@rippling/rippling-sdk 0.2.0-alpha.85 → 0.2.0-alpha.87
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client.d.mts +15 -0
- package/client.d.mts.map +1 -1
- package/client.d.ts +15 -0
- package/client.d.ts.map +1 -1
- package/client.js +15 -0
- package/client.js.map +1 -1
- package/client.mjs +15 -0
- package/client.mjs.map +1 -1
- package/core/platform/custom-objects/category.d.mts +125 -0
- package/core/platform/custom-objects/category.d.mts.map +1 -0
- package/core/platform/custom-objects/category.d.ts +125 -0
- package/core/platform/custom-objects/category.d.ts.map +1 -0
- package/core/platform/custom-objects/category.js +188 -0
- package/core/platform/custom-objects/category.js.map +1 -0
- package/core/platform/custom-objects/category.mjs +178 -0
- package/core/platform/custom-objects/category.mjs.map +1 -0
- package/core/platform/custom-objects/definition.d.mts +147 -0
- package/core/platform/custom-objects/definition.d.mts.map +1 -0
- package/core/platform/custom-objects/definition.d.ts +147 -0
- package/core/platform/custom-objects/definition.d.ts.map +1 -0
- package/core/platform/custom-objects/definition.js +200 -0
- package/core/platform/custom-objects/definition.js.map +1 -0
- package/core/platform/custom-objects/definition.mjs +190 -0
- package/core/platform/custom-objects/definition.mjs.map +1 -0
- package/core/platform/custom-objects/fields.d.mts +302 -0
- package/core/platform/custom-objects/fields.d.mts.map +1 -0
- package/core/platform/custom-objects/fields.d.ts +302 -0
- package/core/platform/custom-objects/fields.d.ts.map +1 -0
- package/core/platform/custom-objects/fields.js +369 -0
- package/core/platform/custom-objects/fields.js.map +1 -0
- package/core/platform/custom-objects/fields.mjs +347 -0
- package/core/platform/custom-objects/fields.mjs.map +1 -0
- package/core/platform/custom-objects/function-runtime.d.mts +42 -0
- package/core/platform/custom-objects/function-runtime.d.mts.map +1 -0
- package/core/platform/custom-objects/function-runtime.d.ts +42 -0
- package/core/platform/custom-objects/function-runtime.d.ts.map +1 -0
- package/core/platform/custom-objects/function-runtime.js +38 -0
- package/core/platform/custom-objects/function-runtime.js.map +1 -0
- package/core/platform/custom-objects/function-runtime.mjs +35 -0
- package/core/platform/custom-objects/function-runtime.mjs.map +1 -0
- package/core/platform/custom-objects/lifecycle.d.mts +83 -0
- package/core/platform/custom-objects/lifecycle.d.mts.map +1 -0
- package/core/platform/custom-objects/lifecycle.d.ts +83 -0
- package/core/platform/custom-objects/lifecycle.d.ts.map +1 -0
- package/core/platform/custom-objects/lifecycle.js +372 -0
- package/core/platform/custom-objects/lifecycle.js.map +1 -0
- package/core/platform/custom-objects/lifecycle.mjs +367 -0
- package/core/platform/custom-objects/lifecycle.mjs.map +1 -0
- package/core/platform/custom-objects/manager.d.mts +354 -0
- package/core/platform/custom-objects/manager.d.mts.map +1 -0
- package/core/platform/custom-objects/manager.d.ts +354 -0
- package/core/platform/custom-objects/manager.d.ts.map +1 -0
- package/core/platform/custom-objects/manager.js +646 -0
- package/core/platform/custom-objects/manager.js.map +1 -0
- package/core/platform/custom-objects/manager.mjs +637 -0
- package/core/platform/custom-objects/manager.mjs.map +1 -0
- package/core/platform/custom-objects/provisioning.d.mts +138 -0
- package/core/platform/custom-objects/provisioning.d.mts.map +1 -0
- package/core/platform/custom-objects/provisioning.d.ts +138 -0
- package/core/platform/custom-objects/provisioning.d.ts.map +1 -0
- package/core/platform/custom-objects/provisioning.js +455 -0
- package/core/platform/custom-objects/provisioning.js.map +1 -0
- package/core/platform/custom-objects/provisioning.mjs +447 -0
- package/core/platform/custom-objects/provisioning.mjs.map +1 -0
- package/core/platform/custom-objects/rql.d.mts +122 -0
- package/core/platform/custom-objects/rql.d.mts.map +1 -0
- package/core/platform/custom-objects/rql.d.ts +122 -0
- package/core/platform/custom-objects/rql.d.ts.map +1 -0
- package/core/platform/custom-objects/rql.js +225 -0
- package/core/platform/custom-objects/rql.js.map +1 -0
- package/core/platform/custom-objects/rql.mjs +222 -0
- package/core/platform/custom-objects/rql.mjs.map +1 -0
- package/core/platform/custom-objects/schema-manager.d.mts +203 -0
- package/core/platform/custom-objects/schema-manager.d.mts.map +1 -0
- package/core/platform/custom-objects/schema-manager.d.ts +203 -0
- package/core/platform/custom-objects/schema-manager.d.ts.map +1 -0
- package/core/platform/custom-objects/schema-manager.js +256 -0
- package/core/platform/custom-objects/schema-manager.js.map +1 -0
- package/core/platform/custom-objects/schema-manager.mjs +249 -0
- package/core/platform/custom-objects/schema-manager.mjs.map +1 -0
- package/core/platform/custom-objects/typed-rql.d.mts +157 -0
- package/core/platform/custom-objects/typed-rql.d.mts.map +1 -0
- package/core/platform/custom-objects/typed-rql.d.ts +157 -0
- package/core/platform/custom-objects/typed-rql.d.ts.map +1 -0
- package/core/platform/custom-objects/typed-rql.js +583 -0
- package/core/platform/custom-objects/typed-rql.js.map +1 -0
- package/core/platform/custom-objects/typed-rql.mjs +580 -0
- package/core/platform/custom-objects/typed-rql.mjs.map +1 -0
- package/core/platform/custom-objects/types.d.mts +549 -0
- package/core/platform/custom-objects/types.d.mts.map +1 -0
- package/core/platform/custom-objects/types.d.ts +549 -0
- package/core/platform/custom-objects/types.d.ts.map +1 -0
- package/core/platform/custom-objects/types.js +20 -0
- package/core/platform/custom-objects/types.js.map +1 -0
- package/core/platform/custom-objects/types.mjs +17 -0
- package/core/platform/custom-objects/types.mjs.map +1 -0
- package/core/platform/custom-objects/validation.d.mts +97 -0
- package/core/platform/custom-objects/validation.d.mts.map +1 -0
- package/core/platform/custom-objects/validation.d.ts +97 -0
- package/core/platform/custom-objects/validation.d.ts.map +1 -0
- package/core/platform/custom-objects/validation.js +477 -0
- package/core/platform/custom-objects/validation.js.map +1 -0
- package/core/platform/custom-objects/validation.mjs +465 -0
- package/core/platform/custom-objects/validation.mjs.map +1 -0
- package/core/platform/custom-objects.d.mts +67 -0
- package/core/platform/custom-objects.d.mts.map +1 -0
- package/core/platform/custom-objects.d.ts +67 -0
- package/core/platform/custom-objects.d.ts.map +1 -0
- package/core/platform/custom-objects.js +118 -0
- package/core/platform/custom-objects.js.map +1 -0
- package/core/platform/custom-objects.mjs +45 -0
- package/core/platform/custom-objects.mjs.map +1 -0
- package/lib/leave-programs/advanced.d.mts +5 -0
- package/lib/leave-programs/advanced.d.mts.map +1 -0
- package/lib/leave-programs/advanced.d.ts +5 -0
- package/lib/leave-programs/advanced.d.ts.map +1 -0
- package/lib/leave-programs/advanced.js +13 -0
- package/lib/leave-programs/advanced.js.map +1 -0
- package/lib/leave-programs/advanced.mjs +4 -0
- package/lib/leave-programs/advanced.mjs.map +1 -0
- package/lib/leave-programs/context.d.mts +3 -0
- package/lib/leave-programs/context.d.mts.map +1 -0
- package/lib/leave-programs/context.d.ts +3 -0
- package/lib/leave-programs/context.d.ts.map +1 -0
- package/lib/leave-programs/context.js +89 -0
- package/lib/leave-programs/context.js.map +1 -0
- package/lib/leave-programs/context.mjs +86 -0
- package/lib/leave-programs/context.mjs.map +1 -0
- package/lib/leave-programs/define-company-leave-program.d.mts +3 -0
- package/lib/leave-programs/define-company-leave-program.d.mts.map +1 -0
- package/lib/leave-programs/define-company-leave-program.d.ts +3 -0
- package/lib/leave-programs/define-company-leave-program.d.ts.map +1 -0
- package/lib/leave-programs/define-company-leave-program.js +47 -0
- package/lib/leave-programs/define-company-leave-program.js.map +1 -0
- package/lib/leave-programs/define-company-leave-program.mjs +44 -0
- package/lib/leave-programs/define-company-leave-program.mjs.map +1 -0
- package/lib/leave-programs/duration.d.mts +5 -0
- package/lib/leave-programs/duration.d.mts.map +1 -0
- package/lib/leave-programs/duration.d.ts +5 -0
- package/lib/leave-programs/duration.d.ts.map +1 -0
- package/lib/leave-programs/duration.js +21 -0
- package/lib/leave-programs/duration.js.map +1 -0
- package/lib/leave-programs/duration.mjs +16 -0
- package/lib/leave-programs/duration.mjs.map +1 -0
- package/lib/leave-programs/pay.d.mts +4 -0
- package/lib/leave-programs/pay.d.mts.map +1 -0
- package/lib/leave-programs/pay.d.ts +4 -0
- package/lib/leave-programs/pay.d.ts.map +1 -0
- package/lib/leave-programs/pay.js +20 -0
- package/lib/leave-programs/pay.js.map +1 -0
- package/lib/leave-programs/pay.mjs +16 -0
- package/lib/leave-programs/pay.mjs.map +1 -0
- package/lib/leave-programs/policy-builder.d.mts +20 -0
- package/lib/leave-programs/policy-builder.d.mts.map +1 -0
- package/lib/leave-programs/policy-builder.d.ts +20 -0
- package/lib/leave-programs/policy-builder.d.ts.map +1 -0
- package/lib/leave-programs/policy-builder.js +89 -0
- package/lib/leave-programs/policy-builder.js.map +1 -0
- package/lib/leave-programs/policy-builder.mjs +85 -0
- package/lib/leave-programs/policy-builder.mjs.map +1 -0
- package/lib/leave-programs/recipes/parental-top-up-policy.d.mts +25 -0
- package/lib/leave-programs/recipes/parental-top-up-policy.d.mts.map +1 -0
- package/lib/leave-programs/recipes/parental-top-up-policy.d.ts +25 -0
- package/lib/leave-programs/recipes/parental-top-up-policy.d.ts.map +1 -0
- package/lib/leave-programs/recipes/parental-top-up-policy.js +56 -0
- package/lib/leave-programs/recipes/parental-top-up-policy.js.map +1 -0
- package/lib/leave-programs/recipes/parental-top-up-policy.mjs +53 -0
- package/lib/leave-programs/recipes/parental-top-up-policy.mjs.map +1 -0
- package/lib/leave-programs/testing.d.mts +8 -0
- package/lib/leave-programs/testing.d.mts.map +1 -0
- package/lib/leave-programs/testing.d.ts +8 -0
- package/lib/leave-programs/testing.d.ts.map +1 -0
- package/lib/leave-programs/testing.js +11 -0
- package/lib/leave-programs/testing.js.map +1 -0
- package/lib/leave-programs/testing.mjs +7 -0
- package/lib/leave-programs/testing.mjs.map +1 -0
- package/lib/leave-programs/types.d.mts +223 -0
- package/lib/leave-programs/types.d.mts.map +1 -0
- package/lib/leave-programs/types.d.ts +223 -0
- package/lib/leave-programs/types.d.ts.map +1 -0
- package/lib/leave-programs/types.js +10 -0
- package/lib/leave-programs/types.js.map +1 -0
- package/lib/leave-programs/types.mjs +7 -0
- package/lib/leave-programs/types.mjs.map +1 -0
- package/lib/leave-programs.d.mts +7 -0
- package/lib/leave-programs.d.mts.map +1 -0
- package/lib/leave-programs.d.ts +7 -0
- package/lib/leave-programs.d.ts.map +1 -0
- package/lib/leave-programs.js +19 -0
- package/lib/leave-programs.js.map +1 -0
- package/lib/leave-programs.mjs +7 -0
- package/lib/leave-programs.mjs.map +1 -0
- package/package.json +1 -1
- package/resources/agents/agents.d.mts +208 -0
- package/resources/agents/agents.d.mts.map +1 -0
- package/resources/agents/agents.d.ts +208 -0
- package/resources/agents/agents.d.ts.map +1 -0
- package/resources/agents/agents.js +64 -0
- package/resources/agents/agents.js.map +1 -0
- package/resources/agents/agents.mjs +59 -0
- package/resources/agents/agents.mjs.map +1 -0
- package/resources/agents/deployments.d.mts +180 -0
- package/resources/agents/deployments.d.mts.map +1 -0
- package/resources/agents/deployments.d.ts +180 -0
- package/resources/agents/deployments.d.ts.map +1 -0
- package/resources/agents/deployments.js +32 -0
- package/resources/agents/deployments.js.map +1 -0
- package/resources/agents/deployments.mjs +28 -0
- package/resources/agents/deployments.mjs.map +1 -0
- package/resources/agents/index.d.mts +5 -0
- package/resources/agents/index.d.mts.map +1 -0
- package/resources/agents/index.d.ts +5 -0
- package/resources/agents/index.d.ts.map +1 -0
- package/resources/agents/index.js +13 -0
- package/resources/agents/index.js.map +1 -0
- package/resources/agents/index.mjs +6 -0
- package/resources/agents/index.mjs.map +1 -0
- package/resources/agents/sessions/events.d.mts +80 -0
- package/resources/agents/sessions/events.d.mts.map +1 -0
- package/resources/agents/sessions/events.d.ts +80 -0
- package/resources/agents/sessions/events.d.ts.map +1 -0
- package/resources/agents/sessions/events.js +19 -0
- package/resources/agents/sessions/events.js.map +1 -0
- package/resources/agents/sessions/events.mjs +15 -0
- package/resources/agents/sessions/events.mjs.map +1 -0
- package/resources/agents/sessions/index.d.mts +3 -0
- package/resources/agents/sessions/index.d.mts.map +1 -0
- package/resources/agents/sessions/index.d.ts +3 -0
- package/resources/agents/sessions/index.d.ts.map +1 -0
- package/resources/agents/sessions/index.js +9 -0
- package/resources/agents/sessions/index.js.map +1 -0
- package/resources/agents/sessions/index.mjs +4 -0
- package/resources/agents/sessions/index.mjs.map +1 -0
- package/resources/agents/sessions/sessions.d.mts +153 -0
- package/resources/agents/sessions/sessions.d.mts.map +1 -0
- package/resources/agents/sessions/sessions.d.ts +153 -0
- package/resources/agents/sessions/sessions.d.ts.map +1 -0
- package/resources/agents/sessions/sessions.js +44 -0
- package/resources/agents/sessions/sessions.js.map +1 -0
- package/resources/agents/sessions/sessions.mjs +39 -0
- package/resources/agents/sessions/sessions.mjs.map +1 -0
- package/resources/agents/sessions.d.mts +2 -0
- package/resources/agents/sessions.d.mts.map +1 -0
- package/resources/agents/sessions.d.ts +2 -0
- package/resources/agents/sessions.d.ts.map +1 -0
- package/resources/agents/sessions.js +6 -0
- package/resources/agents/sessions.js.map +1 -0
- package/resources/agents/sessions.mjs +3 -0
- package/resources/agents/sessions.mjs.map +1 -0
- package/resources/agents/source-revisions.d.mts +195 -0
- package/resources/agents/source-revisions.d.mts.map +1 -0
- package/resources/agents/source-revisions.d.ts +195 -0
- package/resources/agents/source-revisions.d.ts.map +1 -0
- package/resources/agents/source-revisions.js +32 -0
- package/resources/agents/source-revisions.js.map +1 -0
- package/resources/agents/source-revisions.mjs +28 -0
- package/resources/agents/source-revisions.mjs.map +1 -0
- package/resources/agents.d.mts +2 -0
- package/resources/agents.d.mts.map +1 -0
- package/resources/agents.d.ts +2 -0
- package/resources/agents.d.ts.map +1 -0
- package/resources/agents.js +6 -0
- package/resources/agents.js.map +1 -0
- package/resources/agents.mjs +3 -0
- package/resources/agents.mjs.map +1 -0
- package/resources/break-policies.d.mts +1 -1
- package/resources/break-policies.d.ts +1 -1
- package/resources/break-policies.js +1 -1
- package/resources/break-policies.mjs +1 -1
- package/resources/break-types.d.mts +1 -1
- package/resources/break-types.d.ts +1 -1
- package/resources/break-types.js +1 -1
- package/resources/break-types.mjs +1 -1
- package/resources/business-structure-paths.d.mts +1 -1
- package/resources/business-structure-paths.d.ts +1 -1
- package/resources/business-structure-paths.js +1 -1
- package/resources/business-structure-paths.mjs +1 -1
- package/resources/candidate-applications.d.mts +1 -1
- package/resources/candidate-applications.d.ts +1 -1
- package/resources/candidate-applications.js +1 -1
- package/resources/candidate-applications.mjs +1 -1
- package/resources/candidates.d.mts +1 -1
- package/resources/candidates.d.ts +1 -1
- package/resources/candidates.js +1 -1
- package/resources/candidates.mjs +1 -1
- package/resources/company-legal-entities.d.mts +1 -1
- package/resources/company-legal-entities.d.ts +1 -1
- package/resources/company-legal-entities.js +1 -1
- package/resources/company-legal-entities.mjs +1 -1
- package/resources/company-legal-entity-workers.d.mts +1 -1
- package/resources/company-legal-entity-workers.d.ts +1 -1
- package/resources/company-legal-entity-workers.js +1 -1
- package/resources/company-legal-entity-workers.mjs +1 -1
- package/resources/compensation-bands-details.d.mts +1 -1
- package/resources/compensation-bands-details.d.ts +1 -1
- package/resources/compensation-bands-details.js +1 -1
- package/resources/compensation-bands-details.mjs +1 -1
- package/resources/compensations.d.mts +1 -1
- package/resources/compensations.d.ts +1 -1
- package/resources/compensations.js +1 -1
- package/resources/compensations.mjs +1 -1
- package/resources/custom-objects/custom-objects.d.mts +7 -0
- package/resources/custom-objects/custom-objects.d.mts.map +1 -1
- package/resources/custom-objects/custom-objects.d.ts +7 -0
- 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 +129 -54
- package/resources/custom-objects/fields.d.mts.map +1 -1
- package/resources/custom-objects/fields.d.ts +129 -54
- package/resources/custom-objects/fields.d.ts.map +1 -1
- package/resources/device-orders.d.mts +1 -1
- package/resources/device-orders.d.ts +1 -1
- package/resources/device-orders.js +1 -1
- package/resources/device-orders.mjs +1 -1
- package/resources/devices.d.mts +1 -1
- package/resources/devices.d.ts +1 -1
- package/resources/devices.js +1 -1
- package/resources/devices.mjs +1 -1
- package/resources/functions/deployments.d.mts +2 -2
- package/resources/functions/deployments.d.ts +2 -2
- package/resources/functions/deployments.js +2 -2
- package/resources/functions/deployments.mjs +2 -2
- package/resources/functions/executions.d.mts +2 -2
- package/resources/functions/executions.d.ts +2 -2
- package/resources/functions/executions.js +2 -2
- package/resources/functions/executions.mjs +2 -2
- package/resources/functions/functions.d.mts +1 -1
- package/resources/functions/functions.d.ts +1 -1
- package/resources/functions/functions.js +1 -1
- package/resources/functions/functions.mjs +1 -1
- package/resources/headcount-positions.d.mts +1 -1
- package/resources/headcount-positions.d.ts +1 -1
- package/resources/headcount-positions.js +1 -1
- package/resources/headcount-positions.mjs +1 -1
- package/resources/headcount-priorities.d.mts +1 -1
- package/resources/headcount-priorities.d.ts +1 -1
- package/resources/headcount-priorities.js +1 -1
- package/resources/headcount-priorities.mjs +1 -1
- package/resources/index.d.mts +3 -0
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +3 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +8 -2
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +3 -0
- package/resources/index.mjs.map +1 -1
- package/resources/job-assignments.d.mts +2 -2
- package/resources/job-assignments.d.ts +2 -2
- package/resources/job-assignments.js +2 -2
- package/resources/job-assignments.mjs +2 -2
- package/resources/job-codes.d.mts +2 -2
- package/resources/job-codes.d.ts +2 -2
- package/resources/job-codes.js +2 -2
- package/resources/job-codes.mjs +2 -2
- package/resources/job-dimensions.d.mts +1 -1
- package/resources/job-dimensions.d.ts +1 -1
- package/resources/job-dimensions.js +1 -1
- package/resources/job-dimensions.mjs +1 -1
- package/resources/job-pay-rate-exceptions.d.mts +2 -2
- package/resources/job-pay-rate-exceptions.d.ts +2 -2
- package/resources/job-pay-rate-exceptions.js +2 -2
- package/resources/job-pay-rate-exceptions.mjs +2 -2
- package/resources/job-requisitions.d.mts +1 -1
- package/resources/job-requisitions.d.ts +1 -1
- package/resources/job-requisitions.js +1 -1
- package/resources/job-requisitions.mjs +1 -1
- package/resources/kiosk-badges.d.mts +1 -1
- package/resources/kiosk-badges.d.ts +1 -1
- package/resources/kiosk-badges.js +1 -1
- package/resources/kiosk-badges.mjs +1 -1
- package/resources/leave-accruals.d.mts +1 -1
- package/resources/leave-accruals.d.ts +1 -1
- package/resources/leave-accruals.js +1 -1
- package/resources/leave-accruals.mjs +1 -1
- package/resources/leave-balances.d.mts +1 -1
- package/resources/leave-balances.d.ts +1 -1
- package/resources/leave-balances.js +1 -1
- package/resources/leave-balances.mjs +1 -1
- package/resources/leave-requests.d.mts +1 -1
- package/resources/leave-requests.d.ts +1 -1
- package/resources/leave-requests.js +1 -1
- package/resources/leave-requests.mjs +1 -1
- package/resources/leave-types.d.mts +1 -1
- package/resources/leave-types.d.ts +1 -1
- package/resources/leave-types.js +1 -1
- package/resources/leave-types.mjs +1 -1
- package/resources/legal-entities.d.mts +1 -1
- package/resources/legal-entities.d.ts +1 -1
- package/resources/legal-entities.js +1 -1
- package/resources/legal-entities.mjs +1 -1
- package/resources/levels.d.mts +26 -5
- package/resources/levels.d.mts.map +1 -1
- package/resources/levels.d.ts +26 -5
- package/resources/levels.d.ts.map +1 -1
- package/resources/levels.js +1 -1
- package/resources/levels.mjs +1 -1
- package/resources/location-factors.d.mts +1 -1
- package/resources/location-factors.d.ts +1 -1
- package/resources/location-factors.js +1 -1
- package/resources/location-factors.mjs +1 -1
- package/resources/packages/index.d.mts +3 -0
- package/resources/packages/index.d.mts.map +1 -0
- package/resources/packages/index.d.ts +3 -0
- package/resources/packages/index.d.ts.map +1 -0
- package/resources/packages/index.js +9 -0
- package/resources/packages/index.js.map +1 -0
- package/resources/packages/index.mjs +4 -0
- package/resources/packages/index.mjs.map +1 -0
- package/resources/packages/packages.d.mts +239 -0
- package/resources/packages/packages.d.mts.map +1 -0
- package/resources/packages/packages.d.ts +239 -0
- package/resources/packages/packages.d.ts.map +1 -0
- package/resources/packages/packages.js +60 -0
- package/resources/packages/packages.js.map +1 -0
- package/resources/packages/packages.mjs +55 -0
- package/resources/packages/packages.mjs.map +1 -0
- package/resources/packages/versions.d.mts +72 -0
- package/resources/packages/versions.d.mts.map +1 -0
- package/resources/packages/versions.d.ts +72 -0
- package/resources/packages/versions.d.ts.map +1 -0
- package/resources/packages/versions.js +19 -0
- package/resources/packages/versions.js.map +1 -0
- package/resources/packages/versions.mjs +15 -0
- package/resources/packages/versions.mjs.map +1 -0
- package/resources/packages.d.mts +2 -0
- package/resources/packages.d.mts.map +1 -0
- package/resources/packages.d.ts +2 -0
- package/resources/packages.d.ts.map +1 -0
- package/resources/packages.js +6 -0
- package/resources/packages.js.map +1 -0
- package/resources/packages.mjs +3 -0
- package/resources/packages.mjs.map +1 -0
- package/resources/scheduled-job-assignments.d.mts +1 -1
- package/resources/scheduled-job-assignments.d.ts +1 -1
- package/resources/scheduled-job-assignments.js +1 -1
- package/resources/scheduled-job-assignments.mjs +1 -1
- package/resources/schedules.d.mts +1 -1
- package/resources/schedules.d.ts +1 -1
- package/resources/schedules.js +1 -1
- package/resources/schedules.mjs +1 -1
- package/resources/shift-assignments.d.mts +1 -1
- package/resources/shift-assignments.d.ts +1 -1
- package/resources/shift-assignments.js +1 -1
- package/resources/shift-assignments.mjs +1 -1
- package/resources/shift-inputs.d.mts +1 -1
- package/resources/shift-inputs.d.ts +1 -1
- package/resources/shift-inputs.js +1 -1
- package/resources/shift-inputs.mjs +1 -1
- package/resources/shiftassignments.d.mts +1 -1
- package/resources/shiftassignments.d.ts +1 -1
- package/resources/shiftassignments.js +1 -1
- package/resources/shiftassignments.mjs +1 -1
- package/resources/sites.d.mts +572 -0
- package/resources/sites.d.mts.map +1 -0
- package/resources/sites.d.ts +572 -0
- package/resources/sites.d.ts.map +1 -0
- package/resources/sites.js +154 -0
- package/resources/sites.js.map +1 -0
- package/resources/sites.mjs +150 -0
- package/resources/sites.mjs.map +1 -0
- package/resources/software-deployments.d.mts +1 -1
- package/resources/software-deployments.d.ts +1 -1
- package/resources/software-deployments.js +1 -1
- package/resources/software-deployments.mjs +1 -1
- package/resources/time-cards.d.mts +1 -1
- package/resources/time-cards.d.ts +1 -1
- package/resources/time-cards.js +1 -1
- package/resources/time-cards.mjs +1 -1
- package/resources/time-entries.d.mts +1 -1
- package/resources/time-entries.d.ts +1 -1
- package/resources/time-entries.js +1 -1
- package/resources/time-entries.mjs +1 -1
- package/resources/tracks.d.mts +1 -1
- package/resources/tracks.d.ts +1 -1
- package/resources/tracks.js +1 -1
- package/resources/tracks.mjs +1 -1
- package/resources/unassigned-shifts.d.mts +2 -2
- package/resources/unassigned-shifts.d.ts +2 -2
- package/resources/unassigned-shifts.js +2 -2
- package/resources/unassigned-shifts.mjs +2 -2
- package/resources/unassignedshifts.d.mts +1 -1
- package/resources/unassignedshifts.d.ts +1 -1
- package/resources/unassignedshifts.js +1 -1
- package/resources/unassignedshifts.mjs +1 -1
- package/resources/worker-time-splits.d.mts +1 -1
- package/resources/worker-time-splits.d.ts +1 -1
- package/resources/worker-time-splits.js +1 -1
- package/resources/worker-time-splits.mjs +1 -1
- package/src/client.ts +91 -0
- package/src/core/platform/custom-objects/category.ts +294 -0
- package/src/core/platform/custom-objects/definition.ts +373 -0
- package/src/core/platform/custom-objects/fields.ts +653 -0
- package/src/core/platform/custom-objects/function-runtime.ts +76 -0
- package/src/core/platform/custom-objects/lifecycle.ts +557 -0
- package/src/core/platform/custom-objects/manager.ts +959 -0
- package/src/core/platform/custom-objects/provisioning.ts +672 -0
- package/src/core/platform/custom-objects/rql.ts +375 -0
- package/src/core/platform/custom-objects/schema-manager.ts +351 -0
- package/src/core/platform/custom-objects/typed-rql.ts +1273 -0
- package/src/core/platform/custom-objects/types.ts +753 -0
- package/src/core/platform/custom-objects/validation.ts +573 -0
- package/src/core/platform/custom-objects.ts +269 -0
- package/src/lib/leave-programs/README.md +160 -0
- package/src/lib/leave-programs/advanced.ts +11 -0
- package/src/lib/leave-programs/context.ts +101 -0
- package/src/lib/leave-programs/define-company-leave-program.ts +58 -0
- package/src/lib/leave-programs/duration.ts +20 -0
- package/src/lib/leave-programs/pay.ts +18 -0
- package/src/lib/leave-programs/policy-builder.ts +113 -0
- package/src/lib/leave-programs/recipes/parental-top-up-policy.ts +85 -0
- package/src/lib/leave-programs/testing.ts +16 -0
- package/src/lib/leave-programs/types.ts +274 -0
- package/src/lib/leave-programs.ts +35 -0
- package/src/resources/agents/agents.ts +340 -0
- package/src/resources/agents/deployments.ts +249 -0
- package/src/resources/agents/index.ts +40 -0
- package/src/resources/agents/sessions/events.ts +107 -0
- package/src/resources/agents/sessions/index.ts +12 -0
- package/src/resources/agents/sessions/sessions.ts +216 -0
- package/src/resources/agents/sessions.ts +3 -0
- package/src/resources/agents/source-revisions.ts +267 -0
- package/src/resources/agents.ts +3 -0
- package/src/resources/break-policies.ts +1 -1
- package/src/resources/break-types.ts +1 -1
- package/src/resources/business-structure-paths.ts +1 -1
- package/src/resources/candidate-applications.ts +1 -1
- package/src/resources/candidates.ts +1 -1
- package/src/resources/company-legal-entities.ts +1 -1
- package/src/resources/company-legal-entity-workers.ts +1 -1
- package/src/resources/compensation-bands-details.ts +1 -1
- package/src/resources/compensations.ts +1 -1
- package/src/resources/custom-objects/custom-objects.ts +8 -0
- package/src/resources/custom-objects/fields.ts +192 -59
- package/src/resources/device-orders.ts +1 -1
- package/src/resources/devices.ts +1 -1
- package/src/resources/functions/deployments.ts +2 -2
- package/src/resources/functions/executions.ts +2 -2
- package/src/resources/functions/functions.ts +1 -1
- package/src/resources/headcount-positions.ts +1 -1
- package/src/resources/headcount-priorities.ts +1 -1
- package/src/resources/index.ts +38 -0
- package/src/resources/job-assignments.ts +2 -2
- package/src/resources/job-codes.ts +2 -2
- package/src/resources/job-dimensions.ts +1 -1
- package/src/resources/job-pay-rate-exceptions.ts +2 -2
- package/src/resources/job-requisitions.ts +1 -1
- package/src/resources/kiosk-badges.ts +1 -1
- package/src/resources/leave-accruals.ts +1 -1
- package/src/resources/leave-balances.ts +1 -1
- package/src/resources/leave-requests.ts +1 -1
- package/src/resources/leave-types.ts +1 -1
- package/src/resources/legal-entities.ts +1 -1
- package/src/resources/levels.ts +29 -5
- package/src/resources/location-factors.ts +1 -1
- package/src/resources/packages/index.ts +14 -0
- package/src/resources/packages/packages.ts +329 -0
- package/src/resources/packages/versions.ts +98 -0
- package/src/resources/packages.ts +3 -0
- package/src/resources/scheduled-job-assignments.ts +1 -1
- package/src/resources/schedules.ts +1 -1
- package/src/resources/shift-assignments.ts +1 -1
- package/src/resources/shift-inputs.ts +1 -1
- package/src/resources/shiftassignments.ts +1 -1
- package/src/resources/sites.ts +736 -0
- package/src/resources/software-deployments.ts +1 -1
- package/src/resources/time-cards.ts +1 -1
- package/src/resources/time-entries.ts +1 -1
- package/src/resources/tracks.ts +1 -1
- package/src/resources/unassigned-shifts.ts +2 -2
- package/src/resources/unassignedshifts.ts +1 -1
- package/src/resources/worker-time-splits.ts +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
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.defineCustomObjectCategory = defineCustomObjectCategory;
|
|
4
|
+
exports.buildObjectCategoryCreateParams = buildObjectCategoryCreateParams;
|
|
5
|
+
exports.buildObjectCategoryUpdateParams = buildObjectCategoryUpdateParams;
|
|
6
|
+
exports.provisionCustomObjectCategoryDefinition = provisionCustomObjectCategoryDefinition;
|
|
7
|
+
exports.provisionCustomObjectCategoryDefinitions = provisionCustomObjectCategoryDefinitions;
|
|
8
|
+
exports.reconcileCustomObjectCategoryDefinition = reconcileCustomObjectCategoryDefinition;
|
|
9
|
+
exports.reconcileCustomObjectCategoryDefinitions = reconcileCustomObjectCategoryDefinitions;
|
|
10
|
+
exports.deleteCustomObjectCategoryDefinition = deleteCustomObjectCategoryDefinition;
|
|
11
|
+
const definition_1 = require("./definition.js");
|
|
12
|
+
const validation_1 = require("./validation.js");
|
|
13
|
+
/**
|
|
14
|
+
* Creates an immutable typed custom-object category definition.
|
|
15
|
+
*
|
|
16
|
+
* @param definition - Logical category metadata to normalize and freeze.
|
|
17
|
+
* @returns Immutable typed category definition with compiled API name.
|
|
18
|
+
* @typeParam TName - Logical category name supplied by the caller.
|
|
19
|
+
*/
|
|
20
|
+
function defineCustomObjectCategory(definition) {
|
|
21
|
+
(0, validation_1.validateLogicalCategoryName)(definition.name);
|
|
22
|
+
return Object.freeze({
|
|
23
|
+
name: definition.name,
|
|
24
|
+
apiName: (0, definition_1.toCustomCategoryApiName)(definition.name),
|
|
25
|
+
displayName: definition.displayName,
|
|
26
|
+
...(definition.description != null ? { description: definition.description } : {}),
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Builds the low-level create payload for an object category.
|
|
31
|
+
*
|
|
32
|
+
* @param definition - Typed category definition to compile.
|
|
33
|
+
* @returns REST create payload using the logical category name.
|
|
34
|
+
* @typeParam TName - Logical category name carried by the definition.
|
|
35
|
+
*/
|
|
36
|
+
function buildObjectCategoryCreateParams(definition) {
|
|
37
|
+
return {
|
|
38
|
+
name: definition.name,
|
|
39
|
+
...(definition.description != null ? { description: definition.description } : {}),
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Builds the low-level update payload for an object category.
|
|
44
|
+
*
|
|
45
|
+
* @param definition - Typed category definition to compile.
|
|
46
|
+
* @returns REST update payload using human-facing display metadata.
|
|
47
|
+
* @typeParam TName - Logical category name carried by the definition.
|
|
48
|
+
*/
|
|
49
|
+
function buildObjectCategoryUpdateParams(definition) {
|
|
50
|
+
return {
|
|
51
|
+
name: definition.displayName,
|
|
52
|
+
...(definition.description != null ? { description: definition.description } : {}),
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Returns whether one public category DTO matches the typed category definition by currently visible names.
|
|
57
|
+
*
|
|
58
|
+
* @param category - Public category DTO returned by the REST API.
|
|
59
|
+
* @param definition - Typed category definition being matched.
|
|
60
|
+
* @returns Whether the visible name matches either the logical or display name.
|
|
61
|
+
* @typeParam TName - Logical category name carried by the definition.
|
|
62
|
+
*/
|
|
63
|
+
function isMatchingCategoryName(category, definition) {
|
|
64
|
+
return category.name === definition.name || category.name === definition.displayName;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Lists all public category DTOs that ambiguously or exactly match one typed definition.
|
|
68
|
+
*
|
|
69
|
+
* @param client - SDK client used to enumerate categories.
|
|
70
|
+
* @param definition - Typed category definition being matched.
|
|
71
|
+
* @returns Frozen list of public categories whose visible names match.
|
|
72
|
+
* @typeParam TName - Logical category name carried by the definition.
|
|
73
|
+
*/
|
|
74
|
+
async function listMatchingCategories(client, definition) {
|
|
75
|
+
const matches = [];
|
|
76
|
+
for await (const category of client.objectCategories.list()) {
|
|
77
|
+
if (isMatchingCategoryName(category, definition)) {
|
|
78
|
+
matches.push(category);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return Object.freeze(matches);
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Returns the single public category matching one typed definition or throws when the match is ambiguous.
|
|
85
|
+
*
|
|
86
|
+
* @param client - SDK client used to enumerate categories.
|
|
87
|
+
* @param definition - Typed category definition being matched.
|
|
88
|
+
* @returns Matching public category, if any.
|
|
89
|
+
* @throws Error when multiple public categories match the visible names.
|
|
90
|
+
* @typeParam TName - Logical category name carried by the definition.
|
|
91
|
+
*/
|
|
92
|
+
async function getSingleMatchingCategory(client, definition) {
|
|
93
|
+
const matches = await listMatchingCategories(client, definition);
|
|
94
|
+
if (matches.length <= 1)
|
|
95
|
+
return matches[0];
|
|
96
|
+
throw new Error(`Ambiguous category match for "${definition.name}" / "${definition.displayName}". ` +
|
|
97
|
+
`Matched ids: ${matches.map((category) => category.id).join(', ')}.`);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Creates one typed custom-object category through the REST SDK.
|
|
101
|
+
*
|
|
102
|
+
* @param client - SDK client used to call the category APIs.
|
|
103
|
+
* @param definition - Typed category definition to provision.
|
|
104
|
+
* @param options - Provisioning behavior flags for display-metadata updates.
|
|
105
|
+
* @returns Frozen summary of the created and updated backend category DTOs.
|
|
106
|
+
* @typeParam TName - Logical category name carried by the definition.
|
|
107
|
+
*/
|
|
108
|
+
async function provisionCustomObjectCategoryDefinition(client, definition, options = {}) {
|
|
109
|
+
const createdCategory = await client.objectCategories.create(buildObjectCategoryCreateParams(definition));
|
|
110
|
+
const updatedCategory = options.updateDisplayMetadata ?? true ?
|
|
111
|
+
await client.objectCategories.update(createdCategory.id, buildObjectCategoryUpdateParams(definition))
|
|
112
|
+
: createdCategory;
|
|
113
|
+
return Object.freeze({ definition, createdCategory, updatedCategory });
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Creates multiple typed custom-object categories through the REST SDK.
|
|
117
|
+
*
|
|
118
|
+
* @param client - SDK client used to call the category APIs.
|
|
119
|
+
* @param definitions - Typed category definitions to provision.
|
|
120
|
+
* @param options - Provisioning behavior flags shared across the batch.
|
|
121
|
+
* @returns Frozen batch of provisioning results in input order.
|
|
122
|
+
*/
|
|
123
|
+
async function provisionCustomObjectCategoryDefinitions(client, definitions, options = {}) {
|
|
124
|
+
const results = [];
|
|
125
|
+
for (const definition of definitions) {
|
|
126
|
+
results.push(await provisionCustomObjectCategoryDefinition(client, definition, options));
|
|
127
|
+
}
|
|
128
|
+
return Object.freeze(results);
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Reconciles one typed category definition against the backend by name.
|
|
132
|
+
*
|
|
133
|
+
* @param client - SDK client used to call the category APIs.
|
|
134
|
+
* @param definition - Typed category definition to reconcile.
|
|
135
|
+
* @param options - Reconciliation behavior flags for display-metadata updates.
|
|
136
|
+
* @returns Frozen reconciliation result describing the final backend category state.
|
|
137
|
+
* @typeParam TName - Logical category name carried by the definition.
|
|
138
|
+
*/
|
|
139
|
+
async function reconcileCustomObjectCategoryDefinition(client, definition, options = {}) {
|
|
140
|
+
const existing = await getSingleMatchingCategory(client, definition);
|
|
141
|
+
if (existing == null) {
|
|
142
|
+
const provisioned = await provisionCustomObjectCategoryDefinition(client, definition, options);
|
|
143
|
+
return Object.freeze({
|
|
144
|
+
definition,
|
|
145
|
+
action: 'created',
|
|
146
|
+
category: provisioned.updatedCategory,
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
const shouldUpdate = (options.updateDisplayMetadata ?? true) &&
|
|
150
|
+
(existing.name !== definition.displayName ||
|
|
151
|
+
(existing.description ?? '') !== (definition.description ?? ''));
|
|
152
|
+
if (!shouldUpdate) {
|
|
153
|
+
return Object.freeze({ definition, action: 'unchanged', category: existing });
|
|
154
|
+
}
|
|
155
|
+
const updated = await client.objectCategories.update(existing.id, buildObjectCategoryUpdateParams(definition));
|
|
156
|
+
return Object.freeze({ definition, action: 'updated', category: updated });
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Reconciles multiple typed category definitions against the backend by name.
|
|
160
|
+
*
|
|
161
|
+
* @param client - SDK client used to call the category APIs.
|
|
162
|
+
* @param definitions - Typed category definitions to reconcile.
|
|
163
|
+
* @param options - Reconciliation behavior flags shared across the batch.
|
|
164
|
+
* @returns Frozen batch of reconciliation results in input order.
|
|
165
|
+
*/
|
|
166
|
+
async function reconcileCustomObjectCategoryDefinitions(client, definitions, options = {}) {
|
|
167
|
+
const results = [];
|
|
168
|
+
for (const definition of definitions) {
|
|
169
|
+
results.push(await reconcileCustomObjectCategoryDefinition(client, definition, options));
|
|
170
|
+
}
|
|
171
|
+
return Object.freeze(results);
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Deletes a category that matches the typed definition's logical or display name.
|
|
175
|
+
*
|
|
176
|
+
* @param client - SDK client used to call the category APIs.
|
|
177
|
+
* @param definition - Typed category definition used to find the category to delete.
|
|
178
|
+
* @returns Whether a matching category existed and was deleted.
|
|
179
|
+
* @typeParam TName - Logical category name carried by the definition.
|
|
180
|
+
*/
|
|
181
|
+
async function deleteCustomObjectCategoryDefinition(client, definition) {
|
|
182
|
+
const existing = await getSingleMatchingCategory(client, definition);
|
|
183
|
+
if (existing == null)
|
|
184
|
+
return false;
|
|
185
|
+
await client.objectCategories.delete(existing.id);
|
|
186
|
+
return true;
|
|
187
|
+
}
|
|
188
|
+
//# sourceMappingURL=category.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"category.js","sourceRoot":"","sources":["../../../src/core/platform/custom-objects/category.ts"],"names":[],"mappings":";;AAwEA,gEAUC;AASD,0EAOC;AASD,0EAOC;AAqED,0FAYC;AAUD,4FAUC;AAWD,0FA6BC;AAUD,4FAUC;AAUD,oFAQC;AA9RD,gDAAuD;AACvD,gDAA2D;AAyD3D;;;;;;GAMG;AACH,SAAgB,0BAA0B,CACxC,UAAsD;IAEtD,IAAA,wCAA2B,EAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IAC7C,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,IAAI,EAAE,UAAU,CAAC,IAAI;QACrB,OAAO,EAAE,IAAA,oCAAuB,EAAC,UAAU,CAAC,IAAI,CAAC;QACjD,WAAW,EAAE,UAAU,CAAC,WAAW;QACnC,GAAG,CAAC,UAAU,CAAC,WAAW,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,UAAU,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACnF,CAAyE,CAAC;AAC7E,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,+BAA+B,CAC7C,UAAiD;IAEjD,OAAO;QACL,IAAI,EAAE,UAAU,CAAC,IAAI;QACrB,GAAG,CAAC,UAAU,CAAC,WAAW,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,UAAU,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACnF,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,+BAA+B,CAC7C,UAAiD;IAEjD,OAAO;Q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AM,EAAE,UAAU,CAAC,CAAC;IACrE,IAAI,QAAQ,IAAI,IAAI;QAAE,OAAO,KAAK,CAAC;IACnC,MAAM,MAAM,CAAC,gBAAgB,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAClD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { toCustomCategoryApiName } from "./definition.mjs";
|
|
2
|
+
import { validateLogicalCategoryName } from "./validation.mjs";
|
|
3
|
+
/**
|
|
4
|
+
* Creates an immutable typed custom-object category definition.
|
|
5
|
+
*
|
|
6
|
+
* @param definition - Logical category metadata to normalize and freeze.
|
|
7
|
+
* @returns Immutable typed category definition with compiled API name.
|
|
8
|
+
* @typeParam TName - Logical category name supplied by the caller.
|
|
9
|
+
*/
|
|
10
|
+
export function defineCustomObjectCategory(definition) {
|
|
11
|
+
validateLogicalCategoryName(definition.name);
|
|
12
|
+
return Object.freeze({
|
|
13
|
+
name: definition.name,
|
|
14
|
+
apiName: toCustomCategoryApiName(definition.name),
|
|
15
|
+
displayName: definition.displayName,
|
|
16
|
+
...(definition.description != null ? { description: definition.description } : {}),
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Builds the low-level create payload for an object category.
|
|
21
|
+
*
|
|
22
|
+
* @param definition - Typed category definition to compile.
|
|
23
|
+
* @returns REST create payload using the logical category name.
|
|
24
|
+
* @typeParam TName - Logical category name carried by the definition.
|
|
25
|
+
*/
|
|
26
|
+
export function buildObjectCategoryCreateParams(definition) {
|
|
27
|
+
return {
|
|
28
|
+
name: definition.name,
|
|
29
|
+
...(definition.description != null ? { description: definition.description } : {}),
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Builds the low-level update payload for an object category.
|
|
34
|
+
*
|
|
35
|
+
* @param definition - Typed category definition to compile.
|
|
36
|
+
* @returns REST update payload using human-facing display metadata.
|
|
37
|
+
* @typeParam TName - Logical category name carried by the definition.
|
|
38
|
+
*/
|
|
39
|
+
export function buildObjectCategoryUpdateParams(definition) {
|
|
40
|
+
return {
|
|
41
|
+
name: definition.displayName,
|
|
42
|
+
...(definition.description != null ? { description: definition.description } : {}),
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Returns whether one public category DTO matches the typed category definition by currently visible names.
|
|
47
|
+
*
|
|
48
|
+
* @param category - Public category DTO returned by the REST API.
|
|
49
|
+
* @param definition - Typed category definition being matched.
|
|
50
|
+
* @returns Whether the visible name matches either the logical or display name.
|
|
51
|
+
* @typeParam TName - Logical category name carried by the definition.
|
|
52
|
+
*/
|
|
53
|
+
function isMatchingCategoryName(category, definition) {
|
|
54
|
+
return category.name === definition.name || category.name === definition.displayName;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Lists all public category DTOs that ambiguously or exactly match one typed definition.
|
|
58
|
+
*
|
|
59
|
+
* @param client - SDK client used to enumerate categories.
|
|
60
|
+
* @param definition - Typed category definition being matched.
|
|
61
|
+
* @returns Frozen list of public categories whose visible names match.
|
|
62
|
+
* @typeParam TName - Logical category name carried by the definition.
|
|
63
|
+
*/
|
|
64
|
+
async function listMatchingCategories(client, definition) {
|
|
65
|
+
const matches = [];
|
|
66
|
+
for await (const category of client.objectCategories.list()) {
|
|
67
|
+
if (isMatchingCategoryName(category, definition)) {
|
|
68
|
+
matches.push(category);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return Object.freeze(matches);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Returns the single public category matching one typed definition or throws when the match is ambiguous.
|
|
75
|
+
*
|
|
76
|
+
* @param client - SDK client used to enumerate categories.
|
|
77
|
+
* @param definition - Typed category definition being matched.
|
|
78
|
+
* @returns Matching public category, if any.
|
|
79
|
+
* @throws Error when multiple public categories match the visible names.
|
|
80
|
+
* @typeParam TName - Logical category name carried by the definition.
|
|
81
|
+
*/
|
|
82
|
+
async function getSingleMatchingCategory(client, definition) {
|
|
83
|
+
const matches = await listMatchingCategories(client, definition);
|
|
84
|
+
if (matches.length <= 1)
|
|
85
|
+
return matches[0];
|
|
86
|
+
throw new Error(`Ambiguous category match for "${definition.name}" / "${definition.displayName}". ` +
|
|
87
|
+
`Matched ids: ${matches.map((category) => category.id).join(', ')}.`);
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Creates one typed custom-object category through the REST SDK.
|
|
91
|
+
*
|
|
92
|
+
* @param client - SDK client used to call the category APIs.
|
|
93
|
+
* @param definition - Typed category definition to provision.
|
|
94
|
+
* @param options - Provisioning behavior flags for display-metadata updates.
|
|
95
|
+
* @returns Frozen summary of the created and updated backend category DTOs.
|
|
96
|
+
* @typeParam TName - Logical category name carried by the definition.
|
|
97
|
+
*/
|
|
98
|
+
export async function provisionCustomObjectCategoryDefinition(client, definition, options = {}) {
|
|
99
|
+
const createdCategory = await client.objectCategories.create(buildObjectCategoryCreateParams(definition));
|
|
100
|
+
const updatedCategory = options.updateDisplayMetadata ?? true ?
|
|
101
|
+
await client.objectCategories.update(createdCategory.id, buildObjectCategoryUpdateParams(definition))
|
|
102
|
+
: createdCategory;
|
|
103
|
+
return Object.freeze({ definition, createdCategory, updatedCategory });
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Creates multiple typed custom-object categories through the REST SDK.
|
|
107
|
+
*
|
|
108
|
+
* @param client - SDK client used to call the category APIs.
|
|
109
|
+
* @param definitions - Typed category definitions to provision.
|
|
110
|
+
* @param options - Provisioning behavior flags shared across the batch.
|
|
111
|
+
* @returns Frozen batch of provisioning results in input order.
|
|
112
|
+
*/
|
|
113
|
+
export async function provisionCustomObjectCategoryDefinitions(client, definitions, options = {}) {
|
|
114
|
+
const results = [];
|
|
115
|
+
for (const definition of definitions) {
|
|
116
|
+
results.push(await provisionCustomObjectCategoryDefinition(client, definition, options));
|
|
117
|
+
}
|
|
118
|
+
return Object.freeze(results);
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Reconciles one typed category definition against the backend by name.
|
|
122
|
+
*
|
|
123
|
+
* @param client - SDK client used to call the category APIs.
|
|
124
|
+
* @param definition - Typed category definition to reconcile.
|
|
125
|
+
* @param options - Reconciliation behavior flags for display-metadata updates.
|
|
126
|
+
* @returns Frozen reconciliation result describing the final backend category state.
|
|
127
|
+
* @typeParam TName - Logical category name carried by the definition.
|
|
128
|
+
*/
|
|
129
|
+
export async function reconcileCustomObjectCategoryDefinition(client, definition, options = {}) {
|
|
130
|
+
const existing = await getSingleMatchingCategory(client, definition);
|
|
131
|
+
if (existing == null) {
|
|
132
|
+
const provisioned = await provisionCustomObjectCategoryDefinition(client, definition, options);
|
|
133
|
+
return Object.freeze({
|
|
134
|
+
definition,
|
|
135
|
+
action: 'created',
|
|
136
|
+
category: provisioned.updatedCategory,
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
const shouldUpdate = (options.updateDisplayMetadata ?? true) &&
|
|
140
|
+
(existing.name !== definition.displayName ||
|
|
141
|
+
(existing.description ?? '') !== (definition.description ?? ''));
|
|
142
|
+
if (!shouldUpdate) {
|
|
143
|
+
return Object.freeze({ definition, action: 'unchanged', category: existing });
|
|
144
|
+
}
|
|
145
|
+
const updated = await client.objectCategories.update(existing.id, buildObjectCategoryUpdateParams(definition));
|
|
146
|
+
return Object.freeze({ definition, action: 'updated', category: updated });
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Reconciles multiple typed category definitions against the backend by name.
|
|
150
|
+
*
|
|
151
|
+
* @param client - SDK client used to call the category APIs.
|
|
152
|
+
* @param definitions - Typed category definitions to reconcile.
|
|
153
|
+
* @param options - Reconciliation behavior flags shared across the batch.
|
|
154
|
+
* @returns Frozen batch of reconciliation results in input order.
|
|
155
|
+
*/
|
|
156
|
+
export async function reconcileCustomObjectCategoryDefinitions(client, definitions, options = {}) {
|
|
157
|
+
const results = [];
|
|
158
|
+
for (const definition of definitions) {
|
|
159
|
+
results.push(await reconcileCustomObjectCategoryDefinition(client, definition, options));
|
|
160
|
+
}
|
|
161
|
+
return Object.freeze(results);
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Deletes a category that matches the typed definition's logical or display name.
|
|
165
|
+
*
|
|
166
|
+
* @param client - SDK client used to call the category APIs.
|
|
167
|
+
* @param definition - Typed category definition used to find the category to delete.
|
|
168
|
+
* @returns Whether a matching category existed and was deleted.
|
|
169
|
+
* @typeParam TName - Logical category name carried by the definition.
|
|
170
|
+
*/
|
|
171
|
+
export async function deleteCustomObjectCategoryDefinition(client, definition) {
|
|
172
|
+
const existing = await getSingleMatchingCategory(client, definition);
|
|
173
|
+
if (existing == null)
|
|
174
|
+
return false;
|
|
175
|
+
await client.objectCategories.delete(existing.id);
|
|
176
|
+
return true;
|
|
177
|
+
}
|
|
178
|
+
//# sourceMappingURL=category.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"category.mjs","sourceRoot":"","sources":["../../../src/core/platform/custom-objects/category.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,uBAAuB,EAAE,yBAAqB;AACvD,OAAO,EAAE,2BAA2B,EAAE,yBAAqB;AAyD3D;;;;;;GAMG;AACH,MAAM,UAAU,0BAA0B,CACxC,UAAsD;IAEtD,2BAA2B,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IAC7C,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,IAAI,EAAE,UAAU,CAAC,IAAI;QACrB,OAAO,EAAE,uBAAuB,CAAC,UAAU,CAAC,IAAI,CAAC;QACjD,WAAW,EAAE,UAAU,CAAC,WAAW;QACnC,GAAG,CAAC,UAAU,CAAC,WAAW,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,UAAU,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACnF,CAAyE,CAAC;AAC7E,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,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E,CAAC;IACrD,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;QACrC,OAAO,CAAC,IAAI,CAAC,MAAM,uCAAuC,CAAC,MAAM,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC;IAC3F,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AAChC,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,oCAAoC,CACxD,MAAmB,EACnB,UAAiD;IAEjD,MAAM,QAAQ,GAAG,MAAM,yBAAyB,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACrE,IAAI,QAAQ,IAAI,IAAI;QAAE,OAAO,KAAK,CAAC;IACnC,MAAM,MAAM,CAAC,gBAAgB,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAClD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import type { CustomObjectCategoryDefinition } from "./category.mjs";
|
|
2
|
+
import type { AnyCustomObjectDefinition, AnyFieldDefinition, CategoryApiName, CustomObjectApiName, CustomObjectDefinition, FieldDefinitions, FieldNames, LogicalCategoryName, LogicalCustomFieldName, LogicalCustomObjectName, NameFieldDefinition, SectionDefinitions } from "./types.mjs";
|
|
3
|
+
/**
|
|
4
|
+
* Internal input shape accepted by {@link defineCustomObject} before normalization.
|
|
5
|
+
*
|
|
6
|
+
* @typeParam TObjectName - Logical custom-object name for the definition.
|
|
7
|
+
* @typeParam TCategoryName - Logical category name associated with the object.
|
|
8
|
+
* @typeParam TSections - Section map available to field definitions.
|
|
9
|
+
* @typeParam TFields - Field map keyed by logical custom-field names.
|
|
10
|
+
* @typeParam TNameField - Optional name-field behavior supplied by the caller.
|
|
11
|
+
*/
|
|
12
|
+
type CategoryInput<TCategoryName extends string> = LogicalCategoryName<TCategoryName> | CustomObjectCategoryDefinition<LogicalCategoryName<TCategoryName>>;
|
|
13
|
+
/**
|
|
14
|
+
* Internal input shape accepted by {@link defineCustomObject} before normalization.
|
|
15
|
+
*
|
|
16
|
+
* @typeParam TObjectName - Logical custom-object name for the definition.
|
|
17
|
+
* @typeParam TCategoryName - Logical category name associated with the object.
|
|
18
|
+
* @typeParam TSections - Section map available to field definitions.
|
|
19
|
+
* @typeParam TFields - Field map keyed by logical custom-field names.
|
|
20
|
+
* @typeParam TNameField - Optional name-field behavior supplied by the caller.
|
|
21
|
+
*/
|
|
22
|
+
interface CustomObjectDefinitionInput<TObjectName extends string, TCategoryName extends string, TSections extends SectionDefinitions, TFields extends FieldDefinitions, TNameField extends NameFieldDefinition> {
|
|
23
|
+
readonly name: LogicalCustomObjectName<TObjectName>;
|
|
24
|
+
readonly displayName: string;
|
|
25
|
+
readonly pluralLabel?: string;
|
|
26
|
+
readonly category: CategoryInput<TCategoryName>;
|
|
27
|
+
readonly ownerRole?: string;
|
|
28
|
+
readonly enableHistory?: boolean;
|
|
29
|
+
readonly description: string;
|
|
30
|
+
readonly icon?: {
|
|
31
|
+
readonly emoji?: string | null;
|
|
32
|
+
readonly ripplingIcon?: string | null;
|
|
33
|
+
readonly s3Bucket?: string;
|
|
34
|
+
readonly s3Key?: string;
|
|
35
|
+
};
|
|
36
|
+
readonly nameField?: TNameField;
|
|
37
|
+
readonly sections?: TSections;
|
|
38
|
+
readonly fields: ValidateFieldMap<TFields>;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Rejects extension objects that try to redefine keys already present on the base definition.
|
|
42
|
+
*
|
|
43
|
+
* @typeParam TExisting - Existing key set on the base definition.
|
|
44
|
+
* @typeParam TAdded - Proposed extension object.
|
|
45
|
+
*/
|
|
46
|
+
type NoOverlappingKeys<TExisting extends object, TAdded extends object> = Extract<keyof TExisting, keyof TAdded> extends never ? TAdded : never;
|
|
47
|
+
/**
|
|
48
|
+
* Converts a logical field map into a version whose keys must all satisfy the
|
|
49
|
+
* logical custom-field name contract.
|
|
50
|
+
*
|
|
51
|
+
* @typeParam TFields - Candidate logical field map supplied by callers.
|
|
52
|
+
*/
|
|
53
|
+
type ValidateFieldMap<TFields extends FieldDefinitions> = {
|
|
54
|
+
readonly [K in keyof TFields]: K extends string ? LogicalCustomFieldName<K> extends never ? never : TFields[K] : never;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Appends the platform-required `__c` suffix to a logical custom-object name.
|
|
58
|
+
*
|
|
59
|
+
* @param name - Logical unsuffixed custom-object name.
|
|
60
|
+
* @returns Wire-level custom-object API name with the required `__c` suffix.
|
|
61
|
+
* @typeParam TObjectName - Logical custom-object name to compile.
|
|
62
|
+
*/
|
|
63
|
+
export declare function toCustomObjectApiName<TObjectName extends string>(name: LogicalCustomObjectName<TObjectName>): CustomObjectApiName<TObjectName>;
|
|
64
|
+
/**
|
|
65
|
+
* Appends the platform-required `__c` suffix to a logical custom-field name.
|
|
66
|
+
*
|
|
67
|
+
* @param name - Logical unsuffixed custom-field name.
|
|
68
|
+
* @returns Wire-level custom-field API name with the required `__c` suffix.
|
|
69
|
+
* @typeParam TFieldName - Logical custom-field name to compile.
|
|
70
|
+
*/
|
|
71
|
+
export declare function toCustomFieldApiName<TFieldName extends string>(name: LogicalCustomFieldName<TFieldName>): `${TFieldName}__c`;
|
|
72
|
+
/**
|
|
73
|
+
* Appends the platform-required `__c` suffix to a logical category name.
|
|
74
|
+
*
|
|
75
|
+
* @param name - Logical unsuffixed category name.
|
|
76
|
+
* @returns Wire-level category API name with the required `__c` suffix.
|
|
77
|
+
* @typeParam TCategoryName - Logical category name to compile.
|
|
78
|
+
*/
|
|
79
|
+
export declare function toCustomCategoryApiName<TCategoryName extends string>(name: LogicalCategoryName<TCategoryName>): CategoryApiName<TCategoryName>;
|
|
80
|
+
/**
|
|
81
|
+
* Defines an immutable, strongly typed custom-object schema.
|
|
82
|
+
*
|
|
83
|
+
* Callers author only logical snake_case names. The returned value includes the
|
|
84
|
+
* derived wire-level api names so downstream tooling can emit valid manifest
|
|
85
|
+
* payloads without requiring authors to know about the `__c` suffix contract.
|
|
86
|
+
*
|
|
87
|
+
* @typeParam TObjectName - Logical custom-object name for the definition.
|
|
88
|
+
* @typeParam TCategoryName - Logical category name associated with the object.
|
|
89
|
+
* @typeParam TSections - Section map available to field definitions.
|
|
90
|
+
* @typeParam TFields - Field map keyed by logical custom-field names.
|
|
91
|
+
* @param definition - Author-facing typed schema definition to normalize, validate, and freeze.
|
|
92
|
+
* @returns Immutable normalized custom-object definition with compiled field and object API names.
|
|
93
|
+
* @typeParam TNameField - Name-field behavior for the object.
|
|
94
|
+
*/
|
|
95
|
+
export declare function defineCustomObject<TObjectName extends string, TCategoryName extends string, TSections extends SectionDefinitions = {}, TFields extends FieldDefinitions = FieldDefinitions, TNameField extends NameFieldDefinition = {
|
|
96
|
+
kind: 'text';
|
|
97
|
+
}>(definition: CustomObjectDefinitionInput<TObjectName, TCategoryName, TSections, TFields, TNameField>): Readonly<CustomObjectDefinition<LogicalCustomObjectName<TObjectName>, LogicalCategoryName<TCategoryName>, TSections, TFields, TNameField>>;
|
|
98
|
+
/**
|
|
99
|
+
* Extends an existing object definition without losing type information.
|
|
100
|
+
*
|
|
101
|
+
* This helper is useful when a platform package wants to publish a base schema
|
|
102
|
+
* and another package wants to add fields or sections in a type-safe way.
|
|
103
|
+
*
|
|
104
|
+
* @typeParam TBase - Existing object definition being extended.
|
|
105
|
+
* @typeParam TAddedSections - New section definitions merged into the base object.
|
|
106
|
+
* @param base - Existing typed object definition to extend.
|
|
107
|
+
* @param extension - Additional metadata, sections, and fields to merge into the base definition.
|
|
108
|
+
* @returns New immutable custom-object definition preserving the combined type information.
|
|
109
|
+
* @typeParam TAddedFields - New field definitions merged into the base object.
|
|
110
|
+
*/
|
|
111
|
+
export declare function extendCustomObject<TBase extends AnyCustomObjectDefinition, TAddedSections extends SectionDefinitions = {}, TAddedFields extends FieldDefinitions = {}>(base: TBase, extension: {
|
|
112
|
+
readonly displayName?: string;
|
|
113
|
+
readonly pluralLabel?: string;
|
|
114
|
+
readonly ownerRole?: string;
|
|
115
|
+
readonly enableHistory?: boolean;
|
|
116
|
+
readonly description?: string;
|
|
117
|
+
readonly icon?: TBase['icon'];
|
|
118
|
+
readonly sections?: NoOverlappingKeys<TBase['sections'], TAddedSections>;
|
|
119
|
+
readonly fields?: NoOverlappingKeys<TBase['fields'], ValidateFieldMap<TAddedFields>>;
|
|
120
|
+
}): Readonly<CustomObjectDefinition<TBase['name'], TBase['category'], TBase['sections'] & TAddedSections, Omit<TBase['fields'], never> & TAddedFields, TBase['nameField']>>;
|
|
121
|
+
/**
|
|
122
|
+
* Returns the logical custom field names defined on an object.
|
|
123
|
+
*
|
|
124
|
+
* @param definition - Object definition whose logical field names should be returned.
|
|
125
|
+
* @returns Frozen array of logical field names from the definition.
|
|
126
|
+
* @typeParam TDefinition - Object definition whose field names should be returned.
|
|
127
|
+
*/
|
|
128
|
+
export declare function fieldNames<TDefinition extends AnyCustomObjectDefinition>(definition: TDefinition): ReadonlyArray<FieldNames<TDefinition>>;
|
|
129
|
+
/**
|
|
130
|
+
* Retrieves a field definition by logical field name with precise typing.
|
|
131
|
+
*
|
|
132
|
+
* @param definition - Object definition that owns the field.
|
|
133
|
+
* @param fieldName - Logical field name to retrieve.
|
|
134
|
+
* @returns Precisely typed field definition for the requested logical field name.
|
|
135
|
+
* @typeParam TDefinition - Object definition that owns the field.
|
|
136
|
+
* @typeParam TFieldName - Logical field name being retrieved.
|
|
137
|
+
*/
|
|
138
|
+
export declare function getFieldDefinition<TDefinition extends AnyCustomObjectDefinition, TFieldName extends FieldNames<TDefinition>>(definition: TDefinition, fieldName: TFieldName): TDefinition['fields'][TFieldName];
|
|
139
|
+
/**
|
|
140
|
+
* Returns whether one typed field definition is writable by record create/update helpers.
|
|
141
|
+
*
|
|
142
|
+
* @param field - Typed field definition to inspect.
|
|
143
|
+
* @returns Whether the field may be written by callers.
|
|
144
|
+
*/
|
|
145
|
+
export declare function isWritableField(field: AnyFieldDefinition): boolean;
|
|
146
|
+
export {};
|
|
147
|
+
//# sourceMappingURL=definition.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definition.d.mts","sourceRoot":"","sources":["../../../src/core/platform/custom-objects/definition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,8BAA8B,EAAE,uBAAmB;AACjE,OAAO,KAAK,EACV,yBAAyB,EACzB,kBAAkB,EAClB,eAAe,EACf,mBAAmB,EACnB,sBAAsB,EACtB,gBAAgB,EAChB,UAAU,EACV,mBAAmB,EACnB,sBAAsB,EACtB,uBAAuB,EACvB,mBAAmB,EAEnB,kBAAkB,EACnB,oBAAgB;AAQjB;;;;;;;;GAQG;AACH,KAAK,aAAa,CAAC,aAAa,SAAS,MAAM,IAC3C,mBAAmB,CAAC,aAAa,CAAC,GAClC,8BAA8B,CAAC,mBAAmB,CAAC,aAAa,CAAC,CAAC,CAAC;AAEvE;;;;;;;;GAQG;AACH,UAAU,2BAA2B,CACnC,WAAW,SAAS,MAAM,EAC1B,aAAa,SAAS,MAAM,EAC5B,SAAS,SAAS,kBAAkB,EACpC,OAAO,SAAS,gBAAgB,EAChC,UAAU,SAAS,mBAAmB;IAEtC,QAAQ,CAAC,IAAI,EAAE,uBAAuB,CAAC,WAAW,CAAC,CAAC;IACpD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC;IAChD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;IACjC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,IAAI,CAAC,EAAE;QACd,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAC/B,QAAQ,CAAC,YAAY,CAAC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