@scaleway/sdk 2.25.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 +65 -31
- 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 +763 -445
- 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 +324 -188
- 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 +145 -75
- 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 +92 -37
- 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 -32034
- package/dist/index.d.ts +15 -38373
- 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,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const json = require("../../../helpers/json.cjs");
|
|
4
|
+
const scwError = require("../scw-error.cjs");
|
|
5
|
+
const buildMessage = (helpMessage, limit, resetSeconds, resetAt) => {
|
|
6
|
+
const details = [];
|
|
7
|
+
if (limit) {
|
|
8
|
+
if (limit.windowSeconds) {
|
|
9
|
+
details.push(`quota is ${limit.quota} for ${limit.windowSeconds}s`);
|
|
10
|
+
} else {
|
|
11
|
+
details.push(`quota is ${limit.quota}`);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
if (resetSeconds) {
|
|
15
|
+
details.push(`resets in ${resetSeconds}s`);
|
|
16
|
+
} else if (resetAt) {
|
|
17
|
+
details.push(`resets at ${resetAt.toISOString()}`);
|
|
18
|
+
}
|
|
19
|
+
let output = `too many requests`;
|
|
20
|
+
if (details.length > 0) {
|
|
21
|
+
output += ` (${details.join(", ")})`;
|
|
22
|
+
}
|
|
23
|
+
if (helpMessage.length > 0) {
|
|
24
|
+
output += `: ${helpMessage}`;
|
|
25
|
+
}
|
|
26
|
+
return output;
|
|
27
|
+
};
|
|
28
|
+
class TooManyRequestsError extends scwError.ScalewayError {
|
|
29
|
+
constructor(status, body, helpMessage, limit, resetSeconds, resetAt) {
|
|
30
|
+
super(status, body, buildMessage(helpMessage, limit, resetSeconds, resetAt));
|
|
31
|
+
this.status = status;
|
|
32
|
+
this.body = body;
|
|
33
|
+
this.helpMessage = helpMessage;
|
|
34
|
+
this.limit = limit;
|
|
35
|
+
this.resetSeconds = resetSeconds;
|
|
36
|
+
this.resetAt = resetAt;
|
|
37
|
+
this.name = "TooManyRequestsError";
|
|
38
|
+
}
|
|
39
|
+
static fromJSON(status, obj) {
|
|
40
|
+
if (typeof obj.help_message !== "string")
|
|
41
|
+
return null;
|
|
42
|
+
let limit;
|
|
43
|
+
if (json.isJSONObject(obj.limit) && typeof obj.limit.quota === "number") {
|
|
44
|
+
limit = {
|
|
45
|
+
quota: obj.limit.quota,
|
|
46
|
+
windowSeconds: typeof obj.limit.window_seconds === "number" ? obj.limit.window_seconds : void 0
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
return new TooManyRequestsError(
|
|
50
|
+
status,
|
|
51
|
+
obj,
|
|
52
|
+
obj.help_message,
|
|
53
|
+
limit,
|
|
54
|
+
typeof obj.reset_seconds === "number" ? obj.reset_seconds : void 0,
|
|
55
|
+
typeof obj.reset_at === "string" ? new Date(obj.reset_at) : void 0
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
exports.TooManyRequestsError = TooManyRequestsError;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { JSONObject } from '../../../helpers/json';
|
|
2
|
+
import { ScalewayError } from '../scw-error';
|
|
3
|
+
/**
|
|
4
|
+
* Quota policy of {@link TooManyRequestsError}.
|
|
5
|
+
*
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export type TooManyRequestsQuotaPolicy = {
|
|
9
|
+
quota: number;
|
|
10
|
+
windowSeconds?: number;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* TooManyRequestsError error happens when fetching too many times a resource.
|
|
14
|
+
*
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
17
|
+
export declare class TooManyRequestsError extends ScalewayError {
|
|
18
|
+
readonly status: number;
|
|
19
|
+
readonly body: JSONObject;
|
|
20
|
+
readonly helpMessage: string;
|
|
21
|
+
readonly limit?: TooManyRequestsQuotaPolicy | undefined;
|
|
22
|
+
/** The number of seconds until the quota resets */
|
|
23
|
+
readonly resetSeconds?: number | undefined;
|
|
24
|
+
/** The timestamp when the quota resets */
|
|
25
|
+
readonly resetAt?: Date | undefined;
|
|
26
|
+
constructor(status: number, body: JSONObject, helpMessage: string, limit?: TooManyRequestsQuotaPolicy | undefined,
|
|
27
|
+
/** The number of seconds until the quota resets */
|
|
28
|
+
resetSeconds?: number | undefined,
|
|
29
|
+
/** The timestamp when the quota resets */
|
|
30
|
+
resetAt?: Date | undefined);
|
|
31
|
+
static fromJSON(status: number, obj: Readonly<JSONObject>): TooManyRequestsError | null;
|
|
32
|
+
}
|
|
@@ -1,17 +1,5 @@
|
|
|
1
|
-
import { isJSONObject } from
|
|
2
|
-
import { ScalewayError } from
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Quota policy of {@link TooManyRequestsError}.
|
|
6
|
-
*
|
|
7
|
-
* @public
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Build the default message for {@link TooManyRequestsError}.
|
|
12
|
-
*
|
|
13
|
-
* @internal
|
|
14
|
-
*/
|
|
1
|
+
import { isJSONObject } from "../../../helpers/json.js";
|
|
2
|
+
import { ScalewayError } from "../scw-error.js";
|
|
15
3
|
const buildMessage = (helpMessage, limit, resetSeconds, resetAt) => {
|
|
16
4
|
const details = [];
|
|
17
5
|
if (limit) {
|
|
@@ -28,23 +16,15 @@ const buildMessage = (helpMessage, limit, resetSeconds, resetAt) => {
|
|
|
28
16
|
}
|
|
29
17
|
let output = `too many requests`;
|
|
30
18
|
if (details.length > 0) {
|
|
31
|
-
output += ` (${details.join(
|
|
19
|
+
output += ` (${details.join(", ")})`;
|
|
32
20
|
}
|
|
33
21
|
if (helpMessage.length > 0) {
|
|
34
22
|
output += `: ${helpMessage}`;
|
|
35
23
|
}
|
|
36
24
|
return output;
|
|
37
25
|
};
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* TooManyRequestsError error happens when fetching too many times a resource.
|
|
41
|
-
*
|
|
42
|
-
* @public
|
|
43
|
-
*/
|
|
44
26
|
class TooManyRequestsError extends ScalewayError {
|
|
45
|
-
constructor(status, body, helpMessage, limit,
|
|
46
|
-
resetSeconds, /** The timestamp when the quota resets */
|
|
47
|
-
resetAt) {
|
|
27
|
+
constructor(status, body, helpMessage, limit, resetSeconds, resetAt) {
|
|
48
28
|
super(status, body, buildMessage(helpMessage, limit, resetSeconds, resetAt));
|
|
49
29
|
this.status = status;
|
|
50
30
|
this.body = body;
|
|
@@ -52,19 +32,28 @@ class TooManyRequestsError extends ScalewayError {
|
|
|
52
32
|
this.limit = limit;
|
|
53
33
|
this.resetSeconds = resetSeconds;
|
|
54
34
|
this.resetAt = resetAt;
|
|
55
|
-
this.name =
|
|
35
|
+
this.name = "TooManyRequestsError";
|
|
56
36
|
}
|
|
57
37
|
static fromJSON(status, obj) {
|
|
58
|
-
if (typeof obj.help_message !==
|
|
38
|
+
if (typeof obj.help_message !== "string")
|
|
39
|
+
return null;
|
|
59
40
|
let limit;
|
|
60
|
-
if (isJSONObject(obj.limit) && typeof obj.limit.quota ===
|
|
41
|
+
if (isJSONObject(obj.limit) && typeof obj.limit.quota === "number") {
|
|
61
42
|
limit = {
|
|
62
43
|
quota: obj.limit.quota,
|
|
63
|
-
windowSeconds: typeof obj.limit.window_seconds ===
|
|
44
|
+
windowSeconds: typeof obj.limit.window_seconds === "number" ? obj.limit.window_seconds : void 0
|
|
64
45
|
};
|
|
65
46
|
}
|
|
66
|
-
return new TooManyRequestsError(
|
|
47
|
+
return new TooManyRequestsError(
|
|
48
|
+
status,
|
|
49
|
+
obj,
|
|
50
|
+
obj.help_message,
|
|
51
|
+
limit,
|
|
52
|
+
typeof obj.reset_seconds === "number" ? obj.reset_seconds : void 0,
|
|
53
|
+
typeof obj.reset_at === "string" ? new Date(obj.reset_at) : void 0
|
|
54
|
+
);
|
|
67
55
|
}
|
|
68
56
|
}
|
|
69
|
-
|
|
70
|
-
|
|
57
|
+
export {
|
|
58
|
+
TooManyRequestsError
|
|
59
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const scwError = require("../scw-error.cjs");
|
|
4
|
+
class TransientStateError extends scwError.ScalewayError {
|
|
5
|
+
constructor(status, body, resource, resourceId, currentState) {
|
|
6
|
+
super(
|
|
7
|
+
status,
|
|
8
|
+
body,
|
|
9
|
+
`resource ${resource} with ID ${resourceId} is in a transient state: ${currentState}`
|
|
10
|
+
);
|
|
11
|
+
this.status = status;
|
|
12
|
+
this.body = body;
|
|
13
|
+
this.resource = resource;
|
|
14
|
+
this.resourceId = resourceId;
|
|
15
|
+
this.currentState = currentState;
|
|
16
|
+
this.name = "TransientStateError";
|
|
17
|
+
}
|
|
18
|
+
static fromJSON(status, obj) {
|
|
19
|
+
if (typeof obj.resource !== "string" || typeof obj.resource_id !== "string" || typeof obj.current_state !== "string") {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
return new TransientStateError(
|
|
23
|
+
status,
|
|
24
|
+
obj,
|
|
25
|
+
obj.resource,
|
|
26
|
+
obj.resource_id,
|
|
27
|
+
obj.current_state
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.TransientStateError = TransientStateError;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { JSONObject } from '../../../helpers/json';
|
|
2
|
+
import { ScalewayError } from '../scw-error';
|
|
3
|
+
/**
|
|
4
|
+
* TransientState error happens when trying to perform an action on a resource in a transient state.
|
|
5
|
+
*
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export declare class TransientStateError extends ScalewayError {
|
|
9
|
+
readonly status: number;
|
|
10
|
+
readonly body: JSONObject;
|
|
11
|
+
readonly resource: string;
|
|
12
|
+
readonly resourceId: string;
|
|
13
|
+
readonly currentState: string;
|
|
14
|
+
constructor(status: number, body: JSONObject, resource: string, resourceId: string, currentState: string);
|
|
15
|
+
static fromJSON(status: number, obj: Readonly<JSONObject>): ScalewayError | null;
|
|
16
|
+
}
|
|
@@ -1,26 +1,31 @@
|
|
|
1
|
-
import { ScalewayError } from
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* TransientState error happens when trying to perform an action on a resource in a transient state.
|
|
5
|
-
*
|
|
6
|
-
* @public
|
|
7
|
-
*/
|
|
1
|
+
import { ScalewayError } from "../scw-error.js";
|
|
8
2
|
class TransientStateError extends ScalewayError {
|
|
9
3
|
constructor(status, body, resource, resourceId, currentState) {
|
|
10
|
-
super(
|
|
4
|
+
super(
|
|
5
|
+
status,
|
|
6
|
+
body,
|
|
7
|
+
`resource ${resource} with ID ${resourceId} is in a transient state: ${currentState}`
|
|
8
|
+
);
|
|
11
9
|
this.status = status;
|
|
12
10
|
this.body = body;
|
|
13
11
|
this.resource = resource;
|
|
14
12
|
this.resourceId = resourceId;
|
|
15
13
|
this.currentState = currentState;
|
|
16
|
-
this.name =
|
|
14
|
+
this.name = "TransientStateError";
|
|
17
15
|
}
|
|
18
16
|
static fromJSON(status, obj) {
|
|
19
|
-
if (typeof obj.resource !==
|
|
17
|
+
if (typeof obj.resource !== "string" || typeof obj.resource_id !== "string" || typeof obj.current_state !== "string") {
|
|
20
18
|
return null;
|
|
21
19
|
}
|
|
22
|
-
return new TransientStateError(
|
|
20
|
+
return new TransientStateError(
|
|
21
|
+
status,
|
|
22
|
+
obj,
|
|
23
|
+
obj.resource,
|
|
24
|
+
obj.resource_id,
|
|
25
|
+
obj.current_state
|
|
26
|
+
);
|
|
23
27
|
}
|
|
24
28
|
}
|
|
25
|
-
|
|
26
|
-
|
|
29
|
+
export {
|
|
30
|
+
TransientStateError
|
|
31
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const json = require("../../helpers/json.cjs");
|
|
4
|
+
const isRecordOfStringArray = (obj) => {
|
|
5
|
+
if (!json.isJSONObject(obj)) {
|
|
6
|
+
return false;
|
|
7
|
+
}
|
|
8
|
+
for (const elt of Object.values(obj)) {
|
|
9
|
+
if (!Array.isArray(elt) || Object.values(elt).find((x) => typeof x !== "string") !== void 0) {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
return true;
|
|
14
|
+
};
|
|
15
|
+
exports.isRecordOfStringArray = isRecordOfStringArray;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Verifies the object is a record of string to string[].
|
|
3
|
+
*
|
|
4
|
+
* @param obj - The object
|
|
5
|
+
* @returns Whether the object is of the expected type
|
|
6
|
+
*
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export declare const isRecordOfStringArray: (obj: Readonly<unknown>) => obj is Record<string, string[]>;
|
package/dist/scw/errors/types.js
CHANGED
|
@@ -1,23 +1,15 @@
|
|
|
1
|
-
import { isJSONObject } from
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Verifies the object is a record of string to string[].
|
|
5
|
-
*
|
|
6
|
-
* @param obj - The object
|
|
7
|
-
* @returns Whether the object is of the expected type
|
|
8
|
-
*
|
|
9
|
-
* @internal
|
|
10
|
-
*/
|
|
11
|
-
const isRecordOfStringArray = obj => {
|
|
1
|
+
import { isJSONObject } from "../../helpers/json.js";
|
|
2
|
+
const isRecordOfStringArray = (obj) => {
|
|
12
3
|
if (!isJSONObject(obj)) {
|
|
13
4
|
return false;
|
|
14
5
|
}
|
|
15
6
|
for (const elt of Object.values(obj)) {
|
|
16
|
-
if (!Array.isArray(elt) || Object.values(elt).find(x => typeof x !==
|
|
7
|
+
if (!Array.isArray(elt) || Object.values(elt).find((x) => typeof x !== "string") !== void 0) {
|
|
17
8
|
return false;
|
|
18
9
|
}
|
|
19
10
|
}
|
|
20
11
|
return true;
|
|
21
12
|
};
|
|
22
|
-
|
|
23
|
-
|
|
13
|
+
export {
|
|
14
|
+
isRecordOfStringArray
|
|
15
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const isBrowser = require("../../helpers/is-browser.cjs");
|
|
4
|
+
const composer = require("../../internal/interceptors/composer.cjs");
|
|
5
|
+
const auth = require("../auth.cjs");
|
|
6
|
+
const httpInterceptors = require("./http-interceptors.cjs");
|
|
7
|
+
const responseParser = require("./response-parser.cjs");
|
|
8
|
+
const buildRequest = (request, settings) => {
|
|
9
|
+
let { path } = request;
|
|
10
|
+
if (request.urlParams instanceof URLSearchParams) {
|
|
11
|
+
path = path.concat(`?${request.urlParams.toString()}`);
|
|
12
|
+
}
|
|
13
|
+
return new Request(`${settings.apiURL}${path}`, {
|
|
14
|
+
body: request.body,
|
|
15
|
+
headers: {
|
|
16
|
+
Accept: "application/json",
|
|
17
|
+
.../* istanbul ignore next */
|
|
18
|
+
!isBrowser.isBrowser() ? { "User-Agent": settings.userAgent } : {},
|
|
19
|
+
...request.headers
|
|
20
|
+
},
|
|
21
|
+
method: request.method
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
const asIs = (response) => response;
|
|
25
|
+
const buildFetcher = (settings, httpClient) => {
|
|
26
|
+
let requestNumber = 0;
|
|
27
|
+
const prepareRequest = (requestId) => composer.composeRequestInterceptors([
|
|
28
|
+
...settings.interceptors.map((obj) => obj.request).filter((obj) => obj),
|
|
29
|
+
httpInterceptors.logRequest(requestId, httpInterceptors.obfuscateInterceptor(auth.obfuscateAuthHeadersEntry))
|
|
30
|
+
]);
|
|
31
|
+
const prepareResponse = (requestId) => composer.composeResponseInterceptors([
|
|
32
|
+
...settings.interceptors.map((obj) => obj.response).filter((obj) => obj),
|
|
33
|
+
httpInterceptors.logResponse(requestId)
|
|
34
|
+
]);
|
|
35
|
+
const prepareResponseErrors = () => composer.composeResponseErrorInterceptors(
|
|
36
|
+
settings.interceptors.map((obj) => obj.responseError).filter((obj) => obj)
|
|
37
|
+
);
|
|
38
|
+
return async (request, unwrapper = asIs) => {
|
|
39
|
+
const requestId = `${requestNumber += 1}`;
|
|
40
|
+
const reqInterceptors = prepareRequest(requestId);
|
|
41
|
+
const finalRequest = await reqInterceptors(buildRequest(request, settings));
|
|
42
|
+
try {
|
|
43
|
+
const response = await httpClient(finalRequest);
|
|
44
|
+
const resInterceptors = prepareResponse(requestId);
|
|
45
|
+
const finalResponse = await resInterceptors(response);
|
|
46
|
+
const resUnmarshaller = responseParser.responseParser(
|
|
47
|
+
unwrapper,
|
|
48
|
+
request.responseType ?? "json"
|
|
49
|
+
);
|
|
50
|
+
const unmarshaledResponse = await resUnmarshaller(finalResponse);
|
|
51
|
+
return unmarshaledResponse;
|
|
52
|
+
} catch (err) {
|
|
53
|
+
const resErrorInterceptors = prepareResponseErrors();
|
|
54
|
+
const handledError = await resErrorInterceptors(finalRequest, err);
|
|
55
|
+
return unwrapper(handledError);
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
exports.buildFetcher = buildFetcher;
|
|
60
|
+
exports.buildRequest = buildRequest;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Settings } from '../client-settings';
|
|
2
|
+
import type { ResponseUnmarshaller, ScwRequest } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Builds Request from {@link ScwRequest} & {@link Settings}.
|
|
5
|
+
*
|
|
6
|
+
* @param request - A scaleway request
|
|
7
|
+
* @param settings - The settings
|
|
8
|
+
* @returns A fetch Request
|
|
9
|
+
*
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
export declare const buildRequest: (request: Readonly<ScwRequest>, settings: Readonly<Settings>) => Request;
|
|
13
|
+
export type Fetcher = <T>(request: Readonly<ScwRequest>, unwrapper?: ResponseUnmarshaller<T>) => Promise<T>;
|
|
14
|
+
/**
|
|
15
|
+
* Builds a resource fetcher.
|
|
16
|
+
*
|
|
17
|
+
* @param settings - The {@link Settings} object
|
|
18
|
+
* @param httpClient - The HTTP client that should be used to call the API
|
|
19
|
+
* @returns The fetcher
|
|
20
|
+
*
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
23
|
+
export declare const buildFetcher: (settings: Settings, httpClient: typeof fetch) => <T>(request: Readonly<ScwRequest>, unwrapper?: ResponseUnmarshaller<T>) => Promise<T>;
|
|
@@ -1,52 +1,38 @@
|
|
|
1
|
-
import { isBrowser } from
|
|
2
|
-
import { composeRequestInterceptors, composeResponseInterceptors, composeResponseErrorInterceptors } from
|
|
3
|
-
import { obfuscateAuthHeadersEntry } from
|
|
4
|
-
import { logRequest, logResponse, obfuscateInterceptor } from
|
|
5
|
-
import { responseParser } from
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Builds Request from {@link ScwRequest} & {@link Settings}.
|
|
9
|
-
*
|
|
10
|
-
* @param request - A scaleway request
|
|
11
|
-
* @param settings - The settings
|
|
12
|
-
* @returns A fetch Request
|
|
13
|
-
*
|
|
14
|
-
* @internal
|
|
15
|
-
*/
|
|
1
|
+
import { isBrowser } from "../../helpers/is-browser.js";
|
|
2
|
+
import { composeRequestInterceptors, composeResponseInterceptors, composeResponseErrorInterceptors } from "../../internal/interceptors/composer.js";
|
|
3
|
+
import { obfuscateAuthHeadersEntry } from "../auth.js";
|
|
4
|
+
import { logRequest, logResponse, obfuscateInterceptor } from "./http-interceptors.js";
|
|
5
|
+
import { responseParser } from "./response-parser.js";
|
|
16
6
|
const buildRequest = (request, settings) => {
|
|
17
|
-
let {
|
|
18
|
-
path
|
|
19
|
-
} = request;
|
|
7
|
+
let { path } = request;
|
|
20
8
|
if (request.urlParams instanceof URLSearchParams) {
|
|
21
9
|
path = path.concat(`?${request.urlParams.toString()}`);
|
|
22
10
|
}
|
|
23
11
|
return new Request(`${settings.apiURL}${path}`, {
|
|
24
12
|
body: request.body,
|
|
25
13
|
headers: {
|
|
26
|
-
Accept:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
} : {}),
|
|
14
|
+
Accept: "application/json",
|
|
15
|
+
.../* istanbul ignore next */
|
|
16
|
+
!isBrowser() ? { "User-Agent": settings.userAgent } : {},
|
|
30
17
|
...request.headers
|
|
31
18
|
},
|
|
32
19
|
method: request.method
|
|
33
20
|
});
|
|
34
21
|
};
|
|
35
|
-
const asIs = response => response;
|
|
36
|
-
/**
|
|
37
|
-
* Builds a resource fetcher.
|
|
38
|
-
*
|
|
39
|
-
* @param settings - The {@link Settings} object
|
|
40
|
-
* @param httpClient - The HTTP client that should be used to call the API
|
|
41
|
-
* @returns The fetcher
|
|
42
|
-
*
|
|
43
|
-
* @internal
|
|
44
|
-
*/
|
|
22
|
+
const asIs = (response) => response;
|
|
45
23
|
const buildFetcher = (settings, httpClient) => {
|
|
46
24
|
let requestNumber = 0;
|
|
47
|
-
const prepareRequest = requestId => composeRequestInterceptors([
|
|
48
|
-
|
|
49
|
-
|
|
25
|
+
const prepareRequest = (requestId) => composeRequestInterceptors([
|
|
26
|
+
...settings.interceptors.map((obj) => obj.request).filter((obj) => obj),
|
|
27
|
+
logRequest(requestId, obfuscateInterceptor(obfuscateAuthHeadersEntry))
|
|
28
|
+
]);
|
|
29
|
+
const prepareResponse = (requestId) => composeResponseInterceptors([
|
|
30
|
+
...settings.interceptors.map((obj) => obj.response).filter((obj) => obj),
|
|
31
|
+
logResponse(requestId)
|
|
32
|
+
]);
|
|
33
|
+
const prepareResponseErrors = () => composeResponseErrorInterceptors(
|
|
34
|
+
settings.interceptors.map((obj) => obj.responseError).filter((obj) => obj)
|
|
35
|
+
);
|
|
50
36
|
return async (request, unwrapper = asIs) => {
|
|
51
37
|
const requestId = `${requestNumber += 1}`;
|
|
52
38
|
const reqInterceptors = prepareRequest(requestId);
|
|
@@ -55,7 +41,10 @@ const buildFetcher = (settings, httpClient) => {
|
|
|
55
41
|
const response = await httpClient(finalRequest);
|
|
56
42
|
const resInterceptors = prepareResponse(requestId);
|
|
57
43
|
const finalResponse = await resInterceptors(response);
|
|
58
|
-
const resUnmarshaller = responseParser(
|
|
44
|
+
const resUnmarshaller = responseParser(
|
|
45
|
+
unwrapper,
|
|
46
|
+
request.responseType ?? "json"
|
|
47
|
+
);
|
|
59
48
|
const unmarshaledResponse = await resUnmarshaller(finalResponse);
|
|
60
49
|
return unmarshaledResponse;
|
|
61
50
|
} catch (err) {
|
|
@@ -65,5 +54,7 @@ const buildFetcher = (settings, httpClient) => {
|
|
|
65
54
|
}
|
|
66
55
|
};
|
|
67
56
|
};
|
|
68
|
-
|
|
69
|
-
|
|
57
|
+
export {
|
|
58
|
+
buildFetcher,
|
|
59
|
+
buildRequest
|
|
60
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const toPascalCase = (str) => str.replace(
|
|
4
|
+
/\w+/g,
|
|
5
|
+
(word) => `${word[0].toUpperCase()}${word.slice(1).toLowerCase()}`
|
|
6
|
+
);
|
|
7
|
+
const serializeHeadersEntry = ([name, value]) => `${toPascalCase(name)}: ${value}`;
|
|
8
|
+
const serializeHeaders = (headers) => Array.from(headers.entries(), serializeHeadersEntry);
|
|
9
|
+
const dumpRequest = async (request) => [
|
|
10
|
+
`${request.method.toUpperCase()}: ${request.url}`,
|
|
11
|
+
...serializeHeaders(request.headers),
|
|
12
|
+
await request.clone().text()
|
|
13
|
+
].join("\r\n");
|
|
14
|
+
const dumpResponse = async (response) => [
|
|
15
|
+
`HTTP ${response.status} ${response.ok ? "OK" : "NOK"}`,
|
|
16
|
+
...serializeHeaders(response.headers),
|
|
17
|
+
await response.clone().text()
|
|
18
|
+
].join("\r\n");
|
|
19
|
+
exports.dumpRequest = dumpRequest;
|
|
20
|
+
exports.dumpResponse = dumpResponse;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dumps a Request into a readable string.
|
|
3
|
+
*
|
|
4
|
+
* @param request - The request
|
|
5
|
+
* @returns The readable string
|
|
6
|
+
*
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export declare const dumpRequest: (request: Readonly<Request>) => Promise<string>;
|
|
10
|
+
/**
|
|
11
|
+
* Dumps a Response into a readable string.
|
|
12
|
+
*
|
|
13
|
+
* @param response - The response
|
|
14
|
+
* @returns The readable string
|
|
15
|
+
*
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
export declare const dumpResponse: (response: Readonly<Response>) => Promise<string>;
|
|
@@ -1,51 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
* @returns The string in PascalCase
|
|
6
|
-
*
|
|
7
|
-
* @internal
|
|
8
|
-
*/
|
|
9
|
-
const toPascalCase = str => str.replace(/\w+/g, word => `${word[0].toUpperCase()}${word.slice(1).toLowerCase()}`);
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Converts a Headers entry to string.
|
|
13
|
-
*
|
|
14
|
-
* @param entry - The header entry as a string tuple
|
|
15
|
-
* @returns A serialized string
|
|
16
|
-
*
|
|
17
|
-
* @internal
|
|
18
|
-
*/
|
|
1
|
+
const toPascalCase = (str) => str.replace(
|
|
2
|
+
/\w+/g,
|
|
3
|
+
(word) => `${word[0].toUpperCase()}${word.slice(1).toLowerCase()}`
|
|
4
|
+
);
|
|
19
5
|
const serializeHeadersEntry = ([name, value]) => `${toPascalCase(name)}: ${value}`;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
* @returns The readable string
|
|
36
|
-
*
|
|
37
|
-
* @internal
|
|
38
|
-
*/
|
|
39
|
-
const dumpRequest = async request => [`${request.method.toUpperCase()}: ${request.url}`, ...serializeHeaders(request.headers), await request.clone().text()].join('\r\n');
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Dumps a Response into a readable string.
|
|
43
|
-
*
|
|
44
|
-
* @param response - The response
|
|
45
|
-
* @returns The readable string
|
|
46
|
-
*
|
|
47
|
-
* @internal
|
|
48
|
-
*/
|
|
49
|
-
const dumpResponse = async response => [`HTTP ${response.status} ${response.ok ? 'OK' : 'NOK'}`, ...serializeHeaders(response.headers), await response.clone().text()].join('\r\n');
|
|
50
|
-
|
|
51
|
-
export { dumpRequest, dumpResponse };
|
|
6
|
+
const serializeHeaders = (headers) => Array.from(headers.entries(), serializeHeadersEntry);
|
|
7
|
+
const dumpRequest = async (request) => [
|
|
8
|
+
`${request.method.toUpperCase()}: ${request.url}`,
|
|
9
|
+
...serializeHeaders(request.headers),
|
|
10
|
+
await request.clone().text()
|
|
11
|
+
].join("\r\n");
|
|
12
|
+
const dumpResponse = async (response) => [
|
|
13
|
+
`HTTP ${response.status} ${response.ok ? "OK" : "NOK"}`,
|
|
14
|
+
...serializeHeaders(response.headers),
|
|
15
|
+
await response.clone().text()
|
|
16
|
+
].join("\r\n");
|
|
17
|
+
export {
|
|
18
|
+
dumpRequest,
|
|
19
|
+
dumpResponse
|
|
20
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const index = require("../../internal/logger/index.cjs");
|
|
4
|
+
const levelResolver = require("../../internal/logger/level-resolver.cjs");
|
|
5
|
+
const httpDumper = require("./http-dumper.cjs");
|
|
6
|
+
class ObfuscatedRequest extends Request {
|
|
7
|
+
constructor(request, obfuscate) {
|
|
8
|
+
super(request);
|
|
9
|
+
this.request = request;
|
|
10
|
+
this.obfuscate = obfuscate;
|
|
11
|
+
}
|
|
12
|
+
get headers() {
|
|
13
|
+
return new Headers(Array.from(this.request.headers, this.obfuscate));
|
|
14
|
+
}
|
|
15
|
+
clone() {
|
|
16
|
+
return new ObfuscatedRequest(this.request, this.obfuscate);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
const obfuscateInterceptor = (obfuscate) => ({ request }) => new ObfuscatedRequest(request, obfuscate);
|
|
20
|
+
const identity = ({ request }) => request;
|
|
21
|
+
const logRequest = (identifier, obfuscate = identity) => async ({ request }) => {
|
|
22
|
+
if (levelResolver.shouldLog(levelResolver.LevelResolver[index.getLogger().logLevel], "debug")) {
|
|
23
|
+
index.getLogger().debug(
|
|
24
|
+
`--------------- Scaleway SDK REQUEST ${identifier} ---------------
|
|
25
|
+
${await httpDumper.dumpRequest(await obfuscate({ request }))}
|
|
26
|
+
---------------------------------------------------------`
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
return request;
|
|
30
|
+
};
|
|
31
|
+
const logResponse = (identifier) => async ({ response }) => {
|
|
32
|
+
if (levelResolver.shouldLog(levelResolver.LevelResolver[index.getLogger().logLevel], "debug")) {
|
|
33
|
+
index.getLogger().debug(
|
|
34
|
+
`--------------- Scaleway SDK RESPONSE ${identifier} ---------------
|
|
35
|
+
${await httpDumper.dumpResponse(response)}
|
|
36
|
+
---------------------------------------------------------`
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
return response;
|
|
40
|
+
};
|
|
41
|
+
exports.logRequest = logRequest;
|
|
42
|
+
exports.logResponse = logResponse;
|
|
43
|
+
exports.obfuscateInterceptor = obfuscateInterceptor;
|