triangle-types 1.0.120 → 1.0.121

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.
@@ -1,4 +1,3 @@
1
- import { TenantProvision } from "./TenantProvision.js";
2
1
  export declare class Tenant {
3
2
  readonly tenant_id: string;
4
3
  readonly name: string;
@@ -6,8 +5,3 @@ export declare class Tenant {
6
5
  constructor(tenant: Tenant);
7
6
  static is(tenant: any): tenant is Tenant;
8
7
  }
9
- export declare class TenantAux extends Tenant {
10
- readonly provisions: TenantProvision[];
11
- constructor(tenant: Tenant);
12
- static is(tenant: any): tenant is TenantAux;
13
- }
@@ -1,4 +1,3 @@
1
- import { TenantProvision } from "./TenantProvision.js";
2
1
  export class Tenant {
3
2
  tenant_id;
4
3
  name;
@@ -15,17 +14,3 @@ export class Tenant {
15
14
  typeof tenant.name === "string");
16
15
  }
17
16
  }
18
- export class TenantAux extends Tenant {
19
- provisions;
20
- constructor(tenant) {
21
- if (!TenantAux.is(tenant)) {
22
- throw Error("Invalid Input.");
23
- }
24
- super(tenant);
25
- this.provisions = tenant.provisions;
26
- }
27
- static is(tenant) {
28
- return (Tenant.is(tenant) &&
29
- Array.isArray(tenant.provisions) && tenant.provisions.every(TenantProvision.is));
30
- }
31
- }
@@ -1,4 +1,3 @@
1
- import { TenantAux } from "./Tenant.js";
2
1
  export declare class User {
3
2
  readonly user_id: string;
4
3
  readonly email: string;
@@ -7,8 +6,3 @@ export declare class User {
7
6
  constructor(user: User);
8
7
  static is(user: any): user is User;
9
8
  }
10
- export declare class UserAux extends User {
11
- readonly tenant?: TenantAux;
12
- constructor(user: UserAux);
13
- static is(user: any): user is UserAux;
14
- }
@@ -1,11 +1,6 @@
1
- import { TenantAux } from "./Tenant.js";
2
1
  export class User {
3
2
  user_id;
4
3
  email;
5
- // readonly is_admin_elections : boolean
6
- // readonly is_admin_prism : boolean
7
- // readonly is_admin_scout : boolean
8
- // readonly is_admin_triage : boolean
9
4
  tenant_id;
10
5
  constructor(user) {
11
6
  if (!User.is(user)) {
@@ -13,34 +8,28 @@ export class User {
13
8
  }
14
9
  this.user_id = user.user_id;
15
10
  this.email = user.email;
16
- // this.is_admin_elections = user.is_admin_elections
17
- // this.is_admin_prism = user.is_admin_prism
18
- // this.is_admin_scout = user.is_admin_scout
19
- // this.is_admin_triage = user.is_admin_triage
20
11
  this.tenant_id = user.tenant_id;
21
12
  }
22
13
  static is(user) {
23
14
  return (user !== undefined &&
24
15
  typeof user.user_id === "string" &&
25
16
  typeof user.email === "string" &&
26
- // typeof user.is_admin_elections === "boolean" &&
27
- // typeof user.is_admin_prism === "boolean" &&
28
- // typeof user.is_admin_scout === "boolean" &&
29
- // typeof user.is_admin_triage === "boolean" &&
30
17
  (user.tenant_id === undefined || typeof user.tenant_id === "string"));
31
18
  }
32
19
  }
33
- export class UserAux extends User {
34
- tenant;
35
- constructor(user) {
36
- if (!UserAux.is(user)) {
37
- throw Error("Invalid Input.");
38
- }
39
- super(user);
40
- this.tenant = user.tenant;
41
- }
42
- static is(user) {
43
- return (User.is(user) &&
44
- (user.tenant === undefined || TenantAux.is(user.tenant)));
45
- }
46
- }
20
+ // export class UserAux extends User {
21
+ // readonly tenant? : TenantAux
22
+ // constructor (user : UserAux) {
23
+ // if (!UserAux.is(user)) {
24
+ // throw Error("Invalid Input.")
25
+ // }
26
+ // super(user)
27
+ // this.tenant = user.tenant
28
+ // }
29
+ // static is(user : any) : user is UserAux {
30
+ // return (
31
+ // User.is(user) &&
32
+ // (user.tenant === undefined || TenantAux.is(user.tenant))
33
+ // )
34
+ // }
35
+ // }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "triangle-types",
3
- "version": "1.0.120",
3
+ "version": "1.0.121",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "scripts": {
@@ -1,5 +1,3 @@
1
- import { TenantProvision } from "./TenantProvision"
2
-
3
1
  export class Tenant {
4
2
  readonly tenant_id : string
5
3
  readonly name : string
@@ -20,23 +18,4 @@ export class Tenant {
20
18
  typeof tenant.name === "string"
21
19
  )
22
20
  }
23
- }
24
-
25
- export class TenantAux extends Tenant {
26
- readonly provisions : TenantProvision[]
27
-
28
- constructor(tenant : Tenant) {
29
- if (!TenantAux.is(tenant)) {
30
- throw Error("Invalid Input.")
31
- }
32
- super(tenant)
33
- this.provisions = tenant.provisions
34
- }
35
-
36
- static is(tenant : any) : tenant is TenantAux {
37
- return (
38
- Tenant.is(tenant) &&
39
- Array.isArray(tenant.provisions) && tenant.provisions.every(TenantProvision.is)
40
- )
41
- }
42
21
  }
@@ -1,13 +1,6 @@
1
- import { Tenant, TenantAux } from "./Tenant"
2
- import { TenantProvision } from "./TenantProvision"
3
-
4
1
  export class User {
5
2
  readonly user_id : string
6
3
  readonly email : string
7
- // readonly is_admin_elections : boolean
8
- // readonly is_admin_prism : boolean
9
- // readonly is_admin_scout : boolean
10
- // readonly is_admin_triage : boolean
11
4
  readonly tenant_id? : string
12
5
  readonly [x : string] : any
13
6
 
@@ -17,10 +10,6 @@ export class User {
17
10
  }
18
11
  this.user_id = user.user_id
19
12
  this.email = user.email
20
- // this.is_admin_elections = user.is_admin_elections
21
- // this.is_admin_prism = user.is_admin_prism
22
- // this.is_admin_scout = user.is_admin_scout
23
- // this.is_admin_triage = user.is_admin_triage
24
13
  this.tenant_id = user.tenant_id
25
14
  }
26
15
 
@@ -29,30 +18,26 @@ export class User {
29
18
  user !== undefined &&
30
19
  typeof user.user_id === "string" &&
31
20
  typeof user.email === "string" &&
32
- // typeof user.is_admin_elections === "boolean" &&
33
- // typeof user.is_admin_prism === "boolean" &&
34
- // typeof user.is_admin_scout === "boolean" &&
35
- // typeof user.is_admin_triage === "boolean" &&
36
21
  (user.tenant_id === undefined || typeof user.tenant_id === "string")
37
22
  )
38
23
  }
39
24
  }
40
25
 
41
- export class UserAux extends User {
42
- readonly tenant? : TenantAux
26
+ // export class UserAux extends User {
27
+ // readonly tenant? : TenantAux
43
28
 
44
- constructor (user : UserAux) {
45
- if (!UserAux.is(user)) {
46
- throw Error("Invalid Input.")
47
- }
48
- super(user)
49
- this.tenant = user.tenant
50
- }
29
+ // constructor (user : UserAux) {
30
+ // if (!UserAux.is(user)) {
31
+ // throw Error("Invalid Input.")
32
+ // }
33
+ // super(user)
34
+ // this.tenant = user.tenant
35
+ // }
51
36
 
52
- static is(user : any) : user is UserAux {
53
- return (
54
- User.is(user) &&
55
- (user.tenant === undefined || TenantAux.is(user.tenant))
56
- )
57
- }
58
- }
37
+ // static is(user : any) : user is UserAux {
38
+ // return (
39
+ // User.is(user) &&
40
+ // (user.tenant === undefined || TenantAux.is(user.tenant))
41
+ // )
42
+ // }
43
+ // }