@defra/forms-model 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENCE +8 -0
- package/README.md +22 -0
- package/dist/browser/components/component-types.d.ts +3 -0
- package/dist/browser/components/component-types.d.ts.map +1 -0
- package/dist/browser/components/component-types.js +220 -0
- package/dist/browser/components/component-types.js.map +1 -0
- package/dist/browser/components/conditional-component-types.d.ts +3 -0
- package/dist/browser/components/conditional-component-types.d.ts.map +1 -0
- package/dist/browser/components/conditional-component-types.js +28 -0
- package/dist/browser/components/conditional-component-types.js.map +1 -0
- package/dist/browser/components/index.d.ts +4 -0
- package/dist/browser/components/index.d.ts.map +1 -0
- package/dist/browser/components/index.js +45 -0
- package/dist/browser/components/index.js.map +1 -0
- package/dist/browser/components/types.d.ts +244 -0
- package/dist/browser/components/types.d.ts.map +1 -0
- package/dist/browser/components/types.js +56 -0
- package/dist/browser/components/types.js.map +1 -0
- package/dist/browser/conditions/condition-abstract.d.ts +16 -0
- package/dist/browser/conditions/condition-abstract.d.ts.map +1 -0
- package/dist/browser/conditions/condition-abstract.js +62 -0
- package/dist/browser/conditions/condition-abstract.js.map +1 -0
- package/dist/browser/conditions/condition-field.d.ts +13 -0
- package/dist/browser/conditions/condition-field.d.ts.map +1 -0
- package/dist/browser/conditions/condition-field.js +45 -0
- package/dist/browser/conditions/condition-field.js.map +1 -0
- package/dist/browser/conditions/condition-group-def.d.ts +10 -0
- package/dist/browser/conditions/condition-group-def.d.ts.map +1 -0
- package/dist/browser/conditions/condition-group-def.js +45 -0
- package/dist/browser/conditions/condition-group-def.js.map +1 -0
- package/dist/browser/conditions/condition-group.d.ts +15 -0
- package/dist/browser/conditions/condition-group.d.ts.map +1 -0
- package/dist/browser/conditions/condition-group.js +64 -0
- package/dist/browser/conditions/condition-group.js.map +1 -0
- package/dist/browser/conditions/condition-model.d.ts +41 -0
- package/dist/browser/conditions/condition-model.d.ts.map +1 -0
- package/dist/browser/conditions/condition-model.js +214 -0
- package/dist/browser/conditions/condition-model.js.map +1 -0
- package/dist/browser/conditions/condition-operators.d.ts +248 -0
- package/dist/browser/conditions/condition-operators.d.ts.map +1 -0
- package/dist/browser/conditions/condition-operators.js +132 -0
- package/dist/browser/conditions/condition-operators.js.map +1 -0
- package/dist/browser/conditions/condition-ref.d.ts +12 -0
- package/dist/browser/conditions/condition-ref.d.ts.map +1 -0
- package/dist/browser/conditions/condition-ref.js +51 -0
- package/dist/browser/conditions/condition-ref.js.map +1 -0
- package/dist/browser/conditions/condition-value-abstract.d.ts +8 -0
- package/dist/browser/conditions/condition-value-abstract.d.ts.map +1 -0
- package/dist/browser/conditions/condition-value-abstract.js +41 -0
- package/dist/browser/conditions/condition-value-abstract.js.map +1 -0
- package/dist/browser/conditions/condition-value-registration.d.ts +10 -0
- package/dist/browser/conditions/condition-value-registration.d.ts.map +1 -0
- package/dist/browser/conditions/condition-value-registration.js +37 -0
- package/dist/browser/conditions/condition-value-registration.js.map +1 -0
- package/dist/browser/conditions/condition-values.d.ts +38 -0
- package/dist/browser/conditions/condition-values.d.ts.map +1 -0
- package/dist/browser/conditions/condition-values.js +127 -0
- package/dist/browser/conditions/condition-values.js.map +1 -0
- package/dist/browser/conditions/condition.d.ts +15 -0
- package/dist/browser/conditions/condition.d.ts.map +1 -0
- package/dist/browser/conditions/condition.js +56 -0
- package/dist/browser/conditions/condition.js.map +1 -0
- package/dist/browser/conditions/helpers.d.ts +3 -0
- package/dist/browser/conditions/helpers.d.ts.map +1 -0
- package/dist/browser/conditions/helpers.js +26 -0
- package/dist/browser/conditions/helpers.js.map +1 -0
- package/dist/browser/conditions/index.d.ts +11 -0
- package/dist/browser/conditions/index.d.ts.map +1 -0
- package/dist/browser/conditions/index.js +144 -0
- package/dist/browser/conditions/index.js.map +1 -0
- package/dist/browser/conditions/inline-condition-model.d.ts +86 -0
- package/dist/browser/conditions/inline-condition-model.d.ts.map +1 -0
- package/dist/browser/conditions/inline-condition-model.js +418 -0
- package/dist/browser/conditions/inline-condition-model.js.map +1 -0
- package/dist/browser/conditions/inline-condition-operators.d.ts +175 -0
- package/dist/browser/conditions/inline-condition-operators.d.ts.map +1 -0
- package/dist/browser/conditions/inline-condition-operators.js +132 -0
- package/dist/browser/conditions/inline-condition-operators.js.map +1 -0
- package/dist/browser/conditions/inline-condition-values.d.ts +93 -0
- package/dist/browser/conditions/inline-condition-values.d.ts.map +1 -0
- package/dist/browser/conditions/inline-condition-values.js +159 -0
- package/dist/browser/conditions/inline-condition-values.js.map +1 -0
- package/dist/browser/conditions/types.d.ts +38 -0
- package/dist/browser/conditions/types.d.ts.map +1 -0
- package/dist/browser/conditions/types.js +24 -0
- package/dist/browser/conditions/types.js.map +1 -0
- package/dist/browser/data-model/conditions-wrapper.d.ts +19 -0
- package/dist/browser/data-model/conditions-wrapper.d.ts.map +1 -0
- package/dist/browser/data-model/conditions-wrapper.js +49 -0
- package/dist/browser/data-model/conditions-wrapper.js.map +1 -0
- package/dist/browser/data-model/index.d.ts +4 -0
- package/dist/browser/data-model/index.d.ts.map +1 -0
- package/dist/browser/data-model/index.js +66 -0
- package/dist/browser/data-model/index.js.map +1 -0
- package/dist/browser/data-model/input-wrapper.d.ts +16 -0
- package/dist/browser/data-model/input-wrapper.d.ts.map +1 -0
- package/dist/browser/data-model/input-wrapper.js +49 -0
- package/dist/browser/data-model/input-wrapper.js.map +1 -0
- package/dist/browser/data-model/types.d.ts +153 -0
- package/dist/browser/data-model/types.d.ts.map +1 -0
- package/dist/browser/data-model/types.js +34 -0
- package/dist/browser/data-model/types.js.map +1 -0
- package/dist/browser/form/form-configuration.d.ts +8 -0
- package/dist/browser/form/form-configuration.d.ts.map +1 -0
- package/dist/browser/form/form-configuration.js +38 -0
- package/dist/browser/form/form-configuration.js.map +1 -0
- package/dist/browser/form/index.d.ts +2 -0
- package/dist/browser/form/index.d.ts.map +1 -0
- package/dist/browser/form/index.js +24 -0
- package/dist/browser/form/index.js.map +1 -0
- package/dist/browser/index.d.ts +12 -0
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.js +138 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/browser/migration/index.d.ts +2 -0
- package/dist/browser/migration/index.d.ts.map +1 -0
- package/dist/browser/migration/index.js +24 -0
- package/dist/browser/migration/index.js.map +1 -0
- package/dist/browser/migration/migration.0-2.d.ts +3 -0
- package/dist/browser/migration/migration.0-2.d.ts.map +1 -0
- package/dist/browser/migration/migration.0-2.js +65 -0
- package/dist/browser/migration/migration.0-2.js.map +1 -0
- package/dist/browser/migration/migration.1-2.d.ts +3 -0
- package/dist/browser/migration/migration.1-2.d.ts.map +1 -0
- package/dist/browser/migration/migration.1-2.js +108 -0
- package/dist/browser/migration/migration.1-2.js.map +1 -0
- package/dist/browser/migration/types.d.ts +2 -0
- package/dist/browser/migration/types.d.ts.map +1 -0
- package/dist/browser/migration/types.js +16 -0
- package/dist/browser/migration/types.js.map +1 -0
- package/dist/browser/migration/whichMigrations.d.ts +7 -0
- package/dist/browser/migration/whichMigrations.d.ts.map +1 -0
- package/dist/browser/migration/whichMigrations.js +38 -0
- package/dist/browser/migration/whichMigrations.js.map +1 -0
- package/dist/browser/schema/index.d.ts +2 -0
- package/dist/browser/schema/index.d.ts.map +1 -0
- package/dist/browser/schema/index.js +30 -0
- package/dist/browser/schema/index.js.map +1 -0
- package/dist/browser/schema/schema.d.ts +20 -0
- package/dist/browser/schema/schema.d.ts.map +1 -0
- package/dist/browser/schema/schema.js +255 -0
- package/dist/browser/schema/schema.js.map +1 -0
- package/dist/browser/utils/helpers.d.ts +9 -0
- package/dist/browser/utils/helpers.d.ts.map +1 -0
- package/dist/browser/utils/helpers.js +48 -0
- package/dist/browser/utils/helpers.js.map +1 -0
- package/dist/browser/utils/logger.d.ts +11 -0
- package/dist/browser/utils/logger.d.ts.map +1 -0
- package/dist/browser/utils/logger.js +46 -0
- package/dist/browser/utils/logger.js.map +1 -0
- package/dist/module/components/component-types.d.ts +3 -0
- package/dist/module/components/component-types.d.ts.map +1 -0
- package/dist/module/components/component-types.js +206 -0
- package/dist/module/components/component-types.js.map +1 -0
- package/dist/module/components/conditional-component-types.d.ts +3 -0
- package/dist/module/components/conditional-component-types.d.ts.map +1 -0
- package/dist/module/components/conditional-component-types.js +14 -0
- package/dist/module/components/conditional-component-types.js.map +1 -0
- package/dist/module/components/index.d.ts +4 -0
- package/dist/module/components/index.d.ts.map +1 -0
- package/dist/module/components/index.js +34 -0
- package/dist/module/components/index.js.map +1 -0
- package/dist/module/components/types.d.ts +244 -0
- package/dist/module/components/types.d.ts.map +1 -0
- package/dist/module/components/types.js +42 -0
- package/dist/module/components/types.js.map +1 -0
- package/dist/module/conditions/condition-abstract.d.ts +16 -0
- package/dist/module/conditions/condition-abstract.d.ts.map +1 -0
- package/dist/module/conditions/condition-abstract.js +45 -0
- package/dist/module/conditions/condition-abstract.js.map +1 -0
- package/dist/module/conditions/condition-field.d.ts +13 -0
- package/dist/module/conditions/condition-field.d.ts.map +1 -0
- package/dist/module/conditions/condition-field.js +26 -0
- package/dist/module/conditions/condition-field.js.map +1 -0
- package/dist/module/conditions/condition-group-def.d.ts +10 -0
- package/dist/module/conditions/condition-group-def.d.ts.map +1 -0
- package/dist/module/conditions/condition-group-def.js +26 -0
- package/dist/module/conditions/condition-group-def.js.map +1 -0
- package/dist/module/conditions/condition-group.d.ts +15 -0
- package/dist/module/conditions/condition-group.d.ts.map +1 -0
- package/dist/module/conditions/condition-group.js +47 -0
- package/dist/module/conditions/condition-group.js.map +1 -0
- package/dist/module/conditions/condition-model.d.ts +41 -0
- package/dist/module/conditions/condition-model.d.ts.map +1 -0
- package/dist/module/conditions/condition-model.js +199 -0
- package/dist/module/conditions/condition-model.js.map +1 -0
- package/dist/module/conditions/condition-operators.d.ts +248 -0
- package/dist/module/conditions/condition-operators.d.ts.map +1 -0
- package/dist/module/conditions/condition-operators.js +119 -0
- package/dist/module/conditions/condition-operators.js.map +1 -0
- package/dist/module/conditions/condition-ref.d.ts +12 -0
- package/dist/module/conditions/condition-ref.d.ts.map +1 -0
- package/dist/module/conditions/condition-ref.js +33 -0
- package/dist/module/conditions/condition-ref.js.map +1 -0
- package/dist/module/conditions/condition-value-abstract.d.ts +8 -0
- package/dist/module/conditions/condition-value-abstract.d.ts.map +1 -0
- package/dist/module/conditions/condition-value-abstract.js +24 -0
- package/dist/module/conditions/condition-value-abstract.js.map +1 -0
- package/dist/module/conditions/condition-value-registration.d.ts +10 -0
- package/dist/module/conditions/condition-value-registration.d.ts.map +1 -0
- package/dist/module/conditions/condition-value-registration.js +19 -0
- package/dist/module/conditions/condition-value-registration.js.map +1 -0
- package/dist/module/conditions/condition-values.d.ts +38 -0
- package/dist/module/conditions/condition-values.d.ts.map +1 -0
- package/dist/module/conditions/condition-values.js +106 -0
- package/dist/module/conditions/condition-values.js.map +1 -0
- package/dist/module/conditions/condition.d.ts +15 -0
- package/dist/module/conditions/condition.d.ts.map +1 -0
- package/dist/module/conditions/condition.js +40 -0
- package/dist/module/conditions/condition.js.map +1 -0
- package/dist/module/conditions/helpers.d.ts +3 -0
- package/dist/module/conditions/helpers.d.ts.map +1 -0
- package/dist/module/conditions/helpers.js +12 -0
- package/dist/module/conditions/helpers.js.map +1 -0
- package/dist/module/conditions/index.d.ts +11 -0
- package/dist/module/conditions/index.d.ts.map +1 -0
- package/dist/module/conditions/index.js +140 -0
- package/dist/module/conditions/index.js.map +1 -0
- package/dist/module/conditions/inline-condition-model.d.ts +86 -0
- package/dist/module/conditions/inline-condition-model.d.ts.map +1 -0
- package/dist/module/conditions/inline-condition-model.js +384 -0
- package/dist/module/conditions/inline-condition-model.js.map +1 -0
- package/dist/module/conditions/inline-condition-operators.d.ts +175 -0
- package/dist/module/conditions/inline-condition-operators.d.ts.map +1 -0
- package/dist/module/conditions/inline-condition-operators.js +119 -0
- package/dist/module/conditions/inline-condition-operators.js.map +1 -0
- package/dist/module/conditions/inline-condition-values.d.ts +93 -0
- package/dist/module/conditions/inline-condition-values.d.ts.map +1 -0
- package/dist/module/conditions/inline-condition-values.js +134 -0
- package/dist/module/conditions/inline-condition-values.js.map +1 -0
- package/dist/module/conditions/types.d.ts +38 -0
- package/dist/module/conditions/types.d.ts.map +1 -0
- package/dist/module/conditions/types.js +10 -0
- package/dist/module/conditions/types.js.map +1 -0
- package/dist/module/data-model/conditions-wrapper.d.ts +19 -0
- package/dist/module/data-model/conditions-wrapper.d.ts.map +1 -0
- package/dist/module/data-model/conditions-wrapper.js +30 -0
- package/dist/module/data-model/conditions-wrapper.js.map +1 -0
- package/dist/module/data-model/index.d.ts +4 -0
- package/dist/module/data-model/index.d.ts.map +1 -0
- package/dist/module/data-model/index.js +55 -0
- package/dist/module/data-model/index.js.map +1 -0
- package/dist/module/data-model/input-wrapper.d.ts +16 -0
- package/dist/module/data-model/input-wrapper.d.ts.map +1 -0
- package/dist/module/data-model/input-wrapper.js +25 -0
- package/dist/module/data-model/input-wrapper.js.map +1 -0
- package/dist/module/data-model/types.d.ts +153 -0
- package/dist/module/data-model/types.d.ts.map +1 -0
- package/dist/module/data-model/types.js +20 -0
- package/dist/module/data-model/types.js.map +1 -0
- package/dist/module/form/form-configuration.d.ts +8 -0
- package/dist/module/form/form-configuration.d.ts.map +1 -0
- package/dist/module/form/form-configuration.js +17 -0
- package/dist/module/form/form-configuration.js.map +1 -0
- package/dist/module/form/index.d.ts +2 -0
- package/dist/module/form/index.d.ts.map +1 -0
- package/dist/module/form/index.js +11 -0
- package/dist/module/form/index.js.map +1 -0
- package/dist/module/index.d.ts +12 -0
- package/dist/module/index.d.ts.map +1 -0
- package/dist/module/index.js +135 -0
- package/dist/module/index.js.map +1 -0
- package/dist/module/migration/index.d.ts +2 -0
- package/dist/module/migration/index.d.ts.map +1 -0
- package/dist/module/migration/index.js +11 -0
- package/dist/module/migration/index.js.map +1 -0
- package/dist/module/migration/migration.0-2.d.ts +3 -0
- package/dist/module/migration/migration.0-2.d.ts.map +1 -0
- package/dist/module/migration/migration.0-2.js +42 -0
- package/dist/module/migration/migration.0-2.js.map +1 -0
- package/dist/module/migration/migration.1-2.d.ts +3 -0
- package/dist/module/migration/migration.1-2.d.ts.map +1 -0
- package/dist/module/migration/migration.1-2.js +90 -0
- package/dist/module/migration/migration.1-2.js.map +1 -0
- package/dist/module/migration/types.d.ts +2 -0
- package/dist/module/migration/types.d.ts.map +1 -0
- package/dist/module/migration/types.js +1 -0
- package/dist/module/migration/types.js.map +1 -0
- package/dist/module/migration/whichMigrations.d.ts +7 -0
- package/dist/module/migration/whichMigrations.d.ts.map +1 -0
- package/dist/module/migration/whichMigrations.js +26 -0
- package/dist/module/migration/whichMigrations.js.map +1 -0
- package/dist/module/schema/index.d.ts +2 -0
- package/dist/module/schema/index.d.ts.map +1 -0
- package/dist/module/schema/index.js +17 -0
- package/dist/module/schema/index.js.map +1 -0
- package/dist/module/schema/schema.d.ts +20 -0
- package/dist/module/schema/schema.d.ts.map +1 -0
- package/dist/module/schema/schema.js +239 -0
- package/dist/module/schema/schema.js.map +1 -0
- package/dist/module/utils/helpers.d.ts +9 -0
- package/dist/module/utils/helpers.d.ts.map +1 -0
- package/dist/module/utils/helpers.js +35 -0
- package/dist/module/utils/helpers.js.map +1 -0
- package/dist/module/utils/logger.d.ts +11 -0
- package/dist/module/utils/logger.d.ts.map +1 -0
- package/dist/module/utils/logger.js +27 -0
- package/dist/module/utils/logger.js.map +1 -0
- package/package.json +35 -0
- package/src/components/component-types.ts +229 -0
- package/src/components/conditional-component-types.ts +14 -0
- package/src/components/index.ts +3 -0
- package/src/components/types.ts +362 -0
- package/src/conditions/condition-abstract.ts +59 -0
- package/src/conditions/condition-field.ts +29 -0
- package/src/conditions/condition-group-def.ts +29 -0
- package/src/conditions/condition-group.ts +61 -0
- package/src/conditions/condition-model.ts +314 -0
- package/src/conditions/condition-operators.ts +176 -0
- package/src/conditions/condition-ref.ts +47 -0
- package/src/conditions/condition-value-abstract.ts +31 -0
- package/src/conditions/condition-value-registration.ts +18 -0
- package/src/conditions/condition-values.ts +146 -0
- package/src/conditions/condition.ts +64 -0
- package/src/conditions/helpers.ts +7 -0
- package/src/conditions/index.ts +27 -0
- package/src/conditions/inline-condition-model.ts +550 -0
- package/src/conditions/inline-condition-operators.ts +166 -0
- package/src/conditions/inline-condition-values.ts +153 -0
- package/src/conditions/types.ts +30 -0
- package/src/data-model/conditions-wrapper.ts +42 -0
- package/src/data-model/index.ts +3 -0
- package/src/data-model/input-wrapper.ts +40 -0
- package/src/data-model/types.ts +179 -0
- package/src/form/form-configuration.ts +21 -0
- package/src/form/index.ts +1 -0
- package/src/index.ts +11 -0
- package/src/migration/index.ts +1 -0
- package/src/migration/migration.0-2.ts +29 -0
- package/src/migration/migration.1-2.ts +105 -0
- package/src/migration/types.ts +1 -0
- package/src/migration/whichMigrations.ts +23 -0
- package/src/schema/index.ts +1 -0
- package/src/schema/schema.ts +300 -0
- package/src/utils/helpers.ts +37 -0
- package/src/utils/logger.ts +29 -0
@@ -0,0 +1,12 @@
|
|
1
|
+
export { Schema, componentSchema } from './schema';
|
2
|
+
export { ConditionRawData, ConditionsWrapper } from './data-model';
|
3
|
+
export { Logger } from './utils/logger';
|
4
|
+
export { FormConfiguration } from './form';
|
5
|
+
export { ComponentTypes, ConditionalComponentTypes } from './components';
|
6
|
+
export * from './components/types';
|
7
|
+
export * from './conditions';
|
8
|
+
export * from './utils/helpers';
|
9
|
+
export * from './migration';
|
10
|
+
export * from './data-model/types';
|
11
|
+
export { whichMigrations } from './migration/whichMigrations';
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAClD,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAA;AAC1C,OAAO,EAAE,cAAc,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAA;AACxE,cAAc,oBAAoB,CAAA;AAClC,cAAc,cAAc,CAAA;AAC5B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,aAAa,CAAA;AAC3B,cAAc,oBAAoB,CAAA;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA"}
|
@@ -0,0 +1,138 @@
|
|
1
|
+
(function (global, factory) {
|
2
|
+
if (typeof define === "function" && define.amd) {
|
3
|
+
define(["exports", "./schema", "./data-model", "./utils/logger", "./form", "./components", "./components/types", "./conditions", "./utils/helpers", "./migration", "./data-model/types", "./migration/whichMigrations"], factory);
|
4
|
+
} else if (typeof exports !== "undefined") {
|
5
|
+
factory(exports, require("./schema"), require("./data-model"), require("./utils/logger"), require("./form"), require("./components"), require("./components/types"), require("./conditions"), require("./utils/helpers"), require("./migration"), require("./data-model/types"), require("./migration/whichMigrations"));
|
6
|
+
} else {
|
7
|
+
var mod = {
|
8
|
+
exports: {}
|
9
|
+
};
|
10
|
+
factory(mod.exports, global.schema, global.dataModel, global.logger, global.form, global.components, global.types, global.conditions, global.helpers, global.migration, global.types, global.whichMigrations);
|
11
|
+
global.index = mod.exports;
|
12
|
+
}
|
13
|
+
})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _schema, _dataModel, _logger, _form, _components, _types, _conditions, _helpers, _migration, _types2, _whichMigrations) {
|
14
|
+
"use strict";
|
15
|
+
|
16
|
+
_exports.__esModule = true;
|
17
|
+
var _exportNames = {
|
18
|
+
Schema: true,
|
19
|
+
componentSchema: true,
|
20
|
+
ConditionRawData: true,
|
21
|
+
ConditionsWrapper: true,
|
22
|
+
Logger: true,
|
23
|
+
FormConfiguration: true,
|
24
|
+
ComponentTypes: true,
|
25
|
+
ConditionalComponentTypes: true,
|
26
|
+
whichMigrations: true
|
27
|
+
};
|
28
|
+
Object.defineProperty(_exports, "ComponentTypes", {
|
29
|
+
enumerable: true,
|
30
|
+
get: function () {
|
31
|
+
return _components.ComponentTypes;
|
32
|
+
}
|
33
|
+
});
|
34
|
+
Object.defineProperty(_exports, "ConditionRawData", {
|
35
|
+
enumerable: true,
|
36
|
+
get: function () {
|
37
|
+
return _dataModel.ConditionRawData;
|
38
|
+
}
|
39
|
+
});
|
40
|
+
Object.defineProperty(_exports, "ConditionalComponentTypes", {
|
41
|
+
enumerable: true,
|
42
|
+
get: function () {
|
43
|
+
return _components.ConditionalComponentTypes;
|
44
|
+
}
|
45
|
+
});
|
46
|
+
Object.defineProperty(_exports, "ConditionsWrapper", {
|
47
|
+
enumerable: true,
|
48
|
+
get: function () {
|
49
|
+
return _dataModel.ConditionsWrapper;
|
50
|
+
}
|
51
|
+
});
|
52
|
+
Object.defineProperty(_exports, "FormConfiguration", {
|
53
|
+
enumerable: true,
|
54
|
+
get: function () {
|
55
|
+
return _form.FormConfiguration;
|
56
|
+
}
|
57
|
+
});
|
58
|
+
Object.defineProperty(_exports, "Logger", {
|
59
|
+
enumerable: true,
|
60
|
+
get: function () {
|
61
|
+
return _logger.Logger;
|
62
|
+
}
|
63
|
+
});
|
64
|
+
Object.defineProperty(_exports, "Schema", {
|
65
|
+
enumerable: true,
|
66
|
+
get: function () {
|
67
|
+
return _schema.Schema;
|
68
|
+
}
|
69
|
+
});
|
70
|
+
Object.defineProperty(_exports, "componentSchema", {
|
71
|
+
enumerable: true,
|
72
|
+
get: function () {
|
73
|
+
return _schema.componentSchema;
|
74
|
+
}
|
75
|
+
});
|
76
|
+
Object.defineProperty(_exports, "whichMigrations", {
|
77
|
+
enumerable: true,
|
78
|
+
get: function () {
|
79
|
+
return _whichMigrations.whichMigrations;
|
80
|
+
}
|
81
|
+
});
|
82
|
+
Object.keys(_types).forEach(function (key) {
|
83
|
+
if (key === "default" || key === "__esModule") return;
|
84
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
85
|
+
if (key in _exports && _exports[key] === _types[key]) return;
|
86
|
+
Object.defineProperty(_exports, key, {
|
87
|
+
enumerable: true,
|
88
|
+
get: function () {
|
89
|
+
return _types[key];
|
90
|
+
}
|
91
|
+
});
|
92
|
+
});
|
93
|
+
Object.keys(_conditions).forEach(function (key) {
|
94
|
+
if (key === "default" || key === "__esModule") return;
|
95
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
96
|
+
if (key in _exports && _exports[key] === _conditions[key]) return;
|
97
|
+
Object.defineProperty(_exports, key, {
|
98
|
+
enumerable: true,
|
99
|
+
get: function () {
|
100
|
+
return _conditions[key];
|
101
|
+
}
|
102
|
+
});
|
103
|
+
});
|
104
|
+
Object.keys(_helpers).forEach(function (key) {
|
105
|
+
if (key === "default" || key === "__esModule") return;
|
106
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
107
|
+
if (key in _exports && _exports[key] === _helpers[key]) return;
|
108
|
+
Object.defineProperty(_exports, key, {
|
109
|
+
enumerable: true,
|
110
|
+
get: function () {
|
111
|
+
return _helpers[key];
|
112
|
+
}
|
113
|
+
});
|
114
|
+
});
|
115
|
+
Object.keys(_migration).forEach(function (key) {
|
116
|
+
if (key === "default" || key === "__esModule") return;
|
117
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
118
|
+
if (key in _exports && _exports[key] === _migration[key]) return;
|
119
|
+
Object.defineProperty(_exports, key, {
|
120
|
+
enumerable: true,
|
121
|
+
get: function () {
|
122
|
+
return _migration[key];
|
123
|
+
}
|
124
|
+
});
|
125
|
+
});
|
126
|
+
Object.keys(_types2).forEach(function (key) {
|
127
|
+
if (key === "default" || key === "__esModule") return;
|
128
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
129
|
+
if (key in _exports && _exports[key] === _types2[key]) return;
|
130
|
+
Object.defineProperty(_exports, key, {
|
131
|
+
enumerable: true,
|
132
|
+
get: function () {
|
133
|
+
return _types2[key];
|
134
|
+
}
|
135
|
+
});
|
136
|
+
});
|
137
|
+
});
|
138
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","names":["Object","keys","_types","forEach","key","prototype","hasOwnProperty","call","_exportNames","_exports","defineProperty","enumerable","get","_conditions","_helpers","_migration","_types2"],"sources":["../../src/index.ts"],"sourcesContent":["export { Schema, componentSchema } from './schema'\nexport { ConditionRawData, ConditionsWrapper } from './data-model'\nexport { Logger } from './utils/logger'\nexport { FormConfiguration } from './form'\nexport { ComponentTypes, ConditionalComponentTypes } from './components'\nexport * from './components/types'\nexport * from './conditions'\nexport * from './utils/helpers'\nexport * from './migration'\nexport * from './data-model/types'\nexport { whichMigrations } from './migration/whichMigrations'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKAA,MAAA,CAAAC,IAAA,CAAAC,MAAA,EAAAC,OAAA,WAAAC,GAAA;IAAA,IAAAA,GAAA,kBAAAA,GAAA;IAAA,IAAAJ,MAAA,CAAAK,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;IAAA,IAAAA,GAAA,IAAAK,QAAA,IAAAA,QAAA,CAAAL,GAAA,MAAAF,MAAA,CAAAE,GAAA;IAAAJ,MAAA,CAAAU,cAAA,CAAAD,QAAA,EAAAL,GAAA;MAAAO,UAAA;MAAAC,GAAA,WAAAA,CAAA;QAAA,OAAAV,MAAA,CAAAE,GAAA;MAAA;IAAA;EAAA;EACAJ,MAAA,CAAAC,IAAA,CAAAY,WAAA,EAAAV,OAAA,WAAAC,GAAA;IAAA,IAAAA,GAAA,kBAAAA,GAAA;IAAA,IAAAJ,MAAA,CAAAK,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;IAAA,IAAAA,GAAA,IAAAK,QAAA,IAAAA,QAAA,CAAAL,GAAA,MAAAS,WAAA,CAAAT,GAAA;IAAAJ,MAAA,CAAAU,cAAA,CAAAD,QAAA,EAAAL,GAAA;MAAAO,UAAA;MAAAC,GAAA,WAAAA,CAAA;QAAA,OAAAC,WAAA,CAAAT,GAAA;MAAA;IAAA;EAAA;EACAJ,MAAA,CAAAC,IAAA,CAAAa,QAAA,EAAAX,OAAA,WAAAC,GAAA;IAAA,IAAAA,GAAA,kBAAAA,GAAA;IAAA,IAAAJ,MAAA,CAAAK,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;IAAA,IAAAA,GAAA,IAAAK,QAAA,IAAAA,QAAA,CAAAL,GAAA,MAAAU,QAAA,CAAAV,GAAA;IAAAJ,MAAA,CAAAU,cAAA,CAAAD,QAAA,EAAAL,GAAA;MAAAO,UAAA;MAAAC,GAAA,WAAAA,CAAA;QAAA,OAAAE,QAAA,CAAAV,GAAA;MAAA;IAAA;EAAA;EACAJ,MAAA,CAAAC,IAAA,CAAAc,UAAA,EAAAZ,OAAA,WAAAC,GAAA;IAAA,IAAAA,GAAA,kBAAAA,GAAA;IAAA,IAAAJ,MAAA,CAAAK,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;IAAA,IAAAA,GAAA,IAAAK,QAAA,IAAAA,QAAA,CAAAL,GAAA,MAAAW,UAAA,CAAAX,GAAA;IAAAJ,MAAA,CAAAU,cAAA,CAAAD,QAAA,EAAAL,GAAA;MAAAO,UAAA;MAAAC,GAAA,WAAAA,CAAA;QAAA,OAAAG,UAAA,CAAAX,GAAA;MAAA;IAAA;EAAA;EACAJ,MAAA,CAAAC,IAAA,CAAAe,OAAA,EAAAb,OAAA,WAAAC,GAAA;IAAA,IAAAA,GAAA,kBAAAA,GAAA;IAAA,IAAAJ,MAAA,CAAAK,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;IAAA,IAAAA,GAAA,IAAAK,QAAA,IAAAA,QAAA,CAAAL,GAAA,MAAAY,OAAA,CAAAZ,GAAA;IAAAJ,MAAA,CAAAU,cAAA,CAAAD,QAAA,EAAAL,GAAA;MAAAO,UAAA;MAAAC,GAAA,WAAAA,CAAA;QAAA,OAAAI,OAAA,CAAAZ,GAAA;MAAA;IAAA;EAAA;AAAkC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/migration/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA"}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
(function (global, factory) {
|
2
|
+
if (typeof define === "function" && define.amd) {
|
3
|
+
define(["exports", "./whichMigrations"], factory);
|
4
|
+
} else if (typeof exports !== "undefined") {
|
5
|
+
factory(exports, require("./whichMigrations"));
|
6
|
+
} else {
|
7
|
+
var mod = {
|
8
|
+
exports: {}
|
9
|
+
};
|
10
|
+
factory(mod.exports, global.whichMigrations);
|
11
|
+
global.index = mod.exports;
|
12
|
+
}
|
13
|
+
})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _whichMigrations) {
|
14
|
+
"use strict";
|
15
|
+
|
16
|
+
_exports.__esModule = true;
|
17
|
+
Object.defineProperty(_exports, "whichMigrations", {
|
18
|
+
enumerable: true,
|
19
|
+
get: function () {
|
20
|
+
return _whichMigrations.whichMigrations;
|
21
|
+
}
|
22
|
+
});
|
23
|
+
});
|
24
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/migration/index.ts"],"sourcesContent":["export { whichMigrations } from './whichMigrations'\n"],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"migration.0-2.d.ts","sourceRoot":"","sources":["../../../src/migration/migration.0-2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAQzC,wBAAgB,OAAO,CAAC,IAAI,KAAA,GAAG,eAAe,CAoB7C"}
|
@@ -0,0 +1,65 @@
|
|
1
|
+
(function (global, factory) {
|
2
|
+
if (typeof define === "function" && define.amd) {
|
3
|
+
define(["exports"], factory);
|
4
|
+
} else if (typeof exports !== "undefined") {
|
5
|
+
factory(exports);
|
6
|
+
} else {
|
7
|
+
var mod = {
|
8
|
+
exports: {}
|
9
|
+
};
|
10
|
+
factory(mod.exports);
|
11
|
+
global.migration02 = mod.exports;
|
12
|
+
}
|
13
|
+
})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports) {
|
14
|
+
"use strict";
|
15
|
+
|
16
|
+
_exports.__esModule = true;
|
17
|
+
_exports.migrate = migrate;
|
18
|
+
const _excluded = ["list"];
|
19
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
20
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
21
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
22
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
23
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
24
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
25
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
26
|
+
function needsUpgrade(data) {
|
27
|
+
var _data$pages;
|
28
|
+
return !!((_data$pages = data.pages) !== null && _data$pages !== void 0 ? _data$pages : []).flatMap(page => page.components).find(component => {
|
29
|
+
var _component$options;
|
30
|
+
return (_component$options = component.options) === null || _component$options === void 0 ? void 0 : _component$options.list;
|
31
|
+
});
|
32
|
+
}
|
33
|
+
function migrate(data) {
|
34
|
+
if (!needsUpgrade(data)) {
|
35
|
+
return _objectSpread(_objectSpread({}, data), {}, {
|
36
|
+
version: 2
|
37
|
+
});
|
38
|
+
}
|
39
|
+
const {
|
40
|
+
pages
|
41
|
+
} = data;
|
42
|
+
const newPages = pages.flatMap(page => {
|
43
|
+
return page.components.map(component => {
|
44
|
+
var _component$options2;
|
45
|
+
if (!((_component$options2 = component.options) !== null && _component$options2 !== void 0 && _component$options2.list)) {
|
46
|
+
return component;
|
47
|
+
}
|
48
|
+
const _component$options3 = component.options,
|
49
|
+
{
|
50
|
+
list
|
51
|
+
} = _component$options3,
|
52
|
+
rest = _objectWithoutProperties(_component$options3, _excluded);
|
53
|
+
return _objectSpread(_objectSpread({}, component), {}, {
|
54
|
+
list,
|
55
|
+
options: _objectSpread({}, rest)
|
56
|
+
});
|
57
|
+
});
|
58
|
+
});
|
59
|
+
return _objectSpread(_objectSpread({}, data), {}, {
|
60
|
+
pages: newPages,
|
61
|
+
version: 2
|
62
|
+
});
|
63
|
+
}
|
64
|
+
});
|
65
|
+
//# sourceMappingURL=migration.0-2.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"migration.0-2.js","names":["needsUpgrade","data","_data$pages","pages","flatMap","page","components","find","component","_component$options","options","list","migrate","_objectSpread","version","newPages","map","_component$options2","_component$options3","rest","_objectWithoutProperties","_excluded"],"sources":["../../../src/migration/migration.0-2.ts"],"sourcesContent":["import { MigrationScript } from './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":";;;;;;;;;;;;;;;;;;;;;;;;;EAEA,SAASA,YAAYA,CAACC,IAAI,EAAE;IAAA,IAAAC,WAAA;IAC1B,OAAO,CAAC,CAAC,EAAAA,WAAA,GAACD,IAAI,CAACE,KAAK,cAAAD,WAAA,cAAAA,WAAA,GAAI,EAAE,EACvBE,OAAO,CAAEC,IAAI,IAAKA,IAAI,CAACC,UAAU,CAAC,CAClCC,IAAI,CAAEC,SAAS;MAAA,IAAAC,kBAAA;MAAA,QAAAA,kBAAA,GAAKD,SAAS,CAACE,OAAO,cAAAD,kBAAA,uBAAjBA,kBAAA,CAAmBE,IAAI;IAAA,EAAC;EACjD;EAEO,SAASC,OAAOA,CAACX,IAAI,EAAmB;IAC7C,IAAI,CAACD,YAAY,CAACC,IAAI,CAAC,EAAE;MACvB,OAAAY,aAAA,CAAAA,aAAA,KAAYZ,IAAI;QAAEa,OAAO,EAAE;MAAC;IAC9B;IACA,MAAM;MAAEX;IAAM,CAAC,GAAGF,IAAI;IACtB,MAAMc,QAAQ,GAAGZ,KAAK,CAACC,OAAO,CAAEC,IAAI,IAAK;MACvC,OAAOA,IAAI,CAACC,UAAU,CAACU,GAAG,CAAER,SAAS,IAAK;QAAA,IAAAS,mBAAA;QACxC,IAAI,GAAAA,mBAAA,GAACT,SAAS,CAACE,OAAO,cAAAO,mBAAA,eAAjBA,mBAAA,CAAmBN,IAAI,GAAE;UAC5B,OAAOH,SAAS;QAClB;QACA,MAAAU,mBAAA,GAA0BV,SAAS,CAACE,OAAO;UAArC;YAAEC;UAAc,CAAC,GAAAO,mBAAA;UAANC,IAAI,GAAAC,wBAAA,CAAAF,mBAAA,EAAAG,SAAA;QACrB,OAAAR,aAAA,CAAAA,aAAA,KAAYL,SAAS;UAAEG,IAAI;UAAED,OAAO,EAAAG,aAAA,KAAOM,IAAI;QAAE;MACnD,CAAC,CAAC;IACJ,CAAC,CAAC;IAEF,OAAAN,aAAA,CAAAA,aAAA,KACKZ,IAAI;MACPE,KAAK,EAAEY,QAAQ;MACfD,OAAO,EAAE;IAAC;EAEd;AAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"migration.1-2.d.ts","sourceRoot":"","sources":["../../../src/migration/migration.1-2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAiFzC,wBAAgB,OAAO,CAAC,IAAI,KAAA,GAAG,eAAe,CAuB7C"}
|
@@ -0,0 +1,108 @@
|
|
1
|
+
(function (global, factory) {
|
2
|
+
if (typeof define === "function" && define.amd) {
|
3
|
+
define(["exports", "../utils/helpers"], factory);
|
4
|
+
} else if (typeof exports !== "undefined") {
|
5
|
+
factory(exports, require("../utils/helpers"));
|
6
|
+
} else {
|
7
|
+
var mod = {
|
8
|
+
exports: {}
|
9
|
+
};
|
10
|
+
factory(mod.exports, global.helpers);
|
11
|
+
global.migration12 = mod.exports;
|
12
|
+
}
|
13
|
+
})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _helpers) {
|
14
|
+
"use strict";
|
15
|
+
|
16
|
+
_exports.__esModule = true;
|
17
|
+
_exports.migrate = migrate;
|
18
|
+
const _excluded = ["values"];
|
19
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
20
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
21
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
22
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
23
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
24
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
25
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
26
|
+
/**
|
27
|
+
* @private
|
28
|
+
* StaticItem is a deprecated Type.
|
29
|
+
* It should only be used for aiding migration scripts.
|
30
|
+
*/
|
31
|
+
|
32
|
+
/**
|
33
|
+
* @private
|
34
|
+
* StaticComponentValues is a deprecated Type.
|
35
|
+
* It should only be used for aiding migration scripts.
|
36
|
+
*/
|
37
|
+
|
38
|
+
function recastItem({
|
39
|
+
label,
|
40
|
+
value,
|
41
|
+
condition,
|
42
|
+
hint
|
43
|
+
}) {
|
44
|
+
const item = {
|
45
|
+
title: label,
|
46
|
+
value
|
47
|
+
};
|
48
|
+
condition && (item.conditions = condition);
|
49
|
+
hint && (item.hint = hint);
|
50
|
+
return item;
|
51
|
+
}
|
52
|
+
function addListId(component) {
|
53
|
+
if (!component.values) {
|
54
|
+
return component;
|
55
|
+
}
|
56
|
+
const {
|
57
|
+
values
|
58
|
+
} = component;
|
59
|
+
return _objectSpread(_objectSpread({}, component), {}, {
|
60
|
+
list: values.type === 'listRef' ? values.list : (0, _helpers.nanoid)()
|
61
|
+
});
|
62
|
+
}
|
63
|
+
function migratePage(page) {
|
64
|
+
return _objectSpread(_objectSpread({}, page), {}, {
|
65
|
+
components: page.components.map(addListId)
|
66
|
+
});
|
67
|
+
}
|
68
|
+
function removeValues(page) {
|
69
|
+
return _objectSpread(_objectSpread({}, page), {}, {
|
70
|
+
components: page.components.map(component => {
|
71
|
+
const {
|
72
|
+
values
|
73
|
+
} = component,
|
74
|
+
rest = _objectWithoutProperties(component, _excluded);
|
75
|
+
return _objectSpread({}, rest);
|
76
|
+
})
|
77
|
+
});
|
78
|
+
}
|
79
|
+
function needsUpgrade(data) {
|
80
|
+
return !!data.pages.flatMap(page => page.components).find(component => component.values);
|
81
|
+
}
|
82
|
+
function migrate(data) {
|
83
|
+
var _data$lists;
|
84
|
+
if (!needsUpgrade(data)) {
|
85
|
+
return _objectSpread(_objectSpread({}, data), {}, {
|
86
|
+
version: 2
|
87
|
+
});
|
88
|
+
}
|
89
|
+
const pages = data.pages.map(migratePage);
|
90
|
+
const componentsWithList = pages.flatMap(page => page.components.filter(c => {
|
91
|
+
var _c$values;
|
92
|
+
return (_c$values = c.values) === null || _c$values === void 0 ? void 0 : _c$values.items;
|
93
|
+
}));
|
94
|
+
const valuesAsLists = componentsWithList.map(component => {
|
95
|
+
return {
|
96
|
+
title: component.title,
|
97
|
+
name: component.list,
|
98
|
+
items: component.values.items.map(item => recastItem(item))
|
99
|
+
};
|
100
|
+
});
|
101
|
+
return _objectSpread(_objectSpread({}, data), {}, {
|
102
|
+
pages: pages.map(removeValues),
|
103
|
+
lists: [...((_data$lists = data.lists) !== null && _data$lists !== void 0 ? _data$lists : []), ...valuesAsLists],
|
104
|
+
version: 2
|
105
|
+
});
|
106
|
+
}
|
107
|
+
});
|
108
|
+
//# sourceMappingURL=migration.1-2.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"migration.1-2.js","names":["recastItem","label","value","condition","hint","item","title","conditions","addListId","component","values","_objectSpread","list","type","nanoid","migratePage","page","components","map","removeValues","rest","_objectWithoutProperties","_excluded","needsUpgrade","data","pages","flatMap","find","migrate","_data$lists","version","componentsWithList","filter","c","_c$values","items","valuesAsLists","name","lists"],"sources":["../../../src/migration/migration.1-2.ts"],"sourcesContent":["import { MigrationScript } from './types'\nimport { nanoid } from '../utils/helpers'\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":";;;;;;;;;;;;;;;;;;;;;;;;;EAGA;AACA;AACA;AACA;AACA;;EAQA;AACA;AACA;AACA;AACA;;EAeA,SAASA,UAAUA,CAAC;IAAEC,KAAK;IAAEC,KAAK;IAAEC,SAAS;IAAEC;EAAiB,CAAC,EAAE;IACjE,MAAMC,IAAU,GAAG;MACjBC,KAAK,EAAEL,KAAK;MACZC;IACF,CAAC;IAEDC,SAAS,KAAKE,IAAI,CAACE,UAAU,GAAGJ,SAAS,CAAC;IAC1CC,IAAI,KAAKC,IAAI,CAACD,IAAI,GAAGA,IAAI,CAAC;IAC1B,OAAOC,IAAI;EACb;EAEA,SAASG,SAASA,CAACC,SAA4C,EAAE;IAC/D,IAAI,CAACA,SAAS,CAACC,MAAM,EAAE;MACrB,OAAOD,SAAS;IAClB;IACA,MAAM;MAAEC;IAAO,CAAC,GAAGD,SAAS;IAC5B,OAAAE,aAAA,CAAAA,aAAA,KACKF,SAAS;MACZG,IAAI,EAAEF,MAAM,CAACG,IAAI,KAAK,SAAS,GAAGH,MAAM,CAACE,IAAI,GAAG,IAAAE,eAAM,EAAC;IAAC;EAE5D;EAEA,SAASC,WAAWA,CAACC,IAAI,EAAE;IACzB,OAAAL,aAAA,CAAAA,aAAA,KACKK,IAAI;MACPC,UAAU,EAAED,IAAI,CAACC,UAAU,CAACC,GAAG,CAACV,SAAS;IAAC;EAE9C;EAEA,SAASW,YAAYA,CAACH,IAAI,EAAE;IAC1B,OAAAL,aAAA,CAAAA,aAAA,KACKK,IAAI;MACPC,UAAU,EAAED,IAAI,CAACC,UAAU,CAACC,GAAG,CAAET,SAAS,IAAK;QAC7C,MAAM;YAAEC;UAAgB,CAAC,GAAGD,SAAS;UAAlBW,IAAI,GAAAC,wBAAA,CAAKZ,SAAS,EAAAa,SAAA;QACrC,OAAAX,aAAA,KACKS,IAAI;MAEX,CAAC;IAAC;EAEN;EAEA,SAASG,YAAYA,CAACC,IAAI,EAAE;IAC1B,OAAO,CAAC,CAACA,IAAI,CAACC,KAAK,CAChBC,OAAO,CAAEV,IAAI,IAAKA,IAAI,CAACC,UAAU,CAAC,CAClCU,IAAI,CAAElB,SAAS,IAAKA,SAAS,CAACC,MAAM,CAAC;EAC1C;EAEO,SAASkB,OAAOA,CAACJ,IAAI,EAAmB;IAAA,IAAAK,WAAA;IAC7C,IAAI,CAACN,YAAY,CAACC,IAAI,CAAC,EAAE;MACvB,OAAAb,aAAA,CAAAA,aAAA,KAAYa,IAAI;QAAEM,OAAO,EAAE;MAAC;IAC9B;IACA,MAAML,KAAK,GAAGD,IAAI,CAACC,KAAK,CAACP,GAAG,CAACH,WAAW,CAAC;IACzC,MAAMgB,kBAAkB,GAAGN,KAAK,CAACC,OAAO,CAAEV,IAAI,IAC5CA,IAAI,CAACC,UAAU,CAACe,MAAM,CAAEC,CAAC;MAAA,IAAAC,SAAA;MAAA,QAAAA,SAAA,GAAKD,CAAC,CAACvB,MAAM,cAAAwB,SAAA,uBAARA,SAAA,CAAUC,KAAK;IAAA,EAC/C,CAAC;IAED,MAAMC,aAAa,GAAGL,kBAAkB,CAACb,GAAG,CAAET,SAAS,IAAK;MAC1D,OAAO;QACLH,KAAK,EAAEG,SAAS,CAACH,KAAK;QACtB+B,IAAI,EAAE5B,SAAS,CAACG,IAAI;QACpBuB,KAAK,EAAE1B,SAAS,CAACC,MAAM,CAACyB,KAAK,CAACjB,GAAG,CAAEb,IAAI,IAAKL,UAAU,CAACK,IAAI,CAAC;MAC9D,CAAC;IACH,CAAC,CAAC;IAEF,OAAAM,aAAA,CAAAA,aAAA,KACKa,IAAI;MACPC,KAAK,EAAEA,KAAK,CAACP,GAAG,CAACC,YAAY,CAAC;MAC9BmB,KAAK,EAAE,CAAC,KAAAT,WAAA,GAAIL,IAAI,CAACc,KAAK,cAAAT,WAAA,cAAAA,WAAA,GAAI,EAAE,CAAC,EAAE,GAAGO,aAAa,CAAC;MAChDN,OAAO,EAAE;IAAC;EAEd;AAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/migration/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAA"}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
(function (global, factory) {
|
2
|
+
if (typeof define === "function" && define.amd) {
|
3
|
+
define([], factory);
|
4
|
+
} else if (typeof exports !== "undefined") {
|
5
|
+
factory();
|
6
|
+
} else {
|
7
|
+
var mod = {
|
8
|
+
exports: {}
|
9
|
+
};
|
10
|
+
factory();
|
11
|
+
global.types = mod.exports;
|
12
|
+
}
|
13
|
+
})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function () {
|
14
|
+
"use strict";
|
15
|
+
});
|
16
|
+
//# sourceMappingURL=types.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../src/migration/types.ts"],"sourcesContent":["export type MigrationScript = (data: Object) => Object\n"],"mappings":""}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { MigrationScript } from './types';
|
2
|
+
/**
|
3
|
+
* Returns which migrations that should be run against your Object with the given version
|
4
|
+
* @param version
|
5
|
+
*/
|
6
|
+
export declare function whichMigrations(version: number): Set<MigrationScript>;
|
7
|
+
//# sourceMappingURL=whichMigrations.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"whichMigrations.d.ts","sourceRoot":"","sources":["../../../src/migration/whichMigrations.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAEzC;;;GAGG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,wBAc9C"}
|
@@ -0,0 +1,38 @@
|
|
1
|
+
(function (global, factory) {
|
2
|
+
if (typeof define === "function" && define.amd) {
|
3
|
+
define(["exports", "./migration.0-2", "./migration.1-2"], factory);
|
4
|
+
} else if (typeof exports !== "undefined") {
|
5
|
+
factory(exports, require("./migration.0-2"), require("./migration.1-2"));
|
6
|
+
} else {
|
7
|
+
var mod = {
|
8
|
+
exports: {}
|
9
|
+
};
|
10
|
+
factory(mod.exports, global.migration, global.migration);
|
11
|
+
global.whichMigrations = mod.exports;
|
12
|
+
}
|
13
|
+
})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _migration, _migration2) {
|
14
|
+
"use strict";
|
15
|
+
|
16
|
+
_exports.__esModule = true;
|
17
|
+
_exports.whichMigrations = whichMigrations;
|
18
|
+
/**
|
19
|
+
* Returns which migrations that should be run against your Object with the given version
|
20
|
+
* @param version
|
21
|
+
*/
|
22
|
+
function whichMigrations(version) {
|
23
|
+
const migrations = new Set();
|
24
|
+
switch (version) {
|
25
|
+
case 0:
|
26
|
+
migrations.add(_migration.migrate);
|
27
|
+
/**
|
28
|
+
* we are skipping v1 entirely. If we weren't you would do migrations.add([V1_TO_V2, V2_TO_V3]) for example.
|
29
|
+
*/
|
30
|
+
break;
|
31
|
+
case 1:
|
32
|
+
migrations.add(_migration2.migrate);
|
33
|
+
break;
|
34
|
+
}
|
35
|
+
return migrations;
|
36
|
+
}
|
37
|
+
});
|
38
|
+
//# sourceMappingURL=whichMigrations.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"whichMigrations.js","names":["whichMigrations","version","migrations","Set","add","V0_TO_V2","V1_TO_V2"],"sources":["../../../src/migration/whichMigrations.ts"],"sourcesContent":["import { migrate as V0_TO_V2 } from './migration.0-2'\nimport { migrate as V1_TO_V2 } from './migration.1-2'\nimport { MigrationScript } from './types'\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":";;;;;;;;;;;;;;;;;EAIA;AACA;AACA;AACA;EACO,SAASA,eAAeA,CAACC,OAAe,EAAE;IAC/C,MAAMC,UAAU,GAAG,IAAIC,GAAG,CAAkB,CAAC;IAC7C,QAAQF,OAAO;MACb,KAAK,CAAC;QACJC,UAAU,CAACE,GAAG,CAACC,kBAAQ,CAAC;QACxB;AACN;AACA;QACM;MACF,KAAK,CAAC;QACJH,UAAU,CAACE,GAAG,CAACE,mBAAQ,CAAC;QACxB;IACJ;IACA,OAAOJ,UAAU;EACnB;AAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/schema/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA"}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
(function (global, factory) {
|
2
|
+
if (typeof define === "function" && define.amd) {
|
3
|
+
define(["exports", "./schema"], factory);
|
4
|
+
} else if (typeof exports !== "undefined") {
|
5
|
+
factory(exports, require("./schema"));
|
6
|
+
} else {
|
7
|
+
var mod = {
|
8
|
+
exports: {}
|
9
|
+
};
|
10
|
+
factory(mod.exports, global.schema);
|
11
|
+
global.index = mod.exports;
|
12
|
+
}
|
13
|
+
})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _schema) {
|
14
|
+
"use strict";
|
15
|
+
|
16
|
+
_exports.__esModule = true;
|
17
|
+
Object.defineProperty(_exports, "Schema", {
|
18
|
+
enumerable: true,
|
19
|
+
get: function () {
|
20
|
+
return _schema.Schema;
|
21
|
+
}
|
22
|
+
});
|
23
|
+
Object.defineProperty(_exports, "componentSchema", {
|
24
|
+
enumerable: true,
|
25
|
+
get: function () {
|
26
|
+
return _schema.componentSchema;
|
27
|
+
}
|
28
|
+
});
|
29
|
+
});
|
30
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/schema/index.ts"],"sourcesContent":["export { Schema, componentSchema } from './schema'\n"],"mappings":""}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import joi from 'joi';
|
2
|
+
/**
|
3
|
+
* If an optional key is added, CURRENT_VERSION does not need to be incremented.
|
4
|
+
* Only breaking changes will require an increment, as well as a migration script.
|
5
|
+
*/
|
6
|
+
export declare const CURRENT_VERSION = 2;
|
7
|
+
export declare const componentSchema: joi.ObjectSchema<any>;
|
8
|
+
export declare const Schema: joi.ObjectSchema<any>;
|
9
|
+
/**
|
10
|
+
* Schema versions:
|
11
|
+
* Undefined / 0 - initial version as at 28/8/20. Conditions may be in object structure or string form.
|
12
|
+
* 1 - Relevant components (radio, checkbox, select, autocomplete) now contain
|
13
|
+
* options as 'values' rather than referencing a data list
|
14
|
+
* 2 - Reverse v1. Values populating radio, checkboxes, select, autocomplete are defined in Lists only.
|
15
|
+
* TODO:- merge fees and paymentReferenceFormat
|
16
|
+
* 2 - 2023-05-04 `feeOptions` has been introduced. paymentReferenceFormat and payApiKey can be configured in top level or feeOptions. feeOptions will take precedent.
|
17
|
+
* if feeOptions are empty, it will pull values from the top level keys.
|
18
|
+
* WARN: Fee/GOV.UK pay configurations (apart from fees) should no longer be stored in the top level, always within feeOptions.
|
19
|
+
**/
|
20
|
+
//# sourceMappingURL=schema.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/schema/schema.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AAErB;;;GAGG;AACH,eAAO,MAAM,eAAe,IAAI,CAAA;AA2EhC,eAAO,MAAM,eAAe,uBAcZ,CAAA;AA0KhB,eAAO,MAAM,MAAM,uBAsBf,CAAA;AAEJ;;;;;;;;;;IAUI"}
|