lemma-sdk 0.2.27 → 0.2.30
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 +113 -233
- package/bin/lemma-sdk.js +108 -0
- package/dist/browser/lemma-client.js +125 -4
- package/dist/client.d.ts +2 -0
- package/dist/client.js +3 -0
- package/dist/config.d.ts +2 -2
- package/dist/config.js +2 -2
- package/dist/datastore-query.d.ts +54 -0
- package/dist/datastore-query.js +157 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +3 -0
- package/dist/namespaces/datastore.d.ts +9 -0
- package/dist/namespaces/datastore.js +13 -0
- package/dist/namespaces/records.d.ts +1 -1
- package/dist/openapi_client/index.d.ts +4 -0
- package/dist/openapi_client/index.js +1 -0
- package/dist/openapi_client/models/ConvertedArtifactResponse.d.ts +6 -0
- package/dist/openapi_client/models/ConvertedArtifactResponse.js +1 -0
- package/dist/openapi_client/models/ConvertedFileResponse.d.ts +10 -0
- package/dist/openapi_client/models/ConvertedFileResponse.js +1 -0
- package/dist/openapi_client/models/CreateFolderRequest.d.ts +3 -1
- package/dist/openapi_client/models/FlowRunEntity.d.ts +1 -0
- package/dist/openapi_client/models/ScheduledFlowStart.d.ts +3 -6
- package/dist/openapi_client/models/ScheduledFlowStartType.d.ts +4 -0
- package/dist/openapi_client/models/ScheduledFlowStartType.js +9 -0
- package/dist/openapi_client/models/WorkflowInstallRequest.d.ts +5 -0
- package/dist/openapi_client/models/WorkflowTimeInstallConfig.d.ts +19 -0
- package/dist/openapi_client/models/WorkflowTimeInstallConfig.js +1 -0
- package/dist/openapi_client/services/FilesService.d.ts +27 -1
- package/dist/openapi_client/services/FilesService.js +69 -1
- package/dist/openapi_client/services/WorkflowsService.d.ts +1 -1
- package/dist/openapi_client/services/WorkflowsService.js +1 -1
- package/dist/react/assistant-output.d.ts +6 -0
- package/dist/react/assistant-output.js +90 -0
- package/dist/react/components/AssistantExperience.js +6 -4
- package/dist/react/index.d.ts +42 -8
- package/dist/react/index.js +21 -4
- package/dist/react/useAgentRun.d.ts +17 -0
- package/dist/react/useAgentRun.js +58 -0
- package/dist/react/useAssistantRun.d.ts +9 -0
- package/dist/react/useAssistantRun.js +19 -9
- package/dist/react/useAssistantSession.d.ts +5 -0
- package/dist/react/useAssistantSession.js +123 -70
- package/dist/react/useBulkRecords.d.ts +20 -0
- package/dist/react/useBulkRecords.js +72 -0
- package/dist/react/useConversation.d.ts +18 -0
- package/dist/react/useConversation.js +59 -0
- package/dist/react/useConversationMessages.d.ts +59 -0
- package/dist/react/useConversationMessages.js +167 -0
- package/dist/react/useConversations.d.ts +48 -0
- package/dist/react/useConversations.js +182 -0
- package/dist/react/useCreateRecord.d.ts +18 -0
- package/dist/react/useCreateRecord.js +58 -0
- package/dist/react/useDeleteRecord.d.ts +21 -0
- package/dist/react/useDeleteRecord.js +59 -0
- package/dist/react/useForeignKeyOptions.d.ts +31 -0
- package/dist/react/useForeignKeyOptions.js +150 -0
- package/dist/react/useJoinedRecords.d.ts +18 -0
- package/dist/react/useJoinedRecords.js +79 -0
- package/dist/react/useMembers.d.ts +22 -0
- package/dist/react/useMembers.js +59 -0
- package/dist/react/useRecord.d.ts +18 -0
- package/dist/react/useRecord.js +64 -0
- package/dist/react/useRecordForm.d.ts +42 -0
- package/dist/react/useRecordForm.js +238 -0
- package/dist/react/useRecordSchema.d.ts +20 -0
- package/dist/react/useRecordSchema.js +24 -0
- package/dist/react/useRecords.d.ts +18 -0
- package/dist/react/useRecords.js +106 -0
- package/dist/react/useRelatedRecords.d.ts +43 -0
- package/dist/react/useRelatedRecords.js +232 -0
- package/dist/react/useReverseRelatedRecords.d.ts +47 -0
- package/dist/react/useReverseRelatedRecords.js +226 -0
- package/dist/react/useSchemaForm.d.ts +24 -0
- package/dist/react/useSchemaForm.js +116 -0
- package/dist/react/useTable.d.ts +16 -0
- package/dist/react/useTable.js +59 -0
- package/dist/react/useTables.d.ts +22 -0
- package/dist/react/useTables.js +71 -0
- package/dist/react/useUpdateRecord.d.ts +21 -0
- package/dist/react/useUpdateRecord.js +62 -0
- package/dist/react/useWorkflowStart.d.ts +33 -0
- package/dist/react/useWorkflowStart.js +155 -0
- package/dist/record-form.d.ts +30 -0
- package/dist/record-form.js +199 -0
- package/dist/schema-form.d.ts +41 -0
- package/dist/schema-form.js +200 -0
- package/dist/types.d.ts +5 -1
- package/package.json +10 -5
- package/dist/react/styles.css +0 -2401
package/dist/client.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ import { TablesNamespace } from "./namespaces/tables.js";
|
|
|
18
18
|
import { TasksNamespace } from "./namespaces/tasks.js";
|
|
19
19
|
import { UsersNamespace } from "./namespaces/users.js";
|
|
20
20
|
import { WorkflowsNamespace } from "./namespaces/workflows.js";
|
|
21
|
+
import { DatastoreNamespace } from "./namespaces/datastore.js";
|
|
21
22
|
export type { LemmaConfig };
|
|
22
23
|
export { AuthManager };
|
|
23
24
|
export type { AuthState, AuthListener };
|
|
@@ -44,6 +45,7 @@ export declare class LemmaClient {
|
|
|
44
45
|
readonly desks: DesksNamespace;
|
|
45
46
|
readonly integrations: IntegrationsNamespace;
|
|
46
47
|
readonly resources: ResourcesNamespace;
|
|
48
|
+
readonly datastore: DatastoreNamespace;
|
|
47
49
|
readonly users: UsersNamespace;
|
|
48
50
|
readonly icons: IconsNamespace;
|
|
49
51
|
readonly pods: PodsNamespace;
|
package/dist/client.js
CHANGED
|
@@ -20,6 +20,7 @@ import { TablesNamespace } from "./namespaces/tables.js";
|
|
|
20
20
|
import { TasksNamespace } from "./namespaces/tasks.js";
|
|
21
21
|
import { UsersNamespace } from "./namespaces/users.js";
|
|
22
22
|
import { WorkflowsNamespace } from "./namespaces/workflows.js";
|
|
23
|
+
import { DatastoreNamespace } from "./namespaces/datastore.js";
|
|
23
24
|
export { AuthManager };
|
|
24
25
|
export class LemmaClient {
|
|
25
26
|
_config;
|
|
@@ -42,6 +43,7 @@ export class LemmaClient {
|
|
|
42
43
|
desks;
|
|
43
44
|
integrations;
|
|
44
45
|
resources;
|
|
46
|
+
datastore;
|
|
45
47
|
users;
|
|
46
48
|
icons;
|
|
47
49
|
pods;
|
|
@@ -74,6 +76,7 @@ export class LemmaClient {
|
|
|
74
76
|
this.desks = new DesksNamespace(this._generated, this._http, podIdFn);
|
|
75
77
|
this.integrations = new IntegrationsNamespace(this._generated);
|
|
76
78
|
this.resources = new ResourcesNamespace(this._http);
|
|
79
|
+
this.datastore = new DatastoreNamespace(this._generated, podIdFn);
|
|
77
80
|
this.users = new UsersNamespace(this._generated);
|
|
78
81
|
this.icons = new IconsNamespace(this._generated);
|
|
79
82
|
this.pods = new PodsNamespace(this._generated, this._http);
|
package/dist/config.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export interface LemmaConfig {
|
|
2
|
-
/** API base URL, e.g. https://api.
|
|
2
|
+
/** API base URL, e.g. https://api.asur.work */
|
|
3
3
|
apiUrl: string;
|
|
4
|
-
/** Auth service URL, e.g. https://auth.
|
|
4
|
+
/** Auth service URL, e.g. https://auth.asur.work */
|
|
5
5
|
authUrl: string;
|
|
6
6
|
/** Pod ID to scope all pod-level API calls */
|
|
7
7
|
podId?: string;
|
package/dist/config.js
CHANGED
|
@@ -37,11 +37,11 @@ export function resolveConfig(overrides = {}) {
|
|
|
37
37
|
const apiUrl = overrides.apiUrl ??
|
|
38
38
|
win.apiUrl ??
|
|
39
39
|
fromEnv("API_URL") ??
|
|
40
|
-
"
|
|
40
|
+
"https://api.asur.work";
|
|
41
41
|
const authUrl = overrides.authUrl ??
|
|
42
42
|
win.authUrl ??
|
|
43
43
|
fromEnv("AUTH_URL") ??
|
|
44
|
-
"
|
|
44
|
+
"https://auth.asur.work";
|
|
45
45
|
const podId = overrides.podId ??
|
|
46
46
|
win.podId ??
|
|
47
47
|
fromEnv("POD_ID");
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export interface ForeignKeyReference {
|
|
2
|
+
table: string;
|
|
3
|
+
column: string;
|
|
4
|
+
}
|
|
5
|
+
export interface JoinedRecordsSource {
|
|
6
|
+
table: string;
|
|
7
|
+
alias?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface JoinedRecordsColumnRef {
|
|
10
|
+
table?: string;
|
|
11
|
+
column: string;
|
|
12
|
+
}
|
|
13
|
+
export interface JoinedRecordsSelectField {
|
|
14
|
+
table?: string;
|
|
15
|
+
column?: string;
|
|
16
|
+
expression?: string;
|
|
17
|
+
as?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface JoinedRecordsJoinCondition {
|
|
20
|
+
left: string | JoinedRecordsColumnRef;
|
|
21
|
+
right: string | JoinedRecordsColumnRef;
|
|
22
|
+
operator?: "=" | "!=" | "<>" | ">" | ">=" | "<" | "<=";
|
|
23
|
+
}
|
|
24
|
+
export interface JoinedRecordsJoin {
|
|
25
|
+
type?: "inner" | "left" | "left outer" | "right" | "right outer" | "full" | "full outer";
|
|
26
|
+
table: string;
|
|
27
|
+
alias?: string;
|
|
28
|
+
on: string | JoinedRecordsJoinCondition;
|
|
29
|
+
}
|
|
30
|
+
export interface JoinedRecordsFilter {
|
|
31
|
+
field?: string | JoinedRecordsColumnRef;
|
|
32
|
+
expression?: string;
|
|
33
|
+
operator?: "=" | "!=" | "<>" | ">" | ">=" | "<" | "<=" | "LIKE" | "ILIKE" | "IN" | "NOT IN" | "IS" | "IS NOT";
|
|
34
|
+
value?: unknown;
|
|
35
|
+
values?: unknown[];
|
|
36
|
+
}
|
|
37
|
+
export interface JoinedRecordsOrderBy {
|
|
38
|
+
field?: string | JoinedRecordsColumnRef;
|
|
39
|
+
expression?: string;
|
|
40
|
+
direction?: "asc" | "desc";
|
|
41
|
+
nulls?: "first" | "last";
|
|
42
|
+
}
|
|
43
|
+
export interface JoinedRecordsQueryDefinition {
|
|
44
|
+
from: string | JoinedRecordsSource;
|
|
45
|
+
select?: Array<string | JoinedRecordsSelectField>;
|
|
46
|
+
joins?: JoinedRecordsJoin[];
|
|
47
|
+
filters?: JoinedRecordsFilter[];
|
|
48
|
+
orderBy?: Array<string | JoinedRecordsOrderBy>;
|
|
49
|
+
limit?: number;
|
|
50
|
+
offset?: number;
|
|
51
|
+
distinct?: boolean;
|
|
52
|
+
}
|
|
53
|
+
export declare function parseForeignKeyReference(references: string): ForeignKeyReference | null;
|
|
54
|
+
export declare function buildJoinedRecordsQuery(definition: JoinedRecordsQueryDefinition): string;
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
function quoteIdentifierPart(value) {
|
|
2
|
+
return `"${value.replace(/"/g, "\"\"")}"`;
|
|
3
|
+
}
|
|
4
|
+
function quoteIdentifierPath(value) {
|
|
5
|
+
return value
|
|
6
|
+
.split(".")
|
|
7
|
+
.map((part) => (part === "*" ? part : quoteIdentifierPart(part)))
|
|
8
|
+
.join(".");
|
|
9
|
+
}
|
|
10
|
+
function isSimpleIdentifierPath(value) {
|
|
11
|
+
return /^[A-Za-z_][A-Za-z0-9_$]*(\.(\*|[A-Za-z_][A-Za-z0-9_$]*))*$/.test(value);
|
|
12
|
+
}
|
|
13
|
+
function renderIdentifierOrExpression(value) {
|
|
14
|
+
return isSimpleIdentifierPath(value) ? quoteIdentifierPath(value) : value;
|
|
15
|
+
}
|
|
16
|
+
function renderColumnRef(value) {
|
|
17
|
+
if (typeof value === "string") {
|
|
18
|
+
return renderIdentifierOrExpression(value);
|
|
19
|
+
}
|
|
20
|
+
const tablePrefix = value.table ? `${quoteIdentifierPart(value.table)}.` : "";
|
|
21
|
+
if (value.column === "*") {
|
|
22
|
+
return `${tablePrefix}*`;
|
|
23
|
+
}
|
|
24
|
+
return `${tablePrefix}${quoteIdentifierPart(value.column)}`;
|
|
25
|
+
}
|
|
26
|
+
function renderSource(source) {
|
|
27
|
+
if (typeof source === "string") {
|
|
28
|
+
return renderIdentifierOrExpression(source);
|
|
29
|
+
}
|
|
30
|
+
const renderedTable = quoteIdentifierPart(source.table);
|
|
31
|
+
if (!source.alias)
|
|
32
|
+
return renderedTable;
|
|
33
|
+
return `${renderedTable} AS ${quoteIdentifierPart(source.alias)}`;
|
|
34
|
+
}
|
|
35
|
+
function escapeSqlString(value) {
|
|
36
|
+
return value.replace(/'/g, "''");
|
|
37
|
+
}
|
|
38
|
+
function encodeSqlValue(value) {
|
|
39
|
+
if (value === null || typeof value === "undefined")
|
|
40
|
+
return "NULL";
|
|
41
|
+
if (typeof value === "boolean")
|
|
42
|
+
return value ? "TRUE" : "FALSE";
|
|
43
|
+
if (typeof value === "number") {
|
|
44
|
+
if (!Number.isFinite(value)) {
|
|
45
|
+
throw new Error("Joined record query values must be finite numbers.");
|
|
46
|
+
}
|
|
47
|
+
return String(value);
|
|
48
|
+
}
|
|
49
|
+
if (typeof value === "bigint")
|
|
50
|
+
return String(value);
|
|
51
|
+
if (value instanceof Date)
|
|
52
|
+
return `'${escapeSqlString(value.toISOString())}'`;
|
|
53
|
+
if (Array.isArray(value)) {
|
|
54
|
+
return `(${value.map((entry) => encodeSqlValue(entry)).join(", ")})`;
|
|
55
|
+
}
|
|
56
|
+
if (typeof value === "object") {
|
|
57
|
+
return `'${escapeSqlString(JSON.stringify(value))}'`;
|
|
58
|
+
}
|
|
59
|
+
return `'${escapeSqlString(String(value))}'`;
|
|
60
|
+
}
|
|
61
|
+
function renderSelectField(field) {
|
|
62
|
+
if (typeof field === "string") {
|
|
63
|
+
return renderIdentifierOrExpression(field);
|
|
64
|
+
}
|
|
65
|
+
const base = field.expression
|
|
66
|
+
? field.expression
|
|
67
|
+
: renderColumnRef({
|
|
68
|
+
table: field.table,
|
|
69
|
+
column: field.column || "*",
|
|
70
|
+
});
|
|
71
|
+
if (!field.as)
|
|
72
|
+
return base;
|
|
73
|
+
return `${base} AS ${quoteIdentifierPart(field.as)}`;
|
|
74
|
+
}
|
|
75
|
+
function renderJoinCondition(condition) {
|
|
76
|
+
if (typeof condition === "string") {
|
|
77
|
+
return condition;
|
|
78
|
+
}
|
|
79
|
+
return `${renderColumnRef(condition.left)} ${condition.operator ?? "="} ${renderColumnRef(condition.right)}`;
|
|
80
|
+
}
|
|
81
|
+
function renderJoin(join) {
|
|
82
|
+
const joinType = (join.type ?? "left").toUpperCase();
|
|
83
|
+
const source = renderSource({ table: join.table, alias: join.alias });
|
|
84
|
+
return `${joinType} JOIN ${source} ON ${renderJoinCondition(join.on)}`;
|
|
85
|
+
}
|
|
86
|
+
function renderFilter(filter) {
|
|
87
|
+
const lhs = filter.expression
|
|
88
|
+
? filter.expression
|
|
89
|
+
: filter.field
|
|
90
|
+
? renderColumnRef(filter.field)
|
|
91
|
+
: null;
|
|
92
|
+
if (!lhs) {
|
|
93
|
+
throw new Error("Joined record filters require either `expression` or `field`.");
|
|
94
|
+
}
|
|
95
|
+
const operator = (filter.operator ?? "=").toUpperCase();
|
|
96
|
+
const values = Array.isArray(filter.values) ? filter.values : undefined;
|
|
97
|
+
const rhs = values ? encodeSqlValue(values) : encodeSqlValue(filter.value);
|
|
98
|
+
if ((operator === "IN" || operator === "NOT IN") && !values) {
|
|
99
|
+
return `${lhs} ${operator} (${rhs})`;
|
|
100
|
+
}
|
|
101
|
+
return `${lhs} ${operator} ${rhs}`;
|
|
102
|
+
}
|
|
103
|
+
function renderOrderBy(orderBy) {
|
|
104
|
+
if (typeof orderBy === "string") {
|
|
105
|
+
return renderIdentifierOrExpression(orderBy);
|
|
106
|
+
}
|
|
107
|
+
const base = orderBy.expression
|
|
108
|
+
? orderBy.expression
|
|
109
|
+
: orderBy.field
|
|
110
|
+
? renderColumnRef(orderBy.field)
|
|
111
|
+
: null;
|
|
112
|
+
if (!base) {
|
|
113
|
+
throw new Error("Joined record sort entries require either `expression` or `field`.");
|
|
114
|
+
}
|
|
115
|
+
const direction = (orderBy.direction ?? "asc").toUpperCase();
|
|
116
|
+
const nulls = orderBy.nulls ? ` NULLS ${orderBy.nulls.toUpperCase()}` : "";
|
|
117
|
+
return `${base} ${direction}${nulls}`;
|
|
118
|
+
}
|
|
119
|
+
function normalizePositiveInteger(value, field) {
|
|
120
|
+
if (typeof value === "undefined" || value === null)
|
|
121
|
+
return undefined;
|
|
122
|
+
const parsed = Number(value);
|
|
123
|
+
if (!Number.isFinite(parsed) || parsed < 0) {
|
|
124
|
+
throw new Error(`${field} must be a non-negative number.`);
|
|
125
|
+
}
|
|
126
|
+
return Math.floor(parsed);
|
|
127
|
+
}
|
|
128
|
+
export function parseForeignKeyReference(references) {
|
|
129
|
+
const value = references.trim();
|
|
130
|
+
const separator = value.indexOf(".");
|
|
131
|
+
if (separator <= 0 || separator === value.length - 1) {
|
|
132
|
+
return null;
|
|
133
|
+
}
|
|
134
|
+
return {
|
|
135
|
+
table: value.slice(0, separator),
|
|
136
|
+
column: value.slice(separator + 1),
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
export function buildJoinedRecordsQuery(definition) {
|
|
140
|
+
const select = definition.select?.length
|
|
141
|
+
? definition.select.map((field) => renderSelectField(field)).join(", ")
|
|
142
|
+
: "*";
|
|
143
|
+
const distinct = definition.distinct ? "DISTINCT " : "";
|
|
144
|
+
const from = renderSource(definition.from);
|
|
145
|
+
const joins = definition.joins?.length ? ` ${definition.joins.map((join) => renderJoin(join)).join(" ")}` : "";
|
|
146
|
+
const where = definition.filters?.length
|
|
147
|
+
? ` WHERE ${definition.filters.map((filter) => renderFilter(filter)).join(" AND ")}`
|
|
148
|
+
: "";
|
|
149
|
+
const orderBy = definition.orderBy?.length
|
|
150
|
+
? ` ORDER BY ${definition.orderBy.map((entry) => renderOrderBy(entry)).join(", ")}`
|
|
151
|
+
: "";
|
|
152
|
+
const limit = normalizePositiveInteger(definition.limit, "limit");
|
|
153
|
+
const offset = normalizePositiveInteger(definition.offset, "offset");
|
|
154
|
+
const limitClause = typeof limit === "number" ? ` LIMIT ${limit}` : "";
|
|
155
|
+
const offsetClause = typeof offset === "number" ? ` OFFSET ${offset}` : "";
|
|
156
|
+
return `SELECT ${distinct}${select} FROM ${from}${joins}${where}${orderBy}${limitClause}${offsetClause}`.trim();
|
|
157
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -12,7 +12,14 @@ export { parseTaskStreamEvent, upsertTaskMessage } from "./task-events.js";
|
|
|
12
12
|
export type { ParsedTaskStreamEvent } from "./task-events.js";
|
|
13
13
|
export { parseAssistantStreamEvent, upsertConversationMessage } from "./assistant-events.js";
|
|
14
14
|
export type { ParsedAssistantStreamEvent } from "./assistant-events.js";
|
|
15
|
+
export { buildRecordFormValues, buildRecordPayload, buildRecordSchemaFields, formatRecordValueForForm, getEditableRecordFields, getRecordFieldKind, } from "./record-form.js";
|
|
16
|
+
export type { BuildRecordPayloadOptions, BuildRecordPayloadResult, RecordSchemaField, RecordSchemaFieldKind, } from "./record-form.js";
|
|
17
|
+
export { buildSchemaFormFields, buildSchemaFormPayload, buildSchemaFormValues, formatSchemaFieldValueForForm, } from "./schema-form.js";
|
|
18
|
+
export type { BuildSchemaFormPayloadResult, JsonSchemaLike, JsonSchemaPrimitiveType, SchemaFormField, SchemaFormFieldKind, } from "./schema-form.js";
|
|
19
|
+
export { buildJoinedRecordsQuery, parseForeignKeyReference, } from "./datastore-query.js";
|
|
20
|
+
export type { ForeignKeyReference, JoinedRecordsColumnRef, JoinedRecordsFilter, JoinedRecordsJoin, JoinedRecordsJoinCondition, JoinedRecordsOrderBy, JoinedRecordsQueryDefinition, JoinedRecordsSelectField, JoinedRecordsSource, } from "./datastore-query.js";
|
|
15
21
|
export type { AgentsNamespace } from "./namespaces/agents.js";
|
|
22
|
+
export type { DatastoreNamespace } from "./namespaces/datastore.js";
|
|
16
23
|
export type { AssistantsNamespace, ConversationsNamespace } from "./namespaces/assistants.js";
|
|
17
24
|
export type { DesksNamespace } from "./namespaces/desks.js";
|
|
18
25
|
export type { FilesNamespace } from "./namespaces/files.js";
|
package/dist/index.js
CHANGED
|
@@ -6,3 +6,6 @@ export { readSSE, parseSSEJson } from "./streams.js";
|
|
|
6
6
|
export { normalizeRunStatus, isTerminalTaskStatus, isTerminalFunctionStatus, isTerminalFlowStatus, sleep, nextBackoffDelay, } from "./run-utils.js";
|
|
7
7
|
export { parseTaskStreamEvent, upsertTaskMessage } from "./task-events.js";
|
|
8
8
|
export { parseAssistantStreamEvent, upsertConversationMessage } from "./assistant-events.js";
|
|
9
|
+
export { buildRecordFormValues, buildRecordPayload, buildRecordSchemaFields, formatRecordValueForForm, getEditableRecordFields, getRecordFieldKind, } from "./record-form.js";
|
|
10
|
+
export { buildSchemaFormFields, buildSchemaFormPayload, buildSchemaFormValues, formatSchemaFieldValueForForm, } from "./schema-form.js";
|
|
11
|
+
export { buildJoinedRecordsQuery, parseForeignKeyReference, } from "./datastore-query.js";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { GeneratedClientAdapter } from "../generated.js";
|
|
2
|
+
import type { DatastoreQueryRequest } from "../openapi_client/models/DatastoreQueryRequest.js";
|
|
3
|
+
import type { DatastoreQueryResponse } from "../openapi_client/models/DatastoreQueryResponse.js";
|
|
4
|
+
export declare class DatastoreNamespace {
|
|
5
|
+
private readonly client;
|
|
6
|
+
private readonly podId;
|
|
7
|
+
constructor(client: GeneratedClientAdapter, podId: () => string);
|
|
8
|
+
query(request: string | DatastoreQueryRequest): Promise<DatastoreQueryResponse>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { QueryService } from "../openapi_client/services/QueryService.js";
|
|
2
|
+
export class DatastoreNamespace {
|
|
3
|
+
client;
|
|
4
|
+
podId;
|
|
5
|
+
constructor(client, podId) {
|
|
6
|
+
this.client = client;
|
|
7
|
+
this.podId = podId;
|
|
8
|
+
}
|
|
9
|
+
query(request) {
|
|
10
|
+
const payload = typeof request === "string" ? { query: request } : request;
|
|
11
|
+
return this.client.request(() => QueryService.queryExecute(this.podId(), payload));
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -26,6 +26,6 @@ export declare class RecordsNamespace {
|
|
|
26
26
|
readonly bulk: {
|
|
27
27
|
create: (table: string, records: Record<string, unknown>[]) => Promise<import("../types.js").DatastoreMessageResponse>;
|
|
28
28
|
update: (table: string, records: Record<string, unknown>[]) => Promise<import("../types.js").DatastoreMessageResponse>;
|
|
29
|
-
delete: (table: string, recordIds: string
|
|
29
|
+
delete: (table: string, recordIds: Array<string | number>) => Promise<import("../types.js").DatastoreMessageResponse>;
|
|
30
30
|
};
|
|
31
31
|
}
|
|
@@ -43,6 +43,8 @@ export type { ConversationMessageListResponse } from './models/ConversationMessa
|
|
|
43
43
|
export type { ConversationMessageResponse } from './models/ConversationMessageResponse.js';
|
|
44
44
|
export type { ConversationResponse } from './models/ConversationResponse.js';
|
|
45
45
|
export { ConversationStatus } from './models/ConversationStatus.js';
|
|
46
|
+
export type { ConvertedArtifactResponse } from './models/ConvertedArtifactResponse.js';
|
|
47
|
+
export type { ConvertedFileResponse } from './models/ConvertedFileResponse.js';
|
|
46
48
|
export type { CreateAgentRequest } from './models/CreateAgentRequest.js';
|
|
47
49
|
export type { CreateAssistantRequest } from './models/CreateAssistantRequest.js';
|
|
48
50
|
export type { CreateConversationRequest } from './models/CreateConversationRequest.js';
|
|
@@ -166,6 +168,7 @@ export type { RecordResponse } from './models/RecordResponse.js';
|
|
|
166
168
|
export type { ResourceFileListResponse } from './models/ResourceFileListResponse.js';
|
|
167
169
|
export { ResourceType } from './models/ResourceType.js';
|
|
168
170
|
export type { ScheduledFlowStart } from './models/ScheduledFlowStart.js';
|
|
171
|
+
export { ScheduledFlowStartType } from './models/ScheduledFlowStartType.js';
|
|
169
172
|
export { SearchMethod } from './models/SearchMethod.js';
|
|
170
173
|
export type { SearchResult } from './models/SearchResult.js';
|
|
171
174
|
export type { SeatInfoResponse } from './models/SeatInfoResponse.js';
|
|
@@ -228,6 +231,7 @@ export { WorkflowInstallMode } from './models/WorkflowInstallMode.js';
|
|
|
228
231
|
export type { WorkflowInstallRequest } from './models/WorkflowInstallRequest.js';
|
|
229
232
|
export type { WorkflowListResponse } from './models/WorkflowListResponse.js';
|
|
230
233
|
export type { WorkflowRunListResponse } from './models/WorkflowRunListResponse.js';
|
|
234
|
+
export type { WorkflowTimeInstallConfig } from './models/WorkflowTimeInstallConfig.js';
|
|
231
235
|
export type { WorkflowUpdateRequest } from './models/WorkflowUpdateRequest.js';
|
|
232
236
|
export { AgentFilesService } from './services/AgentFilesService.js';
|
|
233
237
|
export { AgentsService } from './services/AgentsService.js';
|
|
@@ -27,6 +27,7 @@ export { PodAppMode } from './models/PodAppMode.js';
|
|
|
27
27
|
export { PodJoinRequestStatus } from './models/PodJoinRequestStatus.js';
|
|
28
28
|
export { PodRole } from './models/PodRole.js';
|
|
29
29
|
export { ResourceType } from './models/ResourceType.js';
|
|
30
|
+
export { ScheduledFlowStartType } from './models/ScheduledFlowStartType.js';
|
|
30
31
|
export { SearchMethod } from './models/SearchMethod.js';
|
|
31
32
|
export { SubscriptionStatus } from './models/SubscriptionStatus.js';
|
|
32
33
|
export { TableAccessMode } from './models/TableAccessMode.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ConvertedArtifactResponse } from './ConvertedArtifactResponse.js';
|
|
2
|
+
export type ConvertedFileResponse = {
|
|
3
|
+
artifacts?: Array<ConvertedArtifactResponse>;
|
|
4
|
+
detected_languages?: Array<string>;
|
|
5
|
+
extraction_mode: string;
|
|
6
|
+
generated_at: string;
|
|
7
|
+
source_mime_type?: (string | null);
|
|
8
|
+
source_name: string;
|
|
9
|
+
source_path: string;
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { FileVisibility } from './FileVisibility.js';
|
|
2
2
|
export type CreateFolderRequest = {
|
|
3
3
|
description?: (string | null);
|
|
4
|
-
|
|
4
|
+
name?: (string | null);
|
|
5
|
+
parent_id?: (string | null);
|
|
6
|
+
path?: (string | null);
|
|
5
7
|
/**
|
|
6
8
|
* Optional visibility override for the new folder.
|
|
7
9
|
*/
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
+
import type { ScheduledFlowStartType } from './ScheduledFlowStartType.js';
|
|
1
2
|
export type ScheduledFlowStart = {
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
+
* Time trigger mode for this workflow definition. Concrete schedule values are provided during installation.
|
|
4
5
|
*/
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* IANA timezone used when evaluating `cron_expression`.
|
|
8
|
-
*/
|
|
9
|
-
timezone?: string;
|
|
6
|
+
schedule_type: ScheduledFlowStartType;
|
|
10
7
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/* generated using openapi-typescript-codegen -- do not edit */
|
|
2
|
+
/* istanbul ignore file */
|
|
3
|
+
/* tslint:disable */
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
export var ScheduledFlowStartType;
|
|
6
|
+
(function (ScheduledFlowStartType) {
|
|
7
|
+
ScheduledFlowStartType["ONCE"] = "ONCE";
|
|
8
|
+
ScheduledFlowStartType["CRON"] = "CRON";
|
|
9
|
+
})(ScheduledFlowStartType || (ScheduledFlowStartType = {}));
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
+
import type { WorkflowTimeInstallConfig } from './WorkflowTimeInstallConfig.js';
|
|
1
2
|
export type WorkflowInstallRequest = {
|
|
2
3
|
/**
|
|
3
4
|
* Optional integration account to bind when installing an event-driven workflow. Scheduled and datastore-event workflows usually do not need this.
|
|
4
5
|
*/
|
|
5
6
|
account_id?: (string | null);
|
|
7
|
+
/**
|
|
8
|
+
* Concrete time trigger settings for scheduled workflows. Provide either a one-time `time` or a recurring `cron_expression`.
|
|
9
|
+
*/
|
|
10
|
+
schedule?: (WorkflowTimeInstallConfig | null);
|
|
6
11
|
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ScheduledFlowStartType } from './ScheduledFlowStartType.js';
|
|
2
|
+
export type WorkflowTimeInstallConfig = {
|
|
3
|
+
/**
|
|
4
|
+
* Cron expression for `CRON` schedules.
|
|
5
|
+
*/
|
|
6
|
+
cron_expression?: (string | null);
|
|
7
|
+
/**
|
|
8
|
+
* Concrete time trigger mode to install: `ONCE` or `CRON`.
|
|
9
|
+
*/
|
|
10
|
+
schedule_type: ScheduledFlowStartType;
|
|
11
|
+
/**
|
|
12
|
+
* One-time execution timestamp for `ONCE` schedules.
|
|
13
|
+
*/
|
|
14
|
+
time?: (string | null);
|
|
15
|
+
/**
|
|
16
|
+
* IANA timezone used for cron evaluation or naive one-time values.
|
|
17
|
+
*/
|
|
18
|
+
timezone?: (string | null);
|
|
19
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ConvertedFileResponse } from '../models/ConvertedFileResponse.js';
|
|
1
2
|
import type { CreateFolderRequest } from '../models/CreateFolderRequest.js';
|
|
2
3
|
import type { DatastoreFileUploadRequest } from '../models/DatastoreFileUploadRequest.js';
|
|
3
4
|
import type { DatastoreMessageResponse } from '../models/DatastoreMessageResponse.js';
|
|
@@ -28,7 +29,7 @@ export declare class FilesService {
|
|
|
28
29
|
*/
|
|
29
30
|
static fileUpload(podId: string, formData: DatastoreFileUploadRequest): CancelablePromise<FileResponse>;
|
|
30
31
|
/**
|
|
31
|
-
* Delete File Or Folder
|
|
32
|
+
* Delete File Or Folder
|
|
32
33
|
* @param podId
|
|
33
34
|
* @param path
|
|
34
35
|
* @returns DatastoreMessageResponse Successful Response
|
|
@@ -51,6 +52,31 @@ export declare class FilesService {
|
|
|
51
52
|
* @throws ApiError
|
|
52
53
|
*/
|
|
53
54
|
static fileUpdate(podId: string, formData: update): CancelablePromise<FileResponse>;
|
|
55
|
+
/**
|
|
56
|
+
* Get Converted File Metadata
|
|
57
|
+
* @param podId
|
|
58
|
+
* @param path
|
|
59
|
+
* @returns ConvertedFileResponse Successful Response
|
|
60
|
+
* @throws ApiError
|
|
61
|
+
*/
|
|
62
|
+
static fileConvertedGet(podId: string, path: string): CancelablePromise<ConvertedFileResponse>;
|
|
63
|
+
/**
|
|
64
|
+
* Download Converted File Artifact
|
|
65
|
+
* @param podId
|
|
66
|
+
* @param path
|
|
67
|
+
* @param artifact
|
|
68
|
+
* @returns any Successful Response
|
|
69
|
+
* @throws ApiError
|
|
70
|
+
*/
|
|
71
|
+
static fileConvertedDownload(podId: string, path: string, artifact?: string): CancelablePromise<any>;
|
|
72
|
+
/**
|
|
73
|
+
* Render Converted File As HTML
|
|
74
|
+
* @param podId
|
|
75
|
+
* @param path
|
|
76
|
+
* @returns any Successful Response
|
|
77
|
+
* @throws ApiError
|
|
78
|
+
*/
|
|
79
|
+
static fileConvertedRender(podId: string, path: string): CancelablePromise<any>;
|
|
54
80
|
/**
|
|
55
81
|
* Download File
|
|
56
82
|
* @param podId
|
|
@@ -49,7 +49,7 @@ export class FilesService {
|
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
52
|
-
* Delete File Or Folder
|
|
52
|
+
* Delete File Or Folder
|
|
53
53
|
* @param podId
|
|
54
54
|
* @param path
|
|
55
55
|
* @returns DatastoreMessageResponse Successful Response
|
|
@@ -113,6 +113,74 @@ export class FilesService {
|
|
|
113
113
|
},
|
|
114
114
|
});
|
|
115
115
|
}
|
|
116
|
+
/**
|
|
117
|
+
* Get Converted File Metadata
|
|
118
|
+
* @param podId
|
|
119
|
+
* @param path
|
|
120
|
+
* @returns ConvertedFileResponse Successful Response
|
|
121
|
+
* @throws ApiError
|
|
122
|
+
*/
|
|
123
|
+
static fileConvertedGet(podId, path) {
|
|
124
|
+
return __request(OpenAPI, {
|
|
125
|
+
method: 'GET',
|
|
126
|
+
url: '/pods/{pod_id}/datastore/files/converted/by-path',
|
|
127
|
+
path: {
|
|
128
|
+
'pod_id': podId,
|
|
129
|
+
},
|
|
130
|
+
query: {
|
|
131
|
+
'path': path,
|
|
132
|
+
},
|
|
133
|
+
errors: {
|
|
134
|
+
422: `Validation Error`,
|
|
135
|
+
},
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Download Converted File Artifact
|
|
140
|
+
* @param podId
|
|
141
|
+
* @param path
|
|
142
|
+
* @param artifact
|
|
143
|
+
* @returns any Successful Response
|
|
144
|
+
* @throws ApiError
|
|
145
|
+
*/
|
|
146
|
+
static fileConvertedDownload(podId, path, artifact = 'document.md') {
|
|
147
|
+
return __request(OpenAPI, {
|
|
148
|
+
method: 'GET',
|
|
149
|
+
url: '/pods/{pod_id}/datastore/files/converted/download',
|
|
150
|
+
path: {
|
|
151
|
+
'pod_id': podId,
|
|
152
|
+
},
|
|
153
|
+
query: {
|
|
154
|
+
'path': path,
|
|
155
|
+
'artifact': artifact,
|
|
156
|
+
},
|
|
157
|
+
errors: {
|
|
158
|
+
422: `Validation Error`,
|
|
159
|
+
},
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Render Converted File As HTML
|
|
164
|
+
* @param podId
|
|
165
|
+
* @param path
|
|
166
|
+
* @returns any Successful Response
|
|
167
|
+
* @throws ApiError
|
|
168
|
+
*/
|
|
169
|
+
static fileConvertedRender(podId, path) {
|
|
170
|
+
return __request(OpenAPI, {
|
|
171
|
+
method: 'GET',
|
|
172
|
+
url: '/pods/{pod_id}/datastore/files/converted/render',
|
|
173
|
+
path: {
|
|
174
|
+
'pod_id': podId,
|
|
175
|
+
},
|
|
176
|
+
query: {
|
|
177
|
+
'path': path,
|
|
178
|
+
},
|
|
179
|
+
errors: {
|
|
180
|
+
422: `Validation Error`,
|
|
181
|
+
},
|
|
182
|
+
});
|
|
183
|
+
}
|
|
116
184
|
/**
|
|
117
185
|
* Download File
|
|
118
186
|
* @param podId
|
|
@@ -107,7 +107,7 @@ export declare class WorkflowsService {
|
|
|
107
107
|
static workflowGraphUpdate(podId: string, workflowName: string, requestBody: WorkflowGraphUpdateRequest): CancelablePromise<FlowResponse>;
|
|
108
108
|
/**
|
|
109
109
|
* Install Workflow
|
|
110
|
-
* Install a workflow for runtime execution. Provide `account_id` when the workflow needs an integration account binding.
|
|
110
|
+
* Install a workflow for runtime execution. Provide `account_id` when the workflow needs an integration account binding, and provide `schedule` when installing a scheduled workflow.
|
|
111
111
|
* @param podId
|
|
112
112
|
* @param workflowName
|
|
113
113
|
* @param requestBody
|
|
@@ -233,7 +233,7 @@ export class WorkflowsService {
|
|
|
233
233
|
}
|
|
234
234
|
/**
|
|
235
235
|
* Install Workflow
|
|
236
|
-
* Install a workflow for runtime execution. Provide `account_id` when the workflow needs an integration account binding.
|
|
236
|
+
* Install a workflow for runtime execution. Provide `account_id` when the workflow needs an integration account binding, and provide `schedule` when installing a scheduled workflow.
|
|
237
237
|
* @param podId
|
|
238
238
|
* @param workflowName
|
|
239
239
|
* @param requestBody
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ConversationMessage } from "../types.js";
|
|
2
|
+
export declare function normalizeConversationStatus(status: unknown): string | undefined;
|
|
3
|
+
export declare function isConversationRunningStatus(status: unknown): boolean;
|
|
4
|
+
export declare function extractConversationMessageText(content: unknown): string;
|
|
5
|
+
export declare function sortConversationMessagesByCreatedAt(messages: ConversationMessage[]): ConversationMessage[];
|
|
6
|
+
export declare function getLatestAssistantMessage(messages: ConversationMessage[]): ConversationMessage | null;
|