@rippling/rippling-sdk 0.2.0-alpha.39 → 0.2.0-alpha.41
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/examples/manifest/existing-manifest-mutations/existing-manifest-mutations.ts +240 -0
- package/lib/manifest/custom-object-page-layout.d.mts +185 -0
- package/lib/manifest/custom-object-page-layout.d.mts.map +1 -1
- package/lib/manifest/custom-object-page-layout.d.ts +185 -0
- package/lib/manifest/custom-object-page-layout.d.ts.map +1 -1
- package/lib/manifest/custom-object-page-layout.js +569 -0
- package/lib/manifest/custom-object-page-layout.js.map +1 -1
- package/lib/manifest/custom-object-page-layout.mjs +569 -0
- package/lib/manifest/custom-object-page-layout.mjs.map +1 -1
- package/lib/manifest/existing-manifest-context.d.mts.map +1 -1
- package/lib/manifest/existing-manifest-context.d.ts.map +1 -1
- package/lib/manifest/existing-manifest-context.js +1 -0
- package/lib/manifest/existing-manifest-context.js.map +1 -1
- package/lib/manifest/existing-manifest-context.mjs +1 -0
- package/lib/manifest/existing-manifest-context.mjs.map +1 -1
- package/lib/manifest/field.d.mts +2 -2
- package/lib/manifest/field.d.mts.map +1 -1
- package/lib/manifest/field.d.ts +2 -2
- package/lib/manifest/field.d.ts.map +1 -1
- package/lib/manifest/field.js +14 -7
- package/lib/manifest/field.js.map +1 -1
- package/lib/manifest/field.mjs +14 -7
- package/lib/manifest/field.mjs.map +1 -1
- package/lib/manifest/index.d.mts +1 -1
- package/lib/manifest/index.d.mts.map +1 -1
- package/lib/manifest/index.d.ts +1 -1
- package/lib/manifest/index.d.ts.map +1 -1
- package/lib/manifest/index.js.map +1 -1
- package/lib/manifest/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/lib/manifest/custom-object-page-layout.ts +830 -0
- package/src/lib/manifest/existing-manifest-context.ts +1 -0
- package/src/lib/manifest/field.ts +18 -9
- package/src/lib/manifest/index.ts +10 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom-object-page-layout.d.ts","sourceRoot":"","sources":["../../src/lib/manifest/custom-object-page-layout.ts"],"names":[],"mappings":"OACO,EAAE,wBAAwB,EAAE;OAC5B,KAAK,EAAE,YAAY,EAAE;OACrB,EAA8B,KAAK,8BAA8B,EAAE;OACnE,KAAK,EAAE,KAAK,EAAE;OACd,KAAK,EAAE,yBAAyB,EAAE;AAEzC,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;CACvB;AAMD,gDAAgD;AAChD,MAAM,WAAW,qBAAqB;IACpC,gEAAgE;IAChE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0DAA0D;IAC1D,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,2CAA2C;IAC3C,OAAO,EAAE,MAAM,CAAC;IAChB,2CAA2C;IAC3C,GAAG,EAAE,MAAM,CAAC;IACZ,wDAAwD;IACxD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,kEAAkE;IAClE,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,yDAAyD;IACzD,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,WAAW;IAC1B,4EAA4E;IAC5E,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,wDAAwD;IACxD,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,sDAAsD;IACtD,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,8DAA8D;IAC9D,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,mFAAmF;IACnF,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;IACzD,+DAA+D;I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,YAAY,CAAC,EAAE,UAAU,GAAG,YAAY,CAAC;CAC1C;AAMD;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB;IAClC,sDAAsD;IACtD,UAAU,EAAE,MAAM,CAAC;IACnB,+CAA+C;IAC/C,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC5C;AAED;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,yEAAyE;IACzE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;IAC/C,iEAAiE;IACjE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;CAC5C;AAMD;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C;;;;;;OAMG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB;;;;OAIG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,6CAA8C,SAAQ,8BAA8B;IACnG,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;
|
|
1
|
+
{"version":3,"file":"custom-object-page-layout.d.ts","sourceRoot":"","sources":["../../src/lib/manifest/custom-object-page-layout.ts"],"names":[],"mappings":"OACO,EAAE,wBAAwB,EAAE;OAC5B,KAAK,EAAE,YAAY,EAAE;OACrB,EAA8B,KAAK,8BAA8B,EAAE;OACnE,KAAK,EAAE,KAAK,EAAE;OACd,KAAK,EAAE,yBAAyB,EAAE;AAEzC,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,EAAE,MAAM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iCAAiC;IAuBzC,OAAO,CAAC,mBAAmB;IAa3B,OAAO,CAAC,uBAAuB;IAc/B,OAAO,CAAC,sBAAsB;IAiB9B,OAAO,CAAC,yBAAyB;IAYjC,OAAO,CAAC,+BAA+B;IAsBvC,OAAO,CAAC,kBAAkB;IAO1B,OAAO,CAAC,uBAAuB;IAM/B,OAAO,CAAC,mBAAmB;IAM3B;;;;OAIG;IACH,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAiB7B;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,CAAC,KAAK,CACV,YAAY,EAAE,YAAY,EAC1B,KAAK,GAAE;QACL,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC;KACb,GACL,sBAAsB;CAmC1B"}
|
|
@@ -117,6 +117,77 @@ function cloneJson(value) {
|
|
|
117
117
|
return value;
|
|
118
118
|
return JSON.parse(JSON.stringify(value));
|
|
119
119
|
}
|
|
120
|
+
function isTabWithSections(tab) {
|
|
121
|
+
return tab.type === 'tab_with_sections';
|
|
122
|
+
}
|
|
123
|
+
function insertionIndex(length, position) {
|
|
124
|
+
if (position == null || position === 'end')
|
|
125
|
+
return length;
|
|
126
|
+
if (position === 'start')
|
|
127
|
+
return 0;
|
|
128
|
+
if (!Number.isInteger(position) || position < 0 || position > length) {
|
|
129
|
+
throw new Error(`Invalid insertion position ${position}; expected 'start', 'end', or 0-${length}.`);
|
|
130
|
+
}
|
|
131
|
+
return position;
|
|
132
|
+
}
|
|
133
|
+
function insertAt(items, item, position) {
|
|
134
|
+
items.splice(insertionIndex(items.length, position), 0, item);
|
|
135
|
+
}
|
|
136
|
+
function fieldRqlNameOf(entry) {
|
|
137
|
+
if (typeof entry === 'string')
|
|
138
|
+
return entry;
|
|
139
|
+
if (entry == null || typeof entry !== 'object')
|
|
140
|
+
return undefined;
|
|
141
|
+
const record = entry;
|
|
142
|
+
const fieldRqlName = record['fieldRqlName'] ?? record['field_rql_name'];
|
|
143
|
+
return typeof fieldRqlName === 'string' ? fieldRqlName : undefined;
|
|
144
|
+
}
|
|
145
|
+
function removeIndexes(items, indexes) {
|
|
146
|
+
for (const index of [...indexes].sort((a, b) => b - a)) {
|
|
147
|
+
items.splice(index, 1);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
function removeFromArray(items, predicate, label, removeAll = true) {
|
|
151
|
+
const indexes = [];
|
|
152
|
+
items.forEach((item, index) => {
|
|
153
|
+
if (predicate(item))
|
|
154
|
+
indexes.push(index);
|
|
155
|
+
});
|
|
156
|
+
if (indexes.length > 1 && !removeAll) {
|
|
157
|
+
throw new Error(`${label} matched ${indexes.length} entries; pass removeAll: true to remove them all.`);
|
|
158
|
+
}
|
|
159
|
+
removeIndexes(items, removeAll ? indexes : indexes.slice(0, 1));
|
|
160
|
+
return removeAll ? indexes.length : Math.min(indexes.length, 1);
|
|
161
|
+
}
|
|
162
|
+
function removeKeyFromOrder(order, key) {
|
|
163
|
+
if (order == null)
|
|
164
|
+
return;
|
|
165
|
+
removeFromArray(order, (entry) => entry === key, `order key "${key}"`);
|
|
166
|
+
}
|
|
167
|
+
function ensureRecordProperty(record, key, label) {
|
|
168
|
+
const existing = record[key];
|
|
169
|
+
if (existing == null) {
|
|
170
|
+
const next = {};
|
|
171
|
+
record[key] = next;
|
|
172
|
+
return next;
|
|
173
|
+
}
|
|
174
|
+
if (typeof existing !== 'object' || Array.isArray(existing)) {
|
|
175
|
+
throw new Error(`${label} must be an object.`);
|
|
176
|
+
}
|
|
177
|
+
return existing;
|
|
178
|
+
}
|
|
179
|
+
function ensureArrayProperty(record, key, label) {
|
|
180
|
+
const existing = record[key];
|
|
181
|
+
if (existing == null) {
|
|
182
|
+
const next = [];
|
|
183
|
+
record[key] = next;
|
|
184
|
+
return next;
|
|
185
|
+
}
|
|
186
|
+
if (!Array.isArray(existing)) {
|
|
187
|
+
throw new Error(`${label} must be an array.`);
|
|
188
|
+
}
|
|
189
|
+
return existing;
|
|
190
|
+
}
|
|
120
191
|
// ---------------------------------------------------------------------------
|
|
121
192
|
// Class
|
|
122
193
|
// ---------------------------------------------------------------------------
|
|
@@ -232,6 +303,504 @@ class CustomObjectPageLayout {
|
|
|
232
303
|
getCustomObjectApiName() {
|
|
233
304
|
return this._customObjectApiName;
|
|
234
305
|
}
|
|
306
|
+
/**
|
|
307
|
+
* Adds one field to an existing layout section.
|
|
308
|
+
*
|
|
309
|
+
* For loaded layouts, this mutates the preserved `tab_edits` JSON in place
|
|
310
|
+
* and normalizes only the inserted field entry.
|
|
311
|
+
*/
|
|
312
|
+
addField(field, options) {
|
|
313
|
+
return this.addFields([field], options);
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* Adds multiple fields to an existing layout section.
|
|
317
|
+
*
|
|
318
|
+
* Fields are inserted in the order provided. If a field does not already have
|
|
319
|
+
* field-section metadata, pass `options.fieldSection` so the corresponding
|
|
320
|
+
* `CUSTOM_OBJECT_FIELD_SECTION` component is registered in the manifest.
|
|
321
|
+
*/
|
|
322
|
+
addFields(fields, options) {
|
|
323
|
+
if (fields.length === 0)
|
|
324
|
+
return this;
|
|
325
|
+
const container = options.systemSection === true ?
|
|
326
|
+
this.ensureSystemSectionFieldContainer(options.tabKey, options.sectionKey)
|
|
327
|
+
: this.requireOneFieldContainer(options.tabKey, options.sectionKey);
|
|
328
|
+
const entries = fields.map((field) => this.serializeFieldForMutation(field, options.sectionKey, options));
|
|
329
|
+
if (options.allowDuplicate !== true) {
|
|
330
|
+
const existing = new Set(container.fields.map((entry) => fieldRqlNameOf(entry)).filter(Boolean));
|
|
331
|
+
const seen = new Set();
|
|
332
|
+
for (const entry of entries) {
|
|
333
|
+
const fieldRqlName = entry.fieldRqlName;
|
|
334
|
+
if (existing.has(fieldRqlName) || seen.has(fieldRqlName)) {
|
|
335
|
+
throw new Error(`CustomObjectPageLayout section "${container.label}" already contains field "${fieldRqlName}".`);
|
|
336
|
+
}
|
|
337
|
+
seen.add(fieldRqlName);
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
const index = insertionIndex(container.fields.length, options.position);
|
|
341
|
+
container.fields.splice(index, 0, ...entries);
|
|
342
|
+
return this;
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* Removes a field from the layout's field sections.
|
|
346
|
+
*
|
|
347
|
+
* This only removes the field from the page layout. It does not delete the
|
|
348
|
+
* `CUSTOM_OBJECT_FIELD` component from the manifest.
|
|
349
|
+
*/
|
|
350
|
+
removeField(field, options = {}) {
|
|
351
|
+
const fieldApiName = typeof field === 'string' ? field : field.getApiName();
|
|
352
|
+
if (isField(field))
|
|
353
|
+
this.assertFieldBelongsToLayout(field);
|
|
354
|
+
const containers = this.findFieldContainers({
|
|
355
|
+
tabKey: options.tabKey,
|
|
356
|
+
sectionKey: options.sectionKey,
|
|
357
|
+
systemSectionOnly: options.systemSection === true,
|
|
358
|
+
});
|
|
359
|
+
const matches = [];
|
|
360
|
+
for (const container of containers) {
|
|
361
|
+
container.fields.forEach((entry, index) => {
|
|
362
|
+
if (fieldRqlNameOf(entry) === fieldApiName) {
|
|
363
|
+
matches.push({ container, index });
|
|
364
|
+
}
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
if (matches.length === 0) {
|
|
368
|
+
throw new Error(`CustomObjectPageLayout does not contain field "${fieldApiName}".`);
|
|
369
|
+
}
|
|
370
|
+
const removeAll = options.removeAll !== false;
|
|
371
|
+
if (matches.length > 1 && !removeAll) {
|
|
372
|
+
throw new Error(`CustomObjectPageLayout field "${fieldApiName}" matched ${matches.length} entries; ` +
|
|
373
|
+
'pass removeAll: true to remove them all.');
|
|
374
|
+
}
|
|
375
|
+
const removals = removeAll ? matches : matches.slice(0, 1);
|
|
376
|
+
const byContainer = new Map();
|
|
377
|
+
for (const match of removals) {
|
|
378
|
+
const indexes = byContainer.get(match.container) ?? [];
|
|
379
|
+
indexes.push(match.index);
|
|
380
|
+
byContainer.set(match.container, indexes);
|
|
381
|
+
}
|
|
382
|
+
for (const [container, indexes] of byContainer.entries()) {
|
|
383
|
+
removeIndexes(container.fields, indexes);
|
|
384
|
+
}
|
|
385
|
+
return this;
|
|
386
|
+
}
|
|
387
|
+
/** Removes multiple fields from the layout's field sections. */
|
|
388
|
+
removeFields(fields, options = {}) {
|
|
389
|
+
for (const field of fields) {
|
|
390
|
+
this.removeField(field, options);
|
|
391
|
+
}
|
|
392
|
+
return this;
|
|
393
|
+
}
|
|
394
|
+
/**
|
|
395
|
+
* Adds a section to an existing tab.
|
|
396
|
+
*
|
|
397
|
+
* Pass `systemTab: true` to add a new section to a built-in tab via
|
|
398
|
+
* `systemTabEdits.newSections`.
|
|
399
|
+
*/
|
|
400
|
+
addSection(section, options) {
|
|
401
|
+
const normalized = this.normalizeSectionForMutation(section);
|
|
402
|
+
if (options.systemTab === true) {
|
|
403
|
+
const tabEdit = this.ensureSystemTabEdit(options.tabKey);
|
|
404
|
+
const sections = ensureArrayProperty(tabEdit, 'newSections', `systemTabEdits.${options.tabKey}.newSections`);
|
|
405
|
+
this.assertSectionKeyAvailable(sections, normalized.key, options.tabKey, options.allowDuplicate);
|
|
406
|
+
insertAt(sections, normalized, options.position);
|
|
407
|
+
if (tabEdit.sectionsOrder != null)
|
|
408
|
+
insertAt(tabEdit.sectionsOrder, normalized.key, options.position);
|
|
409
|
+
return this;
|
|
410
|
+
}
|
|
411
|
+
const tab = this.findNewTabWithSections(options.tabKey);
|
|
412
|
+
if (tab == null) {
|
|
413
|
+
throw new Error(`CustomObjectPageLayout could not find new tab "${options.tabKey}". ` +
|
|
414
|
+
'Pass systemTab: true to add a section to a built-in system tab.');
|
|
415
|
+
}
|
|
416
|
+
this.assertSectionKeyAvailable(tab.sections, normalized.key, options.tabKey, options.allowDuplicate);
|
|
417
|
+
insertAt(tab.sections, normalized, options.position);
|
|
418
|
+
return this;
|
|
419
|
+
}
|
|
420
|
+
/**
|
|
421
|
+
* Removes a section from `newTabs` / `systemTabEdits.newSections`.
|
|
422
|
+
*
|
|
423
|
+
* Pass `systemSection: true` with `tabKey` to delete a built-in section via
|
|
424
|
+
* `systemSectionEdits[sectionKey].deleted`.
|
|
425
|
+
*/
|
|
426
|
+
removeSection(sectionKey, options = {}) {
|
|
427
|
+
if (options.systemSection === true) {
|
|
428
|
+
if (options.tabKey == null) {
|
|
429
|
+
throw new Error('CustomObjectPageLayout removeSection with systemSection: true requires tabKey.');
|
|
430
|
+
}
|
|
431
|
+
const sectionEdit = this.ensureSystemSectionEdit(options.tabKey, sectionKey);
|
|
432
|
+
sectionEdit.deleted = true;
|
|
433
|
+
this.removeSectionVisibility(sectionKey);
|
|
434
|
+
return this;
|
|
435
|
+
}
|
|
436
|
+
const matches = [];
|
|
437
|
+
for (const tab of this._tabEdits.newTabs ?? []) {
|
|
438
|
+
if (!isTabWithSections(tab))
|
|
439
|
+
continue;
|
|
440
|
+
if (options.tabKey != null && tab.key !== options.tabKey)
|
|
441
|
+
continue;
|
|
442
|
+
tab.sections.forEach((section, index) => {
|
|
443
|
+
if (section.key === sectionKey)
|
|
444
|
+
matches.push({ sections: tab.sections, index, tabKey: tab.key });
|
|
445
|
+
});
|
|
446
|
+
}
|
|
447
|
+
for (const [tabKey, tabEdit] of Object.entries(this._tabEdits.systemTabEdits ?? {})) {
|
|
448
|
+
if (options.tabKey != null && tabKey !== options.tabKey)
|
|
449
|
+
continue;
|
|
450
|
+
(tabEdit.newSections ?? []).forEach((section, index) => {
|
|
451
|
+
if (section.key === sectionKey)
|
|
452
|
+
matches.push({ sections: tabEdit.newSections, index, tabEdit, tabKey });
|
|
453
|
+
});
|
|
454
|
+
}
|
|
455
|
+
if (matches.length === 0) {
|
|
456
|
+
throw new Error(`CustomObjectPageLayout does not contain section "${sectionKey}".`);
|
|
457
|
+
}
|
|
458
|
+
const removeAll = options.removeAll !== false;
|
|
459
|
+
if (matches.length > 1 && !removeAll) {
|
|
460
|
+
throw new Error(`CustomObjectPageLayout section "${sectionKey}" matched ${matches.length} entries; ` +
|
|
461
|
+
'pass removeAll: true to remove them all.');
|
|
462
|
+
}
|
|
463
|
+
const removals = removeAll ? matches : matches.slice(0, 1);
|
|
464
|
+
const byArray = new Map();
|
|
465
|
+
for (const match of removals) {
|
|
466
|
+
const indexes = byArray.get(match.sections) ?? [];
|
|
467
|
+
indexes.push(match.index);
|
|
468
|
+
byArray.set(match.sections, indexes);
|
|
469
|
+
if (match.tabEdit != null)
|
|
470
|
+
removeKeyFromOrder(match.tabEdit.sectionsOrder, sectionKey);
|
|
471
|
+
}
|
|
472
|
+
for (const [sections, indexes] of byArray.entries()) {
|
|
473
|
+
removeIndexes(sections, indexes);
|
|
474
|
+
}
|
|
475
|
+
this.removeSectionVisibility(sectionKey);
|
|
476
|
+
return this;
|
|
477
|
+
}
|
|
478
|
+
/** Adds a new tab to `tab_edits.newTabs`. */
|
|
479
|
+
addTab(tab, options = {}) {
|
|
480
|
+
var _a;
|
|
481
|
+
const normalized = this.normalizeTabForMutation(tab);
|
|
482
|
+
const newTabs = ((_a = this._tabEdits).newTabs ?? (_a.newTabs = []));
|
|
483
|
+
if (options.allowDuplicate !== true && newTabs.some((existing) => existing.key === normalized.key)) {
|
|
484
|
+
throw new Error(`CustomObjectPageLayout already contains tab "${normalized.key}".`);
|
|
485
|
+
}
|
|
486
|
+
insertAt(newTabs, normalized, options.position);
|
|
487
|
+
if (this._tabEdits.tabsOrder != null) {
|
|
488
|
+
insertAt(this._tabEdits.tabsOrder, normalized.key, options.position);
|
|
489
|
+
}
|
|
490
|
+
return this;
|
|
491
|
+
}
|
|
492
|
+
/**
|
|
493
|
+
* Removes a tab from `newTabs`.
|
|
494
|
+
*
|
|
495
|
+
* Pass `systemTab: true` to delete a built-in tab via `systemTabEdits[tabKey].deleted`.
|
|
496
|
+
*/
|
|
497
|
+
removeTab(tabKey, options = {}) {
|
|
498
|
+
if (options.systemTab === true) {
|
|
499
|
+
const tabEdit = this.ensureSystemTabEdit(tabKey);
|
|
500
|
+
tabEdit.deleted = true;
|
|
501
|
+
removeKeyFromOrder(this._tabEdits.tabsOrder, tabKey);
|
|
502
|
+
this.removeTabVisibility(tabKey);
|
|
503
|
+
return this;
|
|
504
|
+
}
|
|
505
|
+
const newTabs = this._tabEdits.newTabs ?? [];
|
|
506
|
+
const removed = removeFromArray(newTabs, (tab) => tab.key === tabKey, `CustomObjectPageLayout tab "${tabKey}"`, options.removeAll !== false);
|
|
507
|
+
if (removed === 0) {
|
|
508
|
+
throw new Error(`CustomObjectPageLayout does not contain tab "${tabKey}".`);
|
|
509
|
+
}
|
|
510
|
+
removeKeyFromOrder(this._tabEdits.tabsOrder, tabKey);
|
|
511
|
+
this.removeTabVisibility(tabKey);
|
|
512
|
+
return this;
|
|
513
|
+
}
|
|
514
|
+
/** Adds a custom header field to `header_edits.newFields`. */
|
|
515
|
+
addHeaderField(field, options = {}) {
|
|
516
|
+
var _a;
|
|
517
|
+
const headerField = this.normalizeHeaderFieldForMutation(field, options);
|
|
518
|
+
const newFields = ((_a = this._headerEdits).newFields ?? (_a.newFields = []));
|
|
519
|
+
if (options.allowDuplicate !== true && newFields.some((existing) => existing.key === headerField.key)) {
|
|
520
|
+
throw new Error(`CustomObjectPageLayout header already contains field key "${headerField.key}".`);
|
|
521
|
+
}
|
|
522
|
+
insertAt(newFields, headerField, options.position);
|
|
523
|
+
if (this._headerEdits.headerFieldsOrder != null) {
|
|
524
|
+
insertAt(this._headerEdits.headerFieldsOrder, headerField.key, options.position);
|
|
525
|
+
}
|
|
526
|
+
return this;
|
|
527
|
+
}
|
|
528
|
+
/** Removes custom header fields from `header_edits.newFields`. */
|
|
529
|
+
removeHeaderField(fieldOrKey, options = {}) {
|
|
530
|
+
const fieldApiName = typeof fieldOrKey === 'string' ? undefined : fieldOrKey.getApiName();
|
|
531
|
+
if (isField(fieldOrKey))
|
|
532
|
+
this.assertFieldBelongsToLayout(fieldOrKey);
|
|
533
|
+
const key = typeof fieldOrKey === 'string' ? fieldOrKey : fieldApiName;
|
|
534
|
+
const newFields = this._headerEdits.newFields ?? [];
|
|
535
|
+
const removedKeys = [];
|
|
536
|
+
const removed = removeFromArray(newFields, (field) => {
|
|
537
|
+
const matched = field.key === key || (fieldApiName != null && field.rqlName === fieldApiName);
|
|
538
|
+
if (matched)
|
|
539
|
+
removedKeys.push(field.key);
|
|
540
|
+
return matched;
|
|
541
|
+
}, `CustomObjectPageLayout header field "${key}"`, options.removeAll !== false);
|
|
542
|
+
if (removed === 0) {
|
|
543
|
+
throw new Error(`CustomObjectPageLayout header does not contain field "${key}".`);
|
|
544
|
+
}
|
|
545
|
+
for (const removedKey of removedKeys) {
|
|
546
|
+
removeKeyFromOrder(this._headerEdits.headerFieldsOrder, removedKey);
|
|
547
|
+
}
|
|
548
|
+
return this;
|
|
549
|
+
}
|
|
550
|
+
/** Sets the record title field in `header_edits`. */
|
|
551
|
+
setTitleField(field) {
|
|
552
|
+
this._headerEdits.newTitleField = this.headerFieldApiName(field);
|
|
553
|
+
if (field != null)
|
|
554
|
+
this._headerEdits.titleFieldDeleted = false;
|
|
555
|
+
return this;
|
|
556
|
+
}
|
|
557
|
+
/** Removes the record title field from the header. */
|
|
558
|
+
removeTitleField() {
|
|
559
|
+
this._headerEdits.newTitleField = null;
|
|
560
|
+
this._headerEdits.titleFieldDeleted = true;
|
|
561
|
+
return this;
|
|
562
|
+
}
|
|
563
|
+
/** Sets the record description field in `header_edits`. */
|
|
564
|
+
setDescriptionField(field) {
|
|
565
|
+
this._headerEdits.newDescriptionField = this.headerFieldApiName(field);
|
|
566
|
+
if (field != null)
|
|
567
|
+
this._headerEdits.descriptionFieldDeleted = false;
|
|
568
|
+
return this;
|
|
569
|
+
}
|
|
570
|
+
/** Removes the record description field from the header. */
|
|
571
|
+
removeDescriptionField() {
|
|
572
|
+
this._headerEdits.newDescriptionField = null;
|
|
573
|
+
this._headerEdits.descriptionFieldDeleted = true;
|
|
574
|
+
return this;
|
|
575
|
+
}
|
|
576
|
+
serializeFieldForMutation(field, fallbackSectionKey, options) {
|
|
577
|
+
this.assertFieldBelongsToLayout(field);
|
|
578
|
+
this.assignFieldSectionForMutation(field, fallbackSectionKey, options.fieldSection);
|
|
579
|
+
return toSerializedSectionField(field.getApiName(), options);
|
|
580
|
+
}
|
|
581
|
+
normalizeSectionFieldForMutation(section, sectionKey, entry) {
|
|
582
|
+
if (isField(entry)) {
|
|
583
|
+
this.assertFieldBelongsToLayout(entry);
|
|
584
|
+
entry._assignSection(section);
|
|
585
|
+
return toSerializedSectionField(entry.getApiName());
|
|
586
|
+
}
|
|
587
|
+
if (isFieldRef(entry)) {
|
|
588
|
+
this.assertFieldBelongsToLayout(entry.field);
|
|
589
|
+
entry.field._assignSection(section);
|
|
590
|
+
return toSerializedSectionField(entry.field.getApiName(), entry);
|
|
591
|
+
}
|
|
592
|
+
throw new Error(`CustomObjectPageLayout fields_section "${sectionKey}" has an invalid field entry; ` +
|
|
593
|
+
'pass a Field instance or { field }.');
|
|
594
|
+
}
|
|
595
|
+
normalizeSectionForMutation(input) {
|
|
596
|
+
if (input.section.getModelApiName() !== this._customObjectApiName) {
|
|
597
|
+
throw new Error(`CustomObjectPageLayout section "${input.section.getSectionId()}" belongs to ` +
|
|
598
|
+
`"${input.section.getModelApiName()}", but the layout belongs to "${this._customObjectApiName}".`);
|
|
599
|
+
}
|
|
600
|
+
const key = input.key ?? input.section.getSectionId();
|
|
601
|
+
const name = input.name ?? input.section.getName();
|
|
602
|
+
const normalized = {
|
|
603
|
+
key,
|
|
604
|
+
name,
|
|
605
|
+
type: 'fields_section',
|
|
606
|
+
fields: input.fields.map((field) => this.normalizeSectionFieldForMutation(input.section, key, field)),
|
|
607
|
+
};
|
|
608
|
+
if (input.layout != null)
|
|
609
|
+
normalized.layout = input.layout;
|
|
610
|
+
return normalized;
|
|
611
|
+
}
|
|
612
|
+
normalizeTabForMutation(tab) {
|
|
613
|
+
if (tab.type === 'custom_tab')
|
|
614
|
+
return { ...tab };
|
|
615
|
+
return {
|
|
616
|
+
...tab,
|
|
617
|
+
sections: tab.sections.map((section) => this.normalizeSectionForMutation(section)),
|
|
618
|
+
};
|
|
619
|
+
}
|
|
620
|
+
assignFieldSectionForMutation(field, fallbackSectionKey, fieldSection) {
|
|
621
|
+
const rawFieldSection = fieldSection;
|
|
622
|
+
if (rawFieldSection != null) {
|
|
623
|
+
if (typeof rawFieldSection === 'string') {
|
|
624
|
+
throw new TypeError(`CustomObjectPageLayout fieldSection must be a CustomObjectFieldSection object; ` +
|
|
625
|
+
`received raw section id "${rawFieldSection}". Load/include the existing field section first.`);
|
|
626
|
+
}
|
|
627
|
+
if (rawFieldSection.getModelApiName() !== this._customObjectApiName) {
|
|
628
|
+
throw new Error(`CustomObjectPageLayout field section "${rawFieldSection.getSectionId()}" belongs to ` +
|
|
629
|
+
`"${rawFieldSection.getModelApiName()}", but the layout belongs to "${this._customObjectApiName}".`);
|
|
630
|
+
}
|
|
631
|
+
field._assignSection(rawFieldSection);
|
|
632
|
+
return;
|
|
633
|
+
}
|
|
634
|
+
if (field.getSectionId() == null) {
|
|
635
|
+
throw new Error(`CustomObjectPageLayout field "${field.getApiName()}" is missing field-section metadata. ` +
|
|
636
|
+
`Construct the field with a CustomObjectFieldSection or pass fieldSection when adding it to ` +
|
|
637
|
+
`section "${fallbackSectionKey}".`);
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
assertFieldBelongsToLayout(field) {
|
|
641
|
+
if (field.getCustomObjectApiName() !== this._customObjectApiName) {
|
|
642
|
+
throw new Error(`CustomObjectPageLayout references field "${field.getApiName()}" from ` +
|
|
643
|
+
`"${field.getCustomObjectApiName()}", but the layout belongs to "${this._customObjectApiName}".`);
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
requireOneFieldContainer(tabKey, sectionKey) {
|
|
647
|
+
const containers = this.findFieldContainers({
|
|
648
|
+
tabKey,
|
|
649
|
+
sectionKey,
|
|
650
|
+
systemSectionOnly: false,
|
|
651
|
+
});
|
|
652
|
+
if (containers.length === 0) {
|
|
653
|
+
const prefix = tabKey != null ? `${tabKey}.` : '';
|
|
654
|
+
throw new Error(`CustomObjectPageLayout could not find section "${prefix}${sectionKey}".`);
|
|
655
|
+
}
|
|
656
|
+
if (containers.length > 1) {
|
|
657
|
+
throw new Error(`CustomObjectPageLayout section "${sectionKey}" matched multiple sections: ` +
|
|
658
|
+
`${containers.map((container) => container.label).join(', ')}. Pass tabKey to choose one.`);
|
|
659
|
+
}
|
|
660
|
+
return containers[0];
|
|
661
|
+
}
|
|
662
|
+
findFieldContainers(filter) {
|
|
663
|
+
const containers = [];
|
|
664
|
+
if (!filter.systemSectionOnly) {
|
|
665
|
+
for (const tab of this._tabEdits.newTabs ?? []) {
|
|
666
|
+
if (!isTabWithSections(tab))
|
|
667
|
+
continue;
|
|
668
|
+
if (filter.tabKey != null && tab.key !== filter.tabKey)
|
|
669
|
+
continue;
|
|
670
|
+
for (const section of tab.sections) {
|
|
671
|
+
if (filter.sectionKey != null && section.key !== filter.sectionKey)
|
|
672
|
+
continue;
|
|
673
|
+
containers.push({
|
|
674
|
+
tabKey: tab.key,
|
|
675
|
+
sectionKey: section.key,
|
|
676
|
+
fields: ensureArrayProperty(section, 'fields', `newTabs.${tab.key}.sections.${section.key}.fields`),
|
|
677
|
+
label: `${tab.key}.${section.key}`,
|
|
678
|
+
});
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
for (const [tabKey, tabEdit] of Object.entries(this._tabEdits.systemTabEdits ?? {})) {
|
|
682
|
+
if (filter.tabKey != null && tabKey !== filter.tabKey)
|
|
683
|
+
continue;
|
|
684
|
+
for (const section of tabEdit.newSections ?? []) {
|
|
685
|
+
if (filter.sectionKey != null && section.key !== filter.sectionKey)
|
|
686
|
+
continue;
|
|
687
|
+
containers.push({
|
|
688
|
+
tabKey,
|
|
689
|
+
sectionKey: section.key,
|
|
690
|
+
fields: ensureArrayProperty(section, 'fields', `systemTabEdits.${tabKey}.newSections.${section.key}.fields`),
|
|
691
|
+
label: `${tabKey}.${section.key}`,
|
|
692
|
+
});
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
for (const [tabKey, tabEdit] of Object.entries(this._tabEdits.systemTabEdits ?? {})) {
|
|
697
|
+
if (filter.tabKey != null && tabKey !== filter.tabKey)
|
|
698
|
+
continue;
|
|
699
|
+
for (const [sectionKey, sectionEdit] of Object.entries(tabEdit.systemSectionEdits ?? {})) {
|
|
700
|
+
if (filter.sectionKey != null && sectionKey !== filter.sectionKey)
|
|
701
|
+
continue;
|
|
702
|
+
const fields = sectionEdit['newFields'];
|
|
703
|
+
if (fields == null)
|
|
704
|
+
continue;
|
|
705
|
+
if (!Array.isArray(fields)) {
|
|
706
|
+
throw new Error(`systemTabEdits.${tabKey}.systemSectionEdits.${sectionKey}.newFields must be an array.`);
|
|
707
|
+
}
|
|
708
|
+
containers.push({
|
|
709
|
+
tabKey,
|
|
710
|
+
sectionKey,
|
|
711
|
+
fields: fields,
|
|
712
|
+
label: `${tabKey}.${sectionKey}`,
|
|
713
|
+
});
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
return containers;
|
|
717
|
+
}
|
|
718
|
+
ensureSystemSectionFieldContainer(tabKey, sectionKey) {
|
|
719
|
+
if (tabKey == null) {
|
|
720
|
+
throw new Error('CustomObjectPageLayout addField with systemSection: true requires tabKey.');
|
|
721
|
+
}
|
|
722
|
+
const sectionEdit = this.ensureSystemSectionEdit(tabKey, sectionKey);
|
|
723
|
+
if (sectionEdit.deleted === true) {
|
|
724
|
+
throw new Error(`CustomObjectPageLayout system section "${tabKey}.${sectionKey}" is marked deleted.`);
|
|
725
|
+
}
|
|
726
|
+
return {
|
|
727
|
+
tabKey,
|
|
728
|
+
sectionKey,
|
|
729
|
+
fields: ensureArrayProperty(sectionEdit, 'newFields', `systemTabEdits.${tabKey}.systemSectionEdits.${sectionKey}.newFields`),
|
|
730
|
+
label: `${tabKey}.${sectionKey}`,
|
|
731
|
+
};
|
|
732
|
+
}
|
|
733
|
+
ensureSystemTabEdit(tabKey) {
|
|
734
|
+
const systemTabEdits = ensureRecordProperty(this._tabEdits, 'systemTabEdits', 'tab_edits.systemTabEdits');
|
|
735
|
+
return ensureRecordProperty(systemTabEdits, tabKey, `systemTabEdits.${tabKey}`);
|
|
736
|
+
}
|
|
737
|
+
ensureSystemSectionEdit(tabKey, sectionKey) {
|
|
738
|
+
const tabEdit = this.ensureSystemTabEdit(tabKey);
|
|
739
|
+
const systemSectionEdits = ensureRecordProperty(tabEdit, 'systemSectionEdits', `systemTabEdits.${tabKey}.systemSectionEdits`);
|
|
740
|
+
return ensureRecordProperty(systemSectionEdits, sectionKey, `systemTabEdits.${tabKey}.systemSectionEdits.${sectionKey}`);
|
|
741
|
+
}
|
|
742
|
+
findNewTabWithSections(tabKey) {
|
|
743
|
+
let found;
|
|
744
|
+
for (const tab of this._tabEdits.newTabs ?? []) {
|
|
745
|
+
if (tab.key !== tabKey)
|
|
746
|
+
continue;
|
|
747
|
+
if (!isTabWithSections(tab)) {
|
|
748
|
+
throw new Error(`CustomObjectPageLayout tab "${tabKey}" is a custom_tab and cannot contain sections.`);
|
|
749
|
+
}
|
|
750
|
+
if (found != null) {
|
|
751
|
+
throw new Error(`CustomObjectPageLayout contains multiple new tabs with key "${tabKey}".`);
|
|
752
|
+
}
|
|
753
|
+
found = tab;
|
|
754
|
+
}
|
|
755
|
+
return found;
|
|
756
|
+
}
|
|
757
|
+
assertSectionKeyAvailable(sections, sectionKey, tabKey, allowDuplicate) {
|
|
758
|
+
if (allowDuplicate === true)
|
|
759
|
+
return;
|
|
760
|
+
if (sections.some((section) => section.key === sectionKey)) {
|
|
761
|
+
throw new Error(`CustomObjectPageLayout tab "${tabKey}" already contains section "${sectionKey}".`);
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
normalizeHeaderFieldForMutation(field, options) {
|
|
765
|
+
const source = isField(field) ? undefined : field;
|
|
766
|
+
const rqlName = isField(field) ? field.getApiName() : field.rqlName;
|
|
767
|
+
if (isField(field))
|
|
768
|
+
this.assertFieldBelongsToLayout(field);
|
|
769
|
+
if (!rqlName)
|
|
770
|
+
throw new Error('CustomObjectPageLayout header field rqlName cannot be empty.');
|
|
771
|
+
const key = options.key ?? source?.key ?? (isField(field) ? field.getApiName() : undefined);
|
|
772
|
+
if (!key)
|
|
773
|
+
throw new Error('CustomObjectPageLayout header field key cannot be empty.');
|
|
774
|
+
const normalized = { rqlName, key };
|
|
775
|
+
const canBeDeleted = options.canBeDeleted ?? source?.canBeDeleted;
|
|
776
|
+
const canBeChanged = options.canBeChanged ?? source?.canBeChanged;
|
|
777
|
+
const canBeMoved = options.canBeMoved ?? source?.canBeMoved;
|
|
778
|
+
if (canBeDeleted != null)
|
|
779
|
+
normalized.canBeDeleted = canBeDeleted;
|
|
780
|
+
if (canBeChanged != null)
|
|
781
|
+
normalized.canBeChanged = canBeChanged;
|
|
782
|
+
if (canBeMoved != null)
|
|
783
|
+
normalized.canBeMoved = canBeMoved;
|
|
784
|
+
return normalized;
|
|
785
|
+
}
|
|
786
|
+
headerFieldApiName(field) {
|
|
787
|
+
if (field == null)
|
|
788
|
+
return null;
|
|
789
|
+
if (typeof field === 'string')
|
|
790
|
+
return field;
|
|
791
|
+
this.assertFieldBelongsToLayout(field);
|
|
792
|
+
return field.getApiName();
|
|
793
|
+
}
|
|
794
|
+
removeSectionVisibility(sectionKey) {
|
|
795
|
+
if (this._visibilityConditions.sections != null) {
|
|
796
|
+
delete this._visibilityConditions.sections[sectionKey];
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
removeTabVisibility(tabKey) {
|
|
800
|
+
if (this._visibilityConditions.tabs != null) {
|
|
801
|
+
delete this._visibilityConditions.tabs[tabKey];
|
|
802
|
+
}
|
|
803
|
+
}
|
|
235
804
|
/**
|
|
236
805
|
* Serializes this layout to the wire format consumed by the manifest install endpoint.
|
|
237
806
|
*
|