@turndown/library 0.1.16 → 0.1.22
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/helpers/date/index.d.ts +113 -0
- package/dist/helpers/date/index.js +171 -0
- package/dist/helpers/index.d.ts +3 -1
- package/dist/helpers/index.js +2 -1
- package/dist/helpers/object/index.d.ts +160 -75
- package/dist/helpers/object/index.js +355 -168
- package/dist/helpers/string/index.d.ts +227 -74
- package/dist/helpers/string/index.js +448 -114
- package/dist/types/api/index.d.ts +22 -11
- package/dist/types/api/index.js +9 -2
- package/dist/types/auth/index.d.ts +56 -18
- package/dist/types/auth/index.js +7 -0
- package/dist/types/auth/routes.d.ts +76 -47
- package/dist/types/auth/routes.js +0 -1
- package/dist/types/base/index.d.ts +200 -69
- package/dist/types/base/index.js +116 -0
- package/dist/types/base/paging.types.d.ts +11 -11
- package/dist/types/checklist-template/index.d.ts +8 -8
- package/dist/types/checklist-template/routes.d.ts +57 -28
- package/dist/types/checklist-template/routes.js +0 -1
- package/dist/types/company/index.d.ts +5 -5
- package/dist/types/company/routes.d.ts +81 -33
- package/dist/types/company/routes.js +0 -1
- package/dist/types/damage-report/index.d.ts +9 -9
- package/dist/types/damage-report/routes.d.ts +128 -51
- package/dist/types/damage-report/routes.js +0 -1
- package/dist/types/errors/index.d.ts +15 -16
- package/dist/types/errors/index.js +17 -7
- package/dist/types/health/index.d.ts +20 -0
- package/dist/types/health/index.js +1 -0
- package/dist/types/health/routes.d.ts +10 -0
- package/dist/types/health/routes.js +1 -0
- package/dist/types/image/index.d.ts +34 -0
- package/dist/types/image/index.js +11 -0
- package/dist/types/image/routes.d.ts +32 -0
- package/dist/types/image/routes.js +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.js +3 -0
- package/dist/types/inventory/index.d.ts +13 -87
- package/dist/types/inventory/routes.d.ts +73 -36
- package/dist/types/inventory/routes.js +0 -1
- package/dist/types/job/index.d.ts +7 -0
- package/dist/types/job/index.js +1 -0
- package/dist/types/property/index.d.ts +88 -29
- package/dist/types/property/index.js +23 -23
- package/dist/types/property/routes.d.ts +40 -14
- package/dist/types/property/routes.js +0 -1
- package/dist/types/room/index.d.ts +4 -4
- package/dist/types/room/routes.d.ts +27 -8
- package/dist/types/room/routes.js +0 -1
- package/dist/types/room-checklist/index.d.ts +9 -9
- package/dist/types/room-checklist/routes.d.ts +50 -28
- package/dist/types/room-checklist/routes.js +0 -1
- package/dist/types/user/index.d.ts +12 -12
- package/dist/types/user/routes.d.ts +26 -16
- package/dist/types/user/routes.js +0 -1
- package/dist/types/work-session/index.d.ts +12 -12
- package/dist/types/work-session/routes.d.ts +55 -34
- package/dist/types/work-session/routes.js +0 -1
- package/package.json +14 -5
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IMetaData, TRecordValue } from "../index";
|
|
2
2
|
export * from "./routes";
|
|
3
|
-
export interface
|
|
3
|
+
export interface IUser extends IMetaData {
|
|
4
4
|
id: string;
|
|
5
5
|
firstName: string;
|
|
6
6
|
lastName?: string;
|
|
@@ -14,15 +14,15 @@ export interface User extends MetaData {
|
|
|
14
14
|
passwordLastReset?: string;
|
|
15
15
|
passwordResetRequired?: boolean;
|
|
16
16
|
lastLogin?: string;
|
|
17
|
-
accountType:
|
|
18
|
-
status:
|
|
17
|
+
accountType: TAccountType;
|
|
18
|
+
status: TAccountStatus;
|
|
19
19
|
phoneNumber?: string;
|
|
20
20
|
phoneFormat?: string;
|
|
21
|
-
preferredLanguage?:
|
|
21
|
+
preferredLanguage?: TLanguage;
|
|
22
22
|
companyId?: string;
|
|
23
23
|
biometrics?: string;
|
|
24
24
|
}
|
|
25
|
-
export interface
|
|
25
|
+
export interface IUserSafe extends Omit<IUser, "passwordHash" | "loginAttempts" | "biometrics"> {
|
|
26
26
|
}
|
|
27
27
|
export declare const ACCOUNT_TYPE: {
|
|
28
28
|
readonly TURNDOWN_ADMIN: "TURNDOWN_ADMIN";
|
|
@@ -32,29 +32,29 @@ export declare const ACCOUNT_TYPE: {
|
|
|
32
32
|
readonly CLEANER: "CLEANER";
|
|
33
33
|
readonly GUEST: "GUEST";
|
|
34
34
|
};
|
|
35
|
-
export type
|
|
35
|
+
export type TAccountType = TRecordValue<typeof ACCOUNT_TYPE>;
|
|
36
36
|
export declare const ACCOUNT_STATUS: {
|
|
37
37
|
readonly ACTIVE: "ACTIVE";
|
|
38
38
|
readonly INACTIVE: "INACTIVE";
|
|
39
39
|
readonly SUSPENDED: "SUSPENDED";
|
|
40
40
|
readonly PENDING: "PENDING";
|
|
41
41
|
};
|
|
42
|
-
export type
|
|
42
|
+
export type TAccountStatus = TRecordValue<typeof ACCOUNT_STATUS>;
|
|
43
43
|
export declare const LANGUAGE: {
|
|
44
44
|
readonly ENGLISH: "ENGLISH";
|
|
45
45
|
readonly FRENCH: "FRENCH";
|
|
46
46
|
readonly SPANISH: "SPANISH";
|
|
47
47
|
readonly GERMAN: "GERMAN";
|
|
48
48
|
};
|
|
49
|
-
export type
|
|
50
|
-
export interface
|
|
49
|
+
export type TLanguage = TRecordValue<typeof LANGUAGE>;
|
|
50
|
+
export interface IDeviceInfo {
|
|
51
51
|
userAgent?: string;
|
|
52
52
|
ip?: string;
|
|
53
53
|
deviceName?: string;
|
|
54
54
|
}
|
|
55
|
-
export interface
|
|
55
|
+
export interface IUserSession {
|
|
56
56
|
id: number;
|
|
57
|
-
deviceInfo?:
|
|
57
|
+
deviceInfo?: IDeviceInfo | null;
|
|
58
58
|
createdAt: string;
|
|
59
59
|
lastUsedAt: string;
|
|
60
60
|
}
|
|
@@ -1,22 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export interface
|
|
3
|
-
|
|
1
|
+
import type { TAccountType, TLanguage, IUserSafe } from ".";
|
|
2
|
+
export interface IUserIdParams {
|
|
3
|
+
id: string;
|
|
4
4
|
}
|
|
5
|
-
export interface
|
|
5
|
+
export interface IGetUserResponse {
|
|
6
|
+
user: IUserSafe | null;
|
|
6
7
|
}
|
|
7
|
-
export interface
|
|
8
|
+
export interface IGetCurrentUserRequest {
|
|
8
9
|
}
|
|
9
|
-
export interface
|
|
10
|
-
userId: string;
|
|
10
|
+
export interface IGetCurrentUserResponse extends IGetUserResponse {
|
|
11
11
|
}
|
|
12
|
-
export interface
|
|
12
|
+
export interface IGetUserByIdRequest extends IUserIdParams {
|
|
13
13
|
}
|
|
14
|
-
export interface
|
|
14
|
+
export interface IGetUserByIdResponse extends IGetUserResponse {
|
|
15
|
+
}
|
|
16
|
+
export interface IGetUserByEmailRequest {
|
|
15
17
|
email: string;
|
|
16
18
|
}
|
|
17
|
-
export interface
|
|
19
|
+
export interface IGetUserByEmailResponse extends IGetUserResponse {
|
|
20
|
+
}
|
|
21
|
+
export interface IGetCleanersRequest {
|
|
18
22
|
}
|
|
19
|
-
export interface
|
|
23
|
+
export interface IGetCleanersResponse {
|
|
24
|
+
cleaners: IUserSafe[];
|
|
25
|
+
}
|
|
26
|
+
export interface IUpdateUserRequest {
|
|
20
27
|
firstName?: string;
|
|
21
28
|
lastName?: string;
|
|
22
29
|
mi?: string;
|
|
@@ -24,13 +31,16 @@ export interface UpdateUserRequest {
|
|
|
24
31
|
email?: string;
|
|
25
32
|
phoneNumber?: string;
|
|
26
33
|
phoneFormat?: string;
|
|
27
|
-
preferredLanguage?:
|
|
34
|
+
preferredLanguage?: TLanguage;
|
|
28
35
|
}
|
|
29
|
-
export interface
|
|
30
|
-
user:
|
|
36
|
+
export interface IUpdateUserResponse {
|
|
37
|
+
user: IUserSafe;
|
|
31
38
|
}
|
|
32
|
-
export interface
|
|
39
|
+
export interface IDeleteUserRequest {
|
|
33
40
|
}
|
|
34
|
-
export interface
|
|
41
|
+
export interface IDeleteUserResponse {
|
|
35
42
|
message: string;
|
|
36
43
|
}
|
|
44
|
+
export interface IGetUsersByAccountTypeRequest {
|
|
45
|
+
accountType: TAccountType;
|
|
46
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TRecordValue } from "../base";
|
|
2
2
|
export * from "./routes";
|
|
3
3
|
/**
|
|
4
4
|
* Work session status enum
|
|
@@ -8,7 +8,7 @@ export declare const WORK_SESSION_STATUS: {
|
|
|
8
8
|
COMPLETED: string;
|
|
9
9
|
CANCELLED: string;
|
|
10
10
|
};
|
|
11
|
-
export type
|
|
11
|
+
export type TWorkSessionStatus = TRecordValue<typeof WORK_SESSION_STATUS>;
|
|
12
12
|
/**
|
|
13
13
|
* Checklist execution status enum
|
|
14
14
|
*/
|
|
@@ -18,16 +18,16 @@ export declare const CHECKLIST_EXECUTION_STATUS: {
|
|
|
18
18
|
COMPLETED: string;
|
|
19
19
|
SKIPPED: string;
|
|
20
20
|
};
|
|
21
|
-
export type
|
|
21
|
+
export type TChecklistExecutionStatus = TRecordValue<typeof CHECKLIST_EXECUTION_STATUS>;
|
|
22
22
|
/**
|
|
23
23
|
* Work session
|
|
24
24
|
*/
|
|
25
|
-
export interface
|
|
25
|
+
export interface IWorkSession {
|
|
26
26
|
id: string;
|
|
27
27
|
propertyId: string;
|
|
28
28
|
serviceProviderCompanyId: string;
|
|
29
29
|
performedBy: string;
|
|
30
|
-
status:
|
|
30
|
+
status: TWorkSessionStatus;
|
|
31
31
|
scheduledDate: Date | null;
|
|
32
32
|
startedAt: Date;
|
|
33
33
|
completedAt: Date | null;
|
|
@@ -39,13 +39,13 @@ export interface WorkSession {
|
|
|
39
39
|
/**
|
|
40
40
|
* Checklist execution
|
|
41
41
|
*/
|
|
42
|
-
export interface
|
|
42
|
+
export interface IChecklistExecution {
|
|
43
43
|
id: string;
|
|
44
44
|
workSessionId: string;
|
|
45
45
|
roomChecklistId: string;
|
|
46
46
|
roomId: string;
|
|
47
47
|
workerId: string;
|
|
48
|
-
status:
|
|
48
|
+
status: TChecklistExecutionStatus;
|
|
49
49
|
startedAt: Date | null;
|
|
50
50
|
completedAt: Date | null;
|
|
51
51
|
timeSpentMinutes: number | null;
|
|
@@ -56,7 +56,7 @@ export interface ChecklistExecution {
|
|
|
56
56
|
/**
|
|
57
57
|
* Checklist item completion
|
|
58
58
|
*/
|
|
59
|
-
export interface
|
|
59
|
+
export interface IChecklistItemCompletion {
|
|
60
60
|
id: string;
|
|
61
61
|
checklistExecutionId: string;
|
|
62
62
|
roomChecklistItemId: string;
|
|
@@ -71,13 +71,13 @@ export interface ChecklistItemCompletion {
|
|
|
71
71
|
/**
|
|
72
72
|
* Work session with executions
|
|
73
73
|
*/
|
|
74
|
-
export interface
|
|
75
|
-
executions:
|
|
74
|
+
export interface IWorkSessionWithExecutions extends IWorkSession {
|
|
75
|
+
executions: IChecklistExecution[];
|
|
76
76
|
}
|
|
77
77
|
/**
|
|
78
78
|
* Input for creating a work session
|
|
79
79
|
*/
|
|
80
|
-
export interface
|
|
80
|
+
export interface ICreateWorkSessionInput {
|
|
81
81
|
propertyId: string;
|
|
82
82
|
serviceProviderCompanyId: string;
|
|
83
83
|
performedBy: string;
|
|
@@ -87,7 +87,7 @@ export interface CreateWorkSessionInput {
|
|
|
87
87
|
/**
|
|
88
88
|
* Input for completing a checklist item
|
|
89
89
|
*/
|
|
90
|
-
export interface
|
|
90
|
+
export interface ICompleteChecklistItemInput {
|
|
91
91
|
roomChecklistItemId: string;
|
|
92
92
|
completedBy: string;
|
|
93
93
|
photoId?: string;
|
|
@@ -1,68 +1,89 @@
|
|
|
1
|
-
|
|
1
|
+
import type { IChecklistExecution, IChecklistItemCompletion, ICompleteChecklistItemInput, ICreateWorkSessionInput, IWorkSession, IWorkSessionWithExecutions } from ".";
|
|
2
|
+
export interface IWorkSessionRouteParams {
|
|
3
|
+
sessionId: string;
|
|
2
4
|
}
|
|
3
|
-
export interface
|
|
5
|
+
export interface IWorkSessionPropertyRouteParams {
|
|
6
|
+
propertyId: string;
|
|
4
7
|
}
|
|
5
|
-
export interface
|
|
8
|
+
export interface IWorkSessionUserRouteParams {
|
|
9
|
+
userId: string;
|
|
6
10
|
}
|
|
7
|
-
export interface
|
|
11
|
+
export interface IWorkSessionExecutionRouteParams {
|
|
12
|
+
executionId: string;
|
|
8
13
|
}
|
|
9
|
-
export interface
|
|
14
|
+
export interface ILimitQuery {
|
|
15
|
+
limit?: string;
|
|
10
16
|
}
|
|
11
|
-
export interface
|
|
17
|
+
export interface ICreateWorkSessionRequest extends Omit<ICreateWorkSessionInput, "propertyId"> {
|
|
18
|
+
serviceProviderCompanyId: string;
|
|
19
|
+
performedBy: string;
|
|
12
20
|
}
|
|
13
|
-
export interface
|
|
21
|
+
export interface ICreateWorkSessionResponse extends IWorkSession {
|
|
14
22
|
}
|
|
15
|
-
export interface
|
|
23
|
+
export interface IGetWorkSessionByIdRequest extends IWorkSessionRouteParams {
|
|
16
24
|
}
|
|
17
|
-
export interface
|
|
25
|
+
export interface IGetWorkSessionByIdResponse extends IWorkSession {
|
|
18
26
|
}
|
|
19
|
-
export interface
|
|
27
|
+
export interface IGetWorkSessionWithExecutionsRequest extends IWorkSessionRouteParams {
|
|
20
28
|
}
|
|
21
|
-
export interface
|
|
29
|
+
export interface IGetWorkSessionWithExecutionsResponse extends IWorkSessionWithExecutions {
|
|
22
30
|
}
|
|
23
|
-
export interface
|
|
31
|
+
export interface IUpdateWorkSessionRequest extends Partial<IWorkSession> {
|
|
24
32
|
}
|
|
25
|
-
export interface
|
|
33
|
+
export interface IUpdateWorkSessionResponse extends IWorkSession {
|
|
26
34
|
}
|
|
27
|
-
export interface
|
|
35
|
+
export interface ICompleteWorkSessionRequest extends IWorkSessionRouteParams {
|
|
28
36
|
}
|
|
29
|
-
export interface
|
|
37
|
+
export interface ICompleteWorkSessionResponse extends IWorkSession {
|
|
30
38
|
}
|
|
31
|
-
export interface
|
|
39
|
+
export interface ICancelWorkSessionRequest extends IWorkSessionRouteParams {
|
|
32
40
|
}
|
|
33
|
-
export interface
|
|
41
|
+
export interface ICancelWorkSessionResponse extends IWorkSession {
|
|
34
42
|
}
|
|
35
|
-
export interface
|
|
43
|
+
export interface IGetWorkSessionsByPropertyIdRequest extends IWorkSessionPropertyRouteParams {
|
|
36
44
|
}
|
|
37
|
-
export
|
|
45
|
+
export type IGetWorkSessionsByPropertyIdResponse = IWorkSession[];
|
|
46
|
+
export interface IGetActiveWorkSessionRequest extends IWorkSessionPropertyRouteParams {
|
|
38
47
|
}
|
|
39
|
-
export interface
|
|
48
|
+
export interface IGetActiveWorkSessionResponse extends IWorkSession {
|
|
40
49
|
}
|
|
41
|
-
export interface
|
|
50
|
+
export interface IGetWorkSessionsByUserIdRequest extends IWorkSessionUserRouteParams {
|
|
42
51
|
}
|
|
43
|
-
export
|
|
52
|
+
export type IGetWorkSessionsByUserIdResponse = IWorkSession[];
|
|
53
|
+
export interface IGetChecklistExecutionsRequest extends IWorkSessionRouteParams {
|
|
44
54
|
}
|
|
45
|
-
export
|
|
55
|
+
export type IGetChecklistExecutionsResponse = IChecklistExecution[];
|
|
56
|
+
export interface IGetChecklistExecutionByIdRequest extends IWorkSessionExecutionRouteParams {
|
|
46
57
|
}
|
|
47
|
-
export interface
|
|
58
|
+
export interface IGetChecklistExecutionByIdResponse extends IChecklistExecution {
|
|
48
59
|
}
|
|
49
|
-
export interface
|
|
60
|
+
export interface IStartChecklistExecutionRequest extends IWorkSessionExecutionRouteParams {
|
|
50
61
|
}
|
|
51
|
-
export interface
|
|
62
|
+
export interface IStartChecklistExecutionResponse extends IChecklistExecution {
|
|
52
63
|
}
|
|
53
|
-
export interface
|
|
64
|
+
export interface ICompleteChecklistExecutionRequest {
|
|
65
|
+
notes?: string;
|
|
54
66
|
}
|
|
55
|
-
export interface
|
|
67
|
+
export interface ICompleteChecklistExecutionResponse extends IChecklistExecution {
|
|
56
68
|
}
|
|
57
|
-
export interface
|
|
69
|
+
export interface ISkipChecklistExecutionRequest {
|
|
70
|
+
notes?: string;
|
|
58
71
|
}
|
|
59
|
-
export interface
|
|
72
|
+
export interface ISkipChecklistExecutionResponse extends IChecklistExecution {
|
|
60
73
|
}
|
|
61
|
-
export interface
|
|
74
|
+
export interface IGetExecutionProgressRequest extends IWorkSessionExecutionRouteParams {
|
|
62
75
|
}
|
|
63
|
-
export interface
|
|
76
|
+
export interface IGetExecutionProgressResponse {
|
|
77
|
+
totalItems: number;
|
|
78
|
+
completedItems: number;
|
|
79
|
+
skippedItems: number;
|
|
80
|
+
progressPercentage: number;
|
|
64
81
|
}
|
|
65
|
-
export interface
|
|
82
|
+
export interface IGetExecutionItemsRequest extends IWorkSessionExecutionRouteParams {
|
|
66
83
|
}
|
|
67
|
-
export
|
|
84
|
+
export type IGetExecutionItemsResponse = IChecklistItemCompletion[];
|
|
85
|
+
export interface ICompleteExecutionItemRequest extends ICompleteChecklistItemInput {
|
|
86
|
+
roomChecklistItemId: string;
|
|
87
|
+
}
|
|
88
|
+
export interface ICompleteExecutionItemResponse extends IChecklistItemCompletion {
|
|
68
89
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@turndown/library",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.22",
|
|
4
4
|
"description": "Shared TypeScript library for the Turndown suite.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"types",
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"exports": {
|
|
20
20
|
".": {
|
|
21
21
|
"types": "./dist/index.d.ts",
|
|
22
|
-
"import": "./dist/index.
|
|
23
|
-
"default": "./dist/index.
|
|
22
|
+
"import": "./dist/index.js",
|
|
23
|
+
"default": "./dist/index.js"
|
|
24
24
|
},
|
|
25
25
|
"./package.json": "./package.json"
|
|
26
26
|
},
|
|
@@ -33,11 +33,20 @@
|
|
|
33
33
|
"scripts": {
|
|
34
34
|
"clean": "rimraf dist",
|
|
35
35
|
"build": "npm run clean && tsc -p .",
|
|
36
|
-
"dev": "tsc -w -p ."
|
|
36
|
+
"dev": "tsc -w -p .",
|
|
37
|
+
"test": "jest",
|
|
38
|
+
"test:watch": "jest --watch",
|
|
39
|
+
"test:coverage": "jest --coverage"
|
|
37
40
|
},
|
|
38
41
|
"devDependencies": {
|
|
39
|
-
"@types/
|
|
42
|
+
"@types/jest": "^30.0.0",
|
|
43
|
+
"@types/node": "^24.12.4",
|
|
44
|
+
"jest": "^30.4.2",
|
|
40
45
|
"rimraf": "^6.0.1",
|
|
46
|
+
"ts-jest": "^29.4.9",
|
|
41
47
|
"typescript": "^5.9.3"
|
|
48
|
+
},
|
|
49
|
+
"dependencies": {
|
|
50
|
+
"dayjs": "^1.11.20"
|
|
42
51
|
}
|
|
43
52
|
}
|