@daffodil/core 0.38.9 → 0.39.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 (118) 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/package.json +1 -1
  115. package/routing/package.json +1 -1
  116. package/state/package.json +1 -1
  117. package/testing/package.json +1 -1
  118. package/utils/long-arithmetic.d.ts +3 -0
@@ -1,98 +1,34 @@
1
- import { Injectable, ɵɵdefineInjectable, ɵɵinject } from '@angular/core';
1
+ import { ɵɵdefineInjectable, ɵɵinject, Injectable } from '@angular/core';
2
2
  import { Apollo } from 'apollo-angular';
3
3
  import { Observable } from 'rxjs';
4
4
 
5
- /**
6
- * @fileoverview added by tsickle
7
- * Generated from: fragments/build-fragment-name-spread.ts
8
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
9
- */
10
- /** @type {?} */
11
- const getFragmentNames = (/**
12
- * @param {?} fragment
13
- * @return {?}
14
- */
15
- (fragment) => fragment.definitions.filter((/**
16
- * @param {?} def
17
- * @return {?}
18
- */
19
- def => def.kind === 'FragmentDefinition')).map((/**
20
- * @param {?} def
21
- * @return {?}
22
- */
23
- def => ((/** @type {?} */ (def))).name.value)));
5
+ const getFragmentNames = (fragment) => fragment.definitions.filter(def => def.kind === 'FragmentDefinition').map(def => def.name.value);
24
6
  const ɵ0 = getFragmentNames;
25
7
  /**
26
8
  * Builds a list of fragment names present inside the specified GraphQL document nodes.
27
9
  * Returns an empty array if no fragments have been defined or if null is passed.
28
10
  *
29
- * \@param fragments The created fragments.
30
- * @type {?}
11
+ * @param fragments The created fragments.
31
12
  */
32
- const daffGetFragmentNames = (/**
33
- * @param {...?} fragments
34
- * @return {?}
35
- */
36
- (...fragments) => fragments.reduce((/**
37
- * @param {?} acc
38
- * @param {?} fragment
39
- * @return {?}
40
- */
41
- (acc, fragment) => acc.concat(getFragmentNames(fragment))), []));
13
+ const daffGetFragmentNames = (...fragments) => fragments.reduce((acc, fragment) => acc.concat(getFragmentNames(fragment)), []);
42
14
  const ɵ1 = daffGetFragmentNames;
43
15
  /**
44
16
  * Builds a string of fragment names that can be interpolated into a GraphQL query.
45
17
  * Each name is separated by a newline character: '\n'.
46
18
  * If an empty array is passed, an empty string is returned.
47
19
  *
48
- * \@param fragments A list of GraphQL documents that contain fragments.
49
- * @type {?}
50
- */
51
- const daffBuildFragmentNameSpread = (/**
52
- * @param {...?} fragments
53
- * @return {?}
20
+ * @param fragments A list of GraphQL documents that contain fragments.
54
21
  */
55
- (...fragments) => daffGetFragmentNames(...fragments).reduce((/**
56
- * @param {?} acc
57
- * @param {?} name
58
- * @return {?}
59
- */
60
- (acc, name) => acc.concat(`...${name}\n`)), ''));
22
+ const daffBuildFragmentNameSpread = (...fragments) => daffGetFragmentNames(...fragments).reduce((acc, name) => acc.concat(`...${name}\n`), '');
61
23
 
62
- /**
63
- * @fileoverview added by tsickle
64
- * Generated from: fragments/build-fragment-definition.ts
65
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
66
- */
67
24
  /**
68
25
  * Builds a string of fragment definitions that can be interpolated into a GraphQL query.
69
26
  * Each definition is separated by a newline character: '\n'.
70
27
  *
71
- * \@param documents A list of GraphQL documents that should only contain fragments.
72
- * @type {?}
73
- */
74
- const daffBuildFragmentDefinition = (/**
75
- * @param {...?} documents
76
- * @return {?}
77
- */
78
- (...documents) => documents.reduce((/**
79
- * @param {?} acc
80
- * @param {?} fragment
81
- * @return {?}
28
+ * @param documents A list of GraphQL documents that should only contain fragments.
82
29
  */
83
- (acc, fragment) => acc.concat(`${fragment.loc.source.body}\n`)), ''));
30
+ const daffBuildFragmentDefinition = (...documents) => documents.reduce((acc, fragment) => acc.concat(`${fragment.loc.source.body}\n`), '');
84
31
 
85
- /**
86
- * @fileoverview added by tsickle
87
- * Generated from: fragments/public_api.ts
88
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
89
- */
90
-
91
- /**
92
- * @fileoverview added by tsickle
93
- * Generated from: apollo/queued-apollo/queued-apollo.service.ts
94
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
95
- */
96
32
  /**
97
33
  * A service that will queue mutate calls to Apollo.
98
34
  * It will not send subsequent mutate requests until the previous one has been completed.
@@ -100,9 +36,6 @@ const daffBuildFragmentDefinition = (/**
100
36
  * This should be used alongside Apollo.
101
37
  */
102
38
  class DaffQueuedApollo {
103
- /**
104
- * @param {?} apollo
105
- */
106
39
  constructor(apollo) {
107
40
  this.apollo = apollo;
108
41
  this.queue = [];
@@ -114,63 +47,31 @@ class DaffQueuedApollo {
114
47
  * Otherwise, it will be sent when it reaches the front of the queue.
115
48
  * The observable will complete after it emits once.
116
49
  *
117
- * @template T, V
118
- * @param {?} options Mutation options.
119
- * @return {?}
50
+ * @param options Mutation options.
120
51
  */
121
52
  mutate(options) {
122
- return new Observable((/**
123
- * @param {?} subscriber
124
- * @return {?}
125
- */
126
- subscriber => this.addRequestToQueue(subscriber, this.apollo.mutate(options))));
53
+ return new Observable(subscriber => this.addRequestToQueue(subscriber, this.apollo.mutate(options)));
127
54
  }
128
- /**
129
- * @private
130
- * @param {?} subscriber
131
- * @param {?} request
132
- * @return {?}
133
- */
134
55
  addRequestToQueue(subscriber, request) {
135
- this.queue.push((/**
136
- * @return {?}
137
- */
138
- () => {
139
- /** @type {?} */
140
- const sub = request.subscribe((/**
141
- * @param {?} response
142
- * @return {?}
143
- */
144
- response => {
56
+ this.queue.push(() => {
57
+ const sub = request.subscribe(response => {
145
58
  // emit the outer observable
146
59
  subscriber.next(response);
147
60
  subscriber.complete();
148
61
  this.finishRequestSubscription(sub);
149
- }), (/**
150
- * @param {?} error
151
- * @return {?}
152
- */
153
- error => {
62
+ }, error => {
154
63
  subscriber.error(error);
155
64
  this.finishRequestSubscription(sub);
156
- }), (/**
157
- * @return {?}
158
- */
159
- () => {
65
+ }, () => {
160
66
  subscriber.complete();
161
67
  this.finishRequestSubscription(sub);
162
- }));
163
- }));
68
+ });
69
+ });
164
70
  // start the queue if previously empty
165
71
  if (this.queue.length === 1) {
166
72
  this.queue[0]();
167
73
  }
168
74
  }
169
- /**
170
- * @private
171
- * @param {?} requestSubscription
172
- * @return {?}
173
- */
174
75
  finishRequestSubscription(requestSubscription) {
175
76
  var _a, _b;
176
77
  requestSubscription.unsubscribe();
@@ -179,6 +80,7 @@ class DaffQueuedApollo {
179
80
  (_b = (_a = this.queue)[0]) === null || _b === void 0 ? void 0 : _b.call(_a);
180
81
  }
181
82
  }
83
+ /** @nocollapse */ DaffQueuedApollo.ɵprov = ɵɵdefineInjectable({ factory: function DaffQueuedApollo_Factory() { return new DaffQueuedApollo(ɵɵinject(Apollo)); }, token: DaffQueuedApollo, providedIn: "root" });
182
84
  DaffQueuedApollo.decorators = [
183
85
  { type: Injectable, args: [{
184
86
  providedIn: 'root',
@@ -188,39 +90,9 @@ DaffQueuedApollo.decorators = [
188
90
  DaffQueuedApollo.ctorParameters = () => [
189
91
  { type: Apollo }
190
92
  ];
191
- /** @nocollapse */ DaffQueuedApollo.ɵprov = ɵɵdefineInjectable({ factory: function DaffQueuedApollo_Factory() { return new DaffQueuedApollo(ɵɵinject(Apollo)); }, token: DaffQueuedApollo, providedIn: "root" });
192
- if (false) {
193
- /** @type {?} */
194
- DaffQueuedApollo.prototype.queue;
195
- /**
196
- * @type {?}
197
- * @private
198
- */
199
- DaffQueuedApollo.prototype.apollo;
200
- }
201
-
202
- /**
203
- * @fileoverview added by tsickle
204
- * Generated from: apollo/public_api.ts
205
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
206
- */
207
-
208
- /**
209
- * @fileoverview added by tsickle
210
- * Generated from: public_api.ts
211
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
212
- */
213
-
214
- /**
215
- * @fileoverview added by tsickle
216
- * Generated from: index.ts
217
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
218
- */
219
93
 
220
94
  /**
221
- * @fileoverview added by tsickle
222
- * Generated from: daffodil-core-graphql.ts
223
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
95
+ * Generated bundle index. Do not edit.
224
96
  */
225
97
 
226
98
  export { DaffQueuedApollo, daffBuildFragmentDefinition, daffBuildFragmentNameSpread };
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-core-graphql.js","sources":["../../../libs/core/graphql/src/fragments/build-fragment-name-spread.ts","../../../libs/core/graphql/src/fragments/build-fragment-definition.ts","../../../libs/core/graphql/src/apollo/queued-apollo/queued-apollo.service.ts"],"sourcesContent":["import {\n DocumentNode,\n FragmentDefinitionNode,\n} from 'graphql';\n\nconst getFragmentNames = (fragment: DocumentNode) =>\n fragment.definitions.filter(def =>\n def.kind === 'FragmentDefinition',\n ).map(def =>\n (<FragmentDefinitionNode>def).name.value,\n );\n\n/**\n * Builds a list of fragment names present inside the specified GraphQL document nodes.\n * Returns an empty array if no fragments have been defined or if null is passed.\n *\n * @param fragments The created fragments.\n */\nconst daffGetFragmentNames = (...fragments: DocumentNode[]): string[] =>\n fragments.reduce((acc, fragment) => acc.concat(getFragmentNames(fragment)), []);\n\n/**\n * Builds a string of fragment names that can be interpolated into a GraphQL query.\n * Each name is separated by a newline character: '\\n'.\n * If an empty array is passed, an empty string is returned.\n *\n * @param fragments A list of GraphQL documents that contain fragments.\n */\nexport const daffBuildFragmentNameSpread = (...fragments: DocumentNode[]): string =>\n daffGetFragmentNames(...fragments).reduce((acc, name) => acc.concat(`...${name}\\n`), '');\n","import { DocumentNode } from 'graphql';\n\n/**\n * Builds a string of fragment definitions that can be interpolated into a GraphQL query.\n * Each definition is separated by a newline character: '\\n'.\n *\n * @param documents A list of GraphQL documents that should only contain fragments.\n */\nexport const daffBuildFragmentDefinition = (...documents: DocumentNode[]): string =>\n documents.reduce((acc, fragment) => acc.concat(`${fragment.loc.source.body}\\n`), '');\n","import { Injectable } from '@angular/core';\nimport {\n MutationOptions,\n FetchResult,\n} from '@apollo/client/core';\nimport { Apollo } from 'apollo-angular';\nimport { EmptyObject } from 'apollo-angular/types';\nimport {\n Observable,\n Subscriber,\n Subscription,\n} from 'rxjs';\n\n/**\n * A service that will queue mutate calls to Apollo.\n * It will not send subsequent mutate requests until the previous one has been completed.\n * This is useful for avoiding race conditions on the backend.\n * This should be used alongside Apollo.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffQueuedApollo {\n queue: (() => void)[] = [];\n\n constructor(\n private apollo: Apollo,\n ) {}\n\n /**\n * Queue up a mutate request.\n * The request will not actually be queued until the returned observable is subscribed.\n * If the queue is empty, the request will be sent when it enters the queue.\n * Otherwise, it will be sent when it reaches the front of the queue.\n * The observable will complete after it emits once.\n *\n * @param options Mutation options.\n */\n mutate<T, V = EmptyObject>(options: MutationOptions<T, V>): Observable<FetchResult<T>> {\n return new Observable(subscriber => this.addRequestToQueue(subscriber, this.apollo.mutate(options)));\n }\n\n private addRequestToQueue(subscriber: Subscriber<any>, request: Observable<any>): void {\n this.queue.push(() => {\n const sub = request.subscribe(\n response => {\n // emit the outer observable\n subscriber.next(response);\n subscriber.complete();\n\n this.finishRequestSubscription(sub);\n },\n error => {\n subscriber.error(error);\n this.finishRequestSubscription(sub);\n },\n () => {\n subscriber.complete();\n this.finishRequestSubscription(sub);\n },\n );\n });\n\n // start the queue if previously empty\n if (this.queue.length === 1) {\n this.queue[0]();\n }\n }\n\n private finishRequestSubscription(requestSubscription: Subscription): void {\n requestSubscription.unsubscribe();\n\n // process queue\n this.queue.shift();\n this.queue[0]?.();\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;MAKM,gBAAgB;;;;AAAG,CAAC,QAAsB,KAC9C,QAAQ,CAAC,WAAW,CAAC,MAAM;;;;AAAC,GAAG,IAC7B,GAAG,CAAC,IAAI,KAAK,oBAAoB,EAClC,CAAC,GAAG;;;;AAAC,GAAG,IACP,oBAAyB,GAAG,IAAE,IAAI,CAAC,KAAK,EACzC,CAAA;;;;;;;;;MAQG,oBAAoB;;;;AAAG,CAAC,GAAG,SAAyB,KACxD,SAAS,CAAC,MAAM;;;;;AAAC,CAAC,GAAG,EAAE,QAAQ,KAAK,GAAG,CAAC,MAAM,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,GAAE,EAAE,CAAC,CAAA;;;;;;;;;;MASpE,2BAA2B;;;;AAAG,CAAC,GAAG,SAAyB,KACtE,oBAAoB,CAAC,GAAG,SAAS,CAAC,CAAC,MAAM;;;;;AAAC,CAAC,GAAG,EAAE,IAAI,KAAK,GAAG,CAAC,MAAM,CAAC,MAAM,IAAI,IAAI,CAAC,GAAE,EAAE,CAAC;;;;;;;;;;;;;;MCrB7E,2BAA2B;;;;AAAG,CAAC,GAAG,SAAyB,KACtE,SAAS,CAAC,MAAM;;;;;AAAC,CAAC,GAAG,EAAE,QAAQ,KAAK,GAAG,CAAC,MAAM,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,GAAE,EAAE,CAAC;;;;;;;;;;;;;;;;;;;MCazE,gBAAgB;;;;IAG3B,YACU,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;QAHxB,UAAK,GAAmB,EAAE,CAAC;KAIvB;;;;;;;;;;;;IAWJ,MAAM,CAAqB,OAA8B;QACvD,OAAO,IAAI,UAAU;;;;QAAC,UAAU,IAAI,IAAI,CAAC,iBAAiB,CAAC,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,EAAC,CAAC;KACtG;;;;;;;IAEO,iBAAiB,CAAC,UAA2B,EAAE,OAAwB;QAC7E,IAAI,CAAC,KAAK,CAAC,IAAI;;;QAAC;;kBACR,GAAG,GAAG,OAAO,CAAC,SAAS;;;;YAC3B,QAAQ;;gBAEN,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gBAC1B,UAAU,CAAC,QAAQ,EAAE,CAAC;gBAEtB,IAAI,CAAC,yBAAyB,CAAC,GAAG,CAAC,CAAC;aACrC;;;;YACD,KAAK;gBACH,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;gBACxB,IAAI,CAAC,yBAAyB,CAAC,GAAG,CAAC,CAAC;aACrC;;;YACD;gBACE,UAAU,CAAC,QAAQ,EAAE,CAAC;gBACtB,IAAI,CAAC,yBAAyB,CAAC,GAAG,CAAC,CAAC;aACrC,EACF;SACF,EAAC,CAAC;;QAGH,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;YAC3B,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;SACjB;KACF;;;;;;IAEO,yBAAyB,CAAC,mBAAiC;;QACjE,mBAAmB,CAAC,WAAW,EAAE,CAAC;;QAGlC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;QACnB,MAAA,MAAA,IAAI,CAAC,KAAK,EAAC,CAAC,CAAC,mDAAK;KACnB;;;YAxDF,UAAU,SAAC;gBACV,UAAU,EAAE,MAAM;aACnB;;;;YAhBQ,MAAM;;;;;IAkBb,iCAA2B;;;;;IAGzB,kCAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"daffodil-core-graphql.js","sources":["../../../libs/core/graphql/src/fragments/build-fragment-name-spread.ts","../../../libs/core/graphql/src/fragments/build-fragment-definition.ts","../../../libs/core/graphql/src/apollo/queued-apollo/queued-apollo.service.ts","../../../libs/core/graphql/src/daffodil-core-graphql.ts"],"sourcesContent":["import {\n DocumentNode,\n FragmentDefinitionNode,\n} from 'graphql';\n\nconst getFragmentNames = (fragment: DocumentNode) =>\n fragment.definitions.filter(def =>\n def.kind === 'FragmentDefinition',\n ).map(def =>\n (<FragmentDefinitionNode>def).name.value,\n );\n\n/**\n * Builds a list of fragment names present inside the specified GraphQL document nodes.\n * Returns an empty array if no fragments have been defined or if null is passed.\n *\n * @param fragments The created fragments.\n */\nconst daffGetFragmentNames = (...fragments: DocumentNode[]): string[] =>\n fragments.reduce((acc, fragment) => acc.concat(getFragmentNames(fragment)), []);\n\n/**\n * Builds a string of fragment names that can be interpolated into a GraphQL query.\n * Each name is separated by a newline character: '\\n'.\n * If an empty array is passed, an empty string is returned.\n *\n * @param fragments A list of GraphQL documents that contain fragments.\n */\nexport const daffBuildFragmentNameSpread = (...fragments: DocumentNode[]): string =>\n daffGetFragmentNames(...fragments).reduce((acc, name) => acc.concat(`...${name}\\n`), '');\n","import { DocumentNode } from 'graphql';\n\n/**\n * Builds a string of fragment definitions that can be interpolated into a GraphQL query.\n * Each definition is separated by a newline character: '\\n'.\n *\n * @param documents A list of GraphQL documents that should only contain fragments.\n */\nexport const daffBuildFragmentDefinition = (...documents: DocumentNode[]): string =>\n documents.reduce((acc, fragment) => acc.concat(`${fragment.loc.source.body}\\n`), '');\n","import { Injectable } from '@angular/core';\nimport {\n MutationOptions,\n FetchResult,\n} from '@apollo/client/core';\nimport { Apollo } from 'apollo-angular';\nimport { EmptyObject } from 'apollo-angular/types';\nimport {\n Observable,\n Subscriber,\n Subscription,\n} from 'rxjs';\n\n/**\n * A service that will queue mutate calls to Apollo.\n * It will not send subsequent mutate requests until the previous one has been completed.\n * This is useful for avoiding race conditions on the backend.\n * This should be used alongside Apollo.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffQueuedApollo {\n queue: (() => void)[] = [];\n\n constructor(\n private apollo: Apollo,\n ) {}\n\n /**\n * Queue up a mutate request.\n * The request will not actually be queued until the returned observable is subscribed.\n * If the queue is empty, the request will be sent when it enters the queue.\n * Otherwise, it will be sent when it reaches the front of the queue.\n * The observable will complete after it emits once.\n *\n * @param options Mutation options.\n */\n mutate<T, V = EmptyObject>(options: MutationOptions<T, V>): Observable<FetchResult<T>> {\n return new Observable(subscriber => this.addRequestToQueue(subscriber, this.apollo.mutate(options)));\n }\n\n private addRequestToQueue(subscriber: Subscriber<any>, request: Observable<any>): void {\n this.queue.push(() => {\n const sub = request.subscribe(\n response => {\n // emit the outer observable\n subscriber.next(response);\n subscriber.complete();\n\n this.finishRequestSubscription(sub);\n },\n error => {\n subscriber.error(error);\n this.finishRequestSubscription(sub);\n },\n () => {\n subscriber.complete();\n this.finishRequestSubscription(sub);\n },\n );\n });\n\n // start the queue if previously empty\n if (this.queue.length === 1) {\n this.queue[0]();\n }\n }\n\n private finishRequestSubscription(requestSubscription: Subscription): void {\n requestSubscription.unsubscribe();\n\n // process queue\n this.queue.shift();\n this.queue[0]?.();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAKA,MAAM,gBAAgB,GAAG,CAAC,QAAsB,KAC9C,QAAQ,CAAC,WAAW,CAAC,MAAM,CAAC,GAAG,IAC7B,GAAG,CAAC,IAAI,KAAK,oBAAoB,CAClC,CAAC,GAAG,CAAC,GAAG,IACkB,GAAI,CAAC,IAAI,CAAC,KAAK,CACzC,CAAC;;AAEJ;;;;;;AAMA,MAAM,oBAAoB,GAAG,CAAC,GAAG,SAAyB,KACxD,SAAS,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,QAAQ,KAAK,GAAG,CAAC,MAAM,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;;AAElF;;;;;;;MAOa,2BAA2B,GAAG,CAAC,GAAG,SAAyB,KACtE,oBAAoB,CAAC,GAAG,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,KAAK,GAAG,CAAC,MAAM,CAAC,MAAM,IAAI,IAAI,CAAC,EAAE,EAAE;;AC3BzF;;;;;;MAMa,2BAA2B,GAAG,CAAC,GAAG,SAAyB,KACtE,SAAS,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,QAAQ,KAAK,GAAG,CAAC,MAAM,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,EAAE,EAAE;;ACIrF;;;;;;MASa,gBAAgB;IAG3B,YACU,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;QAHxB,UAAK,GAAmB,EAAE,CAAC;KAIvB;;;;;;;;;;IAWJ,MAAM,CAAqB,OAA8B;QACvD,OAAO,IAAI,UAAU,CAAC,UAAU,IAAI,IAAI,CAAC,iBAAiB,CAAC,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;KACtG;IAEO,iBAAiB,CAAC,UAA2B,EAAE,OAAwB;QAC7E,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;YACd,MAAM,GAAG,GAAG,OAAO,CAAC,SAAS,CAC3B,QAAQ;;gBAEN,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gBAC1B,UAAU,CAAC,QAAQ,EAAE,CAAC;gBAEtB,IAAI,CAAC,yBAAyB,CAAC,GAAG,CAAC,CAAC;aACrC,EACD,KAAK;gBACH,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;gBACxB,IAAI,CAAC,yBAAyB,CAAC,GAAG,CAAC,CAAC;aACrC,EACD;gBACE,UAAU,CAAC,QAAQ,EAAE,CAAC;gBACtB,IAAI,CAAC,yBAAyB,CAAC,GAAG,CAAC,CAAC;aACrC,CACF,CAAC;SACH,CAAC,CAAC;;QAGH,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;YAC3B,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;SACjB;KACF;IAEO,yBAAyB,CAAC,mBAAiC;;QACjE,mBAAmB,CAAC,WAAW,EAAE,CAAC;;QAGlC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;QACnB,MAAA,MAAA,IAAI,CAAC,KAAK,EAAC,CAAC,CAAC,mDAAK;KACnB;;;;YAxDF,UAAU,SAAC;gBACV,UAAU,EAAE,MAAM;aACnB;;;;YAhBQ,MAAM;;;ACLf;;;;;;"}
@@ -1,105 +1,49 @@
1
- import { Injectable, ɵɵdefineInjectable, ɵɵinject } from '@angular/core';
1
+ import { ɵɵdefineInjectable, ɵɵinject, Injectable } from '@angular/core';
2
2
  import { PRIMARY_OUTLET, UrlSerializer } from '@angular/router';
3
3
 
4
- /**
5
- * @fileoverview added by tsickle
6
- * Generated from: uri/truncation/file-extension.ts
7
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
8
- */
9
4
  /**
10
5
  * Truncates the file extension from the end of the URI.
11
6
  * Captures the truncated URI in the `uri` named group.
12
- * @type {?}
13
7
  */
14
8
  const DAFF_TRUNCATE_FILE_EXTENSION_REGEX = /(.*)(?=\.)/;
15
9
  /**
16
10
  * Truncates the file extension from the end of the URI.
17
- * @type {?}
18
- */
19
- const daffUriTruncateFileExtension = (/**
20
- * @param {?} uri
21
- * @return {?}
22
11
  */
23
- (uri) => { var _a; return ((_a = uri.match(DAFF_TRUNCATE_FILE_EXTENSION_REGEX)) === null || _a === void 0 ? void 0 : _a[0]) || uri; });
12
+ const daffUriTruncateFileExtension = (uri) => { var _a; return ((_a = uri.match(DAFF_TRUNCATE_FILE_EXTENSION_REGEX)) === null || _a === void 0 ? void 0 : _a[0]) || uri; };
24
13
 
25
- /**
26
- * @fileoverview added by tsickle
27
- * Generated from: uri/truncation/leading-path-segments.ts
28
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
29
- */
30
14
  /**
31
15
  * Truncates leading path segments from a URI.
32
16
  * e.g. /foo/bar/baz.html -> baz.html
33
- * @type {?}
34
17
  */
35
- const daffUriTruncateLeadingPathSegments = (/**
36
- * @param {?} uri
37
- * @return {?}
38
- */
39
- (uri) => uri.split('/').pop());
18
+ const daffUriTruncateLeadingPathSegments = (uri) => uri.split('/').pop();
40
19
 
41
- /**
42
- * @fileoverview added by tsickle
43
- * Generated from: uri/truncation/leading-slash.ts
44
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
45
- */
46
20
  /**
47
21
  * A regex to truncate the leading slash from a URI,
48
22
  * capturing the truncated in the `uri` group.
49
23
  * e.g. /foo/bar/baz.html -> foo/bar/baz.html
50
- * @type {?}
51
24
  */
52
25
  const DAFF_TRUNCATE_LEADING_SLASH_REGEX = /^\/?(?<uri>.+)$/;
53
26
  /**
54
27
  * Truncates the leading slash from a URI.
55
28
  * e.g. /foo/bar/baz.html -> foo/bar/baz.html
56
- * @type {?}
57
- */
58
- const daffUriTruncateLeadingSlash = (/**
59
- * @param {?} uri
60
- * @return {?}
61
29
  */
62
- (uri) => { var _a; return ((_a = uri.match(DAFF_TRUNCATE_LEADING_SLASH_REGEX)) === null || _a === void 0 ? void 0 : _a.groups.uri) || uri; });
30
+ const daffUriTruncateLeadingSlash = (uri) => { var _a; return ((_a = uri.match(DAFF_TRUNCATE_LEADING_SLASH_REGEX)) === null || _a === void 0 ? void 0 : _a.groups.uri) || uri; };
63
31
 
64
- /**
65
- * @fileoverview added by tsickle
66
- * Generated from: uri/truncation/query-fragment.ts
67
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
68
- */
69
32
  /**
70
33
  * Truncates query parameters and fragments from a URI.
71
34
  * e.g. /foo/bar/baz.html?thing=test#id -> /foo/bar/baz.html
72
- * @type {?}
73
35
  */
74
- const daffUriTruncateQueryFragment = (/**
75
- * @param {?} uri
76
- * @return {?}
77
- */
78
- (uri) => {
36
+ const daffUriTruncateQueryFragment = (uri) => {
79
37
  if (uri[0] !== '/') {
80
38
  uri = `/${uri}`;
81
39
  }
82
40
  return uri.replace(/(\?.*)|(#.*)/, '');
83
- });
84
-
85
- /**
86
- * @fileoverview added by tsickle
87
- * Generated from: uri/truncation/public_api.ts
88
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
89
- */
41
+ };
90
42
 
91
- /**
92
- * @fileoverview added by tsickle
93
- * Generated from: uri/normalizer.service.ts
94
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
95
- */
96
43
  /**
97
44
  * Processes URIs to remove extraneous Angular-specific information.
98
45
  */
99
46
  class DaffRoutingUriNormalizer {
100
- /**
101
- * @param {?} urlParser
102
- */
103
47
  constructor(urlParser) {
104
48
  this.urlParser = urlParser;
105
49
  }
@@ -110,12 +54,10 @@ class DaffRoutingUriNormalizer {
110
54
  * Optionally accepts an outlet to target.
111
55
  * e.g. `normalize('some/url.html(secondary:outlet)?query=param#fragment', 'secondary')` -> `'outlet?query=param#fragment'`
112
56
  *
113
- * @param {?} uri The URI to normalize.
114
- * @param {?=} outlet An optional outlet to process into a URI.
115
- * @return {?}
57
+ * @param uri The URI to normalize.
58
+ * @param outlet An optional outlet to process into a URI.
116
59
  */
117
60
  normalize(uri, outlet = PRIMARY_OUTLET) {
118
- /** @type {?} */
119
61
  const urlTree = this.urlParser.parse(uri);
120
62
  urlTree.root.children = {
121
63
  [PRIMARY_OUTLET]: urlTree.root.children[outlet],
@@ -123,6 +65,7 @@ class DaffRoutingUriNormalizer {
123
65
  return this.urlParser.serialize(urlTree);
124
66
  }
125
67
  }
68
+ /** @nocollapse */ DaffRoutingUriNormalizer.ɵprov = ɵɵdefineInjectable({ factory: function DaffRoutingUriNormalizer_Factory() { return new DaffRoutingUriNormalizer(ɵɵinject(UrlSerializer)); }, token: DaffRoutingUriNormalizer, providedIn: "root" });
126
69
  DaffRoutingUriNormalizer.decorators = [
127
70
  { type: Injectable, args: [{
128
71
  providedIn: 'root',
@@ -132,37 +75,9 @@ DaffRoutingUriNormalizer.decorators = [
132
75
  DaffRoutingUriNormalizer.ctorParameters = () => [
133
76
  { type: UrlSerializer }
134
77
  ];
135
- /** @nocollapse */ DaffRoutingUriNormalizer.ɵprov = ɵɵdefineInjectable({ factory: function DaffRoutingUriNormalizer_Factory() { return new DaffRoutingUriNormalizer(ɵɵinject(UrlSerializer)); }, token: DaffRoutingUriNormalizer, providedIn: "root" });
136
- if (false) {
137
- /**
138
- * @type {?}
139
- * @private
140
- */
141
- DaffRoutingUriNormalizer.prototype.urlParser;
142
- }
143
-
144
- /**
145
- * @fileoverview added by tsickle
146
- * Generated from: uri/public_api.ts
147
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
148
- */
149
-
150
- /**
151
- * @fileoverview added by tsickle
152
- * Generated from: public_api.ts
153
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
154
- */
155
-
156
- /**
157
- * @fileoverview added by tsickle
158
- * Generated from: index.ts
159
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
160
- */
161
78
 
162
79
  /**
163
- * @fileoverview added by tsickle
164
- * Generated from: daffodil-core-routing.ts
165
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
80
+ * Generated bundle index. Do not edit.
166
81
  */
167
82
 
168
83
  export { DAFF_TRUNCATE_FILE_EXTENSION_REGEX, DAFF_TRUNCATE_LEADING_SLASH_REGEX, DaffRoutingUriNormalizer, daffUriTruncateFileExtension, daffUriTruncateLeadingPathSegments, daffUriTruncateLeadingSlash, daffUriTruncateQueryFragment };
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-core-routing.js","sources":["../../../libs/core/routing/src/uri/truncation/file-extension.ts","../../../libs/core/routing/src/uri/truncation/leading-path-segments.ts","../../../libs/core/routing/src/uri/truncation/leading-slash.ts","../../../libs/core/routing/src/uri/truncation/query-fragment.ts","../../../libs/core/routing/src/uri/normalizer.service.ts"],"sourcesContent":["/**\n * Truncates the file extension from the end of the URI.\n * Captures the truncated URI in the `uri` named group.\n */\nexport const DAFF_TRUNCATE_FILE_EXTENSION_REGEX = /(.*)(?=\\.)/;\n/**\n * Truncates the file extension from the end of the URI.\n */\nexport const daffUriTruncateFileExtension = (uri: string): string => uri.match(DAFF_TRUNCATE_FILE_EXTENSION_REGEX)?.[0] || uri;\n","/**\n * Truncates leading path segments from a URI.\n * e.g. /foo/bar/baz.html -> baz.html\n */\nexport const daffUriTruncateLeadingPathSegments = (uri: string): string =>\n uri.split('/').pop();\n","/**\n * A regex to truncate the leading slash from a URI,\n * capturing the truncated in the `uri` group.\n * e.g. /foo/bar/baz.html -> foo/bar/baz.html\n */\nexport const DAFF_TRUNCATE_LEADING_SLASH_REGEX = /^\\/?(?<uri>.+)$/;\n/**\n * Truncates the leading slash from a URI.\n * e.g. /foo/bar/baz.html -> foo/bar/baz.html\n */\nexport const daffUriTruncateLeadingSlash = (uri: string): string =>\n uri.match(DAFF_TRUNCATE_LEADING_SLASH_REGEX)?.groups.uri || uri;\n","/**\n * Truncates query parameters and fragments from a URI.\n * e.g. /foo/bar/baz.html?thing=test#id -> /foo/bar/baz.html\n */\nexport const daffUriTruncateQueryFragment = (uri: string): string => {\n if(uri[0] !== '/') {\n uri = `/${uri}`;\n }\n return uri.replace(/(\\?.*)|(#.*)/, '');\n};\n","import { Injectable } from '@angular/core';\nimport {\n UrlSerializer,\n UrlTree,\n PRIMARY_OUTLET,\n} from '@angular/router';\n\n/**\n * Processes URIs to remove extraneous Angular-specific information.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffRoutingUriNormalizer {\n constructor(\n private urlParser: UrlSerializer,\n ) {}\n\n /**\n * Normalizes an Angular router path into a useable URI.\n * e.g. `normalize('some/url.html(secondary:outlet)?query=param#fragment')` -> `'some/url.html?query=param#fragment'`\n *\n * Optionally accepts an outlet to target.\n * e.g. `normalize('some/url.html(secondary:outlet)?query=param#fragment', 'secondary')` -> `'outlet?query=param#fragment'`\n *\n * @param uri The URI to normalize.\n * @param outlet An optional outlet to process into a URI.\n */\n normalize(uri: string, outlet = PRIMARY_OUTLET): string {\n const urlTree: UrlTree = this.urlParser.parse(uri);\n urlTree.root.children = {\n [PRIMARY_OUTLET]: urlTree.root.children[outlet],\n };\n\n return this.urlParser.serialize(urlTree);\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;MAIa,kCAAkC,GAAG;;;;;MAIrC,4BAA4B;;;;AAAG,CAAC,GAAW,eAAa,OAAA,OAAA,GAAG,CAAC,KAAK,CAAC,kCAAkC,CAAC,0CAAG,CAAC,MAAK,GAAG,CAAA,EAAA;;;;;;;;;;;;MCJjH,kCAAkC;;;;AAAG,CAAC,GAAW,KAC5D,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE;;;;;;;;;;;;;MCAT,iCAAiC,GAAG;;;;;;MAKpC,2BAA2B;;;;AAAG,CAAC,GAAW,eACrD,OAAA,OAAA,GAAG,CAAC,KAAK,CAAC,iCAAiC,CAAC,0CAAE,MAAM,CAAC,GAAG,KAAI,GAAG,CAAA,EAAA;;;;;;;;;;;;MCPpD,4BAA4B;;;;AAAG,CAAC,GAAW;IACtD,IAAG,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;QACjB,GAAG,GAAG,IAAI,GAAG,EAAE,CAAC;KACjB;IACD,OAAO,GAAG,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC;AACzC,CAAC;;;;;;;;;;;;;;;;MCIY,wBAAwB;;;;IACnC,YACU,SAAwB;QAAxB,cAAS,GAAT,SAAS,CAAe;KAC9B;;;;;;;;;;;;IAYJ,SAAS,CAAC,GAAW,EAAE,MAAM,GAAG,cAAc;;cACtC,OAAO,GAAY,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC;QAClD,OAAO,CAAC,IAAI,CAAC,QAAQ,GAAG;YACtB,CAAC,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;SAChD,CAAC;QAEF,OAAO,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;KAC1C;;;YAzBF,UAAU,SAAC;gBACV,UAAU,EAAE,MAAM;aACnB;;;;YAVC,aAAa;;;;;;;;IAaX,6CAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"daffodil-core-routing.js","sources":["../../../libs/core/routing/src/uri/truncation/file-extension.ts","../../../libs/core/routing/src/uri/truncation/leading-path-segments.ts","../../../libs/core/routing/src/uri/truncation/leading-slash.ts","../../../libs/core/routing/src/uri/truncation/query-fragment.ts","../../../libs/core/routing/src/uri/normalizer.service.ts","../../../libs/core/routing/src/daffodil-core-routing.ts"],"sourcesContent":["/**\n * Truncates the file extension from the end of the URI.\n * Captures the truncated URI in the `uri` named group.\n */\nexport const DAFF_TRUNCATE_FILE_EXTENSION_REGEX = /(.*)(?=\\.)/;\n/**\n * Truncates the file extension from the end of the URI.\n */\nexport const daffUriTruncateFileExtension = (uri: string): string => uri.match(DAFF_TRUNCATE_FILE_EXTENSION_REGEX)?.[0] || uri;\n","/**\n * Truncates leading path segments from a URI.\n * e.g. /foo/bar/baz.html -> baz.html\n */\nexport const daffUriTruncateLeadingPathSegments = (uri: string): string =>\n uri.split('/').pop();\n","/**\n * A regex to truncate the leading slash from a URI,\n * capturing the truncated in the `uri` group.\n * e.g. /foo/bar/baz.html -> foo/bar/baz.html\n */\nexport const DAFF_TRUNCATE_LEADING_SLASH_REGEX = /^\\/?(?<uri>.+)$/;\n/**\n * Truncates the leading slash from a URI.\n * e.g. /foo/bar/baz.html -> foo/bar/baz.html\n */\nexport const daffUriTruncateLeadingSlash = (uri: string): string =>\n uri.match(DAFF_TRUNCATE_LEADING_SLASH_REGEX)?.groups.uri || uri;\n","/**\n * Truncates query parameters and fragments from a URI.\n * e.g. /foo/bar/baz.html?thing=test#id -> /foo/bar/baz.html\n */\nexport const daffUriTruncateQueryFragment = (uri: string): string => {\n if(uri[0] !== '/') {\n uri = `/${uri}`;\n }\n return uri.replace(/(\\?.*)|(#.*)/, '');\n};\n","import { Injectable } from '@angular/core';\nimport {\n UrlSerializer,\n UrlTree,\n PRIMARY_OUTLET,\n} from '@angular/router';\n\n/**\n * Processes URIs to remove extraneous Angular-specific information.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffRoutingUriNormalizer {\n constructor(\n private urlParser: UrlSerializer,\n ) {}\n\n /**\n * Normalizes an Angular router path into a useable URI.\n * e.g. `normalize('some/url.html(secondary:outlet)?query=param#fragment')` -> `'some/url.html?query=param#fragment'`\n *\n * Optionally accepts an outlet to target.\n * e.g. `normalize('some/url.html(secondary:outlet)?query=param#fragment', 'secondary')` -> `'outlet?query=param#fragment'`\n *\n * @param uri The URI to normalize.\n * @param outlet An optional outlet to process into a URI.\n */\n normalize(uri: string, outlet = PRIMARY_OUTLET): string {\n const urlTree: UrlTree = this.urlParser.parse(uri);\n urlTree.root.children = {\n [PRIMARY_OUTLET]: urlTree.root.children[outlet],\n };\n\n return this.urlParser.serialize(urlTree);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAAA;;;;MAIa,kCAAkC,GAAG,aAAa;AAC/D;;;MAGa,4BAA4B,GAAG,CAAC,GAAW,eAAa,OAAA,OAAA,GAAG,CAAC,KAAK,CAAC,kCAAkC,CAAC,0CAAG,CAAC,MAAK,GAAG,CAAA;;ACR9H;;;;MAIa,kCAAkC,GAAG,CAAC,GAAW,KAC5D,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG;;ACLpB;;;;;MAKa,iCAAiC,GAAG,kBAAkB;AACnE;;;;MAIa,2BAA2B,GAAG,CAAC,GAAW,eACrD,OAAA,OAAA,GAAG,CAAC,KAAK,CAAC,iCAAiC,CAAC,0CAAE,MAAM,CAAC,GAAG,KAAI,GAAG,CAAA;;ACXjE;;;;MAIa,4BAA4B,GAAG,CAAC,GAAW;IACtD,IAAG,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;QACjB,GAAG,GAAG,IAAI,GAAG,EAAE,CAAC;KACjB;IACD,OAAO,GAAG,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC;AACzC;;ACFA;;;MAMa,wBAAwB;IACnC,YACU,SAAwB;QAAxB,cAAS,GAAT,SAAS,CAAe;KAC9B;;;;;;;;;;;IAYJ,SAAS,CAAC,GAAW,EAAE,MAAM,GAAG,cAAc;QAC5C,MAAM,OAAO,GAAY,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACnD,OAAO,CAAC,IAAI,CAAC,QAAQ,GAAG;YACtB,CAAC,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;SAChD,CAAC;QAEF,OAAO,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;KAC1C;;;;YAzBF,UAAU,SAAC;gBACV,UAAU,EAAE,MAAM;aACnB;;;;YAVC,aAAa;;;ACFf;;;;;;"}