@proteos/sdk 0.20.5 → 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-XJP5WCRZ.js → chunk-OOAHNKPP.js} +104 -5
- package/dist/chunk-OOAHNKPP.js.map +1 -0
- package/dist/{chunk-7RGN4E22.cjs → chunk-V5X4QWIO.cjs} +104 -4
- package/dist/chunk-V5X4QWIO.cjs.map +1 -0
- package/dist/index.cjs +202 -147
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +256 -210
- package/dist/index.d.ts +256 -210
- package/dist/index.js +118 -67
- 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-BNsjfU8N.d.cts → types-DT29DVEj.d.cts} +243 -9
- package/dist/{types-BNsjfU8N.d.ts → types-DT29DVEj.d.ts} +243 -9
- package/package.json +1 -1
- package/src/auth/platform-entities.ts +4 -0
- package/src/client.ts +5 -3
- package/src/data/records.ts +60 -0
- package/src/functions/actions.ts +25 -0
- package/src/index.ts +30 -19
- package/src/meta/design-references.ts +127 -0
- package/src/meta/entities.ts +17 -0
- package/src/meta/index.ts +18 -0
- package/src/meta/pages.ts +28 -1
- package/src/meta/types.ts +139 -6
- package/src/storage/files.ts +31 -0
- package/src/storage/types.ts +10 -0
- package/src/types/options.ts +6 -0
- package/dist/chunk-7RGN4E22.cjs.map +0 -1
- package/dist/chunk-XJP5WCRZ.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" },
|
|
@@ -816,9 +820,11 @@ var ProteosClient = class {
|
|
|
816
820
|
...this.options.headers,
|
|
817
821
|
...requestOptions?.headers
|
|
818
822
|
});
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
823
|
+
if (!requestOptions?.skipAuth) {
|
|
824
|
+
const token = await this.getToken();
|
|
825
|
+
if (token) {
|
|
826
|
+
headers.set("Authorization", `Bearer ${token}`);
|
|
827
|
+
}
|
|
822
828
|
}
|
|
823
829
|
return headers;
|
|
824
830
|
}
|
|
@@ -1087,6 +1093,68 @@ var ProteosClient = class {
|
|
|
1087
1093
|
}
|
|
1088
1094
|
};
|
|
1089
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
|
+
|
|
1090
1158
|
// src/conversation/voice.ts
|
|
1091
1159
|
var VOICE_BASE_PATH = "/conversations/v1/voice";
|
|
1092
1160
|
var VoiceServiceImpl = class {
|
|
@@ -1334,68 +1402,6 @@ var TranscriptionServiceImpl = class {
|
|
|
1334
1402
|
}
|
|
1335
1403
|
};
|
|
1336
1404
|
|
|
1337
|
-
// src/connector/index.ts
|
|
1338
|
-
var CONNECTOR_BASE_PATH = "/connectors/v1";
|
|
1339
|
-
var ConnectorClient = class {
|
|
1340
|
-
connectors;
|
|
1341
|
-
connections;
|
|
1342
|
-
constructor(client) {
|
|
1343
|
-
this.connectors = new ConnectorCatalogServiceImpl(client);
|
|
1344
|
-
this.connections = new ConnectorConnectionServiceImpl(client);
|
|
1345
|
-
}
|
|
1346
|
-
};
|
|
1347
|
-
var ConnectorCatalogServiceImpl = class {
|
|
1348
|
-
constructor(client) {
|
|
1349
|
-
this.client = client;
|
|
1350
|
-
}
|
|
1351
|
-
client;
|
|
1352
|
-
list(query = {}) {
|
|
1353
|
-
return this.client.requestWithQuery("GET", `${CONNECTOR_BASE_PATH}/connectors`, query);
|
|
1354
|
-
}
|
|
1355
|
-
get(key) {
|
|
1356
|
-
return this.client.request("GET", `${CONNECTOR_BASE_PATH}/connectors/${encodeURIComponent(key)}`);
|
|
1357
|
-
}
|
|
1358
|
-
async listMethods(key) {
|
|
1359
|
-
const connector = await this.get(key);
|
|
1360
|
-
return connector.methods ?? [];
|
|
1361
|
-
}
|
|
1362
|
-
};
|
|
1363
|
-
var ConnectorConnectionServiceImpl = class {
|
|
1364
|
-
constructor(client) {
|
|
1365
|
-
this.client = client;
|
|
1366
|
-
}
|
|
1367
|
-
client;
|
|
1368
|
-
list(query = {}) {
|
|
1369
|
-
return this.client.requestWithQuery("GET", `${CONNECTOR_BASE_PATH}/connections`, query);
|
|
1370
|
-
}
|
|
1371
|
-
get(id) {
|
|
1372
|
-
return this.client.request("GET", `${CONNECTOR_BASE_PATH}/connections/${encodeURIComponent(id)}`);
|
|
1373
|
-
}
|
|
1374
|
-
create(request) {
|
|
1375
|
-
return this.client.request("POST", `${CONNECTOR_BASE_PATH}/connections`, request);
|
|
1376
|
-
}
|
|
1377
|
-
update(id, request) {
|
|
1378
|
-
return this.client.request("PATCH", `${CONNECTOR_BASE_PATH}/connections/${encodeURIComponent(id)}`, request);
|
|
1379
|
-
}
|
|
1380
|
-
async delete(id) {
|
|
1381
|
-
await this.client.request("DELETE", `${CONNECTOR_BASE_PATH}/connections/${encodeURIComponent(id)}`);
|
|
1382
|
-
}
|
|
1383
|
-
install(id) {
|
|
1384
|
-
return this.client.request("POST", `${CONNECTOR_BASE_PATH}/connections/${encodeURIComponent(id)}/install`);
|
|
1385
|
-
}
|
|
1386
|
-
token(id) {
|
|
1387
|
-
return this.client.request("POST", `${CONNECTOR_BASE_PATH}/connections/${encodeURIComponent(id)}/token`);
|
|
1388
|
-
}
|
|
1389
|
-
async invokeMethod(id, method, params = {}) {
|
|
1390
|
-
const response = await this.client.request(
|
|
1391
|
-
"POST",
|
|
1392
|
-
`${CONNECTOR_BASE_PATH}/connections/${encodeURIComponent(id)}/methods/${encodeURIComponent(method)}/invoke`,
|
|
1393
|
-
params
|
|
1394
|
-
);
|
|
1395
|
-
return response.result;
|
|
1396
|
-
}
|
|
1397
|
-
};
|
|
1398
|
-
|
|
1399
1405
|
// src/data/queries.ts
|
|
1400
1406
|
var QUERY_BASE_PATH = "/data/v1/query";
|
|
1401
1407
|
var QueryServiceImpl = class {
|
|
@@ -1416,6 +1422,7 @@ var QueryServiceImpl = class {
|
|
|
1416
1422
|
// src/data/records.ts
|
|
1417
1423
|
var RECORDS_BASE_PATH = "/data/v1/records";
|
|
1418
1424
|
var BATCH_RECORDS_BASE_PATH = "/data/v1/batch/records";
|
|
1425
|
+
var PUBLIC_RECORDS_BASE_PATH = "/data/v1/public/orgs";
|
|
1419
1426
|
var RecordServiceImpl = class {
|
|
1420
1427
|
constructor(client) {
|
|
1421
1428
|
this.client = client;
|
|
@@ -1454,6 +1461,26 @@ var RecordServiceImpl = class {
|
|
|
1454
1461
|
transactions
|
|
1455
1462
|
);
|
|
1456
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
|
+
}
|
|
1457
1484
|
};
|
|
1458
1485
|
var BatchUpsertTransactionSchema = z.object({
|
|
1459
1486
|
transaction_id: z.string(),
|
|
@@ -1610,6 +1637,15 @@ var ActionServiceImpl = class {
|
|
|
1610
1637
|
);
|
|
1611
1638
|
return response.result;
|
|
1612
1639
|
}
|
|
1640
|
+
async invokePublic(orgId, slug, params) {
|
|
1641
|
+
const response = await this.client.request(
|
|
1642
|
+
"POST",
|
|
1643
|
+
`/functions/v1/public/orgs/${encodeURIComponent(orgId)}/actions/${encodeURIComponent(slug)}/invoke`,
|
|
1644
|
+
params,
|
|
1645
|
+
{ skipAuth: true }
|
|
1646
|
+
);
|
|
1647
|
+
return response.result;
|
|
1648
|
+
}
|
|
1613
1649
|
async invokeEntity(entitySlug, recordId, slug, params) {
|
|
1614
1650
|
const response = await this.client.request(
|
|
1615
1651
|
"POST",
|
|
@@ -2022,6 +2058,21 @@ var FileServiceImpl = class {
|
|
|
2022
2058
|
const { response } = await this.client.requestRaw("GET", `${FILES_BASE_PATH}/${id}/download`);
|
|
2023
2059
|
return await response.blob();
|
|
2024
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
|
+
}
|
|
2025
2076
|
};
|
|
2026
2077
|
|
|
2027
2078
|
// src/storage/index.ts
|