@vulog/aima-event 1.1.81 → 1.1.82

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.js CHANGED
@@ -227,13 +227,13 @@ var getEventsByType = async (client, type, options) => {
227
227
  }
228
228
  const date = /* @__PURE__ */ new Date();
229
229
  date.setMilliseconds(0);
230
- const startDate = date.toISOString().replace(".000Z", "Z");
231
- date.setMonth(date.getMonth() + 2);
232
230
  const endDate = date.toISOString().replace(".000Z", "Z");
231
+ date.setMonth(date.getMonth() - 2);
232
+ const startDate = date.toISOString().replace(".000Z", "Z");
233
233
  const EventFiltersSchema = import_zod.z.object({
234
234
  startDate: import_zod.z.string().datetime({ offset: false, precision: 0 }).default(startDate),
235
235
  endDate: import_zod.z.string().datetime({ offset: false, precision: 0 }).default(endDate)
236
- });
236
+ }).default({});
237
237
  const PaginableOptionsSchema = (0, import_aima_core.createPaginableOptionsSchema)(
238
238
  EventFiltersSchema,
239
239
  import_zod.z.enum(["date"]).optional().default("date")
@@ -268,13 +268,13 @@ var getEventsByType = async (client, type, options) => {
268
268
  var getEvents = async (client, options) => {
269
269
  const date = /* @__PURE__ */ new Date();
270
270
  date.setMilliseconds(0);
271
- const startDate = date.toISOString().replace(".000Z", "Z");
272
- date.setMonth(date.getMonth() + 2);
273
271
  const endDate = date.toISOString().replace(".000Z", "Z");
272
+ date.setMonth(date.getMonth() - 2);
273
+ const startDate = date.toISOString().replace(".000Z", "Z");
274
274
  const EventFiltersSchema = import_zod.z.object({
275
275
  startDate: import_zod.z.string().datetime({ offset: false, precision: 0 }).default(startDate),
276
276
  endDate: import_zod.z.string().datetime({ offset: false, precision: 0 }).default(endDate)
277
- });
277
+ }).default({});
278
278
  const PaginableOptionsSchema = (0, import_aima_core.createPaginableOptionsSchema)(
279
279
  EventFiltersSchema,
280
280
  import_zod.z.enum(["date"]).optional().default("date")
@@ -311,7 +311,7 @@ var getEventsByTripId = async (client, tripId, options) => {
311
311
  startDate: import_zod.z.string().datetime({ offset: false, precision: 0 }).optional(),
312
312
  endDate: import_zod.z.string().datetime({ offset: false, precision: 0 }).optional(),
313
313
  type: import_zod.z.array(EventTypeList).optional()
314
- });
314
+ }).default({});
315
315
  const PaginableOptionsSchema = (0, import_aima_core.createPaginableOptionsSchema)(
316
316
  EventFiltersSchema,
317
317
  import_zod.z.enum(["date"]).optional().default("date")
package/dist/index.mjs CHANGED
@@ -199,13 +199,13 @@ var getEventsByType = async (client, type, options) => {
199
199
  }
200
200
  const date = /* @__PURE__ */ new Date();
201
201
  date.setMilliseconds(0);
202
- const startDate = date.toISOString().replace(".000Z", "Z");
203
- date.setMonth(date.getMonth() + 2);
204
202
  const endDate = date.toISOString().replace(".000Z", "Z");
203
+ date.setMonth(date.getMonth() - 2);
204
+ const startDate = date.toISOString().replace(".000Z", "Z");
205
205
  const EventFiltersSchema = z.object({
206
206
  startDate: z.string().datetime({ offset: false, precision: 0 }).default(startDate),
207
207
  endDate: z.string().datetime({ offset: false, precision: 0 }).default(endDate)
208
- });
208
+ }).default({});
209
209
  const PaginableOptionsSchema = createPaginableOptionsSchema(
210
210
  EventFiltersSchema,
211
211
  z.enum(["date"]).optional().default("date")
@@ -240,13 +240,13 @@ var getEventsByType = async (client, type, options) => {
240
240
  var getEvents = async (client, options) => {
241
241
  const date = /* @__PURE__ */ new Date();
242
242
  date.setMilliseconds(0);
243
- const startDate = date.toISOString().replace(".000Z", "Z");
244
- date.setMonth(date.getMonth() + 2);
245
243
  const endDate = date.toISOString().replace(".000Z", "Z");
244
+ date.setMonth(date.getMonth() - 2);
245
+ const startDate = date.toISOString().replace(".000Z", "Z");
246
246
  const EventFiltersSchema = z.object({
247
247
  startDate: z.string().datetime({ offset: false, precision: 0 }).default(startDate),
248
248
  endDate: z.string().datetime({ offset: false, precision: 0 }).default(endDate)
249
- });
249
+ }).default({});
250
250
  const PaginableOptionsSchema = createPaginableOptionsSchema(
251
251
  EventFiltersSchema,
252
252
  z.enum(["date"]).optional().default("date")
@@ -283,7 +283,7 @@ var getEventsByTripId = async (client, tripId, options) => {
283
283
  startDate: z.string().datetime({ offset: false, precision: 0 }).optional(),
284
284
  endDate: z.string().datetime({ offset: false, precision: 0 }).optional(),
285
285
  type: z.array(EventTypeList).optional()
286
- });
286
+ }).default({});
287
287
  const PaginableOptionsSchema = createPaginableOptionsSchema(
288
288
  EventFiltersSchema,
289
289
  z.enum(["date"]).optional().default("date")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vulog/aima-event",
3
- "version": "1.1.81",
3
+ "version": "1.1.82",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/index.d.ts",
@@ -19,11 +19,11 @@
19
19
  "author": "Vulog",
20
20
  "license": "MIT",
21
21
  "dependencies": {
22
- "@vulog/aima-client": "1.1.81",
23
- "@vulog/aima-core": "1.1.81"
22
+ "@vulog/aima-client": "1.1.82",
23
+ "@vulog/aima-core": "1.1.82"
24
24
  },
25
25
  "peerDependencies": {
26
- "zod": "^3.24.2"
26
+ "zod": "^3.25.76"
27
27
  },
28
28
  "description": ""
29
- }
29
+ }
package/src/getEvents.ts CHANGED
@@ -221,13 +221,16 @@ export const getEventsByType = async (
221
221
  }
222
222
  const date = new Date();
223
223
  date.setMilliseconds(0);
224
- const startDate = date.toISOString().replace('.000Z', 'Z');
225
- date.setMonth(date.getMonth() + 2);
226
224
  const endDate = date.toISOString().replace('.000Z', 'Z');
227
- const EventFiltersSchema = z.object({
228
- startDate: z.string().datetime({ offset: false, precision: 0 }).default(startDate),
229
- endDate: z.string().datetime({ offset: false, precision: 0 }).default(endDate),
230
- });
225
+ date.setMonth(date.getMonth() - 2);
226
+ const startDate = date.toISOString().replace('.000Z', 'Z');
227
+ const EventFiltersSchema = z
228
+ .object({
229
+ startDate: z.string().datetime({ offset: false, precision: 0 }).default(startDate),
230
+ endDate: z.string().datetime({ offset: false, precision: 0 }).default(endDate),
231
+ })
232
+ .default({});
233
+
231
234
  const PaginableOptionsSchema = createPaginableOptionsSchema(
232
235
  EventFiltersSchema,
233
236
  z.enum(['date']).optional().default('date')
@@ -275,13 +278,16 @@ export const getEvents = async (
275
278
  ): Promise<PaginableResponse<Event>> => {
276
279
  const date = new Date();
277
280
  date.setMilliseconds(0);
278
- const startDate = date.toISOString().replace('.000Z', 'Z');
279
- date.setMonth(date.getMonth() + 2);
280
281
  const endDate = date.toISOString().replace('.000Z', 'Z');
281
- const EventFiltersSchema = z.object({
282
- startDate: z.string().datetime({ offset: false, precision: 0 }).default(startDate),
283
- endDate: z.string().datetime({ offset: false, precision: 0 }).default(endDate),
284
- });
282
+ date.setMonth(date.getMonth() - 2);
283
+ const startDate = date.toISOString().replace('.000Z', 'Z');
284
+ const EventFiltersSchema = z
285
+ .object({
286
+ startDate: z.string().datetime({ offset: false, precision: 0 }).default(startDate),
287
+ endDate: z.string().datetime({ offset: false, precision: 0 }).default(endDate),
288
+ })
289
+ .default({});
290
+
285
291
  const PaginableOptionsSchema = createPaginableOptionsSchema(
286
292
  EventFiltersSchema,
287
293
  z.enum(['date']).optional().default('date')
@@ -328,11 +334,13 @@ export const getEventsByTripId = async (
328
334
  tripId: string,
329
335
  options?: PaginableOptions<EventFilters, 'date'>
330
336
  ): Promise<PaginableResponse<Event>> => {
331
- const EventFiltersSchema = z.object({
332
- startDate: z.string().datetime({ offset: false, precision: 0 }).optional(),
333
- endDate: z.string().datetime({ offset: false, precision: 0 }).optional(),
334
- type: z.array(EventTypeList).optional(),
335
- });
337
+ const EventFiltersSchema = z
338
+ .object({
339
+ startDate: z.string().datetime({ offset: false, precision: 0 }).optional(),
340
+ endDate: z.string().datetime({ offset: false, precision: 0 }).optional(),
341
+ type: z.array(EventTypeList).optional(),
342
+ })
343
+ .default({});
336
344
  const PaginableOptionsSchema = createPaginableOptionsSchema(
337
345
  EventFiltersSchema,
338
346
  z.enum(['date']).optional().default('date')