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