@rippling/rippling-sdk 0.2.0-alpha.83 → 0.2.0-alpha.85
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/custom-object-creation-workflow/custom-object-creation-workflow.ts +44 -26
- package/examples/manifest/dental-practice-management/dental-practice-management.ts +470 -142
- package/examples/manifest/dental-practice-management/functions/chair-schedule.ts +23 -13
- package/examples/manifest/dental-practice-management/functions/complete-visit.ts +55 -32
- package/examples/manifest/dental-practice-management/functions/operatory-list.ts +23 -13
- package/examples/manifest/dental-practice-management/functions/patient-list.ts +23 -13
- package/examples/manifest/dental-practice-management/functions/treatment-plan-list.ts +23 -13
- package/examples/manifest/existing-manifest-mutations/existing-manifest-mutations.ts +23 -68
- package/examples/manifest/field-service-dispatch/field-service-dispatch.ts +375 -102
- package/examples/manifest/grant-program-management/grant-program-management.ts +419 -125
- package/examples/manifest/gym-membership-management/functions/check-in-desk.ts +23 -13
- package/examples/manifest/gym-membership-management/functions/member-list.ts +23 -13
- package/examples/manifest/gym-membership-management/functions/today-schedule.ts +23 -13
- package/examples/manifest/gym-membership-management/functions/trainer-list.ts +23 -13
- package/examples/manifest/gym-membership-management/gym-membership-management.ts +442 -92
- package/examples/manifest/procurement-approval-hub/procurement-approval-hub.ts +408 -122
- package/examples/manifest/simple-todo-app/functions/mark-done.ts +12 -16
- package/examples/manifest/simple-todo-app/functions/todo-list.ts +23 -13
- package/examples/manifest/simple-todo-app/simple-todo-app.ts +109 -40
- package/examples/manifest/todo-app-without-object-list-view/functions/todo-page.ts +193 -166
- package/examples/manifest/todo-app-without-object-list-view/todo-app-without-object-list-view.ts +47 -24
- package/package.json +13 -7
- package/resources/custom-objects/custom-objects.d.mts +0 -7
- package/resources/custom-objects/custom-objects.d.mts.map +1 -1
- package/resources/custom-objects/custom-objects.d.ts +0 -7
- package/resources/custom-objects/custom-objects.d.ts.map +1 -1
- package/resources/custom-objects/custom-objects.js.map +1 -1
- package/resources/custom-objects/custom-objects.mjs.map +1 -1
- package/resources/custom-objects/fields.d.mts +14 -128
- package/resources/custom-objects/fields.d.mts.map +1 -1
- package/resources/custom-objects/fields.d.ts +14 -128
- package/resources/custom-objects/fields.d.ts.map +1 -1
- package/src/resources/custom-objects/custom-objects.ts +0 -8
- package/src/resources/custom-objects/fields.ts +13 -191
- package/src/tsconfig.json +1 -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
- package/core/platform/custom-objects/category.d.mts +0 -125
- package/core/platform/custom-objects/category.d.mts.map +0 -1
- package/core/platform/custom-objects/category.d.ts +0 -125
- package/core/platform/custom-objects/category.d.ts.map +0 -1
- package/core/platform/custom-objects/category.js +0 -188
- package/core/platform/custom-objects/category.js.map +0 -1
- package/core/platform/custom-objects/category.mjs +0 -178
- package/core/platform/custom-objects/category.mjs.map +0 -1
- package/core/platform/custom-objects/definition.d.mts +0 -147
- package/core/platform/custom-objects/definition.d.mts.map +0 -1
- package/core/platform/custom-objects/definition.d.ts +0 -147
- package/core/platform/custom-objects/definition.d.ts.map +0 -1
- package/core/platform/custom-objects/definition.js +0 -200
- package/core/platform/custom-objects/definition.js.map +0 -1
- package/core/platform/custom-objects/definition.mjs +0 -190
- package/core/platform/custom-objects/definition.mjs.map +0 -1
- package/core/platform/custom-objects/fields.d.mts +0 -302
- package/core/platform/custom-objects/fields.d.mts.map +0 -1
- package/core/platform/custom-objects/fields.d.ts +0 -302
- package/core/platform/custom-objects/fields.d.ts.map +0 -1
- package/core/platform/custom-objects/fields.js +0 -369
- package/core/platform/custom-objects/fields.js.map +0 -1
- package/core/platform/custom-objects/fields.mjs +0 -347
- package/core/platform/custom-objects/fields.mjs.map +0 -1
- package/core/platform/custom-objects/function-runtime.d.mts +0 -42
- package/core/platform/custom-objects/function-runtime.d.mts.map +0 -1
- package/core/platform/custom-objects/function-runtime.d.ts +0 -42
- package/core/platform/custom-objects/function-runtime.d.ts.map +0 -1
- package/core/platform/custom-objects/function-runtime.js +0 -38
- package/core/platform/custom-objects/function-runtime.js.map +0 -1
- package/core/platform/custom-objects/function-runtime.mjs +0 -35
- package/core/platform/custom-objects/function-runtime.mjs.map +0 -1
- package/core/platform/custom-objects/lifecycle.d.mts +0 -83
- package/core/platform/custom-objects/lifecycle.d.mts.map +0 -1
- package/core/platform/custom-objects/lifecycle.d.ts +0 -83
- package/core/platform/custom-objects/lifecycle.d.ts.map +0 -1
- package/core/platform/custom-objects/lifecycle.js +0 -372
- package/core/platform/custom-objects/lifecycle.js.map +0 -1
- package/core/platform/custom-objects/lifecycle.mjs +0 -367
- package/core/platform/custom-objects/lifecycle.mjs.map +0 -1
- package/core/platform/custom-objects/manager.d.mts +0 -354
- package/core/platform/custom-objects/manager.d.mts.map +0 -1
- package/core/platform/custom-objects/manager.d.ts +0 -354
- package/core/platform/custom-objects/manager.d.ts.map +0 -1
- package/core/platform/custom-objects/manager.js +0 -646
- package/core/platform/custom-objects/manager.js.map +0 -1
- package/core/platform/custom-objects/manager.mjs +0 -637
- package/core/platform/custom-objects/manager.mjs.map +0 -1
- package/core/platform/custom-objects/provisioning.d.mts +0 -138
- package/core/platform/custom-objects/provisioning.d.mts.map +0 -1
- package/core/platform/custom-objects/provisioning.d.ts +0 -138
- package/core/platform/custom-objects/provisioning.d.ts.map +0 -1
- package/core/platform/custom-objects/provisioning.js +0 -455
- package/core/platform/custom-objects/provisioning.js.map +0 -1
- package/core/platform/custom-objects/provisioning.mjs +0 -447
- package/core/platform/custom-objects/provisioning.mjs.map +0 -1
- package/core/platform/custom-objects/rql.d.mts +0 -122
- package/core/platform/custom-objects/rql.d.mts.map +0 -1
- package/core/platform/custom-objects/rql.d.ts +0 -122
- package/core/platform/custom-objects/rql.d.ts.map +0 -1
- package/core/platform/custom-objects/rql.js +0 -225
- package/core/platform/custom-objects/rql.js.map +0 -1
- package/core/platform/custom-objects/rql.mjs +0 -222
- package/core/platform/custom-objects/rql.mjs.map +0 -1
- package/core/platform/custom-objects/schema-manager.d.mts +0 -203
- package/core/platform/custom-objects/schema-manager.d.mts.map +0 -1
- package/core/platform/custom-objects/schema-manager.d.ts +0 -203
- package/core/platform/custom-objects/schema-manager.d.ts.map +0 -1
- package/core/platform/custom-objects/schema-manager.js +0 -256
- package/core/platform/custom-objects/schema-manager.js.map +0 -1
- package/core/platform/custom-objects/schema-manager.mjs +0 -249
- package/core/platform/custom-objects/schema-manager.mjs.map +0 -1
- package/core/platform/custom-objects/typed-rql.d.mts +0 -157
- package/core/platform/custom-objects/typed-rql.d.mts.map +0 -1
- package/core/platform/custom-objects/typed-rql.d.ts +0 -157
- package/core/platform/custom-objects/typed-rql.d.ts.map +0 -1
- package/core/platform/custom-objects/typed-rql.js +0 -583
- package/core/platform/custom-objects/typed-rql.js.map +0 -1
- package/core/platform/custom-objects/typed-rql.mjs +0 -580
- package/core/platform/custom-objects/typed-rql.mjs.map +0 -1
- package/core/platform/custom-objects/types.d.mts +0 -549
- package/core/platform/custom-objects/types.d.mts.map +0 -1
- package/core/platform/custom-objects/types.d.ts +0 -549
- package/core/platform/custom-objects/types.d.ts.map +0 -1
- package/core/platform/custom-objects/types.js +0 -20
- package/core/platform/custom-objects/types.js.map +0 -1
- package/core/platform/custom-objects/types.mjs +0 -17
- package/core/platform/custom-objects/types.mjs.map +0 -1
- package/core/platform/custom-objects/validation.d.mts +0 -97
- package/core/platform/custom-objects/validation.d.mts.map +0 -1
- package/core/platform/custom-objects/validation.d.ts +0 -97
- package/core/platform/custom-objects/validation.d.ts.map +0 -1
- package/core/platform/custom-objects/validation.js +0 -477
- package/core/platform/custom-objects/validation.js.map +0 -1
- package/core/platform/custom-objects/validation.mjs +0 -465
- package/core/platform/custom-objects/validation.mjs.map +0 -1
- package/core/platform/custom-objects.d.mts +0 -67
- package/core/platform/custom-objects.d.mts.map +0 -1
- package/core/platform/custom-objects.d.ts +0 -67
- package/core/platform/custom-objects.d.ts.map +0 -1
- package/core/platform/custom-objects.js +0 -118
- package/core/platform/custom-objects.js.map +0 -1
- package/core/platform/custom-objects.mjs +0 -45
- package/core/platform/custom-objects.mjs.map +0 -1
- package/core/platform/manifest/custom-objects/action.d.mts +0 -58
- package/core/platform/manifest/custom-objects/action.d.mts.map +0 -1
- package/core/platform/manifest/custom-objects/action.d.ts +0 -58
- package/core/platform/manifest/custom-objects/action.d.ts.map +0 -1
- package/core/platform/manifest/custom-objects/action.js +0 -44
- package/core/platform/manifest/custom-objects/action.js.map +0 -1
- package/core/platform/manifest/custom-objects/action.mjs +0 -40
- package/core/platform/manifest/custom-objects/action.mjs.map +0 -1
- package/core/platform/manifest/custom-objects/conditions.d.mts +0 -240
- package/core/platform/manifest/custom-objects/conditions.d.mts.map +0 -1
- package/core/platform/manifest/custom-objects/conditions.d.ts +0 -240
- package/core/platform/manifest/custom-objects/conditions.d.ts.map +0 -1
- package/core/platform/manifest/custom-objects/conditions.js +0 -326
- package/core/platform/manifest/custom-objects/conditions.js.map +0 -1
- package/core/platform/manifest/custom-objects/conditions.mjs +0 -321
- package/core/platform/manifest/custom-objects/conditions.mjs.map +0 -1
- package/core/platform/manifest/custom-objects/existing.d.mts +0 -87
- package/core/platform/manifest/custom-objects/existing.d.mts.map +0 -1
- package/core/platform/manifest/custom-objects/existing.d.ts +0 -87
- package/core/platform/manifest/custom-objects/existing.d.ts.map +0 -1
- package/core/platform/manifest/custom-objects/existing.js +0 -113
- package/core/platform/manifest/custom-objects/existing.js.map +0 -1
- package/core/platform/manifest/custom-objects/existing.mjs +0 -109
- package/core/platform/manifest/custom-objects/existing.mjs.map +0 -1
- package/core/platform/manifest/custom-objects/field-resolution.d.mts +0 -48
- package/core/platform/manifest/custom-objects/field-resolution.d.mts.map +0 -1
- package/core/platform/manifest/custom-objects/field-resolution.d.ts +0 -48
- package/core/platform/manifest/custom-objects/field-resolution.d.ts.map +0 -1
- package/core/platform/manifest/custom-objects/field-resolution.js +0 -61
- package/core/platform/manifest/custom-objects/field-resolution.js.map +0 -1
- package/core/platform/manifest/custom-objects/field-resolution.mjs +0 -58
- package/core/platform/manifest/custom-objects/field-resolution.mjs.map +0 -1
- package/core/platform/manifest/custom-objects/function-file.d.mts +0 -87
- package/core/platform/manifest/custom-objects/function-file.d.mts.map +0 -1
- package/core/platform/manifest/custom-objects/function-file.d.ts +0 -87
- package/core/platform/manifest/custom-objects/function-file.d.ts.map +0 -1
- package/core/platform/manifest/custom-objects/function-file.js +0 -76
- package/core/platform/manifest/custom-objects/function-file.js.map +0 -1
- package/core/platform/manifest/custom-objects/function-file.mjs +0 -69
- package/core/platform/manifest/custom-objects/function-file.mjs.map +0 -1
- package/core/platform/manifest/custom-objects/list-view.d.mts +0 -65
- package/core/platform/manifest/custom-objects/list-view.d.mts.map +0 -1
- package/core/platform/manifest/custom-objects/list-view.d.ts +0 -65
- package/core/platform/manifest/custom-objects/list-view.d.ts.map +0 -1
- package/core/platform/manifest/custom-objects/list-view.js +0 -33
- package/core/platform/manifest/custom-objects/list-view.js.map +0 -1
- package/core/platform/manifest/custom-objects/list-view.mjs +0 -30
- package/core/platform/manifest/custom-objects/list-view.mjs.map +0 -1
- package/core/platform/manifest/custom-objects/object-list-page.d.mts +0 -43
- package/core/platform/manifest/custom-objects/object-list-page.d.mts.map +0 -1
- package/core/platform/manifest/custom-objects/object-list-page.d.ts +0 -43
- package/core/platform/manifest/custom-objects/object-list-page.d.ts.map +0 -1
- package/core/platform/manifest/custom-objects/object-list-page.js +0 -54
- package/core/platform/manifest/custom-objects/object-list-page.js.map +0 -1
- package/core/platform/manifest/custom-objects/object-list-page.mjs +0 -50
- package/core/platform/manifest/custom-objects/object-list-page.mjs.map +0 -1
- package/core/platform/manifest/custom-objects/page-layout.d.mts +0 -142
- package/core/platform/manifest/custom-objects/page-layout.d.mts.map +0 -1
- package/core/platform/manifest/custom-objects/page-layout.d.ts +0 -142
- package/core/platform/manifest/custom-objects/page-layout.d.ts.map +0 -1
- package/core/platform/manifest/custom-objects/page-layout.js +0 -184
- package/core/platform/manifest/custom-objects/page-layout.js.map +0 -1
- package/core/platform/manifest/custom-objects/page-layout.mjs +0 -180
- package/core/platform/manifest/custom-objects/page-layout.mjs.map +0 -1
- package/core/platform/manifest/custom-objects/register.d.mts +0 -87
- package/core/platform/manifest/custom-objects/register.d.mts.map +0 -1
- package/core/platform/manifest/custom-objects/register.d.ts +0 -87
- package/core/platform/manifest/custom-objects/register.d.ts.map +0 -1
- package/core/platform/manifest/custom-objects/register.js +0 -395
- package/core/platform/manifest/custom-objects/register.js.map +0 -1
- package/core/platform/manifest/custom-objects/register.mjs +0 -391
- package/core/platform/manifest/custom-objects/register.mjs.map +0 -1
- package/core/platform/manifest/custom-objects/rule.d.mts +0 -113
- package/core/platform/manifest/custom-objects/rule.d.mts.map +0 -1
- package/core/platform/manifest/custom-objects/rule.d.ts +0 -113
- package/core/platform/manifest/custom-objects/rule.d.ts.map +0 -1
- package/core/platform/manifest/custom-objects/rule.js +0 -49
- package/core/platform/manifest/custom-objects/rule.js.map +0 -1
- package/core/platform/manifest/custom-objects/rule.mjs +0 -45
- package/core/platform/manifest/custom-objects/rule.mjs.map +0 -1
- package/core/platform/manifest/custom-objects/sdui-page.d.mts +0 -214
- package/core/platform/manifest/custom-objects/sdui-page.d.mts.map +0 -1
- package/core/platform/manifest/custom-objects/sdui-page.d.ts +0 -214
- package/core/platform/manifest/custom-objects/sdui-page.d.ts.map +0 -1
- package/core/platform/manifest/custom-objects/sdui-page.js +0 -194
- package/core/platform/manifest/custom-objects/sdui-page.js.map +0 -1
- package/core/platform/manifest/custom-objects/sdui-page.mjs +0 -182
- package/core/platform/manifest/custom-objects/sdui-page.mjs.map +0 -1
- package/core/platform/manifest/custom-objects/typed-condition.d.mts +0 -28
- package/core/platform/manifest/custom-objects/typed-condition.d.mts.map +0 -1
- package/core/platform/manifest/custom-objects/typed-condition.d.ts +0 -28
- package/core/platform/manifest/custom-objects/typed-condition.d.ts.map +0 -1
- package/core/platform/manifest/custom-objects/typed-condition.js +0 -434
- package/core/platform/manifest/custom-objects/typed-condition.js.map +0 -1
- package/core/platform/manifest/custom-objects/typed-condition.mjs +0 -431
- package/core/platform/manifest/custom-objects/typed-condition.mjs.map +0 -1
- package/core/platform/manifest/custom-objects/types.d.mts +0 -29
- package/core/platform/manifest/custom-objects/types.d.mts.map +0 -1
- package/core/platform/manifest/custom-objects/types.d.ts +0 -29
- package/core/platform/manifest/custom-objects/types.d.ts.map +0 -1
- package/core/platform/manifest/custom-objects/types.js +0 -3
- package/core/platform/manifest/custom-objects/types.js.map +0 -1
- package/core/platform/manifest/custom-objects/types.mjs +0 -2
- package/core/platform/manifest/custom-objects/types.mjs.map +0 -1
- package/core/platform/manifest/custom-objects/validation.d.mts +0 -44
- package/core/platform/manifest/custom-objects/validation.d.mts.map +0 -1
- package/core/platform/manifest/custom-objects/validation.d.ts +0 -44
- package/core/platform/manifest/custom-objects/validation.d.ts.map +0 -1
- package/core/platform/manifest/custom-objects/validation.js +0 -30
- package/core/platform/manifest/custom-objects/validation.js.map +0 -1
- package/core/platform/manifest/custom-objects/validation.mjs +0 -27
- package/core/platform/manifest/custom-objects/validation.mjs.map +0 -1
- package/core/platform/manifest/custom-objects/workflow.d.mts +0 -47
- package/core/platform/manifest/custom-objects/workflow.d.mts.map +0 -1
- package/core/platform/manifest/custom-objects/workflow.d.ts +0 -47
- package/core/platform/manifest/custom-objects/workflow.d.ts.map +0 -1
- package/core/platform/manifest/custom-objects/workflow.js +0 -38
- package/core/platform/manifest/custom-objects/workflow.js.map +0 -1
- package/core/platform/manifest/custom-objects/workflow.mjs +0 -34
- package/core/platform/manifest/custom-objects/workflow.mjs.map +0 -1
- package/core/platform/manifest/custom-objects.d.mts +0 -85
- package/core/platform/manifest/custom-objects.d.mts.map +0 -1
- package/core/platform/manifest/custom-objects.d.ts +0 -85
- package/core/platform/manifest/custom-objects.d.ts.map +0 -1
- package/core/platform/manifest/custom-objects.js +0 -84
- package/core/platform/manifest/custom-objects.js.map +0 -1
- package/core/platform/manifest/custom-objects.mjs +0 -55
- package/core/platform/manifest/custom-objects.mjs.map +0 -1
- package/examples/manifest/custom-object-creation-workflow/functions/intake-request-created.ts +0 -20
- package/examples/manifest/custom-object-creation-workflow/schema.ts +0 -29
- package/examples/manifest/dental-practice-management/schema.ts +0 -298
- package/examples/manifest/field-service-dispatch/schema.ts +0 -248
- package/examples/manifest/grant-program-management/schema.ts +0 -269
- package/examples/manifest/gym-membership-management/schema.ts +0 -266
- package/examples/manifest/procurement-approval-hub/functions/route-purchase-request.ts +0 -20
- package/examples/manifest/procurement-approval-hub/schema.ts +0 -256
- package/examples/manifest/simple-todo-app/schema.ts +0 -60
- package/examples/manifest/todo-app-without-object-list-view/schema.ts +0 -28
- package/src/core/platform/README.md +0 -20
- package/src/core/platform/custom-objects/category.ts +0 -294
- package/src/core/platform/custom-objects/definition.ts +0 -373
- package/src/core/platform/custom-objects/fields.ts +0 -653
- package/src/core/platform/custom-objects/function-runtime.ts +0 -76
- package/src/core/platform/custom-objects/lifecycle.ts +0 -557
- package/src/core/platform/custom-objects/manager.ts +0 -959
- package/src/core/platform/custom-objects/provisioning.ts +0 -672
- package/src/core/platform/custom-objects/rql.ts +0 -375
- package/src/core/platform/custom-objects/schema-manager.ts +0 -351
- package/src/core/platform/custom-objects/typed-rql.ts +0 -1273
- package/src/core/platform/custom-objects/types.ts +0 -753
- package/src/core/platform/custom-objects/validation.ts +0 -573
- package/src/core/platform/custom-objects.ts +0 -269
- package/src/core/platform/manifest/README.md +0 -26
- package/src/core/platform/manifest/custom-objects/action.ts +0 -87
- package/src/core/platform/manifest/custom-objects/conditions.ts +0 -762
- package/src/core/platform/manifest/custom-objects/existing.ts +0 -221
- package/src/core/platform/manifest/custom-objects/field-resolution.ts +0 -116
- package/src/core/platform/manifest/custom-objects/function-file.ts +0 -149
- package/src/core/platform/manifest/custom-objects/list-view.ts +0 -95
- package/src/core/platform/manifest/custom-objects/object-list-page.ts +0 -87
- package/src/core/platform/manifest/custom-objects/page-layout.ts +0 -380
- package/src/core/platform/manifest/custom-objects/register.ts +0 -555
- package/src/core/platform/manifest/custom-objects/rule.ts +0 -192
- package/src/core/platform/manifest/custom-objects/sdui-page.ts +0 -515
- package/src/core/platform/manifest/custom-objects/typed-condition.ts +0 -617
- package/src/core/platform/manifest/custom-objects/types.ts +0 -92
- package/src/core/platform/manifest/custom-objects/validation.ts +0 -70
- package/src/core/platform/manifest/custom-objects/workflow.ts +0 -71
- package/src/core/platform/manifest/custom-objects.ts +0 -203
- package/src/pebble-sdui-web-custom-apps-shim.d.ts +0 -3
|
@@ -1,18 +1,28 @@
|
|
|
1
|
-
import { FunctionContext, FunctionResponse } from '@rippling/rippling-sdk';
|
|
2
|
-
import {
|
|
3
|
-
handleTypedObjectListPageEvent,
|
|
4
|
-
type TypedObjectListPageInput,
|
|
5
|
-
type TypedObjectListPageOutput,
|
|
6
|
-
} from '@rippling/rippling-sdk/core/platform/manifest/custom-objects';
|
|
7
|
-
import { appointmentDefinition } from '../schema';
|
|
1
|
+
import { FunctionContext, FunctionResponse, SduiPageFunctionEvent } from '@rippling/rippling-sdk';
|
|
2
|
+
import { ObjectListView, render } from '@rippling/pebble-sdui-web/catalogs/custom-apps';
|
|
8
3
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export type Output = TypedObjectListPageOutput;
|
|
4
|
+
const OBJECT = 'dental_appointment__c';
|
|
12
5
|
|
|
13
6
|
export async function onRipplingEvent(
|
|
14
|
-
event:
|
|
7
|
+
event: SduiPageFunctionEvent,
|
|
15
8
|
context: FunctionContext,
|
|
16
|
-
): Promise<FunctionResponse
|
|
17
|
-
|
|
9
|
+
): Promise<FunctionResponse> {
|
|
10
|
+
const action = event.parameters.action;
|
|
11
|
+
|
|
12
|
+
if (action === 'init') {
|
|
13
|
+
const spec = render({
|
|
14
|
+
root: ObjectListView({
|
|
15
|
+
props: { objectApiName: OBJECT },
|
|
16
|
+
}),
|
|
17
|
+
state: {},
|
|
18
|
+
});
|
|
19
|
+
return new FunctionResponse({
|
|
20
|
+
body: { spec: JSON.stringify(spec) },
|
|
21
|
+
statusCode: 200,
|
|
22
|
+
headers: {},
|
|
23
|
+
message: '',
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return new FunctionResponse({ body: {}, statusCode: 200, headers: {}, message: '' });
|
|
18
28
|
}
|
|
@@ -1,26 +1,47 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import RipplingSDK, {
|
|
2
|
+
DetailViewActionFunctionEvent,
|
|
3
|
+
FunctionContext,
|
|
4
|
+
FunctionResponse,
|
|
5
|
+
} from '@rippling/rippling-sdk';
|
|
6
|
+
import type { CustomObjectDataRow } from '@rippling/rippling-sdk/resources/custom-objects/records';
|
|
4
7
|
|
|
5
|
-
const APPOINTMENT_OBJECT_API_NAME =
|
|
6
|
-
const TREATMENT_PLAN_OBJECT_API_NAME =
|
|
8
|
+
const APPOINTMENT_OBJECT_API_NAME = 'dental_appointment__c';
|
|
9
|
+
const TREATMENT_PLAN_OBJECT_API_NAME = 'dental_treatment_plan__c';
|
|
7
10
|
|
|
8
|
-
|
|
11
|
+
type CompleteVisitEvent = DetailViewActionFunctionEvent<
|
|
9
12
|
{},
|
|
10
13
|
typeof APPOINTMENT_OBJECT_API_NAME,
|
|
11
14
|
'Complete visit',
|
|
12
15
|
'layout_dental_appointment'
|
|
13
16
|
>;
|
|
14
17
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
| { error: string };
|
|
18
|
+
type CompleteVisitResponse = {
|
|
19
|
+
appointmentId: string;
|
|
20
|
+
treatmentPlanId?: string;
|
|
21
|
+
message: string;
|
|
22
|
+
};
|
|
22
23
|
|
|
23
|
-
function
|
|
24
|
+
function createClient(context: FunctionContext): RipplingSDK {
|
|
25
|
+
return new RipplingSDK({
|
|
26
|
+
bearerToken: context.env.rippling_user_bearer_token,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function stringValue(record: CustomObjectDataRow, key: string): string {
|
|
31
|
+
const value = record[key];
|
|
32
|
+
return typeof value === 'string' ? value : '';
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function lookupId(record: CustomObjectDataRow, key: string): string | undefined {
|
|
36
|
+
const value = record[key];
|
|
37
|
+
if (typeof value === 'string') return value;
|
|
38
|
+
if (value == null || typeof value !== 'object') return undefined;
|
|
39
|
+
|
|
40
|
+
const nested = value as Record<string, unknown>;
|
|
41
|
+
return typeof nested['id'] === 'string' ? nested['id'] : undefined;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function ok(body: CompleteVisitResponse): FunctionResponse<CompleteVisitResponse> {
|
|
24
45
|
return new FunctionResponse({
|
|
25
46
|
body,
|
|
26
47
|
statusCode: 200,
|
|
@@ -29,7 +50,7 @@ function ok(body: Extract<Output, { appointmentId: string }>): FunctionResponse<
|
|
|
29
50
|
});
|
|
30
51
|
}
|
|
31
52
|
|
|
32
|
-
function badRequest(message: string): FunctionResponse<
|
|
53
|
+
function badRequest(message: string): FunctionResponse<{ error: string }> {
|
|
33
54
|
return new FunctionResponse({
|
|
34
55
|
body: { error: message },
|
|
35
56
|
statusCode: 400,
|
|
@@ -39,31 +60,32 @@ function badRequest(message: string): FunctionResponse<Output> {
|
|
|
39
60
|
}
|
|
40
61
|
|
|
41
62
|
export async function onRipplingEvent(
|
|
42
|
-
event:
|
|
63
|
+
event: CompleteVisitEvent,
|
|
43
64
|
context: FunctionContext,
|
|
44
|
-
): Promise<FunctionResponse<
|
|
65
|
+
): Promise<FunctionResponse<CompleteVisitResponse | { error: string }>> {
|
|
45
66
|
if (event.object_api_name !== APPOINTMENT_OBJECT_API_NAME) {
|
|
46
67
|
return badRequest('Unsupported detail view action.');
|
|
47
68
|
}
|
|
48
69
|
|
|
49
|
-
const
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
70
|
+
const client = createClient(context);
|
|
71
|
+
const appointment = await client.customObjects.records.retrieve(
|
|
72
|
+
APPOINTMENT_OBJECT_API_NAME,
|
|
73
|
+
event.record_id,
|
|
74
|
+
);
|
|
53
75
|
|
|
54
|
-
if (appointment
|
|
76
|
+
if (stringValue(appointment, 'appointment_status__c') === 'Completed') {
|
|
55
77
|
return ok({
|
|
56
78
|
appointmentId: event.record_id,
|
|
57
79
|
message: `${appointment.name} is already completed.`,
|
|
58
80
|
});
|
|
59
81
|
}
|
|
60
82
|
|
|
61
|
-
await
|
|
62
|
-
|
|
63
|
-
|
|
83
|
+
await client.customObjects.records.update(APPOINTMENT_OBJECT_API_NAME, event.record_id, {
|
|
84
|
+
appointment_status__c: 'Completed',
|
|
85
|
+
visit_notes__c: stringValue(appointment, 'visit_notes__c'),
|
|
64
86
|
});
|
|
65
87
|
|
|
66
|
-
const patientId = appointment
|
|
88
|
+
const patientId = lookupId(appointment, 'patient_ref__c');
|
|
67
89
|
if (!patientId) {
|
|
68
90
|
return ok({
|
|
69
91
|
appointmentId: event.record_id,
|
|
@@ -71,17 +93,18 @@ export async function onRipplingEvent(
|
|
|
71
93
|
});
|
|
72
94
|
}
|
|
73
95
|
|
|
74
|
-
const treatmentPlan = await
|
|
96
|
+
const treatmentPlan = await client.customObjects.records.create(TREATMENT_PLAN_OBJECT_API_NAME, {
|
|
75
97
|
name: `Follow-up: ${appointment.name}`,
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
98
|
+
plan_patient_ref__c: patientId,
|
|
99
|
+
plan_status__c: 'Draft',
|
|
100
|
+
procedures_summary__c:
|
|
101
|
+
stringValue(appointment, 'visit_notes__c') || 'Follow up after the completed visit.',
|
|
79
102
|
});
|
|
80
|
-
const response:
|
|
103
|
+
const response: CompleteVisitResponse = {
|
|
81
104
|
appointmentId: event.record_id,
|
|
82
105
|
message: `${appointment.name} marked completed and follow-up treatment plan drafted.`,
|
|
83
106
|
};
|
|
84
|
-
response.treatmentPlanId = treatmentPlan.id;
|
|
107
|
+
if (treatmentPlan.data?.id != null) response.treatmentPlanId = treatmentPlan.data.id;
|
|
85
108
|
|
|
86
109
|
return ok(response);
|
|
87
110
|
}
|
|
@@ -1,18 +1,28 @@
|
|
|
1
|
-
import { FunctionContext, FunctionResponse } from '@rippling/rippling-sdk';
|
|
2
|
-
import {
|
|
3
|
-
handleTypedObjectListPageEvent,
|
|
4
|
-
type TypedObjectListPageInput,
|
|
5
|
-
type TypedObjectListPageOutput,
|
|
6
|
-
} from '@rippling/rippling-sdk/core/platform/manifest/custom-objects';
|
|
7
|
-
import { operatoryDefinition } from '../schema';
|
|
1
|
+
import { FunctionContext, FunctionResponse, SduiPageFunctionEvent } from '@rippling/rippling-sdk';
|
|
2
|
+
import { ObjectListView, render } from '@rippling/pebble-sdui-web/catalogs/custom-apps';
|
|
8
3
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export type Output = TypedObjectListPageOutput;
|
|
4
|
+
const OBJECT = 'dental_operatory__c';
|
|
12
5
|
|
|
13
6
|
export async function onRipplingEvent(
|
|
14
|
-
event:
|
|
7
|
+
event: SduiPageFunctionEvent,
|
|
15
8
|
context: FunctionContext,
|
|
16
|
-
): Promise<FunctionResponse
|
|
17
|
-
|
|
9
|
+
): Promise<FunctionResponse> {
|
|
10
|
+
const action = event.parameters.action;
|
|
11
|
+
|
|
12
|
+
if (action === 'init') {
|
|
13
|
+
const spec = render({
|
|
14
|
+
root: ObjectListView({
|
|
15
|
+
props: { objectApiName: OBJECT },
|
|
16
|
+
}),
|
|
17
|
+
state: {},
|
|
18
|
+
});
|
|
19
|
+
return new FunctionResponse({
|
|
20
|
+
body: { spec: JSON.stringify(spec) },
|
|
21
|
+
statusCode: 200,
|
|
22
|
+
headers: {},
|
|
23
|
+
message: '',
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return new FunctionResponse({ body: {}, statusCode: 200, headers: {}, message: '' });
|
|
18
28
|
}
|
|
@@ -1,18 +1,28 @@
|
|
|
1
|
-
import { FunctionContext, FunctionResponse } from '@rippling/rippling-sdk';
|
|
2
|
-
import {
|
|
3
|
-
handleTypedObjectListPageEvent,
|
|
4
|
-
type TypedObjectListPageInput,
|
|
5
|
-
type TypedObjectListPageOutput,
|
|
6
|
-
} from '@rippling/rippling-sdk/core/platform/manifest/custom-objects';
|
|
7
|
-
import { patientDefinition } from '../schema';
|
|
1
|
+
import { FunctionContext, FunctionResponse, SduiPageFunctionEvent } from '@rippling/rippling-sdk';
|
|
2
|
+
import { ObjectListView, render } from '@rippling/pebble-sdui-web/catalogs/custom-apps';
|
|
8
3
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export type Output = TypedObjectListPageOutput;
|
|
4
|
+
const OBJECT = 'dental_patient__c';
|
|
12
5
|
|
|
13
6
|
export async function onRipplingEvent(
|
|
14
|
-
event:
|
|
7
|
+
event: SduiPageFunctionEvent,
|
|
15
8
|
context: FunctionContext,
|
|
16
|
-
): Promise<FunctionResponse
|
|
17
|
-
|
|
9
|
+
): Promise<FunctionResponse> {
|
|
10
|
+
const action = event.parameters.action;
|
|
11
|
+
|
|
12
|
+
if (action === 'init') {
|
|
13
|
+
const spec = render({
|
|
14
|
+
root: ObjectListView({
|
|
15
|
+
props: { objectApiName: OBJECT },
|
|
16
|
+
}),
|
|
17
|
+
state: {},
|
|
18
|
+
});
|
|
19
|
+
return new FunctionResponse({
|
|
20
|
+
body: { spec: JSON.stringify(spec) },
|
|
21
|
+
statusCode: 200,
|
|
22
|
+
headers: {},
|
|
23
|
+
message: '',
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return new FunctionResponse({ body: {}, statusCode: 200, headers: {}, message: '' });
|
|
18
28
|
}
|
|
@@ -1,18 +1,28 @@
|
|
|
1
|
-
import { FunctionContext, FunctionResponse } from '@rippling/rippling-sdk';
|
|
2
|
-
import {
|
|
3
|
-
handleTypedObjectListPageEvent,
|
|
4
|
-
type TypedObjectListPageInput,
|
|
5
|
-
type TypedObjectListPageOutput,
|
|
6
|
-
} from '@rippling/rippling-sdk/core/platform/manifest/custom-objects';
|
|
7
|
-
import { treatmentPlanDefinition } from '../schema';
|
|
1
|
+
import { FunctionContext, FunctionResponse, SduiPageFunctionEvent } from '@rippling/rippling-sdk';
|
|
2
|
+
import { ObjectListView, render } from '@rippling/pebble-sdui-web/catalogs/custom-apps';
|
|
8
3
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export type Output = TypedObjectListPageOutput;
|
|
4
|
+
const OBJECT = 'dental_treatment_plan__c';
|
|
12
5
|
|
|
13
6
|
export async function onRipplingEvent(
|
|
14
|
-
event:
|
|
7
|
+
event: SduiPageFunctionEvent,
|
|
15
8
|
context: FunctionContext,
|
|
16
|
-
): Promise<FunctionResponse
|
|
17
|
-
|
|
9
|
+
): Promise<FunctionResponse> {
|
|
10
|
+
const action = event.parameters.action;
|
|
11
|
+
|
|
12
|
+
if (action === 'init') {
|
|
13
|
+
const spec = render({
|
|
14
|
+
root: ObjectListView({
|
|
15
|
+
props: { objectApiName: OBJECT },
|
|
16
|
+
}),
|
|
17
|
+
state: {},
|
|
18
|
+
});
|
|
19
|
+
return new FunctionResponse({
|
|
20
|
+
body: { spec: JSON.stringify(spec) },
|
|
21
|
+
statusCode: 200,
|
|
22
|
+
headers: {},
|
|
23
|
+
message: '',
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return new FunctionResponse({ body: {}, statusCode: 200, headers: {}, message: '' });
|
|
18
28
|
}
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Existing manifest mutations.
|
|
3
3
|
*
|
|
4
|
-
* This example keeps the existing manifest JSON inline,
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* Current boundary: rebinding avoids most manual load-from-existing plumbing,
|
|
9
|
-
* but creating brand-new fields/sections in an existing manifest still uses
|
|
10
|
-
* low-level manifest classes as an explicit escape hatch.
|
|
4
|
+
* This example keeps the existing manifest JSON inline, hydrates it back into
|
|
5
|
+
* SDK objects, removes layout content, adds different layout content, and
|
|
6
|
+
* prints the updated manifest JSON.
|
|
11
7
|
*
|
|
12
8
|
* Run:
|
|
13
9
|
* yarn -s tsn examples/manifest/existing-manifest-mutations/existing-manifest-mutations.ts \
|
|
@@ -15,15 +11,9 @@
|
|
|
15
11
|
*/
|
|
16
12
|
|
|
17
13
|
import {
|
|
18
|
-
|
|
19
|
-
phone,
|
|
20
|
-
radio,
|
|
21
|
-
section,
|
|
22
|
-
text,
|
|
23
|
-
} from '@rippling/rippling-sdk/core/platform/custom-objects';
|
|
24
|
-
import { bindExistingManifestCustomObject } from '@rippling/rippling-sdk/core/platform/manifest/custom-objects';
|
|
25
|
-
import {
|
|
14
|
+
CustomObject,
|
|
26
15
|
CustomObjectFieldSection,
|
|
16
|
+
CustomObjectPageLayout,
|
|
27
17
|
type ExistingManifest,
|
|
28
18
|
ManifestBuilder,
|
|
29
19
|
RadioField,
|
|
@@ -171,58 +161,24 @@ const existingManifestJson: ExistingManifest = {
|
|
|
171
161
|
],
|
|
172
162
|
};
|
|
173
163
|
|
|
174
|
-
const gymMemberDefinition = defineCustomObject({
|
|
175
|
-
name: 'gym_member',
|
|
176
|
-
displayName: 'Member',
|
|
177
|
-
pluralLabel: 'Members',
|
|
178
|
-
category: 'gym',
|
|
179
|
-
description: 'Gym member profile, contact, and membership status',
|
|
180
|
-
sections: {
|
|
181
|
-
profile: section('Profile', { sectionId: 'sec_gm_profile' }),
|
|
182
|
-
membership: section('Membership', { sectionId: 'sec_gm_membership' }),
|
|
183
|
-
},
|
|
184
|
-
fields: {
|
|
185
|
-
first_name: text({
|
|
186
|
-
displayName: 'First name',
|
|
187
|
-
description: 'First name',
|
|
188
|
-
required: true,
|
|
189
|
-
maxLength: 80,
|
|
190
|
-
section: 'profile',
|
|
191
|
-
}),
|
|
192
|
-
last_name: text({
|
|
193
|
-
displayName: 'Last name',
|
|
194
|
-
description: 'Last name',
|
|
195
|
-
required: true,
|
|
196
|
-
maxLength: 80,
|
|
197
|
-
section: 'profile',
|
|
198
|
-
}),
|
|
199
|
-
phone: phone({
|
|
200
|
-
displayName: 'Phone',
|
|
201
|
-
description: 'Phone',
|
|
202
|
-
section: 'profile',
|
|
203
|
-
}),
|
|
204
|
-
membership_status: radio({
|
|
205
|
-
displayName: 'Membership status',
|
|
206
|
-
description: 'Membership status',
|
|
207
|
-
options: ['Active', 'Frozen', 'Cancelled', 'Trial'],
|
|
208
|
-
required: true,
|
|
209
|
-
section: 'membership',
|
|
210
|
-
}),
|
|
211
|
-
},
|
|
212
|
-
});
|
|
213
|
-
|
|
214
164
|
const manifest = ManifestBuilder.loadFromExistingJson(existingManifestJson);
|
|
215
|
-
const
|
|
216
|
-
const
|
|
165
|
+
const memberObj = CustomObject.loadFromExisting('gym_member__c');
|
|
166
|
+
const profileSection = CustomObjectFieldSection.loadFromExisting('sec_gm_profile', {
|
|
167
|
+
customObjectApiName: memberObj.getApiName(),
|
|
168
|
+
});
|
|
169
|
+
const membershipSection = CustomObjectFieldSection.loadFromExisting('sec_gm_membership', {
|
|
170
|
+
customObjectApiName: memberObj.getApiName(),
|
|
171
|
+
});
|
|
172
|
+
const memberLayout = CustomObjectPageLayout.loadFromExisting('layout_gym_member', {
|
|
173
|
+
customObjectApiName: memberObj.getApiName(),
|
|
174
|
+
});
|
|
217
175
|
|
|
218
|
-
|
|
219
|
-
// drops to the low-level manifest class model today.
|
|
220
|
-
const preferredName = new TextField(member.object, {
|
|
176
|
+
const preferredName = new TextField(memberObj, {
|
|
221
177
|
apiName: 'preferred_name__c',
|
|
222
178
|
displayName: 'Preferred name',
|
|
223
179
|
description: 'Preferred name field',
|
|
224
180
|
maxLength: 80,
|
|
225
|
-
section:
|
|
181
|
+
section: profileSection,
|
|
226
182
|
});
|
|
227
183
|
|
|
228
184
|
// Remove an existing field from one section, then add a different field there.
|
|
@@ -231,28 +187,27 @@ const preferredName = new TextField(member.object, {
|
|
|
231
187
|
memberLayout
|
|
232
188
|
.removeField('phone__c', {
|
|
233
189
|
tabKey: 'member',
|
|
234
|
-
section:
|
|
190
|
+
section: profileSection,
|
|
235
191
|
removeAll: false,
|
|
236
192
|
})
|
|
237
193
|
.addField(preferredName, {
|
|
238
194
|
tabKey: 'member',
|
|
239
|
-
section:
|
|
195
|
+
section: profileSection,
|
|
240
196
|
position: 2,
|
|
241
197
|
});
|
|
242
198
|
|
|
243
|
-
|
|
244
|
-
const marketingSection = new CustomObjectFieldSection(member.object, {
|
|
199
|
+
const marketingSection = new CustomObjectFieldSection(memberObj, {
|
|
245
200
|
sectionId: 'sec_gm_marketing',
|
|
246
201
|
name: 'Marketing',
|
|
247
202
|
});
|
|
248
|
-
const marketingOptIn = new RadioField(
|
|
203
|
+
const marketingOptIn = new RadioField(memberObj, {
|
|
249
204
|
apiName: 'marketing_opt_in__c',
|
|
250
205
|
displayName: 'Marketing opt-in',
|
|
251
206
|
description: 'Marketing opt-in field',
|
|
252
207
|
options: ['Yes', 'No', 'Unknown'],
|
|
253
208
|
section: marketingSection,
|
|
254
209
|
});
|
|
255
|
-
const referralSource = new TextField(
|
|
210
|
+
const referralSource = new TextField(memberObj, {
|
|
256
211
|
apiName: 'referral_source__c',
|
|
257
212
|
displayName: 'Referral source',
|
|
258
213
|
description: 'Referral source field',
|
|
@@ -263,7 +218,7 @@ const referralSource = new TextField(member.object, {
|
|
|
263
218
|
// Remove one existing section from the layout, then add a different one.
|
|
264
219
|
// The removed section component and its fields remain in the manifest.
|
|
265
220
|
memberLayout
|
|
266
|
-
.removeSection(
|
|
221
|
+
.removeSection(membershipSection, {
|
|
267
222
|
tabKey: 'member',
|
|
268
223
|
removeAll: false,
|
|
269
224
|
})
|