@open-mercato/cli 0.10.1-develop.7741.1.61a2652671 → 0.10.1-develop.7748.1.d745ba61aa
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/agentic/guides/module-facts.json +255 -175
- package/dist/agentic/guides/module-facts.v2.json +255 -175
- package/dist/agentic/guides/modules/agent_orchestrator/index.md +1 -1
- package/dist/agentic/guides/modules/ai_assistant/index.md +1 -1
- package/dist/agentic/guides/modules/api_docs/index.md +1 -1
- package/dist/agentic/guides/modules/api_keys/index.md +1 -1
- package/dist/agentic/guides/modules/attachments/active-extension-bindings.md +11 -0
- package/dist/agentic/guides/modules/attachments/di-registrations-rich.md +6 -6
- package/dist/agentic/guides/modules/attachments/di-service-tokens.md +5 -5
- package/dist/agentic/guides/modules/attachments/exact-override-targets.md +9 -7
- package/dist/agentic/guides/modules/attachments/generator-plugins.md +11 -0
- package/dist/agentic/guides/modules/attachments/index.md +4 -2
- package/dist/agentic/guides/modules/attachments/setup.md +1 -1
- package/dist/agentic/guides/modules/audit_logs/index.md +1 -1
- package/dist/agentic/guides/modules/auth/index.md +1 -1
- package/dist/agentic/guides/modules/availability/index.md +1 -1
- package/dist/agentic/guides/modules/business_rules/index.md +1 -1
- package/dist/agentic/guides/modules/carrier_inpost/index.md +1 -1
- package/dist/agentic/guides/modules/cart/index.md +1 -1
- package/dist/agentic/guides/modules/catalog/index.md +1 -1
- package/dist/agentic/guides/modules/channel_apns/index.md +1 -1
- package/dist/agentic/guides/modules/channel_discord/index.md +1 -1
- package/dist/agentic/guides/modules/channel_expo/index.md +1 -1
- package/dist/agentic/guides/modules/channel_fcm/index.md +1 -1
- package/dist/agentic/guides/modules/channel_gmail/index.md +1 -1
- package/dist/agentic/guides/modules/channel_imap/index.md +1 -1
- package/dist/agentic/guides/modules/channel_resend/index.md +1 -1
- package/dist/agentic/guides/modules/channel_ses/index.md +1 -1
- package/dist/agentic/guides/modules/checkout/index.md +1 -1
- package/dist/agentic/guides/modules/communication_channels/index.md +1 -1
- package/dist/agentic/guides/modules/configs/index.md +1 -1
- package/dist/agentic/guides/modules/content/index.md +1 -1
- package/dist/agentic/guides/modules/currencies/index.md +1 -1
- package/dist/agentic/guides/modules/customer_accounts/index.md +1 -1
- package/dist/agentic/guides/modules/customer_groups/index.md +1 -1
- package/dist/agentic/guides/modules/customers/index.md +1 -1
- package/dist/agentic/guides/modules/dashboards/index.md +1 -1
- package/dist/agentic/guides/modules/data_sync/index.md +1 -1
- package/dist/agentic/guides/modules/design_system/index.md +1 -1
- package/dist/agentic/guides/modules/devices/index.md +1 -1
- package/dist/agentic/guides/modules/dictionaries/index.md +1 -1
- package/dist/agentic/guides/modules/directory/index.md +1 -1
- package/dist/agentic/guides/modules/documents/index.md +1 -1
- package/dist/agentic/guides/modules/ecommerce/index.md +1 -1
- package/dist/agentic/guides/modules/entities/index.md +1 -1
- package/dist/agentic/guides/modules/eudr/index.md +1 -1
- package/dist/agentic/guides/modules/events/index.md +1 -1
- package/dist/agentic/guides/modules/feature_toggles/index.md +1 -1
- package/dist/agentic/guides/modules/forms/index.md +1 -1
- package/dist/agentic/guides/modules/gateway_autopay/index.md +1 -1
- package/dist/agentic/guides/modules/gateway_stripe/index.md +1 -1
- package/dist/agentic/guides/modules/gateway_tpay/index.md +1 -1
- package/dist/agentic/guides/modules/generators/index.md +1 -1
- package/dist/agentic/guides/modules/inbox_ops/index.md +1 -1
- package/dist/agentic/guides/modules/integrations/index.md +1 -1
- package/dist/agentic/guides/modules/messages/index.md +1 -1
- package/dist/agentic/guides/modules/notifications/index.md +1 -1
- package/dist/agentic/guides/modules/onboarding/index.md +1 -1
- package/dist/agentic/guides/modules/payment_gateways/index.md +1 -1
- package/dist/agentic/guides/modules/perspectives/index.md +1 -1
- package/dist/agentic/guides/modules/phone_calls/index.md +1 -1
- package/dist/agentic/guides/modules/planner/index.md +1 -1
- package/dist/agentic/guides/modules/portal/index.md +1 -1
- package/dist/agentic/guides/modules/progress/index.md +1 -1
- package/dist/agentic/guides/modules/promotions/index.md +1 -1
- package/dist/agentic/guides/modules/push_notifications/index.md +1 -1
- package/dist/agentic/guides/modules/query_index/index.md +1 -1
- package/dist/agentic/guides/modules/record_locks/index.md +1 -1
- package/dist/agentic/guides/modules/resources/index.md +1 -1
- package/dist/agentic/guides/modules/sales/index.md +1 -1
- package/dist/agentic/guides/modules/scheduler/index.md +1 -1
- package/dist/agentic/guides/modules/search/index.md +1 -1
- package/dist/agentic/guides/modules/security/index.md +1 -1
- package/dist/agentic/guides/modules/seeds/index.md +1 -1
- package/dist/agentic/guides/modules/shipping_carriers/index.md +1 -1
- package/dist/agentic/guides/modules/sso/index.md +1 -1
- package/dist/agentic/guides/modules/staff/index.md +1 -1
- package/dist/agentic/guides/modules/storage_s3/index.md +1 -1
- package/dist/agentic/guides/modules/sync_akeneo/index.md +1 -1
- package/dist/agentic/guides/modules/sync_excel/index.md +1 -1
- package/dist/agentic/guides/modules/system_status_overlays/index.md +1 -1
- package/dist/agentic/guides/modules/telemetry/index.md +1 -1
- package/dist/agentic/guides/modules/tillio/index.md +1 -1
- package/dist/agentic/guides/modules/translations/index.md +1 -1
- package/dist/agentic/guides/modules/warranty_claims/index.md +1 -1
- package/dist/agentic/guides/modules/webhooks/index.md +1 -1
- package/dist/agentic/guides/modules/wms/index.md +1 -1
- package/dist/agentic/guides/modules/workflows/index.md +1 -1
- package/dist/agentic/guides/reference-module-facts.json +1 -1
- package/dist/agentic/guides/upstream/BACKWARD_COMPATIBILITY.md +78 -72
- package/dist/agentic/guides/upstream/manifest.json +2 -2
- package/package.json +7 -7
- package/src/lib/generators/__tests__/attachment-access.test.ts +70 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import fs from 'node:fs'
|
|
2
|
+
import os from 'node:os'
|
|
3
|
+
import path from 'node:path'
|
|
4
|
+
import ts from 'typescript-js'
|
|
5
|
+
import type { ModuleEntry, PackageResolver } from '../../resolver'
|
|
6
|
+
import { generateModuleRegistry } from '../module-registry'
|
|
7
|
+
|
|
8
|
+
const REPO_ROOT = path.resolve(__dirname, '../../../../../..')
|
|
9
|
+
let fixtureRoot: string
|
|
10
|
+
|
|
11
|
+
function write(relative: string, content: string): void {
|
|
12
|
+
const target = path.join(fixtureRoot, relative)
|
|
13
|
+
fs.mkdirSync(path.dirname(target), { recursive: true })
|
|
14
|
+
fs.writeFileSync(target, content)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
beforeEach(() => { fixtureRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'attachment-access-generator-')) })
|
|
18
|
+
afterEach(() => fs.rmSync(fixtureRoot, { recursive: true, force: true }))
|
|
19
|
+
|
|
20
|
+
it.each([false, true])('discovers nested attachment policies and removes disabled adopters (standalone=%s)', async (standalone) => {
|
|
21
|
+
const packageRoot = standalone ? 'node_modules/fixture' : 'packages/core'
|
|
22
|
+
const moduleRoot = `${packageRoot}/${standalone ? 'dist' : 'src'}/modules`
|
|
23
|
+
const extension = standalone ? 'js' : 'ts'
|
|
24
|
+
const source = fs.readFileSync(path.join(REPO_ROOT, 'packages/core/src/modules/attachments/generators.ts'), 'utf8')
|
|
25
|
+
const compiled = ts.transpileModule(source, {
|
|
26
|
+
compilerOptions: { module: ts.ModuleKind.CommonJS, target: ts.ScriptTarget.ES2022 },
|
|
27
|
+
}).outputText
|
|
28
|
+
write(`${moduleRoot}/attachments/generators.${extension}`, compiled)
|
|
29
|
+
write(`${moduleRoot}/documents/data/attachment-access.${extension}`, 'export const attachmentAccessResolvers = []; export const protectedAttachmentTargets = []')
|
|
30
|
+
write(`${moduleRoot}/clinical/data/attachment-access.${extension}`, 'export const attachmentAccessResolvers = []')
|
|
31
|
+
const outputDir = path.join(fixtureRoot, '.mercato/generated')
|
|
32
|
+
const entries: ModuleEntry[] = [
|
|
33
|
+
{ id: 'attachments', from: '@open-mercato/core' },
|
|
34
|
+
{ id: 'documents', from: '@open-mercato/documents' },
|
|
35
|
+
{ id: 'clinical', from: '@open-mercato/core' },
|
|
36
|
+
]
|
|
37
|
+
const resolver: PackageResolver = {
|
|
38
|
+
isMonorepo: () => !standalone,
|
|
39
|
+
getRootDir: () => fixtureRoot,
|
|
40
|
+
getAppDir: () => fixtureRoot,
|
|
41
|
+
getOutputDir: () => outputDir,
|
|
42
|
+
getModulesConfigPath: () => path.join(fixtureRoot, 'src/modules.ts'),
|
|
43
|
+
discoverPackages: () => [],
|
|
44
|
+
loadEnabledModules: () => entries,
|
|
45
|
+
getModulePaths: (entry) => ({
|
|
46
|
+
appBase: path.join(fixtureRoot, 'src/modules', entry.id),
|
|
47
|
+
pkgBase: path.join(fixtureRoot, moduleRoot, entry.id),
|
|
48
|
+
}),
|
|
49
|
+
getModuleImportBase: (entry) => ({
|
|
50
|
+
appBase: `@/modules/${entry.id}`,
|
|
51
|
+
pkgBase: `${entry.from}/modules/${entry.id}`,
|
|
52
|
+
}),
|
|
53
|
+
getPackageOutputDir: () => outputDir,
|
|
54
|
+
getPackageRoot: () => path.join(fixtureRoot, packageRoot),
|
|
55
|
+
}
|
|
56
|
+
const first = await generateModuleRegistry({ resolver, quiet: true })
|
|
57
|
+
expect(first.errors).toEqual([])
|
|
58
|
+
const read = (name: string) => fs.readFileSync(path.join(outputDir, name), 'utf8')
|
|
59
|
+
const registry = read('attachment-access.generated.ts')
|
|
60
|
+
expect(registry).toContain('@open-mercato/documents/modules/documents/data/attachment-access')
|
|
61
|
+
expect(registry).toContain('protectedAttachmentTargets')
|
|
62
|
+
expect(registry.indexOf("moduleId: 'documents'")).toBeLessThan(registry.indexOf("moduleId: 'clinical'"))
|
|
63
|
+
expect(read('bootstrap-registrations.generated.ts')).toContain('registerAttachmentAccessResolvers(attachmentAccessEntries)')
|
|
64
|
+
|
|
65
|
+
entries.splice(1, 1)
|
|
66
|
+
const second = await generateModuleRegistry({ resolver, quiet: true })
|
|
67
|
+
expect(second.errors).toEqual([])
|
|
68
|
+
expect(read('attachment-access.generated.ts')).not.toContain('documents/data/attachment-access')
|
|
69
|
+
expect(read('attachment-access.generated.ts')).toContain('clinical/data/attachment-access')
|
|
70
|
+
})
|