@nirvana-labs/nirvana 1.46.1 → 1.47.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/CHANGELOG.md +26 -0
- package/client.d.mts +5 -5
- package/client.d.mts.map +1 -1
- package/client.d.ts +5 -5
- package/client.d.ts.map +1 -1
- package/client.js +12 -5
- package/client.js.map +1 -1
- package/client.mjs +12 -5
- package/client.mjs.map +1 -1
- package/internal/tslib.js +6 -6
- package/package.json +1 -1
- package/resources/api-keys/api-keys.d.mts +168 -0
- package/resources/api-keys/api-keys.d.mts.map +1 -0
- package/resources/api-keys/api-keys.d.ts +168 -0
- package/resources/api-keys/api-keys.d.ts.map +1 -0
- package/resources/api-keys/api-keys.js +76 -0
- package/resources/api-keys/api-keys.js.map +1 -0
- package/resources/api-keys/api-keys.mjs +72 -0
- package/resources/api-keys/api-keys.mjs.map +1 -0
- package/resources/api-keys/index.d.mts +2 -0
- package/resources/api-keys/index.d.mts.map +1 -0
- package/resources/api-keys/index.d.ts +2 -0
- package/resources/api-keys/index.d.ts.map +1 -0
- package/resources/api-keys/index.js +7 -0
- package/resources/api-keys/index.js.map +1 -0
- package/resources/api-keys/index.mjs +3 -0
- package/resources/api-keys/index.mjs.map +1 -0
- package/resources/api-keys.d.mts +1 -167
- package/resources/api-keys.d.mts.map +1 -1
- package/resources/api-keys.d.ts +1 -167
- package/resources/api-keys.d.ts.map +1 -1
- package/resources/api-keys.js +2 -72
- package/resources/api-keys.js.map +1 -1
- package/resources/api-keys.mjs +1 -70
- package/resources/api-keys.mjs.map +1 -1
- package/resources/compute/vms/vms.d.mts +1 -1
- package/resources/compute/vms/vms.d.mts.map +1 -1
- package/resources/compute/vms/vms.d.ts +1 -1
- package/resources/compute/vms/vms.d.ts.map +1 -1
- package/resources/compute/volumes/volumes.d.mts +1 -1
- package/resources/compute/volumes/volumes.d.mts.map +1 -1
- package/resources/compute/volumes/volumes.d.ts +1 -1
- package/resources/compute/volumes/volumes.d.ts.map +1 -1
- package/resources/networking/connect/connections.d.mts +1 -1
- package/resources/networking/connect/connections.d.mts.map +1 -1
- package/resources/networking/connect/connections.d.ts +1 -1
- package/resources/networking/connect/connections.d.ts.map +1 -1
- package/resources/networking/firewall-rules.d.mts +1 -1
- package/resources/networking/firewall-rules.d.mts.map +1 -1
- package/resources/networking/firewall-rules.d.ts +1 -1
- package/resources/networking/firewall-rules.d.ts.map +1 -1
- package/resources/networking/vpcs/vpcs.d.mts +1 -1
- package/resources/networking/vpcs/vpcs.d.mts.map +1 -1
- package/resources/networking/vpcs/vpcs.d.ts +1 -1
- package/resources/networking/vpcs/vpcs.d.ts.map +1 -1
- package/resources/operations/index.d.mts +2 -0
- package/resources/operations/index.d.mts.map +1 -0
- package/resources/operations/index.d.ts +2 -0
- package/resources/operations/index.d.ts.map +1 -0
- package/resources/operations/index.js +7 -0
- package/resources/operations/index.js.map +1 -0
- package/resources/operations/index.mjs +3 -0
- package/resources/operations/index.mjs.map +1 -0
- package/resources/operations/operations.d.mts +82 -0
- package/resources/operations/operations.d.mts.map +1 -0
- package/resources/operations/operations.d.ts +82 -0
- package/resources/operations/operations.d.ts.map +1 -0
- package/resources/operations/operations.js +23 -0
- package/resources/operations/operations.js.map +1 -0
- package/resources/operations/operations.mjs +19 -0
- package/resources/operations/operations.mjs.map +1 -0
- package/resources/operations.d.mts +1 -81
- package/resources/operations.d.mts.map +1 -1
- package/resources/operations.d.ts +1 -81
- package/resources/operations.d.ts.map +1 -1
- package/resources/operations.js +2 -19
- package/resources/operations.js.map +1 -1
- package/resources/operations.mjs +1 -17
- package/resources/operations.mjs.map +1 -1
- package/resources/organizations/index.d.mts +2 -0
- package/resources/organizations/index.d.mts.map +1 -0
- package/resources/organizations/index.d.ts +2 -0
- package/resources/organizations/index.d.ts.map +1 -0
- package/resources/organizations/index.js +7 -0
- package/resources/organizations/index.js.map +1 -0
- package/resources/organizations/index.mjs +3 -0
- package/resources/organizations/index.mjs.map +1 -0
- package/resources/organizations/organizations.d.mts +103 -0
- package/resources/organizations/organizations.d.mts.map +1 -0
- package/resources/organizations/organizations.d.ts +103 -0
- package/resources/organizations/organizations.d.ts.map +1 -0
- package/resources/organizations/organizations.js +64 -0
- package/resources/organizations/organizations.js.map +1 -0
- package/resources/organizations/organizations.mjs +60 -0
- package/resources/organizations/organizations.mjs.map +1 -0
- package/resources/organizations.d.mts +1 -102
- package/resources/organizations.d.mts.map +1 -1
- package/resources/organizations.d.ts +1 -102
- package/resources/organizations.d.ts.map +1 -1
- package/resources/organizations.js +2 -60
- package/resources/organizations.js.map +1 -1
- package/resources/organizations.mjs +1 -58
- package/resources/organizations.mjs.map +1 -1
- package/resources/projects/index.d.mts +2 -0
- package/resources/projects/index.d.mts.map +1 -0
- package/resources/projects/index.d.ts +2 -0
- package/resources/projects/index.d.ts.map +1 -0
- package/resources/projects/index.js +7 -0
- package/resources/projects/index.js.map +1 -0
- package/resources/projects/index.mjs +3 -0
- package/resources/projects/index.mjs.map +1 -0
- package/resources/projects/projects.d.mts +171 -0
- package/resources/projects/projects.d.mts.map +1 -0
- package/resources/projects/projects.d.ts +171 -0
- package/resources/projects/projects.d.ts.map +1 -0
- package/resources/projects/projects.js +75 -0
- package/resources/projects/projects.js.map +1 -0
- package/resources/projects/projects.mjs +71 -0
- package/resources/projects/projects.mjs.map +1 -0
- package/resources/projects.d.mts +1 -174
- package/resources/projects.d.mts.map +1 -1
- package/resources/projects.d.ts +1 -174
- package/resources/projects.d.ts.map +1 -1
- package/resources/projects.js +2 -71
- package/resources/projects.js.map +1 -1
- package/resources/projects.mjs +1 -69
- package/resources/projects.mjs.map +1 -1
- package/resources/regions/index.d.mts +2 -0
- package/resources/regions/index.d.mts.map +1 -0
- package/resources/regions/index.d.ts +2 -0
- package/resources/regions/index.d.ts.map +1 -0
- package/resources/regions/index.js +7 -0
- package/resources/regions/index.js.map +1 -0
- package/resources/regions/index.mjs +3 -0
- package/resources/regions/index.mjs.map +1 -0
- package/resources/regions/regions.d.mts +108 -0
- package/resources/regions/regions.d.mts.map +1 -0
- package/resources/regions/regions.d.ts +108 -0
- package/resources/regions/regions.d.ts.map +1 -0
- package/resources/regions/regions.js +36 -0
- package/resources/regions/regions.js.map +1 -0
- package/resources/regions/regions.mjs +32 -0
- package/resources/regions/regions.mjs.map +1 -0
- package/resources/regions.d.mts +1 -107
- package/resources/regions.d.mts.map +1 -1
- package/resources/regions.d.ts +1 -107
- package/resources/regions.d.ts.map +1 -1
- package/resources/regions.js +2 -32
- package/resources/regions.js.map +1 -1
- package/resources/regions.mjs +1 -30
- package/resources/regions.mjs.map +1 -1
- package/src/client.ts +14 -6
- package/src/resources/api-keys/api-keys.ts +223 -0
- package/src/resources/api-keys/api.md +14 -0
- package/src/resources/api-keys/index.ts +3 -0
- package/src/resources/api-keys.ts +1 -221
- package/src/resources/compute/api.md +68 -0
- package/src/resources/compute/vms/vms.ts +1 -1
- package/src/resources/compute/volumes/volumes.ts +1 -1
- package/src/resources/networking/api.md +67 -0
- package/src/resources/networking/connect/connections.ts +1 -1
- package/src/resources/networking/firewall-rules.ts +1 -1
- package/src/resources/networking/vpcs/vpcs.ts +1 -1
- package/src/resources/operations/api.md +14 -0
- package/src/resources/operations/index.ts +3 -0
- package/src/resources/operations/operations.ts +114 -0
- package/src/resources/operations.ts +1 -112
- package/src/resources/organizations/api.md +13 -0
- package/src/resources/organizations/index.ts +3 -0
- package/src/resources/organizations/organizations.ts +142 -0
- package/src/resources/organizations.ts +1 -140
- package/src/resources/projects/api.md +14 -0
- package/src/resources/projects/index.ts +3 -0
- package/src/resources/projects/projects.ts +224 -0
- package/src/resources/projects.ts +1 -227
- package/src/resources/regions/api.md +12 -0
- package/src/resources/regions/index.ts +3 -0
- package/src/resources/regions/regions.ts +140 -0
- package/src/resources/regions.ts +1 -138
- package/src/resources/rpc-nodes/api.md +44 -0
- package/src/resources/user/api.md +20 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.js";
|
|
2
|
+
import * as Shared from "../shared.js";
|
|
3
|
+
import { APIPromise } from "../../core/api-promise.js";
|
|
4
|
+
import { Cursor, type CursorParams, PagePromise } from "../../core/pagination.js";
|
|
5
|
+
import { RequestOptions } from "../../internal/request-options.js";
|
|
6
|
+
export declare class APIKeys extends APIResource {
|
|
7
|
+
/**
|
|
8
|
+
* Create a new API key
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* const apiKey = await client.apiKeys.create({
|
|
13
|
+
* expires_at: '2025-12-31T23:59:59Z',
|
|
14
|
+
* name: 'My API Key',
|
|
15
|
+
* });
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
create(body: APIKeyCreateParams, options?: RequestOptions): APIPromise<APIKey>;
|
|
19
|
+
/**
|
|
20
|
+
* Update an existing API key
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* const apiKey = await client.apiKeys.update('api_key_id');
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
update(apiKeyID: string, body: APIKeyUpdateParams, options?: RequestOptions): APIPromise<APIKey>;
|
|
28
|
+
/**
|
|
29
|
+
* List all API keys
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```ts
|
|
33
|
+
* // Automatically fetches more pages as needed.
|
|
34
|
+
* for await (const apiKey of client.apiKeys.list()) {
|
|
35
|
+
* // ...
|
|
36
|
+
* }
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
list(query?: APIKeyListParams | null | undefined, options?: RequestOptions): PagePromise<APIKeysCursor, APIKey>;
|
|
40
|
+
/**
|
|
41
|
+
* Delete an API key
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```ts
|
|
45
|
+
* await client.apiKeys.delete('api_key_id');
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
delete(apiKeyID: string, options?: RequestOptions): APIPromise<void>;
|
|
49
|
+
/**
|
|
50
|
+
* Get details about an API key
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```ts
|
|
54
|
+
* const apiKey = await client.apiKeys.get('api_key_id');
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
get(apiKeyID: string, options?: RequestOptions): APIPromise<APIKey>;
|
|
58
|
+
}
|
|
59
|
+
export type APIKeysCursor = Cursor<APIKey>;
|
|
60
|
+
/**
|
|
61
|
+
* API Key response.
|
|
62
|
+
*/
|
|
63
|
+
export interface APIKey {
|
|
64
|
+
/**
|
|
65
|
+
* API Key ID.
|
|
66
|
+
*/
|
|
67
|
+
id: string;
|
|
68
|
+
/**
|
|
69
|
+
* When the API Key was created.
|
|
70
|
+
*/
|
|
71
|
+
created_at: string;
|
|
72
|
+
/**
|
|
73
|
+
* When the API Key expires and is no longer valid.
|
|
74
|
+
*/
|
|
75
|
+
expires_at: string;
|
|
76
|
+
/**
|
|
77
|
+
* API Key name.
|
|
78
|
+
*/
|
|
79
|
+
name: string;
|
|
80
|
+
/**
|
|
81
|
+
* IP filter rules.
|
|
82
|
+
*/
|
|
83
|
+
source_ip_rule: APIKey.SourceIPRule;
|
|
84
|
+
/**
|
|
85
|
+
* Status of the API Key.
|
|
86
|
+
*/
|
|
87
|
+
status: 'active' | 'inactive' | 'expired';
|
|
88
|
+
/**
|
|
89
|
+
* Tags to attach to the API Key.
|
|
90
|
+
*/
|
|
91
|
+
tags: Array<string>;
|
|
92
|
+
/**
|
|
93
|
+
* When the API Key was updated.
|
|
94
|
+
*/
|
|
95
|
+
updated_at: string;
|
|
96
|
+
/**
|
|
97
|
+
* API Key. Only returned on creation.
|
|
98
|
+
*/
|
|
99
|
+
key?: string;
|
|
100
|
+
/**
|
|
101
|
+
* When the API Key starts to be valid.
|
|
102
|
+
*/
|
|
103
|
+
starts_at?: string;
|
|
104
|
+
}
|
|
105
|
+
export declare namespace APIKey {
|
|
106
|
+
/**
|
|
107
|
+
* IP filter rules.
|
|
108
|
+
*/
|
|
109
|
+
interface SourceIPRule {
|
|
110
|
+
/**
|
|
111
|
+
* List of IPv4 CIDR addresses to allow.
|
|
112
|
+
*/
|
|
113
|
+
allowed: Array<string>;
|
|
114
|
+
/**
|
|
115
|
+
* List of IPv4 CIDR addresses to deny.
|
|
116
|
+
*/
|
|
117
|
+
blocked: Array<string>;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
export interface APIKeyList {
|
|
121
|
+
items: Array<APIKey>;
|
|
122
|
+
/**
|
|
123
|
+
* Pagination response details.
|
|
124
|
+
*/
|
|
125
|
+
pagination: Shared.Pagination;
|
|
126
|
+
}
|
|
127
|
+
export interface APIKeyCreateParams {
|
|
128
|
+
/**
|
|
129
|
+
* When the API Key expires and is no longer valid.
|
|
130
|
+
*/
|
|
131
|
+
expires_at: string;
|
|
132
|
+
/**
|
|
133
|
+
* API Key name.
|
|
134
|
+
*/
|
|
135
|
+
name: string;
|
|
136
|
+
/**
|
|
137
|
+
* IP filter rules.
|
|
138
|
+
*/
|
|
139
|
+
source_ip_rule?: Shared.SourceIPRule;
|
|
140
|
+
/**
|
|
141
|
+
* When the API Key starts to be valid.
|
|
142
|
+
*/
|
|
143
|
+
starts_at?: string;
|
|
144
|
+
/**
|
|
145
|
+
* Tags to attach to the API Key.
|
|
146
|
+
*/
|
|
147
|
+
tags?: Array<string>;
|
|
148
|
+
}
|
|
149
|
+
export interface APIKeyUpdateParams {
|
|
150
|
+
/**
|
|
151
|
+
* API Key name.
|
|
152
|
+
*/
|
|
153
|
+
name?: string;
|
|
154
|
+
/**
|
|
155
|
+
* IP filter rules.
|
|
156
|
+
*/
|
|
157
|
+
source_ip_rule?: Shared.SourceIPRule;
|
|
158
|
+
/**
|
|
159
|
+
* Tags to attach to the API Key.
|
|
160
|
+
*/
|
|
161
|
+
tags?: Array<string>;
|
|
162
|
+
}
|
|
163
|
+
export interface APIKeyListParams extends CursorParams {
|
|
164
|
+
}
|
|
165
|
+
export declare namespace APIKeys {
|
|
166
|
+
export { type APIKey as APIKey, type APIKeyList as APIKeyList, type APIKeysCursor as APIKeysCursor, type APIKeyCreateParams as APIKeyCreateParams, type APIKeyUpdateParams as APIKeyUpdateParams, type APIKeyListParams as APIKeyListParams, };
|
|
167
|
+
}
|
|
168
|
+
//# sourceMappingURL=api-keys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-keys.d.ts","sourceRoot":"","sources":["../../src/resources/api-keys/api-keys.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,MAAM;OACX,EAAE,UAAU,EAAE;OACd,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,WAAW,EAAE;OAE1C,EAAE,cAAc,EAAE;AAGzB,qBAAa,OAAQ,SAAQ,WAAW;IACtC;;;;;;;;;;OAUG;IACH,MAAM,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC;IAI9E;;;;;;;OAOG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC;IAIhG;;;;;;;;;;OAUG;IACH,IAAI,CACF,KAAK,GAAE,gBAAgB,GAAG,IAAI,GAAG,SAAc,EAC/C,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,aAAa,EAAE,MAAM,CAAC;IAIrC;;;;;;;OAOG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;IAOpE;;;;;;;OAOG;IACH,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,MAAM,C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AM,WAAW,kBAAkB;IACjC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC,YAAY,CAAC;IAErC;;OAEG;IACH,IAAI,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACtB;AAED,MAAM,WAAW,gBAAiB,SAAQ,YAAY;CAAG;AAEzD,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,OAAO,EACL,KAAK,MAAM,IAAI,MAAM,EACrB,KAAK,UAAU,IAAI,UAAU,EAC7B,KAAK,aAAa,IAAI,aAAa,EACnC,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;CACH"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.APIKeys = void 0;
|
|
5
|
+
const resource_1 = require("../../core/resource.js");
|
|
6
|
+
const pagination_1 = require("../../core/pagination.js");
|
|
7
|
+
const headers_1 = require("../../internal/headers.js");
|
|
8
|
+
const path_1 = require("../../internal/utils/path.js");
|
|
9
|
+
class APIKeys extends resource_1.APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* Create a new API key
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const apiKey = await client.apiKeys.create({
|
|
16
|
+
* expires_at: '2025-12-31T23:59:59Z',
|
|
17
|
+
* name: 'My API Key',
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
create(body, options) {
|
|
22
|
+
return this._client.post('/v1/api_keys', { body, ...options });
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Update an existing API key
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* const apiKey = await client.apiKeys.update('api_key_id');
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
update(apiKeyID, body, options) {
|
|
33
|
+
return this._client.patch((0, path_1.path) `/v1/api_keys/${apiKeyID}`, { body, ...options });
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* List all API keys
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts
|
|
40
|
+
* // Automatically fetches more pages as needed.
|
|
41
|
+
* for await (const apiKey of client.apiKeys.list()) {
|
|
42
|
+
* // ...
|
|
43
|
+
* }
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
list(query = {}, options) {
|
|
47
|
+
return this._client.getAPIList('/v1/api_keys', (pagination_1.Cursor), { query, ...options });
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Delete an API key
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```ts
|
|
54
|
+
* await client.apiKeys.delete('api_key_id');
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
delete(apiKeyID, options) {
|
|
58
|
+
return this._client.delete((0, path_1.path) `/v1/api_keys/${apiKeyID}`, {
|
|
59
|
+
...options,
|
|
60
|
+
headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Get details about an API key
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```ts
|
|
68
|
+
* const apiKey = await client.apiKeys.get('api_key_id');
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
get(apiKeyID, options) {
|
|
72
|
+
return this._client.get((0, path_1.path) `/v1/api_keys/${apiKeyID}`, options);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
exports.APIKeys = APIKeys;
|
|
76
|
+
//# sourceMappingURL=api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AC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,gBAAgB,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAC;IACnE,CAAC;CACF;AAxED,0BAwEC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
3
|
+
import { Cursor } from "../../core/pagination.mjs";
|
|
4
|
+
import { buildHeaders } from "../../internal/headers.mjs";
|
|
5
|
+
import { path } from "../../internal/utils/path.mjs";
|
|
6
|
+
export class APIKeys extends APIResource {
|
|
7
|
+
/**
|
|
8
|
+
* Create a new API key
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* const apiKey = await client.apiKeys.create({
|
|
13
|
+
* expires_at: '2025-12-31T23:59:59Z',
|
|
14
|
+
* name: 'My API Key',
|
|
15
|
+
* });
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
create(body, options) {
|
|
19
|
+
return this._client.post('/v1/api_keys', { body, ...options });
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Update an existing API key
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* const apiKey = await client.apiKeys.update('api_key_id');
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
update(apiKeyID, body, options) {
|
|
30
|
+
return this._client.patch(path `/v1/api_keys/${apiKeyID}`, { body, ...options });
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* List all API keys
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```ts
|
|
37
|
+
* // Automatically fetches more pages as needed.
|
|
38
|
+
* for await (const apiKey of client.apiKeys.list()) {
|
|
39
|
+
* // ...
|
|
40
|
+
* }
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
list(query = {}, options) {
|
|
44
|
+
return this._client.getAPIList('/v1/api_keys', (Cursor), { query, ...options });
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Delete an API key
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts
|
|
51
|
+
* await client.apiKeys.delete('api_key_id');
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
delete(apiKeyID, options) {
|
|
55
|
+
return this._client.delete(path `/v1/api_keys/${apiKeyID}`, {
|
|
56
|
+
...options,
|
|
57
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Get details about an API key
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```ts
|
|
65
|
+
* const apiKey = await client.apiKeys.get('api_key_id');
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
get(apiKeyID, options) {
|
|
69
|
+
return this._client.get(path `/v1/api_keys/${apiKeyID}`, options);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=api-keys.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-keys.mjs","sourceRoot":"","sources":["../../src/resources/api-keys/api-keys.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,MAAM,EAAkC;OAC1C,EAAE,YAAY,EAAE;OAEhB,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,OAAQ,SAAQ,WAAW;IACtC;;;;;;;;;;OAUG;IACH,MAAM,CAAC,IAAwB,EAAE,OAAwB;QACvD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjE,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,QAAgB,EAAE,IAAwB,EAAE,OAAwB;QACzE,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAA,gBAAgB,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClF,CAAC;IAED;;;;;;;;;;OAUG;IACH,IAAI,CACF,QAA6C,EAAE,EAC/C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,cAAc,EAAE,CAAA,MAAc,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACxF,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,QAAgB,EAAE,OAAwB;QAC/C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,gBAAgB,QAAQ,EAAE,EAAE;YACzD,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;OAOG;IACH,GAAG,CAAC,QAAgB,EAAE,OAAwB;QAC5C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,gBAAgB,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAC;IACnE,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/resources/api-keys/index.ts"],"names":[],"mappings":"OAEO,EAAE,OAAO,EAAE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/api-keys/index.ts"],"names":[],"mappings":"OAEO,EAAE,OAAO,EAAE"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.APIKeys = void 0;
|
|
5
|
+
var api_keys_1 = require("./api-keys.js");
|
|
6
|
+
Object.defineProperty(exports, "APIKeys", { enumerable: true, get: function () { return api_keys_1.APIKeys; } });
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/api-keys/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,0CAAqC;AAA5B,mGAAA,OAAO,OAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/resources/api-keys/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,OAAO,EAAE"}
|
package/resources/api-keys.d.mts
CHANGED
|
@@ -1,168 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import * as Shared from "./shared.mjs";
|
|
3
|
-
import { APIPromise } from "../core/api-promise.mjs";
|
|
4
|
-
import { Cursor, type CursorParams, PagePromise } from "../core/pagination.mjs";
|
|
5
|
-
import { RequestOptions } from "../internal/request-options.mjs";
|
|
6
|
-
export declare class APIKeys extends APIResource {
|
|
7
|
-
/**
|
|
8
|
-
* Create a new API key
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```ts
|
|
12
|
-
* const apiKey = await client.apiKeys.create({
|
|
13
|
-
* expires_at: '2025-12-31T23:59:59Z',
|
|
14
|
-
* name: 'My API Key',
|
|
15
|
-
* });
|
|
16
|
-
* ```
|
|
17
|
-
*/
|
|
18
|
-
create(body: APIKeyCreateParams, options?: RequestOptions): APIPromise<APIKey>;
|
|
19
|
-
/**
|
|
20
|
-
* Update an existing API key
|
|
21
|
-
*
|
|
22
|
-
* @example
|
|
23
|
-
* ```ts
|
|
24
|
-
* const apiKey = await client.apiKeys.update('api_key_id');
|
|
25
|
-
* ```
|
|
26
|
-
*/
|
|
27
|
-
update(apiKeyID: string, body: APIKeyUpdateParams, options?: RequestOptions): APIPromise<APIKey>;
|
|
28
|
-
/**
|
|
29
|
-
* List all API keys for the authenticated user
|
|
30
|
-
*
|
|
31
|
-
* @example
|
|
32
|
-
* ```ts
|
|
33
|
-
* // Automatically fetches more pages as needed.
|
|
34
|
-
* for await (const apiKey of client.apiKeys.list()) {
|
|
35
|
-
* // ...
|
|
36
|
-
* }
|
|
37
|
-
* ```
|
|
38
|
-
*/
|
|
39
|
-
list(query?: APIKeyListParams | null | undefined, options?: RequestOptions): PagePromise<APIKeysCursor, APIKey>;
|
|
40
|
-
/**
|
|
41
|
-
* Delete an API key
|
|
42
|
-
*
|
|
43
|
-
* @example
|
|
44
|
-
* ```ts
|
|
45
|
-
* await client.apiKeys.delete('api_key_id');
|
|
46
|
-
* ```
|
|
47
|
-
*/
|
|
48
|
-
delete(apiKeyID: string, options?: RequestOptions): APIPromise<void>;
|
|
49
|
-
/**
|
|
50
|
-
* Get details about an API key
|
|
51
|
-
*
|
|
52
|
-
* @example
|
|
53
|
-
* ```ts
|
|
54
|
-
* const apiKey = await client.apiKeys.get('api_key_id');
|
|
55
|
-
* ```
|
|
56
|
-
*/
|
|
57
|
-
get(apiKeyID: string, options?: RequestOptions): APIPromise<APIKey>;
|
|
58
|
-
}
|
|
59
|
-
export type APIKeysCursor = Cursor<APIKey>;
|
|
60
|
-
/**
|
|
61
|
-
* API Key response.
|
|
62
|
-
*/
|
|
63
|
-
export interface APIKey {
|
|
64
|
-
/**
|
|
65
|
-
* API Key ID.
|
|
66
|
-
*/
|
|
67
|
-
id: string;
|
|
68
|
-
/**
|
|
69
|
-
* When the API Key was created.
|
|
70
|
-
*/
|
|
71
|
-
created_at: string;
|
|
72
|
-
/**
|
|
73
|
-
* When the API Key expires and is no longer valid.
|
|
74
|
-
*/
|
|
75
|
-
expires_at: string;
|
|
76
|
-
/**
|
|
77
|
-
* API Key name.
|
|
78
|
-
*/
|
|
79
|
-
name: string;
|
|
80
|
-
/**
|
|
81
|
-
* IP filter rules.
|
|
82
|
-
*/
|
|
83
|
-
source_ip_rule: APIKey.SourceIPRule;
|
|
84
|
-
/**
|
|
85
|
-
* Status of the API Key.
|
|
86
|
-
*/
|
|
87
|
-
status: 'active' | 'inactive' | 'expired';
|
|
88
|
-
/**
|
|
89
|
-
* Tags to attach to the API Key.
|
|
90
|
-
*/
|
|
91
|
-
tags: Array<string>;
|
|
92
|
-
/**
|
|
93
|
-
* When the API Key was updated.
|
|
94
|
-
*/
|
|
95
|
-
updated_at: string;
|
|
96
|
-
/**
|
|
97
|
-
* API Key. Only returned on creation.
|
|
98
|
-
*/
|
|
99
|
-
key?: string;
|
|
100
|
-
/**
|
|
101
|
-
* When the API Key starts to be valid.
|
|
102
|
-
*/
|
|
103
|
-
starts_at?: string;
|
|
104
|
-
}
|
|
105
|
-
export declare namespace APIKey {
|
|
106
|
-
/**
|
|
107
|
-
* IP filter rules.
|
|
108
|
-
*/
|
|
109
|
-
interface SourceIPRule {
|
|
110
|
-
/**
|
|
111
|
-
* List of IPv4 CIDR addresses to allow.
|
|
112
|
-
*/
|
|
113
|
-
allowed: Array<string>;
|
|
114
|
-
/**
|
|
115
|
-
* List of IPv4 CIDR addresses to deny.
|
|
116
|
-
*/
|
|
117
|
-
blocked: Array<string>;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
export interface APIKeyList {
|
|
121
|
-
items: Array<APIKey>;
|
|
122
|
-
/**
|
|
123
|
-
* Pagination response details.
|
|
124
|
-
*/
|
|
125
|
-
pagination: Shared.Pagination;
|
|
126
|
-
}
|
|
127
|
-
export interface APIKeyCreateParams {
|
|
128
|
-
/**
|
|
129
|
-
* When the API Key expires and is no longer valid.
|
|
130
|
-
*/
|
|
131
|
-
expires_at: string;
|
|
132
|
-
/**
|
|
133
|
-
* API Key name.
|
|
134
|
-
*/
|
|
135
|
-
name: string;
|
|
136
|
-
/**
|
|
137
|
-
* IP filter rules.
|
|
138
|
-
*/
|
|
139
|
-
source_ip_rule?: Shared.SourceIPRule;
|
|
140
|
-
/**
|
|
141
|
-
* When the API Key starts to be valid.
|
|
142
|
-
*/
|
|
143
|
-
starts_at?: string;
|
|
144
|
-
/**
|
|
145
|
-
* Tags to attach to the API Key.
|
|
146
|
-
*/
|
|
147
|
-
tags?: Array<string>;
|
|
148
|
-
}
|
|
149
|
-
export interface APIKeyUpdateParams {
|
|
150
|
-
/**
|
|
151
|
-
* API Key name.
|
|
152
|
-
*/
|
|
153
|
-
name?: string;
|
|
154
|
-
/**
|
|
155
|
-
* IP filter rules.
|
|
156
|
-
*/
|
|
157
|
-
source_ip_rule?: Shared.SourceIPRule;
|
|
158
|
-
/**
|
|
159
|
-
* Tags to attach to the API Key.
|
|
160
|
-
*/
|
|
161
|
-
tags?: Array<string>;
|
|
162
|
-
}
|
|
163
|
-
export interface APIKeyListParams extends CursorParams {
|
|
164
|
-
}
|
|
165
|
-
export declare namespace APIKeys {
|
|
166
|
-
export { type APIKey as APIKey, type APIKeyList as APIKeyList, type APIKeysCursor as APIKeysCursor, type APIKeyCreateParams as APIKeyCreateParams, type APIKeyUpdateParams as APIKeyUpdateParams, type APIKeyListParams as APIKeyListParams, };
|
|
167
|
-
}
|
|
1
|
+
export * from "./api-keys/index.mjs";
|
|
168
2
|
//# sourceMappingURL=api-keys.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-keys.d.mts","sourceRoot":"","sources":["../src/resources/api-keys.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"api-keys.d.mts","sourceRoot":"","sources":["../src/resources/api-keys.ts"],"names":[],"mappings":""}
|