@scaleway/sdk 2.49.1 → 2.51.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/dist/api/applesilicon/v1alpha1/marshalling.gen.cjs +1 -0
  2. package/dist/api/applesilicon/v1alpha1/marshalling.gen.js +1 -0
  3. package/dist/api/applesilicon/v1alpha1/types.gen.d.ts +8 -0
  4. package/dist/api/baremetal/v1/marshalling.gen.cjs +3 -1
  5. package/dist/api/baremetal/v1/marshalling.gen.js +3 -1
  6. package/dist/api/baremetal/v1/types.gen.d.ts +4 -3
  7. package/dist/api/dedibox/v1/types.gen.d.ts +1 -1
  8. package/dist/api/edge_services/v1alpha1/api.gen.cjs +39 -0
  9. package/dist/api/edge_services/v1alpha1/api.gen.d.ts +16 -1
  10. package/dist/api/edge_services/v1alpha1/api.gen.js +40 -1
  11. package/dist/api/edge_services/v1alpha1/index.gen.d.ts +1 -1
  12. package/dist/api/edge_services/v1alpha1/marshalling.gen.cjs +54 -6
  13. package/dist/api/edge_services/v1alpha1/marshalling.gen.d.ts +4 -1
  14. package/dist/api/edge_services/v1alpha1/marshalling.gen.js +54 -6
  15. package/dist/api/edge_services/v1alpha1/types.gen.d.ts +64 -1
  16. package/dist/api/iam/v1alpha1/marshalling.gen.cjs +9 -0
  17. package/dist/api/iam/v1alpha1/marshalling.gen.js +9 -0
  18. package/dist/api/iam/v1alpha1/types.gen.d.ts +18 -0
  19. package/dist/api/index.gen.d.ts +2 -1
  20. package/dist/api/inference/v1beta1/validation-rules.gen.cjs +1 -1
  21. package/dist/api/inference/v1beta1/validation-rules.gen.js +1 -1
  22. package/dist/api/instance/v1/api.gen.cjs +0 -37
  23. package/dist/api/instance/v1/api.gen.d.ts +1 -21
  24. package/dist/api/instance/v1/api.gen.js +1 -38
  25. package/dist/api/instance/v1/index.gen.d.ts +1 -1
  26. package/dist/api/instance/v1/marshalling.gen.cjs +1 -28
  27. package/dist/api/instance/v1/marshalling.gen.d.ts +1 -3
  28. package/dist/api/instance/v1/marshalling.gen.js +1 -28
  29. package/dist/api/instance/v1/types.gen.d.ts +9 -53
  30. package/dist/api/instance/v1/types.private.gen.d.ts +1 -3
  31. package/dist/api/jobs/v1alpha1/api.gen.cjs +46 -0
  32. package/dist/api/jobs/v1alpha1/api.gen.d.ts +6 -1
  33. package/dist/api/jobs/v1alpha1/api.gen.js +47 -1
  34. package/dist/api/jobs/v1alpha1/index.gen.d.ts +1 -1
  35. package/dist/api/jobs/v1alpha1/marshalling.gen.cjs +80 -0
  36. package/dist/api/jobs/v1alpha1/marshalling.gen.d.ts +6 -1
  37. package/dist/api/jobs/v1alpha1/marshalling.gen.js +81 -1
  38. package/dist/api/jobs/v1alpha1/types.gen.d.ts +81 -0
  39. package/dist/api/jobs/v1alpha1/validation-rules.gen.cjs +14 -2
  40. package/dist/api/jobs/v1alpha1/validation-rules.gen.d.ts +10 -0
  41. package/dist/api/jobs/v1alpha1/validation-rules.gen.js +15 -3
  42. package/dist/api/mongodb/index.gen.cjs +4 -0
  43. package/dist/api/mongodb/index.gen.d.ts +5 -0
  44. package/dist/api/mongodb/index.gen.js +4 -0
  45. package/dist/api/mongodb/v1alpha1/api.gen.cjs +385 -0
  46. package/dist/api/mongodb/v1alpha1/api.gen.d.ts +195 -0
  47. package/dist/api/mongodb/v1alpha1/api.gen.js +385 -0
  48. package/dist/api/mongodb/v1alpha1/content.gen.cjs +16 -0
  49. package/dist/api/mongodb/v1alpha1/content.gen.d.ts +5 -0
  50. package/dist/api/mongodb/v1alpha1/content.gen.js +16 -0
  51. package/dist/api/mongodb/v1alpha1/index.gen.cjs +9 -0
  52. package/dist/api/mongodb/v1alpha1/index.gen.d.ts +4 -0
  53. package/dist/api/mongodb/v1alpha1/index.gen.js +9 -0
  54. package/dist/api/mongodb/v1alpha1/marshalling.gen.cjs +326 -0
  55. package/dist/api/mongodb/v1alpha1/marshalling.gen.d.ts +19 -0
  56. package/dist/api/mongodb/v1alpha1/marshalling.gen.js +326 -0
  57. package/dist/api/mongodb/v1alpha1/types.gen.d.ts +461 -0
  58. package/dist/api/mongodb/v1alpha1/validation-rules.gen.cjs +147 -0
  59. package/dist/api/mongodb/v1alpha1/validation-rules.gen.d.ts +134 -0
  60. package/dist/api/mongodb/v1alpha1/validation-rules.gen.js +147 -0
  61. package/dist/api/tem/v1alpha1/index.gen.d.ts +1 -1
  62. package/dist/api/tem/v1alpha1/marshalling.gen.cjs +13 -0
  63. package/dist/api/tem/v1alpha1/marshalling.gen.js +13 -0
  64. package/dist/api/tem/v1alpha1/types.gen.d.ts +13 -2
  65. package/dist/api/webhosting/v1alpha1/types.gen.d.ts +1 -1
  66. package/dist/index.cjs +16 -14
  67. package/dist/index.js +16 -14
  68. package/dist/scw/constants.cjs +1 -1
  69. package/dist/scw/constants.d.ts +2 -2
  70. package/dist/scw/constants.js +1 -1
  71. package/package.json +2 -2
@@ -32,35 +32,18 @@ export interface ServerSummary {
32
32
  name: string;
33
33
  }
34
34
  export interface Bootscript {
35
- /** Bootscript arguments. */
35
+ architecture: Arch;
36
36
  bootcmdargs: string;
37
- /**
38
- * Display if the bootscript is the default bootscript (if no other boot
39
- * option is configured).
40
- */
41
37
  default: boolean;
42
- /**
43
- * Provide information regarding a Device Tree Binary (DTB) for use with C1
44
- * servers.
45
- */
46
38
  dtb: string;
47
- /** Bootscript ID. */
48
39
  id: string;
49
- /** Initrd (initial ramdisk) configuration. */
50
40
  initrd: string;
51
- /** Instance kernel version. */
52
41
  kernel: string;
53
- /** Bootscript Organization ID. */
54
42
  organization: string;
55
- /** Bootscript Project ID. */
56
- project: string;
57
- /** Provide information if the bootscript is public. */
58
43
  public: boolean;
59
- /** Bootscript title. */
60
44
  title: string;
61
- /** Bootscript architecture. */
62
- architecture: Arch;
63
- /** Zone in which the bootscript is located. */
45
+ project: string;
46
+ /** Zone to target. If none is passed will use default zone from the config. */
64
47
  zone: Zone;
65
48
  }
66
49
  export interface Volume {
@@ -323,8 +306,6 @@ export interface Server {
323
306
  * `True`).
324
307
  */
325
308
  ipv6?: ServerIpv6;
326
- /** @deprecated Instance bootscript. */
327
- bootscript?: Bootscript;
328
309
  /** Instance boot type. */
329
310
  bootType: BootType;
330
311
  /** Instance volumes. */
@@ -679,8 +660,6 @@ export type CreateImageRequest = {
679
660
  rootVolume: string;
680
661
  /** Architecture of the image. */
681
662
  arch: Arch;
682
- /** @deprecated Default bootscript of the image. */
683
- defaultBootscript?: string;
684
663
  /** Additional volumes of the image. */
685
664
  extraVolumes?: Record<string, VolumeTemplate>;
686
665
  /**
@@ -874,7 +853,7 @@ export type CreateServerRequest = {
874
853
  /** Define the Instance commercial type (i.e. GP1-S). */
875
854
  commercialType: string;
876
855
  /** Instance image ID or label. */
877
- image: string;
856
+ image?: string;
878
857
  /** Volumes attached to the server. */
879
858
  volumes?: Record<string, VolumeServerTemplate>;
880
859
  /**
@@ -888,8 +867,6 @@ export type CreateServerRequest = {
888
867
  publicIps?: string[];
889
868
  /** Boot type to use. */
890
869
  bootType?: BootType;
891
- /** @deprecated Bootscript ID to use when `boot_type` is set to `bootscript`. */
892
- bootscript?: string;
893
870
  /**
894
871
  * @deprecated Instance Organization ID.
895
872
  *
@@ -1079,14 +1056,6 @@ export type ExportSnapshotRequest = {
1079
1056
  export interface ExportSnapshotResponse {
1080
1057
  task?: Task;
1081
1058
  }
1082
- export type GetBootscriptRequest = {
1083
- /** Zone to target. If none is passed will use default zone from the config. */
1084
- zone?: Zone;
1085
- bootscriptId: string;
1086
- };
1087
- export interface GetBootscriptResponse {
1088
- bootscript?: Bootscript;
1089
- }
1090
1059
  export type GetDashboardRequest = {
1091
1060
  /** Zone to target. If none is passed will use default zone from the config. */
1092
1061
  zone?: Zone;
@@ -1205,22 +1174,6 @@ export type GetVolumeRequest = {
1205
1174
  export interface GetVolumeResponse {
1206
1175
  volume?: Volume;
1207
1176
  }
1208
- export type ListBootscriptsRequest = {
1209
- /** Zone to target. If none is passed will use default zone from the config. */
1210
- zone?: Zone;
1211
- arch?: string;
1212
- title?: string;
1213
- default?: boolean;
1214
- public?: boolean;
1215
- perPage?: number;
1216
- page?: number;
1217
- };
1218
- export interface ListBootscriptsResponse {
1219
- /** Total number of bootscripts. */
1220
- totalCount: number;
1221
- /** List of bootscripts. */
1222
- bootscripts: Bootscript[];
1223
- }
1224
1177
  export type ListDefaultSecurityGroupRulesRequest = {
1225
1178
  /** Zone to target. If none is passed will use default zone from the config. */
1226
1179
  zone?: Zone;
@@ -1580,6 +1533,11 @@ export type ServerActionRequest = {
1580
1533
  * should only be specified when performing a backup action.
1581
1534
  */
1582
1535
  volumes?: Record<string, ServerActionRequestVolumeBackupTemplate>;
1536
+ /**
1537
+ * Disable IPv6 on the Instance while performing migration to routed IPs. This
1538
+ * field should only be specified when performing a enable_routed_ip action.
1539
+ */
1540
+ disableIpv6?: boolean;
1583
1541
  };
1584
1542
  export interface ServerActionResponse {
1585
1543
  task?: Task;
@@ -1789,8 +1747,6 @@ export type UpdateServerRequest = {
1789
1747
  /** Tags of the Instance. */
1790
1748
  tags?: string[];
1791
1749
  volumes?: Record<string, VolumeServerTemplate>;
1792
- /** @deprecated */
1793
- bootscript?: string;
1794
1750
  dynamicIpRequired?: boolean;
1795
1751
  /**
1796
1752
  * @deprecated True to configure the instance so it uses the new routed IP
@@ -1,5 +1,5 @@
1
1
  import type { Zone } from '../../../bridge';
2
- import type { Arch, BootType, Bootscript, Image, PlacementGroup, PrivateNIC, SecurityGroup, SecurityGroupPolicy, SecurityGroupRule, SecurityGroupRuleAction, SecurityGroupRuleDirection, SecurityGroupRuleProtocol, SecurityGroupSummary, Server, ServerAction, ServerIp, ServerIpv6, ServerLocation, ServerMaintenance, ServerState, ServerSummary, Snapshot, SnapshotBaseVolume, SnapshotState, Volume, VolumeVolumeType } from './types.gen';
2
+ import type { Arch, BootType, Image, PlacementGroup, PrivateNIC, SecurityGroup, SecurityGroupPolicy, SecurityGroupRule, SecurityGroupRuleAction, SecurityGroupRuleDirection, SecurityGroupRuleProtocol, SecurityGroupSummary, Server, ServerAction, ServerIp, ServerIpv6, ServerLocation, ServerMaintenance, ServerState, ServerSummary, Snapshot, SnapshotBaseVolume, SnapshotState, Volume, VolumeVolumeType } from './types.gen';
3
3
  export interface SetImageResponse {
4
4
  image?: Image;
5
5
  }
@@ -121,8 +121,6 @@ export type SetServerRequest = {
121
121
  * `True`).
122
122
  */
123
123
  ipv6?: ServerIpv6;
124
- /** @deprecated Instance bootscript. */
125
- bootscript?: Bootscript;
126
124
  /** Instance boot type. */
127
125
  bootType?: BootType;
128
126
  /** Instance volumes. */
@@ -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
+ };