twenty-sdk 0.5.2 → 0.6.0-alpha
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/README.md +2 -0
- package/dist/{AllIcons-CGPKtPQS-sO2O4z-k.js → AllIcons-CGPKtPQS-BLFCKgx3.js} +3793 -3798
- package/dist/{AllIcons-CGPKtPQS-C-ZFgy8B.mjs → AllIcons-CGPKtPQS-Djzg3SXS.mjs} +5806 -5814
- package/dist/{isValidCountryCode-ujmwsK7z-DwSvvT1u.js → HtmlTagToRemoteComponent-CSfU1Ai0.js} +12 -12
- package/dist/{isValidCountryCode-ujmwsK7z-B8kSH7O8.mjs → HtmlTagToRemoteComponent-_7-Er-Nj.mjs} +1612 -1465
- package/dist/cli/commands/app/app-uninstall.d.ts +2 -2
- package/dist/cli/commands/app-command.d.ts +1 -1
- package/dist/cli/commands/logic-function/logic-function-execute.d.ts +1 -1
- package/dist/cli/commands/logic-function/logic-function-logs.d.ts +1 -1
- package/dist/cli/utilities/api/api-service.d.ts +6 -6
- package/dist/cli/utilities/build/common/esbuild-result-processor.d.ts +2 -2
- package/dist/cli/utilities/build/common/esbuild-watcher.d.ts +2 -2
- package/dist/cli/utilities/build/common/file-upload-watcher.d.ts +1 -1
- package/dist/cli/utilities/build/common/front-component-build/react-globals-plugin.d.ts +1 -1
- package/dist/cli/utilities/build/common/front-component-build/twenty-sdk-globals-plugin.d.ts +1 -1
- package/dist/cli/utilities/build/common/front-component-build/twenty-sdk-ui-globals-plugin.d.ts +1 -1
- package/dist/cli/utilities/build/common/front-component-build/twenty-shared-globals-plugin.d.ts +1 -1
- package/dist/cli/utilities/build/common/front-component-build/utils/extract-names-from-import-specifier.d.ts +1 -1
- package/dist/cli/utilities/build/common/restartable-watcher-interface.d.ts +2 -2
- package/dist/cli/utilities/build/manifest/manifest-build.d.ts +2 -2
- package/dist/cli/utilities/build/manifest/manifest-extract-config-from-file.d.ts +1 -1
- package/dist/cli/utilities/build/manifest/manifest-update-checksums.d.ts +2 -2
- package/dist/cli/utilities/build/manifest/manifest-validate.d.ts +1 -1
- package/dist/cli/utilities/build/manifest/manifest-writer.d.ts +1 -1
- package/dist/cli/utilities/dev/dev-mode-orchestrator.d.ts +6 -6
- package/dist/cli/utilities/dev/dev-ui-state-manager.d.ts +6 -6
- package/dist/cli/utilities/dev/dev-ui-state.d.ts +1 -1
- package/dist/cli/utilities/dev/dev-ui.d.ts +1 -1
- package/dist/cli/utilities/entity/entity-field-template.d.ts +2 -2
- package/dist/cli/utilities/entity/entity-front-component-template.d.ts +1 -1
- package/dist/cli/utilities/entity/entity-logic-function-template.d.ts +1 -1
- package/dist/cli/utilities/entity/entity-role-template.d.ts +1 -1
- package/dist/cli/utilities/file/file-jsonc.d.ts +1 -1
- package/dist/cli/utilities/file/file-path.d.ts +1 -1
- package/dist/cli/utilities/file/file-uploader.d.ts +3 -3
- package/dist/cli/utilities/typescript/typescript-diagnostics.d.ts +1 -1
- package/dist/cli/utilities/typescript/typescript-program.d.ts +1 -1
- package/dist/cli.cjs +29 -29
- package/dist/cli.mjs +463 -460
- package/dist/front-component-renderer/__stories__/FrontComponentRenderer.stories.d.ts +16 -0
- package/dist/front-component-renderer/__stories__/example-sources/chakra-example.front-component.d.ts +8 -0
- package/dist/front-component-renderer/__stories__/example-sources/emotion-example.front-component.d.ts +7 -0
- package/dist/{front-component/__stories__/mocks → front-component-renderer/__stories__/example-sources}/interactive.front-component.d.ts +1 -1
- package/dist/{front-component/__stories__/mocks → front-component-renderer/__stories__/example-sources}/lifecycle.front-component.d.ts +1 -1
- package/dist/front-component-renderer/__stories__/example-sources/mui-example.front-component.d.ts +7 -0
- package/dist/front-component-renderer/__stories__/example-sources/shadcn-example.front-component.d.ts +7 -0
- package/dist/{front-component/__stories__/mocks → front-component-renderer/__stories__/example-sources}/static.front-component.d.ts +1 -1
- package/dist/front-component-renderer/__stories__/example-sources/styled-components-example.front-component.d.ts +7 -0
- package/dist/front-component-renderer/__stories__/example-sources/tailwind-example.front-component.d.ts +7 -0
- package/dist/front-component-renderer/__stories__/example-sources/twenty-ui-example.front-component.d.ts +7 -0
- package/dist/front-component-renderer/__stories__/utils/getBuiltStoryComponentPathForRender.d.ts +1 -0
- package/dist/front-component-renderer/host/components/FrontComponentRenderer.d.ts +14 -0
- package/dist/front-component-renderer/index.cjs +25 -0
- package/dist/{front-component → front-component-renderer}/index.d.ts +4 -4
- package/dist/front-component-renderer/index.mjs +12026 -0
- package/dist/front-component-renderer/remote/components/FrontComponentHostCommunicationApiEffect.d.ts +8 -0
- package/dist/front-component-renderer/remote/components/FrontComponentUpdateContextEffect.d.ts +10 -0
- package/dist/{front-component → front-component-renderer}/remote/components/FrontComponentWorkerEffect.d.ts +5 -4
- package/dist/front-component-renderer/remote/generated/remote-components.d.ts +43 -0
- package/dist/front-component-renderer/remote/generated/remote-elements.d.ts +187 -0
- package/dist/{front-component → front-component-renderer}/remote/mock/mock-front-component.d.ts +1 -1
- package/dist/front-component-renderer/remote/worker/remote-worker.d.ts +3 -0
- package/dist/front-component-renderer/remote/worker/utils/setWorkerEnv.d.ts +1 -0
- package/dist/{front-component → front-component-renderer}/types/FrontComponentHostCommunicationApi.d.ts +1 -1
- package/dist/{front-component → front-component-renderer}/types/HostToWorkerRenderContext.d.ts +2 -1
- package/dist/front-component-renderer/types/PropertySchema.d.ts +4 -0
- package/dist/{front-component → front-component-renderer}/types/WorkerExports.d.ts +3 -3
- package/dist/index-DX23sVyw.js +2415 -0
- package/dist/index-JB9QoBK0.mjs +33884 -0
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +15 -12
- package/dist/sdk/application/application-config.d.ts +1 -1
- package/dist/sdk/application/define-application.d.ts +2 -2
- package/dist/sdk/common/types/define-entity.type.d.ts +4 -4
- package/dist/sdk/common/utils/create-validation-result.d.ts +1 -1
- package/dist/sdk/define-front-component.d.ts +2 -2
- package/dist/sdk/fields/define-field.d.ts +2 -2
- package/dist/sdk/fields/validate-fields.d.ts +1 -1
- package/dist/sdk/front-component-api/constants/HtmlCommonProperties.d.ts +2 -0
- package/dist/sdk/front-component-api/context/frontComponentContext.d.ts +1 -1
- package/dist/sdk/front-component-api/functions/navigate.d.ts +1 -1
- package/dist/sdk/front-component-api/hooks/useFrontComponentExecutionContext.d.ts +1 -1
- package/dist/sdk/front-component-api/index.d.ts +7 -0
- package/dist/sdk/front-component-config.d.ts +1 -1
- package/dist/sdk/index.d.ts +6 -6
- package/dist/sdk/logic-functions/define-logic-function.d.ts +2 -2
- package/dist/sdk/logic-functions/logic-function-config.d.ts +1 -1
- package/dist/sdk/objects/define-object.d.ts +2 -2
- package/dist/sdk/roles/define-role.d.ts +2 -2
- package/dist/ui/index.cjs +1 -47
- package/dist/ui/index.mjs +682 -2401
- package/package.json +34 -12
- package/dist/HtmlTagToRemoteComponent-B6lQe_K8.js +0 -1
- package/dist/HtmlTagToRemoteComponent-DRdIf3GJ.mjs +0 -151
- package/dist/IconWorld-DynX4UYH.mjs +0 -3003
- package/dist/IconWorld-JYjJym3l.js +0 -1876
- package/dist/_commonjsHelpers-DKOUU3wS.js +0 -1
- package/dist/_commonjsHelpers-DaMA6jEr.mjs +0 -8
- package/dist/cli/utilities/build/common/front-component-build/utils/create-front-component-build-options.d.ts +0 -13
- package/dist/front-component/__stories__/FrontComponentRenderer.stories.d.ts +0 -9
- package/dist/front-component/__stories__/utils/buildMockComponents.d.ts +0 -1
- package/dist/front-component/__stories__/utils/loadBuiltComponent.d.ts +0 -1
- package/dist/front-component/host/components/FrontComponentRenderer.d.ts +0 -13
- package/dist/front-component/index.cjs +0 -1
- package/dist/front-component/index.mjs +0 -5736
- package/dist/front-component/remote/components/FrontComponentHostCommunicationApiEffect.d.ts +0 -8
- package/dist/front-component/remote/components/FrontComponentUpdateContextEffect.d.ts +0 -10
- package/dist/front-component/remote/generated/remote-components.d.ts +0 -299
- package/dist/front-component/remote/generated/remote-elements.d.ts +0 -3335
- package/dist/front-component/remote/worker/remote-worker.d.ts +0 -0
- package/dist/front-component/types/PropertySchema.d.ts +0 -4
- package/dist/index.d.ts +0 -1
- package/dist/navigation-_M4-TT0O.js +0 -503
- package/dist/navigation-udgao_jA.mjs +0 -30041
- package/dist/sdk/front-component-common/HtmlCommonProperties.d.ts +0 -2
- package/dist/sdk/front-component-common/index.d.ts +0 -7
- /package/dist/{front-component → front-component-renderer}/host/generated/host-component-registry.d.ts +0 -0
- /package/dist/{front-component → front-component-renderer}/host/generated/host-index.d.ts +0 -0
- /package/dist/{front-component → front-component-renderer}/remote/components/FrontComponentErrorEffect.d.ts +0 -0
- /package/dist/{front-component → front-component-renderer}/remote/generated/remote-index.d.ts +0 -0
- /package/dist/{front-component → front-component-renderer}/remote/utils/exposeGlobals.d.ts +0 -0
- /package/dist/{front-component/remote/worker → front-component-renderer/remote/worker/utils}/createRemoteWorker.d.ts +0 -0
- /package/dist/{front-component → front-component-renderer}/types/FrontComponentExecutionContext.d.ts +0 -0
- /package/dist/sdk/{front-component-common → front-component-api/constants}/AllowedHtmlElements.d.ts +0 -0
- /package/dist/sdk/{front-component-common → front-component-api/constants}/CommonHtmlEvents.d.ts +0 -0
- /package/dist/sdk/{front-component-common → front-component-api/constants}/EventToReact.d.ts +0 -0
- /package/dist/sdk/{front-component-common → front-component-api/constants}/HtmlTagToRemoteComponent.d.ts +0 -0
- /package/dist/sdk/{front-component-common → front-component-api/constants}/SerializedEventData.d.ts +0 -0
package/dist/cli.mjs
CHANGED
|
@@ -6,10 +6,10 @@ import * as Q from "fs-extra";
|
|
|
6
6
|
import { readFile as lm } from "fs-extra";
|
|
7
7
|
import du from "crypto";
|
|
8
8
|
import * as fm from "node:fs/promises";
|
|
9
|
-
import { T as Pn, l as
|
|
9
|
+
import { H as gu, T as Pn, N as Gt, l as mu, Z as Es, s as ou } from "./HtmlTagToRemoteComponent-_7-Er-Nj.mjs";
|
|
10
10
|
import { isNonEmptyString as hm } from "@sniptt/guards";
|
|
11
11
|
import pm from "lodash.camelcase";
|
|
12
|
-
import
|
|
12
|
+
import "react";
|
|
13
13
|
import * as Is from "fs/promises";
|
|
14
14
|
import * as vu from "esbuild";
|
|
15
15
|
import _u from "chokidar";
|
|
@@ -25,51 +25,54 @@ import { glob as yu } from "fast-glob";
|
|
|
25
25
|
import { jsx as ie, jsxs as ye, Fragment as ym } from "react/jsx-runtime";
|
|
26
26
|
import { generate as xm } from "@genql/cli";
|
|
27
27
|
import At from "inquirer";
|
|
28
|
-
import { c as Ht, g as Sm } from "./_commonjsHelpers-DaMA6jEr.mjs";
|
|
29
28
|
import { v4 as Vn } from "uuid";
|
|
30
|
-
import { Command as
|
|
31
|
-
import { inspect as
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
import { Command as Sm, CommanderError as Am } from "commander";
|
|
30
|
+
import { inspect as Em } from "util";
|
|
31
|
+
var Ht = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
32
|
+
function bm(l) {
|
|
33
|
+
return l && l.__esModule && Object.prototype.hasOwnProperty.call(l, "default") ? l.default : l;
|
|
34
|
+
}
|
|
35
|
+
const Cm = (l) => hm(l) ? l[0].toUpperCase() + l.slice(1) : "", Fm = (l) => Cm(pm(l)), Tm = (l) => typeof l == "object" && l !== null && !Array.isArray(l), bt = process.env.INIT_CWD || process.cwd(), Zn = (l) => l && !l?.startsWith("/") ? st(bt, l) : l, Im = async (l, a, i) => {
|
|
36
|
+
const f = new Set(i), g = a.filter((_) => !f.has(_));
|
|
34
37
|
for (const _ of g) {
|
|
35
|
-
const S = _.replace(/\.tsx?$/, ".mjs"), A = me.join(
|
|
38
|
+
const S = _.replace(/\.tsx?$/, ".mjs"), A = me.join(l, S), I = `${A}.map`;
|
|
36
39
|
await Q.remove(A), await Q.remove(I);
|
|
37
40
|
}
|
|
38
41
|
}, Rm = async ({
|
|
39
|
-
result:
|
|
42
|
+
result: l,
|
|
40
43
|
appPath: a,
|
|
41
44
|
fileFolder: i,
|
|
42
|
-
lastChecksums:
|
|
45
|
+
lastChecksums: f,
|
|
43
46
|
onFileBuilt: g
|
|
44
47
|
}) => {
|
|
45
|
-
const _ = Object.keys(
|
|
48
|
+
const _ = Object.keys(l.metafile?.outputs ?? {}).filter(
|
|
46
49
|
(S) => S.endsWith(".mjs")
|
|
47
50
|
);
|
|
48
51
|
for (const S of _) {
|
|
49
|
-
const A = me.resolve(S), I = me.relative(a, A), P =
|
|
50
|
-
|
|
52
|
+
const A = me.resolve(S), I = me.relative(a, A), P = l.metafile?.outputs?.[S]?.entryPoint || "", z = me.relative(a, P), G = await Q.readFile(A), j = du.createHash("md5").update(G).digest("hex");
|
|
53
|
+
f.get(I) !== j && (f.set(I, j), g && await g({
|
|
51
54
|
fileFolder: i,
|
|
52
55
|
builtPath: I,
|
|
53
56
|
sourcePath: z,
|
|
54
|
-
checksum:
|
|
57
|
+
checksum: j
|
|
55
58
|
}));
|
|
56
59
|
}
|
|
57
60
|
}, Pm = ["react-dom"], Om = "RemoteComponents", Lm = () => {
|
|
58
|
-
const
|
|
61
|
+
const l = Object.keys(gu).join(
|
|
59
62
|
"|"
|
|
60
63
|
);
|
|
61
64
|
return new RegExp(
|
|
62
|
-
`(<\\/?)\\b(${
|
|
65
|
+
`(<\\/?)\\b(${l})\\b(?=[\\s>\\/>])`,
|
|
63
66
|
"g"
|
|
64
67
|
);
|
|
65
|
-
}, Mm = Lm(), Um = (
|
|
68
|
+
}, Mm = Lm(), Um = (l) => l.replace(
|
|
66
69
|
Mm,
|
|
67
|
-
(a, i,
|
|
68
|
-
const g =
|
|
70
|
+
(a, i, f) => {
|
|
71
|
+
const g = gu[f];
|
|
69
72
|
return Pn(g) ? `${i}${Om}.${g}` : a;
|
|
70
73
|
}
|
|
71
|
-
), Nm = /import\s*\{\s*defineFrontComponent\s*\}\s*from\s*['"][^'"]+['"];?\n?/g, cu = /export\s+default\s+defineFrontComponent\s*\(\s*\{[^}]*component\s*:\s*(\w+)[^}]*\}\s*\)\s*;?/s, Wm = (
|
|
72
|
-
let a =
|
|
74
|
+
), Nm = /import\s*\{\s*defineFrontComponent\s*\}\s*from\s*['"][^'"]+['"];?\n?/g, cu = /export\s+default\s+defineFrontComponent\s*\(\s*\{[^}]*component\s*:\s*(\w+)[^}]*\}\s*\)\s*;?/s, Wm = (l) => {
|
|
75
|
+
let a = l.replace(
|
|
73
76
|
Nm,
|
|
74
77
|
""
|
|
75
78
|
);
|
|
@@ -77,27 +80,27 @@ const Cm = (f) => hm(f) ? f[0].toUpperCase() + f.slice(1) : "", Fm = (f) => Cm(p
|
|
|
77
80
|
cu
|
|
78
81
|
);
|
|
79
82
|
if (i) {
|
|
80
|
-
const
|
|
81
|
-
`export\\s+(const|function)\\s+${
|
|
83
|
+
const f = i[1], g = new RegExp(
|
|
84
|
+
`export\\s+(const|function)\\s+${f}\\b`
|
|
82
85
|
);
|
|
83
86
|
a = a.replace(
|
|
84
87
|
g,
|
|
85
|
-
`$1 ${
|
|
88
|
+
`$1 ${f}`
|
|
86
89
|
), a = a.replace(
|
|
87
90
|
cu,
|
|
88
|
-
`export default globalThis.jsx(${
|
|
91
|
+
`export default globalThis.jsx(${f}, {});`
|
|
89
92
|
);
|
|
90
93
|
}
|
|
91
94
|
return a;
|
|
92
95
|
}, Dm = {
|
|
93
96
|
name: "jsx-transform-to-remote-dom-worker-format-plugin",
|
|
94
|
-
setup: (
|
|
95
|
-
|
|
97
|
+
setup: (l) => {
|
|
98
|
+
l.onLoad(
|
|
96
99
|
{ filter: /\.tsx$/ },
|
|
97
100
|
async ({ path: a }) => {
|
|
98
101
|
try {
|
|
99
|
-
const i = await fm.readFile(a, "utf8"),
|
|
100
|
-
|
|
102
|
+
const i = await fm.readFile(a, "utf8"), f = Um(i), g = f !== i, _ = Wm(
|
|
103
|
+
f
|
|
101
104
|
);
|
|
102
105
|
return { contents: g ? `var RemoteComponents = globalThis.RemoteComponents;
|
|
103
106
|
${_}` : _, loader: "tsx" };
|
|
@@ -114,48 +117,48 @@ ${_}` : _, loader: "tsx" };
|
|
|
114
117
|
}
|
|
115
118
|
);
|
|
116
119
|
}
|
|
117
|
-
}, $m = /^(\w+)\s+as\s+(\w+)$/, Bm = (
|
|
118
|
-
const a =
|
|
120
|
+
}, $m = /^([\w$]+)\s+as\s+([\w$]+)$/, Bm = (l) => {
|
|
121
|
+
const a = l.trim(), i = a.match($m);
|
|
119
122
|
if (Pn(i)) {
|
|
120
|
-
const [,
|
|
121
|
-
return { originalName:
|
|
123
|
+
const [, f, g] = i;
|
|
124
|
+
return { originalName: f, aliasName: g };
|
|
122
125
|
}
|
|
123
126
|
return { originalName: a, aliasName: a };
|
|
124
|
-
}, km = (
|
|
127
|
+
}, km = (l) => l.split(",").map((a) => a.trim()).filter((a) => a.length > 0).filter((a) => !a.startsWith("type ")).map(
|
|
125
128
|
(a) => Bm(a).originalName
|
|
126
129
|
), Xr = ({
|
|
127
|
-
sourceContent:
|
|
130
|
+
sourceContent: l,
|
|
128
131
|
pattern: a
|
|
129
132
|
}) => {
|
|
130
133
|
const i = /* @__PURE__ */ new Map();
|
|
131
|
-
let
|
|
132
|
-
for (; Pn(
|
|
133
|
-
const g =
|
|
134
|
+
let f;
|
|
135
|
+
for (; Pn(f = a.exec(l)); ) {
|
|
136
|
+
const g = f.groups?.namedImports, _ = f.groups?.subPath ?? "";
|
|
134
137
|
i.has(_) || i.set(_, /* @__PURE__ */ new Set()), g && km(g).forEach(
|
|
135
138
|
(S) => i.get(_)?.add(S)
|
|
136
139
|
);
|
|
137
140
|
}
|
|
138
141
|
return a.lastIndex = 0, i;
|
|
139
|
-
}, Qr = (
|
|
140
|
-
const a =
|
|
142
|
+
}, Qr = (l) => {
|
|
143
|
+
const a = l.namespace ?? l.pluginName;
|
|
141
144
|
return {
|
|
142
|
-
name:
|
|
145
|
+
name: l.pluginName,
|
|
143
146
|
setup: (i) => {
|
|
144
|
-
const
|
|
147
|
+
const f = /* @__PURE__ */ new Map();
|
|
145
148
|
i.onStart(() => {
|
|
146
|
-
|
|
149
|
+
f.clear();
|
|
147
150
|
}), i.onResolve(
|
|
148
|
-
{ filter:
|
|
151
|
+
{ filter: l.moduleFilter },
|
|
149
152
|
async ({ importer: g, path: _ }) => {
|
|
150
|
-
if (g && !
|
|
153
|
+
if (g && !f.has(g))
|
|
151
154
|
try {
|
|
152
155
|
const S = await Is.readFile(g, "utf-8");
|
|
153
|
-
|
|
156
|
+
f.set(
|
|
154
157
|
g,
|
|
155
|
-
|
|
158
|
+
l.collectImports(S)
|
|
156
159
|
);
|
|
157
160
|
} catch {
|
|
158
|
-
|
|
161
|
+
f.set(g, /* @__PURE__ */ new Map());
|
|
159
162
|
}
|
|
160
163
|
return {
|
|
161
164
|
path: g ? `${_}?importer=${encodeURIComponent(g)}` : _,
|
|
@@ -168,14 +171,14 @@ ${_}` : _, loader: "tsx" };
|
|
|
168
171
|
}
|
|
169
172
|
), i.onLoad({ filter: /.*/, namespace: a }, ({ pluginData: g }) => {
|
|
170
173
|
const { originalPath: _, importerFilePath: S } = g;
|
|
171
|
-
if (
|
|
174
|
+
if (l.staticContents?.[_])
|
|
172
175
|
return {
|
|
173
|
-
contents:
|
|
176
|
+
contents: l.staticContents[_],
|
|
174
177
|
loader: "js"
|
|
175
178
|
};
|
|
176
|
-
const A = _ ===
|
|
179
|
+
const A = _ === l.moduleName ? "" : _.replace(`${l.moduleName}/`, ""), P = f.get(S)?.get(A) ?? /* @__PURE__ */ new Set();
|
|
177
180
|
return {
|
|
178
|
-
contents:
|
|
181
|
+
contents: l.generateExports({
|
|
179
182
|
namedImports: P,
|
|
180
183
|
moduleSubPath: A
|
|
181
184
|
}),
|
|
@@ -188,20 +191,20 @@ ${_}` : _, loader: "tsx" };
|
|
|
188
191
|
export var jsx = /* @__PURE__ */ (() => globalThis.jsx)();
|
|
189
192
|
export var jsxs = /* @__PURE__ */ (() => globalThis.jsxs)();
|
|
190
193
|
export var Fragment = /* @__PURE__ */ (() => globalThis.React.Fragment)();
|
|
191
|
-
`.trim(), Hm = (
|
|
194
|
+
`.trim(), Hm = (l) => {
|
|
192
195
|
const a = Xr({
|
|
193
|
-
sourceContent:
|
|
196
|
+
sourceContent: l,
|
|
194
197
|
pattern: bs
|
|
195
198
|
});
|
|
196
199
|
let i;
|
|
197
|
-
for (; Pn(i = bs.exec(
|
|
200
|
+
for (; Pn(i = bs.exec(l)); )
|
|
198
201
|
i.groups?.defaultImport && (a.has("") || a.set("", /* @__PURE__ */ new Set()), a.get("").add("default"));
|
|
199
202
|
return bs.lastIndex = 0, a;
|
|
200
|
-
},
|
|
201
|
-
namedImports:
|
|
203
|
+
}, jm = ({
|
|
204
|
+
namedImports: l
|
|
202
205
|
}) => {
|
|
203
206
|
const a = [];
|
|
204
|
-
for (const i of
|
|
207
|
+
for (const i of l)
|
|
205
208
|
i === "default" ? a.push(
|
|
206
209
|
"export default /* @__PURE__ */ (() => globalThis.React)();"
|
|
207
210
|
) : a.push(
|
|
@@ -209,27 +212,27 @@ export var Fragment = /* @__PURE__ */ (() => globalThis.React.Fragment)();
|
|
|
209
212
|
);
|
|
210
213
|
return a.join(`
|
|
211
214
|
`);
|
|
212
|
-
},
|
|
215
|
+
}, Km = Qr({
|
|
213
216
|
pluginName: "react-globals",
|
|
214
217
|
namespace: "react-globals",
|
|
215
218
|
moduleName: "react",
|
|
216
219
|
moduleFilter: qm,
|
|
217
220
|
collectImports: Hm,
|
|
218
|
-
generateExports:
|
|
221
|
+
generateExports: jm,
|
|
219
222
|
staticContents: {
|
|
220
223
|
"react/jsx-runtime": Gm
|
|
221
224
|
}
|
|
222
225
|
}), zm = /^\/\/.*$\n/gm, Jm = {
|
|
223
226
|
name: "strip-comments",
|
|
224
|
-
setup: (
|
|
225
|
-
|
|
227
|
+
setup: (l) => {
|
|
228
|
+
l.onEnd(async (a) => {
|
|
226
229
|
if (a.errors.length > 0)
|
|
227
230
|
return;
|
|
228
231
|
const i = Object.keys(a.metafile?.outputs ?? {}).filter(
|
|
229
|
-
(
|
|
232
|
+
(f) => f.endsWith(".mjs")
|
|
230
233
|
);
|
|
231
|
-
for (const
|
|
232
|
-
const g = me.resolve(
|
|
234
|
+
for (const f of i) {
|
|
235
|
+
const g = me.resolve(f), _ = await Is.readFile(g, "utf-8"), S = _.replace(zm, "");
|
|
233
236
|
S !== _ && await Is.writeFile(g, S, "utf-8");
|
|
234
237
|
}
|
|
235
238
|
});
|
|
@@ -239,11 +242,11 @@ export var Fragment = /* @__PURE__ */ (() => globalThis.React.Fragment)();
|
|
|
239
242
|
namespace: "twenty-sdk-globals",
|
|
240
243
|
moduleName: "twenty-sdk",
|
|
241
244
|
moduleFilter: Zm,
|
|
242
|
-
collectImports: (
|
|
243
|
-
sourceContent:
|
|
245
|
+
collectImports: (l) => Xr({
|
|
246
|
+
sourceContent: l,
|
|
244
247
|
pattern: Ym
|
|
245
248
|
}),
|
|
246
|
-
generateExports: ({ namedImports:
|
|
249
|
+
generateExports: ({ namedImports: l }) => [...l].map(
|
|
247
250
|
(a) => `export var ${a} = /* @__PURE__ */ (() => globalThis.TwentySdk.${a})();`
|
|
248
251
|
).join(`
|
|
249
252
|
`)
|
|
@@ -252,32 +255,32 @@ export var Fragment = /* @__PURE__ */ (() => globalThis.React.Fragment)();
|
|
|
252
255
|
namespace: "twenty-sdk-ui-globals",
|
|
253
256
|
moduleName: "twenty-sdk/ui",
|
|
254
257
|
moduleFilter: Vm,
|
|
255
|
-
collectImports: (
|
|
256
|
-
sourceContent:
|
|
258
|
+
collectImports: (l) => Xr({
|
|
259
|
+
sourceContent: l,
|
|
257
260
|
pattern: Qm
|
|
258
261
|
}),
|
|
259
|
-
generateExports: ({ namedImports:
|
|
262
|
+
generateExports: ({ namedImports: l }) => [...l].map(
|
|
260
263
|
(a) => `export var ${a} = /* @__PURE__ */ (() => globalThis.RemoteComponents.TwentyUi${a})();`
|
|
261
264
|
).join(`
|
|
262
265
|
`)
|
|
263
|
-
}), t0 = /import\s+\{(?<namedImports>[^}]*)\}\s*from\s*['"]twenty-shared(?:\/(?<subPath>[^'"]*?))?['"];?/g, n0 = /^twenty-shared(\/.*)?$/, r0 = (
|
|
266
|
+
}), t0 = /import\s+\{(?<namedImports>[^}]*)\}\s*from\s*['"]twenty-shared(?:\/(?<subPath>[^'"]*?))?['"];?/g, n0 = /^twenty-shared(\/.*)?$/, r0 = (l) => l === "" ? "globalThis.TwentyShared" : `globalThis.TwentyShared['${l}']`, i0 = Qr({
|
|
264
267
|
pluginName: "twenty-shared-globals",
|
|
265
268
|
namespace: "twenty-shared-globals",
|
|
266
269
|
moduleName: "twenty-shared",
|
|
267
270
|
moduleFilter: n0,
|
|
268
|
-
collectImports: (
|
|
269
|
-
sourceContent:
|
|
271
|
+
collectImports: (l) => Xr({
|
|
272
|
+
sourceContent: l,
|
|
270
273
|
pattern: t0
|
|
271
274
|
}),
|
|
272
|
-
generateExports: ({ namedImports:
|
|
275
|
+
generateExports: ({ namedImports: l, moduleSubPath: a }) => {
|
|
273
276
|
const i = r0(a);
|
|
274
|
-
return [...
|
|
275
|
-
(
|
|
277
|
+
return [...l].map(
|
|
278
|
+
(f) => `export var ${f} = /* @__PURE__ */ (() => ${i}.${f})();`
|
|
276
279
|
).join(`
|
|
277
280
|
`);
|
|
278
281
|
}
|
|
279
282
|
}), s0 = () => [
|
|
280
|
-
|
|
283
|
+
Km,
|
|
281
284
|
Xm,
|
|
282
285
|
e0,
|
|
283
286
|
i0,
|
|
@@ -286,8 +289,8 @@ export var Fragment = /* @__PURE__ */ (() => globalThis.React.Fragment)();
|
|
|
286
289
|
], Rs = "public", a0 = "TWENTY_API_KEY", o0 = "TWENTY_API_URL", u0 = {
|
|
287
290
|
js: `import { createRequire as __createRequire } from 'module';
|
|
288
291
|
const require = __createRequire(import.meta.url);`
|
|
289
|
-
},
|
|
290
|
-
var ge = /* @__PURE__ */ ((
|
|
292
|
+
}, jt = ".twenty/output";
|
|
293
|
+
var ge = /* @__PURE__ */ ((l) => (l.Object = "object", l.Field = "field", l.LogicFunction = "logicFunction", l.FrontComponent = "frontComponent", l.Role = "role", l))(ge || {});
|
|
291
294
|
const c0 = [
|
|
292
295
|
"path",
|
|
293
296
|
"fs",
|
|
@@ -317,8 +320,8 @@ class xu {
|
|
|
317
320
|
this.esBuildContext = null, this.isRestarting = !1, this.lastChecksums = /* @__PURE__ */ new Map(), this.buildCompletePromise = Promise.resolve(), this.resolveBuildComplete = null, this.appPath = a.appPath, this.sourcePaths = a.sourcePaths, this.watchMode = a.watch ?? !0, this.onFileBuilt = a.handleFileBuilt, this.onBuildError = a.handleBuildError, this.config = a.config;
|
|
318
321
|
}
|
|
319
322
|
shouldRestart(a) {
|
|
320
|
-
const i = this.sourcePaths.sort().join(","),
|
|
321
|
-
return i !==
|
|
323
|
+
const i = this.sourcePaths.sort().join(","), f = [...a].sort().join(",");
|
|
324
|
+
return i !== f;
|
|
322
325
|
}
|
|
323
326
|
async start() {
|
|
324
327
|
this.sourcePaths.length > 0 && await this.createContext();
|
|
@@ -331,7 +334,7 @@ class xu {
|
|
|
331
334
|
this.isRestarting = !0;
|
|
332
335
|
try {
|
|
333
336
|
await this.close();
|
|
334
|
-
const i = me.join(this.appPath,
|
|
337
|
+
const i = me.join(this.appPath, jt);
|
|
335
338
|
await Im(i, this.sourcePaths, a), this.sourcePaths = a, this.lastChecksums.clear(), this.sourcePaths.length > 0 && await this.createContext();
|
|
336
339
|
} finally {
|
|
337
340
|
this.isRestarting = !1;
|
|
@@ -339,12 +342,12 @@ class xu {
|
|
|
339
342
|
}
|
|
340
343
|
}
|
|
341
344
|
async createContext() {
|
|
342
|
-
const a = me.join(this.appPath,
|
|
345
|
+
const a = me.join(this.appPath, jt), i = {};
|
|
343
346
|
for (const _ of this.sourcePaths) {
|
|
344
347
|
const S = _.replace(/\.tsx?$/, "");
|
|
345
348
|
i[S] = me.join(this.appPath, _);
|
|
346
349
|
}
|
|
347
|
-
const
|
|
350
|
+
const f = this, g = [
|
|
348
351
|
...this.config.extraPlugins ?? [],
|
|
349
352
|
{
|
|
350
353
|
name: "build-notifications",
|
|
@@ -364,11 +367,11 @@ class xu {
|
|
|
364
367
|
result: S,
|
|
365
368
|
appPath: this.appPath,
|
|
366
369
|
fileFolder: this.config.fileFolder,
|
|
367
|
-
lastChecksums:
|
|
368
|
-
onFileBuilt:
|
|
370
|
+
lastChecksums: f.lastChecksums,
|
|
371
|
+
onFileBuilt: f.onFileBuilt
|
|
369
372
|
});
|
|
370
373
|
} finally {
|
|
371
|
-
|
|
374
|
+
f.resolveBuildComplete?.();
|
|
372
375
|
}
|
|
373
376
|
});
|
|
374
377
|
}
|
|
@@ -398,14 +401,14 @@ class xu {
|
|
|
398
401
|
}
|
|
399
402
|
const l0 = {
|
|
400
403
|
name: "external-patterns",
|
|
401
|
-
setup: (
|
|
402
|
-
|
|
404
|
+
setup: (l) => {
|
|
405
|
+
l.onResolve({ filter: /(?:^|\/)generated(?:\/|$)/ }, (a) => ({
|
|
403
406
|
path: a.path,
|
|
404
407
|
external: !0
|
|
405
408
|
}));
|
|
406
409
|
}
|
|
407
|
-
}, f0 = (
|
|
408
|
-
...
|
|
410
|
+
}, f0 = (l) => new xu({
|
|
411
|
+
...l,
|
|
409
412
|
config: {
|
|
410
413
|
externalModules: c0,
|
|
411
414
|
fileFolder: Gt.BuiltLogicFunction,
|
|
@@ -413,8 +416,8 @@ const l0 = {
|
|
|
413
416
|
extraPlugins: [l0],
|
|
414
417
|
banner: u0
|
|
415
418
|
}
|
|
416
|
-
}), h0 = (
|
|
417
|
-
...
|
|
419
|
+
}), h0 = (l) => new xu({
|
|
420
|
+
...l,
|
|
418
421
|
config: {
|
|
419
422
|
externalModules: Pm,
|
|
420
423
|
fileFolder: Gt.BuiltFrontComponent,
|
|
@@ -436,10 +439,10 @@ class p0 {
|
|
|
436
439
|
}), this.watcher.on("all", async (a, i) => {
|
|
437
440
|
if (a === "addDir")
|
|
438
441
|
return;
|
|
439
|
-
const
|
|
440
|
-
|
|
441
|
-
), A =
|
|
442
|
-
(g || !A || I) && !_ && !S || this.handleChangeDetected(
|
|
442
|
+
const f = ft(this.appPath, i), g = f.startsWith("node_modules") || f.startsWith("generated") || f.startsWith("dist"), _ = f.startsWith(Rs), S = ["package.json", "yarn.lock"].includes(
|
|
443
|
+
f
|
|
444
|
+
), A = f.endsWith(".ts") || f.endsWith(".tsx"), I = f.startsWith(".");
|
|
445
|
+
(g || !A || I) && !_ && !S || this.handleChangeDetected(f, a);
|
|
443
446
|
});
|
|
444
447
|
}
|
|
445
448
|
async close() {
|
|
@@ -447,15 +450,15 @@ class p0 {
|
|
|
447
450
|
}
|
|
448
451
|
}
|
|
449
452
|
const d0 = ({
|
|
450
|
-
manifest:
|
|
453
|
+
manifest: l,
|
|
451
454
|
builtFileInfos: a
|
|
452
455
|
}) => {
|
|
453
|
-
let i = structuredClone(
|
|
456
|
+
let i = structuredClone(l);
|
|
454
457
|
for (const [
|
|
455
|
-
|
|
458
|
+
f,
|
|
456
459
|
{ fileFolder: g, checksum: _ }
|
|
457
460
|
] of a.entries()) {
|
|
458
|
-
const S = ft(
|
|
461
|
+
const S = ft(jt, f);
|
|
459
462
|
if (g === Gt.BuiltLogicFunction) {
|
|
460
463
|
const A = i.logicFunctions, I = A.findIndex(
|
|
461
464
|
(P) => P.builtHandlerPath === S
|
|
@@ -497,11 +500,11 @@ const d0 = ({
|
|
|
497
500
|
g === Gt.Dependencies && (S === "package.json" && (i.application.packageJsonChecksum = _), S === "yarn.lock" && (i.application.yarnLockChecksum = _));
|
|
498
501
|
}
|
|
499
502
|
return i;
|
|
500
|
-
}, g0 = async (
|
|
501
|
-
const i = me.join(
|
|
503
|
+
}, g0 = async (l, a) => {
|
|
504
|
+
const i = me.join(l, jt);
|
|
502
505
|
await Q.ensureDir(i);
|
|
503
|
-
const
|
|
504
|
-
return await Q.writeJSON(
|
|
506
|
+
const f = me.join(i, "manifest.json");
|
|
507
|
+
return await Q.writeJSON(f, a, { spaces: 2 }), f;
|
|
505
508
|
}, m0 = Et.join(wu.tmpdir(), ".twenty-sdk-test"), v0 = () => process.env.NODE_ENV === "test" ? Et.join(m0, "config.json") : Et.join(wu.homedir(), ".twenty", "config.json"), St = "default", Zr = class Zr {
|
|
506
509
|
constructor() {
|
|
507
510
|
this.configPath = v0();
|
|
@@ -526,7 +529,7 @@ const d0 = ({
|
|
|
526
529
|
async getConfigForWorkspace(a) {
|
|
527
530
|
const i = this.getDefaultConfig();
|
|
528
531
|
try {
|
|
529
|
-
const
|
|
532
|
+
const f = await this.readRawConfig(), g = a === St && !f.profiles?.[St] ? f : f.profiles?.[a], _ = g?.apiUrl ?? i.apiUrl, S = g?.apiKey;
|
|
530
533
|
return {
|
|
531
534
|
apiUrl: _,
|
|
532
535
|
apiKey: S
|
|
@@ -536,16 +539,16 @@ const d0 = ({
|
|
|
536
539
|
}
|
|
537
540
|
}
|
|
538
541
|
async setConfig(a) {
|
|
539
|
-
const i = await this.readRawConfig(),
|
|
542
|
+
const i = await this.readRawConfig(), f = this.getActiveWorkspaceName();
|
|
540
543
|
i.profiles || (i.profiles = {});
|
|
541
|
-
const g = i.profiles[
|
|
542
|
-
i.profiles[
|
|
544
|
+
const g = i.profiles[f] || { apiUrl: "" };
|
|
545
|
+
i.profiles[f] = { ...g, ...a }, await Q.ensureDir(Et.dirname(this.configPath)), await Q.writeFile(this.configPath, JSON.stringify(i, null, 2));
|
|
543
546
|
}
|
|
544
547
|
async clearConfig() {
|
|
545
548
|
const a = await this.readRawConfig(), i = this.getActiveWorkspaceName();
|
|
546
549
|
if (a.profiles || (a.profiles = {}), a.profiles[i] && delete a.profiles[i], i === St) {
|
|
547
|
-
const
|
|
548
|
-
delete a.apiKey, a.apiUrl =
|
|
550
|
+
const f = this.getDefaultConfig();
|
|
551
|
+
delete a.apiKey, a.apiUrl = f.apiUrl;
|
|
549
552
|
}
|
|
550
553
|
await Q.ensureDir(Et.dirname(this.configPath)), await Q.writeFile(this.configPath, JSON.stringify(a, null, 2));
|
|
551
554
|
}
|
|
@@ -557,7 +560,7 @@ const d0 = ({
|
|
|
557
560
|
async getAvailableWorkspaces() {
|
|
558
561
|
try {
|
|
559
562
|
const a = await this.readRawConfig(), i = /* @__PURE__ */ new Set();
|
|
560
|
-
return i.add(St), a.profiles && Object.keys(a.profiles).forEach((
|
|
563
|
+
return i.add(St), a.profiles && Object.keys(a.profiles).forEach((f) => i.add(f)), Array.from(i).sort();
|
|
561
564
|
} catch {
|
|
562
565
|
return [St];
|
|
563
566
|
}
|
|
@@ -579,23 +582,23 @@ let Ae = Zr;
|
|
|
579
582
|
class Ct {
|
|
580
583
|
constructor(a) {
|
|
581
584
|
const { disableInterceptors: i = !1 } = a || {};
|
|
582
|
-
this.configService = new Ae(), this.client = Jr.create(), this.client.interceptors.request.use(async (
|
|
585
|
+
this.configService = new Ae(), this.client = Jr.create(), this.client.interceptors.request.use(async (f) => {
|
|
583
586
|
const g = await this.configService.getConfig();
|
|
584
|
-
return
|
|
587
|
+
return f.baseURL = g.apiUrl, g.apiKey && (f.headers.Authorization = `Bearer ${g.apiKey}`), f;
|
|
585
588
|
}), !i && this.client.interceptors.response.use(
|
|
586
|
-
(
|
|
587
|
-
(
|
|
588
|
-
throw
|
|
589
|
+
(f) => f,
|
|
590
|
+
(f) => {
|
|
591
|
+
throw f.response?.status === 401 ? console.error(
|
|
589
592
|
E.red(
|
|
590
593
|
"Authentication failed. Please run `twenty auth:login` first."
|
|
591
594
|
)
|
|
592
|
-
) :
|
|
595
|
+
) : f.response?.status === 403 ? console.error(
|
|
593
596
|
E.red(
|
|
594
597
|
"Access denied. Check your API key and workspace permissions."
|
|
595
598
|
)
|
|
596
|
-
) :
|
|
599
|
+
) : f.code === "ECONNREFUSED" && console.error(
|
|
597
600
|
E.red("Cannot connect to Twenty server. Is it running?")
|
|
598
|
-
),
|
|
601
|
+
), f;
|
|
599
602
|
}
|
|
600
603
|
);
|
|
601
604
|
}
|
|
@@ -632,7 +635,7 @@ class Ct {
|
|
|
632
635
|
}
|
|
633
636
|
async checkApplicationExist(a) {
|
|
634
637
|
try {
|
|
635
|
-
const
|
|
638
|
+
const f = await this.client.post(
|
|
636
639
|
"/metadata",
|
|
637
640
|
{
|
|
638
641
|
query: `
|
|
@@ -649,12 +652,12 @@ class Ct {
|
|
|
649
652
|
}
|
|
650
653
|
}
|
|
651
654
|
);
|
|
652
|
-
return
|
|
655
|
+
return f.data.errors ? {
|
|
653
656
|
success: !1,
|
|
654
|
-
error:
|
|
657
|
+
error: f.data.errors[0]
|
|
655
658
|
} : {
|
|
656
659
|
success: !0,
|
|
657
|
-
data:
|
|
660
|
+
data: f.data.data.checkApplicationExist,
|
|
658
661
|
message: "Successfully find application"
|
|
659
662
|
};
|
|
660
663
|
} catch (i) {
|
|
@@ -673,7 +676,7 @@ class Ct {
|
|
|
673
676
|
universalIdentifier
|
|
674
677
|
}
|
|
675
678
|
}
|
|
676
|
-
`,
|
|
679
|
+
`, f = {
|
|
677
680
|
input: {
|
|
678
681
|
universalIdentifier: a.application.universalIdentifier,
|
|
679
682
|
name: a.application.displayName,
|
|
@@ -684,7 +687,7 @@ class Ct {
|
|
|
684
687
|
"/metadata",
|
|
685
688
|
{
|
|
686
689
|
query: i,
|
|
687
|
-
variables:
|
|
690
|
+
variables: f
|
|
688
691
|
},
|
|
689
692
|
{
|
|
690
693
|
headers: {
|
|
@@ -714,11 +717,11 @@ class Ct {
|
|
|
714
717
|
mutation SyncApplication($manifest: JSON!) {
|
|
715
718
|
syncApplication(manifest: $manifest)
|
|
716
719
|
}
|
|
717
|
-
`,
|
|
720
|
+
`, f = { manifest: a }, g = await this.client.post(
|
|
718
721
|
"/metadata",
|
|
719
722
|
{
|
|
720
723
|
query: i,
|
|
721
|
-
variables:
|
|
724
|
+
variables: f
|
|
722
725
|
},
|
|
723
726
|
{
|
|
724
727
|
headers: {
|
|
@@ -748,11 +751,11 @@ class Ct {
|
|
|
748
751
|
mutation UninstallApplication($universalIdentifier: String!) {
|
|
749
752
|
uninstallApplication(universalIdentifier: $universalIdentifier)
|
|
750
753
|
}
|
|
751
|
-
`,
|
|
754
|
+
`, f = { universalIdentifier: a }, g = await this.client.post(
|
|
752
755
|
"/metadata",
|
|
753
756
|
{
|
|
754
757
|
query: i,
|
|
755
|
-
variables:
|
|
758
|
+
variables: f
|
|
756
759
|
},
|
|
757
760
|
{
|
|
758
761
|
headers: {
|
|
@@ -797,10 +800,10 @@ class Ct {
|
|
|
797
800
|
success: !1,
|
|
798
801
|
error: `GraphQL introspection errors: ${JSON.stringify(i.data.errors)}`
|
|
799
802
|
};
|
|
800
|
-
const
|
|
803
|
+
const f = vm(i.data.data);
|
|
801
804
|
return {
|
|
802
805
|
success: !0,
|
|
803
|
-
data: _m(
|
|
806
|
+
data: _m(f),
|
|
804
807
|
message: "Successfully load schema"
|
|
805
808
|
};
|
|
806
809
|
} catch (a) {
|
|
@@ -852,7 +855,7 @@ class Ct {
|
|
|
852
855
|
payload: i
|
|
853
856
|
}) {
|
|
854
857
|
try {
|
|
855
|
-
const
|
|
858
|
+
const f = `
|
|
856
859
|
mutation ExecuteOneLogicFunction($input: ExecuteOneLogicFunctionInput!) {
|
|
857
860
|
executeOneLogicFunction(input: $input) {
|
|
858
861
|
data
|
|
@@ -870,7 +873,7 @@ class Ct {
|
|
|
870
873
|
}, _ = await this.client.post(
|
|
871
874
|
"/metadata",
|
|
872
875
|
{
|
|
873
|
-
query:
|
|
876
|
+
query: f,
|
|
874
877
|
variables: g
|
|
875
878
|
},
|
|
876
879
|
{
|
|
@@ -887,17 +890,17 @@ class Ct {
|
|
|
887
890
|
success: !0,
|
|
888
891
|
data: _.data.data.executeOneLogicFunction
|
|
889
892
|
};
|
|
890
|
-
} catch (
|
|
893
|
+
} catch (f) {
|
|
891
894
|
return {
|
|
892
895
|
success: !1,
|
|
893
|
-
error:
|
|
896
|
+
error: f
|
|
894
897
|
};
|
|
895
898
|
}
|
|
896
899
|
}
|
|
897
900
|
async subscribeToLogs({
|
|
898
901
|
applicationUniversalIdentifier: a,
|
|
899
902
|
functionUniversalIdentifier: i,
|
|
900
|
-
functionName:
|
|
903
|
+
functionName: f
|
|
901
904
|
}) {
|
|
902
905
|
const g = await this.configService.getConfig(), _ = gm({
|
|
903
906
|
url: g.apiUrl + "/graphql",
|
|
@@ -916,7 +919,7 @@ class Ct {
|
|
|
916
919
|
input: {
|
|
917
920
|
applicationUniversalIdentifier: a,
|
|
918
921
|
universalIdentifier: i,
|
|
919
|
-
name:
|
|
922
|
+
name: f
|
|
920
923
|
}
|
|
921
924
|
};
|
|
922
925
|
_.subscribe(
|
|
@@ -934,7 +937,7 @@ class Ct {
|
|
|
934
937
|
async uploadFile({
|
|
935
938
|
filePath: a,
|
|
936
939
|
builtHandlerPath: i,
|
|
937
|
-
fileFolder:
|
|
940
|
+
fileFolder: f,
|
|
938
941
|
applicationUniversalIdentifier: g
|
|
939
942
|
}) {
|
|
940
943
|
try {
|
|
@@ -949,7 +952,7 @@ class Ct {
|
|
|
949
952
|
uploadApplicationFile(file: $file, applicationUniversalIdentifier: $applicationUniversalIdentifier, fileFolder: $fileFolder, filePath: $filePath)
|
|
950
953
|
{ path }
|
|
951
954
|
}
|
|
952
|
-
`, z = Fm(
|
|
955
|
+
`, z = Fm(f), G = JSON.stringify({
|
|
953
956
|
query: P,
|
|
954
957
|
variables: {
|
|
955
958
|
file: null,
|
|
@@ -957,10 +960,10 @@ class Ct {
|
|
|
957
960
|
filePath: i,
|
|
958
961
|
fileFolder: z
|
|
959
962
|
}
|
|
960
|
-
}),
|
|
963
|
+
}), j = JSON.stringify({
|
|
961
964
|
0: ["variables.file"]
|
|
962
965
|
}), B = new FormData();
|
|
963
|
-
B.append("operations", G), B.append("map",
|
|
966
|
+
B.append("operations", G), B.append("map", j), B.append(
|
|
964
967
|
"0",
|
|
965
968
|
new Blob([new Uint8Array(A)], { type: I }),
|
|
966
969
|
S
|
|
@@ -1033,16 +1036,16 @@ class _0 {
|
|
|
1033
1036
|
builtPath: a,
|
|
1034
1037
|
fileFolder: i
|
|
1035
1038
|
}) {
|
|
1036
|
-
const
|
|
1039
|
+
const f = ft(jt, a);
|
|
1037
1040
|
return await this.apiService.uploadFile({
|
|
1038
1041
|
filePath: me.join(this.appPath, a),
|
|
1039
|
-
builtHandlerPath:
|
|
1042
|
+
builtHandlerPath: f,
|
|
1040
1043
|
fileFolder: i,
|
|
1041
1044
|
applicationUniversalIdentifier: this.applicationUniversalIdentifier
|
|
1042
1045
|
});
|
|
1043
1046
|
}
|
|
1044
1047
|
}
|
|
1045
|
-
var Su = /* @__PURE__ */ ((
|
|
1048
|
+
var Su = /* @__PURE__ */ ((l) => (l.DefineApplication = "defineApplication", l.DefineField = "defineField", l.DefineLogicFunction = "defineLogicFunction", l.DefineObject = "defineObject", l.DefineRole = "defineRole", l.DefineFrontComponent = "defineFrontComponent", l))(Su || {}), qt = /* @__PURE__ */ ((l) => (l.Application = "application", l.Fields = "fields", l.LogicFunctions = "logicFunctions", l.Objects = "objects", l.Roles = "roles", l.FrontComponents = "frontComponents", l.PublicAssets = "publicAssets", l))(qt || {});
|
|
1046
1049
|
const w0 = {
|
|
1047
1050
|
defineApplication: "application",
|
|
1048
1051
|
defineField: "fields",
|
|
@@ -1051,69 +1054,69 @@ const w0 = {
|
|
|
1051
1054
|
defineRole: "roles",
|
|
1052
1055
|
defineFrontComponent: "frontComponents"
|
|
1053
1056
|
/* FrontComponents */
|
|
1054
|
-
}, y0 = (
|
|
1055
|
-
if (!In.isCallExpression(
|
|
1057
|
+
}, y0 = (l) => {
|
|
1058
|
+
if (!In.isCallExpression(l))
|
|
1056
1059
|
return;
|
|
1057
|
-
const a =
|
|
1060
|
+
const a = l.expression;
|
|
1058
1061
|
if (In.isIdentifier(a) && Object.values(Su).includes(a.text))
|
|
1059
1062
|
return a.text;
|
|
1060
|
-
}, x0 = (
|
|
1063
|
+
}, x0 = (l) => {
|
|
1061
1064
|
const a = In.createSourceFile(
|
|
1062
1065
|
"temp.ts",
|
|
1063
|
-
|
|
1066
|
+
l,
|
|
1064
1067
|
In.ScriptTarget.Latest,
|
|
1065
1068
|
!0
|
|
1066
1069
|
), i = [];
|
|
1067
|
-
In.forEachChild(a, (
|
|
1068
|
-
i.push(
|
|
1070
|
+
In.forEachChild(a, (f) => {
|
|
1071
|
+
i.push(f);
|
|
1069
1072
|
});
|
|
1070
|
-
for (const
|
|
1071
|
-
if (In.isExportAssignment(
|
|
1072
|
-
if (
|
|
1073
|
+
for (const f of i)
|
|
1074
|
+
if (In.isExportAssignment(f)) {
|
|
1075
|
+
if (f.isExportEquals || !f.expression)
|
|
1073
1076
|
return;
|
|
1074
|
-
const g = y0(
|
|
1077
|
+
const g = y0(f.expression);
|
|
1075
1078
|
if (g)
|
|
1076
1079
|
return g;
|
|
1077
1080
|
}
|
|
1078
1081
|
}, S0 = ["twenty-sdk/ui"], A0 = {
|
|
1079
1082
|
name: "manifest-mock",
|
|
1080
|
-
setup: (
|
|
1083
|
+
setup: (l) => {
|
|
1081
1084
|
const a = new RegExp(
|
|
1082
1085
|
`^(${S0.map((i) => i.replace("/", "\\/")).join("|")})$`
|
|
1083
1086
|
);
|
|
1084
|
-
|
|
1087
|
+
l.onResolve({ filter: a }, ({ path: i }) => ({
|
|
1085
1088
|
path: i,
|
|
1086
1089
|
namespace: "manifest-mock"
|
|
1087
|
-
})),
|
|
1090
|
+
})), l.onLoad({ filter: /.*/, namespace: "manifest-mock" }, () => ({
|
|
1088
1091
|
contents: "module.exports = new Proxy({}, { get: () => () => {} });",
|
|
1089
1092
|
loader: "js"
|
|
1090
1093
|
}));
|
|
1091
1094
|
}
|
|
1092
1095
|
}, Tn = async ({
|
|
1093
|
-
filePath:
|
|
1096
|
+
filePath: l,
|
|
1094
1097
|
appPath: a
|
|
1095
1098
|
}) => {
|
|
1096
|
-
const i = await E0({ filePath:
|
|
1097
|
-
return b0(i,
|
|
1099
|
+
const i = await E0({ filePath: l, appPath: a });
|
|
1100
|
+
return b0(i, l);
|
|
1098
1101
|
}, E0 = async ({
|
|
1099
|
-
filePath:
|
|
1102
|
+
filePath: l,
|
|
1100
1103
|
appPath: a
|
|
1101
1104
|
}) => {
|
|
1102
|
-
const i = me.join(a, "tsconfig.json"),
|
|
1105
|
+
const i = me.join(a, "tsconfig.json"), f = await Q.pathExists(i), g = wm(me.join(a, "package.json"));
|
|
1103
1106
|
let _, S;
|
|
1104
1107
|
try {
|
|
1105
1108
|
_ = me.dirname(g.resolve("react/package.json")), S = me.dirname(g.resolve("react-dom/package.json"));
|
|
1106
1109
|
} catch {
|
|
1107
1110
|
}
|
|
1108
1111
|
const I = (await vu.build({
|
|
1109
|
-
entryPoints: [
|
|
1112
|
+
entryPoints: [l],
|
|
1110
1113
|
bundle: !0,
|
|
1111
1114
|
write: !1,
|
|
1112
1115
|
format: "cjs",
|
|
1113
1116
|
platform: "node",
|
|
1114
1117
|
target: "node18",
|
|
1115
1118
|
jsx: "automatic",
|
|
1116
|
-
tsconfig:
|
|
1119
|
+
tsconfig: f ? i : void 0,
|
|
1117
1120
|
alias: {
|
|
1118
1121
|
..._ && { react: _ },
|
|
1119
1122
|
...S && { "react-dom": S }
|
|
@@ -1126,115 +1129,115 @@ const w0 = {
|
|
|
1126
1129
|
} finally {
|
|
1127
1130
|
await Q.remove(P);
|
|
1128
1131
|
}
|
|
1129
|
-
}, b0 = (
|
|
1130
|
-
if (Pn(
|
|
1131
|
-
return
|
|
1132
|
+
}, b0 = (l, a) => {
|
|
1133
|
+
if (Pn(l.default) && Tm(l.default))
|
|
1134
|
+
return l.default;
|
|
1132
1135
|
throw new Error(
|
|
1133
1136
|
`Config file ${a} must export a config object default export`
|
|
1134
1137
|
);
|
|
1135
|
-
}, C0 = async (
|
|
1136
|
-
cwd:
|
|
1138
|
+
}, C0 = async (l) => await yu(["**/*.ts", "**/*.tsx"], {
|
|
1139
|
+
cwd: l,
|
|
1137
1140
|
absolute: !0,
|
|
1138
1141
|
ignore: ["**/node_modules/**", "**/*.d.ts", "**/dist/**", "**/.twenty/**"],
|
|
1139
1142
|
onlyFiles: !0
|
|
1140
|
-
}), F0 = async (
|
|
1141
|
-
cwd:
|
|
1143
|
+
}), F0 = async (l) => await yu([`${Rs}/**/*`], {
|
|
1144
|
+
cwd: l,
|
|
1142
1145
|
onlyFiles: !0
|
|
1143
|
-
}), Vr = async (
|
|
1144
|
-
const a = await C0(
|
|
1145
|
-
let
|
|
1146
|
-
const g = [], _ = [], S = [], A = [], I = [], P = [], z = [], G = [],
|
|
1146
|
+
}), Vr = async (l) => {
|
|
1147
|
+
const a = await C0(l), i = [];
|
|
1148
|
+
let f;
|
|
1149
|
+
const g = [], _ = [], S = [], A = [], I = [], P = [], z = [], G = [], j = [], B = [], ae = [], Oe = [], fe = [];
|
|
1147
1150
|
for (const T of a) {
|
|
1148
|
-
const Y = await lm(T, "utf-8"),
|
|
1151
|
+
const Y = await lm(T, "utf-8"), K = ft(l, T), ne = x0(Y);
|
|
1149
1152
|
if (!ne)
|
|
1150
1153
|
continue;
|
|
1151
1154
|
switch (w0[ne]) {
|
|
1152
1155
|
case qt.Application: {
|
|
1153
1156
|
const ee = await Tn({
|
|
1154
|
-
appPath:
|
|
1157
|
+
appPath: l,
|
|
1155
1158
|
filePath: T
|
|
1156
1159
|
});
|
|
1157
|
-
|
|
1160
|
+
f = {
|
|
1158
1161
|
...ee.config,
|
|
1159
1162
|
yarnLockChecksum: null,
|
|
1160
1163
|
packageJsonChecksum: null
|
|
1161
|
-
}, i.push(...ee.errors), z.push(
|
|
1164
|
+
}, i.push(...ee.errors), z.push(K);
|
|
1162
1165
|
break;
|
|
1163
1166
|
}
|
|
1164
1167
|
case qt.Objects: {
|
|
1165
1168
|
const ee = await Tn({
|
|
1166
|
-
appPath:
|
|
1169
|
+
appPath: l,
|
|
1167
1170
|
filePath: T
|
|
1168
1171
|
});
|
|
1169
|
-
g.push(ee.config), i.push(...ee.errors), G.push(
|
|
1172
|
+
g.push(ee.config), i.push(...ee.errors), G.push(K);
|
|
1170
1173
|
break;
|
|
1171
1174
|
}
|
|
1172
1175
|
case qt.Fields: {
|
|
1173
1176
|
const ee = await Tn({
|
|
1174
|
-
appPath:
|
|
1177
|
+
appPath: l,
|
|
1175
1178
|
filePath: T
|
|
1176
1179
|
});
|
|
1177
|
-
_.push(ee.config), i.push(...ee.errors),
|
|
1180
|
+
_.push(ee.config), i.push(...ee.errors), j.push(K);
|
|
1178
1181
|
break;
|
|
1179
1182
|
}
|
|
1180
1183
|
case qt.Roles: {
|
|
1181
1184
|
const ee = await Tn({
|
|
1182
|
-
appPath:
|
|
1185
|
+
appPath: l,
|
|
1183
1186
|
filePath: T
|
|
1184
1187
|
});
|
|
1185
|
-
S.push(ee.config), i.push(...ee.errors), B.push(
|
|
1188
|
+
S.push(ee.config), i.push(...ee.errors), B.push(K);
|
|
1186
1189
|
break;
|
|
1187
1190
|
}
|
|
1188
1191
|
case qt.LogicFunctions: {
|
|
1189
1192
|
const ee = await Tn({
|
|
1190
|
-
appPath:
|
|
1193
|
+
appPath: l,
|
|
1191
1194
|
filePath: T
|
|
1192
1195
|
});
|
|
1193
1196
|
i.push(...ee.errors);
|
|
1194
|
-
const { handler:
|
|
1197
|
+
const { handler: Kt, ...Ge } = ee.config, ht = ft(l, T), Tt = {
|
|
1195
1198
|
...Ge,
|
|
1196
1199
|
handlerName: "default.config.handler",
|
|
1197
1200
|
sourceHandlerPath: ht,
|
|
1198
1201
|
builtHandlerPath: ht.replace(/\.tsx?$/, ".mjs"),
|
|
1199
1202
|
builtHandlerChecksum: "[default-checksum]"
|
|
1200
1203
|
};
|
|
1201
|
-
A.push(Tt), ae.push(
|
|
1204
|
+
A.push(Tt), ae.push(K);
|
|
1202
1205
|
break;
|
|
1203
1206
|
}
|
|
1204
1207
|
case qt.FrontComponents: {
|
|
1205
1208
|
const ee = await Tn({
|
|
1206
|
-
appPath:
|
|
1209
|
+
appPath: l,
|
|
1207
1210
|
filePath: T
|
|
1208
1211
|
});
|
|
1209
1212
|
i.push(...ee.errors);
|
|
1210
|
-
const { component:
|
|
1213
|
+
const { component: Kt, ...Ge } = ee.config, ht = ft(l, T), Tt = {
|
|
1211
1214
|
...Ge,
|
|
1212
|
-
componentName:
|
|
1215
|
+
componentName: Kt.name,
|
|
1213
1216
|
sourceComponentPath: ht,
|
|
1214
1217
|
builtComponentPath: ht.replace(/\.tsx?$/, ".mjs"),
|
|
1215
1218
|
builtComponentChecksum: ""
|
|
1216
1219
|
};
|
|
1217
|
-
I.push(Tt), Oe.push(
|
|
1220
|
+
I.push(Tt), Oe.push(K);
|
|
1218
1221
|
break;
|
|
1219
1222
|
}
|
|
1220
1223
|
case qt.PublicAssets:
|
|
1221
1224
|
break;
|
|
1222
1225
|
default:
|
|
1223
|
-
|
|
1226
|
+
mu();
|
|
1224
1227
|
}
|
|
1225
1228
|
}
|
|
1226
|
-
const Le = await F0(
|
|
1229
|
+
const Le = await F0(l);
|
|
1227
1230
|
for (const T of Le)
|
|
1228
1231
|
P.push({
|
|
1229
1232
|
filePath: T,
|
|
1230
1233
|
fileName: om(T),
|
|
1231
1234
|
fileType: am(T).replace(/^\./, ""),
|
|
1232
1235
|
checksum: null
|
|
1233
|
-
}), fe.push(ft(
|
|
1234
|
-
return
|
|
1236
|
+
}), fe.push(ft(l, T));
|
|
1237
|
+
return f || i.push(
|
|
1235
1238
|
"Cannot build application, please export default defineApplication() to define an application"
|
|
1236
|
-
), { manifest:
|
|
1237
|
-
application:
|
|
1239
|
+
), { manifest: f ? {
|
|
1240
|
+
application: f,
|
|
1238
1241
|
objects: g,
|
|
1239
1242
|
fields: _,
|
|
1240
1243
|
roles: S,
|
|
@@ -1244,27 +1247,27 @@ const w0 = {
|
|
|
1244
1247
|
} : null, filePaths: {
|
|
1245
1248
|
application: z,
|
|
1246
1249
|
objects: G,
|
|
1247
|
-
fields:
|
|
1250
|
+
fields: j,
|
|
1248
1251
|
roles: B,
|
|
1249
1252
|
logicFunctions: ae,
|
|
1250
1253
|
frontComponents: Oe,
|
|
1251
1254
|
publicAssets: fe
|
|
1252
1255
|
}, errors: i };
|
|
1253
|
-
}, T0 = (
|
|
1256
|
+
}, T0 = (l) => {
|
|
1254
1257
|
const a = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set();
|
|
1255
|
-
for (const
|
|
1256
|
-
a.has(
|
|
1258
|
+
for (const f of l)
|
|
1259
|
+
a.has(f) ? i.add(f) : a.add(f);
|
|
1257
1260
|
return Array.from(i);
|
|
1258
|
-
}, Au = (
|
|
1261
|
+
}, Au = (l) => {
|
|
1259
1262
|
const a = [];
|
|
1260
|
-
if (!
|
|
1263
|
+
if (!l)
|
|
1261
1264
|
return [];
|
|
1262
|
-
for (const [i,
|
|
1263
|
-
i === "universalIdentifier" && typeof
|
|
1265
|
+
for (const [i, f] of Object.entries(l))
|
|
1266
|
+
i === "universalIdentifier" && typeof f == "string" && a.push(f), typeof f == "object" && a.push(...Au(f));
|
|
1264
1267
|
return a;
|
|
1265
|
-
}, I0 = (
|
|
1266
|
-
const a = [], i = [],
|
|
1267
|
-
return
|
|
1268
|
+
}, I0 = (l) => {
|
|
1269
|
+
const a = [], i = [], f = T0(Au(l));
|
|
1270
|
+
return f.length > 0 && a.push(`Duplicate universal identifiers: ${f.join(", ")}`), Es(l.objects) || i.push("No object defined"), Es(l.logicFunctions) || i.push("No logic function defined"), Es(l.frontComponents) || i.push("No front component defined"), { errors: a, warnings: i, isValid: a.length === 0 };
|
|
1268
1271
|
};
|
|
1269
1272
|
class R0 {
|
|
1270
1273
|
constructor(a) {
|
|
@@ -1314,7 +1317,7 @@ class R0 {
|
|
|
1314
1317
|
handleFileBuilt({
|
|
1315
1318
|
fileFolder: a,
|
|
1316
1319
|
builtPath: i,
|
|
1317
|
-
sourcePath:
|
|
1320
|
+
sourcePath: f,
|
|
1318
1321
|
checksum: g
|
|
1319
1322
|
}) {
|
|
1320
1323
|
this.uiStateManager.addEvent({
|
|
@@ -1323,18 +1326,18 @@ class R0 {
|
|
|
1323
1326
|
}), this.builtFileInfos.set(i, {
|
|
1324
1327
|
checksum: g,
|
|
1325
1328
|
builtPath: i,
|
|
1326
|
-
sourcePath:
|
|
1329
|
+
sourcePath: f,
|
|
1327
1330
|
fileFolder: a
|
|
1328
|
-
}), this.fileUploader && this.uploadFile(i,
|
|
1331
|
+
}), this.fileUploader && this.uploadFile(i, f, a), this.scheduleSync();
|
|
1329
1332
|
}
|
|
1330
|
-
uploadFile(a, i,
|
|
1333
|
+
uploadFile(a, i, f) {
|
|
1331
1334
|
this.uiStateManager.addEvent({
|
|
1332
1335
|
message: `Uploading ${a}`,
|
|
1333
1336
|
status: "info"
|
|
1334
1337
|
}), this.uiStateManager.updateFileStatus(i, "uploading");
|
|
1335
1338
|
const g = this.fileUploader.uploadFile({
|
|
1336
1339
|
builtPath: a,
|
|
1337
|
-
fileFolder:
|
|
1340
|
+
fileFolder: f
|
|
1338
1341
|
}).then((_) => {
|
|
1339
1342
|
_.success ? (this.uiStateManager.addEvent({
|
|
1340
1343
|
message: `Successfully uploaded ${a}`,
|
|
@@ -1457,14 +1460,14 @@ class R0 {
|
|
|
1457
1460
|
}
|
|
1458
1461
|
for (; this.activeUploads.size > 0; )
|
|
1459
1462
|
await Promise.all(this.activeUploads);
|
|
1460
|
-
const
|
|
1463
|
+
const f = d0({
|
|
1461
1464
|
manifest: a.manifest,
|
|
1462
1465
|
builtFileInfos: this.builtFileInfos
|
|
1463
1466
|
});
|
|
1464
1467
|
this.uiStateManager.addEvent({
|
|
1465
1468
|
message: "Manifest checksums set",
|
|
1466
1469
|
status: "info"
|
|
1467
|
-
}), await g0(this.appPath,
|
|
1470
|
+
}), await g0(this.appPath, f), this.uiStateManager.addEvent({
|
|
1468
1471
|
message: "Manifest saved to output directory",
|
|
1469
1472
|
status: "info"
|
|
1470
1473
|
}), this.uiStateManager.addEvent({
|
|
@@ -1473,7 +1476,7 @@ class R0 {
|
|
|
1473
1476
|
}), this.uiStateManager.updateManifestState({
|
|
1474
1477
|
manifestStatus: "syncing"
|
|
1475
1478
|
});
|
|
1476
|
-
const g = await this.apiService.syncApplication(
|
|
1479
|
+
const g = await this.apiService.syncApplication(f);
|
|
1477
1480
|
this.uiStateManager.updateAllFilesStatus("success"), g.success ? (this.uiStateManager.addEvent({
|
|
1478
1481
|
message: "✓ Synced",
|
|
1479
1482
|
status: "success"
|
|
@@ -1534,7 +1537,7 @@ class O0 {
|
|
|
1534
1537
|
message: a,
|
|
1535
1538
|
status: i = "info"
|
|
1536
1539
|
}) {
|
|
1537
|
-
const
|
|
1540
|
+
const f = {
|
|
1538
1541
|
id: ++this.eventIdCounter,
|
|
1539
1542
|
timestamp: /* @__PURE__ */ new Date(),
|
|
1540
1543
|
message: a.slice(0, 5e3),
|
|
@@ -1542,19 +1545,19 @@ class O0 {
|
|
|
1542
1545
|
};
|
|
1543
1546
|
this.state = {
|
|
1544
1547
|
...this.state,
|
|
1545
|
-
events: [...this.state.events.slice(-201),
|
|
1548
|
+
events: [...this.state.events.slice(-201), f]
|
|
1546
1549
|
}, this.notify();
|
|
1547
1550
|
}
|
|
1548
1551
|
updateManifestState({
|
|
1549
1552
|
manifestStatus: a,
|
|
1550
1553
|
appName: i,
|
|
1551
|
-
error:
|
|
1554
|
+
error: f
|
|
1552
1555
|
}) {
|
|
1553
1556
|
this.state = {
|
|
1554
1557
|
...this.state,
|
|
1555
1558
|
...a ? { manifestStatus: a } : {},
|
|
1556
1559
|
...i ? { appName: i } : {},
|
|
1557
|
-
...
|
|
1560
|
+
...f ? { error: f.slice(0, 5e3) } : { error: void 0 }
|
|
1558
1561
|
}, this.notify();
|
|
1559
1562
|
}
|
|
1560
1563
|
convertEntityTypeToSyncableEntity(a) {
|
|
@@ -1585,18 +1588,18 @@ class O0 {
|
|
|
1585
1588
|
});
|
|
1586
1589
|
}
|
|
1587
1590
|
);
|
|
1588
|
-
const
|
|
1589
|
-
for (const [g, _] of
|
|
1590
|
-
|
|
1591
|
+
const f = new Map(this.state.entities);
|
|
1592
|
+
for (const [g, _] of f)
|
|
1593
|
+
f.set(g, {
|
|
1591
1594
|
..._,
|
|
1592
1595
|
type: i.get(g)
|
|
1593
1596
|
});
|
|
1594
|
-
this.state = { ...this.state, entities:
|
|
1597
|
+
this.state = { ...this.state, entities: f }, this.notify();
|
|
1595
1598
|
}
|
|
1596
1599
|
updateAllFilesStatus(a) {
|
|
1597
1600
|
const i = new Map(this.state.entities);
|
|
1598
|
-
for (const [
|
|
1599
|
-
i.set(
|
|
1601
|
+
for (const [f, g] of i)
|
|
1602
|
+
i.set(f, {
|
|
1600
1603
|
...g,
|
|
1601
1604
|
status: a
|
|
1602
1605
|
});
|
|
@@ -1607,17 +1610,17 @@ class O0 {
|
|
|
1607
1610
|
i.delete(a), this.state = { ...this.state, entities: i };
|
|
1608
1611
|
}
|
|
1609
1612
|
updateFileStatus(a, i) {
|
|
1610
|
-
const
|
|
1613
|
+
const f = new Map(this.state.entities), g = f.get(a);
|
|
1611
1614
|
g?.status && !P0[g.status].find(
|
|
1612
1615
|
(_) => _ === i
|
|
1613
|
-
) || (
|
|
1616
|
+
) || (f.set(
|
|
1614
1617
|
a,
|
|
1615
1618
|
g ? { ...g, status: i } : {
|
|
1616
1619
|
name: a,
|
|
1617
1620
|
path: a,
|
|
1618
1621
|
status: i
|
|
1619
1622
|
}
|
|
1620
|
-
), this.state = { ...this.state, entities:
|
|
1623
|
+
), this.state = { ...this.state, entities: f }, this.notify());
|
|
1621
1624
|
}
|
|
1622
1625
|
}
|
|
1623
1626
|
const Cs = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"], lu = ["↑", "⇡", "↟", "⤒"], Yr = {
|
|
@@ -1639,40 +1642,40 @@ const Cs = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"
|
|
|
1639
1642
|
success: "green",
|
|
1640
1643
|
error: "red",
|
|
1641
1644
|
warning: "yellow"
|
|
1642
|
-
}, M0 = (
|
|
1645
|
+
}, M0 = (l) => {
|
|
1643
1646
|
const a = /* @__PURE__ */ new Map();
|
|
1644
1647
|
for (const i of bu)
|
|
1645
1648
|
a.set(i, []);
|
|
1646
|
-
for (const i of
|
|
1649
|
+
for (const i of l.values()) {
|
|
1647
1650
|
if (!i.type)
|
|
1648
1651
|
continue;
|
|
1649
|
-
const
|
|
1650
|
-
|
|
1652
|
+
const f = a.get(i.type) ?? [];
|
|
1653
|
+
f.push(i), a.set(i.type, f);
|
|
1651
1654
|
}
|
|
1652
1655
|
return a;
|
|
1653
|
-
}, U0 = (
|
|
1656
|
+
}, U0 = (l) => l.toLocaleTimeString("en-US", {
|
|
1654
1657
|
hour12: !1,
|
|
1655
1658
|
hour: "2-digit",
|
|
1656
1659
|
minute: "2-digit",
|
|
1657
1660
|
second: "2-digit"
|
|
1658
|
-
}), N0 = (
|
|
1659
|
-
if (
|
|
1660
|
-
const i =
|
|
1661
|
-
return i.length <= 2 ?
|
|
1662
|
-
}, W0 = (
|
|
1663
|
-
const [a, i] = await Promise.all([import("react"), import("ink")]), { useState:
|
|
1664
|
-
const [
|
|
1661
|
+
}), N0 = (l, a = 40) => {
|
|
1662
|
+
if (l.length <= a) return l;
|
|
1663
|
+
const i = l.split("/");
|
|
1664
|
+
return i.length <= 2 ? l : `.../${i.slice(-2).join("/")}`;
|
|
1665
|
+
}, W0 = (l) => !l.frontendUrl || !l.appUniversalIdentifier ? null : `${l.frontendUrl}/settings/applications`, D0 = async (l) => {
|
|
1666
|
+
const [a, i] = await Promise.all([import("react"), import("ink")]), { useState: f, useEffect: g } = a, { render: _, Box: S, Text: A, Static: I } = i, P = (T, Y = 80) => {
|
|
1667
|
+
const [K, ne] = f(0);
|
|
1665
1668
|
return g(() => {
|
|
1666
1669
|
const qe = setInterval(() => {
|
|
1667
1670
|
ne((ee) => (ee + 1) % T.length);
|
|
1668
1671
|
}, Y);
|
|
1669
1672
|
return () => clearInterval(qe);
|
|
1670
|
-
}, [T.length, Y]), T[
|
|
1673
|
+
}, [T.length, Y]), T[K];
|
|
1671
1674
|
}, z = ({ event: T }) => {
|
|
1672
|
-
const Y = L0[T.status],
|
|
1675
|
+
const Y = L0[T.status], K = U0(T.timestamp);
|
|
1673
1676
|
return /* @__PURE__ */ ye(S, { children: [
|
|
1674
1677
|
/* @__PURE__ */ ye(A, { dimColor: !0, children: [
|
|
1675
|
-
|
|
1678
|
+
K,
|
|
1676
1679
|
" "
|
|
1677
1680
|
] }),
|
|
1678
1681
|
/* @__PURE__ */ ie(A, { color: Y, children: T.message })
|
|
@@ -1680,9 +1683,9 @@ const Cs = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"
|
|
|
1680
1683
|
}, G = ({
|
|
1681
1684
|
status: T
|
|
1682
1685
|
}) => {
|
|
1683
|
-
const Y = P(Cs, 200),
|
|
1686
|
+
const Y = P(Cs, 200), K = P(lu, 200), ne = {
|
|
1684
1687
|
building: Y,
|
|
1685
|
-
uploading:
|
|
1688
|
+
uploading: K,
|
|
1686
1689
|
pending: Yr.pending,
|
|
1687
1690
|
success: Yr.success
|
|
1688
1691
|
};
|
|
@@ -1690,7 +1693,7 @@ const Cs = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"
|
|
|
1690
1693
|
ne[T],
|
|
1691
1694
|
" "
|
|
1692
1695
|
] });
|
|
1693
|
-
},
|
|
1696
|
+
}, j = ({
|
|
1694
1697
|
entity: T
|
|
1695
1698
|
}) => /* @__PURE__ */ ye(S, { children: [
|
|
1696
1699
|
/* @__PURE__ */ ie(G, { status: T.status }),
|
|
@@ -1705,7 +1708,7 @@ const Cs = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"
|
|
|
1705
1708
|
entities: Y
|
|
1706
1709
|
}) => Y.length === 0 ? null : /* @__PURE__ */ ye(S, { flexDirection: "column", marginTop: 1, children: [
|
|
1707
1710
|
/* @__PURE__ */ ie(A, { bold: !0, dimColor: !0, children: Eu[T] }),
|
|
1708
|
-
Y.map((
|
|
1711
|
+
Y.map((K) => /* @__PURE__ */ ie(j, { entity: K }, K.path))
|
|
1709
1712
|
] }), ae = {
|
|
1710
1713
|
synced: { color: "green", icon: "✓", text: "Synced" },
|
|
1711
1714
|
building: { color: "yellow", icon: "spinner", text: "Building..." },
|
|
@@ -1715,16 +1718,16 @@ const Cs = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"
|
|
|
1715
1718
|
}, Oe = ({
|
|
1716
1719
|
snapshot: T
|
|
1717
1720
|
}) => {
|
|
1718
|
-
const Y = P(Cs, 80),
|
|
1719
|
-
return /* @__PURE__ */ ye(A, { color:
|
|
1721
|
+
const Y = P(Cs, 80), K = ae[T.manifestStatus], ne = K.icon === "spinner" ? Y : K.icon;
|
|
1722
|
+
return /* @__PURE__ */ ye(A, { color: K.color, children: [
|
|
1720
1723
|
ne ? `${ne} ` : "",
|
|
1721
|
-
|
|
1724
|
+
K.text,
|
|
1722
1725
|
T.error && `: ${T.error}`
|
|
1723
1726
|
] });
|
|
1724
1727
|
}, fe = ({
|
|
1725
1728
|
snapshot: T
|
|
1726
1729
|
}) => {
|
|
1727
|
-
const Y = M0(T.entities),
|
|
1730
|
+
const Y = M0(T.entities), K = W0(T);
|
|
1728
1731
|
return /* @__PURE__ */ ye(
|
|
1729
1732
|
S,
|
|
1730
1733
|
{
|
|
@@ -1747,11 +1750,11 @@ const Cs = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"
|
|
|
1747
1750
|
/* @__PURE__ */ ie(A, { dimColor: !0, children: "Status: " }),
|
|
1748
1751
|
/* @__PURE__ */ ie(Oe, { snapshot: T })
|
|
1749
1752
|
] }),
|
|
1750
|
-
|
|
1753
|
+
K && /* @__PURE__ */ ye(S, { children: [
|
|
1751
1754
|
/* @__PURE__ */ ie(A, { dimColor: !0, children: "Open:" }),
|
|
1752
1755
|
/* @__PURE__ */ ye(A, { bold: !0, color: "cyan", children: [
|
|
1753
1756
|
" ",
|
|
1754
|
-
|
|
1757
|
+
K
|
|
1755
1758
|
] })
|
|
1756
1759
|
] })
|
|
1757
1760
|
] }),
|
|
@@ -1777,11 +1780,11 @@ const Cs = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"
|
|
|
1777
1780
|
" ",
|
|
1778
1781
|
"success"
|
|
1779
1782
|
] }) }), Ft = () => {
|
|
1780
|
-
const [T, Y] =
|
|
1781
|
-
|
|
1783
|
+
const [T, Y] = f(
|
|
1784
|
+
l.getSnapshot()
|
|
1782
1785
|
);
|
|
1783
|
-
return g(() =>
|
|
1784
|
-
/* @__PURE__ */ ie(I, { items: T.events, children: (
|
|
1786
|
+
return g(() => l.subscribe(Y), []), /* @__PURE__ */ ye(ym, { children: [
|
|
1787
|
+
/* @__PURE__ */ ie(I, { items: T.events, children: (K) => /* @__PURE__ */ ie(z, { event: K }, K.id) }),
|
|
1785
1788
|
/* @__PURE__ */ ye(S, { marginTop: 1, flexDirection: "column", children: [
|
|
1786
1789
|
/* @__PURE__ */ ie(fe, { snapshot: T }),
|
|
1787
1790
|
/* @__PURE__ */ ie(Le, {})
|
|
@@ -1807,26 +1810,26 @@ class fu {
|
|
|
1807
1810
|
pollInterval: 50
|
|
1808
1811
|
},
|
|
1809
1812
|
usePolling: !0
|
|
1810
|
-
}), this.watcher.on("all", (i,
|
|
1811
|
-
i !== "addDir" && ((i === "add" || i === "change") && this.copyAndNotify(
|
|
1813
|
+
}), this.watcher.on("all", (i, f) => {
|
|
1814
|
+
i !== "addDir" && ((i === "add" || i === "change") && this.copyAndNotify(f), i === "unlink" && this.handleUnlink(f));
|
|
1812
1815
|
});
|
|
1813
1816
|
}
|
|
1814
1817
|
async close() {
|
|
1815
1818
|
await this.watcher?.close();
|
|
1816
1819
|
}
|
|
1817
1820
|
async copyAndNotify(a) {
|
|
1818
|
-
const i = ft(this.appPath, a),
|
|
1821
|
+
const i = ft(this.appPath, a), f = st(jt, i), g = st(this.appPath, f);
|
|
1819
1822
|
await Q.ensureDir(um(g)), await Q.copy(a, g);
|
|
1820
1823
|
const _ = await Q.readFile(g), S = du.createHash("md5").update(_).digest("hex");
|
|
1821
1824
|
this.handleFileBuilt({
|
|
1822
1825
|
fileFolder: this.fileFolder,
|
|
1823
|
-
builtPath:
|
|
1826
|
+
builtPath: f,
|
|
1824
1827
|
sourcePath: i,
|
|
1825
1828
|
checksum: S
|
|
1826
1829
|
});
|
|
1827
1830
|
}
|
|
1828
1831
|
async handleUnlink(a) {
|
|
1829
|
-
const i = ft(this.appPath, a),
|
|
1832
|
+
const i = ft(this.appPath, a), f = st(jt, i), g = st(this.appPath, f);
|
|
1830
1833
|
await Q.remove(g);
|
|
1831
1834
|
}
|
|
1832
1835
|
}
|
|
@@ -1856,7 +1859,7 @@ class $0 {
|
|
|
1856
1859
|
}), await this.startManifestWatcher(), this.setupGracefulShutdown();
|
|
1857
1860
|
}
|
|
1858
1861
|
async cleanOutputDir() {
|
|
1859
|
-
const a = me.join(this.appPath,
|
|
1862
|
+
const a = me.join(this.appPath, jt);
|
|
1860
1863
|
await Q.ensureDir(a), await Q.emptyDir(a);
|
|
1861
1864
|
}
|
|
1862
1865
|
async startManifestWatcher() {
|
|
@@ -1868,12 +1871,12 @@ class $0 {
|
|
|
1868
1871
|
}), await this.manifestWatcher.start();
|
|
1869
1872
|
}
|
|
1870
1873
|
async handleWatcherRestarts(a) {
|
|
1871
|
-
const { logicFunctions: i, frontComponents:
|
|
1874
|
+
const { logicFunctions: i, frontComponents: f } = a.filePaths;
|
|
1872
1875
|
if (!this.watchersStarted) {
|
|
1873
|
-
this.watchersStarted = !0, await this.startFileWatchers(i,
|
|
1876
|
+
this.watchersStarted = !0, await this.startFileWatchers(i, f);
|
|
1874
1877
|
return;
|
|
1875
1878
|
}
|
|
1876
|
-
this.logicFunctionsWatcher?.shouldRestart(i) && await this.logicFunctionsWatcher.restart(i), this.frontComponentsWatcher?.shouldRestart(
|
|
1879
|
+
this.logicFunctionsWatcher?.shouldRestart(i) && await this.logicFunctionsWatcher.restart(i), this.frontComponentsWatcher?.shouldRestart(f) && await this.frontComponentsWatcher.restart(f);
|
|
1877
1880
|
}
|
|
1878
1881
|
async startFileWatchers(a, i) {
|
|
1879
1882
|
await Promise.all([
|
|
@@ -1940,7 +1943,7 @@ class k0 {
|
|
|
1940
1943
|
async generate(a) {
|
|
1941
1944
|
const i = st(a, B0);
|
|
1942
1945
|
console.log(E.blue("📦 Generating Twenty client...")), console.log(E.gray(`📁 Output Path: ${i}`)), console.log("");
|
|
1943
|
-
const
|
|
1946
|
+
const f = await this.configService.getConfig(), g = f.apiUrl, _ = f.apiKey;
|
|
1944
1947
|
if (!g || !_) {
|
|
1945
1948
|
console.log(
|
|
1946
1949
|
E.yellow(
|
|
@@ -2072,18 +2075,18 @@ class G0 {
|
|
|
2072
2075
|
}) {
|
|
2073
2076
|
try {
|
|
2074
2077
|
console.log(E.blue("🚀 Uninstall Twenty Application")), console.log(E.gray(`📁 App Path: ${a}`)), console.log(""), i && !await this.confirmationPrompt() && (console.error(E.red("⛔️ Aborting uninstall")), process.exit(1));
|
|
2075
|
-
const { manifest:
|
|
2076
|
-
if (!
|
|
2078
|
+
const { manifest: f } = await Vr(a);
|
|
2079
|
+
if (!f)
|
|
2077
2080
|
return { success: !1, error: "Build failed" };
|
|
2078
2081
|
const g = await this.apiService.uninstallApplication(
|
|
2079
|
-
|
|
2082
|
+
f.application.universalIdentifier
|
|
2080
2083
|
);
|
|
2081
2084
|
return g.success === !1 ? console.error(E.red("❌ Uninstall failed:"), g.error) : console.log(E.green("✅ Application uninstalled successfully")), g;
|
|
2082
|
-
} catch (
|
|
2085
|
+
} catch (f) {
|
|
2083
2086
|
throw console.error(
|
|
2084
2087
|
E.red("Uninstall failed:"),
|
|
2085
|
-
|
|
2086
|
-
),
|
|
2088
|
+
f instanceof Error ? f.message : f
|
|
2089
|
+
), f;
|
|
2087
2090
|
}
|
|
2088
2091
|
}
|
|
2089
2092
|
async confirmationPrompt() {
|
|
@@ -2115,9 +2118,9 @@ class H0 {
|
|
|
2115
2118
|
}
|
|
2116
2119
|
console.log(E.blue(`Available workspaces:
|
|
2117
2120
|
`));
|
|
2118
|
-
for (const
|
|
2119
|
-
const g = await this.configService.getConfigForWorkspace(
|
|
2120
|
-
console.log(` ${I} ${
|
|
2121
|
+
for (const f of a) {
|
|
2122
|
+
const g = await this.configService.getConfigForWorkspace(f), _ = !!g.apiKey, A = f === i ? E.green(" (default)") : "", I = _ ? E.green("●") : E.gray("○");
|
|
2123
|
+
console.log(` ${I} ${f}${A}`), console.log(E.gray(` API URL: ${g.apiUrl}`));
|
|
2121
2124
|
}
|
|
2122
2125
|
console.log(""), console.log(E.gray("● = authenticated, ○ = no credentials")), console.log(
|
|
2123
2126
|
E.gray("Use `twenty auth:switch <workspace>` to change default")
|
|
@@ -2130,15 +2133,15 @@ class H0 {
|
|
|
2130
2133
|
}
|
|
2131
2134
|
}
|
|
2132
2135
|
}
|
|
2133
|
-
class
|
|
2136
|
+
class j0 {
|
|
2134
2137
|
constructor() {
|
|
2135
2138
|
this.configService = new Ae(), this.apiService = new Ct();
|
|
2136
2139
|
}
|
|
2137
2140
|
async execute(a) {
|
|
2138
2141
|
try {
|
|
2139
|
-
let { apiKey: i, apiUrl:
|
|
2142
|
+
let { apiKey: i, apiUrl: f } = a;
|
|
2140
2143
|
const g = await this.configService.getConfig();
|
|
2141
|
-
if (
|
|
2144
|
+
if (f || (f = (await At.prompt([
|
|
2142
2145
|
{
|
|
2143
2146
|
type: "input",
|
|
2144
2147
|
name: "apiUrl",
|
|
@@ -2161,7 +2164,7 @@ class K0 {
|
|
|
2161
2164
|
validate: (A) => A.length > 0 || "API key is required"
|
|
2162
2165
|
}
|
|
2163
2166
|
])).apiKey), await this.configService.setConfig({
|
|
2164
|
-
apiUrl:
|
|
2167
|
+
apiUrl: f,
|
|
2165
2168
|
apiKey: i
|
|
2166
2169
|
}), (await this.apiService.validateAuth()).authValid) {
|
|
2167
2170
|
const S = Ae.getActiveWorkspace();
|
|
@@ -2182,7 +2185,7 @@ class K0 {
|
|
|
2182
2185
|
}
|
|
2183
2186
|
}
|
|
2184
2187
|
}
|
|
2185
|
-
class
|
|
2188
|
+
class K0 {
|
|
2186
2189
|
constructor() {
|
|
2187
2190
|
this.configService = new Ae();
|
|
2188
2191
|
}
|
|
@@ -2213,9 +2216,9 @@ class z0 {
|
|
|
2213
2216
|
if (console.log(E.blue("Authentication Status:")), console.log(`Workspace: ${a}`), console.log(`API URL: ${i.apiUrl}`), console.log(
|
|
2214
2217
|
`API Key: ${i.apiKey ? "***" + i.apiKey.slice(-4) : "Not set"}`
|
|
2215
2218
|
), i.apiKey) {
|
|
2216
|
-
const
|
|
2219
|
+
const f = await this.apiService.validateAuth();
|
|
2217
2220
|
console.log(
|
|
2218
|
-
`Status: ${
|
|
2221
|
+
`Status: ${f.authValid ? E.green("✓ Valid") : E.red("✗ Invalid")}`
|
|
2219
2222
|
);
|
|
2220
2223
|
} else
|
|
2221
2224
|
console.log(`Status: ${E.yellow("⚠ Not authenticated")}`);
|
|
@@ -2234,7 +2237,7 @@ class J0 {
|
|
|
2234
2237
|
async execute({
|
|
2235
2238
|
appPath: a = bt,
|
|
2236
2239
|
functionUniversalIdentifier: i,
|
|
2237
|
-
functionName:
|
|
2240
|
+
functionName: f,
|
|
2238
2241
|
payload: g = "{}"
|
|
2239
2242
|
}) {
|
|
2240
2243
|
try {
|
|
@@ -2255,9 +2258,9 @@ class J0 {
|
|
|
2255
2258
|
), process.exit(1));
|
|
2256
2259
|
const I = A.data.filter(
|
|
2257
2260
|
(B) => B.universalIdentifier && this.belongsToApplication(B, S)
|
|
2258
|
-
), P = I.find((B) => i ? B.universalIdentifier === i :
|
|
2261
|
+
), P = I.find((B) => i ? B.universalIdentifier === i : f ? B.name === f : !1);
|
|
2259
2262
|
if (!P) {
|
|
2260
|
-
const B = i ||
|
|
2263
|
+
const B = i || f;
|
|
2261
2264
|
console.error(
|
|
2262
2265
|
E.red(`Function "${B}" not found in application.`)
|
|
2263
2266
|
), console.log(""), I.length > 0 ? (console.log(E.cyan("Available functions:")), I.forEach((ae) => {
|
|
@@ -2283,9 +2286,9 @@ class J0 {
|
|
|
2283
2286
|
), process.exit(1));
|
|
2284
2287
|
const G = z.data;
|
|
2285
2288
|
console.log(E.cyan("─".repeat(60))), console.log(E.cyan("Execution Result")), console.log(E.cyan("─".repeat(60)));
|
|
2286
|
-
const
|
|
2289
|
+
const j = G.status === "SUCCESS" ? E.green : E.red;
|
|
2287
2290
|
console.log(
|
|
2288
|
-
`${E.bold("Status:")} ${
|
|
2291
|
+
`${E.bold("Status:")} ${j(G.status)}`
|
|
2289
2292
|
), console.log(`${E.bold("Duration:")} ${G.duration}ms`), Pn(G.data) && (console.log(""), console.log(E.bold("Data:")), console.log(E.white(JSON.stringify(G.data, null, 2)))), G.error && (console.log(""), console.log(E.bold.red("Error:")), console.log(E.red(` Type: ${G.error.errorType}`)), console.log(
|
|
2290
2293
|
E.red(` Message: ${G.error.errorMessage}`)
|
|
2291
2294
|
), G.error.stackTrace && (console.log(""), console.log(E.gray("Stack trace:")), console.log(E.gray(G.error.stackTrace)))), G.logs && (console.log(""), console.log(E.bold("Logs:")), console.log(E.gray(G.logs))), console.log(E.cyan("─".repeat(60))), G.status !== "SUCCESS" && process.exit(1);
|
|
@@ -2298,7 +2301,7 @@ class J0 {
|
|
|
2298
2301
|
}
|
|
2299
2302
|
belongsToApplication(a, i) {
|
|
2300
2303
|
return i.logicFunctions.some(
|
|
2301
|
-
(
|
|
2304
|
+
(f) => f.universalIdentifier === a.universalIdentifier
|
|
2302
2305
|
);
|
|
2303
2306
|
}
|
|
2304
2307
|
}
|
|
@@ -2309,18 +2312,18 @@ class Y0 {
|
|
|
2309
2312
|
async execute({
|
|
2310
2313
|
appPath: a = bt,
|
|
2311
2314
|
functionUniversalIdentifier: i,
|
|
2312
|
-
functionName:
|
|
2315
|
+
functionName: f
|
|
2313
2316
|
}) {
|
|
2314
2317
|
try {
|
|
2315
2318
|
const { manifest: g } = await Vr(a);
|
|
2316
2319
|
g || process.exit(1), this.logWatchInfo({
|
|
2317
2320
|
appName: g.application.displayName,
|
|
2318
2321
|
functionUniversalIdentifier: i,
|
|
2319
|
-
functionName:
|
|
2322
|
+
functionName: f
|
|
2320
2323
|
}), await this.apiService.subscribeToLogs({
|
|
2321
2324
|
applicationUniversalIdentifier: g.application.universalIdentifier,
|
|
2322
2325
|
functionUniversalIdentifier: i,
|
|
2323
|
-
functionName:
|
|
2326
|
+
functionName: f
|
|
2324
2327
|
});
|
|
2325
2328
|
} catch (g) {
|
|
2326
2329
|
console.error(
|
|
@@ -2332,9 +2335,9 @@ class Y0 {
|
|
|
2332
2335
|
logWatchInfo({
|
|
2333
2336
|
appName: a,
|
|
2334
2337
|
functionUniversalIdentifier: i,
|
|
2335
|
-
functionName:
|
|
2338
|
+
functionName: f
|
|
2336
2339
|
}) {
|
|
2337
|
-
const g = a ?? "Twenty Application", _ = i ||
|
|
2340
|
+
const g = a ?? "Twenty Application", _ = i || f ? `function "${i || f}"` : "functions";
|
|
2338
2341
|
console.log(
|
|
2339
2342
|
E.blue(`🚀 Watching ${g} ${_} logs:`)
|
|
2340
2343
|
), console.log("");
|
|
@@ -2347,8 +2350,8 @@ class Z0 {
|
|
|
2347
2350
|
async execute(a) {
|
|
2348
2351
|
try {
|
|
2349
2352
|
let { workspace: i } = a;
|
|
2350
|
-
const
|
|
2351
|
-
if (
|
|
2353
|
+
const f = await this.configService.getAvailableWorkspaces(), g = await this.configService.getDefaultWorkspace();
|
|
2354
|
+
if (f.length === 0) {
|
|
2352
2355
|
console.log(
|
|
2353
2356
|
E.yellow(
|
|
2354
2357
|
"⚠ No workspaces configured. Use `twenty auth:login` to create one."
|
|
@@ -2357,7 +2360,7 @@ class Z0 {
|
|
|
2357
2360
|
return;
|
|
2358
2361
|
}
|
|
2359
2362
|
if (!i) {
|
|
2360
|
-
const A =
|
|
2363
|
+
const A = f.map((P) => ({
|
|
2361
2364
|
name: P === g ? `${P} (current default)` : P,
|
|
2362
2365
|
value: P
|
|
2363
2366
|
}));
|
|
@@ -2371,9 +2374,9 @@ class Z0 {
|
|
|
2371
2374
|
}
|
|
2372
2375
|
])).workspace;
|
|
2373
2376
|
}
|
|
2374
|
-
if (
|
|
2377
|
+
if (f.includes(i) || (console.log(
|
|
2375
2378
|
E.red(
|
|
2376
|
-
`✗ Workspace "${i}" not found. Available workspaces: ${
|
|
2379
|
+
`✗ Workspace "${i}" not found. Available workspaces: ${f.join(", ")}`
|
|
2377
2380
|
)
|
|
2378
2381
|
), process.exit(1)), i === g) {
|
|
2379
2382
|
console.log(
|
|
@@ -2406,7 +2409,7 @@ var Fs, hu;
|
|
|
2406
2409
|
function X0() {
|
|
2407
2410
|
if (hu) return Fs;
|
|
2408
2411
|
hu = 1;
|
|
2409
|
-
var
|
|
2412
|
+
var l = "[object Symbol]", a = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g, i = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g, f = "\\ud800-\\udfff", g = "\\u0300-\\u036f\\ufe20-\\ufe23", _ = "\\u20d0-\\u20f0", S = "\\u2700-\\u27bf", A = "a-z\\xdf-\\xf6\\xf8-\\xff", I = "\\xac\\xb1\\xd7\\xf7", P = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", z = "\\u2000-\\u206f", G = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", j = "A-Z\\xc0-\\xd6\\xd8-\\xde", B = "\\ufe0e\\ufe0f", ae = I + P + z + G, Oe = "['’]", fe = "[" + ae + "]", Le = "[" + g + _ + "]", Ft = "\\d+", Fe = "[" + S + "]", T = "[" + A + "]", Y = "[^" + f + ae + Ft + S + A + j + "]", K = "\\ud83c[\\udffb-\\udfff]", ne = "(?:" + Le + "|" + K + ")", qe = "[^" + f + "]", ee = "(?:\\ud83c[\\udde6-\\uddff]){2}", Kt = "[\\ud800-\\udbff][\\udc00-\\udfff]", Ge = "[" + j + "]", ht = "\\u200d", Tt = "(?:" + T + "|" + Y + ")", er = "(?:" + Ge + "|" + Y + ")", tr = "(?:" + Oe + "(?:d|ll|m|re|s|t|ve))?", nr = "(?:" + Oe + "(?:D|LL|M|RE|S|T|VE))?", at = ne + "?", Ve = "[" + B + "]?", ei = "(?:" + ht + "(?:" + [qe, ee, Kt].join("|") + ")" + Ve + at + ")*", cn = Ve + at + ei, He = "(?:" + [Fe, ee, Kt].join("|") + ")" + cn, ti = RegExp(Oe, "g"), ni = RegExp(Le, "g"), ri = RegExp([
|
|
2410
2413
|
Ge + "?" + T + "+" + tr + "(?=" + [fe, Ge, "$"].join("|") + ")",
|
|
2411
2414
|
er + "+" + nr + "(?=" + [fe, Ge + Tt, "$"].join("|") + ")",
|
|
2412
2415
|
Ge + "?" + Tt + "+" + tr,
|
|
@@ -2645,7 +2648,7 @@ function X0() {
|
|
|
2645
2648
|
return !!O && typeof O == "object";
|
|
2646
2649
|
}
|
|
2647
2650
|
function oi(O) {
|
|
2648
|
-
return typeof O == "symbol" || pn(O) && et.call(O) ==
|
|
2651
|
+
return typeof O == "symbol" || pn(O) && et.call(O) == l;
|
|
2649
2652
|
}
|
|
2650
2653
|
function Pt(O) {
|
|
2651
2654
|
return O == null ? "" : Ue(O);
|
|
@@ -2662,11 +2665,11 @@ function X0() {
|
|
|
2662
2665
|
return Fs = Xt, Fs;
|
|
2663
2666
|
}
|
|
2664
2667
|
var Q0 = X0();
|
|
2665
|
-
const Rn = /* @__PURE__ */
|
|
2666
|
-
name:
|
|
2668
|
+
const Rn = /* @__PURE__ */ bm(Q0), V0 = ({
|
|
2669
|
+
name: l,
|
|
2667
2670
|
universalIdentifier: a = Vn()
|
|
2668
2671
|
}) => {
|
|
2669
|
-
const i = Rn(
|
|
2672
|
+
const i = Rn(l);
|
|
2670
2673
|
return `import { defineFrontComponent } from 'twenty-sdk';
|
|
2671
2674
|
|
|
2672
2675
|
// React component - implement your UI here
|
|
@@ -2687,10 +2690,10 @@ export default defineFrontComponent({
|
|
|
2687
2690
|
});
|
|
2688
2691
|
`;
|
|
2689
2692
|
}, ev = ({
|
|
2690
|
-
name:
|
|
2693
|
+
name: l,
|
|
2691
2694
|
universalIdentifier: a = Vn()
|
|
2692
2695
|
}) => {
|
|
2693
|
-
const i = Rn(
|
|
2696
|
+
const i = Rn(l);
|
|
2694
2697
|
return `import { defineLogicFunction } from 'twenty-sdk';
|
|
2695
2698
|
|
|
2696
2699
|
// Logic function handler - rename and implement your logic
|
|
@@ -2742,9 +2745,9 @@ var Qn = { exports: {} };
|
|
|
2742
2745
|
*/
|
|
2743
2746
|
var tv = Qn.exports, pu;
|
|
2744
2747
|
function nv() {
|
|
2745
|
-
return pu || (pu = 1, function(
|
|
2748
|
+
return pu || (pu = 1, function(l, a) {
|
|
2746
2749
|
(function() {
|
|
2747
|
-
var i,
|
|
2750
|
+
var i, f = "4.17.21", g = 200, _ = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.", S = "Expected a function", A = "Invalid `variable` option passed into `_.template`", I = "__lodash_hash_undefined__", P = 500, z = "__lodash_placeholder__", G = 1, j = 2, B = 4, ae = 1, Oe = 2, fe = 1, Le = 2, Ft = 4, Fe = 8, T = 16, Y = 32, K = 64, ne = 128, qe = 256, ee = 512, Kt = 30, Ge = "...", ht = 800, Tt = 16, er = 1, tr = 2, nr = 3, at = 1 / 0, Ve = 9007199254740991, ei = 17976931348623157e292, cn = NaN, He = 4294967295, ti = He - 1, ni = He >>> 1, ri = [
|
|
2748
2751
|
["ary", ne],
|
|
2749
2752
|
["bind", fe],
|
|
2750
2753
|
["bindKey", Le],
|
|
@@ -2752,9 +2755,9 @@ function nv() {
|
|
|
2752
2755
|
["curryRight", T],
|
|
2753
2756
|
["flip", ee],
|
|
2754
2757
|
["partial", Y],
|
|
2755
|
-
["partialRight",
|
|
2758
|
+
["partialRight", K],
|
|
2756
2759
|
["rearg", qe]
|
|
2757
|
-
], It = "[object Arguments]", ln = "[object Array]", ii = "[object AsyncFunction]", zt = "[object Boolean]", Jt = "[object Date]", si = "[object DOMException]", fn = "[object Error]", hn = "[object Function]", rr = "[object GeneratorFunction]", Me = "[object Map]", Yt = "[object Number]", ai = "[object Null]", et = "[object Object]", Ln = "[object Promise]", ir = "[object Proxy]", Rt = "[object RegExp]", Ue = "[object Set]", Zt = "[object String]", pn = "[object Symbol]", oi = "[object Undefined]", Pt = "[object WeakMap]", ui = "[object WeakSet]", Xt = "[object ArrayBuffer]", Ot = "[object DataView]", O = "[object Float32Array]", he = "[object Float64Array]", ot = "[object Int8Array]", sr = "[object Int16Array]", Qt = "[object Int32Array]", Mn = "[object Uint8Array]", ci = "[object Uint8ClampedArray]", li = "[object Uint16Array]", fi = "[object Uint32Array]", Cu = /\b__p \+= '';/g, Fu = /\b(__p \+=) '' \+/g, Tu = /(__e\(.*?\)|\b__t\)) \+\n'';/g, Ps = /&(?:amp|lt|gt|quot|#39);/g, Os = /[&<>"']/g, Iu = RegExp(Ps.source), Ru = RegExp(Os.source), Pu = /<%-([\s\S]+?)%>/g, Ou = /<%([\s\S]+?)%>/g, Ls = /<%=([\s\S]+?)%>/g, Lu = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, Mu = /^\w*$/, Uu = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, hi = /[\\^$.*+?()[\]{}|]/g, Nu = RegExp(hi.source), pi = /^\s+/, Wu = /\s/, Du = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, $u = /\{\n\/\* \[wrapped with (.+)\] \*/, Bu = /,? & /, ku = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g, qu = /[()=,{}\[\]\/\s]/, Gu = /\\(\\)?/g, Hu = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g, Ms = /\w*$/,
|
|
2760
|
+
], It = "[object Arguments]", ln = "[object Array]", ii = "[object AsyncFunction]", zt = "[object Boolean]", Jt = "[object Date]", si = "[object DOMException]", fn = "[object Error]", hn = "[object Function]", rr = "[object GeneratorFunction]", Me = "[object Map]", Yt = "[object Number]", ai = "[object Null]", et = "[object Object]", Ln = "[object Promise]", ir = "[object Proxy]", Rt = "[object RegExp]", Ue = "[object Set]", Zt = "[object String]", pn = "[object Symbol]", oi = "[object Undefined]", Pt = "[object WeakMap]", ui = "[object WeakSet]", Xt = "[object ArrayBuffer]", Ot = "[object DataView]", O = "[object Float32Array]", he = "[object Float64Array]", ot = "[object Int8Array]", sr = "[object Int16Array]", Qt = "[object Int32Array]", Mn = "[object Uint8Array]", ci = "[object Uint8ClampedArray]", li = "[object Uint16Array]", fi = "[object Uint32Array]", Cu = /\b__p \+= '';/g, Fu = /\b(__p \+=) '' \+/g, Tu = /(__e\(.*?\)|\b__t\)) \+\n'';/g, Ps = /&(?:amp|lt|gt|quot|#39);/g, Os = /[&<>"']/g, Iu = RegExp(Ps.source), Ru = RegExp(Os.source), Pu = /<%-([\s\S]+?)%>/g, Ou = /<%([\s\S]+?)%>/g, Ls = /<%=([\s\S]+?)%>/g, Lu = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, Mu = /^\w*$/, Uu = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, hi = /[\\^$.*+?()[\]{}|]/g, Nu = RegExp(hi.source), pi = /^\s+/, Wu = /\s/, Du = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, $u = /\{\n\/\* \[wrapped with (.+)\] \*/, Bu = /,? & /, ku = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g, qu = /[()=,{}\[\]\/\s]/, Gu = /\\(\\)?/g, Hu = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g, Ms = /\w*$/, ju = /^[-+]0x[0-9a-f]+$/i, Ku = /^0b[01]+$/i, zu = /^\[object .+?Constructor\]$/, Ju = /^0o[0-7]+$/i, Yu = /^(?:0|[1-9]\d*)$/, Zu = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g, ar = /($^)/, Xu = /['\n\r\u2028\u2029\\]/g, or = "\\ud800-\\udfff", Qu = "\\u0300-\\u036f", Vu = "\\ufe20-\\ufe2f", ec = "\\u20d0-\\u20ff", Us = Qu + Vu + ec, Ns = "\\u2700-\\u27bf", Ws = "a-z\\xdf-\\xf6\\xf8-\\xff", tc = "\\xac\\xb1\\xd7\\xf7", nc = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", rc = "\\u2000-\\u206f", ic = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", Ds = "A-Z\\xc0-\\xd6\\xd8-\\xde", $s = "\\ufe0e\\ufe0f", Bs = tc + nc + rc + ic, di = "['’]", sc = "[" + or + "]", ks = "[" + Bs + "]", ur = "[" + Us + "]", qs = "\\d+", ac = "[" + Ns + "]", Gs = "[" + Ws + "]", Hs = "[^" + or + Bs + qs + Ns + Ws + Ds + "]", gi = "\\ud83c[\\udffb-\\udfff]", oc = "(?:" + ur + "|" + gi + ")", js = "[^" + or + "]", mi = "(?:\\ud83c[\\udde6-\\uddff]){2}", vi = "[\\ud800-\\udbff][\\udc00-\\udfff]", dn = "[" + Ds + "]", Ks = "\\u200d", zs = "(?:" + Gs + "|" + Hs + ")", uc = "(?:" + dn + "|" + Hs + ")", Js = "(?:" + di + "(?:d|ll|m|re|s|t|ve))?", Ys = "(?:" + di + "(?:D|LL|M|RE|S|T|VE))?", Zs = oc + "?", Xs = "[" + $s + "]?", cc = "(?:" + Ks + "(?:" + [js, mi, vi].join("|") + ")" + Xs + Zs + ")*", lc = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", fc = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", Qs = Xs + Zs + cc, hc = "(?:" + [ac, mi, vi].join("|") + ")" + Qs, pc = "(?:" + [js + ur + "?", ur, mi, vi, sc].join("|") + ")", dc = RegExp(di, "g"), gc = RegExp(ur, "g"), _i = RegExp(gi + "(?=" + gi + ")|" + pc + Qs, "g"), mc = RegExp([
|
|
2758
2761
|
dn + "?" + Gs + "+" + Js + "(?=" + [ks, dn, "$"].join("|") + ")",
|
|
2759
2762
|
uc + "+" + Ys + "(?=" + [ks, dn + zs, "$"].join("|") + ")",
|
|
2760
2763
|
dn + "?" + zs + "+" + Js,
|
|
@@ -2763,7 +2766,7 @@ function nv() {
|
|
|
2763
2766
|
lc,
|
|
2764
2767
|
qs,
|
|
2765
2768
|
hc
|
|
2766
|
-
].join("|"), "g"), vc = RegExp("[" +
|
|
2769
|
+
].join("|"), "g"), vc = RegExp("[" + Ks + or + Us + $s + "]"), _c = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/, wc = [
|
|
2767
2770
|
"Array",
|
|
2768
2771
|
"Buffer",
|
|
2769
2772
|
"DataView",
|
|
@@ -3010,13 +3013,13 @@ function nv() {
|
|
|
3010
3013
|
"\r": "r",
|
|
3011
3014
|
"\u2028": "u2028",
|
|
3012
3015
|
"\u2029": "u2029"
|
|
3013
|
-
}, bc = parseFloat, Cc = parseInt, Vs = typeof Ht == "object" && Ht && Ht.Object === Object && Ht, Fc = typeof self == "object" && self && self.Object === Object && self, _e = Vs || Fc || Function("return this")(), wi = a && !a.nodeType && a, Vt = wi && !0 &&
|
|
3016
|
+
}, bc = parseFloat, Cc = parseInt, Vs = typeof Ht == "object" && Ht && Ht.Object === Object && Ht, Fc = typeof self == "object" && self && self.Object === Object && self, _e = Vs || Fc || Function("return this")(), wi = a && !a.nodeType && a, Vt = wi && !0 && l && !l.nodeType && l, ea = Vt && Vt.exports === wi, yi = ea && Vs.process, je = function() {
|
|
3014
3017
|
try {
|
|
3015
3018
|
var p = Vt && Vt.require && Vt.require("util").types;
|
|
3016
3019
|
return p || yi && yi.binding && yi.binding("util");
|
|
3017
3020
|
} catch {
|
|
3018
3021
|
}
|
|
3019
|
-
}(), ta =
|
|
3022
|
+
}(), ta = je && je.isArrayBuffer, na = je && je.isDate, ra = je && je.isMap, ia = je && je.isRegExp, sa = je && je.isSet, aa = je && je.isTypedArray;
|
|
3020
3023
|
function Ne(p, v, m) {
|
|
3021
3024
|
switch (m.length) {
|
|
3022
3025
|
case 0:
|
|
@@ -3037,7 +3040,7 @@ function nv() {
|
|
|
3037
3040
|
}
|
|
3038
3041
|
return C;
|
|
3039
3042
|
}
|
|
3040
|
-
function
|
|
3043
|
+
function Ke(p, v) {
|
|
3041
3044
|
for (var m = -1, C = p == null ? 0 : p.length; ++m < C && v(p[m], m, p) !== !1; )
|
|
3042
3045
|
;
|
|
3043
3046
|
return p;
|
|
@@ -3119,7 +3122,7 @@ function nv() {
|
|
|
3119
3122
|
return -1;
|
|
3120
3123
|
}
|
|
3121
3124
|
function gn(p, v, m) {
|
|
3122
|
-
return v === v ?
|
|
3125
|
+
return v === v ? jc(p, v, m) : lr(p, ca, m);
|
|
3123
3126
|
}
|
|
3124
3127
|
function Mc(p, v, m, C) {
|
|
3125
3128
|
for (var U = m - 1, J = p.length; ++U < J; )
|
|
@@ -3251,13 +3254,13 @@ function nv() {
|
|
|
3251
3254
|
m[++v] = [C, C];
|
|
3252
3255
|
}), m;
|
|
3253
3256
|
}
|
|
3254
|
-
function
|
|
3257
|
+
function jc(p, v, m) {
|
|
3255
3258
|
for (var C = m - 1, U = p.length; ++C < U; )
|
|
3256
3259
|
if (p[C] === v)
|
|
3257
3260
|
return C;
|
|
3258
3261
|
return -1;
|
|
3259
3262
|
}
|
|
3260
|
-
function
|
|
3263
|
+
function Kc(p, v, m) {
|
|
3261
3264
|
for (var C = m + 1; C--; )
|
|
3262
3265
|
if (p[C] === v)
|
|
3263
3266
|
return C;
|
|
@@ -3572,7 +3575,7 @@ function nv() {
|
|
|
3572
3575
|
return n;
|
|
3573
3576
|
return -1;
|
|
3574
3577
|
}
|
|
3575
|
-
function
|
|
3578
|
+
function jl(e, t, n, r) {
|
|
3576
3579
|
return Wt(e, function(s, u, c) {
|
|
3577
3580
|
t(r, s, n(s), c);
|
|
3578
3581
|
}), r;
|
|
@@ -3580,7 +3583,7 @@ function nv() {
|
|
|
3580
3583
|
function Fa(e, t) {
|
|
3581
3584
|
return e && ct(t, ve(t), e);
|
|
3582
3585
|
}
|
|
3583
|
-
function
|
|
3586
|
+
function Kl(e, t) {
|
|
3584
3587
|
return e && ct(t, Re(t), e);
|
|
3585
3588
|
}
|
|
3586
3589
|
function gt(e, t, n) {
|
|
@@ -3600,7 +3603,7 @@ function nv() {
|
|
|
3600
3603
|
return e === e && (n !== i && (e = e <= n ? e : n), t !== i && (e = e >= t ? e : t)), e;
|
|
3601
3604
|
}
|
|
3602
3605
|
function Ye(e, t, n, r, s, u) {
|
|
3603
|
-
var c, h = t & G, d = t &
|
|
3606
|
+
var c, h = t & G, d = t & j, w = t & B;
|
|
3604
3607
|
if (n && (c = s ? n(e, r, s, u) : n(e)), c !== i)
|
|
3605
3608
|
return c;
|
|
3606
3609
|
if (!oe(e))
|
|
@@ -3615,7 +3618,7 @@ function nv() {
|
|
|
3615
3618
|
return Xa(e, h);
|
|
3616
3619
|
if (x == et || x == It || b && !s) {
|
|
3617
3620
|
if (c = d || b ? {} : vo(e), !h)
|
|
3618
|
-
return d ? Ef(e,
|
|
3621
|
+
return d ? Ef(e, Kl(c, e)) : Af(e, Fa(c, e));
|
|
3619
3622
|
} else {
|
|
3620
3623
|
if (!te[x])
|
|
3621
3624
|
return s ? e : {};
|
|
@@ -3626,13 +3629,13 @@ function nv() {
|
|
|
3626
3629
|
var F = u.get(e);
|
|
3627
3630
|
if (F)
|
|
3628
3631
|
return F;
|
|
3629
|
-
u.set(e, c),
|
|
3632
|
+
u.set(e, c), Ko(e) ? e.forEach(function(M) {
|
|
3630
3633
|
c.add(Ye(M, t, n, M, e, u));
|
|
3631
3634
|
}) : Ho(e) && e.forEach(function(M, k) {
|
|
3632
3635
|
c.set(k, Ye(M, t, n, k, e, u));
|
|
3633
3636
|
});
|
|
3634
3637
|
var L = w ? d ? ts : es : d ? Re : ve, D = y ? i : L(e);
|
|
3635
|
-
return
|
|
3638
|
+
return Ke(D || e, function(M, k) {
|
|
3636
3639
|
D && (k = M, M = e[k]), kn(c, k, Ye(M, t, n, k, e, u));
|
|
3637
3640
|
}), c;
|
|
3638
3641
|
}
|
|
@@ -3735,7 +3738,7 @@ function nv() {
|
|
|
3735
3738
|
return N(e) ? r : Mt(r, n(e));
|
|
3736
3739
|
}
|
|
3737
3740
|
function Ee(e) {
|
|
3738
|
-
return e == null ? e === i ? oi : ai : en && en in V(e) ? Of(e) :
|
|
3741
|
+
return e == null ? e === i ? oi : ai : en && en in V(e) ? Of(e) : jf(e);
|
|
3739
3742
|
}
|
|
3740
3743
|
function Di(e, t) {
|
|
3741
3744
|
return e > t;
|
|
@@ -3853,7 +3856,7 @@ function nv() {
|
|
|
3853
3856
|
return ue(e) && Se(e) == Ue;
|
|
3854
3857
|
}
|
|
3855
3858
|
function of(e) {
|
|
3856
|
-
return ue(e) &&
|
|
3859
|
+
return ue(e) && jr(e.length) && !!re[Ee(e)];
|
|
3857
3860
|
}
|
|
3858
3861
|
function Na(e) {
|
|
3859
3862
|
return typeof e == "function" ? e : e == null ? Pe : typeof e == "object" ? N(e) ? $a(e[0], e[1]) : Da(e) : su(e);
|
|
@@ -3949,7 +3952,7 @@ function nv() {
|
|
|
3949
3952
|
function qa(e, t, n) {
|
|
3950
3953
|
for (var r = -1, s = t.length, u = {}; ++r < s; ) {
|
|
3951
3954
|
var c = t[r], h = sn(e, c);
|
|
3952
|
-
n(h, c) &&
|
|
3955
|
+
n(h, c) && jn(u, $t(c, e), h);
|
|
3953
3956
|
}
|
|
3954
3957
|
return u;
|
|
3955
3958
|
}
|
|
@@ -3983,7 +3986,7 @@ function nv() {
|
|
|
3983
3986
|
c[r ? u : ++s] = e, e += n;
|
|
3984
3987
|
return c;
|
|
3985
3988
|
}
|
|
3986
|
-
function
|
|
3989
|
+
function ji(e, t) {
|
|
3987
3990
|
var n = "";
|
|
3988
3991
|
if (!e || t < 1 || t > Ve)
|
|
3989
3992
|
return n;
|
|
@@ -4002,7 +4005,7 @@ function nv() {
|
|
|
4002
4005
|
var n = Fn(e);
|
|
4003
4006
|
return $r(n, rn(t, 0, n.length));
|
|
4004
4007
|
}
|
|
4005
|
-
function
|
|
4008
|
+
function jn(e, t, n, r) {
|
|
4006
4009
|
if (!oe(e))
|
|
4007
4010
|
return e;
|
|
4008
4011
|
t = $t(t, e);
|
|
@@ -4053,9 +4056,9 @@ function nv() {
|
|
|
4053
4056
|
}
|
|
4054
4057
|
return s;
|
|
4055
4058
|
}
|
|
4056
|
-
return
|
|
4059
|
+
return Ki(e, t, Pe, n);
|
|
4057
4060
|
}
|
|
4058
|
-
function
|
|
4061
|
+
function Ki(e, t, n, r) {
|
|
4059
4062
|
var s = 0, u = e == null ? 0 : e.length;
|
|
4060
4063
|
if (u === 0)
|
|
4061
4064
|
return 0;
|
|
@@ -4069,7 +4072,7 @@ function nv() {
|
|
|
4069
4072
|
}
|
|
4070
4073
|
return xe(u, ti);
|
|
4071
4074
|
}
|
|
4072
|
-
function
|
|
4075
|
+
function ja(e, t) {
|
|
4073
4076
|
for (var n = -1, r = e.length, s = 0, u = []; ++n < r; ) {
|
|
4074
4077
|
var c = e[n], h = t ? t(c) : c;
|
|
4075
4078
|
if (!n || !rt(h, d)) {
|
|
@@ -4079,7 +4082,7 @@ function nv() {
|
|
|
4079
4082
|
}
|
|
4080
4083
|
return u;
|
|
4081
4084
|
}
|
|
4082
|
-
function
|
|
4085
|
+
function Ka(e) {
|
|
4083
4086
|
return typeof e == "number" ? e : $e(e) ? cn : +e;
|
|
4084
4087
|
}
|
|
4085
4088
|
function De(e) {
|
|
@@ -4119,7 +4122,7 @@ function nv() {
|
|
|
4119
4122
|
return t = $t(t, e), e = xo(e, t), e == null || delete e[lt(Xe(t))];
|
|
4120
4123
|
}
|
|
4121
4124
|
function za(e, t, n, r) {
|
|
4122
|
-
return
|
|
4125
|
+
return jn(e, t, n(sn(e, t)), r);
|
|
4123
4126
|
}
|
|
4124
4127
|
function Pr(e, t, n, r) {
|
|
4125
4128
|
for (var s = e.length, u = r ? s : -1; (r ? u-- : ++u < s) && t(e[u], u, e); )
|
|
@@ -4253,7 +4256,7 @@ function nv() {
|
|
|
4253
4256
|
}
|
|
4254
4257
|
function Or(e, t) {
|
|
4255
4258
|
return function(n, r) {
|
|
4256
|
-
var s = N(n) ? Tc :
|
|
4259
|
+
var s = N(n) ? Tc : jl, u = t ? t() : {};
|
|
4257
4260
|
return s(n, e, R(r, 2), u);
|
|
4258
4261
|
};
|
|
4259
4262
|
}
|
|
@@ -4289,7 +4292,7 @@ function nv() {
|
|
|
4289
4292
|
};
|
|
4290
4293
|
}
|
|
4291
4294
|
function bf(e, t, n) {
|
|
4292
|
-
var r = t & fe, s =
|
|
4295
|
+
var r = t & fe, s = Kn(e);
|
|
4293
4296
|
function u() {
|
|
4294
4297
|
var c = this && this !== _e && this instanceof u ? s : e;
|
|
4295
4298
|
return c.apply(r ? n : this, arguments);
|
|
@@ -4308,7 +4311,7 @@ function nv() {
|
|
|
4308
4311
|
return Si(ru(nu(t).replace(dc, "")), e, "");
|
|
4309
4312
|
};
|
|
4310
4313
|
}
|
|
4311
|
-
function
|
|
4314
|
+
function Kn(e) {
|
|
4312
4315
|
return function() {
|
|
4313
4316
|
var t = arguments;
|
|
4314
4317
|
switch (t.length) {
|
|
@@ -4334,7 +4337,7 @@ function nv() {
|
|
|
4334
4337
|
};
|
|
4335
4338
|
}
|
|
4336
4339
|
function Cf(e, t, n) {
|
|
4337
|
-
var r =
|
|
4340
|
+
var r = Kn(e);
|
|
4338
4341
|
function s() {
|
|
4339
4342
|
for (var u = arguments.length, c = m(u), h = u, d = bn(s); h--; )
|
|
4340
4343
|
c[h] = arguments[h];
|
|
@@ -4396,7 +4399,7 @@ function nv() {
|
|
|
4396
4399
|
});
|
|
4397
4400
|
}
|
|
4398
4401
|
function Lr(e, t, n, r, s, u, c, h, d, w) {
|
|
4399
|
-
var y = t & ne, x = t & fe, b = t & Le, F = t & (Fe | T), L = t & ee, D = b ? i :
|
|
4402
|
+
var y = t & ne, x = t & fe, b = t & Le, F = t & (Fe | T), L = t & ee, D = b ? i : Kn(e);
|
|
4400
4403
|
function M() {
|
|
4401
4404
|
for (var k = arguments.length, H = m(k), Be = k; Be--; )
|
|
4402
4405
|
H[Be] = arguments[Be];
|
|
@@ -4418,7 +4421,7 @@ function nv() {
|
|
|
4418
4421
|
);
|
|
4419
4422
|
}
|
|
4420
4423
|
var it = x ? n : this, xt = b ? it[e] : e;
|
|
4421
|
-
return k = H.length, h ? H =
|
|
4424
|
+
return k = H.length, h ? H = Kf(H, h) : L && k > 1 && H.reverse(), y && d < k && (H.length = d), this && this !== _e && this instanceof M && (xt = D || Kn(xt)), xt.apply(it, H);
|
|
4422
4425
|
}
|
|
4423
4426
|
return M;
|
|
4424
4427
|
}
|
|
@@ -4435,7 +4438,7 @@ function nv() {
|
|
|
4435
4438
|
if (n !== i && (s = n), r !== i) {
|
|
4436
4439
|
if (s === i)
|
|
4437
4440
|
return r;
|
|
4438
|
-
typeof n == "string" || typeof r == "string" ? (n = De(n), r = De(r)) : (n =
|
|
4441
|
+
typeof n == "string" || typeof r == "string" ? (n = De(n), r = De(r)) : (n = Ka(n), r = Ka(r)), s = e(n, r);
|
|
4439
4442
|
}
|
|
4440
4443
|
return s;
|
|
4441
4444
|
};
|
|
@@ -4454,12 +4457,12 @@ function nv() {
|
|
|
4454
4457
|
t = t === i ? " " : De(t);
|
|
4455
4458
|
var n = t.length;
|
|
4456
4459
|
if (n < 2)
|
|
4457
|
-
return n ?
|
|
4458
|
-
var r =
|
|
4460
|
+
return n ? ji(t, e) : t;
|
|
4461
|
+
var r = ji(t, xr(e / vn(t)));
|
|
4459
4462
|
return mn(t) ? Bt(tt(r), 0, e).join("") : r.slice(0, e);
|
|
4460
4463
|
}
|
|
4461
4464
|
function Ff(e, t, n, r) {
|
|
4462
|
-
var s = t & fe, u =
|
|
4465
|
+
var s = t & fe, u = Kn(e);
|
|
4463
4466
|
function c() {
|
|
4464
4467
|
for (var h = -1, d = arguments.length, w = -1, y = r.length, x = m(y + d), b = this && this !== _e && this instanceof c ? u : e; ++w < y; )
|
|
4465
4468
|
x[w] = r[w];
|
|
@@ -4481,7 +4484,7 @@ function nv() {
|
|
|
4481
4484
|
}
|
|
4482
4485
|
function co(e, t, n, r, s, u, c, h, d, w) {
|
|
4483
4486
|
var y = t & Fe, x = y ? c : i, b = y ? i : c, F = y ? u : i, L = y ? i : u;
|
|
4484
|
-
t |= y ? Y :
|
|
4487
|
+
t |= y ? Y : K, t &= ~(y ? K : Y), t & Ft || (t &= -4);
|
|
4485
4488
|
var D = [
|
|
4486
4489
|
e,
|
|
4487
4490
|
t,
|
|
@@ -4520,7 +4523,7 @@ function nv() {
|
|
|
4520
4523
|
if (!d && typeof e != "function")
|
|
4521
4524
|
throw new ze(S);
|
|
4522
4525
|
var w = r ? r.length : 0;
|
|
4523
|
-
if (w || (t &= -97, r = s = i), c = c === i ? c : de(W(c), 0), h = h === i ? h : W(h), w -= s ? s.length : 0, t &
|
|
4526
|
+
if (w || (t &= -97, r = s = i), c = c === i ? c : de(W(c), 0), h = h === i ? h : W(h), w -= s ? s.length : 0, t & K) {
|
|
4524
4527
|
var y = r, x = s;
|
|
4525
4528
|
r = s = i;
|
|
4526
4529
|
}
|
|
@@ -4761,7 +4764,7 @@ function nv() {
|
|
|
4761
4764
|
break;
|
|
4762
4765
|
e = e[c];
|
|
4763
4766
|
}
|
|
4764
|
-
return u || ++r != s ? u : (s = e == null ? 0 : e.length, !!s &&
|
|
4767
|
+
return u || ++r != s ? u : (s = e == null ? 0 : e.length, !!s && jr(s) && _t(c, s) && (N(e) || un(e)));
|
|
4765
4768
|
}
|
|
4766
4769
|
function Uf(e) {
|
|
4767
4770
|
var t = e.length, n = new e.constructor(t);
|
|
@@ -4885,7 +4888,7 @@ function nv() {
|
|
|
4885
4888
|
t.push(n);
|
|
4886
4889
|
return t;
|
|
4887
4890
|
}
|
|
4888
|
-
function
|
|
4891
|
+
function jf(e) {
|
|
4889
4892
|
return gr.call(e);
|
|
4890
4893
|
}
|
|
4891
4894
|
function yo(e, t, n) {
|
|
@@ -4901,7 +4904,7 @@ function nv() {
|
|
|
4901
4904
|
function xo(e, t) {
|
|
4902
4905
|
return t.length < 2 ? e : sn(e, Ze(t, 0, -1));
|
|
4903
4906
|
}
|
|
4904
|
-
function
|
|
4907
|
+
function Kf(e, t) {
|
|
4905
4908
|
for (var n = e.length, r = xe(t.length, n), s = Te(e); r--; ) {
|
|
4906
4909
|
var u = t[r];
|
|
4907
4910
|
e[r] = _t(u, n) ? s[u] : i;
|
|
@@ -4965,7 +4968,7 @@ function nv() {
|
|
|
4965
4968
|
return "";
|
|
4966
4969
|
}
|
|
4967
4970
|
function zf(e, t) {
|
|
4968
|
-
return
|
|
4971
|
+
return Ke(ri, function(n) {
|
|
4969
4972
|
var r = "_." + n[0];
|
|
4970
4973
|
t & n[1] && !cr(e, r) && e.push(r);
|
|
4971
4974
|
}), e.sort();
|
|
@@ -5096,7 +5099,7 @@ function nv() {
|
|
|
5096
5099
|
if (!r)
|
|
5097
5100
|
return -1;
|
|
5098
5101
|
var s = r;
|
|
5099
|
-
return n !== i && (s = W(n), s = s < 0 ? de(r + s, 0) : xe(s, r - 1)), t === t ?
|
|
5102
|
+
return n !== i && (s = W(n), s = s < 0 ? de(r + s, 0) : xe(s, r - 1)), t === t ? Kc(e, t, s) : lr(e, ca, s, !0);
|
|
5100
5103
|
}
|
|
5101
5104
|
function gh(e, t) {
|
|
5102
5105
|
return e && e.length ? Ba(e, W(t)) : i;
|
|
@@ -5139,7 +5142,7 @@ function nv() {
|
|
|
5139
5142
|
return Rr(e, t);
|
|
5140
5143
|
}
|
|
5141
5144
|
function Ah(e, t, n) {
|
|
5142
|
-
return
|
|
5145
|
+
return Ki(e, t, R(n, 2));
|
|
5143
5146
|
}
|
|
5144
5147
|
function Eh(e, t) {
|
|
5145
5148
|
var n = e == null ? 0 : e.length;
|
|
@@ -5154,7 +5157,7 @@ function nv() {
|
|
|
5154
5157
|
return Rr(e, t, !0);
|
|
5155
5158
|
}
|
|
5156
5159
|
function Ch(e, t, n) {
|
|
5157
|
-
return
|
|
5160
|
+
return Ki(e, t, R(n, 2), !0);
|
|
5158
5161
|
}
|
|
5159
5162
|
function Fh(e, t) {
|
|
5160
5163
|
var n = e == null ? 0 : e.length;
|
|
@@ -5166,10 +5169,10 @@ function nv() {
|
|
|
5166
5169
|
return -1;
|
|
5167
5170
|
}
|
|
5168
5171
|
function Th(e) {
|
|
5169
|
-
return e && e.length ?
|
|
5172
|
+
return e && e.length ? ja(e) : [];
|
|
5170
5173
|
}
|
|
5171
5174
|
function Ih(e, t) {
|
|
5172
|
-
return e && e.length ?
|
|
5175
|
+
return e && e.length ? ja(e, R(t, 2)) : [];
|
|
5173
5176
|
}
|
|
5174
5177
|
function Rh(e) {
|
|
5175
5178
|
var t = e == null ? 0 : e.length;
|
|
@@ -5235,12 +5238,12 @@ function nv() {
|
|
|
5235
5238
|
}), Hh = $(function(e) {
|
|
5236
5239
|
var t = Xe(e);
|
|
5237
5240
|
return t = typeof t == "function" ? t : i, Ji(Lt(e, ce), i, t);
|
|
5238
|
-
}),
|
|
5239
|
-
function
|
|
5241
|
+
}), jh = $(ls);
|
|
5242
|
+
function Kh(e, t) {
|
|
5240
5243
|
return Ya(e || [], t || [], kn);
|
|
5241
5244
|
}
|
|
5242
5245
|
function zh(e, t) {
|
|
5243
|
-
return Ya(e || [], t || [],
|
|
5246
|
+
return Ya(e || [], t || [], jn);
|
|
5244
5247
|
}
|
|
5245
5248
|
var Jh = $(function(e) {
|
|
5246
5249
|
var t = e.length, n = t > 1 ? e[t - 1] : i;
|
|
@@ -5328,7 +5331,7 @@ function nv() {
|
|
|
5328
5331
|
return n = n === i ? 1 : W(n), we(kr(e, t), n);
|
|
5329
5332
|
}
|
|
5330
5333
|
function Mo(e, t) {
|
|
5331
|
-
var n = N(e) ?
|
|
5334
|
+
var n = N(e) ? Ke : Wt;
|
|
5332
5335
|
return n(e, R(t, 3));
|
|
5333
5336
|
}
|
|
5334
5337
|
function Uo(e, t) {
|
|
@@ -5341,7 +5344,7 @@ function nv() {
|
|
|
5341
5344
|
function pp(e, t, n, r) {
|
|
5342
5345
|
e = Ie(e) ? e : Fn(e), n = n && !r ? W(n) : 0;
|
|
5343
5346
|
var s = e.length;
|
|
5344
|
-
return n < 0 && (n = de(s + n, 0)),
|
|
5347
|
+
return n < 0 && (n = de(s + n, 0)), Kr(e) ? n <= s && e.indexOf(t, n) > -1 : !!s && gn(e, t, n) > -1;
|
|
5345
5348
|
}
|
|
5346
5349
|
var dp = $(function(e, t, n) {
|
|
5347
5350
|
var r = -1, s = typeof t == "function", u = Ie(e) ? m(e.length) : [];
|
|
@@ -5392,7 +5395,7 @@ function nv() {
|
|
|
5392
5395
|
if (e == null)
|
|
5393
5396
|
return 0;
|
|
5394
5397
|
if (Ie(e))
|
|
5395
|
-
return
|
|
5398
|
+
return Kr(e) ? vn(e) : e.length;
|
|
5396
5399
|
var t = Se(e);
|
|
5397
5400
|
return t == Me || t == Ue ? e.size : ki(e).length;
|
|
5398
5401
|
}
|
|
@@ -5554,7 +5557,7 @@ function nv() {
|
|
|
5554
5557
|
return mt(e, Y, i, t, n);
|
|
5555
5558
|
}), qo = $(function(e, t) {
|
|
5556
5559
|
var n = Ut(t, bn(qo));
|
|
5557
|
-
return mt(e,
|
|
5560
|
+
return mt(e, K, i, t, n);
|
|
5558
5561
|
}), Lp = vt(function(e, t) {
|
|
5559
5562
|
return mt(e, qe, i, i, i, t);
|
|
5560
5563
|
});
|
|
@@ -5611,7 +5614,7 @@ function nv() {
|
|
|
5611
5614
|
function rt(e, t) {
|
|
5612
5615
|
return e === t || e !== e && t !== t;
|
|
5613
5616
|
}
|
|
5614
|
-
var
|
|
5617
|
+
var jp = Nr(Di), Kp = Nr(function(e, t) {
|
|
5615
5618
|
return e >= t;
|
|
5616
5619
|
}), un = Ma(/* @__PURE__ */ function() {
|
|
5617
5620
|
return arguments;
|
|
@@ -5619,7 +5622,7 @@ function nv() {
|
|
|
5619
5622
|
return ue(e) && X.call(e, "callee") && !ya.call(e, "callee");
|
|
5620
5623
|
}, N = m.isArray, zp = ta ? We(ta) : ef;
|
|
5621
5624
|
function Ie(e) {
|
|
5622
|
-
return e != null &&
|
|
5625
|
+
return e != null && jr(e.length) && !wt(e);
|
|
5623
5626
|
}
|
|
5624
5627
|
function ce(e) {
|
|
5625
5628
|
return ue(e) && Ie(e);
|
|
@@ -5672,7 +5675,7 @@ function nv() {
|
|
|
5672
5675
|
function Go(e) {
|
|
5673
5676
|
return typeof e == "number" && e == W(e);
|
|
5674
5677
|
}
|
|
5675
|
-
function
|
|
5678
|
+
function jr(e) {
|
|
5676
5679
|
return typeof e == "number" && e > -1 && e % 1 == 0 && e <= Ve;
|
|
5677
5680
|
}
|
|
5678
5681
|
function oe(e) {
|
|
@@ -5690,7 +5693,7 @@ function nv() {
|
|
|
5690
5693
|
return n = typeof n == "function" ? n : i, Bi(e, t, rs(t), n);
|
|
5691
5694
|
}
|
|
5692
5695
|
function rd(e) {
|
|
5693
|
-
return
|
|
5696
|
+
return jo(e) && e != +e;
|
|
5694
5697
|
}
|
|
5695
5698
|
function id(e) {
|
|
5696
5699
|
if (kf(e))
|
|
@@ -5703,7 +5706,7 @@ function nv() {
|
|
|
5703
5706
|
function ad(e) {
|
|
5704
5707
|
return e == null;
|
|
5705
5708
|
}
|
|
5706
|
-
function
|
|
5709
|
+
function jo(e) {
|
|
5707
5710
|
return typeof e == "number" || ue(e) && Ee(e) == Yt;
|
|
5708
5711
|
}
|
|
5709
5712
|
function Yn(e) {
|
|
@@ -5719,8 +5722,8 @@ function nv() {
|
|
|
5719
5722
|
function od(e) {
|
|
5720
5723
|
return Go(e) && e >= -Ve && e <= Ve;
|
|
5721
5724
|
}
|
|
5722
|
-
var
|
|
5723
|
-
function
|
|
5725
|
+
var Ko = sa ? We(sa) : af;
|
|
5726
|
+
function Kr(e) {
|
|
5724
5727
|
return typeof e == "string" || !N(e) && ue(e) && Ee(e) == Zt;
|
|
5725
5728
|
}
|
|
5726
5729
|
function $e(e) {
|
|
@@ -5743,7 +5746,7 @@ function nv() {
|
|
|
5743
5746
|
if (!e)
|
|
5744
5747
|
return [];
|
|
5745
5748
|
if (Ie(e))
|
|
5746
|
-
return
|
|
5749
|
+
return Kr(e) ? tt(e) : Te(e);
|
|
5747
5750
|
if (Nn && e[Nn])
|
|
5748
5751
|
return Gc(e[Nn]());
|
|
5749
5752
|
var t = Se(e), n = t == Me ? Ii : t == Ue ? fr : Fn;
|
|
@@ -5777,8 +5780,8 @@ function nv() {
|
|
|
5777
5780
|
if (typeof e != "string")
|
|
5778
5781
|
return e === 0 ? e : +e;
|
|
5779
5782
|
e = ha(e);
|
|
5780
|
-
var n =
|
|
5781
|
-
return n || Ju.test(e) ? Cc(e.slice(2), n ? 2 : 8) :
|
|
5783
|
+
var n = Ku.test(e);
|
|
5784
|
+
return n || Ju.test(e) ? Cc(e.slice(2), n ? 2 : 8) : ju.test(e) ? cn : +e;
|
|
5782
5785
|
}
|
|
5783
5786
|
function Yo(e) {
|
|
5784
5787
|
return ct(e, Re(e));
|
|
@@ -5887,7 +5890,7 @@ function nv() {
|
|
|
5887
5890
|
var r = !1;
|
|
5888
5891
|
t = se(t, function(u) {
|
|
5889
5892
|
return u = $t(u, e), r || (r = u.length > 1), u;
|
|
5890
|
-
}), ct(e, ts(e), n), r && (n = Ye(n, G |
|
|
5893
|
+
}), ct(e, ts(e), n), r && (n = Ye(n, G | j | B, If));
|
|
5891
5894
|
for (var s = t.length; s--; )
|
|
5892
5895
|
zi(n, t[s]);
|
|
5893
5896
|
return n;
|
|
@@ -5918,10 +5921,10 @@ function nv() {
|
|
|
5918
5921
|
return e;
|
|
5919
5922
|
}
|
|
5920
5923
|
function $d(e, t, n) {
|
|
5921
|
-
return e == null ? e :
|
|
5924
|
+
return e == null ? e : jn(e, t, n);
|
|
5922
5925
|
}
|
|
5923
5926
|
function Bd(e, t, n, r) {
|
|
5924
|
-
return r = typeof r == "function" ? r : i, e == null ? e :
|
|
5927
|
+
return r = typeof r == "function" ? r : i, e == null ? e : jn(e, t, n, r);
|
|
5925
5928
|
}
|
|
5926
5929
|
var Vo = lo(ve), eu = lo(Re);
|
|
5927
5930
|
function kd(e, t, n) {
|
|
@@ -5930,7 +5933,7 @@ function nv() {
|
|
|
5930
5933
|
var u = e && e.constructor;
|
|
5931
5934
|
s ? n = r ? new u() : [] : oe(e) ? n = wt(u) ? Sn(_r(e)) : {} : n = {};
|
|
5932
5935
|
}
|
|
5933
|
-
return (s ?
|
|
5936
|
+
return (s ? Ke : ut)(e, function(c, h, d) {
|
|
5934
5937
|
return t(n, c, h, d);
|
|
5935
5938
|
}), n;
|
|
5936
5939
|
}
|
|
@@ -5946,10 +5949,10 @@ function nv() {
|
|
|
5946
5949
|
function Fn(e) {
|
|
5947
5950
|
return e == null ? [] : Ti(e, ve(e));
|
|
5948
5951
|
}
|
|
5949
|
-
function
|
|
5952
|
+
function jd(e) {
|
|
5950
5953
|
return e == null ? [] : Ti(e, Re(e));
|
|
5951
5954
|
}
|
|
5952
|
-
function
|
|
5955
|
+
function Kd(e, t, n) {
|
|
5953
5956
|
return n === i && (n = t, t = i), n !== i && (n = Qe(n), n = n === n ? n : 0), t !== i && (t = Qe(t), t = t === t ? t : 0), rn(Qe(e), t, n);
|
|
5954
5957
|
}
|
|
5955
5958
|
function zd(e, t, n) {
|
|
@@ -6015,7 +6018,7 @@ function nv() {
|
|
|
6015
6018
|
return n || t == null ? t = 0 : t && (t = +t), fl(Z(e).replace(pi, ""), t || 0);
|
|
6016
6019
|
}
|
|
6017
6020
|
function ag(e, t, n) {
|
|
6018
|
-
return (n ? be(e, t, n) : t === i) ? t = 1 : t = W(t),
|
|
6021
|
+
return (n ? be(e, t, n) : t === i) ? t = 1 : t = W(t), ji(Z(e), t);
|
|
6019
6022
|
}
|
|
6020
6023
|
function og() {
|
|
6021
6024
|
var e = arguments, t = Z(e[0]);
|
|
@@ -6104,7 +6107,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
6104
6107
|
return Bt(r, s).join("");
|
|
6105
6108
|
}
|
|
6106
6109
|
function _g(e, t) {
|
|
6107
|
-
var n =
|
|
6110
|
+
var n = Kt, r = Ge;
|
|
6108
6111
|
if (oe(t)) {
|
|
6109
6112
|
var s = "separator" in t ? t.separator : s;
|
|
6110
6113
|
n = "length" in t ? W(t.length) : n, r = "omission" in t ? De(t.omission) : r;
|
|
@@ -6152,7 +6155,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
6152
6155
|
return ps(n) ? n : new U(n);
|
|
6153
6156
|
}
|
|
6154
6157
|
}), xg = vt(function(e, t) {
|
|
6155
|
-
return
|
|
6158
|
+
return Ke(t, function(n) {
|
|
6156
6159
|
n = lt(n), gt(e, n, fs(e[n], e));
|
|
6157
6160
|
}), e;
|
|
6158
6161
|
});
|
|
@@ -6207,7 +6210,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
6207
6210
|
var r = ve(t), s = Tr(t, r);
|
|
6208
6211
|
n == null && !(oe(t) && (s.length || !r.length)) && (n = t, t = e, e = this, s = Tr(t, ve(t)));
|
|
6209
6212
|
var u = !(oe(n) && "chain" in n) || !!n.chain, c = wt(e);
|
|
6210
|
-
return
|
|
6213
|
+
return Ke(s, function(h) {
|
|
6211
6214
|
var d = t[h];
|
|
6212
6215
|
e[h] = d, c && (e.prototype[h] = function() {
|
|
6213
6216
|
var w = this.__chain__;
|
|
@@ -6270,9 +6273,9 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
6270
6273
|
var t = ++el;
|
|
6271
6274
|
return Z(e) + t;
|
|
6272
6275
|
}
|
|
6273
|
-
var
|
|
6276
|
+
var jg = Mr(function(e, t) {
|
|
6274
6277
|
return e + t;
|
|
6275
|
-
}, 0),
|
|
6278
|
+
}, 0), Kg = Vi("ceil"), zg = Mr(function(e, t) {
|
|
6276
6279
|
return e / t;
|
|
6277
6280
|
}, 1), Jg = Vi("floor");
|
|
6278
6281
|
function Yg(e) {
|
|
@@ -6304,14 +6307,14 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
6304
6307
|
function sm(e, t) {
|
|
6305
6308
|
return e && e.length ? Ci(e, R(t, 2)) : 0;
|
|
6306
6309
|
}
|
|
6307
|
-
return o.after = Fp, o.ary = No, o.assign = dd, o.assignIn = Zo, o.assignInWith = zr, o.assignWith = gd, o.at = md, o.before = Wo, o.bind = fs, o.bindAll = xg, o.bindKey = Do, o.castArray = $p, o.chain = Lo, o.chunk = Jf, o.compact = Yf, o.concat = Zf, o.cond = Sg, o.conforms = Ag, o.constant = _s, o.countBy = ip, o.create = vd, o.curry = $o, o.curryRight = Bo, o.debounce = ko, o.defaults = _d, o.defaultsDeep = wd, o.defer = Tp, o.delay = Ip, o.difference = Xf, o.differenceBy = Qf, o.differenceWith = Vf, o.drop = eh, o.dropRight = th, o.dropRightWhile = nh, o.dropWhile = rh, o.fill = ih, o.filter = ap, o.flatMap = cp, o.flatMapDeep = lp, o.flatMapDepth = fp, o.flatten = Io, o.flattenDeep = sh, o.flattenDepth = ah, o.flip = Rp, o.flow = bg, o.flowRight = Cg, o.fromPairs = oh, o.functions = Cd, o.functionsIn = Fd, o.groupBy = hp, o.initial = ch, o.intersection = lh, o.intersectionBy = fh, o.intersectionWith = hh, o.invert = Id, o.invertBy = Rd, o.invokeMap = dp, o.iteratee = ws, o.keyBy = gp, o.keys = ve, o.keysIn = Re, o.map = kr, o.mapKeys = Od, o.mapValues = Ld, o.matches = Fg, o.matchesProperty = Tg, o.memoize = Gr, o.merge = Md, o.mergeWith = Xo, o.method = Ig, o.methodOf = Rg, o.mixin = ys, o.negate = Hr, o.nthArg = Og, o.omit = Ud, o.omitBy = Nd, o.once = Pp, o.orderBy = mp, o.over = Lg, o.overArgs = Op, o.overEvery = Mg, o.overSome = Ug, o.partial = hs, o.partialRight = qo, o.partition = vp, o.pick = Wd, o.pickBy = Qo, o.property = su, o.propertyOf = Ng, o.pull = mh, o.pullAll = Po, o.pullAllBy = vh, o.pullAllWith = _h, o.pullAt = wh, o.range = Wg, o.rangeRight = Dg, o.rearg = Lp, o.reject = yp, o.remove = yh, o.rest = Mp, o.reverse = cs, o.sampleSize = Sp, o.set = $d, o.setWith = Bd, o.shuffle = Ap, o.slice = xh, o.sortBy = Cp, o.sortedUniq = Th, o.sortedUniqBy = Ih, o.split = cg, o.spread = Up, o.tail = Rh, o.take = Ph, o.takeRight = Oh, o.takeRightWhile = Lh, o.takeWhile = Mh, o.tap = Yh, o.throttle = Np, o.thru = Br, o.toArray = zo, o.toPairs = Vo, o.toPairsIn = eu, o.toPath = Gg, o.toPlainObject = Yo, o.transform = kd, o.unary = Wp, o.union = Uh, o.unionBy = Nh, o.unionWith = Wh, o.uniq = Dh, o.uniqBy = $h, o.uniqWith = Bh, o.unset = qd, o.unzip = ls, o.unzipWith = Oo, o.update = Gd, o.updateWith = Hd, o.values = Fn, o.valuesIn =
|
|
6310
|
+
return o.after = Fp, o.ary = No, o.assign = dd, o.assignIn = Zo, o.assignInWith = zr, o.assignWith = gd, o.at = md, o.before = Wo, o.bind = fs, o.bindAll = xg, o.bindKey = Do, o.castArray = $p, o.chain = Lo, o.chunk = Jf, o.compact = Yf, o.concat = Zf, o.cond = Sg, o.conforms = Ag, o.constant = _s, o.countBy = ip, o.create = vd, o.curry = $o, o.curryRight = Bo, o.debounce = ko, o.defaults = _d, o.defaultsDeep = wd, o.defer = Tp, o.delay = Ip, o.difference = Xf, o.differenceBy = Qf, o.differenceWith = Vf, o.drop = eh, o.dropRight = th, o.dropRightWhile = nh, o.dropWhile = rh, o.fill = ih, o.filter = ap, o.flatMap = cp, o.flatMapDeep = lp, o.flatMapDepth = fp, o.flatten = Io, o.flattenDeep = sh, o.flattenDepth = ah, o.flip = Rp, o.flow = bg, o.flowRight = Cg, o.fromPairs = oh, o.functions = Cd, o.functionsIn = Fd, o.groupBy = hp, o.initial = ch, o.intersection = lh, o.intersectionBy = fh, o.intersectionWith = hh, o.invert = Id, o.invertBy = Rd, o.invokeMap = dp, o.iteratee = ws, o.keyBy = gp, o.keys = ve, o.keysIn = Re, o.map = kr, o.mapKeys = Od, o.mapValues = Ld, o.matches = Fg, o.matchesProperty = Tg, o.memoize = Gr, o.merge = Md, o.mergeWith = Xo, o.method = Ig, o.methodOf = Rg, o.mixin = ys, o.negate = Hr, o.nthArg = Og, o.omit = Ud, o.omitBy = Nd, o.once = Pp, o.orderBy = mp, o.over = Lg, o.overArgs = Op, o.overEvery = Mg, o.overSome = Ug, o.partial = hs, o.partialRight = qo, o.partition = vp, o.pick = Wd, o.pickBy = Qo, o.property = su, o.propertyOf = Ng, o.pull = mh, o.pullAll = Po, o.pullAllBy = vh, o.pullAllWith = _h, o.pullAt = wh, o.range = Wg, o.rangeRight = Dg, o.rearg = Lp, o.reject = yp, o.remove = yh, o.rest = Mp, o.reverse = cs, o.sampleSize = Sp, o.set = $d, o.setWith = Bd, o.shuffle = Ap, o.slice = xh, o.sortBy = Cp, o.sortedUniq = Th, o.sortedUniqBy = Ih, o.split = cg, o.spread = Up, o.tail = Rh, o.take = Ph, o.takeRight = Oh, o.takeRightWhile = Lh, o.takeWhile = Mh, o.tap = Yh, o.throttle = Np, o.thru = Br, o.toArray = zo, o.toPairs = Vo, o.toPairsIn = eu, o.toPath = Gg, o.toPlainObject = Yo, o.transform = kd, o.unary = Wp, o.union = Uh, o.unionBy = Nh, o.unionWith = Wh, o.uniq = Dh, o.uniqBy = $h, o.uniqWith = Bh, o.unset = qd, o.unzip = ls, o.unzipWith = Oo, o.update = Gd, o.updateWith = Hd, o.values = Fn, o.valuesIn = jd, o.without = kh, o.words = ru, o.wrap = Dp, o.xor = qh, o.xorBy = Gh, o.xorWith = Hh, o.zip = jh, o.zipObject = Kh, o.zipObjectDeep = zh, o.zipWith = Jh, o.entries = Vo, o.entriesIn = eu, o.extend = Zo, o.extendWith = zr, ys(o, o), o.add = jg, o.attempt = iu, o.camelCase = Yd, o.capitalize = tu, o.ceil = Kg, o.clamp = Kd, o.clone = Bp, o.cloneDeep = qp, o.cloneDeepWith = Gp, o.cloneWith = kp, o.conformsTo = Hp, o.deburr = nu, o.defaultTo = Eg, o.divide = zg, o.endsWith = Zd, o.eq = rt, o.escape = Xd, o.escapeRegExp = Qd, o.every = sp, o.find = op, o.findIndex = Fo, o.findKey = yd, o.findLast = up, o.findLastIndex = To, o.findLastKey = xd, o.floor = Jg, o.forEach = Mo, o.forEachRight = Uo, o.forIn = Sd, o.forInRight = Ad, o.forOwn = Ed, o.forOwnRight = bd, o.get = gs, o.gt = jp, o.gte = Kp, o.has = Td, o.hasIn = ms, o.head = Ro, o.identity = Pe, o.includes = pp, o.indexOf = uh, o.inRange = zd, o.invoke = Pd, o.isArguments = un, o.isArray = N, o.isArrayBuffer = zp, o.isArrayLike = Ie, o.isArrayLikeObject = ce, o.isBoolean = Jp, o.isBuffer = kt, o.isDate = Yp, o.isElement = Zp, o.isEmpty = Xp, o.isEqual = Qp, o.isEqualWith = Vp, o.isError = ps, o.isFinite = ed, o.isFunction = wt, o.isInteger = Go, o.isLength = jr, o.isMap = Ho, o.isMatch = td, o.isMatchWith = nd, o.isNaN = rd, o.isNative = id, o.isNil = ad, o.isNull = sd, o.isNumber = jo, o.isObject = oe, o.isObjectLike = ue, o.isPlainObject = Yn, o.isRegExp = ds, o.isSafeInteger = od, o.isSet = Ko, o.isString = Kr, o.isSymbol = $e, o.isTypedArray = Cn, o.isUndefined = ud, o.isWeakMap = cd, o.isWeakSet = ld, o.join = ph, o.kebabCase = Vd, o.last = Xe, o.lastIndexOf = dh, o.lowerCase = eg, o.lowerFirst = tg, o.lt = fd, o.lte = hd, o.max = Yg, o.maxBy = Zg, o.mean = Xg, o.meanBy = Qg, o.min = Vg, o.minBy = em, o.stubArray = Ss, o.stubFalse = As, o.stubObject = $g, o.stubString = Bg, o.stubTrue = kg, o.multiply = tm, o.nth = gh, o.noConflict = Pg, o.noop = xs, o.now = qr, o.pad = ng, o.padEnd = rg, o.padStart = ig, o.parseInt = sg, o.random = Jd, o.reduce = _p, o.reduceRight = wp, o.repeat = ag, o.replace = og, o.result = Dd, o.round = nm, o.runInContext = p, o.sample = xp, o.size = Ep, o.snakeCase = ug, o.some = bp, o.sortedIndex = Sh, o.sortedIndexBy = Ah, o.sortedIndexOf = Eh, o.sortedLastIndex = bh, o.sortedLastIndexBy = Ch, o.sortedLastIndexOf = Fh, o.startCase = lg, o.startsWith = fg, o.subtract = rm, o.sum = im, o.sumBy = sm, o.template = hg, o.times = qg, o.toFinite = yt, o.toInteger = W, o.toLength = Jo, o.toLower = pg, o.toNumber = Qe, o.toSafeInteger = pd, o.toString = Z, o.toUpper = dg, o.trim = gg, o.trimEnd = mg, o.trimStart = vg, o.truncate = _g, o.unescape = wg, o.uniqueId = Hg, o.upperCase = yg, o.upperFirst = vs, o.each = Mo, o.eachRight = Uo, o.first = Ro, ys(o, function() {
|
|
6308
6311
|
var e = {};
|
|
6309
6312
|
return ut(o, function(t, n) {
|
|
6310
6313
|
X.call(o.prototype, n) || (e[n] = t);
|
|
6311
6314
|
}), e;
|
|
6312
|
-
}(), { chain: !1 }), o.VERSION =
|
|
6315
|
+
}(), { chain: !1 }), o.VERSION = f, Ke(["bind", "bindKey", "curry", "curryRight", "partial", "partialRight"], function(e) {
|
|
6313
6316
|
o[e].placeholder = o;
|
|
6314
|
-
}),
|
|
6317
|
+
}), Ke(["drop", "take"], function(e, t) {
|
|
6315
6318
|
q.prototype[e] = function(n) {
|
|
6316
6319
|
n = n === i ? 1 : de(W(n), 0);
|
|
6317
6320
|
var r = this.__filtered__ && !t ? new q(this) : this.clone();
|
|
@@ -6322,7 +6325,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
6322
6325
|
}, q.prototype[e + "Right"] = function(n) {
|
|
6323
6326
|
return this.reverse()[e](n).reverse();
|
|
6324
6327
|
};
|
|
6325
|
-
}),
|
|
6328
|
+
}), Ke(["filter", "map", "takeWhile"], function(e, t) {
|
|
6326
6329
|
var n = t + 1, r = n == er || n == nr;
|
|
6327
6330
|
q.prototype[e] = function(s) {
|
|
6328
6331
|
var u = this.clone();
|
|
@@ -6331,12 +6334,12 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
6331
6334
|
type: n
|
|
6332
6335
|
}), u.__filtered__ = u.__filtered__ || r, u;
|
|
6333
6336
|
};
|
|
6334
|
-
}),
|
|
6337
|
+
}), Ke(["head", "last"], function(e, t) {
|
|
6335
6338
|
var n = "take" + (t ? "Right" : "");
|
|
6336
6339
|
q.prototype[e] = function() {
|
|
6337
6340
|
return this[n](1).value()[0];
|
|
6338
6341
|
};
|
|
6339
|
-
}),
|
|
6342
|
+
}), Ke(["initial", "tail"], function(e, t) {
|
|
6340
6343
|
var n = "drop" + (t ? "" : "Right");
|
|
6341
6344
|
q.prototype[e] = function() {
|
|
6342
6345
|
return this.__filtered__ ? new q(this) : this[n](1);
|
|
@@ -6377,7 +6380,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
6377
6380
|
}
|
|
6378
6381
|
return L && D ? e.apply(this, h) : (M = this.thru(x), L ? r ? M.value()[0] : M.value() : M);
|
|
6379
6382
|
});
|
|
6380
|
-
}),
|
|
6383
|
+
}), Ke(["pop", "push", "shift", "sort", "splice", "unshift"], function(e) {
|
|
6381
6384
|
var t = hr[e], n = /^(?:push|sort|unshift)$/.test(e) ? "tap" : "thru", r = /^(?:pop|shift)$/.test(e);
|
|
6382
6385
|
o.prototype[e] = function() {
|
|
6383
6386
|
var s = arguments;
|
|
@@ -6405,19 +6408,19 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
6405
6408
|
}(Qn, Qn.exports)), Qn.exports;
|
|
6406
6409
|
}
|
|
6407
6410
|
var rv = nv();
|
|
6408
|
-
const Ts = (
|
|
6409
|
-
const a = rv.startCase(
|
|
6411
|
+
const Ts = (l) => {
|
|
6412
|
+
const a = rv.startCase(l).toLowerCase();
|
|
6410
6413
|
return a.charAt(0).toUpperCase() + a.slice(1);
|
|
6411
6414
|
}, iv = ({
|
|
6412
|
-
data:
|
|
6415
|
+
data: l
|
|
6413
6416
|
}) => `import { defineObject } from 'twenty-sdk';
|
|
6414
6417
|
|
|
6415
6418
|
export default defineObject({
|
|
6416
6419
|
universalIdentifier: '${Vn()}',
|
|
6417
|
-
nameSingular: '${
|
|
6418
|
-
namePlural: '${
|
|
6419
|
-
labelSingular: '${
|
|
6420
|
-
labelPlural: '${
|
|
6420
|
+
nameSingular: '${l.nameSingular}',
|
|
6421
|
+
namePlural: '${l.namePlural}',
|
|
6422
|
+
labelSingular: '${l.labelSingular}',
|
|
6423
|
+
labelPlural: '${l.labelPlural}',
|
|
6421
6424
|
icon: 'IconBox',
|
|
6422
6425
|
fields: [
|
|
6423
6426
|
// Add your fields here using defineField helper
|
|
@@ -6431,10 +6434,10 @@ export default defineObject({
|
|
|
6431
6434
|
],
|
|
6432
6435
|
});
|
|
6433
6436
|
`, sv = ({
|
|
6434
|
-
name:
|
|
6437
|
+
name: l,
|
|
6435
6438
|
universalIdentifier: a = Vn()
|
|
6436
6439
|
}) => {
|
|
6437
|
-
const i = Rn(
|
|
6440
|
+
const i = Rn(l);
|
|
6438
6441
|
return `import { defineRole } from 'twenty-sdk';
|
|
6439
6442
|
|
|
6440
6443
|
export const ${i.toUpperCase().replace(/-/g, "_")}_ROLE_UNIVERSAL_IDENTIFIER =
|
|
@@ -6442,7 +6445,7 @@ export const ${i.toUpperCase().replace(/-/g, "_")}_ROLE_UNIVERSAL_IDENTIFIER =
|
|
|
6442
6445
|
|
|
6443
6446
|
export default defineRole({
|
|
6444
6447
|
universalIdentifier: ${i.toUpperCase().replace(/-/g, "_")}_ROLE_UNIVERSAL_IDENTIFIER,
|
|
6445
|
-
label: '${
|
|
6448
|
+
label: '${l}',
|
|
6446
6449
|
description: 'Add a description for your role',
|
|
6447
6450
|
canReadAllObjectRecords: true,
|
|
6448
6451
|
canUpdateAllObjectRecords: true,
|
|
@@ -6451,27 +6454,27 @@ export default defineRole({
|
|
|
6451
6454
|
});
|
|
6452
6455
|
`;
|
|
6453
6456
|
}, av = ({
|
|
6454
|
-
data:
|
|
6457
|
+
data: l
|
|
6455
6458
|
}) => {
|
|
6456
|
-
const a = Vn(), i =
|
|
6457
|
-
description: '${
|
|
6459
|
+
const a = Vn(), i = l.description ? `
|
|
6460
|
+
description: '${l.description}',` : "";
|
|
6458
6461
|
return `import { defineField, FieldType } from 'twenty-sdk';
|
|
6459
6462
|
|
|
6460
6463
|
export default defineField({
|
|
6461
6464
|
universalIdentifier: '${a}',
|
|
6462
|
-
name: '${
|
|
6463
|
-
label: '${
|
|
6464
|
-
type: FieldMetadataType.${
|
|
6465
|
-
objectUniversalIdentifier: '${
|
|
6465
|
+
name: '${l.name}',
|
|
6466
|
+
label: '${l.label}',
|
|
6467
|
+
type: FieldMetadataType.${l.type},
|
|
6468
|
+
objectUniversalIdentifier: '${l.objectUniversalIdentifier}',${i}
|
|
6466
6469
|
});
|
|
6467
6470
|
`;
|
|
6468
6471
|
}, ov = "src";
|
|
6469
6472
|
class uv {
|
|
6470
6473
|
async execute(a, i) {
|
|
6471
6474
|
try {
|
|
6472
|
-
const
|
|
6475
|
+
const f = a ?? await this.getEntity(), g = this.getFolderName(f), _ = i ? st(bt, i) : st(bt, ov, g);
|
|
6473
6476
|
await Q.ensureDir(_);
|
|
6474
|
-
const { name: S, file: A } = await this.getEntityData(
|
|
6477
|
+
const { name: S, file: A } = await this.getEntityData(f), I = st(_, this.getFileName(S, f));
|
|
6475
6478
|
if (await Q.pathExists(I)) {
|
|
6476
6479
|
const { overwrite: P } = await this.handleFileExist();
|
|
6477
6480
|
if (!P)
|
|
@@ -6481,47 +6484,47 @@ class uv {
|
|
|
6481
6484
|
E.green(`✓ Created ${g}:`),
|
|
6482
6485
|
E.cyan(ft(bt, I))
|
|
6483
6486
|
);
|
|
6484
|
-
} catch (
|
|
6487
|
+
} catch (f) {
|
|
6485
6488
|
console.error(
|
|
6486
6489
|
E.red("Add new entity failed:"),
|
|
6487
|
-
|
|
6490
|
+
f instanceof Error ? f.message : f
|
|
6488
6491
|
), process.exit(1);
|
|
6489
6492
|
}
|
|
6490
6493
|
}
|
|
6491
6494
|
async getEntityData(a) {
|
|
6492
6495
|
switch (a) {
|
|
6493
6496
|
case ge.Object: {
|
|
6494
|
-
const i = await this.getObjectData(),
|
|
6497
|
+
const i = await this.getObjectData(), f = i.nameSingular, g = iv({
|
|
6495
6498
|
data: i
|
|
6496
6499
|
});
|
|
6497
|
-
return { name:
|
|
6500
|
+
return { name: f, file: g };
|
|
6498
6501
|
}
|
|
6499
6502
|
case ge.Field: {
|
|
6500
|
-
const i = await this.getFieldData(),
|
|
6503
|
+
const i = await this.getFieldData(), f = i.name, g = av({
|
|
6501
6504
|
data: i
|
|
6502
6505
|
});
|
|
6503
|
-
return { name:
|
|
6506
|
+
return { name: f, file: g };
|
|
6504
6507
|
}
|
|
6505
6508
|
case ge.LogicFunction: {
|
|
6506
|
-
const i = await this.getEntityName(a),
|
|
6509
|
+
const i = await this.getEntityName(a), f = ev({
|
|
6507
6510
|
name: i
|
|
6508
6511
|
});
|
|
6509
|
-
return { name: i, file:
|
|
6512
|
+
return { name: i, file: f };
|
|
6510
6513
|
}
|
|
6511
6514
|
case ge.FrontComponent: {
|
|
6512
|
-
const i = await this.getEntityName(a),
|
|
6515
|
+
const i = await this.getEntityName(a), f = V0({
|
|
6513
6516
|
name: i
|
|
6514
6517
|
});
|
|
6515
|
-
return { name: i, file:
|
|
6518
|
+
return { name: i, file: f };
|
|
6516
6519
|
}
|
|
6517
6520
|
case ge.Role: {
|
|
6518
|
-
const i = await this.getEntityName(a),
|
|
6521
|
+
const i = await this.getEntityName(a), f = sv({
|
|
6519
6522
|
name: i
|
|
6520
6523
|
});
|
|
6521
|
-
return { name: i, file:
|
|
6524
|
+
return { name: i, file: f };
|
|
6522
6525
|
}
|
|
6523
6526
|
default:
|
|
6524
|
-
|
|
6527
|
+
mu();
|
|
6525
6528
|
}
|
|
6526
6529
|
}
|
|
6527
6530
|
async getEntity() {
|
|
@@ -6553,7 +6556,7 @@ class uv {
|
|
|
6553
6556
|
name: "name",
|
|
6554
6557
|
message: `Enter a name for your new ${a}:`,
|
|
6555
6558
|
default: "",
|
|
6556
|
-
validate: (
|
|
6559
|
+
validate: (f) => f.length === 0 ? `${a} name is required` : !0
|
|
6557
6560
|
}
|
|
6558
6561
|
]);
|
|
6559
6562
|
return i;
|
|
@@ -6640,54 +6643,54 @@ class uv {
|
|
|
6640
6643
|
}
|
|
6641
6644
|
}
|
|
6642
6645
|
}
|
|
6643
|
-
const cv = (
|
|
6644
|
-
const a = new H0(), i = new
|
|
6645
|
-
|
|
6646
|
-
await i.execute(
|
|
6647
|
-
}),
|
|
6648
|
-
await
|
|
6649
|
-
}),
|
|
6646
|
+
const cv = (l) => {
|
|
6647
|
+
const a = new H0(), i = new j0(), f = new K0(), g = new z0(), _ = new Z0();
|
|
6648
|
+
l.command("auth:login").description("Authenticate with Twenty").option("--api-key <key>", "API key for authentication").option("--api-url <url>", "Twenty API URL").action(async (j) => {
|
|
6649
|
+
await i.execute(j);
|
|
6650
|
+
}), l.command("auth:logout").description("Remove authentication credentials").action(async () => {
|
|
6651
|
+
await f.execute();
|
|
6652
|
+
}), l.command("auth:status").description("Check authentication status").action(async () => {
|
|
6650
6653
|
await g.execute();
|
|
6651
|
-
}),
|
|
6652
|
-
await _.execute({ workspace:
|
|
6653
|
-
}),
|
|
6654
|
+
}), l.command("auth:switch [workspace]").description("Switch the default workspace for authentication").action(async (j) => {
|
|
6655
|
+
await _.execute({ workspace: j });
|
|
6656
|
+
}), l.command("auth:list").description("List all configured workspaces").action(async () => {
|
|
6654
6657
|
await a.execute();
|
|
6655
6658
|
});
|
|
6656
6659
|
const S = new $0(), A = new G0(), I = new uv(), P = new q0(), z = new Y0(), G = new J0();
|
|
6657
|
-
|
|
6660
|
+
l.command("app:dev [appPath]").description("Watch and sync local application changes").action(async (j) => {
|
|
6658
6661
|
await S.execute({
|
|
6659
|
-
appPath: Zn(
|
|
6662
|
+
appPath: Zn(j)
|
|
6660
6663
|
});
|
|
6661
|
-
}),
|
|
6664
|
+
}), l.command("app:uninstall [appPath]").description("Uninstall application from Twenty").option("-y, --yes", "Skip confirmation prompt").action(async (j, B) => {
|
|
6662
6665
|
try {
|
|
6663
6666
|
const ae = await A.execute({
|
|
6664
|
-
appPath: Zn(
|
|
6667
|
+
appPath: Zn(j),
|
|
6665
6668
|
askForConfirmation: !B?.yes
|
|
6666
6669
|
});
|
|
6667
6670
|
process.exit(ae.success ? 0 : 1);
|
|
6668
6671
|
} catch {
|
|
6669
6672
|
process.exit(1);
|
|
6670
6673
|
}
|
|
6671
|
-
}),
|
|
6674
|
+
}), l.command("entity:add [entityType]").option("--path <path>", "Path in which the entity should be created.").description(
|
|
6672
6675
|
`Add a new entity to your application (${Object.values(ge).join("|")})`
|
|
6673
|
-
).action(async (
|
|
6674
|
-
await I.execute(
|
|
6675
|
-
}),
|
|
6676
|
-
await P.execute(Zn(
|
|
6677
|
-
}),
|
|
6676
|
+
).action(async (j, B) => {
|
|
6677
|
+
await I.execute(j, B?.path);
|
|
6678
|
+
}), l.command("app:generate [appPath]").description("Generate Twenty client").action(async (j) => {
|
|
6679
|
+
await P.execute(Zn(j));
|
|
6680
|
+
}), l.command("function:logs [appPath]").option(
|
|
6678
6681
|
"-u, --functionUniversalIdentifier <functionUniversalIdentifier>",
|
|
6679
6682
|
"Only show logs for the function with this universal ID"
|
|
6680
6683
|
).option(
|
|
6681
6684
|
"-n, --functionName <functionName>",
|
|
6682
6685
|
"Only show logs for the function with this name"
|
|
6683
6686
|
).description("Watch application function logs").action(
|
|
6684
|
-
async (
|
|
6687
|
+
async (j, B) => {
|
|
6685
6688
|
await z.execute({
|
|
6686
6689
|
...B,
|
|
6687
|
-
appPath: Zn(
|
|
6690
|
+
appPath: Zn(j)
|
|
6688
6691
|
});
|
|
6689
6692
|
}
|
|
6690
|
-
),
|
|
6693
|
+
), l.command("function:execute [appPath]").option(
|
|
6691
6694
|
"-p, --payload <payload>",
|
|
6692
6695
|
"JSON payload to send to the function",
|
|
6693
6696
|
"{}"
|
|
@@ -6698,7 +6701,7 @@ const cv = (f) => {
|
|
|
6698
6701
|
"-n, --functionName <functionName>",
|
|
6699
6702
|
"Name of the function to execute"
|
|
6700
6703
|
).description("Execute a logic function with a JSON payload").action(
|
|
6701
|
-
async (
|
|
6704
|
+
async (j, B) => {
|
|
6702
6705
|
!B?.functionUniversalIdentifier && !B?.functionName && (console.error(
|
|
6703
6706
|
E.red(
|
|
6704
6707
|
"Error: Either --functionName (-n) or --functionUniversalIdentifier (-u) is required."
|
|
@@ -6706,22 +6709,22 @@ const cv = (f) => {
|
|
|
6706
6709
|
), process.exit(1)), await G.execute({
|
|
6707
6710
|
...B,
|
|
6708
6711
|
payload: B?.payload ?? "{}",
|
|
6709
|
-
appPath: Zn(
|
|
6712
|
+
appPath: Zn(j)
|
|
6710
6713
|
});
|
|
6711
6714
|
}
|
|
6712
6715
|
);
|
|
6713
|
-
}, lv = "0.
|
|
6716
|
+
}, lv = "0.6.0-alpha", fv = {
|
|
6714
6717
|
version: lv
|
|
6715
6718
|
};
|
|
6716
|
-
|
|
6717
|
-
const On = new
|
|
6719
|
+
Em.defaultOptions.depth = 10;
|
|
6720
|
+
const On = new Sm();
|
|
6718
6721
|
On.name("twenty").description("CLI for Twenty application development").version(fv.version);
|
|
6719
6722
|
On.option(
|
|
6720
6723
|
"--workspace <name>",
|
|
6721
6724
|
"Use a specific workspace configuration (overrides the default set by auth:switch)"
|
|
6722
6725
|
);
|
|
6723
|
-
On.hook("preAction", async (
|
|
6724
|
-
let i = (
|
|
6726
|
+
On.hook("preAction", async (l) => {
|
|
6727
|
+
let i = (l.optsWithGlobals ? l.optsWithGlobals() : l.opts()).workspace;
|
|
6725
6728
|
i || (i = await new Ae().getDefaultWorkspace()), Ae.setActiveWorkspace(i), console.log(
|
|
6726
6729
|
E.gray(`👩💻 Workspace - ${Ae.getActiveWorkspace()}`)
|
|
6727
6730
|
);
|
|
@@ -6730,6 +6733,6 @@ cv(On);
|
|
|
6730
6733
|
On.exitOverride();
|
|
6731
6734
|
try {
|
|
6732
6735
|
On.parse();
|
|
6733
|
-
} catch (
|
|
6734
|
-
|
|
6736
|
+
} catch (l) {
|
|
6737
|
+
l instanceof Am && process.exit(l.exitCode), l instanceof Error && (console.error(E.red("Error:"), l.message), process.exit(1));
|
|
6735
6738
|
}
|