triangle-types 1.0.274 → 1.0.276

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,4 @@
1
- declare const resource_type_ids: readonly ["web_document", "twitter_tweet", "youtube_video", "document", "scout", "prism", "state-voter", "label", "target", "role", "user", "fragment_type", "palette"];
1
+ declare const resource_type_ids: readonly ["web_document", "twitter_tweet", "youtube_video", "document", "scout", "prism", "state_voter", "label", "target", "role", "user", "fragment_type", "palette"];
2
2
  export type ResourceTypeID = typeof resource_type_ids[number];
3
3
  export declare function is_resource_type_id(resource_type_id: any): resource_type_id is ResourceTypeID;
4
4
  export declare class TenantProvision {
@@ -1,4 +1,4 @@
1
- const resource_type_ids = ["web_document", "twitter_tweet", "youtube_video", "document", "scout", "prism", "state-voter", "label", "target", "role", "user", "fragment_type", "palette"];
1
+ const resource_type_ids = ["web_document", "twitter_tweet", "youtube_video", "document", "scout", "prism", "state_voter", "label", "target", "role", "user", "fragment_type", "palette"];
2
2
  export function is_resource_type_id(resource_type_id) {
3
3
  return resource_type_ids.includes(resource_type_id);
4
4
  }
@@ -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 {
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,16 @@ export class UserComment {
30
30
  typeof user_comment.is_active === "boolean");
31
31
  }
32
32
  }
33
+ export class UserCommentAux {
34
+ user;
35
+ constructor(user_comment) {
36
+ if (!UserCommentAux.is(user_comment)) {
37
+ throw Error("Invalid Input.");
38
+ }
39
+ this.user = user_comment.user;
40
+ }
41
+ static is(user_comment) {
42
+ return (UserComment.is(user_comment) &&
43
+ User.is(user_comment.user));
44
+ }
45
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "triangle-types",
3
- "version": "1.0.274",
3
+ "version": "1.0.276",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "scripts": {
@@ -1,4 +1,4 @@
1
- const resource_type_ids = ["web_document", "twitter_tweet", "youtube_video", "document", "scout", "prism", "state-voter", "label", "target", "role", "user", "fragment_type", "palette"] as const
1
+ const resource_type_ids = ["web_document", "twitter_tweet", "youtube_video", "document", "scout", "prism", "state_voter", "label", "target", "role", "user", "fragment_type", "palette"] as const
2
2
 
3
3
  export type ResourceTypeID = typeof resource_type_ids[number]
4
4
 
@@ -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,22 @@ export class UserComment {
35
36
  typeof user_comment.is_active === "boolean"
36
37
  )
37
38
  }
39
+ }
40
+
41
+ export class UserCommentAux {
42
+ readonly user : User
43
+
44
+ constructor(user_comment : UserCommentAux) {
45
+ if (!UserCommentAux.is(user_comment)) {
46
+ throw Error("Invalid Input.")
47
+ }
48
+ this.user = user_comment.user
49
+ }
50
+
51
+ static is(user_comment : any) : user_comment is UserCommentAux {
52
+ return (
53
+ UserComment.is(user_comment) &&
54
+ User.is(user_comment.user)
55
+ )
56
+ }
38
57
  }