@permute/sdk 0.6.0 → 0.8.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/README.md +358 -22
- package/dist/app.d.ts +24 -2
- package/dist/app.js +31 -5
- package/dist/auth/oauth.d.ts +64 -0
- package/dist/auth/oauth.js +221 -0
- package/dist/auth/store.d.ts +39 -0
- package/dist/auth/store.js +70 -0
- package/dist/auth.d.ts +1 -0
- package/dist/auth.js +1 -0
- package/dist/bridge.d.ts +10 -0
- package/dist/bridge.js +62 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +127 -0
- package/dist/client.d.ts +152 -10
- package/dist/client.js +142 -105
- package/dist/deploy.d.ts +77 -3
- package/dist/deploy.js +136 -58
- package/dist/generated/openapi.d.ts +726 -16
- package/dist/generated/runtime-contract.d.ts +34 -27
- package/dist/generated/runtime-contract.js +123 -8680
- package/dist/index.d.ts +16 -15
- package/dist/index.js +1 -0
- package/dist/method.d.ts +10 -0
- package/dist/method.js +21 -0
- package/dist/sourceFiles.d.ts +16 -0
- package/dist/sourceFiles.js +114 -0
- package/dist/types.d.ts +45 -1
- package/package.json +15 -3
package/dist/client.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import type { EmailSender, EmailSendRequest, EmailReceipt, PermissionGrant, PermissionGrantInput, PermissionGrantUpdate, PermissionGrantQuery, PermissionGrantList, PermissionGrantRevoked, PermissionInspectionInput, PermissionInspection, AccessRequest, AccessRequestInput, AccessRequestQuery, AccessRequestList, AccessRequestDecision } from './types.js';
|
|
1
2
|
export { PermuteApiError } from './errors.js';
|
|
2
|
-
import type { BusinessAction, BusinessActionList, ActionCreateRequest, ActionDefinition, ActionDefinitionSaveRequest, ActionDefinitionSaved, ActionRequest, ActionReceipt } from './types.js';
|
|
3
|
-
import type { ConnectorSession, ConnectorSessionCreated, ConnectorSessionCreateRequest, Database, AppDraft, AppDraftList, AppCreateRequest, AppUpdateRequest, AppDeleted, AppUploadsRequest, AppUploads, AppSiteSaveRequest, AppGrants, AppGrantSetRequest, AppUploadFile, DatabaseList, DatabaseCreateRequest, DatabaseDefinition, DatabaseDefinitionSaveRequest, DatabaseDefinitionSaved, DatabaseTables, DatabaseTableCreateRequest, DatabaseTableCreated, DatabaseRecords, DatabaseRecordsQuery, DatabaseTransactionRequest, DatabaseTransactionReceipt, WriteSync, WriteSyncCreateRequest, WriteSyncUpdateRequest, WriteSyncDetail, WriteSyncList, WriteSyncDeleted, WriteSyncDestinations, WriteSyncRun, WriteSyncRunList, WriteSyncRunQuery, WriteSyncExecution, ResourceVersionState, ResourceRevisionList, ResourceRevision, ResourceVersionRequest, ResourcePublishRequest, Fact, FactList, FactWriteRequest, SkillList, SkillContent, SkillWriteRequest, KnowledgeWriteResponse, OperationRunGroup, OperationRunQuery, Operation, OperationList, OperationListQuery, OperationSource, OperationSourceUpdateRequest, OperationUpdateRequest, OperationRunRequest, OperationRunStarted, OperationRunList, OperationRunOutput, DataFlow, DataFlowCreateRequest, DataFlowCommandRequest, DataFlowCommandResponse, Workspace, WorkspaceCreateRequest, WorkspaceDeleteResponse, WorkspaceList, WorkspaceUpdateRequest, AnswerRequest,
|
|
3
|
+
import type { BusinessAction, BusinessActionDetail, BusinessActionList, ActionCreateRequest, ActionDefinition, ActionDefinitionSaveRequest, ActionDefinitionSaved, ActionRequest, ActionReceipt, ActionPublicationRequest, ActionPublicationRequestInput, ActionPublicationRequestList, ActionPublicationDecision } from './types.js';
|
|
4
|
+
import type { ConnectorSession, ConnectorSessionCreated, ConnectorSessionCreateRequest, Database, AppPublicationRequest, AppPublicationRequestInput, AppPublicationRequestList, AppPublicationDecision, AppDraft, AppAccess, AppAddressSettings, AppAddressSetRequest, AppAccessSetRequest, AppDraftList, AppCreateRequest, AppUpdateRequest, AppDeleted, AppUploadsRequest, AppUploads, AppSiteSaveRequest, AppSourceFileQuery, AppSourceFileContent, AppGrants, AppGrantSetRequest, AppUploadFile, DatabaseList, DatabaseCreateRequest, DatabaseDefinition, DatabaseDefinitionSaveRequest, DatabaseDefinitionSaved, DatabaseTables, DatabaseTableCreateRequest, DatabaseTableCreated, DatabaseRecords, DatabaseRecordsQuery, DatabaseTransactionRequest, DatabaseTransactionReceipt, WriteSync, WriteSyncCreateRequest, WriteSyncUpdateRequest, WriteSyncDetail, WriteSyncList, WriteSyncDeleted, WriteSyncDestinations, WriteSyncRun, WriteSyncRunList, WriteSyncRunQuery, WriteSyncExecution, ResourceVersionState, ResourceRevisionList, ResourceRevision, ResourceVersionRequest, ResourcePublishRequest, Fact, FactList, FactWriteRequest, SkillList, SkillContent, SkillWriteRequest, KnowledgeWriteResponse, OperationRunGroup, OperationRunQuery, Operation, OperationList, OperationListQuery, OperationSource, OperationSourceUpdateRequest, OperationUpdateRequest, OperationRunRequest, OperationRunStarted, OperationRunList, OperationRunOutput, DataFlow, DataFlowCreateRequest, DataFlowCommandRequest, DataFlowCommandResponse, Workspace, WorkspaceCreateRequest, WorkspaceDeleteResponse, WorkspaceList, WorkspaceUpdateRequest, AnswerRequest, AnswerResponse, PermuteClientOptions, PermuteRequestOptions, QueryRequest, SearchRequest, SourceDetail, CatalogTable, SourceList, CustomDatasetCreateRequest, DatasetDeleteResponse, DatasetResponse, FileDatasetCreateRequest, FileDatasetMetadataCreateRequest, FileDatasetResponse, DatasetRows, CustomDatasetResponse, DashboardSource, DashboardSourceUpdateRequest } from './types.js';
|
|
4
5
|
type DatasetWriteInput = {
|
|
5
6
|
tables: Record<string, DatasetRows>;
|
|
6
7
|
mode: 'replace';
|
|
@@ -19,7 +20,7 @@ type DatasetReader = (id: string, options?: PermuteRequestOptions) => Promise<Da
|
|
|
19
20
|
export declare class PermuteDataset {
|
|
20
21
|
private readonly writeTables;
|
|
21
22
|
private readonly readDataset;
|
|
22
|
-
readonly type:
|
|
23
|
+
readonly type: 'custom';
|
|
23
24
|
private snapshot;
|
|
24
25
|
constructor(snapshot: CustomDatasetResponse, writeTables: DatasetWriter, readDataset: DatasetReader);
|
|
25
26
|
get data(): CustomDatasetResponse;
|
|
@@ -39,7 +40,7 @@ export declare class PermuteDataset {
|
|
|
39
40
|
}
|
|
40
41
|
export declare class PermuteFileDataset {
|
|
41
42
|
private readonly readDataset;
|
|
42
|
-
readonly type:
|
|
43
|
+
readonly type: 'file';
|
|
43
44
|
private snapshot;
|
|
44
45
|
constructor(snapshot: FileDatasetResponse, readDataset: DatasetReader);
|
|
45
46
|
get data(): FileDatasetResponse;
|
|
@@ -56,6 +57,19 @@ export interface SkillsClient {
|
|
|
56
57
|
delete(path: string, options?: PermuteRequestOptions): Promise<KnowledgeWriteResponse>;
|
|
57
58
|
}
|
|
58
59
|
export declare class PermuteClient {
|
|
60
|
+
readonly permissions: {
|
|
61
|
+
update(permissionId: string, body: PermissionGrantUpdate, options?: PermuteRequestOptions): Promise<PermissionGrant>;
|
|
62
|
+
list(query?: PermissionGrantQuery, options?: PermuteRequestOptions): Promise<PermissionGrantList>;
|
|
63
|
+
create(body: PermissionGrantInput, options?: PermuteRequestOptions): Promise<PermissionGrant>;
|
|
64
|
+
delete(permissionId: string, options?: PermuteRequestOptions): Promise<PermissionGrantRevoked>;
|
|
65
|
+
inspect(body: PermissionInspectionInput, options?: PermuteRequestOptions): Promise<PermissionInspection>;
|
|
66
|
+
};
|
|
67
|
+
readonly accessRequests: {
|
|
68
|
+
create(body: AccessRequestInput, options?: PermuteRequestOptions): Promise<AccessRequest>;
|
|
69
|
+
list(query?: AccessRequestQuery, options?: PermuteRequestOptions): Promise<AccessRequestList>;
|
|
70
|
+
get(requestId: string, options?: PermuteRequestOptions): Promise<AccessRequest>;
|
|
71
|
+
decide(requestId: string, body: AccessRequestDecision, options?: PermuteRequestOptions): Promise<AccessRequest>;
|
|
72
|
+
};
|
|
59
73
|
readonly revisions: {
|
|
60
74
|
list(resourceId: string, options?: PermuteRequestOptions): Promise<ResourceRevisionList>;
|
|
61
75
|
get(resourceId: string, revisionId: string, options?: PermuteRequestOptions): Promise<ResourceRevision>;
|
|
@@ -72,14 +86,22 @@ export declare class PermuteClient {
|
|
|
72
86
|
readonly skills: SkillsClient;
|
|
73
87
|
readonly organizationSkills: SkillsClient;
|
|
74
88
|
readonly actions: {
|
|
89
|
+
requestPublication(actionId: string, body: ActionPublicationRequestInput, options?: PermuteRequestOptions): Promise<ActionPublicationRequest>;
|
|
90
|
+
publicationRequests(actionId: string, options?: PermuteRequestOptions): Promise<ActionPublicationRequestList>;
|
|
91
|
+
decidePublication(actionId: string, requestId: string, body: ActionPublicationDecision, options?: PermuteRequestOptions): Promise<ActionPublicationRequest>;
|
|
75
92
|
list(options?: PermuteRequestOptions): Promise<BusinessActionList>;
|
|
76
93
|
create(body: ActionCreateRequest, options?: PermuteRequestOptions): Promise<BusinessAction>;
|
|
77
|
-
get(actionId: string, options?: PermuteRequestOptions): Promise<
|
|
94
|
+
get(actionId: string, options?: PermuteRequestOptions): Promise<BusinessActionDetail>;
|
|
78
95
|
delete(actionId: string, options?: PermuteRequestOptions): Promise<BusinessAction>;
|
|
79
96
|
definition(actionId: string, options?: PermuteRequestOptions): Promise<ActionDefinition>;
|
|
80
97
|
saveDefinition(actionId: string, body: ActionDefinitionSaveRequest, options?: PermuteRequestOptions): Promise<ActionDefinitionSaved>;
|
|
81
98
|
invoke(actionId: string, body: ActionRequest, options?: PermuteRequestOptions): Promise<ActionReceipt>;
|
|
82
99
|
};
|
|
100
|
+
readonly emails: {
|
|
101
|
+
get(options?: PermuteRequestOptions): Promise<EmailSender>;
|
|
102
|
+
/** Only callable from Business Actions through platform.withStep(stepId). */
|
|
103
|
+
send(body: EmailSendRequest, options?: PermuteRequestOptions): Promise<EmailReceipt>;
|
|
104
|
+
};
|
|
83
105
|
readonly databases: {
|
|
84
106
|
list(options?: PermuteRequestOptions): Promise<DatabaseList>;
|
|
85
107
|
create(body: DatabaseCreateRequest, options?: PermuteRequestOptions): Promise<Database>;
|
|
@@ -93,6 +115,13 @@ export declare class PermuteClient {
|
|
|
93
115
|
transact(databaseId: string, body: DatabaseTransactionRequest, options?: PermuteRequestOptions): Promise<DatabaseTransactionReceipt>;
|
|
94
116
|
};
|
|
95
117
|
readonly apps: {
|
|
118
|
+
requestPublication(applicationId: string, body: AppPublicationRequestInput, options?: PermuteRequestOptions): Promise<AppPublicationRequest>;
|
|
119
|
+
publicationRequests(applicationId: string, options?: PermuteRequestOptions): Promise<AppPublicationRequestList>;
|
|
120
|
+
decidePublication(applicationId: string, requestId: string, body: AppPublicationDecision, options?: PermuteRequestOptions): Promise<AppPublicationRequest>;
|
|
121
|
+
address(applicationId: string, options?: PermuteRequestOptions): Promise<AppAddressSettings>;
|
|
122
|
+
setAddress(applicationId: string, body: AppAddressSetRequest, options?: PermuteRequestOptions): Promise<AppAddressSettings>;
|
|
123
|
+
access(applicationId: string, options?: PermuteRequestOptions): Promise<AppAccess>;
|
|
124
|
+
setAccess(applicationId: string, body: AppAccessSetRequest, options?: PermuteRequestOptions): Promise<AppAccess>;
|
|
96
125
|
listGrants(applicationId: string, options?: PermuteRequestOptions): Promise<AppGrants>;
|
|
97
126
|
setGrant(applicationId: string, resourceId: string, body: AppGrantSetRequest, options?: PermuteRequestOptions): Promise<AppGrants>;
|
|
98
127
|
list(options?: PermuteRequestOptions): Promise<AppDraftList>;
|
|
@@ -103,6 +132,7 @@ export declare class PermuteClient {
|
|
|
103
132
|
prepareUploads(applicationId: string, body: AppUploadsRequest, options?: PermuteRequestOptions): Promise<AppUploads>;
|
|
104
133
|
uploadFiles(applicationId: string, files: AppUploadFile[], options?: PermuteRequestOptions): Promise<AppUploadsRequest['files']>;
|
|
105
134
|
saveSite(applicationId: string, body: AppSiteSaveRequest, options?: PermuteRequestOptions): Promise<AppDraft>;
|
|
135
|
+
sourceFile(applicationId: string, query: AppSourceFileQuery, options?: PermuteRequestOptions): Promise<AppSourceFileContent>;
|
|
106
136
|
};
|
|
107
137
|
readonly connectorSessions: {
|
|
108
138
|
create(request: ConnectorSessionCreateRequest, options?: PermuteRequestOptions): Promise<ConnectorSessionCreated>;
|
|
@@ -158,6 +188,7 @@ export declare class PermuteClient {
|
|
|
158
188
|
};
|
|
159
189
|
readonly datasets: {
|
|
160
190
|
create: {
|
|
191
|
+
(request: FileDatasetMetadataCreateRequest, options?: PermuteRequestOptions): Promise<PermuteFileDataset>;
|
|
161
192
|
(request: CustomDatasetCreateRequest, options?: PermuteRequestOptions): Promise<PermuteDataset>;
|
|
162
193
|
(request: FileDatasetCreateRequest, options?: PermuteRequestOptions): Promise<PermuteFileDataset>;
|
|
163
194
|
};
|
|
@@ -166,19 +197,130 @@ export declare class PermuteClient {
|
|
|
166
197
|
download: (datasetId: string, options?: PermuteRequestOptions) => Promise<string>;
|
|
167
198
|
delete: (datasetId: string, options?: PermuteRequestOptions) => Promise<DatasetDeleteResponse>;
|
|
168
199
|
};
|
|
169
|
-
private readonly apiKey
|
|
200
|
+
private readonly apiKey?;
|
|
201
|
+
private readonly accessToken?;
|
|
170
202
|
private readonly baseUrl;
|
|
171
203
|
/** Workspace selected for workspace-scoped API operations. */
|
|
172
204
|
readonly workspaceId?: string;
|
|
173
205
|
private readonly defaultHeaders;
|
|
174
206
|
private readonly fetchImpl;
|
|
175
207
|
constructor(options: PermuteClientOptions);
|
|
176
|
-
search(request: SearchRequest, options?: PermuteRequestOptions)
|
|
208
|
+
search: (request: SearchRequest, options?: PermuteRequestOptions) => Promise<{
|
|
209
|
+
items: {
|
|
210
|
+
citation?: {
|
|
211
|
+
[key: string]: unknown;
|
|
212
|
+
};
|
|
213
|
+
content: string;
|
|
214
|
+
metadata?: {
|
|
215
|
+
[key: string]: unknown;
|
|
216
|
+
};
|
|
217
|
+
score?: number;
|
|
218
|
+
sourceId?: string;
|
|
219
|
+
title?: string;
|
|
220
|
+
type: 'record' | 'document' | 'table' | 'text_block' | 'unknown';
|
|
221
|
+
}[];
|
|
222
|
+
meta: {
|
|
223
|
+
candidateCount?: number;
|
|
224
|
+
reranked: boolean;
|
|
225
|
+
strategy: 'semantic';
|
|
226
|
+
totalMs?: number;
|
|
227
|
+
};
|
|
228
|
+
}>;
|
|
177
229
|
answer(request: AnswerRequest, options?: PermuteRequestOptions): Promise<AnswerResponse>;
|
|
178
|
-
answerJobs(request: AnswerRequest, options?: PermuteRequestOptions)
|
|
179
|
-
|
|
230
|
+
answerJobs: (request: AnswerRequest, options?: PermuteRequestOptions) => Promise<{
|
|
231
|
+
answerJobId: string;
|
|
232
|
+
completedAt?: string | null;
|
|
233
|
+
createdAt?: string;
|
|
234
|
+
error?: string;
|
|
235
|
+
pollAfterMs?: number;
|
|
236
|
+
result?: {
|
|
237
|
+
answer: string;
|
|
238
|
+
assumptions?: {
|
|
239
|
+
[key: string]: unknown;
|
|
240
|
+
}[];
|
|
241
|
+
charts?: {
|
|
242
|
+
[key: string]: unknown;
|
|
243
|
+
}[];
|
|
244
|
+
citations: {
|
|
245
|
+
metadata?: {
|
|
246
|
+
[key: string]: unknown;
|
|
247
|
+
};
|
|
248
|
+
ref?: string;
|
|
249
|
+
sourceId?: string;
|
|
250
|
+
title?: string;
|
|
251
|
+
type: 'text' | 'table' | 'web' | 'fact';
|
|
252
|
+
url?: string;
|
|
253
|
+
}[];
|
|
254
|
+
confidence?: {
|
|
255
|
+
queryComplexity: 'high' | 'medium' | 'low';
|
|
256
|
+
reason: string;
|
|
257
|
+
score: number;
|
|
258
|
+
};
|
|
259
|
+
followUps?: string[];
|
|
260
|
+
};
|
|
261
|
+
startedAt?: string | null;
|
|
262
|
+
status: 'queued' | 'running' | 'completed' | 'failed' | 'cancelled';
|
|
263
|
+
updatedAt?: string;
|
|
264
|
+
}>;
|
|
265
|
+
getAnswerJob: (answerJobId: string, options?: PermuteRequestOptions) => Promise<{
|
|
266
|
+
answerJobId: string;
|
|
267
|
+
completedAt?: string | null;
|
|
268
|
+
createdAt?: string;
|
|
269
|
+
error?: string;
|
|
270
|
+
pollAfterMs?: number;
|
|
271
|
+
result?: {
|
|
272
|
+
answer: string;
|
|
273
|
+
assumptions?: {
|
|
274
|
+
[key: string]: unknown;
|
|
275
|
+
}[];
|
|
276
|
+
charts?: {
|
|
277
|
+
[key: string]: unknown;
|
|
278
|
+
}[];
|
|
279
|
+
citations: {
|
|
280
|
+
metadata?: {
|
|
281
|
+
[key: string]: unknown;
|
|
282
|
+
};
|
|
283
|
+
ref?: string;
|
|
284
|
+
sourceId?: string;
|
|
285
|
+
title?: string;
|
|
286
|
+
type: 'text' | 'table' | 'web' | 'fact';
|
|
287
|
+
url?: string;
|
|
288
|
+
}[];
|
|
289
|
+
confidence?: {
|
|
290
|
+
queryComplexity: 'high' | 'medium' | 'low';
|
|
291
|
+
reason: string;
|
|
292
|
+
score: number;
|
|
293
|
+
};
|
|
294
|
+
followUps?: string[];
|
|
295
|
+
};
|
|
296
|
+
startedAt?: string | null;
|
|
297
|
+
status: 'queued' | 'running' | 'completed' | 'failed' | 'cancelled';
|
|
298
|
+
updatedAt?: string;
|
|
299
|
+
}>;
|
|
180
300
|
withWorkspace(workspaceId: string): PermuteClient;
|
|
181
|
-
query(request: QueryRequest, options?: PermuteRequestOptions)
|
|
301
|
+
query: (request: QueryRequest, options?: PermuteRequestOptions) => Promise<{
|
|
302
|
+
columns: {
|
|
303
|
+
name: string;
|
|
304
|
+
type?: string;
|
|
305
|
+
}[];
|
|
306
|
+
executionMs: number;
|
|
307
|
+
queryId: string;
|
|
308
|
+
rowCount: number;
|
|
309
|
+
rows: {
|
|
310
|
+
[key: string]: unknown;
|
|
311
|
+
}[];
|
|
312
|
+
sourceIds: string[];
|
|
313
|
+
sql: string;
|
|
314
|
+
timings?: {
|
|
315
|
+
initializationMs: number;
|
|
316
|
+
sourceLoadMs: number;
|
|
317
|
+
sourceValidationMs: number;
|
|
318
|
+
sqlExecutionMs: number;
|
|
319
|
+
totalMs: number;
|
|
320
|
+
};
|
|
321
|
+
truncated: boolean;
|
|
322
|
+
}>;
|
|
323
|
+
private bindMethod;
|
|
182
324
|
private request;
|
|
183
325
|
private validateRequestBody;
|
|
184
326
|
private validateRequestQuery;
|