@daffodil/core 0.92.3 → 0.93.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/daffodil-core-external-script-testing.mjs +3 -3
- package/fesm2022/daffodil-core-external-script-testing.mjs.map +1 -1
- package/fesm2022/daffodil-core-external-script.mjs +3 -3
- package/fesm2022/daffodil-core-external-script.mjs.map +1 -1
- package/fesm2022/daffodil-core-graphql.mjs +19 -8
- package/fesm2022/daffodil-core-graphql.mjs.map +1 -1
- package/fesm2022/daffodil-core-routing.mjs +3 -3
- package/fesm2022/daffodil-core-routing.mjs.map +1 -1
- package/fesm2022/daffodil-core-state-testing.mjs +6 -6
- package/fesm2022/daffodil-core-state-testing.mjs.map +1 -1
- package/fesm2022/daffodil-core-testing.mjs +67 -67
- package/fesm2022/daffodil-core-testing.mjs.map +1 -1
- package/fesm2022/daffodil-core.mjs +19 -19
- package/fesm2022/daffodil-core.mjs.map +1 -1
- package/package.json +1 -1
- package/{graphql/index.d.ts → types/daffodil-core-graphql.d.ts} +16 -10
- package/{state/index.d.ts → types/daffodil-core-state.d.ts} +3 -3
- /package/{external-script/testing/index.d.ts → types/daffodil-core-external-script-testing.d.ts} +0 -0
- /package/{external-script/index.d.ts → types/daffodil-core-external-script.d.ts} +0 -0
- /package/{routing/index.d.ts → types/daffodil-core-routing.d.ts} +0 -0
- /package/{state/testing/index.d.ts → types/daffodil-core-state-testing.d.ts} +0 -0
- /package/{testing/index.d.ts → types/daffodil-core-testing.d.ts} +0 -0
- /package/{index.d.ts → types/daffodil-core.d.ts} +0 -0
|
@@ -39,10 +39,10 @@ class DaffExternalScriptTestingService {
|
|
|
39
39
|
return throwError(() => new Error(`Failed to load ${script.src}`));
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
43
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
42
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffExternalScriptTestingService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
43
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffExternalScriptTestingService, providedIn: 'root' }); }
|
|
44
44
|
}
|
|
45
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
45
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffExternalScriptTestingService, decorators: [{
|
|
46
46
|
type: Injectable,
|
|
47
47
|
args: [{
|
|
48
48
|
providedIn: 'root',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-core-external-script-testing.mjs","sources":["../../../libs/core/external-script/testing/src/external-script.service.ts","../../../libs/core/external-script/testing/src/daffodil-core-external-script-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport {\n Observable,\n of,\n throwError,\n} from 'rxjs';\n\nimport {\n DaffExternalScriptServiceInterface ,\n DaffExternalScript,\n} from '@daffodil/core/external-script';\n\nimport { TestScripts } from './constants';\n\n/**\n * A service for loading external scripts into the document.\n *\n * @example Loading an external script into the document\n *\n * ```ts\n * import { DaffExternalScriptTestingService } from '@daffodil/core/external-script/testing';\n *\n * const externalScriptService = new DaffExternalScriptTestingService();\n *\n * externalScriptService.load(TestScripts.SUCCESS, {\n * src: 'https://example.com/script.js',\n * async: true,\n * defer: false,\n * 'data-custom-attribute': 'value',\n * }).subscribe({\n * next: (result) => {\n * console.log('Script loaded successfully:', result);\n * },\n * error: (error) => {\n * console.error('Error loading script:', error);\n * },\n * });\n * ```\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffExternalScriptTestingService implements DaffExternalScriptServiceInterface {\n\n /**\n * @inheritdoc\n */\n load(name: string, script: DaffExternalScript): Observable<boolean> {\n switch(name) {\n case TestScripts.SUCCESS:\n return of(true);\n default:\n return throwError(() => new Error(`Failed to load ${ script.src }`));\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAcA;;;;;;;;;;;;;;;;;;;;;;;;AAwBG;MAIU,gCAAgC,CAAA;AAE3C;;AAEG;IACH,IAAI,CAAC,IAAY,EAAE,MAA0B,EAAA;QAC3C,QAAO,IAAI;AACT,YAAA,KAAA,GAAA;AACE,gBAAA,OAAO,EAAE,CAAC,IAAI,CAAC;AACjB,YAAA;AACE,gBAAA,OAAO,UAAU,CAAC,MAAM,IAAI,KAAK,CAAC,CAAA,eAAA,EAAmB,MAAM,CAAC,GAAI,CAAA,CAAE,CAAC,CAAC;;IAE1E;
|
|
1
|
+
{"version":3,"file":"daffodil-core-external-script-testing.mjs","sources":["../../../libs/core/external-script/testing/src/external-script.service.ts","../../../libs/core/external-script/testing/src/daffodil-core-external-script-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport {\n Observable,\n of,\n throwError,\n} from 'rxjs';\n\nimport {\n DaffExternalScriptServiceInterface ,\n DaffExternalScript,\n} from '@daffodil/core/external-script';\n\nimport { TestScripts } from './constants';\n\n/**\n * A service for loading external scripts into the document.\n *\n * @example Loading an external script into the document\n *\n * ```ts\n * import { DaffExternalScriptTestingService } from '@daffodil/core/external-script/testing';\n *\n * const externalScriptService = new DaffExternalScriptTestingService();\n *\n * externalScriptService.load(TestScripts.SUCCESS, {\n * src: 'https://example.com/script.js',\n * async: true,\n * defer: false,\n * 'data-custom-attribute': 'value',\n * }).subscribe({\n * next: (result) => {\n * console.log('Script loaded successfully:', result);\n * },\n * error: (error) => {\n * console.error('Error loading script:', error);\n * },\n * });\n * ```\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffExternalScriptTestingService implements DaffExternalScriptServiceInterface {\n\n /**\n * @inheritdoc\n */\n load(name: string, script: DaffExternalScript): Observable<boolean> {\n switch(name) {\n case TestScripts.SUCCESS:\n return of(true);\n default:\n return throwError(() => new Error(`Failed to load ${ script.src }`));\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAcA;;;;;;;;;;;;;;;;;;;;;;;;AAwBG;MAIU,gCAAgC,CAAA;AAE3C;;AAEG;IACH,IAAI,CAAC,IAAY,EAAE,MAA0B,EAAA;QAC3C,QAAO,IAAI;AACT,YAAA,KAAA,GAAA;AACE,gBAAA,OAAO,EAAE,CAAC,IAAI,CAAC;AACjB,YAAA;AACE,gBAAA,OAAO,UAAU,CAAC,MAAM,IAAI,KAAK,CAAC,CAAA,eAAA,EAAmB,MAAM,CAAC,GAAI,CAAA,CAAE,CAAC,CAAC;;IAE1E;iIAZW,gCAAgC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAhC,uBAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gCAAgC,cAF/B,MAAM,EAAA,CAAA,CAAA;;2FAEP,gCAAgC,EAAA,UAAA,EAAA,CAAA;kBAH5C,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACzCD;;AAEG;;;;"}
|
|
@@ -75,10 +75,10 @@ class DaffExternalScriptService {
|
|
|
75
75
|
this.scriptMap.set(name, { ...script, ready: undefined, subject: readySubject, el: scriptEl });
|
|
76
76
|
return readySubject.pipe(filter((s) => s !== undefined));
|
|
77
77
|
}
|
|
78
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
79
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
78
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffExternalScriptService, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
79
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffExternalScriptService, providedIn: 'root' }); }
|
|
80
80
|
}
|
|
81
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
81
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffExternalScriptService, decorators: [{
|
|
82
82
|
type: Injectable,
|
|
83
83
|
args: [{
|
|
84
84
|
providedIn: 'root',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-core-external-script.mjs","sources":["../../../libs/core/external-script/src/external-script.service.ts","../../../libs/core/external-script/src/daffodil-core-external-script.ts"],"sourcesContent":["\nimport {\n Inject,\n Injectable,\n DOCUMENT,\n} from '@angular/core';\nimport {\n BehaviorSubject,\n Observable,\n} from 'rxjs';\nimport { filter } from 'rxjs/operators';\n\nimport { DaffExternalScriptServiceInterface } from './interface';\nimport { DaffExternalScript } from './script';\n\nexport interface LoadedExternalScript extends DaffExternalScript {\n ready: boolean | undefined;\n subject: Observable<boolean>;\n el: HTMLElement | undefined;\n}\n\n/**\n * A service for loading external scripts into the document.\n *\n * ### Usage example\n *\n * @example Loading an external script into the document\n *\n * ```ts\n * import { DOCUMENT } from '@angular/common';\n * import { inject } from '@angular/core';\n *\n * import { DaffExternalScriptService } from '@daffodil/core/external-script';\n *\n * const externalScriptService = new DaffExternalScriptService(inject(DOCUMENT));\n *\n * externalScriptService.load('exampleScript', {\n * src: 'https://example.com/script.js',\n * async: true,\n * defer: false,\n * 'data-custom-attribute': 'value',\n * }).subscribe({\n * next: (result) => {\n * console.log('Script loaded successfully:', result);\n * },\n * error: (error) => {\n * console.error('Error loading script:', error);\n * },\n * });\n * ```\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffExternalScriptService implements DaffExternalScriptServiceInterface {\n readonly scriptMap: Map<string, LoadedExternalScript> = new Map();\n private doc: Document;\n\n constructor(\n @Inject(DOCUMENT) doc,\n ) {\n this.doc = doc;\n }\n\n /**\n * @inheritdoc\n */\n load(name: string, script: DaffExternalScript): Observable<boolean> {\n // Don't load the same script twice.\n if(this.scriptMap.has(name)){\n return this.scriptMap.get(name).subject;\n }\n\n const scriptEl = this.doc.createElement('script');\n\n scriptEl.setAttribute('type', 'text/javascript');\n\n scriptEl.setAttribute('src', script.src);\n\n scriptEl.setAttribute('charset', 'utf-8');\n\n // Set custom attributes prefixed with 'data-'.\n Object.keys(script).filter(key => key.startsWith('data-')).map((key) => {\n // setAttribute would lowercase the value of \"key\", which isn't always correct.\n // setAttributeNS maintains key casing.\n scriptEl.setAttributeNS(null, key,script[key]);\n });\n\n if(script.async) {\n scriptEl.async = true;\n }\n\n if(script.defer) {\n scriptEl.defer = true;\n }\n\n const readySubject = new BehaviorSubject<boolean | undefined>(undefined);\n\n scriptEl.onload = () => {\n this.scriptMap.get(name).ready = true;\n readySubject.next(true);\n };\n\n scriptEl.onerror = () => {\n this.scriptMap.get(name).ready = false;\n readySubject.error(new Error(`Failed to load ${ script.src }`));\n };\n\n this.doc.body.appendChild(scriptEl);\n this.scriptMap.set(name, { ...script, ready: undefined, subject: readySubject, el: scriptEl });\n\n return readySubject.pipe(\n filter((s) => s !== undefined),\n );\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAqBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BG;MAIU,yBAAyB,CAAA;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KAAK,GAAG,IAAI;AACrC,YAAA,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC;AACzB,QAAA,CAAC;AAED,QAAA,QAAQ,CAAC,OAAO,GAAG,MAAK;YACtB,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,KAAK,GAAG,KAAK;AACtC,YAAA,YAAY,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,CAAA,eAAA,EAAmB,MAAM,CAAC,GAAI,CAAA,CAAE,CAAC,CAAC;AACjE,QAAA,CAAC;QAED,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC;QACnC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,GAAG,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC;AAE9F,QAAA,OAAO,YAAY,CAAC,IAAI,CACtB,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,SAAS,CAAC,CAC/B;IACH;AA5DW,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,kBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,
|
|
1
|
+
{"version":3,"file":"daffodil-core-external-script.mjs","sources":["../../../libs/core/external-script/src/external-script.service.ts","../../../libs/core/external-script/src/daffodil-core-external-script.ts"],"sourcesContent":["\nimport {\n Inject,\n Injectable,\n DOCUMENT,\n} from '@angular/core';\nimport {\n BehaviorSubject,\n Observable,\n} from 'rxjs';\nimport { filter } from 'rxjs/operators';\n\nimport { DaffExternalScriptServiceInterface } from './interface';\nimport { DaffExternalScript } from './script';\n\nexport interface LoadedExternalScript extends DaffExternalScript {\n ready: boolean | undefined;\n subject: Observable<boolean>;\n el: HTMLElement | undefined;\n}\n\n/**\n * A service for loading external scripts into the document.\n *\n * ### Usage example\n *\n * @example Loading an external script into the document\n *\n * ```ts\n * import { DOCUMENT } from '@angular/common';\n * import { inject } from '@angular/core';\n *\n * import { DaffExternalScriptService } from '@daffodil/core/external-script';\n *\n * const externalScriptService = new DaffExternalScriptService(inject(DOCUMENT));\n *\n * externalScriptService.load('exampleScript', {\n * src: 'https://example.com/script.js',\n * async: true,\n * defer: false,\n * 'data-custom-attribute': 'value',\n * }).subscribe({\n * next: (result) => {\n * console.log('Script loaded successfully:', result);\n * },\n * error: (error) => {\n * console.error('Error loading script:', error);\n * },\n * });\n * ```\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffExternalScriptService implements DaffExternalScriptServiceInterface {\n readonly scriptMap: Map<string, LoadedExternalScript> = new Map();\n private doc: Document;\n\n constructor(\n @Inject(DOCUMENT) doc,\n ) {\n this.doc = doc;\n }\n\n /**\n * @inheritdoc\n */\n load(name: string, script: DaffExternalScript): Observable<boolean> {\n // Don't load the same script twice.\n if(this.scriptMap.has(name)){\n return this.scriptMap.get(name).subject;\n }\n\n const scriptEl = this.doc.createElement('script');\n\n scriptEl.setAttribute('type', 'text/javascript');\n\n scriptEl.setAttribute('src', script.src);\n\n scriptEl.setAttribute('charset', 'utf-8');\n\n // Set custom attributes prefixed with 'data-'.\n Object.keys(script).filter(key => key.startsWith('data-')).map((key) => {\n // setAttribute would lowercase the value of \"key\", which isn't always correct.\n // setAttributeNS maintains key casing.\n scriptEl.setAttributeNS(null, key,script[key]);\n });\n\n if(script.async) {\n scriptEl.async = true;\n }\n\n if(script.defer) {\n scriptEl.defer = true;\n }\n\n const readySubject = new BehaviorSubject<boolean | undefined>(undefined);\n\n scriptEl.onload = () => {\n this.scriptMap.get(name).ready = true;\n readySubject.next(true);\n };\n\n scriptEl.onerror = () => {\n this.scriptMap.get(name).ready = false;\n readySubject.error(new Error(`Failed to load ${ script.src }`));\n };\n\n this.doc.body.appendChild(scriptEl);\n this.scriptMap.set(name, { ...script, ready: undefined, subject: readySubject, el: scriptEl });\n\n return readySubject.pipe(\n filter((s) => s !== undefined),\n );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,yBAAyB,cAFxB,MAAM,EAAA,CAAA,CAAA;;2FAEP,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBAHrC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;0BAMI,MAAM;2BAAC,QAAQ;;;AC3DpB;;AAEG;;;;"}
|
|
@@ -3,6 +3,7 @@ import * as i0 from '@angular/core';
|
|
|
3
3
|
import { Injectable, makeEnvironmentProviders, inject, Injector, runInInjectionContext } from '@angular/core';
|
|
4
4
|
import * as i1 from 'apollo-angular';
|
|
5
5
|
import { Observable } from 'rxjs';
|
|
6
|
+
import { HttpHeaders } from '@angular/common/http';
|
|
6
7
|
|
|
7
8
|
const getFragmentNames = (fragment) => fragment.definitions.filter(def => def.kind === 'FragmentDefinition').map(def => def.name.value);
|
|
8
9
|
/**
|
|
@@ -89,10 +90,10 @@ class DaffQueuedApollo {
|
|
|
89
90
|
this.queue.shift();
|
|
90
91
|
this.queue[0]?.();
|
|
91
92
|
}
|
|
92
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
93
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
93
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffQueuedApollo, deps: [{ token: i1.Apollo }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
94
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffQueuedApollo, providedIn: 'root' }); }
|
|
94
95
|
}
|
|
95
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
96
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffQueuedApollo, decorators: [{
|
|
96
97
|
type: Injectable,
|
|
97
98
|
args: [{
|
|
98
99
|
providedIn: 'root',
|
|
@@ -113,6 +114,10 @@ provider: provideDaffApolloRequestHandlers,
|
|
|
113
114
|
*/
|
|
114
115
|
factoryProvider: provideDaffApolloRequestHandlerFactories, } = createMultiInjectionToken('DAFF_APOLLO_REQUEST_HANDLERS');
|
|
115
116
|
|
|
117
|
+
function getApolloOperationHeaders(operation) {
|
|
118
|
+
return operation.getContext().headers || new HttpHeaders();
|
|
119
|
+
}
|
|
120
|
+
|
|
116
121
|
/**
|
|
117
122
|
* Provider function for {@link DaffApolloHeaderProvider}s.
|
|
118
123
|
*/
|
|
@@ -121,10 +126,16 @@ const provideDaffApolloHeaderProviders = (...providers) => makeEnvironmentProvid
|
|
|
121
126
|
const injector = inject(Injector);
|
|
122
127
|
return (operation, forward) => {
|
|
123
128
|
operation.setContext({
|
|
124
|
-
headers: providers.reduce((acc, provider) =>
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
129
|
+
headers: providers.reduce((acc, provider) => {
|
|
130
|
+
const headers = runInInjectionContext(injector, provider);
|
|
131
|
+
headers.keys().forEach((key) => {
|
|
132
|
+
const val = headers.getAll(key);
|
|
133
|
+
if (val) {
|
|
134
|
+
acc.append(key, val);
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
return acc;
|
|
138
|
+
}, getApolloOperationHeaders(operation)),
|
|
128
139
|
});
|
|
129
140
|
return forward(operation);
|
|
130
141
|
};
|
|
@@ -135,5 +146,5 @@ const provideDaffApolloHeaderProviders = (...providers) => makeEnvironmentProvid
|
|
|
135
146
|
* Generated bundle index. Do not edit.
|
|
136
147
|
*/
|
|
137
148
|
|
|
138
|
-
export { DAFF_APOLLO_REQUEST_HANDLERS, DaffQueuedApollo, daffBuildFragmentDefinition, daffBuildFragmentNameSpread, provideDaffApolloHeaderProviders, provideDaffApolloRequestHandlerFactories, provideDaffApolloRequestHandlers };
|
|
149
|
+
export { DAFF_APOLLO_REQUEST_HANDLERS, DaffQueuedApollo, daffBuildFragmentDefinition, daffBuildFragmentNameSpread, getApolloOperationHeaders, provideDaffApolloHeaderProviders, provideDaffApolloRequestHandlerFactories, provideDaffApolloRequestHandlers };
|
|
139
150
|
//# sourceMappingURL=daffodil-core-graphql.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-core-graphql.mjs","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/apollo/request-handler.provider.ts","../../../libs/core/graphql/src/apollo/header/provider.ts","../../../libs/core/graphql/src/daffodil-core-graphql.ts"],"sourcesContent":["import {\n DocumentNode,\n FragmentDefinitionNode,\n} from 'graphql';\n\nimport { unique } from '@daffodil/core';\n\nexport const 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 the first fragment name 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) => {\n const names = getFragmentNames(fragment);\n if (names[0]) {\n acc.push(names[0]);\n }\n return acc;\n }, []);\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 * Only the first fragment name from each passed fragment is returned.\n *\n * @param fragments A list of GraphQL documents that contain fragments.\n */\nexport const daffBuildFragmentNameSpread = (...fragments: DocumentNode[]): string =>\n unique(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 {\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 = Record<string, any>>(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 next: response => {\n // emit the outer observable\n subscriber.next(response);\n subscriber.complete();\n\n this.finishRequestSubscription(sub);\n },\n error: error => {\n subscriber.error(error);\n this.finishRequestSubscription(sub);\n },\n complete: () => {\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","import { RequestHandler } from '@apollo/client/core';\n\nimport { createMultiInjectionToken } from '@daffodil/core';\n\nexport const {\n /**\n * Apollo request handlers. Allow custom logic to be injected into the apollo link chain.\n */\n token: DAFF_APOLLO_REQUEST_HANDLERS,\n /**\n * Provider for {@link DAFF_APOLLO_REQUEST_HANDLERS}.\n */\n provider: provideDaffApolloRequestHandlers,\n /**\n * Factory provider for {@link DAFF_APOLLO_REQUEST_HANDLERS}.\n */\n factoryProvider: provideDaffApolloRequestHandlerFactories,\n} = createMultiInjectionToken<RequestHandler>('DAFF_APOLLO_REQUEST_HANDLERS');\n","import {\n EnvironmentProviders,\n inject,\n Injector,\n makeEnvironmentProviders,\n runInInjectionContext,\n} from '@angular/core';\n\nimport { DaffApolloHeaderProvider } from './type';\nimport { provideDaffApolloRequestHandlerFactories } from '../request-handler.provider';\n\n/**\n * Provider function for {@link DaffApolloHeaderProvider}s.\n */\nexport const provideDaffApolloHeaderProviders = (...providers: Array<DaffApolloHeaderProvider>): EnvironmentProviders =>\n makeEnvironmentProviders([\n provideDaffApolloRequestHandlerFactories(() => {\n const injector = inject(Injector);\n return (operation, forward) => {\n operation.setContext({\n headers: providers.reduce((acc, provider) => ({\n ...acc,\n ...runInInjectionContext(injector, provider),\n }), operation.getContext().headers),\n });\n return forward(operation);\n };\n }),\n ]);\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAOO,MAAM,gBAAgB,GAAG,CAAC,QAAsB,KACrD,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;AAEH;;;;;AAKG;AACH,MAAM,oBAAoB,GAAG,CAAC,GAAG,SAAyB,KACxD,SAAS,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,QAAQ,KAAI;AACjC,IAAA,MAAM,KAAK,GAAG,gBAAgB,CAAC,QAAQ,CAAC;AACxC,IAAA,IAAI,KAAK,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,EAAE,4BAA4B;AACnC;;AAEG;AACH,QAAQ,EAAE,gCAAgC;AAC1C;;AAEG;AACH,eAAe,EAAE,wCAAwC,GAC1D,GAAG,yBAAyB,CAAiB,8BAA8B;;ACN5E;;AAEG;AACI,MAAM,gCAAgC,GAAG,CAAC,GAAG,SAA0C,KAC5F,wBAAwB,CAAC;IACvB,wCAAwC,CAAC,MAAK;AAC5C,QAAA,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AACjC,QAAA,OAAO,CAAC,SAAS,EAAE,OAAO,KAAI;YAC5B,SAAS,CAAC,UAAU,CAAC;AACnB,gBAAA,OAAO,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,QAAQ,MAAM;AAC5C,oBAAA,GAAG,GAAG;AACN,oBAAA,GAAG,qBAAqB,CAAC,QAAQ,EAAE,QAAQ,CAAC;AAC7C,iBAAA,CAAC,EAAE,SAAS,CAAC,UAAU,EAAE,CAAC,OAAO,CAAC;AACpC,aAAA,CAAC;AACF,YAAA,OAAO,OAAO,CAAC,SAAS,CAAC;AAC3B,QAAA,CAAC;AACH,IAAA,CAAC,CAAC;AACH,CAAA;;AC5BH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"daffodil-core-graphql.mjs","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/apollo/request-handler.provider.ts","../../../libs/core/graphql/src/apollo/header/get.ts","../../../libs/core/graphql/src/apollo/header/provider.ts","../../../libs/core/graphql/src/daffodil-core-graphql.ts"],"sourcesContent":["import {\n DocumentNode,\n FragmentDefinitionNode,\n} from 'graphql';\n\nimport { unique } from '@daffodil/core';\n\nexport const 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 the first fragment name 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) => {\n const names = getFragmentNames(fragment);\n if (names[0]) {\n acc.push(names[0]);\n }\n return acc;\n }, []);\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 * Only the first fragment name from each passed fragment is returned.\n *\n * @param fragments A list of GraphQL documents that contain fragments.\n */\nexport const daffBuildFragmentNameSpread = (...fragments: DocumentNode[]): string =>\n unique(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 { Apollo } from 'apollo-angular';\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 = Record<string, any>>(options: Apollo.MutateOptions<T, V>): Observable<Apollo.MutateResult<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 next: response => {\n // emit the outer observable\n subscriber.next(response);\n subscriber.complete();\n\n this.finishRequestSubscription(sub);\n },\n error: error => {\n subscriber.error(error);\n this.finishRequestSubscription(sub);\n },\n complete: () => {\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","import { ApolloLink } from '@apollo/client';\n\nimport { createMultiInjectionToken } from '@daffodil/core';\n\nexport const {\n /**\n * Apollo request handlers. Allow custom logic to be injected into the apollo link chain.\n */\n token: DAFF_APOLLO_REQUEST_HANDLERS,\n /**\n * Provider for {@link DAFF_APOLLO_REQUEST_HANDLERS}.\n */\n provider: provideDaffApolloRequestHandlers,\n /**\n * Factory provider for {@link DAFF_APOLLO_REQUEST_HANDLERS}.\n */\n factoryProvider: provideDaffApolloRequestHandlerFactories,\n} = createMultiInjectionToken<ApolloLink.RequestHandler>('DAFF_APOLLO_REQUEST_HANDLERS');\n","import { HttpHeaders } from '@angular/common/http';\nimport { ApolloLink } from '@apollo/client';\n\nexport function getApolloOperationHeaders(operation: ApolloLink.Operation): HttpHeaders {\n return operation.getContext().headers || new HttpHeaders();\n}\n","import {\n EnvironmentProviders,\n inject,\n Injector,\n makeEnvironmentProviders,\n runInInjectionContext,\n} from '@angular/core';\n\nimport { DaffApolloHeaderProvider } from './type';\nimport { provideDaffApolloRequestHandlerFactories } from '../request-handler.provider';\nimport { getApolloOperationHeaders } from './get';\n\n/**\n * Provider function for {@link DaffApolloHeaderProvider}s.\n */\nexport const provideDaffApolloHeaderProviders = (...providers: Array<DaffApolloHeaderProvider>): EnvironmentProviders =>\n makeEnvironmentProviders([\n provideDaffApolloRequestHandlerFactories(() => {\n const injector = inject(Injector);\n return (operation, forward) => {\n operation.setContext({\n headers: providers.reduce((acc, provider) => {\n const headers = runInInjectionContext(injector, provider);\n headers.keys().forEach((key) => {\n const val = headers.getAll(key);\n if (val) {\n acc.append(key, val);\n }\n });\n return acc;\n }, getApolloOperationHeaders(operation)),\n });\n return forward(operation);\n };\n }),\n ]);\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAOO,MAAM,gBAAgB,GAAG,CAAC,QAAsB,KACrD,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;AAEH;;;;;AAKG;AACH,MAAM,oBAAoB,GAAG,CAAC,GAAG,SAAyB,KACxD,SAAS,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,QAAQ,KAAI;AACjC,IAAA,MAAM,KAAK,GAAG,gBAAgB,CAAC,QAAQ,CAAC;AACxC,IAAA,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE;QACZ,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACpB;AACA,IAAA,OAAO,GAAG;AACZ,CAAC,EAAE,EAAE,CAAC;AAER;;;;;;;AAOG;AACI,MAAM,2BAA2B,GAAG,CAAC,GAAG,SAAyB,KACtE,MAAM,CAAC,oBAAoB,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,KAAK,GAAG,CAAC,MAAM,CAAC,MAAM,IAAI,CAAA,EAAA,CAAI,CAAC,EAAE,EAAE;;ACpCjG;;;;;AAKG;AACI,MAAM,2BAA2B,GAAG,CAAC,GAAG,SAAyB,KACtE,SAAS,CAAC,MAAM,CA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AAS,CAAC,UAAU,CAAC;gBACnB,OAAO,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,QAAQ,KAAI;oBAC1C,MAAM,OAAO,GAAG,qBAAqB,CAAC,QAAQ,EAAE,QAAQ,CAAC;oBACzD,OAAO,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,CAAC,GAAG,KAAI;wBAC7B,MAAM,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC;wBAC/B,IAAI,GAAG,EAAE;AACP,4BAAA,GAAG,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC;wBACtB;AACF,oBAAA,CAAC,CAAC;AACF,oBAAA,OAAO,GAAG;AACZ,gBAAA,CAAC,EAAE,yBAAyB,CAAC,SAAS,CAAC,CAAC;AACzC,aAAA,CAAC;AACF,YAAA,OAAO,OAAO,CAAC,SAAS,CAAC;AAC3B,QAAA,CAAC;AACH,IAAA,CAAC,CAAC;AACH,CAAA;;ACnCH;;AAEG;;;;"}
|
|
@@ -67,10 +67,10 @@ class DaffRoutingUriNormalizer {
|
|
|
67
67
|
};
|
|
68
68
|
return this.urlParser.serialize(urlTree);
|
|
69
69
|
}
|
|
70
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
71
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
70
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffRoutingUriNormalizer, deps: [{ token: i1.UrlSerializer }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
71
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffRoutingUriNormalizer, providedIn: 'root' }); }
|
|
72
72
|
}
|
|
73
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
73
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffRoutingUriNormalizer, decorators: [{
|
|
74
74
|
type: Injectable,
|
|
75
75
|
args: [{
|
|
76
76
|
providedIn: 'root',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-core-routing.mjs","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/query-param-filter/request-builder/equal.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","import {\n DaffFilterEqualRequest,\n DaffFilterType,\n} from '@daffodil/core';\n\nimport { DaffRoutingQueryParamFilterRequestBuilder } from './type';\n\n/**\n * A standard filter request builder that creates an equal filter request with the query params values.\n */\nexport const daffRoutingQueryParamFilterRequestEqualBuilder: DaffRoutingQueryParamFilterRequestBuilder<DaffFilterEqualRequest>\n = (filterName, qpValue) => ({\n type: DaffFilterType.Equal,\n name: filterName,\n value: qpValue,\n });\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAAA;;;AAGG;AACI,MAAM,kCAAkC,GAAG;AAClD;;AAEG;MACU,4BAA4B,GAAG,CAAC,GAAW,KAAa,GAAG,CAAC,KAAK,CAAC,kCAAkC,CAAC,GAAG,CAAC,CAAC,IAAI;;ACR3H;;;AAGG;AACI,MAAM,kCAAkC,GAAG,CAAC,GAAW,KAC5D,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG;;ACLpB;;;;AAIG;AACI,MAAM,iCAAiC,GAAG;AACjD;;;AAGG;MACU,2BAA2B,GAAG,CAAC,GAAW,KACrD,GAAG,CAAC,KAAK,CAAC,iCAAiC,CAAC,EAAE,MAAM,CAAC,GAAG,IAAI;;ACX9D;;;AAGG;AACI,MAAM,4BAA4B,GAAG,CAAC,GAAW,KAAY;AAClE,IAAA,IAAG,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;AACjB,QAAA,GAAG,GAAG,CAAA,CAAA,EAAI,GAAG,CAAA,CAAE;IACjB;IACA,OAAO,GAAG,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC;AACxC;;ACFA;;AAEG;MAIU,wBAAwB,CAAA;AACnC,IAAA,WAAA,CACU,SAAwB,EAAA;QAAxB,IAAA,CAAA,SAAS,GAAT,SAAS;IAChB;AAEH;;;;;;;;;AASG;AACH,IAAA,SAAS,CAAC,GAAW,EAAE,MAAM,GAAG,cAAc,EAAA;QAC5C,MAAM,OAAO,GAAY,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC;AAClD,QAAA,OAAO,CAAC,IAAI,CAAC,QAAQ,GAAG;YACtB,CAAC,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;SAChD;QAED,OAAO,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,OAAO,CAAC;IAC1C;
|
|
1
|
+
{"version":3,"file":"daffodil-core-routing.mjs","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/query-param-filter/request-builder/equal.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","import {\n DaffFilterEqualRequest,\n DaffFilterType,\n} from '@daffodil/core';\n\nimport { DaffRoutingQueryParamFilterRequestBuilder } from './type';\n\n/**\n * A standard filter request builder that creates an equal filter request with the query params values.\n */\nexport const daffRoutingQueryParamFilterRequestEqualBuilder: DaffRoutingQueryParamFilterRequestBuilder<DaffFilterEqualRequest>\n = (filterName, qpValue) => ({\n type: DaffFilterType.Equal,\n name: filterName,\n value: qpValue,\n });\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAAA;;;AAGG;AACI,MAAM,kCAAkC,GAAG;AAClD;;AAEG;MACU,4BAA4B,GAAG,CAAC,GAAW,KAAa,GAAG,CAAC,KAAK,CAAC,kCAAkC,CAAC,GAAG,CAAC,CAAC,IAAI;;ACR3H;;;AAGG;AACI,MAAM,kCAAkC,GAAG,CAAC,GAAW,KAC5D,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG;;ACLpB;;;;AAIG;AACI,MAAM,iCAAiC,GAAG;AACjD;;;AAGG;MACU,2BAA2B,GAAG,CAAC,GAAW,KACrD,GAAG,CAAC,KAAK,CAAC,iCAAiC,CAAC,EAAE,MAAM,CAAC,GAAG,IAAI;;ACX9D;;;AAGG;AACI,MAAM,4BAA4B,GAAG,CAAC,GAAW,KAAY;AAClE,IAAA,IAAG,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;AACjB,QAAA,GAAG,GAAG,CAAA,CAAA,EAAI,GAAG,CAAA,CAAE;IACjB;IACA,OAAO,GAAG,CAAC,O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
|
|
23
23
|
}
|
|
24
24
|
dispatch(action) { }
|
|
25
25
|
;
|
|
26
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
27
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
26
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MockDaffCollectionFacade, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
27
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MockDaffCollectionFacade, providedIn: 'root' }); }
|
|
28
28
|
}
|
|
29
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
29
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MockDaffCollectionFacade, decorators: [{
|
|
30
30
|
type: Injectable,
|
|
31
31
|
args: [{ providedIn: 'root' }]
|
|
32
32
|
}] });
|
|
@@ -47,10 +47,10 @@ class MockDaffOperationStateFacade {
|
|
|
47
47
|
}
|
|
48
48
|
dispatch(action) { }
|
|
49
49
|
;
|
|
50
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
51
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
50
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MockDaffOperationStateFacade, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
51
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MockDaffOperationStateFacade, providedIn: 'root' }); }
|
|
52
52
|
}
|
|
53
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
53
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MockDaffOperationStateFacade, decorators: [{
|
|
54
54
|
type: Injectable,
|
|
55
55
|
args: [{ providedIn: 'root' }]
|
|
56
56
|
}] });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-core-state-testing.mjs","sources":["../../../libs/core/state/testing/src/mock-collection-facade.ts","../../../libs/core/state/testing/src/mock-operation-facade.ts","../../../libs/core/state/testing/src/daffodil-core-state-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { Action } from '@ngrx/store';\nimport { BehaviorSubject } from 'rxjs';\n\nimport {\n DaffCollectionMetadata,\n DaffCollectionRequest,\n DaffFilters,\n DaffSortDirectionEnum,\n DaffSortOption,\n} from '@daffodil/core';\nimport { DaffCollectionFacadeInterface } from '@daffodil/core/state';\n\n/**\n * Can be used to mock out the {@link DaffCollectionFacade} in testing environments.\n *\n * @inheritdoc\n */\n@Injectable({ providedIn: 'root' })\nexport class MockDaffCollectionFacade implements DaffCollectionFacadeInterface {\n metadata$: BehaviorSubject<DaffCollectionMetadata> = new BehaviorSubject(null);\n request$: BehaviorSubject<DaffCollectionRequest> = new BehaviorSubject(null);\n count$: BehaviorSubject<number> = new BehaviorSubject(0);\n currentPage$: BehaviorSubject<number> = new BehaviorSubject(0);\n totalPages$: BehaviorSubject<number> = new BehaviorSubject(0);\n pageSize$: BehaviorSubject<number> = new BehaviorSubject(0);\n sortOptions$: BehaviorSubject<DaffSortOption[]> = new BehaviorSubject([]);\n appliedSortOption$: BehaviorSubject<string> = new BehaviorSubject(null);\n appliedSortDirection$: BehaviorSubject<DaffSortDirectionEnum> = new BehaviorSubject(null);\n filters$: BehaviorSubject<DaffFilters> = new BehaviorSubject({});\n appliedFilters$: BehaviorSubject<DaffFilters> = new BehaviorSubject({});\n\n dispatch(action: Action) {};\n}\n","import { Injectable } from '@angular/core';\nimport { Action } from '@ngrx/store';\nimport { BehaviorSubject } from 'rxjs';\n\nimport {\n DaffOperationStateFacadeInterface,\n DaffState,\n DaffStateError,\n} from '@daffodil/core/state';\n\n/**\n * Can be used to mock out the {@link DaffOperationStateFacade} in testing environments.\n *\n * @inheritdoc\n */\n@Injectable({ providedIn: 'root' })\nexport class MockDaffOperationStateFacade implements DaffOperationStateFacadeInterface {\n loadingState$ = new BehaviorSubject<DaffState>(DaffState.Stable);\n loading$ = new BehaviorSubject<boolean>(false);\n resolving$ = new BehaviorSubject<boolean>(false);\n mutating$ = new BehaviorSubject<boolean>(false);\n errors$ = new BehaviorSubject<DaffStateError[]>([]);\n hasErrors$ = new BehaviorSubject<boolean>(false);\n\n dispatch(action: Action) {};\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAaA;;;;AAIG;MAEU,wBAAwB,CAAA;AADrC,IAAA,WAAA,GAAA;AAEE,QAAA,IAAA,CAAA,SAAS,GAA4C,IAAI,eAAe,CAAC,IAAI,CAAC;AAC9E,QAAA,IAAA,CAAA,QAAQ,GAA2C,IAAI,eAAe,CAAC,IAAI,CAAC;AAC5E,QAAA,IAAA,CAAA,MAAM,GAA4B,IAAI,eAAe,CAAC,CAAC,CAAC;AACxD,QAAA,IAAA,CAAA,YAAY,GAA4B,IAAI,eAAe,CAAC,CAAC,CAAC;AAC9D,QAAA,IAAA,CAAA,WAAW,GAA4B,IAAI,eAAe,CAAC,CAAC,CAAC;AAC7D,QAAA,IAAA,CAAA,SAAS,GAA4B,IAAI,eAAe,CAAC,CAAC,CAAC;AAC3D,QAAA,IAAA,CAAA,YAAY,GAAsC,IAAI,eAAe,CAAC,EAAE,CAAC;AACzE,QAAA,IAAA,CAAA,kBAAkB,GAA4B,IAAI,eAAe,CAAC,IAAI,CAAC;AACvE,QAAA,IAAA,CAAA,qBAAqB,GAA2C,IAAI,eAAe,CAAC,IAAI,CAAC;AACzF,QAAA,IAAA,CAAA,QAAQ,GAAiC,IAAI,eAAe,CAAC,EAAE,CAAC;AAChE,QAAA,IAAA,CAAA,eAAe,GAAiC,IAAI,eAAe,CAAC,EAAE,CAAC;AAGxE,IAAA;IADC,QAAQ,CAAC,MAAc,EAAA,EAAG;;
|
|
1
|
+
{"version":3,"file":"daffodil-core-state-testing.mjs","sources":["../../../libs/core/state/testing/src/mock-collection-facade.ts","../../../libs/core/state/testing/src/mock-operation-facade.ts","../../../libs/core/state/testing/src/daffodil-core-state-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { Action } from '@ngrx/store';\nimport { BehaviorSubject } from 'rxjs';\n\nimport {\n DaffCollectionMetadata,\n DaffCollectionRequest,\n DaffFilters,\n DaffSortDirectionEnum,\n DaffSortOption,\n} from '@daffodil/core';\nimport { DaffCollectionFacadeInterface } from '@daffodil/core/state';\n\n/**\n * Can be used to mock out the {@link DaffCollectionFacade} in testing environments.\n *\n * @inheritdoc\n */\n@Injectable({ providedIn: 'root' })\nexport class MockDaffCollectionFacade implements DaffCollectionFacadeInterface {\n metadata$: BehaviorSubject<DaffCollectionMetadata> = new BehaviorSubject(null);\n request$: BehaviorSubject<DaffCollectionRequest> = new BehaviorSubject(null);\n count$: BehaviorSubject<number> = new BehaviorSubject(0);\n currentPage$: BehaviorSubject<number> = new BehaviorSubject(0);\n totalPages$: BehaviorSubject<number> = new BehaviorSubject(0);\n pageSize$: BehaviorSubject<number> = new BehaviorSubject(0);\n sortOptions$: BehaviorSubject<DaffSortOption[]> = new BehaviorSubject([]);\n appliedSortOption$: BehaviorSubject<string> = new BehaviorSubject(null);\n appliedSortDirection$: BehaviorSubject<DaffSortDirectionEnum> = new BehaviorSubject(null);\n filters$: BehaviorSubject<DaffFilters> = new BehaviorSubject({});\n appliedFilters$: BehaviorSubject<DaffFilters> = new BehaviorSubject({});\n\n dispatch(action: Action) {};\n}\n","import { Injectable } from '@angular/core';\nimport { Action } from '@ngrx/store';\nimport { BehaviorSubject } from 'rxjs';\n\nimport {\n DaffOperationStateFacadeInterface,\n DaffState,\n DaffStateError,\n} from '@daffodil/core/state';\n\n/**\n * Can be used to mock out the {@link DaffOperationStateFacade} in testing environments.\n *\n * @inheritdoc\n */\n@Injectable({ providedIn: 'root' })\nexport class MockDaffOperationStateFacade implements DaffOperationStateFacadeInterface {\n loadingState$ = new BehaviorSubject<DaffState>(DaffState.Stable);\n loading$ = new BehaviorSubject<boolean>(false);\n resolving$ = new BehaviorSubject<boolean>(false);\n mutating$ = new BehaviorSubject<boolean>(false);\n errors$ = new BehaviorSubject<DaffStateError[]>([]);\n hasErrors$ = new BehaviorSubject<boolean>(false);\n\n dispatch(action: Action) {};\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAaA;;;;AAIG;MAEU,wBAAwB,CAAA;AADrC,IAAA,WAAA,GAAA;AAEE,QAAA,IAAA,CAAA,SAAS,GAA4C,IAAI,eAAe,CAAC,IAAI,CAAC;AAC9E,QAAA,IAAA,CAAA,QAAQ,GAA2C,IAAI,eAAe,CAAC,IAAI,CAAC;AAC5E,QAAA,IAAA,CAAA,MAAM,GAA4B,IAAI,eAAe,CAAC,CAAC,CAAC;AACxD,QAAA,IAAA,CAAA,YAAY,GAA4B,IAAI,eAAe,CAAC,CAAC,CAAC;AAC9D,QAAA,IAAA,CAAA,WAAW,GAA4B,IAAI,eAAe,CAAC,CAAC,CAAC;AAC7D,QAAA,IAAA,CAAA,SAAS,GAA4B,IAAI,eAAe,CAAC,CAAC,CAAC;AAC3D,QAAA,IAAA,CAAA,YAAY,GAAsC,IAAI,eAAe,CAAC,EAAE,CAAC;AACzE,QAAA,IAAA,CAAA,kBAAkB,GAA4B,IAAI,eAAe,CAAC,IAAI,CAAC;AACvE,QAAA,IAAA,CAAA,qBAAqB,GAA2C,IAAI,eAAe,CAAC,IAAI,C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