@pellux/goodvibes-sdk 0.25.8 → 0.25.10
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/README.md +4 -0
- package/dist/_internal/contracts/artifacts/operator-contract.json +1 -1
- package/dist/_internal/contracts/generated/foundation-metadata.d.ts +1 -1
- package/dist/_internal/contracts/generated/foundation-metadata.js +1 -1
- package/dist/_internal/contracts/generated/operator-contract.js +1 -1
- package/dist/_internal/platform/batch/manager.d.ts.map +1 -1
- package/dist/_internal/platform/batch/manager.js +4 -0
- package/dist/_internal/platform/batch/types.d.ts +4 -0
- package/dist/_internal/platform/batch/types.d.ts.map +1 -1
- package/dist/_internal/platform/cloudflare/client.d.ts +3 -0
- package/dist/_internal/platform/cloudflare/client.d.ts.map +1 -0
- package/dist/_internal/platform/cloudflare/client.js +9 -0
- package/dist/_internal/platform/cloudflare/config.d.ts +8 -0
- package/dist/_internal/platform/cloudflare/config.d.ts.map +1 -0
- package/dist/_internal/platform/cloudflare/config.js +48 -0
- package/dist/_internal/platform/cloudflare/constants.d.ts +18 -0
- package/dist/_internal/platform/cloudflare/constants.d.ts.map +1 -0
- package/dist/_internal/platform/cloudflare/constants.js +36 -0
- package/dist/_internal/platform/cloudflare/discovery.d.ts +23 -0
- package/dist/_internal/platform/cloudflare/discovery.d.ts.map +1 -0
- package/dist/_internal/platform/cloudflare/discovery.js +57 -0
- package/dist/_internal/platform/cloudflare/index.d.ts +6 -0
- package/dist/_internal/platform/cloudflare/index.d.ts.map +1 -0
- package/dist/_internal/platform/cloudflare/index.js +4 -0
- package/dist/_internal/platform/cloudflare/manager.d.ts +30 -0
- package/dist/_internal/platform/cloudflare/manager.d.ts.map +1 -0
- package/dist/_internal/platform/cloudflare/manager.js +671 -0
- package/dist/_internal/platform/cloudflare/resources.d.ts +79 -0
- package/dist/_internal/platform/cloudflare/resources.d.ts.map +1 -0
- package/dist/_internal/platform/cloudflare/resources.js +353 -0
- package/dist/_internal/platform/cloudflare/types.d.ts +689 -0
- package/dist/_internal/platform/cloudflare/types.d.ts.map +1 -0
- package/dist/_internal/platform/cloudflare/types.js +10 -0
- package/dist/_internal/platform/cloudflare/utils.d.ts +14 -0
- package/dist/_internal/platform/cloudflare/utils.d.ts.map +1 -0
- package/dist/_internal/platform/cloudflare/utils.js +222 -0
- package/dist/_internal/platform/cloudflare/worker-source.d.ts +2 -0
- package/dist/_internal/platform/cloudflare/worker-source.d.ts.map +1 -0
- package/dist/_internal/platform/cloudflare/worker-source.js +165 -0
- package/dist/_internal/platform/config/schema-domain-runtime.d.ts +24 -0
- package/dist/_internal/platform/config/schema-domain-runtime.d.ts.map +1 -1
- package/dist/_internal/platform/config/schema-domain-runtime.js +169 -0
- package/dist/_internal/platform/config/schema-types.d.ts +26 -2
- package/dist/_internal/platform/config/schema-types.d.ts.map +1 -1
- package/dist/_internal/platform/daemon/http/cloudflare-routes.d.ts +7 -0
- package/dist/_internal/platform/daemon/http/cloudflare-routes.d.ts.map +1 -0
- package/dist/_internal/platform/daemon/http/cloudflare-routes.js +201 -0
- package/dist/_internal/platform/daemon/http/router.d.ts +1 -1
- package/dist/_internal/platform/daemon/http/router.d.ts.map +1 -1
- package/dist/_internal/platform/daemon/http/router.js +15 -0
- package/dist/_internal/platform/version.js +1 -1
- package/dist/workers.d.ts +3 -0
- package/dist/workers.d.ts.map +1 -1
- package/dist/workers.js +13 -1
- package/package.json +2 -1
|
@@ -0,0 +1,689 @@
|
|
|
1
|
+
import type { ConfigManager } from '../config/manager.js';
|
|
2
|
+
import type { SecretsManager } from '../config/secrets.js';
|
|
3
|
+
export type CloudflareProvisionStepStatus = 'ok' | 'skipped' | 'warning';
|
|
4
|
+
export interface CloudflareProvisionStep {
|
|
5
|
+
readonly name: string;
|
|
6
|
+
readonly status: CloudflareProvisionStepStatus;
|
|
7
|
+
readonly message?: string;
|
|
8
|
+
readonly resourceId?: string;
|
|
9
|
+
}
|
|
10
|
+
export type CloudflareComponent = 'workers' | 'queues' | 'zeroTrustTunnel' | 'zeroTrustAccess' | 'dns' | 'kv' | 'durableObjects' | 'secretsStore' | 'r2';
|
|
11
|
+
export type CloudflareComponentSelection = Partial<Record<CloudflareComponent, boolean>>;
|
|
12
|
+
export interface CloudflareControlPlaneConfig {
|
|
13
|
+
readonly enabled: boolean;
|
|
14
|
+
readonly freeTierMode: boolean;
|
|
15
|
+
readonly accountId: string;
|
|
16
|
+
readonly apiTokenRef: string;
|
|
17
|
+
readonly zoneId: string;
|
|
18
|
+
readonly zoneName: string;
|
|
19
|
+
readonly workerName: string;
|
|
20
|
+
readonly workerSubdomain: string;
|
|
21
|
+
readonly workerHostname: string;
|
|
22
|
+
readonly workerBaseUrl: string;
|
|
23
|
+
readonly daemonBaseUrl: string;
|
|
24
|
+
readonly daemonHostname: string;
|
|
25
|
+
readonly workerTokenRef: string;
|
|
26
|
+
readonly workerClientTokenRef: string;
|
|
27
|
+
readonly workerCron: string;
|
|
28
|
+
readonly queueName: string;
|
|
29
|
+
readonly deadLetterQueueName: string;
|
|
30
|
+
readonly tunnelName: string;
|
|
31
|
+
readonly tunnelId: string;
|
|
32
|
+
readonly tunnelTokenRef: string;
|
|
33
|
+
readonly accessAppId: string;
|
|
34
|
+
readonly accessServiceTokenId: string;
|
|
35
|
+
readonly accessServiceTokenRef: string;
|
|
36
|
+
readonly kvNamespaceName: string;
|
|
37
|
+
readonly kvNamespaceId: string;
|
|
38
|
+
readonly durableObjectNamespaceName: string;
|
|
39
|
+
readonly durableObjectNamespaceId: string;
|
|
40
|
+
readonly r2BucketName: string;
|
|
41
|
+
readonly secretsStoreName: string;
|
|
42
|
+
readonly secretsStoreId: string;
|
|
43
|
+
readonly maxQueueOpsPerDay: number;
|
|
44
|
+
}
|
|
45
|
+
export interface CloudflareControlPlaneStatus {
|
|
46
|
+
readonly enabled: boolean;
|
|
47
|
+
readonly ready: boolean;
|
|
48
|
+
readonly configured: {
|
|
49
|
+
readonly accountId: boolean;
|
|
50
|
+
readonly apiToken: boolean;
|
|
51
|
+
readonly zone: boolean;
|
|
52
|
+
readonly workerName: boolean;
|
|
53
|
+
readonly daemonBaseUrl: boolean;
|
|
54
|
+
readonly daemonHostname: boolean;
|
|
55
|
+
readonly workerBaseUrl: boolean;
|
|
56
|
+
readonly workerHostname: boolean;
|
|
57
|
+
readonly queueName: boolean;
|
|
58
|
+
readonly deadLetterQueueName: boolean;
|
|
59
|
+
readonly workerToken: boolean;
|
|
60
|
+
readonly workerClientToken: boolean;
|
|
61
|
+
readonly tunnel: boolean;
|
|
62
|
+
readonly access: boolean;
|
|
63
|
+
readonly kv: boolean;
|
|
64
|
+
readonly durableObjects: boolean;
|
|
65
|
+
readonly r2: boolean;
|
|
66
|
+
readonly secretsStore: boolean;
|
|
67
|
+
};
|
|
68
|
+
readonly config: CloudflareControlPlaneConfig;
|
|
69
|
+
readonly warnings: readonly string[];
|
|
70
|
+
}
|
|
71
|
+
export interface CloudflareValidateInput {
|
|
72
|
+
readonly accountId?: string;
|
|
73
|
+
readonly apiToken?: string;
|
|
74
|
+
readonly apiTokenRef?: string;
|
|
75
|
+
}
|
|
76
|
+
export interface CloudflareValidateResult {
|
|
77
|
+
readonly ok: boolean;
|
|
78
|
+
readonly account?: {
|
|
79
|
+
readonly id: string;
|
|
80
|
+
readonly name: string;
|
|
81
|
+
readonly type?: string;
|
|
82
|
+
};
|
|
83
|
+
readonly tokenSource: CloudflareSecretSource;
|
|
84
|
+
}
|
|
85
|
+
export interface CloudflareProvisionInput extends CloudflareValidateInput {
|
|
86
|
+
readonly components?: CloudflareComponentSelection;
|
|
87
|
+
readonly workerName?: string;
|
|
88
|
+
readonly workerSubdomain?: string;
|
|
89
|
+
readonly workerHostname?: string;
|
|
90
|
+
readonly workerBaseUrl?: string;
|
|
91
|
+
readonly daemonBaseUrl?: string;
|
|
92
|
+
readonly daemonHostname?: string;
|
|
93
|
+
readonly zoneId?: string;
|
|
94
|
+
readonly zoneName?: string;
|
|
95
|
+
readonly queueName?: string;
|
|
96
|
+
readonly deadLetterQueueName?: string;
|
|
97
|
+
readonly tunnelName?: string;
|
|
98
|
+
readonly tunnelId?: string;
|
|
99
|
+
readonly tunnelServiceUrl?: string;
|
|
100
|
+
readonly tunnelTokenRef?: string;
|
|
101
|
+
readonly accessAppId?: string;
|
|
102
|
+
readonly accessServiceTokenId?: string;
|
|
103
|
+
readonly accessServiceTokenRef?: string;
|
|
104
|
+
readonly kvNamespaceName?: string;
|
|
105
|
+
readonly kvNamespaceId?: string;
|
|
106
|
+
readonly durableObjectNamespaceName?: string;
|
|
107
|
+
readonly durableObjectNamespaceId?: string;
|
|
108
|
+
readonly r2BucketName?: string;
|
|
109
|
+
readonly secretsStoreName?: string;
|
|
110
|
+
readonly secretsStoreId?: string;
|
|
111
|
+
readonly workerCron?: string;
|
|
112
|
+
readonly operatorToken?: string;
|
|
113
|
+
readonly operatorTokenRef?: string;
|
|
114
|
+
readonly workerClientToken?: string;
|
|
115
|
+
readonly workerClientTokenRef?: string;
|
|
116
|
+
readonly storeApiToken?: boolean;
|
|
117
|
+
readonly storeOperatorToken?: boolean;
|
|
118
|
+
readonly storeWorkerClientToken?: boolean;
|
|
119
|
+
readonly returnGeneratedSecrets?: boolean;
|
|
120
|
+
readonly enableWorkersDev?: boolean;
|
|
121
|
+
readonly queueJobPayloads?: boolean;
|
|
122
|
+
readonly verify?: boolean;
|
|
123
|
+
readonly persistConfig?: boolean;
|
|
124
|
+
readonly batchMode?: 'off' | 'explicit' | 'eligible-by-default';
|
|
125
|
+
}
|
|
126
|
+
export interface CloudflareProvisionResult {
|
|
127
|
+
readonly ok: boolean;
|
|
128
|
+
readonly dryRun: false;
|
|
129
|
+
readonly steps: readonly CloudflareProvisionStep[];
|
|
130
|
+
readonly account: {
|
|
131
|
+
readonly id: string;
|
|
132
|
+
readonly name: string;
|
|
133
|
+
};
|
|
134
|
+
readonly queues?: {
|
|
135
|
+
readonly queueName: string;
|
|
136
|
+
readonly queueId: string;
|
|
137
|
+
readonly deadLetterQueueName: string;
|
|
138
|
+
readonly deadLetterQueueId: string;
|
|
139
|
+
readonly consumerId?: string;
|
|
140
|
+
};
|
|
141
|
+
readonly worker?: {
|
|
142
|
+
readonly name: string;
|
|
143
|
+
readonly baseUrl?: string;
|
|
144
|
+
readonly subdomain?: string;
|
|
145
|
+
readonly hostname?: string;
|
|
146
|
+
readonly cron?: string;
|
|
147
|
+
};
|
|
148
|
+
readonly tunnel?: {
|
|
149
|
+
readonly id: string;
|
|
150
|
+
readonly name: string;
|
|
151
|
+
readonly hostname?: string;
|
|
152
|
+
readonly tokenRef?: string;
|
|
153
|
+
};
|
|
154
|
+
readonly access?: {
|
|
155
|
+
readonly appId?: string;
|
|
156
|
+
readonly serviceTokenId?: string;
|
|
157
|
+
readonly serviceTokenRef?: string;
|
|
158
|
+
};
|
|
159
|
+
readonly dns?: {
|
|
160
|
+
readonly zoneId: string;
|
|
161
|
+
readonly zoneName?: string;
|
|
162
|
+
readonly records: readonly CloudflareDnsRecordLike[];
|
|
163
|
+
};
|
|
164
|
+
readonly kv?: {
|
|
165
|
+
readonly namespaceName: string;
|
|
166
|
+
readonly namespaceId: string;
|
|
167
|
+
};
|
|
168
|
+
readonly durableObjects?: {
|
|
169
|
+
readonly namespaceName: string;
|
|
170
|
+
readonly namespaceId?: string;
|
|
171
|
+
};
|
|
172
|
+
readonly r2?: {
|
|
173
|
+
readonly bucketName: string;
|
|
174
|
+
readonly storageClass: 'Standard';
|
|
175
|
+
};
|
|
176
|
+
readonly secretsStore?: {
|
|
177
|
+
readonly storeName: string;
|
|
178
|
+
readonly storeId: string;
|
|
179
|
+
};
|
|
180
|
+
readonly verification?: CloudflareVerifyResult;
|
|
181
|
+
readonly generatedSecrets?: {
|
|
182
|
+
readonly workerClientToken?: string;
|
|
183
|
+
readonly tunnelToken?: string;
|
|
184
|
+
readonly accessServiceTokenClientId?: string;
|
|
185
|
+
readonly accessServiceTokenClientSecret?: string;
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
export interface CloudflareTokenRequirementsInput {
|
|
189
|
+
readonly components?: CloudflareComponentSelection;
|
|
190
|
+
readonly includeBootstrap?: boolean;
|
|
191
|
+
}
|
|
192
|
+
export interface CloudflareTokenPermissionRequirement {
|
|
193
|
+
readonly component: CloudflareComponent | 'bootstrap';
|
|
194
|
+
readonly scope: 'account' | 'zone' | 'user' | 'r2';
|
|
195
|
+
readonly permission: string;
|
|
196
|
+
readonly alternatives?: readonly string[];
|
|
197
|
+
readonly reason: string;
|
|
198
|
+
}
|
|
199
|
+
export interface CloudflareTokenRequirementsResult {
|
|
200
|
+
readonly ok: true;
|
|
201
|
+
readonly components: Readonly<Record<CloudflareComponent, boolean>>;
|
|
202
|
+
readonly permissions: readonly CloudflareTokenPermissionRequirement[];
|
|
203
|
+
readonly bootstrapToken: {
|
|
204
|
+
readonly requiredForSdkCreation: boolean;
|
|
205
|
+
readonly storeInGoodVibes: false;
|
|
206
|
+
readonly instructions: readonly string[];
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
export interface CloudflareOperationalTokenInput extends CloudflareTokenRequirementsInput {
|
|
210
|
+
readonly accountId?: string;
|
|
211
|
+
readonly zoneId?: string;
|
|
212
|
+
readonly zoneName?: string;
|
|
213
|
+
readonly bootstrapToken?: string;
|
|
214
|
+
readonly tokenName?: string;
|
|
215
|
+
readonly expiresOn?: string;
|
|
216
|
+
readonly persistConfig?: boolean;
|
|
217
|
+
readonly storeApiToken?: boolean;
|
|
218
|
+
readonly returnGeneratedToken?: boolean;
|
|
219
|
+
}
|
|
220
|
+
export interface CloudflareOperationalTokenResult {
|
|
221
|
+
readonly ok: true;
|
|
222
|
+
readonly tokenId?: string;
|
|
223
|
+
readonly tokenName: string;
|
|
224
|
+
readonly tokenSource: 'bootstrap';
|
|
225
|
+
readonly apiTokenRef?: string;
|
|
226
|
+
readonly generatedToken?: string;
|
|
227
|
+
readonly accountId: string;
|
|
228
|
+
readonly zoneId?: string;
|
|
229
|
+
readonly permissions: readonly CloudflareTokenPermissionRequirement[];
|
|
230
|
+
}
|
|
231
|
+
export interface CloudflareDiscoverInput extends CloudflareValidateInput {
|
|
232
|
+
readonly components?: CloudflareComponentSelection;
|
|
233
|
+
readonly zoneId?: string;
|
|
234
|
+
readonly zoneName?: string;
|
|
235
|
+
readonly includeResources?: boolean;
|
|
236
|
+
}
|
|
237
|
+
export interface CloudflareDiscoverResult {
|
|
238
|
+
readonly ok: true;
|
|
239
|
+
readonly tokenSource: CloudflareSecretSource;
|
|
240
|
+
readonly accounts: readonly CloudflareAccountLike[];
|
|
241
|
+
readonly selectedAccount?: CloudflareAccountLike;
|
|
242
|
+
readonly zones: readonly CloudflareZoneLike[];
|
|
243
|
+
readonly selectedZone?: CloudflareZoneLike;
|
|
244
|
+
readonly workerSubdomain?: string;
|
|
245
|
+
readonly queues?: readonly CloudflareQueueLike[];
|
|
246
|
+
readonly kvNamespaces?: readonly CloudflareKvNamespaceLike[];
|
|
247
|
+
readonly durableObjectNamespaces?: readonly CloudflareDurableObjectNamespaceLike[];
|
|
248
|
+
readonly r2Buckets?: readonly CloudflareR2BucketLike[];
|
|
249
|
+
readonly secretsStores?: readonly CloudflareSecretsStoreLike[];
|
|
250
|
+
readonly tunnels?: readonly CloudflareTunnelLike[];
|
|
251
|
+
readonly accessApplications?: readonly CloudflareAccessApplicationLike[];
|
|
252
|
+
readonly warnings: readonly string[];
|
|
253
|
+
}
|
|
254
|
+
export interface CloudflareVerifyInput {
|
|
255
|
+
readonly workerBaseUrl?: string;
|
|
256
|
+
readonly workerClientToken?: string;
|
|
257
|
+
readonly workerClientTokenRef?: string;
|
|
258
|
+
}
|
|
259
|
+
export interface CloudflareVerifyResult {
|
|
260
|
+
readonly ok: boolean;
|
|
261
|
+
readonly workerHealth: {
|
|
262
|
+
readonly ok: boolean;
|
|
263
|
+
readonly status: number;
|
|
264
|
+
readonly error?: string;
|
|
265
|
+
};
|
|
266
|
+
readonly daemonBatchProxy?: {
|
|
267
|
+
readonly ok: boolean;
|
|
268
|
+
readonly status: number;
|
|
269
|
+
readonly error?: string;
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
export interface CloudflareDisableInput {
|
|
273
|
+
readonly accountId?: string;
|
|
274
|
+
readonly apiToken?: string;
|
|
275
|
+
readonly apiTokenRef?: string;
|
|
276
|
+
readonly workerName?: string;
|
|
277
|
+
readonly disableWorkerSubdomain?: boolean;
|
|
278
|
+
readonly disableCron?: boolean;
|
|
279
|
+
readonly persistConfig?: boolean;
|
|
280
|
+
}
|
|
281
|
+
export interface CloudflareDisableResult {
|
|
282
|
+
readonly ok: boolean;
|
|
283
|
+
readonly steps: readonly CloudflareProvisionStep[];
|
|
284
|
+
}
|
|
285
|
+
export type CloudflareSecretSource = 'body' | 'config-ref' | 'env' | 'goodvibes-secret' | 'auth-token' | 'generated' | 'missing';
|
|
286
|
+
export interface CloudflareResolvedSecret {
|
|
287
|
+
readonly value: string | null;
|
|
288
|
+
readonly source: CloudflareSecretSource;
|
|
289
|
+
}
|
|
290
|
+
export interface CloudflareQueueLike {
|
|
291
|
+
readonly queue_id?: string;
|
|
292
|
+
readonly queue_name?: string;
|
|
293
|
+
}
|
|
294
|
+
export interface CloudflareConsumerLike {
|
|
295
|
+
readonly consumer_id?: string;
|
|
296
|
+
readonly script?: string;
|
|
297
|
+
readonly type?: string;
|
|
298
|
+
}
|
|
299
|
+
export interface CloudflareAccountLike {
|
|
300
|
+
readonly id: string;
|
|
301
|
+
readonly name: string;
|
|
302
|
+
readonly type?: string;
|
|
303
|
+
}
|
|
304
|
+
export interface CloudflareZoneLike {
|
|
305
|
+
readonly id: string;
|
|
306
|
+
readonly name: string;
|
|
307
|
+
readonly status?: string;
|
|
308
|
+
readonly type?: string;
|
|
309
|
+
}
|
|
310
|
+
export interface CloudflareDnsRecordLike {
|
|
311
|
+
readonly id?: string;
|
|
312
|
+
readonly name: string;
|
|
313
|
+
readonly type: string;
|
|
314
|
+
readonly content: string;
|
|
315
|
+
readonly proxied?: boolean;
|
|
316
|
+
readonly ttl?: number;
|
|
317
|
+
}
|
|
318
|
+
export interface CloudflareKvNamespaceLike {
|
|
319
|
+
readonly id?: string;
|
|
320
|
+
readonly title?: string;
|
|
321
|
+
}
|
|
322
|
+
export interface CloudflareDurableObjectNamespaceLike {
|
|
323
|
+
readonly id?: string;
|
|
324
|
+
readonly name?: string;
|
|
325
|
+
readonly class?: string;
|
|
326
|
+
readonly script?: string;
|
|
327
|
+
readonly use_sqlite?: boolean;
|
|
328
|
+
}
|
|
329
|
+
export interface CloudflareR2BucketLike {
|
|
330
|
+
readonly name?: string;
|
|
331
|
+
readonly storage_class?: 'Standard' | 'InfrequentAccess';
|
|
332
|
+
}
|
|
333
|
+
export interface CloudflareSecretsStoreLike {
|
|
334
|
+
readonly id: string;
|
|
335
|
+
readonly name: string;
|
|
336
|
+
}
|
|
337
|
+
export interface CloudflareTunnelLike {
|
|
338
|
+
readonly id?: string;
|
|
339
|
+
readonly name?: string;
|
|
340
|
+
readonly status?: string;
|
|
341
|
+
}
|
|
342
|
+
export interface CloudflareAccessServiceTokenLike {
|
|
343
|
+
readonly id?: string;
|
|
344
|
+
readonly name?: string;
|
|
345
|
+
readonly client_id?: string;
|
|
346
|
+
readonly client_secret?: string;
|
|
347
|
+
}
|
|
348
|
+
export interface CloudflareAccessApplicationLike {
|
|
349
|
+
readonly id?: string;
|
|
350
|
+
readonly name?: string;
|
|
351
|
+
readonly domain?: string;
|
|
352
|
+
readonly type?: string;
|
|
353
|
+
}
|
|
354
|
+
export interface CloudflarePermissionGroupLike {
|
|
355
|
+
readonly id?: string;
|
|
356
|
+
readonly name?: string;
|
|
357
|
+
readonly scopes?: readonly string[];
|
|
358
|
+
}
|
|
359
|
+
export interface CloudflareTokenPolicyParam {
|
|
360
|
+
readonly effect: 'allow' | 'deny';
|
|
361
|
+
readonly permission_groups: readonly {
|
|
362
|
+
readonly id: string;
|
|
363
|
+
}[];
|
|
364
|
+
readonly resources: Record<string, string>;
|
|
365
|
+
}
|
|
366
|
+
export interface CloudflareTokenCreateResponseLike {
|
|
367
|
+
readonly id?: string;
|
|
368
|
+
readonly name?: string;
|
|
369
|
+
readonly value?: string;
|
|
370
|
+
}
|
|
371
|
+
export interface CloudflareTokenVerifyResponseLike {
|
|
372
|
+
readonly id?: string;
|
|
373
|
+
readonly status?: string;
|
|
374
|
+
}
|
|
375
|
+
export interface CloudflareApiClient {
|
|
376
|
+
readonly accounts: {
|
|
377
|
+
list?(): AsyncIterable<CloudflareAccountLike>;
|
|
378
|
+
get(params: {
|
|
379
|
+
readonly account_id: string;
|
|
380
|
+
}): Promise<CloudflareAccountLike>;
|
|
381
|
+
readonly tokens?: {
|
|
382
|
+
create(params: {
|
|
383
|
+
readonly account_id: string;
|
|
384
|
+
readonly name: string;
|
|
385
|
+
readonly policies: readonly CloudflareTokenPolicyParam[];
|
|
386
|
+
readonly expires_on?: string;
|
|
387
|
+
}): Promise<CloudflareTokenCreateResponseLike>;
|
|
388
|
+
verify(params: {
|
|
389
|
+
readonly account_id: string;
|
|
390
|
+
}): Promise<CloudflareTokenVerifyResponseLike>;
|
|
391
|
+
readonly permissionGroups: {
|
|
392
|
+
list(params: {
|
|
393
|
+
readonly account_id: string;
|
|
394
|
+
readonly name?: string;
|
|
395
|
+
readonly scope?: string;
|
|
396
|
+
}): AsyncIterable<CloudflarePermissionGroupLike>;
|
|
397
|
+
get?(params: {
|
|
398
|
+
readonly account_id: string;
|
|
399
|
+
readonly name?: string;
|
|
400
|
+
readonly scope?: string;
|
|
401
|
+
}): Promise<readonly CloudflarePermissionGroupLike[]>;
|
|
402
|
+
};
|
|
403
|
+
};
|
|
404
|
+
};
|
|
405
|
+
readonly user?: {
|
|
406
|
+
readonly tokens: {
|
|
407
|
+
verify(): Promise<CloudflareTokenVerifyResponseLike>;
|
|
408
|
+
readonly permissionGroups: {
|
|
409
|
+
list(params?: {
|
|
410
|
+
readonly name?: string;
|
|
411
|
+
readonly scope?: string;
|
|
412
|
+
}): AsyncIterable<CloudflarePermissionGroupLike>;
|
|
413
|
+
};
|
|
414
|
+
};
|
|
415
|
+
};
|
|
416
|
+
readonly zones?: {
|
|
417
|
+
list(params?: {
|
|
418
|
+
readonly account?: {
|
|
419
|
+
readonly id?: string;
|
|
420
|
+
readonly name?: string;
|
|
421
|
+
};
|
|
422
|
+
readonly name?: string;
|
|
423
|
+
}): AsyncIterable<CloudflareZoneLike>;
|
|
424
|
+
get(params: {
|
|
425
|
+
readonly zone_id: string;
|
|
426
|
+
}): Promise<CloudflareZoneLike>;
|
|
427
|
+
};
|
|
428
|
+
readonly dns?: {
|
|
429
|
+
readonly records: {
|
|
430
|
+
create(params: {
|
|
431
|
+
readonly zone_id: string;
|
|
432
|
+
readonly type: 'CNAME' | 'TXT' | 'A' | 'AAAA';
|
|
433
|
+
readonly name: string;
|
|
434
|
+
readonly content: string;
|
|
435
|
+
readonly proxied?: boolean;
|
|
436
|
+
readonly ttl?: number;
|
|
437
|
+
readonly comment?: string;
|
|
438
|
+
}): Promise<CloudflareDnsRecordLike>;
|
|
439
|
+
update(dnsRecordId: string, params: {
|
|
440
|
+
readonly zone_id: string;
|
|
441
|
+
readonly type: 'CNAME' | 'TXT' | 'A' | 'AAAA';
|
|
442
|
+
readonly name: string;
|
|
443
|
+
readonly content: string;
|
|
444
|
+
readonly proxied?: boolean;
|
|
445
|
+
readonly ttl?: number;
|
|
446
|
+
readonly comment?: string;
|
|
447
|
+
}): Promise<CloudflareDnsRecordLike>;
|
|
448
|
+
list(params: {
|
|
449
|
+
readonly zone_id: string;
|
|
450
|
+
readonly type?: string;
|
|
451
|
+
readonly name?: {
|
|
452
|
+
readonly exact?: string;
|
|
453
|
+
} | string;
|
|
454
|
+
}): AsyncIterable<CloudflareDnsRecordLike>;
|
|
455
|
+
};
|
|
456
|
+
};
|
|
457
|
+
readonly queues: {
|
|
458
|
+
create(params: {
|
|
459
|
+
readonly account_id: string;
|
|
460
|
+
readonly queue_name: string;
|
|
461
|
+
}): Promise<CloudflareQueueLike>;
|
|
462
|
+
list(params: {
|
|
463
|
+
readonly account_id: string;
|
|
464
|
+
}): AsyncIterable<CloudflareQueueLike>;
|
|
465
|
+
get(queueId: string, params: {
|
|
466
|
+
readonly account_id: string;
|
|
467
|
+
}): Promise<CloudflareQueueLike>;
|
|
468
|
+
readonly consumers: {
|
|
469
|
+
create(queueId: string, params: {
|
|
470
|
+
readonly account_id: string;
|
|
471
|
+
readonly type: 'worker';
|
|
472
|
+
readonly script_name: string;
|
|
473
|
+
readonly dead_letter_queue?: string;
|
|
474
|
+
readonly settings?: {
|
|
475
|
+
readonly batch_size?: number;
|
|
476
|
+
readonly max_retries?: number;
|
|
477
|
+
readonly max_wait_time_ms?: number;
|
|
478
|
+
readonly retry_delay?: number;
|
|
479
|
+
};
|
|
480
|
+
}): Promise<CloudflareConsumerLike>;
|
|
481
|
+
update(queueId: string, consumerId: string, params: {
|
|
482
|
+
readonly account_id: string;
|
|
483
|
+
readonly type: 'worker';
|
|
484
|
+
readonly script_name: string;
|
|
485
|
+
readonly dead_letter_queue?: string;
|
|
486
|
+
readonly settings?: {
|
|
487
|
+
readonly batch_size?: number;
|
|
488
|
+
readonly max_retries?: number;
|
|
489
|
+
readonly max_wait_time_ms?: number;
|
|
490
|
+
readonly retry_delay?: number;
|
|
491
|
+
};
|
|
492
|
+
}): Promise<CloudflareConsumerLike>;
|
|
493
|
+
list(queueId: string, params: {
|
|
494
|
+
readonly account_id: string;
|
|
495
|
+
}): AsyncIterable<CloudflareConsumerLike>;
|
|
496
|
+
};
|
|
497
|
+
};
|
|
498
|
+
readonly kv?: {
|
|
499
|
+
readonly namespaces: {
|
|
500
|
+
create(params: {
|
|
501
|
+
readonly account_id: string;
|
|
502
|
+
readonly title: string;
|
|
503
|
+
}): Promise<CloudflareKvNamespaceLike>;
|
|
504
|
+
list(params: {
|
|
505
|
+
readonly account_id: string;
|
|
506
|
+
}): AsyncIterable<CloudflareKvNamespaceLike>;
|
|
507
|
+
};
|
|
508
|
+
};
|
|
509
|
+
readonly durableObjects?: {
|
|
510
|
+
readonly namespaces: {
|
|
511
|
+
list(params: {
|
|
512
|
+
readonly account_id: string;
|
|
513
|
+
}): AsyncIterable<CloudflareDurableObjectNamespaceLike>;
|
|
514
|
+
};
|
|
515
|
+
};
|
|
516
|
+
readonly r2?: {
|
|
517
|
+
readonly buckets: {
|
|
518
|
+
create(params: {
|
|
519
|
+
readonly account_id: string;
|
|
520
|
+
readonly name: string;
|
|
521
|
+
readonly storageClass?: 'Standard' | 'InfrequentAccess';
|
|
522
|
+
readonly storage_class?: 'Standard' | 'InfrequentAccess';
|
|
523
|
+
}): Promise<CloudflareR2BucketLike>;
|
|
524
|
+
list(params: {
|
|
525
|
+
readonly account_id: string;
|
|
526
|
+
}): Promise<{
|
|
527
|
+
readonly buckets?: readonly CloudflareR2BucketLike[];
|
|
528
|
+
}>;
|
|
529
|
+
get?(bucketName: string, params: {
|
|
530
|
+
readonly account_id: string;
|
|
531
|
+
}): Promise<CloudflareR2BucketLike>;
|
|
532
|
+
};
|
|
533
|
+
};
|
|
534
|
+
readonly secretsStore?: {
|
|
535
|
+
readonly stores: {
|
|
536
|
+
create(params: {
|
|
537
|
+
readonly account_id: string;
|
|
538
|
+
readonly body: readonly {
|
|
539
|
+
readonly name: string;
|
|
540
|
+
}[];
|
|
541
|
+
}): AsyncIterable<CloudflareSecretsStoreLike>;
|
|
542
|
+
list(params: {
|
|
543
|
+
readonly account_id: string;
|
|
544
|
+
}): AsyncIterable<CloudflareSecretsStoreLike>;
|
|
545
|
+
};
|
|
546
|
+
};
|
|
547
|
+
readonly zeroTrust?: {
|
|
548
|
+
readonly tunnels?: {
|
|
549
|
+
readonly cloudflared: {
|
|
550
|
+
create(params: {
|
|
551
|
+
readonly account_id: string;
|
|
552
|
+
readonly name: string;
|
|
553
|
+
readonly config_src?: 'local' | 'cloudflare';
|
|
554
|
+
}): Promise<CloudflareTunnelLike>;
|
|
555
|
+
list(params: {
|
|
556
|
+
readonly account_id: string;
|
|
557
|
+
readonly name?: string;
|
|
558
|
+
readonly is_deleted?: boolean;
|
|
559
|
+
}): AsyncIterable<CloudflareTunnelLike>;
|
|
560
|
+
readonly configurations: {
|
|
561
|
+
update(tunnelId: string, params: {
|
|
562
|
+
readonly account_id: string;
|
|
563
|
+
readonly config: Record<string, unknown>;
|
|
564
|
+
}): Promise<Record<string, unknown>>;
|
|
565
|
+
};
|
|
566
|
+
readonly token: {
|
|
567
|
+
get(tunnelId: string, params: {
|
|
568
|
+
readonly account_id: string;
|
|
569
|
+
}): Promise<string>;
|
|
570
|
+
};
|
|
571
|
+
};
|
|
572
|
+
};
|
|
573
|
+
readonly access?: {
|
|
574
|
+
readonly serviceTokens: {
|
|
575
|
+
create(params: {
|
|
576
|
+
readonly account_id?: string;
|
|
577
|
+
readonly zone_id?: string;
|
|
578
|
+
readonly name: string;
|
|
579
|
+
readonly duration?: string;
|
|
580
|
+
}): Promise<CloudflareAccessServiceTokenLike>;
|
|
581
|
+
list(params: {
|
|
582
|
+
readonly account_id?: string;
|
|
583
|
+
readonly zone_id?: string;
|
|
584
|
+
readonly name?: string;
|
|
585
|
+
readonly search?: string;
|
|
586
|
+
}): AsyncIterable<CloudflareAccessServiceTokenLike>;
|
|
587
|
+
};
|
|
588
|
+
readonly applications: {
|
|
589
|
+
create(params: Record<string, unknown>): Promise<CloudflareAccessApplicationLike>;
|
|
590
|
+
update(appId: string, params: Record<string, unknown>): Promise<CloudflareAccessApplicationLike>;
|
|
591
|
+
list(params: {
|
|
592
|
+
readonly account_id?: string;
|
|
593
|
+
readonly zone_id?: string;
|
|
594
|
+
readonly name?: string;
|
|
595
|
+
readonly domain?: string;
|
|
596
|
+
readonly exact?: boolean;
|
|
597
|
+
}): AsyncIterable<CloudflareAccessApplicationLike>;
|
|
598
|
+
};
|
|
599
|
+
};
|
|
600
|
+
};
|
|
601
|
+
readonly workers: {
|
|
602
|
+
readonly subdomains: {
|
|
603
|
+
get(params: {
|
|
604
|
+
readonly account_id: string;
|
|
605
|
+
}): Promise<{
|
|
606
|
+
readonly subdomain: string;
|
|
607
|
+
}>;
|
|
608
|
+
update(params: {
|
|
609
|
+
readonly account_id: string;
|
|
610
|
+
readonly subdomain: string;
|
|
611
|
+
}): Promise<{
|
|
612
|
+
readonly subdomain: string;
|
|
613
|
+
}>;
|
|
614
|
+
};
|
|
615
|
+
readonly scripts: {
|
|
616
|
+
update(scriptName: string, params: {
|
|
617
|
+
readonly account_id: string;
|
|
618
|
+
readonly metadata: Record<string, unknown>;
|
|
619
|
+
readonly files: readonly File[];
|
|
620
|
+
}): Promise<{
|
|
621
|
+
readonly id?: string;
|
|
622
|
+
}>;
|
|
623
|
+
readonly subdomain: {
|
|
624
|
+
create(scriptName: string, params: {
|
|
625
|
+
readonly account_id: string;
|
|
626
|
+
readonly enabled: boolean;
|
|
627
|
+
readonly previews_enabled?: boolean;
|
|
628
|
+
}): Promise<{
|
|
629
|
+
readonly enabled: boolean;
|
|
630
|
+
}>;
|
|
631
|
+
delete(scriptName: string, params: {
|
|
632
|
+
readonly account_id: string;
|
|
633
|
+
}): Promise<{
|
|
634
|
+
readonly enabled: boolean;
|
|
635
|
+
}>;
|
|
636
|
+
get(scriptName: string, params: {
|
|
637
|
+
readonly account_id: string;
|
|
638
|
+
}): Promise<{
|
|
639
|
+
readonly enabled: boolean;
|
|
640
|
+
}>;
|
|
641
|
+
};
|
|
642
|
+
readonly schedules: {
|
|
643
|
+
update(scriptName: string, params: {
|
|
644
|
+
readonly account_id: string;
|
|
645
|
+
readonly body: readonly {
|
|
646
|
+
readonly cron: string;
|
|
647
|
+
}[];
|
|
648
|
+
}): Promise<{
|
|
649
|
+
readonly schedules: readonly {
|
|
650
|
+
readonly cron: string;
|
|
651
|
+
}[];
|
|
652
|
+
}>;
|
|
653
|
+
get(scriptName: string, params: {
|
|
654
|
+
readonly account_id: string;
|
|
655
|
+
}): Promise<{
|
|
656
|
+
readonly schedules: readonly {
|
|
657
|
+
readonly cron: string;
|
|
658
|
+
}[];
|
|
659
|
+
}>;
|
|
660
|
+
};
|
|
661
|
+
readonly secrets: {
|
|
662
|
+
update(scriptName: string, params: {
|
|
663
|
+
readonly account_id: string;
|
|
664
|
+
readonly name: string;
|
|
665
|
+
readonly text: string;
|
|
666
|
+
readonly type: 'secret_text';
|
|
667
|
+
}): Promise<{
|
|
668
|
+
readonly name: string;
|
|
669
|
+
readonly type: 'secret_text';
|
|
670
|
+
}>;
|
|
671
|
+
};
|
|
672
|
+
};
|
|
673
|
+
};
|
|
674
|
+
}
|
|
675
|
+
export interface CloudflareControlPlaneOptions {
|
|
676
|
+
readonly configManager: Pick<ConfigManager, 'get' | 'set'>;
|
|
677
|
+
readonly secretsManager?: Pick<SecretsManager, 'get' | 'set' | 'getGlobalHome'> | null;
|
|
678
|
+
readonly authToken?: () => string | null;
|
|
679
|
+
readonly createClient?: (apiToken: string) => Promise<CloudflareApiClient>;
|
|
680
|
+
readonly fetch?: typeof fetch;
|
|
681
|
+
readonly now?: () => number;
|
|
682
|
+
readonly randomUUID?: () => string;
|
|
683
|
+
}
|
|
684
|
+
export declare class CloudflareControlPlaneError extends Error {
|
|
685
|
+
readonly status: number;
|
|
686
|
+
readonly code: string;
|
|
687
|
+
constructor(message: string, code: string, status?: number);
|
|
688
|
+
}
|
|
689
|
+
//# sourceMappingURL=types.d.ts.map
|