triangle-types 1.0.212 → 1.0.213

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.
@@ -101,6 +101,7 @@ export * from "./types/state_permits/TN/TNStatePermitDocument.js";
101
101
  export * from "./types/state_permits/WI/WIStatePermit.js";
102
102
  export * from "./types/state_permits/WI/WIStatePermitDocument.js";
103
103
  export * from "./types/user/Tenant.js";
104
+ export * from "./types/user/TenantDocument.js";
104
105
  export * from "./types/user/TenantProvision.js";
105
106
  export * from "./types/user/User.js";
106
107
  export * from "./types/user/UserComment.js";
package/dist/src/index.js CHANGED
@@ -101,6 +101,7 @@ export * from "./types/state_permits/TN/TNStatePermitDocument.js";
101
101
  export * from "./types/state_permits/WI/WIStatePermit.js";
102
102
  export * from "./types/state_permits/WI/WIStatePermitDocument.js";
103
103
  export * from "./types/user/Tenant.js";
104
+ export * from "./types/user/TenantDocument.js";
104
105
  export * from "./types/user/TenantProvision.js";
105
106
  export * from "./types/user/User.js";
106
107
  export * from "./types/user/UserComment.js";
@@ -0,0 +1,15 @@
1
+ import { FragmentTypeID } from "../fragments/Fragment.js";
2
+ export declare class TenantDocument {
3
+ readonly tenant_id: string;
4
+ readonly document_id: string;
5
+ readonly file_extension_id: string;
6
+ readonly name: string;
7
+ readonly fragment_type_id?: FragmentTypeID;
8
+ readonly s3_id_zip: string;
9
+ readonly s3_id: string;
10
+ readonly s3_id_pdf?: string;
11
+ readonly s3_id_txt?: string;
12
+ readonly [x: string]: any;
13
+ constructor(tenant_document: any);
14
+ static is(tenant_document: any): tenant_document is TenantDocument;
15
+ }
@@ -0,0 +1,38 @@
1
+ import { is_fragment_type_id } from "../fragments/Fragment.js";
2
+ export class TenantDocument {
3
+ tenant_id;
4
+ document_id;
5
+ file_extension_id;
6
+ name;
7
+ fragment_type_id;
8
+ s3_id_zip;
9
+ s3_id;
10
+ s3_id_pdf;
11
+ s3_id_txt;
12
+ constructor(tenant_document) {
13
+ if (!TenantDocument.is(tenant_document)) {
14
+ throw Error("Invalid input.");
15
+ }
16
+ this.tenant_id = tenant_document.tenant_id;
17
+ this.document_id = tenant_document.document_id;
18
+ this.file_extension_id = tenant_document.file_extension_id;
19
+ this.name = tenant_document.name;
20
+ this.fragment_type_id = tenant_document.fragment_type_id;
21
+ this.s3_id_zip = tenant_document.s3_id_zip;
22
+ this.s3_id = tenant_document.s3_id;
23
+ this.s3_id_pdf = tenant_document.s3_id_pdf;
24
+ this.s3_id_txt = tenant_document.s3_id_txt;
25
+ }
26
+ static is(tenant_document) {
27
+ return (tenant_document !== undefined &&
28
+ typeof tenant_document.tenant_id === "string" &&
29
+ typeof tenant_document.document_id === "string" &&
30
+ typeof tenant_document.file_extension_id === "string" &&
31
+ typeof tenant_document.name === "string" &&
32
+ (tenant_document.fragment_type_id === undefined || is_fragment_type_id(tenant_document.fragment_type_id)) &&
33
+ typeof tenant_document.s3_id_zip === "string" &&
34
+ typeof tenant_document.s3_id === "string" &&
35
+ (tenant_document.s3_id_pdf === undefined || typeof tenant_document.s3_id_pdf === "string") &&
36
+ (tenant_document.s3_id_txt === undefined || typeof tenant_document.s3_id_txt === "string"));
37
+ }
38
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "triangle-types",
3
- "version": "1.0.212",
3
+ "version": "1.0.213",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "scripts": {
package/src/index.ts CHANGED
@@ -124,6 +124,7 @@ export * from "./types/state_permits/WI/WIStatePermit"
124
124
  export * from "./types/state_permits/WI/WIStatePermitDocument"
125
125
 
126
126
  export * from "./types/user/Tenant"
127
+ export * from "./types/user/TenantDocument"
127
128
  export * from "./types/user/TenantProvision"
128
129
  export * from "./types/user/User"
129
130
  export * from "./types/user/UserComment"
@@ -0,0 +1,44 @@
1
+ import { FragmentTypeID, is_fragment_type_id } from "../fragments/Fragment"
2
+
3
+ export class TenantDocument {
4
+ readonly tenant_id : string
5
+ readonly document_id : string
6
+ readonly file_extension_id : string
7
+ readonly name : string
8
+ readonly fragment_type_id? : FragmentTypeID
9
+ readonly s3_id_zip : string
10
+ readonly s3_id : string
11
+ readonly s3_id_pdf? : string
12
+ readonly s3_id_txt? : string
13
+ readonly [x : string] : any
14
+
15
+ constructor(tenant_document : any) {
16
+ if (!TenantDocument.is(tenant_document)) {
17
+ throw Error("Invalid input.")
18
+ }
19
+ this.tenant_id = tenant_document.tenant_id
20
+ this.document_id = tenant_document.document_id
21
+ this.file_extension_id = tenant_document.file_extension_id
22
+ this.name = tenant_document.name
23
+ this.fragment_type_id = tenant_document.fragment_type_id
24
+ this.s3_id_zip = tenant_document.s3_id_zip
25
+ this.s3_id = tenant_document.s3_id
26
+ this.s3_id_pdf = tenant_document.s3_id_pdf
27
+ this.s3_id_txt = tenant_document.s3_id_txt
28
+ }
29
+
30
+ static is(tenant_document : any) : tenant_document is TenantDocument {
31
+ return (
32
+ tenant_document !== undefined &&
33
+ typeof tenant_document.tenant_id === "string" &&
34
+ typeof tenant_document.document_id === "string" &&
35
+ typeof tenant_document.file_extension_id === "string" &&
36
+ typeof tenant_document.name === "string" &&
37
+ (tenant_document.fragment_type_id === undefined || is_fragment_type_id(tenant_document.fragment_type_id)) &&
38
+ typeof tenant_document.s3_id_zip === "string" &&
39
+ typeof tenant_document.s3_id === "string" &&
40
+ (tenant_document.s3_id_pdf === undefined || typeof tenant_document.s3_id_pdf === "string") &&
41
+ (tenant_document.s3_id_txt === undefined || typeof tenant_document.s3_id_txt === "string")
42
+ )
43
+ }
44
+ }