twenty-sdk 2.1.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/README.md +3 -3
  2. package/dist/billing/index.cjs.map +1 -1
  3. package/dist/billing/index.mjs +9 -9
  4. package/dist/billing/index.mjs.map +1 -1
  5. package/dist/cli/commands/add.d.ts +1 -0
  6. package/dist/cli/operations/deploy.d.ts +2 -0
  7. package/dist/cli/operations/index.d.ts +3 -0
  8. package/dist/cli/operations/server-upgrade.d.ts +12 -0
  9. package/dist/cli/types.d.ts +2 -0
  10. package/dist/cli/utilities/build/manifest/manifest-extract-config.d.ts +6 -2
  11. package/dist/cli/utilities/entity/entity-command-menu-item-template.d.ts +3 -0
  12. package/dist/cli/utilities/entity/entity-connection-provider-template.d.ts +4 -0
  13. package/dist/cli/utilities/file/append-server-variables.util.d.ts +22 -0
  14. package/dist/cli/utilities/server/docker-container.d.ts +5 -0
  15. package/dist/cli.cjs +147 -105
  16. package/dist/cli.mjs +3213 -3023
  17. package/dist/define/index.cjs +16 -16
  18. package/dist/define/index.cjs.map +1 -1
  19. package/dist/define/index.d.ts +73 -35
  20. package/dist/define/index.mjs +3386 -6646
  21. package/dist/define/index.mjs.map +1 -1
  22. package/dist/front-component/index.cjs +15 -15
  23. package/dist/front-component/index.cjs.map +1 -1
  24. package/dist/front-component/index.d.ts +12 -1
  25. package/dist/front-component/index.mjs +3274 -6566
  26. package/dist/front-component/index.mjs.map +1 -1
  27. package/dist/{get-function-input-schema-BZ7_XyUh-D38OurwZ.js → get-function-input-schema-BZ7_XyUh-BXB2AcBE.js} +1 -1
  28. package/dist/{get-function-input-schema-BZ7_XyUh-CKgoFzji.mjs → get-function-input-schema-BZ7_XyUh-PnCntsct.mjs} +1 -1
  29. package/dist/logic-function/index.cjs +1 -1
  30. package/dist/logic-function/index.cjs.map +1 -1
  31. package/dist/logic-function/index.d.ts +91 -20
  32. package/dist/logic-function/index.mjs +52 -1
  33. package/dist/logic-function/index.mjs.map +1 -1
  34. package/dist/operations.cjs +1 -1
  35. package/dist/operations.mjs +24 -18
  36. package/dist/ui/index.cjs +36 -2234
  37. package/dist/ui/index.mjs +11051 -17373
  38. package/dist/uninstall-BiLmSWhb.js +253 -0
  39. package/dist/{uninstall-Bw-TK4rL.mjs → uninstall-DAf2XiS3.mjs} +5064 -8113
  40. package/package.json +6 -2
  41. package/dist/uninstall-CYiYoBPe.js +0 -250
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  <div align="center">
2
2
  <a href="https://twenty.com">
3
3
  <picture>
4
- <img alt="Twenty logo" src="https://raw.githubusercontent.com/twentyhq/twenty/2f25922f4cd5bd61e1427c57c4f8ea224e1d552c/packages/twenty-website/public/images/core/logo.svg" height="128">
4
+ <img alt="Twenty logo" src="https://raw.githubusercontent.com/twentyhq/twenty/main/packages/twenty-website-new/public/images/core/logo.svg" height="128">
5
5
  </picture>
6
6
  </a>
7
7
  <h1>Twenty SDK</h1>
@@ -19,8 +19,8 @@ A CLI and SDK to develop, build, and publish applications that extend [Twenty CR
19
19
  The recommended way to start is with [create-twenty-app](https://www.npmjs.com/package/create-twenty-app):
20
20
 
21
21
  ```bash
22
- npx create-twenty-app@latest my-app
23
- cd my-app
22
+ npx create-twenty-app@latest my-twenty-app
23
+ cd my-twenty-app
24
24
  yarn twenty dev
25
25
  ```
26
26
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../twenty-shared/dist/application.mjs","../../src/sdk/billing/charge-credits.ts"],"sourcesContent":["const _ = \"public\", A = \"TWENTY_API_KEY\", T = \"TWENTY_API_URL\", t = \"TWENTY_APP_ACCESS_TOKEN\", N = \"generated\", r = {\n js: `import { createRequire as __createRequire } from 'module';\nconst require = __createRequire(import.meta.url);`\n}, u = \".twenty/output\", E = \"Standard\", I = \"20202020-64aa-4b6f-b003-9c74b97cee20\";\nvar e = /* @__PURE__ */ ((o) => (o.Object = \"object\", o.Field = \"field\", o.LogicFunction = \"logicFunction\", o.FrontComponent = \"frontComponent\", o.Role = \"role\", o.Skill = \"skill\", o.Agent = \"agent\", o.View = \"view\", o.NavigationMenuItem = \"navigationMenuItem\", o.PageLayout = \"pageLayout\", o.PageLayoutTab = \"pageLayoutTab\", o))(e || {});\nexport {\n _ as ASSETS_DIR,\n A as DEFAULT_API_KEY_NAME,\n T as DEFAULT_API_URL_NAME,\n t as DEFAULT_APP_ACCESS_TOKEN_NAME,\n N as GENERATED_DIR,\n r as NODE_ESM_CJS_BANNER,\n u as OUTPUT_DIR,\n e as SyncableEntity,\n E as TWENTY_STANDARD_APPLICATION_NAME,\n I as TWENTY_STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER\n};\n","import {\n DEFAULT_API_URL_NAME,\n DEFAULT_APP_ACCESS_TOKEN_NAME,\n} from 'twenty-shared/application';\n\nconst BILLING_CHARGE_TIMEOUT_MS = 5_000;\n\nexport type ChargeCreditsParams = {\n creditsUsedMicro: number;\n operationType: string;\n quantity?: number;\n resourceContext?: string;\n};\n\n// Records credit usage against the running application via the Twenty\n// server's `/app/billing/charge` endpoint. Reads `TWENTY_API_URL` and\n// `TWENTY_APP_ACCESS_TOKEN` from the execution env (injected by the\n// logic-function runtime). No-ops silently when either is missing so\n// local/test runs don't crash. Failures are non-fatal — a billing error\n// never surfaces as a tool failure.\nexport const chargeCredits = async ({\n creditsUsedMicro,\n operationType,\n quantity = 1,\n resourceContext,\n}: ChargeCreditsParams): Promise<void> => {\n const apiUrl = process.env[DEFAULT_API_URL_NAME];\n const token = process.env[DEFAULT_APP_ACCESS_TOKEN_NAME];\n\n if (!apiUrl || !token) {\n return;\n }\n\n try {\n const response = await fetch(\n `${apiUrl.replace(/\\/$/, '')}/app/billing/charge`,\n {\n method: 'POST',\n headers: {\n Authorization: `Bearer ${token}`,\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n creditsUsedMicro,\n quantity,\n operationType,\n resourceContext,\n }),\n signal: AbortSignal.timeout(BILLING_CHARGE_TIMEOUT_MS),\n },\n );\n\n if (!response.ok) {\n const body = await response.text().catch(() => '');\n\n console.error(\n `chargeCredits: ${response.status} ${response.statusText}: ${body}`,\n );\n }\n } catch (error) {\n console.error(\n `chargeCredits: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n};\n"],"names":["T","t","BILLING_CHARGE_TIMEOUT_MS","chargeCredits","creditsUsedMicro","operationType","quantity","resourceContext","apiUrl","DEFAULT_API_URL_NAME","token","DEFAULT_APP_ACCESS_TOKEN_NAME","response","body","error"],"mappings":"gFAAK,MAAqCA,EAAI,iBAAkBC,EAAI,0BCK9DC,EAA4B,IAerBC,EAAgB,MAAO,CAClC,iBAAAC,EACA,cAAAC,EACA,SAAAC,EAAW,EACX,gBAAAC,CACF,IAA0C,CACxC,MAAMC,EAAS,QAAQ,IAAIC,CAAoB,EACzCC,EAAQ,QAAQ,IAAIC,CAA6B,EAEvD,GAAI,GAACH,GAAU,CAACE,GAIhB,GAAI,CACF,MAAME,EAAW,MAAM,MACrB,GAAGJ,EAAO,QAAQ,MAAO,EAAE,CAAC,sBAC5B,CACE,OAAQ,OACR,QAAS,CACP,cAAe,UAAUE,CAAK,GAC9B,eAAgB,kBAAA,EAElB,KAAM,KAAK,UAAU,CACnB,iBAAAN,EACA,SAAAE,EACA,cAAAD,EACA,gBAAAE,CAAA,CACD,EACD,OAAQ,YAAY,QAAQL,CAAyB,CAAA,CACvD,EAGF,GAAI,CAACU,EAAS,GAAI,CAChB,MAAMC,EAAO,MAAMD,EAAS,OAAO,MAAM,IAAM,EAAE,EAEjD,QAAQ,MACN,kBAAkBA,EAAS,MAAM,IAAIA,EAAS,UAAU,KAAKC,CAAI,EAAA,CAErE,CACF,OAASC,EAAO,CACd,QAAQ,MACN,kBAAkBA,aAAiB,MAAQA,EAAM,QAAU,OAAOA,CAAK,CAAC,EAAA,CAE5E,CACF"}
1
+ {"version":3,"file":"index.cjs","sources":["../../../twenty-shared/dist/application.mjs","../../src/sdk/billing/charge-credits.ts"],"sourcesContent":["const _ = \"public\", A = \"TWENTY_API_KEY\", T = \"TWENTY_API_URL\", r = \"TWENTY_APP_ACCESS_TOKEN\", t = \"generated\", N = {\n js: `import { createRequire as __createRequire } from 'module';\nconst require = __createRequire(import.meta.url);`\n}, u = \".twenty/output\", I = \"Standard\", n = \"20202020-64aa-4b6f-b003-9c74b97cee20\";\nvar e = /* @__PURE__ */ ((o) => (o.Object = \"object\", o.Field = \"field\", o.LogicFunction = \"logicFunction\", o.FrontComponent = \"frontComponent\", o.Role = \"role\", o.Skill = \"skill\", o.Agent = \"agent\", o.ConnectionProvider = \"connectionProvider\", o.View = \"view\", o.NavigationMenuItem = \"navigationMenuItem\", o.PageLayout = \"pageLayout\", o.PageLayoutTab = \"pageLayoutTab\", o.CommandMenuItem = \"commandMenuItem\", o))(e || {});\nexport {\n _ as ASSETS_DIR,\n A as DEFAULT_API_KEY_NAME,\n T as DEFAULT_API_URL_NAME,\n r as DEFAULT_APP_ACCESS_TOKEN_NAME,\n t as GENERATED_DIR,\n N as NODE_ESM_CJS_BANNER,\n u as OUTPUT_DIR,\n e as SyncableEntity,\n I as TWENTY_STANDARD_APPLICATION_NAME,\n n as TWENTY_STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER\n};\n","import {\n DEFAULT_API_URL_NAME,\n DEFAULT_APP_ACCESS_TOKEN_NAME,\n} from 'twenty-shared/application';\n\nconst BILLING_CHARGE_TIMEOUT_MS = 5_000;\n\nexport type ChargeCreditsParams = {\n creditsUsedMicro: number;\n operationType: string;\n quantity?: number;\n resourceContext?: string;\n};\n\n// Records credit usage against the running application via the Twenty\n// server's `/app/billing/charge` endpoint. Reads `TWENTY_API_URL` and\n// `TWENTY_APP_ACCESS_TOKEN` from the execution env (injected by the\n// logic-function runtime). No-ops silently when either is missing so\n// local/test runs don't crash. Failures are non-fatal — a billing error\n// never surfaces as a tool failure.\nexport const chargeCredits = async ({\n creditsUsedMicro,\n operationType,\n quantity = 1,\n resourceContext,\n}: ChargeCreditsParams): Promise<void> => {\n const apiUrl = process.env[DEFAULT_API_URL_NAME];\n const token = process.env[DEFAULT_APP_ACCESS_TOKEN_NAME];\n\n if (!apiUrl || !token) {\n return;\n }\n\n try {\n const response = await fetch(\n `${apiUrl.replace(/\\/$/, '')}/app/billing/charge`,\n {\n method: 'POST',\n headers: {\n Authorization: `Bearer ${token}`,\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n creditsUsedMicro,\n quantity,\n operationType,\n resourceContext,\n }),\n signal: AbortSignal.timeout(BILLING_CHARGE_TIMEOUT_MS),\n },\n );\n\n if (!response.ok) {\n const body = await response.text().catch(() => '');\n\n console.error(\n `chargeCredits: ${response.status} ${response.statusText}: ${body}`,\n );\n }\n } catch (error) {\n console.error(\n `chargeCredits: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n};\n"],"names":["T","r","BILLING_CHARGE_TIMEOUT_MS","chargeCredits","creditsUsedMicro","operationType","quantity","resourceContext","apiUrl","DEFAULT_API_URL_NAME","token","DEFAULT_APP_ACCESS_TOKEN_NAME","response","body","error"],"mappings":"gFAAK,MAAqCA,EAAI,iBAAkBC,EAAI,0BCK9DC,EAA4B,IAerBC,EAAgB,MAAO,CAClC,iBAAAC,EACA,cAAAC,EACA,SAAAC,EAAW,EACX,gBAAAC,CACF,IAA0C,CACxC,MAAMC,EAAS,QAAQ,IAAIC,CAAoB,EACzCC,EAAQ,QAAQ,IAAIC,CAA6B,EAEvD,GAAI,GAACH,GAAU,CAACE,GAIhB,GAAI,CACF,MAAME,EAAW,MAAM,MACrB,GAAGJ,EAAO,QAAQ,MAAO,EAAE,CAAC,sBAC5B,CACE,OAAQ,OACR,QAAS,CACP,cAAe,UAAUE,CAAK,GAC9B,eAAgB,kBAAA,EAElB,KAAM,KAAK,UAAU,CACnB,iBAAAN,EACA,SAAAE,EACA,cAAAD,EACA,gBAAAE,CAAA,CACD,EACD,OAAQ,YAAY,QAAQL,CAAyB,CAAA,CACvD,EAGF,GAAI,CAACU,EAAS,GAAI,CAChB,MAAMC,EAAO,MAAMD,EAAS,OAAO,MAAM,IAAM,EAAE,EAEjD,QAAQ,MACN,kBAAkBA,EAAS,MAAM,IAAIA,EAAS,UAAU,KAAKC,CAAI,EAAA,CAErE,CACF,OAASC,EAAO,CACd,QAAQ,MACN,kBAAkBA,aAAiB,MAAQA,EAAM,QAAU,OAAOA,CAAK,CAAC,EAAA,CAE5E,CACF"}
@@ -5,11 +5,11 @@ const p = async ({
5
5
  quantity: n = 1,
6
6
  resourceContext: a
7
7
  }) => {
8
- const e = process.env[i], r = process.env[T];
9
- if (!(!e || !r))
8
+ const t = process.env[i], r = process.env[T];
9
+ if (!(!t || !r))
10
10
  try {
11
- const t = await fetch(
12
- `${e.replace(/\/$/, "")}/app/billing/charge`,
11
+ const e = await fetch(
12
+ `${t.replace(/\/$/, "")}/app/billing/charge`,
13
13
  {
14
14
  method: "POST",
15
15
  headers: {
@@ -25,15 +25,15 @@ const p = async ({
25
25
  signal: AbortSignal.timeout(5e3)
26
26
  }
27
27
  );
28
- if (!t.ok) {
29
- const c = await t.text().catch(() => "");
28
+ if (!e.ok) {
29
+ const c = await e.text().catch(() => "");
30
30
  console.error(
31
- `chargeCredits: ${t.status} ${t.statusText}: ${c}`
31
+ `chargeCredits: ${e.status} ${e.statusText}: ${c}`
32
32
  );
33
33
  }
34
- } catch (t) {
34
+ } catch (e) {
35
35
  console.error(
36
- `chargeCredits: ${t instanceof Error ? t.message : String(t)}`
36
+ `chargeCredits: ${e instanceof Error ? e.message : String(e)}`
37
37
  );
38
38
  }
39
39
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../twenty-shared/dist/application.mjs","../../src/sdk/billing/charge-credits.ts"],"sourcesContent":["const _ = \"public\", A = \"TWENTY_API_KEY\", T = \"TWENTY_API_URL\", t = \"TWENTY_APP_ACCESS_TOKEN\", N = \"generated\", r = {\n js: `import { createRequire as __createRequire } from 'module';\nconst require = __createRequire(import.meta.url);`\n}, u = \".twenty/output\", E = \"Standard\", I = \"20202020-64aa-4b6f-b003-9c74b97cee20\";\nvar e = /* @__PURE__ */ ((o) => (o.Object = \"object\", o.Field = \"field\", o.LogicFunction = \"logicFunction\", o.FrontComponent = \"frontComponent\", o.Role = \"role\", o.Skill = \"skill\", o.Agent = \"agent\", o.View = \"view\", o.NavigationMenuItem = \"navigationMenuItem\", o.PageLayout = \"pageLayout\", o.PageLayoutTab = \"pageLayoutTab\", o))(e || {});\nexport {\n _ as ASSETS_DIR,\n A as DEFAULT_API_KEY_NAME,\n T as DEFAULT_API_URL_NAME,\n t as DEFAULT_APP_ACCESS_TOKEN_NAME,\n N as GENERATED_DIR,\n r as NODE_ESM_CJS_BANNER,\n u as OUTPUT_DIR,\n e as SyncableEntity,\n E as TWENTY_STANDARD_APPLICATION_NAME,\n I as TWENTY_STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER\n};\n","import {\n DEFAULT_API_URL_NAME,\n DEFAULT_APP_ACCESS_TOKEN_NAME,\n} from 'twenty-shared/application';\n\nconst BILLING_CHARGE_TIMEOUT_MS = 5_000;\n\nexport type ChargeCreditsParams = {\n creditsUsedMicro: number;\n operationType: string;\n quantity?: number;\n resourceContext?: string;\n};\n\n// Records credit usage against the running application via the Twenty\n// server's `/app/billing/charge` endpoint. Reads `TWENTY_API_URL` and\n// `TWENTY_APP_ACCESS_TOKEN` from the execution env (injected by the\n// logic-function runtime). No-ops silently when either is missing so\n// local/test runs don't crash. Failures are non-fatal — a billing error\n// never surfaces as a tool failure.\nexport const chargeCredits = async ({\n creditsUsedMicro,\n operationType,\n quantity = 1,\n resourceContext,\n}: ChargeCreditsParams): Promise<void> => {\n const apiUrl = process.env[DEFAULT_API_URL_NAME];\n const token = process.env[DEFAULT_APP_ACCESS_TOKEN_NAME];\n\n if (!apiUrl || !token) {\n return;\n }\n\n try {\n const response = await fetch(\n `${apiUrl.replace(/\\/$/, '')}/app/billing/charge`,\n {\n method: 'POST',\n headers: {\n Authorization: `Bearer ${token}`,\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n creditsUsedMicro,\n quantity,\n operationType,\n resourceContext,\n }),\n signal: AbortSignal.timeout(BILLING_CHARGE_TIMEOUT_MS),\n },\n );\n\n if (!response.ok) {\n const body = await response.text().catch(() => '');\n\n console.error(\n `chargeCredits: ${response.status} ${response.statusText}: ${body}`,\n );\n }\n } catch (error) {\n console.error(\n `chargeCredits: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n};\n"],"names":["T","t","chargeCredits","creditsUsedMicro","operationType","quantity","resourceContext","apiUrl","DEFAULT_API_URL_NAME","token","DEFAULT_APP_ACCESS_TOKEN_NAME","response","body","error"],"mappings":"AAAK,MAAqCA,IAAI,kBAAkBC,IAAI;ACoB7D,MAAMC,IAAgB,OAAO;AAAA,EAClC,kBAAAC;AAAA,EACA,eAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,iBAAAC;AACF,MAA0C;AACxC,QAAMC,IAAS,QAAQ,IAAIC,CAAoB,GACzCC,IAAQ,QAAQ,IAAIC,CAA6B;AAEvD,MAAI,GAACH,KAAU,CAACE;AAIhB,QAAI;AACF,YAAME,IAAW,MAAM;AAAA,QACrB,GAAGJ,EAAO,QAAQ,OAAO,EAAE,CAAC;AAAA,QAC5B;AAAA,UACE,QAAQ;AAAA,UACR,SAAS;AAAA,YACP,eAAe,UAAUE,CAAK;AAAA,YAC9B,gBAAgB;AAAA,UAAA;AAAA,UAElB,MAAM,KAAK,UAAU;AAAA,YACnB,kBAAAN;AAAA,YACA,UAAAE;AAAA,YACA,eAAAD;AAAA,YACA,iBAAAE;AAAA,UAAA,CACD;AAAA,UACD,QAAQ,YAAY,QAAQ,GAAyB;AAAA,QAAA;AAAA,MACvD;AAGF,UAAI,CAACK,EAAS,IAAI;AAChB,cAAMC,IAAO,MAAMD,EAAS,OAAO,MAAM,MAAM,EAAE;AAEjD,gBAAQ;AAAA,UACN,kBAAkBA,EAAS,MAAM,IAAIA,EAAS,UAAU,KAAKC,CAAI;AAAA,QAAA;AAAA,MAErE;AAAA,IACF,SAASC,GAAO;AACd,cAAQ;AAAA,QACN,kBAAkBA,aAAiB,QAAQA,EAAM,UAAU,OAAOA,CAAK,CAAC;AAAA,MAAA;AAAA,IAE5E;AACF;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../../twenty-shared/dist/application.mjs","../../src/sdk/billing/charge-credits.ts"],"sourcesContent":["const _ = \"public\", A = \"TWENTY_API_KEY\", T = \"TWENTY_API_URL\", r = \"TWENTY_APP_ACCESS_TOKEN\", t = \"generated\", N = {\n js: `import { createRequire as __createRequire } from 'module';\nconst require = __createRequire(import.meta.url);`\n}, u = \".twenty/output\", I = \"Standard\", n = \"20202020-64aa-4b6f-b003-9c74b97cee20\";\nvar e = /* @__PURE__ */ ((o) => (o.Object = \"object\", o.Field = \"field\", o.LogicFunction = \"logicFunction\", o.FrontComponent = \"frontComponent\", o.Role = \"role\", o.Skill = \"skill\", o.Agent = \"agent\", o.ConnectionProvider = \"connectionProvider\", o.View = \"view\", o.NavigationMenuItem = \"navigationMenuItem\", o.PageLayout = \"pageLayout\", o.PageLayoutTab = \"pageLayoutTab\", o.CommandMenuItem = \"commandMenuItem\", o))(e || {});\nexport {\n _ as ASSETS_DIR,\n A as DEFAULT_API_KEY_NAME,\n T as DEFAULT_API_URL_NAME,\n r as DEFAULT_APP_ACCESS_TOKEN_NAME,\n t as GENERATED_DIR,\n N as NODE_ESM_CJS_BANNER,\n u as OUTPUT_DIR,\n e as SyncableEntity,\n I as TWENTY_STANDARD_APPLICATION_NAME,\n n as TWENTY_STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER\n};\n","import {\n DEFAULT_API_URL_NAME,\n DEFAULT_APP_ACCESS_TOKEN_NAME,\n} from 'twenty-shared/application';\n\nconst BILLING_CHARGE_TIMEOUT_MS = 5_000;\n\nexport type ChargeCreditsParams = {\n creditsUsedMicro: number;\n operationType: string;\n quantity?: number;\n resourceContext?: string;\n};\n\n// Records credit usage against the running application via the Twenty\n// server's `/app/billing/charge` endpoint. Reads `TWENTY_API_URL` and\n// `TWENTY_APP_ACCESS_TOKEN` from the execution env (injected by the\n// logic-function runtime). No-ops silently when either is missing so\n// local/test runs don't crash. Failures are non-fatal — a billing error\n// never surfaces as a tool failure.\nexport const chargeCredits = async ({\n creditsUsedMicro,\n operationType,\n quantity = 1,\n resourceContext,\n}: ChargeCreditsParams): Promise<void> => {\n const apiUrl = process.env[DEFAULT_API_URL_NAME];\n const token = process.env[DEFAULT_APP_ACCESS_TOKEN_NAME];\n\n if (!apiUrl || !token) {\n return;\n }\n\n try {\n const response = await fetch(\n `${apiUrl.replace(/\\/$/, '')}/app/billing/charge`,\n {\n method: 'POST',\n headers: {\n Authorization: `Bearer ${token}`,\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n creditsUsedMicro,\n quantity,\n operationType,\n resourceContext,\n }),\n signal: AbortSignal.timeout(BILLING_CHARGE_TIMEOUT_MS),\n },\n );\n\n if (!response.ok) {\n const body = await response.text().catch(() => '');\n\n console.error(\n `chargeCredits: ${response.status} ${response.statusText}: ${body}`,\n );\n }\n } catch (error) {\n console.error(\n `chargeCredits: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n};\n"],"names":["T","r","chargeCredits","creditsUsedMicro","operationType","quantity","resourceContext","apiUrl","DEFAULT_API_URL_NAME","token","DEFAULT_APP_ACCESS_TOKEN_NAME","response","body","error"],"mappings":"AAAK,MAAqCA,IAAI,kBAAkBC,IAAI;ACoB7D,MAAMC,IAAgB,OAAO;AAAA,EAClC,kBAAAC;AAAA,EACA,eAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,iBAAAC;AACF,MAA0C;AACxC,QAAMC,IAAS,QAAQ,IAAIC,CAAoB,GACzCC,IAAQ,QAAQ,IAAIC,CAA6B;AAEvD,MAAI,GAACH,KAAU,CAACE;AAIhB,QAAI;AACF,YAAME,IAAW,MAAM;AAAA,QACrB,GAAGJ,EAAO,QAAQ,OAAO,EAAE,CAAC;AAAA,QAC5B;AAAA,UACE,QAAQ;AAAA,UACR,SAAS;AAAA,YACP,eAAe,UAAUE,CAAK;AAAA,YAC9B,gBAAgB;AAAA,UAAA;AAAA,UAElB,MAAM,KAAK,UAAU;AAAA,YACnB,kBAAAN;AAAA,YACA,UAAAE;AAAA,YACA,eAAAD;AAAA,YACA,iBAAAE;AAAA,UAAA,CACD;AAAA,UACD,QAAQ,YAAY,QAAQ,GAAyB;AAAA,QAAA;AAAA,MACvD;AAGF,UAAI,CAACK,EAAS,IAAI;AAChB,cAAMC,IAAO,MAAMD,EAAS,OAAO,MAAM,MAAM,EAAE;AAEjD,gBAAQ;AAAA,UACN,kBAAkBA,EAAS,MAAM,IAAIA,EAAS,UAAU,KAAKC,CAAI;AAAA,QAAA;AAAA,MAErE;AAAA,IACF,SAASC,GAAO;AACd,cAAQ;AAAA,QACN,kBAAkBA,aAAiB,QAAQA,EAAM,UAAU,OAAOA,CAAK,CAAC;AAAA,MAAA;AAAA,IAE5E;AACF;"}
@@ -6,6 +6,7 @@ export declare class EntityAddCommand {
6
6
  execute(entityType?: SyncableEntity, path?: string): Promise<void>;
7
7
  private getEntityData;
8
8
  private promptAndCreateObjectCompanions;
9
+ private registerConnectionProviderServerVariables;
9
10
  private buildRecordPageFieldsViewFields;
10
11
  private getEntity;
11
12
  private handleFileExist;
@@ -7,6 +7,8 @@ export type AppDeployOptions = {
7
7
  onProgress?: (message: string) => void;
8
8
  };
9
9
  export type AppDeployResult = {
10
+ id: string;
11
+ name: string;
10
12
  universalIdentifier: string;
11
13
  };
12
14
  export declare const appDeploy: (options: AppDeployOptions) => Promise<CommandResult<AppDeployResult>>;
@@ -20,7 +20,10 @@ export { functionExecute } from './execute';
20
20
  export type { FunctionExecuteOptions } from './execute';
21
21
  export { serverStart } from './server-start';
22
22
  export type { ServerStartOptions, ServerStartResult } from './server-start';
23
+ export { serverUpgrade } from './server-upgrade';
24
+ export type { ServerUpgradeOptions, ServerUpgradeResult, } from './server-upgrade';
23
25
  export { detectLocalServer } from '../../cli/utilities/server/detect-local-server';
26
+ export { checkDockerRunning, containerExists, getContainerDigest, getImageDigest, getImageForVersion, } from '../../cli/utilities/server/docker-container';
24
27
  export { ConfigService } from '../../cli/utilities/config/config-service';
25
28
  export { APP_ERROR_CODES, AUTH_ERROR_CODES, FUNCTION_ERROR_CODES, SERVER_ERROR_CODES, } from '../../cli/types';
26
29
  export type { AuthListRemote, AuthStatusResult, CommandError, CommandResult, FunctionExecutionResult, TypecheckResult, } from '../../cli/types';
@@ -0,0 +1,12 @@
1
+ import { type CommandResult } from '../../cli/types';
2
+ export type ServerUpgradeOptions = {
3
+ version?: string;
4
+ test?: boolean;
5
+ onProgress?: (message: string) => void;
6
+ };
7
+ export type ServerUpgradeResult = {
8
+ image: string;
9
+ imageUpdated: boolean;
10
+ containerRecreated: boolean;
11
+ };
12
+ export declare const serverUpgrade: (options?: ServerUpgradeOptions | undefined) => Promise<CommandResult<ServerUpgradeResult>>;
@@ -31,6 +31,7 @@ export declare const SERVER_ERROR_CODES: {
31
31
  readonly DOCKER_NOT_RUNNING: "DOCKER_NOT_RUNNING";
32
32
  readonly CONTAINER_START_FAILED: "CONTAINER_START_FAILED";
33
33
  readonly HEALTH_TIMEOUT: "HEALTH_TIMEOUT";
34
+ readonly IMAGE_UPGRADE_FAILED: "IMAGE_UPGRADE_FAILED";
34
35
  };
35
36
  export declare const FUNCTION_ERROR_CODES: {
36
37
  readonly FETCH_FUNCTIONS_FAILED: "FETCH_FUNCTIONS_FAILED";
@@ -70,3 +71,4 @@ export type FunctionExecutionResult = {
70
71
  stackTrace: string;
71
72
  };
72
73
  };
74
+ export type ChokidarFsEvent = 'add' | 'addDir' | 'change' | 'unlink' | 'unlinkDir' | 'ready' | 'raw' | 'error' | 'all';
@@ -8,11 +8,13 @@ export declare enum TargetFunction {
8
8
  DefineRole = "defineRole",
9
9
  DefineSkill = "defineSkill",
10
10
  DefineAgent = "defineAgent",
11
+ DefineConnectionProvider = "defineConnectionProvider",
11
12
  DefineFrontComponent = "defineFrontComponent",
12
13
  DefineView = "defineView",
13
14
  DefineNavigationMenuItem = "defineNavigationMenuItem",
14
15
  DefinePageLayout = "definePageLayout",
15
- DefinePageLayoutTab = "definePageLayoutTab"
16
+ DefinePageLayoutTab = "definePageLayoutTab",
17
+ DefineCommandMenuItem = "defineCommandMenuItem"
16
18
  }
17
19
  export declare enum ManifestEntityKey {
18
20
  Application = "application",
@@ -22,12 +24,14 @@ export declare enum ManifestEntityKey {
22
24
  Roles = "roles",
23
25
  Skills = "skills",
24
26
  Agents = "agents",
27
+ ConnectionProviders = "connectionProviders",
25
28
  FrontComponents = "frontComponents",
26
29
  PublicAssets = "publicAssets",
27
30
  Views = "views",
28
31
  NavigationMenuItems = "navigationMenuItems",
29
32
  PageLayouts = "pageLayouts",
30
- PageLayoutTabs = "pageLayoutTabs"
33
+ PageLayoutTabs = "pageLayoutTabs",
34
+ CommandMenuItems = "commandMenuItems"
31
35
  }
32
36
  export type EntityFilePaths = Record<ManifestEntityKey, string[]>;
33
37
  export declare const TARGET_FUNCTION_TO_ENTITY_KEY_MAPPING: Record<TargetFunction, ManifestEntityKey>;
@@ -0,0 +1,3 @@
1
+ export declare const getCommandMenuItemBaseFile: ({ name }: {
2
+ name: string;
3
+ }) => string;
@@ -0,0 +1,4 @@
1
+ export declare const getConnectionProviderBaseFile: ({ name, universalIdentifier, }: {
2
+ name: string;
3
+ universalIdentifier?: string | undefined;
4
+ }) => string;
@@ -0,0 +1,22 @@
1
+ export type ServerVariableSpec = {
2
+ name: string;
3
+ description: string;
4
+ isSecret: boolean;
5
+ };
6
+ export type AppendResult = {
7
+ status: 'appended';
8
+ file: string;
9
+ } | {
10
+ status: 'created';
11
+ file: string;
12
+ } | {
13
+ status: 'skipped-existing';
14
+ } | {
15
+ status: 'skipped-no-config';
16
+ } | {
17
+ status: 'skipped-no-app-call';
18
+ };
19
+ export declare const appendServerVariablesToAppConfig: ({ projectRoot, variables, }: {
20
+ projectRoot: string;
21
+ variables: ServerVariableSpec[];
22
+ }) => Promise<AppendResult>;
@@ -6,4 +6,9 @@ export declare const DEFAULT_TEST_PORT = 2021;
6
6
  export declare const isContainerRunning: (containerName?: string) => boolean;
7
7
  export declare const getContainerPort: (containerName?: string) => number;
8
8
  export declare const containerExists: (containerName?: string) => boolean;
9
+ export declare const getImageForVersion: (version?: string) => string;
10
+ export declare const getContainerDigest: (containerName?: string) => string | null;
11
+ export declare const getImageDigest: (image: string) => string | null;
12
+ export declare const getContainerEnvVar: (envVar: string, containerName?: string) => string | null;
9
13
  export declare const checkDockerRunning: () => boolean;
14
+ export declare const getDockerNotRunningMessage: (retryCommand: string) => string;