@osaas/types 0.4.0 → 0.6.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/lib/schema/Tenant.d.ts +34 -0
- package/lib/schema/Tenant.d.ts.map +1 -1
- package/lib/schema/Tenant.js +27 -2
- package/lib/schema/Tenant.js.map +1 -1
- package/lib/schema/User.d.ts +3 -0
- package/lib/schema/User.d.ts.map +1 -1
- package/lib/schema/User.js +3 -2
- package/lib/schema/User.js.map +1 -1
- package/package.json +2 -2
package/lib/schema/Tenant.d.ts
CHANGED
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
/// <reference types="mongoose/types/inferschematype" />
|
|
25
25
|
import { Schema } from 'mongoose';
|
|
26
26
|
export declare const BILLING_OPTIONS: readonly ["paypal", "invoice"];
|
|
27
|
+
export declare const AUTH_PROVIDERS: readonly ["azure-ad"];
|
|
27
28
|
export declare const TenantSchema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, {
|
|
28
29
|
_id: string;
|
|
29
30
|
enabled: boolean;
|
|
@@ -36,6 +37,17 @@ export declare const TenantSchema: Schema<any, import("mongoose").Model<any, any
|
|
|
36
37
|
name?: string | undefined;
|
|
37
38
|
description?: string | undefined;
|
|
38
39
|
avatarUrl?: string | undefined;
|
|
40
|
+
authProvider?: {
|
|
41
|
+
provider: "azure-ad";
|
|
42
|
+
clientId: string;
|
|
43
|
+
clientSecret: string;
|
|
44
|
+
emailRegex: string;
|
|
45
|
+
required?: unknown;
|
|
46
|
+
config?: {
|
|
47
|
+
required?: unknown;
|
|
48
|
+
azureAdTenantId?: string | undefined;
|
|
49
|
+
} | undefined;
|
|
50
|
+
} | undefined;
|
|
39
51
|
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
40
52
|
_id: string;
|
|
41
53
|
enabled: boolean;
|
|
@@ -48,6 +60,17 @@ export declare const TenantSchema: Schema<any, import("mongoose").Model<any, any
|
|
|
48
60
|
name?: string | undefined;
|
|
49
61
|
description?: string | undefined;
|
|
50
62
|
avatarUrl?: string | undefined;
|
|
63
|
+
authProvider?: {
|
|
64
|
+
provider: "azure-ad";
|
|
65
|
+
clientId: string;
|
|
66
|
+
clientSecret: string;
|
|
67
|
+
emailRegex: string;
|
|
68
|
+
required?: unknown;
|
|
69
|
+
config?: {
|
|
70
|
+
required?: unknown;
|
|
71
|
+
azureAdTenantId?: string | undefined;
|
|
72
|
+
} | undefined;
|
|
73
|
+
} | undefined;
|
|
51
74
|
}>> & import("mongoose").FlatRecord<{
|
|
52
75
|
_id: string;
|
|
53
76
|
enabled: boolean;
|
|
@@ -60,6 +83,17 @@ export declare const TenantSchema: Schema<any, import("mongoose").Model<any, any
|
|
|
60
83
|
name?: string | undefined;
|
|
61
84
|
description?: string | undefined;
|
|
62
85
|
avatarUrl?: string | undefined;
|
|
86
|
+
authProvider?: {
|
|
87
|
+
provider: "azure-ad";
|
|
88
|
+
clientId: string;
|
|
89
|
+
clientSecret: string;
|
|
90
|
+
emailRegex: string;
|
|
91
|
+
required?: unknown;
|
|
92
|
+
config?: {
|
|
93
|
+
required?: unknown;
|
|
94
|
+
azureAdTenantId?: string | undefined;
|
|
95
|
+
} | undefined;
|
|
96
|
+
} | undefined;
|
|
63
97
|
}> & Required<{
|
|
64
98
|
_id: string;
|
|
65
99
|
}>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tenant.d.ts","sourceRoot":"","sources":["../../src/schema/Tenant.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAkB,MAAM,UAAU,CAAC;AAKlD,eAAO,MAAM,eAAe,gCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"Tenant.d.ts","sourceRoot":"","sources":["../../src/schema/Tenant.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAkB,MAAM,UAAU,CAAC;AAKlD,eAAO,MAAM,eAAe,gCAAiC,CAAC;AAC9D,eAAO,MAAM,cAAc,uBAAwB,CAAC;AAMpD,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmFvB,CAAC"}
|
package/lib/schema/Tenant.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TenantSchema = exports.BILLING_OPTIONS = void 0;
|
|
3
|
+
exports.TenantSchema = exports.AUTH_PROVIDERS = exports.BILLING_OPTIONS = void 0;
|
|
4
4
|
const mongoose_1 = require("mongoose");
|
|
5
5
|
const util_1 = require("./util");
|
|
6
|
-
const SCHEMA_VERSION =
|
|
6
|
+
const SCHEMA_VERSION = 5;
|
|
7
7
|
exports.BILLING_OPTIONS = ['paypal', 'invoice'];
|
|
8
|
+
exports.AUTH_PROVIDERS = ['azure-ad'];
|
|
8
9
|
function tenantIdValidator(_id) {
|
|
9
10
|
return _id.length && _id.length <= 10 && /^[a-z]([a-z0-9])*$/.test(_id);
|
|
10
11
|
}
|
|
@@ -47,6 +48,30 @@ exports.TenantSchema = new mongoose_1.Schema({
|
|
|
47
48
|
required: true,
|
|
48
49
|
default: 'invoice'
|
|
49
50
|
},
|
|
51
|
+
authProvider: {
|
|
52
|
+
provider: {
|
|
53
|
+
type: String,
|
|
54
|
+
enum: exports.AUTH_PROVIDERS,
|
|
55
|
+
required: true
|
|
56
|
+
},
|
|
57
|
+
clientId: {
|
|
58
|
+
type: String,
|
|
59
|
+
required: true
|
|
60
|
+
},
|
|
61
|
+
clientSecret: {
|
|
62
|
+
type: String,
|
|
63
|
+
required: true
|
|
64
|
+
},
|
|
65
|
+
emailRegex: {
|
|
66
|
+
type: String,
|
|
67
|
+
required: true
|
|
68
|
+
},
|
|
69
|
+
config: {
|
|
70
|
+
azureAdTenantId: { type: String, required: false },
|
|
71
|
+
required: false
|
|
72
|
+
},
|
|
73
|
+
required: false
|
|
74
|
+
},
|
|
50
75
|
repositories: [
|
|
51
76
|
{
|
|
52
77
|
type: {
|
package/lib/schema/Tenant.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tenant.js","sourceRoot":"","sources":["../../src/schema/Tenant.ts"],"names":[],"mappings":";;;AAAA,uCAAkD;AAClD,iCAA0C;AAE1C,MAAM,cAAc,GAAG,CAAC,CAAC;AAEZ,QAAA,eAAe,GAAG,CAAC,QAAQ,EAAE,SAAS,CAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"Tenant.js","sourceRoot":"","sources":["../../src/schema/Tenant.ts"],"names":[],"mappings":";;;AAAA,uCAAkD;AAClD,iCAA0C;AAE1C,MAAM,cAAc,GAAG,CAAC,CAAC;AAEZ,QAAA,eAAe,GAAG,CAAC,QAAQ,EAAE,SAAS,CAAU,CAAC;AACjD,QAAA,cAAc,GAAG,CAAC,UAAU,CAAU,CAAC;AAEpD,SAAS,iBAAiB,CAAC,GAAW;IACpC,OAAO,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,MAAM,IAAI,EAAE,IAAI,oBAAoB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC1E,CAAC;AAEY,QAAA,YAAY,GAAG,IAAI,iBAAM,CAAC;IACrC,GAAG,EAAE;QACH,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,uBAAgB;QACzB,QAAQ,EAAE;YACR,SAAS,EAAE,iBAAiB;YAC5B,OAAO,EAAE,CAAC,KAAqB,EAAE,EAAE,CACjC,GAAG,KAAK,CAAC,KAAK,8GAA8G;SAC/H;KACF;IACD,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE;IACzD,IAAI,EAAE;QACJ,IAAI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AM;gBACZ,QAAQ,EAAE,IAAI;aACf;SACF;KACF;IACD,aAAa,EAAE;QACb,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,cAAc;KACxB;CACF,CAAC,CAAC"}
|
package/lib/schema/User.d.ts
CHANGED
|
@@ -40,6 +40,7 @@ export declare const UserSchema: Schema<any, import("mongoose").Model<any, any,
|
|
|
40
40
|
notifications: import("mongoose").Types.DocumentArray<{
|
|
41
41
|
message: string;
|
|
42
42
|
link: string;
|
|
43
|
+
createdAt: Date;
|
|
43
44
|
}>;
|
|
44
45
|
favoriteServices: string[];
|
|
45
46
|
lastAccessed?: Date | undefined;
|
|
@@ -64,6 +65,7 @@ export declare const UserSchema: Schema<any, import("mongoose").Model<any, any,
|
|
|
64
65
|
notifications: import("mongoose").Types.DocumentArray<{
|
|
65
66
|
message: string;
|
|
66
67
|
link: string;
|
|
68
|
+
createdAt: Date;
|
|
67
69
|
}>;
|
|
68
70
|
favoriteServices: string[];
|
|
69
71
|
lastAccessed?: Date | undefined;
|
|
@@ -88,6 +90,7 @@ export declare const UserSchema: Schema<any, import("mongoose").Model<any, any,
|
|
|
88
90
|
notifications: import("mongoose").Types.DocumentArray<{
|
|
89
91
|
message: string;
|
|
90
92
|
link: string;
|
|
93
|
+
createdAt: Date;
|
|
91
94
|
}>;
|
|
92
95
|
favoriteServices: string[];
|
|
93
96
|
lastAccessed?: Date | undefined;
|
package/lib/schema/User.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"User.d.ts","sourceRoot":"","sources":["../../src/schema/User.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,MAAM,QAAQ,GAAG,aAAa,GAAG,MAAM,CAAC;AAC9C,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"User.d.ts","sourceRoot":"","sources":["../../src/schema/User.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,MAAM,QAAQ,GAAG,aAAa,GAAG,MAAM,CAAC;AAC9C,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAC;AAY1D,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmErB,CAAC"}
|
package/lib/schema/User.js
CHANGED
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UserSchema = void 0;
|
|
4
4
|
const mongoose_1 = require("mongoose");
|
|
5
|
-
const SCHEMA_VERSION =
|
|
5
|
+
const SCHEMA_VERSION = 7;
|
|
6
6
|
const UserRoles = ['osaas-admin', 'user'];
|
|
7
7
|
const NotificationSchema = new mongoose_1.Schema({
|
|
8
8
|
message: { type: String, required: true },
|
|
9
|
-
link: { type: String, required: true }
|
|
9
|
+
link: { type: String, required: true },
|
|
10
|
+
createdAt: { type: Date, required: true, default: Date.now }
|
|
10
11
|
});
|
|
11
12
|
exports.UserSchema = new mongoose_1.Schema({
|
|
12
13
|
lastAccessed: {
|
package/lib/schema/User.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"User.js","sourceRoot":"","sources":["../../src/schema/User.ts"],"names":[],"mappings":";;;AAAA,uCAAkC;AAKlC,MAAM,cAAc,GAAG,CAAC,CAAC;AAEzB,MAAM,SAAS,GAAe,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;AAEtD,MAAM,kBAAkB,GAAG,IAAI,iBAAM,CAAC;IACpC,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE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K;KAChB;IACD,QAAQ,EAAE;QACR,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,KAAK;KAChB;IACD,MAAM,EAAE;QACN,IAAI,EAAE;YACJ,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;SAC1B;QACD,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,EAAE;QACX,GAAG,EAAE,KAAK;KACX;IACD,OAAO,EAAE;QACP;YACE,GAAG,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;YACpD,IAAI,EAAE;gBACJ,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC;gBAClC,QAAQ,EAAE,IAAI;gBACd,OAAO,EAAE,QAAQ;aAClB;YACD,mBAAmB,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;SACtD;KACF;IACD,aAAa,EAAE,CAAC,kBAAkB,CAAC;IACnC,gBAAgB,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IACjE,aAAa,EAAE;QACb,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,cAAc;KACxB;CACF,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@osaas/types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "OSaaS shared types",
|
|
5
5
|
"author": "Jonas Birmé <jonas.birme@eyevinn.se>",
|
|
6
6
|
"homepage": "https://github.com/Eyevinn/osaas-lib-util#readme",
|
|
@@ -31,5 +31,5 @@
|
|
|
31
31
|
"mongoose": "^7.4.3",
|
|
32
32
|
"nanoid": "^3.0.2"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "239ca11ba270bbe3222707c911f3e8587a54805a"
|
|
35
35
|
}
|