@defra/forms-model 3.0.10 → 3.0.12
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/module/components/component-types.js +1 -5
- package/dist/module/components/component-types.js.map +1 -1
- package/dist/module/components/conditional-component-types.js +1 -5
- package/dist/module/components/conditional-component-types.js.map +1 -1
- package/dist/module/components/enums.js +1 -5
- package/dist/module/components/enums.js.map +1 -1
- package/dist/module/components/index.js +3 -24
- package/dist/module/components/index.js.map +1 -1
- package/dist/module/components/types.js +1 -1
- package/dist/module/conditions/condition-abstract.js +3 -8
- package/dist/module/conditions/condition-abstract.js.map +1 -1
- package/dist/module/conditions/condition-field.js +3 -8
- package/dist/module/conditions/condition-field.js.map +1 -1
- package/dist/module/conditions/condition-group-def.js +1 -6
- package/dist/module/conditions/condition-group-def.js.map +1 -1
- package/dist/module/conditions/condition-group.js +4 -9
- package/dist/module/conditions/condition-group.js.map +1 -1
- package/dist/module/conditions/condition-model.js +20 -25
- package/dist/module/conditions/condition-model.js.map +1 -1
- package/dist/module/conditions/condition-operators.js +15 -23
- package/dist/module/conditions/condition-operators.js.map +1 -1
- package/dist/module/conditions/condition-ref.js +2 -7
- package/dist/module/conditions/condition-ref.js.map +1 -1
- package/dist/module/conditions/condition-value-abstract.js +3 -8
- package/dist/module/conditions/condition-value-abstract.js.map +1 -1
- package/dist/module/conditions/condition-value-registration.js +1 -6
- package/dist/module/conditions/condition-value-registration.js.map +1 -1
- package/dist/module/conditions/condition-values.js +12 -20
- package/dist/module/conditions/condition-values.js.map +1 -1
- package/dist/module/conditions/condition.js +9 -14
- package/dist/module/conditions/condition.js.map +1 -1
- package/dist/module/conditions/enums.js +1 -5
- package/dist/module/conditions/enums.js.map +1 -1
- package/dist/module/conditions/helpers.js +2 -7
- package/dist/module/conditions/helpers.js.map +1 -1
- package/dist/module/conditions/index.js +10 -139
- package/dist/module/conditions/index.js.map +1 -1
- package/dist/module/conditions/inline-condition-model.js +15 -26
- package/dist/module/conditions/inline-condition-model.js.map +1 -1
- package/dist/module/conditions/inline-condition-operators.js +15 -23
- package/dist/module/conditions/inline-condition-operators.js.map +1 -1
- package/dist/module/conditions/inline-condition-values.js +9 -17
- package/dist/module/conditions/inline-condition-values.js.map +1 -1
- package/dist/module/conditions/types.js +1 -1
- package/dist/module/conditions/types.js.map +1 -1
- package/dist/module/data-model/conditions-wrapper.js +3 -8
- package/dist/module/data-model/conditions-wrapper.js.map +1 -1
- package/dist/module/data-model/enums.js +1 -5
- package/dist/module/data-model/enums.js.map +1 -1
- package/dist/module/data-model/index.js +3 -24
- package/dist/module/data-model/index.js.map +1 -1
- package/dist/module/data-model/input-wrapper.js +3 -8
- package/dist/module/data-model/input-wrapper.js.map +1 -1
- package/dist/module/data-model/types.js +1 -5
- package/dist/module/data-model/types.js.map +1 -1
- package/dist/module/form/form-configuration.js +1 -6
- package/dist/module/form/form-configuration.js.map +1 -1
- package/dist/module/form/index.js +1 -10
- package/dist/module/form/index.js.map +1 -1
- package/dist/module/index.js +8 -91
- package/dist/module/index.js.map +1 -1
- package/dist/module/migration/index.js +1 -10
- package/dist/module/migration/index.js.map +1 -1
- package/dist/module/migration/migration.0-2.js +1 -5
- package/dist/module/migration/migration.0-2.js.map +1 -1
- package/dist/module/migration/migration.1-2.js +3 -6
- package/dist/module/migration/migration.1-2.js.map +1 -1
- package/dist/module/migration/types.js +1 -1
- package/dist/module/migration/whichMigrations.js +5 -9
- package/dist/module/migration/whichMigrations.js.map +1 -1
- package/dist/module/schema/index.js +1 -16
- package/dist/module/schema/index.js.map +1 -1
- package/dist/module/schema/schema.js +163 -167
- package/dist/module/schema/schema.js.map +1 -1
- package/dist/module/utils/helpers.js +5 -13
- package/dist/module/utils/helpers.js.map +1 -1
- package/dist/module/utils/logger.js +1 -6
- package/dist/module/utils/logger.js.map +1 -1
- package/dist/types/components/component-types.d.ts +1 -1
- package/dist/types/components/component-types.d.ts.map +1 -1
- package/dist/types/components/conditional-component-types.d.ts +1 -1
- package/dist/types/components/conditional-component-types.d.ts.map +1 -1
- package/dist/types/components/index.d.ts +3 -3
- package/dist/types/components/index.d.ts.map +1 -1
- package/dist/types/conditions/condition-abstract.d.ts +1 -1
- package/dist/types/conditions/condition-abstract.d.ts.map +1 -1
- package/dist/types/conditions/condition-field.d.ts +1 -1
- package/dist/types/conditions/condition-field.d.ts.map +1 -1
- package/dist/types/conditions/condition-group-def.d.ts +2 -2
- package/dist/types/conditions/condition-group-def.d.ts.map +1 -1
- package/dist/types/conditions/condition-group.d.ts +2 -2
- package/dist/types/conditions/condition-group.d.ts.map +1 -1
- package/dist/types/conditions/condition-model.d.ts +5 -5
- package/dist/types/conditions/condition-model.d.ts.map +1 -1
- package/dist/types/conditions/condition-operators.d.ts +2 -2
- package/dist/types/conditions/condition-operators.d.ts.map +1 -1
- package/dist/types/conditions/condition-ref.d.ts +2 -2
- package/dist/types/conditions/condition-ref.d.ts.map +1 -1
- package/dist/types/conditions/condition-value-abstract.d.ts +1 -1
- package/dist/types/conditions/condition-value-abstract.d.ts.map +1 -1
- package/dist/types/conditions/condition-values.d.ts +3 -3
- package/dist/types/conditions/condition-values.d.ts.map +1 -1
- package/dist/types/conditions/condition.d.ts +4 -4
- package/dist/types/conditions/condition.d.ts.map +1 -1
- package/dist/types/conditions/index.d.ts +10 -10
- package/dist/types/conditions/index.d.ts.map +1 -1
- package/dist/types/conditions/types.d.ts +3 -3
- package/dist/types/conditions/types.d.ts.map +1 -1
- package/dist/types/data-model/conditions-wrapper.d.ts +1 -1
- package/dist/types/data-model/conditions-wrapper.d.ts.map +1 -1
- package/dist/types/data-model/index.d.ts +3 -3
- package/dist/types/data-model/index.d.ts.map +1 -1
- package/dist/types/data-model/input-wrapper.d.ts +2 -2
- package/dist/types/data-model/input-wrapper.d.ts.map +1 -1
- package/dist/types/data-model/types.d.ts +3 -3
- package/dist/types/data-model/types.d.ts.map +1 -1
- package/dist/types/form/index.d.ts +1 -1
- package/dist/types/form/index.d.ts.map +1 -1
- package/dist/types/index.d.ts +11 -11
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/migration/index.d.ts +1 -1
- package/dist/types/migration/index.d.ts.map +1 -1
- package/dist/types/migration/migration.0-2.d.ts +1 -1
- package/dist/types/migration/migration.0-2.d.ts.map +1 -1
- package/dist/types/migration/migration.1-2.d.ts +1 -1
- package/dist/types/migration/migration.1-2.d.ts.map +1 -1
- package/dist/types/migration/whichMigrations.d.ts +1 -1
- package/dist/types/migration/whichMigrations.d.ts.map +1 -1
- package/dist/types/schema/index.d.ts +1 -1
- package/dist/types/schema/index.d.ts.map +1 -1
- package/package.json +3 -4
- package/src/components/component-types.ts +1 -1
- package/src/components/conditional-component-types.ts +1 -1
- package/src/components/index.ts +3 -3
- package/src/conditions/condition-abstract.ts +1 -1
- package/src/conditions/condition-field.ts +2 -2
- package/src/conditions/condition-group-def.ts +1 -1
- package/src/conditions/condition-group.ts +3 -3
- package/src/conditions/condition-model.ts +9 -9
- package/src/conditions/condition-operators.ts +6 -3
- package/src/conditions/condition-ref.ts +2 -2
- package/src/conditions/condition-value-abstract.ts +1 -1
- package/src/conditions/condition-values.ts +3 -3
- package/src/conditions/condition.ts +6 -6
- package/src/conditions/index.ts +10 -10
- package/src/conditions/inline-condition-model.ts +3 -3
- package/src/conditions/inline-condition-operators.ts +1 -1
- package/src/conditions/types.ts +3 -3
- package/src/data-model/conditions-wrapper.ts +2 -2
- package/src/data-model/index.ts +3 -3
- package/src/data-model/input-wrapper.ts +3 -3
- package/src/data-model/types.ts +3 -3
- package/src/form/index.ts +1 -1
- package/src/index.ts +11 -11
- package/src/migration/index.ts +1 -1
- package/src/migration/migration.0-2.ts +1 -1
- package/src/migration/migration.1-2.ts +2 -2
- package/src/migration/whichMigrations.ts +3 -3
- package/src/schema/index.ts +1 -1
- package/dist/browser/components/component-types.js +0 -220
- package/dist/browser/components/component-types.js.map +0 -1
- package/dist/browser/components/conditional-component-types.js +0 -28
- package/dist/browser/components/conditional-component-types.js.map +0 -1
- package/dist/browser/components/enums.js +0 -46
- package/dist/browser/components/enums.js.map +0 -1
- package/dist/browser/components/index.js +0 -36
- package/dist/browser/components/index.js.map +0 -1
- package/dist/browser/components/types.js +0 -16
- package/dist/browser/components/types.js.map +0 -1
- package/dist/browser/conditions/condition-abstract.js +0 -62
- package/dist/browser/conditions/condition-abstract.js.map +0 -1
- package/dist/browser/conditions/condition-field.js +0 -45
- package/dist/browser/conditions/condition-field.js.map +0 -1
- package/dist/browser/conditions/condition-group-def.js +0 -45
- package/dist/browser/conditions/condition-group-def.js.map +0 -1
- package/dist/browser/conditions/condition-group.js +0 -64
- package/dist/browser/conditions/condition-group.js.map +0 -1
- package/dist/browser/conditions/condition-model.js +0 -214
- package/dist/browser/conditions/condition-model.js.map +0 -1
- package/dist/browser/conditions/condition-operators.js +0 -132
- package/dist/browser/conditions/condition-operators.js.map +0 -1
- package/dist/browser/conditions/condition-ref.js +0 -51
- package/dist/browser/conditions/condition-ref.js.map +0 -1
- package/dist/browser/conditions/condition-value-abstract.js +0 -41
- package/dist/browser/conditions/condition-value-abstract.js.map +0 -1
- package/dist/browser/conditions/condition-value-registration.js +0 -37
- package/dist/browser/conditions/condition-value-registration.js.map +0 -1
- package/dist/browser/conditions/condition-values.js +0 -127
- package/dist/browser/conditions/condition-values.js.map +0 -1
- package/dist/browser/conditions/condition.js +0 -56
- package/dist/browser/conditions/condition.js.map +0 -1
- package/dist/browser/conditions/enums.js +0 -24
- package/dist/browser/conditions/enums.js.map +0 -1
- package/dist/browser/conditions/helpers.js +0 -26
- package/dist/browser/conditions/helpers.js.map +0 -1
- package/dist/browser/conditions/index.js +0 -144
- package/dist/browser/conditions/index.js.map +0 -1
- package/dist/browser/conditions/inline-condition-model.js +0 -418
- package/dist/browser/conditions/inline-condition-model.js.map +0 -1
- package/dist/browser/conditions/inline-condition-operators.js +0 -132
- package/dist/browser/conditions/inline-condition-operators.js.map +0 -1
- package/dist/browser/conditions/inline-condition-values.js +0 -159
- package/dist/browser/conditions/inline-condition-values.js.map +0 -1
- package/dist/browser/conditions/types.js +0 -16
- package/dist/browser/conditions/types.js.map +0 -1
- package/dist/browser/data-model/conditions-wrapper.js +0 -49
- package/dist/browser/data-model/conditions-wrapper.js.map +0 -1
- package/dist/browser/data-model/enums.js +0 -25
- package/dist/browser/data-model/enums.js.map +0 -1
- package/dist/browser/data-model/index.js +0 -36
- package/dist/browser/data-model/index.js.map +0 -1
- package/dist/browser/data-model/input-wrapper.js +0 -49
- package/dist/browser/data-model/input-wrapper.js.map +0 -1
- package/dist/browser/data-model/types.js +0 -27
- package/dist/browser/data-model/types.js.map +0 -1
- package/dist/browser/form/form-configuration.js +0 -38
- package/dist/browser/form/form-configuration.js.map +0 -1
- package/dist/browser/form/index.js +0 -24
- package/dist/browser/form/index.js.map +0 -1
- package/dist/browser/index.js +0 -98
- package/dist/browser/index.js.map +0 -1
- package/dist/browser/migration/index.js +0 -24
- package/dist/browser/migration/index.js.map +0 -1
- package/dist/browser/migration/migration.0-2.js +0 -65
- package/dist/browser/migration/migration.0-2.js.map +0 -1
- package/dist/browser/migration/migration.1-2.js +0 -108
- package/dist/browser/migration/migration.1-2.js.map +0 -1
- package/dist/browser/migration/types.js +0 -16
- package/dist/browser/migration/types.js.map +0 -1
- package/dist/browser/migration/whichMigrations.js +0 -38
- package/dist/browser/migration/whichMigrations.js.map +0 -1
- package/dist/browser/schema/index.js +0 -30
- package/dist/browser/schema/index.js.map +0 -1
- package/dist/browser/schema/schema.js +0 -255
- package/dist/browser/schema/schema.js.map +0 -1
- package/dist/browser/utils/helpers.js +0 -48
- package/dist/browser/utils/helpers.js.map +0 -1
- package/dist/browser/utils/logger.js +0 -46
- package/dist/browser/utils/logger.js.map +0 -1
@@ -1,25 +1,4 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
Object.defineProperty(exports, "ConditionsWrapper", {
|
5
|
-
enumerable: true,
|
6
|
-
get: function () {
|
7
|
-
return _conditionsWrapper.ConditionsWrapper;
|
8
|
-
}
|
9
|
-
});
|
10
|
-
Object.defineProperty(exports, "InputWrapper", {
|
11
|
-
enumerable: true,
|
12
|
-
get: function () {
|
13
|
-
return _inputWrapper.InputWrapper;
|
14
|
-
}
|
15
|
-
});
|
16
|
-
Object.defineProperty(exports, "OutputType", {
|
17
|
-
enumerable: true,
|
18
|
-
get: function () {
|
19
|
-
return _enums.OutputType;
|
20
|
-
}
|
21
|
-
});
|
22
|
-
var _inputWrapper = require("./input-wrapper");
|
23
|
-
var _conditionsWrapper = require("./conditions-wrapper");
|
24
|
-
var _enums = require("./enums");
|
1
|
+
export { InputWrapper } from "./input-wrapper.js";
|
2
|
+
export { ConditionsWrapper } from "./conditions-wrapper.js";
|
3
|
+
export { OutputType } from "./enums.js";
|
25
4
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","names":["
|
1
|
+
{"version":3,"file":"index.js","names":["InputWrapper","ConditionsWrapper","OutputType"],"sources":["../../../src/data-model/index.ts"],"sourcesContent":["export { InputWrapper } from '~/src/data-model/input-wrapper.js'\nexport { ConditionsWrapper } from '~/src/data-model/conditions-wrapper.js'\nexport { OutputType } from '~/src/data-model/enums.js'\n"],"mappings":"AAAA,SAASA,YAAY;AACrB,SAASC,iBAAiB;AAC1B,SAASC,UAAU"}
|
@@ -1,16 +1,12 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
exports.__esModule = true;
|
4
|
-
exports.InputWrapper = void 0;
|
5
|
-
var _helpers = require("../utils/helpers");
|
6
|
-
class InputWrapper {
|
1
|
+
import { clone } from "../utils/helpers.js";
|
2
|
+
export class InputWrapper {
|
7
3
|
name = undefined;
|
8
4
|
title = undefined;
|
9
5
|
type = undefined;
|
10
6
|
#parentItemName;
|
11
7
|
constructor(rawData, page, options) {
|
12
8
|
Object.assign(this, rawData);
|
13
|
-
const myPage =
|
9
|
+
const myPage = clone(page);
|
14
10
|
delete myPage.components;
|
15
11
|
this.page = myPage;
|
16
12
|
this.propertyPath = !options.ignoreSection && page.section ? `${page.section}.${this.name}` : this.name;
|
@@ -21,5 +17,4 @@ class InputWrapper {
|
|
21
17
|
return this.page.section ? `${titleWithContext} in ${this.page.section}` : titleWithContext;
|
22
18
|
}
|
23
19
|
}
|
24
|
-
exports.InputWrapper = InputWrapper;
|
25
20
|
//# sourceMappingURL=input-wrapper.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"input-wrapper.js","names":["
|
1
|
+
{"version":3,"file":"input-wrapper.js","names":["clone","InputWrapper","name","undefined","title","type","parentItemName","constructor","rawData","page","options","Object","assign","myPage","components","propertyPath","ignoreSection","section","displayName","titleWithContext"],"sources":["../../../src/data-model/input-wrapper.ts"],"sourcesContent":["import { type ComponentDef } from '~/src/components/types.js'\nimport { type Page } from '~/src/data-model/types.js'\nimport { clone } from '~/src/utils/helpers.js'\n\nexport class InputWrapper {\n name: string | undefined = undefined\n title: string | undefined = undefined\n type: string | undefined = undefined\n propertyPath: string | undefined\n #parentItemName: string | undefined\n page: Page\n\n constructor(\n rawData: ComponentDef,\n page: Page,\n options: { ignoreSection?: boolean; parentItemName?: string }\n ) {\n Object.assign(this, rawData)\n const myPage = clone(page)\n\n delete myPage.components\n\n this.page = myPage\n this.propertyPath =\n !options.ignoreSection && page.section\n ? `${page.section}.${this.name}`\n : this.name\n this.#parentItemName = options.parentItemName\n }\n\n get displayName(): string | undefined {\n const titleWithContext = this.#parentItemName\n ? `${this.title} under ${this.#parentItemName}`\n : this.title\n\n return this.page.section\n ? `${titleWithContext} in ${this.page.section}`\n : titleWithContext\n }\n}\n"],"mappings":"AAEA,SAASA,KAAK;AAEd,OAAO,MAAMC,YAAY,CAAC;EACxBC,IAAI,GAAuBC,SAAS;EACpCC,KAAK,GAAuBD,SAAS;EACrCE,IAAI,GAAuBF,SAAS;EAEpC,CAACG,cAAc;EAGfC,WAAWA,CACTC,OAAqB,EACrBC,IAAU,EACVC,OAA6D,EAC7D;IACAC,MAAM,CAACC,MAAM,CAAC,IAAI,EAAEJ,OAAO,CAAC;IAC5B,MAAMK,MAAM,GAAGb,KAAK,CAACS,IAAI,CAAC;IAE1B,OAAOI,MAAM,CAACC,UAAU;IAExB,IAAI,CAACL,IAAI,GAAGI,MAAM;IAClB,IAAI,CAACE,YAAY,GACf,CAACL,OAAO,CAACM,aAAa,IAAIP,IAAI,CAACQ,OAAO,GACjC,GAAER,IAAI,CAACQ,OAAQ,IAAG,IAAI,CAACf,IAAK,EAAC,GAC9B,IAAI,CAACA,IAAI;IACf,IAAI,CAAC,CAACI,cAAc,GAAGI,OAAO,CAACJ,cAAc;EAC/C;EAEA,IAAIY,WAAWA,CAAA,EAAuB;IACpC,MAAMC,gBAAgB,GAAG,IAAI,CAAC,CAACb,cAAc,GACxC,GAAE,IAAI,CAACF,KAAM,UAAS,IAAI,CAAC,CAACE,cAAe,EAAC,GAC7C,IAAI,CAACF,KAAK;IAEd,OAAO,IAAI,CAACK,IAAI,CAACQ,OAAO,GACnB,GAAEE,gBAAiB,OAAM,IAAI,CAACV,IAAI,CAACQ,OAAQ,EAAC,GAC7CE,gBAAgB;EACtB;AACF"}
|
@@ -1,8 +1,4 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
exports.__esModule = true;
|
4
|
-
exports.isMultipleApiKey = isMultipleApiKey;
|
5
|
-
function isMultipleApiKey(payApiKey) {
|
1
|
+
export function isMultipleApiKey(payApiKey) {
|
6
2
|
const obj = payApiKey;
|
7
3
|
return obj.test !== undefined || obj.production !== undefined;
|
8
4
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.js","names":["isMultipleApiKey","payApiKey","obj","test","undefined","production"],"sources":["../../../src/data-model/types.ts"],"sourcesContent":["import { type ComponentDef } from '~/src/components/types'\nimport { type Condition } from '~/src/conditions/condition'\nimport { type OutputType } from '~/src/data-model/enums'\n\ntype Toggleable<T> = boolean | T\n\nexport interface Next {\n path: string\n condition?: string\n}\nexport type Link = Next\n\nexport interface Page {\n title: string\n path: string\n controller: string\n components?: ComponentDef[]\n section: string // the section ID\n next?: { path: string; condition?: string }[]\n}\n\nexport interface RepeatingFieldPage extends Page {\n controller: 'RepeatingFieldPageController'\n options: {\n summaryDisplayMode?: {\n samePage?: boolean\n separatePage?: boolean\n hideRowTitles?: boolean\n }\n customText?: {\n separatePageTitle?: string\n }\n }\n}\n\nexport interface Section {\n name: string\n title: string\n hideTitle: boolean\n}\n\nexport interface Item {\n text: string\n value: string | number | boolean\n description?: string\n condition?: string\n}\n\nexport interface List {\n name: string\n title: string\n type: 'string' | 'number' | 'boolean'\n items: Item[]\n}\n\nexport interface Feedback {\n feedbackForm?: boolean\n url?: string\n emailAddress?: string\n}\n\nexport type PhaseBanner = {\n phase?: 'alpha' | 'beta'\n feedbackUrl?: string\n}\n\nexport type MultipleApiKeys = {\n test?: string\n production?: string\n}\n\nexport type EmailOutputConfiguration = {\n emailAddress: string\n}\n\nexport type NotifyOutputConfiguration = {\n apiKey: string\n templateId: string\n emailField: string\n personalisation: string[]\n personalisationFieldCustomisation?: {\n [personalisationName: string]: string[]\n }\n addReferencesToPersonalisation?: boolean\n emailReplyToIdConfiguration?: {\n emailReplyToId: string\n condition?: string | undefined\n }[]\n}\n\nexport type WebhookOutputConfiguration = {\n url: string\n}\n\nexport type OutputConfiguration =\n | EmailOutputConfiguration\n | NotifyOutputConfiguration\n | WebhookOutputConfiguration\n\nexport type Output = {\n name: string\n title: string\n type: OutputType\n outputConfiguration: OutputConfiguration\n}\n\nexport type ConfirmationPage = {\n customText: {\n title: string\n paymentSkipped: Toggleable<string>\n nextSteps: Toggleable<string>\n }\n components: ComponentDef[]\n}\n\nexport type PaymentSkippedWarningPage = {\n customText: {\n title: string\n caption: string\n body: string\n }\n}\n\nexport type SpecialPages = {\n confirmationPage?: ConfirmationPage\n paymentSkippedWarningPage?: PaymentSkippedWarningPage\n}\n\nexport function isMultipleApiKey(\n payApiKey: string | MultipleApiKeys | undefined\n): payApiKey is MultipleApiKeys {\n const obj = payApiKey as MultipleApiKeys\n return obj.test !== undefined || obj.production !== undefined\n}\n\nexport type Fee = {\n description: string\n amount: number\n multiplier?: string\n condition?: string\n prefix?: string\n}\n\nexport type FeeOptions = {\n paymentReferenceFormat?: string\n payReturnUrl?: string\n allowSubmissionWithoutPayment: boolean\n maxAttempts: number\n customPayErrorMessage?: string\n showPaymentSkippedWarningPage: boolean\n}\n\nexport type ConditionWrapperValue =\n | string\n | {\n name: string\n conditions: Condition[]\n }\n\nexport type ConditionRawData = {\n name: string\n displayName: string\n value: ConditionWrapperValue\n}\n\n/**\n * `FormDefinition` is a typescript representation of `Schema`\n */\nexport type FormDefinition = {\n pages: Array<Page | RepeatingFieldPage>\n conditions: ConditionRawData[]\n lists: List[]\n sections: Section[]\n startPage?: Page['path'] | undefined\n name?: string | undefined\n feedback?: Feedback\n phaseBanner?: PhaseBanner\n fees: Fee[]\n skipSummary?: boolean | undefined\n outputs: Output[]\n declaration?: string | undefined\n metadata?: Record<string, any>\n payApiKey?: string | MultipleApiKeys | undefined\n specialPages?: SpecialPages\n paymentReferenceFormat?: string\n feeOptions: FeeOptions\n}\n"],"mappings":"
|
1
|
+
{"version":3,"file":"types.js","names":["isMultipleApiKey","payApiKey","obj","test","undefined","production"],"sources":["../../../src/data-model/types.ts"],"sourcesContent":["import { type ComponentDef } from '~/src/components/types.js'\nimport { type Condition } from '~/src/conditions/condition.js'\nimport { type OutputType } from '~/src/data-model/enums.js'\n\ntype Toggleable<T> = boolean | T\n\nexport interface Next {\n path: string\n condition?: string\n}\nexport type Link = Next\n\nexport interface Page {\n title: string\n path: string\n controller: string\n components?: ComponentDef[]\n section: string // the section ID\n next?: { path: string; condition?: string }[]\n}\n\nexport interface RepeatingFieldPage extends Page {\n controller: 'RepeatingFieldPageController'\n options: {\n summaryDisplayMode?: {\n samePage?: boolean\n separatePage?: boolean\n hideRowTitles?: boolean\n }\n customText?: {\n separatePageTitle?: string\n }\n }\n}\n\nexport interface Section {\n name: string\n title: string\n hideTitle: boolean\n}\n\nexport interface Item {\n text: string\n value: string | number | boolean\n description?: string\n condition?: string\n}\n\nexport interface List {\n name: string\n title: string\n type: 'string' | 'number' | 'boolean'\n items: Item[]\n}\n\nexport interface Feedback {\n feedbackForm?: boolean\n url?: string\n emailAddress?: string\n}\n\nexport type PhaseBanner = {\n phase?: 'alpha' | 'beta'\n feedbackUrl?: string\n}\n\nexport type MultipleApiKeys = {\n test?: string\n production?: string\n}\n\nexport type EmailOutputConfiguration = {\n emailAddress: string\n}\n\nexport type NotifyOutputConfiguration = {\n apiKey: string\n templateId: string\n emailField: string\n personalisation: string[]\n personalisationFieldCustomisation?: {\n [personalisationName: string]: string[]\n }\n addReferencesToPersonalisation?: boolean\n emailReplyToIdConfiguration?: {\n emailReplyToId: string\n condition?: string | undefined\n }[]\n}\n\nexport type WebhookOutputConfiguration = {\n url: string\n}\n\nexport type OutputConfiguration =\n | EmailOutputConfiguration\n | NotifyOutputConfiguration\n | WebhookOutputConfiguration\n\nexport type Output = {\n name: string\n title: string\n type: OutputType\n outputConfiguration: OutputConfiguration\n}\n\nexport type ConfirmationPage = {\n customText: {\n title: string\n paymentSkipped: Toggleable<string>\n nextSteps: Toggleable<string>\n }\n components: ComponentDef[]\n}\n\nexport type PaymentSkippedWarningPage = {\n customText: {\n title: string\n caption: string\n body: string\n }\n}\n\nexport type SpecialPages = {\n confirmationPage?: ConfirmationPage\n paymentSkippedWarningPage?: PaymentSkippedWarningPage\n}\n\nexport function isMultipleApiKey(\n payApiKey: string | MultipleApiKeys | undefined\n): payApiKey is MultipleApiKeys {\n const obj = payApiKey as MultipleApiKeys\n return obj.test !== undefined || obj.production !== undefined\n}\n\nexport type Fee = {\n description: string\n amount: number\n multiplier?: string\n condition?: string\n prefix?: string\n}\n\nexport type FeeOptions = {\n paymentReferenceFormat?: string\n payReturnUrl?: string\n allowSubmissionWithoutPayment: boolean\n maxAttempts: number\n customPayErrorMessage?: string\n showPaymentSkippedWarningPage: boolean\n}\n\nexport type ConditionWrapperValue =\n | string\n | {\n name: string\n conditions: Condition[]\n }\n\nexport type ConditionRawData = {\n name: string\n displayName: string\n value: ConditionWrapperValue\n}\n\n/**\n * `FormDefinition` is a typescript representation of `Schema`\n */\nexport type FormDefinition = {\n pages: Array<Page | RepeatingFieldPage>\n conditions: ConditionRawData[]\n lists: List[]\n sections: Section[]\n startPage?: Page['path'] | undefined\n name?: string | undefined\n feedback?: Feedback\n phaseBanner?: PhaseBanner\n fees: Fee[]\n skipSummary?: boolean | undefined\n outputs: Output[]\n declaration?: string | undefined\n metadata?: Record<string, any>\n payApiKey?: string | MultipleApiKeys | undefined\n specialPages?: SpecialPages\n paymentReferenceFormat?: string\n feeOptions: FeeOptions\n}\n"],"mappings":"AAgIA,OAAO,SAASA,gBAAgBA,CAC9BC,SAA+C,EACjB;EAC9B,MAAMC,GAAG,GAAGD,SAA4B;EACxC,OAAOC,GAAG,CAACC,IAAI,KAAKC,SAAS,IAAIF,GAAG,CAACG,UAAU,KAAKD,SAAS;AAC/D;;AAgCA;AACA;AACA"}
|
@@ -1,8 +1,4 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
exports.__esModule = true;
|
4
|
-
exports.FormConfiguration = void 0;
|
5
|
-
class FormConfiguration {
|
1
|
+
export class FormConfiguration {
|
6
2
|
constructor(Key, DisplayName, LastModified, feedbackForm) {
|
7
3
|
if (!Key) {
|
8
4
|
throw Error('Form configuration must have a key');
|
@@ -13,5 +9,4 @@ class FormConfiguration {
|
|
13
9
|
this.feedbackForm = feedbackForm || false;
|
14
10
|
}
|
15
11
|
}
|
16
|
-
exports.FormConfiguration = FormConfiguration;
|
17
12
|
//# sourceMappingURL=form-configuration.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"form-configuration.js","names":["FormConfiguration","constructor","Key","DisplayName","LastModified","feedbackForm","Error"
|
1
|
+
{"version":3,"file":"form-configuration.js","names":["FormConfiguration","constructor","Key","DisplayName","LastModified","feedbackForm","Error"],"sources":["../../../src/form/form-configuration.ts"],"sourcesContent":["export class FormConfiguration {\n Key: string\n DisplayName: string\n LastModified: string | undefined\n feedbackForm: boolean | undefined\n\n constructor(\n Key: string,\n DisplayName?: string,\n LastModified?: string,\n feedbackForm?: boolean\n ) {\n if (!Key) {\n throw Error('Form configuration must have a key')\n }\n this.Key = Key\n this.DisplayName = DisplayName || Key\n this.LastModified = LastModified\n this.feedbackForm = feedbackForm || false\n }\n}\n"],"mappings":"AAAA,OAAO,MAAMA,iBAAiB,CAAC;EAM7BC,WAAWA,CACTC,GAAW,EACXC,WAAoB,EACpBC,YAAqB,EACrBC,YAAsB,EACtB;IACA,IAAI,CAACH,GAAG,EAAE;MACR,MAAMI,KAAK,CAAC,oCAAoC,CAAC;IACnD;IACA,IAAI,CAACJ,GAAG,GAAGA,GAAG;IACd,IAAI,CAACC,WAAW,GAAGA,WAAW,IAAID,GAAG;IACrC,IAAI,CAACE,YAAY,GAAGA,YAAY;IAChC,IAAI,CAACC,YAAY,GAAGA,YAAY,IAAI,KAAK;EAC3C;AACF"}
|
@@ -1,11 +1,2 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
exports.__esModule = true;
|
4
|
-
Object.defineProperty(exports, "FormConfiguration", {
|
5
|
-
enumerable: true,
|
6
|
-
get: function () {
|
7
|
-
return _formConfiguration.FormConfiguration;
|
8
|
-
}
|
9
|
-
});
|
10
|
-
var _formConfiguration = require("./form-configuration");
|
1
|
+
export { FormConfiguration } from "./form-configuration.js";
|
11
2
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","names":["
|
1
|
+
{"version":3,"file":"index.js","names":["FormConfiguration"],"sources":["../../../src/form/index.ts"],"sourcesContent":["export { FormConfiguration } from '~/src/form/form-configuration.js'\n"],"mappings":"AAAA,SAASA,iBAAiB"}
|
package/dist/module/index.js
CHANGED
@@ -1,92 +1,9 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
enumerable: true,
|
10
|
-
get: function () {
|
11
|
-
return _schema[key];
|
12
|
-
}
|
13
|
-
});
|
14
|
-
});
|
15
|
-
var _dataModel = require("./data-model");
|
16
|
-
Object.keys(_dataModel).forEach(function (key) {
|
17
|
-
if (key === "default" || key === "__esModule") return;
|
18
|
-
if (key in exports && exports[key] === _dataModel[key]) return;
|
19
|
-
Object.defineProperty(exports, key, {
|
20
|
-
enumerable: true,
|
21
|
-
get: function () {
|
22
|
-
return _dataModel[key];
|
23
|
-
}
|
24
|
-
});
|
25
|
-
});
|
26
|
-
var _logger = require("./utils/logger");
|
27
|
-
Object.keys(_logger).forEach(function (key) {
|
28
|
-
if (key === "default" || key === "__esModule") return;
|
29
|
-
if (key in exports && exports[key] === _logger[key]) return;
|
30
|
-
Object.defineProperty(exports, key, {
|
31
|
-
enumerable: true,
|
32
|
-
get: function () {
|
33
|
-
return _logger[key];
|
34
|
-
}
|
35
|
-
});
|
36
|
-
});
|
37
|
-
var _form = require("./form");
|
38
|
-
Object.keys(_form).forEach(function (key) {
|
39
|
-
if (key === "default" || key === "__esModule") return;
|
40
|
-
if (key in exports && exports[key] === _form[key]) return;
|
41
|
-
Object.defineProperty(exports, key, {
|
42
|
-
enumerable: true,
|
43
|
-
get: function () {
|
44
|
-
return _form[key];
|
45
|
-
}
|
46
|
-
});
|
47
|
-
});
|
48
|
-
var _components = require("./components");
|
49
|
-
Object.keys(_components).forEach(function (key) {
|
50
|
-
if (key === "default" || key === "__esModule") return;
|
51
|
-
if (key in exports && exports[key] === _components[key]) return;
|
52
|
-
Object.defineProperty(exports, key, {
|
53
|
-
enumerable: true,
|
54
|
-
get: function () {
|
55
|
-
return _components[key];
|
56
|
-
}
|
57
|
-
});
|
58
|
-
});
|
59
|
-
var _conditions = require("./conditions");
|
60
|
-
Object.keys(_conditions).forEach(function (key) {
|
61
|
-
if (key === "default" || key === "__esModule") return;
|
62
|
-
if (key in exports && exports[key] === _conditions[key]) return;
|
63
|
-
Object.defineProperty(exports, key, {
|
64
|
-
enumerable: true,
|
65
|
-
get: function () {
|
66
|
-
return _conditions[key];
|
67
|
-
}
|
68
|
-
});
|
69
|
-
});
|
70
|
-
var _helpers = require("./utils/helpers");
|
71
|
-
Object.keys(_helpers).forEach(function (key) {
|
72
|
-
if (key === "default" || key === "__esModule") return;
|
73
|
-
if (key in exports && exports[key] === _helpers[key]) return;
|
74
|
-
Object.defineProperty(exports, key, {
|
75
|
-
enumerable: true,
|
76
|
-
get: function () {
|
77
|
-
return _helpers[key];
|
78
|
-
}
|
79
|
-
});
|
80
|
-
});
|
81
|
-
var _migration = require("./migration");
|
82
|
-
Object.keys(_migration).forEach(function (key) {
|
83
|
-
if (key === "default" || key === "__esModule") return;
|
84
|
-
if (key in exports && exports[key] === _migration[key]) return;
|
85
|
-
Object.defineProperty(exports, key, {
|
86
|
-
enumerable: true,
|
87
|
-
get: function () {
|
88
|
-
return _migration[key];
|
89
|
-
}
|
90
|
-
});
|
91
|
-
});
|
1
|
+
export * from "./schema/index.js";
|
2
|
+
export * from "./data-model/index.js";
|
3
|
+
export * from "./utils/logger.js";
|
4
|
+
export * from "./form/index.js";
|
5
|
+
export * from "./components/index.js";
|
6
|
+
export * from "./conditions/index.js";
|
7
|
+
export * from "./utils/helpers.js";
|
8
|
+
export * from "./migration/index.js";
|
92
9
|
//# sourceMappingURL=index.js.map
|
package/dist/module/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","names":[
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/index.ts"],"sourcesContent":["export * from '~/src/schema/index.js'\nexport * from '~/src/data-model/index.js'\nexport * from '~/src/utils/logger.js'\nexport * from '~/src/form/index.js'\nexport * from '~/src/components/index.js'\nexport * from '~/src/conditions/index.js'\nexport * from '~/src/utils/helpers.js'\nexport * from '~/src/migration/index.js'\nexport type * from '~/src/components/types.js'\nexport type * from '~/src/conditions/types.js'\nexport type * from '~/src/data-model/types.js'\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
|
@@ -1,11 +1,2 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
exports.__esModule = true;
|
4
|
-
Object.defineProperty(exports, "whichMigrations", {
|
5
|
-
enumerable: true,
|
6
|
-
get: function () {
|
7
|
-
return _whichMigrations.whichMigrations;
|
8
|
-
}
|
9
|
-
});
|
10
|
-
var _whichMigrations = require("./whichMigrations");
|
1
|
+
export { whichMigrations } from "./whichMigrations.js";
|
11
2
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","names":["
|
1
|
+
{"version":3,"file":"index.js","names":["whichMigrations"],"sources":["../../../src/migration/index.ts"],"sourcesContent":["export { whichMigrations } from '~/src/migration/whichMigrations.js'\n"],"mappings":"AAAA,SAASA,eAAe"}
|
@@ -1,11 +1,7 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
exports.__esModule = true;
|
4
|
-
exports.migrate = migrate;
|
5
1
|
function needsUpgrade(data) {
|
6
2
|
return !!(data.pages ?? []).flatMap(page => page.components).find(component => component.options?.list);
|
7
3
|
}
|
8
|
-
function migrate(data) {
|
4
|
+
export function migrate(data) {
|
9
5
|
if (!needsUpgrade(data)) {
|
10
6
|
return {
|
11
7
|
...data,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"migration.0-2.js","names":["needsUpgrade","data","pages","flatMap","page","components","find","component","options","list","migrate","version","newPages","map","rest"],"sources":["../../../src/migration/migration.0-2.ts"],"sourcesContent":["import { type MigrationScript } from '~/src/migration/types'\n\nfunction needsUpgrade(data) {\n return !!(data.pages ?? [])\n .flatMap((page) => page.components)\n .find((component) => component.options?.list)\n}\n\nexport function migrate(data): MigrationScript {\n if (!needsUpgrade(data)) {\n return { ...data, version: 2 }\n }\n const { pages } = data\n const newPages = pages.flatMap((page) => {\n return page.components.map((component) => {\n if (!component.options?.list) {\n return component\n }\n const { list, ...rest } = component.options\n return { ...component, list, options: { ...rest } }\n })\n })\n\n return {\n ...data,\n pages: newPages,\n version: 2\n }\n}\n"],"mappings":"
|
1
|
+
{"version":3,"file":"migration.0-2.js","names":["needsUpgrade","data","pages","flatMap","page","components","find","component","options","list","migrate","version","newPages","map","rest"],"sources":["../../../src/migration/migration.0-2.ts"],"sourcesContent":["import { type MigrationScript } from '~/src/migration/types.js'\n\nfunction needsUpgrade(data) {\n return !!(data.pages ?? [])\n .flatMap((page) => page.components)\n .find((component) => component.options?.list)\n}\n\nexport function migrate(data): MigrationScript {\n if (!needsUpgrade(data)) {\n return { ...data, version: 2 }\n }\n const { pages } = data\n const newPages = pages.flatMap((page) => {\n return page.components.map((component) => {\n if (!component.options?.list) {\n return component\n }\n const { list, ...rest } = component.options\n return { ...component, list, options: { ...rest } }\n })\n })\n\n return {\n ...data,\n pages: newPages,\n version: 2\n }\n}\n"],"mappings":"AAEA,SAASA,YAAYA,CAACC,IAAI,EAAE;EAC1B,OAAO,CAAC,CAAC,CAACA,IAAI,CAACC,KAAK,IAAI,EAAE,EACvBC,OAAO,CAAEC,IAAI,IAAKA,IAAI,CAACC,UAAU,CAAC,CAClCC,IAAI,CAAEC,SAAS,IAAKA,SAAS,CAACC,OAAO,EAAEC,IAAI,CAAC;AACjD;AAEA,OAAO,SAASC,OAAOA,CAACT,IAAI,EAAmB;EAC7C,IAAI,CAACD,YAAY,CAACC,IAAI,CAAC,EAAE;IACvB,OAAO;MAAE,GAAGA,IAAI;MAAEU,OAAO,EAAE;IAAE,CAAC;EAChC;EACA,MAAM;IAAET;EAAM,CAAC,GAAGD,IAAI;EACtB,MAAMW,QAAQ,GAAGV,KAAK,CAACC,OAAO,CAAEC,IAAI,IAAK;IACvC,OAAOA,IAAI,CAACC,UAAU,CAACQ,GAAG,CAAEN,SAAS,IAAK;MACxC,IAAI,CAACA,SAAS,CAACC,OAAO,EAAEC,IAAI,EAAE;QAC5B,OAAOF,SAAS;MAClB;MACA,MAAM;QAAEE,IAAI;QAAE,GAAGK;MAAK,CAAC,GAAGP,SAAS,CAACC,OAAO;MAC3C,OAAO;QAAE,GAAGD,SAAS;QAAEE,IAAI;QAAED,OAAO,EAAE;UAAE,GAAGM;QAAK;MAAE,CAAC;IACrD,CAAC,CAAC;EACJ,CAAC,CAAC;EAEF,OAAO;IACL,GAAGb,IAAI;IACPC,KAAK,EAAEU,QAAQ;IACfD,OAAO,EAAE;EACX,CAAC;AACH"}
|
@@ -1,8 +1,5 @@
|
|
1
|
-
|
1
|
+
import { nanoid } from "../utils/helpers.js";
|
2
2
|
|
3
|
-
exports.__esModule = true;
|
4
|
-
exports.migrate = migrate;
|
5
|
-
var _helpers = require("../utils/helpers");
|
6
3
|
/**
|
7
4
|
* @private
|
8
5
|
* StaticItem is a deprecated Type.
|
@@ -38,7 +35,7 @@ function addListId(component) {
|
|
38
35
|
} = component;
|
39
36
|
return {
|
40
37
|
...component,
|
41
|
-
list: values.type === 'listRef' ? values.list :
|
38
|
+
list: values.type === 'listRef' ? values.list : nanoid()
|
42
39
|
};
|
43
40
|
}
|
44
41
|
function migratePage(page) {
|
@@ -64,7 +61,7 @@ function removeValues(page) {
|
|
64
61
|
function needsUpgrade(data) {
|
65
62
|
return !!data.pages.flatMap(page => page.components).find(component => component.values);
|
66
63
|
}
|
67
|
-
function migrate(data) {
|
64
|
+
export function migrate(data) {
|
68
65
|
if (!needsUpgrade(data)) {
|
69
66
|
return {
|
70
67
|
...data,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"migration.1-2.js","names":["
|
1
|
+
{"version":3,"file":"migration.1-2.js","names":["nanoid","recastItem","label","value","condition","hint","item","title","conditions","addListId","component","values","list","type","migratePage","page","components","map","removeValues","rest","needsUpgrade","data","pages","flatMap","find","migrate","version","componentsWithList","filter","c","items","valuesAsLists","name","lists"],"sources":["../../../src/migration/migration.1-2.ts"],"sourcesContent":["import { nanoid } from '~/src/utils/helpers.js'\nimport { type MigrationScript } from '~/src/migration/types.js'\n\n/**\n * @private\n * StaticItem is a deprecated Type.\n * It should only be used for aiding migration scripts.\n */\ntype StaticItem = {\n label: string\n value: string | number | boolean\n hint?: string\n condition?: string\n}\n\n/**\n * @private\n * StaticComponentValues is a deprecated Type.\n * It should only be used for aiding migration scripts.\n */\ntype StaticComponentValues = {\n list: any\n type: 'static' | 'listRef'\n valueType: string | number\n items: StaticItem[]\n}\n\ntype Item = {\n title: string\n value: any\n conditions?: any\n hint?: string\n}\n\nfunction recastItem({ label, value, condition, hint }: StaticItem) {\n const item: Item = {\n title: label,\n value\n }\n\n condition && (item.conditions = condition)\n hint && (item.hint = hint)\n return item\n}\n\nfunction addListId(component: { values: StaticComponentValues }) {\n if (!component.values) {\n return component\n }\n const { values } = component\n return {\n ...component,\n list: values.type === 'listRef' ? values.list : nanoid()\n }\n}\n\nfunction migratePage(page) {\n return {\n ...page,\n components: page.components.map(addListId)\n }\n}\n\nfunction removeValues(page) {\n return {\n ...page,\n components: page.components.map((component) => {\n const { values, ...rest } = component\n return {\n ...rest\n }\n })\n }\n}\n\nfunction needsUpgrade(data) {\n return !!data.pages\n .flatMap((page) => page.components)\n .find((component) => component.values)\n}\n\nexport function migrate(data): MigrationScript {\n if (!needsUpgrade(data)) {\n return { ...data, version: 2 }\n }\n const pages = data.pages.map(migratePage)\n const componentsWithList = pages.flatMap((page) =>\n page.components.filter((c) => c.values?.items)\n )\n\n const valuesAsLists = componentsWithList.map((component) => {\n return {\n title: component.title,\n name: component.list,\n items: component.values.items.map((item) => recastItem(item))\n }\n })\n\n return {\n ...data,\n pages: pages.map(removeValues),\n lists: [...(data.lists ?? []), ...valuesAsLists],\n version: 2\n }\n}\n"],"mappings":"AAAA,SAASA,MAAM;;AAGf;AACA;AACA;AACA;AACA;;AAQA;AACA;AACA;AACA;AACA;;AAeA,SAASC,UAAUA,CAAC;EAAEC,KAAK;EAAEC,KAAK;EAAEC,SAAS;EAAEC;AAAiB,CAAC,EAAE;EACjE,MAAMC,IAAU,GAAG;IACjBC,KAAK,EAAEL,KAAK;IACZC;EACF,CAAC;EAEDC,SAAS,KAAKE,IAAI,CAACE,UAAU,GAAGJ,SAAS,CAAC;EAC1CC,IAAI,KAAKC,IAAI,CAACD,IAAI,GAAGA,IAAI,CAAC;EAC1B,OAAOC,IAAI;AACb;AAEA,SAASG,SAASA,CAACC,SAA4C,EAAE;EAC/D,IAAI,CAACA,SAAS,CAACC,MAAM,EAAE;IACrB,OAAOD,SAAS;EAClB;EACA,MAAM;IAAEC;EAAO,CAAC,GAAGD,SAAS;EAC5B,OAAO;IACL,GAAGA,SAAS;IACZE,IAAI,EAAED,MAAM,CAACE,IAAI,KAAK,SAAS,GAAGF,MAAM,CAACC,IAAI,GAAGZ,MAAM,CAAC;EACzD,CAAC;AACH;AAEA,SAASc,WAAWA,CAACC,IAAI,EAAE;EACzB,OAAO;IACL,GAAGA,IAAI;IACPC,UAAU,EAAED,IAAI,CAACC,UAAU,CAACC,GAAG,CAACR,SAAS;EAC3C,CAAC;AACH;AAEA,SAASS,YAAYA,CAACH,IAAI,EAAE;EAC1B,OAAO;IACL,GAAGA,IAAI;IACPC,UAAU,EAAED,IAAI,CAACC,UAAU,CAACC,GAAG,CAAEP,SAAS,IAAK;MAC7C,MAAM;QAAEC,MAAM;QAAE,GAAGQ;MAAK,CAAC,GAAGT,SAAS;MACrC,OAAO;QACL,GAAGS;MACL,CAAC;IACH,CAAC;EACH,CAAC;AACH;AAEA,SAASC,YAAYA,CAACC,IAAI,EAAE;EAC1B,OAAO,CAAC,CAACA,IAAI,CAACC,KAAK,CAChBC,OAAO,CAAER,IAAI,IAAKA,IAAI,CAACC,UAAU,CAAC,CAClCQ,IAAI,CAAEd,SAAS,IAAKA,SAAS,CAACC,MAAM,CAAC;AAC1C;AAEA,OAAO,SAASc,OAAOA,CAACJ,IAAI,EAAmB;EAC7C,IAAI,CAACD,YAAY,CAACC,IAAI,CAAC,EAAE;IACvB,OAAO;MAAE,GAAGA,IAAI;MAAEK,OAAO,EAAE;IAAE,CAAC;EAChC;EACA,MAAMJ,KAAK,GAAGD,IAAI,CAACC,KAAK,CAACL,GAAG,CAACH,WAAW,CAAC;EACzC,MAAMa,kBAAkB,GAAGL,KAAK,CAACC,OAAO,CAAER,IAAI,IAC5CA,IAAI,CAACC,UAAU,CAACY,MAAM,CAAEC,CAAC,IAAKA,CAAC,CAAClB,MAAM,EAAEmB,KAAK,CAC/C,CAAC;EAED,MAAMC,aAAa,GAAGJ,kBAAkB,CAACV,GAAG,CAAEP,SAAS,IAAK;IAC1D,OAAO;MACLH,KAAK,EAAEG,SAAS,CAACH,KAAK;MACtByB,IAAI,EAAEtB,SAAS,CAACE,IAAI;MACpBkB,KAAK,EAAEpB,SAAS,CAACC,MAAM,CAACmB,KAAK,CAACb,GAAG,CAAEX,IAAI,IAAKL,UAAU,CAACK,IAAI,CAAC;IAC9D,CAAC;EACH,CAAC,CAAC;EAEF,OAAO;IACL,GAAGe,IAAI;IACPC,KAAK,EAAEA,KAAK,CAACL,GAAG,CAACC,YAAY,CAAC;IAC9Be,KAAK,EAAE,CAAC,IAAIZ,IAAI,CAACY,KAAK,IAAI,EAAE,CAAC,EAAE,GAAGF,aAAa,CAAC;IAChDL,OAAO,EAAE;EACX,CAAC;AACH"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
|
1
|
+
export {};
|
2
2
|
//# sourceMappingURL=types.js.map
|
@@ -1,24 +1,20 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
exports.__esModule = true;
|
4
|
-
exports.whichMigrations = whichMigrations;
|
5
|
-
var _migration = require("./migration.0-2");
|
6
|
-
var _migration2 = require("./migration.1-2");
|
1
|
+
import { migrate as V0_TO_V2 } from "./migration.0-2.js";
|
2
|
+
import { migrate as V1_TO_V2 } from "./migration.1-2.js";
|
7
3
|
/**
|
8
4
|
* Returns which migrations that should be run against your Object with the given version
|
9
5
|
* @param version
|
10
6
|
*/
|
11
|
-
function whichMigrations(version) {
|
7
|
+
export function whichMigrations(version) {
|
12
8
|
const migrations = new Set();
|
13
9
|
switch (version) {
|
14
10
|
case 0:
|
15
|
-
migrations.add(
|
11
|
+
migrations.add(V0_TO_V2);
|
16
12
|
/**
|
17
13
|
* we are skipping v1 entirely. If we weren't you would do migrations.add([V1_TO_V2, V2_TO_V3]) for example.
|
18
14
|
*/
|
19
15
|
break;
|
20
16
|
case 1:
|
21
|
-
migrations.add(
|
17
|
+
migrations.add(V1_TO_V2);
|
22
18
|
break;
|
23
19
|
}
|
24
20
|
return migrations;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"whichMigrations.js","names":["
|
1
|
+
{"version":3,"file":"whichMigrations.js","names":["migrate","V0_TO_V2","V1_TO_V2","whichMigrations","version","migrations","Set","add"],"sources":["../../../src/migration/whichMigrations.ts"],"sourcesContent":["import { migrate as V0_TO_V2 } from '~/src/migration/migration.0-2.js'\nimport { migrate as V1_TO_V2 } from '~/src/migration/migration.1-2.js'\nimport { type MigrationScript } from '~/src/migration/types.js'\n\n/**\n * Returns which migrations that should be run against your Object with the given version\n * @param version\n */\nexport function whichMigrations(version: number) {\n const migrations = new Set<MigrationScript>()\n switch (version) {\n case 0:\n migrations.add(V0_TO_V2)\n /**\n * we are skipping v1 entirely. If we weren't you would do migrations.add([V1_TO_V2, V2_TO_V3]) for example.\n */\n break\n case 1:\n migrations.add(V1_TO_V2)\n break\n }\n return migrations\n}\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,QAAQ;AAC5B,SAASD,OAAO,IAAIE,QAAQ;AAG5B;AACA;AACA;AACA;AACA,OAAO,SAASC,eAAeA,CAACC,OAAe,EAAE;EAC/C,MAAMC,UAAU,GAAG,IAAIC,GAAG,CAAkB,CAAC;EAC7C,QAAQF,OAAO;IACb,KAAK,CAAC;MACJC,UAAU,CAACE,GAAG,CAACN,QAAQ,CAAC;MACxB;AACN;AACA;MACM;IACF,KAAK,CAAC;MACJI,UAAU,CAACE,GAAG,CAACL,QAAQ,CAAC;MACxB;EACJ;EACA,OAAOG,UAAU;AACnB"}
|
@@ -1,17 +1,2 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
exports.__esModule = true;
|
4
|
-
Object.defineProperty(exports, "Schema", {
|
5
|
-
enumerable: true,
|
6
|
-
get: function () {
|
7
|
-
return _schema.Schema;
|
8
|
-
}
|
9
|
-
});
|
10
|
-
Object.defineProperty(exports, "componentSchema", {
|
11
|
-
enumerable: true,
|
12
|
-
get: function () {
|
13
|
-
return _schema.componentSchema;
|
14
|
-
}
|
15
|
-
});
|
16
|
-
var _schema = require("./schema");
|
1
|
+
export { Schema, componentSchema } from "./schema.js";
|
17
2
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","names":["
|
1
|
+
{"version":3,"file":"index.js","names":["Schema","componentSchema"],"sources":["../../../src/schema/index.ts"],"sourcesContent":["export { Schema, componentSchema } from '~/src/schema/schema.js'\n"],"mappings":"AAAA,SAASA,MAAM,EAAEC,eAAe"}
|