@nexusclawhq/cli 0.3.55 → 0.3.57
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/CHANGELOG.md +23 -0
- package/dist/build-info.json +5 -5
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/agent-executable-assets/employee-eval-cases.types.d.ts +6 -0
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/agent-executable-assets/employee-eval-cases.types.js +11 -0
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/agent-executable-assets/employee-eval-cases.types.js.map +1 -1
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/employee-package/effective-agent-manifest.d.ts +103 -0
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/employee-package/effective-agent-manifest.js +128 -0
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/employee-package/effective-agent-manifest.js.map +1 -0
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/employee-package/index.d.ts +1 -0
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/employee-package/index.js +6 -1
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/employee-package/index.js.map +1 -1
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/employee-package/validator.d.ts +1 -0
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/employee-package/validator.js +13 -2
- package/dist/nexus-cli/node_modules/@nexusclaw/shared/dist/employee-package/validator.js.map +1 -1
- package/dist/nexus-cli/src/cli.js +1 -1
- package/dist/nexus-cli/src/cli.js.map +1 -1
- package/dist/nexus-cli/src/commands/ai/help.test.js +4 -4
- package/dist/nexus-cli/src/commands/commands.test.js +2 -2
- package/dist/nexus-cli/src/commands/commands.test.js.map +1 -1
- package/dist/nexus-cli/src/commands/dx-pages.js +2 -1
- package/dist/nexus-cli/src/commands/dx-pages.js.map +1 -1
- package/dist/nexus-cli/src/commands/dx-release-boundary.e2e.test.js +11 -7
- package/dist/nexus-cli/src/commands/dx-release-boundary.e2e.test.js.map +1 -1
- package/dist/nexus-cli/src/commands/dx-workflows.e2e.test.js +12 -4
- package/dist/nexus-cli/src/commands/dx-workflows.e2e.test.js.map +1 -1
- package/dist/nexus-cli/src/commands/dx.js +3 -1
- package/dist/nexus-cli/src/commands/dx.js.map +1 -1
- package/dist/nexus-cli/src/commands/employee/bundle.js +1 -1
- package/dist/nexus-cli/src/commands/employee/bundle.js.map +1 -1
- package/dist/nexus-cli/src/commands/generate/class.js +13 -5
- package/dist/nexus-cli/src/commands/generate/class.js.map +1 -1
- package/dist/nexus-cli/src/commands/generate/component.js +15 -5
- package/dist/nexus-cli/src/commands/generate/component.js.map +1 -1
- package/dist/nexus-cli/src/commands/generate/project.js +32 -0
- package/dist/nexus-cli/src/commands/generate/project.js.map +1 -1
- package/dist/nexus-cli/src/commands/generate/project.test.js +25 -0
- package/dist/nexus-cli/src/commands/generate/project.test.js.map +1 -1
- package/dist/nexus-cli/src/commands/generate/trigger.js +13 -5
- package/dist/nexus-cli/src/commands/generate/trigger.js.map +1 -1
- package/dist/nexus-cli/src/commands/package/pack.js +3 -0
- package/dist/nexus-cli/src/commands/package/pack.js.map +1 -1
- package/dist/nexus-cli/src/commands/package/package-lifecycle.e2e.test.js +19 -0
- package/dist/nexus-cli/src/commands/package/package-lifecycle.e2e.test.js.map +1 -1
- package/dist/nexus-cli/src/commands/project/deploy-start.js +2 -0
- package/dist/nexus-cli/src/commands/project/deploy-start.js.map +1 -1
- package/dist/nexus-cli/src/commands/project/index.js +57 -0
- package/dist/nexus-cli/src/commands/project/index.js.map +1 -1
- package/dist/nexus-cli/src/commands/source/get.js +3 -1
- package/dist/nexus-cli/src/commands/source/get.js.map +1 -1
- package/dist/nexus-cli/src/commands/source/pull.js +66 -87
- package/dist/nexus-cli/src/commands/source/pull.js.map +1 -1
- package/dist/nexus-cli/src/commands/source/push.js +91 -1
- package/dist/nexus-cli/src/commands/source/push.js.map +1 -1
- package/dist/nexus-cli/src/commands/source/source-sync.e2e.test.js +48 -28
- package/dist/nexus-cli/src/commands/source/source-sync.e2e.test.js.map +1 -1
- package/dist/nexus-cli/src/commands/source/status.js +2 -0
- package/dist/nexus-cli/src/commands/source/status.js.map +1 -1
- package/dist/nexus-cli/src/commands/workforce/cognition.js +14 -0
- package/dist/nexus-cli/src/commands/workforce/cognition.js.map +1 -1
- package/dist/nexus-cli/src/commands/workforce/observe.js +11 -0
- package/dist/nexus-cli/src/commands/workforce/observe.js.map +1 -1
- package/dist/nexus-cli/src/commands/workforce/provider.js +2 -2
- package/dist/nexus-cli/src/commands/workforce/provider.js.map +1 -1
- package/dist/nexus-cli/src/contracts/command-contract-coverage-baseline.json +5 -5
- package/dist/nexus-cli/src/contracts/command-contract-matrix.generated.test.js +69 -28
- package/dist/nexus-cli/src/contracts/command-contract-matrix.generated.test.js.map +1 -1
- package/dist/nexus-cli/src/contracts/command-contract-matrix.scenarios.js +4 -3
- package/dist/nexus-cli/src/contracts/command-contract-matrix.scenarios.js.map +1 -1
- package/dist/nexus-cli/src/contracts/command-contract.registry.js +1 -1
- package/dist/nexus-cli/src/contracts/command-contract.registry.js.map +1 -1
- package/dist/nexus-cli/src/contracts/command-inventory.test.js +4 -4
- package/dist/nexus-cli/src/contracts/command-policy.exporter.test.js +2 -2
- package/dist/nexus-cli/src/contracts/command-policy.registry.js +7 -1
- package/dist/nexus-cli/src/contracts/command-policy.registry.js.map +1 -1
- package/dist/nexus-cli/src/contracts/command-policy.registry.test.js +5 -5
- package/dist/nexus-cli/src/contracts/command-policy.validator.test.js +3 -3
- package/dist/nexus-cli/src/contracts/workforce-contracts.js +3 -0
- package/dist/nexus-cli/src/contracts/workforce-contracts.js.map +1 -1
- package/dist/nexus-cli/src/runtime/failure-normalizer.d.ts +1 -0
- package/dist/nexus-cli/src/runtime/failure-normalizer.js +46 -3
- package/dist/nexus-cli/src/runtime/failure-normalizer.js.map +1 -1
- package/dist/nexus-cli/src/runtime/failure-normalizer.test.js +15 -0
- package/dist/nexus-cli/src/runtime/failure-normalizer.test.js.map +1 -1
- package/dist/nexus-cli/src/services/api-client.d.ts +4 -1
- package/dist/nexus-cli/src/services/api-client.js +12 -0
- package/dist/nexus-cli/src/services/api-client.js.map +1 -1
- package/dist/nexus-cli/src/services/revision-ledger/types.d.ts +2 -2
- package/dist/nexus-cli/src/services/source-command-governance.d.ts +9 -0
- package/dist/nexus-cli/src/services/source-command-governance.js +82 -0
- package/dist/nexus-cli/src/services/source-command-governance.js.map +1 -0
- package/dist/nexus-cli/src/services/source-command-governance.test.d.ts +1 -0
- package/dist/nexus-cli/src/services/source-command-governance.test.js +104 -0
- package/dist/nexus-cli/src/services/source-command-governance.test.js.map +1 -0
- package/dist/nexus-cli/src/services/source-layout-migration.d.ts +27 -0
- package/dist/nexus-cli/src/services/source-layout-migration.js +315 -0
- package/dist/nexus-cli/src/services/source-layout-migration.js.map +1 -0
- package/dist/nexus-cli/src/services/source-layout-migration.test.d.ts +1 -0
- package/dist/nexus-cli/src/services/source-layout-migration.test.js +149 -0
- package/dist/nexus-cli/src/services/source-layout-migration.test.js.map +1 -0
- package/dist/nexus-cli/src/services/source-pull-plan.d.ts +36 -0
- package/dist/nexus-cli/src/services/source-pull-plan.js +269 -0
- package/dist/nexus-cli/src/services/source-pull-plan.js.map +1 -0
- package/dist/nexus-cli/src/services/source-pull-plan.test.d.ts +1 -0
- package/dist/nexus-cli/src/services/source-pull-plan.test.js +252 -0
- package/dist/nexus-cli/src/services/source-pull-plan.test.js.map +1 -0
- package/dist/nexus-cli/src/services/source-taxonomy.d.ts +25 -0
- package/dist/nexus-cli/src/services/source-taxonomy.js +109 -0
- package/dist/nexus-cli/src/services/source-taxonomy.js.map +1 -0
- package/dist/nexus-cli/src/services/source-tracker.d.ts +2 -2
- package/dist/nexus-cli/src/services/source-tracker.js +26 -10
- package/dist/nexus-cli/src/services/source-tracker.js.map +1 -1
- package/dist/nexus-cli/src/services/source-tracker.test.js +34 -0
- package/dist/nexus-cli/src/services/source-tracker.test.js.map +1 -1
- package/dist/nexus-cli/src/services/workforce-bundle-archive.js +2 -0
- package/dist/nexus-cli/src/services/workforce-bundle-archive.js.map +1 -1
- package/dist/nexus-cli/src/services/workforce-bundle-archive.test.js +24 -5
- package/dist/nexus-cli/src/services/workforce-bundle-archive.test.js.map +1 -1
- package/dist/nexus-cli/src/services/workforce-bundle-local.d.ts +4 -1
- package/dist/nexus-cli/src/services/workforce-bundle-local.js +19 -1
- package/dist/nexus-cli/src/services/workforce-bundle-local.js.map +1 -1
- package/dist/nexus-cli/src/services/workforce-bundle-local.test.js +31 -0
- package/dist/nexus-cli/src/services/workforce-bundle-local.test.js.map +1 -1
- package/dist/nexus-cli/src/services/workforce-bundle-remote.js +3 -2
- package/dist/nexus-cli/src/services/workforce-bundle-remote.js.map +1 -1
- package/dist/nexus-cli/src/services/workforce-cognition-remote.d.ts +13 -0
- package/dist/nexus-cli/src/services/workforce-cognition-remote.js +23 -0
- package/dist/nexus-cli/src/services/workforce-cognition-remote.js.map +1 -1
- package/dist/nexus-cli/src/services/workforce-observe-remote.d.ts +4 -0
- package/dist/nexus-cli/src/services/workforce-observe-remote.js +10 -0
- package/dist/nexus-cli/src/services/workforce-observe-remote.js.map +1 -1
- package/dist/nexus-cli/src/services/workforce-provider-remote.d.ts +2 -2
- package/dist/nexus-cli/src/services/workforce-provider-remote.js +14 -31
- package/dist/nexus-cli/src/services/workforce-provider-remote.js.map +1 -1
- package/dist/nexus-cli/src/services/workforce-test-remote.d.ts +1 -1
- package/dist/nexus-cli/src/services/workforce-test-remote.js +1 -1
- package/dist/nexus-cli/src/services/workforce-test-remote.test.js +2 -2
- package/dist/nexus-cli/src/services/workspace-contract.d.ts +12 -2
- package/dist/nexus-cli/src/services/workspace-contract.js +201 -42
- package/dist/nexus-cli/src/services/workspace-contract.js.map +1 -1
- package/dist/nexus-cli/src/services/workspace-contract.test.js +150 -0
- package/dist/nexus-cli/src/services/workspace-contract.test.js.map +1 -1
- package/dist/nexus-cli/src/services/workspace-dx.d.ts +2 -1
- package/dist/nexus-cli/src/services/workspace-dx.js +1 -0
- package/dist/nexus-cli/src/services/workspace-dx.js.map +1 -1
- package/dist/nexus-cli/src/templates/project/templates/base-crm/nexus-project.json.tpl +2 -1
- package/dist/nexus-cli/src/templates/project/templates/base-crm/nexus-project.yaml.tpl +1 -0
- package/dist/nexus-cli/src/templates/project/templates/demo-public-channel-store-delivery/nexus-project.json.tpl +2 -1
- package/dist/nexus-cli/src/templates/project/templates/demo-public-channel-store-delivery/nexus-project.yaml.tpl +1 -0
- package/dist/nexus-cli/src/templates/project/templates/drill-code-extension-page/nexus-project.json.tpl +2 -1
- package/dist/nexus-cli/src/templates/project/templates/drill-code-extension-page/nexus-project.yaml.tpl +1 -0
- package/dist/nexus-cli/src/templates/project/templates/empty/nexus-project.json.tpl +2 -1
- package/dist/nexus-cli/src/templates/project/templates/empty/nexus-project.yaml.tpl +1 -0
- package/dist/nexus-cli/src/templates/project/templates/executable-workforce/README.md.tpl +8 -1
- package/dist/nexus-cli/src/templates/project/templates/executable-workforce/nexus-project.json.tpl +2 -1
- package/dist/nexus-cli/src/templates/project/templates/executable-workforce/nexus-project.yaml.tpl +1 -0
- package/dist/nexus-cli/src/templates/project/templates/executable-workforce/scripts/init-bundle.mjs +0 -1
- package/dist/nexus-cli/src/templates/project/templates/industry-education/nexus-project.json.tpl +2 -1
- package/dist/nexus-cli/src/templates/project/templates/industry-education/nexus-project.yaml.tpl +1 -0
- package/dist/nexus-cli/src/templates/project/templates/industry-finance/nexus-project.json.tpl +2 -1
- package/dist/nexus-cli/src/templates/project/templates/industry-finance/nexus-project.yaml.tpl +1 -0
- package/dist/nexus-cli/src/templates/project/templates/industry-healthcare/nexus-project.json.tpl +2 -1
- package/dist/nexus-cli/src/templates/project/templates/industry-healthcare/nexus-project.yaml.tpl +1 -0
- package/dist/nexus-cli/src/templates/project/templates/industry-partner-cloud/nexus-project.json.tpl +2 -1
- package/dist/nexus-cli/src/templates/project/templates/industry-partner-cloud/nexus-project.yaml.tpl +1 -0
- package/dist/nexus-cli/src/templates/project/templates/industry-retail/nexus-project.json.tpl +2 -1
- package/dist/nexus-cli/src/templates/project/templates/industry-retail/nexus-project.yaml.tpl +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const strict_1 = __importDefault(require("node:assert/strict"));
|
|
7
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
8
|
+
const node_os_1 = __importDefault(require("node:os"));
|
|
9
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
10
|
+
const node_test_1 = __importDefault(require("node:test"));
|
|
11
|
+
const shared_1 = require("@nexusclaw/shared");
|
|
12
|
+
const source_pull_plan_1 = require("./source-pull-plan");
|
|
13
|
+
function statusEntry(sourcePath, componentKey, remoteHash = `hash:${sourcePath}`) {
|
|
14
|
+
return {
|
|
15
|
+
path: sourcePath,
|
|
16
|
+
componentKey,
|
|
17
|
+
syncStatus: 'remote-new',
|
|
18
|
+
driftStatus: 'baseline-missing',
|
|
19
|
+
localHash: '',
|
|
20
|
+
remoteHash,
|
|
21
|
+
lastSyncedHash: '',
|
|
22
|
+
baselineHash: null,
|
|
23
|
+
aliases: { local: [], remote: [sourcePath], baseline: [], tracking: [] },
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function remoteStatus(entries) {
|
|
27
|
+
return {
|
|
28
|
+
remoteRevision: 'revision-1',
|
|
29
|
+
baselineRevision: null,
|
|
30
|
+
baselineHash: null,
|
|
31
|
+
baselineAvailable: false,
|
|
32
|
+
files: entries.map((entry) => ({
|
|
33
|
+
path: entry.path,
|
|
34
|
+
hash: entry.remoteHash,
|
|
35
|
+
componentKey: entry.componentKey,
|
|
36
|
+
})),
|
|
37
|
+
baselineFiles: [],
|
|
38
|
+
drift: { baselineAvailable: false, totalChanges: 0, humanSummary: [] },
|
|
39
|
+
changedComponentCount: entries.length,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
(0, node_test_1.default)('source pull selection requires an explicit selector and isolates --all', () => {
|
|
43
|
+
strict_1.default.throws(() => (0, source_pull_plan_1.resolveSourcePullSelection)([], {}), (error) => error.code === 'SOURCE_SELECTOR_REQUIRED');
|
|
44
|
+
strict_1.default.throws(() => (0, source_pull_plan_1.resolveSourcePullSelection)([], { all: true, paths: ['objects/Account'] }), (error) => error.code === 'SOURCE_SELECTOR_CONFLICT');
|
|
45
|
+
strict_1.default.throws(() => (0, source_pull_plan_1.resolveSourcePullSelection)([], { paths: ['../outside'] }), (error) => error.code === 'SOURCE_PATH_ESCAPE');
|
|
46
|
+
});
|
|
47
|
+
(0, node_test_1.default)('Object and Employee selectors include only their owned closure', () => {
|
|
48
|
+
const statuses = [
|
|
49
|
+
statusEntry('objects/Account/object.json', 'object:Account'),
|
|
50
|
+
statusEntry('objects/Account/fields/name.field.json', 'field:Account.name'),
|
|
51
|
+
statusEntry('objects/Contact/object.json', 'object:Contact'),
|
|
52
|
+
statusEntry('employees/ClaimsAdjuster/workforce.bundle.json', 'employee:ClaimsAdjuster'),
|
|
53
|
+
statusEntry('employees/ClaimsAdjuster/employee/employee-package.json', 'employee:ClaimsAdjuster'),
|
|
54
|
+
statusEntry('employees/Seller/workforce.bundle.json', 'employee:Seller'),
|
|
55
|
+
];
|
|
56
|
+
const selected = (0, source_pull_plan_1.resolveSourcePullSelection)(statuses, {
|
|
57
|
+
metadata: ['Object:Account', 'Employee:ClaimsAdjuster'],
|
|
58
|
+
});
|
|
59
|
+
strict_1.default.deepEqual(selected.entries.map((entry) => entry.path), [
|
|
60
|
+
'employees/ClaimsAdjuster/employee/employee-package.json',
|
|
61
|
+
'employees/ClaimsAdjuster/workforce.bundle.json',
|
|
62
|
+
'objects/Account/fields/name.field.json',
|
|
63
|
+
'objects/Account/object.json',
|
|
64
|
+
]);
|
|
65
|
+
});
|
|
66
|
+
(0, node_test_1.default)('any path inside an Employee expands to the complete component bundle', () => {
|
|
67
|
+
const statuses = [
|
|
68
|
+
statusEntry('employees/ClaimsAdjuster/workforce.bundle.json', 'employee:ClaimsAdjuster'),
|
|
69
|
+
statusEntry('employees/ClaimsAdjuster/employee/employee-package.json', 'employee:ClaimsAdjuster'),
|
|
70
|
+
statusEntry('employees/Seller/workforce.bundle.json', 'employee:Seller'),
|
|
71
|
+
];
|
|
72
|
+
strict_1.default.deepEqual((0, source_pull_plan_1.resolveSourcePullSelection)(statuses, {
|
|
73
|
+
paths: ['employees/ClaimsAdjuster/workforce.bundle.json'],
|
|
74
|
+
}).entries.map((entry) => entry.path), [
|
|
75
|
+
'employees/ClaimsAdjuster/employee/employee-package.json',
|
|
76
|
+
'employees/ClaimsAdjuster/workforce.bundle.json',
|
|
77
|
+
]);
|
|
78
|
+
});
|
|
79
|
+
(0, node_test_1.default)('nexus-source-selection/v1 manifest is strict and contributes selectors', () => {
|
|
80
|
+
const root = node_fs_1.default.mkdtempSync(node_path_1.default.join(node_os_1.default.tmpdir(), 'nexus-source-selection-'));
|
|
81
|
+
try {
|
|
82
|
+
const manifestPath = node_path_1.default.join(root, 'selection.yaml');
|
|
83
|
+
node_fs_1.default.writeFileSync(manifestPath, [
|
|
84
|
+
'schemaVersion: nexus-source-selection/v1',
|
|
85
|
+
'members:',
|
|
86
|
+
' - type: Object',
|
|
87
|
+
' name: Account',
|
|
88
|
+
' - type: Employee',
|
|
89
|
+
' name: ClaimsAdjuster',
|
|
90
|
+
].join('\n'));
|
|
91
|
+
const manifest = (0, source_pull_plan_1.loadSourceSelectionManifest)(manifestPath);
|
|
92
|
+
strict_1.default.deepEqual(manifest.members, [
|
|
93
|
+
{ type: 'Object', name: 'Account' },
|
|
94
|
+
{ type: 'Employee', name: 'ClaimsAdjuster' },
|
|
95
|
+
]);
|
|
96
|
+
node_fs_1.default.writeFileSync(manifestPath, [
|
|
97
|
+
'schemaVersion: nexus-source-selection/v1',
|
|
98
|
+
'members:',
|
|
99
|
+
' - type: Object',
|
|
100
|
+
' name: ../Account',
|
|
101
|
+
].join('\n'));
|
|
102
|
+
strict_1.default.throws(() => (0, source_pull_plan_1.loadSourceSelectionManifest)(manifestPath), (error) => error.code === 'SOURCE_PATH_ESCAPE');
|
|
103
|
+
}
|
|
104
|
+
finally {
|
|
105
|
+
node_fs_1.default.rmSync(root, { recursive: true, force: true });
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
(0, node_test_1.default)('fetched source must exactly match selected paths, revision and digests', () => {
|
|
109
|
+
const entries = [statusEntry('objects/Account/object.json', 'object:Account', 'expected-hash')];
|
|
110
|
+
const status = remoteStatus(entries);
|
|
111
|
+
const valid = (0, source_pull_plan_1.validateFetchedSourceSet)({
|
|
112
|
+
status,
|
|
113
|
+
entries,
|
|
114
|
+
fetched: {
|
|
115
|
+
remoteRevision: 'revision-1',
|
|
116
|
+
files: [{
|
|
117
|
+
path: 'objects/Account/object.json',
|
|
118
|
+
hash: 'expected-hash',
|
|
119
|
+
componentKey: 'object:Account',
|
|
120
|
+
content: '{"name":"Account"}',
|
|
121
|
+
}],
|
|
122
|
+
},
|
|
123
|
+
});
|
|
124
|
+
strict_1.default.equal(valid.get('objects/Account/object.json'), '{"name":"Account"}');
|
|
125
|
+
strict_1.default.throws(() => (0, source_pull_plan_1.validateFetchedSourceSet)({
|
|
126
|
+
status,
|
|
127
|
+
entries,
|
|
128
|
+
fetched: {
|
|
129
|
+
remoteRevision: 'revision-1',
|
|
130
|
+
files: [{
|
|
131
|
+
path: 'objects/Contact/object.json',
|
|
132
|
+
hash: 'unexpected',
|
|
133
|
+
content: '{}',
|
|
134
|
+
}],
|
|
135
|
+
},
|
|
136
|
+
}), (error) => error.code === 'SOURCE_FETCH_SET_MISMATCH'
|
|
137
|
+
&& error.details?.extra?.[0] === 'objects/Contact/object.json'
|
|
138
|
+
&& error.details?.missing?.[0] === 'objects/Account/object.json');
|
|
139
|
+
});
|
|
140
|
+
(0, node_test_1.default)('Employee fetch requires one complete server-attested semantic inventory', () => {
|
|
141
|
+
const apiName = 'ClaimsAdjuster';
|
|
142
|
+
const prefix = `employees/${apiName}/`;
|
|
143
|
+
const portable = [
|
|
144
|
+
{ path: 'workforce.bundle.json', semanticEntryDigest: `sha256:${'1'.repeat(64)}` },
|
|
145
|
+
{ path: 'employee/employee-package.json', semanticEntryDigest: `sha256:${'2'.repeat(64)}` },
|
|
146
|
+
];
|
|
147
|
+
const aggregateDigest = (0, shared_1.portableBundleDigest)(portable);
|
|
148
|
+
const releaseSetId = 'release-1';
|
|
149
|
+
const files = [
|
|
150
|
+
...portable.map((file, index) => ({
|
|
151
|
+
path: `${prefix}${file.path}`,
|
|
152
|
+
hash: `raw-${index}`,
|
|
153
|
+
componentKey: `employee:${apiName}`,
|
|
154
|
+
semanticHash: file.semanticEntryDigest,
|
|
155
|
+
aggregateDigest,
|
|
156
|
+
releaseSetId,
|
|
157
|
+
content: '{}',
|
|
158
|
+
})),
|
|
159
|
+
{
|
|
160
|
+
path: `${prefix}bindings/dev.runtime-bindings.json`,
|
|
161
|
+
hash: 'raw-binding',
|
|
162
|
+
componentKey: `employee:${apiName}`,
|
|
163
|
+
semanticHash: `sha256:${'3'.repeat(64)}`,
|
|
164
|
+
aggregateDigest,
|
|
165
|
+
releaseSetId,
|
|
166
|
+
content: '{}',
|
|
167
|
+
},
|
|
168
|
+
];
|
|
169
|
+
const entries = files.map((file) => statusEntry(file.path, file.componentKey, file.hash));
|
|
170
|
+
const status = remoteStatus(entries);
|
|
171
|
+
status.files = files.map(({ content: _content, ...file }) => file);
|
|
172
|
+
strict_1.default.doesNotThrow(() => (0, source_pull_plan_1.validateFetchedSourceSet)({
|
|
173
|
+
status,
|
|
174
|
+
entries,
|
|
175
|
+
fetched: { remoteRevision: 'revision-1', files },
|
|
176
|
+
}));
|
|
177
|
+
strict_1.default.throws(() => (0, source_pull_plan_1.validateFetchedSourceSet)({
|
|
178
|
+
status,
|
|
179
|
+
entries,
|
|
180
|
+
fetched: {
|
|
181
|
+
remoteRevision: 'revision-1',
|
|
182
|
+
files: files.map((file, index) => index === 0 ? { ...file, aggregateDigest: `sha256:${'f'.repeat(64)}` } : file),
|
|
183
|
+
},
|
|
184
|
+
}), (error) => error.code === 'EMPLOYEE_SOURCE_INCOMPLETE');
|
|
185
|
+
});
|
|
186
|
+
(0, node_test_1.default)('validated selected files are applied together from a workspace-local stage', () => {
|
|
187
|
+
const root = node_fs_1.default.mkdtempSync(node_path_1.default.join(node_os_1.default.tmpdir(), 'nexus-source-atomic-'));
|
|
188
|
+
try {
|
|
189
|
+
node_fs_1.default.mkdirSync(node_path_1.default.join(root, 'objects', 'Account'), { recursive: true });
|
|
190
|
+
node_fs_1.default.mkdirSync(node_path_1.default.join(root, 'objects', 'Old'), { recursive: true });
|
|
191
|
+
node_fs_1.default.writeFileSync(node_path_1.default.join(root, 'objects', 'Account', 'object.json'), '{"old":true}');
|
|
192
|
+
node_fs_1.default.writeFileSync(node_path_1.default.join(root, 'objects', 'Old', 'object.json'), '{"delete":true}');
|
|
193
|
+
const update = statusEntry('objects/Account/object.json', 'object:Account', 'new-hash');
|
|
194
|
+
const deletion = {
|
|
195
|
+
...statusEntry('objects/Old/object.json', 'object:Old'),
|
|
196
|
+
remoteHash: '',
|
|
197
|
+
syncStatus: 'remote-delete',
|
|
198
|
+
};
|
|
199
|
+
(0, source_pull_plan_1.applyPulledSourceFilesAtomically)({
|
|
200
|
+
baseDir: root,
|
|
201
|
+
entries: [update, deletion],
|
|
202
|
+
contentByRemotePath: new Map([['objects/Account/object.json', '{"new":true}']]),
|
|
203
|
+
});
|
|
204
|
+
strict_1.default.equal(node_fs_1.default.readFileSync(node_path_1.default.join(root, 'objects', 'Account', 'object.json'), 'utf8'), '{"new":true}');
|
|
205
|
+
strict_1.default.equal(node_fs_1.default.existsSync(node_path_1.default.join(root, 'objects', 'Old', 'object.json')), false);
|
|
206
|
+
strict_1.default.deepEqual(node_fs_1.default.readdirSync(node_path_1.default.join(root, '.nexusclaw', 'tmp')), []);
|
|
207
|
+
}
|
|
208
|
+
finally {
|
|
209
|
+
node_fs_1.default.rmSync(root, { recursive: true, force: true });
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
(0, node_test_1.default)('atomic apply preserves existing files when staging any selected file fails', () => {
|
|
213
|
+
const root = node_fs_1.default.mkdtempSync(node_path_1.default.join(node_os_1.default.tmpdir(), 'nexus-source-atomic-failure-'));
|
|
214
|
+
try {
|
|
215
|
+
node_fs_1.default.mkdirSync(node_path_1.default.join(root, 'objects', 'Account'), { recursive: true });
|
|
216
|
+
node_fs_1.default.writeFileSync(node_path_1.default.join(root, 'objects', 'Account', 'object.json'), '{"old":true}');
|
|
217
|
+
const first = statusEntry('objects/Account/object.json', 'object:Account', 'new-hash');
|
|
218
|
+
const second = statusEntry('objects/Contact/object.json', 'object:Contact', 'contact-hash');
|
|
219
|
+
strict_1.default.throws(() => (0, source_pull_plan_1.applyPulledSourceFilesAtomically)({
|
|
220
|
+
baseDir: root,
|
|
221
|
+
entries: [first, second],
|
|
222
|
+
contentByRemotePath: new Map([['objects/Account/object.json', '{"new":true}']]),
|
|
223
|
+
}), (error) => error.code === 'SOURCE_FETCH_SET_MISMATCH');
|
|
224
|
+
strict_1.default.equal(node_fs_1.default.readFileSync(node_path_1.default.join(root, 'objects', 'Account', 'object.json'), 'utf8'), '{"old":true}');
|
|
225
|
+
strict_1.default.equal(node_fs_1.default.existsSync(node_path_1.default.join(root, 'objects', 'Contact', 'object.json')), false);
|
|
226
|
+
strict_1.default.deepEqual(node_fs_1.default.readdirSync(node_path_1.default.join(root, '.nexusclaw', 'tmp')), []);
|
|
227
|
+
}
|
|
228
|
+
finally {
|
|
229
|
+
node_fs_1.default.rmSync(root, { recursive: true, force: true });
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
(0, node_test_1.default)('login implementation has no source discovery, download or write dependency', () => {
|
|
233
|
+
const loginSource = node_fs_1.default.readFileSync(node_path_1.default.resolve(__dirname, '../commands/org/login-web.ts'), 'utf8');
|
|
234
|
+
for (const forbidden of [
|
|
235
|
+
'getSourceStatus',
|
|
236
|
+
'getSourceFiles',
|
|
237
|
+
'writeTrackedSourceFile',
|
|
238
|
+
'syncTrackingWithStatus',
|
|
239
|
+
]) {
|
|
240
|
+
strict_1.default.doesNotMatch(loginSource, new RegExp(forbidden));
|
|
241
|
+
}
|
|
242
|
+
});
|
|
243
|
+
(0, node_test_1.default)('source pull validates explicit selection before auth, ledger or remote index access', () => {
|
|
244
|
+
const pullSource = node_fs_1.default.readFileSync(node_path_1.default.resolve(__dirname, '../commands/source/pull.ts'), 'utf8');
|
|
245
|
+
const selectorGuard = pullSource.indexOf('resolveSourcePullSelection([], selectors)');
|
|
246
|
+
const ledgerInitialization = pullSource.indexOf('await ensureRevisionLedgerInitialized');
|
|
247
|
+
const remoteIndex = pullSource.indexOf('client.getSourceStatus()');
|
|
248
|
+
strict_1.default.ok(selectorGuard >= 0);
|
|
249
|
+
strict_1.default.ok(selectorGuard < ledgerInitialization);
|
|
250
|
+
strict_1.default.ok(selectorGuard < remoteIndex);
|
|
251
|
+
});
|
|
252
|
+
//# sourceMappingURL=source-pull-plan.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-pull-plan.test.js","sourceRoot":"","sources":["../../../../src/services/source-pull-plan.test.ts"],"names":[],"mappings":";;;;;AAAA,gEAAwC;AACxC,sDAAyB;AACzB,sDAAyB;AACzB,0DAA6B;AAC7B,0DAA6B;AAC7B,8CAAyD;AAGzD,yDAK4B;AAG5B,SAAS,WAAW,CAClB,UAAkB,EAClB,YAAoB,EACpB,UAAU,GAAG,QAAQ,UAAU,EAAE;IAEjC,OAAO;QACL,IAAI,EAAE,UAAU;QAChB,YAAY;QACZ,U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CAAC,OAAO,CAAC,SAAS,EAAE,4BAA4B,CAAC,EACrD,MAAM,CACP,CAAC;IACF,MAAM,aAAa,GAAG,UAAU,CAAC,OAAO,CAAC,2CAA2C,CAAC,CAAC;IACtF,MAAM,oBAAoB,GAAG,UAAU,CAAC,OAAO,CAAC,uCAAuC,CAAC,CAAC;IACzF,MAAM,WAAW,GAAG,UAAU,CAAC,OAAO,CAAC,0BAA0B,CAAC,CAAC;IACnE,gBAAM,CAAC,EAAE,CAAC,aAAa,IAAI,CAAC,CAAC,CAAC;IAC9B,gBAAM,CAAC,EAAE,CAAC,aAAa,GAAG,oBAAoB,CAAC,CAAC;IAChD,gBAAM,CAAC,EAAE,CAAC,aAAa,GAAG,WAAW,CAAC,CAAC;AACzC,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export type SourcePathPolicy = 'singleton-file' | 'entity-directory' | 'component-bundle';
|
|
2
|
+
export interface SourceTaxonomyEntry {
|
|
3
|
+
kind: string;
|
|
4
|
+
directory: string;
|
|
5
|
+
identityPattern: RegExp;
|
|
6
|
+
pathPolicy: SourcePathPolicy;
|
|
7
|
+
closureResolver: string;
|
|
8
|
+
portable: boolean;
|
|
9
|
+
generated: boolean;
|
|
10
|
+
required: boolean;
|
|
11
|
+
lifecycle: 'canonical' | 'legacy-only';
|
|
12
|
+
}
|
|
13
|
+
export declare const SOURCE_TAXONOMY_REGISTRY: readonly SourceTaxonomyEntry[];
|
|
14
|
+
export declare const CANONICAL_SOURCE_TAXONOMY: SourceTaxonomyEntry[];
|
|
15
|
+
export declare const LEGACY_SOURCE_TAXONOMY: SourceTaxonomyEntry[];
|
|
16
|
+
export declare function canonicalSourceDirectories(): string[];
|
|
17
|
+
export declare function requiredSourceDirectories(): string[];
|
|
18
|
+
export declare function allRecognizedSourceDirectories(): string[];
|
|
19
|
+
export declare function findSourceTaxonomyByDirectory(directory: string): SourceTaxonomyEntry | undefined;
|
|
20
|
+
export declare function findSourceTaxonomyByKind(kind: string): SourceTaxonomyEntry | undefined;
|
|
21
|
+
export declare function findSourceTaxonomyForPath(sourcePath: string, options?: {
|
|
22
|
+
includeLegacy?: boolean;
|
|
23
|
+
}): SourceTaxonomyEntry | undefined;
|
|
24
|
+
export declare function employeeApiNameFromSourcePath(sourcePath: string): string | null;
|
|
25
|
+
export declare function isEmployeeBundleSourcePath(sourcePath: string): boolean;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LEGACY_SOURCE_TAXONOMY = exports.CANONICAL_SOURCE_TAXONOMY = exports.SOURCE_TAXONOMY_REGISTRY = void 0;
|
|
4
|
+
exports.canonicalSourceDirectories = canonicalSourceDirectories;
|
|
5
|
+
exports.requiredSourceDirectories = requiredSourceDirectories;
|
|
6
|
+
exports.allRecognizedSourceDirectories = allRecognizedSourceDirectories;
|
|
7
|
+
exports.findSourceTaxonomyByDirectory = findSourceTaxonomyByDirectory;
|
|
8
|
+
exports.findSourceTaxonomyByKind = findSourceTaxonomyByKind;
|
|
9
|
+
exports.findSourceTaxonomyForPath = findSourceTaxonomyForPath;
|
|
10
|
+
exports.employeeApiNameFromSourcePath = employeeApiNameFromSourcePath;
|
|
11
|
+
exports.isEmployeeBundleSourcePath = isEmployeeBundleSourcePath;
|
|
12
|
+
function canonical(kind, directory, pathPolicy = 'singleton-file', required = false, closureResolver = `${kind}-component`) {
|
|
13
|
+
return {
|
|
14
|
+
kind,
|
|
15
|
+
directory,
|
|
16
|
+
identityPattern: new RegExp(`^${directory}/([^/]+)(?:/|$)`),
|
|
17
|
+
pathPolicy,
|
|
18
|
+
closureResolver,
|
|
19
|
+
portable: true,
|
|
20
|
+
generated: false,
|
|
21
|
+
required,
|
|
22
|
+
lifecycle: 'canonical',
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
exports.SOURCE_TAXONOMY_REGISTRY = [
|
|
26
|
+
canonical('Application', 'applications', 'singleton-file', true),
|
|
27
|
+
canonical('Tab', 'tabs', 'singleton-file', true),
|
|
28
|
+
canonical('Object', 'objects', 'entity-directory', true, 'object-owned-children'),
|
|
29
|
+
canonical('App', 'apps'),
|
|
30
|
+
canonical('Layout', 'layouts', 'entity-directory', true),
|
|
31
|
+
canonical('Page', 'pages', 'singleton-file', true),
|
|
32
|
+
canonical('RecordPage', 'record-pages', 'entity-directory'),
|
|
33
|
+
canonical('NexusWebComponent', 'nwc', 'component-bundle', true),
|
|
34
|
+
canonical('NpexClass', 'classes', 'singleton-file', true),
|
|
35
|
+
canonical('Trigger', 'triggers', 'singleton-file', true),
|
|
36
|
+
canonical('Flow', 'flows', 'singleton-file', true),
|
|
37
|
+
canonical('View', 'views', 'entity-directory'),
|
|
38
|
+
canonical('Menu', 'menus', 'entity-directory'),
|
|
39
|
+
canonical('Dashboard', 'dashboards'),
|
|
40
|
+
canonical('Report', 'reports', 'entity-directory'),
|
|
41
|
+
canonical('ReportFolder', 'report-folders', 'entity-directory'),
|
|
42
|
+
canonical('Action', 'actions'),
|
|
43
|
+
canonical('Approval', 'approvals'),
|
|
44
|
+
canonical('Prompt', 'prompts', 'entity-directory'),
|
|
45
|
+
canonical('PermissionSet', 'permissionsets', 'entity-directory', true),
|
|
46
|
+
canonical('Profile', 'profiles', 'singleton-file', true),
|
|
47
|
+
canonical('PermissionSetGroup', 'permissionSetGroups'),
|
|
48
|
+
canonical('Role', 'roles', 'entity-directory'),
|
|
49
|
+
canonical('Group', 'groups'),
|
|
50
|
+
canonical('Queue', 'queues'),
|
|
51
|
+
canonical('Label', 'labels'),
|
|
52
|
+
canonical('CustomMetadata', 'customMetadata'),
|
|
53
|
+
canonical('CustomSetting', 'customSettings'),
|
|
54
|
+
canonical('StaticResource', 'staticresources', 'component-bundle'),
|
|
55
|
+
canonical('NamedCredential', 'namedCredentials'),
|
|
56
|
+
canonical('RemoteSiteSetting', 'remoteSiteSettings'),
|
|
57
|
+
canonical('NotificationTemplate', 'notificationTemplates'),
|
|
58
|
+
canonical('IsolatedComponent', 'isolated', 'component-bundle'),
|
|
59
|
+
canonical('Employee', 'employees', 'component-bundle', false, 'employee-portable-bundle'),
|
|
60
|
+
{
|
|
61
|
+
kind: 'LegacyAgentProjection',
|
|
62
|
+
directory: 'agents',
|
|
63
|
+
identityPattern: /^agents\/([^/]+)\.agent\.(?:json|ya?ml)$/,
|
|
64
|
+
pathPolicy: 'singleton-file',
|
|
65
|
+
closureResolver: 'legacy-agent-projection',
|
|
66
|
+
portable: false,
|
|
67
|
+
generated: false,
|
|
68
|
+
required: false,
|
|
69
|
+
lifecycle: 'legacy-only',
|
|
70
|
+
},
|
|
71
|
+
];
|
|
72
|
+
exports.CANONICAL_SOURCE_TAXONOMY = exports.SOURCE_TAXONOMY_REGISTRY.filter((entry) => entry.lifecycle === 'canonical');
|
|
73
|
+
exports.LEGACY_SOURCE_TAXONOMY = exports.SOURCE_TAXONOMY_REGISTRY.filter((entry) => entry.lifecycle === 'legacy-only');
|
|
74
|
+
function canonicalSourceDirectories() {
|
|
75
|
+
return exports.CANONICAL_SOURCE_TAXONOMY.map((entry) => entry.directory);
|
|
76
|
+
}
|
|
77
|
+
function requiredSourceDirectories() {
|
|
78
|
+
return exports.CANONICAL_SOURCE_TAXONOMY
|
|
79
|
+
.filter((entry) => entry.required)
|
|
80
|
+
.map((entry) => entry.directory);
|
|
81
|
+
}
|
|
82
|
+
function allRecognizedSourceDirectories() {
|
|
83
|
+
return Array.from(new Set(exports.SOURCE_TAXONOMY_REGISTRY.map((entry) => entry.directory)));
|
|
84
|
+
}
|
|
85
|
+
function findSourceTaxonomyByDirectory(directory) {
|
|
86
|
+
return exports.SOURCE_TAXONOMY_REGISTRY.find((entry) => entry.directory === directory);
|
|
87
|
+
}
|
|
88
|
+
function findSourceTaxonomyByKind(kind) {
|
|
89
|
+
const normalized = kind.toLocaleLowerCase('en-US');
|
|
90
|
+
return exports.SOURCE_TAXONOMY_REGISTRY.find((entry) => entry.lifecycle === 'canonical'
|
|
91
|
+
&& entry.kind.toLocaleLowerCase('en-US') === normalized);
|
|
92
|
+
}
|
|
93
|
+
function findSourceTaxonomyForPath(sourcePath, options = {}) {
|
|
94
|
+
const normalized = sourcePath.replace(/\\/g, '/').replace(/^\.\//, '');
|
|
95
|
+
return exports.SOURCE_TAXONOMY_REGISTRY.find((entry) => (options.includeLegacy !== false || entry.lifecycle === 'canonical')
|
|
96
|
+
&& (normalized === entry.directory || normalized.startsWith(`${entry.directory}/`)));
|
|
97
|
+
}
|
|
98
|
+
function employeeApiNameFromSourcePath(sourcePath) {
|
|
99
|
+
const normalized = sourcePath.replace(/\\/g, '/').replace(/^\.\//, '');
|
|
100
|
+
return normalized.match(/^employees\/([^/]+)(?:\/|$)/)?.[1] ?? null;
|
|
101
|
+
}
|
|
102
|
+
function isEmployeeBundleSourcePath(sourcePath) {
|
|
103
|
+
const normalized = sourcePath.replace(/\\/g, '/').replace(/^\.\//, '');
|
|
104
|
+
if (!employeeApiNameFromSourcePath(normalized) || normalized.includes('/.nexusclaw/')) {
|
|
105
|
+
return false;
|
|
106
|
+
}
|
|
107
|
+
return /\.(?:json|ya?ml|ts)$/u.test(normalized);
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=source-taxonomy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-taxonomy.js","sourceRoot":"","sources":["../../../../src/services/source-taxonomy.ts"],"names":[],"mappings":";;;AAiGA,gEAEC;AAED,8DAIC;AAED,wEAEC;AAED,sEAIC;AAED,4DAMC;AAED,8DASC;AAED,sEAGC;AAED,gEAMC;AAlID,SAAS,SAAS,CAChB,IAAY,EACZ,SAAiB,EACjB,aAA+B,gBAAgB,EAC/C,QAAQ,GAAG,KAAK,EAChB,eAAe,GAAG,GAAG,IAAI,YAAY;IAErC,OAAO;QACL,IAAI;QACJ,SAAS;QACT,eAAe,EAAE,IAAI,MAAM,CAAC,IAAI,SAAS,iBAAiB,CAAC;QAC3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U,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IACvE,OAAO,gCAAwB,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAC7C,CAAC,OAAO,CAAC,aAAa,KAAK,KAAK,IAAI,KAAK,CAAC,SAAS,KAAK,WAAW,CAAC;WACjE,CAAC,UAAU,KAAK,KAAK,CAAC,SAAS,IAAI,UAAU,CAAC,UAAU,CAAC,GAAG,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,CACpF,CAAC;AACJ,CAAC;AAED,SAAgB,6BAA6B,CAAC,UAAkB;IAC9D,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IACvE,OAAO,UAAU,CAAC,KAAK,CAAC,6BAA6B,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;AACtE,CAAC;AAED,SAAgB,0BAA0B,CAAC,UAAkB;IAC3D,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IACvE,IAAI,CAAC,6BAA6B,CAAC,UAAU,CAAC,IAAI,UAAU,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC;QACtF,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,uBAAuB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;AAClD,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type SourceStatusFileRecord, type SourceStatusResult } from './api-client';
|
|
2
2
|
export interface SourceTrackingEntry {
|
|
3
3
|
componentKey: string;
|
|
4
|
-
track: 'metadata-runtime' | 'code-extension';
|
|
4
|
+
track: 'metadata-runtime' | 'code-extension' | 'employee-source';
|
|
5
5
|
localHash: string;
|
|
6
6
|
remoteHash: string;
|
|
7
7
|
lastSyncedHash: string;
|
|
@@ -23,7 +23,7 @@ export interface LocalSourceEntry {
|
|
|
23
23
|
content: string;
|
|
24
24
|
hash: string;
|
|
25
25
|
componentKey: string;
|
|
26
|
-
track: 'metadata-runtime' | 'code-extension';
|
|
26
|
+
track: 'metadata-runtime' | 'code-extension' | 'employee-source';
|
|
27
27
|
}
|
|
28
28
|
export type SourceSyncStatus = 'synced' | 'local-new' | 'local-changed' | 'local-delete' | 'remote-new' | 'remote-changed' | 'remote-delete' | 'conflict';
|
|
29
29
|
export type DriftStatus = 'baseline-missing' | 'in-sync' | 'drifted';
|
|
@@ -57,6 +57,7 @@ const yaml = __importStar(require("js-yaml"));
|
|
|
57
57
|
const workspace_contract_1 = require("./workspace-contract");
|
|
58
58
|
const source_tracking_bridge_1 = require("./revision-ledger/source-tracking-bridge");
|
|
59
59
|
const utils_1 = require("./revision-ledger/utils");
|
|
60
|
+
const source_taxonomy_1 = require("./source-taxonomy");
|
|
60
61
|
const TRACKING_FILE = '.nexus-source-tracking.json';
|
|
61
62
|
const TRACKING_SCHEMA_VERSION = 2;
|
|
62
63
|
const SOURCE_SUFFIXES = [
|
|
@@ -174,8 +175,11 @@ function isSourceFile(filePath) {
|
|
|
174
175
|
}
|
|
175
176
|
function isTrackedMetadataPath(filePath) {
|
|
176
177
|
const normalized = normalizeSourceSelectionPath(filePath);
|
|
178
|
+
if ((0, source_taxonomy_1.isEmployeeBundleSourcePath)(normalized)) {
|
|
179
|
+
return true;
|
|
180
|
+
}
|
|
177
181
|
return isSourceFile(normalized)
|
|
178
|
-
&&
|
|
182
|
+
&& Boolean((0, source_taxonomy_1.findSourceTaxonomyForPath)(normalized));
|
|
179
183
|
}
|
|
180
184
|
function isTrackedCodePath(filePath) {
|
|
181
185
|
const normalized = normalizeSourceSelectionPath(filePath);
|
|
@@ -187,7 +191,9 @@ function isTrackedCodePath(filePath) {
|
|
|
187
191
|
|| /^isolated\/[^/]+\/[^/]+\.(js|isolated-meta\.xml)$/.test(normalized);
|
|
188
192
|
}
|
|
189
193
|
function inferTrackFromPath(filePath) {
|
|
190
|
-
return
|
|
194
|
+
return (0, source_taxonomy_1.isEmployeeBundleSourcePath)(filePath)
|
|
195
|
+
? 'employee-source'
|
|
196
|
+
: isTrackedCodePath(filePath) ? 'code-extension' : 'metadata-runtime';
|
|
191
197
|
}
|
|
192
198
|
const CASE_INSENSITIVE_OBJECT_IDENTITY_KEYS = new Set([
|
|
193
199
|
'nameSingular',
|
|
@@ -250,6 +256,10 @@ function resolveTrackedFilePath(baseDir, trackedPath) {
|
|
|
250
256
|
}
|
|
251
257
|
function deriveComponentKey(trackedPath) {
|
|
252
258
|
const normalized = normalizeSourceSelectionPath(trackedPath);
|
|
259
|
+
const employeeApiName = (0, source_taxonomy_1.employeeApiNameFromSourcePath)(normalized);
|
|
260
|
+
if (employeeApiName) {
|
|
261
|
+
return `employee:${employeeApiName}`;
|
|
262
|
+
}
|
|
253
263
|
const functionMatch = normalized.match(/^src\/functions\/(.+)\.function\.(ts|js)$/);
|
|
254
264
|
if (functionMatch) {
|
|
255
265
|
return `function:${functionMatch[1]}`;
|
|
@@ -518,14 +528,7 @@ function readSelectedSourceDirectory(baseDir) {
|
|
|
518
528
|
const files = [];
|
|
519
529
|
const skippedDirectoryNames = new Set(['node_modules', '.git', 'dist', 'coverage']);
|
|
520
530
|
const rootName = path.basename(absoluteRoot);
|
|
521
|
-
const taxonomyRoots = new Set([
|
|
522
|
-
'applications', 'tabs', 'objects', 'apps', 'layouts', 'pages', 'views',
|
|
523
|
-
'menus', 'dashboards', 'reports', 'actions', 'flows', 'approvals',
|
|
524
|
-
'prompts', 'agents', 'permissionsets', 'profiles', 'permissionSetGroups',
|
|
525
|
-
'roles', 'groups', 'queues', 'labels', 'customMetadata', 'customSettings',
|
|
526
|
-
'staticresources', 'namedCredentials', 'remoteSiteSettings',
|
|
527
|
-
'notificationTemplates', 'classes', 'triggers', 'nwc', 'isolated', 'src',
|
|
528
|
-
]);
|
|
531
|
+
const taxonomyRoots = new Set([...(0, source_taxonomy_1.allRecognizedSourceDirectories)(), 'src']);
|
|
529
532
|
const selectedPrefix = taxonomyRoots.has(rootName) ? `${rootName}/` : '';
|
|
530
533
|
const visit = (currentPath) => {
|
|
531
534
|
for (const entry of fs.readdirSync(currentPath, { withFileTypes: true })) {
|
|
@@ -730,6 +733,19 @@ function filterByMetadataSelector(statuses, selectors) {
|
|
|
730
733
|
const entryType = entry.componentKey.slice(0, keyColonIndex).toLowerCase();
|
|
731
734
|
const entryName = entry.componentKey.slice(keyColonIndex + 1);
|
|
732
735
|
return parsed.some((selector) => {
|
|
736
|
+
if (selector.type === 'object') {
|
|
737
|
+
const objectPath = entry.path.match(/^objects\/([^/]+)\//)?.[1];
|
|
738
|
+
if (objectPath && (selector.name === undefined || selector.name === objectPath)) {
|
|
739
|
+
return true;
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
if (selector.type === 'employee') {
|
|
743
|
+
const employeeApiName = (0, source_taxonomy_1.employeeApiNameFromSourcePath)(entry.path);
|
|
744
|
+
if (employeeApiName
|
|
745
|
+
&& (selector.name === undefined || selector.name === employeeApiName)) {
|
|
746
|
+
return true;
|
|
747
|
+
}
|
|
748
|
+
}
|
|
733
749
|
if (selector.type !== entryType) {
|
|
734
750
|
return false;
|
|
735
751
|
}
|