@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,138 @@
|
|
|
1
|
+
import { _ as _extends } from "@swc/helpers/_/_extends";
|
|
2
|
+
import { Effect } from 'effect';
|
|
3
|
+
import { EntifixBuildError } from '../base-entities/entifix-error/index.js';
|
|
4
|
+
import { deserializeEntityCollection, deserializeSingleEntity } from '../entity-definition/serializer/index.js';
|
|
5
|
+
import { envelopeEntityName } from './make-envelope.js';
|
|
6
|
+
/**
|
|
7
|
+
* Structural check only — `meta.type` is validated separately so a mismatch
|
|
8
|
+
* reports the expected/actual types rather than a generic "not an envelope".
|
|
9
|
+
*/ export function isEntifixEnvelope(body) {
|
|
10
|
+
if (body == null || typeof body !== 'object') {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
const meta = body.meta;
|
|
14
|
+
return meta != null && typeof meta === 'object' && typeof meta.type === 'string';
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Narrows an arbitrary body to an envelope of the expected `meta.type`, failing
|
|
18
|
+
* with an {@link EntifixBuildError} otherwise. A wrong shape must never
|
|
19
|
+
* silently deserialize into a half-populated entity.
|
|
20
|
+
*/ function assertEnvelope(entityConstructor, body, expected) {
|
|
21
|
+
const entity = envelopeEntityName(entityConstructor);
|
|
22
|
+
if (!isEntifixEnvelope(body)) {
|
|
23
|
+
return Effect.fail(new EntifixBuildError(`Expected an EntifixEnvelope for "${entity}" but the payload carried no meta.type`, undefined, {
|
|
24
|
+
entity,
|
|
25
|
+
expected,
|
|
26
|
+
body
|
|
27
|
+
}));
|
|
28
|
+
}
|
|
29
|
+
if (body.meta.type !== expected) {
|
|
30
|
+
return Effect.fail(new EntifixBuildError(`Expected an EntifixEnvelope of type "${expected}" for "${entity}" but got "${body.meta.type}"`, undefined, {
|
|
31
|
+
entity,
|
|
32
|
+
expected,
|
|
33
|
+
actual: body.meta.type
|
|
34
|
+
}));
|
|
35
|
+
}
|
|
36
|
+
return Effect.succeed(body);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Narrows an arbitrary body to an envelope of the expected `meta.type` without
|
|
40
|
+
* requiring an entity constructor — for `command`/`transactionRecord` messages
|
|
41
|
+
* whose `data` is not a serialized entity. `label` only sharpens error text.
|
|
42
|
+
*/ export function readEnvelope(body, expected, label = 'message') {
|
|
43
|
+
if (!isEntifixEnvelope(body)) {
|
|
44
|
+
return Effect.fail(new EntifixBuildError(`Expected an EntifixEnvelope for "${label}" but the payload carried no meta.type`, undefined, {
|
|
45
|
+
label,
|
|
46
|
+
expected,
|
|
47
|
+
body
|
|
48
|
+
}));
|
|
49
|
+
}
|
|
50
|
+
if (body.meta.type !== expected) {
|
|
51
|
+
return Effect.fail(new EntifixBuildError(`Expected an EntifixEnvelope of type "${expected}" for "${label}" but got "${body.meta.type}"`, undefined, {
|
|
52
|
+
label,
|
|
53
|
+
expected,
|
|
54
|
+
actual: body.meta.type
|
|
55
|
+
}));
|
|
56
|
+
}
|
|
57
|
+
return Effect.succeed(body);
|
|
58
|
+
}
|
|
59
|
+
export const readEntityEnvelope = (entityConstructor, body)=>Effect.gen(function*() {
|
|
60
|
+
const envelope = yield* assertEnvelope(entityConstructor, body, 'entity');
|
|
61
|
+
const entity = yield* deserializeSingleEntity(entityConstructor, envelope.data);
|
|
62
|
+
if (entity === undefined) {
|
|
63
|
+
return yield* Effect.fail(new EntifixBuildError(`EntifixEnvelope for "${envelopeEntityName(entityConstructor)}" carried no data`, undefined, {
|
|
64
|
+
entity: envelopeEntityName(entityConstructor)
|
|
65
|
+
}));
|
|
66
|
+
}
|
|
67
|
+
return entity;
|
|
68
|
+
});
|
|
69
|
+
export const readEntityCollectionEnvelope = (entityConstructor, body)=>Effect.gen(function*() {
|
|
70
|
+
const envelope = yield* assertEnvelope(entityConstructor, body, 'entityCollection');
|
|
71
|
+
const items = yield* deserializeEntityCollection(entityConstructor, envelope.data);
|
|
72
|
+
return items;
|
|
73
|
+
});
|
|
74
|
+
export const readEntityPageEnvelope = (entityConstructor, body)=>Effect.gen(function*() {
|
|
75
|
+
var _ref, _ref1;
|
|
76
|
+
var _envelope_data, _envelope_data1, _envelope_data2;
|
|
77
|
+
const envelope = yield* assertEnvelope(entityConstructor, body, 'entityPage');
|
|
78
|
+
const items = yield* deserializeEntityCollection(entityConstructor, (_envelope_data = envelope.data) == null ? void 0 : _envelope_data.items);
|
|
79
|
+
return {
|
|
80
|
+
items: items,
|
|
81
|
+
total: (_ref = (_envelope_data1 = envelope.data) == null ? void 0 : _envelope_data1.total) != null ? _ref : 0,
|
|
82
|
+
request: (_ref1 = (_envelope_data2 = envelope.data) == null ? void 0 : _envelope_data2.request) != null ? _ref1 : {}
|
|
83
|
+
};
|
|
84
|
+
});
|
|
85
|
+
/**
|
|
86
|
+
* Reads a `$metadata` response back into its document.
|
|
87
|
+
*
|
|
88
|
+
* No deserialization step, and no defaulting of the members either: an envelope
|
|
89
|
+
* whose `data` is missing a list would leave a form guessing whether "no
|
|
90
|
+
* actions" meant "denied" or "malformed", so a broken payload fails loudly here
|
|
91
|
+
* the way a half-populated entity does.
|
|
92
|
+
*/ export const readEntityMetadataEnvelope = (entityConstructor, body)=>Effect.gen(function*() {
|
|
93
|
+
const envelope = yield* assertEnvelope(entityConstructor, body, 'entityMetadata');
|
|
94
|
+
const document = envelope.data;
|
|
95
|
+
if (!Array.isArray(document == null ? void 0 : document.actions) || !Array.isArray(document == null ? void 0 : document.useCases)) {
|
|
96
|
+
return yield* Effect.fail(new EntifixBuildError(`EntifixEnvelope for "${envelopeEntityName(entityConstructor)}" carried no metadata document`, undefined, {
|
|
97
|
+
entity: envelopeEntityName(entityConstructor)
|
|
98
|
+
}));
|
|
99
|
+
}
|
|
100
|
+
return document;
|
|
101
|
+
});
|
|
102
|
+
/** Every member `meta.event` must carry for a message to be routable at all. */ const REQUIRED_EVENT_META = [
|
|
103
|
+
'name',
|
|
104
|
+
'id',
|
|
105
|
+
'source',
|
|
106
|
+
'at'
|
|
107
|
+
];
|
|
108
|
+
/**
|
|
109
|
+
* Reads a bus message back into a {@link DomainEvent}.
|
|
110
|
+
*
|
|
111
|
+
* The metadata is validated rather than defaulted, and that is the point: a
|
|
112
|
+
* message missing `id` cannot be deduplicated and a message missing `name`
|
|
113
|
+
* cannot be routed, so both are failures a consumer must see rather than
|
|
114
|
+
* absences it silently works around. It is the same call
|
|
115
|
+
* {@link readEntityMetadataEnvelope} makes — a broken payload fails loudly
|
|
116
|
+
* instead of arriving half-populated.
|
|
117
|
+
*
|
|
118
|
+
* Note this does not validate `data`. The transport has no idea what a
|
|
119
|
+
* `catalog.published` payload should look like, and inventing an opinion here
|
|
120
|
+
* is how the bus would start knowing about domains.
|
|
121
|
+
*/ export function readEventEnvelope(body) {
|
|
122
|
+
return Effect.gen(function*() {
|
|
123
|
+
const envelope = yield* readEnvelope(body, 'event', 'event');
|
|
124
|
+
const event = envelope.meta.event;
|
|
125
|
+
const missing = REQUIRED_EVENT_META.filter((member)=>typeof (event == null ? void 0 : event[member]) !== 'string' || event[member] === '');
|
|
126
|
+
if (missing.length > 0) {
|
|
127
|
+
return yield* Effect.fail(new EntifixBuildError(`event envelope carried incomplete meta.event (missing ${missing.join(', ')})`, undefined, {
|
|
128
|
+
missing,
|
|
129
|
+
body
|
|
130
|
+
}));
|
|
131
|
+
}
|
|
132
|
+
return _extends({}, event, {
|
|
133
|
+
data: envelope.data
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
//# sourceMappingURL=read-envelope.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/envelope/read-envelope.ts"],"sourcesContent":["import { Effect } from 'effect';\n\nimport { EntifixBuildError } from '../base-entities/entifix-error/index.js';\nimport type { EntityMetadataDocument } from '../entity-definition/metadata/index.js';\nimport {\n deserializeEntityCollection,\n deserializeSingleEntity,\n} from '../entity-definition/serializer/index.js';\nimport type { Entity, EntityConstructor } from '../types/Entity.js';\nimport type { EntityPage } from '../types/EntityPage.js';\nimport { envelopeEntityName } from './make-envelope.js';\nimport type {\n DomainEvent,\n EntifixEnvelope,\n EntifixEnvelopeType,\n EntifixEventMeta,\n SerializedEntityPage,\n} from './types.js';\n\n/**\n * Structural check only — `meta.type` is validated separately so a mismatch\n * reports the expected/actual types rather than a generic \"not an envelope\".\n */\nexport function isEntifixEnvelope(body: unknown): body is EntifixEnvelope {\n if (body == null || typeof body !== 'object') {\n return false;\n }\n const meta = (body as EntifixEnvelope).meta;\n return (\n meta != null && typeof meta === 'object' && typeof meta.type === 'string'\n );\n}\n\n/**\n * Narrows an arbitrary body to an envelope of the expected `meta.type`, failing\n * with an {@link EntifixBuildError} otherwise. A wrong shape must never\n * silently deserialize into a half-populated entity.\n */\nfunction assertEnvelope<TEntity extends Entity, TData>(\n entityConstructor: EntityConstructor<TEntity>,\n body: unknown,\n expected: EntifixEnvelopeType,\n): Effect.Effect<EntifixEnvelope<TData>, EntifixBuildError> {\n const entity = envelopeEntityName(entityConstructor);\n\n if (!isEntifixEnvelope(body)) {\n return Effect.fail(\n new EntifixBuildError(\n `Expected an EntifixEnvelope for \"${entity}\" but the payload carried no meta.type`,\n undefined,\n { entity, expected, body },\n ),\n );\n }\n if (body.meta.type !== expected) {\n return Effect.fail(\n new EntifixBuildError(\n `Expected an EntifixEnvelope of type \"${expected}\" for \"${entity}\" but got \"${body.meta.type}\"`,\n undefined,\n { entity, expected, actual: body.meta.type },\n ),\n );\n }\n return Effect.succeed(body as EntifixEnvelope<TData>);\n}\n\n/**\n * Narrows an arbitrary body to an envelope of the expected `meta.type` without\n * requiring an entity constructor — for `command`/`transactionRecord` messages\n * whose `data` is not a serialized entity. `label` only sharpens error text.\n */\nexport function readEnvelope<TData>(\n body: unknown,\n expected: EntifixEnvelopeType,\n label = 'message',\n): Effect.Effect<EntifixEnvelope<TData>, EntifixBuildError> {\n if (!isEntifixEnvelope(body)) {\n return Effect.fail(\n new EntifixBuildError(\n `Expected an EntifixEnvelope for \"${label}\" but the payload carried no meta.type`,\n undefined,\n { label, expected, body },\n ),\n );\n }\n if (body.meta.type !== expected) {\n return Effect.fail(\n new EntifixBuildError(\n `Expected an EntifixEnvelope of type \"${expected}\" for \"${label}\" but got \"${body.meta.type}\"`,\n undefined,\n { label, expected, actual: body.meta.type },\n ),\n );\n }\n return Effect.succeed(body as EntifixEnvelope<TData>);\n}\n\nexport const readEntityEnvelope = <TEntity extends Entity>(\n entityConstructor: EntityConstructor<TEntity>,\n body: unknown,\n) =>\n Effect.gen(function* () {\n const envelope = yield* assertEnvelope<TEntity, unknown>(\n entityConstructor,\n body,\n 'entity',\n );\n const entity = yield* deserializeSingleEntity(\n entityConstructor,\n envelope.data,\n );\n if (entity === undefined) {\n return yield* Effect.fail(\n new EntifixBuildError(\n `EntifixEnvelope for \"${envelopeEntityName(\n entityConstructor,\n )}\" carried no data`,\n undefined,\n { entity: envelopeEntityName(entityConstructor) },\n ),\n );\n }\n return entity;\n });\n\nexport const readEntityCollectionEnvelope = <TEntity extends Entity>(\n entityConstructor: EntityConstructor<TEntity>,\n body: unknown,\n) =>\n Effect.gen(function* () {\n const envelope = yield* assertEnvelope<TEntity, unknown>(\n entityConstructor,\n body,\n 'entityCollection',\n );\n const items = yield* deserializeEntityCollection(\n entityConstructor,\n envelope.data,\n );\n return items as TEntity[];\n });\n\nexport const readEntityPageEnvelope = <TEntity extends Entity>(\n entityConstructor: EntityConstructor<TEntity>,\n body: unknown,\n) =>\n Effect.gen(function* () {\n const envelope = yield* assertEnvelope<\n TEntity,\n SerializedEntityPage<TEntity>\n >(entityConstructor, body, 'entityPage');\n const items = yield* deserializeEntityCollection(\n entityConstructor,\n envelope.data?.items,\n );\n return {\n items: items as TEntity[],\n total: envelope.data?.total ?? 0,\n request: envelope.data?.request ?? {},\n } satisfies EntityPage<TEntity>;\n });\n\n/**\n * Reads a `$metadata` response back into its document.\n *\n * No deserialization step, and no defaulting of the members either: an envelope\n * whose `data` is missing a list would leave a form guessing whether \"no\n * actions\" meant \"denied\" or \"malformed\", so a broken payload fails loudly here\n * the way a half-populated entity does.\n */\nexport const readEntityMetadataEnvelope = <TEntity extends Entity>(\n entityConstructor: EntityConstructor<TEntity>,\n body: unknown,\n) =>\n Effect.gen(function* () {\n const envelope = yield* assertEnvelope<TEntity, EntityMetadataDocument>(\n entityConstructor,\n body,\n 'entityMetadata',\n );\n const document = envelope.data;\n if (\n !Array.isArray(document?.actions) ||\n !Array.isArray(document?.useCases)\n ) {\n return yield* Effect.fail(\n new EntifixBuildError(\n `EntifixEnvelope for \"${envelopeEntityName(\n entityConstructor,\n )}\" carried no metadata document`,\n undefined,\n { entity: envelopeEntityName(entityConstructor) },\n ),\n );\n }\n return document;\n });\n\n/** Every member `meta.event` must carry for a message to be routable at all. */\nconst REQUIRED_EVENT_META = ['name', 'id', 'source', 'at'] as const;\n\n/**\n * Reads a bus message back into a {@link DomainEvent}.\n *\n * The metadata is validated rather than defaulted, and that is the point: a\n * message missing `id` cannot be deduplicated and a message missing `name`\n * cannot be routed, so both are failures a consumer must see rather than\n * absences it silently works around. It is the same call\n * {@link readEntityMetadataEnvelope} makes — a broken payload fails loudly\n * instead of arriving half-populated.\n *\n * Note this does not validate `data`. The transport has no idea what a\n * `catalog.published` payload should look like, and inventing an opinion here\n * is how the bus would start knowing about domains.\n */\nexport function readEventEnvelope<TData = unknown>(\n body: unknown,\n): Effect.Effect<DomainEvent<TData>, EntifixBuildError> {\n return Effect.gen(function* () {\n const envelope = yield* readEnvelope<TData>(body, 'event', 'event');\n const event = envelope.meta.event;\n const missing = REQUIRED_EVENT_META.filter(\n member => typeof event?.[member] !== 'string' || event[member] === '',\n );\n if (missing.length > 0) {\n return yield* Effect.fail(\n new EntifixBuildError(\n `event envelope carried incomplete meta.event (missing ${missing.join(\n ', ',\n )})`,\n undefined,\n { missing, body },\n ),\n );\n }\n return { ...(event as EntifixEventMeta), data: envelope.data };\n });\n}\n"],"names":["Effect","EntifixBuildError","deserializeEntityCollection","deserializeSingleEntity","envelopeEntityName","isEntifixEnvelope","body","meta","type","assertEnvelope","entityConstructor","expected","entity","fail","undefined","actual","succeed","readEnvelope","label","readEntityEnvelope","gen","envelope","data","readEntityCollectionEnvelope","items","readEntityPageEnvelope","total","request","readEntityMetadataEnvelope","document","Array","isArray","actions","useCases","REQUIRED_EVENT_META","readEventEnvelope","event","missing","filter","member","length","join"],"mappings":";AAAA,SAASA,MAAM,QAAQ,SAAS;AAEhC,SAASC,iBAAiB,QAAQ,0CAA0C;AAE5E,SACEC,2BAA2B,EAC3BC,uBAAuB,QAClB,2CAA2C;AAGlD,SAASC,kBAAkB,QAAQ,qBAAqB;AASxD;;;CAGC,GACD,OAAO,SAASC,kBAAkBC,IAAa;IAC7C,IAAIA,QAAQ,QAAQ,OAAOA,SAAS,UAAU;QAC5C,OAAO;IACT;IACA,MAAMC,OAAO,AAACD,KAAyBC,IAAI;IAC3C,OACEA,QAAQ,QAAQ,OAAOA,SAAS,YAAY,OAAOA,KAAKC,IAAI,KAAK;AAErE;AAEA;;;;CAIC,GACD,SAASC,eACPC,iBAA6C,EAC7CJ,IAAa,EACbK,QAA6B;IAE7B,MAAMC,SAASR,mBAAmBM;IAElC,IAAI,CAACL,kBAAkBC,OAAO;QAC5B,OAAON,OAAOa,IAAI,CAChB,IAAIZ,kBACF,CAAC,iCAAiC,EAAEW,OAAO,sCAAsC,CAAC,EAClFE,WACA;YAAEF;YAAQD;YAAUL;QAAK;IAG/B;IACA,IAAIA,KAAKC,IAAI,CAACC,IAAI,KAAKG,UAAU;QAC/B,OAAOX,OAAOa,IAAI,CAChB,IAAIZ,kBACF,CAAC,qCAAqC,EAAEU,SAAS,OAAO,EAAEC,OAAO,WAAW,EAAEN,KAAKC,IAAI,CAACC,IAAI,CAAC,CAAC,CAAC,EAC/FM,WACA;YAAEF;YAAQD;YAAUI,QAAQT,KAAKC,IAAI,CAACC,IAAI;QAAC;IAGjD;IACA,OAAOR,OAAOgB,OAAO,CAACV;AACxB;AAEA;;;;CAIC,GACD,OAAO,SAASW,aACdX,IAAa,EACbK,QAA6B,EAC7BO,QAAQ,SAAS;IAEjB,IAAI,CAACb,kBAAkBC,OAAO;QAC5B,OAAON,OAAOa,IAAI,CAChB,IAAIZ,kBACF,CAAC,iCAAiC,EAAEiB,MAAM,sCAAsC,CAAC,EACjFJ,WACA;YAAEI;YAAOP;YAAUL;QAAK;IAG9B;IACA,IAAIA,KAAKC,IAAI,CAACC,IAAI,KAAKG,UAAU;QAC/B,OAAOX,OAAOa,IAAI,CAChB,IAAIZ,kBACF,CAAC,qCAAqC,EAAEU,SAAS,OAAO,EAAEO,MAAM,WAAW,EAAEZ,KAAKC,IAAI,CAACC,IAAI,CAAC,CAAC,CAAC,EAC9FM,WACA;YAAEI;YAAOP;YAAUI,QAAQT,KAAKC,IAAI,CAACC,IAAI;QAAC;IAGhD;IACA,OAAOR,OAAOgB,OAAO,CAACV;AACxB;AAEA,OAAO,MAAMa,qBAAqB,CAChCT,mBACAJ,OAEAN,OAAOoB,GAAG,CAAC;QACT,MAAMC,WAAW,OAAOZ,eACtBC,mBACAJ,MACA;QAEF,MAAMM,SAAS,OAAOT,wBACpBO,mBACAW,SAASC,IAAI;QAEf,IAAIV,WAAWE,WAAW;YACxB,OAAO,OAAOd,OAAOa,IAAI,CACvB,IAAIZ,kBACF,CAAC,qBAAqB,EAAEG,mBACtBM,mBACA,iBAAiB,CAAC,EACpBI,WACA;gBAAEF,QAAQR,mBAAmBM;YAAmB;QAGtD;QACA,OAAOE;IACT,GAAG;AAEL,OAAO,MAAMW,+BAA+B,CAC1Cb,mBACAJ,OAEAN,OAAOoB,GAAG,CAAC;QACT,MAAMC,WAAW,OAAOZ,eACtBC,mBACAJ,MACA;QAEF,MAAMkB,QAAQ,OAAOtB,4BACnBQ,mBACAW,SAASC,IAAI;QAEf,OAAOE;IACT,GAAG;AAEL,OAAO,MAAMC,yBAAyB,CACpCf,mBACAJ,OAEAN,OAAOoB,GAAG,CAAC;;YAOPC,gBAIOA,iBACEA;QAXX,MAAMA,WAAW,OAAOZ,eAGtBC,mBAAmBJ,MAAM;QAC3B,MAAMkB,QAAQ,OAAOtB,4BACnBQ,oBACAW,iBAAAA,SAASC,IAAI,qBAAbD,eAAeG,KAAK;QAEtB,OAAO;YACLA,OAAOA;YACPE,KAAK,WAAEL,kBAAAA,SAASC,IAAI,qBAAbD,gBAAeK,KAAK,mBAAI;YAC/BC,OAAO,YAAEN,kBAAAA,SAASC,IAAI,qBAAbD,gBAAeM,OAAO,oBAAI,CAAC;QACtC;IACF,GAAG;AAEL;;;;;;;CAOC,GACD,OAAO,MAAMC,6BAA6B,CACxClB,mBACAJ,OAEAN,OAAOoB,GAAG,CAAC;QACT,MAAMC,WAAW,OAAOZ,eACtBC,mBACAJ,MACA;QAEF,MAAMuB,WAAWR,SAASC,IAAI;QAC9B,IACE,CAACQ,MAAMC,OAAO,CAACF,4BAAAA,SAAUG,OAAO,KAChC,CAACF,MAAMC,OAAO,CAACF,4BAAAA,SAAUI,QAAQ,GACjC;YACA,OAAO,OAAOjC,OAAOa,IAAI,CACvB,IAAIZ,kBACF,CAAC,qBAAqB,EAAEG,mBACtBM,mBACA,8BAA8B,CAAC,EACjCI,WACA;gBAAEF,QAAQR,mBAAmBM;YAAmB;QAGtD;QACA,OAAOmB;IACT,GAAG;AAEL,8EAA8E,GAC9E,MAAMK,sBAAsB;IAAC;IAAQ;IAAM;IAAU;CAAK;AAE1D;;;;;;;;;;;;;CAaC,GACD,OAAO,SAASC,kBACd7B,IAAa;IAEb,OAAON,OAAOoB,GAAG,CAAC;QAChB,MAAMC,WAAW,OAAOJ,aAAoBX,MAAM,SAAS;QAC3D,MAAM8B,QAAQf,SAASd,IAAI,CAAC6B,KAAK;QACjC,MAAMC,UAAUH,oBAAoBI,MAAM,CACxCC,CAAAA,SAAU,QAAOH,yBAAAA,KAAO,CAACG,OAAO,MAAK,YAAYH,KAAK,CAACG,OAAO,KAAK;QAErE,IAAIF,QAAQG,MAAM,GAAG,GAAG;YACtB,OAAO,OAAOxC,OAAOa,IAAI,CACvB,IAAIZ,kBACF,CAAC,sDAAsD,EAAEoC,QAAQI,IAAI,CACnE,MACA,CAAC,CAAC,EACJ3B,WACA;gBAAEuB;gBAAS/B;YAAK;QAGtB;QACA,OAAO,aAAM8B;YAA4Bd,MAAMD,SAASC,IAAI;;IAC9D;AACF"}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import type { EntityMetadataDocument } from '../entity-definition/metadata/index.js';
|
|
2
|
+
import type { SerializedEntity } from '../entity-definition/serializer/index.js';
|
|
3
|
+
import type { Entity, EntityId } from '../types/Entity.js';
|
|
4
|
+
import type { EntityLoadRequest } from '../types/EntityLoadRequest.js';
|
|
5
|
+
/**
|
|
6
|
+
* Discriminates what {@link EntifixEnvelope.data} carries.
|
|
7
|
+
*
|
|
8
|
+
* `command` extends the contract for the transactions layer: a write is issued
|
|
9
|
+
* as a `command`, whose `data` shape lives in `@entifix/transactions` —
|
|
10
|
+
* core only owns the discriminant so every artifact agrees on it.
|
|
11
|
+
*
|
|
12
|
+
* `event` is what actually rides the bus, and it is deliberately not named
|
|
13
|
+
* after one publisher's flow: once a message can be `catalog.published` as
|
|
14
|
+
* easily as `transaction.completed`, `transactionEvent` would be the wrong
|
|
15
|
+
* name for it.
|
|
16
|
+
*
|
|
17
|
+
* ⚠️ **The four transaction-shaped discriminants below are four because they
|
|
18
|
+
* carry four shapes.** `transactionEvent` used to mean all of them, and a
|
|
19
|
+
* discriminant that means several things asserts nothing when it is read —
|
|
20
|
+
* which is what `readTransactionEventEnvelope` was doing on the `202`: checking
|
|
21
|
+
* a name that the record route and the event type both also answered to
|
|
22
|
+
* ([ADR 0055](../../../../../../docs/adr/0055-a-coordinator-resumes-from-its-own-record.md),
|
|
23
|
+
* #176).
|
|
24
|
+
*
|
|
25
|
+
* - `transactionAccepted` — the `202` accept body, `{ transactionId, state }`.
|
|
26
|
+
* Not a record: it has no `createdAt` and names no entity id yet.
|
|
27
|
+
* - `transactionRecord` — the fold a client polls, a `TransactionRecord`.
|
|
28
|
+
* - `sagaResult` — how a settled multi-step walk ended: which steps ran and
|
|
29
|
+
* what each returned ([ADR 0052](../../../../../../docs/adr/0052-the-checkout-saga.md)).
|
|
30
|
+
* - `sagaInstance` — the durable instance itself, which is what a resumable
|
|
31
|
+
* coordinator reads and what `GET /api/saga/:id` serves. It differs from
|
|
32
|
+
* `sagaResult` in carrying the inputs and the resume count, because those are
|
|
33
|
+
* what an operator needs to answer *why is this one still here*.
|
|
34
|
+
*
|
|
35
|
+
* `entityMetadata` is the same extension made once more, for the action model:
|
|
36
|
+
* its `data` is an {@link EntityMetadataDocument}, which core does own because
|
|
37
|
+
* both the service that computes it and the controls that render it are already
|
|
38
|
+
* below the layer that would otherwise host it.
|
|
39
|
+
*/
|
|
40
|
+
export type EntifixEnvelopeType = 'entity' | 'entityCollection' | 'entityPage' | 'command' | 'event' | 'transactionAccepted' | 'transactionRecord' | 'sagaResult' | 'sagaInstance' | 'entityMetadata';
|
|
41
|
+
export type EntifixEnvelopeMethod = 'GET' | 'POST' | 'PUT' | 'DELETE';
|
|
42
|
+
/**
|
|
43
|
+
* A HATEOAS affordance: where the peer can go next from this message. Optional —
|
|
44
|
+
* the envelope stands on its own without links, and only the artifact that owns
|
|
45
|
+
* a route surface (today the REST service) is able to fill them in.
|
|
46
|
+
*/
|
|
47
|
+
export interface EntifixEnvelopeLink {
|
|
48
|
+
rel: string;
|
|
49
|
+
href: string;
|
|
50
|
+
method?: EntifixEnvelopeMethod;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* The facts a message carries about *itself*, as opposed to about what
|
|
54
|
+
* happened. Present only when the envelope is a bus message.
|
|
55
|
+
*
|
|
56
|
+
* The split rule: `meta` describes the message, `data` describes the
|
|
57
|
+
* occurrence. So `correlationId` belongs here and an outcome's `code` does not.
|
|
58
|
+
*
|
|
59
|
+
* **`source` is never a consumer branch.** It is there for routing,
|
|
60
|
+
* observability and audit. A handler that behaves differently depending on who
|
|
61
|
+
* published re-couples the two services the bus decoupled — which is why .NET's
|
|
62
|
+
* canonical `(sender, eventArgs)` types its sender as bare `object`, making the
|
|
63
|
+
* dependency awkward on purpose. TypeScript cannot reproduce that friction, so
|
|
64
|
+
* here it is a rule rather than a type.
|
|
65
|
+
*/
|
|
66
|
+
export interface EntifixEventMeta {
|
|
67
|
+
/**
|
|
68
|
+
* What happened, in the register's vocabulary: `catalog.published`,
|
|
69
|
+
* `transaction.completed`. Declared in `tools/slices/*.slice.ts` as
|
|
70
|
+
* `publishedEvents`/`subscriptions`, and used verbatim as the AMQP routing
|
|
71
|
+
* key — which is what makes a subscriber's declared interest and its actual
|
|
72
|
+
* queue binding the same string.
|
|
73
|
+
*/
|
|
74
|
+
name: string;
|
|
75
|
+
/**
|
|
76
|
+
* Unique per message, and **the** deduplication key. Delivery is
|
|
77
|
+
* at-least-once, so a consumer that must not fold twice keys on this.
|
|
78
|
+
*
|
|
79
|
+
* Not `correlationId`: one flow emits several messages, so correlating and
|
|
80
|
+
* deduplicating are different questions. Keying dedup on the correlation id
|
|
81
|
+
* makes a transaction's `completed` look like a duplicate of its `accepted`.
|
|
82
|
+
*/
|
|
83
|
+
id: string;
|
|
84
|
+
/** The emitting **slice** (ADR 0020's ownership noun), e.g. `marketplace-admin`. */
|
|
85
|
+
source: string;
|
|
86
|
+
/** ISO-8601 emission time. */
|
|
87
|
+
at: string;
|
|
88
|
+
/** Ties every message of one flow together — a transaction id, a saga id. */
|
|
89
|
+
correlationId?: string;
|
|
90
|
+
}
|
|
91
|
+
export interface EntifixEnvelopeMeta {
|
|
92
|
+
type: EntifixEnvelopeType;
|
|
93
|
+
/**
|
|
94
|
+
* The target entity's `key` (falling back to its class name).
|
|
95
|
+
*
|
|
96
|
+
* Optional, because a bus message need not be about an entity at all —
|
|
97
|
+
* `settlement.run.completed` is about a run. What a message *is* lives in
|
|
98
|
+
* {@link EntifixEventMeta.name}; this stays the entity label the HTTP arm
|
|
99
|
+
* routes on.
|
|
100
|
+
*/
|
|
101
|
+
entity?: string;
|
|
102
|
+
links?: EntifixEnvelopeLink[];
|
|
103
|
+
/** Present only on a bus message. */
|
|
104
|
+
event?: EntifixEventMeta;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* One message on the bus: its own metadata, plus the payload describing what
|
|
108
|
+
* happened.
|
|
109
|
+
*
|
|
110
|
+
* Generic in the payload so a publisher keeps its own shape —
|
|
111
|
+
* `DomainEvent<TransactionEvent>` today, `DomainEvent<PublishedOffering>` when
|
|
112
|
+
* ADR 0009's projection event lands — without the transport learning either.
|
|
113
|
+
*/
|
|
114
|
+
export interface DomainEvent<TData = unknown> extends EntifixEventMeta {
|
|
115
|
+
data: TData;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* A change to an entity that happened on the server, delivered out-of-band —
|
|
119
|
+
* the `data` of a bus/stream `event` envelope rather than a framing of its own
|
|
120
|
+
* (ADR 0036). `entity` is the `key ?? name` an adapter routes on, the same
|
|
121
|
+
* string `entityQueryScope` uses, so a subscriber can invalidate exactly the
|
|
122
|
+
* affected query keys.
|
|
123
|
+
*
|
|
124
|
+
* It lives in core rather than beside the React `ReactiveChannel` that consumes
|
|
125
|
+
* it because both ends need it: the service maps a `TransactionEvent` onto it,
|
|
126
|
+
* and `entifix:react` sits above every layer that does the mapping.
|
|
127
|
+
*
|
|
128
|
+
* Deliberately **no** `transactionId`, timestamp or sequence: all three already
|
|
129
|
+
* exist one level up as `meta.event.correlationId`, `.at` and `.id`, and
|
|
130
|
+
* duplicating them onto the payload is how two sources of the same fact drift.
|
|
131
|
+
*/
|
|
132
|
+
export interface EntityChangeEvent {
|
|
133
|
+
entity: string;
|
|
134
|
+
change: 'created' | 'updated' | 'deleted';
|
|
135
|
+
id: EntityId;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* The standard message exchanged between entifix artifacts.
|
|
139
|
+
*
|
|
140
|
+
* Every request and response body is an envelope: `meta` describes the payload,
|
|
141
|
+
* `data` is the payload. It is deliberately transport-free — it lives in `core`
|
|
142
|
+
* and knows nothing about HTTP — so the same contract can carry entities over
|
|
143
|
+
* REST today and amqp or websockets later.
|
|
144
|
+
*/
|
|
145
|
+
export interface EntifixEnvelope<TData = unknown> {
|
|
146
|
+
meta: EntifixEnvelopeMeta;
|
|
147
|
+
data: TData;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* `data` shape when `meta.type` is `entityPage`. Generic in the entity so the
|
|
151
|
+
* echoed `request` keeps its `keyof TEntity` filter/sort types — `EntityLoadRequest`
|
|
152
|
+
* is invariant in its entity, so a non-generic `EntityLoadRequest<Entity>` here
|
|
153
|
+
* would not accept a caller's `EntityLoadRequest<Product>`.
|
|
154
|
+
*/
|
|
155
|
+
export interface SerializedEntityPage<TEntity extends Entity = Entity> {
|
|
156
|
+
items: SerializedEntity[];
|
|
157
|
+
total: number;
|
|
158
|
+
request?: EntityLoadRequest<TEntity>;
|
|
159
|
+
}
|
|
160
|
+
export type EntityEnvelope = EntifixEnvelope<SerializedEntity>;
|
|
161
|
+
export type EntityCollectionEnvelope = EntifixEnvelope<SerializedEntity[]>;
|
|
162
|
+
export type EntityPageEnvelope<TEntity extends Entity = Entity> = EntifixEnvelope<SerializedEntityPage<TEntity>>;
|
|
163
|
+
export type EntityMetadataEnvelope = EntifixEnvelope<EntityMetadataDocument>;
|
|
164
|
+
/**
|
|
165
|
+
* A bus message on the wire. `meta.event` is always populated, and
|
|
166
|
+
* `readEventEnvelope` is what proves it before a consumer sees the payload.
|
|
167
|
+
*/
|
|
168
|
+
export type EventEnvelope<TData = unknown> = EntifixEnvelope<TData> & {
|
|
169
|
+
meta: EntifixEnvelopeMeta & {
|
|
170
|
+
event: EntifixEventMeta;
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/envelope/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AACrF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAEvE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM,MAAM,mBAAmB,GAC3B,QAAQ,GACR,kBAAkB,GAClB,YAAY,GACZ,SAAS,GACT,OAAO,GACP,qBAAqB,GACrB,mBAAmB,GACnB,YAAY,GACZ,cAAc,GACd,gBAAgB,CAAC;AAErB,MAAM,MAAM,qBAAqB,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,CAAC;AAEtE;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,qBAAqB,CAAC;CAChC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;;;OAMG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;;;;;OAOG;IACH,EAAE,EAAE,MAAM,CAAC;IACX,oFAAoF;IACpF,MAAM,EAAE,MAAM,CAAC;IACf,8BAA8B;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,6EAA6E;IAC7E,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,mBAAmB,CAAC;IAC1B;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAC9B,qCAAqC;IACrC,KAAK,CAAC,EAAE,gBAAgB,CAAC;CAC1B;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,WAAW,CAAC,KAAK,GAAG,OAAO,CAAE,SAAQ,gBAAgB;IACpE,IAAI,EAAE,KAAK,CAAC;CACb;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC;IAC1C,EAAE,EAAE,QAAQ,CAAC;CACd;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,eAAe,CAAC,KAAK,GAAG,OAAO;IAC9C,IAAI,EAAE,mBAAmB,CAAC;IAC1B,IAAI,EAAE,KAAK,CAAC;CACb;AAED;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB,CAAC,OAAO,SAAS,MAAM,GAAG,MAAM;IACnE,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,iBAAiB,CAAC,OAAO,CAAC,CAAC;CACtC;AAED,MAAM,MAAM,cAAc,GAAG,eAAe,CAAC,gBAAgB,CAAC,CAAC;AAC/D,MAAM,MAAM,wBAAwB,GAAG,eAAe,CAAC,gBAAgB,EAAE,CAAC,CAAC;AAC3E,MAAM,MAAM,kBAAkB,CAAC,OAAO,SAAS,MAAM,GAAG,MAAM,IAC5D,eAAe,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC,CAAC;AACjD,MAAM,MAAM,sBAAsB,GAAG,eAAe,CAAC,sBAAsB,CAAC,CAAC;AAE7E;;;GAGG;AACH,MAAM,MAAM,aAAa,CAAC,KAAK,GAAG,OAAO,IAAI,eAAe,CAAC,KAAK,CAAC,GAAG;IACpE,IAAI,EAAE,mBAAmB,GAAG;QAAE,KAAK,EAAE,gBAAgB,CAAA;KAAE,CAAC;CACzD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/envelope/types.ts"],"sourcesContent":["import type { EntityMetadataDocument } from '../entity-definition/metadata/index.js';\nimport type { SerializedEntity } from '../entity-definition/serializer/index.js';\nimport type { Entity, EntityId } from '../types/Entity.js';\nimport type { EntityLoadRequest } from '../types/EntityLoadRequest.js';\n\n/**\n * Discriminates what {@link EntifixEnvelope.data} carries.\n *\n * `command` extends the contract for the transactions layer: a write is issued\n * as a `command`, whose `data` shape lives in `@entifix/transactions` —\n * core only owns the discriminant so every artifact agrees on it.\n *\n * `event` is what actually rides the bus, and it is deliberately not named\n * after one publisher's flow: once a message can be `catalog.published` as\n * easily as `transaction.completed`, `transactionEvent` would be the wrong\n * name for it.\n *\n * ⚠️ **The four transaction-shaped discriminants below are four because they\n * carry four shapes.** `transactionEvent` used to mean all of them, and a\n * discriminant that means several things asserts nothing when it is read —\n * which is what `readTransactionEventEnvelope` was doing on the `202`: checking\n * a name that the record route and the event type both also answered to\n * ([ADR 0055](../../../../../../docs/adr/0055-a-coordinator-resumes-from-its-own-record.md),\n * #176).\n *\n * - `transactionAccepted` — the `202` accept body, `{ transactionId, state }`.\n * Not a record: it has no `createdAt` and names no entity id yet.\n * - `transactionRecord` — the fold a client polls, a `TransactionRecord`.\n * - `sagaResult` — how a settled multi-step walk ended: which steps ran and\n * what each returned ([ADR 0052](../../../../../../docs/adr/0052-the-checkout-saga.md)).\n * - `sagaInstance` — the durable instance itself, which is what a resumable\n * coordinator reads and what `GET /api/saga/:id` serves. It differs from\n * `sagaResult` in carrying the inputs and the resume count, because those are\n * what an operator needs to answer *why is this one still here*.\n *\n * `entityMetadata` is the same extension made once more, for the action model:\n * its `data` is an {@link EntityMetadataDocument}, which core does own because\n * both the service that computes it and the controls that render it are already\n * below the layer that would otherwise host it.\n */\nexport type EntifixEnvelopeType =\n | 'entity'\n | 'entityCollection'\n | 'entityPage'\n | 'command'\n | 'event'\n | 'transactionAccepted'\n | 'transactionRecord'\n | 'sagaResult'\n | 'sagaInstance'\n | 'entityMetadata';\n\nexport type EntifixEnvelopeMethod = 'GET' | 'POST' | 'PUT' | 'DELETE';\n\n/**\n * A HATEOAS affordance: where the peer can go next from this message. Optional —\n * the envelope stands on its own without links, and only the artifact that owns\n * a route surface (today the REST service) is able to fill them in.\n */\nexport interface EntifixEnvelopeLink {\n rel: string;\n href: string;\n method?: EntifixEnvelopeMethod;\n}\n\n/**\n * The facts a message carries about *itself*, as opposed to about what\n * happened. Present only when the envelope is a bus message.\n *\n * The split rule: `meta` describes the message, `data` describes the\n * occurrence. So `correlationId` belongs here and an outcome's `code` does not.\n *\n * **`source` is never a consumer branch.** It is there for routing,\n * observability and audit. A handler that behaves differently depending on who\n * published re-couples the two services the bus decoupled — which is why .NET's\n * canonical `(sender, eventArgs)` types its sender as bare `object`, making the\n * dependency awkward on purpose. TypeScript cannot reproduce that friction, so\n * here it is a rule rather than a type.\n */\nexport interface EntifixEventMeta {\n /**\n * What happened, in the register's vocabulary: `catalog.published`,\n * `transaction.completed`. Declared in `tools/slices/*.slice.ts` as\n * `publishedEvents`/`subscriptions`, and used verbatim as the AMQP routing\n * key — which is what makes a subscriber's declared interest and its actual\n * queue binding the same string.\n */\n name: string;\n /**\n * Unique per message, and **the** deduplication key. Delivery is\n * at-least-once, so a consumer that must not fold twice keys on this.\n *\n * Not `correlationId`: one flow emits several messages, so correlating and\n * deduplicating are different questions. Keying dedup on the correlation id\n * makes a transaction's `completed` look like a duplicate of its `accepted`.\n */\n id: string;\n /** The emitting **slice** (ADR 0020's ownership noun), e.g. `marketplace-admin`. */\n source: string;\n /** ISO-8601 emission time. */\n at: string;\n /** Ties every message of one flow together — a transaction id, a saga id. */\n correlationId?: string;\n}\n\nexport interface EntifixEnvelopeMeta {\n type: EntifixEnvelopeType;\n /**\n * The target entity's `key` (falling back to its class name).\n *\n * Optional, because a bus message need not be about an entity at all —\n * `settlement.run.completed` is about a run. What a message *is* lives in\n * {@link EntifixEventMeta.name}; this stays the entity label the HTTP arm\n * routes on.\n */\n entity?: string;\n links?: EntifixEnvelopeLink[];\n /** Present only on a bus message. */\n event?: EntifixEventMeta;\n}\n\n/**\n * One message on the bus: its own metadata, plus the payload describing what\n * happened.\n *\n * Generic in the payload so a publisher keeps its own shape —\n * `DomainEvent<TransactionEvent>` today, `DomainEvent<PublishedOffering>` when\n * ADR 0009's projection event lands — without the transport learning either.\n */\nexport interface DomainEvent<TData = unknown> extends EntifixEventMeta {\n data: TData;\n}\n\n/**\n * A change to an entity that happened on the server, delivered out-of-band —\n * the `data` of a bus/stream `event` envelope rather than a framing of its own\n * (ADR 0036). `entity` is the `key ?? name` an adapter routes on, the same\n * string `entityQueryScope` uses, so a subscriber can invalidate exactly the\n * affected query keys.\n *\n * It lives in core rather than beside the React `ReactiveChannel` that consumes\n * it because both ends need it: the service maps a `TransactionEvent` onto it,\n * and `entifix:react` sits above every layer that does the mapping.\n *\n * Deliberately **no** `transactionId`, timestamp or sequence: all three already\n * exist one level up as `meta.event.correlationId`, `.at` and `.id`, and\n * duplicating them onto the payload is how two sources of the same fact drift.\n */\nexport interface EntityChangeEvent {\n entity: string;\n change: 'created' | 'updated' | 'deleted';\n id: EntityId;\n}\n\n/**\n * The standard message exchanged between entifix artifacts.\n *\n * Every request and response body is an envelope: `meta` describes the payload,\n * `data` is the payload. It is deliberately transport-free — it lives in `core`\n * and knows nothing about HTTP — so the same contract can carry entities over\n * REST today and amqp or websockets later.\n */\nexport interface EntifixEnvelope<TData = unknown> {\n meta: EntifixEnvelopeMeta;\n data: TData;\n}\n\n/**\n * `data` shape when `meta.type` is `entityPage`. Generic in the entity so the\n * echoed `request` keeps its `keyof TEntity` filter/sort types — `EntityLoadRequest`\n * is invariant in its entity, so a non-generic `EntityLoadRequest<Entity>` here\n * would not accept a caller's `EntityLoadRequest<Product>`.\n */\nexport interface SerializedEntityPage<TEntity extends Entity = Entity> {\n items: SerializedEntity[];\n total: number;\n request?: EntityLoadRequest<TEntity>;\n}\n\nexport type EntityEnvelope = EntifixEnvelope<SerializedEntity>;\nexport type EntityCollectionEnvelope = EntifixEnvelope<SerializedEntity[]>;\nexport type EntityPageEnvelope<TEntity extends Entity = Entity> =\n EntifixEnvelope<SerializedEntityPage<TEntity>>;\nexport type EntityMetadataEnvelope = EntifixEnvelope<EntityMetadataDocument>;\n\n/**\n * A bus message on the wire. `meta.event` is always populated, and\n * `readEventEnvelope` is what proves it before a consumer sees the payload.\n */\nexport type EventEnvelope<TData = unknown> = EntifixEnvelope<TData> & {\n meta: EntifixEnvelopeMeta & { event: EntifixEventMeta };\n};\n"],"names":[],"mappings":"AAyLA;;;CAGC,GACD,WAEE"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The names of the cookies an entifix application's session travels in.
|
|
3
|
+
*
|
|
4
|
+
* ⚠️ **Constants in one place, deliberately not a runtime option.** Three
|
|
5
|
+
* packages read or write these — the Effect service shell verifies the access
|
|
6
|
+
* token, the Next shell sets and clears all three, and the Playwright helpers
|
|
7
|
+
* seed them — and a Next application runs its middleware, its server and its
|
|
8
|
+
* client as separate bundles, each with its own module state. A prefix a host
|
|
9
|
+
* configured in one bundle would never reach the others: the middleware would
|
|
10
|
+
* look for one name while a route wrote another, and the only symptom is being
|
|
11
|
+
* signed out. So the names are fixed and shared, and every reader imports them
|
|
12
|
+
* from here instead of re-declaring a literal — which is how r10c had five
|
|
13
|
+
* separate copies of `r10c_at` that nothing kept in step
|
|
14
|
+
* ([ADR 0059](../../../../../../docs/adr/0059-entifix-leaves-the-repo.md)).
|
|
15
|
+
*
|
|
16
|
+
* Host-scoped in dev, where localhost shares cookies across ports, so every app
|
|
17
|
+
* and service in a local fleet reads the same session.
|
|
18
|
+
*/
|
|
19
|
+
/** Short-lived signed access token the services verify. httpOnly. */
|
|
20
|
+
export declare const ACCESS_COOKIE = "entifix_at";
|
|
21
|
+
/** Opaque session id — the revocation handle and the refresh source. httpOnly. */
|
|
22
|
+
export declare const SESSION_COOKIE = "entifix_sid";
|
|
23
|
+
/** Long-lived, opaque device id. Cleared with cookies — that is intended. */
|
|
24
|
+
export declare const DEVICE_COOKIE = "entifix_did";
|
|
25
|
+
//# sourceMappingURL=session-cookies.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-cookies.d.ts","sourceRoot":"","sources":["../../src/http/session-cookies.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,qEAAqE;AACrE,eAAO,MAAM,aAAa,eAAe,CAAC;AAE1C,kFAAkF;AAClF,eAAO,MAAM,cAAc,gBAAgB,CAAC;AAE5C,6EAA6E;AAC7E,eAAO,MAAM,aAAa,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The names of the cookies an entifix application's session travels in.
|
|
3
|
+
*
|
|
4
|
+
* ⚠️ **Constants in one place, deliberately not a runtime option.** Three
|
|
5
|
+
* packages read or write these — the Effect service shell verifies the access
|
|
6
|
+
* token, the Next shell sets and clears all three, and the Playwright helpers
|
|
7
|
+
* seed them — and a Next application runs its middleware, its server and its
|
|
8
|
+
* client as separate bundles, each with its own module state. A prefix a host
|
|
9
|
+
* configured in one bundle would never reach the others: the middleware would
|
|
10
|
+
* look for one name while a route wrote another, and the only symptom is being
|
|
11
|
+
* signed out. So the names are fixed and shared, and every reader imports them
|
|
12
|
+
* from here instead of re-declaring a literal — which is how r10c had five
|
|
13
|
+
* separate copies of `r10c_at` that nothing kept in step
|
|
14
|
+
* ([ADR 0059](../../../../../../docs/adr/0059-entifix-leaves-the-repo.md)).
|
|
15
|
+
*
|
|
16
|
+
* Host-scoped in dev, where localhost shares cookies across ports, so every app
|
|
17
|
+
* and service in a local fleet reads the same session.
|
|
18
|
+
*/ /** Short-lived signed access token the services verify. httpOnly. */ export const ACCESS_COOKIE = 'entifix_at';
|
|
19
|
+
/** Opaque session id — the revocation handle and the refresh source. httpOnly. */ export const SESSION_COOKIE = 'entifix_sid';
|
|
20
|
+
/** Long-lived, opaque device id. Cleared with cookies — that is intended. */ export const DEVICE_COOKIE = 'entifix_did';
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=session-cookies.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/http/session-cookies.ts"],"sourcesContent":["/**\n * The names of the cookies an entifix application's session travels in.\n *\n * ⚠️ **Constants in one place, deliberately not a runtime option.** Three\n * packages read or write these — the Effect service shell verifies the access\n * token, the Next shell sets and clears all three, and the Playwright helpers\n * seed them — and a Next application runs its middleware, its server and its\n * client as separate bundles, each with its own module state. A prefix a host\n * configured in one bundle would never reach the others: the middleware would\n * look for one name while a route wrote another, and the only symptom is being\n * signed out. So the names are fixed and shared, and every reader imports them\n * from here instead of re-declaring a literal — which is how r10c had five\n * separate copies of `r10c_at` that nothing kept in step\n * ([ADR 0059](../../../../../../docs/adr/0059-entifix-leaves-the-repo.md)).\n *\n * Host-scoped in dev, where localhost shares cookies across ports, so every app\n * and service in a local fleet reads the same session.\n */\n\n/** Short-lived signed access token the services verify. httpOnly. */\nexport const ACCESS_COOKIE = 'entifix_at';\n\n/** Opaque session id — the revocation handle and the refresh source. httpOnly. */\nexport const SESSION_COOKIE = 'entifix_sid';\n\n/** Long-lived, opaque device id. Cleared with cookies — that is intended. */\nexport const DEVICE_COOKIE = 'entifix_did';\n"],"names":["ACCESS_COOKIE","SESSION_COOKIE","DEVICE_COOKIE"],"mappings":"AAAA;;;;;;;;;;;;;;;;;CAiBC,GAED,mEAAmE,GACnE,OAAO,MAAMA,gBAAgB,aAAa;AAE1C,gFAAgF,GAChF,OAAO,MAAMC,iBAAiB,cAAc;AAE5C,2EAA2E,GAC3E,OAAO,MAAMC,gBAAgB,cAAc"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Locale } from './locales.js';
|
|
2
|
+
export interface Formatters {
|
|
3
|
+
/** Calendar date only. */
|
|
4
|
+
date(value: Date | string | number): string;
|
|
5
|
+
/** Date plus wall-clock time. */
|
|
6
|
+
dateTime(value: Date | string | number): string;
|
|
7
|
+
number(value: number, options?: Intl.NumberFormatOptions): string;
|
|
8
|
+
currency(value: number, currency: string): string;
|
|
9
|
+
relative(value: number, unit: Intl.RelativeTimeFormatUnit): string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Locale-aware formatting, memoized per locale because constructing an `Intl.*`
|
|
13
|
+
* formatter is expensive and these run once per table cell.
|
|
14
|
+
*
|
|
15
|
+
* This exists to kill an argument-less `toLocaleString()`, which resolves against
|
|
16
|
+
* the *runtime's* default locale — Node's on the server, the visitor's in the
|
|
17
|
+
* browser. Those disagree, so the same cell rendered twice produced two strings
|
|
18
|
+
* and React reported a hydration mismatch. Passing the negotiated locale
|
|
19
|
+
* explicitly makes both halves agree by construction.
|
|
20
|
+
*/
|
|
21
|
+
export declare function makeFormatters(locale: Locale): Formatters;
|
|
22
|
+
//# sourceMappingURL=format.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/i18n/format.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C,MAAM,WAAW,UAAU;IACzB,0BAA0B;IAC1B,IAAI,CAAC,KAAK,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IAC5C,iCAAiC;IACjC,QAAQ,CAAC,KAAK,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IAChD,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,mBAAmB,GAAG,MAAM,CAAC;IAClE,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;IAClD,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,sBAAsB,GAAG,MAAM,CAAC;CACpE;AAUD;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAoCzD"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/** `undefined` for an unparseable input, so callers can fall back to the raw value. */ function toDate(value) {
|
|
2
|
+
const date = value instanceof Date ? value : new Date(value);
|
|
3
|
+
return Number.isNaN(date.getTime()) ? undefined : date;
|
|
4
|
+
}
|
|
5
|
+
const cache = new Map();
|
|
6
|
+
/**
|
|
7
|
+
* Locale-aware formatting, memoized per locale because constructing an `Intl.*`
|
|
8
|
+
* formatter is expensive and these run once per table cell.
|
|
9
|
+
*
|
|
10
|
+
* This exists to kill an argument-less `toLocaleString()`, which resolves against
|
|
11
|
+
* the *runtime's* default locale — Node's on the server, the visitor's in the
|
|
12
|
+
* browser. Those disagree, so the same cell rendered twice produced two strings
|
|
13
|
+
* and React reported a hydration mismatch. Passing the negotiated locale
|
|
14
|
+
* explicitly makes both halves agree by construction.
|
|
15
|
+
*/ export function makeFormatters(locale) {
|
|
16
|
+
const cached = cache.get(locale);
|
|
17
|
+
if (cached !== undefined) return cached;
|
|
18
|
+
const dateFormat = new Intl.DateTimeFormat(locale, {
|
|
19
|
+
dateStyle: 'medium'
|
|
20
|
+
});
|
|
21
|
+
const dateTimeFormat = new Intl.DateTimeFormat(locale, {
|
|
22
|
+
dateStyle: 'medium',
|
|
23
|
+
timeStyle: 'short'
|
|
24
|
+
});
|
|
25
|
+
const numberFormat = new Intl.NumberFormat(locale);
|
|
26
|
+
const relativeFormat = new Intl.RelativeTimeFormat(locale, {
|
|
27
|
+
numeric: 'auto'
|
|
28
|
+
});
|
|
29
|
+
const formatters = {
|
|
30
|
+
date: (value)=>{
|
|
31
|
+
const date = toDate(value);
|
|
32
|
+
return date === undefined ? String(value) : dateFormat.format(date);
|
|
33
|
+
},
|
|
34
|
+
dateTime: (value)=>{
|
|
35
|
+
const date = toDate(value);
|
|
36
|
+
return date === undefined ? String(value) : dateTimeFormat.format(date);
|
|
37
|
+
},
|
|
38
|
+
number: (value, options)=>options === undefined ? numberFormat.format(value) : new Intl.NumberFormat(locale, options).format(value),
|
|
39
|
+
currency: (value, currency)=>new Intl.NumberFormat(locale, {
|
|
40
|
+
style: 'currency',
|
|
41
|
+
currency
|
|
42
|
+
}).format(value),
|
|
43
|
+
relative: (value, unit)=>relativeFormat.format(value, unit)
|
|
44
|
+
};
|
|
45
|
+
cache.set(locale, formatters);
|
|
46
|
+
return formatters;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
//# sourceMappingURL=format.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/i18n/format.ts"],"sourcesContent":["import type { Locale } from './locales.js';\n\nexport interface Formatters {\n /** Calendar date only. */\n date(value: Date | string | number): string;\n /** Date plus wall-clock time. */\n dateTime(value: Date | string | number): string;\n number(value: number, options?: Intl.NumberFormatOptions): string;\n currency(value: number, currency: string): string;\n relative(value: number, unit: Intl.RelativeTimeFormatUnit): string;\n}\n\n/** `undefined` for an unparseable input, so callers can fall back to the raw value. */\nfunction toDate(value: Date | string | number): Date | undefined {\n const date = value instanceof Date ? value : new Date(value);\n return Number.isNaN(date.getTime()) ? undefined : date;\n}\n\nconst cache = new Map<Locale, Formatters>();\n\n/**\n * Locale-aware formatting, memoized per locale because constructing an `Intl.*`\n * formatter is expensive and these run once per table cell.\n *\n * This exists to kill an argument-less `toLocaleString()`, which resolves against\n * the *runtime's* default locale — Node's on the server, the visitor's in the\n * browser. Those disagree, so the same cell rendered twice produced two strings\n * and React reported a hydration mismatch. Passing the negotiated locale\n * explicitly makes both halves agree by construction.\n */\nexport function makeFormatters(locale: Locale): Formatters {\n const cached = cache.get(locale);\n if (cached !== undefined) return cached;\n\n const dateFormat = new Intl.DateTimeFormat(locale, { dateStyle: 'medium' });\n const dateTimeFormat = new Intl.DateTimeFormat(locale, {\n dateStyle: 'medium',\n timeStyle: 'short',\n });\n const numberFormat = new Intl.NumberFormat(locale);\n const relativeFormat = new Intl.RelativeTimeFormat(locale, {\n numeric: 'auto',\n });\n\n const formatters: Formatters = {\n date: value => {\n const date = toDate(value);\n return date === undefined ? String(value) : dateFormat.format(date);\n },\n dateTime: value => {\n const date = toDate(value);\n return date === undefined ? String(value) : dateTimeFormat.format(date);\n },\n number: (value, options) =>\n options === undefined\n ? numberFormat.format(value)\n : new Intl.NumberFormat(locale, options).format(value),\n currency: (value, currency) =>\n new Intl.NumberFormat(locale, { style: 'currency', currency }).format(\n value,\n ),\n relative: (value, unit) => relativeFormat.format(value, unit),\n };\n\n cache.set(locale, formatters);\n return formatters;\n}\n"],"names":["toDate","value","date","Date","Number","isNaN","getTime","undefined","cache","Map","makeFormatters","locale","cached","get","dateFormat","Intl","DateTimeFormat","dateStyle","dateTimeFormat","timeStyle","numberFormat","NumberFormat","relativeFormat","RelativeTimeFormat","numeric","formatters","String","format","dateTime","number","options","currency","style","relative","unit","set"],"mappings":"AAYA,qFAAqF,GACrF,SAASA,OAAOC,KAA6B;IAC3C,MAAMC,OAAOD,iBAAiBE,OAAOF,QAAQ,IAAIE,KAAKF;IACtD,OAAOG,OAAOC,KAAK,CAACH,KAAKI,OAAO,MAAMC,YAAYL;AACpD;AAEA,MAAMM,QAAQ,IAAIC;AAElB;;;;;;;;;CASC,GACD,OAAO,SAASC,eAAeC,MAAc;IAC3C,MAAMC,SAASJ,MAAMK,GAAG,CAACF;IACzB,IAAIC,WAAWL,WAAW,OAAOK;IAEjC,MAAME,aAAa,IAAIC,KAAKC,cAAc,CAACL,QAAQ;QAAEM,WAAW;IAAS;IACzE,MAAMC,iBAAiB,IAAIH,KAAKC,cAAc,CAACL,QAAQ;QACrDM,WAAW;QACXE,WAAW;IACb;IACA,MAAMC,eAAe,IAAIL,KAAKM,YAAY,CAACV;IAC3C,MAAMW,iBAAiB,IAAIP,KAAKQ,kBAAkB,CAACZ,QAAQ;QACzDa,SAAS;IACX;IAEA,MAAMC,aAAyB;QAC7BvB,MAAMD,CAAAA;YACJ,MAAMC,OAAOF,OAAOC;YACpB,OAAOC,SAASK,YAAYmB,OAAOzB,SAASa,WAAWa,MAAM,CAACzB;QAChE;QACA0B,UAAU3B,CAAAA;YACR,MAAMC,OAAOF,OAAOC;YACpB,OAAOC,SAASK,YAAYmB,OAAOzB,SAASiB,eAAeS,MAAM,CAACzB;QACpE;QACA2B,QAAQ,CAAC5B,OAAO6B,UACdA,YAAYvB,YACRa,aAAaO,MAAM,CAAC1B,SACpB,IAAIc,KAAKM,YAAY,CAACV,QAAQmB,SAASH,MAAM,CAAC1B;QACpD8B,UAAU,CAAC9B,OAAO8B,WAChB,IAAIhB,KAAKM,YAAY,CAACV,QAAQ;gBAAEqB,OAAO;gBAAYD;YAAS,GAAGJ,MAAM,CACnE1B;QAEJgC,UAAU,CAAChC,OAAOiC,OAASZ,eAAeK,MAAM,CAAC1B,OAAOiC;IAC1D;IAEA1B,MAAM2B,GAAG,CAACxB,QAAQc;IAClB,OAAOA;AACT"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/i18n/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/i18n/index.ts"],"sourcesContent":["export * from './format.js';\nexport * from './locales.js';\nexport * from './negotiate.js';\n"],"names":[],"mappings":"AAAA,cAAc,cAAc;AAC5B,cAAc,eAAe;AAC7B,cAAc,iBAAiB"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The locales the fleet ships. `es` is the default and the fallback: a key that
|
|
3
|
+
* is missing from a catalog resolves against Spanish rather than rendering the
|
|
4
|
+
* raw key, so a half-translated `en` degrades to readable text instead of
|
|
5
|
+
* `controls:table.actions`.
|
|
6
|
+
*/
|
|
7
|
+
export declare const LOCALES: readonly ["es", "en"];
|
|
8
|
+
export type Locale = (typeof LOCALES)[number];
|
|
9
|
+
export declare const DEFAULT_LOCALE: Locale;
|
|
10
|
+
/**
|
|
11
|
+
* Host-scoped so the choice is shared across the fleet's localhost ports in dev,
|
|
12
|
+
* exactly like `entifix_at`/`entifix_sid`. Written by the locale middleware on every
|
|
13
|
+
* redirect, so a visitor who lands on `/en/...` keeps English on the next visit.
|
|
14
|
+
*/
|
|
15
|
+
export declare const LOCALE_COOKIE = "entifix_locale";
|
|
16
|
+
/**
|
|
17
|
+
* Request header the locale middleware sets when it rewrites a prefixed path.
|
|
18
|
+
* Server components read it instead of a route param, which is what lets the
|
|
19
|
+
* route tree stay free of an `app/[locale]` segment.
|
|
20
|
+
*/
|
|
21
|
+
export declare const LOCALE_HEADER = "x-entifix-locale";
|
|
22
|
+
export declare function isLocale(value: unknown): value is Locale;
|
|
23
|
+
//# sourceMappingURL=locales.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"locales.d.ts","sourceRoot":"","sources":["../../src/i18n/locales.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,OAAO,uBAAwB,CAAC;AAE7C,MAAM,MAAM,MAAM,GAAG,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;AAE9C,eAAO,MAAM,cAAc,EAAE,MAAa,CAAC;AAE3C;;;;GAIG;AACH,eAAO,MAAM,aAAa,mBAAmB,CAAC;AAE9C;;;;GAIG;AACH,eAAO,MAAM,aAAa,qBAAqB,CAAC;AAEhD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAIxD"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The locales the fleet ships. `es` is the default and the fallback: a key that
|
|
3
|
+
* is missing from a catalog resolves against Spanish rather than rendering the
|
|
4
|
+
* raw key, so a half-translated `en` degrades to readable text instead of
|
|
5
|
+
* `controls:table.actions`.
|
|
6
|
+
*/ export const LOCALES = [
|
|
7
|
+
'es',
|
|
8
|
+
'en'
|
|
9
|
+
];
|
|
10
|
+
export const DEFAULT_LOCALE = 'es';
|
|
11
|
+
/**
|
|
12
|
+
* Host-scoped so the choice is shared across the fleet's localhost ports in dev,
|
|
13
|
+
* exactly like `entifix_at`/`entifix_sid`. Written by the locale middleware on every
|
|
14
|
+
* redirect, so a visitor who lands on `/en/...` keeps English on the next visit.
|
|
15
|
+
*/ export const LOCALE_COOKIE = 'entifix_locale';
|
|
16
|
+
/**
|
|
17
|
+
* Request header the locale middleware sets when it rewrites a prefixed path.
|
|
18
|
+
* Server components read it instead of a route param, which is what lets the
|
|
19
|
+
* route tree stay free of an `app/[locale]` segment.
|
|
20
|
+
*/ export const LOCALE_HEADER = 'x-entifix-locale';
|
|
21
|
+
export function isLocale(value) {
|
|
22
|
+
return typeof value === 'string' && LOCALES.includes(value);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=locales.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/i18n/locales.ts"],"sourcesContent":["/**\n * The locales the fleet ships. `es` is the default and the fallback: a key that\n * is missing from a catalog resolves against Spanish rather than rendering the\n * raw key, so a half-translated `en` degrades to readable text instead of\n * `controls:table.actions`.\n */\nexport const LOCALES = ['es', 'en'] as const;\n\nexport type Locale = (typeof LOCALES)[number];\n\nexport const DEFAULT_LOCALE: Locale = 'es';\n\n/**\n * Host-scoped so the choice is shared across the fleet's localhost ports in dev,\n * exactly like `entifix_at`/`entifix_sid`. Written by the locale middleware on every\n * redirect, so a visitor who lands on `/en/...` keeps English on the next visit.\n */\nexport const LOCALE_COOKIE = 'entifix_locale';\n\n/**\n * Request header the locale middleware sets when it rewrites a prefixed path.\n * Server components read it instead of a route param, which is what lets the\n * route tree stay free of an `app/[locale]` segment.\n */\nexport const LOCALE_HEADER = 'x-entifix-locale';\n\nexport function isLocale(value: unknown): value is Locale {\n return (\n typeof value === 'string' && (LOCALES as readonly string[]).includes(value)\n );\n}\n"],"names":["LOCALES","DEFAULT_LOCALE","LOCALE_COOKIE","LOCALE_HEADER","isLocale","value","includes"],"mappings":"AAAA;;;;;CAKC,GACD,OAAO,MAAMA,UAAU;IAAC;IAAM;CAAK,CAAU;AAI7C,OAAO,MAAMC,iBAAyB,KAAK;AAE3C;;;;CAIC,GACD,OAAO,MAAMC,gBAAgB,iBAAiB;AAE9C;;;;CAIC,GACD,OAAO,MAAMC,gBAAgB,mBAAmB;AAEhD,OAAO,SAASC,SAASC,KAAc;IACrC,OACE,OAAOA,UAAU,YAAY,AAACL,QAA8BM,QAAQ,CAACD;AAEzE"}
|