@turndown/library 0.1.64 → 0.1.65
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/README.md +41 -1
- package/dist/{index.cjs → helpers/index.cjs} +30 -1116
- package/dist/helpers/index.cjs.map +1 -0
- package/dist/helpers/index.d.cts +675 -0
- package/dist/helpers/index.d.ts +675 -0
- package/dist/{index.mjs → helpers/index.mjs} +17 -926
- package/dist/helpers/index.mjs.map +1 -0
- package/dist/index-CzB45yLv.d.cts +334 -0
- package/dist/index-CzB45yLv.d.ts +334 -0
- package/dist/types/index.cjs +947 -0
- package/dist/types/index.cjs.map +1 -0
- package/dist/{index.d.cts → types/index.d.cts} +15 -1133
- package/dist/{index.d.ts → types/index.d.ts} +15 -1133
- package/dist/types/index.mjs +924 -0
- package/dist/types/index.mjs.map +1 -0
- package/dist/types/validation/index.cjs +195 -0
- package/dist/types/validation/index.cjs.map +1 -0
- package/dist/types/validation/index.d.cts +51 -0
- package/dist/types/validation/index.d.ts +51 -0
- package/dist/types/validation/index.mjs +174 -0
- package/dist/types/validation/index.mjs.map +1 -0
- package/package.json +30 -10
- package/dist/index.cjs.map +0 -1
- package/dist/index.mjs.map +0 -1
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pagination metadata for a paginated response.
|
|
3
|
+
*/
|
|
4
|
+
interface IPagingResult {
|
|
5
|
+
hasNextPage: boolean;
|
|
6
|
+
totalPages: number;
|
|
7
|
+
totalRecords: number;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Generic wrapper for paginated data.
|
|
11
|
+
*/
|
|
12
|
+
interface IDataWithPagingResult<TData> {
|
|
13
|
+
data: TData;
|
|
14
|
+
pagination: IPagingResult;
|
|
15
|
+
}
|
|
16
|
+
declare const SortDirection: {
|
|
17
|
+
readonly Asc: "Asc";
|
|
18
|
+
readonly Desc: "Desc";
|
|
19
|
+
};
|
|
20
|
+
type TSortDirection = (typeof SortDirection)[keyof typeof SortDirection];
|
|
21
|
+
/**
|
|
22
|
+
* Sorting condition for query results.
|
|
23
|
+
*/
|
|
24
|
+
interface ISortCondition {
|
|
25
|
+
name: string;
|
|
26
|
+
direction: TSortDirection;
|
|
27
|
+
}
|
|
28
|
+
declare const FilterCondition: {
|
|
29
|
+
readonly Equal: "=";
|
|
30
|
+
readonly GreaterThan: ">";
|
|
31
|
+
readonly LessThan: "<";
|
|
32
|
+
readonly NotEqual: "!=";
|
|
33
|
+
readonly Like: "LIKE";
|
|
34
|
+
readonly In: "IN";
|
|
35
|
+
readonly GreaterThanOrEqual: ">=";
|
|
36
|
+
readonly LessThanOrEqual: "<=";
|
|
37
|
+
};
|
|
38
|
+
type TFilterCondition = (typeof FilterCondition)[keyof typeof FilterCondition];
|
|
39
|
+
interface IFilterConditionBase {
|
|
40
|
+
name: string;
|
|
41
|
+
condition: TFilterCondition;
|
|
42
|
+
useAnd?: boolean;
|
|
43
|
+
}
|
|
44
|
+
interface IStringFilterCondition extends IFilterConditionBase {
|
|
45
|
+
valueString: string;
|
|
46
|
+
valueNumber?: never;
|
|
47
|
+
valueBoolean?: never;
|
|
48
|
+
}
|
|
49
|
+
interface INumberFilterCondition extends IFilterConditionBase {
|
|
50
|
+
valueString?: never;
|
|
51
|
+
valueNumber: number;
|
|
52
|
+
valueBoolean?: never;
|
|
53
|
+
}
|
|
54
|
+
interface IBooleanFilterCondition extends IFilterConditionBase {
|
|
55
|
+
valueString?: never;
|
|
56
|
+
valueNumber?: never;
|
|
57
|
+
valueBoolean: boolean;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Filter condition for querying data.
|
|
61
|
+
*
|
|
62
|
+
* Exactly one value field should be provided.
|
|
63
|
+
*/
|
|
64
|
+
type TFilterConditionValue = IStringFilterCondition | INumberFilterCondition | IBooleanFilterCondition;
|
|
65
|
+
/**
|
|
66
|
+
* Kept as an exported alias to preserve the existing public API name.
|
|
67
|
+
*/
|
|
68
|
+
type IFilterCondition = TFilterConditionValue;
|
|
69
|
+
/**
|
|
70
|
+
* Request shape for paginated data with optional sorting and filtering.
|
|
71
|
+
*/
|
|
72
|
+
interface IPaginationRequest {
|
|
73
|
+
page: number;
|
|
74
|
+
size: number;
|
|
75
|
+
sort?: ISortCondition[];
|
|
76
|
+
filters?: IFilterCondition[];
|
|
77
|
+
}
|
|
78
|
+
interface IPagingObject {
|
|
79
|
+
pagination: IPaginationRequest;
|
|
80
|
+
}
|
|
81
|
+
declare const createPagingObject: (page: number, size: number, sort?: ISortCondition[], filters?: IFilterCondition[]) => IPagingObject;
|
|
82
|
+
|
|
83
|
+
type TJsonPrimitive = string | number | boolean | null;
|
|
84
|
+
type TJsonObject = {
|
|
85
|
+
[key: string]: TJsonValue;
|
|
86
|
+
};
|
|
87
|
+
type TJsonValue = TJsonPrimitive | TJsonValue[] | TJsonObject;
|
|
88
|
+
type TUnknownRecord = Record<string, unknown>;
|
|
89
|
+
/**
|
|
90
|
+
* Serialized ISO-8601 date/time value returned by API JSON contracts.
|
|
91
|
+
*/
|
|
92
|
+
type TDateTimeString = string;
|
|
93
|
+
type TurndownObject<TObject extends object = TUnknownRecord> = TObject;
|
|
94
|
+
type TEmptyObject = Record<string, never>;
|
|
95
|
+
type IEmptyRouteRequest = TEmptyObject;
|
|
96
|
+
type IEmptyRouteParams = TEmptyObject;
|
|
97
|
+
declare const ENVIRONMENT: {
|
|
98
|
+
readonly Prod: "Prod";
|
|
99
|
+
readonly Dev: "Dev";
|
|
100
|
+
readonly Local: "Local";
|
|
101
|
+
readonly Test: "Test";
|
|
102
|
+
};
|
|
103
|
+
type TEnvironment = (typeof ENVIRONMENT)[keyof typeof ENVIRONMENT];
|
|
104
|
+
interface IMessageResponse {
|
|
105
|
+
message: string;
|
|
106
|
+
}
|
|
107
|
+
interface ISuccessResponse {
|
|
108
|
+
success: boolean;
|
|
109
|
+
}
|
|
110
|
+
interface ICountResponse {
|
|
111
|
+
count: number;
|
|
112
|
+
}
|
|
113
|
+
interface IMetaData {
|
|
114
|
+
createdAt: TDateTimeString;
|
|
115
|
+
updatedAt: TDateTimeString;
|
|
116
|
+
deletedAt: TDateTimeString | null;
|
|
117
|
+
}
|
|
118
|
+
type TRecordValue<TRecord extends object> = TRecord[keyof TRecord];
|
|
119
|
+
type TRecordKeys<TRecord extends object> = keyof TRecord;
|
|
120
|
+
interface IVersion {
|
|
121
|
+
major: number;
|
|
122
|
+
minor: number;
|
|
123
|
+
patch: number;
|
|
124
|
+
}
|
|
125
|
+
type TVersionInput = string | IVersion;
|
|
126
|
+
interface ISelectOption<TValue extends string = string> {
|
|
127
|
+
label: string;
|
|
128
|
+
value: TValue;
|
|
129
|
+
}
|
|
130
|
+
declare const MODE: {
|
|
131
|
+
readonly Create: "Create";
|
|
132
|
+
readonly Edit: "Edit";
|
|
133
|
+
readonly Delete: "Delete";
|
|
134
|
+
readonly Details: "Details";
|
|
135
|
+
};
|
|
136
|
+
type TMode = TRecordValue<typeof MODE> | null;
|
|
137
|
+
declare const IMAGE_ENTITY: {
|
|
138
|
+
readonly USER_PROFILE: "USER_PROFILE";
|
|
139
|
+
readonly PROPERTY: "PROPERTY";
|
|
140
|
+
readonly COMPANY: "COMPANY";
|
|
141
|
+
readonly CHECKLIST_ITEM: "CHECKLIST_ITEM";
|
|
142
|
+
readonly PROPERTY_ROOM: "PROPERTY_ROOM";
|
|
143
|
+
readonly MAINTENANCE_TICKET: "MAINTENANCE_TICKET";
|
|
144
|
+
readonly WORK_REPORT: "WORK_REPORT";
|
|
145
|
+
readonly CLEANING_REPORT: "CLEANING_REPORT";
|
|
146
|
+
readonly TURNDOWN_DEFAULT: "TURNDOWN_DEFAULT";
|
|
147
|
+
};
|
|
148
|
+
type TImageEntityType = TRecordValue<typeof IMAGE_ENTITY>;
|
|
149
|
+
type TUSStateCode = TRecordKeys<typeof US_JURISDICTIONS>;
|
|
150
|
+
declare const US_JURISDICTIONS: {
|
|
151
|
+
readonly AL: "Alabama";
|
|
152
|
+
readonly AK: "Alaska";
|
|
153
|
+
readonly AZ: "Arizona";
|
|
154
|
+
readonly AR: "Arkansas";
|
|
155
|
+
readonly CA: "California";
|
|
156
|
+
readonly CO: "Colorado";
|
|
157
|
+
readonly CT: "Connecticut";
|
|
158
|
+
readonly DE: "Delaware";
|
|
159
|
+
readonly FL: "Florida";
|
|
160
|
+
readonly GA: "Georgia";
|
|
161
|
+
readonly HI: "Hawaii";
|
|
162
|
+
readonly ID: "Idaho";
|
|
163
|
+
readonly IL: "Illinois";
|
|
164
|
+
readonly IN: "Indiana";
|
|
165
|
+
readonly IA: "Iowa";
|
|
166
|
+
readonly KS: "Kansas";
|
|
167
|
+
readonly KY: "Kentucky";
|
|
168
|
+
readonly LA: "Louisiana";
|
|
169
|
+
readonly ME: "Maine";
|
|
170
|
+
readonly MD: "Maryland";
|
|
171
|
+
readonly MA: "Massachusetts";
|
|
172
|
+
readonly MI: "Michigan";
|
|
173
|
+
readonly MN: "Minnesota";
|
|
174
|
+
readonly MS: "Mississippi";
|
|
175
|
+
readonly MO: "Missouri";
|
|
176
|
+
readonly MT: "Montana";
|
|
177
|
+
readonly NE: "Nebraska";
|
|
178
|
+
readonly NV: "Nevada";
|
|
179
|
+
readonly NH: "New Hampshire";
|
|
180
|
+
readonly NJ: "New Jersey";
|
|
181
|
+
readonly NM: "New Mexico";
|
|
182
|
+
readonly NY: "New York";
|
|
183
|
+
readonly NC: "North Carolina";
|
|
184
|
+
readonly ND: "North Dakota";
|
|
185
|
+
readonly OH: "Ohio";
|
|
186
|
+
readonly OK: "Oklahoma";
|
|
187
|
+
readonly OR: "Oregon";
|
|
188
|
+
readonly PA: "Pennsylvania";
|
|
189
|
+
readonly RI: "Rhode Island";
|
|
190
|
+
readonly SC: "South Carolina";
|
|
191
|
+
readonly SD: "South Dakota";
|
|
192
|
+
readonly TN: "Tennessee";
|
|
193
|
+
readonly TX: "Texas";
|
|
194
|
+
readonly UT: "Utah";
|
|
195
|
+
readonly VT: "Vermont";
|
|
196
|
+
readonly VA: "Virginia";
|
|
197
|
+
readonly WA: "Washington";
|
|
198
|
+
readonly WV: "West Virginia";
|
|
199
|
+
readonly WI: "Wisconsin";
|
|
200
|
+
readonly WY: "Wyoming";
|
|
201
|
+
readonly DC: "District of Columbia";
|
|
202
|
+
readonly PR: "Puerto Rico";
|
|
203
|
+
readonly GU: "Guam";
|
|
204
|
+
readonly VI: "United States Virgin Islands";
|
|
205
|
+
readonly AS: "American Samoa";
|
|
206
|
+
readonly MP: "Northern Mariana Islands";
|
|
207
|
+
};
|
|
208
|
+
type TUSJurisdiction = TRecordValue<typeof US_JURISDICTIONS>;
|
|
209
|
+
declare const STATUS: {
|
|
210
|
+
readonly PENDING: "PENDING";
|
|
211
|
+
readonly IN_PROGRESS: "IN_PROGRESS";
|
|
212
|
+
readonly COMPLETED: "COMPLETED";
|
|
213
|
+
readonly OVERDUE: "OVERDUE";
|
|
214
|
+
readonly ACTIVE: "ACTIVE";
|
|
215
|
+
readonly INACTIVE: "INACTIVE";
|
|
216
|
+
};
|
|
217
|
+
type TStatus = TRecordValue<typeof STATUS>;
|
|
218
|
+
declare const SEVERITY: {
|
|
219
|
+
readonly LOW: "LOW";
|
|
220
|
+
readonly MEDIUM: "MEDIUM";
|
|
221
|
+
readonly HIGH: "HIGH";
|
|
222
|
+
};
|
|
223
|
+
type TSeverity = TRecordValue<typeof SEVERITY>;
|
|
224
|
+
declare const SERVICE_TYPES: {
|
|
225
|
+
readonly PROPERTY: "PROPERTY";
|
|
226
|
+
readonly CLEANING: "CLEANING";
|
|
227
|
+
readonly MAINTENANCE: "MAINTENANCE";
|
|
228
|
+
readonly INSPECTION: "INSPECTION";
|
|
229
|
+
readonly OTHER: "OTHER";
|
|
230
|
+
};
|
|
231
|
+
type TServiceType = TRecordValue<typeof SERVICE_TYPES>;
|
|
232
|
+
declare const MONTHS: readonly ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
|
|
233
|
+
type TMonths = (typeof MONTHS)[number];
|
|
234
|
+
declare const WEEK_DAY: {
|
|
235
|
+
readonly Sunday: "Sunday";
|
|
236
|
+
readonly Monday: "Monday";
|
|
237
|
+
readonly Tuesday: "Tuesday";
|
|
238
|
+
readonly Wednesday: "Wednesday";
|
|
239
|
+
readonly Thursday: "Thursday";
|
|
240
|
+
readonly Friday: "Friday";
|
|
241
|
+
readonly Saturday: "Saturday";
|
|
242
|
+
};
|
|
243
|
+
type TWeekDay = TRecordValue<typeof WEEK_DAY>;
|
|
244
|
+
declare const WEEK_DAY_SHORT_LABEL: {
|
|
245
|
+
readonly Sunday: "Sun";
|
|
246
|
+
readonly Monday: "Mon";
|
|
247
|
+
readonly Tuesday: "Tue";
|
|
248
|
+
readonly Wednesday: "Wed";
|
|
249
|
+
readonly Thursday: "Thu";
|
|
250
|
+
readonly Friday: "Fri";
|
|
251
|
+
readonly Saturday: "Sat";
|
|
252
|
+
};
|
|
253
|
+
type TWeekDayShortLabel = TRecordValue<typeof WEEK_DAY_SHORT_LABEL>;
|
|
254
|
+
declare const WEEK_DAY_LETTER: {
|
|
255
|
+
readonly Sunday: "S";
|
|
256
|
+
readonly Monday: "M";
|
|
257
|
+
readonly Tuesday: "T";
|
|
258
|
+
readonly Wednesday: "W";
|
|
259
|
+
readonly Thursday: "T";
|
|
260
|
+
readonly Friday: "F";
|
|
261
|
+
readonly Saturday: "S";
|
|
262
|
+
};
|
|
263
|
+
type TWeekDayLetter = TRecordValue<typeof WEEK_DAY_LETTER>;
|
|
264
|
+
interface IWeekDay {
|
|
265
|
+
date: Date;
|
|
266
|
+
dayOfMonth: number;
|
|
267
|
+
day: TWeekDay;
|
|
268
|
+
shortLabel: TWeekDayShortLabel;
|
|
269
|
+
letter: TWeekDayLetter;
|
|
270
|
+
isToday: boolean;
|
|
271
|
+
}
|
|
272
|
+
declare const UnitedStatesJurisdictionOptions: ISelectOption<TRecordValue<{
|
|
273
|
+
readonly AL: "Alabama";
|
|
274
|
+
readonly AK: "Alaska";
|
|
275
|
+
readonly AZ: "Arizona";
|
|
276
|
+
readonly AR: "Arkansas";
|
|
277
|
+
readonly CA: "California";
|
|
278
|
+
readonly CO: "Colorado";
|
|
279
|
+
readonly CT: "Connecticut";
|
|
280
|
+
readonly DE: "Delaware";
|
|
281
|
+
readonly FL: "Florida";
|
|
282
|
+
readonly GA: "Georgia";
|
|
283
|
+
readonly HI: "Hawaii";
|
|
284
|
+
readonly ID: "Idaho";
|
|
285
|
+
readonly IL: "Illinois";
|
|
286
|
+
readonly IN: "Indiana";
|
|
287
|
+
readonly IA: "Iowa";
|
|
288
|
+
readonly KS: "Kansas";
|
|
289
|
+
readonly KY: "Kentucky";
|
|
290
|
+
readonly LA: "Louisiana";
|
|
291
|
+
readonly ME: "Maine";
|
|
292
|
+
readonly MD: "Maryland";
|
|
293
|
+
readonly MA: "Massachusetts";
|
|
294
|
+
readonly MI: "Michigan";
|
|
295
|
+
readonly MN: "Minnesota";
|
|
296
|
+
readonly MS: "Mississippi";
|
|
297
|
+
readonly MO: "Missouri";
|
|
298
|
+
readonly MT: "Montana";
|
|
299
|
+
readonly NE: "Nebraska";
|
|
300
|
+
readonly NV: "Nevada";
|
|
301
|
+
readonly NH: "New Hampshire";
|
|
302
|
+
readonly NJ: "New Jersey";
|
|
303
|
+
readonly NM: "New Mexico";
|
|
304
|
+
readonly NY: "New York";
|
|
305
|
+
readonly NC: "North Carolina";
|
|
306
|
+
readonly ND: "North Dakota";
|
|
307
|
+
readonly OH: "Ohio";
|
|
308
|
+
readonly OK: "Oklahoma";
|
|
309
|
+
readonly OR: "Oregon";
|
|
310
|
+
readonly PA: "Pennsylvania";
|
|
311
|
+
readonly RI: "Rhode Island";
|
|
312
|
+
readonly SC: "South Carolina";
|
|
313
|
+
readonly SD: "South Dakota";
|
|
314
|
+
readonly TN: "Tennessee";
|
|
315
|
+
readonly TX: "Texas";
|
|
316
|
+
readonly UT: "Utah";
|
|
317
|
+
readonly VT: "Vermont";
|
|
318
|
+
readonly VA: "Virginia";
|
|
319
|
+
readonly WA: "Washington";
|
|
320
|
+
readonly WV: "West Virginia";
|
|
321
|
+
readonly WI: "Wisconsin";
|
|
322
|
+
readonly WY: "Wyoming";
|
|
323
|
+
readonly DC: "District of Columbia";
|
|
324
|
+
readonly PR: "Puerto Rico";
|
|
325
|
+
readonly GU: "Guam";
|
|
326
|
+
readonly VI: "United States Virgin Islands";
|
|
327
|
+
readonly AS: "American Samoa";
|
|
328
|
+
readonly MP: "Northern Mariana Islands";
|
|
329
|
+
}>>[];
|
|
330
|
+
declare const StatusOptions: ISelectOption<TStatus>[];
|
|
331
|
+
declare const SeverityOptions: ISelectOption<TSeverity>[];
|
|
332
|
+
declare const ServiceTypeOptions: ISelectOption<TServiceType>[];
|
|
333
|
+
|
|
334
|
+
export { type TWeekDayLetter as $, type TEmptyObject as A, type TEnvironment as B, type TFilterCondition as C, type TFilterConditionValue as D, ENVIRONMENT as E, FilterCondition as F, type TImageEntityType as G, type TJsonObject as H, type IBooleanFilterCondition as I, type TJsonPrimitive as J, type TJsonValue as K, type TMode as L, MODE as M, type TMonths as N, type TRecordKeys as O, type TRecordValue as P, type TServiceType as Q, type TSeverity as R, SERVICE_TYPES as S, type TDateTimeString as T, type TSortDirection as U, type TStatus as V, type TUSJurisdiction as W, type TUSStateCode as X, type TUnknownRecord as Y, type TVersionInput as Z, type TWeekDay as _, type ICountResponse as a, type TWeekDayShortLabel as a0, type TurndownObject as a1, US_JURISDICTIONS as a2, UnitedStatesJurisdictionOptions as a3, WEEK_DAY as a4, WEEK_DAY_LETTER as a5, WEEK_DAY_SHORT_LABEL as a6, createPagingObject as a7, type IDataWithPagingResult as b, type IEmptyRouteParams as c, type IEmptyRouteRequest as d, type IFilterCondition as e, type IFilterConditionBase as f, IMAGE_ENTITY as g, type IMessageResponse as h, type IMetaData as i, type INumberFilterCondition as j, type IPaginationRequest as k, type IPagingObject as l, type IPagingResult as m, type ISelectOption as n, type ISortCondition as o, type IStringFilterCondition as p, type ISuccessResponse as q, type IVersion as r, type IWeekDay as s, MONTHS as t, SEVERITY as u, STATUS as v, ServiceTypeOptions as w, SeverityOptions as x, SortDirection as y, StatusOptions as z };
|