@scaleway/sdk 2.49.1 → 2.50.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/dedibox/v1/types.gen.d.ts +1 -1
- package/dist/api/edge_services/v1alpha1/api.gen.cjs +14 -0
- package/dist/api/edge_services/v1alpha1/api.gen.d.ts +9 -1
- package/dist/api/edge_services/v1alpha1/api.gen.js +15 -1
- package/dist/api/edge_services/v1alpha1/index.gen.d.ts +1 -1
- package/dist/api/edge_services/v1alpha1/marshalling.gen.cjs +31 -13
- package/dist/api/edge_services/v1alpha1/marshalling.gen.d.ts +2 -1
- package/dist/api/edge_services/v1alpha1/marshalling.gen.js +31 -13
- package/dist/api/edge_services/v1alpha1/types.gen.d.ts +28 -1
- package/dist/api/iam/v1alpha1/marshalling.gen.cjs +8 -0
- package/dist/api/iam/v1alpha1/marshalling.gen.js +8 -0
- package/dist/api/iam/v1alpha1/types.gen.d.ts +16 -0
- package/dist/api/jobs/v1alpha1/api.gen.cjs +46 -0
- package/dist/api/jobs/v1alpha1/api.gen.d.ts +6 -1
- package/dist/api/jobs/v1alpha1/api.gen.js +47 -1
- package/dist/api/jobs/v1alpha1/index.gen.d.ts +1 -1
- package/dist/api/jobs/v1alpha1/marshalling.gen.cjs +80 -0
- package/dist/api/jobs/v1alpha1/marshalling.gen.d.ts +6 -1
- package/dist/api/jobs/v1alpha1/marshalling.gen.js +81 -1
- package/dist/api/jobs/v1alpha1/types.gen.d.ts +81 -0
- package/dist/api/jobs/v1alpha1/validation-rules.gen.cjs +12 -0
- package/dist/api/jobs/v1alpha1/validation-rules.gen.d.ts +10 -0
- package/dist/api/jobs/v1alpha1/validation-rules.gen.js +13 -1
- package/dist/api/tem/v1alpha1/index.gen.d.ts +1 -1
- package/dist/api/tem/v1alpha1/marshalling.gen.cjs +13 -0
- package/dist/api/tem/v1alpha1/marshalling.gen.js +13 -0
- package/dist/api/tem/v1alpha1/types.gen.d.ts +13 -2
- package/dist/scw/constants.cjs +1 -1
- package/dist/scw/constants.d.ts +2 -2
- package/dist/scw/constants.js +1 -1
- package/package.json +2 -2
|
@@ -36,7 +36,7 @@ export type ListServersRequestOrderBy = 'created_at_asc' | 'created_at_desc';
|
|
|
36
36
|
export type ListServicesRequestOrderBy = 'created_at_asc' | 'created_at_desc';
|
|
37
37
|
export type LogAction = 'unknown_log_action' | 'group_created' | 'group_deleted' | 'members_added' | 'members_deleted' | 'description_updated' | 'rpnv1_members_added' | 'rpnv1_members_deleted' | 'vlan_updated' | 'vlan_updated_on_all_servers';
|
|
38
38
|
export type LogStatus = 'unknown_log_status' | 'success' | 'in_progress' | 'error';
|
|
39
|
-
export type MemoryType = 'ddr2' | 'ddr3' | 'ddr4';
|
|
39
|
+
export type MemoryType = 'ddr2' | 'ddr3' | 'ddr4' | 'ddr5';
|
|
40
40
|
export type NetworkInterfaceInterfaceType = 'unknown' | 'normal' | 'ipmi' | 'virtual';
|
|
41
41
|
export type OSArch = 'unknown_arch' | 'amd64' | 'x86' | 'arm' | 'arm64';
|
|
42
42
|
export type OSType = 'unknown_type' | 'server' | 'virtu' | 'panel' | 'desktop' | 'custom' | 'rescue';
|
|
@@ -624,5 +624,19 @@ class API extends api.API {
|
|
|
624
624
|
method: "DELETE",
|
|
625
625
|
path: `/edge-services/v1alpha1/current-plan/${marshalling.validatePathParam("projectId", request.projectId ?? this.client.settings.defaultProjectId)}`
|
|
626
626
|
});
|
|
627
|
+
/**
|
|
628
|
+
* Gives information on current edge-services subscription plan and used
|
|
629
|
+
* resources with associated price.
|
|
630
|
+
*
|
|
631
|
+
* @param request - The request {@link GetBillingRequest}
|
|
632
|
+
* @returns A Promise of GetBillingResponse
|
|
633
|
+
*/
|
|
634
|
+
getBilling = (request = {}) => this.client.fetch(
|
|
635
|
+
{
|
|
636
|
+
method: "GET",
|
|
637
|
+
path: `/edge-services/v1alpha1/billing/${marshalling.validatePathParam("projectId", request.projectId ?? this.client.settings.defaultProjectId)}`
|
|
638
|
+
},
|
|
639
|
+
marshalling_gen.unmarshalGetBillingResponse
|
|
640
|
+
);
|
|
627
641
|
}
|
|
628
642
|
exports.API = API;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { API as ParentAPI } from '../../../bridge';
|
|
2
2
|
import type { WaitForOptions } from '../../../bridge';
|
|
3
|
-
import type { BackendStage, CacheStage, CheckDomainRequest, CheckDomainResponse, CheckLbOriginRequest, CheckLbOriginResponse, CheckPEMChainRequest, CheckPEMChainResponse, CreateBackendStageRequest, CreateCacheStageRequest, CreateDNSStageRequest, CreatePipelineRequest, CreatePurgeRequestRequest, CreateTLSStageRequest, DNSStage, DeleteBackendStageRequest, DeleteCacheStageRequest, DeleteCurrentPlanRequest, DeleteDNSStageRequest, DeletePipelineRequest, DeleteTLSStageRequest, GetBackendStageRequest, GetCacheStageRequest, GetCurrentPlanRequest, GetDNSStageRequest, GetPipelineRequest, GetPurgeRequestRequest, GetTLSStageRequest, ListBackendStagesRequest, ListBackendStagesResponse, ListCacheStagesRequest, ListCacheStagesResponse, ListDNSStagesRequest, ListDNSStagesResponse, ListPipelinesRequest, ListPipelinesResponse, ListPlansResponse, ListPurgeRequestsRequest, ListPurgeRequestsResponse, ListTLSStagesRequest, ListTLSStagesResponse, Pipeline, Plan, PurgeRequest, SelectPlanRequest, TLSStage, UpdateBackendStageRequest, UpdateCacheStageRequest, UpdateDNSStageRequest, UpdatePipelineRequest, UpdateTLSStageRequest } from './types.gen';
|
|
3
|
+
import type { BackendStage, CacheStage, CheckDomainRequest, CheckDomainResponse, CheckLbOriginRequest, CheckLbOriginResponse, CheckPEMChainRequest, CheckPEMChainResponse, CreateBackendStageRequest, CreateCacheStageRequest, CreateDNSStageRequest, CreatePipelineRequest, CreatePurgeRequestRequest, CreateTLSStageRequest, DNSStage, DeleteBackendStageRequest, DeleteCacheStageRequest, DeleteCurrentPlanRequest, DeleteDNSStageRequest, DeletePipelineRequest, DeleteTLSStageRequest, GetBackendStageRequest, GetBillingRequest, GetBillingResponse, GetCacheStageRequest, GetCurrentPlanRequest, GetDNSStageRequest, GetPipelineRequest, GetPurgeRequestRequest, GetTLSStageRequest, ListBackendStagesRequest, ListBackendStagesResponse, ListCacheStagesRequest, ListCacheStagesResponse, ListDNSStagesRequest, ListDNSStagesResponse, ListPipelinesRequest, ListPipelinesResponse, ListPlansResponse, ListPurgeRequestsRequest, ListPurgeRequestsResponse, ListTLSStagesRequest, ListTLSStagesResponse, Pipeline, Plan, PurgeRequest, SelectPlanRequest, TLSStage, UpdateBackendStageRequest, UpdateCacheStageRequest, UpdateDNSStageRequest, UpdatePipelineRequest, UpdateTLSStageRequest } from './types.gen';
|
|
4
4
|
/** Edge Services API. */
|
|
5
5
|
export declare class API extends ParentAPI {
|
|
6
6
|
protected pageOfListPipelines: (request?: Readonly<ListPipelinesRequest>) => Promise<ListPipelinesResponse>;
|
|
@@ -301,4 +301,12 @@ export declare class API extends ParentAPI {
|
|
|
301
301
|
selectPlan: (request?: Readonly<SelectPlanRequest>) => Promise<Plan>;
|
|
302
302
|
getCurrentPlan: (request?: Readonly<GetCurrentPlanRequest>) => Promise<Plan>;
|
|
303
303
|
deleteCurrentPlan: (request?: Readonly<DeleteCurrentPlanRequest>) => Promise<void>;
|
|
304
|
+
/**
|
|
305
|
+
* Gives information on current edge-services subscription plan and used
|
|
306
|
+
* resources with associated price.
|
|
307
|
+
*
|
|
308
|
+
* @param request - The request {@link GetBillingRequest}
|
|
309
|
+
* @returns A Promise of GetBillingResponse
|
|
310
|
+
*/
|
|
311
|
+
getBilling: (request?: Readonly<GetBillingRequest>) => Promise<GetBillingResponse>;
|
|
304
312
|
}
|
|
@@ -4,7 +4,7 @@ import { urlParams, validatePathParam } from "../../../helpers/marshalling.js";
|
|
|
4
4
|
import "../../../vendor/base64/index.js";
|
|
5
5
|
import { enrichForPagination } from "../../../scw/fetch/resource-paginator.js";
|
|
6
6
|
import { PIPELINE_TRANSIENT_STATUSES, PURGE_REQUEST_TRANSIENT_STATUSES } from "./content.gen.js";
|
|
7
|
-
import { unmarshalListPipelinesResponse, marshalCreatePipelineRequest, unmarshalPipeline, marshalUpdatePipelineRequest, unmarshalListDNSStagesResponse, marshalCreateDNSStageRequest, unmarshalDNSStage, marshalUpdateDNSStageRequest, unmarshalListTLSStagesResponse, marshalCreateTLSStageRequest, unmarshalTLSStage, marshalUpdateTLSStageRequest, unmarshalListCacheStagesResponse, marshalCreateCacheStageRequest, unmarshalCacheStage, marshalUpdateCacheStageRequest, unmarshalListBackendStagesResponse, marshalCreateBackendStageRequest, unmarshalBackendStage, marshalUpdateBackendStageRequest, marshalCheckDomainRequest, unmarshalCheckDomainResponse, marshalCheckPEMChainRequest, unmarshalCheckPEMChainResponse, unmarshalListPurgeRequestsResponse, marshalCreatePurgeRequestRequest, unmarshalPurgeRequest, marshalCheckLbOriginRequest, unmarshalCheckLbOriginResponse, unmarshalListPlansResponse, marshalSelectPlanRequest, unmarshalPlan } from "./marshalling.gen.js";
|
|
7
|
+
import { unmarshalListPipelinesResponse, marshalCreatePipelineRequest, unmarshalPipeline, marshalUpdatePipelineRequest, unmarshalListDNSStagesResponse, marshalCreateDNSStageRequest, unmarshalDNSStage, marshalUpdateDNSStageRequest, unmarshalListTLSStagesResponse, marshalCreateTLSStageRequest, unmarshalTLSStage, marshalUpdateTLSStageRequest, unmarshalListCacheStagesResponse, marshalCreateCacheStageRequest, unmarshalCacheStage, marshalUpdateCacheStageRequest, unmarshalListBackendStagesResponse, marshalCreateBackendStageRequest, unmarshalBackendStage, marshalUpdateBackendStageRequest, marshalCheckDomainRequest, unmarshalCheckDomainResponse, marshalCheckPEMChainRequest, unmarshalCheckPEMChainResponse, unmarshalListPurgeRequestsResponse, marshalCreatePurgeRequestRequest, unmarshalPurgeRequest, marshalCheckLbOriginRequest, unmarshalCheckLbOriginResponse, unmarshalListPlansResponse, marshalSelectPlanRequest, unmarshalPlan, unmarshalGetBillingResponse } from "./marshalling.gen.js";
|
|
8
8
|
const jsonContentHeaders = {
|
|
9
9
|
"Content-Type": "application/json; charset=utf-8"
|
|
10
10
|
};
|
|
@@ -622,6 +622,20 @@ class API extends API$1 {
|
|
|
622
622
|
method: "DELETE",
|
|
623
623
|
path: `/edge-services/v1alpha1/current-plan/${validatePathParam("projectId", request.projectId ?? this.client.settings.defaultProjectId)}`
|
|
624
624
|
});
|
|
625
|
+
/**
|
|
626
|
+
* Gives information on current edge-services subscription plan and used
|
|
627
|
+
* resources with associated price.
|
|
628
|
+
*
|
|
629
|
+
* @param request - The request {@link GetBillingRequest}
|
|
630
|
+
* @returns A Promise of GetBillingResponse
|
|
631
|
+
*/
|
|
632
|
+
getBilling = (request = {}) => this.client.fetch(
|
|
633
|
+
{
|
|
634
|
+
method: "GET",
|
|
635
|
+
path: `/edge-services/v1alpha1/billing/${validatePathParam("projectId", request.projectId ?? this.client.settings.defaultProjectId)}`
|
|
636
|
+
},
|
|
637
|
+
unmarshalGetBillingResponse
|
|
638
|
+
);
|
|
625
639
|
}
|
|
626
640
|
export {
|
|
627
641
|
API
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { API } from './api.gen';
|
|
2
2
|
export * from './content.gen';
|
|
3
|
-
export type { BackendStage, CacheStage, CheckDomainRequest, CheckDomainResponse, CheckLbOriginRequest, CheckLbOriginResponse, CheckPEMChainRequest, CheckPEMChainRequestSecretChain, CheckPEMChainResponse, CreateBackendStageRequest, CreateCacheStageRequest, CreateDNSStageRequest, CreatePipelineRequest, CreatePurgeRequestRequest, CreateTLSStageRequest, DNSStage, DNSStageType, DeleteBackendStageRequest, DeleteCacheStageRequest, DeleteCurrentPlanRequest, DeleteDNSStageRequest, DeletePipelineRequest, DeleteTLSStageRequest, GetBackendStageRequest, GetCacheStageRequest, GetCurrentPlanRequest, GetDNSStageRequest, GetPipelineRequest, GetPurgeRequestRequest, GetTLSStageRequest, LbOriginError, ListBackendStagesRequest, ListBackendStagesRequestOrderBy, ListBackendStagesResponse, ListCacheStagesRequest, ListCacheStagesRequestOrderBy, ListCacheStagesResponse, ListDNSStagesRequest, ListDNSStagesRequestOrderBy, ListDNSStagesResponse, ListPipelinesRequest, ListPipelinesRequestOrderBy, ListPipelinesResponse, ListPlansResponse, ListPurgeRequestsRequest, ListPurgeRequestsRequestOrderBy, ListPurgeRequestsResponse, ListTLSStagesRequest, ListTLSStagesRequestOrderBy, ListTLSStagesResponse, Pipeline, PipelineError, PipelineErrorCode, PipelineErrorSeverity, PipelineErrorStage, PipelineErrorType, PipelineStatus, Plan, PlanDetails, PlanName, PurgeRequest, PurgeRequestStatus, ScalewayLb, ScalewayLbBackendConfig, ScalewayS3BackendConfig, SelectPlanRequest, TLSSecret, TLSSecretsConfig, TLSStage, UpdateBackendStageRequest, UpdateCacheStageRequest, UpdateDNSStageRequest, UpdatePipelineRequest, UpdateTLSStageRequest, } from './types.gen';
|
|
3
|
+
export type { BackendStage, CacheStage, CheckDomainRequest, CheckDomainResponse, CheckLbOriginRequest, CheckLbOriginResponse, CheckPEMChainRequest, CheckPEMChainRequestSecretChain, CheckPEMChainResponse, CreateBackendStageRequest, CreateCacheStageRequest, CreateDNSStageRequest, CreatePipelineRequest, CreatePurgeRequestRequest, CreateTLSStageRequest, DNSStage, DNSStageType, DeleteBackendStageRequest, DeleteCacheStageRequest, DeleteCurrentPlanRequest, DeleteDNSStageRequest, DeletePipelineRequest, DeleteTLSStageRequest, GetBackendStageRequest, GetBillingRequest, GetBillingResponse, GetCacheStageRequest, GetCurrentPlanRequest, GetDNSStageRequest, GetPipelineRequest, GetPurgeRequestRequest, GetTLSStageRequest, LbOriginError, ListBackendStagesRequest, ListBackendStagesRequestOrderBy, ListBackendStagesResponse, ListCacheStagesRequest, ListCacheStagesRequestOrderBy, ListCacheStagesResponse, ListDNSStagesRequest, ListDNSStagesRequestOrderBy, ListDNSStagesResponse, ListPipelinesRequest, ListPipelinesRequestOrderBy, ListPipelinesResponse, ListPlansResponse, ListPurgeRequestsRequest, ListPurgeRequestsRequestOrderBy, ListPurgeRequestsResponse, ListTLSStagesRequest, ListTLSStagesRequestOrderBy, ListTLSStagesResponse, Pipeline, PipelineError, PipelineErrorCode, PipelineErrorSeverity, PipelineErrorStage, PipelineErrorType, PipelineStatus, Plan, PlanDetails, PlanName, PurgeRequest, PurgeRequestStatus, ScalewayLb, ScalewayLbBackendConfig, ScalewayS3BackendConfig, SelectPlanRequest, TLSSecret, TLSSecretsConfig, TLSStage, UpdateBackendStageRequest, UpdateCacheStageRequest, UpdateDNSStageRequest, UpdatePipelineRequest, UpdateTLSStageRequest, } from './types.gen';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const json = require("../../../helpers/json.cjs");
|
|
4
|
+
const customMarshalling = require("../../../scw/custom-marshalling.cjs");
|
|
4
5
|
const marshalling = require("../../../helpers/marshalling.cjs");
|
|
5
|
-
require("../../../vendor/base64/index.cjs");
|
|
6
6
|
const unmarshalScalewayLb = (data) => {
|
|
7
7
|
if (!json.isJSONObject(data)) {
|
|
8
8
|
throw new TypeError(
|
|
@@ -199,6 +199,35 @@ const unmarshalCheckPEMChainResponse = (data) => {
|
|
|
199
199
|
isValid: data.is_valid
|
|
200
200
|
};
|
|
201
201
|
};
|
|
202
|
+
const unmarshalPlanDetails = (data) => {
|
|
203
|
+
if (!json.isJSONObject(data)) {
|
|
204
|
+
throw new TypeError(
|
|
205
|
+
`Unmarshalling the type 'PlanDetails' failed as data isn't a dictionary.`
|
|
206
|
+
);
|
|
207
|
+
}
|
|
208
|
+
return {
|
|
209
|
+
packageGb: data.package_gb,
|
|
210
|
+
pipelineLimit: data.pipeline_limit,
|
|
211
|
+
planName: data.plan_name
|
|
212
|
+
};
|
|
213
|
+
};
|
|
214
|
+
const unmarshalGetBillingResponse = (data) => {
|
|
215
|
+
if (!json.isJSONObject(data)) {
|
|
216
|
+
throw new TypeError(
|
|
217
|
+
`Unmarshalling the type 'GetBillingResponse' failed as data isn't a dictionary.`
|
|
218
|
+
);
|
|
219
|
+
}
|
|
220
|
+
return {
|
|
221
|
+
currentPlan: data.current_plan ? unmarshalPlanDetails(data.current_plan) : void 0,
|
|
222
|
+
currentPlanCacheUsage: data.current_plan_cache_usage,
|
|
223
|
+
extraCacheCost: data.extra_cache_cost ? customMarshalling.unmarshalMoney(data.extra_cache_cost) : void 0,
|
|
224
|
+
extraCacheUsage: data.extra_cache_usage,
|
|
225
|
+
extraPipelinesCost: data.extra_pipelines_cost ? customMarshalling.unmarshalMoney(data.extra_pipelines_cost) : void 0,
|
|
226
|
+
pipelineNumber: data.pipeline_number,
|
|
227
|
+
planCost: data.plan_cost ? customMarshalling.unmarshalMoney(data.plan_cost) : void 0,
|
|
228
|
+
totalCost: data.total_cost ? customMarshalling.unmarshalMoney(data.total_cost) : void 0
|
|
229
|
+
};
|
|
230
|
+
};
|
|
202
231
|
const unmarshalListBackendStagesResponse = (data) => {
|
|
203
232
|
if (!json.isJSONObject(data)) {
|
|
204
233
|
throw new TypeError(
|
|
@@ -243,18 +272,6 @@ const unmarshalListPipelinesResponse = (data) => {
|
|
|
243
272
|
totalCount: data.total_count
|
|
244
273
|
};
|
|
245
274
|
};
|
|
246
|
-
const unmarshalPlanDetails = (data) => {
|
|
247
|
-
if (!json.isJSONObject(data)) {
|
|
248
|
-
throw new TypeError(
|
|
249
|
-
`Unmarshalling the type 'PlanDetails' failed as data isn't a dictionary.`
|
|
250
|
-
);
|
|
251
|
-
}
|
|
252
|
-
return {
|
|
253
|
-
packageGb: data.package_gb,
|
|
254
|
-
pipelineLimit: data.pipeline_limit,
|
|
255
|
-
planName: data.plan_name
|
|
256
|
-
};
|
|
257
|
-
};
|
|
258
275
|
const unmarshalListPlansResponse = (data) => {
|
|
259
276
|
if (!json.isJSONObject(data)) {
|
|
260
277
|
throw new TypeError(
|
|
@@ -461,6 +478,7 @@ exports.unmarshalCheckDomainResponse = unmarshalCheckDomainResponse;
|
|
|
461
478
|
exports.unmarshalCheckLbOriginResponse = unmarshalCheckLbOriginResponse;
|
|
462
479
|
exports.unmarshalCheckPEMChainResponse = unmarshalCheckPEMChainResponse;
|
|
463
480
|
exports.unmarshalDNSStage = unmarshalDNSStage;
|
|
481
|
+
exports.unmarshalGetBillingResponse = unmarshalGetBillingResponse;
|
|
464
482
|
exports.unmarshalListBackendStagesResponse = unmarshalListBackendStagesResponse;
|
|
465
483
|
exports.unmarshalListCacheStagesResponse = unmarshalListCacheStagesResponse;
|
|
466
484
|
exports.unmarshalListDNSStagesResponse = unmarshalListDNSStagesResponse;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DefaultValues } from '../../../bridge';
|
|
2
|
-
import type { BackendStage, CacheStage, CheckDomainRequest, CheckDomainResponse, CheckLbOriginRequest, CheckLbOriginResponse, CheckPEMChainRequest, CheckPEMChainResponse, CreateBackendStageRequest, CreateCacheStageRequest, CreateDNSStageRequest, CreatePipelineRequest, CreatePurgeRequestRequest, CreateTLSStageRequest, DNSStage, ListBackendStagesResponse, ListCacheStagesResponse, ListDNSStagesResponse, ListPipelinesResponse, ListPlansResponse, ListPurgeRequestsResponse, ListTLSStagesResponse, Pipeline, Plan, PurgeRequest, SelectPlanRequest, TLSStage, UpdateBackendStageRequest, UpdateCacheStageRequest, UpdateDNSStageRequest, UpdatePipelineRequest, UpdateTLSStageRequest } from './types.gen';
|
|
2
|
+
import type { BackendStage, CacheStage, CheckDomainRequest, CheckDomainResponse, CheckLbOriginRequest, CheckLbOriginResponse, CheckPEMChainRequest, CheckPEMChainResponse, CreateBackendStageRequest, CreateCacheStageRequest, CreateDNSStageRequest, CreatePipelineRequest, CreatePurgeRequestRequest, CreateTLSStageRequest, DNSStage, GetBillingResponse, ListBackendStagesResponse, ListCacheStagesResponse, ListDNSStagesResponse, ListPipelinesResponse, ListPlansResponse, ListPurgeRequestsResponse, ListTLSStagesResponse, Pipeline, Plan, PurgeRequest, SelectPlanRequest, TLSStage, UpdateBackendStageRequest, UpdateCacheStageRequest, UpdateDNSStageRequest, UpdatePipelineRequest, UpdateTLSStageRequest } from './types.gen';
|
|
3
3
|
export declare const unmarshalBackendStage: (data: unknown) => BackendStage;
|
|
4
4
|
export declare const unmarshalCacheStage: (data: unknown) => CacheStage;
|
|
5
5
|
export declare const unmarshalDNSStage: (data: unknown) => DNSStage;
|
|
@@ -9,6 +9,7 @@ export declare const unmarshalPurgeRequest: (data: unknown) => PurgeRequest;
|
|
|
9
9
|
export declare const unmarshalCheckDomainResponse: (data: unknown) => CheckDomainResponse;
|
|
10
10
|
export declare const unmarshalCheckLbOriginResponse: (data: unknown) => CheckLbOriginResponse;
|
|
11
11
|
export declare const unmarshalCheckPEMChainResponse: (data: unknown) => CheckPEMChainResponse;
|
|
12
|
+
export declare const unmarshalGetBillingResponse: (data: unknown) => GetBillingResponse;
|
|
12
13
|
export declare const unmarshalListBackendStagesResponse: (data: unknown) => ListBackendStagesResponse;
|
|
13
14
|
export declare const unmarshalListCacheStagesResponse: (data: unknown) => ListCacheStagesResponse;
|
|
14
15
|
export declare const unmarshalListDNSStagesResponse: (data: unknown) => ListDNSStagesResponse;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isJSONObject } from "../../../helpers/json.js";
|
|
2
|
+
import { unmarshalMoney } from "../../../scw/custom-marshalling.js";
|
|
2
3
|
import { unmarshalDate, unmarshalArrayOfObject, resolveOneOf } from "../../../helpers/marshalling.js";
|
|
3
|
-
import "../../../vendor/base64/index.js";
|
|
4
4
|
const unmarshalScalewayLb = (data) => {
|
|
5
5
|
if (!isJSONObject(data)) {
|
|
6
6
|
throw new TypeError(
|
|
@@ -197,6 +197,35 @@ const unmarshalCheckPEMChainResponse = (data) => {
|
|
|
197
197
|
isValid: data.is_valid
|
|
198
198
|
};
|
|
199
199
|
};
|
|
200
|
+
const unmarshalPlanDetails = (data) => {
|
|
201
|
+
if (!isJSONObject(data)) {
|
|
202
|
+
throw new TypeError(
|
|
203
|
+
`Unmarshalling the type 'PlanDetails' failed as data isn't a dictionary.`
|
|
204
|
+
);
|
|
205
|
+
}
|
|
206
|
+
return {
|
|
207
|
+
packageGb: data.package_gb,
|
|
208
|
+
pipelineLimit: data.pipeline_limit,
|
|
209
|
+
planName: data.plan_name
|
|
210
|
+
};
|
|
211
|
+
};
|
|
212
|
+
const unmarshalGetBillingResponse = (data) => {
|
|
213
|
+
if (!isJSONObject(data)) {
|
|
214
|
+
throw new TypeError(
|
|
215
|
+
`Unmarshalling the type 'GetBillingResponse' failed as data isn't a dictionary.`
|
|
216
|
+
);
|
|
217
|
+
}
|
|
218
|
+
return {
|
|
219
|
+
currentPlan: data.current_plan ? unmarshalPlanDetails(data.current_plan) : void 0,
|
|
220
|
+
currentPlanCacheUsage: data.current_plan_cache_usage,
|
|
221
|
+
extraCacheCost: data.extra_cache_cost ? unmarshalMoney(data.extra_cache_cost) : void 0,
|
|
222
|
+
extraCacheUsage: data.extra_cache_usage,
|
|
223
|
+
extraPipelinesCost: data.extra_pipelines_cost ? unmarshalMoney(data.extra_pipelines_cost) : void 0,
|
|
224
|
+
pipelineNumber: data.pipeline_number,
|
|
225
|
+
planCost: data.plan_cost ? unmarshalMoney(data.plan_cost) : void 0,
|
|
226
|
+
totalCost: data.total_cost ? unmarshalMoney(data.total_cost) : void 0
|
|
227
|
+
};
|
|
228
|
+
};
|
|
200
229
|
const unmarshalListBackendStagesResponse = (data) => {
|
|
201
230
|
if (!isJSONObject(data)) {
|
|
202
231
|
throw new TypeError(
|
|
@@ -241,18 +270,6 @@ const unmarshalListPipelinesResponse = (data) => {
|
|
|
241
270
|
totalCount: data.total_count
|
|
242
271
|
};
|
|
243
272
|
};
|
|
244
|
-
const unmarshalPlanDetails = (data) => {
|
|
245
|
-
if (!isJSONObject(data)) {
|
|
246
|
-
throw new TypeError(
|
|
247
|
-
`Unmarshalling the type 'PlanDetails' failed as data isn't a dictionary.`
|
|
248
|
-
);
|
|
249
|
-
}
|
|
250
|
-
return {
|
|
251
|
-
packageGb: data.package_gb,
|
|
252
|
-
pipelineLimit: data.pipeline_limit,
|
|
253
|
-
planName: data.plan_name
|
|
254
|
-
};
|
|
255
|
-
};
|
|
256
273
|
const unmarshalListPlansResponse = (data) => {
|
|
257
274
|
if (!isJSONObject(data)) {
|
|
258
275
|
throw new TypeError(
|
|
@@ -460,6 +477,7 @@ export {
|
|
|
460
477
|
unmarshalCheckLbOriginResponse,
|
|
461
478
|
unmarshalCheckPEMChainResponse,
|
|
462
479
|
unmarshalDNSStage,
|
|
480
|
+
unmarshalGetBillingResponse,
|
|
463
481
|
unmarshalListBackendStagesResponse,
|
|
464
482
|
unmarshalListCacheStagesResponse,
|
|
465
483
|
unmarshalListDNSStagesResponse,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Region, Zone } from '../../../bridge';
|
|
1
|
+
import type { Money, Region, Zone } from '../../../bridge';
|
|
2
2
|
export type DNSStageType = 'unknown_type' | 'auto' | 'managed' | 'custom';
|
|
3
3
|
export type LbOriginError = 'unknown' | 'timeout' | 'connection_refused' | 'tls_error';
|
|
4
4
|
export type ListBackendStagesRequestOrderBy = 'created_at_asc' | 'created_at_desc';
|
|
@@ -201,8 +201,11 @@ export interface CheckPEMChainRequestSecretChain {
|
|
|
201
201
|
secretRegion: string;
|
|
202
202
|
}
|
|
203
203
|
export interface PlanDetails {
|
|
204
|
+
/** Subscription plan name. */
|
|
204
205
|
planName: PlanName;
|
|
206
|
+
/** Amount of egress data from cache included in subscription plan. */
|
|
205
207
|
packageGb: number;
|
|
208
|
+
/** Number of pipeline included in subscription plan. */
|
|
206
209
|
pipelineLimit: number;
|
|
207
210
|
}
|
|
208
211
|
export interface PurgeRequest {
|
|
@@ -401,6 +404,30 @@ export type GetBackendStageRequest = {
|
|
|
401
404
|
/** ID of the requested backend stage. */
|
|
402
405
|
backendStageId: string;
|
|
403
406
|
};
|
|
407
|
+
export type GetBillingRequest = {
|
|
408
|
+
projectId?: string;
|
|
409
|
+
};
|
|
410
|
+
export interface GetBillingResponse {
|
|
411
|
+
/** Information on the current edge-service subscription plan. */
|
|
412
|
+
currentPlan?: PlanDetails;
|
|
413
|
+
/** Price of the current subscription plan. */
|
|
414
|
+
planCost?: Money;
|
|
415
|
+
/** Total number of pipeline currently configured. */
|
|
416
|
+
pipelineNumber: number;
|
|
417
|
+
/** Cost to date of the pipelines not included in the plans. */
|
|
418
|
+
extraPipelinesCost?: Money;
|
|
419
|
+
/** Total amount of data egressed from cache in current subscription plan. */
|
|
420
|
+
currentPlanCacheUsage: number;
|
|
421
|
+
/** Total amount of data egressed from cache not included in the plans. */
|
|
422
|
+
extraCacheUsage: number;
|
|
423
|
+
/** Cost to date of the data egressed from cache not included in the plans. */
|
|
424
|
+
extraCacheCost?: Money;
|
|
425
|
+
/**
|
|
426
|
+
* Total cost to date of edge-service product for the month including current
|
|
427
|
+
* plan, previous plans, extra pipelines and extra egress cache data.
|
|
428
|
+
*/
|
|
429
|
+
totalCost?: Money;
|
|
430
|
+
}
|
|
404
431
|
export type GetCacheStageRequest = {
|
|
405
432
|
/** ID of the requested cache stage. */
|
|
406
433
|
cacheStageId: string;
|
|
@@ -36,6 +36,7 @@ const unmarshalAPIKey = (data) => {
|
|
|
36
36
|
description: data.description,
|
|
37
37
|
editable: data.editable,
|
|
38
38
|
expiresAt: marshalling.unmarshalDate(data.expires_at),
|
|
39
|
+
managed: data.managed,
|
|
39
40
|
secretKey: data.secret_key,
|
|
40
41
|
updatedAt: marshalling.unmarshalDate(data.updated_at),
|
|
41
42
|
userId: data.user_id
|
|
@@ -49,9 +50,11 @@ const unmarshalApplication = (data) => {
|
|
|
49
50
|
}
|
|
50
51
|
return {
|
|
51
52
|
createdAt: marshalling.unmarshalDate(data.created_at),
|
|
53
|
+
deletable: data.deletable,
|
|
52
54
|
description: data.description,
|
|
53
55
|
editable: data.editable,
|
|
54
56
|
id: data.id,
|
|
57
|
+
managed: data.managed,
|
|
55
58
|
name: data.name,
|
|
56
59
|
nbApiKeys: data.nb_api_keys,
|
|
57
60
|
organizationId: data.organization_id,
|
|
@@ -68,8 +71,11 @@ const unmarshalGroup = (data) => {
|
|
|
68
71
|
return {
|
|
69
72
|
applicationIds: data.application_ids,
|
|
70
73
|
createdAt: marshalling.unmarshalDate(data.created_at),
|
|
74
|
+
deletable: data.deletable,
|
|
71
75
|
description: data.description,
|
|
76
|
+
editable: data.editable,
|
|
72
77
|
id: data.id,
|
|
78
|
+
managed: data.managed,
|
|
73
79
|
name: data.name,
|
|
74
80
|
organizationId: data.organization_id,
|
|
75
81
|
tags: data.tags,
|
|
@@ -104,10 +110,12 @@ const unmarshalPolicy = (data) => {
|
|
|
104
110
|
return {
|
|
105
111
|
applicationId: data.application_id,
|
|
106
112
|
createdAt: marshalling.unmarshalDate(data.created_at),
|
|
113
|
+
deletable: data.deletable,
|
|
107
114
|
description: data.description,
|
|
108
115
|
editable: data.editable,
|
|
109
116
|
groupId: data.group_id,
|
|
110
117
|
id: data.id,
|
|
118
|
+
managed: data.managed,
|
|
111
119
|
name: data.name,
|
|
112
120
|
nbPermissionSets: data.nb_permission_sets,
|
|
113
121
|
nbRules: data.nb_rules,
|
|
@@ -34,6 +34,7 @@ const unmarshalAPIKey = (data) => {
|
|
|
34
34
|
description: data.description,
|
|
35
35
|
editable: data.editable,
|
|
36
36
|
expiresAt: unmarshalDate(data.expires_at),
|
|
37
|
+
managed: data.managed,
|
|
37
38
|
secretKey: data.secret_key,
|
|
38
39
|
updatedAt: unmarshalDate(data.updated_at),
|
|
39
40
|
userId: data.user_id
|
|
@@ -47,9 +48,11 @@ const unmarshalApplication = (data) => {
|
|
|
47
48
|
}
|
|
48
49
|
return {
|
|
49
50
|
createdAt: unmarshalDate(data.created_at),
|
|
51
|
+
deletable: data.deletable,
|
|
50
52
|
description: data.description,
|
|
51
53
|
editable: data.editable,
|
|
52
54
|
id: data.id,
|
|
55
|
+
managed: data.managed,
|
|
53
56
|
name: data.name,
|
|
54
57
|
nbApiKeys: data.nb_api_keys,
|
|
55
58
|
organizationId: data.organization_id,
|
|
@@ -66,8 +69,11 @@ const unmarshalGroup = (data) => {
|
|
|
66
69
|
return {
|
|
67
70
|
applicationIds: data.application_ids,
|
|
68
71
|
createdAt: unmarshalDate(data.created_at),
|
|
72
|
+
deletable: data.deletable,
|
|
69
73
|
description: data.description,
|
|
74
|
+
editable: data.editable,
|
|
70
75
|
id: data.id,
|
|
76
|
+
managed: data.managed,
|
|
71
77
|
name: data.name,
|
|
72
78
|
organizationId: data.organization_id,
|
|
73
79
|
tags: data.tags,
|
|
@@ -102,10 +108,12 @@ const unmarshalPolicy = (data) => {
|
|
|
102
108
|
return {
|
|
103
109
|
applicationId: data.application_id,
|
|
104
110
|
createdAt: unmarshalDate(data.created_at),
|
|
111
|
+
deletable: data.deletable,
|
|
105
112
|
description: data.description,
|
|
106
113
|
editable: data.editable,
|
|
107
114
|
groupId: data.group_id,
|
|
108
115
|
id: data.id,
|
|
116
|
+
managed: data.managed,
|
|
109
117
|
name: data.name,
|
|
110
118
|
nbPermissionSets: data.nb_permission_sets,
|
|
111
119
|
nbRules: data.nb_rules,
|
|
@@ -91,6 +91,8 @@ export interface APIKey {
|
|
|
91
91
|
defaultProjectId: string;
|
|
92
92
|
/** Defines whether or not the API key is editable. */
|
|
93
93
|
editable: boolean;
|
|
94
|
+
/** Defines whether or not the API key is managed. */
|
|
95
|
+
managed: boolean;
|
|
94
96
|
/** IP address of the device that created the API key. */
|
|
95
97
|
creationIp: string;
|
|
96
98
|
}
|
|
@@ -109,6 +111,10 @@ export interface Application {
|
|
|
109
111
|
organizationId: string;
|
|
110
112
|
/** Defines whether or not the application is editable. */
|
|
111
113
|
editable: boolean;
|
|
114
|
+
/** Defines whether or not the application is deletable. */
|
|
115
|
+
deletable: boolean;
|
|
116
|
+
/** Defines whether or not the application is managed. */
|
|
117
|
+
managed: boolean;
|
|
112
118
|
/** Number of API keys attributed to the application. */
|
|
113
119
|
nbApiKeys: number;
|
|
114
120
|
/** Tags associated with the user. */
|
|
@@ -133,6 +139,12 @@ export interface Group {
|
|
|
133
139
|
applicationIds: string[];
|
|
134
140
|
/** Tags associated to the group. */
|
|
135
141
|
tags: string[];
|
|
142
|
+
/** Defines whether or not the group is editable. */
|
|
143
|
+
editable: boolean;
|
|
144
|
+
/** Defines whether or not the group is deletable. */
|
|
145
|
+
deletable: boolean;
|
|
146
|
+
/** Defines whether or not the group is managed. */
|
|
147
|
+
managed: boolean;
|
|
136
148
|
}
|
|
137
149
|
export interface Log {
|
|
138
150
|
/** Log ID. */
|
|
@@ -181,6 +193,10 @@ export interface Policy {
|
|
|
181
193
|
updatedAt?: Date;
|
|
182
194
|
/** Defines whether or not a policy is editable. */
|
|
183
195
|
editable: boolean;
|
|
196
|
+
/** Defines whether or not a policy is deletable. */
|
|
197
|
+
deletable: boolean;
|
|
198
|
+
/** Defines whether or not a policy is managed. */
|
|
199
|
+
managed: boolean;
|
|
184
200
|
/** Number of rules of the policy. */
|
|
185
201
|
nbRules: number;
|
|
186
202
|
/** Number of policy scopes. */
|
|
@@ -114,6 +114,52 @@ class API extends api.API {
|
|
|
114
114
|
},
|
|
115
115
|
marshalling_gen.unmarshalStartJobDefinitionResponse
|
|
116
116
|
);
|
|
117
|
+
createJobDefinitionSecrets = (request) => this.client.fetch(
|
|
118
|
+
{
|
|
119
|
+
body: JSON.stringify(
|
|
120
|
+
marshalling_gen.marshalCreateJobDefinitionSecretsRequest(
|
|
121
|
+
request,
|
|
122
|
+
this.client.settings
|
|
123
|
+
)
|
|
124
|
+
),
|
|
125
|
+
headers: jsonContentHeaders,
|
|
126
|
+
method: "POST",
|
|
127
|
+
path: `/serverless-jobs/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-definitions/${marshalling.validatePathParam("jobDefinitionId", request.jobDefinitionId)}/secrets`
|
|
128
|
+
},
|
|
129
|
+
marshalling_gen.unmarshalCreateJobDefinitionSecretsResponse
|
|
130
|
+
);
|
|
131
|
+
getJobDefinitionSecret = (request) => this.client.fetch(
|
|
132
|
+
{
|
|
133
|
+
method: "GET",
|
|
134
|
+
path: `/serverless-jobs/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-definitions/${marshalling.validatePathParam("jobDefinitionId", request.jobDefinitionId)}/secrets/${marshalling.validatePathParam("secretId", request.secretId)}`
|
|
135
|
+
},
|
|
136
|
+
marshalling_gen.unmarshalSecret
|
|
137
|
+
);
|
|
138
|
+
listJobDefinitionSecrets = (request) => this.client.fetch(
|
|
139
|
+
{
|
|
140
|
+
method: "GET",
|
|
141
|
+
path: `/serverless-jobs/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-definitions/${marshalling.validatePathParam("jobDefinitionId", request.jobDefinitionId)}/secrets`
|
|
142
|
+
},
|
|
143
|
+
marshalling_gen.unmarshalListJobDefinitionSecretsResponse
|
|
144
|
+
);
|
|
145
|
+
updateJobDefinitionSecret = (request) => this.client.fetch(
|
|
146
|
+
{
|
|
147
|
+
body: JSON.stringify(
|
|
148
|
+
marshalling_gen.marshalUpdateJobDefinitionSecretRequest(
|
|
149
|
+
request,
|
|
150
|
+
this.client.settings
|
|
151
|
+
)
|
|
152
|
+
),
|
|
153
|
+
headers: jsonContentHeaders,
|
|
154
|
+
method: "PATCH",
|
|
155
|
+
path: `/serverless-jobs/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-definitions/${marshalling.validatePathParam("jobDefinitionId", request.jobDefinitionId)}/secrets/${marshalling.validatePathParam("secretId", request.secretId)}`
|
|
156
|
+
},
|
|
157
|
+
marshalling_gen.unmarshalSecret
|
|
158
|
+
);
|
|
159
|
+
deleteJobDefinitionSecret = (request) => this.client.fetch({
|
|
160
|
+
method: "DELETE",
|
|
161
|
+
path: `/serverless-jobs/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-definitions/${marshalling.validatePathParam("jobDefinitionId", request.jobDefinitionId)}/secrets/${marshalling.validatePathParam("secretId", request.secretId)}`
|
|
162
|
+
});
|
|
117
163
|
/**
|
|
118
164
|
* Get a job run by its unique identifier.
|
|
119
165
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { API as ParentAPI } from '../../../bridge';
|
|
2
2
|
import type { Region } from '../../../bridge';
|
|
3
|
-
import type { CreateJobDefinitionRequest, DeleteJobDefinitionRequest, GetJobDefinitionRequest, GetJobRunRequest, JobDefinition, JobRun, ListJobDefinitionsRequest, ListJobDefinitionsResponse, ListJobRunsRequest, ListJobRunsResponse, ListJobsResourcesRequest, ListJobsResourcesResponse, StartJobDefinitionRequest, StartJobDefinitionResponse, StopJobRunRequest, UpdateJobDefinitionRequest } from './types.gen';
|
|
3
|
+
import type { CreateJobDefinitionRequest, CreateJobDefinitionSecretsRequest, CreateJobDefinitionSecretsResponse, DeleteJobDefinitionRequest, DeleteJobDefinitionSecretRequest, GetJobDefinitionRequest, GetJobDefinitionSecretRequest, GetJobRunRequest, JobDefinition, JobRun, ListJobDefinitionSecretsRequest, ListJobDefinitionSecretsResponse, ListJobDefinitionsRequest, ListJobDefinitionsResponse, ListJobRunsRequest, ListJobRunsResponse, ListJobsResourcesRequest, ListJobsResourcesResponse, Secret, StartJobDefinitionRequest, StartJobDefinitionResponse, StopJobRunRequest, UpdateJobDefinitionRequest, UpdateJobDefinitionSecretRequest } from './types.gen';
|
|
4
4
|
/**
|
|
5
5
|
* Serverless Jobs API.
|
|
6
6
|
*
|
|
@@ -56,6 +56,11 @@ export declare class API extends ParentAPI {
|
|
|
56
56
|
* @returns A Promise of StartJobDefinitionResponse
|
|
57
57
|
*/
|
|
58
58
|
startJobDefinition: (request: Readonly<StartJobDefinitionRequest>) => Promise<StartJobDefinitionResponse>;
|
|
59
|
+
createJobDefinitionSecrets: (request: Readonly<CreateJobDefinitionSecretsRequest>) => Promise<CreateJobDefinitionSecretsResponse>;
|
|
60
|
+
getJobDefinitionSecret: (request: Readonly<GetJobDefinitionSecretRequest>) => Promise<Secret>;
|
|
61
|
+
listJobDefinitionSecrets: (request: Readonly<ListJobDefinitionSecretsRequest>) => Promise<ListJobDefinitionSecretsResponse>;
|
|
62
|
+
updateJobDefinitionSecret: (request: Readonly<UpdateJobDefinitionSecretRequest>) => Promise<Secret>;
|
|
63
|
+
deleteJobDefinitionSecret: (request: Readonly<DeleteJobDefinitionSecretRequest>) => Promise<void>;
|
|
59
64
|
/**
|
|
60
65
|
* Get a job run by its unique identifier.
|
|
61
66
|
*
|
|
@@ -2,7 +2,7 @@ import { API as API$1 } from "../../../scw/api.js";
|
|
|
2
2
|
import { validatePathParam, urlParams } from "../../../helpers/marshalling.js";
|
|
3
3
|
import "../../../vendor/base64/index.js";
|
|
4
4
|
import { enrichForPagination } from "../../../scw/fetch/resource-paginator.js";
|
|
5
|
-
import { marshalCreateJobDefinitionRequest, unmarshalJobDefinition, unmarshalListJobDefinitionsResponse, marshalUpdateJobDefinitionRequest, marshalStartJobDefinitionRequest, unmarshalStartJobDefinitionResponse, unmarshalJobRun, unmarshalListJobRunsResponse, unmarshalListJobsResourcesResponse } from "./marshalling.gen.js";
|
|
5
|
+
import { marshalCreateJobDefinitionRequest, unmarshalJobDefinition, unmarshalListJobDefinitionsResponse, marshalUpdateJobDefinitionRequest, marshalStartJobDefinitionRequest, unmarshalStartJobDefinitionResponse, marshalCreateJobDefinitionSecretsRequest, unmarshalCreateJobDefinitionSecretsResponse, unmarshalSecret, unmarshalListJobDefinitionSecretsResponse, marshalUpdateJobDefinitionSecretRequest, unmarshalJobRun, unmarshalListJobRunsResponse, unmarshalListJobsResourcesResponse } from "./marshalling.gen.js";
|
|
6
6
|
const jsonContentHeaders = {
|
|
7
7
|
"Content-Type": "application/json; charset=utf-8"
|
|
8
8
|
};
|
|
@@ -112,6 +112,52 @@ class API extends API$1 {
|
|
|
112
112
|
},
|
|
113
113
|
unmarshalStartJobDefinitionResponse
|
|
114
114
|
);
|
|
115
|
+
createJobDefinitionSecrets = (request) => this.client.fetch(
|
|
116
|
+
{
|
|
117
|
+
body: JSON.stringify(
|
|
118
|
+
marshalCreateJobDefinitionSecretsRequest(
|
|
119
|
+
request,
|
|
120
|
+
this.client.settings
|
|
121
|
+
)
|
|
122
|
+
),
|
|
123
|
+
headers: jsonContentHeaders,
|
|
124
|
+
method: "POST",
|
|
125
|
+
path: `/serverless-jobs/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-definitions/${validatePathParam("jobDefinitionId", request.jobDefinitionId)}/secrets`
|
|
126
|
+
},
|
|
127
|
+
unmarshalCreateJobDefinitionSecretsResponse
|
|
128
|
+
);
|
|
129
|
+
getJobDefinitionSecret = (request) => this.client.fetch(
|
|
130
|
+
{
|
|
131
|
+
method: "GET",
|
|
132
|
+
path: `/serverless-jobs/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-definitions/${validatePathParam("jobDefinitionId", request.jobDefinitionId)}/secrets/${validatePathParam("secretId", request.secretId)}`
|
|
133
|
+
},
|
|
134
|
+
unmarshalSecret
|
|
135
|
+
);
|
|
136
|
+
listJobDefinitionSecrets = (request) => this.client.fetch(
|
|
137
|
+
{
|
|
138
|
+
method: "GET",
|
|
139
|
+
path: `/serverless-jobs/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-definitions/${validatePathParam("jobDefinitionId", request.jobDefinitionId)}/secrets`
|
|
140
|
+
},
|
|
141
|
+
unmarshalListJobDefinitionSecretsResponse
|
|
142
|
+
);
|
|
143
|
+
updateJobDefinitionSecret = (request) => this.client.fetch(
|
|
144
|
+
{
|
|
145
|
+
body: JSON.stringify(
|
|
146
|
+
marshalUpdateJobDefinitionSecretRequest(
|
|
147
|
+
request,
|
|
148
|
+
this.client.settings
|
|
149
|
+
)
|
|
150
|
+
),
|
|
151
|
+
headers: jsonContentHeaders,
|
|
152
|
+
method: "PATCH",
|
|
153
|
+
path: `/serverless-jobs/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-definitions/${validatePathParam("jobDefinitionId", request.jobDefinitionId)}/secrets/${validatePathParam("secretId", request.secretId)}`
|
|
154
|
+
},
|
|
155
|
+
unmarshalSecret
|
|
156
|
+
);
|
|
157
|
+
deleteJobDefinitionSecret = (request) => this.client.fetch({
|
|
158
|
+
method: "DELETE",
|
|
159
|
+
path: `/serverless-jobs/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-definitions/${validatePathParam("jobDefinitionId", request.jobDefinitionId)}/secrets/${validatePathParam("secretId", request.secretId)}`
|
|
160
|
+
});
|
|
115
161
|
/**
|
|
116
162
|
* Get a job run by its unique identifier.
|
|
117
163
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { API } from './api.gen';
|
|
2
2
|
export * from './content.gen';
|
|
3
|
-
export type { CreateJobDefinitionRequest, CreateJobDefinitionRequestCronScheduleConfig, CronSchedule, DeleteJobDefinitionRequest, GetJobDefinitionRequest, GetJobRunRequest, JobDefinition, JobRun, JobRunState, ListJobDefinitionsRequest, ListJobDefinitionsRequestOrderBy, ListJobDefinitionsResponse, ListJobRunsRequest, ListJobRunsRequestOrderBy, ListJobRunsResponse, ListJobsResourcesRequest, ListJobsResourcesResponse, Resource, StartJobDefinitionRequest, StartJobDefinitionResponse, StopJobRunRequest, UpdateJobDefinitionRequest, UpdateJobDefinitionRequestCronScheduleConfig, } from './types.gen';
|
|
3
|
+
export type { CreateJobDefinitionRequest, CreateJobDefinitionRequestCronScheduleConfig, CreateJobDefinitionSecretsRequest, CreateJobDefinitionSecretsRequestSecretConfig, CreateJobDefinitionSecretsResponse, CronSchedule, DeleteJobDefinitionRequest, DeleteJobDefinitionSecretRequest, GetJobDefinitionRequest, GetJobDefinitionSecretRequest, GetJobRunRequest, JobDefinition, JobRun, JobRunState, ListJobDefinitionSecretsRequest, ListJobDefinitionSecretsResponse, ListJobDefinitionsRequest, ListJobDefinitionsRequestOrderBy, ListJobDefinitionsResponse, ListJobRunsRequest, ListJobRunsRequestOrderBy, ListJobRunsResponse, ListJobsResourcesRequest, ListJobsResourcesResponse, Resource, Secret, SecretEnvVar, SecretFile, StartJobDefinitionRequest, StartJobDefinitionResponse, StopJobRunRequest, UpdateJobDefinitionRequest, UpdateJobDefinitionRequestCronScheduleConfig, UpdateJobDefinitionSecretRequest, } from './types.gen';
|
|
4
4
|
export * as ValidationRules from './validation-rules.gen';
|
|
@@ -4,6 +4,40 @@ const randomName = require("@scaleway/random-name");
|
|
|
4
4
|
const json = require("../../../helpers/json.cjs");
|
|
5
5
|
const marshalling = require("../../../helpers/marshalling.cjs");
|
|
6
6
|
require("../../../vendor/base64/index.cjs");
|
|
7
|
+
const unmarshalSecretEnvVar = (data) => {
|
|
8
|
+
if (!json.isJSONObject(data)) {
|
|
9
|
+
throw new TypeError(
|
|
10
|
+
`Unmarshalling the type 'SecretEnvVar' failed as data isn't a dictionary.`
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
return {
|
|
14
|
+
name: data.name
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
const unmarshalSecretFile = (data) => {
|
|
18
|
+
if (!json.isJSONObject(data)) {
|
|
19
|
+
throw new TypeError(
|
|
20
|
+
`Unmarshalling the type 'SecretFile' failed as data isn't a dictionary.`
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
path: data.path
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
const unmarshalSecret = (data) => {
|
|
28
|
+
if (!json.isJSONObject(data)) {
|
|
29
|
+
throw new TypeError(
|
|
30
|
+
`Unmarshalling the type 'Secret' failed as data isn't a dictionary.`
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
return {
|
|
34
|
+
envVar: data.env_var ? unmarshalSecretEnvVar(data.env_var) : void 0,
|
|
35
|
+
file: data.file ? unmarshalSecretFile(data.file) : void 0,
|
|
36
|
+
secretId: data.secret_id,
|
|
37
|
+
secretManagerId: data.secret_manager_id,
|
|
38
|
+
secretManagerVersion: data.secret_manager_version
|
|
39
|
+
};
|
|
40
|
+
};
|
|
7
41
|
const unmarshalCronSchedule = (data) => {
|
|
8
42
|
if (!json.isJSONObject(data)) {
|
|
9
43
|
throw new TypeError(
|
|
@@ -64,6 +98,27 @@ const unmarshalJobRun = (data) => {
|
|
|
64
98
|
updatedAt: marshalling.unmarshalDate(data.updated_at)
|
|
65
99
|
};
|
|
66
100
|
};
|
|
101
|
+
const unmarshalCreateJobDefinitionSecretsResponse = (data) => {
|
|
102
|
+
if (!json.isJSONObject(data)) {
|
|
103
|
+
throw new TypeError(
|
|
104
|
+
`Unmarshalling the type 'CreateJobDefinitionSecretsResponse' failed as data isn't a dictionary.`
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
return {
|
|
108
|
+
secrets: marshalling.unmarshalArrayOfObject(data.secrets, unmarshalSecret)
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
const unmarshalListJobDefinitionSecretsResponse = (data) => {
|
|
112
|
+
if (!json.isJSONObject(data)) {
|
|
113
|
+
throw new TypeError(
|
|
114
|
+
`Unmarshalling the type 'ListJobDefinitionSecretsResponse' failed as data isn't a dictionary.`
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
return {
|
|
118
|
+
secrets: marshalling.unmarshalArrayOfObject(data.secrets, unmarshalSecret),
|
|
119
|
+
totalCount: data.total_count
|
|
120
|
+
};
|
|
121
|
+
};
|
|
67
122
|
const unmarshalListJobDefinitionsResponse = (data) => {
|
|
68
123
|
if (!json.isJSONObject(data)) {
|
|
69
124
|
throw new TypeError(
|
|
@@ -139,6 +194,19 @@ const marshalCreateJobDefinitionRequest = (request, defaults) => ({
|
|
|
139
194
|
name: request.name || randomName("job"),
|
|
140
195
|
project_id: request.projectId ?? defaults.defaultProjectId
|
|
141
196
|
});
|
|
197
|
+
const marshalCreateJobDefinitionSecretsRequestSecretConfig = (request, defaults) => ({
|
|
198
|
+
secret_manager_id: request.secretManagerId,
|
|
199
|
+
secret_manager_version: request.secretManagerVersion,
|
|
200
|
+
...marshalling.resolveOneOf([
|
|
201
|
+
{ param: "path", value: request.path },
|
|
202
|
+
{ param: "env_var_name", value: request.envVarName }
|
|
203
|
+
])
|
|
204
|
+
});
|
|
205
|
+
const marshalCreateJobDefinitionSecretsRequest = (request, defaults) => ({
|
|
206
|
+
secrets: request.secrets.map(
|
|
207
|
+
(elt) => marshalCreateJobDefinitionSecretsRequestSecretConfig(elt)
|
|
208
|
+
)
|
|
209
|
+
});
|
|
142
210
|
const marshalStartJobDefinitionRequest = (request, defaults) => ({
|
|
143
211
|
command: request.command,
|
|
144
212
|
environment_variables: request.environmentVariables,
|
|
@@ -162,12 +230,24 @@ const marshalUpdateJobDefinitionRequest = (request, defaults) => ({
|
|
|
162
230
|
memory_limit: request.memoryLimit,
|
|
163
231
|
name: request.name
|
|
164
232
|
});
|
|
233
|
+
const marshalUpdateJobDefinitionSecretRequest = (request, defaults) => ({
|
|
234
|
+
secret_manager_version: request.secretManagerVersion,
|
|
235
|
+
...marshalling.resolveOneOf([
|
|
236
|
+
{ param: "path", value: request.path },
|
|
237
|
+
{ param: "env_var_name", value: request.envVarName }
|
|
238
|
+
])
|
|
239
|
+
});
|
|
165
240
|
exports.marshalCreateJobDefinitionRequest = marshalCreateJobDefinitionRequest;
|
|
241
|
+
exports.marshalCreateJobDefinitionSecretsRequest = marshalCreateJobDefinitionSecretsRequest;
|
|
166
242
|
exports.marshalStartJobDefinitionRequest = marshalStartJobDefinitionRequest;
|
|
167
243
|
exports.marshalUpdateJobDefinitionRequest = marshalUpdateJobDefinitionRequest;
|
|
244
|
+
exports.marshalUpdateJobDefinitionSecretRequest = marshalUpdateJobDefinitionSecretRequest;
|
|
245
|
+
exports.unmarshalCreateJobDefinitionSecretsResponse = unmarshalCreateJobDefinitionSecretsResponse;
|
|
168
246
|
exports.unmarshalJobDefinition = unmarshalJobDefinition;
|
|
169
247
|
exports.unmarshalJobRun = unmarshalJobRun;
|
|
248
|
+
exports.unmarshalListJobDefinitionSecretsResponse = unmarshalListJobDefinitionSecretsResponse;
|
|
170
249
|
exports.unmarshalListJobDefinitionsResponse = unmarshalListJobDefinitionsResponse;
|
|
171
250
|
exports.unmarshalListJobRunsResponse = unmarshalListJobRunsResponse;
|
|
172
251
|
exports.unmarshalListJobsResourcesResponse = unmarshalListJobsResourcesResponse;
|
|
252
|
+
exports.unmarshalSecret = unmarshalSecret;
|
|
173
253
|
exports.unmarshalStartJobDefinitionResponse = unmarshalStartJobDefinitionResponse;
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import type { DefaultValues } from '../../../bridge';
|
|
2
|
-
import type { CreateJobDefinitionRequest, JobDefinition, JobRun, ListJobDefinitionsResponse, ListJobRunsResponse, ListJobsResourcesResponse, StartJobDefinitionRequest, StartJobDefinitionResponse, UpdateJobDefinitionRequest } from './types.gen';
|
|
2
|
+
import type { CreateJobDefinitionRequest, CreateJobDefinitionSecretsRequest, CreateJobDefinitionSecretsResponse, JobDefinition, JobRun, ListJobDefinitionSecretsResponse, ListJobDefinitionsResponse, ListJobRunsResponse, ListJobsResourcesResponse, Secret, StartJobDefinitionRequest, StartJobDefinitionResponse, UpdateJobDefinitionRequest, UpdateJobDefinitionSecretRequest } from './types.gen';
|
|
3
|
+
export declare const unmarshalSecret: (data: unknown) => Secret;
|
|
3
4
|
export declare const unmarshalJobDefinition: (data: unknown) => JobDefinition;
|
|
4
5
|
export declare const unmarshalJobRun: (data: unknown) => JobRun;
|
|
6
|
+
export declare const unmarshalCreateJobDefinitionSecretsResponse: (data: unknown) => CreateJobDefinitionSecretsResponse;
|
|
7
|
+
export declare const unmarshalListJobDefinitionSecretsResponse: (data: unknown) => ListJobDefinitionSecretsResponse;
|
|
5
8
|
export declare const unmarshalListJobDefinitionsResponse: (data: unknown) => ListJobDefinitionsResponse;
|
|
6
9
|
export declare const unmarshalListJobRunsResponse: (data: unknown) => ListJobRunsResponse;
|
|
7
10
|
export declare const unmarshalListJobsResourcesResponse: (data: unknown) => ListJobsResourcesResponse;
|
|
8
11
|
export declare const unmarshalStartJobDefinitionResponse: (data: unknown) => StartJobDefinitionResponse;
|
|
9
12
|
export declare const marshalCreateJobDefinitionRequest: (request: CreateJobDefinitionRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
13
|
+
export declare const marshalCreateJobDefinitionSecretsRequest: (request: CreateJobDefinitionSecretsRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
10
14
|
export declare const marshalStartJobDefinitionRequest: (request: StartJobDefinitionRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
11
15
|
export declare const marshalUpdateJobDefinitionRequest: (request: UpdateJobDefinitionRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
16
|
+
export declare const marshalUpdateJobDefinitionSecretRequest: (request: UpdateJobDefinitionSecretRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
@@ -1,7 +1,41 @@
|
|
|
1
1
|
import randomName from "@scaleway/random-name";
|
|
2
2
|
import { isJSONObject } from "../../../helpers/json.js";
|
|
3
|
-
import { unmarshalDate, unmarshalArrayOfObject } from "../../../helpers/marshalling.js";
|
|
3
|
+
import { unmarshalDate, unmarshalArrayOfObject, resolveOneOf } from "../../../helpers/marshalling.js";
|
|
4
4
|
import "../../../vendor/base64/index.js";
|
|
5
|
+
const unmarshalSecretEnvVar = (data) => {
|
|
6
|
+
if (!isJSONObject(data)) {
|
|
7
|
+
throw new TypeError(
|
|
8
|
+
`Unmarshalling the type 'SecretEnvVar' failed as data isn't a dictionary.`
|
|
9
|
+
);
|
|
10
|
+
}
|
|
11
|
+
return {
|
|
12
|
+
name: data.name
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
const unmarshalSecretFile = (data) => {
|
|
16
|
+
if (!isJSONObject(data)) {
|
|
17
|
+
throw new TypeError(
|
|
18
|
+
`Unmarshalling the type 'SecretFile' failed as data isn't a dictionary.`
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
return {
|
|
22
|
+
path: data.path
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
const unmarshalSecret = (data) => {
|
|
26
|
+
if (!isJSONObject(data)) {
|
|
27
|
+
throw new TypeError(
|
|
28
|
+
`Unmarshalling the type 'Secret' failed as data isn't a dictionary.`
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
return {
|
|
32
|
+
envVar: data.env_var ? unmarshalSecretEnvVar(data.env_var) : void 0,
|
|
33
|
+
file: data.file ? unmarshalSecretFile(data.file) : void 0,
|
|
34
|
+
secretId: data.secret_id,
|
|
35
|
+
secretManagerId: data.secret_manager_id,
|
|
36
|
+
secretManagerVersion: data.secret_manager_version
|
|
37
|
+
};
|
|
38
|
+
};
|
|
5
39
|
const unmarshalCronSchedule = (data) => {
|
|
6
40
|
if (!isJSONObject(data)) {
|
|
7
41
|
throw new TypeError(
|
|
@@ -62,6 +96,27 @@ const unmarshalJobRun = (data) => {
|
|
|
62
96
|
updatedAt: unmarshalDate(data.updated_at)
|
|
63
97
|
};
|
|
64
98
|
};
|
|
99
|
+
const unmarshalCreateJobDefinitionSecretsResponse = (data) => {
|
|
100
|
+
if (!isJSONObject(data)) {
|
|
101
|
+
throw new TypeError(
|
|
102
|
+
`Unmarshalling the type 'CreateJobDefinitionSecretsResponse' failed as data isn't a dictionary.`
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
return {
|
|
106
|
+
secrets: unmarshalArrayOfObject(data.secrets, unmarshalSecret)
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
const unmarshalListJobDefinitionSecretsResponse = (data) => {
|
|
110
|
+
if (!isJSONObject(data)) {
|
|
111
|
+
throw new TypeError(
|
|
112
|
+
`Unmarshalling the type 'ListJobDefinitionSecretsResponse' failed as data isn't a dictionary.`
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
return {
|
|
116
|
+
secrets: unmarshalArrayOfObject(data.secrets, unmarshalSecret),
|
|
117
|
+
totalCount: data.total_count
|
|
118
|
+
};
|
|
119
|
+
};
|
|
65
120
|
const unmarshalListJobDefinitionsResponse = (data) => {
|
|
66
121
|
if (!isJSONObject(data)) {
|
|
67
122
|
throw new TypeError(
|
|
@@ -137,6 +192,19 @@ const marshalCreateJobDefinitionRequest = (request, defaults) => ({
|
|
|
137
192
|
name: request.name || randomName("job"),
|
|
138
193
|
project_id: request.projectId ?? defaults.defaultProjectId
|
|
139
194
|
});
|
|
195
|
+
const marshalCreateJobDefinitionSecretsRequestSecretConfig = (request, defaults) => ({
|
|
196
|
+
secret_manager_id: request.secretManagerId,
|
|
197
|
+
secret_manager_version: request.secretManagerVersion,
|
|
198
|
+
...resolveOneOf([
|
|
199
|
+
{ param: "path", value: request.path },
|
|
200
|
+
{ param: "env_var_name", value: request.envVarName }
|
|
201
|
+
])
|
|
202
|
+
});
|
|
203
|
+
const marshalCreateJobDefinitionSecretsRequest = (request, defaults) => ({
|
|
204
|
+
secrets: request.secrets.map(
|
|
205
|
+
(elt) => marshalCreateJobDefinitionSecretsRequestSecretConfig(elt)
|
|
206
|
+
)
|
|
207
|
+
});
|
|
140
208
|
const marshalStartJobDefinitionRequest = (request, defaults) => ({
|
|
141
209
|
command: request.command,
|
|
142
210
|
environment_variables: request.environmentVariables,
|
|
@@ -160,14 +228,26 @@ const marshalUpdateJobDefinitionRequest = (request, defaults) => ({
|
|
|
160
228
|
memory_limit: request.memoryLimit,
|
|
161
229
|
name: request.name
|
|
162
230
|
});
|
|
231
|
+
const marshalUpdateJobDefinitionSecretRequest = (request, defaults) => ({
|
|
232
|
+
secret_manager_version: request.secretManagerVersion,
|
|
233
|
+
...resolveOneOf([
|
|
234
|
+
{ param: "path", value: request.path },
|
|
235
|
+
{ param: "env_var_name", value: request.envVarName }
|
|
236
|
+
])
|
|
237
|
+
});
|
|
163
238
|
export {
|
|
164
239
|
marshalCreateJobDefinitionRequest,
|
|
240
|
+
marshalCreateJobDefinitionSecretsRequest,
|
|
165
241
|
marshalStartJobDefinitionRequest,
|
|
166
242
|
marshalUpdateJobDefinitionRequest,
|
|
243
|
+
marshalUpdateJobDefinitionSecretRequest,
|
|
244
|
+
unmarshalCreateJobDefinitionSecretsResponse,
|
|
167
245
|
unmarshalJobDefinition,
|
|
168
246
|
unmarshalJobRun,
|
|
247
|
+
unmarshalListJobDefinitionSecretsResponse,
|
|
169
248
|
unmarshalListJobDefinitionsResponse,
|
|
170
249
|
unmarshalListJobRunsResponse,
|
|
171
250
|
unmarshalListJobsResourcesResponse,
|
|
251
|
+
unmarshalSecret,
|
|
172
252
|
unmarshalStartJobDefinitionResponse
|
|
173
253
|
};
|
|
@@ -2,6 +2,12 @@ import type { Region } from '../../../bridge';
|
|
|
2
2
|
export type JobRunState = 'unknown_state' | 'queued' | 'scheduled' | 'running' | 'succeeded' | 'failed' | 'canceled' | 'internal_error';
|
|
3
3
|
export type ListJobDefinitionsRequestOrderBy = 'created_at_asc' | 'created_at_desc';
|
|
4
4
|
export type ListJobRunsRequestOrderBy = 'created_at_asc' | 'created_at_desc';
|
|
5
|
+
export interface SecretEnvVar {
|
|
6
|
+
name: string;
|
|
7
|
+
}
|
|
8
|
+
export interface SecretFile {
|
|
9
|
+
path: string;
|
|
10
|
+
}
|
|
5
11
|
export interface CronSchedule {
|
|
6
12
|
/** UNIX cron schedule to run job (e.g., '* * * * *'). */
|
|
7
13
|
schedule: string;
|
|
@@ -15,6 +21,23 @@ export interface CreateJobDefinitionRequestCronScheduleConfig {
|
|
|
15
21
|
schedule: string;
|
|
16
22
|
timezone: string;
|
|
17
23
|
}
|
|
24
|
+
export interface CreateJobDefinitionSecretsRequestSecretConfig {
|
|
25
|
+
secretManagerId: string;
|
|
26
|
+
secretManagerVersion: string;
|
|
27
|
+
/** One-of ('pathOrEnvVar'): at most one of 'path', 'envVarName' could be set. */
|
|
28
|
+
path?: string;
|
|
29
|
+
/** One-of ('pathOrEnvVar'): at most one of 'path', 'envVarName' could be set. */
|
|
30
|
+
envVarName?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface Secret {
|
|
33
|
+
secretId: string;
|
|
34
|
+
secretManagerId: string;
|
|
35
|
+
secretManagerVersion: string;
|
|
36
|
+
/** One-of ('secretConfig'): at most one of 'file', 'envVar' could be set. */
|
|
37
|
+
file?: SecretFile;
|
|
38
|
+
/** One-of ('secretConfig'): at most one of 'file', 'envVar' could be set. */
|
|
39
|
+
envVar?: SecretEnvVar;
|
|
40
|
+
}
|
|
18
41
|
export interface JobDefinition {
|
|
19
42
|
id: string;
|
|
20
43
|
name: string;
|
|
@@ -98,6 +121,20 @@ export type CreateJobDefinitionRequest = {
|
|
|
98
121
|
/** Configure a cron for the job. */
|
|
99
122
|
cronSchedule?: CreateJobDefinitionRequestCronScheduleConfig;
|
|
100
123
|
};
|
|
124
|
+
export type CreateJobDefinitionSecretsRequest = {
|
|
125
|
+
/**
|
|
126
|
+
* Region to target. If none is passed will use default region from the
|
|
127
|
+
* config.
|
|
128
|
+
*/
|
|
129
|
+
region?: Region;
|
|
130
|
+
/** UUID of the job definition to get. */
|
|
131
|
+
jobDefinitionId: string;
|
|
132
|
+
/** Secrets to inject into the job. */
|
|
133
|
+
secrets: CreateJobDefinitionSecretsRequestSecretConfig[];
|
|
134
|
+
};
|
|
135
|
+
export interface CreateJobDefinitionSecretsResponse {
|
|
136
|
+
secrets: Secret[];
|
|
137
|
+
}
|
|
101
138
|
export type DeleteJobDefinitionRequest = {
|
|
102
139
|
/**
|
|
103
140
|
* Region to target. If none is passed will use default region from the
|
|
@@ -107,6 +144,15 @@ export type DeleteJobDefinitionRequest = {
|
|
|
107
144
|
/** UUID of the job definition to delete. */
|
|
108
145
|
jobDefinitionId: string;
|
|
109
146
|
};
|
|
147
|
+
export type DeleteJobDefinitionSecretRequest = {
|
|
148
|
+
/**
|
|
149
|
+
* Region to target. If none is passed will use default region from the
|
|
150
|
+
* config.
|
|
151
|
+
*/
|
|
152
|
+
region?: Region;
|
|
153
|
+
jobDefinitionId: string;
|
|
154
|
+
secretId: string;
|
|
155
|
+
};
|
|
110
156
|
export type GetJobDefinitionRequest = {
|
|
111
157
|
/**
|
|
112
158
|
* Region to target. If none is passed will use default region from the
|
|
@@ -116,6 +162,15 @@ export type GetJobDefinitionRequest = {
|
|
|
116
162
|
/** UUID of the job definition to get. */
|
|
117
163
|
jobDefinitionId: string;
|
|
118
164
|
};
|
|
165
|
+
export type GetJobDefinitionSecretRequest = {
|
|
166
|
+
/**
|
|
167
|
+
* Region to target. If none is passed will use default region from the
|
|
168
|
+
* config.
|
|
169
|
+
*/
|
|
170
|
+
region?: Region;
|
|
171
|
+
jobDefinitionId: string;
|
|
172
|
+
secretId: string;
|
|
173
|
+
};
|
|
119
174
|
export type GetJobRunRequest = {
|
|
120
175
|
/**
|
|
121
176
|
* Region to target. If none is passed will use default region from the
|
|
@@ -125,6 +180,18 @@ export type GetJobRunRequest = {
|
|
|
125
180
|
/** UUID of the job run to get. */
|
|
126
181
|
jobRunId: string;
|
|
127
182
|
};
|
|
183
|
+
export type ListJobDefinitionSecretsRequest = {
|
|
184
|
+
/**
|
|
185
|
+
* Region to target. If none is passed will use default region from the
|
|
186
|
+
* config.
|
|
187
|
+
*/
|
|
188
|
+
region?: Region;
|
|
189
|
+
jobDefinitionId: string;
|
|
190
|
+
};
|
|
191
|
+
export interface ListJobDefinitionSecretsResponse {
|
|
192
|
+
secrets: Secret[];
|
|
193
|
+
totalCount: number;
|
|
194
|
+
}
|
|
128
195
|
export type ListJobDefinitionsRequest = {
|
|
129
196
|
/**
|
|
130
197
|
* Region to target. If none is passed will use default region from the
|
|
@@ -223,3 +290,17 @@ export type UpdateJobDefinitionRequest = {
|
|
|
223
290
|
jobTimeout?: string;
|
|
224
291
|
cronSchedule?: UpdateJobDefinitionRequestCronScheduleConfig;
|
|
225
292
|
};
|
|
293
|
+
export type UpdateJobDefinitionSecretRequest = {
|
|
294
|
+
/**
|
|
295
|
+
* Region to target. If none is passed will use default region from the
|
|
296
|
+
* config.
|
|
297
|
+
*/
|
|
298
|
+
region?: Region;
|
|
299
|
+
jobDefinitionId: string;
|
|
300
|
+
secretId: string;
|
|
301
|
+
secretManagerVersion?: string;
|
|
302
|
+
/** One-of ('secretConfig'): at most one of 'path', 'envVarName' could be set. */
|
|
303
|
+
path?: string;
|
|
304
|
+
/** One-of ('secretConfig'): at most one of 'path', 'envVarName' could be set. */
|
|
305
|
+
envVarName?: string;
|
|
306
|
+
};
|
|
@@ -27,6 +27,11 @@ const CreateJobDefinitionRequestCronScheduleConfig = {
|
|
|
27
27
|
minLength: 1
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
|
+
const CreateJobDefinitionSecretsRequestSecretConfig = {
|
|
31
|
+
secretManagerVersion: {
|
|
32
|
+
minLength: 1
|
|
33
|
+
}
|
|
34
|
+
};
|
|
30
35
|
const CronSchedule = {
|
|
31
36
|
schedule: {
|
|
32
37
|
maxLength: 255,
|
|
@@ -87,11 +92,18 @@ const UpdateJobDefinitionRequestCronScheduleConfig = {
|
|
|
87
92
|
minLength: 1
|
|
88
93
|
}
|
|
89
94
|
};
|
|
95
|
+
const UpdateJobDefinitionSecretRequest = {
|
|
96
|
+
secretManagerVersion: {
|
|
97
|
+
minLength: 1
|
|
98
|
+
}
|
|
99
|
+
};
|
|
90
100
|
exports.CreateJobDefinitionRequest = CreateJobDefinitionRequest;
|
|
91
101
|
exports.CreateJobDefinitionRequestCronScheduleConfig = CreateJobDefinitionRequestCronScheduleConfig;
|
|
102
|
+
exports.CreateJobDefinitionSecretsRequestSecretConfig = CreateJobDefinitionSecretsRequestSecretConfig;
|
|
92
103
|
exports.CronSchedule = CronSchedule;
|
|
93
104
|
exports.ListJobDefinitionsRequest = ListJobDefinitionsRequest;
|
|
94
105
|
exports.ListJobRunsRequest = ListJobRunsRequest;
|
|
95
106
|
exports.StartJobDefinitionRequest = StartJobDefinitionRequest;
|
|
96
107
|
exports.UpdateJobDefinitionRequest = UpdateJobDefinitionRequest;
|
|
97
108
|
exports.UpdateJobDefinitionRequestCronScheduleConfig = UpdateJobDefinitionRequestCronScheduleConfig;
|
|
109
|
+
exports.UpdateJobDefinitionSecretRequest = UpdateJobDefinitionSecretRequest;
|
|
@@ -25,6 +25,11 @@ export declare const CreateJobDefinitionRequestCronScheduleConfig: {
|
|
|
25
25
|
minLength: number;
|
|
26
26
|
};
|
|
27
27
|
};
|
|
28
|
+
export declare const CreateJobDefinitionSecretsRequestSecretConfig: {
|
|
29
|
+
secretManagerVersion: {
|
|
30
|
+
minLength: number;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
28
33
|
export declare const CronSchedule: {
|
|
29
34
|
schedule: {
|
|
30
35
|
maxLength: number;
|
|
@@ -85,3 +90,8 @@ export declare const UpdateJobDefinitionRequestCronScheduleConfig: {
|
|
|
85
90
|
minLength: number;
|
|
86
91
|
};
|
|
87
92
|
};
|
|
93
|
+
export declare const UpdateJobDefinitionSecretRequest: {
|
|
94
|
+
secretManagerVersion: {
|
|
95
|
+
minLength: number;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
@@ -25,6 +25,11 @@ const CreateJobDefinitionRequestCronScheduleConfig = {
|
|
|
25
25
|
minLength: 1
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
|
+
const CreateJobDefinitionSecretsRequestSecretConfig = {
|
|
29
|
+
secretManagerVersion: {
|
|
30
|
+
minLength: 1
|
|
31
|
+
}
|
|
32
|
+
};
|
|
28
33
|
const CronSchedule = {
|
|
29
34
|
schedule: {
|
|
30
35
|
maxLength: 255,
|
|
@@ -85,13 +90,20 @@ const UpdateJobDefinitionRequestCronScheduleConfig = {
|
|
|
85
90
|
minLength: 1
|
|
86
91
|
}
|
|
87
92
|
};
|
|
93
|
+
const UpdateJobDefinitionSecretRequest = {
|
|
94
|
+
secretManagerVersion: {
|
|
95
|
+
minLength: 1
|
|
96
|
+
}
|
|
97
|
+
};
|
|
88
98
|
export {
|
|
89
99
|
CreateJobDefinitionRequest,
|
|
90
100
|
CreateJobDefinitionRequestCronScheduleConfig,
|
|
101
|
+
CreateJobDefinitionSecretsRequestSecretConfig,
|
|
91
102
|
CronSchedule,
|
|
92
103
|
ListJobDefinitionsRequest,
|
|
93
104
|
ListJobRunsRequest,
|
|
94
105
|
StartJobDefinitionRequest,
|
|
95
106
|
UpdateJobDefinitionRequest,
|
|
96
|
-
UpdateJobDefinitionRequestCronScheduleConfig
|
|
107
|
+
UpdateJobDefinitionRequestCronScheduleConfig,
|
|
108
|
+
UpdateJobDefinitionSecretRequest
|
|
97
109
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { API } from './api.gen';
|
|
2
2
|
export * from './content.gen';
|
|
3
|
-
export type { CancelEmailRequest, CheckDomainRequest, CreateDomainRequest, CreateEmailRequest, CreateEmailRequestAddress, CreateEmailRequestAttachment, CreateEmailRequestHeader, CreateEmailResponse, CreateWebhookRequest, DeleteWebhookRequest, Domain, DomainLastStatus, DomainLastStatusDkimRecord, DomainLastStatusDmarcRecord, DomainLastStatusRecordStatus, DomainLastStatusSpfRecord, DomainRecords, DomainRecordsDMARC, DomainReputation, DomainReputationStatus, DomainStatistics, DomainStatus, Email, EmailFlag, EmailRcptType, EmailStatus, EmailTry, GetDomainLastStatusRequest, GetDomainRequest, GetEmailRequest, GetProjectSettingsRequest, GetStatisticsRequest, GetWebhookRequest, ListDomainsRequest, ListDomainsResponse, ListEmailsRequest, ListEmailsRequestOrderBy, ListEmailsResponse, ListWebhookEventsRequest, ListWebhookEventsRequestOrderBy, ListWebhookEventsResponse, ListWebhooksRequest, ListWebhooksRequestOrderBy, ListWebhooksResponse, ProjectSettings, ProjectSettingsPeriodicReport, ProjectSettingsPeriodicReportFrequency, RevokeDomainRequest, Statistics, UpdateDomainRequest, UpdateProjectSettingsRequest, UpdateProjectSettingsRequestUpdatePeriodicReport, UpdateWebhookRequest, Webhook, WebhookEvent, WebhookEventStatus, WebhookEventType, } from './types.gen';
|
|
3
|
+
export type { CancelEmailRequest, CheckDomainRequest, CreateDomainRequest, CreateEmailRequest, CreateEmailRequestAddress, CreateEmailRequestAttachment, CreateEmailRequestHeader, CreateEmailResponse, CreateWebhookRequest, DeleteWebhookRequest, Domain, DomainLastStatus, DomainLastStatusAutoconfigState, DomainLastStatusAutoconfigStateReason, DomainLastStatusDkimRecord, DomainLastStatusDmarcRecord, DomainLastStatusRecordStatus, DomainLastStatusSpfRecord, DomainRecords, DomainRecordsDMARC, DomainReputation, DomainReputationStatus, DomainStatistics, DomainStatus, Email, EmailFlag, EmailRcptType, EmailStatus, EmailTry, GetDomainLastStatusRequest, GetDomainRequest, GetEmailRequest, GetProjectSettingsRequest, GetStatisticsRequest, GetWebhookRequest, ListDomainsRequest, ListDomainsResponse, ListEmailsRequest, ListEmailsRequestOrderBy, ListEmailsResponse, ListWebhookEventsRequest, ListWebhookEventsRequestOrderBy, ListWebhookEventsResponse, ListWebhooksRequest, ListWebhooksRequestOrderBy, ListWebhooksResponse, ProjectSettings, ProjectSettingsPeriodicReport, ProjectSettingsPeriodicReportFrequency, RevokeDomainRequest, Statistics, UpdateDomainRequest, UpdateProjectSettingsRequest, UpdateProjectSettingsRequestUpdatePeriodicReport, UpdateWebhookRequest, Webhook, WebhookEvent, WebhookEventStatus, WebhookEventType, } from './types.gen';
|
|
4
4
|
export * as ValidationRules from './validation-rules.gen';
|
|
@@ -142,6 +142,18 @@ const unmarshalCreateEmailResponse = (data) => {
|
|
|
142
142
|
emails: marshalling.unmarshalArrayOfObject(data.emails, unmarshalEmail)
|
|
143
143
|
};
|
|
144
144
|
};
|
|
145
|
+
const unmarshalDomainLastStatusAutoconfigState = (data) => {
|
|
146
|
+
if (!json.isJSONObject(data)) {
|
|
147
|
+
throw new TypeError(
|
|
148
|
+
`Unmarshalling the type 'DomainLastStatusAutoconfigState' failed as data isn't a dictionary.`
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
return {
|
|
152
|
+
autoconfigurable: data.autoconfigurable,
|
|
153
|
+
enabled: data.enabled,
|
|
154
|
+
reason: data.reason ? data.reason : void 0
|
|
155
|
+
};
|
|
156
|
+
};
|
|
145
157
|
const unmarshalDomainLastStatusDkimRecord = (data) => {
|
|
146
158
|
if (!json.isJSONObject(data)) {
|
|
147
159
|
throw new TypeError(
|
|
@@ -185,6 +197,7 @@ const unmarshalDomainLastStatus = (data) => {
|
|
|
185
197
|
);
|
|
186
198
|
}
|
|
187
199
|
return {
|
|
200
|
+
autoconfigState: data.autoconfig_state ? unmarshalDomainLastStatusAutoconfigState(data.autoconfig_state) : void 0,
|
|
188
201
|
dkimRecord: data.dkim_record ? unmarshalDomainLastStatusDkimRecord(data.dkim_record) : void 0,
|
|
189
202
|
dmarcRecord: data.dmarc_record ? unmarshalDomainLastStatusDmarcRecord(data.dmarc_record) : void 0,
|
|
190
203
|
domainId: data.domain_id,
|
|
@@ -140,6 +140,18 @@ const unmarshalCreateEmailResponse = (data) => {
|
|
|
140
140
|
emails: unmarshalArrayOfObject(data.emails, unmarshalEmail)
|
|
141
141
|
};
|
|
142
142
|
};
|
|
143
|
+
const unmarshalDomainLastStatusAutoconfigState = (data) => {
|
|
144
|
+
if (!isJSONObject(data)) {
|
|
145
|
+
throw new TypeError(
|
|
146
|
+
`Unmarshalling the type 'DomainLastStatusAutoconfigState' failed as data isn't a dictionary.`
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
return {
|
|
150
|
+
autoconfigurable: data.autoconfigurable,
|
|
151
|
+
enabled: data.enabled,
|
|
152
|
+
reason: data.reason ? data.reason : void 0
|
|
153
|
+
};
|
|
154
|
+
};
|
|
143
155
|
const unmarshalDomainLastStatusDkimRecord = (data) => {
|
|
144
156
|
if (!isJSONObject(data)) {
|
|
145
157
|
throw new TypeError(
|
|
@@ -183,6 +195,7 @@ const unmarshalDomainLastStatus = (data) => {
|
|
|
183
195
|
);
|
|
184
196
|
}
|
|
185
197
|
return {
|
|
198
|
+
autoconfigState: data.autoconfig_state ? unmarshalDomainLastStatusAutoconfigState(data.autoconfig_state) : void 0,
|
|
186
199
|
dkimRecord: data.dkim_record ? unmarshalDomainLastStatusDkimRecord(data.dkim_record) : void 0,
|
|
187
200
|
dmarcRecord: data.dmarc_record ? unmarshalDomainLastStatusDmarcRecord(data.dmarc_record) : void 0,
|
|
188
201
|
domainId: data.domain_id,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Region } from '../../../bridge';
|
|
2
|
+
export type DomainLastStatusAutoconfigStateReason = 'unknown_reason' | 'permission_denied' | 'domain_not_found';
|
|
2
3
|
export type DomainLastStatusRecordStatus = 'unknown_record_status' | 'valid' | 'invalid' | 'not_found';
|
|
3
4
|
export type DomainReputationStatus = 'unknown_status' | 'excellent' | 'good' | 'average' | 'bad';
|
|
4
5
|
export type DomainStatus = 'unknown' | 'checked' | 'unchecked' | 'invalid' | 'locked' | 'revoked' | 'pending' | 'autoconfiguring';
|
|
@@ -114,6 +115,14 @@ export interface Email {
|
|
|
114
115
|
*/
|
|
115
116
|
flags: EmailFlag[];
|
|
116
117
|
}
|
|
118
|
+
export interface DomainLastStatusAutoconfigState {
|
|
119
|
+
/** Enable or disable the auto-configuration of domain DNS records. */
|
|
120
|
+
enabled: boolean;
|
|
121
|
+
/** Whether the domain can be auto-configured or not. */
|
|
122
|
+
autoconfigurable: boolean;
|
|
123
|
+
/** The reason that the domain cannot be auto-configurable. */
|
|
124
|
+
reason?: DomainLastStatusAutoconfigStateReason;
|
|
125
|
+
}
|
|
117
126
|
export interface DomainLastStatusDkimRecord {
|
|
118
127
|
/** Status of the DKIM record's configuration. */
|
|
119
128
|
status: DomainLastStatusRecordStatus;
|
|
@@ -240,9 +249,9 @@ export interface ProjectSettingsPeriodicReport {
|
|
|
240
249
|
export interface UpdateProjectSettingsRequestUpdatePeriodicReport {
|
|
241
250
|
/** (Optional) Enable or disable periodic report notifications. */
|
|
242
251
|
enabled?: boolean;
|
|
243
|
-
/** (Optional)
|
|
252
|
+
/** (Optional) Frequency at which you receive periodic report notifications. */
|
|
244
253
|
frequency?: ProjectSettingsPeriodicReportFrequency;
|
|
245
|
-
/** (Optional)
|
|
254
|
+
/** (Optional) Hour at which you receive periodic report notifications. */
|
|
246
255
|
sendingHour?: number;
|
|
247
256
|
/**
|
|
248
257
|
* (Optional) On which day you receive periodic report notifications (1-7
|
|
@@ -353,6 +362,8 @@ export interface DomainLastStatus {
|
|
|
353
362
|
dkimRecord?: DomainLastStatusDkimRecord;
|
|
354
363
|
/** The DMARC record verification data. */
|
|
355
364
|
dmarcRecord?: DomainLastStatusDmarcRecord;
|
|
365
|
+
/** The verification state of domain auto-configuration. */
|
|
366
|
+
autoconfigState?: DomainLastStatusAutoconfigState;
|
|
356
367
|
}
|
|
357
368
|
export type GetDomainLastStatusRequest = {
|
|
358
369
|
/**
|
package/dist/scw/constants.cjs
CHANGED
package/dist/scw/constants.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "v2.49.
|
|
2
|
-
export declare const userAgent = "scaleway-sdk-js/v2.49.
|
|
1
|
+
export declare const version = "v2.49.1";
|
|
2
|
+
export declare const userAgent = "scaleway-sdk-js/v2.49.1";
|
package/dist/scw/constants.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scaleway/sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.50.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": "a483682cce73c1660c461ed1b9f418539a21db25"
|
|
43
43
|
}
|