@scaleway/sdk-searchdb 1.7.2 → 1.8.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.
@@ -1,175 +0,0 @@
1
- import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
2
- //#region src/v1alpha1/marshalling.gen.ts
3
- const unmarshalEndpointPrivateNetworkDetails = (data) => {
4
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'EndpointPrivateNetworkDetails' failed as data isn't a dictionary.`);
5
- return { privateNetworkId: data.private_network_id };
6
- };
7
- const unmarshalEndpointPublicDetails = (data) => {
8
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'EndpointPublicDetails' failed as data isn't a dictionary.`);
9
- return {};
10
- };
11
- const unmarshalEndpointService = (data) => {
12
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'EndpointService' failed as data isn't a dictionary.`);
13
- return {
14
- name: data.name,
15
- port: data.port,
16
- url: data.url
17
- };
18
- };
19
- const unmarshalEndpoint = (data) => {
20
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Endpoint' failed as data isn't a dictionary.`);
21
- return {
22
- dnsRecord: data.dns_record,
23
- id: data.id,
24
- privateNetwork: data.private_network ? unmarshalEndpointPrivateNetworkDetails(data.private_network) : void 0,
25
- public: data.public ? unmarshalEndpointPublicDetails(data.public) : void 0,
26
- services: unmarshalArrayOfObject(data.services, unmarshalEndpointService)
27
- };
28
- };
29
- const unmarshalVolume = (data) => {
30
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Volume' failed as data isn't a dictionary.`);
31
- return {
32
- sizeBytes: data.size_bytes,
33
- type: data.type
34
- };
35
- };
36
- const unmarshalDeployment = (data) => {
37
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Deployment' failed as data isn't a dictionary.`);
38
- return {
39
- createdAt: unmarshalDate(data.created_at),
40
- endpoints: unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint),
41
- id: data.id,
42
- name: data.name,
43
- nodeAmount: data.node_amount,
44
- nodeCount: data.node_count,
45
- nodeType: data.node_type,
46
- organizationId: data.organization_id,
47
- projectId: data.project_id,
48
- region: data.region,
49
- status: data.status,
50
- tags: data.tags,
51
- updatedAt: unmarshalDate(data.updated_at),
52
- version: data.version,
53
- volume: data.volume ? unmarshalVolume(data.volume) : void 0
54
- };
55
- };
56
- const unmarshalUser = (data) => {
57
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'User' failed as data isn't a dictionary.`);
58
- return { username: data.username };
59
- };
60
- const unmarshalListDeploymentsResponse = (data) => {
61
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListDeploymentsResponse' failed as data isn't a dictionary.`);
62
- return {
63
- deployments: unmarshalArrayOfObject(data.deployments, unmarshalDeployment),
64
- totalCount: data.total_count
65
- };
66
- };
67
- const unmarshalNodeTypeVolumeType = (data) => {
68
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'NodeTypeVolumeType' failed as data isn't a dictionary.`);
69
- return {
70
- chunkSizeBytes: data.chunk_size_bytes,
71
- description: data.description,
72
- maxSizeBytes: data.max_size_bytes,
73
- minSizeBytes: data.min_size_bytes,
74
- type: data.type
75
- };
76
- };
77
- const unmarshalNodeType = (data) => {
78
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'NodeType' failed as data isn't a dictionary.`);
79
- return {
80
- availableVolumeTypes: unmarshalArrayOfObject(data.available_volume_types, unmarshalNodeTypeVolumeType),
81
- beta: data.beta,
82
- description: data.description,
83
- disabled: data.disabled,
84
- instanceRange: data.instance_range,
85
- memoryBytes: data.memory_bytes,
86
- name: data.name,
87
- stockStatus: data.stock_status,
88
- vcpus: data.vcpus
89
- };
90
- };
91
- const unmarshalListNodeTypesResponse = (data) => {
92
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListNodeTypesResponse' failed as data isn't a dictionary.`);
93
- return {
94
- nodeTypes: unmarshalArrayOfObject(data.node_types, unmarshalNodeType),
95
- totalCount: data.total_count
96
- };
97
- };
98
- const unmarshalListUsersResponse = (data) => {
99
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListUsersResponse' failed as data isn't a dictionary.`);
100
- return {
101
- totalCount: data.total_count,
102
- users: unmarshalArrayOfObject(data.users, unmarshalUser)
103
- };
104
- };
105
- const unmarshalVersion = (data) => {
106
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Version' failed as data isn't a dictionary.`);
107
- return {
108
- beta: data.beta,
109
- disabled: data.disabled,
110
- endOfLife: unmarshalDate(data.end_of_life),
111
- version: data.version
112
- };
113
- };
114
- const unmarshalListVersionsResponse = (data) => {
115
- if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListVersionsResponse' failed as data isn't a dictionary.`);
116
- return {
117
- totalCount: data.total_count,
118
- versions: unmarshalArrayOfObject(data.versions, unmarshalVersion)
119
- };
120
- };
121
- const marshalEndpointSpecPrivateNetworkDetails = (request, defaults) => ({ private_network_id: request.privateNetworkId });
122
- const marshalEndpointSpecPublicDetails = (request, defaults) => ({});
123
- const marshalEndpointSpec = (request, defaults) => ({ ...resolveOneOf([{
124
- param: "public",
125
- value: request.public !== void 0 ? marshalEndpointSpecPublicDetails(request.public, defaults) : void 0
126
- }, {
127
- param: "private_network",
128
- value: request.privateNetwork !== void 0 ? marshalEndpointSpecPrivateNetworkDetails(request.privateNetwork, defaults) : void 0
129
- }]) });
130
- const marshalVolume = (request, defaults) => ({
131
- size_bytes: request.sizeBytes,
132
- type: request.type
133
- });
134
- const marshalCreateDeploymentRequest = (request, defaults) => ({
135
- endpoints: request.endpoints !== void 0 ? request.endpoints.map((elt) => marshalEndpointSpec(elt, defaults)) : void 0,
136
- name: request.name,
137
- node_amount: request.nodeAmount,
138
- node_count: request.nodeCount,
139
- node_type: request.nodeType,
140
- password: request.password,
141
- project_id: request.projectId ?? defaults.defaultProjectId,
142
- tags: request.tags,
143
- user_name: request.userName,
144
- version: request.version,
145
- volume: request.volume !== void 0 ? marshalVolume(request.volume, defaults) : void 0
146
- });
147
- const marshalCreateEndpointRequest = (request, defaults) => ({
148
- deployment_id: request.deploymentId,
149
- endpoint_spec: request.endpointSpec !== void 0 ? marshalEndpointSpec(request.endpointSpec, defaults) : void 0
150
- });
151
- const marshalCreateUserRequest = (request, defaults) => ({
152
- password: request.password,
153
- username: request.username
154
- });
155
- const marshalUpdateDeploymentRequest = (request, defaults) => ({
156
- name: request.name,
157
- tags: request.tags
158
- });
159
- const marshalUpdateUserRequest = (request, defaults) => ({ password: request.password });
160
- const marshalUpgradeDeploymentRequest = (request, defaults) => ({ ...resolveOneOf([
161
- {
162
- param: "node_amount",
163
- value: request.nodeAmount
164
- },
165
- {
166
- param: "node_count",
167
- value: request.nodeCount
168
- },
169
- {
170
- param: "volume_size_bytes",
171
- value: request.volumeSizeBytes
172
- }
173
- ]) });
174
- //#endregion
175
- export { marshalCreateDeploymentRequest, marshalCreateEndpointRequest, marshalCreateUserRequest, marshalUpdateDeploymentRequest, marshalUpdateUserRequest, marshalUpgradeDeploymentRequest, unmarshalDeployment, unmarshalEndpoint, unmarshalListDeploymentsResponse, unmarshalListNodeTypesResponse, unmarshalListUsersResponse, unmarshalListVersionsResponse, unmarshalUser };
@@ -1,64 +0,0 @@
1
- export declare const queriesMetadata: {
2
- readonly namespace: 'searchdb';
3
- readonly version: 'v1alpha1';
4
- readonly folderName: 'searchdbv1alpha1';
5
- readonly services: readonly [{
6
- readonly apiClass: 'API';
7
- readonly methods: readonly [{
8
- readonly methodName: 'getDeployment';
9
- readonly protoName: 'GetDeployment';
10
- readonly paramsType: 'GetDeploymentRequest';
11
- readonly returnType: 'Deployment';
12
- readonly isList: false;
13
- readonly paginationType: 'none';
14
- readonly isPrivate: false;
15
- readonly description: '"';
16
- readonly hasWaiter: true;
17
- }, {
18
- readonly methodName: 'listDeployments';
19
- readonly protoName: 'ListDeployments';
20
- readonly paramsType: 'ListDeploymentsRequest';
21
- readonly returnType: 'ListDeploymentsResponse';
22
- readonly isList: true;
23
- readonly paginationType: 'offset';
24
- readonly pageParamKey: 'page';
25
- readonly listItemType: 'Deployment';
26
- readonly isPrivate: false;
27
- readonly description: '"';
28
- }, {
29
- readonly methodName: 'listVersions';
30
- readonly protoName: 'ListVersions';
31
- readonly paramsType: 'ListVersionsRequest';
32
- readonly returnType: 'ListVersionsResponse';
33
- readonly isList: true;
34
- readonly paginationType: 'offset';
35
- readonly pageParamKey: 'page';
36
- readonly listItemType: 'Version';
37
- readonly isPrivate: false;
38
- readonly description: '"';
39
- }, {
40
- readonly methodName: 'listNodeTypes';
41
- readonly protoName: 'ListNodeTypes';
42
- readonly paramsType: 'ListNodeTypesRequest';
43
- readonly returnType: 'ListNodeTypesResponse';
44
- readonly isList: true;
45
- readonly paginationType: 'offset';
46
- readonly pageParamKey: 'page';
47
- readonly listItemType: 'NodeType';
48
- readonly isPrivate: false;
49
- readonly description: '"';
50
- }, {
51
- readonly methodName: 'listUsers';
52
- readonly protoName: 'ListUsers';
53
- readonly paramsType: 'ListUsersRequest';
54
- readonly returnType: 'ListUsersResponse';
55
- readonly isList: true;
56
- readonly paginationType: 'offset';
57
- readonly pageParamKey: 'page';
58
- readonly listItemType: 'User';
59
- readonly isPrivate: false;
60
- readonly description: '"';
61
- }];
62
- }];
63
- };
64
- export type QueriesMetadata = typeof queriesMetadata;
@@ -1,72 +0,0 @@
1
- //#region src/v1alpha1/metadata.gen.ts
2
- const queriesMetadata = {
3
- namespace: "searchdb",
4
- version: "v1alpha1",
5
- folderName: "searchdbv1alpha1",
6
- services: [{
7
- apiClass: "API",
8
- methods: [
9
- {
10
- methodName: "getDeployment",
11
- protoName: "GetDeployment",
12
- paramsType: "GetDeploymentRequest",
13
- returnType: "Deployment",
14
- isList: false,
15
- paginationType: "none",
16
- isPrivate: false,
17
- description: "\"",
18
- hasWaiter: true
19
- },
20
- {
21
- methodName: "listDeployments",
22
- protoName: "ListDeployments",
23
- paramsType: "ListDeploymentsRequest",
24
- returnType: "ListDeploymentsResponse",
25
- isList: true,
26
- paginationType: "offset",
27
- pageParamKey: "page",
28
- listItemType: "Deployment",
29
- isPrivate: false,
30
- description: "\""
31
- },
32
- {
33
- methodName: "listVersions",
34
- protoName: "ListVersions",
35
- paramsType: "ListVersionsRequest",
36
- returnType: "ListVersionsResponse",
37
- isList: true,
38
- paginationType: "offset",
39
- pageParamKey: "page",
40
- listItemType: "Version",
41
- isPrivate: false,
42
- description: "\""
43
- },
44
- {
45
- methodName: "listNodeTypes",
46
- protoName: "ListNodeTypes",
47
- paramsType: "ListNodeTypesRequest",
48
- returnType: "ListNodeTypesResponse",
49
- isList: true,
50
- paginationType: "offset",
51
- pageParamKey: "page",
52
- listItemType: "NodeType",
53
- isPrivate: false,
54
- description: "\""
55
- },
56
- {
57
- methodName: "listUsers",
58
- protoName: "ListUsers",
59
- paramsType: "ListUsersRequest",
60
- returnType: "ListUsersResponse",
61
- isList: true,
62
- paginationType: "offset",
63
- pageParamKey: "page",
64
- listItemType: "User",
65
- isPrivate: false,
66
- description: "\""
67
- }
68
- ]
69
- }]
70
- };
71
- //#endregion
72
- export { queriesMetadata };