triangle-types 1.0.290 → 1.0.291
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/dist/src/index.d.ts +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/types/prism/UserPrismSample.d.ts +12 -0
- package/dist/src/types/prism/UserPrismSample.js +31 -0
- package/dist/src/types/user/TenantProvision.d.ts +1 -2
- package/dist/src/types/user/TenantProvision.js +1 -1
- package/package.json +1 -1
- package/src/index.ts +1 -1
- package/src/types/prism/UserPrismSample.ts +36 -0
- package/src/types/user/TenantProvision.ts +1 -1
package/dist/src/index.d.ts
CHANGED
|
@@ -72,7 +72,7 @@ export * from "./types/prism/PrismSegment.js";
|
|
|
72
72
|
export * from "./types/prism/PrismTarget.js";
|
|
73
73
|
export * from "./types/prism/Target.js";
|
|
74
74
|
export * from "./types/prism/TenantVoterTag.js";
|
|
75
|
-
export * from "./types/prism/
|
|
75
|
+
export * from "./types/prism/UserPrismSample.js";
|
|
76
76
|
export * from "./types/prism/StateVoter.js";
|
|
77
77
|
export * from "./types/prism/StateVoterFeature.js";
|
|
78
78
|
export * from "./types/prism/StateVoterTarget.js";
|
package/dist/src/index.js
CHANGED
|
@@ -72,7 +72,7 @@ export * from "./types/prism/PrismSegment.js";
|
|
|
72
72
|
export * from "./types/prism/PrismTarget.js";
|
|
73
73
|
export * from "./types/prism/Target.js";
|
|
74
74
|
export * from "./types/prism/TenantVoterTag.js";
|
|
75
|
-
export * from "./types/prism/
|
|
75
|
+
export * from "./types/prism/UserPrismSample.js";
|
|
76
76
|
export * from "./types/prism/StateVoter.js";
|
|
77
77
|
export * from "./types/prism/StateVoterFeature.js";
|
|
78
78
|
export * from "./types/prism/StateVoterTarget.js";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare class UserPrismSample {
|
|
2
|
+
readonly user_id: string;
|
|
3
|
+
readonly prism_id: string;
|
|
4
|
+
readonly sample_id: string;
|
|
5
|
+
readonly tenant_id: string;
|
|
6
|
+
readonly num_voters: number;
|
|
7
|
+
readonly name: string;
|
|
8
|
+
readonly seed: number;
|
|
9
|
+
readonly [x: string]: any;
|
|
10
|
+
constructor(prism_sample: any);
|
|
11
|
+
static is(prism_sample: any): prism_sample is UserPrismSample;
|
|
12
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export class UserPrismSample {
|
|
2
|
+
user_id;
|
|
3
|
+
prism_id;
|
|
4
|
+
sample_id;
|
|
5
|
+
tenant_id;
|
|
6
|
+
num_voters;
|
|
7
|
+
name;
|
|
8
|
+
seed;
|
|
9
|
+
constructor(prism_sample) {
|
|
10
|
+
if (!UserPrismSample.is(prism_sample)) {
|
|
11
|
+
throw Error("Invalid input.");
|
|
12
|
+
}
|
|
13
|
+
this.user_id = prism_sample.user_id;
|
|
14
|
+
this.prism_id = prism_sample.prism_id;
|
|
15
|
+
this.sample_id = prism_sample.sample_id;
|
|
16
|
+
this.tenant_id = prism_sample.tenant_id;
|
|
17
|
+
this.num_voters = prism_sample.num_voters;
|
|
18
|
+
this.name = prism_sample.name;
|
|
19
|
+
this.seed = prism_sample.seed;
|
|
20
|
+
}
|
|
21
|
+
static is(prism_sample) {
|
|
22
|
+
return (prism_sample !== undefined &&
|
|
23
|
+
typeof prism_sample.user_id === "string" &&
|
|
24
|
+
typeof prism_sample.prism_id === "string" &&
|
|
25
|
+
typeof prism_sample.sample_id === "string" &&
|
|
26
|
+
typeof prism_sample.tenant_id === "string" &&
|
|
27
|
+
typeof prism_sample.num_voters === "number" &&
|
|
28
|
+
typeof prism_sample.name === "string" &&
|
|
29
|
+
typeof prism_sample.seed === "number");
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -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
|
+
export 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 {
|
|
@@ -13,4 +13,3 @@ export declare class TenantProvision {
|
|
|
13
13
|
constructor(tenant_provision: TenantProvision);
|
|
14
14
|
static is(tenant_provision: any): tenant_provision is TenantProvision;
|
|
15
15
|
}
|
|
16
|
-
export {};
|
|
@@ -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
|
+
export 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
|
}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -87,7 +87,7 @@ export * from "./types/prism/PrismSegment"
|
|
|
87
87
|
export * from "./types/prism/PrismTarget"
|
|
88
88
|
export * from "./types/prism/Target"
|
|
89
89
|
export * from "./types/prism/TenantVoterTag"
|
|
90
|
-
export * from "./types/prism/
|
|
90
|
+
export * from "./types/prism/UserPrismSample"
|
|
91
91
|
export * from "./types/prism/StateVoter"
|
|
92
92
|
export * from "./types/prism/StateVoterFeature"
|
|
93
93
|
export * from "./types/prism/StateVoterTarget"
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export class UserPrismSample {
|
|
2
|
+
readonly user_id : string
|
|
3
|
+
readonly prism_id : string
|
|
4
|
+
readonly sample_id : string
|
|
5
|
+
readonly tenant_id : string
|
|
6
|
+
readonly num_voters : number
|
|
7
|
+
readonly name : string
|
|
8
|
+
readonly seed : number
|
|
9
|
+
readonly [x : string] : any
|
|
10
|
+
|
|
11
|
+
constructor(prism_sample : any) {
|
|
12
|
+
if (!UserPrismSample.is(prism_sample)) {
|
|
13
|
+
throw Error("Invalid input.")
|
|
14
|
+
}
|
|
15
|
+
this.user_id = prism_sample.user_id
|
|
16
|
+
this.prism_id = prism_sample.prism_id
|
|
17
|
+
this.sample_id = prism_sample.sample_id
|
|
18
|
+
this.tenant_id = prism_sample.tenant_id
|
|
19
|
+
this.num_voters = prism_sample.num_voters
|
|
20
|
+
this.name = prism_sample.name
|
|
21
|
+
this.seed = prism_sample.seed
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
static is(prism_sample : any) : prism_sample is UserPrismSample {
|
|
25
|
+
return (
|
|
26
|
+
prism_sample !== undefined &&
|
|
27
|
+
typeof prism_sample.user_id === "string" &&
|
|
28
|
+
typeof prism_sample.prism_id === "string" &&
|
|
29
|
+
typeof prism_sample.sample_id === "string" &&
|
|
30
|
+
typeof prism_sample.tenant_id === "string" &&
|
|
31
|
+
typeof prism_sample.num_voters === "number" &&
|
|
32
|
+
typeof prism_sample.name === "string" &&
|
|
33
|
+
typeof prism_sample.seed === "number"
|
|
34
|
+
)
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -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
|
+
export 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
|
|