@rippling/rippling-sdk 0.2.0-alpha.34 → 0.2.0-alpha.36
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/client.d.mts +6 -0
- package/client.d.mts.map +1 -1
- package/client.d.ts +6 -0
- package/client.d.ts.map +1 -1
- package/client.js +6 -0
- package/client.js.map +1 -1
- package/client.mjs +6 -0
- package/client.mjs.map +1 -1
- package/examples/.keep +4 -0
- package/examples/manifest/dental-practice-management/dental-practice-management.ts +651 -0
- package/examples/manifest/dental-practice-management/manifest.json +1870 -0
- package/examples/manifest/gym-membership-management/gym-membership-management.ts +757 -0
- package/examples/manifest/gym-membership-management/manifest.json +1975 -0
- package/examples/sdui/sdui-crud-todo/rippling-function.ts +367 -0
- package/examples/sdui/sdui-crud-todo/sdui-crud-todo.ts +282 -0
- package/examples/sdui/sdui-showcase/rippling-function.ts +381 -0
- package/examples/sdui/sdui-showcase/sdui-showcase.ts +351 -0
- package/examples/sdui/sdui-tab-multi-view/rippling-function.ts +1061 -0
- package/examples/sdui/sdui-tab-multi-view/sdui-tab-multi-view.ts +924 -0
- package/examples/sdui/vote/rippling-function.ts +330 -0
- package/examples/sdui/vote/vote.ts +298 -0
- package/lib/manifest/app.d.mts +81 -13
- package/lib/manifest/app.d.mts.map +1 -1
- package/lib/manifest/app.d.ts +81 -13
- package/lib/manifest/app.d.ts.map +1 -1
- package/lib/manifest/app.js +37 -16
- package/lib/manifest/app.js.map +1 -1
- package/lib/manifest/app.mjs +37 -16
- package/lib/manifest/app.mjs.map +1 -1
- package/lib/manifest/category.d.mts +63 -7
- package/lib/manifest/category.d.mts.map +1 -1
- package/lib/manifest/category.d.ts +63 -7
- package/lib/manifest/category.d.ts.map +1 -1
- package/lib/manifest/category.js +45 -10
- package/lib/manifest/category.js.map +1 -1
- package/lib/manifest/category.mjs +43 -8
- package/lib/manifest/category.mjs.map +1 -1
- package/lib/manifest/custom-object-field-section.d.mts +56 -6
- package/lib/manifest/custom-object-field-section.d.mts.map +1 -1
- package/lib/manifest/custom-object-field-section.d.ts +56 -6
- package/lib/manifest/custom-object-field-section.d.ts.map +1 -1
- package/lib/manifest/custom-object-field-section.js +41 -14
- package/lib/manifest/custom-object-field-section.js.map +1 -1
- package/lib/manifest/custom-object-field-section.mjs +39 -12
- package/lib/manifest/custom-object-field-section.mjs.map +1 -1
- package/lib/manifest/custom-object-page-layout.d.mts +201 -41
- package/lib/manifest/custom-object-page-layout.d.mts.map +1 -1
- package/lib/manifest/custom-object-page-layout.d.ts +201 -41
- package/lib/manifest/custom-object-page-layout.d.ts.map +1 -1
- package/lib/manifest/custom-object-page-layout.js +76 -30
- package/lib/manifest/custom-object-page-layout.js.map +1 -1
- package/lib/manifest/custom-object-page-layout.mjs +74 -28
- package/lib/manifest/custom-object-page-layout.mjs.map +1 -1
- package/lib/manifest/custom-object.d.mts +128 -15
- package/lib/manifest/custom-object.d.mts.map +1 -1
- package/lib/manifest/custom-object.d.ts +128 -15
- package/lib/manifest/custom-object.d.ts.map +1 -1
- package/lib/manifest/custom-object.js +61 -26
- package/lib/manifest/custom-object.js.map +1 -1
- package/lib/manifest/custom-object.mjs +61 -26
- package/lib/manifest/custom-object.mjs.map +1 -1
- package/lib/manifest/field.d.mts +265 -54
- package/lib/manifest/field.d.mts.map +1 -1
- package/lib/manifest/field.d.ts +265 -54
- package/lib/manifest/field.d.ts.map +1 -1
- package/lib/manifest/field.js +100 -57
- package/lib/manifest/field.js.map +1 -1
- package/lib/manifest/field.mjs +100 -57
- package/lib/manifest/field.mjs.map +1 -1
- package/lib/manifest/list-view.d.mts +105 -14
- package/lib/manifest/list-view.d.mts.map +1 -1
- package/lib/manifest/list-view.d.ts +105 -14
- package/lib/manifest/list-view.d.ts.map +1 -1
- package/lib/manifest/list-view.js +50 -14
- package/lib/manifest/list-view.js.map +1 -1
- package/lib/manifest/list-view.mjs +48 -12
- package/lib/manifest/list-view.mjs.map +1 -1
- package/lib/manifest/manifest-builder.d.mts +77 -11
- package/lib/manifest/manifest-builder.d.mts.map +1 -1
- package/lib/manifest/manifest-builder.d.ts +77 -11
- package/lib/manifest/manifest-builder.d.ts.map +1 -1
- package/lib/manifest/manifest-builder.js +46 -24
- package/lib/manifest/manifest-builder.js.map +1 -1
- package/lib/manifest/manifest-builder.mjs +44 -22
- package/lib/manifest/manifest-builder.mjs.map +1 -1
- package/lib/manifest/manifest-function.d.mts +92 -12
- package/lib/manifest/manifest-function.d.mts.map +1 -1
- package/lib/manifest/manifest-function.d.ts +92 -12
- package/lib/manifest/manifest-function.d.ts.map +1 -1
- package/lib/manifest/manifest-function.js +40 -11
- package/lib/manifest/manifest-function.js.map +1 -1
- package/lib/manifest/manifest-function.mjs +38 -9
- package/lib/manifest/manifest-function.mjs.map +1 -1
- package/lib/manifest/rule.d.mts +94 -16
- package/lib/manifest/rule.d.mts.map +1 -1
- package/lib/manifest/rule.d.ts +94 -16
- package/lib/manifest/rule.d.ts.map +1 -1
- package/lib/manifest/rule.js +36 -15
- package/lib/manifest/rule.js.map +1 -1
- package/lib/manifest/rule.mjs +36 -15
- package/lib/manifest/rule.mjs.map +1 -1
- package/lib/manifest/sdui-page.d.mts +67 -11
- package/lib/manifest/sdui-page.d.mts.map +1 -1
- package/lib/manifest/sdui-page.d.ts +67 -11
- package/lib/manifest/sdui-page.d.ts.map +1 -1
- package/lib/manifest/sdui-page.js +44 -13
- package/lib/manifest/sdui-page.js.map +1 -1
- package/lib/manifest/sdui-page.mjs +42 -11
- package/lib/manifest/sdui-page.mjs.map +1 -1
- package/lib/manifest/validation.d.mts +87 -12
- package/lib/manifest/validation.d.mts.map +1 -1
- package/lib/manifest/validation.d.ts +87 -12
- package/lib/manifest/validation.d.ts.map +1 -1
- package/lib/manifest/validation.js +41 -15
- package/lib/manifest/validation.js.map +1 -1
- package/lib/manifest/validation.mjs +39 -13
- package/lib/manifest/validation.mjs.map +1 -1
- package/lib/sdui/actions.d.mts +25 -0
- package/lib/sdui/actions.d.mts.map +1 -0
- package/lib/sdui/actions.d.ts +25 -0
- package/lib/sdui/actions.d.ts.map +1 -0
- package/lib/sdui/actions.js +53 -0
- package/lib/sdui/actions.js.map +1 -0
- package/lib/sdui/actions.mjs +42 -0
- package/lib/sdui/actions.mjs.map +1 -0
- package/lib/sdui/component.d.mts +41 -0
- package/lib/sdui/component.d.mts.map +1 -0
- package/lib/sdui/component.d.ts +41 -0
- package/lib/sdui/component.d.ts.map +1 -0
- package/lib/sdui/component.js +95 -0
- package/lib/sdui/component.js.map +1 -0
- package/lib/sdui/component.mjs +91 -0
- package/lib/sdui/component.mjs.map +1 -0
- package/lib/sdui/components.d.mts +149 -0
- package/lib/sdui/components.d.mts.map +1 -0
- package/lib/sdui/components.d.ts +149 -0
- package/lib/sdui/components.d.ts.map +1 -0
- package/lib/sdui/components.js +303 -0
- package/lib/sdui/components.js.map +1 -0
- package/lib/sdui/components.mjs +298 -0
- package/lib/sdui/components.mjs.map +1 -0
- package/lib/sdui/conditions.d.mts +25 -0
- package/lib/sdui/conditions.d.mts.map +1 -0
- package/lib/sdui/conditions.d.ts +25 -0
- package/lib/sdui/conditions.d.ts.map +1 -0
- package/lib/sdui/conditions.js +47 -0
- package/lib/sdui/conditions.js.map +1 -0
- package/lib/sdui/conditions.mjs +35 -0
- package/lib/sdui/conditions.mjs.map +1 -0
- package/lib/sdui/directives.d.mts +18 -0
- package/lib/sdui/directives.d.mts.map +1 -0
- package/lib/sdui/directives.d.ts +18 -0
- package/lib/sdui/directives.d.ts.map +1 -0
- package/lib/sdui/directives.js +28 -0
- package/lib/sdui/directives.js.map +1 -0
- package/lib/sdui/directives.mjs +21 -0
- package/lib/sdui/directives.mjs.map +1 -0
- package/lib/sdui/index.d.mts +362 -0
- package/lib/sdui/index.d.mts.map +1 -0
- package/lib/sdui/index.d.ts +362 -0
- package/lib/sdui/index.d.ts.map +1 -0
- package/lib/sdui/index.js +375 -0
- package/lib/sdui/index.js.map +1 -0
- package/lib/sdui/index.mjs +199 -0
- package/lib/sdui/index.mjs.map +1 -0
- package/lib/sdui/props.d.mts +12 -0
- package/lib/sdui/props.d.mts.map +1 -0
- package/lib/sdui/props.d.ts +12 -0
- package/lib/sdui/props.d.ts.map +1 -0
- package/lib/sdui/props.js +25 -0
- package/lib/sdui/props.js.map +1 -0
- package/lib/sdui/props.mjs +21 -0
- package/lib/sdui/props.mjs.map +1 -0
- package/lib/sdui/render.d.mts +23 -0
- package/lib/sdui/render.d.mts.map +1 -0
- package/lib/sdui/render.d.ts +23 -0
- package/lib/sdui/render.d.ts.map +1 -0
- package/lib/sdui/render.js +40 -0
- package/lib/sdui/render.js.map +1 -0
- package/lib/sdui/render.mjs +37 -0
- package/lib/sdui/render.mjs.map +1 -0
- package/lib/sdui/state.d.mts +22 -0
- package/lib/sdui/state.d.mts.map +1 -0
- package/lib/sdui/state.d.ts +22 -0
- package/lib/sdui/state.d.ts.map +1 -0
- package/lib/sdui/state.js +57 -0
- package/lib/sdui/state.js.map +1 -0
- package/lib/sdui/state.mjs +53 -0
- package/lib/sdui/state.mjs.map +1 -0
- package/package.json +11 -1
- package/resources/company-legal-entity-workers.d.mts +79 -0
- package/resources/company-legal-entity-workers.d.mts.map +1 -0
- package/resources/company-legal-entity-workers.d.ts +79 -0
- package/resources/company-legal-entity-workers.d.ts.map +1 -0
- package/resources/company-legal-entity-workers.js +30 -0
- package/resources/company-legal-entity-workers.js.map +1 -0
- package/resources/company-legal-entity-workers.mjs +26 -0
- package/resources/company-legal-entity-workers.mjs.map +1 -0
- package/resources/draft-hires.d.mts +4 -0
- package/resources/draft-hires.d.mts.map +1 -1
- package/resources/draft-hires.d.ts +4 -0
- package/resources/draft-hires.d.ts.map +1 -1
- package/resources/files.d.mts +16 -1
- package/resources/files.d.mts.map +1 -1
- package/resources/files.d.ts +16 -1
- package/resources/files.d.ts.map +1 -1
- package/resources/headcount-positions.d.mts +2 -2
- package/resources/headcount-positions.d.mts.map +1 -1
- package/resources/headcount-positions.d.ts +2 -2
- package/resources/headcount-positions.d.ts.map +1 -1
- package/resources/index.d.mts +1 -0
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +4 -2
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -0
- package/resources/index.mjs.map +1 -1
- package/resources/legal-entities.d.mts +1 -1
- package/resources/legal-entities.d.mts.map +1 -1
- package/resources/legal-entities.d.ts +1 -1
- package/resources/legal-entities.d.ts.map +1 -1
- package/resources/location-factors.d.mts +2 -2
- package/resources/location-factors.d.mts.map +1 -1
- package/resources/location-factors.d.ts +2 -2
- package/resources/location-factors.d.ts.map +1 -1
- package/resources/shared.d.mts +1 -1
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +1 -1
- package/resources/shared.d.ts.map +1 -1
- package/resources/workers.d.mts +2 -2
- package/resources/workers.d.mts.map +1 -1
- package/resources/workers.d.ts +2 -2
- package/resources/workers.d.ts.map +1 -1
- package/src/client.ts +20 -0
- package/src/lib/manifest/app.ts +81 -26
- package/src/lib/manifest/category.ts +63 -14
- package/src/lib/manifest/custom-object-field-section.ts +56 -17
- package/src/lib/manifest/custom-object-page-layout.ts +201 -66
- package/src/lib/manifest/custom-object.ts +128 -37
- package/src/lib/manifest/field.ts +265 -75
- package/src/lib/manifest/list-view.ts +105 -25
- package/src/lib/manifest/manifest-builder.ts +75 -32
- package/src/lib/manifest/manifest-function.ts +92 -22
- package/src/lib/manifest/rule.ts +95 -29
- package/src/lib/manifest/sdui-page.ts +67 -21
- package/src/lib/manifest/validation.ts +87 -24
- package/src/lib/sdui/actions.ts +58 -0
- package/src/lib/sdui/component.ts +122 -0
- package/src/lib/sdui/components.ts +308 -0
- package/src/lib/sdui/conditions.ts +59 -0
- package/src/lib/sdui/directives.ts +42 -0
- package/src/lib/sdui/index.ts +365 -0
- package/src/lib/sdui/props.ts +32 -0
- package/src/lib/sdui/render.ts +58 -0
- package/src/lib/sdui/state.ts +60 -0
- package/src/resources/company-legal-entity-workers.ts +115 -0
- package/src/resources/draft-hires.ts +5 -0
- package/src/resources/files.ts +18 -1
- package/src/resources/headcount-positions.ts +2 -0
- package/src/resources/index.ts +7 -0
- package/src/resources/legal-entities.ts +1 -0
- package/src/resources/location-factors.ts +2 -0
- package/src/resources/shared.ts +1 -0
- package/src/resources/workers.ts +2 -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,27 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
1
|
+
/**
|
|
2
|
+
* Root container for a manifest — collects all components and serializes them to JSON.
|
|
3
3
|
*
|
|
4
|
-
* ManifestBuilder
|
|
4
|
+
* You would normally create one `ManifestBuilder` at the top of your manifest file,
|
|
5
|
+
* then pass it as the scope to all top-level components (categories, custom objects,
|
|
6
|
+
* functions, apps, SDUI pages). Each component auto-registers on construction; there
|
|
7
|
+
* is no separate add or register call.
|
|
5
8
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* constructor arg. The scope is either a `ManifestBuilder` (root) or a
|
|
9
|
-
* `CustomObject` / `CustomObjectFieldSection` for nested children.
|
|
10
|
-
* - Constructing a component auto-registers it with the builder via the
|
|
11
|
-
* scope's `_register` hook. There is no public `addComponent` — the
|
|
12
|
-
* only way a component enters the manifest is by being constructed
|
|
13
|
-
* with a scope that forwards up to this builder.
|
|
14
|
-
* - The builder does not walk into components; each component emits the
|
|
15
|
-
* foreign-key fields (`custom_object_api_name`, `model_rql_name`, ...)
|
|
16
|
-
* itself in `toDict()`.
|
|
9
|
+
* After defining all components, call `preview()` to emit the manifest as a
|
|
10
|
+
* pretty-printed JSON string, or `buildManifest()` to get the plain object.
|
|
17
11
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const manifest = new ManifestBuilder({
|
|
15
|
+
* key: 'gym_membership_management',
|
|
16
|
+
* name: 'Gym Membership Management',
|
|
17
|
+
* description: 'Members, trainers, schedules, and check-in',
|
|
18
|
+
* });
|
|
19
|
+
*
|
|
20
|
+
* const category = new Category(manifest, { apiName: 'gym__c', name: 'Gym' });
|
|
21
|
+
* const memberObj = new CustomObject(manifest, { apiName: 'gym_member__c', name: 'Member', category });
|
|
22
|
+
* // ... define fields, rules, list views, etc. ...
|
|
23
|
+
*
|
|
24
|
+
* console.log(manifest.preview());
|
|
25
|
+
* ```
|
|
22
26
|
*/
|
|
23
27
|
export class ManifestBuilder {
|
|
24
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* @param props - Initialization properties.
|
|
30
|
+
* @throws {Error} If `props.key` is empty or missing.
|
|
31
|
+
*/
|
|
25
32
|
constructor(props) {
|
|
26
33
|
this._components = [];
|
|
27
34
|
if (!props.key) {
|
|
@@ -41,7 +48,11 @@ export class ManifestBuilder {
|
|
|
41
48
|
}
|
|
42
49
|
this._components.push(component);
|
|
43
50
|
}
|
|
44
|
-
/**
|
|
51
|
+
/**
|
|
52
|
+
* Returns the manifest as a plain object with `metadata` and a flat `components` array.
|
|
53
|
+
*
|
|
54
|
+
* @returns `{ metadata: { key, name, description? }, components: Record<string, any>[] }`
|
|
55
|
+
*/
|
|
45
56
|
buildManifest() {
|
|
46
57
|
const metadata = {
|
|
47
58
|
key: this.key,
|
|
@@ -53,11 +64,22 @@ export class ManifestBuilder {
|
|
|
53
64
|
const components = this._components.map((c) => c.toDict());
|
|
54
65
|
return { metadata, components };
|
|
55
66
|
}
|
|
56
|
-
/**
|
|
67
|
+
/**
|
|
68
|
+
* Returns the flat list of all registered component dicts.
|
|
69
|
+
*
|
|
70
|
+
* @returns An array of wire-format component objects, in registration order.
|
|
71
|
+
*/
|
|
57
72
|
componentsList() {
|
|
58
73
|
return this._components.map((c) => c.toDict());
|
|
59
74
|
}
|
|
60
|
-
/**
|
|
75
|
+
/**
|
|
76
|
+
* Returns the full manifest as a pretty-printed JSON string.
|
|
77
|
+
*
|
|
78
|
+
* Typically used as the final line of a manifest file to emit the output:
|
|
79
|
+
* `console.log(manifest.preview())`.
|
|
80
|
+
*
|
|
81
|
+
* @returns Indented JSON string of the complete manifest.
|
|
82
|
+
*/
|
|
61
83
|
preview() {
|
|
62
84
|
return JSON.stringify(this.buildManifest(), null, 2);
|
|
63
85
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest-builder.mjs","sourceRoot":"","sources":["../../src/lib/manifest/manifest-builder.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"manifest-builder.mjs","sourceRoot":"","sources":["../../src/lib/manifest/manifest-builder.ts"],"names":[],"mappings":"AA8CA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,OAAO,eAAe;IAM1B;;;OAGG;IACH,YAAY,KAA2B;QANtB,gBAAW,GAAwB,EAAE,CAAC;QAOrD,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;QACrC,CAAC;QACD,IAAI,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,GAAG,CAAC;QACpC,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC,WAAW,IAAI,EAAE,CAAC;IAC7C,CAAC;IAED;;;OAGG;IACH,SAAS,CAAC,SAA4B;QACpC,IAAI,OAAO,SAAS,CAAC,MAAM,KAAK,UAAU,EAAE,CAAC;YAC3C,MAAM,IAAI,SAAS,CAAC,uCAAuC,CAAC,CAAC;QAC/D,CAAC;QACD,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACnC,CAAC;IAED;;;;OAIG;IACH,aAAa;QACX,MAAM,QAAQ,GAAwB;YACpC,GAAG,EAAE,IAAI,CAAC,GAAG;YACb,IAAI,EAAE,IAAI,CAAC,IAAI;SAChB,CAAC;QACF,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YACrB,QAAQ,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC;QAC7C,CAAC;QACD,MAAM,UAAU,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;QAC3D,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC;IAClC,CAAC;IAED;;;;OAIG;IACH,cAAc;QACZ,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;IACjD,CAAC;IAED;;;;;;;OAOG;IACH,OAAO;QACL,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IACvD,CAAC;CACF"}
|
|
@@ -1,25 +1,96 @@
|
|
|
1
1
|
import type { FunctionRuntime } from "./_helpers.mjs";
|
|
2
2
|
import type { ManifestScope } from "./manifest-builder.mjs";
|
|
3
|
+
/**
|
|
4
|
+
* Initialization properties for {@link ManifestFunction}.
|
|
5
|
+
*/
|
|
3
6
|
export interface ManifestFunctionProps {
|
|
4
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* Unique identifier for this function (e.g. `'gym_today_schedule_fn'`).
|
|
9
|
+
*
|
|
10
|
+
* Required.
|
|
11
|
+
*/
|
|
5
12
|
apiName: string;
|
|
6
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* Display name shown in the Rippling UI.
|
|
15
|
+
*
|
|
16
|
+
* Required.
|
|
17
|
+
*/
|
|
7
18
|
name: string;
|
|
8
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* TypeScript handler source code. Must export an `onRipplingEvent` function.
|
|
21
|
+
*
|
|
22
|
+
* Optional. @default `''`
|
|
23
|
+
*/
|
|
9
24
|
code?: string;
|
|
10
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* Human-readable description of what this function does.
|
|
27
|
+
*
|
|
28
|
+
* Optional. @default `''`
|
|
29
|
+
*/
|
|
11
30
|
description?: string;
|
|
12
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
* NPM package dependencies as a `{ packageName: versionRange }` map
|
|
33
|
+
* (e.g. `{ '@rippling/rippling-sdk': '^0.2.0' }`).
|
|
34
|
+
*
|
|
35
|
+
* Optional. @default null
|
|
36
|
+
*/
|
|
13
37
|
dependencies?: Record<string, string>;
|
|
14
|
-
/**
|
|
38
|
+
/**
|
|
39
|
+
* Raw deployment options object. Prefer `runtime` for the common case.
|
|
40
|
+
*
|
|
41
|
+
* Optional. @default null
|
|
42
|
+
*/
|
|
15
43
|
deploymentOptions?: Record<string, any>;
|
|
16
|
-
/**
|
|
44
|
+
/**
|
|
45
|
+
* Deployment runtime shorthand. Sets `deploymentOptions.runtime` and is merged
|
|
46
|
+
* with any explicit `deploymentOptions`. One of `'cloudflare-js'` | `'lambda-deno'`
|
|
47
|
+
* | `'lambda-python'`.
|
|
48
|
+
*
|
|
49
|
+
* Optional.
|
|
50
|
+
*/
|
|
17
51
|
runtime?: FunctionRuntime;
|
|
18
|
-
/**
|
|
52
|
+
/**
|
|
53
|
+
* Outbound domain allowlist. Requests to domains not in this list will be blocked.
|
|
54
|
+
*
|
|
55
|
+
* Optional. @default null
|
|
56
|
+
*/
|
|
19
57
|
allowedDomains?: string[];
|
|
20
|
-
/**
|
|
58
|
+
/**
|
|
59
|
+
* Whether this function runs asynchronously (fire-and-forget).
|
|
60
|
+
*
|
|
61
|
+
* Optional. @default `false`
|
|
62
|
+
*/
|
|
21
63
|
isAsync?: boolean;
|
|
22
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* Defines a serverless function and registers it with the manifest.
|
|
67
|
+
*
|
|
68
|
+
* A `ManifestFunction` packages TypeScript handler code that runs on Rippling's
|
|
69
|
+
* serverless infrastructure. Functions are the backing implementation for
|
|
70
|
+
* {@link SduiPage} surfaces. The handler must export `onRipplingEvent`.
|
|
71
|
+
*
|
|
72
|
+
* This class is named `ManifestFunction` to avoid collision with the JavaScript
|
|
73
|
+
* built-in `Function`. It is also re-exported as `Function` from the barrel for
|
|
74
|
+
* convenience.
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```ts
|
|
78
|
+
* const todayScheduleFn = new ManifestFunction(manifest, {
|
|
79
|
+
* apiName: 'gym_today_schedule_fn',
|
|
80
|
+
* name: 'Today\'s schedule (SDUI)',
|
|
81
|
+
* description: 'Searchable grid of class sessions',
|
|
82
|
+
* runtime: 'lambda-deno',
|
|
83
|
+
* code: handlerSource,
|
|
84
|
+
* dependencies: {
|
|
85
|
+
* '@rippling/rippling-sdk': '^0.2.0-alpha.33',
|
|
86
|
+
* '@rippling/sdui-builder': '^0.1.0',
|
|
87
|
+
* },
|
|
88
|
+
* isAsync: false,
|
|
89
|
+
* });
|
|
90
|
+
* ```
|
|
91
|
+
*
|
|
92
|
+
* @see {@link SduiPage} — wraps a `ManifestFunction` as a navigable UI surface.
|
|
93
|
+
*/
|
|
23
94
|
export declare class ManifestFunction {
|
|
24
95
|
private readonly _apiName;
|
|
25
96
|
private readonly _name;
|
|
@@ -29,11 +100,20 @@ export declare class ManifestFunction {
|
|
|
29
100
|
private readonly _deploymentOptions;
|
|
30
101
|
private readonly _allowedDomains;
|
|
31
102
|
private readonly _isAsync;
|
|
32
|
-
/**
|
|
103
|
+
/**
|
|
104
|
+
* @param scope - The manifest to register this function with.
|
|
105
|
+
* @param props - Initialization properties.
|
|
106
|
+
*/
|
|
33
107
|
constructor(scope: ManifestScope, props: ManifestFunctionProps);
|
|
34
|
-
/**
|
|
108
|
+
/**
|
|
109
|
+
* Returns the api_name of this function (e.g. `'gym_today_schedule_fn'`).
|
|
110
|
+
*/
|
|
35
111
|
getApiName(): string;
|
|
36
|
-
/**
|
|
112
|
+
/**
|
|
113
|
+
* Serializes this function to the wire format consumed by the manifest install endpoint.
|
|
114
|
+
*
|
|
115
|
+
* @returns A plain object with `type: 'FUNCTION'`. Empty or unset optional fields are omitted.
|
|
116
|
+
*/
|
|
37
117
|
toDict(): Record<string, any>;
|
|
38
118
|
}
|
|
39
119
|
//# sourceMappingURL=manifest-function.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest-function.d.mts","sourceRoot":"","sources":["../../src/lib/manifest/manifest-function.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"manifest-function.d.mts","sourceRoot":"","sources":["../../src/lib/manifest/manifest-function.ts"],"names":[],"mappings":"OAAO,KAAK,EAAE,eAAe,EAAE;OACxB,KAAK,EAAE,aAAa,EAAE;AAE7B;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACxC;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;IAC/B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;IAC/B,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAS;IACtC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAqC;IACnE,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAkC;IACrE,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAuB;IACvD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAU;IAEnC;;;OAGG;gBACS,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,qBAAqB;IAe9D;;OAEG;IACH,UAAU,IAAI,MAAM;IAIpB;;;;OAIG;IACH,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAc9B"}
|
|
@@ -1,25 +1,96 @@
|
|
|
1
1
|
import type { FunctionRuntime } from "./_helpers.js";
|
|
2
2
|
import type { ManifestScope } from "./manifest-builder.js";
|
|
3
|
+
/**
|
|
4
|
+
* Initialization properties for {@link ManifestFunction}.
|
|
5
|
+
*/
|
|
3
6
|
export interface ManifestFunctionProps {
|
|
4
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* Unique identifier for this function (e.g. `'gym_today_schedule_fn'`).
|
|
9
|
+
*
|
|
10
|
+
* Required.
|
|
11
|
+
*/
|
|
5
12
|
apiName: string;
|
|
6
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* Display name shown in the Rippling UI.
|
|
15
|
+
*
|
|
16
|
+
* Required.
|
|
17
|
+
*/
|
|
7
18
|
name: string;
|
|
8
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* TypeScript handler source code. Must export an `onRipplingEvent` function.
|
|
21
|
+
*
|
|
22
|
+
* Optional. @default `''`
|
|
23
|
+
*/
|
|
9
24
|
code?: string;
|
|
10
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* Human-readable description of what this function does.
|
|
27
|
+
*
|
|
28
|
+
* Optional. @default `''`
|
|
29
|
+
*/
|
|
11
30
|
description?: string;
|
|
12
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
* NPM package dependencies as a `{ packageName: versionRange }` map
|
|
33
|
+
* (e.g. `{ '@rippling/rippling-sdk': '^0.2.0' }`).
|
|
34
|
+
*
|
|
35
|
+
* Optional. @default null
|
|
36
|
+
*/
|
|
13
37
|
dependencies?: Record<string, string>;
|
|
14
|
-
/**
|
|
38
|
+
/**
|
|
39
|
+
* Raw deployment options object. Prefer `runtime` for the common case.
|
|
40
|
+
*
|
|
41
|
+
* Optional. @default null
|
|
42
|
+
*/
|
|
15
43
|
deploymentOptions?: Record<string, any>;
|
|
16
|
-
/**
|
|
44
|
+
/**
|
|
45
|
+
* Deployment runtime shorthand. Sets `deploymentOptions.runtime` and is merged
|
|
46
|
+
* with any explicit `deploymentOptions`. One of `'cloudflare-js'` | `'lambda-deno'`
|
|
47
|
+
* | `'lambda-python'`.
|
|
48
|
+
*
|
|
49
|
+
* Optional.
|
|
50
|
+
*/
|
|
17
51
|
runtime?: FunctionRuntime;
|
|
18
|
-
/**
|
|
52
|
+
/**
|
|
53
|
+
* Outbound domain allowlist. Requests to domains not in this list will be blocked.
|
|
54
|
+
*
|
|
55
|
+
* Optional. @default null
|
|
56
|
+
*/
|
|
19
57
|
allowedDomains?: string[];
|
|
20
|
-
/**
|
|
58
|
+
/**
|
|
59
|
+
* Whether this function runs asynchronously (fire-and-forget).
|
|
60
|
+
*
|
|
61
|
+
* Optional. @default `false`
|
|
62
|
+
*/
|
|
21
63
|
isAsync?: boolean;
|
|
22
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* Defines a serverless function and registers it with the manifest.
|
|
67
|
+
*
|
|
68
|
+
* A `ManifestFunction` packages TypeScript handler code that runs on Rippling's
|
|
69
|
+
* serverless infrastructure. Functions are the backing implementation for
|
|
70
|
+
* {@link SduiPage} surfaces. The handler must export `onRipplingEvent`.
|
|
71
|
+
*
|
|
72
|
+
* This class is named `ManifestFunction` to avoid collision with the JavaScript
|
|
73
|
+
* built-in `Function`. It is also re-exported as `Function` from the barrel for
|
|
74
|
+
* convenience.
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```ts
|
|
78
|
+
* const todayScheduleFn = new ManifestFunction(manifest, {
|
|
79
|
+
* apiName: 'gym_today_schedule_fn',
|
|
80
|
+
* name: 'Today\'s schedule (SDUI)',
|
|
81
|
+
* description: 'Searchable grid of class sessions',
|
|
82
|
+
* runtime: 'lambda-deno',
|
|
83
|
+
* code: handlerSource,
|
|
84
|
+
* dependencies: {
|
|
85
|
+
* '@rippling/rippling-sdk': '^0.2.0-alpha.33',
|
|
86
|
+
* '@rippling/sdui-builder': '^0.1.0',
|
|
87
|
+
* },
|
|
88
|
+
* isAsync: false,
|
|
89
|
+
* });
|
|
90
|
+
* ```
|
|
91
|
+
*
|
|
92
|
+
* @see {@link SduiPage} — wraps a `ManifestFunction` as a navigable UI surface.
|
|
93
|
+
*/
|
|
23
94
|
export declare class ManifestFunction {
|
|
24
95
|
private readonly _apiName;
|
|
25
96
|
private readonly _name;
|
|
@@ -29,11 +100,20 @@ export declare class ManifestFunction {
|
|
|
29
100
|
private readonly _deploymentOptions;
|
|
30
101
|
private readonly _allowedDomains;
|
|
31
102
|
private readonly _isAsync;
|
|
32
|
-
/**
|
|
103
|
+
/**
|
|
104
|
+
* @param scope - The manifest to register this function with.
|
|
105
|
+
* @param props - Initialization properties.
|
|
106
|
+
*/
|
|
33
107
|
constructor(scope: ManifestScope, props: ManifestFunctionProps);
|
|
34
|
-
/**
|
|
108
|
+
/**
|
|
109
|
+
* Returns the api_name of this function (e.g. `'gym_today_schedule_fn'`).
|
|
110
|
+
*/
|
|
35
111
|
getApiName(): string;
|
|
36
|
-
/**
|
|
112
|
+
/**
|
|
113
|
+
* Serializes this function to the wire format consumed by the manifest install endpoint.
|
|
114
|
+
*
|
|
115
|
+
* @returns A plain object with `type: 'FUNCTION'`. Empty or unset optional fields are omitted.
|
|
116
|
+
*/
|
|
37
117
|
toDict(): Record<string, any>;
|
|
38
118
|
}
|
|
39
119
|
//# sourceMappingURL=manifest-function.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest-function.d.ts","sourceRoot":"","sources":["../../src/lib/manifest/manifest-function.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"manifest-function.d.ts","sourceRoot":"","sources":["../../src/lib/manifest/manifest-function.ts"],"names":[],"mappings":"OAAO,KAAK,EAAE,eAAe,EAAE;OACxB,KAAK,EAAE,aAAa,EAAE;AAE7B;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACxC;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;IAC/B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;IAC/B,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAS;IACtC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAqC;IACnE,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAkC;IACrE,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAuB;IACvD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAU;IAEnC;;;OAGG;gBACS,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,qBAAqB;IAe9D;;OAEG;IACH,UAAU,IAAI,MAAM;IAIpB;;;;OAIG;IACH,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAc9B"}
|
|
@@ -1,17 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ManifestFunction = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Defines a serverless function and registers it with the manifest.
|
|
6
|
+
*
|
|
7
|
+
* A `ManifestFunction` packages TypeScript handler code that runs on Rippling's
|
|
8
|
+
* serverless infrastructure. Functions are the backing implementation for
|
|
9
|
+
* {@link SduiPage} surfaces. The handler must export `onRipplingEvent`.
|
|
4
10
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
11
|
+
* This class is named `ManifestFunction` to avoid collision with the JavaScript
|
|
12
|
+
* built-in `Function`. It is also re-exported as `Function` from the barrel for
|
|
13
|
+
* convenience.
|
|
7
14
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* const todayScheduleFn = new ManifestFunction(manifest, {
|
|
18
|
+
* apiName: 'gym_today_schedule_fn',
|
|
19
|
+
* name: 'Today\'s schedule (SDUI)',
|
|
20
|
+
* description: 'Searchable grid of class sessions',
|
|
21
|
+
* runtime: 'lambda-deno',
|
|
22
|
+
* code: handlerSource,
|
|
23
|
+
* dependencies: {
|
|
24
|
+
* '@rippling/rippling-sdk': '^0.2.0-alpha.33',
|
|
25
|
+
* '@rippling/sdui-builder': '^0.1.0',
|
|
26
|
+
* },
|
|
27
|
+
* isAsync: false,
|
|
28
|
+
* });
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* @see {@link SduiPage} — wraps a `ManifestFunction` as a navigable UI surface.
|
|
10
32
|
*/
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.ManifestFunction = void 0;
|
|
13
33
|
class ManifestFunction {
|
|
14
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* @param scope - The manifest to register this function with.
|
|
36
|
+
* @param props - Initialization properties.
|
|
37
|
+
*/
|
|
15
38
|
constructor(scope, props) {
|
|
16
39
|
this._apiName = props.apiName;
|
|
17
40
|
this._name = props.name;
|
|
@@ -26,11 +49,17 @@ class ManifestFunction {
|
|
|
26
49
|
this._isAsync = props.isAsync ?? false;
|
|
27
50
|
scope._register(this);
|
|
28
51
|
}
|
|
29
|
-
/**
|
|
52
|
+
/**
|
|
53
|
+
* Returns the api_name of this function (e.g. `'gym_today_schedule_fn'`).
|
|
54
|
+
*/
|
|
30
55
|
getApiName() {
|
|
31
56
|
return this._apiName;
|
|
32
57
|
}
|
|
33
|
-
/**
|
|
58
|
+
/**
|
|
59
|
+
* Serializes this function to the wire format consumed by the manifest install endpoint.
|
|
60
|
+
*
|
|
61
|
+
* @returns A plain object with `type: 'FUNCTION'`. Empty or unset optional fields are omitted.
|
|
62
|
+
*/
|
|
34
63
|
toDict() {
|
|
35
64
|
const component = {
|
|
36
65
|
type: 'FUNCTION',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest-function.js","sourceRoot":"","sources":["../../src/lib/manifest/manifest-function.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"manifest-function.js","sourceRoot":"","sources":["../../src/lib/manifest/manifest-function.ts"],"names":[],"mappings":";;;AAkEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAa,gBAAgB;IAU3B;;;OAGG;IACH,YAAY,KAAoB,EAAE,KAA4B;QAC5D,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC;QAC9B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC;QACxB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC;QAC9B,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC,WAAW,IAAI,EAAE,CAAC;QAC5C,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC,YAAY,CAAC;QACxC,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC,iBAAiB,CAAC;QAClD,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;YAClB,IAAI,CAAC,kBAAkB,GAAG,EAAE,GAAG,CAAC,IAAI,CAAC,kBAAkB,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;QAC3F,CAAC;QACD,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC,cAAc,CAAC;QAC5C,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC;QACvC,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IACxB,CAAC;IAED;;OAEG;IACH,UAAU;QACR,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED;;;;OAIG;IACH,MAAM;QACJ,MAAM,SAAS,GAAwB;YACrC,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,IAAI,CAAC,KAAK;YAChB,QAAQ,EAAE,IAAI,CAAC,QAAQ;SACxB,CAAC;QACF,IAAI,IAAI,CAAC,YAAY;YAAE,SAAS,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC;QACpE,IAAI,IAAI,CAAC,KAAK;YAAE,SAAS,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC;QACrD,IAAI,IAAI,CAAC,aAAa,IAAI,IAAI;YAAE,SAAS,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC;QAC/E,IAAI,IAAI,CAAC,kBAAkB,IAAI,IAAI;YAAE,SAAS,CAAC,oBAAoB,CAAC,GAAG,IAAI,CAAC,kBAAkB,CAAC;QAC/F,IAAI,IAAI,CAAC,eAAe,IAAI,IAAI;YAAE,SAAS,CAAC,iBAAiB,CAAC,GAAG,IAAI,CAAC,eAAe,CAAC;QACtF,IAAI,IAAI,CAAC,QAAQ;YAAE,SAAS,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC;QAChD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AAvDD,4CAuDC"}
|
|
@@ -1,14 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
1
|
+
/**
|
|
2
|
+
* Defines a serverless function and registers it with the manifest.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* A `ManifestFunction` packages TypeScript handler code that runs on Rippling's
|
|
5
|
+
* serverless infrastructure. Functions are the backing implementation for
|
|
6
|
+
* {@link SduiPage} surfaces. The handler must export `onRipplingEvent`.
|
|
6
7
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
8
|
+
* This class is named `ManifestFunction` to avoid collision with the JavaScript
|
|
9
|
+
* built-in `Function`. It is also re-exported as `Function` from the barrel for
|
|
10
|
+
* convenience.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const todayScheduleFn = new ManifestFunction(manifest, {
|
|
15
|
+
* apiName: 'gym_today_schedule_fn',
|
|
16
|
+
* name: 'Today\'s schedule (SDUI)',
|
|
17
|
+
* description: 'Searchable grid of class sessions',
|
|
18
|
+
* runtime: 'lambda-deno',
|
|
19
|
+
* code: handlerSource,
|
|
20
|
+
* dependencies: {
|
|
21
|
+
* '@rippling/rippling-sdk': '^0.2.0-alpha.33',
|
|
22
|
+
* '@rippling/sdui-builder': '^0.1.0',
|
|
23
|
+
* },
|
|
24
|
+
* isAsync: false,
|
|
25
|
+
* });
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* @see {@link SduiPage} — wraps a `ManifestFunction` as a navigable UI surface.
|
|
9
29
|
*/
|
|
10
30
|
export class ManifestFunction {
|
|
11
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
* @param scope - The manifest to register this function with.
|
|
33
|
+
* @param props - Initialization properties.
|
|
34
|
+
*/
|
|
12
35
|
constructor(scope, props) {
|
|
13
36
|
this._apiName = props.apiName;
|
|
14
37
|
this._name = props.name;
|
|
@@ -23,11 +46,17 @@ export class ManifestFunction {
|
|
|
23
46
|
this._isAsync = props.isAsync ?? false;
|
|
24
47
|
scope._register(this);
|
|
25
48
|
}
|
|
26
|
-
/**
|
|
49
|
+
/**
|
|
50
|
+
* Returns the api_name of this function (e.g. `'gym_today_schedule_fn'`).
|
|
51
|
+
*/
|
|
27
52
|
getApiName() {
|
|
28
53
|
return this._apiName;
|
|
29
54
|
}
|
|
30
|
-
/**
|
|
55
|
+
/**
|
|
56
|
+
* Serializes this function to the wire format consumed by the manifest install endpoint.
|
|
57
|
+
*
|
|
58
|
+
* @returns A plain object with `type: 'FUNCTION'`. Empty or unset optional fields are omitted.
|
|
59
|
+
*/
|
|
31
60
|
toDict() {
|
|
32
61
|
const component = {
|
|
33
62
|
type: 'FUNCTION',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest-function.mjs","sourceRoot":"","sources":["../../src/lib/manifest/manifest-function.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"manifest-function.mjs","sourceRoot":"","sources":["../../src/lib/manifest/manifest-function.ts"],"names":[],"mappings":"AAkEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,OAAO,gBAAgB;IAU3B;;;OAGG;IACH,YAAY,KAAoB,EAAE,KAA4B;QAC5D,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC;QAC9B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC;QACxB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC;QAC9B,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC,WAAW,IAAI,EAAE,CAAC;QAC5C,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC,YAAY,CAAC;QACxC,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC,iBAAiB,CAAC;QAClD,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;YAClB,IAAI,CAAC,kBAAkB,GAAG,EAAE,GAAG,CAAC,IAAI,CAAC,kBAAkB,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;QAC3F,CAAC;QACD,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC,cAAc,CAAC;QAC5C,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC;QACvC,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IACxB,CAAC;IAED;;OAEG;IACH,UAAU;QACR,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED;;;;OAIG;IACH,MAAM;QACJ,MAAM,SAAS,GAAwB;YACrC,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,IAAI,CAAC,KAAK;YAChB,QAAQ,EAAE,IAAI,CAAC,QAAQ;SACxB,CAAC;QACF,IAAI,IAAI,CAAC,YAAY;YAAE,SAAS,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC;QACpE,IAAI,IAAI,CAAC,KAAK;YAAE,SAAS,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC;QACrD,IAAI,IAAI,CAAC,aAAa,IAAI,IAAI;YAAE,SAAS,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC;QAC/E,IAAI,IAAI,CAAC,kBAAkB,IAAI,IAAI;YAAE,SAAS,CAAC,oBAAoB,CAAC,GAAG,IAAI,CAAC,kBAAkB,CAAC;QAC/F,IAAI,IAAI,CAAC,eAAe,IAAI,IAAI;YAAE,SAAS,CAAC,iBAAiB,CAAC,GAAG,IAAI,CAAC,eAAe,CAAC;QACtF,IAAI,IAAI,CAAC,QAAQ;YAAE,SAAS,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC;QAChD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF"}
|