@rippling/rippling-sdk 0.2.0-alpha.44 → 0.2.0-alpha.46
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/dental-practice-management/dental-practice-management.ts +0 -7
- package/examples/manifest/dental-practice-management/manifest.json +0 -7
- package/examples/manifest/existing-manifest-mutations/existing-manifest-mutations.ts +6 -7
- package/examples/manifest/gym-membership-management/gym-membership-management.ts +0 -7
- package/examples/manifest/gym-membership-management/manifest.json +0 -7
- package/lib/manifest/app.d.mts +2 -2
- package/lib/manifest/app.d.mts.map +1 -1
- package/lib/manifest/app.d.ts +2 -2
- package/lib/manifest/app.d.ts.map +1 -1
- package/lib/manifest/app.js +15 -4
- package/lib/manifest/app.js.map +1 -1
- package/lib/manifest/app.mjs +15 -4
- package/lib/manifest/app.mjs.map +1 -1
- package/lib/manifest/custom-object-field-section.d.mts +2 -2
- package/lib/manifest/custom-object-field-section.d.ts +2 -2
- package/lib/manifest/custom-object-field-section.js +2 -2
- package/lib/manifest/custom-object-field-section.mjs +2 -2
- package/lib/manifest/custom-object-page-layout.d.mts +86 -40
- package/lib/manifest/custom-object-page-layout.d.mts.map +1 -1
- package/lib/manifest/custom-object-page-layout.d.ts +86 -40
- package/lib/manifest/custom-object-page-layout.d.ts.map +1 -1
- package/lib/manifest/custom-object-page-layout.js +369 -79
- package/lib/manifest/custom-object-page-layout.js.map +1 -1
- package/lib/manifest/custom-object-page-layout.mjs +369 -79
- package/lib/manifest/custom-object-page-layout.mjs.map +1 -1
- package/lib/manifest/custom-object.d.mts +6 -0
- package/lib/manifest/custom-object.d.mts.map +1 -1
- package/lib/manifest/custom-object.d.ts +6 -0
- package/lib/manifest/custom-object.d.ts.map +1 -1
- package/lib/manifest/custom-object.js +6 -0
- package/lib/manifest/custom-object.js.map +1 -1
- package/lib/manifest/custom-object.mjs +6 -0
- package/lib/manifest/custom-object.mjs.map +1 -1
- package/lib/manifest/existing-manifest-context.d.mts +0 -1
- package/lib/manifest/existing-manifest-context.d.mts.map +1 -1
- package/lib/manifest/existing-manifest-context.d.ts +0 -1
- package/lib/manifest/existing-manifest-context.d.ts.map +1 -1
- package/lib/manifest/existing-manifest-context.js +5 -10
- package/lib/manifest/existing-manifest-context.js.map +1 -1
- package/lib/manifest/existing-manifest-context.mjs +5 -10
- package/lib/manifest/existing-manifest-context.mjs.map +1 -1
- package/lib/manifest/field.d.mts +6 -3
- package/lib/manifest/field.d.mts.map +1 -1
- package/lib/manifest/field.d.ts +6 -3
- package/lib/manifest/field.d.ts.map +1 -1
- package/lib/manifest/field.js +26 -6
- package/lib/manifest/field.js.map +1 -1
- package/lib/manifest/field.mjs +26 -6
- package/lib/manifest/field.mjs.map +1 -1
- package/package.json +1 -1
- package/src/lib/manifest/app.ts +19 -5
- package/src/lib/manifest/custom-object-field-section.ts +2 -2
- package/src/lib/manifest/custom-object-page-layout.ts +599 -109
- package/src/lib/manifest/custom-object.ts +6 -0
- package/src/lib/manifest/existing-manifest-context.ts +5 -12
- package/src/lib/manifest/field.ts +45 -9
- 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
package/src/lib/manifest/app.ts
CHANGED
|
@@ -58,9 +58,9 @@ export interface AppProps {
|
|
|
58
58
|
/**
|
|
59
59
|
* SDUI pages shown as tabs in the app. Tab order matches the array order.
|
|
60
60
|
*
|
|
61
|
-
*
|
|
61
|
+
* Required. Must include at least one page.
|
|
62
62
|
*/
|
|
63
|
-
pages
|
|
63
|
+
pages: AppPage[];
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
function resolvePage(entry: AppPage): Record<string, any> {
|
|
@@ -77,6 +77,20 @@ function resolvePage(entry: AppPage): Record<string, any> {
|
|
|
77
77
|
};
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
+
function resolvePages(pages: AppPage[] | undefined): Record<string, any>[] {
|
|
81
|
+
if (pages == null || pages.length === 0) {
|
|
82
|
+
throw new Error('App pages must include at least one page.');
|
|
83
|
+
}
|
|
84
|
+
return pages.map(resolvePage);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function clonePages(value: unknown): Record<string, any>[] {
|
|
88
|
+
if (!Array.isArray(value) || value.length === 0) {
|
|
89
|
+
throw new Error('App pages must include at least one page.');
|
|
90
|
+
}
|
|
91
|
+
return cloneJson(value) as Record<string, any>[];
|
|
92
|
+
}
|
|
93
|
+
|
|
80
94
|
function cloneJson<T>(value: T): T {
|
|
81
95
|
if (value == null) return value;
|
|
82
96
|
return JSON.parse(JSON.stringify(value)) as T;
|
|
@@ -130,7 +144,7 @@ export class App {
|
|
|
130
144
|
this._description = props.description;
|
|
131
145
|
this._appType = props.appType;
|
|
132
146
|
this._icon = props.icon;
|
|
133
|
-
this._pages = (props.pages
|
|
147
|
+
this._pages = resolvePages(props.pages);
|
|
134
148
|
scope._register(this);
|
|
135
149
|
}
|
|
136
150
|
|
|
@@ -150,7 +164,7 @@ export class App {
|
|
|
150
164
|
_description: component['description'],
|
|
151
165
|
_appType: component['app_type'],
|
|
152
166
|
_icon: App.appIconFromExistingComponent(component['icon']),
|
|
153
|
-
_pages:
|
|
167
|
+
_pages: clonePages(component['pages']),
|
|
154
168
|
});
|
|
155
169
|
scope._register(app);
|
|
156
170
|
return app;
|
|
@@ -193,7 +207,7 @@ export class App {
|
|
|
193
207
|
component['icon'] = { s3_bucket: this._icon.s3Bucket, s3_key: this._icon.s3Key };
|
|
194
208
|
}
|
|
195
209
|
if (this._appType != null) component['app_type'] = this._appType;
|
|
196
|
-
|
|
210
|
+
component['pages'] = this._pages.map((p) => ({ ...p }));
|
|
197
211
|
return component;
|
|
198
212
|
}
|
|
199
213
|
}
|
|
@@ -32,8 +32,8 @@ export interface CustomObjectFieldSectionProps {
|
|
|
32
32
|
* Defines a field section and registers it with the manifest.
|
|
33
33
|
*
|
|
34
34
|
* A field section is a named group of fields displayed together on a custom
|
|
35
|
-
* object's detail page.
|
|
36
|
-
*
|
|
35
|
+
* object's detail page. Every custom field must receive one of these sections
|
|
36
|
+
* through its `section` prop.
|
|
37
37
|
*
|
|
38
38
|
* @example
|
|
39
39
|
* ```ts
|