@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,194 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.resolveTypedSduiStatePath = resolveTypedSduiStatePath;
|
|
4
|
-
exports.defineTypedSduiStateAssignments = defineTypedSduiStateAssignments;
|
|
5
|
-
exports.createTypedSduiPageSpecOutput = createTypedSduiPageSpecOutput;
|
|
6
|
-
exports.createTypedSduiPageResponse = createTypedSduiPageResponse;
|
|
7
|
-
exports.createTypedSduiPageSpecResponse = createTypedSduiPageSpecResponse;
|
|
8
|
-
exports.createTypedSduiPageBadRequestResponse = createTypedSduiPageBadRequestResponse;
|
|
9
|
-
exports.createTypedSduiPageServerErrorResponse = createTypedSduiPageServerErrorResponse;
|
|
10
|
-
exports.defineTypedSduiPageHandler = defineTypedSduiPageHandler;
|
|
11
|
-
exports.defineTypedSduiPageHandlerFor = defineTypedSduiPageHandlerFor;
|
|
12
|
-
exports.createTypedSduiMutationTrigger = createTypedSduiMutationTrigger;
|
|
13
|
-
const pebble_sdui_web_1 = require("@rippling/pebble-sdui-web");
|
|
14
|
-
const custom_apps_1 = require("@rippling/pebble-sdui-web/catalogs/custom-apps");
|
|
15
|
-
const functions_1 = require("../../../../functions.js");
|
|
16
|
-
/** Returns a typed SDUI page-state path resolver that preserves literal path inference. */
|
|
17
|
-
function resolveTypedSduiStatePath() {
|
|
18
|
-
return (path) => path;
|
|
19
|
-
}
|
|
20
|
-
/** Returns one typed SDUI page-state assignment map as-is while preserving compile-time validation. */
|
|
21
|
-
function defineTypedSduiStateAssignments(assignments) {
|
|
22
|
-
return assignments;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Serializes one rendered SDUI spec into the standard function output shape.
|
|
26
|
-
*
|
|
27
|
-
* @param spec - Rendered SDUI spec object that should be JSON-serialized.
|
|
28
|
-
* @returns Standard SDUI spec output payload.
|
|
29
|
-
*/
|
|
30
|
-
function createTypedSduiPageSpecOutput(spec) {
|
|
31
|
-
return { spec: JSON.stringify(spec) };
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Builds one successful SDUI page-function response.
|
|
35
|
-
*
|
|
36
|
-
* @param body - Response body to return to the platform.
|
|
37
|
-
* @param options - Optional response metadata such as status code, headers, or message.
|
|
38
|
-
* @returns Typed function response.
|
|
39
|
-
* @typeParam TBody - Body shape returned by the function.
|
|
40
|
-
*/
|
|
41
|
-
function createTypedSduiPageResponse(body, options = {}) {
|
|
42
|
-
return new functions_1.FunctionResponse({
|
|
43
|
-
body,
|
|
44
|
-
statusCode: options.statusCode ?? 200,
|
|
45
|
-
headers: options.headers ?? {},
|
|
46
|
-
message: options.message ?? '',
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Builds the standard SDUI page-function response for one rendered page spec.
|
|
51
|
-
*
|
|
52
|
-
* @param spec - Rendered SDUI spec object that should be JSON-serialized.
|
|
53
|
-
* @returns Typed function response containing `body.spec`.
|
|
54
|
-
* @typeParam TOutput - Output union that includes the standard spec payload.
|
|
55
|
-
*/
|
|
56
|
-
function createTypedSduiPageSpecResponse(spec) {
|
|
57
|
-
return createTypedSduiPageResponse(createTypedSduiPageSpecOutput(spec));
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Builds a 400 SDUI page-function error response.
|
|
61
|
-
*
|
|
62
|
-
* @param message - Human-readable error message.
|
|
63
|
-
* @returns Typed function response containing the standard error payload.
|
|
64
|
-
* @typeParam TOutput - Output union that includes the standard error payload.
|
|
65
|
-
*/
|
|
66
|
-
function createTypedSduiPageBadRequestResponse(message) {
|
|
67
|
-
return createTypedSduiPageResponse({ error: message }, {
|
|
68
|
-
statusCode: 400,
|
|
69
|
-
message,
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Builds a 500 SDUI page-function error response from one thrown value.
|
|
74
|
-
*
|
|
75
|
-
* @param error - Unknown thrown value that should be normalized to a message.
|
|
76
|
-
* @returns Typed function response containing the standard error payload.
|
|
77
|
-
* @typeParam TOutput - Output union that includes the standard error payload.
|
|
78
|
-
*/
|
|
79
|
-
function createTypedSduiPageServerErrorResponse(error) {
|
|
80
|
-
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
81
|
-
return createTypedSduiPageResponse({ error: message }, {
|
|
82
|
-
statusCode: 500,
|
|
83
|
-
message,
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
function hasOwnActionHandler(actions, action) {
|
|
87
|
-
return Object.prototype.hasOwnProperty.call(actions, action);
|
|
88
|
-
}
|
|
89
|
-
function buildTypedSduiPageHandler(options) {
|
|
90
|
-
const initAction = (options.initAction ?? 'init');
|
|
91
|
-
return async (event, context) => {
|
|
92
|
-
const roleId = context.function.role_id;
|
|
93
|
-
if (options.requireRoleId === true && !roleId) {
|
|
94
|
-
return createTypedSduiPageBadRequestResponse(options.missingRoleIdMessage ?? 'Role ID is required');
|
|
95
|
-
}
|
|
96
|
-
try {
|
|
97
|
-
const runtime = await options.createRuntime(context);
|
|
98
|
-
const action = String(event.parameters.action);
|
|
99
|
-
if (action === initAction) {
|
|
100
|
-
const spec = await options.init({
|
|
101
|
-
event,
|
|
102
|
-
context,
|
|
103
|
-
params: event.parameters,
|
|
104
|
-
runtime,
|
|
105
|
-
roleId: roleId,
|
|
106
|
-
});
|
|
107
|
-
return createTypedSduiPageSpecResponse(spec);
|
|
108
|
-
}
|
|
109
|
-
if (!hasOwnActionHandler(options.actions, action)) {
|
|
110
|
-
return createTypedSduiPageBadRequestResponse(options.unknownActionMessage?.(action) ?? `Unknown action: ${action}`);
|
|
111
|
-
}
|
|
112
|
-
const stateUpdate = await options.actions[action]({
|
|
113
|
-
event,
|
|
114
|
-
context,
|
|
115
|
-
params: event.parameters,
|
|
116
|
-
runtime,
|
|
117
|
-
roleId: roleId,
|
|
118
|
-
});
|
|
119
|
-
return createTypedSduiPageResponse(stateUpdate);
|
|
120
|
-
}
|
|
121
|
-
catch (error) {
|
|
122
|
-
return createTypedSduiPageServerErrorResponse(error);
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* Defines one typed SDUI page handler with a shared runtime, one init action,
|
|
128
|
-
* and a typed action-dispatch table for follow-up state updates.
|
|
129
|
-
*
|
|
130
|
-
* The returned handler still accepts the normal `(event, context)` signature, so
|
|
131
|
-
* callers can keep an exported `onRipplingEvent(...)` function declaration that
|
|
132
|
-
* backend IO-contract derivation understands while removing the repetitive
|
|
133
|
-
* action-routing / response-wrapping boilerplate from the function body.
|
|
134
|
-
*
|
|
135
|
-
* @param options - Handler configuration including init renderer, runtime factory, and action dispatch table.
|
|
136
|
-
* @returns Handler function that returns typed SDUI spec / state / error responses.
|
|
137
|
-
* @typeParam TParameters - SDUI page parameter union discriminated by `action`.
|
|
138
|
-
* @typeParam TRuntime - Shared runtime created once per invocation.
|
|
139
|
-
* @typeParam TStateUpdate - State payload returned for follow-up actions.
|
|
140
|
-
* @typeParam TInitAction - Action string that renders the initial SDUI spec.
|
|
141
|
-
* @typeParam TRequireRoleId - Whether callback args should require `roleId`.
|
|
142
|
-
*/
|
|
143
|
-
function defineTypedSduiPageHandler(options) {
|
|
144
|
-
return buildTypedSduiPageHandler(options);
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* Creates one parameter-first SDUI page-handler builder that fixes the action
|
|
148
|
-
* union and state-update payload up front, then infers the shared runtime type
|
|
149
|
-
* from `createRuntime(...)` when the returned builder is called.
|
|
150
|
-
*
|
|
151
|
-
* This is the intended golden path for normal page-function authoring: specify
|
|
152
|
-
* the discriminated input union and returned state payload once, then let the
|
|
153
|
-
* runtime object and `requireRoleId` behavior infer from the provided options.
|
|
154
|
-
*
|
|
155
|
-
* @returns Builder that accepts typed SDUI page-handler options.
|
|
156
|
-
* @typeParam TParameters - SDUI page parameter union discriminated by `action`.
|
|
157
|
-
* @typeParam TStateUpdate - State payload returned for follow-up actions.
|
|
158
|
-
*/
|
|
159
|
-
function defineTypedSduiPageHandlerFor() {
|
|
160
|
-
return (options) => buildTypedSduiPageHandler(options);
|
|
161
|
-
}
|
|
162
|
-
function createTypedSduiMutationTrigger(options) {
|
|
163
|
-
const mutationStatePath = options.mutationStatePath ?? '/isMutating';
|
|
164
|
-
const errorStatePath = options.errorStatePath ?? '/errorMessage';
|
|
165
|
-
const triggerParams = {
|
|
166
|
-
functionId: options.functionId,
|
|
167
|
-
inputs: options.inputs,
|
|
168
|
-
responsePath: options.responsePath,
|
|
169
|
-
};
|
|
170
|
-
const triggerOptions = {
|
|
171
|
-
onSuccess: {
|
|
172
|
-
set: {
|
|
173
|
-
[errorStatePath]: '',
|
|
174
|
-
[mutationStatePath]: false,
|
|
175
|
-
...(options.onSuccessState ?? {}),
|
|
176
|
-
},
|
|
177
|
-
},
|
|
178
|
-
onError: {
|
|
179
|
-
set: {
|
|
180
|
-
[errorStatePath]: options.errorMessage,
|
|
181
|
-
[mutationStatePath]: false,
|
|
182
|
-
...(options.onErrorState ?? {}),
|
|
183
|
-
},
|
|
184
|
-
},
|
|
185
|
-
};
|
|
186
|
-
return [
|
|
187
|
-
(0, custom_apps_1.setState)({
|
|
188
|
-
statePath: mutationStatePath,
|
|
189
|
-
value: true,
|
|
190
|
-
}),
|
|
191
|
-
(0, pebble_sdui_web_1.buildAction)('triggerFunction', triggerParams, triggerOptions),
|
|
192
|
-
];
|
|
193
|
-
}
|
|
194
|
-
//# sourceMappingURL=sdui-page.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sdui-page.js","sourceRoot":"","sources":["../../../../src/core/platform/manifest/custom-objects/sdui-page.ts"],"names":[],"mappings":";;AAqDA,8DAEC;AAGD,0EAIC;AA+BD,sEAIC;AAUD,kEAUC;AASD,0EAKC;AASD,sFAOC;AASD,wFAQC;AA+ND,gEAUC;AAeD,sEAiBC;AAmDD,wEAkCC;AAlgBD,+DAAgG;AAChG,gFAA0E;AAC1E,wDAK+B;AA6C/B,2FAA2F;AAC3F,SAAgB,yBAAyB;IACvC,OAAO,CAA2C,IAAW,EAAS,EAAE,CAAC,IAAI,CAAC;AAChF,CAAC;AAED,uGAAuG;AACvG,SAAgB,+BAA+B,CAC7C,WAA8C;IAE9C,OAAO,WAAW,CAAC;AACrB,CAAC;AAyBD;;;;;GAKG;AACH,SAAgB,6BAA6B,CAC3C,IAAW;IAEX,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;AACxC,CAAC;AAED;;;;;;;GAOG;AACH,SAAgB,2BAA2B,CACzC,IAAW,EACX,UAAwD,EAAE;IAE1D,OAAO,IAAI,4BAAgB,CAAQ;QACjC,IAAI;QACJ,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,GAAG;QACrC,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,EAAE;QAC9B,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,EAAE;KAC/B,CAAC,CAAC;AACL,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,+BAA+B,CAG7C,IAAW;IACX,OAAO,2BAA2B,CAAC,6BAA6B,CAAC,IAAI,CAAY,CAAC,CAAC;AACrF,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,qCAAqC,CACnD,OAAe;IAEf,OAAO,2BAA2B,CAAC,EAAE,KAAK,EAAE,OAAO,EAAa,EAAE;QAChE,UAAU,EAAE,GAA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,GAAkB;QACpC,SAAS,EAAE;YACT,GAAG,EAAE;gBACH,CAAC,cAAc,CAAC,EAAE,EAAE;gBACpB,CAAC,iBAAiB,CAAC,EAAE,KAAK;gBAC1B,GAAG,CAAC,OAAO,CAAC,cAAc,IAAI,EAAE,CAAC;aAClC;SACF;QACD,OAAO,EAAE;YACP,GAAG,EAAE;gBACH,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC,YAAY;gBACtC,CAAC,iBAAiB,CAAC,EAAE,KAAK;gBAC1B,GAAG,CAAC,OAAO,CAAC,YAAY,IAAI,EAAE,CAAC;aAChC;SACF;KACF,CAAC;IAEF,OAAO;QACL,IAAA,sBAAQ,EAAC;YACP,SAAS,EAAE,iBAAiB;YAC5B,KAAK,EAAE,IAAI;SACZ,CAAC;QACF,IAAA,6BAAW,EAAC,iBAAiB,EAAE,aAAa,EAAE,cAAc,CAAC;KAC9D,CAAC;AACJ,CAAC"}
|
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
import { buildAction } from '@rippling/pebble-sdui-web';
|
|
2
|
-
import { setState } from '@rippling/pebble-sdui-web/catalogs/custom-apps';
|
|
3
|
-
import { FunctionResponse, } from "../../../../functions.mjs";
|
|
4
|
-
/** Returns a typed SDUI page-state path resolver that preserves literal path inference. */
|
|
5
|
-
export function resolveTypedSduiStatePath() {
|
|
6
|
-
return (path) => path;
|
|
7
|
-
}
|
|
8
|
-
/** Returns one typed SDUI page-state assignment map as-is while preserving compile-time validation. */
|
|
9
|
-
export function defineTypedSduiStateAssignments(assignments) {
|
|
10
|
-
return assignments;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Serializes one rendered SDUI spec into the standard function output shape.
|
|
14
|
-
*
|
|
15
|
-
* @param spec - Rendered SDUI spec object that should be JSON-serialized.
|
|
16
|
-
* @returns Standard SDUI spec output payload.
|
|
17
|
-
*/
|
|
18
|
-
export function createTypedSduiPageSpecOutput(spec) {
|
|
19
|
-
return { spec: JSON.stringify(spec) };
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Builds one successful SDUI page-function response.
|
|
23
|
-
*
|
|
24
|
-
* @param body - Response body to return to the platform.
|
|
25
|
-
* @param options - Optional response metadata such as status code, headers, or message.
|
|
26
|
-
* @returns Typed function response.
|
|
27
|
-
* @typeParam TBody - Body shape returned by the function.
|
|
28
|
-
*/
|
|
29
|
-
export function createTypedSduiPageResponse(body, options = {}) {
|
|
30
|
-
return new FunctionResponse({
|
|
31
|
-
body,
|
|
32
|
-
statusCode: options.statusCode ?? 200,
|
|
33
|
-
headers: options.headers ?? {},
|
|
34
|
-
message: options.message ?? '',
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Builds the standard SDUI page-function response for one rendered page spec.
|
|
39
|
-
*
|
|
40
|
-
* @param spec - Rendered SDUI spec object that should be JSON-serialized.
|
|
41
|
-
* @returns Typed function response containing `body.spec`.
|
|
42
|
-
* @typeParam TOutput - Output union that includes the standard spec payload.
|
|
43
|
-
*/
|
|
44
|
-
export function createTypedSduiPageSpecResponse(spec) {
|
|
45
|
-
return createTypedSduiPageResponse(createTypedSduiPageSpecOutput(spec));
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Builds a 400 SDUI page-function error response.
|
|
49
|
-
*
|
|
50
|
-
* @param message - Human-readable error message.
|
|
51
|
-
* @returns Typed function response containing the standard error payload.
|
|
52
|
-
* @typeParam TOutput - Output union that includes the standard error payload.
|
|
53
|
-
*/
|
|
54
|
-
export function createTypedSduiPageBadRequestResponse(message) {
|
|
55
|
-
return createTypedSduiPageResponse({ error: message }, {
|
|
56
|
-
statusCode: 400,
|
|
57
|
-
message,
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Builds a 500 SDUI page-function error response from one thrown value.
|
|
62
|
-
*
|
|
63
|
-
* @param error - Unknown thrown value that should be normalized to a message.
|
|
64
|
-
* @returns Typed function response containing the standard error payload.
|
|
65
|
-
* @typeParam TOutput - Output union that includes the standard error payload.
|
|
66
|
-
*/
|
|
67
|
-
export function createTypedSduiPageServerErrorResponse(error) {
|
|
68
|
-
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
69
|
-
return createTypedSduiPageResponse({ error: message }, {
|
|
70
|
-
statusCode: 500,
|
|
71
|
-
message,
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
function hasOwnActionHandler(actions, action) {
|
|
75
|
-
return Object.prototype.hasOwnProperty.call(actions, action);
|
|
76
|
-
}
|
|
77
|
-
function buildTypedSduiPageHandler(options) {
|
|
78
|
-
const initAction = (options.initAction ?? 'init');
|
|
79
|
-
return async (event, context) => {
|
|
80
|
-
const roleId = context.function.role_id;
|
|
81
|
-
if (options.requireRoleId === true && !roleId) {
|
|
82
|
-
return createTypedSduiPageBadRequestResponse(options.missingRoleIdMessage ?? 'Role ID is required');
|
|
83
|
-
}
|
|
84
|
-
try {
|
|
85
|
-
const runtime = await options.createRuntime(context);
|
|
86
|
-
const action = String(event.parameters.action);
|
|
87
|
-
if (action === initAction) {
|
|
88
|
-
const spec = await options.init({
|
|
89
|
-
event,
|
|
90
|
-
context,
|
|
91
|
-
params: event.parameters,
|
|
92
|
-
runtime,
|
|
93
|
-
roleId: roleId,
|
|
94
|
-
});
|
|
95
|
-
return createTypedSduiPageSpecResponse(spec);
|
|
96
|
-
}
|
|
97
|
-
if (!hasOwnActionHandler(options.actions, action)) {
|
|
98
|
-
return createTypedSduiPageBadRequestResponse(options.unknownActionMessage?.(action) ?? `Unknown action: ${action}`);
|
|
99
|
-
}
|
|
100
|
-
const stateUpdate = await options.actions[action]({
|
|
101
|
-
event,
|
|
102
|
-
context,
|
|
103
|
-
params: event.parameters,
|
|
104
|
-
runtime,
|
|
105
|
-
roleId: roleId,
|
|
106
|
-
});
|
|
107
|
-
return createTypedSduiPageResponse(stateUpdate);
|
|
108
|
-
}
|
|
109
|
-
catch (error) {
|
|
110
|
-
return createTypedSduiPageServerErrorResponse(error);
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* Defines one typed SDUI page handler with a shared runtime, one init action,
|
|
116
|
-
* and a typed action-dispatch table for follow-up state updates.
|
|
117
|
-
*
|
|
118
|
-
* The returned handler still accepts the normal `(event, context)` signature, so
|
|
119
|
-
* callers can keep an exported `onRipplingEvent(...)` function declaration that
|
|
120
|
-
* backend IO-contract derivation understands while removing the repetitive
|
|
121
|
-
* action-routing / response-wrapping boilerplate from the function body.
|
|
122
|
-
*
|
|
123
|
-
* @param options - Handler configuration including init renderer, runtime factory, and action dispatch table.
|
|
124
|
-
* @returns Handler function that returns typed SDUI spec / state / error responses.
|
|
125
|
-
* @typeParam TParameters - SDUI page parameter union discriminated by `action`.
|
|
126
|
-
* @typeParam TRuntime - Shared runtime created once per invocation.
|
|
127
|
-
* @typeParam TStateUpdate - State payload returned for follow-up actions.
|
|
128
|
-
* @typeParam TInitAction - Action string that renders the initial SDUI spec.
|
|
129
|
-
* @typeParam TRequireRoleId - Whether callback args should require `roleId`.
|
|
130
|
-
*/
|
|
131
|
-
export function defineTypedSduiPageHandler(options) {
|
|
132
|
-
return buildTypedSduiPageHandler(options);
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* Creates one parameter-first SDUI page-handler builder that fixes the action
|
|
136
|
-
* union and state-update payload up front, then infers the shared runtime type
|
|
137
|
-
* from `createRuntime(...)` when the returned builder is called.
|
|
138
|
-
*
|
|
139
|
-
* This is the intended golden path for normal page-function authoring: specify
|
|
140
|
-
* the discriminated input union and returned state payload once, then let the
|
|
141
|
-
* runtime object and `requireRoleId` behavior infer from the provided options.
|
|
142
|
-
*
|
|
143
|
-
* @returns Builder that accepts typed SDUI page-handler options.
|
|
144
|
-
* @typeParam TParameters - SDUI page parameter union discriminated by `action`.
|
|
145
|
-
* @typeParam TStateUpdate - State payload returned for follow-up actions.
|
|
146
|
-
*/
|
|
147
|
-
export function defineTypedSduiPageHandlerFor() {
|
|
148
|
-
return (options) => buildTypedSduiPageHandler(options);
|
|
149
|
-
}
|
|
150
|
-
export function createTypedSduiMutationTrigger(options) {
|
|
151
|
-
const mutationStatePath = options.mutationStatePath ?? '/isMutating';
|
|
152
|
-
const errorStatePath = options.errorStatePath ?? '/errorMessage';
|
|
153
|
-
const triggerParams = {
|
|
154
|
-
functionId: options.functionId,
|
|
155
|
-
inputs: options.inputs,
|
|
156
|
-
responsePath: options.responsePath,
|
|
157
|
-
};
|
|
158
|
-
const triggerOptions = {
|
|
159
|
-
onSuccess: {
|
|
160
|
-
set: {
|
|
161
|
-
[errorStatePath]: '',
|
|
162
|
-
[mutationStatePath]: false,
|
|
163
|
-
...(options.onSuccessState ?? {}),
|
|
164
|
-
},
|
|
165
|
-
},
|
|
166
|
-
onError: {
|
|
167
|
-
set: {
|
|
168
|
-
[errorStatePath]: options.errorMessage,
|
|
169
|
-
[mutationStatePath]: false,
|
|
170
|
-
...(options.onErrorState ?? {}),
|
|
171
|
-
},
|
|
172
|
-
},
|
|
173
|
-
};
|
|
174
|
-
return [
|
|
175
|
-
setState({
|
|
176
|
-
statePath: mutationStatePath,
|
|
177
|
-
value: true,
|
|
178
|
-
}),
|
|
179
|
-
buildAction('triggerFunction', triggerParams, triggerOptions),
|
|
180
|
-
];
|
|
181
|
-
}
|
|
182
|
-
//# sourceMappingURL=sdui-page.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sdui-page.mjs","sourceRoot":"","sources":["../../../../src/core/platform/manifest/custom-objects/sdui-page.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAA0C,MAAM,2BAA2B,CAAC;AAChG,OAAO,EAAE,QAAQ,EAAE,MAAM,gDAAgD,CAAC;AAC1E,OAAO,EACL,gBAAgB,GAIjB,kCAA8B;AA6C/B,2FAA2F;AAC3F,MAAM,UAAU,yBAAyB;IACvC,OAAO,CAA2C,IAAW,EAAS,EAAE,CAAC,IAAI,CAAC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O;QACL,QAAQ,CAAC;YACP,SAAS,EAAE,iBAAiB;YAC5B,KAAK,EAAE,IAAI;SACZ,CAAC;QACF,WAAW,CAAC,iBAAiB,EAAE,aAAa,EAAE,cAAc,CAAC;KAC9D,CAAC;AACJ,CAAC"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { AnyCustomObjectDefinition, FieldNames } from "../../custom-objects/types.mjs";
|
|
2
|
-
import type { ManifestConditionFragment, ManifestCustomObjectTarget } from "./conditions.mjs";
|
|
3
|
-
declare const STANDARD_TYPED_CONDITION_FIELDS: readonly ["id", "name", "created_at", "updated_at", "system_updated_at", "external_id", "owner_role", "created_by", "last_modified_by"];
|
|
4
|
-
/** Standard field-name strings accepted by {@link typedCondition}. */
|
|
5
|
-
export type ParsedConditionStandardFieldName<TDefinition extends AnyCustomObjectDefinition> = (typeof STANDARD_TYPED_CONDITION_FIELDS)[number];
|
|
6
|
-
/** Field-name strings accepted by {@link typedCondition}. */
|
|
7
|
-
export type ParsedConditionFieldName<TDefinition extends AnyCustomObjectDefinition> = ParsedConditionStandardFieldName<TDefinition> | FieldNames<TDefinition>;
|
|
8
|
-
/**
|
|
9
|
-
* Parses one constrained logical-name manifest-condition string, validates it against the typed custom-object definition,
|
|
10
|
-
* and renders a backend-ready manifest condition that uses wire-level field API names.
|
|
11
|
-
*
|
|
12
|
-
* Supported parsed-string manifest-condition contract:
|
|
13
|
-
* - standard record fields and local custom-object fields
|
|
14
|
-
* - `==`, `!=`, `<`, `<=`, `>`, `>=`, `IN`, `NOT_IN`
|
|
15
|
-
* - `AND`, `OR`, `NOT`
|
|
16
|
-
* - parentheses / grouping
|
|
17
|
-
* - string / number / boolean / null / array literals
|
|
18
|
-
* - `TODAY()`
|
|
19
|
-
*
|
|
20
|
-
* @param target - Object definition or manifest registration whose logical field names should be enforced.
|
|
21
|
-
* @param expression - Constrained logical-name manifest-condition source string to parse and render.
|
|
22
|
-
* @returns Opaque manifest-condition fragment that can be passed anywhere typed manifest helpers accept conditions.
|
|
23
|
-
* @typeParam TDefinition - Object definition whose field names and value categories should be enforced.
|
|
24
|
-
* @typeParam TExpression - Candidate manifest-condition expression string.
|
|
25
|
-
*/
|
|
26
|
-
export declare function typedCondition<TDefinition extends AnyCustomObjectDefinition, TExpression extends string>(target: ManifestCustomObjectTarget<TDefinition>, expression: TExpression): ManifestConditionFragment;
|
|
27
|
-
export {};
|
|
28
|
-
//# sourceMappingURL=typed-condition.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"typed-condition.d.mts","sourceRoot":"","sources":["../../../../src/core/platform/manifest/custom-objects/typed-condition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,UAAU,EAAE,uCAAmC;AACxF,OAAO,KAAK,EAEV,yBAAyB,EACzB,0BAA0B,EAC3B,yBAAqB;AAGtB,QAAA,MAAM,+BAA+B,yIAU3B,CAAC;AAIX,sEAAsE;AACtE,MAAM,MAAM,gCAAgC,CAAC,WAAW,SAAS,yBAAyB,IACxF,CAAC,OAAO,+BAA+B,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnD,6DAA6D;AAC7D,MAAM,MAAM,wBAAwB,CAAC,WAAW,SAAS,yBAAyB,IAC9E,gCAAgC,CAAC,WAAW,CAAC,GAC7C,UAAU,CAAC,WAAW,CAAC,CAAC;AAijB5B;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,cAAc,CAAC,WAAW,SAAS,yBAAyB,EAAE,WAAW,SAAS,MAAM,EACtG,MAAM,EAAE,0BAA0B,CAAC,WAAW,CAAC,EAC/C,UAAU,EAAE,WAAW,GACtB,yBAAyB,CAK3B"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { AnyCustomObjectDefinition, FieldNames } from "../../custom-objects/types.js";
|
|
2
|
-
import type { ManifestConditionFragment, ManifestCustomObjectTarget } from "./conditions.js";
|
|
3
|
-
declare const STANDARD_TYPED_CONDITION_FIELDS: readonly ["id", "name", "created_at", "updated_at", "system_updated_at", "external_id", "owner_role", "created_by", "last_modified_by"];
|
|
4
|
-
/** Standard field-name strings accepted by {@link typedCondition}. */
|
|
5
|
-
export type ParsedConditionStandardFieldName<TDefinition extends AnyCustomObjectDefinition> = (typeof STANDARD_TYPED_CONDITION_FIELDS)[number];
|
|
6
|
-
/** Field-name strings accepted by {@link typedCondition}. */
|
|
7
|
-
export type ParsedConditionFieldName<TDefinition extends AnyCustomObjectDefinition> = ParsedConditionStandardFieldName<TDefinition> | FieldNames<TDefinition>;
|
|
8
|
-
/**
|
|
9
|
-
* Parses one constrained logical-name manifest-condition string, validates it against the typed custom-object definition,
|
|
10
|
-
* and renders a backend-ready manifest condition that uses wire-level field API names.
|
|
11
|
-
*
|
|
12
|
-
* Supported parsed-string manifest-condition contract:
|
|
13
|
-
* - standard record fields and local custom-object fields
|
|
14
|
-
* - `==`, `!=`, `<`, `<=`, `>`, `>=`, `IN`, `NOT_IN`
|
|
15
|
-
* - `AND`, `OR`, `NOT`
|
|
16
|
-
* - parentheses / grouping
|
|
17
|
-
* - string / number / boolean / null / array literals
|
|
18
|
-
* - `TODAY()`
|
|
19
|
-
*
|
|
20
|
-
* @param target - Object definition or manifest registration whose logical field names should be enforced.
|
|
21
|
-
* @param expression - Constrained logical-name manifest-condition source string to parse and render.
|
|
22
|
-
* @returns Opaque manifest-condition fragment that can be passed anywhere typed manifest helpers accept conditions.
|
|
23
|
-
* @typeParam TDefinition - Object definition whose field names and value categories should be enforced.
|
|
24
|
-
* @typeParam TExpression - Candidate manifest-condition expression string.
|
|
25
|
-
*/
|
|
26
|
-
export declare function typedCondition<TDefinition extends AnyCustomObjectDefinition, TExpression extends string>(target: ManifestCustomObjectTarget<TDefinition>, expression: TExpression): ManifestConditionFragment;
|
|
27
|
-
export {};
|
|
28
|
-
//# sourceMappingURL=typed-condition.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"typed-condition.d.ts","sourceRoot":"","sources":["../../../../src/core/platform/manifest/custom-objects/typed-condition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,UAAU,EAAE,sCAAmC;AACxF,OAAO,KAAK,EAEV,yBAAyB,EACzB,0BAA0B,EAC3B,wBAAqB;AAGtB,QAAA,MAAM,+BAA+B,yIAU3B,CAAC;AAIX,sEAAsE;AACtE,MAAM,MAAM,gCAAgC,CAAC,WAAW,SAAS,yBAAyB,IACxF,CAAC,OAAO,+BAA+B,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnD,6DAA6D;AAC7D,MAAM,MAAM,wBAAwB,CAAC,WAAW,SAAS,yBAAyB,IAC9E,gCAAgC,CAAC,WAAW,CAAC,GAC7C,UAAU,CAAC,WAAW,CAAC,CAAC;AAijB5B;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,cAAc,CAAC,WAAW,SAAS,yBAAyB,EAAE,WAAW,SAAS,MAAM,EACtG,MAAM,EAAE,0BAA0B,CAAC,WAAW,CAAC,EAC/C,UAAU,EAAE,WAAW,GACtB,yBAAyB,CAK3B"}
|