@daffodil/core 0.39.13 → 0.42.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/base64/browser/browser.service.d.ts +3 -0
- package/base64/server/server.service.d.ts +3 -0
- package/daffodil-core.d.ts +1 -0
- package/{esm2015/address/address.js → esm2020/address/address.mjs} +0 -0
- package/{esm2015/base64/base64.interface.js → esm2020/base64/base64.interface.mjs} +0 -0
- package/esm2020/base64/browser/browser.service.mjs +31 -0
- package/{esm2015/base64/public_api.js → esm2020/base64/public_api.mjs} +0 -0
- package/{esm2015/base64/server/public_api.js → esm2020/base64/server/public_api.mjs} +0 -0
- package/esm2020/base64/server/server.service.mjs +33 -0
- package/{esm2015/canonically-locateable/canonically-locateable.interface.js → esm2020/canonically-locateable/canonically-locateable.interface.mjs} +0 -0
- package/{esm2015/constructable/constructable.js → esm2020/constructable/constructable.mjs} +0 -0
- package/{esm2015/daffodil-core.js → esm2020/daffodil-core.mjs} +0 -0
- package/{esm2015/errors/error-map.js → esm2020/errors/error-map.mjs} +1 -1
- package/{esm2015/errors/error.interface.js → esm2020/errors/error.interface.mjs} +0 -0
- package/{esm2015/errors/inheritable-error.js → esm2020/errors/inheritable-error.mjs} +1 -1
- package/{esm2015/errors/is-error.js → esm2020/errors/is-error.mjs} +0 -0
- package/{esm2015/errors/public_api.js → esm2020/errors/public_api.mjs} +0 -0
- package/{esm2015/graphql/apollo/cacheable-operations/cacheable-operations-link.interface.js → esm2020/graphql/apollo/cacheable-operations/cacheable-operations-link.interface.mjs} +1 -1
- package/{esm2015/graphql/apollo/public_api.js → esm2020/graphql/apollo/public_api.mjs} +0 -0
- package/esm2020/graphql/apollo/queued-apollo/queued-apollo.service.mjs +64 -0
- package/{esm2015/graphql/daffodil-core-graphql.js → esm2020/graphql/daffodil-core-graphql.mjs} +0 -0
- package/{esm2015/graphql/fragments/build-fragment-definition.js → esm2020/graphql/fragments/build-fragment-definition.mjs} +0 -0
- package/esm2020/graphql/fragments/build-fragment-name-spread.mjs +18 -0
- package/{esm2015/graphql/fragments/public_api.js → esm2020/graphql/fragments/public_api.mjs} +0 -0
- package/{esm2015/graphql/index.js → esm2020/graphql/index.mjs} +0 -0
- package/{esm2015/graphql/public_api.js → esm2020/graphql/public_api.mjs} +0 -0
- package/{esm2015/identifiable/identifiable.interface.js → esm2020/identifiable/identifiable.interface.mjs} +0 -0
- package/{esm2015/index.js → esm2020/index.mjs} +0 -0
- package/{esm2015/kindable/kindable.interface.js → esm2020/kindable/kindable.interface.mjs} +0 -0
- package/{esm2015/kindable/public_api.js → esm2020/kindable/public_api.mjs} +0 -0
- package/{esm2015/locateable/locateable.interface.js → esm2020/locateable/locateable.interface.mjs} +0 -0
- package/{esm2015/operators/backoff.pipe.js → esm2020/operators/backoff.pipe.mjs} +0 -0
- package/{esm2015/operators/public_api.js → esm2020/operators/public_api.mjs} +0 -0
- package/{esm2015/orderable/orderable.js → esm2020/orderable/orderable.mjs} +1 -1
- package/{esm2015/public_api.js → esm2020/public_api.mjs} +0 -0
- package/{esm2015/routing/daffodil-core-routing.js → esm2020/routing/daffodil-core-routing.mjs} +0 -0
- package/{esm2015/routing/index.js → esm2020/routing/index.mjs} +0 -0
- package/{esm2015/routing/public_api.js → esm2020/routing/public_api.mjs} +0 -0
- package/esm2020/routing/uri/normalizer.service.mjs +38 -0
- package/{esm2015/routing/uri/public_api.js → esm2020/routing/uri/public_api.mjs} +0 -0
- package/esm2020/routing/uri/truncation/file-extension.mjs +10 -0
- package/{esm2015/routing/uri/truncation/leading-path-segments.js → esm2020/routing/uri/truncation/leading-path-segments.mjs} +0 -0
- package/esm2020/routing/uri/truncation/leading-slash.mjs +12 -0
- package/{esm2015/routing/uri/truncation/public_api.js → esm2020/routing/uri/truncation/public_api.mjs} +0 -0
- package/{esm2015/routing/uri/truncation/query-fragment.js → esm2020/routing/uri/truncation/query-fragment.mjs} +0 -0
- package/{esm2015/state/collection/paginable.js → esm2020/state/collection/paginable.mjs} +0 -0
- package/{esm2015/state/collection/public_api.js → esm2020/state/collection/public_api.mjs} +0 -0
- package/{esm2015/state/collection/sortable.js → esm2020/state/collection/sortable.mjs} +0 -0
- package/{esm2015/state/daffodil-core-state.js → esm2020/state/daffodil-core-state.mjs} +0 -0
- package/{esm2015/state/errors/public_api.js → esm2020/state/errors/public_api.mjs} +0 -0
- package/{esm2015/state/errors/state-error.interface.js → esm2020/state/errors/state-error.interface.mjs} +0 -0
- package/{esm2015/state/errors/transform-error-to-state-error.js → esm2020/state/errors/transform-error-to-state-error.mjs} +0 -0
- package/{esm2015/state/index.js → esm2020/state/index.mjs} +0 -0
- package/{esm2015/state/operators/public_api.js → esm2020/state/operators/public_api.mjs} +0 -0
- package/esm2020/state/operators/substream.pipe.mjs +42 -0
- package/{esm2015/state/public_api.js → esm2020/state/public_api.mjs} +0 -0
- package/{esm2015/state/reducers/create-meta.js → esm2020/state/reducers/create-meta.mjs} +0 -0
- package/{esm2015/state/reducers/public_api.js → esm2020/state/reducers/public_api.mjs} +0 -0
- package/{esm2015/state/states/loading.js → esm2020/state/states/loading.mjs} +0 -0
- package/{esm2015/state/states/mutable-loading.js → esm2020/state/states/mutable-loading.mjs} +0 -0
- package/{esm2015/state/states/public_api.js → esm2020/state/states/public_api.mjs} +0 -0
- package/{esm2015/state/states/state.enum.js → esm2020/state/states/state.enum.mjs} +0 -0
- package/{esm2015/state/states/stateable.interface.js → esm2020/state/states/stateable.interface.mjs} +0 -0
- package/{esm2015/state/store/facade.js → esm2020/state/store/facade.mjs} +0 -0
- package/{esm2015/storage/error/error.js → esm2020/storage/error/error.mjs} +0 -0
- package/esm2020/storage/error/error.service.mjs +33 -0
- package/{esm2015/storage/error/public_api.js → esm2020/storage/error/public_api.mjs} +0 -0
- package/esm2020/storage/localstorage/localstorage.service.mjs +46 -0
- package/esm2020/storage/noopstorage/noopstorage.service.mjs +24 -0
- package/esm2020/storage/persistence-server-safe.token.mjs +14 -0
- package/{esm2015/storage/persistence.interface.js → esm2020/storage/persistence.interface.mjs} +0 -0
- package/esm2020/storage/public_api.mjs +7 -0
- package/{esm2015/storage/server-error/public_api.js → esm2020/storage/server-error/public_api.mjs} +0 -0
- package/{esm2015/storage/server-error/server-error.js → esm2020/storage/server-error/server-error.mjs} +0 -0
- package/esm2020/storage/server-error/server-error.service.mjs +36 -0
- package/esm2020/testing/address/factories/address.factory.mjs +38 -0
- package/{esm2015/testing/angular/interfaces/in-memory-data-service.interface.js → esm2020/testing/angular/interfaces/in-memory-data-service.interface.mjs} +1 -1
- package/esm2020/testing/angular/mocks/pipes/currency.mjs +19 -0
- package/{esm2015/testing/daffodil-core-testing.js → esm2020/testing/daffodil-core-testing.mjs} +0 -0
- package/{esm2015/testing/factories/factory.interface.js → esm2020/testing/factories/factory.interface.mjs} +1 -1
- package/esm2020/testing/factories/factory.mjs +54 -0
- package/{esm2015/testing/index.js → esm2020/testing/index.mjs} +0 -0
- package/esm2020/testing/testing.module.mjs +17 -0
- package/{esm2015/types/dict.type.js → esm2020/types/dict.type.mjs} +0 -0
- package/{esm2015/types/id.type.js → esm2020/types/id.type.mjs} +0 -0
- package/{esm2015/types/public_api.js → esm2020/types/public_api.mjs} +0 -0
- package/{esm2015/utils/array-to-dict.js → esm2020/utils/array-to-dict.mjs} +0 -0
- package/{esm2015/utils/long-arithmetic.js → esm2020/utils/long-arithmetic.mjs} +0 -0
- package/{esm2015/utils/public_api.js → esm2020/utils/public_api.mjs} +0 -0
- package/{esm2015/utils/random-slice.js → esm2020/utils/random-slice.mjs} +0 -0
- package/{esm2015/utils/random-subset.js → esm2020/utils/random-subset.mjs} +0 -0
- package/{esm2015/utils/range.js → esm2020/utils/range.mjs} +0 -0
- package/{esm2015/utils/sample.js → esm2020/utils/sample.mjs} +0 -0
- package/{esm2015/utils/shuffle.js → esm2020/utils/shuffle.mjs} +0 -0
- package/{esm2015/utils/unique.js → esm2020/utils/unique.mjs} +0 -0
- package/fesm2015/{daffodil-core-graphql.js → daffodil-core-graphql.mjs} +12 -14
- package/fesm2015/daffodil-core-graphql.mjs.map +1 -0
- package/fesm2015/{daffodil-core-routing.js → daffodil-core-routing.mjs} +13 -13
- package/fesm2015/daffodil-core-routing.mjs.map +1 -0
- package/fesm2015/{daffodil-core-state.js → daffodil-core-state.mjs} +2 -3
- package/fesm2015/daffodil-core-state.mjs.map +1 -0
- package/fesm2015/daffodil-core-testing.mjs +128 -0
- package/fesm2015/daffodil-core-testing.mjs.map +1 -0
- package/fesm2015/daffodil-core.mjs +465 -0
- package/fesm2015/daffodil-core.mjs.map +1 -0
- package/fesm2020/daffodil-core-graphql.mjs +96 -0
- package/fesm2020/daffodil-core-graphql.mjs.map +1 -0
- package/fesm2020/daffodil-core-routing.mjs +84 -0
- package/fesm2020/daffodil-core-routing.mjs.map +1 -0
- package/fesm2020/daffodil-core-state.mjs +74 -0
- package/fesm2020/daffodil-core-state.mjs.map +1 -0
- package/fesm2020/daffodil-core-testing.mjs +131 -0
- package/fesm2020/daffodil-core-testing.mjs.map +1 -0
- package/{fesm2015/daffodil-core.js → fesm2020/daffodil-core.mjs} +71 -51
- package/fesm2020/daffodil-core.mjs.map +1 -0
- package/graphql/apollo/queued-apollo/queued-apollo.service.d.ts +4 -2
- package/graphql/daffodil-core-graphql.d.ts +1 -0
- package/graphql/package.json +5 -6
- package/package.json +59 -15
- package/routing/daffodil-core-routing.d.ts +1 -0
- package/routing/package.json +5 -6
- package/routing/uri/normalizer.service.d.ts +3 -0
- package/state/daffodil-core-state.d.ts +1 -0
- package/state/package.json +5 -6
- package/storage/error/error.service.d.ts +3 -0
- package/storage/localstorage/localstorage.service.d.ts +3 -0
- package/storage/noopstorage/noopstorage.service.d.ts +3 -0
- package/storage/persistence-server-safe.token.d.ts +6 -0
- package/storage/public_api.d.ts +1 -0
- package/storage/server-error/server-error.service.d.ts +3 -0
- package/testing/address/factories/address.factory.d.ts +3 -0
- package/testing/angular/mocks/pipes/currency.d.ts +3 -0
- package/testing/daffodil-core-testing.d.ts +1 -0
- package/testing/package.json +5 -6
- package/testing/testing.module.d.ts +5 -0
- package/utils/array-to-dict.d.ts +1 -1
- package/bundles/daffodil-core-graphql.umd.js +0 -445
- package/bundles/daffodil-core-graphql.umd.js.map +0 -1
- package/bundles/daffodil-core-graphql.umd.min.js +0 -16
- package/bundles/daffodil-core-graphql.umd.min.js.map +0 -1
- package/bundles/daffodil-core-routing.umd.js +0 -100
- package/bundles/daffodil-core-routing.umd.js.map +0 -1
- package/bundles/daffodil-core-routing.umd.min.js +0 -2
- package/bundles/daffodil-core-routing.umd.min.js.map +0 -1
- package/bundles/daffodil-core-state.umd.js +0 -405
- package/bundles/daffodil-core-state.umd.js.map +0 -1
- package/bundles/daffodil-core-state.umd.min.js +0 -16
- package/bundles/daffodil-core-state.umd.min.js.map +0 -1
- package/bundles/daffodil-core-testing.umd.js +0 -466
- package/bundles/daffodil-core-testing.umd.js.map +0 -1
- package/bundles/daffodil-core-testing.umd.min.js +0 -16
- package/bundles/daffodil-core-testing.umd.min.js.map +0 -1
- package/bundles/daffodil-core.umd.js +0 -829
- package/bundles/daffodil-core.umd.js.map +0 -1
- package/bundles/daffodil-core.umd.min.js +0 -16
- package/bundles/daffodil-core.umd.min.js.map +0 -1
- package/daffodil-core.metadata.json +0 -1
- package/esm2015/base64/browser/browser.service.js +0 -30
- package/esm2015/base64/server/server.service.js +0 -32
- package/esm2015/graphql/apollo/queued-apollo/queued-apollo.service.js +0 -67
- package/esm2015/graphql/fragments/build-fragment-name-spread.js +0 -20
- package/esm2015/routing/uri/normalizer.service.js +0 -40
- package/esm2015/routing/uri/truncation/file-extension.js +0 -10
- package/esm2015/routing/uri/truncation/leading-slash.js +0 -12
- package/esm2015/state/operators/substream.pipe.js +0 -44
- package/esm2015/storage/error/error.service.js +0 -31
- package/esm2015/storage/localstorage/localstorage.service.js +0 -45
- package/esm2015/storage/noopstorage/noopstorage.service.js +0 -22
- package/esm2015/storage/public_api.js +0 -6
- package/esm2015/storage/server-error/server-error.service.js +0 -34
- package/esm2015/testing/address/factories/address.factory.js +0 -38
- package/esm2015/testing/angular/mocks/pipes/currency.js +0 -15
- package/esm2015/testing/factories/factory.js +0 -51
- package/esm2015/testing/testing.module.js +0 -12
- package/fesm2015/daffodil-core-graphql.js.map +0 -1
- package/fesm2015/daffodil-core-routing.js.map +0 -1
- package/fesm2015/daffodil-core-state.js.map +0 -1
- package/fesm2015/daffodil-core-testing.js +0 -120
- package/fesm2015/daffodil-core-testing.js.map +0 -1
- package/fesm2015/daffodil-core.js.map +0 -1
- package/graphql/daffodil-core-graphql.metadata.json +0 -1
- package/routing/daffodil-core-routing.metadata.json +0 -1
- package/state/daffodil-core-state.metadata.json +0 -1
- package/testing/daffodil-core-testing.metadata.json +0 -1
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* @inheritdoc
|
|
5
|
+
*/
|
|
6
|
+
export class DaffNoopStorageService {
|
|
7
|
+
setItem(key, value) { }
|
|
8
|
+
;
|
|
9
|
+
getItem(key) { }
|
|
10
|
+
;
|
|
11
|
+
clear() { }
|
|
12
|
+
;
|
|
13
|
+
removeItem(key) { }
|
|
14
|
+
;
|
|
15
|
+
}
|
|
16
|
+
/** @nocollapse */ /** @nocollapse */ DaffNoopStorageService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffNoopStorageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
17
|
+
/** @nocollapse */ /** @nocollapse */ DaffNoopStorageService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffNoopStorageService, providedIn: 'root' });
|
|
18
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffNoopStorageService, decorators: [{
|
|
19
|
+
type: Injectable,
|
|
20
|
+
args: [{
|
|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k5vb3BTdG9yYWdlU2VydmljZSBpbXBsZW1lbnRzIERhZmZQZXJzaXN0ZW5jZVNlcnZpY2Uge1xuICBzZXRJdGVtKGtleTogc3RyaW5nLCB2YWx1ZTogYW55KTogdm9pZCB7fTtcbiAgZ2V0SXRlbShrZXk6IHN0cmluZyk6IGFueSB7fTtcbiAgY2xlYXIoKTogdm9pZCB7fTtcbiAgcmVtb3ZlSXRlbShrZXk6IHN0cmluZyk6IHZvaWQge307XG59XG4iXX0=
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { isPlatformBrowser } from '@angular/common';
|
|
2
|
+
import { InjectionToken, inject, PLATFORM_ID, } from '@angular/core';
|
|
3
|
+
import { DaffNoopStorageService } from './noopstorage/noopstorage.service';
|
|
4
|
+
import { DaffPersistenceServiceToken, } from './persistence.interface';
|
|
5
|
+
/**
|
|
6
|
+
* Provides noop for the persistence service on the server.
|
|
7
|
+
*/
|
|
8
|
+
export const DaffServerSafePersistenceServiceToken = new InjectionToken('DaffServerSafePersistenceService', {
|
|
9
|
+
providedIn: 'root',
|
|
10
|
+
factory: () => isPlatformBrowser(inject(PLATFORM_ID))
|
|
11
|
+
? inject(DaffPersistenceServiceToken)
|
|
12
|
+
: inject(DaffNoopStorageService),
|
|
13
|
+
});
|
|
14
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGVyc2lzdGVuY2Utc2VydmVyLXNhZmUudG9rZW4uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9saWJzL2NvcmUvc3JjL3N0b3JhZ2UvcGVyc2lzdGVuY2Utc2VydmVyLXNhZmUudG9rZW4udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLGlCQUFpQixFQUFFLE1BQU0saUJBQWlCLENBQUM7QUFDcEQsT0FBTyxFQUNMLGNBQWMsRUFDZCxNQUFNLEVBQ04sV0FBVyxHQUNa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JzaXN0ZW5jZVNlcnZpY2VUb2tlbiA9IG5ldyBJbmplY3Rpb25Ub2tlbjxcbkRhZmZQZXJzaXN0ZW5jZVNlcnZpY2Vcbj4oJ0RhZmZTZXJ2ZXJTYWZlUGVyc2lzdGVuY2VTZXJ2aWNlJywge1xuICBwcm92aWRlZEluOiAncm9vdCcsXG4gIGZhY3Rvcnk6ICgpID0+XG4gICAgaXNQbGF0Zm9ybUJyb3dzZXIoaW5qZWN0PHN0cmluZz4oUExBVEZPUk1fSUQpKVxuICAgICAgPyBpbmplY3Q8RGFmZlBlcnNpc3RlbmNlU2VydmljZT4oRGFmZlBlcnNpc3RlbmNlU2VydmljZVRva2VuKVxuICAgICAgOiBpbmplY3Q8RGFmZlBlcnNpc3RlbmNlU2VydmljZT4oRGFmZk5vb3BTdG9yYWdlU2VydmljZSksXG59KTtcbiJdfQ==
|
package/{esm2015/storage/persistence.interface.js → esm2020/storage/persistence.interface.mjs}
RENAMED
|
File without changes
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './error/public_api';
|
|
2
|
+
export * from './server-error/public_api';
|
|
3
|
+
export { DaffLocalStorageService } from './localstorage/localstorage.service';
|
|
4
|
+
export { DaffNoopStorageService } from './noopstorage/noopstorage.service';
|
|
5
|
+
export { DaffPersistenceServiceToken, } from './persistence.interface';
|
|
6
|
+
export { DaffServerSafePersistenceServiceToken } from './persistence-server-safe.token';
|
|
7
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYnMvY29yZS9zcmMvc3RvcmFnZS9wdWJsaWNfYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsb0JBQW9CLENBQUM7QUFDbkMsY0FBYywyQkFBMkIsQ0FBQztBQUMxQyxPQUFPLEVBQUUsdUJBQXVCLEVBQUUsTUFBTSxxQ0FBcUMsQ0FBQztBQUM5RSxPQUFPLEVBQUUsc0JBQXNCLEVBQUUsTUFBTSxtQ0FBbUMsQ0FBQztBQUMzRSxPQUFPLEVBRUwsMkJBQTJCLEdBQzVCLE1BQU0seUJBQXlCLENBQUM7QUFDakMsT0FBTyxFQUFFLHFDQUFxQyxFQUFFLE1BQU0saUNBQWlDLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tICcuL2Vycm9yL3B1YmxpY19hcGknO1xuZXhwb3J0ICogZnJvbSAnLi9zZXJ2ZXItZXJyb3IvcHVibGljX2FwaSc7XG5leHBvcnQgeyBEYWZmTG9jYWxTdG9yYWdlU2VydmljZSB9IGZyb20gJy4vbG9jYWxzdG9yYWdlL2xvY2Fsc3RvcmFnZS5zZXJ2aWNlJztcbmV4cG9ydCB7IERhZmZOb29wU3RvcmFnZVNlcnZpY2UgfSBmcm9tICcuL25vb3BzdG9yYWdlL25vb3BzdG9yYWdlLnNlcnZpY2UnO1xuZXhwb3J0IHtcbiAgRGFmZlBlcnNpc3RlbmNlU2VydmljZSxcbiAgRGFmZlBlcnNpc3RlbmNlU2VydmljZVRva2VuLFxufSBmcm9tICcuL3BlcnNpc3RlbmNlLmludGVyZmFjZSc7XG5leHBvcnQgeyBEYWZmU2VydmVyU2FmZVBlcnNpc3RlbmNlU2VydmljZVRva2VuIH0gZnJvbSAnLi9wZXJzaXN0ZW5jZS1zZXJ2ZXItc2FmZS50b2tlbic7XG4iXX0=
|
package/{esm2015/storage/server-error/public_api.js → esm2020/storage/server-error/public_api.mjs}
RENAMED
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
import { DaffServerSideStorageError } from './server-error';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* A storage service meant to be loaded into SSR contexts.
|
|
6
|
+
* It will always throw the {@link DaffServerSideStorageError}.
|
|
7
|
+
*
|
|
8
|
+
* @inheritdoc
|
|
9
|
+
*/
|
|
10
|
+
export class DaffServerErrorStorageService {
|
|
11
|
+
setItem(key, value) {
|
|
12
|
+
this.throwError();
|
|
13
|
+
}
|
|
14
|
+
getItem(key) {
|
|
15
|
+
this.throwError();
|
|
16
|
+
}
|
|
17
|
+
removeItem(key) {
|
|
18
|
+
this.throwError();
|
|
19
|
+
}
|
|
20
|
+
clear() {
|
|
21
|
+
this.throwError();
|
|
22
|
+
}
|
|
23
|
+
throwError() {
|
|
24
|
+
throw new DaffServerSideStorageError(DaffServerErrorStorageService.ERROR_MESSAGE);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
DaffServerErrorStorageService.ERROR_MESSAGE = 'The DaffServerErrorStorageService always throws an error.';
|
|
28
|
+
/** @nocollapse */ /** @nocollapse */ DaffServerErrorStorageService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffServerErrorStorageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
29
|
+
/** @nocollapse */ /** @nocollapse */ DaffServerErrorStorageService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffServerErrorStorageService, providedIn: 'root' });
|
|
30
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffServerErrorStorageService, decorators: [{
|
|
31
|
+
type: Injectable,
|
|
32
|
+
args: [{
|
|
33
|
+
providedIn: 'root',
|
|
34
|
+
}]
|
|
35
|
+
}] });
|
|
36
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VydmVyLWVycm9yLnNlcnZpY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9saWJzL2NvcmUvc3JjL3N0b3JhZ2Uvc2VydmVyLWVyc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
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
import * as faker from '@faker-js/faker/locale/en_US';
|
|
3
|
+
import { DaffModelFactory } from '../../factories/factory';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated
|
|
7
|
+
* Prefer the `MockDaffAddress` of daffodil/geography/testing`
|
|
8
|
+
*/
|
|
9
|
+
export class MockDaffAddress {
|
|
10
|
+
constructor() {
|
|
11
|
+
this.firstname = faker.name.firstName();
|
|
12
|
+
this.lastname = faker.name.lastName();
|
|
13
|
+
this.street = faker.address.streetName();
|
|
14
|
+
this.city = faker.address.city();
|
|
15
|
+
this.state = faker.address.stateAbbr();
|
|
16
|
+
this.email = faker.internet.email();
|
|
17
|
+
this.postcode = faker.address.zipCode();
|
|
18
|
+
this.telephone = faker.phone.phoneNumber();
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* @deprecated
|
|
23
|
+
* Prefer the `DaffAddressFactory` of `daffodil/geography/testing`
|
|
24
|
+
*/
|
|
25
|
+
export class DaffAddressFactory extends DaffModelFactory {
|
|
26
|
+
constructor() {
|
|
27
|
+
super(MockDaffAddress);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
/** @nocollapse */ /** @nocollapse */ DaffAddressFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffAddressFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
31
|
+
/** @nocollapse */ /** @nocollapse */ DaffAddressFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffAddressFactory, providedIn: 'root' });
|
|
32
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffAddressFactory, decorators: [{
|
|
33
|
+
type: Injectable,
|
|
34
|
+
args: [{
|
|
35
|
+
providedIn: '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SBmb3IgZGVmaW5pbmcgaW4gbWVtb3J5IHNlcnZpY2VzIHRoYXQgdXNlIHRoZSBhbmd1bGFyIGluIG1lbW9yeSB3ZWIgYXBpLlxuICovXG5leHBvcnQgaW50ZXJmYWNlIERhZmZJbk1lbW9yeURhdGFTZXJ2aWNlSW50ZXJmYWNlIHtcbiAgZ2V0PyhyZXFJbmZvOiBSZXF1ZXN0SW5mbyk6IE9ic2VydmFibGU8YW55PjtcbiAgcG9zdD8ocmVxSW5mbzogUmVxdWVzdEluZm8pOiBPYnNlcnZhYmxlPGFueT47XG4gIHB1dD8ocmVxSW5mbzogUmVxdWVzdEluZm8pOiBPYnNlcnZhYmxlPGFueT47XG4gIGRlbGV0ZT8ocmVxSW5mbzogUmVxdWVzdEluZm8pOiBPYnNlcnZhYmxlPGFueT47XG59XG4iXX0=
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Pipe, } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* @docs
|
|
5
|
+
* A mock CurrencyPipe that does nothing to a given input.
|
|
6
|
+
* This pipe is useful for asserting that a CurrencyPipe is in use via a spy,
|
|
7
|
+
* but ignoring the actual underlying implementation
|
|
8
|
+
*/
|
|
9
|
+
export class DaffMockCurrencyPipe {
|
|
10
|
+
transform(value) { }
|
|
11
|
+
;
|
|
12
|
+
}
|
|
13
|
+
/** @nocollapse */ /** @nocollapse */ DaffMockCurrencyPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffMockCurrencyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
14
|
+
/** @nocollapse */ /** @nocollapse */ DaffMockCurrencyPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffMockCurrencyPipe, name: "currency" });
|
|
15
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffMockCurrencyPipe, decorators: [{
|
|
16
|
+
type: Pipe,
|
|
17
|
+
args: [{ name: 'currency' }]
|
|
18
|
+
}] });
|
|
19
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY3VycmVuY3kuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9saWJzL2NvcmUvdGVzdGluZy9zcmMvYW5ndWxhci9tb2Nrcy9waXBlcy9jdXJyZW5jeS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQ0wsSUFBSSxHQUVMLE1BQU0sZUFBZSxDQUFDOztBQUV2Qjs7Ozs7R0FLRztBQUVILE1BQU0sT0FBTyxvQkFBb0I7SUFDL0IsU0FBUyxDQUFDLEtBQWEsSUFBRyxDQUFDO0lBQUEsQ0FBQzs7dUpBRGpCLG9CQUFvQjtxSkFBcEIsb0JBQW9COzJGQUFwQixvQkFBb0I7a0JBRGhDLElBQUk7bUJBQUMsRUFBRSxJQUFJLEVBQUUsVUFBVSxFQUFFIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHtcbiAgUGlwZSxcbiAgUGlwZVRyYW5zZm9ybSxcbn0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XG5cbi8qKlxuICogQGRvY3NcbiAqIEEgbW9jayBDdXJyZW5jeVBpcGUgdGhhdCBkb2VzIG5vdGhpbmcgdG8gYSBnaXZlbiBpbnB1dC5cbiAqIFRoaXMgcGlwZSBpcyB1c2VmdWwgZm9yIGFzc2VydGluZyB0aGF0IGEgQ3VycmVuY3lQaXBlIGlzIGluIHVzZSB2aWEgYSBzcHksXG4gKiBidXQgaWdub3JpbmcgdGhlIGFjdHVhbCB1bmRlcmx5aW5nIGltcGxlbWVudGF0aW9uXG4gKi9cbkBQaXBlKHsgbmFtZTogJ2N1cnJlbmN5JyB9KVxuZXhwb3J0IGNsYXNzIERhZmZNb2NrQ3VycmVuY3lQaXBlIGltcGxlbWVudHMgUGlwZVRyYW5zZm9ybSB7XG4gIHRyYW5zZm9ybSh2YWx1ZTogbnVtYmVyKSB7fTtcbn1cbiJdfQ==
|
package/{esm2015/testing/daffodil-core-testing.js → esm2020/testing/daffodil-core-testing.mjs}
RENAMED
|
File without changes
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export {};
|
|
2
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmFjdG9yeS5pbnRlcmZhY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9saWJzL2NvcmUvdGVzdGluZy9zcmMvZmFjdG9yaWVzL2ZhY3RvcnkuaW50ZXJmYWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgaW50ZXJmYWNlIElEYWZmTW9kZWxGYWN0b3J5PFQ+
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmFjdG9yeS5pbnRlcmZhY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9saWJzL2NvcmUvdGVzdGluZy9zcmMvZmFjdG9yaWVzL2ZhY3RvcnkuaW50ZXJmYWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgaW50ZXJmYWNlIElEYWZmTW9kZWxGYWN0b3J5PFQ+IHtcbiAgY3JlYXRlKHBhcnRpYWw6IFBhcnRpYWw8VD4pOiBUO1xuICBjcmVhdGVNYW55KHF0eTogbnVtYmVyLCBwYXJ0aWFsOiBQYXJ0aWFsPFQ+KTogVFtdO1xufVxuIl19
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { range, } from '@daffodil/core';
|
|
2
|
+
/**
|
|
3
|
+
* The base class for model factories.
|
|
4
|
+
*
|
|
5
|
+
* The mock class is passed as the first constructor arg
|
|
6
|
+
* and any additional args are passed to the mock class constructor.
|
|
7
|
+
*
|
|
8
|
+
* The constructor args can be omitted if the `create` method is overridden.
|
|
9
|
+
*
|
|
10
|
+
* The following example demonstrates using this feature to inject
|
|
11
|
+
* a different factory into a mock class.
|
|
12
|
+
*
|
|
13
|
+
* ```ts
|
|
14
|
+
* class MyMockModel {
|
|
15
|
+
* constructor(
|
|
16
|
+
* private otherFactory: MyOtherFactory
|
|
17
|
+
* ) {}
|
|
18
|
+
*
|
|
19
|
+
* private createOtherModel() {
|
|
20
|
+
* return this.otherFactory.create()
|
|
21
|
+
* }
|
|
22
|
+
*
|
|
23
|
+
* otherModel = this.createOtherModel()
|
|
24
|
+
* }
|
|
25
|
+
*
|
|
26
|
+
* @Injectable()
|
|
27
|
+
* class TestFactory extends DaffModelFactory<MyMockModel> {
|
|
28
|
+
* constructor(
|
|
29
|
+
* otherFactory: MyOtherFactory
|
|
30
|
+
* ) {
|
|
31
|
+
* super(MyMockModel, otherFactory)
|
|
32
|
+
* }
|
|
33
|
+
* }
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export class DaffModelFactory {
|
|
37
|
+
constructor(type, ...args) {
|
|
38
|
+
this.type = type;
|
|
39
|
+
this._instantiationArgs = args;
|
|
40
|
+
}
|
|
41
|
+
create(partial = {}) {
|
|
42
|
+
if (!this.type) {
|
|
43
|
+
throw new Error('`type` is required if `create` is not overriden.');
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
...new this.type(...this._instantiationArgs),
|
|
47
|
+
...partial,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
createMany(qty = 1, partial = {}) {
|
|
51
|
+
return range(0, qty - 1).map(() => this.create(partial));
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=data:application/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CwgcXR5IC0gMSkubWFwKCgpID0+IHRoaXMuY3JlYXRlKHBhcnRpYWwpKTtcbiAgfVxufVxuIl19
|
|
File without changes
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { DaffMockCurrencyPipe } from './angular/mocks/pipes/currency';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export class DaffCoreTestingModule {
|
|
5
|
+
}
|
|
6
|
+
/** @nocollapse */ /** @nocollapse */ DaffCoreTestingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffCoreTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
7
|
+
/** @nocollapse */ /** @nocollapse */ DaffCoreTestingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffCoreTestingModule, declarations: [DaffMockCurrencyPipe] });
|
|
8
|
+
/** @nocollapse */ /** @nocollapse */ DaffCoreTestingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffCoreTestingModule });
|
|
9
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffCoreTestingModule, decorators: [{
|
|
10
|
+
type: NgModule,
|
|
11
|
+
args: [{
|
|
12
|
+
declarations: [
|
|
13
|
+
DaffMockCurrencyPipe,
|
|
14
|
+
],
|
|
15
|
+
}]
|
|
16
|
+
}] });
|
|
17
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdGluZy5tb2R1bGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9saWJzL2NvcmUvdGVzdGluZy9zcmMvdGVzdGluZy5tb2R1bGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFFBQVEsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUV6QyxPQUFPLEVBQUUsb0JBQW9CLEVBQUUsTUFBTSxnQ0FBZ0MsQ0FBQzs7QUFPdEUsTUFBTSxPQUFPLHFCQUFxQjs7d0pBQXJCLHFCQUFxQjt5SkFBckIscUJBQXFCLGlCQUg5QixvQkFBb0I7eUpBR1gscUJBQXFCOzJGQUFyQixxQkFBcUI7a0JBTGpDLFFBQVE7bUJBQUM7b0JBQ1IsWUFBWSxFQUFFO3dCQUNaLG9CQUFvQjtxQkFDckI7aUJBQ0YiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBOZ01vZHVsZSB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuXG5pbXBvcnQgeyBEYWZmTW9ja0N1cnJlbmN5UGlwZSB9IGZyb20gJy4vYW5ndWxhci9tb2Nrcy9waXBlcy9jdXJyZW5jeSc7XG5cbkBOZ01vZHVsZSh7XG4gIGRlY2xhcmF0aW9uczogW1xuICAgIERhZmZNb2NrQ3VycmVuY3lQaXBlLFxuICBdLFxufSlcbmV4cG9ydCBjbGFzcyBEYWZmQ29yZVRlc3RpbmdNb2R1bGUge31cbiJdfQ==
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { unique } from '@daffodil/core';
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { Injectable } from '@angular/core';
|
|
4
4
|
import { Observable } from 'rxjs';
|
|
5
|
+
import * as i1 from 'apollo-angular';
|
|
5
6
|
|
|
6
7
|
const getFragmentNames = (fragment) => fragment.definitions.filter(def => def.kind === 'FragmentDefinition').map(def => def.name.value);
|
|
7
8
|
/**
|
|
@@ -11,7 +12,6 @@ const getFragmentNames = (fragment) => fragment.definitions.filter(def => def.ki
|
|
|
11
12
|
* @param fragments The created fragments.
|
|
12
13
|
*/
|
|
13
14
|
const daffGetFragmentNames = (...fragments) => fragments.reduce((acc, fragment) => acc.concat(getFragmentNames(fragment)), []);
|
|
14
|
-
const ɵ0 = daffGetFragmentNames;
|
|
15
15
|
/**
|
|
16
16
|
* Builds a string of fragment names that can be interpolated into a GraphQL query.
|
|
17
17
|
* Each name is separated by a newline character: '\n'.
|
|
@@ -80,20 +80,18 @@ class DaffQueuedApollo {
|
|
|
80
80
|
(_b = (_a = this.queue)[0]) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
|
-
/** @nocollapse */ DaffQueuedApollo.ɵ
|
|
84
|
-
DaffQueuedApollo
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
{ type: Apollo }
|
|
92
|
-
];
|
|
83
|
+
/** @nocollapse */ /** @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 });
|
|
84
|
+
/** @nocollapse */ /** @nocollapse */ DaffQueuedApollo.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffQueuedApollo, providedIn: 'root' });
|
|
85
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffQueuedApollo, decorators: [{
|
|
86
|
+
type: Injectable,
|
|
87
|
+
args: [{
|
|
88
|
+
providedIn: 'root',
|
|
89
|
+
}]
|
|
90
|
+
}], ctorParameters: function () { return [{ type: i1.Apollo }]; } });
|
|
93
91
|
|
|
94
92
|
/**
|
|
95
93
|
* Generated bundle index. Do not edit.
|
|
96
94
|
*/
|
|
97
95
|
|
|
98
96
|
export { DaffQueuedApollo, daffBuildFragmentDefinition, daffBuildFragmentNameSpread };
|
|
99
|
-
//# sourceMappingURL=daffodil-core-graphql.
|
|
97
|
+
//# sourceMappingURL=daffodil-core-graphql.mjs.map
|
|
@@ -0,0 +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,GAA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2FAEP,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAH5B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;iBACnB,CAAA;;;ACpBD;;AAEG;;;;"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Injectable } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/router';
|
|
4
|
+
import { PRIMARY_OUTLET } from '@angular/router';
|
|
3
5
|
|
|
4
6
|
/**
|
|
5
7
|
* Truncates the file extension from the end of the URI.
|
|
@@ -65,20 +67,18 @@ class DaffRoutingUriNormalizer {
|
|
|
65
67
|
return this.urlParser.serialize(urlTree);
|
|
66
68
|
}
|
|
67
69
|
}
|
|
68
|
-
/** @nocollapse */ DaffRoutingUriNormalizer.ɵ
|
|
69
|
-
DaffRoutingUriNormalizer
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
{ type: UrlSerializer }
|
|
77
|
-
];
|
|
70
|
+
/** @nocollapse */ /** @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 */ /** @nocollapse */ DaffRoutingUriNormalizer.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffRoutingUriNormalizer, providedIn: 'root' });
|
|
72
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffRoutingUriNormalizer, decorators: [{
|
|
73
|
+
type: Injectable,
|
|
74
|
+
args: [{
|
|
75
|
+
providedIn: 'root',
|
|
76
|
+
}]
|
|
77
|
+
}], ctorParameters: function () { return [{ type: i1.UrlSerializer }]; } });
|
|
78
78
|
|
|
79
79
|
/**
|
|
80
80
|
* Generated bundle index. Do not edit.
|
|
81
81
|
*/
|
|
82
82
|
|
|
83
83
|
export { DAFF_TRUNCATE_FILE_EXTENSION_REGEX, DAFF_TRUNCATE_LEADING_SLASH_REGEX, DaffRoutingUriNormalizer, daffUriTruncateFileExtension, daffUriTruncateLeadingPathSegments, daffUriTruncateLeadingSlash, daffUriTruncateQueryFragment };
|
|
84
|
-
//# sourceMappingURL=daffodil-core-routing.
|
|
84
|
+
//# sourceMappingURL=daffodil-core-routing.mjs.map
|
|
@@ -0,0 +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,C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;2JAtBU,wBAAwB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,aAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAxB,sCAAA,wBAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,wBAAwB,cAFvB,MAAM,EAAA,CAAA,CAAA;2FAEP,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBAHpC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;iBACnB,CAAA;;;ACZD;;AAEG;;;;"}
|
|
@@ -4,7 +4,6 @@ import { scan, filter } from 'rxjs/operators';
|
|
|
4
4
|
const compareActionSequenceStep = (step, action) => Array.isArray(step)
|
|
5
5
|
? step.reduce((acc, type) => acc || action.type === type, false)
|
|
6
6
|
: action.type === step;
|
|
7
|
-
const ɵ0 = compareActionSequenceStep;
|
|
8
7
|
/**
|
|
9
8
|
* Watches for a particular stream of actions in the specified order and
|
|
10
9
|
* emits a list of those actions once all sequence steps have been matched.
|
|
@@ -71,5 +70,5 @@ function daffComposeReducers(reducers) {
|
|
|
71
70
|
* Generated bundle index. Do not edit.
|
|
72
71
|
*/
|
|
73
72
|
|
|
74
|
-
export { DaffSortDirectionEnum, daffComposeReducers, daffTransformErrorToStateError, substream
|
|
75
|
-
//# sourceMappingURL=daffodil-core-state.
|
|
73
|
+
export { DaffSortDirectionEnum, daffComposeReducers, daffTransformErrorToStateError, substream };
|
|
74
|
+
//# sourceMappingURL=daffodil-core-state.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"daffodil-core-state.mjs","sources":["../../../libs/core/state/src/operators/substream.pipe.ts","../../../libs/core/state/src/errors/transform-error-to-state-error.ts","../../../libs/core/state/src/collection/sortable.ts","../../../libs/core/state/src/reducers/create-meta.ts","../../../libs/core/state/src/daffodil-core-state.ts"],"sourcesContent":["import { Action } from '@ngrx/store';\nimport { pipe } from 'rxjs';\nimport {\n scan,\n filter,\n} from 'rxjs/operators';\n\nexport type ActionType = Action['type'];\nexport type ActionSequenceStep = ActionType | ActionType[];\nexport type ActionSequence = ActionSequenceStep[];\n\nconst compareActionSequenceStep = (step: ActionSequenceStep, action: Action): boolean => Array.isArray(step)\n ? step.reduce((acc, type) => acc || action.type === type, false)\n : action.type === step;\n\n/**\n * Watches for a particular stream of actions in the specified order and\n * emits a list of those actions once all sequence steps have been matched.\n *\n * This will find the first occurence of the substream and not necessarily the most concise or recent substream.\n * For example, substream([A, B]) encountering an action stream of [A1, A2, B1, B2] will emit [A1, B1].\n * When a substream is found and emitted, the list is reset and it will continue to listen to the action stream.\n *\n * You can indicate that a particular step in the sequence can be matched by mutiple actions by passing an array for that step.\n * For example, if the first step of the sequence could be action A or action B: substream([[A, B], C]).\n * An action stream of [A1, C1] would cause substream to emit [A1, C1].\n * An action stream of [B1, C1] would cause substream to emit [B1, C1].\n * An action stream of [A1, B1, C1] would cause substream to emit [A1, C1].\n *\n * You can optionally pass a list of terminators.\n * If a terminator is encountered in the action stream, any partially matched substream is reset.\n * For example, substream([A, B], C) would not emit anything for an action stream of [A1, C1, B1].\n *\n * @param sequence The sequence of action types that define the substream to listen for.\n * @param terminators A list of terminators, any of which interrupt and reset a partially matched substream.\n */\nexport const substream = (sequence: ActionSequence, ...terminators: ActionType[]) => {\n const isFullMatch = matchedSubstream => matchedSubstream.length === sequence.length;\n const accumulateMatchedSubstream = (matchedSubstream, action) =>\n compareActionSequenceStep(sequence[matchedSubstream.length], action)\n ? [\n ...matchedSubstream,\n action,\n ]\n : matchedSubstream;\n\n return pipe(\n scan<Action, Action[]>((matchedSubstream, action) =>\n terminators.indexOf(action.type) > -1\n // terminator found, reset the list\n ? []\n : accumulateMatchedSubstream(\n // reset the list if fully matched\n isFullMatch(matchedSubstream) ? [] : matchedSubstream,\n action,\n ),\n []),\n filter(isFullMatch),\n );\n};\n","import { DaffError } from '@daffodil/core';\n\nimport { DaffStateError } from './state-error.interface';\n\nexport type ErrorTransformer = (DaffError) => DaffStateError;\n\n/**\n * Transforms an error instance to a state error object.\n */\nexport function daffTransformErrorToStateError({ code, message, recoverable }: DaffError): DaffStateError {\n return { code, message, recoverable };\n}\n","/**\n * The metadata that describes the sorting behavior of a collection of elements.\n */\nexport interface DaffSortOptions {\n default: DaffSortOption['value'];\n options: DaffSortOption[];\n}\n\n\n/**\n * One particular option used to sort a collection of elements;\n */\nexport interface DaffSortOption {\n label: string;\n value: any;\n}\n\n/**\n * The direction in which to sort a list of elements, e.g. if the list was\n * sorted alphabetically, \"Ascending\" would be from \"A-Z\",\n * and \"Descending\" would be from \"Z-A\".\n */\nexport enum DaffSortDirectionEnum {\n Ascending = 'ASC',\n Descending = 'DSC'\n}\n\n/**\n * Describes the properties of a collection that make the collection able to be\n * sorted by Daffodil.\n */\nexport interface DaffSortable {\n\n /**\n * The available options by which to sort the collection.\n */\n sort_options: DaffSortOptions;\n\n /**\n * The currently applied sorting option.\n */\n applied_sort_option: DaffSortOption['value'];\n\n /**\n * The currently applied sort direction.\n */\n applied_sort_direction: DaffSortDirectionEnum;\n}\n","import {\n Action,\n ActionReducer,\n} from '@ngrx/store';\n\n/**\n * Creates and returns a composite reducer that invokes each of the passed reducers in turn.\n */\nexport function daffComposeReducers<\n T,\n V extends Action = Action\n>(reducers: ActionReducer<T, V>[]): ActionReducer<T, V> {\n return (state: T, action: V): T =>\n reducers.reduce((nextState, reducer) => reducer(nextState, action), state);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAWA,MAAM,yBAAyB,GAAG,CAAC,IAAwB,EAAE,MAAc,KAAc,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;MACxG,IAAI,CAAC,MAAM,CAAC,CAAC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qB,KAArB,qBAAqB,GAGhC,EAAA,CAAA,CAAA;;ACpBD;;AAEG;AACG,SAAU,mBAAmB,CAGjC,QAA+B,EAAA;IAC/B,OAAO,CAAC,KAAQ,EAAE,MAAS,KACzB,QAAQ,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,OAAO,KAAK,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC,EAAE,KAAK,CAAC,CAAC;AAC/E;;ACdA;;AAEG;;;;"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Injectable, Pipe, NgModule } from '@angular/core';
|
|
3
|
+
import * as faker from '@faker-js/faker/locale/en_US';
|
|
4
|
+
import { range } from '@daffodil/core';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The base class for model factories.
|
|
8
|
+
*
|
|
9
|
+
* The mock class is passed as the first constructor arg
|
|
10
|
+
* and any additional args are passed to the mock class constructor.
|
|
11
|
+
*
|
|
12
|
+
* The constructor args can be omitted if the `create` method is overridden.
|
|
13
|
+
*
|
|
14
|
+
* The following example demonstrates using this feature to inject
|
|
15
|
+
* a different factory into a mock class.
|
|
16
|
+
*
|
|
17
|
+
* ```ts
|
|
18
|
+
* class MyMockModel {
|
|
19
|
+
* constructor(
|
|
20
|
+
* private otherFactory: MyOtherFactory
|
|
21
|
+
* ) {}
|
|
22
|
+
*
|
|
23
|
+
* private createOtherModel() {
|
|
24
|
+
* return this.otherFactory.create()
|
|
25
|
+
* }
|
|
26
|
+
*
|
|
27
|
+
* otherModel = this.createOtherModel()
|
|
28
|
+
* }
|
|
29
|
+
*
|
|
30
|
+
* @Injectable()
|
|
31
|
+
* class TestFactory extends DaffModelFactory<MyMockModel> {
|
|
32
|
+
* constructor(
|
|
33
|
+
* otherFactory: MyOtherFactory
|
|
34
|
+
* ) {
|
|
35
|
+
* super(MyMockModel, otherFactory)
|
|
36
|
+
* }
|
|
37
|
+
* }
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
class DaffModelFactory {
|
|
41
|
+
constructor(type, ...args) {
|
|
42
|
+
this.type = type;
|
|
43
|
+
this._instantiationArgs = args;
|
|
44
|
+
}
|
|
45
|
+
create(partial = {}) {
|
|
46
|
+
if (!this.type) {
|
|
47
|
+
throw new Error('`type` is required if `create` is not overriden.');
|
|
48
|
+
}
|
|
49
|
+
return Object.assign(Object.assign({}, new this.type(...this._instantiationArgs)), partial);
|
|
50
|
+
}
|
|
51
|
+
createMany(qty = 1, partial = {}) {
|
|
52
|
+
return range(0, qty - 1).map(() => this.create(partial));
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* @deprecated
|
|
58
|
+
* Prefer the `MockDaffAddress` of daffodil/geography/testing`
|
|
59
|
+
*/
|
|
60
|
+
class MockDaffAddress {
|
|
61
|
+
constructor() {
|
|
62
|
+
this.firstname = faker.name.firstName();
|
|
63
|
+
this.lastname = faker.name.lastName();
|
|
64
|
+
this.street = faker.address.streetName();
|
|
65
|
+
this.city = faker.address.city();
|
|
66
|
+
this.state = faker.address.stateAbbr();
|
|
67
|
+
this.email = faker.internet.email();
|
|
68
|
+
this.postcode = faker.address.zipCode();
|
|
69
|
+
this.telephone = faker.phone.phoneNumber();
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* @deprecated
|
|
74
|
+
* Prefer the `DaffAddressFactory` of `daffodil/geography/testing`
|
|
75
|
+
*/
|
|
76
|
+
class DaffAddressFactory extends DaffModelFactory {
|
|
77
|
+
constructor() {
|
|
78
|
+
super(MockDaffAddress);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
/** @nocollapse */ /** @nocollapse */ DaffAddressFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffAddressFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
82
|
+
/** @nocollapse */ /** @nocollapse */ DaffAddressFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffAddressFactory, providedIn: 'root' });
|
|
83
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffAddressFactory, decorators: [{
|
|
84
|
+
type: Injectable,
|
|
85
|
+
args: [{
|
|
86
|
+
providedIn: 'root',
|
|
87
|
+
}]
|
|
88
|
+
}], ctorParameters: function () { return []; } });
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* @docs
|
|
92
|
+
* A mock CurrencyPipe that does nothing to a given input.
|
|
93
|
+
* This pipe is useful for asserting that a CurrencyPipe is in use via a spy,
|
|
94
|
+
* but ignoring the actual underlying implementation
|
|
95
|
+
*/
|
|
96
|
+
class DaffMockCurrencyPipe {
|
|
97
|
+
transform(value) { }
|
|
98
|
+
;
|
|
99
|
+
}
|
|
100
|
+
/** @nocollapse */ /** @nocollapse */ DaffMockCurrencyPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffMockCurrencyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
101
|
+
/** @nocollapse */ /** @nocollapse */ DaffMockCurrencyPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffMockCurrencyPipe, name: "currency" });
|
|
102
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffMockCurrencyPipe, decorators: [{
|
|
103
|
+
type: Pipe,
|
|
104
|
+
args: [{ name: 'currency' }]
|
|
105
|
+
}] });
|
|
106
|
+
|
|
107
|
+
class DaffCoreTestingModule {
|
|
108
|
+
}
|
|
109
|
+
/** @nocollapse */ /** @nocollapse */ DaffCoreTestingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffCoreTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
110
|
+
/** @nocollapse */ /** @nocollapse */ DaffCoreTestingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffCoreTestingModule, declarations: [DaffMockCurrencyPipe] });
|
|
111
|
+
/** @nocollapse */ /** @nocollapse */ DaffCoreTestingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffCoreTestingModule });
|
|
112
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffCoreTestingModule, decorators: [{
|
|
113
|
+
type: NgModule,
|
|
114
|
+
args: [{
|
|
115
|
+
declarations: [
|
|
116
|
+
DaffMockCurrencyPipe,
|
|
117
|
+
],
|
|
118
|
+
}]
|
|
119
|
+
}] });
|
|
120
|
+
|
|
121
|
+
// Address
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Generated bundle index. Do not edit.
|
|
125
|
+
*/
|
|
126
|
+
|
|
127
|
+
export { DaffAddressFactory, DaffCoreTestingModule, DaffMockCurrencyPipe, DaffModelFactory };
|
|
128
|
+
//# sourceMappingURL=daffodil-core-testing.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"daffodil-core-testing.mjs","sources":["../../../libs/core/testing/src/factories/factory.ts","../../../libs/core/testing/src/address/factories/address.factory.ts","../../../libs/core/testing/src/angular/mocks/pipes/currency.ts","../../../libs/core/testing/src/testing.module.ts","../../../libs/core/testing/src/index.ts","../../../libs/core/testing/src/daffodil-core-testing.ts"],"sourcesContent":["import {\n range,\n Constructable,\n} from '@daffodil/core';\n\nimport { IDaffModelFactory } from './factory.interface';\n\n/**\n * The base class for model factories.\n *\n * The mock class is passed as the first constructor arg\n * and any additional args are passed to the mock class constructor.\n *\n * The 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 '../../factories/factory';\n\n/**\n * @deprecated\n * Prefer the `MockDaffAddress` of daffodil/geography/testing`\n */\nexport class MockDaffAddress implements DaffAddress {\n firstname = faker.name.firstName();\n lastname = faker.name.lastName();\n street = faker.address.streetName();\n city = faker.address.city();\n state = faker.address.stateAbbr();\n email = faker.internet.email();\n postcode = faker.address.zipCode();\n telephone = faker.phone.phoneNumber();\n}\n\n/**\n * @deprecated\n * Prefer the `DaffAddressFactory` of `daffodil/geography/testing`\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffAddressFactory extends DaffModelFactory<DaffAddress>{\n constructor(){\n super(MockDaffAddress);\n }\n}\n","import {\n Pipe,\n PipeTransform,\n} from '@angular/core';\n\n/**\n * @docs\n * A mock CurrencyPipe that does nothing to a given input.\n * This pipe is useful for asserting that a CurrencyPipe is in use via a spy,\n * but ignoring the actual underlying implementation\n */\n@Pipe({ name: 'currency' })\nexport class DaffMockCurrencyPipe implements PipeTransform {\n transform(value: number) {};\n}\n","import { NgModule } from '@angular/core';\n\nimport { DaffMockCurrencyPipe } from './angular/mocks/pipes/currency';\n\n@NgModule({\n declarations: [\n DaffMockCurrencyPipe,\n ],\n})\nexport class DaffCoreTestingModule {}\n","// Address\nexport { DaffAddressFactory } from './address/factories/address.factory';\n\n//@angular/core\nexport { DaffMockCurrencyPipe } from './angular/mocks/pipes/currency';\nexport { DaffInMemoryDataServiceInterface } from './angular/interfaces/in-memory-data-service.interface';\n\n//Core\nexport { DaffCoreTestingModule } from './testing.module';\nexport { DaffModelFactory } from './factories/factory';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCG;MACmB,gBAAgB,CAAA;IAGpC,WACS,CAAA,IAAuB,EAC9B,GAAG,IAA6C,EAAA;AADzC,QAAA,IAAI,CAAA,IAAA,GAAJ,IAAI,CAAmB;AAG9B,QAAA,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC;KAChC;IAED,MAAM,CAAC,OAAO,GAAG,EAAE,EAAA;AACjB,QAAA,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;AACd,YAAA,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;AACrE,SAAA;AACD,QAAA,OAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EACK,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,kBAAkB,CAAC,CACzC,EAAA,OAAO,CACV,CAAA;KACH;AAED,IAAA,UAAU,CAAC,GAAG,GAAG,CAAC,EAAE,OAAO,GAAG,EAAE,EAAA;QAC9B,OAAO,KAAK,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC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