@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,316 @@
|
|
|
1
|
+
# PConnect: State & Configuration Management, Data Access
|
|
2
|
+
|
|
3
|
+
> Part of the [PCore / PConnect API Reference skills](../README.md). Methods documented here are called on a `PConnect` instance (`pConn`), obtained via the `getPConnect()` prop passed to every component.
|
|
4
|
+
|
|
5
|
+
## `getStateProps()`
|
|
6
|
+
|
|
7
|
+
**Purpose:** Returns the reactive properties bound to state for the current component — the properties that trigger a re-render when they change.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
getStateProps(): Record<string, unknown>
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
**Example:**
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
const pConn = getPConnect();
|
|
19
|
+
const currentValue = pConn.getStateProps().value;
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## `getConfigProps(destinationObject?)`
|
|
25
|
+
|
|
26
|
+
**Purpose:** Returns the fully resolved configuration props for the component — annotations such as `@P` (property references) and `@L` (localized text) are resolved to their live values.
|
|
27
|
+
|
|
28
|
+
**Signature:**
|
|
29
|
+
|
|
30
|
+
```typescript
|
|
31
|
+
getConfigProps(destinationObject?: Record<string, unknown>): Record<string, unknown>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
**Example:**
|
|
35
|
+
|
|
36
|
+
```typescript
|
|
37
|
+
const MyComponent = ({ getPConnect }) => {
|
|
38
|
+
const pConn = getPConnect();
|
|
39
|
+
const { label, value } = pConn.getConfigProps();
|
|
40
|
+
return null;
|
|
41
|
+
};
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
**Notes:** This is the primary way a component reads its resolved configuration — prefer it over reading raw, unresolved metadata.
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## `populateAdditionalProps(configData)`
|
|
49
|
+
|
|
50
|
+
**Purpose:** Populates component-specific properties that aren't part of the raw configuration — for example, page/case/HTTP messages, validation messages, and stage info — directly onto the given config object.
|
|
51
|
+
|
|
52
|
+
**Signature:**
|
|
53
|
+
|
|
54
|
+
```typescript
|
|
55
|
+
populateAdditionalProps(configData: Record<string, unknown>): void
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
**Example:**
|
|
59
|
+
|
|
60
|
+
```typescript
|
|
61
|
+
const configData = pConn.getConfigProps();
|
|
62
|
+
pConn.populateAdditionalProps(configData);
|
|
63
|
+
// configData now also has any applicable validatemessage/pageMessages/httpMessages/stages props
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## `getRawMetadata()`
|
|
69
|
+
|
|
70
|
+
**Purpose:** Returns the component's complete, unresolved metadata (`type`, `config`, `children`).
|
|
71
|
+
|
|
72
|
+
**Signature:**
|
|
73
|
+
|
|
74
|
+
```typescript
|
|
75
|
+
getRawMetadata(): { type: string; config?: Record<string, unknown>; children?: unknown[] }
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
**Example:**
|
|
79
|
+
|
|
80
|
+
```typescript
|
|
81
|
+
const rawMetadata = pConn.getRawMetadata();
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
**Notes:** Prefer `getConfigProps()` for most use cases; use `getRawMetadata()` only when you specifically need the unresolved shape (for example, to inspect `children`).
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## `resolveConfigProps(configProps, destinationObject?)`
|
|
89
|
+
|
|
90
|
+
**Purpose:** Resolves a given props object (for example, one containing `@P` property references) against the component's context.
|
|
91
|
+
|
|
92
|
+
**Signature:**
|
|
93
|
+
|
|
94
|
+
```typescript
|
|
95
|
+
resolveConfigProps(configProps: Record<string, unknown>, destinationObject?: Record<string, unknown>): Record<string, unknown>
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
**Example:**
|
|
99
|
+
|
|
100
|
+
```typescript
|
|
101
|
+
const resolvedParams = pConn.resolveConfigProps(rawParameters);
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## `registerAdditionalProps(additionalMeta?)`
|
|
107
|
+
|
|
108
|
+
**Purpose:** Resolves and registers an additional props object so it is merged into subsequent `getConfigProps()` calls.
|
|
109
|
+
|
|
110
|
+
**Signature:**
|
|
111
|
+
|
|
112
|
+
```typescript
|
|
113
|
+
registerAdditionalProps(additionalMeta?: Record<string, unknown>): Record<string, unknown>
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
**Example:**
|
|
117
|
+
|
|
118
|
+
```typescript
|
|
119
|
+
useEffect(() => {
|
|
120
|
+
pConn.registerAdditionalProps({ readOnly: true });
|
|
121
|
+
});
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## `deRegisterAdditionalProps(deRegisterKeys?)`
|
|
127
|
+
|
|
128
|
+
**Purpose:** Removes previously registered additional prop keys so they no longer appear in `getConfigProps()` output.
|
|
129
|
+
|
|
130
|
+
**Signature:**
|
|
131
|
+
|
|
132
|
+
```typescript
|
|
133
|
+
deRegisterAdditionalProps(deRegisterKeys?: string[]): boolean
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
**Example:**
|
|
137
|
+
|
|
138
|
+
```typescript
|
|
139
|
+
pConn.registerAdditionalProps({ label: 'Custom label' });
|
|
140
|
+
// ...later, once the override is no longer needed
|
|
141
|
+
pConn.deRegisterAdditionalProps(['label']);
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## `getInheritedProps()`
|
|
147
|
+
|
|
148
|
+
**Purpose:** Returns props inherited from a parent view reference's configuration — used to cascade values (for example, a label override) down into a reused view.
|
|
149
|
+
|
|
150
|
+
**Signature:**
|
|
151
|
+
|
|
152
|
+
```typescript
|
|
153
|
+
getInheritedProps(): Record<string, unknown>
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
**Example:**
|
|
157
|
+
|
|
158
|
+
```typescript
|
|
159
|
+
const parentProps = getPConnect().getInheritedProps();
|
|
160
|
+
const label = parentProps.label ?? defaultLabel;
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## `setInheritedProp(propName, value)`
|
|
166
|
+
|
|
167
|
+
**Purpose:** Sets a single inherited prop that propagates to the component and all of its children.
|
|
168
|
+
|
|
169
|
+
**Signature:**
|
|
170
|
+
|
|
171
|
+
```typescript
|
|
172
|
+
setInheritedProp(propName: string, value: unknown): void
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
**Example:**
|
|
176
|
+
|
|
177
|
+
```typescript
|
|
178
|
+
pConn.setInheritedProp('displayMode', 'DISPLAY_ONLY');
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
## `setInheritedConfig(rawConfig)`
|
|
184
|
+
|
|
185
|
+
**Purpose:** Merges select configuration fields (for example, `readOnly`, `displayMode`, `hideLabel`) into the component's inherited configuration.
|
|
186
|
+
|
|
187
|
+
**Signature:**
|
|
188
|
+
|
|
189
|
+
```typescript
|
|
190
|
+
setInheritedConfig(rawConfig: Record<string, unknown>): void
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
**Example:**
|
|
194
|
+
|
|
195
|
+
```typescript
|
|
196
|
+
childPConn.setInheritedConfig({ readOnly: true, displayMode: null });
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
## `getValue(prop, pageReference?)`
|
|
202
|
+
|
|
203
|
+
**Purpose:** Resolves and returns a property's current value from the application state, relative to the component's (or a given) page reference.
|
|
204
|
+
|
|
205
|
+
**Signature:**
|
|
206
|
+
|
|
207
|
+
```typescript
|
|
208
|
+
getValue(prop: string, pageReference?: string): unknown
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
**Example:**
|
|
212
|
+
|
|
213
|
+
```typescript
|
|
214
|
+
const firstName = pConn.getValue('.FirstName');
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
**Notes:** This is one of the most commonly used PConnect APIs — nearly every field-reading component uses it.
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
## `setValue(prop, value, initialValue?, isImplicit?, options?)`
|
|
222
|
+
|
|
223
|
+
**Purpose:** Writes a value to a property in the application state.
|
|
224
|
+
|
|
225
|
+
**Signature:**
|
|
226
|
+
|
|
227
|
+
```typescript
|
|
228
|
+
setValue(
|
|
229
|
+
prop: string,
|
|
230
|
+
value: { [key: string]: any } | undefined,
|
|
231
|
+
initialValue?: string,
|
|
232
|
+
isImplicit?: boolean,
|
|
233
|
+
options?: { isArrayDeepMerge?: boolean }
|
|
234
|
+
): void
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
**Example:**
|
|
238
|
+
|
|
239
|
+
```typescript
|
|
240
|
+
pConn.setValue('.FirstName', 'Jane' as unknown as { [key: string]: any });
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
**Notes:** The 5.1.0 typedefs type `value` as `{ [key: string]: any } | undefined`, even though the typedef's own example passes a string; a primitive therefore needs a cast to compile (as in the example above). For field-editing components, prefer `pConn.getActionsApi().updateFieldValue()` or `triggerFieldChange()`, which also handle message clearing and validation — see [pconnect-actions-api.md](./pconnect-actions-api.md).
|
|
244
|
+
|
|
245
|
+
---
|
|
246
|
+
|
|
247
|
+
## `replaceState(prop, value, options?)`
|
|
248
|
+
|
|
249
|
+
**Purpose:** Fully replaces (rather than merges) the state value at a given property or page path.
|
|
250
|
+
|
|
251
|
+
**Signature:**
|
|
252
|
+
|
|
253
|
+
```typescript
|
|
254
|
+
replaceState(prop: string, value: unknown, options?: { skipDirtyValidation?: boolean }): void
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
**Example:**
|
|
258
|
+
|
|
259
|
+
```typescript
|
|
260
|
+
pConn.replaceState('.Address', { Country: 'US', State: 'MA' });
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
---
|
|
264
|
+
|
|
265
|
+
## `updateState(dataObject)`
|
|
266
|
+
|
|
267
|
+
**Purpose:** Deep-merges a data object into the store at the component's root page reference.
|
|
268
|
+
|
|
269
|
+
**Signature:**
|
|
270
|
+
|
|
271
|
+
```typescript
|
|
272
|
+
updateState(dataObject: Record<string, unknown>): void
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
**Example:**
|
|
276
|
+
|
|
277
|
+
```typescript
|
|
278
|
+
const response = await fetchRelatedData();
|
|
279
|
+
pConn.updateState({ relatedRecords: response.data });
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
---
|
|
283
|
+
|
|
284
|
+
## `resolveDatasourceReference(datasourceRef)`
|
|
285
|
+
|
|
286
|
+
**Purpose:** Resolves a data-page-backed reference (for example, `D_MyDataPage`) against the current context's cached list summaries.
|
|
287
|
+
|
|
288
|
+
**Signature:**
|
|
289
|
+
|
|
290
|
+
```typescript
|
|
291
|
+
resolveDatasourceReference(datasourceRef: string): unknown
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
**Example:**
|
|
295
|
+
|
|
296
|
+
```typescript
|
|
297
|
+
const resolvedReference = pConn.resolveDatasourceReference('D_MyDataPage');
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
---
|
|
301
|
+
|
|
302
|
+
## `getCurrentClassID()`
|
|
303
|
+
|
|
304
|
+
**Purpose:** Returns the class ID (Pega class name) for the component's current context.
|
|
305
|
+
|
|
306
|
+
**Signature:**
|
|
307
|
+
|
|
308
|
+
```typescript
|
|
309
|
+
getCurrentClassID(): string
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
**Example:**
|
|
313
|
+
|
|
314
|
+
```typescript
|
|
315
|
+
const classID = pConn.getCurrentClassID();
|
|
316
|
+
```
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# ValidationApi
|
|
2
|
+
|
|
3
|
+
> Part of the [PCore / PConnect API Reference skills](../README.md). Obtained via `pConn.getValidationApi()`.
|
|
4
|
+
|
|
5
|
+
## `validate(value, propertyName?)`
|
|
6
|
+
|
|
7
|
+
**Purpose:** Validates a field's value against the validators configured on that field, and updates the field's validation message in application state.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
validate(value: string, propertyName?: string): { status: boolean; message?: string }
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
**Example:**
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
const result = pConn.getValidationApi().validate(inputValue);
|
|
19
|
+
if (!result.status) {
|
|
20
|
+
// result.message contains the validation error
|
|
21
|
+
}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## `validateEmail(value, options?)`
|
|
27
|
+
|
|
28
|
+
**Purpose:** Validates an email address (RFC 5322 by default, or RFC 822 if requested) without automatically displaying errors on the field — the result is returned directly to the caller.
|
|
29
|
+
|
|
30
|
+
**Signature:**
|
|
31
|
+
|
|
32
|
+
```typescript
|
|
33
|
+
validateEmail(value: string, options?: { useRFC822Validation?: boolean }): { status: 'success' } | { status: 'failure'; message: string }
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
**Example:**
|
|
37
|
+
|
|
38
|
+
```typescript
|
|
39
|
+
const result = pConn.getValidationApi().validateEmail(emailValue);
|
|
40
|
+
if (result.status === 'failure') {
|
|
41
|
+
// show result.message next to the email field
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**Notes:** Unlike `validate()`, this does not write anything to application state — it's a pure validation utility for custom error handling.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Analytics & GenAI — Method Details
|
|
2
|
+
|
|
3
|
+
> Part of the [PCore / PConnect API Reference skills](../README.md). Companion to [pcore-case-collaboration-genai.md](./pcore-case-collaboration-genai.md), which covers the top-level `PCore.get*()` accessors. This file catalogs the methods available on the objects those accessors return.
|
|
4
|
+
|
|
5
|
+
## AnalyticsUtils (via `PCore.getAnalyticsUtils()`)
|
|
6
|
+
|
|
7
|
+
| Method | Signature | Purpose |
|
|
8
|
+
| ----------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- |
|
|
9
|
+
| `getInsightIDs()` | `(): Promise<unknown>` | Retrieves all available insight IDs. |
|
|
10
|
+
| `getInsightByID(insightID)` | `(insightID: string): Promise<unknown>` | Retrieves metadata for a specific insight. |
|
|
11
|
+
| `getDataObjects()` | `(): Promise<unknown>` | Retrieves the list of data objects corresponding to data/case types. |
|
|
12
|
+
| `getDataPageObjects(useCache?)` | `(useCache?: boolean): Promise<unknown>` | Retrieves the list of data objects corresponding to data pages. |
|
|
13
|
+
| `getDefaultColumns(payload)` | `(payload: { reportName: string; className: string }): Promise<unknown>` | Retrieves the default columns configured for a report. |
|
|
14
|
+
| `getFieldsForDataSource(dataViewName, skipStoreCheck, context)` | `(dataViewName: string, skipStoreCheck: boolean, context: string): Promise<unknown>` | Retrieves the fields configured for a data view. |
|
|
15
|
+
| `getPrimaryFieldsForDataSource(dataViewName?, dataViewClassName?)` | `(dataViewName?: string, dataViewClassName?: string): Promise<unknown>` | Retrieves the primary fields for a data view. |
|
|
16
|
+
| `getDataViewMetadata(dataViewName, skipStoreCheck, associationFilter?)` | `(dataViewName: string, skipStoreCheck: boolean, associationFilter?: string[]): Promise<unknown>` | Retrieves and caches metadata for a data view. |
|
|
17
|
+
| `translateStrings(stringsToTranslate)` | `(stringsToTranslate: string): Promise<unknown>` | Translates a list of strings. |
|
|
18
|
+
|
|
19
|
+
**Example:**
|
|
20
|
+
|
|
21
|
+
```typescript
|
|
22
|
+
const insightIDs = await PCore.getAnalyticsUtils().getInsightIDs();
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## GenAIAssistantUtils (via `PCore.getGenAIAssistantUtils()`)
|
|
28
|
+
|
|
29
|
+
| Method | Signature | Purpose |
|
|
30
|
+
| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
|
|
31
|
+
| `createConversation(contextID, assistantID, context, cancelTokenSource?)` | `(contextID: string, assistantID: string, context: string, cancelTokenSource?: CancelTokenSource[]): Promise<ConversationResponse>` | Starts a conversation with a GenAI Assistant. Resolves to `{ data: { ID, response, suggestedPrompts, ... } }` — the conversation ID is `conversation.data.ID`. |
|
|
32
|
+
| `createConversationForAgent(contextID, agentID, context, cancelTokenSource?, config?)` | `(contextID: string, agentID: string, context: string, cancelTokenSource?: CancelTokenSource[], config?: CreateConversationConfig): Promise<ConversationResponse>` | Starts a conversation with an Agent. Resolves to the same `ConversationResponse` shape (`conversation.data.ID`). |
|
|
33
|
+
| `sendMessage(assistantID, conversationID, message, context, config?)` | `(assistantID: string, conversationID: string, message: string, context: string, config?: SendMessageConfig): Promise<AxiosResponse>` | Sends a message in an Assistant conversation. `SendMessageConfig` requires `enableStreaming: boolean`. |
|
|
34
|
+
| `sendMessageForAgent(agentID, conversationID, message, context, attachments?, config?)` | `(agentID: string, conversationID: string, message: string, context: string, attachments?: Attachment[], config?: SendMessageConfig): Promise<AxiosResponse>` | Sends a message in an Agent conversation. |
|
|
35
|
+
| `getConversations(assistantID, contextID, pageSize, pageIndex, context, cancelTokenSource?)` | `(assistantID: string, contextID: string, pageSize: number, pageIndex: number, context: string, cancelTokenSource?: CancelTokenSource[]): Promise<AxiosResponse>` | Retrieves a paginated list of Assistant conversations. |
|
|
36
|
+
| `getConversationsForAgent(agentID, contextID, pageSize, pageIndex, context, cancelTokenSource?)` | `(agentID: string, contextID: string, pageSize: number, pageIndex: number, context: string, cancelTokenSource?: CancelTokenSource[]): Promise<AxiosResponse>` | Retrieves a paginated list of Agent conversations. |
|
|
37
|
+
| `getMessages(assistantID, conversationID, context, cancelTokenSource?)` | `(assistantID: string, conversationID: string, context: string, cancelTokenSource?: CancelTokenSource[]): Promise<AxiosResponse>` | Retrieves messages from an Assistant conversation. Resolves to an Axios response (not an array) — the payload is on `.data`; its inner shape is not typed in the 5.1.0 typedefs (`any`). |
|
|
38
|
+
| `getMessagesForAgent(agentID, conversationID, context, cancelTokenSource?)` | `(agentID: string, conversationID: string, context: string, cancelTokenSource?: CancelTokenSource[]): Promise<AxiosResponse>` | Retrieves messages from an Agent conversation (Axios response; payload on `.data`, inner shape untyped). |
|
|
39
|
+
| `getAgent(agentID, context, contextID, cancelTokenSource?)` | `(agentID: string, context: string, contextID: string, cancelTokenSource?: CancelTokenSource[]): Promise<AxiosResponse>` | Retrieves details for a configured Agent. |
|
|
40
|
+
| `getCoach(assistantID, context, contextID, cancelTokenSource?)` | `(assistantID: string, context: string, contextID: string, cancelTokenSource?: CancelTokenSource[]): Promise<AxiosResponse>` | Retrieves details for a configured GenAI Coach (Assistant). |
|
|
41
|
+
| `likeAgentMessage(agentID, conversationID, messageID, context)` | `(agentID: string, conversationID: string, messageID: string, context: string): Promise<AxiosResponse>` | Likes a message in an Agent conversation. |
|
|
42
|
+
| `unLikeAgentMessage(agentID, conversationID, messageID, context, feedbackText?)` | `(agentID: string, conversationID: string, messageID: string, context: string, feedbackText?: string): Promise<AxiosResponse>` | Removes a like from a message, optionally with feedback text. |
|
|
43
|
+
|
|
44
|
+
**Example:**
|
|
45
|
+
|
|
46
|
+
```typescript
|
|
47
|
+
const { createConversation, sendMessage } = PCore.getGenAIAssistantUtils();
|
|
48
|
+
const conversation = await createConversation(contextID, assistantID, context);
|
|
49
|
+
await sendMessage(assistantID, conversation.data.ID, userMessage, context);
|
|
50
|
+
```
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# Bootstrap, Initialisation & Component Registry — Method Details
|
|
2
|
+
|
|
3
|
+
> Part of the [PCore / PConnect API Reference skills](../README.md). Companion to [pcore-bootstrap-registry-routing.md](./pcore-bootstrap-registry-routing.md), which covers the top-level `PCore.get*()` accessors. This file catalogs the methods available on the objects those accessors return.
|
|
4
|
+
>
|
|
5
|
+
> **Audience note:** `Initialiser` and `BootstrapUtils` are almost entirely used by the portal shell / SDK bridge layer during application startup — a typical custom component does not call these directly. They're cataloged here for completeness (for example, if you're building a custom SDK bridge or embedding integration), but most component authors can skip this section entirely.
|
|
6
|
+
|
|
7
|
+
## ComponentsRegistry (via `PCore.getComponentsRegistry()`)
|
|
8
|
+
|
|
9
|
+
| Method | Signature | Purpose |
|
|
10
|
+
| ---------------------------------------------------------- | --------------------------------------------------- | -------------------------------------------------------- |
|
|
11
|
+
| `register(componentName, component)` | `(componentName: string, component: unknown): void` | Registers a component descriptor with the registry. |
|
|
12
|
+
| `getComponent(componentName)` | `(componentName: string): unknown` | Returns a registered component descriptor by name. |
|
|
13
|
+
| `registerLazyMap(componentName, component)` | `(componentName: string, component: unknown): void` | Registers a component for lazy (deferred) loading. |
|
|
14
|
+
| `getLazyComponent(componentName)` | `(componentName: string): unknown` | Returns a lazily-loaded component by name. |
|
|
15
|
+
| `registerCustomComponentLazyMap(componentName, component)` | `(componentName: string, component: unknown): void` | Registers a custom component for lazy loading. |
|
|
16
|
+
| `getCustomComponent(componentName)` | `(componentName: string): unknown` | Returns a lazily-loaded custom component by name. |
|
|
17
|
+
| `mergeComponentsMap(componentsMap?)` | `(componentsMap?: unknown): void` | Merges a map of component descriptors into the registry. |
|
|
18
|
+
| `mergeOverrideMap(overrideMap?)` | `(overrideMap?: unknown): void` | Merges a map of component overrides into the registry. |
|
|
19
|
+
| `getOverrideMap()` | `(): unknown` | Returns the current override map. |
|
|
20
|
+
| `getLazyMap()` | `(): unknown` | Returns the current lazy-component map. |
|
|
21
|
+
|
|
22
|
+
**Example:**
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
const registry = PCore.getComponentsRegistry();
|
|
26
|
+
registry.register('MyCustomWidget', { component: MyCustomWidgetComponent });
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Initialiser (via `PCore.getInitialiser()`)
|
|
32
|
+
|
|
33
|
+
| Method | Signature | Purpose |
|
|
34
|
+
| -------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------ |
|
|
35
|
+
| `init(configObj)` | `(configObj: unknown): Promise<void>` | Initializes the application with the given configuration. |
|
|
36
|
+
| `start(config, callback?)` | `(config: unknown, callback?: () => void): Promise<boolean>` | Initiates bootstrapping and loads component libraries. |
|
|
37
|
+
| `configureTheme(theme?)` | `(theme?: unknown): void` | Configures light/dark theme settings. Not in the 5.1.0 typedefs, so TypeScript may need a cast (e.g. `(PCore.getInitialiser() as any).configureTheme(...)`). |
|
|
38
|
+
| `getBootstrapConfig(restServerUrl, tokenInfo)` | `(restServerUrl: string, tokenInfo: unknown): Promise<unknown>` | Fetches the bootstrap configuration from the server. |
|
|
39
|
+
| `initCoreContainers(options?)` | `(options?: { containerType?: string }): unknown` | Initializes core containers and returns a `getPConnect` function. |
|
|
40
|
+
| `initCoreConfig(config)` | `(config: unknown): Promise<void>` | Initializes core configuration, routing, and history. |
|
|
41
|
+
| `launchPortal(targetDom, portalName, containerTargetName?, preLoadComponents?, ccLibs?)` | `(...): Promise<unknown>` | Launches the portal shell into a DOM target. |
|
|
42
|
+
| `launchView(targetDom, viewMetadata, preLoadComponents, runtimeParams, portalTarget, styleSheetTarget, containerTargetName)` | `(...): void` | Launches a specific view into a DOM target. All 7 arguments are required (`preLoadComponents` is typed `string[] \| undefined`, so pass `undefined` explicitly if unused). |
|
|
43
|
+
| `launchViewByName(targetDom, viewName, portalName, viewClass, additionalComponents, portalTarget, styleSheetTarget, containerTargetName, ccLibs?)` | `(...): Promise<void>` | Launches a view identified by name into a DOM target. |
|
|
44
|
+
| `launchMashup(targetDom, usePegaMashupStyling?, ccLibs?)` | `(targetDom: string, usePegaMashupStyling?: boolean, ccLibs?: unknown[]): void` | Launches a mashup/embed into a DOM target. |
|
|
45
|
+
| `loadEnvironmentInfoFromDataPage(config)` | `(config: unknown): Promise<void>` | Loads environment information from the environment-info data page. |
|
|
46
|
+
| `loadDataPagesIntoEnvironmentInfo(dataPages)` | `(dataPages: unknown[]): Promise<void>` | Merges specified data page results into environment info. |
|
|
47
|
+
| `loadEnvironmentInfo(config)` | `(config: unknown): Promise<void>` | Loads theme, branding, and key-mapping info from configuration. |
|
|
48
|
+
| `loadCustomComponentLibrariesIfEnabled(ccLibs)` | `(ccLibs: unknown[]): Promise<void>` | Conditionally loads custom component libraries if enabled. |
|
|
49
|
+
| `loadCustomComponentLibraries(ccLibs)` | `(ccLibs: unknown[]): Promise<void>` | Loads all custom component libraries from the given list. |
|
|
50
|
+
| `importSingleCustomComponent(ccLib)` | `(ccLib: unknown): Promise<void>` | Imports a single custom component. |
|
|
51
|
+
| `importReactRoot()` | `(): Promise<unknown>` | Imports the React root component module. |
|
|
52
|
+
| `importDesignSystemComponentMap(appStaticContentServer, environmentId, alternateDesignSystemName)` | `(...): Promise<void>` | Dynamically loads an alternate design system's component map. |
|
|
53
|
+
| `buildSemanticUrl(pathInfo, queryParams, noPortal, restServer, viewName)` | `(...): string` | Constructs a semantic URL from path and query information. |
|
|
54
|
+
| `registerForDebugInfo(channel)` | `(channel: unknown): void` | Registers a debug-message handler and enables preview mode. |
|
|
55
|
+
| `toggleTracerHeaders(channel)` | `(channel: unknown): void` | Toggles tracer headers on/off based on channel messages. |
|
|
56
|
+
|
|
57
|
+
**Example:**
|
|
58
|
+
|
|
59
|
+
```typescript
|
|
60
|
+
PCore.getInitialiser()
|
|
61
|
+
.start(bootstrapConfig)
|
|
62
|
+
.then(() => {
|
|
63
|
+
// application is ready
|
|
64
|
+
});
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## BootstrapUtils (via `PCore.getBootstrapUtils()`)
|
|
70
|
+
|
|
71
|
+
| Method | Signature | Purpose |
|
|
72
|
+
| --------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- | ------------------------------------------------------------------ |
|
|
73
|
+
| `loadRootComponent(domContainerID, componentMetaData, additionalComponents?, portalTarget?, styleSheetTarget?, removeContainer?)` | `(...): Promise<void>` | Renders the root container and loads the component tree. |
|
|
74
|
+
| `renderApp(translatedDXAPIResponse, domContainerID)` | `(translatedDXAPIResponse: unknown, domContainerID: string): void` | Renders the application from a DX API response. |
|
|
75
|
+
| `updateStoreWithUiRoot(dxAPIResponse, containerName, isPortal)` | `(...): Promise<void>` | Updates application state with a UI root response. |
|
|
76
|
+
| `loadComponent(componentConfig, domContainerID, additionalComponents)` | `(...): Promise<void>` | Loads and renders a single component. |
|
|
77
|
+
| `loadView(dxAPIResponse, domContainerID, additionalComponents?)` | `(...): Promise<void>` | Loads view metadata and renders the application. |
|
|
78
|
+
| `loadViewByName(viewName, portalName, viewClass, containerName)` | `(...): void` | Loads a view by name into a container. |
|
|
79
|
+
| `loadPortalView(portalName, containerName)` | `(portalName: string, containerName: string): void` | Loads the portal shell and renders it. |
|
|
80
|
+
| `loadMashup(targetDom, usePegaMashupStyling?)` | `(targetDom: string, usePegaMashupStyling?: boolean): Promise<void>` | Loads a Constellation mashup into a DOM target. |
|
|
81
|
+
| `bootstrapWithAuthHeader(config, target, preLoadComponents?, portalTarget?, styleSheetTarget?)` | `(...): Promise<void>` | Runs a full bootstrap sequence with an authorization header. |
|
|
82
|
+
| `getBootstrapConfig(restServerUrl, tokenInfo)` | `(restServerUrl: string, tokenInfo: unknown): Promise<unknown>` | Fetches the bootstrap configuration via a direct fetch call. |
|
|
83
|
+
| `getBootstrapConfigViaSB(restServerUrl, additionalHeaders, themeID)` | `(...): Promise<unknown>` | Fetches bootstrap configuration via the service broker. |
|
|
84
|
+
| `getBootstrapConfigExtended(restServerUrl, authorizationHeader, additionalHeaders, themeID, customCookies, locale)` | `(...): Promise<unknown>` | Fetches bootstrap configuration with theme/locale parameters. |
|
|
85
|
+
| `getLPConfig(restServerUrl, authorizationHeader, additionalHeaders, customCookies)` | `(...): Promise<unknown>` | Fetches Launchpad environment configuration. |
|
|
86
|
+
| `applyEnvironmentInfoResponse(config)` | `(config: unknown): Promise<unknown>` | Parses and applies an environment-info server response. |
|
|
87
|
+
| `initAppShell(appRoutingTable, actionsTargetModel, servicesObj)` | `(...): void` | Initializes routing, actions, and services for the app shell. |
|
|
88
|
+
| `initRoutingTable(appRoutingTable, servicesObj)` | `(appRoutingTable: unknown, servicesObj: unknown): void` | Initializes routing and services only. |
|
|
89
|
+
| `initStore()` | `(): void` | Initializes the application state store. |
|
|
90
|
+
| `enableAppRouting(enableRouting)` | `(enableRouting: boolean): void` | Enables or disables application routing. |
|
|
91
|
+
| `setAppAlias(appAlias)` | `(appAlias: string): void` | Sets the application alias used for asset loading. |
|
|
92
|
+
| `setStaticServerUrl(staticUrl, appStaticUrl, b2sJWT)` | `(staticUrl: string, appStaticUrl: string, b2sJWT: string): void` | Configures the static asset server URLs. |
|
|
93
|
+
| `setFetchDefaultHeaders(headersObj)` | `(headersObj: unknown): void` | Sets default HTTP headers applied to all requests. |
|
|
94
|
+
| `setFetchAuthInfo(authInfo)` | `(authInfo: unknown): void` | Sets authentication information used by outgoing requests. |
|
|
95
|
+
| `setFieldsDefaultConfigs(config)` | `(config: unknown): void` | Sets default field configurations. |
|
|
96
|
+
| `setGoogleMapsAPIKey(googleMapsAPIKey)` | `(googleMapsAPIKey: string): void` | Configures the Google Maps API key. |
|
|
97
|
+
| `getHomeRestApi(portalName)` | `(portalName: string): string` | Returns the REST path to a portal's home endpoint. |
|
|
98
|
+
| `getViewRestApi(viewID, viewClass)` | `(viewID: string, viewClass: string): string` | Returns the REST path to a view endpoint. |
|
|
99
|
+
| `getCaseApi()` | `(): unknown` | Returns the case API module. |
|
|
100
|
+
| `getMashupApi()` | `(): unknown` | Returns the mashup API module. |
|
|
101
|
+
| `getContextUtils()` | `(): unknown` | Returns the context utilities module. |
|
|
102
|
+
| `getRoutingManager()` | `(): unknown` | Returns the routing manager module. |
|
|
103
|
+
| `getComponentsRegistry()` | `(): ComponentsRegistry` | Returns the components registry instance. |
|
|
104
|
+
| `getStateManager()` | `(): unknown` | Returns the state manager module. |
|
|
105
|
+
| `createC11nEnv(meta)` | `(meta: unknown): PConnect` | Creates a `PConnect` (`C11nEnv`) object from metadata. |
|
|
106
|
+
| `configureForBrowserBookmark(payload)` | `(payload: unknown): void` | Publishes browser bookmark configuration. |
|
|
107
|
+
| `checkIfSemanticURL()` | `(): boolean` | Checks whether the current URL is a semantic URL. |
|
|
108
|
+
| `onPCoreReady(callback)` | `(callback: Function): void` | Registers a callback for when the render infrastructure is ready. |
|
|
109
|
+
| `onPCoreCleanup(callback)` | `(callback: Function): void` | Registers a callback for when the application should be unmounted. |
|
|
110
|
+
|
|
111
|
+
**Example:**
|
|
112
|
+
|
|
113
|
+
```typescript
|
|
114
|
+
PCore.getBootstrapUtils()
|
|
115
|
+
.loadRootComponent('app-root', rootContainer, [], rootElement, stylesElement, true)
|
|
116
|
+
.then(() => {
|
|
117
|
+
// root component is ready
|
|
118
|
+
});
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
**Notes:** Several `BootstrapUtils` methods overlap with dedicated top-level `PCore.*` accessors (for example, `PCore.onPCoreReady()`, `PCore.configureForBrowserBookmark()`) — prefer the top-level `PCore.*` accessor when one exists, and reach for `getBootstrapUtils()` only for lower-level bootstrap customization not otherwise exposed.
|