twenty-client-sdk 2.30.0 → 2.31.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/application-BaeFV5yH.js +20 -0
- package/dist/application-Ce5JfsBq.mjs +2490 -0
- package/dist/generate.cjs +3 -3
- package/dist/generate.mjs +1 -1
- package/dist/metadata/generated/schema.d.ts +26 -3
- package/dist/metadata/generated/types.d.ts +12 -0
- package/dist/metadata.cjs +1 -1
- package/dist/metadata.mjs +13 -2
- package/dist/rest.cjs +1 -1
- package/dist/rest.mjs +3 -3
- package/package.json +1 -1
- package/dist/application-CoyGBdkd.js +0 -1
- package/dist/application-Diu8pW7j.mjs +0 -101
package/dist/generate.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./chunk-DWNI8pZO.js"),t=require("./application-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./chunk-DWNI8pZO.js"),t=require("./application-BaeFV5yH.js");let n=require("node:fs/promises"),r=require("node:path"),i=require("esbuild"),a=require("graphql"),o=require("lodash/camelCase.js");o=e.n(o);let s=require("node:fs"),c=require("node:os"),l=require("prettier/standalone");l=e.n(l);let u=require("prettier/plugins/graphql");u=e.n(u);let d=require("prettier/plugins/typescript");d=e.n(d);let f=require("prettier/plugins/estree");f=e.n(f);let p=require("lodash/uniq.js");p=e.n(p);let ee=require("node:url");var te=`// __STRIPPED_DURING_INJECTION_START__`,ne=`// __STRIPPED_DURING_INJECTION_END__`,m=`// __UPLOAD_FILE_START__`,h=`// __UPLOAD_FILE_END__`,g=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),_=(e,t)=>{let n=e;return n=n.replace(RegExp(`${g(te)}[\\s\\S]*?${g(ne)}\\n?`),``),n=n.replace(`'__TWENTY_DEFAULT_URL__'`,t.defaultUrl),n=n.replace(/TwentyGeneratedClient/g,t.apiClientName),t.includeUploadFile?(n=n.replace(RegExp(`\\s*${g(m)}\\n`),`
|
|
2
2
|
`),n=n.replace(RegExp(`\\s*${g(h)}\\n`),`
|
|
3
3
|
`)):n=n.replace(RegExp(`\\s*${g(m)}[\\s\\S]*?${g(h)}\\n?`),`
|
|
4
4
|
`),`\n// ${t.apiClientName} (auto-injected by twenty-client-sdk)\n${n}`},v=e=>(0,n.mkdir)(e,{recursive:!0}),y=async e=>{let t;try{t=await(0,n.readdir)(e)}catch(t){if(t instanceof Error&&`code`in t&&t.code===`ENOENT`){await(0,n.mkdir)(e,{recursive:!0});return}throw t}await Promise.all(t.map(t=>(0,n.rm)((0,r.join)(e,t),{recursive:!0,force:!0})))},b=async(e,t)=>{try{await(0,n.rename)(e,t)}catch(r){if(r instanceof Error&&`code`in r&&r.code===`EXDEV`)await(0,n.cp)(e,t,{recursive:!0}),await(0,n.rm)(e,{recursive:!0,force:!0});else throw r}},x=e=>(0,n.rm)(e,{recursive:!0,force:!0}),re=e=>{let{root:t}=(0,r.parse)(e),n=e.slice(t.length).split(/[\\/]/).filter(Boolean).length,i=(0,r.resolve)((0,c.homedir)()),a=e===i||i.startsWith(`${e}/`);if(e===t||n<2||a)throw Error(`Refusing to recursively clear unsafe path: ${e}`)},S=async(e,t=!1)=>{let n=(0,r.resolve)(...e);t&&(re(n),await s.promises.rm(n,{recursive:!0,force:!0})),await s.promises.mkdir(n,{recursive:!0})},C=async(e,t)=>{let n=(0,r.resolve)(...e,`..`);await s.promises.mkdir(n,{recursive:!0}),await s.promises.writeFile((0,r.resolve)(...e),t)},w=`./runtime`,T=e=>e?`${e.name}GenqlSelection`:``,ie=e=>{let t=e.config?.endpoint?`"${e.config.endpoint}"`:`undefined`,n=e.config?.fetchImport;return`
|
|
@@ -1525,7 +1525,7 @@ export class TwentyGeneratedClient {
|
|
|
1525
1525
|
processEnvironment[APP_ACCESS_TOKEN_ENV_KEY] = token;
|
|
1526
1526
|
}
|
|
1527
1527
|
}
|
|
1528
|
-
`,s=`${i}.tmp`;await v(s),await y(s);try{await Z({schema:e,output:s,scalarTypes:Le});let a=_(o,{apiClientName:`CoreApiClient`,defaultUrl:`\`\${process.env.${t.
|
|
1528
|
+
`,s=`${i}.tmp`;await v(s),await y(s);try{await Z({schema:e,output:s,scalarTypes:Le});let a=_(o,{apiClientName:`CoreApiClient`,defaultUrl:`\`\${process.env.${t.r}}/graphql\``,includeUploadFile:!0});await(0,n.appendFile)((0,r.join)(s,`index.ts`),a),await x(i),await b(s,i),await ze(i)}catch(e){throw await x(s),e}},Re=async({packageRoot:e,schema:t})=>{let i=(0,r.join)(e,`dist`,Q);await $({schema:t,outputPath:i}),await(0,n.copyFile)((0,r.join)(i,`index.mjs`),(0,r.join)(e,`dist`,`core.mjs`)),await(0,n.copyFile)((0,r.join)(i,`index.cjs`),(0,r.join)(e,`dist`,`core.cjs`))},ze=async e=>{let t=(0,r.join)(e,`index.ts`),a=(0,r.join)(e,`index.mjs`);await(0,i.build)({entryPoints:[t],outfile:a,bundle:!0,format:`esm`,platform:`node`,target:`node18`,sourcemap:!1,minify:!1}),await(0,i.build)({entryPoints:[t],outfile:(0,r.join)(e,`index.cjs`),bundle:!0,format:`cjs`,platform:`node`,target:`node18`,sourcemap:!1,minify:!1}),await(0,n.writeFile)((0,r.join)(e,`package.json`),JSON.stringify({type:`module`,main:`index.mjs`,module:`index.mjs`},null,2))},Be={DateTime:`string`,JSON:`Record<string, unknown>`,UUID:`string`},Ve=async({schema:e,outputPath:i,clientWrapperTemplateSource:a})=>{let o=a??`// Ambient type stubs for the genql-generated code this template gets
|
|
1529
1529
|
// injected into. They enable full typecheck/lint on this file.
|
|
1530
1530
|
// __STRIPPED_DURING_INJECTION_START__
|
|
1531
1531
|
type QueryGenqlSelection = Record<string, unknown>;
|
|
@@ -1959,4 +1959,4 @@ export class TwentyGeneratedClient {
|
|
|
1959
1959
|
processEnvironment[APP_ACCESS_TOKEN_ENV_KEY] = token;
|
|
1960
1960
|
}
|
|
1961
1961
|
}
|
|
1962
|
-
`;await v(i),await y(i),await Z({schema:e,output:i,scalarTypes:{...Be,Upload:`File`}});let s=_(o,{apiClientName:`MetadataApiClient`,defaultUrl:`\`\${process.env.${t.
|
|
1962
|
+
`;await v(i),await y(i),await Z({schema:e,output:i,scalarTypes:{...Be,Upload:`File`}});let s=_(o,{apiClientName:`MetadataApiClient`,defaultUrl:`\`\${process.env.${t.r}}/metadata\``,includeUploadFile:!0});await(0,n.appendFile)((0,r.join)(i,`index.ts`),s)};exports.GENERATED_CORE_DIR=Q,exports.generateCoreClientFromSchema=$,exports.generateMetadataClient=Ve,exports.replaceCoreClient=Re;
|
package/dist/generate.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as e } from "./application-Ce5JfsBq.mjs";
|
|
2
2
|
import { appendFile as t, copyFile as n, cp as r, mkdir as i, readdir as a, rename as o, rm as s, writeFile as c } from "node:fs/promises";
|
|
3
3
|
import { dirname as l, join as u, parse as ee, relative as d, resolve as f } from "node:path";
|
|
4
4
|
import { build as p } from "esbuild";
|
|
@@ -359,6 +359,9 @@ export interface UserWorkspace {
|
|
|
359
359
|
export type PermissionFlagType = 'API_KEYS_AND_WEBHOOKS' | 'WORKSPACE' | 'WORKSPACE_MEMBERS' | 'ROLES' | 'DATA_MODEL' | 'SECURITY' | 'WORKFLOWS' | 'IMPERSONATE' | 'SSO_BYPASS' | 'APPLICATIONS' | 'MARKETPLACE_APPS' | 'LAYOUTS' | 'BILLING' | 'AI_SETTINGS' | 'AI' | 'VIEWS' | 'UPLOAD_FILE' | 'DOWNLOAD_FILE' | 'SEND_EMAIL_TOOL' | 'CREATE_CALENDAR_EVENT_TOOL' | 'HTTP_REQUEST_TOOL' | 'CODE_INTERPRETER_TOOL' | 'IMPORT_CSV' | 'EXPORT_CSV' | 'CONNECTED_ACCOUNTS' | 'PROFILE_INFORMATION';
|
|
360
360
|
export interface ViewField {
|
|
361
361
|
id: Scalars['UUID'];
|
|
362
|
+
universalIdentifier: Scalars['UUID'];
|
|
363
|
+
applicationId: Scalars['UUID'];
|
|
364
|
+
isSystemSideEffect: Scalars['Boolean'];
|
|
362
365
|
fieldMetadataId: Scalars['UUID'];
|
|
363
366
|
isVisible: Scalars['Boolean'];
|
|
364
367
|
size: Scalars['Float'];
|
|
@@ -449,6 +452,9 @@ export interface ViewFieldGroup {
|
|
|
449
452
|
}
|
|
450
453
|
export interface View {
|
|
451
454
|
id: Scalars['UUID'];
|
|
455
|
+
universalIdentifier: Scalars['UUID'];
|
|
456
|
+
applicationId: Scalars['UUID'];
|
|
457
|
+
isSystemSideEffect: Scalars['Boolean'];
|
|
452
458
|
name: Scalars['String'];
|
|
453
459
|
objectMetadataId: Scalars['UUID'];
|
|
454
460
|
type: ViewType;
|
|
@@ -622,6 +628,8 @@ export interface GridPosition {
|
|
|
622
628
|
}
|
|
623
629
|
export interface PageLayoutWidget {
|
|
624
630
|
id: Scalars['UUID'];
|
|
631
|
+
universalIdentifier: Scalars['UUID'];
|
|
632
|
+
isSystemSideEffect: Scalars['Boolean'];
|
|
625
633
|
applicationId: Scalars['UUID'];
|
|
626
634
|
pageLayoutTabId: Scalars['UUID'];
|
|
627
635
|
title: Scalars['String'];
|
|
@@ -884,6 +892,8 @@ export interface WorkflowVersionConfiguration {
|
|
|
884
892
|
}
|
|
885
893
|
export interface PageLayoutTab {
|
|
886
894
|
id: Scalars['UUID'];
|
|
895
|
+
universalIdentifier: Scalars['UUID'];
|
|
896
|
+
isSystemSideEffect: Scalars['Boolean'];
|
|
887
897
|
applicationId: Scalars['UUID'];
|
|
888
898
|
title: Scalars['String'];
|
|
889
899
|
position: Scalars['Float'];
|
|
@@ -907,6 +917,8 @@ export interface PageLayout {
|
|
|
907
917
|
tabs?: PageLayoutTab[];
|
|
908
918
|
defaultTabToFocusOnMobileAndSidePanelId?: Scalars['UUID'];
|
|
909
919
|
universalIdentifier: Scalars['UUID'];
|
|
920
|
+
applicationId: Scalars['UUID'];
|
|
921
|
+
isSystemSideEffect: Scalars['Boolean'];
|
|
910
922
|
createdAt: Scalars['DateTime'];
|
|
911
923
|
updatedAt: Scalars['DateTime'];
|
|
912
924
|
deletedAt?: Scalars['DateTime'];
|
|
@@ -1227,7 +1239,7 @@ export interface FeatureFlag {
|
|
|
1227
1239
|
value: Scalars['Boolean'];
|
|
1228
1240
|
__typename: 'FeatureFlag';
|
|
1229
1241
|
}
|
|
1230
|
-
export type FeatureFlagKey = '
|
|
1242
|
+
export type FeatureFlagKey = 'IS_APP_CLAIMING_ENABLED' | 'IS_UNIQUE_INDEXES_ENABLED' | 'IS_JSON_FILTER_ENABLED' | 'IS_CALENDAR_WEEK_VIEW_ENABLED' | 'IS_EMAIL_GROUP_ENABLED' | 'IS_JUNCTION_RELATIONS_ENABLED' | 'IS_LIST_VIEW_ENABLED' | 'IS_REST_METADATA_API_NEW_FORMAT_DIRECT' | 'IS_LOGIC_FUNCTION_PREBUILT_MODE_ENABLED' | 'IS_SETTINGS_DISCOVERY_HERO_ENABLED' | 'IS_WORKFLOW_VERSION_IN_CORE_ENABLED' | 'IS_WORKFLOW_DISPATCH_FROM_CORE_ENABLED' | 'IS_NATIVE_CALL_RECORDING_TABS_ENABLED';
|
|
1231
1243
|
export interface WorkspaceUrls {
|
|
1232
1244
|
customUrl?: Scalars['String'];
|
|
1233
1245
|
subdomainUrl: Scalars['String'];
|
|
@@ -3280,6 +3292,9 @@ export interface UserWorkspaceGenqlSelection {
|
|
|
3280
3292
|
}
|
|
3281
3293
|
export interface ViewFieldGenqlSelection {
|
|
3282
3294
|
id?: boolean | number;
|
|
3295
|
+
universalIdentifier?: boolean | number;
|
|
3296
|
+
applicationId?: boolean | number;
|
|
3297
|
+
isSystemSideEffect?: boolean | number;
|
|
3283
3298
|
fieldMetadataId?: boolean | number;
|
|
3284
3299
|
isVisible?: boolean | number;
|
|
3285
3300
|
size?: boolean | number;
|
|
@@ -3372,6 +3387,9 @@ export interface ViewFieldGroupGenqlSelection {
|
|
|
3372
3387
|
}
|
|
3373
3388
|
export interface ViewGenqlSelection {
|
|
3374
3389
|
id?: boolean | number;
|
|
3390
|
+
universalIdentifier?: boolean | number;
|
|
3391
|
+
applicationId?: boolean | number;
|
|
3392
|
+
isSystemSideEffect?: boolean | number;
|
|
3375
3393
|
name?: boolean | number;
|
|
3376
3394
|
objectMetadataId?: boolean | number;
|
|
3377
3395
|
type?: boolean | number;
|
|
@@ -3544,6 +3562,8 @@ export interface GridPositionGenqlSelection {
|
|
|
3544
3562
|
}
|
|
3545
3563
|
export interface PageLayoutWidgetGenqlSelection {
|
|
3546
3564
|
id?: boolean | number;
|
|
3565
|
+
universalIdentifier?: boolean | number;
|
|
3566
|
+
isSystemSideEffect?: boolean | number;
|
|
3547
3567
|
applicationId?: boolean | number;
|
|
3548
3568
|
pageLayoutTabId?: boolean | number;
|
|
3549
3569
|
title?: boolean | number;
|
|
@@ -3848,6 +3868,8 @@ export interface WorkflowVersionConfigurationGenqlSelection {
|
|
|
3848
3868
|
}
|
|
3849
3869
|
export interface PageLayoutTabGenqlSelection {
|
|
3850
3870
|
id?: boolean | number;
|
|
3871
|
+
universalIdentifier?: boolean | number;
|
|
3872
|
+
isSystemSideEffect?: boolean | number;
|
|
3851
3873
|
applicationId?: boolean | number;
|
|
3852
3874
|
title?: boolean | number;
|
|
3853
3875
|
position?: boolean | number;
|
|
@@ -3872,6 +3894,8 @@ export interface PageLayoutGenqlSelection {
|
|
|
3872
3894
|
tabs?: PageLayoutTabGenqlSelection;
|
|
3873
3895
|
defaultTabToFocusOnMobileAndSidePanelId?: boolean | number;
|
|
3874
3896
|
universalIdentifier?: boolean | number;
|
|
3897
|
+
applicationId?: boolean | number;
|
|
3898
|
+
isSystemSideEffect?: boolean | number;
|
|
3875
3899
|
createdAt?: boolean | number;
|
|
3876
3900
|
updatedAt?: boolean | number;
|
|
3877
3901
|
deletedAt?: boolean | number;
|
|
@@ -9627,7 +9651,6 @@ export declare const enumDatabaseEventAction: {
|
|
|
9627
9651
|
UPSERTED: "UPSERTED";
|
|
9628
9652
|
};
|
|
9629
9653
|
export declare const enumFeatureFlagKey: {
|
|
9630
|
-
IS_AI_CHAT_PAGE_ENABLED: "IS_AI_CHAT_PAGE_ENABLED";
|
|
9631
9654
|
IS_APP_CLAIMING_ENABLED: "IS_APP_CLAIMING_ENABLED";
|
|
9632
9655
|
IS_UNIQUE_INDEXES_ENABLED: "IS_UNIQUE_INDEXES_ENABLED";
|
|
9633
9656
|
IS_JSON_FILTER_ENABLED: "IS_JSON_FILTER_ENABLED";
|
|
@@ -9640,7 +9663,7 @@ export declare const enumFeatureFlagKey: {
|
|
|
9640
9663
|
IS_SETTINGS_DISCOVERY_HERO_ENABLED: "IS_SETTINGS_DISCOVERY_HERO_ENABLED";
|
|
9641
9664
|
IS_WORKFLOW_VERSION_IN_CORE_ENABLED: "IS_WORKFLOW_VERSION_IN_CORE_ENABLED";
|
|
9642
9665
|
IS_WORKFLOW_DISPATCH_FROM_CORE_ENABLED: "IS_WORKFLOW_DISPATCH_FROM_CORE_ENABLED";
|
|
9643
|
-
|
|
9666
|
+
IS_NATIVE_CALL_RECORDING_TABS_ENABLED: "IS_NATIVE_CALL_RECORDING_TABS_ENABLED";
|
|
9644
9667
|
};
|
|
9645
9668
|
export declare const enumIdentityProviderType: {
|
|
9646
9669
|
OIDC: "OIDC";
|
|
@@ -414,6 +414,9 @@ declare const _default: {
|
|
|
414
414
|
PermissionFlagType: {};
|
|
415
415
|
ViewField: {
|
|
416
416
|
id: number[];
|
|
417
|
+
universalIdentifier: number[];
|
|
418
|
+
applicationId: number[];
|
|
419
|
+
isSystemSideEffect: number[];
|
|
417
420
|
fieldMetadataId: number[];
|
|
418
421
|
isVisible: number[];
|
|
419
422
|
size: number[];
|
|
@@ -502,6 +505,9 @@ declare const _default: {
|
|
|
502
505
|
};
|
|
503
506
|
View: {
|
|
504
507
|
id: number[];
|
|
508
|
+
universalIdentifier: number[];
|
|
509
|
+
applicationId: number[];
|
|
510
|
+
isSystemSideEffect: number[];
|
|
505
511
|
name: number[];
|
|
506
512
|
objectMetadataId: number[];
|
|
507
513
|
type: number[];
|
|
@@ -673,6 +679,8 @@ declare const _default: {
|
|
|
673
679
|
};
|
|
674
680
|
PageLayoutWidget: {
|
|
675
681
|
id: number[];
|
|
682
|
+
universalIdentifier: number[];
|
|
683
|
+
isSystemSideEffect: number[];
|
|
676
684
|
applicationId: number[];
|
|
677
685
|
pageLayoutTabId: number[];
|
|
678
686
|
title: number[];
|
|
@@ -955,6 +963,8 @@ declare const _default: {
|
|
|
955
963
|
};
|
|
956
964
|
PageLayoutTab: {
|
|
957
965
|
id: number[];
|
|
966
|
+
universalIdentifier: number[];
|
|
967
|
+
isSystemSideEffect: number[];
|
|
958
968
|
applicationId: number[];
|
|
959
969
|
title: number[];
|
|
960
970
|
position: number[];
|
|
@@ -977,6 +987,8 @@ declare const _default: {
|
|
|
977
987
|
tabs: number[];
|
|
978
988
|
defaultTabToFocusOnMobileAndSidePanelId: number[];
|
|
979
989
|
universalIdentifier: number[];
|
|
990
|
+
applicationId: number[];
|
|
991
|
+
isSystemSideEffect: number[];
|
|
980
992
|
createdAt: number[];
|
|
981
993
|
updatedAt: number[];
|
|
982
994
|
deletedAt: number[];
|