@ngrx/data 12.4.0 → 13.0.0-rc.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.
Files changed (156) hide show
  1. package/{esm2015/index.js → esm2020/index.mjs} +0 -0
  2. package/esm2020/ngrx-data.mjs +5 -0
  3. package/{esm2015/public_api.js → esm2020/public_api.mjs} +0 -0
  4. package/esm2020/src/actions/entity-action-factory.mjs +50 -0
  5. package/{esm2015/src/actions/entity-action-guard.js → esm2020/src/actions/entity-action-guard.mjs} +0 -0
  6. package/{esm2015/src/actions/entity-action-operators.js → esm2020/src/actions/entity-action-operators.mjs} +0 -0
  7. package/{esm2015/src/actions/entity-action.js → esm2020/src/actions/entity-action.mjs} +0 -0
  8. package/esm2020/src/actions/entity-cache-action.mjs +116 -0
  9. package/esm2020/src/actions/entity-cache-change-set.mjs +50 -0
  10. package/{esm2015/src/actions/entity-op.js → esm2020/src/actions/entity-op.mjs} +0 -0
  11. package/{esm2015/src/actions/merge-strategy.js → esm2020/src/actions/merge-strategy.mjs} +0 -0
  12. package/{esm2015/src/actions/update-response-data.js → esm2020/src/actions/update-response-data.mjs} +0 -0
  13. package/{esm2015/src/dataservices/data-service-error.js → esm2020/src/dataservices/data-service-error.mjs} +0 -0
  14. package/{esm2015/src/dataservices/default-data-service-config.js → esm2020/src/dataservices/default-data-service-config.mjs} +0 -0
  15. package/{esm2015/src/dataservices/default-data.service.js → esm2020/src/dataservices/default-data.service.mjs} +13 -13
  16. package/esm2020/src/dataservices/entity-cache-data.service.mjs +146 -0
  17. package/esm2020/src/dataservices/entity-data.service.mjs +63 -0
  18. package/{esm2015/src/dataservices/http-url-generator.js → esm2020/src/dataservices/http-url-generator.mjs} +12 -10
  19. package/{esm2015/src/dataservices/interfaces.js → esm2020/src/dataservices/interfaces.mjs} +0 -0
  20. package/esm2020/src/dataservices/persistence-result-handler.service.mjs +49 -0
  21. package/esm2020/src/dispatchers/entity-cache-dispatcher.mjs +163 -0
  22. package/{esm2015/src/dispatchers/entity-commands.js → esm2020/src/dispatchers/entity-commands.mjs} +0 -0
  23. package/esm2020/src/dispatchers/entity-dispatcher-base.mjs +405 -0
  24. package/esm2020/src/dispatchers/entity-dispatcher-default-options.mjs +30 -0
  25. package/esm2020/src/dispatchers/entity-dispatcher-factory.mjs +65 -0
  26. package/{esm2015/src/dispatchers/entity-dispatcher.js → esm2020/src/dispatchers/entity-dispatcher.mjs} +0 -0
  27. package/esm2020/src/effects/entity-cache-effects.mjs +115 -0
  28. package/{esm2015/src/effects/entity-effects-scheduler.js → esm2020/src/effects/entity-effects-scheduler.mjs} +0 -0
  29. package/esm2020/src/effects/entity-effects.mjs +148 -0
  30. package/esm2020/src/entity-data-without-effects.module.mjs +160 -0
  31. package/esm2020/src/entity-data.module.mjs +121 -0
  32. package/esm2020/src/entity-metadata/entity-definition.mjs +33 -0
  33. package/esm2020/src/entity-metadata/entity-definition.service.mjs +93 -0
  34. package/{esm2015/src/entity-metadata/entity-filters.js → esm2020/src/entity-metadata/entity-filters.mjs} +0 -0
  35. package/{esm2015/src/entity-metadata/entity-metadata.js → esm2020/src/entity-metadata/entity-metadata.mjs} +0 -0
  36. package/{esm2015/src/entity-services/entity-collection-service-base.js → esm2020/src/entity-services/entity-collection-service-base.mjs} +0 -0
  37. package/esm2020/src/entity-services/entity-collection-service-elements-factory.mjs +38 -0
  38. package/esm2020/src/entity-services/entity-collection-service-factory.mjs +28 -0
  39. package/{esm2015/src/entity-services/entity-collection-service.js → esm2020/src/entity-services/entity-collection-service.mjs} +0 -0
  40. package/esm2020/src/entity-services/entity-services-base.mjs +119 -0
  41. package/esm2020/src/entity-services/entity-services-elements.mjs +33 -0
  42. package/{esm2015/src/entity-services/entity-services.js → esm2020/src/entity-services/entity-services.mjs} +0 -0
  43. package/{esm2015/src/index.js → esm2020/src/index.mjs} +0 -0
  44. package/{esm2015/src/reducers/constants.js → esm2020/src/reducers/constants.mjs} +0 -0
  45. package/esm2020/src/reducers/entity-cache-reducer.mjs +271 -0
  46. package/{esm2015/src/reducers/entity-cache.js → esm2020/src/reducers/entity-cache.mjs} +0 -0
  47. package/esm2020/src/reducers/entity-change-tracker-base.mjs +587 -0
  48. package/{esm2015/src/reducers/entity-change-tracker.js → esm2020/src/reducers/entity-change-tracker.mjs} +0 -0
  49. package/esm2020/src/reducers/entity-collection-creator.mjs +37 -0
  50. package/esm2020/src/reducers/entity-collection-reducer-methods.mjs +806 -0
  51. package/esm2020/src/reducers/entity-collection-reducer-registry.mjs +68 -0
  52. package/esm2020/src/reducers/entity-collection-reducer.mjs +24 -0
  53. package/{esm2015/src/reducers/entity-collection.js → esm2020/src/reducers/entity-collection.mjs} +0 -0
  54. package/{esm2015/src/selectors/entity-cache-selector.js → esm2020/src/selectors/entity-cache-selector.mjs} +0 -0
  55. package/esm2020/src/selectors/entity-selectors$.mjs +52 -0
  56. package/esm2020/src/selectors/entity-selectors.mjs +96 -0
  57. package/esm2020/src/utils/correlation-id-generator.mjs +30 -0
  58. package/esm2020/src/utils/default-logger.mjs +25 -0
  59. package/esm2020/src/utils/default-pluralizer.mjs +71 -0
  60. package/{esm2015/src/utils/guid-fns.js → esm2020/src/utils/guid-fns.mjs} +0 -0
  61. package/{esm2015/src/utils/interfaces.js → esm2020/src/utils/interfaces.mjs} +0 -0
  62. package/{esm2015/src/utils/utilities.js → esm2020/src/utils/utilities.mjs} +0 -0
  63. package/fesm2015/{ngrx-data.js → ngrx-data.mjs} +343 -286
  64. package/fesm2015/ngrx-data.mjs.map +1 -0
  65. package/fesm2020/ngrx-data.mjs +4936 -0
  66. package/fesm2020/ngrx-data.mjs.map +1 -0
  67. package/ngrx-data.d.ts +1 -1
  68. package/package.json +26 -14
  69. package/schematics/ng-add/index.js +29 -25
  70. package/schematics/ng-add/index.js.map +1 -1
  71. package/schematics-core/index.js +2 -1
  72. package/schematics-core/index.js.map +1 -1
  73. package/schematics-core/utility/angular-utils.js +6 -5
  74. package/schematics-core/utility/angular-utils.js.map +1 -1
  75. package/schematics-core/utility/ast-utils.js +12 -8
  76. package/schematics-core/utility/ast-utils.js.map +1 -1
  77. package/schematics-core/utility/find-component.js +12 -12
  78. package/schematics-core/utility/find-component.js.map +1 -1
  79. package/schematics-core/utility/find-module.js +12 -12
  80. package/schematics-core/utility/find-module.js.map +1 -1
  81. package/schematics-core/utility/json-utilts.js.map +1 -1
  82. package/schematics-core/utility/libs-version.js +1 -1
  83. package/schematics-core/utility/libs-version.js.map +1 -1
  84. package/schematics-core/utility/ngrx-utils.js +23 -13
  85. package/schematics-core/utility/ngrx-utils.js.map +1 -1
  86. package/schematics-core/utility/parse-name.js +3 -3
  87. package/schematics-core/utility/parse-name.js.map +1 -1
  88. package/schematics-core/utility/project.js +1 -1
  89. package/schematics-core/utility/project.js.map +1 -1
  90. package/schematics-core/utility/visitors.js +2 -2
  91. package/schematics-core/utility/visitors.js.map +1 -1
  92. package/src/actions/entity-action-factory.d.ts +3 -0
  93. package/src/dataservices/default-data.service.d.ts +3 -0
  94. package/src/dataservices/entity-cache-data.service.d.ts +3 -0
  95. package/src/dataservices/entity-data.service.d.ts +3 -0
  96. package/src/dataservices/http-url-generator.d.ts +3 -0
  97. package/src/dataservices/persistence-result-handler.service.d.ts +3 -0
  98. package/src/dispatchers/entity-cache-dispatcher.d.ts +3 -0
  99. package/src/dispatchers/entity-dispatcher-default-options.d.ts +3 -0
  100. package/src/dispatchers/entity-dispatcher-factory.d.ts +3 -0
  101. package/src/effects/entity-cache-effects.d.ts +3 -0
  102. package/src/effects/entity-effects.d.ts +3 -0
  103. package/src/entity-data-without-effects.module.d.ts +5 -0
  104. package/src/entity-data.module.d.ts +6 -0
  105. package/src/entity-metadata/entity-definition.service.d.ts +3 -0
  106. package/src/entity-services/entity-collection-service-base.d.ts +1 -1
  107. package/src/entity-services/entity-collection-service-elements-factory.d.ts +3 -0
  108. package/src/entity-services/entity-collection-service-factory.d.ts +3 -0
  109. package/src/entity-services/entity-services-base.d.ts +3 -0
  110. package/src/entity-services/entity-services-elements.d.ts +3 -0
  111. package/src/reducers/entity-cache-reducer.d.ts +3 -0
  112. package/src/reducers/entity-collection-creator.d.ts +3 -0
  113. package/src/reducers/entity-collection-reducer-methods.d.ts +3 -0
  114. package/src/reducers/entity-collection-reducer-registry.d.ts +3 -0
  115. package/src/reducers/entity-collection-reducer.d.ts +3 -0
  116. package/src/selectors/entity-selectors$.d.ts +3 -0
  117. package/src/selectors/entity-selectors.d.ts +3 -0
  118. package/src/utils/correlation-id-generator.d.ts +3 -0
  119. package/src/utils/default-logger.d.ts +3 -0
  120. package/src/utils/default-pluralizer.d.ts +3 -0
  121. package/bundles/ngrx-data.umd.js +0 -5418
  122. package/bundles/ngrx-data.umd.js.map +0 -1
  123. package/esm2015/ngrx-data.js +0 -6
  124. package/esm2015/src/actions/entity-action-factory.js +0 -43
  125. package/esm2015/src/actions/entity-cache-action.js +0 -116
  126. package/esm2015/src/actions/entity-cache-change-set.js +0 -50
  127. package/esm2015/src/dataservices/entity-cache-data.service.js +0 -141
  128. package/esm2015/src/dataservices/entity-data.service.js +0 -64
  129. package/esm2015/src/dataservices/persistence-result-handler.service.js +0 -51
  130. package/esm2015/src/dispatchers/entity-cache-dispatcher.js +0 -162
  131. package/esm2015/src/dispatchers/entity-dispatcher-base.js +0 -401
  132. package/esm2015/src/dispatchers/entity-dispatcher-default-options.js +0 -27
  133. package/esm2015/src/dispatchers/entity-dispatcher-factory.js +0 -61
  134. package/esm2015/src/effects/entity-cache-effects.js +0 -114
  135. package/esm2015/src/effects/entity-effects.js +0 -147
  136. package/esm2015/src/entity-data-without-effects.module.js +0 -126
  137. package/esm2015/src/entity-data.module.js +0 -103
  138. package/esm2015/src/entity-metadata/entity-definition.js +0 -26
  139. package/esm2015/src/entity-metadata/entity-definition.service.js +0 -89
  140. package/esm2015/src/entity-services/entity-collection-service-elements-factory.js +0 -42
  141. package/esm2015/src/entity-services/entity-collection-service-factory.js +0 -29
  142. package/esm2015/src/entity-services/entity-services-base.js +0 -120
  143. package/esm2015/src/entity-services/entity-services-elements.js +0 -37
  144. package/esm2015/src/reducers/entity-cache-reducer.js +0 -274
  145. package/esm2015/src/reducers/entity-change-tracker-base.js +0 -575
  146. package/esm2015/src/reducers/entity-collection-creator.js +0 -36
  147. package/esm2015/src/reducers/entity-collection-reducer-methods.js +0 -785
  148. package/esm2015/src/reducers/entity-collection-reducer-registry.js +0 -65
  149. package/esm2015/src/reducers/entity-collection-reducer.js +0 -25
  150. package/esm2015/src/selectors/entity-selectors$.js +0 -52
  151. package/esm2015/src/selectors/entity-selectors.js +0 -83
  152. package/esm2015/src/utils/correlation-id-generator.js +0 -27
  153. package/esm2015/src/utils/default-logger.js +0 -22
  154. package/esm2015/src/utils/default-pluralizer.js +0 -67
  155. package/fesm2015/ngrx-data.js.map +0 -1
  156. package/ngrx-data.metadata.json +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ngrx-utils.js","sourceRoot":"","sources":["../../../../../modules/data/schematics-core/utility/ngrx-utils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAiC;AACjC,uCAAyC;AACzC,mCAA4D;AAC5D,yDAA6E;AAC7E,6CAAiD;AACjD,6CAAkD;AAClD,yCAA8D;AAE9D,SAAgB,iBAAiB,CAAC,OAAY;IAC5C,OAAO,UAAC,IAAU;;QAChB,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE;YACrB,OAAO,IAAI,CAAC;SACb;QAED,IAAM,YAAY,GAAG,gBAAS,CAAC,MAAI,OAAO,CAAC,IAAI,SAAI,OAAO,CAAC,QAAU,CAAC,CAAC;QAEvE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE;YAC9B,MAAM,IAAI,KAAK,CAAC,6BAA2B,YAAY,oBAAiB,CAAC,CAAC;SAC3E;QAED,IAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACrC,IAAI,IAAI,KAAK,IA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AQ,GAAG,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;;YAC9C,KAAqB,IAAA,YAAA,SAAA,OAAO,CAAA,gCAAA,qDAAE;gBAAzB,IAAM,MAAM,oBAAA;gBACf,IAAI,MAAM,YAAY,qBAAY,EAAE;oBAClC,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;iBAC/C;aACF;;;;;;;;;QACD,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;QAE5B,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;AACJ,CAAC;AAlED,gEAkEC;AAED,SAAgB,IAAI,CAClB,MAAS,EACT,WAAoB;IAEpB,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;SACvB,MAAM,CAAC,UAAC,GAAG,IAAK,OAAA,GAAG,KAAK,WAAW,EAAnB,CAAmB,CAAC;SACpC,MAAM,CAAC,UAAC,MAAM,EAAE,GAAG;;QAAK,OAAA,MAAM,CAAC,MAAM,CAAC,MAAM,YAAI,GAAC,GAAG,IAAG,MAAM,CAAC,GAAG,CAAC,MAAG;IAA7C,CAA6C,EAAE,EAAE,CAAC,CAAC;AAChF,CAAC;AAPD,oBAOC","sourcesContent":["import * as ts from 'typescript';\nimport * as stringUtils from './strings';\nimport { InsertChange, Change, NoopChange } from './change';\nimport { Tree, SchematicsException, Rule } from '@angular-devkit/schematics';\nimport { normalize } from '@angular-devkit/core';\nimport { buildRelativePath } from './find-module';\nimport { addImportToModule, insertImport } from './ast-utils';\n\nexport function addReducerToState(options: any): Rule {\n return (host: Tree) => {\n if (!options.reducers) {\n return host;\n }\n\n const reducersPath = normalize(`/${options.path}/${options.reducers}`);\n\n if (!host.exists(reducersPath)) {\n throw new Error(`Specified reducers path ${reducersPath} does not exist`);\n }\n\n const text = host.read(reducersPath);\n if (text === null) {\n throw new SchematicsException(`File ${reducersPath} does not exist.`);\n }\n\n const sourceText = text.toString('utf-8');\n\n const source = ts.createSourceFile(\n reducersPath,\n sourceText,\n ts.ScriptTarget.Latest,\n true\n );\n\n const reducerPath =\n `/${options.path}/` +\n (options.flat ? '' : stringUtils.dasherize(options.name) + '/') +\n (options.group ? 'reducers/' : '') +\n stringUtils.dasherize(options.name) +\n '.reducer';\n\n const relativePath = buildRelativePath(reducersPath, reducerPath);\n const reducerImport = insertImport(\n source,\n reducersPath,\n `* as from${stringUtils.classify(options.name)}`,\n relativePath,\n true\n );\n\n const stateInterfaceInsert = addReducerToStateInterface(\n source,\n reducersPath,\n options\n );\n const reducerMapInsert = addReducerToActionReducerMap(\n source,\n reducersPath,\n options\n );\n\n const changes = [reducerImport, stateInterfaceInsert, reducerMapInsert];\n const recorder = host.beginUpdate(reducersPath);\n for (const change of changes) {\n if (change instanceof InsertChange) {\n recorder.insertLeft(change.pos, change.toAdd);\n }\n }\n host.commitUpdate(recorder);\n\n return host;\n };\n}\n\n/**\n * Insert the reducer into the first defined top level interface\n */\nexport function addReducerToStateInterface(\n source: ts.SourceFile,\n reducersPath: string,\n options: { name: string; plural: boolean }\n): Change {\n const stateInterface = source.statements.find(\n (stm) => stm.kind === ts.SyntaxKind.InterfaceDeclaration\n );\n let node = stateInterface as ts.Statement;\n\n if (!node) {\n return new NoopChange();\n }\n\n const state = options.plural\n ? stringUtils.pluralize(options.name)\n : stringUtils.camelize(options.name);\n\n const keyInsert = `[from${stringUtils.classify(\n options.name\n )}.${stringUtils.camelize(state)}FeatureKey]: from${stringUtils.classify(\n options.name\n )}.State;`;\n const expr = node as any;\n let position;\n let toInsert;\n\n if (expr.members.length === 0) {\n position = expr.getEnd() - 1;\n toInsert = ` ${keyInsert}\\n`;\n } else {\n node = expr.members[expr.members.length - 1];\n position = node.getEnd() + 1;\n // Get the indentation of the last element, if any.\n const text = node.getFullText(source);\n const matches = text.match(/^\\r?\\n+(\\s*)/);\n\n if (matches && matches.length > 0) {\n toInsert = `${matches[1]}${keyInsert}\\n`;\n } else {\n toInsert = `\\n${keyInsert}`;\n }\n }\n\n return new InsertChange(reducersPath, position, toInsert);\n}\n\n/**\n * Insert the reducer into the ActionReducerMap\n */\nexport function addReducerToActionReducerMap(\n source: ts.SourceFile,\n reducersPath: string,\n options: { name: string; plural: boolean }\n): Change {\n let initializer: any;\n const actionReducerMap: any = source.statements\n .filter((stm) => stm.kind === ts.SyntaxKind.VariableStatement)\n .filter((stm: any) => !!stm.declarationList)\n .map((stm: any) => {\n const {\n declarations,\n }: {\n declarations: ts.SyntaxKind.VariableDeclarationList[];\n } = stm.declarationList;\n const variable: any = declarations.find(\n (decl: any) => decl.kind === ts.SyntaxKind.VariableDeclaration\n );\n const type = variable ? variable.type : {};\n\n return { initializer: variable.initializer, type };\n })\n .filter((initWithType) => initWithType.type !== undefined)\n .find(({ type }) => type.typeName.text === 'ActionReducerMap');\n\n if (!actionReducerMap || !actionReducerMap.initializer) {\n return new NoopChange();\n }\n\n let node = actionReducerMap.initializer;\n\n const state = options.plural\n ? stringUtils.pluralize(options.name)\n : stringUtils.camelize(options.name);\n\n const keyInsert = `[from${stringUtils.classify(\n options.name\n )}.${stringUtils.camelize(state)}FeatureKey]: from${stringUtils.classify(\n options.name\n )}.reducer,`;\n const expr = node as any;\n let position;\n let toInsert;\n\n if (expr.properties.length === 0) {\n position = expr.getEnd() - 1;\n toInsert = ` ${keyInsert}\\n`;\n } else {\n node = expr.properties[expr.properties.length - 1];\n position = node.getEnd() + 1;\n // Get the indentation of the last element, if any.\n const text = node.getFullText(source);\n const matches = text.match(/^\\r?\\n+(\\s*)/);\n\n if (matches && matches.length > 0) {\n toInsert = `\\n${matches[1]}${keyInsert}`;\n } else {\n toInsert = `\\n${keyInsert}`;\n }\n }\n\n return new InsertChange(reducersPath, position, toInsert);\n}\n\n/**\n * Add reducer feature to NgModule\n */\nexport function addReducerImportToNgModule(options: any): Rule {\n return (host: Tree) => {\n if (!options.module) {\n return host;\n }\n\n const modulePath = options.module;\n if (!host.exists(options.module)) {\n throw new Error(`Specified module path ${modulePath} does not exist`);\n }\n\n const text = host.read(modulePath);\n if (text === null) {\n throw new SchematicsException(`File ${modulePath} does not exist.`);\n }\n const sourceText = text.toString('utf-8');\n\n const source = ts.createSourceFile(\n modulePath,\n sourceText,\n ts.ScriptTarget.Latest,\n true\n );\n\n const commonImports = [\n insertImport(source, modulePath, 'StoreModule', '@ngrx/store'),\n ];\n\n const reducerPath =\n `/${options.path}/` +\n (options.flat ? '' : stringUtils.dasherize(options.name) + '/') +\n (options.group ? 'reducers/' : '') +\n stringUtils.dasherize(options.name) +\n '.reducer';\n const relativePath = buildRelativePath(modulePath, reducerPath);\n const reducerImport = insertImport(\n source,\n modulePath,\n `* as from${stringUtils.classify(options.name)}`,\n relativePath,\n true\n );\n const state = options.plural\n ? stringUtils.pluralize(options.name)\n : stringUtils.camelize(options.name);\n const [storeNgModuleImport] = addImportToModule(\n source,\n modulePath,\n `StoreModule.forFeature(from${stringUtils.classify(\n options.name\n )}.${state}FeatureKey, from${stringUtils.classify(\n options.name\n )}.reducer)`,\n relativePath\n );\n const changes = [...commonImports, reducerImport, storeNgModuleImport];\n const recorder = host.beginUpdate(modulePath);\n for (const change of changes) {\n if (change instanceof InsertChange) {\n recorder.insertLeft(change.pos, change.toAdd);\n }\n }\n host.commitUpdate(recorder);\n\n return host;\n };\n}\n\nexport function omit<T extends { [key: string]: any }>(\n object: T,\n keyToRemove: keyof T\n): Partial<T> {\n return Object.keys(object)\n .filter((key) => key !== keyToRemove)\n .reduce((result, key) => Object.assign(result, { [key]: object[key] }), {});\n}\n"]}
1
+ {"version":3,"file":"ngrx-utils.js","sourceRoot":"","sources":["../../../../../modules/data/schematics-core/utility/ngrx-utils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAiC;AACjC,uCAAyC;AACzC,mCAA4D;AAC5D,yDAA6E;AAC7E,6CAAiD;AACjD,6CAAkD;AAClD,yCAA8D;AAE9D,SAAgB,iBAAiB,CAA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CAAC;AAPD,oBAOC;AAED,SAAgB,SAAS,CAAC,OAAgD;IACxE,OAAO,OAAO,CAAC,QAAQ;QACrB,CAAC,CAAC,WAAW,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,IAAI,MAAM,CAAC;QAChD,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,OAAO,CAAC,MAAM,IAAI,MAAM,CAAC,CAAC;AACvD,CAAC;AAJD,8BAIC","sourcesContent":["import * as ts from 'typescript';\nimport * as stringUtils from './strings';\nimport { InsertChange, Change, NoopChange } from './change';\nimport { Tree, SchematicsException, Rule } from '@angular-devkit/schematics';\nimport { normalize } from '@angular-devkit/core';\nimport { buildRelativePath } from './find-module';\nimport { addImportToModule, insertImport } from './ast-utils';\n\nexport function addReducerToState(options: any): Rule {\n return (host: Tree) => {\n if (!options.reducers) {\n return host;\n }\n\n const reducersPath = normalize(`/${options.path}/${options.reducers}`);\n\n if (!host.exists(reducersPath)) {\n throw new Error(`Specified reducers path ${reducersPath} does not exist`);\n }\n\n const text = host.read(reducersPath);\n if (text === null) {\n throw new SchematicsException(`File ${reducersPath} does not exist.`);\n }\n\n const sourceText = text.toString('utf-8');\n\n const source = ts.createSourceFile(\n reducersPath,\n sourceText,\n ts.ScriptTarget.Latest,\n true\n );\n\n const reducerPath =\n `/${options.path}/` +\n (options.flat ? '' : stringUtils.dasherize(options.name) + '/') +\n (options.group ? 'reducers/' : '') +\n stringUtils.dasherize(options.name) +\n '.reducer';\n\n const relativePath = buildRelativePath(reducersPath, reducerPath);\n const reducerImport = insertImport(\n source,\n reducersPath,\n `* as from${stringUtils.classify(options.name)}`,\n relativePath,\n true\n );\n\n const stateInterfaceInsert = addReducerToStateInterface(\n source,\n reducersPath,\n options\n );\n const reducerMapInsert = addReducerToActionReducerMap(\n source,\n reducersPath,\n options\n );\n\n const changes = [reducerImport, stateInterfaceInsert, reducerMapInsert];\n const recorder = host.beginUpdate(reducersPath);\n for (const change of changes) {\n if (change instanceof InsertChange) {\n recorder.insertLeft(change.pos, change.toAdd);\n }\n }\n host.commitUpdate(recorder);\n\n return host;\n };\n}\n\n/**\n * Insert the reducer into the first defined top level interface\n */\nexport function addReducerToStateInterface(\n source: ts.SourceFile,\n reducersPath: string,\n options: { name: string; plural: boolean }\n): Change {\n const stateInterface = source.statements.find(\n (stm) => stm.kind === ts.SyntaxKind.InterfaceDeclaration\n );\n let node = stateInterface as ts.Statement;\n\n if (!node) {\n return new NoopChange();\n }\n\n const state = options.plural\n ? stringUtils.pluralize(options.name)\n : stringUtils.camelize(options.name);\n\n const keyInsert = `[from${stringUtils.classify(\n options.name\n )}.${stringUtils.camelize(state)}FeatureKey]: from${stringUtils.classify(\n options.name\n )}.State;`;\n const expr = node as any;\n let position;\n let toInsert;\n\n if (expr.members.length === 0) {\n position = expr.getEnd() - 1;\n toInsert = ` ${keyInsert}\\n`;\n } else {\n node = expr.members[expr.members.length - 1];\n position = node.getEnd() + 1;\n // Get the indentation of the last element, if any.\n const text = node.getFullText(source);\n const matches = text.match(/^\\r?\\n+(\\s*)/);\n\n if (matches && matches.length > 0) {\n toInsert = `${matches[1]}${keyInsert}\\n`;\n } else {\n toInsert = `\\n${keyInsert}`;\n }\n }\n\n return new InsertChange(reducersPath, position, toInsert);\n}\n\n/**\n * Insert the reducer into the ActionReducerMap\n */\nexport function addReducerToActionReducerMap(\n source: ts.SourceFile,\n reducersPath: string,\n options: { name: string; plural: boolean }\n): Change {\n let initializer: any;\n const actionReducerMap: any = source.statements\n .filter((stm) => stm.kind === ts.SyntaxKind.VariableStatement)\n .filter((stm: any) => !!stm.declarationList)\n .map((stm: any) => {\n const {\n declarations,\n }: {\n declarations: ts.SyntaxKind.VariableDeclarationList[];\n } = stm.declarationList;\n const variable: any = declarations.find(\n (decl: any) => decl.kind === ts.SyntaxKind.VariableDeclaration\n );\n const type = variable ? variable.type : {};\n\n return { initializer: variable.initializer, type };\n })\n .filter((initWithType) => initWithType.type !== undefined)\n .find(({ type }) => type.typeName.text === 'ActionReducerMap');\n\n if (!actionReducerMap || !actionReducerMap.initializer) {\n return new NoopChange();\n }\n\n let node = actionReducerMap.initializer;\n\n const state = options.plural\n ? stringUtils.pluralize(options.name)\n : stringUtils.camelize(options.name);\n\n const keyInsert = `[from${stringUtils.classify(\n options.name\n )}.${stringUtils.camelize(state)}FeatureKey]: from${stringUtils.classify(\n options.name\n )}.reducer,`;\n const expr = node as any;\n let position;\n let toInsert;\n\n if (expr.properties.length === 0) {\n position = expr.getEnd() - 1;\n toInsert = ` ${keyInsert}\\n`;\n } else {\n node = expr.properties[expr.properties.length - 1];\n position = node.getEnd() + 1;\n // Get the indentation of the last element, if any.\n const text = node.getFullText(source);\n const matches = text.match(/^\\r?\\n+(\\s*)/);\n\n if (matches && matches.length > 0) {\n toInsert = `\\n${matches[1]}${keyInsert}`;\n } else {\n toInsert = `\\n${keyInsert}`;\n }\n }\n\n return new InsertChange(reducersPath, position, toInsert);\n}\n\n/**\n * Add reducer feature to NgModule\n */\nexport function addReducerImportToNgModule(options: any): Rule {\n return (host: Tree) => {\n if (!options.module) {\n return host;\n }\n\n const modulePath = options.module;\n if (!host.exists(options.module)) {\n throw new Error(`Specified module path ${modulePath} does not exist`);\n }\n\n const text = host.read(modulePath);\n if (text === null) {\n throw new SchematicsException(`File ${modulePath} does not exist.`);\n }\n const sourceText = text.toString('utf-8');\n\n const source = ts.createSourceFile(\n modulePath,\n sourceText,\n ts.ScriptTarget.Latest,\n true\n );\n\n const commonImports = [\n insertImport(source, modulePath, 'StoreModule', '@ngrx/store'),\n ];\n\n const reducerPath =\n `/${options.path}/` +\n (options.flat ? '' : stringUtils.dasherize(options.name) + '/') +\n (options.group ? 'reducers/' : '') +\n stringUtils.dasherize(options.name) +\n '.reducer';\n const relativePath = buildRelativePath(modulePath, reducerPath);\n const reducerImport = insertImport(\n source,\n modulePath,\n `* as from${stringUtils.classify(options.name)}`,\n relativePath,\n true\n );\n const state = options.plural\n ? stringUtils.pluralize(options.name)\n : stringUtils.camelize(options.name);\n const [storeNgModuleImport] = addImportToModule(\n source,\n modulePath,\n `StoreModule.forFeature(from${stringUtils.classify(\n options.name\n )}.${state}FeatureKey, from${stringUtils.classify(\n options.name\n )}.reducer)`,\n relativePath\n );\n const changes = [...commonImports, reducerImport, storeNgModuleImport];\n const recorder = host.beginUpdate(modulePath);\n for (const change of changes) {\n if (change instanceof InsertChange) {\n recorder.insertLeft(change.pos, change.toAdd);\n }\n }\n host.commitUpdate(recorder);\n\n return host;\n };\n}\n\nexport function omit<T extends { [key: string]: any }>(\n object: T,\n keyToRemove: keyof T\n): Partial<T> {\n return Object.keys(object)\n .filter((key) => key !== keyToRemove)\n .reduce((result, key) => Object.assign(result, { [key]: object[key] }), {});\n}\n\nexport function getPrefix(options: { prefix?: string; creators?: boolean }) {\n return options.creators\n ? stringUtils.camelize(options.prefix || 'load')\n : stringUtils.capitalize(options.prefix || 'load');\n}\n"]}
@@ -3,11 +3,11 @@ exports.__esModule = true;
3
3
  exports.parseName = void 0;
4
4
  var core_1 = require("@angular-devkit/core");
5
5
  function parseName(path, name) {
6
- var nameWithoutPath = core_1.basename(name);
7
- var namePath = core_1.dirname((path + '/' + name));
6
+ var nameWithoutPath = (0, core_1.basename)(name);
7
+ var namePath = (0, core_1.dirname)((path + '/' + name));
8
8
  return {
9
9
  name: nameWithoutPath,
10
- path: core_1.normalize('/' + namePath)
10
+ path: (0, core_1.normalize)('/' + namePath)
11
11
  };
12
12
  }
13
13
  exports.parseName = parseName;
@@ -1 +1 @@
1
- {"version":3,"file":"parse-name.js","sourceRoot":"","sources":["../../../../../modules/data/schematics-core/utility/parse-name.ts"],"names":[],"mappings":";;;AAAA,6CAA0E;AAO1E,SAAgB,SAAS,CAAC,IAAY,EAAE,IAAY;IAClD,IAAM,eAAe,GAAG,eAAQ,CAAC,IAAY,CAAC,CAAC;IAC/C,IAAM,QAAQ,GAAG,cAAO,CAAC,CAAC,IAAI,GAAG,GAAG,GAAG,IAAI,CAAS,CAAC,CAAC;IAEtD,OAAO;QACL,IAAI,EAAE,eAAe;QACrB,IAAI,EAAE,gBAAS,CAAC,GAAG,GAAG,QAAQ,CAAC;KAChC,CAAC;AACJ,CAAC;AARD,8BAQC","sourcesContent":["import { Path, basename, dirname, normalize } from '@angular-devkit/core';\n\nexport interface Location {\n name: string;\n path: Path;\n}\n\nexport function parseName(path: string, name: string): Location {\n const nameWithoutPath = basename(name as Path);\n const namePath = dirname((path + '/' + name) as Path);\n\n return {\n name: nameWithoutPath,\n path: normalize('/' + namePath),\n };\n}\n"]}
1
+ {"version":3,"file":"parse-name.js","sourceRoot":"","sources":["../../../../../modules/data/schematics-core/utility/parse-name.ts"],"names":[],"mappings":";;;AAAA,6CAA0E;AAO1E,SAAgB,SAAS,CAAC,IAAY,EAAE,IAAY;IAClD,IAAM,eAAe,GAAG,IAAA,eAAQ,EAAC,IAAY,CAAC,CAAC;IAC/C,IAAM,QAAQ,GAAG,IAAA,cAAO,EAAC,CAAC,IAAI,GAAG,GAAG,GAAG,IAAI,CAAS,CAAC,CAAC;IAEtD,OAAO;QACL,IAAI,EAAE,eAAe;QACrB,IAAI,EAAE,IAAA,gBAAS,EAAC,GAAG,GAAG,QAAQ,CAAC;KAChC,CAAC;AACJ,CAAC;AARD,8BAQC","sourcesContent":["import { Path, basename, dirname, normalize } from '@angular-devkit/core';\n\nexport interface Location {\n name: string;\n path: Path;\n}\n\nexport function parseName(path: string, name: string): Location {\n const nameWithoutPath = basename(name as Path);\n const namePath = dirname((path + '/' + name) as Path);\n\n return {\n name: nameWithoutPath,\n path: normalize('/' + namePath),\n };\n}\n"]}
@@ -3,7 +3,7 @@ exports.__esModule = true;
3
3
  exports.isLib = exports.getProjectPath = exports.getProject = void 0;
4
4
  var config_1 = require("./config");
5
5
  function getProject(host, options) {
6
- var workspace = config_1.getWorkspace(host);
6
+ var workspace = (0, config_1.getWorkspace)(host);
7
7
  if (!options.project) {
8
8
  var defaultProject = workspace
9
9
  .defaultProject;
@@ -1 +1 @@
1
- {"version":3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AAED,SAAgB,KAAK,CACnB,IAAU,EACV,OAAoE;IAEpE,IAAM,OAAO,GAAG,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAE1C,OAAO,OAAO,CAAC,WAAW,KAAK,SAAS,CAAC;AAC3C,CAAC;AAPD,sBAOC","sourcesContent":["import { getWorkspace } from './config';\nimport { Tree } from '@angular-devkit/schematics';\n\nexport interface WorkspaceProject {\n root: string;\n projectType: string;\n}\n\nexport function getProject(\n host: Tree,\n options: { project?: string | undefined; path?: string | undefined }\n): WorkspaceProject {\n const workspace = getWorkspace(host);\n\n if (!options.project) {\n const defaultProject = (workspace as { defaultProject?: string })\n .defaultProject;\n options.project =\n defaultProject !== undefined\n ? defaultProject\n : Object.keys(workspace.projects)[0];\n }\n\n return workspace.projects[options.project];\n}\n\nexport function getProjectPath(\n host: Tree,\n options: { project?: string | undefined; path?: string | undefined }\n) {\n const project = getProject(host, options);\n\n if (project.root.substr(-1) === '/') {\n project.root = project.root.substr(0, project.root.length - 1);\n }\n\n if (options.path === undefined) {\n const projectDirName =\n project.projectType === 'application' ? 'app' : 'lib';\n\n return `${project.root ? `/${project.root}` : ''}/src/${projectDirName}`;\n }\n\n return options.path;\n}\n\nexport function isLib(\n host: Tree,\n options: { project?: string | undefined; path?: string | undefined }\n) {\n const project = getProject(host, options);\n\n return project.projectType === 'library';\n}\n"]}
1
+ {"version":3,"file":"project.js","sourceRoot":"","sources":["../../../../../modules/data/schematics-core/utility/project.ts"],"names":[],"mappings":";;;AAAA,mCAAwC;AAQxC,SAAgB,UAAU,CACxB,IAAU,EACV,OAAoE;IAEpE,IAAM,SAAS,GAAG,IAAA,qBAAY,EAAC,IAAI,CAAC,CAAC;IAErC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE;QACpB,IAAM,cAAc,GAAI,SAAyC;aAC9D,cAAc,CAAC;QAClB,OAAO,CAAC,OAAO;YACb,cAAc,KAAK,SAAS;gBAC1B,CAAC,CAAC,cAAc;gBAChB,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;KAC1C;IAED,OAAO,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;AAC7C,CAAC;AAhBD,gCAgBC;AAED,SAAgB,cAAc,CAC5B,IAAU,EACV,OAAoE;IAEpE,IAAM,OAAO,GAAG,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAE1C,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;QACnC,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;KAChE;IAED,IAAI,OAAO,CAAC,IAAI,KAAK,SAAS,EAAE;QAC9B,IAAM,cAAc,GAClB,OAAO,CAAC,WAAW,KAAK,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;QAExD,OAAO,CAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,MAAI,OAAO,CAAC,IAAM,CAAC,CAAC,CAAC,EAAE,cAAQ,cAAgB,CAAC;KAC1E;IAED,OAAO,OAAO,CAAC,IAAI,CAAC;AACtB,CAAC;AAlBD,wCAkBC;AAED,SAAgB,KAAK,CACnB,IAAU,EACV,OAAoE;IAEpE,IAAM,OAAO,GAAG,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAE1C,OAAO,OAAO,CAAC,WAAW,KAAK,SAAS,CAAC;AAC3C,CAAC;AAPD,sBAOC","sourcesContent":["import { getWorkspace } from './config';\nimport { Tree } from '@angular-devkit/schematics';\n\nexport interface WorkspaceProject {\n root: string;\n projectType: string;\n}\n\nexport function getProject(\n host: Tree,\n options: { project?: string | undefined; path?: string | undefined }\n): WorkspaceProject {\n const workspace = getWorkspace(host);\n\n if (!options.project) {\n const defaultProject = (workspace as { defaultProject?: string })\n .defaultProject;\n options.project =\n defaultProject !== undefined\n ? defaultProject\n : Object.keys(workspace.projects)[0];\n }\n\n return workspace.projects[options.project];\n}\n\nexport function getProjectPath(\n host: Tree,\n options: { project?: string | undefined; path?: string | undefined }\n) {\n const project = getProject(host, options);\n\n if (project.root.substr(-1) === '/') {\n project.root = project.root.substr(0, project.root.length - 1);\n }\n\n if (options.path === undefined) {\n const projectDirName =\n project.projectType === 'application' ? 'app' : 'lib';\n\n return `${project.root ? `/${project.root}` : ''}/src/${projectDirName}`;\n }\n\n return options.path;\n}\n\nexport function isLib(\n host: Tree,\n options: { project?: string | undefined; path?: string | undefined }\n) {\n const project = getProject(host, options);\n\n return project.projectType === 'library';\n}\n"]}
@@ -96,8 +96,8 @@ function visitTemplates(tree, visitor) {
96
96
  }
97
97
  else if (n.name.text === 'templateUrl' &&
98
98
  ts.isStringLiteralLike(n.initializer)) {
99
- var parts = core_1.normalize(source.fileName).split('/').slice(0, -1);
100
- var templatePath = core_1.resolve(core_1.normalize(parts.join('/')), core_1.normalize(n.initializer.text));
99
+ var parts = (0, core_1.normalize)(source.fileName).split('/').slice(0, -1);
100
+ var templatePath = (0, core_1.resolve)((0, core_1.normalize)(parts.join('/')), (0, core_1.normalize)(n.initializer.text));
101
101
  if (!tree.exists(templatePath)) {
102
102
  return;
103
103
  }
@@ -1 +1 @@
1
- {"version":3,"file":"visitors.js","sourceRoot":"","sources":["../../../../../modules/data/schematics-core/utility/visitors.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAiC;AACjC,6CAA0D;AAG1D,SAAgB,kBAAkB,CAChC,IAAU,EACV,OAIuB;;IAEvB,IAAI,MAAM,GAAuB,SAAS,CAAC;;QAC3C,KAAyB,IAAA,KAAA,SAAA,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA,gBAAA,4BA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S;iBACV;gBAED,sBAAA,SAAO,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAA,EAAA;;gBAAjC,SAAiC,CAAC;;;;;;;;;;;;;;;;;;;CAErC","sourcesContent":["import * as ts from 'typescript';\nimport { normalize, resolve } from '@angular-devkit/core';\nimport { Tree, DirEntry } from '@angular-devkit/schematics';\n\nexport function visitTSSourceFiles<Result = void>(\n tree: Tree,\n visitor: (\n sourceFile: ts.SourceFile,\n tree: Tree,\n result?: Result\n ) => Result | undefined\n): Result | undefined {\n let result: Result | undefined = undefined;\n for (const sourceFile of visit(tree.root)) {\n result = visitor(sourceFile, tree, result);\n }\n\n return result;\n}\n\nexport function visitTemplates(\n tree: Tree,\n visitor: (\n template: {\n fileName: string;\n content: string;\n inline: boolean;\n start: number;\n },\n tree: Tree\n ) => void\n): void {\n visitTSSourceFiles(tree, (source) => {\n visitComponents(source, (_, decoratorExpressionNode) => {\n ts.forEachChild(decoratorExpressionNode, function findTemplates(n) {\n if (ts.isPropertyAssignment(n) && ts.isIdentifier(n.name)) {\n if (\n n.name.text === 'template' &&\n ts.isStringLiteralLike(n.initializer)\n ) {\n // Need to add an offset of one to the start because the template quotes are\n // not part of the template content.\n const templateStartIdx = n.initializer.getStart() + 1;\n visitor(\n {\n fileName: source.fileName,\n content: n.initializer.text,\n inline: true,\n start: templateStartIdx,\n },\n tree\n );\n return;\n } else if (\n n.name.text === 'templateUrl' &&\n ts.isStringLiteralLike(n.initializer)\n ) {\n const parts = normalize(source.fileName).split('/').slice(0, -1);\n const templatePath = resolve(\n normalize(parts.join('/')),\n normalize(n.initializer.text)\n );\n if (!tree.exists(templatePath)) {\n return;\n }\n\n const fileContent = tree.read(templatePath);\n if (!fileContent) {\n return;\n }\n\n visitor(\n {\n fileName: templatePath,\n content: fileContent.toString(),\n inline: false,\n start: 0,\n },\n tree\n );\n return;\n }\n }\n\n ts.forEachChild(n, findTemplates);\n });\n });\n });\n}\n\nexport function visitNgModuleImports(\n sourceFile: ts.SourceFile,\n callback: (\n importNode: ts.PropertyAssignment,\n elementExpressions: ts.NodeArray<ts.Expression>\n ) => void\n) {\n visitNgModuleProperty(sourceFile, callback, 'imports');\n}\n\nexport function visitNgModuleExports(\n sourceFile: ts.SourceFile,\n callback: (\n exportNode: ts.PropertyAssignment,\n elementExpressions: ts.NodeArray<ts.Expression>\n ) => void\n) {\n visitNgModuleProperty(sourceFile, callback, 'exports');\n}\n\nfunction visitNgModuleProperty(\n sourceFile: ts.SourceFile,\n callback: (\n nodes: ts.PropertyAssignment,\n elementExpressions: ts.NodeArray<ts.Expression>\n ) => void,\n property: string\n) {\n visitNgModules(sourceFile, (_, decoratorExpressionNode) => {\n ts.forEachChild(decoratorExpressionNode, function findTemplates(n) {\n if (\n ts.isPropertyAssignment(n) &&\n ts.isIdentifier(n.name) &&\n n.name.text === property &&\n ts.isArrayLiteralExpression(n.initializer)\n ) {\n callback(n, n.initializer.elements);\n return;\n }\n\n ts.forEachChild(n, findTemplates);\n });\n });\n}\nexport function visitComponents(\n sourceFile: ts.SourceFile,\n callback: (\n classDeclarationNode: ts.ClassDeclaration,\n decoratorExpressionNode: ts.ObjectLiteralExpression\n ) => void\n) {\n visitDecorator(sourceFile, 'Component', callback);\n}\n\nexport function visitNgModules(\n sourceFile: ts.SourceFile,\n callback: (\n classDeclarationNode: ts.ClassDeclaration,\n decoratorExpressionNode: ts.ObjectLiteralExpression\n ) => void\n) {\n visitDecorator(sourceFile, 'NgModule', callback);\n}\n\nexport function visitDecorator(\n sourceFile: ts.SourceFile,\n decoratorName: string,\n callback: (\n classDeclarationNode: ts.ClassDeclaration,\n decoratorExpressionNode: ts.ObjectLiteralExpression\n ) => void\n) {\n ts.forEachChild(sourceFile, function findClassDeclaration(node) {\n if (!ts.isClassDeclaration(node)) {\n ts.forEachChild(node, findClassDeclaration);\n }\n\n const classDeclarationNode = node as ts.ClassDeclaration;\n\n if (\n !classDeclarationNode.decorators ||\n !classDeclarationNode.decorators.length\n ) {\n return;\n }\n\n const componentDecorator = classDeclarationNode.decorators.find((d) => {\n return (\n ts.isCallExpression(d.expression) &&\n ts.isIdentifier(d.expression.expression) &&\n d.expression.expression.text === decoratorName\n );\n });\n\n if (!componentDecorator) {\n return;\n }\n\n const { expression } = componentDecorator;\n if (!ts.isCallExpression(expression)) {\n return;\n }\n\n const [arg] = expression.arguments;\n if (!arg || !ts.isObjectLiteralExpression(arg)) {\n return;\n }\n\n callback(classDeclarationNode, arg);\n });\n}\n\nfunction* visit(directory: DirEntry): IterableIterator<ts.SourceFile> {\n for (const path of directory.subfiles) {\n if (path.endsWith('.ts') && !path.endsWith('.d.ts')) {\n const entry = directory.file(path);\n if (entry) {\n const content = entry.content;\n const source = ts.createSourceFile(\n entry.path,\n content.toString().replace(/^\\uFEFF/, ''),\n ts.ScriptTarget.Latest,\n true\n );\n yield source;\n }\n }\n }\n\n for (const path of directory.subdirs) {\n if (path === 'node_modules') {\n continue;\n }\n\n yield* visit(directory.dir(path));\n }\n}\n"]}
1
+ {"version":3,"file":"visitors.js","sourceRoot":"","sources":["../../../../../modules/data/schematics-core/utility/visitors.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAiC;AACjC,6CAA0D;AAG1D,SAAgB,kBAAkB,CAChC,IAAU,EACV,OAIuB;;IAEvB,IAAI,MAAM,GAAuB,SAAS,CAAC;;QAC3C,KAAyB,IAAA,KAAA,SAAA,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA,gBAAA,4BAAE;YAAtC,IAAM,UAAU,WAAA;YACnB,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;SAC5C;;;;;;;;;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAdD,gDAcC;AAED,SAAgB,cAAc,CAC5B,IAAU,EACV,OAQS;IAET,kBAAkB,CAAC,IAAI,EAAE,UAA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@angular-devkit/schematics';\n\nexport function visitTSSourceFiles<Result = void>(\n tree: Tree,\n visitor: (\n sourceFile: ts.SourceFile,\n tree: Tree,\n result?: Result\n ) => Result | undefined\n): Result | undefined {\n let result: Result | undefined = undefined;\n for (const sourceFile of visit(tree.root)) {\n result = visitor(sourceFile, tree, result);\n }\n\n return result;\n}\n\nexport function visitTemplates(\n tree: Tree,\n visitor: (\n template: {\n fileName: string;\n content: string;\n inline: boolean;\n start: number;\n },\n tree: Tree\n ) => void\n): void {\n visitTSSourceFiles(tree, (source) => {\n visitComponents(source, (_, decoratorExpressionNode) => {\n ts.forEachChild(decoratorExpressionNode, function findTemplates(n) {\n if (ts.isPropertyAssignment(n) && ts.isIdentifier(n.name)) {\n if (\n n.name.text === 'template' &&\n ts.isStringLiteralLike(n.initializer)\n ) {\n // Need to add an offset of one to the start because the template quotes are\n // not part of the template content.\n const templateStartIdx = n.initializer.getStart() + 1;\n visitor(\n {\n fileName: source.fileName,\n content: n.initializer.text,\n inline: true,\n start: templateStartIdx,\n },\n tree\n );\n return;\n } else if (\n n.name.text === 'templateUrl' &&\n ts.isStringLiteralLike(n.initializer)\n ) {\n const parts = normalize(source.fileName).split('/').slice(0, -1);\n const templatePath = resolve(\n normalize(parts.join('/')),\n normalize(n.initializer.text)\n );\n if (!tree.exists(templatePath)) {\n return;\n }\n\n const fileContent = tree.read(templatePath);\n if (!fileContent) {\n return;\n }\n\n visitor(\n {\n fileName: templatePath,\n content: fileContent.toString(),\n inline: false,\n start: 0,\n },\n tree\n );\n return;\n }\n }\n\n ts.forEachChild(n, findTemplates);\n });\n });\n });\n}\n\nexport function visitNgModuleImports(\n sourceFile: ts.SourceFile,\n callback: (\n importNode: ts.PropertyAssignment,\n elementExpressions: ts.NodeArray<ts.Expression>\n ) => void\n) {\n visitNgModuleProperty(sourceFile, callback, 'imports');\n}\n\nexport function visitNgModuleExports(\n sourceFile: ts.SourceFile,\n callback: (\n exportNode: ts.PropertyAssignment,\n elementExpressions: ts.NodeArray<ts.Expression>\n ) => void\n) {\n visitNgModuleProperty(sourceFile, callback, 'exports');\n}\n\nfunction visitNgModuleProperty(\n sourceFile: ts.SourceFile,\n callback: (\n nodes: ts.PropertyAssignment,\n elementExpressions: ts.NodeArray<ts.Expression>\n ) => void,\n property: string\n) {\n visitNgModules(sourceFile, (_, decoratorExpressionNode) => {\n ts.forEachChild(decoratorExpressionNode, function findTemplates(n) {\n if (\n ts.isPropertyAssignment(n) &&\n ts.isIdentifier(n.name) &&\n n.name.text === property &&\n ts.isArrayLiteralExpression(n.initializer)\n ) {\n callback(n, n.initializer.elements);\n return;\n }\n\n ts.forEachChild(n, findTemplates);\n });\n });\n}\nexport function visitComponents(\n sourceFile: ts.SourceFile,\n callback: (\n classDeclarationNode: ts.ClassDeclaration,\n decoratorExpressionNode: ts.ObjectLiteralExpression\n ) => void\n) {\n visitDecorator(sourceFile, 'Component', callback);\n}\n\nexport function visitNgModules(\n sourceFile: ts.SourceFile,\n callback: (\n classDeclarationNode: ts.ClassDeclaration,\n decoratorExpressionNode: ts.ObjectLiteralExpression\n ) => void\n) {\n visitDecorator(sourceFile, 'NgModule', callback);\n}\n\nexport function visitDecorator(\n sourceFile: ts.SourceFile,\n decoratorName: string,\n callback: (\n classDeclarationNode: ts.ClassDeclaration,\n decoratorExpressionNode: ts.ObjectLiteralExpression\n ) => void\n) {\n ts.forEachChild(sourceFile, function findClassDeclaration(node) {\n if (!ts.isClassDeclaration(node)) {\n ts.forEachChild(node, findClassDeclaration);\n }\n\n const classDeclarationNode = node as ts.ClassDeclaration;\n\n if (\n !classDeclarationNode.decorators ||\n !classDeclarationNode.decorators.length\n ) {\n return;\n }\n\n const componentDecorator = classDeclarationNode.decorators.find((d) => {\n return (\n ts.isCallExpression(d.expression) &&\n ts.isIdentifier(d.expression.expression) &&\n d.expression.expression.text === decoratorName\n );\n });\n\n if (!componentDecorator) {\n return;\n }\n\n const { expression } = componentDecorator;\n if (!ts.isCallExpression(expression)) {\n return;\n }\n\n const [arg] = expression.arguments;\n if (!arg || !ts.isObjectLiteralExpression(arg)) {\n return;\n }\n\n callback(classDeclarationNode, arg);\n });\n}\n\nfunction* visit(directory: DirEntry): IterableIterator<ts.SourceFile> {\n for (const path of directory.subfiles) {\n if (path.endsWith('.ts') && !path.endsWith('.d.ts')) {\n const entry = directory.file(path);\n if (entry) {\n const content = entry.content;\n const source = ts.createSourceFile(\n entry.path,\n content.toString().replace(/^\\uFEFF/, ''),\n ts.ScriptTarget.Latest,\n true\n );\n yield source;\n }\n }\n }\n\n for (const path of directory.subdirs) {\n if (path === 'node_modules') {\n continue;\n }\n\n yield* visit(directory.dir(path));\n }\n}\n"]}
@@ -1,5 +1,6 @@
1
1
  import { EntityOp } from './entity-op';
2
2
  import { EntityAction, EntityActionOptions, EntityActionPayload } from './entity-action';
3
+ import * as i0 from "@angular/core";
3
4
  export declare class EntityActionFactory {
4
5
  /**
5
6
  * Create an EntityAction to perform an operation (op) for a particular entity type
@@ -32,4 +33,6 @@ export declare class EntityActionFactory {
32
33
  */
33
34
  createFromAction<P = any>(from: EntityAction, newProperties: Partial<EntityActionPayload<P>>): EntityAction<P>;
34
35
  formatActionType(op: string, tag: string): string;
36
+ static ɵfac: i0.ɵɵFactoryDeclaration<EntityActionFactory, never>;
37
+ static ɵprov: i0.ɵɵInjectableDeclaration<EntityActionFactory>;
35
38
  }
@@ -4,6 +4,7 @@ import { Update } from '@ngrx/entity';
4
4
  import { DefaultDataServiceConfig } from './default-data-service-config';
5
5
  import { EntityCollectionDataService, HttpMethods, QueryParams } from './interfaces';
6
6
  import { HttpUrlGenerator } from './http-url-generator';
7
+ import * as i0 from "@angular/core";
7
8
  /**
8
9
  * A basic, generic entity data service
9
10
  * suitable for persistence of most entities.
@@ -49,4 +50,6 @@ export declare class DefaultDataServiceFactory {
49
50
  * @param entityName {string} Name of the entity type for this data service
50
51
  */
51
52
  create<T>(entityName: string): EntityCollectionDataService<T>;
53
+ static ɵfac: i0.ɵɵFactoryDeclaration<DefaultDataServiceFactory, [null, null, { optional: true; }]>;
54
+ static ɵprov: i0.ɵɵInjectableDeclaration<DefaultDataServiceFactory>;
52
55
  }
@@ -5,6 +5,7 @@ import { ChangeSet } from '../actions/entity-cache-change-set';
5
5
  import { DefaultDataServiceConfig } from './default-data-service-config';
6
6
  import { EntityDefinitionService } from '../entity-metadata/entity-definition.service';
7
7
  import { RequestData } from './interfaces';
8
+ import * as i0 from "@angular/core";
8
9
  /**
9
10
  * Default data service for making remote service calls targeting the entire EntityCache.
10
11
  * See EntityDataService for services that target a single EntityCollection
@@ -52,4 +53,6 @@ export declare class EntityCacheDataService {
52
53
  * @param entityName name of the entity type
53
54
  */
54
55
  protected getIdSelector(entityName: string): IdSelector<any>;
56
+ static ɵfac: i0.ɵɵFactoryDeclaration<EntityCacheDataService, [null, null, { optional: true; }]>;
57
+ static ɵprov: i0.ɵɵInjectableDeclaration<EntityCacheDataService>;
55
58
  }
@@ -1,5 +1,6 @@
1
1
  import { EntityCollectionDataService } from './interfaces';
2
2
  import { DefaultDataServiceFactory } from './default-data.service';
3
+ import * as i0 from "@angular/core";
3
4
  /**
4
5
  * Registry of EntityCollection data services that make REST-like CRUD calls
5
6
  * to entity collection endpoints.
@@ -42,4 +43,6 @@ export declare class EntityDataService {
42
43
  registerServices(services: {
43
44
  [name: string]: EntityCollectionDataService<any>;
44
45
  }): void;
46
+ static ɵfac: i0.ɵɵFactoryDeclaration<EntityDataService, never>;
47
+ static ɵprov: i0.ɵɵInjectableDeclaration<EntityDataService>;
45
48
  }
@@ -1,4 +1,5 @@
1
1
  import { Pluralizer } from '../utils/interfaces';
2
+ import * as i0 from "@angular/core";
2
3
  /**
3
4
  * Known resource URLS for specific entity types.
4
5
  * Each entity's resource URLS are endpoints that
@@ -86,6 +87,8 @@ export declare class DefaultHttpUrlGenerator implements HttpUrlGenerator {
86
87
  * Note: this method does not ensure that resource urls are well-formed.
87
88
  */
88
89
  registerHttpResourceUrls(entityHttpResourceUrls: EntityHttpResourceUrls): void;
90
+ static ɵfac: i0.ɵɵFactoryDeclaration<DefaultHttpUrlGenerator, never>;
91
+ static ɵprov: i0.ɵɵInjectableDeclaration<DefaultHttpUrlGenerator>;
89
92
  }
90
93
  /** Remove leading & trailing spaces or slashes */
91
94
  export declare function normalizeRoot(root: string): string;
@@ -3,6 +3,7 @@ import { DataServiceError, EntityActionDataServiceError } from './data-service-e
3
3
  import { EntityAction } from '../actions/entity-action';
4
4
  import { EntityActionFactory } from '../actions/entity-action-factory';
5
5
  import { Logger } from '../utils/interfaces';
6
+ import * as i0 from "@angular/core";
6
7
  /**
7
8
  * Handling of responses from persistence operation
8
9
  */
@@ -24,4 +25,6 @@ export declare class DefaultPersistenceResultHandler implements PersistenceResul
24
25
  handleSuccess(originalAction: EntityAction): (data: any) => Action;
25
26
  /** Handle error result of persistence operation on an EntityAction */
26
27
  handleError(originalAction: EntityAction): (error: DataServiceError | Error) => EntityAction<EntityActionDataServiceError>;
28
+ static ɵfac: i0.ɵɵFactoryDeclaration<DefaultPersistenceResultHandler, never>;
29
+ static ɵprov: i0.ɵɵInjectableDeclaration<DefaultPersistenceResultHandler>;
27
30
  }
@@ -7,6 +7,7 @@ import { EntityDispatcherDefaultOptions } from './entity-dispatcher-default-opti
7
7
  import { MergeStrategy } from '../actions/merge-strategy';
8
8
  import { ChangeSet, ChangeSetItem } from '../actions/entity-cache-change-set';
9
9
  import { EntityCacheQuerySet } from '../actions/entity-cache-action';
10
+ import * as i0 from "@angular/core";
10
11
  /**
11
12
  * Dispatches Entity Cache actions to the EntityCache reducer
12
13
  */
@@ -108,4 +109,6 @@ export declare class EntityCacheDispatcher {
108
109
  * @param crid The correlationId for both the save and response actions.
109
110
  */
110
111
  private getSaveEntitiesResponseData$;
112
+ static ɵfac: i0.ɵɵFactoryDeclaration<EntityCacheDispatcher, never>;
113
+ static ɵprov: i0.ɵɵInjectableDeclaration<EntityCacheDispatcher>;
111
114
  }
@@ -1,3 +1,4 @@
1
+ import * as i0 from "@angular/core";
1
2
  /**
2
3
  * Default options for EntityDispatcher behavior
3
4
  * such as whether `add()` is optimistic or pessimistic by default.
@@ -17,4 +18,6 @@ export declare class EntityDispatcherDefaultOptions {
17
18
  optimisticUpsert: boolean;
18
19
  /** True if entities in a cache saveEntities request are saved optimistically; false if saved pessimistically. */
19
20
  optimisticSaveEntities: boolean;
21
+ static ɵfac: i0.ɵɵFactoryDeclaration<EntityDispatcherDefaultOptions, never>;
22
+ static ɵprov: i0.ɵɵInjectableDeclaration<EntityDispatcherDefaultOptions>;
20
23
  }
@@ -8,6 +8,7 @@ import { EntityActionFactory } from '../actions/entity-action-factory';
8
8
  import { EntityCache } from '../reducers/entity-cache';
9
9
  import { EntityCacheSelector } from '../selectors/entity-cache-selector';
10
10
  import { EntityDispatcher } from './entity-dispatcher';
11
+ import * as i0 from "@angular/core";
11
12
  /** Creates EntityDispatchers for entity collections */
12
13
  export declare class EntityDispatcherFactory implements OnDestroy {
13
14
  private entityActionFactory;
@@ -38,4 +39,6 @@ export declare class EntityDispatcherFactory implements OnDestroy {
38
39
  */
39
40
  defaultOptions?: Partial<EntityDispatcherDefaultOptions>): EntityDispatcher<T>;
40
41
  ngOnDestroy(): void;
42
+ static ɵfac: i0.ɵɵFactoryDeclaration<EntityDispatcherFactory, never>;
43
+ static ɵprov: i0.ɵɵInjectableDeclaration<EntityDispatcherFactory>;
41
44
  }
@@ -5,6 +5,7 @@ import { EntityActionFactory } from '../actions/entity-action-factory';
5
5
  import { SaveEntities, SaveEntitiesCancel } from '../actions/entity-cache-action';
6
6
  import { EntityCacheDataService } from '../dataservices/entity-cache-data.service';
7
7
  import { Logger } from '../utils/interfaces';
8
+ import * as i0 from "@angular/core";
8
9
  export declare class EntityCacheEffects {
9
10
  private actions;
10
11
  private dataService;
@@ -40,4 +41,6 @@ export declare class EntityCacheEffects {
40
41
  private handleSaveEntitiesError$;
41
42
  /** return handler of the ChangeSet result of successful saveEntities() */
42
43
  private handleSaveEntitiesSuccess$;
44
+ static ɵfac: i0.ɵɵFactoryDeclaration<EntityCacheEffects, [null, null, null, null, { optional: true; }]>;
45
+ static ɵprov: i0.ɵɵInjectableDeclaration<EntityCacheEffects>;
43
46
  }
@@ -6,6 +6,7 @@ import { EntityActionFactory } from '../actions/entity-action-factory';
6
6
  import { EntityOp } from '../actions/entity-op';
7
7
  import { EntityDataService } from '../dataservices/entity-data.service';
8
8
  import { PersistenceResultHandler } from '../dataservices/persistence-result-handler.service';
9
+ import * as i0 from "@angular/core";
9
10
  export declare const persistOps: EntityOp[];
10
11
  export declare class EntityEffects {
11
12
  private actions;
@@ -49,4 +50,6 @@ export declare class EntityEffects {
49
50
  * return a scalar success action that looks like the operation succeeded.
50
51
  */
51
52
  private handleSkipSuccess$;
53
+ static ɵfac: i0.ɵɵFactoryDeclaration<EntityEffects, [null, null, null, null, { optional: true; }]>;
54
+ static ɵprov: i0.ɵɵInjectableDeclaration<EntityEffects>;
52
55
  }
@@ -5,6 +5,8 @@ import { EntityCache } from './reducers/entity-cache';
5
5
  import { EntityCollection } from './reducers/entity-collection';
6
6
  import { EntityMetadataMap } from './entity-metadata/entity-metadata';
7
7
  import { EntityCacheReducerFactory } from './reducers/entity-cache-reducer';
8
+ import * as i0 from "@angular/core";
9
+ import * as i1 from "@ngrx/store";
8
10
  export interface EntityDataModuleConfig {
9
11
  entityMetadata?: EntityMetadataMap;
10
12
  entityCacheMetaReducers?: (MetaReducer<EntityCache, Action> | InjectionToken<MetaReducer<EntityCache, Action>>)[];
@@ -30,4 +32,7 @@ export declare class EntityDataModuleWithoutEffects implements OnDestroy {
30
32
  static forRoot(config: EntityDataModuleConfig): ModuleWithProviders<EntityDataModuleWithoutEffects>;
31
33
  constructor(reducerManager: ReducerManager, entityCacheReducerFactory: EntityCacheReducerFactory, injector: Injector, entityCacheName: string, initialState: any, metaReducers: (MetaReducer<EntityCache, Action> | InjectionToken<MetaReducer<EntityCache, Action>>)[]);
32
34
  ngOnDestroy(): void;
35
+ static ɵfac: i0.ɵɵFactoryDeclaration<EntityDataModuleWithoutEffects, [null, null, null, { optional: true; }, { optional: true; }, { optional: true; }]>;
36
+ static ɵmod: i0.ɵɵNgModuleDeclaration<EntityDataModuleWithoutEffects, never, [typeof i1.StoreModule], never>;
37
+ static ɵinj: i0.ɵɵInjectorDeclaration<EntityDataModuleWithoutEffects>;
33
38
  }
@@ -3,6 +3,9 @@ import { EffectSources } from '@ngrx/effects';
3
3
  import { EntityCacheEffects } from './effects/entity-cache-effects';
4
4
  import { EntityEffects } from './effects/entity-effects';
5
5
  import { EntityDataModuleConfig } from './entity-data-without-effects.module';
6
+ import * as i0 from "@angular/core";
7
+ import * as i1 from "./entity-data-without-effects.module";
8
+ import * as i2 from "@ngrx/effects";
6
9
  /**
7
10
  * entity-data main module includes effects and HTTP data services
8
11
  * Configure with `forRoot`.
@@ -18,4 +21,7 @@ export declare class EntityDataModule {
18
21
  * Warning: undocumented @ngrx/effects API
19
22
  */
20
23
  addEffects(effectSourceInstance: any): void;
24
+ static ɵfac: i0.ɵɵFactoryDeclaration<EntityDataModule, never>;
25
+ static ɵmod: i0.ɵɵNgModuleDeclaration<EntityDataModule, never, [typeof i1.EntityDataModuleWithoutEffects, typeof i2.EffectsModule], never>;
26
+ static ɵinj: i0.ɵɵInjectorDeclaration<EntityDataModule>;
21
27
  }
@@ -1,5 +1,6 @@
1
1
  import { EntityDefinition } from './entity-definition';
2
2
  import { EntityMetadata, EntityMetadataMap } from './entity-metadata';
3
+ import * as i0 from "@angular/core";
3
4
  export interface EntityDefinitions {
4
5
  [entityName: string]: EntityDefinition<any>;
5
6
  }
@@ -56,4 +57,6 @@ export declare class EntityDefinitionService {
56
57
  * });
57
58
  */
58
59
  registerDefinitions(definitions: EntityDefinitions): void;
60
+ static ɵfac: i0.ɵɵFactoryDeclaration<EntityDefinitionService, [{ optional: true; }]>;
61
+ static ɵprov: i0.ɵɵInjectableDeclaration<EntityDefinitionService>;
59
62
  }
@@ -55,7 +55,7 @@ export declare class EntityCollectionServiceBase<T, S$ extends EntitySelectors$<
55
55
  */
56
56
  dispatch(action: Action): Action;
57
57
  /** The NgRx Store for the {EntityCache} */
58
- get store(): Store<import("..").EntityCache>;
58
+ get store(): Store<import("@ngrx/data").EntityCache>;
59
59
  /**
60
60
  * Utility class with methods to validate EntityAction payloads.
61
61
  */
@@ -3,6 +3,7 @@ import { EntityDispatcherFactory } from '../dispatchers/entity-dispatcher-factor
3
3
  import { EntityDefinitionService } from '../entity-metadata/entity-definition.service';
4
4
  import { EntitySelectors, EntitySelectorsFactory } from '../selectors/entity-selectors';
5
5
  import { EntitySelectors$, EntitySelectors$Factory } from '../selectors/entity-selectors$';
6
+ import * as i0 from "@angular/core";
6
7
  /** Core ingredients of an EntityCollectionService */
7
8
  export interface EntityCollectionServiceElements<T, S$ extends EntitySelectors$<T> = EntitySelectors$<T>> {
8
9
  readonly dispatcher: EntityDispatcher<T>;
@@ -22,4 +23,6 @@ export declare class EntityCollectionServiceElementsFactory {
22
23
  * @param entityName - name of the entity type
23
24
  */
24
25
  create<T, S$ extends EntitySelectors$<T> = EntitySelectors$<T>>(entityName: string): EntityCollectionServiceElements<T, S$>;
26
+ static ɵfac: i0.ɵɵFactoryDeclaration<EntityCollectionServiceElementsFactory, never>;
27
+ static ɵprov: i0.ɵɵInjectableDeclaration<EntityCollectionServiceElementsFactory>;
25
28
  }
@@ -1,6 +1,7 @@
1
1
  import { EntityCollectionService } from './entity-collection-service';
2
2
  import { EntityCollectionServiceElementsFactory } from './entity-collection-service-elements-factory';
3
3
  import { EntitySelectors$ } from '../selectors/entity-selectors$';
4
+ import * as i0 from "@angular/core";
4
5
  /**
5
6
  * Creates EntityCollectionService instances for
6
7
  * a cached collection of T entities in the ngrx store.
@@ -16,4 +17,6 @@ export declare class EntityCollectionServiceFactory {
16
17
  * @param entityName - name of the entity type
17
18
  */
18
19
  create<T, S$ extends EntitySelectors$<T> = EntitySelectors$<T>>(entityName: string): EntityCollectionService<T>;
20
+ static ɵfac: i0.ɵɵFactoryDeclaration<EntityCollectionServiceFactory, never>;
21
+ static ɵprov: i0.ɵɵInjectableDeclaration<EntityCollectionServiceFactory>;
19
22
  }
@@ -7,6 +7,7 @@ import { EntityCollectionServiceFactory } from './entity-collection-service-fact
7
7
  import { EntityCollectionServiceMap, EntityServices } from './entity-services';
8
8
  import { EntitySelectors$ } from '../selectors/entity-selectors$';
9
9
  import { EntityServicesElements } from './entity-services-elements';
10
+ import * as i0 from "@angular/core";
10
11
  /**
11
12
  * Base/default class of a central registry of EntityCollectionServices for all entity types.
12
13
  * Create your own subclass to add app-specific members for an improved developer experience.
@@ -73,4 +74,6 @@ export declare class EntityServicesBase implements EntityServices {
73
74
  * EntityCollectionServices to register, either as a map or an array
74
75
  */
75
76
  registerEntityCollectionServices(entityCollectionServices: EntityCollectionServiceMap | EntityCollectionService<any>[]): void;
77
+ static ɵfac: i0.ɵɵFactoryDeclaration<EntityServicesBase, never>;
78
+ static ɵprov: i0.ɵɵInjectableDeclaration<EntityServicesBase>;
76
79
  }
@@ -5,6 +5,7 @@ import { EntityCache } from '../reducers/entity-cache';
5
5
  import { EntityDispatcherFactory } from '../dispatchers/entity-dispatcher-factory';
6
6
  import { EntitySelectors$Factory } from '../selectors/entity-selectors$';
7
7
  import { EntityCollectionServiceFactory } from './entity-collection-service-factory';
8
+ import * as i0 from "@angular/core";
8
9
  /** Core ingredients of an EntityServices class */
9
10
  export declare class EntityServicesElements {
10
11
  /**
@@ -35,4 +36,6 @@ export declare class EntityServicesElements {
35
36
  * A replay observable of the most recent action reduced by the store.
36
37
  */
37
38
  readonly reducedActions$: Observable<Action>;
39
+ static ɵfac: i0.ɵɵFactoryDeclaration<EntityServicesElements, never>;
40
+ static ɵprov: i0.ɵɵInjectableDeclaration<EntityServicesElements>;
38
41
  }
@@ -4,6 +4,7 @@ import { ClearCollections, LoadCollections, MergeQuerySet, SaveEntities, SaveEnt
4
4
  import { EntityCollectionCreator } from './entity-collection-creator';
5
5
  import { EntityCollectionReducerRegistry } from './entity-collection-reducer-registry';
6
6
  import { Logger } from '../utils/interfaces';
7
+ import * as i0 from "@angular/core";
7
8
  /**
8
9
  * Creates the EntityCacheReducer via its create() method
9
10
  */
@@ -44,4 +45,6 @@ export declare class EntityCacheReducerFactory {
44
45
  private applyCollectionReducer;
45
46
  /** Ensure loading is false for every collection in entityNames */
46
47
  private clearLoadingFlags;
48
+ static ɵfac: i0.ɵɵFactoryDeclaration<EntityCacheReducerFactory, never>;
49
+ static ɵprov: i0.ɵɵInjectableDeclaration<EntityCacheReducerFactory>;
47
50
  }
@@ -1,5 +1,6 @@
1
1
  import { EntityCollection } from './entity-collection';
2
2
  import { EntityDefinitionService } from '../entity-metadata/entity-definition.service';
3
+ import * as i0 from "@angular/core";
3
4
  export declare class EntityCollectionCreator {
4
5
  private entityDefinitionService?;
5
6
  constructor(entityDefinitionService?: EntityDefinitionService);
@@ -8,5 +9,7 @@ export declare class EntityCollectionCreator {
8
9
  * @param entityName {string} entity type name
9
10
  */
10
11
  create<T = any, S extends EntityCollection<T> = EntityCollection<T>>(entityName: string): S;
12
+ static ɵfac: i0.ɵɵFactoryDeclaration<EntityCollectionCreator, [{ optional: true; }]>;
13
+ static ɵprov: i0.ɵɵInjectableDeclaration<EntityCollectionCreator>;
11
14
  }
12
15
  export declare function createEmptyEntityCollection<T>(entityName?: string): EntityCollection<T>;
@@ -8,6 +8,7 @@ import { EntityDefinition } from '../entity-metadata/entity-definition';
8
8
  import { EntityDefinitionService } from '../entity-metadata/entity-definition.service';
9
9
  import { MergeStrategy } from '../actions/merge-strategy';
10
10
  import { UpdateResponseData } from '../actions/update-response-data';
11
+ import * as i0 from "@angular/core";
11
12
  /**
12
13
  * Map of {EntityOp} to reducer method for the operation.
13
14
  * If an operation is missing, caller should return the collection for that reducer.
@@ -359,4 +360,6 @@ export declare class EntityCollectionReducerMethodsFactory {
359
360
  constructor(entityDefinitionService: EntityDefinitionService);
360
361
  /** Create the {EntityCollectionReducerMethods} for the named entity type */
361
362
  create<T>(entityName: string): EntityCollectionReducerMethodMap<T>;
363
+ static ɵfac: i0.ɵɵFactoryDeclaration<EntityCollectionReducerMethodsFactory, never>;
364
+ static ɵprov: i0.ɵɵInjectableDeclaration<EntityCollectionReducerMethodsFactory>;
362
365
  }
@@ -2,6 +2,7 @@ import { MetaReducer } from '@ngrx/store';
2
2
  import { EntityAction } from '../actions/entity-action';
3
3
  import { EntityCollection } from './entity-collection';
4
4
  import { EntityCollectionReducer, EntityCollectionReducerFactory } from './entity-collection-reducer';
5
+ import * as i0 from "@angular/core";
5
6
  /** A hash of EntityCollectionReducers */
6
7
  export interface EntityCollectionReducers {
7
8
  [entity: string]: EntityCollectionReducer<any>;
@@ -41,4 +42,6 @@ export declare class EntityCollectionReducerRegistry {
41
42
  * });
42
43
  */
43
44
  registerReducers(reducers: EntityCollectionReducers): void;
45
+ static ɵfac: i0.ɵɵFactoryDeclaration<EntityCollectionReducerRegistry, [null, { optional: true; }]>;
46
+ static ɵprov: i0.ɵɵInjectableDeclaration<EntityCollectionReducerRegistry>;
44
47
  }
@@ -1,6 +1,7 @@
1
1
  import { EntityAction } from '../actions/entity-action';
2
2
  import { EntityCollection } from './entity-collection';
3
3
  import { EntityCollectionReducerMethodsFactory } from './entity-collection-reducer-methods';
4
+ import * as i0 from "@angular/core";
4
5
  export declare type EntityCollectionReducer<T = any> = (collection: EntityCollection<T>, action: EntityAction) => EntityCollection<T>;
5
6
  /** Create a default reducer for a specific entity collection */
6
7
  export declare class EntityCollectionReducerFactory {
@@ -8,4 +9,6 @@ export declare class EntityCollectionReducerFactory {
8
9
  constructor(methodsFactory: EntityCollectionReducerMethodsFactory);
9
10
  /** Create a default reducer for a collection of entities of T */
10
11
  create<T = any>(entityName: string): EntityCollectionReducer<T>;
12
+ static ɵfac: i0.ɵɵFactoryDeclaration<EntityCollectionReducerFactory, never>;
13
+ static ɵprov: i0.ɵɵInjectableDeclaration<EntityCollectionReducerFactory>;
11
14
  }
@@ -7,6 +7,7 @@ import { EntityCacheSelector } from './entity-cache-selector';
7
7
  import { EntitySelectors } from './entity-selectors';
8
8
  import { EntityCache } from '../reducers/entity-cache';
9
9
  import { EntityCollection, ChangeStateMap } from '../reducers/entity-collection';
10
+ import * as i0 from "@angular/core";
10
11
  /**
11
12
  * The selector observable functions for entity collection members.
12
13
  */
@@ -57,4 +58,6 @@ export declare class EntitySelectors$Factory {
57
58
  * @param selectors - selector functions for this collection.
58
59
  **/
59
60
  create<T, S$ extends EntitySelectors$<T> = EntitySelectors$<T>>(entityName: string, selectors: EntitySelectors<T>): S$;
61
+ static ɵfac: i0.ɵɵFactoryDeclaration<EntitySelectors$Factory, never>;
62
+ static ɵprov: i0.ɵɵInjectableDeclaration<EntitySelectors$Factory>;
60
63
  }
@@ -6,6 +6,7 @@ import { EntityCacheSelector } from './entity-cache-selector';
6
6
  import { EntityCollection, ChangeStateMap } from '../reducers/entity-collection';
7
7
  import { EntityCollectionCreator } from '../reducers/entity-collection-creator';
8
8
  import { EntityMetadata } from '../entity-metadata/entity-metadata';
9
+ import * as i0 from "@angular/core";
9
10
  /**
10
11
  * The selector functions for entity collection members,
11
12
  * Selects from the entity collection to the collection member
@@ -111,4 +112,6 @@ export declare class EntitySelectorsFactory {
111
112
  * through the collection, to the collection members.
112
113
  */
113
114
  create<T, S extends EntitySelectors<T> = EntitySelectors<T>>(entityName: string): S;
115
+ static ɵfac: i0.ɵɵFactoryDeclaration<EntitySelectorsFactory, [{ optional: true; }, { optional: true; }]>;
116
+ static ɵprov: i0.ɵɵInjectableDeclaration<EntitySelectorsFactory>;
114
117
  }
@@ -1,3 +1,4 @@
1
+ import * as i0 from "@angular/core";
1
2
  /**
2
3
  * Generates a string id beginning 'CRID',
3
4
  * followed by a monotonically increasing integer for use as a correlation id.
@@ -14,4 +15,6 @@ export declare class CorrelationIdGenerator {
14
15
  protected prefix: string;
15
16
  /** Return the next correlation id */
16
17
  next(): string;
18
+ static ɵfac: i0.ɵɵFactoryDeclaration<CorrelationIdGenerator, never>;
19
+ static ɵprov: i0.ɵɵInjectableDeclaration<CorrelationIdGenerator>;
17
20
  }