twenty-sdk 2.35.1 → 2.38.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/dist/billing/index.cjs +3 -3
  2. package/dist/billing/index.cjs.map +1 -1
  3. package/dist/billing/index.d.ts +25 -4
  4. package/dist/billing/index.mjs +495 -464
  5. package/dist/billing/index.mjs.map +1 -1
  6. package/dist/catalog-sync-DB_oIbry.js +1 -0
  7. package/dist/{catalog-sync-C82Xfr2f.mjs → catalog-sync-TFrxc_Y6.mjs} +4 -4
  8. package/dist/cli/commands/dev/dev-once.d.ts +1 -0
  9. package/dist/cli/commands/dev/dev.d.ts +1 -0
  10. package/dist/cli/operations/dev-once.d.ts +1 -0
  11. package/dist/cli/utilities/api/api-service.d.ts +3 -0
  12. package/dist/cli/utilities/api/application-api.d.ts +1 -0
  13. package/dist/cli/utilities/api/file-api.d.ts +41 -0
  14. package/dist/cli/utilities/dev/orchestrator/dev-mode-orchestrator.d.ts +1 -0
  15. package/dist/cli/utilities/dev/orchestrator/steps/format-sync-actions-plan.d.ts +8 -1
  16. package/dist/cli/utilities/dev/orchestrator/steps/sync-application-orchestrator-step.d.ts +3 -1
  17. package/dist/cli/utilities/dev/orchestrator/steps/upload-files-orchestrator-step.d.ts +1 -0
  18. package/dist/cli/utilities/entity/entity-view-template.d.ts +1 -1
  19. package/dist/cli/utilities/error/parse-server-error.d.ts +1 -0
  20. package/dist/cli/utilities/file/file-uploader.d.ts +13 -4
  21. package/dist/cli/utilities/file/put-file-to-upload-url.d.ts +5 -0
  22. package/dist/cli.cjs +30 -30
  23. package/dist/cli.mjs +5455 -5421
  24. package/dist/define/index.cjs +14 -14
  25. package/dist/define/index.cjs.map +1 -1
  26. package/dist/define/index.d.ts +340 -26
  27. package/dist/define/index.mjs +6104 -5955
  28. package/dist/define/index.mjs.map +1 -1
  29. package/dist/front-component/index.cjs +1 -1
  30. package/dist/front-component/index.cjs.map +1 -1
  31. package/dist/front-component/index.d.ts +23 -6
  32. package/dist/front-component/index.mjs +2 -2
  33. package/dist/front-component/index.mjs.map +1 -1
  34. package/dist/front-component-renderer/build.cjs +1 -1
  35. package/dist/front-component-renderer/build.mjs +1 -1
  36. package/dist/{get-front-component-build-plugins-D9VJQHw7.mjs → get-front-component-build-plugins-Bed7hCGi.mjs} +105 -91
  37. package/dist/{get-front-component-build-plugins-CcV3Cown.js → get-front-component-build-plugins-o8cM1FFZ.js} +8 -8
  38. package/dist/{get-function-input-schema-GNk3NRLJ-Byssjp8I.js → get-function-input-schema-GNk3NRLJ-A3CmF1qq.js} +1 -1
  39. package/dist/{get-function-input-schema-GNk3NRLJ-Dm0Ljlg4.mjs → get-function-input-schema-GNk3NRLJ-BPeB4a-_.mjs} +1 -1
  40. package/dist/logic-function/index.cjs +6 -4
  41. package/dist/logic-function/index.cjs.map +1 -1
  42. package/dist/logic-function/index.d.ts +24 -3
  43. package/dist/logic-function/index.mjs +28 -14
  44. package/dist/logic-function/index.mjs.map +1 -1
  45. package/dist/{login-cG7hCrTK.js → login-2yrPIORt.js} +89 -66
  46. package/dist/{login-BsiMC4oB.mjs → login-QYv7vAbh.mjs} +5011 -4705
  47. package/dist/operations.cjs +1 -1
  48. package/dist/operations.mjs +4 -4
  49. package/dist/utils/index.cjs.map +1 -1
  50. package/dist/utils/index.mjs.map +1 -1
  51. package/package.json +2 -2
  52. package/dist/catalog-sync-Bs-X2ChV.js +0 -1
@@ -1,10 +1,31 @@
1
+ declare const USAGE_OPERATION_TYPES: readonly ["AI_CHAT_TOKEN", "AI_WORKFLOW_TOKEN", "WORKFLOW_EXECUTION", "CODE_EXECUTION", "WEB_SEARCH", "CALL_RECORDING", "EMAIL_SEND"];
2
+ type UsageOperationTypeValue = (typeof USAGE_OPERATION_TYPES)[number];
3
+
4
+ declare const CREDIT_UNAVAILABLE_REASONS: readonly ["workspace-suspended", "no-subscription", "no-credits"];
5
+ type CreditUnavailableReason = (typeof CREDIT_UNAVAILABLE_REASONS)[number];
6
+ type CreditAvailability = {
7
+ hasAvailableCredits: true;
8
+ } | {
9
+ hasAvailableCredits: false;
10
+ reason: CreditUnavailableReason;
11
+ };
12
+
1
13
  type ChargeCreditsParams = {
2
14
  creditsUsedMicro: number;
3
- operationType: string;
4
15
  quantity?: number;
16
+ userWorkspaceId?: string;
17
+ } & ({
18
+ operation: string;
19
+ operationType?: never;
20
+ resourceContext?: never;
21
+ } | {
22
+ operationType: UsageOperationTypeValue;
23
+ operation?: never;
5
24
  resourceContext?: string;
6
- };
7
- declare const chargeCredits: ({ creditsUsedMicro, operationType, quantity, resourceContext, }: ChargeCreditsParams) => Promise<void>;
25
+ });
26
+ declare const chargeCredits: ({ creditsUsedMicro, quantity, operation, operationType, resourceContext, userWorkspaceId, }: ChargeCreditsParams) => Promise<void>;
27
+
28
+ declare const getCreditAvailability: () => Promise<CreditAvailability>;
8
29
 
9
- export { chargeCredits };
30
+ export { chargeCredits, getCreditAvailability };
10
31
  export type { ChargeCreditsParams };