@cloudflare/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/2021-11-03/index.d.ts +179 -1
- package/2021-11-03/index.ts +179 -1
- package/2022-01-31/index.d.ts +179 -1
- package/2022-01-31/index.ts +179 -1
- package/2022-03-21/index.d.ts +179 -1
- package/2022-03-21/index.ts +179 -1
- package/2022-08-04/index.d.ts +179 -1
- package/2022-08-04/index.ts +179 -1
- package/2022-10-31/index.d.ts +179 -1
- package/2022-10-31/index.ts +179 -1
- package/2022-11-30/index.d.ts +179 -1
- package/2022-11-30/index.ts +179 -1
- package/2023-03-01/index.d.ts +179 -1
- package/2023-03-01/index.ts +179 -1
- package/2023-07-01/index.d.ts +179 -1
- package/2023-07-01/index.ts +179 -1
- package/experimental/index.d.ts +185 -1
- package/experimental/index.ts +185 -1
- package/index.d.ts +179 -1
- package/index.ts +179 -1
- package/latest/index.d.ts +179 -1
- package/latest/index.ts +179 -1
- package/oldest/index.d.ts +179 -1
- package/oldest/index.ts +179 -1
- package/package.json +1 -1
package/2022-08-04/index.d.ts
CHANGED
|
@@ -560,7 +560,6 @@ interface CachePurgeError {
|
|
|
560
560
|
}
|
|
561
561
|
interface CachePurgeResult {
|
|
562
562
|
success: boolean;
|
|
563
|
-
zoneTag: string;
|
|
564
563
|
errors: CachePurgeError[];
|
|
565
564
|
}
|
|
566
565
|
interface CachePurgeOptions {
|
|
@@ -11019,6 +11018,185 @@ declare abstract class AiGateway {
|
|
|
11019
11018
|
): Promise<Response>;
|
|
11020
11019
|
getUrl(provider?: AIGatewayProviders | string): Promise<string>; // eslint-disable-line
|
|
11021
11020
|
}
|
|
11021
|
+
// Copyright (c) 2022-2025 Cloudflare, Inc.
|
|
11022
|
+
// Licensed under the Apache 2.0 license found in the LICENSE file or at:
|
|
11023
|
+
// https://opensource.org/licenses/Apache-2.0
|
|
11024
|
+
/**
|
|
11025
|
+
* Artifacts — Git-compatible file storage on Cloudflare Workers.
|
|
11026
|
+
*
|
|
11027
|
+
* Provides programmatic access to create, manage, and fork repositories,
|
|
11028
|
+
* and to issue and revoke scoped access tokens.
|
|
11029
|
+
*/
|
|
11030
|
+
/** Information about a repository. */
|
|
11031
|
+
interface ArtifactsRepoInfo {
|
|
11032
|
+
/** Unique repository ID. */
|
|
11033
|
+
id: string;
|
|
11034
|
+
/** Repository name. */
|
|
11035
|
+
name: string;
|
|
11036
|
+
/** Repository description, or null if not set. */
|
|
11037
|
+
description: string | null;
|
|
11038
|
+
/** Default branch name (e.g. "main"). */
|
|
11039
|
+
defaultBranch: string;
|
|
11040
|
+
/** ISO 8601 creation timestamp. */
|
|
11041
|
+
createdAt: string;
|
|
11042
|
+
/** ISO 8601 last-updated timestamp. */
|
|
11043
|
+
updatedAt: string;
|
|
11044
|
+
/** ISO 8601 timestamp of the last push, or null if never pushed. */
|
|
11045
|
+
lastPushAt: string | null;
|
|
11046
|
+
/** Fork source (e.g. "github:owner/repo", "artifacts:namespace/repo"), or null if not a fork. */
|
|
11047
|
+
source: string | null;
|
|
11048
|
+
/** Whether the repository is read-only. */
|
|
11049
|
+
readOnly: boolean;
|
|
11050
|
+
/** HTTPS git remote URL. */
|
|
11051
|
+
remote: string;
|
|
11052
|
+
}
|
|
11053
|
+
/** Result of creating a repository — includes the initial access token. */
|
|
11054
|
+
interface ArtifactsCreateRepoResult {
|
|
11055
|
+
/** Unique repository ID. */
|
|
11056
|
+
id: string;
|
|
11057
|
+
/** Repository name. */
|
|
11058
|
+
name: string;
|
|
11059
|
+
/** Repository description, or null if not set. */
|
|
11060
|
+
description: string | null;
|
|
11061
|
+
/** Default branch name. */
|
|
11062
|
+
defaultBranch: string;
|
|
11063
|
+
/** HTTPS git remote URL. */
|
|
11064
|
+
remote: string;
|
|
11065
|
+
/** Plaintext access token (only returned at creation time). */
|
|
11066
|
+
token: string;
|
|
11067
|
+
/** ISO 8601 token expiry timestamp. */
|
|
11068
|
+
tokenExpiresAt: string;
|
|
11069
|
+
}
|
|
11070
|
+
/** Paginated list of repositories. */
|
|
11071
|
+
interface ArtifactsRepoListResult {
|
|
11072
|
+
/** Repositories in this page (without the `remote` field). */
|
|
11073
|
+
repos: Omit<ArtifactsRepoInfo, "remote">[];
|
|
11074
|
+
/** Total number of repositories in the namespace. */
|
|
11075
|
+
total: number;
|
|
11076
|
+
/** Cursor for the next page, if there are more results. */
|
|
11077
|
+
cursor?: string;
|
|
11078
|
+
}
|
|
11079
|
+
/** Result of creating an access token. */
|
|
11080
|
+
interface ArtifactsCreateTokenResult {
|
|
11081
|
+
/** Unique token ID. */
|
|
11082
|
+
id: string;
|
|
11083
|
+
/** Plaintext token (only returned at creation time). */
|
|
11084
|
+
plaintext: string;
|
|
11085
|
+
/** Token scope: "read" or "write". */
|
|
11086
|
+
scope: "read" | "write";
|
|
11087
|
+
/** ISO 8601 token expiry timestamp. */
|
|
11088
|
+
expiresAt: string;
|
|
11089
|
+
}
|
|
11090
|
+
/** Token metadata (no plaintext). */
|
|
11091
|
+
interface ArtifactsTokenInfo {
|
|
11092
|
+
/** Unique token ID. */
|
|
11093
|
+
id: string;
|
|
11094
|
+
/** Token scope: "read" or "write". */
|
|
11095
|
+
scope: "read" | "write";
|
|
11096
|
+
/** Token state: "active", "expired", or "revoked". */
|
|
11097
|
+
state: "active" | "expired" | "revoked";
|
|
11098
|
+
/** ISO 8601 creation timestamp. */
|
|
11099
|
+
createdAt: string;
|
|
11100
|
+
/** ISO 8601 expiry timestamp. */
|
|
11101
|
+
expiresAt: string;
|
|
11102
|
+
}
|
|
11103
|
+
/** Paginated list of tokens for a repository. */
|
|
11104
|
+
interface ArtifactsTokenListResult {
|
|
11105
|
+
/** Tokens in this page. */
|
|
11106
|
+
tokens: ArtifactsTokenInfo[];
|
|
11107
|
+
/** Total number of tokens for the repository. */
|
|
11108
|
+
total: number;
|
|
11109
|
+
}
|
|
11110
|
+
/** Handle for a single repository. Returned by Artifacts.get(). */
|
|
11111
|
+
interface ArtifactsRepo extends ArtifactsRepoInfo {
|
|
11112
|
+
/**
|
|
11113
|
+
* Create an access token for this repo.
|
|
11114
|
+
* @param scope Token scope: "write" (default) or "read".
|
|
11115
|
+
* @param ttl Time-to-live in seconds (default 86400, min 60, max 31536000).
|
|
11116
|
+
*/
|
|
11117
|
+
createToken(
|
|
11118
|
+
scope?: "write" | "read",
|
|
11119
|
+
ttl?: number,
|
|
11120
|
+
): Promise<ArtifactsCreateTokenResult>;
|
|
11121
|
+
/** List tokens for this repo (metadata only, no plaintext). */
|
|
11122
|
+
listTokens(): Promise<ArtifactsTokenListResult>;
|
|
11123
|
+
/**
|
|
11124
|
+
* Revoke a token by plaintext or ID.
|
|
11125
|
+
* @param tokenOrId Plaintext token or token ID.
|
|
11126
|
+
* @returns true if revoked, false if not found.
|
|
11127
|
+
*/
|
|
11128
|
+
revokeToken(tokenOrId: string): Promise<boolean>;
|
|
11129
|
+
// ── Fork ──
|
|
11130
|
+
/**
|
|
11131
|
+
* Fork this repo to a new repo.
|
|
11132
|
+
* @param name Target repository name.
|
|
11133
|
+
* @param opts Optional: description, readOnly flag, defaultBranchOnly (default true).
|
|
11134
|
+
*/
|
|
11135
|
+
fork(
|
|
11136
|
+
name: string,
|
|
11137
|
+
opts?: {
|
|
11138
|
+
description?: string;
|
|
11139
|
+
readOnly?: boolean;
|
|
11140
|
+
defaultBranchOnly?: boolean;
|
|
11141
|
+
},
|
|
11142
|
+
): Promise<ArtifactsCreateRepoResult>;
|
|
11143
|
+
}
|
|
11144
|
+
/** Artifacts binding — namespace-level operations. */
|
|
11145
|
+
interface Artifacts {
|
|
11146
|
+
/**
|
|
11147
|
+
* Create a new repository with an initial access token.
|
|
11148
|
+
* @param name Repository name (alphanumeric, dots, hyphens, underscores).
|
|
11149
|
+
* @param opts Optional: readOnly flag, description, default branch name.
|
|
11150
|
+
* @returns Repo metadata with initial token.
|
|
11151
|
+
*/
|
|
11152
|
+
create(
|
|
11153
|
+
name: string,
|
|
11154
|
+
opts?: {
|
|
11155
|
+
readOnly?: boolean;
|
|
11156
|
+
description?: string;
|
|
11157
|
+
setDefaultBranch?: string;
|
|
11158
|
+
},
|
|
11159
|
+
): Promise<ArtifactsCreateRepoResult>;
|
|
11160
|
+
/**
|
|
11161
|
+
* Get a handle to an existing repository.
|
|
11162
|
+
* @param name Repository name.
|
|
11163
|
+
* @returns Repo handle.
|
|
11164
|
+
*/
|
|
11165
|
+
get(name: string): Promise<ArtifactsRepo>;
|
|
11166
|
+
/**
|
|
11167
|
+
* Import a repository from an external git remote.
|
|
11168
|
+
* @param params Source URL and optional branch/depth, plus target name and options.
|
|
11169
|
+
* @returns Repo metadata with initial token.
|
|
11170
|
+
*/
|
|
11171
|
+
import(params: {
|
|
11172
|
+
source: {
|
|
11173
|
+
url: string;
|
|
11174
|
+
branch?: string;
|
|
11175
|
+
depth?: number;
|
|
11176
|
+
};
|
|
11177
|
+
target: {
|
|
11178
|
+
name: string;
|
|
11179
|
+
opts?: {
|
|
11180
|
+
description?: string;
|
|
11181
|
+
readOnly?: boolean;
|
|
11182
|
+
};
|
|
11183
|
+
};
|
|
11184
|
+
}): Promise<ArtifactsCreateRepoResult>;
|
|
11185
|
+
/**
|
|
11186
|
+
* List repositories with cursor-based pagination.
|
|
11187
|
+
* @param opts Optional: limit (1–200, default 50), cursor for next page.
|
|
11188
|
+
*/
|
|
11189
|
+
list(opts?: {
|
|
11190
|
+
limit?: number;
|
|
11191
|
+
cursor?: string;
|
|
11192
|
+
}): Promise<ArtifactsRepoListResult>;
|
|
11193
|
+
/**
|
|
11194
|
+
* Delete a repository and all associated tokens.
|
|
11195
|
+
* @param name Repository name.
|
|
11196
|
+
* @returns true if deleted, false if not found.
|
|
11197
|
+
*/
|
|
11198
|
+
delete(name: string): Promise<boolean>;
|
|
11199
|
+
}
|
|
11022
11200
|
/**
|
|
11023
11201
|
* @deprecated Use the standalone AI Search Workers binding instead.
|
|
11024
11202
|
* See https://developers.cloudflare.com/ai-search/usage/workers-binding/
|
package/2022-08-04/index.ts
CHANGED
|
@@ -562,7 +562,6 @@ export interface CachePurgeError {
|
|
|
562
562
|
}
|
|
563
563
|
export interface CachePurgeResult {
|
|
564
564
|
success: boolean;
|
|
565
|
-
zoneTag: string;
|
|
566
565
|
errors: CachePurgeError[];
|
|
567
566
|
}
|
|
568
567
|
export interface CachePurgeOptions {
|
|
@@ -11031,6 +11030,185 @@ export declare abstract class AiGateway {
|
|
|
11031
11030
|
): Promise<Response>;
|
|
11032
11031
|
getUrl(provider?: AIGatewayProviders | string): Promise<string>; // eslint-disable-line
|
|
11033
11032
|
}
|
|
11033
|
+
// Copyright (c) 2022-2025 Cloudflare, Inc.
|
|
11034
|
+
// Licensed under the Apache 2.0 license found in the LICENSE file or at:
|
|
11035
|
+
// https://opensource.org/licenses/Apache-2.0
|
|
11036
|
+
/**
|
|
11037
|
+
* Artifacts — Git-compatible file storage on Cloudflare Workers.
|
|
11038
|
+
*
|
|
11039
|
+
* Provides programmatic access to create, manage, and fork repositories,
|
|
11040
|
+
* and to issue and revoke scoped access tokens.
|
|
11041
|
+
*/
|
|
11042
|
+
/** Information about a repository. */
|
|
11043
|
+
export interface ArtifactsRepoInfo {
|
|
11044
|
+
/** Unique repository ID. */
|
|
11045
|
+
id: string;
|
|
11046
|
+
/** Repository name. */
|
|
11047
|
+
name: string;
|
|
11048
|
+
/** Repository description, or null if not set. */
|
|
11049
|
+
description: string | null;
|
|
11050
|
+
/** Default branch name (e.g. "main"). */
|
|
11051
|
+
defaultBranch: string;
|
|
11052
|
+
/** ISO 8601 creation timestamp. */
|
|
11053
|
+
createdAt: string;
|
|
11054
|
+
/** ISO 8601 last-updated timestamp. */
|
|
11055
|
+
updatedAt: string;
|
|
11056
|
+
/** ISO 8601 timestamp of the last push, or null if never pushed. */
|
|
11057
|
+
lastPushAt: string | null;
|
|
11058
|
+
/** Fork source (e.g. "github:owner/repo", "artifacts:namespace/repo"), or null if not a fork. */
|
|
11059
|
+
source: string | null;
|
|
11060
|
+
/** Whether the repository is read-only. */
|
|
11061
|
+
readOnly: boolean;
|
|
11062
|
+
/** HTTPS git remote URL. */
|
|
11063
|
+
remote: string;
|
|
11064
|
+
}
|
|
11065
|
+
/** Result of creating a repository — includes the initial access token. */
|
|
11066
|
+
export interface ArtifactsCreateRepoResult {
|
|
11067
|
+
/** Unique repository ID. */
|
|
11068
|
+
id: string;
|
|
11069
|
+
/** Repository name. */
|
|
11070
|
+
name: string;
|
|
11071
|
+
/** Repository description, or null if not set. */
|
|
11072
|
+
description: string | null;
|
|
11073
|
+
/** Default branch name. */
|
|
11074
|
+
defaultBranch: string;
|
|
11075
|
+
/** HTTPS git remote URL. */
|
|
11076
|
+
remote: string;
|
|
11077
|
+
/** Plaintext access token (only returned at creation time). */
|
|
11078
|
+
token: string;
|
|
11079
|
+
/** ISO 8601 token expiry timestamp. */
|
|
11080
|
+
tokenExpiresAt: string;
|
|
11081
|
+
}
|
|
11082
|
+
/** Paginated list of repositories. */
|
|
11083
|
+
export interface ArtifactsRepoListResult {
|
|
11084
|
+
/** Repositories in this page (without the `remote` field). */
|
|
11085
|
+
repos: Omit<ArtifactsRepoInfo, "remote">[];
|
|
11086
|
+
/** Total number of repositories in the namespace. */
|
|
11087
|
+
total: number;
|
|
11088
|
+
/** Cursor for the next page, if there are more results. */
|
|
11089
|
+
cursor?: string;
|
|
11090
|
+
}
|
|
11091
|
+
/** Result of creating an access token. */
|
|
11092
|
+
export interface ArtifactsCreateTokenResult {
|
|
11093
|
+
/** Unique token ID. */
|
|
11094
|
+
id: string;
|
|
11095
|
+
/** Plaintext token (only returned at creation time). */
|
|
11096
|
+
plaintext: string;
|
|
11097
|
+
/** Token scope: "read" or "write". */
|
|
11098
|
+
scope: "read" | "write";
|
|
11099
|
+
/** ISO 8601 token expiry timestamp. */
|
|
11100
|
+
expiresAt: string;
|
|
11101
|
+
}
|
|
11102
|
+
/** Token metadata (no plaintext). */
|
|
11103
|
+
export interface ArtifactsTokenInfo {
|
|
11104
|
+
/** Unique token ID. */
|
|
11105
|
+
id: string;
|
|
11106
|
+
/** Token scope: "read" or "write". */
|
|
11107
|
+
scope: "read" | "write";
|
|
11108
|
+
/** Token state: "active", "expired", or "revoked". */
|
|
11109
|
+
state: "active" | "expired" | "revoked";
|
|
11110
|
+
/** ISO 8601 creation timestamp. */
|
|
11111
|
+
createdAt: string;
|
|
11112
|
+
/** ISO 8601 expiry timestamp. */
|
|
11113
|
+
expiresAt: string;
|
|
11114
|
+
}
|
|
11115
|
+
/** Paginated list of tokens for a repository. */
|
|
11116
|
+
export interface ArtifactsTokenListResult {
|
|
11117
|
+
/** Tokens in this page. */
|
|
11118
|
+
tokens: ArtifactsTokenInfo[];
|
|
11119
|
+
/** Total number of tokens for the repository. */
|
|
11120
|
+
total: number;
|
|
11121
|
+
}
|
|
11122
|
+
/** Handle for a single repository. Returned by Artifacts.get(). */
|
|
11123
|
+
export interface ArtifactsRepo extends ArtifactsRepoInfo {
|
|
11124
|
+
/**
|
|
11125
|
+
* Create an access token for this repo.
|
|
11126
|
+
* @param scope Token scope: "write" (default) or "read".
|
|
11127
|
+
* @param ttl Time-to-live in seconds (default 86400, min 60, max 31536000).
|
|
11128
|
+
*/
|
|
11129
|
+
createToken(
|
|
11130
|
+
scope?: "write" | "read",
|
|
11131
|
+
ttl?: number,
|
|
11132
|
+
): Promise<ArtifactsCreateTokenResult>;
|
|
11133
|
+
/** List tokens for this repo (metadata only, no plaintext). */
|
|
11134
|
+
listTokens(): Promise<ArtifactsTokenListResult>;
|
|
11135
|
+
/**
|
|
11136
|
+
* Revoke a token by plaintext or ID.
|
|
11137
|
+
* @param tokenOrId Plaintext token or token ID.
|
|
11138
|
+
* @returns true if revoked, false if not found.
|
|
11139
|
+
*/
|
|
11140
|
+
revokeToken(tokenOrId: string): Promise<boolean>;
|
|
11141
|
+
// ── Fork ──
|
|
11142
|
+
/**
|
|
11143
|
+
* Fork this repo to a new repo.
|
|
11144
|
+
* @param name Target repository name.
|
|
11145
|
+
* @param opts Optional: description, readOnly flag, defaultBranchOnly (default true).
|
|
11146
|
+
*/
|
|
11147
|
+
fork(
|
|
11148
|
+
name: string,
|
|
11149
|
+
opts?: {
|
|
11150
|
+
description?: string;
|
|
11151
|
+
readOnly?: boolean;
|
|
11152
|
+
defaultBranchOnly?: boolean;
|
|
11153
|
+
},
|
|
11154
|
+
): Promise<ArtifactsCreateRepoResult>;
|
|
11155
|
+
}
|
|
11156
|
+
/** Artifacts binding — namespace-level operations. */
|
|
11157
|
+
export interface Artifacts {
|
|
11158
|
+
/**
|
|
11159
|
+
* Create a new repository with an initial access token.
|
|
11160
|
+
* @param name Repository name (alphanumeric, dots, hyphens, underscores).
|
|
11161
|
+
* @param opts Optional: readOnly flag, description, default branch name.
|
|
11162
|
+
* @returns Repo metadata with initial token.
|
|
11163
|
+
*/
|
|
11164
|
+
create(
|
|
11165
|
+
name: string,
|
|
11166
|
+
opts?: {
|
|
11167
|
+
readOnly?: boolean;
|
|
11168
|
+
description?: string;
|
|
11169
|
+
setDefaultBranch?: string;
|
|
11170
|
+
},
|
|
11171
|
+
): Promise<ArtifactsCreateRepoResult>;
|
|
11172
|
+
/**
|
|
11173
|
+
* Get a handle to an existing repository.
|
|
11174
|
+
* @param name Repository name.
|
|
11175
|
+
* @returns Repo handle.
|
|
11176
|
+
*/
|
|
11177
|
+
get(name: string): Promise<ArtifactsRepo>;
|
|
11178
|
+
/**
|
|
11179
|
+
* Import a repository from an external git remote.
|
|
11180
|
+
* @param params Source URL and optional branch/depth, plus target name and options.
|
|
11181
|
+
* @returns Repo metadata with initial token.
|
|
11182
|
+
*/
|
|
11183
|
+
import(params: {
|
|
11184
|
+
source: {
|
|
11185
|
+
url: string;
|
|
11186
|
+
branch?: string;
|
|
11187
|
+
depth?: number;
|
|
11188
|
+
};
|
|
11189
|
+
target: {
|
|
11190
|
+
name: string;
|
|
11191
|
+
opts?: {
|
|
11192
|
+
description?: string;
|
|
11193
|
+
readOnly?: boolean;
|
|
11194
|
+
};
|
|
11195
|
+
};
|
|
11196
|
+
}): Promise<ArtifactsCreateRepoResult>;
|
|
11197
|
+
/**
|
|
11198
|
+
* List repositories with cursor-based pagination.
|
|
11199
|
+
* @param opts Optional: limit (1–200, default 50), cursor for next page.
|
|
11200
|
+
*/
|
|
11201
|
+
list(opts?: {
|
|
11202
|
+
limit?: number;
|
|
11203
|
+
cursor?: string;
|
|
11204
|
+
}): Promise<ArtifactsRepoListResult>;
|
|
11205
|
+
/**
|
|
11206
|
+
* Delete a repository and all associated tokens.
|
|
11207
|
+
* @param name Repository name.
|
|
11208
|
+
* @returns true if deleted, false if not found.
|
|
11209
|
+
*/
|
|
11210
|
+
delete(name: string): Promise<boolean>;
|
|
11211
|
+
}
|
|
11034
11212
|
/**
|
|
11035
11213
|
* @deprecated Use the standalone AI Search Workers binding instead.
|
|
11036
11214
|
* See https://developers.cloudflare.com/ai-search/usage/workers-binding/
|
package/2022-10-31/index.d.ts
CHANGED
|
@@ -560,7 +560,6 @@ interface CachePurgeError {
|
|
|
560
560
|
}
|
|
561
561
|
interface CachePurgeResult {
|
|
562
562
|
success: boolean;
|
|
563
|
-
zoneTag: string;
|
|
564
563
|
errors: CachePurgeError[];
|
|
565
564
|
}
|
|
566
565
|
interface CachePurgeOptions {
|
|
@@ -11039,6 +11038,185 @@ declare abstract class AiGateway {
|
|
|
11039
11038
|
): Promise<Response>;
|
|
11040
11039
|
getUrl(provider?: AIGatewayProviders | string): Promise<string>; // eslint-disable-line
|
|
11041
11040
|
}
|
|
11041
|
+
// Copyright (c) 2022-2025 Cloudflare, Inc.
|
|
11042
|
+
// Licensed under the Apache 2.0 license found in the LICENSE file or at:
|
|
11043
|
+
// https://opensource.org/licenses/Apache-2.0
|
|
11044
|
+
/**
|
|
11045
|
+
* Artifacts — Git-compatible file storage on Cloudflare Workers.
|
|
11046
|
+
*
|
|
11047
|
+
* Provides programmatic access to create, manage, and fork repositories,
|
|
11048
|
+
* and to issue and revoke scoped access tokens.
|
|
11049
|
+
*/
|
|
11050
|
+
/** Information about a repository. */
|
|
11051
|
+
interface ArtifactsRepoInfo {
|
|
11052
|
+
/** Unique repository ID. */
|
|
11053
|
+
id: string;
|
|
11054
|
+
/** Repository name. */
|
|
11055
|
+
name: string;
|
|
11056
|
+
/** Repository description, or null if not set. */
|
|
11057
|
+
description: string | null;
|
|
11058
|
+
/** Default branch name (e.g. "main"). */
|
|
11059
|
+
defaultBranch: string;
|
|
11060
|
+
/** ISO 8601 creation timestamp. */
|
|
11061
|
+
createdAt: string;
|
|
11062
|
+
/** ISO 8601 last-updated timestamp. */
|
|
11063
|
+
updatedAt: string;
|
|
11064
|
+
/** ISO 8601 timestamp of the last push, or null if never pushed. */
|
|
11065
|
+
lastPushAt: string | null;
|
|
11066
|
+
/** Fork source (e.g. "github:owner/repo", "artifacts:namespace/repo"), or null if not a fork. */
|
|
11067
|
+
source: string | null;
|
|
11068
|
+
/** Whether the repository is read-only. */
|
|
11069
|
+
readOnly: boolean;
|
|
11070
|
+
/** HTTPS git remote URL. */
|
|
11071
|
+
remote: string;
|
|
11072
|
+
}
|
|
11073
|
+
/** Result of creating a repository — includes the initial access token. */
|
|
11074
|
+
interface ArtifactsCreateRepoResult {
|
|
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. */
|
|
11082
|
+
defaultBranch: string;
|
|
11083
|
+
/** HTTPS git remote URL. */
|
|
11084
|
+
remote: string;
|
|
11085
|
+
/** Plaintext access token (only returned at creation time). */
|
|
11086
|
+
token: string;
|
|
11087
|
+
/** ISO 8601 token expiry timestamp. */
|
|
11088
|
+
tokenExpiresAt: string;
|
|
11089
|
+
}
|
|
11090
|
+
/** Paginated list of repositories. */
|
|
11091
|
+
interface ArtifactsRepoListResult {
|
|
11092
|
+
/** Repositories in this page (without the `remote` field). */
|
|
11093
|
+
repos: Omit<ArtifactsRepoInfo, "remote">[];
|
|
11094
|
+
/** Total number of repositories in the namespace. */
|
|
11095
|
+
total: number;
|
|
11096
|
+
/** Cursor for the next page, if there are more results. */
|
|
11097
|
+
cursor?: string;
|
|
11098
|
+
}
|
|
11099
|
+
/** Result of creating an access token. */
|
|
11100
|
+
interface ArtifactsCreateTokenResult {
|
|
11101
|
+
/** Unique token ID. */
|
|
11102
|
+
id: string;
|
|
11103
|
+
/** Plaintext token (only returned at creation time). */
|
|
11104
|
+
plaintext: string;
|
|
11105
|
+
/** Token scope: "read" or "write". */
|
|
11106
|
+
scope: "read" | "write";
|
|
11107
|
+
/** ISO 8601 token expiry timestamp. */
|
|
11108
|
+
expiresAt: string;
|
|
11109
|
+
}
|
|
11110
|
+
/** Token metadata (no plaintext). */
|
|
11111
|
+
interface ArtifactsTokenInfo {
|
|
11112
|
+
/** Unique token ID. */
|
|
11113
|
+
id: string;
|
|
11114
|
+
/** Token scope: "read" or "write". */
|
|
11115
|
+
scope: "read" | "write";
|
|
11116
|
+
/** Token state: "active", "expired", or "revoked". */
|
|
11117
|
+
state: "active" | "expired" | "revoked";
|
|
11118
|
+
/** ISO 8601 creation timestamp. */
|
|
11119
|
+
createdAt: string;
|
|
11120
|
+
/** ISO 8601 expiry timestamp. */
|
|
11121
|
+
expiresAt: string;
|
|
11122
|
+
}
|
|
11123
|
+
/** Paginated list of tokens for a repository. */
|
|
11124
|
+
interface ArtifactsTokenListResult {
|
|
11125
|
+
/** Tokens in this page. */
|
|
11126
|
+
tokens: ArtifactsTokenInfo[];
|
|
11127
|
+
/** Total number of tokens for the repository. */
|
|
11128
|
+
total: number;
|
|
11129
|
+
}
|
|
11130
|
+
/** Handle for a single repository. Returned by Artifacts.get(). */
|
|
11131
|
+
interface ArtifactsRepo extends ArtifactsRepoInfo {
|
|
11132
|
+
/**
|
|
11133
|
+
* Create an access token for this repo.
|
|
11134
|
+
* @param scope Token scope: "write" (default) or "read".
|
|
11135
|
+
* @param ttl Time-to-live in seconds (default 86400, min 60, max 31536000).
|
|
11136
|
+
*/
|
|
11137
|
+
createToken(
|
|
11138
|
+
scope?: "write" | "read",
|
|
11139
|
+
ttl?: number,
|
|
11140
|
+
): Promise<ArtifactsCreateTokenResult>;
|
|
11141
|
+
/** List tokens for this repo (metadata only, no plaintext). */
|
|
11142
|
+
listTokens(): Promise<ArtifactsTokenListResult>;
|
|
11143
|
+
/**
|
|
11144
|
+
* Revoke a token by plaintext or ID.
|
|
11145
|
+
* @param tokenOrId Plaintext token or token ID.
|
|
11146
|
+
* @returns true if revoked, false if not found.
|
|
11147
|
+
*/
|
|
11148
|
+
revokeToken(tokenOrId: string): Promise<boolean>;
|
|
11149
|
+
// ── Fork ──
|
|
11150
|
+
/**
|
|
11151
|
+
* Fork this repo to a new repo.
|
|
11152
|
+
* @param name Target repository name.
|
|
11153
|
+
* @param opts Optional: description, readOnly flag, defaultBranchOnly (default true).
|
|
11154
|
+
*/
|
|
11155
|
+
fork(
|
|
11156
|
+
name: string,
|
|
11157
|
+
opts?: {
|
|
11158
|
+
description?: string;
|
|
11159
|
+
readOnly?: boolean;
|
|
11160
|
+
defaultBranchOnly?: boolean;
|
|
11161
|
+
},
|
|
11162
|
+
): Promise<ArtifactsCreateRepoResult>;
|
|
11163
|
+
}
|
|
11164
|
+
/** Artifacts binding — namespace-level operations. */
|
|
11165
|
+
interface Artifacts {
|
|
11166
|
+
/**
|
|
11167
|
+
* Create a new repository with an initial access token.
|
|
11168
|
+
* @param name Repository name (alphanumeric, dots, hyphens, underscores).
|
|
11169
|
+
* @param opts Optional: readOnly flag, description, default branch name.
|
|
11170
|
+
* @returns Repo metadata with initial token.
|
|
11171
|
+
*/
|
|
11172
|
+
create(
|
|
11173
|
+
name: string,
|
|
11174
|
+
opts?: {
|
|
11175
|
+
readOnly?: boolean;
|
|
11176
|
+
description?: string;
|
|
11177
|
+
setDefaultBranch?: string;
|
|
11178
|
+
},
|
|
11179
|
+
): Promise<ArtifactsCreateRepoResult>;
|
|
11180
|
+
/**
|
|
11181
|
+
* Get a handle to an existing repository.
|
|
11182
|
+
* @param name Repository name.
|
|
11183
|
+
* @returns Repo handle.
|
|
11184
|
+
*/
|
|
11185
|
+
get(name: string): Promise<ArtifactsRepo>;
|
|
11186
|
+
/**
|
|
11187
|
+
* Import a repository from an external git remote.
|
|
11188
|
+
* @param params Source URL and optional branch/depth, plus target name and options.
|
|
11189
|
+
* @returns Repo metadata with initial token.
|
|
11190
|
+
*/
|
|
11191
|
+
import(params: {
|
|
11192
|
+
source: {
|
|
11193
|
+
url: string;
|
|
11194
|
+
branch?: string;
|
|
11195
|
+
depth?: number;
|
|
11196
|
+
};
|
|
11197
|
+
target: {
|
|
11198
|
+
name: string;
|
|
11199
|
+
opts?: {
|
|
11200
|
+
description?: string;
|
|
11201
|
+
readOnly?: boolean;
|
|
11202
|
+
};
|
|
11203
|
+
};
|
|
11204
|
+
}): Promise<ArtifactsCreateRepoResult>;
|
|
11205
|
+
/**
|
|
11206
|
+
* List repositories with cursor-based pagination.
|
|
11207
|
+
* @param opts Optional: limit (1–200, default 50), cursor for next page.
|
|
11208
|
+
*/
|
|
11209
|
+
list(opts?: {
|
|
11210
|
+
limit?: number;
|
|
11211
|
+
cursor?: string;
|
|
11212
|
+
}): Promise<ArtifactsRepoListResult>;
|
|
11213
|
+
/**
|
|
11214
|
+
* Delete a repository and all associated tokens.
|
|
11215
|
+
* @param name Repository name.
|
|
11216
|
+
* @returns true if deleted, false if not found.
|
|
11217
|
+
*/
|
|
11218
|
+
delete(name: string): Promise<boolean>;
|
|
11219
|
+
}
|
|
11042
11220
|
/**
|
|
11043
11221
|
* @deprecated Use the standalone AI Search Workers binding instead.
|
|
11044
11222
|
* See https://developers.cloudflare.com/ai-search/usage/workers-binding/
|