twenty-sdk 2.37.0 → 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-mAO3vmdp.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 +1 -0
- package/dist/cli/utilities/api/application-api.d.ts +1 -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/entity/entity-view-template.d.ts +1 -1
- package/dist/cli/utilities/error/parse-server-error.d.ts +1 -0
- package/dist/cli.cjs +30 -30
- package/dist/cli.mjs +5447 -5427
- package/dist/define/index.cjs +14 -14
- package/dist/define/index.cjs.map +1 -1
- package/dist/define/index.d.ts +82 -14
- package/dist/define/index.mjs +5717 -5690
- 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-WU9ATS3e.mjs → get-front-component-build-plugins-Bed7hCGi.mjs} +46 -38
- package/dist/{get-front-component-build-plugins-DZIleilT.js → get-front-component-build-plugins-o8cM1FFZ.js} +8 -8
- package/dist/{get-function-input-schema-GNk3NRLJ-DKoJBhuO.js → get-function-input-schema-GNk3NRLJ-A3CmF1qq.js} +1 -1
- package/dist/{get-function-input-schema-GNk3NRLJ-H7iWzfXn.mjs → get-function-input-schema-GNk3NRLJ-BPeB4a-_.mjs} +1 -1
- package/dist/logic-function/index.cjs +4 -4
- package/dist/logic-function/index.cjs.map +1 -1
- package/dist/logic-function/index.d.ts +23 -3
- package/dist/logic-function/index.mjs +26 -12
- package/dist/logic-function/index.mjs.map +1 -1
- package/dist/{login-4PI5lTOa.js → login-2yrPIORt.js} +59 -66
- package/dist/{login-CNByz3vi.mjs → login-QYv7vAbh.mjs} +5348 -5303
- 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-Szx_4267.js +0 -1
|
@@ -58,19 +58,37 @@ type EnqueueJobOptions = {
|
|
|
58
58
|
type EnqueueJobInput = EnqueueJobOptions & {
|
|
59
59
|
logicFunctionUniversalIdentifier: string;
|
|
60
60
|
payload?: Record<string, unknown>;
|
|
61
|
+
jobId?: string;
|
|
61
62
|
};
|
|
62
63
|
type EnqueueJobResult = {
|
|
63
64
|
enqueued: boolean;
|
|
64
65
|
logicFunctionUniversalIdentifier: string;
|
|
66
|
+
jobId: string;
|
|
67
|
+
};
|
|
68
|
+
type EnqueueJobItem = {
|
|
69
|
+
payload?: Record<string, unknown>;
|
|
70
|
+
jobId?: string;
|
|
65
71
|
};
|
|
66
72
|
type EnqueueJobsInput = EnqueueJobOptions & {
|
|
67
73
|
logicFunctionUniversalIdentifier: string;
|
|
68
|
-
payloads
|
|
74
|
+
payloads?: Record<string, unknown>[];
|
|
75
|
+
jobs?: EnqueueJobItem[];
|
|
69
76
|
};
|
|
70
77
|
type EnqueueJobsResult = {
|
|
71
78
|
enqueued: boolean;
|
|
72
79
|
logicFunctionUniversalIdentifier: string;
|
|
73
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;
|
|
74
92
|
};
|
|
75
93
|
|
|
76
94
|
declare enum HTTPMethod {
|
|
@@ -405,6 +423,8 @@ declare const enqueueJob: (input: EnqueueJobInput) => Promise<EnqueueJobResult>;
|
|
|
405
423
|
|
|
406
424
|
declare const enqueueJobs: (input: EnqueueJobsInput) => Promise<EnqueueJobsResult>;
|
|
407
425
|
|
|
426
|
+
declare const getJobs: (jobIds: string[]) => Promise<JobStatusResult[]>;
|
|
427
|
+
|
|
408
428
|
type CreateTimelineActivityBaseInput = {
|
|
409
429
|
timelineActivityTypeUniversalIdentifier: string;
|
|
410
430
|
targetObjectUniversalIdentifier: string;
|
|
@@ -448,5 +468,5 @@ declare class Response implements LogicFunctionHttpResponse {
|
|
|
448
468
|
constructor(body: unknown, init?: ResponseInit);
|
|
449
469
|
}
|
|
450
470
|
|
|
451
|
-
export { AppConnectionAuthFailedError, ObjectRecordBaseEvent, ObjectRecordCreateEvent, ObjectRecordDeleteEvent, ObjectRecordDestroyEvent, ObjectRecordRestoreEvent, ObjectRecordUpdateEvent, ObjectRecordUpsertEvent, Response, RetryableLogicFunctionError, createTimelineActivity, enqueueJob, enqueueJobs, findConnectionForRequest, getConnection, jsonSchemaToInputSchema, kv, listConnections, runAgent };
|
|
452
|
-
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 };
|
|
@@ -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
|