triangle-types 1.0.212 → 1.0.214

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,16 @@
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 path: 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
+ constructor(tenant_document: any);
15
+ static is(tenant_document: any): tenant_document is TenantDocument;
16
+ }
@@ -0,0 +1,41 @@
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
+ path;
8
+ fragment_type_id;
9
+ s3_id_zip;
10
+ s3_id;
11
+ s3_id_pdf;
12
+ s3_id_txt;
13
+ constructor(tenant_document) {
14
+ if (!TenantDocument.is(tenant_document)) {
15
+ throw Error("Invalid input.");
16
+ }
17
+ this.tenant_id = tenant_document.tenant_id;
18
+ this.document_id = tenant_document.document_id;
19
+ this.file_extension_id = tenant_document.file_extension_id;
20
+ this.name = tenant_document.name;
21
+ this.path = tenant_document.path;
22
+ this.fragment_type_id = tenant_document.fragment_type_id;
23
+ this.s3_id_zip = tenant_document.s3_id_zip;
24
+ this.s3_id = tenant_document.s3_id;
25
+ this.s3_id_pdf = tenant_document.s3_id_pdf;
26
+ this.s3_id_txt = tenant_document.s3_id_txt;
27
+ }
28
+ static is(tenant_document) {
29
+ return (tenant_document !== undefined &&
30
+ typeof tenant_document.tenant_id === "string" &&
31
+ typeof tenant_document.document_id === "string" &&
32
+ typeof tenant_document.file_extension_id === "string" &&
33
+ typeof tenant_document.name === "string" &&
34
+ typeof tenant_document.path === "string" &&
35
+ (tenant_document.fragment_type_id === undefined || is_fragment_type_id(tenant_document.fragment_type_id)) &&
36
+ typeof tenant_document.s3_id_zip === "string" &&
37
+ typeof tenant_document.s3_id === "string" &&
38
+ (tenant_document.s3_id_pdf === undefined || typeof tenant_document.s3_id_pdf === "string") &&
39
+ (tenant_document.s3_id_txt === undefined || typeof tenant_document.s3_id_txt === "string"));
40
+ }
41
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "triangle-types",
3
- "version": "1.0.212",
3
+ "version": "1.0.214",
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,47 @@
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 path : string
9
+ readonly fragment_type_id? : FragmentTypeID
10
+ readonly s3_id_zip : string
11
+ readonly s3_id : string
12
+ readonly s3_id_pdf? : string
13
+ readonly s3_id_txt? : string
14
+ readonly [x : string] : any
15
+
16
+ constructor(tenant_document : any) {
17
+ if (!TenantDocument.is(tenant_document)) {
18
+ throw Error("Invalid input.")
19
+ }
20
+ this.tenant_id = tenant_document.tenant_id
21
+ this.document_id = tenant_document.document_id
22
+ this.file_extension_id = tenant_document.file_extension_id
23
+ this.name = tenant_document.name
24
+ this.path = tenant_document.path
25
+ this.fragment_type_id = tenant_document.fragment_type_id
26
+ this.s3_id_zip = tenant_document.s3_id_zip
27
+ this.s3_id = tenant_document.s3_id
28
+ this.s3_id_pdf = tenant_document.s3_id_pdf
29
+ this.s3_id_txt = tenant_document.s3_id_txt
30
+ }
31
+
32
+ static is(tenant_document : any) : tenant_document is TenantDocument {
33
+ return (
34
+ tenant_document !== undefined &&
35
+ typeof tenant_document.tenant_id === "string" &&
36
+ typeof tenant_document.document_id === "string" &&
37
+ typeof tenant_document.file_extension_id === "string" &&
38
+ typeof tenant_document.name === "string" &&
39
+ typeof tenant_document.path === "string" &&
40
+ (tenant_document.fragment_type_id === undefined || is_fragment_type_id(tenant_document.fragment_type_id)) &&
41
+ typeof tenant_document.s3_id_zip === "string" &&
42
+ typeof tenant_document.s3_id === "string" &&
43
+ (tenant_document.s3_id_pdf === undefined || typeof tenant_document.s3_id_pdf === "string") &&
44
+ (tenant_document.s3_id_txt === undefined || typeof tenant_document.s3_id_txt === "string")
45
+ )
46
+ }
47
+ }