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