@turndown/library 0.1.16 → 0.1.20

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.
Files changed (44) hide show
  1. package/dist/helpers/date/index.d.ts +113 -0
  2. package/dist/helpers/date/index.js +171 -0
  3. package/dist/helpers/index.d.ts +3 -1
  4. package/dist/helpers/index.js +2 -1
  5. package/dist/helpers/object/index.d.ts +160 -75
  6. package/dist/helpers/object/index.js +355 -168
  7. package/dist/helpers/string/index.d.ts +227 -74
  8. package/dist/helpers/string/index.js +448 -114
  9. package/dist/types/api/index.d.ts +22 -11
  10. package/dist/types/api/index.js +9 -2
  11. package/dist/types/auth/index.d.ts +56 -18
  12. package/dist/types/auth/index.js +7 -0
  13. package/dist/types/auth/routes.d.ts +52 -43
  14. package/dist/types/auth/routes.js +0 -1
  15. package/dist/types/base/index.d.ts +188 -69
  16. package/dist/types/base/index.js +116 -0
  17. package/dist/types/base/paging.types.d.ts +11 -11
  18. package/dist/types/checklist-template/index.d.ts +8 -8
  19. package/dist/types/checklist-template/routes.d.ts +28 -28
  20. package/dist/types/company/index.d.ts +5 -5
  21. package/dist/types/company/routes.d.ts +23 -23
  22. package/dist/types/damage-report/index.d.ts +9 -9
  23. package/dist/types/damage-report/routes.d.ts +38 -38
  24. package/dist/types/errors/index.d.ts +15 -16
  25. package/dist/types/errors/index.js +17 -7
  26. package/dist/types/index.d.ts +1 -0
  27. package/dist/types/index.js +1 -0
  28. package/dist/types/inventory/index.d.ts +19 -19
  29. package/dist/types/inventory/routes.d.ts +36 -36
  30. package/dist/types/job/index.d.ts +7 -0
  31. package/dist/types/job/index.js +1 -0
  32. package/dist/types/property/index.d.ts +88 -29
  33. package/dist/types/property/index.js +23 -23
  34. package/dist/types/property/routes.d.ts +41 -14
  35. package/dist/types/property/routes.js +0 -1
  36. package/dist/types/room/index.d.ts +4 -4
  37. package/dist/types/room/routes.d.ts +8 -8
  38. package/dist/types/room-checklist/index.d.ts +9 -9
  39. package/dist/types/room-checklist/routes.d.ts +28 -28
  40. package/dist/types/user/index.d.ts +12 -12
  41. package/dist/types/user/routes.d.ts +15 -15
  42. package/dist/types/work-session/index.d.ts +12 -12
  43. package/dist/types/work-session/routes.d.ts +34 -34
  44. package/package.json +13 -4
@@ -1,15 +1,15 @@
1
- import { MetaData } from "../index";
2
- import { ChecklistTemplateItem } from "../checklist-template";
1
+ import { IMetaData } from "../index";
2
+ import { IChecklistTemplateItem } from "../checklist-template";
3
3
  export * from "./routes";
4
- export interface RoomChecklist extends MetaData {
4
+ export interface IRoomChecklist extends IMetaData {
5
5
  id: string;
6
6
  roomId: string;
7
7
  templateId?: string;
8
8
  name: string;
9
9
  isActive: boolean;
10
- items: RoomChecklistItem[];
10
+ items: IRoomChecklistItem[];
11
11
  }
12
- export interface RoomChecklistItem extends ChecklistTemplateItem {
12
+ export interface IRoomChecklistItem extends IChecklistTemplateItem {
13
13
  roomChecklistId: string;
14
14
  templateItemId?: string;
15
15
  isCustom: boolean;
@@ -17,13 +17,13 @@ export interface RoomChecklistItem extends ChecklistTemplateItem {
17
17
  /**
18
18
  * Room checklist with items
19
19
  */
20
- export interface RoomChecklistWithItems extends RoomChecklist {
21
- items: RoomChecklistItem[];
20
+ export interface IRoomChecklistWithItems extends IRoomChecklist {
21
+ items: IRoomChecklistItem[];
22
22
  }
23
23
  /**
24
24
  * Input for creating a room checklist
25
25
  */
26
- export interface CreateRoomChecklistInput {
26
+ export interface ICreateRoomChecklistInput {
27
27
  roomId: string;
28
28
  templateId?: string;
29
29
  name: string;
@@ -32,7 +32,7 @@ export interface CreateRoomChecklistInput {
32
32
  /**
33
33
  * Input for creating room checklist items
34
34
  */
35
- export interface CreateRoomChecklistItemInput {
35
+ export interface ICreateRoomChecklistItemInput {
36
36
  title: string;
37
37
  description?: string;
38
38
  displayOrder: number;
@@ -1,56 +1,56 @@
1
- export interface CreateChecklistRequest {
1
+ export interface ICreateChecklistRequest {
2
2
  }
3
- export interface CreateChecklistResponse {
3
+ export interface ICreateChecklistResponse {
4
4
  }
5
- export interface CreateCustomChecklistRequest {
5
+ export interface ICreateCustomChecklistRequest {
6
6
  }
7
- export interface CreateCustomChecklistResponse {
7
+ export interface ICreateCustomChecklistResponse {
8
8
  }
9
- export interface GetChecklistByRoomIdRequest {
9
+ export interface IGetChecklistByRoomIdRequest {
10
10
  }
11
- export interface GetChecklistByRoomIdResponse {
11
+ export interface IGetChecklistByRoomIdResponse {
12
12
  }
13
- export interface GetChecklistByIdRequest {
13
+ export interface IGetChecklistByIdRequest {
14
14
  }
15
- export interface GetChecklistByIdResponse {
15
+ export interface IGetChecklistByIdResponse {
16
16
  }
17
- export interface GetChecklistWithItemsRequest {
17
+ export interface IGetChecklistWithItemsRequest {
18
18
  }
19
- export interface GetChecklistWithItemsResponse {
19
+ export interface IGetChecklistWithItemsResponse {
20
20
  }
21
- export interface UpdateChecklistRequest {
21
+ export interface IUpdateChecklistRequest {
22
22
  }
23
- export interface UpdateChecklistResponse {
23
+ export interface IUpdateChecklistResponse {
24
24
  }
25
- export interface DeleteChecklistRequest {
25
+ export interface IDeleteChecklistRequest {
26
26
  }
27
- export interface DeleteChecklistResponse {
27
+ export interface IDeleteChecklistResponse {
28
28
  }
29
- export interface CloneChecklistRequest {
29
+ export interface ICloneChecklistRequest {
30
30
  }
31
- export interface CloneChecklistResponse {
31
+ export interface ICloneChecklistResponse {
32
32
  }
33
- export interface GetChecklistItemsRequest {
33
+ export interface IGetChecklistItemsRequest {
34
34
  }
35
- export interface GetChecklistItemsResponse {
35
+ export interface IGetChecklistItemsResponse {
36
36
  }
37
- export interface GetCustomChecklistItemsRequest {
37
+ export interface IGetCustomChecklistItemsRequest {
38
38
  }
39
- export interface GetCustomChecklistItemsResponse {
39
+ export interface IGetCustomChecklistItemsResponse {
40
40
  }
41
- export interface AddChecklistItemRequest {
41
+ export interface IAddChecklistItemRequest {
42
42
  }
43
- export interface AddChecklistItemResponse {
43
+ export interface IAddChecklistItemResponse {
44
44
  }
45
- export interface UpdateChecklistItemRequest {
45
+ export interface IUpdateChecklistItemRequest {
46
46
  }
47
- export interface UpdateChecklistItemResponse {
47
+ export interface IUpdateChecklistItemResponse {
48
48
  }
49
- export interface DeleteChecklistItemRequest {
49
+ export interface IDeleteChecklistItemRequest {
50
50
  }
51
- export interface DeleteChecklistItemResponse {
51
+ export interface IDeleteChecklistItemResponse {
52
52
  }
53
- export interface ReorderChecklistItemsRequest {
53
+ export interface IReorderChecklistItemsRequest {
54
54
  }
55
- export interface ReorderChecklistItemsResponse {
55
+ export interface IReorderChecklistItemsResponse {
56
56
  }
@@ -1,6 +1,6 @@
1
- import { MetaData, ObjectValues } from "../index";
1
+ import { IMetaData, TRecordValue } from "../index";
2
2
  export * from "./routes";
3
- export interface User extends MetaData {
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: AccountType;
18
- status: AccountStatus;
17
+ accountType: TAccountType;
18
+ status: TAccountStatus;
19
19
  phoneNumber?: string;
20
20
  phoneFormat?: string;
21
- preferredLanguage?: Language;
21
+ preferredLanguage?: TLanguage;
22
22
  companyId?: string;
23
23
  biometrics?: string;
24
24
  }
25
- export interface UserSafe extends Omit<User, "passwordHash" | "loginAttempts" | "biometrics"> {
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 AccountType = ObjectValues<typeof ACCOUNT_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 AccountStatus = ObjectValues<typeof ACCOUNT_STATUS>;
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 Language = ObjectValues<typeof LANGUAGE>;
50
- export interface DeviceInfo {
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 UserSession {
55
+ export interface IUserSession {
56
56
  id: number;
57
- deviceInfo?: DeviceInfo | null;
57
+ deviceInfo?: IDeviceInfo | null;
58
58
  createdAt: string;
59
59
  lastUsedAt: string;
60
60
  }
@@ -1,22 +1,22 @@
1
- import { Language, UserSafe } from "..";
2
- export interface GetUserResponse {
3
- user: UserSafe | null;
1
+ import { TLanguage, IUserSafe } from "..";
2
+ export interface IGetUserResponse {
3
+ user: IUserSafe | null;
4
4
  }
5
- export interface GetCurrentUserRequest {
5
+ export interface IGetCurrentUserRequest {
6
6
  }
7
- export interface GetCurrentUserResponse extends GetUserResponse {
7
+ export interface IGetCurrentUserResponse extends IGetUserResponse {
8
8
  }
9
- export interface GetUserByIdRequest {
9
+ export interface IGetUserByIdRequest {
10
10
  userId: string;
11
11
  }
12
- export interface GetUserByIdResponse extends GetUserResponse {
12
+ export interface IGetUserByIdResponse extends IGetUserResponse {
13
13
  }
14
- export interface GetUserByEmailRequest {
14
+ export interface IGetUserByEmailRequest {
15
15
  email: string;
16
16
  }
17
- export interface GetUserByEmailResponse extends GetUserResponse {
17
+ export interface IGetUserByEmailResponse extends IGetUserResponse {
18
18
  }
19
- export interface UpdateUserRequest {
19
+ export interface IUpdateUserRequest {
20
20
  firstName?: string;
21
21
  lastName?: string;
22
22
  mi?: string;
@@ -24,13 +24,13 @@ export interface UpdateUserRequest {
24
24
  email?: string;
25
25
  phoneNumber?: string;
26
26
  phoneFormat?: string;
27
- preferredLanguage?: Language;
27
+ preferredLanguage?: TLanguage;
28
28
  }
29
- export interface UpdateUserResponse {
30
- user: UserSafe;
29
+ export interface IUpdateUserResponse {
30
+ user: IUserSafe;
31
31
  }
32
- export interface DeleteUserRequest {
32
+ export interface IDeleteUserRequest {
33
33
  }
34
- export interface DeleteUserResponse {
34
+ export interface IDeleteUserResponse {
35
35
  message: string;
36
36
  }
@@ -1,4 +1,4 @@
1
- import { ObjectValues } from "../base";
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 WorkSessionStatus = ObjectValues<typeof WORK_SESSION_STATUS>;
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 ChecklistExecutionStatus = ObjectValues<typeof CHECKLIST_EXECUTION_STATUS>;
21
+ export type TChecklistExecutionStatus = TRecordValue<typeof CHECKLIST_EXECUTION_STATUS>;
22
22
  /**
23
23
  * Work session
24
24
  */
25
- export interface WorkSession {
25
+ export interface IWorkSession {
26
26
  id: string;
27
27
  propertyId: string;
28
28
  serviceProviderCompanyId: string;
29
29
  performedBy: string;
30
- status: WorkSessionStatus;
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 ChecklistExecution {
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: ChecklistExecutionStatus;
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 ChecklistItemCompletion {
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 WorkSessionWithExecutions extends WorkSession {
75
- executions: ChecklistExecution[];
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 CreateWorkSessionInput {
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 CompleteChecklistItemInput {
90
+ export interface ICompleteChecklistItemInput {
91
91
  roomChecklistItemId: string;
92
92
  completedBy: string;
93
93
  photoId?: string;
@@ -1,68 +1,68 @@
1
- export interface CreateWorkSessionRequest {
1
+ export interface ICreateWorkSessionRequest {
2
2
  }
3
- export interface CreateWorkSessionResponse {
3
+ export interface ICreateWorkSessionResponse {
4
4
  }
5
- export interface GetWorkSessionByIdRequest {
5
+ export interface IGetWorkSessionByIdRequest {
6
6
  }
7
- export interface GetWorkSessionByIdResponse {
7
+ export interface IGetWorkSessionByIdResponse {
8
8
  }
9
- export interface GetWorkSessionWithExecutionsRequest {
9
+ export interface IGetWorkSessionWithExecutionsRequest {
10
10
  }
11
- export interface GetWorkSessionWithExecutionsResponse {
11
+ export interface IGetWorkSessionWithExecutionsResponse {
12
12
  }
13
- export interface UpdateWorkSessionRequest {
13
+ export interface IUpdateWorkSessionRequest {
14
14
  }
15
- export interface UpdateWorkSessionResponse {
15
+ export interface IUpdateWorkSessionResponse {
16
16
  }
17
- export interface CompleteWorkSessionRequest {
17
+ export interface ICompleteWorkSessionRequest {
18
18
  }
19
- export interface CompleteWorkSessionResponse {
19
+ export interface ICompleteWorkSessionResponse {
20
20
  }
21
- export interface CancelWorkSessionRequest {
21
+ export interface ICancelWorkSessionRequest {
22
22
  }
23
- export interface CancelWorkSessionResponse {
23
+ export interface ICancelWorkSessionResponse {
24
24
  }
25
- export interface GetWorkSessionsByPropertyIdRequest {
25
+ export interface IGetWorkSessionsByPropertyIdRequest {
26
26
  }
27
- export interface GetWorkSessionsByPropertyIdResponse {
27
+ export interface IGetWorkSessionsByPropertyIdResponse {
28
28
  }
29
- export interface GetActiveWorkSessionRequest {
29
+ export interface IGetActiveWorkSessionRequest {
30
30
  }
31
- export interface GetActiveWorkSessionResponse {
31
+ export interface IGetActiveWorkSessionResponse {
32
32
  }
33
- export interface GetWorkSessionsByUserIdRequest {
33
+ export interface IGetWorkSessionsByUserIdRequest {
34
34
  }
35
- export interface GetWorkSessionsByUserIdResponse {
35
+ export interface IGetWorkSessionsByUserIdResponse {
36
36
  }
37
- export interface GetChecklistExecutionsRequest {
37
+ export interface IGetChecklistExecutionsRequest {
38
38
  }
39
- export interface GetChecklistExecutionsResponse {
39
+ export interface IGetChecklistExecutionsResponse {
40
40
  }
41
- export interface GetChecklistExecutionByIdRequest {
41
+ export interface IGetChecklistExecutionByIdRequest {
42
42
  }
43
- export interface GetChecklistExecutionByIdResponse {
43
+ export interface IGetChecklistExecutionByIdResponse {
44
44
  }
45
- export interface StartChecklistExecutionRequest {
45
+ export interface IStartChecklistExecutionRequest {
46
46
  }
47
- export interface StartChecklistExecutionResponse {
47
+ export interface IStartChecklistExecutionResponse {
48
48
  }
49
- export interface CompleteChecklistExecutionRequest {
49
+ export interface ICompleteChecklistExecutionRequest {
50
50
  }
51
- export interface CompleteChecklistExecutionResponse {
51
+ export interface ICompleteChecklistExecutionResponse {
52
52
  }
53
- export interface SkipChecklistExecutionRequest {
53
+ export interface ISkipChecklistExecutionRequest {
54
54
  }
55
- export interface SkipChecklistExecutionResponse {
55
+ export interface ISkipChecklistExecutionResponse {
56
56
  }
57
- export interface GetExecutionProgressRequest {
57
+ export interface IGetExecutionProgressRequest {
58
58
  }
59
- export interface GetExecutionProgressResponse {
59
+ export interface IGetExecutionProgressResponse {
60
60
  }
61
- export interface GetExecutionItemsRequest {
61
+ export interface IGetExecutionItemsRequest {
62
62
  }
63
- export interface GetExecutionItemsResponse {
63
+ export interface IGetExecutionItemsResponse {
64
64
  }
65
- export interface CompleteExecutionItemRequest {
65
+ export interface ICompleteExecutionItemRequest {
66
66
  }
67
- export interface CompleteExecutionItemResponse {
67
+ export interface ICompleteExecutionItemResponse {
68
68
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@turndown/library",
3
- "version": "0.1.16",
3
+ "version": "0.1.20",
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.ts",
23
- "default": "./dist/index.ts"
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": {
42
+ "@types/jest": "^30.0.0",
39
43
  "@types/node": "^24.6.1",
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
  }