@proteos/sdk 0.21.0 → 0.22.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/dist/{chunk-OUVD2XJX.js → chunk-OOAHNKPP.js} +92 -3
- package/dist/chunk-OOAHNKPP.js.map +1 -0
- package/dist/{chunk-DD6H5PIF.cjs → chunk-V5X4QWIO.cjs} +92 -2
- package/dist/chunk-V5X4QWIO.cjs.map +1 -0
- package/dist/index.cjs +188 -144
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +246 -210
- package/dist/index.d.ts +246 -210
- package/dist/index.js +104 -64
- package/dist/index.js.map +1 -1
- package/dist/meta/index.cjs +54 -50
- package/dist/meta/index.d.cts +1 -1
- package/dist/meta/index.d.ts +1 -1
- package/dist/meta/index.js +1 -1
- package/dist/{types-PzImL4QI.d.cts → types-DT29DVEj.d.cts} +180 -1
- package/dist/{types-PzImL4QI.d.ts → types-DT29DVEj.d.ts} +180 -1
- package/package.json +1 -1
- package/src/auth/platform-entities.ts +4 -0
- package/src/data/records.ts +60 -0
- package/src/index.ts +29 -21
- package/src/meta/design-references.ts +127 -0
- package/src/meta/entities.ts +17 -0
- package/src/meta/index.ts +15 -0
- package/src/meta/types.ts +94 -0
- package/src/storage/files.ts +31 -0
- package/src/storage/types.ts +10 -0
- package/dist/chunk-DD6H5PIF.cjs.map +0 -1
- package/dist/chunk-OUVD2XJX.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AuditFieldsSchema, AttributeSchema, UserRefSchema, PageIterator } from './chunk-
|
|
2
|
-
export { AppSchema, AttributeSchema, AuditFieldsSchema, ColumnSchema, ComponentSchema, CurrencyAttributeMetaSchema, DEFAULT_PAGE_SIZE, DONE, EntitySchema, EntityWithSchemaSchema, FileRefSchema, FilterElementSchema, FilterGroupSchema, ListSchema, ListViewSchema, MenuConfigurationSchema, MenuItemSchema, MenuItemType, MetaClient, ModuleSchema, OnDeleteActionSchema, PLATFORM_ATTRIBUTE_NAMES, PLATFORM_USER_ID, PageActionSchema, PageIterator, PageLayoutSchema, PageSchema, RelationAttributeMetaSchema, ResponseMetaSchema, SortConfigSchema, UserRefSchema, VariableSchema, allCurrencyCodes, createIterator, createListResultSchema, currencyLabel, currencySymbol, currencySymbolSide, formatAmount, formatMoney, isPlatformAttributeName, localeNumberSeparators, parseAmount, parseCurrencyMeta, parseFileMeta, parseRelationMeta, platformAttributes } from './chunk-
|
|
1
|
+
import { AuditFieldsSchema, AttributeSchema, UserRefSchema, PageIterator } from './chunk-OOAHNKPP.js';
|
|
2
|
+
export { AppSchema, AttributeSchema, AuditFieldsSchema, ColumnSchema, ComponentSchema, CurrencyAttributeMetaSchema, DEFAULT_PAGE_SIZE, DONE, DesignReferenceSchema, EntitySchema, EntityWithSchemaSchema, FileRefSchema, FilterElementSchema, FilterGroupSchema, ListSchema, ListViewSchema, MenuConfigurationSchema, MenuItemSchema, MenuItemType, MetaClient, ModuleSchema, OnDeleteActionSchema, PLATFORM_ATTRIBUTE_NAMES, PLATFORM_USER_ID, PageActionSchema, PageIterator, PageLayoutSchema, PageSchema, RelationAttributeMetaSchema, ResponseMetaSchema, SortConfigSchema, UserRefSchema, VariableSchema, allCurrencyCodes, createIterator, createListResultSchema, currencyLabel, currencySymbol, currencySymbolSide, formatAmount, formatMoney, isPlatformAttributeName, localeNumberSeparators, parseAmount, parseCurrencyMeta, parseFileMeta, parseRelationMeta, platformAttributes } from './chunk-OOAHNKPP.js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import { fetchEventSource } from '@microsoft/fetch-event-source';
|
|
5
5
|
|
|
@@ -493,6 +493,7 @@ var PLATFORM_ENTITIES = [
|
|
|
493
493
|
{ slug: "components", name: "Components" },
|
|
494
494
|
{ slug: "lists", name: "Lists" },
|
|
495
495
|
{ slug: "list-views", name: "List Views" },
|
|
496
|
+
{ slug: "design-references", name: "Design References" },
|
|
496
497
|
// System (metadata-service)
|
|
497
498
|
{ slug: "modules", name: "Modules" },
|
|
498
499
|
{ slug: "variables", name: "Variables" },
|
|
@@ -502,6 +503,9 @@ var PLATFORM_ENTITIES = [
|
|
|
502
503
|
// Automation (function-service)
|
|
503
504
|
{ slug: "hooks", name: "Hooks" },
|
|
504
505
|
{ slug: "actions", name: "Actions" },
|
|
506
|
+
// Workflows (workflow-service)
|
|
507
|
+
{ slug: "workflows", name: "Workflows" },
|
|
508
|
+
{ slug: "workflow-executions", name: "Workflow Executions" },
|
|
505
509
|
// Knowledge (knowledge-service)
|
|
506
510
|
{ slug: "knowledge-nodes", name: "Knowledge Nodes" },
|
|
507
511
|
{ slug: "knowledge-links", name: "Knowledge Links" },
|
|
@@ -1089,6 +1093,68 @@ var ProteosClient = class {
|
|
|
1089
1093
|
}
|
|
1090
1094
|
};
|
|
1091
1095
|
|
|
1096
|
+
// src/connector/index.ts
|
|
1097
|
+
var CONNECTOR_BASE_PATH = "/connectors/v1";
|
|
1098
|
+
var ConnectorClient = class {
|
|
1099
|
+
connectors;
|
|
1100
|
+
connections;
|
|
1101
|
+
constructor(client) {
|
|
1102
|
+
this.connectors = new ConnectorCatalogServiceImpl(client);
|
|
1103
|
+
this.connections = new ConnectorConnectionServiceImpl(client);
|
|
1104
|
+
}
|
|
1105
|
+
};
|
|
1106
|
+
var ConnectorCatalogServiceImpl = class {
|
|
1107
|
+
constructor(client) {
|
|
1108
|
+
this.client = client;
|
|
1109
|
+
}
|
|
1110
|
+
client;
|
|
1111
|
+
list(query = {}) {
|
|
1112
|
+
return this.client.requestWithQuery("GET", `${CONNECTOR_BASE_PATH}/connectors`, query);
|
|
1113
|
+
}
|
|
1114
|
+
get(key) {
|
|
1115
|
+
return this.client.request("GET", `${CONNECTOR_BASE_PATH}/connectors/${encodeURIComponent(key)}`);
|
|
1116
|
+
}
|
|
1117
|
+
async listMethods(key) {
|
|
1118
|
+
const connector = await this.get(key);
|
|
1119
|
+
return connector.methods ?? [];
|
|
1120
|
+
}
|
|
1121
|
+
};
|
|
1122
|
+
var ConnectorConnectionServiceImpl = class {
|
|
1123
|
+
constructor(client) {
|
|
1124
|
+
this.client = client;
|
|
1125
|
+
}
|
|
1126
|
+
client;
|
|
1127
|
+
list(query = {}) {
|
|
1128
|
+
return this.client.requestWithQuery("GET", `${CONNECTOR_BASE_PATH}/connections`, query);
|
|
1129
|
+
}
|
|
1130
|
+
get(id) {
|
|
1131
|
+
return this.client.request("GET", `${CONNECTOR_BASE_PATH}/connections/${encodeURIComponent(id)}`);
|
|
1132
|
+
}
|
|
1133
|
+
create(request) {
|
|
1134
|
+
return this.client.request("POST", `${CONNECTOR_BASE_PATH}/connections`, request);
|
|
1135
|
+
}
|
|
1136
|
+
update(id, request) {
|
|
1137
|
+
return this.client.request("PATCH", `${CONNECTOR_BASE_PATH}/connections/${encodeURIComponent(id)}`, request);
|
|
1138
|
+
}
|
|
1139
|
+
async delete(id) {
|
|
1140
|
+
await this.client.request("DELETE", `${CONNECTOR_BASE_PATH}/connections/${encodeURIComponent(id)}`);
|
|
1141
|
+
}
|
|
1142
|
+
install(id) {
|
|
1143
|
+
return this.client.request("POST", `${CONNECTOR_BASE_PATH}/connections/${encodeURIComponent(id)}/install`);
|
|
1144
|
+
}
|
|
1145
|
+
token(id) {
|
|
1146
|
+
return this.client.request("POST", `${CONNECTOR_BASE_PATH}/connections/${encodeURIComponent(id)}/token`);
|
|
1147
|
+
}
|
|
1148
|
+
async invokeMethod(id, method, params = {}) {
|
|
1149
|
+
const response = await this.client.request(
|
|
1150
|
+
"POST",
|
|
1151
|
+
`${CONNECTOR_BASE_PATH}/connections/${encodeURIComponent(id)}/methods/${encodeURIComponent(method)}/invoke`,
|
|
1152
|
+
params
|
|
1153
|
+
);
|
|
1154
|
+
return response.result;
|
|
1155
|
+
}
|
|
1156
|
+
};
|
|
1157
|
+
|
|
1092
1158
|
// src/conversation/voice.ts
|
|
1093
1159
|
var VOICE_BASE_PATH = "/conversations/v1/voice";
|
|
1094
1160
|
var VoiceServiceImpl = class {
|
|
@@ -1336,68 +1402,6 @@ var TranscriptionServiceImpl = class {
|
|
|
1336
1402
|
}
|
|
1337
1403
|
};
|
|
1338
1404
|
|
|
1339
|
-
// src/connector/index.ts
|
|
1340
|
-
var CONNECTOR_BASE_PATH = "/connectors/v1";
|
|
1341
|
-
var ConnectorClient = class {
|
|
1342
|
-
connectors;
|
|
1343
|
-
connections;
|
|
1344
|
-
constructor(client) {
|
|
1345
|
-
this.connectors = new ConnectorCatalogServiceImpl(client);
|
|
1346
|
-
this.connections = new ConnectorConnectionServiceImpl(client);
|
|
1347
|
-
}
|
|
1348
|
-
};
|
|
1349
|
-
var ConnectorCatalogServiceImpl = class {
|
|
1350
|
-
constructor(client) {
|
|
1351
|
-
this.client = client;
|
|
1352
|
-
}
|
|
1353
|
-
client;
|
|
1354
|
-
list(query = {}) {
|
|
1355
|
-
return this.client.requestWithQuery("GET", `${CONNECTOR_BASE_PATH}/connectors`, query);
|
|
1356
|
-
}
|
|
1357
|
-
get(key) {
|
|
1358
|
-
return this.client.request("GET", `${CONNECTOR_BASE_PATH}/connectors/${encodeURIComponent(key)}`);
|
|
1359
|
-
}
|
|
1360
|
-
async listMethods(key) {
|
|
1361
|
-
const connector = await this.get(key);
|
|
1362
|
-
return connector.methods ?? [];
|
|
1363
|
-
}
|
|
1364
|
-
};
|
|
1365
|
-
var ConnectorConnectionServiceImpl = class {
|
|
1366
|
-
constructor(client) {
|
|
1367
|
-
this.client = client;
|
|
1368
|
-
}
|
|
1369
|
-
client;
|
|
1370
|
-
list(query = {}) {
|
|
1371
|
-
return this.client.requestWithQuery("GET", `${CONNECTOR_BASE_PATH}/connections`, query);
|
|
1372
|
-
}
|
|
1373
|
-
get(id) {
|
|
1374
|
-
return this.client.request("GET", `${CONNECTOR_BASE_PATH}/connections/${encodeURIComponent(id)}`);
|
|
1375
|
-
}
|
|
1376
|
-
create(request) {
|
|
1377
|
-
return this.client.request("POST", `${CONNECTOR_BASE_PATH}/connections`, request);
|
|
1378
|
-
}
|
|
1379
|
-
update(id, request) {
|
|
1380
|
-
return this.client.request("PATCH", `${CONNECTOR_BASE_PATH}/connections/${encodeURIComponent(id)}`, request);
|
|
1381
|
-
}
|
|
1382
|
-
async delete(id) {
|
|
1383
|
-
await this.client.request("DELETE", `${CONNECTOR_BASE_PATH}/connections/${encodeURIComponent(id)}`);
|
|
1384
|
-
}
|
|
1385
|
-
install(id) {
|
|
1386
|
-
return this.client.request("POST", `${CONNECTOR_BASE_PATH}/connections/${encodeURIComponent(id)}/install`);
|
|
1387
|
-
}
|
|
1388
|
-
token(id) {
|
|
1389
|
-
return this.client.request("POST", `${CONNECTOR_BASE_PATH}/connections/${encodeURIComponent(id)}/token`);
|
|
1390
|
-
}
|
|
1391
|
-
async invokeMethod(id, method, params = {}) {
|
|
1392
|
-
const response = await this.client.request(
|
|
1393
|
-
"POST",
|
|
1394
|
-
`${CONNECTOR_BASE_PATH}/connections/${encodeURIComponent(id)}/methods/${encodeURIComponent(method)}/invoke`,
|
|
1395
|
-
params
|
|
1396
|
-
);
|
|
1397
|
-
return response.result;
|
|
1398
|
-
}
|
|
1399
|
-
};
|
|
1400
|
-
|
|
1401
1405
|
// src/data/queries.ts
|
|
1402
1406
|
var QUERY_BASE_PATH = "/data/v1/query";
|
|
1403
1407
|
var QueryServiceImpl = class {
|
|
@@ -1418,6 +1422,7 @@ var QueryServiceImpl = class {
|
|
|
1418
1422
|
// src/data/records.ts
|
|
1419
1423
|
var RECORDS_BASE_PATH = "/data/v1/records";
|
|
1420
1424
|
var BATCH_RECORDS_BASE_PATH = "/data/v1/batch/records";
|
|
1425
|
+
var PUBLIC_RECORDS_BASE_PATH = "/data/v1/public/orgs";
|
|
1421
1426
|
var RecordServiceImpl = class {
|
|
1422
1427
|
constructor(client) {
|
|
1423
1428
|
this.client = client;
|
|
@@ -1456,6 +1461,26 @@ var RecordServiceImpl = class {
|
|
|
1456
1461
|
transactions
|
|
1457
1462
|
);
|
|
1458
1463
|
}
|
|
1464
|
+
listPublic(orgId, entitySlug, options = {}) {
|
|
1465
|
+
return new PageIterator((opts) => this.listPublicPage(orgId, entitySlug, opts), options);
|
|
1466
|
+
}
|
|
1467
|
+
async listPublicPage(orgId, entitySlug, options = {}) {
|
|
1468
|
+
return this.client.requestWithQuery(
|
|
1469
|
+
"GET",
|
|
1470
|
+
`${PUBLIC_RECORDS_BASE_PATH}/${encodeURIComponent(orgId)}/records/${encodeURIComponent(entitySlug)}`,
|
|
1471
|
+
options,
|
|
1472
|
+
void 0,
|
|
1473
|
+
{ skipAuth: true }
|
|
1474
|
+
);
|
|
1475
|
+
}
|
|
1476
|
+
async getPublic(orgId, entitySlug, id) {
|
|
1477
|
+
return this.client.request(
|
|
1478
|
+
"GET",
|
|
1479
|
+
`${PUBLIC_RECORDS_BASE_PATH}/${encodeURIComponent(orgId)}/records/${encodeURIComponent(entitySlug)}/${encodeURIComponent(id)}`,
|
|
1480
|
+
void 0,
|
|
1481
|
+
{ skipAuth: true }
|
|
1482
|
+
);
|
|
1483
|
+
}
|
|
1459
1484
|
};
|
|
1460
1485
|
var BatchUpsertTransactionSchema = z.object({
|
|
1461
1486
|
transaction_id: z.string(),
|
|
@@ -2033,6 +2058,21 @@ var FileServiceImpl = class {
|
|
|
2033
2058
|
const { response } = await this.client.requestRaw("GET", `${FILES_BASE_PATH}/${id}/download`);
|
|
2034
2059
|
return await response.blob();
|
|
2035
2060
|
}
|
|
2061
|
+
async downloadPublic(orgId, id) {
|
|
2062
|
+
const { response } = await this.client.requestRaw(
|
|
2063
|
+
"GET",
|
|
2064
|
+
this.publicDownloadPath(orgId, id),
|
|
2065
|
+
void 0,
|
|
2066
|
+
{ skipAuth: true }
|
|
2067
|
+
);
|
|
2068
|
+
return await response.blob();
|
|
2069
|
+
}
|
|
2070
|
+
publicDownloadUrl(orgId, id) {
|
|
2071
|
+
return `${this.client.baseUrl}${this.publicDownloadPath(orgId, id)}`;
|
|
2072
|
+
}
|
|
2073
|
+
publicDownloadPath(orgId, id) {
|
|
2074
|
+
return `/storage/v1/public/orgs/${encodeURIComponent(orgId)}/files/${encodeURIComponent(id)}/download`;
|
|
2075
|
+
}
|
|
2036
2076
|
};
|
|
2037
2077
|
|
|
2038
2078
|
// src/storage/index.ts
|