bem-ai-sdk 0.26.0 → 0.28.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 +25 -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 +526 -0
- package/resources/entities/entities.d.mts.map +1 -0
- package/resources/entities/entities.d.ts +526 -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/errors.d.mts +9 -0
- package/resources/errors.d.mts.map +1 -1
- package/resources/errors.d.ts +9 -0
- package/resources/errors.d.ts.map +1 -1
- 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/functions/functions.d.mts +338 -8
- package/resources/functions/functions.d.mts.map +1 -1
- package/resources/functions/functions.d.ts +338 -8
- package/resources/functions/functions.d.ts.map +1 -1
- package/resources/functions/functions.js +2 -2
- package/resources/functions/functions.js.map +1 -1
- package/resources/functions/functions.mjs +2 -2
- package/resources/functions/functions.mjs.map +1 -1
- package/resources/functions/versions.d.mts +133 -1
- package/resources/functions/versions.d.mts.map +1 -1
- package/resources/functions/versions.d.ts +133 -1
- package/resources/functions/versions.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 +143 -0
- package/resources/knowledge-graph.d.mts.map +1 -0
- package/resources/knowledge-graph.d.ts +143 -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/outputs.d.mts +80 -2
- package/resources/outputs.d.mts.map +1 -1
- package/resources/outputs.d.ts +80 -2
- package/resources/outputs.d.ts.map +1 -1
- 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/resources/workflows/workflows.d.mts +8 -0
- package/resources/workflows/workflows.d.mts.map +1 -1
- package/resources/workflows/workflows.d.ts +8 -0
- package/resources/workflows/workflows.d.ts.map +1 -1
- package/resources/workflows/workflows.js.map +1 -1
- package/resources/workflows/workflows.mjs.map +1 -1
- package/src/client.ts +220 -3
- package/src/resources/buckets.ts +351 -0
- package/src/resources/entities/entities.ts +651 -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/errors.ts +10 -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/functions/functions.ts +395 -8
- package/src/resources/functions/versions.ts +153 -1
- package/src/resources/index.ts +40 -0
- package/src/resources/knowledge-graph.ts +174 -0
- package/src/resources/outputs.ts +101 -1
- package/src/resources/review-queue.ts +234 -0
- package/src/resources/subscriptions.ts +14 -2
- package/src/resources/users.ts +76 -0
- package/src/resources/workflows/workflows.ts +9 -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
package/src/resources/index.ts
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
+
export {
|
|
4
|
+
Buckets,
|
|
5
|
+
type BucketCreateResponse,
|
|
6
|
+
type BucketRetrieveResponse,
|
|
7
|
+
type BucketUpdateResponse,
|
|
8
|
+
type BucketListResponse,
|
|
9
|
+
type BucketCreateParams,
|
|
10
|
+
type BucketUpdateParams,
|
|
11
|
+
type BucketListParams,
|
|
12
|
+
type BucketDeleteParams,
|
|
13
|
+
} from './buckets';
|
|
3
14
|
export {
|
|
4
15
|
Calls,
|
|
5
16
|
type Call,
|
|
@@ -28,6 +39,28 @@ export {
|
|
|
28
39
|
type ConnectorCreateParams,
|
|
29
40
|
type ConnectorListParams,
|
|
30
41
|
} from './connectors';
|
|
42
|
+
export {
|
|
43
|
+
Entities,
|
|
44
|
+
type EntityUpdateResponse,
|
|
45
|
+
type EntityBulkCreateResponse,
|
|
46
|
+
type EntityBulkValidateResponse,
|
|
47
|
+
type EntityRetrieveRelationsResponse,
|
|
48
|
+
type EntityRetrieveSeedStatusResponse,
|
|
49
|
+
type EntityUpdateParams,
|
|
50
|
+
type EntityBulkCreateParams,
|
|
51
|
+
type EntityBulkValidateParams,
|
|
52
|
+
type EntityRetrieveRelationsParams,
|
|
53
|
+
} from './entities/entities';
|
|
54
|
+
export {
|
|
55
|
+
EntityTypes,
|
|
56
|
+
type EntityTypeCreateResponse,
|
|
57
|
+
type EntityTypeRetrieveResponse,
|
|
58
|
+
type EntityTypeUpdateResponse,
|
|
59
|
+
type EntityTypeListResponse,
|
|
60
|
+
type EntityTypeCreateParams,
|
|
61
|
+
type EntityTypeUpdateParams,
|
|
62
|
+
type EntityTypeListParams,
|
|
63
|
+
} from './entity-types/entity-types';
|
|
31
64
|
export {
|
|
32
65
|
Errors,
|
|
33
66
|
type ErrorEvent,
|
|
@@ -68,6 +101,11 @@ export {
|
|
|
68
101
|
type FunctionsFunctionsPage,
|
|
69
102
|
} from './functions/functions';
|
|
70
103
|
export { InferSchema, type InferSchemaCreateResponse, type InferSchemaCreateParams } from './infer-schema';
|
|
104
|
+
export {
|
|
105
|
+
KnowledgeGraph,
|
|
106
|
+
type KnowledgeGraphRetrieveResponse,
|
|
107
|
+
type KnowledgeGraphRetrieveParams,
|
|
108
|
+
} from './knowledge-graph';
|
|
71
109
|
export {
|
|
72
110
|
Outputs,
|
|
73
111
|
type AnyType,
|
|
@@ -77,6 +115,7 @@ export {
|
|
|
77
115
|
type OutputListParams,
|
|
78
116
|
type EventsOutputsPage,
|
|
79
117
|
} from './outputs';
|
|
118
|
+
export { ReviewQueue, type ReviewQueueListResponse, type ReviewQueueListParams } from './review-queue';
|
|
80
119
|
export {
|
|
81
120
|
Subscriptions,
|
|
82
121
|
type SubscriptionV3,
|
|
@@ -85,6 +124,7 @@ export {
|
|
|
85
124
|
type SubscriptionUpdateParams,
|
|
86
125
|
type SubscriptionListParams,
|
|
87
126
|
} from './subscriptions';
|
|
127
|
+
export { Users, type UserListReviewerAssignmentsResponse } from './users';
|
|
88
128
|
export {
|
|
89
129
|
Views,
|
|
90
130
|
type ViewCreateResponse,
|
|
@@ -0,0 +1,174 @@
|
|
|
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 { RequestOptions } from '../internal/request-options';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Read the cross-document knowledge graph — the canonical entities and the
|
|
9
|
+
* directed relations between them that the Parse pipeline populates when
|
|
10
|
+
* `linkAcrossDocuments` is enabled.
|
|
11
|
+
*
|
|
12
|
+
* - **`GET /v3/entities/{id}/relations`** returns the inbound and outbound
|
|
13
|
+
* edges incident to one entity, split by direction. Supports
|
|
14
|
+
* `direction`, an exact `relationType` filter, and cursor pagination over
|
|
15
|
+
* edges. A merged-away entity id transparently resolves to its surviving
|
|
16
|
+
* canonical entity.
|
|
17
|
+
* - **`GET /v3/knowledge-graph`** returns the graph as `{ nodes, edges }`,
|
|
18
|
+
* paginating over edges. The `nodes` for a page are the distinct endpoint
|
|
19
|
+
* entities of that page's edges (both endpoints of every edge are
|
|
20
|
+
* included). Filter with `type[]`, `since`, and `search`; an edge is
|
|
21
|
+
* returned only when both of its endpoints survive the entity filters.
|
|
22
|
+
*
|
|
23
|
+
* Both endpoints take an optional `bucket` (`bkt_...`) to scope the read to
|
|
24
|
+
* a single bucket; omit it for the unscoped account+environment view.
|
|
25
|
+
*/
|
|
26
|
+
export class KnowledgeGraph extends APIResource {
|
|
27
|
+
/**
|
|
28
|
+
* Retrieve the Knowledge Graph
|
|
29
|
+
*/
|
|
30
|
+
retrieve(
|
|
31
|
+
query: KnowledgeGraphRetrieveParams | null | undefined = {},
|
|
32
|
+
options?: RequestOptions,
|
|
33
|
+
): APIPromise<KnowledgeGraphRetrieveResponse> {
|
|
34
|
+
return this._client.get('/v3/knowledge-graph', { query, ...options });
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Response body for `GET /v3/knowledge-graph`. Pagination is over edges; `nodes`
|
|
40
|
+
* are the distinct endpoint entities of the returned edge page (both endpoints of
|
|
41
|
+
* every edge are included).
|
|
42
|
+
*/
|
|
43
|
+
export interface KnowledgeGraphRetrieveResponse {
|
|
44
|
+
/**
|
|
45
|
+
* The page of edges.
|
|
46
|
+
*/
|
|
47
|
+
edges: Array<KnowledgeGraphRetrieveResponse.Edge>;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Distinct endpoint entities of the returned edge page.
|
|
51
|
+
*/
|
|
52
|
+
nodes: Array<KnowledgeGraphRetrieveResponse.Node>;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Opaque cursor for the next page of edges, or absent on the last page. Pass it
|
|
56
|
+
* back as `cursor`.
|
|
57
|
+
*/
|
|
58
|
+
nextCursor?: string;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export namespace KnowledgeGraphRetrieveResponse {
|
|
62
|
+
/**
|
|
63
|
+
* One directed edge between two entities, addressed by their public ids.
|
|
64
|
+
*/
|
|
65
|
+
export interface Edge {
|
|
66
|
+
/**
|
|
67
|
+
* How many times this edge has been observed.
|
|
68
|
+
*/
|
|
69
|
+
mentionCount: number;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Free-form relation label.
|
|
73
|
+
*/
|
|
74
|
+
relationType: string;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Source entity public id (`ent_...`).
|
|
78
|
+
*/
|
|
79
|
+
sourceId: string;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Target entity public id (`ent_...`).
|
|
83
|
+
*/
|
|
84
|
+
targetId: string;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* One entity node in the knowledge graph.
|
|
89
|
+
*/
|
|
90
|
+
export interface Node {
|
|
91
|
+
/**
|
|
92
|
+
* Stable public identifier for the entity (`ent_...`).
|
|
93
|
+
*/
|
|
94
|
+
id: string;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Canonical (most descriptive) surface form.
|
|
98
|
+
*/
|
|
99
|
+
canonical: string;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Hops from the center node when the request centers the graph on one entity
|
|
103
|
+
* (`nodeID`). The center is depth 0. When the request is uncentered (no `nodeID`),
|
|
104
|
+
* this is 0 for every node.
|
|
105
|
+
*/
|
|
106
|
+
depth: number;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Total mentions of this entity across all parsed documents.
|
|
110
|
+
*/
|
|
111
|
+
mentionCount: number;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Effective entity type.
|
|
115
|
+
*/
|
|
116
|
+
type: string;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export interface KnowledgeGraphRetrieveParams {
|
|
121
|
+
/**
|
|
122
|
+
* Optional bucket public ID (`bkt_...`) to scope the read to one bucket. Omit for
|
|
123
|
+
* the unscoped (all account+environment) view.
|
|
124
|
+
*/
|
|
125
|
+
bucket?: string;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Cursor: return edges whose KSUID sorts after this value.
|
|
129
|
+
*/
|
|
130
|
+
cursor?: string;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Maximum number of edges per page (default 50, max 200).
|
|
134
|
+
*/
|
|
135
|
+
limit?: number;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Maximum hops from the center node. Only meaningful with `nodeID`. Defaults to 2
|
|
139
|
+
* and is clamped down to a system maximum (5).
|
|
140
|
+
*/
|
|
141
|
+
maxDepth?: number;
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Center the graph on this entity (`ent_...`) and only return the subgraph within
|
|
145
|
+
* `maxDepth` hops of it; every node then carries its `depth` (hops from the
|
|
146
|
+
* center, center = 0). Omit for the uncentered whole-graph view. `rootNodeID` and
|
|
147
|
+
* `focusNodeID` are accepted as aliases.
|
|
148
|
+
*/
|
|
149
|
+
nodeID?: string;
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Case-insensitive substring match on canonical names. Both endpoints of an edge
|
|
153
|
+
* must match for the edge (and its nodes) to be returned.
|
|
154
|
+
*/
|
|
155
|
+
search?: string;
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Only edges created at/after this RFC 3339 timestamp.
|
|
159
|
+
*/
|
|
160
|
+
since?: string;
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Restrict to entities of these types. An edge is returned only when BOTH of its
|
|
164
|
+
* endpoints survive the type filter.
|
|
165
|
+
*/
|
|
166
|
+
type?: Array<string>;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export declare namespace KnowledgeGraph {
|
|
170
|
+
export {
|
|
171
|
+
type KnowledgeGraphRetrieveResponse as KnowledgeGraphRetrieveResponse,
|
|
172
|
+
type KnowledgeGraphRetrieveParams as KnowledgeGraphRetrieveParams,
|
|
173
|
+
};
|
|
174
|
+
}
|
package/src/resources/outputs.ts
CHANGED
|
@@ -85,7 +85,8 @@ export type Event =
|
|
|
85
85
|
| Event.PayloadShapingEvent
|
|
86
86
|
| Event.EvaluationEvent
|
|
87
87
|
| Event.CollectionProcessingEvent
|
|
88
|
-
| Event.SendEvent
|
|
88
|
+
| Event.SendEvent
|
|
89
|
+
| Event.RenderEvent;
|
|
89
90
|
|
|
90
91
|
export namespace Event {
|
|
91
92
|
export interface TransformEvent {
|
|
@@ -1836,6 +1837,103 @@ export namespace Event {
|
|
|
1836
1837
|
httpStatusCode: number;
|
|
1837
1838
|
}
|
|
1838
1839
|
}
|
|
1840
|
+
|
|
1841
|
+
export interface RenderEvent {
|
|
1842
|
+
/**
|
|
1843
|
+
* Wall-clock seconds spent generating the output docx through the template.
|
|
1844
|
+
*/
|
|
1845
|
+
docxRenderSeconds: number;
|
|
1846
|
+
|
|
1847
|
+
/**
|
|
1848
|
+
* Unique ID generated by bem to identify the event.
|
|
1849
|
+
*/
|
|
1850
|
+
eventID: string;
|
|
1851
|
+
|
|
1852
|
+
/**
|
|
1853
|
+
* Unique identifier of function that this event is associated with.
|
|
1854
|
+
*/
|
|
1855
|
+
functionID: string;
|
|
1856
|
+
|
|
1857
|
+
/**
|
|
1858
|
+
* Unique name of function that this event is associated with.
|
|
1859
|
+
*/
|
|
1860
|
+
functionName: string;
|
|
1861
|
+
|
|
1862
|
+
/**
|
|
1863
|
+
* Short-lived presigned HTTPS URL the recipient can GET to download the rendered
|
|
1864
|
+
* docx. Bearer-token semantics: possession equals access. Treat as a credential —
|
|
1865
|
+
* do not log full URLs or store beyond the delivery window. The URL expires after
|
|
1866
|
+
* the platform-configured TTL; the next API serialization mints a fresh one.
|
|
1867
|
+
*/
|
|
1868
|
+
outputDownloadURL: string;
|
|
1869
|
+
|
|
1870
|
+
/**
|
|
1871
|
+
* The unique ID you use internally to refer to this data point, propagated from
|
|
1872
|
+
* the original function input.
|
|
1873
|
+
*/
|
|
1874
|
+
referenceID: string;
|
|
1875
|
+
|
|
1876
|
+
/**
|
|
1877
|
+
* Wall-clock seconds spent validating the upstream JSON against the doc-type
|
|
1878
|
+
* schema.
|
|
1879
|
+
*/
|
|
1880
|
+
validationSeconds: number;
|
|
1881
|
+
|
|
1882
|
+
/**
|
|
1883
|
+
* Unique identifier of workflow call that this event is associated with.
|
|
1884
|
+
*/
|
|
1885
|
+
callID?: string;
|
|
1886
|
+
|
|
1887
|
+
/**
|
|
1888
|
+
* Timestamp indicating when the event was created.
|
|
1889
|
+
*/
|
|
1890
|
+
createdAt?: string;
|
|
1891
|
+
|
|
1892
|
+
eventType?: 'render';
|
|
1893
|
+
|
|
1894
|
+
/**
|
|
1895
|
+
* Unique identifier of function call that this event is associated with.
|
|
1896
|
+
*/
|
|
1897
|
+
functionCallID?: string;
|
|
1898
|
+
|
|
1899
|
+
/**
|
|
1900
|
+
* The attempt number of the function call that created this event. 1 indexed.
|
|
1901
|
+
*/
|
|
1902
|
+
functionCallTryNumber?: number;
|
|
1903
|
+
|
|
1904
|
+
/**
|
|
1905
|
+
* Version number of function that this event is associated with.
|
|
1906
|
+
*/
|
|
1907
|
+
functionVersionNum?: number;
|
|
1908
|
+
|
|
1909
|
+
/**
|
|
1910
|
+
* The inbound email that triggered this event.
|
|
1911
|
+
*/
|
|
1912
|
+
inboundEmail?: ErrorsAPI.InboundEmailEvent;
|
|
1913
|
+
|
|
1914
|
+
metadata?: RenderEvent.Metadata;
|
|
1915
|
+
|
|
1916
|
+
/**
|
|
1917
|
+
* Unique identifier of workflow that this event is associated with.
|
|
1918
|
+
*/
|
|
1919
|
+
workflowID?: string;
|
|
1920
|
+
|
|
1921
|
+
/**
|
|
1922
|
+
* Name of workflow that this event is associated with.
|
|
1923
|
+
*/
|
|
1924
|
+
workflowName?: string;
|
|
1925
|
+
|
|
1926
|
+
/**
|
|
1927
|
+
* Version number of workflow that this event is associated with.
|
|
1928
|
+
*/
|
|
1929
|
+
workflowVersionNum?: number;
|
|
1930
|
+
}
|
|
1931
|
+
|
|
1932
|
+
export namespace RenderEvent {
|
|
1933
|
+
export interface Metadata {
|
|
1934
|
+
durationFunctionToEventSeconds?: number;
|
|
1935
|
+
}
|
|
1936
|
+
}
|
|
1839
1937
|
}
|
|
1840
1938
|
|
|
1841
1939
|
/**
|
|
@@ -1851,7 +1949,9 @@ export type InputType =
|
|
|
1851
1949
|
| 'json'
|
|
1852
1950
|
| 'heif'
|
|
1853
1951
|
| 'm4a'
|
|
1952
|
+
| 'mov'
|
|
1854
1953
|
| 'mp3'
|
|
1954
|
+
| 'mp4'
|
|
1855
1955
|
| 'pdf'
|
|
1856
1956
|
| 'png'
|
|
1857
1957
|
| 'text'
|
|
@@ -0,0 +1,234 @@
|
|
|
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 { RequestOptions } from '../internal/request-options';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The reviewer-facing read surface for entity curation, available on the
|
|
9
|
+
* dashboard (JWT) only.
|
|
10
|
+
*
|
|
11
|
+
* - **`GET /v3/review-queue`** returns a cursor-paginated set of entities
|
|
12
|
+
* awaiting curation, scoped to your account+environment (and optional
|
|
13
|
+
* `bucket`). Each row is a full entity plus a small preview (up to 2) of
|
|
14
|
+
* its first mentions, so a reviewer can triage without opening every
|
|
15
|
+
* entity.
|
|
16
|
+
*
|
|
17
|
+
* Filters AND together. `status` (repeatable) defaults to the pre-terminal
|
|
18
|
+
* states `extracted` + `proposed` when omitted. `type` (repeatable `ety_…`
|
|
19
|
+
* IDs) matches the entity's *effective* type — its assigned type id, or, for
|
|
20
|
+
* entities with no assigned type, its bem-inferred type name. `assignedTo`
|
|
21
|
+
* (`me` or a `usr_…` ID) restricts to entities whose effective type the user
|
|
22
|
+
* reviews. `since` (RFC3339) filters by creation time. Pagination is
|
|
23
|
+
* cursor-based on `entityID` ascending; default limit 50, maximum 200.
|
|
24
|
+
*/
|
|
25
|
+
export class ReviewQueue extends APIResource {
|
|
26
|
+
/**
|
|
27
|
+
* **List entities awaiting curation, for a human reviewer's queue.**
|
|
28
|
+
*
|
|
29
|
+
* Returns a cursor-paginated set of entities scoped to your account+environment
|
|
30
|
+
* (and optional `bucket`), each carrying a small preview of its first mentions so
|
|
31
|
+
* a reviewer can triage without opening every entity. All filters AND together.
|
|
32
|
+
*
|
|
33
|
+
* - **`status`** (repeatable) restricts to the given lifecycle states. Omitting it
|
|
34
|
+
* defaults to the pre-terminal states `extracted` and `proposed`.
|
|
35
|
+
* - **`type`** (repeatable, `ety_...` IDs) matches the entity's _effective_ type:
|
|
36
|
+
* an entity matches when its assigned type is one of these IDs, or it has no
|
|
37
|
+
* assigned type and its bem-inferred type name matches one of them.
|
|
38
|
+
* - **`assignedTo`** (`me` or a `usr_...` ID) restricts to entities whose
|
|
39
|
+
* effective type the given user reviews. `me` resolves to the calling user.
|
|
40
|
+
* - **`since`** (RFC3339) restricts to entities created at or after the time.
|
|
41
|
+
*
|
|
42
|
+
* Pagination is cursor-based on `entityID` ascending; default limit is 50,
|
|
43
|
+
* maximum 200.
|
|
44
|
+
*/
|
|
45
|
+
list(
|
|
46
|
+
query: ReviewQueueListParams | null | undefined = {},
|
|
47
|
+
options?: RequestOptions,
|
|
48
|
+
): APIPromise<ReviewQueueListResponse> {
|
|
49
|
+
return this._client.get('/v3/review-queue', { query, ...options });
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* `GET /v3/review-queue` response. Cursor-paginated by `entityID` ascending.
|
|
55
|
+
*/
|
|
56
|
+
export interface ReviewQueueListResponse {
|
|
57
|
+
/**
|
|
58
|
+
* The page of entities awaiting curation.
|
|
59
|
+
*/
|
|
60
|
+
entities: Array<ReviewQueueListResponse.Entity>;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Whether more rows exist beyond this page.
|
|
64
|
+
*/
|
|
65
|
+
hasMore: boolean;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Opaque cursor to pass as `?cursor=` for the next page. Empty when `hasMore` is
|
|
69
|
+
* false.
|
|
70
|
+
*/
|
|
71
|
+
nextCursor?: string;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export namespace ReviewQueueListResponse {
|
|
75
|
+
/**
|
|
76
|
+
* One row of the review queue: an entity plus a small preview of its mentions.
|
|
77
|
+
*/
|
|
78
|
+
export interface Entity {
|
|
79
|
+
/**
|
|
80
|
+
* The canonical (longest / most descriptive) surface form.
|
|
81
|
+
*/
|
|
82
|
+
canonical: string;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* When the entity was created.
|
|
86
|
+
*/
|
|
87
|
+
createdAt: string;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Public ID (`ent_...`) of the entity.
|
|
91
|
+
*/
|
|
92
|
+
entityID: string;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Total mentions across all parsed documents.
|
|
96
|
+
*/
|
|
97
|
+
mentionCount: number;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* A capped preview (up to 2) of the entity's first mentions, ordered by page then
|
|
101
|
+
* time, so a reviewer can triage without opening each entity.
|
|
102
|
+
*/
|
|
103
|
+
previewMentions: Array<Entity.PreviewMention>;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Curation lifecycle state: `extracted`, `proposed`, `approved`, `rejected`.
|
|
107
|
+
*/
|
|
108
|
+
status: string;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Distinct surface forms that have resolved to this entity.
|
|
112
|
+
*/
|
|
113
|
+
surfaceForms: Array<string>;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* The effective type name (assigned override if set, else bem-inferred).
|
|
117
|
+
*/
|
|
118
|
+
type: string;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* When the entity was last updated.
|
|
122
|
+
*/
|
|
123
|
+
updatedAt: string;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Free-form description of the entity, when present.
|
|
127
|
+
*/
|
|
128
|
+
description?: string;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Public ID (`ety_...`) of the customer-assigned type, when one is set.
|
|
132
|
+
*/
|
|
133
|
+
typeID?: string;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* When a human approved/rejected the entity. Omitted while un-validated.
|
|
137
|
+
*/
|
|
138
|
+
validatedAt?: string;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Public ID (`usr_...`) of the user who validated the entity, when known.
|
|
142
|
+
*/
|
|
143
|
+
validatedByUserID?: string;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export namespace Entity {
|
|
147
|
+
/**
|
|
148
|
+
* A single per-document occurrence of an entity, used in review-queue previews.
|
|
149
|
+
*/
|
|
150
|
+
export interface PreviewMention {
|
|
151
|
+
/**
|
|
152
|
+
* When this mention was recorded.
|
|
153
|
+
*/
|
|
154
|
+
createdAt: string;
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Public ID (`ent_...`) of the entity this mention resolves to.
|
|
158
|
+
*/
|
|
159
|
+
entityID: string;
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Public ID (`emn_...`) of this mention.
|
|
163
|
+
*/
|
|
164
|
+
mentionID: string;
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* 1-indexed page number within the source document.
|
|
168
|
+
*/
|
|
169
|
+
page: number;
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* The user-provided document handle this mention came from.
|
|
173
|
+
*/
|
|
174
|
+
referenceID: string;
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* The exact surface string Parse extracted on the page.
|
|
178
|
+
*/
|
|
179
|
+
surface: string;
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* The parse-emitted section label this mention sat under, when present.
|
|
183
|
+
*/
|
|
184
|
+
sectionLabel?: string;
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Public ID of the parse transformation that produced this mention, when known.
|
|
188
|
+
*/
|
|
189
|
+
transformationID?: string;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export interface ReviewQueueListParams {
|
|
195
|
+
/**
|
|
196
|
+
* `me` or a `usr_...` ID — restrict to entities whose effective type that user
|
|
197
|
+
* reviews.
|
|
198
|
+
*/
|
|
199
|
+
assignedTo?: string;
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Optional bucket public ID (`bkt_...`) to scope to. Omit for all buckets.
|
|
203
|
+
*/
|
|
204
|
+
bucket?: string;
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Cursor — an `entityID` defining your place in the list.
|
|
208
|
+
*/
|
|
209
|
+
cursor?: string;
|
|
210
|
+
|
|
211
|
+
limit?: number;
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* RFC3339 timestamp — restrict to entities created at or after this time.
|
|
215
|
+
*/
|
|
216
|
+
since?: string;
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Restrict to these lifecycle states. Defaults to `extracted` + `proposed`.
|
|
220
|
+
*/
|
|
221
|
+
status?: Array<string>;
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Restrict to entities whose effective type is one of these `ety_...` IDs.
|
|
225
|
+
*/
|
|
226
|
+
type?: Array<string>;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
export declare namespace ReviewQueue {
|
|
230
|
+
export {
|
|
231
|
+
type ReviewQueueListResponse as ReviewQueueListResponse,
|
|
232
|
+
type ReviewQueueListParams as ReviewQueueListParams,
|
|
233
|
+
};
|
|
234
|
+
}
|
|
@@ -9,11 +9,23 @@ import { path } from '../internal/utils/path';
|
|
|
9
9
|
/**
|
|
10
10
|
* Subscriptions wire up notifications for the events your functions and collections produce.
|
|
11
11
|
*
|
|
12
|
-
*
|
|
13
|
-
* collection (by `collectionName` or `collectionID`) and
|
|
12
|
+
* Most subscriptions target a single function (by `functionName` or `functionID`) or a single
|
|
13
|
+
* collection (by `collectionName` or `collectionID`) and select a `type` corresponding to the
|
|
14
14
|
* event you want to receive — for example `transform`, `route`, `join`, `evaluation`, `error`,
|
|
15
15
|
* `enrich`, or `collection_processing`.
|
|
16
16
|
*
|
|
17
|
+
* Entity-lifecycle events are account-wide and target no function or collection. Set `type` to
|
|
18
|
+
* one of the following and provide a `webhookURL` (these event types support webhook delivery
|
|
19
|
+
* only):
|
|
20
|
+
*
|
|
21
|
+
* - `entity_proposed` — an entity entered the `proposed` curation status (queued for review).
|
|
22
|
+
* - `entity_validated` — an entity was approved/validated by a reviewer.
|
|
23
|
+
* - `entity_rejected` — an entity was rejected by a reviewer.
|
|
24
|
+
*
|
|
25
|
+
* Each entity-lifecycle delivery is a JSON POST describing the transition (`entityID`,
|
|
26
|
+
* `typeName`, `priorStatus`, `newStatus`, optional `actorUserID` and `reason`, and a
|
|
27
|
+
* `timestamp`).
|
|
28
|
+
*
|
|
17
29
|
* Deliveries can be sent to any combination of:
|
|
18
30
|
*
|
|
19
31
|
* - `webhookURL` — HTTPS endpoint that receives a JSON POST per event.
|
|
@@ -0,0 +1,76 @@
|
|
|
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 { RequestOptions } from '../internal/request-options';
|
|
6
|
+
import { path } from '../internal/utils/path';
|
|
7
|
+
|
|
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
|
+
export class Users extends APIResource {
|
|
28
|
+
/**
|
|
29
|
+
* List a User's Reviewer Assignments
|
|
30
|
+
*/
|
|
31
|
+
listReviewerAssignments(
|
|
32
|
+
userID: string,
|
|
33
|
+
options?: RequestOptions,
|
|
34
|
+
): APIPromise<UserListReviewerAssignmentsResponse> {
|
|
35
|
+
return this._client.get(path`/v3/users/${userID}/reviewer-assignments`, options);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Response body for the reverse lookup of a user's reviewer assignments.
|
|
41
|
+
*/
|
|
42
|
+
export interface UserListReviewerAssignmentsResponse {
|
|
43
|
+
assignments: Array<UserListReviewerAssignmentsResponse.Assignment>;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export namespace UserListReviewerAssignmentsResponse {
|
|
47
|
+
/**
|
|
48
|
+
* One entity type a user reviews, as returned by the reverse-lookup endpoint. The
|
|
49
|
+
* type is exposed via its public ID plus its name and description.
|
|
50
|
+
*/
|
|
51
|
+
export interface Assignment {
|
|
52
|
+
/**
|
|
53
|
+
* When the assignment was created (RFC 3339).
|
|
54
|
+
*/
|
|
55
|
+
createdAt: string;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* The entity type's description.
|
|
59
|
+
*/
|
|
60
|
+
description: string;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* The entity type's human-facing name.
|
|
64
|
+
*/
|
|
65
|
+
name: string;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Public ID (`ety_...`) of the entity type the user reviews.
|
|
69
|
+
*/
|
|
70
|
+
typeID: string;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export declare namespace Users {
|
|
75
|
+
export { type UserListReviewerAssignmentsResponse as UserListReviewerAssignmentsResponse };
|
|
76
|
+
}
|