timezest 1.1.4 → 2.0.0
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 +34 -17
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/utils/makeRequest.js +9 -1
- package/dist/utils/makeRequest.js.map +1 -1
- package/dist/utils/tqlFilter.d.ts +2 -2
- package/dist/utils/tqlFilter.js +45 -40
- package/dist/utils/tqlFilter.js.map +1 -1
- package/package.json +7 -9
package/README.md
CHANGED
|
@@ -9,6 +9,7 @@ This Node.js module provides a convenient and fully-typed interface for interact
|
|
|
9
9
|
- Automatic handling of paginated responses.
|
|
10
10
|
- Built-in support for request retries
|
|
11
11
|
- Fully typed with TypeScript for enhanced developer experience.
|
|
12
|
+
- Fluent, type-safe TQL filter builder for constructing filters programmatically.
|
|
12
13
|
|
|
13
14
|
## Installation
|
|
14
15
|
|
|
@@ -78,16 +79,16 @@ The `TimeZestAPI` supports the following methods for interacting with the TimeZe
|
|
|
78
79
|
|
|
79
80
|
```typescript
|
|
80
81
|
// Retrieve all agents
|
|
81
|
-
timeZest.getAgents(filter: string | null = null): Promise<Agent[]>
|
|
82
|
+
timeZest.getAgents(filter: TQLFilter | string | null = null): Promise<Agent[]>
|
|
82
83
|
|
|
83
84
|
// Retrieve all appointment types
|
|
84
|
-
timeZest.getAppointmentTypes(filter: string | null = null): Promise<AppointmentType[]>
|
|
85
|
+
timeZest.getAppointmentTypes(filter: TQLFilter | string | null = null): Promise<AppointmentType[]>
|
|
85
86
|
|
|
86
87
|
// Retrieve all resources
|
|
87
|
-
timeZest.getResources(filter: string | null = null): Promise<Resource[]>
|
|
88
|
+
timeZest.getResources(filter: TQLFilter | string | null = null): Promise<Resource[]>
|
|
88
89
|
|
|
89
90
|
// Retreive all scheduling reuests
|
|
90
|
-
timeZest.getSchedulingRequests(filter: string | null = null): Promise<SchedulingRequest[]>
|
|
91
|
+
timeZest.getSchedulingRequests(filter: TQLFilter | string | null = null): Promise<SchedulingRequest[]>
|
|
91
92
|
|
|
92
93
|
// Retrieve a scheduling request by id
|
|
93
94
|
timeZest.getSchedulingRequest(id: string): Promise<SchedulingRequest>
|
|
@@ -96,26 +97,41 @@ timeZest.getSchedulingRequest(id: string): Promise<SchedulingRequest>
|
|
|
96
97
|
timeZest.createSchedulingRequest(data: SchedulingRequest): Promise<SchedulingRequest>
|
|
97
98
|
|
|
98
99
|
// Retrieve all teams
|
|
99
|
-
timeZest.getTeams(filter: string | null = null): Promise<Team[]>
|
|
100
|
+
timeZest.getTeams(filter: TQLFilter | string | null = null): Promise<Team[]>
|
|
100
101
|
```
|
|
101
102
|
|
|
102
|
-
### Filtering Requests
|
|
103
|
+
### Filtering Requests (TQL)
|
|
103
104
|
|
|
104
|
-
|
|
105
|
+
You can filter results using TQL in two ways:
|
|
106
|
+
|
|
107
|
+
- Using the fluent, type-safe TQL builder (recommended)
|
|
108
|
+
- Passing a raw TQL string
|
|
109
|
+
|
|
110
|
+
Both styles are supported by all list methods.
|
|
105
111
|
|
|
106
112
|
```typescript
|
|
107
|
-
|
|
108
|
-
try {
|
|
109
|
-
const teams = await timeZest.getTeams("team.internal_name EQ Tier1");
|
|
110
|
-
console.log("Teams:", teams);
|
|
111
|
-
} catch (error) {
|
|
112
|
-
console.error("Error fetching teams:", error);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
113
|
+
import TimeZestAPI, { TQL } from "timezest";
|
|
115
114
|
|
|
116
|
-
|
|
115
|
+
const timeZest = new TimeZestAPI("your-api-key");
|
|
116
|
+
|
|
117
|
+
// 1) Type-safe builder with autocomplete
|
|
118
|
+
const teams = await timeZest.getTeams(
|
|
119
|
+
TQL.forTeams().filter("internal_name").eq("Tier1")
|
|
120
|
+
);
|
|
121
|
+
|
|
122
|
+
// You can also chain logical operators
|
|
123
|
+
const scheduledRequests = await timeZest.getSchedulingRequests(
|
|
124
|
+
TQL.forSchedulingRequests()
|
|
125
|
+
.filter("status").eq("scheduled")
|
|
126
|
+
.and("end_user_email").like("@example.com")
|
|
127
|
+
);
|
|
128
|
+
|
|
129
|
+
// 2) Raw TQL string
|
|
130
|
+
const teamsByString = await timeZest.getTeams("team.internal_name EQ Tier1");
|
|
117
131
|
```
|
|
118
132
|
|
|
133
|
+
For more about TQL syntax, see the TimeZest TQL documentation: `https://developer.timezest.com/tql/`.
|
|
134
|
+
|
|
119
135
|
### Paginated Requests
|
|
120
136
|
|
|
121
137
|
For endpoints that return paginated data, the library automatically handles pagination:
|
|
@@ -169,8 +185,9 @@ const timeZest = new TimeZestAPI("your-api-key", options);
|
|
|
169
185
|
### Retry Behavior Example
|
|
170
186
|
|
|
171
187
|
If you hit a rate limit without a `Retry-After` header, the retry delays will be:
|
|
188
|
+
|
|
172
189
|
- 1st retry: ~1 second (0.75-1.25s with jitter)
|
|
173
|
-
- 2nd retry: ~2 seconds (1.5-2.5s with jitter)
|
|
190
|
+
- 2nd retry: ~2 seconds (1.5-2.5s with jitter)
|
|
174
191
|
- 3rd retry: ~4 seconds (3-5s with jitter)
|
|
175
192
|
- 4th retry: ~8 seconds (6-10s with jitter)
|
|
176
193
|
- 5th retry: ~16 seconds (12-20s with jitter)
|
package/dist/index.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ 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
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";
|
|
5
|
+
export { Agent, Resource, AppointmentType, SchedulingRequest, SchedulingRequestPost, Team, } from "./entities/entities";
|
|
6
|
+
export { ResourceSchema, AgentSchema, AppointmentTypeSchema, SchedulingRequestSchema, TeamSchema, } from "./entities/schemas";
|
|
7
7
|
export { TQL, TQLFilter } from "./utils/tqlFilter";
|
|
8
8
|
/**
|
|
9
9
|
* Options for configuring the TimeZest API.
|
package/dist/index.js
CHANGED
|
@@ -52,7 +52,9 @@ class TimeZestAPI {
|
|
|
52
52
|
baseUrl: (options === null || options === void 0 ? void 0 : options.baseUrl) || config_1.CONFIG.baseUrl,
|
|
53
53
|
maxRetryDelayMs: (options === null || options === void 0 ? void 0 : options.maxRetryDelayMs) || config_1.CONFIG.maxRetryDelayMs,
|
|
54
54
|
maxRetryTimeMs: (options === null || options === void 0 ? void 0 : options.maxRetryTimeMs) || config_1.CONFIG.maxRetryTimeMs,
|
|
55
|
-
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,
|
|
56
58
|
};
|
|
57
59
|
this.log = (0, logger_1.buildLogger)(this.config.logger, this.config.logLevel);
|
|
58
60
|
// Log the initialization of the API client but remove apiKey
|
package/dist/index.js.map
CHANGED
|
@@ -1 +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;
|
|
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,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uB,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QACjD,CAAC;KAAA;IAED;;;;OAIG;IACG,qBAAqB;6DACzB,SAAoC,IAAI;YAExC,MAAM,QAAQ,GAAG,MAAM,IAAA,2CAAoB,EACzC,IAAI,EACJ,yBAAa,CAAC,mBAAmB,EACjC,KAAK,EACL,IAAI,EACJ,MAAM,CACP,CAAC;YACF,OAAO,IAAI,CAAC,gBAAgB,CAAC,QAAQ,EAAE,iCAAuB,CAAC,CAAC;QAClE,CAAC;KAAA;IAED;;;;OAIG;IACG,uBAAuB,CAC3B,IAA2B;;YAE3B,MAAM,QAAQ,GAAG,MAAM,IAAA,yBAAW,EAChC,IAAI,CAAC,GAAG,EACR,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,MAAM,CAAC,OAAO,EACnB,yBAAa,CAAC,mBAAmB,EACjC,MAAM,EACN,IAAI,EACJ,IAAI,CAAC,MAAM,CAAC,cAAc,EAC1B,IAAI,CAAC,MAAM,CAAC,eAAe,CAC5B,CAAC;YACF,OAAO,QAAQ,CAAC;QAClB,CAAC;KAAA;IAED;;;;;OAKG;IACK,gBAAgB,CAAI,QAAa,EAAE,MAAiB;QAC1D,IAAI,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,CAAC;YACjC,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"}
|
|
@@ -60,7 +60,15 @@ function makeRequest(log, apiKey, baseUrl, endpoint, method, data, maxRetryTimeM
|
|
|
60
60
|
else {
|
|
61
61
|
// HTTP date format - calculate difference
|
|
62
62
|
const retryDate = new Date(retryAfterHeader);
|
|
63
|
-
|
|
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
|
+
}
|
|
64
72
|
}
|
|
65
73
|
}
|
|
66
74
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"makeRequest.js","sourceRoot":"","sources":["../../src/utils/makeRequest.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAkBA,
|
|
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,CAAC;gBACH,GAAG,CACD,OAAO,EACP,yBAAyB,QAAQ,kBAAkB,OAAO,EAAE,CAC7D,CAAC;gBAEF,MAAM,QAAQ,GAAG,MAAM,IAAA,eAAK,EAAC;oBAC3B,GAAG,EAAE,GAAG,OAAO,GAAG,QAAQ,EAAE;oBAC5B,MAAM;oBACN,OAAO,EAAE;wBACP,aAAa,EAAE,UAAU,MAAM,EAAE;wBACjC,cAAc,EAAE,kBAAkB;qBACnC;oBACD,IAAI;iBACL,CAAC,CAAC;gBACH,OAAO,QAAQ,CAAC,IAAI,CAAC;YACvB,CAAC;YAAC,OAAO,KAAU,EAAE,C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GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC,+BAA+B;wBAChF,YAAY,GAAG,WAAW,GAAG,YAAY,CAAC;oBAC5C,CAAC;oBAED,yBAAyB;oBACzB,YAAY,GAAG,IAAI,CAAC,GAAG,CAAC,eAAe,EAAE,YAAY,CAAC,CAAC;oBAEvD,IAAI,gBAAgB,GAAG,YAAY,IAAI,cAAc,EAAE,CAAC;wBACtD,GAAG,CAAC,OAAO,EAAE,+BAA+B,QAAQ,EAAE,CAAC,CAAC;wBACxD,MAAM;oBACR,CAAC;oBAED,GAAG,CACD,MAAM,EACN,yBAAyB,QAAQ,oBAAoB,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,wBAAwB,OAAO,GAAG,CAAC,GAAG,CAC5H,CAAC;oBAEF,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC;oBAClE,gBAAgB,IAAI,YAAY,CAAC;oBACjC,OAAO,EAAE,CAAC;gBACZ,CAAC;qBAAM,CAAC;oBACN,GAAG,CACD,OAAO,EACP,cAAc,QAAQ,uBAAuB,KAAK,CAAC,OAAO,EAAE,CAC7D,CAAC;oBACF,IAAA,yBAAW,EAAC,GAAG,EAAE,KAAK,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"}
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
* const filterString = TQL.forAgents().filter('name').like('John').toString();
|
|
28
28
|
* ```
|
|
29
29
|
*/
|
|
30
|
-
import type { Agent, Resource, Team, AppointmentType, SchedulingRequest } from
|
|
30
|
+
import type { Agent, Resource, Team, AppointmentType, SchedulingRequest } from "../entities/entities";
|
|
31
31
|
/**
|
|
32
32
|
* Union of all valid TQL attribute paths.
|
|
33
33
|
* This is automatically inferred from entity types when using the type-safe helpers.
|
|
@@ -159,7 +159,7 @@ export declare class TQLFilter<TAttribute extends string = string> {
|
|
|
159
159
|
* Custom primitive conversion for string contexts.
|
|
160
160
|
* Allows TQLFilter to be used directly in places expecting strings.
|
|
161
161
|
*/
|
|
162
|
-
[Symbol.toPrimitive](hint:
|
|
162
|
+
[Symbol.toPrimitive](hint: "string" | "number" | "default"): string;
|
|
163
163
|
}
|
|
164
164
|
/**
|
|
165
165
|
* Normalizes a filter value to a string.
|
package/dist/utils/tqlFilter.js
CHANGED
|
@@ -44,6 +44,7 @@ class TQLFilter {
|
|
|
44
44
|
this.predicates = [];
|
|
45
45
|
this.logicalOperators = [];
|
|
46
46
|
this.entityPrefix = null;
|
|
47
|
+
this.currentAttribute = null;
|
|
47
48
|
this.currentOperator = null;
|
|
48
49
|
this.currentValue = null;
|
|
49
50
|
this.currentAttribute = attribute;
|
|
@@ -53,14 +54,16 @@ class TQLFilter {
|
|
|
53
54
|
* Adds a completed predicate and starts a new one.
|
|
54
55
|
*/
|
|
55
56
|
finalizePredicate() {
|
|
56
|
-
if (this.currentAttribute &&
|
|
57
|
+
if (this.currentAttribute &&
|
|
58
|
+
this.currentOperator !== null &&
|
|
59
|
+
this.currentValue !== null) {
|
|
57
60
|
this.predicates.push({
|
|
58
61
|
attribute: this.currentAttribute,
|
|
59
62
|
operator: this.currentOperator,
|
|
60
63
|
value: this.currentValue,
|
|
61
64
|
});
|
|
62
65
|
}
|
|
63
|
-
this.currentAttribute =
|
|
66
|
+
this.currentAttribute = null;
|
|
64
67
|
this.currentOperator = null;
|
|
65
68
|
this.currentValue = null;
|
|
66
69
|
}
|
|
@@ -69,7 +72,7 @@ class TQLFilter {
|
|
|
69
72
|
*/
|
|
70
73
|
setComparison(operator, value) {
|
|
71
74
|
if (!this.currentAttribute) {
|
|
72
|
-
throw new Error(
|
|
75
|
+
throw new Error("Must call filter() or and() or or() before using comparison operators");
|
|
73
76
|
}
|
|
74
77
|
this.currentOperator = operator;
|
|
75
78
|
this.currentValue = value;
|
|
@@ -82,28 +85,28 @@ class TQLFilter {
|
|
|
82
85
|
* @param value - The value to compare against
|
|
83
86
|
*/
|
|
84
87
|
eq(value) {
|
|
85
|
-
return this.setComparison(
|
|
88
|
+
return this.setComparison("EQ", value);
|
|
86
89
|
}
|
|
87
90
|
/**
|
|
88
91
|
* Not equals operator (NOT_EQ)
|
|
89
92
|
* @param value - The value to compare against
|
|
90
93
|
*/
|
|
91
94
|
notEq(value) {
|
|
92
|
-
return this.setComparison(
|
|
95
|
+
return this.setComparison("NOT_EQ", value);
|
|
93
96
|
}
|
|
94
97
|
/**
|
|
95
98
|
* Like operator (contains pattern matching)
|
|
96
99
|
* @param value - The pattern to match against
|
|
97
100
|
*/
|
|
98
101
|
like(value) {
|
|
99
|
-
return this.setComparison(
|
|
102
|
+
return this.setComparison("LIKE", value);
|
|
100
103
|
}
|
|
101
104
|
/**
|
|
102
105
|
* Not like operator (does not contain pattern)
|
|
103
106
|
* @param value - The pattern to exclude
|
|
104
107
|
*/
|
|
105
108
|
notLike(value) {
|
|
106
|
-
return this.setComparison(
|
|
109
|
+
return this.setComparison("NOT_LIKE", value);
|
|
107
110
|
}
|
|
108
111
|
/**
|
|
109
112
|
* In operator (value is in the provided array)
|
|
@@ -111,9 +114,9 @@ class TQLFilter {
|
|
|
111
114
|
*/
|
|
112
115
|
in(values) {
|
|
113
116
|
if (!Array.isArray(values) || values.length === 0) {
|
|
114
|
-
throw new Error(
|
|
117
|
+
throw new Error("IN operator requires a non-empty array");
|
|
115
118
|
}
|
|
116
|
-
return this.setComparison(
|
|
119
|
+
return this.setComparison("IN", values);
|
|
117
120
|
}
|
|
118
121
|
/**
|
|
119
122
|
* Not in operator (value is not in the provided array)
|
|
@@ -121,9 +124,9 @@ class TQLFilter {
|
|
|
121
124
|
*/
|
|
122
125
|
notIn(values) {
|
|
123
126
|
if (!Array.isArray(values) || values.length === 0) {
|
|
124
|
-
throw new Error(
|
|
127
|
+
throw new Error("NOT_IN operator requires a non-empty array");
|
|
125
128
|
}
|
|
126
|
-
return this.setComparison(
|
|
129
|
+
return this.setComparison("NOT_IN", values);
|
|
127
130
|
}
|
|
128
131
|
// Numeric/timestamp comparison operators
|
|
129
132
|
/**
|
|
@@ -131,28 +134,28 @@ class TQLFilter {
|
|
|
131
134
|
* @param value - The value to compare against
|
|
132
135
|
*/
|
|
133
136
|
gt(value) {
|
|
134
|
-
return this.setComparison(
|
|
137
|
+
return this.setComparison("GT", value);
|
|
135
138
|
}
|
|
136
139
|
/**
|
|
137
140
|
* Greater than or equal operator (GTE)
|
|
138
141
|
* @param value - The value to compare against
|
|
139
142
|
*/
|
|
140
143
|
gte(value) {
|
|
141
|
-
return this.setComparison(
|
|
144
|
+
return this.setComparison("GTE", value);
|
|
142
145
|
}
|
|
143
146
|
/**
|
|
144
147
|
* Less than operator (LT)
|
|
145
148
|
* @param value - The value to compare against
|
|
146
149
|
*/
|
|
147
150
|
lt(value) {
|
|
148
|
-
return this.setComparison(
|
|
151
|
+
return this.setComparison("LT", value);
|
|
149
152
|
}
|
|
150
153
|
/**
|
|
151
154
|
* Less than or equal operator (LTE)
|
|
152
155
|
* @param value - The value to compare against
|
|
153
156
|
*/
|
|
154
157
|
lte(value) {
|
|
155
|
-
return this.setComparison(
|
|
158
|
+
return this.setComparison("LTE", value);
|
|
156
159
|
}
|
|
157
160
|
/**
|
|
158
161
|
* Adds an AND logical operator and starts a new predicate with the given attribute.
|
|
@@ -162,11 +165,11 @@ class TQLFilter {
|
|
|
162
165
|
*/
|
|
163
166
|
and(attribute) {
|
|
164
167
|
if (this.predicates.length === 0) {
|
|
165
|
-
throw new Error(
|
|
168
|
+
throw new Error("Must have at least one predicate before using AND");
|
|
166
169
|
}
|
|
167
|
-
this.logicalOperators.push(
|
|
170
|
+
this.logicalOperators.push("AND");
|
|
168
171
|
// If we have an entity prefix and the attribute doesn't contain a dot, prepend the prefix
|
|
169
|
-
if (this.entityPrefix && !attribute.includes(
|
|
172
|
+
if (this.entityPrefix && !attribute.includes(".")) {
|
|
170
173
|
this.currentAttribute = `${this.entityPrefix}.${attribute}`;
|
|
171
174
|
}
|
|
172
175
|
else {
|
|
@@ -182,11 +185,11 @@ class TQLFilter {
|
|
|
182
185
|
*/
|
|
183
186
|
or(attribute) {
|
|
184
187
|
if (this.predicates.length === 0) {
|
|
185
|
-
throw new Error(
|
|
188
|
+
throw new Error("Must have at least one predicate before using OR");
|
|
186
189
|
}
|
|
187
|
-
this.logicalOperators.push(
|
|
190
|
+
this.logicalOperators.push("OR");
|
|
188
191
|
// If we have an entity prefix and the attribute doesn't contain a dot, prepend the prefix
|
|
189
|
-
if (this.entityPrefix && !attribute.includes(
|
|
192
|
+
if (this.entityPrefix && !attribute.includes(".")) {
|
|
190
193
|
this.currentAttribute = `${this.entityPrefix}.${attribute}`;
|
|
191
194
|
}
|
|
192
195
|
else {
|
|
@@ -201,7 +204,7 @@ class TQLFilter {
|
|
|
201
204
|
formatValue(value) {
|
|
202
205
|
if (Array.isArray(value)) {
|
|
203
206
|
// Arrays are comma-separated (no spaces) according to TQL spec
|
|
204
|
-
return value.map(v => this.formatSingleValue(v)).join(
|
|
207
|
+
return value.map((v) => this.formatSingleValue(v)).join(",");
|
|
205
208
|
}
|
|
206
209
|
return this.formatSingleValue(value);
|
|
207
210
|
}
|
|
@@ -209,13 +212,13 @@ class TQLFilter {
|
|
|
209
212
|
* Formats a single value for TQL output.
|
|
210
213
|
*/
|
|
211
214
|
formatSingleValue(value) {
|
|
212
|
-
if (typeof value ===
|
|
215
|
+
if (typeof value === "number") {
|
|
213
216
|
return String(value);
|
|
214
217
|
}
|
|
215
|
-
// Strings containing spaces, commas, or
|
|
216
|
-
if (/[\s,~"]/.test(value) || value ===
|
|
217
|
-
// Escape quotes in the value
|
|
218
|
-
const escaped = value.replace(/"/g,
|
|
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, "\\$&");
|
|
219
222
|
return `"${escaped}"`;
|
|
220
223
|
}
|
|
221
224
|
return value;
|
|
@@ -228,12 +231,12 @@ class TQLFilter {
|
|
|
228
231
|
* @returns The string with spaces outside quotes replaced by tildes
|
|
229
232
|
*/
|
|
230
233
|
replaceSpacesOutsideQuotes(str) {
|
|
231
|
-
let result =
|
|
234
|
+
let result = "";
|
|
232
235
|
let insideQuotes = false;
|
|
233
236
|
let i = 0;
|
|
234
237
|
while (i < str.length) {
|
|
235
238
|
const char = str[i];
|
|
236
|
-
if (char ===
|
|
239
|
+
if (char === "\\" && insideQuotes && i + 1 < str.length) {
|
|
237
240
|
// Handle escaped characters (like \")
|
|
238
241
|
result += char + str[i + 1];
|
|
239
242
|
i += 2;
|
|
@@ -244,9 +247,9 @@ class TQLFilter {
|
|
|
244
247
|
insideQuotes = !insideQuotes;
|
|
245
248
|
result += char;
|
|
246
249
|
}
|
|
247
|
-
else if (char
|
|
250
|
+
else if (/\s/.test(char)) {
|
|
248
251
|
// Only replace whitespace if we're NOT inside quotes
|
|
249
|
-
result += insideQuotes ? char :
|
|
252
|
+
result += insideQuotes ? char : "~";
|
|
250
253
|
}
|
|
251
254
|
else {
|
|
252
255
|
result += char;
|
|
@@ -263,11 +266,13 @@ class TQLFilter {
|
|
|
263
266
|
*/
|
|
264
267
|
toString(urlEncode = true) {
|
|
265
268
|
// Finalize any pending predicate
|
|
266
|
-
if (this.currentAttribute &&
|
|
269
|
+
if (this.currentAttribute &&
|
|
270
|
+
this.currentOperator !== null &&
|
|
271
|
+
this.currentValue !== null) {
|
|
267
272
|
this.finalizePredicate();
|
|
268
273
|
}
|
|
269
274
|
if (this.predicates.length === 0) {
|
|
270
|
-
throw new Error(
|
|
275
|
+
throw new Error("Filter must have at least one predicate");
|
|
271
276
|
}
|
|
272
277
|
// Build the filter string
|
|
273
278
|
// Format: predicate1 [operator] predicate2 [operator] predicate3 ...
|
|
@@ -282,7 +287,7 @@ class TQLFilter {
|
|
|
282
287
|
parts.push(this.logicalOperators[i]);
|
|
283
288
|
}
|
|
284
289
|
}
|
|
285
|
-
let result = parts.join(
|
|
290
|
+
let result = parts.join(" ");
|
|
286
291
|
// Replace spaces with ~ for URL encoding if requested
|
|
287
292
|
// Only replace spaces outside of quoted strings to preserve spaces in values
|
|
288
293
|
if (urlEncode) {
|
|
@@ -323,7 +328,7 @@ function normalizeFilter(filter) {
|
|
|
323
328
|
if (filter === null) {
|
|
324
329
|
return null;
|
|
325
330
|
}
|
|
326
|
-
if (typeof filter ===
|
|
331
|
+
if (typeof filter === "string") {
|
|
327
332
|
return filter;
|
|
328
333
|
}
|
|
329
334
|
// filter is a TQLFilter instance
|
|
@@ -379,7 +384,7 @@ class TQL {
|
|
|
379
384
|
* ```
|
|
380
385
|
*/
|
|
381
386
|
static forAgents() {
|
|
382
|
-
return new TypedTQLFilterBuilder(
|
|
387
|
+
return new TypedTQLFilterBuilder("agent");
|
|
383
388
|
}
|
|
384
389
|
/**
|
|
385
390
|
* Creates a type-safe filter builder for Resource entities.
|
|
@@ -392,7 +397,7 @@ class TQL {
|
|
|
392
397
|
* ```
|
|
393
398
|
*/
|
|
394
399
|
static forResources() {
|
|
395
|
-
return new TypedTQLFilterBuilder(
|
|
400
|
+
return new TypedTQLFilterBuilder("resource");
|
|
396
401
|
}
|
|
397
402
|
/**
|
|
398
403
|
* Creates a type-safe filter builder for Team entities.
|
|
@@ -405,7 +410,7 @@ class TQL {
|
|
|
405
410
|
* ```
|
|
406
411
|
*/
|
|
407
412
|
static forTeams() {
|
|
408
|
-
return new TypedTQLFilterBuilder(
|
|
413
|
+
return new TypedTQLFilterBuilder("team");
|
|
409
414
|
}
|
|
410
415
|
/**
|
|
411
416
|
* Creates a type-safe filter builder for AppointmentType entities.
|
|
@@ -418,7 +423,7 @@ class TQL {
|
|
|
418
423
|
* ```
|
|
419
424
|
*/
|
|
420
425
|
static forAppointmentTypes() {
|
|
421
|
-
return new TypedTQLFilterBuilder(
|
|
426
|
+
return new TypedTQLFilterBuilder("appointment_type");
|
|
422
427
|
}
|
|
423
428
|
/**
|
|
424
429
|
* Creates a type-safe filter builder for SchedulingRequest entities.
|
|
@@ -431,7 +436,7 @@ class TQL {
|
|
|
431
436
|
* ```
|
|
432
437
|
*/
|
|
433
438
|
static forSchedulingRequests() {
|
|
434
|
-
return new TypedTQLFilterBuilder(
|
|
439
|
+
return new TypedTQLFilterBuilder("scheduling_request");
|
|
435
440
|
}
|
|
436
441
|
}
|
|
437
442
|
exports.TQL = TQL;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tqlFilter.js","sourceRoot":"","sources":["../../src/utils/tqlFilter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;;;
|
|
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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,IAAI,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": "
|
|
4
|
-
"main": "index.js",
|
|
3
|
+
"version": "2.0.0",
|
|
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",
|