@intlayer/cli 7.0.3-canary.1 → 7.0.3

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.
@@ -22,14 +22,18 @@ const checkCMSAuth = async (configuration) => {
22
22
  };
23
23
  const checkAIAccess = async (configuration, aiOptions) => {
24
24
  const appLogger = (0, __intlayer_config.getAppLogger)(configuration);
25
- const hasCMSAuth = configuration.editor.clientId && configuration.editor.clientSecret;
26
- const hasHisOwnAIAPIKey = configuration.ai?.apiKey || aiOptions?.apiKey;
27
- if (!hasCMSAuth && !hasHisOwnAIAPIKey) {
25
+ const hasCMSAuth = Boolean(configuration.editor.clientId && configuration.editor.clientSecret);
26
+ const hasHisOwnAIAPIKey = Boolean(configuration.ai?.apiKey || aiOptions?.apiKey);
27
+ console.log({
28
+ hasCMSAuth,
29
+ hasHisOwnAIAPIKey
30
+ });
31
+ if (hasHisOwnAIAPIKey) return true;
32
+ if (!hasCMSAuth) {
28
33
  appLogger("AI options or API key not provided.", { level: "error" });
29
34
  return false;
30
35
  }
31
- if (!hasHisOwnAIAPIKey) return await checkCMSAuth(configuration);
32
- return true;
36
+ return await checkCMSAuth(configuration);
33
37
  };
34
38
 
35
39
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"checkAccess.cjs","names":[],"sources":["../../../src/utils/checkAccess.ts"],"sourcesContent":["import type { AIOptions } from '@intlayer/api';\nimport { getIntlayerAPIProxy } from '@intlayer/api';\nimport { extractErrorMessage, getAppLogger } from '@intlayer/config';\nimport type { IntlayerConfig } from '@intlayer/types';\n\nexport const checkCMSAuth = async (\n configuration: IntlayerConfig\n): Promise<boolean> => {\n const appLogger = getAppLogger(configuration, {\n config: {\n prefix: '',\n },\n });\n\n const hasCMSAuth =\n configuration.editor.clientId && configuration.editor.clientSecret;\n if (!hasCMSAuth) {\n appLogger('CMS auth not provided.', {\n level: 'error',\n });\n\n return false;\n }\n const intlayerAPI = getIntlayerAPIProxy(undefined, configuration);\n\n try {\n await intlayerAPI.oAuth.getOAuth2AccessToken();\n } catch (error) {\n const message = extractErrorMessage(error);\n\n appLogger(message, {\n level: 'error',\n });\n return false;\n }\n\n return true;\n};\n\nexport const checkAIAccess = async (\n configuration: IntlayerConfig,\n aiOptions?: AIOptions\n): Promise<boolean> => {\n const appLogger = getAppLogger(configuration);\n\n const hasCMSAuth =\n configuration.editor.clientId && configuration.editor.clientSecret;\n const hasHisOwnAIAPIKey = configuration.ai?.apiKey || aiOptions?.apiKey;\n\n // User need to provide either his own AI API key or the CMS auth\n if (!hasCMSAuth && !hasHisOwnAIAPIKey) {\n appLogger('AI options or API key not provided.', {\n level: 'error',\n });\n\n return false;\n }\n\n // If the user do not have his own AI API key, we need to check the CMS auth\n if (!hasHisOwnAIAPIKey) {\n return await checkCMSAuth(configuration);\n }\n\n return true;\n};\n"],"mappings":";;;;;;;AAKA,MAAa,eAAe,OAC1B,kBACqB;CACrB,MAAM,gDAAyB,eAAe,EAC5C,QAAQ,EACN,QAAQ,IACT,EACF,CAAC;AAIF,KAAI,EADF,cAAc,OAAO,YAAY,cAAc,OAAO,eACvC;AACf,YAAU,0BAA0B,EAClC,OAAO,SACR,CAAC;AAEF,SAAO;;CAET,MAAM,sDAAkC,QAAW,cAAc;AAEjE,KAAI;AACF,QAAM,YAAY,MAAM,sBAAsB;UACvC,OAAO;AAGd,uDAFoC,MAAM,EAEvB,EACjB,OAAO,SACR,CAAC;AACF,SAAO;;AAGT,QAAO;;AAGT,MAAa,gBAAgB,OAC3B,eACA,cACqB;CACrB,MAAM,gDAAyB,cAAc;CAE7C,MAAM,aACJ,cAAc,OAAO,YAAY,cAAc,OAAO;CACxD,MAAM,oBAAoB,cAAc,IAAI,UAAU,WAAW;AAGjE,KAAI,CAAC,cAAc,CAAC,mBAAmB;AACrC,YAAU,uCAAuC,EAC/C,OAAO,SACR,CAAC;AAEF,SAAO;;AAIT,KAAI,CAAC,kBACH,QAAO,MAAM,aAAa,cAAc;AAG1C,QAAO"}
1
+ {"version":3,"file":"checkAccess.cjs","names":[],"sources":["../../../src/utils/checkAccess.ts"],"sourcesContent":["import type { AIOptions } from '@intlayer/api';\nimport { getIntlayerAPIProxy } from '@intlayer/api';\nimport { extractErrorMessage, getAppLogger } from '@intlayer/config';\nimport type { IntlayerConfig } from '@intlayer/types';\n\nexport const checkCMSAuth = async (\n configuration: IntlayerConfig\n): Promise<boolean> => {\n const appLogger = getAppLogger(configuration, {\n config: {\n prefix: '',\n },\n });\n\n const hasCMSAuth =\n configuration.editor.clientId && configuration.editor.clientSecret;\n if (!hasCMSAuth) {\n appLogger('CMS auth not provided.', {\n level: 'error',\n });\n\n return false;\n }\n const intlayerAPI = getIntlayerAPIProxy(undefined, configuration);\n\n try {\n await intlayerAPI.oAuth.getOAuth2AccessToken();\n } catch (error) {\n const message = extractErrorMessage(error);\n\n appLogger(message, {\n level: 'error',\n });\n return false;\n }\n\n return true;\n};\n\nexport const checkAIAccess = async (\n configuration: IntlayerConfig,\n aiOptions?: AIOptions\n): Promise<boolean> => {\n const appLogger = getAppLogger(configuration);\n\n const hasCMSAuth = Boolean(\n configuration.editor.clientId && configuration.editor.clientSecret\n );\n const hasHisOwnAIAPIKey = Boolean(\n configuration.ai?.apiKey || aiOptions?.apiKey\n );\n\n console.log({ hasCMSAuth, hasHisOwnAIAPIKey });\n\n if (hasHisOwnAIAPIKey) {\n return true;\n }\n\n // User need to provide either his own AI API key or the CMS auth\n if (!hasCMSAuth) {\n appLogger('AI options or API key not provided.', {\n level: 'error',\n });\n\n return false;\n }\n\n // If the user do not have his own AI API key, we need to check the CMS auth\n return await checkCMSAuth(configuration);\n};\n"],"mappings":";;;;;;;AAKA,MAAa,eAAe,OAC1B,kBACqB;CACrB,MAAM,gDAAyB,eAAe,EAC5C,QAAQ,EACN,QAAQ,IACT,EACF,CAAC;AAIF,KAAI,EADF,cAAc,OAAO,YAAY,cAAc,OAAO,eACvC;AACf,YAAU,0BAA0B,EAClC,OAAO,SACR,CAAC;AAEF,SAAO;;CAET,MAAM,sDAAkC,QAAW,cAAc;AAEjE,KAAI;AACF,QAAM,YAAY,MAAM,sBAAsB;UACvC,OAAO;AAGd,uDAFoC,MAAM,EAEvB,EACjB,OAAO,SACR,CAAC;AACF,SAAO;;AAGT,QAAO;;AAGT,MAAa,gBAAgB,OAC3B,eACA,cACqB;CACrB,MAAM,gDAAyB,cAAc;CAE7C,MAAM,aAAa,QACjB,cAAc,OAAO,YAAY,cAAc,OAAO,aACvD;CACD,MAAM,oBAAoB,QACxB,cAAc,IAAI,UAAU,WAAW,OACxC;AAED,SAAQ,IAAI;EAAE;EAAY;EAAmB,CAAC;AAE9C,KAAI,kBACF,QAAO;AAIT,KAAI,CAAC,YAAY;AACf,YAAU,uCAAuC,EAC/C,OAAO,SACR,CAAC;AAEF,SAAO;;AAIT,QAAO,MAAM,aAAa,cAAc"}
@@ -19,14 +19,18 @@ const checkCMSAuth = async (configuration) => {
19
19
  };
20
20
  const checkAIAccess = async (configuration, aiOptions) => {
21
21
  const appLogger = getAppLogger(configuration);
22
- const hasCMSAuth = configuration.editor.clientId && configuration.editor.clientSecret;
23
- const hasHisOwnAIAPIKey = configuration.ai?.apiKey || aiOptions?.apiKey;
24
- if (!hasCMSAuth && !hasHisOwnAIAPIKey) {
22
+ const hasCMSAuth = Boolean(configuration.editor.clientId && configuration.editor.clientSecret);
23
+ const hasHisOwnAIAPIKey = Boolean(configuration.ai?.apiKey || aiOptions?.apiKey);
24
+ console.log({
25
+ hasCMSAuth,
26
+ hasHisOwnAIAPIKey
27
+ });
28
+ if (hasHisOwnAIAPIKey) return true;
29
+ if (!hasCMSAuth) {
25
30
  appLogger("AI options or API key not provided.", { level: "error" });
26
31
  return false;
27
32
  }
28
- if (!hasHisOwnAIAPIKey) return await checkCMSAuth(configuration);
29
- return true;
33
+ return await checkCMSAuth(configuration);
30
34
  };
31
35
 
32
36
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"checkAccess.mjs","names":[],"sources":["../../../src/utils/checkAccess.ts"],"sourcesContent":["import type { AIOptions } from '@intlayer/api';\nimport { getIntlayerAPIProxy } from '@intlayer/api';\nimport { extractErrorMessage, getAppLogger } from '@intlayer/config';\nimport type { IntlayerConfig } from '@intlayer/types';\n\nexport const checkCMSAuth = async (\n configuration: IntlayerConfig\n): Promise<boolean> => {\n const appLogger = getAppLogger(configuration, {\n config: {\n prefix: '',\n },\n });\n\n const hasCMSAuth =\n configuration.editor.clientId && configuration.editor.clientSecret;\n if (!hasCMSAuth) {\n appLogger('CMS auth not provided.', {\n level: 'error',\n });\n\n return false;\n }\n const intlayerAPI = getIntlayerAPIProxy(undefined, configuration);\n\n try {\n await intlayerAPI.oAuth.getOAuth2AccessToken();\n } catch (error) {\n const message = extractErrorMessage(error);\n\n appLogger(message, {\n level: 'error',\n });\n return false;\n }\n\n return true;\n};\n\nexport const checkAIAccess = async (\n configuration: IntlayerConfig,\n aiOptions?: AIOptions\n): Promise<boolean> => {\n const appLogger = getAppLogger(configuration);\n\n const hasCMSAuth =\n configuration.editor.clientId && configuration.editor.clientSecret;\n const hasHisOwnAIAPIKey = configuration.ai?.apiKey || aiOptions?.apiKey;\n\n // User need to provide either his own AI API key or the CMS auth\n if (!hasCMSAuth && !hasHisOwnAIAPIKey) {\n appLogger('AI options or API key not provided.', {\n level: 'error',\n });\n\n return false;\n }\n\n // If the user do not have his own AI API key, we need to check the CMS auth\n if (!hasHisOwnAIAPIKey) {\n return await checkCMSAuth(configuration);\n }\n\n return true;\n};\n"],"mappings":";;;;AAKA,MAAa,eAAe,OAC1B,kBACqB;CACrB,MAAM,YAAY,aAAa,eAAe,EAC5C,QAAQ,EACN,QAAQ,IACT,EACF,CAAC;AAIF,KAAI,EADF,cAAc,OAAO,YAAY,cAAc,OAAO,eACvC;AACf,YAAU,0BAA0B,EAClC,OAAO,SACR,CAAC;AAEF,SAAO;;CAET,MAAM,cAAc,oBAAoB,QAAW,cAAc;AAEjE,KAAI;AACF,QAAM,YAAY,MAAM,sBAAsB;UACvC,OAAO;AAGd,YAFgB,oBAAoB,MAAM,EAEvB,EACjB,OAAO,SACR,CAAC;AACF,SAAO;;AAGT,QAAO;;AAGT,MAAa,gBAAgB,OAC3B,eACA,cACqB;CACrB,MAAM,YAAY,aAAa,cAAc;CAE7C,MAAM,aACJ,cAAc,OAAO,YAAY,cAAc,OAAO;CACxD,MAAM,oBAAoB,cAAc,IAAI,UAAU,WAAW;AAGjE,KAAI,CAAC,cAAc,CAAC,mBAAmB;AACrC,YAAU,uCAAuC,EAC/C,OAAO,SACR,CAAC;AAEF,SAAO;;AAIT,KAAI,CAAC,kBACH,QAAO,MAAM,aAAa,cAAc;AAG1C,QAAO"}
1
+ {"version":3,"file":"checkAccess.mjs","names":[],"sources":["../../../src/utils/checkAccess.ts"],"sourcesContent":["import type { AIOptions } from '@intlayer/api';\nimport { getIntlayerAPIProxy } from '@intlayer/api';\nimport { extractErrorMessage, getAppLogger } from '@intlayer/config';\nimport type { IntlayerConfig } from '@intlayer/types';\n\nexport const checkCMSAuth = async (\n configuration: IntlayerConfig\n): Promise<boolean> => {\n const appLogger = getAppLogger(configuration, {\n config: {\n prefix: '',\n },\n });\n\n const hasCMSAuth =\n configuration.editor.clientId && configuration.editor.clientSecret;\n if (!hasCMSAuth) {\n appLogger('CMS auth not provided.', {\n level: 'error',\n });\n\n return false;\n }\n const intlayerAPI = getIntlayerAPIProxy(undefined, configuration);\n\n try {\n await intlayerAPI.oAuth.getOAuth2AccessToken();\n } catch (error) {\n const message = extractErrorMessage(error);\n\n appLogger(message, {\n level: 'error',\n });\n return false;\n }\n\n return true;\n};\n\nexport const checkAIAccess = async (\n configuration: IntlayerConfig,\n aiOptions?: AIOptions\n): Promise<boolean> => {\n const appLogger = getAppLogger(configuration);\n\n const hasCMSAuth = Boolean(\n configuration.editor.clientId && configuration.editor.clientSecret\n );\n const hasHisOwnAIAPIKey = Boolean(\n configuration.ai?.apiKey || aiOptions?.apiKey\n );\n\n console.log({ hasCMSAuth, hasHisOwnAIAPIKey });\n\n if (hasHisOwnAIAPIKey) {\n return true;\n }\n\n // User need to provide either his own AI API key or the CMS auth\n if (!hasCMSAuth) {\n appLogger('AI options or API key not provided.', {\n level: 'error',\n });\n\n return false;\n }\n\n // If the user do not have his own AI API key, we need to check the CMS auth\n return await checkCMSAuth(configuration);\n};\n"],"mappings":";;;;AAKA,MAAa,eAAe,OAC1B,kBACqB;CACrB,MAAM,YAAY,aAAa,eAAe,EAC5C,QAAQ,EACN,QAAQ,IACT,EACF,CAAC;AAIF,KAAI,EADF,cAAc,OAAO,YAAY,cAAc,OAAO,eACvC;AACf,YAAU,0BAA0B,EAClC,OAAO,SACR,CAAC;AAEF,SAAO;;CAET,MAAM,cAAc,oBAAoB,QAAW,cAAc;AAEjE,KAAI;AACF,QAAM,YAAY,MAAM,sBAAsB;UACvC,OAAO;AAGd,YAFgB,oBAAoB,MAAM,EAEvB,EACjB,OAAO,SACR,CAAC;AACF,SAAO;;AAGT,QAAO;;AAGT,MAAa,gBAAgB,OAC3B,eACA,cACqB;CACrB,MAAM,YAAY,aAAa,cAAc;CAE7C,MAAM,aAAa,QACjB,cAAc,OAAO,YAAY,cAAc,OAAO,aACvD;CACD,MAAM,oBAAoB,QACxB,cAAc,IAAI,UAAU,WAAW,OACxC;AAED,SAAQ,IAAI;EAAE;EAAY;EAAmB,CAAC;AAE9C,KAAI,kBACF,QAAO;AAIT,KAAI,CAAC,YAAY;AACf,YAAU,uCAAuC,EAC/C,OAAO,SACR,CAAC;AAEF,SAAO;;AAIT,QAAO,MAAM,aAAa,cAAc"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/cli",
3
- "version": "7.0.3-canary.1",
3
+ "version": "7.0.3",
4
4
  "private": false,
5
5
  "description": "Provides uniform command-line interface scripts for Intlayer, used in packages like intlayer-cli and intlayer.",
6
6
  "keywords": [
@@ -63,36 +63,36 @@
63
63
  "typecheck": "tsc --noEmit --project tsconfig.types.json"
64
64
  },
65
65
  "dependencies": {
66
- "@intlayer/api": "7.0.3-canary.1",
67
- "@intlayer/chokidar": "7.0.3-canary.1",
68
- "@intlayer/config": "7.0.3-canary.1",
69
- "@intlayer/dictionaries-entry": "7.0.3-canary.1",
70
- "@intlayer/remote-dictionaries-entry": "7.0.3-canary.1",
71
- "@intlayer/types": "7.0.3-canary.1",
72
- "@intlayer/unmerged-dictionaries-entry": "7.0.3-canary.1",
66
+ "@intlayer/api": "7.0.3",
67
+ "@intlayer/chokidar": "7.0.3",
68
+ "@intlayer/config": "7.0.3",
69
+ "@intlayer/dictionaries-entry": "7.0.3",
70
+ "@intlayer/remote-dictionaries-entry": "7.0.3",
71
+ "@intlayer/types": "7.0.3",
72
+ "@intlayer/unmerged-dictionaries-entry": "7.0.3",
73
73
  "commander": "14.0.1",
74
74
  "eventsource": "3.0.7",
75
75
  "fast-glob": "3.3.3"
76
76
  },
77
77
  "devDependencies": {
78
- "@intlayer/core": "7.0.3-canary.1",
79
- "@types/node": "24.9.1",
80
- "@utils/ts-config": "7.0.3-canary.1",
81
- "@utils/ts-config-types": "7.0.3-canary.1",
82
- "@utils/tsdown-config": "7.0.3-canary.1",
78
+ "@intlayer/core": "7.0.3",
79
+ "@types/node": "24.9.2",
80
+ "@utils/ts-config": "7.0.3",
81
+ "@utils/ts-config-types": "7.0.3",
82
+ "@utils/tsdown-config": "7.0.3",
83
83
  "rimraf": "6.0.1",
84
- "tsdown": "0.15.9",
84
+ "tsdown": "0.15.11",
85
85
  "typescript": "5.9.3",
86
- "vitest": "4.0.3"
86
+ "vitest": "4.0.5"
87
87
  },
88
88
  "peerDependencies": {
89
- "@intlayer/api": "7.0.3-canary.1",
90
- "@intlayer/chokidar": "7.0.3-canary.1",
91
- "@intlayer/config": "7.0.3-canary.1",
92
- "@intlayer/dictionaries-entry": "7.0.3-canary.1",
93
- "@intlayer/remote-dictionaries-entry": "7.0.3-canary.1",
94
- "@intlayer/types": "7.0.3-canary.1",
95
- "@intlayer/unmerged-dictionaries-entry": "7.0.3-canary.1"
89
+ "@intlayer/api": "7.0.3",
90
+ "@intlayer/chokidar": "7.0.3",
91
+ "@intlayer/config": "7.0.3",
92
+ "@intlayer/dictionaries-entry": "7.0.3",
93
+ "@intlayer/remote-dictionaries-entry": "7.0.3",
94
+ "@intlayer/types": "7.0.3",
95
+ "@intlayer/unmerged-dictionaries-entry": "7.0.3"
96
96
  },
97
97
  "bug": {
98
98
  "url": "https://github.com/aymericzip/intlayer/issues"