@entifix/core 0.5.0 → 0.7.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/dist/command-palette/command-matching.d.ts +1 -1
- package/dist/command-palette/command-matching.js +1 -1
- package/dist/command-palette/command-matching.js.map +1 -1
- package/dist/command-palette/command-source.d.ts +3 -3
- package/dist/command-palette/command-source.js.map +1 -1
- package/dist/entity-definition/decorators/use-case/use-case.d.ts +1 -1
- package/dist/entity-definition/decorators/use-case/use-case.js +1 -1
- package/dist/entity-definition/decorators/use-case/use-case.js.map +1 -1
- package/dist/entity-definition/describe/describe-child-columns.d.ts +1 -1
- package/dist/entity-definition/describe/describe-child-columns.js +1 -1
- package/dist/entity-definition/describe/describe-child-columns.js.map +1 -1
- package/dist/entity-definition/describe/describe-entity-columns.d.ts +24 -0
- package/dist/entity-definition/describe/describe-entity-columns.d.ts.map +1 -1
- package/dist/entity-definition/describe/describe-entity-columns.js +36 -2
- package/dist/entity-definition/describe/describe-entity-columns.js.map +1 -1
- package/dist/entity-definition/describe/describe-entity-use-cases.d.ts +2 -1
- package/dist/entity-definition/describe/describe-entity-use-cases.d.ts.map +1 -1
- package/dist/entity-definition/describe/describe-entity-use-cases.js +2 -1
- package/dist/entity-definition/describe/describe-entity-use-cases.js.map +1 -1
- package/dist/entity-definition/helpers/entity-definition-helpers.d.ts +2 -2
- package/dist/entity-definition/helpers/entity-definition-helpers.js +2 -2
- package/dist/entity-definition/helpers/entity-definition-helpers.js.map +1 -1
- package/dist/entity-definition/meta-entities/meta-accessor/meta-accessor.d.ts +17 -4
- package/dist/entity-definition/meta-entities/meta-accessor/meta-accessor.d.ts.map +1 -1
- package/dist/entity-definition/meta-entities/meta-accessor/meta-accessor.js +1 -0
- package/dist/entity-definition/meta-entities/meta-accessor/meta-accessor.js.map +1 -1
- package/dist/entity-definition/meta-entities/meta-use-case/meta-use-case.d.ts +1 -1
- package/dist/entity-definition/meta-entities/meta-use-case/meta-use-case.js.map +1 -1
- package/dist/entity-definition/reconstruct/clone-entity-draft.d.ts +1 -1
- package/dist/entity-definition/reconstruct/clone-entity-draft.d.ts.map +1 -1
- package/dist/entity-definition/reconstruct/clone-entity-draft.js +5 -2
- package/dist/entity-definition/reconstruct/clone-entity-draft.js.map +1 -1
- package/dist/entity-definition/reconstruct/reconstruct-entity.js +1 -1
- package/dist/entity-definition/reconstruct/reconstruct-entity.js.map +1 -1
- package/dist/envelope/types.d.ts +5 -7
- package/dist/envelope/types.d.ts.map +1 -1
- package/dist/envelope/types.js.map +1 -1
- package/dist/hierarchy/hierarchy.d.ts +77 -0
- package/dist/hierarchy/hierarchy.d.ts.map +1 -0
- package/dist/hierarchy/hierarchy.js +165 -0
- package/dist/hierarchy/hierarchy.js.map +1 -0
- package/dist/hierarchy/index.d.ts +2 -0
- package/dist/hierarchy/index.d.ts.map +1 -0
- package/dist/hierarchy/index.js +3 -0
- package/dist/hierarchy/index.js.map +1 -0
- package/dist/http/session-cookies.d.ts +2 -3
- package/dist/http/session-cookies.d.ts.map +1 -1
- package/dist/http/session-cookies.js +2 -3
- package/dist/http/session-cookies.js.map +1 -1
- package/dist/i18n/locales.js +2 -2
- package/dist/i18n/locales.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/types/BulkOutcome.d.ts +1 -2
- package/dist/types/BulkOutcome.d.ts.map +1 -1
- package/dist/types/BulkOutcome.js.map +1 -1
- package/dist/types/EntityAction.d.ts +1 -2
- package/dist/types/EntityAction.d.ts.map +1 -1
- package/dist/types/EntityAction.js +1 -2
- package/dist/types/EntityAction.js.map +1 -1
- package/dist/types/EntityDraft.d.ts +2 -3
- package/dist/types/EntityDraft.d.ts.map +1 -1
- package/dist/types/EntityDraft.js.map +1 -1
- package/dist/types/EntityRowDraft.d.ts +2 -3
- package/dist/types/EntityRowDraft.d.ts.map +1 -1
- package/dist/types/EntityRowDraft.js +1 -1
- package/dist/types/EntityRowDraft.js.map +1 -1
- package/dist/types/EntitySelection.d.ts +2 -3
- package/dist/types/EntitySelection.d.ts.map +1 -1
- package/dist/types/EntitySelection.js.map +1 -1
- package/dist/wizard/wizard-definition.d.ts +5 -8
- package/dist/wizard/wizard-definition.d.ts.map +1 -1
- package/dist/wizard/wizard-definition.js +3 -5
- package/dist/wizard/wizard-definition.js.map +1 -1
- package/dist/wizard/wizard-state.d.ts +4 -7
- package/dist/wizard/wizard-state.d.ts.map +1 -1
- package/dist/wizard/wizard-state.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wizard-state.d.ts","sourceRoot":"","sources":["../../src/wizard/wizard-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D
|
|
1
|
+
{"version":3,"file":"wizard-state.d.ts","sourceRoot":"","sources":["../../src/wizard/wizard-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,eAAe,GACvB;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAA;CAAE,GACvD;IAAE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,GAC/D;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GACpD;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAE9B;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,KAAK,EAAE;QAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAG,eAAe,CAAA;KAAE,CAAC;CAChE,CAAC;AAEF,0DAA0D;AAC1D,eAAO,MAAM,gBAAgB,GAAI,aAAa,MAAM,KAAG,WAIrD,CAAC;AAEH,oEAAoE;AACpE,eAAO,MAAM,aAAa,GACxB,OAAO,WAAW,EAClB,QAAQ,MAAM,KACb,eAAe,GAAG,SAAgC,CAAC;AAEtD;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,GACxB,OAAO,WAAW,EAClB,QAAQ,MAAM,KACb,WAGF,CAAC;AAEF,+CAA+C;AAC/C,eAAO,MAAM,WAAW,GACtB,OAAO,WAAW,EAClB,QAAQ,MAAM,KACb,SAAS,MAAM,EAGjB,CAAC;AAEF,6EAA6E;AAC7E,eAAO,MAAM,cAAc,GACzB,OAAO,WAAW,EAClB,QAAQ,MAAM,KACb,MAAM,GAAG,SAGX,CAAC;AAEF,gDAAgD;AAChD,eAAO,MAAM,aAAa,GACxB,OAAO,WAAW,EAClB,QAAQ,MAAM,EACd,OAAO,eAAe,KACrB,WAGD,CAAC;AAEH;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,WAAW,GAAG,SAAS,CAiBvE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/wizard/wizard-state.ts"],"sourcesContent":["import type { EntityDraft } from '../types/EntityDraft.js';\n\n/**\n * What one step holds.\n *\n * A wizard's state is **heterogeneous by construction** — a form step drafts\n * strings, a table step holds a set of ids, a branch point holds the option\n * taken — so this is a discriminated union rather than one shape with optional\n * members, which would let a form step carry ids nothing would ever read.\n *\n * ⚠️ A selection holds `readonly string[]`, **never a `ReadonlySet`**. A `Set`\n * serializes to `{}` and does it silently, which is the fault
|
|
1
|
+
{"version":3,"sources":["../../src/wizard/wizard-state.ts"],"sourcesContent":["import type { EntityDraft } from '../types/EntityDraft.js';\n\n/**\n * What one step holds.\n *\n * A wizard's state is **heterogeneous by construction** — a form step drafts\n * strings, a table step holds a set of ids, a branch point holds the option\n * taken — so this is a discriminated union rather than one shape with optional\n * members, which would let a form step carry ids nothing would ever read.\n *\n * ⚠️ A selection holds `readonly string[]`, **never a `ReadonlySet`**. A `Set`\n * serializes to `{}` and does it silently, which is the fault a bulk\n * selection meets on the wire — and a wizard's state goes through `createJSONStorage` on\n * every keystroke, so it would be met far more often here than there.\n */\nexport type WizardStepValue =\n | { readonly kind: 'form'; readonly values: EntityDraft }\n | { readonly kind: 'selection'; readonly ids: readonly string[] }\n | { readonly kind: 'choice'; readonly option: string }\n | { readonly kind: 'none' };\n\n/**\n * A wizard in progress: where the operator is, how they got there, and what\n * they have answered.\n *\n * **A `type`, never an `interface`.** This is persisted through\n * `createJSONStorage` and therefore has to satisfy `JsonValue`, and TypeScript\n * gives an interface no implicit index signature — the resulting \"Index\n * signature for type 'string' is missing\" explains nothing about the real cause.\n *\n * `history` is **the path actually taken**, and it is what Back pops. A branch's\n * inverse is ambiguous once an earlier answer changes, so a computed `previous`\n * would walk the operator back through a path they were never on.\n *\n * `steps` is deliberately **not** pruned when a branch is abandoned. It is the\n * record of what was typed, and {@link wizardPath} decides what counts — so\n * flipping back to an earlier answer restores the work instead of discarding it,\n * while the summary and the submit still read only the steps on the live path.\n */\nexport type WizardState = {\n readonly activeStep: string;\n readonly history: readonly string[];\n readonly steps: { readonly [stepId: string]: WizardStepValue };\n};\n\n/** A wizard that has been opened and not yet answered. */\nexport const emptyWizardState = (entryStepId: string): WizardState => ({\n activeStep: entryStepId,\n history: [],\n steps: {},\n});\n\n/** The value stored for a step, or `undefined` when it has none. */\nexport const readStepValue = (\n state: WizardState,\n stepId: string,\n): WizardStepValue | undefined => state.steps[stepId];\n\n/**\n * The draft a form step holds, or an empty one.\n *\n * The fallback is `{}` rather than `undefined` for the reason every draft read\n * in this repo has one: a form handed `undefined` flips its inputs from\n * controlled to uncontrolled mid-render.\n */\nexport const readStepDraft = (\n state: WizardState,\n stepId: string,\n): EntityDraft => {\n const value = state.steps[stepId];\n return value?.kind === 'form' ? value.values : {};\n};\n\n/** The ids a selection step holds, or none. */\nexport const readStepIds = (\n state: WizardState,\n stepId: string,\n): readonly string[] => {\n const value = state.steps[stepId];\n return value?.kind === 'selection' ? value.ids : [];\n};\n\n/** The option a choice step holds, or `undefined` while it is unanswered. */\nexport const readStepChoice = (\n state: WizardState,\n stepId: string,\n): string | undefined => {\n const value = state.steps[stepId];\n return value?.kind === 'choice' ? value.option : undefined;\n};\n\n/** The state with one step's value replaced. */\nexport const withStepValue = (\n state: WizardState,\n stepId: string,\n value: WizardStepValue,\n): WizardState => ({\n ...state,\n steps: { ...state.steps, [stepId]: value },\n});\n\n/**\n * Narrows a restored value to a usable state.\n *\n * A persisted wizard comes back as `JsonValue`, so it can be anything — written\n * by a build before a step existed, `null`, or the right shape with the wrong\n * contents. Every caller must ask before reading, and the answer for a value\n * that fails is a **fresh** wizard rather than a crash: an unreadable draft is\n * an unfinished edit, and `restoreEntityDraft` already discards those per entry\n * rather than losing the whole form.\n *\n * A step value of an unknown `kind` fails the whole state rather than being\n * dropped, deliberately. Dropping it would resume the operator on a step whose\n * answer had silently vanished, which reads as the wizard having forgotten one\n * page of a flow it otherwise restored perfectly.\n */\nexport function readWizardState(value: unknown): WizardState | undefined {\n if (!isRecord(value)) return undefined;\n\n const { activeStep, history, steps } = value;\n if (typeof activeStep !== 'string' || activeStep === '') return undefined;\n if (!Array.isArray(history)) return undefined;\n if (!history.every(entry => typeof entry === 'string')) return undefined;\n if (!isRecord(steps)) return undefined;\n\n const readSteps: Record<string, WizardStepValue> = {};\n for (const [stepId, stepValue] of Object.entries(steps)) {\n const read = readStepValueOf(stepValue);\n if (read === undefined) return undefined;\n readSteps[stepId] = read;\n }\n\n return { activeStep, history, steps: readSteps };\n}\n\nfunction readStepValueOf(value: unknown): WizardStepValue | undefined {\n if (!isRecord(value)) return undefined;\n\n switch (value.kind) {\n case 'none':\n return { kind: 'none' };\n case 'choice':\n return typeof value.option === 'string'\n ? { kind: 'choice', option: value.option }\n : undefined;\n case 'selection':\n return Array.isArray(value.ids) &&\n value.ids.every(id => typeof id === 'string')\n ? { kind: 'selection', ids: value.ids }\n : undefined;\n case 'form':\n return isDraft(value.values)\n ? { kind: 'form', values: value.values }\n : undefined;\n default:\n return undefined;\n }\n}\n\n/**\n * Whether a restored value is a usable {@link EntityDraft}.\n *\n * The same two shapes `EntityDraft` allows, checked the way `isRowDraftArray`\n * checks its half — a scalar is a string and a composition is a list of row\n * drafts, and anything else means the entry was written by something that does\n * not know the contract.\n */\nfunction isDraft(value: unknown): value is EntityDraft {\n return (\n isRecord(value) &&\n Object.values(value).every(\n member =>\n typeof member === 'string' ||\n (Array.isArray(member) && member.every(isRowOfStrings)),\n )\n );\n}\n\nconst isRowOfStrings = (row: unknown): boolean =>\n isRecord(row) && Object.values(row).every(cell => typeof cell === 'string');\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === 'object' && value !== null && !Array.isArray(value);\n"],"names":["emptyWizardState","entryStepId","activeStep","history","steps","readStepValue","state","stepId","readStepDraft","value","kind","values","readStepIds","ids","readStepChoice","option","undefined","withStepValue","readWizardState","isRecord","Array","isArray","every","entry","readSteps","stepValue","Object","entries","read","readStepValueOf","id","isDraft","member","isRowOfStrings","row","cell"],"mappings":";AA6CA,wDAAwD,GACxD,OAAO,MAAMA,mBAAmB,CAACC,cAAsC,CAAA;QACrEC,YAAYD;QACZE,SAAS,EAAE;QACXC,OAAO,CAAC;IACV,CAAA,EAAG;AAEH,kEAAkE,GAClE,OAAO,MAAMC,gBAAgB,CAC3BC,OACAC,SACgCD,MAAMF,KAAK,CAACG,OAAO,CAAC;AAEtD;;;;;;CAMC,GACD,OAAO,MAAMC,gBAAgB,CAC3BF,OACAC;IAEA,MAAME,QAAQH,MAAMF,KAAK,CAACG,OAA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