@daffodil/product 0.94.1-rc.0 → 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-product-driver-in-memory.mjs +200 -227
- package/fesm2022/daffodil-product-driver-in-memory.mjs.map +1 -1
- package/fesm2022/daffodil-product-driver-magento-2.4.7-testing.mjs +444 -0
- package/fesm2022/daffodil-product-driver-magento-2.4.7-testing.mjs.map +1 -0
- package/fesm2022/daffodil-product-driver-magento-2.4.7.mjs +704 -0
- package/fesm2022/daffodil-product-driver-magento-2.4.7.mjs.map +1 -0
- package/fesm2022/daffodil-product-driver-magento-auto-testing.mjs +7 -0
- package/fesm2022/daffodil-product-driver-magento-auto-testing.mjs.map +1 -0
- package/fesm2022/daffodil-product-driver-magento-auto.mjs +7 -0
- package/fesm2022/daffodil-product-driver-magento-auto.mjs.map +1 -0
- package/fesm2022/daffodil-product-driver-shopify.mjs +99 -127
- package/fesm2022/daffodil-product-driver-shopify.mjs.map +1 -1
- package/fesm2022/daffodil-product-driver-testing.mjs +117 -87
- package/fesm2022/daffodil-product-driver-testing.mjs.map +1 -1
- package/fesm2022/daffodil-product-driver.mjs +22 -45
- package/fesm2022/daffodil-product-driver.mjs.map +1 -1
- package/fesm2022/daffodil-product-routing.mjs +347 -285
- package/fesm2022/daffodil-product-routing.mjs.map +1 -1
- package/fesm2022/daffodil-product-state-testing.mjs +189 -106
- package/fesm2022/daffodil-product-state-testing.mjs.map +1 -1
- package/fesm2022/daffodil-product-state.mjs +566 -659
- package/fesm2022/daffodil-product-state.mjs.map +1 -1
- package/fesm2022/daffodil-product-testing.mjs +316 -276
- package/fesm2022/daffodil-product-testing.mjs.map +1 -1
- package/fesm2022/daffodil-product.mjs +8 -29
- package/fesm2022/daffodil-product.mjs.map +1 -1
- package/package.json +1 -1
- package/types/daffodil-product-driver-in-memory.d.ts +65 -75
- package/types/daffodil-product-driver-magento-2.4.7-testing.d.ts +105 -0
- package/types/daffodil-product-driver-magento-2.4.7.d.ts +337 -0
- package/types/daffodil-product-driver-magento-auto-testing.d.ts +1 -0
- package/types/daffodil-product-driver-magento-auto.d.ts +1 -0
- package/types/daffodil-product-driver-shopify.d.ts +31 -43
- package/types/daffodil-product-driver-testing.d.ts +28 -26
- package/types/daffodil-product-driver.d.ts +50 -61
- package/types/daffodil-product-routing.d.ts +101 -110
- package/types/daffodil-product-state-testing.d.ts +45 -43
- package/types/daffodil-product-state.d.ts +347 -375
- package/types/daffodil-product-testing.d.ts +82 -89
- package/types/daffodil-product.d.ts +93 -102
- package/fesm2022/daffodil-product-driver-magento-testing.mjs +0 -275
- package/fesm2022/daffodil-product-driver-magento-testing.mjs.map +0 -1
- package/fesm2022/daffodil-product-driver-magento.mjs +0 -855
- package/fesm2022/daffodil-product-driver-magento.mjs.map +0 -1
- package/types/daffodil-product-driver-magento-testing.d.ts +0 -114
- package/types/daffodil-product-driver-magento.d.ts +0 -396
|
@@ -1,281 +1,321 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import {
|
|
3
|
-
import { faker } from
|
|
4
|
-
import * as i2 from
|
|
5
|
-
import { DaffModelFactory, MockCollection } from
|
|
6
|
-
import { createServicesInjectionToken, sample } from
|
|
7
|
-
import { DaffProductTypeEnum } from
|
|
8
|
-
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { Inject, Injectable, NgModule, makeEnvironmentProviders } from "@angular/core";
|
|
3
|
+
import { faker } from "@faker-js/faker/locale/en_US";
|
|
4
|
+
import * as i2 from "@daffodil/core/testing";
|
|
5
|
+
import { DaffModelFactory, MockCollection } from "@daffodil/core/testing";
|
|
6
|
+
import { createServicesInjectionToken, sample } from "@daffodil/core";
|
|
7
|
+
import { DaffProductTypeEnum } from "@daffodil/product";
|
|
9
8
|
const productImageUrlsList = [
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
9
|
+
"https://assets.daff.io/elegant_gold_soap.png",
|
|
10
|
+
"https://assets.daff.io/elegant_plastic_gloves.png",
|
|
11
|
+
"https://assets.daff.io/ergonomic_bronze_pants.png",
|
|
12
|
+
"https://assets.daff.io/fantastic_aluminum_keyboard.png",
|
|
13
|
+
"https://assets.daff.io/frozen_metal_soap_bubbles.png",
|
|
14
|
+
"https://assets.daff.io/frozen_metal_soap.png",
|
|
15
|
+
"https://assets.daff.io/handcrafted_bamboo_cheese.png",
|
|
16
|
+
"https://assets.daff.io/incredible_ceramic_bike_blue.png",
|
|
17
|
+
"https://assets.daff.io/modern_bronze_chair.png",
|
|
18
|
+
"https://assets.daff.io/modern_granite_tuna.png",
|
|
19
|
+
"https://assets.daff.io/recycled_wooden_table.png",
|
|
20
|
+
"https://assets.daff.io/refined_cotton_pants.png",
|
|
21
|
+
"https://assets.daff.io/refined_rubber_gloves.png",
|
|
22
|
+
"https://assets.daff.io/rustic_bronze_computer.png",
|
|
23
|
+
"https://assets.daff.io/rustic_ceramic_chips.png",
|
|
24
|
+
"https://assets.daff.io/sleek_metal_shirt.png",
|
|
25
|
+
"https://assets.daff.io/soft_granite_pants.png",
|
|
26
|
+
"https://assets.daff.io/tasty_wooden_sausages.png"
|
|
28
27
|
];
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
28
|
+
var MockProductImage = class {
|
|
29
|
+
constructor() {
|
|
30
|
+
this.id = faker.string.uuid();
|
|
31
|
+
this.url = productImageUrlsList[faker.number.int(productImageUrlsList.length - 1)];
|
|
32
|
+
this.label = faker.lorem.sentence();
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
var DaffProductImageFactory = class DaffProductImageFactory extends DaffModelFactory {
|
|
36
|
+
constructor() {
|
|
37
|
+
super(MockProductImage);
|
|
38
|
+
}
|
|
39
|
+
static {
|
|
40
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
41
|
+
minVersion: "12.0.0",
|
|
42
|
+
version: "22.2.4",
|
|
43
|
+
ngImport: i0,
|
|
44
|
+
type: DaffProductImageFactory,
|
|
45
|
+
deps: [],
|
|
46
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
static {
|
|
50
|
+
this.ɵprov = i0.ɵɵngDeclareInjectable({
|
|
51
|
+
minVersion: "12.0.0",
|
|
52
|
+
version: "22.2.4",
|
|
53
|
+
ngImport: i0,
|
|
54
|
+
type: DaffProductImageFactory,
|
|
55
|
+
providedIn: "root"
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
60
|
+
minVersion: "12.0.0",
|
|
61
|
+
version: "22.2.4",
|
|
62
|
+
ngImport: i0,
|
|
63
|
+
type: DaffProductImageFactory,
|
|
64
|
+
decorators: [{
|
|
65
|
+
type: Injectable,
|
|
66
|
+
args: [{ providedIn: "root" }]
|
|
67
|
+
}],
|
|
68
|
+
ctorParameters: () => []
|
|
69
|
+
});
|
|
70
|
+
var MockProduct = class {
|
|
71
|
+
constructor(imageFactory) {
|
|
72
|
+
this.imageFactory = imageFactory;
|
|
73
|
+
this.stubPrice = faker.number.int({
|
|
74
|
+
min: 1,
|
|
75
|
+
max: 1500
|
|
76
|
+
});
|
|
77
|
+
this.stubDiscount = faker.number.int({
|
|
78
|
+
min: 0,
|
|
79
|
+
max: this.stubPrice - 1
|
|
80
|
+
});
|
|
81
|
+
this.type = DaffProductTypeEnum.Simple;
|
|
82
|
+
this.id = faker.string.uuid();
|
|
83
|
+
this.url = `/${faker.internet.domainWord()}.html`;
|
|
84
|
+
this.canonicalUrl = faker.internet.url();
|
|
85
|
+
this.price = this.stubPrice;
|
|
86
|
+
this.in_stock = true;
|
|
87
|
+
this.discount = {
|
|
88
|
+
amount: this.stubDiscount,
|
|
89
|
+
percent: Math.floor(this.stubDiscount / this.stubPrice * 100)
|
|
90
|
+
};
|
|
91
|
+
this.images = this.imageFactory.createMany(faker.number.int({
|
|
92
|
+
min: 1,
|
|
93
|
+
max: 10
|
|
94
|
+
}));
|
|
95
|
+
this.thumbnail = this.imageFactory.create();
|
|
96
|
+
this.name = faker.commerce.productName();
|
|
97
|
+
this.brand = faker.company.name();
|
|
98
|
+
this.description = faker.commerce.productDescription();
|
|
99
|
+
this.short_description = faker.commerce.productDescription();
|
|
100
|
+
this.meta_title = faker.commerce.productName();
|
|
101
|
+
this.meta_description = faker.commerce.productDescription();
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
var DaffDefaultProductFactory = class DaffDefaultProductFactory extends DaffModelFactory {
|
|
105
|
+
constructor(imageFactory) {
|
|
106
|
+
super(MockProduct, imageFactory);
|
|
107
|
+
}
|
|
108
|
+
static {
|
|
109
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
110
|
+
minVersion: "12.0.0",
|
|
111
|
+
version: "22.2.4",
|
|
112
|
+
ngImport: i0,
|
|
113
|
+
type: DaffDefaultProductFactory,
|
|
114
|
+
deps: [{ token: DaffProductImageFactory }],
|
|
115
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
static {
|
|
119
|
+
this.ɵprov = i0.ɵɵngDeclareInjectable({
|
|
120
|
+
minVersion: "12.0.0",
|
|
121
|
+
version: "22.2.4",
|
|
122
|
+
ngImport: i0,
|
|
123
|
+
type: DaffDefaultProductFactory,
|
|
124
|
+
providedIn: "root"
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
129
|
+
minVersion: "12.0.0",
|
|
130
|
+
version: "22.2.4",
|
|
131
|
+
ngImport: i0,
|
|
132
|
+
type: DaffDefaultProductFactory,
|
|
133
|
+
decorators: [{
|
|
134
|
+
type: Injectable,
|
|
135
|
+
args: [{ providedIn: "root" }]
|
|
136
|
+
}],
|
|
137
|
+
ctorParameters: () => [{ type: DaffProductImageFactory }]
|
|
138
|
+
});
|
|
139
|
+
const { token: DAFF_PRODUCT_TYPE_FACTORIES, provider: provideDaffProductExtraFactoryTypes } = createServicesInjectionToken("DAFF_PRODUCT_TYPE_FACTORIES", { providedIn: "root" });
|
|
140
|
+
const { token: DAFF_PRODUCT_EXTRA_FACTORIES, provider: provideDaffProductExtraProductFactories } = createServicesInjectionToken("DAFF_PRODUCT_EXTRA_FACTORIES", { providedIn: "root" });
|
|
141
|
+
var DaffProductKindFactory = class DaffProductKindFactory extends DaffModelFactory {
|
|
142
|
+
constructor(productTypeFactories) {
|
|
143
|
+
super(MockProduct);
|
|
144
|
+
this.productTypeFactories = productTypeFactories;
|
|
145
|
+
}
|
|
146
|
+
get _randomFactory() {
|
|
147
|
+
return sample(this.productTypeFactories);
|
|
148
|
+
}
|
|
149
|
+
create(partial = {}) {
|
|
150
|
+
return this._randomFactory.create(partial);
|
|
151
|
+
}
|
|
152
|
+
static {
|
|
153
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
154
|
+
minVersion: "12.0.0",
|
|
155
|
+
version: "22.2.4",
|
|
156
|
+
ngImport: i0,
|
|
157
|
+
type: DaffProductKindFactory,
|
|
158
|
+
deps: [{ token: DAFF_PRODUCT_TYPE_FACTORIES }],
|
|
159
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
static {
|
|
163
|
+
this.ɵprov = i0.ɵɵngDeclareInjectable({
|
|
164
|
+
minVersion: "12.0.0",
|
|
165
|
+
version: "22.2.4",
|
|
166
|
+
ngImport: i0,
|
|
167
|
+
type: DaffProductKindFactory,
|
|
168
|
+
providedIn: "root"
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
173
|
+
minVersion: "12.0.0",
|
|
174
|
+
version: "22.2.4",
|
|
175
|
+
ngImport: i0,
|
|
176
|
+
type: DaffProductKindFactory,
|
|
177
|
+
decorators: [{
|
|
178
|
+
type: Injectable,
|
|
179
|
+
args: [{ providedIn: "root" }]
|
|
180
|
+
}],
|
|
181
|
+
ctorParameters: () => [{
|
|
182
|
+
type: void 0,
|
|
183
|
+
decorators: [{
|
|
184
|
+
type: Inject,
|
|
185
|
+
args: [DAFF_PRODUCT_TYPE_FACTORIES]
|
|
186
|
+
}]
|
|
187
|
+
}]
|
|
188
|
+
});
|
|
189
|
+
var DaffProductExtensionFactory = class DaffProductExtensionFactory extends DaffModelFactory {
|
|
190
|
+
constructor(extraFactories, productKindFactory) {
|
|
191
|
+
super(null);
|
|
192
|
+
this.extraFactories = extraFactories;
|
|
193
|
+
this.productKindFactory = productKindFactory;
|
|
194
|
+
}
|
|
195
|
+
create(partial = {}) {
|
|
196
|
+
const kind = this.productKindFactory.create(partial);
|
|
197
|
+
return Object.assign({}, kind, ...this.extraFactories.map((factory) => factory.create(partial)), { type: kind.type });
|
|
198
|
+
}
|
|
199
|
+
static {
|
|
200
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
201
|
+
minVersion: "12.0.0",
|
|
202
|
+
version: "22.2.4",
|
|
203
|
+
ngImport: i0,
|
|
204
|
+
type: DaffProductExtensionFactory,
|
|
205
|
+
deps: [{ token: DAFF_PRODUCT_EXTRA_FACTORIES }, { token: DaffProductKindFactory }],
|
|
206
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
static {
|
|
210
|
+
this.ɵprov = i0.ɵɵngDeclareInjectable({
|
|
211
|
+
minVersion: "12.0.0",
|
|
212
|
+
version: "22.2.4",
|
|
213
|
+
ngImport: i0,
|
|
214
|
+
type: DaffProductExtensionFactory,
|
|
215
|
+
providedIn: "root"
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
220
|
+
minVersion: "12.0.0",
|
|
221
|
+
version: "22.2.4",
|
|
222
|
+
ngImport: i0,
|
|
223
|
+
type: DaffProductExtensionFactory,
|
|
224
|
+
decorators: [{
|
|
225
|
+
type: Injectable,
|
|
226
|
+
args: [{ providedIn: "root" }]
|
|
227
|
+
}],
|
|
228
|
+
ctorParameters: () => [{
|
|
229
|
+
type: void 0,
|
|
230
|
+
decorators: [{
|
|
231
|
+
type: Inject,
|
|
232
|
+
args: [DAFF_PRODUCT_EXTRA_FACTORIES]
|
|
233
|
+
}]
|
|
234
|
+
}, { type: DaffProductKindFactory }]
|
|
235
|
+
});
|
|
236
|
+
var MockProductCollection = class extends MockCollection {
|
|
237
|
+
constructor(productFactory, metadataFactory) {
|
|
238
|
+
super(productFactory, metadataFactory);
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
var DaffProductCollectionFactory = class DaffProductCollectionFactory extends DaffModelFactory {
|
|
242
|
+
constructor(productFactory, metadataFactory) {
|
|
243
|
+
super(MockProductCollection, productFactory, metadataFactory);
|
|
244
|
+
}
|
|
245
|
+
static {
|
|
246
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
247
|
+
minVersion: "12.0.0",
|
|
248
|
+
version: "22.2.4",
|
|
249
|
+
ngImport: i0,
|
|
250
|
+
type: DaffProductCollectionFactory,
|
|
251
|
+
deps: [{ token: DaffProductKindFactory }, { token: i2.DaffCollectionMetadataFactory }],
|
|
252
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
static {
|
|
256
|
+
this.ɵprov = i0.ɵɵngDeclareInjectable({
|
|
257
|
+
minVersion: "12.0.0",
|
|
258
|
+
version: "22.2.4",
|
|
259
|
+
ngImport: i0,
|
|
260
|
+
type: DaffProductCollectionFactory,
|
|
261
|
+
providedIn: "root"
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
};
|
|
265
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
266
|
+
minVersion: "12.0.0",
|
|
267
|
+
version: "22.2.4",
|
|
268
|
+
ngImport: i0,
|
|
269
|
+
type: DaffProductCollectionFactory,
|
|
270
|
+
decorators: [{
|
|
271
|
+
type: Injectable,
|
|
272
|
+
args: [{ providedIn: "root" }]
|
|
273
|
+
}],
|
|
274
|
+
ctorParameters: () => [{ type: DaffProductKindFactory }, { type: i2.DaffCollectionMetadataFactory }]
|
|
275
|
+
});
|
|
248
276
|
function isProduct(product) {
|
|
249
|
-
|
|
250
|
-
&& !!product.price
|
|
251
|
-
&& !!product.name
|
|
252
|
-
&& !!product.brand
|
|
253
|
-
&& !!product.description
|
|
254
|
-
&& !!product.images;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
/**
|
|
258
|
-
* Provides the default product factory as a product type factory.
|
|
259
|
-
*/
|
|
260
|
-
class DaffProductTestingModule {
|
|
261
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffProductTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
262
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.9", ngImport: i0, type: DaffProductTestingModule }); }
|
|
263
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DaffProductTestingModule, providers: [
|
|
264
|
-
provideDaffProductExtraFactoryTypes(DaffDefaultProductFactory),
|
|
265
|
-
] }); }
|
|
277
|
+
return !!product.id && !!product.price && !!product.name && !!product.brand && !!product.description && !!product.images;
|
|
266
278
|
}
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
+
const provideDaffProductTesting = () => makeEnvironmentProviders([provideDaffProductExtraFactoryTypes(DaffDefaultProductFactory)]);
|
|
280
|
+
var DaffProductTestingModule = class DaffProductTestingModule {
|
|
281
|
+
static {
|
|
282
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
283
|
+
minVersion: "12.0.0",
|
|
284
|
+
version: "22.2.4",
|
|
285
|
+
ngImport: i0,
|
|
286
|
+
type: DaffProductTestingModule,
|
|
287
|
+
deps: [],
|
|
288
|
+
target: i0.ɵɵFactoryTarget.NgModule
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
static {
|
|
292
|
+
this.ɵmod = i0.ɵɵngDeclareNgModule({
|
|
293
|
+
minVersion: "14.0.0",
|
|
294
|
+
version: "22.2.4",
|
|
295
|
+
ngImport: i0,
|
|
296
|
+
type: DaffProductTestingModule
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
static {
|
|
300
|
+
this.ɵinj = i0.ɵɵngDeclareInjector({
|
|
301
|
+
minVersion: "12.0.0",
|
|
302
|
+
version: "22.2.4",
|
|
303
|
+
ngImport: i0,
|
|
304
|
+
type: DaffProductTestingModule,
|
|
305
|
+
providers: [provideDaffProductTesting()]
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
};
|
|
309
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
310
|
+
minVersion: "12.0.0",
|
|
311
|
+
version: "22.2.4",
|
|
312
|
+
ngImport: i0,
|
|
313
|
+
type: DaffProductTestingModule,
|
|
314
|
+
decorators: [{
|
|
315
|
+
type: NgModule,
|
|
316
|
+
args: [{ providers: [provideDaffProductTesting()] }]
|
|
317
|
+
}]
|
|
318
|
+
});
|
|
319
|
+
export { DAFF_PRODUCT_EXTRA_FACTORIES, DAFF_PRODUCT_TYPE_FACTORIES, DaffDefaultProductFactory, DaffDefaultProductFactory as DaffProductFactory, DaffProductCollectionFactory, DaffProductExtensionFactory, DaffProductImageFactory, DaffProductKindFactory, DaffProductTestingModule, MockProduct, MockProductCollection, MockProductImage, isProduct, provideDaffProductExtraFactoryTypes, provideDaffProductExtraProductFactories, provideDaffProductTesting };
|
|
279
320
|
|
|
280
|
-
|
|
281
|
-
//# sourceMappingURL=daffodil-product-testing.mjs.map
|
|
321
|
+
//# sourceMappingURL=daffodil-product-testing.mjs.map
|