@pega/custom-dx-components 26.1.11 → 26.1.12-alpha.0.2
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/README.md +6 -2
- package/package.json +48 -64
- package/src/ai/README.md +44 -0
- package/src/ai/catalog/README.md +133 -0
- package/src/ai/catalog/best-practices/README.md +24 -0
- package/src/ai/catalog/best-practices/accessibility-for-async-components.md +53 -0
- package/src/ai/catalog/best-practices/error-handling-and-resiliency.md +116 -0
- package/src/ai/catalog/best-practices/genai-assistant-integration-patterns.md +49 -0
- package/src/ai/catalog/best-practices/performance-and-efficiency.md +109 -0
- package/src/ai/catalog/best-practices/security-considerations.md +93 -0
- package/src/ai/catalog/best-practices/testing-pconnect-components.md +245 -0
- package/src/ai/catalog/best-practices/troubleshooting-common-pitfalls.md +132 -0
- package/src/ai/catalog/pconnect-assignment-lifecycle/SKILL.md +44 -0
- package/src/ai/catalog/pconnect-assignment-lifecycle/cookbooks/README.md +39 -0
- package/src/ai/catalog/pconnect-assignment-lifecycle/cookbooks/approval-workflow-decision.md +47 -0
- package/src/ai/catalog/pconnect-assignment-lifecycle/cookbooks/attachment-upload.md +45 -0
- package/src/ai/catalog/pconnect-assignment-lifecycle/cookbooks/bulk-action-submit.md +50 -0
- package/src/ai/catalog/pconnect-assignment-lifecycle/cookbooks/confirm-before-destructive-action.md +43 -0
- package/src/ai/catalog/pconnect-assignment-lifecycle/cookbooks/create-and-stage-new-case.md +45 -0
- package/src/ai/catalog/pconnect-assignment-lifecycle/cookbooks/graceful-submit-failure.md +39 -0
- package/src/ai/catalog/pconnect-assignment-lifecycle/cookbooks/modal-assignment-submit.md +58 -0
- package/src/ai/catalog/pconnect-assignment-lifecycle/cookbooks/multi-step-wizard.md +44 -0
- package/src/ai/catalog/pconnect-assignment-lifecycle/cookbooks/resolve-or-ignore-duplicate.md +47 -0
- package/src/ai/catalog/pconnect-assignment-lifecycle/cookbooks/safe-case-deletion.md +36 -0
- package/src/ai/catalog/pconnect-case-collaboration/SKILL.md +42 -0
- package/src/ai/catalog/pconnect-case-collaboration/cookbooks/README.md +36 -0
- package/src/ai/catalog/pconnect-case-collaboration/cookbooks/look-up-user-details.md +43 -0
- package/src/ai/catalog/pconnect-case-collaboration/cookbooks/manage-case-attachments.md +51 -0
- package/src/ai/catalog/pconnect-case-collaboration/cookbooks/manage-case-participants.md +52 -0
- package/src/ai/catalog/pconnect-case-collaboration/cookbooks/participant-and-follower.md +40 -0
- package/src/ai/catalog/pconnect-case-collaboration/cookbooks/post-and-manage-feed.md +50 -0
- package/src/ai/catalog/pconnect-case-collaboration/cookbooks/relate-cases.md +35 -0
- package/src/ai/catalog/pconnect-case-collaboration/cookbooks/tag-case-and-find-related.md +44 -0
- package/src/ai/catalog/pconnect-data-subscriptions/SKILL.md +42 -0
- package/src/ai/catalog/pconnect-data-subscriptions/cookbooks/README.md +35 -0
- package/src/ai/catalog/pconnect-data-subscriptions/cookbooks/data-page-subscription-cleanup.md +41 -0
- package/src/ai/catalog/pconnect-data-subscriptions/cookbooks/publish-and-subscribe-events.md +40 -0
- package/src/ai/catalog/pconnect-data-subscriptions/cookbooks/pubsub-cleanup.md +38 -0
- package/src/ai/catalog/pconnect-data-subscriptions/cookbooks/query-paginated-list-data.md +44 -0
- package/src/ai/catalog/pconnect-data-subscriptions/cookbooks/realtime-case-subscription.md +46 -0
- package/src/ai/catalog/pconnect-data-subscriptions/cookbooks/refresh-and-update-data.md +41 -0
- package/src/ai/catalog/pconnect-forms-and-fields/SKILL.md +44 -0
- package/src/ai/catalog/pconnect-forms-and-fields/cookbooks/README.md +36 -0
- package/src/ai/catalog/pconnect-forms-and-fields/cookbooks/autosave-tracking.md +45 -0
- package/src/ai/catalog/pconnect-forms-and-fields/cookbooks/cascading-dependent-fields.md +51 -0
- package/src/ai/catalog/pconnect-forms-and-fields/cookbooks/collect-form-changes-for-manual-save.md +45 -0
- package/src/ai/catalog/pconnect-forms-and-fields/cookbooks/custom-field-validators.md +44 -0
- package/src/ai/catalog/pconnect-forms-and-fields/cookbooks/discard-changes-and-reset-form.md +41 -0
- package/src/ai/catalog/pconnect-forms-and-fields/cookbooks/full-form-validation.md +38 -0
- package/src/ai/catalog/pconnect-forms-and-fields/cookbooks/persist-widget-ui-state.md +41 -0
- package/src/ai/catalog/pconnect-lists-and-views/SKILL.md +44 -0
- package/src/ai/catalog/pconnect-lists-and-views/cookbooks/README.md +35 -0
- package/src/ai/catalog/pconnect-lists-and-views/cookbooks/activate-and-switch-container-items.md +52 -0
- package/src/ai/catalog/pconnect-lists-and-views/cookbooks/container-item-lifecycle.md +61 -0
- package/src/ai/catalog/pconnect-lists-and-views/cookbooks/insert-delete-list-rows.md +40 -0
- package/src/ai/catalog/pconnect-lists-and-views/cookbooks/reorder-list-rows.md +39 -0
- package/src/ai/catalog/pconnect-lists-and-views/cookbooks/repeating-row-edit.md +39 -0
- package/src/ai/catalog/pconnect-lists-and-views/cookbooks/view-personalization.md +60 -0
- package/src/ai/catalog/pconnect-navigation-locale-genai/SKILL.md +45 -0
- package/src/ai/catalog/pconnect-navigation-locale-genai/cookbooks/README.md +35 -0
- package/src/ai/catalog/pconnect-navigation-locale-genai/cookbooks/agent-conversation-for-tasks.md +54 -0
- package/src/ai/catalog/pconnect-navigation-locale-genai/cookbooks/bookmarkable-filter-state.md +40 -0
- package/src/ai/catalog/pconnect-navigation-locale-genai/cookbooks/deep-link-semantic-url.md +39 -0
- package/src/ai/catalog/pconnect-navigation-locale-genai/cookbooks/genai-assistant-conversation.md +43 -0
- package/src/ai/catalog/pconnect-navigation-locale-genai/cookbooks/locale-switch-and-relocalize.md +38 -0
- package/src/ai/catalog/pconnect-navigation-locale-genai/cookbooks/persist-operator-preferences.md +40 -0
- package/src/ai/catalog/references/architecture-overview.md +52 -0
- package/src/ai/catalog/references/pconnect-actions-api.md +948 -0
- package/src/ai/catalog/references/pconnect-case-info-data-info-localization.md +618 -0
- package/src/ai/catalog/references/pconnect-case-validation-utilities.md +238 -0
- package/src/ai/catalog/references/pconnect-container-manager.md +215 -0
- package/src/ai/catalog/references/pconnect-list-actions.md +250 -0
- package/src/ai/catalog/references/pconnect-misc-suggestions-creation.md +231 -0
- package/src/ai/catalog/references/pconnect-reference-context-component.md +471 -0
- package/src/ai/catalog/references/pconnect-state-config.md +316 -0
- package/src/ai/catalog/references/pconnect-validation-api.md +45 -0
- package/src/ai/catalog/references/pcore-analytics-genai-details.md +50 -0
- package/src/ai/catalog/references/pcore-bootstrap-init-details.md +121 -0
- package/src/ai/catalog/references/pcore-bootstrap-registry-routing.md +253 -0
- package/src/ai/catalog/references/pcore-case-collaboration-details.md +191 -0
- package/src/ai/catalog/references/pcore-case-collaboration-genai.md +264 -0
- package/src/ai/catalog/references/pcore-environment-info-details.md +96 -0
- package/src/ai/catalog/references/pcore-environment-locale-namespace.md +175 -0
- package/src/ai/catalog/references/pcore-messaging-details.md +99 -0
- package/src/ai/catalog/references/pcore-misc-details.md +207 -0
- package/src/ai/catalog/references/pcore-misc-utilities.md +325 -0
- package/src/ai/catalog/references/pcore-rest-data-details.md +164 -0
- package/src/ai/catalog/references/pcore-rest-data-messaging.md +308 -0
- package/src/ai/catalog/references/pcore-store-context-details.md +40 -0
- package/src/ai/catalog/references/pcore-store-context-state.md +130 -0
- package/src/ai/index.js +154 -0
- package/src/ai/project/.claude/skills/boolean/SKILL.md +43 -0
- package/src/ai/project/.claude/skills/case/SKILL.md +58 -0
- package/src/ai/project/.claude/skills/create-dx-component/SKILL.md +98 -0
- package/src/ai/project/.claude/skills/create-dx-component/assets/PConnProps.d.ts +24 -0
- package/src/ai/project/.claude/skills/create-dx-component/assets/create-nonce.ts +5 -0
- package/src/ai/project/.claude/skills/create-dx-component/assets/event-utils.ts +18 -0
- package/src/ai/project/.claude/skills/create-dx-component/assets/styles.ts +7 -0
- package/src/ai/project/.claude/skills/create-dx-component/cookbooks/README.md +28 -0
- package/src/ai/project/.claude/skills/create-dx-component/cookbooks/build-a-data-widget.md +281 -0
- package/src/ai/project/.claude/skills/create-dx-component/cookbooks/field-with-limits-and-validation.md +156 -0
- package/src/ai/project/.claude/skills/create-dx-component/cookbooks/status-badge-field.md +97 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/accessibility.md +71 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/choosing-type-and-subtype.md +79 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/cli-workflow.md +125 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/component-patterns.md +241 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/config-schema.md +296 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/cosmos-components.md +137 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/field-behavior.md +155 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/field-essentials.md +90 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/field-subtypes-extra.md +68 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/localization.md +30 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/pcore-pconnect-apis.md +77 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/presentation-essentials.md +57 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/props-contract.md +182 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/state-matrix.md +102 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/storybook-pattern.md +262 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/styles-pattern.md +54 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/template-essentials.md +87 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/template-patterns.md +131 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/test-pattern.md +215 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/ui-gallery-reuse.md +93 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/widget-essentials.md +84 -0
- package/src/ai/project/.claude/skills/create-dx-component/references/widget-patterns.md +164 -0
- package/src/ai/project/.claude/skills/currency/SKILL.md +46 -0
- package/src/ai/project/.claude/skills/date/SKILL.md +46 -0
- package/src/ai/project/.claude/skills/decimal/SKILL.md +49 -0
- package/src/ai/project/.claude/skills/details/SKILL.md +60 -0
- package/src/ai/project/.claude/skills/email/SKILL.md +42 -0
- package/src/ai/project/.claude/skills/field/SKILL.md +68 -0
- package/src/ai/project/.claude/skills/form/SKILL.md +51 -0
- package/src/ai/project/.claude/skills/generate-component-set/SKILL.md +80 -0
- package/src/ai/project/.claude/skills/generate-component-set/component-manifest.json +161 -0
- package/src/ai/project/.claude/skills/identify-components/SKILL.md +76 -0
- package/src/ai/project/.claude/skills/integer/SKILL.md +45 -0
- package/src/ai/project/.claude/skills/page/SKILL.md +60 -0
- package/src/ai/project/.claude/skills/page-widget/SKILL.md +55 -0
- package/src/ai/project/.claude/skills/percentage/SKILL.md +52 -0
- package/src/ai/project/.claude/skills/phone/SKILL.md +44 -0
- package/src/ai/project/.claude/skills/picklist/SKILL.md +50 -0
- package/src/ai/project/.claude/skills/plan-dx-component/SKILL.md +51 -0
- package/src/ai/project/.claude/skills/plan-dx-component/references/design-system-mapping.md +108 -0
- package/src/ai/project/.claude/skills/plan-dx-component/references/intake.md +146 -0
- package/src/ai/project/.claude/skills/plan-dx-component/references/plan-template.md +76 -0
- package/src/ai/project/.claude/skills/plan-dx-component/references/requirements-template.md +88 -0
- package/src/ai/project/.claude/skills/presentation/SKILL.md +61 -0
- package/src/ai/project/.claude/skills/publish-library/SKILL.md +106 -0
- package/src/ai/project/.claude/skills/radiobuttons/SKILL.md +51 -0
- package/src/ai/project/.claude/skills/review-component/SKILL.md +49 -0
- package/src/ai/project/.claude/skills/review-component/references/checklist.md +77 -0
- package/src/ai/project/.claude/skills/template/SKILL.md +60 -0
- package/src/ai/project/.claude/skills/text/SKILL.md +45 -0
- package/src/ai/project/.claude/skills/update-dx-component/SKILL.md +56 -0
- package/src/ai/project/.claude/skills/update-dx-component/references/maintenance.md +43 -0
- package/src/ai/project/.claude/skills/url/SKILL.md +46 -0
- package/src/ai/project/.claude/skills/validate-component/SKILL.md +78 -0
- package/src/ai/project/.claude/skills/validate-component/references/runtime-troubleshooting.md +56 -0
- package/src/ai/project/.claude/skills/validate-component/scripts/check-component.mjs +327 -0
- package/src/ai/project/.claude/skills/widget/SKILL.md +59 -0
- package/src/ai/project/.gemini/settings.json +5 -0
- package/src/ai/project/AGENTS.md +74 -0
- package/src/ai/readme-section.md +91 -0
- package/src/cli.js +48 -7
- package/src/constants.js +54 -53
- package/src/internal-tests.js +27 -0
- package/src/tasks/ai-toggle/index.js +46 -0
- package/src/tasks/authenticate/helper.js +38 -38
- package/src/tasks/authenticate/index.js +17 -15
- package/src/tasks/build-all/helper.js +4 -4
- package/src/tasks/build-all/index.js +7 -7
- package/src/tasks/build-comp/helper.js +17 -17
- package/src/tasks/build-comp/index.js +10 -10
- package/src/tasks/build-jest-assets/index.js +7 -9
- package/src/tasks/build-lib/helper.js +8 -8
- package/src/tasks/build-lib/index.js +8 -8
- package/src/tasks/bundle/builder/index.js +9 -12
- package/src/tasks/bundle/builder/modules.js +8 -9
- package/src/tasks/bundle/builder/paths.js +2 -19
- package/src/tasks/bundle/builder/webpack.config.js +60 -77
- package/src/tasks/bundle/index.js +8 -8
- package/src/tasks/create/index.js +35 -35
- package/src/tasks/create/templates/Constellation/Field/Boolean/index.tsx.mustache +1 -36
- package/src/tasks/create/templates/Constellation/Field/Date/date.ts.mustache +2 -2
- package/src/tasks/create/templates/Constellation/Field/Date/index.tsx.mustache +2 -27
- package/src/tasks/create/templates/Constellation/Field/DateTime/date-utils.ts.mustache +2 -2
- package/src/tasks/create/templates/Constellation/Field/DateTime/date.ts.mustache +2 -2
- package/src/tasks/create/templates/Constellation/Field/DateTime/index.tsx.mustache +2 -35
- package/src/tasks/create/templates/Constellation/Field/Decimal/index.tsx.mustache +3 -36
- package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/index.tsx.mustache +4 -39
- package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/index.tsx.mustache +4 -53
- package/src/tasks/create/templates/Constellation/Field/Icon-Button-URL/index.tsx.mustache +5 -5
- package/src/tasks/create/templates/Constellation/Field/Integer/index.tsx.mustache +3 -36
- package/src/tasks/create/templates/Constellation/Field/Picklist/index.tsx.mustache +7 -42
- package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/component-constants.ts +1 -1
- package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/date.ts.mustache +0 -2
- package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/embed-utils.ts.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/index.tsx.mustache +11 -11
- package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/repeat-utils.ts.mustache +3 -13
- package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/textformat-utils.tsx.mustache +2 -3
- package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/utils.ts.mustache +28 -28
- package/src/tasks/create/templates/Constellation/Field/Picklist-RadioButtons/index.tsx.mustache +2 -2
- package/src/tasks/create/templates/Constellation/Field/Picklist-RadioButtons/textformat-utils.tsx.mustache +2 -3
- package/src/tasks/create/templates/Constellation/Field/Text/index.tsx.mustache +4 -33
- package/src/tasks/create/templates/Constellation/Field/Text-Email/index.tsx.mustache +3 -33
- package/src/tasks/create/templates/Constellation/Field/Text-Input/index.tsx.mustache +3 -31
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/index.tsx.mustache +3 -31
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/index.tsx.mustache +3 -35
- package/src/tasks/create/templates/Constellation/Field/Text-URL/index.tsx.mustache +3 -33
- package/src/tasks/create/templates/Constellation/Field/Text-URL/text-url.tsx.mustache +2 -3
- package/src/tasks/create/templates/Constellation/Field/TimeofDay/index.tsx.mustache +2 -35
- package/src/tasks/create/templates/Constellation/Field/TimeofDay/time-of-day.ts.mustache +2 -2
- package/src/tasks/create/templates/Constellation/Template/DETAILS/Avatar.tsx.mustache +19 -15
- package/src/tasks/create/templates/Constellation/Template/DETAILS/Operator.tsx.mustache +6 -6
- package/src/tasks/create/templates/Constellation/Template/DETAILS/demo.stories.tsx.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Template/DETAILS/index.tsx.mustache +4 -8
- package/src/tasks/create/templates/Constellation/Template/DETAILS/mock.ts.mustache +9 -9
- package/src/tasks/create/templates/Constellation/Template/DETAILS/utils.js.mustache +4 -8
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/Avatar.tsx.mustache +19 -15
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/Operator.tsx.mustache +6 -6
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/demo.stories.tsx.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/index.tsx.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/mock.ts.mustache +9 -9
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/utils.ts.mustache +4 -8
- package/src/tasks/create/templates/Constellation/Template/FORM/demo.stories.tsx.mustache +8 -8
- package/src/tasks/create/templates/Constellation/Template/FORM-region/demo.stories.tsx.mustache +8 -8
- package/src/tasks/create/templates/Constellation/Template/PAGE/utils.ts.mustache +4 -9
- package/src/tasks/create/templates/Constellation/Widget/CASE/demo.test.tsx.mustache +3 -3
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/Avatar.tsx.mustache +19 -14
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/Operator.tsx.mustache +6 -6
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/index.tsx.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/mock.ts.mustache +1 -1
- package/src/tasks/create/templates/Launchpad/Field/Icon-Button-URL/index.tsx.mustache +5 -5
- package/src/tasks/create/templates/Launchpad/Field/Text-Phone/index.tsx.mustache +3 -35
- package/src/tasks/create/templates/Launchpad/Field/__components.md +1 -1
- package/src/tasks/create/templates/Launchpad/Template/FORM/demo.stories.tsx.mustache +8 -8
- package/src/tasks/create/templates/Launchpad/Template/FORM-region/demo.stories.tsx.mustache +8 -8
- package/src/tasks/create/templates/Launchpad/Widget/CASE/demo.test.tsx.mustache +3 -3
- package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/index.tsx.mustache +1 -1
- package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/mock.ts.mustache +1 -1
- package/src/tasks/create-all/index.js +42 -41
- package/src/tasks/create-lib/helper.js +13 -13
- package/src/tasks/create-lib/index.js +5 -5
- package/src/tasks/create-version/helper.js +10 -10
- package/src/tasks/create-version/index.js +3 -4
- package/src/tasks/delete/helper.js +20 -19
- package/src/tasks/delete/index.js +2 -2
- package/src/tasks/delete-all/helper.js +26 -25
- package/src/tasks/delete-all/index.js +2 -2
- package/src/tasks/delete-lib/helper.js +6 -6
- package/src/tasks/delete-lib/index.js +6 -6
- package/src/tasks/delete-pub/helper.js +18 -18
- package/src/tasks/delete-pub/index.js +8 -8
- package/src/tasks/delete-version/index.js +2 -2
- package/src/tasks/dev-server/index.js +1 -1
- package/src/tasks/export-archive/helper.js +21 -21
- package/src/tasks/export-archive/index.js +27 -40
- package/src/tasks/export-rc/helper.js +34 -34
- package/src/tasks/export-rc/index.js +21 -31
- package/src/tasks/import-archive/helper.js +39 -39
- package/src/tasks/import-archive/index.js +69 -89
- package/src/tasks/import-comp/helper.js +8 -8
- package/src/tasks/import-comp/index.js +30 -42
- package/src/tasks/index.js +5 -0
- package/src/tasks/init/Node.gitignore +149 -0
- package/src/tasks/init/helper.js +15 -8
- package/src/tasks/init/index.js +115 -35
- package/src/tasks/init/template/.prettierrc.json +4 -1
- package/src/tasks/init/template/.storybook/main.ts +1 -4
- package/src/tasks/init/template/.storybook/manager.ts +1 -1
- package/src/tasks/init/template/.storybook/preview.tsx +2 -2
- package/src/tasks/init/template/.storybook/theme.js +1 -1
- package/src/tasks/init/template/.vscode/extensions.json +0 -1
- package/src/tasks/init/template/README.md +2 -2
- package/src/tasks/init/template/eslint.config.mjs +13 -155
- package/src/tasks/init/template/jest.config.cjs +2 -0
- package/src/tasks/init/template/package-lock.json +26864 -0
- package/src/tasks/init/template/package.json.mustache +19 -74
- package/src/tasks/init/template/setupTests.ts +10 -4
- package/src/tasks/init/template/tsconfig.json +14 -6
- package/src/tasks/internal-test/index.js +21 -0
- package/src/tasks/internal-test-full/index.js +15 -0
- package/src/tasks/internal-test-functional/index.js +15 -0
- package/src/tasks/internal-test-unit/index.js +13 -0
- package/src/tasks/linter/index.js +2 -2
- package/src/tasks/list/helper.js +41 -40
- package/src/tasks/list/index.js +3 -3
- package/src/tasks/list-lib/helper.js +5 -5
- package/src/tasks/list-lib/index.js +8 -8
- package/src/tasks/list-pub/helper.js +23 -16
- package/src/tasks/list-pub/index.js +24 -21
- package/src/tasks/move/helper.js +8 -8
- package/src/tasks/move/index.js +19 -23
- package/src/tasks/promote-webpack/index.js +4 -4
- package/src/tasks/promote-webpack/webpack.config.js +62 -93
- package/src/tasks/publish/helper.js +21 -21
- package/src/tasks/publish/index.js +16 -16
- package/src/tasks/publish-all/helper.js +20 -20
- package/src/tasks/publish-all/index.js +11 -12
- package/src/tasks/publish-archive/helper.js +9 -9
- package/src/tasks/publish-archive/index.js +12 -14
- package/src/tasks/publish-lib/helper.js +3 -3
- package/src/tasks/publish-lib/index.js +28 -34
- package/src/tasks/quarantine/index.js +8 -8
- package/src/tasks/rename/index.js +26 -30
- package/src/tasks/rename-lib/index.js +21 -25
- package/src/tasks/restore/index.js +8 -8
- package/src/tasks/restore-config/index.js +3 -5
- package/src/tasks/set-perm/index.js +8 -8
- package/src/tasks/show-help/index.js +17 -9
- package/src/tasks/show-status/index.js +2 -2
- package/src/tasks/store/index.js +8 -8
- package/src/tasks/switch-lib/helper.js +7 -7
- package/src/tasks/switch-lib/index.js +7 -7
- package/src/tasks/switch-version/helper.js +6 -6
- package/src/tasks/switch-version/index.js +7 -7
- package/src/tasks/update/index.js +1 -1
- package/src/tasks/upgrade/index.js +7 -7
- package/src/tasks/validator/index.js +49 -203
- package/src/util.js +169 -186
- package/src/rules/no-pcore-pconnect-in-presentation.js +0 -103
- package/src/tasks/init/template/.stylelintrc.json +0 -4
- package/src/tasks/init/template/babel.config.cjs +0 -22
- package/src/tasks/init/template/cspell.json +0 -14
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
# REST Client, Data APIs & Cascade — Method Details
|
|
2
|
+
|
|
3
|
+
> Part of the [PCore / PConnect API Reference skills](../README.md). Companion to [pcore-rest-data-messaging.md](./pcore-rest-data-messaging.md), which covers the top-level `PCore.get*()` accessors. This file catalogs the methods available on the objects those accessors return.
|
|
4
|
+
>
|
|
5
|
+
> Curated subset — internal query-building helpers used only by `fetchData()`'s own pipeline are omitted.
|
|
6
|
+
|
|
7
|
+
## RestClient (via `PCore.getRestClient()`)
|
|
8
|
+
|
|
9
|
+
| Method | Signature | Purpose |
|
|
10
|
+
| ------------------------------------------------------ | ---------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
|
|
11
|
+
| `invokeRestApi(routeKey, payload, context?, options?)` | `(routeKey: string, payload: unknown, context?: string, options?: unknown): Promise<unknown>` | Invokes a Pega REST API by route key. |
|
|
12
|
+
| `invokeCustomRestApi(endpointUrl, config, context)` | `(endpointUrl: string, config: unknown, context: string): Promise<unknown>` | Invokes a custom REST API by absolute or relative URL. |
|
|
13
|
+
| `getCancelTokenSource()` | `(): { token: AbortSignal; cancel: () => void }` | Returns a cancel token source to cancel an in-flight request. |
|
|
14
|
+
| `isRequestCanceled(err)` | `(err: unknown): boolean` | Checks whether a caught error was caused by request cancellation. |
|
|
15
|
+
| `getHeaderProcessor()` | `(): { registerHeader: Function; unRegisterHeader: Function; getRegisteredHeaders: Function }` | Manages custom headers applied to outgoing requests. |
|
|
16
|
+
| `getCaseApi()` | `(): unknown` | Returns lower-level case-related REST operations. |
|
|
17
|
+
|
|
18
|
+
**Example:**
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
const { invokeRestApi, getCancelTokenSource, isRequestCanceled } = PCore.getRestClient();
|
|
22
|
+
const cancelTokenSource = getCancelTokenSource();
|
|
23
|
+
|
|
24
|
+
invokeRestApi('D_MyDataPage', { cancelTokenSource }).catch((error) => {
|
|
25
|
+
if (isRequestCanceled(error)) {
|
|
26
|
+
// ignore — request was canceled
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## DataApi (via `PCore.getDataApi()`)
|
|
34
|
+
|
|
35
|
+
| Method | Signature | Purpose |
|
|
36
|
+
| ----------------------------------------------- | ---------------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
|
|
37
|
+
| `DataApi.init(config, context?)` | `(config: unknown, context?: string): Promise<DataApi>` | Static factory — creates and caches a `DataApi` instance for a data source. |
|
|
38
|
+
| `DataApi.clearContextedCache(context)` | `(context: string): void` | Static — clears cached `DataApi` instances for a context. |
|
|
39
|
+
| `fetchData(searchText?, isPaginated?, config?)` | `(searchText?: string, isPaginated?: boolean, config?: unknown): Promise<unknown>` | Fetches data with optional pagination and caching. |
|
|
40
|
+
| `getData(searchText, config?)` | `(searchText: string, config?: unknown): Promise<unknown>` | Fetches data matching search text (queryable or non-queryable). |
|
|
41
|
+
| `registerForBufferedCall(params)` | `(params: { waitTime?: number; maxSize?: number }): this` | Configures batched/debounced fetches for typeahead-style fields. |
|
|
42
|
+
| `isValidDatasource()` | `(): boolean` | Returns whether a valid data source is configured. |
|
|
43
|
+
|
|
44
|
+
**Example:**
|
|
45
|
+
|
|
46
|
+
```typescript
|
|
47
|
+
PCore.getDataApi()
|
|
48
|
+
.init(dataConfig, contextName)
|
|
49
|
+
.then((dataApiInstance) => {
|
|
50
|
+
dataApiInstance.registerForBufferedCall({ waitTime: 50 });
|
|
51
|
+
return dataApiInstance.fetchData(searchTerm);
|
|
52
|
+
});
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
**Notes:** For most list/data-page lookups, prefer the simpler `PCore.getDataApiUtils()` or `PCore.getDataPageUtils()` — reach for a live `DataApi` instance only when you need buffered/typeahead behavior.
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## DataApiUtils (via `PCore.getDataApiUtils()`)
|
|
60
|
+
|
|
61
|
+
| Method | Signature | Purpose |
|
|
62
|
+
| ---------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
|
|
63
|
+
| `getData(dataViewName, payload?, context?, options?)` | `(dataViewName: string, payload?: unknown, context?: string, options?: unknown): Promise<unknown>` | Fetches list data from a data view with columns, filters, and paging. |
|
|
64
|
+
| `getListDataView(dataViewName, payload?, context?, options?)` | same shape as `getData` | Alias for `getData`. |
|
|
65
|
+
| `getListCount(dataViewName, payload?, context?)` | `(dataViewName: string, payload?: unknown, context?: string): Promise<unknown>` | Returns the count of records matching a query. |
|
|
66
|
+
| `getDataObjectView(dataViewName, viewName, params, context, options?)` | `(dataViewName: string, viewName: string, params: unknown, context: string, options?: unknown): Promise<unknown>` | Retrieves a structured view object initialized with data view parameters. |
|
|
67
|
+
| `getDataViewMetadata(dataViewName, context, associationFilter?, propertyFilter?)` | `(dataViewName: string, context: string \| undefined, associationFilter?: string[] \| null, propertyFilter?: string[]): Promise<unknown>` | Retrieves metadata (fields, `isQueryable`) for a data view. |
|
|
68
|
+
| `moveListRecords(payload, context)` | `(payload: unknown, context: string): Promise<{ pyStatus: string }>` | Moves/reorders records within a list. |
|
|
69
|
+
| `getCaseEditMetadata(caseID, context)` | `(caseID: string, context: string): Promise<unknown>` | _Deprecated._ Fetches case edit metadata. |
|
|
70
|
+
| `getCaseEditLock(caseID, context)` | `(caseID: string, context: string): Promise<unknown>` | _Deprecated._ Acquires an exclusive edit lock on a case. |
|
|
71
|
+
| `updateCaseEditFieldsData(caseID, changeSet, eTag, context)` | `(caseID: string, changeSet: unknown, eTag: string, context: string): Promise<unknown>` | _Deprecated._ Updates case field data (requires an eTag from `getCaseEditLock`). |
|
|
72
|
+
|
|
73
|
+
**Example:**
|
|
74
|
+
|
|
75
|
+
```typescript
|
|
76
|
+
const { data } = await PCore.getDataApiUtils().getData('D_MyDataPage', { paging: { pageSize: 20 } }, context);
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## DataPageUtils (via `PCore.getDataPageUtils()`)
|
|
82
|
+
|
|
83
|
+
| Method | Signature | Purpose |
|
|
84
|
+
| ---------------------------------------------------------------------------------------------------- | --------------------------------------------------- | ----------------------------------------------------------------------------- |
|
|
85
|
+
| `getDataAsync(dataPageName, context, parameters?, paging?, query?, options?)` | `(...): Promise<unknown>` | Fetches list-type data page results with caching, query, and pagination. |
|
|
86
|
+
| `getPageDataAsync(dataPageName, context?, parameters?, options?)` | `(...): Promise<unknown>` | Fetches page-type (single-object) data page results. |
|
|
87
|
+
| `subscribeToDataPageUpdates(subscriptionId, callback, dataPageName, parameters?)` | `(...): boolean` | Subscribes to server push notifications when a data page updates. |
|
|
88
|
+
| `unsubscribeToDataPageUpdates(subscriptionId, dataPageName, parameters?)` | `(...): boolean` | Unsubscribes from data page update notifications. |
|
|
89
|
+
| `subscribeToUpdate(dataPageName, dependentFields, context, pageReference, callback, subscriptionId)` | `(...): void` | Subscribes to cascading updates when dependent fields change. |
|
|
90
|
+
| `unsubscribe(dataPageName, dependentFields, context, pageReference, subscriptionId)` | `(...): void` | Unsubscribes from cascading field-change notifications. |
|
|
91
|
+
| `markDataInstanceDirty(dataPageName, parameters)` | `(dataPageName: string, parameters: unknown): void` | Marks a cached data page instance as stale, forcing a refresh on next fetch. |
|
|
92
|
+
| `isDataPage(propertyRef?)` | `(propertyRef?: string): boolean` | Returns whether a property reference is a data page (`D_`/`Declare_` prefix). |
|
|
93
|
+
| `updateDataPageStore(sharedDataPages?)` | `(sharedDataPages?: unknown): void` | Merges server-pushed shared data page updates into application state. |
|
|
94
|
+
|
|
95
|
+
**Example:**
|
|
96
|
+
|
|
97
|
+
```typescript
|
|
98
|
+
const response = await PCore.getDataPageUtils().getPageDataAsync(
|
|
99
|
+
'D_MyDataPage',
|
|
100
|
+
context,
|
|
101
|
+
{ AccountID: accountId },
|
|
102
|
+
{ invalidateCache: true }
|
|
103
|
+
);
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## DataTypeUtils (via `PCore.getDataTypeUtils()`)
|
|
109
|
+
|
|
110
|
+
| Method | Signature | Purpose |
|
|
111
|
+
| ---------------------------------- | ----------------------------------- | ------------------------------------------------------------------- |
|
|
112
|
+
| `getSavableDataPage(dataClass)` | `(dataClass: string): string` | Returns the default save data page for a data class. |
|
|
113
|
+
| `getLookUpDataPage(dataClass)` | `(dataClass: string): string` | Returns the default record-lookup data page for a data class. |
|
|
114
|
+
| `getLookUpDataPageInfo(dataClass)` | `(dataClass: string): unknown` | Returns metadata for the lookup data page (key mapping, and so on). |
|
|
115
|
+
| `getDataPageKeys(dataPageName)` | `(dataPageName: string): unknown[]` | Returns the key definitions for a data page. |
|
|
116
|
+
|
|
117
|
+
**Example:**
|
|
118
|
+
|
|
119
|
+
```typescript
|
|
120
|
+
const lookupDataPage = PCore.getDataTypeUtils().getLookUpDataPage(classID);
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## CascadeManager (via `PCore.getCascadeManager()`)
|
|
126
|
+
|
|
127
|
+
| Method | Signature | Purpose |
|
|
128
|
+
| --------------------------------------------------------------------------------------------- | ------------- | ---------------------------------------------------------------------- |
|
|
129
|
+
| `registerFields(context, pageReference, fields, callback, subscriberId)` | `(...): void` | Registers fields so a callback runs when their values change. |
|
|
130
|
+
| `unRegisterFields(context, pageReference, fields, subscriberId)` | `(...): void` | Unregisters previously registered fields. |
|
|
131
|
+
| `registerListField(context, pageReference, listField, callback, subscriberId)` | `(...): void` | Registers a page-list field and its parameter dependencies. |
|
|
132
|
+
| `unRegisterListField(context, pageReference, listField, subscriberId)` | `(...): void` | Unregisters a page-list field registration. |
|
|
133
|
+
| `registerResetDependencies(context, pageReference, target, dependentProps, fieldType, mode?)` | `(...): void` | Registers a target field to be reset when dependent properties change. |
|
|
134
|
+
| `deregisterResetDependencies(context, pageReference, target, dependentProps, fieldType)` | `(...): void` | Deregisters a reset-dependency registration. |
|
|
135
|
+
|
|
136
|
+
**Example:**
|
|
137
|
+
|
|
138
|
+
```typescript
|
|
139
|
+
useEffect(() => {
|
|
140
|
+
PCore.getCascadeManager().registerFields(contextID, '', dependentProps, onDependentPropsChange, subscriberId);
|
|
141
|
+
return () => {
|
|
142
|
+
PCore.getCascadeManager().unRegisterFields(contextID, '', dependentProps, subscriberId);
|
|
143
|
+
};
|
|
144
|
+
}, []);
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
## MashupApi (via `PCore.getMashupApi()`)
|
|
150
|
+
|
|
151
|
+
| Method | Signature | Purpose |
|
|
152
|
+
| --------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- |
|
|
153
|
+
| `openCase(caseId, targetContext?, options?)` | `(caseId: string, targetContext?: string, options?: unknown): Promise<unknown>` | Loads and displays a case by ID in a target container. |
|
|
154
|
+
| `createCase(className, targetContext?, options?)` | `(className: string, targetContext?: string, options?: unknown): Promise<unknown>` | Creates and displays a new case in a target container. |
|
|
155
|
+
| `getNextWork(targetContext?, options?)` | `(targetContext?: string, options?: unknown): Promise<unknown>` | Retrieves and displays the user's highest-priority assignment. |
|
|
156
|
+
| `openAssignment(assignmentId, targetContext?, options?)` | `(assignmentId: string, targetContext?: string, options?: unknown): Promise<unknown>` | Loads and displays an assignment by ID. |
|
|
157
|
+
| `openPage(pageName, className, targetContext?, options?)` | `(pageName: string, className: string, targetContext?: string, options?: unknown): Promise<unknown>` | Opens a page view (not a case/assignment) in a target container. |
|
|
158
|
+
| `getCurrentContextAPI(pageReference, targetContext?)` | `(pageReference: string, targetContext?: string): PConnect` | Returns a `PConnect` object for a given page reference/context. |
|
|
159
|
+
|
|
160
|
+
**Example:**
|
|
161
|
+
|
|
162
|
+
```typescript
|
|
163
|
+
await PCore.getMashupApi().openCase(caseHandle);
|
|
164
|
+
```
|
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
# PCore: REST, Data & Messaging
|
|
2
|
+
|
|
3
|
+
> Part of the [PCore / PConnect API Reference skills](../README.md). See [pcore-rest-data-details.md](./pcore-rest-data-details.md) and [pcore-messaging-details.md](./pcore-messaging-details.md) for the full method catalogs of the objects these accessors return.
|
|
4
|
+
|
|
5
|
+
## `getRestClient()`
|
|
6
|
+
|
|
7
|
+
**Purpose:** Entry point to the REST client, exposing `invokeRestApi`, `getCancelTokenSource`, and `isRequestCanceled`.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
getRestClient(): RestClient
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
**Example:**
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
const { invokeRestApi, getCancelTokenSource, isRequestCanceled } = PCore.getRestClient();
|
|
19
|
+
|
|
20
|
+
const cancelTokenSource = getCancelTokenSource();
|
|
21
|
+
invokeRestApi('D_MyDataPage', { cancelTokenSource })
|
|
22
|
+
.then((response) => {
|
|
23
|
+
// handle response
|
|
24
|
+
})
|
|
25
|
+
.catch((error) => {
|
|
26
|
+
if (isRequestCanceled(error)) {
|
|
27
|
+
// request was canceled — ignore
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## `getDataApi()`
|
|
35
|
+
|
|
36
|
+
**Purpose:** Creates a live `DataApi` instance for a datasource — used by components that need buffered/typeahead fetches (for example, an autocomplete field backed by a data page).
|
|
37
|
+
|
|
38
|
+
**Signature:**
|
|
39
|
+
|
|
40
|
+
```typescript
|
|
41
|
+
getDataApi(): DataApi
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
**Example:**
|
|
45
|
+
|
|
46
|
+
```typescript
|
|
47
|
+
PCore.getDataApi()
|
|
48
|
+
.init(dataConfig, contextName)
|
|
49
|
+
.then((dataApiInstance) => {
|
|
50
|
+
dataApiInstance.registerForBufferedCall({ waitTime: 50 });
|
|
51
|
+
dataApiInstance.fetchData(searchTerm).then((response) => {
|
|
52
|
+
// handle response
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
**Notes:** `init()` returns a `Promise` that resolves to a `DataApi` instance scoped to the given context. Call `clearContextedCache(contextName)` when tearing down.
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## `getDataApiUtils()`
|
|
62
|
+
|
|
63
|
+
**Purpose:** Utility APIs to retrieve information from a data view without managing a live `DataApi` instance.
|
|
64
|
+
|
|
65
|
+
**Signature:**
|
|
66
|
+
|
|
67
|
+
```typescript
|
|
68
|
+
getDataApiUtils(): DataApiUtils
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
**Example:**
|
|
72
|
+
|
|
73
|
+
```typescript
|
|
74
|
+
PCore.getDataApiUtils()
|
|
75
|
+
.getDataViewMetadata(dataPageID, context, null, fieldIDs)
|
|
76
|
+
.then(({ data }) => {
|
|
77
|
+
// use resolved field metadata
|
|
78
|
+
});
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## `getDataPageUtils()`
|
|
84
|
+
|
|
85
|
+
**Purpose:** Utility methods to retrieve data page data (page-type or list-type), with optional cache control.
|
|
86
|
+
|
|
87
|
+
**Signature:**
|
|
88
|
+
|
|
89
|
+
```typescript
|
|
90
|
+
getDataPageUtils(): DataPageUtils
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
**Example:**
|
|
94
|
+
|
|
95
|
+
```typescript
|
|
96
|
+
const response = await PCore.getDataPageUtils().getPageDataAsync(
|
|
97
|
+
'D_MyDataPage',
|
|
98
|
+
context,
|
|
99
|
+
{ AccountID: accountId },
|
|
100
|
+
{ invalidateCache: true }
|
|
101
|
+
);
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## `getDataTypeUtils()`
|
|
107
|
+
|
|
108
|
+
**Purpose:** Utility methods to retrieve information about a data type, such as its lookup data page or class keys.
|
|
109
|
+
|
|
110
|
+
**Signature:**
|
|
111
|
+
|
|
112
|
+
```typescript
|
|
113
|
+
getDataTypeUtils(): DataTypeUtils
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
**Example:**
|
|
117
|
+
|
|
118
|
+
```typescript
|
|
119
|
+
const lookupDataPage = PCore.getDataTypeUtils().getLookUpDataPage(classID);
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## `getCascadeManager()`
|
|
125
|
+
|
|
126
|
+
**Purpose:** Registers a callback to run when a set of properties change — used to build cascading/dependent fields (for example, a country field that resets a state field).
|
|
127
|
+
|
|
128
|
+
**Signature:**
|
|
129
|
+
|
|
130
|
+
```typescript
|
|
131
|
+
getCascadeManager(): CascadeManager
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
**Example:**
|
|
135
|
+
|
|
136
|
+
```typescript
|
|
137
|
+
useEffect(() => {
|
|
138
|
+
PCore.getCascadeManager().registerFields(contextID, '', dependentProps, onDependentPropsChange, subscriberId);
|
|
139
|
+
|
|
140
|
+
return () => {
|
|
141
|
+
PCore.getCascadeManager().unRegisterFields(contextID, '', dependentProps, subscriberId);
|
|
142
|
+
};
|
|
143
|
+
}, []);
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
**Notes:** Always pair `registerFields` with a matching `unRegisterFields` on cleanup to avoid stale callbacks.
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## `getMashupApi()`
|
|
151
|
+
|
|
152
|
+
**Purpose:** Provides APIs to work with cases and pages across a mashup/embedding boundary.
|
|
153
|
+
|
|
154
|
+
**Signature:**
|
|
155
|
+
|
|
156
|
+
```typescript
|
|
157
|
+
getMashupApi(): MashupApi
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
**Example:**
|
|
161
|
+
|
|
162
|
+
```typescript
|
|
163
|
+
PCore.getMashupApi().openCase(caseHandle);
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## `getSemanticUrlUtils()`
|
|
169
|
+
|
|
170
|
+
**Purpose:** Utilities to build and resolve semantic URLs, including the constant names used for supported semantic-URL actions.
|
|
171
|
+
|
|
172
|
+
**Signature:**
|
|
173
|
+
|
|
174
|
+
```typescript
|
|
175
|
+
getSemanticUrlUtils(): SemanticUrlUtils
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
**Example:**
|
|
179
|
+
|
|
180
|
+
```typescript
|
|
181
|
+
const { ACTION_OPENWORKBYHANDLE, ACTION_SHOWDATA } = PCore.getSemanticUrlUtils().getActions();
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## `getMessageManager()`
|
|
187
|
+
|
|
188
|
+
**Purpose:** Adds, reads, and clears case/validation messages stored in the application state.
|
|
189
|
+
|
|
190
|
+
**Signature:**
|
|
191
|
+
|
|
192
|
+
```typescript
|
|
193
|
+
getMessageManager(): MessageManager
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
**Example:**
|
|
197
|
+
|
|
198
|
+
```typescript
|
|
199
|
+
const { addMessages, clearMessages } = PCore.getMessageManager();
|
|
200
|
+
|
|
201
|
+
addMessages({
|
|
202
|
+
messages: [{ type: 'error', message: 'Something went wrong' }],
|
|
203
|
+
category: 'PAGE',
|
|
204
|
+
context
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
clearMessages({ category: 'PAGE', context });
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
---
|
|
211
|
+
|
|
212
|
+
## `getPubSubUtils()`
|
|
213
|
+
|
|
214
|
+
**Purpose:** Entry point to the application-wide publish/subscribe event bus.
|
|
215
|
+
|
|
216
|
+
**Signature:**
|
|
217
|
+
|
|
218
|
+
```typescript
|
|
219
|
+
getPubSubUtils(): PubSubUtils
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
**Example:**
|
|
223
|
+
|
|
224
|
+
```typescript
|
|
225
|
+
const { subscribe, unsubscribe, publish } = PCore.getPubSubUtils();
|
|
226
|
+
const stageCreatedEvent = PCore.getEvents().getCaseEvent().CREATE_STAGE_DONE;
|
|
227
|
+
|
|
228
|
+
subscribe(stageCreatedEvent, onStageCreated, 'stageCreatedHandler');
|
|
229
|
+
// later
|
|
230
|
+
unsubscribe(stageCreatedEvent, 'stageCreatedHandler');
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
## `getEvents()`
|
|
236
|
+
|
|
237
|
+
**Purpose:** Returns the catalog of case-related event names, intended for use as topics with `getPubSubUtils()`.
|
|
238
|
+
|
|
239
|
+
**Signature:**
|
|
240
|
+
|
|
241
|
+
```typescript
|
|
242
|
+
getEvents(): Events
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
**Example:**
|
|
246
|
+
|
|
247
|
+
```typescript
|
|
248
|
+
const caseCreated = PCore.getEvents().getCaseEvent().CREATE_STAGE_DONE;
|
|
249
|
+
PCore.getPubSubUtils().subscribe(caseCreated, onStageCreated);
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
---
|
|
253
|
+
|
|
254
|
+
## `getMessagingServiceManager()`
|
|
255
|
+
|
|
256
|
+
**Purpose:** Provides WebSocket-based messaging service APIs, including subscribing to case/interaction notifications and reading user presence.
|
|
257
|
+
|
|
258
|
+
**Signature:**
|
|
259
|
+
|
|
260
|
+
```typescript
|
|
261
|
+
getMessagingServiceManager(): MessagingServiceManager
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
**Example:**
|
|
265
|
+
|
|
266
|
+
```typescript
|
|
267
|
+
const userState = PCore.getMessagingServiceManager().getUserPresence().getUserState(userIdentifier);
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
---
|
|
271
|
+
|
|
272
|
+
## `getActionsSequencer()`
|
|
273
|
+
|
|
274
|
+
**Purpose:** Returns the `ActionsSequencer`, which serializes case actions dispatched through `ActionsApi` to prevent race conditions. Most components don't need to interact with it directly since `ActionsApi` uses it internally.
|
|
275
|
+
|
|
276
|
+
**Signature:**
|
|
277
|
+
|
|
278
|
+
```typescript
|
|
279
|
+
getActionsSequencer(): ActionsSequencer
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
**Example:**
|
|
283
|
+
|
|
284
|
+
```typescript
|
|
285
|
+
const sequencer = PCore.getActionsSequencer();
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
---
|
|
289
|
+
|
|
290
|
+
## `getExpressionEngine()`
|
|
291
|
+
|
|
292
|
+
**Purpose:** Evaluates an authored expression string against a given data context.
|
|
293
|
+
|
|
294
|
+
**Signature:**
|
|
295
|
+
|
|
296
|
+
```typescript
|
|
297
|
+
getExpressionEngine(): ExpressionEngine
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
**Example:**
|
|
301
|
+
|
|
302
|
+
```typescript
|
|
303
|
+
// CreateC11nEnv is `{ getPConnect: () => PConnect }`; BootstrapUtils.createC11nEnv(meta) returns one.
|
|
304
|
+
const options = { pConnect: PCore.getBootstrapUtils().createC11nEnv(meta) };
|
|
305
|
+
const result = PCore.getExpressionEngine().evaluate(expressionString, rowData, options);
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
**Notes:** In the 5.1.0 typedefs `evaluate(expression: string, data: object, options: { pConnect: CreateC11nEnv }): boolean` takes all three arguments and returns a `boolean` (it evaluates a filter expression such as `.HomeNumber != '123'` against `data`). `options` is typed as required, although the typedef's own comment calls it optional.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# State & Context Tree — Method Details
|
|
2
|
+
|
|
3
|
+
> Part of the [PCore / PConnect API Reference skills](../README.md). Companion to [pcore-store-context-state.md](./pcore-store-context-state.md), which covers the top-level `PCore.get*()` accessors. This file catalogs the methods available on the objects those accessors return.
|
|
4
|
+
|
|
5
|
+
## StateUtils (via `PCore.getStateUtils()`)
|
|
6
|
+
|
|
7
|
+
| Method | Signature | Purpose |
|
|
8
|
+
| -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------- |
|
|
9
|
+
| `getSharedState(key)` | `(key: string): unknown` | Reads a property value from shared application state. |
|
|
10
|
+
| `setSharedState(key, value)` | `(key: string, value: unknown): void` | Writes a property value to shared application state. |
|
|
11
|
+
| `updateState(context, key, value, options?)` | `(context: string, key: string, value: unknown, options?: { pageReference?: string; isArrayDeepMerge?: boolean; skipDirtyValidation?: boolean; removePropertyFromChangedList?: boolean }): void` | Updates a property value for a given context with merge options. |
|
|
12
|
+
| `getSuggestionsContext(context)` | `(context: string): unknown` | Returns the Suggestions Context entry point for a given context. |
|
|
13
|
+
| `triggerRefresh(context, pageReference)` | `(context: string, pageReference: string): void` | Triggers a refresh of the assignment in the specified context. |
|
|
14
|
+
|
|
15
|
+
**Example:**
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
const stateUtils = PCore.getStateUtils();
|
|
19
|
+
stateUtils.updateState(context, 'caseInfo.ID', caseID, { skipDirtyValidation: true });
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## ContextTreeManager (via `PCore.getContextTreeManager()`)
|
|
25
|
+
|
|
26
|
+
| Method | Signature | Purpose |
|
|
27
|
+
| ----------------------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------------- |
|
|
28
|
+
| `onViewMutate(context, pageName, viewName, callback)` | `(...): void` | Registers a callback for view-hierarchy mutations. |
|
|
29
|
+
| `onPageListMutate(context, pageName, viewName, pageListName, callback)` | `(...): void` | Registers a callback for page-list hierarchy mutations. |
|
|
30
|
+
| `isFieldExists(context, propertyReference)` | `(context: string, propertyReference: string): boolean` | Checks whether a field is tracked in the context tree. |
|
|
31
|
+
| `getFieldsList(context)` | `(context: string): Map<string, unknown>` | Returns all editable/calculated fields tracked for a context. |
|
|
32
|
+
| `getFieldReferencePreviousValue(context, propertyReference)` | `(context: string, propertyReference: string): unknown` | Returns the previously stored value of a tracked field. |
|
|
33
|
+
|
|
34
|
+
**Example:**
|
|
35
|
+
|
|
36
|
+
```typescript
|
|
37
|
+
const trackedFields = PCore.getContextTreeManager().getFieldsList(contextName);
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
**Notes:** This class primarily supports the framework's own refresh/validation tracking; most mutation methods (`mutateField`, `removeFieldNode`, and so on) are invoked internally as part of the component render lifecycle rather than called directly by component code.
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# PCore: Store, Context & State
|
|
2
|
+
|
|
3
|
+
> Part of the [PCore / PConnect API Reference skills](../README.md). See [pcore-store-context-details.md](./pcore-store-context-details.md) for the full method catalogs of `StateUtils` and `ContextTreeManager`.
|
|
4
|
+
|
|
5
|
+
## `getStore()`
|
|
6
|
+
|
|
7
|
+
**Purpose:** Returns the Redux store instance backing the entire application state.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
getStore(): Store
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
**Example:**
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
const store = PCore.getStore();
|
|
20
|
+
return store.subscribe(() => {
|
|
21
|
+
// react to any store change
|
|
22
|
+
});
|
|
23
|
+
}, []);
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
**Notes:** The returned object is a standard Redux store (`getState()`, `dispatch()`, `subscribe()`). Prefer `pConn.getValue()`/`PCore.getStoreValue()` for reading specific values rather than reading raw state directly.
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## `getStoreValue(propReference, pageReference, context)`
|
|
31
|
+
|
|
32
|
+
**Purpose:** Returns the value of a property from the store, without needing a `PConnect` instance.
|
|
33
|
+
|
|
34
|
+
**Signature:**
|
|
35
|
+
|
|
36
|
+
```typescript
|
|
37
|
+
getStoreValue(propReference: string, pageReference: string, context: string): unknown
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
**Example:**
|
|
41
|
+
|
|
42
|
+
```typescript
|
|
43
|
+
const firstName = PCore.getStoreValue('.FirstName', 'caseInfo.content', 'app/primary_1');
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
**Notes:** `propReference` is the property path (e.g. `.FirstName`), `pageReference` is the page path (e.g. `caseInfo.content`), and `context` scopes the lookup to a specific container/view context.
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## `getStateUtils()`
|
|
51
|
+
|
|
52
|
+
**Purpose:** Returns `StateUtils`, a set of utilities for reading and updating shared application state.
|
|
53
|
+
|
|
54
|
+
**Signature:**
|
|
55
|
+
|
|
56
|
+
```typescript
|
|
57
|
+
getStateUtils(): StateUtils
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
**Example:**
|
|
61
|
+
|
|
62
|
+
```typescript
|
|
63
|
+
const stateUtils = PCore.getStateUtils();
|
|
64
|
+
stateUtils.updateState(context, 'caseInfo.ID', caseID, { skipDirtyValidation: true });
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## `createPConnect(config)`
|
|
70
|
+
|
|
71
|
+
**Purpose:** Creates a `PConnect` object from a component configuration — useful for rendering a component dynamically outside the normal `getPConnect()` prop chain (for example, a cell renderer inside a custom table).
|
|
72
|
+
|
|
73
|
+
**Signature:**
|
|
74
|
+
|
|
75
|
+
```typescript
|
|
76
|
+
createPConnect(config: {
|
|
77
|
+
meta: { type: string; config?: Record<string, unknown> };
|
|
78
|
+
options?: { context?: string; pageReference?: string; referenceList?: string };
|
|
79
|
+
}): { getPConnect: () => PConnect }
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
**Example:**
|
|
83
|
+
|
|
84
|
+
```typescript
|
|
85
|
+
const cellComponent = PCore.createPConnect({
|
|
86
|
+
meta: { type: 'TextInput', config: { label: 'Name', value: '.FirstName' } },
|
|
87
|
+
options: { context: 'app/primary_1', pageReference: 'caseInfo.content' }
|
|
88
|
+
});
|
|
89
|
+
const pConn = cellComponent.getPConnect();
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
**Notes:** `meta.type` is required; `options.context`/`options.pageReference` are only needed when the component must render under a context different from its parent's.
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## `getContextTreeManager()`
|
|
97
|
+
|
|
98
|
+
**Purpose:** Returns the `ContextTreeManager`, which tracks view/field dependencies confined to a view and its children (used to support refresh and validation behavior).
|
|
99
|
+
|
|
100
|
+
**Signature:**
|
|
101
|
+
|
|
102
|
+
```typescript
|
|
103
|
+
getContextTreeManager(): ContextTreeManager
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
**Example:**
|
|
107
|
+
|
|
108
|
+
```typescript
|
|
109
|
+
const viewNode = PCore.getContextTreeManager().getViewNode(contextName, pageReference, viewName);
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## `isDeepEqual(oldValue, newValue)`
|
|
115
|
+
|
|
116
|
+
**Purpose:** Determines whether two objects are equal via a deep comparison.
|
|
117
|
+
|
|
118
|
+
**Signature:**
|
|
119
|
+
|
|
120
|
+
```typescript
|
|
121
|
+
isDeepEqual(oldValue: object, newValue: object): boolean
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
**Example:**
|
|
125
|
+
|
|
126
|
+
```typescript
|
|
127
|
+
if (!PCore.isDeepEqual(previousMetadata, updatedMetadata)) {
|
|
128
|
+
// only re-dispatch when the metadata actually changed
|
|
129
|
+
}
|
|
130
|
+
```
|