@daffodil/core 0.38.6 → 0.39.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. package/bundles/daffodil-core-graphql.umd.js +24 -153
  2. package/bundles/daffodil-core-graphql.umd.js.map +1 -1
  3. package/bundles/daffodil-core-graphql.umd.min.js +1 -1
  4. package/bundles/daffodil-core-graphql.umd.min.js.map +1 -1
  5. package/bundles/daffodil-core-routing.umd.js +9 -90
  6. package/bundles/daffodil-core-routing.umd.js.map +1 -1
  7. package/bundles/daffodil-core-routing.umd.min.js +1 -1
  8. package/bundles/daffodil-core-routing.umd.min.js.map +1 -1
  9. package/bundles/daffodil-core-state.umd.js +23 -154
  10. package/bundles/daffodil-core-state.umd.js.map +1 -1
  11. package/bundles/daffodil-core-state.umd.min.js +1 -1
  12. package/bundles/daffodil-core-state.umd.min.js.map +1 -1
  13. package/bundles/daffodil-core-testing.umd.js +7 -68
  14. package/bundles/daffodil-core-testing.umd.js.map +1 -1
  15. package/bundles/daffodil-core-testing.umd.min.js +1 -1
  16. package/bundles/daffodil-core-testing.umd.min.js.map +1 -1
  17. package/bundles/daffodil-core.umd.js +56 -389
  18. package/bundles/daffodil-core.umd.js.map +1 -1
  19. package/bundles/daffodil-core.umd.min.js +1 -1
  20. package/bundles/daffodil-core.umd.min.js.map +1 -1
  21. package/esm2015/address/address.js +2 -28
  22. package/esm2015/canonically-locateable/canonically-locateable.interface.js +2 -18
  23. package/esm2015/constructable/constructable.js +2 -6
  24. package/esm2015/daffodil-core.js +2 -7
  25. package/esm2015/errors/error-map.js +2 -11
  26. package/esm2015/errors/error.interface.js +2 -17
  27. package/esm2015/errors/inheritable-error.js +1 -14
  28. package/esm2015/errors/public_api.js +1 -6
  29. package/esm2015/graphql/apollo/cacheable-operations/cacheable-operations-link.interface.js +2 -16
  30. package/esm2015/graphql/apollo/public_api.js +1 -6
  31. package/esm2015/graphql/apollo/queued-apollo/queued-apollo.service.js +10 -59
  32. package/esm2015/graphql/daffodil-core-graphql.js +2 -7
  33. package/esm2015/graphql/fragments/build-fragment-definition.js +3 -18
  34. package/esm2015/graphql/fragments/build-fragment-name-spread.js +6 -44
  35. package/esm2015/graphql/fragments/public_api.js +1 -6
  36. package/esm2015/graphql/index.js +2 -7
  37. package/esm2015/graphql/public_api.js +3 -8
  38. package/esm2015/identifiable/identifiable.interface.js +2 -18
  39. package/esm2015/index.js +2 -7
  40. package/esm2015/locateable/locateable.interface.js +2 -18
  41. package/esm2015/operators/backoff.pipe.js +5 -20
  42. package/esm2015/operators/public_api.js +2 -7
  43. package/esm2015/orderable/orderable.js +2 -18
  44. package/esm2015/public_api.js +6 -11
  45. package/esm2015/routing/daffodil-core-routing.js +2 -7
  46. package/esm2015/routing/index.js +2 -7
  47. package/esm2015/routing/public_api.js +2 -7
  48. package/esm2015/routing/uri/normalizer.service.js +4 -21
  49. package/esm2015/routing/uri/public_api.js +2 -7
  50. package/esm2015/routing/uri/truncation/file-extension.js +2 -13
  51. package/esm2015/routing/uri/truncation/leading-path-segments.js +2 -12
  52. package/esm2015/routing/uri/truncation/leading-slash.js +2 -13
  53. package/esm2015/routing/uri/truncation/public_api.js +1 -6
  54. package/esm2015/routing/uri/truncation/query-fragment.js +3 -13
  55. package/esm2015/state/collection/paginable.js +2 -21
  56. package/esm2015/state/collection/public_api.js +3 -8
  57. package/esm2015/state/collection/sortable.js +10 -56
  58. package/esm2015/state/daffodil-core-state.js +2 -7
  59. package/esm2015/state/errors/public_api.js +1 -6
  60. package/esm2015/state/errors/state-error.interface.js +2 -17
  61. package/esm2015/state/errors/transform-error-to-state-error.js +1 -8
  62. package/esm2015/state/index.js +2 -7
  63. package/esm2015/state/operators/public_api.js +2 -7
  64. package/esm2015/state/operators/substream.pipe.js +13 -51
  65. package/esm2015/state/public_api.js +6 -11
  66. package/esm2015/state/reducers/create-meta.js +2 -20
  67. package/esm2015/state/reducers/public_api.js +1 -6
  68. package/esm2015/state/states/loading.js +2 -6
  69. package/esm2015/state/states/mutable-loading.js +2 -6
  70. package/esm2015/state/states/public_api.js +2 -6
  71. package/esm2015/state/states/state.enum.js +2 -55
  72. package/esm2015/state/states/stateable.interface.js +2 -17
  73. package/esm2015/state/store/facade.js +2 -18
  74. package/esm2015/storage/error/error.js +1 -15
  75. package/esm2015/storage/error/error.service.js +3 -32
  76. package/esm2015/storage/error/public_api.js +1 -6
  77. package/esm2015/storage/localstorage/localstorage.service.js +3 -21
  78. package/esm2015/storage/noopstorage/noopstorage.service.js +3 -24
  79. package/esm2015/storage/persistence.interface.js +3 -38
  80. package/esm2015/storage/public_api.js +3 -8
  81. package/esm2015/storage/server-error/public_api.js +1 -6
  82. package/esm2015/storage/server-error/server-error.js +1 -15
  83. package/esm2015/storage/server-error/server-error.service.js +4 -33
  84. package/esm2015/testing/address/factories/address.factory.js +2 -25
  85. package/esm2015/testing/angular/interfaces/in-memory-data-service.interface.js +2 -33
  86. package/esm2015/testing/angular/mocks/pipes/currency.js +2 -11
  87. package/esm2015/testing/daffodil-core-testing.js +2 -7
  88. package/esm2015/testing/factories/factory.interface.js +2 -24
  89. package/esm2015/testing/factories/factory.js +3 -32
  90. package/esm2015/testing/index.js +1 -6
  91. package/esm2015/testing/testing.module.js +1 -6
  92. package/esm2015/types/dict.type.js +2 -6
  93. package/esm2015/types/id.type.js +2 -6
  94. package/esm2015/types/public_api.js +2 -6
  95. package/esm2015/utils/array-to-dict.js +3 -24
  96. package/esm2015/utils/long-arithmetic.js +19 -45
  97. package/esm2015/utils/public_api.js +2 -7
  98. package/esm2015/utils/random-slice.js +4 -19
  99. package/esm2015/utils/random-subset.js +5 -17
  100. package/esm2015/utils/range.js +5 -21
  101. package/esm2015/utils/sample.js +2 -13
  102. package/esm2015/utils/shuffle.js +5 -23
  103. package/fesm2015/daffodil-core-graphql.js +18 -146
  104. package/fesm2015/daffodil-core-graphql.js.map +1 -1
  105. package/fesm2015/daffodil-core-routing.js +10 -95
  106. package/fesm2015/daffodil-core-routing.js.map +1 -1
  107. package/fesm2015/daffodil-core-state.js +23 -196
  108. package/fesm2015/daffodil-core-state.js.map +1 -1
  109. package/fesm2015/daffodil-core-testing.js +7 -79
  110. package/fesm2015/daffodil-core-testing.js.map +1 -1
  111. package/fesm2015/daffodil-core.js +53 -416
  112. package/fesm2015/daffodil-core.js.map +1 -1
  113. package/graphql/package.json +1 -1
  114. package/locateable/locateable.interface.d.ts +1 -0
  115. package/package.json +1 -1
  116. package/routing/package.json +1 -1
  117. package/state/package.json +1 -1
  118. package/testing/package.json +1 -1
  119. package/utils/long-arithmetic.d.ts +3 -0
@@ -1,25 +1,9 @@
1
1
  import { pipe } from 'rxjs';
2
2
  import { scan, filter } from 'rxjs/operators';
3
3
 
4
- /**
5
- * @fileoverview added by tsickle
6
- * Generated from: operators/substream.pipe.ts
7
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
8
- */
9
- /** @type {?} */
10
- const compareActionSequenceStep = (/**
11
- * @param {?} step
12
- * @param {?} action
13
- * @return {?}
14
- */
15
- (step, action) => Array.isArray(step)
16
- ? step.reduce((/**
17
- * @param {?} acc
18
- * @param {?} type
19
- * @return {?}
20
- */
21
- (acc, type) => acc || action.type === type), false)
22
- : action.type === step);
4
+ const compareActionSequenceStep = (step, action) => Array.isArray(step)
5
+ ? step.reduce((acc, type) => acc || action.type === type, false)
6
+ : action.type === step;
23
7
  const ɵ0 = compareActionSequenceStep;
24
8
  /**
25
9
  * Watches for a particular stream of actions in the specified order and
@@ -39,210 +23,53 @@ const ɵ0 = compareActionSequenceStep;
39
23
  * If a terminator is encountered in the action stream, any partially matched substream is reset.
40
24
  * For example, substream([A, B], C) would not emit anything for an action stream of [A1, C1, B1].
41
25
  *
42
- * \@param sequence The sequence of action types that define the substream to listen for.
43
- * \@param terminators A list of terminators, any of which interrupt and reset a partially matched substream.
44
- * @type {?}
26
+ * @param sequence The sequence of action types that define the substream to listen for.
27
+ * @param terminators A list of terminators, any of which interrupt and reset a partially matched substream.
45
28
  */
46
- const substream = (/**
47
- * @param {?} sequence
48
- * @param {...?} terminators
49
- * @return {?}
50
- */
51
- (sequence, ...terminators) => {
52
- /** @type {?} */
53
- const isFullMatch = (/**
54
- * @param {?} matchedSubstream
55
- * @return {?}
56
- */
57
- matchedSubstream => matchedSubstream.length === sequence.length);
58
- /** @type {?} */
59
- const accumulateMatchedSubstream = (/**
60
- * @param {?} matchedSubstream
61
- * @param {?} action
62
- * @return {?}
63
- */
64
- (matchedSubstream, action) => compareActionSequenceStep(sequence[matchedSubstream.length], action)
29
+ const substream = (sequence, ...terminators) => {
30
+ const isFullMatch = matchedSubstream => matchedSubstream.length === sequence.length;
31
+ const accumulateMatchedSubstream = (matchedSubstream, action) => compareActionSequenceStep(sequence[matchedSubstream.length], action)
65
32
  ? [
66
33
  ...matchedSubstream,
67
34
  action,
68
35
  ]
69
- : matchedSubstream);
70
- return pipe(scan((/**
71
- * @param {?} matchedSubstream
72
- * @param {?} action
73
- * @return {?}
74
- */
75
- (matchedSubstream, action) => terminators.indexOf(action.type) > -1
36
+ : matchedSubstream;
37
+ return pipe(scan((matchedSubstream, action) => terminators.indexOf(action.type) > -1
76
38
  // terminator found, reset the list
77
39
  ? []
78
40
  : accumulateMatchedSubstream(
79
41
  // reset the list if fully matched
80
- isFullMatch(matchedSubstream) ? [] : matchedSubstream, action)), []), filter(isFullMatch));
81
- });
82
-
83
- /**
84
- * @fileoverview added by tsickle
85
- * Generated from: operators/public_api.ts
86
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
87
- */
88
-
89
- /**
90
- * @fileoverview added by tsickle
91
- * Generated from: states/public_api.ts
92
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
93
- */
42
+ isFullMatch(matchedSubstream) ? [] : matchedSubstream, action), []), filter(isFullMatch));
43
+ };
94
44
 
95
- /**
96
- * @fileoverview added by tsickle
97
- * Generated from: errors/transform-error-to-state-error.ts
98
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
99
- */
100
45
  /**
101
46
  * Transforms an error instance to a state error object.
102
- * @param {?} __0
103
- * @return {?}
104
47
  */
105
48
  function daffTransformErrorToStateError({ code, message }) {
106
49
  return { code, message };
107
50
  }
108
51
 
109
52
  /**
110
- * @fileoverview added by tsickle
111
- * Generated from: errors/public_api.ts
112
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
113
- */
114
-
115
- /**
116
- * @fileoverview added by tsickle
117
- * Generated from: collection/paginable.ts
118
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
119
- */
120
- /**
121
- * The interface that describes a collection of elements that can be navigated in
122
- * a paged way. E.g. "Pages 1,2,3,4,5".
123
- *
124
- * @record
53
+ * The direction in which to sort a list of elements, e.g. if the list was
54
+ * sorted alphabetically, "Ascending" would be from "A-Z",
55
+ * and "Descending" would be from "Z-A".
125
56
  */
126
- function DaffNumericallyPaginable() { }
127
- if (false) {
128
- /** @type {?} */
129
- DaffNumericallyPaginable.prototype.current_page;
130
- /** @type {?} */
131
- DaffNumericallyPaginable.prototype.total_pages;
132
- /** @type {?} */
133
- DaffNumericallyPaginable.prototype.page_size;
134
- }
57
+ var DaffSortDirectionEnum;
58
+ (function (DaffSortDirectionEnum) {
59
+ DaffSortDirectionEnum["Ascending"] = "ASC";
60
+ DaffSortDirectionEnum["Descending"] = "DSC";
61
+ })(DaffSortDirectionEnum || (DaffSortDirectionEnum = {}));
135
62
 
136
- /**
137
- * @fileoverview added by tsickle
138
- * Generated from: collection/sortable.ts
139
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
140
- */
141
- /**
142
- * The metadata that describes the sorting behavior of a collection of elements.
143
- * @record
144
- */
145
- function DaffSortOptions() { }
146
- if (false) {
147
- /** @type {?} */
148
- DaffSortOptions.prototype.default;
149
- /** @type {?} */
150
- DaffSortOptions.prototype.options;
151
- }
152
- /**
153
- * One particular option used to sort a collection of elements;
154
- * @record
155
- */
156
- function DaffSortOption() { }
157
- if (false) {
158
- /** @type {?} */
159
- DaffSortOption.prototype.label;
160
- /** @type {?} */
161
- DaffSortOption.prototype.value;
162
- }
163
- /** @enum {string} */
164
- const DaffSortDirectionEnum = {
165
- Ascending: "ASC",
166
- Descending: "DSC",
167
- };
168
- /**
169
- * Describes the properties of a collection that make the collection able to be
170
- * sorted by Daffodil.
171
- * @record
172
- */
173
- function DaffSortable() { }
174
- if (false) {
175
- /**
176
- * The available options by which to sort the collection.
177
- * @type {?}
178
- */
179
- DaffSortable.prototype.sort_options;
180
- /**
181
- * The currently applied sorting option.
182
- * @type {?}
183
- */
184
- DaffSortable.prototype.applied_sort_option;
185
- /**
186
- * The currently applied sort direction.
187
- * @type {?}
188
- */
189
- DaffSortable.prototype.applied_sort_direction;
190
- }
191
-
192
- /**
193
- * @fileoverview added by tsickle
194
- * Generated from: collection/public_api.ts
195
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
196
- */
197
-
198
- /**
199
- * @fileoverview added by tsickle
200
- * Generated from: reducers/create-meta.ts
201
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
202
- */
203
63
  /**
204
64
  * Creates and returns a composite reducer that invokes each of the passed reducers in turn.
205
- * @template T, V
206
- * @param {?} reducers
207
- * @return {?}
208
65
  */
209
66
  function daffComposeReducers(reducers) {
210
- return (/**
211
- * @param {?} state
212
- * @param {?} action
213
- * @return {?}
214
- */
215
- (state, action) => reducers.reduce((/**
216
- * @param {?} nextState
217
- * @param {?} reducer
218
- * @return {?}
219
- */
220
- (nextState, reducer) => reducer(nextState, action)), state));
67
+ return (state, action) => reducers.reduce((nextState, reducer) => reducer(nextState, action), state);
221
68
  }
222
69
 
223
70
  /**
224
- * @fileoverview added by tsickle
225
- * Generated from: reducers/public_api.ts
226
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
227
- */
228
-
229
- /**
230
- * @fileoverview added by tsickle
231
- * Generated from: public_api.ts
232
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
233
- */
234
-
235
- /**
236
- * @fileoverview added by tsickle
237
- * Generated from: index.ts
238
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
239
- */
240
-
241
- /**
242
- * @fileoverview added by tsickle
243
- * Generated from: daffodil-core-state.ts
244
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
71
+ * Generated bundle index. Do not edit.
245
72
  */
246
73
 
247
- export { DaffSortDirectionEnum, daffComposeReducers, daffTransformErrorToStateError, substream };
74
+ export { DaffSortDirectionEnum, daffComposeReducers, daffTransformErrorToStateError, substream, ɵ0 };
248
75
  //# sourceMappingURL=daffodil-core-state.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-core-state.js","sources":["../../../libs/core/state/src/operators/substream.pipe.ts","../../../libs/core/state/src/errors/transform-error-to-state-error.ts","../../../libs/core/state/src/collection/paginable.ts","../../../libs/core/state/src/collection/sortable.ts","../../../libs/core/state/src/reducers/create-meta.ts"],"sourcesContent":["import { Action } from '@ngrx/store';\nimport { pipe } from 'rxjs';\nimport {\n scan,\n filter,\n} from 'rxjs/operators';\n\nexport type ActionType = Action['type'];\nexport type ActionSequenceStep = ActionType | ActionType[];\nexport type ActionSequence = ActionSequenceStep[];\n\nconst compareActionSequenceStep = (step: ActionSequenceStep, action: Action): boolean => Array.isArray(step)\n ? step.reduce((acc, type) => acc || action.type === type, false)\n : action.type === step;\n\n/**\n * Watches for a particular stream of actions in the specified order and\n * emits a list of those actions once all sequence steps have been matched.\n *\n * This will find the first occurence of the substream and not necessarily the most concise or recent substream.\n * For example, substream([A, B]) encountering an action stream of [A1, A2, B1, B2] will emit [A1, B1].\n * When a substream is found and emitted, the list is reset and it will continue to listen to the action stream.\n *\n * You can indicate that a particular step in the sequence can be matched by mutiple actions by passing an array for that step.\n * For example, if the first step of the sequence could be action A or action B: substream([[A, B], C]).\n * An action stream of [A1, C1] would cause substream to emit [A1, C1].\n * An action stream of [B1, C1] would cause substream to emit [B1, C1].\n * An action stream of [A1, B1, C1] would cause substream to emit [A1, C1].\n *\n * You can optionally pass a list of terminators.\n * If a terminator is encountered in the action stream, any partially matched substream is reset.\n * For example, substream([A, B], C) would not emit anything for an action stream of [A1, C1, B1].\n *\n * @param sequence The sequence of action types that define the substream to listen for.\n * @param terminators A list of terminators, any of which interrupt and reset a partially matched substream.\n */\nexport const substream = (sequence: ActionSequence, ...terminators: ActionType[]) => {\n const isFullMatch = matchedSubstream => matchedSubstream.length === sequence.length;\n const accumulateMatchedSubstream = (matchedSubstream, action) =>\n compareActionSequenceStep(sequence[matchedSubstream.length], action)\n ? [\n ...matchedSubstream,\n action,\n ]\n : matchedSubstream;\n\n return pipe(\n scan<Action, Action[]>((matchedSubstream, action) =>\n terminators.indexOf(action.type) > -1\n // terminator found, reset the list\n ? []\n : accumulateMatchedSubstream(\n // reset the list if fully matched\n isFullMatch(matchedSubstream) ? [] : matchedSubstream,\n action,\n ),\n []),\n filter(isFullMatch),\n );\n};\n","import { DaffError } from '@daffodil/core';\n\nimport { DaffStateError } from './state-error.interface';\n\nexport type ErrorTransformer = (DaffError) => DaffStateError;\n\n/**\n * Transforms an error instance to a state error object.\n */\nexport function daffTransformErrorToStateError({ code, message }: DaffError): DaffStateError {\n return { code, message };\n}\n","/**\n * The interface that describes a collection of elements that can be navigated in\n * a paged way. E.g. \"Pages 1,2,3,4,5\".\n *\n */\nexport interface DaffNumericallyPaginable {\n current_page: number;\n total_pages: number;\n page_size: number;\n}\n","/**\n * The metadata that describes the sorting behavior of a collection of elements.\n */\nexport interface DaffSortOptions {\n default: DaffSortOption['value'];\n options: DaffSortOption[];\n}\n\n\n/**\n * One particular option used to sort a collection of elements;\n */\nexport interface DaffSortOption {\n label: string;\n value: any;\n}\n\n/**\n * The direction in which to sort a list of elements, e.g. if the list was\n * sorted alphabetically, \"Ascending\" would be from \"A-Z\",\n * and \"Descending\" would be from \"Z-A\".\n */\nexport enum DaffSortDirectionEnum {\n Ascending = 'ASC',\n Descending = 'DSC'\n}\n\n/**\n * Describes the properties of a collection that make the collection able to be\n * sorted by Daffodil.\n */\nexport interface DaffSortable {\n\n /**\n * The available options by which to sort the collection.\n */\n sort_options: DaffSortOptions;\n\n /**\n * The currently applied sorting option.\n */\n applied_sort_option: DaffSortOption['value'];\n\n /**\n * The currently applied sort direction.\n */\n applied_sort_direction: DaffSortDirectionEnum;\n}\n","import {\n Action,\n ActionReducer,\n} from '@ngrx/store';\n\n/**\n * Creates and returns a composite reducer that invokes each of the passed reducers in turn.\n */\nexport function daffComposeReducers<\n T,\n V extends Action = Action\n>(reducers: ActionReducer<T, V>[]): ActionReducer<T, V> {\n return (state: T, action: V): T =>\n reducers.reduce((nextState, reducer) => reducer(nextState, action), state);\n}\n"],"names":[],"mappings":";;;;;;;;;MAWM,yBAAyB;;;;;AAAG,CAAC,IAAwB,EAAE,MAAc,KAAc,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;MACxG,IAAI,CAAC,MAAM;;;;;IAAC,CAAC,GAAG,EAAE,IAAI,KAAK,GAAG,IAAI,MAAM,CAAC,IAAI,KAAK,IAAI,GAAE,KAAK,CAAC;MAC9D,MAAM,CAAC,IAAI,KAAK,IAAI,CAAA;;;;;;;;;;;;;;;;;;;;;;;;MAuBX,SAAS;;;;;AAAG,CAAC,QAAwB,EAAE,GAAG,WAAyB;;UACxE,WAAW;;;;IAAG,gBAAgB,IAAI,gBAAgB,CAAC,MAAM,KAAK,QAAQ,CAAC,MAAM,CAAA;;UAC7E,0BAA0B;;;;;IAAG,CAAC,gBAAgB,EAAE,MAAM,KAC1D,yBAAyB,CAAC,QAAQ,CAAC,gBAAgB,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;UAChE;YACA,GAAG,gBAAgB;YACnB,MAAM;SACP;UACC,gBAAgB,CAAA;IAEtB,OAAO,IAAI,CACT,IAAI;;;;;IAAmB,CAAC,gBAAgB,EAAE,MAAM,KAC9C,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;;UAEjC,EAAE;UACF,0BAA0B;;QAE1B,WAAW,CAAC,gBAAgB,CAAC,GAAG,EAAE,GAAG,gBAAgB,EACrD,MAAM,CACP,GACL,EAAE,CAAC,EACH,MAAM,CAAC,WAAW,CAAC,CACpB,CAAC;AACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;SClDe,8BAA8B,CAAC,EAAE,IAAI,EAAE,OAAO,EAAa;IACzE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AAC3B;;;;;;;;;;;;;;;;;;;uCCFC;;;IAHC,gDAAqB;;IACrB,+CAAoB;;IACpB,6CAAkB;;;;;;;;;;;;8BCFnB;;;IAFC,kCAAiC;;IACjC,kCAA0B;;;;;;6BAU3B;;;IAFC,+BAAc;;IACd,+BAAW;;;MAQD,qBAAqB;IAC/B,SAAS,OAAQ;IACjB,UAAU,OAAQ;EACnB;;;;;;2BAsBA;;;;;;IAXC,oCAA8B;;;;;IAK9B,2CAA6C;;;;;IAK7C,8CAA8C;;;;;;;;;;;;;;;;;;;;SCtChC,mBAAmB,CAGjC,QAA+B;IAC/B;;;;;IAAO,CAAC,KAAQ,EAAE,MAAS,KACzB,QAAQ,CAAC,MAAM;;;;;IAAC,CAAC,SAAS,EAAE,OAAO,KAAK,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC,GAAE,KAAK,CAAC,EAAC;AAC/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"daffodil-core-state.js","sources":["../../../libs/core/state/src/operators/substream.pipe.ts","../../../libs/core/state/src/errors/transform-error-to-state-error.ts","../../../libs/core/state/src/collection/sortable.ts","../../../libs/core/state/src/reducers/create-meta.ts","../../../libs/core/state/src/daffodil-core-state.ts"],"sourcesContent":["import { Action } from '@ngrx/store';\nimport { pipe } from 'rxjs';\nimport {\n scan,\n filter,\n} from 'rxjs/operators';\n\nexport type ActionType = Action['type'];\nexport type ActionSequenceStep = ActionType | ActionType[];\nexport type ActionSequence = ActionSequenceStep[];\n\nconst compareActionSequenceStep = (step: ActionSequenceStep, action: Action): boolean => Array.isArray(step)\n ? step.reduce((acc, type) => acc || action.type === type, false)\n : action.type === step;\n\n/**\n * Watches for a particular stream of actions in the specified order and\n * emits a list of those actions once all sequence steps have been matched.\n *\n * This will find the first occurence of the substream and not necessarily the most concise or recent substream.\n * For example, substream([A, B]) encountering an action stream of [A1, A2, B1, B2] will emit [A1, B1].\n * When a substream is found and emitted, the list is reset and it will continue to listen to the action stream.\n *\n * You can indicate that a particular step in the sequence can be matched by mutiple actions by passing an array for that step.\n * For example, if the first step of the sequence could be action A or action B: substream([[A, B], C]).\n * An action stream of [A1, C1] would cause substream to emit [A1, C1].\n * An action stream of [B1, C1] would cause substream to emit [B1, C1].\n * An action stream of [A1, B1, C1] would cause substream to emit [A1, C1].\n *\n * You can optionally pass a list of terminators.\n * If a terminator is encountered in the action stream, any partially matched substream is reset.\n * For example, substream([A, B], C) would not emit anything for an action stream of [A1, C1, B1].\n *\n * @param sequence The sequence of action types that define the substream to listen for.\n * @param terminators A list of terminators, any of which interrupt and reset a partially matched substream.\n */\nexport const substream = (sequence: ActionSequence, ...terminators: ActionType[]) => {\n const isFullMatch = matchedSubstream => matchedSubstream.length === sequence.length;\n const accumulateMatchedSubstream = (matchedSubstream, action) =>\n compareActionSequenceStep(sequence[matchedSubstream.length], action)\n ? [\n ...matchedSubstream,\n action,\n ]\n : matchedSubstream;\n\n return pipe(\n scan<Action, Action[]>((matchedSubstream, action) =>\n terminators.indexOf(action.type) > -1\n // terminator found, reset the list\n ? []\n : accumulateMatchedSubstream(\n // reset the list if fully matched\n isFullMatch(matchedSubstream) ? [] : matchedSubstream,\n action,\n ),\n []),\n filter(isFullMatch),\n );\n};\n","import { DaffError } from '@daffodil/core';\n\nimport { DaffStateError } from './state-error.interface';\n\nexport type ErrorTransformer = (DaffError) => DaffStateError;\n\n/**\n * Transforms an error instance to a state error object.\n */\nexport function daffTransformErrorToStateError({ code, message }: DaffError): DaffStateError {\n return { code, message };\n}\n","/**\n * The metadata that describes the sorting behavior of a collection of elements.\n */\nexport interface DaffSortOptions {\n default: DaffSortOption['value'];\n options: DaffSortOption[];\n}\n\n\n/**\n * One particular option used to sort a collection of elements;\n */\nexport interface DaffSortOption {\n label: string;\n value: any;\n}\n\n/**\n * The direction in which to sort a list of elements, e.g. if the list was\n * sorted alphabetically, \"Ascending\" would be from \"A-Z\",\n * and \"Descending\" would be from \"Z-A\".\n */\nexport enum DaffSortDirectionEnum {\n Ascending = 'ASC',\n Descending = 'DSC'\n}\n\n/**\n * Describes the properties of a collection that make the collection able to be\n * sorted by Daffodil.\n */\nexport interface DaffSortable {\n\n /**\n * The available options by which to sort the collection.\n */\n sort_options: DaffSortOptions;\n\n /**\n * The currently applied sorting option.\n */\n applied_sort_option: DaffSortOption['value'];\n\n /**\n * The currently applied sort direction.\n */\n applied_sort_direction: DaffSortDirectionEnum;\n}\n","import {\n Action,\n ActionReducer,\n} from '@ngrx/store';\n\n/**\n * Creates and returns a composite reducer that invokes each of the passed reducers in turn.\n */\nexport function daffComposeReducers<\n T,\n V extends Action = Action\n>(reducers: ActionReducer<T, V>[]): ActionReducer<T, V> {\n return (state: T, action: V): T =>\n reducers.reduce((nextState, reducer) => reducer(nextState, action), state);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAWA,MAAM,yBAAyB,GAAG,CAAC,IAAwB,EAAE,MAAc,KAAc,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;MACxG,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,KAAK,GAAG,IAAI,MAAM,CAAC,IAAI,KAAK,IAAI,EAAE,KAAK,CAAC;MAC9D,MAAM,CAAC,IAAI,KAAK,IAAI,CAAC;;AAEzB;;;;;;;;;;;;;;;;;;;;;MAqBa,SAAS,GAAG,CAAC,QAAwB,EAAE,GAAG,WAAyB;IAC9E,MAAM,WAAW,GAAG,gBAAgB,IAAI,gBAAgB,CAAC,MAAM,KAAK,QAAQ,CAAC,MAAM,CAAC;IACpF,MAAM,0BAA0B,GAAG,CAAC,gBAAgB,EAAE,MAAM,KAC1D,yBAAyB,CAAC,QAAQ,CAAC,gBAAgB,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;UAChE;YACA,GAAG,gBAAgB;YACnB,MAAM;SACP;UACC,gBAAgB,CAAC;IAEvB,OAAO,IAAI,CACT,IAAI,CAAmB,CAAC,gBAAgB,EAAE,MAAM,KAC9C,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;;UAEjC,EAAE;UACF,0BAA0B;;QAE1B,WAAW,CAAC,gBAAgB,CAAC,GAAG,EAAE,GAAG,gBAAgB,EACrD,MAAM,CACP,EACL,EAAE,CAAC,EACH,MAAM,CAAC,WAAW,CAAC,CACpB,CAAC;AACJ;;ACrDA;;;SAGgB,8BAA8B,CAAC,EAAE,IAAI,EAAE,OAAO,EAAa;IACzE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AAC3B;;ACMA;;;;;IAKY;AAAZ,WAAY,qBAAqB;IAC/B,0CAAiB,CAAA;IACjB,2CAAkB,CAAA;AACpB,CAAC,EAHW,qBAAqB,KAArB,qBAAqB;;ACjBjC;;;SAGgB,mBAAmB,CAGjC,QAA+B;IAC/B,OAAO,CAAC,KAAQ,EAAE,MAAS,KACzB,QAAQ,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,OAAO,KAAK,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC,EAAE,KAAK,CAAC,CAAC;AAC/E;;ACdA;;;;;;"}
@@ -1,12 +1,7 @@
1
- import { Injectable, ɵɵdefineInjectable, Pipe, NgModule } from '@angular/core';
1
+ import { ɵɵdefineInjectable, Injectable, Pipe, NgModule } from '@angular/core';
2
2
  import { name, address, internet, phone } from 'faker/locale/en_US';
3
3
  import { range } from '@daffodil/core';
4
4
 
5
- /**
6
- * @fileoverview added by tsickle
7
- * Generated from: factories/factory.ts
8
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
9
- */
10
5
  /**
11
6
  * The base class for model factories.
12
7
  *
@@ -29,7 +24,7 @@ import { range } from '@daffodil/core';
29
24
  * otherModel = this.createOtherModel()
30
25
  * }
31
26
  *
32
- * \@Injectable()
27
+ * @Injectable()
33
28
  * class TestFactory extends DaffModelFactory<MyMockModel> {
34
29
  * constructor(
35
30
  * otherFactory: MyOtherFactory
@@ -38,49 +33,20 @@ import { range } from '@daffodil/core';
38
33
  * }
39
34
  * }
40
35
  * ```
41
- * @abstract
42
- * @template T
43
36
  */
44
37
  class DaffModelFactory {
45
- /**
46
- * @param {?} type
47
- * @param {...?} args
48
- */
49
38
  constructor(type, ...args) {
50
39
  this.type = type;
51
40
  this._instantiationArgs = args;
52
41
  }
53
- /**
54
- * @param {?=} partial
55
- * @return {?}
56
- */
57
42
  create(partial = {}) {
58
43
  return Object.assign(Object.assign({}, new this.type(...this._instantiationArgs)), partial);
59
44
  }
60
- /**
61
- * @param {?=} qty
62
- * @param {?=} partial
63
- * @return {?}
64
- */
65
45
  createMany(qty = 1, partial = {}) {
66
- return range(0, qty - 1).map((/**
67
- * @return {?}
68
- */
69
- () => this.create(partial)));
46
+ return range(0, qty - 1).map(() => this.create(partial));
70
47
  }
71
48
  }
72
- if (false) {
73
- /** @type {?} */
74
- DaffModelFactory.prototype._instantiationArgs;
75
- /** @type {?} */
76
- DaffModelFactory.prototype.type;
77
- }
78
49
 
79
- /**
80
- * @fileoverview added by tsickle
81
- * Generated from: address/factories/address.factory.ts
82
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
83
- */
84
50
  /**
85
51
  * @deprecated
86
52
  * Prefer the `MockDaffAddress` of daffodil/geography/testing`
@@ -97,24 +63,6 @@ class MockDaffAddress {
97
63
  this.telephone = phone.phoneNumber();
98
64
  }
99
65
  }
100
- if (false) {
101
- /** @type {?} */
102
- MockDaffAddress.prototype.firstname;
103
- /** @type {?} */
104
- MockDaffAddress.prototype.lastname;
105
- /** @type {?} */
106
- MockDaffAddress.prototype.street;
107
- /** @type {?} */
108
- MockDaffAddress.prototype.city;
109
- /** @type {?} */
110
- MockDaffAddress.prototype.state;
111
- /** @type {?} */
112
- MockDaffAddress.prototype.email;
113
- /** @type {?} */
114
- MockDaffAddress.prototype.postcode;
115
- /** @type {?} */
116
- MockDaffAddress.prototype.telephone;
117
- }
118
66
  /**
119
67
  * @deprecated
120
68
  * Prefer the `DaffAddressFactory` of `daffodil/geography/testing`
@@ -124,6 +72,7 @@ class DaffAddressFactory extends DaffModelFactory {
124
72
  super(MockDaffAddress);
125
73
  }
126
74
  }
75
+ /** @nocollapse */ DaffAddressFactory.ɵprov = ɵɵdefineInjectable({ factory: function DaffAddressFactory_Factory() { return new DaffAddressFactory(); }, token: DaffAddressFactory, providedIn: "root" });
127
76
  DaffAddressFactory.decorators = [
128
77
  { type: Injectable, args: [{
129
78
  providedIn: 'root',
@@ -131,24 +80,14 @@ DaffAddressFactory.decorators = [
131
80
  ];
132
81
  /** @nocollapse */
133
82
  DaffAddressFactory.ctorParameters = () => [];
134
- /** @nocollapse */ DaffAddressFactory.ɵprov = ɵɵdefineInjectable({ factory: function DaffAddressFactory_Factory() { return new DaffAddressFactory(); }, token: DaffAddressFactory, providedIn: "root" });
135
83
 
136
84
  /**
137
- * @fileoverview added by tsickle
138
- * Generated from: angular/mocks/pipes/currency.ts
139
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
140
- */
141
- /**
142
- * \@docs
85
+ * @docs
143
86
  * A mock CurrencyPipe that does nothing to a given input.
144
87
  * This pipe is useful for asserting that a CurrencyPipe is in use via a spy,
145
88
  * but ignoring the actual underlying implementation
146
89
  */
147
90
  class DaffMockCurrencyPipe {
148
- /**
149
- * @param {?} value
150
- * @return {?}
151
- */
152
91
  transform(value) { }
153
92
  ;
154
93
  }
@@ -156,11 +95,6 @@ DaffMockCurrencyPipe.decorators = [
156
95
  { type: Pipe, args: [{ name: 'currency' },] }
157
96
  ];
158
97
 
159
- /**
160
- * @fileoverview added by tsickle
161
- * Generated from: testing.module.ts
162
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
163
- */
164
98
  class DaffCoreTestingModule {
165
99
  }
166
100
  DaffCoreTestingModule.decorators = [
@@ -171,16 +105,10 @@ DaffCoreTestingModule.decorators = [
171
105
  },] }
172
106
  ];
173
107
 
174
- /**
175
- * @fileoverview added by tsickle
176
- * Generated from: index.ts
177
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
178
- */
108
+ // Address
179
109
 
180
110
  /**
181
- * @fileoverview added by tsickle
182
- * Generated from: daffodil-core-testing.ts
183
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
111
+ * Generated bundle index. Do not edit.
184
112
  */
185
113
 
186
114
  export { DaffAddressFactory, DaffCoreTestingModule, DaffMockCurrencyPipe, DaffModelFactory };
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-core-testing.js","sources":["../../../libs/core/testing/src/factories/factory.ts","../../../libs/core/testing/src/address/factories/address.factory.ts","../../../libs/core/testing/src/angular/mocks/pipes/currency.ts","../../../libs/core/testing/src/testing.module.ts"],"sourcesContent":["import {\n range,\n Constructable,\n} from '@daffodil/core';\n\nimport { IDaffModelFactory } from './factory.interface';\n\n/**\n * The base class for model factories.\n *\n * The mock class is passed as the first constructor arg\n * and any additional args are passed to the mock class constructor.\n *\n * The following example demonstrates using this feature to inject\n * a different factory into a mock class.\n *\n * ```ts\n * class MyMockModel {\n * constructor(\n * private otherFactory: MyOtherFactory\n * ) {}\n *\n * private createOtherModel() {\n * return this.otherFactory.create()\n * }\n *\n * otherModel = this.createOtherModel()\n * }\n *\n * @Injectable()\n * class TestFactory extends DaffModelFactory<MyMockModel> {\n * constructor(\n * otherFactory: MyOtherFactory\n * ) {\n * super(MyMockModel, otherFactory)\n * }\n * }\n * ```\n */\nexport abstract class DaffModelFactory<T extends Record<string, any>> implements IDaffModelFactory<T> {\n _instantiationArgs: ConstructorParameters<Constructable<T>>;\n\n constructor(\n public type: Constructable<T>,\n ...args: ConstructorParameters<Constructable<T>>\n ) {\n this._instantiationArgs = args;\n }\n\n create(partial = {}): T {\n return {\n ...new this.type(...this._instantiationArgs),\n ...partial,\n };\n }\n\n createMany(qty = 1, partial = {}): T[] {\n return range(0, qty - 1).map(() => this.create(partial));\n }\n}\n","import { Injectable } from '@angular/core';\nimport * as faker from 'faker/locale/en_US';\n\nimport { DaffAddress } from '@daffodil/core';\n\nimport { DaffModelFactory } from '../../factories/factory';\n\n/**\n * @deprecated\n * Prefer the `MockDaffAddress` of daffodil/geography/testing`\n */\nexport class MockDaffAddress implements DaffAddress {\n firstname = faker.name.firstName();\n lastname = faker.name.lastName();\n street = faker.address.streetName();\n city = faker.address.city();\n state = faker.address.stateAbbr();\n email = faker.internet.email();\n postcode = faker.address.zipCode();\n telephone = faker.phone.phoneNumber();\n}\n\n/**\n * @deprecated\n * Prefer the `DaffAddressFactory` of `daffodil/geography/testing`\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffAddressFactory extends DaffModelFactory<DaffAddress>{\n constructor(){\n super(MockDaffAddress);\n }\n}\n","import {\n Pipe,\n PipeTransform,\n} from '@angular/core';\n\n/**\n * @docs\n * A mock CurrencyPipe that does nothing to a given input.\n * This pipe is useful for asserting that a CurrencyPipe is in use via a spy,\n * but ignoring the actual underlying implementation\n */\n@Pipe({ name: 'currency' })\nexport class DaffMockCurrencyPipe implements PipeTransform {\n transform(value: number) {};\n}\n","import { NgModule } from '@angular/core';\n\nimport { DaffMockCurrencyPipe } from './angular/mocks/pipes/currency';\n\n@NgModule({\n declarations: [\n DaffMockCurrencyPipe,\n ],\n})\nexport class DaffCoreTestingModule {}\n"],"names":["faker.name","faker.address","faker.internet","faker.phone"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAuCsB,gBAAgB;;;;;IAGpC,YACS,IAAsB,EAC7B,GAAG,IAA6C;QADzC,SAAI,GAAJ,IAAI,CAAkB;QAG7B,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC;KAChC;;;;;IAED,MAAM,CAAC,OAAO,GAAG,EAAE;QACjB,uCACK,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,kBAAkB,CAAC,GACzC,OAAO,EACV;KACH;;;;;;IAED,UAAU,CAAC,GAAG,GAAG,CAAC,EAAE,OAAO,GAAG,EAAE;QAC9B,OAAO,KAAK,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG;;;QAAC,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,EAAC,CAAC;KAC1D;CACF;;;IAnBC,8CAA4D;;IAG1D,gCAA6B;;;;;;;;;;;;MChCpB,eAAe;IAA5B;QACE,cAAS,GAAGA,IAAU,CAAC,SAAS,EAAE,CAAC;QACnC,aAAQ,GAAGA,IAAU,CAAC,QAAQ,EAAE,CAAC;QACjC,WAAM,GAAGC,OAAa,CAAC,UAAU,EAAE,CAAC;QACpC,SAAI,GAAGA,OAAa,CAAC,IAAI,EAAE,CAAC;QAC5B,UAAK,GAAGA,OAAa,CAAC,SAAS,EAAE,CAAC;QAClC,UAAK,GAAGC,QAAc,CAAC,KAAK,EAAE,CAAC;QAC/B,aAAQ,GAAGD,OAAa,CAAC,OAAO,EAAE,CAAC;QACnC,cAAS,GAAGE,KAAW,CAAC,WAAW,EAAE,CAAC;KACvC;CAAA;;;IARC,oCAAmC;;IACnC,mCAAiC;;IACjC,iCAAoC;;IACpC,+BAA4B;;IAC5B,gCAAkC;;IAClC,gCAA+B;;IAC/B,mCAAmC;;IACnC,oCAAsC;;;;;;MAU3B,kBAAmB,SAAQ,gBAA6B;IACnE;QACE,KAAK,CAAC,eAAe,CAAC,CAAC;KACxB;;;YANF,UAAU,SAAC;gBACV,UAAU,EAAE,MAAM;aACnB;;;;;;;;;;;;;;;;;MChBY,oBAAoB;;;;;IAC/B,SAAS,CAAC,KAAa,KAAI;;;;YAF5B,IAAI,SAAC,EAAE,IAAI,EAAE,UAAU,EAAE;;;;;;;;MCFb,qBAAqB;;;YALjC,QAAQ,SAAC;gBACR,YAAY,EAAE;oBACZ,oBAAoB;iBACrB;aACF;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"daffodil-core-testing.js","sources":["../../../libs/core/testing/src/factories/factory.ts","../../../libs/core/testing/src/address/factories/address.factory.ts","../../../libs/core/testing/src/angular/mocks/pipes/currency.ts","../../../libs/core/testing/src/testing.module.ts","../../../libs/core/testing/src/index.ts","../../../libs/core/testing/src/daffodil-core-testing.ts"],"sourcesContent":["import {\n range,\n Constructable,\n} from '@daffodil/core';\n\nimport { IDaffModelFactory } from './factory.interface';\n\n/**\n * The base class for model factories.\n *\n * The mock class is passed as the first constructor arg\n * and any additional args are passed to the mock class constructor.\n *\n * The following example demonstrates using this feature to inject\n * a different factory into a mock class.\n *\n * ```ts\n * class MyMockModel {\n * constructor(\n * private otherFactory: MyOtherFactory\n * ) {}\n *\n * private createOtherModel() {\n * return this.otherFactory.create()\n * }\n *\n * otherModel = this.createOtherModel()\n * }\n *\n * @Injectable()\n * class TestFactory extends DaffModelFactory<MyMockModel> {\n * constructor(\n * otherFactory: MyOtherFactory\n * ) {\n * super(MyMockModel, otherFactory)\n * }\n * }\n * ```\n */\nexport abstract class DaffModelFactory<T extends Record<string, any>> implements IDaffModelFactory<T> {\n _instantiationArgs: ConstructorParameters<Constructable<T>>;\n\n constructor(\n public type: Constructable<T>,\n ...args: ConstructorParameters<Constructable<T>>\n ) {\n this._instantiationArgs = args;\n }\n\n create(partial = {}): T {\n return {\n ...new this.type(...this._instantiationArgs),\n ...partial,\n };\n }\n\n createMany(qty = 1, partial = {}): T[] {\n return range(0, qty - 1).map(() => this.create(partial));\n }\n}\n","import { Injectable } from '@angular/core';\nimport * as faker from 'faker/locale/en_US';\n\nimport { DaffAddress } from '@daffodil/core';\n\nimport { DaffModelFactory } from '../../factories/factory';\n\n/**\n * @deprecated\n * Prefer the `MockDaffAddress` of daffodil/geography/testing`\n */\nexport class MockDaffAddress implements DaffAddress {\n firstname = faker.name.firstName();\n lastname = faker.name.lastName();\n street = faker.address.streetName();\n city = faker.address.city();\n state = faker.address.stateAbbr();\n email = faker.internet.email();\n postcode = faker.address.zipCode();\n telephone = faker.phone.phoneNumber();\n}\n\n/**\n * @deprecated\n * Prefer the `DaffAddressFactory` of `daffodil/geography/testing`\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffAddressFactory extends DaffModelFactory<DaffAddress>{\n constructor(){\n super(MockDaffAddress);\n }\n}\n","import {\n Pipe,\n PipeTransform,\n} from '@angular/core';\n\n/**\n * @docs\n * A mock CurrencyPipe that does nothing to a given input.\n * This pipe is useful for asserting that a CurrencyPipe is in use via a spy,\n * but ignoring the actual underlying implementation\n */\n@Pipe({ name: 'currency' })\nexport class DaffMockCurrencyPipe implements PipeTransform {\n transform(value: number) {};\n}\n","import { NgModule } from '@angular/core';\n\nimport { DaffMockCurrencyPipe } from './angular/mocks/pipes/currency';\n\n@NgModule({\n declarations: [\n DaffMockCurrencyPipe,\n ],\n})\nexport class DaffCoreTestingModule {}\n","// Address\nexport { DaffAddressFactory } from './address/factories/address.factory';\n\n//@angular/core\nexport { DaffMockCurrencyPipe } from './angular/mocks/pipes/currency';\nexport { DaffInMemoryDataServiceInterface } from './angular/interfaces/in-memory-data-service.interface';\n\n//Core\nexport { DaffCoreTestingModule } from './testing.module';\nexport { DaffModelFactory } from './factories/factory';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["faker.name","faker.address","faker.internet","faker.phone"],"mappings":";;;;AAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAgCsB,gBAAgB;IAGpC,YACS,IAAsB,EAC7B,GAAG,IAA6C;QADzC,SAAI,GAAJ,IAAI,CAAkB;QAG7B,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC;KAChC;IAED,MAAM,CAAC,OAAO,GAAG,EAAE;QACjB,uCACK,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,kBAAkB,CAAC,GACzC,OAAO,EACV;KACH;IAED,UAAU,CAAC,GAAG,GAAG,CAAC,EAAE,OAAO,GAAG,EAAE;QAC9B,OAAO,KAAK,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;KAC1D;;;ACnDH;;;;MAIa,eAAe;IAA5B;QACE,cAAS,GAAGA,IAAU,CAAC,SAAS,EAAE,CAAC;QACnC,aAAQ,GAAGA,IAAU,CAAC,QAAQ,EAAE,CAAC;QACjC,WAAM,GAAGC,OAAa,CAAC,UAAU,EAAE,CAAC;QACpC,SAAI,GAAGA,OAAa,CAAC,IAAI,EAAE,CAAC;QAC5B,UAAK,GAAGA,OAAa,CAAC,SAAS,EAAE,CAAC;QAClC,UAAK,GAAGC,QAAc,CAAC,KAAK,EAAE,CAAC;QAC/B,aAAQ,GAAGD,OAAa,CAAC,OAAO,EAAE,CAAC;QACnC,cAAS,GAAGE,KAAW,CAAC,WAAW,EAAE,CAAC;KACvC;CAAA;AAED;;;;MAOa,kBAAmB,SAAQ,gBAA6B;IACnE;QACE,KAAK,CAAC,eAAe,CAAC,CAAC;KACxB;;;;YANF,UAAU,SAAC;gBACV,UAAU,EAAE,MAAM;aACnB;;;;;ACvBD;;;;;;MAOa,oBAAoB;IAC/B,SAAS,CAAC,KAAa,KAAI;;;;YAF5B,IAAI,SAAC,EAAE,IAAI,EAAE,UAAU,EAAE;;;MCFb,qBAAqB;;;YALjC,QAAQ,SAAC;gBACR,YAAY,EAAE;oBACZ,oBAAoB;iBACrB;aACF;;;ACRD;;ACAA;;;;;;"}