@scaleway/sdk-mnq 1.2.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 ADDED
@@ -0,0 +1,96 @@
1
+ # @scaleway/sdk-mnq
2
+
3
+ [![npm version](https://img.shields.io/npm/v/@scaleway/sdk-mnq.svg)](https://www.npmjs.com/package/@scaleway/sdk-mnq)
4
+ [![npm downloads](https://img.shields.io/npm/dm/@scaleway/sdk-mnq.svg)](https://www.npmjs.com/package/@scaleway/sdk-mnq)
5
+ [![license](https://img.shields.io/npm/l/@scaleway/sdk-mnq.svg)](https://github.com/scaleway/scaleway-sdk-js/blob/master/LICENSE)
6
+
7
+ Scaleway SDK for Mnq 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-mnq @scaleway/sdk-client
16
+ ```
17
+
18
+ or with pnpm:
19
+
20
+ ```bash
21
+ pnpm add @scaleway/sdk-mnq @scaleway/sdk-client
22
+ ```
23
+
24
+ or with yarn:
25
+
26
+ ```bash
27
+ yarn add @scaleway/sdk-mnq @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 { Mnq } from '@scaleway/sdk-mnq'
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 Mnq.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 { Mnq } from '@scaleway/sdk-mnq'
62
+
63
+ const profile = loadProfileFromConfigurationFile()
64
+ const client = createClient(profile)
65
+ const api = new Mnq.v1.API(client)
66
+ ```
67
+
68
+ ## Documentation
69
+
70
+ - 📚 [Scaleway SDK Reference Documentation](https://scaleway.github.io/scaleway-sdk-js)
71
+ - 🌐 [Scaleway Mnq API Documentation](https://www.scaleway.com/en/developers/api/mnq/)
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 } from '@scaleway/sdk-client';
2
+ import { API as ParentAPI } from '@scaleway/sdk-client';
3
3
  import type { ListNatsAccountsResponse, ListNatsCredentialsResponse, ListSnsCredentialsResponse, ListSqsCredentialsResponse, NatsAccount, NatsApiCreateNatsAccountRequest, NatsApiCreateNatsCredentialsRequest, NatsApiDeleteNatsAccountRequest, NatsApiDeleteNatsCredentialsRequest, NatsApiGetNatsAccountRequest, NatsApiGetNatsCredentialsRequest, NatsApiListNatsAccountsRequest, NatsApiListNatsCredentialsRequest, NatsApiUpdateNatsAccountRequest, NatsCredentials, SnsApiActivateSnsRequest, SnsApiCreateSnsCredentialsRequest, SnsApiDeactivateSnsRequest, SnsApiDeleteSnsCredentialsRequest, SnsApiGetSnsCredentialsRequest, SnsApiGetSnsInfoRequest, SnsApiListSnsCredentialsRequest, SnsApiUpdateSnsCredentialsRequest, SnsCredentials, SnsInfo, SqsApiActivateSqsRequest, SqsApiCreateSqsCredentialsRequest, SqsApiDeactivateSqsRequest, SqsApiDeleteSqsCredentialsRequest, SqsApiGetSqsCredentialsRequest, SqsApiGetSqsInfoRequest, SqsApiListSqsCredentialsRequest, SqsApiUpdateSqsCredentialsRequest, SqsCredentials, SqsInfo } from './types.gen.js';
4
4
  /**
5
5
  * NATS API.
@@ -101,7 +101,7 @@ export declare class SnsAPI extends ParentAPI {
101
101
  */
102
102
  activateSns: (request?: Readonly<SnsApiActivateSnsRequest>) => Promise<SnsInfo>;
103
103
  /**
104
- * Get Topics and Events info. Retrieve the Topics and Events information of the specified Project ID. Informations include the activation status and the Topics and Events API endpoint URL.
104
+ * Get Topics and Events info. Retrieve the Topics and Events information of the specified Project ID. information include the activation status and the Topics and Events API endpoint URL.
105
105
  *
106
106
  * @param request - The request {@link SnsApiGetSnsInfoRequest}
107
107
  * @returns A Promise of SnsInfo
@@ -172,7 +172,7 @@ export declare class SqsAPI extends ParentAPI {
172
172
  */
173
173
  activateSqs: (request?: Readonly<SqsApiActivateSqsRequest>) => Promise<SqsInfo>;
174
174
  /**
175
- * Get Queues info. Retrieve the Queues information of the specified Project ID. Informations include the activation status and the Queues API endpoint URL.
175
+ * Get Queues info. Retrieve the Queues information of the specified Project ID. information include the activation status and the Queues API endpoint URL.
176
176
  *
177
177
  * @param request - The request {@link SqsApiGetSqsInfoRequest}
178
178
  * @returns A Promise of SqsInfo
@@ -9,7 +9,10 @@ class NatsAPI extends API {
9
9
  * type ∈ {'zone','region','global','unspecified'}
10
10
  */
11
11
  static LOCALITY = toApiLocality({
12
- regions: ["fr-par", "nl-ams"]
12
+ regions: [
13
+ "fr-par",
14
+ "nl-ams"
15
+ ]
13
16
  });
14
17
  /**
15
18
  * Create a NATS account. Create a NATS account associated with a Project.
@@ -33,10 +36,12 @@ class NatsAPI extends API {
33
36
  *
34
37
  * @param request - The request {@link NatsApiDeleteNatsAccountRequest}
35
38
  */
36
- deleteNatsAccount = (request) => this.client.fetch({
37
- method: "DELETE",
38
- path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nats-accounts/${validatePathParam("natsAccountId", request.natsAccountId)}`
39
- });
39
+ deleteNatsAccount = (request) => this.client.fetch(
40
+ {
41
+ method: "DELETE",
42
+ path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nats-accounts/${validatePathParam("natsAccountId", request.natsAccountId)}`
43
+ }
44
+ );
40
45
  /**
41
46
  * Update the name of a NATS account. Update the name of a NATS account, specified by its NATS account ID.
42
47
  *
@@ -74,10 +79,7 @@ class NatsAPI extends API {
74
79
  urlParams: urlParams(
75
80
  ["order_by", request.orderBy],
76
81
  ["page", request.page],
77
- [
78
- "page_size",
79
- request.pageSize ?? this.client.settings.defaultPageSize
80
- ],
82
+ ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
81
83
  ["project_id", request.projectId]
82
84
  )
83
85
  },
@@ -99,10 +101,7 @@ class NatsAPI extends API {
99
101
  createNatsCredentials = (request) => this.client.fetch(
100
102
  {
101
103
  body: JSON.stringify(
102
- marshalNatsApiCreateNatsCredentialsRequest(
103
- request,
104
- this.client.settings
105
- )
104
+ marshalNatsApiCreateNatsCredentialsRequest(request, this.client.settings)
106
105
  ),
107
106
  headers: jsonContentHeaders,
108
107
  method: "POST",
@@ -115,10 +114,12 @@ class NatsAPI extends API {
115
114
  *
116
115
  * @param request - The request {@link NatsApiDeleteNatsCredentialsRequest}
117
116
  */
118
- deleteNatsCredentials = (request) => this.client.fetch({
119
- method: "DELETE",
120
- path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nats-credentials/${validatePathParam("natsCredentialsId", request.natsCredentialsId)}`
121
- });
117
+ deleteNatsCredentials = (request) => this.client.fetch(
118
+ {
119
+ method: "DELETE",
120
+ path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nats-credentials/${validatePathParam("natsCredentialsId", request.natsCredentialsId)}`
121
+ }
122
+ );
122
123
  /**
123
124
  * Get NATS credentials. Retrieve an existing set of credentials, identified by the `nats_credentials_id`. The credentials themselves are NOT returned, only their metadata (NATS account ID, credentials name, etc), are returned in the response.
124
125
  *
@@ -140,10 +141,7 @@ class NatsAPI extends API {
140
141
  ["nats_account_id", request.natsAccountId],
141
142
  ["order_by", request.orderBy],
142
143
  ["page", request.page],
143
- [
144
- "page_size",
145
- request.pageSize ?? this.client.settings.defaultPageSize
146
- ],
144
+ ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
147
145
  ["project_id", request.projectId]
148
146
  )
149
147
  },
@@ -155,11 +153,7 @@ class NatsAPI extends API {
155
153
  * @param request - The request {@link NatsApiListNatsCredentialsRequest}
156
154
  * @returns A Promise of ListNatsCredentialsResponse
157
155
  */
158
- listNatsCredentials = (request = {}) => enrichForPagination(
159
- "natsCredentials",
160
- this.pageOfListNatsCredentials,
161
- request
162
- );
156
+ listNatsCredentials = (request = {}) => enrichForPagination("natsCredentials", this.pageOfListNatsCredentials, request);
163
157
  }
164
158
  class SnsAPI extends API {
165
159
  /**
@@ -167,7 +161,10 @@ class SnsAPI extends API {
167
161
  * type ∈ {'zone','region','global','unspecified'}
168
162
  */
169
163
  static LOCALITY = toApiLocality({
170
- regions: ["fr-par", "nl-ams"]
164
+ regions: [
165
+ "fr-par",
166
+ "nl-ams"
167
+ ]
171
168
  });
172
169
  /**
173
170
  * Activate Topics and Events. Activate Topics and Events for the specified Project ID. Topics and Events must be activated before any usage. Activating Topics and Events does not trigger any billing, and you can deactivate at any time.
@@ -187,7 +184,7 @@ class SnsAPI extends API {
187
184
  unmarshalSnsInfo
188
185
  );
189
186
  /**
190
- * Get Topics and Events info. Retrieve the Topics and Events information of the specified Project ID. Informations include the activation status and the Topics and Events API endpoint URL.
187
+ * Get Topics and Events info. Retrieve the Topics and Events information of the specified Project ID. information include the activation status and the Topics and Events API endpoint URL.
191
188
  *
192
189
  * @param request - The request {@link SnsApiGetSnsInfoRequest}
193
190
  * @returns A Promise of SnsInfo
@@ -196,10 +193,9 @@ class SnsAPI extends API {
196
193
  {
197
194
  method: "GET",
198
195
  path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/sns-info`,
199
- urlParams: urlParams([
200
- "project_id",
201
- request.projectId ?? this.client.settings.defaultProjectId
202
- ])
196
+ urlParams: urlParams(
197
+ ["project_id", request.projectId ?? this.client.settings.defaultProjectId]
198
+ )
203
199
  },
204
200
  unmarshalSnsInfo
205
201
  );
@@ -229,10 +225,7 @@ class SnsAPI extends API {
229
225
  createSnsCredentials = (request = {}) => this.client.fetch(
230
226
  {
231
227
  body: JSON.stringify(
232
- marshalSnsApiCreateSnsCredentialsRequest(
233
- request,
234
- this.client.settings
235
- )
228
+ marshalSnsApiCreateSnsCredentialsRequest(request, this.client.settings)
236
229
  ),
237
230
  headers: jsonContentHeaders,
238
231
  method: "POST",
@@ -245,10 +238,12 @@ class SnsAPI extends API {
245
238
  *
246
239
  * @param request - The request {@link SnsApiDeleteSnsCredentialsRequest}
247
240
  */
248
- deleteSnsCredentials = (request) => this.client.fetch({
249
- method: "DELETE",
250
- path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/sns-credentials/${validatePathParam("snsCredentialsId", request.snsCredentialsId)}`
251
- });
241
+ deleteSnsCredentials = (request) => this.client.fetch(
242
+ {
243
+ method: "DELETE",
244
+ path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/sns-credentials/${validatePathParam("snsCredentialsId", request.snsCredentialsId)}`
245
+ }
246
+ );
252
247
  /**
253
248
  * Update Topics and Events credentials. Update a set of Topics and Events credentials. You can update the credentials' name, or their permissions.
254
249
  *
@@ -258,10 +253,7 @@ class SnsAPI extends API {
258
253
  updateSnsCredentials = (request) => this.client.fetch(
259
254
  {
260
255
  body: JSON.stringify(
261
- marshalSnsApiUpdateSnsCredentialsRequest(
262
- request,
263
- this.client.settings
264
- )
256
+ marshalSnsApiUpdateSnsCredentialsRequest(request, this.client.settings)
265
257
  ),
266
258
  headers: jsonContentHeaders,
267
259
  method: "PATCH",
@@ -289,10 +281,7 @@ class SnsAPI extends API {
289
281
  urlParams: urlParams(
290
282
  ["order_by", request.orderBy],
291
283
  ["page", request.page],
292
- [
293
- "page_size",
294
- request.pageSize ?? this.client.settings.defaultPageSize
295
- ],
284
+ ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
296
285
  ["project_id", request.projectId]
297
286
  )
298
287
  },
@@ -304,11 +293,7 @@ class SnsAPI extends API {
304
293
  * @param request - The request {@link SnsApiListSnsCredentialsRequest}
305
294
  * @returns A Promise of ListSnsCredentialsResponse
306
295
  */
307
- listSnsCredentials = (request = {}) => enrichForPagination(
308
- "snsCredentials",
309
- this.pageOfListSnsCredentials,
310
- request
311
- );
296
+ listSnsCredentials = (request = {}) => enrichForPagination("snsCredentials", this.pageOfListSnsCredentials, request);
312
297
  }
313
298
  class SqsAPI extends API {
314
299
  /**
@@ -316,7 +301,10 @@ class SqsAPI extends API {
316
301
  * type ∈ {'zone','region','global','unspecified'}
317
302
  */
318
303
  static LOCALITY = toApiLocality({
319
- regions: ["fr-par", "nl-ams"]
304
+ regions: [
305
+ "fr-par",
306
+ "nl-ams"
307
+ ]
320
308
  });
321
309
  /**
322
310
  * Activate Queues. Activate Queues for the specified Project ID. Queues must be activated before any usage such as creating credentials and queues. Activating Queues does not trigger any billing, and you can deactivate at any time.
@@ -336,7 +324,7 @@ class SqsAPI extends API {
336
324
  unmarshalSqsInfo
337
325
  );
338
326
  /**
339
- * Get Queues info. Retrieve the Queues information of the specified Project ID. Informations include the activation status and the Queues API endpoint URL.
327
+ * Get Queues info. Retrieve the Queues information of the specified Project ID. information include the activation status and the Queues API endpoint URL.
340
328
  *
341
329
  * @param request - The request {@link SqsApiGetSqsInfoRequest}
342
330
  * @returns A Promise of SqsInfo
@@ -345,10 +333,9 @@ class SqsAPI extends API {
345
333
  {
346
334
  method: "GET",
347
335
  path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/sqs-info`,
348
- urlParams: urlParams([
349
- "project_id",
350
- request.projectId ?? this.client.settings.defaultProjectId
351
- ])
336
+ urlParams: urlParams(
337
+ ["project_id", request.projectId ?? this.client.settings.defaultProjectId]
338
+ )
352
339
  },
353
340
  unmarshalSqsInfo
354
341
  );
@@ -378,10 +365,7 @@ class SqsAPI extends API {
378
365
  createSqsCredentials = (request = {}) => this.client.fetch(
379
366
  {
380
367
  body: JSON.stringify(
381
- marshalSqsApiCreateSqsCredentialsRequest(
382
- request,
383
- this.client.settings
384
- )
368
+ marshalSqsApiCreateSqsCredentialsRequest(request, this.client.settings)
385
369
  ),
386
370
  headers: jsonContentHeaders,
387
371
  method: "POST",
@@ -394,10 +378,12 @@ class SqsAPI extends API {
394
378
  *
395
379
  * @param request - The request {@link SqsApiDeleteSqsCredentialsRequest}
396
380
  */
397
- deleteSqsCredentials = (request) => this.client.fetch({
398
- method: "DELETE",
399
- path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/sqs-credentials/${validatePathParam("sqsCredentialsId", request.sqsCredentialsId)}`
400
- });
381
+ deleteSqsCredentials = (request) => this.client.fetch(
382
+ {
383
+ method: "DELETE",
384
+ path: `/mnq/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/sqs-credentials/${validatePathParam("sqsCredentialsId", request.sqsCredentialsId)}`
385
+ }
386
+ );
401
387
  /**
402
388
  * Update Queues credentials. Update a set of Queues credentials. You can update the credentials' name, or their permissions.
403
389
  *
@@ -407,10 +393,7 @@ class SqsAPI extends API {
407
393
  updateSqsCredentials = (request) => this.client.fetch(
408
394
  {
409
395
  body: JSON.stringify(
410
- marshalSqsApiUpdateSqsCredentialsRequest(
411
- request,
412
- this.client.settings
413
- )
396
+ marshalSqsApiUpdateSqsCredentialsRequest(request, this.client.settings)
414
397
  ),
415
398
  headers: jsonContentHeaders,
416
399
  method: "PATCH",
@@ -438,10 +421,7 @@ class SqsAPI extends API {
438
421
  urlParams: urlParams(
439
422
  ["order_by", request.orderBy],
440
423
  ["page", request.page],
441
- [
442
- "page_size",
443
- request.pageSize ?? this.client.settings.defaultPageSize
444
- ],
424
+ ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
445
425
  ["project_id", request.projectId]
446
426
  )
447
427
  },
@@ -453,11 +433,7 @@ class SqsAPI extends API {
453
433
  * @param request - The request {@link SqsApiListSqsCredentialsRequest}
454
434
  * @returns A Promise of ListSqsCredentialsResponse
455
435
  */
456
- listSqsCredentials = (request = {}) => enrichForPagination(
457
- "sqsCredentials",
458
- this.pageOfListSqsCredentials,
459
- request
460
- );
436
+ listSqsCredentials = (request = {}) => enrichForPagination("sqsCredentials", this.pageOfListSqsCredentials, request);
461
437
  }
462
438
  export {
463
439
  NatsAPI,
@@ -113,10 +113,7 @@ const unmarshalListNatsAccountsResponse = (data) => {
113
113
  );
114
114
  }
115
115
  return {
116
- natsAccounts: unmarshalArrayOfObject(
117
- data.nats_accounts,
118
- unmarshalNatsAccount
119
- ),
116
+ natsAccounts: unmarshalArrayOfObject(data.nats_accounts, unmarshalNatsAccount),
120
117
  totalCount: data.total_count
121
118
  };
122
119
  };
@@ -127,10 +124,7 @@ const unmarshalListNatsCredentialsResponse = (data) => {
127
124
  );
128
125
  }
129
126
  return {
130
- natsCredentials: unmarshalArrayOfObject(
131
- data.nats_credentials,
132
- unmarshalNatsCredentials
133
- ),
127
+ natsCredentials: unmarshalArrayOfObject(data.nats_credentials, unmarshalNatsCredentials),
134
128
  totalCount: data.total_count
135
129
  };
136
130
  };
@@ -141,10 +135,7 @@ const unmarshalListSnsCredentialsResponse = (data) => {
141
135
  );
142
136
  }
143
137
  return {
144
- snsCredentials: unmarshalArrayOfObject(
145
- data.sns_credentials,
146
- unmarshalSnsCredentials
147
- ),
138
+ snsCredentials: unmarshalArrayOfObject(data.sns_credentials, unmarshalSnsCredentials),
148
139
  totalCount: data.total_count
149
140
  };
150
141
  };
@@ -155,10 +146,7 @@ const unmarshalListSqsCredentialsResponse = (data) => {
155
146
  );
156
147
  }
157
148
  return {
158
- sqsCredentials: unmarshalArrayOfObject(
159
- data.sqs_credentials,
160
- unmarshalSqsCredentials
161
- ),
149
+ sqsCredentials: unmarshalArrayOfObject(data.sqs_credentials, unmarshalSqsCredentials),
162
150
  totalCount: data.total_count
163
151
  };
164
152
  };
package/package.json CHANGED
@@ -1,23 +1,20 @@
1
1
  {
2
2
  "name": "@scaleway/sdk-mnq",
3
- "version": "1.2.0",
3
+ "version": "2.1.1",
4
4
  "description": "Scaleway SDK mnq",
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/mnq"
27
24
  },
28
25
  "engines": {
29
- "node": ">=20.19.4"
26
+ "node": ">=20.19.6"
30
27
  },
31
28
  "dependencies": {
32
29
  "@scaleway/random-name": "5.1.2",
33
- "@scaleway/sdk-std": "1.2.0"
30
+ "@scaleway/sdk-std": "2.1.0"
34
31
  },
35
32
  "peerDependencies": {
36
- "@scaleway/sdk-client": "^1.3.3"
33
+ "@scaleway/sdk-client": "^2.1.0"
37
34
  },
38
35
  "devDependencies": {
39
- "@scaleway/sdk-client": "^1.3.3"
36
+ "@scaleway/sdk-client": "^2.1.0"
40
37
  },
41
38
  "scripts": {
42
39
  "package:check": "pnpm publint",
@@ -1,4 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const index_gen = require("./v1beta1/index.gen.cjs");
4
- exports.Mnqv1beta1 = index_gen;
@@ -1,466 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const sdkClient = require("@scaleway/sdk-client");
4
- const marshalling_gen = require("./marshalling.gen.cjs");
5
- const jsonContentHeaders = {
6
- "Content-Type": "application/json; charset=utf-8"
7
- };
8
- class NatsAPI extends sdkClient.API {
9
- /**
10
- * Locality of this API.
11
- * type ∈ {'zone','region','global','unspecified'}
12
- */
13
- static LOCALITY = sdkClient.toApiLocality({
14
- regions: ["fr-par", "nl-ams"]
15
- });
16
- /**
17
- * Create a NATS account. Create a NATS account associated with a Project.
18
- *
19
- * @param request - The request {@link NatsApiCreateNatsAccountRequest}
20
- * @returns A Promise of NatsAccount
21
- */
22
- createNatsAccount = (request = {}) => this.client.fetch(
23
- {
24
- body: JSON.stringify(
25
- marshalling_gen.marshalNatsApiCreateNatsAccountRequest(request, this.client.settings)
26
- ),
27
- headers: jsonContentHeaders,
28
- method: "POST",
29
- path: `/mnq/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nats-accounts`
30
- },
31
- marshalling_gen.unmarshalNatsAccount
32
- );
33
- /**
34
- * Delete a NATS account. Delete a NATS account, specified by its NATS account ID. Note that deleting a NATS account is irreversible, and any credentials, streams, consumer and stored messages belonging to this NATS account will also be deleted.
35
- *
36
- * @param request - The request {@link NatsApiDeleteNatsAccountRequest}
37
- */
38
- deleteNatsAccount = (request) => this.client.fetch({
39
- method: "DELETE",
40
- path: `/mnq/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nats-accounts/${sdkClient.validatePathParam("natsAccountId", request.natsAccountId)}`
41
- });
42
- /**
43
- * Update the name of a NATS account. Update the name of a NATS account, specified by its NATS account ID.
44
- *
45
- * @param request - The request {@link NatsApiUpdateNatsAccountRequest}
46
- * @returns A Promise of NatsAccount
47
- */
48
- updateNatsAccount = (request) => this.client.fetch(
49
- {
50
- body: JSON.stringify(
51
- marshalling_gen.marshalNatsApiUpdateNatsAccountRequest(request, this.client.settings)
52
- ),
53
- headers: jsonContentHeaders,
54
- method: "PATCH",
55
- path: `/mnq/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nats-accounts/${sdkClient.validatePathParam("natsAccountId", request.natsAccountId)}`
56
- },
57
- marshalling_gen.unmarshalNatsAccount
58
- );
59
- /**
60
- * Get a NATS account. Retrieve information about an existing NATS account identified by its NATS account ID. Its full details, including name and endpoint, are returned in the response.
61
- *
62
- * @param request - The request {@link NatsApiGetNatsAccountRequest}
63
- * @returns A Promise of NatsAccount
64
- */
65
- getNatsAccount = (request) => this.client.fetch(
66
- {
67
- method: "GET",
68
- path: `/mnq/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nats-accounts/${sdkClient.validatePathParam("natsAccountId", request.natsAccountId)}`
69
- },
70
- marshalling_gen.unmarshalNatsAccount
71
- );
72
- pageOfListNatsAccounts = (request = {}) => this.client.fetch(
73
- {
74
- method: "GET",
75
- path: `/mnq/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nats-accounts`,
76
- urlParams: sdkClient.urlParams(
77
- ["order_by", request.orderBy],
78
- ["page", request.page],
79
- [
80
- "page_size",
81
- request.pageSize ?? this.client.settings.defaultPageSize
82
- ],
83
- ["project_id", request.projectId]
84
- )
85
- },
86
- marshalling_gen.unmarshalListNatsAccountsResponse
87
- );
88
- /**
89
- * List NATS accounts. List all NATS accounts in the specified region, for a Scaleway Organization or Project. By default, the NATS accounts returned in the list are ordered by creation date in ascending order, though this can be modified via the `order_by` field.
90
- *
91
- * @param request - The request {@link NatsApiListNatsAccountsRequest}
92
- * @returns A Promise of ListNatsAccountsResponse
93
- */
94
- listNatsAccounts = (request = {}) => sdkClient.enrichForPagination("natsAccounts", this.pageOfListNatsAccounts, request);
95
- /**
96
- * Create NATS credentials. Create a set of credentials for a NATS account, specified by its NATS account ID.
97
- *
98
- * @param request - The request {@link NatsApiCreateNatsCredentialsRequest}
99
- * @returns A Promise of NatsCredentials
100
- */
101
- createNatsCredentials = (request) => this.client.fetch(
102
- {
103
- body: JSON.stringify(
104
- marshalling_gen.marshalNatsApiCreateNatsCredentialsRequest(
105
- request,
106
- this.client.settings
107
- )
108
- ),
109
- headers: jsonContentHeaders,
110
- method: "POST",
111
- path: `/mnq/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nats-credentials`
112
- },
113
- marshalling_gen.unmarshalNatsCredentials
114
- );
115
- /**
116
- * Delete NATS credentials. Delete a set of credentials, specified by their credentials ID. Deleting credentials is irreversible and cannot be undone. The credentials can no longer be used to access the NATS account, and active connections using this credentials will be closed.
117
- *
118
- * @param request - The request {@link NatsApiDeleteNatsCredentialsRequest}
119
- */
120
- deleteNatsCredentials = (request) => this.client.fetch({
121
- method: "DELETE",
122
- path: `/mnq/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nats-credentials/${sdkClient.validatePathParam("natsCredentialsId", request.natsCredentialsId)}`
123
- });
124
- /**
125
- * Get NATS credentials. Retrieve an existing set of credentials, identified by the `nats_credentials_id`. The credentials themselves are NOT returned, only their metadata (NATS account ID, credentials name, etc), are returned in the response.
126
- *
127
- * @param request - The request {@link NatsApiGetNatsCredentialsRequest}
128
- * @returns A Promise of NatsCredentials
129
- */
130
- getNatsCredentials = (request) => this.client.fetch(
131
- {
132
- method: "GET",
133
- path: `/mnq/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nats-credentials/${sdkClient.validatePathParam("natsCredentialsId", request.natsCredentialsId)}`
134
- },
135
- marshalling_gen.unmarshalNatsCredentials
136
- );
137
- pageOfListNatsCredentials = (request = {}) => this.client.fetch(
138
- {
139
- method: "GET",
140
- path: `/mnq/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nats-credentials`,
141
- urlParams: sdkClient.urlParams(
142
- ["nats_account_id", request.natsAccountId],
143
- ["order_by", request.orderBy],
144
- ["page", request.page],
145
- [
146
- "page_size",
147
- request.pageSize ?? this.client.settings.defaultPageSize
148
- ],
149
- ["project_id", request.projectId]
150
- )
151
- },
152
- marshalling_gen.unmarshalListNatsCredentialsResponse
153
- );
154
- /**
155
- * List NATS credentials. List existing credentials in the specified NATS account. The response contains only the metadata for the credentials, not the credentials themselves, which are only returned after a **Create Credentials** call.
156
- *
157
- * @param request - The request {@link NatsApiListNatsCredentialsRequest}
158
- * @returns A Promise of ListNatsCredentialsResponse
159
- */
160
- listNatsCredentials = (request = {}) => sdkClient.enrichForPagination(
161
- "natsCredentials",
162
- this.pageOfListNatsCredentials,
163
- request
164
- );
165
- }
166
- class SnsAPI extends sdkClient.API {
167
- /**
168
- * Locality of this API.
169
- * type ∈ {'zone','region','global','unspecified'}
170
- */
171
- static LOCALITY = sdkClient.toApiLocality({
172
- regions: ["fr-par", "nl-ams"]
173
- });
174
- /**
175
- * Activate Topics and Events. Activate Topics and Events for the specified Project ID. Topics and Events must be activated before any usage. Activating Topics and Events does not trigger any billing, and you can deactivate at any time.
176
- *
177
- * @param request - The request {@link SnsApiActivateSnsRequest}
178
- * @returns A Promise of SnsInfo
179
- */
180
- activateSns = (request = {}) => this.client.fetch(
181
- {
182
- body: JSON.stringify(
183
- marshalling_gen.marshalSnsApiActivateSnsRequest(request, this.client.settings)
184
- ),
185
- headers: jsonContentHeaders,
186
- method: "POST",
187
- path: `/mnq/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/activate-sns`
188
- },
189
- marshalling_gen.unmarshalSnsInfo
190
- );
191
- /**
192
- * Get Topics and Events info. Retrieve the Topics and Events information of the specified Project ID. Informations include the activation status and the Topics and Events API endpoint URL.
193
- *
194
- * @param request - The request {@link SnsApiGetSnsInfoRequest}
195
- * @returns A Promise of SnsInfo
196
- */
197
- getSnsInfo = (request = {}) => this.client.fetch(
198
- {
199
- method: "GET",
200
- path: `/mnq/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/sns-info`,
201
- urlParams: sdkClient.urlParams([
202
- "project_id",
203
- request.projectId ?? this.client.settings.defaultProjectId
204
- ])
205
- },
206
- marshalling_gen.unmarshalSnsInfo
207
- );
208
- /**
209
- * Deactivate Topics and Events. Deactivate Topics and Events for the specified Project ID. You must delete all topics and credentials before this call or you need to set the force_delete parameter.
210
- *
211
- * @param request - The request {@link SnsApiDeactivateSnsRequest}
212
- * @returns A Promise of SnsInfo
213
- */
214
- deactivateSns = (request = {}) => this.client.fetch(
215
- {
216
- body: JSON.stringify(
217
- marshalling_gen.marshalSnsApiDeactivateSnsRequest(request, this.client.settings)
218
- ),
219
- headers: jsonContentHeaders,
220
- method: "POST",
221
- path: `/mnq/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deactivate-sns`
222
- },
223
- marshalling_gen.unmarshalSnsInfo
224
- );
225
- /**
226
- * Create Topics and Events credentials. Create a set of credentials for Topics and Events, specified by a Project ID. Credentials give the bearer access to topics, and the level of permissions can be defined granularly.
227
- *
228
- * @param request - The request {@link SnsApiCreateSnsCredentialsRequest}
229
- * @returns A Promise of SnsCredentials
230
- */
231
- createSnsCredentials = (request = {}) => this.client.fetch(
232
- {
233
- body: JSON.stringify(
234
- marshalling_gen.marshalSnsApiCreateSnsCredentialsRequest(
235
- request,
236
- this.client.settings
237
- )
238
- ),
239
- headers: jsonContentHeaders,
240
- method: "POST",
241
- path: `/mnq/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/sns-credentials`
242
- },
243
- marshalling_gen.unmarshalSnsCredentials
244
- );
245
- /**
246
- * Delete Topics and Events credentials. Delete a set of Topics and Events credentials, specified by their credentials ID. Deleting credentials is irreversible and cannot be undone. The credentials can then no longer be used to access Topics and Events.
247
- *
248
- * @param request - The request {@link SnsApiDeleteSnsCredentialsRequest}
249
- */
250
- deleteSnsCredentials = (request) => this.client.fetch({
251
- method: "DELETE",
252
- path: `/mnq/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/sns-credentials/${sdkClient.validatePathParam("snsCredentialsId", request.snsCredentialsId)}`
253
- });
254
- /**
255
- * Update Topics and Events credentials. Update a set of Topics and Events credentials. You can update the credentials' name, or their permissions.
256
- *
257
- * @param request - The request {@link SnsApiUpdateSnsCredentialsRequest}
258
- * @returns A Promise of SnsCredentials
259
- */
260
- updateSnsCredentials = (request) => this.client.fetch(
261
- {
262
- body: JSON.stringify(
263
- marshalling_gen.marshalSnsApiUpdateSnsCredentialsRequest(
264
- request,
265
- this.client.settings
266
- )
267
- ),
268
- headers: jsonContentHeaders,
269
- method: "PATCH",
270
- path: `/mnq/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/sns-credentials/${sdkClient.validatePathParam("snsCredentialsId", request.snsCredentialsId)}`
271
- },
272
- marshalling_gen.unmarshalSnsCredentials
273
- );
274
- /**
275
- * Get Topics and Events credentials. Retrieve an existing set of credentials, identified by the `credentials_id`. The credentials themselves, as well as their metadata (name, project ID etc), are returned in the response.
276
- *
277
- * @param request - The request {@link SnsApiGetSnsCredentialsRequest}
278
- * @returns A Promise of SnsCredentials
279
- */
280
- getSnsCredentials = (request) => this.client.fetch(
281
- {
282
- method: "GET",
283
- path: `/mnq/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/sns-credentials/${sdkClient.validatePathParam("snsCredentialsId", request.snsCredentialsId)}`
284
- },
285
- marshalling_gen.unmarshalSnsCredentials
286
- );
287
- pageOfListSnsCredentials = (request = {}) => this.client.fetch(
288
- {
289
- method: "GET",
290
- path: `/mnq/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/sns-credentials`,
291
- urlParams: sdkClient.urlParams(
292
- ["order_by", request.orderBy],
293
- ["page", request.page],
294
- [
295
- "page_size",
296
- request.pageSize ?? this.client.settings.defaultPageSize
297
- ],
298
- ["project_id", request.projectId]
299
- )
300
- },
301
- marshalling_gen.unmarshalListSnsCredentialsResponse
302
- );
303
- /**
304
- * List Topics and Events credentials. List existing Topics and Events credentials in the specified region. The response contains only the metadata for the credentials, not the credentials themselves.
305
- *
306
- * @param request - The request {@link SnsApiListSnsCredentialsRequest}
307
- * @returns A Promise of ListSnsCredentialsResponse
308
- */
309
- listSnsCredentials = (request = {}) => sdkClient.enrichForPagination(
310
- "snsCredentials",
311
- this.pageOfListSnsCredentials,
312
- request
313
- );
314
- }
315
- class SqsAPI extends sdkClient.API {
316
- /**
317
- * Locality of this API.
318
- * type ∈ {'zone','region','global','unspecified'}
319
- */
320
- static LOCALITY = sdkClient.toApiLocality({
321
- regions: ["fr-par", "nl-ams"]
322
- });
323
- /**
324
- * Activate Queues. Activate Queues for the specified Project ID. Queues must be activated before any usage such as creating credentials and queues. Activating Queues does not trigger any billing, and you can deactivate at any time.
325
- *
326
- * @param request - The request {@link SqsApiActivateSqsRequest}
327
- * @returns A Promise of SqsInfo
328
- */
329
- activateSqs = (request = {}) => this.client.fetch(
330
- {
331
- body: JSON.stringify(
332
- marshalling_gen.marshalSqsApiActivateSqsRequest(request, this.client.settings)
333
- ),
334
- headers: jsonContentHeaders,
335
- method: "POST",
336
- path: `/mnq/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/activate-sqs`
337
- },
338
- marshalling_gen.unmarshalSqsInfo
339
- );
340
- /**
341
- * Get Queues info. Retrieve the Queues information of the specified Project ID. Informations include the activation status and the Queues API endpoint URL.
342
- *
343
- * @param request - The request {@link SqsApiGetSqsInfoRequest}
344
- * @returns A Promise of SqsInfo
345
- */
346
- getSqsInfo = (request = {}) => this.client.fetch(
347
- {
348
- method: "GET",
349
- path: `/mnq/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/sqs-info`,
350
- urlParams: sdkClient.urlParams([
351
- "project_id",
352
- request.projectId ?? this.client.settings.defaultProjectId
353
- ])
354
- },
355
- marshalling_gen.unmarshalSqsInfo
356
- );
357
- /**
358
- * Deactivate Queues. Deactivate Queues for the specified Project ID. You must delete all queues and credentials before this call or you need to set the force_delete parameter.
359
- *
360
- * @param request - The request {@link SqsApiDeactivateSqsRequest}
361
- * @returns A Promise of SqsInfo
362
- */
363
- deactivateSqs = (request = {}) => this.client.fetch(
364
- {
365
- body: JSON.stringify(
366
- marshalling_gen.marshalSqsApiDeactivateSqsRequest(request, this.client.settings)
367
- ),
368
- headers: jsonContentHeaders,
369
- method: "POST",
370
- path: `/mnq/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deactivate-sqs`
371
- },
372
- marshalling_gen.unmarshalSqsInfo
373
- );
374
- /**
375
- * Create Queues credentials. Create a set of credentials for Queues, specified by a Project ID. Credentials give the bearer access to queues, and the level of permissions can be defined granularly.
376
- *
377
- * @param request - The request {@link SqsApiCreateSqsCredentialsRequest}
378
- * @returns A Promise of SqsCredentials
379
- */
380
- createSqsCredentials = (request = {}) => this.client.fetch(
381
- {
382
- body: JSON.stringify(
383
- marshalling_gen.marshalSqsApiCreateSqsCredentialsRequest(
384
- request,
385
- this.client.settings
386
- )
387
- ),
388
- headers: jsonContentHeaders,
389
- method: "POST",
390
- path: `/mnq/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/sqs-credentials`
391
- },
392
- marshalling_gen.unmarshalSqsCredentials
393
- );
394
- /**
395
- * Delete Queues credentials. Delete a set of Queues credentials, specified by their credentials ID. Deleting credentials is irreversible and cannot be undone. The credentials can then no longer be used to access Queues.
396
- *
397
- * @param request - The request {@link SqsApiDeleteSqsCredentialsRequest}
398
- */
399
- deleteSqsCredentials = (request) => this.client.fetch({
400
- method: "DELETE",
401
- path: `/mnq/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/sqs-credentials/${sdkClient.validatePathParam("sqsCredentialsId", request.sqsCredentialsId)}`
402
- });
403
- /**
404
- * Update Queues credentials. Update a set of Queues credentials. You can update the credentials' name, or their permissions.
405
- *
406
- * @param request - The request {@link SqsApiUpdateSqsCredentialsRequest}
407
- * @returns A Promise of SqsCredentials
408
- */
409
- updateSqsCredentials = (request) => this.client.fetch(
410
- {
411
- body: JSON.stringify(
412
- marshalling_gen.marshalSqsApiUpdateSqsCredentialsRequest(
413
- request,
414
- this.client.settings
415
- )
416
- ),
417
- headers: jsonContentHeaders,
418
- method: "PATCH",
419
- path: `/mnq/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/sqs-credentials/${sdkClient.validatePathParam("sqsCredentialsId", request.sqsCredentialsId)}`
420
- },
421
- marshalling_gen.unmarshalSqsCredentials
422
- );
423
- /**
424
- * Get Queues credentials. Retrieve an existing set of credentials, identified by the `credentials_id`. The credentials themselves, as well as their metadata (name, project ID etc), are returned in the response.
425
- *
426
- * @param request - The request {@link SqsApiGetSqsCredentialsRequest}
427
- * @returns A Promise of SqsCredentials
428
- */
429
- getSqsCredentials = (request) => this.client.fetch(
430
- {
431
- method: "GET",
432
- path: `/mnq/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/sqs-credentials/${sdkClient.validatePathParam("sqsCredentialsId", request.sqsCredentialsId)}`
433
- },
434
- marshalling_gen.unmarshalSqsCredentials
435
- );
436
- pageOfListSqsCredentials = (request = {}) => this.client.fetch(
437
- {
438
- method: "GET",
439
- path: `/mnq/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/sqs-credentials`,
440
- urlParams: sdkClient.urlParams(
441
- ["order_by", request.orderBy],
442
- ["page", request.page],
443
- [
444
- "page_size",
445
- request.pageSize ?? this.client.settings.defaultPageSize
446
- ],
447
- ["project_id", request.projectId]
448
- )
449
- },
450
- marshalling_gen.unmarshalListSqsCredentialsResponse
451
- );
452
- /**
453
- * List Queues credentials. List existing Queues credentials in the specified region. The response contains only the metadata for the credentials, not the credentials themselves.
454
- *
455
- * @param request - The request {@link SqsApiListSqsCredentialsRequest}
456
- * @returns A Promise of ListSqsCredentialsResponse
457
- */
458
- listSqsCredentials = (request = {}) => sdkClient.enrichForPagination(
459
- "sqsCredentials",
460
- this.pageOfListSqsCredentials,
461
- request
462
- );
463
- }
464
- exports.NatsAPI = NatsAPI;
465
- exports.SnsAPI = SnsAPI;
466
- exports.SqsAPI = SqsAPI;
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const api_gen = require("./api.gen.cjs");
4
- const marshalling_gen = require("./marshalling.gen.cjs");
5
- const validationRules_gen = require("./validation-rules.gen.cjs");
6
- exports.NatsAPI = api_gen.NatsAPI;
7
- exports.SnsAPI = api_gen.SnsAPI;
8
- exports.SqsAPI = api_gen.SqsAPI;
9
- exports.marshalNatsApiCreateNatsAccountRequest = marshalling_gen.marshalNatsApiCreateNatsAccountRequest;
10
- exports.marshalNatsApiCreateNatsCredentialsRequest = marshalling_gen.marshalNatsApiCreateNatsCredentialsRequest;
11
- exports.marshalNatsApiUpdateNatsAccountRequest = marshalling_gen.marshalNatsApiUpdateNatsAccountRequest;
12
- exports.marshalSnsApiActivateSnsRequest = marshalling_gen.marshalSnsApiActivateSnsRequest;
13
- exports.marshalSnsApiCreateSnsCredentialsRequest = marshalling_gen.marshalSnsApiCreateSnsCredentialsRequest;
14
- exports.marshalSnsApiDeactivateSnsRequest = marshalling_gen.marshalSnsApiDeactivateSnsRequest;
15
- exports.marshalSnsApiUpdateSnsCredentialsRequest = marshalling_gen.marshalSnsApiUpdateSnsCredentialsRequest;
16
- exports.marshalSqsApiActivateSqsRequest = marshalling_gen.marshalSqsApiActivateSqsRequest;
17
- exports.marshalSqsApiCreateSqsCredentialsRequest = marshalling_gen.marshalSqsApiCreateSqsCredentialsRequest;
18
- exports.marshalSqsApiDeactivateSqsRequest = marshalling_gen.marshalSqsApiDeactivateSqsRequest;
19
- exports.marshalSqsApiUpdateSqsCredentialsRequest = marshalling_gen.marshalSqsApiUpdateSqsCredentialsRequest;
20
- exports.unmarshalListNatsAccountsResponse = marshalling_gen.unmarshalListNatsAccountsResponse;
21
- exports.unmarshalListNatsCredentialsResponse = marshalling_gen.unmarshalListNatsCredentialsResponse;
22
- exports.unmarshalListSnsCredentialsResponse = marshalling_gen.unmarshalListSnsCredentialsResponse;
23
- exports.unmarshalListSqsCredentialsResponse = marshalling_gen.unmarshalListSqsCredentialsResponse;
24
- exports.unmarshalNatsAccount = marshalling_gen.unmarshalNatsAccount;
25
- exports.unmarshalNatsCredentials = marshalling_gen.unmarshalNatsCredentials;
26
- exports.unmarshalSnsCredentials = marshalling_gen.unmarshalSnsCredentials;
27
- exports.unmarshalSnsInfo = marshalling_gen.unmarshalSnsInfo;
28
- exports.unmarshalSqsCredentials = marshalling_gen.unmarshalSqsCredentials;
29
- exports.unmarshalSqsInfo = marshalling_gen.unmarshalSqsInfo;
30
- exports.ValidationRules = validationRules_gen;
@@ -1,268 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const randomName = require("@scaleway/random-name");
4
- const sdkClient = require("@scaleway/sdk-client");
5
- const unmarshalNatsAccount = (data) => {
6
- if (!sdkClient.isJSONObject(data)) {
7
- throw new TypeError(
8
- `Unmarshalling the type 'NatsAccount' failed as data isn't a dictionary.`
9
- );
10
- }
11
- return {
12
- createdAt: sdkClient.unmarshalDate(data.created_at),
13
- endpoint: data.endpoint,
14
- id: data.id,
15
- name: data.name,
16
- projectId: data.project_id,
17
- region: data.region,
18
- updatedAt: sdkClient.unmarshalDate(data.updated_at)
19
- };
20
- };
21
- const unmarshalFile = (data) => {
22
- if (!sdkClient.isJSONObject(data)) {
23
- throw new TypeError(
24
- `Unmarshalling the type 'File' failed as data isn't a dictionary.`
25
- );
26
- }
27
- return {
28
- content: data.content,
29
- name: data.name
30
- };
31
- };
32
- const unmarshalNatsCredentials = (data) => {
33
- if (!sdkClient.isJSONObject(data)) {
34
- throw new TypeError(
35
- `Unmarshalling the type 'NatsCredentials' failed as data isn't a dictionary.`
36
- );
37
- }
38
- return {
39
- checksum: data.checksum,
40
- createdAt: sdkClient.unmarshalDate(data.created_at),
41
- credentials: data.credentials ? unmarshalFile(data.credentials) : void 0,
42
- id: data.id,
43
- name: data.name,
44
- natsAccountId: data.nats_account_id,
45
- region: data.region,
46
- updatedAt: sdkClient.unmarshalDate(data.updated_at)
47
- };
48
- };
49
- const unmarshalSnsPermissions = (data) => {
50
- if (!sdkClient.isJSONObject(data)) {
51
- throw new TypeError(
52
- `Unmarshalling the type 'SnsPermissions' failed as data isn't a dictionary.`
53
- );
54
- }
55
- return {
56
- canManage: data.can_manage,
57
- canPublish: data.can_publish,
58
- canReceive: data.can_receive
59
- };
60
- };
61
- const unmarshalSnsCredentials = (data) => {
62
- if (!sdkClient.isJSONObject(data)) {
63
- throw new TypeError(
64
- `Unmarshalling the type 'SnsCredentials' failed as data isn't a dictionary.`
65
- );
66
- }
67
- return {
68
- accessKey: data.access_key,
69
- createdAt: sdkClient.unmarshalDate(data.created_at),
70
- id: data.id,
71
- name: data.name,
72
- permissions: data.permissions ? unmarshalSnsPermissions(data.permissions) : void 0,
73
- projectId: data.project_id,
74
- region: data.region,
75
- secretChecksum: data.secret_checksum,
76
- secretKey: data.secret_key,
77
- updatedAt: sdkClient.unmarshalDate(data.updated_at)
78
- };
79
- };
80
- const unmarshalSqsPermissions = (data) => {
81
- if (!sdkClient.isJSONObject(data)) {
82
- throw new TypeError(
83
- `Unmarshalling the type 'SqsPermissions' failed as data isn't a dictionary.`
84
- );
85
- }
86
- return {
87
- canManage: data.can_manage,
88
- canPublish: data.can_publish,
89
- canReceive: data.can_receive
90
- };
91
- };
92
- const unmarshalSqsCredentials = (data) => {
93
- if (!sdkClient.isJSONObject(data)) {
94
- throw new TypeError(
95
- `Unmarshalling the type 'SqsCredentials' failed as data isn't a dictionary.`
96
- );
97
- }
98
- return {
99
- accessKey: data.access_key,
100
- createdAt: sdkClient.unmarshalDate(data.created_at),
101
- id: data.id,
102
- name: data.name,
103
- permissions: data.permissions ? unmarshalSqsPermissions(data.permissions) : void 0,
104
- projectId: data.project_id,
105
- region: data.region,
106
- secretChecksum: data.secret_checksum,
107
- secretKey: data.secret_key,
108
- updatedAt: sdkClient.unmarshalDate(data.updated_at)
109
- };
110
- };
111
- const unmarshalListNatsAccountsResponse = (data) => {
112
- if (!sdkClient.isJSONObject(data)) {
113
- throw new TypeError(
114
- `Unmarshalling the type 'ListNatsAccountsResponse' failed as data isn't a dictionary.`
115
- );
116
- }
117
- return {
118
- natsAccounts: sdkClient.unmarshalArrayOfObject(
119
- data.nats_accounts,
120
- unmarshalNatsAccount
121
- ),
122
- totalCount: data.total_count
123
- };
124
- };
125
- const unmarshalListNatsCredentialsResponse = (data) => {
126
- if (!sdkClient.isJSONObject(data)) {
127
- throw new TypeError(
128
- `Unmarshalling the type 'ListNatsCredentialsResponse' failed as data isn't a dictionary.`
129
- );
130
- }
131
- return {
132
- natsCredentials: sdkClient.unmarshalArrayOfObject(
133
- data.nats_credentials,
134
- unmarshalNatsCredentials
135
- ),
136
- totalCount: data.total_count
137
- };
138
- };
139
- const unmarshalListSnsCredentialsResponse = (data) => {
140
- if (!sdkClient.isJSONObject(data)) {
141
- throw new TypeError(
142
- `Unmarshalling the type 'ListSnsCredentialsResponse' failed as data isn't a dictionary.`
143
- );
144
- }
145
- return {
146
- snsCredentials: sdkClient.unmarshalArrayOfObject(
147
- data.sns_credentials,
148
- unmarshalSnsCredentials
149
- ),
150
- totalCount: data.total_count
151
- };
152
- };
153
- const unmarshalListSqsCredentialsResponse = (data) => {
154
- if (!sdkClient.isJSONObject(data)) {
155
- throw new TypeError(
156
- `Unmarshalling the type 'ListSqsCredentialsResponse' failed as data isn't a dictionary.`
157
- );
158
- }
159
- return {
160
- sqsCredentials: sdkClient.unmarshalArrayOfObject(
161
- data.sqs_credentials,
162
- unmarshalSqsCredentials
163
- ),
164
- totalCount: data.total_count
165
- };
166
- };
167
- const unmarshalSnsInfo = (data) => {
168
- if (!sdkClient.isJSONObject(data)) {
169
- throw new TypeError(
170
- `Unmarshalling the type 'SnsInfo' failed as data isn't a dictionary.`
171
- );
172
- }
173
- return {
174
- createdAt: sdkClient.unmarshalDate(data.created_at),
175
- projectId: data.project_id,
176
- region: data.region,
177
- snsEndpointUrl: data.sns_endpoint_url,
178
- status: data.status,
179
- updatedAt: sdkClient.unmarshalDate(data.updated_at)
180
- };
181
- };
182
- const unmarshalSqsInfo = (data) => {
183
- if (!sdkClient.isJSONObject(data)) {
184
- throw new TypeError(
185
- `Unmarshalling the type 'SqsInfo' failed as data isn't a dictionary.`
186
- );
187
- }
188
- return {
189
- createdAt: sdkClient.unmarshalDate(data.created_at),
190
- projectId: data.project_id,
191
- region: data.region,
192
- sqsEndpointUrl: data.sqs_endpoint_url,
193
- status: data.status,
194
- updatedAt: sdkClient.unmarshalDate(data.updated_at)
195
- };
196
- };
197
- const marshalNatsApiCreateNatsAccountRequest = (request, defaults) => ({
198
- name: request.name || randomName("mnq"),
199
- project_id: request.projectId ?? defaults.defaultProjectId
200
- });
201
- const marshalNatsApiCreateNatsCredentialsRequest = (request, defaults) => ({
202
- name: request.name || randomName("mnq"),
203
- nats_account_id: request.natsAccountId
204
- });
205
- const marshalNatsApiUpdateNatsAccountRequest = (request, defaults) => ({
206
- name: request.name
207
- });
208
- const marshalSnsApiActivateSnsRequest = (request, defaults) => ({
209
- project_id: request.projectId ?? defaults.defaultProjectId
210
- });
211
- const marshalSnsPermissions = (request, defaults) => ({
212
- can_manage: request.canManage,
213
- can_publish: request.canPublish,
214
- can_receive: request.canReceive
215
- });
216
- const marshalSnsApiCreateSnsCredentialsRequest = (request, defaults) => ({
217
- name: request.name || randomName("mnq_sns"),
218
- permissions: request.permissions !== void 0 ? marshalSnsPermissions(request.permissions) : void 0,
219
- project_id: request.projectId ?? defaults.defaultProjectId
220
- });
221
- const marshalSnsApiDeactivateSnsRequest = (request, defaults) => ({
222
- project_id: request.projectId ?? defaults.defaultProjectId
223
- });
224
- const marshalSnsApiUpdateSnsCredentialsRequest = (request, defaults) => ({
225
- name: request.name,
226
- permissions: request.permissions !== void 0 ? marshalSnsPermissions(request.permissions) : void 0
227
- });
228
- const marshalSqsApiActivateSqsRequest = (request, defaults) => ({
229
- project_id: request.projectId ?? defaults.defaultProjectId
230
- });
231
- const marshalSqsPermissions = (request, defaults) => ({
232
- can_manage: request.canManage,
233
- can_publish: request.canPublish,
234
- can_receive: request.canReceive
235
- });
236
- const marshalSqsApiCreateSqsCredentialsRequest = (request, defaults) => ({
237
- name: request.name || randomName("mnq_sqs"),
238
- permissions: request.permissions !== void 0 ? marshalSqsPermissions(request.permissions) : void 0,
239
- project_id: request.projectId ?? defaults.defaultProjectId
240
- });
241
- const marshalSqsApiDeactivateSqsRequest = (request, defaults) => ({
242
- project_id: request.projectId ?? defaults.defaultProjectId
243
- });
244
- const marshalSqsApiUpdateSqsCredentialsRequest = (request, defaults) => ({
245
- name: request.name,
246
- permissions: request.permissions !== void 0 ? marshalSqsPermissions(request.permissions) : void 0
247
- });
248
- exports.marshalNatsApiCreateNatsAccountRequest = marshalNatsApiCreateNatsAccountRequest;
249
- exports.marshalNatsApiCreateNatsCredentialsRequest = marshalNatsApiCreateNatsCredentialsRequest;
250
- exports.marshalNatsApiUpdateNatsAccountRequest = marshalNatsApiUpdateNatsAccountRequest;
251
- exports.marshalSnsApiActivateSnsRequest = marshalSnsApiActivateSnsRequest;
252
- exports.marshalSnsApiCreateSnsCredentialsRequest = marshalSnsApiCreateSnsCredentialsRequest;
253
- exports.marshalSnsApiDeactivateSnsRequest = marshalSnsApiDeactivateSnsRequest;
254
- exports.marshalSnsApiUpdateSnsCredentialsRequest = marshalSnsApiUpdateSnsCredentialsRequest;
255
- exports.marshalSqsApiActivateSqsRequest = marshalSqsApiActivateSqsRequest;
256
- exports.marshalSqsApiCreateSqsCredentialsRequest = marshalSqsApiCreateSqsCredentialsRequest;
257
- exports.marshalSqsApiDeactivateSqsRequest = marshalSqsApiDeactivateSqsRequest;
258
- exports.marshalSqsApiUpdateSqsCredentialsRequest = marshalSqsApiUpdateSqsCredentialsRequest;
259
- exports.unmarshalListNatsAccountsResponse = unmarshalListNatsAccountsResponse;
260
- exports.unmarshalListNatsCredentialsResponse = unmarshalListNatsCredentialsResponse;
261
- exports.unmarshalListSnsCredentialsResponse = unmarshalListSnsCredentialsResponse;
262
- exports.unmarshalListSqsCredentialsResponse = unmarshalListSqsCredentialsResponse;
263
- exports.unmarshalNatsAccount = unmarshalNatsAccount;
264
- exports.unmarshalNatsCredentials = unmarshalNatsCredentials;
265
- exports.unmarshalSnsCredentials = unmarshalSnsCredentials;
266
- exports.unmarshalSnsInfo = unmarshalSnsInfo;
267
- exports.unmarshalSqsCredentials = unmarshalSqsCredentials;
268
- exports.unmarshalSqsInfo = unmarshalSqsInfo;
@@ -1,85 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const NatsAccount = {
4
- name: {
5
- maxLength: 64,
6
- minLength: 1
7
- }
8
- };
9
- const NatsApiCreateNatsAccountRequest = {
10
- name: {
11
- maxLength: 64,
12
- minLength: 1
13
- }
14
- };
15
- const NatsApiCreateNatsCredentialsRequest = {
16
- name: {
17
- maxLength: 500,
18
- minLength: 1
19
- }
20
- };
21
- const NatsApiUpdateNatsAccountRequest = {
22
- name: {
23
- maxLength: 64,
24
- minLength: 1
25
- }
26
- };
27
- const NatsCredentials = {
28
- name: {
29
- maxLength: 500,
30
- minLength: 1
31
- }
32
- };
33
- const SnsApiCreateSnsCredentialsRequest = {
34
- name: {
35
- maxLength: 500,
36
- minLength: 1
37
- }
38
- };
39
- const SnsApiUpdateSnsCredentialsRequest = {
40
- name: {
41
- maxLength: 500,
42
- minLength: 1
43
- }
44
- };
45
- const SnsCredentials = {
46
- accessKey: {
47
- minLength: 1
48
- },
49
- name: {
50
- maxLength: 500,
51
- minLength: 1
52
- }
53
- };
54
- const SqsApiCreateSqsCredentialsRequest = {
55
- name: {
56
- maxLength: 500,
57
- minLength: 1
58
- }
59
- };
60
- const SqsApiUpdateSqsCredentialsRequest = {
61
- name: {
62
- maxLength: 500,
63
- minLength: 1
64
- }
65
- };
66
- const SqsCredentials = {
67
- accessKey: {
68
- minLength: 1
69
- },
70
- name: {
71
- maxLength: 500,
72
- minLength: 1
73
- }
74
- };
75
- exports.NatsAccount = NatsAccount;
76
- exports.NatsApiCreateNatsAccountRequest = NatsApiCreateNatsAccountRequest;
77
- exports.NatsApiCreateNatsCredentialsRequest = NatsApiCreateNatsCredentialsRequest;
78
- exports.NatsApiUpdateNatsAccountRequest = NatsApiUpdateNatsAccountRequest;
79
- exports.NatsCredentials = NatsCredentials;
80
- exports.SnsApiCreateSnsCredentialsRequest = SnsApiCreateSnsCredentialsRequest;
81
- exports.SnsApiUpdateSnsCredentialsRequest = SnsApiUpdateSnsCredentialsRequest;
82
- exports.SnsCredentials = SnsCredentials;
83
- exports.SqsApiCreateSqsCredentialsRequest = SqsApiCreateSqsCredentialsRequest;
84
- exports.SqsApiUpdateSqsCredentialsRequest = SqsApiUpdateSqsCredentialsRequest;
85
- exports.SqsCredentials = SqsCredentials;