@vulog/aima-event 1.1.76 → 1.1.78
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/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +4 -0
- package/dist/index.mjs +4 -0
- package/package.json +3 -3
- package/src/getEvents.ts +7 -3
package/dist/index.d.mts
CHANGED
|
@@ -35,8 +35,8 @@ type EventFilters = {
|
|
|
35
35
|
*/
|
|
36
36
|
endDate?: string;
|
|
37
37
|
};
|
|
38
|
-
declare const getEventsByType: (client: Client, type: EventType, options?: PaginableOptions<EventFilters>) => Promise<PaginableResponse<Event>>;
|
|
39
|
-
declare const getEvents: (client: Client, options?: PaginableOptions<EventFilters>) => Promise<PaginableResponse<Event>>;
|
|
40
|
-
declare const getEventsByTripId: (client: Client, tripId: string, options?: PaginableOptions<EventFilters>) => Promise<PaginableResponse<Event>>;
|
|
38
|
+
declare const getEventsByType: (client: Client, type: EventType, options?: PaginableOptions<EventFilters, "date">) => Promise<PaginableResponse<Event>>;
|
|
39
|
+
declare const getEvents: (client: Client, options?: PaginableOptions<EventFilters, "date">) => Promise<PaginableResponse<Event>>;
|
|
40
|
+
declare const getEventsByTripId: (client: Client, tripId: string, options?: PaginableOptions<EventFilters, "date">) => Promise<PaginableResponse<Event>>;
|
|
41
41
|
|
|
42
42
|
export { type Event, type EventFilters, type EventType, type ExtraInfo, getEvents, getEventsByTripId, getEventsByType };
|
package/dist/index.d.ts
CHANGED
|
@@ -35,8 +35,8 @@ type EventFilters = {
|
|
|
35
35
|
*/
|
|
36
36
|
endDate?: string;
|
|
37
37
|
};
|
|
38
|
-
declare const getEventsByType: (client: Client, type: EventType, options?: PaginableOptions<EventFilters>) => Promise<PaginableResponse<Event>>;
|
|
39
|
-
declare const getEvents: (client: Client, options?: PaginableOptions<EventFilters>) => Promise<PaginableResponse<Event>>;
|
|
40
|
-
declare const getEventsByTripId: (client: Client, tripId: string, options?: PaginableOptions<EventFilters>) => Promise<PaginableResponse<Event>>;
|
|
38
|
+
declare const getEventsByType: (client: Client, type: EventType, options?: PaginableOptions<EventFilters, "date">) => Promise<PaginableResponse<Event>>;
|
|
39
|
+
declare const getEvents: (client: Client, options?: PaginableOptions<EventFilters, "date">) => Promise<PaginableResponse<Event>>;
|
|
40
|
+
declare const getEventsByTripId: (client: Client, tripId: string, options?: PaginableOptions<EventFilters, "date">) => Promise<PaginableResponse<Event>>;
|
|
41
41
|
|
|
42
42
|
export { type Event, type EventFilters, type EventType, type ExtraInfo, getEvents, getEventsByTripId, getEventsByType };
|
package/dist/index.js
CHANGED
|
@@ -245,6 +245,8 @@ var getEventsByType = async (client, type, options) => {
|
|
|
245
245
|
const searchParams = new URLSearchParams();
|
|
246
246
|
searchParams.append("page", finalOptions.page.toString());
|
|
247
247
|
searchParams.append("pageSize", finalOptions.pageSize.toString());
|
|
248
|
+
searchParams.append("sort", finalOptions.sort.toString());
|
|
249
|
+
searchParams.append("sortDirection", finalOptions.sortDirection.toString());
|
|
248
250
|
Object.entries(finalOptions.filters).forEach(([key, value]) => {
|
|
249
251
|
if (value === void 0) {
|
|
250
252
|
return;
|
|
@@ -282,6 +284,8 @@ var getEvents = async (client, options) => {
|
|
|
282
284
|
const searchParams = new URLSearchParams();
|
|
283
285
|
searchParams.append("page", finalOptions.page.toString());
|
|
284
286
|
searchParams.append("pageSize", finalOptions.pageSize.toString());
|
|
287
|
+
searchParams.append("sort", finalOptions.sort.toString());
|
|
288
|
+
searchParams.append("sortDirection", finalOptions.sortDirection.toString());
|
|
285
289
|
Object.entries(finalOptions.filters).forEach(([key, value]) => {
|
|
286
290
|
if (value === void 0) {
|
|
287
291
|
return;
|
package/dist/index.mjs
CHANGED
|
@@ -217,6 +217,8 @@ var getEventsByType = async (client, type, options) => {
|
|
|
217
217
|
const searchParams = new URLSearchParams();
|
|
218
218
|
searchParams.append("page", finalOptions.page.toString());
|
|
219
219
|
searchParams.append("pageSize", finalOptions.pageSize.toString());
|
|
220
|
+
searchParams.append("sort", finalOptions.sort.toString());
|
|
221
|
+
searchParams.append("sortDirection", finalOptions.sortDirection.toString());
|
|
220
222
|
Object.entries(finalOptions.filters).forEach(([key, value]) => {
|
|
221
223
|
if (value === void 0) {
|
|
222
224
|
return;
|
|
@@ -254,6 +256,8 @@ var getEvents = async (client, options) => {
|
|
|
254
256
|
const searchParams = new URLSearchParams();
|
|
255
257
|
searchParams.append("page", finalOptions.page.toString());
|
|
256
258
|
searchParams.append("pageSize", finalOptions.pageSize.toString());
|
|
259
|
+
searchParams.append("sort", finalOptions.sort.toString());
|
|
260
|
+
searchParams.append("sortDirection", finalOptions.sortDirection.toString());
|
|
257
261
|
Object.entries(finalOptions.filters).forEach(([key, value]) => {
|
|
258
262
|
if (value === void 0) {
|
|
259
263
|
return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vulog/aima-event",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.78",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.mjs",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"author": "Vulog",
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@vulog/aima-client": "1.1.
|
|
23
|
-
"@vulog/aima-core": "1.1.
|
|
22
|
+
"@vulog/aima-client": "1.1.78",
|
|
23
|
+
"@vulog/aima-core": "1.1.78"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
26
|
"zod": "^3.24.2"
|
package/src/getEvents.ts
CHANGED
|
@@ -211,7 +211,7 @@ export type EventFilters = {
|
|
|
211
211
|
export const getEventsByType = async (
|
|
212
212
|
client: Client,
|
|
213
213
|
type: EventType,
|
|
214
|
-
options?: PaginableOptions<EventFilters>
|
|
214
|
+
options?: PaginableOptions<EventFilters, 'date'>
|
|
215
215
|
): Promise<PaginableResponse<Event>> => {
|
|
216
216
|
const resultStatus = EventTypeList.safeParse(type);
|
|
217
217
|
if (!resultStatus.success) {
|
|
@@ -242,6 +242,8 @@ export const getEventsByType = async (
|
|
|
242
242
|
const searchParams = new URLSearchParams();
|
|
243
243
|
searchParams.append('page', finalOptions.page!.toString());
|
|
244
244
|
searchParams.append('pageSize', finalOptions.pageSize!.toString());
|
|
245
|
+
searchParams.append('sort', finalOptions.sort!.toString());
|
|
246
|
+
searchParams.append('sortDirection', finalOptions.sortDirection!.toString());
|
|
245
247
|
|
|
246
248
|
Object.entries(finalOptions.filters!).forEach(([key, value]) => {
|
|
247
249
|
if (value === undefined) {
|
|
@@ -267,7 +269,7 @@ export const getEventsByType = async (
|
|
|
267
269
|
|
|
268
270
|
export const getEvents = async (
|
|
269
271
|
client: Client,
|
|
270
|
-
options?: PaginableOptions<EventFilters>
|
|
272
|
+
options?: PaginableOptions<EventFilters, 'date'>
|
|
271
273
|
): Promise<PaginableResponse<Event>> => {
|
|
272
274
|
const date = new Date();
|
|
273
275
|
date.setMilliseconds(0);
|
|
@@ -292,6 +294,8 @@ export const getEvents = async (
|
|
|
292
294
|
const searchParams = new URLSearchParams();
|
|
293
295
|
searchParams.append('page', finalOptions.page!.toString());
|
|
294
296
|
searchParams.append('pageSize', finalOptions.pageSize!.toString());
|
|
297
|
+
searchParams.append('sort', finalOptions.sort!.toString());
|
|
298
|
+
searchParams.append('sortDirection', finalOptions.sortDirection!.toString());
|
|
295
299
|
|
|
296
300
|
Object.entries(finalOptions.filters!).forEach(([key, value]) => {
|
|
297
301
|
if (value === undefined) {
|
|
@@ -318,7 +322,7 @@ export const getEvents = async (
|
|
|
318
322
|
export const getEventsByTripId = async (
|
|
319
323
|
client: Client,
|
|
320
324
|
tripId: string,
|
|
321
|
-
options?: PaginableOptions<EventFilters>
|
|
325
|
+
options?: PaginableOptions<EventFilters, 'date'>
|
|
322
326
|
): Promise<PaginableResponse<Event>> => {
|
|
323
327
|
const EventFiltersSchema = z.object({
|
|
324
328
|
startDate: z.string().datetime({ offset: false, precision: 0 }).optional(),
|