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.
Files changed (174) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/client.d.mts +127 -2
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +127 -2
  5. package/client.d.ts.map +1 -1
  6. package/client.js +136 -3
  7. package/client.js.map +1 -1
  8. package/client.mjs +136 -3
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/buckets.d.mts +272 -0
  12. package/resources/buckets.d.mts.map +1 -0
  13. package/resources/buckets.d.ts +272 -0
  14. package/resources/buckets.d.ts.map +1 -0
  15. package/resources/buckets.js +93 -0
  16. package/resources/buckets.js.map +1 -0
  17. package/resources/buckets.mjs +89 -0
  18. package/resources/buckets.mjs.map +1 -0
  19. package/resources/entities/entities.d.mts +516 -0
  20. package/resources/entities/entities.d.mts.map +1 -0
  21. package/resources/entities/entities.d.ts +516 -0
  22. package/resources/entities/entities.d.ts.map +1 -0
  23. package/resources/entities/entities.js +93 -0
  24. package/resources/entities/entities.js.map +1 -0
  25. package/resources/entities/entities.mjs +88 -0
  26. package/resources/entities/entities.mjs.map +1 -0
  27. package/resources/entities/index.d.mts +3 -0
  28. package/resources/entities/index.d.mts.map +1 -0
  29. package/resources/entities/index.d.ts +3 -0
  30. package/resources/entities/index.d.ts.map +1 -0
  31. package/resources/entities/index.js +9 -0
  32. package/resources/entities/index.js.map +1 -0
  33. package/resources/entities/index.mjs +4 -0
  34. package/resources/entities/index.mjs.map +1 -0
  35. package/resources/entities/synonyms.d.mts +109 -0
  36. package/resources/entities/synonyms.d.mts.map +1 -0
  37. package/resources/entities/synonyms.d.ts +109 -0
  38. package/resources/entities/synonyms.d.ts.map +1 -0
  39. package/resources/entities/synonyms.js +61 -0
  40. package/resources/entities/synonyms.js.map +1 -0
  41. package/resources/entities/synonyms.mjs +57 -0
  42. package/resources/entities/synonyms.mjs.map +1 -0
  43. package/resources/entities.d.mts +2 -0
  44. package/resources/entities.d.mts.map +1 -0
  45. package/resources/entities.d.ts +2 -0
  46. package/resources/entities.d.ts.map +1 -0
  47. package/resources/entities.js +6 -0
  48. package/resources/entities.js.map +1 -0
  49. package/resources/entities.mjs +3 -0
  50. package/resources/entities.mjs.map +1 -0
  51. package/resources/entity-types/entity-types.d.mts +302 -0
  52. package/resources/entity-types/entity-types.d.mts.map +1 -0
  53. package/resources/entity-types/entity-types.d.ts +302 -0
  54. package/resources/entity-types/entity-types.d.ts.map +1 -0
  55. package/resources/entity-types/entity-types.js +104 -0
  56. package/resources/entity-types/entity-types.js.map +1 -0
  57. package/resources/entity-types/entity-types.mjs +99 -0
  58. package/resources/entity-types/entity-types.mjs.map +1 -0
  59. package/resources/entity-types/index.d.mts +3 -0
  60. package/resources/entity-types/index.d.mts.map +1 -0
  61. package/resources/entity-types/index.d.ts +3 -0
  62. package/resources/entity-types/index.d.ts.map +1 -0
  63. package/resources/entity-types/index.js +9 -0
  64. package/resources/entity-types/index.js.map +1 -0
  65. package/resources/entity-types/index.mjs +4 -0
  66. package/resources/entity-types/index.mjs.map +1 -0
  67. package/resources/entity-types/reviewers.d.mts +136 -0
  68. package/resources/entity-types/reviewers.d.mts.map +1 -0
  69. package/resources/entity-types/reviewers.d.ts +136 -0
  70. package/resources/entity-types/reviewers.d.ts.map +1 -0
  71. package/resources/entity-types/reviewers.js +74 -0
  72. package/resources/entity-types/reviewers.js.map +1 -0
  73. package/resources/entity-types/reviewers.mjs +70 -0
  74. package/resources/entity-types/reviewers.mjs.map +1 -0
  75. package/resources/entity-types.d.mts +2 -0
  76. package/resources/entity-types.d.mts.map +1 -0
  77. package/resources/entity-types.d.ts +2 -0
  78. package/resources/entity-types.d.ts.map +1 -0
  79. package/resources/entity-types.js +6 -0
  80. package/resources/entity-types.js.map +1 -0
  81. package/resources/entity-types.mjs +3 -0
  82. package/resources/entity-types.mjs.map +1 -0
  83. package/resources/eval/eval.d.mts +4 -0
  84. package/resources/eval/eval.d.mts.map +1 -1
  85. package/resources/eval/eval.d.ts +4 -0
  86. package/resources/eval/eval.d.ts.map +1 -1
  87. package/resources/eval/eval.js +4 -0
  88. package/resources/eval/eval.js.map +1 -1
  89. package/resources/eval/eval.mjs +4 -0
  90. package/resources/eval/eval.mjs.map +1 -1
  91. package/resources/eval/index.d.mts +1 -0
  92. package/resources/eval/index.d.mts.map +1 -1
  93. package/resources/eval/index.d.ts +1 -0
  94. package/resources/eval/index.d.ts.map +1 -1
  95. package/resources/eval/index.js +3 -1
  96. package/resources/eval/index.js.map +1 -1
  97. package/resources/eval/index.mjs +1 -0
  98. package/resources/eval/index.mjs.map +1 -1
  99. package/resources/eval/score.d.mts +486 -0
  100. package/resources/eval/score.d.mts.map +1 -0
  101. package/resources/eval/score.d.ts +486 -0
  102. package/resources/eval/score.d.ts.map +1 -0
  103. package/resources/eval/score.js +126 -0
  104. package/resources/eval/score.js.map +1 -0
  105. package/resources/eval/score.mjs +122 -0
  106. package/resources/eval/score.mjs.map +1 -0
  107. package/resources/fs.d.mts +28 -0
  108. package/resources/fs.d.mts.map +1 -1
  109. package/resources/fs.d.ts +28 -0
  110. package/resources/fs.d.ts.map +1 -1
  111. package/resources/index.d.mts +6 -0
  112. package/resources/index.d.mts.map +1 -1
  113. package/resources/index.d.ts +6 -0
  114. package/resources/index.d.ts.map +1 -1
  115. package/resources/index.js +13 -1
  116. package/resources/index.js.map +1 -1
  117. package/resources/index.mjs +6 -0
  118. package/resources/index.mjs.map +1 -1
  119. package/resources/knowledge-graph.d.mts +125 -0
  120. package/resources/knowledge-graph.d.mts.map +1 -0
  121. package/resources/knowledge-graph.d.ts +125 -0
  122. package/resources/knowledge-graph.d.ts.map +1 -0
  123. package/resources/knowledge-graph.js +34 -0
  124. package/resources/knowledge-graph.js.map +1 -0
  125. package/resources/knowledge-graph.mjs +30 -0
  126. package/resources/knowledge-graph.mjs.map +1 -0
  127. package/resources/review-queue.d.mts +192 -0
  128. package/resources/review-queue.d.mts.map +1 -0
  129. package/resources/review-queue.d.ts +192 -0
  130. package/resources/review-queue.d.ts.map +1 -0
  131. package/resources/review-queue.js +49 -0
  132. package/resources/review-queue.js.map +1 -0
  133. package/resources/review-queue.mjs +45 -0
  134. package/resources/review-queue.mjs.map +1 -0
  135. package/resources/subscriptions.d.mts +14 -2
  136. package/resources/subscriptions.d.mts.map +1 -1
  137. package/resources/subscriptions.d.ts +14 -2
  138. package/resources/subscriptions.d.ts.map +1 -1
  139. package/resources/subscriptions.js +14 -2
  140. package/resources/subscriptions.js.map +1 -1
  141. package/resources/subscriptions.mjs +14 -2
  142. package/resources/subscriptions.mjs.map +1 -1
  143. package/resources/users.d.mts +62 -0
  144. package/resources/users.d.mts.map +1 -0
  145. package/resources/users.d.ts +62 -0
  146. package/resources/users.d.ts.map +1 -0
  147. package/resources/users.js +35 -0
  148. package/resources/users.js.map +1 -0
  149. package/resources/users.mjs +31 -0
  150. package/resources/users.mjs.map +1 -0
  151. package/src/client.ts +220 -3
  152. package/src/resources/buckets.ts +351 -0
  153. package/src/resources/entities/entities.ts +639 -0
  154. package/src/resources/entities/index.ts +20 -0
  155. package/src/resources/entities/synonyms.ts +140 -0
  156. package/src/resources/entities.ts +3 -0
  157. package/src/resources/entity-types/entity-types.ts +396 -0
  158. package/src/resources/entity-types/index.ts +19 -0
  159. package/src/resources/entity-types/reviewers.ts +175 -0
  160. package/src/resources/entity-types.ts +3 -0
  161. package/src/resources/eval/eval.ts +18 -0
  162. package/src/resources/eval/index.ts +7 -0
  163. package/src/resources/eval/score.ts +590 -0
  164. package/src/resources/fs.ts +30 -0
  165. package/src/resources/index.ts +40 -0
  166. package/src/resources/knowledge-graph.ts +153 -0
  167. package/src/resources/review-queue.ts +234 -0
  168. package/src/resources/subscriptions.ts +14 -2
  169. package/src/resources/users.ts +76 -0
  170. package/src/version.ts +1 -1
  171. package/version.d.mts +1 -1
  172. package/version.d.ts +1 -1
  173. package/version.js +1 -1
  174. package/version.mjs +1 -1
@@ -0,0 +1,175 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import { APIPromise } from '../../core/api-promise';
5
+ import { buildHeaders } from '../../internal/headers';
6
+ import { RequestOptions } from '../../internal/request-options';
7
+ import { path } from '../../internal/utils/path';
8
+
9
+ /**
10
+ * Reviewer assignments link users to the entity types they are responsible
11
+ * for reviewing, scoped to an account+environment. These are dashboard-only
12
+ * endpoints: an assignment needs a user identity, which only the dashboard
13
+ * (JWT) surface carries.
14
+ *
15
+ * - **`POST /v3/entity-types/{typeID}/reviewers`** assigns a user as a
16
+ * reviewer of the type. The assignment is idempotent: re-assigning an
17
+ * existing reviewer returns the existing assignment. Requires the `admin`
18
+ * role.
19
+ * - **`GET /v3/entity-types/{typeID}/reviewers`** lists the users assigned
20
+ * to review the type, with each user's email and role. Requires the
21
+ * `operator` role.
22
+ * - **`DELETE /v3/entity-types/{typeID}/reviewers/{userID}`** removes an
23
+ * assignment. Requires the `admin` role.
24
+ * - **`GET /v3/users/{userID}/reviewer-assignments`** is the reverse lookup:
25
+ * the entity types a user reviews. A user may read their own assignments;
26
+ * reading another user's assignments requires the `admin` role.
27
+ */
28
+ export class Reviewers extends APIResource {
29
+ /**
30
+ * List Reviewers
31
+ *
32
+ * @example
33
+ * ```ts
34
+ * const reviewers = await client.entityTypes.reviewers.list(
35
+ * 'typeID',
36
+ * );
37
+ * ```
38
+ */
39
+ list(typeID: string, options?: RequestOptions): APIPromise<ReviewerListResponse> {
40
+ return this._client.get(path`/v3/entity-types/${typeID}/reviewers`, options);
41
+ }
42
+
43
+ /**
44
+ * Assign a Reviewer
45
+ *
46
+ * @example
47
+ * ```ts
48
+ * const response = await client.entityTypes.reviewers.assign(
49
+ * 'typeID',
50
+ * { userID: 'usr_2xyz...' },
51
+ * );
52
+ * ```
53
+ */
54
+ assign(
55
+ typeID: string,
56
+ body: ReviewerAssignParams,
57
+ options?: RequestOptions,
58
+ ): APIPromise<ReviewerAssignResponse> {
59
+ return this._client.post(path`/v3/entity-types/${typeID}/reviewers`, { body, ...options });
60
+ }
61
+
62
+ /**
63
+ * Remove a Reviewer
64
+ *
65
+ * @example
66
+ * ```ts
67
+ * await client.entityTypes.reviewers.remove('userID', {
68
+ * typeID: 'typeID',
69
+ * });
70
+ * ```
71
+ */
72
+ remove(userID: string, params: ReviewerRemoveParams, options?: RequestOptions): APIPromise<void> {
73
+ const { typeID } = params;
74
+ return this._client.delete(path`/v3/entity-types/${typeID}/reviewers/${userID}`, {
75
+ ...options,
76
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
77
+ });
78
+ }
79
+ }
80
+
81
+ /**
82
+ * Response body for listing the reviewers of an entity type.
83
+ */
84
+ export interface ReviewerListResponse {
85
+ reviewers: Array<ReviewerListResponse.Reviewer>;
86
+ }
87
+
88
+ export namespace ReviewerListResponse {
89
+ /**
90
+ * A reviewer assignment links a user to an entity type they are responsible for
91
+ * reviewing. The assignment is scoped to an account+environment and is unique per
92
+ * (entity type, user).
93
+ */
94
+ export interface Reviewer {
95
+ /**
96
+ * When the assignment was created (RFC 3339).
97
+ */
98
+ createdAt: string;
99
+
100
+ /**
101
+ * The assigned user's email.
102
+ */
103
+ email: string;
104
+
105
+ /**
106
+ * Stable public identifier for the assignment (`etr_...`).
107
+ */
108
+ reviewerID: string;
109
+
110
+ /**
111
+ * The assigned user's account role (for example `operator`, `admin`).
112
+ */
113
+ role: string;
114
+
115
+ /**
116
+ * Public identifier of the assigned user (`usr_...`).
117
+ */
118
+ userID: string;
119
+ }
120
+ }
121
+
122
+ /**
123
+ * A reviewer assignment links a user to an entity type they are responsible for
124
+ * reviewing. The assignment is scoped to an account+environment and is unique per
125
+ * (entity type, user).
126
+ */
127
+ export interface ReviewerAssignResponse {
128
+ /**
129
+ * When the assignment was created (RFC 3339).
130
+ */
131
+ createdAt: string;
132
+
133
+ /**
134
+ * The assigned user's email.
135
+ */
136
+ email: string;
137
+
138
+ /**
139
+ * Stable public identifier for the assignment (`etr_...`).
140
+ */
141
+ reviewerID: string;
142
+
143
+ /**
144
+ * The assigned user's account role (for example `operator`, `admin`).
145
+ */
146
+ role: string;
147
+
148
+ /**
149
+ * Public identifier of the assigned user (`usr_...`).
150
+ */
151
+ userID: string;
152
+ }
153
+
154
+ export interface ReviewerAssignParams {
155
+ /**
156
+ * Public ID (`usr_...`) of the user to assign. Must belong to the account.
157
+ */
158
+ userID: string;
159
+ }
160
+
161
+ export interface ReviewerRemoveParams {
162
+ /**
163
+ * Entity type public ID (`ety_...`).
164
+ */
165
+ typeID: string;
166
+ }
167
+
168
+ export declare namespace Reviewers {
169
+ export {
170
+ type ReviewerListResponse as ReviewerListResponse,
171
+ type ReviewerAssignResponse as ReviewerAssignResponse,
172
+ type ReviewerAssignParams as ReviewerAssignParams,
173
+ type ReviewerRemoveParams as ReviewerRemoveParams,
174
+ };
175
+ }
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export * from './entity-types/index';
@@ -3,6 +3,14 @@
3
3
  import { APIResource } from '../../core/resource';
4
4
  import * as ResultsAPI from './results';
5
5
  import { EvaluationResults, ResultRetrieveResultsParams, Results } from './results';
6
+ import * as ScoreAPI from './score';
7
+ import {
8
+ Score,
9
+ ScoreCancelResponse,
10
+ ScoreCreateParams,
11
+ ScoreCreateResponse,
12
+ ScoreRetrieveResponse,
13
+ } from './score';
6
14
  import { APIPromise } from '../../core/api-promise';
7
15
  import { RequestOptions } from '../../internal/request-options';
8
16
 
@@ -53,6 +61,7 @@ import { RequestOptions } from '../../internal/request-options';
53
61
  */
54
62
  export class Eval extends APIResource {
55
63
  results: ResultsAPI.Results = new ResultsAPI.Results(this._client);
64
+ score: ScoreAPI.Score = new ScoreAPI.Score(this._client);
56
65
 
57
66
  /**
58
67
  * **Queue evaluation jobs for a batch of transformations.**
@@ -119,6 +128,7 @@ export interface EvalTriggerEvaluationParams {
119
128
  }
120
129
 
121
130
  Eval.Results = Results;
131
+ Eval.Score = Score;
122
132
 
123
133
  export declare namespace Eval {
124
134
  export {
@@ -131,4 +141,12 @@ export declare namespace Eval {
131
141
  type EvaluationResults as EvaluationResults,
132
142
  type ResultRetrieveResultsParams as ResultRetrieveResultsParams,
133
143
  };
144
+
145
+ export {
146
+ Score as Score,
147
+ type ScoreCreateResponse as ScoreCreateResponse,
148
+ type ScoreRetrieveResponse as ScoreRetrieveResponse,
149
+ type ScoreCancelResponse as ScoreCancelResponse,
150
+ type ScoreCreateParams as ScoreCreateParams,
151
+ };
134
152
  }
@@ -2,3 +2,10 @@
2
2
 
3
3
  export { Eval, type EvalTriggerEvaluationResponse, type EvalTriggerEvaluationParams } from './eval';
4
4
  export { Results, type EvaluationResults, type ResultRetrieveResultsParams } from './results';
5
+ export {
6
+ Score,
7
+ type ScoreCreateResponse,
8
+ type ScoreRetrieveResponse,
9
+ type ScoreCancelResponse,
10
+ type ScoreCreateParams,
11
+ } from './score';