@scaleway/sdk 2.0.0-alpha.11 → 2.0.0-alpha.13

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 (204) hide show
  1. package/package.json +2 -2
  2. package/dist/api/account/index.js +0 -4
  3. package/dist/api/account/v2/api.gen.js +0 -147
  4. package/dist/api/account/v2/index.gen.js +0 -4
  5. package/dist/api/account/v2/marshalling.gen.js +0 -39
  6. package/dist/api/account/v3/api.gen.js +0 -129
  7. package/dist/api/account/v3/index.gen.js +0 -6
  8. package/dist/api/account/v3/marshalling.gen.js +0 -39
  9. package/dist/api/account/v3/validation-rules.gen.js +0 -39
  10. package/dist/api/applesilicon/index.js +0 -2
  11. package/dist/api/applesilicon/v1alpha1/api.gen.js +0 -220
  12. package/dist/api/applesilicon/v1alpha1/content.gen.js +0 -7
  13. package/dist/api/applesilicon/v1alpha1/index.gen.js +0 -5
  14. package/dist/api/applesilicon/v1alpha1/marshalling.gen.js +0 -113
  15. package/dist/api/baremetal/index.js +0 -2
  16. package/dist/api/baremetal/v1/api.gen.js +0 -523
  17. package/dist/api/baremetal/v1/api.utils.js +0 -27
  18. package/dist/api/baremetal/v1/content.gen.js +0 -13
  19. package/dist/api/baremetal/v1/index.js +0 -5
  20. package/dist/api/baremetal/v1/marshalling.gen.js +0 -395
  21. package/dist/api/baremetal/v1/validation-rules.gen.js +0 -109
  22. package/dist/api/billing/index.js +0 -2
  23. package/dist/api/billing/v2alpha1/api.gen.js +0 -80
  24. package/dist/api/billing/v2alpha1/index.gen.js +0 -4
  25. package/dist/api/billing/v2alpha1/marshalling.gen.js +0 -53
  26. package/dist/api/block/index.js +0 -2
  27. package/dist/api/block/v1alpha1/api.gen.js +0 -245
  28. package/dist/api/block/v1alpha1/content.gen.js +0 -13
  29. package/dist/api/block/v1alpha1/index.gen.js +0 -7
  30. package/dist/api/block/v1alpha1/marshalling.gen.js +0 -175
  31. package/dist/api/block/v1alpha1/validation-rules.gen.js +0 -42
  32. package/dist/api/cockpit/index.js +0 -2
  33. package/dist/api/cockpit/v1beta1/api.gen.js +0 -448
  34. package/dist/api/cockpit/v1beta1/content.gen.js +0 -7
  35. package/dist/api/cockpit/v1beta1/index.gen.js +0 -5
  36. package/dist/api/cockpit/v1beta1/marshalling.gen.js +0 -220
  37. package/dist/api/container/index.js +0 -2
  38. package/dist/api/container/v1beta1/api.gen.js +0 -549
  39. package/dist/api/container/v1beta1/content.gen.js +0 -22
  40. package/dist/api/container/v1beta1/index.gen.js +0 -5
  41. package/dist/api/container/v1beta1/marshalling.gen.js +0 -330
  42. package/dist/api/document_db/index.js +0 -2
  43. package/dist/api/document_db/v1beta1/api.gen.js +0 -830
  44. package/dist/api/document_db/v1beta1/content.gen.js +0 -19
  45. package/dist/api/document_db/v1beta1/index.gen.js +0 -7
  46. package/dist/api/document_db/v1beta1/marshalling.gen.js +0 -580
  47. package/dist/api/document_db/v1beta1/validation-rules.gen.js +0 -10
  48. package/dist/api/domain/index.js +0 -2
  49. package/dist/api/domain/v2beta1/api.gen.js +0 -875
  50. package/dist/api/domain/v2beta1/content.gen.js +0 -28
  51. package/dist/api/domain/v2beta1/index.gen.js +0 -7
  52. package/dist/api/domain/v2beta1/marshalling.gen.js +0 -958
  53. package/dist/api/flexibleip/index.js +0 -2
  54. package/dist/api/flexibleip/v1alpha1/api.gen.js +0 -203
  55. package/dist/api/flexibleip/v1alpha1/content.gen.js +0 -10
  56. package/dist/api/flexibleip/v1alpha1/index.gen.js +0 -7
  57. package/dist/api/flexibleip/v1alpha1/marshalling.gen.js +0 -97
  58. package/dist/api/flexibleip/v1alpha1/validation-rules.gen.js +0 -14
  59. package/dist/api/function/index.js +0 -2
  60. package/dist/api/function/v1beta1/api.gen.js +0 -560
  61. package/dist/api/function/v1beta1/content.gen.js +0 -22
  62. package/dist/api/function/v1beta1/index.gen.js +0 -5
  63. package/dist/api/function/v1beta1/marshalling.gen.js +0 -368
  64. package/dist/api/iam/index.js +0 -2
  65. package/dist/api/iam/v1alpha1/api.gen.js +0 -799
  66. package/dist/api/iam/v1alpha1/index.gen.js +0 -6
  67. package/dist/api/iam/v1alpha1/marshalling.gen.js +0 -373
  68. package/dist/api/iam/v1alpha1/validation-rules.gen.js +0 -207
  69. package/dist/api/instance/index.js +0 -2
  70. package/dist/api/instance/v1/api.gen.js +0 -1003
  71. package/dist/api/instance/v1/api.utils.js +0 -369
  72. package/dist/api/instance/v1/content.gen.js +0 -31
  73. package/dist/api/instance/v1/index.js +0 -2
  74. package/dist/api/instance/v1/marshalling.gen.js +0 -1206
  75. package/dist/api/instance/v1/marshalling.utils.js +0 -63
  76. package/dist/api/iot/index.js +0 -2
  77. package/dist/api/iot/v1/api.gen.js +0 -581
  78. package/dist/api/iot/v1/content.gen.js +0 -7
  79. package/dist/api/iot/v1/index.gen.js +0 -5
  80. package/dist/api/iot/v1/marshalling.gen.js +0 -388
  81. package/dist/api/ipfs/index.js +0 -2
  82. package/dist/api/ipfs/v1alpha1/api.gen.js +0 -197
  83. package/dist/api/ipfs/v1alpha1/content.gen.js +0 -7
  84. package/dist/api/ipfs/v1alpha1/index.gen.js +0 -5
  85. package/dist/api/ipfs/v1alpha1/marshalling.gen.js +0 -121
  86. package/dist/api/k8s/index.js +0 -2
  87. package/dist/api/k8s/v1/api.gen.js +0 -454
  88. package/dist/api/k8s/v1/api.utils.js +0 -13
  89. package/dist/api/k8s/v1/content.gen.js +0 -13
  90. package/dist/api/k8s/v1/index.js +0 -4
  91. package/dist/api/k8s/v1/marshalling.gen.js +0 -333
  92. package/dist/api/k8s/v1/validation-rules.gen.js +0 -101
  93. package/dist/api/lb/index.js +0 -2
  94. package/dist/api/lb/v1/api.gen.js +0 -1669
  95. package/dist/api/lb/v1/api.utils.js +0 -81
  96. package/dist/api/lb/v1/content.gen.js +0 -16
  97. package/dist/api/lb/v1/index.js +0 -2
  98. package/dist/api/lb/v1/marshalling.gen.js +0 -923
  99. package/dist/api/marketplace/index.js +0 -4
  100. package/dist/api/marketplace/v1/api.gen.js +0 -60
  101. package/dist/api/marketplace/v1/index.gen.js +0 -4
  102. package/dist/api/marketplace/v1/marshalling.gen.js +0 -92
  103. package/dist/api/marketplace/v2/api.gen.js +0 -162
  104. package/dist/api/marketplace/v2/index.gen.js +0 -4
  105. package/dist/api/marketplace/v2/marshalling.gen.js +0 -94
  106. package/dist/api/mnq/index.js +0 -2
  107. package/dist/api/mnq/v1alpha1/api.gen.js +0 -205
  108. package/dist/api/mnq/v1alpha1/index.gen.js +0 -4
  109. package/dist/api/mnq/v1alpha1/marshalling.gen.js +0 -121
  110. package/dist/api/rdb/index.js +0 -2
  111. package/dist/api/rdb/v1/api.gen.js +0 -972
  112. package/dist/api/rdb/v1/content.gen.js +0 -22
  113. package/dist/api/rdb/v1/index.gen.js +0 -7
  114. package/dist/api/rdb/v1/marshalling.gen.js +0 -636
  115. package/dist/api/rdb/v1/validation-rules.gen.js +0 -10
  116. package/dist/api/redis/index.js +0 -2
  117. package/dist/api/redis/v1/api.gen.js +0 -389
  118. package/dist/api/redis/v1/content.gen.js +0 -7
  119. package/dist/api/redis/v1/index.gen.js +0 -5
  120. package/dist/api/redis/v1/marshalling.gen.js +0 -259
  121. package/dist/api/registry/index.js +0 -2
  122. package/dist/api/registry/v1/api.gen.js +0 -252
  123. package/dist/api/registry/v1/content.gen.js +0 -13
  124. package/dist/api/registry/v1/index.gen.js +0 -5
  125. package/dist/api/registry/v1/marshalling.gen.js +0 -106
  126. package/dist/api/secret/index.js +0 -2
  127. package/dist/api/secret/v1alpha1/api.gen.js +0 -415
  128. package/dist/api/secret/v1alpha1/index.gen.js +0 -4
  129. package/dist/api/secret/v1alpha1/marshalling.gen.js +0 -143
  130. package/dist/api/tem/index.js +0 -2
  131. package/dist/api/tem/v1alpha1/api.gen.js +0 -229
  132. package/dist/api/tem/v1alpha1/content.gen.js +0 -10
  133. package/dist/api/tem/v1alpha1/index.gen.js +0 -5
  134. package/dist/api/tem/v1alpha1/marshalling.gen.js +0 -159
  135. package/dist/api/test/index.js +0 -2
  136. package/dist/api/test/v1/api.gen.js +0 -152
  137. package/dist/api/test/v1/content.gen.js +0 -7
  138. package/dist/api/test/v1/index.gen.js +0 -5
  139. package/dist/api/test/v1/marshalling.gen.js +0 -79
  140. package/dist/api/vpc/index.js +0 -4
  141. package/dist/api/vpc/v1/api.gen.js +0 -110
  142. package/dist/api/vpc/v1/index.gen.js +0 -4
  143. package/dist/api/vpc/v1/marshalling.gen.js +0 -44
  144. package/dist/api/vpc/v2/api.gen.js +0 -276
  145. package/dist/api/vpc/v2/index.gen.js +0 -4
  146. package/dist/api/vpc/v2/marshalling.gen.js +0 -135
  147. package/dist/api/vpcgw/index.js +0 -2
  148. package/dist/api/vpcgw/v1/api.gen.js +0 -669
  149. package/dist/api/vpcgw/v1/content.gen.js +0 -10
  150. package/dist/api/vpcgw/v1/index.gen.js +0 -5
  151. package/dist/api/vpcgw/v1/marshalling.gen.js +0 -336
  152. package/dist/api/webhosting/index.js +0 -2
  153. package/dist/api/webhosting/v1alpha1/api.gen.js +0 -210
  154. package/dist/api/webhosting/v1alpha1/content.gen.js +0 -7
  155. package/dist/api/webhosting/v1alpha1/index.gen.js +0 -7
  156. package/dist/api/webhosting/v1alpha1/marshalling.gen.js +0 -173
  157. package/dist/api/webhosting/v1alpha1/validation-rules.gen.js +0 -23
  158. package/dist/helpers/is-browser.js +0 -5
  159. package/dist/helpers/is-response.js +0 -10
  160. package/dist/helpers/json.js +0 -11
  161. package/dist/helpers/marshalling.js +0 -130
  162. package/dist/index.cjs +0 -24364
  163. package/dist/index.d.ts +0 -27584
  164. package/dist/index.js +0 -69
  165. package/dist/internal/async/interval-retrier.js +0 -105
  166. package/dist/internal/async/sleep.js +0 -13
  167. package/dist/internal/interceptors/composer.js +0 -46
  168. package/dist/internal/interceptors/helpers.js +0 -32
  169. package/dist/internal/logger/console-logger.js +0 -38
  170. package/dist/internal/logger/index.js +0 -41
  171. package/dist/internal/logger/level-resolver.js +0 -13
  172. package/dist/internal/validations/string-validation.js +0 -38
  173. package/dist/node_modules/.pnpm/@scaleway_random-name@4.0.2/node_modules/@scaleway/random-name/dist/index.js +0 -13
  174. package/dist/scw/api.js +0 -12
  175. package/dist/scw/auth.js +0 -68
  176. package/dist/scw/client-ini-factory.js +0 -174
  177. package/dist/scw/client-ini-profile.js +0 -54
  178. package/dist/scw/client-settings.js +0 -78
  179. package/dist/scw/client.js +0 -98
  180. package/dist/scw/constants.js +0 -4
  181. package/dist/scw/custom-marshalling.js +0 -131
  182. package/dist/scw/errors/error-parser.js +0 -107
  183. package/dist/scw/errors/non-standard/invalid-request-mapper.js +0 -36
  184. package/dist/scw/errors/non-standard/unknown-resource-mapper.js +0 -27
  185. package/dist/scw/errors/scw-error.js +0 -66
  186. package/dist/scw/errors/standard/already-exists-error.js +0 -26
  187. package/dist/scw/errors/standard/denied-authentication-error.js +0 -52
  188. package/dist/scw/errors/standard/index.js +0 -13
  189. package/dist/scw/errors/standard/invalid-arguments-error.js +0 -67
  190. package/dist/scw/errors/standard/out-of-stock-error.js +0 -22
  191. package/dist/scw/errors/standard/permissions-denied-error.js +0 -48
  192. package/dist/scw/errors/standard/precondition-failed-error.js +0 -42
  193. package/dist/scw/errors/standard/quotas-exceeded-error.js +0 -68
  194. package/dist/scw/errors/standard/resource-expired-error.js +0 -26
  195. package/dist/scw/errors/standard/resource-locked-error.js +0 -25
  196. package/dist/scw/errors/standard/resource-not-found-error.js +0 -25
  197. package/dist/scw/errors/standard/too-many-requests-error.js +0 -70
  198. package/dist/scw/errors/standard/transient-state-error.js +0 -26
  199. package/dist/scw/errors/types.js +0 -23
  200. package/dist/scw/fetch/build-fetcher.js +0 -72
  201. package/dist/scw/fetch/http-dumper.js +0 -54
  202. package/dist/scw/fetch/http-interceptors.js +0 -99
  203. package/dist/scw/fetch/resource-paginator.js +0 -84
  204. package/dist/scw/fetch/response-parser.js +0 -72
@@ -1,415 +0,0 @@
1
- import { API as API$1 } from '../../../scw/api.js';
2
- import { validatePathParam, urlParams } from '../../../helpers/marshalling.js';
3
- import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
4
- import { marshalCreateSecretRequest, unmarshalSecret, marshalCreateFolderRequest, unmarshalFolder, marshalUpdateSecretRequest, unmarshalListSecretsResponse, unmarshalListFoldersResponse, marshalAddSecretOwnerRequest, marshalCreateSecretVersionRequest, unmarshalSecretVersion, marshalGeneratePasswordRequest, marshalUpdateSecretVersionRequest, unmarshalListSecretVersionsResponse, unmarshalAccessSecretVersionResponse, unmarshalListTagsResponse } from './marshalling.gen.js';
5
-
6
- // This file was automatically generated. DO NOT EDIT.
7
- // If you have any remark or suggestion do not hesitate to open an issue.
8
- const jsonContentHeaders = {
9
- 'Content-Type': 'application/json; charset=utf-8'
10
- };
11
-
12
- /**
13
- * Secret Manager API.
14
- *
15
- * Secret Manager API. This API allows you to conveniently store, access and
16
- * share sensitive data.
17
- */
18
- class API extends API$1 {
19
- /** Lists the available regions of the API. */
20
- static LOCALITIES = ['fr-par'];
21
-
22
- /**
23
- * Create a secret. You must specify the `region` to create a secret.
24
- *
25
- * @param request - The request {@link CreateSecretRequest}
26
- * @returns A Promise of Secret
27
- */
28
- createSecret = request => this.client.fetch({
29
- body: JSON.stringify(marshalCreateSecretRequest(request, this.client.settings)),
30
- headers: jsonContentHeaders,
31
- method: 'POST',
32
- path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets`
33
- }, unmarshalSecret);
34
-
35
- /**
36
- * Create folder.
37
- *
38
- * @param request - The request {@link CreateFolderRequest}
39
- * @returns A Promise of Folder
40
- */
41
- createFolder = request => this.client.fetch({
42
- body: JSON.stringify(marshalCreateFolderRequest(request, this.client.settings)),
43
- headers: jsonContentHeaders,
44
- method: 'POST',
45
- path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/folders`
46
- }, unmarshalFolder);
47
-
48
- /**
49
- * Get metadata using the secret's ID. Retrieve the metadata of a secret
50
- * specified by the `region` and `secret_id` parameters.
51
- *
52
- * @param request - The request {@link GetSecretRequest}
53
- * @returns A Promise of Secret
54
- */
55
- getSecret = request => this.client.fetch({
56
- method: 'GET',
57
- path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}`
58
- }, unmarshalSecret);
59
-
60
- /**
61
- * Get metadata using the secret's name. Retrieve the metadata of a secret
62
- * specified by the `region` and `secret_name` parameters.
63
- *
64
- * GetSecretByName usage is now deprecated.
65
- *
66
- * Scaleway recommends that you use the `ListSecrets` request with the `name`
67
- * filter.
68
- *
69
- * @deprecated
70
- * @param request - The request {@link GetSecretByNameRequest}
71
- * @returns A Promise of Secret
72
- */
73
- getSecretByName = request => this.client.fetch({
74
- method: 'GET',
75
- path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets-by-name/${validatePathParam('secretName', request.secretName)}`,
76
- urlParams: urlParams(['project_id', request.projectId])
77
- }, unmarshalSecret);
78
-
79
- /**
80
- * Update metadata of a secret. Edit a secret's metadata such as name, tag(s)
81
- * and description. The secret to update is specified by the `secret_id` and
82
- * `region` parameters.
83
- *
84
- * @param request - The request {@link UpdateSecretRequest}
85
- * @returns A Promise of Secret
86
- */
87
- updateSecret = request => this.client.fetch({
88
- body: JSON.stringify(marshalUpdateSecretRequest(request, this.client.settings)),
89
- headers: jsonContentHeaders,
90
- method: 'PATCH',
91
- path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}`
92
- }, unmarshalSecret);
93
- pageOfListSecrets = (() => {
94
- var _this = this;
95
- return function (request) {
96
- if (request === void 0) {
97
- request = {};
98
- }
99
- return _this.client.fetch({
100
- method: 'GET',
101
- path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? _this.client.settings.defaultRegion)}/secrets`,
102
- urlParams: urlParams(['is_managed', request.isManaged], ['name', request.name], ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['path', request.path], ['project_id', request.projectId], ['tags', request.tags])
103
- }, unmarshalListSecretsResponse);
104
- };
105
- })();
106
-
107
- /**
108
- * List secrets. Retrieve the list of secrets created within an Organization
109
- * and/or Project. You must specify either the `organization_id` or the
110
- * `project_id` and the `region`.
111
- *
112
- * @param request - The request {@link ListSecretsRequest}
113
- * @returns A Promise of ListSecretsResponse
114
- */
115
- listSecrets = (() => {
116
- var _this2 = this;
117
- return function (request) {
118
- if (request === void 0) {
119
- request = {};
120
- }
121
- return enrichForPagination('secrets', _this2.pageOfListSecrets, request);
122
- };
123
- })();
124
- pageOfListFolders = (() => {
125
- var _this3 = this;
126
- return function (request) {
127
- if (request === void 0) {
128
- request = {};
129
- }
130
- return _this3.client.fetch({
131
- method: 'GET',
132
- path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? _this3.client.settings.defaultRegion)}/folders`,
133
- urlParams: urlParams(['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? _this3.client.settings.defaultPageSize], ['path', request.path], ['project_id', request.projectId])
134
- }, unmarshalListFoldersResponse);
135
- };
136
- })();
137
-
138
- /**
139
- * List folders. Retrieve the list of folders created within a Project.
140
- *
141
- * @param request - The request {@link ListFoldersRequest}
142
- * @returns A Promise of ListFoldersResponse
143
- */
144
- listFolders = (() => {
145
- var _this4 = this;
146
- return function (request) {
147
- if (request === void 0) {
148
- request = {};
149
- }
150
- return enrichForPagination('folders', _this4.pageOfListFolders, request);
151
- };
152
- })();
153
-
154
- /**
155
- * Delete a secret. Delete a given secret specified by the `region` and
156
- * `secret_id` parameters.
157
- *
158
- * @param request - The request {@link DeleteSecretRequest}
159
- */
160
- deleteSecret = request => this.client.fetch({
161
- method: 'DELETE',
162
- path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}`
163
- });
164
-
165
- /**
166
- * Delete a given folder specified by the `region` and `folder_id` parameters.
167
- *
168
- * @param request - The request {@link DeleteFolderRequest}
169
- */
170
- deleteFolder = request => this.client.fetch({
171
- method: 'DELETE',
172
- path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/folders/${validatePathParam('folderId', request.folderId)}`
173
- });
174
-
175
- /**
176
- * Protect a secret. Protect a given secret specified by the `secret_id`
177
- * parameter. A protected secret can be read and modified but cannot be
178
- * deleted.
179
- *
180
- * @param request - The request {@link ProtectSecretRequest}
181
- * @returns A Promise of Secret
182
- */
183
- protectSecret = request => this.client.fetch({
184
- body: '{}',
185
- headers: jsonContentHeaders,
186
- method: 'POST',
187
- path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/protect`
188
- }, unmarshalSecret);
189
-
190
- /**
191
- * Unprotect a secret. Unprotect a given secret specified by the `secret_id`
192
- * parameter. An unprotected secret can be read, modified and deleted.
193
- *
194
- * @param request - The request {@link UnprotectSecretRequest}
195
- * @returns A Promise of Secret
196
- */
197
- unprotectSecret = request => this.client.fetch({
198
- body: '{}',
199
- headers: jsonContentHeaders,
200
- method: 'POST',
201
- path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/unprotect`
202
- }, unmarshalSecret);
203
-
204
- /**
205
- * Allow a product to use the secret.
206
- *
207
- * @param request - The request {@link AddSecretOwnerRequest}
208
- */
209
- addSecretOwner = request => this.client.fetch({
210
- body: JSON.stringify(marshalAddSecretOwnerRequest(request, this.client.settings)),
211
- headers: jsonContentHeaders,
212
- method: 'POST',
213
- path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/add-owner`
214
- });
215
-
216
- /**
217
- * Create a version. Create a version of a given secret specified by the
218
- * `region` and `secret_id` parameters.
219
- *
220
- * @param request - The request {@link CreateSecretVersionRequest}
221
- * @returns A Promise of SecretVersion
222
- */
223
- createSecretVersion = request => this.client.fetch({
224
- body: JSON.stringify(marshalCreateSecretVersionRequest(request, this.client.settings)),
225
- headers: jsonContentHeaders,
226
- method: 'POST',
227
- path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions`
228
- }, unmarshalSecretVersion);
229
-
230
- /**
231
- * Generate a password in a new version. Generate a password for the given
232
- * secret specified by the `region` and `secret_id` parameters. This will also
233
- * create a new version of the secret that will store the password.
234
- *
235
- * @param request - The request {@link GeneratePasswordRequest}
236
- * @returns A Promise of SecretVersion
237
- */
238
- generatePassword = request => this.client.fetch({
239
- body: JSON.stringify(marshalGeneratePasswordRequest(request, this.client.settings)),
240
- headers: jsonContentHeaders,
241
- method: 'POST',
242
- path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/generate-password`
243
- }, unmarshalSecretVersion);
244
-
245
- /**
246
- * Get metadata of a secret's version using the secret's ID. Retrieve the
247
- * metadata of a secret's given version specified by the `region`, `secret_id`
248
- * and `revision` parameters.
249
- *
250
- * @param request - The request {@link GetSecretVersionRequest}
251
- * @returns A Promise of SecretVersion
252
- */
253
- getSecretVersion = request => this.client.fetch({
254
- method: 'GET',
255
- path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions/${validatePathParam('revision', request.revision)}`
256
- }, unmarshalSecretVersion);
257
-
258
- /**
259
- * Get metadata of a secret's version using the secret's name. Retrieve the
260
- * metadata of a secret's given version specified by the `region`,
261
- * `secret_name`, `revision` and `project_id` parameters.
262
- *
263
- * @param request - The request {@link GetSecretVersionByNameRequest}
264
- * @returns A Promise of SecretVersion
265
- */
266
- getSecretVersionByName = request => this.client.fetch({
267
- method: 'GET',
268
- path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets-by-name/${validatePathParam('secretName', request.secretName)}/versions/${validatePathParam('revision', request.revision)}`,
269
- urlParams: urlParams(['project_id', request.projectId])
270
- }, unmarshalSecretVersion);
271
-
272
- /**
273
- * Update metadata of a version. Edit the metadata of a secret's given
274
- * version, specified by the `region`, `secret_id` and `revision` parameters.
275
- *
276
- * @param request - The request {@link UpdateSecretVersionRequest}
277
- * @returns A Promise of SecretVersion
278
- */
279
- updateSecretVersion = request => this.client.fetch({
280
- body: JSON.stringify(marshalUpdateSecretVersionRequest(request, this.client.settings)),
281
- headers: jsonContentHeaders,
282
- method: 'PATCH',
283
- path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions/${validatePathParam('revision', request.revision)}`
284
- }, unmarshalSecretVersion);
285
- pageOfListSecretVersions = request => this.client.fetch({
286
- method: 'GET',
287
- path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions`,
288
- urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['status', request.status])
289
- }, unmarshalListSecretVersionsResponse);
290
-
291
- /**
292
- * List versions of a secret using the secret's ID. Retrieve the list of a
293
- * given secret's versions specified by the `secret_id` and `region`
294
- * parameters.
295
- *
296
- * @param request - The request {@link ListSecretVersionsRequest}
297
- * @returns A Promise of ListSecretVersionsResponse
298
- */
299
- listSecretVersions = request => enrichForPagination('versions', this.pageOfListSecretVersions, request);
300
- pageOfListSecretVersionsByName = request => this.client.fetch({
301
- method: 'GET',
302
- path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets-by-name/${validatePathParam('secretName', request.secretName)}/versions`,
303
- urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId], ['status', request.status])
304
- }, unmarshalListSecretVersionsResponse);
305
-
306
- /**
307
- * List versions of a secret using the secret's name. Retrieve the list of a
308
- * given secret's versions specified by the `secret_name`,`region` and
309
- * `project_id` parameters.
310
- *
311
- * @param request - The request {@link ListSecretVersionsByNameRequest}
312
- * @returns A Promise of ListSecretVersionsResponse
313
- */
314
- listSecretVersionsByName = request => enrichForPagination('versions', this.pageOfListSecretVersionsByName, request);
315
-
316
- /**
317
- * Enable a version. Make a specific version accessible. You must specify the
318
- * `region`, `secret_id` and `revision` parameters.
319
- *
320
- * @param request - The request {@link EnableSecretVersionRequest}
321
- * @returns A Promise of SecretVersion
322
- */
323
- enableSecretVersion = request => this.client.fetch({
324
- body: '{}',
325
- headers: jsonContentHeaders,
326
- method: 'POST',
327
- path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions/${validatePathParam('revision', request.revision)}/enable`
328
- }, unmarshalSecretVersion);
329
-
330
- /**
331
- * Disable a version. Make a specific version inaccessible. You must specify
332
- * the `region`, `secret_id` and `revision` parameters.
333
- *
334
- * @param request - The request {@link DisableSecretVersionRequest}
335
- * @returns A Promise of SecretVersion
336
- */
337
- disableSecretVersion = request => this.client.fetch({
338
- body: '{}',
339
- headers: jsonContentHeaders,
340
- method: 'POST',
341
- path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions/${validatePathParam('revision', request.revision)}/disable`
342
- }, unmarshalSecretVersion);
343
-
344
- /**
345
- * Access a secret's version using the secret's ID. Access sensitive data in a
346
- * secret's version specified by the `region`, `secret_id` and `revision`
347
- * parameters.
348
- *
349
- * @param request - The request {@link AccessSecretVersionRequest}
350
- * @returns A Promise of AccessSecretVersionResponse
351
- */
352
- accessSecretVersion = request => this.client.fetch({
353
- method: 'GET',
354
- path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions/${validatePathParam('revision', request.revision)}/access`
355
- }, unmarshalAccessSecretVersionResponse);
356
-
357
- /**
358
- * Access a secret's version using the secret's name. Access sensitive data in
359
- * a secret's version specified by the `region`, `secret_name`, `revision` and
360
- * `project_id` parameters.
361
- *
362
- * @param request - The request {@link AccessSecretVersionByNameRequest}
363
- * @returns A Promise of AccessSecretVersionResponse
364
- */
365
- accessSecretVersionByName = request => this.client.fetch({
366
- method: 'GET',
367
- path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets-by-name/${validatePathParam('secretName', request.secretName)}/versions/${validatePathParam('revision', request.revision)}/access`,
368
- urlParams: urlParams(['project_id', request.projectId])
369
- }, unmarshalAccessSecretVersionResponse);
370
-
371
- /**
372
- * Delete a version. Delete a secret's version and the sensitive data
373
- * contained in it. Deleting a version is permanent and cannot be undone.
374
- *
375
- * @param request - The request {@link DestroySecretVersionRequest}
376
- * @returns A Promise of SecretVersion
377
- */
378
- destroySecretVersion = request => this.client.fetch({
379
- body: '{}',
380
- headers: jsonContentHeaders,
381
- method: 'POST',
382
- path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions/${validatePathParam('revision', request.revision)}/destroy`
383
- }, unmarshalSecretVersion);
384
- pageOfListTags = (() => {
385
- var _this5 = this;
386
- return function (request) {
387
- if (request === void 0) {
388
- request = {};
389
- }
390
- return _this5.client.fetch({
391
- method: 'GET',
392
- path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? _this5.client.settings.defaultRegion)}/tags`,
393
- urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? _this5.client.settings.defaultPageSize], ['project_id', request.projectId])
394
- }, unmarshalListTagsResponse);
395
- };
396
- })();
397
-
398
- /**
399
- * List tags. List all tags associated with secrets within a given Project.
400
- *
401
- * @param request - The request {@link ListTagsRequest}
402
- * @returns A Promise of ListTagsResponse
403
- */
404
- listTags = (() => {
405
- var _this6 = this;
406
- return function (request) {
407
- if (request === void 0) {
408
- request = {};
409
- }
410
- return enrichForPagination('tags', _this6.pageOfListTags, request);
411
- };
412
- })();
413
- }
414
-
415
- export { API };
@@ -1,4 +0,0 @@
1
- export { API } from './api.gen.js';
2
-
3
- // This file was automatically generated. DO NOT EDIT.
4
- // If you have any remark or suggestion do not hesitate to open an issue.
@@ -1,143 +0,0 @@
1
- import { isJSONObject } from '../../../helpers/json.js';
2
- import { unmarshalDate, unmarshalArrayOfObject } from '../../../helpers/marshalling.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.
6
- const unmarshalFolder = data => {
7
- if (!isJSONObject(data)) {
8
- throw new TypeError(`Unmarshalling the type 'Folder' failed as data isn't a dictionary.`);
9
- }
10
- return {
11
- createdAt: unmarshalDate(data.created_at),
12
- id: data.id,
13
- name: data.name,
14
- path: data.path,
15
- projectId: data.project_id
16
- };
17
- };
18
- const unmarshalSecretVersion = data => {
19
- if (!isJSONObject(data)) {
20
- throw new TypeError(`Unmarshalling the type 'SecretVersion' failed as data isn't a dictionary.`);
21
- }
22
- return {
23
- createdAt: unmarshalDate(data.created_at),
24
- description: data.description ? data.description : undefined,
25
- isLatest: data.is_latest,
26
- revision: data.revision,
27
- secretId: data.secret_id,
28
- status: data.status,
29
- updatedAt: unmarshalDate(data.updated_at)
30
- };
31
- };
32
- const unmarshalSecret = data => {
33
- if (!isJSONObject(data)) {
34
- throw new TypeError(`Unmarshalling the type 'Secret' failed as data isn't a dictionary.`);
35
- }
36
- return {
37
- createdAt: unmarshalDate(data.created_at),
38
- description: data.description ? data.description : undefined,
39
- id: data.id,
40
- isManaged: data.is_managed,
41
- isProtected: data.is_protected,
42
- name: data.name,
43
- path: data.path,
44
- projectId: data.project_id,
45
- region: data.region,
46
- status: data.status,
47
- tags: data.tags,
48
- type: data.type,
49
- updatedAt: unmarshalDate(data.updated_at),
50
- versionCount: data.version_count
51
- };
52
- };
53
- const unmarshalAccessSecretVersionResponse = data => {
54
- if (!isJSONObject(data)) {
55
- throw new TypeError(`Unmarshalling the type 'AccessSecretVersionResponse' failed as data isn't a dictionary.`);
56
- }
57
- return {
58
- data: data.data,
59
- dataCrc32: data.data_crc32 ? data.data_crc32 : undefined,
60
- revision: data.revision,
61
- secretId: data.secret_id
62
- };
63
- };
64
- const unmarshalListFoldersResponse = data => {
65
- if (!isJSONObject(data)) {
66
- throw new TypeError(`Unmarshalling the type 'ListFoldersResponse' failed as data isn't a dictionary.`);
67
- }
68
- return {
69
- folders: unmarshalArrayOfObject(data.folders, unmarshalFolder),
70
- totalCount: data.total_count
71
- };
72
- };
73
- const unmarshalListSecretVersionsResponse = data => {
74
- if (!isJSONObject(data)) {
75
- throw new TypeError(`Unmarshalling the type 'ListSecretVersionsResponse' failed as data isn't a dictionary.`);
76
- }
77
- return {
78
- totalCount: data.total_count,
79
- versions: unmarshalArrayOfObject(data.versions, unmarshalSecretVersion)
80
- };
81
- };
82
- const unmarshalListSecretsResponse = data => {
83
- if (!isJSONObject(data)) {
84
- throw new TypeError(`Unmarshalling the type 'ListSecretsResponse' failed as data isn't a dictionary.`);
85
- }
86
- return {
87
- secrets: unmarshalArrayOfObject(data.secrets, unmarshalSecret),
88
- totalCount: data.total_count
89
- };
90
- };
91
- const unmarshalListTagsResponse = data => {
92
- if (!isJSONObject(data)) {
93
- throw new TypeError(`Unmarshalling the type 'ListTagsResponse' failed as data isn't a dictionary.`);
94
- }
95
- return {
96
- tags: data.tags,
97
- totalCount: data.total_count
98
- };
99
- };
100
- const marshalAddSecretOwnerRequest = (request, defaults) => ({
101
- product: request.product,
102
- product_name: request.productName
103
- });
104
- const marshalCreateFolderRequest = (request, defaults) => ({
105
- name: request.name,
106
- path: request.path,
107
- project_id: request.projectId ?? defaults.defaultProjectId
108
- });
109
- const marshalCreateSecretRequest = (request, defaults) => ({
110
- description: request.description,
111
- name: request.name,
112
- path: request.path,
113
- project_id: request.projectId ?? defaults.defaultProjectId,
114
- tags: request.tags,
115
- type: request.type
116
- });
117
- const marshalCreateSecretVersionRequest = (request, defaults) => ({
118
- data: request.data,
119
- data_crc32: request.dataCrc32,
120
- description: request.description,
121
- disable_previous: request.disablePrevious,
122
- password_generation: request.passwordGeneration
123
- });
124
- const marshalGeneratePasswordRequest = (request, defaults) => ({
125
- additional_chars: request.additionalChars,
126
- description: request.description,
127
- disable_previous: request.disablePrevious,
128
- length: request.length,
129
- no_digits: request.noDigits,
130
- no_lowercase_letters: request.noLowercaseLetters,
131
- no_uppercase_letters: request.noUppercaseLetters
132
- });
133
- const marshalUpdateSecretRequest = (request, defaults) => ({
134
- description: request.description,
135
- name: request.name,
136
- path: request.path,
137
- tags: request.tags
138
- });
139
- const marshalUpdateSecretVersionRequest = (request, defaults) => ({
140
- description: request.description
141
- });
142
-
143
- export { marshalAddSecretOwnerRequest, marshalCreateFolderRequest, marshalCreateSecretRequest, marshalCreateSecretVersionRequest, marshalGeneratePasswordRequest, marshalUpdateSecretRequest, marshalUpdateSecretVersionRequest, unmarshalAccessSecretVersionResponse, unmarshalFolder, unmarshalListFoldersResponse, unmarshalListSecretVersionsResponse, unmarshalListSecretsResponse, unmarshalListTagsResponse, unmarshalSecret, unmarshalSecretVersion };
@@ -1,2 +0,0 @@
1
- import * as index_gen from './v1alpha1/index.gen.js';
2
- export { index_gen as v1alpha1 };