@scaleway/sdk 2.39.0 → 2.41.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/v2/api.gen.cjs +1 -0
- package/dist/api/account/v2/api.gen.js +1 -0
- package/dist/api/account/v2/marshalling.gen.cjs +1 -0
- package/dist/api/account/v2/marshalling.gen.js +1 -0
- package/dist/api/account/v3/api.gen.cjs +1 -0
- package/dist/api/account/v3/api.gen.js +1 -0
- package/dist/api/account/v3/marshalling.gen.cjs +1 -0
- package/dist/api/account/v3/marshalling.gen.js +1 -0
- package/dist/api/applesilicon/v1alpha1/api.gen.cjs +1 -0
- package/dist/api/applesilicon/v1alpha1/api.gen.js +1 -0
- package/dist/api/applesilicon/v1alpha1/marshalling.gen.cjs +1 -0
- package/dist/api/applesilicon/v1alpha1/marshalling.gen.js +1 -0
- package/dist/api/baremetal/v1/api.gen.cjs +1 -0
- package/dist/api/baremetal/v1/api.gen.js +1 -0
- package/dist/api/billing/v2alpha1/api.gen.cjs +1 -0
- package/dist/api/billing/v2alpha1/api.gen.js +1 -0
- package/dist/api/billing/v2beta1/api.gen.cjs +1 -0
- package/dist/api/billing/v2beta1/api.gen.js +1 -0
- package/dist/api/block/v1alpha1/api.gen.cjs +1 -0
- package/dist/api/block/v1alpha1/api.gen.js +1 -0
- package/dist/api/cockpit/v1/api.gen.cjs +1 -0
- package/dist/api/cockpit/v1/api.gen.js +1 -0
- package/dist/api/cockpit/v1/marshalling.gen.cjs +1 -0
- package/dist/api/cockpit/v1/marshalling.gen.js +1 -0
- package/dist/api/cockpit/v1beta1/api.gen.cjs +1 -0
- package/dist/api/cockpit/v1beta1/api.gen.js +1 -0
- package/dist/api/container/v1beta1/api.gen.cjs +1 -0
- package/dist/api/container/v1beta1/api.gen.js +1 -0
- package/dist/api/container/v1beta1/marshalling.gen.cjs +1 -0
- package/dist/api/container/v1beta1/marshalling.gen.js +1 -0
- package/dist/api/dedibox/v1/api.gen.cjs +1 -0
- package/dist/api/dedibox/v1/api.gen.js +1 -0
- package/dist/api/document_db/v1beta1/api.gen.cjs +1 -0
- package/dist/api/document_db/v1beta1/api.gen.js +1 -0
- package/dist/api/domain/v2beta1/api.gen.cjs +4 -2
- package/dist/api/domain/v2beta1/api.gen.d.ts +3 -2
- package/dist/api/domain/v2beta1/api.gen.js +4 -2
- package/dist/api/edge_services/v1alpha1/types.gen.d.ts +10 -0
- package/dist/api/flexibleip/v1alpha1/api.gen.cjs +1 -0
- package/dist/api/flexibleip/v1alpha1/api.gen.js +1 -0
- package/dist/api/flexibleip/v1alpha1/marshalling.gen.cjs +1 -0
- package/dist/api/flexibleip/v1alpha1/marshalling.gen.js +1 -0
- package/dist/api/function/v1beta1/api.gen.cjs +1 -0
- package/dist/api/function/v1beta1/api.gen.js +1 -0
- package/dist/api/function/v1beta1/marshalling.gen.cjs +1 -0
- package/dist/api/function/v1beta1/marshalling.gen.js +1 -0
- package/dist/api/iam/v1alpha1/api.gen.cjs +1 -0
- package/dist/api/iam/v1alpha1/api.gen.js +1 -0
- package/dist/api/iam/v1alpha1/marshalling.gen.cjs +1 -0
- package/dist/api/iam/v1alpha1/marshalling.gen.js +1 -0
- package/dist/api/instance/v1/api.gen.cjs +1 -0
- package/dist/api/instance/v1/api.gen.js +1 -0
- package/dist/api/instance/v1/api.utils.cjs +1 -0
- package/dist/api/instance/v1/api.utils.js +1 -0
- package/dist/api/instance/v1/marshalling.gen.cjs +1 -0
- package/dist/api/instance/v1/marshalling.gen.js +1 -0
- package/dist/api/iot/v1/api.gen.cjs +1 -0
- package/dist/api/iot/v1/api.gen.js +1 -0
- package/dist/api/ipam/v1/api.gen.cjs +1 -0
- package/dist/api/ipam/v1/api.gen.js +1 -0
- package/dist/api/ipam/v1/marshalling.gen.cjs +1 -0
- package/dist/api/ipam/v1/marshalling.gen.js +1 -0
- package/dist/api/ipfs/v1alpha1/api.gen.cjs +1 -0
- package/dist/api/ipfs/v1alpha1/api.gen.js +1 -0
- package/dist/api/ipfs/v1alpha1/marshalling.gen.cjs +1 -0
- package/dist/api/ipfs/v1alpha1/marshalling.gen.js +1 -0
- package/dist/api/jobs/v1alpha1/api.gen.cjs +1 -0
- package/dist/api/jobs/v1alpha1/api.gen.js +1 -0
- package/dist/api/jobs/v1alpha1/marshalling.gen.cjs +1 -0
- package/dist/api/jobs/v1alpha1/marshalling.gen.js +1 -0
- package/dist/api/k8s/v1/api.gen.cjs +1 -0
- package/dist/api/k8s/v1/api.gen.js +1 -0
- package/dist/api/k8s/v1/marshalling.gen.cjs +1 -0
- package/dist/api/k8s/v1/marshalling.gen.js +1 -0
- package/dist/api/key_manager/v1alpha1/api.gen.cjs +1 -0
- package/dist/api/key_manager/v1alpha1/api.gen.js +1 -0
- package/dist/api/key_manager/v1alpha1/marshalling.gen.cjs +1 -0
- package/dist/api/key_manager/v1alpha1/marshalling.gen.js +1 -0
- package/dist/api/lb/v1/api.gen.cjs +1 -0
- package/dist/api/lb/v1/api.gen.js +1 -0
- package/dist/api/lb/v1/marshalling.gen.cjs +1 -0
- package/dist/api/lb/v1/marshalling.gen.js +1 -0
- package/dist/api/llm_inference/v1beta1/api.gen.cjs +1 -0
- package/dist/api/llm_inference/v1beta1/api.gen.js +1 -0
- package/dist/api/llm_inference/v1beta1/marshalling.gen.cjs +1 -0
- package/dist/api/llm_inference/v1beta1/marshalling.gen.js +1 -0
- package/dist/api/marketplace/v2/api.gen.cjs +1 -0
- package/dist/api/marketplace/v2/api.gen.js +1 -0
- package/dist/api/marketplace/v2/marshalling.gen.cjs +1 -0
- package/dist/api/marketplace/v2/marshalling.gen.js +1 -0
- package/dist/api/mnq/v1beta1/api.gen.cjs +1 -0
- package/dist/api/mnq/v1beta1/api.gen.js +1 -0
- package/dist/api/mnq/v1beta1/marshalling.gen.cjs +1 -0
- package/dist/api/mnq/v1beta1/marshalling.gen.js +1 -0
- package/dist/api/rdb/v1/api.gen.cjs +1 -0
- package/dist/api/rdb/v1/api.gen.js +1 -0
- package/dist/api/redis/v1/api.gen.cjs +1 -0
- package/dist/api/redis/v1/api.gen.js +1 -0
- package/dist/api/registry/v1/api.gen.cjs +1 -0
- package/dist/api/registry/v1/api.gen.js +1 -0
- package/dist/api/registry/v1/marshalling.gen.cjs +1 -0
- package/dist/api/registry/v1/marshalling.gen.js +1 -0
- package/dist/api/secret/v1alpha1/api.gen.cjs +1 -0
- package/dist/api/secret/v1alpha1/api.gen.js +1 -0
- package/dist/api/secret/v1alpha1/marshalling.gen.cjs +1 -0
- package/dist/api/secret/v1alpha1/marshalling.gen.js +1 -0
- package/dist/api/secret/v1beta1/api.gen.cjs +1 -0
- package/dist/api/secret/v1beta1/api.gen.js +1 -0
- package/dist/api/secret/v1beta1/marshalling.gen.cjs +1 -0
- package/dist/api/secret/v1beta1/marshalling.gen.js +1 -0
- package/dist/api/serverless_sqldb/v1alpha1/api.gen.cjs +1 -0
- package/dist/api/serverless_sqldb/v1alpha1/api.gen.js +1 -0
- package/dist/api/serverless_sqldb/v1alpha1/marshalling.gen.cjs +1 -0
- package/dist/api/serverless_sqldb/v1alpha1/marshalling.gen.js +1 -0
- package/dist/api/tem/v1alpha1/api.gen.cjs +1 -0
- package/dist/api/tem/v1alpha1/api.gen.js +1 -0
- package/dist/api/tem/v1alpha1/marshalling.gen.cjs +1 -0
- package/dist/api/tem/v1alpha1/marshalling.gen.js +1 -0
- package/dist/api/tem/v1alpha1/types.gen.d.ts +1 -1
- package/dist/api/test/v1/api.gen.cjs +1 -0
- package/dist/api/test/v1/api.gen.js +1 -0
- package/dist/api/test/v1/marshalling.gen.cjs +1 -0
- package/dist/api/test/v1/marshalling.gen.js +1 -0
- package/dist/api/vpc/v1/api.gen.cjs +1 -0
- package/dist/api/vpc/v1/api.gen.js +1 -0
- package/dist/api/vpc/v1/marshalling.gen.cjs +1 -0
- package/dist/api/vpc/v1/marshalling.gen.js +1 -0
- package/dist/api/vpc/v2/api.gen.cjs +1 -0
- package/dist/api/vpc/v2/api.gen.js +1 -0
- package/dist/api/vpc/v2/marshalling.gen.cjs +1 -0
- package/dist/api/vpc/v2/marshalling.gen.js +1 -0
- package/dist/api/vpcgw/v1/api.gen.cjs +1 -0
- package/dist/api/vpcgw/v1/api.gen.js +1 -0
- package/dist/api/vpcgw/v1/marshalling.gen.cjs +1 -0
- package/dist/api/vpcgw/v1/marshalling.gen.js +1 -0
- package/dist/api/webhosting/v1alpha1/api.gen.cjs +18 -0
- package/dist/api/webhosting/v1alpha1/api.gen.d.ts +8 -1
- package/dist/api/webhosting/v1alpha1/api.gen.js +19 -1
- package/dist/api/webhosting/v1alpha1/index.gen.d.ts +1 -1
- package/dist/api/webhosting/v1alpha1/marshalling.gen.cjs +15 -0
- package/dist/api/webhosting/v1alpha1/marshalling.gen.d.ts +3 -1
- package/dist/api/webhosting/v1alpha1/marshalling.gen.js +15 -0
- package/dist/api/webhosting/v1alpha1/types.gen.d.ts +15 -0
- package/dist/bridge.d.ts +1 -1
- package/dist/index.cjs +1 -0
- package/dist/index.js +2 -1
- package/dist/internals.d.ts +1 -1
- package/dist/scw/constants.cjs +1 -1
- package/dist/scw/constants.d.ts +2 -2
- package/dist/scw/constants.js +1 -1
- package/dist/scw/custom-marshalling.cjs +7 -0
- package/dist/scw/custom-marshalling.d.ts +6 -0
- package/dist/scw/custom-marshalling.js +7 -0
- package/dist/vendor/base64/index.cjs +42 -0
- package/dist/vendor/base64/index.js +42 -0
- package/package.json +2 -2
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { waitForResource } from "../../../internal/async/interval-retrier.js";
|
|
2
2
|
import { API as API$1 } from "../../../scw/api.js";
|
|
3
3
|
import { urlParams, validatePathParam } from "../../../helpers/marshalling.js";
|
|
4
|
+
import "../../../vendor/base64/index.js";
|
|
4
5
|
import { enrichForPagination } from "../../../scw/fetch/resource-paginator.js";
|
|
5
6
|
import { HUMAN_TRANSIENT_STATUSES } from "./content.gen.js";
|
|
6
7
|
import { marshalRegisterRequest, unmarshalRegisterResponse, unmarshalListHumansResponse, unmarshalHuman, marshalCreateHumanRequest, marshalUpdateHumanRequest } from "./marshalling.gen.js";
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const json = require("../../../helpers/json.cjs");
|
|
4
4
|
const marshalling = require("../../../helpers/marshalling.cjs");
|
|
5
|
+
require("../../../vendor/base64/index.cjs");
|
|
5
6
|
const unmarshalHuman = (data) => {
|
|
6
7
|
if (!json.isJSONObject(data)) {
|
|
7
8
|
throw new TypeError(
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { isJSONObject } from "../../../helpers/json.js";
|
|
2
2
|
import { unmarshalDate, unmarshalArrayOfObject, resolveOneOf } from "../../../helpers/marshalling.js";
|
|
3
|
+
import "../../../vendor/base64/index.js";
|
|
3
4
|
const unmarshalHuman = (data) => {
|
|
4
5
|
if (!isJSONObject(data)) {
|
|
5
6
|
throw new TypeError(
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const api = require("../../../scw/api.cjs");
|
|
4
4
|
const marshalling = require("../../../helpers/marshalling.cjs");
|
|
5
|
+
require("../../../vendor/base64/index.cjs");
|
|
5
6
|
const resourcePaginator = require("../../../scw/fetch/resource-paginator.cjs");
|
|
6
7
|
const marshalling_gen = require("./marshalling.gen.cjs");
|
|
7
8
|
const jsonContentHeaders = {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { API as API$1 } from "../../../scw/api.js";
|
|
2
2
|
import { validatePathParam, urlParams } from "../../../helpers/marshalling.js";
|
|
3
|
+
import "../../../vendor/base64/index.js";
|
|
3
4
|
import { enrichForPagination } from "../../../scw/fetch/resource-paginator.js";
|
|
4
5
|
import { unmarshalListPrivateNetworksResponse, marshalCreatePrivateNetworkRequest, unmarshalPrivateNetwork, marshalUpdatePrivateNetworkRequest } from "./marshalling.gen.js";
|
|
5
6
|
const jsonContentHeaders = {
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const randomName = require("@scaleway/random-name");
|
|
4
4
|
const json = require("../../../helpers/json.cjs");
|
|
5
5
|
const marshalling = require("../../../helpers/marshalling.cjs");
|
|
6
|
+
require("../../../vendor/base64/index.cjs");
|
|
6
7
|
const unmarshalPrivateNetwork = (data) => {
|
|
7
8
|
if (!json.isJSONObject(data)) {
|
|
8
9
|
throw new TypeError(
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import randomName from "@scaleway/random-name";
|
|
2
2
|
import { isJSONObject } from "../../../helpers/json.js";
|
|
3
3
|
import { unmarshalDate, unmarshalArrayOfObject } from "../../../helpers/marshalling.js";
|
|
4
|
+
import "../../../vendor/base64/index.js";
|
|
4
5
|
const unmarshalPrivateNetwork = (data) => {
|
|
5
6
|
if (!isJSONObject(data)) {
|
|
6
7
|
throw new TypeError(
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const api = require("../../../scw/api.cjs");
|
|
4
4
|
const marshalling = require("../../../helpers/marshalling.cjs");
|
|
5
|
+
require("../../../vendor/base64/index.cjs");
|
|
5
6
|
const resourcePaginator = require("../../../scw/fetch/resource-paginator.cjs");
|
|
6
7
|
const marshalling_gen = require("./marshalling.gen.cjs");
|
|
7
8
|
const jsonContentHeaders = {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { API as API$1 } from "../../../scw/api.js";
|
|
2
2
|
import { validatePathParam, urlParams } from "../../../helpers/marshalling.js";
|
|
3
|
+
import "../../../vendor/base64/index.js";
|
|
3
4
|
import { enrichForPagination } from "../../../scw/fetch/resource-paginator.js";
|
|
4
5
|
import { unmarshalListVPCsResponse, marshalCreateVPCRequest, unmarshalVPC, marshalUpdateVPCRequest, unmarshalListPrivateNetworksResponse, marshalCreatePrivateNetworkRequest, unmarshalPrivateNetwork, marshalUpdatePrivateNetworkRequest, marshalMigrateZonalPrivateNetworksRequest, unmarshalListSubnetsResponse, marshalSetSubnetsRequest, unmarshalSetSubnetsResponse, marshalAddSubnetsRequest, unmarshalAddSubnetsResponse, marshalDeleteSubnetsRequest, unmarshalDeleteSubnetsResponse, marshalCreateRouteRequest, unmarshalRoute, marshalUpdateRouteRequest } from "./marshalling.gen.js";
|
|
5
6
|
const jsonContentHeaders = {
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const randomName = require("@scaleway/random-name");
|
|
4
4
|
const json = require("../../../helpers/json.cjs");
|
|
5
5
|
const marshalling = require("../../../helpers/marshalling.cjs");
|
|
6
|
+
require("../../../vendor/base64/index.cjs");
|
|
6
7
|
const unmarshalSubnet = (data) => {
|
|
7
8
|
if (!json.isJSONObject(data)) {
|
|
8
9
|
throw new TypeError(
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import randomName from "@scaleway/random-name";
|
|
2
2
|
import { isJSONObject } from "../../../helpers/json.js";
|
|
3
3
|
import { unmarshalDate, unmarshalArrayOfObject, resolveOneOf } from "../../../helpers/marshalling.js";
|
|
4
|
+
import "../../../vendor/base64/index.js";
|
|
4
5
|
const unmarshalSubnet = (data) => {
|
|
5
6
|
if (!isJSONObject(data)) {
|
|
6
7
|
throw new TypeError(
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const intervalRetrier = require("../../../internal/async/interval-retrier.cjs");
|
|
4
4
|
const api = require("../../../scw/api.cjs");
|
|
5
5
|
const marshalling = require("../../../helpers/marshalling.cjs");
|
|
6
|
+
require("../../../vendor/base64/index.cjs");
|
|
6
7
|
const resourcePaginator = require("../../../scw/fetch/resource-paginator.cjs");
|
|
7
8
|
const content_gen = require("./content.gen.cjs");
|
|
8
9
|
const marshalling_gen = require("./marshalling.gen.cjs");
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { waitForResource } from "../../../internal/async/interval-retrier.js";
|
|
2
2
|
import { API as API$1 } from "../../../scw/api.js";
|
|
3
3
|
import { validatePathParam, urlParams } from "../../../helpers/marshalling.js";
|
|
4
|
+
import "../../../vendor/base64/index.js";
|
|
4
5
|
import { enrichForPagination } from "../../../scw/fetch/resource-paginator.js";
|
|
5
6
|
import { GATEWAY_TRANSIENT_STATUSES, GATEWAY_NETWORK_TRANSIENT_STATUSES } from "./content.gen.js";
|
|
6
7
|
import { unmarshalListGatewaysResponse, unmarshalGateway, marshalCreateGatewayRequest, marshalUpdateGatewayRequest, unmarshalListGatewayNetworksResponse, unmarshalGatewayNetwork, marshalCreateGatewayNetworkRequest, marshalUpdateGatewayNetworkRequest, unmarshalListDHCPsResponse, unmarshalDHCP, marshalCreateDHCPRequest, marshalUpdateDHCPRequest, unmarshalListDHCPEntriesResponse, unmarshalDHCPEntry, marshalCreateDHCPEntryRequest, marshalUpdateDHCPEntryRequest, marshalSetDHCPEntriesRequest, unmarshalSetDHCPEntriesResponse, unmarshalListPATRulesResponse, unmarshalPATRule, marshalCreatePATRuleRequest, marshalUpdatePATRuleRequest, marshalSetPATRulesRequest, unmarshalSetPATRulesResponse, unmarshalListGatewayTypesResponse, unmarshalListIPsResponse, unmarshalIP, marshalCreateIPRequest, marshalUpdateIPRequest } from "./marshalling.gen.js";
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const randomName = require("@scaleway/random-name");
|
|
4
4
|
const json = require("../../../helpers/json.cjs");
|
|
5
5
|
const marshalling = require("../../../helpers/marshalling.cjs");
|
|
6
|
+
require("../../../vendor/base64/index.cjs");
|
|
6
7
|
const unmarshalDHCP = (data) => {
|
|
7
8
|
if (!json.isJSONObject(data)) {
|
|
8
9
|
throw new TypeError(
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import randomName from "@scaleway/random-name";
|
|
2
2
|
import { isJSONObject } from "../../../helpers/json.js";
|
|
3
3
|
import { unmarshalDate, unmarshalArrayOfObject, resolveOneOf } from "../../../helpers/marshalling.js";
|
|
4
|
+
import "../../../vendor/base64/index.js";
|
|
4
5
|
const unmarshalDHCP = (data) => {
|
|
5
6
|
if (!isJSONObject(data)) {
|
|
6
7
|
throw new TypeError(
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const intervalRetrier = require("../../../internal/async/interval-retrier.cjs");
|
|
4
4
|
const api = require("../../../scw/api.cjs");
|
|
5
5
|
const marshalling = require("../../../helpers/marshalling.cjs");
|
|
6
|
+
require("../../../vendor/base64/index.cjs");
|
|
6
7
|
const resourcePaginator = require("../../../scw/fetch/resource-paginator.cjs");
|
|
7
8
|
const content_gen = require("./content.gen.cjs");
|
|
8
9
|
const marshalling_gen = require("./marshalling.gen.cjs");
|
|
@@ -156,6 +157,23 @@ class API extends api.API {
|
|
|
156
157
|
},
|
|
157
158
|
marshalling_gen.unmarshalDnsRecords
|
|
158
159
|
);
|
|
160
|
+
/**
|
|
161
|
+
* "Check whether you own this domain or not.".
|
|
162
|
+
*
|
|
163
|
+
* @param request - The request {@link CheckUserOwnsDomainRequest}
|
|
164
|
+
* @returns A Promise of CheckUserOwnsDomainResponse
|
|
165
|
+
*/
|
|
166
|
+
checkUserOwnsDomain = (request) => this.client.fetch(
|
|
167
|
+
{
|
|
168
|
+
body: JSON.stringify(
|
|
169
|
+
marshalling_gen.marshalCheckUserOwnsDomainRequest(request, this.client.settings)
|
|
170
|
+
),
|
|
171
|
+
headers: jsonContentHeaders,
|
|
172
|
+
method: "POST",
|
|
173
|
+
path: `/webhosting/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${marshalling.validatePathParam("domain", request.domain)}/check-ownership`
|
|
174
|
+
},
|
|
175
|
+
marshalling_gen.unmarshalCheckUserOwnsDomainResponse
|
|
176
|
+
);
|
|
159
177
|
/**
|
|
160
178
|
* List all offers. List the different Web Hosting offers, and their options,
|
|
161
179
|
* available to order from Scaleway.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { API as ParentAPI } from '../../../bridge';
|
|
2
2
|
import type { Region, WaitForOptions } from '../../../bridge';
|
|
3
|
-
import type { CreateHostingRequest, CreateSessionRequest, DeleteHostingRequest, DnsRecords, GetDomainDnsRecordsRequest, GetHostingRequest, Hosting, ListControlPanelsRequest, ListControlPanelsResponse, ListHostingsRequest, ListHostingsResponse, ListOffersRequest, ListOffersResponse, ResetHostingPasswordRequest, ResetHostingPasswordResponse, RestoreHostingRequest, Session, UpdateHostingRequest } from './types.gen';
|
|
3
|
+
import type { CheckUserOwnsDomainRequest, CheckUserOwnsDomainResponse, CreateHostingRequest, CreateSessionRequest, DeleteHostingRequest, DnsRecords, GetDomainDnsRecordsRequest, GetHostingRequest, Hosting, ListControlPanelsRequest, ListControlPanelsResponse, ListHostingsRequest, ListHostingsResponse, ListOffersRequest, ListOffersResponse, ResetHostingPasswordRequest, ResetHostingPasswordResponse, RestoreHostingRequest, Session, UpdateHostingRequest } from './types.gen';
|
|
4
4
|
/**
|
|
5
5
|
* Web Hosting API.
|
|
6
6
|
*
|
|
@@ -85,6 +85,13 @@ export declare class API extends ParentAPI {
|
|
|
85
85
|
* @returns A Promise of DnsRecords
|
|
86
86
|
*/
|
|
87
87
|
getDomainDnsRecords: (request: Readonly<GetDomainDnsRecordsRequest>) => Promise<DnsRecords>;
|
|
88
|
+
/**
|
|
89
|
+
* "Check whether you own this domain or not.".
|
|
90
|
+
*
|
|
91
|
+
* @param request - The request {@link CheckUserOwnsDomainRequest}
|
|
92
|
+
* @returns A Promise of CheckUserOwnsDomainResponse
|
|
93
|
+
*/
|
|
94
|
+
checkUserOwnsDomain: (request: Readonly<CheckUserOwnsDomainRequest>) => Promise<CheckUserOwnsDomainResponse>;
|
|
88
95
|
/**
|
|
89
96
|
* List all offers. List the different Web Hosting offers, and their options,
|
|
90
97
|
* available to order from Scaleway.
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { waitForResource } from "../../../internal/async/interval-retrier.js";
|
|
2
2
|
import { API as API$1 } from "../../../scw/api.js";
|
|
3
3
|
import { validatePathParam, urlParams } from "../../../helpers/marshalling.js";
|
|
4
|
+
import "../../../vendor/base64/index.js";
|
|
4
5
|
import { enrichForPagination } from "../../../scw/fetch/resource-paginator.js";
|
|
5
6
|
import { HOSTING_TRANSIENT_STATUSES } from "./content.gen.js";
|
|
6
|
-
import { marshalCreateHostingRequest, unmarshalHosting, unmarshalListHostingsResponse, marshalUpdateHostingRequest, unmarshalDnsRecords, unmarshalListOffersResponse, unmarshalListControlPanelsResponse, unmarshalSession, unmarshalResetHostingPasswordResponse } from "./marshalling.gen.js";
|
|
7
|
+
import { marshalCreateHostingRequest, unmarshalHosting, unmarshalListHostingsResponse, marshalUpdateHostingRequest, unmarshalDnsRecords, marshalCheckUserOwnsDomainRequest, unmarshalCheckUserOwnsDomainResponse, unmarshalListOffersResponse, unmarshalListControlPanelsResponse, unmarshalSession, unmarshalResetHostingPasswordResponse } from "./marshalling.gen.js";
|
|
7
8
|
const jsonContentHeaders = {
|
|
8
9
|
"Content-Type": "application/json; charset=utf-8"
|
|
9
10
|
};
|
|
@@ -154,6 +155,23 @@ class API extends API$1 {
|
|
|
154
155
|
},
|
|
155
156
|
unmarshalDnsRecords
|
|
156
157
|
);
|
|
158
|
+
/**
|
|
159
|
+
* "Check whether you own this domain or not.".
|
|
160
|
+
*
|
|
161
|
+
* @param request - The request {@link CheckUserOwnsDomainRequest}
|
|
162
|
+
* @returns A Promise of CheckUserOwnsDomainResponse
|
|
163
|
+
*/
|
|
164
|
+
checkUserOwnsDomain = (request) => this.client.fetch(
|
|
165
|
+
{
|
|
166
|
+
body: JSON.stringify(
|
|
167
|
+
marshalCheckUserOwnsDomainRequest(request, this.client.settings)
|
|
168
|
+
),
|
|
169
|
+
headers: jsonContentHeaders,
|
|
170
|
+
method: "POST",
|
|
171
|
+
path: `/webhosting/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam("domain", request.domain)}/check-ownership`
|
|
172
|
+
},
|
|
173
|
+
unmarshalCheckUserOwnsDomainResponse
|
|
174
|
+
);
|
|
157
175
|
/**
|
|
158
176
|
* List all offers. List the different Web Hosting offers, and their options,
|
|
159
177
|
* available to order from Scaleway.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { API } from './api.gen';
|
|
2
2
|
export * from './content.gen';
|
|
3
|
-
export type { ControlPanel, CreateHostingRequest, CreateHostingRequestDomainConfiguration, CreateSessionRequest, DeleteHostingRequest, DnsRecord, DnsRecordStatus, DnsRecordType, DnsRecords, DnsRecordsStatus, GetDomainDnsRecordsRequest, GetHostingRequest, Hosting, HostingCpanelUrls, HostingDnsStatus, HostingOption, HostingStatus, ListControlPanelsRequest, ListControlPanelsResponse, ListHostingsRequest, ListHostingsRequestOrderBy, ListHostingsResponse, ListOffersRequest, ListOffersRequestOrderBy, ListOffersResponse, Nameserver, NameserverStatus, Offer, OfferProduct, OfferQuotaWarning, ResetHostingPasswordRequest, ResetHostingPasswordResponse, RestoreHostingRequest, Session, UpdateHostingRequest, } from './types.gen';
|
|
3
|
+
export type { CheckUserOwnsDomainRequest, CheckUserOwnsDomainResponse, ControlPanel, CreateHostingRequest, CreateHostingRequestDomainConfiguration, CreateSessionRequest, DeleteHostingRequest, DnsRecord, DnsRecordStatus, DnsRecordType, DnsRecords, DnsRecordsStatus, GetDomainDnsRecordsRequest, GetHostingRequest, Hosting, HostingCpanelUrls, HostingDnsStatus, HostingOption, HostingStatus, ListControlPanelsRequest, ListControlPanelsResponse, ListHostingsRequest, ListHostingsRequestOrderBy, ListHostingsResponse, ListOffersRequest, ListOffersRequestOrderBy, ListOffersResponse, Nameserver, NameserverStatus, Offer, OfferProduct, OfferQuotaWarning, ResetHostingPasswordRequest, ResetHostingPasswordResponse, RestoreHostingRequest, Session, UpdateHostingRequest, } from './types.gen';
|
|
4
4
|
export * as ValidationRules from './validation-rules.gen';
|
|
@@ -58,6 +58,16 @@ const unmarshalHosting = (data) => {
|
|
|
58
58
|
username: data.username
|
|
59
59
|
};
|
|
60
60
|
};
|
|
61
|
+
const unmarshalCheckUserOwnsDomainResponse = (data) => {
|
|
62
|
+
if (!json.isJSONObject(data)) {
|
|
63
|
+
throw new TypeError(
|
|
64
|
+
`Unmarshalling the type 'CheckUserOwnsDomainResponse' failed as data isn't a dictionary.`
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
ownsDomain: data.owns_domain
|
|
69
|
+
};
|
|
70
|
+
};
|
|
61
71
|
const unmarshalDnsRecord = (data) => {
|
|
62
72
|
if (!json.isJSONObject(data)) {
|
|
63
73
|
throw new TypeError(
|
|
@@ -201,6 +211,9 @@ const unmarshalSession = (data) => {
|
|
|
201
211
|
url: data.url
|
|
202
212
|
};
|
|
203
213
|
};
|
|
214
|
+
const marshalCheckUserOwnsDomainRequest = (request, defaults) => ({
|
|
215
|
+
project_id: request.projectId ?? defaults.defaultProjectId
|
|
216
|
+
});
|
|
204
217
|
const marshalCreateHostingRequestDomainConfiguration = (request, defaults) => ({
|
|
205
218
|
update_all_records: request.updateAllRecords,
|
|
206
219
|
update_mail_record: request.updateMailRecord,
|
|
@@ -226,8 +239,10 @@ const marshalUpdateHostingRequest = (request, defaults) => ({
|
|
|
226
239
|
protected: request.protected,
|
|
227
240
|
tags: request.tags
|
|
228
241
|
});
|
|
242
|
+
exports.marshalCheckUserOwnsDomainRequest = marshalCheckUserOwnsDomainRequest;
|
|
229
243
|
exports.marshalCreateHostingRequest = marshalCreateHostingRequest;
|
|
230
244
|
exports.marshalUpdateHostingRequest = marshalUpdateHostingRequest;
|
|
245
|
+
exports.unmarshalCheckUserOwnsDomainResponse = unmarshalCheckUserOwnsDomainResponse;
|
|
231
246
|
exports.unmarshalDnsRecords = unmarshalDnsRecords;
|
|
232
247
|
exports.unmarshalHosting = unmarshalHosting;
|
|
233
248
|
exports.unmarshalListControlPanelsResponse = unmarshalListControlPanelsResponse;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import type { DefaultValues } from '../../../bridge';
|
|
2
|
-
import type { CreateHostingRequest, DnsRecords, Hosting, ListControlPanelsResponse, ListHostingsResponse, ListOffersResponse, ResetHostingPasswordResponse, Session, UpdateHostingRequest } from './types.gen';
|
|
2
|
+
import type { CheckUserOwnsDomainRequest, CheckUserOwnsDomainResponse, CreateHostingRequest, DnsRecords, Hosting, ListControlPanelsResponse, ListHostingsResponse, ListOffersResponse, ResetHostingPasswordResponse, Session, UpdateHostingRequest } from './types.gen';
|
|
3
3
|
export declare const unmarshalHosting: (data: unknown) => Hosting;
|
|
4
|
+
export declare const unmarshalCheckUserOwnsDomainResponse: (data: unknown) => CheckUserOwnsDomainResponse;
|
|
4
5
|
export declare const unmarshalDnsRecords: (data: unknown) => DnsRecords;
|
|
5
6
|
export declare const unmarshalListControlPanelsResponse: (data: unknown) => ListControlPanelsResponse;
|
|
6
7
|
export declare const unmarshalListHostingsResponse: (data: unknown) => ListHostingsResponse;
|
|
7
8
|
export declare const unmarshalListOffersResponse: (data: unknown) => ListOffersResponse;
|
|
8
9
|
export declare const unmarshalResetHostingPasswordResponse: (data: unknown) => ResetHostingPasswordResponse;
|
|
9
10
|
export declare const unmarshalSession: (data: unknown) => Session;
|
|
11
|
+
export declare const marshalCheckUserOwnsDomainRequest: (request: CheckUserOwnsDomainRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
10
12
|
export declare const marshalCreateHostingRequest: (request: CreateHostingRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
11
13
|
export declare const marshalUpdateHostingRequest: (request: UpdateHostingRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
@@ -56,6 +56,16 @@ const unmarshalHosting = (data) => {
|
|
|
56
56
|
username: data.username
|
|
57
57
|
};
|
|
58
58
|
};
|
|
59
|
+
const unmarshalCheckUserOwnsDomainResponse = (data) => {
|
|
60
|
+
if (!isJSONObject(data)) {
|
|
61
|
+
throw new TypeError(
|
|
62
|
+
`Unmarshalling the type 'CheckUserOwnsDomainResponse' failed as data isn't a dictionary.`
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
return {
|
|
66
|
+
ownsDomain: data.owns_domain
|
|
67
|
+
};
|
|
68
|
+
};
|
|
59
69
|
const unmarshalDnsRecord = (data) => {
|
|
60
70
|
if (!isJSONObject(data)) {
|
|
61
71
|
throw new TypeError(
|
|
@@ -199,6 +209,9 @@ const unmarshalSession = (data) => {
|
|
|
199
209
|
url: data.url
|
|
200
210
|
};
|
|
201
211
|
};
|
|
212
|
+
const marshalCheckUserOwnsDomainRequest = (request, defaults) => ({
|
|
213
|
+
project_id: request.projectId ?? defaults.defaultProjectId
|
|
214
|
+
});
|
|
202
215
|
const marshalCreateHostingRequestDomainConfiguration = (request, defaults) => ({
|
|
203
216
|
update_all_records: request.updateAllRecords,
|
|
204
217
|
update_mail_record: request.updateMailRecord,
|
|
@@ -225,8 +238,10 @@ const marshalUpdateHostingRequest = (request, defaults) => ({
|
|
|
225
238
|
tags: request.tags
|
|
226
239
|
});
|
|
227
240
|
export {
|
|
241
|
+
marshalCheckUserOwnsDomainRequest,
|
|
228
242
|
marshalCreateHostingRequest,
|
|
229
243
|
marshalUpdateHostingRequest,
|
|
244
|
+
unmarshalCheckUserOwnsDomainResponse,
|
|
230
245
|
unmarshalDnsRecords,
|
|
231
246
|
unmarshalHosting,
|
|
232
247
|
unmarshalListControlPanelsResponse,
|
|
@@ -153,6 +153,21 @@ export interface Offer {
|
|
|
153
153
|
/** Name of the control panel. */
|
|
154
154
|
controlPanelName: string;
|
|
155
155
|
}
|
|
156
|
+
export type CheckUserOwnsDomainRequest = {
|
|
157
|
+
/**
|
|
158
|
+
* Region to target. If none is passed will use default region from the
|
|
159
|
+
* config.
|
|
160
|
+
*/
|
|
161
|
+
region?: Region;
|
|
162
|
+
/** Domain for which ownership is to be verified. */
|
|
163
|
+
domain: string;
|
|
164
|
+
/** ID of the project currently in use. */
|
|
165
|
+
projectId?: string;
|
|
166
|
+
};
|
|
167
|
+
export interface CheckUserOwnsDomainResponse {
|
|
168
|
+
/** Indicates whether the specified project owns the domain. */
|
|
169
|
+
ownsDomain: boolean;
|
|
170
|
+
}
|
|
156
171
|
export type CreateHostingRequest = {
|
|
157
172
|
/**
|
|
158
173
|
* Region to target. If none is passed will use default region from the
|
package/dist/bridge.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export { API } from './scw/api';
|
|
|
6
6
|
export type { DefaultValues } from './scw/client-settings';
|
|
7
7
|
export type { Money, ServiceInfo, ScwFile, TimeSeries, } from './scw/custom-types';
|
|
8
8
|
export { Decimal } from './scw/custom-types';
|
|
9
|
-
export { marshalScwFile, marshalMoney, marshalTimeSeries, marshalDecimal, unmarshalMoney, unmarshalScwFile, unmarshalServiceInfo, unmarshalTimeSeries, unmarshalTimeSeriesPoint, unmarshalDecimal, } from './scw/custom-marshalling';
|
|
9
|
+
export { marshalScwFile, marshalMoney, marshalTimeSeries, marshalDecimal, marshalBlobToScwFile, unmarshalMoney, unmarshalScwFile, unmarshalServiceInfo, unmarshalTimeSeries, unmarshalTimeSeriesPoint, unmarshalDecimal, } from './scw/custom-marshalling';
|
|
10
10
|
export { enrichForPagination } from './scw/fetch/resource-paginator';
|
|
11
11
|
export type { Region, Zone } from './scw/locality';
|
|
12
12
|
export { resolveOneOf, unmarshalDate, unmarshalArrayOfObject, unmarshalMapOfObject, urlParams, validatePathParam, } from './helpers/marshalling';
|
package/dist/index.cjs
CHANGED
|
@@ -67,6 +67,7 @@ exports.waitForResource = intervalRetrier.waitForResource;
|
|
|
67
67
|
exports.addAsyncHeaderInterceptor = helpers.addAsyncHeaderInterceptor;
|
|
68
68
|
exports.API = api.API;
|
|
69
69
|
exports.authenticateWithSessionToken = auth.authenticateWithSessionToken;
|
|
70
|
+
exports.marshalBlobToScwFile = customMarshalling.marshalBlobToScwFile;
|
|
70
71
|
exports.marshalDecimal = customMarshalling.marshalDecimal;
|
|
71
72
|
exports.marshalMoney = customMarshalling.marshalMoney;
|
|
72
73
|
exports.marshalScwFile = customMarshalling.marshalScwFile;
|
package/dist/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import { createExponentialBackoffStrategy, tryAtIntervals, waitForResource } fro
|
|
|
8
8
|
import { addAsyncHeaderInterceptor } from "./internal/interceptors/helpers.js";
|
|
9
9
|
import { API } from "./scw/api.js";
|
|
10
10
|
import { authenticateWithSessionToken } from "./scw/auth.js";
|
|
11
|
-
import { marshalDecimal, marshalMoney, marshalScwFile, marshalTimeSeries, unmarshalDecimal, unmarshalMoney, unmarshalScwFile, unmarshalServiceInfo, unmarshalTimeSeries, unmarshalTimeSeriesPoint } from "./scw/custom-marshalling.js";
|
|
11
|
+
import { marshalBlobToScwFile, marshalDecimal, marshalMoney, marshalScwFile, marshalTimeSeries, unmarshalDecimal, unmarshalMoney, unmarshalScwFile, unmarshalServiceInfo, unmarshalTimeSeries, unmarshalTimeSeriesPoint } from "./scw/custom-marshalling.js";
|
|
12
12
|
import { resolveOneOf, unmarshalArrayOfObject, unmarshalDate, unmarshalMapOfObject, urlParams, validatePathParam } from "./helpers/marshalling.js";
|
|
13
13
|
import { enrichForPagination } from "./scw/fetch/resource-paginator.js";
|
|
14
14
|
import * as index$1 from "./api/account/index.js";
|
|
@@ -93,6 +93,7 @@ export {
|
|
|
93
93
|
enableConsoleLogger,
|
|
94
94
|
enrichForPagination,
|
|
95
95
|
isJSONObject,
|
|
96
|
+
marshalBlobToScwFile,
|
|
96
97
|
marshalDecimal,
|
|
97
98
|
marshalMoney,
|
|
98
99
|
marshalScwFile,
|
package/dist/internals.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export { addAsyncHeaderInterceptor } from './internal/interceptors/helpers';
|
|
|
4
4
|
export { API } from './scw/api';
|
|
5
5
|
export { authenticateWithSessionToken } from './scw/auth';
|
|
6
6
|
export type { DefaultValues } from './scw/client-settings';
|
|
7
|
-
export { marshalDecimal, marshalScwFile, marshalMoney, marshalTimeSeries, unmarshalDecimal, unmarshalMoney, unmarshalScwFile, unmarshalServiceInfo, unmarshalTimeSeries, unmarshalTimeSeriesPoint, } from './scw/custom-marshalling';
|
|
7
|
+
export { marshalDecimal, marshalScwFile, marshalMoney, marshalTimeSeries, marshalBlobToScwFile, unmarshalDecimal, unmarshalMoney, unmarshalScwFile, unmarshalServiceInfo, unmarshalTimeSeries, unmarshalTimeSeriesPoint, } from './scw/custom-marshalling';
|
|
8
8
|
export type { ServiceInfo } from './scw/custom-types';
|
|
9
9
|
export { resolveOneOf, unmarshalDate, unmarshalArrayOfObject, unmarshalMapOfObject, urlParams, validatePathParam, } from './helpers/marshalling';
|
|
10
10
|
export { enrichForPagination } from './scw/fetch/resource-paginator';
|
package/dist/scw/constants.cjs
CHANGED
package/dist/scw/constants.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "v2.
|
|
2
|
-
export declare const userAgent = "scaleway-sdk-js/v2.
|
|
1
|
+
export declare const version = "v2.40.0";
|
|
2
|
+
export declare const userAgent = "scaleway-sdk-js/v2.40.0";
|
package/dist/scw/constants.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const json = require("../helpers/json.cjs");
|
|
4
4
|
const marshalling = require("../helpers/marshalling.cjs");
|
|
5
|
+
const index = require("../vendor/base64/index.cjs");
|
|
5
6
|
const customTypes = require("./custom-types.cjs");
|
|
6
7
|
const unmarshalMoney = (data) => {
|
|
7
8
|
if (!json.isJSONObject(data)) {
|
|
@@ -76,6 +77,11 @@ const marshalScwFile = (obj) => ({
|
|
|
76
77
|
content_type: obj.contentType,
|
|
77
78
|
name: obj.name
|
|
78
79
|
});
|
|
80
|
+
const marshalBlobToScwFile = async (blob) => ({
|
|
81
|
+
content: index.fromByteArray(new Uint8Array(await blob.arrayBuffer())),
|
|
82
|
+
content_type: blob.type,
|
|
83
|
+
name: "file"
|
|
84
|
+
});
|
|
79
85
|
const marshalMoney = (obj) => ({
|
|
80
86
|
currency_code: obj.currencyCode,
|
|
81
87
|
nanos: obj.nanos,
|
|
@@ -91,6 +97,7 @@ const marshalTimeSeries = (obj) => ({
|
|
|
91
97
|
points: obj.points.map((elt) => marshalTimeSeriesPoint(elt))
|
|
92
98
|
});
|
|
93
99
|
const marshalDecimal = (obj) => obj.toString();
|
|
100
|
+
exports.marshalBlobToScwFile = marshalBlobToScwFile;
|
|
94
101
|
exports.marshalDecimal = marshalDecimal;
|
|
95
102
|
exports.marshalMoney = marshalMoney;
|
|
96
103
|
exports.marshalScwFile = marshalScwFile;
|
|
@@ -46,6 +46,12 @@ export declare const unmarshalDecimal: (data: unknown) => Decimal;
|
|
|
46
46
|
* @internal
|
|
47
47
|
*/
|
|
48
48
|
export declare const marshalScwFile: (obj: ScwFile) => Record<string, unknown>;
|
|
49
|
+
/**
|
|
50
|
+
* Marshals {@link Blob}.
|
|
51
|
+
*
|
|
52
|
+
* @internal
|
|
53
|
+
*/
|
|
54
|
+
export declare const marshalBlobToScwFile: (blob: Blob) => Promise<Record<string, unknown>>;
|
|
49
55
|
/**
|
|
50
56
|
* Marshals {@link Money}
|
|
51
57
|
*
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { isJSONObject } from "../helpers/json.js";
|
|
2
2
|
import { unmarshalDate, unmarshalArrayOfObject } from "../helpers/marshalling.js";
|
|
3
|
+
import { fromByteArray } from "../vendor/base64/index.js";
|
|
3
4
|
import { Decimal } from "./custom-types.js";
|
|
4
5
|
const unmarshalMoney = (data) => {
|
|
5
6
|
if (!isJSONObject(data)) {
|
|
@@ -74,6 +75,11 @@ const marshalScwFile = (obj) => ({
|
|
|
74
75
|
content_type: obj.contentType,
|
|
75
76
|
name: obj.name
|
|
76
77
|
});
|
|
78
|
+
const marshalBlobToScwFile = async (blob) => ({
|
|
79
|
+
content: fromByteArray(new Uint8Array(await blob.arrayBuffer())),
|
|
80
|
+
content_type: blob.type,
|
|
81
|
+
name: "file"
|
|
82
|
+
});
|
|
77
83
|
const marshalMoney = (obj) => ({
|
|
78
84
|
currency_code: obj.currencyCode,
|
|
79
85
|
nanos: obj.nanos,
|
|
@@ -90,6 +96,7 @@ const marshalTimeSeries = (obj) => ({
|
|
|
90
96
|
});
|
|
91
97
|
const marshalDecimal = (obj) => obj.toString();
|
|
92
98
|
export {
|
|
99
|
+
marshalBlobToScwFile,
|
|
93
100
|
marshalDecimal,
|
|
94
101
|
marshalMoney,
|
|
95
102
|
marshalScwFile,
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
var lookup = [];
|
|
4
|
+
var code = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
5
|
+
for (var i = 0, len = code.length; i < len; ++i) {
|
|
6
|
+
lookup[i] = code[i];
|
|
7
|
+
}
|
|
8
|
+
function tripletToBase64(num) {
|
|
9
|
+
return lookup[num >> 18 & 63] + lookup[num >> 12 & 63] + lookup[num >> 6 & 63] + lookup[num & 63];
|
|
10
|
+
}
|
|
11
|
+
function encodeChunk(uint8, start, end) {
|
|
12
|
+
var tmp;
|
|
13
|
+
var output = [];
|
|
14
|
+
for (var i = start; i < end; i += 3) {
|
|
15
|
+
tmp = (uint8[i] << 16 & 16711680) + (uint8[i + 1] << 8 & 65280) + (uint8[i + 2] & 255);
|
|
16
|
+
output.push(tripletToBase64(tmp));
|
|
17
|
+
}
|
|
18
|
+
return output.join("");
|
|
19
|
+
}
|
|
20
|
+
function fromByteArray(uint8) {
|
|
21
|
+
var tmp;
|
|
22
|
+
var len = uint8.length;
|
|
23
|
+
var extraBytes = len % 3;
|
|
24
|
+
var parts = [];
|
|
25
|
+
var maxChunkLength = 16383;
|
|
26
|
+
for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
|
|
27
|
+
parts.push(encodeChunk(uint8, i, i + maxChunkLength > len2 ? len2 : i + maxChunkLength));
|
|
28
|
+
}
|
|
29
|
+
if (extraBytes === 1) {
|
|
30
|
+
tmp = uint8[len - 1];
|
|
31
|
+
parts.push(
|
|
32
|
+
lookup[tmp >> 2] + lookup[tmp << 4 & 63] + "=="
|
|
33
|
+
);
|
|
34
|
+
} else if (extraBytes === 2) {
|
|
35
|
+
tmp = (uint8[len - 2] << 8) + uint8[len - 1];
|
|
36
|
+
parts.push(
|
|
37
|
+
lookup[tmp >> 10] + lookup[tmp >> 4 & 63] + lookup[tmp << 2 & 63] + "="
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
return parts.join("");
|
|
41
|
+
}
|
|
42
|
+
exports.fromByteArray = fromByteArray;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
var lookup = [];
|
|
2
|
+
var code = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
3
|
+
for (var i = 0, len = code.length; i < len; ++i) {
|
|
4
|
+
lookup[i] = code[i];
|
|
5
|
+
}
|
|
6
|
+
function tripletToBase64(num) {
|
|
7
|
+
return lookup[num >> 18 & 63] + lookup[num >> 12 & 63] + lookup[num >> 6 & 63] + lookup[num & 63];
|
|
8
|
+
}
|
|
9
|
+
function encodeChunk(uint8, start, end) {
|
|
10
|
+
var tmp;
|
|
11
|
+
var output = [];
|
|
12
|
+
for (var i = start; i < end; i += 3) {
|
|
13
|
+
tmp = (uint8[i] << 16 & 16711680) + (uint8[i + 1] << 8 & 65280) + (uint8[i + 2] & 255);
|
|
14
|
+
output.push(tripletToBase64(tmp));
|
|
15
|
+
}
|
|
16
|
+
return output.join("");
|
|
17
|
+
}
|
|
18
|
+
function fromByteArray(uint8) {
|
|
19
|
+
var tmp;
|
|
20
|
+
var len = uint8.length;
|
|
21
|
+
var extraBytes = len % 3;
|
|
22
|
+
var parts = [];
|
|
23
|
+
var maxChunkLength = 16383;
|
|
24
|
+
for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
|
|
25
|
+
parts.push(encodeChunk(uint8, i, i + maxChunkLength > len2 ? len2 : i + maxChunkLength));
|
|
26
|
+
}
|
|
27
|
+
if (extraBytes === 1) {
|
|
28
|
+
tmp = uint8[len - 1];
|
|
29
|
+
parts.push(
|
|
30
|
+
lookup[tmp >> 2] + lookup[tmp << 4 & 63] + "=="
|
|
31
|
+
);
|
|
32
|
+
} else if (extraBytes === 2) {
|
|
33
|
+
tmp = (uint8[len - 2] << 8) + uint8[len - 1];
|
|
34
|
+
parts.push(
|
|
35
|
+
lookup[tmp >> 10] + lookup[tmp >> 4 & 63] + lookup[tmp << 2 & 63] + "="
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
return parts.join("");
|
|
39
|
+
}
|
|
40
|
+
export {
|
|
41
|
+
fromByteArray
|
|
42
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scaleway/sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.41.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Scaleway SDK.",
|
|
6
6
|
"keywords": [
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"bundledDependencies": [
|
|
40
40
|
"@scaleway/random-name"
|
|
41
41
|
],
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "33be5736d009849b28bef4e66a0a2c6aec80827b"
|
|
43
43
|
}
|