@daffodil/customer-store-credit 0.94.1 → 0.95.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/daffodil-customer-store-credit-driver-in-memory.mjs +147 -116
- package/fesm2022/daffodil-customer-store-credit-driver-in-memory.mjs.map +1 -1
- package/fesm2022/daffodil-customer-store-credit-driver-magento-2.4.7-testing.mjs +51 -0
- package/fesm2022/daffodil-customer-store-credit-driver-magento-2.4.7-testing.mjs.map +1 -0
- package/fesm2022/daffodil-customer-store-credit-driver-magento-2.4.7.mjs +157 -0
- package/fesm2022/daffodil-customer-store-credit-driver-magento-2.4.7.mjs.map +1 -0
- package/fesm2022/daffodil-customer-store-credit-driver-magento-auto-testing.mjs +7 -0
- package/fesm2022/daffodil-customer-store-credit-driver-magento-auto-testing.mjs.map +1 -0
- package/fesm2022/daffodil-customer-store-credit-driver-magento-auto.mjs +7 -0
- package/fesm2022/daffodil-customer-store-credit-driver-magento-auto.mjs.map +1 -0
- package/fesm2022/daffodil-customer-store-credit-driver-testing.mjs +93 -60
- package/fesm2022/daffodil-customer-store-credit-driver-testing.mjs.map +1 -1
- package/fesm2022/daffodil-customer-store-credit-driver.mjs +13 -39
- package/fesm2022/daffodil-customer-store-credit-driver.mjs.map +1 -1
- package/fesm2022/daffodil-customer-store-credit-routing.mjs +86 -52
- package/fesm2022/daffodil-customer-store-credit-routing.mjs.map +1 -1
- package/fesm2022/daffodil-customer-store-credit-state-testing.mjs +86 -50
- package/fesm2022/daffodil-customer-store-credit-state-testing.mjs.map +1 -1
- package/fesm2022/daffodil-customer-store-credit-state.mjs +212 -231
- package/fesm2022/daffodil-customer-store-credit-state.mjs.map +1 -1
- package/fesm2022/daffodil-customer-store-credit-testing.mjs +49 -36
- package/fesm2022/daffodil-customer-store-credit-testing.mjs.map +1 -1
- package/fesm2022/daffodil-customer-store-credit.mjs +3 -7
- package/fesm2022/daffodil-customer-store-credit.mjs.map +1 -1
- package/package.json +1 -1
- package/types/daffodil-customer-store-credit-driver-in-memory.d.ts +54 -54
- package/types/daffodil-customer-store-credit-driver-magento-2.4.7-testing.d.ts +16 -0
- package/types/daffodil-customer-store-credit-driver-magento-2.4.7.d.ts +62 -0
- package/types/daffodil-customer-store-credit-driver-magento-auto-testing.d.ts +1 -0
- package/types/daffodil-customer-store-credit-driver-magento-auto.d.ts +1 -0
- package/types/daffodil-customer-store-credit-driver-testing.d.ts +24 -22
- package/types/daffodil-customer-store-credit-driver.d.ts +19 -28
- package/types/daffodil-customer-store-credit-routing.d.ts +18 -22
- package/types/daffodil-customer-store-credit-state-testing.d.ts +22 -19
- package/types/daffodil-customer-store-credit-state.d.ts +74 -86
- package/types/daffodil-customer-store-credit-testing.d.ts +10 -13
- package/types/daffodil-customer-store-credit.d.ts +6 -10
- package/fesm2022/daffodil-customer-store-credit-driver-magento-testing.mjs +0 -34
- package/fesm2022/daffodil-customer-store-credit-driver-magento-testing.mjs.map +0 -1
- package/fesm2022/daffodil-customer-store-credit-driver-magento.mjs +0 -154
- package/fesm2022/daffodil-customer-store-credit-driver-magento.mjs.map +0 -1
- package/types/daffodil-customer-store-credit-driver-magento-testing.d.ts +0 -20
- package/types/daffodil-customer-store-credit-driver-magento.d.ts +0 -67
|
@@ -1,37 +1,50 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import { Injectable } from
|
|
3
|
-
import { faker } from
|
|
4
|
-
import { DaffModelFactory } from
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { Injectable } from "@angular/core";
|
|
3
|
+
import { faker } from "@faker-js/faker/locale/en_US";
|
|
4
|
+
import { DaffModelFactory } from "@daffodil/core/testing";
|
|
5
|
+
var MockDaffCustomerStoreCredit = class {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.balance = faker.number.int({
|
|
8
|
+
min: 0,
|
|
9
|
+
max: 1e3
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
var DaffCustomerStoreCreditFactory = class DaffCustomerStoreCreditFactory extends DaffModelFactory {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(MockDaffCustomerStoreCredit);
|
|
16
|
+
}
|
|
17
|
+
static {
|
|
18
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
19
|
+
minVersion: "12.0.0",
|
|
20
|
+
version: "22.2.4",
|
|
21
|
+
ngImport: i0,
|
|
22
|
+
type: DaffCustomerStoreCreditFactory,
|
|
23
|
+
deps: [],
|
|
24
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
static {
|
|
28
|
+
this.ɵprov = i0.ɵɵngDeclareInjectable({
|
|
29
|
+
minVersion: "12.0.0",
|
|
30
|
+
version: "22.2.4",
|
|
31
|
+
ngImport: i0,
|
|
32
|
+
type: DaffCustomerStoreCreditFactory,
|
|
33
|
+
providedIn: "root"
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
38
|
+
minVersion: "12.0.0",
|
|
39
|
+
version: "22.2.4",
|
|
40
|
+
ngImport: i0,
|
|
41
|
+
type: DaffCustomerStoreCreditFactory,
|
|
42
|
+
decorators: [{
|
|
43
|
+
type: Injectable,
|
|
44
|
+
args: [{ providedIn: "root" }]
|
|
45
|
+
}],
|
|
46
|
+
ctorParameters: () => []
|
|
47
|
+
});
|
|
36
48
|
export { DaffCustomerStoreCreditFactory, MockDaffCustomerStoreCredit };
|
|
37
|
-
|
|
49
|
+
|
|
50
|
+
//# sourceMappingURL=daffodil-customer-store-credit-testing.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-customer-store-credit-testing.mjs","sources":["../../../libs/customer-store-credit/testing/src/factories/customer-store-credit.factory.ts"
|
|
1
|
+
{"version":3,"file":"daffodil-customer-store-credit-testing.mjs","names":[],"sources":["../../../libs/customer-store-credit/testing/src/factories/customer-store-credit.factory.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { faker } from '@faker-js/faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { DaffCustomerStoreCredit } from '@daffodil/customer-store-credit';\n\n/**\n * Mock class for {@link DaffCustomerStoreCredit}.\n */\nexport class MockDaffCustomerStoreCredit implements DaffCustomerStoreCredit {\n balance = faker.number.int({ min: 0, max: 1000 });\n};\n\n/**\n * Model factory for {@link DaffCustomerStoreCredit}.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffCustomerStoreCreditFactory extends DaffModelFactory<DaffCustomerStoreCredit>{\n constructor() {\n super(MockDaffCustomerStoreCredit);\n }\n}\n"],"mappings":";;;;AASA,IAAa,8BAAb,MAAwC;CAAxC,cAAA;EACE,KAAA,UAAU,MAAM,OAAO,IAAI;GAAE,KAAK;GAAG,KAAK;EAAI,CAAE;CAClD;AAAC;AAQD,IAAa,iCAAb,MAAa,uCAAuC,iBAAyC;CAC3F,cAAA;EACE,MAAM,2BAA2B;CACnC;CAHW;EAAA,KAAA,OAAA,GAAA,mBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAA8B,MAAA,CAAA;GAAA,QAAA,GAAA,gBAAA;EAAA,CAAA;CAAA;CAA9B;EAAA,KAAA,QAAA,GAAA,sBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAA8B,YAF7B;EAAM,CAAA;CAAA;;AAEP,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAA8B,YAAA,CAAA;EAH1C,MAAA;EAAW,MAAA,CAAA,EACV,YAAY,OACb,CAAA"}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
const DAFF_CUSTOMER_STORE_CREDIT_ORDER_TOTAL_TYPE =
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Generated bundle index. Do not edit.
|
|
5
|
-
*/
|
|
6
|
-
|
|
1
|
+
const DAFF_CUSTOMER_STORE_CREDIT_ORDER_TOTAL_TYPE = "storeCredit";
|
|
7
2
|
export { DAFF_CUSTOMER_STORE_CREDIT_ORDER_TOTAL_TYPE };
|
|
8
|
-
|
|
3
|
+
|
|
4
|
+
//# sourceMappingURL=daffodil-customer-store-credit.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-customer-store-credit.mjs","sources":["../../../libs/customer-store-credit/src/constants/store-credit-order-total-type.ts"
|
|
1
|
+
{"version":3,"file":"daffodil-customer-store-credit.mjs","names":[],"sources":["../../../libs/customer-store-credit/src/constants/store-credit-order-total-type.ts"],"sourcesContent":["export const DAFF_CUSTOMER_STORE_CREDIT_ORDER_TOTAL_TYPE = 'storeCredit';\n"],"mappings":"AAAA,MAAa,8CAA8C"}
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@daffodil/customer-store-credit","nx":{"targets":{"build":{"outputs":["{workspaceRoot}/dist/customer-store-credit"]}}},"version":"0.
|
|
1
|
+
{"name":"@daffodil/customer-store-credit","nx":{"targets":{"build":{"outputs":["{workspaceRoot}/dist/customer-store-credit"]}}},"version":"0.95.0","description":"Platform-agnostic models, state management, and drivers for customer store credit balances. Part of the Daffodil ecommerce framework.","repository":{"type":"git","url":"https://github.com/graycoreio/daffodil"},"author":"Graycore LLC","license":"MIT","bugs":{"url":"https://github.com/graycoreio/daffodil/issues"},"homepage":"https://github.com/graycoreio/daffodil","peerDependencies":{"@angular/common":"^22","@angular/core":"^22","@daffodil/customer":"0.95.0","@daffodil/customer-order":"0.95.0","@daffodil/core":"0.95.0","@ngrx/effects":"^22","@ngrx/store":"^22","rxjs":"^7.0.0","@daffodil/driver":"0.95.0"},"optionalDependencies":{"@apollo/client":"^4.0.13","@daffodil/driver":"0.95.0","apollo-angular":"^14.0.0","@faker-js/faker":"^10.3.0"},"exports":{"./driver/magento/auto":{"customer-store-credit-magento-2.4.7":{"types":"./types/daffodil-customer-store-credit-driver-magento-2.4.7.d.ts","default":"./fesm2022/daffodil-customer-store-credit-driver-magento-2.4.7.mjs"},"types":"./types/daffodil-customer-store-credit-driver-magento-auto.d.ts","default":"./fesm2022/daffodil-customer-store-credit-driver-magento-auto.mjs"},"./driver/magento/auto/testing":{"customer-store-credit-magento-2.4.7":{"types":"./types/daffodil-customer-store-credit-driver-magento-2.4.7-testing.d.ts","default":"./fesm2022/daffodil-customer-store-credit-driver-magento-2.4.7-testing.mjs"},"types":"./types/daffodil-customer-store-credit-driver-magento-auto-testing.d.ts","default":"./fesm2022/daffodil-customer-store-credit-driver-magento-auto-testing.mjs"},"./package.json":{"default":"./package.json"},".":{"types":"./types/daffodil-customer-store-credit.d.ts","default":"./fesm2022/daffodil-customer-store-credit.mjs"},"./driver":{"types":"./types/daffodil-customer-store-credit-driver.d.ts","default":"./fesm2022/daffodil-customer-store-credit-driver.mjs"},"./driver/in-memory":{"types":"./types/daffodil-customer-store-credit-driver-in-memory.d.ts","default":"./fesm2022/daffodil-customer-store-credit-driver-in-memory.mjs"},"./driver/magento/2.4.7":{"types":"./types/daffodil-customer-store-credit-driver-magento-2.4.7.d.ts","default":"./fesm2022/daffodil-customer-store-credit-driver-magento-2.4.7.mjs"},"./driver/magento/2.4.7/testing":{"types":"./types/daffodil-customer-store-credit-driver-magento-2.4.7-testing.d.ts","default":"./fesm2022/daffodil-customer-store-credit-driver-magento-2.4.7-testing.mjs"},"./driver/testing":{"types":"./types/daffodil-customer-store-credit-driver-testing.d.ts","default":"./fesm2022/daffodil-customer-store-credit-driver-testing.mjs"},"./routing":{"types":"./types/daffodil-customer-store-credit-routing.d.ts","default":"./fesm2022/daffodil-customer-store-credit-routing.mjs"},"./state":{"types":"./types/daffodil-customer-store-credit-state.d.ts","default":"./fesm2022/daffodil-customer-store-credit-state.mjs"},"./state/testing":{"types":"./types/daffodil-customer-store-credit-state-testing.d.ts","default":"./fesm2022/daffodil-customer-store-credit-state-testing.mjs"},"./testing":{"types":"./types/daffodil-customer-store-credit-testing.d.ts","default":"./fesm2022/daffodil-customer-store-credit-testing.mjs"}},"module":"fesm2022/daffodil-customer-store-credit.mjs","typings":"types/daffodil-customer-store-credit.d.ts","sideEffects":false,"type":"module","dependencies":{"tslib":"^2.6.2"}}
|
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import * as i1 from '@angular/common';
|
|
12
|
-
|
|
1
|
+
import { InMemoryBackendConfig, InMemoryDbService, ParsedRequestUrl, RequestInfo, RequestInfoUtilities } from "angular-in-memory-web-api";
|
|
2
|
+
import { DaffCustomerStoreCredit } from "@daffodil/customer-store-credit";
|
|
3
|
+
import { DaffCustomerStoreCreditFactory } from "@daffodil/customer-store-credit/testing";
|
|
4
|
+
import { DaffInMemoryDriverBase, DaffInMemorySingleRouteableBackend } from "@daffodil/driver/in-memory";
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
import { EnvironmentProviders, ModuleWithProviders } from "@angular/core";
|
|
7
|
+
import { HttpClient } from "@angular/common/http";
|
|
8
|
+
import { Observable } from "rxjs";
|
|
9
|
+
import { DaffCustomerStoreCreditDriverInterface } from "@daffodil/customer-store-credit/driver";
|
|
10
|
+
import * as i1 from "@angular/common";
|
|
13
11
|
/**
|
|
14
12
|
* An in-memory service that handles customer store credit HTTP requests.
|
|
15
13
|
*/
|
|
16
|
-
declare class DaffCustomerStoreCreditInMemoryBackendService implements InMemoryDbService, DaffInMemorySingleRouteableBackend {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
14
|
+
export declare class DaffCustomerStoreCreditInMemoryBackendService implements InMemoryDbService, DaffInMemorySingleRouteableBackend {
|
|
15
|
+
private factory;
|
|
16
|
+
readonly collectionName = "customer-store-credit";
|
|
17
|
+
storeCredit: DaffCustomerStoreCredit;
|
|
18
|
+
constructor(factory: DaffCustomerStoreCreditFactory);
|
|
19
|
+
/**
|
|
20
|
+
* Automatically called as part of the InMemoryDbService to parse incoming urls to match the InMemory backend urls.
|
|
21
|
+
*
|
|
22
|
+
* @param url initial url
|
|
23
|
+
* @param utils utility to parse url
|
|
24
|
+
* @returns ParsedRequestUrl
|
|
25
|
+
* @docs-private
|
|
26
|
+
*/
|
|
27
|
+
parseRequestUrl(url: string, utils: RequestInfoUtilities): ParsedRequestUrl;
|
|
28
|
+
/**
|
|
29
|
+
* @docs-private
|
|
30
|
+
*/
|
|
31
|
+
createDb(): any;
|
|
32
|
+
/**
|
|
33
|
+
* Gets the customer's store credit.
|
|
34
|
+
*
|
|
35
|
+
* @param reqInfo request object
|
|
36
|
+
* @returns An http response object
|
|
37
|
+
*/
|
|
38
|
+
get(reqInfo: RequestInfo): import("rxjs").Observable<any>;
|
|
39
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCustomerStoreCreditInMemoryBackendService, never>;
|
|
40
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
43
41
|
}
|
|
44
|
-
|
|
45
42
|
/**
|
|
46
43
|
* The customer store credit in-memory driver to mock the customer store credit backend service.
|
|
47
44
|
*
|
|
48
45
|
* @inheritdoc
|
|
49
46
|
*/
|
|
50
|
-
declare class DaffCustomerStoreCreditInMemoryDriver extends DaffInMemoryDriverBase implements DaffCustomerStoreCreditDriverInterface {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
47
|
+
export declare class DaffCustomerStoreCreditInMemoryDriver extends DaffInMemoryDriverBase implements DaffCustomerStoreCreditDriverInterface {
|
|
48
|
+
private http;
|
|
49
|
+
constructor(http: HttpClient, config: InMemoryBackendConfig);
|
|
50
|
+
get(): Observable<DaffCustomerStoreCredit>;
|
|
51
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCustomerStoreCreditInMemoryDriver, never>;
|
|
52
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
56
53
|
}
|
|
57
|
-
|
|
58
54
|
/**
|
|
59
55
|
* Provides the {@link DaffCustomerStoreCreditInMemoryDriver} as the {@link DaffCustomerStoreCreditDriver}.
|
|
56
|
+
*
|
|
57
|
+
* @deprecated in favor of {@link provideDaffCustomerStoreCreditInMemoryDriver} Deprecated in version 0.95.0. Will be removed in version 0.98.0.
|
|
60
58
|
*/
|
|
61
|
-
declare class DaffCustomerStoreCreditInMemoryDriverModule {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
59
|
+
export declare class DaffCustomerStoreCreditInMemoryDriverModule {
|
|
60
|
+
static forRoot(): ModuleWithProviders<DaffCustomerStoreCreditInMemoryDriverModule>;
|
|
61
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCustomerStoreCreditInMemoryDriverModule, never>;
|
|
62
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DaffCustomerStoreCreditInMemoryDriverModule, never, [typeof i1.CommonModule], never>;
|
|
63
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<DaffCustomerStoreCreditInMemoryDriverModule>;
|
|
66
64
|
}
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
/**
|
|
66
|
+
* Provides the {@link DaffCustomerStoreCreditInMemoryDriver} as the {@link DaffCustomerStoreCreditDriver}.
|
|
67
|
+
*/
|
|
68
|
+
export declare const provideDaffCustomerStoreCreditInMemoryDriver: () => EnvironmentProviders;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { DaffModelFactory } from "@daffodil/core/testing";
|
|
2
|
+
import { MagentoCustomerStoreCredit } from "@daffodil/customer-store-credit/driver/magento/2.4.7";
|
|
3
|
+
import { MagentoMoneyFactory } from "@daffodil/driver/magento/2.4.7/testing";
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class MockMagentoCustomerStoreCredit implements MagentoCustomerStoreCredit {
|
|
6
|
+
protected moneyFactory: MagentoMoneyFactory;
|
|
7
|
+
__typename: "CustomerStoreCredit";
|
|
8
|
+
current_balance: import("@daffodil/driver/types/daffodil-driver-magento-2.4.7").MagentoMoney;
|
|
9
|
+
enabled: boolean;
|
|
10
|
+
constructor(moneyFactory: MagentoMoneyFactory);
|
|
11
|
+
}
|
|
12
|
+
export declare class MagentoCustomerStoreCreditFactory extends DaffModelFactory<MagentoCustomerStoreCredit> {
|
|
13
|
+
constructor(moneyFactory: MagentoMoneyFactory);
|
|
14
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MagentoCustomerStoreCreditFactory, never>;
|
|
15
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { DaffCustomerStoreCredit } from "@daffodil/customer-store-credit";
|
|
2
|
+
import { MagentoMoney } from "@daffodil/driver/magento/2.4.7";
|
|
3
|
+
import { DaffMagentoCustomerOrderExtraTransform, MagentoCustomerOrder } from "@daffodil/customer-order/driver/magento/2.4.6";
|
|
4
|
+
import "graphql";
|
|
5
|
+
import { DaffError } from "@daffodil/core";
|
|
6
|
+
import { DaffCustomerStoreCreditDriverInterface, DaffCustomerStoreCreditInvalidAPIResponseError } from "@daffodil/customer-store-credit/driver";
|
|
7
|
+
import { Apollo } from "apollo-angular";
|
|
8
|
+
import { Observable } from "rxjs";
|
|
9
|
+
import * as i0 from "@angular/core";
|
|
10
|
+
import { EnvironmentProviders, ModuleWithProviders } from "@angular/core";
|
|
11
|
+
import * as i1 from "@angular/common";
|
|
12
|
+
export interface MagentoCustomerStoreCredit {
|
|
13
|
+
__typename?: 'CustomerStoreCredit';
|
|
14
|
+
current_balance?: MagentoMoney;
|
|
15
|
+
enabled?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface MagentoGetCustomerStoreCreditResponse {
|
|
18
|
+
customer: {
|
|
19
|
+
store_credit: MagentoCustomerStoreCredit;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export interface MagentoCustomerOrderWithStoreCredit extends MagentoCustomerOrder {
|
|
23
|
+
total: MagentoCustomerOrder['total'] & {
|
|
24
|
+
total_store_credit: MagentoMoney;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export declare const magentoCustomerStoreCreditTransform: (storeCredit: MagentoCustomerStoreCredit) => DaffCustomerStoreCredit;
|
|
28
|
+
export declare const magentoCustomerOrderWithStoreCreditTransform: DaffMagentoCustomerOrderExtraTransform<MagentoCustomerOrderWithStoreCredit>;
|
|
29
|
+
export declare const magentoCustomerStoreCreditFragment: import("apollo-angular").TypedDocumentNode<unknown, unknown>;
|
|
30
|
+
export declare const magentoCustomerOrderStoreCreditTotalFragment: import("apollo-angular").TypedDocumentNode<unknown, unknown>;
|
|
31
|
+
export declare const MAGENTO_GET_CUSTOMER_STORE_CREDIT_QUERY_NAME = "MagentoGetCustomerStoreCredit";
|
|
32
|
+
export declare const getCustomerStoreCredit: import("apollo-angular").TypedDocumentNode<unknown, unknown>;
|
|
33
|
+
export declare function transformMagentoReviewsError(error: any, requestPayload?: unknown): DaffError | DaffCustomerStoreCreditInvalidAPIResponseError;
|
|
34
|
+
export declare const validateGetCustomerStoreCreditResponse: (response: Apollo.QueryResult<MagentoGetCustomerStoreCreditResponse>) => {
|
|
35
|
+
data: MagentoGetCustomerStoreCreditResponse;
|
|
36
|
+
error?: import("@apollo/client").ErrorLike;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* A service for making Magento GraphQL queries for customers.
|
|
40
|
+
*
|
|
41
|
+
* @inheritdoc
|
|
42
|
+
*/
|
|
43
|
+
export declare class DaffCustomerStoreCreditMagentoService implements DaffCustomerStoreCreditDriverInterface {
|
|
44
|
+
private apollo;
|
|
45
|
+
constructor(apollo: Apollo);
|
|
46
|
+
get(): Observable<DaffCustomerStoreCredit>;
|
|
47
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCustomerStoreCreditMagentoService, never>;
|
|
48
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* @deprecated in favor of {@link provideDaffCustomerStoreCreditMagentoDriver} Deprecated in version 0.95.0. Will be removed in version 0.98.0.
|
|
52
|
+
*/
|
|
53
|
+
export declare class DaffCustomerStoreCreditMagentoDriverModule {
|
|
54
|
+
static forRoot(): ModuleWithProviders<DaffCustomerStoreCreditMagentoDriverModule>;
|
|
55
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCustomerStoreCreditMagentoDriverModule, never>;
|
|
56
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DaffCustomerStoreCreditMagentoDriverModule, never, [typeof i1.CommonModule], never>;
|
|
57
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<DaffCustomerStoreCreditMagentoDriverModule>;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Provides the Magento implementation of the `@daffodil/customer-store-credit/driver` interface.
|
|
61
|
+
*/
|
|
62
|
+
export declare const provideDaffCustomerStoreCreditMagentoDriver: () => EnvironmentProviders;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {}
|
|
@@ -1,33 +1,35 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import { ModuleWithProviders } from
|
|
3
|
-
import * as i1 from
|
|
4
|
-
import { Observable } from
|
|
5
|
-
import { DaffCustomerStoreCredit } from
|
|
6
|
-
import { DaffCustomerStoreCreditDriverInterface } from
|
|
7
|
-
import { DaffCustomerStoreCreditFactory } from
|
|
8
|
-
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { EnvironmentProviders, ModuleWithProviders } from "@angular/core";
|
|
3
|
+
import * as i1 from "@angular/common";
|
|
4
|
+
import { Observable } from "rxjs";
|
|
5
|
+
import { DaffCustomerStoreCredit } from "@daffodil/customer-store-credit";
|
|
6
|
+
import { DaffCustomerStoreCreditDriverInterface } from "@daffodil/customer-store-credit/driver";
|
|
7
|
+
import { DaffCustomerStoreCreditFactory } from "@daffodil/customer-store-credit/testing";
|
|
9
8
|
/**
|
|
10
9
|
* Provides the {@link DaffCustomerStoreCreditTestingDriver} as the {@link DaffCustomerStoreCreditDriver}.
|
|
10
|
+
*
|
|
11
|
+
* @deprecated in favor of {@link provideDaffCustomerStoreCreditTestingDriver} Deprecated in version 0.95.0. Will be removed in version 0.98.0.
|
|
11
12
|
*/
|
|
12
|
-
declare class DaffCustomerStoreCreditTestingDriverModule {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
export declare class DaffCustomerStoreCreditTestingDriverModule {
|
|
14
|
+
static forRoot(): ModuleWithProviders<DaffCustomerStoreCreditTestingDriverModule>;
|
|
15
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCustomerStoreCreditTestingDriverModule, never>;
|
|
16
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DaffCustomerStoreCreditTestingDriverModule, never, [typeof i1.CommonModule], never>;
|
|
17
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<DaffCustomerStoreCreditTestingDriverModule>;
|
|
17
18
|
}
|
|
18
|
-
|
|
19
19
|
/**
|
|
20
20
|
* A basic customer driver that creates mock customer results of different kinds.
|
|
21
21
|
* For testing purposes.
|
|
22
22
|
*
|
|
23
23
|
* @inheritdoc
|
|
24
24
|
*/
|
|
25
|
-
declare class DaffCustomerStoreCreditTestingDriver implements DaffCustomerStoreCreditDriverInterface {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
export declare class DaffCustomerStoreCreditTestingDriver implements DaffCustomerStoreCreditDriverInterface {
|
|
26
|
+
private factory;
|
|
27
|
+
constructor(factory: DaffCustomerStoreCreditFactory);
|
|
28
|
+
get(): Observable<DaffCustomerStoreCredit>;
|
|
29
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCustomerStoreCreditTestingDriver, never>;
|
|
30
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
31
31
|
}
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
/**
|
|
33
|
+
* Provides the {@link DaffCustomerStoreCreditTestingDriver} as the {@link DaffCustomerStoreCreditDriver}.
|
|
34
|
+
*/
|
|
35
|
+
export declare const provideDaffCustomerStoreCreditTestingDriver: () => EnvironmentProviders;
|
|
@@ -1,40 +1,31 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
declare const DaffCustomerStoreCreditDriver: _angular_core.InjectionToken<DaffCustomerStoreCreditDriverInterface<DaffCustomerStoreCredit>>;
|
|
7
|
-
declare const provideDaffCustomerStoreCreditDriver: <R extends DaffCustomerStoreCreditDriverInterface<DaffCustomerStoreCredit> = DaffCustomerStoreCreditDriverInterface<DaffCustomerStoreCredit>>(klass: _angular_core.Type<R>) => _angular_core.ExistingProvider;
|
|
1
|
+
import { Observable } from "rxjs";
|
|
2
|
+
import { DaffCustomerStoreCredit } from "@daffodil/customer-store-credit";
|
|
3
|
+
import { DaffError, DaffInheritableError } from "@daffodil/core";
|
|
4
|
+
export declare const DaffCustomerStoreCreditDriver: import("@angular/core").InjectionToken<DaffCustomerStoreCreditDriverInterface<DaffCustomerStoreCredit>>, provideDaffCustomerStoreCreditDriver: <R extends DaffCustomerStoreCreditDriverInterface<DaffCustomerStoreCredit> = DaffCustomerStoreCreditDriverInterface<DaffCustomerStoreCredit>>(klass: import("@angular/core").Type<R>) => import("@angular/core").ExistingProvider;
|
|
8
5
|
/**
|
|
9
6
|
* The customer store credit driver is responsible for loading customers.
|
|
10
7
|
*/
|
|
11
|
-
interface DaffCustomerStoreCreditDriverInterface<TStoreCredit extends DaffCustomerStoreCredit = DaffCustomerStoreCredit> {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
export interface DaffCustomerStoreCreditDriverInterface<TStoreCredit extends DaffCustomerStoreCredit = DaffCustomerStoreCredit> {
|
|
9
|
+
/**
|
|
10
|
+
* Get the customer's store credit.
|
|
11
|
+
*/
|
|
12
|
+
get(): Observable<TStoreCredit>;
|
|
16
13
|
}
|
|
17
|
-
|
|
18
|
-
declare const DAFF_CUSTOMER_STORE_CREDIT_INVALID_API_RESPONSE_ERROR_CODE = "DAFF_CUSTOMER_STORE_CREDIT_INVALID_API_RESPONSE";
|
|
14
|
+
export declare const DAFF_CUSTOMER_STORE_CREDIT_INVALID_API_RESPONSE_ERROR_CODE = "DAFF_CUSTOMER_STORE_CREDIT_INVALID_API_RESPONSE";
|
|
19
15
|
/**
|
|
20
16
|
* A general error indicating that the platform returned a response which cannot be processed.
|
|
21
17
|
*/
|
|
22
|
-
declare class DaffCustomerStoreCreditInvalidAPIResponseError extends DaffInheritableError implements DaffError {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
export declare class DaffCustomerStoreCreditInvalidAPIResponseError extends DaffInheritableError implements DaffError {
|
|
19
|
+
message: string;
|
|
20
|
+
readonly code: string;
|
|
21
|
+
constructor(message: string);
|
|
26
22
|
}
|
|
27
|
-
|
|
28
23
|
/**
|
|
29
24
|
* A mapping from error codes to error class constructors.
|
|
30
25
|
*/
|
|
31
|
-
declare const DaffCustomerStoreCreditDriverErrorMap: {
|
|
32
|
-
|
|
26
|
+
export declare const DaffCustomerStoreCreditDriverErrorMap: {
|
|
27
|
+
DAFF_CUSTOMER_STORE_CREDIT_INVALID_API_RESPONSE: typeof DaffCustomerStoreCreditInvalidAPIResponseError;
|
|
33
28
|
};
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export { DAFF_CUSTOMER_STORE_CREDIT_INVALID_API_RESPONSE_ERROR_CODE, DaffCustomerStoreCreditDriver, DaffCustomerStoreCreditDriverErrorCodes, DaffCustomerStoreCreditDriverErrorMap, DaffCustomerStoreCreditInvalidAPIResponseError, provideDaffCustomerStoreCreditDriver };
|
|
40
|
-
export type { DaffCustomerStoreCreditDriverInterface };
|
|
29
|
+
export declare const DaffCustomerStoreCreditDriverErrorCodes: {
|
|
30
|
+
INVALID_API_RESPONSE: string;
|
|
31
|
+
};
|
|
@@ -1,29 +1,25 @@
|
|
|
1
|
-
import { UrlTree } from
|
|
2
|
-
import { Store } from
|
|
3
|
-
import { Observable } from
|
|
4
|
-
import * as i0 from
|
|
5
|
-
import { DaffCustomerStoreCreditPageFacade } from
|
|
6
|
-
|
|
1
|
+
import { UrlTree } from "@angular/router";
|
|
2
|
+
import { Store } from "@ngrx/store";
|
|
3
|
+
import { Observable } from "rxjs";
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
import { DaffCustomerStoreCreditPageFacade } from "@daffodil/customer-store-credit/state";
|
|
7
6
|
/**
|
|
8
7
|
* A guard that will clear customer state errors before allowing route deactivation.
|
|
9
8
|
*/
|
|
10
|
-
declare class DaffCustomerStoreCreditClearErrorsGuard {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
export declare class DaffCustomerStoreCreditClearErrorsGuard {
|
|
10
|
+
private store;
|
|
11
|
+
constructor(store: Store<any>);
|
|
12
|
+
canDeactivate(): boolean | UrlTree | Observable<boolean | UrlTree> | Promise<boolean | UrlTree>;
|
|
13
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCustomerStoreCreditClearErrorsGuard, never>;
|
|
14
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
16
15
|
}
|
|
17
|
-
|
|
18
16
|
/**
|
|
19
17
|
* Dispatches customer load.
|
|
20
18
|
*/
|
|
21
|
-
declare class DaffCustomerStoreCreditResolver {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export { DaffCustomerStoreCreditClearErrorsGuard, DaffCustomerStoreCreditResolver };
|
|
19
|
+
export declare class DaffCustomerStoreCreditResolver {
|
|
20
|
+
private facade;
|
|
21
|
+
constructor(facade: DaffCustomerStoreCreditPageFacade);
|
|
22
|
+
resolve(): Observable<boolean>;
|
|
23
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCustomerStoreCreditResolver, never>;
|
|
24
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
25
|
+
}
|
|
@@ -1,29 +1,32 @@
|
|
|
1
|
-
import { Action } from
|
|
2
|
-
import { BehaviorSubject } from
|
|
3
|
-
import { MockDaffOperationStateFacade } from
|
|
4
|
-
import { DaffCustomerStoreCredit } from
|
|
5
|
-
import { DaffCustomerStoreCreditPageFacadeInterface } from
|
|
6
|
-
import * as i0 from
|
|
7
|
-
|
|
1
|
+
import { Action } from "@ngrx/store";
|
|
2
|
+
import { BehaviorSubject } from "rxjs";
|
|
3
|
+
import { MockDaffOperationStateFacade } from "@daffodil/core/state/testing";
|
|
4
|
+
import { DaffCustomerStoreCredit } from "@daffodil/customer-store-credit";
|
|
5
|
+
import { DaffCustomerStoreCreditPageFacadeInterface } from "@daffodil/customer-store-credit/state";
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
import { EnvironmentProviders } from "@angular/core";
|
|
8
8
|
/**
|
|
9
9
|
* Mocks out facade fields and methods for testing purposes.
|
|
10
10
|
*
|
|
11
11
|
* @inheritdoc
|
|
12
12
|
*/
|
|
13
|
-
declare class MockDaffCustomerStoreCreditPageFacade extends MockDaffOperationStateFacade implements DaffCustomerStoreCreditPageFacadeInterface {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
export declare class MockDaffCustomerStoreCreditPageFacade extends MockDaffOperationStateFacade implements DaffCustomerStoreCreditPageFacadeInterface {
|
|
14
|
+
storeCredit$: BehaviorSubject<DaffCustomerStoreCredit>;
|
|
15
|
+
dispatch(action: Action): void;
|
|
16
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MockDaffCustomerStoreCreditPageFacade, never>;
|
|
17
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
18
18
|
}
|
|
19
|
-
|
|
20
19
|
/**
|
|
21
20
|
* Provides the {@link MockDaffCustomerStoreCreditPageFacade} for {@link DaffCustomerStoreCreditPageFacade}.
|
|
21
|
+
*
|
|
22
|
+
* @deprecated in favor of {@link provideDaffCustomerStoreCreditStateTesting} Deprecated in version 0.95.0. Will be removed in version 0.98.0.
|
|
22
23
|
*/
|
|
23
|
-
declare class DaffCustomerStoreCreditStateTestingModule {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
export declare class DaffCustomerStoreCreditStateTestingModule {
|
|
25
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DaffCustomerStoreCreditStateTestingModule, never>;
|
|
26
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DaffCustomerStoreCreditStateTestingModule, never, never, never>;
|
|
27
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<DaffCustomerStoreCreditStateTestingModule>;
|
|
27
28
|
}
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
/**
|
|
30
|
+
* Provides the {@link MockDaffCustomerStoreCreditPageFacade} for {@link DaffCustomerStoreCreditPageFacade}.
|
|
31
|
+
*/
|
|
32
|
+
export declare const provideDaffCustomerStoreCreditStateTesting: () => EnvironmentProviders;
|