@rippling/rippling-sdk 0.2.0-alpha.38 → 0.2.0-alpha.39
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/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 +21 -0
- package/lib/manifest/custom-object-page-layout.d.mts.map +1 -1
- package/lib/manifest/custom-object-page-layout.d.ts +21 -0
- package/lib/manifest/custom-object-page-layout.d.ts.map +1 -1
- package/lib/manifest/custom-object-page-layout.js +41 -1
- package/lib/manifest/custom-object-page-layout.js.map +1 -1
- package/lib/manifest/custom-object-page-layout.mjs +41 -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 +61 -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 +39 -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
|
+
import { getExistingManifestContext, type ExistingManifestContextOptions } from './existing-manifest-context';
|
|
1
2
|
import type { ManifestFunction } from './manifest-function';
|
|
2
|
-
import type { ManifestScope } from './manifest-builder';
|
|
3
|
+
import type { ManifestComponentDeletion, ManifestScope } from './manifest-builder';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Initialization properties for {@link SduiPage}.
|
|
@@ -59,6 +60,15 @@ export interface SduiPageProps {
|
|
|
59
60
|
* @see {@link App} — hosts this page as a tab via `pages`.
|
|
60
61
|
*/
|
|
61
62
|
export class SduiPage {
|
|
63
|
+
static readonly componentType = 'SDUI_PAGE' as const;
|
|
64
|
+
|
|
65
|
+
static toDeletionIdentifier(sduiPageId: string): ManifestComponentDeletion {
|
|
66
|
+
return {
|
|
67
|
+
type: SduiPage.componentType,
|
|
68
|
+
sdui_page_id: sduiPageId,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
|
|
62
72
|
private readonly _sduiPageId: string;
|
|
63
73
|
private readonly _name: string;
|
|
64
74
|
private readonly _functionApiName: string;
|
|
@@ -80,6 +90,31 @@ export class SduiPage {
|
|
|
80
90
|
scope._register(this);
|
|
81
91
|
}
|
|
82
92
|
|
|
93
|
+
/**
|
|
94
|
+
* Loads this SDUI page from the active existing-manifest JSON context.
|
|
95
|
+
*/
|
|
96
|
+
static loadFromExisting(sduiPageId: string, options: ExistingManifestContextOptions = {}): SduiPage {
|
|
97
|
+
return getExistingManifestContext(options).loadSduiPage(sduiPageId);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** @internal Hydrates an SDUI page from existing manifest wire JSON. */
|
|
101
|
+
static _fromExistingComponent(
|
|
102
|
+
scope: ManifestScope,
|
|
103
|
+
component: Record<string, any>,
|
|
104
|
+
resolveFunction: (apiName: string) => ManifestFunction | string,
|
|
105
|
+
): SduiPage {
|
|
106
|
+
const functionApiName = component['function_api_name'];
|
|
107
|
+
const props: SduiPageProps = {
|
|
108
|
+
sduiPageId: component['sdui_page_id'],
|
|
109
|
+
name: component['name'] ?? component['sdui_page_id'],
|
|
110
|
+
function: typeof functionApiName === 'string' ? resolveFunction(functionApiName) : functionApiName,
|
|
111
|
+
};
|
|
112
|
+
if (component['description'] !== undefined) {
|
|
113
|
+
props.description = component['description'];
|
|
114
|
+
}
|
|
115
|
+
return new SduiPage(scope, props);
|
|
116
|
+
}
|
|
117
|
+
|
|
83
118
|
/**
|
|
84
119
|
* Returns the unique page identifier (e.g. `'gym_today_schedule'`).
|
|
85
120
|
*/
|
|
@@ -108,7 +143,7 @@ export class SduiPage {
|
|
|
108
143
|
*/
|
|
109
144
|
toDict(): Record<string, any> {
|
|
110
145
|
return {
|
|
111
|
-
type:
|
|
146
|
+
type: SduiPage.componentType,
|
|
112
147
|
name: this._name,
|
|
113
148
|
sdui_page_id: this._sduiPageId,
|
|
114
149
|
function_api_name: this._functionApiName,
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { generateId, type ValidationLevel, type ValidationState } from './_helpers';
|
|
2
2
|
import type { CustomObject } from './custom-object';
|
|
3
|
+
import { getExistingManifestContext, type ExistingManifestContextOptions } from './existing-manifest-context';
|
|
3
4
|
import type { Field } from './field';
|
|
5
|
+
import type { ManifestComponentDeletion } from './manifest-builder';
|
|
6
|
+
|
|
7
|
+
export interface ValidationDeletionIdentifier {
|
|
8
|
+
ruleId: string;
|
|
9
|
+
modelRqlName: string;
|
|
10
|
+
}
|
|
4
11
|
|
|
5
12
|
/**
|
|
6
13
|
* Initialization properties for {@link Validation}.
|
|
@@ -59,6 +66,10 @@ export interface ValidationProps {
|
|
|
59
66
|
fieldRef?: Field;
|
|
60
67
|
}
|
|
61
68
|
|
|
69
|
+
export interface ValidationLoadFromExistingOptions extends ExistingManifestContextOptions {
|
|
70
|
+
customObjectApiName?: string;
|
|
71
|
+
}
|
|
72
|
+
|
|
62
73
|
/**
|
|
63
74
|
* Defines a validation rule and registers it with the manifest.
|
|
64
75
|
*
|
|
@@ -85,6 +96,16 @@ export interface ValidationProps {
|
|
|
85
96
|
* ```
|
|
86
97
|
*/
|
|
87
98
|
export class Validation {
|
|
99
|
+
static readonly componentType = 'CUSTOM_OBJECT_VALIDATION_RULE' as const;
|
|
100
|
+
|
|
101
|
+
static toDeletionIdentifier(identifier: ValidationDeletionIdentifier): ManifestComponentDeletion {
|
|
102
|
+
return {
|
|
103
|
+
type: Validation.componentType,
|
|
104
|
+
rule_id: identifier.ruleId,
|
|
105
|
+
model_rql_name: identifier.modelRqlName,
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
|
|
88
109
|
private readonly _ruleId: string;
|
|
89
110
|
private readonly _customObjectApiName: string;
|
|
90
111
|
private readonly _displayName: string;
|
|
@@ -112,6 +133,32 @@ export class Validation {
|
|
|
112
133
|
customObject._register(this);
|
|
113
134
|
}
|
|
114
135
|
|
|
136
|
+
/**
|
|
137
|
+
* Loads this validation rule from the active existing-manifest JSON context.
|
|
138
|
+
*/
|
|
139
|
+
static loadFromExisting(ruleId: string, options: ValidationLoadFromExistingOptions = {}): Validation {
|
|
140
|
+
return getExistingManifestContext(options).loadValidation(ruleId, options);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/** @internal Hydrates a validation rule from existing manifest wire JSON. */
|
|
144
|
+
static _fromExistingComponent(
|
|
145
|
+
customObject: CustomObject,
|
|
146
|
+
component: Record<string, any>,
|
|
147
|
+
resolveField: (apiName: string) => Field,
|
|
148
|
+
): Validation {
|
|
149
|
+
const props: ValidationProps = {
|
|
150
|
+
ruleId: component['rule_id'],
|
|
151
|
+
displayName: component['display_name'] ?? component['rule_id'],
|
|
152
|
+
rqlFormula: component['rql_formula'] ?? '',
|
|
153
|
+
errorMessage: component['custom_error_message'] ?? '',
|
|
154
|
+
state: component['state'],
|
|
155
|
+
level: component['level'],
|
|
156
|
+
ruleDescription: component['rule_description'] ?? '',
|
|
157
|
+
};
|
|
158
|
+
if (component['field_rql_name'] != null) props.fieldRef = resolveField(component['field_rql_name']);
|
|
159
|
+
return new Validation(customObject, props);
|
|
160
|
+
}
|
|
161
|
+
|
|
115
162
|
/**
|
|
116
163
|
* Returns the stable identifier for this validation rule (e.g. `'gym_session_end_after_start'`).
|
|
117
164
|
*/
|
|
@@ -134,7 +181,7 @@ export class Validation {
|
|
|
134
181
|
*/
|
|
135
182
|
toDict(): Record<string, any> {
|
|
136
183
|
const component: Record<string, any> = {
|
|
137
|
-
type:
|
|
184
|
+
type: Validation.componentType,
|
|
138
185
|
model_rql_name: this._customObjectApiName,
|
|
139
186
|
rule_id: this._ruleId,
|
|
140
187
|
state: this._state,
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.2.0-alpha.
|
|
1
|
+
export const VERSION = '0.2.0-alpha.39'; // 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.39";
|
|
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.39";
|
|
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.39'; // 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.39'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|