triangle-types 1.0.275 → 1.0.277

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,5 @@
1
1
  import { ResourceTypeID } from "./TenantProvision.js";
2
+ import { User } from "./User.js";
2
3
  export declare class UserComment {
3
4
  readonly user_id: string;
4
5
  readonly comment_id: string;
@@ -7,6 +8,12 @@ export declare class UserComment {
7
8
  readonly resource_id: string;
8
9
  readonly text: string;
9
10
  readonly is_active: boolean;
11
+ readonly [x: string]: any;
10
12
  constructor(user_comment: UserComment);
11
13
  static is(user_comment: any): user_comment is UserComment;
12
14
  }
15
+ export declare class UserCommentAux extends UserComment {
16
+ readonly user: User;
17
+ constructor(user_comment: UserCommentAux);
18
+ static is(user_comment: any): user_comment is UserCommentAux;
19
+ }
@@ -1,3 +1,4 @@
1
+ import { User } from "./User.js";
1
2
  export class UserComment {
2
3
  user_id;
3
4
  comment_id;
@@ -6,7 +7,6 @@ export class UserComment {
6
7
  resource_id;
7
8
  text;
8
9
  is_active;
9
- // readonly [x : string] : any
10
10
  constructor(user_comment) {
11
11
  if (!UserComment.is(user_comment)) {
12
12
  throw Error("Invalid Input.");
@@ -30,3 +30,17 @@ export class UserComment {
30
30
  typeof user_comment.is_active === "boolean");
31
31
  }
32
32
  }
33
+ export class UserCommentAux extends UserComment {
34
+ user;
35
+ constructor(user_comment) {
36
+ if (!UserCommentAux.is(user_comment)) {
37
+ throw Error("Invalid Input.");
38
+ }
39
+ super(user_comment);
40
+ this.user = user_comment.user;
41
+ }
42
+ static is(user_comment) {
43
+ return (UserComment.is(user_comment) &&
44
+ User.is(user_comment.user));
45
+ }
46
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "triangle-types",
3
- "version": "1.0.275",
3
+ "version": "1.0.277",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "scripts": {
@@ -1,4 +1,5 @@
1
1
  import { ResourceTypeID } from "./TenantProvision"
2
+ import { User } from "./User"
2
3
 
3
4
  export class UserComment {
4
5
  readonly user_id : string
@@ -8,7 +9,7 @@ export class UserComment {
8
9
  readonly resource_id : string
9
10
  readonly text : string
10
11
  readonly is_active : boolean
11
- // readonly [x : string] : any
12
+ readonly [x : string] : any
12
13
 
13
14
  constructor(user_comment : UserComment) {
14
15
  if (!UserComment.is(user_comment)) {
@@ -35,4 +36,23 @@ export class UserComment {
35
36
  typeof user_comment.is_active === "boolean"
36
37
  )
37
38
  }
39
+ }
40
+
41
+ export class UserCommentAux extends UserComment {
42
+ readonly user : User
43
+
44
+ constructor(user_comment : UserCommentAux) {
45
+ if (!UserCommentAux.is(user_comment)) {
46
+ throw Error("Invalid Input.")
47
+ }
48
+ super(user_comment)
49
+ this.user = user_comment.user
50
+ }
51
+
52
+ static is(user_comment : any) : user_comment is UserCommentAux {
53
+ return (
54
+ UserComment.is(user_comment) &&
55
+ User.is(user_comment.user)
56
+ )
57
+ }
38
58
  }