@turndown/library 0.1.20 → 0.1.23

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 (41) hide show
  1. package/dist/helpers/object/index.js +9 -6
  2. package/dist/helpers/string/index.d.ts +5 -4
  3. package/dist/helpers/string/index.js +7 -6
  4. package/dist/types/auth/routes.d.ts +27 -7
  5. package/dist/types/base/index.d.ts +72 -69
  6. package/dist/types/base/index.js +60 -67
  7. package/dist/types/checklist-template/routes.d.ts +55 -26
  8. package/dist/types/checklist-template/routes.js +0 -1
  9. package/dist/types/company/index.d.ts +5 -5
  10. package/dist/types/company/routes.d.ts +81 -33
  11. package/dist/types/company/routes.js +0 -1
  12. package/dist/types/damage-report/index.d.ts +18 -2
  13. package/dist/types/damage-report/index.js +15 -0
  14. package/dist/types/damage-report/routes.d.ts +122 -45
  15. package/dist/types/damage-report/routes.js +0 -1
  16. package/dist/types/health/index.d.ts +20 -0
  17. package/dist/types/health/index.js +1 -0
  18. package/dist/types/health/routes.d.ts +10 -0
  19. package/dist/types/health/routes.js +1 -0
  20. package/dist/types/image/index.d.ts +34 -0
  21. package/dist/types/image/index.js +11 -0
  22. package/dist/types/image/routes.d.ts +32 -0
  23. package/dist/types/image/routes.js +1 -0
  24. package/dist/types/index.d.ts +2 -0
  25. package/dist/types/index.js +2 -0
  26. package/dist/types/inventory/index.d.ts +0 -74
  27. package/dist/types/inventory/routes.d.ts +72 -35
  28. package/dist/types/inventory/routes.js +0 -1
  29. package/dist/types/property/index.d.ts +10 -9
  30. package/dist/types/property/routes.d.ts +27 -28
  31. package/dist/types/room/routes.d.ts +26 -7
  32. package/dist/types/room/routes.js +0 -1
  33. package/dist/types/room-checklist/routes.d.ts +48 -26
  34. package/dist/types/room-checklist/routes.js +0 -1
  35. package/dist/types/user/index.d.ts +2 -3
  36. package/dist/types/user/index.js +2 -3
  37. package/dist/types/user/routes.d.ts +13 -3
  38. package/dist/types/user/routes.js +0 -1
  39. package/dist/types/work-session/routes.d.ts +53 -32
  40. package/dist/types/work-session/routes.js +0 -1
  41. package/package.json +3 -2
@@ -1,6 +1,9 @@
1
1
  const unsafePathSegments = new Set(["__proto__", "prototype", "constructor"]);
2
2
  const isRecord = (value) => {
3
- return typeof value === "object" && value !== null && !Array.isArray(value) && !(value instanceof Date);
3
+ return (typeof value === "object" &&
4
+ value !== null &&
5
+ !Array.isArray(value) &&
6
+ !(value instanceof Date));
4
7
  };
5
8
  const isSafePathSegment = (segment) => {
6
9
  return segment.length > 0 && !unsafePathSegments.has(segment);
@@ -272,9 +275,7 @@ export const resetPagination = (sort, filters) => {
272
275
  export const formatPhoneNumber = (value) => {
273
276
  const originalValue = value.toString();
274
277
  const digits = originalValue.replace(/\D/g, "");
275
- const normalizedDigits = digits.length === 11 && digits.startsWith("1")
276
- ? digits.slice(1)
277
- : digits;
278
+ const normalizedDigits = digits.length === 11 && digits.startsWith("1") ? digits.slice(1) : digits;
278
279
  if (normalizedDigits.length !== 10)
279
280
  return originalValue;
280
281
  const area = normalizedDigits.slice(0, 3);
@@ -422,7 +423,8 @@ export const getNestedValue = (value, path) => {
422
423
  if (currentValue === null || currentValue === undefined) {
423
424
  return undefined;
424
425
  }
425
- if (typeof currentValue !== "object" && typeof currentValue !== "function") {
426
+ if (typeof currentValue !== "object" &&
427
+ typeof currentValue !== "function") {
426
428
  return undefined;
427
429
  }
428
430
  currentValue = currentValue[pathSegment];
@@ -445,7 +447,8 @@ export const getNestedValue = (value, path) => {
445
447
  */
446
448
  export const setNestedValue = (objectToUpdate, path, value) => {
447
449
  const pathSegments = getPathSegments(path);
448
- if (pathSegments.length === 0 || pathSegments.some((pathSegment) => !isSafePathSegment(pathSegment))) {
450
+ if (pathSegments.length === 0 ||
451
+ pathSegments.some((pathSegment) => !isSafePathSegment(pathSegment))) {
449
452
  return objectToUpdate;
450
453
  }
451
454
  let currentValue = objectToUpdate;
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * String utilities for common text manipulation tasks.
3
3
  */
4
+ import { TUSStateCode } from "@/types";
4
5
  /**
5
6
  * Adds commas to a number for thousands separators.
6
7
  *
@@ -248,10 +249,10 @@ export declare const containsAny: (str: string, ...substrings: string[]) => bool
248
249
  */
249
250
  export declare const containsAll: (str: string, ...substrings: string[]) => boolean;
250
251
  export interface IAddress {
251
- addressLine1?: string;
252
+ addressLine1: string;
252
253
  addressLine2?: string;
253
- city?: string;
254
- stateCode?: string;
255
- postalCode?: string;
254
+ city: string;
255
+ stateCode: TUSStateCode;
256
+ postalCode: string;
256
257
  }
257
258
  export declare const formatAddress: (address: IAddress) => string;
@@ -65,10 +65,7 @@ export const toCamelCase = (str) => {
65
65
  return "";
66
66
  }
67
67
  const [firstWord, ...remainingWords] = words;
68
- return [
69
- firstWord.toLowerCase(),
70
- ...remainingWords.map(capitalizeWord),
71
- ].join("");
68
+ return [firstWord.toLowerCase(), ...remainingWords.map(capitalizeWord)].join("");
72
69
  };
73
70
  export const camelCase = toCamelCase;
74
71
  /**
@@ -78,7 +75,9 @@ export const camelCase = toCamelCase;
78
75
  * @example toKebabCase('Hello_World') => 'hello-world'
79
76
  */
80
77
  export const toKebabCase = (str) => {
81
- return getWords(str).map((word) => word.toLowerCase()).join("-");
78
+ return getWords(str)
79
+ .map((word) => word.toLowerCase())
80
+ .join("-");
82
81
  };
83
82
  export const kebabCase = toKebabCase;
84
83
  /**
@@ -88,7 +87,9 @@ export const kebabCase = toKebabCase;
88
87
  * @example toSnakeCase('hello-world') => 'hello_world'
89
88
  */
90
89
  export const toSnakeCase = (str) => {
91
- return getWords(str).map((word) => word.toLowerCase()).join("_");
90
+ return getWords(str)
91
+ .map((word) => word.toLowerCase())
92
+ .join("_");
92
93
  };
93
94
  export const snakeCase = toSnakeCase;
94
95
  /**
@@ -1,6 +1,15 @@
1
1
  import type { IAuthTokenResponse } from "..";
2
2
  import type { TAccountType, IDeviceInfo, IUserSafe } from "../user";
3
3
  import type { IGetUserResponse } from "../user/routes";
4
+ export interface IAuthSessionIdParams {
5
+ sessionId: string;
6
+ }
7
+ export interface IAuthInvitationTokenParams {
8
+ token: string;
9
+ }
10
+ export interface IAuthInvitationIdParams {
11
+ invitationId: string;
12
+ }
4
13
  export interface IRegisterRequest {
5
14
  email: string;
6
15
  password: string;
@@ -31,7 +40,7 @@ export interface IRefreshSessionResponse {
31
40
  companyId?: string;
32
41
  }
33
42
  export interface ILogoutRequest {
34
- refreshToken: string;
43
+ refreshToken?: string;
35
44
  }
36
45
  export interface ILogoutResponse {
37
46
  message: string;
@@ -55,7 +64,7 @@ export interface IGetSessionsResponse {
55
64
  createdAt: string;
56
65
  lastUsedAt: string;
57
66
  }
58
- export interface IRevokeSessionRequest {
67
+ export interface IRevokeSessionRequest extends IAuthSessionIdParams {
59
68
  }
60
69
  export interface IRevokeSessionResponse {
61
70
  message: string;
@@ -83,7 +92,11 @@ export interface IGetLoginHistoryResponse {
83
92
  failureReason?: string;
84
93
  createdAt: Date;
85
94
  }
86
- export interface IValidateInvitationRequest {
95
+ export interface IGetLoginHistoryListResponse {
96
+ history: IGetLoginHistoryResponse[];
97
+ length: number;
98
+ }
99
+ export interface IValidateInvitationRequest extends IAuthInvitationTokenParams {
87
100
  }
88
101
  export interface IValidateInvitationResponse {
89
102
  id: string;
@@ -106,7 +119,7 @@ export interface IRegisterWithInvitationRequest {
106
119
  export interface IRegisterWithInvitationResponse extends IAuthTokenResponse {
107
120
  }
108
121
  export interface IAcceptInvitationRequest {
109
- userId: string;
122
+ userId?: string;
110
123
  token: string;
111
124
  }
112
125
  export interface IAcceptInvitationResponse {
@@ -114,6 +127,10 @@ export interface IAcceptInvitationResponse {
114
127
  companyName: string;
115
128
  role: TAccountType;
116
129
  }
130
+ export interface IAcceptInvitationRouteResponse {
131
+ invite: IAcceptInvitationResponse;
132
+ message: string;
133
+ }
117
134
  export interface IGetPendingInvitationsRequest {
118
135
  }
119
136
  export interface IGetPendingInvitationsResponse {
@@ -127,9 +144,12 @@ export interface IGetPendingInvitationsResponse {
127
144
  expiresAt: string;
128
145
  createdAt: string;
129
146
  }
130
- export interface IRevokeInvitationRequest {
131
- invitationId: string;
132
- revokedBy: string;
147
+ export interface IGetPendingInvitationsListResponse {
148
+ invitations: IGetPendingInvitationsResponse[];
149
+ length: number;
150
+ }
151
+ export interface IRevokeInvitationRequest extends IAuthInvitationIdParams {
152
+ revokedBy?: string;
133
153
  }
134
154
  export interface IRevokeInvitationResponse {
135
155
  message: string;
@@ -6,6 +6,18 @@ export type TUnknownRecord = Record<string, unknown>;
6
6
  export type TurndownObject<TObject extends object = TUnknownRecord> = {
7
7
  [TKey in keyof TObject]: TObject[TKey];
8
8
  };
9
+ export type TEmptyObject = Record<string, never>;
10
+ export interface IMessageResponse {
11
+ message: string;
12
+ }
13
+ export interface ISuccessResponse {
14
+ success: boolean;
15
+ }
16
+ export interface ICountResponse {
17
+ count: number;
18
+ }
19
+ export interface IEmptyRouteParams {
20
+ }
9
21
  export interface IMetaData {
10
22
  createdAt: Date;
11
23
  updatedAt: Date;
@@ -90,76 +102,67 @@ export declare const US_STATES_CODE: {
90
102
  readonly AS: "AS";
91
103
  readonly MP: "MP";
92
104
  };
93
- export type TUnitedStatesStateCode = TRecordValue<typeof US_STATES_CODE>;
94
- export declare const UNITED_STATES_JURISDICTIONS: {
95
- readonly Alabama: "Alabama";
96
- readonly Alaska: "Alaska";
97
- readonly AmericanSamoa: "American Samoa";
98
- readonly Arizona: "Arizona";
99
- readonly Arkansas: "Arkansas";
100
- readonly BakerIsland: "Baker Island";
101
- readonly California: "California";
102
- readonly Colorado: "Colorado";
103
- readonly Connecticut: "Connecticut";
104
- readonly Delaware: "Delaware";
105
- readonly DistrictOfColumbia: "District of Columbia";
106
- readonly Florida: "Florida";
107
- readonly Georgia: "Georgia";
108
- readonly Guam: "Guam";
109
- readonly Hawaii: "Hawaii";
110
- readonly HowlandIsland: "Howland Island";
111
- readonly Idaho: "Idaho";
112
- readonly Illinois: "Illinois";
113
- readonly Indiana: "Indiana";
114
- readonly Iowa: "Iowa";
115
- readonly JarvisIsland: "Jarvis Island";
116
- readonly JohnstonAtoll: "Johnston Atoll";
117
- readonly Kansas: "Kansas";
118
- readonly Kentucky: "Kentucky";
119
- readonly KingmanReef: "Kingman Reef";
120
- readonly Louisiana: "Louisiana";
121
- readonly Maine: "Maine";
122
- readonly Maryland: "Maryland";
123
- readonly Massachusetts: "Massachusetts";
124
- readonly Michigan: "Michigan";
125
- readonly MidwayAtoll: "Midway Atoll";
126
- readonly Minnesota: "Minnesota";
127
- readonly Mississippi: "Mississippi";
128
- readonly Missouri: "Missouri";
129
- readonly Montana: "Montana";
130
- readonly NavassaIsland: "Navassa Island";
131
- readonly Nebraska: "Nebraska";
132
- readonly Nevada: "Nevada";
133
- readonly NewHampshire: "New Hampshire";
134
- readonly NewJersey: "New Jersey";
135
- readonly NewMexico: "New Mexico";
136
- readonly NewYork: "New York";
137
- readonly NorthCarolina: "North Carolina";
138
- readonly NorthDakota: "North Dakota";
139
- readonly NorthernMarianaIslands: "Northern Mariana Islands";
140
- readonly Ohio: "Ohio";
141
- readonly Oklahoma: "Oklahoma";
142
- readonly Oregon: "Oregon";
143
- readonly PalmyraAtoll: "Palmyra Atoll";
144
- readonly Pennsylvania: "Pennsylvania";
145
- readonly PuertoRico: "Puerto Rico";
146
- readonly RhodeIsland: "Rhode Island";
147
- readonly SouthCarolina: "South Carolina";
148
- readonly SouthDakota: "South Dakota";
149
- readonly Tennessee: "Tennessee";
150
- readonly Texas: "Texas";
151
- readonly UnitedStatesVirginIslands: "United States Virgin Islands";
152
- readonly Utah: "Utah";
153
- readonly Vermont: "Vermont";
154
- readonly Virginia: "Virginia";
155
- readonly WakeIsland: "Wake Island";
156
- readonly Washington: "Washington";
157
- readonly WestVirginia: "West Virginia";
158
- readonly Wisconsin: "Wisconsin";
159
- readonly Wyoming: "Wyoming";
105
+ export type TUSStateCode = TRecordValue<typeof US_STATES_CODE>;
106
+ export declare const US_JURISDICTIONS: {
107
+ readonly AL: "Alabama";
108
+ readonly AK: "Alaska";
109
+ readonly AZ: "Arizona";
110
+ readonly AR: "Arkansas";
111
+ readonly CA: "California";
112
+ readonly CO: "Colorado";
113
+ readonly CT: "Connecticut";
114
+ readonly DE: "Delaware";
115
+ readonly FL: "Florida";
116
+ readonly GA: "Georgia";
117
+ readonly HI: "Hawaii";
118
+ readonly ID: "Idaho";
119
+ readonly IL: "Illinois";
120
+ readonly IN: "Indiana";
121
+ readonly IA: "Iowa";
122
+ readonly KS: "Kansas";
123
+ readonly KY: "Kentucky";
124
+ readonly LA: "Louisiana";
125
+ readonly ME: "Maine";
126
+ readonly MD: "Maryland";
127
+ readonly MA: "Massachusetts";
128
+ readonly MI: "Michigan";
129
+ readonly MN: "Minnesota";
130
+ readonly MS: "Mississippi";
131
+ readonly MO: "Missouri";
132
+ readonly MT: "Montana";
133
+ readonly NE: "Nebraska";
134
+ readonly NV: "Nevada";
135
+ readonly NH: "New Hampshire";
136
+ readonly NJ: "New Jersey";
137
+ readonly NM: "New Mexico";
138
+ readonly NY: "New York";
139
+ readonly NC: "North Carolina";
140
+ readonly ND: "North Dakota";
141
+ readonly OH: "Ohio";
142
+ readonly OK: "Oklahoma";
143
+ readonly OR: "Oregon";
144
+ readonly PA: "Pennsylvania";
145
+ readonly RI: "Rhode Island";
146
+ readonly SC: "South Carolina";
147
+ readonly SD: "South Dakota";
148
+ readonly TN: "Tennessee";
149
+ readonly TX: "Texas";
150
+ readonly UT: "Utah";
151
+ readonly VT: "Vermont";
152
+ readonly VA: "Virginia";
153
+ readonly WA: "Washington";
154
+ readonly WV: "West Virginia";
155
+ readonly WI: "Wisconsin";
156
+ readonly WY: "Wyoming";
157
+ readonly DC: "District of Columbia";
158
+ readonly PR: "Puerto Rico";
159
+ readonly GU: "Guam";
160
+ readonly VI: "United States Virgin Islands";
161
+ readonly AS: "American Samoa";
162
+ readonly MP: "Northern Mariana Islands";
160
163
  };
161
- export type TUnitedStatesJurisdiction = TRecordValue<typeof UNITED_STATES_JURISDICTIONS>;
162
- export declare const UnitedStatesJurisdictionOptions: ISelectOption<TUnitedStatesJurisdiction>[];
164
+ export type TUSJurisdiction = TRecordValue<typeof US_JURISDICTIONS>;
165
+ export declare const UnitedStatesJurisdictionOptions: ISelectOption<TUSJurisdiction>[];
163
166
  export declare const STATUS: {
164
167
  readonly Pending: "Pending";
165
168
  readonly InProgress: "InProgress";
@@ -65,74 +65,67 @@ export const US_STATES_CODE = {
65
65
  AS: "AS",
66
66
  MP: "MP",
67
67
  };
68
- export const UNITED_STATES_JURISDICTIONS = {
69
- Alabama: "Alabama",
70
- Alaska: "Alaska",
71
- AmericanSamoa: "American Samoa",
72
- Arizona: "Arizona",
73
- Arkansas: "Arkansas",
74
- BakerIsland: "Baker Island",
75
- California: "California",
76
- Colorado: "Colorado",
77
- Connecticut: "Connecticut",
78
- Delaware: "Delaware",
79
- DistrictOfColumbia: "District of Columbia",
80
- Florida: "Florida",
81
- Georgia: "Georgia",
82
- Guam: "Guam",
83
- Hawaii: "Hawaii",
84
- HowlandIsland: "Howland Island",
85
- Idaho: "Idaho",
86
- Illinois: "Illinois",
87
- Indiana: "Indiana",
88
- Iowa: "Iowa",
89
- JarvisIsland: "Jarvis Island",
90
- JohnstonAtoll: "Johnston Atoll",
91
- Kansas: "Kansas",
92
- Kentucky: "Kentucky",
93
- KingmanReef: "Kingman Reef",
94
- Louisiana: "Louisiana",
95
- Maine: "Maine",
96
- Maryland: "Maryland",
97
- Massachusetts: "Massachusetts",
98
- Michigan: "Michigan",
99
- MidwayAtoll: "Midway Atoll",
100
- Minnesota: "Minnesota",
101
- Mississippi: "Mississippi",
102
- Missouri: "Missouri",
103
- Montana: "Montana",
104
- NavassaIsland: "Navassa Island",
105
- Nebraska: "Nebraska",
106
- Nevada: "Nevada",
107
- NewHampshire: "New Hampshire",
108
- NewJersey: "New Jersey",
109
- NewMexico: "New Mexico",
110
- NewYork: "New York",
111
- NorthCarolina: "North Carolina",
112
- NorthDakota: "North Dakota",
113
- NorthernMarianaIslands: "Northern Mariana Islands",
114
- Ohio: "Ohio",
115
- Oklahoma: "Oklahoma",
116
- Oregon: "Oregon",
117
- PalmyraAtoll: "Palmyra Atoll",
118
- Pennsylvania: "Pennsylvania",
119
- PuertoRico: "Puerto Rico",
120
- RhodeIsland: "Rhode Island",
121
- SouthCarolina: "South Carolina",
122
- SouthDakota: "South Dakota",
123
- Tennessee: "Tennessee",
124
- Texas: "Texas",
125
- UnitedStatesVirginIslands: "United States Virgin Islands",
126
- Utah: "Utah",
127
- Vermont: "Vermont",
128
- Virginia: "Virginia",
129
- WakeIsland: "Wake Island",
130
- Washington: "Washington",
131
- WestVirginia: "West Virginia",
132
- Wisconsin: "Wisconsin",
133
- Wyoming: "Wyoming",
68
+ export const US_JURISDICTIONS = {
69
+ // 50 States
70
+ AL: "Alabama",
71
+ AK: "Alaska",
72
+ AZ: "Arizona",
73
+ AR: "Arkansas",
74
+ CA: "California",
75
+ CO: "Colorado",
76
+ CT: "Connecticut",
77
+ DE: "Delaware",
78
+ FL: "Florida",
79
+ GA: "Georgia",
80
+ HI: "Hawaii",
81
+ ID: "Idaho",
82
+ IL: "Illinois",
83
+ IN: "Indiana",
84
+ IA: "Iowa",
85
+ KS: "Kansas",
86
+ KY: "Kentucky",
87
+ LA: "Louisiana",
88
+ ME: "Maine",
89
+ MD: "Maryland",
90
+ MA: "Massachusetts",
91
+ MI: "Michigan",
92
+ MN: "Minnesota",
93
+ MS: "Mississippi",
94
+ MO: "Missouri",
95
+ MT: "Montana",
96
+ NE: "Nebraska",
97
+ NV: "Nevada",
98
+ NH: "New Hampshire",
99
+ NJ: "New Jersey",
100
+ NM: "New Mexico",
101
+ NY: "New York",
102
+ NC: "North Carolina",
103
+ ND: "North Dakota",
104
+ OH: "Ohio",
105
+ OK: "Oklahoma",
106
+ OR: "Oregon",
107
+ PA: "Pennsylvania",
108
+ RI: "Rhode Island",
109
+ SC: "South Carolina",
110
+ SD: "South Dakota",
111
+ TN: "Tennessee",
112
+ TX: "Texas",
113
+ UT: "Utah",
114
+ VT: "Vermont",
115
+ VA: "Virginia",
116
+ WA: "Washington",
117
+ WV: "West Virginia",
118
+ WI: "Wisconsin",
119
+ WY: "Wyoming",
120
+ // Territories
121
+ DC: "District of Columbia",
122
+ PR: "Puerto Rico",
123
+ GU: "Guam",
124
+ VI: "United States Virgin Islands",
125
+ AS: "American Samoa",
126
+ MP: "Northern Mariana Islands",
134
127
  };
135
- export const UnitedStatesJurisdictionOptions = Object.values(UNITED_STATES_JURISDICTIONS).map((jurisdiction) => ({
128
+ export const UnitedStatesJurisdictionOptions = Object.values(US_JURISDICTIONS).map((jurisdiction) => ({
136
129
  label: jurisdiction,
137
130
  value: jurisdiction,
138
131
  }));
@@ -1,56 +1,85 @@
1
- export interface ICreateTemplateRequest {
1
+ import type { IChecklistTemplate, IChecklistTemplateItem, IChecklistTemplateWithItems, ICreateTemplateInput, ICreateTemplateItemInput } from ".";
2
+ import type { ICountResponse, IMessageResponse } from "../base";
3
+ export interface IChecklistTemplateCompanyRouteParams {
4
+ companyId: string;
2
5
  }
3
- export interface ICreateTemplateResponse {
6
+ export interface ITemplateIdParams {
7
+ templateId: string;
4
8
  }
5
- export interface ICreateTemplateWithItemsRequest {
9
+ export interface ITemplateItemIdParams {
10
+ itemId: string;
6
11
  }
7
- export interface ICreateTemplateWithItemsResponse {
12
+ export interface ITemplateAndItemIdParams {
13
+ templateId: string;
14
+ itemId: string;
8
15
  }
9
- export interface IGetTemplatesByCompanyIdRequest {
16
+ export interface IIncludeInactiveQuery {
17
+ includeInactive?: string;
10
18
  }
11
- export interface IGetTemplatesByCompanyIdResponse {
19
+ export interface ICreateTemplateRequest extends Partial<Omit<ICreateTemplateInput, "companyId" | "createdBy">> {
20
+ name: string;
12
21
  }
13
- export interface IGetTemplateByIdRequest {
22
+ export interface ICreateTemplateResponse extends IChecklistTemplate {
14
23
  }
15
- export interface IGetTemplateByIdResponse {
24
+ export interface ICreateTemplateWithItemsRequest extends ICreateTemplateInput {
25
+ items: ICreateTemplateItemInput[];
16
26
  }
17
- export interface IGetTemplateWithItemsRequest {
27
+ export interface ICreateTemplateWithItemsResponse extends IChecklistTemplateWithItems {
18
28
  }
19
- export interface IGetTemplateWithItemsResponse {
29
+ export interface IGetTemplatesByCompanyIdRequest extends IChecklistTemplateCompanyRouteParams {
20
30
  }
21
- export interface IUpdateTemplateRequest {
31
+ export type IGetTemplatesByCompanyIdResponse = IChecklistTemplate[];
32
+ export interface IGetTemplateByIdRequest extends ITemplateIdParams {
22
33
  }
23
- export interface IUpdateTemplateResponse {
34
+ export interface IGetTemplateByIdResponse extends IChecklistTemplate {
24
35
  }
25
- export interface IDeleteTemplateRequest {
36
+ export interface IGetTemplateWithItemsRequest extends ITemplateIdParams {
26
37
  }
27
- export interface IDeleteTemplateResponse {
38
+ export interface IGetTemplateWithItemsResponse extends IChecklistTemplateWithItems {
39
+ }
40
+ export interface IUpdateTemplateRequest extends Partial<ICreateTemplateInput> {
41
+ }
42
+ export interface IUpdateTemplateResponse extends IChecklistTemplate {
43
+ }
44
+ export interface IDeleteTemplateRequest extends ITemplateIdParams {
45
+ }
46
+ export interface IDeleteTemplateResponse extends IMessageResponse {
28
47
  }
29
48
  export interface IToggleTemplateActiveRequest {
49
+ isActive: boolean;
50
+ }
51
+ export interface IToggleTemplateActiveResponse extends IChecklistTemplate {
52
+ }
53
+ export interface IGetTemplateUsageRequest extends ITemplateIdParams {
30
54
  }
31
- export interface IToggleTemplateActiveResponse {
55
+ export interface IGetTemplateUsageResponse extends ICountResponse {
32
56
  }
33
- export interface IGetTemplateUsageRequest {
57
+ export interface IGetTemplateItemsRequest extends ITemplateIdParams {
34
58
  }
35
- export interface IGetTemplateUsageResponse {
59
+ export type IGetTemplateItemsResponse = IChecklistTemplateItem[];
60
+ export interface IAddTemplateItemRequest extends ICreateTemplateItemInput {
61
+ title: string;
36
62
  }
37
- export interface IGetTemplateItemsRequest {
63
+ export interface IAddTemplateItemResponse extends IChecklistTemplateItem {
38
64
  }
39
- export interface IGetTemplateItemsResponse {
65
+ export interface IUpdateTemplateItemRequest extends Partial<ICreateTemplateItemInput> {
40
66
  }
41
- export interface IAddTemplateItemRequest {
67
+ export interface IUpdateTemplateItemResponse extends IChecklistTemplateItem {
42
68
  }
43
- export interface IAddTemplateItemResponse {
69
+ export interface IDuplicateTemplateItemRequest extends ITemplateItemIdParams {
44
70
  }
45
- export interface IUpdateTemplateItemRequest {
71
+ export interface IDuplicateTemplateItemResponse extends IChecklistTemplateItem {
46
72
  }
47
- export interface IUpdateTemplateItemResponse {
73
+ export interface IDeleteTemplateItemRequest extends ITemplateItemIdParams {
48
74
  }
49
- export interface IDeleteTemplateItemRequest {
75
+ export interface IDeleteTemplateItemResponse extends IMessageResponse {
50
76
  }
51
- export interface IDeleteTemplateItemResponse {
77
+ export interface ITemplateItemOrder {
78
+ itemId: string;
79
+ displayOrder: number;
52
80
  }
53
81
  export interface IReorderTemplateItemsRequest {
82
+ itemOrders: ITemplateItemOrder[];
54
83
  }
55
- export interface IReorderTemplateItemsResponse {
84
+ export interface IReorderTemplateItemsResponse extends IMessageResponse {
56
85
  }
@@ -1,2 +1 @@
1
- // checklist-template.interfaces.ts
2
1
  export {};
@@ -1,14 +1,14 @@
1
- import { IMetaData, TRecordValue, TUnitedStatesStateCode } from "../index";
1
+ import { IMetaData, TRecordValue, TUSStateCode } from "../index";
2
2
  export * from "./routes";
3
3
  export interface ICompany extends IMetaData {
4
4
  id: string;
5
5
  displayName: string;
6
- addressLine1?: string;
6
+ addressLine1: string;
7
7
  addressLine2?: string;
8
- city?: string;
9
- stateCode?: TUnitedStatesStateCode;
8
+ city: string;
9
+ stateCode: TUSStateCode;
10
10
  companyType: TCompanyType;
11
- postalCode?: string;
11
+ postalCode: string;
12
12
  country?: string;
13
13
  timezone?: string;
14
14
  photoUrl?: string;