@clidey/whodb-sdk 0.127.1 → 0.127.3
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/README.md +10 -0
- package/dist/client.d.ts +2 -2
- package/dist/generated/hydration.js +1 -1
- package/dist/generated/manifest.d.ts +1 -1
- package/dist/generated/manifest.js +14 -2
- package/dist/generated/operations.d.ts +33 -4
- package/dist/generated/operations.js +28 -4
- package/dist/generated/surface.d.ts +32 -0
- package/dist/generated/surface.js +33 -1
- package/dist/generated/types.d.ts +59 -0
- package/dist/generated/types.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +15 -0
- package/dist/ontology.d.ts +14 -1
- package/dist/ontology.js +66 -0
- package/dist/transport-ipc.js +44 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -33,6 +33,16 @@ await users.createMany(rows, { idempotencyKey: 'import-42' });
|
|
|
33
33
|
await users.update('u_123', { plan: 'pro' });
|
|
34
34
|
const orders = await users.followLink('u_123', 'orders');
|
|
35
35
|
|
|
36
|
+
// Behavior-managed workflow:
|
|
37
|
+
const order = whodb.ontology('Order');
|
|
38
|
+
const capabilities = await order.capabilities('order_123');
|
|
39
|
+
await order.previewAction('approve', 'order_123', { note: 'Looks good' });
|
|
40
|
+
await order.action('approve', 'order_123', { note: 'Looks good' }, {
|
|
41
|
+
expectedVersion: capabilities.recordVersion ?? undefined,
|
|
42
|
+
idempotencyKey: 'approve-order-123',
|
|
43
|
+
});
|
|
44
|
+
const history = await order.actionExecutions('order_123');
|
|
45
|
+
|
|
36
46
|
// Iterate everything, page by page:
|
|
37
47
|
for await (const page of users.list({ pageSize: 500 }).pages()) {
|
|
38
48
|
console.log(page.rows.length);
|
package/dist/client.d.ts
CHANGED
|
@@ -17,9 +17,9 @@ import type { OntologyObjectType, PlatformSource } from './generated/types.js';
|
|
|
17
17
|
*/
|
|
18
18
|
export declare class WhoDB {
|
|
19
19
|
/** SHA-256 of the platform manifest this SDK release was generated from. */
|
|
20
|
-
static readonly manifestHash = "
|
|
20
|
+
static readonly manifestHash = "3cc0e6ed8d6e928e57d0acaec664df395c36307c8425124270d4a4efa7bfb7a7";
|
|
21
21
|
/** This SDK package's version. */
|
|
22
|
-
static readonly version = "0.127.
|
|
22
|
+
static readonly version = "0.127.3";
|
|
23
23
|
private readonly transport;
|
|
24
24
|
private readonly httpTransport;
|
|
25
25
|
private readonly filesHandle;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// GENERATED by sdk/tools/generate-core.mjs — DO NOT EDIT (manifest
|
|
1
|
+
// GENERATED by sdk/tools/generate-core.mjs — DO NOT EDIT (manifest 3cc0e6ed8d6e)
|
|
2
2
|
/** Column-type → coercion kind rules shared across all SDK languages. */
|
|
3
3
|
export const hydrationRules = {
|
|
4
4
|
"int": "int",
|
|
@@ -7,6 +7,6 @@ export declare const embeddedManifest: Record<string, {
|
|
|
7
7
|
note?: string;
|
|
8
8
|
}>;
|
|
9
9
|
/** SHA-256 of the platform-manifest.json this SDK was generated from. */
|
|
10
|
-
export declare const manifestHash = "
|
|
10
|
+
export declare const manifestHash = "3cc0e6ed8d6e928e57d0acaec664df395c36307c8425124270d4a4efa7bfb7a7";
|
|
11
11
|
/** Manifest protocol version this SDK understands. */
|
|
12
12
|
export declare const manifestProtocolVersion = "1";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// GENERATED by sdk/tools/generate-core.mjs — DO NOT EDIT (manifest
|
|
1
|
+
// GENERATED by sdk/tools/generate-core.mjs — DO NOT EDIT (manifest 3cc0e6ed8d6e)
|
|
2
2
|
/** Per-operation versioning-policy state embedded at generation time. */
|
|
3
3
|
export const embeddedManifest = {
|
|
4
4
|
"OntologyEntities": {
|
|
@@ -34,6 +34,18 @@ export const embeddedManifest = {
|
|
|
34
34
|
"OntologyFastLookups": {
|
|
35
35
|
"kind": "Query"
|
|
36
36
|
},
|
|
37
|
+
"OntologyRecordCapabilities": {
|
|
38
|
+
"kind": "Query"
|
|
39
|
+
},
|
|
40
|
+
"PreviewOntologyAction": {
|
|
41
|
+
"kind": "Query"
|
|
42
|
+
},
|
|
43
|
+
"ExecuteOntologyAction": {
|
|
44
|
+
"kind": "Mutation"
|
|
45
|
+
},
|
|
46
|
+
"OntologyActionExecutions": {
|
|
47
|
+
"kind": "Query"
|
|
48
|
+
},
|
|
37
49
|
"OntologyAddRow": {
|
|
38
50
|
"kind": "Mutation"
|
|
39
51
|
},
|
|
@@ -75,6 +87,6 @@ export const embeddedManifest = {
|
|
|
75
87
|
}
|
|
76
88
|
};
|
|
77
89
|
/** SHA-256 of the platform-manifest.json this SDK was generated from. */
|
|
78
|
-
export const manifestHash = '
|
|
90
|
+
export const manifestHash = '3cc0e6ed8d6e928e57d0acaec664df395c36307c8425124270d4a4efa7bfb7a7';
|
|
79
91
|
/** Manifest protocol version this SDK understands. */
|
|
80
92
|
export const manifestProtocolVersion = '1';
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import type { Transport } from '../transport.js';
|
|
2
|
-
import type { Column, Dataset, DatasetQueryResult, OntologyAddRowsResult, OntologyAggregateMetricInput, OntologyCreateRowInput, OntologyDescribeInput, OntologyDescription, OntologyFastLookup, OntologyObjectType, OntologyQueryInput, OntologySimilarInput, OntologySimilarityResult, OntologyStatsResult, Organization, PlatformSource, Project, QueryDatasetInput, RecordInput, RowsResult, SortCondition, SourceObject, SourceObjectKind, SourceObjectRefInput, StatusResponse, WhereCondition, Workspace } from './types.js';
|
|
2
|
+
import type { Column, Dataset, DatasetQueryResult, ExecuteOntologyActionInput, ExecuteOntologyActionResult, OntologyActionExecution, OntologyActionPreview, OntologyAddRowsResult, OntologyAggregateMetricInput, OntologyCreateRowInput, OntologyDescribeInput, OntologyDescription, OntologyFastLookup, OntologyObjectType, OntologyQueryInput, OntologyRecordCapabilities, OntologySimilarInput, OntologySimilarityResult, OntologyStatsResult, Organization, PlatformSource, PreviewOntologyActionInput, Project, QueryDatasetInput, RecordInput, RowsResult, SortCondition, SourceObject, SourceObjectKind, SourceObjectRefInput, StatusResponse, WhereCondition, Workspace } from './types.js';
|
|
3
3
|
export interface OntologyEntitiesVars {
|
|
4
4
|
projectId: string;
|
|
5
5
|
}
|
|
6
|
-
export declare const OntologyEntitiesDocument = "query OntologyEntities($projectId: ID!) { OntologyEntities(projectId: $projectId) { id projectId apiName displayName pluralDisplayName description primaryKey sourceId tableName schemaName storageMode provisioningStatus embeddingEnabled embeddingProperties status icon color createdAt updatedAt properties { id apiName displayName description columnName dataType arrayElementType isRequired visibility isSearchable isSortable isEditOnly sortOrder } links { id apiName targetOntologyApiName cardinality foreignKeyProperty targetForeignKeyProperty joinTable sourceColumnInJoinTable targetColumnInJoinTable displayName pluralDisplayName reverseDisplayName } } }";
|
|
6
|
+
export declare const OntologyEntitiesDocument = "query OntologyEntities($projectId: ID!) { OntologyEntities(projectId: $projectId) { id projectId apiName displayName pluralDisplayName description primaryKey sourceId tableName schemaName storageMode provisioningStatus embeddingEnabled embeddingProperties status icon color createdAt updatedAt properties { id apiName displayName description columnName dataType arrayElementType isRequired visibility isSearchable isSortable isEditOnly sortOrder } links { id apiName targetOntologyApiName cardinality foreignKeyProperty targetForeignKeyProperty joinTable sourceColumnInJoinTable targetColumnInJoinTable displayName pluralDisplayName reverseDisplayName targetKind targetReferenceId } } }";
|
|
7
7
|
/** Generated wire call for Query OntologyEntities. */
|
|
8
8
|
export declare function ontologyEntities(transport: Transport, vars: OntologyEntitiesVars): Promise<Array<OntologyObjectType>>;
|
|
9
9
|
export interface OntologyEntityVars {
|
|
10
10
|
projectId: string;
|
|
11
11
|
id: string;
|
|
12
12
|
}
|
|
13
|
-
export declare const OntologyEntityDocument = "query OntologyEntity($projectId: ID!, $id: ID!) { OntologyEntity(projectId: $projectId, id: $id) { id projectId apiName displayName pluralDisplayName description primaryKey sourceId tableName schemaName storageMode provisioningStatus embeddingEnabled embeddingProperties status icon color createdAt updatedAt properties { id apiName displayName description columnName dataType arrayElementType isRequired visibility isSearchable isSortable isEditOnly sortOrder } links { id apiName targetOntologyApiName cardinality foreignKeyProperty targetForeignKeyProperty joinTable sourceColumnInJoinTable targetColumnInJoinTable displayName pluralDisplayName reverseDisplayName } } }";
|
|
13
|
+
export declare const OntologyEntityDocument = "query OntologyEntity($projectId: ID!, $id: ID!) { OntologyEntity(projectId: $projectId, id: $id) { id projectId apiName displayName pluralDisplayName description primaryKey sourceId tableName schemaName storageMode provisioningStatus embeddingEnabled embeddingProperties status icon color createdAt updatedAt properties { id apiName displayName description columnName dataType arrayElementType isRequired visibility isSearchable isSortable isEditOnly sortOrder } links { id apiName targetOntologyApiName cardinality foreignKeyProperty targetForeignKeyProperty joinTable sourceColumnInJoinTable targetColumnInJoinTable displayName pluralDisplayName reverseDisplayName targetKind targetReferenceId } } }";
|
|
14
14
|
/** Generated wire call for Query OntologyEntity. */
|
|
15
15
|
export declare function ontologyEntity(transport: Transport, vars: OntologyEntityVars): Promise<OntologyObjectType>;
|
|
16
16
|
export interface OntologyDescribeVars {
|
|
@@ -95,6 +95,35 @@ export interface OntologyFastLookupsVars {
|
|
|
95
95
|
export declare const OntologyFastLookupsDocument = "query OntologyFastLookups($projectId: ID!, $entityId: ID!) { OntologyFastLookups(projectId: $projectId, entityId: $entityId) { id entityId displayName fields status reason createdAt updatedAt } }";
|
|
96
96
|
/** Generated wire call for Query OntologyFastLookups. */
|
|
97
97
|
export declare function ontologyFastLookups(transport: Transport, vars: OntologyFastLookupsVars): Promise<Array<OntologyFastLookup>>;
|
|
98
|
+
export interface OntologyRecordCapabilitiesVars {
|
|
99
|
+
projectId: string;
|
|
100
|
+
ontologyId: string;
|
|
101
|
+
recordKey?: string | null;
|
|
102
|
+
}
|
|
103
|
+
export declare const OntologyRecordCapabilitiesDocument = "query OntologyRecordCapabilities($projectId: ID!, $ontologyId: ID!, $recordKey: String) { OntologyRecordCapabilities(projectId: $projectId, ontologyId: $ontologyId, recordKey: $recordKey) { behaviorVersion recordVersion currentState readableProperties writableProperties actions { apiName allowed denialCode } } }";
|
|
104
|
+
/** Generated wire call for Query OntologyRecordCapabilities. */
|
|
105
|
+
export declare function ontologyRecordCapabilities(transport: Transport, vars: OntologyRecordCapabilitiesVars): Promise<OntologyRecordCapabilities>;
|
|
106
|
+
export interface PreviewOntologyActionVars {
|
|
107
|
+
input: PreviewOntologyActionInput;
|
|
108
|
+
}
|
|
109
|
+
export declare const PreviewOntologyActionDocument = "query PreviewOntologyAction($input: PreviewOntologyActionInput!) { PreviewOntologyAction(input: $input) { allowed denialCode proposedChanges emittedEvents } }";
|
|
110
|
+
/** Generated wire call for Query PreviewOntologyAction. */
|
|
111
|
+
export declare function previewOntologyAction(transport: Transport, vars: PreviewOntologyActionVars): Promise<OntologyActionPreview>;
|
|
112
|
+
export interface ExecuteOntologyActionVars {
|
|
113
|
+
input: ExecuteOntologyActionInput;
|
|
114
|
+
}
|
|
115
|
+
export declare const ExecuteOntologyActionDocument = "mutation ExecuteOntologyAction($input: ExecuteOntologyActionInput!) { ExecuteOntologyAction(input: $input) { executionId allowed denialCode recordChanges recordVersion emittedEventIds validationErrors } }";
|
|
116
|
+
/** Generated wire call for Mutation ExecuteOntologyAction. */
|
|
117
|
+
export declare function executeOntologyAction(transport: Transport, vars: ExecuteOntologyActionVars): Promise<ExecuteOntologyActionResult>;
|
|
118
|
+
export interface OntologyActionExecutionsVars {
|
|
119
|
+
projectId: string;
|
|
120
|
+
ontologyId: string;
|
|
121
|
+
recordKey: string;
|
|
122
|
+
limit?: number | null;
|
|
123
|
+
}
|
|
124
|
+
export declare const OntologyActionExecutionsDocument = "query OntologyActionExecutions($projectId: ID!, $ontologyId: ID!, $recordKey: String!, $limit: Int) { OntologyActionExecutions(projectId: $projectId, ontologyId: $ontologyId, recordKey: $recordKey, limit: $limit) { id ontologyId recordKey actionName behaviorVersionId actorId status resultSummary createdAt } }";
|
|
125
|
+
/** Generated wire call for Query OntologyActionExecutions. */
|
|
126
|
+
export declare function ontologyActionExecutions(transport: Transport, vars: OntologyActionExecutionsVars): Promise<Array<OntologyActionExecution>>;
|
|
98
127
|
export interface OntologyAddRowVars {
|
|
99
128
|
projectId: string;
|
|
100
129
|
entityId: string;
|
|
@@ -132,7 +161,7 @@ export declare function ontologyDeleteRow(transport: Transport, vars: OntologyDe
|
|
|
132
161
|
export interface ProjectDatasetsVars {
|
|
133
162
|
projectId: string;
|
|
134
163
|
}
|
|
135
|
-
export declare const ProjectDatasetsDocument = "query ProjectDatasets($projectId: ID!) { ProjectDatasets(projectId: $projectId) { id projectId sourceId name description schema { name type isNullable isPrimary } schemaMode ownerId rowCount sizeBytes createdAt updatedAt } }";
|
|
164
|
+
export declare const ProjectDatasetsDocument = "query ProjectDatasets($projectId: ID!) { ProjectDatasets(projectId: $projectId) { id projectId sourceId name description schema { name type isNullable isPrimary } schemaMode storageMode ownerId rowCount sizeBytes createdAt updatedAt } }";
|
|
136
165
|
/** Generated wire call for Query ProjectDatasets. */
|
|
137
166
|
export declare function projectDatasets(transport: Transport, vars: ProjectDatasetsVars): Promise<Array<Dataset>>;
|
|
138
167
|
export interface QueryDatasetVars {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
// GENERATED by sdk/tools/generate-core.mjs — DO NOT EDIT (manifest
|
|
2
|
-
export const OntologyEntitiesDocument = "query OntologyEntities($projectId: ID!) { OntologyEntities(projectId: $projectId) { id projectId apiName displayName pluralDisplayName description primaryKey sourceId tableName schemaName storageMode provisioningStatus embeddingEnabled embeddingProperties status icon color createdAt updatedAt properties { id apiName displayName description columnName dataType arrayElementType isRequired visibility isSearchable isSortable isEditOnly sortOrder } links { id apiName targetOntologyApiName cardinality foreignKeyProperty targetForeignKeyProperty joinTable sourceColumnInJoinTable targetColumnInJoinTable displayName pluralDisplayName reverseDisplayName } } }";
|
|
1
|
+
// GENERATED by sdk/tools/generate-core.mjs — DO NOT EDIT (manifest 3cc0e6ed8d6e)
|
|
2
|
+
export const OntologyEntitiesDocument = "query OntologyEntities($projectId: ID!) { OntologyEntities(projectId: $projectId) { id projectId apiName displayName pluralDisplayName description primaryKey sourceId tableName schemaName storageMode provisioningStatus embeddingEnabled embeddingProperties status icon color createdAt updatedAt properties { id apiName displayName description columnName dataType arrayElementType isRequired visibility isSearchable isSortable isEditOnly sortOrder } links { id apiName targetOntologyApiName cardinality foreignKeyProperty targetForeignKeyProperty joinTable sourceColumnInJoinTable targetColumnInJoinTable displayName pluralDisplayName reverseDisplayName targetKind targetReferenceId } } }";
|
|
3
3
|
/** Generated wire call for Query OntologyEntities. */
|
|
4
4
|
export async function ontologyEntities(transport, vars) {
|
|
5
5
|
const data = await transport.execute('OntologyEntities', OntologyEntitiesDocument, vars);
|
|
6
6
|
return data['OntologyEntities'];
|
|
7
7
|
}
|
|
8
|
-
export const OntologyEntityDocument = "query OntologyEntity($projectId: ID!, $id: ID!) { OntologyEntity(projectId: $projectId, id: $id) { id projectId apiName displayName pluralDisplayName description primaryKey sourceId tableName schemaName storageMode provisioningStatus embeddingEnabled embeddingProperties status icon color createdAt updatedAt properties { id apiName displayName description columnName dataType arrayElementType isRequired visibility isSearchable isSortable isEditOnly sortOrder } links { id apiName targetOntologyApiName cardinality foreignKeyProperty targetForeignKeyProperty joinTable sourceColumnInJoinTable targetColumnInJoinTable displayName pluralDisplayName reverseDisplayName } } }";
|
|
8
|
+
export const OntologyEntityDocument = "query OntologyEntity($projectId: ID!, $id: ID!) { OntologyEntity(projectId: $projectId, id: $id) { id projectId apiName displayName pluralDisplayName description primaryKey sourceId tableName schemaName storageMode provisioningStatus embeddingEnabled embeddingProperties status icon color createdAt updatedAt properties { id apiName displayName description columnName dataType arrayElementType isRequired visibility isSearchable isSortable isEditOnly sortOrder } links { id apiName targetOntologyApiName cardinality foreignKeyProperty targetForeignKeyProperty joinTable sourceColumnInJoinTable targetColumnInJoinTable displayName pluralDisplayName reverseDisplayName targetKind targetReferenceId } } }";
|
|
9
9
|
/** Generated wire call for Query OntologyEntity. */
|
|
10
10
|
export async function ontologyEntity(transport, vars) {
|
|
11
11
|
const data = await transport.execute('OntologyEntity', OntologyEntityDocument, vars);
|
|
@@ -65,6 +65,30 @@ export async function ontologyFastLookups(transport, vars) {
|
|
|
65
65
|
const data = await transport.execute('OntologyFastLookups', OntologyFastLookupsDocument, vars);
|
|
66
66
|
return data['OntologyFastLookups'];
|
|
67
67
|
}
|
|
68
|
+
export const OntologyRecordCapabilitiesDocument = "query OntologyRecordCapabilities($projectId: ID!, $ontologyId: ID!, $recordKey: String) { OntologyRecordCapabilities(projectId: $projectId, ontologyId: $ontologyId, recordKey: $recordKey) { behaviorVersion recordVersion currentState readableProperties writableProperties actions { apiName allowed denialCode } } }";
|
|
69
|
+
/** Generated wire call for Query OntologyRecordCapabilities. */
|
|
70
|
+
export async function ontologyRecordCapabilities(transport, vars) {
|
|
71
|
+
const data = await transport.execute('OntologyRecordCapabilities', OntologyRecordCapabilitiesDocument, vars);
|
|
72
|
+
return data['OntologyRecordCapabilities'];
|
|
73
|
+
}
|
|
74
|
+
export const PreviewOntologyActionDocument = "query PreviewOntologyAction($input: PreviewOntologyActionInput!) { PreviewOntologyAction(input: $input) { allowed denialCode proposedChanges emittedEvents } }";
|
|
75
|
+
/** Generated wire call for Query PreviewOntologyAction. */
|
|
76
|
+
export async function previewOntologyAction(transport, vars) {
|
|
77
|
+
const data = await transport.execute('PreviewOntologyAction', PreviewOntologyActionDocument, vars);
|
|
78
|
+
return data['PreviewOntologyAction'];
|
|
79
|
+
}
|
|
80
|
+
export const ExecuteOntologyActionDocument = "mutation ExecuteOntologyAction($input: ExecuteOntologyActionInput!) { ExecuteOntologyAction(input: $input) { executionId allowed denialCode recordChanges recordVersion emittedEventIds validationErrors } }";
|
|
81
|
+
/** Generated wire call for Mutation ExecuteOntologyAction. */
|
|
82
|
+
export async function executeOntologyAction(transport, vars) {
|
|
83
|
+
const data = await transport.execute('ExecuteOntologyAction', ExecuteOntologyActionDocument, vars);
|
|
84
|
+
return data['ExecuteOntologyAction'];
|
|
85
|
+
}
|
|
86
|
+
export const OntologyActionExecutionsDocument = "query OntologyActionExecutions($projectId: ID!, $ontologyId: ID!, $recordKey: String!, $limit: Int) { OntologyActionExecutions(projectId: $projectId, ontologyId: $ontologyId, recordKey: $recordKey, limit: $limit) { id ontologyId recordKey actionName behaviorVersionId actorId status resultSummary createdAt } }";
|
|
87
|
+
/** Generated wire call for Query OntologyActionExecutions. */
|
|
88
|
+
export async function ontologyActionExecutions(transport, vars) {
|
|
89
|
+
const data = await transport.execute('OntologyActionExecutions', OntologyActionExecutionsDocument, vars);
|
|
90
|
+
return data['OntologyActionExecutions'];
|
|
91
|
+
}
|
|
68
92
|
export const OntologyAddRowDocument = "mutation OntologyAddRow($projectId: ID!, $entityId: ID!, $values: [RecordInput!]!) { OntologyAddRow(projectId: $projectId, entityId: $entityId, values: $values) { Status } }";
|
|
69
93
|
/** Generated wire call for Mutation OntologyAddRow. */
|
|
70
94
|
export async function ontologyAddRow(transport, vars) {
|
|
@@ -89,7 +113,7 @@ export async function ontologyDeleteRow(transport, vars) {
|
|
|
89
113
|
const data = await transport.execute('OntologyDeleteRow', OntologyDeleteRowDocument, vars);
|
|
90
114
|
return data['OntologyDeleteRow'];
|
|
91
115
|
}
|
|
92
|
-
export const ProjectDatasetsDocument = "query ProjectDatasets($projectId: ID!) { ProjectDatasets(projectId: $projectId) { id projectId sourceId name description schema { name type isNullable isPrimary } schemaMode ownerId rowCount sizeBytes createdAt updatedAt } }";
|
|
116
|
+
export const ProjectDatasetsDocument = "query ProjectDatasets($projectId: ID!) { ProjectDatasets(projectId: $projectId) { id projectId sourceId name description schema { name type isNullable isPrimary } schemaMode storageMode ownerId rowCount sizeBytes createdAt updatedAt } }";
|
|
93
117
|
/** Generated wire call for Query ProjectDatasets. */
|
|
94
118
|
export async function projectDatasets(transport, vars) {
|
|
95
119
|
const data = await transport.execute('ProjectDatasets', ProjectDatasetsDocument, vars);
|
|
@@ -101,6 +101,38 @@ export declare const surface: {
|
|
|
101
101
|
readonly rename: {};
|
|
102
102
|
readonly paginated: null;
|
|
103
103
|
};
|
|
104
|
+
readonly capabilities: {
|
|
105
|
+
readonly operation: "OntologyRecordCapabilities";
|
|
106
|
+
readonly autofill: {
|
|
107
|
+
readonly projectId: "$project";
|
|
108
|
+
};
|
|
109
|
+
readonly rename: {};
|
|
110
|
+
readonly paginated: null;
|
|
111
|
+
};
|
|
112
|
+
readonly previewAction: {
|
|
113
|
+
readonly operation: "PreviewOntologyAction";
|
|
114
|
+
readonly autofill: {
|
|
115
|
+
readonly projectId: "$project";
|
|
116
|
+
};
|
|
117
|
+
readonly rename: {};
|
|
118
|
+
readonly paginated: null;
|
|
119
|
+
};
|
|
120
|
+
readonly action: {
|
|
121
|
+
readonly operation: "ExecuteOntologyAction";
|
|
122
|
+
readonly autofill: {
|
|
123
|
+
readonly projectId: "$project";
|
|
124
|
+
};
|
|
125
|
+
readonly rename: {};
|
|
126
|
+
readonly paginated: null;
|
|
127
|
+
};
|
|
128
|
+
readonly actionExecutions: {
|
|
129
|
+
readonly operation: "OntologyActionExecutions";
|
|
130
|
+
readonly autofill: {
|
|
131
|
+
readonly projectId: "$project";
|
|
132
|
+
};
|
|
133
|
+
readonly rename: {};
|
|
134
|
+
readonly paginated: null;
|
|
135
|
+
};
|
|
104
136
|
readonly create: {
|
|
105
137
|
readonly operation: "OntologyAddRow";
|
|
106
138
|
readonly autofill: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// GENERATED by sdk/tools/generate-core.mjs — DO NOT EDIT (manifest
|
|
1
|
+
// GENERATED by sdk/tools/generate-core.mjs — DO NOT EDIT (manifest 3cc0e6ed8d6e)
|
|
2
2
|
/** Facade surface mapping generated from sdk/spec/surface.yaml. */
|
|
3
3
|
export const surface = {
|
|
4
4
|
"ontology": {
|
|
@@ -102,6 +102,38 @@ export const surface = {
|
|
|
102
102
|
"rename": {},
|
|
103
103
|
"paginated": null
|
|
104
104
|
},
|
|
105
|
+
"capabilities": {
|
|
106
|
+
"operation": "OntologyRecordCapabilities",
|
|
107
|
+
"autofill": {
|
|
108
|
+
"projectId": "$project"
|
|
109
|
+
},
|
|
110
|
+
"rename": {},
|
|
111
|
+
"paginated": null
|
|
112
|
+
},
|
|
113
|
+
"previewAction": {
|
|
114
|
+
"operation": "PreviewOntologyAction",
|
|
115
|
+
"autofill": {
|
|
116
|
+
"projectId": "$project"
|
|
117
|
+
},
|
|
118
|
+
"rename": {},
|
|
119
|
+
"paginated": null
|
|
120
|
+
},
|
|
121
|
+
"action": {
|
|
122
|
+
"operation": "ExecuteOntologyAction",
|
|
123
|
+
"autofill": {
|
|
124
|
+
"projectId": "$project"
|
|
125
|
+
},
|
|
126
|
+
"rename": {},
|
|
127
|
+
"paginated": null
|
|
128
|
+
},
|
|
129
|
+
"actionExecutions": {
|
|
130
|
+
"operation": "OntologyActionExecutions",
|
|
131
|
+
"autofill": {
|
|
132
|
+
"projectId": "$project"
|
|
133
|
+
},
|
|
134
|
+
"rename": {},
|
|
135
|
+
"paginated": null
|
|
136
|
+
},
|
|
105
137
|
"create": {
|
|
106
138
|
"operation": "OntologyAddRow",
|
|
107
139
|
"autofill": {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export type ActionExecutionStatus = 'committed' | 'failed' | 'denied';
|
|
1
2
|
export interface AtomicWhereCondition {
|
|
2
3
|
ColumnType: string;
|
|
3
4
|
Key: string;
|
|
@@ -30,6 +31,7 @@ export interface Dataset {
|
|
|
30
31
|
description: string;
|
|
31
32
|
schema: Array<ColumnDef>;
|
|
32
33
|
schemaMode: string;
|
|
34
|
+
storageMode: string;
|
|
33
35
|
ownerId: string;
|
|
34
36
|
rowCount: number;
|
|
35
37
|
sizeBytes: number;
|
|
@@ -41,6 +43,46 @@ export interface DatasetQueryResult {
|
|
|
41
43
|
rows: Array<Array<string>>;
|
|
42
44
|
total: number;
|
|
43
45
|
}
|
|
46
|
+
export interface ExecuteOntologyActionInput {
|
|
47
|
+
projectId: string;
|
|
48
|
+
ontologyId: string;
|
|
49
|
+
recordKey?: string | null;
|
|
50
|
+
action: string;
|
|
51
|
+
values: unknown;
|
|
52
|
+
expectedVersion?: number | null;
|
|
53
|
+
idempotencyKey?: string | null;
|
|
54
|
+
}
|
|
55
|
+
export interface ExecuteOntologyActionResult {
|
|
56
|
+
executionId: string;
|
|
57
|
+
allowed: boolean;
|
|
58
|
+
denialCode?: string | null;
|
|
59
|
+
recordChanges?: unknown | null;
|
|
60
|
+
recordVersion?: number | null;
|
|
61
|
+
emittedEventIds?: Array<string> | null;
|
|
62
|
+
validationErrors?: Array<string> | null;
|
|
63
|
+
}
|
|
64
|
+
export interface OntologyActionCapability {
|
|
65
|
+
apiName: string;
|
|
66
|
+
allowed: boolean;
|
|
67
|
+
denialCode?: string | null;
|
|
68
|
+
}
|
|
69
|
+
export interface OntologyActionExecution {
|
|
70
|
+
id: string;
|
|
71
|
+
ontologyId: string;
|
|
72
|
+
recordKey: string;
|
|
73
|
+
actionName: string;
|
|
74
|
+
behaviorVersionId: string;
|
|
75
|
+
actorId: string;
|
|
76
|
+
status: ActionExecutionStatus;
|
|
77
|
+
resultSummary?: unknown | null;
|
|
78
|
+
createdAt: unknown;
|
|
79
|
+
}
|
|
80
|
+
export interface OntologyActionPreview {
|
|
81
|
+
allowed: boolean;
|
|
82
|
+
denialCode?: string | null;
|
|
83
|
+
proposedChanges?: unknown | null;
|
|
84
|
+
emittedEvents?: Array<string> | null;
|
|
85
|
+
}
|
|
44
86
|
export interface OntologyAddRowsResult {
|
|
45
87
|
inserted: number;
|
|
46
88
|
ids: Array<string>;
|
|
@@ -111,6 +153,8 @@ export interface OntologyLink {
|
|
|
111
153
|
displayName: string;
|
|
112
154
|
pluralDisplayName: string;
|
|
113
155
|
reverseDisplayName: string;
|
|
156
|
+
targetKind: string;
|
|
157
|
+
targetReferenceId?: string | null;
|
|
114
158
|
}
|
|
115
159
|
export type OntologyLinkCardinality = 'ONE_TO_ONE' | 'ONE_TO_MANY' | 'MANY_TO_ONE' | 'MANY_TO_MANY';
|
|
116
160
|
export interface OntologyObjectType {
|
|
@@ -181,6 +225,14 @@ export interface OntologyQuerySortInput {
|
|
|
181
225
|
field: string;
|
|
182
226
|
desc?: boolean | null;
|
|
183
227
|
}
|
|
228
|
+
export interface OntologyRecordCapabilities {
|
|
229
|
+
behaviorVersion: number;
|
|
230
|
+
recordVersion?: number | null;
|
|
231
|
+
currentState?: string | null;
|
|
232
|
+
readableProperties: Array<string>;
|
|
233
|
+
writableProperties: Array<string>;
|
|
234
|
+
actions: Array<OntologyActionCapability>;
|
|
235
|
+
}
|
|
184
236
|
export interface OntologySimilarInput {
|
|
185
237
|
entityId: string;
|
|
186
238
|
rowId: string;
|
|
@@ -230,6 +282,13 @@ export interface PlatformSource {
|
|
|
230
282
|
ingestionError: string;
|
|
231
283
|
eventsReceived: string;
|
|
232
284
|
}
|
|
285
|
+
export interface PreviewOntologyActionInput {
|
|
286
|
+
projectId: string;
|
|
287
|
+
ontologyId: string;
|
|
288
|
+
recordKey?: string | null;
|
|
289
|
+
action: string;
|
|
290
|
+
values: unknown;
|
|
291
|
+
}
|
|
233
292
|
export interface Project {
|
|
234
293
|
id: string;
|
|
235
294
|
orgId: string;
|
package/dist/generated/types.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
// GENERATED by sdk/tools/generate-core.mjs — DO NOT EDIT (manifest
|
|
1
|
+
// GENERATED by sdk/tools/generate-core.mjs — DO NOT EDIT (manifest 3cc0e6ed8d6e)
|
|
2
2
|
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export type { Row } from './hydrate.js';
|
|
|
9
9
|
export type { Page } from './pagination.js';
|
|
10
10
|
export { ListCall } from './pagination.js';
|
|
11
11
|
export { OntologyHandle } from './ontology.js';
|
|
12
|
+
export type { ActionOptions } from './ontology.js';
|
|
12
13
|
export { DatasetHandle } from './dataset.js';
|
|
13
14
|
export { SourceHandle } from './source.js';
|
|
14
15
|
export { FilesHandle } from './files.js';
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 Clidey, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
1
16
|
export { WhoDB } from './client.js';
|
|
2
17
|
export { IpcTransport } from './transport-ipc.js';
|
|
3
18
|
export { apiKeyProvider, tokenProvider, cliProvider } from './auth.js';
|
package/dist/ontology.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Transport } from './transport.js';
|
|
2
|
-
import type { OntologyDescription, OntologyFastLookup, OntologyObjectType, OntologyStatsResult, OntologySimilarInput, OntologySimilarityResult, OntologyQueryInput, OntologyQuerySortInput, OntologyAggregateMetricInput, WhereCondition, SortCondition, OntologyAddRowsResult } from './generated/types.js';
|
|
2
|
+
import type { OntologyDescription, OntologyFastLookup, OntologyObjectType, OntologyStatsResult, OntologySimilarInput, OntologySimilarityResult, OntologyQueryInput, OntologyQuerySortInput, OntologyAggregateMetricInput, WhereCondition, SortCondition, OntologyAddRowsResult, ExecuteOntologyActionResult, OntologyActionExecution, OntologyActionPreview, OntologyRecordCapabilities } from './generated/types.js';
|
|
3
3
|
import { type Row } from './hydrate.js';
|
|
4
4
|
import { ListCall } from './pagination.js';
|
|
5
5
|
/** Options for list-shaped ontology reads. `where` is a JSON filter object
|
|
@@ -20,6 +20,11 @@ export interface AggregateOptions {
|
|
|
20
20
|
sort?: SortCondition[];
|
|
21
21
|
pageSize?: number;
|
|
22
22
|
}
|
|
23
|
+
/** Concurrency and retry controls for a named ontology action. */
|
|
24
|
+
export interface ActionOptions {
|
|
25
|
+
expectedVersion?: number;
|
|
26
|
+
idempotencyKey?: string;
|
|
27
|
+
}
|
|
23
28
|
/**
|
|
24
29
|
* OntologyHandle is the `whodb.ontology("User")` facade: reads and record
|
|
25
30
|
* writes for one ontology entity, addressed by apiName. Entity metadata is
|
|
@@ -60,6 +65,14 @@ export declare class OntologyHandle {
|
|
|
60
65
|
}): ListCall;
|
|
61
66
|
/** Lists the entity's fast lookups. */
|
|
62
67
|
fastLookups(): Promise<OntologyFastLookup[]>;
|
|
68
|
+
/** Computes the current actor's readable fields and allowed actions. */
|
|
69
|
+
capabilities(recordKey?: string | number): Promise<OntologyRecordCapabilities>;
|
|
70
|
+
/** Dry-runs a named action without persisting records, effects, or events. */
|
|
71
|
+
previewAction(action: string, recordKey: string | number | null, values?: Record<string, unknown>): Promise<OntologyActionPreview>;
|
|
72
|
+
/** Executes a named action with full behavior enforcement. */
|
|
73
|
+
action(action: string, recordKey: string | number | null, values?: Record<string, unknown>, options?: ActionOptions): Promise<ExecuteOntologyActionResult>;
|
|
74
|
+
/** Lists recent named-action executions for one record. */
|
|
75
|
+
actionExecutions(recordKey: string | number, limit?: number): Promise<OntologyActionExecution[]>;
|
|
63
76
|
/** Inserts one record. Values are field name/value pairs. */
|
|
64
77
|
create(values: Record<string, unknown>): Promise<void>;
|
|
65
78
|
/** Inserts many records; idempotencyKey makes safe retries possible. */
|
package/dist/ontology.js
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 Clidey, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
1
16
|
import * as ops from './generated/operations.js';
|
|
2
17
|
import { hydrateRows, propertyTypesOf } from './hydrate.js';
|
|
3
18
|
import { ListCall } from './pagination.js';
|
|
@@ -183,6 +198,57 @@ export class OntologyHandle {
|
|
|
183
198
|
entityId: entity.id,
|
|
184
199
|
});
|
|
185
200
|
}
|
|
201
|
+
/** Computes the current actor's readable fields and allowed actions. */
|
|
202
|
+
async capabilities(recordKey) {
|
|
203
|
+
const entity = await this.entityMeta();
|
|
204
|
+
warnIfFlagged('OntologyRecordCapabilities');
|
|
205
|
+
return ops.ontologyRecordCapabilities(this.transport, {
|
|
206
|
+
projectId: await this.projectId(),
|
|
207
|
+
ontologyId: entity.id,
|
|
208
|
+
recordKey: recordKey === undefined ? null : String(recordKey),
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
/** Dry-runs a named action without persisting records, effects, or events. */
|
|
212
|
+
async previewAction(action, recordKey, values = {}) {
|
|
213
|
+
const entity = await this.entityMeta();
|
|
214
|
+
warnIfFlagged('PreviewOntologyAction');
|
|
215
|
+
return ops.previewOntologyAction(this.transport, {
|
|
216
|
+
input: {
|
|
217
|
+
projectId: await this.projectId(),
|
|
218
|
+
ontologyId: entity.id,
|
|
219
|
+
recordKey: recordKey === null ? null : String(recordKey),
|
|
220
|
+
action,
|
|
221
|
+
values,
|
|
222
|
+
},
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
/** Executes a named action with full behavior enforcement. */
|
|
226
|
+
async action(action, recordKey, values = {}, options = {}) {
|
|
227
|
+
const entity = await this.entityMeta();
|
|
228
|
+
warnIfFlagged('ExecuteOntologyAction');
|
|
229
|
+
return ops.executeOntologyAction(this.transport, {
|
|
230
|
+
input: {
|
|
231
|
+
projectId: await this.projectId(),
|
|
232
|
+
ontologyId: entity.id,
|
|
233
|
+
recordKey: recordKey === null ? null : String(recordKey),
|
|
234
|
+
action,
|
|
235
|
+
values,
|
|
236
|
+
expectedVersion: options.expectedVersion ?? null,
|
|
237
|
+
idempotencyKey: options.idempotencyKey ?? null,
|
|
238
|
+
},
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
/** Lists recent named-action executions for one record. */
|
|
242
|
+
async actionExecutions(recordKey, limit = 50) {
|
|
243
|
+
const entity = await this.entityMeta();
|
|
244
|
+
warnIfFlagged('OntologyActionExecutions');
|
|
245
|
+
return ops.ontologyActionExecutions(this.transport, {
|
|
246
|
+
projectId: await this.projectId(),
|
|
247
|
+
ontologyId: entity.id,
|
|
248
|
+
recordKey: String(recordKey),
|
|
249
|
+
limit,
|
|
250
|
+
});
|
|
251
|
+
}
|
|
186
252
|
/** Inserts one record. Values are field name/value pairs. */
|
|
187
253
|
async create(values) {
|
|
188
254
|
const entity = await this.entityMeta();
|
package/dist/transport-ipc.js
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 Clidey, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
1
16
|
import { request as httpRequest } from 'node:http';
|
|
2
17
|
import { NotFoundError, PlatformError, TransportCapabilityError } from './errors.js';
|
|
3
18
|
/**
|
|
@@ -131,6 +146,35 @@ export class IpcTransport {
|
|
|
131
146
|
pageSize: variables.pageSize,
|
|
132
147
|
offset: variables.pageOffset,
|
|
133
148
|
}),
|
|
149
|
+
OntologyRecordCapabilities: async (variables) => this.post('/capabilities', {
|
|
150
|
+
entity: await this.entityName(String(variables.ontologyId)),
|
|
151
|
+
recordKey: variables.recordKey,
|
|
152
|
+
}),
|
|
153
|
+
PreviewOntologyAction: async (variables) => {
|
|
154
|
+
const input = variables.input ?? {};
|
|
155
|
+
return this.post('/preview_action', {
|
|
156
|
+
entity: await this.entityName(String(input.ontologyId)),
|
|
157
|
+
action: input.action,
|
|
158
|
+
recordKey: input.recordKey,
|
|
159
|
+
values: input.values,
|
|
160
|
+
});
|
|
161
|
+
},
|
|
162
|
+
ExecuteOntologyAction: async (variables) => {
|
|
163
|
+
const input = variables.input ?? {};
|
|
164
|
+
return this.post('/action', {
|
|
165
|
+
entity: await this.entityName(String(input.ontologyId)),
|
|
166
|
+
action: input.action,
|
|
167
|
+
recordKey: input.recordKey,
|
|
168
|
+
values: input.values,
|
|
169
|
+
expectedVersion: input.expectedVersion,
|
|
170
|
+
idempotencyKey: input.idempotencyKey,
|
|
171
|
+
});
|
|
172
|
+
},
|
|
173
|
+
OntologyActionExecutions: async (variables) => this.post('/action_executions', {
|
|
174
|
+
entity: await this.entityName(String(variables.ontologyId)),
|
|
175
|
+
recordKey: variables.recordKey,
|
|
176
|
+
limit: variables.limit,
|
|
177
|
+
}),
|
|
134
178
|
OntologyAddRow: async (variables) => {
|
|
135
179
|
await this.post('/create', {
|
|
136
180
|
entity: await this.entityName(String(variables.entityId)),
|
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED