@rippling/rippling-sdk 0.2.0-alpha.38 → 0.2.0-alpha.40
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/app.d.mts +11 -1
- package/lib/manifest/app.d.mts.map +1 -1
- package/lib/manifest/app.d.ts +11 -1
- package/lib/manifest/app.d.ts.map +1 -1
- package/lib/manifest/app.js +42 -1
- package/lib/manifest/app.js.map +1 -1
- package/lib/manifest/app.mjs +42 -1
- package/lib/manifest/app.mjs.map +1 -1
- package/lib/manifest/category.d.mts +10 -1
- package/lib/manifest/category.d.mts.map +1 -1
- package/lib/manifest/category.d.ts +10 -1
- package/lib/manifest/category.d.ts.map +1 -1
- package/lib/manifest/category.js +23 -1
- package/lib/manifest/category.js.map +1 -1
- package/lib/manifest/category.mjs +23 -1
- package/lib/manifest/category.mjs.map +1 -1
- package/lib/manifest/custom-object-field-section.d.mts +13 -0
- package/lib/manifest/custom-object-field-section.d.mts.map +1 -1
- package/lib/manifest/custom-object-field-section.d.ts +13 -0
- package/lib/manifest/custom-object-field-section.d.ts.map +1 -1
- package/lib/manifest/custom-object-field-section.js +22 -1
- package/lib/manifest/custom-object-field-section.js.map +1 -1
- package/lib/manifest/custom-object-field-section.mjs +22 -1
- package/lib/manifest/custom-object-field-section.mjs.map +1 -1
- package/lib/manifest/custom-object-page-layout.d.mts +206 -0
- package/lib/manifest/custom-object-page-layout.d.mts.map +1 -1
- package/lib/manifest/custom-object-page-layout.d.ts +206 -0
- package/lib/manifest/custom-object-page-layout.d.ts.map +1 -1
- package/lib/manifest/custom-object-page-layout.js +603 -1
- package/lib/manifest/custom-object-page-layout.js.map +1 -1
- package/lib/manifest/custom-object-page-layout.mjs +603 -1
- package/lib/manifest/custom-object-page-layout.mjs.map +1 -1
- package/lib/manifest/custom-object.d.mts +11 -1
- package/lib/manifest/custom-object.d.mts.map +1 -1
- package/lib/manifest/custom-object.d.ts +11 -1
- package/lib/manifest/custom-object.d.ts.map +1 -1
- package/lib/manifest/custom-object.js +55 -2
- package/lib/manifest/custom-object.js.map +1 -1
- package/lib/manifest/custom-object.mjs +55 -2
- package/lib/manifest/custom-object.mjs.map +1 -1
- package/lib/manifest/existing-manifest-context.d.mts +87 -0
- package/lib/manifest/existing-manifest-context.d.mts.map +1 -0
- package/lib/manifest/existing-manifest-context.d.ts +87 -0
- package/lib/manifest/existing-manifest-context.d.ts.map +1 -0
- package/lib/manifest/existing-manifest-context.js +511 -0
- package/lib/manifest/existing-manifest-context.js.map +1 -0
- package/lib/manifest/existing-manifest-context.mjs +506 -0
- package/lib/manifest/existing-manifest-context.mjs.map +1 -0
- package/lib/manifest/field.d.mts +24 -0
- package/lib/manifest/field.d.mts.map +1 -1
- package/lib/manifest/field.d.ts +24 -0
- package/lib/manifest/field.d.ts.map +1 -1
- package/lib/manifest/field.js +114 -1
- package/lib/manifest/field.js.map +1 -1
- package/lib/manifest/field.mjs +114 -1
- package/lib/manifest/field.mjs.map +1 -1
- package/lib/manifest/index.d.mts +8 -7
- package/lib/manifest/index.d.mts.map +1 -1
- package/lib/manifest/index.d.ts +8 -7
- package/lib/manifest/index.d.ts.map +1 -1
- package/lib/manifest/index.js +3 -1
- package/lib/manifest/index.js.map +1 -1
- package/lib/manifest/index.mjs +5 -4
- package/lib/manifest/index.mjs.map +1 -1
- package/lib/manifest/list-view.d.mts +17 -0
- package/lib/manifest/list-view.d.mts.map +1 -1
- package/lib/manifest/list-view.d.ts +17 -0
- package/lib/manifest/list-view.d.ts.map +1 -1
- package/lib/manifest/list-view.js +38 -1
- package/lib/manifest/list-view.js.map +1 -1
- package/lib/manifest/list-view.mjs +38 -1
- package/lib/manifest/list-view.mjs.map +1 -1
- package/lib/manifest/manifest-builder.d.mts +59 -6
- package/lib/manifest/manifest-builder.d.mts.map +1 -1
- package/lib/manifest/manifest-builder.d.ts +59 -6
- package/lib/manifest/manifest-builder.d.ts.map +1 -1
- package/lib/manifest/manifest-builder.js +61 -3
- package/lib/manifest/manifest-builder.js.map +1 -1
- package/lib/manifest/manifest-builder.mjs +61 -3
- package/lib/manifest/manifest-builder.mjs.map +1 -1
- package/lib/manifest/manifest-function.d.mts +10 -1
- package/lib/manifest/manifest-function.d.mts.map +1 -1
- package/lib/manifest/manifest-function.d.ts +10 -1
- package/lib/manifest/manifest-function.d.ts.map +1 -1
- package/lib/manifest/manifest-function.js +36 -1
- package/lib/manifest/manifest-function.js.map +1 -1
- package/lib/manifest/manifest-function.mjs +36 -1
- package/lib/manifest/manifest-function.mjs.map +1 -1
- package/lib/manifest/rule.d.mts +17 -0
- package/lib/manifest/rule.d.mts.map +1 -1
- package/lib/manifest/rule.d.ts +17 -0
- package/lib/manifest/rule.d.ts.map +1 -1
- package/lib/manifest/rule.js +45 -1
- package/lib/manifest/rule.js.map +1 -1
- package/lib/manifest/rule.mjs +45 -1
- package/lib/manifest/rule.mjs.map +1 -1
- package/lib/manifest/sdui-page.d.mts +10 -1
- package/lib/manifest/sdui-page.d.mts.map +1 -1
- package/lib/manifest/sdui-page.d.ts +10 -1
- package/lib/manifest/sdui-page.d.ts.map +1 -1
- package/lib/manifest/sdui-page.js +28 -1
- package/lib/manifest/sdui-page.js.map +1 -1
- package/lib/manifest/sdui-page.mjs +28 -1
- package/lib/manifest/sdui-page.mjs.map +1 -1
- package/lib/manifest/validation.d.mts +17 -0
- package/lib/manifest/validation.d.mts.map +1 -1
- package/lib/manifest/validation.d.ts +17 -0
- package/lib/manifest/validation.d.ts.map +1 -1
- package/lib/manifest/validation.js +31 -1
- package/lib/manifest/validation.js.map +1 -1
- package/lib/manifest/validation.mjs +31 -1
- package/lib/manifest/validation.mjs.map +1 -1
- package/package.json +1 -1
- package/src/lib/manifest/app.ts +46 -2
- package/src/lib/manifest/category.ts +28 -2
- package/src/lib/manifest/custom-object-field-section.ts +37 -1
- package/src/lib/manifest/custom-object-page-layout.ts +878 -1
- package/src/lib/manifest/custom-object.ts +58 -3
- package/src/lib/manifest/existing-manifest-context.ts +673 -0
- package/src/lib/manifest/field.ts +140 -1
- package/src/lib/manifest/index.ts +49 -4
- package/src/lib/manifest/list-view.ts +50 -1
- package/src/lib/manifest/manifest-builder.ts +114 -4
- package/src/lib/manifest/manifest-function.ts +36 -2
- package/src/lib/manifest/rule.ts +60 -1
- package/src/lib/manifest/sdui-page.ts +37 -2
- package/src/lib/manifest/validation.ts +48 -1
- 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,5 +1,6 @@
|
|
|
1
1
|
import { Category } from './category';
|
|
2
|
-
import
|
|
2
|
+
import { getExistingManifestContext, type ExistingManifestContextOptions } from './existing-manifest-context';
|
|
3
|
+
import type { ManifestComponent, ManifestComponentDeletion, ManifestScope } from './manifest-builder';
|
|
3
4
|
|
|
4
5
|
// ────────────────────────────────────────────────────────────────────────
|
|
5
6
|
// Platform-managed standard fields — mirrors
|
|
@@ -113,6 +114,8 @@ const STANDARD_FIELD_SPECS: ReadonlyArray<{
|
|
|
113
114
|
* (`id`, `created_at`, …) don't carry the custom-field suffix.
|
|
114
115
|
*/
|
|
115
116
|
class _StandardField implements ManifestComponent {
|
|
117
|
+
static readonly componentType = 'CUSTOM_OBJECT_FIELD' as const;
|
|
118
|
+
|
|
116
119
|
constructor(
|
|
117
120
|
private readonly customObjectApiName: string,
|
|
118
121
|
private readonly spec: (typeof STANDARD_FIELD_SPECS)[number],
|
|
@@ -120,7 +123,7 @@ class _StandardField implements ManifestComponent {
|
|
|
120
123
|
|
|
121
124
|
toDict(): Record<string, any> {
|
|
122
125
|
return {
|
|
123
|
-
type:
|
|
126
|
+
type: _StandardField.componentType,
|
|
124
127
|
custom_object_api_name: this.customObjectApiName,
|
|
125
128
|
field_api_name: this.spec.apiName,
|
|
126
129
|
field_display_name: this.spec.displayName,
|
|
@@ -297,6 +300,15 @@ export interface CustomObjectProps {
|
|
|
297
300
|
* can fragment ownership and complicate the permission story.
|
|
298
301
|
*/
|
|
299
302
|
export class CustomObject implements ManifestScope {
|
|
303
|
+
static readonly componentType = 'CUSTOM_OBJECT' as const;
|
|
304
|
+
|
|
305
|
+
static toDeletionIdentifier(apiName: string): ManifestComponentDeletion {
|
|
306
|
+
return {
|
|
307
|
+
type: CustomObject.componentType,
|
|
308
|
+
api_name: apiName,
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
|
|
300
312
|
private readonly _scope: ManifestScope;
|
|
301
313
|
private readonly _apiName: string;
|
|
302
314
|
private readonly _name: string;
|
|
@@ -333,6 +345,49 @@ export class CustomObject implements ManifestScope {
|
|
|
333
345
|
}
|
|
334
346
|
}
|
|
335
347
|
|
|
348
|
+
/**
|
|
349
|
+
* Loads this custom object from the active existing-manifest JSON context.
|
|
350
|
+
*/
|
|
351
|
+
static loadFromExisting(apiName: string, options: ExistingManifestContextOptions = {}): CustomObject {
|
|
352
|
+
return getExistingManifestContext(options).loadCustomObject(apiName);
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
/** @internal Hydrates a custom object from existing manifest wire JSON. */
|
|
356
|
+
static _fromExistingComponent(
|
|
357
|
+
scope: ManifestScope,
|
|
358
|
+
component: Record<string, any>,
|
|
359
|
+
resolveCategory: (apiName: string) => Category | string,
|
|
360
|
+
): CustomObject {
|
|
361
|
+
const categoryApiName = component['category_api_name'];
|
|
362
|
+
const props: CustomObjectProps = {
|
|
363
|
+
apiName: component['api_name'],
|
|
364
|
+
name: component['name'] ?? component['api_name'],
|
|
365
|
+
category: typeof categoryApiName === 'string' ? resolveCategory(categoryApiName) : categoryApiName,
|
|
366
|
+
};
|
|
367
|
+
if (component['description'] !== undefined) props.description = component['description'];
|
|
368
|
+
if (component['plural_label'] !== undefined) props.pluralLabel = component['plural_label'];
|
|
369
|
+
if (component['name_field_details'] !== undefined) {
|
|
370
|
+
props.nameFieldDetails = component['name_field_details'];
|
|
371
|
+
}
|
|
372
|
+
if (component['default_field_section_name'] !== undefined) {
|
|
373
|
+
props.defaultFieldSectionName = component['default_field_section_name'];
|
|
374
|
+
}
|
|
375
|
+
const icon = CustomObject.iconFromExistingComponent(component['icon']);
|
|
376
|
+
if (icon != null) props.icon = icon;
|
|
377
|
+
return new CustomObject(scope, props);
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
private static iconFromExistingComponent(value: unknown): IconConfig | undefined {
|
|
381
|
+
if (value == null || typeof value !== 'object') return undefined;
|
|
382
|
+
const wire = value as Record<string, any>;
|
|
383
|
+
const icon: IconConfig = {};
|
|
384
|
+
if (wire['emoji'] !== undefined) icon.emoji = wire['emoji'];
|
|
385
|
+
if (wire['rippling_icon'] !== undefined) icon.ripplingIcon = wire['rippling_icon'];
|
|
386
|
+
if (wire['s3_bucket'] !== undefined) icon.s3Bucket = wire['s3_bucket'];
|
|
387
|
+
if (wire['s3_key'] !== undefined) icon.s3Key = wire['s3_key'];
|
|
388
|
+
return Object.keys(icon).length > 0 ? icon : undefined;
|
|
389
|
+
}
|
|
390
|
+
|
|
336
391
|
/** @internal Scope hook — forwards child registration up to the root builder. */
|
|
337
392
|
_register(component: ManifestComponent): void {
|
|
338
393
|
this._scope._register(component);
|
|
@@ -362,7 +417,7 @@ export class CustomObject implements ManifestScope {
|
|
|
362
417
|
*/
|
|
363
418
|
toDict(): Record<string, any> {
|
|
364
419
|
const component: Record<string, any> = {
|
|
365
|
-
type:
|
|
420
|
+
type: CustomObject.componentType,
|
|
366
421
|
api_name: this._apiName,
|
|
367
422
|
name: this._name,
|
|
368
423
|
description: this._description ?? null,
|