@open-mercato/sync-akeneo 0.10.1-develop.8231.1.ae76b1d2c5 → 0.10.1-develop.8258.1.62a94b74a2
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.
|
@@ -1,25 +1,8 @@
|
|
|
1
|
+
import { parseModuleCliOptions } from "@open-mercato/shared/lib/cli/parseModuleCliOptions";
|
|
1
2
|
import { createRequestContainer } from "@open-mercato/shared/lib/di/container";
|
|
2
3
|
import { applyAkeneoEnvPreset, readAkeneoEnvPreset } from "./lib/preset.js";
|
|
3
4
|
function parseArgs(args) {
|
|
4
|
-
|
|
5
|
-
for (let i = 0; i < args.length; i++) {
|
|
6
|
-
const arg = args[i];
|
|
7
|
-
if (!arg.startsWith("--")) continue;
|
|
8
|
-
const key = arg.slice(2);
|
|
9
|
-
if (key.includes("=")) {
|
|
10
|
-
const [name, value] = key.split("=");
|
|
11
|
-
result[name] = value;
|
|
12
|
-
continue;
|
|
13
|
-
}
|
|
14
|
-
const next = args[i + 1];
|
|
15
|
-
if (next && !next.startsWith("--")) {
|
|
16
|
-
result[key] = next;
|
|
17
|
-
i += 1;
|
|
18
|
-
continue;
|
|
19
|
-
}
|
|
20
|
-
result[key] = true;
|
|
21
|
-
}
|
|
22
|
-
return result;
|
|
5
|
+
return parseModuleCliOptions(args);
|
|
23
6
|
}
|
|
24
7
|
function printHelp() {
|
|
25
8
|
console.log("Usage: yarn mercato sync_akeneo configure-from-env --tenant <tenantId> --org <organizationId> [--force]");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/modules/sync_akeneo/cli.ts"],
|
|
4
|
-
"sourcesContent": ["import type { ModuleCli } from '@open-mercato/shared/modules/registry'\nimport type { EntityManager } from '@mikro-orm/postgresql'\nimport { createRequestContainer } from '@open-mercato/shared/lib/di/container'\nimport type { CredentialsService } from '@open-mercato/core/modules/integrations/lib/credentials-service'\nimport type { IntegrationStateService } from '@open-mercato/core/modules/integrations/lib/state-service'\nimport type { IntegrationLogService } from '@open-mercato/core/modules/integrations/lib/log-service'\nimport { applyAkeneoEnvPreset, readAkeneoEnvPreset } from './lib/preset'\n\nfunction parseArgs(args: string[]): Record<string, string | boolean> {\n
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import { parseModuleCliOptions } from '@open-mercato/shared/lib/cli/parseModuleCliOptions'\nimport type { ModuleCli } from '@open-mercato/shared/modules/registry'\nimport type { EntityManager } from '@mikro-orm/postgresql'\nimport { createRequestContainer } from '@open-mercato/shared/lib/di/container'\nimport type { CredentialsService } from '@open-mercato/core/modules/integrations/lib/credentials-service'\nimport type { IntegrationStateService } from '@open-mercato/core/modules/integrations/lib/state-service'\nimport type { IntegrationLogService } from '@open-mercato/core/modules/integrations/lib/log-service'\nimport { applyAkeneoEnvPreset, readAkeneoEnvPreset } from './lib/preset'\n\nfunction parseArgs(args: string[]): Record<string, string | boolean> {\n return parseModuleCliOptions(args)\n}\n\nfunction printHelp(): void {\n console.log('Usage: yarn mercato sync_akeneo configure-from-env --tenant <tenantId> --org <organizationId> [--force]')\n console.log('')\n console.log('Required env vars:')\n console.log(' OM_INTEGRATION_AKENEO_API_URL')\n console.log(' OM_INTEGRATION_AKENEO_CLIENT_ID')\n console.log(' OM_INTEGRATION_AKENEO_CLIENT_SECRET')\n console.log(' OM_INTEGRATION_AKENEO_USERNAME')\n console.log(' OM_INTEGRATION_AKENEO_PASSWORD')\n console.log('')\n console.log('Optional env vars:')\n console.log(' OM_INTEGRATION_AKENEO_PRODUCT_LOCALE')\n console.log(' OM_INTEGRATION_AKENEO_CATEGORY_LOCALE')\n console.log(' OM_INTEGRATION_AKENEO_PRODUCT_CHANNEL')\n console.log(' OM_INTEGRATION_AKENEO_IMPORT_CHANNELS')\n console.log(' OM_INTEGRATION_AKENEO_IMPORT_ALL_CHANNELS')\n console.log(' OM_INTEGRATION_AKENEO_CREATE_MISSING_CHANNELS')\n console.log(' OM_INTEGRATION_AKENEO_SYNC_ASSOCIATIONS')\n console.log(' OM_INTEGRATION_AKENEO_ATTRIBUTE_FAMILY_FILTER')\n console.log(' OM_INTEGRATION_AKENEO_PRODUCTS_SETTINGS_JSON')\n console.log(' OM_INTEGRATION_AKENEO_CATEGORIES_SETTINGS_JSON')\n console.log(' OM_INTEGRATION_AKENEO_ATTRIBUTES_SETTINGS_JSON')\n console.log('')\n console.log('Legacy aliases still work:')\n console.log(' OPENMERCATO_AKENEO_*')\n console.log(' AKENEO_*')\n}\n\nconst configureFromEnvCommand: ModuleCli = {\n command: 'configure-from-env',\n async run(rest) {\n const args = parseArgs(rest)\n const tenantId = String(args.tenantId ?? args.tenant ?? '')\n const organizationId = String(args.organizationId ?? args.orgId ?? args.org ?? '')\n const force = args.force === true\n\n if (!tenantId || !organizationId) {\n printHelp()\n return\n }\n\n const preset = readAkeneoEnvPreset()\n if (!preset) {\n console.error('[sync_akeneo] No Akeneo env preset was found.')\n printHelp()\n process.exitCode = 1\n return\n }\n\n const container = await createRequestContainer()\n try {\n const em = container.resolve('em') as EntityManager\n const credentialsService = container.resolve('integrationCredentialsService') as CredentialsService\n const integrationStateService = container.resolve('integrationStateService') as IntegrationStateService\n const integrationLogService = container.resolve('integrationLogService') as IntegrationLogService\n\n const result = await applyAkeneoEnvPreset({\n em,\n credentialsService,\n integrationStateService,\n integrationLogService,\n scope: { tenantId, organizationId },\n force,\n })\n\n if (result.status === 'skipped') {\n console.log(`[sync_akeneo] Skipped: ${result.reason}`)\n return\n }\n\n console.log('[sync_akeneo] Akeneo credentials and mappings were configured from env.')\n } catch (error) {\n const message = error instanceof Error ? error.message : 'Unknown Akeneo preset error'\n console.error(`[sync_akeneo] ${message}`)\n process.exitCode = 1\n } finally {\n const disposable = container as unknown as { dispose?: () => Promise<void> }\n if (typeof disposable.dispose === 'function') {\n await disposable.dispose()\n }\n }\n },\n}\n\nconst helpCommand: ModuleCli = {\n command: 'help',\n async run() {\n printHel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
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -53,21 +53,21 @@
|
|
|
53
53
|
}
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@open-mercato/core": "0.10.1-develop.
|
|
57
|
-
"@open-mercato/ui": "0.10.1-develop.
|
|
56
|
+
"@open-mercato/core": "0.10.1-develop.8258.1.62a94b74a2",
|
|
57
|
+
"@open-mercato/ui": "0.10.1-develop.8258.1.62a94b74a2",
|
|
58
58
|
"node-html-markdown": "^2.0.0"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
61
|
"@mikro-orm/postgresql": "^7.0.14",
|
|
62
|
-
"@open-mercato/ai-assistant": "0.10.1-develop.
|
|
63
|
-
"@open-mercato/shared": "0.10.1-develop.
|
|
62
|
+
"@open-mercato/ai-assistant": "0.10.1-develop.8258.1.62a94b74a2",
|
|
63
|
+
"@open-mercato/shared": "0.10.1-develop.8258.1.62a94b74a2",
|
|
64
64
|
"react": "^19.0.0",
|
|
65
65
|
"react-dom": "^19.0.0",
|
|
66
66
|
"react-is": ">=18.0.0"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
|
-
"@open-mercato/ai-assistant": "0.10.1-develop.
|
|
70
|
-
"@open-mercato/shared": "0.10.1-develop.
|
|
69
|
+
"@open-mercato/ai-assistant": "0.10.1-develop.8258.1.62a94b74a2",
|
|
70
|
+
"@open-mercato/shared": "0.10.1-develop.8258.1.62a94b74a2",
|
|
71
71
|
"@types/jest": "^30.0.0",
|
|
72
72
|
"@types/react": "^19.2.18",
|
|
73
73
|
"@types/react-dom": "^19.2.5",
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { parseModuleCliOptions } from '@open-mercato/shared/lib/cli/parseModuleCliOptions'
|
|
1
2
|
import type { ModuleCli } from '@open-mercato/shared/modules/registry'
|
|
2
3
|
import type { EntityManager } from '@mikro-orm/postgresql'
|
|
3
4
|
import { createRequestContainer } from '@open-mercato/shared/lib/di/container'
|
|
@@ -7,30 +8,7 @@ import type { IntegrationLogService } from '@open-mercato/core/modules/integrati
|
|
|
7
8
|
import { applyAkeneoEnvPreset, readAkeneoEnvPreset } from './lib/preset'
|
|
8
9
|
|
|
9
10
|
function parseArgs(args: string[]): Record<string, string | boolean> {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
for (let i = 0; i < args.length; i++) {
|
|
13
|
-
const arg = args[i]
|
|
14
|
-
if (!arg.startsWith('--')) continue
|
|
15
|
-
|
|
16
|
-
const key = arg.slice(2)
|
|
17
|
-
if (key.includes('=')) {
|
|
18
|
-
const [name, value] = key.split('=')
|
|
19
|
-
result[name] = value
|
|
20
|
-
continue
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const next = args[i + 1]
|
|
24
|
-
if (next && !next.startsWith('--')) {
|
|
25
|
-
result[key] = next
|
|
26
|
-
i += 1
|
|
27
|
-
continue
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
result[key] = true
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
return result
|
|
11
|
+
return parseModuleCliOptions(args)
|
|
34
12
|
}
|
|
35
13
|
|
|
36
14
|
function printHelp(): void {
|