twenty-sdk 2.50.0 → 2.51.1
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/build/descriptor.json +1 -1
- package/dist/{build-snapshot-DlB2VyNd.mjs → build-snapshot--GXJr4vI.mjs} +2 -2
- package/dist/{build-snapshot-C-NQg7fn.js → build-snapshot-D38u-ntr.js} +1 -1
- package/dist/build.cjs +1 -1
- package/dist/build.mjs +2 -2
- package/dist/{catalog-sync-DxcdSEBJ.js → catalog-sync-DJgluWIc.js} +1 -1
- package/dist/{catalog-sync-C6jv_xoa.mjs → catalog-sync-Z1uWs5Ge.mjs} +1 -1
- package/dist/cli/utilities/build/common/front-component-build/css-injection-plugin.d.ts +1 -2
- package/dist/cli/utilities/build/common/front-component-build/utils/unwrap-define-front-component-to-direct-export.d.ts +1 -1
- package/dist/cli.cjs +11 -11
- package/dist/cli.mjs +113 -113
- package/dist/{compile-application-BFhqkVqO.js → compile-application-BPxjs2Co.js} +5 -5
- package/dist/{compile-application-B2LfsDBX.mjs → compile-application-CU3rJlps.mjs} +1380 -1376
- package/dist/define/index.cjs +15 -12
- package/dist/define/index.cjs.map +1 -1
- package/dist/define/index.d.ts +22 -5
- package/dist/define/index.mjs +5555 -5128
- 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 +6 -1
- package/dist/front-component/index.mjs +26 -15
- 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-B0LNjbg4.js +883 -0
- package/dist/{get-front-component-build-plugins-QXeU8MwC.mjs → get-front-component-build-plugins-CnwC-jU8.mjs} +7178 -6721
- package/dist/logic-function/index.cjs.map +1 -1
- package/dist/logic-function/index.mjs.map +1 -1
- package/dist/{login-_eABINVq.mjs → login-CNV69o8l.mjs} +466 -466
- package/dist/{login-DkjpI4jn.js → login-CbjId2Zl.js} +9 -9
- package/dist/operations.cjs +1 -1
- package/dist/operations.mjs +2 -2
- package/dist/{package-DftRfrG7.mjs → package-CEEl5qZD.mjs} +6 -1
- package/dist/package-RzehG8GA.js +1 -0
- package/dist/{typecheck-application-DIe_vwjU.mjs → typecheck-application-aR7mCSHB.mjs} +1 -1
- package/package.json +8 -3
- package/dist/get-front-component-build-plugins-BcUjFnki.js +0 -880
- package/dist/package-vtLsH5RS.js +0 -1
package/dist/cli.mjs
CHANGED
|
@@ -3,11 +3,11 @@ import { createRequire as e } from "node:module";
|
|
|
3
3
|
import { fileURLToPath as t } from "node:url";
|
|
4
4
|
import { dirname as n } from "node:path";
|
|
5
5
|
e(import.meta.url), n(t(import.meta.url));
|
|
6
|
-
import {
|
|
7
|
-
import { B as b, C as ee, D as te, E as ne, F as x, N as re, O as ie, P as ae, R as oe, S as se, T as ce, U as S, V as le, _ as ue, a as de, g as fe, i as pe, k as me, n as he, o as ge, s as _e, u as ve, v as ye, w as be, z as xe } from "./compile-application-
|
|
6
|
+
import { Bt as r, Dt as i, E as a, Ht as o, L as s, Lt as c, Mt as l, Rt as u, St as d, W as f, Z as p, bt as m, c as h, h as g, ot as _, rt as v, t as y } from "./get-front-component-build-plugins-CnwC-jU8.mjs";
|
|
7
|
+
import { B as b, C as ee, D as te, E as ne, F as x, N as re, O as ie, P as ae, R as oe, S as se, T as ce, U as S, V as le, _ as ue, a as de, g as fe, i as pe, k as me, n as he, o as ge, s as _e, u as ve, v as ye, w as be, z as xe } from "./compile-application-CU3rJlps.mjs";
|
|
8
8
|
import { t as C } from "./isDefined-Dtu5EYqP-CX5uLGda.mjs";
|
|
9
|
-
import { $ as Se, A as Ce, C as we, D as Te, E as w, F as Ee, G as De, H as Oe, J as ke, K as Ae, L as je, M as Me, N as Ne, O as Pe, Q as Fe, R as Ie, S as Le, T as Re, U as ze, V as Be, W as Ve, X as He, Y as Ue, Z as T, _ as We, a as Ge, b as Ke, c as qe, d as Je, et as Ye, f as Xe, g as Ze, h as Qe, i as $e, j as et, k as tt, l as nt, m as rt, n as it, nt as at, o as ot, p as st, q as ct, s as lt, t as ut, u as E, v as dt, w as ft, x as pt, y as mt } from "./login-
|
|
10
|
-
import { t as ht } from "./package-
|
|
9
|
+
import { $ as Se, A as Ce, C as we, D as Te, E as w, F as Ee, G as De, H as Oe, J as ke, K as Ae, L as je, M as Me, N as Ne, O as Pe, Q as Fe, R as Ie, S as Le, T as Re, U as ze, V as Be, W as Ve, X as He, Y as Ue, Z as T, _ as We, a as Ge, b as Ke, c as qe, d as Je, et as Ye, f as Xe, g as Ze, h as Qe, i as $e, j as et, k as tt, l as nt, m as rt, n as it, nt as at, o as ot, p as st, q as ct, s as lt, t as ut, u as E, v as dt, w as ft, x as pt, y as mt } from "./login-CNV69o8l.mjs";
|
|
10
|
+
import { t as ht } from "./package-CEEl5qZD.mjs";
|
|
11
11
|
import gt, { dirname as _t, join as D, relative as vt } from "path";
|
|
12
12
|
import { isNonEmptyArray as yt } from "@sniptt/guards";
|
|
13
13
|
import { v4 as O } from "uuid";
|
|
@@ -3474,8 +3474,8 @@ var F = (e) => e && !e?.startsWith("/") ? D(S, e) : e, Lt = async (e) => {
|
|
|
3474
3474
|
});
|
|
3475
3475
|
}, Qt = (e) => e.map(({ name: e, description: t, isSecret: n }) => ` ${e}: {\n description: ${JSON.stringify(t)},\n isSecret: ${n},\n isRequired: true,\n },`).join("\n"), $t = (e, t) => `serverVariables: {\n${e.map(({ name: e, description: n, isSecret: r }) => `${t} ${e}: {\n${t} description: ${JSON.stringify(n)},\n${t} isSecret: ${r},\n${t} isRequired: true,\n${t} },`).join("\n")}\n${t}},`, en = ({ data: e }) => {
|
|
3476
3476
|
let t = O(), n = e.description ? `\n description: '${e.description}',` : "";
|
|
3477
|
-
if (e.type ===
|
|
3478
|
-
let r = e.onDelete && e.onDelete !== "None", i = `import { defineField, FieldType, RelationType${r ? ", OnDeleteAction" : ""} } from 'twenty-sdk/define';`, a = r ? `, onDelete: OnDeleteAction.${e.onDelete}` : "", o = e.relationType ===
|
|
3477
|
+
if (e.type === u.RELATION || e.type === u.MORPH_RELATION) {
|
|
3478
|
+
let r = e.onDelete && e.onDelete !== "None", i = `import { defineField, FieldType, RelationType${r ? ", OnDeleteAction" : ""} } from 'twenty-sdk/define';`, a = r ? `, onDelete: OnDeleteAction.${e.onDelete}` : "", o = e.relationType === l.MANY_TO_ONE ? `, joinColumnName: '${e.name}Id'` : "", s = e.type === u.MORPH_RELATION ? `\n morphId: '${O()}',` : "";
|
|
3479
3479
|
return `${i}
|
|
3480
3480
|
|
|
3481
3481
|
export default defineField({
|
|
@@ -3486,7 +3486,7 @@ export default defineField({
|
|
|
3486
3486
|
objectUniversalIdentifier: '${e.objectUniversalIdentifier}',
|
|
3487
3487
|
relationTargetObjectMetadataUniversalIdentifier: '${e.relationTargetObjectMetadataUniversalIdentifier}',
|
|
3488
3488
|
relationTargetFieldMetadataUniversalIdentifier: '${e.relationTargetFieldMetadataUniversalIdentifier}',
|
|
3489
|
-
universalSettings: { relationType: RelationType.${e.relationType}${a}${o} },${
|
|
3489
|
+
universalSettings: { relationType: RelationType.${e.relationType}${a}${o} },${s}${n}
|
|
3490
3490
|
});
|
|
3491
3491
|
`;
|
|
3492
3492
|
}
|
|
@@ -3612,7 +3612,7 @@ export default defineCommandMenuItem({
|
|
|
3612
3612
|
availabilityType: 'GLOBAL',
|
|
3613
3613
|
});
|
|
3614
3614
|
`, sn = ({ name: e, type: t }) => {
|
|
3615
|
-
let n = t ===
|
|
3615
|
+
let n = t === i.DASHBOARD ? r.GRID : r.VERTICAL_LIST;
|
|
3616
3616
|
return `import {
|
|
3617
3617
|
definePageLayout,
|
|
3618
3618
|
PageLayoutTabLayoutMode,
|
|
@@ -3778,17 +3778,17 @@ export default defineSkill({
|
|
|
3778
3778
|
});
|
|
3779
3779
|
`;
|
|
3780
3780
|
}, dn = ({ field: e, index: t, objectUniversalIdentifier: n, applicationUniversalIdentifier: r }) => {
|
|
3781
|
-
let i = e.universalIdentifier ?? O(), a = e.position ?? t, o = e.isVisible ?? !0,
|
|
3781
|
+
let i = e.universalIdentifier ?? O(), a = e.position ?? t, o = e.isVisible ?? !0, c = e.size ?? 200;
|
|
3782
3782
|
return ` {
|
|
3783
3783
|
universalIdentifier: '${i}',
|
|
3784
|
-
${` fieldMetadataUniversalIdentifier: '${"defaultFieldName" in e ?
|
|
3784
|
+
${` fieldMetadataUniversalIdentifier: '${"defaultFieldName" in e ? s({
|
|
3785
3785
|
applicationUniversalIdentifier: r,
|
|
3786
3786
|
objectUniversalIdentifier: n,
|
|
3787
3787
|
name: e.defaultFieldName
|
|
3788
3788
|
}) : e.fieldMetadataUniversalIdentifier}'`},
|
|
3789
3789
|
position: ${a},
|
|
3790
3790
|
isVisible: ${o},
|
|
3791
|
-
size: ${
|
|
3791
|
+
size: ${c},
|
|
3792
3792
|
}`;
|
|
3793
3793
|
}, fn = ({ name: e, universalIdentifier: t = O(), objectUniversalIdentifier: n = "fill-later", applicationUniversalIdentifier: r, fields: i = [], type: a }) => {
|
|
3794
3794
|
let o = w(e), s = i.length > 0 ? ` fields: [
|
|
@@ -3805,7 +3805,7 @@ export default defineView({
|
|
|
3805
3805
|
universalIdentifier: '${t}',
|
|
3806
3806
|
name: '${o}',
|
|
3807
3807
|
objectUniversalIdentifier: '${n}',
|
|
3808
|
-
${a === void 0 ? "" : ` type: '${a}',\n`} icon: '${
|
|
3808
|
+
${a === void 0 ? "" : ` type: '${a}',\n`} icon: '${_[a ?? c.TABLE]}',
|
|
3809
3809
|
position: 0,
|
|
3810
3810
|
${s}
|
|
3811
3811
|
// filters: [
|
|
@@ -3865,18 +3865,18 @@ export default defineTimelineActivityType({
|
|
|
3865
3865
|
let { overwrite: e } = await this.handleFileExist();
|
|
3866
3866
|
if (!e) return;
|
|
3867
3867
|
}
|
|
3868
|
-
await k(c, s), console.log(A.green(`✓ Created ${i}:`), A.cyan(vt(S, c))), r ===
|
|
3868
|
+
await k(c, s), console.log(A.green(`✓ Created ${i}:`), A.cyan(vt(S, c))), r === h.Object && await this.promptAndCreateObjectCompanions({
|
|
3869
3869
|
objectName: o,
|
|
3870
3870
|
applicationUniversalIdentifier: n,
|
|
3871
3871
|
customPath: t
|
|
3872
|
-
}), r ===
|
|
3872
|
+
}), r === h.ConnectionProvider && await this.registerConnectionProviderServerVariables(o);
|
|
3873
3873
|
} catch (e) {
|
|
3874
3874
|
console.error(A.red("Add new entity failed:"), e instanceof Error ? e.message : e), process.exit(1);
|
|
3875
3875
|
}
|
|
3876
3876
|
}
|
|
3877
3877
|
async getEntityData(e, t) {
|
|
3878
3878
|
switch (e) {
|
|
3879
|
-
case
|
|
3879
|
+
case h.Object: {
|
|
3880
3880
|
let e = await this.getObjectData(), t = e.nameSingular, n = O(), r = O();
|
|
3881
3881
|
return this.lastObjectUniversalIdentifier = n, this.lastNameFieldUniversalIdentifier = r, this.lastObjectLabelSingular = e.labelSingular, {
|
|
3882
3882
|
name: t,
|
|
@@ -3888,7 +3888,7 @@ export default defineTimelineActivityType({
|
|
|
3888
3888
|
})
|
|
3889
3889
|
};
|
|
3890
3890
|
}
|
|
3891
|
-
case
|
|
3891
|
+
case h.Field: {
|
|
3892
3892
|
let e = await this.getFieldData(), t = e.name;
|
|
3893
3893
|
return {
|
|
3894
3894
|
name: t,
|
|
@@ -3898,49 +3898,49 @@ export default defineTimelineActivityType({
|
|
|
3898
3898
|
})
|
|
3899
3899
|
};
|
|
3900
3900
|
}
|
|
3901
|
-
case
|
|
3901
|
+
case h.LogicFunction: {
|
|
3902
3902
|
let t = await this.getEntityName(e);
|
|
3903
3903
|
return {
|
|
3904
3904
|
name: t,
|
|
3905
3905
|
file: nn({ name: t })
|
|
3906
3906
|
};
|
|
3907
3907
|
}
|
|
3908
|
-
case
|
|
3908
|
+
case h.FrontComponent: {
|
|
3909
3909
|
let t = await this.getEntityName(e);
|
|
3910
3910
|
return {
|
|
3911
3911
|
name: t,
|
|
3912
3912
|
file: tn({ name: t })
|
|
3913
3913
|
};
|
|
3914
3914
|
}
|
|
3915
|
-
case
|
|
3915
|
+
case h.Role: {
|
|
3916
3916
|
let t = await this.getEntityName(e);
|
|
3917
3917
|
return {
|
|
3918
3918
|
name: t,
|
|
3919
3919
|
file: L({ name: t })
|
|
3920
3920
|
};
|
|
3921
3921
|
}
|
|
3922
|
-
case
|
|
3922
|
+
case h.Skill: {
|
|
3923
3923
|
let t = await this.getEntityName(e);
|
|
3924
3924
|
return {
|
|
3925
3925
|
name: t,
|
|
3926
3926
|
file: un({ name: t })
|
|
3927
3927
|
};
|
|
3928
3928
|
}
|
|
3929
|
-
case
|
|
3929
|
+
case h.Agent: {
|
|
3930
3930
|
let t = await this.getEntityName(e);
|
|
3931
3931
|
return {
|
|
3932
3932
|
name: t,
|
|
3933
3933
|
file: R({ name: t })
|
|
3934
3934
|
};
|
|
3935
3935
|
}
|
|
3936
|
-
case
|
|
3936
|
+
case h.ConnectionProvider: {
|
|
3937
3937
|
let t = await this.getEntityName(e);
|
|
3938
3938
|
return {
|
|
3939
3939
|
name: t,
|
|
3940
3940
|
file: z({ name: t })
|
|
3941
3941
|
};
|
|
3942
3942
|
}
|
|
3943
|
-
case
|
|
3943
|
+
case h.View: {
|
|
3944
3944
|
let e = await this.getViewData(), n = e.name;
|
|
3945
3945
|
return {
|
|
3946
3946
|
name: n,
|
|
@@ -3951,23 +3951,23 @@ export default defineTimelineActivityType({
|
|
|
3951
3951
|
})
|
|
3952
3952
|
};
|
|
3953
3953
|
}
|
|
3954
|
-
case
|
|
3954
|
+
case h.ViewField: return {
|
|
3955
3955
|
name: await this.getEntityName(e),
|
|
3956
3956
|
file: pn({})
|
|
3957
3957
|
};
|
|
3958
|
-
case
|
|
3958
|
+
case h.NavigationMenuItem: {
|
|
3959
3959
|
let t = await this.getEntityName(e);
|
|
3960
3960
|
return {
|
|
3961
3961
|
name: t,
|
|
3962
3962
|
file: rn({ name: t })
|
|
3963
3963
|
};
|
|
3964
3964
|
}
|
|
3965
|
-
case
|
|
3965
|
+
case h.PageLayout: {
|
|
3966
3966
|
let t = await this.getEntityName(e), { type: n } = await j.prompt([{
|
|
3967
3967
|
type: "select",
|
|
3968
3968
|
name: "type",
|
|
3969
3969
|
message: "Select the page layout type:",
|
|
3970
|
-
choices: Object.values(
|
|
3970
|
+
choices: Object.values(i)
|
|
3971
3971
|
}]);
|
|
3972
3972
|
return {
|
|
3973
3973
|
name: t,
|
|
@@ -3977,42 +3977,42 @@ export default defineTimelineActivityType({
|
|
|
3977
3977
|
})
|
|
3978
3978
|
};
|
|
3979
3979
|
}
|
|
3980
|
-
case
|
|
3980
|
+
case h.PageLayoutTab: {
|
|
3981
3981
|
let t = await this.getEntityName(e);
|
|
3982
3982
|
return {
|
|
3983
3983
|
name: t,
|
|
3984
3984
|
file: I({ name: t })
|
|
3985
3985
|
};
|
|
3986
3986
|
}
|
|
3987
|
-
case
|
|
3987
|
+
case h.PageLayoutWidget: {
|
|
3988
3988
|
let t = await this.getEntityName(e);
|
|
3989
3989
|
return {
|
|
3990
3990
|
name: t,
|
|
3991
3991
|
file: cn({ name: t })
|
|
3992
3992
|
};
|
|
3993
3993
|
}
|
|
3994
|
-
case
|
|
3994
|
+
case h.CommandMenuItem: {
|
|
3995
3995
|
let t = await this.getEntityName(e);
|
|
3996
3996
|
return {
|
|
3997
3997
|
name: t,
|
|
3998
3998
|
file: on({ name: t })
|
|
3999
3999
|
};
|
|
4000
4000
|
}
|
|
4001
|
-
case
|
|
4001
|
+
case h.TimelineActivityType: {
|
|
4002
4002
|
let t = await this.getEntityName(e);
|
|
4003
4003
|
return {
|
|
4004
4004
|
name: t,
|
|
4005
4005
|
file: hn({ name: t })
|
|
4006
4006
|
};
|
|
4007
4007
|
}
|
|
4008
|
-
case
|
|
4008
|
+
case h.SettingsMenuItem: {
|
|
4009
4009
|
let t = await this.getEntityName(e);
|
|
4010
4010
|
return {
|
|
4011
4011
|
name: t,
|
|
4012
4012
|
file: mn({ name: t })
|
|
4013
4013
|
};
|
|
4014
4014
|
}
|
|
4015
|
-
default:
|
|
4015
|
+
default: f(e);
|
|
4016
4016
|
}
|
|
4017
4017
|
}
|
|
4018
4018
|
async promptAndCreateObjectCompanions({ objectName: e, applicationUniversalIdentifier: t, customPath: n }) {
|
|
@@ -4034,44 +4034,44 @@ export default defineTimelineActivityType({
|
|
|
4034
4034
|
isVisible: !0,
|
|
4035
4035
|
size: 200
|
|
4036
4036
|
}] : []
|
|
4037
|
-
}), s = n ? D(S, n) : D(S, B, this.getFolderName(
|
|
4037
|
+
}), s = n ? D(S, n) : D(S, B, this.getFolderName(h.View));
|
|
4038
4038
|
await x(s);
|
|
4039
|
-
let
|
|
4040
|
-
if (await oe(
|
|
4039
|
+
let l = D(s, `all-${w(e)}.ts`);
|
|
4040
|
+
if (await oe(l)) {
|
|
4041
4041
|
let { overwrite: e } = await this.handleFileExist();
|
|
4042
4042
|
if (!e) return;
|
|
4043
4043
|
}
|
|
4044
|
-
await k(
|
|
4045
|
-
let
|
|
4044
|
+
await k(l, o), console.log(A.green("✓ Created view:"), A.cyan(vt(S, l)));
|
|
4045
|
+
let u = this.buildRecordPageFieldsViewFields(this.lastNameFieldUniversalIdentifier), d = fn({
|
|
4046
4046
|
name: `${w(e)}-record-page-fields`,
|
|
4047
4047
|
universalIdentifier: a,
|
|
4048
4048
|
objectUniversalIdentifier: this.lastObjectUniversalIdentifier,
|
|
4049
4049
|
applicationUniversalIdentifier: t,
|
|
4050
|
-
type:
|
|
4051
|
-
fields:
|
|
4052
|
-
}),
|
|
4053
|
-
if (await oe(
|
|
4050
|
+
type: c.FIELDS_WIDGET,
|
|
4051
|
+
fields: u
|
|
4052
|
+
}), f = D(s, `${w(e)}-record-page-fields.ts`);
|
|
4053
|
+
if (await oe(f)) {
|
|
4054
4054
|
let { overwrite: e } = await this.handleFileExist();
|
|
4055
4055
|
if (!e) return;
|
|
4056
4056
|
}
|
|
4057
|
-
await k(
|
|
4058
|
-
let
|
|
4057
|
+
await k(f, d), console.log(A.green("✓ Created record-page-fields view:"), A.cyan(vt(S, f)));
|
|
4058
|
+
let p = rn({
|
|
4059
4059
|
name: e,
|
|
4060
4060
|
type: "OBJECT",
|
|
4061
4061
|
targetObjectUniversalIdentifier: this.lastObjectUniversalIdentifier
|
|
4062
|
-
}),
|
|
4063
|
-
await x(
|
|
4064
|
-
let g = D(
|
|
4062
|
+
}), m = n ? D(S, n) : D(S, B, this.getFolderName(h.NavigationMenuItem));
|
|
4063
|
+
await x(m);
|
|
4064
|
+
let g = D(m, `${w(e)}.ts`);
|
|
4065
4065
|
if (await oe(g)) {
|
|
4066
4066
|
let { overwrite: e } = await this.handleFileExist();
|
|
4067
4067
|
if (!e) return;
|
|
4068
4068
|
}
|
|
4069
|
-
await k(g,
|
|
4069
|
+
await k(g, p), console.log(A.green("✓ Created navigation menu item:"), A.cyan(vt(S, g)));
|
|
4070
4070
|
let _ = ln({
|
|
4071
4071
|
objectLabelSingular: this.lastObjectLabelSingular ?? e,
|
|
4072
4072
|
objectUniversalIdentifier: this.lastObjectUniversalIdentifier,
|
|
4073
4073
|
fieldsWidgetViewUniversalIdentifier: a
|
|
4074
|
-
}), v = n ? D(S, n) : D(S, B, this.getFolderName(
|
|
4074
|
+
}), v = n ? D(S, n) : D(S, B, this.getFolderName(h.PageLayout));
|
|
4075
4075
|
await x(v);
|
|
4076
4076
|
let y = D(v, `${w(e)}-record-page-layout.ts`);
|
|
4077
4077
|
if (await oe(y)) {
|
|
@@ -4133,7 +4133,7 @@ export default defineTimelineActivityType({
|
|
|
4133
4133
|
name: "entity",
|
|
4134
4134
|
message: "What entity do you want to create?",
|
|
4135
4135
|
default: "",
|
|
4136
|
-
choices: Object.values(
|
|
4136
|
+
choices: Object.values(h)
|
|
4137
4137
|
}]);
|
|
4138
4138
|
return e;
|
|
4139
4139
|
}
|
|
@@ -4156,7 +4156,7 @@ export default defineTimelineActivityType({
|
|
|
4156
4156
|
return t;
|
|
4157
4157
|
}
|
|
4158
4158
|
async getFieldData() {
|
|
4159
|
-
let e = (e) => e ===
|
|
4159
|
+
let e = (e) => e === u.RELATION || e === u.MORPH_RELATION;
|
|
4160
4160
|
return j.prompt([
|
|
4161
4161
|
{
|
|
4162
4162
|
type: "input",
|
|
@@ -4176,8 +4176,8 @@ export default defineTimelineActivityType({
|
|
|
4176
4176
|
type: "select",
|
|
4177
4177
|
name: "type",
|
|
4178
4178
|
message: "Select the field type:",
|
|
4179
|
-
choices: Object.values(
|
|
4180
|
-
default:
|
|
4179
|
+
choices: Object.values(u),
|
|
4180
|
+
default: u.TEXT
|
|
4181
4181
|
},
|
|
4182
4182
|
{
|
|
4183
4183
|
type: "input",
|
|
@@ -4212,16 +4212,16 @@ export default defineTimelineActivityType({
|
|
|
4212
4212
|
type: "select",
|
|
4213
4213
|
name: "relationType",
|
|
4214
4214
|
message: "Select the relation type:",
|
|
4215
|
-
choices: Object.values(
|
|
4216
|
-
default:
|
|
4215
|
+
choices: Object.values(l),
|
|
4216
|
+
default: l.ONE_TO_MANY,
|
|
4217
4217
|
when: (t) => e(t.type)
|
|
4218
4218
|
},
|
|
4219
4219
|
{
|
|
4220
4220
|
type: "select",
|
|
4221
4221
|
name: "onDelete",
|
|
4222
4222
|
message: "Select the onDelete behavior:",
|
|
4223
|
-
choices: Object.values(
|
|
4224
|
-
default:
|
|
4223
|
+
choices: Object.values(m),
|
|
4224
|
+
default: m.CASCADE,
|
|
4225
4225
|
when: (t) => e(t.type)
|
|
4226
4226
|
}
|
|
4227
4227
|
]);
|
|
@@ -4278,7 +4278,7 @@ export default defineTimelineActivityType({
|
|
|
4278
4278
|
}
|
|
4279
4279
|
getFileName(e, t) {
|
|
4280
4280
|
switch (t) {
|
|
4281
|
-
case
|
|
4281
|
+
case h.FrontComponent: return `${w(e)}.tsx`;
|
|
4282
4282
|
default: return `${w(e)}.ts`;
|
|
4283
4283
|
}
|
|
4284
4284
|
}
|
|
@@ -4436,7 +4436,7 @@ export default defineTimelineActivityType({
|
|
|
4436
4436
|
}
|
|
4437
4437
|
}), e.command("catalog-sync", { hidden: !0 }).option("-r, --remote <name>", "Sync on a specific remote").action(async (e) => {
|
|
4438
4438
|
Sn("catalog-sync", "dev:catalog-sync");
|
|
4439
|
-
let { CatalogSyncCommand: t } = await import("./catalog-sync-
|
|
4439
|
+
let { CatalogSyncCommand: t } = await import("./catalog-sync-Z1uWs5Ge.mjs");
|
|
4440
4440
|
await new t().execute({ remote: e.remote });
|
|
4441
4441
|
});
|
|
4442
4442
|
}, wn = class {
|
|
@@ -4569,9 +4569,9 @@ export default defineTimelineActivityType({
|
|
|
4569
4569
|
await this.watcher?.close();
|
|
4570
4570
|
}
|
|
4571
4571
|
async copyAndNotify(e) {
|
|
4572
|
-
let t = vt(this.appPath, e), n = D(
|
|
4572
|
+
let t = vt(this.appPath, e), n = D(a, t), r = D(this.appPath, n);
|
|
4573
4573
|
await x(_t(r)), await re(e, r);
|
|
4574
|
-
let
|
|
4574
|
+
let i = await Et(r), o = Tt.createHash("md5").update(i).digest("hex");
|
|
4575
4575
|
this.handleFileBuilt({
|
|
4576
4576
|
fileFolder: this.fileFolder,
|
|
4577
4577
|
builtPath: n,
|
|
@@ -4580,7 +4580,7 @@ export default defineTimelineActivityType({
|
|
|
4580
4580
|
});
|
|
4581
4581
|
}
|
|
4582
4582
|
async handleUnlink(e) {
|
|
4583
|
-
let t = D(
|
|
4583
|
+
let t = D(a, vt(this.appPath, e));
|
|
4584
4584
|
await b(D(this.appPath, t));
|
|
4585
4585
|
}
|
|
4586
4586
|
}, kn = ["package.json", "yarn.lock"], An = class {
|
|
@@ -4602,11 +4602,11 @@ export default defineTimelineActivityType({
|
|
|
4602
4602
|
handleBuildError: this.handleBuildError,
|
|
4603
4603
|
config: {
|
|
4604
4604
|
externalModules: ee,
|
|
4605
|
-
fileFolder:
|
|
4605
|
+
fileFolder: d.BuiltFrontComponent,
|
|
4606
4606
|
jsx: "automatic",
|
|
4607
4607
|
extraPlugins: [
|
|
4608
4608
|
ne(this.appPath, this.shouldSkipTypecheck),
|
|
4609
|
-
...
|
|
4609
|
+
...y({ getSharedDependenciesBuildContext: () => this.sharedDependenciesBuildContext }),
|
|
4610
4610
|
me()
|
|
4611
4611
|
]
|
|
4612
4612
|
}
|
|
@@ -4752,7 +4752,7 @@ export default defineTimelineActivityType({
|
|
|
4752
4752
|
}
|
|
4753
4753
|
}), this.watcher.on("all", (e, t) => {
|
|
4754
4754
|
if (e === "addDir" || e === "unlinkDir") return;
|
|
4755
|
-
let n = vt(this.appPath, t), r = n.startsWith(
|
|
4755
|
+
let n = vt(this.appPath, t), r = n.startsWith(g), i = ["package.json", "yarn.lock"].includes(n);
|
|
4756
4756
|
!(n.endsWith(".ts") || n.endsWith(".tsx")) && !r && !i || this.handleChangeDetected(n, e);
|
|
4757
4757
|
});
|
|
4758
4758
|
}
|
|
@@ -4848,15 +4848,15 @@ export default defineTimelineActivityType({
|
|
|
4848
4848
|
async startAssetWatcher() {
|
|
4849
4849
|
this.assetWatcher = new On({
|
|
4850
4850
|
appPath: this.state.appPath,
|
|
4851
|
-
fileFolder:
|
|
4852
|
-
watchPaths: [
|
|
4851
|
+
fileFolder: d.PublicAsset,
|
|
4852
|
+
watchPaths: [g],
|
|
4853
4853
|
handleFileBuilt: this.handleFileBuilt.bind(this)
|
|
4854
4854
|
}), await this.assetWatcher.start();
|
|
4855
4855
|
}
|
|
4856
4856
|
async startDependencyWatcher() {
|
|
4857
4857
|
this.dependencyWatcher = new On({
|
|
4858
4858
|
appPath: this.state.appPath,
|
|
4859
|
-
fileFolder:
|
|
4859
|
+
fileFolder: d.Dependencies,
|
|
4860
4860
|
watchPaths: ["package.json", "yarn.lock"],
|
|
4861
4861
|
handleFileBuilt: (e) => {
|
|
4862
4862
|
this.handleDependencyFileBuilt(e);
|
|
@@ -5154,7 +5154,7 @@ export default defineTimelineActivityType({
|
|
|
5154
5154
|
}
|
|
5155
5155
|
async start() {
|
|
5156
5156
|
this.isClosed = !1;
|
|
5157
|
-
let e = gt.join(this.state.appPath,
|
|
5157
|
+
let e = gt.join(this.state.appPath, a);
|
|
5158
5158
|
await x(e), await ae(e), this.state.addEvent({
|
|
5159
5159
|
message: `Using remote "${T.getActiveRemote()}"`,
|
|
5160
5160
|
status: "info"
|
|
@@ -5243,22 +5243,22 @@ export default defineTimelineActivityType({
|
|
|
5243
5243
|
}), !0;
|
|
5244
5244
|
}
|
|
5245
5245
|
}, Hn = {
|
|
5246
|
-
objects:
|
|
5247
|
-
fields:
|
|
5248
|
-
logicFunctions:
|
|
5249
|
-
frontComponents:
|
|
5250
|
-
roles:
|
|
5251
|
-
skills:
|
|
5252
|
-
connectionProviders:
|
|
5253
|
-
views:
|
|
5254
|
-
viewFields:
|
|
5255
|
-
navigationMenuItems:
|
|
5256
|
-
pageLayouts:
|
|
5257
|
-
pageLayoutTabs:
|
|
5258
|
-
pageLayoutWidgets:
|
|
5259
|
-
commandMenuItems:
|
|
5260
|
-
timelineActivityTypes:
|
|
5261
|
-
settingsMenuItems:
|
|
5246
|
+
objects: h.Object,
|
|
5247
|
+
fields: h.Field,
|
|
5248
|
+
logicFunctions: h.LogicFunction,
|
|
5249
|
+
frontComponents: h.FrontComponent,
|
|
5250
|
+
roles: h.Role,
|
|
5251
|
+
skills: h.Skill,
|
|
5252
|
+
connectionProviders: h.ConnectionProvider,
|
|
5253
|
+
views: h.View,
|
|
5254
|
+
viewFields: h.ViewField,
|
|
5255
|
+
navigationMenuItems: h.NavigationMenuItem,
|
|
5256
|
+
pageLayouts: h.PageLayout,
|
|
5257
|
+
pageLayoutTabs: h.PageLayoutTab,
|
|
5258
|
+
pageLayoutWidgets: h.PageLayoutWidget,
|
|
5259
|
+
commandMenuItems: h.CommandMenuItem,
|
|
5260
|
+
timelineActivityTypes: h.TimelineActivityType,
|
|
5261
|
+
settingsMenuItems: h.SettingsMenuItem
|
|
5262
5262
|
}, Un = 200, Wn = {
|
|
5263
5263
|
pending: [
|
|
5264
5264
|
"building",
|
|
@@ -5478,23 +5478,23 @@ export default defineTimelineActivityType({
|
|
|
5478
5478
|
"↑",
|
|
5479
5479
|
"⇡"
|
|
5480
5480
|
], $n = {
|
|
5481
|
-
[
|
|
5482
|
-
[
|
|
5483
|
-
[
|
|
5484
|
-
[
|
|
5485
|
-
[
|
|
5486
|
-
[
|
|
5487
|
-
[
|
|
5488
|
-
[
|
|
5489
|
-
[
|
|
5490
|
-
[
|
|
5491
|
-
[
|
|
5492
|
-
[
|
|
5493
|
-
[
|
|
5494
|
-
[
|
|
5495
|
-
[
|
|
5496
|
-
[
|
|
5497
|
-
[
|
|
5481
|
+
[h.Object]: "Objects",
|
|
5482
|
+
[h.Field]: "Fields",
|
|
5483
|
+
[h.LogicFunction]: "Logic functions",
|
|
5484
|
+
[h.FrontComponent]: "Front components",
|
|
5485
|
+
[h.CommandMenuItem]: "Command menu items",
|
|
5486
|
+
[h.Role]: "Roles",
|
|
5487
|
+
[h.Skill]: "Skills",
|
|
5488
|
+
[h.View]: "Views",
|
|
5489
|
+
[h.ViewField]: "View fields",
|
|
5490
|
+
[h.NavigationMenuItem]: "Navigation menu items",
|
|
5491
|
+
[h.PageLayout]: "Page layouts",
|
|
5492
|
+
[h.PageLayoutTab]: "Page layout tabs",
|
|
5493
|
+
[h.PageLayoutWidget]: "Page layout widgets",
|
|
5494
|
+
[h.Agent]: "Agents",
|
|
5495
|
+
[h.ConnectionProvider]: "Connection providers",
|
|
5496
|
+
[h.TimelineActivityType]: "Timeline activity types",
|
|
5497
|
+
[h.SettingsMenuItem]: "Settings menu items"
|
|
5498
5498
|
}, er = Object.keys($n), tr = {
|
|
5499
5499
|
info: "gray",
|
|
5500
5500
|
success: "green",
|
|
@@ -6171,10 +6171,10 @@ export default defineTimelineActivityType({
|
|
|
6171
6171
|
sourceCount: i.length,
|
|
6172
6172
|
updatedLocaleFiles: o
|
|
6173
6173
|
};
|
|
6174
|
-
}, qr = (e) => Object.prototype.hasOwnProperty.call(
|
|
6174
|
+
}, qr = (e) => Object.prototype.hasOwnProperty.call(v, e), Jr = class {
|
|
6175
6175
|
async execute(e) {
|
|
6176
6176
|
let t = e.appPath ?? S, n;
|
|
6177
|
-
e.locale !== void 0 && ((e.locale === "en" || !qr(e.locale)) && (console.error(A.red(`"${e.locale}" is not a supported target locale. Choose one of: ${Object.keys(
|
|
6177
|
+
e.locale !== void 0 && ((e.locale === "en" || !qr(e.locale)) && (console.error(A.red(`"${e.locale}" is not a supported target locale. Choose one of: ${Object.keys(v).filter((e) => e !== "en").join(", ")}`)), process.exit(1)), n = e.locale), console.log(A.blue("Extracting translatable strings..."));
|
|
6178
6178
|
let r = await ge(t);
|
|
6179
6179
|
r.success || (console.error(A.red(r.errors.join("\n"))), process.exit(1)), r.warnings.length > 0 && console.warn(A.yellow(r.warnings.join("\n")));
|
|
6180
6180
|
let i = r.filePaths.frontComponents.map((e) => gt.join(t, e)), { sourceCount: a, updatedLocaleFiles: o } = await Kr({
|
|
@@ -6235,10 +6235,10 @@ export default defineTimelineActivityType({
|
|
|
6235
6235
|
});
|
|
6236
6236
|
}), e.command("dev:typecheck [appPath]").description("Run TypeScript type checking").action(async (e) => {
|
|
6237
6237
|
await a.execute({ appPath: F(e) });
|
|
6238
|
-
}), e.command("dev:add [entityType]").description(`Scaffold a new entity (${Object.values(
|
|
6238
|
+
}), e.command("dev:add [entityType]").description(`Scaffold a new entity (${Object.values(h).join("|")})`).option("--path <path>", "Path in which the entity should be created.").action(async (e, t) => {
|
|
6239
6239
|
await o.execute(e, t?.path);
|
|
6240
6240
|
}), e.command("dev:catalog-sync").description("Trigger marketplace catalog sync").option("-r, --remote <name>", "Sync on a specific remote").action(async (e) => {
|
|
6241
|
-
let { CatalogSyncCommand: t } = await import("./catalog-sync-
|
|
6241
|
+
let { CatalogSyncCommand: t } = await import("./catalog-sync-Z1uWs5Ge.mjs");
|
|
6242
6242
|
await new t().execute({ remote: e.remote });
|
|
6243
6243
|
}), e.command("dev:generate-client [appPath]").description("Generate the typed API client for the built app from the active remote").action(async (e) => {
|
|
6244
6244
|
await s.execute({ appPath: F(e) });
|
|
@@ -6325,7 +6325,7 @@ export default defineTimelineActivityType({
|
|
|
6325
6325
|
n("upgrade", "docker:upgrade"), await ti(e, t);
|
|
6326
6326
|
}), t.command("catalog-sync").option("-r, --remote <name>", "Sync on a specific remote").action(async (e) => {
|
|
6327
6327
|
n("catalog-sync", "dev:catalog-sync");
|
|
6328
|
-
let { CatalogSyncCommand: t } = await import("./catalog-sync-
|
|
6328
|
+
let { CatalogSyncCommand: t } = await import("./catalog-sync-Z1uWs5Ge.mjs");
|
|
6329
6329
|
await new t().execute({ remote: e.remote });
|
|
6330
6330
|
});
|
|
6331
6331
|
}, ri = /^(\d{1,3}\.){3}\d{1,3}$/, ii = (e) => {
|
|
@@ -6364,10 +6364,10 @@ export default defineTimelineActivityType({
|
|
|
6364
6364
|
return;
|
|
6365
6365
|
}
|
|
6366
6366
|
let i = e.url ?? e.apiUrl;
|
|
6367
|
-
if (i) i =
|
|
6367
|
+
if (i) i = p(i);
|
|
6368
6368
|
else {
|
|
6369
6369
|
let t = await we();
|
|
6370
|
-
e.local ? (t || (console.error(A.red("No local Twenty server found.\nStart one with: yarn twenty docker:start")), process.exit(1)), console.log(A.gray(`Found local server at ${t}`)), i = t) : i =
|
|
6370
|
+
e.local ? (t || (console.error(A.red("No local Twenty server found.\nStart one with: yarn twenty docker:start")), process.exit(1)), console.log(A.gray(`Found local server at ${t}`)), i = t) : i = p((await j.prompt([{
|
|
6371
6371
|
type: "input",
|
|
6372
6372
|
name: "serverUrl",
|
|
6373
6373
|
message: "Twenty server URL:",
|
|
@@ -6380,10 +6380,10 @@ export default defineTimelineActivityType({
|
|
|
6380
6380
|
}
|
|
6381
6381
|
}])).serverUrl);
|
|
6382
6382
|
}
|
|
6383
|
-
let
|
|
6384
|
-
T.setActiveRemote(
|
|
6385
|
-
let
|
|
6386
|
-
console.log(A.green(`✓ Remote "${
|
|
6383
|
+
let a = e.as ?? ii(i);
|
|
6384
|
+
T.setActiveRemote(a);
|
|
6385
|
+
let o = await ai(i, e.apiKey);
|
|
6386
|
+
console.log(A.green(`✓ Remote "${a}" added (${i}) via ${o}.`)), await n.setDefaultRemote(a), console.log(A.green(`✓ Default remote set to "${a}".`));
|
|
6387
6387
|
}, ci = async () => {
|
|
6388
6388
|
let e = new T(), t = await e.getRemotes(), n = await e.getDefaultRemote();
|
|
6389
6389
|
if (t.length === 0) {
|