timezest 1.1.3 → 1.1.5
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/LICENSE +8 -8
- package/README.md +32 -9
- package/{config → dist/config}/config.d.ts +3 -0
- package/{config → dist/config}/config.js +5 -2
- package/dist/config/config.js.map +1 -0
- package/{index.d.ts → dist/index.d.ts} +14 -12
- package/{index.js → dist/index.js} +12 -7
- package/dist/index.js.map +1 -0
- package/{utils → dist/utils}/makePaginatedRequest.d.ts +3 -2
- package/{utils → dist/utils}/makePaginatedRequest.js +3 -2
- package/dist/utils/makePaginatedRequest.js.map +1 -0
- package/{utils → dist/utils}/makeRequest.js +38 -7
- package/dist/utils/makeRequest.js.map +1 -0
- package/dist/utils/tqlFilter.d.ts +260 -0
- package/dist/utils/tqlFilter.js +444 -0
- package/dist/utils/tqlFilter.js.map +1 -0
- package/package.json +7 -9
- package/config/config.js.map +0 -1
- package/index.js.map +0 -1
- package/utils/makePaginatedRequest.js.map +0 -1
- package/utils/makeRequest.js.map +0 -1
- /package/{constants → dist/constants}/endpoints.d.ts +0 -0
- /package/{constants → dist/constants}/endpoints.js +0 -0
- /package/{constants → dist/constants}/endpoints.js.map +0 -0
- /package/{entities → dist/entities}/entities.d.ts +0 -0
- /package/{entities → dist/entities}/entities.js +0 -0
- /package/{entities → dist/entities}/entities.js.map +0 -0
- /package/{entities → dist/entities}/schemas.d.ts +0 -0
- /package/{entities → dist/entities}/schemas.js +0 -0
- /package/{entities → dist/entities}/schemas.js.map +0 -0
- /package/{utils → dist/utils}/handleError.d.ts +0 -0
- /package/{utils → dist/utils}/handleError.js +0 -0
- /package/{utils → dist/utils}/handleError.js.map +0 -0
- /package/{utils → dist/utils}/logger.d.ts +0 -0
- /package/{utils → dist/utils}/logger.js +0 -0
- /package/{utils → dist/utils}/logger.js.map +0 -0
- /package/{utils → dist/utils}/makeRequest.d.ts +0 -0
package/LICENSE
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 PNC IT
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
-
|
|
7
|
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
-
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 PNC IT
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
9
|
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -133,29 +133,52 @@ async function fetchAllResources() {
|
|
|
133
133
|
fetchAllResources();
|
|
134
134
|
```
|
|
135
135
|
|
|
136
|
-
## Retry Logic
|
|
136
|
+
## Rate Limiting and Retry Logic
|
|
137
137
|
|
|
138
|
-
The `TimeZestAPI` class includes
|
|
138
|
+
The `TimeZestAPI` class includes intelligent retry logic optimized for TimeZest's API limits. TimeZest enforces a **maximum of 180 requests in any 60-second sliding window**.
|
|
139
139
|
|
|
140
|
-
|
|
141
|
-
|
|
140
|
+
### Retry Strategy
|
|
141
|
+
|
|
142
|
+
When a request fails due to rate limiting (429 Too Many Requests), the library automatically retries with an optimized strategy:
|
|
143
|
+
|
|
144
|
+
- **Aggressive Exponential Backoff**: Starts at 1 second and doubles with each retry (1s, 2s, 4s, 8s, 16s, 32s, 64s...)
|
|
145
|
+
- **Jitter**: Adds ±25% random variation to retry delays to prevent a thundering herd problem when multiple clients hit rate limits simultaneously
|
|
146
|
+
- **Retry-After Header**: Always respects the `Retry-After` header from 429 responses when provided by the API
|
|
147
|
+
- **Patient by Default**: Will retry for up to 5 minutes by default, allowing time for rate limit windows to clear
|
|
148
|
+
- **Configurable**: Full control over retry behavior via configuration options
|
|
149
|
+
|
|
150
|
+
### Configuration Options
|
|
151
|
+
|
|
152
|
+
You can configure the retry behavior using the following options when initializing the class:
|
|
153
|
+
|
|
154
|
+
- **`maxRetryTimeMs`**: The maximum amount of time (in milliseconds) to spend retrying a request. Defaults to 5 minutes (300,000ms).
|
|
155
|
+
- **`maxRetryDelayMs`**: The maximum delay (in milliseconds) between individual retry attempts. Defaults to 60 seconds (60,000ms).
|
|
142
156
|
|
|
143
157
|
### Example Configuration
|
|
144
158
|
|
|
145
159
|
```typescript
|
|
146
160
|
const options = {
|
|
147
|
-
maxRetryTimeMs:
|
|
148
|
-
maxRetryDelayMs:
|
|
161
|
+
maxRetryTimeMs: 10 * 60 * 1000, // Retry for up to 10 minutes
|
|
162
|
+
maxRetryDelayMs: 60 * 1000, // Max 60 seconds between retries
|
|
163
|
+
logLevel: "debug", // See detailed retry information in logs
|
|
149
164
|
};
|
|
150
165
|
|
|
151
166
|
const timeZest = new TimeZestAPI("your-api-key", options);
|
|
152
167
|
```
|
|
153
168
|
|
|
154
|
-
###
|
|
169
|
+
### Retry Behavior Example
|
|
170
|
+
|
|
171
|
+
If you hit a rate limit without a `Retry-After` header, the retry delays will be:
|
|
155
172
|
|
|
156
|
-
|
|
173
|
+
- 1st retry: ~1 second (0.75-1.25s with jitter)
|
|
174
|
+
- 2nd retry: ~2 seconds (1.5-2.5s with jitter)
|
|
175
|
+
- 3rd retry: ~4 seconds (3-5s with jitter)
|
|
176
|
+
- 4th retry: ~8 seconds (6-10s with jitter)
|
|
177
|
+
- 5th retry: ~16 seconds (12-20s with jitter)
|
|
178
|
+
- 6th retry: ~32 seconds (24-40s with jitter)
|
|
179
|
+
- 7th+ retry: ~60 seconds (45-60s with jitter, capped at maxRetryDelayMs)
|
|
157
180
|
|
|
158
|
-
|
|
181
|
+
The jitter ensures that if multiple clients hit the rate limit at the same time, they won't all retry simultaneously.
|
|
159
182
|
|
|
160
183
|
## Logging
|
|
161
184
|
|
|
@@ -30,5 +30,8 @@ export interface TimeZestAPIConfig {
|
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
32
|
* Default configuration for the TimeZest API client.
|
|
33
|
+
*
|
|
34
|
+
* Rate limit: 180 requests per 60 seconds (sliding window)
|
|
35
|
+
* Retry strategy: Aggressive exponential backoff with jitter
|
|
33
36
|
*/
|
|
34
37
|
export declare const CONFIG: TimeZestAPIConfig;
|
|
@@ -4,13 +4,16 @@ exports.CONFIG = void 0;
|
|
|
4
4
|
const logger_1 = require("../utils/logger");
|
|
5
5
|
/**
|
|
6
6
|
* Default configuration for the TimeZest API client.
|
|
7
|
+
*
|
|
8
|
+
* Rate limit: 180 requests per 60 seconds (sliding window)
|
|
9
|
+
* Retry strategy: Aggressive exponential backoff with jitter
|
|
7
10
|
*/
|
|
8
11
|
exports.CONFIG = {
|
|
9
12
|
logLevel: "error",
|
|
10
13
|
logger: logger_1.defaultLogger,
|
|
11
14
|
baseUrl: "https://api.timezest.com/v1",
|
|
12
|
-
maxRetryDelayMs:
|
|
13
|
-
maxRetryTimeMs:
|
|
15
|
+
maxRetryDelayMs: 60 * 1000, // 60 seconds (aligned with rate limit window)
|
|
16
|
+
maxRetryTimeMs: 5 * 60 * 1000, // 5 minutes (be patient with retries)
|
|
14
17
|
outputValidation: true,
|
|
15
18
|
};
|
|
16
19
|
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config/config.ts"],"names":[],"mappings":";;;AAAA,4CAAkE;AAqClE;;;;;GAKG;AACU,QAAA,MAAM,GAAsB;IACvC,QAAQ,EAAE,OAAO;IACjB,MAAM,EAAE,sBAAa;IACrB,OAAO,EAAE,6BAA6B;IACtC,eAAe,EAAE,EAAE,GAAG,IAAI,EAAE,8CAA8C;IAC1E,cAAc,EAAE,CAAC,GAAG,EAAE,GAAG,IAAI,EAAE,sCAAsC;IACrE,gBAAgB,EAAE,IAAI;CACvB,CAAC"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { log, LogLevel, Logger } from "./utils/logger";
|
|
2
2
|
import { TimeZestAPIConfig } from "./config/config";
|
|
3
3
|
import { Agent, Resource, AppointmentType, SchedulingRequest, Team, SchedulingRequestPost } from "./entities/entities";
|
|
4
|
-
|
|
5
|
-
export {
|
|
4
|
+
import { TQLFilter } from "./utils/tqlFilter";
|
|
5
|
+
export { Agent, Resource, AppointmentType, SchedulingRequest, SchedulingRequestPost, Team, } from "./entities/entities";
|
|
6
|
+
export { ResourceSchema, AgentSchema, AppointmentTypeSchema, SchedulingRequestSchema, TeamSchema, } from "./entities/schemas";
|
|
7
|
+
export { TQL, TQLFilter } from "./utils/tqlFilter";
|
|
6
8
|
/**
|
|
7
9
|
* Options for configuring the TimeZest API.
|
|
8
10
|
*/
|
|
@@ -46,28 +48,28 @@ export declare class TimeZestAPI {
|
|
|
46
48
|
getConfig(): TimeZestAPIConfig;
|
|
47
49
|
/**
|
|
48
50
|
* Fetches resources from the TimeZest API.
|
|
49
|
-
* @param {string | null} [filter=null] - Optional filter string to narrow down results.
|
|
51
|
+
* @param {TQLFilter | string | null} [filter=null] - Optional filter (TQLFilter instance or string) to narrow down results.
|
|
50
52
|
* @returns {Promise<Resource[]>} A promise that resolves to an array of resources.
|
|
51
53
|
*/
|
|
52
|
-
getResources: (filter?: string | null) => Promise<Resource[]>;
|
|
54
|
+
getResources: (filter?: TQLFilter | string | null) => Promise<Resource[]>;
|
|
53
55
|
/**
|
|
54
56
|
* Fetches agents from the TimeZest API.
|
|
55
|
-
* @param {string | null} [filter=null] - Optional filter string to narrow down results.
|
|
57
|
+
* @param {TQLFilter | string | null} [filter=null] - Optional filter (TQLFilter instance or string) to narrow down results.
|
|
56
58
|
* @returns {Promise<Agent[]>} A promise that resolves to an array of agents.
|
|
57
59
|
*/
|
|
58
|
-
getAgents(filter?: string | null): Promise<Agent[]>;
|
|
60
|
+
getAgents(filter?: TQLFilter | string | null): Promise<Agent[]>;
|
|
59
61
|
/**
|
|
60
62
|
* Fetches teams from the TimeZest API.
|
|
61
|
-
* @param {string | null} [filter=null] - Optional filter string to narrow down results.
|
|
63
|
+
* @param {TQLFilter | string | null} [filter=null] - Optional filter (TQLFilter instance or string) to narrow down results.
|
|
62
64
|
* @returns {Promise<Team[]>} A promise that resolves to an array of teams.
|
|
63
65
|
*/
|
|
64
|
-
getTeams(filter?: string | null): Promise<Team[]>;
|
|
66
|
+
getTeams(filter?: TQLFilter | string | null): Promise<Team[]>;
|
|
65
67
|
/**
|
|
66
68
|
* Fetches appointment types from the TimeZest API.
|
|
67
|
-
* @param {string | null} [filter=null] - Optional filter string to narrow down results.
|
|
69
|
+
* @param {TQLFilter | string | null} [filter=null] - Optional filter (TQLFilter instance or string) to narrow down results.
|
|
68
70
|
* @returns {Promise<AppointmentType[]>} A promise that resolves to an array of appointment types.
|
|
69
71
|
*/
|
|
70
|
-
getAppointmentTypes(filter?: string | null): Promise<AppointmentType[]>;
|
|
72
|
+
getAppointmentTypes(filter?: TQLFilter | string | null): Promise<AppointmentType[]>;
|
|
71
73
|
/**
|
|
72
74
|
* Fetches a scheduling request by its ID.
|
|
73
75
|
* @param {string} id - The ID of the scheduling request to fetch.
|
|
@@ -76,10 +78,10 @@ export declare class TimeZestAPI {
|
|
|
76
78
|
getSchedulingRequest(id: string): Promise<SchedulingRequest>;
|
|
77
79
|
/**
|
|
78
80
|
* Fetches scheduling requests from the TimeZest API.
|
|
79
|
-
* @param {string | null} [filter=null] - Optional filter string to narrow down results.
|
|
81
|
+
* @param {TQLFilter | string | null} [filter=null] - Optional filter (TQLFilter instance or string) to narrow down results.
|
|
80
82
|
* @returns {Promise<SchedulingRequest[]>} A promise that resolves to an array of scheduling requests.
|
|
81
83
|
*/
|
|
82
|
-
getSchedulingRequests(filter?: string | null): Promise<SchedulingRequest[]>;
|
|
84
|
+
getSchedulingRequests(filter?: TQLFilter | string | null): Promise<SchedulingRequest[]>;
|
|
83
85
|
/**
|
|
84
86
|
* Creates a new scheduling request in the TimeZest API.
|
|
85
87
|
* @param {SchedulingRequestPost} data - The data for the new scheduling request.
|
|
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.TimeZestAPI = exports.TeamSchema = exports.SchedulingRequestSchema = exports.AppointmentTypeSchema = exports.AgentSchema = exports.ResourceSchema = void 0;
|
|
12
|
+
exports.TimeZestAPI = exports.TQLFilter = exports.TQL = exports.TeamSchema = exports.SchedulingRequestSchema = exports.AppointmentTypeSchema = exports.AgentSchema = exports.ResourceSchema = void 0;
|
|
13
13
|
const schemas_1 = require("./entities/schemas");
|
|
14
14
|
const config_1 = require("./config/config");
|
|
15
15
|
const makeRequest_1 = require("./utils/makeRequest");
|
|
@@ -22,6 +22,9 @@ Object.defineProperty(exports, "AgentSchema", { enumerable: true, get: function
|
|
|
22
22
|
Object.defineProperty(exports, "AppointmentTypeSchema", { enumerable: true, get: function () { return schemas_2.AppointmentTypeSchema; } });
|
|
23
23
|
Object.defineProperty(exports, "SchedulingRequestSchema", { enumerable: true, get: function () { return schemas_2.SchedulingRequestSchema; } });
|
|
24
24
|
Object.defineProperty(exports, "TeamSchema", { enumerable: true, get: function () { return schemas_2.TeamSchema; } });
|
|
25
|
+
var tqlFilter_1 = require("./utils/tqlFilter");
|
|
26
|
+
Object.defineProperty(exports, "TQL", { enumerable: true, get: function () { return tqlFilter_1.TQL; } });
|
|
27
|
+
Object.defineProperty(exports, "TQLFilter", { enumerable: true, get: function () { return tqlFilter_1.TQLFilter; } });
|
|
25
28
|
/**
|
|
26
29
|
* Represents the TimeZest API client.
|
|
27
30
|
* Provides methods to interact with the TimeZest API.
|
|
@@ -35,7 +38,7 @@ class TimeZestAPI {
|
|
|
35
38
|
constructor(apiKey, options) {
|
|
36
39
|
/**
|
|
37
40
|
* Fetches resources from the TimeZest API.
|
|
38
|
-
* @param {string | null} [filter=null] - Optional filter string to narrow down results.
|
|
41
|
+
* @param {TQLFilter | string | null} [filter=null] - Optional filter (TQLFilter instance or string) to narrow down results.
|
|
39
42
|
* @returns {Promise<Resource[]>} A promise that resolves to an array of resources.
|
|
40
43
|
*/
|
|
41
44
|
this.getResources = (...args_1) => __awaiter(this, [...args_1], void 0, function* (filter = null) {
|
|
@@ -49,7 +52,9 @@ class TimeZestAPI {
|
|
|
49
52
|
baseUrl: (options === null || options === void 0 ? void 0 : options.baseUrl) || config_1.CONFIG.baseUrl,
|
|
50
53
|
maxRetryDelayMs: (options === null || options === void 0 ? void 0 : options.maxRetryDelayMs) || config_1.CONFIG.maxRetryDelayMs,
|
|
51
54
|
maxRetryTimeMs: (options === null || options === void 0 ? void 0 : options.maxRetryTimeMs) || config_1.CONFIG.maxRetryTimeMs,
|
|
52
|
-
outputValidation: (options === null || options === void 0 ? void 0 : options.outputValidation) !== undefined
|
|
55
|
+
outputValidation: (options === null || options === void 0 ? void 0 : options.outputValidation) !== undefined
|
|
56
|
+
? options.outputValidation
|
|
57
|
+
: config_1.CONFIG.outputValidation,
|
|
53
58
|
};
|
|
54
59
|
this.log = (0, logger_1.buildLogger)(this.config.logger, this.config.logLevel);
|
|
55
60
|
// Log the initialization of the API client but remove apiKey
|
|
@@ -80,7 +85,7 @@ class TimeZestAPI {
|
|
|
80
85
|
}
|
|
81
86
|
/**
|
|
82
87
|
* Fetches agents from the TimeZest API.
|
|
83
|
-
* @param {string | null} [filter=null] - Optional filter string to narrow down results.
|
|
88
|
+
* @param {TQLFilter | string | null} [filter=null] - Optional filter (TQLFilter instance or string) to narrow down results.
|
|
84
89
|
* @returns {Promise<Agent[]>} A promise that resolves to an array of agents.
|
|
85
90
|
*/
|
|
86
91
|
getAgents() {
|
|
@@ -91,7 +96,7 @@ class TimeZestAPI {
|
|
|
91
96
|
}
|
|
92
97
|
/**
|
|
93
98
|
* Fetches teams from the TimeZest API.
|
|
94
|
-
* @param {string | null} [filter=null] - Optional filter string to narrow down results.
|
|
99
|
+
* @param {TQLFilter | string | null} [filter=null] - Optional filter (TQLFilter instance or string) to narrow down results.
|
|
95
100
|
* @returns {Promise<Team[]>} A promise that resolves to an array of teams.
|
|
96
101
|
*/
|
|
97
102
|
getTeams() {
|
|
@@ -102,7 +107,7 @@ class TimeZestAPI {
|
|
|
102
107
|
}
|
|
103
108
|
/**
|
|
104
109
|
* Fetches appointment types from the TimeZest API.
|
|
105
|
-
* @param {string | null} [filter=null] - Optional filter string to narrow down results.
|
|
110
|
+
* @param {TQLFilter | string | null} [filter=null] - Optional filter (TQLFilter instance or string) to narrow down results.
|
|
106
111
|
* @returns {Promise<AppointmentType[]>} A promise that resolves to an array of appointment types.
|
|
107
112
|
*/
|
|
108
113
|
getAppointmentTypes() {
|
|
@@ -124,7 +129,7 @@ class TimeZestAPI {
|
|
|
124
129
|
}
|
|
125
130
|
/**
|
|
126
131
|
* Fetches scheduling requests from the TimeZest API.
|
|
127
|
-
* @param {string | null} [filter=null] - Optional filter string to narrow down results.
|
|
132
|
+
* @param {TQLFilter | string | null} [filter=null] - Optional filter (TQLFilter instance or string) to narrow down results.
|
|
128
133
|
* @returns {Promise<SchedulingRequest[]>} A promise that resolves to an array of scheduling requests.
|
|
129
134
|
*/
|
|
130
135
|
getSchedulingRequests() {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAUA,gDAM4B;AAC5B,4CAAyC;AACzC,qDAAkD;AAClD,qDAAsD;AACtD,2CAA0D;AAC1D,uEAAoE;AAYpE,8CAM4B;AAL1B,yGAAA,cAAc,OAAA;AACd,sGAAA,WAAW,OAAA;AACX,gHAAA,qBAAqB,OAAA;AACrB,kHAAA,uBAAuB,OAAA;AACvB,qGAAA,UAAU,OAAA;AAEZ,+CAAmD;AAA1C,gGAAA,GAAG,OAAA;AAAE,sGAAA,SAAS,OAAA;AAyBvB;;;GAGG;AACH,MAAa,WAAW;IAKtB;;;;OAIG;IACH,YAAY,MAAc,EAAE,OAA4B;QAgExD;;;;WAIG;QACH,iBAAY,GAAG,YAEQ,EAAE,iDADvB,SAAoC,IAAI;YAExC,MAAM,QAAQ,GAAG,MAAM,IAAA,2CAAoB,EACzC,IAAI,EACJ,yBAAa,CAAC,SAAS,EACvB,KAAK,EACL,IAAI,EACJ,MAAM,CACP,CAAC;YACF,OAAO,IAAI,CAAC,gBAAgB,CAAC,QAAQ,EAAE,wBAAc,CAAC,CAAC;QACzD,CAAC,CAAA,CAAC;QA/EA,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG;YACZ,QAAQ,EAAE,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,KAAI,eAAM,CAAC,QAAQ;YAC9C,MAAM,EAAE,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,KAAI,eAAM,CAAC,MAAM;YACxC,OAAO,EAAE,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,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OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;QACpD,CAAC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF;AApND,kCAoNC;AAED,kBAAe,WAAW,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { apiEndpoint } from "../constants/endpoints";
|
|
2
2
|
import { TimeZestAPI } from "../index";
|
|
3
|
+
import { TQLFilter } from "./tqlFilter";
|
|
3
4
|
/**
|
|
4
5
|
* Makes a paginated API request.
|
|
5
6
|
* @template T - The type of the response data.
|
|
@@ -7,7 +8,7 @@ import { TimeZestAPI } from "../index";
|
|
|
7
8
|
* @param endpoint - The API endpoint to call.
|
|
8
9
|
* @param method - The HTTP method (GET or POST).
|
|
9
10
|
* @param data - The request payload.
|
|
10
|
-
* @param filter - An optional filter string.
|
|
11
|
+
* @param filter - An optional filter string or TQLFilter instance.
|
|
11
12
|
* @returns A promise that resolves to an array of response data.
|
|
12
13
|
*/
|
|
13
|
-
export declare const makePaginatedRequest: <T>(apiInstance: TimeZestAPI, endpoint: apiEndpoint, method?: "GET" | "POST", data?: any, filter?: string | null) => Promise<T[]>;
|
|
14
|
+
export declare const makePaginatedRequest: <T>(apiInstance: TimeZestAPI, endpoint: apiEndpoint, method?: "GET" | "POST", data?: any, filter?: TQLFilter | string | null) => Promise<T[]>;
|
|
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.makePaginatedRequest = void 0;
|
|
13
13
|
const makeRequest_1 = require("./makeRequest");
|
|
14
14
|
const handleError_1 = require("./handleError");
|
|
15
|
+
const tqlFilter_1 = require("./tqlFilter");
|
|
15
16
|
/**
|
|
16
17
|
* Makes a paginated API request.
|
|
17
18
|
* @template T - The type of the response data.
|
|
@@ -19,7 +20,7 @@ const handleError_1 = require("./handleError");
|
|
|
19
20
|
* @param endpoint - The API endpoint to call.
|
|
20
21
|
* @param method - The HTTP method (GET or POST).
|
|
21
22
|
* @param data - The request payload.
|
|
22
|
-
* @param filter - An optional filter string.
|
|
23
|
+
* @param filter - An optional filter string or TQLFilter instance.
|
|
23
24
|
* @returns A promise that resolves to an array of response data.
|
|
24
25
|
*/
|
|
25
26
|
const makePaginatedRequest = (apiInstance_1, endpoint_1, ...args_1) => __awaiter(void 0, [apiInstance_1, endpoint_1, ...args_1], void 0, function* (apiInstance, endpoint, method = "GET", data = null, filter = null) {
|
|
@@ -31,7 +32,7 @@ const makePaginatedRequest = (apiInstance_1, endpoint_1, ...args_1) => __awaiter
|
|
|
31
32
|
try {
|
|
32
33
|
do {
|
|
33
34
|
log("debug", `Fetching page ${nextPage} for ${endpoint}`);
|
|
34
|
-
const response = yield (0, makeRequest_1.makeRequest)(log, apiKey, baseUrl, endpoint, method, Object.assign(Object.assign({}, data), { filter, page: nextPage }), maxRetryTimeMs, maxRetryDelayMs);
|
|
35
|
+
const response = yield (0, makeRequest_1.makeRequest)(log, apiKey, baseUrl, endpoint, method, Object.assign(Object.assign({}, data), { filter: (0, tqlFilter_1.normalizeFilter)(filter), page: nextPage }), maxRetryTimeMs, maxRetryDelayMs);
|
|
35
36
|
log("http", `Page ${nextPage} fetched successfully for ${endpoint}`);
|
|
36
37
|
results = results.concat(response.data);
|
|
37
38
|
nextPage = response.next_page;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"makePaginatedRequest.js","sourceRoot":"","sources":["../../src/utils/makePaginatedRequest.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAA4C;AAC5C,+CAA4C;AAG5C,2CAAyD;AAEzD;;;;;;;;;GASG;AACI,MAAM,oBAAoB,GAAG,uCAMpB,EAAE,8EALhB,WAAwB,EACxB,QAAqB,EACrB,SAAyB,KAAK,EAC9B,OAAY,IAAI,EAChB,SAAoC,IAAI;IAExC,MAAM,EAAE,GAAG,EAAE,GAAG,WAAW,CAAC;IAC5B,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49
|
}
|
|
50
50
|
catch (error) {
|
|
51
51
|
if (((_a = error.response) === null || _a === void 0 ? void 0 : _a.status) === 429) {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
// Parse Retry-After header (can be in seconds or HTTP date format)
|
|
53
|
+
let retryAfterMs;
|
|
54
|
+
const retryAfterHeader = error.response.headers["retry-after"];
|
|
55
|
+
if (retryAfterHeader) {
|
|
56
|
+
const retryAfterSeconds = parseInt(retryAfterHeader, 10);
|
|
57
|
+
if (!isNaN(retryAfterSeconds)) {
|
|
58
|
+
retryAfterMs = retryAfterSeconds * 1000;
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
// HTTP date format - calculate difference
|
|
62
|
+
const retryDate = new Date(retryAfterHeader);
|
|
63
|
+
if (isNaN(retryDate.getTime())) {
|
|
64
|
+
// Invalid date, fall back to exponential backoff
|
|
65
|
+
const baseDelayMs = Math.pow(2, retries) * 1000;
|
|
66
|
+
const jitterFactor = 0.75 + Math.random() * 0.5; // Random between 0.75 and 1.25
|
|
67
|
+
retryAfterMs = baseDelayMs * jitterFactor;
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
retryAfterMs = Math.max(0, retryDate.getTime() - Date.now());
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
// No Retry-After header - use aggressive exponential backoff
|
|
76
|
+
// Start at 1 second, grow rapidly: 1s, 2s, 4s, 8s, 16s, 32s, 64s
|
|
77
|
+
const baseDelayMs = Math.pow(2, retries) * 1000;
|
|
78
|
+
// Add jitter (random ±25%) to prevent thundering herd
|
|
79
|
+
// If multiple clients hit 429 at the same time, they'll retry at different times
|
|
80
|
+
const jitterFactor = 0.75 + Math.random() * 0.5; // Random between 0.75 and 1.25
|
|
81
|
+
retryAfterMs = baseDelayMs * jitterFactor;
|
|
82
|
+
}
|
|
83
|
+
// Cap at maxRetryDelayMs
|
|
84
|
+
retryAfterMs = Math.min(maxRetryDelayMs, retryAfterMs);
|
|
85
|
+
if (totalElapsedTime + retryAfterMs >= maxRetryTimeMs) {
|
|
55
86
|
log("error", `Max retry time exceeded for ${endpoint}`);
|
|
56
87
|
break;
|
|
57
88
|
}
|
|
58
|
-
log("warn", `Rate limited on ${endpoint}. Retrying after ${
|
|
59
|
-
yield new Promise((resolve) => setTimeout(resolve,
|
|
60
|
-
totalElapsedTime +=
|
|
89
|
+
log("warn", `Rate limited (429) on ${endpoint}. Retrying after ${(retryAfterMs / 1000).toFixed(2)} seconds... (attempt ${retries + 1})`);
|
|
90
|
+
yield new Promise((resolve) => setTimeout(resolve, retryAfterMs));
|
|
91
|
+
totalElapsedTime += retryAfterMs;
|
|
61
92
|
retries++;
|
|
62
93
|
}
|
|
63
94
|
else {
|
|
@@ -66,7 +97,7 @@ function makeRequest(log, apiKey, baseUrl, endpoint, method, data, maxRetryTimeM
|
|
|
66
97
|
}
|
|
67
98
|
}
|
|
68
99
|
}
|
|
69
|
-
throw new Error(`Max retry time of ${maxRetryTimeMs}
|
|
100
|
+
throw new Error(`Max retry time of ${maxRetryTimeMs / 1000} seconds exceeded for ${endpoint}`);
|
|
70
101
|
});
|
|
71
102
|
}
|
|
72
103
|
//# sourceMappingURL=makeRequest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"makeRequest.js","sourceRoot":"","sources":["../../src/utils/makeRequest.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAkBA,kCA4FC;AA9GD,kDAA0B;AAC1B,+CAA4C;AAI5C;;;;;;;;;;;;GAYG;AACH,SAAsB,WAAW,CAC/B,GAA2D,EAC3D,MAAc,EACd,OAAe,EACf,QAAqB,EACrB,MAAsB,EACtB,IAAS,EACT,cAAsB,EACtB,eAAuB;;;QAEvB,IAAI,gBAAgB,GAAG,CAAC,CAAC;QACzB,IAAI,OAAO,GAAG,CAAC,CAAC;QAEhB,OAAO,gBAAgB,GAAG,cAAc,EAAE,CAAC;YACzC,IAAI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K,CAAC,CAAC;gBAC1B,CAAC;YACH,CAAC;QACH,CAAC;QAED,MAAM,IAAI,KAAK,CACb,qBAAqB,cAAc,GAAG,IAAI,yBAAyB,QAAQ,EAAE,CAC9E,CAAC;IACJ,CAAC;CAAA"}
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TimeZest Query Language (TQL) Filter Builder
|
|
3
|
+
*
|
|
4
|
+
* Provides a user-friendly, fluent API for constructing valid TQL filters.
|
|
5
|
+
* Based on the TimeZest TQL documentation: https://developer.timezest.com/tql/
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* // Type-safe filtering with autocomplete (recommended)
|
|
10
|
+
* const filter = TQL.forSchedulingRequests()
|
|
11
|
+
* .filter('status').eq('scheduled');
|
|
12
|
+
*
|
|
13
|
+
* // Type-safe chaining with AND/OR
|
|
14
|
+
* const filter = TQL.forSchedulingRequests()
|
|
15
|
+
* .filter('end_user_email').like('@example.com')
|
|
16
|
+
* .and('status').eq('scheduled');
|
|
17
|
+
*
|
|
18
|
+
* // Using with API - no toString() needed!
|
|
19
|
+
* const requests = await timeZest.getSchedulingRequests(
|
|
20
|
+
* TQL.forSchedulingRequests().filter('status').eq('scheduled')
|
|
21
|
+
* );
|
|
22
|
+
*
|
|
23
|
+
* // Flexible filtering (no type checking, still works)
|
|
24
|
+
* const filter = TQL.filter('scheduling_request.status').eq('scheduled');
|
|
25
|
+
*
|
|
26
|
+
* // Call toString() explicitly if you need the string
|
|
27
|
+
* const filterString = TQL.forAgents().filter('name').like('John').toString();
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
import type { Agent, Resource, Team, AppointmentType, SchedulingRequest } from "../entities/entities";
|
|
31
|
+
/**
|
|
32
|
+
* Union of all valid TQL attribute paths.
|
|
33
|
+
* This is automatically inferred from entity types when using the type-safe helpers.
|
|
34
|
+
*/
|
|
35
|
+
export type TQLAttribute = `agent.${keyof Agent & string}` | `resource.${keyof Resource & string}` | `team.${keyof Team & string}` | `appointment_type.${keyof AppointmentType & string}` | `scheduling_request.${keyof SchedulingRequest & string}`;
|
|
36
|
+
/**
|
|
37
|
+
* Represents a TQL filter being constructed.
|
|
38
|
+
*/
|
|
39
|
+
export declare class TQLFilter<TAttribute extends string = string> {
|
|
40
|
+
private predicates;
|
|
41
|
+
private logicalOperators;
|
|
42
|
+
private entityPrefix;
|
|
43
|
+
private currentAttribute;
|
|
44
|
+
private currentOperator;
|
|
45
|
+
private currentValue;
|
|
46
|
+
/**
|
|
47
|
+
* Creates a new TQL filter starting with the given attribute.
|
|
48
|
+
* @param attribute - The attribute to filter on (e.g., 'scheduling_request.status')
|
|
49
|
+
* @param entityPrefix - Optional prefix for this entity type (e.g., 'scheduling_request')
|
|
50
|
+
*/
|
|
51
|
+
constructor(attribute: TAttribute, entityPrefix?: string);
|
|
52
|
+
/**
|
|
53
|
+
* Adds a completed predicate and starts a new one.
|
|
54
|
+
*/
|
|
55
|
+
private finalizePredicate;
|
|
56
|
+
/**
|
|
57
|
+
* Sets the operator and value for comparison operations.
|
|
58
|
+
*/
|
|
59
|
+
private setComparison;
|
|
60
|
+
/**
|
|
61
|
+
* Equals operator (EQ)
|
|
62
|
+
* @param value - The value to compare against
|
|
63
|
+
*/
|
|
64
|
+
eq(value: string | number): this;
|
|
65
|
+
/**
|
|
66
|
+
* Not equals operator (NOT_EQ)
|
|
67
|
+
* @param value - The value to compare against
|
|
68
|
+
*/
|
|
69
|
+
notEq(value: string | number): this;
|
|
70
|
+
/**
|
|
71
|
+
* Like operator (contains pattern matching)
|
|
72
|
+
* @param value - The pattern to match against
|
|
73
|
+
*/
|
|
74
|
+
like(value: string): this;
|
|
75
|
+
/**
|
|
76
|
+
* Not like operator (does not contain pattern)
|
|
77
|
+
* @param value - The pattern to exclude
|
|
78
|
+
*/
|
|
79
|
+
notLike(value: string): this;
|
|
80
|
+
/**
|
|
81
|
+
* In operator (value is in the provided array)
|
|
82
|
+
* @param values - Array of values to match against
|
|
83
|
+
*/
|
|
84
|
+
in(values: string[] | number[]): this;
|
|
85
|
+
/**
|
|
86
|
+
* Not in operator (value is not in the provided array)
|
|
87
|
+
* @param values - Array of values to exclude
|
|
88
|
+
*/
|
|
89
|
+
notIn(values: string[] | number[]): this;
|
|
90
|
+
/**
|
|
91
|
+
* Greater than operator (GT)
|
|
92
|
+
* @param value - The value to compare against
|
|
93
|
+
*/
|
|
94
|
+
gt(value: number): this;
|
|
95
|
+
/**
|
|
96
|
+
* Greater than or equal operator (GTE)
|
|
97
|
+
* @param value - The value to compare against
|
|
98
|
+
*/
|
|
99
|
+
gte(value: number): this;
|
|
100
|
+
/**
|
|
101
|
+
* Less than operator (LT)
|
|
102
|
+
* @param value - The value to compare against
|
|
103
|
+
*/
|
|
104
|
+
lt(value: number): this;
|
|
105
|
+
/**
|
|
106
|
+
* Less than or equal operator (LTE)
|
|
107
|
+
* @param value - The value to compare against
|
|
108
|
+
*/
|
|
109
|
+
lte(value: number): this;
|
|
110
|
+
/**
|
|
111
|
+
* Adds an AND logical operator and starts a new predicate with the given attribute.
|
|
112
|
+
* If this filter was created with an entity prefix and you pass just a property name,
|
|
113
|
+
* it will automatically prepend the entity prefix.
|
|
114
|
+
* @param attribute - The attribute for the next predicate (full path or property name if using entity prefix)
|
|
115
|
+
*/
|
|
116
|
+
and(attribute: TAttribute | string): this;
|
|
117
|
+
/**
|
|
118
|
+
* Adds an OR logical operator and starts a new predicate with the given attribute.
|
|
119
|
+
* If this filter was created with an entity prefix and you pass just a property name,
|
|
120
|
+
* it will automatically prepend the entity prefix.
|
|
121
|
+
* @param attribute - The attribute for the next predicate (full path or property name if using entity prefix)
|
|
122
|
+
*/
|
|
123
|
+
or(attribute: TAttribute | string): this;
|
|
124
|
+
/**
|
|
125
|
+
* Formats a value for TQL output.
|
|
126
|
+
* Handles arrays, strings with special characters, and numbers.
|
|
127
|
+
*/
|
|
128
|
+
private formatValue;
|
|
129
|
+
/**
|
|
130
|
+
* Formats a single value for TQL output.
|
|
131
|
+
*/
|
|
132
|
+
private formatSingleValue;
|
|
133
|
+
/**
|
|
134
|
+
* Replaces spaces with tildes outside of quoted strings.
|
|
135
|
+
* This is needed for URL encoding while preserving spaces inside quoted values.
|
|
136
|
+
* Handles escaped quotes properly (e.g., "value with \"quotes\"").
|
|
137
|
+
* @param str - The string to process
|
|
138
|
+
* @returns The string with spaces outside quotes replaced by tildes
|
|
139
|
+
*/
|
|
140
|
+
private replaceSpacesOutsideQuotes;
|
|
141
|
+
/**
|
|
142
|
+
* Converts the filter to a TQL string suitable for API requests.
|
|
143
|
+
* In URLs, spaces are replaced with tildes (~).
|
|
144
|
+
* @param urlEncode - If true, replaces spaces with ~ for URL encoding (default: true)
|
|
145
|
+
* @returns The TQL filter string
|
|
146
|
+
*/
|
|
147
|
+
toString(urlEncode?: boolean): string;
|
|
148
|
+
/**
|
|
149
|
+
* Returns the filter as a plain string with spaces (not URL encoded).
|
|
150
|
+
* Useful for debugging or when you need the human-readable format.
|
|
151
|
+
*/
|
|
152
|
+
toHumanReadableString(): string;
|
|
153
|
+
/**
|
|
154
|
+
* Returns the string representation when converted to a primitive.
|
|
155
|
+
* This allows TQLFilter to be used directly without calling toString().
|
|
156
|
+
*/
|
|
157
|
+
valueOf(): string;
|
|
158
|
+
/**
|
|
159
|
+
* Custom primitive conversion for string contexts.
|
|
160
|
+
* Allows TQLFilter to be used directly in places expecting strings.
|
|
161
|
+
*/
|
|
162
|
+
[Symbol.toPrimitive](hint: "string" | "number" | "default"): string;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Normalizes a filter value to a string.
|
|
166
|
+
* Converts TQLFilter instances to strings, leaves strings as-is, and returns null for null.
|
|
167
|
+
* @param filter - The filter value (TQLFilter, string, or null)
|
|
168
|
+
* @returns The normalized filter string or null
|
|
169
|
+
*/
|
|
170
|
+
export declare function normalizeFilter(filter: TQLFilter | string | null): string | null;
|
|
171
|
+
/**
|
|
172
|
+
* Helper class for building type-safe filters for specific entity types.
|
|
173
|
+
* Provides autocomplete and type checking for entity properties.
|
|
174
|
+
*/
|
|
175
|
+
declare class TypedTQLFilterBuilder<T extends Record<string, any>> {
|
|
176
|
+
private prefix;
|
|
177
|
+
constructor(prefix: string);
|
|
178
|
+
/**
|
|
179
|
+
* Starts a filter with a type-safe attribute from the entity.
|
|
180
|
+
* @param attribute - A valid property key from the entity type
|
|
181
|
+
* @returns A TQLFilter instance for method chaining (with entity prefix stored)
|
|
182
|
+
*/
|
|
183
|
+
filter<K extends keyof T>(attribute: K): TQLFilter<`${string}.${string & K}`>;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* TQL Filter Builder
|
|
187
|
+
* Provides a user-friendly, fluent API for constructing TimeZest Query Language filters.
|
|
188
|
+
*/
|
|
189
|
+
export declare class TQL {
|
|
190
|
+
/**
|
|
191
|
+
* Starts building a TQL filter with the given attribute.
|
|
192
|
+
* Use this for flexibility - no type checking on the attribute.
|
|
193
|
+
* For type-safe filtering, use the endpoint-specific helpers like `TQL.forAgents()`.
|
|
194
|
+
*
|
|
195
|
+
* @param attribute - The attribute to filter on (e.g., 'scheduling_request.status')
|
|
196
|
+
* @returns A TQLFilter instance for method chaining
|
|
197
|
+
*
|
|
198
|
+
* @example
|
|
199
|
+
* ```typescript
|
|
200
|
+
* TQL.filter('scheduling_request.status').eq('scheduled')
|
|
201
|
+
* ```
|
|
202
|
+
*/
|
|
203
|
+
static filter(attribute: string): TQLFilter<string>;
|
|
204
|
+
/**
|
|
205
|
+
* Creates a type-safe filter builder for Agent entities.
|
|
206
|
+
* Provides autocomplete and type checking for Agent attributes.
|
|
207
|
+
*
|
|
208
|
+
* @example
|
|
209
|
+
* ```typescript
|
|
210
|
+
* TQL.forAgents().filter('name').like('John')
|
|
211
|
+
* TQL.forAgents().filter('email').eq('user@example.com')
|
|
212
|
+
* ```
|
|
213
|
+
*/
|
|
214
|
+
static forAgents(): TypedTQLFilterBuilder<Agent>;
|
|
215
|
+
/**
|
|
216
|
+
* Creates a type-safe filter builder for Resource entities.
|
|
217
|
+
* Provides autocomplete and type checking for Resource attributes.
|
|
218
|
+
*
|
|
219
|
+
* @example
|
|
220
|
+
* ```typescript
|
|
221
|
+
* TQL.forResources().filter('name').like('Room')
|
|
222
|
+
* TQL.forResources().filter('schedulable').eq(true)
|
|
223
|
+
* ```
|
|
224
|
+
*/
|
|
225
|
+
static forResources(): TypedTQLFilterBuilder<Resource>;
|
|
226
|
+
/**
|
|
227
|
+
* Creates a type-safe filter builder for Team entities.
|
|
228
|
+
* Provides autocomplete and type checking for Team attributes.
|
|
229
|
+
*
|
|
230
|
+
* @example
|
|
231
|
+
* ```typescript
|
|
232
|
+
* TQL.forTeams().filter('internal_name').eq('Tier1')
|
|
233
|
+
* TQL.forTeams().filter('team_type').eq('support')
|
|
234
|
+
* ```
|
|
235
|
+
*/
|
|
236
|
+
static forTeams(): TypedTQLFilterBuilder<Team>;
|
|
237
|
+
/**
|
|
238
|
+
* Creates a type-safe filter builder for AppointmentType entities.
|
|
239
|
+
* Provides autocomplete and type checking for AppointmentType attributes.
|
|
240
|
+
*
|
|
241
|
+
* @example
|
|
242
|
+
* ```typescript
|
|
243
|
+
* TQL.forAppointmentTypes().filter('internal_name').eq('consultation')
|
|
244
|
+
* TQL.forAppointmentTypes().filter('duration_mins').gte(30)
|
|
245
|
+
* ```
|
|
246
|
+
*/
|
|
247
|
+
static forAppointmentTypes(): TypedTQLFilterBuilder<AppointmentType>;
|
|
248
|
+
/**
|
|
249
|
+
* Creates a type-safe filter builder for SchedulingRequest entities.
|
|
250
|
+
* Provides autocomplete and type checking for SchedulingRequest attributes.
|
|
251
|
+
*
|
|
252
|
+
* @example
|
|
253
|
+
* ```typescript
|
|
254
|
+
* TQL.forSchedulingRequests().filter('status').eq('scheduled')
|
|
255
|
+
* TQL.forSchedulingRequests().filter('end_user_email').like('@example.com')
|
|
256
|
+
* ```
|
|
257
|
+
*/
|
|
258
|
+
static forSchedulingRequests(): TypedTQLFilterBuilder<SchedulingRequest>;
|
|
259
|
+
}
|
|
260
|
+
export default TQL;
|
|
@@ -0,0 +1,444 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* TimeZest Query Language (TQL) Filter Builder
|
|
4
|
+
*
|
|
5
|
+
* Provides a user-friendly, fluent API for constructing valid TQL filters.
|
|
6
|
+
* Based on the TimeZest TQL documentation: https://developer.timezest.com/tql/
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* // Type-safe filtering with autocomplete (recommended)
|
|
11
|
+
* const filter = TQL.forSchedulingRequests()
|
|
12
|
+
* .filter('status').eq('scheduled');
|
|
13
|
+
*
|
|
14
|
+
* // Type-safe chaining with AND/OR
|
|
15
|
+
* const filter = TQL.forSchedulingRequests()
|
|
16
|
+
* .filter('end_user_email').like('@example.com')
|
|
17
|
+
* .and('status').eq('scheduled');
|
|
18
|
+
*
|
|
19
|
+
* // Using with API - no toString() needed!
|
|
20
|
+
* const requests = await timeZest.getSchedulingRequests(
|
|
21
|
+
* TQL.forSchedulingRequests().filter('status').eq('scheduled')
|
|
22
|
+
* );
|
|
23
|
+
*
|
|
24
|
+
* // Flexible filtering (no type checking, still works)
|
|
25
|
+
* const filter = TQL.filter('scheduling_request.status').eq('scheduled');
|
|
26
|
+
*
|
|
27
|
+
* // Call toString() explicitly if you need the string
|
|
28
|
+
* const filterString = TQL.forAgents().filter('name').like('John').toString();
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
+
exports.TQL = exports.TQLFilter = void 0;
|
|
33
|
+
exports.normalizeFilter = normalizeFilter;
|
|
34
|
+
/**
|
|
35
|
+
* Represents a TQL filter being constructed.
|
|
36
|
+
*/
|
|
37
|
+
class TQLFilter {
|
|
38
|
+
/**
|
|
39
|
+
* Creates a new TQL filter starting with the given attribute.
|
|
40
|
+
* @param attribute - The attribute to filter on (e.g., 'scheduling_request.status')
|
|
41
|
+
* @param entityPrefix - Optional prefix for this entity type (e.g., 'scheduling_request')
|
|
42
|
+
*/
|
|
43
|
+
constructor(attribute, entityPrefix) {
|
|
44
|
+
this.predicates = [];
|
|
45
|
+
this.logicalOperators = [];
|
|
46
|
+
this.entityPrefix = null;
|
|
47
|
+
this.currentAttribute = null;
|
|
48
|
+
this.currentOperator = null;
|
|
49
|
+
this.currentValue = null;
|
|
50
|
+
this.currentAttribute = attribute;
|
|
51
|
+
this.entityPrefix = entityPrefix || null;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Adds a completed predicate and starts a new one.
|
|
55
|
+
*/
|
|
56
|
+
finalizePredicate() {
|
|
57
|
+
if (this.currentAttribute &&
|
|
58
|
+
this.currentOperator !== null &&
|
|
59
|
+
this.currentValue !== null) {
|
|
60
|
+
this.predicates.push({
|
|
61
|
+
attribute: this.currentAttribute,
|
|
62
|
+
operator: this.currentOperator,
|
|
63
|
+
value: this.currentValue,
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
this.currentAttribute = null;
|
|
67
|
+
this.currentOperator = null;
|
|
68
|
+
this.currentValue = null;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Sets the operator and value for comparison operations.
|
|
72
|
+
*/
|
|
73
|
+
setComparison(operator, value) {
|
|
74
|
+
if (!this.currentAttribute) {
|
|
75
|
+
throw new Error("Must call filter() or and() or or() before using comparison operators");
|
|
76
|
+
}
|
|
77
|
+
this.currentOperator = operator;
|
|
78
|
+
this.currentValue = value;
|
|
79
|
+
this.finalizePredicate();
|
|
80
|
+
return this;
|
|
81
|
+
}
|
|
82
|
+
// String comparison operators
|
|
83
|
+
/**
|
|
84
|
+
* Equals operator (EQ)
|
|
85
|
+
* @param value - The value to compare against
|
|
86
|
+
*/
|
|
87
|
+
eq(value) {
|
|
88
|
+
return this.setComparison("EQ", value);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Not equals operator (NOT_EQ)
|
|
92
|
+
* @param value - The value to compare against
|
|
93
|
+
*/
|
|
94
|
+
notEq(value) {
|
|
95
|
+
return this.setComparison("NOT_EQ", value);
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Like operator (contains pattern matching)
|
|
99
|
+
* @param value - The pattern to match against
|
|
100
|
+
*/
|
|
101
|
+
like(value) {
|
|
102
|
+
return this.setComparison("LIKE", value);
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Not like operator (does not contain pattern)
|
|
106
|
+
* @param value - The pattern to exclude
|
|
107
|
+
*/
|
|
108
|
+
notLike(value) {
|
|
109
|
+
return this.setComparison("NOT_LIKE", value);
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* In operator (value is in the provided array)
|
|
113
|
+
* @param values - Array of values to match against
|
|
114
|
+
*/
|
|
115
|
+
in(values) {
|
|
116
|
+
if (!Array.isArray(values) || values.length === 0) {
|
|
117
|
+
throw new Error("IN operator requires a non-empty array");
|
|
118
|
+
}
|
|
119
|
+
return this.setComparison("IN", values);
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Not in operator (value is not in the provided array)
|
|
123
|
+
* @param values - Array of values to exclude
|
|
124
|
+
*/
|
|
125
|
+
notIn(values) {
|
|
126
|
+
if (!Array.isArray(values) || values.length === 0) {
|
|
127
|
+
throw new Error("NOT_IN operator requires a non-empty array");
|
|
128
|
+
}
|
|
129
|
+
return this.setComparison("NOT_IN", values);
|
|
130
|
+
}
|
|
131
|
+
// Numeric/timestamp comparison operators
|
|
132
|
+
/**
|
|
133
|
+
* Greater than operator (GT)
|
|
134
|
+
* @param value - The value to compare against
|
|
135
|
+
*/
|
|
136
|
+
gt(value) {
|
|
137
|
+
return this.setComparison("GT", value);
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Greater than or equal operator (GTE)
|
|
141
|
+
* @param value - The value to compare against
|
|
142
|
+
*/
|
|
143
|
+
gte(value) {
|
|
144
|
+
return this.setComparison("GTE", value);
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Less than operator (LT)
|
|
148
|
+
* @param value - The value to compare against
|
|
149
|
+
*/
|
|
150
|
+
lt(value) {
|
|
151
|
+
return this.setComparison("LT", value);
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Less than or equal operator (LTE)
|
|
155
|
+
* @param value - The value to compare against
|
|
156
|
+
*/
|
|
157
|
+
lte(value) {
|
|
158
|
+
return this.setComparison("LTE", value);
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Adds an AND logical operator and starts a new predicate with the given attribute.
|
|
162
|
+
* If this filter was created with an entity prefix and you pass just a property name,
|
|
163
|
+
* it will automatically prepend the entity prefix.
|
|
164
|
+
* @param attribute - The attribute for the next predicate (full path or property name if using entity prefix)
|
|
165
|
+
*/
|
|
166
|
+
and(attribute) {
|
|
167
|
+
if (this.predicates.length === 0) {
|
|
168
|
+
throw new Error("Must have at least one predicate before using AND");
|
|
169
|
+
}
|
|
170
|
+
this.logicalOperators.push("AND");
|
|
171
|
+
// If we have an entity prefix and the attribute doesn't contain a dot, prepend the prefix
|
|
172
|
+
if (this.entityPrefix && !attribute.includes(".")) {
|
|
173
|
+
this.currentAttribute = `${this.entityPrefix}.${attribute}`;
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
this.currentAttribute = attribute;
|
|
177
|
+
}
|
|
178
|
+
return this;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Adds an OR logical operator and starts a new predicate with the given attribute.
|
|
182
|
+
* If this filter was created with an entity prefix and you pass just a property name,
|
|
183
|
+
* it will automatically prepend the entity prefix.
|
|
184
|
+
* @param attribute - The attribute for the next predicate (full path or property name if using entity prefix)
|
|
185
|
+
*/
|
|
186
|
+
or(attribute) {
|
|
187
|
+
if (this.predicates.length === 0) {
|
|
188
|
+
throw new Error("Must have at least one predicate before using OR");
|
|
189
|
+
}
|
|
190
|
+
this.logicalOperators.push("OR");
|
|
191
|
+
// If we have an entity prefix and the attribute doesn't contain a dot, prepend the prefix
|
|
192
|
+
if (this.entityPrefix && !attribute.includes(".")) {
|
|
193
|
+
this.currentAttribute = `${this.entityPrefix}.${attribute}`;
|
|
194
|
+
}
|
|
195
|
+
else {
|
|
196
|
+
this.currentAttribute = attribute;
|
|
197
|
+
}
|
|
198
|
+
return this;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Formats a value for TQL output.
|
|
202
|
+
* Handles arrays, strings with special characters, and numbers.
|
|
203
|
+
*/
|
|
204
|
+
formatValue(value) {
|
|
205
|
+
if (Array.isArray(value)) {
|
|
206
|
+
// Arrays are comma-separated (no spaces) according to TQL spec
|
|
207
|
+
return value.map((v) => this.formatSingleValue(v)).join(",");
|
|
208
|
+
}
|
|
209
|
+
return this.formatSingleValue(value);
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Formats a single value for TQL output.
|
|
213
|
+
*/
|
|
214
|
+
formatSingleValue(value) {
|
|
215
|
+
if (typeof value === "number") {
|
|
216
|
+
return String(value);
|
|
217
|
+
}
|
|
218
|
+
// Strings containing spaces, commas, tildes, backslashes, or quotes should be enclosed in quotes
|
|
219
|
+
if (/[\s,~"\\]/.test(value) || value === "") {
|
|
220
|
+
// Escape backslashes and quotes in the value to prevent injection issues
|
|
221
|
+
const escaped = value.replace(/[\\"]/g, "\\$&");
|
|
222
|
+
return `"${escaped}"`;
|
|
223
|
+
}
|
|
224
|
+
return value;
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Replaces spaces with tildes outside of quoted strings.
|
|
228
|
+
* This is needed for URL encoding while preserving spaces inside quoted values.
|
|
229
|
+
* Handles escaped quotes properly (e.g., "value with \"quotes\"").
|
|
230
|
+
* @param str - The string to process
|
|
231
|
+
* @returns The string with spaces outside quotes replaced by tildes
|
|
232
|
+
*/
|
|
233
|
+
replaceSpacesOutsideQuotes(str) {
|
|
234
|
+
let result = "";
|
|
235
|
+
let insideQuotes = false;
|
|
236
|
+
let i = 0;
|
|
237
|
+
while (i < str.length) {
|
|
238
|
+
const char = str[i];
|
|
239
|
+
if (char === "\\" && insideQuotes && i + 1 < str.length) {
|
|
240
|
+
// Handle escaped characters (like \")
|
|
241
|
+
result += char + str[i + 1];
|
|
242
|
+
i += 2;
|
|
243
|
+
continue;
|
|
244
|
+
}
|
|
245
|
+
if (char === '"') {
|
|
246
|
+
// Toggle quote state
|
|
247
|
+
insideQuotes = !insideQuotes;
|
|
248
|
+
result += char;
|
|
249
|
+
}
|
|
250
|
+
else if (/\s/.test(char)) {
|
|
251
|
+
// Only replace whitespace if we're NOT inside quotes
|
|
252
|
+
result += insideQuotes ? char : "~";
|
|
253
|
+
}
|
|
254
|
+
else {
|
|
255
|
+
result += char;
|
|
256
|
+
}
|
|
257
|
+
i++;
|
|
258
|
+
}
|
|
259
|
+
return result;
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Converts the filter to a TQL string suitable for API requests.
|
|
263
|
+
* In URLs, spaces are replaced with tildes (~).
|
|
264
|
+
* @param urlEncode - If true, replaces spaces with ~ for URL encoding (default: true)
|
|
265
|
+
* @returns The TQL filter string
|
|
266
|
+
*/
|
|
267
|
+
toString(urlEncode = true) {
|
|
268
|
+
// Finalize any pending predicate
|
|
269
|
+
if (this.currentAttribute &&
|
|
270
|
+
this.currentOperator !== null &&
|
|
271
|
+
this.currentValue !== null) {
|
|
272
|
+
this.finalizePredicate();
|
|
273
|
+
}
|
|
274
|
+
if (this.predicates.length === 0) {
|
|
275
|
+
throw new Error("Filter must have at least one predicate");
|
|
276
|
+
}
|
|
277
|
+
// Build the filter string
|
|
278
|
+
// Format: predicate1 [operator] predicate2 [operator] predicate3 ...
|
|
279
|
+
const parts = [];
|
|
280
|
+
for (let i = 0; i < this.predicates.length; i++) {
|
|
281
|
+
const predicate = this.predicates[i];
|
|
282
|
+
const predicateStr = `${predicate.attribute} ${predicate.operator} ${this.formatValue(predicate.value)}`;
|
|
283
|
+
parts.push(predicateStr);
|
|
284
|
+
// Add logical operator AFTER this predicate if it's not the last one
|
|
285
|
+
// logicalOperators[i] contains the operator between predicates[i] and predicates[i+1]
|
|
286
|
+
if (i < this.predicates.length - 1 && this.logicalOperators[i]) {
|
|
287
|
+
parts.push(this.logicalOperators[i]);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
let result = parts.join(" ");
|
|
291
|
+
// Replace spaces with ~ for URL encoding if requested
|
|
292
|
+
// Only replace spaces outside of quoted strings to preserve spaces in values
|
|
293
|
+
if (urlEncode) {
|
|
294
|
+
result = this.replaceSpacesOutsideQuotes(result);
|
|
295
|
+
}
|
|
296
|
+
return result;
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* Returns the filter as a plain string with spaces (not URL encoded).
|
|
300
|
+
* Useful for debugging or when you need the human-readable format.
|
|
301
|
+
*/
|
|
302
|
+
toHumanReadableString() {
|
|
303
|
+
return this.toString(false);
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Returns the string representation when converted to a primitive.
|
|
307
|
+
* This allows TQLFilter to be used directly without calling toString().
|
|
308
|
+
*/
|
|
309
|
+
valueOf() {
|
|
310
|
+
return this.toString();
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Custom primitive conversion for string contexts.
|
|
314
|
+
* Allows TQLFilter to be used directly in places expecting strings.
|
|
315
|
+
*/
|
|
316
|
+
[Symbol.toPrimitive](hint) {
|
|
317
|
+
return this.toString();
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
exports.TQLFilter = TQLFilter;
|
|
321
|
+
/**
|
|
322
|
+
* Normalizes a filter value to a string.
|
|
323
|
+
* Converts TQLFilter instances to strings, leaves strings as-is, and returns null for null.
|
|
324
|
+
* @param filter - The filter value (TQLFilter, string, or null)
|
|
325
|
+
* @returns The normalized filter string or null
|
|
326
|
+
*/
|
|
327
|
+
function normalizeFilter(filter) {
|
|
328
|
+
if (filter === null) {
|
|
329
|
+
return null;
|
|
330
|
+
}
|
|
331
|
+
if (typeof filter === "string") {
|
|
332
|
+
return filter;
|
|
333
|
+
}
|
|
334
|
+
// filter is a TQLFilter instance
|
|
335
|
+
return filter.toString();
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* Helper class for building type-safe filters for specific entity types.
|
|
339
|
+
* Provides autocomplete and type checking for entity properties.
|
|
340
|
+
*/
|
|
341
|
+
class TypedTQLFilterBuilder {
|
|
342
|
+
constructor(prefix) {
|
|
343
|
+
this.prefix = prefix;
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* Starts a filter with a type-safe attribute from the entity.
|
|
347
|
+
* @param attribute - A valid property key from the entity type
|
|
348
|
+
* @returns A TQLFilter instance for method chaining (with entity prefix stored)
|
|
349
|
+
*/
|
|
350
|
+
filter(attribute) {
|
|
351
|
+
const fullPath = `${this.prefix}.${String(attribute)}`;
|
|
352
|
+
return new TQLFilter(fullPath, this.prefix);
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
/**
|
|
356
|
+
* TQL Filter Builder
|
|
357
|
+
* Provides a user-friendly, fluent API for constructing TimeZest Query Language filters.
|
|
358
|
+
*/
|
|
359
|
+
class TQL {
|
|
360
|
+
/**
|
|
361
|
+
* Starts building a TQL filter with the given attribute.
|
|
362
|
+
* Use this for flexibility - no type checking on the attribute.
|
|
363
|
+
* For type-safe filtering, use the endpoint-specific helpers like `TQL.forAgents()`.
|
|
364
|
+
*
|
|
365
|
+
* @param attribute - The attribute to filter on (e.g., 'scheduling_request.status')
|
|
366
|
+
* @returns A TQLFilter instance for method chaining
|
|
367
|
+
*
|
|
368
|
+
* @example
|
|
369
|
+
* ```typescript
|
|
370
|
+
* TQL.filter('scheduling_request.status').eq('scheduled')
|
|
371
|
+
* ```
|
|
372
|
+
*/
|
|
373
|
+
static filter(attribute) {
|
|
374
|
+
return new TQLFilter(attribute);
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
* Creates a type-safe filter builder for Agent entities.
|
|
378
|
+
* Provides autocomplete and type checking for Agent attributes.
|
|
379
|
+
*
|
|
380
|
+
* @example
|
|
381
|
+
* ```typescript
|
|
382
|
+
* TQL.forAgents().filter('name').like('John')
|
|
383
|
+
* TQL.forAgents().filter('email').eq('user@example.com')
|
|
384
|
+
* ```
|
|
385
|
+
*/
|
|
386
|
+
static forAgents() {
|
|
387
|
+
return new TypedTQLFilterBuilder("agent");
|
|
388
|
+
}
|
|
389
|
+
/**
|
|
390
|
+
* Creates a type-safe filter builder for Resource entities.
|
|
391
|
+
* Provides autocomplete and type checking for Resource attributes.
|
|
392
|
+
*
|
|
393
|
+
* @example
|
|
394
|
+
* ```typescript
|
|
395
|
+
* TQL.forResources().filter('name').like('Room')
|
|
396
|
+
* TQL.forResources().filter('schedulable').eq(true)
|
|
397
|
+
* ```
|
|
398
|
+
*/
|
|
399
|
+
static forResources() {
|
|
400
|
+
return new TypedTQLFilterBuilder("resource");
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* Creates a type-safe filter builder for Team entities.
|
|
404
|
+
* Provides autocomplete and type checking for Team attributes.
|
|
405
|
+
*
|
|
406
|
+
* @example
|
|
407
|
+
* ```typescript
|
|
408
|
+
* TQL.forTeams().filter('internal_name').eq('Tier1')
|
|
409
|
+
* TQL.forTeams().filter('team_type').eq('support')
|
|
410
|
+
* ```
|
|
411
|
+
*/
|
|
412
|
+
static forTeams() {
|
|
413
|
+
return new TypedTQLFilterBuilder("team");
|
|
414
|
+
}
|
|
415
|
+
/**
|
|
416
|
+
* Creates a type-safe filter builder for AppointmentType entities.
|
|
417
|
+
* Provides autocomplete and type checking for AppointmentType attributes.
|
|
418
|
+
*
|
|
419
|
+
* @example
|
|
420
|
+
* ```typescript
|
|
421
|
+
* TQL.forAppointmentTypes().filter('internal_name').eq('consultation')
|
|
422
|
+
* TQL.forAppointmentTypes().filter('duration_mins').gte(30)
|
|
423
|
+
* ```
|
|
424
|
+
*/
|
|
425
|
+
static forAppointmentTypes() {
|
|
426
|
+
return new TypedTQLFilterBuilder("appointment_type");
|
|
427
|
+
}
|
|
428
|
+
/**
|
|
429
|
+
* Creates a type-safe filter builder for SchedulingRequest entities.
|
|
430
|
+
* Provides autocomplete and type checking for SchedulingRequest attributes.
|
|
431
|
+
*
|
|
432
|
+
* @example
|
|
433
|
+
* ```typescript
|
|
434
|
+
* TQL.forSchedulingRequests().filter('status').eq('scheduled')
|
|
435
|
+
* TQL.forSchedulingRequests().filter('end_user_email').like('@example.com')
|
|
436
|
+
* ```
|
|
437
|
+
*/
|
|
438
|
+
static forSchedulingRequests() {
|
|
439
|
+
return new TypedTQLFilterBuilder("scheduling_request");
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
exports.TQL = TQL;
|
|
443
|
+
exports.default = TQL;
|
|
444
|
+
//# sourceMappingURL=tqlFilter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tqlFilter.js","sourceRoot":"","sources":["../../src/utils/tqlFilter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;;;AAuXH,0CAWC;AAzVD;;GAEG;AACH,MAAa,SAAS;IAQpB;;;;OAIG;IACH,YAAY,SAAqB,EAAE,YAAqB;QAZhD,eAAU,GAAmB,EAAE,CAAC;QAChC,qBAAgB,GAAsB,EAAE,CAAC;QACzC,iBAAY,GAAkB,IAAI,CAAC;QACnC,qBAAgB,GAAsB,IAAI,CAAC;QAC3C,oBAAe,GAAuB,IAAI,CAAC;QAC3C,iBAAY,GAAiD,IAAI,CAAC;QAQxE,IAAI,CAAC,gBAAgB,GAAG,SAAS,CAAC;QAClC,IAAI,CAAC,YAAY,GAAG,YAAY,IAAI,IAAI,CAAC;IAC3C,CAAC;IAED;;OAEG;IACK,iBAAiB;QACvB,IACE,IAAI,CAAC,gBAAgB;YACrB,IAAI,CAAC,eAAe,KAAK,IAAI;Y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AAI,qBAAqB,CAAQ,OAAO,CAAC,CAAC;IACnD,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,YAAY;QACjB,OAAO,IAAI,qBAAqB,CAAW,UAAU,CAAC,CAAC;IACzD,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,QAAQ;QACb,OAAO,IAAI,qBAAqB,CAAO,MAAM,CAAC,CAAC;IACjD,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,mBAAmB;QACxB,OAAO,IAAI,qBAAqB,CAAkB,kBAAkB,CAAC,CAAC;IACxE,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,qBAAqB;QAC1B,OAAO,IAAI,qBAAqB,CAAoB,oBAAoB,CAAC,CAAC;IAC5E,CAAC;CACF;AAvFD,kBAuFC;AAED,kBAAe,GAAG,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "timezest",
|
|
3
|
-
"version": "1.1.
|
|
4
|
-
"main": "index.js",
|
|
3
|
+
"version": "1.1.5",
|
|
4
|
+
"main": "dist/index.js",
|
|
5
|
+
"files": ["dist", "README.md", "LICENSE"],
|
|
5
6
|
"scripts": {
|
|
6
7
|
"build": "tsc",
|
|
7
|
-
"test": "node dist/src/tests/test.js",
|
|
8
8
|
"format": "prettier --write .",
|
|
9
|
-
"clean": "
|
|
10
|
-
"
|
|
11
|
-
"publish": "npm run prep-publish && npm publish .\\dist"
|
|
9
|
+
"clean": "rm -rf dist",
|
|
10
|
+
"prepublishOnly": "npm run clean && npm run build"
|
|
12
11
|
},
|
|
13
12
|
"keywords": [],
|
|
14
13
|
"author": "",
|
|
15
14
|
"license": "MIT",
|
|
16
15
|
"description": "",
|
|
17
16
|
"dependencies": {
|
|
18
|
-
"axios": "^1.
|
|
19
|
-
"
|
|
20
|
-
"zod": "^3.24.3"
|
|
17
|
+
"axios": "^1.13.1",
|
|
18
|
+
"zod": "^3.25.76"
|
|
21
19
|
},
|
|
22
20
|
"devDependencies": {
|
|
23
21
|
"prettier": "^3.5.3",
|
package/config/config.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config/config.ts"],"names":[],"mappings":";;;AAAA,4CAAkE;AAqClE;;GAEG;AACU,QAAA,MAAM,GAAsB;IACvC,QAAQ,EAAE,OAAO;IACjB,MAAM,EAAE,sBAAa;IACrB,OAAO,EAAE,6BAA6B;IACtC,eAAe,EAAE,GAAG,GAAG,EAAE,GAAG,IAAI,EAAE,cAAc;IAChD,cAAc,EAAE,EAAE,GAAG,IAAI,EAAE,aAAa;IACxC,gBAAgB,EAAE,IAAI;CACvB,CAAC"}
|
package/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAUA,gDAM4B;AAC5B,4CAAyC;AACzC,qDAAkD;AAClD,qDAAsD;AACtD,2CAA0D;AAC1D,uEAAoE;AAIpE,8CAA6H;AAApH,yGAAA,cAAc,OAAA;AAAE,sGAAA,WAAW,OAAA;AAAE,gHAAA,qBAAqB,OAAA;AAAE,kHAAA,uBAAuB,OAAA;AAAE,qGAAA,UAAU,OAAA;AAyBhG;;;GAGG;AACH,MAAa,WAAW;IAKtB;;;;OAIG;IACH,YAAY,MAAc,EAAE,OAA4B;QA6DxD;;;;WAIG;QACH,iBAAY,GAAG,YAA0D,EAAE,iDAArD,SAAwB,IAAI;YAChD,MAAM,QAAQ,GAAG,MAAM,IAAA,2CAAoB,EACzC,IAAI,EACJ,yBAAa,CAAC,SAAS,EACvB,KAAK,EACL,IAAI,EACJ,MAAM,CACP,CAAC;YACF,OAAO,IAAI,CAAC,gBAAgB,CAAC,QAAQ,EAAE,wBAAc,CAAC,CAAC;QACzD,CAAC,CAAA,CAAC;QA1EA,IAAI,CAAC,MAAM,GAAG,MAAM,CAA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CAAC;oBACF,IAAA,yBAAW,EAAC,GAAG,EAAE,KAAK,CAAC,CAAC;gBAC1B,CAAC;YACH,CAAC;QACH,CAAC;QAED,MAAM,IAAI,KAAK,CACb,qBAAqB,cAAc,yBAAyB,QAAQ,EAAE,CACvE,CAAC;IACJ,CAAC;CAAA"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|