@entifix/core 0.1.0-0
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/LICENSE +21 -0
- package/README.md +11 -0
- package/dist/base-entities/configuration-client/configuration-client-singleton.d.ts +39 -0
- package/dist/base-entities/configuration-client/configuration-client-singleton.d.ts.map +1 -0
- package/dist/base-entities/configuration-client/configuration-client-singleton.js +164 -0
- package/dist/base-entities/configuration-client/configuration-client-singleton.js.map +1 -0
- package/dist/base-entities/configuration-client/index.d.ts +4 -0
- package/dist/base-entities/configuration-client/index.d.ts.map +1 -0
- package/dist/base-entities/configuration-client/index.js +5 -0
- package/dist/base-entities/configuration-client/index.js.map +1 -0
- package/dist/base-entities/configuration-client/read-configuration-from-process.d.ts +11 -0
- package/dist/base-entities/configuration-client/read-configuration-from-process.d.ts.map +1 -0
- package/dist/base-entities/configuration-client/read-configuration-from-process.js +26 -0
- package/dist/base-entities/configuration-client/read-configuration-from-process.js.map +1 -0
- package/dist/base-entities/configuration-client/types.d.ts +38 -0
- package/dist/base-entities/configuration-client/types.d.ts.map +1 -0
- package/dist/base-entities/configuration-client/types.js +3 -0
- package/dist/base-entities/configuration-client/types.js.map +1 -0
- package/dist/base-entities/entifix-error/entifix-error.d.ts +31 -0
- package/dist/base-entities/entifix-error/entifix-error.d.ts.map +1 -0
- package/dist/base-entities/entifix-error/entifix-error.js +56 -0
- package/dist/base-entities/entifix-error/entifix-error.js.map +1 -0
- package/dist/base-entities/entifix-error/index.d.ts +2 -0
- package/dist/base-entities/entifix-error/index.d.ts.map +1 -0
- package/dist/base-entities/entifix-error/index.js +3 -0
- package/dist/base-entities/entifix-error/index.js.map +1 -0
- package/dist/command-palette/command-matching.d.ts +79 -0
- package/dist/command-palette/command-matching.d.ts.map +1 -0
- package/dist/command-palette/command-matching.js +116 -0
- package/dist/command-palette/command-matching.js.map +1 -0
- package/dist/command-palette/command-source.d.ts +109 -0
- package/dist/command-palette/command-source.d.ts.map +1 -0
- package/dist/command-palette/command-source.js +11 -0
- package/dist/command-palette/command-source.js.map +1 -0
- package/dist/command-palette/index.d.ts +3 -0
- package/dist/command-palette/index.d.ts.map +1 -0
- package/dist/command-palette/index.js +4 -0
- package/dist/command-palette/index.js.map +1 -0
- package/dist/entity-definition/decorators/accessor/accessor.d.ts +3 -0
- package/dist/entity-definition/decorators/accessor/accessor.d.ts.map +1 -0
- package/dist/entity-definition/decorators/accessor/accessor.js +11 -0
- package/dist/entity-definition/decorators/accessor/accessor.js.map +1 -0
- package/dist/entity-definition/decorators/accessor/index.d.ts +2 -0
- package/dist/entity-definition/decorators/accessor/index.d.ts.map +1 -0
- package/dist/entity-definition/decorators/accessor/index.js +3 -0
- package/dist/entity-definition/decorators/accessor/index.js.map +1 -0
- package/dist/entity-definition/decorators/entity/entity.d.ts +4 -0
- package/dist/entity-definition/decorators/entity/entity.d.ts.map +1 -0
- package/dist/entity-definition/decorators/entity/entity.js +9 -0
- package/dist/entity-definition/decorators/entity/entity.js.map +1 -0
- package/dist/entity-definition/decorators/entity/index.d.ts +2 -0
- package/dist/entity-definition/decorators/entity/index.d.ts.map +1 -0
- package/dist/entity-definition/decorators/entity/index.js +3 -0
- package/dist/entity-definition/decorators/entity/index.js.map +1 -0
- package/dist/entity-definition/decorators/method/index.d.ts +2 -0
- package/dist/entity-definition/decorators/method/index.d.ts.map +1 -0
- package/dist/entity-definition/decorators/method/index.js +3 -0
- package/dist/entity-definition/decorators/method/index.js.map +1 -0
- package/dist/entity-definition/decorators/method/method.d.ts +3 -0
- package/dist/entity-definition/decorators/method/method.d.ts.map +1 -0
- package/dist/entity-definition/decorators/method/method.js +10 -0
- package/dist/entity-definition/decorators/method/method.js.map +1 -0
- package/dist/entity-definition/decorators/use-case/index.d.ts +2 -0
- package/dist/entity-definition/decorators/use-case/index.d.ts.map +1 -0
- package/dist/entity-definition/decorators/use-case/index.js +3 -0
- package/dist/entity-definition/decorators/use-case/index.js.map +1 -0
- package/dist/entity-definition/decorators/use-case/use-case.d.ts +18 -0
- package/dist/entity-definition/decorators/use-case/use-case.d.ts.map +1 -0
- package/dist/entity-definition/decorators/use-case/use-case.js +26 -0
- package/dist/entity-definition/decorators/use-case/use-case.js.map +1 -0
- package/dist/entity-definition/describe/describe-child-columns.d.ts +33 -0
- package/dist/entity-definition/describe/describe-child-columns.d.ts.map +1 -0
- package/dist/entity-definition/describe/describe-child-columns.js +44 -0
- package/dist/entity-definition/describe/describe-child-columns.js.map +1 -0
- package/dist/entity-definition/describe/describe-entity-columns.d.ts +83 -0
- package/dist/entity-definition/describe/describe-entity-columns.d.ts.map +1 -0
- package/dist/entity-definition/describe/describe-entity-columns.js +112 -0
- package/dist/entity-definition/describe/describe-entity-columns.js.map +1 -0
- package/dist/entity-definition/describe/describe-entity-use-cases.d.ts +34 -0
- package/dist/entity-definition/describe/describe-entity-use-cases.d.ts.map +1 -0
- package/dist/entity-definition/describe/describe-entity-use-cases.js +24 -0
- package/dist/entity-definition/describe/describe-entity-use-cases.js.map +1 -0
- package/dist/entity-definition/describe/index.d.ts +4 -0
- package/dist/entity-definition/describe/index.d.ts.map +1 -0
- package/dist/entity-definition/describe/index.js +5 -0
- package/dist/entity-definition/describe/index.js.map +1 -0
- package/dist/entity-definition/field-path.d.ts +49 -0
- package/dist/entity-definition/field-path.d.ts.map +1 -0
- package/dist/entity-definition/field-path.js +58 -0
- package/dist/entity-definition/field-path.js.map +1 -0
- package/dist/entity-definition/helpers/entity-definition-helpers.d.ts +59 -0
- package/dist/entity-definition/helpers/entity-definition-helpers.d.ts.map +1 -0
- package/dist/entity-definition/helpers/entity-definition-helpers.js +115 -0
- package/dist/entity-definition/helpers/entity-definition-helpers.js.map +1 -0
- package/dist/entity-definition/helpers/index.d.ts +2 -0
- package/dist/entity-definition/helpers/index.d.ts.map +1 -0
- package/dist/entity-definition/helpers/index.js +3 -0
- package/dist/entity-definition/helpers/index.js.map +1 -0
- package/dist/entity-definition/links/apply-entity-links/apply-entity-links.d.ts +48 -0
- package/dist/entity-definition/links/apply-entity-links/apply-entity-links.d.ts.map +1 -0
- package/dist/entity-definition/links/apply-entity-links/apply-entity-links.js +88 -0
- package/dist/entity-definition/links/apply-entity-links/apply-entity-links.js.map +1 -0
- package/dist/entity-definition/links/apply-entity-links/index.d.ts +2 -0
- package/dist/entity-definition/links/apply-entity-links/index.d.ts.map +1 -0
- package/dist/entity-definition/links/apply-entity-links/index.js +3 -0
- package/dist/entity-definition/links/apply-entity-links/index.js.map +1 -0
- package/dist/entity-definition/links/entity-collection-link/entity-collection-link.d.ts +29 -0
- package/dist/entity-definition/links/entity-collection-link/entity-collection-link.d.ts.map +1 -0
- package/dist/entity-definition/links/entity-collection-link/entity-collection-link.js +61 -0
- package/dist/entity-definition/links/entity-collection-link/entity-collection-link.js.map +1 -0
- package/dist/entity-definition/links/entity-collection-link/index.d.ts +2 -0
- package/dist/entity-definition/links/entity-collection-link/index.d.ts.map +1 -0
- package/dist/entity-definition/links/entity-collection-link/index.js +3 -0
- package/dist/entity-definition/links/entity-collection-link/index.js.map +1 -0
- package/dist/entity-definition/links/entity-link/entity-link.d.ts +58 -0
- package/dist/entity-definition/links/entity-link/entity-link.d.ts.map +1 -0
- package/dist/entity-definition/links/entity-link/entity-link.js +79 -0
- package/dist/entity-definition/links/entity-link/entity-link.js.map +1 -0
- package/dist/entity-definition/links/entity-link/index.d.ts +2 -0
- package/dist/entity-definition/links/entity-link/index.d.ts.map +1 -0
- package/dist/entity-definition/links/entity-link/index.js +3 -0
- package/dist/entity-definition/links/entity-link/index.js.map +1 -0
- package/dist/entity-definition/links/entity-link-source/entity-link-source.d.ts +74 -0
- package/dist/entity-definition/links/entity-link-source/entity-link-source.d.ts.map +1 -0
- package/dist/entity-definition/links/entity-link-source/entity-link-source.js +11 -0
- package/dist/entity-definition/links/entity-link-source/entity-link-source.js.map +1 -0
- package/dist/entity-definition/links/entity-link-source/index.d.ts +2 -0
- package/dist/entity-definition/links/entity-link-source/index.d.ts.map +1 -0
- package/dist/entity-definition/links/entity-link-source/index.js +3 -0
- package/dist/entity-definition/links/entity-link-source/index.js.map +1 -0
- package/dist/entity-definition/meta-entities/meta-accessor/index.d.ts +2 -0
- package/dist/entity-definition/meta-entities/meta-accessor/index.d.ts.map +1 -0
- package/dist/entity-definition/meta-entities/meta-accessor/index.js +3 -0
- package/dist/entity-definition/meta-entities/meta-accessor/index.js.map +1 -0
- package/dist/entity-definition/meta-entities/meta-accessor/meta-accessor.d.ts +137 -0
- package/dist/entity-definition/meta-entities/meta-accessor/meta-accessor.d.ts.map +1 -0
- package/dist/entity-definition/meta-entities/meta-accessor/meta-accessor.js +52 -0
- package/dist/entity-definition/meta-entities/meta-accessor/meta-accessor.js.map +1 -0
- package/dist/entity-definition/meta-entities/meta-entity/index.d.ts +2 -0
- package/dist/entity-definition/meta-entities/meta-entity/index.d.ts.map +1 -0
- package/dist/entity-definition/meta-entities/meta-entity/index.js +3 -0
- package/dist/entity-definition/meta-entities/meta-entity/index.js.map +1 -0
- package/dist/entity-definition/meta-entities/meta-entity/meta-entity.d.ts +17 -0
- package/dist/entity-definition/meta-entities/meta-entity/meta-entity.d.ts.map +1 -0
- package/dist/entity-definition/meta-entities/meta-entity/meta-entity.js +13 -0
- package/dist/entity-definition/meta-entities/meta-entity/meta-entity.js.map +1 -0
- package/dist/entity-definition/meta-entities/meta-method/index.d.ts +2 -0
- package/dist/entity-definition/meta-entities/meta-method/index.d.ts.map +1 -0
- package/dist/entity-definition/meta-entities/meta-method/index.js +3 -0
- package/dist/entity-definition/meta-entities/meta-method/index.js.map +1 -0
- package/dist/entity-definition/meta-entities/meta-method/meta-method.d.ts +16 -0
- package/dist/entity-definition/meta-entities/meta-method/meta-method.d.ts.map +1 -0
- package/dist/entity-definition/meta-entities/meta-method/meta-method.js +11 -0
- package/dist/entity-definition/meta-entities/meta-method/meta-method.js.map +1 -0
- package/dist/entity-definition/meta-entities/meta-use-case/index.d.ts +2 -0
- package/dist/entity-definition/meta-entities/meta-use-case/index.d.ts.map +1 -0
- package/dist/entity-definition/meta-entities/meta-use-case/index.js +3 -0
- package/dist/entity-definition/meta-entities/meta-use-case/index.js.map +1 -0
- package/dist/entity-definition/meta-entities/meta-use-case/meta-use-case.d.ts +94 -0
- package/dist/entity-definition/meta-entities/meta-use-case/meta-use-case.d.ts.map +1 -0
- package/dist/entity-definition/meta-entities/meta-use-case/meta-use-case.js +17 -0
- package/dist/entity-definition/meta-entities/meta-use-case/meta-use-case.js.map +1 -0
- package/dist/entity-definition/metadata/entity-metadata-document.d.ts +23 -0
- package/dist/entity-definition/metadata/entity-metadata-document.d.ts.map +1 -0
- package/dist/entity-definition/metadata/entity-metadata-document.js +16 -0
- package/dist/entity-definition/metadata/entity-metadata-document.js.map +1 -0
- package/dist/entity-definition/metadata/entity-metadata-source.d.ts +19 -0
- package/dist/entity-definition/metadata/entity-metadata-source.d.ts.map +1 -0
- package/dist/entity-definition/metadata/entity-metadata-source.js +15 -0
- package/dist/entity-definition/metadata/entity-metadata-source.js.map +1 -0
- package/dist/entity-definition/metadata/index.d.ts +3 -0
- package/dist/entity-definition/metadata/index.d.ts.map +1 -0
- package/dist/entity-definition/metadata/index.js +4 -0
- package/dist/entity-definition/metadata/index.js.map +1 -0
- package/dist/entity-definition/reconstruct/clone-entity-draft.d.ts +34 -0
- package/dist/entity-definition/reconstruct/clone-entity-draft.d.ts.map +1 -0
- package/dist/entity-definition/reconstruct/clone-entity-draft.js +75 -0
- package/dist/entity-definition/reconstruct/clone-entity-draft.js.map +1 -0
- package/dist/entity-definition/reconstruct/coerce-field-value.d.ts +34 -0
- package/dist/entity-definition/reconstruct/coerce-field-value.d.ts.map +1 -0
- package/dist/entity-definition/reconstruct/coerce-field-value.js +42 -0
- package/dist/entity-definition/reconstruct/coerce-field-value.js.map +1 -0
- package/dist/entity-definition/reconstruct/index.d.ts +5 -0
- package/dist/entity-definition/reconstruct/index.d.ts.map +1 -0
- package/dist/entity-definition/reconstruct/index.js +6 -0
- package/dist/entity-definition/reconstruct/index.js.map +1 -0
- package/dist/entity-definition/reconstruct/reconstruct-child.d.ts +35 -0
- package/dist/entity-definition/reconstruct/reconstruct-child.d.ts.map +1 -0
- package/dist/entity-definition/reconstruct/reconstruct-child.js +47 -0
- package/dist/entity-definition/reconstruct/reconstruct-child.js.map +1 -0
- package/dist/entity-definition/reconstruct/reconstruct-entity.d.ts +49 -0
- package/dist/entity-definition/reconstruct/reconstruct-entity.d.ts.map +1 -0
- package/dist/entity-definition/reconstruct/reconstruct-entity.js +116 -0
- package/dist/entity-definition/reconstruct/reconstruct-entity.js.map +1 -0
- package/dist/entity-definition/serializer/deserialize.d.ts +13 -0
- package/dist/entity-definition/serializer/deserialize.d.ts.map +1 -0
- package/dist/entity-definition/serializer/deserialize.js +145 -0
- package/dist/entity-definition/serializer/deserialize.js.map +1 -0
- package/dist/entity-definition/serializer/index.d.ts +3 -0
- package/dist/entity-definition/serializer/index.d.ts.map +1 -0
- package/dist/entity-definition/serializer/index.js +4 -0
- package/dist/entity-definition/serializer/index.js.map +1 -0
- package/dist/entity-definition/serializer/serialize.d.ts +26 -0
- package/dist/entity-definition/serializer/serialize.d.ts.map +1 -0
- package/dist/entity-definition/serializer/serialize.js +64 -0
- package/dist/entity-definition/serializer/serialize.js.map +1 -0
- package/dist/envelope/event-pattern.d.ts +14 -0
- package/dist/envelope/event-pattern.d.ts.map +1 -0
- package/dist/envelope/event-pattern.js +30 -0
- package/dist/envelope/event-pattern.js.map +1 -0
- package/dist/envelope/index.d.ts +5 -0
- package/dist/envelope/index.d.ts.map +1 -0
- package/dist/envelope/index.js +6 -0
- package/dist/envelope/index.js.map +1 -0
- package/dist/envelope/make-envelope.d.ts +45 -0
- package/dist/envelope/make-envelope.d.ts.map +1 -0
- package/dist/envelope/make-envelope.js +111 -0
- package/dist/envelope/make-envelope.js.map +1 -0
- package/dist/envelope/read-envelope.d.ts +48 -0
- package/dist/envelope/read-envelope.d.ts.map +1 -0
- package/dist/envelope/read-envelope.js +138 -0
- package/dist/envelope/read-envelope.js.map +1 -0
- package/dist/envelope/types.d.ts +173 -0
- package/dist/envelope/types.d.ts.map +1 -0
- package/dist/envelope/types.js +6 -0
- package/dist/envelope/types.js.map +1 -0
- package/dist/http/session-cookies.d.ts +25 -0
- package/dist/http/session-cookies.d.ts.map +1 -0
- package/dist/http/session-cookies.js +22 -0
- package/dist/http/session-cookies.js.map +1 -0
- package/dist/i18n/format.d.ts +22 -0
- package/dist/i18n/format.d.ts.map +1 -0
- package/dist/i18n/format.js +49 -0
- package/dist/i18n/format.js.map +1 -0
- package/dist/i18n/index.d.ts +4 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +5 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/i18n/locales.d.ts +23 -0
- package/dist/i18n/locales.d.ts.map +1 -0
- package/dist/i18n/locales.js +25 -0
- package/dist/i18n/locales.js.map +1 -0
- package/dist/i18n/negotiate.d.ts +39 -0
- package/dist/i18n/negotiate.d.ts.map +1 -0
- package/dist/i18n/negotiate.js +63 -0
- package/dist/i18n/negotiate.js.map +1 -0
- package/dist/index.d.ts +42 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +43 -0
- package/dist/index.js.map +1 -0
- package/dist/rsql/coerce-rsql.d.ts +27 -0
- package/dist/rsql/coerce-rsql.d.ts.map +1 -0
- package/dist/rsql/coerce-rsql.js +121 -0
- package/dist/rsql/coerce-rsql.js.map +1 -0
- package/dist/rsql/index.d.ts +8 -0
- package/dist/rsql/index.d.ts.map +1 -0
- package/dist/rsql/index.js +9 -0
- package/dist/rsql/index.js.map +1 -0
- package/dist/rsql/load-request-url.d.ts +30 -0
- package/dist/rsql/load-request-url.d.ts.map +1 -0
- package/dist/rsql/load-request-url.js +67 -0
- package/dist/rsql/load-request-url.js.map +1 -0
- package/dist/rsql/parse-rsql.d.ts +35 -0
- package/dist/rsql/parse-rsql.d.ts.map +1 -0
- package/dist/rsql/parse-rsql.js +235 -0
- package/dist/rsql/parse-rsql.js.map +1 -0
- package/dist/rsql/rsql-operators.d.ts +36 -0
- package/dist/rsql/rsql-operators.d.ts.map +1 -0
- package/dist/rsql/rsql-operators.js +65 -0
- package/dist/rsql/rsql-operators.js.map +1 -0
- package/dist/rsql/rsql-values.d.ts +11 -0
- package/dist/rsql/rsql-values.d.ts.map +1 -0
- package/dist/rsql/rsql-values.js +26 -0
- package/dist/rsql/rsql-values.js.map +1 -0
- package/dist/rsql/serialize-rsql.d.ts +19 -0
- package/dist/rsql/serialize-rsql.d.ts.map +1 -0
- package/dist/rsql/serialize-rsql.js +71 -0
- package/dist/rsql/serialize-rsql.js.map +1 -0
- package/dist/rsql/sort-param.d.ts +20 -0
- package/dist/rsql/sort-param.d.ts.map +1 -0
- package/dist/rsql/sort-param.js +66 -0
- package/dist/rsql/sort-param.js.map +1 -0
- package/dist/types/BulkOutcome.d.ts +27 -0
- package/dist/types/BulkOutcome.d.ts.map +1 -0
- package/dist/types/BulkOutcome.js +8 -0
- package/dist/types/BulkOutcome.js.map +1 -0
- package/dist/types/Entity.d.ts +6 -0
- package/dist/types/Entity.d.ts.map +1 -0
- package/dist/types/Entity.js +3 -0
- package/dist/types/Entity.js.map +1 -0
- package/dist/types/EntityAction.d.ts +15 -0
- package/dist/types/EntityAction.d.ts.map +1 -0
- package/dist/types/EntityAction.js +18 -0
- package/dist/types/EntityAction.js.map +1 -0
- package/dist/types/EntityDraft.d.ts +47 -0
- package/dist/types/EntityDraft.d.ts.map +1 -0
- package/dist/types/EntityDraft.js +14 -0
- package/dist/types/EntityDraft.js.map +1 -0
- package/dist/types/EntityFiltering.d.ts +45 -0
- package/dist/types/EntityFiltering.d.ts.map +1 -0
- package/dist/types/EntityFiltering.js +30 -0
- package/dist/types/EntityFiltering.js.map +1 -0
- package/dist/types/EntityLoadRequest.d.ts +10 -0
- package/dist/types/EntityLoadRequest.d.ts.map +1 -0
- package/dist/types/EntityLoadRequest.js +3 -0
- package/dist/types/EntityLoadRequest.js.map +1 -0
- package/dist/types/EntityPage.d.ts +8 -0
- package/dist/types/EntityPage.d.ts.map +1 -0
- package/dist/types/EntityPage.js +3 -0
- package/dist/types/EntityPage.js.map +1 -0
- package/dist/types/EntityRowDraft.d.ts +79 -0
- package/dist/types/EntityRowDraft.d.ts.map +1 -0
- package/dist/types/EntityRowDraft.js +65 -0
- package/dist/types/EntityRowDraft.js.map +1 -0
- package/dist/types/EntitySelection.d.ts +117 -0
- package/dist/types/EntitySelection.d.ts.map +1 -0
- package/dist/types/EntitySelection.js +107 -0
- package/dist/types/EntitySelection.js.map +1 -0
- package/dist/types/EntitySorting.d.ts +7 -0
- package/dist/types/EntitySorting.d.ts.map +1 -0
- package/dist/types/EntitySorting.js +3 -0
- package/dist/types/EntitySorting.js.map +1 -0
- package/dist/types/Json.d.ts +37 -0
- package/dist/types/Json.d.ts.map +1 -0
- package/dist/types/Json.js +43 -0
- package/dist/types/Json.js.map +1 -0
- package/dist/types/StandardSchema.d.ts +45 -0
- package/dist/types/StandardSchema.d.ts.map +1 -0
- package/dist/types/StandardSchema.js +15 -0
- package/dist/types/StandardSchema.js.map +1 -0
- package/dist/types/UseCase.d.ts +10 -0
- package/dist/types/UseCase.d.ts.map +1 -0
- package/dist/types/UseCase.js +10 -0
- package/dist/types/UseCase.js.map +1 -0
- package/dist/wizard/index.d.ts +4 -0
- package/dist/wizard/index.d.ts.map +1 -0
- package/dist/wizard/index.js +5 -0
- package/dist/wizard/index.js.map +1 -0
- package/dist/wizard/wizard-definition.d.ts +108 -0
- package/dist/wizard/wizard-definition.d.ts.map +1 -0
- package/dist/wizard/wizard-definition.js +125 -0
- package/dist/wizard/wizard-definition.js.map +1 -0
- package/dist/wizard/wizard-navigation.d.ts +81 -0
- package/dist/wizard/wizard-navigation.d.ts.map +1 -0
- package/dist/wizard/wizard-navigation.js +139 -0
- package/dist/wizard/wizard-navigation.js.map +1 -0
- package/dist/wizard/wizard-state.d.ts +89 -0
- package/dist/wizard/wizard-state.d.ts.map +1 -0
- package/dist/wizard/wizard-state.js +103 -0
- package/dist/wizard/wizard-state.js.map +1 -0
- package/package.json +64 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/entity-definition/links/entity-link-source/entity-link-source.ts"],"sourcesContent":["import { EntifixError } from '../../../base-entities/entifix-error/index.js';\nimport { Entity, EntityConstructor } from '../../../types/Entity.js';\nimport { FilterGroup } from '../../../types/EntityFiltering.js';\nimport { EntitySorting } from '../../../types/EntitySorting.js';\n\n/**\n * A paged, filterable list of link targets, expressed as state plus the commands\n * that change it.\n *\n * The member names match what a table already renders from, so a browse dialog\n * forwards this object through untouched. It carries no Effect and no React: the\n * hook that produces it lives in the integration layer, the components that\n * consume it in the controls layer, and those two may not import each other —\n * this contract in `core` is what lets them meet.\n */\nexport interface EntityLinkListView<TEntity extends Entity> {\n items: ReadonlyArray<TEntity>;\n totalItems: number;\n currentPage: number;\n pageSize: number;\n isLoading: boolean;\n error?: EntifixError;\n filtering?: FilterGroup<TEntity>;\n sorting?: EntitySorting<TEntity>;\n onPageChange: (page: number) => void;\n onPageSizeChange: (pageSize: number) => void;\n onFilteringChange: (filtering: FilterGroup<TEntity>) => void;\n onSortingChange: (sorting: EntitySorting<TEntity>) => void;\n}\n\n/** The quick half: a term, and the short list of matches it produces. */\nexport interface EntityLinkQuickSearch<TEntity extends Entity> {\n term: string;\n setTerm: (term: string) => void;\n options: ReadonlyArray<TEntity>;\n isLoading: boolean;\n error?: EntifixError;\n}\n\n/** The browse half: the full list view, plus the dialog holding it. */\nexport interface EntityLinkBrowse<\n TEntity extends Entity,\n> extends EntityLinkListView<TEntity> {\n isOpen: boolean;\n open: () => void;\n close: () => void;\n}\n\n/**\n * Everything an editor needs in order to set one relation, and nothing about how\n * the targets are fetched.\n *\n * Two ways in, because they answer different questions: {@link quick} is\n * \"I know roughly what it is called\", {@link browse} is \"I need to look at the\n * catalog and filter it\". {@link selected} is the third, quieter one — a draft\n * restored from storage holds an id and no instance, and an id is not a name.\n */\nexport interface EntityLinkSource<TEntity extends Entity> {\n entityConstructor: EntityConstructor<TEntity>;\n /** Reads a target's display label, per the owner's `linkLabelProperty`. */\n labelOf: (entity: TEntity) => string;\n /**\n * The currently held id, resolved into something a form can use.\n *\n * `entity` is the whole target, not just its name, and that matters: a draft\n * restored from storage holds ids only, so the instance a `linkSerialization:\n * 'embedded'` member needs at submit is gone. Resolving the id was already\n * happening for the label — carrying the instance out is what lets the form\n * rehydrate its selection instead of quietly writing the `id` shape onto an\n * `embedded` member.\n */\n selected: { label?: string; entity?: TEntity; isLoading: boolean };\n quick: EntityLinkQuickSearch<TEntity>;\n browse: EntityLinkBrowse<TEntity>;\n}\n"],"names":[],"mappings":"AAgDA;;;;;;;;CAQC,GACD,WAiBC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/entity-definition/links/entity-link-source/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/entity-definition/links/entity-link-source/index.ts"],"sourcesContent":["export * from './entity-link-source.js';\n"],"names":[],"mappings":"AAAA,cAAc,0BAA0B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/entity-definition/meta-entities/meta-accessor/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/entity-definition/meta-entities/meta-accessor/index.ts"],"sourcesContent":["export * from './meta-accessor.js';\n"],"names":[],"mappings":"AAAA,cAAc,qBAAqB"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
export type MetaAccessorKind = 'getter' | 'setter';
|
|
2
|
+
/**
|
|
3
|
+
* The kinds of value an accessor can hold, as far as generic UI and adapters
|
|
4
|
+
* care. It is deliberately a presentation/behaviour taxonomy rather than a
|
|
5
|
+
* TypeScript mirror: `id` and `enum` are strings at runtime but are rendered,
|
|
6
|
+
* sorted and filtered differently.
|
|
7
|
+
*/
|
|
8
|
+
export declare const MetaAccessorTypes: readonly ["string", "number", "boolean", "date", "enum", "id", "link", "linkCollection", "composition", "scalarCollection"];
|
|
9
|
+
export type MetaAccessorType = (typeof MetaAccessorTypes)[number];
|
|
10
|
+
/**
|
|
11
|
+
* The class whose accessors describe one row of a `composition` member.
|
|
12
|
+
*
|
|
13
|
+
* Deliberately not `EntityConstructor`: a child of a composition is a **value**,
|
|
14
|
+
* not an entity. It has no identity of its own, is never addressed apart from
|
|
15
|
+
* the master that holds it, and therefore has no `id` for `Entity` to require.
|
|
16
|
+
* What it does have is `@accessor()` metadata, which is written to its own
|
|
17
|
+
* class's `Symbol.metadata` bag independently of `@entity()` — so a child is
|
|
18
|
+
* described by its accessors and by nothing else.
|
|
19
|
+
*
|
|
20
|
+
* ⚠️ It is a **shape declaration, not a runtime constructor contract.** Children
|
|
21
|
+
* arrive off the wire as plain objects — the serializer walks `instanceof
|
|
22
|
+
* EntityLink`, not the declared type, so an embedded array passes straight
|
|
23
|
+
* through — and ADR 0032 forbids a class instance inside an autosaved draft
|
|
24
|
+
* anyway. Nothing may branch on `instanceof` against this constructor.
|
|
25
|
+
*/
|
|
26
|
+
export type ChildConstructor<TChild extends object = object> = new (...args: any[]) => TChild;
|
|
27
|
+
/**
|
|
28
|
+
* The wire shape a relation takes: the target's foreign key, or the whole
|
|
29
|
+
* target inlined. Declared here rather than next to `EntityLink` because it is
|
|
30
|
+
* metadata about a member, not state of a link instance.
|
|
31
|
+
*/
|
|
32
|
+
export declare const EntityLinkSerializations: readonly ["id", "embedded"];
|
|
33
|
+
export type EntityLinkSerialization = (typeof EntityLinkSerializations)[number];
|
|
34
|
+
export interface MetaAccessorOptions {
|
|
35
|
+
alias?: string;
|
|
36
|
+
type?: MetaAccessorType;
|
|
37
|
+
readonly?: boolean;
|
|
38
|
+
hidden?: boolean;
|
|
39
|
+
/** Member must hold a value. Drives form validation; defaults to optional. */
|
|
40
|
+
required?: boolean;
|
|
41
|
+
/** Human label for UI. Falls back to a humanized `name`. */
|
|
42
|
+
label?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Translation key for the label, resolved by the presentation layer. Takes
|
|
45
|
+
* precedence over `label`, which stays as the untranslated fallback for a
|
|
46
|
+
* member that has no catalog entry yet.
|
|
47
|
+
*
|
|
48
|
+
* Keys mirror the entity's own `@entity({ key })`, so they are derivable
|
|
49
|
+
* rather than invented: `entity:product-specification.fields.code`.
|
|
50
|
+
*/
|
|
51
|
+
labelKey?: string;
|
|
52
|
+
/** Opt in/out of sorting controls. Defaults per `type`. */
|
|
53
|
+
sortable?: boolean;
|
|
54
|
+
/** Opt in/out of filtering controls. Defaults per `type`. */
|
|
55
|
+
filterable?: boolean;
|
|
56
|
+
/** Default position among the entity's members; ties keep declaration order. */
|
|
57
|
+
order?: number;
|
|
58
|
+
/** Allowed values when `type` is `enum` — drives the filter value control. */
|
|
59
|
+
enumValues?: readonly string[];
|
|
60
|
+
/**
|
|
61
|
+
* Catalog prefix for those values; a value's label is `${enumLabelKey}.${value}`.
|
|
62
|
+
* Explicit rather than derived from `labelKey`, so a member whose values are
|
|
63
|
+
* shared with another member can point both at one vocabulary.
|
|
64
|
+
*/
|
|
65
|
+
enumLabelKey?: string;
|
|
66
|
+
/** Property of a `link` target used as its display label. Default `name`. */
|
|
67
|
+
linkLabelProperty?: string;
|
|
68
|
+
/**
|
|
69
|
+
* Property of a `link` target a picker searches on. Defaults to
|
|
70
|
+
* {@link linkLabelProperty} — you search for what you read. It must be
|
|
71
|
+
* `filterable` on the target entity, since member metadata is also the
|
|
72
|
+
* server-side filter allowlist.
|
|
73
|
+
*/
|
|
74
|
+
linkSearchProperty?: string;
|
|
75
|
+
/**
|
|
76
|
+
* How a `link` travels when its owner is serialized: as the target's scalar
|
|
77
|
+
* foreign key (`id`, the default) or with the whole target inlined
|
|
78
|
+
* (`embedded`). The serializer decides per *link instance* — it inlines
|
|
79
|
+
* whatever `isLoaded` — so without this the shape a write takes would depend
|
|
80
|
+
* on whether the form happened to hold the target. Declaring it on the entity
|
|
81
|
+
* makes the wire shape a property of the relation instead of an accident of
|
|
82
|
+
* the UI.
|
|
83
|
+
*/
|
|
84
|
+
linkSerialization?: EntityLinkSerialization;
|
|
85
|
+
/**
|
|
86
|
+
* The class describing one row of a `composition` member — the child's own
|
|
87
|
+
* `@accessor()` metadata is what a detail grid renders its columns from.
|
|
88
|
+
*
|
|
89
|
+
* A **thunk**, because a child module and the entity that owns it are usually
|
|
90
|
+
* declared in the same package and a direct reference makes the decorator's
|
|
91
|
+
* evaluation order load-bearing. Deferring the read to first use removes the
|
|
92
|
+
* ordering question entirely, which is the same reason a to-one relation's
|
|
93
|
+
* target is reached through a resolver rather than an import.
|
|
94
|
+
*
|
|
95
|
+
* Meaningless on any other type. There is no inference fallback: an empty
|
|
96
|
+
* array cannot be told apart from an empty `string[]` at runtime, so a
|
|
97
|
+
* collection must be declared.
|
|
98
|
+
*/
|
|
99
|
+
childType?: () => ChildConstructor;
|
|
100
|
+
/**
|
|
101
|
+
* Reset this member when the record is copied.
|
|
102
|
+
*
|
|
103
|
+
* It lives on the **accessor**, not on a use case's descriptor, and that is a
|
|
104
|
+
* decision already on file: ADR 0026 closed `UseCaseDescriptor` against
|
|
105
|
+
* per-verb payloads and named this exact case, because a descriptor that
|
|
106
|
+
* grows a field per verb ends up a union of every verb's arguments. Which
|
|
107
|
+
* members a copy must not carry is a property of the *member* — a unique
|
|
108
|
+
* code, an audit stamp, a sequence number — and it is the same answer however
|
|
109
|
+
* the copy is triggered.
|
|
110
|
+
*
|
|
111
|
+
* The identity member is always reset and needs no flag.
|
|
112
|
+
*/
|
|
113
|
+
resetOnClone?: boolean;
|
|
114
|
+
}
|
|
115
|
+
export declare class MetaAccessor {
|
|
116
|
+
readonly name: string | symbol;
|
|
117
|
+
readonly kind: MetaAccessorKind;
|
|
118
|
+
readonly alias?: string;
|
|
119
|
+
readonly type?: MetaAccessorType;
|
|
120
|
+
readonly readonly?: boolean;
|
|
121
|
+
readonly hidden?: boolean;
|
|
122
|
+
readonly required?: boolean;
|
|
123
|
+
readonly label?: string;
|
|
124
|
+
readonly labelKey?: string;
|
|
125
|
+
readonly sortable?: boolean;
|
|
126
|
+
readonly filterable?: boolean;
|
|
127
|
+
readonly order?: number;
|
|
128
|
+
readonly enumValues?: readonly string[];
|
|
129
|
+
readonly enumLabelKey?: string;
|
|
130
|
+
readonly linkLabelProperty?: string;
|
|
131
|
+
readonly linkSearchProperty?: string;
|
|
132
|
+
readonly linkSerialization?: EntityLinkSerialization;
|
|
133
|
+
readonly childType?: () => ChildConstructor;
|
|
134
|
+
readonly resetOnClone?: boolean;
|
|
135
|
+
constructor(name: string | symbol, kind: MetaAccessorKind, options?: MetaAccessorOptions);
|
|
136
|
+
}
|
|
137
|
+
//# sourceMappingURL=meta-accessor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta-accessor.d.ts","sourceRoot":"","sources":["../../../../src/entity-definition/meta-entities/meta-accessor/meta-accessor.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEnD;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,6HAWpB,CAAC;AACX,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAElE;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,gBAAgB,CAAC,MAAM,SAAS,MAAM,GAAG,MAAM,IAAI,KAI7D,GAAG,IAAI,EAAE,GAAG,EAAE,KACX,MAAM,CAAC;AAEZ;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,6BAA8B,CAAC;AACpE,MAAM,MAAM,uBAAuB,GAAG,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhF,MAAM,WAAW,mBAAmB;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,4DAA4D;IAC5D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,6DAA6D;IAC7D,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gFAAgF;IAChF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8EAA8E;IAC9E,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,6EAA6E;IAC7E,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;;;;;;OAQG;IACH,iBAAiB,CAAC,EAAE,uBAAuB,CAAC;IAC5C;;;;;;;;;;;;;OAaG;IACH,SAAS,CAAC,EAAE,MAAM,gBAAgB,CAAC;IACnC;;;;;;;;;;;;OAYG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,qBAAa,YAAY;IAGvB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAChC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACjC,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACxC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IACpC,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IACrC,QAAQ,CAAC,iBAAiB,CAAC,EAAE,uBAAuB,CAAC;IACrD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,gBAAgB,CAAC;IAC5C,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;gBAM9B,IAAI,EAAE,MAAM,GAAG,MAAM,EACrB,IAAI,EAAE,gBAAgB,EACtB,OAAO,CAAC,EAAE,mBAAmB;CA6BhC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The kinds of value an accessor can hold, as far as generic UI and adapters
|
|
3
|
+
* care. It is deliberately a presentation/behaviour taxonomy rather than a
|
|
4
|
+
* TypeScript mirror: `id` and `enum` are strings at runtime but are rendered,
|
|
5
|
+
* sorted and filtered differently.
|
|
6
|
+
*/ export const MetaAccessorTypes = [
|
|
7
|
+
'string',
|
|
8
|
+
'number',
|
|
9
|
+
'boolean',
|
|
10
|
+
'date',
|
|
11
|
+
'enum',
|
|
12
|
+
'id',
|
|
13
|
+
'link',
|
|
14
|
+
'linkCollection',
|
|
15
|
+
'composition',
|
|
16
|
+
'scalarCollection'
|
|
17
|
+
];
|
|
18
|
+
/**
|
|
19
|
+
* The wire shape a relation takes: the target's foreign key, or the whole
|
|
20
|
+
* target inlined. Declared here rather than next to `EntityLink` because it is
|
|
21
|
+
* metadata about a member, not state of a link instance.
|
|
22
|
+
*/ export const EntityLinkSerializations = [
|
|
23
|
+
'id',
|
|
24
|
+
'embedded'
|
|
25
|
+
];
|
|
26
|
+
export class MetaAccessor {
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region Constructors
|
|
29
|
+
constructor(name, kind, options){
|
|
30
|
+
this.name = name;
|
|
31
|
+
this.kind = kind;
|
|
32
|
+
this.alias = options == null ? void 0 : options.alias;
|
|
33
|
+
this.type = options == null ? void 0 : options.type;
|
|
34
|
+
this.readonly = options == null ? void 0 : options.readonly;
|
|
35
|
+
this.hidden = options == null ? void 0 : options.hidden;
|
|
36
|
+
this.required = options == null ? void 0 : options.required;
|
|
37
|
+
this.label = options == null ? void 0 : options.label;
|
|
38
|
+
this.labelKey = options == null ? void 0 : options.labelKey;
|
|
39
|
+
this.sortable = options == null ? void 0 : options.sortable;
|
|
40
|
+
this.filterable = options == null ? void 0 : options.filterable;
|
|
41
|
+
this.order = options == null ? void 0 : options.order;
|
|
42
|
+
this.enumValues = options == null ? void 0 : options.enumValues;
|
|
43
|
+
this.enumLabelKey = options == null ? void 0 : options.enumLabelKey;
|
|
44
|
+
this.linkLabelProperty = options == null ? void 0 : options.linkLabelProperty;
|
|
45
|
+
this.linkSearchProperty = options == null ? void 0 : options.linkSearchProperty;
|
|
46
|
+
this.linkSerialization = options == null ? void 0 : options.linkSerialization;
|
|
47
|
+
this.childType = options == null ? void 0 : options.childType;
|
|
48
|
+
this.resetOnClone = options == null ? void 0 : options.resetOnClone;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
//# sourceMappingURL=meta-accessor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/entity-definition/meta-entities/meta-accessor/meta-accessor.ts"],"sourcesContent":["export type MetaAccessorKind = 'getter' | 'setter';\n\n/**\n * The kinds of value an accessor can hold, as far as generic UI and adapters\n * care. It is deliberately a presentation/behaviour taxonomy rather than a\n * TypeScript mirror: `id` and `enum` are strings at runtime but are rendered,\n * sorted and filtered differently.\n */\nexport const MetaAccessorTypes = [\n 'string',\n 'number',\n 'boolean',\n 'date',\n 'enum',\n 'id',\n 'link',\n 'linkCollection',\n 'composition',\n 'scalarCollection',\n] as const;\nexport type MetaAccessorType = (typeof MetaAccessorTypes)[number];\n\n/**\n * The class whose accessors describe one row of a `composition` member.\n *\n * Deliberately not `EntityConstructor`: a child of a composition is a **value**,\n * not an entity. It has no identity of its own, is never addressed apart from\n * the master that holds it, and therefore has no `id` for `Entity` to require.\n * What it does have is `@accessor()` metadata, which is written to its own\n * class's `Symbol.metadata` bag independently of `@entity()` — so a child is\n * described by its accessors and by nothing else.\n *\n * ⚠️ It is a **shape declaration, not a runtime constructor contract.** Children\n * arrive off the wire as plain objects — the serializer walks `instanceof\n * EntityLink`, not the declared type, so an embedded array passes straight\n * through — and ADR 0032 forbids a class instance inside an autosaved draft\n * anyway. Nothing may branch on `instanceof` against this constructor.\n */\nexport type ChildConstructor<TChild extends object = object> = new (\n // Mirrors `EntityConstructor`: the arguments are the child's business, only\n // the class identity matters here.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ...args: any[]\n) => TChild;\n\n/**\n * The wire shape a relation takes: the target's foreign key, or the whole\n * target inlined. Declared here rather than next to `EntityLink` because it is\n * metadata about a member, not state of a link instance.\n */\nexport const EntityLinkSerializations = ['id', 'embedded'] as const;\nexport type EntityLinkSerialization = (typeof EntityLinkSerializations)[number];\n\nexport interface MetaAccessorOptions {\n alias?: string;\n type?: MetaAccessorType;\n readonly?: boolean;\n hidden?: boolean;\n /** Member must hold a value. Drives form validation; defaults to optional. */\n required?: boolean;\n /** Human label for UI. Falls back to a humanized `name`. */\n label?: string;\n /**\n * Translation key for the label, resolved by the presentation layer. Takes\n * precedence over `label`, which stays as the untranslated fallback for a\n * member that has no catalog entry yet.\n *\n * Keys mirror the entity's own `@entity({ key })`, so they are derivable\n * rather than invented: `entity:product-specification.fields.code`.\n */\n labelKey?: string;\n /** Opt in/out of sorting controls. Defaults per `type`. */\n sortable?: boolean;\n /** Opt in/out of filtering controls. Defaults per `type`. */\n filterable?: boolean;\n /** Default position among the entity's members; ties keep declaration order. */\n order?: number;\n /** Allowed values when `type` is `enum` — drives the filter value control. */\n enumValues?: readonly string[];\n /**\n * Catalog prefix for those values; a value's label is `${enumLabelKey}.${value}`.\n * Explicit rather than derived from `labelKey`, so a member whose values are\n * shared with another member can point both at one vocabulary.\n */\n enumLabelKey?: string;\n /** Property of a `link` target used as its display label. Default `name`. */\n linkLabelProperty?: string;\n /**\n * Property of a `link` target a picker searches on. Defaults to\n * {@link linkLabelProperty} — you search for what you read. It must be\n * `filterable` on the target entity, since member metadata is also the\n * server-side filter allowlist.\n */\n linkSearchProperty?: string;\n /**\n * How a `link` travels when its owner is serialized: as the target's scalar\n * foreign key (`id`, the default) or with the whole target inlined\n * (`embedded`). The serializer decides per *link instance* — it inlines\n * whatever `isLoaded` — so without this the shape a write takes would depend\n * on whether the form happened to hold the target. Declaring it on the entity\n * makes the wire shape a property of the relation instead of an accident of\n * the UI.\n */\n linkSerialization?: EntityLinkSerialization;\n /**\n * The class describing one row of a `composition` member — the child's own\n * `@accessor()` metadata is what a detail grid renders its columns from.\n *\n * A **thunk**, because a child module and the entity that owns it are usually\n * declared in the same package and a direct reference makes the decorator's\n * evaluation order load-bearing. Deferring the read to first use removes the\n * ordering question entirely, which is the same reason a to-one relation's\n * target is reached through a resolver rather than an import.\n *\n * Meaningless on any other type. There is no inference fallback: an empty\n * array cannot be told apart from an empty `string[]` at runtime, so a\n * collection must be declared.\n */\n childType?: () => ChildConstructor;\n /**\n * Reset this member when the record is copied.\n *\n * It lives on the **accessor**, not on a use case's descriptor, and that is a\n * decision already on file: ADR 0026 closed `UseCaseDescriptor` against\n * per-verb payloads and named this exact case, because a descriptor that\n * grows a field per verb ends up a union of every verb's arguments. Which\n * members a copy must not carry is a property of the *member* — a unique\n * code, an audit stamp, a sequence number — and it is the same answer however\n * the copy is triggered.\n *\n * The identity member is always reset and needs no flag.\n */\n resetOnClone?: boolean;\n}\n\nexport class MetaAccessor {\n //#region Properties\n\n readonly name: string | symbol;\n readonly kind: MetaAccessorKind;\n readonly alias?: string;\n readonly type?: MetaAccessorType;\n readonly readonly?: boolean;\n readonly hidden?: boolean;\n readonly required?: boolean;\n readonly label?: string;\n readonly labelKey?: string;\n readonly sortable?: boolean;\n readonly filterable?: boolean;\n readonly order?: number;\n readonly enumValues?: readonly string[];\n readonly enumLabelKey?: string;\n readonly linkLabelProperty?: string;\n readonly linkSearchProperty?: string;\n readonly linkSerialization?: EntityLinkSerialization;\n readonly childType?: () => ChildConstructor;\n readonly resetOnClone?: boolean;\n\n //#endregion\n\n //#region Constructors\n constructor(\n name: string | symbol,\n kind: MetaAccessorKind,\n options?: MetaAccessorOptions,\n ) {\n this.name = name;\n this.kind = kind;\n this.alias = options?.alias;\n this.type = options?.type;\n this.readonly = options?.readonly;\n this.hidden = options?.hidden;\n this.required = options?.required;\n this.label = options?.label;\n this.labelKey = options?.labelKey;\n this.sortable = options?.sortable;\n this.filterable = options?.filterable;\n this.order = options?.order;\n this.enumValues = options?.enumValues;\n this.enumLabelKey = options?.enumLabelKey;\n this.linkLabelProperty = options?.linkLabelProperty;\n this.linkSearchProperty = options?.linkSearchProperty;\n this.linkSerialization = options?.linkSerialization;\n this.childType = options?.childType;\n this.resetOnClone = options?.resetOnClone;\n }\n //#endregion\n\n //#region Methods\n //#endregion\n\n //#region Accessors\n //#endregion\n}\n"],"names":["MetaAccessorTypes","EntityLinkSerializations","MetaAccessor","name","kind","options","alias","type","readonly","hidden","required","label","labelKey","sortable","filterable","order","enumValues","enumLabelKey","linkLabelProperty","linkSearchProperty","linkSerialization","childType","resetOnClone"],"mappings":"AAEA;;;;;CAKC,GACD,OAAO,MAAMA,oBAAoB;IAC/B;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD,CAAU;AA0BX;;;;CAIC,GACD,OAAO,MAAMC,2BAA2B;IAAC;IAAM;CAAW,CAAU;AAqFpE,OAAO,MAAMC;IAuBX,YAAY;IAEZ,sBAAsB;IACtB,YACEC,IAAqB,EACrBC,IAAsB,EACtBC,OAA6B,CAC7B;QACA,IAAI,CAACF,IAAI,GAAGA;QACZ,IAAI,CAACC,IAAI,GAAGA;QACZ,IAAI,CAACE,KAAK,GAAGD,2BAAAA,QAASC,KAAK;QAC3B,IAAI,CAACC,IAAI,GAAGF,2BAAAA,QAASE,IAAI;QACzB,IAAI,CAACC,QAAQ,GAAGH,2BAAAA,QAASG,QAAQ;QACjC,IAAI,CAACC,MAAM,GAAGJ,2BAAAA,QAASI,MAAM;QAC7B,IAAI,CAACC,QAAQ,GAAGL,2BAAAA,QAASK,QAAQ;QACjC,IAAI,CAACC,KAAK,GAAGN,2BAAAA,QAASM,KAAK;QAC3B,IAAI,CAACC,QAAQ,GAAGP,2BAAAA,QAASO,QAAQ;QACjC,IAAI,CAACC,QAAQ,GAAGR,2BAAAA,QAASQ,QAAQ;QACjC,IAAI,CAACC,UAAU,GAAGT,2BAAAA,QAASS,UAAU;QACrC,IAAI,CAACC,KAAK,GAAGV,2BAAAA,QAASU,KAAK;QAC3B,IAAI,CAACC,UAAU,GAAGX,2BAAAA,QAASW,UAAU;QACrC,IAAI,CAACC,YAAY,GAAGZ,2BAAAA,QAASY,YAAY;QACzC,IAAI,CAACC,iBAAiB,GAAGb,2BAAAA,QAASa,iBAAiB;QACnD,IAAI,CAACC,kBAAkB,GAAGd,2BAAAA,QAASc,kBAAkB;QACrD,IAAI,CAACC,iBAAiB,GAAGf,2BAAAA,QAASe,iBAAiB;QACnD,IAAI,CAACC,SAAS,GAAGhB,2BAAAA,QAASgB,SAAS;QACnC,IAAI,CAACC,YAAY,GAAGjB,2BAAAA,QAASiB,YAAY;IAC3C;AAQF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/entity-definition/meta-entities/meta-entity/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/entity-definition/meta-entities/meta-entity/index.ts"],"sourcesContent":["export * from './meta-entity.js';\n"],"names":[],"mappings":"AAAA,cAAc,mBAAmB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface MetaEntityOptions {
|
|
2
|
+
key?: string;
|
|
3
|
+
domain?: string;
|
|
4
|
+
/** Translation key for the entity's singular name, e.g. `entity:product-specification.label`. */
|
|
5
|
+
labelKey?: string;
|
|
6
|
+
/** Translation key for its plural, e.g. `entity:product-specification.plural`. */
|
|
7
|
+
pluralKey?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare class MetaEntity {
|
|
10
|
+
readonly name: string;
|
|
11
|
+
readonly key?: string;
|
|
12
|
+
readonly domain?: string;
|
|
13
|
+
readonly labelKey?: string;
|
|
14
|
+
readonly pluralKey?: string;
|
|
15
|
+
constructor(name: string, options?: MetaEntityOptions);
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=meta-entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta-entity.d.ts","sourceRoot":"","sources":["../../../../src/entity-definition/meta-entities/meta-entity/meta-entity.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAChC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iGAAiG;IACjG,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kFAAkF;IAClF,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,qBAAa,UAAU;IAErB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;gBAIhB,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,iBAAiB;CActD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export class MetaEntity {
|
|
2
|
+
//#endregion
|
|
3
|
+
//#region Constructors
|
|
4
|
+
constructor(name, options){
|
|
5
|
+
this.name = name;
|
|
6
|
+
this.key = options == null ? void 0 : options.key;
|
|
7
|
+
this.domain = options == null ? void 0 : options.domain;
|
|
8
|
+
this.labelKey = options == null ? void 0 : options.labelKey;
|
|
9
|
+
this.pluralKey = options == null ? void 0 : options.pluralKey;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=meta-entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/entity-definition/meta-entities/meta-entity/meta-entity.ts"],"sourcesContent":["export interface MetaEntityOptions {\n key?: string;\n domain?: string;\n /** Translation key for the entity's singular name, e.g. `entity:product-specification.label`. */\n labelKey?: string;\n /** Translation key for its plural, e.g. `entity:product-specification.plural`. */\n pluralKey?: string;\n}\n\nexport class MetaEntity {\n //#region Properties\n readonly name: string;\n readonly key?: string;\n readonly domain?: string;\n readonly labelKey?: string;\n readonly pluralKey?: string;\n //#endregion\n\n //#region Constructors\n constructor(name: string, options?: MetaEntityOptions) {\n this.name = name;\n this.key = options?.key;\n this.domain = options?.domain;\n this.labelKey = options?.labelKey;\n this.pluralKey = options?.pluralKey;\n }\n //#endregion\n\n //#region Methods\n //#endregion\n\n //#region Accessors\n //#endregion\n}\n"],"names":["MetaEntity","name","options","key","domain","labelKey","pluralKey"],"mappings":"AASA,OAAO,MAAMA;IAOX,YAAY;IAEZ,sBAAsB;IACtB,YAAYC,IAAY,EAAEC,OAA2B,CAAE;QACrD,IAAI,CAACD,IAAI,GAAGA;QACZ,IAAI,CAACE,GAAG,GAAGD,2BAAAA,QAASC,GAAG;QACvB,IAAI,CAACC,MAAM,GAAGF,2BAAAA,QAASE,MAAM;QAC7B,IAAI,CAACC,QAAQ,GAAGH,2BAAAA,QAASG,QAAQ;QACjC,IAAI,CAACC,SAAS,GAAGJ,2BAAAA,QAASI,SAAS;IACrC;AAQF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/entity-definition/meta-entities/meta-method/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/entity-definition/meta-entities/meta-method/index.ts"],"sourcesContent":["export * from './meta-method.js';\n"],"names":[],"mappings":"AAAA,cAAc,mBAAmB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
2
|
+
export interface MetaMethodHttp {
|
|
3
|
+
method: HttpMethod;
|
|
4
|
+
path: string;
|
|
5
|
+
}
|
|
6
|
+
export interface MetaMethodOptions {
|
|
7
|
+
http?: MetaMethodHttp;
|
|
8
|
+
returnType?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare class MetaMethod {
|
|
11
|
+
readonly name: string | symbol;
|
|
12
|
+
readonly http?: MetaMethodHttp;
|
|
13
|
+
readonly returnType?: string;
|
|
14
|
+
constructor(name: string | symbol, options?: MetaMethodOptions);
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=meta-method.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta-method.d.ts","sourceRoot":"","sources":["../../../../src/entity-definition/meta-entities/meta-method/meta-method.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAC;AAErE,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,UAAU,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,qBAAa,UAAU;IAGrB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,QAAQ,CAAC,IAAI,CAAC,EAAE,cAAc,CAAC;IAC/B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;gBAKjB,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,OAAO,CAAC,EAAE,iBAAiB;CAY/D"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export class MetaMethod {
|
|
2
|
+
//#endregion
|
|
3
|
+
//#region Constructors
|
|
4
|
+
constructor(name, options){
|
|
5
|
+
this.name = name;
|
|
6
|
+
this.http = options == null ? void 0 : options.http;
|
|
7
|
+
this.returnType = options == null ? void 0 : options.returnType;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=meta-method.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/entity-definition/meta-entities/meta-method/meta-method.ts"],"sourcesContent":["export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';\n\nexport interface MetaMethodHttp {\n method: HttpMethod;\n path: string;\n}\n\nexport interface MetaMethodOptions {\n http?: MetaMethodHttp;\n returnType?: string;\n}\n\nexport class MetaMethod {\n //#region Properties\n\n readonly name: string | symbol;\n readonly http?: MetaMethodHttp;\n readonly returnType?: string;\n\n //#endregion\n\n //#region Constructors\n constructor(name: string | symbol, options?: MetaMethodOptions) {\n this.name = name;\n this.http = options?.http;\n this.returnType = options?.returnType;\n }\n //#endregion\n\n //#region Methods\n //#endregion\n\n //#region Accessors\n //#endregion\n}\n"],"names":["MetaMethod","name","options","http","returnType"],"mappings":"AAYA,OAAO,MAAMA;IAOX,YAAY;IAEZ,sBAAsB;IACtB,YAAYC,IAAqB,EAAEC,OAA2B,CAAE;QAC9D,IAAI,CAACD,IAAI,GAAGA;QACZ,IAAI,CAACE,IAAI,GAAGD,2BAAAA,QAASC,IAAI;QACzB,IAAI,CAACC,UAAU,GAAGF,2BAAAA,QAASE,UAAU;IACvC;AAQF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/entity-definition/meta-entities/meta-use-case/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/entity-definition/meta-entities/meta-use-case/index.ts"],"sourcesContent":["export * from './meta-use-case.js';\n"],"names":[],"mappings":"AAAA,cAAc,qBAAqB"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import type { Entity, EntityConstructor } from '../../../types/Entity.js';
|
|
2
|
+
/** What a use case acts on: one record, a selection, or nothing. */
|
|
3
|
+
export type UseCaseBinding = 'entity' | 'collection' | 'unbound';
|
|
4
|
+
/**
|
|
5
|
+
* Where a surface puts the action. Deliberately **not** derivable from
|
|
6
|
+
* {@link UseCaseBinding}: an entity-bound action can be determining (a footer
|
|
7
|
+
* "Publish" that finalizes the page) or context-independent (a toolbar action
|
|
8
|
+
* available whenever a record is open). Collapsing the two would force every
|
|
9
|
+
* surface to re-derive a placement the author already knew.
|
|
10
|
+
*/
|
|
11
|
+
export type UseCasePlacement = 'context-dependent' | 'context-independent' | 'determining';
|
|
12
|
+
/**
|
|
13
|
+
* One place a verb can appear: a binding and a placement together.
|
|
14
|
+
*
|
|
15
|
+
* The pair is the unit rather than either half, because the two answer
|
|
16
|
+
* different questions — placement decides the *surface* and binding decides the
|
|
17
|
+
* *payload* — and a verb reachable from a row and from a selection differs in
|
|
18
|
+
* both at once.
|
|
19
|
+
*/
|
|
20
|
+
export interface UseCaseCell {
|
|
21
|
+
binding: UseCaseBinding;
|
|
22
|
+
placement: UseCasePlacement;
|
|
23
|
+
}
|
|
24
|
+
/** Confirmation a surface must obtain before running the use case. */
|
|
25
|
+
export interface UseCaseConfirm {
|
|
26
|
+
tone: 'destructive' | 'neutral';
|
|
27
|
+
/** Catalog key. Copy never lives in a descriptor. */
|
|
28
|
+
messageKey: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* What `@useCase()` declares.
|
|
32
|
+
*
|
|
33
|
+
* `entity` is the target the verb is registered against — it is what the
|
|
34
|
+
* decorator appends to, and it is not part of the served descriptor.
|
|
35
|
+
*
|
|
36
|
+
* `labelKey` is mandatory and namespace-qualified, the `GuardedNavItem`
|
|
37
|
+
* convention: i18n is mandatory and `react/jsx-no-literals` fails the build on a
|
|
38
|
+
* string written into JSX, so a descriptor carrying copy could not be rendered.
|
|
39
|
+
*
|
|
40
|
+
* `keywordsKey` is a catalog key rather than a `string[]` so the command palette
|
|
41
|
+
* matches across locales — a user typing an English term reaches a Spanish
|
|
42
|
+
* command.
|
|
43
|
+
*/
|
|
44
|
+
export interface MetaUseCaseOptions<TKey extends string, TEntity extends Entity> {
|
|
45
|
+
entity: EntityConstructor<TEntity>;
|
|
46
|
+
key: TKey;
|
|
47
|
+
binding: UseCaseBinding;
|
|
48
|
+
placement: UseCasePlacement;
|
|
49
|
+
/**
|
|
50
|
+
* Further places the same verb appears, beyond the {@link binding} and
|
|
51
|
+
* {@link placement} above.
|
|
52
|
+
*
|
|
53
|
+
* ⚠️ **One verb, one permission, several surfaces.** Publishing an offering
|
|
54
|
+
* from its form, from a row menu and over a selection is one act reached three
|
|
55
|
+
* ways, and the alternative was three `@useCase()` classes — which `slices`
|
|
56
|
+
* refuses anyway, since a verb key is the third segment of one permission and
|
|
57
|
+
* two classes cannot share a key. Three classes would have meant three
|
|
58
|
+
* permissions for one act, and a grant that let somebody publish one offering
|
|
59
|
+
* but not twenty (#216).
|
|
60
|
+
*
|
|
61
|
+
* The primary cell stays where it is so that nothing already declared
|
|
62
|
+
* changes, and so a descriptor still reads as "this verb lives here" with the
|
|
63
|
+
* rest as additions.
|
|
64
|
+
*/
|
|
65
|
+
alsoAt?: readonly UseCaseCell[];
|
|
66
|
+
labelKey: string;
|
|
67
|
+
keywordsKey?: string;
|
|
68
|
+
confirm?: UseCaseConfirm;
|
|
69
|
+
/** Names a form a surface should open instead of acting immediately. */
|
|
70
|
+
form?: string;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* What the use-case class's **own** metadata carries, as opposed to what is
|
|
74
|
+
* appended to the entity. Two fields are enough to derive the permission, which
|
|
75
|
+
* is what lets `permissionForUseCase(SomeUC)` take a single argument and keeps
|
|
76
|
+
* the verb string written exactly once.
|
|
77
|
+
*/
|
|
78
|
+
export interface MetaUseCaseBinding {
|
|
79
|
+
entity: EntityConstructor<Entity>;
|
|
80
|
+
key: string;
|
|
81
|
+
}
|
|
82
|
+
export declare class MetaUseCase {
|
|
83
|
+
readonly entity: EntityConstructor<Entity>;
|
|
84
|
+
readonly key: string;
|
|
85
|
+
readonly binding: UseCaseBinding;
|
|
86
|
+
readonly placement: UseCasePlacement;
|
|
87
|
+
readonly alsoAt?: readonly UseCaseCell[];
|
|
88
|
+
readonly labelKey: string;
|
|
89
|
+
readonly keywordsKey?: string;
|
|
90
|
+
readonly confirm?: UseCaseConfirm;
|
|
91
|
+
readonly form?: string;
|
|
92
|
+
constructor(options: MetaUseCaseOptions<string, Entity>);
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=meta-use-case.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta-use-case.d.ts","sourceRoot":"","sources":["../../../../src/entity-definition/meta-entities/meta-use-case/meta-use-case.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE1E,oEAAoE;AACpE,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,YAAY,GAAG,SAAS,CAAC;AAEjE;;;;;;GAMG;AACH,MAAM,MAAM,gBAAgB,GAC1B,mBAAmB,GAAG,qBAAqB,GAAG,aAAa,CAAC;AAE9D;;;;;;;GAOG;AACH,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,cAAc,CAAC;IACxB,SAAS,EAAE,gBAAgB,CAAC;CAC7B;AAED,sEAAsE;AACtE,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,aAAa,GAAG,SAAS,CAAC;IAChC,qDAAqD;IACrD,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,kBAAkB,CACjC,IAAI,SAAS,MAAM,EACnB,OAAO,SAAS,MAAM;IAEtB,MAAM,EAAE,iBAAiB,CAAC,OAAO,CAAC,CAAC;IACnC,GAAG,EAAE,IAAI,CAAC;IACV,OAAO,EAAE,cAAc,CAAC;IACxB,SAAS,EAAE,gBAAgB,CAAC;IAC5B;;;;;;;;;;;;;;;OAeG;IACH,MAAM,CAAC,EAAE,SAAS,WAAW,EAAE,CAAC;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,wEAAwE;IACxE,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAClC,GAAG,EAAE,MAAM,CAAC;CACb;AAED,qBAAa,WAAW;IAEtB,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAC3C,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;IACjC,QAAQ,CAAC,SAAS,EAAE,gBAAgB,CAAC;IACrC,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,WAAW,EAAE,CAAC;IACzC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,OAAO,CAAC,EAAE,cAAc,CAAC;IAClC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;gBAIX,OAAO,EAAE,kBAAkB,CAAC,MAAM,EAAE,MAAM,CAAC;CAkBxD"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export class MetaUseCase {
|
|
2
|
+
//#endregion
|
|
3
|
+
//#region Constructors
|
|
4
|
+
constructor(options){
|
|
5
|
+
this.entity = options.entity;
|
|
6
|
+
this.key = options.key;
|
|
7
|
+
this.binding = options.binding;
|
|
8
|
+
this.placement = options.placement;
|
|
9
|
+
this.alsoAt = options.alsoAt;
|
|
10
|
+
this.labelKey = options.labelKey;
|
|
11
|
+
this.keywordsKey = options.keywordsKey;
|
|
12
|
+
this.confirm = options.confirm;
|
|
13
|
+
this.form = options.form;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=meta-use-case.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/entity-definition/meta-entities/meta-use-case/meta-use-case.ts"],"sourcesContent":["import type { Entity, EntityConstructor } from '../../../types/Entity.js';\n\n/** What a use case acts on: one record, a selection, or nothing. */\nexport type UseCaseBinding = 'entity' | 'collection' | 'unbound';\n\n/**\n * Where a surface puts the action. Deliberately **not** derivable from\n * {@link UseCaseBinding}: an entity-bound action can be determining (a footer\n * \"Publish\" that finalizes the page) or context-independent (a toolbar action\n * available whenever a record is open). Collapsing the two would force every\n * surface to re-derive a placement the author already knew.\n */\nexport type UseCasePlacement =\n 'context-dependent' | 'context-independent' | 'determining';\n\n/**\n * One place a verb can appear: a binding and a placement together.\n *\n * The pair is the unit rather than either half, because the two answer\n * different questions — placement decides the *surface* and binding decides the\n * *payload* — and a verb reachable from a row and from a selection differs in\n * both at once.\n */\nexport interface UseCaseCell {\n binding: UseCaseBinding;\n placement: UseCasePlacement;\n}\n\n/** Confirmation a surface must obtain before running the use case. */\nexport interface UseCaseConfirm {\n tone: 'destructive' | 'neutral';\n /** Catalog key. Copy never lives in a descriptor. */\n messageKey: string;\n}\n\n/**\n * What `@useCase()` declares.\n *\n * `entity` is the target the verb is registered against — it is what the\n * decorator appends to, and it is not part of the served descriptor.\n *\n * `labelKey` is mandatory and namespace-qualified, the `GuardedNavItem`\n * convention: i18n is mandatory and `react/jsx-no-literals` fails the build on a\n * string written into JSX, so a descriptor carrying copy could not be rendered.\n *\n * `keywordsKey` is a catalog key rather than a `string[]` so the command palette\n * matches across locales — a user typing an English term reaches a Spanish\n * command.\n */\nexport interface MetaUseCaseOptions<\n TKey extends string,\n TEntity extends Entity,\n> {\n entity: EntityConstructor<TEntity>;\n key: TKey;\n binding: UseCaseBinding;\n placement: UseCasePlacement;\n /**\n * Further places the same verb appears, beyond the {@link binding} and\n * {@link placement} above.\n *\n * ⚠️ **One verb, one permission, several surfaces.** Publishing an offering\n * from its form, from a row menu and over a selection is one act reached three\n * ways, and the alternative was three `@useCase()` classes — which `slices`\n * refuses anyway, since a verb key is the third segment of one permission and\n * two classes cannot share a key. Three classes would have meant three\n * permissions for one act, and a grant that let somebody publish one offering\n * but not twenty (#216).\n *\n * The primary cell stays where it is so that nothing already declared\n * changes, and so a descriptor still reads as \"this verb lives here\" with the\n * rest as additions.\n */\n alsoAt?: readonly UseCaseCell[];\n labelKey: string;\n keywordsKey?: string;\n confirm?: UseCaseConfirm;\n /** Names a form a surface should open instead of acting immediately. */\n form?: string;\n}\n\n/**\n * What the use-case class's **own** metadata carries, as opposed to what is\n * appended to the entity. Two fields are enough to derive the permission, which\n * is what lets `permissionForUseCase(SomeUC)` take a single argument and keeps\n * the verb string written exactly once.\n */\nexport interface MetaUseCaseBinding {\n entity: EntityConstructor<Entity>;\n key: string;\n}\n\nexport class MetaUseCase {\n //#region Properties\n readonly entity: EntityConstructor<Entity>;\n readonly key: string;\n readonly binding: UseCaseBinding;\n readonly placement: UseCasePlacement;\n readonly alsoAt?: readonly UseCaseCell[];\n readonly labelKey: string;\n readonly keywordsKey?: string;\n readonly confirm?: UseCaseConfirm;\n readonly form?: string;\n //#endregion\n\n //#region Constructors\n constructor(options: MetaUseCaseOptions<string, Entity>) {\n this.entity = options.entity;\n this.key = options.key;\n this.binding = options.binding;\n this.placement = options.placement;\n this.alsoAt = options.alsoAt;\n this.labelKey = options.labelKey;\n this.keywordsKey = options.keywordsKey;\n this.confirm = options.confirm;\n this.form = options.form;\n }\n //#endregion\n\n //#region Methods\n //#endregion\n\n //#region Accessors\n //#endregion\n}\n"],"names":["MetaUseCase","options","entity","key","binding","placement","alsoAt","labelKey","keywordsKey","confirm","form"],"mappings":"AA4FA,OAAO,MAAMA;IAWX,YAAY;IAEZ,sBAAsB;IACtB,YAAYC,OAA2C,CAAE;QACvD,IAAI,CAACC,MAAM,GAAGD,QAAQC,MAAM;QAC5B,IAAI,CAACC,GAAG,GAAGF,QAAQE,GAAG;QACtB,IAAI,CAACC,OAAO,GAAGH,QAAQG,OAAO;QAC9B,IAAI,CAACC,SAAS,GAAGJ,QAAQI,SAAS;QAClC,IAAI,CAACC,MAAM,GAAGL,QAAQK,MAAM;QAC5B,IAAI,CAACC,QAAQ,GAAGN,QAAQM,QAAQ;QAChC,IAAI,CAACC,WAAW,GAAGP,QAAQO,WAAW;QACtC,IAAI,CAACC,OAAO,GAAGR,QAAQQ,OAAO;QAC9B,IAAI,CAACC,IAAI,GAAGT,QAAQS,IAAI;IAC1B;AAQF"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { EntityAction } from '../../types/EntityAction.js';
|
|
2
|
+
import type { UseCaseDescriptor } from '../describe/describe-entity-use-cases.js';
|
|
3
|
+
/**
|
|
4
|
+
* What a caller may do with one entity, as answered by
|
|
5
|
+
* `GET /api/<entity>/$metadata`.
|
|
6
|
+
*
|
|
7
|
+
* Both members are **already filtered against the verified principal** — the
|
|
8
|
+
* service computes them through `PolicyDecisionTag`, so this is not a catalogue
|
|
9
|
+
* of everything the model declares but of what this caller is permitted. A UI
|
|
10
|
+
* renders it directly; it never re-checks, and it has nothing to re-check with.
|
|
11
|
+
*
|
|
12
|
+
* `actions` is here beside `useCases` because Save and Delete are the three most
|
|
13
|
+
* common affordances on any screen and they have no descriptor — without them a
|
|
14
|
+
* form would keep rendering its buttons unconditionally and the document would
|
|
15
|
+
* describe only the rare half of the surface.
|
|
16
|
+
*/
|
|
17
|
+
export interface EntityMetadataDocument {
|
|
18
|
+
/** The CRUD subset this caller holds, in {@link ENTITY_ACTIONS} order. */
|
|
19
|
+
actions: EntityAction[];
|
|
20
|
+
/** The declared use cases this caller may invoke, in declaration order. */
|
|
21
|
+
useCases: UseCaseDescriptor[];
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=entity-metadata-document.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity-metadata-document.d.ts","sourceRoot":"","sources":["../../../src/entity-definition/metadata/entity-metadata-document.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAElF;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,sBAAsB;IACrC,0EAA0E;IAC1E,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,2EAA2E;IAC3E,QAAQ,EAAE,iBAAiB,EAAE,CAAC;CAC/B"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a caller may do with one entity, as answered by
|
|
3
|
+
* `GET /api/<entity>/$metadata`.
|
|
4
|
+
*
|
|
5
|
+
* Both members are **already filtered against the verified principal** — the
|
|
6
|
+
* service computes them through `PolicyDecisionTag`, so this is not a catalogue
|
|
7
|
+
* of everything the model declares but of what this caller is permitted. A UI
|
|
8
|
+
* renders it directly; it never re-checks, and it has nothing to re-check with.
|
|
9
|
+
*
|
|
10
|
+
* `actions` is here beside `useCases` because Save and Delete are the three most
|
|
11
|
+
* common affordances on any screen and they have no descriptor — without them a
|
|
12
|
+
* form would keep rendering its buttons unconditionally and the document would
|
|
13
|
+
* describe only the rare half of the surface.
|
|
14
|
+
*/ export { };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=entity-metadata-document.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/entity-definition/metadata/entity-metadata-document.ts"],"sourcesContent":["import type { EntityAction } from '../../types/EntityAction.js';\nimport type { UseCaseDescriptor } from '../describe/describe-entity-use-cases.js';\n\n/**\n * What a caller may do with one entity, as answered by\n * `GET /api/<entity>/$metadata`.\n *\n * Both members are **already filtered against the verified principal** — the\n * service computes them through `PolicyDecisionTag`, so this is not a catalogue\n * of everything the model declares but of what this caller is permitted. A UI\n * renders it directly; it never re-checks, and it has nothing to re-check with.\n *\n * `actions` is here beside `useCases` because Save and Delete are the three most\n * common affordances on any screen and they have no descriptor — without them a\n * form would keep rendering its buttons unconditionally and the document would\n * describe only the rare half of the surface.\n */\nexport interface EntityMetadataDocument {\n /** The CRUD subset this caller holds, in {@link ENTITY_ACTIONS} order. */\n actions: EntityAction[];\n /** The declared use cases this caller may invoke, in declaration order. */\n useCases: UseCaseDescriptor[];\n}\n"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;CAaC,GACD,WAKC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Entity, EntityConstructor } from '../../types/Entity.js';
|
|
2
|
+
import type { EntityMetadataDocument } from './entity-metadata-document.js';
|
|
3
|
+
/**
|
|
4
|
+
* Where a UI gets an entity's {@link EntityMetadataDocument} from.
|
|
5
|
+
*
|
|
6
|
+
* A port, for the same reason `EntityLinkSource` is one: the implementation that
|
|
7
|
+
* fetches lives in the client layer, the components that render live in the
|
|
8
|
+
* controls layer, and those two may not import each other — this contract in
|
|
9
|
+
* `core` is what lets them meet. It carries no Effect and no React deliberately.
|
|
10
|
+
*
|
|
11
|
+
* The indirection is also what keeps use-case *implementations* out of a client
|
|
12
|
+
* bundle. A browser must never import a `@useCase()` class: that would drag its
|
|
13
|
+
* `Effect` body, its repository tags and its whole import closure across the
|
|
14
|
+
* wire. It fetches descriptors instead.
|
|
15
|
+
*/
|
|
16
|
+
export interface EntityMetadataSource {
|
|
17
|
+
fetchMetadata<TEntity extends Entity>(entityConstructor: EntityConstructor<TEntity>): Promise<EntityMetadataDocument>;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=entity-metadata-source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity-metadata-source.d.ts","sourceRoot":"","sources":["../../../src/entity-definition/metadata/entity-metadata-source.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAE5E;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,oBAAoB;IACnC,aAAa,CAAC,OAAO,SAAS,MAAM,EAClC,iBAAiB,EAAE,iBAAiB,CAAC,OAAO,CAAC,GAC5C,OAAO,CAAC,sBAAsB,CAAC,CAAC;CACpC"}
|