@roarkanalytics/sdk 4.21.0 → 4.23.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 +24 -0
- package/client.d.mts +2 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +2 -2
- package/client.d.ts.map +1 -1
- package/client.js.map +1 -1
- package/client.mjs +1 -1
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/call.d.mts +21 -0
- package/resources/call.d.mts.map +1 -1
- package/resources/call.d.ts +21 -0
- package/resources/call.d.ts.map +1 -1
- package/resources/index.d.mts +1 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/me.d.mts +208 -1
- package/resources/me.d.mts.map +1 -1
- package/resources/me.d.ts +208 -1
- package/resources/me.d.ts.map +1 -1
- package/resources/me.js +46 -0
- package/resources/me.js.map +1 -1
- package/resources/me.mjs +46 -0
- package/resources/me.mjs.map +1 -1
- package/src/client.ts +18 -2
- package/src/resources/call.ts +25 -0
- package/src/resources/index.ts +9 -1
- package/src/resources/me.ts +261 -1
- 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
package/src/resources/me.ts
CHANGED
|
@@ -3,8 +3,28 @@
|
|
|
3
3
|
import { APIResource } from '../core/resource';
|
|
4
4
|
import { APIPromise } from '../core/api-promise';
|
|
5
5
|
import { RequestOptions } from '../internal/request-options';
|
|
6
|
+
import { path } from '../internal/utils/path';
|
|
6
7
|
|
|
7
8
|
export class Me extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Mints a credential that acts as you, for a CLI or an automation. The key value
|
|
11
|
+
* is returned exactly once, in the `key` field: capture it now, it is unreadable
|
|
12
|
+
* afterwards. Requires a personal credential (a project API key is refused) and
|
|
13
|
+
* admin on the project the credential defaults to. The new credential can never
|
|
14
|
+
* exceed the one that created it: not in scope, not in permissions, and not in
|
|
15
|
+
* lifetime. Omit a field to copy it from the calling credential.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* const response = await client.me.createAPIKey({
|
|
20
|
+
* name: 'CI deploy gate',
|
|
21
|
+
* });
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
createAPIKey(body: MeCreateAPIKeyParams, options?: RequestOptions): APIPromise<MeCreateAPIKeyResponse> {
|
|
25
|
+
return this._client.post('/v1/me/api-keys', { body, ...options });
|
|
26
|
+
}
|
|
27
|
+
|
|
8
28
|
/**
|
|
9
29
|
* Returns the scope of the credential making the request, the organization it acts
|
|
10
30
|
* in, its default project (if any) and the permissions it was granted. Works for
|
|
@@ -19,6 +39,105 @@ export class Me extends APIResource {
|
|
|
19
39
|
get(options?: RequestOptions): APIPromise<MeGetResponse> {
|
|
20
40
|
return this._client.get('/v1/me', options);
|
|
21
41
|
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Returns the credentials that act as you: the ones created in the dashboard, from
|
|
45
|
+
* `roark auth login`, and MCP connectors. Requires a personal credential; a
|
|
46
|
+
* project API key is refused. Defaults to ACTIVE, pass ?status=REVOKED to see
|
|
47
|
+
* revoked ones. The key value itself is never returned.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts
|
|
51
|
+
* const response = await client.me.listAPIKeys();
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
listAPIKeys(
|
|
55
|
+
query: MeListAPIKeysParams | null | undefined = {},
|
|
56
|
+
options?: RequestOptions,
|
|
57
|
+
): APIPromise<MeListAPIKeysResponse> {
|
|
58
|
+
return this._client.get('/v1/me/api-keys', { query, ...options });
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Revokes a credential that acts as you. It stops working immediately. A
|
|
63
|
+
* credential may revoke itself, which is what `roark auth logout` does. Repeating
|
|
64
|
+
* the call is safe; an unknown id, or one belonging to someone else, answers 404.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```ts
|
|
68
|
+
* const response = await client.me.revokeAPIKey('id');
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
revokeAPIKey(id: string, options?: RequestOptions): APIPromise<MeRevokeAPIKeyResponse> {
|
|
72
|
+
return this._client.delete(path`/v1/me/api-keys/${id}`, options);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface MeCreateAPIKeyResponse {
|
|
77
|
+
/**
|
|
78
|
+
* The created credential, with its key
|
|
79
|
+
*/
|
|
80
|
+
data: MeCreateAPIKeyResponse.Data;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export namespace MeCreateAPIKeyResponse {
|
|
84
|
+
/**
|
|
85
|
+
* The created credential, with its key
|
|
86
|
+
*/
|
|
87
|
+
export interface Data {
|
|
88
|
+
/**
|
|
89
|
+
* Roark ID of the credential. Pass it to DELETE to revoke.
|
|
90
|
+
*/
|
|
91
|
+
id: string;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* ISO 8601 timestamp
|
|
95
|
+
*/
|
|
96
|
+
createdAt: string;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* The project a request acts on when it sends no X-Roark-Project-Id header. Null
|
|
100
|
+
* once that project is deleted.
|
|
101
|
+
*/
|
|
102
|
+
defaultProjectId: string | null;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* ISO 8601 timestamp, null if it never expires
|
|
106
|
+
*/
|
|
107
|
+
expiresAt: string | null;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* The credential value. Returned only here, only once.
|
|
111
|
+
*/
|
|
112
|
+
key: string;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* ISO 8601 timestamp, null if never used
|
|
116
|
+
*/
|
|
117
|
+
lastUsedAt: string | null;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* The label chosen when it was created
|
|
121
|
+
*/
|
|
122
|
+
name: string;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* The organization this credential is pinned to
|
|
126
|
+
*/
|
|
127
|
+
organizationId: string | null;
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Granted 'resource:action' permissions
|
|
131
|
+
*/
|
|
132
|
+
permissions: Array<string>;
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Coarse tier: READ, or WRITE for read and write
|
|
136
|
+
*/
|
|
137
|
+
scopes: Array<string>;
|
|
138
|
+
|
|
139
|
+
status: 'ACTIVE' | 'REVOKED' | null;
|
|
140
|
+
}
|
|
22
141
|
}
|
|
23
142
|
|
|
24
143
|
export interface MeGetResponse {
|
|
@@ -71,6 +190,147 @@ export namespace MeGetResponse {
|
|
|
71
190
|
}
|
|
72
191
|
}
|
|
73
192
|
|
|
193
|
+
export interface MeListAPIKeysResponse {
|
|
194
|
+
/**
|
|
195
|
+
* The credentials that act as the caller
|
|
196
|
+
*/
|
|
197
|
+
data: MeListAPIKeysResponse.Data;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
export namespace MeListAPIKeysResponse {
|
|
201
|
+
/**
|
|
202
|
+
* The credentials that act as the caller
|
|
203
|
+
*/
|
|
204
|
+
export interface Data {
|
|
205
|
+
apiKeys: Array<Data.APIKey>;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
export namespace Data {
|
|
209
|
+
/**
|
|
210
|
+
* A credential that acts as the caller
|
|
211
|
+
*/
|
|
212
|
+
export interface APIKey {
|
|
213
|
+
/**
|
|
214
|
+
* Roark ID of the credential. Pass it to DELETE to revoke.
|
|
215
|
+
*/
|
|
216
|
+
id: string;
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* ISO 8601 timestamp
|
|
220
|
+
*/
|
|
221
|
+
createdAt: string;
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* The project a request acts on when it sends no X-Roark-Project-Id header. Null
|
|
225
|
+
* once that project is deleted.
|
|
226
|
+
*/
|
|
227
|
+
defaultProjectId: string | null;
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* ISO 8601 timestamp, null if it never expires
|
|
231
|
+
*/
|
|
232
|
+
expiresAt: string | null;
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* ISO 8601 timestamp, null if never used
|
|
236
|
+
*/
|
|
237
|
+
lastUsedAt: string | null;
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* The label chosen when it was created
|
|
241
|
+
*/
|
|
242
|
+
name: string;
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* The organization this credential is pinned to
|
|
246
|
+
*/
|
|
247
|
+
organizationId: string | null;
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Granted 'resource:action' permissions
|
|
251
|
+
*/
|
|
252
|
+
permissions: Array<string>;
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Coarse tier: READ, or WRITE for read and write
|
|
256
|
+
*/
|
|
257
|
+
scopes: Array<string>;
|
|
258
|
+
|
|
259
|
+
status: 'ACTIVE' | 'REVOKED' | null;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
export interface MeRevokeAPIKeyResponse {
|
|
265
|
+
/**
|
|
266
|
+
* Result of revoking one of your credentials
|
|
267
|
+
*/
|
|
268
|
+
data: MeRevokeAPIKeyResponse.Data;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
export namespace MeRevokeAPIKeyResponse {
|
|
272
|
+
/**
|
|
273
|
+
* Result of revoking one of your credentials
|
|
274
|
+
*/
|
|
275
|
+
export interface Data {
|
|
276
|
+
id: string;
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* Always true when the credential was revoked
|
|
280
|
+
*/
|
|
281
|
+
deleted: true;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
export interface MeCreateAPIKeyParams {
|
|
286
|
+
/**
|
|
287
|
+
* A label you will recognise later. It is the only thing that tells two
|
|
288
|
+
* credentials apart in the list you revoke from.
|
|
289
|
+
*/
|
|
290
|
+
name: string;
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* ISO 8601 expiry. Defaults to the calling credential's own expiry (no expiry, for
|
|
294
|
+
* a `roark auth login` credential) and may not outlive it, so a short-lived
|
|
295
|
+
* connector credential cannot mint a permanent one.
|
|
296
|
+
*/
|
|
297
|
+
expiresAt?: string;
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* Granular 'resource:action' permissions. Defaults to the calling credential's own
|
|
301
|
+
* set, and can never exceed it. A ceiling, not an entitlement: the holder still
|
|
302
|
+
* only reaches what their project membership allows.
|
|
303
|
+
*/
|
|
304
|
+
permissions?: Array<string>;
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* Project the credential assumes when a request sends no X-Roark-Project-Id
|
|
308
|
+
* header. Defaults to the calling credential's own default project. You must be an
|
|
309
|
+
* admin of whichever project is used.
|
|
310
|
+
*/
|
|
311
|
+
projectId?: string;
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
* Coarse tier. Defaults to the calling credential's own tier, and can never exceed
|
|
315
|
+
* it: a READ credential cannot mint a WRITE one.
|
|
316
|
+
*/
|
|
317
|
+
scopes?: Array<'READ' | 'WRITE'>;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
export interface MeListAPIKeysParams {
|
|
321
|
+
/**
|
|
322
|
+
* Filter by status. Defaults to ACTIVE.
|
|
323
|
+
*/
|
|
324
|
+
status?: 'ACTIVE' | 'REVOKED';
|
|
325
|
+
}
|
|
326
|
+
|
|
74
327
|
export declare namespace Me {
|
|
75
|
-
export {
|
|
328
|
+
export {
|
|
329
|
+
type MeCreateAPIKeyResponse as MeCreateAPIKeyResponse,
|
|
330
|
+
type MeGetResponse as MeGetResponse,
|
|
331
|
+
type MeListAPIKeysResponse as MeListAPIKeysResponse,
|
|
332
|
+
type MeRevokeAPIKeyResponse as MeRevokeAPIKeyResponse,
|
|
333
|
+
type MeCreateAPIKeyParams as MeCreateAPIKeyParams,
|
|
334
|
+
type MeListAPIKeysParams as MeListAPIKeysParams,
|
|
335
|
+
};
|
|
76
336
|
}
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '4.
|
|
1
|
+
export const VERSION = '4.23.0'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "4.
|
|
1
|
+
export declare const VERSION = "4.23.0";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "4.
|
|
1
|
+
export declare const VERSION = "4.23.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '4.
|
|
1
|
+
export const VERSION = '4.23.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|