@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,87 +0,0 @@
|
|
|
1
|
-
import { CustomObjectAction, CustomObjectPageLayout, ExistingManifestContext, type ExistingManifestContextOptions, ListViewDef, Rule, Validation } from "../../../../lib/manifest.mjs";
|
|
2
|
-
import type { AnyCustomObjectDefinition } from "../../custom-objects/types.mjs";
|
|
3
|
-
import type { ManifestRegistration } from "./types.mjs";
|
|
4
|
-
/**
|
|
5
|
-
* Typed binding result for one custom object loaded from an existing manifest.
|
|
6
|
-
*
|
|
7
|
-
* This mirrors the registration shape produced by `registerManifestCustomObject(...)`
|
|
8
|
-
* while pointing at already-existing manifest components instead of creating new ones.
|
|
9
|
-
* It is the typed anchor for existing-manifest extension work: callers can keep
|
|
10
|
-
* using typed fields, sections, layouts, rules, validations, and actions that
|
|
11
|
-
* already exist in the manifest, then drop to raw `lib/manifest` classes only
|
|
12
|
-
* when they intentionally need an escape hatch for brand-new manifest-only
|
|
13
|
-
* components that do not yet have a dedicated typed helper.
|
|
14
|
-
*
|
|
15
|
-
* @typeParam TDefinition - Typed custom-object definition bound to the loaded manifest components.
|
|
16
|
-
*/
|
|
17
|
-
export interface ExistingManifestRegistration<TDefinition extends AnyCustomObjectDefinition> extends ManifestRegistration<TDefinition> {
|
|
18
|
-
/** Existing-manifest context that resolved this binding. */
|
|
19
|
-
readonly context: ExistingManifestContext;
|
|
20
|
-
/** Loads one existing list view scoped to this custom object. */
|
|
21
|
-
loadListView(viewId: string): ListViewDef;
|
|
22
|
-
/** Loads one existing page layout scoped to this custom object. */
|
|
23
|
-
loadPageLayout(layoutIdOrApiName: string): CustomObjectPageLayout;
|
|
24
|
-
/** Loads one existing validation rule scoped to this custom object. */
|
|
25
|
-
loadValidation(ruleId: string): Validation;
|
|
26
|
-
/** Loads one existing record-triggered rule scoped to this custom object. */
|
|
27
|
-
loadRule(flowId: string): Rule;
|
|
28
|
-
/** Loads one existing object action scoped to this custom object. */
|
|
29
|
-
loadAction(actionId: string): CustomObjectAction;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Options for {@link bindExistingManifestCustomObject}.
|
|
33
|
-
*
|
|
34
|
-
* @typeParam TDefinition - Typed custom-object definition being bound.
|
|
35
|
-
*/
|
|
36
|
-
export interface BindExistingManifestCustomObjectOptions<TDefinition extends AnyCustomObjectDefinition> extends ExistingManifestContextOptions {
|
|
37
|
-
/** Optional override for the custom-object API name to load. Defaults to `definition.apiName`. */
|
|
38
|
-
readonly customObjectApiName?: TDefinition['apiName'];
|
|
39
|
-
/** Optional override for the category API name to load. Defaults to `definition.categoryApiName`. */
|
|
40
|
-
readonly categoryApiName?: TDefinition['categoryApiName'];
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Options for {@link bindExistingManifestCustomObjects}.
|
|
44
|
-
*
|
|
45
|
-
* @typeParam TDefinitions - Ordered tuple of typed custom-object definitions being bound.
|
|
46
|
-
*/
|
|
47
|
-
export interface BindExistingManifestCustomObjectsOptions<TDefinitions extends readonly AnyCustomObjectDefinition[]> extends ExistingManifestContextOptions {
|
|
48
|
-
/** Ordered tuple of typed custom-object definitions to bind. */
|
|
49
|
-
readonly definitions: TDefinitions;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Registration tuple returned by {@link bindExistingManifestCustomObjects}.
|
|
53
|
-
*
|
|
54
|
-
* @typeParam TDefinitions - Ordered tuple of object definitions that were bound.
|
|
55
|
-
*/
|
|
56
|
-
export type ExistingManifestRegistrationTuple<TDefinitions extends readonly AnyCustomObjectDefinition[]> = {
|
|
57
|
-
readonly [TIndex in keyof TDefinitions]: TDefinitions[TIndex] extends AnyCustomObjectDefinition ? ExistingManifestRegistration<TDefinitions[TIndex]> : never;
|
|
58
|
-
};
|
|
59
|
-
/**
|
|
60
|
-
* Binds one typed custom-object definition to components already present in an existing manifest.
|
|
61
|
-
*
|
|
62
|
-
* Use this helper when you want to mutate an installed or pre-authored manifest
|
|
63
|
-
* through the typed custom-object lane instead of manually loading raw fields,
|
|
64
|
-
* sections, layouts, and actions one by one.
|
|
65
|
-
*
|
|
66
|
-
* Current boundary: this helper rebinds the existing manifest back onto the
|
|
67
|
-
* typed definition so downstream code can stay in logical typed names for the
|
|
68
|
-
* common path, but it does not yet provide a fully typed builder for creating
|
|
69
|
-
* brand-new fields or sections during an existing-manifest edit. When you need
|
|
70
|
-
* that today, use this binding as the typed anchor and then drop to
|
|
71
|
-
* `@rippling/rippling-sdk/lib/manifest` as the explicit escape hatch.
|
|
72
|
-
*
|
|
73
|
-
* @param definition - Typed custom-object definition that should bind to existing manifest components.
|
|
74
|
-
* @param options - Existing-manifest context plus optional API-name overrides.
|
|
75
|
-
* @returns Typed registration-like handle backed by existing manifest components.
|
|
76
|
-
* @typeParam TDefinition - Object definition whose fields and sections should be bound.
|
|
77
|
-
*/
|
|
78
|
-
export declare function bindExistingManifestCustomObject<TDefinition extends AnyCustomObjectDefinition>(definition: TDefinition, options?: BindExistingManifestCustomObjectOptions<TDefinition>): ExistingManifestRegistration<TDefinition>;
|
|
79
|
-
/**
|
|
80
|
-
* Binds multiple typed custom-object definitions to components already present in an existing manifest.
|
|
81
|
-
*
|
|
82
|
-
* @param options - Existing-manifest context plus the ordered tuple of definitions to bind.
|
|
83
|
-
* @returns Ordered tuple of typed registration-like handles backed by existing manifest components.
|
|
84
|
-
* @typeParam TDefinitions - Ordered tuple of object definitions to bind.
|
|
85
|
-
*/
|
|
86
|
-
export declare function bindExistingManifestCustomObjects<TDefinitions extends readonly AnyCustomObjectDefinition[]>(options: BindExistingManifestCustomObjectsOptions<TDefinitions>): ExistingManifestRegistrationTuple<TDefinitions>;
|
|
87
|
-
//# sourceMappingURL=existing.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"existing.d.mts","sourceRoot":"","sources":["../../../../src/core/platform/manifest/custom-objects/existing.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,uBAAuB,EACvB,KAAK,8BAA8B,EACnC,WAAW,EACX,IAAI,EACJ,UAAU,EACX,qCAAiC;AAClC,OAAO,KAAK,EAAE,yBAAyB,EAAc,uCAAmC;AAExF,OAAO,KAAK,EAAE,oBAAoB,EAAE,oBAAgB;AAEpD;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,4BAA4B,CAAC,WAAW,SAAS,yBAAyB,CACzF,SAAQ,oBAAoB,CAAC,WAAW,CAAC;IACzC,4DAA4D;IAC5D,QAAQ,CAAC,OAAO,EAAE,uBAAuB,CAAC;IAC1C,iEAAiE;IACjE,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,CAAC;IAC1C,mEAAmE;IACnE,cAAc,CAAC,iBAAiB,EAAE,MAAM,GAAG,sBAAsB,CAAC;IAClE,uEAAuE;IACvE,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAAC;IAC3C,6EAA6E;IAC7E,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,qEAAqE;IACrE,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,kBAAkB,CAAC;CAClD;AAED;;;;GAIG;AACH,MAAM,WAAW,uCAAuC,CAAC,WAAW,SAAS,yBAAyB,CACpG,SAAQ,8BAA8B;IACtC,kGAAkG;IAClG,QAAQ,CAAC,mBAAmB,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IACtD,qGAAqG;IACrG,QAAQ,CAAC,eAAe,CAAC,EAAE,WAAW,CAAC,iBAAiB,CAAC,CAAC;CAC3D;AAED;;;;GAIG;AACH,MAAM,WAAW,wCAAwC,CACvD,YAAY,SAAS,SAAS,yBAAyB,EAAE,CACzD,SAAQ,8BAA8B;IACtC,gEAAgE;IAChE,QAAQ,CAAC,WAAW,EAAE,YAAY,CAAC;CACpC;AAED;;;;GAIG;AACH,MAAM,MAAM,iCAAiC,CAAC,YAAY,SAAS,SAAS,yBAAyB,EAAE,IAAI;IACzG,QAAQ,EAAE,MAAM,IAAI,MAAM,YAAY,GAAG,YAAY,CAAC,MAAM,CAAC,SAAS,yBAAyB,GAC7F,4BAA4B,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,GAClD,KAAK;CACR,CAAC;AA2CF;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,gCAAgC,CAAC,WAAW,SAAS,yBAAyB,EAC5F,UAAU,EAAE,WAAW,EACvB,OAAO,GAAE,uCAAuC,CAAC,WAAW,CAAM,GACjE,4BAA4B,CAAC,WAAW,CAAC,CA4D3C;AAED;;;;;;GAMG;AACH,wBAAgB,iCAAiC,CAAC,YAAY,SAAS,SAAS,yBAAyB,EAAE,EACzG,OAAO,EAAE,wCAAwC,CAAC,YAAY,CAAC,GAC9D,iCAAiC,CAAC,YAAY,CAAC,CAQjD"}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { CustomObjectAction, CustomObjectPageLayout, ExistingManifestContext, type ExistingManifestContextOptions, ListViewDef, Rule, Validation } from "../../../../lib/manifest.js";
|
|
2
|
-
import type { AnyCustomObjectDefinition } from "../../custom-objects/types.js";
|
|
3
|
-
import type { ManifestRegistration } from "./types.js";
|
|
4
|
-
/**
|
|
5
|
-
* Typed binding result for one custom object loaded from an existing manifest.
|
|
6
|
-
*
|
|
7
|
-
* This mirrors the registration shape produced by `registerManifestCustomObject(...)`
|
|
8
|
-
* while pointing at already-existing manifest components instead of creating new ones.
|
|
9
|
-
* It is the typed anchor for existing-manifest extension work: callers can keep
|
|
10
|
-
* using typed fields, sections, layouts, rules, validations, and actions that
|
|
11
|
-
* already exist in the manifest, then drop to raw `lib/manifest` classes only
|
|
12
|
-
* when they intentionally need an escape hatch for brand-new manifest-only
|
|
13
|
-
* components that do not yet have a dedicated typed helper.
|
|
14
|
-
*
|
|
15
|
-
* @typeParam TDefinition - Typed custom-object definition bound to the loaded manifest components.
|
|
16
|
-
*/
|
|
17
|
-
export interface ExistingManifestRegistration<TDefinition extends AnyCustomObjectDefinition> extends ManifestRegistration<TDefinition> {
|
|
18
|
-
/** Existing-manifest context that resolved this binding. */
|
|
19
|
-
readonly context: ExistingManifestContext;
|
|
20
|
-
/** Loads one existing list view scoped to this custom object. */
|
|
21
|
-
loadListView(viewId: string): ListViewDef;
|
|
22
|
-
/** Loads one existing page layout scoped to this custom object. */
|
|
23
|
-
loadPageLayout(layoutIdOrApiName: string): CustomObjectPageLayout;
|
|
24
|
-
/** Loads one existing validation rule scoped to this custom object. */
|
|
25
|
-
loadValidation(ruleId: string): Validation;
|
|
26
|
-
/** Loads one existing record-triggered rule scoped to this custom object. */
|
|
27
|
-
loadRule(flowId: string): Rule;
|
|
28
|
-
/** Loads one existing object action scoped to this custom object. */
|
|
29
|
-
loadAction(actionId: string): CustomObjectAction;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Options for {@link bindExistingManifestCustomObject}.
|
|
33
|
-
*
|
|
34
|
-
* @typeParam TDefinition - Typed custom-object definition being bound.
|
|
35
|
-
*/
|
|
36
|
-
export interface BindExistingManifestCustomObjectOptions<TDefinition extends AnyCustomObjectDefinition> extends ExistingManifestContextOptions {
|
|
37
|
-
/** Optional override for the custom-object API name to load. Defaults to `definition.apiName`. */
|
|
38
|
-
readonly customObjectApiName?: TDefinition['apiName'];
|
|
39
|
-
/** Optional override for the category API name to load. Defaults to `definition.categoryApiName`. */
|
|
40
|
-
readonly categoryApiName?: TDefinition['categoryApiName'];
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Options for {@link bindExistingManifestCustomObjects}.
|
|
44
|
-
*
|
|
45
|
-
* @typeParam TDefinitions - Ordered tuple of typed custom-object definitions being bound.
|
|
46
|
-
*/
|
|
47
|
-
export interface BindExistingManifestCustomObjectsOptions<TDefinitions extends readonly AnyCustomObjectDefinition[]> extends ExistingManifestContextOptions {
|
|
48
|
-
/** Ordered tuple of typed custom-object definitions to bind. */
|
|
49
|
-
readonly definitions: TDefinitions;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Registration tuple returned by {@link bindExistingManifestCustomObjects}.
|
|
53
|
-
*
|
|
54
|
-
* @typeParam TDefinitions - Ordered tuple of object definitions that were bound.
|
|
55
|
-
*/
|
|
56
|
-
export type ExistingManifestRegistrationTuple<TDefinitions extends readonly AnyCustomObjectDefinition[]> = {
|
|
57
|
-
readonly [TIndex in keyof TDefinitions]: TDefinitions[TIndex] extends AnyCustomObjectDefinition ? ExistingManifestRegistration<TDefinitions[TIndex]> : never;
|
|
58
|
-
};
|
|
59
|
-
/**
|
|
60
|
-
* Binds one typed custom-object definition to components already present in an existing manifest.
|
|
61
|
-
*
|
|
62
|
-
* Use this helper when you want to mutate an installed or pre-authored manifest
|
|
63
|
-
* through the typed custom-object lane instead of manually loading raw fields,
|
|
64
|
-
* sections, layouts, and actions one by one.
|
|
65
|
-
*
|
|
66
|
-
* Current boundary: this helper rebinds the existing manifest back onto the
|
|
67
|
-
* typed definition so downstream code can stay in logical typed names for the
|
|
68
|
-
* common path, but it does not yet provide a fully typed builder for creating
|
|
69
|
-
* brand-new fields or sections during an existing-manifest edit. When you need
|
|
70
|
-
* that today, use this binding as the typed anchor and then drop to
|
|
71
|
-
* `@rippling/rippling-sdk/lib/manifest` as the explicit escape hatch.
|
|
72
|
-
*
|
|
73
|
-
* @param definition - Typed custom-object definition that should bind to existing manifest components.
|
|
74
|
-
* @param options - Existing-manifest context plus optional API-name overrides.
|
|
75
|
-
* @returns Typed registration-like handle backed by existing manifest components.
|
|
76
|
-
* @typeParam TDefinition - Object definition whose fields and sections should be bound.
|
|
77
|
-
*/
|
|
78
|
-
export declare function bindExistingManifestCustomObject<TDefinition extends AnyCustomObjectDefinition>(definition: TDefinition, options?: BindExistingManifestCustomObjectOptions<TDefinition>): ExistingManifestRegistration<TDefinition>;
|
|
79
|
-
/**
|
|
80
|
-
* Binds multiple typed custom-object definitions to components already present in an existing manifest.
|
|
81
|
-
*
|
|
82
|
-
* @param options - Existing-manifest context plus the ordered tuple of definitions to bind.
|
|
83
|
-
* @returns Ordered tuple of typed registration-like handles backed by existing manifest components.
|
|
84
|
-
* @typeParam TDefinitions - Ordered tuple of object definitions to bind.
|
|
85
|
-
*/
|
|
86
|
-
export declare function bindExistingManifestCustomObjects<TDefinitions extends readonly AnyCustomObjectDefinition[]>(options: BindExistingManifestCustomObjectsOptions<TDefinitions>): ExistingManifestRegistrationTuple<TDefinitions>;
|
|
87
|
-
//# sourceMappingURL=existing.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"existing.d.ts","sourceRoot":"","sources":["../../../../src/core/platform/manifest/custom-objects/existing.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,uBAAuB,EACvB,KAAK,8BAA8B,EACnC,WAAW,EACX,IAAI,EACJ,UAAU,EACX,oCAAiC;AAClC,OAAO,KAAK,EAAE,yBAAyB,EAAc,sCAAmC;AAExF,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAgB;AAEpD;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,4BAA4B,CAAC,WAAW,SAAS,yBAAyB,CACzF,SAAQ,oBAAoB,CAAC,WAAW,CAAC;IACzC,4DAA4D;IAC5D,QAAQ,CAAC,OAAO,EAAE,uBAAuB,CAAC;IAC1C,iEAAiE;IACjE,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,CAAC;IAC1C,mEAAmE;IACnE,cAAc,CAAC,iBAAiB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AAY,CAAC,GAC9D,iCAAiC,CAAC,YAAY,CAAC,CAQjD"}
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.bindExistingManifestCustomObject = bindExistingManifestCustomObject;
|
|
4
|
-
exports.bindExistingManifestCustomObjects = bindExistingManifestCustomObjects;
|
|
5
|
-
const existing_manifest_context_1 = require("../../../../lib/manifest/existing-manifest-context.js");
|
|
6
|
-
function resolveSectionId(definition, sectionKey, customObjectApiName, context) {
|
|
7
|
-
const section = definition.sections[sectionKey];
|
|
8
|
-
if (section?.sectionId != null) {
|
|
9
|
-
return section.sectionId;
|
|
10
|
-
}
|
|
11
|
-
const fieldSectionIds = new Set();
|
|
12
|
-
for (const fieldName of Object.keys(definition.fields)) {
|
|
13
|
-
const field = definition.fields[fieldName];
|
|
14
|
-
if (field == null || field.section !== sectionKey)
|
|
15
|
-
continue;
|
|
16
|
-
const loadedField = context.loadField(field.apiName, { customObjectApiName });
|
|
17
|
-
const sectionId = loadedField.getSectionId();
|
|
18
|
-
if (typeof sectionId === 'string' && sectionId.length > 0) {
|
|
19
|
-
fieldSectionIds.add(sectionId);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
if (fieldSectionIds.size === 1) {
|
|
23
|
-
return [...fieldSectionIds][0];
|
|
24
|
-
}
|
|
25
|
-
if (fieldSectionIds.size > 1) {
|
|
26
|
-
throw new Error(`Could not resolve one existing manifest section for key "${sectionKey}" on "${customObjectApiName}". ` +
|
|
27
|
-
`Fields in that section resolved to multiple section ids: ${[...fieldSectionIds]
|
|
28
|
-
.sort()
|
|
29
|
-
.join(', ')}. ` +
|
|
30
|
-
'Add a stable sectionId to the typed definition to disambiguate.');
|
|
31
|
-
}
|
|
32
|
-
throw new Error(`Could not resolve existing manifest section key "${sectionKey}" for "${customObjectApiName}". ` +
|
|
33
|
-
'Add a stable sectionId to the typed definition or ensure at least one field in that section already exists in the manifest.');
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Binds one typed custom-object definition to components already present in an existing manifest.
|
|
37
|
-
*
|
|
38
|
-
* Use this helper when you want to mutate an installed or pre-authored manifest
|
|
39
|
-
* through the typed custom-object lane instead of manually loading raw fields,
|
|
40
|
-
* sections, layouts, and actions one by one.
|
|
41
|
-
*
|
|
42
|
-
* Current boundary: this helper rebinds the existing manifest back onto the
|
|
43
|
-
* typed definition so downstream code can stay in logical typed names for the
|
|
44
|
-
* common path, but it does not yet provide a fully typed builder for creating
|
|
45
|
-
* brand-new fields or sections during an existing-manifest edit. When you need
|
|
46
|
-
* that today, use this binding as the typed anchor and then drop to
|
|
47
|
-
* `@rippling/rippling-sdk/lib/manifest` as the explicit escape hatch.
|
|
48
|
-
*
|
|
49
|
-
* @param definition - Typed custom-object definition that should bind to existing manifest components.
|
|
50
|
-
* @param options - Existing-manifest context plus optional API-name overrides.
|
|
51
|
-
* @returns Typed registration-like handle backed by existing manifest components.
|
|
52
|
-
* @typeParam TDefinition - Object definition whose fields and sections should be bound.
|
|
53
|
-
*/
|
|
54
|
-
function bindExistingManifestCustomObject(definition, options = {}) {
|
|
55
|
-
const context = (0, existing_manifest_context_1.getExistingManifestContext)(options);
|
|
56
|
-
const customObjectApiName = options.customObjectApiName ?? definition.apiName;
|
|
57
|
-
const categoryApiName = options.categoryApiName ?? definition.categoryApiName;
|
|
58
|
-
const category = context.loadCategory(categoryApiName);
|
|
59
|
-
const object = context.loadCustomObject(customObjectApiName);
|
|
60
|
-
const sections = Object.freeze(Object.fromEntries(Object.keys(definition.sections).map((sectionKey) => {
|
|
61
|
-
const sectionId = resolveSectionId(definition, sectionKey, customObjectApiName, context);
|
|
62
|
-
return [
|
|
63
|
-
sectionKey,
|
|
64
|
-
context.loadFieldSection(sectionId, {
|
|
65
|
-
customObjectApiName,
|
|
66
|
-
}),
|
|
67
|
-
];
|
|
68
|
-
})));
|
|
69
|
-
const fields = Object.freeze(Object.fromEntries(Object.keys(definition.fields).map((fieldName) => [
|
|
70
|
-
fieldName,
|
|
71
|
-
context.loadField(definition.fields[fieldName].apiName, {
|
|
72
|
-
customObjectApiName,
|
|
73
|
-
}),
|
|
74
|
-
])));
|
|
75
|
-
return Object.freeze({
|
|
76
|
-
context,
|
|
77
|
-
definition,
|
|
78
|
-
category,
|
|
79
|
-
object,
|
|
80
|
-
sections,
|
|
81
|
-
fields,
|
|
82
|
-
loadListView(viewId) {
|
|
83
|
-
return context.loadListView(viewId, { customObjectApiName });
|
|
84
|
-
},
|
|
85
|
-
loadPageLayout(layoutIdOrApiName) {
|
|
86
|
-
return context.loadPageLayout(layoutIdOrApiName, { customObjectApiName });
|
|
87
|
-
},
|
|
88
|
-
loadValidation(ruleId) {
|
|
89
|
-
return context.loadValidation(ruleId, { customObjectApiName });
|
|
90
|
-
},
|
|
91
|
-
loadRule(flowId) {
|
|
92
|
-
return context.loadRule(flowId, { customObjectApiName });
|
|
93
|
-
},
|
|
94
|
-
loadAction(actionId) {
|
|
95
|
-
return context.loadCustomObjectAction(actionId, { customObjectApiName });
|
|
96
|
-
},
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Binds multiple typed custom-object definitions to components already present in an existing manifest.
|
|
101
|
-
*
|
|
102
|
-
* @param options - Existing-manifest context plus the ordered tuple of definitions to bind.
|
|
103
|
-
* @returns Ordered tuple of typed registration-like handles backed by existing manifest components.
|
|
104
|
-
* @typeParam TDefinitions - Ordered tuple of object definitions to bind.
|
|
105
|
-
*/
|
|
106
|
-
function bindExistingManifestCustomObjects(options) {
|
|
107
|
-
return options.definitions.map((definition) => options.context != null ?
|
|
108
|
-
bindExistingManifestCustomObject(definition, {
|
|
109
|
-
context: options.context,
|
|
110
|
-
})
|
|
111
|
-
: bindExistingManifestCustomObject(definition));
|
|
112
|
-
}
|
|
113
|
-
//# sourceMappingURL=existing.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"exist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1
|
-
import { getExistingManifestContext } from "../../../../lib/manifest/existing-manifest-context.mjs";
|
|
2
|
-
function resolveSectionId(definition, sectionKey, customObjectApiName, context) {
|
|
3
|
-
const section = definition.sections[sectionKey];
|
|
4
|
-
if (section?.sectionId != null) {
|
|
5
|
-
return section.sectionId;
|
|
6
|
-
}
|
|
7
|
-
const fieldSectionIds = new Set();
|
|
8
|
-
for (const fieldName of Object.keys(definition.fields)) {
|
|
9
|
-
const field = definition.fields[fieldName];
|
|
10
|
-
if (field == null || field.section !== sectionKey)
|
|
11
|
-
continue;
|
|
12
|
-
const loadedField = context.loadField(field.apiName, { customObjectApiName });
|
|
13
|
-
const sectionId = loadedField.getSectionId();
|
|
14
|
-
if (typeof sectionId === 'string' && sectionId.length > 0) {
|
|
15
|
-
fieldSectionIds.add(sectionId);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
if (fieldSectionIds.size === 1) {
|
|
19
|
-
return [...fieldSectionIds][0];
|
|
20
|
-
}
|
|
21
|
-
if (fieldSectionIds.size > 1) {
|
|
22
|
-
throw new Error(`Could not resolve one existing manifest section for key "${sectionKey}" on "${customObjectApiName}". ` +
|
|
23
|
-
`Fields in that section resolved to multiple section ids: ${[...fieldSectionIds]
|
|
24
|
-
.sort()
|
|
25
|
-
.join(', ')}. ` +
|
|
26
|
-
'Add a stable sectionId to the typed definition to disambiguate.');
|
|
27
|
-
}
|
|
28
|
-
throw new Error(`Could not resolve existing manifest section key "${sectionKey}" for "${customObjectApiName}". ` +
|
|
29
|
-
'Add a stable sectionId to the typed definition or ensure at least one field in that section already exists in the manifest.');
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Binds one typed custom-object definition to components already present in an existing manifest.
|
|
33
|
-
*
|
|
34
|
-
* Use this helper when you want to mutate an installed or pre-authored manifest
|
|
35
|
-
* through the typed custom-object lane instead of manually loading raw fields,
|
|
36
|
-
* sections, layouts, and actions one by one.
|
|
37
|
-
*
|
|
38
|
-
* Current boundary: this helper rebinds the existing manifest back onto the
|
|
39
|
-
* typed definition so downstream code can stay in logical typed names for the
|
|
40
|
-
* common path, but it does not yet provide a fully typed builder for creating
|
|
41
|
-
* brand-new fields or sections during an existing-manifest edit. When you need
|
|
42
|
-
* that today, use this binding as the typed anchor and then drop to
|
|
43
|
-
* `@rippling/rippling-sdk/lib/manifest` as the explicit escape hatch.
|
|
44
|
-
*
|
|
45
|
-
* @param definition - Typed custom-object definition that should bind to existing manifest components.
|
|
46
|
-
* @param options - Existing-manifest context plus optional API-name overrides.
|
|
47
|
-
* @returns Typed registration-like handle backed by existing manifest components.
|
|
48
|
-
* @typeParam TDefinition - Object definition whose fields and sections should be bound.
|
|
49
|
-
*/
|
|
50
|
-
export function bindExistingManifestCustomObject(definition, options = {}) {
|
|
51
|
-
const context = getExistingManifestContext(options);
|
|
52
|
-
const customObjectApiName = options.customObjectApiName ?? definition.apiName;
|
|
53
|
-
const categoryApiName = options.categoryApiName ?? definition.categoryApiName;
|
|
54
|
-
const category = context.loadCategory(categoryApiName);
|
|
55
|
-
const object = context.loadCustomObject(customObjectApiName);
|
|
56
|
-
const sections = Object.freeze(Object.fromEntries(Object.keys(definition.sections).map((sectionKey) => {
|
|
57
|
-
const sectionId = resolveSectionId(definition, sectionKey, customObjectApiName, context);
|
|
58
|
-
return [
|
|
59
|
-
sectionKey,
|
|
60
|
-
context.loadFieldSection(sectionId, {
|
|
61
|
-
customObjectApiName,
|
|
62
|
-
}),
|
|
63
|
-
];
|
|
64
|
-
})));
|
|
65
|
-
const fields = Object.freeze(Object.fromEntries(Object.keys(definition.fields).map((fieldName) => [
|
|
66
|
-
fieldName,
|
|
67
|
-
context.loadField(definition.fields[fieldName].apiName, {
|
|
68
|
-
customObjectApiName,
|
|
69
|
-
}),
|
|
70
|
-
])));
|
|
71
|
-
return Object.freeze({
|
|
72
|
-
context,
|
|
73
|
-
definition,
|
|
74
|
-
category,
|
|
75
|
-
object,
|
|
76
|
-
sections,
|
|
77
|
-
fields,
|
|
78
|
-
loadListView(viewId) {
|
|
79
|
-
return context.loadListView(viewId, { customObjectApiName });
|
|
80
|
-
},
|
|
81
|
-
loadPageLayout(layoutIdOrApiName) {
|
|
82
|
-
return context.loadPageLayout(layoutIdOrApiName, { customObjectApiName });
|
|
83
|
-
},
|
|
84
|
-
loadValidation(ruleId) {
|
|
85
|
-
return context.loadValidation(ruleId, { customObjectApiName });
|
|
86
|
-
},
|
|
87
|
-
loadRule(flowId) {
|
|
88
|
-
return context.loadRule(flowId, { customObjectApiName });
|
|
89
|
-
},
|
|
90
|
-
loadAction(actionId) {
|
|
91
|
-
return context.loadCustomObjectAction(actionId, { customObjectApiName });
|
|
92
|
-
},
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Binds multiple typed custom-object definitions to components already present in an existing manifest.
|
|
97
|
-
*
|
|
98
|
-
* @param options - Existing-manifest context plus the ordered tuple of definitions to bind.
|
|
99
|
-
* @returns Ordered tuple of typed registration-like handles backed by existing manifest components.
|
|
100
|
-
* @typeParam TDefinitions - Ordered tuple of object definitions to bind.
|
|
101
|
-
*/
|
|
102
|
-
export function bindExistingManifestCustomObjects(options) {
|
|
103
|
-
return options.definitions.map((definition) => options.context != null ?
|
|
104
|
-
bindExistingManifestCustomObject(definition, {
|
|
105
|
-
context: options.context,
|
|
106
|
-
})
|
|
107
|
-
: bindExistingManifestCustomObject(definition));
|
|
108
|
-
}
|
|
109
|
-
//# sourceMappingURL=existing.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"existing.mjs","sourceRoot":"","sources":["../../../../src/core/platform/manifest/custom-objects/existing.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,0BAA0B,EAAE,+DAA2D;AAoEhG,SAAS,gBAAgB,CACvB,UAAuB,EACvB,UAA0D,EAC1D,mBAA2B,EAC3B,OAAgC;IAEhC,MAAM,OAAO,GAAG,UAAU,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;IA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CAAC,MAAc;YACzB,OAAO,OAAO,CAAC,YAAY,CAAC,MAAM,EAAE,EAAE,mBAAmB,EAAE,CAAC,CAAC;QAC/D,CAAC;QACD,cAAc,CAAC,iBAAyB;YACtC,OAAO,OAAO,CAAC,cAAc,CAAC,iBAAiB,EAAE,EAAE,mBAAmB,EAAE,CAAC,CAAC;QAC5E,CAAC;QACD,cAAc,CAAC,MAAc;YAC3B,OAAO,OAAO,CAAC,cAAc,CAAC,MAAM,EAAE,EAAE,mBAAmB,EAAE,CAAC,CAAC;QACjE,CAAC;QACD,QAAQ,CAAC,MAAc;YACrB,OAAO,OAAO,CAAC,QAAQ,CAAC,MAAM,EAAE,EAAE,mBAAmB,EAAE,CAAC,CAAC;QAC3D,CAAC;QACD,UAAU,CAAC,QAAgB;YACzB,OAAO,OAAO,CAAC,sBAAsB,CAAC,QAAQ,EAAE,EAAE,mBAAmB,EAAE,CAAC,CAAC;QAC3E,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,iCAAiC,CAC/C,OAA+D;IAE/D,OAAO,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAC5C,OAAO,CAAC,OAAO,IAAI,IAAI,CAAC,CAAC;QACvB,gCAAgC,CAAC,UAAU,EAAE;YAC3C,OAAO,EAAE,OAAO,CAAC,OAAO;SACzB,CAAC;QACJ,CAAC,CAAC,gCAAgC,CAAC,UAAU,CAAC,CACI,CAAC;AACvD,CAAC"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import type { Field } from "../../../../lib/manifest.mjs";
|
|
2
|
-
import type { AnyCustomObjectDefinition, FieldNames, StandardRecordFields } from "../../custom-objects/types.mjs";
|
|
3
|
-
import type { ManifestRegistration } from "./types.mjs";
|
|
4
|
-
/**
|
|
5
|
-
* Standard field-name strings accepted by typed manifest helpers.
|
|
6
|
-
*
|
|
7
|
-
* These names intentionally use the record-shape snake_case surface rather than
|
|
8
|
-
* the low-level manifest layer's camelCase aliases so authoring stays aligned
|
|
9
|
-
* with typed records, validators, and create/update payload helpers.
|
|
10
|
-
*
|
|
11
|
-
* @typeParam TDefinition - Object definition whose standard record fields should be exposed.
|
|
12
|
-
*/
|
|
13
|
-
export type StandardManifestFieldName<TDefinition extends AnyCustomObjectDefinition> = Extract<keyof StandardRecordFields<TDefinition>, string>;
|
|
14
|
-
/**
|
|
15
|
-
* Field-name strings accepted by typed manifest helpers.
|
|
16
|
-
*
|
|
17
|
-
* The union combines the standard per-record fields present on every custom
|
|
18
|
-
* object with the logical custom-field names declared in the typed schema.
|
|
19
|
-
*
|
|
20
|
-
* @typeParam TDefinition - Object definition whose valid field-name strings should be exposed.
|
|
21
|
-
*/
|
|
22
|
-
export type TypedManifestFieldName<TDefinition extends AnyCustomObjectDefinition> = StandardManifestFieldName<TDefinition> | FieldNames<TDefinition>;
|
|
23
|
-
/**
|
|
24
|
-
* Field inputs accepted by typed manifest helpers.
|
|
25
|
-
*
|
|
26
|
-
* Strings provide object-specific IntelliSense for standard and custom fields.
|
|
27
|
-
* Concrete manifest {@link Field} references remain allowed for computed fields
|
|
28
|
-
* such as summary fields that are created after the base schema is registered.
|
|
29
|
-
*
|
|
30
|
-
* @typeParam TDefinition - Object definition whose manifest field inputs are being authored.
|
|
31
|
-
*/
|
|
32
|
-
export type TypedManifestFieldInput<TDefinition extends AnyCustomObjectDefinition> = TypedManifestFieldName<TDefinition> | Field;
|
|
33
|
-
/**
|
|
34
|
-
* Resolves one typed manifest field input into the concrete manifest {@link Field} instance.
|
|
35
|
-
*
|
|
36
|
-
* Assumptions:
|
|
37
|
-
* - standard field names should autocomplete as snake_case strings
|
|
38
|
-
* - custom typed fields should resolve from the manifest registration returned by
|
|
39
|
-
* the typed manifest registration helper
|
|
40
|
-
* - computed fields like summary fields may still be passed directly as manifest field objects
|
|
41
|
-
*
|
|
42
|
-
* @param registration - Manifest registration produced from the typed object definition.
|
|
43
|
-
* @param field - Typed field input to resolve.
|
|
44
|
-
* @returns Concrete manifest field instance suitable for low-level manifest APIs.
|
|
45
|
-
* @typeParam TDefinition - Object definition whose field reference is being resolved.
|
|
46
|
-
*/
|
|
47
|
-
export declare function resolveTypedManifestField<TDefinition extends AnyCustomObjectDefinition>(registration: ManifestRegistration<TDefinition>, field: TypedManifestFieldInput<TDefinition>): Field;
|
|
48
|
-
//# sourceMappingURL=field-resolution.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"field-resolution.d.mts","sourceRoot":"","sources":["../../../../src/core/platform/manifest/custom-objects/field-resolution.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAoC,KAAK,EAAE,qCAAiC;AACxF,OAAO,KAAK,EAAE,yBAAyB,EAAE,UAAU,EAAE,oBAAoB,EAAE,uCAAmC;AAC9G,OAAO,KAAK,EAAE,oBAAoB,EAAE,oBAAgB;AAgBpD;;;;;;;;GAQG;AACH,MAAM,MAAM,yBAAyB,CAAC,WAAW,SAAS,yBAAyB,IAAI,OAAO,CAC5F,MAAM,oBAAoB,CAAC,WAAW,CAAC,EACvC,MAAM,CACP,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,sBAAsB,CAAC,WAAW,SAAS,yBAAyB,IAC5E,yBAAyB,CAAC,WAAW,CAAC,GACtC,UAAU,CAAC,WAAW,CAAC,CAAC;AAE5B;;;;;;;;GAQG;AACH,MAAM,MAAM,uBAAuB,CAAC,WAAW,SAAS,yBAAyB,IAC7E,sBAAsB,CAAC,WAAW,CAAC,GACnC,KAAK,CAAC;AAiBV;;;;;;;;;;;;;GAaG;AACH,wBAAgB,yBAAyB,CAAC,WAAW,SAAS,yBAAyB,EACrF,YAAY,EAAE,oBAAoB,CAAC,WAAW,CAAC,EAC/C,KAAK,EAAE,uBAAuB,CAAC,WAAW,CAAC,GAC1C,KAAK,CA0BP"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import type { Field } from "../../../../lib/manifest.js";
|
|
2
|
-
import type { AnyCustomObjectDefinition, FieldNames, StandardRecordFields } from "../../custom-objects/types.js";
|
|
3
|
-
import type { ManifestRegistration } from "./types.js";
|
|
4
|
-
/**
|
|
5
|
-
* Standard field-name strings accepted by typed manifest helpers.
|
|
6
|
-
*
|
|
7
|
-
* These names intentionally use the record-shape snake_case surface rather than
|
|
8
|
-
* the low-level manifest layer's camelCase aliases so authoring stays aligned
|
|
9
|
-
* with typed records, validators, and create/update payload helpers.
|
|
10
|
-
*
|
|
11
|
-
* @typeParam TDefinition - Object definition whose standard record fields should be exposed.
|
|
12
|
-
*/
|
|
13
|
-
export type StandardManifestFieldName<TDefinition extends AnyCustomObjectDefinition> = Extract<keyof StandardRecordFields<TDefinition>, string>;
|
|
14
|
-
/**
|
|
15
|
-
* Field-name strings accepted by typed manifest helpers.
|
|
16
|
-
*
|
|
17
|
-
* The union combines the standard per-record fields present on every custom
|
|
18
|
-
* object with the logical custom-field names declared in the typed schema.
|
|
19
|
-
*
|
|
20
|
-
* @typeParam TDefinition - Object definition whose valid field-name strings should be exposed.
|
|
21
|
-
*/
|
|
22
|
-
export type TypedManifestFieldName<TDefinition extends AnyCustomObjectDefinition> = StandardManifestFieldName<TDefinition> | FieldNames<TDefinition>;
|
|
23
|
-
/**
|
|
24
|
-
* Field inputs accepted by typed manifest helpers.
|
|
25
|
-
*
|
|
26
|
-
* Strings provide object-specific IntelliSense for standard and custom fields.
|
|
27
|
-
* Concrete manifest {@link Field} references remain allowed for computed fields
|
|
28
|
-
* such as summary fields that are created after the base schema is registered.
|
|
29
|
-
*
|
|
30
|
-
* @typeParam TDefinition - Object definition whose manifest field inputs are being authored.
|
|
31
|
-
*/
|
|
32
|
-
export type TypedManifestFieldInput<TDefinition extends AnyCustomObjectDefinition> = TypedManifestFieldName<TDefinition> | Field;
|
|
33
|
-
/**
|
|
34
|
-
* Resolves one typed manifest field input into the concrete manifest {@link Field} instance.
|
|
35
|
-
*
|
|
36
|
-
* Assumptions:
|
|
37
|
-
* - standard field names should autocomplete as snake_case strings
|
|
38
|
-
* - custom typed fields should resolve from the manifest registration returned by
|
|
39
|
-
* the typed manifest registration helper
|
|
40
|
-
* - computed fields like summary fields may still be passed directly as manifest field objects
|
|
41
|
-
*
|
|
42
|
-
* @param registration - Manifest registration produced from the typed object definition.
|
|
43
|
-
* @param field - Typed field input to resolve.
|
|
44
|
-
* @returns Concrete manifest field instance suitable for low-level manifest APIs.
|
|
45
|
-
* @typeParam TDefinition - Object definition whose field reference is being resolved.
|
|
46
|
-
*/
|
|
47
|
-
export declare function resolveTypedManifestField<TDefinition extends AnyCustomObjectDefinition>(registration: ManifestRegistration<TDefinition>, field: TypedManifestFieldInput<TDefinition>): Field;
|
|
48
|
-
//# sourceMappingURL=field-resolution.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"field-resolution.d.ts","sourceRoot":"","sources":["../../../../src/core/platform/manifest/custom-objects/field-resolution.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAoC,KAAK,EAAE,oCAAiC;AACxF,OAAO,KAAK,EAAE,yBAAyB,EAAE,UAAU,EAAE,oBAAoB,EAAE,sCAAmC;AAC9G,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAgB;AAgBpD;;;;;;;;GAQG;AACH,MAAM,MAAM,yBAAyB,CAAC,WAAW,SAAS,yBAAyB,IAAI,OAAO,CAC5F,MAAM,oBAAoB,CAAC,WAAW,CAAC,EACvC,MAAM,CACP,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,sBAAsB,CAAC,WAAW,SAAS,yBAAyB,IAC5E,yBAAyB,CAAC,WAAW,CAAC,GACtC,UAAU,CAAC,WAAW,CAAC,CAAC;AAE5B;;;;;;;;GAQG;AACH,MAAM,MAAM,uBAAuB,CAAC,WAAW,SAAS,yBAAyB,IAC7E,sBAAsB,CAAC,WAAW,CAAC,GACnC,KAAK,CAAC;AAiBV;;;;;;;;;;;;;GAaG;AACH,wBAAgB,yBAAyB,CAAC,WAAW,SAAS,yBAAyB,EACrF,YAAY,EAAE,oBAAoB,CAAC,WAAW,CAAC,EAC/C,KAAK,EAAE,uBAAuB,CAAC,WAAW,CAAC,GAC1C,KAAK,CA0BP"}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.resolveTypedManifestField = resolveTypedManifestField;
|
|
4
|
-
const STANDARD_TYPED_MANIFEST_FIELD_NAMES = [
|
|
5
|
-
'id',
|
|
6
|
-
'name',
|
|
7
|
-
'created_at',
|
|
8
|
-
'updated_at',
|
|
9
|
-
'system_updated_at',
|
|
10
|
-
'external_id',
|
|
11
|
-
'owner_role',
|
|
12
|
-
'created_by',
|
|
13
|
-
'last_modified_by',
|
|
14
|
-
];
|
|
15
|
-
const STANDARD_TYPED_MANIFEST_FIELD_NAME_SET = new Set(STANDARD_TYPED_MANIFEST_FIELD_NAMES);
|
|
16
|
-
/**
|
|
17
|
-
* Type-safe `hasOwnProperty` helper for typed manifest field resolution.
|
|
18
|
-
*
|
|
19
|
-
* @param value - Object whose own properties should be checked.
|
|
20
|
-
* @param key - Candidate property key.
|
|
21
|
-
* @returns Whether the object owns that property.
|
|
22
|
-
* @typeParam TObject - Object type being narrowed.
|
|
23
|
-
*/
|
|
24
|
-
function hasOwn(value, key) {
|
|
25
|
-
return Object.prototype.hasOwnProperty.call(value, key);
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Resolves one typed manifest field input into the concrete manifest {@link Field} instance.
|
|
29
|
-
*
|
|
30
|
-
* Assumptions:
|
|
31
|
-
* - standard field names should autocomplete as snake_case strings
|
|
32
|
-
* - custom typed fields should resolve from the manifest registration returned by
|
|
33
|
-
* the typed manifest registration helper
|
|
34
|
-
* - computed fields like summary fields may still be passed directly as manifest field objects
|
|
35
|
-
*
|
|
36
|
-
* @param registration - Manifest registration produced from the typed object definition.
|
|
37
|
-
* @param field - Typed field input to resolve.
|
|
38
|
-
* @returns Concrete manifest field instance suitable for low-level manifest APIs.
|
|
39
|
-
* @typeParam TDefinition - Object definition whose field reference is being resolved.
|
|
40
|
-
*/
|
|
41
|
-
function resolveTypedManifestField(registration, field) {
|
|
42
|
-
if (typeof field !== 'string')
|
|
43
|
-
return field;
|
|
44
|
-
const matchesCustomField = hasOwn(registration.fields, field);
|
|
45
|
-
const matchesStandardField = STANDARD_TYPED_MANIFEST_FIELD_NAME_SET.has(field);
|
|
46
|
-
if (matchesCustomField && matchesStandardField) {
|
|
47
|
-
throw new Error(`Field name "${field}" is ambiguous on "${registration.definition.apiName}" because it matches both a standard field and a custom field. ` +
|
|
48
|
-
'Pass an explicit manifest field reference instead.');
|
|
49
|
-
}
|
|
50
|
-
if (matchesCustomField)
|
|
51
|
-
return registration.fields[field];
|
|
52
|
-
if (matchesStandardField) {
|
|
53
|
-
return registration.object.standardField(field);
|
|
54
|
-
}
|
|
55
|
-
const validFieldNames = [
|
|
56
|
-
...STANDARD_TYPED_MANIFEST_FIELD_NAMES,
|
|
57
|
-
...Object.keys(registration.fields).sort(),
|
|
58
|
-
];
|
|
59
|
-
throw new Error(`Unknown field name "${field}" for "${registration.definition.apiName}". Valid field names: ${validFieldNames.join(', ')}.`);
|
|
60
|
-
}
|
|
61
|
-
//# sourceMappingURL=field-resolution.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"field-resolution.js","sourceRoot":"","sources":["../../../../src/core/platform/manifest/custom-objects/field-resolution.ts"],"names":[],"mappings":";;AAsFA,8DA6BC;AA/GD,MAAM,mCAAmC,GAAG;IAC1C,IAAI;IACJ,MAAM;IACN,YAAY;IACZ,YAAY;IACZ,mBAAmB;IACnB,aAAa;IACb,YAAY;IACZ,YAAY;IACZ,kBAAkB;CACgE,CAAC;AAErF,MAAM,sCAAsC,GAAG,IAAI,GAAG,CAAS,mCAAmC,CAAC,CAAC;AAyCpG;;;;;;;GAOG;AACH,SAAS,MAA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