@daffodil/core 0.44.1 → 0.45.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/esm2020/base64/browser/browser.service.mjs +3 -3
- package/esm2020/base64/server/server.service.mjs +3 -3
- package/esm2020/graphql/apollo/queued-apollo/queued-apollo.service.mjs +3 -3
- package/esm2020/routing/uri/normalizer.service.mjs +3 -3
- package/esm2020/state/testing/mock-collection-facade.mjs +3 -3
- package/esm2020/storage/error/error.service.mjs +3 -3
- package/esm2020/storage/localstorage/localstorage.service.mjs +3 -3
- package/esm2020/storage/noopstorage/noopstorage.service.mjs +3 -3
- package/esm2020/storage/server-error/server-error.service.mjs +3 -3
- package/esm2020/testing/angular/mocks/pipes/currency.mjs +3 -3
- package/esm2020/testing/factories/address.factory.mjs +3 -3
- package/esm2020/testing/factories/collection/metadata.factory.mjs +3 -3
- package/esm2020/testing/factories/collection/numerically-paginable.factory.mjs +3 -3
- package/esm2020/testing/factories/collection/request.factory.mjs +3 -3
- package/esm2020/testing/factories/collection/sort-option.factory.mjs +3 -3
- package/esm2020/testing/factories/collection/sort-options.factory.mjs +3 -3
- package/esm2020/testing/factories/collection/sortable.factory.mjs +3 -3
- package/esm2020/testing/testing.module.mjs +4 -4
- package/fesm2015/daffodil-core-graphql.mjs +2 -2
- package/fesm2015/daffodil-core-graphql.mjs.map +1 -1
- package/fesm2015/daffodil-core-routing.mjs +2 -2
- package/fesm2015/daffodil-core-routing.mjs.map +1 -1
- package/fesm2015/daffodil-core-state-testing.mjs +2 -2
- package/fesm2015/daffodil-core-state-testing.mjs.map +1 -1
- package/fesm2015/daffodil-core-testing.mjs +19 -19
- package/fesm2015/daffodil-core-testing.mjs.map +1 -1
- package/fesm2015/daffodil-core.mjs +12 -12
- package/fesm2015/daffodil-core.mjs.map +1 -1
- package/fesm2020/daffodil-core-graphql.mjs +2 -2
- package/fesm2020/daffodil-core-graphql.mjs.map +1 -1
- package/fesm2020/daffodil-core-routing.mjs +2 -2
- package/fesm2020/daffodil-core-routing.mjs.map +1 -1
- package/fesm2020/daffodil-core-state-testing.mjs +2 -2
- package/fesm2020/daffodil-core-state-testing.mjs.map +1 -1
- package/fesm2020/daffodil-core-testing.mjs +19 -19
- package/fesm2020/daffodil-core-testing.mjs.map +1 -1
- package/fesm2020/daffodil-core.mjs +12 -12
- package/fesm2020/daffodil-core.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -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/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;;;AAGG;AACI,MAAM,kCAAkC,GAAG,aAAa;AAC/D;;AAEG;AACU,MAAA,4BAA4B,GAAG,CAAC,GAAW,KAAa,EAAA,IAAA,EAAA,CAAA,CAAA,OAAA,CAAA,CAAA,EAAA,GAAA,GAAG,CAAC,KAAK,CAAC,kCAAkC,CAAC,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAG,CAAC,CAAC,KAAI,GAAG,CAAA;;ACR9H;;;AAGG;AACU,MAAA,kCAAkC,GAAG,CAAC,GAAW,KAC5D,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG;;ACLpB;;;;AAIG;AACI,MAAM,iCAAiC,GAAG,kBAAkB;AACnE;;;AAGG;AACU,MAAA,2BAA2B,GAAG,CAAC,GAAW,KAAY,EAAA,IAAA,EAAA,CAAA,CACjE,OAAA,CAAA,CAAA,EAAA,GAAA,GAAG,CAAC,KAAK,CAAC,iCAAiC,CAAC,MAAE,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,MAAM,CAAC,GAAG,KAAI,GAAG,CAAA;;ACXjE;;;AAGG;AACU,MAAA,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,CAAC;AACjB,KAAA;IACD,OAAO,GAAG,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC;AACzC;;ACFA;;AAEG;MAIU,wBAAwB,CAAA;AACnC,IAAA,WAAA,CACU,SAAwB,EAAA;AAAxB,QAAA,IAAS,CAAA,SAAA,GAAT,SAAS,CAAe;KAC9B;AAEJ;;;;;;;;;AASG;AACH,IAAA,SAAS,CAAC,GAAW,EAAE,MAAM,GAAG,cAAc,EAAA;QAC5C,MAAM,OAAO,GAAY,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AACnD,QAAA,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;;
|
|
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/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;;;AAGG;AACI,MAAM,kCAAkC,GAAG,aAAa;AAC/D;;AAEG;AACU,MAAA,4BAA4B,GAAG,CAAC,GAAW,KAAa,EAAA,IAAA,EAAA,CAAA,CAAA,OAAA,CAAA,CAAA,EAAA,GAAA,GAAG,CAAC,KAAK,CAAC,kCAAkC,CAAC,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAG,CAAC,CAAC,KAAI,GAAG,CAAA;;ACR9H;;;AAGG;AACU,MAAA,kCAAkC,GAAG,CAAC,GAAW,KAC5D,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG;;ACLpB;;;;AAIG;AACI,MAAM,iCAAiC,GAAG,kBAAkB;AACnE;;;AAGG;AACU,MAAA,2BAA2B,GAAG,CAAC,GAAW,KAAY,EAAA,IAAA,EAAA,CAAA,CACjE,OAAA,CAAA,CAAA,EAAA,GAAA,GAAG,CAAC,KAAK,CAAC,iCAAiC,CAAC,MAAE,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,MAAM,CAAC,GAAG,KAAI,GAAG,CAAA;;ACXjE;;;AAGG;AACU,MAAA,4BAA4B,GAAG,CAAC,GAAW,KAAY;AAClE,IAAA,IAAG,GAA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|
22
22
|
dispatch(action) { }
|
|
23
23
|
;
|
|
24
24
|
}
|
|
25
|
-
/** @nocollapse */
|
|
26
|
-
/** @nocollapse */
|
|
25
|
+
/** @nocollapse */ MockDaffCollectionFacade.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: MockDaffCollectionFacade, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
26
|
+
/** @nocollapse */ MockDaffCollectionFacade.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: MockDaffCollectionFacade, providedIn: 'root' });
|
|
27
27
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: MockDaffCollectionFacade, decorators: [{
|
|
28
28
|
type: Injectable,
|
|
29
29
|
args: [{ providedIn: 'root' }]
|
|
@@ -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/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 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\n dispatch(action: Action) {};\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAYA;;;;AAIG;MAEU,wBAAwB,CAAA;AADrC,IAAA,WAAA,GAAA;QAEE,IAAA,CAAA,SAAS,GAA4C,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;QAC/E,IAAA,CAAA,QAAQ,GAA2C,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;QAC7E,IAAA,CAAA,MAAM,GAA4B,IAAI,eAAe,CAAC,CAAC,CAAC,CAAC;QACzD,IAAA,CAAA,YAAY,GAA4B,IAAI,eAAe,CAAC,CAAC,CAAC,CAAC;QAC/D,IAAA,CAAA,WAAW,GAA4B,IAAI,eAAe,CAAC,CAAC,CAAC,CAAC;QAC9D,IAAA,CAAA,SAAS,GAA4B,IAAI,eAAe,CAAC,CAAC,CAAC,CAAC;QAC5D,IAAA,CAAA,YAAY,GAAsC,IAAI,eAAe,CAAC,EAAE,CAAC,CAAC;QAC1E,IAAA,CAAA,kBAAkB,GAA4B,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;QACxE,IAAA,CAAA,qBAAqB,GAA2C,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;KAG3F;IADC,QAAQ,CAAC,MAAc,EAAA,GAAI;;;
|
|
1
|
+
{"version":3,"file":"daffodil-core-state-testing.mjs","sources":["../../../libs/core/state/testing/src/mock-collection-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 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\n dispatch(action: Action) {};\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAYA;;;;AAIG;MAEU,wBAAwB,CAAA;AADrC,IAAA,WAAA,GAAA;QAEE,IAAA,CAAA,SAAS,GAA4C,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;QAC/E,IAAA,CAAA,QAAQ,GAA2C,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;QAC7E,IAAA,CAAA,MAAM,GAA4B,IAAI,eAAe,CAAC,CAAC,CAAC,CAAC;QACzD,IAAA,CAAA,YAAY,GAA4B,IAAI,eAAe,CAAC,CAAC,CAAC,CAAC;QAC/D,IAAA,CAAA,WAAW,GAA4B,IAAI,eAAe,CAAC,CAAC,CAAC,CAAC;QAC9D,IAAA,CAAA,SAAS,GAA4B,IAAI,eAAe,CAAC,CAAC,CAAC,CAAC;QAC5D,IAAA,CAAA,YAAY,GAAsC,IAAI,eAAe,CAAC,EAAE,CAAC,CAAC;QAC1E,IAAA,CAAA,kBAAkB,GAA4B,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;QACxE,IAAA,CAAA,qBAAqB,GAA2C,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;KAG3F;IADC,QAAQ,CAAC,MAAc,EAAA,GAAI;;;wIAXhB,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAxB,mBAAA,wBAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,wBAAwB,cADX,MAAM,EAAA,CAAA,CAAA;2FACnB,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBADpC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE,CAAA;;;ACjBlC;;AAEG;;;;"}
|
|
@@ -13,8 +13,8 @@ class DaffMockCurrencyPipe {
|
|
|
13
13
|
transform(value) { }
|
|
14
14
|
;
|
|
15
15
|
}
|
|
16
|
-
/** @nocollapse */
|
|
17
|
-
/** @nocollapse */
|
|
16
|
+
/** @nocollapse */ DaffMockCurrencyPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffMockCurrencyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
17
|
+
/** @nocollapse */ DaffMockCurrencyPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffMockCurrencyPipe, name: "currency" });
|
|
18
18
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffMockCurrencyPipe, decorators: [{
|
|
19
19
|
type: Pipe,
|
|
20
20
|
args: [{ name: 'currency' }]
|
|
@@ -22,9 +22,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImpor
|
|
|
22
22
|
|
|
23
23
|
class DaffCoreTestingModule {
|
|
24
24
|
}
|
|
25
|
-
/** @nocollapse */
|
|
26
|
-
/** @nocollapse */
|
|
27
|
-
/** @nocollapse */
|
|
25
|
+
/** @nocollapse */ DaffCoreTestingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffCoreTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
26
|
+
/** @nocollapse */ DaffCoreTestingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffCoreTestingModule, declarations: [DaffMockCurrencyPipe] });
|
|
27
|
+
/** @nocollapse */ DaffCoreTestingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffCoreTestingModule });
|
|
28
28
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffCoreTestingModule, decorators: [{
|
|
29
29
|
type: NgModule,
|
|
30
30
|
args: [{
|
|
@@ -109,8 +109,8 @@ class DaffAddressFactory extends DaffModelFactory {
|
|
|
109
109
|
super(MockDaffAddress);
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
|
-
/** @nocollapse */
|
|
113
|
-
/** @nocollapse */
|
|
112
|
+
/** @nocollapse */ DaffAddressFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffAddressFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
113
|
+
/** @nocollapse */ DaffAddressFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffAddressFactory, providedIn: 'root' });
|
|
114
114
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffAddressFactory, decorators: [{
|
|
115
115
|
type: Injectable,
|
|
116
116
|
args: [{
|
|
@@ -130,8 +130,8 @@ class DaffNumericallyPaginableFactory extends DaffModelFactory {
|
|
|
130
130
|
super(MockDaffNumericallyPaginable);
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
|
-
/** @nocollapse */
|
|
134
|
-
/** @nocollapse */
|
|
133
|
+
/** @nocollapse */ DaffNumericallyPaginableFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffNumericallyPaginableFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
134
|
+
/** @nocollapse */ DaffNumericallyPaginableFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffNumericallyPaginableFactory, providedIn: 'root' });
|
|
135
135
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffNumericallyPaginableFactory, decorators: [{
|
|
136
136
|
type: Injectable,
|
|
137
137
|
args: [{
|
|
@@ -150,8 +150,8 @@ class DaffSortOptionFactory extends DaffModelFactory {
|
|
|
150
150
|
super(MockDaffSortOption);
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
|
-
/** @nocollapse */
|
|
154
|
-
/** @nocollapse */
|
|
153
|
+
/** @nocollapse */ DaffSortOptionFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffSortOptionFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
154
|
+
/** @nocollapse */ DaffSortOptionFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffSortOptionFactory, providedIn: 'root' });
|
|
155
155
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffSortOptionFactory, decorators: [{
|
|
156
156
|
type: Injectable,
|
|
157
157
|
args: [{
|
|
@@ -174,8 +174,8 @@ class DaffSortOptionsFactory extends DaffModelFactory {
|
|
|
174
174
|
super(MockDaffSortOptions, optionFactory);
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
|
-
/** @nocollapse */
|
|
178
|
-
/** @nocollapse */
|
|
177
|
+
/** @nocollapse */ DaffSortOptionsFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffSortOptionsFactory, deps: [{ token: DaffSortOptionFactory }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
178
|
+
/** @nocollapse */ DaffSortOptionsFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffSortOptionsFactory, providedIn: 'root' });
|
|
179
179
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffSortOptionsFactory, decorators: [{
|
|
180
180
|
type: Injectable,
|
|
181
181
|
args: [{
|
|
@@ -199,8 +199,8 @@ class DaffSortableFactory extends DaffModelFactory {
|
|
|
199
199
|
super(MockDaffSortable, optionFactory);
|
|
200
200
|
}
|
|
201
201
|
}
|
|
202
|
-
/** @nocollapse */
|
|
203
|
-
/** @nocollapse */
|
|
202
|
+
/** @nocollapse */ DaffSortableFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffSortableFactory, deps: [{ token: DaffSortOptionsFactory }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
203
|
+
/** @nocollapse */ DaffSortableFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffSortableFactory, providedIn: 'root' });
|
|
204
204
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffSortableFactory, decorators: [{
|
|
205
205
|
type: Injectable,
|
|
206
206
|
args: [{
|
|
@@ -233,8 +233,8 @@ class DaffCollectionMetadataFactory extends DaffModelFactory {
|
|
|
233
233
|
super(MockCollectionMetadata, pageInfoFactory, sortFieldsFactory);
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
|
-
/** @nocollapse */
|
|
237
|
-
/** @nocollapse */
|
|
236
|
+
/** @nocollapse */ DaffCollectionMetadataFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffCollectionMetadataFactory, deps: [{ token: DaffNumericallyPaginableFactory }, { token: DaffSortableFactory }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
237
|
+
/** @nocollapse */ DaffCollectionMetadataFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffCollectionMetadataFactory, providedIn: 'root' });
|
|
238
238
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffCollectionMetadataFactory, decorators: [{
|
|
239
239
|
type: Injectable,
|
|
240
240
|
args: [{
|
|
@@ -261,8 +261,8 @@ class DaffCollectionRequestFactory extends DaffModelFactory {
|
|
|
261
261
|
super(MockCollectionRequest);
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
|
-
/** @nocollapse */
|
|
265
|
-
/** @nocollapse */
|
|
264
|
+
/** @nocollapse */ DaffCollectionRequestFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffCollectionRequestFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
265
|
+
/** @nocollapse */ DaffCollectionRequestFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffCollectionRequestFactory, providedIn: 'root' });
|
|
266
266
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffCollectionRequestFactory, decorators: [{
|
|
267
267
|
type: Injectable,
|
|
268
268
|
args: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-core-testing.mjs","sources":["../../../libs/core/testing/src/angular/mocks/pipes/currency.ts","../../../libs/core/testing/src/testing.module.ts","../../../libs/core/testing/src/factories/factory.ts","../../../libs/core/testing/src/factories/address.factory.ts","../../../libs/core/testing/src/factories/collection/numerically-paginable.factory.ts","../../../libs/core/testing/src/factories/collection/sort-option.factory.ts","../../../libs/core/testing/src/factories/collection/sort-options.factory.ts","../../../libs/core/testing/src/factories/collection/sortable.factory.ts","../../../libs/core/testing/src/factories/collection/metadata.factory.ts","../../../libs/core/testing/src/factories/collection/request.factory.ts","../../../libs/core/testing/src/factories/collection/mock-collection.class.ts","../../../libs/core/testing/src/public_api.ts","../../../libs/core/testing/src/daffodil-core-testing.ts"],"sourcesContent":["import {\n Pipe,\n PipeTransform,\n} from '@angular/core';\n\n/**\n * @docs\n * A mock CurrencyPipe that does nothing to a given input.\n * This pipe is useful for asserting that a CurrencyPipe is in use via a spy,\n * but ignoring the actual underlying implementation\n */\n@Pipe({ name: 'currency' })\nexport class DaffMockCurrencyPipe implements PipeTransform {\n transform(value: number) {};\n}\n","import { NgModule } from '@angular/core';\n\nimport { DaffMockCurrencyPipe } from './angular/mocks/pipes/currency';\n\n@NgModule({\n declarations: [\n DaffMockCurrencyPipe,\n ],\n})\nexport class DaffCoreTestingModule {}\n","import {\n range,\n Constructable,\n} from '@daffodil/core';\n\nimport { IDaffModelFactory } from './factory.interface';\n\n/**\n * The base class for model factories.\n *\n * The mock class is passed as the first constructor arg\n * and any additional args are passed to the mock class constructor.\n *\n * The constructor args can be omitted if the `create` method is overridden.\n *\n * The following example demonstrates using this feature to inject\n * a different factory into a mock class.\n *\n * ```ts\n * class MyMockModel {\n * constructor(\n * private otherFactory: MyOtherFactory\n * ) {}\n *\n * private createOtherModel() {\n * return this.otherFactory.create()\n * }\n *\n * otherModel = this.createOtherModel()\n * }\n *\n * @Injectable()\n * class TestFactory extends DaffModelFactory<MyMockModel> {\n * constructor(\n * otherFactory: MyOtherFactory\n * ) {\n * super(MyMockModel, otherFactory)\n * }\n * }\n * ```\n */\nexport abstract class DaffModelFactory<T extends Record<string, any>> implements IDaffModelFactory<T> {\n _instantiationArgs: ConstructorParameters<Constructable<T>>;\n\n constructor(\n public type?: Constructable<T>,\n ...args: ConstructorParameters<Constructable<T>>\n ) {\n this._instantiationArgs = args;\n }\n\n create(partial = {}): T {\n if (!this.type) {\n throw new Error('`type` is required if `create` is not overriden.');\n }\n return {\n ...new this.type(...this._instantiationArgs),\n ...partial,\n };\n }\n\n createMany(qty = 1, partial = {}): T[] {\n return range(0, qty - 1).map(() => this.create(partial));\n }\n}\n","import { Injectable } from '@angular/core';\nimport * as faker from '@faker-js/faker/locale/en_US';\n\nimport { DaffAddress } from '@daffodil/core';\n\nimport { DaffModelFactory } from './factory';\n\n/**\n * @deprecated\n * Prefer the `MockDaffAddress` of daffodil/geography/testing`\n */\nexport class MockDaffAddress implements DaffAddress {\n firstname = faker.name.firstName();\n lastname = faker.name.lastName();\n street = faker.address.streetName();\n city = faker.address.city();\n state = faker.address.stateAbbr();\n email = faker.internet.email();\n postcode = faker.address.zipCode();\n telephone = faker.phone.phoneNumber();\n}\n\n/**\n * @deprecated\n * Prefer the `DaffAddressFactory` of `daffodil/geography/testing`\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffAddressFactory extends DaffModelFactory<DaffAddress>{\n constructor(){\n super(MockDaffAddress);\n }\n}\n","import { Injectable } from '@angular/core';\nimport * as faker from '@faker-js/faker/locale/en_US';\n\nimport { DaffNumericallyPaginable } from '@daffodil/core';\n\nimport { DaffModelFactory } from '../factory';\n\nclass MockDaffNumericallyPaginable implements DaffNumericallyPaginable {\n totalPages = faker.datatype.number({ min: 1, max: 100 });\n currentPage = faker.datatype.number({ min: 1, max: this.totalPages });\n pageSize = faker.datatype.number({ min: 1, max: 100 });\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffNumericallyPaginableFactory extends DaffModelFactory<DaffNumericallyPaginable> {\n constructor(){\n super(MockDaffNumericallyPaginable);\n }\n}\n","import { Injectable } from '@angular/core';\nimport * as faker from '@faker-js/faker/locale/en_US';\n\nimport { DaffSortOption } from '@daffodil/core';\n\nimport { DaffModelFactory } from '../factory';\n\nclass MockDaffSortOption implements DaffSortOption {\n label = faker.random.word();\n value = faker.random.word();\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffSortOptionFactory extends DaffModelFactory<DaffSortOption> {\n constructor() {\n super(MockDaffSortOption);\n }\n}\n","import { Injectable } from '@angular/core';\nimport * as faker from '@faker-js/faker/locale/en_US';\n\nimport {\n DaffSortOption,\n DaffSortOptions,\n} from '@daffodil/core';\n\nimport { DaffModelFactory } from '../factory';\nimport { DaffSortOptionFactory } from './sort-option.factory';\n\nclass MockDaffSortOptions implements DaffSortOptions {\n options = this.createOptions();\n default = faker.random.arrayElement(this.options).value;\n\n constructor(\n private optionFactory: DaffSortOptionFactory,\n ) {}\n\n private createOptions(): DaffSortOption[] {\n return this.optionFactory.createMany(faker.random.number({ min: 1, max: 5 }));\n }\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffSortOptionsFactory extends DaffModelFactory<DaffSortOptions> {\n constructor(\n optionFactory: DaffSortOptionFactory,\n ) {\n super(MockDaffSortOptions, optionFactory);\n }\n}\n","import { Injectable } from '@angular/core';\nimport * as faker from '@faker-js/faker/locale/en_US';\n\nimport {\n DaffSortable,\n DaffSortDirectionEnum,\n DaffSortOptions,\n} from '@daffodil/core';\n\nimport { DaffModelFactory } from '../factory';\nimport { DaffSortOptionsFactory } from './sort-options.factory';\n\nclass MockDaffSortable implements DaffSortable {\n sortOptions = this.createOptions();\n appliedSortOption = faker.random.arrayElement(this.sortOptions.options).value;\n appliedSortDirection = faker.random.arrayElement([DaffSortDirectionEnum.Ascending, DaffSortDirectionEnum.Descending]);\n\n constructor(\n private optionFactory: DaffSortOptionsFactory,\n ) {}\n\n private createOptions(): DaffSortOptions {\n return this.optionFactory.create();\n }\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffSortableFactory extends DaffModelFactory<DaffSortable> {\n constructor(\n optionFactory: DaffSortOptionsFactory,\n ) {\n super(MockDaffSortable, optionFactory);\n }\n}\n","import { Injectable } from '@angular/core';\nimport * as faker from '@faker-js/faker/locale/en_US';\n\nimport {\n DaffCollectionMetadata,\n DaffIdentifiable,\n DaffNumericallyPaginable,\n DaffSortable,\n DaffSortDirectionEnum,\n DaffSortOption,\n DaffSortOptions,\n} from '@daffodil/core';\n\nimport { DaffModelFactory } from '../factory';\nimport { DaffNumericallyPaginableFactory } from './numerically-paginable.factory';\nimport { DaffSortableFactory } from './sortable.factory';\n\n/**\n * Mocked {@link DaffCollectionMetadata} object.\n */\nexport class MockCollectionMetadata implements DaffCollectionMetadata {\n currentPage: number;\n totalPages: number;\n pageSize: number;\n sortOptions: DaffSortOptions;\n appliedSortOption: DaffSortOption['value'];\n appliedSortDirection: DaffSortDirectionEnum;\n count: number;\n ids: DaffIdentifiable['id'][];\n\n constructor(\n pageInfoFactory: DaffNumericallyPaginableFactory,\n sortFieldsFactory: DaffSortableFactory,\n ) {\n const _pageInfo = pageInfoFactory.create();\n const _sortFields = sortFieldsFactory.create();\n\n this.count = faker.datatype.number({ min: 1, max: 1000 });\n this.ids = new Array(this.count).fill(null).map<string>(() => faker.datatype.uuid());\n\n this.currentPage = _pageInfo.currentPage;\n this.totalPages = _pageInfo.totalPages;\n this.pageSize = _pageInfo.pageSize;\n\n this.appliedSortDirection = _sortFields.appliedSortDirection;\n this.appliedSortOption = _sortFields.appliedSortOption;\n this.sortOptions = _sortFields.sortOptions;\n }\n}\n\n/**\n * Factory for creating {@link DaffCollectionMetadata}s.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffCollectionMetadataFactory extends DaffModelFactory<DaffCollectionMetadata> {\n constructor(\n pageInfoFactory: DaffNumericallyPaginableFactory,\n sortFieldsFactory: DaffSortableFactory,\n ) {\n super(MockCollectionMetadata, pageInfoFactory, sortFieldsFactory);\n }\n}\n","import { Injectable } from '@angular/core';\nimport * as faker from '@faker-js/faker/locale/en_US';\n\nimport {\n DaffCollectionRequest,\n DaffSortDirectionEnum,\n} from '@daffodil/core';\n\nimport { DaffModelFactory } from '../factory';\n\n/**\n * Mocked {@link DaffCollectionRequest} object.\n */\nexport class MockCollectionRequest implements DaffCollectionRequest {\n currentPage = faker.datatype.number({ min: 1, max: 100 });\n appliedSortDirection = faker.random.arrayElement([DaffSortDirectionEnum.Ascending, DaffSortDirectionEnum.Descending]);\n pageSize = faker.datatype.number({ min: 1, max: 100 });\n appliedSortOption = faker.random.word();\n}\n\n/**\n * Factory for creating {@link DaffCollectionRequest}s.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffCollectionRequestFactory extends DaffModelFactory<DaffCollectionRequest> {\n constructor() {\n super(MockCollectionRequest);\n }\n}\n","import {\n daffIdentifiableArrayToDict,\n DaffCollection,\n DaffCollectionMetadata,\n DaffIdentifiable,\n} from '@daffodil/core';\n\nimport { DaffModelFactory } from '../factory';\nimport { DaffCollectionMetadataFactory } from './metadata.factory';\n\n/**\n * Mocked {@link DaffCollection} object.\n *\n * It should be customized by passing the factory for the contained entity as the first constructor argument.\n */\nexport class MockCollection<T extends DaffIdentifiable = DaffIdentifiable> implements DaffCollection<T> {\n private _items = this.createItems();\n metadata = this.createMetadata();\n data = daffIdentifiableArrayToDict(this._items);\n\n constructor(\n private itemFactory: DaffModelFactory<T>,\n private metadataFactory: DaffCollectionMetadataFactory,\n ) {}\n\n private createItems(): T[] {\n return this.itemFactory.createMany();\n }\n\n private createMetadata(): DaffCollectionMetadata {\n return this.metadataFactory.create({\n ids: this._items.map(({ id }) => id),\n count: this._items.length,\n });\n }\n}\n","//@angular/core\nexport { DaffMockCurrencyPipe } from './angular/mocks/pipes/currency';\nexport { DaffInMemoryDataServiceInterface } from './angular/interfaces/in-memory-data-service.interface';\n\n//Core\nexport { DaffCoreTestingModule } from './testing.module';\n\nexport * from './factories/public_api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.DaffSortOptionFactory","i1.DaffSortOptionsFactory","i1.DaffNumericallyPaginableFactory","i2.DaffSortableFactory"],"mappings":";;;;;AAKA;;;;;AAKG;MAEU,oBAAoB,CAAA;IAC/B,SAAS,CAAC,KAAa,EAAA,GAAI;;;uJADhB,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA;qJAApB,oBAAoB,EAAA,IAAA,EAAA,UAAA,EAAA,CAAA,CAAA;2FAApB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBADhC,IAAI;mBAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAA;;;MCFb,qBAAqB,CAAA;;wJAArB,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAArB,sCAAA,qBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,qBAAqB,iBAH9B,oBAAoB,CAAA,EAAA,CAAA,CAAA;yJAGX,qBAAqB,EAAA,CAAA,CAAA;2FAArB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBALjC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE;wBACZ,oBAAoB;AACrB,qBAAA;iBACF,CAAA;;;ACDD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCG;MACmB,gBAAgB,CAAA;IAGpC,WACS,CAAA,IAAuB,EAC9B,GAAG,IAA6C,EAAA;AADzC,QAAA,IAAI,C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UAAU,EAAE,MAAM;iBACnB,CAAA;;;ACfD;;;;AAIG;MACU,cAAc,CAAA;IAKzB,WACU,CAAA,WAAgC,EAChC,eAA8C,EAAA;AAD9C,QAAA,IAAW,CAAA,WAAA,GAAX,WAAW,CAAqB;AAChC,QAAA,IAAe,CAAA,eAAA,GAAf,eAAe,CAA+B;AANhD,QAAA,IAAA,CAAA,MAAM,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;AACpC,QAAA,IAAA,CAAA,QAAQ,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;QACjC,IAAA,CAAA,IAAI,GAAG,2BAA2B,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;KAK5C;IAEI,WAAW,GAAA;AACjB,QAAA,OAAO,IAAI,CAAC,WAAW,CAAC,UAAU,EAAE,CAAC;KACtC;IAEO,cAAc,GAAA;AACpB,QAAA,OAAO,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC;AACjC,YAAA,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC;AACpC,YAAA,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM;AAC1B,SAAA,CAAC,CAAC;KACJ;AACF;;ACnCD;;ACAA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"daffodil-core-testing.mjs","sources":["../../../libs/core/testing/src/angular/mocks/pipes/currency.ts","../../../libs/core/testing/src/testing.module.ts","../../../libs/core/testing/src/factories/factory.ts","../../../libs/core/testing/src/factories/address.factory.ts","../../../libs/core/testing/src/factories/collection/numerically-paginable.factory.ts","../../../libs/core/testing/src/factories/collection/sort-option.factory.ts","../../../libs/core/testing/src/factories/collection/sort-options.factory.ts","../../../libs/core/testing/src/factories/collection/sortable.factory.ts","../../../libs/core/testing/src/factories/collection/metadata.factory.ts","../../../libs/core/testing/src/factories/collection/request.factory.ts","../../../libs/core/testing/src/factories/collection/mock-collection.class.ts","../../../libs/core/testing/src/public_api.ts","../../../libs/core/testing/src/daffodil-core-testing.ts"],"sourcesContent":["import {\n Pipe,\n PipeTransform,\n} from '@angular/core';\n\n/**\n * @docs\n * A mock CurrencyPipe that does nothing to a given input.\n * This pipe is useful for asserting that a CurrencyPipe is in use via a spy,\n * but ignoring the actual underlying implementation\n */\n@Pipe({ name: 'currency' })\nexport class DaffMockCurrencyPipe implements PipeTransform {\n transform(value: number) {};\n}\n","import { NgModule } from '@angular/core';\n\nimport { DaffMockCurrencyPipe } from './angular/mocks/pipes/currency';\n\n@NgModule({\n declarations: [\n DaffMockCurrencyPipe,\n ],\n})\nexport class DaffCoreTestingModule {}\n","import {\n range,\n Constructable,\n} from '@daffodil/core';\n\nimport { IDaffModelFactory } from './factory.interface';\n\n/**\n * The base class for model factories.\n *\n * The mock class is passed as the first constructor arg\n * and any additional args are passed to the mock class constructor.\n *\n * The constructor args can be omitted if the `create` method is overridden.\n *\n * The following example demonstrates using this feature to inject\n * a different factory into a mock class.\n *\n * ```ts\n * class MyMockModel {\n * constructor(\n * private otherFactory: MyOtherFactory\n * ) {}\n *\n * private createOtherModel() {\n * return this.otherFactory.create()\n * }\n *\n * otherModel = this.createOtherModel()\n * }\n *\n * @Injectable()\n * class TestFactory extends DaffModelFactory<MyMockModel> {\n * constructor(\n * otherFactory: MyOtherFactory\n * ) {\n * super(MyMockModel, otherFactory)\n * }\n * }\n * ```\n */\nexport abstract class DaffModelFactory<T extends Record<string, any>> implements IDaffModelFactory<T> {\n _instantiationArgs: ConstructorParameters<Constructable<T>>;\n\n constructor(\n public type?: Constructable<T>,\n ...args: ConstructorParameters<Constructable<T>>\n ) {\n this._instantiationArgs = args;\n }\n\n create(partial = {}): T {\n if (!this.type) {\n throw new Error('`type` is required if `create` is not overriden.');\n }\n return {\n ...new this.type(...this._instantiationArgs),\n ...partial,\n };\n }\n\n createMany(qty = 1, partial = {}): T[] {\n return range(0, qty - 1).map(() => this.create(partial));\n }\n}\n","import { Injectable } from '@angular/core';\nimport * as faker from '@faker-js/faker/locale/en_US';\n\nimport { DaffAddress } from '@daffodil/core';\n\nimport { DaffModelFactory } from './factory';\n\n/**\n * @deprecated\n * Prefer the `MockDaffAddress` of daffodil/geography/testing`\n */\nexport class MockDaffAddress implements DaffAddress {\n firstname = faker.name.firstName();\n lastname = faker.name.lastName();\n street = faker.address.streetName();\n city = faker.address.city();\n state = faker.address.stateAbbr();\n email = faker.internet.email();\n postcode = faker.address.zipCode();\n telephone = faker.phone.phoneNumber();\n}\n\n/**\n * @deprecated\n * Prefer the `DaffAddressFactory` of `daffodil/geography/testing`\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffAddressFactory extends DaffModelFactory<DaffAddress>{\n constructor(){\n super(MockDaffAddress);\n }\n}\n","import { Injectable } from '@angular/core';\nimport * as faker from '@faker-js/faker/locale/en_US';\n\nimport { DaffNumericallyPaginable } from '@daffodil/core';\n\nimport { DaffModelFactory } from '../factory';\n\nclass MockDaffNumericallyPaginable implements DaffNumericallyPaginable {\n totalPages = faker.datatype.number({ min: 1, max: 100 });\n currentPage = faker.datatype.number({ min: 1, max: this.totalPages });\n pageSize = faker.datatype.number({ min: 1, max: 100 });\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffNumericallyPaginableFactory extends DaffModelFactory<DaffNumericallyPaginable> {\n constructor(){\n super(MockDaffNumericallyPaginable);\n }\n}\n","import { Injectable } from '@angular/core';\nimport * as faker from '@faker-js/faker/locale/en_US';\n\nimport { DaffSortOption } from '@daffodil/core';\n\nimport { DaffModelFactory } from '../factory';\n\nclass MockDaffSortOption implements DaffSortOption {\n label = faker.random.word();\n value = faker.random.word();\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffSortOptionFactory extends DaffModelFactory<DaffSortOption> {\n constructor() {\n super(MockDaffSortOption);\n }\n}\n","import { Injectable } from '@angular/core';\nimport * as faker from '@faker-js/faker/locale/en_US';\n\nimport {\n DaffSortOption,\n DaffSortOptions,\n} from '@daffodil/core';\n\nimport { DaffModelFactory } from '../factory';\nimport { DaffSortOptionFactory } from './sort-option.factory';\n\nclass MockDaffSortOptions implements DaffSortOptions {\n options = this.createOptions();\n default = faker.random.arrayElement(this.options).value;\n\n constructor(\n private optionFactory: DaffSortOptionFactory,\n ) {}\n\n private createOptions(): DaffSortOption[] {\n return this.optionFactory.createMany(faker.random.number({ min: 1, max: 5 }));\n }\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffSortOptionsFactory extends DaffModelFactory<DaffSortOptions> {\n constructor(\n optionFactory: DaffSortOptionFactory,\n ) {\n super(MockDaffSortOptions, optionFactory);\n }\n}\n","import { Injectable } from '@angular/core';\nimport * as faker from '@faker-js/faker/locale/en_US';\n\nimport {\n DaffSortable,\n DaffSortDirectionEnum,\n DaffSortOptions,\n} from '@daffodil/core';\n\nimport { DaffModelFactory } from '../factory';\nimport { DaffSortOptionsFactory } from './sort-options.factory';\n\nclass MockDaffSortable implements DaffSortable {\n sortOptions = this.createOptions();\n appliedSortOption = faker.random.arrayElement(this.sortOptions.options).value;\n appliedSortDirection = faker.random.arrayElement([DaffSortDirectionEnum.Ascending, DaffSortDirectionEnum.Descending]);\n\n constructor(\n private optionFactory: DaffSortOptionsFactory,\n ) {}\n\n private createOptions(): DaffSortOptions {\n return this.optionFactory.create();\n }\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffSortableFactory extends DaffModelFactory<DaffSortable> {\n constructor(\n optionFactory: DaffSortOptionsFactory,\n ) {\n super(MockDaffSortable, optionFactory);\n }\n}\n","import { Injectable } from '@angular/core';\nimport * as faker from '@faker-js/faker/locale/en_US';\n\nimport {\n DaffCollectionMetadata,\n DaffIdentifiable,\n DaffNumericallyPaginable,\n DaffSortable,\n DaffSortDirectionEnum,\n DaffSortOption,\n DaffSortOptions,\n} from '@daffodil/core';\n\nimport { DaffModelFactory } from '../factory';\nimport { DaffNumericallyPaginableFactory } from './numerically-paginable.factory';\nimport { DaffSortableFactory } from './sortable.factory';\n\n/**\n * Mocked {@link DaffCollectionMetadata} object.\n */\nexport class MockCollectionMetadata implements DaffCollectionMetadata {\n currentPage: number;\n totalPages: number;\n pageSize: number;\n sortOptions: DaffSortOptions;\n appliedSortOption: DaffSortOption['value'];\n appliedSortDirection: DaffSortDirectionEnum;\n count: number;\n ids: DaffIdentifiable['id'][];\n\n constructor(\n pageInfoFactory: DaffNumericallyPaginableFactory,\n sortFieldsFactory: DaffSortableFactory,\n ) {\n const _pageInfo = pageInfoFactory.create();\n const _sortFields = sortFieldsFactory.create();\n\n this.count = faker.datatype.number({ min: 1, max: 1000 });\n this.ids = new Array(this.count).fill(null).map<string>(() => faker.datatype.uuid());\n\n this.currentPage = _pageInfo.currentPage;\n this.totalPages = _pageInfo.totalPages;\n this.pageSize = _pageInfo.pageSize;\n\n this.appliedSortDirection = _sortFields.appliedSortDirection;\n this.appliedSortOption = _sortFields.appliedSortOption;\n this.sortOptions = _sortFields.sortOptions;\n }\n}\n\n/**\n * Factory for creating {@link DaffCollectionMetadata}s.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffCollectionMetadataFactory extends DaffModelFactory<DaffCollectionMetadata> {\n constructor(\n pageInfoFactory: DaffNumericallyPaginableFactory,\n sortFieldsFactory: DaffSortableFactory,\n ) {\n super(MockCollectionMetadata, pageInfoFactory, sortFieldsFactory);\n }\n}\n","import { Injectable } from '@angular/core';\nimport * as faker from '@faker-js/faker/locale/en_US';\n\nimport {\n DaffCollectionRequest,\n DaffSortDirectionEnum,\n} from '@daffodil/core';\n\nimport { DaffModelFactory } from '../factory';\n\n/**\n * Mocked {@link DaffCollectionRequest} object.\n */\nexport class MockCollectionRequest implements DaffCollectionRequest {\n currentPage = faker.datatype.number({ min: 1, max: 100 });\n appliedSortDirection = faker.random.arrayElement([DaffSortDirectionEnum.Ascending, DaffSortDirectionEnum.Descending]);\n pageSize = faker.datatype.number({ min: 1, max: 100 });\n appliedSortOption = faker.random.word();\n}\n\n/**\n * Factory for creating {@link DaffCollectionRequest}s.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffCollectionRequestFactory extends DaffModelFactory<DaffCollectionRequest> {\n constructor() {\n super(MockCollectionRequest);\n }\n}\n","import {\n daffIdentifiableArrayToDict,\n DaffCollection,\n DaffCollectionMetadata,\n DaffIdentifiable,\n} from '@daffodil/core';\n\nimport { DaffModelFactory } from '../factory';\nimport { DaffCollectionMetadataFactory } from './metadata.factory';\n\n/**\n * Mocked {@link DaffCollection} object.\n *\n * It should be customized by passing the factory for the contained entity as the first constructor argument.\n */\nexport class MockCollection<T extends DaffIdentifiable = DaffIdentifiable> implements DaffCollection<T> {\n private _items = this.createItems();\n metadata = this.createMetadata();\n data = daffIdentifiableArrayToDict(this._items);\n\n constructor(\n private itemFactory: DaffModelFactory<T>,\n private metadataFactory: DaffCollectionMetadataFactory,\n ) {}\n\n private createItems(): T[] {\n return this.itemFactory.createMany();\n }\n\n private createMetadata(): DaffCollectionMetadata {\n return this.metadataFactory.create({\n ids: this._items.map(({ id }) => id),\n count: this._items.length,\n });\n }\n}\n","//@angular/core\nexport { DaffMockCurrencyPipe } from './angular/mocks/pipes/currency';\nexport { DaffInMemoryDataServiceInterface } from './angular/interfaces/in-memory-data-service.interface';\n\n//Core\nexport { DaffCoreTestingModule } from './testing.module';\n\nexport * from './factories/public_api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.DaffSortOptionFactory","i1.DaffSortOptionsFactory","i1.DaffNumericallyPaginableFactory","i2.DaffSortableFactory"],"mappings":";;;;;AAKA;;;;;AAKG;MAEU,oBAAoB,CAAA;IAC/B,SAAS,CAAC,KAAa,EAAA,GAAI;;;oIADhB,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA;kIAApB,oBAAoB,EAAA,IAAA,EAAA,UAAA,EAAA,CAAA,CAAA;2FAApB,oBAAoB,EAAA,UAAA,EAAA,CA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IAEO,cAAc,GAAA;AACpB,QAAA,OAAO,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC;AACjC,YAAA,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC;AACpC,YAAA,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM;AAC1B,SAAA,CAAC,CAAC;KACJ;AACF;;ACnCD;;ACAA;;AAEG;;;;"}
|
|
@@ -233,8 +233,8 @@ class DaffErrorStorageService {
|
|
|
233
233
|
}
|
|
234
234
|
}
|
|
235
235
|
DaffErrorStorageService.ERROR_MESSAGE = 'The DaffErrorStorageService always throws an error.';
|
|
236
|
-
/** @nocollapse */
|
|
237
|
-
/** @nocollapse */
|
|
236
|
+
/** @nocollapse */ DaffErrorStorageService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffErrorStorageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
237
|
+
/** @nocollapse */ DaffErrorStorageService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffErrorStorageService, providedIn: 'root' });
|
|
238
238
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffErrorStorageService, decorators: [{
|
|
239
239
|
type: Injectable,
|
|
240
240
|
args: [{
|
|
@@ -277,8 +277,8 @@ class DaffServerErrorStorageService {
|
|
|
277
277
|
}
|
|
278
278
|
}
|
|
279
279
|
DaffServerErrorStorageService.ERROR_MESSAGE = 'The DaffServerErrorStorageService always throws an error.';
|
|
280
|
-
/** @nocollapse */
|
|
281
|
-
/** @nocollapse */
|
|
280
|
+
/** @nocollapse */ DaffServerErrorStorageService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffServerErrorStorageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
281
|
+
/** @nocollapse */ DaffServerErrorStorageService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffServerErrorStorageService, providedIn: 'root' });
|
|
282
282
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffServerErrorStorageService, decorators: [{
|
|
283
283
|
type: Injectable,
|
|
284
284
|
args: [{
|
|
@@ -317,8 +317,8 @@ class DaffLocalStorageService {
|
|
|
317
317
|
localStorage.clear();
|
|
318
318
|
}
|
|
319
319
|
}
|
|
320
|
-
/** @nocollapse */
|
|
321
|
-
/** @nocollapse */
|
|
320
|
+
/** @nocollapse */ DaffLocalStorageService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffLocalStorageService, deps: [{ token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
321
|
+
/** @nocollapse */ DaffLocalStorageService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffLocalStorageService, providedIn: 'root' });
|
|
322
322
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffLocalStorageService, decorators: [{
|
|
323
323
|
type: Injectable,
|
|
324
324
|
args: [{
|
|
@@ -344,8 +344,8 @@ class DaffNoopStorageService {
|
|
|
344
344
|
removeItem(key) { }
|
|
345
345
|
;
|
|
346
346
|
}
|
|
347
|
-
/** @nocollapse */
|
|
348
|
-
/** @nocollapse */
|
|
347
|
+
/** @nocollapse */ DaffNoopStorageService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffNoopStorageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
348
|
+
/** @nocollapse */ DaffNoopStorageService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffNoopStorageService, providedIn: 'root' });
|
|
349
349
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffNoopStorageService, decorators: [{
|
|
350
350
|
type: Injectable,
|
|
351
351
|
args: [{
|
|
@@ -403,8 +403,8 @@ class DaffServerBase64Service {
|
|
|
403
403
|
return Buffer.from(str, 'base64').toString('ascii');
|
|
404
404
|
}
|
|
405
405
|
}
|
|
406
|
-
/** @nocollapse */
|
|
407
|
-
/** @nocollapse */
|
|
406
|
+
/** @nocollapse */ DaffServerBase64Service.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffServerBase64Service, deps: [{ token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
407
|
+
/** @nocollapse */ DaffServerBase64Service.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffServerBase64Service, providedIn: 'root' });
|
|
408
408
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffServerBase64Service, decorators: [{
|
|
409
409
|
type: Injectable,
|
|
410
410
|
args: [{
|
|
@@ -433,8 +433,8 @@ class DaffBrowserBase64Service {
|
|
|
433
433
|
return atob(str);
|
|
434
434
|
}
|
|
435
435
|
}
|
|
436
|
-
/** @nocollapse */
|
|
437
|
-
/** @nocollapse */
|
|
436
|
+
/** @nocollapse */ DaffBrowserBase64Service.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffBrowserBase64Service, deps: [{ token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
437
|
+
/** @nocollapse */ DaffBrowserBase64Service.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffBrowserBase64Service, providedIn: 'root' });
|
|
438
438
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffBrowserBase64Service, decorators: [{
|
|
439
439
|
type: Injectable,
|
|
440
440
|
args: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-core.mjs","sources":["../../../libs/core/src/utils/long-arithmetic.ts","../../../libs/core/src/utils/range.ts","../../../libs/core/src/utils/shuffle.ts","../../../libs/core/src/utils/random-subset.ts","../../../libs/core/src/utils/random-slice.ts","../../../libs/core/src/utils/array-to-dict.ts","../../../libs/core/src/utils/sample.ts","../../../libs/core/src/utils/unique.ts","../../../libs/core/src/errors/inheritable-error.ts","../../../libs/core/src/errors/is-error.ts","../../../libs/core/src/storage/error/error.ts","../../../libs/core/src/storage/error/error.service.ts","../../../libs/core/src/storage/server-error/server-error.ts","../../../libs/core/src/storage/server-error/server-error.service.ts","../../../libs/core/src/storage/localstorage/localstorage.service.ts","../../../libs/core/src/storage/noopstorage/noopstorage.service.ts","../../../libs/core/src/storage/persistence.interface.ts","../../../libs/core/src/storage/persistence-server-safe.token.ts","../../../libs/core/src/operators/backoff.pipe.ts","../../../libs/core/src/base64/server/server.service.ts","../../../libs/core/src/base64/browser/browser.service.ts","../../../libs/core/src/base64/base64.interface.ts","../../../libs/core/src/collection/sortable.ts","../../../libs/core/src/collection/page-out-of-bounds.error.ts","../../../libs/core/src/collection/error-map.ts","../../../libs/core/src/collection/build-metadata.ts","../../../libs/core/src/collection/build-request.ts","../../../libs/core/src/identifiable/array-to-dict.ts","../../../libs/core/src/daffodil-core.ts"],"sourcesContent":["/**\n * A helper function to get the number of decimal significant figures of a number.\n * This function will fail if the given number has more than 16 significant figures or\n * the value of the number is greater than 10^11\n *\n * @param number\n */\nfunction daffPrecision(number: number): number {\n let p = 10000;\n if(number === undefined || number === null) {\n return p;\n }\n while (Math.round(number * p) / p !== number) {\n p *= 10;\n }\n return p;\n}\n\n/**\n * A function to add long numbers accurately with conversions and integer math.\n * This function only guarantees correct answers when the numbers given and the result are less than\n * 16 significant figures and less than 10^11\n *\n * @param numbers\n */\nexport function daffAdd(...numbers: number[]): number {\n if(numbers.length < 2) {\n throw new Error('Provide at least 2 numbers for daffAdd.');\n }\n const precision = Math.max(...numbers.map(daffPrecision));\n return numbers.reduce((acc, number) => acc + Math.round(number*precision), 0) / precision;\n}\n\n/**\n * A function to subtract long numbers accurately with conversions and integer math.\n * This function only guarantees correct answers when the numbers given and the result are each less than\n * 16 significant figures and less than 10^11\n *\n * @param numbers\n */\nexport function daffSubtract(...numbers: number[]): number {\n if(numbers.length < 2) {\n throw new Error('Provide at least 2 numbers for daffSubtract.');\n }\n const precision = Math.max(...numbers.map(daffPrecision));\n return numbers.slice(1).reduce(\n (acc, number) => acc - Math.round(number*precision),\n Math.round(numbers[0]*precision),\n ) / precision;\n}\n\n/**\n * A function to multiply long numbers accurately with conversions and integer math.\n * This function only guarantees correct answers when the numbers given and the result are each less than 16 significant figures\n * and less than 10^11\n *\n * @param numbers\n */\nexport function daffMultiply(...numbers: number[]): number {\n if(numbers.length < 2) {\n throw new Error('Provide at least 2 numbers for daffMultiply.');\n }\n const precision = Math.max(...numbers.map(daffPrecision));\n return numbers.reduce(\n (acc, number) => acc * Math.round(number*precision),\n 1,\n ) / Math.pow(precision, numbers.length);\n}\n\n/**\n * A function to divide long numbers accurately with conversions and integer math.\n * This function only guarantees correct answers when the numbers given and the result are each less than 16 significant figures\n * and less than 10^11\n *\n * Returns NaN when attempting to use NaN as an input.\n * Returns NaN when attempting to divide by 0 or null.\n *\n * @param numbers\n */\nexport function daffDivide(...numbers: number[]): number {\n if(numbers.length < 2) {\n throw new Error('Provide at least 2 numbers for daffDivide.');\n }\n // TODO(griest024): use better condition after IE support is dropped\n const illegalOperation = numbers.filter(isNaN).length > 0\n || numbers.slice(1).filter(n => n === 0 || n === null).length > 0;\n if (illegalOperation) {\n return NaN;\n }\n const precision = Math.max(...numbers.map(daffPrecision));\n return numbers.slice(1).reduce(\n (acc, number) => acc / Math.round(number*precision),\n Math.round(numbers[0]*precision),\n ) * Math.pow(precision, numbers.length - 2);\n}\n","/**\n * Range\n *\n * Range accepts two inputs, a `start` and an `end`\n * and returns an array filled with numbers from\n * `start` to `end`.\n *\n * @param start\n * @param end\n * @returns number\n */\nexport const range = (start: number, end: number): Array<number> =>\n Array.apply(null, Array(end - start + 1)).map((val, index) => index + start);\n\n","/**\n * Immutable Fisher-Yates Shuffle\n * https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle\n */\nexport const shuffle = <T>(array: T[]): T[] => {\n const result = [];\n array.forEach((el, i) => {\n const s = Math.floor(Math.random() * i);\n if( s !== i ){\n result[i] = result[s];\n }\n result[s] = el;\n });\n return result;\n};\n","import { shuffle } from './shuffle';\n\n/**\n * Returns a random subset of an array in a random order.\n *\n * @param array\n * @param length\n */\nexport const randomSubset = <T>(array: T[], length?: number): T[] => {\n if(length > array.length){\n throw new Error('Requested length is longer than array length.');\n }\n length = length ? length : Math.floor(Math.random() * array.length);\n return shuffle(array).slice(0, length);\n};\n","/**\n * Returns a random slice of an array.\n * An optional length may be specified.\n *\n * @param array\n */\nexport const randomSlice = <T>(array: T[], length?: number): T[] => {\n if(array.length === 0) {\n return [];\n };\n if(length > array.length) {\n throw new Error('Requested length is longer than array length.');\n }\n const arrayLength = length || Math.floor(Math.random() * array.length);\n const start = Math.floor(Math.random() * (array.length - arrayLength + 1));\n const end = start + arrayLength;\n return array.slice(start, end);\n};\n","type Dictionary = Record<string | number | symbol, any>;\n\n/**\n * Converts an array into a dictionary.\n * Dictionary values are keyed by the return of the specified `getKey`.\n */\nexport const daffArrayToDict = <T extends Dictionary>(array: T[], getKey: (val: T) => keyof Dictionary): Record<keyof Dictionary, T> =>\n array.reduce(\n (dict, val) => {\n dict[getKey(val)] = val;\n return dict;\n },\n {},\n );\n","import { randomSlice } from './random-slice';\n\n/**\n * Returns a random element of an array.\n */\nexport const sample = <T>(array: T[]): T => randomSlice(array, 1)[0];\n","/**\n * Filters an array of elements, removing duplicates.\n * Does not guarantee order of filtered elements.\n *\n * An optional comparator function may be passed for arbitrary comparison behavior.\n * The default is a strict equality comparison: `a === b`.\n */\nexport const unique = <T>(array: T[], comparator: (a: T, b: T) => boolean = (a, b) => a === b): T[] =>\n array.filter((a, index) => array.slice(index + 1).filter(b => comparator(a, b)).length === 0);\n","/**\n * A class which allows you to appropriately check the inheritance of an error.\n *\n * In typescript, when you try to extend an error with a specialized error class,\n * if you try to call something like:\n *\n * ```ts\n * class MyError extends Error {}\n *\n * let myError = new MyError();\n *\n * myError instanceof MyError; // returns false\n * ```\n *\n * You will see unexpected things. This class fixes that issue as described here\n * https://github.com/microsoft/TypeScript/issues/13965\n */\nexport class DaffInheritableError extends Error {\n __proto__: Error;\n\n recoverable = false;\n\n constructor(message?: string) {\n\t super(message);\n\t const trueProto = new.target.prototype;\n\n\t Object.setPrototypeOf(this, trueProto);\n }\n}\n","import { DaffError } from './error.interface';\nimport { DaffInheritableError } from './inheritable-error';\n\n/**\n * Checks if the passed object is a {@link DaffError}\n */\nexport const daffIsError = (error: any): boolean =>\n error instanceof DaffInheritableError || !!(<DaffError>error).code;\n","import {\n DaffError,\n DaffInheritableError,\n} from '../../errors/public_api';\n\nexport class DaffStorageServiceError extends DaffInheritableError implements DaffError {\n public readonly code: string = 'DAFF_STORAGE_FAILURE';\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import { Injectable } from '@angular/core';\n\nimport { DaffPersistenceService } from '../persistence.interface';\nimport { DaffStorageServiceError } from './error';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffErrorStorageService implements DaffPersistenceService {\n static readonly ERROR_MESSAGE = 'The DaffErrorStorageService always throws an error.';\n\n setItem(key: string, value: any): void {\n this.throwError();\n }\n\n getItem(key: string): any {\n this.throwError();\n }\n\n removeItem(key: string): any {\n this.throwError();\n }\n\n clear(){\n this.throwError();\n }\n\n private throwError() {\n throw new DaffStorageServiceError(DaffErrorStorageService.ERROR_MESSAGE);\n }\n}\n","import { DaffError } from '../../errors/public_api';\nimport { DaffStorageServiceError } from '../error/error';\n\n/**\n * An error thrown when there is an attempt to access storage on the server and none is available.\n */\nexport class DaffServerSideStorageError extends DaffStorageServiceError implements DaffError {\n public readonly code: string = 'DAFF_SERVER_STORAGE_FAILURE';\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import { Injectable } from '@angular/core';\n\nimport { DaffPersistenceService } from '../persistence.interface';\nimport { DaffServerSideStorageError } from './server-error';\n\n/**\n * A storage service meant to be loaded into SSR contexts.\n * It will always throw the {@link DaffServerSideStorageError}.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffServerErrorStorageService implements DaffPersistenceService {\n static readonly ERROR_MESSAGE = 'The DaffServerErrorStorageService always throws an error.';\n\n setItem(key: string, value: any): void {\n this.throwError();\n }\n\n getItem(key: string): any {\n this.throwError();\n }\n\n removeItem(key: string): any {\n this.throwError();\n }\n\n clear(){\n this.throwError();\n }\n\n private throwError() {\n throw new DaffServerSideStorageError(DaffServerErrorStorageService.ERROR_MESSAGE);\n }\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n Injectable,\n Inject,\n PLATFORM_ID,\n} from '@angular/core';\n\nimport { DaffPersistenceService } from '../persistence.interface';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffLocalStorageService implements DaffPersistenceService {\n constructor(@Inject(PLATFORM_ID) platformId: string){\n if(!isPlatformBrowser(platformId)){\n throw new Error('The DaffLocalStorageService can only be instantiated in the browser.');\n }\n }\n\n /**\n * Persist the given item into local storage.\n */\n setItem(key: string, value: any): void {\n localStorage.setItem(key, value);\n }\n\n /**\n * Retrieve the given item from localstorage.\n */\n getItem(key: string): any {\n return localStorage.getItem(key);\n }\n\n /**\n * Remove a given item from localstorage\n */\n removeItem(key: string): any {\n localStorage.removeItem(key);\n }\n\n clear(){\n localStorage.clear();\n }\n}\n","import { Injectable } from '@angular/core';\n\nimport { DaffPersistenceService } from '../persistence.interface';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffNoopStorageService implements DaffPersistenceService {\n setItem(key: string, value: any): void {};\n getItem(key: string): any {};\n clear(): void {};\n removeItem(key: string): void {};\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n InjectionToken,\n inject,\n PLATFORM_ID,\n} from '@angular/core';\n\nimport { DaffLocalStorageService } from './localstorage/localstorage.service';\nimport { DaffServerErrorStorageService } from './server-error/public_api';\n\nexport interface DaffPersistenceService {\n setItem(key: string, value: any): void;\n getItem(key: string): any;\n clear(): void;\n removeItem(key: string): void;\n}\n\nexport const DaffPersistenceServiceToken = new InjectionToken<DaffPersistenceService>('DaffPersistenceService', {\n providedIn: 'root',\n factory: () => isPlatformBrowser(inject<string>(PLATFORM_ID))\n ? new DaffLocalStorageService(inject<string>(PLATFORM_ID))\n : new DaffServerErrorStorageService(),\n});\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n InjectionToken,\n inject,\n PLATFORM_ID,\n} from '@angular/core';\n\nimport { DaffNoopStorageService } from './noopstorage/noopstorage.service';\nimport {\n DaffPersistenceService,\n DaffPersistenceServiceToken,\n} from './persistence.interface';\n\n/**\n * Provides noop for the persistence service on the server.\n */\nexport const DaffServerSafePersistenceServiceToken = new InjectionToken<\nDaffPersistenceService\n>('DaffServerSafePersistenceService', {\n providedIn: 'root',\n factory: () =>\n isPlatformBrowser(inject<string>(PLATFORM_ID))\n ? inject<DaffPersistenceService>(DaffPersistenceServiceToken)\n : inject<DaffPersistenceService>(DaffNoopStorageService),\n});\n","import {\n pipe,\n timer,\n throwError,\n} from 'rxjs';\nimport {\n retryWhen,\n mergeMap,\n} from 'rxjs/operators';\n\n/**\n * Retries failed Observables\n *\n * @param maxTries The maximum number of tries the observable will be tried\n * @param ms The initial amount of time\n */\nexport function backoff(maxTries: number, ms: number) {\n return pipe(\n retryWhen(attempt => attempt.pipe(\n mergeMap((shadowedAttempt: Error, i) => {\n if(i >= maxTries) {\n return throwError(shadowedAttempt);\n }\n return timer(ms*Math.pow(2,i));\n }),\n )),\n );\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n Inject,\n Injectable,\n PLATFORM_ID,\n} from '@angular/core';\n\nimport { DaffBase64Service } from '../base64.interface';\n\ndeclare const Buffer;\n\n/**\n * A base64 service meant to be loaded into SSR contexts.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffServerBase64Service implements DaffBase64Service {\n constructor(@Inject(PLATFORM_ID) platformId: string){\n if (isPlatformBrowser(platformId)){\n throw new Error('The DaffBrowserBase64Service can only be instantiated on the server.');\n }\n }\n\n encode(str: string): string {\n return Buffer.from(str).toString('base64');\n }\n\n decode(str: string): string {\n return Buffer.from(str, 'base64').toString('ascii');\n }\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n Injectable,\n Inject,\n PLATFORM_ID,\n} from '@angular/core';\n\nimport { DaffBase64Service } from '../base64.interface';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffBrowserBase64Service implements DaffBase64Service {\n constructor(@Inject(PLATFORM_ID) platformId: string){\n if(!isPlatformBrowser(platformId)){\n throw new Error('The DaffBrowserBase64Service can only be instantiated in the browser.');\n }\n }\n\n encode(str: string): string {\n return btoa(str);\n }\n\n decode(str: string): string {\n return atob(str);\n }\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n InjectionToken,\n inject,\n PLATFORM_ID,\n} from '@angular/core';\n\nimport { DaffBrowserBase64Service } from './browser/browser.service';\nimport { DaffServerBase64Service } from './server/public_api';\n\n/**\n * A service for encoding and decoding base64 strings.\n */\nexport interface DaffBase64Service {\n /**\n * Encodes an ASCII string to base64.\n */\n encode(str: string): string;\n /**\n * Decodes a base64 string to ASCII.\n */\n decode(str: string): string;\n}\n\n/**\n * A token which creates a base64 service appropriate for the current environment, i.e., browser vs. server.\n */\nexport const DaffBase64ServiceToken = new InjectionToken<DaffBase64Service>('DaffBase64Service', {\n providedIn: 'root',\n factory: () => isPlatformBrowser(inject<string>(PLATFORM_ID))\n ? new DaffBrowserBase64Service(inject<string>(PLATFORM_ID))\n : new DaffServerBase64Service(inject<string>(PLATFORM_ID)),\n});\n","/**\n * The metadata that describes the sorting behavior of a collection of elements.\n */\nexport interface DaffSortOptions {\n default: DaffSortOption['value'];\n options: DaffSortOption[];\n}\n\n\n/**\n * One particular option used to sort a collection of elements;\n */\nexport interface DaffSortOption {\n label: string;\n value: any;\n}\n\n/**\n * The direction in which to sort a list of elements, e.g. if the list was\n * sorted alphabetically, \"Ascending\" would be from \"A-Z\",\n * and \"Descending\" would be from \"Z-A\".\n */\nexport enum DaffSortDirectionEnum {\n Ascending = 'ASC',\n Descending = 'DSC'\n}\n\n/**\n * Describes the properties of a collection that make the collection able to be\n * sorted by Daffodil.\n */\nexport interface DaffSortable {\n\n /**\n * The available options by which to sort the collection.\n */\n sortOptions: DaffSortOptions;\n\n /**\n * The currently applied sorting option.\n */\n appliedSortOption: DaffSortOption['value'];\n\n /**\n * The currently applied sort direction.\n */\n appliedSortDirection: DaffSortDirectionEnum;\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '../errors/public_api';\n\nexport const DAFF_COLLECTION_PAGE_OUT_OF_BOUNDS_ERROR_CODE = 'DAFF_COLLECTION_PAGE_OUT_OF_BOUNDS';\n\n/**\n * An error thrown when the requested page is greater than the number of available pages.\n */\nexport class DaffCollectionPageOutOfBoundsError extends DaffInheritableError implements DaffError {\n public readonly code: string = DAFF_COLLECTION_PAGE_OUT_OF_BOUNDS_ERROR_CODE;\n\n constructor(message?: string) {\n\t super(message);\n }\n}\n","import {\n DaffCollectionPageOutOfBoundsError,\n DAFF_COLLECTION_PAGE_OUT_OF_BOUNDS_ERROR_CODE,\n} from './page-out-of-bounds.error';\n\nexport const daffCollectionErrorMap = {\n [DAFF_COLLECTION_PAGE_OUT_OF_BOUNDS_ERROR_CODE]: DaffCollectionPageOutOfBoundsError,\n};\n","import { DaffCollectionMetadata } from './metadata.interface';\nimport { DaffCollectionRequest } from './request.interface';\n\ntype MetadataRequestIntersection = keyof DaffCollectionMetadata & keyof DaffCollectionRequest;\n\nconst allowedMetadataKeys: MetadataRequestIntersection[] = [\n 'appliedSortOption',\n 'appliedSortDirection',\n 'currentPage',\n 'pageSize',\n];\n\n/**\n * Extracts the part of the {@link DaffCollectionRequest} that can be directly set in {@link DaffCollectionMetadata}.\n */\nexport const daffCollectionBuildMetadataFromRequest = (request: DaffCollectionRequest): Partial<DaffCollectionMetadata> =>\n allowedMetadataKeys.reduce(<K extends MetadataRequestIntersection>(acc: Partial<DaffCollectionMetadata>, key: K) => {\n if (request[key]) {\n acc[key] = request[key];\n }\n return acc;\n }, <Partial<DaffCollectionMetadata>>{});\n","import { DaffCollectionMetadata } from './metadata.interface';\nimport { DaffCollectionRequest } from './request.interface';\n\n/**\n * Builds a {@link DaffCollectionRequest} from {@link DaffCollectionMetadata}.\n */\nexport const daffCollectionBuildRequestFromMetadata = (metadata: DaffCollectionMetadata): Partial<DaffCollectionRequest> => ({\n appliedSortOption: metadata.appliedSortOption,\n appliedSortDirection: metadata.appliedSortDirection,\n currentPage: metadata.currentPage,\n pageSize: metadata.pageSize,\n});\n","import { daffArrayToDict } from '../utils/public_api';\nimport { DaffIdentifiable } from './identifiable.interface';\n\n/**\n * Transforms an array of {@link DaffIdentifiable} objects to a dictionary of those objects keyed by ID.\n */\nexport const daffIdentifiableArrayToDict = <T extends DaffIdentifiable = DaffIdentifiable>(ary: T[]): Record<T['id'], T> =>\n daffArrayToDict(ary, ({ id }) => id);\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAAA;;;;;;AAMG;AACH,SAAS,aAAa,CAAC,MAAc,EAAA;IACnC,IAAI,CAAC,GAAG,KAAK,CAAC;AACd,IAAA,IAAG,MAAM,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AAI,CAAA,IAAA,GAAW,6CAA6C,CAAC;KAI5E;AACF;;ACXY,MAAA,sBAAsB,GAAG;IACpC,CAAC,6CAA6C,GAAG,kCAAkC;;;ACDrF,MAAM,mBAAmB,GAAkC;IACzD,mBAAmB;IACnB,sBAAsB;IACtB,aAAa;IACb,UAAU;CACX,CAAC;AAEF;;AAEG;AACU,MAAA,sCAAsC,GAAG,CAAC,OAA8B,KACnF,mBAAmB,CAAC,MAAM,CAAC,CAAwC,GAAoC,EAAE,GAAM,KAAI;AACjH,IAAA,IAAI,OAAO,CAAC,GAAG,CAAC,EAAE;QAChB,GAAG,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;AACzB,KAAA;AACD,IAAA,OAAO,GAAG,CAAC;AACb,CAAC,EAAmC,EAAE;;AClBxC;;AAEG;MACU,sCAAsC,GAAG,CAAC,QAAgC,MAAsC;IAC3H,iBAAiB,EAAE,QAAQ,CAAC,iBAAiB;IAC7C,oBAAoB,EAAE,QAAQ,CAAC,oBAAoB;IACnD,WAAW,EAAE,QAAQ,CAAC,WAAW;IACjC,QAAQ,EAAE,QAAQ,CAAC,QAAQ;AAC5B,CAAA;;ACRD;;AAEG;MACU,2BAA2B,GAAG,CAAgD,GAAQ,KACjG,eAAe,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE;;ACPrC;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"daffodil-core.mjs","sources":["../../../libs/core/src/utils/long-arithmetic.ts","../../../libs/core/src/utils/range.ts","../../../libs/core/src/utils/shuffle.ts","../../../libs/core/src/utils/random-subset.ts","../../../libs/core/src/utils/random-slice.ts","../../../libs/core/src/utils/array-to-dict.ts","../../../libs/core/src/utils/sample.ts","../../../libs/core/src/utils/unique.ts","../../../libs/core/src/errors/inheritable-error.ts","../../../libs/core/src/errors/is-error.ts","../../../libs/core/src/storage/error/error.ts","../../../libs/core/src/storage/error/error.service.ts","../../../libs/core/src/storage/server-error/server-error.ts","../../../libs/core/src/storage/server-error/server-error.service.ts","../../../libs/core/src/storage/localstorage/localstorage.service.ts","../../../libs/core/src/storage/noopstorage/noopstorage.service.ts","../../../libs/core/src/storage/persistence.interface.ts","../../../libs/core/src/storage/persistence-server-safe.token.ts","../../../libs/core/src/operators/backoff.pipe.ts","../../../libs/core/src/base64/server/server.service.ts","../../../libs/core/src/base64/browser/browser.service.ts","../../../libs/core/src/base64/base64.interface.ts","../../../libs/core/src/collection/sortable.ts","../../../libs/core/src/collection/page-out-of-bounds.error.ts","../../../libs/core/src/collection/error-map.ts","../../../libs/core/src/collection/build-metadata.ts","../../../libs/core/src/collection/build-request.ts","../../../libs/core/src/identifiable/array-to-dict.ts","../../../libs/core/src/daffodil-core.ts"],"sourcesContent":["/**\n * A helper function to get the number of decimal significant figures of a number.\n * This function will fail if the given number has more than 16 significant figures or\n * the value of the number is greater than 10^11\n *\n * @param number\n */\nfunction daffPrecision(number: number): number {\n let p = 10000;\n if(number === undefined || number === null) {\n return p;\n }\n while (Math.round(number * p) / p !== number) {\n p *= 10;\n }\n return p;\n}\n\n/**\n * A function to add long numbers accurately with conversions and integer math.\n * This function only guarantees correct answers when the numbers given and the result are less than\n * 16 significant figures and less than 10^11\n *\n * @param numbers\n */\nexport function daffAdd(...numbers: number[]): number {\n if(numbers.length < 2) {\n throw new Error('Provide at least 2 numbers for daffAdd.');\n }\n const precision = Math.max(...numbers.map(daffPrecision));\n return numbers.reduce((acc, number) => acc + Math.round(number*precision), 0) / precision;\n}\n\n/**\n * A function to subtract long numbers accurately with conversions and integer math.\n * This function only guarantees correct answers when the numbers given and the result are each less than\n * 16 significant figures and less than 10^11\n *\n * @param numbers\n */\nexport function daffSubtract(...numbers: number[]): number {\n if(numbers.length < 2) {\n throw new Error('Provide at least 2 numbers for daffSubtract.');\n }\n const precision = Math.max(...numbers.map(daffPrecision));\n return numbers.slice(1).reduce(\n (acc, number) => acc - Math.round(number*precision),\n Math.round(numbers[0]*precision),\n ) / precision;\n}\n\n/**\n * A function to multiply long numbers accurately with conversions and integer math.\n * This function only guarantees correct answers when the numbers given and the result are each less than 16 significant figures\n * and less than 10^11\n *\n * @param numbers\n */\nexport function daffMultiply(...numbers: number[]): number {\n if(numbers.length < 2) {\n throw new Error('Provide at least 2 numbers for daffMultiply.');\n }\n const precision = Math.max(...numbers.map(daffPrecision));\n return numbers.reduce(\n (acc, number) => acc * Math.round(number*precision),\n 1,\n ) / Math.pow(precision, numbers.length);\n}\n\n/**\n * A function to divide long numbers accurately with conversions and integer math.\n * This function only guarantees correct answers when the numbers given and the result are each less than 16 significant figures\n * and less than 10^11\n *\n * Returns NaN when attempting to use NaN as an input.\n * Returns NaN when attempting to divide by 0 or null.\n *\n * @param numbers\n */\nexport function daffDivide(...numbers: number[]): number {\n if(numbers.length < 2) {\n throw new Error('Provide at least 2 numbers for daffDivide.');\n }\n // TODO(griest024): use better condition after IE support is dropped\n const illegalOperation = numbers.filter(isNaN).length > 0\n || numbers.slice(1).filter(n => n === 0 || n === null).length > 0;\n if (illegalOperation) {\n return NaN;\n }\n const precision = Math.max(...numbers.map(daffPrecision));\n return numbers.slice(1).reduce(\n (acc, number) => acc / Math.round(number*precision),\n Math.round(numbers[0]*precision),\n ) * Math.pow(precision, numbers.length - 2);\n}\n","/**\n * Range\n *\n * Range accepts two inputs, a `start` and an `end`\n * and returns an array filled with numbers from\n * `start` to `end`.\n *\n * @param start\n * @param end\n * @returns number\n */\nexport const range = (start: number, end: number): Array<number> =>\n Array.apply(null, Array(end - start + 1)).map((val, index) => index + start);\n\n","/**\n * Immutable Fisher-Yates Shuffle\n * https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle\n */\nexport const shuffle = <T>(array: T[]): T[] => {\n const result = [];\n array.forEach((el, i) => {\n const s = Math.floor(Math.random() * i);\n if( s !== i ){\n result[i] = result[s];\n }\n result[s] = el;\n });\n return result;\n};\n","import { shuffle } from './shuffle';\n\n/**\n * Returns a random subset of an array in a random order.\n *\n * @param array\n * @param length\n */\nexport const randomSubset = <T>(array: T[], length?: number): T[] => {\n if(length > array.length){\n throw new Error('Requested length is longer than array length.');\n }\n length = length ? length : Math.floor(Math.random() * array.length);\n return shuffle(array).slice(0, length);\n};\n","/**\n * Returns a random slice of an array.\n * An optional length may be specified.\n *\n * @param array\n */\nexport const randomSlice = <T>(array: T[], length?: number): T[] => {\n if(array.length === 0) {\n return [];\n };\n if(length > array.length) {\n throw new Error('Requested length is longer than array length.');\n }\n const arrayLength = length || Math.floor(Math.random() * array.length);\n const start = Math.floor(Math.random() * (array.length - arrayLength + 1));\n const end = start + arrayLength;\n return array.slice(start, end);\n};\n","type Dictionary = Record<string | number | symbol, any>;\n\n/**\n * Converts an array into a dictionary.\n * Dictionary values are keyed by the return of the specified `getKey`.\n */\nexport const daffArrayToDict = <T extends Dictionary>(array: T[], getKey: (val: T) => keyof Dictionary): Record<keyof Dictionary, T> =>\n array.reduce(\n (dict, val) => {\n dict[getKey(val)] = val;\n return dict;\n },\n {},\n );\n","import { randomSlice } from './random-slice';\n\n/**\n * Returns a random element of an array.\n */\nexport const sample = <T>(array: T[]): T => randomSlice(array, 1)[0];\n","/**\n * Filters an array of elements, removing duplicates.\n * Does not guarantee order of filtered elements.\n *\n * An optional comparator function may be passed for arbitrary comparison behavior.\n * The default is a strict equality comparison: `a === b`.\n */\nexport const unique = <T>(array: T[], comparator: (a: T, b: T) => boolean = (a, b) => a === b): T[] =>\n array.filter((a, index) => array.slice(index + 1).filter(b => comparator(a, b)).length === 0);\n","/**\n * A class which allows you to appropriately check the inheritance of an error.\n *\n * In typescript, when you try to extend an error with a specialized error class,\n * if you try to call something like:\n *\n * ```ts\n * class MyError extends Error {}\n *\n * let myError = new MyError();\n *\n * myError instanceof MyError; // returns false\n * ```\n *\n * You will see unexpected things. This class fixes that issue as described here\n * https://github.com/microsoft/TypeScript/issues/13965\n */\nexport class DaffInheritableError extends Error {\n __proto__: Error;\n\n recoverable = false;\n\n constructor(message?: string) {\n\t super(message);\n\t const trueProto = new.target.prototype;\n\n\t Object.setPrototypeOf(this, trueProto);\n }\n}\n","import { DaffError } from './error.interface';\nimport { DaffInheritableError } from './inheritable-error';\n\n/**\n * Checks if the passed object is a {@link DaffError}\n */\nexport const daffIsError = (error: any): boolean =>\n error instanceof DaffInheritableError || !!(<DaffError>error).code;\n","import {\n DaffError,\n DaffInheritableError,\n} from '../../errors/public_api';\n\nexport class DaffStorageServiceError extends DaffInheritableError implements DaffError {\n public readonly code: string = 'DAFF_STORAGE_FAILURE';\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import { Injectable } from '@angular/core';\n\nimport { DaffPersistenceService } from '../persistence.interface';\nimport { DaffStorageServiceError } from './error';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffErrorStorageService implements DaffPersistenceService {\n static readonly ERROR_MESSAGE = 'The DaffErrorStorageService always throws an error.';\n\n setItem(key: string, value: any): void {\n this.throwError();\n }\n\n getItem(key: string): any {\n this.throwError();\n }\n\n removeItem(key: string): any {\n this.throwError();\n }\n\n clear(){\n this.throwError();\n }\n\n private throwError() {\n throw new DaffStorageServiceError(DaffErrorStorageService.ERROR_MESSAGE);\n }\n}\n","import { DaffError } from '../../errors/public_api';\nimport { DaffStorageServiceError } from '../error/error';\n\n/**\n * An error thrown when there is an attempt to access storage on the server and none is available.\n */\nexport class DaffServerSideStorageError extends DaffStorageServiceError implements DaffError {\n public readonly code: string = 'DAFF_SERVER_STORAGE_FAILURE';\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import { Injectable } from '@angular/core';\n\nimport { DaffPersistenceService } from '../persistence.interface';\nimport { DaffServerSideStorageError } from './server-error';\n\n/**\n * A storage service meant to be loaded into SSR contexts.\n * It will always throw the {@link DaffServerSideStorageError}.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffServerErrorStorageService implements DaffPersistenceService {\n static readonly ERROR_MESSAGE = 'The DaffServerErrorStorageService always throws an error.';\n\n setItem(key: string, value: any): void {\n this.throwError();\n }\n\n getItem(key: string): any {\n this.throwError();\n }\n\n removeItem(key: string): any {\n this.throwError();\n }\n\n clear(){\n this.throwError();\n }\n\n private throwError() {\n throw new DaffServerSideStorageError(DaffServerErrorStorageService.ERROR_MESSAGE);\n }\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n Injectable,\n Inject,\n PLATFORM_ID,\n} from '@angular/core';\n\nimport { DaffPersistenceService } from '../persistence.interface';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffLocalStorageService implements DaffPersistenceService {\n constructor(@Inject(PLATFORM_ID) platformId: string){\n if(!isPlatformBrowser(platformId)){\n throw new Error('The DaffLocalStorageService can only be instantiated in the browser.');\n }\n }\n\n /**\n * Persist the given item into local storage.\n */\n setItem(key: string, value: any): void {\n localStorage.setItem(key, value);\n }\n\n /**\n * Retrieve the given item from localstorage.\n */\n getItem(key: string): any {\n return localStorage.getItem(key);\n }\n\n /**\n * Remove a given item from localstorage\n */\n removeItem(key: string): any {\n localStorage.removeItem(key);\n }\n\n clear(){\n localStorage.clear();\n }\n}\n","import { Injectable } from '@angular/core';\n\nimport { DaffPersistenceService } from '../persistence.interface';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffNoopStorageService implements DaffPersistenceService {\n setItem(key: string, value: any): void {};\n getItem(key: string): any {};\n clear(): void {};\n removeItem(key: string): void {};\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n InjectionToken,\n inject,\n PLATFORM_ID,\n} from '@angular/core';\n\nimport { DaffLocalStorageService } from './localstorage/localstorage.service';\nimport { DaffServerErrorStorageService } from './server-error/public_api';\n\nexport interface DaffPersistenceService {\n setItem(key: string, value: any): void;\n getItem(key: string): any;\n clear(): void;\n removeItem(key: string): void;\n}\n\nexport const DaffPersistenceServiceToken = new InjectionToken<DaffPersistenceService>('DaffPersistenceService', {\n providedIn: 'root',\n factory: () => isPlatformBrowser(inject<string>(PLATFORM_ID))\n ? new DaffLocalStorageService(inject<string>(PLATFORM_ID))\n : new DaffServerErrorStorageService(),\n});\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n InjectionToken,\n inject,\n PLATFORM_ID,\n} from '@angular/core';\n\nimport { DaffNoopStorageService } from './noopstorage/noopstorage.service';\nimport {\n DaffPersistenceService,\n DaffPersistenceServiceToken,\n} from './persistence.interface';\n\n/**\n * Provides noop for the persistence service on the server.\n */\nexport const DaffServerSafePersistenceServiceToken = new InjectionToken<\nDaffPersistenceService\n>('DaffServerSafePersistenceService', {\n providedIn: 'root',\n factory: () =>\n isPlatformBrowser(inject<string>(PLATFORM_ID))\n ? inject<DaffPersistenceService>(DaffPersistenceServiceToken)\n : inject<DaffPersistenceService>(DaffNoopStorageService),\n});\n","import {\n pipe,\n timer,\n throwError,\n} from 'rxjs';\nimport {\n retryWhen,\n mergeMap,\n} from 'rxjs/operators';\n\n/**\n * Retries failed Observables\n *\n * @param maxTries The maximum number of tries the observable will be tried\n * @param ms The initial amount of time\n */\nexport function backoff(maxTries: number, ms: number) {\n return pipe(\n retryWhen(attempt => attempt.pipe(\n mergeMap((shadowedAttempt: Error, i) => {\n if(i >= maxTries) {\n return throwError(shadowedAttempt);\n }\n return timer(ms*Math.pow(2,i));\n }),\n )),\n );\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n Inject,\n Injectable,\n PLATFORM_ID,\n} from '@angular/core';\n\nimport { DaffBase64Service } from '../base64.interface';\n\ndeclare const Buffer;\n\n/**\n * A base64 service meant to be loaded into SSR contexts.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffServerBase64Service implements DaffBase64Service {\n constructor(@Inject(PLATFORM_ID) platformId: string){\n if (isPlatformBrowser(platformId)){\n throw new Error('The DaffBrowserBase64Service can only be instantiated on the server.');\n }\n }\n\n encode(str: string): string {\n return Buffer.from(str).toString('base64');\n }\n\n decode(str: string): string {\n return Buffer.from(str, 'base64').toString('ascii');\n }\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n Injectable,\n Inject,\n PLATFORM_ID,\n} from '@angular/core';\n\nimport { DaffBase64Service } from '../base64.interface';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffBrowserBase64Service implements DaffBase64Service {\n constructor(@Inject(PLATFORM_ID) platformId: string){\n if(!isPlatformBrowser(platformId)){\n throw new Error('The DaffBrowserBase64Service can only be instantiated in the browser.');\n }\n }\n\n encode(str: string): string {\n return btoa(str);\n }\n\n decode(str: string): string {\n return atob(str);\n }\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n InjectionToken,\n inject,\n PLATFORM_ID,\n} from '@angular/core';\n\nimport { DaffBrowserBase64Service } from './browser/browser.service';\nimport { DaffServerBase64Service } from './server/public_api';\n\n/**\n * A service for encoding and decoding base64 strings.\n */\nexport interface DaffBase64Service {\n /**\n * Encodes an ASCII string to base64.\n */\n encode(str: string): string;\n /**\n * Decodes a base64 string to ASCII.\n */\n decode(str: string): string;\n}\n\n/**\n * A token which creates a base64 service appropriate for the current environment, i.e., browser vs. server.\n */\nexport const DaffBase64ServiceToken = new InjectionToken<DaffBase64Service>('DaffBase64Service', {\n providedIn: 'root',\n factory: () => isPlatformBrowser(inject<string>(PLATFORM_ID))\n ? new DaffBrowserBase64Service(inject<string>(PLATFORM_ID))\n : new DaffServerBase64Service(inject<string>(PLATFORM_ID)),\n});\n","/**\n * The metadata that describes the sorting behavior of a collection of elements.\n */\nexport interface DaffSortOptions {\n default: DaffSortOption['value'];\n options: DaffSortOption[];\n}\n\n\n/**\n * One particular option used to sort a collection of elements;\n */\nexport interface DaffSortOption {\n label: string;\n value: any;\n}\n\n/**\n * The direction in which to sort a list of elements, e.g. if the list was\n * sorted alphabetically, \"Ascending\" would be from \"A-Z\",\n * and \"Descending\" would be from \"Z-A\".\n */\nexport enum DaffSortDirectionEnum {\n Ascending = 'ASC',\n Descending = 'DSC'\n}\n\n/**\n * Describes the properties of a collection that make the collection able to be\n * sorted by Daffodil.\n */\nexport interface DaffSortable {\n\n /**\n * The available options by which to sort the collection.\n */\n sortOptions: DaffSortOptions;\n\n /**\n * The currently applied sorting option.\n */\n appliedSortOption: DaffSortOption['value'];\n\n /**\n * The currently applied sort direction.\n */\n appliedSortDirection: DaffSortDirectionEnum;\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '../errors/public_api';\n\nexport const DAFF_COLLECTION_PAGE_OUT_OF_BOUNDS_ERROR_CODE = 'DAFF_COLLECTION_PAGE_OUT_OF_BOUNDS';\n\n/**\n * An error thrown when the requested page is greater than the number of available pages.\n */\nexport class DaffCollectionPageOutOfBoundsError extends DaffInheritableError implements DaffError {\n public readonly code: string = DAFF_COLLECTION_PAGE_OUT_OF_BOUNDS_ERROR_CODE;\n\n constructor(message?: string) {\n\t super(message);\n }\n}\n","import {\n DaffCollectionPageOutOfBoundsError,\n DAFF_COLLECTION_PAGE_OUT_OF_BOUNDS_ERROR_CODE,\n} from './page-out-of-bounds.error';\n\nexport const daffCollectionErrorMap = {\n [DAFF_COLLECTION_PAGE_OUT_OF_BOUNDS_ERROR_CODE]: DaffCollectionPageOutOfBoundsError,\n};\n","import { DaffCollectionMetadata } from './metadata.interface';\nimport { DaffCollectionRequest } from './request.interface';\n\ntype MetadataRequestIntersection = keyof DaffCollectionMetadata & keyof DaffCollectionRequest;\n\nconst allowedMetadataKeys: MetadataRequestIntersection[] = [\n 'appliedSortOption',\n 'appliedSortDirection',\n 'currentPage',\n 'pageSize',\n];\n\n/**\n * Extracts the part of the {@link DaffCollectionRequest} that can be directly set in {@link DaffCollectionMetadata}.\n */\nexport const daffCollectionBuildMetadataFromRequest = (request: DaffCollectionRequest): Partial<DaffCollectionMetadata> =>\n allowedMetadataKeys.reduce(<K extends MetadataRequestIntersection>(acc: Partial<DaffCollectionMetadata>, key: K) => {\n if (request[key]) {\n acc[key] = request[key];\n }\n return acc;\n }, <Partial<DaffCollectionMetadata>>{});\n","import { DaffCollectionMetadata } from './metadata.interface';\nimport { DaffCollectionRequest } from './request.interface';\n\n/**\n * Builds a {@link DaffCollectionRequest} from {@link DaffCollectionMetadata}.\n */\nexport const daffCollectionBuildRequestFromMetadata = (metadata: DaffCollectionMetadata): Partial<DaffCollectionRequest> => ({\n appliedSortOption: metadata.appliedSortOption,\n appliedSortDirection: metadata.appliedSortDirection,\n currentPage: metadata.currentPage,\n pageSize: metadata.pageSize,\n});\n","import { daffArrayToDict } from '../utils/public_api';\nimport { DaffIdentifiable } from './identifiable.interface';\n\n/**\n * Transforms an array of {@link DaffIdentifiable} objects to a dictionary of those objects keyed by ID.\n */\nexport const daffIdentifiableArrayToDict = <T extends DaffIdentifiable = DaffIdentifiable>(ary: T[]): Record<T['id'], T> =>\n daffArrayToDict(ary, ({ id }) => id);\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAAA;;;;;;AAMG;AACH,SAAS,aAAa,CAAC,MAAc,EAAA;IACnC,IAAI,CAAC,GAAG,KAAK,CAAC;AACd,IAAA,IAAG,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,IAAI,EAAE;AAC1C,QAAA,OAAO,CAAC,CAAC;AACV,KAAA;AACD,IAAA,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,MAAM,EAAE;QAC5C,CAAC,IAAI,EAAE,CAAC;AACT,KAAA;AACD,IAAA,OAAO,CAAC,CAAC;AACX,CAAC;AAED;;;;;;AAMG;AACa,SAAA,OAAO,CAAC,GAAG,OAAiB,EAAA;AAC1C,IAAA,IAAG,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE;AACrB,QAAA,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;AAC5D,KAAA;AACD,IAAA,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,a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,GAAG,CAAC,QAAgC,MAAsC;IAC3H,iBAAiB,EAAE,QAAQ,CAAC,iBAAiB;IAC7C,oBAAoB,EAAE,QAAQ,CAAC,oBAAoB;IACnD,WAAW,EAAE,QAAQ,CAAC,WAAW;IACjC,QAAQ,EAAE,QAAQ,CAAC,QAAQ;AAC5B,CAAA;;ACRD;;AAEG;MACU,2BAA2B,GAAG,CAAgD,GAAQ,KACjG,eAAe,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE;;ACPrC;;AAEG;;;;"}
|
|
@@ -79,8 +79,8 @@ class DaffQueuedApollo {
|
|
|
79
79
|
this.queue[0]?.();
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
|
-
/** @nocollapse */
|
|
83
|
-
/** @nocollapse */
|
|
82
|
+
/** @nocollapse */ DaffQueuedApollo.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffQueuedApollo, deps: [{ token: i1.Apollo }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
83
|
+
/** @nocollapse */ DaffQueuedApollo.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffQueuedApollo, providedIn: 'root' });
|
|
84
84
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffQueuedApollo, decorators: [{
|
|
85
85
|
type: Injectable,
|
|
86
86
|
args: [{
|
|
@@ -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/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 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 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 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":";;;;;;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,CAAC;AAEJ;;;;;AAKG;AACH,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;;;;;;AAMG;AACU,MAAA,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;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,CAAC;;AAGH,QAAA,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;AAC3B,YAAA,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;AACjB,SAAA;KACF;AAEO,IAAA,yBAAyB,CAAC,mBAAiC,EAAA;QACjE,mBAAmB,CAAC,WAAW,EAAE,CAAC;;AAGlC,QAAA,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;AACnB,QAAA,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;KACnB;;
|
|
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/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 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 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 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":";;;;;;AAO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AA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,cAFf,MAAM,EAAA,CAAA,CAAA;2FAEP,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAH5B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA,CAAA;;;ACpBD;;AAEG;;;;"}
|
|
@@ -67,8 +67,8 @@ class DaffRoutingUriNormalizer {
|
|
|
67
67
|
return this.urlParser.serialize(urlTree);
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
/** @nocollapse */
|
|
71
|
-
/** @nocollapse */
|
|
70
|
+
/** @nocollapse */ DaffRoutingUriNormalizer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffRoutingUriNormalizer, deps: [{ token: i1.UrlSerializer }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
71
|
+
/** @nocollapse */ DaffRoutingUriNormalizer.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffRoutingUriNormalizer, providedIn: 'root' });
|
|
72
72
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffRoutingUriNormalizer, decorators: [{
|
|
73
73
|
type: Injectable,
|
|
74
74
|
args: [{
|