@scaleway/sdk-annotations 1.0.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.
- package/README.md +96 -0
- package/dist/.vite/license.md +3 -0
- package/dist/_virtual/_rolldown/runtime.js +13 -0
- package/dist/index.gen.d.ts +5 -0
- package/dist/index.gen.js +2 -0
- package/dist/metadata.gen.d.ts +12 -0
- package/dist/metadata.gen.js +13 -0
- package/dist/v1/api.gen.d.ts +135 -0
- package/dist/v1/api.gen.js +102 -0
- package/dist/v1/index.gen.d.ts +4 -0
- package/dist/v1/index.gen.js +26 -0
- package/dist/v1/marshalling.gen.d.ts +17 -0
- package/dist/v1/marshalling.gen.js +120 -0
- package/dist/v1/metadata.gen.d.ts +70 -0
- package/dist/v1/metadata.gen.js +79 -0
- package/dist/v1/types.gen.d.ts +334 -0
- package/dist/v1/types.gen.js +0 -0
- package/dist/v1/validation-rules.gen.d.ts +67 -0
- package/dist/v1/validation-rules.gen.js +66 -0
- package/package.json +53 -0
package/README.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# @scaleway/sdk-annotations
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@scaleway/sdk-annotations)
|
|
4
|
+
[](https://www.npmjs.com/package/@scaleway/sdk-annotations)
|
|
5
|
+
[](https://github.com/scaleway/scaleway-sdk-js/blob/master/LICENSE)
|
|
6
|
+
|
|
7
|
+
Scaleway SDK for Annotations API.
|
|
8
|
+
|
|
9
|
+
> **Note**
|
|
10
|
+
> This is an automatically generated package that is part of the [Scaleway SDK for JavaScript](https://github.com/scaleway/scaleway-sdk-js).
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install @scaleway/sdk-annotations @scaleway/sdk-client
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
or with pnpm:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
pnpm add @scaleway/sdk-annotations @scaleway/sdk-client
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
or with yarn:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
yarn add @scaleway/sdk-annotations @scaleway/sdk-client
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Getting Started
|
|
31
|
+
|
|
32
|
+
You'll need a pair of access and secret keys to connect to Scaleway API. Please check the [documentation](https://www.scaleway.com/en/docs/identity-and-access-management/iam/how-to/create-api-keys/) on how to retrieve them.
|
|
33
|
+
|
|
34
|
+
### Basic Usage
|
|
35
|
+
|
|
36
|
+
```typescript
|
|
37
|
+
import { createClient } from '@scaleway/sdk-client'
|
|
38
|
+
import { Annotations } from '@scaleway/sdk-annotations'
|
|
39
|
+
|
|
40
|
+
const client = createClient({
|
|
41
|
+
accessKey: 'SCWXXXXXXXXXXXXXXXXX',
|
|
42
|
+
secretKey: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
|
|
43
|
+
defaultProjectId: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
|
|
44
|
+
defaultRegion: 'fr-par',
|
|
45
|
+
defaultZone: 'fr-par-1',
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
const api = new Annotations.v1.API(client)
|
|
49
|
+
|
|
50
|
+
// Use the API
|
|
51
|
+
// Example: await api.listServers()
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Using Configuration Loader
|
|
55
|
+
|
|
56
|
+
For a simpler setup, you can load credentials from the configuration file or environment variables:
|
|
57
|
+
|
|
58
|
+
```typescript
|
|
59
|
+
import { createClient } from '@scaleway/sdk-client'
|
|
60
|
+
import { loadProfileFromConfigurationFile } from '@scaleway/configuration-loader'
|
|
61
|
+
import { Annotations } from '@scaleway/sdk-annotations'
|
|
62
|
+
|
|
63
|
+
const profile = loadProfileFromConfigurationFile()
|
|
64
|
+
const client = createClient(profile)
|
|
65
|
+
const api = new Annotations.v1.API(client)
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Documentation
|
|
69
|
+
|
|
70
|
+
- 📚 [Scaleway SDK Reference Documentation](https://scaleway.github.io/scaleway-sdk-js)
|
|
71
|
+
- 🌐 [Scaleway Annotations API Documentation](https://www.scaleway.com/en/developers/api/annotations/)
|
|
72
|
+
- 📖 [Main Repository](https://github.com/scaleway/scaleway-sdk-js)
|
|
73
|
+
- 💡 [Example Projects](https://github.com/scaleway/scaleway-sdk-js/tree/master/examples)
|
|
74
|
+
|
|
75
|
+
## Features
|
|
76
|
+
|
|
77
|
+
- ✅ Full TypeScript support with complete type definitions
|
|
78
|
+
- ✅ Promise-based API
|
|
79
|
+
- ✅ Automatic pagination helpers
|
|
80
|
+
- ✅ Built-in error handling
|
|
81
|
+
- ✅ Compatible with Node.js ≥ 20
|
|
82
|
+
|
|
83
|
+
## Support
|
|
84
|
+
|
|
85
|
+
We love feedback! Feel free to reach us on:
|
|
86
|
+
|
|
87
|
+
- [Scaleway Slack community](https://slack.scaleway.com/) - Join us on [#opensource](https://scaleway-community.slack.com/app_redirect?channel=opensource)
|
|
88
|
+
- [GitHub Issues](https://github.com/scaleway/scaleway-sdk-js/issues)
|
|
89
|
+
|
|
90
|
+
## Contributing
|
|
91
|
+
|
|
92
|
+
This repository is at its early stage and is still in active development. If you are looking for a way to contribute, please read [CONTRIBUTING.md](https://github.com/scaleway/scaleway-sdk-js/blob/master/CONTRIBUTING.md).
|
|
93
|
+
|
|
94
|
+
## License
|
|
95
|
+
|
|
96
|
+
This project is Apache 2.0 licensed. See the [LICENSE](https://github.com/scaleway/scaleway-sdk-js/blob/master/LICENSE) file for details.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __exportAll = (all, no_symbols) => {
|
|
4
|
+
let target = {};
|
|
5
|
+
for (var name in all) __defProp(target, name, {
|
|
6
|
+
get: all[name],
|
|
7
|
+
enumerable: true
|
|
8
|
+
});
|
|
9
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
10
|
+
return target;
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { __exportAll };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is automatically generated
|
|
3
|
+
* PLEASE DO NOT EDIT HERE
|
|
4
|
+
*/
|
|
5
|
+
export declare const pkgMetadata: {
|
|
6
|
+
readonly name: "@scaleway/sdk-annotations";
|
|
7
|
+
readonly namespace: "annotations";
|
|
8
|
+
readonly displayName: "Annotations";
|
|
9
|
+
readonly versions: readonly ["v1"];
|
|
10
|
+
};
|
|
11
|
+
export type Metadata = typeof pkgMetadata;
|
|
12
|
+
export default pkgMetadata;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region src/metadata.gen.ts
|
|
2
|
+
/**
|
|
3
|
+
* This file is automatically generated
|
|
4
|
+
* PLEASE DO NOT EDIT HERE
|
|
5
|
+
*/
|
|
6
|
+
const pkgMetadata = {
|
|
7
|
+
name: "@scaleway/sdk-annotations",
|
|
8
|
+
namespace: "annotations",
|
|
9
|
+
displayName: "Annotations",
|
|
10
|
+
versions: ["v1"]
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { pkgMetadata as default, pkgMetadata };
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { API as ParentAPI } from '@scaleway/sdk-client';
|
|
2
|
+
import type { Binding, CreateBindingRequest, CreateKeyRequest, CreateValueRequest, DeleteAllBindingsMatchingSRNRequest, DeleteAllBindingsMatchingSRNResponse, DeleteAllBindingsMatchingValueRequest, DeleteAllBindingsMatchingValueResponse, DeleteAllValuesMatchingKeyRequest, DeleteAllValuesMatchingKeyResponse, DeleteBindingRequest, DeleteKeyRequest, DeleteValueRequest, GetKeyRequest, GetValueRequest, Key, ListAllKeysAndValuesRequest, ListAllKeysAndValuesResponse, ListBindingsRequest, ListBindingsResponse, ListKeysRequest, ListKeysResponse, ListValuesRequest, ListValuesResponse, UpdateKeyRequest, UpdateValueRequest, Value } from './types.gen.js';
|
|
3
|
+
/**
|
|
4
|
+
* Annotations API.
|
|
5
|
+
*/
|
|
6
|
+
export declare class API extends ParentAPI {
|
|
7
|
+
/**
|
|
8
|
+
* Create an annotation key.. Create an annotation key.
|
|
9
|
+
*
|
|
10
|
+
* @param request - The request {@link CreateKeyRequest}
|
|
11
|
+
* @returns A Promise of Key
|
|
12
|
+
*/
|
|
13
|
+
createKey: (request: Readonly<CreateKeyRequest>) => Promise<Key>;
|
|
14
|
+
protected pageOfListKeys: (request?: Readonly<ListKeysRequest>) => Promise<ListKeysResponse>;
|
|
15
|
+
/**
|
|
16
|
+
* List of keys.. List of keys.
|
|
17
|
+
*
|
|
18
|
+
* @param request - The request {@link ListKeysRequest}
|
|
19
|
+
* @returns A Promise of ListKeysResponse
|
|
20
|
+
*/
|
|
21
|
+
listKeys: (request?: Readonly<ListKeysRequest>) => Promise<ListKeysResponse> & {
|
|
22
|
+
all: () => Promise<Key[]>;
|
|
23
|
+
[Symbol.asyncIterator]: () => AsyncGenerator<Key[], void, void>;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Retrieve a specific key.. Retrieve a specific key.
|
|
27
|
+
*
|
|
28
|
+
* @param request - The request {@link GetKeyRequest}
|
|
29
|
+
* @returns A Promise of Key
|
|
30
|
+
*/
|
|
31
|
+
getKey: (request: Readonly<GetKeyRequest>) => Promise<Key>;
|
|
32
|
+
/**
|
|
33
|
+
* Update name or description. All associated resources will immediately display the new name.. Update name or description. All associated resources will immediately display the new name.
|
|
34
|
+
*
|
|
35
|
+
* @param request - The request {@link UpdateKeyRequest}
|
|
36
|
+
* @returns A Promise of Key
|
|
37
|
+
*/
|
|
38
|
+
updateKey: (request: Readonly<UpdateKeyRequest>) => Promise<Key>;
|
|
39
|
+
/**
|
|
40
|
+
* Delete a key definition. Fails if the key has any associated values.. Delete a key definition. Fails if the key has any associated values.
|
|
41
|
+
*
|
|
42
|
+
* @param request - The request {@link DeleteKeyRequest}
|
|
43
|
+
*/
|
|
44
|
+
deleteKey: (request: Readonly<DeleteKeyRequest>) => Promise<void>;
|
|
45
|
+
/**
|
|
46
|
+
* Add a value definition to a key.. Add a value definition to a key.
|
|
47
|
+
*
|
|
48
|
+
* @param request - The request {@link CreateValueRequest}
|
|
49
|
+
* @returns A Promise of Value
|
|
50
|
+
*/
|
|
51
|
+
createValue: (request: Readonly<CreateValueRequest>) => Promise<Value>;
|
|
52
|
+
protected pageOfListValues: (request?: Readonly<ListValuesRequest>) => Promise<ListValuesResponse>;
|
|
53
|
+
/**
|
|
54
|
+
* List all values for a key, sorted alphabetically by name.. List all values for a key, sorted alphabetically by name.
|
|
55
|
+
*
|
|
56
|
+
* @param request - The request {@link ListValuesRequest}
|
|
57
|
+
* @returns A Promise of ListValuesResponse
|
|
58
|
+
*/
|
|
59
|
+
listValues: (request?: Readonly<ListValuesRequest>) => Promise<ListValuesResponse> & {
|
|
60
|
+
all: () => Promise<Value[]>;
|
|
61
|
+
[Symbol.asyncIterator]: () => AsyncGenerator<Value[], void, void>;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Retrieve a specific value.. Retrieve a specific value.
|
|
65
|
+
*
|
|
66
|
+
* @param request - The request {@link GetValueRequest}
|
|
67
|
+
* @returns A Promise of Value
|
|
68
|
+
*/
|
|
69
|
+
getValue: (request: Readonly<GetValueRequest>) => Promise<Value>;
|
|
70
|
+
/**
|
|
71
|
+
* Update name or description. Global update.. Update name or description. Global update.
|
|
72
|
+
*
|
|
73
|
+
* @param request - The request {@link UpdateValueRequest}
|
|
74
|
+
* @returns A Promise of Value
|
|
75
|
+
*/
|
|
76
|
+
updateValue: (request: Readonly<UpdateValueRequest>) => Promise<Value>;
|
|
77
|
+
/**
|
|
78
|
+
* Delete a value definition. Fails if the value is currently bound to any resource.. Delete a value definition. Fails if the value is currently bound to any resource.
|
|
79
|
+
*
|
|
80
|
+
* @param request - The request {@link DeleteValueRequest}
|
|
81
|
+
*/
|
|
82
|
+
deleteValue: (request: Readonly<DeleteValueRequest>) => Promise<void>;
|
|
83
|
+
/**
|
|
84
|
+
* Delete ALL values associated with a key. Fails if any of these values are currently bound to any resource.. Delete ALL values associated with a key. Fails if any of these values are currently bound to any resource.
|
|
85
|
+
*
|
|
86
|
+
* @param request - The request {@link DeleteAllValuesMatchingKeyRequest}
|
|
87
|
+
* @returns A Promise of DeleteAllValuesMatchingKeyResponse
|
|
88
|
+
*/
|
|
89
|
+
deleteAllValuesMatchingKey: (request: Readonly<DeleteAllValuesMatchingKeyRequest>) => Promise<DeleteAllValuesMatchingKeyResponse>;
|
|
90
|
+
/**
|
|
91
|
+
* List all keys and values for an organization, sorted alphabetically by key name and value name.. List all keys and values for an organization, sorted alphabetically by key name and value name.
|
|
92
|
+
*
|
|
93
|
+
* @param request - The request {@link ListAllKeysAndValuesRequest}
|
|
94
|
+
* @returns A Promise of ListAllKeysAndValuesResponse
|
|
95
|
+
*/
|
|
96
|
+
listAllKeysAndValues: (request?: Readonly<ListAllKeysAndValuesRequest>) => Promise<ListAllKeysAndValuesResponse>;
|
|
97
|
+
/**
|
|
98
|
+
* Attach a value to a resource. Fails if the resource already has a value for this key.. Attach a value to a resource. Fails if the resource already has a value for this key.
|
|
99
|
+
*
|
|
100
|
+
* @param request - The request {@link CreateBindingRequest}
|
|
101
|
+
* @returns A Promise of Binding
|
|
102
|
+
*/
|
|
103
|
+
createBinding: (request: Readonly<CreateBindingRequest>) => Promise<Binding>;
|
|
104
|
+
protected pageOfListBindings: (request?: Readonly<ListBindingsRequest>) => Promise<ListBindingsResponse>;
|
|
105
|
+
/**
|
|
106
|
+
* List all bindings, or filter by Scaleway Resource Number or value ID. Response order by ID.. List all bindings, or filter by Scaleway Resource Number or value ID. Response order by ID.
|
|
107
|
+
*
|
|
108
|
+
* @param request - The request {@link ListBindingsRequest}
|
|
109
|
+
* @returns A Promise of ListBindingsResponse
|
|
110
|
+
*/
|
|
111
|
+
listBindings: (request?: Readonly<ListBindingsRequest>) => Promise<ListBindingsResponse> & {
|
|
112
|
+
all: () => Promise<Binding[]>;
|
|
113
|
+
[Symbol.asyncIterator]: () => AsyncGenerator<Binding[], void, void>;
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* Detach an annotation from a resource.. Detach an annotation from a resource.
|
|
117
|
+
*
|
|
118
|
+
* @param request - The request {@link DeleteBindingRequest}
|
|
119
|
+
*/
|
|
120
|
+
deleteBinding: (request: Readonly<DeleteBindingRequest>) => Promise<void>;
|
|
121
|
+
/**
|
|
122
|
+
* Delete ALL bindings associated with a value.. Delete ALL bindings associated with a value.
|
|
123
|
+
*
|
|
124
|
+
* @param request - The request {@link DeleteAllBindingsMatchingValueRequest}
|
|
125
|
+
* @returns A Promise of DeleteAllBindingsMatchingValueResponse
|
|
126
|
+
*/
|
|
127
|
+
deleteAllBindingsMatchingValue: (request: Readonly<DeleteAllBindingsMatchingValueRequest>) => Promise<DeleteAllBindingsMatchingValueResponse>;
|
|
128
|
+
/**
|
|
129
|
+
* Delete ALL bindings associated with a Scaleway Resource Number.. Delete ALL bindings associated with a Scaleway Resource Number.
|
|
130
|
+
*
|
|
131
|
+
* @param request - The request {@link DeleteAllBindingsMatchingSRNRequest}
|
|
132
|
+
* @returns A Promise of DeleteAllBindingsMatchingSRNResponse
|
|
133
|
+
*/
|
|
134
|
+
deleteAllBindingsMatchingSRN: (request: Readonly<DeleteAllBindingsMatchingSRNRequest>) => Promise<DeleteAllBindingsMatchingSRNResponse>;
|
|
135
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { marshalCreateBindingRequest, marshalCreateKeyRequest, marshalCreateValueRequest, marshalUpdateKeyRequest, marshalUpdateValueRequest, unmarshalBinding, unmarshalDeleteAllBindingsMatchingSRNResponse, unmarshalDeleteAllBindingsMatchingValueResponse, unmarshalDeleteAllValuesMatchingKeyResponse, unmarshalKey, unmarshalListAllKeysAndValuesResponse, unmarshalListBindingsResponse, unmarshalListKeysResponse, unmarshalListValuesResponse, unmarshalValue } from "./marshalling.gen.js";
|
|
2
|
+
import { API as API$1, enrichForPagination, urlParams, validatePathParam } from "@scaleway/sdk-client";
|
|
3
|
+
//#region src/v1/api.gen.ts
|
|
4
|
+
const jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
|
|
5
|
+
/**
|
|
6
|
+
* Annotations API.
|
|
7
|
+
*/
|
|
8
|
+
var API = class extends API$1 {
|
|
9
|
+
constructor(..._args) {
|
|
10
|
+
super(..._args);
|
|
11
|
+
this.createKey = (request) => this.client.fetch({
|
|
12
|
+
body: JSON.stringify(marshalCreateKeyRequest(request, this.client.settings)),
|
|
13
|
+
headers: jsonContentHeaders,
|
|
14
|
+
method: "POST",
|
|
15
|
+
path: `/annotations/v1/keys`
|
|
16
|
+
}, unmarshalKey);
|
|
17
|
+
this.pageOfListKeys = (request = {}) => this.client.fetch({
|
|
18
|
+
method: "GET",
|
|
19
|
+
path: `/annotations/v1/keys`,
|
|
20
|
+
urlParams: urlParams(["organization_id", request.organizationId ?? this.client.settings.defaultOrganizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
|
|
21
|
+
}, unmarshalListKeysResponse);
|
|
22
|
+
this.listKeys = (request = {}) => enrichForPagination("keys", this.pageOfListKeys, request);
|
|
23
|
+
this.getKey = (request) => this.client.fetch({
|
|
24
|
+
method: "GET",
|
|
25
|
+
path: `/annotations/v1/keys/${validatePathParam("keyId", request.keyId)}`
|
|
26
|
+
}, unmarshalKey);
|
|
27
|
+
this.updateKey = (request) => this.client.fetch({
|
|
28
|
+
body: JSON.stringify(marshalUpdateKeyRequest(request, this.client.settings)),
|
|
29
|
+
headers: jsonContentHeaders,
|
|
30
|
+
method: "PATCH",
|
|
31
|
+
path: `/annotations/v1/keys/${validatePathParam("keyId", request.keyId)}`
|
|
32
|
+
}, unmarshalKey);
|
|
33
|
+
this.deleteKey = (request) => this.client.fetch({
|
|
34
|
+
method: "DELETE",
|
|
35
|
+
path: `/annotations/v1/keys/${validatePathParam("keyId", request.keyId)}`
|
|
36
|
+
});
|
|
37
|
+
this.createValue = (request) => this.client.fetch({
|
|
38
|
+
body: JSON.stringify(marshalCreateValueRequest(request, this.client.settings)),
|
|
39
|
+
headers: jsonContentHeaders,
|
|
40
|
+
method: "POST",
|
|
41
|
+
path: `/annotations/v1/values`
|
|
42
|
+
}, unmarshalValue);
|
|
43
|
+
this.pageOfListValues = (request = {}) => this.client.fetch({
|
|
44
|
+
method: "GET",
|
|
45
|
+
path: `/annotations/v1/values`,
|
|
46
|
+
urlParams: urlParams(["key_id", request.keyId], ["organization_id", request.organizationId ?? this.client.settings.defaultOrganizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
|
|
47
|
+
}, unmarshalListValuesResponse);
|
|
48
|
+
this.listValues = (request = {}) => enrichForPagination("values", this.pageOfListValues, request);
|
|
49
|
+
this.getValue = (request) => this.client.fetch({
|
|
50
|
+
method: "GET",
|
|
51
|
+
path: `/annotations/v1/values/${validatePathParam("valueId", request.valueId)}`
|
|
52
|
+
}, unmarshalValue);
|
|
53
|
+
this.updateValue = (request) => this.client.fetch({
|
|
54
|
+
body: JSON.stringify(marshalUpdateValueRequest(request, this.client.settings)),
|
|
55
|
+
headers: jsonContentHeaders,
|
|
56
|
+
method: "PATCH",
|
|
57
|
+
path: `/annotations/v1/values/${validatePathParam("valueId", request.valueId)}`
|
|
58
|
+
}, unmarshalValue);
|
|
59
|
+
this.deleteValue = (request) => this.client.fetch({
|
|
60
|
+
method: "DELETE",
|
|
61
|
+
path: `/annotations/v1/values/${validatePathParam("valueId", request.valueId)}`
|
|
62
|
+
});
|
|
63
|
+
this.deleteAllValuesMatchingKey = (request) => this.client.fetch({
|
|
64
|
+
method: "DELETE",
|
|
65
|
+
path: `/annotations/v1/values/delete-all-matching-key`,
|
|
66
|
+
urlParams: urlParams(["key_id", request.keyId])
|
|
67
|
+
}, unmarshalDeleteAllValuesMatchingKeyResponse);
|
|
68
|
+
this.listAllKeysAndValues = (request = {}) => this.client.fetch({
|
|
69
|
+
method: "GET",
|
|
70
|
+
path: `/annotations/v1/all-keys-and-values`,
|
|
71
|
+
urlParams: urlParams(["organization_id", request.organizationId ?? this.client.settings.defaultOrganizationId])
|
|
72
|
+
}, unmarshalListAllKeysAndValuesResponse);
|
|
73
|
+
this.createBinding = (request) => this.client.fetch({
|
|
74
|
+
body: JSON.stringify(marshalCreateBindingRequest(request, this.client.settings)),
|
|
75
|
+
headers: jsonContentHeaders,
|
|
76
|
+
method: "POST",
|
|
77
|
+
path: `/annotations/v1/bindings`
|
|
78
|
+
}, unmarshalBinding);
|
|
79
|
+
this.pageOfListBindings = (request = {}) => this.client.fetch({
|
|
80
|
+
method: "GET",
|
|
81
|
+
path: `/annotations/v1/bindings`,
|
|
82
|
+
urlParams: urlParams(["organization_id", request.organizationId ?? this.client.settings.defaultOrganizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["srn", request.srn], ["value_id", request.valueId])
|
|
83
|
+
}, unmarshalListBindingsResponse);
|
|
84
|
+
this.listBindings = (request = {}) => enrichForPagination("bindings", this.pageOfListBindings, request);
|
|
85
|
+
this.deleteBinding = (request) => this.client.fetch({
|
|
86
|
+
method: "DELETE",
|
|
87
|
+
path: `/annotations/v1/bindings/${validatePathParam("bindingId", request.bindingId)}`
|
|
88
|
+
});
|
|
89
|
+
this.deleteAllBindingsMatchingValue = (request) => this.client.fetch({
|
|
90
|
+
method: "DELETE",
|
|
91
|
+
path: `/annotations/v1/bindings/delete-all-matching-value`,
|
|
92
|
+
urlParams: urlParams(["value_id", request.valueId])
|
|
93
|
+
}, unmarshalDeleteAllBindingsMatchingValueResponse);
|
|
94
|
+
this.deleteAllBindingsMatchingSRN = (request) => this.client.fetch({
|
|
95
|
+
method: "DELETE",
|
|
96
|
+
path: `/annotations/v1/bindings/delete-all-matching-srn`,
|
|
97
|
+
urlParams: urlParams(["organization_id", request.organizationId ?? this.client.settings.defaultOrganizationId], ["srn", request.srn])
|
|
98
|
+
}, unmarshalDeleteAllBindingsMatchingSRNResponse);
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
//#endregion
|
|
102
|
+
export { API };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { API, } from './api.gen.js';
|
|
2
|
+
export * from './marshalling.gen.js';
|
|
3
|
+
export type { Binding, BindingKey, BindingValue, CreateBindingRequest, CreateKeyRequest, CreateValueRequest, DeleteAllBindingsMatchingSRNRequest, DeleteAllBindingsMatchingSRNResponse, DeleteAllBindingsMatchingValueRequest, DeleteAllBindingsMatchingValueResponse, DeleteAllValuesMatchingKeyRequest, DeleteAllValuesMatchingKeyResponse, DeleteBindingRequest, DeleteKeyRequest, DeleteValueRequest, GetKeyRequest, GetValueRequest, Key, ListAllKeysAndValuesRequest, ListAllKeysAndValuesResponse, ListAllKeysAndValuesResponseKey, ListAllKeysAndValuesResponseValue, ListBindingsRequest, ListBindingsResponse, ListKeysRequest, ListKeysResponse, ListValuesRequest, ListValuesResponse, UpdateKeyRequest, UpdateValueRequest, Value, } from './types.gen.js';
|
|
4
|
+
export * as ValidationRules from './validation-rules.gen.js';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { marshalCreateBindingRequest, marshalCreateKeyRequest, marshalCreateValueRequest, marshalUpdateKeyRequest, marshalUpdateValueRequest, unmarshalBinding, unmarshalDeleteAllBindingsMatchingSRNResponse, unmarshalDeleteAllBindingsMatchingValueResponse, unmarshalDeleteAllValuesMatchingKeyResponse, unmarshalKey, unmarshalListAllKeysAndValuesResponse, unmarshalListBindingsResponse, unmarshalListKeysResponse, unmarshalListValuesResponse, unmarshalValue } from "./marshalling.gen.js";
|
|
3
|
+
import { API } from "./api.gen.js";
|
|
4
|
+
import { validation_rules_gen_exports } from "./validation-rules.gen.js";
|
|
5
|
+
//#region src/v1/index.gen.ts
|
|
6
|
+
var index_gen_exports = /* @__PURE__ */ __exportAll({
|
|
7
|
+
API: () => API,
|
|
8
|
+
ValidationRules: () => validation_rules_gen_exports,
|
|
9
|
+
marshalCreateBindingRequest: () => marshalCreateBindingRequest,
|
|
10
|
+
marshalCreateKeyRequest: () => marshalCreateKeyRequest,
|
|
11
|
+
marshalCreateValueRequest: () => marshalCreateValueRequest,
|
|
12
|
+
marshalUpdateKeyRequest: () => marshalUpdateKeyRequest,
|
|
13
|
+
marshalUpdateValueRequest: () => marshalUpdateValueRequest,
|
|
14
|
+
unmarshalBinding: () => unmarshalBinding,
|
|
15
|
+
unmarshalDeleteAllBindingsMatchingSRNResponse: () => unmarshalDeleteAllBindingsMatchingSRNResponse,
|
|
16
|
+
unmarshalDeleteAllBindingsMatchingValueResponse: () => unmarshalDeleteAllBindingsMatchingValueResponse,
|
|
17
|
+
unmarshalDeleteAllValuesMatchingKeyResponse: () => unmarshalDeleteAllValuesMatchingKeyResponse,
|
|
18
|
+
unmarshalKey: () => unmarshalKey,
|
|
19
|
+
unmarshalListAllKeysAndValuesResponse: () => unmarshalListAllKeysAndValuesResponse,
|
|
20
|
+
unmarshalListBindingsResponse: () => unmarshalListBindingsResponse,
|
|
21
|
+
unmarshalListKeysResponse: () => unmarshalListKeysResponse,
|
|
22
|
+
unmarshalListValuesResponse: () => unmarshalListValuesResponse,
|
|
23
|
+
unmarshalValue: () => unmarshalValue
|
|
24
|
+
});
|
|
25
|
+
//#endregion
|
|
26
|
+
export { API, validation_rules_gen_exports as ValidationRules, index_gen_exports, marshalCreateBindingRequest, marshalCreateKeyRequest, marshalCreateValueRequest, marshalUpdateKeyRequest, marshalUpdateValueRequest, unmarshalBinding, unmarshalDeleteAllBindingsMatchingSRNResponse, unmarshalDeleteAllBindingsMatchingValueResponse, unmarshalDeleteAllValuesMatchingKeyResponse, unmarshalKey, unmarshalListAllKeysAndValuesResponse, unmarshalListBindingsResponse, unmarshalListKeysResponse, unmarshalListValuesResponse, unmarshalValue };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { DefaultValues } from '@scaleway/sdk-client';
|
|
2
|
+
import type { Binding, Key, Value, DeleteAllBindingsMatchingSRNResponse, DeleteAllBindingsMatchingValueResponse, DeleteAllValuesMatchingKeyResponse, ListAllKeysAndValuesResponse, ListBindingsResponse, ListKeysResponse, ListValuesResponse, CreateBindingRequest, CreateKeyRequest, CreateValueRequest, UpdateKeyRequest, UpdateValueRequest } from './types.gen.js';
|
|
3
|
+
export declare const unmarshalBinding: (data: unknown) => Binding;
|
|
4
|
+
export declare const unmarshalKey: (data: unknown) => Key;
|
|
5
|
+
export declare const unmarshalValue: (data: unknown) => Value;
|
|
6
|
+
export declare const unmarshalDeleteAllBindingsMatchingSRNResponse: (data: unknown) => DeleteAllBindingsMatchingSRNResponse;
|
|
7
|
+
export declare const unmarshalDeleteAllBindingsMatchingValueResponse: (data: unknown) => DeleteAllBindingsMatchingValueResponse;
|
|
8
|
+
export declare const unmarshalDeleteAllValuesMatchingKeyResponse: (data: unknown) => DeleteAllValuesMatchingKeyResponse;
|
|
9
|
+
export declare const unmarshalListAllKeysAndValuesResponse: (data: unknown) => ListAllKeysAndValuesResponse;
|
|
10
|
+
export declare const unmarshalListBindingsResponse: (data: unknown) => ListBindingsResponse;
|
|
11
|
+
export declare const unmarshalListKeysResponse: (data: unknown) => ListKeysResponse;
|
|
12
|
+
export declare const unmarshalListValuesResponse: (data: unknown) => ListValuesResponse;
|
|
13
|
+
export declare const marshalCreateBindingRequest: (request: CreateBindingRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
14
|
+
export declare const marshalCreateKeyRequest: (request: CreateKeyRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
15
|
+
export declare const marshalCreateValueRequest: (request: CreateValueRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
16
|
+
export declare const marshalUpdateKeyRequest: (request: UpdateKeyRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
17
|
+
export declare const marshalUpdateValueRequest: (request: UpdateValueRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { isJSONObject, unmarshalArrayOfObject } from "@scaleway/sdk-client";
|
|
2
|
+
//#region src/v1/marshalling.gen.ts
|
|
3
|
+
const unmarshalBindingKey = (data) => {
|
|
4
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'BindingKey' failed as data isn't a dictionary.`);
|
|
5
|
+
return {
|
|
6
|
+
id: data.id,
|
|
7
|
+
name: data.name
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
const unmarshalBindingValue = (data) => {
|
|
11
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'BindingValue' failed as data isn't a dictionary.`);
|
|
12
|
+
return {
|
|
13
|
+
id: data.id,
|
|
14
|
+
name: data.name
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
const unmarshalBinding = (data) => {
|
|
18
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Binding' failed as data isn't a dictionary.`);
|
|
19
|
+
return {
|
|
20
|
+
id: data.id,
|
|
21
|
+
key: data.key ? unmarshalBindingKey(data.key) : void 0,
|
|
22
|
+
srn: data.srn,
|
|
23
|
+
value: data.value ? unmarshalBindingValue(data.value) : void 0
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
const unmarshalKey = (data) => {
|
|
27
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Key' failed as data isn't a dictionary.`);
|
|
28
|
+
return {
|
|
29
|
+
description: data.description,
|
|
30
|
+
id: data.id,
|
|
31
|
+
name: data.name
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
const unmarshalValue = (data) => {
|
|
35
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Value' failed as data isn't a dictionary.`);
|
|
36
|
+
return {
|
|
37
|
+
description: data.description,
|
|
38
|
+
id: data.id,
|
|
39
|
+
keyId: data.key_id,
|
|
40
|
+
name: data.name
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
const unmarshalDeleteAllBindingsMatchingSRNResponse = (data) => {
|
|
44
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'DeleteAllBindingsMatchingSRNResponse' failed as data isn't a dictionary.`);
|
|
45
|
+
return { totalDeleted: data.total_deleted };
|
|
46
|
+
};
|
|
47
|
+
const unmarshalDeleteAllBindingsMatchingValueResponse = (data) => {
|
|
48
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'DeleteAllBindingsMatchingValueResponse' failed as data isn't a dictionary.`);
|
|
49
|
+
return { totalDeleted: data.total_deleted };
|
|
50
|
+
};
|
|
51
|
+
const unmarshalDeleteAllValuesMatchingKeyResponse = (data) => {
|
|
52
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'DeleteAllValuesMatchingKeyResponse' failed as data isn't a dictionary.`);
|
|
53
|
+
return { totalDeleted: data.total_deleted };
|
|
54
|
+
};
|
|
55
|
+
const unmarshalListAllKeysAndValuesResponseValue = (data) => {
|
|
56
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListAllKeysAndValuesResponseValue' failed as data isn't a dictionary.`);
|
|
57
|
+
return {
|
|
58
|
+
description: data.description,
|
|
59
|
+
id: data.id,
|
|
60
|
+
name: data.name
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
const unmarshalListAllKeysAndValuesResponseKey = (data) => {
|
|
64
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListAllKeysAndValuesResponseKey' failed as data isn't a dictionary.`);
|
|
65
|
+
return {
|
|
66
|
+
description: data.description,
|
|
67
|
+
id: data.id,
|
|
68
|
+
name: data.name,
|
|
69
|
+
values: unmarshalArrayOfObject(data.values, unmarshalListAllKeysAndValuesResponseValue)
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
const unmarshalListAllKeysAndValuesResponse = (data) => {
|
|
73
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListAllKeysAndValuesResponse' failed as data isn't a dictionary.`);
|
|
74
|
+
return { keys: unmarshalArrayOfObject(data.keys, unmarshalListAllKeysAndValuesResponseKey) };
|
|
75
|
+
};
|
|
76
|
+
const unmarshalListBindingsResponse = (data) => {
|
|
77
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListBindingsResponse' failed as data isn't a dictionary.`);
|
|
78
|
+
return {
|
|
79
|
+
bindings: unmarshalArrayOfObject(data.bindings, unmarshalBinding),
|
|
80
|
+
totalCount: data.total_count
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
const unmarshalListKeysResponse = (data) => {
|
|
84
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListKeysResponse' failed as data isn't a dictionary.`);
|
|
85
|
+
return {
|
|
86
|
+
keys: unmarshalArrayOfObject(data.keys, unmarshalKey),
|
|
87
|
+
totalCount: data.total_count
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
const unmarshalListValuesResponse = (data) => {
|
|
91
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListValuesResponse' failed as data isn't a dictionary.`);
|
|
92
|
+
return {
|
|
93
|
+
totalCount: data.total_count,
|
|
94
|
+
values: unmarshalArrayOfObject(data.values, unmarshalValue)
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
const marshalCreateBindingRequest = (request, defaults) => ({
|
|
98
|
+
srn: request.srn,
|
|
99
|
+
value_id: request.valueId
|
|
100
|
+
});
|
|
101
|
+
const marshalCreateKeyRequest = (request, defaults) => ({
|
|
102
|
+
description: request.description,
|
|
103
|
+
name: request.name,
|
|
104
|
+
organization_id: request.organizationId ?? defaults.defaultOrganizationId
|
|
105
|
+
});
|
|
106
|
+
const marshalCreateValueRequest = (request, defaults) => ({
|
|
107
|
+
description: request.description,
|
|
108
|
+
key_id: request.keyId,
|
|
109
|
+
name: request.name
|
|
110
|
+
});
|
|
111
|
+
const marshalUpdateKeyRequest = (request, defaults) => ({
|
|
112
|
+
description: request.description,
|
|
113
|
+
name: request.name
|
|
114
|
+
});
|
|
115
|
+
const marshalUpdateValueRequest = (request, defaults) => ({
|
|
116
|
+
description: request.description,
|
|
117
|
+
name: request.name
|
|
118
|
+
});
|
|
119
|
+
//#endregion
|
|
120
|
+
export { marshalCreateBindingRequest, marshalCreateKeyRequest, marshalCreateValueRequest, marshalUpdateKeyRequest, marshalUpdateValueRequest, unmarshalBinding, unmarshalDeleteAllBindingsMatchingSRNResponse, unmarshalDeleteAllBindingsMatchingValueResponse, unmarshalDeleteAllValuesMatchingKeyResponse, unmarshalKey, unmarshalListAllKeysAndValuesResponse, unmarshalListBindingsResponse, unmarshalListKeysResponse, unmarshalListValuesResponse, unmarshalValue };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export declare const queriesMetadata: {
|
|
2
|
+
readonly namespace: 'annotations';
|
|
3
|
+
readonly version: 'v1';
|
|
4
|
+
readonly folderName: 'annotationsv1';
|
|
5
|
+
readonly services: readonly [{
|
|
6
|
+
readonly apiClass: 'API';
|
|
7
|
+
readonly methods: readonly [{
|
|
8
|
+
readonly methodName: 'listKeys';
|
|
9
|
+
readonly protoName: 'ListKeys';
|
|
10
|
+
readonly paramsType: 'ListKeysRequest';
|
|
11
|
+
readonly returnType: 'ListKeysResponse';
|
|
12
|
+
readonly isList: true;
|
|
13
|
+
readonly paginationType: 'offset';
|
|
14
|
+
readonly pageParamKey: 'page';
|
|
15
|
+
readonly listItemType: 'Key';
|
|
16
|
+
readonly isPrivate: false;
|
|
17
|
+
readonly description: '"';
|
|
18
|
+
}, {
|
|
19
|
+
readonly methodName: 'getKey';
|
|
20
|
+
readonly protoName: 'GetKey';
|
|
21
|
+
readonly paramsType: 'GetKeyRequest';
|
|
22
|
+
readonly returnType: 'Key';
|
|
23
|
+
readonly isList: false;
|
|
24
|
+
readonly paginationType: 'none';
|
|
25
|
+
readonly isPrivate: false;
|
|
26
|
+
readonly description: '"';
|
|
27
|
+
}, {
|
|
28
|
+
readonly methodName: 'listValues';
|
|
29
|
+
readonly protoName: 'ListValues';
|
|
30
|
+
readonly paramsType: 'ListValuesRequest';
|
|
31
|
+
readonly returnType: 'ListValuesResponse';
|
|
32
|
+
readonly isList: true;
|
|
33
|
+
readonly paginationType: 'offset';
|
|
34
|
+
readonly pageParamKey: 'page';
|
|
35
|
+
readonly listItemType: 'Value';
|
|
36
|
+
readonly isPrivate: false;
|
|
37
|
+
readonly description: '"';
|
|
38
|
+
}, {
|
|
39
|
+
readonly methodName: 'getValue';
|
|
40
|
+
readonly protoName: 'GetValue';
|
|
41
|
+
readonly paramsType: 'GetValueRequest';
|
|
42
|
+
readonly returnType: 'Value';
|
|
43
|
+
readonly isList: false;
|
|
44
|
+
readonly paginationType: 'none';
|
|
45
|
+
readonly isPrivate: false;
|
|
46
|
+
readonly description: '"';
|
|
47
|
+
}, {
|
|
48
|
+
readonly methodName: 'listAllKeysAndValues';
|
|
49
|
+
readonly protoName: 'ListAllKeysAndValues';
|
|
50
|
+
readonly paramsType: 'ListAllKeysAndValuesRequest';
|
|
51
|
+
readonly returnType: 'ListAllKeysAndValuesResponse';
|
|
52
|
+
readonly isList: false;
|
|
53
|
+
readonly paginationType: 'none';
|
|
54
|
+
readonly isPrivate: false;
|
|
55
|
+
readonly description: '"';
|
|
56
|
+
}, {
|
|
57
|
+
readonly methodName: 'listBindings';
|
|
58
|
+
readonly protoName: 'ListBindings';
|
|
59
|
+
readonly paramsType: 'ListBindingsRequest';
|
|
60
|
+
readonly returnType: 'ListBindingsResponse';
|
|
61
|
+
readonly isList: true;
|
|
62
|
+
readonly paginationType: 'offset';
|
|
63
|
+
readonly pageParamKey: 'page';
|
|
64
|
+
readonly listItemType: 'Binding';
|
|
65
|
+
readonly isPrivate: false;
|
|
66
|
+
readonly description: '"';
|
|
67
|
+
}];
|
|
68
|
+
}];
|
|
69
|
+
};
|
|
70
|
+
export type QueriesMetadata = typeof queriesMetadata;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
//#region src/v1/metadata.gen.ts
|
|
2
|
+
const queriesMetadata = {
|
|
3
|
+
namespace: "annotations",
|
|
4
|
+
version: "v1",
|
|
5
|
+
folderName: "annotationsv1",
|
|
6
|
+
services: [{
|
|
7
|
+
apiClass: "API",
|
|
8
|
+
methods: [
|
|
9
|
+
{
|
|
10
|
+
methodName: "listKeys",
|
|
11
|
+
protoName: "ListKeys",
|
|
12
|
+
paramsType: "ListKeysRequest",
|
|
13
|
+
returnType: "ListKeysResponse",
|
|
14
|
+
isList: true,
|
|
15
|
+
paginationType: "offset",
|
|
16
|
+
pageParamKey: "page",
|
|
17
|
+
listItemType: "Key",
|
|
18
|
+
isPrivate: false,
|
|
19
|
+
description: "\""
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
methodName: "getKey",
|
|
23
|
+
protoName: "GetKey",
|
|
24
|
+
paramsType: "GetKeyRequest",
|
|
25
|
+
returnType: "Key",
|
|
26
|
+
isList: false,
|
|
27
|
+
paginationType: "none",
|
|
28
|
+
isPrivate: false,
|
|
29
|
+
description: "\""
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
methodName: "listValues",
|
|
33
|
+
protoName: "ListValues",
|
|
34
|
+
paramsType: "ListValuesRequest",
|
|
35
|
+
returnType: "ListValuesResponse",
|
|
36
|
+
isList: true,
|
|
37
|
+
paginationType: "offset",
|
|
38
|
+
pageParamKey: "page",
|
|
39
|
+
listItemType: "Value",
|
|
40
|
+
isPrivate: false,
|
|
41
|
+
description: "\""
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
methodName: "getValue",
|
|
45
|
+
protoName: "GetValue",
|
|
46
|
+
paramsType: "GetValueRequest",
|
|
47
|
+
returnType: "Value",
|
|
48
|
+
isList: false,
|
|
49
|
+
paginationType: "none",
|
|
50
|
+
isPrivate: false,
|
|
51
|
+
description: "\""
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
methodName: "listAllKeysAndValues",
|
|
55
|
+
protoName: "ListAllKeysAndValues",
|
|
56
|
+
paramsType: "ListAllKeysAndValuesRequest",
|
|
57
|
+
returnType: "ListAllKeysAndValuesResponse",
|
|
58
|
+
isList: false,
|
|
59
|
+
paginationType: "none",
|
|
60
|
+
isPrivate: false,
|
|
61
|
+
description: "\""
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
methodName: "listBindings",
|
|
65
|
+
protoName: "ListBindings",
|
|
66
|
+
paramsType: "ListBindingsRequest",
|
|
67
|
+
returnType: "ListBindingsResponse",
|
|
68
|
+
isList: true,
|
|
69
|
+
paginationType: "offset",
|
|
70
|
+
pageParamKey: "page",
|
|
71
|
+
listItemType: "Binding",
|
|
72
|
+
isPrivate: false,
|
|
73
|
+
description: "\""
|
|
74
|
+
}
|
|
75
|
+
]
|
|
76
|
+
}]
|
|
77
|
+
};
|
|
78
|
+
//#endregion
|
|
79
|
+
export { queriesMetadata };
|
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
export interface ListAllKeysAndValuesResponseValue {
|
|
2
|
+
/**
|
|
3
|
+
* ID of the value.
|
|
4
|
+
*/
|
|
5
|
+
id: string;
|
|
6
|
+
/**
|
|
7
|
+
* Name of the value.
|
|
8
|
+
*/
|
|
9
|
+
name: string;
|
|
10
|
+
/**
|
|
11
|
+
* Description of the value.
|
|
12
|
+
*/
|
|
13
|
+
description: string;
|
|
14
|
+
}
|
|
15
|
+
export interface BindingKey {
|
|
16
|
+
/**
|
|
17
|
+
* ID of the key.
|
|
18
|
+
*/
|
|
19
|
+
id: string;
|
|
20
|
+
/**
|
|
21
|
+
* Name of the key.
|
|
22
|
+
*/
|
|
23
|
+
name: string;
|
|
24
|
+
}
|
|
25
|
+
export interface BindingValue {
|
|
26
|
+
/**
|
|
27
|
+
* ID of the value.
|
|
28
|
+
*/
|
|
29
|
+
id: string;
|
|
30
|
+
/**
|
|
31
|
+
* Name of the value.
|
|
32
|
+
*/
|
|
33
|
+
name: string;
|
|
34
|
+
}
|
|
35
|
+
export interface ListAllKeysAndValuesResponseKey {
|
|
36
|
+
/**
|
|
37
|
+
* ID of the key.
|
|
38
|
+
*/
|
|
39
|
+
id: string;
|
|
40
|
+
/**
|
|
41
|
+
* Name of the key.
|
|
42
|
+
*/
|
|
43
|
+
name: string;
|
|
44
|
+
/**
|
|
45
|
+
* Description of the key.
|
|
46
|
+
*/
|
|
47
|
+
description: string;
|
|
48
|
+
/**
|
|
49
|
+
* List of values associated with the key, sorted alphabetically by name.
|
|
50
|
+
*/
|
|
51
|
+
values: ListAllKeysAndValuesResponseValue[];
|
|
52
|
+
}
|
|
53
|
+
export interface Binding {
|
|
54
|
+
/**
|
|
55
|
+
* ID of the binding.
|
|
56
|
+
*/
|
|
57
|
+
id: string;
|
|
58
|
+
/**
|
|
59
|
+
* Scaleway Resource Number associated to the binding.
|
|
60
|
+
*/
|
|
61
|
+
srn: string;
|
|
62
|
+
/**
|
|
63
|
+
* Key associated to the binding.
|
|
64
|
+
*/
|
|
65
|
+
key?: BindingKey;
|
|
66
|
+
/**
|
|
67
|
+
* Value associated to the binding.
|
|
68
|
+
*/
|
|
69
|
+
value?: BindingValue;
|
|
70
|
+
}
|
|
71
|
+
export interface Key {
|
|
72
|
+
/**
|
|
73
|
+
* ID of the annotation key.
|
|
74
|
+
*/
|
|
75
|
+
id: string;
|
|
76
|
+
/**
|
|
77
|
+
* Name of the annotation key.
|
|
78
|
+
*/
|
|
79
|
+
name: string;
|
|
80
|
+
/**
|
|
81
|
+
* Description of the annotation key.
|
|
82
|
+
*/
|
|
83
|
+
description: string;
|
|
84
|
+
}
|
|
85
|
+
export interface Value {
|
|
86
|
+
/**
|
|
87
|
+
* ID of the value.
|
|
88
|
+
*/
|
|
89
|
+
id: string;
|
|
90
|
+
/**
|
|
91
|
+
* ID of the key the value is associated to.
|
|
92
|
+
*/
|
|
93
|
+
keyId: string;
|
|
94
|
+
/**
|
|
95
|
+
* Name of the value (e.g. "production" for a key "environment").
|
|
96
|
+
*/
|
|
97
|
+
name: string;
|
|
98
|
+
/**
|
|
99
|
+
* Description of the value.
|
|
100
|
+
*/
|
|
101
|
+
description: string;
|
|
102
|
+
}
|
|
103
|
+
export type CreateBindingRequest = {
|
|
104
|
+
/**
|
|
105
|
+
* Scaleway Resource Number to associate.
|
|
106
|
+
*/
|
|
107
|
+
srn: string;
|
|
108
|
+
/**
|
|
109
|
+
* ID of the value to associate.
|
|
110
|
+
*/
|
|
111
|
+
valueId: string;
|
|
112
|
+
};
|
|
113
|
+
export type CreateKeyRequest = {
|
|
114
|
+
/**
|
|
115
|
+
* ID of the organization.
|
|
116
|
+
*/
|
|
117
|
+
organizationId?: string;
|
|
118
|
+
/**
|
|
119
|
+
* Name of the annotation key.
|
|
120
|
+
*/
|
|
121
|
+
name: string;
|
|
122
|
+
/**
|
|
123
|
+
* Description of the annotation key.
|
|
124
|
+
*/
|
|
125
|
+
description: string;
|
|
126
|
+
};
|
|
127
|
+
export type CreateValueRequest = {
|
|
128
|
+
/**
|
|
129
|
+
* ID of the key the value will be bound to.
|
|
130
|
+
*/
|
|
131
|
+
keyId: string;
|
|
132
|
+
/**
|
|
133
|
+
* Name of the value.
|
|
134
|
+
*/
|
|
135
|
+
name: string;
|
|
136
|
+
/**
|
|
137
|
+
* Description of the value.
|
|
138
|
+
*/
|
|
139
|
+
description: string;
|
|
140
|
+
};
|
|
141
|
+
export type DeleteAllBindingsMatchingSRNRequest = {
|
|
142
|
+
/**
|
|
143
|
+
* Scaleway Resource Number for which all bindings should be deleted.
|
|
144
|
+
*/
|
|
145
|
+
srn: string;
|
|
146
|
+
/**
|
|
147
|
+
* ID of the organization.
|
|
148
|
+
*/
|
|
149
|
+
organizationId?: string;
|
|
150
|
+
};
|
|
151
|
+
export interface DeleteAllBindingsMatchingSRNResponse {
|
|
152
|
+
/**
|
|
153
|
+
* Total number of bindings deleted.
|
|
154
|
+
*/
|
|
155
|
+
totalDeleted: number;
|
|
156
|
+
}
|
|
157
|
+
export type DeleteAllBindingsMatchingValueRequest = {
|
|
158
|
+
/**
|
|
159
|
+
* ID of the value for which all bindings should be deleted.
|
|
160
|
+
*/
|
|
161
|
+
valueId: string;
|
|
162
|
+
};
|
|
163
|
+
export interface DeleteAllBindingsMatchingValueResponse {
|
|
164
|
+
/**
|
|
165
|
+
* Total number of bindings deleted.
|
|
166
|
+
*/
|
|
167
|
+
totalDeleted: number;
|
|
168
|
+
}
|
|
169
|
+
export type DeleteAllValuesMatchingKeyRequest = {
|
|
170
|
+
/**
|
|
171
|
+
* ID of the key for which to delete all values.
|
|
172
|
+
*/
|
|
173
|
+
keyId: string;
|
|
174
|
+
};
|
|
175
|
+
export interface DeleteAllValuesMatchingKeyResponse {
|
|
176
|
+
/**
|
|
177
|
+
* Total number of bindings deleted.
|
|
178
|
+
*/
|
|
179
|
+
totalDeleted: number;
|
|
180
|
+
}
|
|
181
|
+
export type DeleteBindingRequest = {
|
|
182
|
+
/**
|
|
183
|
+
* ID of the binding to delete.
|
|
184
|
+
*/
|
|
185
|
+
bindingId: string;
|
|
186
|
+
};
|
|
187
|
+
export type DeleteKeyRequest = {
|
|
188
|
+
/**
|
|
189
|
+
* ID of the key to delete.
|
|
190
|
+
*/
|
|
191
|
+
keyId: string;
|
|
192
|
+
};
|
|
193
|
+
export type DeleteValueRequest = {
|
|
194
|
+
/**
|
|
195
|
+
* ID of the value to delete.
|
|
196
|
+
*/
|
|
197
|
+
valueId: string;
|
|
198
|
+
};
|
|
199
|
+
export type GetKeyRequest = {
|
|
200
|
+
/**
|
|
201
|
+
* ID of the key to retrieve.
|
|
202
|
+
*/
|
|
203
|
+
keyId: string;
|
|
204
|
+
};
|
|
205
|
+
export type GetValueRequest = {
|
|
206
|
+
/**
|
|
207
|
+
* ID of the value to retrieve.
|
|
208
|
+
*/
|
|
209
|
+
valueId: string;
|
|
210
|
+
};
|
|
211
|
+
export type ListAllKeysAndValuesRequest = {
|
|
212
|
+
/**
|
|
213
|
+
* ID of the organization.
|
|
214
|
+
*/
|
|
215
|
+
organizationId?: string;
|
|
216
|
+
};
|
|
217
|
+
export interface ListAllKeysAndValuesResponse {
|
|
218
|
+
/**
|
|
219
|
+
* List of keys with values for an organization, sorted alphabetically by name.
|
|
220
|
+
*/
|
|
221
|
+
keys: ListAllKeysAndValuesResponseKey[];
|
|
222
|
+
}
|
|
223
|
+
export type ListBindingsRequest = {
|
|
224
|
+
/**
|
|
225
|
+
* Page number.
|
|
226
|
+
*/
|
|
227
|
+
page?: number;
|
|
228
|
+
/**
|
|
229
|
+
* Maximum number of bindings on the page.
|
|
230
|
+
*/
|
|
231
|
+
pageSize?: number;
|
|
232
|
+
/**
|
|
233
|
+
* ID of the organization.
|
|
234
|
+
*/
|
|
235
|
+
organizationId?: string;
|
|
236
|
+
/**
|
|
237
|
+
* Scaleway Resource Number for which to list all bindings.
|
|
238
|
+
*/
|
|
239
|
+
srn?: string;
|
|
240
|
+
/**
|
|
241
|
+
* Value ID for which to list all bindings.
|
|
242
|
+
*/
|
|
243
|
+
valueId?: string;
|
|
244
|
+
};
|
|
245
|
+
export interface ListBindingsResponse {
|
|
246
|
+
/**
|
|
247
|
+
* List of bindings for the organization. Response order by ID.
|
|
248
|
+
*/
|
|
249
|
+
bindings: Binding[];
|
|
250
|
+
/**
|
|
251
|
+
* Total number of bindings returned.
|
|
252
|
+
*/
|
|
253
|
+
totalCount: number;
|
|
254
|
+
}
|
|
255
|
+
export type ListKeysRequest = {
|
|
256
|
+
/**
|
|
257
|
+
* Page number.
|
|
258
|
+
*/
|
|
259
|
+
page?: number;
|
|
260
|
+
/**
|
|
261
|
+
* Maximum number of keys on the page.
|
|
262
|
+
*/
|
|
263
|
+
pageSize?: number;
|
|
264
|
+
/**
|
|
265
|
+
* ID of the organization.
|
|
266
|
+
*/
|
|
267
|
+
organizationId?: string;
|
|
268
|
+
};
|
|
269
|
+
export interface ListKeysResponse {
|
|
270
|
+
/**
|
|
271
|
+
* List of keys for an organization, sorted alphabetically by name.
|
|
272
|
+
*/
|
|
273
|
+
keys: Key[];
|
|
274
|
+
/**
|
|
275
|
+
* Total number of keys returned.
|
|
276
|
+
*/
|
|
277
|
+
totalCount: number;
|
|
278
|
+
}
|
|
279
|
+
export type ListValuesRequest = {
|
|
280
|
+
/**
|
|
281
|
+
* Page number.
|
|
282
|
+
*/
|
|
283
|
+
page?: number;
|
|
284
|
+
/**
|
|
285
|
+
* Maximum number of values on the page.
|
|
286
|
+
*/
|
|
287
|
+
pageSize?: number;
|
|
288
|
+
/**
|
|
289
|
+
* ID of the organization.
|
|
290
|
+
*/
|
|
291
|
+
organizationId?: string;
|
|
292
|
+
/**
|
|
293
|
+
* ID of the key to list the values for.
|
|
294
|
+
*/
|
|
295
|
+
keyId?: string;
|
|
296
|
+
};
|
|
297
|
+
export interface ListValuesResponse {
|
|
298
|
+
/**
|
|
299
|
+
* List of values for a key, sorted alphabetically by name.
|
|
300
|
+
*/
|
|
301
|
+
values: Value[];
|
|
302
|
+
/**
|
|
303
|
+
* Total number of values returned.
|
|
304
|
+
*/
|
|
305
|
+
totalCount: number;
|
|
306
|
+
}
|
|
307
|
+
export type UpdateKeyRequest = {
|
|
308
|
+
/**
|
|
309
|
+
* ID of the key to update.
|
|
310
|
+
*/
|
|
311
|
+
keyId: string;
|
|
312
|
+
/**
|
|
313
|
+
* New name of the key.
|
|
314
|
+
*/
|
|
315
|
+
name?: string;
|
|
316
|
+
/**
|
|
317
|
+
* New description of the key.
|
|
318
|
+
*/
|
|
319
|
+
description?: string;
|
|
320
|
+
};
|
|
321
|
+
export type UpdateValueRequest = {
|
|
322
|
+
/**
|
|
323
|
+
* ID of the value to update.
|
|
324
|
+
*/
|
|
325
|
+
valueId: string;
|
|
326
|
+
/**
|
|
327
|
+
* New name of the value.
|
|
328
|
+
*/
|
|
329
|
+
name?: string;
|
|
330
|
+
/**
|
|
331
|
+
* New description of the value.
|
|
332
|
+
*/
|
|
333
|
+
description?: string;
|
|
334
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export declare const CreateKeyRequest: {
|
|
2
|
+
description: {
|
|
3
|
+
maxLength: number;
|
|
4
|
+
};
|
|
5
|
+
name: {
|
|
6
|
+
maxLength: number;
|
|
7
|
+
minLength: number;
|
|
8
|
+
pattern: RegExp;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export declare const CreateValueRequest: {
|
|
12
|
+
description: {
|
|
13
|
+
maxLength: number;
|
|
14
|
+
};
|
|
15
|
+
name: {
|
|
16
|
+
maxLength: number;
|
|
17
|
+
minLength: number;
|
|
18
|
+
pattern: RegExp;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export declare const ListBindingsRequest: {
|
|
22
|
+
page: {
|
|
23
|
+
greaterThanOrEqual: number;
|
|
24
|
+
};
|
|
25
|
+
pageSize: {
|
|
26
|
+
greaterThanOrEqual: number;
|
|
27
|
+
lessThanOrEqual: number;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export declare const ListKeysRequest: {
|
|
31
|
+
page: {
|
|
32
|
+
greaterThanOrEqual: number;
|
|
33
|
+
};
|
|
34
|
+
pageSize: {
|
|
35
|
+
greaterThanOrEqual: number;
|
|
36
|
+
lessThanOrEqual: number;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
export declare const ListValuesRequest: {
|
|
40
|
+
page: {
|
|
41
|
+
greaterThanOrEqual: number;
|
|
42
|
+
};
|
|
43
|
+
pageSize: {
|
|
44
|
+
greaterThanOrEqual: number;
|
|
45
|
+
lessThanOrEqual: number;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
export declare const UpdateKeyRequest: {
|
|
49
|
+
description: {
|
|
50
|
+
maxLength: number;
|
|
51
|
+
};
|
|
52
|
+
name: {
|
|
53
|
+
maxLength: number;
|
|
54
|
+
minLength: number;
|
|
55
|
+
pattern: RegExp;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
export declare const UpdateValueRequest: {
|
|
59
|
+
description: {
|
|
60
|
+
maxLength: number;
|
|
61
|
+
};
|
|
62
|
+
name: {
|
|
63
|
+
maxLength: number;
|
|
64
|
+
minLength: number;
|
|
65
|
+
pattern: RegExp;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
2
|
+
//#region src/v1/validation-rules.gen.ts
|
|
3
|
+
var validation_rules_gen_exports = /* @__PURE__ */ __exportAll({
|
|
4
|
+
CreateKeyRequest: () => CreateKeyRequest,
|
|
5
|
+
CreateValueRequest: () => CreateValueRequest,
|
|
6
|
+
ListBindingsRequest: () => ListBindingsRequest,
|
|
7
|
+
ListKeysRequest: () => ListKeysRequest,
|
|
8
|
+
ListValuesRequest: () => ListValuesRequest,
|
|
9
|
+
UpdateKeyRequest: () => UpdateKeyRequest,
|
|
10
|
+
UpdateValueRequest: () => UpdateValueRequest
|
|
11
|
+
});
|
|
12
|
+
const CreateKeyRequest = {
|
|
13
|
+
description: { maxLength: 1024 },
|
|
14
|
+
name: {
|
|
15
|
+
maxLength: 128,
|
|
16
|
+
minLength: 1,
|
|
17
|
+
pattern: /^[_\pL][_\pL0-9]*$/
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
const CreateValueRequest = {
|
|
21
|
+
description: { maxLength: 1024 },
|
|
22
|
+
name: {
|
|
23
|
+
maxLength: 256,
|
|
24
|
+
minLength: 1,
|
|
25
|
+
pattern: /^[_\pL][_\pL0-9]*$/
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
const ListBindingsRequest = {
|
|
29
|
+
page: { greaterThanOrEqual: 1 },
|
|
30
|
+
pageSize: {
|
|
31
|
+
greaterThanOrEqual: 1,
|
|
32
|
+
lessThanOrEqual: 1e3
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
const ListKeysRequest = {
|
|
36
|
+
page: { greaterThanOrEqual: 1 },
|
|
37
|
+
pageSize: {
|
|
38
|
+
greaterThanOrEqual: 1,
|
|
39
|
+
lessThanOrEqual: 1e3
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
const ListValuesRequest = {
|
|
43
|
+
page: { greaterThanOrEqual: 1 },
|
|
44
|
+
pageSize: {
|
|
45
|
+
greaterThanOrEqual: 1,
|
|
46
|
+
lessThanOrEqual: 1e3
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
const UpdateKeyRequest = {
|
|
50
|
+
description: { maxLength: 1024 },
|
|
51
|
+
name: {
|
|
52
|
+
maxLength: 128,
|
|
53
|
+
minLength: 1,
|
|
54
|
+
pattern: /^[_\pL][_\pL0-9]*$/
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
const UpdateValueRequest = {
|
|
58
|
+
description: { maxLength: 1024 },
|
|
59
|
+
name: {
|
|
60
|
+
maxLength: 256,
|
|
61
|
+
minLength: 1,
|
|
62
|
+
pattern: /^[_\pL][_\pL0-9]*$/
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
//#endregion
|
|
66
|
+
export { CreateKeyRequest, CreateValueRequest, ListBindingsRequest, ListKeysRequest, ListValuesRequest, UpdateKeyRequest, UpdateValueRequest, validation_rules_gen_exports };
|
package/package.json
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@scaleway/sdk-annotations",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "Scaleway SDK annotations",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"directory": "packages_generated/annotations"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist",
|
|
12
|
+
"README.md"
|
|
13
|
+
],
|
|
14
|
+
"type": "module",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./dist/index.gen.d.ts",
|
|
18
|
+
"default": "./dist/index.gen.js"
|
|
19
|
+
},
|
|
20
|
+
"./*": {
|
|
21
|
+
"types": "./dist/*/index.gen.d.ts",
|
|
22
|
+
"default": "./dist/*/index.gen.js"
|
|
23
|
+
},
|
|
24
|
+
"./metadata": {
|
|
25
|
+
"types": "./dist/metadata.gen.d.ts",
|
|
26
|
+
"default": "./dist/metadata.gen.js"
|
|
27
|
+
},
|
|
28
|
+
"./*/metadata": {
|
|
29
|
+
"types": "./dist/*/metadata.gen.d.ts",
|
|
30
|
+
"default": "./dist/*/metadata.gen.js"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@scaleway/random-name": "5.1.4",
|
|
35
|
+
"@scaleway/sdk-std": "2.4.3"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@scaleway/sdk-client": "^2.4.1"
|
|
39
|
+
},
|
|
40
|
+
"peerDependencies": {
|
|
41
|
+
"@scaleway/sdk-client": "^2.4.1"
|
|
42
|
+
},
|
|
43
|
+
"engines": {
|
|
44
|
+
"node": ">=20.18.3"
|
|
45
|
+
},
|
|
46
|
+
"scripts": {
|
|
47
|
+
"package:check": "pnpm publint",
|
|
48
|
+
"typecheck": "tsgo --noEmit",
|
|
49
|
+
"type:generate": "tsgo --declaration -p tsconfig.build.json",
|
|
50
|
+
"build": "vite build --config vite.config.ts && pnpm run type:generate",
|
|
51
|
+
"build:profile": "npx vite-bundle-visualizer -c vite.config.ts"
|
|
52
|
+
}
|
|
53
|
+
}
|