@infrab4a/connect 0.13.5 → 0.14.1-beta.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/bundles/infrab4a-connect.umd.js +35 -5
- package/bundles/infrab4a-connect.umd.js.map +1 -1
- package/esm2015/lib/domain/users/services/authentication.service.js +1 -1
- package/esm2015/lib/domain/users/use-cases/index.js +2 -1
- package/esm2015/lib/domain/users/use-cases/recovery-password.js +12 -0
- package/esm2015/lib/infra/firebase/auth/authentication-firebase-auth.service.js +6 -1
- package/esm2015/lib/infra/firebase/firestore/mixins/with-find-firestore.mixin.js +8 -6
- package/fesm2015/infrab4a-connect.js +24 -6
- package/fesm2015/infrab4a-connect.js.map +1 -1
- package/lib/domain/users/services/authentication.service.d.ts +1 -0
- package/lib/domain/users/use-cases/index.d.ts +1 -0
- package/lib/domain/users/use-cases/recovery-password.d.ts +6 -0
- package/lib/infra/firebase/auth/authentication-firebase-auth.service.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1093,6 +1093,25 @@
|
|
|
1093
1093
|
return SignOut;
|
|
1094
1094
|
}());
|
|
1095
1095
|
|
|
1096
|
+
var RecoveryPassword = /** @class */ (function () {
|
|
1097
|
+
function RecoveryPassword(authService) {
|
|
1098
|
+
this.authService = authService;
|
|
1099
|
+
}
|
|
1100
|
+
RecoveryPassword.prototype.sendEmail = function (email) {
|
|
1101
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1102
|
+
return __generator(this, function (_a) {
|
|
1103
|
+
switch (_a.label) {
|
|
1104
|
+
case 0: return [4 /*yield*/, this.authService.sendPasswordResetEmail(email)];
|
|
1105
|
+
case 1:
|
|
1106
|
+
_a.sent();
|
|
1107
|
+
return [2 /*return*/];
|
|
1108
|
+
}
|
|
1109
|
+
});
|
|
1110
|
+
});
|
|
1111
|
+
};
|
|
1112
|
+
return RecoveryPassword;
|
|
1113
|
+
}());
|
|
1114
|
+
|
|
1096
1115
|
exports.Shops = void 0;
|
|
1097
1116
|
(function (Shops) {
|
|
1098
1117
|
Shops["MENSMARKET"] = "mensmarket";
|
|
@@ -1559,20 +1578,23 @@
|
|
|
1559
1578
|
var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
|
|
1560
1579
|
_this.makeFirestoreWhere = function (queryReference, filter) { return Object.keys(filter).reduce(function (query, fieldName) { return _this.buildWhereSentence(query, fieldName, filter[fieldName]); }, queryReference); };
|
|
1561
1580
|
_this.buildWhereSentence = function (queryReference, fieldName, options) {
|
|
1581
|
+
var _b;
|
|
1562
1582
|
if (_this.isSubCollection(_this) && fieldName === _this.parentIdField)
|
|
1563
1583
|
return queryReference;
|
|
1584
|
+
var plainInstance = new _this.model((_b = {}, _b[fieldName] = options === null || options === void 0 ? void 0 : options.value, _b)).toPlain();
|
|
1585
|
+
var firestoreFieldName = Object.keys(plainInstance).find(function (key) { return plainInstance[key] === (options === null || options === void 0 ? void 0 : options.value); });
|
|
1564
1586
|
if ((options === null || options === void 0 ? void 0 : options.operator) === exports.Where.LIKE) {
|
|
1565
1587
|
if (Array.isArray(options === null || options === void 0 ? void 0 : options.value))
|
|
1566
|
-
return queryReference.where(
|
|
1567
|
-
queryReference = queryReference.where(
|
|
1568
|
-
queryReference = queryReference.where(
|
|
1588
|
+
return queryReference.where(firestoreFieldName, 'array-contains-any', options.value);
|
|
1589
|
+
queryReference = queryReference.where(firestoreFieldName, '>=', options.value);
|
|
1590
|
+
queryReference = queryReference.where(firestoreFieldName, '<=', options.value + "~");
|
|
1569
1591
|
return queryReference;
|
|
1570
1592
|
}
|
|
1571
1593
|
if ((options === null || options === void 0 ? void 0 : options.operator) === exports.Where.IN && Array.isArray(options === null || options === void 0 ? void 0 : options.value))
|
|
1572
|
-
return queryReference.where(
|
|
1594
|
+
return queryReference.where(firestoreFieldName, 'array-contains', options.value);
|
|
1573
1595
|
if (lodash.isObject(options) && lodash.isNil(options === null || options === void 0 ? void 0 : options.operator) && lodash.isNil(options === null || options === void 0 ? void 0 : options.value))
|
|
1574
1596
|
return Object.keys(options).reduce(function (queryReferenceWithWhere, key) { return _this.buildWhereSentence(queryReferenceWithWhere, fieldName + "." + key, options[key]); }, queryReference);
|
|
1575
|
-
return queryReference.where(
|
|
1597
|
+
return queryReference.where(firestoreFieldName, (options === null || options === void 0 ? void 0 : options.operator) || '==', (options === null || options === void 0 ? void 0 : options.value) || options);
|
|
1576
1598
|
};
|
|
1577
1599
|
return _this;
|
|
1578
1600
|
}
|
|
@@ -2413,6 +2435,13 @@
|
|
|
2413
2435
|
});
|
|
2414
2436
|
});
|
|
2415
2437
|
};
|
|
2438
|
+
AuthenticationFirebaseAuthService.prototype.sendPasswordResetEmail = function (email) {
|
|
2439
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
2440
|
+
return __generator(this, function (_a) {
|
|
2441
|
+
return [2 /*return*/, this.firebaseAuth.sendPasswordResetEmail(email)];
|
|
2442
|
+
});
|
|
2443
|
+
});
|
|
2444
|
+
};
|
|
2416
2445
|
return AuthenticationFirebaseAuthService;
|
|
2417
2446
|
}());
|
|
2418
2447
|
|
|
@@ -2516,6 +2545,7 @@
|
|
|
2516
2545
|
exports.Product = Product;
|
|
2517
2546
|
exports.ProductFirestoreRepository = ProductFirestoreRepository;
|
|
2518
2547
|
exports.ProductVariantFirestoreRepository = ProductVariantFirestoreRepository;
|
|
2548
|
+
exports.RecoveryPassword = RecoveryPassword;
|
|
2519
2549
|
exports.Register = Register;
|
|
2520
2550
|
exports.RegisterFirebaseAuthService = RegisterFirebaseAuthService;
|
|
2521
2551
|
exports.RequiredArgumentError = RequiredArgumentError;
|