@scaleway/sdk-mongodb 2.4.0 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/_rolldown/runtime.js +2 -0
- package/dist/v1/api.gen.js +5 -3
- package/dist/v1/content.gen.js +5 -3
- package/dist/v1/index.gen.d.ts +1 -1
- package/dist/v1/index.gen.js +8 -3
- package/dist/v1/marshalling.gen.d.ts +4 -1
- package/dist/v1/marshalling.gen.js +33 -23
- package/dist/v1/types.gen.d.ts +8 -0
- package/dist/v1/types.gen.js +0 -0
- package/dist/v1/validation-rules.gen.js +20 -18
- package/dist/v1alpha1/api.gen.js +5 -3
- package/dist/v1alpha1/content.gen.js +4 -2
- package/dist/v1alpha1/index.gen.js +5 -5
- package/dist/v1alpha1/marshalling.gen.d.ts +1 -3
- package/dist/v1alpha1/marshalling.gen.js +24 -22
- package/dist/v1alpha1/types.gen.js +0 -0
- package/dist/v1alpha1/validation-rules.gen.js +17 -15
- package/package.json +5 -5
|
@@ -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 };
|
package/dist/v1/api.gen.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { INSTANCE_TRANSIENT_STATUSES, MAINTENANCE_TRANSIENT_STATUSES, SNAPSHOT_TRANSIENT_STATUSES } from "./content.gen.js";
|
|
2
2
|
import { marshalCreateEndpointRequest, marshalCreateInstanceRequest, marshalCreateSnapshotRequest, marshalCreateUserRequest, marshalRestoreSnapshotRequest, marshalSetUserRoleRequest, marshalUpdateInstanceRequest, marshalUpdateSnapshotRequest, marshalUpdateUserRequest, marshalUpgradeInstanceRequest, unmarshalEndpoint, unmarshalInstance, unmarshalListDatabasesResponse, unmarshalListInstancesResponse, unmarshalListMaintenancesResponse, unmarshalListNodeTypesResponse, unmarshalListSnapshotsResponse, unmarshalListUsersResponse, unmarshalListVersionsResponse, unmarshalMaintenance, unmarshalSnapshot, unmarshalUser } from "./marshalling.gen.js";
|
|
3
|
-
import { API, enrichForPagination, toApiLocality, urlParams, validatePathParam, waitForResource } from "@scaleway/sdk-client";
|
|
3
|
+
import { API as API$1, enrichForPagination, toApiLocality, urlParams, validatePathParam, waitForResource } from "@scaleway/sdk-client";
|
|
4
|
+
//#region src/v1/api.gen.ts
|
|
4
5
|
var jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
|
|
5
6
|
/**
|
|
6
7
|
* Managed MongoDB®.
|
|
7
8
|
|
|
8
9
|
This API allows you to manage your Managed Databases for MongoDB®.
|
|
9
10
|
*/
|
|
10
|
-
var API
|
|
11
|
+
var API = class extends API$1 {
|
|
11
12
|
/**
|
|
12
13
|
* Locality of this API.
|
|
13
14
|
* type ∈ {'zone','region','global','unspecified'}
|
|
@@ -334,4 +335,5 @@ var API$1 = class extends API {
|
|
|
334
335
|
path: `/mongodb/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/maintenances/${validatePathParam("maintenanceId", request.maintenanceId)}/apply`
|
|
335
336
|
}, unmarshalMaintenance);
|
|
336
337
|
};
|
|
337
|
-
|
|
338
|
+
//#endregion
|
|
339
|
+
export { API };
|
package/dist/v1/content.gen.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
//#region src/v1/content.gen.ts
|
|
1
2
|
/** Lists transient statutes of the enum {@link InstanceStatus}. */
|
|
2
|
-
|
|
3
|
+
var INSTANCE_TRANSIENT_STATUSES = [
|
|
3
4
|
"provisioning",
|
|
4
5
|
"configuring",
|
|
5
6
|
"deleting",
|
|
@@ -7,11 +8,12 @@ const INSTANCE_TRANSIENT_STATUSES = [
|
|
|
7
8
|
"snapshotting"
|
|
8
9
|
];
|
|
9
10
|
/** Lists transient statutes of the enum {@link MaintenanceStatus}. */
|
|
10
|
-
|
|
11
|
+
var MAINTENANCE_TRANSIENT_STATUSES = ["ongoing"];
|
|
11
12
|
/** Lists transient statutes of the enum {@link SnapshotStatus}. */
|
|
12
|
-
|
|
13
|
+
var SNAPSHOT_TRANSIENT_STATUSES = [
|
|
13
14
|
"creating",
|
|
14
15
|
"restoring",
|
|
15
16
|
"deleting"
|
|
16
17
|
];
|
|
18
|
+
//#endregion
|
|
17
19
|
export { INSTANCE_TRANSIENT_STATUSES, MAINTENANCE_TRANSIENT_STATUSES, SNAPSHOT_TRANSIENT_STATUSES };
|
package/dist/v1/index.gen.d.ts
CHANGED
|
@@ -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 { ApplyMaintenanceRequest, CreateEndpointRequest, CreateInstanceRequest, CreateSnapshotRequest, CreateUserRequest, Database, DeleteEndpointRequest, DeleteInstanceRequest, DeleteSnapshotRequest, DeleteUserRequest, Endpoint, EndpointPrivateNetworkDetails, EndpointPublicNetworkDetails, EndpointSpec, EndpointSpecPrivateNetworkDetails, EndpointSpecPublicNetworkDetails, EngineUpgrade, GetInstanceCertificateRequest, GetInstanceRequest, GetMaintenanceRequest, GetSnapshotRequest, Instance, InstanceSnapshotSchedule, InstanceStatus, ListDatabasesRequest, ListDatabasesRequestOrderBy, ListDatabasesResponse, ListInstancesRequest, ListInstancesRequestOrderBy, ListInstancesResponse, ListMaintenancesRequest, ListMaintenancesRequestOrderBy, ListMaintenancesResponse, ListNodeTypesRequest, ListNodeTypesResponse, ListSnapshotsRequest, ListSnapshotsRequestOrderBy, ListSnapshotsResponse, ListUsersRequest, ListUsersRequestOrderBy, ListUsersResponse, ListVersionsRequest, ListVersionsResponse, Maintenance, MaintenanceAppliedBy, MaintenanceStatus, NodeType, NodeTypeStock, NodeTypeVolumeType, RestoreSnapshotRequest, ServiceUpdate, SetUserRoleRequest, Snapshot, SnapshotStatus, UpdateInstanceRequest, UpdateSnapshotRequest, UpdateUserRequest, UpgradeInstanceRequest, User, UserRole, UserRoleRole, Version, Volume, VolumeType, Workflow, } from './types.gen.js';
|
|
4
|
+
export type { ApplyMaintenanceRequest, CreateEndpointRequest, CreateInstanceRequest, CreateSnapshotRequest, CreateUserRequest, Database, DeleteEndpointRequest, DeleteInstanceRequest, DeleteSnapshotRequest, DeleteUserRequest, Endpoint, EndpointPrivateNetworkDetails, EndpointPublicNetworkDetails, EndpointSpec, EndpointSpecPrivateNetworkDetails, EndpointSpecPublicNetworkDetails, EngineUpgrade, GetInstanceCertificateRequest, GetInstanceRequest, GetMaintenanceRequest, GetSnapshotRequest, Instance, InstanceSetting, InstanceSnapshotSchedule, InstanceStatus, ListDatabasesRequest, ListDatabasesRequestOrderBy, ListDatabasesResponse, ListInstancesRequest, ListInstancesRequestOrderBy, ListInstancesResponse, ListMaintenancesRequest, ListMaintenancesRequestOrderBy, ListMaintenancesResponse, ListNodeTypesRequest, ListNodeTypesResponse, ListSnapshotsRequest, ListSnapshotsRequestOrderBy, ListSnapshotsResponse, ListUsersRequest, ListUsersRequestOrderBy, ListUsersResponse, ListVersionsRequest, ListVersionsResponse, Maintenance, MaintenanceAppliedBy, MaintenanceStatus, NodeType, NodeTypeStock, NodeTypeVolumeType, RestoreSnapshotRequest, ServiceUpdate, SetUserRoleRequest, Snapshot, SnapshotStatus, UpdateInstanceRequest, UpdateSnapshotRequest, UpdateUserRequest, UpgradeInstanceRequest, User, UserRole, UserRoleRole, Version, Volume, VolumeType, Workflow, } from './types.gen.js';
|
|
5
5
|
export * as ValidationRules from './validation-rules.gen.js';
|
package/dist/v1/index.gen.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { INSTANCE_TRANSIENT_STATUSES, MAINTENANCE_TRANSIENT_STATUSES, SNAPSHOT_TRANSIENT_STATUSES } from "./content.gen.js";
|
|
3
|
-
import { marshalCreateEndpointRequest, marshalCreateInstanceRequest, marshalCreateSnapshotRequest, marshalCreateUserRequest, marshalRestoreSnapshotRequest, marshalSetUserRoleRequest, marshalUpdateInstanceRequest, marshalUpdateSnapshotRequest, marshalUpdateUserRequest, marshalUpgradeInstanceRequest, unmarshalEndpoint, unmarshalInstance, unmarshalListDatabasesResponse, unmarshalListInstancesResponse, unmarshalListMaintenancesResponse, unmarshalListNodeTypesResponse, unmarshalListSnapshotsResponse, unmarshalListUsersResponse, unmarshalListVersionsResponse, unmarshalMaintenance, unmarshalSnapshot, unmarshalUser } from "./marshalling.gen.js";
|
|
3
|
+
import { marshalCreateEndpointRequest, marshalCreateInstanceRequest, marshalCreateSnapshotRequest, marshalCreateUserRequest, marshalRestoreSnapshotRequest, marshalSetUserRoleRequest, marshalUpdateInstanceRequest, marshalUpdateSnapshotRequest, marshalUpdateUserRequest, marshalUpgradeInstanceRequest, marshalVolume, unmarshalEndpoint, unmarshalInstance, unmarshalInstanceSetting, unmarshalListDatabasesResponse, unmarshalListInstancesResponse, unmarshalListMaintenancesResponse, unmarshalListNodeTypesResponse, unmarshalListSnapshotsResponse, unmarshalListUsersResponse, unmarshalListVersionsResponse, unmarshalMaintenance, unmarshalSnapshot, unmarshalUser, unmarshalVolume } from "./marshalling.gen.js";
|
|
4
4
|
import { API } from "./api.gen.js";
|
|
5
5
|
import { validation_rules_gen_exports } from "./validation-rules.gen.js";
|
|
6
|
+
//#region src/v1/index.gen.ts
|
|
6
7
|
var index_gen_exports = /* @__PURE__ */ __exportAll({
|
|
7
8
|
API: () => API,
|
|
8
9
|
INSTANCE_TRANSIENT_STATUSES: () => INSTANCE_TRANSIENT_STATUSES,
|
|
@@ -19,8 +20,10 @@ var index_gen_exports = /* @__PURE__ */ __exportAll({
|
|
|
19
20
|
marshalUpdateSnapshotRequest: () => marshalUpdateSnapshotRequest,
|
|
20
21
|
marshalUpdateUserRequest: () => marshalUpdateUserRequest,
|
|
21
22
|
marshalUpgradeInstanceRequest: () => marshalUpgradeInstanceRequest,
|
|
23
|
+
marshalVolume: () => marshalVolume,
|
|
22
24
|
unmarshalEndpoint: () => unmarshalEndpoint,
|
|
23
25
|
unmarshalInstance: () => unmarshalInstance,
|
|
26
|
+
unmarshalInstanceSetting: () => unmarshalInstanceSetting,
|
|
24
27
|
unmarshalListDatabasesResponse: () => unmarshalListDatabasesResponse,
|
|
25
28
|
unmarshalListInstancesResponse: () => unmarshalListInstancesResponse,
|
|
26
29
|
unmarshalListMaintenancesResponse: () => unmarshalListMaintenancesResponse,
|
|
@@ -30,6 +33,8 @@ var index_gen_exports = /* @__PURE__ */ __exportAll({
|
|
|
30
33
|
unmarshalListVersionsResponse: () => unmarshalListVersionsResponse,
|
|
31
34
|
unmarshalMaintenance: () => unmarshalMaintenance,
|
|
32
35
|
unmarshalSnapshot: () => unmarshalSnapshot,
|
|
33
|
-
unmarshalUser: () => unmarshalUser
|
|
36
|
+
unmarshalUser: () => unmarshalUser,
|
|
37
|
+
unmarshalVolume: () => unmarshalVolume
|
|
34
38
|
});
|
|
35
|
-
|
|
39
|
+
//#endregion
|
|
40
|
+
export { API, INSTANCE_TRANSIENT_STATUSES, MAINTENANCE_TRANSIENT_STATUSES, SNAPSHOT_TRANSIENT_STATUSES, validation_rules_gen_exports as ValidationRules, index_gen_exports, marshalCreateEndpointRequest, marshalCreateInstanceRequest, marshalCreateSnapshotRequest, marshalCreateUserRequest, marshalRestoreSnapshotRequest, marshalSetUserRoleRequest, marshalUpdateInstanceRequest, marshalUpdateSnapshotRequest, marshalUpdateUserRequest, marshalUpgradeInstanceRequest, marshalVolume, unmarshalEndpoint, unmarshalInstance, unmarshalInstanceSetting, unmarshalListDatabasesResponse, unmarshalListInstancesResponse, unmarshalListMaintenancesResponse, unmarshalListNodeTypesResponse, unmarshalListSnapshotsResponse, unmarshalListUsersResponse, unmarshalListVersionsResponse, unmarshalMaintenance, unmarshalSnapshot, unmarshalUser, unmarshalVolume };
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { DefaultValues } from '@scaleway/sdk-client';
|
|
2
|
-
import type { CreateEndpointRequest, CreateInstanceRequest, CreateSnapshotRequest, CreateUserRequest, Endpoint, Instance, ListDatabasesResponse, ListInstancesResponse, ListMaintenancesResponse, ListNodeTypesResponse, ListSnapshotsResponse, ListUsersResponse, ListVersionsResponse, Maintenance, RestoreSnapshotRequest, SetUserRoleRequest, Snapshot, UpdateInstanceRequest, UpdateSnapshotRequest, UpdateUserRequest, UpgradeInstanceRequest, User } from './types.gen.js';
|
|
2
|
+
import type { CreateEndpointRequest, CreateInstanceRequest, CreateSnapshotRequest, CreateUserRequest, Endpoint, Instance, InstanceSetting, ListDatabasesResponse, ListInstancesResponse, ListMaintenancesResponse, ListNodeTypesResponse, ListSnapshotsResponse, ListUsersResponse, ListVersionsResponse, Maintenance, RestoreSnapshotRequest, SetUserRoleRequest, Snapshot, UpdateInstanceRequest, UpdateSnapshotRequest, UpdateUserRequest, UpgradeInstanceRequest, User, Volume } from './types.gen.js';
|
|
3
3
|
export declare const unmarshalEndpoint: (data: unknown) => Endpoint;
|
|
4
|
+
export declare const unmarshalInstanceSetting: (data: unknown) => InstanceSetting;
|
|
5
|
+
export declare const unmarshalVolume: (data: unknown) => Volume;
|
|
4
6
|
export declare const unmarshalInstance: (data: unknown) => Instance;
|
|
5
7
|
export declare const unmarshalMaintenance: (data: unknown) => Maintenance;
|
|
6
8
|
export declare const unmarshalSnapshot: (data: unknown) => Snapshot;
|
|
@@ -13,6 +15,7 @@ export declare const unmarshalListSnapshotsResponse: (data: unknown) => ListSnap
|
|
|
13
15
|
export declare const unmarshalListUsersResponse: (data: unknown) => ListUsersResponse;
|
|
14
16
|
export declare const unmarshalListVersionsResponse: (data: unknown) => ListVersionsResponse;
|
|
15
17
|
export declare const marshalCreateEndpointRequest: (request: CreateEndpointRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
18
|
+
export declare const marshalVolume: (request: Volume, defaults: DefaultValues) => Record<string, unknown>;
|
|
16
19
|
export declare const marshalCreateInstanceRequest: (request: CreateInstanceRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
17
20
|
export declare const marshalCreateSnapshotRequest: (request: CreateSnapshotRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
18
21
|
export declare const marshalCreateUserRequest: (request: CreateUserRequest, 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/v1/marshalling.gen.ts
|
|
3
4
|
var unmarshalEndpointPrivateNetworkDetails = (data) => {
|
|
4
5
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'EndpointPrivateNetworkDetails' failed as data isn't a dictionary.`);
|
|
5
6
|
return { privateNetworkId: data.private_network_id };
|
|
@@ -8,7 +9,7 @@ var unmarshalEndpointPublicNetworkDetails = (data) => {
|
|
|
8
9
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'EndpointPublicNetworkDetails' failed as data isn't a dictionary.`);
|
|
9
10
|
return {};
|
|
10
11
|
};
|
|
11
|
-
|
|
12
|
+
var unmarshalEndpoint = (data) => {
|
|
12
13
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Endpoint' failed as data isn't a dictionary.`);
|
|
13
14
|
return {
|
|
14
15
|
dnsRecord: data.dns_record,
|
|
@@ -18,6 +19,13 @@ const unmarshalEndpoint = (data) => {
|
|
|
18
19
|
publicNetwork: data.public_network ? unmarshalEndpointPublicNetworkDetails(data.public_network) : void 0
|
|
19
20
|
};
|
|
20
21
|
};
|
|
22
|
+
var unmarshalInstanceSetting = (data) => {
|
|
23
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'InstanceSetting' failed as data isn't a dictionary.`);
|
|
24
|
+
return {
|
|
25
|
+
name: data.name,
|
|
26
|
+
value: data.value
|
|
27
|
+
};
|
|
28
|
+
};
|
|
21
29
|
var unmarshalInstanceSnapshotSchedule = (data) => {
|
|
22
30
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'InstanceSnapshotSchedule' failed as data isn't a dictionary.`);
|
|
23
31
|
return {
|
|
@@ -35,7 +43,7 @@ var unmarshalVolume = (data) => {
|
|
|
35
43
|
type: data.type
|
|
36
44
|
};
|
|
37
45
|
};
|
|
38
|
-
|
|
46
|
+
var unmarshalInstance = (data) => {
|
|
39
47
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Instance' failed as data isn't a dictionary.`);
|
|
40
48
|
return {
|
|
41
49
|
createdAt: unmarshalDate(data.created_at),
|
|
@@ -47,6 +55,7 @@ const unmarshalInstance = (data) => {
|
|
|
47
55
|
organizationId: data.organization_id,
|
|
48
56
|
projectId: data.project_id,
|
|
49
57
|
region: data.region,
|
|
58
|
+
settings: unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting),
|
|
50
59
|
snapshotSchedule: data.snapshot_schedule ? unmarshalInstanceSnapshotSchedule(data.snapshot_schedule) : void 0,
|
|
51
60
|
status: data.status,
|
|
52
61
|
tags: data.tags,
|
|
@@ -69,7 +78,7 @@ var unmarshalWorkflow = (data) => {
|
|
|
69
78
|
serviceUpdate: data.service_update ? unmarshalServiceUpdate(data.service_update) : void 0
|
|
70
79
|
};
|
|
71
80
|
};
|
|
72
|
-
|
|
81
|
+
var unmarshalMaintenance = (data) => {
|
|
73
82
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Maintenance' failed as data isn't a dictionary.`);
|
|
74
83
|
return {
|
|
75
84
|
appliedAt: unmarshalDate(data.applied_at),
|
|
@@ -85,7 +94,7 @@ const unmarshalMaintenance = (data) => {
|
|
|
85
94
|
workflow: data.workflow ? unmarshalWorkflow(data.workflow) : void 0
|
|
86
95
|
};
|
|
87
96
|
};
|
|
88
|
-
|
|
97
|
+
var unmarshalSnapshot = (data) => {
|
|
89
98
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Snapshot' failed as data isn't a dictionary.`);
|
|
90
99
|
return {
|
|
91
100
|
createdAt: unmarshalDate(data.created_at),
|
|
@@ -110,7 +119,7 @@ var unmarshalUserRole = (data) => {
|
|
|
110
119
|
role: data.role
|
|
111
120
|
};
|
|
112
121
|
};
|
|
113
|
-
|
|
122
|
+
var unmarshalUser = (data) => {
|
|
114
123
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'User' failed as data isn't a dictionary.`);
|
|
115
124
|
return {
|
|
116
125
|
name: data.name,
|
|
@@ -121,21 +130,21 @@ var unmarshalDatabase = (data) => {
|
|
|
121
130
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Database' failed as data isn't a dictionary.`);
|
|
122
131
|
return { name: data.name };
|
|
123
132
|
};
|
|
124
|
-
|
|
133
|
+
var unmarshalListDatabasesResponse = (data) => {
|
|
125
134
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListDatabasesResponse' failed as data isn't a dictionary.`);
|
|
126
135
|
return {
|
|
127
136
|
databases: unmarshalArrayOfObject(data.databases, unmarshalDatabase),
|
|
128
137
|
totalCount: data.total_count
|
|
129
138
|
};
|
|
130
139
|
};
|
|
131
|
-
|
|
140
|
+
var unmarshalListInstancesResponse = (data) => {
|
|
132
141
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListInstancesResponse' failed as data isn't a dictionary.`);
|
|
133
142
|
return {
|
|
134
143
|
instances: unmarshalArrayOfObject(data.instances, unmarshalInstance),
|
|
135
144
|
totalCount: data.total_count
|
|
136
145
|
};
|
|
137
146
|
};
|
|
138
|
-
|
|
147
|
+
var unmarshalListMaintenancesResponse = (data) => {
|
|
139
148
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListMaintenancesResponse' failed as data isn't a dictionary.`);
|
|
140
149
|
return {
|
|
141
150
|
maintenances: unmarshalArrayOfObject(data.maintenances, unmarshalMaintenance),
|
|
@@ -166,21 +175,21 @@ var unmarshalNodeType = (data) => {
|
|
|
166
175
|
vcpus: data.vcpus
|
|
167
176
|
};
|
|
168
177
|
};
|
|
169
|
-
|
|
178
|
+
var unmarshalListNodeTypesResponse = (data) => {
|
|
170
179
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListNodeTypesResponse' failed as data isn't a dictionary.`);
|
|
171
180
|
return {
|
|
172
181
|
nodeTypes: unmarshalArrayOfObject(data.node_types, unmarshalNodeType),
|
|
173
182
|
totalCount: data.total_count
|
|
174
183
|
};
|
|
175
184
|
};
|
|
176
|
-
|
|
185
|
+
var unmarshalListSnapshotsResponse = (data) => {
|
|
177
186
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListSnapshotsResponse' failed as data isn't a dictionary.`);
|
|
178
187
|
return {
|
|
179
188
|
snapshots: unmarshalArrayOfObject(data.snapshots, unmarshalSnapshot),
|
|
180
189
|
totalCount: data.total_count
|
|
181
190
|
};
|
|
182
191
|
};
|
|
183
|
-
|
|
192
|
+
var unmarshalListUsersResponse = (data) => {
|
|
184
193
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListUsersResponse' failed as data isn't a dictionary.`);
|
|
185
194
|
return {
|
|
186
195
|
totalCount: data.total_count,
|
|
@@ -194,7 +203,7 @@ var unmarshalVersion = (data) => {
|
|
|
194
203
|
version: data.version
|
|
195
204
|
};
|
|
196
205
|
};
|
|
197
|
-
|
|
206
|
+
var unmarshalListVersionsResponse = (data) => {
|
|
198
207
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListVersionsResponse' failed as data isn't a dictionary.`);
|
|
199
208
|
return {
|
|
200
209
|
totalCount: data.total_count,
|
|
@@ -210,7 +219,7 @@ var marshalEndpointSpec = (request, defaults) => ({ ...resolveOneOf([{
|
|
|
210
219
|
param: "private_network",
|
|
211
220
|
value: request.privateNetwork !== void 0 ? marshalEndpointSpecPrivateNetworkDetails(request.privateNetwork, defaults) : void 0
|
|
212
221
|
}]) });
|
|
213
|
-
|
|
222
|
+
var marshalCreateEndpointRequest = (request, defaults) => ({
|
|
214
223
|
endpoint: marshalEndpointSpec(request.endpoint, defaults),
|
|
215
224
|
instance_id: request.instanceId
|
|
216
225
|
});
|
|
@@ -218,7 +227,7 @@ var marshalVolume = (request, defaults) => ({
|
|
|
218
227
|
size_bytes: request.sizeBytes,
|
|
219
228
|
type: request.type
|
|
220
229
|
});
|
|
221
|
-
|
|
230
|
+
var marshalCreateInstanceRequest = (request, defaults) => ({
|
|
222
231
|
endpoints: request.endpoints !== void 0 ? request.endpoints.map((elt) => marshalEndpointSpec(elt, defaults)) : void 0,
|
|
223
232
|
name: request.name || randomName("mgdb"),
|
|
224
233
|
node_amount: request.nodeAmount,
|
|
@@ -230,16 +239,16 @@ const marshalCreateInstanceRequest = (request, defaults) => ({
|
|
|
230
239
|
version: request.version,
|
|
231
240
|
volume: request.volume !== void 0 ? marshalVolume(request.volume, defaults) : void 0
|
|
232
241
|
});
|
|
233
|
-
|
|
242
|
+
var marshalCreateSnapshotRequest = (request, defaults) => ({
|
|
234
243
|
expires_at: request.expiresAt,
|
|
235
244
|
instance_id: request.instanceId,
|
|
236
245
|
name: request.name
|
|
237
246
|
});
|
|
238
|
-
|
|
247
|
+
var marshalCreateUserRequest = (request, defaults) => ({
|
|
239
248
|
name: request.name,
|
|
240
249
|
password: request.password
|
|
241
250
|
});
|
|
242
|
-
|
|
251
|
+
var marshalRestoreSnapshotRequest = (request, defaults) => ({
|
|
243
252
|
instance_name: request.instanceName,
|
|
244
253
|
node_amount: request.nodeAmount,
|
|
245
254
|
node_type: request.nodeType,
|
|
@@ -255,27 +264,28 @@ var marshalUserRole = (request, defaults) => ({
|
|
|
255
264
|
value: request.anyDatabase
|
|
256
265
|
}])
|
|
257
266
|
});
|
|
258
|
-
|
|
267
|
+
var marshalSetUserRoleRequest = (request, defaults) => ({
|
|
259
268
|
roles: request.roles !== void 0 ? request.roles.map((elt) => marshalUserRole(elt, defaults)) : void 0,
|
|
260
269
|
user_name: request.userName
|
|
261
270
|
});
|
|
262
|
-
|
|
271
|
+
var marshalUpdateInstanceRequest = (request, defaults) => ({
|
|
263
272
|
is_snapshot_schedule_enabled: request.isSnapshotScheduleEnabled,
|
|
264
273
|
name: request.name,
|
|
265
274
|
snapshot_schedule_frequency_hours: request.snapshotScheduleFrequencyHours,
|
|
266
275
|
snapshot_schedule_retention_days: request.snapshotScheduleRetentionDays,
|
|
267
276
|
tags: request.tags
|
|
268
277
|
});
|
|
269
|
-
|
|
278
|
+
var marshalUpdateSnapshotRequest = (request, defaults) => ({
|
|
270
279
|
expires_at: request.expiresAt,
|
|
271
280
|
name: request.name
|
|
272
281
|
});
|
|
273
|
-
|
|
274
|
-
|
|
282
|
+
var marshalUpdateUserRequest = (request, defaults) => ({ password: request.password });
|
|
283
|
+
var marshalUpgradeInstanceRequest = (request, defaults) => ({ ...resolveOneOf([{
|
|
275
284
|
param: "volume_size_bytes",
|
|
276
285
|
value: request.volumeSizeBytes
|
|
277
286
|
}, {
|
|
278
287
|
param: "version_id",
|
|
279
288
|
value: request.versionId
|
|
280
289
|
}]) });
|
|
281
|
-
|
|
290
|
+
//#endregion
|
|
291
|
+
export { marshalCreateEndpointRequest, marshalCreateInstanceRequest, marshalCreateSnapshotRequest, marshalCreateUserRequest, marshalRestoreSnapshotRequest, marshalSetUserRoleRequest, marshalUpdateInstanceRequest, marshalUpdateSnapshotRequest, marshalUpdateUserRequest, marshalUpgradeInstanceRequest, marshalVolume, unmarshalEndpoint, unmarshalInstance, unmarshalInstanceSetting, unmarshalListDatabasesResponse, unmarshalListInstancesResponse, unmarshalListMaintenancesResponse, unmarshalListNodeTypesResponse, unmarshalListSnapshotsResponse, unmarshalListUsersResponse, unmarshalListVersionsResponse, unmarshalMaintenance, unmarshalSnapshot, unmarshalUser, unmarshalVolume };
|
package/dist/v1/types.gen.d.ts
CHANGED
|
@@ -65,6 +65,10 @@ export interface Endpoint {
|
|
|
65
65
|
*/
|
|
66
66
|
publicNetwork?: EndpointPublicNetworkDetails;
|
|
67
67
|
}
|
|
68
|
+
export interface InstanceSetting {
|
|
69
|
+
name: string;
|
|
70
|
+
value: string;
|
|
71
|
+
}
|
|
68
72
|
export interface InstanceSnapshotSchedule {
|
|
69
73
|
frequencyHours: number;
|
|
70
74
|
retentionDays: number;
|
|
@@ -206,6 +210,10 @@ export interface Instance {
|
|
|
206
210
|
* Snapshot schedule configuration of the Database Instance.
|
|
207
211
|
*/
|
|
208
212
|
snapshotSchedule?: InstanceSnapshotSchedule;
|
|
213
|
+
/**
|
|
214
|
+
* List of settings applied to the Database Instance.
|
|
215
|
+
*/
|
|
216
|
+
settings: InstanceSetting[];
|
|
209
217
|
}
|
|
210
218
|
export interface Maintenance {
|
|
211
219
|
/**
|
|
File without changes
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
2
|
+
//#region src/v1/validation-rules.gen.ts
|
|
2
3
|
var validation_rules_gen_exports = /* @__PURE__ */ __exportAll({
|
|
3
4
|
CreateInstanceRequest: () => CreateInstanceRequest,
|
|
4
5
|
CreateSnapshotRequest: () => CreateSnapshotRequest,
|
|
@@ -18,7 +19,7 @@ var validation_rules_gen_exports = /* @__PURE__ */ __exportAll({
|
|
|
18
19
|
UpdateUserRequest: () => UpdateUserRequest,
|
|
19
20
|
Volume: () => Volume
|
|
20
21
|
});
|
|
21
|
-
|
|
22
|
+
var CreateInstanceRequest = {
|
|
22
23
|
name: {
|
|
23
24
|
maxLength: 255,
|
|
24
25
|
minLength: 1,
|
|
@@ -44,12 +45,12 @@ const CreateInstanceRequest = {
|
|
|
44
45
|
},
|
|
45
46
|
version: { pattern: /^[0-9]+\.[0-9]+$/ }
|
|
46
47
|
};
|
|
47
|
-
|
|
48
|
+
var CreateSnapshotRequest = { name: {
|
|
48
49
|
maxLength: 255,
|
|
49
50
|
minLength: 1,
|
|
50
51
|
pattern: /^[A-Za-z0-9\-_]+$/
|
|
51
52
|
} };
|
|
52
|
-
|
|
53
|
+
var CreateUserRequest = {
|
|
53
54
|
name: {
|
|
54
55
|
maxLength: 63,
|
|
55
56
|
minLength: 1,
|
|
@@ -60,19 +61,19 @@ const CreateUserRequest = {
|
|
|
60
61
|
minLength: 8
|
|
61
62
|
}
|
|
62
63
|
};
|
|
63
|
-
|
|
64
|
+
var DeleteUserRequest = { name: {
|
|
64
65
|
maxLength: 63,
|
|
65
66
|
minLength: 1,
|
|
66
67
|
pattern: /^[a-zA-Z0-9_\-]*$/
|
|
67
68
|
} };
|
|
68
|
-
|
|
69
|
+
var ListDatabasesRequest = {
|
|
69
70
|
page: { greaterThanOrEqual: 1 },
|
|
70
71
|
pageSize: {
|
|
71
72
|
greaterThanOrEqual: 1,
|
|
72
73
|
lessThanOrEqual: 100
|
|
73
74
|
}
|
|
74
75
|
};
|
|
75
|
-
|
|
76
|
+
var ListInstancesRequest = {
|
|
76
77
|
name: {
|
|
77
78
|
maxLength: 255,
|
|
78
79
|
minLength: 1,
|
|
@@ -84,21 +85,21 @@ const ListInstancesRequest = {
|
|
|
84
85
|
lessThanOrEqual: 100
|
|
85
86
|
}
|
|
86
87
|
};
|
|
87
|
-
|
|
88
|
+
var ListMaintenancesRequest = {
|
|
88
89
|
page: { greaterThanOrEqual: 1 },
|
|
89
90
|
pageSize: {
|
|
90
91
|
greaterThanOrEqual: 1,
|
|
91
92
|
lessThanOrEqual: 100
|
|
92
93
|
}
|
|
93
94
|
};
|
|
94
|
-
|
|
95
|
+
var ListNodeTypesRequest = {
|
|
95
96
|
page: { greaterThanOrEqual: 1 },
|
|
96
97
|
pageSize: {
|
|
97
98
|
greaterThanOrEqual: 1,
|
|
98
99
|
lessThanOrEqual: 100
|
|
99
100
|
}
|
|
100
101
|
};
|
|
101
|
-
|
|
102
|
+
var ListSnapshotsRequest = {
|
|
102
103
|
name: {
|
|
103
104
|
maxLength: 255,
|
|
104
105
|
minLength: 1,
|
|
@@ -110,7 +111,7 @@ const ListSnapshotsRequest = {
|
|
|
110
111
|
lessThanOrEqual: 100
|
|
111
112
|
}
|
|
112
113
|
};
|
|
113
|
-
|
|
114
|
+
var ListUsersRequest = {
|
|
114
115
|
name: {
|
|
115
116
|
maxLength: 63,
|
|
116
117
|
minLength: 1,
|
|
@@ -122,7 +123,7 @@ const ListUsersRequest = {
|
|
|
122
123
|
lessThanOrEqual: 100
|
|
123
124
|
}
|
|
124
125
|
};
|
|
125
|
-
|
|
126
|
+
var ListVersionsRequest = {
|
|
126
127
|
page: { greaterThanOrEqual: 1 },
|
|
127
128
|
pageSize: {
|
|
128
129
|
greaterThanOrEqual: 1,
|
|
@@ -130,7 +131,7 @@ const ListVersionsRequest = {
|
|
|
130
131
|
},
|
|
131
132
|
version: { pattern: /^[0-9]+\.[0-9]+$/ }
|
|
132
133
|
};
|
|
133
|
-
|
|
134
|
+
var RestoreSnapshotRequest = {
|
|
134
135
|
instanceName: {
|
|
135
136
|
maxLength: 255,
|
|
136
137
|
minLength: 1,
|
|
@@ -141,12 +142,12 @@ const RestoreSnapshotRequest = {
|
|
|
141
142
|
lessThanOrEqual: 3
|
|
142
143
|
}
|
|
143
144
|
};
|
|
144
|
-
|
|
145
|
+
var SetUserRoleRequest = { userName: {
|
|
145
146
|
maxLength: 63,
|
|
146
147
|
minLength: 1,
|
|
147
148
|
pattern: /^[a-zA-Z0-9_\-]*$/
|
|
148
149
|
} };
|
|
149
|
-
|
|
150
|
+
var UpdateInstanceRequest = {
|
|
150
151
|
name: {
|
|
151
152
|
maxLength: 255,
|
|
152
153
|
minLength: 1,
|
|
@@ -161,12 +162,12 @@ const UpdateInstanceRequest = {
|
|
|
161
162
|
lessThanOrEqual: 365
|
|
162
163
|
}
|
|
163
164
|
};
|
|
164
|
-
|
|
165
|
+
var UpdateSnapshotRequest = { name: {
|
|
165
166
|
maxLength: 255,
|
|
166
167
|
minLength: 1,
|
|
167
168
|
pattern: /^[A-Za-z0-9\-_]+$/
|
|
168
169
|
} };
|
|
169
|
-
|
|
170
|
+
var UpdateUserRequest = {
|
|
170
171
|
name: {
|
|
171
172
|
maxLength: 63,
|
|
172
173
|
minLength: 1,
|
|
@@ -177,5 +178,6 @@ const UpdateUserRequest = {
|
|
|
177
178
|
minLength: 8
|
|
178
179
|
}
|
|
179
180
|
};
|
|
180
|
-
|
|
181
|
-
|
|
181
|
+
var Volume = { sizeBytes: { greaterThanOrEqual: 1e9 } };
|
|
182
|
+
//#endregion
|
|
183
|
+
export { CreateInstanceRequest, CreateSnapshotRequest, CreateUserRequest, DeleteUserRequest, ListDatabasesRequest, ListInstancesRequest, ListMaintenancesRequest, ListNodeTypesRequest, ListSnapshotsRequest, ListUsersRequest, ListVersionsRequest, RestoreSnapshotRequest, SetUserRoleRequest, UpdateInstanceRequest, UpdateSnapshotRequest, UpdateUserRequest, Volume, validation_rules_gen_exports };
|
package/dist/v1alpha1/api.gen.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { INSTANCE_TRANSIENT_STATUSES, SNAPSHOT_TRANSIENT_STATUSES } from "./content.gen.js";
|
|
2
2
|
import { marshalCreateEndpointRequest, marshalCreateInstanceRequest, marshalCreateSnapshotRequest, marshalCreateUserRequest, marshalRestoreSnapshotRequest, marshalSetUserRoleRequest, marshalUpdateInstanceRequest, marshalUpdateSnapshotRequest, marshalUpdateUserRequest, marshalUpgradeInstanceRequest, unmarshalEndpoint, unmarshalInstance, unmarshalListInstancesResponse, unmarshalListNodeTypesResponse, unmarshalListSnapshotsResponse, unmarshalListUsersResponse, unmarshalListVersionsResponse, unmarshalSnapshot, unmarshalUser } from "./marshalling.gen.js";
|
|
3
|
-
import { API, enrichForPagination, toApiLocality, urlParams, validatePathParam, waitForResource } from "@scaleway/sdk-client";
|
|
3
|
+
import { API as API$1, enrichForPagination, toApiLocality, urlParams, validatePathParam, waitForResource } from "@scaleway/sdk-client";
|
|
4
|
+
//#region src/v1alpha1/api.gen.ts
|
|
4
5
|
var jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
|
|
5
6
|
/**
|
|
6
7
|
* Managed MongoDB®.
|
|
7
8
|
|
|
8
9
|
This API allows you to manage your Managed Databases for MongoDB®.
|
|
9
10
|
*/
|
|
10
|
-
var API
|
|
11
|
+
var API = class extends API$1 {
|
|
11
12
|
/**
|
|
12
13
|
* Locality of this API.
|
|
13
14
|
* type ∈ {'zone','region','global','unspecified'}
|
|
@@ -282,4 +283,5 @@ var API$1 = class extends API {
|
|
|
282
283
|
path: `/mongodb/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/endpoints`
|
|
283
284
|
}, unmarshalEndpoint);
|
|
284
285
|
};
|
|
285
|
-
|
|
286
|
+
//#endregion
|
|
287
|
+
export { API };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
//#region src/v1alpha1/content.gen.ts
|
|
1
2
|
/** Lists transient statutes of the enum {@link InstanceStatus}. */
|
|
2
|
-
|
|
3
|
+
var INSTANCE_TRANSIENT_STATUSES = [
|
|
3
4
|
"provisioning",
|
|
4
5
|
"configuring",
|
|
5
6
|
"deleting",
|
|
@@ -7,9 +8,10 @@ const INSTANCE_TRANSIENT_STATUSES = [
|
|
|
7
8
|
"snapshotting"
|
|
8
9
|
];
|
|
9
10
|
/** Lists transient statutes of the enum {@link SnapshotStatus}. */
|
|
10
|
-
|
|
11
|
+
var SNAPSHOT_TRANSIENT_STATUSES = [
|
|
11
12
|
"creating",
|
|
12
13
|
"restoring",
|
|
13
14
|
"deleting"
|
|
14
15
|
];
|
|
16
|
+
//#endregion
|
|
15
17
|
export { INSTANCE_TRANSIENT_STATUSES, SNAPSHOT_TRANSIENT_STATUSES };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { INSTANCE_TRANSIENT_STATUSES, SNAPSHOT_TRANSIENT_STATUSES } from "./content.gen.js";
|
|
3
|
-
import { marshalCreateEndpointRequest, marshalCreateInstanceRequest, marshalCreateSnapshotRequest, marshalCreateUserRequest, marshalRestoreSnapshotRequest, marshalSetUserRoleRequest, marshalUpdateInstanceRequest, marshalUpdateSnapshotRequest, marshalUpdateUserRequest, marshalUpgradeInstanceRequest, unmarshalEndpoint, unmarshalInstance,
|
|
3
|
+
import { marshalCreateEndpointRequest, marshalCreateInstanceRequest, marshalCreateSnapshotRequest, marshalCreateUserRequest, marshalRestoreSnapshotRequest, marshalSetUserRoleRequest, marshalUpdateInstanceRequest, marshalUpdateSnapshotRequest, marshalUpdateUserRequest, marshalUpgradeInstanceRequest, unmarshalEndpoint, unmarshalInstance, unmarshalListInstancesResponse, unmarshalListNodeTypesResponse, unmarshalListSnapshotsResponse, unmarshalListUsersResponse, unmarshalListVersionsResponse, unmarshalSnapshot, unmarshalUser } from "./marshalling.gen.js";
|
|
4
4
|
import { API } from "./api.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
|
INSTANCE_TRANSIENT_STATUSES: () => INSTANCE_TRANSIENT_STATUSES,
|
|
@@ -20,14 +21,13 @@ var index_gen_exports = /* @__PURE__ */ __exportAll({
|
|
|
20
21
|
marshalUpgradeInstanceRequest: () => marshalUpgradeInstanceRequest,
|
|
21
22
|
unmarshalEndpoint: () => unmarshalEndpoint,
|
|
22
23
|
unmarshalInstance: () => unmarshalInstance,
|
|
23
|
-
unmarshalInstanceSetting: () => unmarshalInstanceSetting,
|
|
24
24
|
unmarshalListInstancesResponse: () => unmarshalListInstancesResponse,
|
|
25
25
|
unmarshalListNodeTypesResponse: () => unmarshalListNodeTypesResponse,
|
|
26
26
|
unmarshalListSnapshotsResponse: () => unmarshalListSnapshotsResponse,
|
|
27
27
|
unmarshalListUsersResponse: () => unmarshalListUsersResponse,
|
|
28
28
|
unmarshalListVersionsResponse: () => unmarshalListVersionsResponse,
|
|
29
29
|
unmarshalSnapshot: () => unmarshalSnapshot,
|
|
30
|
-
unmarshalUser: () => unmarshalUser
|
|
31
|
-
unmarshalVolume: () => unmarshalVolume
|
|
30
|
+
unmarshalUser: () => unmarshalUser
|
|
32
31
|
});
|
|
33
|
-
|
|
32
|
+
//#endregion
|
|
33
|
+
export { API, INSTANCE_TRANSIENT_STATUSES, SNAPSHOT_TRANSIENT_STATUSES, validation_rules_gen_exports as ValidationRules, index_gen_exports, marshalCreateEndpointRequest, marshalCreateInstanceRequest, marshalCreateSnapshotRequest, marshalCreateUserRequest, marshalRestoreSnapshotRequest, marshalSetUserRoleRequest, marshalUpdateInstanceRequest, marshalUpdateSnapshotRequest, marshalUpdateUserRequest, marshalUpgradeInstanceRequest, unmarshalEndpoint, unmarshalInstance, unmarshalListInstancesResponse, unmarshalListNodeTypesResponse, unmarshalListSnapshotsResponse, unmarshalListUsersResponse, unmarshalListVersionsResponse, unmarshalSnapshot, unmarshalUser };
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { DefaultValues } from '@scaleway/sdk-client';
|
|
2
|
-
import type { CreateEndpointRequest, CreateInstanceRequest, CreateSnapshotRequest, CreateUserRequest, Endpoint, Instance,
|
|
2
|
+
import type { CreateEndpointRequest, CreateInstanceRequest, CreateSnapshotRequest, CreateUserRequest, Endpoint, Instance, ListInstancesResponse, ListNodeTypesResponse, ListSnapshotsResponse, ListUsersResponse, ListVersionsResponse, RestoreSnapshotRequest, SetUserRoleRequest, Snapshot, UpdateInstanceRequest, UpdateSnapshotRequest, UpdateUserRequest, UpgradeInstanceRequest, User } from './types.gen.js';
|
|
3
3
|
export declare const unmarshalEndpoint: (data: unknown) => Endpoint;
|
|
4
|
-
export declare const unmarshalInstanceSetting: (data: unknown) => InstanceSetting;
|
|
5
|
-
export declare const unmarshalVolume: (data: unknown) => Volume;
|
|
6
4
|
export declare const unmarshalInstance: (data: unknown) => Instance;
|
|
7
5
|
export declare const unmarshalSnapshot: (data: unknown) => Snapshot;
|
|
8
6
|
export declare const unmarshalUser: (data: unknown) => User;
|
|
@@ -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 unmarshalEndpointPrivateNetworkDetails = (data) => {
|
|
4
5
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'EndpointPrivateNetworkDetails' failed as data isn't a dictionary.`);
|
|
5
6
|
return { privateNetworkId: data.private_network_id };
|
|
@@ -8,7 +9,7 @@ var unmarshalEndpointPublicDetails = (data) => {
|
|
|
8
9
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'EndpointPublicDetails' failed as data isn't a dictionary.`);
|
|
9
10
|
return {};
|
|
10
11
|
};
|
|
11
|
-
|
|
12
|
+
var unmarshalEndpoint = (data) => {
|
|
12
13
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Endpoint' failed as data isn't a dictionary.`);
|
|
13
14
|
return {
|
|
14
15
|
dnsRecords: data.dns_records,
|
|
@@ -19,7 +20,7 @@ const unmarshalEndpoint = (data) => {
|
|
|
19
20
|
public: data.public ? unmarshalEndpointPublicDetails(data.public) : void 0
|
|
20
21
|
};
|
|
21
22
|
};
|
|
22
|
-
|
|
23
|
+
var unmarshalInstanceSetting = (data) => {
|
|
23
24
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'InstanceSetting' failed as data isn't a dictionary.`);
|
|
24
25
|
return {
|
|
25
26
|
name: data.name,
|
|
@@ -36,14 +37,14 @@ var unmarshalInstanceSnapshotSchedule = (data) => {
|
|
|
36
37
|
retentionDays: data.retention_days
|
|
37
38
|
};
|
|
38
39
|
};
|
|
39
|
-
|
|
40
|
+
var unmarshalVolume = (data) => {
|
|
40
41
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Volume' failed as data isn't a dictionary.`);
|
|
41
42
|
return {
|
|
42
43
|
size: data.size,
|
|
43
44
|
type: data.type
|
|
44
45
|
};
|
|
45
46
|
};
|
|
46
|
-
|
|
47
|
+
var unmarshalInstance = (data) => {
|
|
47
48
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Instance' failed as data isn't a dictionary.`);
|
|
48
49
|
return {
|
|
49
50
|
createdAt: unmarshalDate(data.created_at),
|
|
@@ -66,7 +67,7 @@ var unmarshalSnapshotVolumeType = (data) => {
|
|
|
66
67
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SnapshotVolumeType' failed as data isn't a dictionary.`);
|
|
67
68
|
return { type: data.type };
|
|
68
69
|
};
|
|
69
|
-
|
|
70
|
+
var unmarshalSnapshot = (data) => {
|
|
70
71
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Snapshot' failed as data isn't a dictionary.`);
|
|
71
72
|
return {
|
|
72
73
|
createdAt: unmarshalDate(data.created_at),
|
|
@@ -91,14 +92,14 @@ var unmarshalUserRole = (data) => {
|
|
|
91
92
|
role: data.role
|
|
92
93
|
};
|
|
93
94
|
};
|
|
94
|
-
|
|
95
|
+
var unmarshalUser = (data) => {
|
|
95
96
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'User' failed as data isn't a dictionary.`);
|
|
96
97
|
return {
|
|
97
98
|
name: data.name,
|
|
98
99
|
roles: unmarshalArrayOfObject(data.roles, unmarshalUserRole)
|
|
99
100
|
};
|
|
100
101
|
};
|
|
101
|
-
|
|
102
|
+
var unmarshalListInstancesResponse = (data) => {
|
|
102
103
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListInstancesResponse' failed as data isn't a dictionary.`);
|
|
103
104
|
return {
|
|
104
105
|
instances: unmarshalArrayOfObject(data.instances, unmarshalInstance),
|
|
@@ -129,21 +130,21 @@ var unmarshalNodeType = (data) => {
|
|
|
129
130
|
vcpus: data.vcpus
|
|
130
131
|
};
|
|
131
132
|
};
|
|
132
|
-
|
|
133
|
+
var unmarshalListNodeTypesResponse = (data) => {
|
|
133
134
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListNodeTypesResponse' failed as data isn't a dictionary.`);
|
|
134
135
|
return {
|
|
135
136
|
nodeTypes: unmarshalArrayOfObject(data.node_types, unmarshalNodeType),
|
|
136
137
|
totalCount: data.total_count
|
|
137
138
|
};
|
|
138
139
|
};
|
|
139
|
-
|
|
140
|
+
var unmarshalListSnapshotsResponse = (data) => {
|
|
140
141
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListSnapshotsResponse' failed as data isn't a dictionary.`);
|
|
141
142
|
return {
|
|
142
143
|
snapshots: unmarshalArrayOfObject(data.snapshots, unmarshalSnapshot),
|
|
143
144
|
totalCount: data.total_count
|
|
144
145
|
};
|
|
145
146
|
};
|
|
146
|
-
|
|
147
|
+
var unmarshalListUsersResponse = (data) => {
|
|
147
148
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListUsersResponse' failed as data isn't a dictionary.`);
|
|
148
149
|
return {
|
|
149
150
|
totalCount: data.total_count,
|
|
@@ -174,7 +175,7 @@ var unmarshalVersion = (data) => {
|
|
|
174
175
|
version: data.version
|
|
175
176
|
};
|
|
176
177
|
};
|
|
177
|
-
|
|
178
|
+
var unmarshalListVersionsResponse = (data) => {
|
|
178
179
|
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListVersionsResponse' failed as data isn't a dictionary.`);
|
|
179
180
|
return {
|
|
180
181
|
totalCount: data.total_count,
|
|
@@ -190,7 +191,7 @@ var marshalEndpointSpec = (request, defaults) => ({ ...resolveOneOf([{
|
|
|
190
191
|
param: "private_network",
|
|
191
192
|
value: request.privateNetwork !== void 0 ? marshalEndpointSpecPrivateNetworkDetails(request.privateNetwork, defaults) : void 0
|
|
192
193
|
}]) });
|
|
193
|
-
|
|
194
|
+
var marshalCreateEndpointRequest = (request, defaults) => ({
|
|
194
195
|
endpoint: marshalEndpointSpec(request.endpoint, defaults),
|
|
195
196
|
instance_id: request.instanceId
|
|
196
197
|
});
|
|
@@ -198,7 +199,7 @@ var marshalCreateInstanceRequestVolumeDetails = (request, defaults) => ({
|
|
|
198
199
|
volume_size: request.volumeSize,
|
|
199
200
|
volume_type: request.volumeType
|
|
200
201
|
});
|
|
201
|
-
|
|
202
|
+
var marshalCreateInstanceRequest = (request, defaults) => ({
|
|
202
203
|
endpoints: request.endpoints !== void 0 ? request.endpoints.map((elt) => marshalEndpointSpec(elt, defaults)) : void 0,
|
|
203
204
|
name: request.name || randomName("mgdb"),
|
|
204
205
|
node_number: request.nodeNumber,
|
|
@@ -210,16 +211,16 @@ const marshalCreateInstanceRequest = (request, defaults) => ({
|
|
|
210
211
|
version: request.version,
|
|
211
212
|
volume: request.volume !== void 0 ? marshalCreateInstanceRequestVolumeDetails(request.volume, defaults) : void 0
|
|
212
213
|
});
|
|
213
|
-
|
|
214
|
+
var marshalCreateSnapshotRequest = (request, defaults) => ({
|
|
214
215
|
expires_at: request.expiresAt,
|
|
215
216
|
name: request.name
|
|
216
217
|
});
|
|
217
|
-
|
|
218
|
+
var marshalCreateUserRequest = (request, defaults) => ({
|
|
218
219
|
name: request.name,
|
|
219
220
|
password: request.password
|
|
220
221
|
});
|
|
221
222
|
var marshalRestoreSnapshotRequestVolumeDetails = (request, defaults) => ({ volume_type: request.volumeType });
|
|
222
|
-
|
|
223
|
+
var marshalRestoreSnapshotRequest = (request, defaults) => ({
|
|
223
224
|
instance_name: request.instanceName,
|
|
224
225
|
node_number: request.nodeNumber,
|
|
225
226
|
node_type: request.nodeType,
|
|
@@ -235,21 +236,22 @@ var marshalUserRole = (request, defaults) => ({
|
|
|
235
236
|
value: request.anyDatabase
|
|
236
237
|
}])
|
|
237
238
|
});
|
|
238
|
-
|
|
239
|
+
var marshalSetUserRoleRequest = (request, defaults) => ({
|
|
239
240
|
roles: request.roles !== void 0 ? request.roles.map((elt) => marshalUserRole(elt, defaults)) : void 0,
|
|
240
241
|
user_name: request.userName
|
|
241
242
|
});
|
|
242
|
-
|
|
243
|
+
var marshalUpdateInstanceRequest = (request, defaults) => ({
|
|
243
244
|
name: request.name,
|
|
244
245
|
tags: request.tags
|
|
245
246
|
});
|
|
246
|
-
|
|
247
|
+
var marshalUpdateSnapshotRequest = (request, defaults) => ({
|
|
247
248
|
expires_at: request.expiresAt,
|
|
248
249
|
name: request.name
|
|
249
250
|
});
|
|
250
|
-
|
|
251
|
-
|
|
251
|
+
var marshalUpdateUserRequest = (request, defaults) => ({ password: request.password });
|
|
252
|
+
var marshalUpgradeInstanceRequest = (request, defaults) => ({ ...resolveOneOf([{
|
|
252
253
|
param: "volume_size",
|
|
253
254
|
value: request.volumeSize
|
|
254
255
|
}]) });
|
|
255
|
-
|
|
256
|
+
//#endregion
|
|
257
|
+
export { marshalCreateEndpointRequest, marshalCreateInstanceRequest, marshalCreateSnapshotRequest, marshalCreateUserRequest, marshalRestoreSnapshotRequest, marshalSetUserRoleRequest, marshalUpdateInstanceRequest, marshalUpdateSnapshotRequest, marshalUpdateUserRequest, marshalUpgradeInstanceRequest, unmarshalEndpoint, unmarshalInstance, unmarshalListInstancesResponse, unmarshalListNodeTypesResponse, unmarshalListSnapshotsResponse, unmarshalListUsersResponse, unmarshalListVersionsResponse, unmarshalSnapshot, unmarshalUser };
|
|
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
|
CreateInstanceRequest: () => CreateInstanceRequest,
|
|
4
5
|
CreateSnapshotRequest: () => CreateSnapshotRequest,
|
|
@@ -15,7 +16,7 @@ var validation_rules_gen_exports = /* @__PURE__ */ __exportAll({
|
|
|
15
16
|
UpdateSnapshotRequest: () => UpdateSnapshotRequest,
|
|
16
17
|
UpdateUserRequest: () => UpdateUserRequest
|
|
17
18
|
});
|
|
18
|
-
|
|
19
|
+
var CreateInstanceRequest = {
|
|
19
20
|
name: {
|
|
20
21
|
maxLength: 255,
|
|
21
22
|
minLength: 1,
|
|
@@ -41,12 +42,12 @@ const CreateInstanceRequest = {
|
|
|
41
42
|
},
|
|
42
43
|
version: { pattern: /^[0-9]+\.[0-9]+\.[0-9]+$/ }
|
|
43
44
|
};
|
|
44
|
-
|
|
45
|
+
var CreateSnapshotRequest = { name: {
|
|
45
46
|
maxLength: 255,
|
|
46
47
|
minLength: 1,
|
|
47
48
|
pattern: /^[A-Za-z0-9\-_]+$/
|
|
48
49
|
} };
|
|
49
|
-
|
|
50
|
+
var CreateUserRequest = {
|
|
50
51
|
name: {
|
|
51
52
|
maxLength: 63,
|
|
52
53
|
minLength: 1,
|
|
@@ -57,12 +58,12 @@ const CreateUserRequest = {
|
|
|
57
58
|
minLength: 8
|
|
58
59
|
}
|
|
59
60
|
};
|
|
60
|
-
|
|
61
|
+
var DeleteUserRequest = { name: {
|
|
61
62
|
maxLength: 63,
|
|
62
63
|
minLength: 1,
|
|
63
64
|
pattern: /^[a-zA-Z0-9_\-]*$/
|
|
64
65
|
} };
|
|
65
|
-
|
|
66
|
+
var ListInstancesRequest = {
|
|
66
67
|
name: {
|
|
67
68
|
maxLength: 255,
|
|
68
69
|
minLength: 1,
|
|
@@ -74,14 +75,14 @@ const ListInstancesRequest = {
|
|
|
74
75
|
lessThanOrEqual: 100
|
|
75
76
|
}
|
|
76
77
|
};
|
|
77
|
-
|
|
78
|
+
var ListNodeTypesRequest = {
|
|
78
79
|
page: { greaterThanOrEqual: 1 },
|
|
79
80
|
pageSize: {
|
|
80
81
|
greaterThanOrEqual: 1,
|
|
81
82
|
lessThanOrEqual: 100
|
|
82
83
|
}
|
|
83
84
|
};
|
|
84
|
-
|
|
85
|
+
var ListSnapshotsRequest = {
|
|
85
86
|
name: {
|
|
86
87
|
maxLength: 255,
|
|
87
88
|
minLength: 1,
|
|
@@ -93,7 +94,7 @@ const ListSnapshotsRequest = {
|
|
|
93
94
|
lessThanOrEqual: 100
|
|
94
95
|
}
|
|
95
96
|
};
|
|
96
|
-
|
|
97
|
+
var ListUsersRequest = {
|
|
97
98
|
name: {
|
|
98
99
|
maxLength: 63,
|
|
99
100
|
minLength: 1,
|
|
@@ -105,7 +106,7 @@ const ListUsersRequest = {
|
|
|
105
106
|
lessThanOrEqual: 100
|
|
106
107
|
}
|
|
107
108
|
};
|
|
108
|
-
|
|
109
|
+
var ListVersionsRequest = {
|
|
109
110
|
page: { greaterThanOrEqual: 1 },
|
|
110
111
|
pageSize: {
|
|
111
112
|
greaterThanOrEqual: 1,
|
|
@@ -113,7 +114,7 @@ const ListVersionsRequest = {
|
|
|
113
114
|
},
|
|
114
115
|
version: { pattern: /^[0-9]+\.[0-9]+\.[0-9]+$/ }
|
|
115
116
|
};
|
|
116
|
-
|
|
117
|
+
var RestoreSnapshotRequest = {
|
|
117
118
|
instanceName: {
|
|
118
119
|
maxLength: 255,
|
|
119
120
|
minLength: 1,
|
|
@@ -124,22 +125,22 @@ const RestoreSnapshotRequest = {
|
|
|
124
125
|
lessThanOrEqual: 3
|
|
125
126
|
}
|
|
126
127
|
};
|
|
127
|
-
|
|
128
|
+
var SetUserRoleRequest = { userName: {
|
|
128
129
|
maxLength: 63,
|
|
129
130
|
minLength: 1,
|
|
130
131
|
pattern: /^[a-zA-Z0-9_\-]*$/
|
|
131
132
|
} };
|
|
132
|
-
|
|
133
|
+
var UpdateInstanceRequest = { name: {
|
|
133
134
|
maxLength: 255,
|
|
134
135
|
minLength: 1,
|
|
135
136
|
pattern: /^[A-Za-z0-9\-_]+$/
|
|
136
137
|
} };
|
|
137
|
-
|
|
138
|
+
var UpdateSnapshotRequest = { name: {
|
|
138
139
|
maxLength: 255,
|
|
139
140
|
minLength: 1,
|
|
140
141
|
pattern: /^[A-Za-z0-9\-_]+$/
|
|
141
142
|
} };
|
|
142
|
-
|
|
143
|
+
var UpdateUserRequest = {
|
|
143
144
|
name: {
|
|
144
145
|
maxLength: 63,
|
|
145
146
|
minLength: 1,
|
|
@@ -150,4 +151,5 @@ const UpdateUserRequest = {
|
|
|
150
151
|
minLength: 8
|
|
151
152
|
}
|
|
152
153
|
};
|
|
153
|
-
|
|
154
|
+
//#endregion
|
|
155
|
+
export { CreateInstanceRequest, CreateSnapshotRequest, CreateUserRequest, DeleteUserRequest, ListInstancesRequest, ListNodeTypesRequest, ListSnapshotsRequest, ListUsersRequest, ListVersionsRequest, RestoreSnapshotRequest, SetUserRoleRequest, UpdateInstanceRequest, UpdateSnapshotRequest, UpdateUserRequest, validation_rules_gen_exports };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scaleway/sdk-mongodb",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.0",
|
|
4
4
|
"description": "Scaleway SDK mongodb",
|
|
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.
|
|
30
|
-
"@scaleway/sdk-std": "2.2.
|
|
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.
|
|
33
|
+
"@scaleway/sdk-client": "^2.2.2"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@scaleway/sdk-client": "^2.2.
|
|
36
|
+
"@scaleway/sdk-client": "^2.2.2"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
39
|
"package:check": "pnpm publint",
|