@rapidrest/auth 1.0.0-beta.1
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/LICENSE +21 -0
- package/README.md +75 -0
- package/dist/lib/auth/BasicStrategy.js +82 -0
- package/dist/lib/auth/BasicStrategy.js.map +1 -0
- package/dist/lib/auth/FIDO2Strategy.js +179 -0
- package/dist/lib/auth/FIDO2Strategy.js.map +1 -0
- package/dist/lib/auth/MFAStrategy.js +219 -0
- package/dist/lib/auth/MFAStrategy.js.map +1 -0
- package/dist/lib/auth/OIDCStrategy.js +397 -0
- package/dist/lib/auth/OIDCStrategy.js.map +1 -0
- package/dist/lib/auth/OTPStrategy.js +143 -0
- package/dist/lib/auth/OTPStrategy.js.map +1 -0
- package/dist/lib/auth/PasskeyStrategy.js +185 -0
- package/dist/lib/auth/PasskeyStrategy.js.map +1 -0
- package/dist/lib/auth/TOTPStrategy.js +84 -0
- package/dist/lib/auth/TOTPStrategy.js.map +1 -0
- package/dist/lib/auth/index.js +10 -0
- package/dist/lib/auth/index.js.map +1 -0
- package/dist/lib/auth/shared.js +431 -0
- package/dist/lib/auth/shared.js.map +1 -0
- package/dist/lib/auth/types.js +12 -0
- package/dist/lib/auth/types.js.map +1 -0
- package/dist/lib/index.js +4 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/models/index.js +2 -0
- package/dist/lib/models/index.js.map +1 -0
- package/dist/lib/models/mongo/AliasMongo.js +77 -0
- package/dist/lib/models/mongo/AliasMongo.js.map +1 -0
- package/dist/lib/models/mongo/ProfileMongo.js +99 -0
- package/dist/lib/models/mongo/ProfileMongo.js.map +1 -0
- package/dist/lib/models/mongo/SecretMongo.js +71 -0
- package/dist/lib/models/mongo/SecretMongo.js.map +1 -0
- package/dist/lib/models/mongo/UserMongo.js +71 -0
- package/dist/lib/models/mongo/UserMongo.js.map +1 -0
- package/dist/lib/models/mongo/index.js +5 -0
- package/dist/lib/models/mongo/index.js.map +1 -0
- package/dist/lib/models/mongo.js +2 -0
- package/dist/lib/models/mongo.js.map +1 -0
- package/dist/lib/models/sql/AliasSQL.js +77 -0
- package/dist/lib/models/sql/AliasSQL.js.map +1 -0
- package/dist/lib/models/sql/ProfileSQL.js +99 -0
- package/dist/lib/models/sql/ProfileSQL.js.map +1 -0
- package/dist/lib/models/sql/SecretSQL.js +71 -0
- package/dist/lib/models/sql/SecretSQL.js.map +1 -0
- package/dist/lib/models/sql/UserSQL.js +68 -0
- package/dist/lib/models/sql/UserSQL.js.map +1 -0
- package/dist/lib/models/sql/index.js +5 -0
- package/dist/lib/models/sql/index.js.map +1 -0
- package/dist/lib/models/sql.js +2 -0
- package/dist/lib/models/sql.js.map +1 -0
- package/dist/lib/models/types.js +35 -0
- package/dist/lib/models/types.js.map +1 -0
- package/dist/lib/mongo.js +3 -0
- package/dist/lib/mongo.js.map +1 -0
- package/dist/lib/routes/BaseAliasRoute.js +10 -0
- package/dist/lib/routes/BaseAliasRoute.js.map +1 -0
- package/dist/lib/routes/BaseAuthBasicRoute.js +132 -0
- package/dist/lib/routes/BaseAuthBasicRoute.js.map +1 -0
- package/dist/lib/routes/BaseAuthFIDO2Route.js +191 -0
- package/dist/lib/routes/BaseAuthFIDO2Route.js.map +1 -0
- package/dist/lib/routes/BaseAuthMFARoute.js +310 -0
- package/dist/lib/routes/BaseAuthMFARoute.js.map +1 -0
- package/dist/lib/routes/BaseAuthOIDCRoute.js +231 -0
- package/dist/lib/routes/BaseAuthOIDCRoute.js.map +1 -0
- package/dist/lib/routes/BaseAuthOTPRoute.js +214 -0
- package/dist/lib/routes/BaseAuthOTPRoute.js.map +1 -0
- package/dist/lib/routes/BaseAuthPasskeyRoute.js +182 -0
- package/dist/lib/routes/BaseAuthPasskeyRoute.js.map +1 -0
- package/dist/lib/routes/BaseAuthTOTPRoute.js +133 -0
- package/dist/lib/routes/BaseAuthTOTPRoute.js.map +1 -0
- package/dist/lib/routes/BaseProfileRoute.js +10 -0
- package/dist/lib/routes/BaseProfileRoute.js.map +1 -0
- package/dist/lib/routes/BaseSecretRoute.js +399 -0
- package/dist/lib/routes/BaseSecretRoute.js.map +1 -0
- package/dist/lib/routes/BaseUserRoute.js +10 -0
- package/dist/lib/routes/BaseUserRoute.js.map +1 -0
- package/dist/lib/routes/UserUtils.js +78 -0
- package/dist/lib/routes/UserUtils.js.map +1 -0
- package/dist/lib/routes/index.js +13 -0
- package/dist/lib/routes/index.js.map +1 -0
- package/dist/lib/routes/mongo/BaseAliasRouteMongo.js +20 -0
- package/dist/lib/routes/mongo/BaseAliasRouteMongo.js.map +1 -0
- package/dist/lib/routes/mongo/BaseAuthBasicRouteMongo.js +14 -0
- package/dist/lib/routes/mongo/BaseAuthBasicRouteMongo.js.map +1 -0
- package/dist/lib/routes/mongo/BaseAuthFIDO2RouteMongo.js +14 -0
- package/dist/lib/routes/mongo/BaseAuthFIDO2RouteMongo.js.map +1 -0
- package/dist/lib/routes/mongo/BaseAuthMFARouteMongo.js +14 -0
- package/dist/lib/routes/mongo/BaseAuthMFARouteMongo.js.map +1 -0
- package/dist/lib/routes/mongo/BaseAuthOIDCRouteMongo.js +11 -0
- package/dist/lib/routes/mongo/BaseAuthOIDCRouteMongo.js.map +1 -0
- package/dist/lib/routes/mongo/BaseAuthOTPRouteMongo.js +14 -0
- package/dist/lib/routes/mongo/BaseAuthOTPRouteMongo.js.map +1 -0
- package/dist/lib/routes/mongo/BaseAuthPasskeyRouteMongo.js +14 -0
- package/dist/lib/routes/mongo/BaseAuthPasskeyRouteMongo.js.map +1 -0
- package/dist/lib/routes/mongo/BaseAuthTOTPRouteMongo.js +14 -0
- package/dist/lib/routes/mongo/BaseAuthTOTPRouteMongo.js.map +1 -0
- package/dist/lib/routes/mongo/BaseProfileRouteMongo.js +20 -0
- package/dist/lib/routes/mongo/BaseProfileRouteMongo.js.map +1 -0
- package/dist/lib/routes/mongo/BaseSecretRouteMongo.js +20 -0
- package/dist/lib/routes/mongo/BaseSecretRouteMongo.js.map +1 -0
- package/dist/lib/routes/mongo/BaseUserRouteMongo.js +20 -0
- package/dist/lib/routes/mongo/BaseUserRouteMongo.js.map +1 -0
- package/dist/lib/routes/mongo/index.js +12 -0
- package/dist/lib/routes/mongo/index.js.map +1 -0
- package/dist/lib/routes/mongo.js +2 -0
- package/dist/lib/routes/mongo.js.map +1 -0
- package/dist/lib/routes/sql/BaseAliasRouteSQL.js +20 -0
- package/dist/lib/routes/sql/BaseAliasRouteSQL.js.map +1 -0
- package/dist/lib/routes/sql/BaseAuthBasicRouteSQL.js +14 -0
- package/dist/lib/routes/sql/BaseAuthBasicRouteSQL.js.map +1 -0
- package/dist/lib/routes/sql/BaseAuthFIDO2RouteSQL.js +14 -0
- package/dist/lib/routes/sql/BaseAuthFIDO2RouteSQL.js.map +1 -0
- package/dist/lib/routes/sql/BaseAuthMFARouteSQL.js +14 -0
- package/dist/lib/routes/sql/BaseAuthMFARouteSQL.js.map +1 -0
- package/dist/lib/routes/sql/BaseAuthOIDCRouteSQL.js +11 -0
- package/dist/lib/routes/sql/BaseAuthOIDCRouteSQL.js.map +1 -0
- package/dist/lib/routes/sql/BaseAuthOTPRouteSQL.js +14 -0
- package/dist/lib/routes/sql/BaseAuthOTPRouteSQL.js.map +1 -0
- package/dist/lib/routes/sql/BaseAuthPasskeyRouteSQL.js +14 -0
- package/dist/lib/routes/sql/BaseAuthPasskeyRouteSQL.js.map +1 -0
- package/dist/lib/routes/sql/BaseAuthTOTPRouteSQL.js +14 -0
- package/dist/lib/routes/sql/BaseAuthTOTPRouteSQL.js.map +1 -0
- package/dist/lib/routes/sql/BaseProfileRouteSQL.js +20 -0
- package/dist/lib/routes/sql/BaseProfileRouteSQL.js.map +1 -0
- package/dist/lib/routes/sql/BaseSecretRouteSQL.js +20 -0
- package/dist/lib/routes/sql/BaseSecretRouteSQL.js.map +1 -0
- package/dist/lib/routes/sql/BaseUserRouteSQL.js +20 -0
- package/dist/lib/routes/sql/BaseUserRouteSQL.js.map +1 -0
- package/dist/lib/routes/sql/index.js +12 -0
- package/dist/lib/routes/sql/index.js.map +1 -0
- package/dist/lib/routes/sql.js +2 -0
- package/dist/lib/routes/sql.js.map +1 -0
- package/dist/lib/sql.js +3 -0
- package/dist/lib/sql.js.map +1 -0
- package/dist/types/auth/BasicStrategy.d.ts +39 -0
- package/dist/types/auth/FIDO2Strategy.d.ts +85 -0
- package/dist/types/auth/MFAStrategy.d.ts +110 -0
- package/dist/types/auth/OIDCStrategy.d.ts +188 -0
- package/dist/types/auth/OTPStrategy.d.ts +88 -0
- package/dist/types/auth/PasskeyStrategy.d.ts +81 -0
- package/dist/types/auth/TOTPStrategy.d.ts +49 -0
- package/dist/types/auth/index.d.ts +9 -0
- package/dist/types/auth/shared.d.ts +136 -0
- package/dist/types/auth/types.d.ts +127 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/models/index.d.ts +1 -0
- package/dist/types/models/mongo/AliasMongo.d.ts +15 -0
- package/dist/types/models/mongo/ProfileMongo.d.ts +17 -0
- package/dist/types/models/mongo/SecretMongo.d.ts +14 -0
- package/dist/types/models/mongo/UserMongo.d.ts +14 -0
- package/dist/types/models/mongo/index.d.ts +4 -0
- package/dist/types/models/mongo.d.ts +1 -0
- package/dist/types/models/sql/AliasSQL.d.ts +15 -0
- package/dist/types/models/sql/ProfileSQL.d.ts +17 -0
- package/dist/types/models/sql/SecretSQL.d.ts +14 -0
- package/dist/types/models/sql/UserSQL.d.ts +14 -0
- package/dist/types/models/sql/index.d.ts +4 -0
- package/dist/types/models/sql.d.ts +1 -0
- package/dist/types/models/types.d.ts +136 -0
- package/dist/types/mongo.d.ts +2 -0
- package/dist/types/routes/BaseAliasRoute.d.ts +7 -0
- package/dist/types/routes/BaseAuthBasicRoute.d.ts +27 -0
- package/dist/types/routes/BaseAuthFIDO2Route.d.ts +50 -0
- package/dist/types/routes/BaseAuthMFARoute.d.ts +61 -0
- package/dist/types/routes/BaseAuthOIDCRoute.d.ts +33 -0
- package/dist/types/routes/BaseAuthOTPRoute.d.ts +53 -0
- package/dist/types/routes/BaseAuthPasskeyRoute.d.ts +41 -0
- package/dist/types/routes/BaseAuthTOTPRoute.d.ts +38 -0
- package/dist/types/routes/BaseProfileRoute.d.ts +7 -0
- package/dist/types/routes/BaseSecretRoute.d.ts +89 -0
- package/dist/types/routes/BaseUserRoute.d.ts +7 -0
- package/dist/types/routes/UserUtils.d.ts +21 -0
- package/dist/types/routes/index.d.ts +12 -0
- package/dist/types/routes/mongo/BaseAliasRouteMongo.d.ts +4 -0
- package/dist/types/routes/mongo/BaseAuthBasicRouteMongo.d.ts +7 -0
- package/dist/types/routes/mongo/BaseAuthFIDO2RouteMongo.d.ts +7 -0
- package/dist/types/routes/mongo/BaseAuthMFARouteMongo.d.ts +7 -0
- package/dist/types/routes/mongo/BaseAuthOIDCRouteMongo.d.ts +7 -0
- package/dist/types/routes/mongo/BaseAuthOTPRouteMongo.d.ts +7 -0
- package/dist/types/routes/mongo/BaseAuthPasskeyRouteMongo.d.ts +7 -0
- package/dist/types/routes/mongo/BaseAuthTOTPRouteMongo.d.ts +7 -0
- package/dist/types/routes/mongo/BaseProfileRouteMongo.d.ts +4 -0
- package/dist/types/routes/mongo/BaseSecretRouteMongo.d.ts +4 -0
- package/dist/types/routes/mongo/BaseUserRouteMongo.d.ts +4 -0
- package/dist/types/routes/mongo/index.d.ts +11 -0
- package/dist/types/routes/mongo.d.ts +1 -0
- package/dist/types/routes/sql/BaseAliasRouteSQL.d.ts +4 -0
- package/dist/types/routes/sql/BaseAuthBasicRouteSQL.d.ts +7 -0
- package/dist/types/routes/sql/BaseAuthFIDO2RouteSQL.d.ts +7 -0
- package/dist/types/routes/sql/BaseAuthMFARouteSQL.d.ts +7 -0
- package/dist/types/routes/sql/BaseAuthOIDCRouteSQL.d.ts +7 -0
- package/dist/types/routes/sql/BaseAuthOTPRouteSQL.d.ts +7 -0
- package/dist/types/routes/sql/BaseAuthPasskeyRouteSQL.d.ts +7 -0
- package/dist/types/routes/sql/BaseAuthTOTPRouteSQL.d.ts +7 -0
- package/dist/types/routes/sql/BaseProfileRouteSQL.d.ts +4 -0
- package/dist/types/routes/sql/BaseSecretRouteSQL.d.ts +4 -0
- package/dist/types/routes/sql/BaseUserRouteSQL.d.ts +4 -0
- package/dist/types/routes/sql/index.d.ts +11 -0
- package/dist/types/routes/sql.d.ts +1 -0
- package/dist/types/sql.d.ts +2 -0
- package/package.json +138 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
11
|
+
// Copyright (C) 2026 Jean-Philippe Steinmetz. All rights reserved.
|
|
12
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
13
|
+
import { ObjectDecorators, ValidationUtils } from "@rapidrest/core";
|
|
14
|
+
import { BaseMongoEntity, DocDecorators, ModelDecorators, PersistenceDecorators } from "@rapidrest/service-core";
|
|
15
|
+
const { Description } = DocDecorators;
|
|
16
|
+
const { DataStore, Protect } = ModelDecorators;
|
|
17
|
+
const { Nullable, RequiresScope, Validator } = ObjectDecorators;
|
|
18
|
+
const { Column, Entity } = PersistenceDecorators;
|
|
19
|
+
/**
|
|
20
|
+
* Implementation of the `Profile` interface for storage in a MongoDB database. If SQL is desired, please use
|
|
21
|
+
* `models.sql.ProfileSQL` instead.
|
|
22
|
+
*
|
|
23
|
+
* @author Jean-Philippe Steinmetz
|
|
24
|
+
*/
|
|
25
|
+
let ProfileMongo = class ProfileMongo extends BaseMongoEntity {
|
|
26
|
+
constructor(other) {
|
|
27
|
+
super(other);
|
|
28
|
+
this.contacts = [];
|
|
29
|
+
this.preferences = {
|
|
30
|
+
contact: ["all"],
|
|
31
|
+
};
|
|
32
|
+
if (other) {
|
|
33
|
+
this.avatar = "avatar" in other ? other.avatar : this.avatar;
|
|
34
|
+
this.birthdate = "birthdate" in other ? other.birthdate : this.birthdate;
|
|
35
|
+
this.contacts = other.contacts !== undefined ? other.contacts : this.contacts;
|
|
36
|
+
this.givenName = "givenName" in other ? other.givenName : this.givenName;
|
|
37
|
+
this.familyName = "familyName" in other ? other.familyName : this.familyName;
|
|
38
|
+
this.preferences = other.preferences !== undefined ? other.preferences : this.preferences;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
__decorate([
|
|
43
|
+
Column(),
|
|
44
|
+
Description("The URL or path to the user's avatar image (e.g. gravatar)."),
|
|
45
|
+
Nullable,
|
|
46
|
+
__metadata("design:type", String)
|
|
47
|
+
], ProfileMongo.prototype, "avatar", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
Column(),
|
|
50
|
+
Validator(ValidationUtils.checkDate),
|
|
51
|
+
Description("The user's date of birth."),
|
|
52
|
+
Nullable,
|
|
53
|
+
__metadata("design:type", Date)
|
|
54
|
+
], ProfileMongo.prototype, "birthdate", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
Column(),
|
|
57
|
+
RequiresScope("profile:email"),
|
|
58
|
+
Description("The user's list of contact e-mails."),
|
|
59
|
+
__metadata("design:type", Array)
|
|
60
|
+
], ProfileMongo.prototype, "contacts", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
Column(),
|
|
63
|
+
Description("The user's given name (aka: first name)."),
|
|
64
|
+
Nullable,
|
|
65
|
+
__metadata("design:type", String)
|
|
66
|
+
], ProfileMongo.prototype, "givenName", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
Column(),
|
|
69
|
+
Description("The user's family surname (or last name)."),
|
|
70
|
+
Nullable,
|
|
71
|
+
__metadata("design:type", String)
|
|
72
|
+
], ProfileMongo.prototype, "familyName", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
Column(),
|
|
75
|
+
RequiresScope("profile:preferences"),
|
|
76
|
+
Description("The user's account preferences."),
|
|
77
|
+
__metadata("design:type", Object)
|
|
78
|
+
], ProfileMongo.prototype, "preferences", void 0);
|
|
79
|
+
ProfileMongo = __decorate([
|
|
80
|
+
DataStore("mongo"),
|
|
81
|
+
Entity(),
|
|
82
|
+
Description(""),
|
|
83
|
+
Protect({
|
|
84
|
+
uid: "UserMongo",
|
|
85
|
+
records: [
|
|
86
|
+
{
|
|
87
|
+
userOrRoleId: "anonymous",
|
|
88
|
+
actions: [],
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
userOrRoleId: ".*",
|
|
92
|
+
actions: [],
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
}),
|
|
96
|
+
__metadata("design:paramtypes", [Object])
|
|
97
|
+
], ProfileMongo);
|
|
98
|
+
export { ProfileMongo };
|
|
99
|
+
//# sourceMappingURL=ProfileMongo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProfileMongo.js","sourceRoot":"","sources":["../../../../src/models/mongo/ProfileMongo.ts"],"names":[],"mappings":";;;;;;;;;AAAA,+EAA+E;AAC/E,mEAAmE;AACnE,+EAA+E;AAC/E,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEjH,MAAM,EAAE,WAAW,EAAE,GAAG,aAAa,CAAC;A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AC,WAAW,CAAC;QAC9F,CAAC;IACL,CAAC;CACJ,CAAA;AA1CU;IAHN,MAAM,EAAE;IACR,WAAW,CAAC,6DAA6D,CAAC;IAC1E,QAAQ;;4CACc;AAMhB;IAJN,MAAM,EAAE;IACR,SAAS,CAAC,eAAe,CAAC,SAAS,CAAC;IACpC,WAAW,CAAC,2BAA2B,CAAC;IACxC,QAAQ;8BACU,IAAI;+CAAC;AAKjB;IAHN,MAAM,EAAE;IACR,aAAa,CAAC,eAAe,CAAC;IAC9B,WAAW,CAAC,qCAAqC,CAAC;;8CACnB;AAKzB;IAHN,MAAM,EAAE;IACR,WAAW,CAAC,0CAA0C,CAAC;IACvD,QAAQ;;+CACiB;AAKnB;IAHN,MAAM,EAAE;IACR,WAAW,CAAC,2CAA2C,CAAC;IACxD,QAAQ;;gDACkB;AAKpB;IAHN,MAAM,EAAE;IACR,aAAa,CAAC,qBAAqB,CAAC;IACpC,WAAW,CAAC,iCAAiC,CAAC;;iDAG7C;AAhCO,YAAY;IAhBxB,SAAS,CAAC,OAAO,CAAC;IAClB,MAAM,EAAE;IACR,WAAW,CAAC,EAAE,CAAC;IACf,OAAO,CAAC;QACL,GAAG,EAAE,WAAW;QAChB,OAAO,EAAE;YACL;gBACI,YAAY,EAAE,WAAW;gBACzB,OAAO,EAAE,EAAE;aACd;YACD;gBACI,YAAY,EAAE,IAAI;gBAClB,OAAO,EAAE,EAAE;aACd;SACJ;KACJ,CAAC;;GACW,YAAY,CA8CxB"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
11
|
+
// Copyright (C) 2026 Jean-Philippe Steinmetz. All rights reserved.
|
|
12
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
13
|
+
import { BaseMongoEntity, DocDecorators, ModelDecorators, PersistenceDecorators } from "@rapidrest/service-core";
|
|
14
|
+
import { SecretType } from "../types.js";
|
|
15
|
+
import { ObjectDecorators } from "@rapidrest/core";
|
|
16
|
+
const { Description } = DocDecorators;
|
|
17
|
+
const { DataStore, Protect } = ModelDecorators;
|
|
18
|
+
const { Nullable } = ObjectDecorators;
|
|
19
|
+
const { Column, Entity } = PersistenceDecorators;
|
|
20
|
+
/**
|
|
21
|
+
* Implementation of the `Secret` interface for storage in a MongoDB database. If SQL is desired, please use
|
|
22
|
+
* `models.sql.SecretSQL` instead.
|
|
23
|
+
*
|
|
24
|
+
* @author Jean-Philippe Steinmetz
|
|
25
|
+
*/
|
|
26
|
+
let SecretMongo = class SecretMongo extends BaseMongoEntity {
|
|
27
|
+
constructor(other) {
|
|
28
|
+
super(other);
|
|
29
|
+
this.type = SecretType.PASSWORD;
|
|
30
|
+
this.userUid = "";
|
|
31
|
+
if (other) {
|
|
32
|
+
this.data = "data" in other ? other.data : this.data;
|
|
33
|
+
this.type = other.type !== undefined ? other.type : this.type;
|
|
34
|
+
this.userUid = other.userUid !== undefined ? other.userUid : this.userUid;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
__decorate([
|
|
39
|
+
Column(),
|
|
40
|
+
Nullable,
|
|
41
|
+
__metadata("design:type", Object)
|
|
42
|
+
], SecretMongo.prototype, "data", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
Column(),
|
|
45
|
+
__metadata("design:type", String)
|
|
46
|
+
], SecretMongo.prototype, "type", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
Column(),
|
|
49
|
+
__metadata("design:type", String)
|
|
50
|
+
], SecretMongo.prototype, "userUid", void 0);
|
|
51
|
+
SecretMongo = __decorate([
|
|
52
|
+
DataStore("mongo"),
|
|
53
|
+
Entity(),
|
|
54
|
+
Description("Defines a record for a single user alias in the system."),
|
|
55
|
+
Protect({
|
|
56
|
+
uid: "UserMongo",
|
|
57
|
+
records: [
|
|
58
|
+
{
|
|
59
|
+
userOrRoleId: "anonymous",
|
|
60
|
+
actions: [],
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
userOrRoleId: ".*",
|
|
64
|
+
actions: [],
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
}),
|
|
68
|
+
__metadata("design:paramtypes", [Object])
|
|
69
|
+
], SecretMongo);
|
|
70
|
+
export { SecretMongo };
|
|
71
|
+
//# sourceMappingURL=SecretMongo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SecretMongo.js","sourceRoot":"","sources":["../../../../src/models/mongo/SecretMongo.ts"],"names":[],"mappings":";;;;;;;;;AAAA,+EAA+E;AAC/E,mEAAmE;AACnE,+EAA+E;AAC/E,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AACjH,OAAO,EAAU,UAAU,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,MAAM,EAAE,WAAW,EAAE,GAAG,aAAa,CAAC;AACtC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,eAAe,CAAC;AAC/C,MAAM,EAAE,QAAQ,EAAE,GAAG,gBAAgB,CAAC;AACtC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,qBAAqB,CAAC;AAEjD;;;;;GAKG;AAiBI,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,eAAe;IAW5C,YAAY,KAA4B;QACpC,KAAK,CAAC,KAAK,CAAC,CAAC;QANV,SAAI,GAAe,UAAU,CAAC,QAAQ,CAAC;QAGvC,YAAO,GAAW,EAAE,CAAC;QAKxB,IAAI,KAAK,EAAE,CAAC;YACR,IAAI,CAAC,IAAI,GAAG,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;YACrD,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;YAC9D,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC;QAC9E,CAAC;IACL,CAAC;CACJ,CAAA;AAjBU;IAFN,MAAM,EAAE;IACR,QAAQ;;yCACQ;AAGV;IADN,MAAM,EAAE;;yCACqC;AAGvC;IADN,MAAM,EAAE;;4CACmB;AATnB,WAAW;IAhBvB,SAAS,CAAC,OAAO,CAAC;IAClB,MAAM,EAAE;IACR,WAAW,CAAC,yDAAyD,CAAC;IACtE,OAAO,CAAC;QACL,GAAG,EAAE,WAAW;QAChB,OAAO,EAAE;YACL;gBACI,YAAY,EAAE,WAAW;gBACzB,OAAO,EAAE,EAAE;aACd;YACD;gBACI,YAAY,EAAE,IAAI;gBAClB,OAAO,EAAE,EAAE;aACd;SACJ;KACJ,CAAC;;GACW,WAAW,CAoBvB"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
11
|
+
// Copyright (C) 2026 Jean-Philippe Steinmetz. All rights reserved.
|
|
12
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
13
|
+
import { BaseMongoEntity, DocDecorators, ModelDecorators, PersistenceDecorators, } from "@rapidrest/service-core";
|
|
14
|
+
const { Description } = DocDecorators;
|
|
15
|
+
const { DataStore, Protect } = ModelDecorators;
|
|
16
|
+
const { Column, Entity } = PersistenceDecorators;
|
|
17
|
+
/**
|
|
18
|
+
* Implementation of the `User` interface for storage in a MongoDB database. If SQL is desired, please use
|
|
19
|
+
* `models.sql.UserSQL` instead.
|
|
20
|
+
*
|
|
21
|
+
* @author Jean-Philippe Steinmetz
|
|
22
|
+
*/
|
|
23
|
+
let UserMongo = class UserMongo extends BaseMongoEntity {
|
|
24
|
+
constructor(other) {
|
|
25
|
+
super(other);
|
|
26
|
+
this.roles = [];
|
|
27
|
+
// This is purposefully not stored in the database as its built at runtime
|
|
28
|
+
this.scopes = [];
|
|
29
|
+
this.verified = false;
|
|
30
|
+
if (other) {
|
|
31
|
+
this.roles = other.roles !== undefined ? other.roles : this.roles;
|
|
32
|
+
this.scopes = other.scopes !== undefined ? other.scopes : this.scopes;
|
|
33
|
+
this.verified = other.verified !== undefined ? other.verified : this.verified;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
__decorate([
|
|
38
|
+
Column(),
|
|
39
|
+
Description("The list of permission roles the user has."),
|
|
40
|
+
__metadata("design:type", Array)
|
|
41
|
+
], UserMongo.prototype, "roles", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
Description("The list of permission scopes the user has."),
|
|
44
|
+
__metadata("design:type", Array)
|
|
45
|
+
], UserMongo.prototype, "scopes", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
Column(),
|
|
48
|
+
Description("Indicates if the user's contact information (e.g. email, phone number) has been verified."),
|
|
49
|
+
__metadata("design:type", Boolean)
|
|
50
|
+
], UserMongo.prototype, "verified", void 0);
|
|
51
|
+
UserMongo = __decorate([
|
|
52
|
+
DataStore("mongo"),
|
|
53
|
+
Entity(),
|
|
54
|
+
Description("Defines a record for a single user account in the system."),
|
|
55
|
+
Protect({
|
|
56
|
+
uid: "UserMongo",
|
|
57
|
+
records: [
|
|
58
|
+
{
|
|
59
|
+
userOrRoleId: "anonymous",
|
|
60
|
+
actions: [],
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
userOrRoleId: ".*",
|
|
64
|
+
actions: [],
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
}),
|
|
68
|
+
__metadata("design:paramtypes", [Object])
|
|
69
|
+
], UserMongo);
|
|
70
|
+
export { UserMongo };
|
|
71
|
+
//# sourceMappingURL=UserMongo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserMongo.js","sourceRoot":"","sources":["../../../../src/models/mongo/UserMongo.ts"],"names":[],"mappings":";;;;;;;;;AAAA,+EAA+E;AAC/E,mEAAmE;AACnE,+EAA+E;AAC/E,OAAO,EAEH,eAAe,EACf,aAAa,EACb,eAAe,EACf,qBAAqB,GACxB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,EAAE,WAAW,EAAE,GAAG,aAAa,CAAC;AACtC,MAAM,EAAE,SAAS,EA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AI;gBAClB,OAAO,EAAE,EAAE;aACd;SACJ;KACJ,CAAC;;GACW,SAAS,CAsBrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/models/mongo/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mongo.js","sourceRoot":"","sources":["../../../src/models/mongo.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
11
|
+
// Copyright (C) 2026 Jean-Philippe Steinmetz. All rights reserved.
|
|
12
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
13
|
+
import { BaseEntity, DocDecorators, ModelDecorators, PersistenceDecorators } from "@rapidrest/service-core";
|
|
14
|
+
import { AliasType } from "../types.js";
|
|
15
|
+
const { Description } = DocDecorators;
|
|
16
|
+
const { DataStore, Identifier, Protect } = ModelDecorators;
|
|
17
|
+
const { Column, Entity, Index } = PersistenceDecorators;
|
|
18
|
+
/**
|
|
19
|
+
* Implementation of the `Alias` interface for storage in a SQL database. If MongoDB is desired, please use
|
|
20
|
+
* `models.mongo.AliasMongo` instead.
|
|
21
|
+
*
|
|
22
|
+
* @author Jean-Philippe Steinmetz
|
|
23
|
+
*/
|
|
24
|
+
let AliasSQL = class AliasSQL extends BaseEntity {
|
|
25
|
+
constructor(other) {
|
|
26
|
+
super(other);
|
|
27
|
+
this.alias = "";
|
|
28
|
+
this.type = AliasType.NAME;
|
|
29
|
+
this.userUid = "";
|
|
30
|
+
this.verified = false;
|
|
31
|
+
if (other) {
|
|
32
|
+
this.alias = other.alias !== undefined ? other.alias : this.alias;
|
|
33
|
+
this.type = other.type !== undefined ? other.type : this.type;
|
|
34
|
+
this.userUid = other.userUid !== undefined ? other.userUid : this.userUid;
|
|
35
|
+
this.verified = other.verified !== undefined ? other.verified : this.verified;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
__decorate([
|
|
40
|
+
Column(),
|
|
41
|
+
Identifier,
|
|
42
|
+
Index("alias", { unique: true }),
|
|
43
|
+
__metadata("design:type", String)
|
|
44
|
+
], AliasSQL.prototype, "alias", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
Column({ type: "varchar" }),
|
|
47
|
+
__metadata("design:type", String)
|
|
48
|
+
], AliasSQL.prototype, "type", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
Column(),
|
|
51
|
+
__metadata("design:type", String)
|
|
52
|
+
], AliasSQL.prototype, "userUid", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
Column(),
|
|
55
|
+
__metadata("design:type", Boolean)
|
|
56
|
+
], AliasSQL.prototype, "verified", void 0);
|
|
57
|
+
AliasSQL = __decorate([
|
|
58
|
+
DataStore("sql"),
|
|
59
|
+
Entity(),
|
|
60
|
+
Description("Defines a record for a single user alias in the system."),
|
|
61
|
+
Protect({
|
|
62
|
+
uid: "UserMongo",
|
|
63
|
+
records: [
|
|
64
|
+
{
|
|
65
|
+
userOrRoleId: "anonymous",
|
|
66
|
+
actions: [],
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
userOrRoleId: ".*",
|
|
70
|
+
actions: [],
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
}),
|
|
74
|
+
__metadata("design:paramtypes", [Object])
|
|
75
|
+
], AliasSQL);
|
|
76
|
+
export { AliasSQL };
|
|
77
|
+
//# sourceMappingURL=AliasSQL.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AliasSQL.js","sourceRoot":"","sources":["../../../../src/models/sql/AliasSQL.ts"],"names":[],"mappings":";;;;;;;;;AAAA,+EAA+E;AAC/E,mEAAmE;AACnE,+EAA+E;AAC/E,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAC5G,OAAO,EAAS,SAAS,EAAE,MAAM,aAAa,CAAC;AAC/C,MAAM,EAAE,WAAW,EAAE,GAAG,aAAa,CAAC;AACtC,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,eAAe,CAAC;AAC3D,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,qBAAqB,CAAC;AAExD;;;;;GAKG;AAiBI,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,UAAU;IAepC,YAAY,KAAyB;QACjC,KAAK,CAAC,KAAK,CAAC,CAAC;QAZV,UAAK,GAAW,EAAE,CAAC;QAGnB,SAAI,GAAc,SAAS,CAAC,IAAI,CAAC;QAGjC,YAAO,GAAW,EAAE,CAAC;QAGrB,aAAQ,GAAY,KAAK,CAAC;QAK7B,IAAI,KAAK,EAAE,CAAC;YACR,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;YAClE,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;YAC9D,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC;YAC1E,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC;QAClF,CAAC;IACL,CAAC;CACJ,CAAA;AArBU;IAHN,MAAM,EAAE;IACR,UAAU;IACV,KAAK,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;;uCACP;AAGnB;IADN,MAAM,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;sCACY;AAGjC;IADN,MAAM,EAAE;;yCACmB;AAGrB;IADN,MAAM,EAAE;;0CACwB;AAbxB,QAAQ;IAhBpB,SAAS,CAAC,KAAK,CAAC;IAChB,MAAM,EAAE;IACR,WAAW,CAAC,yDAAyD,CAAC;IACtE,OAAO,CAAC;QACL,GAAG,EAAE,WAAW;QAChB,OAAO,EAAE;YACL;gBACI,YAAY,EAAE,WAAW;gBACzB,OAAO,EAAE,EAAE;aACd;YACD;gBACI,YAAY,EAAE,IAAI;gBAClB,OAAO,EAAE,EAAE;aACd;SACJ;KACJ,CAAC;;GACW,QAAQ,CAyBpB"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
11
|
+
// Copyright (C) 2026 Jean-Philippe Steinmetz. All rights reserved.
|
|
12
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
13
|
+
import { ObjectDecorators, ValidationUtils } from "@rapidrest/core";
|
|
14
|
+
import { BaseEntity, DocDecorators, ModelDecorators, PersistenceDecorators } from "@rapidrest/service-core";
|
|
15
|
+
const { Description } = DocDecorators;
|
|
16
|
+
const { DataStore, Protect } = ModelDecorators;
|
|
17
|
+
const { Nullable, RequiresScope, Validator } = ObjectDecorators;
|
|
18
|
+
const { Column, Entity } = PersistenceDecorators;
|
|
19
|
+
/**
|
|
20
|
+
* Implementation of the `Profile` interface for storage in a SQL database. If MongoDB is desired, please use
|
|
21
|
+
* `models.mongo.ProfileMongo` instead.
|
|
22
|
+
*
|
|
23
|
+
* @author Jean-Philippe Steinmetz
|
|
24
|
+
*/
|
|
25
|
+
let ProfileSQL = class ProfileSQL extends BaseEntity {
|
|
26
|
+
constructor(other) {
|
|
27
|
+
super(other);
|
|
28
|
+
this.contacts = [];
|
|
29
|
+
this.preferences = {
|
|
30
|
+
contact: ["all"],
|
|
31
|
+
};
|
|
32
|
+
if (other) {
|
|
33
|
+
this.avatar = "avatar" in other ? other.avatar : this.avatar;
|
|
34
|
+
this.birthdate = "birthdate" in other ? other.birthdate : this.birthdate;
|
|
35
|
+
this.contacts = other.contacts !== undefined ? other.contacts : this.contacts;
|
|
36
|
+
this.givenName = "givenName" in other ? other.givenName : this.givenName;
|
|
37
|
+
this.familyName = "familyName" in other ? other.familyName : this.familyName;
|
|
38
|
+
this.preferences = other.preferences !== undefined ? other.preferences : this.preferences;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
__decorate([
|
|
43
|
+
Column({ nullable: true }),
|
|
44
|
+
Description("The URL or path to the user's avatar image (e.g. gravatar)."),
|
|
45
|
+
Nullable,
|
|
46
|
+
__metadata("design:type", String)
|
|
47
|
+
], ProfileSQL.prototype, "avatar", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
Column({ nullable: true }),
|
|
50
|
+
Validator(ValidationUtils.checkDate),
|
|
51
|
+
Description("The user's date of birth."),
|
|
52
|
+
Nullable,
|
|
53
|
+
__metadata("design:type", Date)
|
|
54
|
+
], ProfileSQL.prototype, "birthdate", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
Column({ type: "simple-json" }),
|
|
57
|
+
RequiresScope("profile:email"),
|
|
58
|
+
Description("The user's list of contact e-mails."),
|
|
59
|
+
__metadata("design:type", Array)
|
|
60
|
+
], ProfileSQL.prototype, "contacts", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
Column({ nullable: true }),
|
|
63
|
+
Description("The user's given name (aka: first name)."),
|
|
64
|
+
Nullable,
|
|
65
|
+
__metadata("design:type", String)
|
|
66
|
+
], ProfileSQL.prototype, "givenName", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
Column({ nullable: true }),
|
|
69
|
+
Description("The user's family surname (or last name)."),
|
|
70
|
+
Nullable,
|
|
71
|
+
__metadata("design:type", String)
|
|
72
|
+
], ProfileSQL.prototype, "familyName", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
Column({ type: "simple-json" }),
|
|
75
|
+
RequiresScope("profile:preferences"),
|
|
76
|
+
Description("The user's account preferences."),
|
|
77
|
+
__metadata("design:type", Object)
|
|
78
|
+
], ProfileSQL.prototype, "preferences", void 0);
|
|
79
|
+
ProfileSQL = __decorate([
|
|
80
|
+
DataStore("sql"),
|
|
81
|
+
Entity(),
|
|
82
|
+
Description(""),
|
|
83
|
+
Protect({
|
|
84
|
+
uid: "UserMongo",
|
|
85
|
+
records: [
|
|
86
|
+
{
|
|
87
|
+
userOrRoleId: "anonymous",
|
|
88
|
+
actions: [],
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
userOrRoleId: ".*",
|
|
92
|
+
actions: [],
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
}),
|
|
96
|
+
__metadata("design:paramtypes", [Object])
|
|
97
|
+
], ProfileSQL);
|
|
98
|
+
export { ProfileSQL };
|
|
99
|
+
//# sourceMappingURL=ProfileSQL.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProfileSQL.js","sourceRoot":"","sources":["../../../../src/models/sql/ProfileSQL.ts"],"names":[],"mappings":";;;;;;;;;AAAA,+EAA+E;AAC/E,mEAAmE;AACnE,+EAA+E;AAC/E,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAE5G,MAAM,EAAE,WAAW,EAAE,GAAG,aAAa,CAAC;AACtC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,eAAe,CAAC;AAC/C,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,SAAS,EAAE,GAAG,gBAAgB,CAAC;AAChE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,qBAAqB,CAAC;AAEjD;;;;;GAKG;AAiBI,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,UAAU;IAkCtC,YAAY,KAA2B;QACnC,KAAK,CAAC,KAAK,CAAC,CAAC;QApBV,aAAQ,GAAc,EAAE,CAAC;QAezB,gBAAW,GAAgB;YAC9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,aAAa,EAAE,CAAC;IAC/B,aAAa,CAAC,eAAe,CAAC;IAC9B,WAAW,CAAC,qCAAqC,CAAC;;4CACnB;AAKzB;IAHN,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC1B,WAAW,CAAC,0CAA0C,CAAC;IACvD,QAAQ;;6CACiB;AAKnB;IAHN,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC1B,WAAW,CAAC,2CAA2C,CAAC;IACxD,QAAQ;;8CACkB;AAKpB;IAHN,MAAM,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;IAC/B,aAAa,CAAC,qBAAqB,CAAC;IACpC,WAAW,CAAC,iCAAiC,CAAC;;+CAG7C;AAhCO,UAAU;IAhBtB,SAAS,CAAC,KAAK,CAAC;IAChB,MAAM,EAAE;IACR,WAAW,CAAC,EAAE,CAAC;IACf,OAAO,CAAC;QACL,GAAG,EAAE,WAAW;QAChB,OAAO,EAAE;YACL;gBACI,YAAY,EAAE,WAAW;gBACzB,OAAO,EAAE,EAAE;aACd;YACD;gBACI,YAAY,EAAE,IAAI;gBAClB,OAAO,EAAE,EAAE;aACd;SACJ;KACJ,CAAC;;GACW,UAAU,CA8CtB"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
11
|
+
// Copyright (C) 2026 Jean-Philippe Steinmetz. All rights reserved.
|
|
12
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
13
|
+
import { BaseEntity, DocDecorators, ModelDecorators, PersistenceDecorators } from "@rapidrest/service-core";
|
|
14
|
+
import { SecretType } from "../types.js";
|
|
15
|
+
import { ObjectDecorators } from "@rapidrest/core";
|
|
16
|
+
const { Description } = DocDecorators;
|
|
17
|
+
const { DataStore, Protect } = ModelDecorators;
|
|
18
|
+
const { Nullable } = ObjectDecorators;
|
|
19
|
+
const { Column, Entity } = PersistenceDecorators;
|
|
20
|
+
/**
|
|
21
|
+
* Implementation of the `Secret` interface for storage in a SQL database. If MongoDB is desired, please use
|
|
22
|
+
* `models.mongo.SecretMongo` instead.
|
|
23
|
+
*
|
|
24
|
+
* @author Jean-Philippe Steinmetz
|
|
25
|
+
*/
|
|
26
|
+
let SecretSQL = class SecretSQL extends BaseEntity {
|
|
27
|
+
constructor(other) {
|
|
28
|
+
super(other);
|
|
29
|
+
this.type = SecretType.PASSWORD;
|
|
30
|
+
this.userUid = "";
|
|
31
|
+
if (other) {
|
|
32
|
+
this.data = "data" in other ? other.data : this.data;
|
|
33
|
+
this.type = other.type !== undefined ? other.type : this.type;
|
|
34
|
+
this.userUid = other.userUid !== undefined ? other.userUid : this.userUid;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
__decorate([
|
|
39
|
+
Column({ type: "simple-json", nullable: true }),
|
|
40
|
+
Nullable,
|
|
41
|
+
__metadata("design:type", Object)
|
|
42
|
+
], SecretSQL.prototype, "data", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
Column({ type: "varchar" }),
|
|
45
|
+
__metadata("design:type", String)
|
|
46
|
+
], SecretSQL.prototype, "type", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
Column(),
|
|
49
|
+
__metadata("design:type", String)
|
|
50
|
+
], SecretSQL.prototype, "userUid", void 0);
|
|
51
|
+
SecretSQL = __decorate([
|
|
52
|
+
DataStore("sql"),
|
|
53
|
+
Entity(),
|
|
54
|
+
Description("Defines a record for a single user alias in the system."),
|
|
55
|
+
Protect({
|
|
56
|
+
uid: "UserMongo",
|
|
57
|
+
records: [
|
|
58
|
+
{
|
|
59
|
+
userOrRoleId: "anonymous",
|
|
60
|
+
actions: [],
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
userOrRoleId: ".*",
|
|
64
|
+
actions: [],
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
}),
|
|
68
|
+
__metadata("design:paramtypes", [Object])
|
|
69
|
+
], SecretSQL);
|
|
70
|
+
export { SecretSQL };
|
|
71
|
+
//# sourceMappingURL=SecretSQL.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SecretSQL.js","sourceRoot":"","sources":["../../../../src/models/sql/SecretSQL.ts"],"names":[],"mappings":";;;;;;;;;AAAA,+EAA+E;AAC/E,mEAAmE;AACnE,+EAA+E;AAC/E,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAC5G,OAAO,EAAU,UAAU,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,MAAM,EAAE,WAAW,EAAE,GAAG,aAAa,CAAC;AACtC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,eAAe,CAAC;AAC/C,MAAM,EAAE,QAAQ,EAAE,GAAG,gBAAgB,CAAC;AACtC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,qBAAqB,CAAC;AAEjD;;;;;GAKG;AAiBI,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,UAAU;IAWrC,YAAY,KAA0B;QAClC,KAAK,CAAC,KAAK,CAAC,CAAC;QANV,SAAI,GAAe,UAAU,CAAC,QAAQ,CAAC;QAGvC,YAAO,GAAW,EAAE,CAAC;QAKxB,IAAI,KAAK,EAAE,CAAC;YACR,IAAI,CAAC,IAAI,GAAG,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;YACrD,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;YAC9D,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC;QAC9E,CAAC;IACL,CAAC;CACJ,CAAA;AAjBU;IAFN,MAAM,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC/C,QAAQ;;uCACQ;AAGV;IADN,MAAM,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;uCACkB;AAGvC;IADN,MAAM,EAAE;;0CACmB;AATnB,SAAS;IAhBrB,SAAS,CAAC,KAAK,CAAC;IAChB,MAAM,EAAE;IACR,WAAW,CAAC,yDAAyD,CAAC;IACtE,OAAO,CAAC;QACL,GAAG,EAAE,WAAW;QAChB,OAAO,EAAE;YACL;gBACI,YAAY,EAAE,WAAW;gBACzB,OAAO,EAAE,EAAE;aACd;YACD;gBACI,YAAY,EAAE,IAAI;gBAClB,OAAO,EAAE,EAAE;aACd;SACJ;KACJ,CAAC;;GACW,SAAS,CAoBrB"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { BaseEntity, DocDecorators, ModelDecorators, PersistenceDecorators } from "@rapidrest/service-core";
|
|
11
|
+
const { Description } = DocDecorators;
|
|
12
|
+
const { DataStore, Protect } = ModelDecorators;
|
|
13
|
+
const { Column, Entity } = PersistenceDecorators;
|
|
14
|
+
/**
|
|
15
|
+
* Implementation of the `User` interface for storage in a SQLDB database. If MongoDB is desired, please use
|
|
16
|
+
* `models.mongo.UserMongo` instead.
|
|
17
|
+
*
|
|
18
|
+
* @author Jean-Philippe Steinmetz
|
|
19
|
+
*/
|
|
20
|
+
let UserSQL = class UserSQL extends BaseEntity {
|
|
21
|
+
constructor(other) {
|
|
22
|
+
super(other);
|
|
23
|
+
this.roles = [];
|
|
24
|
+
// This is purposefully not stored in the database as its built at runtime
|
|
25
|
+
this.scopes = [];
|
|
26
|
+
this.verified = false;
|
|
27
|
+
if (other) {
|
|
28
|
+
this.roles = other.roles !== undefined ? other.roles : this.roles;
|
|
29
|
+
this.scopes = other.scopes !== undefined ? other.scopes : this.scopes;
|
|
30
|
+
this.verified = other.verified !== undefined ? other.verified : this.verified;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
__decorate([
|
|
35
|
+
Column({ type: "simple-json" }),
|
|
36
|
+
Description("The list of permission roles the user has."),
|
|
37
|
+
__metadata("design:type", Array)
|
|
38
|
+
], UserSQL.prototype, "roles", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
Description("The list of permission scopes the user has."),
|
|
41
|
+
__metadata("design:type", Array)
|
|
42
|
+
], UserSQL.prototype, "scopes", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
Column(),
|
|
45
|
+
Description("Indicates if the user's contact information (e.g. email, phone number) has been verified."),
|
|
46
|
+
__metadata("design:type", Boolean)
|
|
47
|
+
], UserSQL.prototype, "verified", void 0);
|
|
48
|
+
UserSQL = __decorate([
|
|
49
|
+
DataStore("sql"),
|
|
50
|
+
Entity(),
|
|
51
|
+
Description("Defines a record for a single user account in the system."),
|
|
52
|
+
Protect({
|
|
53
|
+
uid: "UserMongo",
|
|
54
|
+
records: [
|
|
55
|
+
{
|
|
56
|
+
userOrRoleId: "anonymous",
|
|
57
|
+
actions: [],
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
userOrRoleId: ".*",
|
|
61
|
+
actions: [],
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
}),
|
|
65
|
+
__metadata("design:paramtypes", [Object])
|
|
66
|
+
], UserSQL);
|
|
67
|
+
export { UserSQL };
|
|
68
|
+
//# sourceMappingURL=UserSQL.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserSQL.js","sourceRoot":"","sources":["../../../../src/models/sql/UserSQL.ts"],"names":[],"mappings":";;;;;;;;;AAIA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAE5G,MAAM,EAAE,WAAW,EAAE,GAAG,aAAa,CAAC;AACtC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,eAAe,CAAC;AAC/C,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,qBAAqB,CAAC;AAEjD;;;;;GAKG;AAiBI,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,UAAU;IAanC,YAAY,KAAwB;QAChC,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ql/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sql.js","sourceRoot":"","sources":["../../../src/models/sql.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
|