twenty-sdk 0.6.0 → 0.6.2

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 (70) hide show
  1. package/README.md +6 -2
  2. package/dist/{HtmlTagToRemoteComponent-DzQ2I9Lz.js → HtmlTagToRemoteComponent-CgtwxDeH.js} +11 -11
  3. package/dist/{HtmlTagToRemoteComponent-DBOkvIRB.mjs → HtmlTagToRemoteComponent-D_EW5OLu.mjs} +1743 -1640
  4. package/dist/cli/utilities/api/api-service.d.ts +4 -0
  5. package/dist/cli/utilities/build/common/esbuild-watcher.d.ts +5 -2
  6. package/dist/cli/utilities/build/common/typecheck-plugin.d.ts +1 -1
  7. package/dist/cli/utilities/build/manifest/manifest-extract-config.d.ts +2 -0
  8. package/dist/cli/utilities/client/client-service.d.ts +5 -1
  9. package/dist/cli/utilities/client/twenty-client-template.d.ts +42 -0
  10. package/dist/cli/utilities/dev/orchestrator/dev-mode-orchestrator.d.ts +2 -0
  11. package/dist/cli/utilities/dev/orchestrator/steps/start-watchers-orchestrator-step.d.ts +2 -0
  12. package/dist/cli.cjs +430 -75
  13. package/dist/cli.mjs +3175 -2725
  14. package/dist/front-component-renderer/index.cjs +11 -11
  15. package/dist/front-component-renderer/index.d.ts +3 -3
  16. package/dist/front-component-renderer/index.mjs +2186 -1906
  17. package/dist/front-component-renderer/remote/generated/remote-components.d.ts +44 -0
  18. package/dist/front-component-renderer/remote/generated/remote-elements.d.ts +93 -0
  19. package/dist/front-component-renderer/types/FrontComponentHostCommunicationApi.d.ts +2 -1
  20. package/dist/{get-function-input-schema-BZ7_XyUh-GxSybvDe.js → get-function-input-schema-BZ7_XyUh-CCSi0u_q.js} +1 -1
  21. package/dist/{get-function-input-schema-BZ7_XyUh-By3UDh4s.mjs → get-function-input-schema-BZ7_XyUh-DAPandzB.mjs} +1 -1
  22. package/dist/index.cjs +2 -2
  23. package/dist/index.mjs +122 -89
  24. package/dist/sdk/application/application-config.d.ts +1 -1
  25. package/dist/sdk/front-component-api/constants/AllowedHtmlElements.d.ts +1 -0
  26. package/dist/sdk/front-component-api/constants/AllowedHtmlElements.js +104 -1
  27. package/dist/sdk/front-component-api/constants/AllowedHtmlElements.js.map +1 -1
  28. package/dist/sdk/front-component-api/constants/EventToReact.js +22 -3
  29. package/dist/sdk/front-component-api/constants/EventToReact.js.map +1 -1
  30. package/dist/sdk/front-component-api/constants/SerializedEventData.d.ts +7 -0
  31. package/dist/sdk/front-component-api/globals/frontComponentHostCommunicationApi.d.ts +2 -0
  32. package/dist/sdk/front-component-api/globals/frontComponentHostCommunicationApi.js.map +1 -1
  33. package/dist/sdk/index.d.ts +3 -0
  34. package/dist/sdk/index.js +70 -66
  35. package/dist/sdk/index.js.map +1 -1
  36. package/dist/sdk/logic-functions/define-post-install-logic-function.d.ts +6 -0
  37. package/dist/sdk/logic-functions/define-post-install-logic-function.js +12 -0
  38. package/dist/sdk/logic-functions/define-post-install-logic-function.js.map +1 -0
  39. package/dist/sdk/logic-functions/define-pre-install-logic-function.d.ts +6 -0
  40. package/dist/sdk/logic-functions/define-pre-install-logic-function.js +12 -0
  41. package/dist/sdk/logic-functions/define-pre-install-logic-function.js.map +1 -0
  42. package/dist/sdk/logic-functions/install-logic-function-payload-type.d.ts +4 -0
  43. package/generated/core/index.ts +406 -0
  44. package/generated/core/runtime/batcher.ts +265 -0
  45. package/generated/core/runtime/createClient.ts +68 -0
  46. package/generated/core/runtime/error.ts +29 -0
  47. package/generated/core/runtime/fetcher.ts +98 -0
  48. package/generated/core/runtime/generateGraphqlOperation.ts +225 -0
  49. package/generated/core/runtime/index.ts +13 -0
  50. package/generated/core/runtime/linkTypeMap.ts +139 -0
  51. package/generated/core/runtime/typeSelection.ts +98 -0
  52. package/generated/core/runtime/types.ts +69 -0
  53. package/generated/core/schema.graphql +36745 -0
  54. package/generated/core/schema.ts +39341 -0
  55. package/generated/core/types.ts +45860 -0
  56. package/generated/index.ts +2 -0
  57. package/generated/metadata/index.ts +469 -0
  58. package/generated/metadata/runtime/batcher.ts +265 -0
  59. package/generated/metadata/runtime/createClient.ts +68 -0
  60. package/generated/metadata/runtime/error.ts +29 -0
  61. package/generated/metadata/runtime/fetcher.ts +98 -0
  62. package/generated/metadata/runtime/generateGraphqlOperation.ts +225 -0
  63. package/generated/metadata/runtime/index.ts +13 -0
  64. package/generated/metadata/runtime/linkTypeMap.ts +139 -0
  65. package/generated/metadata/runtime/typeSelection.ts +98 -0
  66. package/generated/metadata/runtime/types.ts +69 -0
  67. package/generated/metadata/schema.graphql +3971 -0
  68. package/generated/metadata/schema.ts +8357 -0
  69. package/generated/metadata/types.ts +10044 -0
  70. package/package.json +17 -1
@@ -44,6 +44,10 @@ export declare class ApiService {
44
44
  getSchema(options?: {
45
45
  authToken?: string;
46
46
  }): Promise<ApiResponse<string>>;
47
+ getMetadataSchema(options?: {
48
+ authToken?: string;
49
+ }): Promise<ApiResponse<string>>;
50
+ private introspectEndpoint;
47
51
  findLogicFunctions(): Promise<ApiResponse<Array<{
48
52
  id: string;
49
53
  name: string;
@@ -33,5 +33,8 @@ export declare class EsbuildWatcher implements RestartableWatcher {
33
33
  restart(sourcePaths: string[]): Promise<void>;
34
34
  private createContext;
35
35
  }
36
- export declare const createLogicFunctionsWatcher: (options: RestartableWatcherOptions) => EsbuildWatcher;
37
- export declare const createFrontComponentsWatcher: (options: RestartableWatcherOptions) => EsbuildWatcher;
36
+ export type EsbuildWatcherFactoryOptions = RestartableWatcherOptions & {
37
+ shouldSkipTypecheck: () => boolean;
38
+ };
39
+ export declare const createLogicFunctionsWatcher: (options: EsbuildWatcherFactoryOptions) => EsbuildWatcher;
40
+ export declare const createFrontComponentsWatcher: (options: EsbuildWatcherFactoryOptions) => EsbuildWatcher;
@@ -7,4 +7,4 @@ export type TypecheckError = {
7
7
  };
8
8
  export declare const parseTscOutputLine: (line: string) => TypecheckError | null;
9
9
  export declare const runTypecheck: (appPath: string) => Promise<TypecheckError[]>;
10
- export declare const createTypecheckPlugin: (appPath: string) => esbuild.Plugin;
10
+ export declare const createTypecheckPlugin: (appPath: string, shouldSkipTypecheck: () => boolean) => esbuild.Plugin;
@@ -2,6 +2,8 @@ export declare enum TargetFunction {
2
2
  DefineApplication = "defineApplication",
3
3
  DefineField = "defineField",
4
4
  DefineLogicFunction = "defineLogicFunction",
5
+ DefinePreInstallLogicFunction = "definePreInstallLogicFunction",
6
+ DefinePostInstallLogicFunction = "definePostInstallLogicFunction",
5
7
  DefineObject = "defineObject",
6
8
  DefineRole = "defineRole",
7
9
  DefineSkill = "defineSkill",
@@ -5,6 +5,10 @@ export declare class ClientService {
5
5
  appPath: string;
6
6
  authToken?: string;
7
7
  }): Promise<void>;
8
+ ensureGeneratedClientStub({ appPath }: {
9
+ appPath: string;
10
+ }): Promise<void>;
8
11
  private resolveGeneratedPath;
9
- private injectTwentyClient;
12
+ private writeBarrelIndex;
13
+ private injectClientWrapper;
10
14
  }
@@ -0,0 +1,42 @@
1
+ type QueryGenqlSelection = Record<string, unknown>;
2
+ type MutationGenqlSelection = Record<string, unknown>;
3
+ type GraphqlOperation = Record<string, unknown>;
4
+ type ClientOptions = {
5
+ url?: string;
6
+ headers?: HeadersInit | (() => HeadersInit | Promise<HeadersInit>);
7
+ fetcher?: (operation: GraphqlOperation | GraphqlOperation[]) => Promise<unknown>;
8
+ fetch?: typeof globalThis.fetch;
9
+ batch?: unknown;
10
+ };
11
+ type TwentyGeneratedClientOptions = ClientOptions;
12
+ export declare class TwentyGeneratedClient {
13
+ private client;
14
+ private url;
15
+ private requestOptions;
16
+ private headers;
17
+ private fetchImplementation;
18
+ private authorizationToken;
19
+ private refreshAccessTokenPromise;
20
+ constructor(options?: TwentyGeneratedClientOptions);
21
+ query<R extends QueryGenqlSelection>(request: R & {
22
+ __name?: string;
23
+ }): Promise<unknown>;
24
+ mutation<R extends MutationGenqlSelection>(request: R & {
25
+ __name?: string;
26
+ }): Promise<unknown>;
27
+ uploadFile(fileBuffer: Buffer, filename: string, contentType: string | undefined, fieldMetadataUniversalIdentifier: string): Promise<{
28
+ id: string;
29
+ path: string;
30
+ size: number;
31
+ createdAt: string;
32
+ url: string;
33
+ }>;
34
+ private executeGraphqlRequestWithOptionalRefresh;
35
+ private executeGraphqlRequest;
36
+ private resolveHeaders;
37
+ private shouldRefreshToken;
38
+ private assertResponseIsSuccessful;
39
+ private requestRefreshedAccessToken;
40
+ private setAuthorizationToken;
41
+ }
42
+ export {};
@@ -8,6 +8,8 @@ export declare class DevModeOrchestrator {
8
8
  private debounceMs;
9
9
  private syncTimer;
10
10
  private serverCheckInterval;
11
+ private clientService;
12
+ private skipTypecheck;
11
13
  private checkServerStep;
12
14
  private ensureValidTokensStep;
13
15
  private buildManifestStep;
@@ -15,6 +15,7 @@ export declare class StartWatchersOrchestratorStep {
15
15
  private scheduleSync;
16
16
  private notify;
17
17
  private onFileBuilt;
18
+ private shouldSkipTypecheck;
18
19
  private manifestWatcher;
19
20
  private logicFunctionsWatcher;
20
21
  private frontComponentsWatcher;
@@ -26,6 +27,7 @@ export declare class StartWatchersOrchestratorStep {
26
27
  scheduleSync: () => void;
27
28
  notify: () => void;
28
29
  onFileBuilt: (event: FileBuiltEvent) => void;
30
+ shouldSkipTypecheck: () => boolean;
29
31
  });
30
32
  start(): Promise<void>;
31
33
  handleWatcherRestarts(result: ManifestBuildResult): Promise<void>;