twenty-sdk 2.35.1 → 2.38.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/billing/index.cjs +3 -3
- package/dist/billing/index.cjs.map +1 -1
- package/dist/billing/index.d.ts +25 -4
- package/dist/billing/index.mjs +495 -464
- package/dist/billing/index.mjs.map +1 -1
- package/dist/catalog-sync-DB_oIbry.js +1 -0
- package/dist/{catalog-sync-C82Xfr2f.mjs → catalog-sync-TFrxc_Y6.mjs} +4 -4
- package/dist/cli/commands/dev/dev-once.d.ts +1 -0
- package/dist/cli/commands/dev/dev.d.ts +1 -0
- package/dist/cli/operations/dev-once.d.ts +1 -0
- package/dist/cli/utilities/api/api-service.d.ts +3 -0
- package/dist/cli/utilities/api/application-api.d.ts +1 -0
- package/dist/cli/utilities/api/file-api.d.ts +41 -0
- package/dist/cli/utilities/dev/orchestrator/dev-mode-orchestrator.d.ts +1 -0
- package/dist/cli/utilities/dev/orchestrator/steps/format-sync-actions-plan.d.ts +8 -1
- package/dist/cli/utilities/dev/orchestrator/steps/sync-application-orchestrator-step.d.ts +3 -1
- package/dist/cli/utilities/dev/orchestrator/steps/upload-files-orchestrator-step.d.ts +1 -0
- package/dist/cli/utilities/entity/entity-view-template.d.ts +1 -1
- package/dist/cli/utilities/error/parse-server-error.d.ts +1 -0
- package/dist/cli/utilities/file/file-uploader.d.ts +13 -4
- package/dist/cli/utilities/file/put-file-to-upload-url.d.ts +5 -0
- package/dist/cli.cjs +30 -30
- package/dist/cli.mjs +5455 -5421
- package/dist/define/index.cjs +14 -14
- package/dist/define/index.cjs.map +1 -1
- package/dist/define/index.d.ts +340 -26
- package/dist/define/index.mjs +6104 -5955
- package/dist/define/index.mjs.map +1 -1
- package/dist/front-component/index.cjs +1 -1
- package/dist/front-component/index.cjs.map +1 -1
- package/dist/front-component/index.d.ts +23 -6
- package/dist/front-component/index.mjs +2 -2
- package/dist/front-component/index.mjs.map +1 -1
- package/dist/front-component-renderer/build.cjs +1 -1
- package/dist/front-component-renderer/build.mjs +1 -1
- package/dist/{get-front-component-build-plugins-D9VJQHw7.mjs → get-front-component-build-plugins-Bed7hCGi.mjs} +105 -91
- package/dist/{get-front-component-build-plugins-CcV3Cown.js → get-front-component-build-plugins-o8cM1FFZ.js} +8 -8
- package/dist/{get-function-input-schema-GNk3NRLJ-Byssjp8I.js → get-function-input-schema-GNk3NRLJ-A3CmF1qq.js} +1 -1
- package/dist/{get-function-input-schema-GNk3NRLJ-Dm0Ljlg4.mjs → get-function-input-schema-GNk3NRLJ-BPeB4a-_.mjs} +1 -1
- package/dist/logic-function/index.cjs +6 -4
- package/dist/logic-function/index.cjs.map +1 -1
- package/dist/logic-function/index.d.ts +24 -3
- package/dist/logic-function/index.mjs +28 -14
- package/dist/logic-function/index.mjs.map +1 -1
- package/dist/{login-cG7hCrTK.js → login-2yrPIORt.js} +89 -66
- package/dist/{login-BsiMC4oB.mjs → login-QYv7vAbh.mjs} +5011 -4705
- package/dist/operations.cjs +1 -1
- package/dist/operations.mjs +4 -4
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.mjs.map +1 -1
- package/package.json +2 -2
- package/dist/catalog-sync-Bs-X2ChV.js +0 -1
|
@@ -9,6 +9,7 @@ type AppConnection = {
|
|
|
9
9
|
handle: string;
|
|
10
10
|
visibility: 'user' | 'workspace';
|
|
11
11
|
userWorkspaceId: string;
|
|
12
|
+
workspaceMemberId: string | null;
|
|
12
13
|
accessToken: string;
|
|
13
14
|
scopes: string[];
|
|
14
15
|
authFailedAt: string | null;
|
|
@@ -57,19 +58,37 @@ type EnqueueJobOptions = {
|
|
|
57
58
|
type EnqueueJobInput = EnqueueJobOptions & {
|
|
58
59
|
logicFunctionUniversalIdentifier: string;
|
|
59
60
|
payload?: Record<string, unknown>;
|
|
61
|
+
jobId?: string;
|
|
60
62
|
};
|
|
61
63
|
type EnqueueJobResult = {
|
|
62
64
|
enqueued: boolean;
|
|
63
65
|
logicFunctionUniversalIdentifier: string;
|
|
66
|
+
jobId: string;
|
|
67
|
+
};
|
|
68
|
+
type EnqueueJobItem = {
|
|
69
|
+
payload?: Record<string, unknown>;
|
|
70
|
+
jobId?: string;
|
|
64
71
|
};
|
|
65
72
|
type EnqueueJobsInput = EnqueueJobOptions & {
|
|
66
73
|
logicFunctionUniversalIdentifier: string;
|
|
67
|
-
payloads
|
|
74
|
+
payloads?: Record<string, unknown>[];
|
|
75
|
+
jobs?: EnqueueJobItem[];
|
|
68
76
|
};
|
|
69
77
|
type EnqueueJobsResult = {
|
|
70
78
|
enqueued: boolean;
|
|
71
79
|
logicFunctionUniversalIdentifier: string;
|
|
72
80
|
enqueuedJobsCount: number;
|
|
81
|
+
jobIds: string[];
|
|
82
|
+
};
|
|
83
|
+
type JobStatusState = 'COMPLETED' | 'FAILED' | 'ACTIVE' | 'WAITING' | 'DELAYED' | 'PRIORITIZED' | 'WAITING_CHILDREN';
|
|
84
|
+
type JobStatusResult = {
|
|
85
|
+
jobId: string;
|
|
86
|
+
state: JobStatusState;
|
|
87
|
+
attemptsMade: number;
|
|
88
|
+
failedReason?: string | null;
|
|
89
|
+
enqueuedAt: number;
|
|
90
|
+
startedAt?: number | null;
|
|
91
|
+
finishedAt?: number | null;
|
|
73
92
|
};
|
|
74
93
|
|
|
75
94
|
declare enum HTTPMethod {
|
|
@@ -404,6 +423,8 @@ declare const enqueueJob: (input: EnqueueJobInput) => Promise<EnqueueJobResult>;
|
|
|
404
423
|
|
|
405
424
|
declare const enqueueJobs: (input: EnqueueJobsInput) => Promise<EnqueueJobsResult>;
|
|
406
425
|
|
|
426
|
+
declare const getJobs: (jobIds: string[]) => Promise<JobStatusResult[]>;
|
|
427
|
+
|
|
407
428
|
type CreateTimelineActivityBaseInput = {
|
|
408
429
|
timelineActivityTypeUniversalIdentifier: string;
|
|
409
430
|
targetObjectUniversalIdentifier: string;
|
|
@@ -447,5 +468,5 @@ declare class Response implements LogicFunctionHttpResponse {
|
|
|
447
468
|
constructor(body: unknown, init?: ResponseInit);
|
|
448
469
|
}
|
|
449
470
|
|
|
450
|
-
export { AppConnectionAuthFailedError, ObjectRecordBaseEvent, ObjectRecordCreateEvent, ObjectRecordDeleteEvent, ObjectRecordDestroyEvent, ObjectRecordRestoreEvent, ObjectRecordUpdateEvent, ObjectRecordUpsertEvent, Response, RetryableLogicFunctionError, createTimelineActivity, enqueueJob, enqueueJobs, findConnectionForRequest, getConnection, jsonSchemaToInputSchema, kv, listConnections, runAgent };
|
|
451
|
-
export type { AppConnection, AppKeyValue, AppKeyValueScope, CreateTimelineActivityInput, CreatedTimelineActivity, CronPayload, DatabaseEventPayload, EnqueueJobInput, EnqueueJobOptions, EnqueueJobResult, EnqueueJobsInput, EnqueueJobsResult, InputJsonSchema, InstallHandler, InstallPayload, ListConnectionsFilter, LogicFunctionConfig, LogicFunctionExecutionContext, LogicFunctionHandler, ObjectRecordEvent, ResponseInit, LogicFunctionEvent as RoutePayload, RunAgentInput, RunAgentResult, ServerRouteDispatchResult, ServerRouteResolverResult, UninstallHandler, UninstallPayload };
|
|
471
|
+
export { AppConnectionAuthFailedError, ObjectRecordBaseEvent, ObjectRecordCreateEvent, ObjectRecordDeleteEvent, ObjectRecordDestroyEvent, ObjectRecordRestoreEvent, ObjectRecordUpdateEvent, ObjectRecordUpsertEvent, Response, RetryableLogicFunctionError, createTimelineActivity, enqueueJob, enqueueJobs, findConnectionForRequest, getConnection, getJobs, jsonSchemaToInputSchema, kv, listConnections, runAgent };
|
|
472
|
+
export type { AppConnection, AppKeyValue, AppKeyValueScope, CreateTimelineActivityInput, CreatedTimelineActivity, CronPayload, DatabaseEventPayload, EnqueueJobInput, EnqueueJobItem, EnqueueJobOptions, EnqueueJobResult, EnqueueJobsInput, EnqueueJobsResult, InputJsonSchema, InstallHandler, InstallPayload, JobStatusResult, JobStatusState, ListConnectionsFilter, LogicFunctionConfig, LogicFunctionExecutionContext, LogicFunctionHandler, ObjectRecordEvent, ResponseInit, LogicFunctionEvent as RoutePayload, RunAgentInput, RunAgentResult, ServerRouteDispatchResult, ServerRouteResolverResult, UninstallHandler, UninstallPayload };
|
|
@@ -2514,7 +2514,7 @@ var ua = "TWENTY_API_URL", da = "TWENTY_APP_APPLICATION_ACCESS_TOKEN", fa = () =
|
|
|
2514
2514
|
if (o.errors && o.errors.length > 0) throw Error(`${n}() failed: ${o.errors.map((e) => e.message).join(", ")}`);
|
|
2515
2515
|
if (!o.data) throw Error(`${n}() failed: response contained no data.`);
|
|
2516
2516
|
return o.data;
|
|
2517
|
-
}, pa = "\n query GetAppConnection($id: ID!) {\n appConnection(id: $id) {\n id\n providerName\n name\n handle\n visibility\n userWorkspaceId\n accessToken\n scopes\n authFailedAt\n }\n }\n", ma = async (e) => {
|
|
2517
|
+
}, pa = "\n query GetAppConnection($id: ID!) {\n appConnection(id: $id) {\n id\n providerName\n name\n handle\n visibility\n userWorkspaceId\n workspaceMemberId\n accessToken\n scopes\n authFailedAt\n }\n }\n", ma = async (e) => {
|
|
2518
2518
|
let { appConnection: t } = await Q({
|
|
2519
2519
|
query: pa,
|
|
2520
2520
|
variables: { id: e },
|
|
@@ -2522,7 +2522,7 @@ var ua = "TWENTY_API_URL", da = "TWENTY_APP_APPLICATION_ACCESS_TOKEN", fa = () =
|
|
|
2522
2522
|
});
|
|
2523
2523
|
if (t.authFailedAt !== null) throw new ae(t.id);
|
|
2524
2524
|
return t;
|
|
2525
|
-
}, ha = "\n query ListAppConnections($filter: ListAppConnectionsInput) {\n appConnections(filter: $filter) {\n id\n providerName\n name\n handle\n visibility\n userWorkspaceId\n accessToken\n scopes\n authFailedAt\n }\n }\n", ga = async (e = {}) => {
|
|
2525
|
+
}, ha = "\n query ListAppConnections($filter: ListAppConnectionsInput) {\n appConnections(filter: $filter) {\n id\n providerName\n name\n handle\n visibility\n userWorkspaceId\n workspaceMemberId\n accessToken\n scopes\n authFailedAt\n }\n }\n", ga = async (e = {}) => {
|
|
2526
2526
|
let { appConnections: t } = await Q({
|
|
2527
2527
|
query: ha,
|
|
2528
2528
|
variables: { filter: e },
|
|
@@ -2546,7 +2546,8 @@ var ua = "TWENTY_API_URL", da = "TWENTY_APP_APPLICATION_ACCESS_TOKEN", fa = () =
|
|
|
2546
2546
|
let { enqueueJob: t } = await new i().mutation({ enqueueJob: {
|
|
2547
2547
|
__args: { input: e },
|
|
2548
2548
|
enqueued: !0,
|
|
2549
|
-
logicFunctionUniversalIdentifier: !0
|
|
2549
|
+
logicFunctionUniversalIdentifier: !0,
|
|
2550
|
+
jobId: !0
|
|
2550
2551
|
} });
|
|
2551
2552
|
return t;
|
|
2552
2553
|
}, xa = async (e) => {
|
|
@@ -2554,10 +2555,23 @@ var ua = "TWENTY_API_URL", da = "TWENTY_APP_APPLICATION_ACCESS_TOKEN", fa = () =
|
|
|
2554
2555
|
__args: { input: e },
|
|
2555
2556
|
enqueued: !0,
|
|
2556
2557
|
logicFunctionUniversalIdentifier: !0,
|
|
2557
|
-
enqueuedJobsCount: !0
|
|
2558
|
+
enqueuedJobsCount: !0,
|
|
2559
|
+
jobIds: !0
|
|
2560
|
+
} });
|
|
2561
|
+
return t;
|
|
2562
|
+
}, Sa = async (e) => {
|
|
2563
|
+
let { getJobs: t } = await new i().query({ getJobs: {
|
|
2564
|
+
__args: { jobIds: e },
|
|
2565
|
+
jobId: !0,
|
|
2566
|
+
state: !0,
|
|
2567
|
+
attemptsMade: !0,
|
|
2568
|
+
failedReason: !0,
|
|
2569
|
+
enqueuedAt: !0,
|
|
2570
|
+
startedAt: !0,
|
|
2571
|
+
finishedAt: !0
|
|
2558
2572
|
} });
|
|
2559
2573
|
return t;
|
|
2560
|
-
},
|
|
2574
|
+
}, Ca = (e) => t(e) ? e[0].toUpperCase() + e.slice(1) : "", wa = (e) => ({
|
|
2561
2575
|
__args: {
|
|
2562
2576
|
paging: { first: e.length },
|
|
2563
2577
|
filter: { universalIdentifier: { in: e } }
|
|
@@ -2567,20 +2581,20 @@ var ua = "TWENTY_API_URL", da = "TWENTY_APP_APPLICATION_ACCESS_TOKEN", fa = () =
|
|
|
2567
2581
|
universalIdentifier: !0,
|
|
2568
2582
|
nameSingular: !0
|
|
2569
2583
|
} }
|
|
2570
|
-
}),
|
|
2584
|
+
}), Ta = async ({ timelineActivityTypeUniversalIdentifier: t, targetObjectUniversalIdentifier: n, linkedObjectMetadataUniversalIdentifier: r, targetRecordId: o, ...s }) => {
|
|
2571
2585
|
let c = [...new Set([n, r].filter(e))], { timelineActivityTypes: l, objects: u } = await new i().query({
|
|
2572
2586
|
timelineActivityTypes: {
|
|
2573
2587
|
id: !0,
|
|
2574
2588
|
universalIdentifier: !0,
|
|
2575
2589
|
isActive: !0
|
|
2576
2590
|
},
|
|
2577
|
-
objects:
|
|
2591
|
+
objects: wa(c)
|
|
2578
2592
|
}), d = l.find(({ universalIdentifier: e }) => e === t);
|
|
2579
2593
|
if (!e(d)) throw Error(`Timeline activity type ${t} is not installed`);
|
|
2580
2594
|
if (!d.isActive) throw Error(`Timeline activity type ${t} is inactive`);
|
|
2581
2595
|
let f = new Map(u.edges.map(({ node: e }) => [e.universalIdentifier, e])), p = f.get(n);
|
|
2582
2596
|
if (!e(p)) throw Error(`Timeline activity target object ${n} is not installed`);
|
|
2583
|
-
let m = `target${
|
|
2597
|
+
let m = `target${Ca(p.nameSingular)}Id`, h = e(r) ? f.get(r) : void 0;
|
|
2584
2598
|
if (e(r) && !e(h)) throw Error(`Timeline activity linked object ${r} is not installed`);
|
|
2585
2599
|
return (await new a().post("/rest/timelineActivities", {
|
|
2586
2600
|
...s,
|
|
@@ -2588,10 +2602,10 @@ var ua = "TWENTY_API_URL", da = "TWENTY_APP_APPLICATION_ACCESS_TOKEN", fa = () =
|
|
|
2588
2602
|
linkedObjectMetadataId: h?.id,
|
|
2589
2603
|
[m]: o
|
|
2590
2604
|
})).data.createTimelineActivity;
|
|
2591
|
-
},
|
|
2605
|
+
}, Ea = "\n query GetAppKeyValue($key: String!, $scope: AppKeyValueScope) {\n appKeyValue(key: $key, scope: $scope) {\n key\n value\n scope\n }\n }\n", Da = "\n mutation SetAppKeyValue($input: SetAppKeyValueInput!) {\n setAppKeyValue(input: $input) {\n key\n value\n scope\n }\n }\n", Oa = "\n mutation DeleteAppKeyValue($key: String!, $scope: AppKeyValueScope) {\n deleteAppKeyValue(key: $key, scope: $scope)\n }\n", $ = "WORKSPACE", ka = {
|
|
2592
2606
|
async get(e, t) {
|
|
2593
2607
|
let { appKeyValue: n } = await Q({
|
|
2594
|
-
query:
|
|
2608
|
+
query: Ea,
|
|
2595
2609
|
variables: {
|
|
2596
2610
|
key: e,
|
|
2597
2611
|
scope: t?.scope ?? $
|
|
@@ -2602,7 +2616,7 @@ var ua = "TWENTY_API_URL", da = "TWENTY_APP_APPLICATION_ACCESS_TOKEN", fa = () =
|
|
|
2602
2616
|
},
|
|
2603
2617
|
async set(e, t, n) {
|
|
2604
2618
|
await Q({
|
|
2605
|
-
query:
|
|
2619
|
+
query: Da,
|
|
2606
2620
|
variables: { input: {
|
|
2607
2621
|
key: e,
|
|
2608
2622
|
value: t,
|
|
@@ -2613,7 +2627,7 @@ var ua = "TWENTY_API_URL", da = "TWENTY_APP_APPLICATION_ACCESS_TOKEN", fa = () =
|
|
|
2613
2627
|
},
|
|
2614
2628
|
async delete(e, t) {
|
|
2615
2629
|
let { deleteAppKeyValue: n } = await Q({
|
|
2616
|
-
query:
|
|
2630
|
+
query: Oa,
|
|
2617
2631
|
variables: {
|
|
2618
2632
|
key: e,
|
|
2619
2633
|
scope: t?.scope ?? $
|
|
@@ -2622,12 +2636,12 @@ var ua = "TWENTY_API_URL", da = "TWENTY_APP_APPLICATION_ACCESS_TOKEN", fa = () =
|
|
|
2622
2636
|
});
|
|
2623
2637
|
return n;
|
|
2624
2638
|
}
|
|
2625
|
-
},
|
|
2639
|
+
}, Aa = class {
|
|
2626
2640
|
constructor(e, t) {
|
|
2627
2641
|
this.__twentyHttpResponse = !0, this.body = e, this.status = t?.status, this.headers = t?.headers;
|
|
2628
2642
|
}
|
|
2629
2643
|
};
|
|
2630
2644
|
//#endregion
|
|
2631
|
-
export { ae as AppConnectionAuthFailedError,
|
|
2645
|
+
export { ae as AppConnectionAuthFailedError, Aa as Response, ie as RetryableLogicFunctionError, Ta as createTimelineActivity, ba as enqueueJob, xa as enqueueJobs, _a as findConnectionForRequest, ma as getConnection, Sa as getJobs, u as jsonSchemaToInputSchema, ka as kv, ga as listConnections, ya as runAgent };
|
|
2632
2646
|
|
|
2633
2647
|
//# sourceMappingURL=index.mjs.map
|