sf-plugin-data 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +257 -2
- package/bin/run.js +4 -0
- package/docs/artifact-format.md +633 -0
- package/docs/capabilities.md +217 -0
- package/docs/git-workflow.md +37 -0
- package/docs/handover.md +2632 -0
- package/lib/artifacts/dmo-document.d.ts +181 -0
- package/lib/artifacts/dmo-document.js +848 -0
- package/lib/artifacts/dmo-update-delta.d.ts +28 -0
- package/lib/artifacts/dmo-update-delta.js +86 -0
- package/lib/artifacts/read-deploy-input.d.ts +23 -0
- package/lib/artifacts/read-deploy-input.js +199 -0
- package/lib/artifacts/write-other-dmo.d.ts +17 -0
- package/lib/artifacts/write-other-dmo.js +140 -0
- package/lib/commands/data360/deploy.d.ts +84 -0
- package/lib/commands/data360/deploy.js +208 -0
- package/lib/commands/data360/retrieve.d.ts +75 -0
- package/lib/commands/data360/retrieve.js +168 -0
- package/lib/plugin.d.ts +4 -0
- package/lib/plugin.js +3 -0
- package/lib/services/execute-dmo-create.d.ts +24 -0
- package/lib/services/execute-dmo-create.js +118 -0
- package/lib/services/execute-dmo-deploy.d.ts +33 -0
- package/lib/services/execute-dmo-deploy.js +197 -0
- package/lib/services/preflight-dmo-deploy.d.ts +69 -0
- package/lib/services/preflight-dmo-deploy.js +161 -0
- package/lib/services/retrieve-other-dmo.d.ts +46 -0
- package/lib/services/retrieve-other-dmo.js +140 -0
- package/lib/transport/connect-client.d.ts +67 -0
- package/lib/transport/connect-client.js +306 -0
- package/package.json +73 -4
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
declare const fieldTypes: readonly ["Number", "Text", "Date", "DateTime", "Url", "Phone", "Email", "Percent", "Boolean", "Currency", "ArrayOfFloats", "ArrayOfTexts"];
|
|
2
|
+
export type DmoField = {
|
|
3
|
+
name: string;
|
|
4
|
+
label: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
dataType: (typeof fieldTypes)[number];
|
|
7
|
+
category?: string;
|
|
8
|
+
isPrimaryKey: boolean;
|
|
9
|
+
isDynamicLookup: boolean;
|
|
10
|
+
};
|
|
11
|
+
export type DmoDocument = {
|
|
12
|
+
schemaVersion: 1;
|
|
13
|
+
kind: 'dmo';
|
|
14
|
+
identity: {
|
|
15
|
+
dataSpace: string;
|
|
16
|
+
apiName: string;
|
|
17
|
+
};
|
|
18
|
+
spec: {
|
|
19
|
+
label: string;
|
|
20
|
+
description?: string;
|
|
21
|
+
category: 'Profile' | 'Other' | 'Engagement';
|
|
22
|
+
eventDateTimeFieldName?: string;
|
|
23
|
+
recordModifiedFieldName?: string;
|
|
24
|
+
fields: DmoField[];
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
/** Payload-free local contract failure; never interpolate untrusted document values. */
|
|
28
|
+
export declare class DmoDocumentError extends Error {
|
|
29
|
+
constructor();
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Classify documented raw keys only; configuration still needs lossless adapter handling.
|
|
33
|
+
* @param {'object' | 'field'} level Raw response level.
|
|
34
|
+
* @param {string} key Response property name.
|
|
35
|
+
* @returns {'configuration' | 'observation' | 'unknown'} Unknown keys must block export.
|
|
36
|
+
*/
|
|
37
|
+
export declare function classifyDmoRawField(level: 'object' | 'field', key: string): 'configuration' | 'observation' | 'unknown';
|
|
38
|
+
/**
|
|
39
|
+
* Validate the initial custom-schema subset, without coercion or an API-support claim.
|
|
40
|
+
* @param {unknown} value Parsed JSON document (not a raw org response).
|
|
41
|
+
* @returns {DmoDocument} The validated document; no projection or field removal occurs.
|
|
42
|
+
*/
|
|
43
|
+
export declare function validateDmoDocument(value: unknown): DmoDocument;
|
|
44
|
+
export type DmoFieldProjection = {
|
|
45
|
+
status: 'incomplete';
|
|
46
|
+
blockers: string[];
|
|
47
|
+
candidate: DmoDocument;
|
|
48
|
+
/** All raw configuration, including generated fields; never a deploy input. */
|
|
49
|
+
configuration: Record<string, unknown>;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Project custom fields while retaining every raw configuration value in an incomplete result.
|
|
53
|
+
* @param {unknown} value Raw custom DMO detail, not a list or a portable document.
|
|
54
|
+
* @returns {DmoFieldProjection} Diagnostic candidate only; relationship acquisition is still required.
|
|
55
|
+
*/
|
|
56
|
+
export declare function projectDmoRawFields(value: unknown): DmoFieldProjection;
|
|
57
|
+
export type DmoJoinedFields = {
|
|
58
|
+
fields: DmoField[];
|
|
59
|
+
qualifierBindings: Array<{
|
|
60
|
+
fieldName: string;
|
|
61
|
+
qualifierFieldName: string;
|
|
62
|
+
}>;
|
|
63
|
+
blockers: string[];
|
|
64
|
+
expectations: {
|
|
65
|
+
connect: Array<Record<string, unknown>>;
|
|
66
|
+
metadata: Array<Record<string, unknown>>;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Join common field semantics without qualifying object configuration or generated replay.
|
|
71
|
+
* @param {unknown} connectFields Complete Connect field collection.
|
|
72
|
+
* @param {unknown} metadataFields Complete Metadata field collection.
|
|
73
|
+
* @returns {DmoJoinedFields} Authored fields, exact qualifier bindings and unresolved replay semantics.
|
|
74
|
+
*/
|
|
75
|
+
export declare function joinDmoConnectMetadataFields(connectFields: unknown, metadataFields: unknown): DmoJoinedFields;
|
|
76
|
+
export type DmoCommonProjection = {
|
|
77
|
+
status: 'projected' | 'incomplete';
|
|
78
|
+
blockers: string[];
|
|
79
|
+
/** Absent when an Engagement event designation is unavailable. */
|
|
80
|
+
candidate?: DmoDocument;
|
|
81
|
+
createIdentity: {
|
|
82
|
+
status: 'verified';
|
|
83
|
+
name: string;
|
|
84
|
+
sourceApiName: string;
|
|
85
|
+
};
|
|
86
|
+
qualifierBindings: DmoJoinedFields['qualifierBindings'];
|
|
87
|
+
expectations: {
|
|
88
|
+
connect: Record<string, unknown>;
|
|
89
|
+
metadata: Record<string, unknown>;
|
|
90
|
+
relationships: unknown[];
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* Compose exact common object joins and qualify only evidenced replay semantics.
|
|
95
|
+
* @param {unknown} connect Complete Connect object detail.
|
|
96
|
+
* @param {unknown} metadata Exact matching Metadata CustomObject.
|
|
97
|
+
* @param {unknown} relationships Complete separately acquired relationship inventory.
|
|
98
|
+
* @returns {DmoCommonProjection} Qualified authored candidate or precise incomplete diagnostics.
|
|
99
|
+
*/
|
|
100
|
+
export declare function projectCommonDmoConnectMetadata(connect: unknown, metadata: unknown, relationships: unknown): DmoCommonProjection;
|
|
101
|
+
export type DmoConnectMetadataProjection = {
|
|
102
|
+
status: 'projected';
|
|
103
|
+
blockers: [];
|
|
104
|
+
candidate: DmoDocument;
|
|
105
|
+
createIdentity: {
|
|
106
|
+
status: 'verified';
|
|
107
|
+
name: string;
|
|
108
|
+
sourceApiName: string;
|
|
109
|
+
};
|
|
110
|
+
qualifierBindings: Array<{
|
|
111
|
+
fieldName: string;
|
|
112
|
+
qualifierFieldName: string;
|
|
113
|
+
}>;
|
|
114
|
+
/** Complete admitted readback contracts, not writable Metadata API input. */
|
|
115
|
+
expectations: {
|
|
116
|
+
connect: Record<string, unknown>;
|
|
117
|
+
metadata: Record<string, unknown>;
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* Join the proven relationship-free Other shape and invert its documented custom DMO suffix.
|
|
122
|
+
* @param {unknown} connect Connect DMO detail.
|
|
123
|
+
* @param {unknown} metadata Matching Metadata API CustomObject.
|
|
124
|
+
* @param {unknown} relationships Complete separately acquired relationship inventory.
|
|
125
|
+
* @returns {DmoConnectMetadataProjection} Offline projection, verified create identity and exact readback expectations.
|
|
126
|
+
*/
|
|
127
|
+
export declare function projectDmoConnectMetadata(connect: unknown, metadata: unknown, relationships: unknown): DmoConnectMetadataProjection;
|
|
128
|
+
export type DmoCreateRequest = {
|
|
129
|
+
name: string;
|
|
130
|
+
label: string;
|
|
131
|
+
description?: string;
|
|
132
|
+
dataSpaceName: 'default';
|
|
133
|
+
category: DmoDocument['spec']['category'];
|
|
134
|
+
eventDateTimeFieldName?: string;
|
|
135
|
+
recordModifiedFieldName?: string;
|
|
136
|
+
fields: Array<{
|
|
137
|
+
name: string;
|
|
138
|
+
label: string;
|
|
139
|
+
dataType: DmoField['dataType'];
|
|
140
|
+
description?: string;
|
|
141
|
+
category?: string;
|
|
142
|
+
isPrimaryKey: boolean;
|
|
143
|
+
isDynamicLookup: boolean;
|
|
144
|
+
}>;
|
|
145
|
+
};
|
|
146
|
+
/**
|
|
147
|
+
* Map authored custom schema to the documented Connect input, not a raw response.
|
|
148
|
+
* @param {unknown} value Parsed authored document, never a runtime projection.
|
|
149
|
+
* @param {unknown} targetDataSpace Explicit target binding; this slice supports default only.
|
|
150
|
+
* @returns {DmoCreateRequest} Fresh allowlisted request, without a runtime acceptance claim.
|
|
151
|
+
*/
|
|
152
|
+
export declare function buildDmoCreateRequestFromDocument(value: unknown, targetDataSpace: unknown): DmoCreateRequest;
|
|
153
|
+
export type OtherDmoCreateRequest = {
|
|
154
|
+
name: string;
|
|
155
|
+
label: string;
|
|
156
|
+
description?: string;
|
|
157
|
+
dataSpaceName: 'default';
|
|
158
|
+
category: 'Other';
|
|
159
|
+
fields: Array<Pick<DmoField, 'name' | 'label' | 'dataType' | 'isPrimaryKey' | 'isDynamicLookup'>>;
|
|
160
|
+
};
|
|
161
|
+
/**
|
|
162
|
+
* Construct only the evidenced default-space Other request, rechecking the complete projection.
|
|
163
|
+
* @param {unknown} value Joined projection, including its independent readback expectations.
|
|
164
|
+
* @param {unknown} targetDataSpace Explicit target binding; only default has replay evidence.
|
|
165
|
+
* @returns {OtherDmoCreateRequest} Fresh authored-only request; no transport or generated-field replay.
|
|
166
|
+
*/
|
|
167
|
+
export declare function buildOtherDmoCreateRequest(value: unknown, targetDataSpace: unknown): OtherDmoCreateRequest;
|
|
168
|
+
/**
|
|
169
|
+
* Map an authored document independently of internal source-readback expectations.
|
|
170
|
+
* @param {unknown} value Parsed authored document, never a runtime projection.
|
|
171
|
+
* @param {unknown} targetDataSpace Explicit target binding; only default has replay evidence.
|
|
172
|
+
* @returns {OtherDmoCreateRequest} Fresh request for the evidenced two-field Other subset.
|
|
173
|
+
*/
|
|
174
|
+
export declare function buildOtherDmoCreateRequestFromDocument(value: unknown, targetDataSpace: unknown): OtherDmoCreateRequest;
|
|
175
|
+
/**
|
|
176
|
+
* Serialize validated DMO JSON with sorted object keys, original arrays and a final LF.
|
|
177
|
+
* @param {unknown} value Parsed portable document.
|
|
178
|
+
* @returns {string} Deterministic JSON text; UTF-8 encoding belongs to the future writer.
|
|
179
|
+
*/
|
|
180
|
+
export declare function serializeDmoDocument(value: unknown): string;
|
|
181
|
+
export {};
|