@infrab4a/connect-angular 3.4.0-beta.3 → 3.4.0-beta.5
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/bundles/infrab4a-connect-angular.umd.js +39 -108
- package/bundles/infrab4a-connect-angular.umd.js.map +1 -1
- package/esm2015/services/shipping.service.js +14 -13
- package/fesm2015/infrab4a-connect-angular.js +13 -9
- package/fesm2015/infrab4a-connect-angular.js.map +1 -1
- package/package.json +1 -1
- package/services/shipping.service.d.ts +1 -3
- package/package-lock.json +0 -18
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
var i1__namespace$2 = /*#__PURE__*/_interopNamespace(i1$2);
|
|
32
32
|
var i1__namespace$3 = /*#__PURE__*/_interopNamespace(i1$3);
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
/*! *****************************************************************************
|
|
35
35
|
Copyright (c) Microsoft Corporation.
|
|
36
36
|
|
|
37
37
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -98,64 +98,6 @@
|
|
|
98
98
|
function __param(paramIndex, decorator) {
|
|
99
99
|
return function (target, key) { decorator(target, key, paramIndex); };
|
|
100
100
|
}
|
|
101
|
-
function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
102
|
-
function accept(f) { if (f !== void 0 && typeof f !== "function")
|
|
103
|
-
throw new TypeError("Function expected"); return f; }
|
|
104
|
-
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
105
|
-
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
106
|
-
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
107
|
-
var _, done = false;
|
|
108
|
-
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
109
|
-
var context = {};
|
|
110
|
-
for (var p in contextIn)
|
|
111
|
-
context[p] = p === "access" ? {} : contextIn[p];
|
|
112
|
-
for (var p in contextIn.access)
|
|
113
|
-
context.access[p] = contextIn.access[p];
|
|
114
|
-
context.addInitializer = function (f) { if (done)
|
|
115
|
-
throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
116
|
-
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
117
|
-
if (kind === "accessor") {
|
|
118
|
-
if (result === void 0)
|
|
119
|
-
continue;
|
|
120
|
-
if (result === null || typeof result !== "object")
|
|
121
|
-
throw new TypeError("Object expected");
|
|
122
|
-
if (_ = accept(result.get))
|
|
123
|
-
descriptor.get = _;
|
|
124
|
-
if (_ = accept(result.set))
|
|
125
|
-
descriptor.set = _;
|
|
126
|
-
if (_ = accept(result.init))
|
|
127
|
-
initializers.push(_);
|
|
128
|
-
}
|
|
129
|
-
else if (_ = accept(result)) {
|
|
130
|
-
if (kind === "field")
|
|
131
|
-
initializers.push(_);
|
|
132
|
-
else
|
|
133
|
-
descriptor[key] = _;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
if (target)
|
|
137
|
-
Object.defineProperty(target, contextIn.name, descriptor);
|
|
138
|
-
done = true;
|
|
139
|
-
}
|
|
140
|
-
;
|
|
141
|
-
function __runInitializers(thisArg, initializers, value) {
|
|
142
|
-
var useValue = arguments.length > 2;
|
|
143
|
-
for (var i = 0; i < initializers.length; i++) {
|
|
144
|
-
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
145
|
-
}
|
|
146
|
-
return useValue ? value : void 0;
|
|
147
|
-
}
|
|
148
|
-
;
|
|
149
|
-
function __propKey(x) {
|
|
150
|
-
return typeof x === "symbol" ? x : "".concat(x);
|
|
151
|
-
}
|
|
152
|
-
;
|
|
153
|
-
function __setFunctionName(f, name, prefix) {
|
|
154
|
-
if (typeof name === "symbol")
|
|
155
|
-
name = name.description ? "[".concat(name.description, "]") : "";
|
|
156
|
-
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
|
157
|
-
}
|
|
158
|
-
;
|
|
159
101
|
function __metadata(metadataKey, metadataValue) {
|
|
160
102
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
161
103
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
@@ -187,7 +129,7 @@
|
|
|
187
129
|
function step(op) {
|
|
188
130
|
if (f)
|
|
189
131
|
throw new TypeError("Generator is already executing.");
|
|
190
|
-
while (
|
|
132
|
+
while (_)
|
|
191
133
|
try {
|
|
192
134
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
|
193
135
|
return t;
|
|
@@ -251,11 +193,7 @@
|
|
|
251
193
|
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
|
252
194
|
if (k2 === undefined)
|
|
253
195
|
k2 = k;
|
|
254
|
-
|
|
255
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
256
|
-
desc = { enumerable: true, get: function () { return m[k]; } };
|
|
257
|
-
}
|
|
258
|
-
Object.defineProperty(o, k2, desc);
|
|
196
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
|
|
259
197
|
}) : (function (o, m, k, k2) {
|
|
260
198
|
if (k2 === undefined)
|
|
261
199
|
k2 = k;
|
|
@@ -355,7 +293,7 @@
|
|
|
355
293
|
function __asyncDelegator(o) {
|
|
356
294
|
var i, p;
|
|
357
295
|
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
358
|
-
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done:
|
|
296
|
+
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
|
359
297
|
}
|
|
360
298
|
function __asyncValues(o) {
|
|
361
299
|
if (!Symbol.asyncIterator)
|
|
@@ -409,11 +347,6 @@
|
|
|
409
347
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
410
348
|
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
411
349
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
412
|
-
}
|
|
413
|
-
function __classPrivateFieldIn(state, receiver) {
|
|
414
|
-
if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function"))
|
|
415
|
-
throw new TypeError("Cannot use 'in' operator on non-object");
|
|
416
|
-
return typeof state === "function" ? receiver === state : state.has(receiver);
|
|
417
350
|
}
|
|
418
351
|
|
|
419
352
|
var AuthService = /** @class */ (function () {
|
|
@@ -1290,51 +1223,49 @@
|
|
|
1290
1223
|
} });
|
|
1291
1224
|
|
|
1292
1225
|
var ShippingService = /** @class */ (function () {
|
|
1293
|
-
function ShippingService(http,
|
|
1226
|
+
function ShippingService(http,
|
|
1227
|
+
// private homeService: HomeShopService,
|
|
1228
|
+
apiUrl) {
|
|
1294
1229
|
this.http = http;
|
|
1295
|
-
this.homeService = homeService;
|
|
1296
1230
|
this.apiUrl = apiUrl;
|
|
1297
1231
|
}
|
|
1298
1232
|
ShippingService.prototype.getMensShippingMethods = function (zip, weightGrams, totalPrice, personId, shop, subscriptionPlan) {
|
|
1299
1233
|
var _this = this;
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
]).pipe(
|
|
1234
|
+
// combineLatest([
|
|
1235
|
+
// this.homeService.getHomeData(),
|
|
1236
|
+
// this.http.get(`${this.apiUrl}open/checkshippingcompany?personId=${personId}&postalCode=${zip}&weightGrams=${weightGrams}`)
|
|
1237
|
+
// ]).pipe(
|
|
1238
|
+
// map((datas, shippings) => console.log('combineLatest', datas, shippings))
|
|
1239
|
+
// )
|
|
1304
1240
|
return this.http.get(this.apiUrl + "open/checkshippingcompany?personId=" + personId + "&postalCode=" + zip + "&weightGrams=" + weightGrams)
|
|
1305
1241
|
.pipe(operators.map(function (data) { return data.result; }), operators.map(function (shippingMethods) { return __awaiter(_this, void 0, void 0, function () {
|
|
1306
1242
|
var shippingMethodsResponse, datas;
|
|
1307
1243
|
return __generator(this, function (_a) {
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
return Object.assign(Object.assign({}, s), { totalPrice: s.totalPrice / 2 });
|
|
1332
|
-
else
|
|
1333
|
-
return s;
|
|
1334
|
-
})];
|
|
1335
|
-
}
|
|
1336
|
-
return [2 /*return*/, shippingMethodsResponse];
|
|
1244
|
+
shippingMethodsResponse = shippingMethods;
|
|
1245
|
+
console.log('shippingMethods', shippingMethods);
|
|
1246
|
+
if (!shippingMethods.length)
|
|
1247
|
+
return [2 /*return*/, []];
|
|
1248
|
+
datas = [];
|
|
1249
|
+
if (this.isHolidays(datas)) {
|
|
1250
|
+
shippingMethodsResponse = shippingMethods.filter(function (method) { return method.ShippingCompanyName !== 'Same Day'; });
|
|
1251
|
+
}
|
|
1252
|
+
if (totalPrice >= 200 || this.isFreeShippingBySubscription(shop, subscriptionPlan)) {
|
|
1253
|
+
return [2 /*return*/, shippingMethodsResponse.map(function (s) {
|
|
1254
|
+
if (s.serviceName !== 'Same Day')
|
|
1255
|
+
return Object.assign(Object.assign({}, s), { totalPrice: 0 });
|
|
1256
|
+
else
|
|
1257
|
+
return s;
|
|
1258
|
+
})];
|
|
1259
|
+
}
|
|
1260
|
+
if (this.isFreeShippingBySubscription(shop, subscriptionPlan)) {
|
|
1261
|
+
return [2 /*return*/, shippingMethodsResponse.map(function (s) {
|
|
1262
|
+
if (s.serviceName !== 'Same Day')
|
|
1263
|
+
return Object.assign(Object.assign({}, s), { totalPrice: s.totalPrice / 2 });
|
|
1264
|
+
else
|
|
1265
|
+
return s;
|
|
1266
|
+
})];
|
|
1337
1267
|
}
|
|
1268
|
+
return [2 /*return*/, shippingMethodsResponse];
|
|
1338
1269
|
});
|
|
1339
1270
|
}); }));
|
|
1340
1271
|
};
|
|
@@ -1368,12 +1299,12 @@
|
|
|
1368
1299
|
};
|
|
1369
1300
|
return ShippingService;
|
|
1370
1301
|
}());
|
|
1371
|
-
ShippingService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: ShippingService, deps: [{ token: i1__namespace$3.HttpClient }, { token:
|
|
1302
|
+
ShippingService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: ShippingService, deps: [{ token: i1__namespace$3.HttpClient }, { token: API_URL }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1372
1303
|
ShippingService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: ShippingService });
|
|
1373
1304
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: ShippingService, decorators: [{
|
|
1374
1305
|
type: i0.Injectable
|
|
1375
1306
|
}], ctorParameters: function () {
|
|
1376
|
-
return [{ type: i1__namespace$3.HttpClient }, { type:
|
|
1307
|
+
return [{ type: i1__namespace$3.HttpClient }, { type: undefined, decorators: [{
|
|
1377
1308
|
type: i0.Inject,
|
|
1378
1309
|
args: [API_URL]
|
|
1379
1310
|
}] }];
|