@intlayer/cli 4.1.7 → 4.1.8
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/cjs/cli.cjs +2 -2
- package/dist/cjs/cli.cjs.map +1 -1
- package/dist/cjs/config.cjs +1 -1
- package/dist/cjs/config.cjs.map +1 -1
- package/dist/cjs/pushConfig.cjs +1 -1
- package/dist/cjs/pushConfig.cjs.map +1 -1
- package/dist/esm/cli.mjs +2 -2
- package/dist/esm/cli.mjs.map +1 -1
- package/dist/esm/config.mjs +5 -2
- package/dist/esm/config.mjs.map +1 -1
- package/dist/esm/pushConfig.mjs +5 -2
- package/dist/esm/pushConfig.mjs.map +1 -1
- package/dist/types/cli.d.ts.map +1 -1
- package/dist/types/config.d.ts +2 -1
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/pushConfig.d.ts +2 -2
- package/dist/types/pushConfig.d.ts.map +1 -1
- package/package.json +14 -13
package/dist/cjs/cli.cjs
CHANGED
|
@@ -45,8 +45,8 @@ const setAPI = () => {
|
|
|
45
45
|
"Keep the local dictionaries after pushing"
|
|
46
46
|
).action(import_push.push);
|
|
47
47
|
const configurationProgram = program.command("config").description("Configuration operations");
|
|
48
|
-
configurationProgram.command("get").description("Get the configuration").action(import_config.getConfig);
|
|
49
|
-
configurationProgram.command("push").description("Push the configuration").action(import_pushConfig.pushConfig);
|
|
48
|
+
configurationProgram.command("get").description("Get the configuration").option("--env [env]", "Environment").option("--env-file [envFile]", "Environment file").option("--verbose", "Verbose").action(import_config.getConfig);
|
|
49
|
+
configurationProgram.command("push").description("Push the configuration").option("--env [env]", "Environment").option("--env-file [envFile]", "Environment file").option("--verbose", "Verbose").action(import_pushConfig.pushConfig);
|
|
50
50
|
program.command("content list").description("List the content declaration files").action(import_listContentDeclaration.listContentDeclaration);
|
|
51
51
|
program.command("audit").description("Audit the dictionaries").option(
|
|
52
52
|
"-f, --files [files...]",
|
package/dist/cjs/cli.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/cli.ts"],"sourcesContent":["import { Command } from 'commander';\nimport { audit } from './audit';\nimport { build } from './build';\nimport { getConfig } from './config';\nimport { listContentDeclaration } from './listContentDeclaration';\nimport { pull } from './pull';\nimport { push } from './push';\nimport { pushConfig } from './pushConfig';\n\n/**\n * Set the API for the CLI\n *\n * Example of commands:\n *\n * npm run intlayer build --watch\n * npm run intlayer push --dictionaries id1 id2 id3 --deleteLocaleDir\n */\nexport const setAPI = (): Command => {\n const program = new Command();\n\n program.version('1.0.0').description('Intlayer CLI');\n\n program\n .command('build')\n .description('Build the dictionaries')\n .option('-w, --watch', 'Watch for changes')\n .action(build);\n\n /**\n * DICTIONARIES\n */\n\n const dictionariesProgram = program\n .command('dictionaries')\n .description('Dictionaries operations');\n\n dictionariesProgram\n .command('pull')\n .option('-d, --dictionaries [ids...]', 'List of dictionary IDs to pull')\n .option('--newDictionariesPath [path]', 'Path to save the new dictionaries')\n .action(pull);\n\n // Define the main `push` command\n dictionariesProgram\n .command('push')\n .description(\n 'Push all dictionaries. Create or update the pushed dictionaries'\n )\n .option('-d, --dictionaries [ids...]', 'List of dictionary IDs to push')\n .option(\n '-r, --deleteLocaleDictionary',\n 'Delete the local dictionaries after pushing'\n )\n .option(\n '-k, --keepLocaleDictionary',\n 'Keep the local dictionaries after pushing'\n )\n .action(push);\n\n /**\n * CONFIGURATION\n */\n\n const configurationProgram = program\n .command('config')\n .description('Configuration operations');\n\n configurationProgram\n .command('get')\n .description('Get the configuration')\n\n .action(getConfig);\n\n // Define the `push config` subcommand and add it to the `push` command\n configurationProgram\n .command('push')\n .description('Push the configuration')\n .action(pushConfig);\n\n /**\n * CONTENT DECLARATION\n */\n\n program\n .command('content list')\n .description('List the content declaration files')\n .action(listContentDeclaration);\n\n program\n .command('audit')\n .description('Audit the dictionaries')\n .option(\n '-f, --files [files...]',\n 'List of Content Declaration files to audit'\n )\n .option(\n '--exclude [excludedGlobs...]',\n 'Globs pattern to exclude from the audit'\n )\n .option('-m, --model [model]', 'Model')\n .option('-p, --custom-prompt [prompt]', 'Custom prompt')\n .option('-l, --async-limit [asyncLimit]', 'Async limit')\n .option('-k, --open-ai-api-key [openAiApiKey]', 'OpenAI API key')\n .action(audit);\n\n program.parse(process.argv);\n\n return program;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAwB;AACxB,mBAAsB;AACtB,mBAAsB;AACtB,oBAA0B;AAC1B,oCAAuC;AACvC,kBAAqB;AACrB,kBAAqB;AACrB,wBAA2B;AAUpB,MAAM,SAAS,MAAe;AACnC,QAAM,UAAU,IAAI,yBAAQ;AAE5B,UAAQ,QAAQ,OAAO,EAAE,YAAY,cAAc;AAEnD,UACG,QAAQ,OAAO,EACf,YAAY,wBAAwB,EACpC,OAAO,eAAe,mBAAmB,EACzC,OAAO,kBAAK;AAMf,QAAM,sBAAsB,QACzB,QAAQ,cAAc,EACtB,YAAY,yBAAyB;AAExC,sBACG,QAAQ,MAAM,EACd,OAAO,+BAA+B,gCAAgC,EACtE,OAAO,gCAAgC,mCAAmC,EAC1E,OAAO,gBAAI;AAGd,sBACG,QAAQ,MAAM,EACd;AAAA,IACC;AAAA,EACF,EACC,OAAO,+BAA+B,gCAAgC,EACtE;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC,OAAO,gBAAI;AAMd,QAAM,uBAAuB,QAC1B,QAAQ,QAAQ,EAChB,YAAY,0BAA0B;AAEzC,uBACG,QAAQ,KAAK,EACb,YAAY,uBAAuB,
|
|
1
|
+
{"version":3,"sources":["../../src/cli.ts"],"sourcesContent":["import { Command } from 'commander';\nimport { audit } from './audit';\nimport { build } from './build';\nimport { getConfig } from './config';\nimport { listContentDeclaration } from './listContentDeclaration';\nimport { pull } from './pull';\nimport { push } from './push';\nimport { pushConfig } from './pushConfig';\n\n/**\n * Set the API for the CLI\n *\n * Example of commands:\n *\n * npm run intlayer build --watch\n * npm run intlayer push --dictionaries id1 id2 id3 --deleteLocaleDir\n */\nexport const setAPI = (): Command => {\n const program = new Command();\n\n program.version('1.0.0').description('Intlayer CLI');\n\n program\n .command('build')\n .description('Build the dictionaries')\n .option('-w, --watch', 'Watch for changes')\n .action(build);\n\n /**\n * DICTIONARIES\n */\n\n const dictionariesProgram = program\n .command('dictionaries')\n .description('Dictionaries operations');\n\n dictionariesProgram\n .command('pull')\n .option('-d, --dictionaries [ids...]', 'List of dictionary IDs to pull')\n .option('--newDictionariesPath [path]', 'Path to save the new dictionaries')\n .action(pull);\n\n // Define the main `push` command\n dictionariesProgram\n .command('push')\n .description(\n 'Push all dictionaries. Create or update the pushed dictionaries'\n )\n .option('-d, --dictionaries [ids...]', 'List of dictionary IDs to push')\n .option(\n '-r, --deleteLocaleDictionary',\n 'Delete the local dictionaries after pushing'\n )\n .option(\n '-k, --keepLocaleDictionary',\n 'Keep the local dictionaries after pushing'\n )\n .action(push);\n\n /**\n * CONFIGURATION\n */\n\n const configurationProgram = program\n .command('config')\n .description('Configuration operations');\n\n configurationProgram\n .command('get')\n .description('Get the configuration')\n .option('--env [env]', 'Environment')\n .option('--env-file [envFile]', 'Environment file')\n .option('--verbose', 'Verbose')\n .action(getConfig);\n\n // Define the `push config` subcommand and add it to the `push` command\n configurationProgram\n .command('push')\n .description('Push the configuration')\n .option('--env [env]', 'Environment')\n .option('--env-file [envFile]', 'Environment file')\n .option('--verbose', 'Verbose')\n .action(pushConfig);\n\n /**\n * CONTENT DECLARATION\n */\n\n program\n .command('content list')\n .description('List the content declaration files')\n .action(listContentDeclaration);\n\n program\n .command('audit')\n .description('Audit the dictionaries')\n .option(\n '-f, --files [files...]',\n 'List of Content Declaration files to audit'\n )\n .option(\n '--exclude [excludedGlobs...]',\n 'Globs pattern to exclude from the audit'\n )\n .option('-m, --model [model]', 'Model')\n .option('-p, --custom-prompt [prompt]', 'Custom prompt')\n .option('-l, --async-limit [asyncLimit]', 'Async limit')\n .option('-k, --open-ai-api-key [openAiApiKey]', 'OpenAI API key')\n .action(audit);\n\n program.parse(process.argv);\n\n return program;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAwB;AACxB,mBAAsB;AACtB,mBAAsB;AACtB,oBAA0B;AAC1B,oCAAuC;AACvC,kBAAqB;AACrB,kBAAqB;AACrB,wBAA2B;AAUpB,MAAM,SAAS,MAAe;AACnC,QAAM,UAAU,IAAI,yBAAQ;AAE5B,UAAQ,QAAQ,OAAO,EAAE,YAAY,cAAc;AAEnD,UACG,QAAQ,OAAO,EACf,YAAY,wBAAwB,EACpC,OAAO,eAAe,mBAAmB,EACzC,OAAO,kBAAK;AAMf,QAAM,sBAAsB,QACzB,QAAQ,cAAc,EACtB,YAAY,yBAAyB;AAExC,sBACG,QAAQ,MAAM,EACd,OAAO,+BAA+B,gCAAgC,EACtE,OAAO,gCAAgC,mCAAmC,EAC1E,OAAO,gBAAI;AAGd,sBACG,QAAQ,MAAM,EACd;AAAA,IACC;AAAA,EACF,EACC,OAAO,+BAA+B,gCAAgC,EACtE;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC,OAAO,gBAAI;AAMd,QAAM,uBAAuB,QAC1B,QAAQ,QAAQ,EAChB,YAAY,0BAA0B;AAEzC,uBACG,QAAQ,KAAK,EACb,YAAY,uBAAuB,EACnC,OAAO,eAAe,aAAa,EACnC,OAAO,wBAAwB,kBAAkB,EACjD,OAAO,aAAa,SAAS,EAC7B,OAAO,uBAAS;AAGnB,uBACG,QAAQ,MAAM,EACd,YAAY,wBAAwB,EACpC,OAAO,eAAe,aAAa,EACnC,OAAO,wBAAwB,kBAAkB,EACjD,OAAO,aAAa,SAAS,EAC7B,OAAO,4BAAU;AAMpB,UACG,QAAQ,cAAc,EACtB,YAAY,oCAAoC,EAChD,OAAO,oDAAsB;AAEhC,UACG,QAAQ,OAAO,EACf,YAAY,wBAAwB,EACpC;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC,OAAO,uBAAuB,OAAO,EACrC,OAAO,gCAAgC,eAAe,EACtD,OAAO,kCAAkC,aAAa,EACtD,OAAO,wCAAwC,gBAAgB,EAC/D,OAAO,kBAAK;AAEf,UAAQ,MAAM,QAAQ,IAAI;AAE1B,SAAO;AACT;","names":[]}
|
package/dist/cjs/config.cjs
CHANGED
|
@@ -23,7 +23,7 @@ __export(config_exports, {
|
|
|
23
23
|
module.exports = __toCommonJS(config_exports);
|
|
24
24
|
var import_config = require("@intlayer/config");
|
|
25
25
|
const getConfig = (options) => {
|
|
26
|
-
const config = (0, import_config.getConfiguration)();
|
|
26
|
+
const config = (0, import_config.getConfiguration)(options);
|
|
27
27
|
(0, import_config.logger)(JSON.stringify(config, null, 2), {
|
|
28
28
|
config: {
|
|
29
29
|
prefix: options?.logPrefix
|
package/dist/cjs/config.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/config.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../../src/config.ts"],"sourcesContent":["import {\n getConfiguration,\n type GetConfigurationOptions,\n logger,\n} from '@intlayer/config';\n\ntype ConfigOptions = {\n logPrefix?: string;\n} & GetConfigurationOptions;\n\nexport const getConfig = (options?: ConfigOptions) => {\n const config = getConfiguration(options);\n\n logger(JSON.stringify(config, null, 2), {\n config: {\n prefix: options?.logPrefix,\n },\n });\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAIO;AAMA,MAAM,YAAY,CAAC,YAA4B;AACpD,QAAM,aAAS,gCAAiB,OAAO;AAEvC,4BAAO,KAAK,UAAU,QAAQ,MAAM,CAAC,GAAG;AAAA,IACtC,QAAQ;AAAA,MACN,QAAQ,SAAS;AAAA,IACnB;AAAA,EACF,CAAC;AACH;","names":[]}
|
package/dist/cjs/pushConfig.cjs
CHANGED
|
@@ -24,7 +24,7 @@ module.exports = __toCommonJS(pushConfig_exports);
|
|
|
24
24
|
var import_api = require("@intlayer/api");
|
|
25
25
|
var import_config = require("@intlayer/config");
|
|
26
26
|
const pushConfig = async (options) => {
|
|
27
|
-
const config = (0, import_config.getConfiguration)();
|
|
27
|
+
const config = (0, import_config.getConfiguration)(options);
|
|
28
28
|
const { clientId, clientSecret } = config.editor;
|
|
29
29
|
if (!clientId || !clientSecret) {
|
|
30
30
|
(0, import_config.logger)(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/pushConfig.ts"],"sourcesContent":["import { getIntlayerAPI } from '@intlayer/api';\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/pushConfig.ts"],"sourcesContent":["import { getIntlayerAPI } from '@intlayer/api';\nimport {\n getConfiguration,\n logger,\n type GetConfigurationOptions,\n} from '@intlayer/config';\n\ntype PushOptions = {\n logPrefix?: string;\n} & GetConfigurationOptions;\n\nexport const pushConfig = async (options?: PushOptions) => {\n const config = getConfiguration(options);\n\n const { clientId, clientSecret } = config.editor;\n\n if (!clientId || !clientSecret) {\n logger(\n 'Missing OAuth2 client ID or client secret. To get access token go to https://intlayer.org/dashboard/project.',\n {\n level: 'error',\n config: {\n prefix: options?.logPrefix,\n },\n }\n );\n return;\n }\n\n const intlayerAPI = getIntlayerAPI(undefined, config);\n\n const oAuth2TokenResult = await intlayerAPI.auth.getOAuth2AccessToken();\n\n const oAuth2AccessToken = oAuth2TokenResult.data?.accessToken;\n\n // Get the list of dictionary keys\n const getDictionariesKeysResult =\n await intlayerAPI.project.pushProjectConfiguration(config, {\n headers: { Authorization: `Bearer ${oAuth2AccessToken}` },\n });\n\n if (!getDictionariesKeysResult.data) {\n throw new Error('Error pushing project configuration');\n }\n\n logger('Project configuration pushed successfully', {\n config: {\n prefix: options?.logPrefix,\n },\n });\n\n logger(JSON.stringify(getDictionariesKeysResult.data, null, 2), {\n config: {\n prefix: options?.logPrefix,\n },\n });\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAA+B;AAC/B,oBAIO;AAMA,MAAM,aAAa,OAAO,YAA0B;AACzD,QAAM,aAAS,gCAAiB,OAAO;AAEvC,QAAM,EAAE,UAAU,aAAa,IAAI,OAAO;AAE1C,MAAI,CAAC,YAAY,CAAC,cAAc;AAC9B;AAAA,MACE;AAAA,MACA;AAAA,QACE,OAAO;AAAA,QACP,QAAQ;AAAA,UACN,QAAQ,SAAS;AAAA,QACnB;AAAA,MACF;AAAA,IACF;AACA;AAAA,EACF;AAEA,QAAM,kBAAc,2BAAe,QAAW,MAAM;AAEpD,QAAM,oBAAoB,MAAM,YAAY,KAAK,qBAAqB;AAEtE,QAAM,oBAAoB,kBAAkB,MAAM;AAGlD,QAAM,4BACJ,MAAM,YAAY,QAAQ,yBAAyB,QAAQ;AAAA,IACzD,SAAS,EAAE,eAAe,UAAU,iBAAiB,GAAG;AAAA,EAC1D,CAAC;AAEH,MAAI,CAAC,0BAA0B,MAAM;AACnC,UAAM,IAAI,MAAM,qCAAqC;AAAA,EACvD;AAEA,4BAAO,6CAA6C;AAAA,IAClD,QAAQ;AAAA,MACN,QAAQ,SAAS;AAAA,IACnB;AAAA,EACF,CAAC;AAED,4BAAO,KAAK,UAAU,0BAA0B,MAAM,MAAM,CAAC,GAAG;AAAA,IAC9D,QAAQ;AAAA,MACN,QAAQ,SAAS;AAAA,IACnB;AAAA,EACF,CAAC;AACH;","names":[]}
|
package/dist/esm/cli.mjs
CHANGED
|
@@ -22,8 +22,8 @@ const setAPI = () => {
|
|
|
22
22
|
"Keep the local dictionaries after pushing"
|
|
23
23
|
).action(push);
|
|
24
24
|
const configurationProgram = program.command("config").description("Configuration operations");
|
|
25
|
-
configurationProgram.command("get").description("Get the configuration").action(getConfig);
|
|
26
|
-
configurationProgram.command("push").description("Push the configuration").action(pushConfig);
|
|
25
|
+
configurationProgram.command("get").description("Get the configuration").option("--env [env]", "Environment").option("--env-file [envFile]", "Environment file").option("--verbose", "Verbose").action(getConfig);
|
|
26
|
+
configurationProgram.command("push").description("Push the configuration").option("--env [env]", "Environment").option("--env-file [envFile]", "Environment file").option("--verbose", "Verbose").action(pushConfig);
|
|
27
27
|
program.command("content list").description("List the content declaration files").action(listContentDeclaration);
|
|
28
28
|
program.command("audit").description("Audit the dictionaries").option(
|
|
29
29
|
"-f, --files [files...]",
|
package/dist/esm/cli.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/cli.ts"],"sourcesContent":["import { Command } from 'commander';\nimport { audit } from './audit';\nimport { build } from './build';\nimport { getConfig } from './config';\nimport { listContentDeclaration } from './listContentDeclaration';\nimport { pull } from './pull';\nimport { push } from './push';\nimport { pushConfig } from './pushConfig';\n\n/**\n * Set the API for the CLI\n *\n * Example of commands:\n *\n * npm run intlayer build --watch\n * npm run intlayer push --dictionaries id1 id2 id3 --deleteLocaleDir\n */\nexport const setAPI = (): Command => {\n const program = new Command();\n\n program.version('1.0.0').description('Intlayer CLI');\n\n program\n .command('build')\n .description('Build the dictionaries')\n .option('-w, --watch', 'Watch for changes')\n .action(build);\n\n /**\n * DICTIONARIES\n */\n\n const dictionariesProgram = program\n .command('dictionaries')\n .description('Dictionaries operations');\n\n dictionariesProgram\n .command('pull')\n .option('-d, --dictionaries [ids...]', 'List of dictionary IDs to pull')\n .option('--newDictionariesPath [path]', 'Path to save the new dictionaries')\n .action(pull);\n\n // Define the main `push` command\n dictionariesProgram\n .command('push')\n .description(\n 'Push all dictionaries. Create or update the pushed dictionaries'\n )\n .option('-d, --dictionaries [ids...]', 'List of dictionary IDs to push')\n .option(\n '-r, --deleteLocaleDictionary',\n 'Delete the local dictionaries after pushing'\n )\n .option(\n '-k, --keepLocaleDictionary',\n 'Keep the local dictionaries after pushing'\n )\n .action(push);\n\n /**\n * CONFIGURATION\n */\n\n const configurationProgram = program\n .command('config')\n .description('Configuration operations');\n\n configurationProgram\n .command('get')\n .description('Get the configuration')\n\n .action(getConfig);\n\n // Define the `push config` subcommand and add it to the `push` command\n configurationProgram\n .command('push')\n .description('Push the configuration')\n .action(pushConfig);\n\n /**\n * CONTENT DECLARATION\n */\n\n program\n .command('content list')\n .description('List the content declaration files')\n .action(listContentDeclaration);\n\n program\n .command('audit')\n .description('Audit the dictionaries')\n .option(\n '-f, --files [files...]',\n 'List of Content Declaration files to audit'\n )\n .option(\n '--exclude [excludedGlobs...]',\n 'Globs pattern to exclude from the audit'\n )\n .option('-m, --model [model]', 'Model')\n .option('-p, --custom-prompt [prompt]', 'Custom prompt')\n .option('-l, --async-limit [asyncLimit]', 'Async limit')\n .option('-k, --open-ai-api-key [openAiApiKey]', 'OpenAI API key')\n .action(audit);\n\n program.parse(process.argv);\n\n return program;\n};\n"],"mappings":"AAAA,SAAS,eAAe;AACxB,SAAS,aAAa;AACtB,SAAS,aAAa;AACtB,SAAS,iBAAiB;AAC1B,SAAS,8BAA8B;AACvC,SAAS,YAAY;AACrB,SAAS,YAAY;AACrB,SAAS,kBAAkB;AAUpB,MAAM,SAAS,MAAe;AACnC,QAAM,UAAU,IAAI,QAAQ;AAE5B,UAAQ,QAAQ,OAAO,EAAE,YAAY,cAAc;AAEnD,UACG,QAAQ,OAAO,EACf,YAAY,wBAAwB,EACpC,OAAO,eAAe,mBAAmB,EACzC,OAAO,KAAK;AAMf,QAAM,sBAAsB,QACzB,QAAQ,cAAc,EACtB,YAAY,yBAAyB;AAExC,sBACG,QAAQ,MAAM,EACd,OAAO,+BAA+B,gCAAgC,EACtE,OAAO,gCAAgC,mCAAmC,EAC1E,OAAO,IAAI;AAGd,sBACG,QAAQ,MAAM,EACd;AAAA,IACC;AAAA,EACF,EACC,OAAO,+BAA+B,gCAAgC,EACtE;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC,OAAO,IAAI;AAMd,QAAM,uBAAuB,QAC1B,QAAQ,QAAQ,EAChB,YAAY,0BAA0B;AAEzC,uBACG,QAAQ,KAAK,EACb,YAAY,uBAAuB,
|
|
1
|
+
{"version":3,"sources":["../../src/cli.ts"],"sourcesContent":["import { Command } from 'commander';\nimport { audit } from './audit';\nimport { build } from './build';\nimport { getConfig } from './config';\nimport { listContentDeclaration } from './listContentDeclaration';\nimport { pull } from './pull';\nimport { push } from './push';\nimport { pushConfig } from './pushConfig';\n\n/**\n * Set the API for the CLI\n *\n * Example of commands:\n *\n * npm run intlayer build --watch\n * npm run intlayer push --dictionaries id1 id2 id3 --deleteLocaleDir\n */\nexport const setAPI = (): Command => {\n const program = new Command();\n\n program.version('1.0.0').description('Intlayer CLI');\n\n program\n .command('build')\n .description('Build the dictionaries')\n .option('-w, --watch', 'Watch for changes')\n .action(build);\n\n /**\n * DICTIONARIES\n */\n\n const dictionariesProgram = program\n .command('dictionaries')\n .description('Dictionaries operations');\n\n dictionariesProgram\n .command('pull')\n .option('-d, --dictionaries [ids...]', 'List of dictionary IDs to pull')\n .option('--newDictionariesPath [path]', 'Path to save the new dictionaries')\n .action(pull);\n\n // Define the main `push` command\n dictionariesProgram\n .command('push')\n .description(\n 'Push all dictionaries. Create or update the pushed dictionaries'\n )\n .option('-d, --dictionaries [ids...]', 'List of dictionary IDs to push')\n .option(\n '-r, --deleteLocaleDictionary',\n 'Delete the local dictionaries after pushing'\n )\n .option(\n '-k, --keepLocaleDictionary',\n 'Keep the local dictionaries after pushing'\n )\n .action(push);\n\n /**\n * CONFIGURATION\n */\n\n const configurationProgram = program\n .command('config')\n .description('Configuration operations');\n\n configurationProgram\n .command('get')\n .description('Get the configuration')\n .option('--env [env]', 'Environment')\n .option('--env-file [envFile]', 'Environment file')\n .option('--verbose', 'Verbose')\n .action(getConfig);\n\n // Define the `push config` subcommand and add it to the `push` command\n configurationProgram\n .command('push')\n .description('Push the configuration')\n .option('--env [env]', 'Environment')\n .option('--env-file [envFile]', 'Environment file')\n .option('--verbose', 'Verbose')\n .action(pushConfig);\n\n /**\n * CONTENT DECLARATION\n */\n\n program\n .command('content list')\n .description('List the content declaration files')\n .action(listContentDeclaration);\n\n program\n .command('audit')\n .description('Audit the dictionaries')\n .option(\n '-f, --files [files...]',\n 'List of Content Declaration files to audit'\n )\n .option(\n '--exclude [excludedGlobs...]',\n 'Globs pattern to exclude from the audit'\n )\n .option('-m, --model [model]', 'Model')\n .option('-p, --custom-prompt [prompt]', 'Custom prompt')\n .option('-l, --async-limit [asyncLimit]', 'Async limit')\n .option('-k, --open-ai-api-key [openAiApiKey]', 'OpenAI API key')\n .action(audit);\n\n program.parse(process.argv);\n\n return program;\n};\n"],"mappings":"AAAA,SAAS,eAAe;AACxB,SAAS,aAAa;AACtB,SAAS,aAAa;AACtB,SAAS,iBAAiB;AAC1B,SAAS,8BAA8B;AACvC,SAAS,YAAY;AACrB,SAAS,YAAY;AACrB,SAAS,kBAAkB;AAUpB,MAAM,SAAS,MAAe;AACnC,QAAM,UAAU,IAAI,QAAQ;AAE5B,UAAQ,QAAQ,OAAO,EAAE,YAAY,cAAc;AAEnD,UACG,QAAQ,OAAO,EACf,YAAY,wBAAwB,EACpC,OAAO,eAAe,mBAAmB,EACzC,OAAO,KAAK;AAMf,QAAM,sBAAsB,QACzB,QAAQ,cAAc,EACtB,YAAY,yBAAyB;AAExC,sBACG,QAAQ,MAAM,EACd,OAAO,+BAA+B,gCAAgC,EACtE,OAAO,gCAAgC,mCAAmC,EAC1E,OAAO,IAAI;AAGd,sBACG,QAAQ,MAAM,EACd;AAAA,IACC;AAAA,EACF,EACC,OAAO,+BAA+B,gCAAgC,EACtE;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC,OAAO,IAAI;AAMd,QAAM,uBAAuB,QAC1B,QAAQ,QAAQ,EAChB,YAAY,0BAA0B;AAEzC,uBACG,QAAQ,KAAK,EACb,YAAY,uBAAuB,EACnC,OAAO,eAAe,aAAa,EACnC,OAAO,wBAAwB,kBAAkB,EACjD,OAAO,aAAa,SAAS,EAC7B,OAAO,SAAS;AAGnB,uBACG,QAAQ,MAAM,EACd,YAAY,wBAAwB,EACpC,OAAO,eAAe,aAAa,EACnC,OAAO,wBAAwB,kBAAkB,EACjD,OAAO,aAAa,SAAS,EAC7B,OAAO,UAAU;AAMpB,UACG,QAAQ,cAAc,EACtB,YAAY,oCAAoC,EAChD,OAAO,sBAAsB;AAEhC,UACG,QAAQ,OAAO,EACf,YAAY,wBAAwB,EACpC;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC;AAAA,IACC;AAAA,IACA;AAAA,EACF,EACC,OAAO,uBAAuB,OAAO,EACrC,OAAO,gCAAgC,eAAe,EACtD,OAAO,kCAAkC,aAAa,EACtD,OAAO,wCAAwC,gBAAgB,EAC/D,OAAO,KAAK;AAEf,UAAQ,MAAM,QAAQ,IAAI;AAE1B,SAAO;AACT;","names":[]}
|
package/dist/esm/config.mjs
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
getConfiguration,
|
|
3
|
+
logger
|
|
4
|
+
} from "@intlayer/config";
|
|
2
5
|
const getConfig = (options) => {
|
|
3
|
-
const config = getConfiguration();
|
|
6
|
+
const config = getConfiguration(options);
|
|
4
7
|
logger(JSON.stringify(config, null, 2), {
|
|
5
8
|
config: {
|
|
6
9
|
prefix: options?.logPrefix
|
package/dist/esm/config.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/config.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../../src/config.ts"],"sourcesContent":["import {\n getConfiguration,\n type GetConfigurationOptions,\n logger,\n} from '@intlayer/config';\n\ntype ConfigOptions = {\n logPrefix?: string;\n} & GetConfigurationOptions;\n\nexport const getConfig = (options?: ConfigOptions) => {\n const config = getConfiguration(options);\n\n logger(JSON.stringify(config, null, 2), {\n config: {\n prefix: options?.logPrefix,\n },\n });\n};\n"],"mappings":"AAAA;AAAA,EACE;AAAA,EAEA;AAAA,OACK;AAMA,MAAM,YAAY,CAAC,YAA4B;AACpD,QAAM,SAAS,iBAAiB,OAAO;AAEvC,SAAO,KAAK,UAAU,QAAQ,MAAM,CAAC,GAAG;AAAA,IACtC,QAAQ;AAAA,MACN,QAAQ,SAAS;AAAA,IACnB;AAAA,EACF,CAAC;AACH;","names":[]}
|
package/dist/esm/pushConfig.mjs
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { getIntlayerAPI } from "@intlayer/api";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
getConfiguration,
|
|
4
|
+
logger
|
|
5
|
+
} from "@intlayer/config";
|
|
3
6
|
const pushConfig = async (options) => {
|
|
4
|
-
const config = getConfiguration();
|
|
7
|
+
const config = getConfiguration(options);
|
|
5
8
|
const { clientId, clientSecret } = config.editor;
|
|
6
9
|
if (!clientId || !clientSecret) {
|
|
7
10
|
logger(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/pushConfig.ts"],"sourcesContent":["import { getIntlayerAPI } from '@intlayer/api';\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/pushConfig.ts"],"sourcesContent":["import { getIntlayerAPI } from '@intlayer/api';\nimport {\n getConfiguration,\n logger,\n type GetConfigurationOptions,\n} from '@intlayer/config';\n\ntype PushOptions = {\n logPrefix?: string;\n} & GetConfigurationOptions;\n\nexport const pushConfig = async (options?: PushOptions) => {\n const config = getConfiguration(options);\n\n const { clientId, clientSecret } = config.editor;\n\n if (!clientId || !clientSecret) {\n logger(\n 'Missing OAuth2 client ID or client secret. To get access token go to https://intlayer.org/dashboard/project.',\n {\n level: 'error',\n config: {\n prefix: options?.logPrefix,\n },\n }\n );\n return;\n }\n\n const intlayerAPI = getIntlayerAPI(undefined, config);\n\n const oAuth2TokenResult = await intlayerAPI.auth.getOAuth2AccessToken();\n\n const oAuth2AccessToken = oAuth2TokenResult.data?.accessToken;\n\n // Get the list of dictionary keys\n const getDictionariesKeysResult =\n await intlayerAPI.project.pushProjectConfiguration(config, {\n headers: { Authorization: `Bearer ${oAuth2AccessToken}` },\n });\n\n if (!getDictionariesKeysResult.data) {\n throw new Error('Error pushing project configuration');\n }\n\n logger('Project configuration pushed successfully', {\n config: {\n prefix: options?.logPrefix,\n },\n });\n\n logger(JSON.stringify(getDictionariesKeysResult.data, null, 2), {\n config: {\n prefix: options?.logPrefix,\n },\n });\n};\n"],"mappings":"AAAA,SAAS,sBAAsB;AAC/B;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AAMA,MAAM,aAAa,OAAO,YAA0B;AACzD,QAAM,SAAS,iBAAiB,OAAO;AAEvC,QAAM,EAAE,UAAU,aAAa,IAAI,OAAO;AAE1C,MAAI,CAAC,YAAY,CAAC,cAAc;AAC9B;AAAA,MACE;AAAA,MACA;AAAA,QACE,OAAO;AAAA,QACP,QAAQ;AAAA,UACN,QAAQ,SAAS;AAAA,QACnB;AAAA,MACF;AAAA,IACF;AACA;AAAA,EACF;AAEA,QAAM,cAAc,eAAe,QAAW,MAAM;AAEpD,QAAM,oBAAoB,MAAM,YAAY,KAAK,qBAAqB;AAEtE,QAAM,oBAAoB,kBAAkB,MAAM;AAGlD,QAAM,4BACJ,MAAM,YAAY,QAAQ,yBAAyB,QAAQ;AAAA,IACzD,SAAS,EAAE,eAAe,UAAU,iBAAiB,GAAG;AAAA,EAC1D,CAAC;AAEH,MAAI,CAAC,0BAA0B,MAAM;AACnC,UAAM,IAAI,MAAM,qCAAqC;AAAA,EACvD;AAEA,SAAO,6CAA6C;AAAA,IAClD,QAAQ;AAAA,MACN,QAAQ,SAAS;AAAA,IACnB;AAAA,EACF,CAAC;AAED,SAAO,KAAK,UAAU,0BAA0B,MAAM,MAAM,CAAC,GAAG;AAAA,IAC9D,QAAQ;AAAA,MACN,QAAQ,SAAS;AAAA,IACnB;AAAA,EACF,CAAC;AACH;","names":[]}
|
package/dist/types/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AASpC;;;;;;;GAOG;AACH,eAAO,MAAM,MAAM,QAAO,
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AASpC;;;;;;;GAOG;AACH,eAAO,MAAM,MAAM,QAAO,OAgGzB,CAAC"}
|
package/dist/types/config.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { type GetConfigurationOptions } from '@intlayer/config';
|
|
1
2
|
type ConfigOptions = {
|
|
2
3
|
logPrefix?: string;
|
|
3
|
-
};
|
|
4
|
+
} & GetConfigurationOptions;
|
|
4
5
|
export declare const getConfig: (options?: ConfigOptions) => void;
|
|
5
6
|
export {};
|
|
6
7
|
//# sourceMappingURL=config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,uBAAuB,EAE7B,MAAM,kBAAkB,CAAC;AAE1B,KAAK,aAAa,GAAG;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,uBAAuB,CAAC;AAE5B,eAAO,MAAM,SAAS,aAAc,aAAa,SAQhD,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { type GetConfigurationOptions } from '@intlayer/config';
|
|
1
2
|
type PushOptions = {
|
|
2
3
|
logPrefix?: string;
|
|
3
|
-
|
|
4
|
-
};
|
|
4
|
+
} & GetConfigurationOptions;
|
|
5
5
|
export declare const pushConfig: (options?: PushOptions) => Promise<void>;
|
|
6
6
|
export {};
|
|
7
7
|
//# sourceMappingURL=pushConfig.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pushConfig.d.ts","sourceRoot":"","sources":["../../src/pushConfig.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pushConfig.d.ts","sourceRoot":"","sources":["../../src/pushConfig.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,uBAAuB,EAC7B,MAAM,kBAAkB,CAAC;AAE1B,KAAK,WAAW,GAAG;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,uBAAuB,CAAC;AAE5B,eAAO,MAAM,UAAU,aAAoB,WAAW,kBA6CrD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlayer/cli",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.8",
|
|
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": [
|
|
@@ -51,11 +51,11 @@
|
|
|
51
51
|
"commander": "^13.0.0",
|
|
52
52
|
"fast-glob": "^3.3.3",
|
|
53
53
|
"p-limit": "^3.1.0",
|
|
54
|
-
"@intlayer/api": "4.1.
|
|
55
|
-
"@intlayer/chokidar": "4.1.
|
|
56
|
-
"@intlayer/
|
|
57
|
-
"@intlayer/
|
|
58
|
-
"@intlayer/editor": "4.1.
|
|
54
|
+
"@intlayer/api": "4.1.8",
|
|
55
|
+
"@intlayer/chokidar": "4.1.8",
|
|
56
|
+
"@intlayer/dictionaries-entry": "4.1.8",
|
|
57
|
+
"@intlayer/config": "4.1.8",
|
|
58
|
+
"@intlayer/editor": "4.1.8"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@types/node": "^22.10.6",
|
|
@@ -67,18 +67,18 @@
|
|
|
67
67
|
"tsc-alias": "^1.8.10",
|
|
68
68
|
"tsup": "^8.3.5",
|
|
69
69
|
"typescript": "^5.7.3",
|
|
70
|
-
"@intlayer/core": "4.1.7",
|
|
71
|
-
"@utils/eslint-config": "1.0.4",
|
|
72
70
|
"@utils/ts-config": "1.0.4",
|
|
71
|
+
"@utils/eslint-config": "1.0.4",
|
|
72
|
+
"@intlayer/core": "4.1.8",
|
|
73
73
|
"@utils/ts-config-types": "1.0.4",
|
|
74
74
|
"@utils/tsup-config": "1.0.4"
|
|
75
75
|
},
|
|
76
76
|
"peerDependencies": {
|
|
77
|
-
"@intlayer/
|
|
78
|
-
"@intlayer/
|
|
79
|
-
"@intlayer/config": "4.1.
|
|
80
|
-
"@intlayer/
|
|
81
|
-
"@intlayer/
|
|
77
|
+
"@intlayer/api": "4.1.8",
|
|
78
|
+
"@intlayer/chokidar": "4.1.8",
|
|
79
|
+
"@intlayer/config": "4.1.8",
|
|
80
|
+
"@intlayer/dictionaries-entry": "^4.1.8",
|
|
81
|
+
"@intlayer/editor": "4.1.8"
|
|
82
82
|
},
|
|
83
83
|
"bug": {
|
|
84
84
|
"url": "https://github.com/aymericzip/intlayer/issues"
|
|
@@ -93,6 +93,7 @@
|
|
|
93
93
|
"lint:fix": "eslint . --cache --fix",
|
|
94
94
|
"prettier": "prettier . --check",
|
|
95
95
|
"prettier:fix": "prettier . --write",
|
|
96
|
+
"reset": "pnpm clean & pnpm build",
|
|
96
97
|
"test": ""
|
|
97
98
|
}
|
|
98
99
|
}
|