@scaleway/sdk 2.46.0 → 2.48.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (193) hide show
  1. package/dist/api/baremetal/v1/api.gen.cjs +36 -1
  2. package/dist/api/baremetal/v1/api.gen.d.ts +17 -1
  3. package/dist/api/baremetal/v1/api.gen.js +37 -2
  4. package/dist/api/baremetal/v1/index.gen.d.ts +1 -1
  5. package/dist/api/baremetal/v1/marshalling.gen.cjs +200 -0
  6. package/dist/api/baremetal/v1/marshalling.gen.d.ts +4 -1
  7. package/dist/api/baremetal/v1/marshalling.gen.js +200 -0
  8. package/dist/api/baremetal/v1/types.gen.d.ts +74 -0
  9. package/dist/api/billing/v2alpha1/marshalling.gen.cjs +1 -0
  10. package/dist/api/billing/v2alpha1/marshalling.gen.js +1 -0
  11. package/dist/api/billing/v2alpha1/types.gen.d.ts +2 -0
  12. package/dist/api/billing/v2beta1/marshalling.gen.cjs +1 -0
  13. package/dist/api/billing/v2beta1/marshalling.gen.js +1 -0
  14. package/dist/api/billing/v2beta1/types.gen.d.ts +2 -0
  15. package/dist/api/edge_services/v1alpha1/api.gen.cjs +636 -0
  16. package/dist/api/edge_services/v1alpha1/api.gen.d.ts +5 -1
  17. package/dist/api/edge_services/v1alpha1/api.gen.js +636 -0
  18. package/dist/api/edge_services/v1alpha1/content.gen.cjs +8 -0
  19. package/dist/api/edge_services/v1alpha1/content.gen.js +8 -0
  20. package/dist/api/edge_services/v1alpha1/index.gen.cjs +7 -0
  21. package/dist/api/edge_services/v1alpha1/index.gen.d.ts +1 -1
  22. package/dist/api/edge_services/v1alpha1/index.gen.js +7 -0
  23. package/dist/api/edge_services/v1alpha1/marshalling.gen.cjs +474 -0
  24. package/dist/api/edge_services/v1alpha1/marshalling.gen.d.ts +5 -2
  25. package/dist/api/edge_services/v1alpha1/marshalling.gen.js +474 -0
  26. package/dist/api/edge_services/v1alpha1/types.gen.d.ts +51 -28
  27. package/dist/api/iam/v1alpha1/marshalling.gen.cjs +1 -0
  28. package/dist/api/iam/v1alpha1/marshalling.gen.js +1 -0
  29. package/dist/api/iam/v1alpha1/types.gen.d.ts +2 -0
  30. package/dist/api/index.d.ts +65 -35
  31. package/dist/api/inference/v1beta1/api.gen.cjs +306 -0
  32. package/dist/api/inference/v1beta1/api.gen.js +306 -0
  33. package/dist/api/inference/v1beta1/content.gen.cjs +8 -0
  34. package/dist/api/inference/v1beta1/content.gen.js +8 -0
  35. package/dist/api/inference/v1beta1/index.gen.cjs +8 -0
  36. package/dist/api/inference/v1beta1/index.gen.js +8 -0
  37. package/dist/api/inference/v1beta1/marshalling.gen.cjs +273 -0
  38. package/dist/api/inference/v1beta1/marshalling.gen.js +273 -0
  39. package/dist/api/inference/v1beta1/validation-rules.gen.cjs +56 -0
  40. package/dist/api/inference/v1beta1/validation-rules.gen.js +56 -0
  41. package/dist/api/k8s/v1/marshalling.gen.cjs +1 -0
  42. package/dist/api/k8s/v1/marshalling.gen.js +1 -0
  43. package/dist/api/k8s/v1/types.gen.d.ts +2 -0
  44. package/dist/api/k8s/v1/validation-rules.gen.cjs +63 -0
  45. package/dist/api/k8s/v1/validation-rules.gen.d.ts +60 -0
  46. package/dist/api/k8s/v1/validation-rules.gen.js +64 -1
  47. package/dist/api/mnq/index.gen.cjs +4 -0
  48. package/dist/api/mnq/index.gen.js +4 -0
  49. package/dist/api/qaas/v1alpha1/api.gen.cjs +527 -0
  50. package/dist/api/qaas/v1alpha1/api.gen.js +527 -0
  51. package/dist/api/qaas/v1alpha1/content.gen.cjs +19 -0
  52. package/dist/api/qaas/v1alpha1/content.gen.js +19 -0
  53. package/dist/api/qaas/v1alpha1/index.gen.cjs +10 -0
  54. package/dist/api/qaas/v1alpha1/index.gen.js +10 -0
  55. package/dist/api/qaas/v1alpha1/marshalling.gen.cjs +320 -0
  56. package/dist/api/qaas/v1alpha1/marshalling.gen.js +320 -0
  57. package/dist/api/qaas/v1alpha1/validation-rules.gen.cjs +14 -0
  58. package/dist/api/qaas/v1alpha1/validation-rules.gen.js +14 -0
  59. package/dist/api/tem/index.gen.cjs +4 -0
  60. package/dist/api/tem/index.gen.js +4 -0
  61. package/dist/api/tem/v1alpha1/api.gen.cjs +32 -0
  62. package/dist/api/tem/v1alpha1/api.gen.d.ts +17 -1
  63. package/dist/api/tem/v1alpha1/api.gen.js +33 -1
  64. package/dist/api/tem/v1alpha1/index.gen.d.ts +1 -1
  65. package/dist/api/tem/v1alpha1/marshalling.gen.cjs +36 -0
  66. package/dist/api/tem/v1alpha1/marshalling.gen.d.ts +3 -1
  67. package/dist/api/tem/v1alpha1/marshalling.gen.js +36 -0
  68. package/dist/api/tem/v1alpha1/types.gen.d.ts +51 -0
  69. package/dist/api/tem/v1alpha1/validation-rules.gen.cjs +11 -0
  70. package/dist/api/tem/v1alpha1/validation-rules.gen.d.ts +10 -0
  71. package/dist/api/tem/v1alpha1/validation-rules.gen.js +11 -0
  72. package/dist/api/webhosting/index.gen.cjs +6 -0
  73. package/dist/api/webhosting/index.gen.js +6 -0
  74. package/dist/api/webhosting/v1/api.gen.cjs +620 -0
  75. package/dist/api/webhosting/v1/api.gen.js +620 -0
  76. package/dist/api/webhosting/v1/content.gen.cjs +14 -0
  77. package/dist/api/webhosting/v1/content.gen.js +14 -0
  78. package/dist/api/webhosting/v1/index.gen.cjs +15 -0
  79. package/dist/api/webhosting/v1/index.gen.js +15 -0
  80. package/dist/api/webhosting/v1/marshalling.gen.cjs +391 -0
  81. package/dist/api/webhosting/v1/marshalling.gen.js +391 -0
  82. package/dist/api/webhosting/v1/types.gen.d.ts +5 -0
  83. package/dist/api/webhosting/v1/validation-rules.gen.cjs +82 -0
  84. package/dist/api/webhosting/v1/validation-rules.gen.js +82 -0
  85. package/dist/index.cjs +92 -70
  86. package/dist/index.js +92 -70
  87. package/dist/scw/constants.cjs +1 -1
  88. package/dist/scw/constants.d.ts +2 -2
  89. package/dist/scw/constants.js +1 -1
  90. package/package.json +2 -2
  91. package/dist/api/account/index.d.ts +0 -2
  92. package/dist/api/applesilicon/index.d.ts +0 -1
  93. package/dist/api/baremetal/index.d.ts +0 -1
  94. package/dist/api/billing/index.d.ts +0 -2
  95. package/dist/api/block/index.d.ts +0 -1
  96. package/dist/api/cockpit/index.d.ts +0 -2
  97. package/dist/api/container/index.d.ts +0 -1
  98. package/dist/api/dedibox/index.d.ts +0 -1
  99. package/dist/api/document_db/index.d.ts +0 -1
  100. package/dist/api/domain/index.d.ts +0 -1
  101. package/dist/api/edge_services/index.d.ts +0 -1
  102. package/dist/api/flexibleip/index.d.ts +0 -1
  103. package/dist/api/function/index.d.ts +0 -1
  104. package/dist/api/iam/index.d.ts +0 -1
  105. package/dist/api/instance/index.d.ts +0 -1
  106. package/dist/api/iot/index.d.ts +0 -1
  107. package/dist/api/ipam/index.d.ts +0 -1
  108. package/dist/api/ipfs/index.d.ts +0 -1
  109. package/dist/api/jobs/index.d.ts +0 -1
  110. package/dist/api/k8s/index.d.ts +0 -1
  111. package/dist/api/key_manager/index.d.ts +0 -1
  112. package/dist/api/lb/index.d.ts +0 -1
  113. package/dist/api/llm_inference/index.d.ts +0 -1
  114. package/dist/api/marketplace/index.d.ts +0 -1
  115. package/dist/api/mnq/index.d.ts +0 -1
  116. package/dist/api/rdb/index.d.ts +0 -1
  117. package/dist/api/redis/index.d.ts +0 -1
  118. package/dist/api/registry/index.d.ts +0 -1
  119. package/dist/api/secret/index.d.ts +0 -2
  120. package/dist/api/serverless_sqldb/index.d.ts +0 -1
  121. package/dist/api/tem/index.d.ts +0 -1
  122. package/dist/api/test/index.d.ts +0 -1
  123. package/dist/api/vpc/index.d.ts +0 -2
  124. package/dist/api/vpcgw/index.d.ts +0 -1
  125. package/dist/api/webhosting/index.d.ts +0 -1
  126. /package/dist/api/account/{index.cjs → index.gen.cjs} +0 -0
  127. /package/dist/api/account/{index.js → index.gen.js} +0 -0
  128. /package/dist/api/applesilicon/{index.cjs → index.gen.cjs} +0 -0
  129. /package/dist/api/applesilicon/{index.js → index.gen.js} +0 -0
  130. /package/dist/api/baremetal/{index.cjs → index.gen.cjs} +0 -0
  131. /package/dist/api/baremetal/{index.js → index.gen.js} +0 -0
  132. /package/dist/api/billing/{index.cjs → index.gen.cjs} +0 -0
  133. /package/dist/api/billing/{index.js → index.gen.js} +0 -0
  134. /package/dist/api/block/{index.cjs → index.gen.cjs} +0 -0
  135. /package/dist/api/block/{index.js → index.gen.js} +0 -0
  136. /package/dist/api/cockpit/{index.cjs → index.gen.cjs} +0 -0
  137. /package/dist/api/cockpit/{index.js → index.gen.js} +0 -0
  138. /package/dist/api/container/{index.cjs → index.gen.cjs} +0 -0
  139. /package/dist/api/container/{index.js → index.gen.js} +0 -0
  140. /package/dist/api/dedibox/{index.cjs → index.gen.cjs} +0 -0
  141. /package/dist/api/dedibox/{index.js → index.gen.js} +0 -0
  142. /package/dist/api/document_db/{index.cjs → index.gen.cjs} +0 -0
  143. /package/dist/api/document_db/{index.js → index.gen.js} +0 -0
  144. /package/dist/api/domain/{index.cjs → index.gen.cjs} +0 -0
  145. /package/dist/api/domain/{index.js → index.gen.js} +0 -0
  146. /package/dist/api/{flexibleip/index.cjs → edge_services/index.gen.cjs} +0 -0
  147. /package/dist/api/{flexibleip/index.js → edge_services/index.gen.js} +0 -0
  148. /package/dist/api/{iam/index.cjs → flexibleip/index.gen.cjs} +0 -0
  149. /package/dist/api/{iam/index.js → flexibleip/index.gen.js} +0 -0
  150. /package/dist/api/function/{index.cjs → index.gen.cjs} +0 -0
  151. /package/dist/api/function/{index.js → index.gen.js} +0 -0
  152. /package/dist/api/{ipfs/index.cjs → iam/index.gen.cjs} +0 -0
  153. /package/dist/api/{ipfs/index.js → iam/index.gen.js} +0 -0
  154. /package/dist/api/{llm_inference/index.cjs → inference/index.gen.cjs} +0 -0
  155. /package/dist/api/{llm_inference/index.js → inference/index.gen.js} +0 -0
  156. /package/dist/api/instance/{index.cjs → index.gen.cjs} +0 -0
  157. /package/dist/api/instance/{index.js → index.gen.js} +0 -0
  158. /package/dist/api/iot/{index.cjs → index.gen.cjs} +0 -0
  159. /package/dist/api/iot/{index.js → index.gen.js} +0 -0
  160. /package/dist/api/ipam/{index.cjs → index.gen.cjs} +0 -0
  161. /package/dist/api/ipam/{index.js → index.gen.js} +0 -0
  162. /package/dist/api/{jobs/index.cjs → ipfs/index.gen.cjs} +0 -0
  163. /package/dist/api/{jobs/index.js → ipfs/index.gen.js} +0 -0
  164. /package/dist/api/{key_manager/index.cjs → jobs/index.gen.cjs} +0 -0
  165. /package/dist/api/{key_manager/index.js → jobs/index.gen.js} +0 -0
  166. /package/dist/api/k8s/{index.cjs → index.gen.cjs} +0 -0
  167. /package/dist/api/k8s/{index.js → index.gen.js} +0 -0
  168. /package/dist/api/{serverless_sqldb/index.cjs → key_manager/index.gen.cjs} +0 -0
  169. /package/dist/api/{serverless_sqldb/index.js → key_manager/index.gen.js} +0 -0
  170. /package/dist/api/lb/{index.cjs → index.gen.cjs} +0 -0
  171. /package/dist/api/lb/{index.js → index.gen.js} +0 -0
  172. /package/dist/api/{mnq/index.cjs → llm_inference/index.gen.cjs} +0 -0
  173. /package/dist/api/{mnq/index.js → llm_inference/index.gen.js} +0 -0
  174. /package/dist/api/marketplace/{index.cjs → index.gen.cjs} +0 -0
  175. /package/dist/api/marketplace/{index.js → index.gen.js} +0 -0
  176. /package/dist/api/{tem/index.cjs → qaas/index.gen.cjs} +0 -0
  177. /package/dist/api/{tem/index.js → qaas/index.gen.js} +0 -0
  178. /package/dist/api/rdb/{index.cjs → index.gen.cjs} +0 -0
  179. /package/dist/api/rdb/{index.js → index.gen.js} +0 -0
  180. /package/dist/api/redis/{index.cjs → index.gen.cjs} +0 -0
  181. /package/dist/api/redis/{index.js → index.gen.js} +0 -0
  182. /package/dist/api/registry/{index.cjs → index.gen.cjs} +0 -0
  183. /package/dist/api/registry/{index.js → index.gen.js} +0 -0
  184. /package/dist/api/secret/{index.cjs → index.gen.cjs} +0 -0
  185. /package/dist/api/secret/{index.js → index.gen.js} +0 -0
  186. /package/dist/api/{webhosting/index.cjs → serverless_sqldb/index.gen.cjs} +0 -0
  187. /package/dist/api/{webhosting/index.js → serverless_sqldb/index.gen.js} +0 -0
  188. /package/dist/api/test/{index.cjs → index.gen.cjs} +0 -0
  189. /package/dist/api/test/{index.js → index.gen.js} +0 -0
  190. /package/dist/api/vpc/{index.cjs → index.gen.cjs} +0 -0
  191. /package/dist/api/vpc/{index.js → index.gen.js} +0 -0
  192. /package/dist/api/vpcgw/{index.cjs → index.gen.cjs} +0 -0
  193. /package/dist/api/vpcgw/{index.js → index.gen.js} +0 -0
@@ -0,0 +1,636 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const intervalRetrier = require("../../../internal/async/interval-retrier.cjs");
4
+ const api = require("../../../scw/api.cjs");
5
+ const marshalling = require("../../../helpers/marshalling.cjs");
6
+ require("../../../vendor/base64/index.cjs");
7
+ const resourcePaginator = require("../../../scw/fetch/resource-paginator.cjs");
8
+ const content_gen = require("./content.gen.cjs");
9
+ const marshalling_gen = require("./marshalling.gen.cjs");
10
+ const jsonContentHeaders = {
11
+ "Content-Type": "application/json; charset=utf-8"
12
+ };
13
+ class API extends api.API {
14
+ pageOfListPipelines = (request = {}) => this.client.fetch(
15
+ {
16
+ method: "GET",
17
+ path: `/edge-services/v1alpha1/pipelines`,
18
+ urlParams: marshalling.urlParams(
19
+ ["has_backend_stage_lb", request.hasBackendStageLb],
20
+ ["name", request.name],
21
+ ["order_by", request.orderBy],
22
+ ["organization_id", request.organizationId],
23
+ ["page", request.page],
24
+ [
25
+ "page_size",
26
+ request.pageSize ?? this.client.settings.defaultPageSize
27
+ ],
28
+ ["project_id", request.projectId]
29
+ )
30
+ },
31
+ marshalling_gen.unmarshalListPipelinesResponse
32
+ );
33
+ /**
34
+ * List pipelines. List all pipelines, for a Scaleway Organization or Scaleway
35
+ * Project. By default, the pipelines returned in the list are ordered by
36
+ * creation date in ascending order, though this can be modified via the
37
+ * `order_by` field.
38
+ *
39
+ * @param request - The request {@link ListPipelinesRequest}
40
+ * @returns A Promise of ListPipelinesResponse
41
+ */
42
+ listPipelines = (request = {}) => resourcePaginator.enrichForPagination("pipelines", this.pageOfListPipelines, request);
43
+ /**
44
+ * Create pipeline. Create a new pipeline. You must specify a `dns_stage_id`
45
+ * to form a stage-chain that goes all the way to the backend stage (origin),
46
+ * so the HTTP request will be processed according to the stages you created.
47
+ *
48
+ * @param request - The request {@link CreatePipelineRequest}
49
+ * @returns A Promise of Pipeline
50
+ */
51
+ createPipeline = (request) => this.client.fetch(
52
+ {
53
+ body: JSON.stringify(
54
+ marshalling_gen.marshalCreatePipelineRequest(request, this.client.settings)
55
+ ),
56
+ headers: jsonContentHeaders,
57
+ method: "POST",
58
+ path: `/edge-services/v1alpha1/pipelines`
59
+ },
60
+ marshalling_gen.unmarshalPipeline
61
+ );
62
+ /**
63
+ * Get pipeline. Retrieve information about an existing pipeline, specified by
64
+ * its `pipeline_id`. Its full details, including errors, are returned in the
65
+ * response object.
66
+ *
67
+ * @param request - The request {@link GetPipelineRequest}
68
+ * @returns A Promise of Pipeline
69
+ */
70
+ getPipeline = (request) => this.client.fetch(
71
+ {
72
+ method: "GET",
73
+ path: `/edge-services/v1alpha1/pipelines/${marshalling.validatePathParam("pipelineId", request.pipelineId)}`
74
+ },
75
+ marshalling_gen.unmarshalPipeline
76
+ );
77
+ /**
78
+ * Waits for {@link Pipeline} to be in a final state.
79
+ *
80
+ * @param request - The request {@link GetPipelineRequest}
81
+ * @param options - The waiting options
82
+ * @returns A Promise of Pipeline
83
+ */
84
+ waitForPipeline = (request, options) => intervalRetrier.waitForResource(
85
+ options?.stop ?? ((res) => Promise.resolve(!content_gen.PIPELINE_TRANSIENT_STATUSES.includes(res.status))),
86
+ this.getPipeline,
87
+ request,
88
+ options
89
+ );
90
+ /**
91
+ * Update pipeline. Update the parameters of an existing pipeline, specified
92
+ * by its `pipeline_id`. Parameters which can be updated include the `name`,
93
+ * `description` and `dns_stage_id`.
94
+ *
95
+ * @param request - The request {@link UpdatePipelineRequest}
96
+ * @returns A Promise of Pipeline
97
+ */
98
+ updatePipeline = (request) => this.client.fetch(
99
+ {
100
+ body: JSON.stringify(
101
+ marshalling_gen.marshalUpdatePipelineRequest(request, this.client.settings)
102
+ ),
103
+ headers: jsonContentHeaders,
104
+ method: "PATCH",
105
+ path: `/edge-services/v1alpha1/pipelines/${marshalling.validatePathParam("pipelineId", request.pipelineId)}`
106
+ },
107
+ marshalling_gen.unmarshalPipeline
108
+ );
109
+ /**
110
+ * Delete pipeline. Delete an existing pipeline, specified by its
111
+ * `pipeline_id`. Deleting a pipeline is permanent, and cannot be undone. Note
112
+ * that all stages linked to the pipeline are also deleted.
113
+ *
114
+ * @param request - The request {@link DeletePipelineRequest}
115
+ */
116
+ deletePipeline = (request) => this.client.fetch({
117
+ method: "DELETE",
118
+ path: `/edge-services/v1alpha1/pipelines/${marshalling.validatePathParam("pipelineId", request.pipelineId)}`
119
+ });
120
+ pageOfListDNSStages = (request = {}) => this.client.fetch(
121
+ {
122
+ method: "GET",
123
+ path: `/edge-services/v1alpha1/dns-stages`,
124
+ urlParams: marshalling.urlParams(
125
+ ["fqdn", request.fqdn],
126
+ ["order_by", request.orderBy],
127
+ ["page", request.page],
128
+ [
129
+ "page_size",
130
+ request.pageSize ?? this.client.settings.defaultPageSize
131
+ ],
132
+ ["pipeline_id", request.pipelineId],
133
+ ["project_id", request.projectId]
134
+ )
135
+ },
136
+ marshalling_gen.unmarshalListDNSStagesResponse
137
+ );
138
+ /**
139
+ * List DNS stages. List all DNS stages, for a Scaleway Organization or
140
+ * Scaleway Project. By default, the DNS stages returned in the list are
141
+ * ordered by creation date in ascending order, though this can be modified
142
+ * via the `order_by` field.
143
+ *
144
+ * @param request - The request {@link ListDNSStagesRequest}
145
+ * @returns A Promise of ListDNSStagesResponse
146
+ */
147
+ listDNSStages = (request = {}) => resourcePaginator.enrichForPagination("stages", this.pageOfListDNSStages, request);
148
+ /**
149
+ * Create DNS stage. Create a new DNS stage. You must specify the `fqdns`
150
+ * field to customize the domain endpoint, using a domain you already own.
151
+ *
152
+ * @param request - The request {@link CreateDNSStageRequest}
153
+ * @returns A Promise of DNSStage
154
+ */
155
+ createDNSStage = (request = {}) => this.client.fetch(
156
+ {
157
+ body: JSON.stringify(
158
+ marshalling_gen.marshalCreateDNSStageRequest(request, this.client.settings)
159
+ ),
160
+ headers: jsonContentHeaders,
161
+ method: "POST",
162
+ path: `/edge-services/v1alpha1/dns-stages`
163
+ },
164
+ marshalling_gen.unmarshalDNSStage
165
+ );
166
+ /**
167
+ * Get DNS stage. Retrieve information about an existing DNS stage, specified
168
+ * by its `dns_stage_id`. Its full details, including FQDNs, are returned in
169
+ * the response object.
170
+ *
171
+ * @param request - The request {@link GetDNSStageRequest}
172
+ * @returns A Promise of DNSStage
173
+ */
174
+ getDNSStage = (request) => this.client.fetch(
175
+ {
176
+ method: "GET",
177
+ path: `/edge-services/v1alpha1/dns-stages/${marshalling.validatePathParam("dnsStageId", request.dnsStageId)}`
178
+ },
179
+ marshalling_gen.unmarshalDNSStage
180
+ );
181
+ /**
182
+ * Update DNS stage. Update the parameters of an existing DNS stage, specified
183
+ * by its `dns_stage_id`.
184
+ *
185
+ * @param request - The request {@link UpdateDNSStageRequest}
186
+ * @returns A Promise of DNSStage
187
+ */
188
+ updateDNSStage = (request) => this.client.fetch(
189
+ {
190
+ body: JSON.stringify(
191
+ marshalling_gen.marshalUpdateDNSStageRequest(request, this.client.settings)
192
+ ),
193
+ headers: jsonContentHeaders,
194
+ method: "PATCH",
195
+ path: `/edge-services/v1alpha1/dns-stages/${marshalling.validatePathParam("dnsStageId", request.dnsStageId)}`
196
+ },
197
+ marshalling_gen.unmarshalDNSStage
198
+ );
199
+ /**
200
+ * Delete DNS stage. Delete an existing DNS stage, specified by its
201
+ * `dns_stage_id`. Deleting a DNS stage is permanent, and cannot be undone.
202
+ *
203
+ * @param request - The request {@link DeleteDNSStageRequest}
204
+ */
205
+ deleteDNSStage = (request) => this.client.fetch({
206
+ method: "DELETE",
207
+ path: `/edge-services/v1alpha1/dns-stages/${marshalling.validatePathParam("dnsStageId", request.dnsStageId)}`
208
+ });
209
+ pageOfListTLSStages = (request = {}) => this.client.fetch(
210
+ {
211
+ method: "GET",
212
+ path: `/edge-services/v1alpha1/tls-stages`,
213
+ urlParams: marshalling.urlParams(
214
+ ["order_by", request.orderBy],
215
+ ["page", request.page],
216
+ [
217
+ "page_size",
218
+ request.pageSize ?? this.client.settings.defaultPageSize
219
+ ],
220
+ ["pipeline_id", request.pipelineId],
221
+ ["project_id", request.projectId],
222
+ ["secret_id", request.secretId],
223
+ ["secret_region", request.secretRegion]
224
+ )
225
+ },
226
+ marshalling_gen.unmarshalListTLSStagesResponse
227
+ );
228
+ /**
229
+ * List TLS stages. List all TLS stages, for a Scaleway Organization or
230
+ * Scaleway Project. By default, the TLS stages returned in the list are
231
+ * ordered by creation date in ascending order, though this can be modified
232
+ * via the `order_by` field.
233
+ *
234
+ * @param request - The request {@link ListTLSStagesRequest}
235
+ * @returns A Promise of ListTLSStagesResponse
236
+ */
237
+ listTLSStages = (request = {}) => resourcePaginator.enrichForPagination("stages", this.pageOfListTLSStages, request);
238
+ /**
239
+ * Create TLS stage. Create a new TLS stage. You must specify either the
240
+ * `secrets` or `managed_certificate` fields to customize the SSL/TLS
241
+ * certificate of your endpoint. Choose `secrets` if you are using a
242
+ * pre-existing certificate held in Scaleway Secret Manager, or
243
+ * `managed_certificate` to let Scaleway generate and manage a Let's Encrypt
244
+ * certificate for your customized endpoint.
245
+ *
246
+ * @param request - The request {@link CreateTLSStageRequest}
247
+ * @returns A Promise of TLSStage
248
+ */
249
+ createTLSStage = (request = {}) => this.client.fetch(
250
+ {
251
+ body: JSON.stringify(
252
+ marshalling_gen.marshalCreateTLSStageRequest(request, this.client.settings)
253
+ ),
254
+ headers: jsonContentHeaders,
255
+ method: "POST",
256
+ path: `/edge-services/v1alpha1/tls-stages`
257
+ },
258
+ marshalling_gen.unmarshalTLSStage
259
+ );
260
+ /**
261
+ * Get TLS stage. Retrieve information about an existing TLS stage, specified
262
+ * by its `tls_stage_id`. Its full details, including secrets and certificate
263
+ * expiration date are returned in the response object.
264
+ *
265
+ * @param request - The request {@link GetTLSStageRequest}
266
+ * @returns A Promise of TLSStage
267
+ */
268
+ getTLSStage = (request) => this.client.fetch(
269
+ {
270
+ method: "GET",
271
+ path: `/edge-services/v1alpha1/tls-stages/${marshalling.validatePathParam("tlsStageId", request.tlsStageId)}`
272
+ },
273
+ marshalling_gen.unmarshalTLSStage
274
+ );
275
+ /**
276
+ * Update TLS stage. Update the parameters of an existing TLS stage, specified
277
+ * by its `tls_stage_id`. Both `tls_secrets_config` and `managed_certificate`
278
+ * parameters can be updated.
279
+ *
280
+ * @param request - The request {@link UpdateTLSStageRequest}
281
+ * @returns A Promise of TLSStage
282
+ */
283
+ updateTLSStage = (request) => this.client.fetch(
284
+ {
285
+ body: JSON.stringify(
286
+ marshalling_gen.marshalUpdateTLSStageRequest(request, this.client.settings)
287
+ ),
288
+ headers: jsonContentHeaders,
289
+ method: "PATCH",
290
+ path: `/edge-services/v1alpha1/tls-stages/${marshalling.validatePathParam("tlsStageId", request.tlsStageId)}`
291
+ },
292
+ marshalling_gen.unmarshalTLSStage
293
+ );
294
+ /**
295
+ * Delete TLS stage. Delete an existing TLS stage, specified by its
296
+ * `tls_stage_id`. Deleting a TLS stage is permanent, and cannot be undone.
297
+ *
298
+ * @param request - The request {@link DeleteTLSStageRequest}
299
+ */
300
+ deleteTLSStage = (request) => this.client.fetch({
301
+ method: "DELETE",
302
+ path: `/edge-services/v1alpha1/tls-stages/${marshalling.validatePathParam("tlsStageId", request.tlsStageId)}`
303
+ });
304
+ pageOfListCacheStages = (request = {}) => this.client.fetch(
305
+ {
306
+ method: "GET",
307
+ path: `/edge-services/v1alpha1/cache-stages`,
308
+ urlParams: marshalling.urlParams(
309
+ ["order_by", request.orderBy],
310
+ ["page", request.page],
311
+ [
312
+ "page_size",
313
+ request.pageSize ?? this.client.settings.defaultPageSize
314
+ ],
315
+ ["pipeline_id", request.pipelineId],
316
+ ["project_id", request.projectId]
317
+ )
318
+ },
319
+ marshalling_gen.unmarshalListCacheStagesResponse
320
+ );
321
+ /**
322
+ * List cache stages. List all cache stages, for a Scaleway Organization or
323
+ * Scaleway Project. By default, the cache stages returned in the list are
324
+ * ordered by creation date in ascending order, though this can be modified
325
+ * via the `order_by` field.
326
+ *
327
+ * @param request - The request {@link ListCacheStagesRequest}
328
+ * @returns A Promise of ListCacheStagesResponse
329
+ */
330
+ listCacheStages = (request = {}) => resourcePaginator.enrichForPagination("stages", this.pageOfListCacheStages, request);
331
+ /**
332
+ * Create cache stage. Create a new cache stage. You must specify the
333
+ * `fallback_ttl` field to customize the TTL of the cache.
334
+ *
335
+ * @param request - The request {@link CreateCacheStageRequest}
336
+ * @returns A Promise of CacheStage
337
+ */
338
+ createCacheStage = (request = {}) => this.client.fetch(
339
+ {
340
+ body: JSON.stringify(
341
+ marshalling_gen.marshalCreateCacheStageRequest(request, this.client.settings)
342
+ ),
343
+ headers: jsonContentHeaders,
344
+ method: "POST",
345
+ path: `/edge-services/v1alpha1/cache-stages`
346
+ },
347
+ marshalling_gen.unmarshalCacheStage
348
+ );
349
+ /**
350
+ * Get cache stage. Retrieve information about an existing cache stage,
351
+ * specified by its `cache_stage_id`. Its full details, including Time To Live
352
+ * (TTL), are returned in the response object.
353
+ *
354
+ * @param request - The request {@link GetCacheStageRequest}
355
+ * @returns A Promise of CacheStage
356
+ */
357
+ getCacheStage = (request) => this.client.fetch(
358
+ {
359
+ method: "GET",
360
+ path: `/edge-services/v1alpha1/cache-stages/${marshalling.validatePathParam("cacheStageId", request.cacheStageId)}`
361
+ },
362
+ marshalling_gen.unmarshalCacheStage
363
+ );
364
+ /**
365
+ * Update cache stage. Update the parameters of an existing cache stage,
366
+ * specified by its `cache_stage_id`. Parameters which can be updated include
367
+ * the `fallback_ttl` and `backend_stage_id`.
368
+ *
369
+ * @param request - The request {@link UpdateCacheStageRequest}
370
+ * @returns A Promise of CacheStage
371
+ */
372
+ updateCacheStage = (request) => this.client.fetch(
373
+ {
374
+ body: JSON.stringify(
375
+ marshalling_gen.marshalUpdateCacheStageRequest(request, this.client.settings)
376
+ ),
377
+ headers: jsonContentHeaders,
378
+ method: "PATCH",
379
+ path: `/edge-services/v1alpha1/cache-stages/${marshalling.validatePathParam("cacheStageId", request.cacheStageId)}`
380
+ },
381
+ marshalling_gen.unmarshalCacheStage
382
+ );
383
+ /**
384
+ * Delete cache stage. Delete an existing cache stage, specified by its
385
+ * `cache_stage_id`. Deleting a cache stage is permanent, and cannot be
386
+ * undone.
387
+ *
388
+ * @param request - The request {@link DeleteCacheStageRequest}
389
+ */
390
+ deleteCacheStage = (request) => this.client.fetch({
391
+ method: "DELETE",
392
+ path: `/edge-services/v1alpha1/cache-stages/${marshalling.validatePathParam("cacheStageId", request.cacheStageId)}`
393
+ });
394
+ pageOfListBackendStages = (request = {}) => this.client.fetch(
395
+ {
396
+ method: "GET",
397
+ path: `/edge-services/v1alpha1/backend-stages`,
398
+ urlParams: marshalling.urlParams(
399
+ ["bucket_name", request.bucketName],
400
+ ["bucket_region", request.bucketRegion],
401
+ ["lb_id", request.lbId],
402
+ ["order_by", request.orderBy],
403
+ ["page", request.page],
404
+ [
405
+ "page_size",
406
+ request.pageSize ?? this.client.settings.defaultPageSize
407
+ ],
408
+ ["pipeline_id", request.pipelineId],
409
+ ["project_id", request.projectId]
410
+ )
411
+ },
412
+ marshalling_gen.unmarshalListBackendStagesResponse
413
+ );
414
+ /**
415
+ * List backend stages. List all backend stages, for a Scaleway Organization
416
+ * or Scaleway Project. By default, the backend stages returned in the list
417
+ * are ordered by creation date in ascending order, though this can be
418
+ * modified via the `order_by` field.
419
+ *
420
+ * @param request - The request {@link ListBackendStagesRequest}
421
+ * @returns A Promise of ListBackendStagesResponse
422
+ */
423
+ listBackendStages = (request = {}) => resourcePaginator.enrichForPagination("stages", this.pageOfListBackendStages, request);
424
+ /**
425
+ * Create backend stage. Create a new backend stage. You must specify either a
426
+ * `scaleway_s3` (for a Scaleway Object Storage bucket) or `scaleway_lb` (for
427
+ * a Scaleway Load Balancer) field to configure the origin.
428
+ *
429
+ * @param request - The request {@link CreateBackendStageRequest}
430
+ * @returns A Promise of BackendStage
431
+ */
432
+ createBackendStage = (request = {}) => this.client.fetch(
433
+ {
434
+ body: JSON.stringify(
435
+ marshalling_gen.marshalCreateBackendStageRequest(request, this.client.settings)
436
+ ),
437
+ headers: jsonContentHeaders,
438
+ method: "POST",
439
+ path: `/edge-services/v1alpha1/backend-stages`
440
+ },
441
+ marshalling_gen.unmarshalBackendStage
442
+ );
443
+ /**
444
+ * Get backend stage. Retrieve information about an existing backend stage,
445
+ * specified by its `backend_stage_id`. Its full details, including
446
+ * `scaleway_s3` or `scaleway_lb`, are returned in the response object.
447
+ *
448
+ * @param request - The request {@link GetBackendStageRequest}
449
+ * @returns A Promise of BackendStage
450
+ */
451
+ getBackendStage = (request) => this.client.fetch(
452
+ {
453
+ method: "GET",
454
+ path: `/edge-services/v1alpha1/backend-stages/${marshalling.validatePathParam("backendStageId", request.backendStageId)}`
455
+ },
456
+ marshalling_gen.unmarshalBackendStage
457
+ );
458
+ /**
459
+ * Update backend stage. Update the parameters of an existing backend stage,
460
+ * specified by its `backend_stage_id`.
461
+ *
462
+ * @param request - The request {@link UpdateBackendStageRequest}
463
+ * @returns A Promise of BackendStage
464
+ */
465
+ updateBackendStage = (request) => this.client.fetch(
466
+ {
467
+ body: JSON.stringify(
468
+ marshalling_gen.marshalUpdateBackendStageRequest(request, this.client.settings)
469
+ ),
470
+ headers: jsonContentHeaders,
471
+ method: "PATCH",
472
+ path: `/edge-services/v1alpha1/backend-stages/${marshalling.validatePathParam("backendStageId", request.backendStageId)}`
473
+ },
474
+ marshalling_gen.unmarshalBackendStage
475
+ );
476
+ /**
477
+ * Delete backend stage. Delete an existing backend stage, specified by its
478
+ * `backend_stage_id`. Deleting a backend stage is permanent, and cannot be
479
+ * undone.
480
+ *
481
+ * @param request - The request {@link DeleteBackendStageRequest}
482
+ */
483
+ deleteBackendStage = (request) => this.client.fetch({
484
+ method: "DELETE",
485
+ path: `/edge-services/v1alpha1/backend-stages/${marshalling.validatePathParam("backendStageId", request.backendStageId)}`
486
+ });
487
+ checkDomain = (request) => this.client.fetch(
488
+ {
489
+ body: JSON.stringify(
490
+ marshalling_gen.marshalCheckDomainRequest(request, this.client.settings)
491
+ ),
492
+ headers: jsonContentHeaders,
493
+ method: "POST",
494
+ path: `/edge-services/v1alpha1/check-domain`
495
+ },
496
+ marshalling_gen.unmarshalCheckDomainResponse
497
+ );
498
+ checkPEMChain = (request) => this.client.fetch(
499
+ {
500
+ body: JSON.stringify(
501
+ marshalling_gen.marshalCheckPEMChainRequest(request, this.client.settings)
502
+ ),
503
+ headers: jsonContentHeaders,
504
+ method: "POST",
505
+ path: `/edge-services/v1alpha1/check-pem-chain`
506
+ },
507
+ marshalling_gen.unmarshalCheckPEMChainResponse
508
+ );
509
+ pageOfListPurgeRequests = (request = {}) => this.client.fetch(
510
+ {
511
+ method: "GET",
512
+ path: `/edge-services/v1alpha1/purge-requests`,
513
+ urlParams: marshalling.urlParams(
514
+ ["order_by", request.orderBy],
515
+ ["organization_id", request.organizationId],
516
+ ["page", request.page],
517
+ [
518
+ "page_size",
519
+ request.pageSize ?? this.client.settings.defaultPageSize
520
+ ],
521
+ ["pipeline_id", request.pipelineId],
522
+ ["project_id", request.projectId]
523
+ )
524
+ },
525
+ marshalling_gen.unmarshalListPurgeRequestsResponse
526
+ );
527
+ /**
528
+ * List purge requests. List all purge requests, for a Scaleway Organization
529
+ * or Scaleway Project. This enables you to retrieve a history of all
530
+ * previously-made purge requests. By default, the purge requests returned in
531
+ * the list are ordered by creation date in ascending order, though this can
532
+ * be modified via the `order_by` field.
533
+ *
534
+ * @param request - The request {@link ListPurgeRequestsRequest}
535
+ * @returns A Promise of ListPurgeRequestsResponse
536
+ */
537
+ listPurgeRequests = (request = {}) => resourcePaginator.enrichForPagination("purgeRequests", this.pageOfListPurgeRequests, request);
538
+ /**
539
+ * Create purge request. Create a new purge request. You must specify either
540
+ * the `all` field (to purge all content) or a list of `assets` (to define the
541
+ * precise assets to purge).
542
+ *
543
+ * @param request - The request {@link CreatePurgeRequestRequest}
544
+ * @returns A Promise of PurgeRequest
545
+ */
546
+ createPurgeRequest = (request) => this.client.fetch(
547
+ {
548
+ body: JSON.stringify(
549
+ marshalling_gen.marshalCreatePurgeRequestRequest(request, this.client.settings)
550
+ ),
551
+ headers: jsonContentHeaders,
552
+ method: "POST",
553
+ path: `/edge-services/v1alpha1/purge-requests`
554
+ },
555
+ marshalling_gen.unmarshalPurgeRequest
556
+ );
557
+ /**
558
+ * Get purge request. Retrieve information about a purge request, specified by
559
+ * its `purge_request_id`. Its full details, including `status` and `target`,
560
+ * are returned in the response object.
561
+ *
562
+ * @param request - The request {@link GetPurgeRequestRequest}
563
+ * @returns A Promise of PurgeRequest
564
+ */
565
+ getPurgeRequest = (request) => this.client.fetch(
566
+ {
567
+ method: "GET",
568
+ path: `/edge-services/v1alpha1/purge-requests/${marshalling.validatePathParam("purgeRequestId", request.purgeRequestId)}`
569
+ },
570
+ marshalling_gen.unmarshalPurgeRequest
571
+ );
572
+ /**
573
+ * Waits for {@link PurgeRequest} to be in a final state.
574
+ *
575
+ * @param request - The request {@link GetPurgeRequestRequest}
576
+ * @param options - The waiting options
577
+ * @returns A Promise of PurgeRequest
578
+ */
579
+ waitForPurgeRequest = (request, options) => intervalRetrier.waitForResource(
580
+ options?.stop ?? ((res) => Promise.resolve(
581
+ !content_gen.PURGE_REQUEST_TRANSIENT_STATUSES.includes(res.status)
582
+ )),
583
+ this.getPurgeRequest,
584
+ request,
585
+ options
586
+ );
587
+ checkLbOrigin = (request = {}) => this.client.fetch(
588
+ {
589
+ body: JSON.stringify(
590
+ marshalling_gen.marshalCheckLbOriginRequest(request, this.client.settings)
591
+ ),
592
+ headers: jsonContentHeaders,
593
+ method: "POST",
594
+ path: `/edge-services/v1alpha1/check-lb-origin`
595
+ },
596
+ marshalling_gen.unmarshalCheckLbOriginResponse
597
+ );
598
+ listPlans = () => this.client.fetch(
599
+ {
600
+ method: "GET",
601
+ path: `/edge-services/v1alpha1/plans`
602
+ },
603
+ marshalling_gen.unmarshalListPlansResponse
604
+ );
605
+ selectPlan = (request = {}) => this.client.fetch(
606
+ {
607
+ body: JSON.stringify(
608
+ marshalling_gen.marshalSelectPlanRequest(request, this.client.settings)
609
+ ),
610
+ headers: jsonContentHeaders,
611
+ method: "PATCH",
612
+ path: `/edge-services/v1alpha1/current-plan`
613
+ },
614
+ marshalling_gen.unmarshalPlan
615
+ );
616
+ getCurrentPlan = (request = {}) => this.client.fetch(
617
+ {
618
+ method: "GET",
619
+ path: `/edge-services/v1alpha1/current-plan`,
620
+ urlParams: marshalling.urlParams([
621
+ "project_id",
622
+ request.projectId ?? this.client.settings.defaultProjectId
623
+ ])
624
+ },
625
+ marshalling_gen.unmarshalPlan
626
+ );
627
+ deleteCurrentPlan = (request = {}) => this.client.fetch({
628
+ method: "DELETE",
629
+ path: `/edge-services/v1alpha1/current-plan`,
630
+ urlParams: marshalling.urlParams([
631
+ "project_id",
632
+ request.projectId ?? this.client.settings.defaultProjectId
633
+ ])
634
+ });
635
+ }
636
+ exports.API = API;
@@ -1,6 +1,6 @@
1
1
  import { API as ParentAPI } from '../../../bridge';
2
2
  import type { WaitForOptions } from '../../../bridge';
3
- import type { BackendStage, CacheStage, CheckDomainRequest, CheckDomainResponse, CheckLbOriginRequest, CheckLbOriginResponse, CheckPEMChainRequest, CheckPEMChainResponse, CreateBackendStageRequest, CreateCacheStageRequest, CreateDNSStageRequest, CreatePipelineRequest, CreatePurgeRequestRequest, CreateTLSStageRequest, DNSStage, DeleteBackendStageRequest, DeleteCacheStageRequest, DeleteDNSStageRequest, DeletePipelineRequest, DeleteTLSStageRequest, GetBackendStageRequest, GetCacheStageRequest, GetDNSStageRequest, GetPipelineRequest, GetPurgeRequestRequest, GetTLSStageRequest, ListBackendStagesRequest, ListBackendStagesResponse, ListCacheStagesRequest, ListCacheStagesResponse, ListDNSStagesRequest, ListDNSStagesResponse, ListPipelinesRequest, ListPipelinesResponse, ListPurgeRequestsRequest, ListPurgeRequestsResponse, ListTLSStagesRequest, ListTLSStagesResponse, Pipeline, PurgeRequest, TLSStage, UpdateBackendStageRequest, UpdateCacheStageRequest, UpdateDNSStageRequest, UpdatePipelineRequest, UpdateTLSStageRequest } from './types.gen';
3
+ import type { BackendStage, CacheStage, CheckDomainRequest, CheckDomainResponse, CheckLbOriginRequest, CheckLbOriginResponse, CheckPEMChainRequest, CheckPEMChainResponse, CreateBackendStageRequest, CreateCacheStageRequest, CreateDNSStageRequest, CreatePipelineRequest, CreatePurgeRequestRequest, CreateTLSStageRequest, DNSStage, DeleteBackendStageRequest, DeleteCacheStageRequest, DeleteCurrentPlanRequest, DeleteDNSStageRequest, DeletePipelineRequest, DeleteTLSStageRequest, GetBackendStageRequest, GetCacheStageRequest, GetCurrentPlanRequest, GetDNSStageRequest, GetPipelineRequest, GetPurgeRequestRequest, GetTLSStageRequest, ListBackendStagesRequest, ListBackendStagesResponse, ListCacheStagesRequest, ListCacheStagesResponse, ListDNSStagesRequest, ListDNSStagesResponse, ListPipelinesRequest, ListPipelinesResponse, ListPlansResponse, ListPurgeRequestsRequest, ListPurgeRequestsResponse, ListTLSStagesRequest, ListTLSStagesResponse, Pipeline, Plan, PurgeRequest, SelectPlanRequest, TLSStage, UpdateBackendStageRequest, UpdateCacheStageRequest, UpdateDNSStageRequest, UpdatePipelineRequest, UpdateTLSStageRequest } from './types.gen';
4
4
  /** Edge Services API. */
5
5
  export declare class API extends ParentAPI {
6
6
  protected pageOfListPipelines: (request?: Readonly<ListPipelinesRequest>) => Promise<ListPipelinesResponse>;
@@ -297,4 +297,8 @@ export declare class API extends ParentAPI {
297
297
  */
298
298
  waitForPurgeRequest: (request: Readonly<GetPurgeRequestRequest>, options?: Readonly<WaitForOptions<PurgeRequest>>) => Promise<PurgeRequest>;
299
299
  checkLbOrigin: (request?: Readonly<CheckLbOriginRequest>) => Promise<CheckLbOriginResponse>;
300
+ listPlans: () => Promise<ListPlansResponse>;
301
+ selectPlan: (request?: Readonly<SelectPlanRequest>) => Promise<Plan>;
302
+ getCurrentPlan: (request?: Readonly<GetCurrentPlanRequest>) => Promise<Plan>;
303
+ deleteCurrentPlan: (request?: Readonly<DeleteCurrentPlanRequest>) => Promise<void>;
300
304
  }