@rippling/rippling-sdk 0.2.0-alpha.41 → 0.2.0-alpha.43
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/lib/manifest/_existing-component-fields.d.mts +9 -0
- package/lib/manifest/_existing-component-fields.d.mts.map +1 -0
- package/lib/manifest/_existing-component-fields.d.ts +9 -0
- package/lib/manifest/_existing-component-fields.d.ts.map +1 -0
- package/lib/manifest/_existing-component-fields.js +51 -0
- package/lib/manifest/_existing-component-fields.js.map +1 -0
- package/lib/manifest/_existing-component-fields.mjs +45 -0
- package/lib/manifest/_existing-component-fields.mjs.map +1 -0
- package/lib/manifest/app.d.mts.map +1 -1
- package/lib/manifest/app.d.ts.map +1 -1
- package/lib/manifest/app.js +3 -2
- package/lib/manifest/app.js.map +1 -1
- package/lib/manifest/app.mjs +3 -2
- package/lib/manifest/app.mjs.map +1 -1
- package/lib/manifest/category.d.mts +1 -1
- package/lib/manifest/category.d.mts.map +1 -1
- package/lib/manifest/category.d.ts +1 -1
- package/lib/manifest/category.d.ts.map +1 -1
- package/lib/manifest/category.js +7 -4
- package/lib/manifest/category.js.map +1 -1
- package/lib/manifest/category.mjs +7 -4
- package/lib/manifest/category.mjs.map +1 -1
- package/lib/manifest/custom-object-field-section.d.mts.map +1 -1
- package/lib/manifest/custom-object-field-section.d.ts.map +1 -1
- package/lib/manifest/custom-object-field-section.js +3 -2
- package/lib/manifest/custom-object-field-section.js.map +1 -1
- package/lib/manifest/custom-object-field-section.mjs +3 -2
- package/lib/manifest/custom-object-field-section.mjs.map +1 -1
- package/lib/manifest/custom-object-page-layout.d.mts.map +1 -1
- package/lib/manifest/custom-object-page-layout.d.ts.map +1 -1
- package/lib/manifest/custom-object-page-layout.js +5 -4
- package/lib/manifest/custom-object-page-layout.js.map +1 -1
- package/lib/manifest/custom-object-page-layout.mjs +5 -4
- package/lib/manifest/custom-object-page-layout.mjs.map +1 -1
- package/lib/manifest/custom-object.d.mts +3 -4
- package/lib/manifest/custom-object.d.mts.map +1 -1
- package/lib/manifest/custom-object.d.ts +3 -4
- package/lib/manifest/custom-object.d.ts.map +1 -1
- package/lib/manifest/custom-object.js +11 -5
- package/lib/manifest/custom-object.js.map +1 -1
- package/lib/manifest/custom-object.mjs +11 -5
- package/lib/manifest/custom-object.mjs.map +1 -1
- package/lib/manifest/existing-manifest-context.d.mts +3 -0
- package/lib/manifest/existing-manifest-context.d.mts.map +1 -1
- package/lib/manifest/existing-manifest-context.d.ts +3 -0
- package/lib/manifest/existing-manifest-context.d.ts.map +1 -1
- package/lib/manifest/existing-manifest-context.js +68 -27
- package/lib/manifest/existing-manifest-context.js.map +1 -1
- package/lib/manifest/existing-manifest-context.mjs +68 -27
- package/lib/manifest/existing-manifest-context.mjs.map +1 -1
- package/lib/manifest/field.d.mts.map +1 -1
- package/lib/manifest/field.d.ts.map +1 -1
- package/lib/manifest/field.js +13 -7
- package/lib/manifest/field.js.map +1 -1
- package/lib/manifest/field.mjs +13 -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/lib/manifest/list-view.d.mts +14 -2
- package/lib/manifest/list-view.d.mts.map +1 -1
- package/lib/manifest/list-view.d.ts +14 -2
- package/lib/manifest/list-view.d.ts.map +1 -1
- package/lib/manifest/list-view.js +5 -4
- package/lib/manifest/list-view.js.map +1 -1
- package/lib/manifest/list-view.mjs +5 -4
- package/lib/manifest/list-view.mjs.map +1 -1
- package/lib/manifest/manifest-function.d.mts.map +1 -1
- package/lib/manifest/manifest-function.d.ts.map +1 -1
- package/lib/manifest/manifest-function.js +3 -2
- package/lib/manifest/manifest-function.js.map +1 -1
- package/lib/manifest/manifest-function.mjs +3 -2
- package/lib/manifest/manifest-function.mjs.map +1 -1
- package/lib/manifest/rule.d.mts.map +1 -1
- package/lib/manifest/rule.d.ts.map +1 -1
- package/lib/manifest/rule.js +4 -3
- package/lib/manifest/rule.js.map +1 -1
- package/lib/manifest/rule.mjs +4 -3
- package/lib/manifest/rule.mjs.map +1 -1
- package/lib/manifest/sdui-page.d.mts +1 -1
- package/lib/manifest/sdui-page.d.mts.map +1 -1
- package/lib/manifest/sdui-page.d.ts +1 -1
- package/lib/manifest/sdui-page.d.ts.map +1 -1
- package/lib/manifest/sdui-page.js +5 -4
- package/lib/manifest/sdui-page.js.map +1 -1
- package/lib/manifest/sdui-page.mjs +5 -4
- package/lib/manifest/sdui-page.mjs.map +1 -1
- package/lib/manifest/validation.d.mts.map +1 -1
- package/lib/manifest/validation.d.ts.map +1 -1
- package/lib/manifest/validation.js +12 -7
- package/lib/manifest/validation.js.map +1 -1
- package/lib/manifest/validation.mjs +12 -7
- package/lib/manifest/validation.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/draft-hires.d.mts +17 -0
- package/resources/draft-hires.d.mts.map +1 -1
- package/resources/draft-hires.d.ts +17 -0
- package/resources/draft-hires.d.ts.map +1 -1
- package/src/lib/manifest/_existing-component-fields.ts +73 -0
- package/src/lib/manifest/app.ts +3 -2
- package/src/lib/manifest/category.ts +7 -4
- package/src/lib/manifest/custom-object-field-section.ts +3 -2
- package/src/lib/manifest/custom-object-page-layout.ts +9 -4
- package/src/lib/manifest/custom-object.ts +20 -10
- package/src/lib/manifest/existing-manifest-context.ts +125 -38
- package/src/lib/manifest/field.ts +18 -10
- package/src/lib/manifest/index.ts +1 -0
- package/src/lib/manifest/list-view.ts +27 -7
- package/src/lib/manifest/manifest-function.ts +3 -2
- package/src/lib/manifest/rule.ts +4 -3
- package/src/lib/manifest/sdui-page.ts +10 -5
- package/src/lib/manifest/validation.ts +12 -7
- package/src/resources/draft-hires.ts +19 -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
|
@@ -10,6 +10,7 @@ import { ManifestFunction } from './manifest-function';
|
|
|
10
10
|
import { Rule } from './rule';
|
|
11
11
|
import { SduiPage } from './sdui-page';
|
|
12
12
|
import { Validation } from './validation';
|
|
13
|
+
import { requireObjectComponentField, requireStringComponentField } from './_existing-component-fields';
|
|
13
14
|
|
|
14
15
|
export interface ExistingManifest {
|
|
15
16
|
metadata?: Record<string, any>;
|
|
@@ -316,37 +317,52 @@ export class ExistingManifestContext {
|
|
|
316
317
|
}
|
|
317
318
|
|
|
318
319
|
private loadCategoryComponent(component: Record<string, any>): Category {
|
|
319
|
-
const
|
|
320
|
+
const apiName = requireStringComponentField(component, 'api_name', Category.componentType);
|
|
321
|
+
const cacheKey = this.cacheKey('CUSTOM_CATEGORY', apiName);
|
|
320
322
|
return this.getOrLoad(cacheKey, () =>
|
|
321
323
|
Category._fromExistingComponent(this.getManifestBuilder(), component),
|
|
322
324
|
);
|
|
323
325
|
}
|
|
324
326
|
|
|
325
327
|
private loadCustomObjectComponent(component: Record<string, any>): CustomObject {
|
|
326
|
-
const
|
|
328
|
+
const customObjectApiName = requireStringComponentField(
|
|
329
|
+
component,
|
|
330
|
+
'api_name',
|
|
331
|
+
CustomObject.componentType,
|
|
332
|
+
);
|
|
333
|
+
const cacheKey = this.cacheKey('CUSTOM_OBJECT', customObjectApiName);
|
|
327
334
|
return this.getOrLoad(cacheKey, () => {
|
|
328
335
|
return CustomObject._fromExistingComponent(this.getManifestBuilder(), component, (categoryApiName) =>
|
|
329
|
-
this.
|
|
330
|
-
this.loadCategory(categoryApiName)
|
|
331
|
-
: categoryApiName,
|
|
336
|
+
this.loadRequiredCategoryForCustomObject(categoryApiName, customObjectApiName),
|
|
332
337
|
);
|
|
333
338
|
});
|
|
334
339
|
}
|
|
335
340
|
|
|
336
341
|
private loadFieldSectionComponent(component: Record<string, any>): CustomObjectFieldSection {
|
|
337
|
-
const
|
|
338
|
-
|
|
339
|
-
|
|
342
|
+
const modelName = requireStringComponentField(
|
|
343
|
+
component,
|
|
344
|
+
'model_name',
|
|
345
|
+
CustomObjectFieldSection.componentType,
|
|
340
346
|
);
|
|
347
|
+
const sectionId = requireStringComponentField(
|
|
348
|
+
component,
|
|
349
|
+
'section_id',
|
|
350
|
+
CustomObjectFieldSection.componentType,
|
|
351
|
+
);
|
|
352
|
+
const cacheKey = this.cacheKey('CUSTOM_OBJECT_FIELD_SECTION', `${modelName}.${sectionId}`);
|
|
341
353
|
return this.getOrLoad(cacheKey, () => {
|
|
342
|
-
const customObject = this.loadCustomObject(
|
|
354
|
+
const customObject = this.loadCustomObject(modelName);
|
|
343
355
|
return CustomObjectFieldSection._fromExistingComponent(customObject, component);
|
|
344
356
|
});
|
|
345
357
|
}
|
|
346
358
|
|
|
347
359
|
private loadFieldComponent(component: Record<string, any>): Field {
|
|
348
|
-
const customObjectApiName =
|
|
349
|
-
|
|
360
|
+
const customObjectApiName = requireStringComponentField(
|
|
361
|
+
component,
|
|
362
|
+
'custom_object_api_name',
|
|
363
|
+
Field.componentType,
|
|
364
|
+
);
|
|
365
|
+
const fieldApiName = requireStringComponentField(component, 'field_api_name', Field.componentType);
|
|
350
366
|
if (component['is_standard'] === true) {
|
|
351
367
|
this.loadCustomObject(customObjectApiName);
|
|
352
368
|
return this.loadFieldReferenceComponent(component);
|
|
@@ -357,7 +373,11 @@ export class ExistingManifestContext {
|
|
|
357
373
|
const customObject = this.loadCustomObject(customObjectApiName);
|
|
358
374
|
const sectionId = component['section'];
|
|
359
375
|
if (typeof sectionId === 'string') {
|
|
360
|
-
this.
|
|
376
|
+
this.loadRequiredFieldSection(
|
|
377
|
+
customObjectApiName,
|
|
378
|
+
sectionId,
|
|
379
|
+
`CUSTOM_OBJECT_FIELD ${customObjectApiName}.${fieldApiName}`,
|
|
380
|
+
);
|
|
361
381
|
}
|
|
362
382
|
this.loadFieldRelationshipDependencies(component);
|
|
363
383
|
return Field._fromExistingComponent(customObject, component);
|
|
@@ -365,12 +385,14 @@ export class ExistingManifestContext {
|
|
|
365
385
|
}
|
|
366
386
|
|
|
367
387
|
private loadListViewComponent(component: Record<string, any>): ListViewDef {
|
|
368
|
-
const
|
|
369
|
-
|
|
370
|
-
|
|
388
|
+
const customObjectApiName = requireStringComponentField(
|
|
389
|
+
component,
|
|
390
|
+
'object_rql_name',
|
|
391
|
+
ListViewDef.componentType,
|
|
371
392
|
);
|
|
393
|
+
const viewId = requireStringComponentField(component, 'view_id', ListViewDef.componentType);
|
|
394
|
+
const cacheKey = this.cacheKey('CUSTOM_OBJECT_LIST_VIEW', `${customObjectApiName}.${viewId}`);
|
|
372
395
|
return this.getOrLoad(cacheKey, () => {
|
|
373
|
-
const customObjectApiName = component['object_rql_name'];
|
|
374
396
|
const customObject = this.loadCustomObject(customObjectApiName);
|
|
375
397
|
return ListViewDef._fromExistingComponent(customObject, component, (fieldApiName) =>
|
|
376
398
|
this.loadFieldByObjectAndApi(customObjectApiName, fieldApiName),
|
|
@@ -379,12 +401,18 @@ export class ExistingManifestContext {
|
|
|
379
401
|
}
|
|
380
402
|
|
|
381
403
|
private loadPageLayoutComponent(component: Record<string, any>): CustomObjectPageLayout {
|
|
382
|
-
const
|
|
383
|
-
|
|
384
|
-
|
|
404
|
+
const layoutId = requireStringComponentField(
|
|
405
|
+
component,
|
|
406
|
+
'layout_id',
|
|
407
|
+
CustomObjectPageLayout.componentType,
|
|
408
|
+
);
|
|
409
|
+
const customObjectApiName = requireStringComponentField(
|
|
410
|
+
component,
|
|
411
|
+
'object_rql_name',
|
|
412
|
+
CustomObjectPageLayout.componentType,
|
|
385
413
|
);
|
|
414
|
+
const cacheKey = this.cacheKey('CUSTOM_OBJECT_PAGE_LAYOUT', layoutId);
|
|
386
415
|
return this.getOrLoad(cacheKey, () => {
|
|
387
|
-
const customObjectApiName = component['object_rql_name'];
|
|
388
416
|
const customObject = this.loadCustomObject(customObjectApiName);
|
|
389
417
|
this.loadPageLayoutDependencies(customObjectApiName, component);
|
|
390
418
|
return CustomObjectPageLayout._fromExistingComponent(customObject, component);
|
|
@@ -392,12 +420,14 @@ export class ExistingManifestContext {
|
|
|
392
420
|
}
|
|
393
421
|
|
|
394
422
|
private loadValidationComponent(component: Record<string, any>): Validation {
|
|
395
|
-
const
|
|
396
|
-
|
|
397
|
-
|
|
423
|
+
const customObjectApiName = requireStringComponentField(
|
|
424
|
+
component,
|
|
425
|
+
'model_rql_name',
|
|
426
|
+
Validation.componentType,
|
|
398
427
|
);
|
|
428
|
+
const ruleId = requireStringComponentField(component, 'rule_id', Validation.componentType);
|
|
429
|
+
const cacheKey = this.cacheKey('CUSTOM_OBJECT_VALIDATION_RULE', `${customObjectApiName}.${ruleId}`);
|
|
399
430
|
return this.getOrLoad(cacheKey, () => {
|
|
400
|
-
const customObjectApiName = component['model_rql_name'];
|
|
401
431
|
const customObject = this.loadCustomObject(customObjectApiName);
|
|
402
432
|
return Validation._fromExistingComponent(customObject, component, (fieldApiName) =>
|
|
403
433
|
this.loadFieldByObjectAndApi(customObjectApiName, fieldApiName),
|
|
@@ -406,12 +436,10 @@ export class ExistingManifestContext {
|
|
|
406
436
|
}
|
|
407
437
|
|
|
408
438
|
private loadRuleComponent(component: Record<string, any>): Rule {
|
|
409
|
-
const
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
);
|
|
439
|
+
const customObjectApiName = requireStringComponentField(component, 'model_rql_name', Rule.componentType);
|
|
440
|
+
const flowId = requireStringComponentField(component, 'flow_id', Rule.componentType);
|
|
441
|
+
const cacheKey = this.cacheKey('CUSTOM_OBJECT_RECORD_TRIGGERED_FLOW', `${customObjectApiName}.${flowId}`);
|
|
413
442
|
return this.getOrLoad(cacheKey, () => {
|
|
414
|
-
const customObjectApiName = component['model_rql_name'];
|
|
415
443
|
const customObject = this.loadCustomObject(customObjectApiName);
|
|
416
444
|
return Rule._fromExistingComponent(customObject, component, (fieldApiName) =>
|
|
417
445
|
this.loadFieldByObjectAndApi(customObjectApiName, fieldApiName),
|
|
@@ -420,25 +448,26 @@ export class ExistingManifestContext {
|
|
|
420
448
|
}
|
|
421
449
|
|
|
422
450
|
private loadFunctionComponent(component: Record<string, any>): ManifestFunction {
|
|
423
|
-
const
|
|
451
|
+
const apiName = requireStringComponentField(component, 'api_name', ManifestFunction.componentType);
|
|
452
|
+
const cacheKey = this.cacheKey('FUNCTION', apiName);
|
|
424
453
|
return this.getOrLoad(cacheKey, () =>
|
|
425
454
|
ManifestFunction._fromExistingComponent(this.getManifestBuilder(), component),
|
|
426
455
|
);
|
|
427
456
|
}
|
|
428
457
|
|
|
429
458
|
private loadSduiPageComponent(component: Record<string, any>): SduiPage {
|
|
430
|
-
const
|
|
459
|
+
const sduiPageId = requireStringComponentField(component, 'sdui_page_id', SduiPage.componentType);
|
|
460
|
+
const cacheKey = this.cacheKey('SDUI_PAGE', sduiPageId);
|
|
431
461
|
return this.getOrLoad(cacheKey, () => {
|
|
432
462
|
return SduiPage._fromExistingComponent(this.getManifestBuilder(), component, (functionApiName) =>
|
|
433
|
-
this.
|
|
434
|
-
this.loadFunction(functionApiName)
|
|
435
|
-
: functionApiName,
|
|
463
|
+
this.loadRequiredFunctionForSduiPage(functionApiName, component),
|
|
436
464
|
);
|
|
437
465
|
});
|
|
438
466
|
}
|
|
439
467
|
|
|
440
468
|
private loadAppComponent(component: Record<string, any>): App {
|
|
441
|
-
const
|
|
469
|
+
const apiName = requireStringComponentField(component, 'api_name', App.componentType);
|
|
470
|
+
const cacheKey = this.cacheKey('CUSTOM_APP', apiName);
|
|
442
471
|
return this.getOrLoad(cacheKey, () => {
|
|
443
472
|
this.loadAppDependencies(component);
|
|
444
473
|
return App._fromExistingComponent(this.getManifestBuilder(), component);
|
|
@@ -495,13 +524,48 @@ export class ExistingManifestContext {
|
|
|
495
524
|
return this.getOrLoad(cacheKey, () => Field._referenceFromExistingComponent(component));
|
|
496
525
|
}
|
|
497
526
|
|
|
527
|
+
private loadRequiredCategoryForCustomObject(
|
|
528
|
+
categoryApiName: string,
|
|
529
|
+
customObjectApiName: string,
|
|
530
|
+
): Category {
|
|
531
|
+
const component = this.ofType('CUSTOM_CATEGORY').find(
|
|
532
|
+
(candidate) => candidate['api_name'] === categoryApiName,
|
|
533
|
+
);
|
|
534
|
+
if (component == null) {
|
|
535
|
+
throw new Error(
|
|
536
|
+
`CUSTOM_OBJECT ${customObjectApiName} references CUSTOM_CATEGORY ${categoryApiName}, ` +
|
|
537
|
+
'but that category component is not present. Pass the full existing component extraction ' +
|
|
538
|
+
'to ManifestBuilder.loadFromExistingJson(...).',
|
|
539
|
+
);
|
|
540
|
+
}
|
|
541
|
+
return this.loadCategoryComponent(component);
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
private loadRequiredFunctionForSduiPage(
|
|
545
|
+
functionApiName: string,
|
|
546
|
+
component: Record<string, any>,
|
|
547
|
+
): ManifestFunction {
|
|
548
|
+
const sduiPageId = component['sdui_page_id'] ?? 'unknown';
|
|
549
|
+
const functionComponent = this.ofType('FUNCTION').find(
|
|
550
|
+
(candidate) => candidate['api_name'] === functionApiName,
|
|
551
|
+
);
|
|
552
|
+
if (functionComponent == null) {
|
|
553
|
+
throw new Error(
|
|
554
|
+
`SDUI_PAGE ${sduiPageId} references FUNCTION ${functionApiName}, ` +
|
|
555
|
+
'but that function component is not present. Pass the full existing component extraction ' +
|
|
556
|
+
'to ManifestBuilder.loadFromExistingJson(...).',
|
|
557
|
+
);
|
|
558
|
+
}
|
|
559
|
+
return this.loadFunctionComponent(functionComponent);
|
|
560
|
+
}
|
|
561
|
+
|
|
498
562
|
private loadSyntheticFieldReference(customObjectApiName: string, fieldApiName: string): Field {
|
|
499
563
|
const cacheKey = this.cacheKey('CUSTOM_OBJECT_FIELD_REF', `${customObjectApiName}.${fieldApiName}`);
|
|
500
564
|
return this.getOrLoad(cacheKey, () => Field._syntheticReference(customObjectApiName, fieldApiName));
|
|
501
565
|
}
|
|
502
566
|
|
|
503
567
|
private loadFieldRelationshipDependencies(component: Record<string, any>): void {
|
|
504
|
-
const dataType = component
|
|
568
|
+
const dataType = requireObjectComponentField(component, 'data_type', Field.componentType);
|
|
505
569
|
const targetApiName = dataType['og_model_rql_name'];
|
|
506
570
|
if (
|
|
507
571
|
typeof targetApiName === 'string' &&
|
|
@@ -600,8 +664,17 @@ export class ExistingManifestContext {
|
|
|
600
664
|
}
|
|
601
665
|
if (field == null || typeof field !== 'object') return;
|
|
602
666
|
const record = field as Record<string, any>;
|
|
603
|
-
|
|
604
|
-
|
|
667
|
+
const fieldSection = record['fieldSection'] ?? record['field_section'];
|
|
668
|
+
const fieldApiName = record['fieldRqlName'] ?? record['field_rql_name'];
|
|
669
|
+
if (typeof fieldSection === 'string') {
|
|
670
|
+
const fieldLabel = typeof fieldApiName === 'string' ? ` ${fieldApiName}` : '';
|
|
671
|
+
this.loadRequiredFieldSection(
|
|
672
|
+
customObjectApiName,
|
|
673
|
+
fieldSection,
|
|
674
|
+
`CUSTOM_OBJECT_PAGE_LAYOUT field${fieldLabel} on ${customObjectApiName}`,
|
|
675
|
+
);
|
|
676
|
+
}
|
|
677
|
+
this.loadFieldDependencyIfString(customObjectApiName, fieldApiName);
|
|
605
678
|
}
|
|
606
679
|
|
|
607
680
|
private loadFieldDependencyIfString(customObjectApiName: string, fieldApiName: unknown): void {
|
|
@@ -620,6 +693,20 @@ export class ExistingManifestContext {
|
|
|
620
693
|
}
|
|
621
694
|
}
|
|
622
695
|
|
|
696
|
+
private loadRequiredFieldSection(customObjectApiName: string, sectionId: string, ownerLabel: string): void {
|
|
697
|
+
const component = this.ofType('CUSTOM_OBJECT_FIELD_SECTION').find(
|
|
698
|
+
(candidate) => candidate['model_name'] === customObjectApiName && candidate['section_id'] === sectionId,
|
|
699
|
+
);
|
|
700
|
+
if (component == null) {
|
|
701
|
+
throw new Error(
|
|
702
|
+
`${ownerLabel} references CUSTOM_OBJECT_FIELD_SECTION ${sectionId}, ` +
|
|
703
|
+
'but that field section component is not present. Pass the full existing component extraction ' +
|
|
704
|
+
'to ManifestBuilder.loadFromExistingJson(...).',
|
|
705
|
+
);
|
|
706
|
+
}
|
|
707
|
+
this.loadFieldSectionComponent(component);
|
|
708
|
+
}
|
|
709
|
+
|
|
623
710
|
private loadAppDependencies(component: Record<string, any>): void {
|
|
624
711
|
for (const page of component['pages'] ?? []) {
|
|
625
712
|
if (page == null || typeof page !== 'object') continue;
|
|
@@ -9,6 +9,7 @@ import type { CustomObject } from './custom-object';
|
|
|
9
9
|
import type { CustomObjectFieldSection } from './custom-object-field-section';
|
|
10
10
|
import { getExistingManifestContext, type ExistingManifestContextOptions } from './existing-manifest-context';
|
|
11
11
|
import type { ManifestComponentDeletion } from './manifest-builder';
|
|
12
|
+
import { requireObjectComponentField, requireStringComponentField } from './_existing-component-fields';
|
|
12
13
|
|
|
13
14
|
export interface CustomObjectFieldDeletionIdentifier {
|
|
14
15
|
customObjectApiName: string;
|
|
@@ -124,15 +125,19 @@ class ExistingFieldReference {
|
|
|
124
125
|
private readonly customObjectApiName: string,
|
|
125
126
|
private readonly component: Record<string, any>,
|
|
126
127
|
) {
|
|
128
|
+
requireStringComponentField(component, 'custom_object_api_name', Field.componentType);
|
|
129
|
+
requireStringComponentField(component, 'field_api_name', Field.componentType);
|
|
130
|
+
requireStringComponentField(component, 'field_display_name', Field.componentType);
|
|
131
|
+
requireObjectComponentField(component, 'data_type', Field.componentType);
|
|
127
132
|
this._section = (component['section'] as string | null | undefined) ?? null;
|
|
128
133
|
}
|
|
129
134
|
|
|
130
135
|
getApiName(): string {
|
|
131
|
-
return this.component['field_api_name'];
|
|
136
|
+
return this.component['field_api_name'] as string;
|
|
132
137
|
}
|
|
133
138
|
|
|
134
139
|
getDisplayName(): string {
|
|
135
|
-
return this.component['field_display_name']
|
|
140
|
+
return this.component['field_display_name'] as string;
|
|
136
141
|
}
|
|
137
142
|
|
|
138
143
|
getCustomObjectApiName(): string {
|
|
@@ -144,7 +149,7 @@ class ExistingFieldReference {
|
|
|
144
149
|
}
|
|
145
150
|
|
|
146
151
|
getDataType(): Readonly<Record<string, any>> {
|
|
147
|
-
return this.component['data_type']
|
|
152
|
+
return this.component['data_type'] as Record<string, any>;
|
|
148
153
|
}
|
|
149
154
|
|
|
150
155
|
isFormula(): boolean {
|
|
@@ -270,10 +275,10 @@ export class Field {
|
|
|
270
275
|
/** @internal Hydrates a custom object field from existing manifest wire JSON. */
|
|
271
276
|
static _fromExistingComponent(customObject: CustomObject, component: Record<string, any>): Field {
|
|
272
277
|
const props: FieldProps = {
|
|
273
|
-
apiName: component
|
|
274
|
-
displayName: component
|
|
278
|
+
apiName: requireStringComponentField(component, 'field_api_name', Field.componentType),
|
|
279
|
+
displayName: requireStringComponentField(component, 'field_display_name', Field.componentType),
|
|
280
|
+
dataType: cloneJson(requireObjectComponentField(component, 'data_type', Field.componentType)),
|
|
275
281
|
};
|
|
276
|
-
if (component['data_type'] !== undefined) props.dataType = cloneJson(component['data_type'] ?? {});
|
|
277
282
|
if (component['description'] !== undefined) props.description = component['description'];
|
|
278
283
|
if (component['is_required'] !== undefined) props.required = component['is_required'];
|
|
279
284
|
if (component['is_unique'] !== undefined) props.unique = component['is_unique'];
|
|
@@ -293,10 +298,13 @@ export class Field {
|
|
|
293
298
|
|
|
294
299
|
/** @internal Creates a non-registered reference for standard or external fields. */
|
|
295
300
|
static _referenceFromExistingComponent(component: Record<string, any>): Field {
|
|
296
|
-
|
|
297
|
-
component
|
|
298
|
-
|
|
299
|
-
|
|
301
|
+
const customObjectApiName = requireStringComponentField(
|
|
302
|
+
component,
|
|
303
|
+
'custom_object_api_name',
|
|
304
|
+
Field.componentType,
|
|
305
|
+
);
|
|
306
|
+
requireStringComponentField(component, 'field_api_name', Field.componentType);
|
|
307
|
+
return new ExistingFieldReference(customObjectApiName, cloneJson(component)) as unknown as Field;
|
|
300
308
|
}
|
|
301
309
|
|
|
302
310
|
/** @internal Creates a non-registered reference for a known wire field name. */
|
|
@@ -3,12 +3,27 @@ import type { CustomObject } from './custom-object';
|
|
|
3
3
|
import { getExistingManifestContext, type ExistingManifestContextOptions } from './existing-manifest-context';
|
|
4
4
|
import type { Field } from './field';
|
|
5
5
|
import type { ManifestComponentDeletion } from './manifest-builder';
|
|
6
|
+
import {
|
|
7
|
+
requireArrayComponentField,
|
|
8
|
+
requireBooleanComponentField,
|
|
9
|
+
requireStringComponentField,
|
|
10
|
+
} from './_existing-component-fields';
|
|
6
11
|
|
|
7
12
|
export interface ListViewDeletionIdentifier {
|
|
8
13
|
viewId: string;
|
|
9
14
|
objectRqlName: string;
|
|
10
15
|
}
|
|
11
16
|
|
|
17
|
+
/**
|
|
18
|
+
* Per-column display configuration for a list view.
|
|
19
|
+
*/
|
|
20
|
+
export interface ListViewColumnConfig {
|
|
21
|
+
/**
|
|
22
|
+
* Relative display width for this column.
|
|
23
|
+
*/
|
|
24
|
+
widthRatio: number;
|
|
25
|
+
}
|
|
26
|
+
|
|
12
27
|
/**
|
|
13
28
|
* Initialization properties for {@link ListViewDef}.
|
|
14
29
|
*/
|
|
@@ -63,11 +78,14 @@ export interface ListViewDefProps {
|
|
|
63
78
|
*/
|
|
64
79
|
description?: string;
|
|
65
80
|
/**
|
|
66
|
-
* Per-column configuration overrides
|
|
81
|
+
* Per-column configuration overrides keyed by field API name.
|
|
82
|
+
*
|
|
83
|
+
* Only `widthRatio` is currently supported. Presentation hints such as
|
|
84
|
+
* badge/status rendering are not list-view column config options.
|
|
67
85
|
*
|
|
68
86
|
* Optional. @default `{}`
|
|
69
87
|
*/
|
|
70
|
-
columnConfig?: Record<string,
|
|
88
|
+
columnConfig?: Record<string, ListViewColumnConfig>;
|
|
71
89
|
/**
|
|
72
90
|
* RQL filter expression to pre-filter records shown in this view
|
|
73
91
|
* (e.g. `'(session_date__c == TODAY())'`).
|
|
@@ -134,7 +152,7 @@ export class ListViewDef {
|
|
|
134
152
|
private readonly _sortOrder: SortOrder | undefined;
|
|
135
153
|
private readonly _objectScope: ObjectScope | undefined;
|
|
136
154
|
private readonly _description: string | undefined;
|
|
137
|
-
private readonly _columnConfig: Record<string,
|
|
155
|
+
private readonly _columnConfig: Record<string, ListViewColumnConfig> | undefined;
|
|
138
156
|
private readonly _rqlFilter: string | undefined;
|
|
139
157
|
|
|
140
158
|
/**
|
|
@@ -178,10 +196,12 @@ export class ListViewDef {
|
|
|
178
196
|
resolveField: (apiName: string) => Field,
|
|
179
197
|
): ListViewDef {
|
|
180
198
|
const props: ListViewDefProps = {
|
|
181
|
-
viewId: component
|
|
182
|
-
name: component
|
|
183
|
-
fields: (component
|
|
184
|
-
|
|
199
|
+
viewId: requireStringComponentField(component, 'view_id', ListViewDef.componentType),
|
|
200
|
+
name: requireStringComponentField(component, 'name', ListViewDef.componentType),
|
|
201
|
+
fields: requireArrayComponentField<string>(component, 'fields', ListViewDef.componentType).map(
|
|
202
|
+
(fieldApiName: string) => resolveField(fieldApiName),
|
|
203
|
+
),
|
|
204
|
+
isPublic: requireBooleanComponentField(component, 'public', ListViewDef.componentType),
|
|
185
205
|
};
|
|
186
206
|
if (component['description'] !== undefined) props.description = component['description'];
|
|
187
207
|
if (component['object_scope'] !== undefined) props.objectScope = component['object_scope'];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { FunctionRuntime } from './_helpers';
|
|
2
2
|
import { getExistingManifestContext, type ExistingManifestContextOptions } from './existing-manifest-context';
|
|
3
3
|
import type { ManifestComponentDeletion, ManifestScope } from './manifest-builder';
|
|
4
|
+
import { requireStringComponentField } from './_existing-component-fields';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Initialization properties for {@link ManifestFunction}.
|
|
@@ -148,8 +149,8 @@ export class ManifestFunction {
|
|
|
148
149
|
/** @internal Hydrates a function from existing manifest wire JSON. */
|
|
149
150
|
static _fromExistingComponent(scope: ManifestScope, component: Record<string, any>): ManifestFunction {
|
|
150
151
|
const props: ManifestFunctionProps = {
|
|
151
|
-
apiName: component
|
|
152
|
-
name: component
|
|
152
|
+
apiName: requireStringComponentField(component, 'api_name', ManifestFunction.componentType),
|
|
153
|
+
name: requireStringComponentField(component, 'name', ManifestFunction.componentType),
|
|
153
154
|
};
|
|
154
155
|
if (component['code_draft'] !== undefined) props.code = component['code_draft'];
|
|
155
156
|
if (component['description'] !== undefined) props.description = component['description'];
|
package/src/lib/manifest/rule.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { CustomObject } from './custom-object';
|
|
|
3
3
|
import { getExistingManifestContext, type ExistingManifestContextOptions } from './existing-manifest-context';
|
|
4
4
|
import type { Field } from './field';
|
|
5
5
|
import type { ManifestComponentDeletion } from './manifest-builder';
|
|
6
|
+
import { requireStringComponentField } from './_existing-component-fields';
|
|
6
7
|
|
|
7
8
|
export interface RuleDeletionIdentifier {
|
|
8
9
|
flowId: string;
|
|
@@ -193,9 +194,9 @@ export class Rule {
|
|
|
193
194
|
resolveField: (apiName: string) => Field,
|
|
194
195
|
): Rule {
|
|
195
196
|
const props: RuleProps = {
|
|
196
|
-
flowId: component
|
|
197
|
-
flowName: component
|
|
198
|
-
triggerType: component
|
|
197
|
+
flowId: requireStringComponentField(component, 'flow_id', Rule.componentType),
|
|
198
|
+
flowName: requireStringComponentField(component, 'flow_name', Rule.componentType),
|
|
199
|
+
triggerType: requireStringComponentField(component, 'trigger_type', Rule.componentType) as TriggerType,
|
|
199
200
|
actions: (component['actions'] ?? []).map((action: Record<string, any>): RuleAction => {
|
|
200
201
|
const out: RuleAction = {
|
|
201
202
|
targetField: resolveField(action['target_field']),
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { getExistingManifestContext, type ExistingManifestContextOptions } from './existing-manifest-context';
|
|
2
2
|
import type { ManifestFunction } from './manifest-function';
|
|
3
3
|
import type { ManifestComponentDeletion, ManifestScope } from './manifest-builder';
|
|
4
|
+
import { requireStringComponentField } from './_existing-component-fields';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Initialization properties for {@link SduiPage}.
|
|
@@ -101,13 +102,17 @@ export class SduiPage {
|
|
|
101
102
|
static _fromExistingComponent(
|
|
102
103
|
scope: ManifestScope,
|
|
103
104
|
component: Record<string, any>,
|
|
104
|
-
resolveFunction: (apiName: string) => ManifestFunction
|
|
105
|
+
resolveFunction: (apiName: string) => ManifestFunction,
|
|
105
106
|
): SduiPage {
|
|
106
|
-
const functionApiName =
|
|
107
|
+
const functionApiName = requireStringComponentField(
|
|
108
|
+
component,
|
|
109
|
+
'function_api_name',
|
|
110
|
+
SduiPage.componentType,
|
|
111
|
+
);
|
|
107
112
|
const props: SduiPageProps = {
|
|
108
|
-
sduiPageId: component
|
|
109
|
-
name: component
|
|
110
|
-
function:
|
|
113
|
+
sduiPageId: requireStringComponentField(component, 'sdui_page_id', SduiPage.componentType),
|
|
114
|
+
name: requireStringComponentField(component, 'name', SduiPage.componentType),
|
|
115
|
+
function: resolveFunction(functionApiName),
|
|
111
116
|
};
|
|
112
117
|
if (component['description'] !== undefined) {
|
|
113
118
|
props.description = component['description'];
|
|
@@ -3,6 +3,7 @@ import type { CustomObject } from './custom-object';
|
|
|
3
3
|
import { getExistingManifestContext, type ExistingManifestContextOptions } from './existing-manifest-context';
|
|
4
4
|
import type { Field } from './field';
|
|
5
5
|
import type { ManifestComponentDeletion } from './manifest-builder';
|
|
6
|
+
import { requireStringComponentField } from './_existing-component-fields';
|
|
6
7
|
|
|
7
8
|
export interface ValidationDeletionIdentifier {
|
|
8
9
|
ruleId: string;
|
|
@@ -147,13 +148,17 @@ export class Validation {
|
|
|
147
148
|
resolveField: (apiName: string) => Field,
|
|
148
149
|
): Validation {
|
|
149
150
|
const props: ValidationProps = {
|
|
150
|
-
ruleId: component
|
|
151
|
-
displayName: component
|
|
152
|
-
rqlFormula: component
|
|
153
|
-
errorMessage: component
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
151
|
+
ruleId: requireStringComponentField(component, 'rule_id', Validation.componentType),
|
|
152
|
+
displayName: requireStringComponentField(component, 'display_name', Validation.componentType),
|
|
153
|
+
rqlFormula: requireStringComponentField(component, 'rql_formula', Validation.componentType),
|
|
154
|
+
errorMessage: requireStringComponentField(component, 'custom_error_message', Validation.componentType, {
|
|
155
|
+
allowEmpty: true,
|
|
156
|
+
}),
|
|
157
|
+
state: requireStringComponentField(component, 'state', Validation.componentType) as ValidationState,
|
|
158
|
+
level: requireStringComponentField(component, 'level', Validation.componentType) as ValidationLevel,
|
|
159
|
+
ruleDescription: requireStringComponentField(component, 'rule_description', Validation.componentType, {
|
|
160
|
+
allowEmpty: true,
|
|
161
|
+
}),
|
|
157
162
|
};
|
|
158
163
|
if (component['field_rql_name'] != null) props.fieldRef = resolveField(component['field_rql_name']);
|
|
159
164
|
return new Validation(customObject, props);
|
|
@@ -123,6 +123,13 @@ export namespace DraftHireCreateParams {
|
|
|
123
123
|
* Documents to attach to this draft hire
|
|
124
124
|
*/
|
|
125
125
|
documents?: Array<DraftHire.Document>;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Headcount planning info for hiring into a position. If provided, the draft hire
|
|
129
|
+
* will be linked to the specified open headcount allocation. Requires headcount
|
|
130
|
+
* planning to be enabled for the company.
|
|
131
|
+
*/
|
|
132
|
+
headcount_info?: DraftHire.HeadcountInfo;
|
|
126
133
|
}
|
|
127
134
|
|
|
128
135
|
export namespace DraftHire {
|
|
@@ -569,6 +576,18 @@ export namespace DraftHireCreateParams {
|
|
|
569
576
|
*/
|
|
570
577
|
signature_date?: string;
|
|
571
578
|
}
|
|
579
|
+
|
|
580
|
+
/**
|
|
581
|
+
* Headcount planning info for hiring into a position. If provided, the draft hire
|
|
582
|
+
* will be linked to the specified open headcount allocation. Requires headcount
|
|
583
|
+
* planning to be enabled for the company.
|
|
584
|
+
*/
|
|
585
|
+
export interface HeadcountInfo {
|
|
586
|
+
/**
|
|
587
|
+
* The Position ID (PID) of the headcount allocation to fill (e.g., PID100615)
|
|
588
|
+
*/
|
|
589
|
+
position_id: string;
|
|
590
|
+
}
|
|
572
591
|
}
|
|
573
592
|
}
|
|
574
593
|
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.2.0-alpha.
|
|
1
|
+
export const VERSION = '0.2.0-alpha.43'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.2.0-alpha.
|
|
1
|
+
export declare const VERSION = "0.2.0-alpha.43";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.2.0-alpha.
|
|
1
|
+
export declare const VERSION = "0.2.0-alpha.43";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.VERSION = void 0;
|
|
4
|
-
exports.VERSION = '0.2.0-alpha.
|
|
4
|
+
exports.VERSION = '0.2.0-alpha.43'; // x-release-please-version
|
|
5
5
|
//# sourceMappingURL=version.js.map
|
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.2.0-alpha.
|
|
1
|
+
export const VERSION = '0.2.0-alpha.43'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|