triangle-types 1.0.118 → 1.0.119

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,6 +1,11 @@
1
+ declare const tenant_provision_type_ids: readonly ["supreme_admin", "scout", "prism"];
2
+ export type TenantProvisionTypeID = typeof tenant_provision_type_ids[number];
3
+ export declare function is_tenant_provision_type_id(tenant_provision_type_id: any): tenant_provision_type_id is TenantProvisionTypeID;
1
4
  export declare class TenantProvision {
2
5
  readonly tenant_id: string;
3
6
  readonly provision_id: string;
7
+ readonly value?: any;
4
8
  constructor(tenant_provision: TenantProvision);
5
9
  static is(tenant_provision: any): tenant_provision is TenantProvision;
6
10
  }
11
+ export {};
@@ -1,6 +1,11 @@
1
+ const tenant_provision_type_ids = ["supreme_admin", "scout", "prism"];
2
+ export function is_tenant_provision_type_id(tenant_provision_type_id) {
3
+ return tenant_provision_type_ids.includes(tenant_provision_type_id);
4
+ }
1
5
  export class TenantProvision {
2
6
  tenant_id;
3
7
  provision_id;
8
+ value;
4
9
  // readonly [x : string] : any
5
10
  constructor(tenant_provision) {
6
11
  if (!TenantProvision.is(tenant_provision)) {
@@ -8,6 +13,7 @@ export class TenantProvision {
8
13
  }
9
14
  this.tenant_id = tenant_provision.tenant_id;
10
15
  this.provision_id = tenant_provision.provision_id;
16
+ this.value = tenant_provision.value;
11
17
  }
12
18
  static is(tenant_provision) {
13
19
  return (tenant_provision !== undefined &&
@@ -1,4 +1,4 @@
1
- import { Tenant } from "./Tenant.js";
1
+ import { TenantAux } from "./Tenant.js";
2
2
  export declare class User {
3
3
  readonly user_id: string;
4
4
  readonly email: string;
@@ -8,7 +8,7 @@ export declare class User {
8
8
  static is(user: any): user is User;
9
9
  }
10
10
  export declare class UserAux extends User {
11
- readonly tenant?: Tenant;
11
+ readonly tenant?: TenantAux;
12
12
  constructor(user: UserAux);
13
13
  static is(user: any): user is UserAux;
14
14
  }
@@ -1,4 +1,4 @@
1
- import { Tenant } from "./Tenant.js";
1
+ import { TenantAux } from "./Tenant.js";
2
2
  export class User {
3
3
  user_id;
4
4
  email;
@@ -41,6 +41,6 @@ export class UserAux extends User {
41
41
  }
42
42
  static is(user) {
43
43
  return (User.is(user) &&
44
- (user.tenant === undefined || Tenant.is(user.tenant)));
44
+ (user.tenant === undefined || TenantAux.is(user.tenant)));
45
45
  }
46
46
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "triangle-types",
3
- "version": "1.0.118",
3
+ "version": "1.0.119",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "scripts": {
@@ -1,6 +1,16 @@
1
+ const tenant_provision_type_ids = ["supreme_admin", "scout", "prism"] as const
2
+
3
+ export type TenantProvisionTypeID = typeof tenant_provision_type_ids[number]
4
+
5
+ export function is_tenant_provision_type_id(tenant_provision_type_id : any) : tenant_provision_type_id is TenantProvisionTypeID {
6
+ return tenant_provision_type_ids.includes(tenant_provision_type_id)
7
+ }
8
+
9
+
1
10
  export class TenantProvision {
2
11
  readonly tenant_id : string
3
12
  readonly provision_id : string
13
+ readonly value? : any
4
14
  // readonly [x : string] : any
5
15
 
6
16
  constructor(tenant_provision : TenantProvision) {
@@ -9,6 +19,7 @@ export class TenantProvision {
9
19
  }
10
20
  this.tenant_id = tenant_provision.tenant_id
11
21
  this.provision_id = tenant_provision.provision_id
22
+ this.value = tenant_provision.value
12
23
  }
13
24
 
14
25
  static is(tenant_provision : any) : tenant_provision is TenantProvision {
@@ -1,4 +1,4 @@
1
- import { Tenant } from "./Tenant"
1
+ import { Tenant, TenantAux } from "./Tenant"
2
2
  import { TenantProvision } from "./TenantProvision"
3
3
 
4
4
  export class User {
@@ -39,7 +39,7 @@ export class User {
39
39
  }
40
40
 
41
41
  export class UserAux extends User {
42
- readonly tenant? : Tenant
42
+ readonly tenant? : TenantAux
43
43
 
44
44
  constructor (user : UserAux) {
45
45
  if (!UserAux.is(user)) {
@@ -52,7 +52,7 @@ export class UserAux extends User {
52
52
  static is(user : any) : user is UserAux {
53
53
  return (
54
54
  User.is(user) &&
55
- (user.tenant === undefined || Tenant.is(user.tenant))
55
+ (user.tenant === undefined || TenantAux.is(user.tenant))
56
56
  )
57
57
  }
58
58
  }