@workers-community/workers-types 4.20260417.1 → 4.20260418.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +179 -1
- package/index.ts +179 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -565,7 +565,6 @@ interface CachePurgeError {
|
|
|
565
565
|
}
|
|
566
566
|
interface CachePurgeResult {
|
|
567
567
|
success: boolean;
|
|
568
|
-
zoneTag: string;
|
|
569
568
|
errors: CachePurgeError[];
|
|
570
569
|
}
|
|
571
570
|
interface CachePurgeOptions {
|
|
@@ -11050,6 +11049,185 @@ declare abstract class AiGateway {
|
|
|
11050
11049
|
): Promise<Response>;
|
|
11051
11050
|
getUrl(provider?: AIGatewayProviders | string): Promise<string>; // eslint-disable-line
|
|
11052
11051
|
}
|
|
11052
|
+
// Copyright (c) 2022-2025 Cloudflare, Inc.
|
|
11053
|
+
// Licensed under the Apache 2.0 license found in the LICENSE file or at:
|
|
11054
|
+
// https://opensource.org/licenses/Apache-2.0
|
|
11055
|
+
/**
|
|
11056
|
+
* Artifacts — Git-compatible file storage on Cloudflare Workers.
|
|
11057
|
+
*
|
|
11058
|
+
* Provides programmatic access to create, manage, and fork repositories,
|
|
11059
|
+
* and to issue and revoke scoped access tokens.
|
|
11060
|
+
*/
|
|
11061
|
+
/** Information about a repository. */
|
|
11062
|
+
interface ArtifactsRepoInfo {
|
|
11063
|
+
/** Unique repository ID. */
|
|
11064
|
+
id: string;
|
|
11065
|
+
/** Repository name. */
|
|
11066
|
+
name: string;
|
|
11067
|
+
/** Repository description, or null if not set. */
|
|
11068
|
+
description: string | null;
|
|
11069
|
+
/** Default branch name (e.g. "main"). */
|
|
11070
|
+
defaultBranch: string;
|
|
11071
|
+
/** ISO 8601 creation timestamp. */
|
|
11072
|
+
createdAt: string;
|
|
11073
|
+
/** ISO 8601 last-updated timestamp. */
|
|
11074
|
+
updatedAt: string;
|
|
11075
|
+
/** ISO 8601 timestamp of the last push, or null if never pushed. */
|
|
11076
|
+
lastPushAt: string | null;
|
|
11077
|
+
/** Fork source (e.g. "github:owner/repo", "artifacts:namespace/repo"), or null if not a fork. */
|
|
11078
|
+
source: string | null;
|
|
11079
|
+
/** Whether the repository is read-only. */
|
|
11080
|
+
readOnly: boolean;
|
|
11081
|
+
/** HTTPS git remote URL. */
|
|
11082
|
+
remote: string;
|
|
11083
|
+
}
|
|
11084
|
+
/** Result of creating a repository — includes the initial access token. */
|
|
11085
|
+
interface ArtifactsCreateRepoResult {
|
|
11086
|
+
/** Unique repository ID. */
|
|
11087
|
+
id: string;
|
|
11088
|
+
/** Repository name. */
|
|
11089
|
+
name: string;
|
|
11090
|
+
/** Repository description, or null if not set. */
|
|
11091
|
+
description: string | null;
|
|
11092
|
+
/** Default branch name. */
|
|
11093
|
+
defaultBranch: string;
|
|
11094
|
+
/** HTTPS git remote URL. */
|
|
11095
|
+
remote: string;
|
|
11096
|
+
/** Plaintext access token (only returned at creation time). */
|
|
11097
|
+
token: string;
|
|
11098
|
+
/** ISO 8601 token expiry timestamp. */
|
|
11099
|
+
tokenExpiresAt: string;
|
|
11100
|
+
}
|
|
11101
|
+
/** Paginated list of repositories. */
|
|
11102
|
+
interface ArtifactsRepoListResult {
|
|
11103
|
+
/** Repositories in this page (without the `remote` field). */
|
|
11104
|
+
repos: Omit<ArtifactsRepoInfo, "remote">[];
|
|
11105
|
+
/** Total number of repositories in the namespace. */
|
|
11106
|
+
total: number;
|
|
11107
|
+
/** Cursor for the next page, if there are more results. */
|
|
11108
|
+
cursor?: string;
|
|
11109
|
+
}
|
|
11110
|
+
/** Result of creating an access token. */
|
|
11111
|
+
interface ArtifactsCreateTokenResult {
|
|
11112
|
+
/** Unique token ID. */
|
|
11113
|
+
id: string;
|
|
11114
|
+
/** Plaintext token (only returned at creation time). */
|
|
11115
|
+
plaintext: string;
|
|
11116
|
+
/** Token scope: "read" or "write". */
|
|
11117
|
+
scope: "read" | "write";
|
|
11118
|
+
/** ISO 8601 token expiry timestamp. */
|
|
11119
|
+
expiresAt: string;
|
|
11120
|
+
}
|
|
11121
|
+
/** Token metadata (no plaintext). */
|
|
11122
|
+
interface ArtifactsTokenInfo {
|
|
11123
|
+
/** Unique token ID. */
|
|
11124
|
+
id: string;
|
|
11125
|
+
/** Token scope: "read" or "write". */
|
|
11126
|
+
scope: "read" | "write";
|
|
11127
|
+
/** Token state: "active", "expired", or "revoked". */
|
|
11128
|
+
state: "active" | "expired" | "revoked";
|
|
11129
|
+
/** ISO 8601 creation timestamp. */
|
|
11130
|
+
createdAt: string;
|
|
11131
|
+
/** ISO 8601 expiry timestamp. */
|
|
11132
|
+
expiresAt: string;
|
|
11133
|
+
}
|
|
11134
|
+
/** Paginated list of tokens for a repository. */
|
|
11135
|
+
interface ArtifactsTokenListResult {
|
|
11136
|
+
/** Tokens in this page. */
|
|
11137
|
+
tokens: ArtifactsTokenInfo[];
|
|
11138
|
+
/** Total number of tokens for the repository. */
|
|
11139
|
+
total: number;
|
|
11140
|
+
}
|
|
11141
|
+
/** Handle for a single repository. Returned by Artifacts.get(). */
|
|
11142
|
+
interface ArtifactsRepo extends ArtifactsRepoInfo {
|
|
11143
|
+
/**
|
|
11144
|
+
* Create an access token for this repo.
|
|
11145
|
+
* @param scope Token scope: "write" (default) or "read".
|
|
11146
|
+
* @param ttl Time-to-live in seconds (default 86400, min 60, max 31536000).
|
|
11147
|
+
*/
|
|
11148
|
+
createToken(
|
|
11149
|
+
scope?: "write" | "read",
|
|
11150
|
+
ttl?: number,
|
|
11151
|
+
): Promise<ArtifactsCreateTokenResult>;
|
|
11152
|
+
/** List tokens for this repo (metadata only, no plaintext). */
|
|
11153
|
+
listTokens(): Promise<ArtifactsTokenListResult>;
|
|
11154
|
+
/**
|
|
11155
|
+
* Revoke a token by plaintext or ID.
|
|
11156
|
+
* @param tokenOrId Plaintext token or token ID.
|
|
11157
|
+
* @returns true if revoked, false if not found.
|
|
11158
|
+
*/
|
|
11159
|
+
revokeToken(tokenOrId: string): Promise<boolean>;
|
|
11160
|
+
// ── Fork ──
|
|
11161
|
+
/**
|
|
11162
|
+
* Fork this repo to a new repo.
|
|
11163
|
+
* @param name Target repository name.
|
|
11164
|
+
* @param opts Optional: description, readOnly flag, defaultBranchOnly (default true).
|
|
11165
|
+
*/
|
|
11166
|
+
fork(
|
|
11167
|
+
name: string,
|
|
11168
|
+
opts?: {
|
|
11169
|
+
description?: string;
|
|
11170
|
+
readOnly?: boolean;
|
|
11171
|
+
defaultBranchOnly?: boolean;
|
|
11172
|
+
},
|
|
11173
|
+
): Promise<ArtifactsCreateRepoResult>;
|
|
11174
|
+
}
|
|
11175
|
+
/** Artifacts binding — namespace-level operations. */
|
|
11176
|
+
interface Artifacts {
|
|
11177
|
+
/**
|
|
11178
|
+
* Create a new repository with an initial access token.
|
|
11179
|
+
* @param name Repository name (alphanumeric, dots, hyphens, underscores).
|
|
11180
|
+
* @param opts Optional: readOnly flag, description, default branch name.
|
|
11181
|
+
* @returns Repo metadata with initial token.
|
|
11182
|
+
*/
|
|
11183
|
+
create(
|
|
11184
|
+
name: string,
|
|
11185
|
+
opts?: {
|
|
11186
|
+
readOnly?: boolean;
|
|
11187
|
+
description?: string;
|
|
11188
|
+
setDefaultBranch?: string;
|
|
11189
|
+
},
|
|
11190
|
+
): Promise<ArtifactsCreateRepoResult>;
|
|
11191
|
+
/**
|
|
11192
|
+
* Get a handle to an existing repository.
|
|
11193
|
+
* @param name Repository name.
|
|
11194
|
+
* @returns Repo handle.
|
|
11195
|
+
*/
|
|
11196
|
+
get(name: string): Promise<ArtifactsRepo>;
|
|
11197
|
+
/**
|
|
11198
|
+
* Import a repository from an external git remote.
|
|
11199
|
+
* @param params Source URL and optional branch/depth, plus target name and options.
|
|
11200
|
+
* @returns Repo metadata with initial token.
|
|
11201
|
+
*/
|
|
11202
|
+
import(params: {
|
|
11203
|
+
source: {
|
|
11204
|
+
url: string;
|
|
11205
|
+
branch?: string;
|
|
11206
|
+
depth?: number;
|
|
11207
|
+
};
|
|
11208
|
+
target: {
|
|
11209
|
+
name: string;
|
|
11210
|
+
opts?: {
|
|
11211
|
+
description?: string;
|
|
11212
|
+
readOnly?: boolean;
|
|
11213
|
+
};
|
|
11214
|
+
};
|
|
11215
|
+
}): Promise<ArtifactsCreateRepoResult>;
|
|
11216
|
+
/**
|
|
11217
|
+
* List repositories with cursor-based pagination.
|
|
11218
|
+
* @param opts Optional: limit (1–200, default 50), cursor for next page.
|
|
11219
|
+
*/
|
|
11220
|
+
list(opts?: {
|
|
11221
|
+
limit?: number;
|
|
11222
|
+
cursor?: string;
|
|
11223
|
+
}): Promise<ArtifactsRepoListResult>;
|
|
11224
|
+
/**
|
|
11225
|
+
* Delete a repository and all associated tokens.
|
|
11226
|
+
* @param name Repository name.
|
|
11227
|
+
* @returns true if deleted, false if not found.
|
|
11228
|
+
*/
|
|
11229
|
+
delete(name: string): Promise<boolean>;
|
|
11230
|
+
}
|
|
11053
11231
|
/**
|
|
11054
11232
|
* @deprecated Use the standalone AI Search Workers binding instead.
|
|
11055
11233
|
* See https://developers.cloudflare.com/ai-search/usage/workers-binding/
|
package/index.ts
CHANGED
|
@@ -567,7 +567,6 @@ export interface CachePurgeError {
|
|
|
567
567
|
}
|
|
568
568
|
export interface CachePurgeResult {
|
|
569
569
|
success: boolean;
|
|
570
|
-
zoneTag: string;
|
|
571
570
|
errors: CachePurgeError[];
|
|
572
571
|
}
|
|
573
572
|
export interface CachePurgeOptions {
|
|
@@ -11062,6 +11061,185 @@ export declare abstract class AiGateway {
|
|
|
11062
11061
|
): Promise<Response>;
|
|
11063
11062
|
getUrl(provider?: AIGatewayProviders | string): Promise<string>; // eslint-disable-line
|
|
11064
11063
|
}
|
|
11064
|
+
// Copyright (c) 2022-2025 Cloudflare, Inc.
|
|
11065
|
+
// Licensed under the Apache 2.0 license found in the LICENSE file or at:
|
|
11066
|
+
// https://opensource.org/licenses/Apache-2.0
|
|
11067
|
+
/**
|
|
11068
|
+
* Artifacts — Git-compatible file storage on Cloudflare Workers.
|
|
11069
|
+
*
|
|
11070
|
+
* Provides programmatic access to create, manage, and fork repositories,
|
|
11071
|
+
* and to issue and revoke scoped access tokens.
|
|
11072
|
+
*/
|
|
11073
|
+
/** Information about a repository. */
|
|
11074
|
+
export interface ArtifactsRepoInfo {
|
|
11075
|
+
/** Unique repository ID. */
|
|
11076
|
+
id: string;
|
|
11077
|
+
/** Repository name. */
|
|
11078
|
+
name: string;
|
|
11079
|
+
/** Repository description, or null if not set. */
|
|
11080
|
+
description: string | null;
|
|
11081
|
+
/** Default branch name (e.g. "main"). */
|
|
11082
|
+
defaultBranch: string;
|
|
11083
|
+
/** ISO 8601 creation timestamp. */
|
|
11084
|
+
createdAt: string;
|
|
11085
|
+
/** ISO 8601 last-updated timestamp. */
|
|
11086
|
+
updatedAt: string;
|
|
11087
|
+
/** ISO 8601 timestamp of the last push, or null if never pushed. */
|
|
11088
|
+
lastPushAt: string | null;
|
|
11089
|
+
/** Fork source (e.g. "github:owner/repo", "artifacts:namespace/repo"), or null if not a fork. */
|
|
11090
|
+
source: string | null;
|
|
11091
|
+
/** Whether the repository is read-only. */
|
|
11092
|
+
readOnly: boolean;
|
|
11093
|
+
/** HTTPS git remote URL. */
|
|
11094
|
+
remote: string;
|
|
11095
|
+
}
|
|
11096
|
+
/** Result of creating a repository — includes the initial access token. */
|
|
11097
|
+
export interface ArtifactsCreateRepoResult {
|
|
11098
|
+
/** Unique repository ID. */
|
|
11099
|
+
id: string;
|
|
11100
|
+
/** Repository name. */
|
|
11101
|
+
name: string;
|
|
11102
|
+
/** Repository description, or null if not set. */
|
|
11103
|
+
description: string | null;
|
|
11104
|
+
/** Default branch name. */
|
|
11105
|
+
defaultBranch: string;
|
|
11106
|
+
/** HTTPS git remote URL. */
|
|
11107
|
+
remote: string;
|
|
11108
|
+
/** Plaintext access token (only returned at creation time). */
|
|
11109
|
+
token: string;
|
|
11110
|
+
/** ISO 8601 token expiry timestamp. */
|
|
11111
|
+
tokenExpiresAt: string;
|
|
11112
|
+
}
|
|
11113
|
+
/** Paginated list of repositories. */
|
|
11114
|
+
export interface ArtifactsRepoListResult {
|
|
11115
|
+
/** Repositories in this page (without the `remote` field). */
|
|
11116
|
+
repos: Omit<ArtifactsRepoInfo, "remote">[];
|
|
11117
|
+
/** Total number of repositories in the namespace. */
|
|
11118
|
+
total: number;
|
|
11119
|
+
/** Cursor for the next page, if there are more results. */
|
|
11120
|
+
cursor?: string;
|
|
11121
|
+
}
|
|
11122
|
+
/** Result of creating an access token. */
|
|
11123
|
+
export interface ArtifactsCreateTokenResult {
|
|
11124
|
+
/** Unique token ID. */
|
|
11125
|
+
id: string;
|
|
11126
|
+
/** Plaintext token (only returned at creation time). */
|
|
11127
|
+
plaintext: string;
|
|
11128
|
+
/** Token scope: "read" or "write". */
|
|
11129
|
+
scope: "read" | "write";
|
|
11130
|
+
/** ISO 8601 token expiry timestamp. */
|
|
11131
|
+
expiresAt: string;
|
|
11132
|
+
}
|
|
11133
|
+
/** Token metadata (no plaintext). */
|
|
11134
|
+
export interface ArtifactsTokenInfo {
|
|
11135
|
+
/** Unique token ID. */
|
|
11136
|
+
id: string;
|
|
11137
|
+
/** Token scope: "read" or "write". */
|
|
11138
|
+
scope: "read" | "write";
|
|
11139
|
+
/** Token state: "active", "expired", or "revoked". */
|
|
11140
|
+
state: "active" | "expired" | "revoked";
|
|
11141
|
+
/** ISO 8601 creation timestamp. */
|
|
11142
|
+
createdAt: string;
|
|
11143
|
+
/** ISO 8601 expiry timestamp. */
|
|
11144
|
+
expiresAt: string;
|
|
11145
|
+
}
|
|
11146
|
+
/** Paginated list of tokens for a repository. */
|
|
11147
|
+
export interface ArtifactsTokenListResult {
|
|
11148
|
+
/** Tokens in this page. */
|
|
11149
|
+
tokens: ArtifactsTokenInfo[];
|
|
11150
|
+
/** Total number of tokens for the repository. */
|
|
11151
|
+
total: number;
|
|
11152
|
+
}
|
|
11153
|
+
/** Handle for a single repository. Returned by Artifacts.get(). */
|
|
11154
|
+
export interface ArtifactsRepo extends ArtifactsRepoInfo {
|
|
11155
|
+
/**
|
|
11156
|
+
* Create an access token for this repo.
|
|
11157
|
+
* @param scope Token scope: "write" (default) or "read".
|
|
11158
|
+
* @param ttl Time-to-live in seconds (default 86400, min 60, max 31536000).
|
|
11159
|
+
*/
|
|
11160
|
+
createToken(
|
|
11161
|
+
scope?: "write" | "read",
|
|
11162
|
+
ttl?: number,
|
|
11163
|
+
): Promise<ArtifactsCreateTokenResult>;
|
|
11164
|
+
/** List tokens for this repo (metadata only, no plaintext). */
|
|
11165
|
+
listTokens(): Promise<ArtifactsTokenListResult>;
|
|
11166
|
+
/**
|
|
11167
|
+
* Revoke a token by plaintext or ID.
|
|
11168
|
+
* @param tokenOrId Plaintext token or token ID.
|
|
11169
|
+
* @returns true if revoked, false if not found.
|
|
11170
|
+
*/
|
|
11171
|
+
revokeToken(tokenOrId: string): Promise<boolean>;
|
|
11172
|
+
// ── Fork ──
|
|
11173
|
+
/**
|
|
11174
|
+
* Fork this repo to a new repo.
|
|
11175
|
+
* @param name Target repository name.
|
|
11176
|
+
* @param opts Optional: description, readOnly flag, defaultBranchOnly (default true).
|
|
11177
|
+
*/
|
|
11178
|
+
fork(
|
|
11179
|
+
name: string,
|
|
11180
|
+
opts?: {
|
|
11181
|
+
description?: string;
|
|
11182
|
+
readOnly?: boolean;
|
|
11183
|
+
defaultBranchOnly?: boolean;
|
|
11184
|
+
},
|
|
11185
|
+
): Promise<ArtifactsCreateRepoResult>;
|
|
11186
|
+
}
|
|
11187
|
+
/** Artifacts binding — namespace-level operations. */
|
|
11188
|
+
export interface Artifacts {
|
|
11189
|
+
/**
|
|
11190
|
+
* Create a new repository with an initial access token.
|
|
11191
|
+
* @param name Repository name (alphanumeric, dots, hyphens, underscores).
|
|
11192
|
+
* @param opts Optional: readOnly flag, description, default branch name.
|
|
11193
|
+
* @returns Repo metadata with initial token.
|
|
11194
|
+
*/
|
|
11195
|
+
create(
|
|
11196
|
+
name: string,
|
|
11197
|
+
opts?: {
|
|
11198
|
+
readOnly?: boolean;
|
|
11199
|
+
description?: string;
|
|
11200
|
+
setDefaultBranch?: string;
|
|
11201
|
+
},
|
|
11202
|
+
): Promise<ArtifactsCreateRepoResult>;
|
|
11203
|
+
/**
|
|
11204
|
+
* Get a handle to an existing repository.
|
|
11205
|
+
* @param name Repository name.
|
|
11206
|
+
* @returns Repo handle.
|
|
11207
|
+
*/
|
|
11208
|
+
get(name: string): Promise<ArtifactsRepo>;
|
|
11209
|
+
/**
|
|
11210
|
+
* Import a repository from an external git remote.
|
|
11211
|
+
* @param params Source URL and optional branch/depth, plus target name and options.
|
|
11212
|
+
* @returns Repo metadata with initial token.
|
|
11213
|
+
*/
|
|
11214
|
+
import(params: {
|
|
11215
|
+
source: {
|
|
11216
|
+
url: string;
|
|
11217
|
+
branch?: string;
|
|
11218
|
+
depth?: number;
|
|
11219
|
+
};
|
|
11220
|
+
target: {
|
|
11221
|
+
name: string;
|
|
11222
|
+
opts?: {
|
|
11223
|
+
description?: string;
|
|
11224
|
+
readOnly?: boolean;
|
|
11225
|
+
};
|
|
11226
|
+
};
|
|
11227
|
+
}): Promise<ArtifactsCreateRepoResult>;
|
|
11228
|
+
/**
|
|
11229
|
+
* List repositories with cursor-based pagination.
|
|
11230
|
+
* @param opts Optional: limit (1–200, default 50), cursor for next page.
|
|
11231
|
+
*/
|
|
11232
|
+
list(opts?: {
|
|
11233
|
+
limit?: number;
|
|
11234
|
+
cursor?: string;
|
|
11235
|
+
}): Promise<ArtifactsRepoListResult>;
|
|
11236
|
+
/**
|
|
11237
|
+
* Delete a repository and all associated tokens.
|
|
11238
|
+
* @param name Repository name.
|
|
11239
|
+
* @returns true if deleted, false if not found.
|
|
11240
|
+
*/
|
|
11241
|
+
delete(name: string): Promise<boolean>;
|
|
11242
|
+
}
|
|
11065
11243
|
/**
|
|
11066
11244
|
* @deprecated Use the standalone AI Search Workers binding instead.
|
|
11067
11245
|
* See https://developers.cloudflare.com/ai-search/usage/workers-binding/
|