@scaleway/sdk-jobs 2.3.1 → 2.4.1

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.
@@ -1,3 +1,4 @@
1
+ //#region \0rolldown/runtime.js
1
2
  var __defProp = Object.defineProperty;
2
3
  var __exportAll = (all, no_symbols) => {
3
4
  let target = {};
@@ -8,4 +9,5 @@ var __exportAll = (all, no_symbols) => {
8
9
  if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
9
10
  return target;
10
11
  };
12
+ //#endregion
11
13
  export { __exportAll };
@@ -1,12 +1,13 @@
1
1
  import { marshalCreateJobDefinitionRequest, marshalCreateJobDefinitionSecretsRequest, marshalStartJobDefinitionRequest, marshalUpdateJobDefinitionRequest, marshalUpdateJobDefinitionSecretRequest, unmarshalCreateJobDefinitionSecretsResponse, unmarshalJobDefinition, unmarshalJobRun, unmarshalJobsLimits, unmarshalListJobDefinitionSecretsResponse, unmarshalListJobDefinitionsResponse, unmarshalListJobRunsResponse, unmarshalListJobsResourcesResponse, unmarshalSecret, unmarshalStartJobDefinitionResponse } from "./marshalling.gen.js";
2
- import { API, enrichForPagination, toApiLocality, urlParams, validatePathParam } from "@scaleway/sdk-client";
2
+ import { API as API$1, enrichForPagination, toApiLocality, urlParams, validatePathParam } from "@scaleway/sdk-client";
3
+ //#region src/v1alpha1/api.gen.ts
3
4
  var jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
4
5
  /**
5
6
  * Serverless Jobs API.
6
7
 
7
8
  This API allows you to manage your Serverless Jobs.
8
9
  */
9
- var API$1 = class extends API {
10
+ var API = class extends API$1 {
10
11
  /**
11
12
  * Locality of this API.
12
13
  * type ∈ {'zone','region','global','unspecified'}
@@ -191,4 +192,5 @@ var API$1 = class extends API {
191
192
  path: `/serverless-jobs/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/jobs-limits`
192
193
  }, unmarshalJobsLimits);
193
194
  };
194
- export { API$1 as API };
195
+ //#endregion
196
+ export { API };
@@ -1,7 +1,9 @@
1
+ //#region src/v1alpha1/content.gen.ts
1
2
  /** Lists transient statutes of the enum {@link JobRunState}. */
2
- const JOB_RUN_TRANSIENT_STATUSES = [
3
+ var JOB_RUN_TRANSIENT_STATUSES = [
3
4
  "queued",
4
5
  "scheduled",
5
6
  "running"
6
7
  ];
8
+ //#endregion
7
9
  export { JOB_RUN_TRANSIENT_STATUSES };
@@ -3,6 +3,7 @@ import { marshalCreateJobDefinitionRequest, marshalCreateJobDefinitionSecretsReq
3
3
  import { API } from "./api.gen.js";
4
4
  import { JOB_RUN_TRANSIENT_STATUSES } from "./content.gen.js";
5
5
  import { validation_rules_gen_exports } from "./validation-rules.gen.js";
6
+ //#region src/v1alpha1/index.gen.ts
6
7
  var index_gen_exports = /* @__PURE__ */ __exportAll({
7
8
  API: () => API,
8
9
  JOB_RUN_TRANSIENT_STATUSES: () => JOB_RUN_TRANSIENT_STATUSES,
@@ -23,4 +24,5 @@ var index_gen_exports = /* @__PURE__ */ __exportAll({
23
24
  unmarshalSecret: () => unmarshalSecret,
24
25
  unmarshalStartJobDefinitionResponse: () => unmarshalStartJobDefinitionResponse
25
26
  });
26
- export { index_gen_exports };
27
+ //#endregion
28
+ export { API, JOB_RUN_TRANSIENT_STATUSES, validation_rules_gen_exports as ValidationRules, index_gen_exports, marshalCreateJobDefinitionRequest, marshalCreateJobDefinitionSecretsRequest, marshalStartJobDefinitionRequest, marshalUpdateJobDefinitionRequest, marshalUpdateJobDefinitionSecretRequest, unmarshalCreateJobDefinitionSecretsResponse, unmarshalJobDefinition, unmarshalJobRun, unmarshalJobsLimits, unmarshalListJobDefinitionSecretsResponse, unmarshalListJobDefinitionsResponse, unmarshalListJobRunsResponse, unmarshalListJobsResourcesResponse, unmarshalSecret, unmarshalStartJobDefinitionResponse };
@@ -1,5 +1,6 @@
1
1
  import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
2
2
  import randomName from "@scaleway/random-name";
3
+ //#region src/v1alpha1/marshalling.gen.ts
3
4
  var unmarshalSecretEnvVar = (data) => {
4
5
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SecretEnvVar' failed as data isn't a dictionary.`);
5
6
  return { name: data.name };
@@ -8,7 +9,7 @@ var unmarshalSecretFile = (data) => {
8
9
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SecretFile' failed as data isn't a dictionary.`);
9
10
  return { path: data.path };
10
11
  };
11
- const unmarshalSecret = (data) => {
12
+ var unmarshalSecret = (data) => {
12
13
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Secret' failed as data isn't a dictionary.`);
13
14
  return {
14
15
  envVar: data.env_var ? unmarshalSecretEnvVar(data.env_var) : void 0,
@@ -25,7 +26,7 @@ var unmarshalCronSchedule = (data) => {
25
26
  timezone: data.timezone
26
27
  };
27
28
  };
28
- const unmarshalJobDefinition = (data) => {
29
+ var unmarshalJobDefinition = (data) => {
29
30
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'JobDefinition' failed as data isn't a dictionary.`);
30
31
  return {
31
32
  command: data.command,
@@ -45,7 +46,7 @@ const unmarshalJobDefinition = (data) => {
45
46
  updatedAt: unmarshalDate(data.updated_at)
46
47
  };
47
48
  };
48
- const unmarshalJobRun = (data) => {
49
+ var unmarshalJobRun = (data) => {
49
50
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'JobRun' failed as data isn't a dictionary.`);
50
51
  return {
51
52
  command: data.command,
@@ -66,29 +67,29 @@ const unmarshalJobRun = (data) => {
66
67
  updatedAt: unmarshalDate(data.updated_at)
67
68
  };
68
69
  };
69
- const unmarshalCreateJobDefinitionSecretsResponse = (data) => {
70
+ var unmarshalCreateJobDefinitionSecretsResponse = (data) => {
70
71
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'CreateJobDefinitionSecretsResponse' failed as data isn't a dictionary.`);
71
72
  return { secrets: unmarshalArrayOfObject(data.secrets, unmarshalSecret) };
72
73
  };
73
- const unmarshalJobsLimits = (data) => {
74
+ var unmarshalJobsLimits = (data) => {
74
75
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'JobsLimits' failed as data isn't a dictionary.`);
75
76
  return { secretsPerJobDefinition: data.secrets_per_job_definition };
76
77
  };
77
- const unmarshalListJobDefinitionSecretsResponse = (data) => {
78
+ var unmarshalListJobDefinitionSecretsResponse = (data) => {
78
79
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListJobDefinitionSecretsResponse' failed as data isn't a dictionary.`);
79
80
  return {
80
81
  secrets: unmarshalArrayOfObject(data.secrets, unmarshalSecret),
81
82
  totalCount: data.total_count
82
83
  };
83
84
  };
84
- const unmarshalListJobDefinitionsResponse = (data) => {
85
+ var unmarshalListJobDefinitionsResponse = (data) => {
85
86
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListJobDefinitionsResponse' failed as data isn't a dictionary.`);
86
87
  return {
87
88
  jobDefinitions: unmarshalArrayOfObject(data.job_definitions, unmarshalJobDefinition),
88
89
  totalCount: data.total_count
89
90
  };
90
91
  };
91
- const unmarshalListJobRunsResponse = (data) => {
92
+ var unmarshalListJobRunsResponse = (data) => {
92
93
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListJobRunsResponse' failed as data isn't a dictionary.`);
93
94
  return {
94
95
  jobRuns: unmarshalArrayOfObject(data.job_runs, unmarshalJobRun),
@@ -102,11 +103,11 @@ var unmarshalResource = (data) => {
102
103
  memoryLimit: data.memory_limit
103
104
  };
104
105
  };
105
- const unmarshalListJobsResourcesResponse = (data) => {
106
+ var unmarshalListJobsResourcesResponse = (data) => {
106
107
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListJobsResourcesResponse' failed as data isn't a dictionary.`);
107
108
  return { resources: unmarshalArrayOfObject(data.resources, unmarshalResource) };
108
109
  };
109
- const unmarshalStartJobDefinitionResponse = (data) => {
110
+ var unmarshalStartJobDefinitionResponse = (data) => {
110
111
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'StartJobDefinitionResponse' failed as data isn't a dictionary.`);
111
112
  return { jobRuns: unmarshalArrayOfObject(data.job_runs, unmarshalJobRun) };
112
113
  };
@@ -114,7 +115,7 @@ var marshalCreateJobDefinitionRequestCronScheduleConfig = (request, defaults) =>
114
115
  schedule: request.schedule,
115
116
  timezone: request.timezone
116
117
  });
117
- const marshalCreateJobDefinitionRequest = (request, defaults) => ({
118
+ var marshalCreateJobDefinitionRequest = (request, defaults) => ({
118
119
  command: request.command,
119
120
  cpu_limit: request.cpuLimit,
120
121
  cron_schedule: request.cronSchedule !== void 0 ? marshalCreateJobDefinitionRequestCronScheduleConfig(request.cronSchedule, defaults) : void 0,
@@ -138,8 +139,8 @@ var marshalCreateJobDefinitionSecretsRequestSecretConfig = (request, defaults) =
138
139
  value: request.envVarName
139
140
  }])
140
141
  });
141
- const marshalCreateJobDefinitionSecretsRequest = (request, defaults) => ({ secrets: request.secrets.map((elt) => marshalCreateJobDefinitionSecretsRequestSecretConfig(elt, defaults)) });
142
- const marshalStartJobDefinitionRequest = (request, defaults) => ({
142
+ var marshalCreateJobDefinitionSecretsRequest = (request, defaults) => ({ secrets: request.secrets.map((elt) => marshalCreateJobDefinitionSecretsRequestSecretConfig(elt, defaults)) });
143
+ var marshalStartJobDefinitionRequest = (request, defaults) => ({
143
144
  command: request.command,
144
145
  environment_variables: request.environmentVariables,
145
146
  replicas: request.replicas
@@ -148,7 +149,7 @@ var marshalUpdateJobDefinitionRequestCronScheduleConfig = (request, defaults) =>
148
149
  schedule: request.schedule,
149
150
  timezone: request.timezone
150
151
  });
151
- const marshalUpdateJobDefinitionRequest = (request, defaults) => ({
152
+ var marshalUpdateJobDefinitionRequest = (request, defaults) => ({
152
153
  command: request.command,
153
154
  cpu_limit: request.cpuLimit,
154
155
  cron_schedule: request.cronSchedule !== void 0 ? marshalUpdateJobDefinitionRequestCronScheduleConfig(request.cronSchedule, defaults) : void 0,
@@ -160,7 +161,7 @@ const marshalUpdateJobDefinitionRequest = (request, defaults) => ({
160
161
  memory_limit: request.memoryLimit,
161
162
  name: request.name
162
163
  });
163
- const marshalUpdateJobDefinitionSecretRequest = (request, defaults) => ({
164
+ var marshalUpdateJobDefinitionSecretRequest = (request, defaults) => ({
164
165
  secret_manager_version: request.secretManagerVersion,
165
166
  ...resolveOneOf([{
166
167
  param: "path",
@@ -170,4 +171,5 @@ const marshalUpdateJobDefinitionSecretRequest = (request, defaults) => ({
170
171
  value: request.envVarName
171
172
  }])
172
173
  });
174
+ //#endregion
173
175
  export { marshalCreateJobDefinitionRequest, marshalCreateJobDefinitionSecretsRequest, marshalStartJobDefinitionRequest, marshalUpdateJobDefinitionRequest, marshalUpdateJobDefinitionSecretRequest, unmarshalCreateJobDefinitionSecretsResponse, unmarshalJobDefinition, unmarshalJobRun, unmarshalJobsLimits, unmarshalListJobDefinitionSecretsResponse, unmarshalListJobDefinitionsResponse, unmarshalListJobRunsResponse, unmarshalListJobsResourcesResponse, unmarshalSecret, unmarshalStartJobDefinitionResponse };
File without changes
@@ -1,4 +1,5 @@
1
1
  import { __exportAll } from "../_virtual/_rolldown/runtime.js";
2
+ //#region src/v1alpha1/validation-rules.gen.ts
2
3
  var validation_rules_gen_exports = /* @__PURE__ */ __exportAll({
3
4
  CreateJobDefinitionRequest: () => CreateJobDefinitionRequest,
4
5
  CreateJobDefinitionRequestCronScheduleConfig: () => CreateJobDefinitionRequestCronScheduleConfig,
@@ -11,7 +12,7 @@ var validation_rules_gen_exports = /* @__PURE__ */ __exportAll({
11
12
  UpdateJobDefinitionRequestCronScheduleConfig: () => UpdateJobDefinitionRequestCronScheduleConfig,
12
13
  UpdateJobDefinitionSecretRequest: () => UpdateJobDefinitionSecretRequest
13
14
  });
14
- const CreateJobDefinitionRequest = {
15
+ var CreateJobDefinitionRequest = {
15
16
  cpuLimit: { greaterThan: 0 },
16
17
  description: { maxLength: 255 },
17
18
  imageUri: { pattern: /^((?:(?:(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])(?:\.(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]))*|\[(?:[a-fA-F0-9:]+)\])(?::[0-9]+)?\/)?[a-z0-9]+(?:(?:[._]|__|[-]+)[a-z0-9]+)*(?:\/[a-z0-9]+(?:(?:[._]|__|[-]+)[a-z0-9]+)*)*)(?::(\w[A-Za-z0-9_.-]{0,127}))?(?:@([A-Za-z][A-Za-z0-9]*(?:[-_+.][A-Za-z][A-Za-z0-9]*)*[:][[:xdigit:]]{32,}))?$/ },
@@ -19,7 +20,7 @@ const CreateJobDefinitionRequest = {
19
20
  memoryLimit: { greaterThan: 0 },
20
21
  name: { pattern: /^[A-Za-z0-9-_]{3,50}$/ }
21
22
  };
22
- const CreateJobDefinitionRequestCronScheduleConfig = {
23
+ var CreateJobDefinitionRequestCronScheduleConfig = {
23
24
  schedule: {
24
25
  maxLength: 255,
25
26
  minLength: 1
@@ -29,8 +30,8 @@ const CreateJobDefinitionRequestCronScheduleConfig = {
29
30
  minLength: 1
30
31
  }
31
32
  };
32
- const CreateJobDefinitionSecretsRequestSecretConfig = { secretManagerVersion: { minLength: 1 } };
33
- const CronSchedule = {
33
+ var CreateJobDefinitionSecretsRequestSecretConfig = { secretManagerVersion: { minLength: 1 } };
34
+ var CronSchedule = {
34
35
  schedule: {
35
36
  maxLength: 255,
36
37
  minLength: 1
@@ -40,22 +41,22 @@ const CronSchedule = {
40
41
  minLength: 1
41
42
  }
42
43
  };
43
- const ListJobDefinitionsRequest = {
44
+ var ListJobDefinitionsRequest = {
44
45
  page: { greaterThanOrEqual: 1 },
45
46
  pageSize: {
46
47
  greaterThanOrEqual: 1,
47
48
  lessThanOrEqual: 1e3
48
49
  }
49
50
  };
50
- const ListJobRunsRequest = {
51
+ var ListJobRunsRequest = {
51
52
  page: { greaterThanOrEqual: 1 },
52
53
  pageSize: {
53
54
  greaterThanOrEqual: 1,
54
55
  lessThanOrEqual: 1e3
55
56
  }
56
57
  };
57
- const StartJobDefinitionRequest = { replicas: { greaterThan: 0 } };
58
- const UpdateJobDefinitionRequest = {
58
+ var StartJobDefinitionRequest = { replicas: { greaterThan: 0 } };
59
+ var UpdateJobDefinitionRequest = {
59
60
  cpuLimit: { greaterThan: 0 },
60
61
  description: { maxLength: 255 },
61
62
  imageUri: { pattern: /^((?:(?:(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])(?:\.(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]))*|\[(?:[a-fA-F0-9:]+)\])(?::[0-9]+)?\/)?[a-z0-9]+(?:(?:[._]|__|[-]+)[a-z0-9]+)*(?:\/[a-z0-9]+(?:(?:[._]|__|[-]+)[a-z0-9]+)*)*)(?::(\w[A-Za-z0-9_.-]{0,127}))?(?:@([A-Za-z][A-Za-z0-9]*(?:[-_+.][A-Za-z][A-Za-z0-9]*)*[:][[:xdigit:]]{32,}))?$/ },
@@ -63,7 +64,7 @@ const UpdateJobDefinitionRequest = {
63
64
  memoryLimit: { greaterThan: 0 },
64
65
  name: { pattern: /^[A-Za-z0-9-_]{3,50}$/ }
65
66
  };
66
- const UpdateJobDefinitionRequestCronScheduleConfig = {
67
+ var UpdateJobDefinitionRequestCronScheduleConfig = {
67
68
  schedule: {
68
69
  maxLength: 255,
69
70
  minLength: 1
@@ -73,5 +74,6 @@ const UpdateJobDefinitionRequestCronScheduleConfig = {
73
74
  minLength: 1
74
75
  }
75
76
  };
76
- const UpdateJobDefinitionSecretRequest = { secretManagerVersion: { minLength: 1 } };
77
- export { validation_rules_gen_exports };
77
+ var UpdateJobDefinitionSecretRequest = { secretManagerVersion: { minLength: 1 } };
78
+ //#endregion
79
+ export { CreateJobDefinitionRequest, CreateJobDefinitionRequestCronScheduleConfig, CreateJobDefinitionSecretsRequestSecretConfig, CronSchedule, ListJobDefinitionsRequest, ListJobRunsRequest, StartJobDefinitionRequest, UpdateJobDefinitionRequest, UpdateJobDefinitionRequestCronScheduleConfig, UpdateJobDefinitionSecretRequest, validation_rules_gen_exports };
@@ -1,6 +1,6 @@
1
1
  import type { ApiLocality } from '@scaleway/sdk-client';
2
2
  import { API as ParentAPI } from '@scaleway/sdk-client';
3
- import type { CreateJobDefinitionRequest, CreateSecretsRequest, CreateSecretsResponse, DeleteJobDefinitionRequest, DeleteSecretRequest, GetJobDefinitionRequest, GetJobLimitsRequest, GetJobRunRequest, GetSecretRequest, JobDefinition, JobLimits, JobRun, ListJobDefinitionsRequest, ListJobDefinitionsResponse, ListJobResourcesRequest, ListJobResourcesResponse, ListJobRunsRequest, ListJobRunsResponse, ListSecretsRequest, ListSecretsResponse, Secret, StartJobDefinitionRequest, StartJobDefinitionResponse, StopJobRunRequest, UpdateJobDefinitionRequest, UpdateSecretRequest } from './types.gen.js';
3
+ import type { CreateJobDefinitionRequest, CreateSecretsRequest, CreateSecretsResponse, CreateTriggerRequest, DeleteJobDefinitionRequest, DeleteSecretRequest, DeleteTriggerRequest, GetJobDefinitionRequest, GetJobLimitsRequest, GetJobRunRequest, GetSecretRequest, GetTriggerRequest, JobDefinition, JobLimits, JobRun, ListJobDefinitionsRequest, ListJobDefinitionsResponse, ListJobResourcesRequest, ListJobResourcesResponse, ListJobRunsRequest, ListJobRunsResponse, ListSecretsRequest, ListSecretsResponse, ListTriggersRequest, ListTriggersResponse, Secret, StartJobDefinitionRequest, StartJobDefinitionResponse, StopJobRunRequest, Trigger, UpdateJobDefinitionRequest, UpdateSecretRequest, UpdateTriggerRequest } from './types.gen.js';
4
4
  /**
5
5
  * Serverless Jobs API.
6
6
 
@@ -116,6 +116,44 @@ export declare class API extends ParentAPI {
116
116
  * @param request - The request {@link DeleteSecretRequest}
117
117
  */
118
118
  deleteSecret: (request: Readonly<DeleteSecretRequest>) => Promise<void>;
119
+ /**
120
+ * Create a trigger.
121
+ *
122
+ * @param request - The request {@link CreateTriggerRequest}
123
+ * @returns A Promise of Trigger
124
+ */
125
+ createTrigger: (request: Readonly<CreateTriggerRequest>) => Promise<Trigger>;
126
+ /**
127
+ * Get a trigger.
128
+ *
129
+ * @param request - The request {@link GetTriggerRequest}
130
+ * @returns A Promise of Trigger
131
+ */
132
+ getTrigger: (request: Readonly<GetTriggerRequest>) => Promise<Trigger>;
133
+ protected pageOfListTriggers: (request: Readonly<ListTriggersRequest>) => Promise<ListTriggersResponse>;
134
+ /**
135
+ * List triggers of a job definition.
136
+ *
137
+ * @param request - The request {@link ListTriggersRequest}
138
+ * @returns A Promise of ListTriggersResponse
139
+ */
140
+ listTriggers: (request: Readonly<ListTriggersRequest>) => Promise<ListTriggersResponse> & {
141
+ all: () => Promise<Trigger[]>;
142
+ [Symbol.asyncIterator]: () => AsyncGenerator<Trigger[], void, void>;
143
+ };
144
+ /**
145
+ * Update a trigger.
146
+ *
147
+ * @param request - The request {@link UpdateTriggerRequest}
148
+ * @returns A Promise of Trigger
149
+ */
150
+ updateTrigger: (request: Readonly<UpdateTriggerRequest>) => Promise<Trigger>;
151
+ /**
152
+ * Delete a trigger.
153
+ *
154
+ * @param request - The request {@link DeleteTriggerRequest}
155
+ */
156
+ deleteTrigger: (request: Readonly<DeleteTriggerRequest>) => Promise<void>;
119
157
  /**
120
158
  * List job resources for the console.
121
159
  *
@@ -1,12 +1,13 @@
1
- import { marshalCreateJobDefinitionRequest, marshalCreateSecretsRequest, marshalStartJobDefinitionRequest, marshalUpdateJobDefinitionRequest, marshalUpdateSecretRequest, unmarshalCreateSecretsResponse, unmarshalJobDefinition, unmarshalJobLimits, unmarshalJobRun, unmarshalListJobDefinitionsResponse, unmarshalListJobResourcesResponse, unmarshalListJobRunsResponse, unmarshalListSecretsResponse, unmarshalSecret, unmarshalStartJobDefinitionResponse } from "./marshalling.gen.js";
2
- import { API, enrichForPagination, toApiLocality, urlParams, validatePathParam } from "@scaleway/sdk-client";
1
+ import { marshalCreateJobDefinitionRequest, marshalCreateSecretsRequest, marshalCreateTriggerRequest, marshalStartJobDefinitionRequest, marshalUpdateJobDefinitionRequest, marshalUpdateSecretRequest, marshalUpdateTriggerRequest, unmarshalCreateSecretsResponse, unmarshalJobDefinition, unmarshalJobLimits, unmarshalJobRun, unmarshalListJobDefinitionsResponse, unmarshalListJobResourcesResponse, unmarshalListJobRunsResponse, unmarshalListSecretsResponse, unmarshalListTriggersResponse, unmarshalSecret, unmarshalStartJobDefinitionResponse, unmarshalTrigger } from "./marshalling.gen.js";
2
+ import { API as API$1, enrichForPagination, toApiLocality, urlParams, validatePathParam } from "@scaleway/sdk-client";
3
+ //#region src/v1alpha2/api.gen.ts
3
4
  var jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
4
5
  /**
5
6
  * Serverless Jobs API.
6
7
 
7
8
  This API allows you to manage your Serverless Jobs.
8
9
  */
9
- var API$1 = class extends API {
10
+ var API = class extends API$1 {
10
11
  /**
11
12
  * Locality of this API.
12
13
  * type ∈ {'zone','region','global','unspecified'}
@@ -172,6 +173,61 @@ var API$1 = class extends API {
172
173
  path: `/serverless-jobs/v1alpha2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam("secretId", request.secretId)}`
173
174
  });
174
175
  /**
176
+ * Create a trigger.
177
+ *
178
+ * @param request - The request {@link CreateTriggerRequest}
179
+ * @returns A Promise of Trigger
180
+ */
181
+ createTrigger = (request) => this.client.fetch({
182
+ body: JSON.stringify(marshalCreateTriggerRequest(request, this.client.settings)),
183
+ headers: jsonContentHeaders,
184
+ method: "POST",
185
+ path: `/serverless-jobs/v1alpha2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/triggers`
186
+ }, unmarshalTrigger);
187
+ /**
188
+ * Get a trigger.
189
+ *
190
+ * @param request - The request {@link GetTriggerRequest}
191
+ * @returns A Promise of Trigger
192
+ */
193
+ getTrigger = (request) => this.client.fetch({
194
+ method: "GET",
195
+ path: `/serverless-jobs/v1alpha2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/triggers/${validatePathParam("triggerId", request.triggerId)}`
196
+ }, unmarshalTrigger);
197
+ pageOfListTriggers = (request) => this.client.fetch({
198
+ method: "GET",
199
+ path: `/serverless-jobs/v1alpha2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/triggers`,
200
+ urlParams: urlParams(["job_definition_id", request.jobDefinitionId], ["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
201
+ }, unmarshalListTriggersResponse);
202
+ /**
203
+ * List triggers of a job definition.
204
+ *
205
+ * @param request - The request {@link ListTriggersRequest}
206
+ * @returns A Promise of ListTriggersResponse
207
+ */
208
+ listTriggers = (request) => enrichForPagination("triggers", this.pageOfListTriggers, request);
209
+ /**
210
+ * Update a trigger.
211
+ *
212
+ * @param request - The request {@link UpdateTriggerRequest}
213
+ * @returns A Promise of Trigger
214
+ */
215
+ updateTrigger = (request) => this.client.fetch({
216
+ body: JSON.stringify(marshalUpdateTriggerRequest(request, this.client.settings)),
217
+ headers: jsonContentHeaders,
218
+ method: "PATCH",
219
+ path: `/serverless-jobs/v1alpha2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/triggers/${validatePathParam("triggerId", request.triggerId)}`
220
+ }, unmarshalTrigger);
221
+ /**
222
+ * Delete a trigger.
223
+ *
224
+ * @param request - The request {@link DeleteTriggerRequest}
225
+ */
226
+ deleteTrigger = (request) => this.client.fetch({
227
+ method: "DELETE",
228
+ path: `/serverless-jobs/v1alpha2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/triggers/${validatePathParam("triggerId", request.triggerId)}`
229
+ });
230
+ /**
175
231
  * List job resources for the console.
176
232
  *
177
233
  * @param request - The request {@link ListJobResourcesRequest}
@@ -192,4 +248,5 @@ var API$1 = class extends API {
192
248
  path: `/serverless-jobs/v1alpha2/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-limits`
193
249
  }, unmarshalJobLimits);
194
250
  };
195
- export { API$1 as API };
251
+ //#endregion
252
+ export { API };
@@ -1,5 +1,6 @@
1
+ //#region src/v1alpha2/content.gen.ts
1
2
  /** Lists transient statutes of the enum {@link JobRunState}. */
2
- const JOB_RUN_TRANSIENT_STATUSES = [
3
+ var JOB_RUN_TRANSIENT_STATUSES = [
3
4
  "initialized",
4
5
  "validated",
5
6
  "queued",
@@ -7,4 +8,5 @@ const JOB_RUN_TRANSIENT_STATUSES = [
7
8
  "interrupting",
8
9
  "retrying"
9
10
  ];
11
+ //#endregion
10
12
  export { JOB_RUN_TRANSIENT_STATUSES };
@@ -1,5 +1,5 @@
1
1
  export { API, } from './api.gen.js';
2
2
  export * from './content.gen.js';
3
3
  export * from './marshalling.gen.js';
4
- export type { CreateJobDefinitionRequest, CreateJobDefinitionRequestCronScheduleConfig, CreateSecretsRequest, CreateSecretsRequestSecretConfig, CreateSecretsResponse, CronSchedule, DeleteJobDefinitionRequest, DeleteSecretRequest, GetJobDefinitionRequest, GetJobLimitsRequest, GetJobRunRequest, GetSecretRequest, JobDefinition, JobLimits, JobRun, JobRunReason, JobRunState, ListJobDefinitionsRequest, ListJobDefinitionsRequestOrderBy, ListJobDefinitionsResponse, ListJobResourcesRequest, ListJobResourcesResponse, ListJobRunsRequest, ListJobRunsRequestOrderBy, ListJobRunsResponse, ListSecretsRequest, ListSecretsResponse, Resource, RetryPolicy, Secret, SecretEnvVar, SecretFile, StartJobDefinitionRequest, StartJobDefinitionResponse, StopJobRunRequest, UpdateJobDefinitionRequest, UpdateJobDefinitionRequestCronScheduleConfig, UpdateSecretRequest, } from './types.gen.js';
4
+ export type { CreateJobDefinitionRequest, CreateJobDefinitionRequestCronScheduleConfig, CreateSecretsRequest, CreateSecretsRequestSecretConfig, CreateSecretsResponse, CreateTriggerRequest, CreateTriggerRequestCronConfig, CronSchedule, DeleteJobDefinitionRequest, DeleteSecretRequest, DeleteTriggerRequest, GetJobDefinitionRequest, GetJobLimitsRequest, GetJobRunRequest, GetSecretRequest, GetTriggerRequest, JobDefinition, JobLimits, JobRun, JobRunReason, JobRunState, ListJobDefinitionsRequest, ListJobDefinitionsRequestOrderBy, ListJobDefinitionsResponse, ListJobResourcesRequest, ListJobResourcesResponse, ListJobRunsRequest, ListJobRunsRequestOrderBy, ListJobRunsResponse, ListSecretsRequest, ListSecretsResponse, ListTriggersRequest, ListTriggersRequestOrderBy, ListTriggersResponse, Resource, RetryPolicy, Secret, SecretEnvVar, SecretFile, StartJobDefinitionRequest, StartJobDefinitionResponse, StopJobRunRequest, Trigger, TriggerCronConfig, UpdateJobDefinitionRequest, UpdateJobDefinitionRequestCronScheduleConfig, UpdateSecretRequest, UpdateTriggerRequest, UpdateTriggerRequestCronConfig, } from './types.gen.js';
5
5
  export * as ValidationRules from './validation-rules.gen.js';
@@ -1,17 +1,20 @@
1
1
  import { __exportAll } from "../_virtual/_rolldown/runtime.js";
2
- import { marshalCreateJobDefinitionRequest, marshalCreateSecretsRequest, marshalStartJobDefinitionRequest, marshalUpdateJobDefinitionRequest, marshalUpdateSecretRequest, unmarshalCreateSecretsResponse, unmarshalJobDefinition, unmarshalJobLimits, unmarshalJobRun, unmarshalListJobDefinitionsResponse, unmarshalListJobResourcesResponse, unmarshalListJobRunsResponse, unmarshalListSecretsResponse, unmarshalSecret, unmarshalStartJobDefinitionResponse } from "./marshalling.gen.js";
2
+ import { marshalCreateJobDefinitionRequest, marshalCreateSecretsRequest, marshalCreateTriggerRequest, marshalStartJobDefinitionRequest, marshalUpdateJobDefinitionRequest, marshalUpdateSecretRequest, marshalUpdateTriggerRequest, unmarshalCreateSecretsResponse, unmarshalJobDefinition, unmarshalJobLimits, unmarshalJobRun, unmarshalListJobDefinitionsResponse, unmarshalListJobResourcesResponse, unmarshalListJobRunsResponse, unmarshalListSecretsResponse, unmarshalListTriggersResponse, unmarshalSecret, unmarshalStartJobDefinitionResponse, unmarshalTrigger } from "./marshalling.gen.js";
3
3
  import { API } from "./api.gen.js";
4
4
  import { JOB_RUN_TRANSIENT_STATUSES } from "./content.gen.js";
5
5
  import { validation_rules_gen_exports } from "./validation-rules.gen.js";
6
+ //#region src/v1alpha2/index.gen.ts
6
7
  var index_gen_exports = /* @__PURE__ */ __exportAll({
7
8
  API: () => API,
8
9
  JOB_RUN_TRANSIENT_STATUSES: () => JOB_RUN_TRANSIENT_STATUSES,
9
10
  ValidationRules: () => validation_rules_gen_exports,
10
11
  marshalCreateJobDefinitionRequest: () => marshalCreateJobDefinitionRequest,
11
12
  marshalCreateSecretsRequest: () => marshalCreateSecretsRequest,
13
+ marshalCreateTriggerRequest: () => marshalCreateTriggerRequest,
12
14
  marshalStartJobDefinitionRequest: () => marshalStartJobDefinitionRequest,
13
15
  marshalUpdateJobDefinitionRequest: () => marshalUpdateJobDefinitionRequest,
14
16
  marshalUpdateSecretRequest: () => marshalUpdateSecretRequest,
17
+ marshalUpdateTriggerRequest: () => marshalUpdateTriggerRequest,
15
18
  unmarshalCreateSecretsResponse: () => unmarshalCreateSecretsResponse,
16
19
  unmarshalJobDefinition: () => unmarshalJobDefinition,
17
20
  unmarshalJobLimits: () => unmarshalJobLimits,
@@ -20,7 +23,10 @@ var index_gen_exports = /* @__PURE__ */ __exportAll({
20
23
  unmarshalListJobResourcesResponse: () => unmarshalListJobResourcesResponse,
21
24
  unmarshalListJobRunsResponse: () => unmarshalListJobRunsResponse,
22
25
  unmarshalListSecretsResponse: () => unmarshalListSecretsResponse,
26
+ unmarshalListTriggersResponse: () => unmarshalListTriggersResponse,
23
27
  unmarshalSecret: () => unmarshalSecret,
24
- unmarshalStartJobDefinitionResponse: () => unmarshalStartJobDefinitionResponse
28
+ unmarshalStartJobDefinitionResponse: () => unmarshalStartJobDefinitionResponse,
29
+ unmarshalTrigger: () => unmarshalTrigger
25
30
  });
26
- export { index_gen_exports };
31
+ //#endregion
32
+ export { API, JOB_RUN_TRANSIENT_STATUSES, validation_rules_gen_exports as ValidationRules, index_gen_exports, marshalCreateJobDefinitionRequest, marshalCreateSecretsRequest, marshalCreateTriggerRequest, marshalStartJobDefinitionRequest, marshalUpdateJobDefinitionRequest, marshalUpdateSecretRequest, marshalUpdateTriggerRequest, unmarshalCreateSecretsResponse, unmarshalJobDefinition, unmarshalJobLimits, unmarshalJobRun, unmarshalListJobDefinitionsResponse, unmarshalListJobResourcesResponse, unmarshalListJobRunsResponse, unmarshalListSecretsResponse, unmarshalListTriggersResponse, unmarshalSecret, unmarshalStartJobDefinitionResponse, unmarshalTrigger };
@@ -1,17 +1,21 @@
1
1
  import type { DefaultValues } from '@scaleway/sdk-client';
2
- import type { CreateJobDefinitionRequest, CreateSecretsRequest, CreateSecretsResponse, JobDefinition, JobLimits, JobRun, ListJobDefinitionsResponse, ListJobResourcesResponse, ListJobRunsResponse, ListSecretsResponse, Secret, StartJobDefinitionRequest, StartJobDefinitionResponse, UpdateJobDefinitionRequest, UpdateSecretRequest } from './types.gen.js';
2
+ import type { CreateJobDefinitionRequest, CreateSecretsRequest, CreateSecretsResponse, CreateTriggerRequest, JobDefinition, JobLimits, JobRun, ListJobDefinitionsResponse, ListJobResourcesResponse, ListJobRunsResponse, ListSecretsResponse, ListTriggersResponse, Secret, StartJobDefinitionRequest, StartJobDefinitionResponse, Trigger, UpdateJobDefinitionRequest, UpdateSecretRequest, UpdateTriggerRequest } from './types.gen.js';
3
3
  export declare const unmarshalSecret: (data: unknown) => Secret;
4
4
  export declare const unmarshalJobDefinition: (data: unknown) => JobDefinition;
5
5
  export declare const unmarshalJobRun: (data: unknown) => JobRun;
6
+ export declare const unmarshalTrigger: (data: unknown) => Trigger;
6
7
  export declare const unmarshalCreateSecretsResponse: (data: unknown) => CreateSecretsResponse;
7
8
  export declare const unmarshalJobLimits: (data: unknown) => JobLimits;
8
9
  export declare const unmarshalListJobDefinitionsResponse: (data: unknown) => ListJobDefinitionsResponse;
9
10
  export declare const unmarshalListJobResourcesResponse: (data: unknown) => ListJobResourcesResponse;
10
11
  export declare const unmarshalListJobRunsResponse: (data: unknown) => ListJobRunsResponse;
11
12
  export declare const unmarshalListSecretsResponse: (data: unknown) => ListSecretsResponse;
13
+ export declare const unmarshalListTriggersResponse: (data: unknown) => ListTriggersResponse;
12
14
  export declare const unmarshalStartJobDefinitionResponse: (data: unknown) => StartJobDefinitionResponse;
13
15
  export declare const marshalCreateJobDefinitionRequest: (request: CreateJobDefinitionRequest, defaults: DefaultValues) => Record<string, unknown>;
14
16
  export declare const marshalCreateSecretsRequest: (request: CreateSecretsRequest, defaults: DefaultValues) => Record<string, unknown>;
17
+ export declare const marshalCreateTriggerRequest: (request: CreateTriggerRequest, defaults: DefaultValues) => Record<string, unknown>;
15
18
  export declare const marshalStartJobDefinitionRequest: (request: StartJobDefinitionRequest, defaults: DefaultValues) => Record<string, unknown>;
16
19
  export declare const marshalUpdateJobDefinitionRequest: (request: UpdateJobDefinitionRequest, defaults: DefaultValues) => Record<string, unknown>;
17
20
  export declare const marshalUpdateSecretRequest: (request: UpdateSecretRequest, defaults: DefaultValues) => Record<string, unknown>;
21
+ export declare const marshalUpdateTriggerRequest: (request: UpdateTriggerRequest, defaults: DefaultValues) => Record<string, unknown>;
@@ -1,5 +1,6 @@
1
1
  import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
2
2
  import randomName from "@scaleway/random-name";
3
+ //#region src/v1alpha2/marshalling.gen.ts
3
4
  var unmarshalSecretEnvVar = (data) => {
4
5
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SecretEnvVar' failed as data isn't a dictionary.`);
5
6
  return { name: data.name };
@@ -8,7 +9,7 @@ var unmarshalSecretFile = (data) => {
8
9
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SecretFile' failed as data isn't a dictionary.`);
9
10
  return { path: data.path };
10
11
  };
11
- const unmarshalSecret = (data) => {
12
+ var unmarshalSecret = (data) => {
12
13
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Secret' failed as data isn't a dictionary.`);
13
14
  return {
14
15
  envVar: data.env_var ? unmarshalSecretEnvVar(data.env_var) : void 0,
@@ -30,7 +31,7 @@ var unmarshalRetryPolicy = (data) => {
30
31
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'RetryPolicy' failed as data isn't a dictionary.`);
31
32
  return { maxRetries: data.max_retries };
32
33
  };
33
- const unmarshalJobDefinition = (data) => {
34
+ var unmarshalJobDefinition = (data) => {
34
35
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'JobDefinition' failed as data isn't a dictionary.`);
35
36
  return {
36
37
  args: data.args,
@@ -53,7 +54,7 @@ const unmarshalJobDefinition = (data) => {
53
54
  updatedAt: unmarshalDate(data.updated_at)
54
55
  };
55
56
  };
56
- const unmarshalJobRun = (data) => {
57
+ var unmarshalJobRun = (data) => {
57
58
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'JobRun' failed as data isn't a dictionary.`);
58
59
  return {
59
60
  args: data.args,
@@ -68,7 +69,7 @@ const unmarshalJobRun = (data) => {
68
69
  jobDefinitionId: data.job_definition_id,
69
70
  localStorageCapacity: data.local_storage_capacity,
70
71
  memoryLimit: data.memory_limit,
71
- reason: data.reason ? data.reason : void 0,
72
+ reason: data.reason,
72
73
  region: data.region,
73
74
  runDuration: data.run_duration,
74
75
  startedAt: unmarshalDate(data.started_at),
@@ -78,15 +79,35 @@ const unmarshalJobRun = (data) => {
78
79
  updatedAt: unmarshalDate(data.updated_at)
79
80
  };
80
81
  };
81
- const unmarshalCreateSecretsResponse = (data) => {
82
+ var unmarshalTriggerCronConfig = (data) => {
83
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'TriggerCronConfig' failed as data isn't a dictionary.`);
84
+ return {
85
+ args: data.args,
86
+ schedule: data.schedule,
87
+ startupCommand: data.startup_command,
88
+ timezone: data.timezone
89
+ };
90
+ };
91
+ var unmarshalTrigger = (data) => {
92
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Trigger' failed as data isn't a dictionary.`);
93
+ return {
94
+ createdAt: unmarshalDate(data.created_at),
95
+ cronConfig: data.cron_config ? unmarshalTriggerCronConfig(data.cron_config) : void 0,
96
+ id: data.id,
97
+ jobDefinitionId: data.job_definition_id,
98
+ name: data.name,
99
+ updatedAt: unmarshalDate(data.updated_at)
100
+ };
101
+ };
102
+ var unmarshalCreateSecretsResponse = (data) => {
82
103
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'CreateSecretsResponse' failed as data isn't a dictionary.`);
83
104
  return { secrets: unmarshalArrayOfObject(data.secrets, unmarshalSecret) };
84
105
  };
85
- const unmarshalJobLimits = (data) => {
106
+ var unmarshalJobLimits = (data) => {
86
107
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'JobLimits' failed as data isn't a dictionary.`);
87
108
  return { secretsPerJobDefinition: data.secrets_per_job_definition };
88
109
  };
89
- const unmarshalListJobDefinitionsResponse = (data) => {
110
+ var unmarshalListJobDefinitionsResponse = (data) => {
90
111
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListJobDefinitionsResponse' failed as data isn't a dictionary.`);
91
112
  return {
92
113
  jobDefinitions: unmarshalArrayOfObject(data.job_definitions, unmarshalJobDefinition),
@@ -100,25 +121,32 @@ var unmarshalResource = (data) => {
100
121
  memoryLimitBytes: data.memory_limit_bytes
101
122
  };
102
123
  };
103
- const unmarshalListJobResourcesResponse = (data) => {
124
+ var unmarshalListJobResourcesResponse = (data) => {
104
125
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListJobResourcesResponse' failed as data isn't a dictionary.`);
105
126
  return { resources: unmarshalArrayOfObject(data.resources, unmarshalResource) };
106
127
  };
107
- const unmarshalListJobRunsResponse = (data) => {
128
+ var unmarshalListJobRunsResponse = (data) => {
108
129
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListJobRunsResponse' failed as data isn't a dictionary.`);
109
130
  return {
110
131
  jobRuns: unmarshalArrayOfObject(data.job_runs, unmarshalJobRun),
111
132
  totalCount: data.total_count
112
133
  };
113
134
  };
114
- const unmarshalListSecretsResponse = (data) => {
135
+ var unmarshalListSecretsResponse = (data) => {
115
136
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListSecretsResponse' failed as data isn't a dictionary.`);
116
137
  return {
117
138
  secrets: unmarshalArrayOfObject(data.secrets, unmarshalSecret),
118
139
  totalCount: data.total_count
119
140
  };
120
141
  };
121
- const unmarshalStartJobDefinitionResponse = (data) => {
142
+ var unmarshalListTriggersResponse = (data) => {
143
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListTriggersResponse' failed as data isn't a dictionary.`);
144
+ return {
145
+ totalCount: data.total_count,
146
+ triggers: unmarshalArrayOfObject(data.triggers, unmarshalTrigger)
147
+ };
148
+ };
149
+ var unmarshalStartJobDefinitionResponse = (data) => {
122
150
  if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'StartJobDefinitionResponse' failed as data isn't a dictionary.`);
123
151
  return { jobRuns: unmarshalArrayOfObject(data.job_runs, unmarshalJobRun) };
124
152
  };
@@ -127,7 +155,7 @@ var marshalCreateJobDefinitionRequestCronScheduleConfig = (request, defaults) =>
127
155
  timezone: request.timezone
128
156
  });
129
157
  var marshalRetryPolicy = (request, defaults) => ({ max_retries: request.maxRetries });
130
- const marshalCreateJobDefinitionRequest = (request, defaults) => ({
158
+ var marshalCreateJobDefinitionRequest = (request, defaults) => ({
131
159
  args: request.args,
132
160
  command: request.command,
133
161
  cpu_limit: request.cpuLimit,
@@ -154,11 +182,25 @@ var marshalCreateSecretsRequestSecretConfig = (request, defaults) => ({
154
182
  value: request.envVarName
155
183
  }])
156
184
  });
157
- const marshalCreateSecretsRequest = (request, defaults) => ({
185
+ var marshalCreateSecretsRequest = (request, defaults) => ({
158
186
  job_definition_id: request.jobDefinitionId,
159
187
  secrets: request.secrets.map((elt) => marshalCreateSecretsRequestSecretConfig(elt, defaults))
160
188
  });
161
- const marshalStartJobDefinitionRequest = (request, defaults) => ({
189
+ var marshalCreateTriggerRequestCronConfig = (request, defaults) => ({
190
+ args: request.args,
191
+ schedule: request.schedule,
192
+ startup_command: request.startupCommand,
193
+ timezone: request.timezone
194
+ });
195
+ var marshalCreateTriggerRequest = (request, defaults) => ({
196
+ job_definition_id: request.jobDefinitionId,
197
+ name: request.name,
198
+ ...resolveOneOf([{
199
+ param: "cron_config",
200
+ value: request.cronConfig !== void 0 ? marshalCreateTriggerRequestCronConfig(request.cronConfig, defaults) : void 0
201
+ }])
202
+ });
203
+ var marshalStartJobDefinitionRequest = (request, defaults) => ({
162
204
  args: request.args,
163
205
  command: request.command,
164
206
  environment_variables: request.environmentVariables,
@@ -169,7 +211,7 @@ var marshalUpdateJobDefinitionRequestCronScheduleConfig = (request, defaults) =>
169
211
  schedule: request.schedule,
170
212
  timezone: request.timezone
171
213
  });
172
- const marshalUpdateJobDefinitionRequest = (request, defaults) => ({
214
+ var marshalUpdateJobDefinitionRequest = (request, defaults) => ({
173
215
  args: request.args,
174
216
  command: request.command,
175
217
  cpu_limit: request.cpuLimit,
@@ -184,7 +226,7 @@ const marshalUpdateJobDefinitionRequest = (request, defaults) => ({
184
226
  retry_policy: request.retryPolicy !== void 0 ? marshalRetryPolicy(request.retryPolicy, defaults) : void 0,
185
227
  startup_command: request.startupCommand
186
228
  });
187
- const marshalUpdateSecretRequest = (request, defaults) => ({
229
+ var marshalUpdateSecretRequest = (request, defaults) => ({
188
230
  secret_manager_version: request.secretManagerVersion,
189
231
  ...resolveOneOf([{
190
232
  param: "path",
@@ -194,4 +236,18 @@ const marshalUpdateSecretRequest = (request, defaults) => ({
194
236
  value: request.envVarName
195
237
  }])
196
238
  });
197
- export { marshalCreateJobDefinitionRequest, marshalCreateSecretsRequest, marshalStartJobDefinitionRequest, marshalUpdateJobDefinitionRequest, marshalUpdateSecretRequest, unmarshalCreateSecretsResponse, unmarshalJobDefinition, unmarshalJobLimits, unmarshalJobRun, unmarshalListJobDefinitionsResponse, unmarshalListJobResourcesResponse, unmarshalListJobRunsResponse, unmarshalListSecretsResponse, unmarshalSecret, unmarshalStartJobDefinitionResponse };
239
+ var marshalUpdateTriggerRequestCronConfig = (request, defaults) => ({
240
+ args: request.args,
241
+ schedule: request.schedule,
242
+ startup_command: request.startupCommand,
243
+ timezone: request.timezone
244
+ });
245
+ var marshalUpdateTriggerRequest = (request, defaults) => ({
246
+ name: request.name,
247
+ ...resolveOneOf([{
248
+ param: "cron_config",
249
+ value: request.cronConfig !== void 0 ? marshalUpdateTriggerRequestCronConfig(request.cronConfig, defaults) : void 0
250
+ }])
251
+ });
252
+ //#endregion
253
+ export { marshalCreateJobDefinitionRequest, marshalCreateSecretsRequest, marshalCreateTriggerRequest, marshalStartJobDefinitionRequest, marshalUpdateJobDefinitionRequest, marshalUpdateSecretRequest, marshalUpdateTriggerRequest, unmarshalCreateSecretsResponse, unmarshalJobDefinition, unmarshalJobLimits, unmarshalJobRun, unmarshalListJobDefinitionsResponse, unmarshalListJobResourcesResponse, unmarshalListJobRunsResponse, unmarshalListSecretsResponse, unmarshalListTriggersResponse, unmarshalSecret, unmarshalStartJobDefinitionResponse, unmarshalTrigger };
@@ -3,6 +3,7 @@ export type JobRunReason = 'unknown_reason' | 'invalid_request' | 'timeout' | 'c
3
3
  export type JobRunState = 'unknown_state' | 'initialized' | 'validated' | 'queued' | 'running' | 'succeeded' | 'failed' | 'interrupting' | 'interrupted' | 'retrying';
4
4
  export type ListJobDefinitionsRequestOrderBy = 'created_at_asc' | 'created_at_desc';
5
5
  export type ListJobRunsRequestOrderBy = 'created_at_asc' | 'created_at_desc';
6
+ export type ListTriggersRequestOrderBy = 'created_at_asc' | 'created_at_desc';
6
7
  export interface SecretEnvVar {
7
8
  name: string;
8
9
  }
@@ -25,6 +26,24 @@ export interface RetryPolicy {
25
26
  */
26
27
  maxRetries: number;
27
28
  }
29
+ export interface TriggerCronConfig {
30
+ /**
31
+ * CRON schedule in UNIX format.
32
+ */
33
+ schedule: string;
34
+ /**
35
+ * Time zone for the CRON schedule.
36
+ */
37
+ timezone: string;
38
+ /**
39
+ * Startup command that will be used by the triggered job.
40
+ */
41
+ startupCommand: string[];
42
+ /**
43
+ * Arguments passed to the startup command used by the triggered job.
44
+ */
45
+ args: string[];
46
+ }
28
47
  export interface CreateJobDefinitionRequestCronScheduleConfig {
29
48
  schedule: string;
30
49
  timezone: string;
@@ -73,26 +92,92 @@ export interface Secret {
73
92
  */
74
93
  envVar?: SecretEnvVar;
75
94
  }
95
+ export interface CreateTriggerRequestCronConfig {
96
+ /**
97
+ * CRON schedule in UNIX format.
98
+ */
99
+ schedule: string;
100
+ /**
101
+ * Time zone for the CRON schedule.
102
+ */
103
+ timezone: string;
104
+ /**
105
+ * Startup command that will be used by the triggered job.
106
+ */
107
+ startupCommand: string[];
108
+ /**
109
+ * Arguments passed to the startup command used by the triggered job.
110
+ */
111
+ args: string[];
112
+ }
76
113
  export interface JobDefinition {
114
+ /**
115
+ * UUID of the job definition.
116
+ */
77
117
  id: string;
118
+ /**
119
+ * Name of the job definition.
120
+ */
78
121
  name: string;
122
+ /**
123
+ * UUID of the Scaleway Project containing the job.
124
+ */
79
125
  projectId: string;
126
+ /**
127
+ * Creation date of the job definition.
128
+ */
80
129
  createdAt?: Date;
130
+ /**
131
+ * Last update date of the job definition.
132
+ */
81
133
  updatedAt?: Date;
134
+ /**
135
+ * CPU limit of the job (in mvCPU).
136
+ */
82
137
  cpuLimit: number;
138
+ /**
139
+ * Memory limit of the job (in MiB).
140
+ */
83
141
  memoryLimit: number;
142
+ /**
143
+ * Local storage capacity of the job (in MiB).
144
+ */
84
145
  localStorageCapacity: number;
146
+ /**
147
+ * Image to use for the job.
148
+ */
85
149
  imageUri: string;
86
150
  /**
87
- * @deprecated
151
+ * @deprecated Deprecated, please use startup_command instead.
152
+ */
153
+ command: string;
154
+ /**
155
+ * Environment variables of the job.
88
156
  */
89
- command?: string;
90
157
  environmentVariables: Record<string, string>;
158
+ /**
159
+ * Timeout of the job in seconds.
160
+ */
91
161
  jobTimeout?: string;
162
+ /**
163
+ * Description of the job.
164
+ */
92
165
  description: string;
166
+ /**
167
+ * Configure a cron for the job.
168
+ */
93
169
  cronSchedule?: CronSchedule;
170
+ /**
171
+ * Job startup command.
172
+ */
94
173
  startupCommand: string[];
174
+ /**
175
+ * Job arguments passed to the startup command at runtime.
176
+ */
95
177
  args: string[];
178
+ /**
179
+ * Retry behaviour in case of job failure.
180
+ */
96
181
  retryPolicy?: RetryPolicy;
97
182
  /**
98
183
  * Region to target. If none is passed will use default region from the config.
@@ -104,37 +189,137 @@ export interface Resource {
104
189
  memoryLimitBytes: number;
105
190
  }
106
191
  export interface JobRun {
192
+ /**
193
+ * UUID of the job run.
194
+ */
107
195
  id: string;
196
+ /**
197
+ * UUID of the job definition.
198
+ */
108
199
  jobDefinitionId: string;
200
+ /**
201
+ * Creation date of the job run.
202
+ */
109
203
  createdAt?: Date;
204
+ /**
205
+ * Last update date of the job run.
206
+ */
110
207
  updatedAt?: Date;
208
+ /**
209
+ * Start date of the job run.
210
+ */
111
211
  startedAt?: Date;
212
+ /**
213
+ * Termination date of the job run.
214
+ */
112
215
  terminatedAt?: Date;
216
+ /**
217
+ * Duration of the job run.
218
+ */
113
219
  runDuration?: string;
220
+ /**
221
+ * State of the job run.
222
+ */
114
223
  state: JobRunState;
224
+ /**
225
+ * Reason for failure if the job failed.
226
+ */
115
227
  reason?: JobRunReason;
228
+ /**
229
+ * Exit code of the job.
230
+ */
116
231
  exitCode?: number;
232
+ /**
233
+ * Error message if the job failed.
234
+ */
117
235
  errorMessage?: string;
236
+ /**
237
+ * CPU limit of the job (in mvCPU).
238
+ */
118
239
  cpuLimit: number;
240
+ /**
241
+ * Memory limit of the job (in MiB).
242
+ */
119
243
  memoryLimit: number;
244
+ /**
245
+ * Local storage capacity of the job (in MiB).
246
+ */
120
247
  localStorageCapacity: number;
121
248
  /**
122
- * @deprecated
249
+ * @deprecated Deprecated, please use startup_command instead.
250
+ */
251
+ command: string;
252
+ /**
253
+ * Environment variables of the job run.
123
254
  */
124
- command?: string;
125
255
  environmentVariables: Record<string, string>;
256
+ /**
257
+ * Job startup command.
258
+ */
126
259
  startupCommand: string[];
260
+ /**
261
+ * Job arguments passed to the startup command at runtime.
262
+ */
127
263
  args: string[];
264
+ /**
265
+ * Number of retry attempts.
266
+ */
128
267
  attempts?: number;
129
268
  /**
130
269
  * Region to target. If none is passed will use default region from the config.
131
270
  */
132
271
  region: ScwRegion;
133
272
  }
273
+ export interface Trigger {
274
+ /**
275
+ * UUID of the trigger.
276
+ */
277
+ id: string;
278
+ /**
279
+ * UUID of the job definition.
280
+ */
281
+ jobDefinitionId: string;
282
+ /**
283
+ * Human readable name of the trigger.
284
+ */
285
+ name: string;
286
+ /**
287
+ * Creation time of the trigger.
288
+ */
289
+ createdAt?: Date;
290
+ /**
291
+ * Last update time of the trigger.
292
+ */
293
+ updatedAt?: Date;
294
+ /**
295
+ * Configuration of the CRON trigger.
296
+ *
297
+ * One-of ('config'): at most one of 'cronConfig' could be set.
298
+ */
299
+ cronConfig?: TriggerCronConfig;
300
+ }
134
301
  export interface UpdateJobDefinitionRequestCronScheduleConfig {
135
302
  schedule?: string;
136
303
  timezone?: string;
137
304
  }
305
+ export interface UpdateTriggerRequestCronConfig {
306
+ /**
307
+ * CRON schedule in UNIX format.
308
+ */
309
+ schedule?: string;
310
+ /**
311
+ * Time zone for the CRON schedule.
312
+ */
313
+ timezone?: string;
314
+ /**
315
+ * Startup command that will be used by the triggered job.
316
+ */
317
+ startupCommand?: string[];
318
+ /**
319
+ * Arguments passed to the startup command used by the triggered job.
320
+ */
321
+ args?: string[];
322
+ }
138
323
  export type CreateJobDefinitionRequest = {
139
324
  /**
140
325
  * Region to target. If none is passed will use default region from the config.
@@ -163,7 +348,7 @@ export type CreateJobDefinitionRequest = {
163
348
  /**
164
349
  * @deprecated Deprecated: please use startup_command instead.
165
350
  */
166
- command?: string;
351
+ command: string;
167
352
  /**
168
353
  * The main executable or entrypoint script to run.
169
354
  If both command and startup_command are provided, only startup_command will be used.
@@ -219,6 +404,26 @@ export interface CreateSecretsResponse {
219
404
  */
220
405
  secrets: Secret[];
221
406
  }
407
+ export type CreateTriggerRequest = {
408
+ /**
409
+ * Region to target. If none is passed will use default region from the config.
410
+ */
411
+ region?: ScwRegion;
412
+ /**
413
+ * UUID of the job definition.
414
+ */
415
+ jobDefinitionId: string;
416
+ /**
417
+ * Name of the trigger.
418
+ */
419
+ name: string;
420
+ /**
421
+ * Configuration of the CRON trigger.
422
+ *
423
+ * One-of ('config'): at most one of 'cronConfig' could be set.
424
+ */
425
+ cronConfig?: CreateTriggerRequestCronConfig;
426
+ };
222
427
  export type DeleteJobDefinitionRequest = {
223
428
  /**
224
429
  * Region to target. If none is passed will use default region from the config.
@@ -239,6 +444,16 @@ export type DeleteSecretRequest = {
239
444
  */
240
445
  secretId: string;
241
446
  };
447
+ export type DeleteTriggerRequest = {
448
+ /**
449
+ * Region to target. If none is passed will use default region from the config.
450
+ */
451
+ region?: ScwRegion;
452
+ /**
453
+ * UUID of the trigger.
454
+ */
455
+ triggerId: string;
456
+ };
242
457
  export type GetJobDefinitionRequest = {
243
458
  /**
244
459
  * Region to target. If none is passed will use default region from the config.
@@ -275,6 +490,16 @@ export type GetSecretRequest = {
275
490
  */
276
491
  secretId: string;
277
492
  };
493
+ export type GetTriggerRequest = {
494
+ /**
495
+ * Region to target. If none is passed will use default region from the config.
496
+ */
497
+ region?: ScwRegion;
498
+ /**
499
+ * UUID of the trigger.
500
+ */
501
+ triggerId: string;
502
+ };
278
503
  export interface JobLimits {
279
504
  secretsPerJobDefinition: number;
280
505
  }
@@ -341,6 +566,38 @@ export interface ListSecretsResponse {
341
566
  */
342
567
  totalCount: number;
343
568
  }
569
+ export type ListTriggersRequest = {
570
+ /**
571
+ * Region to target. If none is passed will use default region from the config.
572
+ */
573
+ region?: ScwRegion;
574
+ /**
575
+ * UUID of the job definition.
576
+ */
577
+ jobDefinitionId: string;
578
+ /**
579
+ * Page number from paginated list of triggers.
580
+ */
581
+ page?: number;
582
+ /**
583
+ * Number of triggers per page.
584
+ */
585
+ pageSize?: number;
586
+ /**
587
+ * Sorting order of triggers.
588
+ */
589
+ orderBy?: ListTriggersRequestOrderBy;
590
+ };
591
+ export interface ListTriggersResponse {
592
+ /**
593
+ * List of triggers.
594
+ */
595
+ triggers: Trigger[];
596
+ /**
597
+ * Total count of triggers.
598
+ */
599
+ totalCount: number;
600
+ }
344
601
  export type StartJobDefinitionRequest = {
345
602
  /**
346
603
  * Region to target. If none is passed will use default region from the config.
@@ -482,3 +739,23 @@ export type UpdateSecretRequest = {
482
739
  */
483
740
  envVarName?: string;
484
741
  };
742
+ export type UpdateTriggerRequest = {
743
+ /**
744
+ * Region to target. If none is passed will use default region from the config.
745
+ */
746
+ region?: ScwRegion;
747
+ /**
748
+ * UUID of the trigger.
749
+ */
750
+ triggerId: string;
751
+ /**
752
+ * Name of the trigger.
753
+ */
754
+ name?: string;
755
+ /**
756
+ * Configuration of the CRON trigger.
757
+ *
758
+ * One-of ('config'): at most one of 'cronConfig' could be set.
759
+ */
760
+ cronConfig?: UpdateTriggerRequestCronConfig;
761
+ };
File without changes
@@ -33,6 +33,23 @@ export declare const CreateSecretsRequestSecretConfig: {
33
33
  minLength: number;
34
34
  };
35
35
  };
36
+ export declare const CreateTriggerRequest: {
37
+ name: {
38
+ maxLength: number;
39
+ minLength: number;
40
+ pattern: RegExp;
41
+ };
42
+ };
43
+ export declare const CreateTriggerRequestCronConfig: {
44
+ schedule: {
45
+ maxLength: number;
46
+ minLength: number;
47
+ };
48
+ timezone: {
49
+ maxLength: number;
50
+ minLength: number;
51
+ };
52
+ };
36
53
  export declare const CronSchedule: {
37
54
  schedule: {
38
55
  maxLength: number;
@@ -61,6 +78,15 @@ export declare const ListJobRunsRequest: {
61
78
  lessThanOrEqual: number;
62
79
  };
63
80
  };
81
+ export declare const ListTriggersRequest: {
82
+ page: {
83
+ greaterThanOrEqual: number;
84
+ };
85
+ pageSize: {
86
+ greaterThanOrEqual: number;
87
+ lessThanOrEqual: number;
88
+ };
89
+ };
64
90
  export declare const RetryPolicy: {
65
91
  maxRetries: {
66
92
  lessThanOrEqual: number;
@@ -106,3 +132,20 @@ export declare const UpdateSecretRequest: {
106
132
  minLength: number;
107
133
  };
108
134
  };
135
+ export declare const UpdateTriggerRequest: {
136
+ name: {
137
+ maxLength: number;
138
+ minLength: number;
139
+ pattern: RegExp;
140
+ };
141
+ };
142
+ export declare const UpdateTriggerRequestCronConfig: {
143
+ schedule: {
144
+ maxLength: number;
145
+ minLength: number;
146
+ };
147
+ timezone: {
148
+ maxLength: number;
149
+ minLength: number;
150
+ };
151
+ };
@@ -1,18 +1,24 @@
1
1
  import { __exportAll } from "../_virtual/_rolldown/runtime.js";
2
+ //#region src/v1alpha2/validation-rules.gen.ts
2
3
  var validation_rules_gen_exports = /* @__PURE__ */ __exportAll({
3
4
  CreateJobDefinitionRequest: () => CreateJobDefinitionRequest,
4
5
  CreateJobDefinitionRequestCronScheduleConfig: () => CreateJobDefinitionRequestCronScheduleConfig,
5
6
  CreateSecretsRequestSecretConfig: () => CreateSecretsRequestSecretConfig,
7
+ CreateTriggerRequest: () => CreateTriggerRequest,
8
+ CreateTriggerRequestCronConfig: () => CreateTriggerRequestCronConfig,
6
9
  CronSchedule: () => CronSchedule,
7
10
  ListJobDefinitionsRequest: () => ListJobDefinitionsRequest,
8
11
  ListJobRunsRequest: () => ListJobRunsRequest,
12
+ ListTriggersRequest: () => ListTriggersRequest,
9
13
  RetryPolicy: () => RetryPolicy,
10
14
  StartJobDefinitionRequest: () => StartJobDefinitionRequest,
11
15
  UpdateJobDefinitionRequest: () => UpdateJobDefinitionRequest,
12
16
  UpdateJobDefinitionRequestCronScheduleConfig: () => UpdateJobDefinitionRequestCronScheduleConfig,
13
- UpdateSecretRequest: () => UpdateSecretRequest
17
+ UpdateSecretRequest: () => UpdateSecretRequest,
18
+ UpdateTriggerRequest: () => UpdateTriggerRequest,
19
+ UpdateTriggerRequestCronConfig: () => UpdateTriggerRequestCronConfig
14
20
  });
15
- const CreateJobDefinitionRequest = {
21
+ var CreateJobDefinitionRequest = {
16
22
  cpuLimit: { greaterThan: 0 },
17
23
  description: { maxLength: 255 },
18
24
  imageUri: { pattern: /^((?:(?:(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])(?:\.(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]))*|\[(?:[a-fA-F0-9:]+)\])(?::[0-9]+)?\/)?[a-z0-9]+(?:(?:[._]|__|[-]+)[a-z0-9]+)*(?:\/[a-z0-9]+(?:(?:[._]|__|[-]+)[a-z0-9]+)*)*)(?::(\w[A-Za-z0-9_.-]{0,127}))?(?:@([A-Za-z][A-Za-z0-9]*(?:[-_+.][A-Za-z][A-Za-z0-9]*)*[:][[:xdigit:]]{32,}))?$/ },
@@ -20,7 +26,7 @@ const CreateJobDefinitionRequest = {
20
26
  memoryLimit: { greaterThan: 0 },
21
27
  name: { pattern: /^[A-Za-z0-9-_]{3,50}$/ }
22
28
  };
23
- const CreateJobDefinitionRequestCronScheduleConfig = {
29
+ var CreateJobDefinitionRequestCronScheduleConfig = {
24
30
  schedule: {
25
31
  maxLength: 255,
26
32
  minLength: 1
@@ -30,8 +36,13 @@ const CreateJobDefinitionRequestCronScheduleConfig = {
30
36
  minLength: 1
31
37
  }
32
38
  };
33
- const CreateSecretsRequestSecretConfig = { secretManagerVersion: { minLength: 1 } };
34
- const CronSchedule = {
39
+ var CreateSecretsRequestSecretConfig = { secretManagerVersion: { minLength: 1 } };
40
+ var CreateTriggerRequest = { name: {
41
+ maxLength: 50,
42
+ minLength: 1,
43
+ pattern: /^[A-Za-z0-9-_]*$/
44
+ } };
45
+ var CreateTriggerRequestCronConfig = {
35
46
  schedule: {
36
47
  maxLength: 255,
37
48
  minLength: 1
@@ -41,23 +52,40 @@ const CronSchedule = {
41
52
  minLength: 1
42
53
  }
43
54
  };
44
- const ListJobDefinitionsRequest = {
55
+ var CronSchedule = {
56
+ schedule: {
57
+ maxLength: 255,
58
+ minLength: 1
59
+ },
60
+ timezone: {
61
+ maxLength: 255,
62
+ minLength: 1
63
+ }
64
+ };
65
+ var ListJobDefinitionsRequest = {
66
+ page: { greaterThanOrEqual: 1 },
67
+ pageSize: {
68
+ greaterThanOrEqual: 1,
69
+ lessThanOrEqual: 1e3
70
+ }
71
+ };
72
+ var ListJobRunsRequest = {
45
73
  page: { greaterThanOrEqual: 1 },
46
74
  pageSize: {
47
75
  greaterThanOrEqual: 1,
48
76
  lessThanOrEqual: 1e3
49
77
  }
50
78
  };
51
- const ListJobRunsRequest = {
79
+ var ListTriggersRequest = {
52
80
  page: { greaterThanOrEqual: 1 },
53
81
  pageSize: {
54
82
  greaterThanOrEqual: 1,
55
83
  lessThanOrEqual: 1e3
56
84
  }
57
85
  };
58
- const RetryPolicy = { maxRetries: { lessThanOrEqual: 5 } };
59
- const StartJobDefinitionRequest = { replicas: { greaterThan: 0 } };
60
- const UpdateJobDefinitionRequest = {
86
+ var RetryPolicy = { maxRetries: { lessThanOrEqual: 5 } };
87
+ var StartJobDefinitionRequest = { replicas: { greaterThan: 0 } };
88
+ var UpdateJobDefinitionRequest = {
61
89
  cpuLimit: { greaterThan: 0 },
62
90
  description: { maxLength: 255 },
63
91
  imageUri: { pattern: /^((?:(?:(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])(?:\.(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]))*|\[(?:[a-fA-F0-9:]+)\])(?::[0-9]+)?\/)?[a-z0-9]+(?:(?:[._]|__|[-]+)[a-z0-9]+)*(?:\/[a-z0-9]+(?:(?:[._]|__|[-]+)[a-z0-9]+)*)*)(?::(\w[A-Za-z0-9_.-]{0,127}))?(?:@([A-Za-z][A-Za-z0-9]*(?:[-_+.][A-Za-z][A-Za-z0-9]*)*[:][[:xdigit:]]{32,}))?$/ },
@@ -65,7 +93,23 @@ const UpdateJobDefinitionRequest = {
65
93
  memoryLimit: { greaterThan: 0 },
66
94
  name: { pattern: /^[A-Za-z0-9-_]{3,50}$/ }
67
95
  };
68
- const UpdateJobDefinitionRequestCronScheduleConfig = {
96
+ var UpdateJobDefinitionRequestCronScheduleConfig = {
97
+ schedule: {
98
+ maxLength: 255,
99
+ minLength: 1
100
+ },
101
+ timezone: {
102
+ maxLength: 255,
103
+ minLength: 1
104
+ }
105
+ };
106
+ var UpdateSecretRequest = { secretManagerVersion: { minLength: 1 } };
107
+ var UpdateTriggerRequest = { name: {
108
+ maxLength: 50,
109
+ minLength: 1,
110
+ pattern: /^[A-Za-z0-9-_]*$/
111
+ } };
112
+ var UpdateTriggerRequestCronConfig = {
69
113
  schedule: {
70
114
  maxLength: 255,
71
115
  minLength: 1
@@ -75,5 +119,5 @@ const UpdateJobDefinitionRequestCronScheduleConfig = {
75
119
  minLength: 1
76
120
  }
77
121
  };
78
- const UpdateSecretRequest = { secretManagerVersion: { minLength: 1 } };
79
- export { validation_rules_gen_exports };
122
+ //#endregion
123
+ export { CreateJobDefinitionRequest, CreateJobDefinitionRequestCronScheduleConfig, CreateSecretsRequestSecretConfig, CreateTriggerRequest, CreateTriggerRequestCronConfig, CronSchedule, ListJobDefinitionsRequest, ListJobRunsRequest, ListTriggersRequest, RetryPolicy, StartJobDefinitionRequest, UpdateJobDefinitionRequest, UpdateJobDefinitionRequestCronScheduleConfig, UpdateSecretRequest, UpdateTriggerRequest, UpdateTriggerRequestCronConfig, validation_rules_gen_exports };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scaleway/sdk-jobs",
3
- "version": "2.3.1",
3
+ "version": "2.4.1",
4
4
  "description": "Scaleway SDK jobs",
5
5
  "license": "Apache-2.0",
6
6
  "files": [
@@ -26,14 +26,14 @@
26
26
  "node": ">=20.19.6"
27
27
  },
28
28
  "dependencies": {
29
- "@scaleway/random-name": "5.1.2",
30
- "@scaleway/sdk-std": "2.2.1"
29
+ "@scaleway/random-name": "5.1.4",
30
+ "@scaleway/sdk-std": "2.2.2"
31
31
  },
32
32
  "peerDependencies": {
33
- "@scaleway/sdk-client": "^2.2.1"
33
+ "@scaleway/sdk-client": "^2.2.2"
34
34
  },
35
35
  "devDependencies": {
36
- "@scaleway/sdk-client": "^2.2.1"
36
+ "@scaleway/sdk-client": "^2.2.2"
37
37
  },
38
38
  "scripts": {
39
39
  "package:check": "pnpm publint",