@scaleway/sdk-function 1.6.0 → 2.1.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/README.md +96 -0
- package/dist/v1beta1/api.gen.d.ts +3 -2
- package/dist/v1beta1/api.gen.js +37 -56
- package/dist/v1beta1/content.gen.js +4 -1
- package/dist/v1beta1/index.gen.d.ts +1 -1
- package/dist/v1beta1/marshalling.gen.js +18 -34
- package/dist/v1beta1/types.gen.d.ts +2 -2
- package/package.json +6 -9
- package/dist/index.gen.cjs +0 -4
- package/dist/v1beta1/api.gen.cjs +0 -646
- package/dist/v1beta1/content.gen.cjs +0 -34
- package/dist/v1beta1/index.gen.cjs +0 -39
- package/dist/v1beta1/marshalling.gen.cjs +0 -475
- package/dist/v1beta1/validation-rules.gen.cjs +0 -57
package/README.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# @scaleway/sdk-function
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@scaleway/sdk-function)
|
|
4
|
+
[](https://www.npmjs.com/package/@scaleway/sdk-function)
|
|
5
|
+
[](https://github.com/scaleway/scaleway-sdk-js/blob/master/LICENSE)
|
|
6
|
+
|
|
7
|
+
Scaleway SDK for Function API.
|
|
8
|
+
|
|
9
|
+
> **Note**
|
|
10
|
+
> This is an automatically generated package that is part of the [Scaleway SDK for JavaScript](https://github.com/scaleway/scaleway-sdk-js).
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install @scaleway/sdk-function @scaleway/sdk-client
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
or with pnpm:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
pnpm add @scaleway/sdk-function @scaleway/sdk-client
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
or with yarn:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
yarn add @scaleway/sdk-function @scaleway/sdk-client
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Getting Started
|
|
31
|
+
|
|
32
|
+
You'll need a pair of access and secret keys to connect to Scaleway API. Please check the [documentation](https://www.scaleway.com/en/docs/identity-and-access-management/iam/how-to/create-api-keys/) on how to retrieve them.
|
|
33
|
+
|
|
34
|
+
### Basic Usage
|
|
35
|
+
|
|
36
|
+
```typescript
|
|
37
|
+
import { createClient } from '@scaleway/sdk-client'
|
|
38
|
+
import { Function } from '@scaleway/sdk-function'
|
|
39
|
+
|
|
40
|
+
const client = createClient({
|
|
41
|
+
accessKey: 'SCWXXXXXXXXXXXXXXXXX',
|
|
42
|
+
secretKey: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
|
|
43
|
+
defaultProjectId: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
|
|
44
|
+
defaultRegion: 'fr-par',
|
|
45
|
+
defaultZone: 'fr-par-1',
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
const api = new Function.v1.API(client)
|
|
49
|
+
|
|
50
|
+
// Use the API
|
|
51
|
+
// Example: await api.listServers()
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Using Configuration Loader
|
|
55
|
+
|
|
56
|
+
For a simpler setup, you can load credentials from the configuration file or environment variables:
|
|
57
|
+
|
|
58
|
+
```typescript
|
|
59
|
+
import { createClient } from '@scaleway/sdk-client'
|
|
60
|
+
import { loadProfileFromConfigurationFile } from '@scaleway/configuration-loader'
|
|
61
|
+
import { Function } from '@scaleway/sdk-function'
|
|
62
|
+
|
|
63
|
+
const profile = loadProfileFromConfigurationFile()
|
|
64
|
+
const client = createClient(profile)
|
|
65
|
+
const api = new Function.v1.API(client)
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Documentation
|
|
69
|
+
|
|
70
|
+
- 📚 [Scaleway SDK Reference Documentation](https://scaleway.github.io/scaleway-sdk-js)
|
|
71
|
+
- 🌐 [Scaleway Function API Documentation](https://www.scaleway.com/en/developers/api/function/)
|
|
72
|
+
- 📖 [Main Repository](https://github.com/scaleway/scaleway-sdk-js)
|
|
73
|
+
- 💡 [Example Projects](https://github.com/scaleway/scaleway-sdk-js/tree/master/examples)
|
|
74
|
+
|
|
75
|
+
## Features
|
|
76
|
+
|
|
77
|
+
- ✅ Full TypeScript support with complete type definitions
|
|
78
|
+
- ✅ Promise-based API
|
|
79
|
+
- ✅ Automatic pagination helpers
|
|
80
|
+
- ✅ Built-in error handling
|
|
81
|
+
- ✅ Compatible with Node.js ≥ 20
|
|
82
|
+
|
|
83
|
+
## Support
|
|
84
|
+
|
|
85
|
+
We love feedback! Feel free to reach us on:
|
|
86
|
+
- [Scaleway Slack community](https://slack.scaleway.com/) - Join us on [#opensource](https://scaleway-community.slack.com/app_redirect?channel=opensource)
|
|
87
|
+
- [GitHub Issues](https://github.com/scaleway/scaleway-sdk-js/issues)
|
|
88
|
+
|
|
89
|
+
## Contributing
|
|
90
|
+
|
|
91
|
+
This repository is at its early stage and is still in active development. If you are looking for a way to contribute, please read [CONTRIBUTING.md](https://github.com/scaleway/scaleway-sdk-js/blob/master/CONTRIBUTING.md).
|
|
92
|
+
|
|
93
|
+
## License
|
|
94
|
+
|
|
95
|
+
This project is Apache 2.0 licensed. See the [LICENSE](https://github.com/scaleway/scaleway-sdk-js/blob/master/LICENSE) file for details.
|
|
96
|
+
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { API as ParentAPI } from '@scaleway/sdk-client';
|
|
2
1
|
import type { ApiLocality, WaitForOptions } from '@scaleway/sdk-client';
|
|
2
|
+
import { API as ParentAPI } from '@scaleway/sdk-client';
|
|
3
3
|
import type { CreateCronRequest, CreateDomainRequest, CreateFunctionRequest, CreateNamespaceRequest, CreateTokenRequest, CreateTriggerRequest, Cron, DeleteCronRequest, DeleteDomainRequest, DeleteFunctionRequest, DeleteNamespaceRequest, DeleteTokenRequest, DeleteTriggerRequest, DeployFunctionRequest, Domain, DownloadURL, Function, GetCronRequest, GetDomainRequest, GetFunctionDownloadURLRequest, GetFunctionRequest, GetFunctionUploadURLRequest, GetNamespaceRequest, GetTokenRequest, GetTriggerRequest, ListCronsRequest, ListCronsResponse, ListDomainsRequest, ListDomainsResponse, ListFunctionRuntimesRequest, ListFunctionRuntimesResponse, ListFunctionsRequest, ListFunctionsResponse, ListNamespacesRequest, ListNamespacesResponse, ListTokensRequest, ListTokensResponse, ListTriggersRequest, ListTriggersResponse, Namespace, Token, Trigger, UpdateCronRequest, UpdateFunctionRequest, UpdateNamespaceRequest, UpdateTriggerRequest, UploadURL } from './types.gen.js';
|
|
4
4
|
/**
|
|
5
5
|
* Serverless Functions API.
|
|
@@ -225,8 +225,9 @@ export declare class API extends ParentAPI {
|
|
|
225
225
|
*/
|
|
226
226
|
deleteDomain: (request: Readonly<DeleteDomainRequest>) => Promise<Domain>;
|
|
227
227
|
/**
|
|
228
|
-
* Create a new revocable token.
|
|
228
|
+
* Create a new revocable token. Deprecated in favor of IAM authentication.
|
|
229
229
|
*
|
|
230
|
+
* @deprecated
|
|
230
231
|
* @param request - The request {@link CreateTokenRequest}
|
|
231
232
|
* @returns A Promise of Token
|
|
232
233
|
*/
|
package/dist/v1beta1/api.gen.js
CHANGED
|
@@ -10,7 +10,11 @@ class API extends API$1 {
|
|
|
10
10
|
* type ∈ {'zone','region','global','unspecified'}
|
|
11
11
|
*/
|
|
12
12
|
static LOCALITY = toApiLocality({
|
|
13
|
-
regions: [
|
|
13
|
+
regions: [
|
|
14
|
+
"fr-par",
|
|
15
|
+
"nl-ams",
|
|
16
|
+
"pl-waw"
|
|
17
|
+
]
|
|
14
18
|
});
|
|
15
19
|
pageOfListNamespaces = (request = {}) => this.client.fetch(
|
|
16
20
|
{
|
|
@@ -21,10 +25,7 @@ class API extends API$1 {
|
|
|
21
25
|
["order_by", request.orderBy],
|
|
22
26
|
["organization_id", request.organizationId],
|
|
23
27
|
["page", request.page],
|
|
24
|
-
[
|
|
25
|
-
"page_size",
|
|
26
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
27
|
-
],
|
|
28
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
|
|
28
29
|
["project_id", request.projectId]
|
|
29
30
|
)
|
|
30
31
|
},
|
|
@@ -58,9 +59,7 @@ class API extends API$1 {
|
|
|
58
59
|
* @returns A Promise of Namespace
|
|
59
60
|
*/
|
|
60
61
|
waitForNamespace = (request, options) => waitForResource(
|
|
61
|
-
options?.stop ?? ((res) => Promise.resolve(
|
|
62
|
-
!NAMESPACE_TRANSIENT_STATUSES.includes(res.status)
|
|
63
|
-
)),
|
|
62
|
+
options?.stop ?? ((res) => Promise.resolve(!NAMESPACE_TRANSIENT_STATUSES.includes(res.status))),
|
|
64
63
|
this.getNamespace,
|
|
65
64
|
request,
|
|
66
65
|
options
|
|
@@ -122,10 +121,7 @@ class API extends API$1 {
|
|
|
122
121
|
["order_by", request.orderBy],
|
|
123
122
|
["organization_id", request.organizationId],
|
|
124
123
|
["page", request.page],
|
|
125
|
-
[
|
|
126
|
-
"page_size",
|
|
127
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
128
|
-
],
|
|
124
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
|
|
129
125
|
["project_id", request.projectId]
|
|
130
126
|
)
|
|
131
127
|
},
|
|
@@ -159,9 +155,7 @@ class API extends API$1 {
|
|
|
159
155
|
* @returns A Promise of Function
|
|
160
156
|
*/
|
|
161
157
|
waitForFunction = (request, options) => waitForResource(
|
|
162
|
-
options?.stop ?? ((res) => Promise.resolve(
|
|
163
|
-
!FUNCTION_TRANSIENT_STATUSES.includes(res.status)
|
|
164
|
-
)),
|
|
158
|
+
options?.stop ?? ((res) => Promise.resolve(!FUNCTION_TRANSIENT_STATUSES.includes(res.status))),
|
|
165
159
|
this.getFunction,
|
|
166
160
|
request,
|
|
167
161
|
options
|
|
@@ -254,7 +248,9 @@ class API extends API$1 {
|
|
|
254
248
|
{
|
|
255
249
|
method: "GET",
|
|
256
250
|
path: `/functions/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/functions/${validatePathParam("functionId", request.functionId)}/upload-url`,
|
|
257
|
-
urlParams: urlParams(
|
|
251
|
+
urlParams: urlParams(
|
|
252
|
+
["content_length", request.contentLength]
|
|
253
|
+
)
|
|
258
254
|
},
|
|
259
255
|
unmarshalUploadURL
|
|
260
256
|
);
|
|
@@ -279,10 +275,7 @@ class API extends API$1 {
|
|
|
279
275
|
["function_id", request.functionId],
|
|
280
276
|
["order_by", request.orderBy],
|
|
281
277
|
["page", request.page],
|
|
282
|
-
[
|
|
283
|
-
"page_size",
|
|
284
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
285
|
-
]
|
|
278
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize]
|
|
286
279
|
)
|
|
287
280
|
},
|
|
288
281
|
unmarshalListCronsResponse
|
|
@@ -315,9 +308,7 @@ class API extends API$1 {
|
|
|
315
308
|
* @returns A Promise of Cron
|
|
316
309
|
*/
|
|
317
310
|
waitForCron = (request, options) => waitForResource(
|
|
318
|
-
options?.stop ?? ((res) => Promise.resolve(
|
|
319
|
-
!CRON_TRANSIENT_STATUSES.includes(res.status)
|
|
320
|
-
)),
|
|
311
|
+
options?.stop ?? ((res) => Promise.resolve(!CRON_TRANSIENT_STATUSES.includes(res.status))),
|
|
321
312
|
this.getCron,
|
|
322
313
|
request,
|
|
323
314
|
options
|
|
@@ -377,10 +368,7 @@ class API extends API$1 {
|
|
|
377
368
|
["function_id", request.functionId],
|
|
378
369
|
["order_by", request.orderBy],
|
|
379
370
|
["page", request.page],
|
|
380
|
-
[
|
|
381
|
-
"page_size",
|
|
382
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
383
|
-
]
|
|
371
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize]
|
|
384
372
|
)
|
|
385
373
|
},
|
|
386
374
|
unmarshalListDomainsResponse
|
|
@@ -413,9 +401,7 @@ class API extends API$1 {
|
|
|
413
401
|
* @returns A Promise of Domain
|
|
414
402
|
*/
|
|
415
403
|
waitForDomain = (request, options) => waitForResource(
|
|
416
|
-
options?.stop ?? ((res) => Promise.resolve(
|
|
417
|
-
!DOMAIN_TRANSIENT_STATUSES.includes(res.status)
|
|
418
|
-
)),
|
|
404
|
+
options?.stop ?? ((res) => Promise.resolve(!DOMAIN_TRANSIENT_STATUSES.includes(res.status))),
|
|
419
405
|
this.getDomain,
|
|
420
406
|
request,
|
|
421
407
|
options
|
|
@@ -451,8 +437,9 @@ class API extends API$1 {
|
|
|
451
437
|
unmarshalDomain
|
|
452
438
|
);
|
|
453
439
|
/**
|
|
454
|
-
* Create a new revocable token.
|
|
440
|
+
* Create a new revocable token. Deprecated in favor of IAM authentication.
|
|
455
441
|
*
|
|
442
|
+
* @deprecated
|
|
456
443
|
* @param request - The request {@link CreateTokenRequest}
|
|
457
444
|
* @returns A Promise of Token
|
|
458
445
|
*/
|
|
@@ -488,9 +475,7 @@ class API extends API$1 {
|
|
|
488
475
|
* @returns A Promise of Token
|
|
489
476
|
*/
|
|
490
477
|
waitForToken = (request, options) => waitForResource(
|
|
491
|
-
options?.stop ?? ((res) => Promise.resolve(
|
|
492
|
-
!TOKEN_TRANSIENT_STATUSES.includes(res.status)
|
|
493
|
-
)),
|
|
478
|
+
options?.stop ?? ((res) => Promise.resolve(!TOKEN_TRANSIENT_STATUSES.includes(res.status))),
|
|
494
479
|
this.getToken,
|
|
495
480
|
request,
|
|
496
481
|
options
|
|
@@ -504,10 +489,7 @@ class API extends API$1 {
|
|
|
504
489
|
["namespace_id", request.namespaceId],
|
|
505
490
|
["order_by", request.orderBy],
|
|
506
491
|
["page", request.page],
|
|
507
|
-
[
|
|
508
|
-
"page_size",
|
|
509
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
510
|
-
]
|
|
492
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize]
|
|
511
493
|
)
|
|
512
494
|
},
|
|
513
495
|
unmarshalListTokensResponse
|
|
@@ -570,9 +552,7 @@ class API extends API$1 {
|
|
|
570
552
|
* @returns A Promise of Trigger
|
|
571
553
|
*/
|
|
572
554
|
waitForTrigger = (request, options) => waitForResource(
|
|
573
|
-
options?.stop ?? ((res) => Promise.resolve(
|
|
574
|
-
!TRIGGER_TRANSIENT_STATUSES.includes(res.status)
|
|
575
|
-
)),
|
|
555
|
+
options?.stop ?? ((res) => Promise.resolve(!TRIGGER_TRANSIENT_STATUSES.includes(res.status))),
|
|
576
556
|
this.getTrigger,
|
|
577
557
|
request,
|
|
578
558
|
options
|
|
@@ -584,21 +564,22 @@ class API extends API$1 {
|
|
|
584
564
|
urlParams: urlParams(
|
|
585
565
|
["order_by", request.orderBy],
|
|
586
566
|
["page", request.page],
|
|
587
|
-
[
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
567
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
|
|
568
|
+
...Object.entries(resolveOneOf([
|
|
569
|
+
{
|
|
570
|
+
param: "function_id",
|
|
571
|
+
value: request.functionId
|
|
572
|
+
},
|
|
573
|
+
{
|
|
574
|
+
param: "namespace_id",
|
|
575
|
+
value: request.namespaceId
|
|
576
|
+
},
|
|
577
|
+
{
|
|
578
|
+
default: this.client.settings.defaultProjectId,
|
|
579
|
+
param: "project_id",
|
|
580
|
+
value: request.projectId
|
|
581
|
+
}
|
|
582
|
+
]))
|
|
602
583
|
)
|
|
603
584
|
},
|
|
604
585
|
unmarshalListTriggersResponse
|
|
@@ -18,7 +18,10 @@ const NAMESPACE_TRANSIENT_STATUSES = [
|
|
|
18
18
|
"creating",
|
|
19
19
|
"pending"
|
|
20
20
|
];
|
|
21
|
-
const TOKEN_TRANSIENT_STATUSES = [
|
|
21
|
+
const TOKEN_TRANSIENT_STATUSES = [
|
|
22
|
+
"deleting",
|
|
23
|
+
"creating"
|
|
24
|
+
];
|
|
22
25
|
const TRIGGER_TRANSIENT_STATUSES = [
|
|
23
26
|
"deleting",
|
|
24
27
|
"creating",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { API } from './api.gen.js';
|
|
1
|
+
export { API, } from './api.gen.js';
|
|
2
2
|
export * from './content.gen.js';
|
|
3
3
|
export * from './marshalling.gen.js';
|
|
4
4
|
export type { CreateCronRequest, CreateDomainRequest, CreateFunctionRequest, CreateNamespaceRequest, CreateTokenRequest, CreateTriggerRequest, CreateTriggerRequestMnqNatsClientConfig, CreateTriggerRequestMnqSqsClientConfig, CreateTriggerRequestSqsClientConfig, Cron, CronStatus, DeleteCronRequest, DeleteDomainRequest, DeleteFunctionRequest, DeleteNamespaceRequest, DeleteTokenRequest, DeleteTriggerRequest, DeployFunctionRequest, Domain, DomainStatus, DownloadURL, Function, FunctionHttpOption, FunctionPrivacy, FunctionRuntime, FunctionSandbox, FunctionStatus, GetCronRequest, GetDomainRequest, GetFunctionDownloadURLRequest, GetFunctionRequest, GetFunctionUploadURLRequest, GetNamespaceRequest, GetTokenRequest, GetTriggerRequest, ListCronsRequest, ListCronsRequestOrderBy, ListCronsResponse, ListDomainsRequest, ListDomainsRequestOrderBy, ListDomainsResponse, ListFunctionRuntimesRequest, ListFunctionRuntimesResponse, ListFunctionsRequest, ListFunctionsRequestOrderBy, ListFunctionsResponse, ListNamespacesRequest, ListNamespacesRequestOrderBy, ListNamespacesResponse, ListTokensRequest, ListTokensRequestOrderBy, ListTokensResponse, ListTriggersRequest, ListTriggersRequestOrderBy, ListTriggersResponse, Namespace, NamespaceStatus, Runtime, RuntimeStatus, Secret, SecretHashedValue, Token, TokenStatus, Trigger, TriggerInputType, TriggerMnqNatsClientConfig, TriggerMnqSqsClientConfig, TriggerSqsClientConfig, TriggerStatus, UpdateCronRequest, UpdateFunctionRequest, UpdateNamespaceRequest, UpdateTriggerRequest, UpdateTriggerRequestSqsClientConfig, UploadURL, } from './types.gen.js';
|
|
@@ -70,10 +70,7 @@ const unmarshalFunction = (data) => {
|
|
|
70
70
|
runtime: data.runtime,
|
|
71
71
|
runtimeMessage: data.runtime_message,
|
|
72
72
|
sandbox: data.sandbox,
|
|
73
|
-
secretEnvironmentVariables: unmarshalArrayOfObject(
|
|
74
|
-
data.secret_environment_variables,
|
|
75
|
-
unmarshalSecretHashedValue
|
|
76
|
-
),
|
|
73
|
+
secretEnvironmentVariables: unmarshalArrayOfObject(data.secret_environment_variables, unmarshalSecretHashedValue),
|
|
77
74
|
status: data.status,
|
|
78
75
|
tags: data.tags,
|
|
79
76
|
timeout: data.timeout,
|
|
@@ -98,10 +95,7 @@ const unmarshalNamespace = (data) => {
|
|
|
98
95
|
region: data.region,
|
|
99
96
|
registryEndpoint: data.registry_endpoint,
|
|
100
97
|
registryNamespaceId: data.registry_namespace_id,
|
|
101
|
-
secretEnvironmentVariables: unmarshalArrayOfObject(
|
|
102
|
-
data.secret_environment_variables,
|
|
103
|
-
unmarshalSecretHashedValue
|
|
104
|
-
),
|
|
98
|
+
secretEnvironmentVariables: unmarshalArrayOfObject(data.secret_environment_variables, unmarshalSecretHashedValue),
|
|
105
99
|
status: data.status,
|
|
106
100
|
tags: data.tags,
|
|
107
101
|
updatedAt: unmarshalDate(data.updated_at),
|
|
@@ -330,9 +324,7 @@ const marshalCreateFunctionRequest = (request, defaults) => ({
|
|
|
330
324
|
private_network_id: request.privateNetworkId,
|
|
331
325
|
runtime: request.runtime,
|
|
332
326
|
sandbox: request.sandbox,
|
|
333
|
-
secret_environment_variables: request.secretEnvironmentVariables !== void 0 ? request.secretEnvironmentVariables.map(
|
|
334
|
-
(elt) => marshalSecret(elt)
|
|
335
|
-
) : void 0,
|
|
327
|
+
secret_environment_variables: request.secretEnvironmentVariables !== void 0 ? request.secretEnvironmentVariables.map((elt) => marshalSecret(elt)) : void 0,
|
|
336
328
|
tags: request.tags,
|
|
337
329
|
timeout: request.timeout
|
|
338
330
|
});
|
|
@@ -342,17 +334,21 @@ const marshalCreateNamespaceRequest = (request, defaults) => ({
|
|
|
342
334
|
environment_variables: request.environmentVariables,
|
|
343
335
|
name: request.name || randomName("ns"),
|
|
344
336
|
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
345
|
-
secret_environment_variables: request.secretEnvironmentVariables !== void 0 ? request.secretEnvironmentVariables.map(
|
|
346
|
-
(elt) => marshalSecret(elt)
|
|
347
|
-
) : void 0,
|
|
337
|
+
secret_environment_variables: request.secretEnvironmentVariables !== void 0 ? request.secretEnvironmentVariables.map((elt) => marshalSecret(elt)) : void 0,
|
|
348
338
|
tags: request.tags
|
|
349
339
|
});
|
|
350
340
|
const marshalCreateTokenRequest = (request, defaults) => ({
|
|
351
341
|
description: request.description,
|
|
352
342
|
expires_at: request.expiresAt,
|
|
353
343
|
...resolveOneOf([
|
|
354
|
-
{
|
|
355
|
-
|
|
344
|
+
{
|
|
345
|
+
param: "function_id",
|
|
346
|
+
value: request.functionId
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
param: "namespace_id",
|
|
350
|
+
value: request.namespaceId
|
|
351
|
+
}
|
|
356
352
|
])
|
|
357
353
|
});
|
|
358
354
|
const marshalCreateTriggerRequestMnqNatsClientConfig = (request, defaults) => ({
|
|
@@ -379,21 +375,15 @@ const marshalCreateTriggerRequest = (request, defaults) => ({
|
|
|
379
375
|
...resolveOneOf([
|
|
380
376
|
{
|
|
381
377
|
param: "scw_sqs_config",
|
|
382
|
-
value: request.scwSqsConfig !== void 0 ? marshalCreateTriggerRequestMnqSqsClientConfig(
|
|
383
|
-
request.scwSqsConfig
|
|
384
|
-
) : void 0
|
|
378
|
+
value: request.scwSqsConfig !== void 0 ? marshalCreateTriggerRequestMnqSqsClientConfig(request.scwSqsConfig) : void 0
|
|
385
379
|
},
|
|
386
380
|
{
|
|
387
381
|
param: "scw_nats_config",
|
|
388
|
-
value: request.scwNatsConfig !== void 0 ? marshalCreateTriggerRequestMnqNatsClientConfig(
|
|
389
|
-
request.scwNatsConfig
|
|
390
|
-
) : void 0
|
|
382
|
+
value: request.scwNatsConfig !== void 0 ? marshalCreateTriggerRequestMnqNatsClientConfig(request.scwNatsConfig) : void 0
|
|
391
383
|
},
|
|
392
384
|
{
|
|
393
385
|
param: "sqs_config",
|
|
394
|
-
value: request.sqsConfig !== void 0 ? marshalCreateTriggerRequestSqsClientConfig(
|
|
395
|
-
request.sqsConfig
|
|
396
|
-
) : void 0
|
|
386
|
+
value: request.sqsConfig !== void 0 ? marshalCreateTriggerRequestSqsClientConfig(request.sqsConfig) : void 0
|
|
397
387
|
}
|
|
398
388
|
])
|
|
399
389
|
});
|
|
@@ -416,18 +406,14 @@ const marshalUpdateFunctionRequest = (request, defaults) => ({
|
|
|
416
406
|
redeploy: request.redeploy,
|
|
417
407
|
runtime: request.runtime,
|
|
418
408
|
sandbox: request.sandbox,
|
|
419
|
-
secret_environment_variables: request.secretEnvironmentVariables !== void 0 ? request.secretEnvironmentVariables.map(
|
|
420
|
-
(elt) => marshalSecret(elt)
|
|
421
|
-
) : void 0,
|
|
409
|
+
secret_environment_variables: request.secretEnvironmentVariables !== void 0 ? request.secretEnvironmentVariables.map((elt) => marshalSecret(elt)) : void 0,
|
|
422
410
|
tags: request.tags,
|
|
423
411
|
timeout: request.timeout
|
|
424
412
|
});
|
|
425
413
|
const marshalUpdateNamespaceRequest = (request, defaults) => ({
|
|
426
414
|
description: request.description,
|
|
427
415
|
environment_variables: request.environmentVariables,
|
|
428
|
-
secret_environment_variables: request.secretEnvironmentVariables !== void 0 ? request.secretEnvironmentVariables.map(
|
|
429
|
-
(elt) => marshalSecret(elt)
|
|
430
|
-
) : void 0,
|
|
416
|
+
secret_environment_variables: request.secretEnvironmentVariables !== void 0 ? request.secretEnvironmentVariables.map((elt) => marshalSecret(elt)) : void 0,
|
|
431
417
|
tags: request.tags
|
|
432
418
|
});
|
|
433
419
|
const marshalUpdateTriggerRequestSqsClientConfig = (request, defaults) => ({
|
|
@@ -440,9 +426,7 @@ const marshalUpdateTriggerRequest = (request, defaults) => ({
|
|
|
440
426
|
...resolveOneOf([
|
|
441
427
|
{
|
|
442
428
|
param: "sqs_config",
|
|
443
|
-
value: request.sqsConfig !== void 0 ? marshalUpdateTriggerRequestSqsClientConfig(
|
|
444
|
-
request.sqsConfig
|
|
445
|
-
) : void 0
|
|
429
|
+
value: request.sqsConfig !== void 0 ? marshalUpdateTriggerRequestSqsClientConfig(request.sqsConfig) : void 0
|
|
446
430
|
}
|
|
447
431
|
])
|
|
448
432
|
});
|
|
@@ -153,7 +153,7 @@ export interface Domain {
|
|
|
153
153
|
*/
|
|
154
154
|
url: string;
|
|
155
155
|
/**
|
|
156
|
-
* State of the
|
|
156
|
+
* State of the domain.
|
|
157
157
|
*/
|
|
158
158
|
status: DomainStatus;
|
|
159
159
|
/**
|
|
@@ -466,7 +466,7 @@ export type CreateDomainRequest = {
|
|
|
466
466
|
*/
|
|
467
467
|
region?: ScwRegion;
|
|
468
468
|
/**
|
|
469
|
-
*
|
|
469
|
+
* Hostname to create.
|
|
470
470
|
*/
|
|
471
471
|
hostname: string;
|
|
472
472
|
/**
|
package/package.json
CHANGED
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scaleway/sdk-function",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "Scaleway SDK function",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"files": [
|
|
7
|
+
"README.md",
|
|
7
8
|
"dist"
|
|
8
9
|
],
|
|
9
10
|
"type": "module",
|
|
10
11
|
"exports": {
|
|
11
12
|
".": {
|
|
12
13
|
"types": "./dist/index.gen.d.ts",
|
|
13
|
-
"import": "./dist/index.gen.js",
|
|
14
|
-
"require": "./dist/index.gen.cjs",
|
|
15
14
|
"default": "./dist/index.gen.js"
|
|
16
15
|
},
|
|
17
16
|
"./*": {
|
|
18
17
|
"types": "./dist/*/index.gen.d.ts",
|
|
19
|
-
"import": "./dist/*/index.gen.js",
|
|
20
|
-
"require": "./dist/*/index.gen.cjs",
|
|
21
18
|
"default": "./dist/*/index.gen.js"
|
|
22
19
|
}
|
|
23
20
|
},
|
|
@@ -26,17 +23,17 @@
|
|
|
26
23
|
"directory": "packages_generated/function"
|
|
27
24
|
},
|
|
28
25
|
"engines": {
|
|
29
|
-
"node": ">=20.19.
|
|
26
|
+
"node": ">=20.19.6"
|
|
30
27
|
},
|
|
31
28
|
"dependencies": {
|
|
32
29
|
"@scaleway/random-name": "5.1.2",
|
|
33
|
-
"@scaleway/sdk-std": "
|
|
30
|
+
"@scaleway/sdk-std": "2.1.0"
|
|
34
31
|
},
|
|
35
32
|
"peerDependencies": {
|
|
36
|
-
"@scaleway/sdk-client": "^1.
|
|
33
|
+
"@scaleway/sdk-client": "^2.1.0"
|
|
37
34
|
},
|
|
38
35
|
"devDependencies": {
|
|
39
|
-
"@scaleway/sdk-client": "^1.
|
|
36
|
+
"@scaleway/sdk-client": "^2.1.0"
|
|
40
37
|
},
|
|
41
38
|
"scripts": {
|
|
42
39
|
"package:check": "pnpm publint",
|
package/dist/index.gen.cjs
DELETED