@scaleway/sdk 2.26.0 → 2.27.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.
- package/dist/api/account/index.cjs +6 -0
- package/dist/api/account/index.d.ts +2 -0
- package/dist/api/account/index.js +6 -4
- package/dist/api/account/v2/api.gen.cjs +116 -0
- package/dist/api/account/v2/api.gen.d.ts +67 -0
- package/dist/api/account/v2/api.gen.js +61 -44
- package/dist/api/account/v2/index.gen.cjs +4 -0
- package/dist/api/account/v2/index.gen.d.ts +2 -0
- package/dist/api/account/v2/index.gen.js +4 -4
- package/dist/api/account/v2/marshalling.gen.cjs +44 -0
- package/dist/api/account/v2/marshalling.gen.d.ts +6 -0
- package/dist/api/account/v2/marshalling.gen.js +18 -13
- package/dist/api/account/v2/types.gen.d.ts +62 -0
- package/dist/api/account/v3/api.gen.cjs +106 -0
- package/dist/api/account/v3/api.gen.d.ts +57 -0
- package/dist/api/account/v3/api.gen.js +61 -44
- package/dist/api/account/v3/index.gen.cjs +6 -0
- package/dist/api/account/v3/index.gen.d.ts +3 -0
- package/dist/api/account/v3/index.gen.js +6 -6
- package/dist/api/account/v3/marshalling.gen.cjs +44 -0
- package/dist/api/account/v3/marshalling.gen.d.ts +6 -0
- package/dist/api/account/v3/marshalling.gen.js +18 -13
- package/dist/api/account/v3/types.gen.d.ts +62 -0
- package/dist/api/account/v3/validation-rules.gen.cjs +39 -0
- package/dist/api/account/v3/validation-rules.gen.d.ts +34 -0
- package/dist/api/account/v3/validation-rules.gen.js +5 -5
- package/dist/api/applesilicon/index.cjs +4 -0
- package/dist/api/applesilicon/index.d.ts +1 -0
- package/dist/api/applesilicon/index.js +4 -2
- package/dist/api/applesilicon/v1alpha1/api.gen.cjs +222 -0
- package/dist/api/applesilicon/v1alpha1/api.gen.d.ts +119 -0
- package/dist/api/applesilicon/v1alpha1/api.gen.js +125 -83
- package/dist/api/applesilicon/v1alpha1/content.gen.cjs +11 -0
- package/dist/api/applesilicon/v1alpha1/content.gen.d.ts +3 -0
- package/dist/api/applesilicon/v1alpha1/content.gen.js +11 -7
- package/dist/api/applesilicon/v1alpha1/index.gen.cjs +6 -0
- package/dist/api/applesilicon/v1alpha1/index.gen.d.ts +3 -0
- package/dist/api/applesilicon/v1alpha1/index.gen.js +6 -5
- package/dist/api/applesilicon/v1alpha1/marshalling.gen.cjs +147 -0
- package/dist/api/applesilicon/v1alpha1/marshalling.gen.d.ts +11 -0
- package/dist/api/applesilicon/v1alpha1/marshalling.gen.js +56 -32
- package/dist/api/applesilicon/v1alpha1/types.gen.d.ts +203 -0
- package/dist/api/baremetal/index.cjs +4 -0
- package/dist/api/baremetal/index.d.ts +1 -0
- package/dist/api/baremetal/index.js +4 -2
- package/dist/api/baremetal/v1/api.gen.cjs +575 -0
- package/dist/api/baremetal/v1/api.gen.d.ts +287 -0
- package/dist/api/baremetal/v1/api.gen.js +353 -205
- package/dist/api/baremetal/v1/api.utils.cjs +36 -0
- package/dist/api/baremetal/v1/api.utils.d.ts +13 -0
- package/dist/api/baremetal/v1/api.utils.js +27 -18
- package/dist/api/baremetal/v1/content.gen.cjs +18 -0
- package/dist/api/baremetal/v1/content.gen.d.ts +7 -0
- package/dist/api/baremetal/v1/content.gen.js +18 -13
- package/dist/api/baremetal/v1/index.cjs +12 -0
- package/dist/api/baremetal/v1/index.d.ts +5 -0
- package/dist/api/baremetal/v1/index.gen.d.ts +4 -0
- package/dist/api/baremetal/v1/index.js +12 -5
- package/dist/api/baremetal/v1/marshalling.gen.cjs +502 -0
- package/dist/api/baremetal/v1/marshalling.gen.d.ts +30 -0
- package/dist/api/baremetal/v1/marshalling.gen.js +186 -90
- package/dist/api/baremetal/v1/types.gen.d.ts +682 -0
- package/dist/api/baremetal/v1/validation-rules.gen.cjs +116 -0
- package/dist/api/baremetal/v1/validation-rules.gen.d.ts +104 -0
- package/dist/api/baremetal/v1/validation-rules.gen.js +12 -5
- package/dist/api/billing/index.cjs +6 -0
- package/dist/api/billing/index.d.ts +2 -0
- package/dist/api/billing/index.js +6 -4
- package/dist/api/billing/v2alpha1/api.gen.cjs +92 -0
- package/dist/api/billing/v2alpha1/api.gen.d.ts +50 -0
- package/dist/api/billing/v2alpha1/api.gen.js +60 -39
- package/dist/api/billing/v2alpha1/index.gen.cjs +4 -0
- package/dist/api/billing/v2alpha1/index.gen.d.ts +2 -0
- package/dist/api/billing/v2alpha1/index.gen.js +4 -4
- package/dist/api/billing/v2alpha1/marshalling.gen.cjs +117 -0
- package/dist/api/billing/v2alpha1/marshalling.gen.d.ts +4 -0
- package/dist/api/billing/v2alpha1/marshalling.gen.js +48 -29
- package/dist/api/billing/v2alpha1/types.gen.d.ts +136 -0
- package/dist/api/billing/v2beta1/api.gen.cjs +175 -0
- package/dist/api/billing/v2beta1/api.gen.d.ts +79 -0
- package/dist/api/billing/v2beta1/api.gen.js +122 -65
- package/dist/api/billing/v2beta1/index.gen.cjs +4 -0
- package/dist/api/billing/v2beta1/index.gen.d.ts +2 -0
- package/dist/api/billing/v2beta1/index.gen.js +4 -4
- package/dist/api/billing/v2beta1/marshalling.gen.cjs +158 -0
- package/dist/api/billing/v2beta1/marshalling.gen.d.ts +6 -0
- package/dist/api/billing/v2beta1/marshalling.gen.js +61 -36
- package/dist/api/billing/v2beta1/types.gen.d.ts +269 -0
- package/dist/api/block/index.cjs +4 -0
- package/dist/api/block/index.d.ts +1 -0
- package/dist/api/block/index.js +4 -2
- package/dist/api/block/v1alpha1/api.gen.cjs +272 -0
- package/dist/api/block/v1alpha1/api.gen.d.ts +144 -0
- package/dist/api/block/v1alpha1/api.gen.js +167 -90
- package/dist/api/block/v1alpha1/content.gen.cjs +20 -0
- package/dist/api/block/v1alpha1/content.gen.d.ts +7 -0
- package/dist/api/block/v1alpha1/content.gen.js +20 -13
- package/dist/api/block/v1alpha1/index.gen.cjs +10 -0
- package/dist/api/block/v1alpha1/index.gen.d.ts +4 -0
- package/dist/api/block/v1alpha1/index.gen.js +10 -7
- package/dist/api/block/v1alpha1/marshalling.gen.cjs +194 -0
- package/dist/api/block/v1alpha1/marshalling.gen.d.ts +13 -0
- package/dist/api/block/v1alpha1/marshalling.gen.js +78 -42
- package/dist/api/block/v1alpha1/types.gen.d.ts +315 -0
- package/dist/api/block/v1alpha1/validation-rules.gen.cjs +56 -0
- package/dist/api/block/v1alpha1/validation-rules.gen.d.ts +47 -0
- package/dist/api/block/v1alpha1/validation-rules.gen.js +14 -5
- package/dist/api/cockpit/index.cjs +6 -0
- package/dist/api/cockpit/index.d.ts +2 -0
- package/dist/api/cockpit/index.js +6 -4
- package/dist/api/cockpit/v1/api.gen.cjs +629 -0
- package/dist/api/cockpit/v1/api.gen.d.ts +310 -0
- package/dist/api/cockpit/v1/api.gen.js +374 -201
- package/dist/api/cockpit/v1/index.gen.cjs +7 -0
- package/dist/api/cockpit/v1/index.gen.d.ts +3 -0
- package/dist/api/cockpit/v1/index.gen.js +7 -6
- package/dist/api/cockpit/v1/marshalling.gen.cjs +325 -0
- package/dist/api/cockpit/v1/marshalling.gen.d.ts +30 -0
- package/dist/api/cockpit/v1/marshalling.gen.js +131 -59
- package/dist/api/cockpit/v1/types.gen.d.ts +525 -0
- package/dist/api/cockpit/v1/validation-rules.gen.cjs +48 -0
- package/dist/api/cockpit/v1/validation-rules.gen.d.ts +41 -0
- package/dist/api/cockpit/v1/validation-rules.gen.js +10 -8
- package/dist/api/cockpit/v1beta1/api.gen.cjs +484 -0
- package/dist/api/cockpit/v1beta1/api.gen.d.ts +224 -0
- package/dist/api/cockpit/v1beta1/api.gen.js +298 -167
- package/dist/api/cockpit/v1beta1/content.gen.cjs +8 -0
- package/dist/api/cockpit/v1beta1/content.gen.d.ts +3 -0
- package/dist/api/cockpit/v1beta1/content.gen.js +8 -7
- package/dist/api/cockpit/v1beta1/index.gen.cjs +6 -0
- package/dist/api/cockpit/v1beta1/index.gen.d.ts +3 -0
- package/dist/api/cockpit/v1beta1/index.gen.js +6 -5
- package/dist/api/cockpit/v1beta1/marshalling.gen.cjs +343 -0
- package/dist/api/cockpit/v1beta1/marshalling.gen.d.ts +29 -0
- package/dist/api/cockpit/v1beta1/marshalling.gen.js +131 -60
- package/dist/api/cockpit/v1beta1/types.gen.d.ts +385 -0
- package/dist/api/container/index.cjs +4 -0
- package/dist/api/container/index.d.ts +1 -0
- package/dist/api/container/index.js +4 -2
- package/dist/api/container/v1beta1/api.gen.cjs +621 -0
- package/dist/api/container/v1beta1/api.gen.d.ts +300 -0
- package/dist/api/container/v1beta1/api.gen.js +384 -228
- package/dist/api/container/v1beta1/content.gen.cjs +34 -0
- package/dist/api/container/v1beta1/content.gen.d.ts +13 -0
- package/dist/api/container/v1beta1/content.gen.js +34 -22
- package/dist/api/container/v1beta1/index.gen.cjs +13 -0
- package/dist/api/container/v1beta1/index.gen.d.ts +4 -0
- package/dist/api/container/v1beta1/index.gen.js +13 -7
- package/dist/api/container/v1beta1/marshalling.gen.cjs +408 -0
- package/dist/api/container/v1beta1/marshalling.gen.d.ts +24 -0
- package/dist/api/container/v1beta1/marshalling.gen.js +147 -71
- package/dist/api/container/v1beta1/types.gen.d.ts +785 -0
- package/dist/api/container/v1beta1/validation-rules.gen.cjs +45 -0
- package/dist/api/container/v1beta1/validation-rules.gen.d.ts +39 -0
- package/dist/api/container/v1beta1/validation-rules.gen.js +6 -5
- package/dist/api/dedibox/index.cjs +4 -0
- package/dist/api/dedibox/index.d.ts +1 -0
- package/dist/api/dedibox/index.js +4 -2
- package/dist/api/dedibox/v1/api.gen.cjs +1460 -0
- package/dist/api/dedibox/v1/api.gen.d.ts +560 -0
- package/dist/api/dedibox/v1/api.gen.js +1051 -565
- package/dist/api/dedibox/v1/content.gen.cjs +49 -0
- package/dist/api/dedibox/v1/content.gen.d.ts +19 -0
- package/dist/api/dedibox/v1/content.gen.js +49 -31
- package/dist/api/dedibox/v1/index.gen.cjs +22 -0
- package/dist/api/dedibox/v1/index.gen.d.ts +4 -0
- package/dist/api/dedibox/v1/index.gen.js +22 -7
- package/dist/api/dedibox/v1/marshalling.gen.cjs +1475 -0
- package/dist/api/dedibox/v1/marshalling.gen.d.ts +82 -0
- package/dist/api/dedibox/v1/marshalling.gen.js +514 -237
- package/dist/api/dedibox/v1/types.gen.d.ts +1900 -0
- package/dist/api/dedibox/v1/validation-rules.gen.cjs +626 -0
- package/dist/api/dedibox/v1/validation-rules.gen.d.ts +539 -0
- package/dist/api/dedibox/v1/validation-rules.gen.js +87 -5
- package/dist/api/document_db/index.cjs +4 -0
- package/dist/api/document_db/index.d.ts +1 -0
- package/dist/api/document_db/index.js +4 -2
- package/dist/api/document_db/v1beta1/api.gen.cjs +1018 -0
- package/dist/api/document_db/v1beta1/api.gen.d.ts +538 -0
- package/dist/api/document_db/v1beta1/api.gen.js +561 -339
- package/dist/api/document_db/v1beta1/content.gen.cjs +31 -0
- package/dist/api/document_db/v1beta1/content.gen.d.ts +11 -0
- package/dist/api/document_db/v1beta1/content.gen.js +31 -19
- package/dist/api/document_db/v1beta1/index.gen.cjs +12 -0
- package/dist/api/document_db/v1beta1/index.gen.d.ts +4 -0
- package/dist/api/document_db/v1beta1/index.gen.js +12 -7
- package/dist/api/document_db/v1beta1/marshalling.gen.cjs +829 -0
- package/dist/api/document_db/v1beta1/marshalling.gen.d.ts +50 -0
- package/dist/api/document_db/v1beta1/marshalling.gen.js +354 -181
- package/dist/api/document_db/v1beta1/types.gen.d.ts +1254 -0
- package/dist/api/document_db/v1beta1/validation-rules.gen.cjs +8 -0
- package/dist/api/document_db/v1beta1/validation-rules.gen.d.ts +5 -0
- package/dist/api/document_db/v1beta1/validation-rules.gen.js +3 -5
- package/dist/api/domain/index.cjs +4 -0
- package/dist/api/domain/index.d.ts +1 -0
- package/dist/api/domain/index.js +4 -2
- package/dist/api/domain/v2beta1/api.gen.cjs +1052 -0
- package/dist/api/domain/v2beta1/api.gen.d.ts +521 -0
- package/dist/api/domain/v2beta1/api.gen.js +638 -365
- package/dist/api/domain/v2beta1/content.gen.cjs +29 -0
- package/dist/api/domain/v2beta1/content.gen.d.ts +18 -0
- package/dist/api/domain/v2beta1/content.gen.js +29 -28
- package/dist/api/domain/v2beta1/index.gen.cjs +13 -0
- package/dist/api/domain/v2beta1/index.gen.d.ts +3 -0
- package/dist/api/domain/v2beta1/index.gen.js +13 -5
- package/dist/api/domain/v2beta1/marshalling.gen.cjs +1472 -0
- package/dist/api/domain/v2beta1/marshalling.gen.d.ts +59 -0
- package/dist/api/domain/v2beta1/marshalling.gen.js +676 -383
- package/dist/api/domain/v2beta1/types.gen.d.ts +1073 -0
- package/dist/api/flexibleip/index.cjs +4 -0
- package/dist/api/flexibleip/index.d.ts +1 -0
- package/dist/api/flexibleip/index.js +4 -2
- package/dist/api/flexibleip/v1alpha1/api.gen.cjs +227 -0
- package/dist/api/flexibleip/v1alpha1/api.gen.d.ts +117 -0
- package/dist/api/flexibleip/v1alpha1/api.gen.js +134 -86
- package/dist/api/flexibleip/v1alpha1/content.gen.cjs +12 -0
- package/dist/api/flexibleip/v1alpha1/content.gen.d.ts +5 -0
- package/dist/api/flexibleip/v1alpha1/content.gen.js +12 -10
- package/dist/api/flexibleip/v1alpha1/index.gen.cjs +9 -0
- package/dist/api/flexibleip/v1alpha1/index.gen.d.ts +4 -0
- package/dist/api/flexibleip/v1alpha1/index.gen.js +9 -7
- package/dist/api/flexibleip/v1alpha1/marshalling.gen.cjs +115 -0
- package/dist/api/flexibleip/v1alpha1/marshalling.gen.d.ts +13 -0
- package/dist/api/flexibleip/v1alpha1/marshalling.gen.js +36 -18
- package/dist/api/flexibleip/v1alpha1/types.gen.d.ts +196 -0
- package/dist/api/flexibleip/v1alpha1/validation-rules.gen.cjs +12 -0
- package/dist/api/flexibleip/v1alpha1/validation-rules.gen.d.ts +9 -0
- package/dist/api/flexibleip/v1alpha1/validation-rules.gen.js +3 -5
- package/dist/api/function/index.cjs +4 -0
- package/dist/api/function/index.d.ts +1 -0
- package/dist/api/function/index.js +4 -2
- package/dist/api/function/v1beta1/api.gen.cjs +666 -0
- package/dist/api/function/v1beta1/api.gen.d.ts +326 -0
- package/dist/api/function/v1beta1/api.gen.js +406 -244
- package/dist/api/function/v1beta1/content.gen.cjs +34 -0
- package/dist/api/function/v1beta1/content.gen.d.ts +13 -0
- package/dist/api/function/v1beta1/content.gen.js +34 -22
- package/dist/api/function/v1beta1/index.gen.cjs +13 -0
- package/dist/api/function/v1beta1/index.gen.d.ts +4 -0
- package/dist/api/function/v1beta1/index.gen.js +13 -7
- package/dist/api/function/v1beta1/marshalling.gen.cjs +457 -0
- package/dist/api/function/v1beta1/marshalling.gen.d.ts +27 -0
- package/dist/api/function/v1beta1/marshalling.gen.js +167 -80
- package/dist/api/function/v1beta1/types.gen.d.ts +819 -0
- package/dist/api/function/v1beta1/validation-rules.gen.cjs +45 -0
- package/dist/api/function/v1beta1/validation-rules.gen.d.ts +39 -0
- package/dist/api/function/v1beta1/validation-rules.gen.js +6 -5
- package/dist/api/iam/index.cjs +4 -0
- package/dist/api/iam/index.d.ts +1 -0
- package/dist/api/iam/index.js +4 -2
- package/dist/api/iam/v1alpha1/api.gen.cjs +951 -0
- package/dist/api/iam/v1alpha1/api.gen.d.ts +475 -0
- package/dist/api/iam/v1alpha1/api.gen.js +560 -302
- package/dist/api/iam/v1alpha1/index.gen.cjs +6 -0
- package/dist/api/iam/v1alpha1/index.gen.d.ts +3 -0
- package/dist/api/iam/v1alpha1/index.gen.js +6 -6
- package/dist/api/iam/v1alpha1/marshalling.gen.cjs +504 -0
- package/dist/api/iam/v1alpha1/marshalling.gen.d.ts +42 -0
- package/dist/api/iam/v1alpha1/marshalling.gen.js +184 -119
- package/dist/api/iam/v1alpha1/types.gen.d.ts +886 -0
- package/dist/api/iam/v1alpha1/validation-rules.gen.cjs +235 -0
- package/dist/api/iam/v1alpha1/validation-rules.gen.d.ts +211 -0
- package/dist/api/iam/v1alpha1/validation-rules.gen.js +29 -10
- package/dist/api/index.d.ts +34 -0
- package/dist/api/instance/index.cjs +4 -0
- package/dist/api/instance/index.d.ts +1 -0
- package/dist/api/instance/index.js +4 -2
- package/dist/api/instance/v1/api.gen.cjs +1178 -0
- package/dist/api/instance/v1/api.gen.d.ts +528 -0
- package/dist/api/instance/v1/api.gen.js +753 -436
- package/dist/api/instance/v1/api.utils.cjs +279 -0
- package/dist/api/instance/v1/api.utils.d.ts +95 -0
- package/dist/api/instance/v1/api.utils.js +145 -109
- package/dist/api/instance/v1/content.gen.cjs +44 -0
- package/dist/api/instance/v1/content.gen.d.ts +21 -0
- package/dist/api/instance/v1/content.gen.js +44 -34
- package/dist/api/instance/v1/index.cjs +15 -0
- package/dist/api/instance/v1/index.d.ts +4 -0
- package/dist/api/instance/v1/index.gen.d.ts +4 -0
- package/dist/api/instance/v1/index.js +15 -2
- package/dist/api/instance/v1/marshalling.gen.cjs +1813 -0
- package/dist/api/instance/v1/marshalling.gen.d.ts +95 -0
- package/dist/api/instance/v1/marshalling.gen.js +736 -412
- package/dist/api/instance/v1/marshalling.utils.d.ts +3 -0
- package/dist/api/instance/v1/types.gen.d.ts +1818 -0
- package/dist/api/instance/v1/types.private.gen.d.ts +167 -0
- package/dist/api/instance/v1/types.utils.d.ts +35 -0
- package/dist/api/instance/v1/validation-rules.gen.d.ts +10 -0
- package/dist/api/iot/index.cjs +4 -0
- package/dist/api/iot/index.d.ts +1 -0
- package/dist/api/iot/index.js +4 -2
- package/dist/api/iot/v1/api.gen.cjs +621 -0
- package/dist/api/iot/v1/api.gen.d.ts +325 -0
- package/dist/api/iot/v1/api.gen.js +350 -238
- package/dist/api/iot/v1/content.gen.cjs +4 -0
- package/dist/api/iot/v1/content.gen.d.ts +3 -0
- package/dist/api/iot/v1/content.gen.js +4 -7
- package/dist/api/iot/v1/index.gen.cjs +6 -0
- package/dist/api/iot/v1/index.gen.d.ts +3 -0
- package/dist/api/iot/v1/index.gen.js +6 -5
- package/dist/api/iot/v1/marshalling.gen.cjs +534 -0
- package/dist/api/iot/v1/marshalling.gen.d.ts +31 -0
- package/dist/api/iot/v1/marshalling.gen.js +209 -114
- package/dist/api/iot/v1/types.gen.d.ts +916 -0
- package/dist/api/ipam/index.cjs +4 -0
- package/dist/api/ipam/index.d.ts +1 -0
- package/dist/api/ipam/index.js +4 -2
- package/dist/api/ipam/v1/api.gen.cjs +115 -0
- package/dist/api/ipam/v1/api.gen.d.ts +57 -0
- package/dist/api/ipam/v1/api.gen.js +73 -55
- package/dist/api/ipam/v1/index.gen.cjs +6 -0
- package/dist/api/ipam/v1/index.gen.d.ts +3 -0
- package/dist/api/ipam/v1/index.gen.js +6 -6
- package/dist/api/ipam/v1/marshalling.gen.cjs +98 -0
- package/dist/api/ipam/v1/marshalling.gen.d.ts +6 -0
- package/dist/api/ipam/v1/marshalling.gen.js +35 -29
- package/dist/api/ipam/v1/types.gen.d.ts +198 -0
- package/dist/api/ipam/v1/validation-rules.gen.cjs +9 -0
- package/dist/api/ipam/v1/validation-rules.gen.d.ts +6 -0
- package/dist/api/ipam/v1/validation-rules.gen.js +3 -5
- package/dist/api/ipfs/index.cjs +4 -0
- package/dist/api/ipfs/index.d.ts +1 -0
- package/dist/api/ipfs/index.js +4 -2
- package/dist/api/ipfs/v1alpha1/api.gen.cjs +374 -0
- package/dist/api/ipfs/v1alpha1/api.gen.d.ts +198 -0
- package/dist/api/ipfs/v1alpha1/api.gen.js +210 -133
- package/dist/api/ipfs/v1alpha1/content.gen.cjs +6 -0
- package/dist/api/ipfs/v1alpha1/content.gen.d.ts +5 -0
- package/dist/api/ipfs/v1alpha1/content.gen.js +6 -10
- package/dist/api/ipfs/v1alpha1/index.gen.cjs +8 -0
- package/dist/api/ipfs/v1alpha1/index.gen.d.ts +3 -0
- package/dist/api/ipfs/v1alpha1/index.gen.js +8 -5
- package/dist/api/ipfs/v1alpha1/marshalling.gen.cjs +208 -0
- package/dist/api/ipfs/v1alpha1/marshalling.gen.d.ts +18 -0
- package/dist/api/ipfs/v1alpha1/marshalling.gen.js +68 -33
- package/dist/api/ipfs/v1alpha1/types.gen.d.ts +317 -0
- package/dist/api/jobs/index.cjs +4 -0
- package/dist/api/jobs/index.d.ts +1 -0
- package/dist/api/jobs/index.js +4 -2
- package/dist/api/jobs/v1alpha1/api.gen.cjs +170 -0
- package/dist/api/jobs/v1alpha1/api.gen.d.ts +80 -0
- package/dist/api/jobs/v1alpha1/api.gen.js +109 -69
- package/dist/api/jobs/v1alpha1/content.gen.cjs +8 -0
- package/dist/api/jobs/v1alpha1/content.gen.d.ts +3 -0
- package/dist/api/jobs/v1alpha1/content.gen.js +8 -7
- package/dist/api/jobs/v1alpha1/index.gen.cjs +8 -0
- package/dist/api/jobs/v1alpha1/index.gen.d.ts +4 -0
- package/dist/api/jobs/v1alpha1/index.gen.js +8 -7
- package/dist/api/jobs/v1alpha1/marshalling.gen.cjs +150 -0
- package/dist/api/jobs/v1alpha1/marshalling.gen.d.ts +10 -0
- package/dist/api/jobs/v1alpha1/marshalling.gen.js +50 -26
- package/dist/api/jobs/v1alpha1/types.gen.d.ts +210 -0
- package/dist/api/jobs/v1alpha1/validation-rules.gen.cjs +97 -0
- package/dist/api/jobs/v1alpha1/validation-rules.gen.d.ts +87 -0
- package/dist/api/jobs/v1alpha1/validation-rules.gen.js +12 -7
- package/dist/api/k8s/index.cjs +4 -0
- package/dist/api/k8s/index.d.ts +1 -0
- package/dist/api/k8s/index.js +4 -2
- package/dist/api/k8s/v1/api.gen.cjs +550 -0
- package/dist/api/k8s/v1/api.gen.d.ts +280 -0
- package/dist/api/k8s/v1/api.gen.js +317 -195
- package/dist/api/k8s/v1/api.utils.cjs +13 -0
- package/dist/api/k8s/v1/api.utils.d.ts +11 -0
- package/dist/api/k8s/v1/api.utils.js +5 -5
- package/dist/api/k8s/v1/content.gen.cjs +23 -0
- package/dist/api/k8s/v1/content.gen.d.ts +7 -0
- package/dist/api/k8s/v1/content.gen.js +23 -13
- package/dist/api/k8s/v1/index.cjs +10 -0
- package/dist/api/k8s/v1/index.d.ts +4 -0
- package/dist/api/k8s/v1/index.gen.d.ts +4 -0
- package/dist/api/k8s/v1/index.js +10 -4
- package/dist/api/k8s/v1/marshalling.gen.cjs +510 -0
- package/dist/api/k8s/v1/marshalling.gen.d.ts +22 -0
- package/dist/api/k8s/v1/marshalling.gen.js +158 -79
- package/dist/api/k8s/v1/types.gen.d.ts +1123 -0
- package/dist/api/k8s/v1/validation-rules.gen.cjs +110 -0
- package/dist/api/k8s/v1/validation-rules.gen.d.ts +96 -0
- package/dist/api/k8s/v1/validation-rules.gen.js +14 -5
- package/dist/api/lb/index.cjs +4 -0
- package/dist/api/lb/index.d.ts +1 -0
- package/dist/api/lb/index.js +4 -2
- package/dist/api/lb/v1/api.gen.cjs +1984 -0
- package/dist/api/lb/v1/api.gen.d.ts +990 -0
- package/dist/api/lb/v1/api.gen.js +1186 -695
- package/dist/api/lb/v1/api.utils.cjs +116 -0
- package/dist/api/lb/v1/api.utils.d.ts +41 -0
- package/dist/api/lb/v1/api.utils.js +83 -48
- package/dist/api/lb/v1/content.gen.cjs +22 -0
- package/dist/api/lb/v1/content.gen.d.ts +9 -0
- package/dist/api/lb/v1/content.gen.js +22 -16
- package/dist/api/lb/v1/index.cjs +10 -0
- package/dist/api/lb/v1/index.d.ts +4 -0
- package/dist/api/lb/v1/index.gen.d.ts +3 -0
- package/dist/api/lb/v1/index.js +10 -2
- package/dist/api/lb/v1/marshalling.gen.cjs +1289 -0
- package/dist/api/lb/v1/marshalling.gen.d.ts +73 -0
- package/dist/api/lb/v1/marshalling.gen.js +576 -334
- package/dist/api/lb/v1/types.gen.d.ts +2729 -0
- package/dist/api/lb/v1/types.utils.d.ts +13 -0
- package/dist/api/llm_inference/index.cjs +4 -0
- package/dist/api/llm_inference/index.d.ts +1 -0
- package/dist/api/llm_inference/index.js +4 -2
- package/dist/api/llm_inference/v1beta1/api.gen.cjs +305 -0
- package/dist/api/llm_inference/v1beta1/api.gen.d.ts +147 -0
- package/dist/api/llm_inference/v1beta1/api.gen.js +192 -120
- package/dist/api/llm_inference/v1beta1/content.gen.cjs +8 -0
- package/dist/api/llm_inference/v1beta1/content.gen.d.ts +3 -0
- package/dist/api/llm_inference/v1beta1/content.gen.js +8 -7
- package/dist/api/llm_inference/v1beta1/index.gen.cjs +8 -0
- package/dist/api/llm_inference/v1beta1/index.gen.d.ts +4 -0
- package/dist/api/llm_inference/v1beta1/index.gen.js +8 -7
- package/dist/api/llm_inference/v1beta1/marshalling.gen.cjs +271 -0
- package/dist/api/llm_inference/v1beta1/marshalling.gen.d.ts +18 -0
- package/dist/api/llm_inference/v1beta1/marshalling.gen.js +98 -52
- package/dist/api/llm_inference/v1beta1/types.gen.d.ts +433 -0
- package/dist/api/llm_inference/v1beta1/validation-rules.gen.cjs +56 -0
- package/dist/api/llm_inference/v1beta1/validation-rules.gen.d.ts +50 -0
- package/dist/api/llm_inference/v1beta1/validation-rules.gen.js +6 -5
- package/dist/api/marketplace/index.cjs +4 -0
- package/dist/api/marketplace/index.d.ts +1 -0
- package/dist/api/marketplace/index.js +4 -2
- package/dist/api/marketplace/v2/api.gen.cjs +174 -0
- package/dist/api/marketplace/v2/api.gen.d.ts +90 -0
- package/dist/api/marketplace/v2/api.gen.js +111 -67
- package/dist/api/marketplace/v2/index.gen.cjs +4 -0
- package/dist/api/marketplace/v2/index.gen.d.ts +2 -0
- package/dist/api/marketplace/v2/index.gen.js +4 -4
- package/dist/api/marketplace/v2/marshalling.gen.cjs +115 -0
- package/dist/api/marketplace/v2/marshalling.gen.d.ts +9 -0
- package/dist/api/marketplace/v2/marshalling.gen.js +44 -23
- package/dist/api/marketplace/v2/types.gen.d.ts +135 -0
- package/dist/api/mnq/index.cjs +4 -0
- package/dist/api/mnq/index.d.ts +1 -0
- package/dist/api/mnq/index.js +4 -2
- package/dist/api/mnq/v1beta1/api.gen.cjs +500 -0
- package/dist/api/mnq/v1beta1/api.gen.d.ts +265 -0
- package/dist/api/mnq/v1beta1/api.gen.js +291 -184
- package/dist/api/mnq/v1beta1/index.gen.cjs +8 -0
- package/dist/api/mnq/v1beta1/index.gen.d.ts +3 -0
- package/dist/api/mnq/v1beta1/index.gen.js +8 -6
- package/dist/api/mnq/v1beta1/marshalling.gen.cjs +268 -0
- package/dist/api/mnq/v1beta1/marshalling.gen.d.ts +23 -0
- package/dist/api/mnq/v1beta1/marshalling.gen.js +105 -49
- package/dist/api/mnq/v1beta1/types.gen.d.ts +449 -0
- package/dist/api/mnq/v1beta1/validation-rules.gen.cjs +85 -0
- package/dist/api/mnq/v1beta1/validation-rules.gen.d.ts +72 -0
- package/dist/api/mnq/v1beta1/validation-rules.gen.js +13 -5
- package/dist/api/rdb/index.cjs +4 -0
- package/dist/api/rdb/index.d.ts +1 -0
- package/dist/api/rdb/index.js +4 -2
- package/dist/api/rdb/v1/api.gen.cjs +1192 -0
- package/dist/api/rdb/v1/api.gen.d.ts +626 -0
- package/dist/api/rdb/v1/api.gen.js +660 -393
- package/dist/api/rdb/v1/content.gen.cjs +38 -0
- package/dist/api/rdb/v1/content.gen.d.ts +13 -0
- package/dist/api/rdb/v1/content.gen.js +38 -22
- package/dist/api/rdb/v1/index.gen.cjs +13 -0
- package/dist/api/rdb/v1/index.gen.d.ts +4 -0
- package/dist/api/rdb/v1/index.gen.js +13 -7
- package/dist/api/rdb/v1/marshalling.gen.cjs +908 -0
- package/dist/api/rdb/v1/marshalling.gen.d.ts +59 -0
- package/dist/api/rdb/v1/marshalling.gen.js +385 -191
- package/dist/api/rdb/v1/types.gen.d.ts +1404 -0
- package/dist/api/rdb/v1/validation-rules.gen.cjs +8 -0
- package/dist/api/rdb/v1/validation-rules.gen.d.ts +5 -0
- package/dist/api/rdb/v1/validation-rules.gen.js +3 -5
- package/dist/api/redis/index.cjs +4 -0
- package/dist/api/redis/index.d.ts +1 -0
- package/dist/api/redis/index.js +4 -2
- package/dist/api/redis/v1/api.gen.cjs +476 -0
- package/dist/api/redis/v1/api.gen.d.ts +249 -0
- package/dist/api/redis/v1/api.gen.js +265 -162
- package/dist/api/redis/v1/content.gen.cjs +10 -0
- package/dist/api/redis/v1/content.gen.d.ts +3 -0
- package/dist/api/redis/v1/content.gen.js +10 -7
- package/dist/api/redis/v1/index.gen.cjs +6 -0
- package/dist/api/redis/v1/index.gen.d.ts +3 -0
- package/dist/api/redis/v1/index.gen.js +6 -5
- package/dist/api/redis/v1/marshalling.gen.cjs +355 -0
- package/dist/api/redis/v1/marshalling.gen.d.ts +24 -0
- package/dist/api/redis/v1/marshalling.gen.js +156 -84
- package/dist/api/redis/v1/types.gen.d.ts +473 -0
- package/dist/api/registry/index.cjs +4 -0
- package/dist/api/registry/index.d.ts +1 -0
- package/dist/api/registry/index.js +4 -2
- package/dist/api/registry/v1/api.gen.cjs +287 -0
- package/dist/api/registry/v1/api.gen.d.ts +156 -0
- package/dist/api/registry/v1/api.gen.js +161 -94
- package/dist/api/registry/v1/content.gen.cjs +8 -0
- package/dist/api/registry/v1/content.gen.d.ts +7 -0
- package/dist/api/registry/v1/content.gen.js +8 -13
- package/dist/api/registry/v1/index.gen.cjs +8 -0
- package/dist/api/registry/v1/index.gen.d.ts +3 -0
- package/dist/api/registry/v1/index.gen.js +8 -5
- package/dist/api/registry/v1/marshalling.gen.cjs +129 -0
- package/dist/api/registry/v1/marshalling.gen.d.ts +11 -0
- package/dist/api/registry/v1/marshalling.gen.js +51 -30
- package/dist/api/registry/v1/types.gen.d.ts +300 -0
- package/dist/api/secret/index.cjs +6 -0
- package/dist/api/secret/index.d.ts +2 -0
- package/dist/api/secret/index.js +6 -4
- package/dist/api/secret/v1alpha1/api.gen.cjs +483 -0
- package/dist/api/secret/v1alpha1/api.gen.d.ts +261 -0
- package/dist/api/secret/v1alpha1/api.gen.js +271 -176
- package/dist/api/secret/v1alpha1/index.gen.cjs +4 -0
- package/dist/api/secret/v1alpha1/index.gen.d.ts +2 -0
- package/dist/api/secret/v1alpha1/index.gen.js +4 -4
- package/dist/api/secret/v1alpha1/marshalling.gen.cjs +221 -0
- package/dist/api/secret/v1alpha1/marshalling.gen.d.ts +19 -0
- package/dist/api/secret/v1alpha1/marshalling.gen.js +67 -33
- package/dist/api/secret/v1alpha1/types.gen.d.ts +619 -0
- package/dist/api/secret/v1beta1/api.gen.cjs +359 -0
- package/dist/api/secret/v1beta1/api.gen.d.ts +181 -0
- package/dist/api/secret/v1beta1/api.gen.js +213 -135
- package/dist/api/secret/v1beta1/index.gen.cjs +6 -0
- package/dist/api/secret/v1beta1/index.gen.d.ts +3 -0
- package/dist/api/secret/v1beta1/index.gen.js +6 -6
- package/dist/api/secret/v1beta1/marshalling.gen.cjs +219 -0
- package/dist/api/secret/v1beta1/marshalling.gen.d.ts +14 -0
- package/dist/api/secret/v1beta1/marshalling.gen.js +76 -40
- package/dist/api/secret/v1beta1/types.gen.d.ts +513 -0
- package/dist/api/secret/v1beta1/validation-rules.gen.cjs +8 -0
- package/dist/api/secret/v1beta1/validation-rules.gen.d.ts +5 -0
- package/dist/api/secret/v1beta1/validation-rules.gen.js +3 -5
- package/dist/api/serverless_sqldb/index.cjs +4 -0
- package/dist/api/serverless_sqldb/index.d.ts +1 -0
- package/dist/api/serverless_sqldb/index.js +4 -2
- package/dist/api/serverless_sqldb/v1alpha1/api.gen.cjs +202 -0
- package/dist/api/serverless_sqldb/v1alpha1/api.gen.d.ts +109 -0
- package/dist/api/serverless_sqldb/v1alpha1/api.gen.js +118 -78
- package/dist/api/serverless_sqldb/v1alpha1/content.gen.cjs +8 -0
- package/dist/api/serverless_sqldb/v1alpha1/content.gen.d.ts +3 -0
- package/dist/api/serverless_sqldb/v1alpha1/content.gen.js +8 -7
- package/dist/api/serverless_sqldb/v1alpha1/index.gen.cjs +8 -0
- package/dist/api/serverless_sqldb/v1alpha1/index.gen.d.ts +4 -0
- package/dist/api/serverless_sqldb/v1alpha1/index.gen.js +8 -7
- package/dist/api/serverless_sqldb/v1alpha1/marshalling.gen.cjs +89 -0
- package/dist/api/serverless_sqldb/v1alpha1/marshalling.gen.d.ts +9 -0
- package/dist/api/serverless_sqldb/v1alpha1/marshalling.gen.js +27 -15
- package/dist/api/serverless_sqldb/v1alpha1/types.gen.d.ts +193 -0
- package/dist/api/serverless_sqldb/v1alpha1/validation-rules.gen.cjs +62 -0
- package/dist/api/serverless_sqldb/v1alpha1/validation-rules.gen.d.ts +55 -0
- package/dist/api/serverless_sqldb/v1alpha1/validation-rules.gen.js +9 -7
- package/dist/api/std/index.gen.cjs +1 -0
- package/dist/api/std/index.gen.d.ts +1 -0
- package/dist/api/std/types.gen.d.ts +1 -0
- package/dist/api/tem/index.cjs +4 -0
- package/dist/api/tem/index.d.ts +1 -0
- package/dist/api/tem/index.js +4 -2
- package/dist/api/tem/v1alpha1/api.gen.cjs +260 -0
- package/dist/api/tem/v1alpha1/api.gen.d.ts +130 -0
- package/dist/api/tem/v1alpha1/api.gen.js +154 -89
- package/dist/api/tem/v1alpha1/content.gen.cjs +6 -0
- package/dist/api/tem/v1alpha1/content.gen.d.ts +5 -0
- package/dist/api/tem/v1alpha1/content.gen.js +6 -10
- package/dist/api/tem/v1alpha1/index.gen.cjs +7 -0
- package/dist/api/tem/v1alpha1/index.gen.d.ts +3 -0
- package/dist/api/tem/v1alpha1/index.gen.js +7 -5
- package/dist/api/tem/v1alpha1/marshalling.gen.cjs +255 -0
- package/dist/api/tem/v1alpha1/marshalling.gen.d.ts +11 -0
- package/dist/api/tem/v1alpha1/marshalling.gen.js +90 -50
- package/dist/api/tem/v1alpha1/types.gen.d.ts +401 -0
- package/dist/api/test/index.cjs +4 -0
- package/dist/api/test/index.d.ts +1 -0
- package/dist/api/test/index.js +4 -2
- package/dist/api/test/v1/api.gen.cjs +164 -0
- package/dist/api/test/v1/api.gen.d.ts +84 -0
- package/dist/api/test/v1/api.gen.js +99 -71
- package/dist/api/test/v1/content.gen.cjs +4 -0
- package/dist/api/test/v1/content.gen.d.ts +3 -0
- package/dist/api/test/v1/content.gen.js +4 -7
- package/dist/api/test/v1/index.gen.cjs +6 -0
- package/dist/api/test/v1/index.gen.d.ts +3 -0
- package/dist/api/test/v1/index.gen.js +6 -5
- package/dist/api/test/v1/marshalling.gen.cjs +93 -0
- package/dist/api/test/v1/marshalling.gen.d.ts +8 -0
- package/dist/api/test/v1/marshalling.gen.js +34 -22
- package/dist/api/test/v1/types.gen.d.ts +91 -0
- package/dist/api/vpc/index.cjs +6 -0
- package/dist/api/vpc/index.d.ts +2 -0
- package/dist/api/vpc/index.js +6 -4
- package/dist/api/vpc/v1/api.gen.cjs +119 -0
- package/dist/api/vpc/v1/api.gen.d.ts +54 -0
- package/dist/api/vpc/v1/api.gen.js +76 -43
- package/dist/api/vpc/v1/index.gen.cjs +4 -0
- package/dist/api/vpc/v1/index.gen.d.ts +2 -0
- package/dist/api/vpc/v1/index.gen.js +4 -4
- package/dist/api/vpc/v1/marshalling.gen.cjs +52 -0
- package/dist/api/vpc/v1/marshalling.gen.d.ts +6 -0
- package/dist/api/vpc/v1/marshalling.gen.js +22 -14
- package/dist/api/vpc/v1/types.gen.d.ts +99 -0
- package/dist/api/vpc/v2/api.gen.cjs +303 -0
- package/dist/api/vpc/v2/api.gen.d.ts +144 -0
- package/dist/api/vpc/v2/api.gen.js +181 -112
- package/dist/api/vpc/v2/index.gen.cjs +4 -0
- package/dist/api/vpc/v2/index.gen.d.ts +2 -0
- package/dist/api/vpc/v2/index.gen.js +4 -4
- package/dist/api/vpc/v2/marshalling.gen.cjs +173 -0
- package/dist/api/vpc/v2/marshalling.gen.d.ts +17 -0
- package/dist/api/vpc/v2/marshalling.gen.js +70 -36
- package/dist/api/vpc/v2/types.gen.d.ts +338 -0
- package/dist/api/vpcgw/index.cjs +4 -0
- package/dist/api/vpcgw/index.d.ts +1 -0
- package/dist/api/vpcgw/index.js +4 -2
- package/dist/api/vpcgw/v1/api.gen.cjs +740 -0
- package/dist/api/vpcgw/v1/api.gen.d.ts +389 -0
- package/dist/api/vpcgw/v1/api.gen.js +408 -239
- package/dist/api/vpcgw/v1/content.gen.cjs +15 -0
- package/dist/api/vpcgw/v1/content.gen.d.ts +5 -0
- package/dist/api/vpcgw/v1/content.gen.js +15 -10
- package/dist/api/vpcgw/v1/index.gen.cjs +7 -0
- package/dist/api/vpcgw/v1/index.gen.d.ts +3 -0
- package/dist/api/vpcgw/v1/index.gen.js +7 -5
- package/dist/api/vpcgw/v1/marshalling.gen.cjs +437 -0
- package/dist/api/vpcgw/v1/marshalling.gen.d.ts +31 -0
- package/dist/api/vpcgw/v1/marshalling.gen.js +145 -74
- package/dist/api/vpcgw/v1/types.gen.d.ts +901 -0
- package/dist/api/webhosting/index.cjs +4 -0
- package/dist/api/webhosting/index.d.ts +1 -0
- package/dist/api/webhosting/index.js +4 -2
- package/dist/api/webhosting/v1alpha1/api.gen.cjs +226 -0
- package/dist/api/webhosting/v1alpha1/api.gen.d.ts +111 -0
- package/dist/api/webhosting/v1alpha1/api.gen.js +138 -86
- package/dist/api/webhosting/v1alpha1/content.gen.cjs +8 -0
- package/dist/api/webhosting/v1alpha1/content.gen.d.ts +3 -0
- package/dist/api/webhosting/v1alpha1/content.gen.js +8 -7
- package/dist/api/webhosting/v1alpha1/index.gen.cjs +8 -0
- package/dist/api/webhosting/v1alpha1/index.gen.d.ts +4 -0
- package/dist/api/webhosting/v1alpha1/index.gen.js +8 -7
- package/dist/api/webhosting/v1alpha1/marshalling.gen.cjs +236 -0
- package/dist/api/webhosting/v1alpha1/marshalling.gen.d.ts +11 -0
- package/dist/api/webhosting/v1alpha1/marshalling.gen.js +80 -41
- package/dist/api/webhosting/v1alpha1/types.gen.d.ts +379 -0
- package/dist/api/webhosting/v1alpha1/validation-rules.gen.cjs +22 -0
- package/dist/api/webhosting/v1alpha1/validation-rules.gen.d.ts +18 -0
- package/dist/api/webhosting/v1alpha1/validation-rules.gen.js +4 -5
- package/dist/bridge.d.ts +11 -0
- package/dist/helpers/is-browser.cjs +7 -0
- package/dist/helpers/is-browser.d.ts +1 -0
- package/dist/helpers/is-browser.js +7 -5
- package/dist/helpers/is-response.cjs +4 -0
- package/dist/helpers/is-response.d.ts +8 -0
- package/dist/helpers/is-response.js +4 -10
- package/dist/helpers/json.cjs +7 -0
- package/dist/helpers/json.d.ts +13 -0
- package/dist/helpers/json.js +5 -9
- package/dist/helpers/marshalling.cjs +78 -0
- package/dist/helpers/marshalling.d.ts +63 -0
- package/dist/helpers/marshalling.js +40 -77
- package/dist/index.cjs +114 -32093
- package/dist/index.d.ts +15 -38464
- package/dist/index.js +115 -81
- package/dist/internal/async/interval-retrier.cjs +55 -0
- package/dist/internal/async/interval-retrier.d.ts +111 -0
- package/dist/internal/async/interval-retrier.js +30 -72
- package/dist/internal/async/sleep.cjs +6 -0
- package/dist/internal/async/sleep.d.ts +9 -0
- package/dist/internal/async/sleep.js +4 -11
- package/dist/internal/interceptors/composer.cjs +25 -0
- package/dist/internal/interceptors/composer.d.ts +25 -0
- package/dist/internal/interceptors/composer.js +15 -36
- package/dist/internal/interceptors/helpers.cjs +12 -0
- package/dist/internal/interceptors/helpers.d.ts +21 -0
- package/dist/internal/interceptors/helpers.js +7 -26
- package/dist/internal/interceptors/types.d.ts +89 -0
- package/dist/internal/logger/console-logger.cjs +24 -0
- package/dist/internal/logger/console-logger.d.ts +23 -0
- package/dist/internal/logger/console-logger.js +11 -19
- package/dist/internal/logger/index.cjs +12 -0
- package/dist/internal/logger/index.d.ts +25 -0
- package/dist/internal/logger/index.js +9 -30
- package/dist/internal/logger/level-resolver.cjs +13 -0
- package/dist/internal/logger/level-resolver.d.ts +9 -0
- package/dist/internal/logger/level-resolver.js +12 -12
- package/dist/internal/logger/logger.d.ts +13 -0
- package/dist/internal/validations/string-validation.cjs +30 -0
- package/dist/internal/validations/string-validation.d.ts +18 -0
- package/dist/internal/validations/string-validation.js +19 -27
- package/dist/internals.d.ts +10 -0
- package/dist/scw/api.cjs +8 -0
- package/dist/scw/api.d.ts +10 -0
- package/dist/scw/api.js +3 -7
- package/dist/scw/auth.cjs +28 -0
- package/dist/scw/auth.d.ts +57 -0
- package/dist/scw/auth.js +23 -62
- package/dist/scw/client-ini-factory.cjs +66 -0
- package/dist/scw/client-ini-factory.d.ts +111 -0
- package/dist/scw/client-ini-factory.js +33 -141
- package/dist/scw/client-ini-profile.cjs +23 -0
- package/dist/scw/client-ini-profile.d.ts +82 -0
- package/dist/scw/client-ini-profile.js +15 -46
- package/dist/scw/client-settings.cjs +51 -0
- package/dist/scw/client-settings.d.ts +59 -0
- package/dist/scw/client-settings.js +26 -53
- package/dist/scw/client.cjs +28 -0
- package/dist/scw/client.d.ts +72 -0
- package/dist/scw/client.js +14 -76
- package/dist/scw/constants.cjs +6 -0
- package/dist/scw/constants.d.ts +2 -0
- package/dist/scw/constants.js +5 -3
- package/dist/scw/custom-marshalling.cjs +92 -0
- package/dist/scw/custom-marshalling.d.ts +59 -0
- package/dist/scw/custom-marshalling.js +38 -77
- package/dist/scw/errors/error-parser.cjs +76 -0
- package/dist/scw/errors/error-parser.d.ts +12 -0
- package/dist/scw/errors/error-parser.js +33 -64
- package/dist/scw/errors/non-standard/invalid-request-mapper.cjs +36 -0
- package/dist/scw/errors/non-standard/invalid-request-mapper.d.ts +12 -0
- package/dist/scw/errors/non-standard/invalid-request-mapper.js +26 -23
- package/dist/scw/errors/non-standard/unknown-resource-mapper.cjs +23 -0
- package/dist/scw/errors/non-standard/unknown-resource-mapper.d.ts +11 -0
- package/dist/scw/errors/non-standard/unknown-resource-mapper.js +16 -20
- package/dist/scw/errors/scw-error.cjs +43 -0
- package/dist/scw/errors/scw-error.d.ts +25 -0
- package/dist/scw/errors/scw-error.js +19 -35
- package/dist/scw/errors/standard/already-exists-error.cjs +31 -0
- package/dist/scw/errors/standard/already-exists-error.d.ts +16 -0
- package/dist/scw/errors/standard/already-exists-error.js +18 -13
- package/dist/scw/errors/standard/denied-authentication-error.cjs +37 -0
- package/dist/scw/errors/standard/denied-authentication-error.d.ts +15 -0
- package/dist/scw/errors/standard/denied-authentication-error.js +9 -24
- package/dist/scw/errors/standard/index.cjs +28 -0
- package/dist/scw/errors/standard/index.d.ts +17 -0
- package/dist/scw/errors/standard/index.js +28 -13
- package/dist/scw/errors/standard/invalid-arguments-error.cjs +55 -0
- package/dist/scw/errors/standard/invalid-arguments-error.d.ts +24 -0
- package/dist/scw/errors/standard/invalid-arguments-error.js +26 -38
- package/dist/scw/errors/standard/out-of-stock-error.cjs +18 -0
- package/dist/scw/errors/standard/out-of-stock-error.d.ts +14 -0
- package/dist/scw/errors/standard/out-of-stock-error.js +7 -11
- package/dist/scw/errors/standard/permissions-denied-error.cjs +30 -0
- package/dist/scw/errors/standard/permissions-denied-error.d.ts +23 -0
- package/dist/scw/errors/standard/permissions-denied-error.js +20 -35
- package/dist/scw/errors/standard/precondition-failed-error.cjs +32 -0
- package/dist/scw/errors/standard/precondition-failed-error.d.ts +15 -0
- package/dist/scw/errors/standard/precondition-failed-error.js +14 -24
- package/dist/scw/errors/standard/quotas-exceeded-error.cjs +44 -0
- package/dist/scw/errors/standard/quotas-exceeded-error.d.ts +34 -0
- package/dist/scw/errors/standard/quotas-exceeded-error.js +29 -53
- package/dist/scw/errors/standard/resource-expired-error.cjs +31 -0
- package/dist/scw/errors/standard/resource-expired-error.d.ts +16 -0
- package/dist/scw/errors/standard/resource-expired-error.js +18 -13
- package/dist/scw/errors/standard/resource-locked-error.cjs +20 -0
- package/dist/scw/errors/standard/resource-locked-error.d.ts +15 -0
- package/dist/scw/errors/standard/resource-locked-error.js +6 -11
- package/dist/scw/errors/standard/resource-not-found-error.cjs +24 -0
- package/dist/scw/errors/standard/resource-not-found-error.d.ts +15 -0
- package/dist/scw/errors/standard/resource-not-found-error.js +11 -12
- package/dist/scw/errors/standard/too-many-requests-error.cjs +59 -0
- package/dist/scw/errors/standard/too-many-requests-error.d.ts +32 -0
- package/dist/scw/errors/standard/too-many-requests-error.js +20 -31
- package/dist/scw/errors/standard/transient-state-error.cjs +31 -0
- package/dist/scw/errors/standard/transient-state-error.d.ts +16 -0
- package/dist/scw/errors/standard/transient-state-error.js +18 -13
- package/dist/scw/errors/types.cjs +15 -0
- package/dist/scw/errors/types.d.ts +9 -0
- package/dist/scw/errors/types.js +6 -14
- package/dist/scw/fetch/build-fetcher.cjs +60 -0
- package/dist/scw/fetch/build-fetcher.d.ts +23 -0
- package/dist/scw/fetch/build-fetcher.js +29 -38
- package/dist/scw/fetch/http-dumper.cjs +20 -0
- package/dist/scw/fetch/http-dumper.d.ts +18 -0
- package/dist/scw/fetch/http-dumper.js +19 -50
- package/dist/scw/fetch/http-interceptors.cjs +43 -0
- package/dist/scw/fetch/http-interceptors.d.ts +38 -0
- package/dist/scw/fetch/http-interceptors.js +23 -66
- package/dist/scw/fetch/resource-paginator.cjs +37 -0
- package/dist/scw/fetch/resource-paginator.d.ts +47 -0
- package/dist/scw/fetch/resource-paginator.js +12 -45
- package/dist/scw/fetch/response-parser.cjs +57 -0
- package/dist/scw/fetch/response-parser.d.ts +25 -0
- package/dist/scw/fetch/response-parser.js +31 -46
- package/package.json +7 -3
- package/dist/node_modules/.pnpm/@scaleway_random-name@4.0.3/node_modules/@scaleway/random-name/dist/index.js +0 -11
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { RequestInterceptor, ResponseInterceptor } from '../../internal/interceptors/types';
|
|
2
|
+
/**
|
|
3
|
+
* Mapper of an header entry.
|
|
4
|
+
*
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
interface HeaderEntryMapper {
|
|
8
|
+
(entry: [string, string]): [string, string];
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Creates an interceptor to obfuscate the requests.
|
|
12
|
+
*
|
|
13
|
+
* @param obfuscate - The Header entries obfuscator mapper
|
|
14
|
+
* @returns The obfuscated Request
|
|
15
|
+
*
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
export declare const obfuscateInterceptor: (obfuscate: HeaderEntryMapper) => RequestInterceptor;
|
|
19
|
+
/**
|
|
20
|
+
* Creates an interceptor to log the requests.
|
|
21
|
+
*
|
|
22
|
+
* @param identifier - The request identifier
|
|
23
|
+
* @param obfuscate - The obfuscation interceptor
|
|
24
|
+
* @returns The interceptor
|
|
25
|
+
*
|
|
26
|
+
* @internal
|
|
27
|
+
*/
|
|
28
|
+
export declare const logRequest: (identifier: string, obfuscate?: RequestInterceptor) => RequestInterceptor;
|
|
29
|
+
/**
|
|
30
|
+
* Creates an interceptor to log the responses.
|
|
31
|
+
*
|
|
32
|
+
* @param identifier - The request identifier
|
|
33
|
+
* @returns The interceptor
|
|
34
|
+
*
|
|
35
|
+
* @internal
|
|
36
|
+
*/
|
|
37
|
+
export declare const logResponse: (identifier: string) => ResponseInterceptor;
|
|
38
|
+
export {};
|
|
@@ -1,18 +1,6 @@
|
|
|
1
|
-
import { getLogger } from
|
|
2
|
-
import { shouldLog, LevelResolver } from
|
|
3
|
-
import { dumpRequest, dumpResponse } from
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Mapper of an header entry.
|
|
7
|
-
*
|
|
8
|
-
* @internal
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* HTTP Request with obfuscated secrets.
|
|
13
|
-
*
|
|
14
|
-
* @internal
|
|
15
|
-
*/
|
|
1
|
+
import { getLogger } from "../../internal/logger/index.js";
|
|
2
|
+
import { shouldLog, LevelResolver } from "../../internal/logger/level-resolver.js";
|
|
3
|
+
import { dumpRequest, dumpResponse } from "./http-dumper.js";
|
|
16
4
|
class ObfuscatedRequest extends Request {
|
|
17
5
|
constructor(request, obfuscate) {
|
|
18
6
|
super(request);
|
|
@@ -26,61 +14,30 @@ class ObfuscatedRequest extends Request {
|
|
|
26
14
|
return new ObfuscatedRequest(this.request, this.obfuscate);
|
|
27
15
|
}
|
|
28
16
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const obfuscateInterceptor = obfuscate => ({
|
|
39
|
-
request
|
|
40
|
-
}) => new ObfuscatedRequest(request, obfuscate);
|
|
41
|
-
const identity = ({
|
|
42
|
-
request
|
|
43
|
-
}) => request;
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Creates an interceptor to log the requests.
|
|
47
|
-
*
|
|
48
|
-
* @param identifier - The request identifier
|
|
49
|
-
* @param obfuscate - The obfuscation interceptor
|
|
50
|
-
* @returns The interceptor
|
|
51
|
-
*
|
|
52
|
-
* @internal
|
|
53
|
-
*/
|
|
54
|
-
const logRequest = (identifier, obfuscate = identity) => async ({
|
|
55
|
-
request
|
|
56
|
-
}) => {
|
|
57
|
-
if (shouldLog(LevelResolver[getLogger().logLevel], 'debug')) {
|
|
58
|
-
getLogger().debug(`--------------- Scaleway SDK REQUEST ${identifier} ---------------
|
|
59
|
-
${await dumpRequest(await obfuscate({
|
|
60
|
-
request
|
|
61
|
-
}))}
|
|
62
|
-
---------------------------------------------------------`);
|
|
17
|
+
const obfuscateInterceptor = (obfuscate) => ({ request }) => new ObfuscatedRequest(request, obfuscate);
|
|
18
|
+
const identity = ({ request }) => request;
|
|
19
|
+
const logRequest = (identifier, obfuscate = identity) => async ({ request }) => {
|
|
20
|
+
if (shouldLog(LevelResolver[getLogger().logLevel], "debug")) {
|
|
21
|
+
getLogger().debug(
|
|
22
|
+
`--------------- Scaleway SDK REQUEST ${identifier} ---------------
|
|
23
|
+
${await dumpRequest(await obfuscate({ request }))}
|
|
24
|
+
---------------------------------------------------------`
|
|
25
|
+
);
|
|
63
26
|
}
|
|
64
27
|
return request;
|
|
65
28
|
};
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
* @param identifier - The request identifier
|
|
71
|
-
* @returns The interceptor
|
|
72
|
-
*
|
|
73
|
-
* @internal
|
|
74
|
-
*/
|
|
75
|
-
const logResponse = identifier => async ({
|
|
76
|
-
response
|
|
77
|
-
}) => {
|
|
78
|
-
if (shouldLog(LevelResolver[getLogger().logLevel], 'debug')) {
|
|
79
|
-
getLogger().debug(`--------------- Scaleway SDK RESPONSE ${identifier} ---------------
|
|
29
|
+
const logResponse = (identifier) => async ({ response }) => {
|
|
30
|
+
if (shouldLog(LevelResolver[getLogger().logLevel], "debug")) {
|
|
31
|
+
getLogger().debug(
|
|
32
|
+
`--------------- Scaleway SDK RESPONSE ${identifier} ---------------
|
|
80
33
|
${await dumpResponse(response)}
|
|
81
|
-
---------------------------------------------------------`
|
|
34
|
+
---------------------------------------------------------`
|
|
35
|
+
);
|
|
82
36
|
}
|
|
83
37
|
return response;
|
|
84
38
|
};
|
|
85
|
-
|
|
86
|
-
|
|
39
|
+
export {
|
|
40
|
+
logRequest,
|
|
41
|
+
logResponse,
|
|
42
|
+
obfuscateInterceptor
|
|
43
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const extract = (key) => (result) => result[key];
|
|
4
|
+
function* pages(key, fetcher, request, firstPage) {
|
|
5
|
+
if (!Array.isArray(firstPage[key])) {
|
|
6
|
+
throw new Error(`Property ${key} is not a list in paginated result`);
|
|
7
|
+
}
|
|
8
|
+
const getList = extract(key);
|
|
9
|
+
let page = request.page || 1;
|
|
10
|
+
if (page === 1) {
|
|
11
|
+
yield Promise.resolve(getList(firstPage));
|
|
12
|
+
page += 1;
|
|
13
|
+
}
|
|
14
|
+
const { length } = firstPage[key];
|
|
15
|
+
if (!length)
|
|
16
|
+
return;
|
|
17
|
+
const { totalCount } = firstPage;
|
|
18
|
+
while (page <= Math.floor((totalCount + length - 1) / length)) {
|
|
19
|
+
yield fetcher({ ...request, page }).then(getList);
|
|
20
|
+
page += 1;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
async function* fetchPaginated(key, fetcher, request, initial = fetcher(request)) {
|
|
24
|
+
yield* pages(key, fetcher, request, await initial);
|
|
25
|
+
}
|
|
26
|
+
const fetchAll = async (key, fetcher, request, initial = fetcher(request)) => (await Promise.all(Array.from(pages(key, fetcher, request, await initial)))).flat();
|
|
27
|
+
const enrichForPagination = (key, fetcher, request) => {
|
|
28
|
+
const firstPage = fetcher(request);
|
|
29
|
+
return Object.assign(firstPage, {
|
|
30
|
+
all: () => fetchAll(key, fetcher, request, firstPage),
|
|
31
|
+
[Symbol.asyncIterator]: () => fetchPaginated(key, fetcher, request, firstPage)
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
exports.enrichForPagination = enrichForPagination;
|
|
35
|
+
exports.extract = extract;
|
|
36
|
+
exports.fetchAll = fetchAll;
|
|
37
|
+
exports.fetchPaginated = fetchPaginated;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
interface PaginationOptions {
|
|
2
|
+
page?: number;
|
|
3
|
+
pageSize?: number;
|
|
4
|
+
}
|
|
5
|
+
interface PaginatedResponse {
|
|
6
|
+
totalCount: number;
|
|
7
|
+
}
|
|
8
|
+
export type PaginatedFetcher<T, R extends PaginationOptions = PaginationOptions> = (request: R) => Promise<T>;
|
|
9
|
+
export type PaginatedContent<K extends string, T = unknown> = PaginatedResponse & {
|
|
10
|
+
[key in K]: T[];
|
|
11
|
+
};
|
|
12
|
+
export declare const extract: <K extends string>(key: K) => <T extends PaginatedContent<K, unknown>>(result: T) => T[K];
|
|
13
|
+
/**
|
|
14
|
+
* Fetches a paginated resource.
|
|
15
|
+
*
|
|
16
|
+
* @param key - The resource key of values list
|
|
17
|
+
* @param fetcher - The method to retrieve paginated resources
|
|
18
|
+
* @param request - A request with pagination options
|
|
19
|
+
* @param initial - The first page
|
|
20
|
+
* @returns An async generator of resources arrays
|
|
21
|
+
*/
|
|
22
|
+
export declare function fetchPaginated<K extends string, T extends PaginatedContent<K>, R extends PaginationOptions>(key: K, fetcher: PaginatedFetcher<T, R>, request: R, initial?: Promise<T>): AsyncGenerator<T[K], void, void>;
|
|
23
|
+
/**
|
|
24
|
+
* Fetches all paginated resource.
|
|
25
|
+
*
|
|
26
|
+
* @param key - The resource key of values list
|
|
27
|
+
* @param fetcher - The method to retrieve paginated resources
|
|
28
|
+
* @param request - A request with pagination options
|
|
29
|
+
* @param initial - The first page
|
|
30
|
+
* @returns A resources array Promise
|
|
31
|
+
*/
|
|
32
|
+
export declare const fetchAll: <K extends string, T extends PaginatedContent<K, unknown>, R extends PaginationOptions>(key: K, fetcher: PaginatedFetcher<T, R>, request: R, initial?: Promise<T>) => Promise<(Awaited<T[K]> extends infer T_1 ? T_1 extends Awaited<T[K]> ? T_1 extends readonly (infer InnerArr)[] ? InnerArr : T_1 : never : never)[]>;
|
|
33
|
+
/**
|
|
34
|
+
* Enriches a listing method with helpers.
|
|
35
|
+
*
|
|
36
|
+
* @param key - The resource key of values list
|
|
37
|
+
* @param fetcher - The method to retrieve paginated resources
|
|
38
|
+
* @param request - A request with pagination options
|
|
39
|
+
* @returns A resource Promise with the pagination helpers
|
|
40
|
+
*
|
|
41
|
+
* @internal
|
|
42
|
+
*/
|
|
43
|
+
export declare const enrichForPagination: <K extends string, T extends PaginatedContent<K, unknown>, R extends PaginationOptions>(key: K, fetcher: PaginatedFetcher<T, R>, request: R) => Promise<T> & {
|
|
44
|
+
all: () => Promise<(Awaited<T[K]> extends infer T_1 ? T_1 extends Awaited<T[K]> ? T_1 extends readonly (infer InnerArr)[] ? InnerArr : T_1 : never : never)[]>;
|
|
45
|
+
[Symbol.asyncIterator]: () => AsyncGenerator<T[K], void, void>;
|
|
46
|
+
};
|
|
47
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const extract = key => result => result[key];
|
|
1
|
+
const extract = (key) => (result) => result[key];
|
|
2
2
|
function* pages(key, fetcher, request, firstPage) {
|
|
3
3
|
if (!Array.isArray(firstPage[key])) {
|
|
4
4
|
throw new Error(`Property ${key} is not a list in paginated result`);
|
|
@@ -9,56 +9,19 @@ function* pages(key, fetcher, request, firstPage) {
|
|
|
9
9
|
yield Promise.resolve(getList(firstPage));
|
|
10
10
|
page += 1;
|
|
11
11
|
}
|
|
12
|
-
const {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const {
|
|
17
|
-
totalCount
|
|
18
|
-
} = firstPage;
|
|
12
|
+
const { length } = firstPage[key];
|
|
13
|
+
if (!length)
|
|
14
|
+
return;
|
|
15
|
+
const { totalCount } = firstPage;
|
|
19
16
|
while (page <= Math.floor((totalCount + length - 1) / length)) {
|
|
20
|
-
yield fetcher({
|
|
21
|
-
...request,
|
|
22
|
-
page
|
|
23
|
-
}).then(getList);
|
|
17
|
+
yield fetcher({ ...request, page }).then(getList);
|
|
24
18
|
page += 1;
|
|
25
19
|
}
|
|
26
20
|
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Fetches a paginated resource.
|
|
30
|
-
*
|
|
31
|
-
* @param key - The resource key of values list
|
|
32
|
-
* @param fetcher - The method to retrieve paginated resources
|
|
33
|
-
* @param request - A request with pagination options
|
|
34
|
-
* @param initial - The first page
|
|
35
|
-
* @returns An async generator of resources arrays
|
|
36
|
-
*/
|
|
37
21
|
async function* fetchPaginated(key, fetcher, request, initial = fetcher(request)) {
|
|
38
22
|
yield* pages(key, fetcher, request, await initial);
|
|
39
23
|
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Fetches all paginated resource.
|
|
43
|
-
*
|
|
44
|
-
* @param key - The resource key of values list
|
|
45
|
-
* @param fetcher - The method to retrieve paginated resources
|
|
46
|
-
* @param request - A request with pagination options
|
|
47
|
-
* @param initial - The first page
|
|
48
|
-
* @returns A resources array Promise
|
|
49
|
-
*/
|
|
50
24
|
const fetchAll = async (key, fetcher, request, initial = fetcher(request)) => (await Promise.all(Array.from(pages(key, fetcher, request, await initial)))).flat();
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Enriches a listing method with helpers.
|
|
54
|
-
*
|
|
55
|
-
* @param key - The resource key of values list
|
|
56
|
-
* @param fetcher - The method to retrieve paginated resources
|
|
57
|
-
* @param request - A request with pagination options
|
|
58
|
-
* @returns A resource Promise with the pagination helpers
|
|
59
|
-
*
|
|
60
|
-
* @internal
|
|
61
|
-
*/
|
|
62
25
|
const enrichForPagination = (key, fetcher, request) => {
|
|
63
26
|
const firstPage = fetcher(request);
|
|
64
27
|
return Object.assign(firstPage, {
|
|
@@ -66,5 +29,9 @@ const enrichForPagination = (key, fetcher, request) => {
|
|
|
66
29
|
[Symbol.asyncIterator]: () => fetchPaginated(key, fetcher, request, firstPage)
|
|
67
30
|
});
|
|
68
31
|
};
|
|
69
|
-
|
|
70
|
-
|
|
32
|
+
export {
|
|
33
|
+
enrichForPagination,
|
|
34
|
+
extract,
|
|
35
|
+
fetchAll,
|
|
36
|
+
fetchPaginated
|
|
37
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const isResponse = require("../../helpers/is-response.cjs");
|
|
4
|
+
const json = require("../../helpers/json.cjs");
|
|
5
|
+
const errorParser = require("../errors/error-parser.cjs");
|
|
6
|
+
const scwError = require("../errors/scw-error.cjs");
|
|
7
|
+
const X_TOTAL_COUNT_HEADER_KEY = "x-total-count";
|
|
8
|
+
const TOTAL_COUNT_RES_KEY = "total_count";
|
|
9
|
+
const fixLegacyTotalCount = (obj, headers) => {
|
|
10
|
+
const headerVal = headers.get(X_TOTAL_COUNT_HEADER_KEY);
|
|
11
|
+
if (!headerVal) {
|
|
12
|
+
return obj;
|
|
13
|
+
}
|
|
14
|
+
const totalCount = parseInt(headerVal, 10);
|
|
15
|
+
if (Number.isNaN(totalCount)) {
|
|
16
|
+
return obj;
|
|
17
|
+
}
|
|
18
|
+
if (json.isJSONObject(obj) && !(TOTAL_COUNT_RES_KEY in obj)) {
|
|
19
|
+
return Object.assign(obj, { [TOTAL_COUNT_RES_KEY]: totalCount });
|
|
20
|
+
}
|
|
21
|
+
return obj;
|
|
22
|
+
};
|
|
23
|
+
const responseParser = (unmarshaller, responseType) => async (response) => {
|
|
24
|
+
if (!isResponse.isResponse(response)) {
|
|
25
|
+
throw new TypeError("Invalid response object");
|
|
26
|
+
}
|
|
27
|
+
if (response.ok) {
|
|
28
|
+
if (response.status === 204)
|
|
29
|
+
return unmarshaller(void 0);
|
|
30
|
+
const contentType = response.headers.get("Content-Type");
|
|
31
|
+
try {
|
|
32
|
+
if (responseType === "json" && contentType === "application/json") {
|
|
33
|
+
return unmarshaller(
|
|
34
|
+
fixLegacyTotalCount(await response.json(), response.headers)
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
if (responseType === "blob") {
|
|
38
|
+
return unmarshaller(await response.blob());
|
|
39
|
+
}
|
|
40
|
+
return unmarshaller(await response.text());
|
|
41
|
+
} catch (err) {
|
|
42
|
+
throw new scwError.ScalewayError(
|
|
43
|
+
response.status,
|
|
44
|
+
`could not parse '${contentType ?? ""}' response${err instanceof Error ? `: ${err.message}` : ""}`
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
const error = await response.clone().json().catch(() => response.text());
|
|
49
|
+
if (json.isJSONObject(error))
|
|
50
|
+
throw errorParser.parseScalewayError(response.status, error);
|
|
51
|
+
throw new scwError.ScalewayError(
|
|
52
|
+
response.status,
|
|
53
|
+
typeof error === "string" ? error : "cannot read error response body"
|
|
54
|
+
);
|
|
55
|
+
};
|
|
56
|
+
exports.fixLegacyTotalCount = fixLegacyTotalCount;
|
|
57
|
+
exports.responseParser = responseParser;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ResponseUnmarshaller } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Fixes the totalCount property for old APIs.
|
|
4
|
+
*
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export declare const fixLegacyTotalCount: <T>(obj: T, headers: Headers) => T;
|
|
8
|
+
/**
|
|
9
|
+
* Makes response parser.
|
|
10
|
+
*
|
|
11
|
+
* @param unmarshaller - The response payload unmarshaller
|
|
12
|
+
* @returns An async converter of HTTP Response to desired result
|
|
13
|
+
*
|
|
14
|
+
* @throws {@link ScalewayError}
|
|
15
|
+
* Thrown by the API if the request couldn't be completed.
|
|
16
|
+
*
|
|
17
|
+
* @throws TypeError
|
|
18
|
+
* Thrown if the response parameter isn't of the expected type.
|
|
19
|
+
*
|
|
20
|
+
* @throws Error
|
|
21
|
+
* JSON parsing could trigger an error.
|
|
22
|
+
*
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
25
|
+
export declare const responseParser: <T>(unmarshaller: ResponseUnmarshaller<T>, responseType: 'json' | 'text' | 'blob') => (response: Response) => Promise<T>;
|
|
@@ -1,16 +1,9 @@
|
|
|
1
|
-
import { isResponse } from
|
|
2
|
-
import { isJSONObject } from
|
|
3
|
-
import { parseScalewayError } from
|
|
4
|
-
import { ScalewayError } from
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
const TOTAL_COUNT_RES_KEY = 'total_count';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Fixes the totalCount property for old APIs.
|
|
11
|
-
*
|
|
12
|
-
* @internal
|
|
13
|
-
*/
|
|
1
|
+
import { isResponse } from "../../helpers/is-response.js";
|
|
2
|
+
import { isJSONObject } from "../../helpers/json.js";
|
|
3
|
+
import { parseScalewayError } from "../errors/error-parser.js";
|
|
4
|
+
import { ScalewayError } from "../errors/scw-error.js";
|
|
5
|
+
const X_TOTAL_COUNT_HEADER_KEY = "x-total-count";
|
|
6
|
+
const TOTAL_COUNT_RES_KEY = "total_count";
|
|
14
7
|
const fixLegacyTotalCount = (obj, headers) => {
|
|
15
8
|
const headerVal = headers.get(X_TOTAL_COUNT_HEADER_KEY);
|
|
16
9
|
if (!headerVal) {
|
|
@@ -21,52 +14,44 @@ const fixLegacyTotalCount = (obj, headers) => {
|
|
|
21
14
|
return obj;
|
|
22
15
|
}
|
|
23
16
|
if (isJSONObject(obj) && !(TOTAL_COUNT_RES_KEY in obj)) {
|
|
24
|
-
return Object.assign(obj, {
|
|
25
|
-
[TOTAL_COUNT_RES_KEY]: totalCount
|
|
26
|
-
});
|
|
17
|
+
return Object.assign(obj, { [TOTAL_COUNT_RES_KEY]: totalCount });
|
|
27
18
|
}
|
|
28
19
|
return obj;
|
|
29
20
|
};
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Makes response parser.
|
|
33
|
-
*
|
|
34
|
-
* @param unmarshaller - The response payload unmarshaller
|
|
35
|
-
* @returns An async converter of HTTP Response to desired result
|
|
36
|
-
*
|
|
37
|
-
* @throws {@link ScalewayError}
|
|
38
|
-
* Thrown by the API if the request couldn't be completed.
|
|
39
|
-
*
|
|
40
|
-
* @throws TypeError
|
|
41
|
-
* Thrown if the response parameter isn't of the expected type.
|
|
42
|
-
*
|
|
43
|
-
* @throws Error
|
|
44
|
-
* JSON parsing could trigger an error.
|
|
45
|
-
*
|
|
46
|
-
* @internal
|
|
47
|
-
*/
|
|
48
|
-
const responseParser = (unmarshaller, responseType) => async response => {
|
|
21
|
+
const responseParser = (unmarshaller, responseType) => async (response) => {
|
|
49
22
|
if (!isResponse(response)) {
|
|
50
|
-
throw new TypeError(
|
|
23
|
+
throw new TypeError("Invalid response object");
|
|
51
24
|
}
|
|
52
25
|
if (response.ok) {
|
|
53
|
-
if (response.status === 204)
|
|
54
|
-
|
|
26
|
+
if (response.status === 204)
|
|
27
|
+
return unmarshaller(void 0);
|
|
28
|
+
const contentType = response.headers.get("Content-Type");
|
|
55
29
|
try {
|
|
56
|
-
if (responseType ===
|
|
57
|
-
return unmarshaller(
|
|
30
|
+
if (responseType === "json" && contentType === "application/json") {
|
|
31
|
+
return unmarshaller(
|
|
32
|
+
fixLegacyTotalCount(await response.json(), response.headers)
|
|
33
|
+
);
|
|
58
34
|
}
|
|
59
|
-
if (responseType ===
|
|
35
|
+
if (responseType === "blob") {
|
|
60
36
|
return unmarshaller(await response.blob());
|
|
61
37
|
}
|
|
62
38
|
return unmarshaller(await response.text());
|
|
63
39
|
} catch (err) {
|
|
64
|
-
throw new ScalewayError(
|
|
40
|
+
throw new ScalewayError(
|
|
41
|
+
response.status,
|
|
42
|
+
`could not parse '${contentType ?? ""}' response${err instanceof Error ? `: ${err.message}` : ""}`
|
|
43
|
+
);
|
|
65
44
|
}
|
|
66
45
|
}
|
|
67
46
|
const error = await response.clone().json().catch(() => response.text());
|
|
68
|
-
if (isJSONObject(error))
|
|
69
|
-
|
|
47
|
+
if (isJSONObject(error))
|
|
48
|
+
throw parseScalewayError(response.status, error);
|
|
49
|
+
throw new ScalewayError(
|
|
50
|
+
response.status,
|
|
51
|
+
typeof error === "string" ? error : "cannot read error response body"
|
|
52
|
+
);
|
|
53
|
+
};
|
|
54
|
+
export {
|
|
55
|
+
fixLegacyTotalCount,
|
|
56
|
+
responseParser
|
|
70
57
|
};
|
|
71
|
-
|
|
72
|
-
export { fixLegacyTotalCount, responseParser };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scaleway/sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.27.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Scaleway SDK.",
|
|
6
6
|
"keywords": [
|
|
@@ -12,7 +12,11 @@
|
|
|
12
12
|
"module": "dist/index.js",
|
|
13
13
|
"types": "dist/index.d.ts",
|
|
14
14
|
"scripts": {
|
|
15
|
-
"version": "./scripts/update-constants-file.sh"
|
|
15
|
+
"version": "./scripts/update-constants-file.sh",
|
|
16
|
+
"typecheck": "tsc --noEmit",
|
|
17
|
+
"type:generate": "tsc --declaration -p tsconfig.build.json",
|
|
18
|
+
"build": "vite build --config ../../vite.config.ts && pnpm run type:generate",
|
|
19
|
+
"build:profile": "npx vite-bundle-visualizer -c ../../vite.config.ts"
|
|
16
20
|
},
|
|
17
21
|
"files": [
|
|
18
22
|
"dist"
|
|
@@ -35,5 +39,5 @@
|
|
|
35
39
|
"bundledDependencies": [
|
|
36
40
|
"@scaleway/random-name"
|
|
37
41
|
],
|
|
38
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "454991493a602594b9a252adc2329bd3a25f5023"
|
|
39
43
|
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
const ADJECTIVES = ['admiring', 'adoring', 'affectionate', 'agitated', 'amazing', 'angry', 'awesome', 'beautiful', 'blissful', 'bold', 'boring', 'brave', 'busy', 'charming', 'clever', 'cool', 'compassionate', 'competent', 'condescending', 'confident', 'cranky', 'crazy', 'dazzling', 'determined', 'distracted', 'dreamy', 'eager', 'ecstatic', 'elastic', 'elated', 'elegant', 'eloquent', 'epic', 'exciting', 'fervent', 'festive', 'flamboyant', 'focused', 'friendly', 'frosty', 'funny', 'gallant', 'gifted', 'goofy', 'gracious', 'great', 'happy', 'hardcore', 'heuristic', 'hopeful', 'hungry', 'infallible', 'inspiring', 'interesting', 'intelligent', 'jolly', 'jovial', 'keen', 'kind', 'laughing', 'loving', 'lucid', 'magical', 'mystifying', 'modest', 'musing', 'naughty', 'nervous', 'nice', 'nifty', 'nostalgic', 'objective', 'optimistic', 'peaceful', 'pedantic', 'pensive', 'practical', 'priceless', 'quirky', 'quizzical', 'recursing', 'relaxed', 'reverent', 'romantic', 'sad', 'serene', 'sharp', 'silly', 'sleepy', 'stoic', 'strange', 'stupefied', 'suspicious', 'sweet', 'tender', 'thirsty', 'trusting', 'unruffled', 'upbeat', 'vibrant', 'vigilant', 'vigorous', 'wizardly', 'wonderful', 'xenodochial', 'youthful', 'zealous', 'zen'];
|
|
2
|
-
const NAMES = ['albattani', 'allen', 'almeida', 'antonelli', 'agnesi', 'archimedes', 'ardinghelli', 'aryabhata', 'austin', 'babbage', 'banach', 'banzai', 'bardeen', 'bartik', 'bassi', 'beaver', 'bell', 'benz', 'bhabha', 'bhaskara', 'black', 'blackburn', 'blackwell', 'bohr', 'booth', 'borg', 'bose', 'bouman', 'boyd', 'brahmagupta', 'brattain', 'brown', 'buck', 'burnell', 'cannon', 'carson', 'cartwright', 'carver', 'cerf', 'chandrasekhar', 'chaplygin', 'chatelet', 'chatterjee', 'chebyshev', 'cohen', 'chaum', 'clarke', 'colden', 'cori', 'cray', 'curran', 'curie', 'darwin', 'davinci', 'dewdney', 'dhawan', 'diffie', 'dijkstra', 'dirac', 'driscoll', 'dubinsky', 'easley', 'edison', 'einstein', 'elbakyan', 'elgamal', 'elion', 'ellis', 'engelbart', 'euclid', 'euler', 'faraday', 'feistel', 'fermat', 'fermi', 'feynman', 'franklin', 'gagarin', 'galileo', 'galois', 'ganguly', 'gates', 'gauss', 'germain', 'goldberg', 'goldstine', 'goldwasser', 'golick', 'goodall', 'gould', 'greider', 'grothendieck', 'haibt', 'hamilton', 'haslett', 'hawking', 'hellman', 'heisenberg', 'hermann', 'herschel', 'hertz', 'heyrovsky', 'hodgkin', 'hofstadter', 'hoover', 'hopper', 'hugle', 'hypatia', 'ishizaka', 'jackson', 'jang', 'jemison', 'jennings', 'jepsen', 'johnson', 'joliot', 'jones', 'kalam', 'kapitsa', 'kare', 'keldysh', 'keller', 'kepler', 'khayyam', 'khorana', 'kilby', 'kirch', 'knuth', 'kowalevski', 'lalande', 'lamarr', 'lamport', 'leakey', 'leavitt', 'lederberg', 'lehmann', 'lewin', 'lichterman', 'liskov', 'lovelace', 'lumiere', 'mahavira', 'margulis', 'matsumoto', 'maxwell', 'mayer', 'mccarthy', 'mcclintock', 'mclaren', 'mclean', 'mcnulty', 'mendel', 'mendeleev', 'meitner', 'meninsky', 'merkle', 'mestorf', 'mirzakhani', 'montalcini', 'moore', 'morse', 'murdock', 'moser', 'napier', 'nash', 'neumann', 'newton', 'niel', 'nightingale', 'nobel', 'noether', 'northcutt', 'noyce', 'panini', 'pare', 'pascal', 'pasteur', 'payne', 'perlman', 'pike', 'poincare', 'poitras', 'proskuriakova', 'ptolemy', 'raman', 'ramanujan', 'ride', 'ritchie', 'rhodes', 'robinson', 'roentgen', 'rosalind', 'rubin', 'saha', 'sammet', 'sanderson', 'satoshi', 'shamir', 'shannon', 'shaw', 'shirley', 'shockley', 'shtern', 'sinoussi', 'snyder', 'solomon', 'spence', 'stonebraker', 'sutherland', 'swanson', 'swartz', 'swirles', 'taussig', 'tereshkova', 'tesla', 'tharp', 'thompson', 'torvalds', 'tu', 'turing', 'varahamihira', 'vaughan', 'visvesvaraya', 'volhard', 'villani', 'wescoff', 'wilbur', 'wiles', 'williams', 'williamson', 'wilson', 'wing', 'wozniak', 'wright', 'wu', 'yalow', 'yonath', 'zhukovsky'];
|
|
3
|
-
const randomName = (prefix = '', separator = '-') => {
|
|
4
|
-
const name = `${ADJECTIVES[Math.floor(Math.random() * ADJECTIVES.length)] ?? ''}${separator}${NAMES[Math.floor(Math.random() * NAMES.length)] ?? ''}`;
|
|
5
|
-
if (name === `boring${separator}wozniak`) {
|
|
6
|
-
return randomName(prefix, separator);
|
|
7
|
-
}
|
|
8
|
-
return prefix.length > 0 ? `${prefix}${separator}${name}` : name;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export { randomName as default };
|