@fibery/expression-utils 9.3.0 → 9.4.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/lib/index.d.ts +6 -0
- package/lib/index.js +44 -0
- package/lib/src/context-variables.d.ts +22 -0
- package/lib/src/context-variables.js +122 -0
- package/lib/src/errors.d.ts +4 -0
- package/lib/src/errors.js +15 -0
- package/lib/src/fieldExpressionVisitorTypeAware.d.ts +5 -0
- package/lib/src/fieldExpressionVisitorTypeAware.js +133 -0
- package/lib/src/params-placeholders.d.ts +55 -0
- package/lib/src/params-placeholders.js +204 -0
- package/lib/src/tsfixme.d.ts +1 -0
- package/lib/src/tsfixme.js +2 -0
- package/lib/src/types.d.ts +35 -0
- package/lib/src/types.js +2 -0
- package/lib/src/utils.d.ts +42 -0
- package/lib/src/utils.js +260 -0
- package/lib/src/visitors.d.ts +44 -0
- package/lib/src/visitors.js +382 -0
- package/lib/testData/schemaMock.d.ts +502 -0
- package/lib/testData/schemaMock.js +138 -0
- package/package.json +22 -22
- package/lib/contextVariables.js +0 -106
- package/lib/expression-utils.js +0 -1121
- package/lib/paramsPlaceholders.js +0 -232
- package/lib/utils.js +0 -223
- package/lib/visitors.js +0 -660
- package/types.d.ts +0 -139
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as paramsPlaceholders from "./src/params-placeholders";
|
|
2
|
+
import * as utils from "./src/utils";
|
|
3
|
+
import * as visitors from "./src/visitors";
|
|
4
|
+
import * as contextVariables from "./src/context-variables";
|
|
5
|
+
export { utils, visitors, paramsPlaceholders, contextVariables };
|
|
6
|
+
export type { Expression, OrderBy, Query, Select, SubQuery, ExpressionVisitor, ExpressionVisitorWithDefault, } from "./src/types";
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.contextVariables = exports.paramsPlaceholders = exports.visitors = exports.utils = void 0;
|
|
37
|
+
const paramsPlaceholders = __importStar(require("./src/params-placeholders"));
|
|
38
|
+
exports.paramsPlaceholders = paramsPlaceholders;
|
|
39
|
+
const utils = __importStar(require("./src/utils"));
|
|
40
|
+
exports.utils = utils;
|
|
41
|
+
const visitors = __importStar(require("./src/visitors"));
|
|
42
|
+
exports.visitors = visitors;
|
|
43
|
+
const contextVariables = __importStar(require("./src/context-variables"));
|
|
44
|
+
exports.contextVariables = contextVariables;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Schema, TypeObject } from "@fibery/schema";
|
|
2
|
+
type ContextVariable = {
|
|
3
|
+
typeObject: TypeObject;
|
|
4
|
+
id: string;
|
|
5
|
+
title: string;
|
|
6
|
+
isCollection: boolean;
|
|
7
|
+
description: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const getAutomationButtonContextVariables: (typeId: string, typeName: string, fiberySchema: Schema) => Array<ContextVariable>;
|
|
10
|
+
export declare const getTriggerCollectionFieldObject: (typeId: string, collectionFieldId: string, fiberySchema: Schema) => import("@fibery/schema").FieldObject | undefined;
|
|
11
|
+
export declare const getAutomationTriggersContextVariables: (triggers: Array<{
|
|
12
|
+
trigger: string;
|
|
13
|
+
args: Record<string, unknown>;
|
|
14
|
+
}>, typeId: string, fiberySchema: Schema) => Array<ContextVariable>;
|
|
15
|
+
export declare const getEntityQueryVariables: (schema: Schema) => {
|
|
16
|
+
typeObject: TypeObject;
|
|
17
|
+
id: string;
|
|
18
|
+
title: string;
|
|
19
|
+
isCollection: boolean;
|
|
20
|
+
description: string;
|
|
21
|
+
}[];
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getEntityQueryVariables = exports.getAutomationTriggersContextVariables = exports.getTriggerCollectionFieldObject = exports.getAutomationButtonContextVariables = void 0;
|
|
7
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
8
|
+
const getAutomationButtonContextVariables = (typeId, typeName, fiberySchema) => {
|
|
9
|
+
if (!fiberySchema) {
|
|
10
|
+
return [];
|
|
11
|
+
}
|
|
12
|
+
const userTypeObject = fiberySchema.typeObjectsByName["fibery/user"];
|
|
13
|
+
const typeObject = fiberySchema.typeObjectsById[typeId];
|
|
14
|
+
return [
|
|
15
|
+
{
|
|
16
|
+
id: "triggeredEntity",
|
|
17
|
+
title: `Step 1 ${typeObject.singularTitle}`,
|
|
18
|
+
typeObject,
|
|
19
|
+
isCollection: false,
|
|
20
|
+
description: `The ${typeObject.singularTitle} for which the Button was clicked`,
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
id: "currentUser",
|
|
24
|
+
title: `User who clicked Button`,
|
|
25
|
+
typeObject: userTypeObject,
|
|
26
|
+
isCollection: false,
|
|
27
|
+
description: `The User who triggered this automation by clicking a Button.`,
|
|
28
|
+
},
|
|
29
|
+
];
|
|
30
|
+
};
|
|
31
|
+
exports.getAutomationButtonContextVariables = getAutomationButtonContextVariables;
|
|
32
|
+
const getTriggerCollectionFieldObject = (typeId, collectionFieldId, fiberySchema) => {
|
|
33
|
+
if (!fiberySchema) {
|
|
34
|
+
return undefined;
|
|
35
|
+
}
|
|
36
|
+
if (!Object.hasOwn(fiberySchema.typeObjectsById, typeId)) {
|
|
37
|
+
return undefined;
|
|
38
|
+
}
|
|
39
|
+
if (!Object.hasOwn(fiberySchema.typeObjectsById[typeId].fieldObjectsById, collectionFieldId)) {
|
|
40
|
+
return undefined;
|
|
41
|
+
}
|
|
42
|
+
return fiberySchema.typeObjectsById[typeId].fieldObjectsById[collectionFieldId];
|
|
43
|
+
};
|
|
44
|
+
exports.getTriggerCollectionFieldObject = getTriggerCollectionFieldObject;
|
|
45
|
+
const getTriggerContextVariables = (trigger, typeId, fiberySchema) => {
|
|
46
|
+
if (!fiberySchema) {
|
|
47
|
+
return [];
|
|
48
|
+
}
|
|
49
|
+
const typeObject = fiberySchema.typeObjectsById[typeId];
|
|
50
|
+
const userTypeObject = fiberySchema.typeObjectsByName["fibery/user"];
|
|
51
|
+
const triggeredEntityVar = {
|
|
52
|
+
id: "triggeredEntity",
|
|
53
|
+
title: `Step 1 ${typeObject.singularTitle}`,
|
|
54
|
+
typeObject,
|
|
55
|
+
isCollection: false,
|
|
56
|
+
description: `The ${typeObject.singularTitle} from step 1 of this Rule`,
|
|
57
|
+
};
|
|
58
|
+
const currentUserVar = {
|
|
59
|
+
id: "currentUser",
|
|
60
|
+
title: `User who triggered Rule`,
|
|
61
|
+
typeObject: userTypeObject,
|
|
62
|
+
isCollection: false,
|
|
63
|
+
description: `The User who made the change which triggered this automation. Empty in case the change was made by a formula or an integration.`,
|
|
64
|
+
};
|
|
65
|
+
if (trigger.trigger === "time-based") {
|
|
66
|
+
return [triggeredEntityVar];
|
|
67
|
+
}
|
|
68
|
+
else if (trigger.trigger === "created") {
|
|
69
|
+
return typeObject.syncSource !== null ? [triggeredEntityVar] : [triggeredEntityVar, currentUserVar];
|
|
70
|
+
}
|
|
71
|
+
else if (trigger.trigger === "updated") {
|
|
72
|
+
const disableCurrentUserVar = trigger.args.updatedField &&
|
|
73
|
+
lodash_1.default.isArray(trigger.args.updatedField) &&
|
|
74
|
+
trigger.args.updatedField.some((fieldId) => {
|
|
75
|
+
if (!Object.hasOwn(typeObject.fieldObjectsById, fieldId)) {
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
const fieldObject = typeObject.fieldObjectsById[fieldId];
|
|
79
|
+
return fieldObject?.isReadOnly || fieldObject?.type === "Collaboration~Documents/Document";
|
|
80
|
+
});
|
|
81
|
+
return disableCurrentUserVar ? [triggeredEntityVar] : [triggeredEntityVar, currentUserVar];
|
|
82
|
+
}
|
|
83
|
+
else if (trigger.trigger === "collection-item-added" || trigger.trigger === "collection-item-removed") {
|
|
84
|
+
const collectionItemFieldObject = (0, exports.getTriggerCollectionFieldObject)(typeId, trigger.args.changedCollectionField, fiberySchema);
|
|
85
|
+
const collectionItemTypeObject = collectionItemFieldObject?.typeObject;
|
|
86
|
+
const variables = [triggeredEntityVar];
|
|
87
|
+
collectionItemTypeObject &&
|
|
88
|
+
variables.push({
|
|
89
|
+
id: "triggered-collection-item",
|
|
90
|
+
title: `Step 1 ${trigger.trigger === "collection-item-added" ? "linked" : "unlinked"} ${collectionItemTypeObject.singularTitle}`,
|
|
91
|
+
typeObject: collectionItemTypeObject,
|
|
92
|
+
isCollection: false,
|
|
93
|
+
description: `The ${collectionItemTypeObject.singularTitle} from step 1 of this Rule`,
|
|
94
|
+
});
|
|
95
|
+
const disableCurrentUserVar = collectionItemFieldObject?.isReadOnly;
|
|
96
|
+
!disableCurrentUserVar && variables.push(currentUserVar);
|
|
97
|
+
return variables;
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
return [];
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
const getAutomationTriggersContextVariables = (triggers, typeId, fiberySchema) => {
|
|
104
|
+
const triggerContextVars = triggers.flatMap((trigger) => {
|
|
105
|
+
return getTriggerContextVariables(trigger, typeId, fiberySchema);
|
|
106
|
+
});
|
|
107
|
+
return lodash_1.default.uniqBy(triggerContextVars, (variable) => `${variable.id}_${variable.typeObject.id}`);
|
|
108
|
+
};
|
|
109
|
+
exports.getAutomationTriggersContextVariables = getAutomationTriggersContextVariables;
|
|
110
|
+
const getEntityQueryVariables = (schema) => {
|
|
111
|
+
const grouped = lodash_1.default.groupBy(schema.typeObjects.filter((x) => x.isDomain), (typeObject) => typeObject.pluralTitle);
|
|
112
|
+
return lodash_1.default.flatten(Object.values(grouped).map((group) => {
|
|
113
|
+
return group.map((typeObject) => ({
|
|
114
|
+
typeObject,
|
|
115
|
+
id: `entityQuery_${typeObject.id}`,
|
|
116
|
+
title: group.length > 1 ? `${typeObject.pluralTitle} (${typeObject.nameParts.namespace})` : typeObject.pluralTitle,
|
|
117
|
+
isCollection: true,
|
|
118
|
+
description: `All Entities from "${typeObject.title}" Database`,
|
|
119
|
+
}));
|
|
120
|
+
}));
|
|
121
|
+
};
|
|
122
|
+
exports.getEntityQueryVariables = getEntityQueryVariables;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NotImplementedError = void 0;
|
|
4
|
+
const stringify = (x) => {
|
|
5
|
+
if (x === undefined) {
|
|
6
|
+
return "undefined";
|
|
7
|
+
}
|
|
8
|
+
return JSON.stringify(x);
|
|
9
|
+
};
|
|
10
|
+
class NotImplementedError extends Error {
|
|
11
|
+
constructor(value, itemType) {
|
|
12
|
+
super([`"${stringify(value)}"`, itemType, "is not implemented"].filter((x) => x !== undefined).join(" "));
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.NotImplementedError = NotImplementedError;
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.fieldAccessVisitorTypeAware = void 0;
|
|
7
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
8
|
+
const utils_1 = require("./utils");
|
|
9
|
+
const visitFieldExpression = ({ expression: fieldExpression, typeObject: initialTypeObject, onField, onFieldNotFound }) => fieldExpression.reduce(({ typeObject, expression }, fieldAccess) => {
|
|
10
|
+
if (typeObject && (0, utils_1.isMultiFieldAccess)(fieldAccess) && typeObject.fieldObjectsById.hasOwnProperty(fieldAccess[0])) {
|
|
11
|
+
const typeId = fieldAccess[1];
|
|
12
|
+
const fieldObject = typeObject.fieldObjectsById[fieldAccess[0]];
|
|
13
|
+
const nextTypeObject = fieldObject.multiRelatedFieldObjects.find((f) => f.holderTypeObject.id === typeId)?.holderTypeObject;
|
|
14
|
+
if (!nextTypeObject) {
|
|
15
|
+
const notFoundResult = onFieldNotFound({
|
|
16
|
+
currentTypeObject: typeObject,
|
|
17
|
+
expression: fieldExpression,
|
|
18
|
+
fieldAccess,
|
|
19
|
+
});
|
|
20
|
+
return notFoundResult
|
|
21
|
+
? { typeObject: notFoundResult.typeObject, expression: [...expression, notFoundResult.fieldAccess] }
|
|
22
|
+
: {
|
|
23
|
+
typeObject,
|
|
24
|
+
expression,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
const onFieldResult = onField({
|
|
28
|
+
fieldAccess,
|
|
29
|
+
fieldObject,
|
|
30
|
+
typeObject: nextTypeObject,
|
|
31
|
+
});
|
|
32
|
+
return onFieldResult
|
|
33
|
+
? {
|
|
34
|
+
typeObject: onFieldResult.typeObject,
|
|
35
|
+
expression: [...expression, onFieldResult.fieldAccess],
|
|
36
|
+
}
|
|
37
|
+
: {
|
|
38
|
+
typeObject,
|
|
39
|
+
expression,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
else if (typeObject && typeObject.fieldObjectsById.hasOwnProperty(fieldAccess)) {
|
|
43
|
+
const fieldObject = typeObject.fieldObjectsById[fieldAccess];
|
|
44
|
+
const onFieldResult = onField({
|
|
45
|
+
fieldAccess,
|
|
46
|
+
fieldObject,
|
|
47
|
+
typeObject: fieldObject.typeObject,
|
|
48
|
+
});
|
|
49
|
+
return onFieldResult
|
|
50
|
+
? {
|
|
51
|
+
typeObject: onFieldResult.typeObject,
|
|
52
|
+
expression: [...expression, onFieldResult.fieldAccess],
|
|
53
|
+
}
|
|
54
|
+
: {
|
|
55
|
+
typeObject,
|
|
56
|
+
expression,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
const notFoundResult = onFieldNotFound({
|
|
61
|
+
currentTypeObject: typeObject,
|
|
62
|
+
expression: fieldExpression,
|
|
63
|
+
fieldAccess,
|
|
64
|
+
});
|
|
65
|
+
return notFoundResult
|
|
66
|
+
? { typeObject: notFoundResult.typeObject, expression: [...expression, notFoundResult.fieldAccess] }
|
|
67
|
+
: {
|
|
68
|
+
typeObject,
|
|
69
|
+
expression,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
}, {
|
|
73
|
+
typeObject: initialTypeObject,
|
|
74
|
+
expression: [],
|
|
75
|
+
});
|
|
76
|
+
const defaultOnFieldNotFound = () => undefined;
|
|
77
|
+
const defaultOnField = () => undefined;
|
|
78
|
+
const fieldAccessVisitorTypeAwareInternal = ({ typeObject, rootTypeObject, onField = defaultOnField, onFieldNotFound = defaultOnFieldNotFound, }) => {
|
|
79
|
+
return (0, utils_1.createExpressionVisitor)({
|
|
80
|
+
visitFieldExpression: (expression) => visitFieldExpression({
|
|
81
|
+
typeObject,
|
|
82
|
+
expression,
|
|
83
|
+
onField,
|
|
84
|
+
onFieldNotFound,
|
|
85
|
+
}).expression,
|
|
86
|
+
visitFromRootFieldExpression: ([fromRootKeyword, ...rest]) => [
|
|
87
|
+
fromRootKeyword,
|
|
88
|
+
...rest.map((x) => fieldAccessVisitorTypeAwareInternal({
|
|
89
|
+
typeObject: rootTypeObject,
|
|
90
|
+
rootTypeObject,
|
|
91
|
+
onField,
|
|
92
|
+
onFieldNotFound,
|
|
93
|
+
}).visitExpression(x)),
|
|
94
|
+
],
|
|
95
|
+
visitQueryExpression: (subQueryExpression) => {
|
|
96
|
+
const { "q/from": fromExpression, "q/select": selectExpression, "q/where": whereExpression, "q/order-by": orderByExpression, } = subQueryExpression;
|
|
97
|
+
const fromVisitResult = visitFieldExpression({
|
|
98
|
+
typeObject,
|
|
99
|
+
expression: fromExpression,
|
|
100
|
+
onField,
|
|
101
|
+
onFieldNotFound,
|
|
102
|
+
});
|
|
103
|
+
if (fromVisitResult?.typeObject) {
|
|
104
|
+
const subQueryVisitor = fieldAccessVisitorTypeAwareInternal({
|
|
105
|
+
typeObject: fromVisitResult?.typeObject,
|
|
106
|
+
rootTypeObject,
|
|
107
|
+
onField,
|
|
108
|
+
onFieldNotFound,
|
|
109
|
+
});
|
|
110
|
+
return {
|
|
111
|
+
...subQueryExpression,
|
|
112
|
+
...{
|
|
113
|
+
"q/from": fromVisitResult.expression,
|
|
114
|
+
"q/select": lodash_1.default.isPlainObject(selectExpression)
|
|
115
|
+
? lodash_1.default.mapValues(selectExpression, (val) => subQueryVisitor.visitExpression(val))
|
|
116
|
+
: subQueryVisitor.visitExpression(selectExpression),
|
|
117
|
+
},
|
|
118
|
+
...(whereExpression ? { "q/where": subQueryVisitor.visitExpression(whereExpression) } : null),
|
|
119
|
+
...(orderByExpression
|
|
120
|
+
? {
|
|
121
|
+
"q/order-by": subQueryVisitor.visitOrderByExpression(orderByExpression),
|
|
122
|
+
}
|
|
123
|
+
: null),
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
return subQueryExpression;
|
|
127
|
+
},
|
|
128
|
+
});
|
|
129
|
+
};
|
|
130
|
+
const fieldAccessVisitorTypeAware = ({ typeObject, onField = defaultOnField, onFieldNotFound = defaultOnFieldNotFound, }) => {
|
|
131
|
+
return fieldAccessVisitorTypeAwareInternal({ typeObject, rootTypeObject: typeObject, onField, onFieldNotFound });
|
|
132
|
+
};
|
|
133
|
+
exports.fieldAccessVisitorTypeAware = fieldAccessVisitorTypeAware;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import moment, { unitOfTime } from "moment";
|
|
2
|
+
import { $TSFixMe } from "./tsfixme";
|
|
3
|
+
export declare const formulaTodayDateParamPlaceholder = "$formula-today-date-placeholder";
|
|
4
|
+
export declare const formulaNowDateTimeParamPlaceholder = "$formula-now-date-time-placeholder";
|
|
5
|
+
export declare const todayDateParamPlaceholder = "$today-date";
|
|
6
|
+
export declare const tomorrowDateParamPlaceholder = "$tomorrow-date";
|
|
7
|
+
export declare const yesterdayDateParamPlaceholder = "$yesterday-date";
|
|
8
|
+
export declare const weekAgoDateParamPlaceholder = "$week-ago-date";
|
|
9
|
+
export declare const weekFromNowDateParamPlaceholder = "$week-from-now-date";
|
|
10
|
+
export declare const monthAgoDateParamPlaceholder = "$month-ago-date";
|
|
11
|
+
export declare const monthFromNowDateParamPlaceholder = "$month-from-now-date";
|
|
12
|
+
export declare const yearAgoDateParamPlaceholder = "$year-ago-date";
|
|
13
|
+
export declare const yearFromNowDateParamPlaceholder = "$year-from-now-date";
|
|
14
|
+
export declare const todayStartDateTimeParamPlaceholder = "$today-date-time-start";
|
|
15
|
+
export declare const todayEndDateTimeParamPlaceholder = "$today-date-time-end";
|
|
16
|
+
export declare const tomorrowStartDateTimeParamPlaceholder = "$tomorrow-date-time-start";
|
|
17
|
+
export declare const tomorrowEndDateTimeParamPlaceholder = "$tomorrow-date-time-end";
|
|
18
|
+
export declare const yesterdayStartDateTimeParamPlaceholder = "$yesterday-date-time-start";
|
|
19
|
+
export declare const yesterdayEndDateTimeParamPlaceholder = "$yesterday-date-time-end";
|
|
20
|
+
export declare const weekAgoStartDateTimeParamPlaceholder = "$week-ago-date-time-start";
|
|
21
|
+
export declare const weekAgoEndDateTimeParamPlaceholder = "$week-ago-date-time-end";
|
|
22
|
+
export declare const weekFromNowStartDateTimeParamPlaceholder = "$week-from-now-date-time-start";
|
|
23
|
+
export declare const weekFromNowEndDateTimeParamPlaceholder = "$week-from-now-date-time-end";
|
|
24
|
+
export declare const monthAgoStartDateTimeParamPlaceholder = "$month-ago-date-time-start";
|
|
25
|
+
export declare const monthAgoEndDateTimeParamPlaceholder = "$month-ago-date-time-end";
|
|
26
|
+
export declare const monthFromNowStartDateTimeParamPlaceholder = "$month-from-now-date-time-start";
|
|
27
|
+
export declare const monthFromNowEndDateTimeParamPlaceholder = "$month-from-now-date-time-end";
|
|
28
|
+
export declare const yearAgoStartDateTimeParamPlaceholder = "$year-ago-date-time-start";
|
|
29
|
+
export declare const yearAgoEndDateTimeParamPlaceholder = "$year-ago-date-time-end";
|
|
30
|
+
export declare const yearFromNowStartDateTimeParamPlaceholder = "$year-from-now-date-time-start";
|
|
31
|
+
export declare const yearFromNowEndDateTimeParamPlaceholder = "$year-from-now-date-time-end";
|
|
32
|
+
export declare const paramsPlaceholdersLookup: Record<string, () => string>;
|
|
33
|
+
export declare const dynamicFilterParamPrefix = "$dynamic_";
|
|
34
|
+
export declare const isDynamicFilterParam: (paramValue: string) => boolean;
|
|
35
|
+
export declare const getFieldIdFromDynamicParam: (paramValue: string) => string;
|
|
36
|
+
export declare const whereParamPrefix = "$where";
|
|
37
|
+
export declare const mapDynamicParams: (params: Record<string, $TSFixMe> | null, onDynamicParam: (value: string) => string) => Record<string, $TSFixMe> | null;
|
|
38
|
+
type RelativeDateInfo = {
|
|
39
|
+
isStartOfInterval?: boolean;
|
|
40
|
+
unitForStart?: unitOfTime.DurationConstructor;
|
|
41
|
+
amount: number;
|
|
42
|
+
unit: unitOfTime.DurationConstructor;
|
|
43
|
+
isBeforeNow: boolean;
|
|
44
|
+
isDateTime?: boolean;
|
|
45
|
+
};
|
|
46
|
+
export declare const getRelativeMomentDate: ({ isStartOfInterval, unitForStart, amount, unit, isBeforeNow, }: Omit<RelativeDateInfo, "isDateTime">) => moment.Moment;
|
|
47
|
+
export declare const getRelativeDateValue: ({ isStartOfInterval, unitForStart, amount, unit, isBeforeNow, isDateTime, }: RelativeDateInfo) => string;
|
|
48
|
+
export declare const toRelativeDatePlaceholder: ({ isStartOfInterval, unitForStart, amount, unit, isBeforeNow, isDateTime, }: RelativeDateInfo) => string;
|
|
49
|
+
export declare const parseRelativeDatePlaceholder: (placeholder: $TSFixMe) => RelativeDateInfo | null;
|
|
50
|
+
export declare function replacePlaceholdersInParams(params: Record<string, $TSFixMe> | null | undefined): Record<string, $TSFixMe> | null | undefined;
|
|
51
|
+
export declare const dateToDateTimeIntervalLookup: Record<string, {
|
|
52
|
+
start: string;
|
|
53
|
+
end: string;
|
|
54
|
+
}>;
|
|
55
|
+
export {};
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.dateToDateTimeIntervalLookup = exports.parseRelativeDatePlaceholder = exports.toRelativeDatePlaceholder = exports.getRelativeDateValue = exports.getRelativeMomentDate = exports.mapDynamicParams = exports.whereParamPrefix = exports.getFieldIdFromDynamicParam = exports.isDynamicFilterParam = exports.dynamicFilterParamPrefix = exports.paramsPlaceholdersLookup = exports.yearFromNowEndDateTimeParamPlaceholder = exports.yearFromNowStartDateTimeParamPlaceholder = exports.yearAgoEndDateTimeParamPlaceholder = exports.yearAgoStartDateTimeParamPlaceholder = exports.monthFromNowEndDateTimeParamPlaceholder = exports.monthFromNowStartDateTimeParamPlaceholder = exports.monthAgoEndDateTimeParamPlaceholder = exports.monthAgoStartDateTimeParamPlaceholder = exports.weekFromNowEndDateTimeParamPlaceholder = exports.weekFromNowStartDateTimeParamPlaceholder = exports.weekAgoEndDateTimeParamPlaceholder = exports.weekAgoStartDateTimeParamPlaceholder = exports.yesterdayEndDateTimeParamPlaceholder = exports.yesterdayStartDateTimeParamPlaceholder = exports.tomorrowEndDateTimeParamPlaceholder = exports.tomorrowStartDateTimeParamPlaceholder = exports.todayEndDateTimeParamPlaceholder = exports.todayStartDateTimeParamPlaceholder = exports.yearFromNowDateParamPlaceholder = exports.yearAgoDateParamPlaceholder = exports.monthFromNowDateParamPlaceholder = exports.monthAgoDateParamPlaceholder = exports.weekFromNowDateParamPlaceholder = exports.weekAgoDateParamPlaceholder = exports.yesterdayDateParamPlaceholder = exports.tomorrowDateParamPlaceholder = exports.todayDateParamPlaceholder = exports.formulaNowDateTimeParamPlaceholder = exports.formulaTodayDateParamPlaceholder = void 0;
|
|
7
|
+
exports.replacePlaceholdersInParams = replacePlaceholdersInParams;
|
|
8
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
9
|
+
const moment_1 = __importDefault(require("moment"));
|
|
10
|
+
const serializeDate = (momentDate) => {
|
|
11
|
+
return momentDate.format("YYYY-MM-DD");
|
|
12
|
+
};
|
|
13
|
+
const serializeDateTime = (momentDate) => {
|
|
14
|
+
return momentDate.toISOString();
|
|
15
|
+
};
|
|
16
|
+
exports.formulaTodayDateParamPlaceholder = "$formula-today-date-placeholder";
|
|
17
|
+
exports.formulaNowDateTimeParamPlaceholder = "$formula-now-date-time-placeholder";
|
|
18
|
+
exports.todayDateParamPlaceholder = "$today-date";
|
|
19
|
+
exports.tomorrowDateParamPlaceholder = "$tomorrow-date";
|
|
20
|
+
exports.yesterdayDateParamPlaceholder = "$yesterday-date";
|
|
21
|
+
exports.weekAgoDateParamPlaceholder = "$week-ago-date";
|
|
22
|
+
exports.weekFromNowDateParamPlaceholder = "$week-from-now-date";
|
|
23
|
+
exports.monthAgoDateParamPlaceholder = "$month-ago-date";
|
|
24
|
+
exports.monthFromNowDateParamPlaceholder = "$month-from-now-date";
|
|
25
|
+
exports.yearAgoDateParamPlaceholder = "$year-ago-date";
|
|
26
|
+
exports.yearFromNowDateParamPlaceholder = "$year-from-now-date";
|
|
27
|
+
exports.todayStartDateTimeParamPlaceholder = "$today-date-time-start";
|
|
28
|
+
exports.todayEndDateTimeParamPlaceholder = "$today-date-time-end";
|
|
29
|
+
exports.tomorrowStartDateTimeParamPlaceholder = "$tomorrow-date-time-start";
|
|
30
|
+
exports.tomorrowEndDateTimeParamPlaceholder = "$tomorrow-date-time-end";
|
|
31
|
+
exports.yesterdayStartDateTimeParamPlaceholder = "$yesterday-date-time-start";
|
|
32
|
+
exports.yesterdayEndDateTimeParamPlaceholder = "$yesterday-date-time-end";
|
|
33
|
+
exports.weekAgoStartDateTimeParamPlaceholder = "$week-ago-date-time-start";
|
|
34
|
+
exports.weekAgoEndDateTimeParamPlaceholder = "$week-ago-date-time-end";
|
|
35
|
+
exports.weekFromNowStartDateTimeParamPlaceholder = "$week-from-now-date-time-start";
|
|
36
|
+
exports.weekFromNowEndDateTimeParamPlaceholder = "$week-from-now-date-time-end";
|
|
37
|
+
exports.monthAgoStartDateTimeParamPlaceholder = "$month-ago-date-time-start";
|
|
38
|
+
exports.monthAgoEndDateTimeParamPlaceholder = "$month-ago-date-time-end";
|
|
39
|
+
exports.monthFromNowStartDateTimeParamPlaceholder = "$month-from-now-date-time-start";
|
|
40
|
+
exports.monthFromNowEndDateTimeParamPlaceholder = "$month-from-now-date-time-end";
|
|
41
|
+
exports.yearAgoStartDateTimeParamPlaceholder = "$year-ago-date-time-start";
|
|
42
|
+
exports.yearAgoEndDateTimeParamPlaceholder = "$year-ago-date-time-end";
|
|
43
|
+
exports.yearFromNowStartDateTimeParamPlaceholder = "$year-from-now-date-time-start";
|
|
44
|
+
exports.yearFromNowEndDateTimeParamPlaceholder = "$year-from-now-date-time-end";
|
|
45
|
+
exports.paramsPlaceholdersLookup = {
|
|
46
|
+
[exports.todayDateParamPlaceholder]: () => serializeDate((0, moment_1.default)()),
|
|
47
|
+
[exports.formulaTodayDateParamPlaceholder]: () => serializeDate((0, moment_1.default)()),
|
|
48
|
+
[exports.formulaNowDateTimeParamPlaceholder]: () => serializeDateTime((0, moment_1.default)()),
|
|
49
|
+
[exports.tomorrowDateParamPlaceholder]: () => serializeDate((0, moment_1.default)().add(1, "days")),
|
|
50
|
+
[exports.yesterdayDateParamPlaceholder]: () => serializeDate((0, moment_1.default)().subtract(1, "days")),
|
|
51
|
+
[exports.weekAgoDateParamPlaceholder]: () => serializeDate((0, moment_1.default)().subtract(7, "days")),
|
|
52
|
+
[exports.weekFromNowDateParamPlaceholder]: () => serializeDate((0, moment_1.default)().add(7, "days")),
|
|
53
|
+
[exports.monthAgoDateParamPlaceholder]: () => serializeDate((0, moment_1.default)().subtract(1, "months")),
|
|
54
|
+
[exports.monthFromNowDateParamPlaceholder]: () => serializeDate((0, moment_1.default)().add(1, "months")),
|
|
55
|
+
[exports.yearAgoDateParamPlaceholder]: () => serializeDate((0, moment_1.default)().subtract(1, "year")),
|
|
56
|
+
[exports.yearFromNowDateParamPlaceholder]: () => serializeDate((0, moment_1.default)().add(1, "year")),
|
|
57
|
+
[exports.todayStartDateTimeParamPlaceholder]: () => serializeDateTime((0, moment_1.default)().startOf("day")),
|
|
58
|
+
[exports.todayEndDateTimeParamPlaceholder]: () => serializeDateTime((0, moment_1.default)().endOf("day")),
|
|
59
|
+
[exports.tomorrowStartDateTimeParamPlaceholder]: () => serializeDateTime((0, moment_1.default)().add(1, "days").startOf("day")),
|
|
60
|
+
[exports.tomorrowEndDateTimeParamPlaceholder]: () => serializeDateTime((0, moment_1.default)().add(1, "days").endOf("day")),
|
|
61
|
+
[exports.yesterdayStartDateTimeParamPlaceholder]: () => serializeDateTime((0, moment_1.default)().subtract(1, "days").startOf("day")),
|
|
62
|
+
[exports.yesterdayEndDateTimeParamPlaceholder]: () => serializeDateTime((0, moment_1.default)().subtract(1, "days").endOf("day")),
|
|
63
|
+
[exports.weekAgoStartDateTimeParamPlaceholder]: () => serializeDateTime((0, moment_1.default)().subtract(7, "days").startOf("day")),
|
|
64
|
+
[exports.weekAgoEndDateTimeParamPlaceholder]: () => serializeDateTime((0, moment_1.default)().subtract(7, "days").endOf("day")),
|
|
65
|
+
[exports.weekFromNowStartDateTimeParamPlaceholder]: () => serializeDateTime((0, moment_1.default)().add(7, "days").startOf("day")),
|
|
66
|
+
[exports.weekFromNowEndDateTimeParamPlaceholder]: () => serializeDateTime((0, moment_1.default)().add(7, "days").endOf("day")),
|
|
67
|
+
[exports.monthAgoStartDateTimeParamPlaceholder]: () => serializeDateTime((0, moment_1.default)().subtract(1, "months").startOf("day")),
|
|
68
|
+
[exports.monthAgoEndDateTimeParamPlaceholder]: () => serializeDateTime((0, moment_1.default)().subtract(1, "months").endOf("day")),
|
|
69
|
+
[exports.monthFromNowStartDateTimeParamPlaceholder]: () => serializeDateTime((0, moment_1.default)().add(1, "months").startOf("day")),
|
|
70
|
+
[exports.monthFromNowEndDateTimeParamPlaceholder]: () => serializeDateTime((0, moment_1.default)().add(1, "months").endOf("day")),
|
|
71
|
+
[exports.yearAgoStartDateTimeParamPlaceholder]: () => serializeDateTime((0, moment_1.default)().subtract(1, "year").startOf("day")),
|
|
72
|
+
[exports.yearAgoEndDateTimeParamPlaceholder]: () => serializeDateTime((0, moment_1.default)().subtract(1, "year").endOf("day")),
|
|
73
|
+
[exports.yearFromNowStartDateTimeParamPlaceholder]: () => serializeDateTime((0, moment_1.default)().add(1, "year").startOf("day")),
|
|
74
|
+
[exports.yearFromNowEndDateTimeParamPlaceholder]: () => serializeDateTime((0, moment_1.default)().add(1, "year").endOf("day")),
|
|
75
|
+
};
|
|
76
|
+
exports.dynamicFilterParamPrefix = `$dynamic_`;
|
|
77
|
+
const isDynamicFilterParam = (paramValue) => paramValue.startsWith(exports.dynamicFilterParamPrefix);
|
|
78
|
+
exports.isDynamicFilterParam = isDynamicFilterParam;
|
|
79
|
+
const getFieldIdFromDynamicParam = (paramValue) => paramValue.substring(exports.dynamicFilterParamPrefix.length);
|
|
80
|
+
exports.getFieldIdFromDynamicParam = getFieldIdFromDynamicParam;
|
|
81
|
+
exports.whereParamPrefix = "$where";
|
|
82
|
+
const mapDynamicParams = (params, onDynamicParam) => {
|
|
83
|
+
if (!params) {
|
|
84
|
+
return params;
|
|
85
|
+
}
|
|
86
|
+
return Object.fromEntries(Object.entries(params).map(([key, value]) => {
|
|
87
|
+
if (lodash_1.default.isArray(value)) {
|
|
88
|
+
return [
|
|
89
|
+
key,
|
|
90
|
+
value.map((v) => {
|
|
91
|
+
return lodash_1.default.isString(v) && (0, exports.isDynamicFilterParam)(v) ? onDynamicParam(v) : v;
|
|
92
|
+
}),
|
|
93
|
+
];
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
return [key, lodash_1.default.isString(value) && (0, exports.isDynamicFilterParam)(value) ? onDynamicParam(value) : value];
|
|
97
|
+
}
|
|
98
|
+
}));
|
|
99
|
+
};
|
|
100
|
+
exports.mapDynamicParams = mapDynamicParams;
|
|
101
|
+
const relativeDatePlaceholderRegex = /\$(?:start-|end-|start-of-day-|end-of-day-)?(\d+)-(second|minute|hour|day|week|month|quarter|year)-(before-now|after-now)-(date-time|date)/;
|
|
102
|
+
const getRelativeMomentDate = ({ isStartOfInterval, unitForStart, amount, unit, isBeforeNow, }) => {
|
|
103
|
+
const result = isBeforeNow ? (0, moment_1.default)().subtract(amount, unit) : (0, moment_1.default)().add(amount, unit);
|
|
104
|
+
if (isStartOfInterval === undefined) {
|
|
105
|
+
return result;
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
return isStartOfInterval ? result.startOf(unitForStart) : result.endOf(unitForStart);
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
exports.getRelativeMomentDate = getRelativeMomentDate;
|
|
112
|
+
const getRelativeDateValue = ({ isStartOfInterval, unitForStart, amount, unit, isBeforeNow, isDateTime, }) => {
|
|
113
|
+
const momentDate = (0, exports.getRelativeMomentDate)({ isStartOfInterval, unitForStart, amount, unit, isBeforeNow });
|
|
114
|
+
return isDateTime ? serializeDateTime(momentDate) : serializeDate(momentDate);
|
|
115
|
+
};
|
|
116
|
+
exports.getRelativeDateValue = getRelativeDateValue;
|
|
117
|
+
const toRelativeDatePlaceholder = ({ isStartOfInterval, unitForStart, amount, unit, isBeforeNow, isDateTime, }) => {
|
|
118
|
+
return `$${isStartOfInterval === undefined ? "" : isStartOfInterval ? `start-of-${unitForStart}-` : `end-of-${unitForStart}-`}${amount}-${unit}-${isBeforeNow ? "before-now" : "after-now"}-${isDateTime ? "date-time" : "date"}`;
|
|
119
|
+
};
|
|
120
|
+
exports.toRelativeDatePlaceholder = toRelativeDatePlaceholder;
|
|
121
|
+
const parseRelativeDatePlaceholder = (placeholder) => {
|
|
122
|
+
if (typeof placeholder === "string") {
|
|
123
|
+
const relativeDatePlaceholderMatch = placeholder.match(relativeDatePlaceholderRegex);
|
|
124
|
+
if (relativeDatePlaceholderMatch) {
|
|
125
|
+
const fullMatch = relativeDatePlaceholderMatch[0];
|
|
126
|
+
const isStartOfInterval = fullMatch.startsWith("$start")
|
|
127
|
+
? true
|
|
128
|
+
: fullMatch.startsWith("$end")
|
|
129
|
+
? false
|
|
130
|
+
: undefined;
|
|
131
|
+
const unit = relativeDatePlaceholderMatch[2];
|
|
132
|
+
return {
|
|
133
|
+
isStartOfInterval,
|
|
134
|
+
unitForStart:
|
|
135
|
+
// Usually the "start" unit is the same as the unit for relative date calculation.
|
|
136
|
+
// e.g. when we calculate the date "1 week ago", we want the beginning of the previous week.
|
|
137
|
+
// But sometimes they are different. We have hardcoded "day" for now, but this can be extended to any unit.
|
|
138
|
+
(fullMatch.startsWith("$start-of-day") || fullMatch.startsWith("$end-of-day")
|
|
139
|
+
? "day"
|
|
140
|
+
: isStartOfInterval !== undefined
|
|
141
|
+
? unit
|
|
142
|
+
: undefined),
|
|
143
|
+
amount: Number.parseInt(relativeDatePlaceholderMatch[1]),
|
|
144
|
+
unit: unit,
|
|
145
|
+
isBeforeNow: relativeDatePlaceholderMatch[3] === "before-now",
|
|
146
|
+
isDateTime: relativeDatePlaceholderMatch[4] === "date-time",
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
return null;
|
|
151
|
+
};
|
|
152
|
+
exports.parseRelativeDatePlaceholder = parseRelativeDatePlaceholder;
|
|
153
|
+
function replacePlaceholdersInParams(params) {
|
|
154
|
+
return (params &&
|
|
155
|
+
lodash_1.default.mapValues(params, (value, key) => {
|
|
156
|
+
const replaceFn = exports.paramsPlaceholdersLookup[key];
|
|
157
|
+
if (replaceFn) {
|
|
158
|
+
return replaceFn();
|
|
159
|
+
}
|
|
160
|
+
const relativeDateInfo = (0, exports.parseRelativeDatePlaceholder)(key);
|
|
161
|
+
if (relativeDateInfo) {
|
|
162
|
+
return (0, exports.getRelativeDateValue)(relativeDateInfo);
|
|
163
|
+
}
|
|
164
|
+
return value;
|
|
165
|
+
}));
|
|
166
|
+
}
|
|
167
|
+
exports.dateToDateTimeIntervalLookup = {
|
|
168
|
+
[exports.todayDateParamPlaceholder]: {
|
|
169
|
+
start: exports.todayStartDateTimeParamPlaceholder,
|
|
170
|
+
end: exports.todayEndDateTimeParamPlaceholder,
|
|
171
|
+
},
|
|
172
|
+
[exports.tomorrowDateParamPlaceholder]: {
|
|
173
|
+
start: exports.tomorrowStartDateTimeParamPlaceholder,
|
|
174
|
+
end: exports.tomorrowEndDateTimeParamPlaceholder,
|
|
175
|
+
},
|
|
176
|
+
[exports.yesterdayDateParamPlaceholder]: {
|
|
177
|
+
start: exports.yesterdayStartDateTimeParamPlaceholder,
|
|
178
|
+
end: exports.yesterdayEndDateTimeParamPlaceholder,
|
|
179
|
+
},
|
|
180
|
+
[exports.weekAgoDateParamPlaceholder]: {
|
|
181
|
+
start: exports.weekAgoStartDateTimeParamPlaceholder,
|
|
182
|
+
end: exports.weekAgoEndDateTimeParamPlaceholder,
|
|
183
|
+
},
|
|
184
|
+
[exports.weekFromNowDateParamPlaceholder]: {
|
|
185
|
+
start: exports.weekFromNowStartDateTimeParamPlaceholder,
|
|
186
|
+
end: exports.weekFromNowEndDateTimeParamPlaceholder,
|
|
187
|
+
},
|
|
188
|
+
[exports.monthAgoDateParamPlaceholder]: {
|
|
189
|
+
start: exports.monthAgoStartDateTimeParamPlaceholder,
|
|
190
|
+
end: exports.monthAgoEndDateTimeParamPlaceholder,
|
|
191
|
+
},
|
|
192
|
+
[exports.monthFromNowDateParamPlaceholder]: {
|
|
193
|
+
start: exports.monthFromNowStartDateTimeParamPlaceholder,
|
|
194
|
+
end: exports.monthFromNowEndDateTimeParamPlaceholder,
|
|
195
|
+
},
|
|
196
|
+
[exports.yearAgoDateParamPlaceholder]: {
|
|
197
|
+
start: exports.yearAgoStartDateTimeParamPlaceholder,
|
|
198
|
+
end: exports.yearAgoEndDateTimeParamPlaceholder,
|
|
199
|
+
},
|
|
200
|
+
[exports.yearFromNowDateParamPlaceholder]: {
|
|
201
|
+
start: exports.yearFromNowStartDateTimeParamPlaceholder,
|
|
202
|
+
end: exports.yearFromNowEndDateTimeParamPlaceholder,
|
|
203
|
+
},
|
|
204
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type $TSFixMe = any;
|