@omni-graph/omni-model 0.6.107-1-g0211605 → 0.6.107-13-g8a976b7
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/functions/filtering/baseHandler.d.ts +9 -0
- package/dist/functions/filtering/baseHandler.d.ts.map +1 -0
- package/dist/functions/filtering/baseHandler.js +12 -0
- package/dist/functions/filtering/baseHandler.js.map +1 -0
- package/dist/functions/filtering/booleanHandler.d.ts +16 -0
- package/dist/functions/filtering/booleanHandler.d.ts.map +1 -0
- package/dist/functions/filtering/booleanHandler.js +39 -0
- package/dist/functions/filtering/booleanHandler.js.map +1 -0
- package/dist/functions/filtering/dateHandler.d.ts +21 -0
- package/dist/functions/filtering/dateHandler.d.ts.map +1 -0
- package/dist/functions/filtering/dateHandler.js +67 -0
- package/dist/functions/filtering/dateHandler.js.map +1 -0
- package/dist/functions/filtering/dateRangeHandler.d.ts +14 -0
- package/dist/functions/filtering/dateRangeHandler.d.ts.map +1 -0
- package/dist/functions/filtering/dateRangeHandler.js +44 -0
- package/dist/functions/filtering/dateRangeHandler.js.map +1 -0
- package/dist/functions/filtering/filterPredicate.d.ts +2 -0
- package/dist/functions/filtering/filterPredicate.d.ts.map +1 -0
- package/dist/functions/filtering/filterPredicate.js +2 -0
- package/dist/functions/filtering/filterPredicate.js.map +1 -0
- package/dist/functions/filtering/generalFilterArgs.d.ts +6 -0
- package/dist/functions/filtering/generalFilterArgs.d.ts.map +1 -0
- package/dist/functions/filtering/generalFilterArgs.js +2 -0
- package/dist/functions/filtering/generalFilterArgs.js.map +1 -0
- package/dist/functions/filtering/handler.d.ts +8 -0
- package/dist/functions/filtering/handler.d.ts.map +1 -0
- package/dist/functions/filtering/handler.js +2 -0
- package/dist/functions/filtering/handler.js.map +1 -0
- package/dist/functions/filtering/index.d.ts +8 -0
- package/dist/functions/filtering/index.d.ts.map +1 -1
- package/dist/functions/filtering/multiSelectHandler.d.ts +14 -0
- package/dist/functions/filtering/multiSelectHandler.d.ts.map +1 -0
- package/dist/functions/filtering/multiSelectHandler.js +46 -0
- package/dist/functions/filtering/multiSelectHandler.js.map +1 -0
- package/dist/functions/filtering/numberHandler.d.ts +20 -0
- package/dist/functions/filtering/numberHandler.d.ts.map +1 -0
- package/dist/functions/filtering/numberHandler.js +48 -0
- package/dist/functions/filtering/numberHandler.js.map +1 -0
- package/dist/functions/filtering/numberRangeHandler.d.ts +13 -0
- package/dist/functions/filtering/numberRangeHandler.d.ts.map +1 -0
- package/dist/functions/filtering/numberRangeHandler.js +25 -0
- package/dist/functions/filtering/numberRangeHandler.js.map +1 -0
- package/dist/functions/filtering/queryFilters.d.ts +20 -8
- package/dist/functions/filtering/queryFilters.d.ts.map +1 -1
- package/dist/functions/filtering/queryFilters.js +57 -431
- package/dist/functions/filtering/queryFilters.js.map +1 -1
- package/dist/functions/filtering/textHandler.d.ts +20 -0
- package/dist/functions/filtering/textHandler.d.ts.map +1 -0
- package/dist/functions/filtering/textHandler.js +40 -0
- package/dist/functions/filtering/textHandler.js.map +1 -0
- package/dist/functions/filtering/utils.d.ts +12 -0
- package/dist/functions/filtering/utils.d.ts.map +1 -0
- package/dist/functions/filtering/utils.js +97 -0
- package/dist/functions/filtering/utils.js.map +1 -0
- package/dist/functions/index.d.ts.map +1 -1
- package/dist/functions/index.js.map +1 -1
- package/dist/zod/filtering/index.d.ts +1 -0
- package/dist/zod/filtering/index.d.ts.map +1 -1
- package/dist/zod/filtering/index.js +1 -0
- package/dist/zod/filtering/index.js.map +1 -1
- package/dist/zod/filtering/relativeDateFiltering.d.ts +35 -0
- package/dist/zod/filtering/relativeDateFiltering.d.ts.map +1 -0
- package/dist/zod/filtering/relativeDateFiltering.js +16 -0
- package/dist/zod/filtering/relativeDateFiltering.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { RelativeDateRangeSchema, RelativeDateSchema } from "../../zod";
|
|
2
|
+
export declare const parseJSONValue: (json: string) => boolean | number | string | string[] | number[];
|
|
3
|
+
export declare const toNumber: (x: unknown) => number | null;
|
|
4
|
+
export declare const toDate: (x: unknown) => Date | null;
|
|
5
|
+
export declare const normalizeStr: (x: unknown) => string;
|
|
6
|
+
/** ---------- Date helpers ---------- */
|
|
7
|
+
export declare const startOfDay: (d: Date) => Date;
|
|
8
|
+
export declare const endOfDay: (d: Date) => Date;
|
|
9
|
+
export declare const compareDateOnly: (a: Date | null, b: Date | null) => number;
|
|
10
|
+
export declare const parseRelative: (json: string) => RelativeDateSchema | RelativeDateRangeSchema;
|
|
11
|
+
export declare const addDays: (d: Date, days: number) => Date;
|
|
12
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/functions/filtering/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,uBAAuB,EAAE,kBAAkB,EAAgD,MAAM,WAAW,CAAC;AAErH,eAAO,MAAM,cAAc,GAAI,MAAM,MAAM,KAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,EAQ1F,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,GAAG,OAAO,KAAG,MAAM,GAAG,IAI9C,CAAC;AAEF,eAAO,MAAM,MAAM,GAAI,GAAG,OAAO,KAAG,IAAI,GAAG,IAe1C,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,GAAG,OAAO,KAAG,MAOzC,CAAC;AAGF,yCAAyC;AACzC,eAAO,MAAM,UAAU,GAAI,GAAG,IAAI,KAAG,IAIpC,CAAC;AACF,eAAO,MAAM,QAAQ,GAAI,GAAG,IAAI,KAAG,IAIlC,CAAC;AACF,eAAO,MAAM,eAAe,GAAI,GAAG,IAAI,GAAG,IAAI,EAAE,GAAG,IAAI,GAAG,IAAI,KAAG,MAQhE,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,MAAM,MAAM,KAAG,kBAAkB,GAAG,uBAajE,CAAC;AAEF,eAAO,MAAM,OAAO,GAAI,GAAG,IAAI,EAAE,MAAM,MAAM,SAI5C,CAAC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { DateTime } from "luxon";
|
|
2
|
+
import { zRelativeDateRangeSchema, zRelativeDateSchema } from "../../zod";
|
|
3
|
+
export const parseJSONValue = (json) => {
|
|
4
|
+
const v = JSON.parse(json);
|
|
5
|
+
if (typeof v === 'string')
|
|
6
|
+
return v;
|
|
7
|
+
if (typeof v === 'boolean')
|
|
8
|
+
return v;
|
|
9
|
+
if (typeof v === 'number')
|
|
10
|
+
return v;
|
|
11
|
+
if (Array.isArray(v) && v.every((x) => typeof x === 'string'))
|
|
12
|
+
return v;
|
|
13
|
+
if (Array.isArray(v) && v.every((x) => typeof x === 'number'))
|
|
14
|
+
return v;
|
|
15
|
+
throw new Error('Invalid type for filter value');
|
|
16
|
+
};
|
|
17
|
+
export const toNumber = (x) => {
|
|
18
|
+
if (x == null || x === '')
|
|
19
|
+
return null;
|
|
20
|
+
const n = Number(x);
|
|
21
|
+
return Number.isFinite(n) ? n : null;
|
|
22
|
+
};
|
|
23
|
+
export const toDate = (x) => {
|
|
24
|
+
if (x == null || x === '')
|
|
25
|
+
return null;
|
|
26
|
+
// Accept Date, epoch number, Luxon, or ISO-like string
|
|
27
|
+
if (x instanceof Date && !Number.isNaN(x.getTime()))
|
|
28
|
+
return x;
|
|
29
|
+
if (x instanceof DateTime && !Number.isNaN(x.toJSDate().getTime()))
|
|
30
|
+
return x.toJSDate();
|
|
31
|
+
const n = Number(x);
|
|
32
|
+
if (Number.isFinite(n)) {
|
|
33
|
+
const d = new Date(n);
|
|
34
|
+
return Number.isNaN(d.getTime()) ? null : d;
|
|
35
|
+
}
|
|
36
|
+
if (typeof x === 'string') {
|
|
37
|
+
const d = new Date(String(x));
|
|
38
|
+
return Number.isNaN(d.getTime()) ? null : d;
|
|
39
|
+
}
|
|
40
|
+
throw new Error('Invalid date value');
|
|
41
|
+
};
|
|
42
|
+
export const normalizeStr = (x) => {
|
|
43
|
+
var _a, _b;
|
|
44
|
+
if (x == null || x === '')
|
|
45
|
+
return '';
|
|
46
|
+
if (typeof x === 'object' && x !== null)
|
|
47
|
+
return JSON.stringify(x);
|
|
48
|
+
if (typeof x === 'string')
|
|
49
|
+
return x.trim();
|
|
50
|
+
if (typeof x === 'number')
|
|
51
|
+
return String(x);
|
|
52
|
+
if (typeof x === 'boolean')
|
|
53
|
+
return String(x);
|
|
54
|
+
return (_b = (_a = JSON.stringify(x)) === null || _a === void 0 ? void 0 : _a.trim()) !== null && _b !== void 0 ? _b : '';
|
|
55
|
+
};
|
|
56
|
+
/** ---------- Date helpers ---------- */
|
|
57
|
+
export const startOfDay = (d) => {
|
|
58
|
+
const r = new Date(d);
|
|
59
|
+
r.setHours(0, 0, 0, 0);
|
|
60
|
+
return r;
|
|
61
|
+
};
|
|
62
|
+
export const endOfDay = (d) => {
|
|
63
|
+
const r = new Date(d);
|
|
64
|
+
r.setHours(23, 59, 59, 999);
|
|
65
|
+
return r;
|
|
66
|
+
};
|
|
67
|
+
export const compareDateOnly = (a, b) => {
|
|
68
|
+
if (!a && !b)
|
|
69
|
+
return 0;
|
|
70
|
+
if (!a)
|
|
71
|
+
return 1;
|
|
72
|
+
if (!b)
|
|
73
|
+
return -1;
|
|
74
|
+
const aa = startOfDay(a).getTime();
|
|
75
|
+
const bb = startOfDay(b).getTime();
|
|
76
|
+
if (aa === bb)
|
|
77
|
+
return 0;
|
|
78
|
+
return aa < bb ? -1 : 1;
|
|
79
|
+
};
|
|
80
|
+
export const parseRelative = (json) => {
|
|
81
|
+
const v = JSON.parse(json);
|
|
82
|
+
const asSingle = zRelativeDateSchema.safeParse(v);
|
|
83
|
+
if (asSingle.success) {
|
|
84
|
+
return asSingle.data;
|
|
85
|
+
}
|
|
86
|
+
const asRange = zRelativeDateRangeSchema.safeParse(v);
|
|
87
|
+
if (asRange.success) {
|
|
88
|
+
return asRange.data;
|
|
89
|
+
}
|
|
90
|
+
throw new Error('For "isRelativeToToday", value must be {"offsetDays":number,"compare":"lt|lte|gt|gte|eq|ne"} or {"startOffsetDays":number,"endOffsetDays":number}');
|
|
91
|
+
};
|
|
92
|
+
export const addDays = (d, days) => {
|
|
93
|
+
const copy = new Date(d);
|
|
94
|
+
copy.setDate(copy.getDate() + days);
|
|
95
|
+
return copy;
|
|
96
|
+
};
|
|
97
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/functions/filtering/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC/B,OAAO,EAA8C,wBAAwB,EAAE,mBAAmB,EAAC,MAAM,WAAW,CAAC;AAErH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,IAAY,EAAmD,EAAE;IAC9F,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC3B,IAAI,OAAO,CAAC,KAAK,QAAQ;QAAE,OAAO,CAAC,CAAC;IACpC,IAAI,OAAO,CAAC,KAAK,SAAS;QAAE,OAAO,CAAC,CAAC;IACrC,IAAI,OAAO,CAAC,KAAK,QAAQ;QAAE,OAAO,CAAC,CAAC;IACpC,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC;QAAE,OAAO,CAAC,CAAC;IACxE,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC;QAAE,OAAO,CAAC,CAAC;IACxE,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;AACnD,CAAC,CAAC;AAEF,MAAM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,CAAC;IACzB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;IACpC,OAAO,IAAI,CAAC;AACd,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/functions/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/functions/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/functions/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/functions/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/zod/filtering/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/zod/filtering/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/zod/filtering/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/zod/filtering/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAA"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Zod schema for defining a relative date. See `RelativeDateSchema`
|
|
4
|
+
*/
|
|
5
|
+
export declare const zRelativeDateSchema: z.ZodObject<{
|
|
6
|
+
offsetDays: z.ZodNumber;
|
|
7
|
+
compare: z.core.$ZodType<"=" | "!=" | "<" | "<=" | ">" | ">=" | "isEmpty" | "isNotEmpty", "=" | "!=" | "<" | "<=" | ">" | ">=" | "isEmpty" | "isNotEmpty", z.core.$ZodTypeInternals<"=" | "!=" | "<" | "<=" | ">" | ">=" | "isEmpty" | "isNotEmpty", "=" | "!=" | "<" | "<=" | ">" | ">=" | "isEmpty" | "isNotEmpty">>;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
/**
|
|
10
|
+
* RelativeDateSchema defines the structure for representing a relative date configuration.
|
|
11
|
+
*
|
|
12
|
+
* This schema includes two properties:
|
|
13
|
+
* 1. offsetDays: A numeric value representing the amount of days to offset the relative date.
|
|
14
|
+
* 2. compare: A string value specifying the comparison operator, limited to a subset of DateOperator
|
|
15
|
+
* that excludes 'isBetween' and 'isRelativeToToday'.
|
|
16
|
+
*/
|
|
17
|
+
export type RelativeDateSchema = z.infer<typeof zRelativeDateSchema>;
|
|
18
|
+
/**
|
|
19
|
+
* Zod schema for defining a relative date range. See `RelativeDateRangeSchema`
|
|
20
|
+
*/
|
|
21
|
+
export declare const zRelativeDateRangeSchema: z.ZodObject<{
|
|
22
|
+
startOffsetDays: z.ZodNumber;
|
|
23
|
+
endOffsetDays: z.ZodNumber;
|
|
24
|
+
}, z.core.$strip>;
|
|
25
|
+
/**
|
|
26
|
+
* Represents a schema for defining a relative date range.
|
|
27
|
+
*
|
|
28
|
+
* The schema includes the following properties:
|
|
29
|
+
* - `startOffsetDays`: A number indicating the offset in days from a reference point to specify the start of the date range.
|
|
30
|
+
* - `endOffsetDays`: A number indicating the offset in days from the same reference point to specify the end of the date range.
|
|
31
|
+
*
|
|
32
|
+
* This schema is used to represent a range of dates relative to a given point in time.
|
|
33
|
+
*/
|
|
34
|
+
export type RelativeDateRangeSchema = z.infer<typeof zRelativeDateRangeSchema>;
|
|
35
|
+
//# sourceMappingURL=relativeDateFiltering.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relativeDateFiltering.d.ts","sourceRoot":"","sources":["../../../src/zod/filtering/relativeDateFiltering.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAGtB;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;iBAG9B,CAAC;AAEH;;;;;;;GAOG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAGrE;;GAEG;AACH,eAAO,MAAM,wBAAwB;;;iBAGnC,CAAC;AAEH;;;;;;;;GAQG;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Zod schema for defining a relative date. See `RelativeDateSchema`
|
|
4
|
+
*/
|
|
5
|
+
export const zRelativeDateSchema = z.object({
|
|
6
|
+
offsetDays: z.number(),
|
|
7
|
+
compare: z.string()
|
|
8
|
+
});
|
|
9
|
+
/**
|
|
10
|
+
* Zod schema for defining a relative date range. See `RelativeDateRangeSchema`
|
|
11
|
+
*/
|
|
12
|
+
export const zRelativeDateRangeSchema = z.object({
|
|
13
|
+
startOffsetDays: z.number(),
|
|
14
|
+
endOffsetDays: z.number()
|
|
15
|
+
});
|
|
16
|
+
//# sourceMappingURL=relativeDateFiltering.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relativeDateFiltering.js","sourceRoot":"","sources":["../../../src/zod/filtering/relativeDateFiltering.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAGtB;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,OAAO,EAAE,CAAC,CAAC,MAAM,EAA4D;CAC9E,CAAC,CAAC;AAaH;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE;IAC3B,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE;CAC1B,CAAC,CAAC"}
|