Skip to content

Commit 8fb2e7c

Browse files
committed
chore: update worker-configuration.d.ts
1 parent 52e6190 commit 8fb2e7c

1 file changed

Lines changed: 62 additions & 9 deletions

File tree

worker-configuration.d.ts

Lines changed: 62 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
/* eslint-disable */
2-
// Generated by Wrangler by running `wrangler types` (hash: c7746b7b9512a492050296060eeb0a4b)
3-
// Runtime types generated with workerd@1.20260508.1 2025-10-17 nodejs_compat
2+
// Generated by Wrangler by running `wrangler types` (hash: ad94e3d4f0b09e36a00ce199c5a61442)
3+
// Runtime types generated with workerd@1.20260518.1 2025-10-17 nodejs_compat
4+
interface __BaseEnv_Env {
5+
WEBSITE_CACHE: KVNamespace;
6+
ASSETS: Fetcher;
7+
}
48
declare namespace Cloudflare {
59
interface GlobalProps {
610
mainModule: typeof import("./src/worker");
711
}
8-
interface Env {
9-
WEBSITE_CACHE: KVNamespace;
10-
ASSETS: Fetcher;
11-
}
12+
interface Env extends __BaseEnv_Env {}
1213
}
13-
interface Env extends Cloudflare.Env {}
14+
interface Env extends __BaseEnv_Env {}
1415

1516
// Begin runtime types
1617
/*! *****************************************************************************
@@ -10129,12 +10130,17 @@ interface ArtifactsTokenListResult {
1012910130
/** Total number of tokens for the repository. */
1013010131
total: number;
1013110132
}
10132-
/** Handle for a single repository. Returned by Artifacts.get(). */
10133+
/**
10134+
* Handle for a single repository. Returned by Artifacts.get().
10135+
*
10136+
* Methods may throw `ArtifactsError` with code `INTERNAL_ERROR` if an unexpected service error occurs.
10137+
*/
1013310138
interface ArtifactsRepo extends ArtifactsRepoInfo {
1013410139
/**
1013510140
* Create an access token for this repo.
1013610141
* @param scope Token scope: "write" (default) or "read".
1013710142
* @param ttl Time-to-live in seconds (default 86400, min 60, max 31536000).
10143+
* @throws {ArtifactsError} with code `INVALID_TTL` if ttl is out of range.
1013810144
*/
1013910145
createToken(scope?: 'write' | 'read', ttl?: number): Promise<ArtifactsCreateTokenResult>;
1014010146
/** List tokens for this repo (metadata only, no plaintext). */
@@ -10143,27 +10149,59 @@ interface ArtifactsRepo extends ArtifactsRepoInfo {
1014310149
* Revoke a token by plaintext or ID.
1014410150
* @param tokenOrId Plaintext token or token ID.
1014510151
* @returns true if revoked, false if not found.
10152+
* @throws {ArtifactsError} with code `INVALID_INPUT` if tokenOrId is empty.
1014610153
*/
1014710154
revokeToken(tokenOrId: string): Promise<boolean>;
1014810155
// ── Fork ──
1014910156
/**
1015010157
* Fork this repo to a new repo.
1015110158
* @param name Target repository name.
1015210159
* @param opts Optional: description, readOnly flag, defaultBranchOnly (default true).
10160+
* @throws {ArtifactsError} with code `INVALID_REPO_NAME` if name is invalid.
10161+
* @throws {ArtifactsError} with code `ALREADY_EXISTS` if the target repo already exists.
10162+
* @throws {ArtifactsError} with code `FORK_IN_PROGRESS` if a fork is already running.
1015310163
*/
1015410164
fork(name: string, opts?: {
1015510165
description?: string;
1015610166
readOnly?: boolean;
1015710167
defaultBranchOnly?: boolean;
1015810168
}): Promise<ArtifactsCreateRepoResult>;
1015910169
}
10160-
/** Artifacts binding — namespace-level operations. */
10170+
// ── Error types ──────────────────────────────────────────────────────────────
10171+
/**
10172+
* Error codes returned by Artifacts binding operations.
10173+
*
10174+
* Each code maps to a numeric code available on `ArtifactsError.numericCode`.
10175+
*/
10176+
type ArtifactsErrorCode = 'ALREADY_EXISTS' | 'NOT_FOUND' | 'IMPORT_IN_PROGRESS' | 'FORK_IN_PROGRESS' | 'INVALID_INPUT' | 'INVALID_REPO_NAME' | 'INVALID_TTL' | 'INVALID_URL' | 'REMOTE_AUTH_REQUIRED' | 'UPSTREAM_UNAVAILABLE' | 'MEMORY_LIMIT' | 'INTERNAL_ERROR';
10177+
/**
10178+
* Error thrown by Artifacts binding operations.
10179+
*
10180+
* Uses a string `.code` discriminator following the Cloudflare platform
10181+
* convention (StreamError, ImagesError, etc.). The `.numericCode` matches
10182+
* the REST API `errors[].code` values.
10183+
*/
10184+
interface ArtifactsError extends Error {
10185+
readonly name: 'ArtifactsError';
10186+
/** String error code for programmatic matching. */
10187+
readonly code: ArtifactsErrorCode;
10188+
/** Numeric error code matching the REST API. */
10189+
readonly numericCode: number;
10190+
}
10191+
// ── Binding ──────────────────────────────────────────────────────────────────
10192+
/**
10193+
* Artifacts binding — namespace-level operations.
10194+
*
10195+
* Methods may throw `ArtifactsError` with code `INTERNAL_ERROR` if an unexpected service error occurs.
10196+
*/
1016110197
interface Artifacts {
1016210198
/**
1016310199
* Create a new repository with an initial access token.
1016410200
* @param name Repository name (alphanumeric, dots, hyphens, underscores).
1016510201
* @param opts Optional: readOnly flag, description, default branch name.
1016610202
* @returns Repo metadata with initial token.
10203+
* @throws {ArtifactsError} with code `INVALID_REPO_NAME` if name is invalid.
10204+
* @throws {ArtifactsError} with code `ALREADY_EXISTS` if the repo already exists.
1016710205
*/
1016810206
create(name: string, opts?: {
1016910207
readOnly?: boolean;
@@ -10174,12 +10212,23 @@ interface Artifacts {
1017410212
* Get a handle to an existing repository.
1017510213
* @param name Repository name.
1017610214
* @returns Repo handle.
10215+
* @throws {ArtifactsError} with code `NOT_FOUND` if the repo does not exist.
10216+
* @throws {ArtifactsError} with code `IMPORT_IN_PROGRESS` if the repo is still importing.
10217+
* @throws {ArtifactsError} with code `FORK_IN_PROGRESS` if the repo is still forking.
1017710218
*/
1017810219
get(name: string): Promise<ArtifactsRepo>;
1017910220
/**
1018010221
* Import a repository from an external git remote.
1018110222
* @param params Source URL and optional branch/depth, plus target name and options.
1018210223
* @returns Repo metadata with initial token.
10224+
* @throws {ArtifactsError} with code `INVALID_REPO_NAME` if the target name is invalid.
10225+
* @throws {ArtifactsError} with code `INVALID_INPUT` if the source URL is not valid HTTPS.
10226+
* @throws {ArtifactsError} with code `INVALID_URL` if the source URL does not point to a git repository.
10227+
* @throws {ArtifactsError} with code `REMOTE_AUTH_REQUIRED` if the remote requires authentication.
10228+
* @throws {ArtifactsError} with code `NOT_FOUND` if the remote repository does not exist.
10229+
* @throws {ArtifactsError} with code `UPSTREAM_UNAVAILABLE` if the remote cannot be reached.
10230+
* @throws {ArtifactsError} with code `MEMORY_LIMIT` if the import exceeds service memory limits.
10231+
* @throws {ArtifactsError} with code `ALREADY_EXISTS` if the target repo already exists.
1018310232
*/
1018410233
import(params: {
1018510234
source: {
@@ -10207,6 +10256,7 @@ interface Artifacts {
1020710256
* Delete a repository and all associated tokens.
1020810257
* @param name Repository name.
1020910258
* @returns true if deleted, false if not found.
10259+
* @throws {ArtifactsError} with code `INVALID_REPO_NAME` if name is invalid.
1021010260
*/
1021110261
delete(name: string): Promise<boolean>;
1021210262
}
@@ -13144,6 +13194,9 @@ declare namespace TailStream {
1314413194
// 1. This is an Onset event
1314513195
// 2. We are not inheriting any SpanContext. (e.g. this is a cross-account service binding or a new top-level invocation)
1314613196
readonly spanId?: string;
13197+
// W3C trace flags from an upstream traceparent. Absent when no upstream
13198+
// sampling decision was made.
13199+
readonly traceFlags?: number;
1314713200
}
1314813201
interface TailEvent<Event extends EventType> {
1314913202
// invocation id of the currently invoked worker stage.

0 commit comments

Comments
 (0)