sf-plugin-cms 0.1.0 → 0.3.0
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/README.md +143 -25
- package/lib/{commands/cms/command-base.d.ts → command-base.d.ts} +2 -1
- package/lib/{commands/cms/command-base.js → command-base.js} +3 -0
- package/lib/command-base.js.map +1 -0
- package/lib/commands/cms/export/workspace.d.ts +15 -7
- package/lib/commands/cms/export/workspace.js +114 -12
- package/lib/commands/cms/export/workspace.js.map +1 -1
- package/lib/commands/cms/get/channel.d.ts +1 -1
- package/lib/commands/cms/get/channel.js +1 -1
- package/lib/commands/cms/get/channel.js.map +1 -1
- package/lib/commands/cms/get/content.d.ts +1 -1
- package/lib/commands/cms/get/content.js +1 -1
- package/lib/commands/cms/get/content.js.map +1 -1
- package/lib/commands/cms/get/variant.d.ts +1 -1
- package/lib/commands/cms/get/variant.js +1 -1
- package/lib/commands/cms/get/variant.js.map +1 -1
- package/lib/commands/cms/get/workspace.d.ts +1 -1
- package/lib/commands/cms/get/workspace.js +1 -1
- package/lib/commands/cms/get/workspace.js.map +1 -1
- package/lib/commands/cms/import/workspace.d.ts +10 -6
- package/lib/commands/cms/import/workspace.js +127 -35
- package/lib/commands/cms/import/workspace.js.map +1 -1
- package/lib/commands/cms/info.d.ts +11 -10
- package/lib/commands/cms/info.js +123 -8
- package/lib/commands/cms/info.js.map +1 -1
- package/lib/commands/cms/list/channel.d.ts +1 -1
- package/lib/commands/cms/list/channel.js +1 -1
- package/lib/commands/cms/list/channel.js.map +1 -1
- package/lib/commands/cms/list/workspace.d.ts +1 -1
- package/lib/commands/cms/list/workspace.js +1 -1
- package/lib/commands/cms/list/workspace.js.map +1 -1
- package/lib/contracts/info.d.ts +43 -0
- package/lib/contracts/info.js +69 -0
- package/lib/contracts/info.js.map +1 -0
- package/lib/contracts/shared.d.ts +81 -0
- package/lib/contracts/shared.js +218 -0
- package/lib/contracts/shared.js.map +1 -0
- package/lib/contracts/workspace-export.d.ts +91 -0
- package/lib/contracts/workspace-export.js +324 -0
- package/lib/contracts/workspace-export.js.map +1 -0
- package/lib/contracts/workspace-import.d.ts +46 -0
- package/lib/contracts/workspace-import.js +108 -0
- package/lib/contracts/workspace-import.js.map +1 -0
- package/lib/index.d.ts +1 -1
- package/lib/services/bulk-export-workspaces.d.ts +25 -0
- package/lib/services/bulk-export-workspaces.js +272 -0
- package/lib/services/bulk-export-workspaces.js.map +1 -0
- package/lib/services/export-references.d.ts +21 -0
- package/lib/services/export-references.js +150 -0
- package/lib/services/export-references.js.map +1 -0
- package/lib/services/export-workspace.d.ts +12 -22
- package/lib/services/export-workspace.js +91 -2
- package/lib/services/export-workspace.js.map +1 -1
- package/lib/services/import-workspace.d.ts +7 -3
- package/lib/services/import-workspace.js +224 -96
- package/lib/services/import-workspace.js.map +1 -1
- package/lib/services/resolve-workspace.d.ts +20 -0
- package/lib/services/resolve-workspace.js +86 -0
- package/lib/services/resolve-workspace.js.map +1 -0
- package/messages/cms.export.workspace.md +31 -5
- package/messages/cms.import.workspace.md +17 -7
- package/messages/cms.info.md +21 -0
- package/package.json +3 -2
- package/lib/commands/cms/command-base.js.map +0 -1
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
export declare const CMS_CONTRACT_MAJOR: 1;
|
|
2
|
+
export declare const CMS_CONTRACT_VERSION: "1.0.0";
|
|
3
|
+
export declare const CMS_PLUGIN_NAME: "sf-plugin-cms";
|
|
4
|
+
export declare const CMS_STATUSES: readonly ["success", "partial", "failed", "blocked"];
|
|
5
|
+
export declare const CMS_OPERATIONS: readonly ["cms.info", "workspace.export.bulk", "workspace.import"];
|
|
6
|
+
export declare const CMS_REFERENCE_RESOLUTIONS: readonly ["included", "unresolved", "unsupported", "external"];
|
|
7
|
+
export declare const MAX_DIAGNOSTICS_PER_KIND = 100;
|
|
8
|
+
export declare const MAX_DIAGNOSTIC_MESSAGE_LENGTH = 1024;
|
|
9
|
+
export type CmsStatus = (typeof CMS_STATUSES)[number];
|
|
10
|
+
export type CmsOperation = (typeof CMS_OPERATIONS)[number];
|
|
11
|
+
export type CmsReferenceResolution = (typeof CMS_REFERENCE_RESOLUTIONS)[number];
|
|
12
|
+
export type CmsDiagnostic = {
|
|
13
|
+
code: string;
|
|
14
|
+
message: string;
|
|
15
|
+
scope?: string;
|
|
16
|
+
reference?: string;
|
|
17
|
+
retryable?: boolean;
|
|
18
|
+
};
|
|
19
|
+
export type CmsWarning = CmsDiagnostic;
|
|
20
|
+
export type CmsError = CmsDiagnostic;
|
|
21
|
+
export type CmsDiagnostics = {
|
|
22
|
+
warnings: CmsWarning[];
|
|
23
|
+
errors: CmsError[];
|
|
24
|
+
};
|
|
25
|
+
export type OpaqueCmsReference = {
|
|
26
|
+
referenceId: string;
|
|
27
|
+
owner: 'cms';
|
|
28
|
+
kind: string;
|
|
29
|
+
source: {
|
|
30
|
+
workspaceId: string;
|
|
31
|
+
sourceId: string;
|
|
32
|
+
};
|
|
33
|
+
portableKey: {
|
|
34
|
+
scheme: 'cms-opaque-v1';
|
|
35
|
+
value: string;
|
|
36
|
+
};
|
|
37
|
+
required: boolean;
|
|
38
|
+
resolution: CmsReferenceResolution;
|
|
39
|
+
};
|
|
40
|
+
export type CmsMetadata = {
|
|
41
|
+
operation: CmsOperation;
|
|
42
|
+
plugin: {
|
|
43
|
+
name: typeof CMS_PLUGIN_NAME;
|
|
44
|
+
version: string;
|
|
45
|
+
};
|
|
46
|
+
apiVersion: string | null;
|
|
47
|
+
};
|
|
48
|
+
export type CmsProvenance = {
|
|
49
|
+
producer: typeof CMS_PLUGIN_NAME;
|
|
50
|
+
sourceOrgId: string;
|
|
51
|
+
pluginVersion: string;
|
|
52
|
+
exportSetId?: string;
|
|
53
|
+
command: string;
|
|
54
|
+
generatedAt: string;
|
|
55
|
+
};
|
|
56
|
+
export type CmsEnvelope<T> = {
|
|
57
|
+
contract: string;
|
|
58
|
+
contractVersion: typeof CMS_CONTRACT_VERSION;
|
|
59
|
+
status: CmsStatus;
|
|
60
|
+
metadata: CmsMetadata;
|
|
61
|
+
diagnostics: CmsDiagnostics;
|
|
62
|
+
provenance: CmsProvenance;
|
|
63
|
+
result: T | null;
|
|
64
|
+
};
|
|
65
|
+
export type CmsEnvelopeFinalizer = {
|
|
66
|
+
emit: (envelope: CmsEnvelope<unknown>) => void;
|
|
67
|
+
setExitCode?: (exitCode: 0 | 1 | 2) => void;
|
|
68
|
+
};
|
|
69
|
+
export declare function assertSupportedMajor(version: unknown, label?: string): asserts version is 1;
|
|
70
|
+
export declare function assertExactKeys(value: unknown, keys: readonly string[], label: string): asserts value is Record<string, unknown>;
|
|
71
|
+
export declare function assertNonemptyString(value: unknown, label: string): asserts value is string;
|
|
72
|
+
export declare function assertIdentifier(value: unknown, label: string): asserts value is string;
|
|
73
|
+
export declare function assertReferenceId(value: unknown, label: string): asserts value is string;
|
|
74
|
+
export declare function assertSha256(value: unknown, label: string): asserts value is string;
|
|
75
|
+
export declare function assertRelativePosixPath(value: unknown, label: string): asserts value is string;
|
|
76
|
+
export declare function sanitizeDiagnostics(diagnostics: readonly CmsDiagnostic[], label: string): CmsDiagnostic[];
|
|
77
|
+
export declare function assertDiagnostics(value: unknown, label?: string): asserts value is CmsDiagnostics;
|
|
78
|
+
export declare function assertOpaqueCmsReference(value: unknown, label?: string): asserts value is OpaqueCmsReference;
|
|
79
|
+
export declare function assertCmsEnvelope<T>(value: unknown, resultValidator: (result: unknown, provenance?: CmsProvenance, status?: CmsStatus) => asserts result is T): asserts value is CmsEnvelope<T>;
|
|
80
|
+
export declare function serializeCmsEnvelope<T>(envelope: CmsEnvelope<T>, resultValidator: (result: unknown, provenance?: CmsProvenance) => asserts result is T): string;
|
|
81
|
+
export declare function finalizeCmsEnvelope<T>(envelope: CmsEnvelope<T>, resultValidator: (result: unknown, provenance?: CmsProvenance) => asserts result is T, finalizer: CmsEnvelopeFinalizer): CmsEnvelope<T>;
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import { redactSecrets } from '../transport/redact-secrets.js';
|
|
2
|
+
export const CMS_CONTRACT_MAJOR = 1;
|
|
3
|
+
export const CMS_CONTRACT_VERSION = '1.0.0';
|
|
4
|
+
export const CMS_PLUGIN_NAME = 'sf-plugin-cms';
|
|
5
|
+
export const CMS_STATUSES = ['success', 'partial', 'failed', 'blocked'];
|
|
6
|
+
export const CMS_OPERATIONS = ['cms.info', 'workspace.export.bulk', 'workspace.import'];
|
|
7
|
+
export const CMS_REFERENCE_RESOLUTIONS = [
|
|
8
|
+
'included',
|
|
9
|
+
'unresolved',
|
|
10
|
+
'unsupported',
|
|
11
|
+
'external',
|
|
12
|
+
];
|
|
13
|
+
export const MAX_DIAGNOSTICS_PER_KIND = 100;
|
|
14
|
+
export const MAX_DIAGNOSTIC_MESSAGE_LENGTH = 1024;
|
|
15
|
+
export function assertSupportedMajor(version, label = 'contractVersion') {
|
|
16
|
+
if (version !== CMS_CONTRACT_MAJOR)
|
|
17
|
+
throw new TypeError(`${label} must be supported major 1`);
|
|
18
|
+
}
|
|
19
|
+
export function assertExactKeys(value, keys, label) {
|
|
20
|
+
if (!isRecord(value))
|
|
21
|
+
throw new TypeError(`${label} must be an object`);
|
|
22
|
+
const actual = Object.keys(value).toSorted();
|
|
23
|
+
const expected = [...keys].toSorted();
|
|
24
|
+
if (JSON.stringify(actual) !== JSON.stringify(expected)) {
|
|
25
|
+
throw new TypeError(`${label} must contain exactly: ${expected.join(', ')}`);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
export function assertNonemptyString(value, label) {
|
|
29
|
+
if (typeof value !== 'string' || value.length === 0) {
|
|
30
|
+
throw new TypeError(`${label} must be a nonempty string`);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
export function assertIdentifier(value, label) {
|
|
34
|
+
assertNonemptyString(value, label);
|
|
35
|
+
if (value.includes('/') ||
|
|
36
|
+
value.includes('\\') ||
|
|
37
|
+
[...value].some((character) => {
|
|
38
|
+
const codePoint = character.codePointAt(0) ?? 0;
|
|
39
|
+
return codePoint <= 31 || codePoint === 127;
|
|
40
|
+
})) {
|
|
41
|
+
throw new TypeError(`${label} is invalid`);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
export function assertReferenceId(value, label) {
|
|
45
|
+
if (typeof value !== 'string' || !/^ref:[a-f\d]{64}$/u.test(value)) {
|
|
46
|
+
throw new TypeError(`${label} must be a canonical reference ID`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
export function assertSha256(value, label) {
|
|
50
|
+
if (typeof value !== 'string' || !/^[a-f\d]{64}$/u.test(value)) {
|
|
51
|
+
throw new TypeError(`${label} must be a lowercase SHA-256`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
export function assertRelativePosixPath(value, label) {
|
|
55
|
+
assertNonemptyString(value, label);
|
|
56
|
+
if (value.includes('\\') || value.startsWith('/') || /^[A-Za-z]:/u.test(value)) {
|
|
57
|
+
throw new TypeError(`${label} must be a relative POSIX path`);
|
|
58
|
+
}
|
|
59
|
+
const portable = value.startsWith('./') ? value.slice(2) : value;
|
|
60
|
+
if (portable.length === 0 ||
|
|
61
|
+
portable.split('/').some((segment) => segment === '' || segment === '.' || segment === '..')) {
|
|
62
|
+
throw new TypeError(`${label} must not contain empty or traversal segments`);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
export function sanitizeDiagnostics(diagnostics, label) {
|
|
66
|
+
if (diagnostics.length > MAX_DIAGNOSTICS_PER_KIND) {
|
|
67
|
+
throw new TypeError(`${label} exceeds ${MAX_DIAGNOSTICS_PER_KIND} entries`);
|
|
68
|
+
}
|
|
69
|
+
return diagnostics.map((diagnostic, index) => {
|
|
70
|
+
assertDiagnostic(diagnostic, `${label}[${index}]`);
|
|
71
|
+
const message = redactSecrets(diagnostic.message);
|
|
72
|
+
if (message.length > MAX_DIAGNOSTIC_MESSAGE_LENGTH) {
|
|
73
|
+
throw new TypeError(`${label}[${index}].message exceeds ${MAX_DIAGNOSTIC_MESSAGE_LENGTH} characters`);
|
|
74
|
+
}
|
|
75
|
+
return { ...diagnostic, message };
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
export function assertDiagnostics(value, label = 'diagnostics') {
|
|
79
|
+
assertExactKeys(value, ['warnings', 'errors'], label);
|
|
80
|
+
if (!Array.isArray(value.warnings) || !Array.isArray(value.errors)) {
|
|
81
|
+
throw new TypeError(`${label} arrays are required`);
|
|
82
|
+
}
|
|
83
|
+
sanitizeDiagnostics(value.warnings, `${label}.warnings`);
|
|
84
|
+
sanitizeDiagnostics(value.errors, `${label}.errors`);
|
|
85
|
+
for (const [kind, entries] of [
|
|
86
|
+
['warnings', value.warnings],
|
|
87
|
+
['errors', value.errors],
|
|
88
|
+
]) {
|
|
89
|
+
for (const [index, diagnostic] of entries.entries()) {
|
|
90
|
+
if (redactSecrets(diagnostic.message) !== diagnostic.message) {
|
|
91
|
+
throw new TypeError(`${label}.${kind}[${index}].message must already be redacted`);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
export function assertOpaqueCmsReference(value, label = 'reference') {
|
|
97
|
+
assertExactKeys(value, ['referenceId', 'owner', 'kind', 'source', 'portableKey', 'required', 'resolution'], label);
|
|
98
|
+
assertReferenceId(value.referenceId, `${label}.referenceId`);
|
|
99
|
+
if (value.owner !== 'cms')
|
|
100
|
+
throw new TypeError(`${label}.owner must be cms`);
|
|
101
|
+
assertIdentifier(value.kind, `${label}.kind`);
|
|
102
|
+
assertExactKeys(value.source, ['workspaceId', 'sourceId'], `${label}.source`);
|
|
103
|
+
assertIdentifier(value.source.workspaceId, `${label}.source.workspaceId`);
|
|
104
|
+
assertIdentifier(value.source.sourceId, `${label}.source.sourceId`);
|
|
105
|
+
assertExactKeys(value.portableKey, ['scheme', 'value'], `${label}.portableKey`);
|
|
106
|
+
if (value.portableKey.scheme !== 'cms-opaque-v1') {
|
|
107
|
+
throw new TypeError(`${label}.portableKey.scheme is unsupported`);
|
|
108
|
+
}
|
|
109
|
+
assertNonemptyString(value.portableKey.value, `${label}.portableKey.value`);
|
|
110
|
+
if (typeof value.required !== 'boolean')
|
|
111
|
+
throw new TypeError(`${label}.required must be boolean`);
|
|
112
|
+
if (!CMS_REFERENCE_RESOLUTIONS.includes(value.resolution)) {
|
|
113
|
+
throw new TypeError(`${label}.resolution is unsupported`);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
export function assertCmsEnvelope(value, resultValidator) {
|
|
117
|
+
assertExactKeys(value, ['contract', 'contractVersion', 'status', 'metadata', 'diagnostics', 'provenance', 'result'], 'envelope');
|
|
118
|
+
assertNonemptyString(value.contract, 'envelope.contract');
|
|
119
|
+
if (value.contractVersion !== CMS_CONTRACT_VERSION) {
|
|
120
|
+
throw new TypeError('envelope.contractVersion must be 1.0.0');
|
|
121
|
+
}
|
|
122
|
+
if (!CMS_STATUSES.includes(value.status))
|
|
123
|
+
throw new TypeError('envelope.status is invalid');
|
|
124
|
+
assertMetadata(value.metadata);
|
|
125
|
+
const expectedContract = new Map([
|
|
126
|
+
['cms.info', 'sf-cms-info'],
|
|
127
|
+
['workspace.export.bulk', 'sf-cms-workspace-export-set'],
|
|
128
|
+
['workspace.import', 'sf-cms-workspace-import'],
|
|
129
|
+
]);
|
|
130
|
+
if (value.contract !== expectedContract.get(value.metadata.operation)) {
|
|
131
|
+
throw new TypeError('envelope.contract does not match metadata.operation');
|
|
132
|
+
}
|
|
133
|
+
assertDiagnostics(value.diagnostics);
|
|
134
|
+
assertProvenance(value.provenance);
|
|
135
|
+
if (value.provenance.pluginVersion !== value.metadata.plugin.version) {
|
|
136
|
+
throw new TypeError('envelope provenance pluginVersion must match metadata.plugin.version');
|
|
137
|
+
}
|
|
138
|
+
if (value.result === null) {
|
|
139
|
+
if (value.status !== 'failed' && value.status !== 'blocked') {
|
|
140
|
+
throw new TypeError('envelope.result may be null only for failed or blocked status');
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
resultValidator(value.result, value.provenance, value.status);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
export function serializeCmsEnvelope(envelope, resultValidator) {
|
|
148
|
+
assertCmsEnvelope(envelope, resultValidator);
|
|
149
|
+
return `${JSON.stringify(envelope, null, 2)}\n`;
|
|
150
|
+
}
|
|
151
|
+
export function finalizeCmsEnvelope(envelope, resultValidator, finalizer) {
|
|
152
|
+
assertCmsEnvelope(envelope, resultValidator);
|
|
153
|
+
finalizer.emit(envelope);
|
|
154
|
+
finalizer.setExitCode?.(exitCodeForStatus(envelope.status));
|
|
155
|
+
return envelope;
|
|
156
|
+
}
|
|
157
|
+
function exitCodeForStatus(status) {
|
|
158
|
+
if (status === 'success')
|
|
159
|
+
return 0;
|
|
160
|
+
if (status === 'partial')
|
|
161
|
+
return 2;
|
|
162
|
+
return 1;
|
|
163
|
+
}
|
|
164
|
+
function assertDiagnostic(value, label) {
|
|
165
|
+
if (!isRecord(value))
|
|
166
|
+
throw new TypeError(`${label} must be an object`);
|
|
167
|
+
const allowed = new Set(['code', 'message', 'scope', 'reference', 'retryable']);
|
|
168
|
+
if (Object.keys(value).some((key) => !allowed.has(key))) {
|
|
169
|
+
throw new TypeError(`${label} contains an unknown key`);
|
|
170
|
+
}
|
|
171
|
+
assertNonemptyString(value.code, `${label}.code`);
|
|
172
|
+
assertNonemptyString(value.message, `${label}.message`);
|
|
173
|
+
for (const key of ['scope', 'reference']) {
|
|
174
|
+
if (value[key] !== undefined)
|
|
175
|
+
assertNonemptyString(value[key], `${label}.${key}`);
|
|
176
|
+
}
|
|
177
|
+
if (value.retryable !== undefined && typeof value.retryable !== 'boolean') {
|
|
178
|
+
throw new TypeError(`${label}.retryable must be boolean`);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
function assertMetadata(value) {
|
|
182
|
+
assertExactKeys(value, ['operation', 'plugin', 'apiVersion'], 'envelope.metadata');
|
|
183
|
+
if (!CMS_OPERATIONS.includes(value.operation)) {
|
|
184
|
+
throw new TypeError('envelope.metadata.operation is invalid');
|
|
185
|
+
}
|
|
186
|
+
assertExactKeys(value.plugin, ['name', 'version'], 'envelope.metadata.plugin');
|
|
187
|
+
if (value.plugin.name !== CMS_PLUGIN_NAME)
|
|
188
|
+
throw new TypeError('envelope.metadata.plugin.name is invalid');
|
|
189
|
+
assertNonemptyString(value.plugin.version, 'envelope.metadata.plugin.version');
|
|
190
|
+
if (value.apiVersion !== null)
|
|
191
|
+
assertNonemptyString(value.apiVersion, 'envelope.metadata.apiVersion');
|
|
192
|
+
}
|
|
193
|
+
function assertProvenance(value) {
|
|
194
|
+
if (!isRecord(value))
|
|
195
|
+
throw new TypeError('envelope.provenance must be an object');
|
|
196
|
+
const required = ['producer', 'sourceOrgId', 'pluginVersion', 'command', 'generatedAt'];
|
|
197
|
+
const allowed = new Set([...required, 'exportSetId']);
|
|
198
|
+
if (required.some((key) => !(key in value)) ||
|
|
199
|
+
Object.keys(value).some((key) => !allowed.has(key))) {
|
|
200
|
+
throw new TypeError('envelope.provenance has invalid keys');
|
|
201
|
+
}
|
|
202
|
+
if (value.producer !== CMS_PLUGIN_NAME)
|
|
203
|
+
throw new TypeError('envelope.provenance.producer is invalid');
|
|
204
|
+
assertIdentifier(value.sourceOrgId, 'envelope.provenance.sourceOrgId');
|
|
205
|
+
assertNonemptyString(value.pluginVersion, 'envelope.provenance.pluginVersion');
|
|
206
|
+
assertNonemptyString(value.command, 'envelope.provenance.command');
|
|
207
|
+
assertNonemptyString(value.generatedAt, 'envelope.provenance.generatedAt');
|
|
208
|
+
if (Number.isNaN(Date.parse(value.generatedAt)))
|
|
209
|
+
throw new TypeError('envelope.provenance.generatedAt is invalid');
|
|
210
|
+
if (value.exportSetId !== undefined &&
|
|
211
|
+
!/^export-set:[a-f\d]{64}$/u.test(value.exportSetId)) {
|
|
212
|
+
throw new TypeError('envelope.provenance.exportSetId is invalid');
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
function isRecord(value) {
|
|
216
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
217
|
+
}
|
|
218
|
+
//# sourceMappingURL=shared.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../src/contracts/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAE/D,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAU,CAAC;AAC7C,MAAM,CAAC,MAAM,oBAAoB,GAAG,OAAgB,CAAC;AACrD,MAAM,CAAC,MAAM,eAAe,GAAG,eAAwB,CAAC;AACxD,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,CAAU,CAAC;AACjF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,UAAU,EAAE,uBAAuB,EAAE,kBAAkB,CAAU,CAAC;AACjG,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,UAAU;IACV,YAAY;IACZ,aAAa;IACb,UAAU;CACF,CAAC;AACX,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,CAAC;AAC5C,MAAM,CAAC,MAAM,6BAA6B,GAAG,IAAI,CAAC;AAuElD,MAAM,UAAU,oBAAoB,CAClC,OAAgB,EAChB,KAAK,GAAG,iBAAiB;IAEzB,IAAI,OAAO,KAAK,kBAAkB;QAAE,MAAM,IAAI,SAAS,CAAC,GAAG,KAAK,4BAA4B,CAAC,CAAC;AAChG,CAAC;AAED,MAAM,UAAU,eAAe,CAC7B,KAAc,EACd,IAAuB,EACvB,KAAa;IAEb,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,MAAM,IAAI,SAAS,CAAC,GAAG,KAAK,oBAAoB,CAAC,CAAC;IACxE,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,CAAC;IAC7C,MAAM,QAAQ,GAA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C;IACD,IAAI,KAAK,CAAC,QAAQ,KAAK,eAAe;QACpC,MAAM,IAAI,SAAS,CAAC,yCAAyC,CAAC,CAAC;IACjE,gBAAgB,CAAC,KAAK,CAAC,WAAW,EAAE,iCAAiC,CAAC,CAAC;IACvE,oBAAoB,CAAC,KAAK,CAAC,aAAa,EAAE,mCAAmC,CAAC,CAAC;IAC/E,oBAAoB,CAAC,KAAK,CAAC,OAAO,EAAE,6BAA6B,CAAC,CAAC;IACnE,oBAAoB,CAAC,KAAK,CAAC,WAAW,EAAE,iCAAiC,CAAC,CAAC;IAC3E,IAAI,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QAC7C,MAAM,IAAI,SAAS,CAAC,4CAA4C,CAAC,CAAC;IACpE,IACE,KAAK,CAAC,WAAW,KAAK,SAAS;QAC/B,CAAC,2BAA2B,CAAC,IAAI,CAAC,KAAK,CAAC,WAAqB,CAAC,EAC9D,CAAC;QACD,MAAM,IAAI,SAAS,CAAC,4CAA4C,CAAC,CAAC;IACpE,CAAC;AACH,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { type CmsDiagnostics, type CmsProvenance, type OpaqueCmsReference } from './shared.js';
|
|
2
|
+
export declare const WORKSPACE_EXPORT_SET_CONTRACT: "sf-cms-workspace-export-set";
|
|
3
|
+
export declare const WORKSPACE_EXPORT_MANIFEST_CONTRACT: "sf-cms-workspace-export";
|
|
4
|
+
export declare const EXTERNAL_REFERENCE_CORRELATIONS_CONTRACT: "sf-cms-external-reference-correlations@1";
|
|
5
|
+
export type WorkspaceExportManifestItem = {
|
|
6
|
+
path: string;
|
|
7
|
+
sha256: string;
|
|
8
|
+
kind: string;
|
|
9
|
+
referenceId?: string;
|
|
10
|
+
};
|
|
11
|
+
export type WorkspaceExportManifest = {
|
|
12
|
+
schemaVersion: 1;
|
|
13
|
+
mode: 'experimental-best-effort';
|
|
14
|
+
workspaceId: string;
|
|
15
|
+
search: {
|
|
16
|
+
contentSpaceOrFolderIds: [string];
|
|
17
|
+
languages: ['All'];
|
|
18
|
+
pageSize: 250;
|
|
19
|
+
queryTerm: '*';
|
|
20
|
+
};
|
|
21
|
+
expectedCount: number;
|
|
22
|
+
foundCount: number;
|
|
23
|
+
exportedCount: number;
|
|
24
|
+
pagesRequested: number;
|
|
25
|
+
entries: Array<{
|
|
26
|
+
file: string;
|
|
27
|
+
variantId: string;
|
|
28
|
+
}>;
|
|
29
|
+
rejectedVariantIds: string[];
|
|
30
|
+
failedVariantIds: string[];
|
|
31
|
+
warnings: Array<{
|
|
32
|
+
code: 'COUNT_MISMATCH' | 'DETAIL_FAILED' | 'DUPLICATE_VARIANTS' | 'OWNERSHIP_MISMATCH' | 'PREMATURE_EMPTY_PAGE' | 'REFERENCE_UNRESOLVED' | 'REFERENCE_UNSUPPORTED' | 'UNSUPPORTED_WILDCARD';
|
|
33
|
+
message: string;
|
|
34
|
+
variantIds?: string[];
|
|
35
|
+
}>;
|
|
36
|
+
contract: typeof WORKSPACE_EXPORT_MANIFEST_CONTRACT;
|
|
37
|
+
contractVersion: '1.0.0';
|
|
38
|
+
provenance: {
|
|
39
|
+
producer: 'sf-plugin-cms';
|
|
40
|
+
sourceOrgId: string;
|
|
41
|
+
sourceWorkspaceId: string;
|
|
42
|
+
pluginVersion: string;
|
|
43
|
+
generatedAt: string;
|
|
44
|
+
};
|
|
45
|
+
completeness: 'complete' | 'partial';
|
|
46
|
+
dependencies: string[];
|
|
47
|
+
externalReferences: OpaqueCmsReference[];
|
|
48
|
+
items: WorkspaceExportManifestItem[];
|
|
49
|
+
};
|
|
50
|
+
export type ExternalReferenceCorrelation = {
|
|
51
|
+
sourceWorkspaceId: string;
|
|
52
|
+
sourceReference: string;
|
|
53
|
+
referenceKind: string;
|
|
54
|
+
referenceId: string;
|
|
55
|
+
packageManifestSha256: string;
|
|
56
|
+
};
|
|
57
|
+
export type WorkspaceExportSetEntry = {
|
|
58
|
+
source: {
|
|
59
|
+
kind: 'cms.workspace';
|
|
60
|
+
sourceId: string;
|
|
61
|
+
name: string;
|
|
62
|
+
workspaceType: 'Marketing' | 'Content';
|
|
63
|
+
};
|
|
64
|
+
status: 'success' | 'partial' | 'failed';
|
|
65
|
+
artifact: {
|
|
66
|
+
path: string;
|
|
67
|
+
manifestPath: string;
|
|
68
|
+
manifestContract: typeof WORKSPACE_EXPORT_MANIFEST_CONTRACT;
|
|
69
|
+
manifestContractVersion: '1.0.0';
|
|
70
|
+
manifestSha256: string;
|
|
71
|
+
} | null;
|
|
72
|
+
diagnostics: CmsDiagnostics;
|
|
73
|
+
};
|
|
74
|
+
export type WorkspaceExportSetResult = {
|
|
75
|
+
workspaceType: 'Marketing' | 'Content';
|
|
76
|
+
outputDirectory: string;
|
|
77
|
+
selection: {
|
|
78
|
+
mode: 'all';
|
|
79
|
+
discoveredCount: number;
|
|
80
|
+
selectedCount: number;
|
|
81
|
+
};
|
|
82
|
+
summary: {
|
|
83
|
+
succeededCount: number;
|
|
84
|
+
partialCount: number;
|
|
85
|
+
failedCount: number;
|
|
86
|
+
};
|
|
87
|
+
externalReferenceCorrelations: ExternalReferenceCorrelation[];
|
|
88
|
+
workspaces: WorkspaceExportSetEntry[];
|
|
89
|
+
};
|
|
90
|
+
export declare function assertWorkspaceExportManifest(value: unknown): asserts value is WorkspaceExportManifest;
|
|
91
|
+
export declare function assertWorkspaceExportSetResult(value: unknown, provenance?: CmsProvenance, status?: 'success' | 'partial' | 'failed' | 'blocked'): asserts value is WorkspaceExportSetResult;
|