@rippling/rippling-sdk 0.2.0-alpha.59 → 0.2.0-alpha.61
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 +10 -10
- package/examples/manifest/dental-practice-management/functions/chair-schedule.ts +7 -10
- package/examples/manifest/dental-practice-management/functions/operatory-list.ts +7 -10
- package/examples/manifest/dental-practice-management/functions/patient-list.ts +7 -10
- package/examples/manifest/dental-practice-management/functions/treatment-plan-list.ts +7 -10
- package/examples/manifest/gym-membership-management/functions/check-in-desk.ts +7 -10
- package/examples/manifest/gym-membership-management/functions/member-list.ts +7 -10
- package/examples/manifest/gym-membership-management/functions/today-schedule.ts +7 -10
- package/examples/manifest/gym-membership-management/functions/trainer-list.ts +7 -10
- package/examples/manifest/gym-membership-management/gym-membership-management.ts +10 -10
- package/examples/manifest/simple-todo-app/functions/todo-list.ts +7 -10
- package/examples/manifest/simple-todo-app/simple-todo-app.ts +3 -5
- package/internal/tslib.js +0 -4
- 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/manifest-function.d.mts +10 -7
- package/lib/manifest/manifest-function.d.mts.map +1 -1
- package/lib/manifest/manifest-function.d.ts +10 -7
- package/lib/manifest/manifest-function.d.ts.map +1 -1
- package/lib/manifest/manifest-function.js +14 -10
- package/lib/manifest/manifest-function.js.map +1 -1
- package/lib/manifest/manifest-function.mjs +13 -10
- package/lib/manifest/manifest-function.mjs.map +1 -1
- package/package.json +1 -1
- package/src/lib/manifest/index.ts +1 -0
- package/src/lib/manifest/manifest-function.ts +21 -11
- 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/examples/sdui/sdui-crud-todo/rippling-function.ts +0 -358
- package/examples/sdui/sdui-showcase/rippling-function.ts +0 -366
- package/examples/sdui/sdui-tab-multi-view/rippling-function.ts +0 -1042
- package/examples/sdui/vote/rippling-function.ts +0 -315
- package/lib/sdui/actions.d.mts +0 -25
- package/lib/sdui/actions.d.mts.map +0 -1
- package/lib/sdui/actions.d.ts +0 -25
- package/lib/sdui/actions.d.ts.map +0 -1
- package/lib/sdui/actions.js +0 -63
- package/lib/sdui/actions.js.map +0 -1
- package/lib/sdui/actions.mjs +0 -52
- package/lib/sdui/actions.mjs.map +0 -1
- package/lib/sdui/component.d.mts +0 -58
- package/lib/sdui/component.d.mts.map +0 -1
- package/lib/sdui/component.d.ts +0 -58
- package/lib/sdui/component.d.ts.map +0 -1
- package/lib/sdui/component.js +0 -128
- package/lib/sdui/component.js.map +0 -1
- package/lib/sdui/component.mjs +0 -124
- package/lib/sdui/component.mjs.map +0 -1
- package/lib/sdui/components.d.mts +0 -1047
- package/lib/sdui/components.d.mts.map +0 -1
- package/lib/sdui/components.d.ts +0 -1047
- package/lib/sdui/components.d.ts.map +0 -1
- package/lib/sdui/components.js +0 -845
- package/lib/sdui/components.js.map +0 -1
- package/lib/sdui/components.mjs +0 -840
- package/lib/sdui/components.mjs.map +0 -1
- package/lib/sdui/conditions.d.mts +0 -25
- package/lib/sdui/conditions.d.mts.map +0 -1
- package/lib/sdui/conditions.d.ts +0 -25
- package/lib/sdui/conditions.d.ts.map +0 -1
- package/lib/sdui/conditions.js +0 -47
- package/lib/sdui/conditions.js.map +0 -1
- package/lib/sdui/conditions.mjs +0 -35
- package/lib/sdui/conditions.mjs.map +0 -1
- package/lib/sdui/directives.d.mts +0 -18
- package/lib/sdui/directives.d.mts.map +0 -1
- package/lib/sdui/directives.d.ts +0 -18
- package/lib/sdui/directives.d.ts.map +0 -1
- package/lib/sdui/directives.js +0 -31
- package/lib/sdui/directives.js.map +0 -1
- package/lib/sdui/directives.mjs +0 -24
- package/lib/sdui/directives.mjs.map +0 -1
- package/lib/sdui/index.d.mts +0 -375
- package/lib/sdui/index.d.mts.map +0 -1
- package/lib/sdui/index.d.ts +0 -375
- package/lib/sdui/index.d.ts.map +0 -1
- package/lib/sdui/index.js +0 -386
- package/lib/sdui/index.js.map +0 -1
- package/lib/sdui/index.mjs +0 -215
- package/lib/sdui/index.mjs.map +0 -1
- package/lib/sdui/propTypes.d.mts +0 -5971
- package/lib/sdui/propTypes.d.mts.map +0 -1
- package/lib/sdui/propTypes.d.ts +0 -5971
- package/lib/sdui/propTypes.d.ts.map +0 -1
- package/lib/sdui/propTypes.js +0 -14
- package/lib/sdui/propTypes.js.map +0 -1
- package/lib/sdui/propTypes.mjs +0 -13
- package/lib/sdui/propTypes.mjs.map +0 -1
- package/lib/sdui/props.d.mts +0 -12
- package/lib/sdui/props.d.mts.map +0 -1
- package/lib/sdui/props.d.ts +0 -12
- package/lib/sdui/props.d.ts.map +0 -1
- package/lib/sdui/props.js +0 -25
- package/lib/sdui/props.js.map +0 -1
- package/lib/sdui/props.mjs +0 -21
- package/lib/sdui/props.mjs.map +0 -1
- package/lib/sdui/render.d.mts +0 -23
- package/lib/sdui/render.d.mts.map +0 -1
- package/lib/sdui/render.d.ts +0 -23
- package/lib/sdui/render.d.ts.map +0 -1
- package/lib/sdui/render.js +0 -48
- package/lib/sdui/render.js.map +0 -1
- package/lib/sdui/render.mjs +0 -45
- package/lib/sdui/render.mjs.map +0 -1
- package/lib/sdui/state.d.mts +0 -22
- package/lib/sdui/state.d.mts.map +0 -1
- package/lib/sdui/state.d.ts +0 -22
- package/lib/sdui/state.d.ts.map +0 -1
- package/lib/sdui/state.js +0 -59
- package/lib/sdui/state.js.map +0 -1
- package/lib/sdui/state.mjs +0 -55
- package/lib/sdui/state.mjs.map +0 -1
- package/lib/sdui.d.mts +0 -3
- package/lib/sdui.d.mts.map +0 -1
- package/lib/sdui.d.ts +0 -3
- package/lib/sdui.d.ts.map +0 -1
- package/lib/sdui.js +0 -8
- package/lib/sdui.js.map +0 -1
- package/lib/sdui.mjs +0 -3
- package/lib/sdui.mjs.map +0 -1
- package/src/lib/sdui/actions.ts +0 -71
- package/src/lib/sdui/component.ts +0 -162
- package/src/lib/sdui/components.ts +0 -1572
- package/src/lib/sdui/conditions.ts +0 -59
- package/src/lib/sdui/directives.ts +0 -45
- package/src/lib/sdui/index.ts +0 -650
- package/src/lib/sdui/propTypes.ts +0 -8087
- package/src/lib/sdui/props.ts +0 -32
- package/src/lib/sdui/render.ts +0 -66
- package/src/lib/sdui/state.ts +0 -66
- package/src/lib/sdui.ts +0 -2
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type ExistingManifestContextOptions } from "./existing-manifest-context.js";
|
|
2
2
|
import type { ManifestComponentDeletion, ManifestScope } from "./manifest-builder.js";
|
|
3
|
+
export type FunctionCodeFile = `./${string}.ts` | `/${string}.ts`;
|
|
3
4
|
/**
|
|
4
5
|
* Initialization properties for {@link ManifestFunction}.
|
|
5
6
|
*/
|
|
@@ -17,11 +18,12 @@ export interface ManifestFunctionProps {
|
|
|
17
18
|
*/
|
|
18
19
|
name: string;
|
|
19
20
|
/**
|
|
20
|
-
* TypeScript handler source
|
|
21
|
+
* Path to a TypeScript handler source file. The file must export an
|
|
22
|
+
* `onRipplingEvent` function. Its contents are serialized to `code_draft`.
|
|
21
23
|
*
|
|
22
24
|
* Optional. @default `''`
|
|
23
25
|
*/
|
|
24
|
-
|
|
26
|
+
codeFile?: FunctionCodeFile;
|
|
25
27
|
/**
|
|
26
28
|
* Human-readable description of what this function does.
|
|
27
29
|
*
|
|
@@ -61,9 +63,9 @@ export interface ManifestFunctionProps {
|
|
|
61
63
|
* serverless infrastructure. The handler must export `onRipplingEvent`.
|
|
62
64
|
*
|
|
63
65
|
* Functions have two primary uses:
|
|
64
|
-
* 1. **
|
|
65
|
-
*
|
|
66
|
-
*
|
|
66
|
+
* 1. **Rendering SDUI for Custom Apps** — the function returns an SDUI spec
|
|
67
|
+
* payload that renders as a page tab. Wrap the function in an {@link SduiPage}
|
|
68
|
+
* and reference it from an {@link App}.
|
|
67
69
|
* 2. **Workflow / event handlers** — functions invoked from rules, automations,
|
|
68
70
|
* or callbacks that do not render UI.
|
|
69
71
|
*
|
|
@@ -77,7 +79,7 @@ export interface ManifestFunctionProps {
|
|
|
77
79
|
* apiName: 'gym_today_schedule_fn',
|
|
78
80
|
* name: 'Today\'s schedule (SDUI)',
|
|
79
81
|
* description: 'Searchable grid of class sessions',
|
|
80
|
-
*
|
|
82
|
+
* codeFile: './functions/gym_today_schedule_fn/code.ts',
|
|
81
83
|
* dependencies: {
|
|
82
84
|
* '@rippling/rippling-sdk': '^0.2.0-alpha.33',
|
|
83
85
|
* },
|
|
@@ -92,7 +94,8 @@ export declare class ManifestFunction {
|
|
|
92
94
|
static toDeletionIdentifier(apiName: string): ManifestComponentDeletion;
|
|
93
95
|
private readonly _apiName;
|
|
94
96
|
private readonly _name;
|
|
95
|
-
private readonly
|
|
97
|
+
private readonly _codeFile;
|
|
98
|
+
private _codeDraft;
|
|
96
99
|
private readonly _description;
|
|
97
100
|
private readonly _dependencies;
|
|
98
101
|
private readonly _deploymentOptions;
|
|
@@ -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":"AAEA,OAAO,EAA8B,KAAK,8BAA8B,EAAE,uCAAoC;AAC9G,OAAO,KAAK,EAAE,yBAAyB,EAAE,aAAa,EAAE,8BAA2B;AAGnF,MAAM,MAAM,gBAAgB,GAAG,KAAK,MAAM,KAAK,GAAG,IAAI,MAAM,KAAK,CAAC;AAElE;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,IAAI,EAAE,M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,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,gBAAgB;IAkBrG;;OAEG;IACH,UAAU,IAAI,MAAM;IAIpB;;;;OAIG;IACH,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAgB9B"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ManifestFunction = void 0;
|
|
4
|
+
const tslib_1 = require("../../internal/tslib.js");
|
|
5
|
+
const fs = tslib_1.__importStar(require("node:fs"));
|
|
4
6
|
const existing_manifest_context_1 = require("./existing-manifest-context.js");
|
|
5
7
|
const _existing_component_fields_1 = require("./_existing-component-fields.js");
|
|
6
8
|
/**
|
|
@@ -10,9 +12,9 @@ const _existing_component_fields_1 = require("./_existing-component-fields.js");
|
|
|
10
12
|
* serverless infrastructure. The handler must export `onRipplingEvent`.
|
|
11
13
|
*
|
|
12
14
|
* Functions have two primary uses:
|
|
13
|
-
* 1. **
|
|
14
|
-
*
|
|
15
|
-
*
|
|
15
|
+
* 1. **Rendering SDUI for Custom Apps** — the function returns an SDUI spec
|
|
16
|
+
* payload that renders as a page tab. Wrap the function in an {@link SduiPage}
|
|
17
|
+
* and reference it from an {@link App}.
|
|
16
18
|
* 2. **Workflow / event handlers** — functions invoked from rules, automations,
|
|
17
19
|
* or callbacks that do not render UI.
|
|
18
20
|
*
|
|
@@ -26,7 +28,7 @@ const _existing_component_fields_1 = require("./_existing-component-fields.js");
|
|
|
26
28
|
* apiName: 'gym_today_schedule_fn',
|
|
27
29
|
* name: 'Today\'s schedule (SDUI)',
|
|
28
30
|
* description: 'Searchable grid of class sessions',
|
|
29
|
-
*
|
|
31
|
+
* codeFile: './functions/gym_today_schedule_fn/code.ts',
|
|
30
32
|
* dependencies: {
|
|
31
33
|
* '@rippling/rippling-sdk': '^0.2.0-alpha.33',
|
|
32
34
|
* },
|
|
@@ -50,7 +52,7 @@ class ManifestFunction {
|
|
|
50
52
|
constructor(scope, props) {
|
|
51
53
|
this._apiName = props.apiName;
|
|
52
54
|
this._name = props.name;
|
|
53
|
-
this.
|
|
55
|
+
this._codeFile = props.codeFile;
|
|
54
56
|
this._description = props.description;
|
|
55
57
|
this._dependencies = props.dependencies;
|
|
56
58
|
this._deploymentOptions = props.deploymentOptions;
|
|
@@ -71,8 +73,7 @@ class ManifestFunction {
|
|
|
71
73
|
name: (0, _existing_component_fields_1.requireStringComponentField)(component, 'name', ManifestFunction.componentType),
|
|
72
74
|
description: (0, _existing_component_fields_1.optionalStringComponentField)(component, 'description'),
|
|
73
75
|
};
|
|
74
|
-
|
|
75
|
-
props.code = component['code_draft'];
|
|
76
|
+
const codeDraft = (0, _existing_component_fields_1.optionalStringComponentField)(component, 'code_draft');
|
|
76
77
|
if (component['dependencies'] !== undefined)
|
|
77
78
|
props.dependencies = component['dependencies'];
|
|
78
79
|
if (component['deployment_options'] !== undefined) {
|
|
@@ -82,7 +83,9 @@ class ManifestFunction {
|
|
|
82
83
|
props.allowedDomains = component['allowed_domains'];
|
|
83
84
|
if (component['is_async'] !== undefined)
|
|
84
85
|
props.isAsync = component['is_async'];
|
|
85
|
-
|
|
86
|
+
const manifestFunction = new ManifestFunction(scope, props);
|
|
87
|
+
manifestFunction._codeDraft = codeDraft;
|
|
88
|
+
return manifestFunction;
|
|
86
89
|
}
|
|
87
90
|
/**
|
|
88
91
|
* Returns the api_name of this function (e.g. `'gym_today_schedule_fn'`).
|
|
@@ -102,8 +105,9 @@ class ManifestFunction {
|
|
|
102
105
|
api_name: this._apiName,
|
|
103
106
|
description: this._description,
|
|
104
107
|
};
|
|
105
|
-
|
|
106
|
-
|
|
108
|
+
const codeDraft = this._codeDraft ?? (this._codeFile ? fs.readFileSync(this._codeFile, 'utf-8') : undefined);
|
|
109
|
+
if (codeDraft)
|
|
110
|
+
component['code_draft'] = codeDraft;
|
|
107
111
|
if (this._dependencies != null)
|
|
108
112
|
component['dependencies'] = this._dependencies;
|
|
109
113
|
if (this._deploymentOptions != null)
|
|
@@ -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":";;;;AAAA,oDAA8B;AAE9B,8EAA8G;AAE9G,gFAAyG;AA4DzG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAa,gBAAgB;IAG3B,MAAM,CAAC,oBAAoB,CAAC,OAAe;QACzC,OAAO;YACL,IAAI,EAAE,gBAAgB,CAAC,aAAa;YACpC,QAAQ,EAAE,OAAO;SAClB,CAAC;IACJ,CAAC;IAYD;;;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,SAAS,GAAG,KAAK,CAAC,QAAQ,CAAC;QAChC,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC,WAAW,CAAC;QACtC,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC,YAAY,CAAC;QACxC,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC,iBAAiB,CAAC;QAClD,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,MAAM,CAAC,gBAAgB,CAAC,OAAe,EAAE,UAA0C,EAAE;QACnF,OAAO,IAAA,sDAA0B,EAAC,OAAO,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;IACnE,CAAC;IAED,sEAAsE;IACtE,M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B,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,WAAW,EAAE,IAAI,CAAC,YAAY;SAC/B,CAAC;QACF,MAAM,SAAS,GACb,IAAI,CAAC,UAAU,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QAC7F,IAAI,SAAS;YAAE,SAAS,CAAC,YAAY,CAAC,GAAG,SAAS,CAAC;QACnD,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;;AAzFH,4CA0FC;AAzFiB,8BAAa,GAAG,UAAmB,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as fs from 'node:fs';
|
|
1
2
|
import { getExistingManifestContext } from "./existing-manifest-context.mjs";
|
|
2
3
|
import { optionalStringComponentField, requireStringComponentField } from "./_existing-component-fields.mjs";
|
|
3
4
|
/**
|
|
@@ -7,9 +8,9 @@ import { optionalStringComponentField, requireStringComponentField } from "./_ex
|
|
|
7
8
|
* serverless infrastructure. The handler must export `onRipplingEvent`.
|
|
8
9
|
*
|
|
9
10
|
* Functions have two primary uses:
|
|
10
|
-
* 1. **
|
|
11
|
-
*
|
|
12
|
-
*
|
|
11
|
+
* 1. **Rendering SDUI for Custom Apps** — the function returns an SDUI spec
|
|
12
|
+
* payload that renders as a page tab. Wrap the function in an {@link SduiPage}
|
|
13
|
+
* and reference it from an {@link App}.
|
|
13
14
|
* 2. **Workflow / event handlers** — functions invoked from rules, automations,
|
|
14
15
|
* or callbacks that do not render UI.
|
|
15
16
|
*
|
|
@@ -23,7 +24,7 @@ import { optionalStringComponentField, requireStringComponentField } from "./_ex
|
|
|
23
24
|
* apiName: 'gym_today_schedule_fn',
|
|
24
25
|
* name: 'Today\'s schedule (SDUI)',
|
|
25
26
|
* description: 'Searchable grid of class sessions',
|
|
26
|
-
*
|
|
27
|
+
* codeFile: './functions/gym_today_schedule_fn/code.ts',
|
|
27
28
|
* dependencies: {
|
|
28
29
|
* '@rippling/rippling-sdk': '^0.2.0-alpha.33',
|
|
29
30
|
* },
|
|
@@ -47,7 +48,7 @@ export class ManifestFunction {
|
|
|
47
48
|
constructor(scope, props) {
|
|
48
49
|
this._apiName = props.apiName;
|
|
49
50
|
this._name = props.name;
|
|
50
|
-
this.
|
|
51
|
+
this._codeFile = props.codeFile;
|
|
51
52
|
this._description = props.description;
|
|
52
53
|
this._dependencies = props.dependencies;
|
|
53
54
|
this._deploymentOptions = props.deploymentOptions;
|
|
@@ -68,8 +69,7 @@ export class ManifestFunction {
|
|
|
68
69
|
name: requireStringComponentField(component, 'name', ManifestFunction.componentType),
|
|
69
70
|
description: optionalStringComponentField(component, 'description'),
|
|
70
71
|
};
|
|
71
|
-
|
|
72
|
-
props.code = component['code_draft'];
|
|
72
|
+
const codeDraft = optionalStringComponentField(component, 'code_draft');
|
|
73
73
|
if (component['dependencies'] !== undefined)
|
|
74
74
|
props.dependencies = component['dependencies'];
|
|
75
75
|
if (component['deployment_options'] !== undefined) {
|
|
@@ -79,7 +79,9 @@ export class ManifestFunction {
|
|
|
79
79
|
props.allowedDomains = component['allowed_domains'];
|
|
80
80
|
if (component['is_async'] !== undefined)
|
|
81
81
|
props.isAsync = component['is_async'];
|
|
82
|
-
|
|
82
|
+
const manifestFunction = new ManifestFunction(scope, props);
|
|
83
|
+
manifestFunction._codeDraft = codeDraft;
|
|
84
|
+
return manifestFunction;
|
|
83
85
|
}
|
|
84
86
|
/**
|
|
85
87
|
* Returns the api_name of this function (e.g. `'gym_today_schedule_fn'`).
|
|
@@ -99,8 +101,9 @@ export class ManifestFunction {
|
|
|
99
101
|
api_name: this._apiName,
|
|
100
102
|
description: this._description,
|
|
101
103
|
};
|
|
102
|
-
|
|
103
|
-
|
|
104
|
+
const codeDraft = this._codeDraft ?? (this._codeFile ? fs.readFileSync(this._codeFile, 'utf-8') : undefined);
|
|
105
|
+
if (codeDraft)
|
|
106
|
+
component['code_draft'] = codeDraft;
|
|
104
107
|
if (this._dependencies != null)
|
|
105
108
|
component['dependencies'] = this._dependencies;
|
|
106
109
|
if (this._deploymentOptions != null)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest-function.mjs","sourceRoot":"","sources":["../../src/lib/manifest/manifest-function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAuC,wCAAoC;AAE9G,OAAO,EAAE,4BAA4B,EAAE,2BAA2B,EAAE,yCAAqC;
|
|
1
|
+
{"version":3,"file":"manifest-function.mjs","sourceRoot":"","sources":["../../src/lib/manifest/manifest-function.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAE9B,OAAO,EAAE,0BAA0B,EAAuC,wCAAoC;AAE9G,OAAO,EAAE,4BAA4B,EAAE,2BAA2B,EAAE,yCAAqC;AA4DzG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,OAAO,gBAAgB;IAG3B,MAAM,CAAC,oBAAoB,CAAC,OAAe;QACzC,OAAO;YACL,IAAI,EAAE,gBAAgB,CAAC,aAAa;YACpC,QAAQ,EAAE,OAAO;SAClB,CAAC;IACJ,CAAC;IAYD;;;OAGG;IACH,YAAY,KAAoB,EAAE,KAA4B;QAC5D,IAAI,CA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,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;;AAxFe,8BAAa,GAAG,UAAmB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
import * as fs from 'node:fs';
|
|
2
|
+
|
|
1
3
|
import { getExistingManifestContext, type ExistingManifestContextOptions } from './existing-manifest-context';
|
|
2
4
|
import type { ManifestComponentDeletion, ManifestScope } from './manifest-builder';
|
|
3
5
|
import { optionalStringComponentField, requireStringComponentField } from './_existing-component-fields';
|
|
4
6
|
|
|
7
|
+
export type FunctionCodeFile = `./${string}.ts` | `/${string}.ts`;
|
|
8
|
+
|
|
5
9
|
/**
|
|
6
10
|
* Initialization properties for {@link ManifestFunction}.
|
|
7
11
|
*/
|
|
@@ -19,11 +23,12 @@ export interface ManifestFunctionProps {
|
|
|
19
23
|
*/
|
|
20
24
|
name: string;
|
|
21
25
|
/**
|
|
22
|
-
* TypeScript handler source
|
|
26
|
+
* Path to a TypeScript handler source file. The file must export an
|
|
27
|
+
* `onRipplingEvent` function. Its contents are serialized to `code_draft`.
|
|
23
28
|
*
|
|
24
29
|
* Optional. @default `''`
|
|
25
30
|
*/
|
|
26
|
-
|
|
31
|
+
codeFile?: FunctionCodeFile;
|
|
27
32
|
/**
|
|
28
33
|
* Human-readable description of what this function does.
|
|
29
34
|
*
|
|
@@ -64,9 +69,9 @@ export interface ManifestFunctionProps {
|
|
|
64
69
|
* serverless infrastructure. The handler must export `onRipplingEvent`.
|
|
65
70
|
*
|
|
66
71
|
* Functions have two primary uses:
|
|
67
|
-
* 1. **
|
|
68
|
-
*
|
|
69
|
-
*
|
|
72
|
+
* 1. **Rendering SDUI for Custom Apps** — the function returns an SDUI spec
|
|
73
|
+
* payload that renders as a page tab. Wrap the function in an {@link SduiPage}
|
|
74
|
+
* and reference it from an {@link App}.
|
|
70
75
|
* 2. **Workflow / event handlers** — functions invoked from rules, automations,
|
|
71
76
|
* or callbacks that do not render UI.
|
|
72
77
|
*
|
|
@@ -80,7 +85,7 @@ export interface ManifestFunctionProps {
|
|
|
80
85
|
* apiName: 'gym_today_schedule_fn',
|
|
81
86
|
* name: 'Today\'s schedule (SDUI)',
|
|
82
87
|
* description: 'Searchable grid of class sessions',
|
|
83
|
-
*
|
|
88
|
+
* codeFile: './functions/gym_today_schedule_fn/code.ts',
|
|
84
89
|
* dependencies: {
|
|
85
90
|
* '@rippling/rippling-sdk': '^0.2.0-alpha.33',
|
|
86
91
|
* },
|
|
@@ -102,7 +107,8 @@ export class ManifestFunction {
|
|
|
102
107
|
|
|
103
108
|
private readonly _apiName: string;
|
|
104
109
|
private readonly _name: string;
|
|
105
|
-
private readonly
|
|
110
|
+
private readonly _codeFile: FunctionCodeFile | undefined;
|
|
111
|
+
private _codeDraft: string | undefined;
|
|
106
112
|
private readonly _description: string;
|
|
107
113
|
private readonly _dependencies: Record<string, string> | undefined;
|
|
108
114
|
private readonly _deploymentOptions: Record<string, any> | undefined;
|
|
@@ -116,7 +122,7 @@ export class ManifestFunction {
|
|
|
116
122
|
constructor(scope: ManifestScope, props: ManifestFunctionProps) {
|
|
117
123
|
this._apiName = props.apiName;
|
|
118
124
|
this._name = props.name;
|
|
119
|
-
this.
|
|
125
|
+
this._codeFile = props.codeFile;
|
|
120
126
|
this._description = props.description;
|
|
121
127
|
this._dependencies = props.dependencies;
|
|
122
128
|
this._deploymentOptions = props.deploymentOptions;
|
|
@@ -139,14 +145,16 @@ export class ManifestFunction {
|
|
|
139
145
|
name: requireStringComponentField(component, 'name', ManifestFunction.componentType),
|
|
140
146
|
description: optionalStringComponentField(component, 'description'),
|
|
141
147
|
};
|
|
142
|
-
|
|
148
|
+
const codeDraft = optionalStringComponentField(component, 'code_draft');
|
|
143
149
|
if (component['dependencies'] !== undefined) props.dependencies = component['dependencies'];
|
|
144
150
|
if (component['deployment_options'] !== undefined) {
|
|
145
151
|
props.deploymentOptions = component['deployment_options'];
|
|
146
152
|
}
|
|
147
153
|
if (component['allowed_domains'] !== undefined) props.allowedDomains = component['allowed_domains'];
|
|
148
154
|
if (component['is_async'] !== undefined) props.isAsync = component['is_async'];
|
|
149
|
-
|
|
155
|
+
const manifestFunction = new ManifestFunction(scope, props);
|
|
156
|
+
manifestFunction._codeDraft = codeDraft;
|
|
157
|
+
return manifestFunction;
|
|
150
158
|
}
|
|
151
159
|
|
|
152
160
|
/**
|
|
@@ -168,7 +176,9 @@ export class ManifestFunction {
|
|
|
168
176
|
api_name: this._apiName,
|
|
169
177
|
description: this._description,
|
|
170
178
|
};
|
|
171
|
-
|
|
179
|
+
const codeDraft =
|
|
180
|
+
this._codeDraft ?? (this._codeFile ? fs.readFileSync(this._codeFile, 'utf-8') : undefined);
|
|
181
|
+
if (codeDraft) component['code_draft'] = codeDraft;
|
|
172
182
|
if (this._dependencies != null) component['dependencies'] = this._dependencies;
|
|
173
183
|
if (this._deploymentOptions != null) component['deployment_options'] = this._deploymentOptions;
|
|
174
184
|
if (this._allowedDomains != null) component['allowed_domains'] = this._allowedDomains;
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.2.0-alpha.
|
|
1
|
+
export const VERSION = '0.2.0-alpha.61'; // 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.61";
|
|
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.61";
|
|
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.61'; // 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.61'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|