@scaleway/sdk 3.0.0-alpha.0 → 3.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.
Files changed (214) hide show
  1. package/dist/index.gen.d.ts +362 -0
  2. package/dist/index.gen.js +323 -0
  3. package/package.json +71 -25
  4. package/README.md +0 -46
  5. package/dist/api/account/index.js +0 -4
  6. package/dist/api/account/v2/api.gen.js +0 -147
  7. package/dist/api/account/v2/index.gen.js +0 -4
  8. package/dist/api/account/v2/marshalling.gen.js +0 -39
  9. package/dist/api/account/v3/api.gen.js +0 -129
  10. package/dist/api/account/v3/index.gen.js +0 -6
  11. package/dist/api/account/v3/marshalling.gen.js +0 -39
  12. package/dist/api/account/v3/validation-rules.gen.js +0 -39
  13. package/dist/api/applesilicon/index.js +0 -2
  14. package/dist/api/applesilicon/v1alpha1/api.gen.js +0 -220
  15. package/dist/api/applesilicon/v1alpha1/content.gen.js +0 -7
  16. package/dist/api/applesilicon/v1alpha1/index.gen.js +0 -5
  17. package/dist/api/applesilicon/v1alpha1/marshalling.gen.js +0 -113
  18. package/dist/api/baremetal/index.js +0 -2
  19. package/dist/api/baremetal/v1/api.gen.js +0 -523
  20. package/dist/api/baremetal/v1/api.utils.js +0 -27
  21. package/dist/api/baremetal/v1/content.gen.js +0 -13
  22. package/dist/api/baremetal/v1/index.js +0 -5
  23. package/dist/api/baremetal/v1/marshalling.gen.js +0 -395
  24. package/dist/api/baremetal/v1/validation-rules.gen.js +0 -109
  25. package/dist/api/billing/index.js +0 -2
  26. package/dist/api/billing/v2alpha1/api.gen.js +0 -80
  27. package/dist/api/billing/v2alpha1/index.gen.js +0 -4
  28. package/dist/api/billing/v2alpha1/marshalling.gen.js +0 -53
  29. package/dist/api/block/index.js +0 -2
  30. package/dist/api/block/v1alpha1/api.gen.js +0 -245
  31. package/dist/api/block/v1alpha1/content.gen.js +0 -13
  32. package/dist/api/block/v1alpha1/index.gen.js +0 -7
  33. package/dist/api/block/v1alpha1/marshalling.gen.js +0 -175
  34. package/dist/api/block/v1alpha1/validation-rules.gen.js +0 -42
  35. package/dist/api/cockpit/index.js +0 -2
  36. package/dist/api/cockpit/v1beta1/api.gen.js +0 -448
  37. package/dist/api/cockpit/v1beta1/content.gen.js +0 -7
  38. package/dist/api/cockpit/v1beta1/index.gen.js +0 -5
  39. package/dist/api/cockpit/v1beta1/marshalling.gen.js +0 -220
  40. package/dist/api/container/index.js +0 -2
  41. package/dist/api/container/v1beta1/api.gen.js +0 -549
  42. package/dist/api/container/v1beta1/content.gen.js +0 -22
  43. package/dist/api/container/v1beta1/index.gen.js +0 -5
  44. package/dist/api/container/v1beta1/marshalling.gen.js +0 -330
  45. package/dist/api/document_db/index.js +0 -2
  46. package/dist/api/document_db/v1beta1/api.gen.js +0 -830
  47. package/dist/api/document_db/v1beta1/content.gen.js +0 -19
  48. package/dist/api/document_db/v1beta1/index.gen.js +0 -7
  49. package/dist/api/document_db/v1beta1/marshalling.gen.js +0 -580
  50. package/dist/api/document_db/v1beta1/validation-rules.gen.js +0 -10
  51. package/dist/api/domain/index.js +0 -2
  52. package/dist/api/domain/v2beta1/api.gen.js +0 -875
  53. package/dist/api/domain/v2beta1/content.gen.js +0 -28
  54. package/dist/api/domain/v2beta1/index.gen.js +0 -7
  55. package/dist/api/domain/v2beta1/marshalling.gen.js +0 -958
  56. package/dist/api/flexibleip/index.js +0 -2
  57. package/dist/api/flexibleip/v1alpha1/api.gen.js +0 -203
  58. package/dist/api/flexibleip/v1alpha1/content.gen.js +0 -10
  59. package/dist/api/flexibleip/v1alpha1/index.gen.js +0 -7
  60. package/dist/api/flexibleip/v1alpha1/marshalling.gen.js +0 -97
  61. package/dist/api/flexibleip/v1alpha1/validation-rules.gen.js +0 -14
  62. package/dist/api/function/index.js +0 -2
  63. package/dist/api/function/v1beta1/api.gen.js +0 -560
  64. package/dist/api/function/v1beta1/content.gen.js +0 -22
  65. package/dist/api/function/v1beta1/index.gen.js +0 -5
  66. package/dist/api/function/v1beta1/marshalling.gen.js +0 -368
  67. package/dist/api/iam/index.js +0 -2
  68. package/dist/api/iam/v1alpha1/api.gen.js +0 -799
  69. package/dist/api/iam/v1alpha1/index.gen.js +0 -6
  70. package/dist/api/iam/v1alpha1/marshalling.gen.js +0 -373
  71. package/dist/api/iam/v1alpha1/validation-rules.gen.js +0 -207
  72. package/dist/api/instance/index.js +0 -2
  73. package/dist/api/instance/v1/api.gen.js +0 -1003
  74. package/dist/api/instance/v1/api.utils.js +0 -369
  75. package/dist/api/instance/v1/content.gen.js +0 -31
  76. package/dist/api/instance/v1/index.js +0 -2
  77. package/dist/api/instance/v1/marshalling.gen.js +0 -1206
  78. package/dist/api/instance/v1/marshalling.utils.js +0 -63
  79. package/dist/api/iot/index.js +0 -2
  80. package/dist/api/iot/v1/api.gen.js +0 -581
  81. package/dist/api/iot/v1/content.gen.js +0 -7
  82. package/dist/api/iot/v1/index.gen.js +0 -5
  83. package/dist/api/iot/v1/marshalling.gen.js +0 -388
  84. package/dist/api/ipfs/index.js +0 -2
  85. package/dist/api/ipfs/v1alpha1/api.gen.js +0 -197
  86. package/dist/api/ipfs/v1alpha1/content.gen.js +0 -7
  87. package/dist/api/ipfs/v1alpha1/index.gen.js +0 -5
  88. package/dist/api/ipfs/v1alpha1/marshalling.gen.js +0 -121
  89. package/dist/api/k8s/index.js +0 -2
  90. package/dist/api/k8s/v1/api.gen.js +0 -454
  91. package/dist/api/k8s/v1/api.utils.js +0 -13
  92. package/dist/api/k8s/v1/content.gen.js +0 -13
  93. package/dist/api/k8s/v1/index.js +0 -4
  94. package/dist/api/k8s/v1/marshalling.gen.js +0 -333
  95. package/dist/api/k8s/v1/validation-rules.gen.js +0 -101
  96. package/dist/api/lb/index.js +0 -2
  97. package/dist/api/lb/v1/api.gen.js +0 -1669
  98. package/dist/api/lb/v1/api.utils.js +0 -81
  99. package/dist/api/lb/v1/content.gen.js +0 -16
  100. package/dist/api/lb/v1/index.js +0 -2
  101. package/dist/api/lb/v1/marshalling.gen.js +0 -923
  102. package/dist/api/marketplace/index.js +0 -4
  103. package/dist/api/marketplace/v1/api.gen.js +0 -60
  104. package/dist/api/marketplace/v1/index.gen.js +0 -4
  105. package/dist/api/marketplace/v1/marshalling.gen.js +0 -92
  106. package/dist/api/marketplace/v2/api.gen.js +0 -162
  107. package/dist/api/marketplace/v2/index.gen.js +0 -4
  108. package/dist/api/marketplace/v2/marshalling.gen.js +0 -94
  109. package/dist/api/mnq/index.js +0 -2
  110. package/dist/api/mnq/v1alpha1/api.gen.js +0 -205
  111. package/dist/api/mnq/v1alpha1/index.gen.js +0 -4
  112. package/dist/api/mnq/v1alpha1/marshalling.gen.js +0 -121
  113. package/dist/api/rdb/index.js +0 -2
  114. package/dist/api/rdb/v1/api.gen.js +0 -972
  115. package/dist/api/rdb/v1/content.gen.js +0 -22
  116. package/dist/api/rdb/v1/index.gen.js +0 -7
  117. package/dist/api/rdb/v1/marshalling.gen.js +0 -636
  118. package/dist/api/rdb/v1/validation-rules.gen.js +0 -10
  119. package/dist/api/redis/index.js +0 -2
  120. package/dist/api/redis/v1/api.gen.js +0 -389
  121. package/dist/api/redis/v1/content.gen.js +0 -7
  122. package/dist/api/redis/v1/index.gen.js +0 -5
  123. package/dist/api/redis/v1/marshalling.gen.js +0 -259
  124. package/dist/api/registry/index.js +0 -2
  125. package/dist/api/registry/v1/api.gen.js +0 -252
  126. package/dist/api/registry/v1/content.gen.js +0 -13
  127. package/dist/api/registry/v1/index.gen.js +0 -5
  128. package/dist/api/registry/v1/marshalling.gen.js +0 -106
  129. package/dist/api/secret/index.js +0 -2
  130. package/dist/api/secret/v1alpha1/api.gen.js +0 -415
  131. package/dist/api/secret/v1alpha1/index.gen.js +0 -4
  132. package/dist/api/secret/v1alpha1/marshalling.gen.js +0 -143
  133. package/dist/api/tem/index.js +0 -2
  134. package/dist/api/tem/v1alpha1/api.gen.js +0 -229
  135. package/dist/api/tem/v1alpha1/content.gen.js +0 -10
  136. package/dist/api/tem/v1alpha1/index.gen.js +0 -5
  137. package/dist/api/tem/v1alpha1/marshalling.gen.js +0 -159
  138. package/dist/api/test/index.js +0 -2
  139. package/dist/api/test/v1/api.gen.js +0 -152
  140. package/dist/api/test/v1/content.gen.js +0 -7
  141. package/dist/api/test/v1/index.gen.js +0 -5
  142. package/dist/api/test/v1/marshalling.gen.js +0 -79
  143. package/dist/api/vpc/index.js +0 -4
  144. package/dist/api/vpc/v1/api.gen.js +0 -110
  145. package/dist/api/vpc/v1/index.gen.js +0 -4
  146. package/dist/api/vpc/v1/marshalling.gen.js +0 -44
  147. package/dist/api/vpc/v2/api.gen.js +0 -276
  148. package/dist/api/vpc/v2/index.gen.js +0 -4
  149. package/dist/api/vpc/v2/marshalling.gen.js +0 -135
  150. package/dist/api/vpcgw/index.js +0 -2
  151. package/dist/api/vpcgw/v1/api.gen.js +0 -669
  152. package/dist/api/vpcgw/v1/content.gen.js +0 -10
  153. package/dist/api/vpcgw/v1/index.gen.js +0 -5
  154. package/dist/api/vpcgw/v1/marshalling.gen.js +0 -336
  155. package/dist/api/webhosting/index.js +0 -2
  156. package/dist/api/webhosting/v1alpha1/api.gen.js +0 -210
  157. package/dist/api/webhosting/v1alpha1/content.gen.js +0 -7
  158. package/dist/api/webhosting/v1alpha1/index.gen.js +0 -7
  159. package/dist/api/webhosting/v1alpha1/marshalling.gen.js +0 -173
  160. package/dist/api/webhosting/v1alpha1/validation-rules.gen.js +0 -23
  161. package/dist/helpers/is-browser.js +0 -5
  162. package/dist/helpers/is-response.js +0 -10
  163. package/dist/helpers/json.js +0 -11
  164. package/dist/helpers/marshalling.js +0 -130
  165. package/dist/index.cjs +0 -24364
  166. package/dist/index.d.ts +0 -27584
  167. package/dist/index.js +0 -69
  168. package/dist/internal/async/interval-retrier.js +0 -105
  169. package/dist/internal/async/sleep.js +0 -13
  170. package/dist/internal/interceptors/composer.js +0 -46
  171. package/dist/internal/interceptors/helpers.js +0 -32
  172. package/dist/internal/logger/console-logger.js +0 -38
  173. package/dist/internal/logger/index.js +0 -41
  174. package/dist/internal/logger/level-resolver.js +0 -13
  175. package/dist/internal/validations/string-validation.js +0 -38
  176. package/dist/node_modules/.pnpm/@scaleway_random-name@4.0.2/node_modules/@scaleway/random-name/dist/index.js +0 -13
  177. package/dist/scw/api.js +0 -12
  178. package/dist/scw/auth.js +0 -68
  179. package/dist/scw/client-ini-factory.js +0 -174
  180. package/dist/scw/client-ini-profile.js +0 -54
  181. package/dist/scw/client-settings.js +0 -78
  182. package/dist/scw/client.js +0 -98
  183. package/dist/scw/constants.js +0 -4
  184. package/dist/scw/custom-marshalling.js +0 -131
  185. package/dist/scw/errors/error-parser.js +0 -107
  186. package/dist/scw/errors/non-standard/invalid-request-mapper.js +0 -36
  187. package/dist/scw/errors/non-standard/unknown-resource-mapper.js +0 -27
  188. package/dist/scw/errors/scw-error.js +0 -66
  189. package/dist/scw/errors/standard/already-exists-error.js +0 -26
  190. package/dist/scw/errors/standard/denied-authentication-error.js +0 -52
  191. package/dist/scw/errors/standard/index.js +0 -13
  192. package/dist/scw/errors/standard/invalid-arguments-error.js +0 -67
  193. package/dist/scw/errors/standard/out-of-stock-error.js +0 -22
  194. package/dist/scw/errors/standard/permissions-denied-error.js +0 -48
  195. package/dist/scw/errors/standard/precondition-failed-error.js +0 -42
  196. package/dist/scw/errors/standard/quotas-exceeded-error.js +0 -68
  197. package/dist/scw/errors/standard/resource-expired-error.js +0 -26
  198. package/dist/scw/errors/standard/resource-locked-error.js +0 -25
  199. package/dist/scw/errors/standard/resource-not-found-error.js +0 -25
  200. package/dist/scw/errors/standard/too-many-requests-error.js +0 -70
  201. package/dist/scw/errors/standard/transient-state-error.js +0 -26
  202. package/dist/scw/errors/types.js +0 -23
  203. package/dist/scw/fetch/build-fetcher.js +0 -72
  204. package/dist/scw/fetch/http-dumper.js +0 -54
  205. package/dist/scw/fetch/http-interceptors.js +0 -99
  206. package/dist/scw/fetch/resource-paginator.js +0 -84
  207. package/dist/scw/fetch/response-parser.js +0 -72
  208. package/node_modules/@scaleway/random-name/.npmignore +0 -4
  209. package/node_modules/@scaleway/random-name/CHANGELOG.md +0 -129
  210. package/node_modules/@scaleway/random-name/LICENSE.md +0 -21
  211. package/node_modules/@scaleway/random-name/README.md +0 -26
  212. package/node_modules/@scaleway/random-name/dist/index.d.ts +0 -3
  213. package/node_modules/@scaleway/random-name/dist/index.js +0 -13
  214. package/node_modules/@scaleway/random-name/package.json +0 -23
@@ -1,560 +0,0 @@
1
- import { waitForResource } from '../../../internal/async/interval-retrier.js';
2
- import { API as API$1 } from '../../../scw/api.js';
3
- import { validatePathParam, urlParams, resolveOneOf } from '../../../helpers/marshalling.js';
4
- import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
5
- import { NAMESPACE_TRANSIENT_STATUSES, FUNCTION_TRANSIENT_STATUSES, CRON_TRANSIENT_STATUSES, DOMAIN_TRANSIENT_STATUSES, TOKEN_TRANSIENT_STATUSES, TRIGGER_TRANSIENT_STATUSES } from './content.gen.js';
6
- import { unmarshalListNamespacesResponse, unmarshalNamespace, marshalCreateNamespaceRequest, marshalUpdateNamespaceRequest, unmarshalListFunctionsResponse, unmarshalFunction, marshalCreateFunctionRequest, marshalUpdateFunctionRequest, unmarshalListFunctionRuntimesResponse, unmarshalUploadURL, unmarshalDownloadURL, unmarshalListCronsResponse, unmarshalCron, marshalCreateCronRequest, marshalUpdateCronRequest, unmarshalListLogsResponse, unmarshalListDomainsResponse, unmarshalDomain, marshalCreateDomainRequest, unmarshalToken, marshalCreateTokenRequest, unmarshalListTokensResponse, marshalCreateTriggerRequest, unmarshalTrigger, unmarshalListTriggersResponse, marshalUpdateTriggerRequest } from './marshalling.gen.js';
7
-
8
- // This file was automatically generated. DO NOT EDIT.
9
- // If you have any remark or suggestion do not hesitate to open an issue.
10
- const jsonContentHeaders = {
11
- 'Content-Type': 'application/json; charset=utf-8'
12
- };
13
-
14
- /** Serverless Functions API. */
15
- class API extends API$1 {
16
- /** Lists the available regions of the API. */
17
- static LOCALITIES = ['fr-par', 'nl-ams', 'pl-waw'];
18
- pageOfListNamespaces = (() => {
19
- var _this = this;
20
- return function (request) {
21
- if (request === void 0) {
22
- request = {};
23
- }
24
- return _this.client.fetch({
25
- method: 'GET',
26
- path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? _this.client.settings.defaultRegion)}/namespaces`,
27
- urlParams: urlParams(['name', request.name], ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_id', request.projectId])
28
- }, unmarshalListNamespacesResponse);
29
- };
30
- })();
31
-
32
- /**
33
- * List all your namespaces. List all existing namespaces in the specified
34
- * region.
35
- *
36
- * @param request - The request {@link ListNamespacesRequest}
37
- * @returns A Promise of ListNamespacesResponse
38
- */
39
- listNamespaces = (() => {
40
- var _this2 = this;
41
- return function (request) {
42
- if (request === void 0) {
43
- request = {};
44
- }
45
- return enrichForPagination('namespaces', _this2.pageOfListNamespaces, request);
46
- };
47
- })();
48
-
49
- /**
50
- * Get a namespace. Get the namespace associated with the specified ID.
51
- *
52
- * @param request - The request {@link GetNamespaceRequest}
53
- * @returns A Promise of Namespace
54
- */
55
- getNamespace = request => this.client.fetch({
56
- method: 'GET',
57
- path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces/${validatePathParam('namespaceId', request.namespaceId)}`
58
- }, unmarshalNamespace);
59
-
60
- /**
61
- * Waits for {@link Namespace} to be in a final state.
62
- *
63
- * @param request - The request {@link GetNamespaceRequest}
64
- * @param options - The waiting options
65
- * @returns A Promise of Namespace
66
- */
67
- waitForNamespace = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!NAMESPACE_TRANSIENT_STATUSES.includes(res.status))), this.getNamespace, request, options);
68
-
69
- /**
70
- * Create a new namespace. Create a new namespace in a specified Organization
71
- * or Project.
72
- *
73
- * @param request - The request {@link CreateNamespaceRequest}
74
- * @returns A Promise of Namespace
75
- */
76
- createNamespace = (() => {
77
- var _this3 = this;
78
- return function (request) {
79
- if (request === void 0) {
80
- request = {};
81
- }
82
- return _this3.client.fetch({
83
- body: JSON.stringify(marshalCreateNamespaceRequest(request, _this3.client.settings)),
84
- headers: jsonContentHeaders,
85
- method: 'POST',
86
- path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? _this3.client.settings.defaultRegion)}/namespaces`
87
- }, unmarshalNamespace);
88
- };
89
- })();
90
-
91
- /**
92
- * Update an existing namespace. Update the namespace associated with the
93
- * specified ID.
94
- *
95
- * @param request - The request {@link UpdateNamespaceRequest}
96
- * @returns A Promise of Namespace
97
- */
98
- updateNamespace = request => this.client.fetch({
99
- body: JSON.stringify(marshalUpdateNamespaceRequest(request, this.client.settings)),
100
- headers: jsonContentHeaders,
101
- method: 'PATCH',
102
- path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces/${validatePathParam('namespaceId', request.namespaceId)}`
103
- }, unmarshalNamespace);
104
-
105
- /**
106
- * Delete an existing namespace. Delete the namespace associated with the
107
- * specified ID.
108
- *
109
- * @param request - The request {@link DeleteNamespaceRequest}
110
- * @returns A Promise of Namespace
111
- */
112
- deleteNamespace = request => this.client.fetch({
113
- method: 'DELETE',
114
- path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces/${validatePathParam('namespaceId', request.namespaceId)}`
115
- }, unmarshalNamespace);
116
- pageOfListFunctions = request => this.client.fetch({
117
- method: 'GET',
118
- path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/functions`,
119
- urlParams: urlParams(['name', request.name], ['namespace_id', request.namespaceId], ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId])
120
- }, unmarshalListFunctionsResponse);
121
-
122
- /**
123
- * List all your functions.
124
- *
125
- * @param request - The request {@link ListFunctionsRequest}
126
- * @returns A Promise of ListFunctionsResponse
127
- */
128
- listFunctions = request => enrichForPagination('functions', this.pageOfListFunctions, request);
129
-
130
- /**
131
- * Get a function. Get the function associated with the specified ID.
132
- *
133
- * @param request - The request {@link GetFunctionRequest}
134
- * @returns A Promise of Function
135
- */
136
- getFunction = request => this.client.fetch({
137
- method: 'GET',
138
- path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/functions/${validatePathParam('functionId', request.functionId)}`
139
- }, unmarshalFunction);
140
-
141
- /**
142
- * Waits for {@link Function} to be in a final state.
143
- *
144
- * @param request - The request {@link GetFunctionRequest}
145
- * @param options - The waiting options
146
- * @returns A Promise of Function
147
- */
148
- waitForFunction = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!FUNCTION_TRANSIENT_STATUSES.includes(res.status))), this.getFunction, request, options);
149
-
150
- /**
151
- * Create a new function. Create a new function in the specified region for a
152
- * specified Organization or Project.
153
- *
154
- * @param request - The request {@link CreateFunctionRequest}
155
- * @returns A Promise of Function
156
- */
157
- createFunction = request => this.client.fetch({
158
- body: JSON.stringify(marshalCreateFunctionRequest(request, this.client.settings)),
159
- headers: jsonContentHeaders,
160
- method: 'POST',
161
- path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/functions`
162
- }, unmarshalFunction);
163
-
164
- /**
165
- * Update an existing function. Update the function associated with the
166
- * specified ID.
167
- *
168
- * @param request - The request {@link UpdateFunctionRequest}
169
- * @returns A Promise of Function
170
- */
171
- updateFunction = request => this.client.fetch({
172
- body: JSON.stringify(marshalUpdateFunctionRequest(request, this.client.settings)),
173
- headers: jsonContentHeaders,
174
- method: 'PATCH',
175
- path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/functions/${validatePathParam('functionId', request.functionId)}`
176
- }, unmarshalFunction);
177
-
178
- /**
179
- * Delete a function. Delete the function associated with the specified ID.
180
- *
181
- * @param request - The request {@link DeleteFunctionRequest}
182
- * @returns A Promise of Function
183
- */
184
- deleteFunction = request => this.client.fetch({
185
- method: 'DELETE',
186
- path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/functions/${validatePathParam('functionId', request.functionId)}`
187
- }, unmarshalFunction);
188
-
189
- /**
190
- * Deploy a function. Deploy a function associated with the specified ID.
191
- *
192
- * @param request - The request {@link DeployFunctionRequest}
193
- * @returns A Promise of Function
194
- */
195
- deployFunction = request => this.client.fetch({
196
- body: '{}',
197
- headers: jsonContentHeaders,
198
- method: 'POST',
199
- path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/functions/${validatePathParam('functionId', request.functionId)}/deploy`
200
- }, unmarshalFunction);
201
-
202
- /**
203
- * List function runtimes. List available function runtimes.
204
- *
205
- * @param request - The request {@link ListFunctionRuntimesRequest}
206
- * @returns A Promise of ListFunctionRuntimesResponse
207
- */
208
- listFunctionRuntimes = (() => {
209
- var _this4 = this;
210
- return function (request) {
211
- if (request === void 0) {
212
- request = {};
213
- }
214
- return _this4.client.fetch({
215
- method: 'GET',
216
- path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? _this4.client.settings.defaultRegion)}/runtimes`
217
- }, unmarshalListFunctionRuntimesResponse);
218
- };
219
- })();
220
-
221
- /**
222
- * Get an upload URL of a function. Get an upload URL of a function associated
223
- * with the specified ID.
224
- *
225
- * @param request - The request {@link GetFunctionUploadURLRequest}
226
- * @returns A Promise of UploadURL
227
- */
228
- getFunctionUploadURL = request => this.client.fetch({
229
- method: 'GET',
230
- path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/functions/${validatePathParam('functionId', request.functionId)}/upload-url`,
231
- urlParams: urlParams(['content_length', request.contentLength])
232
- }, unmarshalUploadURL);
233
-
234
- /**
235
- * Get a download URL of a function. Get a download URL for a function
236
- * associated with the specified ID.
237
- *
238
- * @param request - The request {@link GetFunctionDownloadURLRequest}
239
- * @returns A Promise of DownloadURL
240
- */
241
- getFunctionDownloadURL = request => this.client.fetch({
242
- method: 'GET',
243
- path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/functions/${validatePathParam('functionId', request.functionId)}/download-url`
244
- }, unmarshalDownloadURL);
245
- pageOfListCrons = request => this.client.fetch({
246
- method: 'GET',
247
- path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/crons`,
248
- urlParams: urlParams(['function_id', request.functionId], ['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
249
- }, unmarshalListCronsResponse);
250
-
251
- /**
252
- * List all crons. List all the cronjobs in a specified region.
253
- *
254
- * @param request - The request {@link ListCronsRequest}
255
- * @returns A Promise of ListCronsResponse
256
- */
257
- listCrons = request => enrichForPagination('crons', this.pageOfListCrons, request);
258
-
259
- /**
260
- * Get a cron. Get the cron associated with the specified ID.
261
- *
262
- * @param request - The request {@link GetCronRequest}
263
- * @returns A Promise of Cron
264
- */
265
- getCron = request => this.client.fetch({
266
- method: 'GET',
267
- path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/crons/${validatePathParam('cronId', request.cronId)}`
268
- }, unmarshalCron);
269
-
270
- /**
271
- * Waits for {@link Cron} to be in a final state.
272
- *
273
- * @param request - The request {@link GetCronRequest}
274
- * @param options - The waiting options
275
- * @returns A Promise of Cron
276
- */
277
- waitForCron = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!CRON_TRANSIENT_STATUSES.includes(res.status))), this.getCron, request, options);
278
-
279
- /**
280
- * Create a new cron. Create a new cronjob for a function with the specified
281
- * ID.
282
- *
283
- * @param request - The request {@link CreateCronRequest}
284
- * @returns A Promise of Cron
285
- */
286
- createCron = request => this.client.fetch({
287
- body: JSON.stringify(marshalCreateCronRequest(request, this.client.settings)),
288
- headers: jsonContentHeaders,
289
- method: 'POST',
290
- path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/crons`
291
- }, unmarshalCron);
292
-
293
- /**
294
- * Update an existing cron. Update the cron associated with the specified ID.
295
- *
296
- * @param request - The request {@link UpdateCronRequest}
297
- * @returns A Promise of Cron
298
- */
299
- updateCron = request => this.client.fetch({
300
- body: JSON.stringify(marshalUpdateCronRequest(request, this.client.settings)),
301
- headers: jsonContentHeaders,
302
- method: 'PATCH',
303
- path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/crons/${validatePathParam('cronId', request.cronId)}`
304
- }, unmarshalCron);
305
-
306
- /**
307
- * Delete an existing cron. Delete the cron associated with the specified ID.
308
- *
309
- * @param request - The request {@link DeleteCronRequest}
310
- * @returns A Promise of Cron
311
- */
312
- deleteCron = request => this.client.fetch({
313
- method: 'DELETE',
314
- path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/crons/${validatePathParam('cronId', request.cronId)}`
315
- }, unmarshalCron);
316
- pageOfListLogs = request => this.client.fetch({
317
- method: 'GET',
318
- path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/functions/${validatePathParam('functionId', request.functionId)}/logs`,
319
- urlParams: urlParams(['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
320
- }, unmarshalListLogsResponse);
321
-
322
- /**
323
- * List application logs. List the application logs of the function with the
324
- * specified ID.
325
- *
326
- * @param request - The request {@link ListLogsRequest}
327
- * @returns A Promise of ListLogsResponse
328
- */
329
- listLogs = request => enrichForPagination('logs', this.pageOfListLogs, request);
330
- pageOfListDomains = request => this.client.fetch({
331
- method: 'GET',
332
- path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains`,
333
- urlParams: urlParams(['function_id', request.functionId], ['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
334
- }, unmarshalListDomainsResponse);
335
-
336
- /**
337
- * List all domain name bindings. List all domain name bindings in a specified
338
- * region.
339
- *
340
- * @param request - The request {@link ListDomainsRequest}
341
- * @returns A Promise of ListDomainsResponse
342
- */
343
- listDomains = request => enrichForPagination('domains', this.pageOfListDomains, request);
344
-
345
- /**
346
- * Get a domain name binding. Get a domain name binding for the function with
347
- * the specified ID.
348
- *
349
- * @param request - The request {@link GetDomainRequest}
350
- * @returns A Promise of Domain
351
- */
352
- getDomain = request => this.client.fetch({
353
- method: 'GET',
354
- path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam('domainId', request.domainId)}`
355
- }, unmarshalDomain);
356
-
357
- /**
358
- * Waits for {@link Domain} to be in a final state.
359
- *
360
- * @param request - The request {@link GetDomainRequest}
361
- * @param options - The waiting options
362
- * @returns A Promise of Domain
363
- */
364
- waitForDomain = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!DOMAIN_TRANSIENT_STATUSES.includes(res.status))), this.getDomain, request, options);
365
-
366
- /**
367
- * Create a domain name binding. Create a domain name binding for the function
368
- * with the specified ID.
369
- *
370
- * @param request - The request {@link CreateDomainRequest}
371
- * @returns A Promise of Domain
372
- */
373
- createDomain = request => this.client.fetch({
374
- body: JSON.stringify(marshalCreateDomainRequest(request, this.client.settings)),
375
- headers: jsonContentHeaders,
376
- method: 'POST',
377
- path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains`
378
- }, unmarshalDomain);
379
-
380
- /**
381
- * Delete a domain name binding. Delete a domain name binding for the function
382
- * with the specified ID.
383
- *
384
- * @param request - The request {@link DeleteDomainRequest}
385
- * @returns A Promise of Domain
386
- */
387
- deleteDomain = request => this.client.fetch({
388
- method: 'DELETE',
389
- path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam('domainId', request.domainId)}`
390
- }, unmarshalDomain);
391
-
392
- /**
393
- * @deprecated
394
- * @param request - The request {@link IssueJWTRequest}
395
- * @returns A Promise of Token
396
- */
397
- issueJWT = (() => {
398
- var _this5 = this;
399
- return function (request) {
400
- if (request === void 0) {
401
- request = {};
402
- }
403
- return _this5.client.fetch({
404
- method: 'GET',
405
- path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? _this5.client.settings.defaultRegion)}/issue-jwt`,
406
- urlParams: urlParams(['expires_at', request.expiresAt], ...Object.entries(resolveOneOf([{
407
- param: 'function_id',
408
- value: request.functionId
409
- }, {
410
- param: 'namespace_id',
411
- value: request.namespaceId
412
- }])))
413
- }, unmarshalToken);
414
- };
415
- })();
416
-
417
- /**
418
- * Create a new revocable token.
419
- *
420
- * @param request - The request {@link CreateTokenRequest}
421
- * @returns A Promise of Token
422
- */
423
- createToken = (() => {
424
- var _this6 = this;
425
- return function (request) {
426
- if (request === void 0) {
427
- request = {};
428
- }
429
- return _this6.client.fetch({
430
- body: JSON.stringify(marshalCreateTokenRequest(request, _this6.client.settings)),
431
- headers: jsonContentHeaders,
432
- method: 'POST',
433
- path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? _this6.client.settings.defaultRegion)}/tokens`
434
- }, unmarshalToken);
435
- };
436
- })();
437
-
438
- /**
439
- * Get a token.
440
- *
441
- * @param request - The request {@link GetTokenRequest}
442
- * @returns A Promise of Token
443
- */
444
- getToken = request => this.client.fetch({
445
- method: 'GET',
446
- path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/tokens/${validatePathParam('tokenId', request.tokenId)}`
447
- }, unmarshalToken);
448
-
449
- /**
450
- * Waits for {@link Token} to be in a final state.
451
- *
452
- * @param request - The request {@link GetTokenRequest}
453
- * @param options - The waiting options
454
- * @returns A Promise of Token
455
- */
456
- waitForToken = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!TOKEN_TRANSIENT_STATUSES.includes(res.status))), this.getToken, request, options);
457
- pageOfListTokens = (() => {
458
- var _this7 = this;
459
- return function (request) {
460
- if (request === void 0) {
461
- request = {};
462
- }
463
- return _this7.client.fetch({
464
- method: 'GET',
465
- path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? _this7.client.settings.defaultRegion)}/tokens`,
466
- urlParams: urlParams(['function_id', request.functionId], ['namespace_id', request.namespaceId], ['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? _this7.client.settings.defaultPageSize])
467
- }, unmarshalListTokensResponse);
468
- };
469
- })();
470
-
471
- /**
472
- * List all tokens.
473
- *
474
- * @param request - The request {@link ListTokensRequest}
475
- * @returns A Promise of ListTokensResponse
476
- */
477
- listTokens = (() => {
478
- var _this8 = this;
479
- return function (request) {
480
- if (request === void 0) {
481
- request = {};
482
- }
483
- return enrichForPagination('tokens', _this8.pageOfListTokens, request);
484
- };
485
- })();
486
-
487
- /**
488
- * Delete a token.
489
- *
490
- * @param request - The request {@link DeleteTokenRequest}
491
- * @returns A Promise of Token
492
- */
493
- deleteToken = request => this.client.fetch({
494
- method: 'DELETE',
495
- path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/tokens/${validatePathParam('tokenId', request.tokenId)}`
496
- }, unmarshalToken);
497
- createTrigger = request => this.client.fetch({
498
- body: JSON.stringify(marshalCreateTriggerRequest(request, this.client.settings)),
499
- headers: jsonContentHeaders,
500
- method: 'POST',
501
- path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/triggers`
502
- }, unmarshalTrigger);
503
- getTrigger = request => this.client.fetch({
504
- method: 'GET',
505
- path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/triggers/${validatePathParam('triggerId', request.triggerId)}`
506
- }, unmarshalTrigger);
507
-
508
- /**
509
- * Waits for {@link Trigger} to be in a final state.
510
- *
511
- * @param request - The request {@link GetTriggerRequest}
512
- * @param options - The waiting options
513
- * @returns A Promise of Trigger
514
- */
515
- waitForTrigger = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!TRIGGER_TRANSIENT_STATUSES.includes(res.status))), this.getTrigger, request, options);
516
- pageOfListTriggers = (() => {
517
- var _this9 = this;
518
- return function (request) {
519
- if (request === void 0) {
520
- request = {};
521
- }
522
- return _this9.client.fetch({
523
- method: 'GET',
524
- path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? _this9.client.settings.defaultRegion)}/triggers`,
525
- urlParams: urlParams(['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? _this9.client.settings.defaultPageSize], ...Object.entries(resolveOneOf([{
526
- param: 'function_id',
527
- value: request.functionId
528
- }, {
529
- param: 'namespace_id',
530
- value: request.namespaceId
531
- }, {
532
- default: _this9.client.settings.defaultProjectId,
533
- param: 'project_id',
534
- value: request.projectId
535
- }])))
536
- }, unmarshalListTriggersResponse);
537
- };
538
- })();
539
- listTriggers = (() => {
540
- var _this10 = this;
541
- return function (request) {
542
- if (request === void 0) {
543
- request = {};
544
- }
545
- return enrichForPagination('triggers', _this10.pageOfListTriggers, request);
546
- };
547
- })();
548
- updateTrigger = request => this.client.fetch({
549
- body: JSON.stringify(marshalUpdateTriggerRequest(request, this.client.settings)),
550
- headers: jsonContentHeaders,
551
- method: 'PATCH',
552
- path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/triggers/${validatePathParam('triggerId', request.triggerId)}`
553
- }, unmarshalTrigger);
554
- deleteTrigger = request => this.client.fetch({
555
- method: 'DELETE',
556
- path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/triggers/${validatePathParam('triggerId', request.triggerId)}`
557
- }, unmarshalTrigger);
558
- }
559
-
560
- export { API };
@@ -1,22 +0,0 @@
1
- // This file was automatically generated. DO NOT EDIT.
2
- // If you have any remark or suggestion do not hesitate to open an issue.
3
-
4
- /** Lists transient statutes of the enum {@link CronStatus}. */
5
- const CRON_TRANSIENT_STATUSES = ['deleting', 'creating', 'pending'];
6
-
7
- /** Lists transient statutes of the enum {@link DomainStatus}. */
8
- const DOMAIN_TRANSIENT_STATUSES = ['deleting', 'creating', 'pending'];
9
-
10
- /** Lists transient statutes of the enum {@link FunctionStatus}. */
11
- const FUNCTION_TRANSIENT_STATUSES = ['deleting', 'creating', 'pending'];
12
-
13
- /** Lists transient statutes of the enum {@link NamespaceStatus}. */
14
- const NAMESPACE_TRANSIENT_STATUSES = ['deleting', 'creating', 'pending'];
15
-
16
- /** Lists transient statutes of the enum {@link TokenStatus}. */
17
- const TOKEN_TRANSIENT_STATUSES = ['deleting', 'creating'];
18
-
19
- /** Lists transient statutes of the enum {@link TriggerStatus}. */
20
- const TRIGGER_TRANSIENT_STATUSES = ['deleting', 'creating', 'pending'];
21
-
22
- export { CRON_TRANSIENT_STATUSES, DOMAIN_TRANSIENT_STATUSES, FUNCTION_TRANSIENT_STATUSES, NAMESPACE_TRANSIENT_STATUSES, TOKEN_TRANSIENT_STATUSES, TRIGGER_TRANSIENT_STATUSES };
@@ -1,5 +0,0 @@
1
- export { API } from './api.gen.js';
2
- export { CRON_TRANSIENT_STATUSES, DOMAIN_TRANSIENT_STATUSES, FUNCTION_TRANSIENT_STATUSES, NAMESPACE_TRANSIENT_STATUSES, TOKEN_TRANSIENT_STATUSES, TRIGGER_TRANSIENT_STATUSES } from './content.gen.js';
3
-
4
- // This file was automatically generated. DO NOT EDIT.
5
- // If you have any remark or suggestion do not hesitate to open an issue.