sf-plugin-data 0.0.0-stage → 0.2.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 +589 -2
- package/bin/run.js +4 -0
- package/docs/artifact-format.md +527 -0
- package/docs/capabilities.md +1208 -0
- package/docs/git-workflow.md +160 -0
- package/docs/handover.md +10446 -0
- package/lib/api.d.ts +7 -0
- package/lib/api.js +7 -0
- package/lib/artifacts/code-fields.d.ts +49 -0
- package/lib/artifacts/code-fields.js +142 -0
- package/lib/artifacts/data-graph-document.d.ts +29 -0
- package/lib/artifacts/data-graph-document.js +52 -0
- package/lib/artifacts/data-space-field.d.ts +65 -0
- package/lib/artifacts/data-space-field.js +98 -0
- package/lib/artifacts/data-stream-document.d.ts +264 -0
- package/lib/artifacts/data-stream-document.js +680 -0
- package/lib/artifacts/data-transform-document.d.ts +152 -0
- package/lib/artifacts/data-transform-document.js +560 -0
- package/lib/artifacts/dependency-selection.d.ts +51 -0
- package/lib/artifacts/dependency-selection.js +154 -0
- package/lib/artifacts/dlo-document.d.ts +93 -0
- package/lib/artifacts/dlo-document.js +253 -0
- package/lib/artifacts/enum-case.d.ts +39 -0
- package/lib/artifacts/enum-case.js +67 -0
- package/lib/artifacts/git-deploy-selection.d.ts +68 -0
- package/lib/artifacts/git-deploy-selection.js +474 -0
- package/lib/artifacts/identity-resolution-document.d.ts +133 -0
- package/lib/artifacts/identity-resolution-document.js +625 -0
- package/lib/artifacts/mapping-document.d.ts +1 -0
- package/lib/artifacts/mapping-document.js +1 -0
- package/lib/artifacts/native-calculated-insight-document.d.ts +142 -0
- package/lib/artifacts/native-calculated-insight-document.js +321 -0
- package/lib/artifacts/native-data-graph-document.d.ts +124 -0
- package/lib/artifacts/native-data-graph-document.js +780 -0
- package/lib/artifacts/native-dmo-document.d.ts +151 -0
- package/lib/artifacts/native-dmo-document.js +313 -0
- package/lib/artifacts/native-mapping-document.d.ts +67 -0
- package/lib/artifacts/native-mapping-document.js +187 -0
- package/lib/artifacts/native-relationship-document.d.ts +76 -0
- package/lib/artifacts/native-relationship-document.js +232 -0
- package/lib/artifacts/path-selector.d.ts +55 -0
- package/lib/artifacts/path-selector.js +167 -0
- package/lib/artifacts/read-deploy-input.d.ts +239 -0
- package/lib/artifacts/read-deploy-input.js +1359 -0
- package/lib/artifacts/segment-document.d.ts +183 -0
- package/lib/artifacts/segment-document.js +570 -0
- package/lib/artifacts/verbatim-document.d.ts +203 -0
- package/lib/artifacts/verbatim-document.js +339 -0
- package/lib/artifacts/write-data-graph.d.ts +17 -0
- package/lib/artifacts/write-data-graph.js +162 -0
- package/lib/artifacts/write-data-stream.d.ts +11 -0
- package/lib/artifacts/write-data-stream.js +175 -0
- package/lib/artifacts/write-data-transform.d.ts +11 -0
- package/lib/artifacts/write-data-transform.js +180 -0
- package/lib/artifacts/write-dlo.d.ts +11 -0
- package/lib/artifacts/write-dlo.js +158 -0
- package/lib/artifacts/write-identity-resolution.d.ts +18 -0
- package/lib/artifacts/write-identity-resolution.js +165 -0
- package/lib/artifacts/write-mapping-definition.d.ts +17 -0
- package/lib/artifacts/write-mapping-definition.js +127 -0
- package/lib/artifacts/write-member-export.d.ts +88 -0
- package/lib/artifacts/write-member-export.js +199 -0
- package/lib/artifacts/write-native-calculated-insight.d.ts +21 -0
- package/lib/artifacts/write-native-calculated-insight.js +176 -0
- package/lib/artifacts/write-native-dmo.d.ts +11 -0
- package/lib/artifacts/write-native-dmo.js +158 -0
- package/lib/artifacts/write-native-mapping.d.ts +11 -0
- package/lib/artifacts/write-native-mapping.js +157 -0
- package/lib/artifacts/write-native-relationship.d.ts +11 -0
- package/lib/artifacts/write-native-relationship.js +157 -0
- package/lib/artifacts/write-segment.d.ts +26 -0
- package/lib/artifacts/write-segment.js +212 -0
- package/lib/commands/data360/delete.d.ts +280 -0
- package/lib/commands/data360/delete.js +2297 -0
- package/lib/commands/data360/deploy.d.ts +303 -0
- package/lib/commands/data360/deploy.js +2400 -0
- package/lib/commands/data360/publish.d.ts +93 -0
- package/lib/commands/data360/publish.js +292 -0
- package/lib/commands/data360/retrieve.d.ts +322 -0
- package/lib/commands/data360/retrieve.js +1963 -0
- package/lib/commands/data360/segment/members/export.d.ts +101 -0
- package/lib/commands/data360/segment/members/export.js +318 -0
- package/lib/errors/codes/calculated-insight.d.ts +2 -0
- package/lib/errors/codes/calculated-insight.js +25 -0
- package/lib/errors/codes/data-graph.d.ts +2 -0
- package/lib/errors/codes/data-graph.js +22 -0
- package/lib/errors/codes/data-stream.d.ts +2 -0
- package/lib/errors/codes/data-stream.js +70 -0
- package/lib/errors/codes/data-transform.d.ts +2 -0
- package/lib/errors/codes/data-transform.js +35 -0
- package/lib/errors/codes/dependency.d.ts +2 -0
- package/lib/errors/codes/dependency.js +11 -0
- package/lib/errors/codes/dlo.d.ts +2 -0
- package/lib/errors/codes/dlo.js +31 -0
- package/lib/errors/codes/dmo.d.ts +2 -0
- package/lib/errors/codes/dmo.js +28 -0
- package/lib/errors/codes/general.d.ts +2 -0
- package/lib/errors/codes/general.js +57 -0
- package/lib/errors/codes/identity-resolution.d.ts +2 -0
- package/lib/errors/codes/identity-resolution.js +24 -0
- package/lib/errors/codes/mapping.d.ts +2 -0
- package/lib/errors/codes/mapping.js +42 -0
- package/lib/errors/codes/relationship.d.ts +2 -0
- package/lib/errors/codes/relationship.js +21 -0
- package/lib/errors/codes/segment.d.ts +2 -0
- package/lib/errors/codes/segment.js +49 -0
- package/lib/errors/registry.d.ts +60 -0
- package/lib/errors/registry.js +123 -0
- package/lib/plugin.d.ts +5 -0
- package/lib/plugin.js +5 -0
- package/lib/services/acquire-retrieve-selection.d.ts +43 -0
- package/lib/services/acquire-retrieve-selection.js +145 -0
- package/lib/services/bind-identity-resolution-dependencies.d.ts +53 -0
- package/lib/services/bind-identity-resolution-dependencies.js +238 -0
- package/lib/services/bind-segment-dependencies.d.ts +49 -0
- package/lib/services/bind-segment-dependencies.js +115 -0
- package/lib/services/bounded-reads.d.ts +17 -0
- package/lib/services/bounded-reads.js +42 -0
- package/lib/services/calculated-insight-sql-checks.d.ts +33 -0
- package/lib/services/calculated-insight-sql-checks.js +193 -0
- package/lib/services/command-dlo.d.ts +48 -0
- package/lib/services/command-dlo.js +103 -0
- package/lib/services/command-native-data-graph.d.ts +54 -0
- package/lib/services/command-native-data-graph.js +485 -0
- package/lib/services/command-native-data-stream.d.ts +104 -0
- package/lib/services/command-native-data-stream.js +257 -0
- package/lib/services/command-native-dmo.d.ts +124 -0
- package/lib/services/command-native-dmo.js +338 -0
- package/lib/services/command-native-mapping.d.ts +65 -0
- package/lib/services/command-native-mapping.js +129 -0
- package/lib/services/command-native-relationship.d.ts +46 -0
- package/lib/services/command-native-relationship.js +103 -0
- package/lib/services/cross-dataspace-deploy.d.ts +111 -0
- package/lib/services/cross-dataspace-deploy.js +493 -0
- package/lib/services/cross-dataspace-rename.d.ts +74 -0
- package/lib/services/cross-dataspace-rename.js +1314 -0
- package/lib/services/cross-dataspace-sql.d.ts +109 -0
- package/lib/services/cross-dataspace-sql.js +1301 -0
- package/lib/services/cross-space-context.d.ts +23 -0
- package/lib/services/cross-space-context.js +36 -0
- package/lib/services/crud-plan.d.ts +137 -0
- package/lib/services/crud-plan.js +408 -0
- package/lib/services/data-space-check.d.ts +89 -0
- package/lib/services/data-space-check.js +162 -0
- package/lib/services/data-space-prefix.d.ts +77 -0
- package/lib/services/data-space-prefix.js +127 -0
- package/lib/services/data-transform-space.d.ts +31 -0
- package/lib/services/data-transform-space.js +79 -0
- package/lib/services/delete-calculated-insight.d.ts +44 -0
- package/lib/services/delete-calculated-insight.js +101 -0
- package/lib/services/delete-data-transform.d.ts +52 -0
- package/lib/services/delete-data-transform.js +222 -0
- package/lib/services/delete-dmo-field.d.ts +211 -0
- package/lib/services/delete-dmo-field.js +472 -0
- package/lib/services/delete-identity-resolution.d.ts +43 -0
- package/lib/services/delete-identity-resolution.js +295 -0
- package/lib/services/delete-segment.d.ts +42 -0
- package/lib/services/delete-segment.js +248 -0
- package/lib/services/deploy-result.d.ts +54 -0
- package/lib/services/deploy-result.js +60 -0
- package/lib/services/escaped-copy.d.ts +23 -0
- package/lib/services/escaped-copy.js +88 -0
- package/lib/services/execute-calculated-insight-deploy.d.ts +42 -0
- package/lib/services/execute-calculated-insight-deploy.js +96 -0
- package/lib/services/execute-data-transform-deploy.d.ts +56 -0
- package/lib/services/execute-data-transform-deploy.js +168 -0
- package/lib/services/execute-native-identity-resolution-deploy.d.ts +48 -0
- package/lib/services/execute-native-identity-resolution-deploy.js +360 -0
- package/lib/services/execute-segment-deploy.d.ts +45 -0
- package/lib/services/execute-segment-deploy.js +393 -0
- package/lib/services/local-file-removal.d.ts +36 -0
- package/lib/services/local-file-removal.js +103 -0
- package/lib/services/native-calculated-insight.d.ts +87 -0
- package/lib/services/native-calculated-insight.js +164 -0
- package/lib/services/native-crm-data-stream.d.ts +91 -0
- package/lib/services/native-crm-data-stream.js +272 -0
- package/lib/services/native-data-graph-context.d.ts +12 -0
- package/lib/services/native-data-graph-context.js +139 -0
- package/lib/services/native-data-graph-crd.d.ts +261 -0
- package/lib/services/native-data-graph-crd.js +866 -0
- package/lib/services/native-data-stream.d.ts +329 -0
- package/lib/services/native-data-stream.js +1830 -0
- package/lib/services/native-dlo.d.ts +163 -0
- package/lib/services/native-dlo.js +402 -0
- package/lib/services/native-dmo.d.ts +191 -0
- package/lib/services/native-dmo.js +614 -0
- package/lib/services/native-mapping.d.ts +255 -0
- package/lib/services/native-mapping.js +1226 -0
- package/lib/services/native-relationship.d.ts +132 -0
- package/lib/services/native-relationship.js +512 -0
- package/lib/services/operation-diagnostic.d.ts +83 -0
- package/lib/services/operation-diagnostic.js +272 -0
- package/lib/services/preflight-calculated-insight-deploy.d.ts +58 -0
- package/lib/services/preflight-calculated-insight-deploy.js +95 -0
- package/lib/services/preflight-data-transform-deploy.d.ts +33 -0
- package/lib/services/preflight-data-transform-deploy.js +104 -0
- package/lib/services/preflight-identity-resolution-deploy.d.ts +107 -0
- package/lib/services/preflight-identity-resolution-deploy.js +281 -0
- package/lib/services/preflight-segment-deploy.d.ts +31 -0
- package/lib/services/preflight-segment-deploy.js +109 -0
- package/lib/services/publish-calculated-insight.d.ts +40 -0
- package/lib/services/publish-calculated-insight.js +95 -0
- package/lib/services/publish-segment.d.ts +65 -0
- package/lib/services/publish-segment.js +194 -0
- package/lib/services/readback-pace.d.ts +16 -0
- package/lib/services/readback-pace.js +23 -0
- package/lib/services/retrieve-data-transform.d.ts +26 -0
- package/lib/services/retrieve-data-transform.js +65 -0
- package/lib/services/retrieve-identity-resolution.d.ts +40 -0
- package/lib/services/retrieve-identity-resolution.js +87 -0
- package/lib/services/retrieve-inventory.d.ts +32 -0
- package/lib/services/retrieve-inventory.js +151 -0
- package/lib/services/retrieve-segment.d.ts +120 -0
- package/lib/services/retrieve-segment.js +502 -0
- package/lib/services/segment-lookup.d.ts +46 -0
- package/lib/services/segment-lookup.js +108 -0
- package/lib/services/segment-members.d.ts +144 -0
- package/lib/services/segment-members.js +402 -0
- package/lib/services/select-native-retrieve.d.ts +60 -0
- package/lib/services/select-native-retrieve.js +226 -0
- package/lib/services/settle-calculated-insight.d.ts +22 -0
- package/lib/services/settle-calculated-insight.js +53 -0
- package/lib/services/sql-tokens.d.ts +58 -0
- package/lib/services/sql-tokens.js +147 -0
- package/lib/transport/api-version.d.ts +36 -0
- package/lib/transport/api-version.js +89 -0
- package/lib/transport/bound-ssot.d.ts +27 -0
- package/lib/transport/bound-ssot.js +116 -0
- package/lib/transport/calculated-insight-rest.d.ts +28 -0
- package/lib/transport/calculated-insight-rest.js +62 -0
- package/lib/transport/connect-client.d.ts +129 -0
- package/lib/transport/connect-client.js +446 -0
- package/lib/transport/connect-diagnostic.d.ts +89 -0
- package/lib/transport/connect-diagnostic.js +331 -0
- package/lib/transport/data-graph-rest.d.ts +27 -0
- package/lib/transport/data-graph-rest.js +76 -0
- package/lib/transport/data-stream-rest.d.ts +62 -0
- package/lib/transport/data-stream-rest.js +348 -0
- package/lib/transport/data-transform-rest.d.ts +25 -0
- package/lib/transport/data-transform-rest.js +100 -0
- package/lib/transport/dlo-native-rest.d.ts +22 -0
- package/lib/transport/dlo-native-rest.js +89 -0
- package/lib/transport/dlo-rest.d.ts +23 -0
- package/lib/transport/dlo-rest.js +135 -0
- package/lib/transport/dmo-native-rest.d.ts +18 -0
- package/lib/transport/dmo-native-rest.js +55 -0
- package/lib/transport/dmo-rest.d.ts +30 -0
- package/lib/transport/dmo-rest.js +163 -0
- package/lib/transport/mapping-rest.d.ts +63 -0
- package/lib/transport/mapping-rest.js +341 -0
- package/lib/transport/project-metadata.d.ts +36 -0
- package/lib/transport/project-metadata.js +118 -0
- package/lib/transport/relationship-rest.d.ts +43 -0
- package/lib/transport/relationship-rest.js +201 -0
- package/package.json +96 -4
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import type { CodeField, CodeFile } from './code-fields.js';
|
|
2
|
+
import type { DocumentMode } from './verbatim-document.js';
|
|
3
|
+
/** The DMO a segment is built on: always in the segment's own data space (`c__dataSpace`). */
|
|
4
|
+
export type SegmentReference = {
|
|
5
|
+
kind: 'dmo';
|
|
6
|
+
apiName: string;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* The refresh schedule in its write shape: `frequency`, `interval`, `daysOfWeek` (a plain list),
|
|
10
|
+
* `startDateTime`, `endDate`, `endDateTime`, `time` (`hour`, `minute`, `timeZone`), or an hourly
|
|
11
|
+
* `publishInterval`. `{frequency: None}` turns the schedule off.
|
|
12
|
+
*/
|
|
13
|
+
export type SegmentSchedule = Record<string, unknown> & {
|
|
14
|
+
frequency?: string;
|
|
15
|
+
publishInterval?: string;
|
|
16
|
+
};
|
|
17
|
+
type SegmentSpecBase = {
|
|
18
|
+
displayName: string;
|
|
19
|
+
description: string;
|
|
20
|
+
segmentOn: SegmentReference;
|
|
21
|
+
/** Desired schedule. Absent leaves the org schedule alone. */
|
|
22
|
+
schedule?: SegmentSchedule;
|
|
23
|
+
};
|
|
24
|
+
/** A SQL (DBT) segment: each SQL model lives in its own file. */
|
|
25
|
+
export type DbtSegmentSpec = SegmentSpecBase & {
|
|
26
|
+
segmentType: 'DBT';
|
|
27
|
+
models: Array<{
|
|
28
|
+
name: string;
|
|
29
|
+
sql: string;
|
|
30
|
+
}>;
|
|
31
|
+
lookbackPeriod: string;
|
|
32
|
+
};
|
|
33
|
+
/** A segment built in the segment canvas (`UI`): its criteria are a JSON object in the file. */
|
|
34
|
+
export type UiSegmentSpec = SegmentSpecBase & {
|
|
35
|
+
segmentType: 'UI';
|
|
36
|
+
includeCriteria: Record<string, unknown>;
|
|
37
|
+
lookbackPeriod: string;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Any other segment type Salesforce reads (for example Waterfall or Dynamic), without criteria.
|
|
41
|
+
* A Waterfall may list its child segments by API name, in priority order.
|
|
42
|
+
*/
|
|
43
|
+
export type OtherSegmentSpec = SegmentSpecBase & {
|
|
44
|
+
segmentType: string;
|
|
45
|
+
lookbackPeriod?: string;
|
|
46
|
+
/** Waterfall only: child segment API names in priority order. Absent leaves the org children alone. */
|
|
47
|
+
childSegments?: string[];
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* A segment file. `c__dataSpace` names its data space; its name is the one Salesforce stores
|
|
51
|
+
* (`<prefix>_<Name>` in a non-default data space, live API 68), and the plugin adds or strips
|
|
52
|
+
* nothing.
|
|
53
|
+
*/
|
|
54
|
+
export type SegmentDocument = {
|
|
55
|
+
schemaVersion: 1;
|
|
56
|
+
kind: 'segment';
|
|
57
|
+
c__dataSpace: string;
|
|
58
|
+
identity: {
|
|
59
|
+
apiName: string;
|
|
60
|
+
};
|
|
61
|
+
spec: DbtSegmentSpec | UiSegmentSpec | OtherSegmentSpec;
|
|
62
|
+
};
|
|
63
|
+
/** Payload-free refusal of incomplete or unsupported Segment content. */
|
|
64
|
+
export declare class SegmentError extends Error {
|
|
65
|
+
readonly code: string;
|
|
66
|
+
constructor(code: string);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* The schedule of a segment that does not refresh. Retrieve leaves the key out for it; a file
|
|
70
|
+
* states it explicitly to turn a schedule off.
|
|
71
|
+
*/
|
|
72
|
+
export declare const unscheduledSegment: Readonly<SegmentSchedule>;
|
|
73
|
+
/** The segment type whose child segments the file holds by name (`spec.childSegments`). */
|
|
74
|
+
export declare const waterfallSegmentType = "Waterfall";
|
|
75
|
+
/**
|
|
76
|
+
* Stand-in for a child segment of a Waterfall read from an org that the plugin could not name
|
|
77
|
+
* (deploy-mode reads only): it never equals a name in a file, and deploy refuses it in a file.
|
|
78
|
+
*/
|
|
79
|
+
export declare const unnamedChildSegment = "(a child segment the plugin could not name)";
|
|
80
|
+
/**
|
|
81
|
+
* Stand-in for an org schedule the file cannot hold (deploy-mode reads only): it never equals a
|
|
82
|
+
* file schedule, and a file without `schedule` leaves it alone.
|
|
83
|
+
*/
|
|
84
|
+
export declare const opaqueSegmentSchedule: Readonly<SegmentSchedule>;
|
|
85
|
+
/**
|
|
86
|
+
* Validate and detach an authored Segment definition (structure only). Its data space is the
|
|
87
|
+
* top-level `c__dataSpace`; the old `identity.dataSpace` and `spec.segmentOn.dataSpace` keys are
|
|
88
|
+
* refused (LEGACY_DATASPACE_KEY), since the segmentOn DMO is always in the segment's space. A DBT segment
|
|
89
|
+
* holds SQL models, a UI segment (`segmentType: UI`) its `includeCriteria` as a JSON object, and
|
|
90
|
+
* any other type neither; a Waterfall may list its child segments by API name
|
|
91
|
+
* (`childSegments`). The lookback (any text; optional for other types) and the optional
|
|
92
|
+
* schedule are sent as written and Salesforce decides about them. Retrieve mode keeps unknown
|
|
93
|
+
* `spec`, schedule and model keys and lifts the text limits, but still refuses what the file
|
|
94
|
+
* cannot represent: another source kind, and a model name that cannot be a file
|
|
95
|
+
* name or repeats one (ignoring case). Deploy refuses unknown keys and names the key path.
|
|
96
|
+
* @param {unknown} value Untrusted authored document.
|
|
97
|
+
* @param {DocumentMode} [mode] `deploy` (strict) or `retrieve` (keeps unknown keys).
|
|
98
|
+
* @returns {SegmentDocument} Independently admitted detached document.
|
|
99
|
+
*/
|
|
100
|
+
export declare function validateSegmentDocument(value: unknown, mode?: DocumentMode): SegmentDocument;
|
|
101
|
+
/**
|
|
102
|
+
* Whether the org schedule (as projected; none is unscheduled) already holds the schedule of the
|
|
103
|
+
* file. Only the keys the file states are compared: a key the file leaves out keeps its org
|
|
104
|
+
* value, because a write without it keeps the stored value. Salesforce does not read the time
|
|
105
|
+
* back, so a `time` the org does not show is not compared. A schedule the file cannot hold
|
|
106
|
+
* (`opaqueSegmentSchedule`) never equals a file schedule.
|
|
107
|
+
* @param {SegmentSchedule | undefined} current Projected org schedule.
|
|
108
|
+
* @param {SegmentSchedule} desired Schedule of the file.
|
|
109
|
+
* @returns {boolean} True when the schedule would not change.
|
|
110
|
+
*/
|
|
111
|
+
export declare function sameSegmentSchedule(current: SegmentSchedule | undefined, desired: SegmentSchedule): boolean;
|
|
112
|
+
/**
|
|
113
|
+
* The child segment definition IDs (`marketSegmentDefinitionId`, `3HX…`) in a Waterfall's
|
|
114
|
+
* criteria (live API 68, 2026-11-18): exactly
|
|
115
|
+
* `{"type":"Waterfall","segments":[{"type":"NestedSegment","segmentId":"<id>"}, ...]}` with at
|
|
116
|
+
* least one child. Anything else (other keys, element types, no children) is not a shape the
|
|
117
|
+
* file holds by name.
|
|
118
|
+
* @param {string} criteria Plain criteria JSON text.
|
|
119
|
+
* @returns {string[] | undefined} Child definition IDs in priority order, or undefined.
|
|
120
|
+
*/
|
|
121
|
+
export declare function waterfallChildIds(criteria: string): string[] | undefined;
|
|
122
|
+
/**
|
|
123
|
+
* The request body of a segment write, sent as written. Create names the segment
|
|
124
|
+
* (`developerName`); a PATCH takes the full definition. A DBT segment sends its models
|
|
125
|
+
* (`segmentType: Dbt`), a UI segment its criteria as a JSON string with
|
|
126
|
+
* `segmentCreationFlow: Headless` (what lets the API write a UI segment at all), any other type
|
|
127
|
+
* its type as read; a Waterfall with `childSegments` sends them as its criteria (each child by
|
|
128
|
+
* its definition ID in the target, from `children`). The lookback goes along when the file has
|
|
129
|
+
* one.
|
|
130
|
+
* @param {SegmentDocument} document Admitted segment.
|
|
131
|
+
* @param {boolean} create Whether this is the create POST.
|
|
132
|
+
* @param {boolean} [schedule] Whether an update sends the schedule (it changes).
|
|
133
|
+
* @param {ReadonlyMap<string, string>} [children] Waterfall child API name to target definition ID.
|
|
134
|
+
* @returns {Record<string, unknown>} Request body.
|
|
135
|
+
*/
|
|
136
|
+
export declare function segmentWriteBody(document: SegmentDocument, create: boolean, schedule?: boolean, children?: ReadonlyMap<string, string>): Record<string, unknown>;
|
|
137
|
+
/**
|
|
138
|
+
* The notice for a schedule the write sends: a schedule copied from another org makes the
|
|
139
|
+
* segment publish on it in this one. None when the schedule is absent, unchanged, or off on a
|
|
140
|
+
* create (a new segment does not refresh).
|
|
141
|
+
* @param {SegmentDocument} desired Admitted segment.
|
|
142
|
+
* @param {SegmentDocument | undefined} current Projected org segment; none on create.
|
|
143
|
+
* @returns {{code: string; message: string} | undefined} SEGMENT_SCHEDULE_CHANGE notice.
|
|
144
|
+
*/
|
|
145
|
+
export declare function segmentScheduleNotice(desired: SegmentDocument, current: SegmentDocument | undefined): {
|
|
146
|
+
code: string;
|
|
147
|
+
message: string;
|
|
148
|
+
} | undefined;
|
|
149
|
+
/** Every `spec.models[].sql` lives in its own `<Name>.segment.<model>.sql` file. */
|
|
150
|
+
export declare const segmentCodeFields: readonly CodeField[];
|
|
151
|
+
/**
|
|
152
|
+
* The JSON text (admitted fields, stable key order, models without SQL) and one SQL file per model.
|
|
153
|
+
* @param {unknown} value Complete authored document.
|
|
154
|
+
* @param {DocumentMode} [mode] `deploy` (strict) or `retrieve` (keeps unknown keys).
|
|
155
|
+
* @returns {{json: string; files: CodeFile[]}} JSON with LF terminator and the SQL files in model order.
|
|
156
|
+
*/
|
|
157
|
+
export declare function serializeSegmentFiles(value: unknown, mode?: DocumentMode): {
|
|
158
|
+
json: string;
|
|
159
|
+
files: CodeFile[];
|
|
160
|
+
};
|
|
161
|
+
/**
|
|
162
|
+
* Join a parsed segment JSON with its SQL files; a missing or extra SQL file, or SQL left in the
|
|
163
|
+
* JSON, is INVALID_SEGMENT_DOCUMENT.
|
|
164
|
+
* @param {unknown} value Parsed JSON file content.
|
|
165
|
+
* @param {readonly CodeFile[]} files SQL file contents.
|
|
166
|
+
* @param {DocumentMode} [mode] `deploy` (strict) or `retrieve` (keeps unknown keys).
|
|
167
|
+
* @returns {SegmentDocument} Complete admitted document.
|
|
168
|
+
*/
|
|
169
|
+
export declare function joinSegmentFiles(value: unknown, files: readonly CodeFile[], mode?: DocumentMode): SegmentDocument;
|
|
170
|
+
/**
|
|
171
|
+
* Whether a segment read from the org carries the desired definition: the one comparison that
|
|
172
|
+
* preflight, execute and delete use. A UI segment's criteria match when they are equal except
|
|
173
|
+
* for the keys Salesforce adds to each comparison it stores (`selfReference`, `subjectField*`
|
|
174
|
+
* beside `subject`). A file without a schedule leaves the schedule out of the comparison; one
|
|
175
|
+
* with a schedule compares it as `sameSegmentSchedule` does; likewise a Waterfall file without
|
|
176
|
+
* `childSegments` leaves the children out of the comparison, and one with them compares the
|
|
177
|
+
* names in order. Everything else must be equal.
|
|
178
|
+
* @param {unknown} observed Projected candidate from a read or write response.
|
|
179
|
+
* @param {SegmentDocument} desired Admitted requested definition.
|
|
180
|
+
* @returns {boolean} Whether the org holds the desired definition.
|
|
181
|
+
*/
|
|
182
|
+
export declare function carriesDefinition(observed: unknown, desired: SegmentDocument): boolean;
|
|
183
|
+
export { segmentName } from './path-selector.js';
|