@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/resources/me.d.ts
CHANGED
|
@@ -2,6 +2,22 @@ import { APIResource } from "../core/resource.js";
|
|
|
2
2
|
import { APIPromise } from "../core/api-promise.js";
|
|
3
3
|
import { RequestOptions } from "../internal/request-options.js";
|
|
4
4
|
export declare class Me extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Mints a credential that acts as you, for a CLI or an automation. The key value
|
|
7
|
+
* is returned exactly once, in the `key` field: capture it now, it is unreadable
|
|
8
|
+
* afterwards. Requires a personal credential (a project API key is refused) and
|
|
9
|
+
* admin on the project the credential defaults to. The new credential can never
|
|
10
|
+
* exceed the one that created it: not in scope, not in permissions, and not in
|
|
11
|
+
* lifetime. Omit a field to copy it from the calling credential.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const response = await client.me.createAPIKey({
|
|
16
|
+
* name: 'CI deploy gate',
|
|
17
|
+
* });
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
createAPIKey(body: MeCreateAPIKeyParams, options?: RequestOptions): APIPromise<MeCreateAPIKeyResponse>;
|
|
5
21
|
/**
|
|
6
22
|
* Returns the scope of the credential making the request, the organization it acts
|
|
7
23
|
* in, its default project (if any) and the permissions it was granted. Works for
|
|
@@ -14,6 +30,84 @@ export declare class Me extends APIResource {
|
|
|
14
30
|
* ```
|
|
15
31
|
*/
|
|
16
32
|
get(options?: RequestOptions): APIPromise<MeGetResponse>;
|
|
33
|
+
/**
|
|
34
|
+
* Returns the credentials that act as you: the ones created in the dashboard, from
|
|
35
|
+
* `roark auth login`, and MCP connectors. Requires a personal credential; a
|
|
36
|
+
* project API key is refused. Defaults to ACTIVE, pass ?status=REVOKED to see
|
|
37
|
+
* revoked ones. The key value itself is never returned.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```ts
|
|
41
|
+
* const response = await client.me.listAPIKeys();
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
listAPIKeys(query?: MeListAPIKeysParams | null | undefined, options?: RequestOptions): APIPromise<MeListAPIKeysResponse>;
|
|
45
|
+
/**
|
|
46
|
+
* Revokes a credential that acts as you. It stops working immediately. A
|
|
47
|
+
* credential may revoke itself, which is what `roark auth logout` does. Repeating
|
|
48
|
+
* the call is safe; an unknown id, or one belonging to someone else, answers 404.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```ts
|
|
52
|
+
* const response = await client.me.revokeAPIKey('id');
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
revokeAPIKey(id: string, options?: RequestOptions): APIPromise<MeRevokeAPIKeyResponse>;
|
|
56
|
+
}
|
|
57
|
+
export interface MeCreateAPIKeyResponse {
|
|
58
|
+
/**
|
|
59
|
+
* The created credential, with its key
|
|
60
|
+
*/
|
|
61
|
+
data: MeCreateAPIKeyResponse.Data;
|
|
62
|
+
}
|
|
63
|
+
export declare namespace MeCreateAPIKeyResponse {
|
|
64
|
+
/**
|
|
65
|
+
* The created credential, with its key
|
|
66
|
+
*/
|
|
67
|
+
interface Data {
|
|
68
|
+
/**
|
|
69
|
+
* Roark ID of the credential. Pass it to DELETE to revoke.
|
|
70
|
+
*/
|
|
71
|
+
id: string;
|
|
72
|
+
/**
|
|
73
|
+
* ISO 8601 timestamp
|
|
74
|
+
*/
|
|
75
|
+
createdAt: string;
|
|
76
|
+
/**
|
|
77
|
+
* The project a request acts on when it sends no X-Roark-Project-Id header. Null
|
|
78
|
+
* once that project is deleted.
|
|
79
|
+
*/
|
|
80
|
+
defaultProjectId: string | null;
|
|
81
|
+
/**
|
|
82
|
+
* ISO 8601 timestamp, null if it never expires
|
|
83
|
+
*/
|
|
84
|
+
expiresAt: string | null;
|
|
85
|
+
/**
|
|
86
|
+
* The credential value. Returned only here, only once.
|
|
87
|
+
*/
|
|
88
|
+
key: string;
|
|
89
|
+
/**
|
|
90
|
+
* ISO 8601 timestamp, null if never used
|
|
91
|
+
*/
|
|
92
|
+
lastUsedAt: string | null;
|
|
93
|
+
/**
|
|
94
|
+
* The label chosen when it was created
|
|
95
|
+
*/
|
|
96
|
+
name: string;
|
|
97
|
+
/**
|
|
98
|
+
* The organization this credential is pinned to
|
|
99
|
+
*/
|
|
100
|
+
organizationId: string | null;
|
|
101
|
+
/**
|
|
102
|
+
* Granted 'resource:action' permissions
|
|
103
|
+
*/
|
|
104
|
+
permissions: Array<string>;
|
|
105
|
+
/**
|
|
106
|
+
* Coarse tier: READ, or WRITE for read and write
|
|
107
|
+
*/
|
|
108
|
+
scopes: Array<string>;
|
|
109
|
+
status: 'ACTIVE' | 'REVOKED' | null;
|
|
110
|
+
}
|
|
17
111
|
}
|
|
18
112
|
export interface MeGetResponse {
|
|
19
113
|
/**
|
|
@@ -50,7 +144,120 @@ export declare namespace MeGetResponse {
|
|
|
50
144
|
}
|
|
51
145
|
}
|
|
52
146
|
}
|
|
147
|
+
export interface MeListAPIKeysResponse {
|
|
148
|
+
/**
|
|
149
|
+
* The credentials that act as the caller
|
|
150
|
+
*/
|
|
151
|
+
data: MeListAPIKeysResponse.Data;
|
|
152
|
+
}
|
|
153
|
+
export declare namespace MeListAPIKeysResponse {
|
|
154
|
+
/**
|
|
155
|
+
* The credentials that act as the caller
|
|
156
|
+
*/
|
|
157
|
+
interface Data {
|
|
158
|
+
apiKeys: Array<Data.APIKey>;
|
|
159
|
+
}
|
|
160
|
+
namespace Data {
|
|
161
|
+
/**
|
|
162
|
+
* A credential that acts as the caller
|
|
163
|
+
*/
|
|
164
|
+
interface APIKey {
|
|
165
|
+
/**
|
|
166
|
+
* Roark ID of the credential. Pass it to DELETE to revoke.
|
|
167
|
+
*/
|
|
168
|
+
id: string;
|
|
169
|
+
/**
|
|
170
|
+
* ISO 8601 timestamp
|
|
171
|
+
*/
|
|
172
|
+
createdAt: string;
|
|
173
|
+
/**
|
|
174
|
+
* The project a request acts on when it sends no X-Roark-Project-Id header. Null
|
|
175
|
+
* once that project is deleted.
|
|
176
|
+
*/
|
|
177
|
+
defaultProjectId: string | null;
|
|
178
|
+
/**
|
|
179
|
+
* ISO 8601 timestamp, null if it never expires
|
|
180
|
+
*/
|
|
181
|
+
expiresAt: string | null;
|
|
182
|
+
/**
|
|
183
|
+
* ISO 8601 timestamp, null if never used
|
|
184
|
+
*/
|
|
185
|
+
lastUsedAt: string | null;
|
|
186
|
+
/**
|
|
187
|
+
* The label chosen when it was created
|
|
188
|
+
*/
|
|
189
|
+
name: string;
|
|
190
|
+
/**
|
|
191
|
+
* The organization this credential is pinned to
|
|
192
|
+
*/
|
|
193
|
+
organizationId: string | null;
|
|
194
|
+
/**
|
|
195
|
+
* Granted 'resource:action' permissions
|
|
196
|
+
*/
|
|
197
|
+
permissions: Array<string>;
|
|
198
|
+
/**
|
|
199
|
+
* Coarse tier: READ, or WRITE for read and write
|
|
200
|
+
*/
|
|
201
|
+
scopes: Array<string>;
|
|
202
|
+
status: 'ACTIVE' | 'REVOKED' | null;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
export interface MeRevokeAPIKeyResponse {
|
|
207
|
+
/**
|
|
208
|
+
* Result of revoking one of your credentials
|
|
209
|
+
*/
|
|
210
|
+
data: MeRevokeAPIKeyResponse.Data;
|
|
211
|
+
}
|
|
212
|
+
export declare namespace MeRevokeAPIKeyResponse {
|
|
213
|
+
/**
|
|
214
|
+
* Result of revoking one of your credentials
|
|
215
|
+
*/
|
|
216
|
+
interface Data {
|
|
217
|
+
id: string;
|
|
218
|
+
/**
|
|
219
|
+
* Always true when the credential was revoked
|
|
220
|
+
*/
|
|
221
|
+
deleted: true;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
export interface MeCreateAPIKeyParams {
|
|
225
|
+
/**
|
|
226
|
+
* A label you will recognise later. It is the only thing that tells two
|
|
227
|
+
* credentials apart in the list you revoke from.
|
|
228
|
+
*/
|
|
229
|
+
name: string;
|
|
230
|
+
/**
|
|
231
|
+
* ISO 8601 expiry. Defaults to the calling credential's own expiry (no expiry, for
|
|
232
|
+
* a `roark auth login` credential) and may not outlive it, so a short-lived
|
|
233
|
+
* connector credential cannot mint a permanent one.
|
|
234
|
+
*/
|
|
235
|
+
expiresAt?: string;
|
|
236
|
+
/**
|
|
237
|
+
* Granular 'resource:action' permissions. Defaults to the calling credential's own
|
|
238
|
+
* set, and can never exceed it. A ceiling, not an entitlement: the holder still
|
|
239
|
+
* only reaches what their project membership allows.
|
|
240
|
+
*/
|
|
241
|
+
permissions?: Array<string>;
|
|
242
|
+
/**
|
|
243
|
+
* Project the credential assumes when a request sends no X-Roark-Project-Id
|
|
244
|
+
* header. Defaults to the calling credential's own default project. You must be an
|
|
245
|
+
* admin of whichever project is used.
|
|
246
|
+
*/
|
|
247
|
+
projectId?: string;
|
|
248
|
+
/**
|
|
249
|
+
* Coarse tier. Defaults to the calling credential's own tier, and can never exceed
|
|
250
|
+
* it: a READ credential cannot mint a WRITE one.
|
|
251
|
+
*/
|
|
252
|
+
scopes?: Array<'READ' | 'WRITE'>;
|
|
253
|
+
}
|
|
254
|
+
export interface MeListAPIKeysParams {
|
|
255
|
+
/**
|
|
256
|
+
* Filter by status. Defaults to ACTIVE.
|
|
257
|
+
*/
|
|
258
|
+
status?: 'ACTIVE' | 'REVOKED';
|
|
259
|
+
}
|
|
53
260
|
export declare namespace Me {
|
|
54
|
-
export { type MeGetResponse as MeGetResponse };
|
|
261
|
+
export { type MeCreateAPIKeyResponse as MeCreateAPIKeyResponse, type MeGetResponse as MeGetResponse, type MeListAPIKeysResponse as MeListAPIKeysResponse, type MeRevokeAPIKeyResponse as MeRevokeAPIKeyResponse, type MeCreateAPIKeyParams as MeCreateAPIKeyParams, type MeListAPIKeysParams as MeListAPIKeysParams, };
|
|
55
262
|
}
|
|
56
263
|
//# sourceMappingURL=me.d.ts.map
|
package/resources/me.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"me.d.ts","sourceRoot":"","sources":["../src/resources/me.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,4BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,+BAA4B;AACjD,OAAO,EAAE,cAAc,EAAE,uCAAoC;
|
|
1
|
+
{"version":3,"file":"me.d.ts","sourceRoot":"","sources":["../src/resources/me.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,4BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,+BAA4B;AACjD,OAAO,EAAE,cAAc,EAAE,uCAAoC;AAG7D,qBAAa,EAAG,SAAQ,WAAW;IACjC;;;;;;;;;;;;;;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ACjD,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH"}
|
package/resources/me.js
CHANGED
|
@@ -3,7 +3,26 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.Me = void 0;
|
|
5
5
|
const resource_1 = require("../core/resource.js");
|
|
6
|
+
const path_1 = require("../internal/utils/path.js");
|
|
6
7
|
class Me extends resource_1.APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Mints a credential that acts as you, for a CLI or an automation. The key value
|
|
10
|
+
* is returned exactly once, in the `key` field: capture it now, it is unreadable
|
|
11
|
+
* afterwards. Requires a personal credential (a project API key is refused) and
|
|
12
|
+
* admin on the project the credential defaults to. The new credential can never
|
|
13
|
+
* exceed the one that created it: not in scope, not in permissions, and not in
|
|
14
|
+
* lifetime. Omit a field to copy it from the calling credential.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* const response = await client.me.createAPIKey({
|
|
19
|
+
* name: 'CI deploy gate',
|
|
20
|
+
* });
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
createAPIKey(body, options) {
|
|
24
|
+
return this._client.post('/v1/me/api-keys', { body, ...options });
|
|
25
|
+
}
|
|
7
26
|
/**
|
|
8
27
|
* Returns the scope of the credential making the request, the organization it acts
|
|
9
28
|
* in, its default project (if any) and the permissions it was granted. Works for
|
|
@@ -18,6 +37,33 @@ class Me extends resource_1.APIResource {
|
|
|
18
37
|
get(options) {
|
|
19
38
|
return this._client.get('/v1/me', options);
|
|
20
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* Returns the credentials that act as you: the ones created in the dashboard, from
|
|
42
|
+
* `roark auth login`, and MCP connectors. Requires a personal credential; a
|
|
43
|
+
* project API key is refused. Defaults to ACTIVE, pass ?status=REVOKED to see
|
|
44
|
+
* revoked ones. The key value itself is never returned.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```ts
|
|
48
|
+
* const response = await client.me.listAPIKeys();
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
listAPIKeys(query = {}, options) {
|
|
52
|
+
return this._client.get('/v1/me/api-keys', { query, ...options });
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Revokes a credential that acts as you. It stops working immediately. A
|
|
56
|
+
* credential may revoke itself, which is what `roark auth logout` does. Repeating
|
|
57
|
+
* the call is safe; an unknown id, or one belonging to someone else, answers 404.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```ts
|
|
61
|
+
* const response = await client.me.revokeAPIKey('id');
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
revokeAPIKey(id, options) {
|
|
65
|
+
return this._client.delete((0, path_1.path) `/v1/me/api-keys/${id}`, options);
|
|
66
|
+
}
|
|
21
67
|
}
|
|
22
68
|
exports.Me = Me;
|
|
23
69
|
//# sourceMappingURL=me.js.map
|
package/resources/me.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"me.js","sourceRoot":"","sources":["../src/resources/me.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;
|
|
1
|
+
{"version":3,"file":"me.js","sourceRoot":"","sources":["../src/resources/me.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAG/C,oDAA8C;AAE9C,MAAa,EAAG,SAAQ,sBAAW;IACjC;;;;;;;;;;;;;;OAcG;IACH,YAAY,CAAC,IAA0B,EAAE,OAAwB;QAC/D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,iBAAiB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACpE,CAAC;IAED;;;;;;;;;;OAUG;IACH,GAAG,CAAC,OAAwB;QAC1B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC7C,CAAC;IAED;;;;;;;;;;OAUG;IACH,WAAW,CACT,QAAgD,EAAE,EAClD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACpE,CAAC;IAED;;;;;;;;;OASG;IACH,YAAY,CAAC,EAAU,EAAE,OAAwB;QAC/C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,mBAAmB,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACnE,CAAC;CACF;AAlED,gBAkEC"}
|
package/resources/me.mjs
CHANGED
|
@@ -1,6 +1,25 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
import { APIResource } from "../core/resource.mjs";
|
|
3
|
+
import { path } from "../internal/utils/path.mjs";
|
|
3
4
|
export class Me extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Mints a credential that acts as you, for a CLI or an automation. The key value
|
|
7
|
+
* is returned exactly once, in the `key` field: capture it now, it is unreadable
|
|
8
|
+
* afterwards. Requires a personal credential (a project API key is refused) and
|
|
9
|
+
* admin on the project the credential defaults to. The new credential can never
|
|
10
|
+
* exceed the one that created it: not in scope, not in permissions, and not in
|
|
11
|
+
* lifetime. Omit a field to copy it from the calling credential.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const response = await client.me.createAPIKey({
|
|
16
|
+
* name: 'CI deploy gate',
|
|
17
|
+
* });
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
createAPIKey(body, options) {
|
|
21
|
+
return this._client.post('/v1/me/api-keys', { body, ...options });
|
|
22
|
+
}
|
|
4
23
|
/**
|
|
5
24
|
* Returns the scope of the credential making the request, the organization it acts
|
|
6
25
|
* in, its default project (if any) and the permissions it was granted. Works for
|
|
@@ -15,5 +34,32 @@ export class Me extends APIResource {
|
|
|
15
34
|
get(options) {
|
|
16
35
|
return this._client.get('/v1/me', options);
|
|
17
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* Returns the credentials that act as you: the ones created in the dashboard, from
|
|
39
|
+
* `roark auth login`, and MCP connectors. Requires a personal credential; a
|
|
40
|
+
* project API key is refused. Defaults to ACTIVE, pass ?status=REVOKED to see
|
|
41
|
+
* revoked ones. The key value itself is never returned.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```ts
|
|
45
|
+
* const response = await client.me.listAPIKeys();
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
listAPIKeys(query = {}, options) {
|
|
49
|
+
return this._client.get('/v1/me/api-keys', { query, ...options });
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Revokes a credential that acts as you. It stops working immediately. A
|
|
53
|
+
* credential may revoke itself, which is what `roark auth logout` does. Repeating
|
|
54
|
+
* the call is safe; an unknown id, or one belonging to someone else, answers 404.
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```ts
|
|
58
|
+
* const response = await client.me.revokeAPIKey('id');
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
revokeAPIKey(id, options) {
|
|
62
|
+
return this._client.delete(path `/v1/me/api-keys/${id}`, options);
|
|
63
|
+
}
|
|
18
64
|
}
|
|
19
65
|
//# sourceMappingURL=me.mjs.map
|
package/resources/me.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"me.mjs","sourceRoot":"","sources":["../src/resources/me.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;
|
|
1
|
+
{"version":3,"file":"me.mjs","sourceRoot":"","sources":["../src/resources/me.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAG/C,OAAO,EAAE,IAAI,EAAE,mCAA+B;AAE9C,MAAM,OAAO,EAAG,SAAQ,WAAW;IACjC;;;;;;;;;;;;;;OAcG;IACH,YAAY,CAAC,IAA0B,EAAE,OAAwB;QAC/D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,iBAAiB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACpE,CAAC;IAED;;;;;;;;;;OAUG;IACH,GAAG,CAAC,OAAwB;QAC1B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC7C,CAAC;IAED;;;;;;;;;;OAUG;IACH,WAAW,CACT,QAAgD,EAAE,EAClD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACpE,CAAC;IAED;;;;;;;;;OASG;IACH,YAAY,CAAC,EAAU,EAAE,OAAwB;QAC/C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,mBAAmB,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACnE,CAAC;CACF"}
|
package/src/client.ts
CHANGED
|
@@ -152,7 +152,15 @@ import {
|
|
|
152
152
|
HTTPRequestDefinitionUpdateParams,
|
|
153
153
|
HTTPRequestDefinitionUpdateResponse,
|
|
154
154
|
} from './resources/http-request-definition';
|
|
155
|
-
import {
|
|
155
|
+
import {
|
|
156
|
+
Me,
|
|
157
|
+
MeCreateAPIKeyParams,
|
|
158
|
+
MeCreateAPIKeyResponse,
|
|
159
|
+
MeGetResponse,
|
|
160
|
+
MeListAPIKeysParams,
|
|
161
|
+
MeListAPIKeysResponse,
|
|
162
|
+
MeRevokeAPIKeyResponse,
|
|
163
|
+
} from './resources/me';
|
|
156
164
|
import {
|
|
157
165
|
Metric,
|
|
158
166
|
MetricCreateDefinitionParams,
|
|
@@ -1082,7 +1090,15 @@ export declare namespace Roark {
|
|
|
1082
1090
|
|
|
1083
1091
|
export { Health as Health, type HealthGetResponse as HealthGetResponse };
|
|
1084
1092
|
|
|
1085
|
-
export {
|
|
1093
|
+
export {
|
|
1094
|
+
Me as Me,
|
|
1095
|
+
type MeCreateAPIKeyResponse as MeCreateAPIKeyResponse,
|
|
1096
|
+
type MeGetResponse as MeGetResponse,
|
|
1097
|
+
type MeListAPIKeysResponse as MeListAPIKeysResponse,
|
|
1098
|
+
type MeRevokeAPIKeyResponse as MeRevokeAPIKeyResponse,
|
|
1099
|
+
type MeCreateAPIKeyParams as MeCreateAPIKeyParams,
|
|
1100
|
+
type MeListAPIKeysParams as MeListAPIKeysParams,
|
|
1101
|
+
};
|
|
1086
1102
|
|
|
1087
1103
|
export { Project as Project, type ProjectListResponse as ProjectListResponse };
|
|
1088
1104
|
|
package/src/resources/call.ts
CHANGED
|
@@ -1923,6 +1923,20 @@ export interface CallListParams {
|
|
|
1923
1923
|
*/
|
|
1924
1924
|
after?: string;
|
|
1925
1925
|
|
|
1926
|
+
/**
|
|
1927
|
+
* true: only simulated calls their run's results count (not invalidated, for
|
|
1928
|
+
* example because the agent never spoke). false: only the simulated calls the
|
|
1929
|
+
* results leave out, each invalidated. Live calls, and calls removed from their
|
|
1930
|
+
* run, match neither.
|
|
1931
|
+
*/
|
|
1932
|
+
countedInResults?: 'true' | 'false';
|
|
1933
|
+
|
|
1934
|
+
/**
|
|
1935
|
+
* true: leave out calls from runs hidden from the runs list. Live calls stay in.
|
|
1936
|
+
* false is the same as leaving it out.
|
|
1937
|
+
*/
|
|
1938
|
+
excludeHiddenRuns?: 'true' | 'false';
|
|
1939
|
+
|
|
1926
1940
|
/**
|
|
1927
1941
|
* Maximum number of calls to return (default: 20, max: 100)
|
|
1928
1942
|
*/
|
|
@@ -1933,12 +1947,23 @@ export interface CallListParams {
|
|
|
1933
1947
|
*/
|
|
1934
1948
|
searchText?: string;
|
|
1935
1949
|
|
|
1950
|
+
/**
|
|
1951
|
+
* Calls from every run of any of these run plans, comma-separated, at most 100
|
|
1952
|
+
*/
|
|
1953
|
+
simulationRunPlanIds?: string;
|
|
1954
|
+
|
|
1936
1955
|
/**
|
|
1937
1956
|
* Filter by simulation run plan job ID to get all calls from a specific simulation
|
|
1938
1957
|
* batch
|
|
1939
1958
|
*/
|
|
1940
1959
|
simulationRunPlanJobId?: string;
|
|
1941
1960
|
|
|
1961
|
+
/**
|
|
1962
|
+
* Calls from any of these simulation runs (run plan job ids), comma-separated, at
|
|
1963
|
+
* most 100
|
|
1964
|
+
*/
|
|
1965
|
+
simulationRunPlanJobIds?: string;
|
|
1966
|
+
|
|
1942
1967
|
/**
|
|
1943
1968
|
* Field to sort by (default: createdAt)
|
|
1944
1969
|
*/
|
package/src/resources/index.ts
CHANGED
|
@@ -135,7 +135,15 @@ export {
|
|
|
135
135
|
type HTTPRequestDefinitionListParams,
|
|
136
136
|
} from './http-request-definition';
|
|
137
137
|
export { Health, type HealthGetResponse } from './health';
|
|
138
|
-
export {
|
|
138
|
+
export {
|
|
139
|
+
Me,
|
|
140
|
+
type MeCreateAPIKeyResponse,
|
|
141
|
+
type MeGetResponse,
|
|
142
|
+
type MeListAPIKeysResponse,
|
|
143
|
+
type MeRevokeAPIKeyResponse,
|
|
144
|
+
type MeCreateAPIKeyParams,
|
|
145
|
+
type MeListAPIKeysParams,
|
|
146
|
+
} from './me';
|
|
139
147
|
export {
|
|
140
148
|
Metric,
|
|
141
149
|
type MetricCreateDefinitionResponse,
|