@scaleway/sdk 0.0.2-alpha.0

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.
Files changed (56) hide show
  1. package/LICENSE +191 -0
  2. package/README.md +28 -0
  3. package/dist/api/function/manual/FunctionAPI.js +436 -0
  4. package/dist/api/function/manual/WaitForFunctionAPI.js +27 -0
  5. package/dist/api/function/manual/types.js +1 -0
  6. package/dist/api/registry/manual/RegistryAPI.js +260 -0
  7. package/dist/api/registry/manual/WaitForRegistryAPI.js +27 -0
  8. package/dist/api/registry/manual/types.js +1 -0
  9. package/dist/helpers/API.js +12 -0
  10. package/dist/helpers/camelize.js +36 -0
  11. package/dist/helpers/forRegions.js +15 -0
  12. package/dist/helpers/is-browser.js +3 -0
  13. package/dist/helpers/json.js +6 -0
  14. package/dist/index.cjs +9449 -0
  15. package/dist/index.d.ts +1126 -0
  16. package/dist/index.js +13 -0
  17. package/dist/internal/async/interval-retrier.js +89 -0
  18. package/dist/internal/async/sleep.js +13 -0
  19. package/dist/internal/auth.js +68 -0
  20. package/dist/internal/interceptors/interceptor.js +11 -0
  21. package/dist/internal/interceptors/request.js +29 -0
  22. package/dist/internal/logger/console-logger.js +31 -0
  23. package/dist/internal/logger/index.js +38 -0
  24. package/dist/internal/logger/level-resolver.js +16 -0
  25. package/dist/internal/tools/string-validation.js +39 -0
  26. package/dist/internals.js +4 -0
  27. package/dist/node_modules/@scaleway/random-name/dist/index.js +254 -0
  28. package/dist/scw/client-ini-factory.js +24 -0
  29. package/dist/scw/client-ini-profile.js +30 -0
  30. package/dist/scw/client-settings.js +49 -0
  31. package/dist/scw/client.js +96 -0
  32. package/dist/scw/constants.js +4 -0
  33. package/dist/scw/errors/error-parser.js +121 -0
  34. package/dist/scw/errors/non-standard/invalid-request-mapper.js +34 -0
  35. package/dist/scw/errors/non-standard/unknown-resource-mapper.js +26 -0
  36. package/dist/scw/errors/scw-error.js +64 -0
  37. package/dist/scw/errors/standard/already-exists-error.js +26 -0
  38. package/dist/scw/errors/standard/denied-authentication-error.js +58 -0
  39. package/dist/scw/errors/standard/index.js +12 -0
  40. package/dist/scw/errors/standard/invalid-arguments-error.js +75 -0
  41. package/dist/scw/errors/standard/out-of-stock-error.js +24 -0
  42. package/dist/scw/errors/standard/permissions-denied-error.js +50 -0
  43. package/dist/scw/errors/standard/precondition-failed-error.js +62 -0
  44. package/dist/scw/errors/standard/quotas-exceeded-error.js +61 -0
  45. package/dist/scw/errors/standard/resource-expired-error.js +26 -0
  46. package/dist/scw/errors/standard/resource-locked-error.js +25 -0
  47. package/dist/scw/errors/standard/resource-not-found-error.js +25 -0
  48. package/dist/scw/errors/standard/transient-state-error.js +26 -0
  49. package/dist/scw/errors/types.js +26 -0
  50. package/dist/scw/fetch/build-fetcher.js +66 -0
  51. package/dist/scw/fetch/http-dumper.js +57 -0
  52. package/dist/scw/fetch/http-interceptors.js +80 -0
  53. package/dist/scw/fetch/resource-paginator.js +41 -0
  54. package/dist/scw/fetch/response-parser.js +46 -0
  55. package/dist/scw/marshalling.js +103 -0
  56. package/package.json +27 -0
@@ -0,0 +1,1126 @@
1
+ declare type Region = 'fr-par' | 'nl-ams' | 'pl-waw' | string;
2
+ declare type Zone = 'fr-par-1' | 'fr-par-2' | 'fr-par-3' | 'nl-ams-1' | 'pl-waw-1' | string;
3
+
4
+ /**
5
+ * Holds access key and secret key.
6
+ *
7
+ * @public
8
+ */
9
+ interface AuthenticationSecrets {
10
+ /**
11
+ * You need an access key and a secret key to connect to Scaleway API.
12
+ * Generate your token at the following address: {@link https://console.scaleway.com/project/credentials}.
13
+ */
14
+ accessKey: string;
15
+ /**
16
+ * The secret key is the value that can be used to authenticate against the API (the value used in X-Auth-Token HTTP-header).
17
+ * The secret key MUST remain secret and not given to anyone or published online.
18
+ */
19
+ secretKey: string;
20
+ }
21
+ /**
22
+ * Holds default values of a Scaleway profile.
23
+ *
24
+ * @public
25
+ */
26
+ interface DefaultValues {
27
+ /**
28
+ * APIURL overrides the API URL of the Scaleway API to the given URL.
29
+ * Change that if you want to direct requests to a different endpoint.
30
+ *
31
+ * @defaultValue `https://api.scaleway.com`
32
+ */
33
+ apiURL: string;
34
+ /**
35
+ * Your organization ID is the identifier of your account inside Scaleway infrastructure.
36
+ */
37
+ defaultOrganizationId?: string;
38
+ /**
39
+ * Your project ID is the identifier of the project your resources are attached to.
40
+ */
41
+ defaultProjectId?: string;
42
+ /**
43
+ * A region is represented as a geographical area such as France (Paris) or the Netherlands (Amsterdam).
44
+ * It can contain multiple availability zones.
45
+ *
46
+ * Examples: fr-par, nl-ams.
47
+ */
48
+ defaultRegion?: Region;
49
+ /**
50
+ * A region can be split into many availability zones (AZ).
51
+ * Latency between multiple AZ of the same region are low as they have a common network layer.
52
+ *
53
+ * Examples: fr-par-1, nl-ams-1
54
+ */
55
+ defaultZone?: Zone;
56
+ }
57
+ /**
58
+ * Holds values of a Scaleway profile.
59
+ *
60
+ * @public
61
+ */
62
+ declare type Profile = Partial<DefaultValues & AuthenticationSecrets>;
63
+
64
+ interface Interceptor<T> {
65
+ (instance: Readonly<T>): T | Promise<T>;
66
+ }
67
+
68
+ /** Request Interceptor. */
69
+ declare type RequestInterceptor = Interceptor<Request>;
70
+
71
+ /** Response Interceptor. */
72
+ declare type ResponseInterceptor = Interceptor<Response>;
73
+
74
+ /**
75
+ * Settings hold the values of all client options.
76
+ *
77
+ * @public
78
+ */
79
+ interface Settings extends DefaultValues {
80
+ /**
81
+ * The default number of results when requesting a paginated resource.
82
+ */
83
+ defaultPageSize?: number;
84
+ /**
85
+ * HTTP Client doing the requests.
86
+ */
87
+ httpClient: typeof fetch;
88
+ /**
89
+ * The Request interceptors.
90
+ */
91
+ requestInterceptors: RequestInterceptor[];
92
+ /**
93
+ * The Response interceptors.
94
+ */
95
+ responseInterceptors: ResponseInterceptor[];
96
+ /**
97
+ * The User-Agent sent with each request.
98
+ *
99
+ * @defaultValue scaleway-sdk-js/version
100
+ */
101
+ userAgent: string;
102
+ }
103
+
104
+ /**
105
+ * A factory to build {@link Settings}.
106
+ *
107
+ * @public
108
+ */
109
+ declare type ClientConfig = (obj: Settings) => Settings;
110
+ /**
111
+ * Instanciates the SDK from a configuration {@link Profile}.
112
+ *
113
+ * @param profile - The profile
114
+ * @returns A factory {@link ClientConfig}
115
+ *
116
+ * @public
117
+ */
118
+ declare const withProfile: (profile: Readonly<Profile>) => (settings: Readonly<Settings>) => Settings;
119
+
120
+ /** Scaleway Request. */
121
+ declare type ScwRequest = {
122
+ method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
123
+ path: string;
124
+ headers?: Record<string, string>;
125
+ body?: string;
126
+ urlParams?: URLSearchParams;
127
+ };
128
+ /**
129
+ * A factory to unmarshal a response.
130
+ *
131
+ * @param obj - The input object.
132
+ * @returns The output object
133
+ */
134
+ declare type ResponseUnmarshaller<T> = (obj: unknown) => T;
135
+ interface PaginatedResponse {
136
+ totalCount: number;
137
+ }
138
+
139
+ declare type Fetcher = <T>(request: Readonly<ScwRequest>, unwrapper?: ResponseUnmarshaller<T>) => Promise<T>;
140
+
141
+ /**
142
+ * Scaleway client.
143
+ */
144
+ declare type ScwClient = {
145
+ fetch: Fetcher;
146
+ settings: Settings;
147
+ };
148
+ /**
149
+ * Creates a Scaleway client with advanced options.
150
+ * You can either use existing factories
151
+ * (like `withProfile`, `withUserAgentSuffix`, etc)
152
+ * or write your own using the interface `ClientConfig`.
153
+ *
154
+ * @example
155
+ * Creates a client with factories:
156
+ * ```
157
+ * createAdvancedScwClient(
158
+ * (obj: Settings) => ({
159
+ * ...obj,
160
+ * defaultPageSize: 100 ,
161
+ * httpClient: myFetchWrapper,
162
+ * }),
163
+ * withUserAgentSuffix('bot-name/1.0'),
164
+ * )
165
+ * ```
166
+ *
167
+ * @throws Error
168
+ * Thrown if the setup fails.
169
+ *
170
+ * @public
171
+ */
172
+ declare const createAdvancedScwClient: (...configs: ClientConfig[]) => ScwClient;
173
+ /**
174
+ * Creates a Scaleway client with a profile (recommended).
175
+ *
176
+ * @example
177
+ * Creates a client with hard coded values:
178
+ * ```
179
+ * createScwClient({
180
+ * accessKey: 'SCWXXXXXXXXXXXXXXXXX',
181
+ * secretKey: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
182
+ * defaultProjectId: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
183
+ * defaultRegion: 'fr',
184
+ * defaultZone: 'fr-par-1',
185
+ * })
186
+ * ```
187
+ *
188
+ * @example
189
+ * Creates a client by loading values from the environment or the config file:
190
+ * ```
191
+ * import { loadProfileFromConfigurationFile } from '@scaleway/configuration-loader'
192
+ *
193
+ * createScwClient({
194
+ * ...await loadProfileFromConfigurationFile(),
195
+ * defaultZone: 'fr-par-3',
196
+ * })
197
+ * ```
198
+ *
199
+ * @throws Error
200
+ * Thrown if the setup fails.
201
+ *
202
+ * @public
203
+ */
204
+ declare const createScwClient: (profile?: Profile) => ScwClient;
205
+
206
+ declare enum LevelResolver {
207
+ silent = 0,
208
+ error = 1,
209
+ warn = 2,
210
+ info = 3,
211
+ debug = 4
212
+ }
213
+ declare type LogLevel = keyof typeof LevelResolver;
214
+
215
+ /**
216
+ * Logger.
217
+ *
218
+ * @public
219
+ */
220
+ interface Logger {
221
+ readonly logLevel: LogLevel;
222
+ debug: (message: string) => void;
223
+ info: (message: string) => void;
224
+ warn: (message: string) => void;
225
+ error: (message: string) => void;
226
+ }
227
+
228
+ /**
229
+ * Sets a logger to be used within the SDK.
230
+ *
231
+ * @param logger - The Logger instance
232
+ *
233
+ * @public
234
+ */
235
+ declare const setLogger: (logger: Readonly<Logger>) => void;
236
+ /**
237
+ * Sets the logger to console logger with given logLevel.
238
+ *
239
+ * @param logLevel - The Log level name
240
+ *
241
+ * @public
242
+ */
243
+ declare const enableConsoleLogger: (logLevel?: LogLevel) => void;
244
+
245
+ interface TokenAccessor {
246
+ (): Promise<string>;
247
+ }
248
+ /**
249
+ * Authenticates with a session token.
250
+ *
251
+ * @param getToken - The token accessor
252
+ * @returns The request interceptor
253
+ *
254
+ * @internal
255
+ */
256
+ declare const authenticateWithSessionToken: (getToken: TokenAccessor) => RequestInterceptor;
257
+
258
+ /**
259
+ * Unmarshals input to a record with camilized keys and instanciated Date.
260
+ *
261
+ * @param obj - The input
262
+ * @param ignoreKeys - The keys which should be not be transformed
263
+ * @param dateKeys - The keys which should be transformed to Date
264
+ * @returns The record
265
+ *
266
+ * @throws TypeError
267
+ * Thrown if the input isn't {@link JSONObject}.
268
+ *
269
+ * @internal
270
+ */
271
+ declare const unmarshalAnyRes: <T>(obj: unknown, ignoreKeys?: string[], dateKeys?: string[] | undefined) => T;
272
+
273
+ /**
274
+ * Abstract class to instanciate API from a {@link ScwClient}
275
+ * @internal
276
+ */
277
+ declare abstract class API {
278
+ protected client: ScwClient;
279
+ constructor(client: ScwClient);
280
+ }
281
+
282
+ declare type RegionFetcher<T, R> = (request: R) => Promise<T[]>;
283
+ /**
284
+ * Executes a request for several regions at once.
285
+ *
286
+ * @param regions - The regions
287
+ * @param fetcher - The fetcher
288
+ * @param request - The request
289
+ * @returns The resolved promise
290
+ *
291
+ * @internal
292
+ */
293
+ declare const forRegions: <T, R extends {
294
+ region?: string | undefined;
295
+ }>(regions: Region[], fetcher: RegionFetcher<T, R>, request: R) => Promise<T[]>;
296
+
297
+ declare const internals_authenticateWithSessionToken: typeof authenticateWithSessionToken;
298
+ declare const internals_unmarshalAnyRes: typeof unmarshalAnyRes;
299
+ type internals_API = API;
300
+ declare const internals_API: typeof API;
301
+ declare const internals_forRegions: typeof forRegions;
302
+ declare namespace internals {
303
+ export {
304
+ internals_authenticateWithSessionToken as authenticateWithSessionToken,
305
+ internals_unmarshalAnyRes as unmarshalAnyRes,
306
+ internals_API as API,
307
+ internals_forRegions as forRegions,
308
+ };
309
+ }
310
+
311
+ declare type JSON = string | number | boolean | null | JSON[] | {
312
+ [key: string]: JSON;
313
+ };
314
+ declare type JSONObject = {
315
+ [key: string]: JSON;
316
+ };
317
+
318
+ /**
319
+ * Scaleway error.
320
+ *
321
+ * @public
322
+ */
323
+ declare class ScalewayError extends Error {
324
+ readonly status: number;
325
+ readonly body: JSONObject | string;
326
+ readonly message: string;
327
+ constructor(status: number, body: JSONObject | string, message?: string);
328
+ static fromJSON(status: number, obj: Readonly<JSONObject>): ScalewayError | null;
329
+ }
330
+
331
+ /**
332
+ * AlreadyExists error is used when a resource already exists.
333
+ *
334
+ * @public
335
+ */
336
+ declare class AlreadyExistsError extends ScalewayError {
337
+ readonly status: number;
338
+ readonly body: JSONObject;
339
+ readonly resource: string;
340
+ readonly resourceId: string;
341
+ readonly helpMessage: string;
342
+ constructor(status: number, body: JSONObject, resource: string, resourceId: string, helpMessage: string);
343
+ static fromJSON(status: number, obj: Readonly<JSONObject>): AlreadyExistsError | null;
344
+ }
345
+
346
+ /**
347
+ * DeniedAuthentication error is used by the API Gateway auth service to deny a request.
348
+ *
349
+ * @public
350
+ */
351
+ declare class DeniedAuthenticationError extends ScalewayError {
352
+ readonly status: number;
353
+ readonly body: JSONObject;
354
+ readonly method: string;
355
+ readonly reason: string;
356
+ constructor(status: number, body: JSONObject, method: string, reason: string);
357
+ static fromJSON(status: number, obj: Readonly<JSONObject>): DeniedAuthenticationError | null;
358
+ }
359
+
360
+ /**
361
+ * Details of an {@link InvalidArgumentsError} error.
362
+ *
363
+ * @internal
364
+ */
365
+ declare type InvalidArgumentsErrorDetails = {
366
+ readonly argumentName: string;
367
+ readonly reason: string;
368
+ readonly helpMessage?: string;
369
+ };
370
+ /**
371
+ * InvalidArguments error happens when one or many fields are invalid in the request message.
372
+ *
373
+ * @public
374
+ */
375
+ declare class InvalidArgumentsError extends ScalewayError {
376
+ readonly status: number;
377
+ readonly body: JSONObject;
378
+ readonly details: Array<InvalidArgumentsErrorDetails>;
379
+ constructor(status: number, body: JSONObject, details: Array<InvalidArgumentsErrorDetails>);
380
+ static fromJSON(status: number, obj: Readonly<JSONObject>): InvalidArgumentsError | null;
381
+ }
382
+
383
+ /**
384
+ * OutOfStock error happens when stocks are empty for the resource.
385
+ *
386
+ * @public
387
+ */
388
+ declare class OutOfStockError extends ScalewayError {
389
+ readonly status: number;
390
+ readonly body: JSONObject;
391
+ readonly resource: string;
392
+ constructor(status: number, body: JSONObject, resource: string);
393
+ static fromJSON(status: number, obj: Readonly<JSONObject>): OutOfStockError | null;
394
+ }
395
+
396
+ /**
397
+ * Details of an {@link PermissionsDeniedError} error.
398
+ *
399
+ * @public
400
+ */
401
+ declare type PermissionsDeniedErrorDetails = {
402
+ readonly resource: string;
403
+ readonly action: string;
404
+ };
405
+ /**
406
+ * PermissionsDenied error happens when one or many permissions are not accorded to the user making the request.
407
+ *
408
+ * @public
409
+ */
410
+ declare class PermissionsDeniedError extends ScalewayError {
411
+ readonly status: number;
412
+ readonly body: JSONObject;
413
+ readonly list: Array<PermissionsDeniedErrorDetails>;
414
+ constructor(status: number, body: JSONObject, list: Array<PermissionsDeniedErrorDetails>);
415
+ static fromJSON(status: number, obj: Readonly<JSONObject>): ScalewayError | null;
416
+ }
417
+
418
+ /**
419
+ * PreconditionFailed error is used when a precondition is not respected.
420
+ *
421
+ * @public
422
+ */
423
+ declare class PreconditionFailedError extends ScalewayError {
424
+ readonly status: number;
425
+ readonly body: JSONObject;
426
+ readonly precondition: string;
427
+ readonly helpMessage: string;
428
+ constructor(status: number, body: JSONObject, precondition: string, helpMessage: string);
429
+ static fromJSON(status: number, obj: Readonly<JSONObject>): PreconditionFailedError | null;
430
+ }
431
+
432
+ /**
433
+ * Scope of an {@link QuotasExceededErrorDetails} error.
434
+ *
435
+ * @public
436
+ */
437
+ declare type QuotasExceededErrorScope = {
438
+ kind: 'organization' | 'project';
439
+ id: string;
440
+ };
441
+ /**
442
+ * Details of an {@link QuotasExceededError} error.
443
+ *
444
+ * @public
445
+ */
446
+ declare type QuotasExceededErrorDetails = {
447
+ readonly resource: string;
448
+ readonly quota: number;
449
+ readonly current: number;
450
+ readonly scope?: QuotasExceededErrorScope;
451
+ };
452
+ /**
453
+ * QuotasExceeded error happens when one or many resource exceed quotas during the creation of a resource.
454
+ *
455
+ * @public
456
+ */
457
+ declare class QuotasExceededError extends ScalewayError {
458
+ readonly status: number;
459
+ readonly body: JSONObject;
460
+ readonly list: Array<QuotasExceededErrorDetails>;
461
+ constructor(status: number, body: JSONObject, list: Array<QuotasExceededErrorDetails>);
462
+ static fromJSON(status: number, obj: Readonly<JSONObject>): QuotasExceededError | null;
463
+ }
464
+
465
+ /**
466
+ * ResourceExpired error happens when trying to access a resource that has expired.
467
+ *
468
+ * @public
469
+ */
470
+ declare class ResourceExpiredError extends ScalewayError {
471
+ readonly status: number;
472
+ readonly body: JSONObject;
473
+ readonly resource: string;
474
+ readonly resourceId: string;
475
+ readonly expiredSince: Date;
476
+ constructor(status: number, body: JSONObject, resource: string, resourceId: string, expiredSince: Date);
477
+ static fromJSON(status: number, obj: Readonly<JSONObject>): ResourceExpiredError | null;
478
+ }
479
+
480
+ /**
481
+ * ResourceLocked error happens when a resource is locked by trust and safety.
482
+ *
483
+ * @public
484
+ */
485
+ declare class ResourceLockedError extends ScalewayError {
486
+ readonly status: number;
487
+ readonly body: JSONObject;
488
+ readonly resource: string;
489
+ readonly resourceId: string;
490
+ constructor(status: number, body: JSONObject, resource: string, resourceId: string);
491
+ static fromJSON(status: number, obj: Readonly<JSONObject>): ResourceLockedError | null;
492
+ }
493
+
494
+ /**
495
+ * ResourceNotFound error happens when getting a resource that does not exist anymore.
496
+ *
497
+ * @public
498
+ */
499
+ declare class ResourceNotFoundError extends ScalewayError {
500
+ readonly status: number;
501
+ readonly body: JSONObject;
502
+ readonly resource: string;
503
+ readonly resourceId: string;
504
+ constructor(status: number, body: JSONObject, resource: string, resourceId: string);
505
+ static fromJSON(status: number, obj: Readonly<JSONObject>): ResourceNotFoundError | null;
506
+ }
507
+
508
+ /**
509
+ * TransientState error happens when trying to perform an action on a resource in a transient state.
510
+ *
511
+ * @public
512
+ */
513
+ declare class TransientStateError extends ScalewayError {
514
+ readonly status: number;
515
+ readonly body: JSONObject;
516
+ readonly resource: string;
517
+ readonly resourceId: string;
518
+ readonly currentState: string;
519
+ constructor(status: number, body: JSONObject, resource: string, resourceId: string, currentState: string);
520
+ static fromJSON(status: number, obj: Readonly<JSONObject>): ScalewayError | null;
521
+ }
522
+
523
+ type index_ScalewayError = ScalewayError;
524
+ declare const index_ScalewayError: typeof ScalewayError;
525
+ type index_AlreadyExistsError = AlreadyExistsError;
526
+ declare const index_AlreadyExistsError: typeof AlreadyExistsError;
527
+ type index_DeniedAuthenticationError = DeniedAuthenticationError;
528
+ declare const index_DeniedAuthenticationError: typeof DeniedAuthenticationError;
529
+ type index_InvalidArgumentsError = InvalidArgumentsError;
530
+ declare const index_InvalidArgumentsError: typeof InvalidArgumentsError;
531
+ type index_OutOfStockError = OutOfStockError;
532
+ declare const index_OutOfStockError: typeof OutOfStockError;
533
+ type index_PermissionsDeniedError = PermissionsDeniedError;
534
+ declare const index_PermissionsDeniedError: typeof PermissionsDeniedError;
535
+ type index_PreconditionFailedError = PreconditionFailedError;
536
+ declare const index_PreconditionFailedError: typeof PreconditionFailedError;
537
+ type index_QuotasExceededError = QuotasExceededError;
538
+ declare const index_QuotasExceededError: typeof QuotasExceededError;
539
+ type index_ResourceExpiredError = ResourceExpiredError;
540
+ declare const index_ResourceExpiredError: typeof ResourceExpiredError;
541
+ type index_ResourceLockedError = ResourceLockedError;
542
+ declare const index_ResourceLockedError: typeof ResourceLockedError;
543
+ type index_ResourceNotFoundError = ResourceNotFoundError;
544
+ declare const index_ResourceNotFoundError: typeof ResourceNotFoundError;
545
+ type index_TransientStateError = TransientStateError;
546
+ declare const index_TransientStateError: typeof TransientStateError;
547
+ declare namespace index {
548
+ export {
549
+ index_ScalewayError as ScalewayError,
550
+ index_AlreadyExistsError as AlreadyExistsError,
551
+ index_DeniedAuthenticationError as DeniedAuthenticationError,
552
+ index_InvalidArgumentsError as InvalidArgumentsError,
553
+ index_OutOfStockError as OutOfStockError,
554
+ index_PermissionsDeniedError as PermissionsDeniedError,
555
+ index_PreconditionFailedError as PreconditionFailedError,
556
+ index_QuotasExceededError as QuotasExceededError,
557
+ index_ResourceExpiredError as ResourceExpiredError,
558
+ index_ResourceLockedError as ResourceLockedError,
559
+ index_ResourceNotFoundError as ResourceNotFoundError,
560
+ index_TransientStateError as TransientStateError,
561
+ };
562
+ }
563
+
564
+ declare type ImageStatus = 'unknown' | 'ready' | 'deleting' | 'error' | 'locked';
565
+ declare type ImageVisibility = 'visibility_unknown' | 'inherit' | 'public' | 'private';
566
+ declare type ListImagesRequestOrderBy = 'created_at_asc' | 'created_at_desc' | 'name_asc' | 'name_desc';
567
+ declare type ListNamespacesRequestOrderBy$1 = 'created_at_asc' | 'created_at_desc' | 'description_asc' | 'description_desc' | 'name_asc' | 'name_desc';
568
+ declare type ListTagsRequestOrderBy = 'created_at_asc' | 'created_at_desc' | 'name_asc' | 'name_desc';
569
+ declare type NamespaceStatus$1 = 'unknown' | 'ready' | 'deleting' | 'error' | 'locked';
570
+ declare type TagStatus = 'unknown' | 'ready' | 'deleting' | 'error' | 'locked';
571
+ interface Image {
572
+ id: string;
573
+ name: string;
574
+ namespaceId: string;
575
+ status: ImageStatus;
576
+ statusMessage?: string;
577
+ visibility: ImageVisibility;
578
+ size: number;
579
+ createdAt?: Date;
580
+ updatedAt?: Date;
581
+ tags: string[];
582
+ }
583
+ interface Namespace$1 {
584
+ id: string;
585
+ name: string;
586
+ description: string;
587
+ organizationId: string;
588
+ projectId: string;
589
+ status: NamespaceStatus$1;
590
+ statusMessage: string;
591
+ endpoint: string;
592
+ isPublic: boolean;
593
+ size: number;
594
+ createdAt?: Date;
595
+ updatedAt?: Date;
596
+ imageCount: number;
597
+ region: Region;
598
+ }
599
+ interface Tag {
600
+ id: string;
601
+ name: string;
602
+ imageId: string;
603
+ status: TagStatus;
604
+ digest: string;
605
+ createdAt?: Date;
606
+ updatedAt?: Date;
607
+ }
608
+ interface ListImagesResponse extends PaginatedResponse {
609
+ images: Image[];
610
+ }
611
+ interface ListNamespacesResponse$1 extends PaginatedResponse {
612
+ namespaces: Namespace$1[];
613
+ }
614
+ interface ListTagsResponse extends PaginatedResponse {
615
+ tags: Tag[];
616
+ }
617
+ declare type ListNamespacesRequest$1 = {
618
+ region?: Region;
619
+ page?: number;
620
+ pageSize?: number;
621
+ orderBy?: ListNamespacesRequestOrderBy$1;
622
+ organizationId?: string;
623
+ projectId?: string;
624
+ name?: string;
625
+ };
626
+ declare type ListImagesRequest = {
627
+ region?: Region;
628
+ page?: number;
629
+ pageSize?: number;
630
+ orderBy?: ListImagesRequestOrderBy;
631
+ namespaceId?: string;
632
+ name?: string;
633
+ organizationId?: string;
634
+ projectId?: string;
635
+ };
636
+ declare type GetNamespaceRequest$1 = {
637
+ region?: Region;
638
+ namespaceId: string;
639
+ };
640
+ declare type CreateNamespaceRequest$1 = {
641
+ region?: Region;
642
+ name: string;
643
+ description: string;
644
+ projectId?: string;
645
+ organizationId?: string;
646
+ isPublic: boolean;
647
+ };
648
+ declare type UpdateNamespaceRequest$1 = {
649
+ region?: Region;
650
+ namespaceId: string;
651
+ description?: string;
652
+ isPublic?: boolean;
653
+ };
654
+ declare type DeleteNamespaceRequest$1 = {
655
+ region?: Region;
656
+ namespaceId: string;
657
+ };
658
+ declare type GetImageRequest = {
659
+ region?: Region;
660
+ imageId: string;
661
+ };
662
+ declare type UpdateImageRequest = {
663
+ region?: Region;
664
+ imageId: string;
665
+ visibility: ImageVisibility;
666
+ };
667
+ declare type DeleteImageRequest = {
668
+ region?: Region;
669
+ imageId: string;
670
+ };
671
+ declare type ListTagsRequest = {
672
+ region?: Region;
673
+ imageId: string;
674
+ page?: number;
675
+ pageSize?: number;
676
+ orderBy?: ListTagsRequestOrderBy;
677
+ name?: string;
678
+ };
679
+ declare type GetTagRequest = {
680
+ region?: Region;
681
+ tagId: string;
682
+ };
683
+ declare type DeleteTagRequest = {
684
+ region?: Region;
685
+ tagId: string;
686
+ force: boolean;
687
+ };
688
+
689
+ type types$1_ImageStatus = ImageStatus;
690
+ type types$1_ImageVisibility = ImageVisibility;
691
+ type types$1_ListImagesRequestOrderBy = ListImagesRequestOrderBy;
692
+ type types$1_ListTagsRequestOrderBy = ListTagsRequestOrderBy;
693
+ type types$1_TagStatus = TagStatus;
694
+ type types$1_Image = Image;
695
+ type types$1_Tag = Tag;
696
+ type types$1_ListImagesResponse = ListImagesResponse;
697
+ type types$1_ListTagsResponse = ListTagsResponse;
698
+ type types$1_ListImagesRequest = ListImagesRequest;
699
+ type types$1_GetImageRequest = GetImageRequest;
700
+ type types$1_UpdateImageRequest = UpdateImageRequest;
701
+ type types$1_DeleteImageRequest = DeleteImageRequest;
702
+ type types$1_ListTagsRequest = ListTagsRequest;
703
+ type types$1_GetTagRequest = GetTagRequest;
704
+ type types$1_DeleteTagRequest = DeleteTagRequest;
705
+ declare namespace types$1 {
706
+ export {
707
+ types$1_ImageStatus as ImageStatus,
708
+ types$1_ImageVisibility as ImageVisibility,
709
+ types$1_ListImagesRequestOrderBy as ListImagesRequestOrderBy,
710
+ ListNamespacesRequestOrderBy$1 as ListNamespacesRequestOrderBy,
711
+ types$1_ListTagsRequestOrderBy as ListTagsRequestOrderBy,
712
+ NamespaceStatus$1 as NamespaceStatus,
713
+ types$1_TagStatus as TagStatus,
714
+ types$1_Image as Image,
715
+ Namespace$1 as Namespace,
716
+ types$1_Tag as Tag,
717
+ types$1_ListImagesResponse as ListImagesResponse,
718
+ ListNamespacesResponse$1 as ListNamespacesResponse,
719
+ types$1_ListTagsResponse as ListTagsResponse,
720
+ ListNamespacesRequest$1 as ListNamespacesRequest,
721
+ types$1_ListImagesRequest as ListImagesRequest,
722
+ GetNamespaceRequest$1 as GetNamespaceRequest,
723
+ CreateNamespaceRequest$1 as CreateNamespaceRequest,
724
+ UpdateNamespaceRequest$1 as UpdateNamespaceRequest,
725
+ DeleteNamespaceRequest$1 as DeleteNamespaceRequest,
726
+ types$1_GetImageRequest as GetImageRequest,
727
+ types$1_UpdateImageRequest as UpdateImageRequest,
728
+ types$1_DeleteImageRequest as DeleteImageRequest,
729
+ types$1_ListTagsRequest as ListTagsRequest,
730
+ types$1_GetTagRequest as GetTagRequest,
731
+ types$1_DeleteTagRequest as DeleteTagRequest,
732
+ };
733
+ }
734
+
735
+ declare type WaitForOptions = {
736
+ timeout?: number;
737
+ retryInterval?: number;
738
+ };
739
+
740
+ declare abstract class WaitForRegistryAPI extends API {
741
+ abstract getNamespace: (request: GetNamespaceRequest$1) => Promise<Namespace$1>;
742
+ abstract getImage: (request: GetImageRequest) => Promise<Image>;
743
+ abstract getTag: (request: GetTagRequest) => Promise<Tag>;
744
+ waitForNamespace: (request: Readonly<GetNamespaceRequest$1>, options?: Readonly<WaitForOptions> | undefined) => Promise<Namespace$1>;
745
+ waitForImage: (request: Readonly<GetImageRequest>, options?: Readonly<WaitForOptions> | undefined) => Promise<Image>;
746
+ waitForTag: (request: Readonly<GetTagRequest>, options?: Readonly<WaitForOptions> | undefined) => Promise<Tag>;
747
+ }
748
+
749
+ declare class RegistryAPI extends WaitForRegistryAPI {
750
+ createNamespace: ({ region, ...req }: Readonly<CreateNamespaceRequest$1>) => Promise<Namespace$1>;
751
+ updateNamespace: ({ region, ...req }: Readonly<UpdateNamespaceRequest$1>) => Promise<Namespace$1>;
752
+ getNamespace: ({ region, ...req }: Readonly<GetNamespaceRequest$1>) => Promise<Namespace$1>;
753
+ private listNamespaces;
754
+ paginateNamespaces: (request?: Readonly<ListNamespacesRequest$1>) => AsyncGenerator<Namespace$1[], void, number | undefined>;
755
+ listAllNamespaces: (request?: Readonly<ListNamespacesRequest$1>) => Promise<Namespace$1[]>;
756
+ deleteNamespace: ({ region, ...req }: Readonly<DeleteNamespaceRequest$1>) => Promise<Namespace$1>;
757
+ updateImage: ({ region, ...req }: Readonly<UpdateImageRequest>) => Promise<Image>;
758
+ getImage: ({ region, ...req }: Readonly<GetImageRequest>) => Promise<Image>;
759
+ private listImages;
760
+ paginateImages: (request?: Readonly<ListImagesRequest>) => AsyncGenerator<Image[], void, number | undefined>;
761
+ listAllImages: (request?: Readonly<ListImagesRequest>) => Promise<Image[]>;
762
+ deleteImage: ({ region, ...req }: Readonly<DeleteImageRequest>) => Promise<Image>;
763
+ getTag: ({ region, ...req }: Readonly<GetTagRequest>) => Promise<Tag>;
764
+ private listTags;
765
+ paginateTags: (request: ListTagsRequest) => AsyncGenerator<Tag[], void, number | undefined>;
766
+ listAllTags: (request: ListTagsRequest) => Promise<Tag[]>;
767
+ deleteTag: ({ region, ...req }: Readonly<DeleteTagRequest>) => Promise<Tag>;
768
+ }
769
+
770
+ declare type NamespaceStatus = 'unknown' | 'ready' | 'deleting' | 'error' | 'locked' | 'creating' | 'pending';
771
+ declare type ListNamespacesRequestOrderBy = 'created_at_asc' | 'created_at_desc' | 'name_asc' | 'name_desc';
772
+ declare type FunctionRuntime = 'unknown_runtime' | 'golang' | 'python' | 'python3' | 'node8' | 'node10' | 'node14';
773
+ declare type FunctionStatus = 'unknown' | 'ready' | 'deleting' | 'error' | 'locked' | 'creating' | 'pending' | 'created';
774
+ declare type FunctionPrivacy = 'unknown_privacy' | 'public' | 'private';
775
+ declare type ListFunctionsRequestOrderBy = 'created_at_asc' | 'created_at_desc' | 'name_asc' | 'name_desc';
776
+ declare type DomainStatus = 'unknown' | 'ready' | 'deleting' | 'error' | 'creating' | 'pending';
777
+ declare type ListDomainsRequestOrderBy = 'created_at_asc' | 'created_at_desc' | 'hostname_asc' | 'hostname_desc';
778
+ declare type CronStatus = 'unknown' | 'ready' | 'deleting' | 'error' | 'locked' | 'creating' | 'pending';
779
+ declare type ListCronsRequestOrderBy = 'created_at_asc' | 'created_at_desc';
780
+ declare type ListLogsRequestOrderBy = 'timestamp_desc' | 'timestamp_asc';
781
+ interface Cron {
782
+ id: string;
783
+ functionId: string;
784
+ schedule: string;
785
+ args: object;
786
+ status: CronStatus;
787
+ }
788
+ interface Namespace {
789
+ id: string;
790
+ name: string;
791
+ environmentVariables: Record<string, string>;
792
+ organizationId: string;
793
+ projectId: string;
794
+ status: NamespaceStatus;
795
+ registryNamespaceId: string;
796
+ errorMessage?: string;
797
+ registryEndpoint: string;
798
+ description?: string;
799
+ region: Region;
800
+ }
801
+ interface Function {
802
+ id: string;
803
+ name: string;
804
+ namespaceId: string;
805
+ status: FunctionStatus;
806
+ environmentVariables: Record<string, string>;
807
+ minScale: number;
808
+ maxScale: number;
809
+ runtime: FunctionRuntime;
810
+ memoryLimit: number;
811
+ cpuLimit: number;
812
+ timeout?: string;
813
+ handler: string;
814
+ errorMessage?: string;
815
+ privacy: FunctionPrivacy;
816
+ description?: string;
817
+ region: Region;
818
+ }
819
+ interface Domain {
820
+ id: string;
821
+ hostname: string;
822
+ functionId: string;
823
+ url: string;
824
+ status: DomainStatus;
825
+ errorMessage?: string;
826
+ }
827
+ interface Log {
828
+ message: string;
829
+ timestamp: number;
830
+ id: string;
831
+ }
832
+ interface UploadURL {
833
+ url: string;
834
+ headers: Record<string, string>;
835
+ }
836
+ interface DownloadURL {
837
+ url: string;
838
+ headers: Record<string, string>;
839
+ }
840
+ interface Token {
841
+ token: string;
842
+ publicKey: string;
843
+ }
844
+ declare type ListNamespacesRequest = {
845
+ region?: Region;
846
+ page?: number;
847
+ pageSize?: number;
848
+ orderBy?: ListNamespacesRequestOrderBy;
849
+ organizationId?: string;
850
+ projectId?: string;
851
+ name?: string;
852
+ };
853
+ interface ListNamespacesResponse extends PaginatedResponse {
854
+ namespaces: Namespace[];
855
+ }
856
+ declare type GetNamespaceRequest = {
857
+ region?: Region;
858
+ namespaceId: string;
859
+ };
860
+ declare type CreateNamespaceRequest = {
861
+ region?: Region;
862
+ projectId?: string;
863
+ name: string;
864
+ environmentVariables?: Record<string, string>;
865
+ description?: string;
866
+ };
867
+ declare type UpdateNamespaceRequest = {
868
+ region?: Region;
869
+ namespaceId: string;
870
+ environmentVariables?: Record<string, string>;
871
+ description?: string;
872
+ };
873
+ declare type DeleteNamespaceRequest = {
874
+ region?: Region;
875
+ namespaceId: string;
876
+ };
877
+ declare type IssueJWTRequest = {
878
+ region?: Region;
879
+ functionId?: string;
880
+ namespaceId?: string;
881
+ expiresAt?: Date;
882
+ };
883
+ declare type ListFunctionsRequest = {
884
+ region?: Region;
885
+ page?: number;
886
+ pageSize?: number;
887
+ orderBy?: ListFunctionsRequestOrderBy;
888
+ namespaceId?: string;
889
+ name?: string;
890
+ organizationId?: string;
891
+ projectId?: string;
892
+ };
893
+ interface ListFunctionsResponse extends PaginatedResponse {
894
+ functions: Function[];
895
+ }
896
+ declare type GetFunctionRequest = {
897
+ region?: Region;
898
+ functionId: string;
899
+ };
900
+ declare type CreateFunctionRequest = {
901
+ region?: Region;
902
+ namespaceId: string;
903
+ name: string;
904
+ environmentVariables?: Record<string, string>;
905
+ minScale?: number;
906
+ maxScale?: number;
907
+ runtime: FunctionRuntime;
908
+ memoryLimit?: number;
909
+ timeout?: string;
910
+ handler?: string;
911
+ privacy?: FunctionPrivacy;
912
+ description?: string;
913
+ };
914
+ declare type UpdateFunctionRequest = {
915
+ region?: Region;
916
+ functionId: string;
917
+ environmentVariables?: Record<string, string>;
918
+ minScale?: number;
919
+ maxScale?: number;
920
+ memoryLimit?: number;
921
+ timeout?: string;
922
+ redeploy?: boolean;
923
+ handler?: string;
924
+ privacy?: FunctionPrivacy;
925
+ description?: string;
926
+ };
927
+ declare type DeleteFunctionRequest = {
928
+ region?: Region;
929
+ functionId: string;
930
+ };
931
+ declare type DeployFunctionRequest = {
932
+ region?: Region;
933
+ functionId: string;
934
+ };
935
+ declare type GetFunctionUploadURLRequest = {
936
+ region?: Region;
937
+ functionId: string;
938
+ contentLength: number;
939
+ };
940
+ declare type GetFunctionDownloadURLRequest = {
941
+ region?: Region;
942
+ functionId: string;
943
+ };
944
+ declare type ListFunctionRuntimesRequest = {
945
+ region?: Region;
946
+ };
947
+ declare type ListFunctionRuntimesResponse = {
948
+ runtimes: FunctionRuntime[];
949
+ };
950
+ declare type ListCronsRequest = {
951
+ region?: Region;
952
+ page?: number;
953
+ pageSize?: number;
954
+ orderBy?: ListCronsRequestOrderBy;
955
+ functionId: string;
956
+ };
957
+ interface ListCronsResponse extends PaginatedResponse {
958
+ crons: Cron[];
959
+ }
960
+ declare type GetCronRequest = {
961
+ region?: Region;
962
+ cronId: string;
963
+ };
964
+ declare type CreateCronRequest = {
965
+ region?: Region;
966
+ functionId: string;
967
+ schedule: string;
968
+ args: object;
969
+ };
970
+ declare type DeleteCronRequest = {
971
+ region?: Region;
972
+ cronId: string;
973
+ };
974
+ declare type UpdateCronRequest = {
975
+ region?: Region;
976
+ cronId: string;
977
+ functionId?: string;
978
+ schedule?: string;
979
+ args: object;
980
+ };
981
+ declare type ListLogsRequest = {
982
+ region?: Region;
983
+ functionId: string;
984
+ page?: number;
985
+ pageSize?: number;
986
+ orderBy?: ListLogsRequestOrderBy;
987
+ };
988
+ interface ListLogsResponse extends PaginatedResponse {
989
+ logs: Log[];
990
+ }
991
+
992
+ type types_NamespaceStatus = NamespaceStatus;
993
+ type types_ListNamespacesRequestOrderBy = ListNamespacesRequestOrderBy;
994
+ type types_FunctionRuntime = FunctionRuntime;
995
+ type types_FunctionStatus = FunctionStatus;
996
+ type types_FunctionPrivacy = FunctionPrivacy;
997
+ type types_ListFunctionsRequestOrderBy = ListFunctionsRequestOrderBy;
998
+ type types_DomainStatus = DomainStatus;
999
+ type types_ListDomainsRequestOrderBy = ListDomainsRequestOrderBy;
1000
+ type types_CronStatus = CronStatus;
1001
+ type types_ListCronsRequestOrderBy = ListCronsRequestOrderBy;
1002
+ type types_ListLogsRequestOrderBy = ListLogsRequestOrderBy;
1003
+ type types_Cron = Cron;
1004
+ type types_Namespace = Namespace;
1005
+ type types_Function = Function;
1006
+ type types_Domain = Domain;
1007
+ type types_Log = Log;
1008
+ type types_UploadURL = UploadURL;
1009
+ type types_DownloadURL = DownloadURL;
1010
+ type types_Token = Token;
1011
+ type types_ListNamespacesRequest = ListNamespacesRequest;
1012
+ type types_ListNamespacesResponse = ListNamespacesResponse;
1013
+ type types_GetNamespaceRequest = GetNamespaceRequest;
1014
+ type types_CreateNamespaceRequest = CreateNamespaceRequest;
1015
+ type types_UpdateNamespaceRequest = UpdateNamespaceRequest;
1016
+ type types_DeleteNamespaceRequest = DeleteNamespaceRequest;
1017
+ type types_IssueJWTRequest = IssueJWTRequest;
1018
+ type types_ListFunctionsRequest = ListFunctionsRequest;
1019
+ type types_ListFunctionsResponse = ListFunctionsResponse;
1020
+ type types_GetFunctionRequest = GetFunctionRequest;
1021
+ type types_CreateFunctionRequest = CreateFunctionRequest;
1022
+ type types_UpdateFunctionRequest = UpdateFunctionRequest;
1023
+ type types_DeleteFunctionRequest = DeleteFunctionRequest;
1024
+ type types_DeployFunctionRequest = DeployFunctionRequest;
1025
+ type types_GetFunctionUploadURLRequest = GetFunctionUploadURLRequest;
1026
+ type types_GetFunctionDownloadURLRequest = GetFunctionDownloadURLRequest;
1027
+ type types_ListFunctionRuntimesRequest = ListFunctionRuntimesRequest;
1028
+ type types_ListFunctionRuntimesResponse = ListFunctionRuntimesResponse;
1029
+ type types_ListCronsRequest = ListCronsRequest;
1030
+ type types_ListCronsResponse = ListCronsResponse;
1031
+ type types_GetCronRequest = GetCronRequest;
1032
+ type types_CreateCronRequest = CreateCronRequest;
1033
+ type types_DeleteCronRequest = DeleteCronRequest;
1034
+ type types_UpdateCronRequest = UpdateCronRequest;
1035
+ type types_ListLogsRequest = ListLogsRequest;
1036
+ type types_ListLogsResponse = ListLogsResponse;
1037
+ declare namespace types {
1038
+ export {
1039
+ types_NamespaceStatus as NamespaceStatus,
1040
+ types_ListNamespacesRequestOrderBy as ListNamespacesRequestOrderBy,
1041
+ types_FunctionRuntime as FunctionRuntime,
1042
+ types_FunctionStatus as FunctionStatus,
1043
+ types_FunctionPrivacy as FunctionPrivacy,
1044
+ types_ListFunctionsRequestOrderBy as ListFunctionsRequestOrderBy,
1045
+ types_DomainStatus as DomainStatus,
1046
+ types_ListDomainsRequestOrderBy as ListDomainsRequestOrderBy,
1047
+ types_CronStatus as CronStatus,
1048
+ types_ListCronsRequestOrderBy as ListCronsRequestOrderBy,
1049
+ types_ListLogsRequestOrderBy as ListLogsRequestOrderBy,
1050
+ types_Cron as Cron,
1051
+ types_Namespace as Namespace,
1052
+ types_Function as Function,
1053
+ types_Domain as Domain,
1054
+ types_Log as Log,
1055
+ types_UploadURL as UploadURL,
1056
+ types_DownloadURL as DownloadURL,
1057
+ types_Token as Token,
1058
+ types_ListNamespacesRequest as ListNamespacesRequest,
1059
+ types_ListNamespacesResponse as ListNamespacesResponse,
1060
+ types_GetNamespaceRequest as GetNamespaceRequest,
1061
+ types_CreateNamespaceRequest as CreateNamespaceRequest,
1062
+ types_UpdateNamespaceRequest as UpdateNamespaceRequest,
1063
+ types_DeleteNamespaceRequest as DeleteNamespaceRequest,
1064
+ types_IssueJWTRequest as IssueJWTRequest,
1065
+ types_ListFunctionsRequest as ListFunctionsRequest,
1066
+ types_ListFunctionsResponse as ListFunctionsResponse,
1067
+ types_GetFunctionRequest as GetFunctionRequest,
1068
+ types_CreateFunctionRequest as CreateFunctionRequest,
1069
+ types_UpdateFunctionRequest as UpdateFunctionRequest,
1070
+ types_DeleteFunctionRequest as DeleteFunctionRequest,
1071
+ types_DeployFunctionRequest as DeployFunctionRequest,
1072
+ types_GetFunctionUploadURLRequest as GetFunctionUploadURLRequest,
1073
+ types_GetFunctionDownloadURLRequest as GetFunctionDownloadURLRequest,
1074
+ types_ListFunctionRuntimesRequest as ListFunctionRuntimesRequest,
1075
+ types_ListFunctionRuntimesResponse as ListFunctionRuntimesResponse,
1076
+ types_ListCronsRequest as ListCronsRequest,
1077
+ types_ListCronsResponse as ListCronsResponse,
1078
+ types_GetCronRequest as GetCronRequest,
1079
+ types_CreateCronRequest as CreateCronRequest,
1080
+ types_DeleteCronRequest as DeleteCronRequest,
1081
+ types_UpdateCronRequest as UpdateCronRequest,
1082
+ types_ListLogsRequest as ListLogsRequest,
1083
+ types_ListLogsResponse as ListLogsResponse,
1084
+ };
1085
+ }
1086
+
1087
+ declare abstract class WaitForFunctionAPI extends API {
1088
+ abstract getNamespace: (request: GetNamespaceRequest) => Promise<Namespace>;
1089
+ abstract getFunction: (request: GetFunctionRequest) => Promise<Function>;
1090
+ abstract getCron: (request: GetCronRequest) => Promise<Cron>;
1091
+ waitForNamespace: (request: Readonly<GetNamespaceRequest>, options?: Readonly<WaitForOptions> | undefined) => Promise<Namespace>;
1092
+ waitForFunction: (request: Readonly<GetFunctionRequest>, options?: Readonly<WaitForOptions> | undefined) => Promise<Function>;
1093
+ waitForCron: (request: Readonly<GetCronRequest>, options?: Readonly<WaitForOptions> | undefined) => Promise<Cron>;
1094
+ }
1095
+
1096
+ declare class FunctionAPI extends WaitForFunctionAPI {
1097
+ private listNamespaces;
1098
+ paginateNamespaces: (request?: Readonly<ListNamespacesRequest>) => AsyncGenerator<Namespace[], void, number | undefined>;
1099
+ listAllNamespaces: (request?: Readonly<ListNamespacesRequest>) => Promise<Namespace[]>;
1100
+ getNamespace: ({ region, ...req }: Readonly<GetNamespaceRequest>) => Promise<Namespace>;
1101
+ createNamespace: ({ projectId, region, ...req }: Readonly<CreateNamespaceRequest>) => Promise<Namespace>;
1102
+ updateNamespace: ({ region, ...req }: Readonly<UpdateNamespaceRequest>) => Promise<Namespace>;
1103
+ deleteNamespace: ({ region, ...req }: Readonly<DeleteNamespaceRequest>) => Promise<Namespace>;
1104
+ private listFunctions;
1105
+ paginateFunctions: (request?: Readonly<ListFunctionsRequest>) => AsyncGenerator<Function[], void, number | undefined>;
1106
+ listAllFunctions: (request?: Readonly<ListFunctionsRequest>) => Promise<Function[]>;
1107
+ getFunction: ({ region, ...req }: Readonly<GetFunctionRequest>) => Promise<Function>;
1108
+ createFunction: ({ region, ...req }: Readonly<CreateFunctionRequest>) => Promise<Function>;
1109
+ updateFunction: ({ region, ...req }: Readonly<UpdateFunctionRequest>) => Promise<Function>;
1110
+ deleteFunction: ({ region, ...req }: Readonly<DeleteFunctionRequest>) => Promise<Function>;
1111
+ deployFunction: ({ region, ...req }: Readonly<DeployFunctionRequest>) => Promise<Function>;
1112
+ getFunctionUploadURL: ({ region, ...req }: Readonly<GetFunctionUploadURLRequest>) => Promise<UploadURL>;
1113
+ getFunctionDownloadURL: ({ region, ...req }: Readonly<GetFunctionDownloadURLRequest>) => Promise<DownloadURL>;
1114
+ listFunctionRuntimes: ({ region, }?: Readonly<ListFunctionRuntimesRequest>) => Promise<ListFunctionRuntimesResponse>;
1115
+ listLogs: ({ region, orderBy, ...req }: Readonly<ListLogsRequest>) => Promise<ListLogsResponse>;
1116
+ private listCrons;
1117
+ paginateCrons: (request: Readonly<ListCronsRequest>) => AsyncGenerator<Cron[], void, number | undefined>;
1118
+ listAllCrons: (request: Readonly<ListCronsRequest>) => Promise<Cron[]>;
1119
+ getCron: ({ region, ...req }: Readonly<GetCronRequest>) => Promise<Cron>;
1120
+ createCron: ({ region, ...req }: Readonly<CreateCronRequest>) => Promise<Cron>;
1121
+ updateCron: ({ region, ...req }: Readonly<UpdateCronRequest>) => Promise<Cron>;
1122
+ deleteCron: ({ region, ...req }: Readonly<DeleteCronRequest>) => Promise<Cron>;
1123
+ issueJWT: ({ region, ...req }: Readonly<IssueJWTRequest>) => Promise<Token>;
1124
+ }
1125
+
1126
+ export { ClientConfig, index as Errors, FunctionAPI, types as FunctionNS, Logger, Profile, RegistryAPI, types$1 as RegistryNS, ScwClient, Settings, createAdvancedScwClient, createScwClient, enableConsoleLogger, internals, setLogger, withProfile };