@osaas/types 0.5.0 → 0.6.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/lib/schema/Tenant.d.ts +31 -0
- package/lib/schema/Tenant.d.ts.map +1 -1
- package/lib/schema/Tenant.js +26 -2
- package/lib/schema/Tenant.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,16 @@ 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
|
+
azureAdTenantId?: string | undefined;
|
|
48
|
+
} | undefined;
|
|
49
|
+
} | undefined;
|
|
39
50
|
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
40
51
|
_id: string;
|
|
41
52
|
enabled: boolean;
|
|
@@ -48,6 +59,16 @@ export declare const TenantSchema: Schema<any, import("mongoose").Model<any, any
|
|
|
48
59
|
name?: string | undefined;
|
|
49
60
|
description?: string | undefined;
|
|
50
61
|
avatarUrl?: string | undefined;
|
|
62
|
+
authProvider?: {
|
|
63
|
+
provider: "azure-ad";
|
|
64
|
+
clientId: string;
|
|
65
|
+
clientSecret: string;
|
|
66
|
+
emailRegex: string;
|
|
67
|
+
required?: unknown;
|
|
68
|
+
config?: {
|
|
69
|
+
azureAdTenantId?: string | undefined;
|
|
70
|
+
} | undefined;
|
|
71
|
+
} | undefined;
|
|
51
72
|
}>> & import("mongoose").FlatRecord<{
|
|
52
73
|
_id: string;
|
|
53
74
|
enabled: boolean;
|
|
@@ -60,6 +81,16 @@ export declare const TenantSchema: Schema<any, import("mongoose").Model<any, any
|
|
|
60
81
|
name?: string | undefined;
|
|
61
82
|
description?: string | undefined;
|
|
62
83
|
avatarUrl?: string | undefined;
|
|
84
|
+
authProvider?: {
|
|
85
|
+
provider: "azure-ad";
|
|
86
|
+
clientId: string;
|
|
87
|
+
clientSecret: string;
|
|
88
|
+
emailRegex: string;
|
|
89
|
+
required?: unknown;
|
|
90
|
+
config?: {
|
|
91
|
+
azureAdTenantId?: string | undefined;
|
|
92
|
+
} | undefined;
|
|
93
|
+
} | undefined;
|
|
63
94
|
}> & Required<{
|
|
64
95
|
_id: string;
|
|
65
96
|
}>>;
|
|
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkFvB,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,29 @@ 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
|
+
},
|
|
72
|
+
required: false
|
|
73
|
+
},
|
|
50
74
|
repositories: [
|
|
51
75
|
{
|
|
52
76
|
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,EAAE,MAAM;QACZ,QAAQ,EAAE,KAAK;QACf,KAAK,EAAE;YACL,MAAM,EAAE,IAAI;YACZ,SAAS,EAAE;gBACT,mBAAmB;gBACnB,MAAM,EAAE,QAAQ;gBAChB,QAAQ,EAAE,CAAC;aACZ;YACD,8CAA8C;Y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
{
|
|
2
2
|
"name": "@osaas/types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.1",
|
|
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": "9773960cb4ff77cbb388bb5fceff134dd3070e58"
|
|
35
35
|
}
|