bem-ai-sdk 0.26.0 → 0.27.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 +14 -0
- package/client.d.mts +127 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +127 -2
- package/client.d.ts.map +1 -1
- package/client.js +136 -3
- package/client.js.map +1 -1
- package/client.mjs +136 -3
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/buckets.d.mts +272 -0
- package/resources/buckets.d.mts.map +1 -0
- package/resources/buckets.d.ts +272 -0
- package/resources/buckets.d.ts.map +1 -0
- package/resources/buckets.js +93 -0
- package/resources/buckets.js.map +1 -0
- package/resources/buckets.mjs +89 -0
- package/resources/buckets.mjs.map +1 -0
- package/resources/entities/entities.d.mts +516 -0
- package/resources/entities/entities.d.mts.map +1 -0
- package/resources/entities/entities.d.ts +516 -0
- package/resources/entities/entities.d.ts.map +1 -0
- package/resources/entities/entities.js +93 -0
- package/resources/entities/entities.js.map +1 -0
- package/resources/entities/entities.mjs +88 -0
- package/resources/entities/entities.mjs.map +1 -0
- package/resources/entities/index.d.mts +3 -0
- package/resources/entities/index.d.mts.map +1 -0
- package/resources/entities/index.d.ts +3 -0
- package/resources/entities/index.d.ts.map +1 -0
- package/resources/entities/index.js +9 -0
- package/resources/entities/index.js.map +1 -0
- package/resources/entities/index.mjs +4 -0
- package/resources/entities/index.mjs.map +1 -0
- package/resources/entities/synonyms.d.mts +109 -0
- package/resources/entities/synonyms.d.mts.map +1 -0
- package/resources/entities/synonyms.d.ts +109 -0
- package/resources/entities/synonyms.d.ts.map +1 -0
- package/resources/entities/synonyms.js +61 -0
- package/resources/entities/synonyms.js.map +1 -0
- package/resources/entities/synonyms.mjs +57 -0
- package/resources/entities/synonyms.mjs.map +1 -0
- package/resources/entities.d.mts +2 -0
- package/resources/entities.d.mts.map +1 -0
- package/resources/entities.d.ts +2 -0
- package/resources/entities.d.ts.map +1 -0
- package/resources/entities.js +6 -0
- package/resources/entities.js.map +1 -0
- package/resources/entities.mjs +3 -0
- package/resources/entities.mjs.map +1 -0
- package/resources/entity-types/entity-types.d.mts +302 -0
- package/resources/entity-types/entity-types.d.mts.map +1 -0
- package/resources/entity-types/entity-types.d.ts +302 -0
- package/resources/entity-types/entity-types.d.ts.map +1 -0
- package/resources/entity-types/entity-types.js +104 -0
- package/resources/entity-types/entity-types.js.map +1 -0
- package/resources/entity-types/entity-types.mjs +99 -0
- package/resources/entity-types/entity-types.mjs.map +1 -0
- package/resources/entity-types/index.d.mts +3 -0
- package/resources/entity-types/index.d.mts.map +1 -0
- package/resources/entity-types/index.d.ts +3 -0
- package/resources/entity-types/index.d.ts.map +1 -0
- package/resources/entity-types/index.js +9 -0
- package/resources/entity-types/index.js.map +1 -0
- package/resources/entity-types/index.mjs +4 -0
- package/resources/entity-types/index.mjs.map +1 -0
- package/resources/entity-types/reviewers.d.mts +136 -0
- package/resources/entity-types/reviewers.d.mts.map +1 -0
- package/resources/entity-types/reviewers.d.ts +136 -0
- package/resources/entity-types/reviewers.d.ts.map +1 -0
- package/resources/entity-types/reviewers.js +74 -0
- package/resources/entity-types/reviewers.js.map +1 -0
- package/resources/entity-types/reviewers.mjs +70 -0
- package/resources/entity-types/reviewers.mjs.map +1 -0
- package/resources/entity-types.d.mts +2 -0
- package/resources/entity-types.d.mts.map +1 -0
- package/resources/entity-types.d.ts +2 -0
- package/resources/entity-types.d.ts.map +1 -0
- package/resources/entity-types.js +6 -0
- package/resources/entity-types.js.map +1 -0
- package/resources/entity-types.mjs +3 -0
- package/resources/entity-types.mjs.map +1 -0
- package/resources/eval/eval.d.mts +4 -0
- package/resources/eval/eval.d.mts.map +1 -1
- package/resources/eval/eval.d.ts +4 -0
- package/resources/eval/eval.d.ts.map +1 -1
- package/resources/eval/eval.js +4 -0
- package/resources/eval/eval.js.map +1 -1
- package/resources/eval/eval.mjs +4 -0
- package/resources/eval/eval.mjs.map +1 -1
- package/resources/eval/index.d.mts +1 -0
- package/resources/eval/index.d.mts.map +1 -1
- package/resources/eval/index.d.ts +1 -0
- package/resources/eval/index.d.ts.map +1 -1
- package/resources/eval/index.js +3 -1
- package/resources/eval/index.js.map +1 -1
- package/resources/eval/index.mjs +1 -0
- package/resources/eval/index.mjs.map +1 -1
- package/resources/eval/score.d.mts +486 -0
- package/resources/eval/score.d.mts.map +1 -0
- package/resources/eval/score.d.ts +486 -0
- package/resources/eval/score.d.ts.map +1 -0
- package/resources/eval/score.js +126 -0
- package/resources/eval/score.js.map +1 -0
- package/resources/eval/score.mjs +122 -0
- package/resources/eval/score.mjs.map +1 -0
- package/resources/fs.d.mts +28 -0
- package/resources/fs.d.mts.map +1 -1
- package/resources/fs.d.ts +28 -0
- package/resources/fs.d.ts.map +1 -1
- package/resources/index.d.mts +6 -0
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +6 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +13 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +6 -0
- package/resources/index.mjs.map +1 -1
- package/resources/knowledge-graph.d.mts +125 -0
- package/resources/knowledge-graph.d.mts.map +1 -0
- package/resources/knowledge-graph.d.ts +125 -0
- package/resources/knowledge-graph.d.ts.map +1 -0
- package/resources/knowledge-graph.js +34 -0
- package/resources/knowledge-graph.js.map +1 -0
- package/resources/knowledge-graph.mjs +30 -0
- package/resources/knowledge-graph.mjs.map +1 -0
- package/resources/review-queue.d.mts +192 -0
- package/resources/review-queue.d.mts.map +1 -0
- package/resources/review-queue.d.ts +192 -0
- package/resources/review-queue.d.ts.map +1 -0
- package/resources/review-queue.js +49 -0
- package/resources/review-queue.js.map +1 -0
- package/resources/review-queue.mjs +45 -0
- package/resources/review-queue.mjs.map +1 -0
- package/resources/subscriptions.d.mts +14 -2
- package/resources/subscriptions.d.mts.map +1 -1
- package/resources/subscriptions.d.ts +14 -2
- package/resources/subscriptions.d.ts.map +1 -1
- package/resources/subscriptions.js +14 -2
- package/resources/subscriptions.js.map +1 -1
- package/resources/subscriptions.mjs +14 -2
- package/resources/subscriptions.mjs.map +1 -1
- package/resources/users.d.mts +62 -0
- package/resources/users.d.mts.map +1 -0
- package/resources/users.d.ts +62 -0
- package/resources/users.d.ts.map +1 -0
- package/resources/users.js +35 -0
- package/resources/users.js.map +1 -0
- package/resources/users.mjs +31 -0
- package/resources/users.mjs.map +1 -0
- package/src/client.ts +220 -3
- package/src/resources/buckets.ts +351 -0
- package/src/resources/entities/entities.ts +639 -0
- package/src/resources/entities/index.ts +20 -0
- package/src/resources/entities/synonyms.ts +140 -0
- package/src/resources/entities.ts +3 -0
- package/src/resources/entity-types/entity-types.ts +396 -0
- package/src/resources/entity-types/index.ts +19 -0
- package/src/resources/entity-types/reviewers.ts +175 -0
- package/src/resources/entity-types.ts +3 -0
- package/src/resources/eval/eval.ts +18 -0
- package/src/resources/eval/index.ts +7 -0
- package/src/resources/eval/score.ts +590 -0
- package/src/resources/fs.ts +30 -0
- package/src/resources/index.ts +40 -0
- package/src/resources/knowledge-graph.ts +153 -0
- package/src/resources/review-queue.ts +234 -0
- package/src/resources/subscriptions.ts +14 -2
- package/src/resources/users.ts +76 -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,104 @@
|
|
|
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.EntityTypes = void 0;
|
|
5
|
+
const tslib_1 = require("../../internal/tslib.js");
|
|
6
|
+
const resource_1 = require("../../core/resource.js");
|
|
7
|
+
const ReviewersAPI = tslib_1.__importStar(require("./reviewers.js"));
|
|
8
|
+
const reviewers_1 = require("./reviewers.js");
|
|
9
|
+
const headers_1 = require("../../internal/headers.js");
|
|
10
|
+
const path_1 = require("../../internal/utils/path.js");
|
|
11
|
+
/**
|
|
12
|
+
* Entity Types are the customer-defined taxonomy for the knowledge graph,
|
|
13
|
+
* scoped to an account+environment. Each type has a unique, immutable name
|
|
14
|
+
* and can be organised into hierarchies via `parentTypeID`. A type may
|
|
15
|
+
* carry per-type structured attribute metadata in `attributeSchema` (for
|
|
16
|
+
* example `{"unit": "mg", "range": [0, 100]}`).
|
|
17
|
+
*
|
|
18
|
+
* Use these endpoints to create, list, fetch, update, and delete entity
|
|
19
|
+
* types:
|
|
20
|
+
*
|
|
21
|
+
* - **`POST /v3/entity-types`** creates a type, optionally under a parent.
|
|
22
|
+
* - **`GET /v3/entity-types`** lists types with cursor pagination
|
|
23
|
+
* (`startingAfter` / `endingBefore` over `typeID`) and an optional
|
|
24
|
+
* `parentTypeId` filter for direct children.
|
|
25
|
+
* - **`PATCH /v3/entity-types/{typeID}`** updates `description`,
|
|
26
|
+
* `parentTypeID`, and/or `attributeSchema`. The `name` is immutable.
|
|
27
|
+
* - **`DELETE /v3/entity-types/{typeID}`** soft-deletes a type. The request
|
|
28
|
+
* is rejected with `409 Conflict` while any live entity is assigned to
|
|
29
|
+
* the type or any live child type points at it.
|
|
30
|
+
*/
|
|
31
|
+
class EntityTypes extends resource_1.APIResource {
|
|
32
|
+
constructor() {
|
|
33
|
+
super(...arguments);
|
|
34
|
+
this.reviewers = new ReviewersAPI.Reviewers(this._client);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Create an Entity Type
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```ts
|
|
41
|
+
* const entityType = await client.entityTypes.create({
|
|
42
|
+
* name: 'Drug',
|
|
43
|
+
* description: 'A pharmaceutical compound',
|
|
44
|
+
* });
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
create(body, options) {
|
|
48
|
+
return this._client.post('/v3/entity-types', { body, ...options });
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Get an Entity Type
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```ts
|
|
55
|
+
* const entityType = await client.entityTypes.retrieve(
|
|
56
|
+
* 'typeID',
|
|
57
|
+
* );
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
retrieve(typeID, options) {
|
|
61
|
+
return this._client.get((0, path_1.path) `/v3/entity-types/${typeID}`, options);
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Update an Entity Type
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```ts
|
|
68
|
+
* const entityType = await client.entityTypes.update(
|
|
69
|
+
* 'typeID',
|
|
70
|
+
* );
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
update(typeID, body, options) {
|
|
74
|
+
return this._client.patch((0, path_1.path) `/v3/entity-types/${typeID}`, { body, ...options });
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* List Entity Types
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* ```ts
|
|
81
|
+
* const entityTypes = await client.entityTypes.list();
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
84
|
+
list(query = {}, options) {
|
|
85
|
+
return this._client.get('/v3/entity-types', { query, ...options });
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Delete an Entity Type
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* ```ts
|
|
92
|
+
* await client.entityTypes.delete('typeID');
|
|
93
|
+
* ```
|
|
94
|
+
*/
|
|
95
|
+
delete(typeID, options) {
|
|
96
|
+
return this._client.delete((0, path_1.path) `/v3/entity-types/${typeID}`, {
|
|
97
|
+
...options,
|
|
98
|
+
headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
exports.EntityTypes = EntityTypes;
|
|
103
|
+
EntityTypes.Reviewers = reviewers_1.Reviewers;
|
|
104
|
+
//# sourceMappingURL=entity-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity-types.js","sourceRoot":"","sources":["../../src/resources/entity-types/entity-types.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAClD,qEAA4C;AAC5C,8CAMqB;AAErB,uDAAsD;AAEtD,uDAAiD;AAEjD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAa,WAAY,SAAQ,sBAAW;IAA5C;;QACE,cAAS,GAA2B,IAAI,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IA8E/E,CAAC;IA5EC;;;;;;;;;;OAUG;IACH,MAAM,CAAC,IAA4B,EAAE,OAAwB;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrE,CAAC;IAED;;;;;;;;;OASG;IACH,QAAQ,CAAC,MAAc,EAAE,OAAwB;QAC/C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,oBAAoB,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;IACrE,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CACJ,MAAc,EACd,IAA4B,EAC5B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAA,WAAI,EAAA,oBAAoB,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACpF,CAAC;IAED;;;;;;;OAOG;IACH,IAAI,CACF,QAAiD,EAAE,EACnD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrE,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,MAAc,EAAE,OAAwB;QAC7C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,oBAAoB,MAAM,EAAE,EAAE;YAC3D,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;CACF;AA/ED,kCA+EC;AAoQD,WAAW,CAAC,SAAS,GAAG,qBAAS,CAAC"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
3
|
+
import * as ReviewersAPI from "./reviewers.mjs";
|
|
4
|
+
import { Reviewers, } from "./reviewers.mjs";
|
|
5
|
+
import { buildHeaders } from "../../internal/headers.mjs";
|
|
6
|
+
import { path } from "../../internal/utils/path.mjs";
|
|
7
|
+
/**
|
|
8
|
+
* Entity Types are the customer-defined taxonomy for the knowledge graph,
|
|
9
|
+
* scoped to an account+environment. Each type has a unique, immutable name
|
|
10
|
+
* and can be organised into hierarchies via `parentTypeID`. A type may
|
|
11
|
+
* carry per-type structured attribute metadata in `attributeSchema` (for
|
|
12
|
+
* example `{"unit": "mg", "range": [0, 100]}`).
|
|
13
|
+
*
|
|
14
|
+
* Use these endpoints to create, list, fetch, update, and delete entity
|
|
15
|
+
* types:
|
|
16
|
+
*
|
|
17
|
+
* - **`POST /v3/entity-types`** creates a type, optionally under a parent.
|
|
18
|
+
* - **`GET /v3/entity-types`** lists types with cursor pagination
|
|
19
|
+
* (`startingAfter` / `endingBefore` over `typeID`) and an optional
|
|
20
|
+
* `parentTypeId` filter for direct children.
|
|
21
|
+
* - **`PATCH /v3/entity-types/{typeID}`** updates `description`,
|
|
22
|
+
* `parentTypeID`, and/or `attributeSchema`. The `name` is immutable.
|
|
23
|
+
* - **`DELETE /v3/entity-types/{typeID}`** soft-deletes a type. The request
|
|
24
|
+
* is rejected with `409 Conflict` while any live entity is assigned to
|
|
25
|
+
* the type or any live child type points at it.
|
|
26
|
+
*/
|
|
27
|
+
export class EntityTypes extends APIResource {
|
|
28
|
+
constructor() {
|
|
29
|
+
super(...arguments);
|
|
30
|
+
this.reviewers = new ReviewersAPI.Reviewers(this._client);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Create an Entity Type
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```ts
|
|
37
|
+
* const entityType = await client.entityTypes.create({
|
|
38
|
+
* name: 'Drug',
|
|
39
|
+
* description: 'A pharmaceutical compound',
|
|
40
|
+
* });
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
create(body, options) {
|
|
44
|
+
return this._client.post('/v3/entity-types', { body, ...options });
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Get an Entity Type
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts
|
|
51
|
+
* const entityType = await client.entityTypes.retrieve(
|
|
52
|
+
* 'typeID',
|
|
53
|
+
* );
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
retrieve(typeID, options) {
|
|
57
|
+
return this._client.get(path `/v3/entity-types/${typeID}`, options);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Update an Entity Type
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```ts
|
|
64
|
+
* const entityType = await client.entityTypes.update(
|
|
65
|
+
* 'typeID',
|
|
66
|
+
* );
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
update(typeID, body, options) {
|
|
70
|
+
return this._client.patch(path `/v3/entity-types/${typeID}`, { body, ...options });
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* List Entity Types
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```ts
|
|
77
|
+
* const entityTypes = await client.entityTypes.list();
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
list(query = {}, options) {
|
|
81
|
+
return this._client.get('/v3/entity-types', { query, ...options });
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Delete an Entity Type
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```ts
|
|
88
|
+
* await client.entityTypes.delete('typeID');
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
delete(typeID, options) {
|
|
92
|
+
return this._client.delete(path `/v3/entity-types/${typeID}`, {
|
|
93
|
+
...options,
|
|
94
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
EntityTypes.Reviewers = Reviewers;
|
|
99
|
+
//# sourceMappingURL=entity-types.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity-types.mjs","sourceRoot":"","sources":["../../src/resources/entity-types/entity-types.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,KAAK,YAAY,wBAAoB;AAC5C,OAAO,EAKL,SAAS,GACV,wBAAoB;AAErB,OAAO,EAAE,YAAY,EAAE,mCAA+B;AAEtD,OAAO,EAAE,IAAI,EAAE,sCAAkC;AAEjD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,OAAO,WAAY,SAAQ,WAAW;IAA5C;;QACE,cAAS,GAA2B,IAAI,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IA8E/E,CAAC;IA5EC;;;;;;;;;;OAUG;IACH,MAAM,CAAC,IAA4B,EAAE,OAAwB;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrE,CAAC;IAED;;;;;;;;;OASG;IACH,QAAQ,CAAC,MAAc,EAAE,OAAwB;QAC/C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,oBAAoB,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;IACrE,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CACJ,MAAc,EACd,IAA4B,EAC5B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAA,oBAAoB,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACpF,CAAC;IAED;;;;;;;OAOG;IACH,IAAI,CACF,QAAiD,EAAE,EACnD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrE,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,MAAc,EAAE,OAAwB;QAC7C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,oBAAoB,MAAM,EAAE,EAAE;YAC3D,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;CACF;AAoQD,WAAW,CAAC,SAAS,GAAG,SAAS,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { EntityTypes, type EntityTypeCreateResponse, type EntityTypeRetrieveResponse, type EntityTypeUpdateResponse, type EntityTypeListResponse, type EntityTypeCreateParams, type EntityTypeUpdateParams, type EntityTypeListParams, } from "./entity-types.mjs";
|
|
2
|
+
export { Reviewers, type ReviewerListResponse, type ReviewerAssignResponse, type ReviewerAssignParams, type ReviewerRemoveParams, } from "./reviewers.mjs";
|
|
3
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/resources/entity-types/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,WAAW,EACX,KAAK,wBAAwB,EAC7B,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,GAC1B,2BAAuB;AACxB,OAAO,EACL,SAAS,EACT,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,GAC1B,wBAAoB"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { EntityTypes, type EntityTypeCreateResponse, type EntityTypeRetrieveResponse, type EntityTypeUpdateResponse, type EntityTypeListResponse, type EntityTypeCreateParams, type EntityTypeUpdateParams, type EntityTypeListParams, } from "./entity-types.js";
|
|
2
|
+
export { Reviewers, type ReviewerListResponse, type ReviewerAssignResponse, type ReviewerAssignParams, type ReviewerRemoveParams, } from "./reviewers.js";
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/entity-types/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,WAAW,EACX,KAAK,wBAAwB,EAC7B,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,GAC1B,0BAAuB;AACxB,OAAO,EACL,SAAS,EACT,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,GAC1B,uBAAoB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
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.Reviewers = exports.EntityTypes = void 0;
|
|
5
|
+
var entity_types_1 = require("./entity-types.js");
|
|
6
|
+
Object.defineProperty(exports, "EntityTypes", { enumerable: true, get: function () { return entity_types_1.EntityTypes; } });
|
|
7
|
+
var reviewers_1 = require("./reviewers.js");
|
|
8
|
+
Object.defineProperty(exports, "Reviewers", { enumerable: true, get: function () { return reviewers_1.Reviewers; } });
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/entity-types/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDASwB;AARtB,2GAAA,WAAW,OAAA;AASb,4CAMqB;AALnB,sGAAA,SAAS,OAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/resources/entity-types/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EACL,WAAW,GAQZ,2BAAuB;AACxB,OAAO,EACL,SAAS,GAKV,wBAAoB"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
2
|
+
import { APIPromise } from "../../core/api-promise.mjs";
|
|
3
|
+
import { RequestOptions } from "../../internal/request-options.mjs";
|
|
4
|
+
/**
|
|
5
|
+
* Reviewer assignments link users to the entity types they are responsible
|
|
6
|
+
* for reviewing, scoped to an account+environment. These are dashboard-only
|
|
7
|
+
* endpoints: an assignment needs a user identity, which only the dashboard
|
|
8
|
+
* (JWT) surface carries.
|
|
9
|
+
*
|
|
10
|
+
* - **`POST /v3/entity-types/{typeID}/reviewers`** assigns a user as a
|
|
11
|
+
* reviewer of the type. The assignment is idempotent: re-assigning an
|
|
12
|
+
* existing reviewer returns the existing assignment. Requires the `admin`
|
|
13
|
+
* role.
|
|
14
|
+
* - **`GET /v3/entity-types/{typeID}/reviewers`** lists the users assigned
|
|
15
|
+
* to review the type, with each user's email and role. Requires the
|
|
16
|
+
* `operator` role.
|
|
17
|
+
* - **`DELETE /v3/entity-types/{typeID}/reviewers/{userID}`** removes an
|
|
18
|
+
* assignment. Requires the `admin` role.
|
|
19
|
+
* - **`GET /v3/users/{userID}/reviewer-assignments`** is the reverse lookup:
|
|
20
|
+
* the entity types a user reviews. A user may read their own assignments;
|
|
21
|
+
* reading another user's assignments requires the `admin` role.
|
|
22
|
+
*/
|
|
23
|
+
export declare class Reviewers extends APIResource {
|
|
24
|
+
/**
|
|
25
|
+
* List Reviewers
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* const reviewers = await client.entityTypes.reviewers.list(
|
|
30
|
+
* 'typeID',
|
|
31
|
+
* );
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
list(typeID: string, options?: RequestOptions): APIPromise<ReviewerListResponse>;
|
|
35
|
+
/**
|
|
36
|
+
* Assign a Reviewer
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts
|
|
40
|
+
* const response = await client.entityTypes.reviewers.assign(
|
|
41
|
+
* 'typeID',
|
|
42
|
+
* { userID: 'usr_2xyz...' },
|
|
43
|
+
* );
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
assign(typeID: string, body: ReviewerAssignParams, options?: RequestOptions): APIPromise<ReviewerAssignResponse>;
|
|
47
|
+
/**
|
|
48
|
+
* Remove a Reviewer
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```ts
|
|
52
|
+
* await client.entityTypes.reviewers.remove('userID', {
|
|
53
|
+
* typeID: 'typeID',
|
|
54
|
+
* });
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
remove(userID: string, params: ReviewerRemoveParams, options?: RequestOptions): APIPromise<void>;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Response body for listing the reviewers of an entity type.
|
|
61
|
+
*/
|
|
62
|
+
export interface ReviewerListResponse {
|
|
63
|
+
reviewers: Array<ReviewerListResponse.Reviewer>;
|
|
64
|
+
}
|
|
65
|
+
export declare namespace ReviewerListResponse {
|
|
66
|
+
/**
|
|
67
|
+
* A reviewer assignment links a user to an entity type they are responsible for
|
|
68
|
+
* reviewing. The assignment is scoped to an account+environment and is unique per
|
|
69
|
+
* (entity type, user).
|
|
70
|
+
*/
|
|
71
|
+
interface Reviewer {
|
|
72
|
+
/**
|
|
73
|
+
* When the assignment was created (RFC 3339).
|
|
74
|
+
*/
|
|
75
|
+
createdAt: string;
|
|
76
|
+
/**
|
|
77
|
+
* The assigned user's email.
|
|
78
|
+
*/
|
|
79
|
+
email: string;
|
|
80
|
+
/**
|
|
81
|
+
* Stable public identifier for the assignment (`etr_...`).
|
|
82
|
+
*/
|
|
83
|
+
reviewerID: string;
|
|
84
|
+
/**
|
|
85
|
+
* The assigned user's account role (for example `operator`, `admin`).
|
|
86
|
+
*/
|
|
87
|
+
role: string;
|
|
88
|
+
/**
|
|
89
|
+
* Public identifier of the assigned user (`usr_...`).
|
|
90
|
+
*/
|
|
91
|
+
userID: string;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* A reviewer assignment links a user to an entity type they are responsible for
|
|
96
|
+
* reviewing. The assignment is scoped to an account+environment and is unique per
|
|
97
|
+
* (entity type, user).
|
|
98
|
+
*/
|
|
99
|
+
export interface ReviewerAssignResponse {
|
|
100
|
+
/**
|
|
101
|
+
* When the assignment was created (RFC 3339).
|
|
102
|
+
*/
|
|
103
|
+
createdAt: string;
|
|
104
|
+
/**
|
|
105
|
+
* The assigned user's email.
|
|
106
|
+
*/
|
|
107
|
+
email: string;
|
|
108
|
+
/**
|
|
109
|
+
* Stable public identifier for the assignment (`etr_...`).
|
|
110
|
+
*/
|
|
111
|
+
reviewerID: string;
|
|
112
|
+
/**
|
|
113
|
+
* The assigned user's account role (for example `operator`, `admin`).
|
|
114
|
+
*/
|
|
115
|
+
role: string;
|
|
116
|
+
/**
|
|
117
|
+
* Public identifier of the assigned user (`usr_...`).
|
|
118
|
+
*/
|
|
119
|
+
userID: string;
|
|
120
|
+
}
|
|
121
|
+
export interface ReviewerAssignParams {
|
|
122
|
+
/**
|
|
123
|
+
* Public ID (`usr_...`) of the user to assign. Must belong to the account.
|
|
124
|
+
*/
|
|
125
|
+
userID: string;
|
|
126
|
+
}
|
|
127
|
+
export interface ReviewerRemoveParams {
|
|
128
|
+
/**
|
|
129
|
+
* Entity type public ID (`ety_...`).
|
|
130
|
+
*/
|
|
131
|
+
typeID: string;
|
|
132
|
+
}
|
|
133
|
+
export declare namespace Reviewers {
|
|
134
|
+
export { type ReviewerListResponse as ReviewerListResponse, type ReviewerAssignResponse as ReviewerAssignResponse, type ReviewerAssignParams as ReviewerAssignParams, type ReviewerRemoveParams as ReviewerRemoveParams, };
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=reviewers.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reviewers.d.mts","sourceRoot":"","sources":["../../src/resources/entity-types/reviewers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,EAAE,UAAU,EAAE,mCAA+B;AAEpD,OAAO,EAAE,cAAc,EAAE,2CAAuC;AAGhE;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,SAAU,SAAQ,WAAW;IACxC;;;;;;;;;OASG;IACH,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,oBAAoB,CAAC;IAIhF;;;;;;;;;;OAUG;IACH,MAAM,CACJ,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,oBAAoB,EAC1B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,sBAAsB,CAAC;IAIrC;;;;;;;;;OASG;IACH,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,oBAAoB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;CAOjG;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,KAAK,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC;CACjD;AAED,yBAAiB,oBAAoB,CAAC;IACpC;;;;OAIG;IACH,UAAiB,QAAQ;QACvB;;WAEG;QACH,SAAS,EAAE,MAAM,CAAC;QAElB;;WAEG;QACH,KAAK,EAAE,MAAM,CAAC;QAEd;;WAEG;QACH,UAAU,EAAE,MAAM,CAAC;QAEnB;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;QAEb;;WAEG;QACH,MAAM,EAAE,MAAM,CAAC;KAChB;CACF;AAED;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,CAAC,OAAO,WAAW,SAAS,CAAC;IACjC,OAAO,EACL,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,oBAAoB,IAAI,oBAAoB,GAClD,CAAC;CACH"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.js";
|
|
2
|
+
import { APIPromise } from "../../core/api-promise.js";
|
|
3
|
+
import { RequestOptions } from "../../internal/request-options.js";
|
|
4
|
+
/**
|
|
5
|
+
* Reviewer assignments link users to the entity types they are responsible
|
|
6
|
+
* for reviewing, scoped to an account+environment. These are dashboard-only
|
|
7
|
+
* endpoints: an assignment needs a user identity, which only the dashboard
|
|
8
|
+
* (JWT) surface carries.
|
|
9
|
+
*
|
|
10
|
+
* - **`POST /v3/entity-types/{typeID}/reviewers`** assigns a user as a
|
|
11
|
+
* reviewer of the type. The assignment is idempotent: re-assigning an
|
|
12
|
+
* existing reviewer returns the existing assignment. Requires the `admin`
|
|
13
|
+
* role.
|
|
14
|
+
* - **`GET /v3/entity-types/{typeID}/reviewers`** lists the users assigned
|
|
15
|
+
* to review the type, with each user's email and role. Requires the
|
|
16
|
+
* `operator` role.
|
|
17
|
+
* - **`DELETE /v3/entity-types/{typeID}/reviewers/{userID}`** removes an
|
|
18
|
+
* assignment. Requires the `admin` role.
|
|
19
|
+
* - **`GET /v3/users/{userID}/reviewer-assignments`** is the reverse lookup:
|
|
20
|
+
* the entity types a user reviews. A user may read their own assignments;
|
|
21
|
+
* reading another user's assignments requires the `admin` role.
|
|
22
|
+
*/
|
|
23
|
+
export declare class Reviewers extends APIResource {
|
|
24
|
+
/**
|
|
25
|
+
* List Reviewers
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* const reviewers = await client.entityTypes.reviewers.list(
|
|
30
|
+
* 'typeID',
|
|
31
|
+
* );
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
list(typeID: string, options?: RequestOptions): APIPromise<ReviewerListResponse>;
|
|
35
|
+
/**
|
|
36
|
+
* Assign a Reviewer
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts
|
|
40
|
+
* const response = await client.entityTypes.reviewers.assign(
|
|
41
|
+
* 'typeID',
|
|
42
|
+
* { userID: 'usr_2xyz...' },
|
|
43
|
+
* );
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
assign(typeID: string, body: ReviewerAssignParams, options?: RequestOptions): APIPromise<ReviewerAssignResponse>;
|
|
47
|
+
/**
|
|
48
|
+
* Remove a Reviewer
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```ts
|
|
52
|
+
* await client.entityTypes.reviewers.remove('userID', {
|
|
53
|
+
* typeID: 'typeID',
|
|
54
|
+
* });
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
remove(userID: string, params: ReviewerRemoveParams, options?: RequestOptions): APIPromise<void>;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Response body for listing the reviewers of an entity type.
|
|
61
|
+
*/
|
|
62
|
+
export interface ReviewerListResponse {
|
|
63
|
+
reviewers: Array<ReviewerListResponse.Reviewer>;
|
|
64
|
+
}
|
|
65
|
+
export declare namespace ReviewerListResponse {
|
|
66
|
+
/**
|
|
67
|
+
* A reviewer assignment links a user to an entity type they are responsible for
|
|
68
|
+
* reviewing. The assignment is scoped to an account+environment and is unique per
|
|
69
|
+
* (entity type, user).
|
|
70
|
+
*/
|
|
71
|
+
interface Reviewer {
|
|
72
|
+
/**
|
|
73
|
+
* When the assignment was created (RFC 3339).
|
|
74
|
+
*/
|
|
75
|
+
createdAt: string;
|
|
76
|
+
/**
|
|
77
|
+
* The assigned user's email.
|
|
78
|
+
*/
|
|
79
|
+
email: string;
|
|
80
|
+
/**
|
|
81
|
+
* Stable public identifier for the assignment (`etr_...`).
|
|
82
|
+
*/
|
|
83
|
+
reviewerID: string;
|
|
84
|
+
/**
|
|
85
|
+
* The assigned user's account role (for example `operator`, `admin`).
|
|
86
|
+
*/
|
|
87
|
+
role: string;
|
|
88
|
+
/**
|
|
89
|
+
* Public identifier of the assigned user (`usr_...`).
|
|
90
|
+
*/
|
|
91
|
+
userID: string;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* A reviewer assignment links a user to an entity type they are responsible for
|
|
96
|
+
* reviewing. The assignment is scoped to an account+environment and is unique per
|
|
97
|
+
* (entity type, user).
|
|
98
|
+
*/
|
|
99
|
+
export interface ReviewerAssignResponse {
|
|
100
|
+
/**
|
|
101
|
+
* When the assignment was created (RFC 3339).
|
|
102
|
+
*/
|
|
103
|
+
createdAt: string;
|
|
104
|
+
/**
|
|
105
|
+
* The assigned user's email.
|
|
106
|
+
*/
|
|
107
|
+
email: string;
|
|
108
|
+
/**
|
|
109
|
+
* Stable public identifier for the assignment (`etr_...`).
|
|
110
|
+
*/
|
|
111
|
+
reviewerID: string;
|
|
112
|
+
/**
|
|
113
|
+
* The assigned user's account role (for example `operator`, `admin`).
|
|
114
|
+
*/
|
|
115
|
+
role: string;
|
|
116
|
+
/**
|
|
117
|
+
* Public identifier of the assigned user (`usr_...`).
|
|
118
|
+
*/
|
|
119
|
+
userID: string;
|
|
120
|
+
}
|
|
121
|
+
export interface ReviewerAssignParams {
|
|
122
|
+
/**
|
|
123
|
+
* Public ID (`usr_...`) of the user to assign. Must belong to the account.
|
|
124
|
+
*/
|
|
125
|
+
userID: string;
|
|
126
|
+
}
|
|
127
|
+
export interface ReviewerRemoveParams {
|
|
128
|
+
/**
|
|
129
|
+
* Entity type public ID (`ety_...`).
|
|
130
|
+
*/
|
|
131
|
+
typeID: string;
|
|
132
|
+
}
|
|
133
|
+
export declare namespace Reviewers {
|
|
134
|
+
export { type ReviewerListResponse as ReviewerListResponse, type ReviewerAssignResponse as ReviewerAssignResponse, type ReviewerAssignParams as ReviewerAssignParams, type ReviewerRemoveParams as ReviewerRemoveParams, };
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=reviewers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reviewers.d.ts","sourceRoot":"","sources":["../../src/resources/entity-types/reviewers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,EAAE,UAAU,EAAE,kCAA+B;AAEpD,OAAO,EAAE,cAAc,EAAE,0CAAuC;AAGhE;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,SAAU,SAAQ,WAAW;IACxC;;;;;;;;;OASG;IACH,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,oBAAoB,CAAC;IAIhF;;;;;;;;;;OAUG;IACH,MAAM,CACJ,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,oBAAoB,EAC1B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,sBAAsB,CAAC;IAIrC;;;;;;;;;OASG;IACH,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,oBAAoB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;CAOjG;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,KAAK,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC;CACjD;AAED,yBAAiB,oBAAoB,CAAC;IACpC;;;;OAIG;IACH,UAAiB,QAAQ;QACvB;;WAEG;QACH,SAAS,EAAE,MAAM,CAAC;QAElB;;WAEG;QACH,KAAK,EAAE,MAAM,CAAC;QAEd;;WAEG;QACH,UAAU,EAAE,MAAM,CAAC;QAEnB;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;QAEb;;WAEG;QACH,MAAM,EAAE,MAAM,CAAC;KAChB;CACF;AAED;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,CAAC,OAAO,WAAW,SAAS,CAAC;IACjC,OAAO,EACL,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,oBAAoB,IAAI,oBAAoB,GAClD,CAAC;CACH"}
|
|
@@ -0,0 +1,74 @@
|
|
|
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.Reviewers = void 0;
|
|
5
|
+
const resource_1 = require("../../core/resource.js");
|
|
6
|
+
const headers_1 = require("../../internal/headers.js");
|
|
7
|
+
const path_1 = require("../../internal/utils/path.js");
|
|
8
|
+
/**
|
|
9
|
+
* Reviewer assignments link users to the entity types they are responsible
|
|
10
|
+
* for reviewing, scoped to an account+environment. These are dashboard-only
|
|
11
|
+
* endpoints: an assignment needs a user identity, which only the dashboard
|
|
12
|
+
* (JWT) surface carries.
|
|
13
|
+
*
|
|
14
|
+
* - **`POST /v3/entity-types/{typeID}/reviewers`** assigns a user as a
|
|
15
|
+
* reviewer of the type. The assignment is idempotent: re-assigning an
|
|
16
|
+
* existing reviewer returns the existing assignment. Requires the `admin`
|
|
17
|
+
* role.
|
|
18
|
+
* - **`GET /v3/entity-types/{typeID}/reviewers`** lists the users assigned
|
|
19
|
+
* to review the type, with each user's email and role. Requires the
|
|
20
|
+
* `operator` role.
|
|
21
|
+
* - **`DELETE /v3/entity-types/{typeID}/reviewers/{userID}`** removes an
|
|
22
|
+
* assignment. Requires the `admin` role.
|
|
23
|
+
* - **`GET /v3/users/{userID}/reviewer-assignments`** is the reverse lookup:
|
|
24
|
+
* the entity types a user reviews. A user may read their own assignments;
|
|
25
|
+
* reading another user's assignments requires the `admin` role.
|
|
26
|
+
*/
|
|
27
|
+
class Reviewers extends resource_1.APIResource {
|
|
28
|
+
/**
|
|
29
|
+
* List Reviewers
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```ts
|
|
33
|
+
* const reviewers = await client.entityTypes.reviewers.list(
|
|
34
|
+
* 'typeID',
|
|
35
|
+
* );
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
list(typeID, options) {
|
|
39
|
+
return this._client.get((0, path_1.path) `/v3/entity-types/${typeID}/reviewers`, options);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Assign a Reviewer
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* const response = await client.entityTypes.reviewers.assign(
|
|
47
|
+
* 'typeID',
|
|
48
|
+
* { userID: 'usr_2xyz...' },
|
|
49
|
+
* );
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
assign(typeID, body, options) {
|
|
53
|
+
return this._client.post((0, path_1.path) `/v3/entity-types/${typeID}/reviewers`, { body, ...options });
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Remove a Reviewer
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* await client.entityTypes.reviewers.remove('userID', {
|
|
61
|
+
* typeID: 'typeID',
|
|
62
|
+
* });
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
remove(userID, params, options) {
|
|
66
|
+
const { typeID } = params;
|
|
67
|
+
return this._client.delete((0, path_1.path) `/v3/entity-types/${typeID}/reviewers/${userID}`, {
|
|
68
|
+
...options,
|
|
69
|
+
headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
exports.Reviewers = Reviewers;
|
|
74
|
+
//# sourceMappingURL=reviewers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reviewers.js","sourceRoot":"","sources":["../../src/resources/entity-types/reviewers.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAElD,uDAAsD;AAEtD,uDAAiD;AAEjD;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAa,SAAU,SAAQ,sBAAW;IACxC;;;;;;;;;OASG;IACH,IAAI,CAAC,MAAc,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,oBAAoB,MAAM,YAAY,EAAE,OAAO,CAAC,CAAC;IAC/E,CAAC;IAED;;;;;;;;;;OAUG;IACH,MAAM,CACJ,MAAc,EACd,IAA0B,EAC1B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,oBAAoB,MAAM,YAAY,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7F,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,MAAc,EAAE,MAA4B,EAAE,OAAwB;QAC3E,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;QAC1B,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,oBAAoB,MAAM,cAAc,MAAM,EAAE,EAAE;YAC/E,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;CACF;AAnDD,8BAmDC"}
|