@o3r/core 10.0.0-next.9 → 11.0.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -13
- package/builders/app-version/index.d.ts.map +1 -1
- package/builders/app-version/index.js +1 -1
- package/builders/app-version/index.js.map +1 -1
- package/builders/app-version/schema.json +1 -1
- package/builders/lib-build/schema.json +1 -1
- package/builders/multi-watcher/schema.json +1 -1
- package/builders/ngc/schema.json +1 -1
- package/builders/pattern-replacement/index.d.ts.map +1 -1
- package/builders/pattern-replacement/index.js +5 -5
- package/builders/pattern-replacement/index.js.map +1 -1
- package/builders/pattern-replacement/schema.json +1 -1
- package/builders/run-script/index.d.ts +4 -0
- package/builders/run-script/index.d.ts.map +1 -0
- package/builders/run-script/index.js +34 -0
- package/builders/run-script/index.js.map +1 -0
- package/builders/run-script/schema.d.ts +6 -0
- package/builders/run-script/schema.d.ts.map +1 -0
- package/{schematics/library → builders/run-script}/schema.js.map +1 -1
- package/builders/run-script/schema.json +15 -0
- package/builders.json +5 -0
- package/collection.json +0 -23
- package/core/application/dgp.interfaces.d.ts +6 -3
- package/core/application/dgp.interfaces.d.ts.map +1 -1
- package/core/devkit/devtools.interface.d.ts +16 -2
- package/core/devkit/devtools.interface.d.ts.map +1 -1
- package/core/index.d.ts +1 -0
- package/core/index.d.ts.map +1 -1
- package/core/index.js +1 -0
- package/core/index.js.map +1 -1
- package/core/interfaces/configuration.d.ts +39 -17
- package/core/interfaces/configuration.d.ts.map +1 -1
- package/core/interfaces/index.d.ts +0 -3
- package/core/interfaces/index.d.ts.map +1 -1
- package/core/interfaces/index.js +0 -3
- package/core/interfaces/index.js.map +1 -1
- package/core/metadata/component.decorator.d.ts +0 -1
- package/core/metadata/component.decorator.d.ts.map +1 -1
- package/core/metadata/component.decorator.js +0 -1
- package/core/metadata/component.decorator.js.map +1 -1
- package/core/metadata/component.identifier.d.ts +7 -0
- package/core/metadata/component.identifier.d.ts.map +1 -0
- package/core/metadata/component.identifier.js +9 -0
- package/core/metadata/component.identifier.js.map +1 -0
- package/core/metadata/index.d.ts +1 -0
- package/core/metadata/index.d.ts.map +1 -1
- package/core/metadata/index.js +1 -0
- package/core/metadata/index.js.map +1 -1
- package/core/rules-engine/index.d.ts +2 -0
- package/core/rules-engine/index.d.ts.map +1 -0
- package/core/rules-engine/index.js +2 -0
- package/core/rules-engine/index.js.map +1 -0
- package/core/rules-engine/rules-engine.interfaces.d.ts +24 -0
- package/core/rules-engine/rules-engine.interfaces.d.ts.map +1 -0
- package/core/rules-engine/rules-engine.interfaces.js +2 -0
- package/core/rules-engine/rules-engine.interfaces.js.map +1 -0
- package/esm2022/core/application/dgp.interfaces.mjs +1 -1
- package/esm2022/core/devkit/devtools.interface.mjs +1 -1
- package/esm2022/core/index.mjs +2 -1
- package/esm2022/core/interfaces/configuration.mjs +1 -1
- package/esm2022/core/interfaces/index.mjs +1 -4
- package/esm2022/core/metadata/component.decorator.mjs +1 -2
- package/esm2022/core/metadata/component.identifier.mjs +9 -0
- package/esm2022/core/metadata/index.mjs +2 -1
- package/esm2022/core/rules-engine/index.mjs +2 -0
- package/esm2022/core/rules-engine/rules-engine.interfaces.mjs +2 -0
- package/esm2022/log/logger.mjs +1 -1
- package/esm2022/messages/message.helpers.mjs +1 -5
- package/esm2022/store/async/async-entity.adapter.mjs +1 -2
- package/esm2022/store/async/async.adapter.mjs +1 -1
- package/esm2022/store/async/async.helpers.mjs +1 -4
- package/esm2022/store/async/async.operators.mjs +3 -4
- package/esm2022/store/async/async.serializer.mjs +1 -4
- package/esm2022/store/index.mjs +1 -2
- package/esm2022/utils/debug/debug.helper.mjs +1 -3
- package/esm2022/utils/deep-fill/deep-fill.mjs +23 -28
- package/esm2022/utils/rendering/rendering.helpers.mjs +1 -2
- package/fesm2022/o3r-core.mjs +47 -169
- package/fesm2022/o3r-core.mjs.map +1 -1
- package/log/logger.d.ts +0 -5
- package/log/logger.d.ts.map +1 -1
- package/messages/message.helpers.d.ts +0 -3
- package/messages/message.helpers.d.ts.map +1 -1
- package/messages/message.helpers.js +0 -4
- package/messages/message.helpers.js.map +1 -1
- package/migration.json +5 -0
- package/package.json +46 -39
- package/schematics/add-modules/index.d.ts +1 -2
- package/schematics/add-modules/index.d.ts.map +1 -1
- package/schematics/add-modules/index.js +16 -9
- package/schematics/add-modules/index.js.map +1 -1
- package/schematics/add-modules/schema.d.ts +5 -1
- package/schematics/add-modules/schema.d.ts.map +1 -1
- package/schematics/add-modules/schema.json +14 -4
- package/schematics/component/container/index.d.ts +0 -1
- package/schematics/component/container/index.d.ts.map +1 -1
- package/schematics/component/container/index.js +1 -3
- package/schematics/component/container/index.js.map +1 -1
- package/schematics/component/container/schema.json +1 -1
- package/schematics/component/index.d.ts.map +1 -1
- package/schematics/component/index.js +5 -2
- package/schematics/component/index.js.map +1 -1
- package/schematics/component/presenter/index.d.ts +0 -1
- package/schematics/component/presenter/index.d.ts.map +1 -1
- package/schematics/component/presenter/index.js +9 -9
- package/schematics/component/presenter/index.js.map +1 -1
- package/schematics/component/presenter/schema.json +4 -3
- package/schematics/component/schema.json +4 -4
- package/schematics/component/structures.types.d.ts +3 -2
- package/schematics/component/structures.types.d.ts.map +1 -1
- package/schematics/component/structures.types.js +1 -0
- package/schematics/component/structures.types.js.map +1 -1
- package/schematics/context-to-component/index.d.ts.map +1 -1
- package/schematics/context-to-component/index.js +1 -1
- package/schematics/context-to-component/index.js.map +1 -1
- package/schematics/context-to-component/schema.json +1 -1
- package/schematics/convert-component/index.js +2 -2
- package/schematics/convert-component/index.js.map +1 -1
- package/schematics/convert-component/schema.json +1 -1
- package/schematics/ng-add/index.d.ts.map +1 -1
- package/schematics/ng-add/index.js +30 -31
- package/schematics/ng-add/index.js.map +1 -1
- package/schematics/ng-add/project-setup/index.d.ts +0 -1
- package/schematics/ng-add/project-setup/index.d.ts.map +1 -1
- package/schematics/ng-add/project-setup/index.js +16 -65
- package/schematics/ng-add/project-setup/index.js.map +1 -1
- package/schematics/ng-add/schema.d.ts +7 -46
- package/schematics/ng-add/schema.d.ts.map +1 -1
- package/schematics/ng-add/schema.json +16 -86
- package/schematics/ng-add/updates-for-v8/cms-adapters/update-builders-names.d.ts.map +1 -1
- package/schematics/ng-add/updates-for-v8/cms-adapters/update-builders-names.js +7 -3
- package/schematics/ng-add/updates-for-v8/cms-adapters/update-builders-names.js.map +1 -1
- package/schematics/ng-add/updates-for-v8/generators/update-generators-names.d.ts.map +1 -1
- package/schematics/ng-add/updates-for-v8/generators/update-generators-names.js +7 -2
- package/schematics/ng-add/updates-for-v8/generators/update-generators-names.js.map +1 -1
- package/schematics/ng-add-create/schema.json +1 -1
- package/schematics/ng-add-create/templates/schematics/ng-add/schema.json.template +2 -2
- package/schematics/ng-update/index.d.ts +4 -0
- package/schematics/ng-update/index.d.ts.map +1 -1
- package/schematics/ng-update/index.js +14 -1
- package/schematics/ng-update/index.js.map +1 -1
- package/schematics/ng-update/v10.0/configuration.d.ts +9 -0
- package/schematics/ng-update/v10.0/configuration.d.ts.map +1 -0
- package/schematics/ng-update/v10.0/configuration.js +23 -0
- package/schematics/ng-update/v10.0/configuration.js.map +1 -0
- package/schematics/page/index.d.ts +0 -1
- package/schematics/page/index.d.ts.map +1 -1
- package/schematics/page/index.js +6 -11
- package/schematics/page/index.js.map +1 -1
- package/schematics/page/schema.json +1 -1
- package/schematics/renovate/schema.json +1 -1
- package/schematics/renovate/templates/azure-pipelines.ugrade.yml +1 -1
- package/schematics/rule-factories/additional-modules/index.d.ts +0 -1
- package/schematics/rule-factories/additional-modules/index.d.ts.map +1 -1
- package/schematics/rule-factories/additional-modules/index.js +14 -18
- package/schematics/rule-factories/additional-modules/index.js.map +1 -1
- package/schematics/rule-factories/component/common.js +2 -2
- package/schematics/rule-factories/component/common.js.map +1 -1
- package/schematics/rule-factories/customization-environment/index.d.ts +0 -1
- package/schematics/rule-factories/customization-environment/index.d.ts.map +1 -1
- package/schematics/rule-factories/customization-environment/index.js +9 -30
- package/schematics/rule-factories/customization-environment/index.js.map +1 -1
- package/schematics/rule-factories/index.d.ts +0 -3
- package/schematics/rule-factories/index.d.ts.map +1 -1
- package/schematics/rule-factories/index.js +0 -3
- package/schematics/rule-factories/index.js.map +1 -1
- package/schematics/rule-factories/o3r-basic-updates/index.d.ts +1 -2
- package/schematics/rule-factories/o3r-basic-updates/index.d.ts.map +1 -1
- package/schematics/rule-factories/o3r-basic-updates/index.js +7 -4
- package/schematics/rule-factories/o3r-basic-updates/index.js.map +1 -1
- package/schematics/rule-factories/otter-environment/index.d.ts +0 -1
- package/schematics/rule-factories/otter-environment/index.d.ts.map +1 -1
- package/schematics/rule-factories/otter-environment/index.js +8 -13
- package/schematics/rule-factories/otter-environment/index.js.map +1 -1
- package/schematics/rule-factories/store/index.d.ts.map +1 -1
- package/schematics/rule-factories/store/index.js +30 -13
- package/schematics/rule-factories/store/index.js.map +1 -1
- package/schematics/schematics-update/schema.json +1 -1
- package/schematics/service/index.d.ts +0 -1
- package/schematics/service/index.d.ts.map +1 -1
- package/schematics/service/index.js +1 -2
- package/schematics/service/index.js.map +1 -1
- package/schematics/service/schema.json +1 -1
- package/schematics/shared/presets/all.preset.d.ts +10 -0
- package/schematics/shared/presets/all.preset.d.ts.map +1 -0
- package/schematics/shared/presets/all.preset.js +40 -0
- package/schematics/shared/presets/all.preset.js.map +1 -0
- package/schematics/shared/presets/external.preset.d.ts +10 -0
- package/schematics/shared/presets/external.preset.d.ts.map +1 -0
- package/schematics/shared/presets/external.preset.js +25 -0
- package/schematics/shared/presets/external.preset.js.map +1 -0
- package/schematics/shared/presets/helpers.js +1 -1
- package/schematics/shared/presets/helpers.js.map +1 -1
- package/schematics/shared/presets/index.d.ts +1 -0
- package/schematics/shared/presets/index.d.ts.map +1 -1
- package/schematics/shared/presets/index.js +4 -1
- package/schematics/shared/presets/index.js.map +1 -1
- package/schematics/show-modules/index.d.ts +1 -2
- package/schematics/show-modules/index.d.ts.map +1 -1
- package/schematics/show-modules/index.js +3 -5
- package/schematics/show-modules/index.js.map +1 -1
- package/schematics/show-modules/schema.json +1 -1
- package/schematics/store/entity-async/index.d.ts.map +1 -1
- package/schematics/store/entity-async/index.js +4 -0
- package/schematics/store/entity-async/index.js.map +1 -1
- package/schematics/store/entity-async/schema.json +1 -1
- package/schematics/store/entity-async/templates/__storeName@dasherize__.state.ts +1 -1
- package/schematics/store/entity-sync/index.d.ts.map +1 -1
- package/schematics/store/entity-sync/index.js +4 -0
- package/schematics/store/entity-sync/index.js.map +1 -1
- package/schematics/store/entity-sync/schema.json +1 -1
- package/schematics/store/entity-sync/templates/__storeName@dasherize__.state.ts +1 -1
- package/schematics/store/schema.json +1 -1
- package/schematics/store/simple-async/index.d.ts.map +1 -1
- package/schematics/store/simple-async/index.js +2 -0
- package/schematics/store/simple-async/index.js.map +1 -1
- package/schematics/store/simple-async/schema.json +1 -1
- package/schematics/store/simple-sync/index.d.ts.map +1 -1
- package/schematics/store/simple-sync/index.js +1 -0
- package/schematics/store/simple-sync/index.js.map +1 -1
- package/schematics/store/simple-sync/schema.json +1 -1
- package/schematics/store-action/schema.json +1 -1
- package/store/async/async-entity.adapter.d.ts +0 -8
- package/store/async/async-entity.adapter.d.ts.map +1 -1
- package/store/async/async-entity.adapter.js +0 -1
- package/store/async/async-entity.adapter.js.map +1 -1
- package/store/async/async.adapter.d.ts +0 -13
- package/store/async/async.adapter.d.ts.map +1 -1
- package/store/async/async.adapter.js.map +1 -1
- package/store/async/async.helpers.d.ts +0 -3
- package/store/async/async.helpers.d.ts.map +1 -1
- package/store/async/async.helpers.js +0 -3
- package/store/async/async.helpers.js.map +1 -1
- package/store/async/async.operators.d.ts +2 -3
- package/store/async/async.operators.d.ts.map +1 -1
- package/store/async/async.operators.js +2 -3
- package/store/async/async.operators.js.map +1 -1
- package/store/async/async.serializer.d.ts +0 -3
- package/store/async/async.serializer.d.ts.map +1 -1
- package/store/async/async.serializer.js +0 -3
- package/store/async/async.serializer.js.map +1 -1
- package/store/index.d.ts +0 -1
- package/store/index.d.ts.map +1 -1
- package/store/index.js +0 -1
- package/store/index.js.map +1 -1
- package/utils/debug/debug.helper.d.ts +0 -2
- package/utils/debug/debug.helper.d.ts.map +1 -1
- package/utils/debug/debug.helper.js +0 -2
- package/utils/debug/debug.helper.js.map +1 -1
- package/utils/deep-fill/deep-fill.d.ts +17 -12
- package/utils/deep-fill/deep-fill.d.ts.map +1 -1
- package/utils/deep-fill/deep-fill.js +22 -27
- package/utils/deep-fill/deep-fill.js.map +1 -1
- package/utils/rendering/rendering.helpers.d.ts +0 -1
- package/utils/rendering/rendering.helpers.d.ts.map +1 -1
- package/utils/rendering/rendering.helpers.js +0 -1
- package/utils/rendering/rendering.helpers.js.map +1 -1
- package/builders/package.json +0 -3
- package/core/interfaces/block.d.ts +0 -9
- package/core/interfaces/block.d.ts.map +0 -1
- package/core/interfaces/block.js +0 -2
- package/core/interfaces/block.js.map +0 -1
- package/core/interfaces/exposed-component.d.ts +0 -10
- package/core/interfaces/exposed-component.d.ts.map +0 -1
- package/core/interfaces/exposed-component.js +0 -2
- package/core/interfaces/exposed-component.js.map +0 -1
- package/core/interfaces/page.d.ts +0 -9
- package/core/interfaces/page.d.ts.map +0 -1
- package/core/interfaces/page.js +0 -2
- package/core/interfaces/page.js.map +0 -1
- package/esm2022/core/interfaces/block.mjs +0 -2
- package/esm2022/core/interfaces/exposed-component.mjs +0 -2
- package/esm2022/core/interfaces/page.mjs +0 -2
- package/esm2022/store/storage/index.mjs +0 -2
- package/esm2022/store/storage/store-sync.mjs +0 -111
- package/schematics/application/index.d.ts +0 -9
- package/schematics/application/index.d.ts.map +0 -1
- package/schematics/application/index.js +0 -68
- package/schematics/application/index.js.map +0 -1
- package/schematics/application/schema.d.ts +0 -14
- package/schematics/application/schema.d.ts.map +0 -1
- package/schematics/application/schema.js.map +0 -1
- package/schematics/application/schema.json +0 -38
- package/schematics/application/templates/package.json.template +0 -29
- package/schematics/library/index.d.ts +0 -9
- package/schematics/library/index.d.ts.map +0 -1
- package/schematics/library/index.js +0 -41
- package/schematics/library/index.js.map +0 -1
- package/schematics/library/rules/rules.ng.d.ts +0 -11
- package/schematics/library/rules/rules.ng.d.ts.map +0 -1
- package/schematics/library/rules/rules.ng.js +0 -113
- package/schematics/library/rules/rules.ng.js.map +0 -1
- package/schematics/library/rules/rules.nx.d.ts +0 -10
- package/schematics/library/rules/rules.nx.d.ts.map +0 -1
- package/schematics/library/rules/rules.nx.js +0 -126
- package/schematics/library/rules/rules.nx.js.map +0 -1
- package/schematics/library/rules/shared.d.ts +0 -19
- package/schematics/library/rules/shared.d.ts.map +0 -1
- package/schematics/library/rules/shared.js +0 -84
- package/schematics/library/rules/shared.js.map +0 -1
- package/schematics/library/schema.d.ts +0 -18
- package/schematics/library/schema.d.ts.map +0 -1
- package/schematics/library/schema.js +0 -3
- package/schematics/library/schema.json +0 -51
- package/schematics/library/templates/ng/.eslintrc.js.template +0 -19
- package/schematics/library/templates/ng/.gitignore.template +0 -2
- package/schematics/library/templates/ng/.npmignore.template +0 -0
- package/schematics/library/templates/ng/jest.config.js.template +0 -37
- package/schematics/library/templates/ng/testing/setup-jest.ts.template +0 -2
- package/schematics/library/templates/ng/tsconfig.builders.json.template +0 -22
- package/schematics/library/templates/ng/tsconfig.eslint.json.template +0 -8
- package/schematics/library/templates/ng/tsconfig.json.template +0 -12
- package/schematics/library/templates/ng/tsconfig.spec.json.template +0 -17
- package/schematics/library/templates/nx/.eslintrc.js.template +0 -19
- package/schematics/library/templates/nx/.gitignore.template +0 -2
- package/schematics/library/templates/nx/.npmignore.template +0 -0
- package/schematics/library/templates/nx/jest.config.js.template +0 -37
- package/schematics/library/templates/nx/project.json.template +0 -66
- package/schematics/library/templates/nx/testing/setup-jest.ts.template +0 -2
- package/schematics/library/templates/nx/tsconfig.eslint.json.template +0 -8
- package/schematics/package.json +0 -3
- package/schematics/rule-factories/azure-pipeline/index.d.ts +0 -14
- package/schematics/rule-factories/azure-pipeline/index.d.ts.map +0 -1
- package/schematics/rule-factories/azure-pipeline/index.js +0 -64
- package/schematics/rule-factories/azure-pipeline/index.js.map +0 -1
- package/schematics/rule-factories/azure-pipeline/templates/azure/scripts/e2e/attach-files-to-test-results.js.template +0 -147
- package/schematics/rule-factories/azure-pipeline/templates/azure/scripts/e2e/compute-deployment-service-url.js.template +0 -20
- package/schematics/rule-factories/azure-pipeline/templates/azure/scripts/e2e/gen-pckg-json-e2e.js.template +0 -15
- package/schematics/rule-factories/azure-pipeline/templates/azure/scripts/e2e/get-app-version.js.template +0 -36
- package/schematics/rule-factories/azure-pipeline/templates/azure/scripts/e2e/get-major-minor.js.template +0 -8
- package/schematics/rule-factories/azure-pipeline/templates/azure/templates/steps/allure.yml.template +0 -24
- package/schematics/rule-factories/azure-pipeline/templates/azure/templates/steps/cascading.yml.template +0 -8
- package/schematics/rule-factories/azure-pipeline/templates/azure/templates/steps/publish.yml.template +0 -14
- package/schematics/rule-factories/azure-pipeline/templates/azure/templates/steps/set-version-tag.yml.template +0 -13
- package/schematics/rule-factories/azure-pipeline/templates/azure/templates/steps/setup.yml.template +0 -21
- package/schematics/rule-factories/azure-pipeline/templates/azure/templates/steps/versioning.yml.template +0 -8
- package/schematics/rule-factories/azure-pipeline/templates/azure-pipelines.yml.template +0 -252
- package/schematics/rule-factories/module-list/index.d.ts +0 -11
- package/schematics/rule-factories/module-list/index.d.ts.map +0 -1
- package/schematics/rule-factories/module-list/index.js +0 -45
- package/schematics/rule-factories/module-list/index.js.map +0 -1
- package/schematics/rule-factories/monorepo/index.d.ts +0 -16
- package/schematics/rule-factories/monorepo/index.d.ts.map +0 -1
- package/schematics/rule-factories/monorepo/index.js +0 -65
- package/schematics/rule-factories/monorepo/index.js.map +0 -1
- package/schematics/rule-factories/renovate/index.d.ts +0 -8
- package/schematics/rule-factories/renovate/index.d.ts.map +0 -1
- package/schematics/rule-factories/renovate/index.js +0 -27
- package/schematics/rule-factories/renovate/index.js.map +0 -1
- package/schematics/rule-factories/renovate/templates/__dot__renovaterc.json.template +0 -61
- package/schematics/sdk/index.d.ts +0 -8
- package/schematics/sdk/index.d.ts.map +0 -1
- package/schematics/sdk/index.js +0 -62
- package/schematics/sdk/index.js.map +0 -1
- package/schematics/sdk/rules/clean-standalone.rule.d.ts +0 -7
- package/schematics/sdk/rules/clean-standalone.rule.d.ts.map +0 -1
- package/schematics/sdk/rules/clean-standalone.rule.js +0 -28
- package/schematics/sdk/rules/clean-standalone.rule.js.map +0 -1
- package/schematics/sdk/rules/rules.ng.d.ts +0 -11
- package/schematics/sdk/rules/rules.ng.d.ts.map +0 -1
- package/schematics/sdk/rules/rules.ng.js +0 -38
- package/schematics/sdk/rules/rules.ng.js.map +0 -1
- package/schematics/sdk/rules/rules.nx.d.ts +0 -11
- package/schematics/sdk/rules/rules.nx.d.ts.map +0 -1
- package/schematics/sdk/rules/rules.nx.js +0 -60
- package/schematics/sdk/rules/rules.nx.js.map +0 -1
- package/schematics/sdk/rules/update-ts-paths.rule.d.ts +0 -10
- package/schematics/sdk/rules/update-ts-paths.rule.d.ts.map +0 -1
- package/schematics/sdk/rules/update-ts-paths.rule.js +0 -41
- package/schematics/sdk/rules/update-ts-paths.rule.js.map +0 -1
- package/schematics/sdk/schema.d.ts +0 -19
- package/schematics/sdk/schema.d.ts.map +0 -1
- package/schematics/sdk/schema.js +0 -3
- package/schematics/sdk/schema.js.map +0 -1
- package/schematics/sdk/schema.json +0 -46
- package/schematics/sdk/templates/jest.config.js.template +0 -12
- package/schematics/store/common/mocks/example-module.d.ts +0 -2
- package/schematics/store/common/mocks/example-module.d.ts.map +0 -1
- package/schematics/store/common/mocks/example-module.js +0 -40
- package/schematics/store/common/mocks/example-module.js.map +0 -1
- package/schematics/store/common/mocks/index.d.ts +0 -2
- package/schematics/store/common/mocks/index.d.ts.map +0 -1
- package/schematics/store/common/mocks/index.js +0 -12
- package/schematics/store/common/mocks/index.js.map +0 -1
- package/schematics/store/entity-async/mocks/example-actions.d.ts +0 -2
- package/schematics/store/entity-async/mocks/example-actions.d.ts.map +0 -1
- package/schematics/store/entity-async/mocks/example-actions.js +0 -82
- package/schematics/store/entity-async/mocks/example-actions.js.map +0 -1
- package/schematics/store/entity-async/mocks/example-effect-spec.d.ts +0 -2
- package/schematics/store/entity-async/mocks/example-effect-spec.d.ts.map +0 -1
- package/schematics/store/entity-async/mocks/example-effect-spec.js +0 -45
- package/schematics/store/entity-async/mocks/example-effect-spec.js.map +0 -1
- package/schematics/store/entity-async/mocks/example-effect.d.ts +0 -2
- package/schematics/store/entity-async/mocks/example-effect.d.ts.map +0 -1
- package/schematics/store/entity-async/mocks/example-effect.js +0 -72
- package/schematics/store/entity-async/mocks/example-effect.js.map +0 -1
- package/schematics/store/entity-async/mocks/example-reducer-spec.d.ts +0 -2
- package/schematics/store/entity-async/mocks/example-reducer-spec.d.ts.map +0 -1
- package/schematics/store/entity-async/mocks/example-reducer-spec.js +0 -127
- package/schematics/store/entity-async/mocks/example-reducer-spec.js.map +0 -1
- package/schematics/store/entity-async/mocks/example-reducer.d.ts +0 -2
- package/schematics/store/entity-async/mocks/example-reducer.d.ts.map +0 -1
- package/schematics/store/entity-async/mocks/example-reducer.js +0 -69
- package/schematics/store/entity-async/mocks/example-reducer.js.map +0 -1
- package/schematics/store/entity-async/mocks/example-selectors-spec.d.ts +0 -2
- package/schematics/store/entity-async/mocks/example-selectors-spec.d.ts.map +0 -1
- package/schematics/store/entity-async/mocks/example-selectors-spec.js +0 -16
- package/schematics/store/entity-async/mocks/example-selectors-spec.js.map +0 -1
- package/schematics/store/entity-async/mocks/example-selectors.d.ts +0 -2
- package/schematics/store/entity-async/mocks/example-selectors.d.ts.map +0 -1
- package/schematics/store/entity-async/mocks/example-selectors.js +0 -28
- package/schematics/store/entity-async/mocks/example-selectors.js.map +0 -1
- package/schematics/store/entity-async/mocks/example-state.d.ts +0 -2
- package/schematics/store/entity-async/mocks/example-state.d.ts.map +0 -1
- package/schematics/store/entity-async/mocks/example-state.js +0 -39
- package/schematics/store/entity-async/mocks/example-state.js.map +0 -1
- package/schematics/store/entity-async/mocks/example-sync.d.ts +0 -2
- package/schematics/store/entity-async/mocks/example-sync.d.ts.map +0 -1
- package/schematics/store/entity-async/mocks/example-sync.js +0 -29
- package/schematics/store/entity-async/mocks/example-sync.js.map +0 -1
- package/schematics/store/entity-sync/mocks/example-actions.d.ts +0 -2
- package/schematics/store/entity-sync/mocks/example-actions.d.ts.map +0 -1
- package/schematics/store/entity-sync/mocks/example-actions.js +0 -56
- package/schematics/store/entity-sync/mocks/example-actions.js.map +0 -1
- package/schematics/store/entity-sync/mocks/example-reducer-spec.d.ts +0 -2
- package/schematics/store/entity-sync/mocks/example-reducer-spec.d.ts.map +0 -1
- package/schematics/store/entity-sync/mocks/example-reducer-spec.js +0 -85
- package/schematics/store/entity-sync/mocks/example-reducer-spec.js.map +0 -1
- package/schematics/store/entity-sync/mocks/example-reducer.d.ts +0 -2
- package/schematics/store/entity-sync/mocks/example-reducer.d.ts.map +0 -1
- package/schematics/store/entity-sync/mocks/example-reducer.js +0 -51
- package/schematics/store/entity-sync/mocks/example-reducer.js.map +0 -1
- package/schematics/store/entity-sync/mocks/example-selectors-spec.d.ts +0 -2
- package/schematics/store/entity-sync/mocks/example-selectors-spec.d.ts.map +0 -1
- package/schematics/store/entity-sync/mocks/example-selectors-spec.js +0 -10
- package/schematics/store/entity-sync/mocks/example-selectors-spec.js.map +0 -1
- package/schematics/store/entity-sync/mocks/example-selectors.d.ts +0 -2
- package/schematics/store/entity-sync/mocks/example-selectors.d.ts.map +0 -1
- package/schematics/store/entity-sync/mocks/example-selectors.js +0 -25
- package/schematics/store/entity-sync/mocks/example-selectors.js.map +0 -1
- package/schematics/store/entity-sync/mocks/example-state.d.ts +0 -2
- package/schematics/store/entity-sync/mocks/example-state.d.ts.map +0 -1
- package/schematics/store/entity-sync/mocks/example-state.js +0 -37
- package/schematics/store/entity-sync/mocks/example-state.js.map +0 -1
- package/schematics/store/simple-async/mocks/example-actions.d.ts +0 -2
- package/schematics/store/simple-async/mocks/example-actions.d.ts.map +0 -1
- package/schematics/store/simple-async/mocks/example-actions.js +0 -56
- package/schematics/store/simple-async/mocks/example-actions.js.map +0 -1
- package/schematics/store/simple-async/mocks/example-effect-spec.d.ts +0 -2
- package/schematics/store/simple-async/mocks/example-effect-spec.d.ts.map +0 -1
- package/schematics/store/simple-async/mocks/example-effect-spec.js +0 -45
- package/schematics/store/simple-async/mocks/example-effect-spec.js.map +0 -1
- package/schematics/store/simple-async/mocks/example-effect.d.ts +0 -2
- package/schematics/store/simple-async/mocks/example-effect.d.ts.map +0 -1
- package/schematics/store/simple-async/mocks/example-effect.js +0 -54
- package/schematics/store/simple-async/mocks/example-effect.js.map +0 -1
- package/schematics/store/simple-async/mocks/example-reducer-spec.d.ts +0 -2
- package/schematics/store/simple-async/mocks/example-reducer-spec.d.ts.map +0 -1
- package/schematics/store/simple-async/mocks/example-reducer-spec.js +0 -58
- package/schematics/store/simple-async/mocks/example-reducer-spec.js.map +0 -1
- package/schematics/store/simple-async/mocks/example-reducer.d.ts +0 -2
- package/schematics/store/simple-async/mocks/example-reducer.d.ts.map +0 -1
- package/schematics/store/simple-async/mocks/example-reducer.js +0 -46
- package/schematics/store/simple-async/mocks/example-reducer.js.map +0 -1
- package/schematics/store/simple-async/mocks/example-state.d.ts +0 -2
- package/schematics/store/simple-async/mocks/example-state.d.ts.map +0 -1
- package/schematics/store/simple-async/mocks/example-state.js +0 -39
- package/schematics/store/simple-async/mocks/example-state.js.map +0 -1
- package/schematics/store/simple-async/mocks/example-sync.d.ts +0 -2
- package/schematics/store/simple-async/mocks/example-sync.d.ts.map +0 -1
- package/schematics/store/simple-async/mocks/example-sync.js +0 -22
- package/schematics/store/simple-async/mocks/example-sync.js.map +0 -1
- package/schematics/store/simple-sync/mocks/example-actions.d.ts +0 -2
- package/schematics/store/simple-sync/mocks/example-actions.d.ts.map +0 -1
- package/schematics/store/simple-sync/mocks/example-actions.js +0 -28
- package/schematics/store/simple-sync/mocks/example-actions.js.map +0 -1
- package/schematics/store/simple-sync/mocks/example-reducer-spec.d.ts +0 -2
- package/schematics/store/simple-sync/mocks/example-reducer-spec.d.ts.map +0 -1
- package/schematics/store/simple-sync/mocks/example-reducer-spec.js +0 -38
- package/schematics/store/simple-sync/mocks/example-reducer-spec.js.map +0 -1
- package/schematics/store/simple-sync/mocks/example-reducer.d.ts +0 -2
- package/schematics/store/simple-sync/mocks/example-reducer.d.ts.map +0 -1
- package/schematics/store/simple-sync/mocks/example-reducer.js +0 -32
- package/schematics/store/simple-sync/mocks/example-reducer.js.map +0 -1
- package/schematics/store/simple-sync/mocks/example-state.d.ts +0 -2
- package/schematics/store/simple-sync/mocks/example-state.d.ts.map +0 -1
- package/schematics/store/simple-sync/mocks/example-state.js +0 -22
- package/schematics/store/simple-sync/mocks/example-state.js.map +0 -1
- package/store/storage/index.d.ts +0 -2
- package/store/storage/index.d.ts.map +0 -1
- package/store/storage/index.js +0 -2
- package/store/storage/index.js.map +0 -1
- package/store/storage/store-sync.d.ts +0 -113
- package/store/storage/store-sync.d.ts.map +0 -1
- package/store/storage/store-sync.js +0 -111
- package/store/storage/store-sync.js.map +0 -1
- /package/{schematics/application → builders/run-script}/schema.js +0 -0
|
@@ -1,38 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* Check if an object is a date
|
|
4
|
-
*
|
|
5
|
-
* @param obj
|
|
6
|
-
*/
|
|
7
|
-
export function isDate(obj) {
|
|
8
|
-
return obj instanceof utils.DateTime || obj instanceof utils.Date;
|
|
9
|
-
}
|
|
1
|
+
const defaultConstruct = (data) => data;
|
|
2
|
+
const isDate = (data) => data instanceof Date && !isNaN(data);
|
|
10
3
|
/**
|
|
11
4
|
* Check if an object is not an array or a date
|
|
12
|
-
*
|
|
13
5
|
* @param obj
|
|
6
|
+
* @param additionalMappers
|
|
14
7
|
*/
|
|
15
|
-
export function isObject(obj) {
|
|
16
|
-
return obj instanceof Object && !Array.isArray(obj) && !isDate(obj);
|
|
8
|
+
export function isObject(obj, additionalMappers) {
|
|
9
|
+
return obj instanceof Object && !Array.isArray(obj) && !additionalMappers?.some((mapper) => mapper.condition(obj)) && !isDate(obj);
|
|
17
10
|
}
|
|
18
11
|
/**
|
|
19
12
|
* Return a new reference of the given object
|
|
20
|
-
*
|
|
21
13
|
* @param obj
|
|
14
|
+
* @param additionalMappers
|
|
22
15
|
*/
|
|
23
|
-
export function immutablePrimitive(obj) {
|
|
16
|
+
export function immutablePrimitive(obj, additionalMappers) {
|
|
24
17
|
if (Array.isArray(obj)) {
|
|
25
18
|
return obj.slice();
|
|
26
19
|
}
|
|
27
|
-
|
|
28
|
-
|
|
20
|
+
const matchingPrimitive = additionalMappers?.find((mapper) => mapper.condition(obj));
|
|
21
|
+
const resolvedType = matchingPrimitive && ((matchingPrimitive.construct || defaultConstruct)(obj));
|
|
22
|
+
if (resolvedType !== undefined) {
|
|
23
|
+
return resolvedType;
|
|
29
24
|
}
|
|
30
|
-
|
|
31
|
-
return new
|
|
25
|
+
if (isDate(obj)) {
|
|
26
|
+
return new Date(obj);
|
|
32
27
|
}
|
|
33
28
|
else if (obj instanceof Object) {
|
|
34
29
|
// eslint-disable-next-line no-use-before-define
|
|
35
|
-
return deepFill(obj, obj);
|
|
30
|
+
return deepFill(obj, obj, additionalMappers);
|
|
36
31
|
}
|
|
37
32
|
else {
|
|
38
33
|
return obj;
|
|
@@ -42,33 +37,33 @@ export function immutablePrimitive(obj) {
|
|
|
42
37
|
* Deep fill of base object using source
|
|
43
38
|
* It will do a deep merge of the objects, overriding arrays
|
|
44
39
|
* All properties not present in source, but present in base, will remain
|
|
45
|
-
*
|
|
46
40
|
* @param base
|
|
47
41
|
* @param source
|
|
42
|
+
* @param additionalMappers Map of conditions of type mapper
|
|
48
43
|
*/
|
|
49
|
-
export function deepFill(base, source) {
|
|
44
|
+
export function deepFill(base, source, additionalMappers) {
|
|
50
45
|
if (typeof source === 'undefined') {
|
|
51
|
-
return deepFill(base, base);
|
|
46
|
+
return deepFill(base, base, additionalMappers);
|
|
52
47
|
}
|
|
53
|
-
if (!isObject(base)) {
|
|
54
|
-
return immutablePrimitive(typeof source !== 'undefined' ? source : base);
|
|
48
|
+
if (!isObject(base, additionalMappers)) {
|
|
49
|
+
return immutablePrimitive(typeof source !== 'undefined' ? source : base, additionalMappers);
|
|
55
50
|
}
|
|
56
51
|
const newObj = { ...base };
|
|
57
52
|
for (const key in base) {
|
|
58
53
|
if (key in source && typeof base[key] === typeof source[key]) {
|
|
59
54
|
const keyOfSource = source[key];
|
|
60
|
-
newObj[key] = typeof keyOfSource === 'undefined' ? immutablePrimitive(base[key]) : deepFill(base[key], source[key]);
|
|
55
|
+
newObj[key] = typeof keyOfSource === 'undefined' ? immutablePrimitive(base[key], additionalMappers) : deepFill(base[key], source[key], additionalMappers);
|
|
61
56
|
}
|
|
62
57
|
else {
|
|
63
|
-
newObj[key] = immutablePrimitive(base[key]);
|
|
58
|
+
newObj[key] = immutablePrimitive(base[key], additionalMappers);
|
|
64
59
|
}
|
|
65
60
|
}
|
|
66
61
|
// getting keys present in source and not present in base
|
|
67
62
|
for (const key in source) {
|
|
68
63
|
if (!(key in newObj)) {
|
|
69
|
-
newObj[key] = immutablePrimitive(source[key]);
|
|
64
|
+
newObj[key] = immutablePrimitive(source[key], additionalMappers);
|
|
70
65
|
}
|
|
71
66
|
}
|
|
72
67
|
return newObj;
|
|
73
68
|
}
|
|
74
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
69
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVlcC1maWxsLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL3V0aWxzL2RlZXAtZmlsbC9kZWVwLWZpbGwudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBYUEsTUFBTSxnQkFBZ0IsR0FBRyxDQUFDLElBQVMsRUFBRSxFQUFFLENBQUMsSUFBSSxDQUFDO0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HByZXNlbnQgaW4gc291cmNlIGFuZCBub3QgcHJlc2VudCBpbiBiYXNlXG4gIGZvciAoY29uc3Qga2V5IGluIHNvdXJjZSkge1xuICAgIGlmICghKGtleSBpbiBuZXdPYmopKSB7XG4gICAgICBuZXdPYmpba2V5IGFzIGtleW9mIFRdID0gaW1tdXRhYmxlUHJpbWl0aXZlKHNvdXJjZVtrZXldLCBhZGRpdGlvbmFsTWFwcGVycyk7XG4gICAgfVxuICB9XG4gIHJldHVybiBuZXdPYmo7XG59XG4iXX0=
|
|
@@ -4,7 +4,6 @@ import { bufferCount, concatMap, delay, mergeMap, scan, tap } from 'rxjs/operato
|
|
|
4
4
|
* Buffers and emits data for lazy/progressive rendering of big lists
|
|
5
5
|
* That could solve issues with long-running tasks when trying to render an array
|
|
6
6
|
* of similar components.
|
|
7
|
-
*
|
|
8
7
|
* @param delayMs Delay between data emits
|
|
9
8
|
* @param concurrency Amount of elements that should be emitted at once
|
|
10
9
|
* @returns
|
|
@@ -30,4 +29,4 @@ export function lazyArray(delayMs = 0, concurrency = 2) {
|
|
|
30
29
|
}));
|
|
31
30
|
};
|
|
32
31
|
}
|
|
33
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
32
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVuZGVyaW5nLmhlbHBlcnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvdXRpbHMvcmVuZGVyaW5nL3JlbmRlcmluZy5oZWxwZXJzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSx1QkFBdUIsRUFBRSxJQUFJLEVBQWMsU0FBUyxFQUFFLEVBQUUsRUFBRSxNQUFNLE1BQU0sQ0FBQztBQUNoRixPQUFPLEVBQ0wsV0FBVyxFQUNYLFNBQVMsRUFDVCxLQUFLLEVBQ0wsUUFBUSxFQUNSLElBQUksRUFDSixHQ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JzZXJ2YWJsZTxUW10+KSA9PiB7XG4gICAgcmV0dXJuIHNvdXJjZSQucGlwZShcbiAgICAgIG1lcmdlTWFwKChpdGVtcykgPT4ge1xuICAgICAgICBpZiAoIWlzRmlyc3RFbWlzc2lvbikge1xuICAgICAgICAgIHJldHVybiBvZihpdGVtcyk7XG4gICAgICAgIH1cblxuICAgICAgICBjb25zdCBpdGVtcyQgPSBmcm9tKGl0ZW1zKTtcblxuICAgICAgICByZXR1cm4gaXRlbXMkLnBpcGUoXG4gICAgICAgICAgYnVmZmVyQ291bnQoY29uY3VycmVuY3kpLFxuICAgICAgICAgIGNvbmNhdE1hcCgodmFsdWUsIGluZGV4KSA9PiB7XG4gICAgICAgICAgICByZXR1cm4gb2YodmFsdWUpLnBpcGUoXG4gICAgICAgICAgICAgIG9ic2VydmVPbihhbmltYXRpb25GcmFtZVNjaGVkdWxlciksXG4gICAgICAgICAgICAgIGRlbGF5KGluZGV4ICogZGVsYXlNcylcbiAgICAgICAgICAgICk7XG4gICAgICAgICAgfSksXG4gICAgICAgICAgc2NhbigoYWNjOiBUW10sIHN0ZXBzOiBUW10pID0+IHtcbiAgICAgICAgICAgIHJldHVybiBbLi4uYWNjLCAuLi5zdGVwc107XG4gICAgICAgICAgfSwgW10pLFxuICAgICAgICAgIHRhcCgoc2Nhbm5lZEl0ZW1zOiBUW10pID0+IHtcbiAgICAgICAgICAgIGNvbnN0IHNjYW5EaWRDb21wbGV0ZSA9IHNjYW5uZWRJdGVtcy5sZW5ndGggPT09IGl0ZW1zLmxlbmd0aDtcblxuICAgICAgICAgICAgaWYgKHNjYW5EaWRDb21wbGV0ZSkge1xuICAgICAgICAgICAgICBpc0ZpcnN0RW1pc3Npb24gPSBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KVxuICAgICAgICApO1xuICAgICAgfSlcbiAgICApO1xuICB9O1xufVxuIl19
|
package/fesm2022/o3r-core.mjs
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { map, filter, EMPTY,
|
|
1
|
+
import { map, filter, EMPTY, isObservable, of, from, identity, BehaviorSubject, merge, animationFrameScheduler, observeOn } from 'rxjs';
|
|
2
2
|
import { v4 } from 'uuid';
|
|
3
|
-
import { tap, startWith, pairwise, switchMap, catchError, filter as filter$1, delay, finalize,
|
|
4
|
-
import { createAction, props, INIT, UPDATE } from '@ngrx/store';
|
|
5
|
-
import { localStorageSync } from 'ngrx-store-localstorage';
|
|
6
|
-
import { utils } from '@ama-sdk/core';
|
|
3
|
+
import { tap, startWith, pairwise, switchMap, catchError, filter as filter$1, delay, finalize, bufferCount, concatMap, scan, mergeMap } from 'rxjs/operators';
|
|
7
4
|
|
|
8
5
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
9
6
|
/**
|
|
@@ -30,7 +27,6 @@ const DEFAULT_BUILD_PROPERTIES = {
|
|
|
30
27
|
const otterComponentInfoPropertyName = '__otter-info__';
|
|
31
28
|
/**
|
|
32
29
|
* Decorates an Angular component to provide Otter information
|
|
33
|
-
*
|
|
34
30
|
* @param info Information to define the Otter component
|
|
35
31
|
* @returns the component with the information
|
|
36
32
|
*/
|
|
@@ -43,6 +39,15 @@ function O3rComponent(info) {
|
|
|
43
39
|
};
|
|
44
40
|
}
|
|
45
41
|
|
|
42
|
+
/**
|
|
43
|
+
* Compute the name of the component with the library's name to generate unique component identifier used in metadata and different modules
|
|
44
|
+
* @param componentName Name of the component to get the configuration
|
|
45
|
+
* @param libraryName Name of the library the component is coming from
|
|
46
|
+
*/
|
|
47
|
+
function computeItemIdentifier(componentName, libraryName) {
|
|
48
|
+
return (libraryName ? libraryName + '#' : '') + componentName;
|
|
49
|
+
}
|
|
50
|
+
|
|
46
51
|
/** Type of a message exchanged within the Otter Framework */
|
|
47
52
|
const otterMessageType = 'otter';
|
|
48
53
|
/** Target of a message that should be handled by the application */
|
|
@@ -50,7 +55,6 @@ const applicationMessageTarget = 'app';
|
|
|
50
55
|
|
|
51
56
|
/**
|
|
52
57
|
* Determine if a message should be handle by the application
|
|
53
|
-
*
|
|
54
58
|
* @param message Message to analyze
|
|
55
59
|
*/
|
|
56
60
|
const isToAppOtterMessage = (message) => {
|
|
@@ -58,7 +62,6 @@ const isToAppOtterMessage = (message) => {
|
|
|
58
62
|
};
|
|
59
63
|
/**
|
|
60
64
|
* Determine if a message is emitted by an Otter tool
|
|
61
|
-
*
|
|
62
65
|
* @param message Message to analyze
|
|
63
66
|
*/
|
|
64
67
|
const isOtterMessage = (message) => {
|
|
@@ -66,7 +69,6 @@ const isOtterMessage = (message) => {
|
|
|
66
69
|
};
|
|
67
70
|
/**
|
|
68
71
|
* Send an Otter Message
|
|
69
|
-
*
|
|
70
72
|
* @param dataType Type of the message
|
|
71
73
|
* @param content content of the message
|
|
72
74
|
* @param preStringify determine if the message should JSON.stringify before being send (will use the default mechanism otherwise)
|
|
@@ -83,7 +85,6 @@ const sendOtterMessage = (dataType, content, preStringify = true) => {
|
|
|
83
85
|
};
|
|
84
86
|
/**
|
|
85
87
|
* Filter the Otter message that should be handle by the application and returns it content
|
|
86
|
-
*
|
|
87
88
|
* @param predicate condition to filter the message
|
|
88
89
|
* @returns content of the message
|
|
89
90
|
*/
|
|
@@ -104,7 +105,6 @@ function filterMessageContent(predicate) {
|
|
|
104
105
|
|
|
105
106
|
/**
|
|
106
107
|
* Determine if the action is an AsyncRequest action
|
|
107
|
-
*
|
|
108
108
|
* @param action Redux Action
|
|
109
109
|
*/
|
|
110
110
|
function isCallAction(action) {
|
|
@@ -115,7 +115,6 @@ function isCallAction(action) {
|
|
|
115
115
|
}
|
|
116
116
|
/**
|
|
117
117
|
* Determine if the action is an AsyncRequest action with a Request ID
|
|
118
|
-
*
|
|
119
118
|
* @param action Redux Action
|
|
120
119
|
*/
|
|
121
120
|
function isIdentifiedCallAction(action) {
|
|
@@ -123,7 +122,6 @@ function isIdentifiedCallAction(action) {
|
|
|
123
122
|
}
|
|
124
123
|
/**
|
|
125
124
|
* Determine if the given item implements the AsyncRequest interface
|
|
126
|
-
*
|
|
127
125
|
* @param item
|
|
128
126
|
*/
|
|
129
127
|
function isAsyncRequest(item) {
|
|
@@ -225,7 +223,6 @@ const asyncStoreItemAdapter = {
|
|
|
225
223
|
|
|
226
224
|
/**
|
|
227
225
|
* Create an Asynchronous Request Entity Adapter
|
|
228
|
-
*
|
|
229
226
|
* @param adapter Entity Adapter
|
|
230
227
|
*/
|
|
231
228
|
function createEntityAsyncRequestAdapter(adapter) {
|
|
@@ -288,7 +285,6 @@ const asyncProps = () => {
|
|
|
288
285
|
/**
|
|
289
286
|
* Custom operator to use instead of SwitchMap with effects based on FromApi actions.
|
|
290
287
|
* It makes sure to emit an action when the inner subscription is unsubscribed in order to keep the store up-to-date with pending information.
|
|
291
|
-
*
|
|
292
288
|
* @param successHandler function that returns the action to emit in case the FromApi call is a success
|
|
293
289
|
* @param errorHandler function that returns the action to emit in case the FromApi call fails
|
|
294
290
|
* @param cancelRequestActionFactory function that returns the action to emit in case the FromApi action is 'cancelled' because a new action was received by the switchMap
|
|
@@ -311,8 +307,8 @@ function fromApiEffectSwitchMap(successHandler, errorHandler, cancelRequestActio
|
|
|
311
307
|
}
|
|
312
308
|
};
|
|
313
309
|
return from(action.call).pipe(tap(cleanStack), switchMap((result) => {
|
|
314
|
-
const
|
|
315
|
-
return isObservable(success) ? success : of(success);
|
|
310
|
+
const sucessPromise = Promise.resolve(successHandler(result, action));
|
|
311
|
+
return from(sucessPromise).pipe(switchMap((success) => isObservable(success) ? success : of(success)));
|
|
316
312
|
}), catchError((error) => {
|
|
317
313
|
cleanStack();
|
|
318
314
|
return errorHandler?.(error, action) || EMPTY;
|
|
@@ -355,7 +351,6 @@ function fromApiEffectSwitchMapById(successHandler, errorHandler, cancelRequestA
|
|
|
355
351
|
|
|
356
352
|
/**
|
|
357
353
|
* Serializer for asynchronous store.
|
|
358
|
-
*
|
|
359
354
|
* @param state State of an asynchronous store to serialize
|
|
360
355
|
* @returns a plain json object to pass to json.stringify
|
|
361
356
|
*/
|
|
@@ -364,7 +359,6 @@ function asyncSerializer(state) {
|
|
|
364
359
|
}
|
|
365
360
|
/**
|
|
366
361
|
* Serializer for asynchronous entity store.
|
|
367
|
-
*
|
|
368
362
|
* @param state State of an asynchronous entity store to serialize
|
|
369
363
|
* @returns a plain json object to pass to json.stringify
|
|
370
364
|
*/
|
|
@@ -377,7 +371,6 @@ function asyncEntitySerializer(state) {
|
|
|
377
371
|
}
|
|
378
372
|
/**
|
|
379
373
|
* Serializer for asynchronous entity store with status.
|
|
380
|
-
*
|
|
381
374
|
* @param state State of an asynchronous entity store with status to serialize
|
|
382
375
|
* @returns a plain json object to pass to json.stringify
|
|
383
376
|
*/
|
|
@@ -389,9 +382,19 @@ function asyncEntityWithStatusSerializer(state) {
|
|
|
389
382
|
return { ...asyncStoreItemAdapter.clearAsyncStoreItem(state), entities };
|
|
390
383
|
}
|
|
391
384
|
|
|
385
|
+
class StateSerializer {
|
|
386
|
+
constructor(serializer) {
|
|
387
|
+
this.reviver = (_, value) => value;
|
|
388
|
+
this.serialize = serializer.serialize || this.serialize;
|
|
389
|
+
this.deserialize = serializer.deserialize || this.deserialize;
|
|
390
|
+
this.reviver = serializer.reviver || this.reviver;
|
|
391
|
+
this.replacer = serializer.replacer || this.replacer;
|
|
392
|
+
this.initialState = serializer.initialState || this.initialState;
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
|
|
392
396
|
/**
|
|
393
397
|
* Pad number
|
|
394
|
-
*
|
|
395
398
|
* @param val
|
|
396
399
|
* @param digits
|
|
397
400
|
*/
|
|
@@ -401,7 +404,6 @@ function padNumber(val, digits = 2) {
|
|
|
401
404
|
}
|
|
402
405
|
/**
|
|
403
406
|
* Returns TRUE if bootstrap config environment is production FALSE otherwise
|
|
404
|
-
*
|
|
405
407
|
* @param dataset
|
|
406
408
|
* @returns TRUE if bootstrap config environment is production FALSE otherwise
|
|
407
409
|
*/
|
|
@@ -411,40 +413,36 @@ function isProductionEnvironment(dataset) {
|
|
|
411
413
|
return bootstrapConfig?.environment === 'prod';
|
|
412
414
|
}
|
|
413
415
|
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
*
|
|
417
|
-
* @param obj
|
|
418
|
-
*/
|
|
419
|
-
function isDate(obj) {
|
|
420
|
-
return obj instanceof utils.DateTime || obj instanceof utils.Date;
|
|
421
|
-
}
|
|
416
|
+
const defaultConstruct = (data) => data;
|
|
417
|
+
const isDate = (data) => data instanceof Date && !isNaN(data);
|
|
422
418
|
/**
|
|
423
419
|
* Check if an object is not an array or a date
|
|
424
|
-
*
|
|
425
420
|
* @param obj
|
|
421
|
+
* @param additionalMappers
|
|
426
422
|
*/
|
|
427
|
-
function isObject(obj) {
|
|
428
|
-
return obj instanceof Object && !Array.isArray(obj) && !isDate(obj);
|
|
423
|
+
function isObject(obj, additionalMappers) {
|
|
424
|
+
return obj instanceof Object && !Array.isArray(obj) && !additionalMappers?.some((mapper) => mapper.condition(obj)) && !isDate(obj);
|
|
429
425
|
}
|
|
430
426
|
/**
|
|
431
427
|
* Return a new reference of the given object
|
|
432
|
-
*
|
|
433
428
|
* @param obj
|
|
429
|
+
* @param additionalMappers
|
|
434
430
|
*/
|
|
435
|
-
function immutablePrimitive(obj) {
|
|
431
|
+
function immutablePrimitive(obj, additionalMappers) {
|
|
436
432
|
if (Array.isArray(obj)) {
|
|
437
433
|
return obj.slice();
|
|
438
434
|
}
|
|
439
|
-
|
|
440
|
-
|
|
435
|
+
const matchingPrimitive = additionalMappers?.find((mapper) => mapper.condition(obj));
|
|
436
|
+
const resolvedType = matchingPrimitive && ((matchingPrimitive.construct || defaultConstruct)(obj));
|
|
437
|
+
if (resolvedType !== undefined) {
|
|
438
|
+
return resolvedType;
|
|
441
439
|
}
|
|
442
|
-
|
|
443
|
-
return new
|
|
440
|
+
if (isDate(obj)) {
|
|
441
|
+
return new Date(obj);
|
|
444
442
|
}
|
|
445
443
|
else if (obj instanceof Object) {
|
|
446
444
|
// eslint-disable-next-line no-use-before-define
|
|
447
|
-
return deepFill(obj, obj);
|
|
445
|
+
return deepFill(obj, obj, additionalMappers);
|
|
448
446
|
}
|
|
449
447
|
else {
|
|
450
448
|
return obj;
|
|
@@ -454,31 +452,31 @@ function immutablePrimitive(obj) {
|
|
|
454
452
|
* Deep fill of base object using source
|
|
455
453
|
* It will do a deep merge of the objects, overriding arrays
|
|
456
454
|
* All properties not present in source, but present in base, will remain
|
|
457
|
-
*
|
|
458
455
|
* @param base
|
|
459
456
|
* @param source
|
|
457
|
+
* @param additionalMappers Map of conditions of type mapper
|
|
460
458
|
*/
|
|
461
|
-
function deepFill(base, source) {
|
|
459
|
+
function deepFill(base, source, additionalMappers) {
|
|
462
460
|
if (typeof source === 'undefined') {
|
|
463
|
-
return deepFill(base, base);
|
|
461
|
+
return deepFill(base, base, additionalMappers);
|
|
464
462
|
}
|
|
465
|
-
if (!isObject(base)) {
|
|
466
|
-
return immutablePrimitive(typeof source !== 'undefined' ? source : base);
|
|
463
|
+
if (!isObject(base, additionalMappers)) {
|
|
464
|
+
return immutablePrimitive(typeof source !== 'undefined' ? source : base, additionalMappers);
|
|
467
465
|
}
|
|
468
466
|
const newObj = { ...base };
|
|
469
467
|
for (const key in base) {
|
|
470
468
|
if (key in source && typeof base[key] === typeof source[key]) {
|
|
471
469
|
const keyOfSource = source[key];
|
|
472
|
-
newObj[key] = typeof keyOfSource === 'undefined' ? immutablePrimitive(base[key]) : deepFill(base[key], source[key]);
|
|
470
|
+
newObj[key] = typeof keyOfSource === 'undefined' ? immutablePrimitive(base[key], additionalMappers) : deepFill(base[key], source[key], additionalMappers);
|
|
473
471
|
}
|
|
474
472
|
else {
|
|
475
|
-
newObj[key] = immutablePrimitive(base[key]);
|
|
473
|
+
newObj[key] = immutablePrimitive(base[key], additionalMappers);
|
|
476
474
|
}
|
|
477
475
|
}
|
|
478
476
|
// getting keys present in source and not present in base
|
|
479
477
|
for (const key in source) {
|
|
480
478
|
if (!(key in newObj)) {
|
|
481
|
-
newObj[key] = immutablePrimitive(source[key]);
|
|
479
|
+
newObj[key] = immutablePrimitive(source[key], additionalMappers);
|
|
482
480
|
}
|
|
483
481
|
}
|
|
484
482
|
return newObj;
|
|
@@ -488,7 +486,6 @@ function deepFill(base, source) {
|
|
|
488
486
|
* Buffers and emits data for lazy/progressive rendering of big lists
|
|
489
487
|
* That could solve issues with long-running tasks when trying to render an array
|
|
490
488
|
* of similar components.
|
|
491
|
-
*
|
|
492
489
|
* @param delayMs Delay between data emits
|
|
493
490
|
* @param concurrency Amount of elements that should be emitted at once
|
|
494
491
|
* @returns
|
|
@@ -515,128 +512,9 @@ function lazyArray(delayMs = 0, concurrency = 2) {
|
|
|
515
512
|
};
|
|
516
513
|
}
|
|
517
514
|
|
|
518
|
-
/**
|
|
519
|
-
* Defines if an object is a Serializer
|
|
520
|
-
*
|
|
521
|
-
* @deprecated will be removed in v10, use the one exported by @o3r/store-sync instead
|
|
522
|
-
* @param obj Object to test
|
|
523
|
-
* @returns True if the object is a Serializer
|
|
524
|
-
*/
|
|
525
|
-
const isSerializer = (obj) => !!(obj.serialize || obj.deserialize || obj.reviver || obj.replacer || obj.initialState);
|
|
526
|
-
/**
|
|
527
|
-
* Action to rehydrate the store
|
|
528
|
-
*
|
|
529
|
-
* @deprecated will be removed in v10, use the `rehydrateAction` exported by @o3r/store-sync instead
|
|
530
|
-
*/
|
|
531
|
-
const rehydrate = createAction('[CapacitorRehydrater] rehydrate', props());
|
|
532
|
-
/**
|
|
533
|
-
* Defines if the storage is a non-async storage
|
|
534
|
-
*
|
|
535
|
-
* @deprecated will be removed in v10, use the one exported by @o3r/store-sync instead
|
|
536
|
-
* @param options The storage config
|
|
537
|
-
* @returns in case the storage used is a non-async storage
|
|
538
|
-
*/
|
|
539
|
-
const isLocalStorageConfig = (options) => !options.storage || options.storage instanceof Storage;
|
|
540
|
-
class StorageSync {
|
|
541
|
-
constructor(options) {
|
|
542
|
-
this.alreadyHydratedStoreSlices = new Set();
|
|
543
|
-
this.hasHydrated = false;
|
|
544
|
-
/**
|
|
545
|
-
* Handle state manipulation in case of store storage sync
|
|
546
|
-
* Merge strategy is a full merge at init; When a new `store slice` is registered, its initial state is merged with its corresponding storage content
|
|
547
|
-
* Pass it as mergeReducer callback when calling localStorageSync function from 'ngrx-store-localstorage', in the app
|
|
548
|
-
*
|
|
549
|
-
* @deprecated will be removed in v10, use the one exported by @o3r/store-sync instead
|
|
550
|
-
* @param state actual state
|
|
551
|
-
* @param rehydratedState state from storage
|
|
552
|
-
* @param action Triggered action
|
|
553
|
-
*/
|
|
554
|
-
this.mergeReducer = (state, rehydratedState, action) => {
|
|
555
|
-
if (rehydratedState) {
|
|
556
|
-
if (action.type === INIT) {
|
|
557
|
-
state = deepFill(state, rehydratedState);
|
|
558
|
-
}
|
|
559
|
-
if (action.type === UPDATE && Array.isArray(action.features)) {
|
|
560
|
-
const notHandledFeatures = action.features.filter((featName) => !this.alreadyHydratedStoreSlices.has(featName));
|
|
561
|
-
notHandledFeatures.filter((featName) => !!rehydratedState[featName]).forEach((fName) => {
|
|
562
|
-
state[fName] = state[fName] ? deepFill(state[fName], rehydratedState[fName]) : rehydratedState[fName];
|
|
563
|
-
this.alreadyHydratedStoreSlices.add(fName);
|
|
564
|
-
});
|
|
565
|
-
}
|
|
566
|
-
}
|
|
567
|
-
return state;
|
|
568
|
-
};
|
|
569
|
-
this.options = {
|
|
570
|
-
keys: [],
|
|
571
|
-
...options,
|
|
572
|
-
mergeReducer: typeof options?.mergeReducer !== 'function' ? this.mergeReducer : options.mergeReducer
|
|
573
|
-
};
|
|
574
|
-
}
|
|
575
|
-
/**
|
|
576
|
-
* Returns a meta reducer that handles storage sync
|
|
577
|
-
*
|
|
578
|
-
* @deprecated will be removed in v10, use the one exported by @o3r/store-sync instead
|
|
579
|
-
*/
|
|
580
|
-
localStorageSync() {
|
|
581
|
-
return (reducer) => {
|
|
582
|
-
if (isLocalStorageConfig(this.options)) {
|
|
583
|
-
return localStorageSync(this.options)(reducer);
|
|
584
|
-
}
|
|
585
|
-
const base = localStorageSync({
|
|
586
|
-
...this.options,
|
|
587
|
-
rehydrate: false,
|
|
588
|
-
storage: this.options.storage,
|
|
589
|
-
syncCondition: () => this.hasHydrated
|
|
590
|
-
})(reducer);
|
|
591
|
-
return (state, action) => {
|
|
592
|
-
let hydratedState = state;
|
|
593
|
-
if (action.type === rehydrate.type) {
|
|
594
|
-
const hasAlreadyHydrated = this.hasHydrated;
|
|
595
|
-
this.hasHydrated = true;
|
|
596
|
-
const initialStates = this.options.keys.reduce((acc, key) => {
|
|
597
|
-
const storeName = Object.keys(key)[0];
|
|
598
|
-
const storeSynchronizer = key[storeName];
|
|
599
|
-
if (isSerializer(storeSynchronizer)) {
|
|
600
|
-
acc[storeName] = storeSynchronizer.initialState;
|
|
601
|
-
}
|
|
602
|
-
return acc;
|
|
603
|
-
}, {});
|
|
604
|
-
let overrides = {};
|
|
605
|
-
if (!hasAlreadyHydrated) {
|
|
606
|
-
overrides = Object.entries(action.payload).reduce((acc, [storeName, value]) => {
|
|
607
|
-
if (!initialStates[storeName] || initialStates[storeName] === state[storeName]) {
|
|
608
|
-
acc[storeName] = value;
|
|
609
|
-
}
|
|
610
|
-
else if (initialStates[storeName] !== state[storeName]) {
|
|
611
|
-
(this.options.logger || console).error(`Unable to rehydrate store "${storeName}", it has been modified before being hydrated`);
|
|
612
|
-
}
|
|
613
|
-
return acc;
|
|
614
|
-
}, {});
|
|
615
|
-
}
|
|
616
|
-
if (Object.keys(overrides).length) {
|
|
617
|
-
hydratedState = { ...state, ...overrides };
|
|
618
|
-
}
|
|
619
|
-
}
|
|
620
|
-
return base(hydratedState, action);
|
|
621
|
-
};
|
|
622
|
-
};
|
|
623
|
-
}
|
|
624
|
-
}
|
|
625
|
-
|
|
626
|
-
class StateSerializer {
|
|
627
|
-
constructor(serializer) {
|
|
628
|
-
this.reviver = (_, value) => value;
|
|
629
|
-
this.serialize = serializer.serialize || this.serialize;
|
|
630
|
-
this.deserialize = serializer.deserialize || this.deserialize;
|
|
631
|
-
this.reviver = serializer.reviver || this.reviver;
|
|
632
|
-
this.replacer = serializer.replacer || this.replacer;
|
|
633
|
-
this.initialState = serializer.initialState || this.initialState;
|
|
634
|
-
}
|
|
635
|
-
}
|
|
636
|
-
|
|
637
515
|
/**
|
|
638
516
|
* Generated bundle index. Do not edit.
|
|
639
517
|
*/
|
|
640
518
|
|
|
641
|
-
export { DEFAULT_BUILD_PROPERTIES, O3rComponent, StateSerializer,
|
|
519
|
+
export { DEFAULT_BUILD_PROPERTIES, O3rComponent, StateSerializer, applicationMessageTarget, asyncEntitySerializer, asyncEntityWithStatusSerializer, asyncProps, asyncSerializer, asyncStoreItemAdapter, computeItemIdentifier, createEntityAsyncRequestAdapter, deepFill, filterMessageContent, fromApiEffectSwitchMap, fromApiEffectSwitchMapById, immutablePrimitive, isAsyncRequest, isCallAction, isIdentifiedCallAction, isObject, isOtterMessage, isProductionEnvironment, isToAppOtterMessage, lazyArray, otterComponentInfoPropertyName, otterMessageType, padNumber, sendOtterMessage };
|
|
642
520
|
//# sourceMappingURL=o3r-core.mjs.map
|