@fibery/expression-utils 9.7.3 → 10.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.
Files changed (53) hide show
  1. package/lib/_virtual/_rolldown/runtime.js +13 -0
  2. package/lib/index.d.ts +191 -585
  3. package/lib/index.js +15 -50
  4. package/lib/src/context-variables.d.ts +27 -22
  5. package/lib/src/context-variables.js +106 -138
  6. package/lib/src/errors.d.ts +5 -2
  7. package/lib/src/errors.js +14 -14
  8. package/lib/src/field-expression-visitor-type-aware.d.ts +18 -16
  9. package/lib/src/field-expression-visitor-type-aware.js +116 -131
  10. package/lib/src/filter-expression/index.d.ts +12 -9
  11. package/lib/src/filter-expression/index.js +34 -47
  12. package/lib/src/filter-expression/operator-utils.d.ts +14 -11
  13. package/lib/src/filter-expression/operator-utils.js +191 -185
  14. package/lib/src/filter-expression/operators.d.ts +111 -106
  15. package/lib/src/filter-expression/operators.js +1130 -846
  16. package/lib/src/filter-expression/pattern-match-placeholders.d.ts +63 -61
  17. package/lib/src/filter-expression/pattern-match-placeholders.js +107 -138
  18. package/lib/src/filter-expression/pattern-match.d.ts +17 -15
  19. package/lib/src/filter-expression/pattern-match.js +118 -130
  20. package/lib/src/filter-expression/pattern-to-expression.d.ts +13 -11
  21. package/lib/src/filter-expression/pattern-to-expression.js +42 -45
  22. package/lib/src/filter-expression/types.d.ts +29 -26
  23. package/lib/src/filter-expression/types.js +0 -3
  24. package/lib/src/params-placeholders.d.ts +55 -51
  25. package/lib/src/params-placeholders.js +199 -192
  26. package/lib/src/tsfixme.d.ts +4 -1
  27. package/lib/src/tsfixme.js +0 -3
  28. package/lib/src/types.d.ts +47 -45
  29. package/lib/src/types.js +0 -3
  30. package/lib/src/utils.d.ts +53 -48
  31. package/lib/src/utils.js +276 -337
  32. package/lib/src/visitors.d.ts +43 -37
  33. package/lib/src/visitors.js +306 -365
  34. package/lib/test-data/schema-mock.d.ts +68 -751
  35. package/lib/test-data/schema-mock.js +175 -139
  36. package/package.json +17 -10
  37. package/lib/index.js.map +0 -1
  38. package/lib/src/context-variables.js.map +0 -1
  39. package/lib/src/errors.js.map +0 -1
  40. package/lib/src/field-expression-visitor-type-aware.js.map +0 -1
  41. package/lib/src/filter-expression/index.js.map +0 -1
  42. package/lib/src/filter-expression/operator-utils.js.map +0 -1
  43. package/lib/src/filter-expression/operators.js.map +0 -1
  44. package/lib/src/filter-expression/pattern-match-placeholders.js.map +0 -1
  45. package/lib/src/filter-expression/pattern-match.js.map +0 -1
  46. package/lib/src/filter-expression/pattern-to-expression.js.map +0 -1
  47. package/lib/src/filter-expression/types.js.map +0 -1
  48. package/lib/src/params-placeholders.js.map +0 -1
  49. package/lib/src/tsfixme.js.map +0 -1
  50. package/lib/src/types.js.map +0 -1
  51. package/lib/src/utils.js.map +0 -1
  52. package/lib/src/visitors.js.map +0 -1
  53. package/lib/test-data/schema-mock.js.map +0 -1
package/lib/index.js CHANGED
@@ -1,50 +1,15 @@
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.filterExpression = exports.contextVariables = exports.paramsPlaceholders = exports.visitors = exports.utils = void 0;
37
- const contextVariables = __importStar(require("./src/context-variables"));
38
- exports.contextVariables = contextVariables;
39
- const filter_expression_1 = require("./src/filter-expression");
40
- const operators = __importStar(require("./src/filter-expression/operators"));
41
- const pattern_to_expression_1 = require("./src/filter-expression/pattern-to-expression");
42
- const paramsPlaceholders = __importStar(require("./src/params-placeholders"));
43
- exports.paramsPlaceholders = paramsPlaceholders;
44
- const utils = __importStar(require("./src/utils"));
45
- exports.utils = utils;
46
- const visitors = __importStar(require("./src/visitors"));
47
- exports.visitors = visitors;
48
- const filterExpression = { findMatchedFilter: filter_expression_1.findMatchedFilter, operators, convertToExpression: pattern_to_expression_1.convertToExpression };
49
- exports.filterExpression = filterExpression;
50
- //# sourceMappingURL=index.js.map
1
+ import { context_variables_exports } from "./src/context-variables.js";
2
+ import { utils_exports } from "./src/utils.js";
3
+ import { findMatchedFilter } from "./src/filter-expression/index.js";
4
+ import { params_placeholders_exports } from "./src/params-placeholders.js";
5
+ import { convertToExpression } from "./src/filter-expression/pattern-to-expression.js";
6
+ import { operators_exports } from "./src/filter-expression/operators.js";
7
+ import { visitors_exports } from "./src/visitors.js";
8
+ //#region index.ts
9
+ const filterExpression = {
10
+ findMatchedFilter,
11
+ operators: operators_exports,
12
+ convertToExpression
13
+ };
14
+ //#endregion
15
+ export { context_variables_exports as contextVariables, filterExpression, params_placeholders_exports as paramsPlaceholders, utils_exports as utils, visitors_exports as visitors };
@@ -1,25 +1,30 @@
1
- import type { Schema, TypeObject } from "@fibery/schema";
2
- export type ContextVariable = {
3
- description: string;
4
- id: string;
5
- title: string;
6
- typeObject: TypeObject;
7
- isCollection: boolean;
1
+ import { Schema, TypeObject } from "@fibery/schema";
2
+ declare namespace context_variables_d_exports {
3
+ export { ContextVariable, currentUserContextVariableId, getAutomationButtonContextVariables, getAutomationTriggersContextVariables, getEntityQueryVariables, getTriggerCollectionFieldObject, previousTriggeredEntityContextVariableId, triggeredCollectionItemContextVariableId, triggeredEntityContextVariableId };
4
+ }
5
+ type ContextVariable = {
6
+ description: string;
7
+ id: string;
8
+ title: string;
9
+ typeObject: TypeObject;
10
+ isCollection: boolean;
8
11
  };
9
- export declare const triggeredEntityContextVariableId = "triggeredEntity";
10
- export declare const previousTriggeredEntityContextVariableId = "previousTriggeredEntity";
11
- export declare const currentUserContextVariableId = "currentUser";
12
- export declare const triggeredCollectionItemContextVariableId = "triggered-collection-item";
13
- export declare const getAutomationButtonContextVariables: (typeId: string, fiberySchema: Schema) => Array<ContextVariable>;
14
- export declare const getTriggerCollectionFieldObject: (typeId: string, collectionFieldId: string, fiberySchema: Schema) => import("@fibery/schema").FieldObject | undefined;
15
- export declare const getAutomationTriggersContextVariables: (triggers: Array<{
16
- trigger: string;
17
- args: Record<string, unknown>;
12
+ declare const triggeredEntityContextVariableId = "triggeredEntity";
13
+ declare const previousTriggeredEntityContextVariableId = "previousTriggeredEntity";
14
+ declare const currentUserContextVariableId = "currentUser";
15
+ declare const triggeredCollectionItemContextVariableId = "triggered-collection-item";
16
+ declare const getAutomationButtonContextVariables: (typeId: string, fiberySchema: Schema) => Array<ContextVariable>;
17
+ declare const getTriggerCollectionFieldObject: (typeId: string, collectionFieldId: string, fiberySchema: Schema) => import("@fibery/schema").FieldObject | undefined;
18
+ declare const getAutomationTriggersContextVariables: (triggers: Array<{
19
+ trigger: string;
20
+ args: Record<string, unknown>;
18
21
  }>, typeId: string, fiberySchema: Schema) => Array<ContextVariable>;
19
- export declare const getEntityQueryVariables: (schema: Schema) => {
20
- typeObject: TypeObject;
21
- id: string;
22
- title: string;
23
- isCollection: boolean;
24
- description: string;
22
+ declare const getEntityQueryVariables: (schema: Schema) => {
23
+ typeObject: TypeObject;
24
+ id: string;
25
+ title: string;
26
+ isCollection: boolean;
27
+ description: string;
25
28
  }[];
29
+ //#endregion
30
+ export { ContextVariable, context_variables_d_exports, currentUserContextVariableId, getAutomationButtonContextVariables, getAutomationTriggersContextVariables, getEntityQueryVariables, getTriggerCollectionFieldObject, previousTriggeredEntityContextVariableId, triggeredCollectionItemContextVariableId, triggeredEntityContextVariableId };
@@ -1,148 +1,116 @@
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 = exports.triggeredCollectionItemContextVariableId = exports.currentUserContextVariableId = exports.previousTriggeredEntityContextVariableId = exports.triggeredEntityContextVariableId = void 0;
7
- const flatten_1 = __importDefault(require("lodash/flatten"));
8
- const groupBy_1 = __importDefault(require("lodash/groupBy"));
9
- const uniqBy_1 = __importDefault(require("lodash/uniqBy"));
10
- exports.triggeredEntityContextVariableId = "triggeredEntity";
11
- exports.previousTriggeredEntityContextVariableId = "previousTriggeredEntity";
12
- exports.currentUserContextVariableId = "currentUser";
13
- exports.triggeredCollectionItemContextVariableId = "triggered-collection-item";
1
+ import { __exportAll } from "../_virtual/_rolldown/runtime.js";
2
+ import flatten from "lodash/flatten.js";
3
+ import groupBy from "lodash/groupBy.js";
4
+ import uniqBy from "lodash/uniqBy.js";
5
+ //#region src/context-variables.ts
6
+ var context_variables_exports = /* @__PURE__ */ __exportAll({
7
+ currentUserContextVariableId: () => currentUserContextVariableId,
8
+ getAutomationButtonContextVariables: () => getAutomationButtonContextVariables,
9
+ getAutomationTriggersContextVariables: () => getAutomationTriggersContextVariables,
10
+ getEntityQueryVariables: () => getEntityQueryVariables,
11
+ getTriggerCollectionFieldObject: () => getTriggerCollectionFieldObject,
12
+ previousTriggeredEntityContextVariableId: () => previousTriggeredEntityContextVariableId,
13
+ triggeredCollectionItemContextVariableId: () => triggeredCollectionItemContextVariableId,
14
+ triggeredEntityContextVariableId: () => triggeredEntityContextVariableId
15
+ });
16
+ const triggeredEntityContextVariableId = "triggeredEntity";
17
+ const previousTriggeredEntityContextVariableId = "previousTriggeredEntity";
18
+ const currentUserContextVariableId = "currentUser";
19
+ const triggeredCollectionItemContextVariableId = "triggered-collection-item";
14
20
  const getAutomationButtonContextVariables = (typeId, fiberySchema) => {
15
- if (!fiberySchema) {
16
- return [];
17
- }
18
- const userTypeObject = fiberySchema.typeObjectsByName["fibery/user"];
19
- const typeObject = fiberySchema.typeObjectsById[typeId];
20
- return [
21
- {
22
- id: exports.triggeredEntityContextVariableId,
23
- title: `Step 1 ${typeObject.singularTitle}`,
24
- typeObject,
25
- isCollection: false,
26
- description: `The ${typeObject.singularTitle} for which the Button was clicked`,
27
- },
28
- {
29
- id: exports.currentUserContextVariableId,
30
- title: `User who clicked Button`,
31
- typeObject: userTypeObject,
32
- isCollection: false,
33
- description: `The User who triggered this automation by clicking a Button.`,
34
- },
35
- ];
21
+ if (!fiberySchema) return [];
22
+ const userTypeObject = fiberySchema.typeObjectsByName["fibery/user"];
23
+ const typeObject = fiberySchema.typeObjectsById[typeId];
24
+ return [{
25
+ id: triggeredEntityContextVariableId,
26
+ title: `Step 1 ${typeObject.singularTitle}`,
27
+ typeObject,
28
+ isCollection: false,
29
+ description: `The ${typeObject.singularTitle} for which the Button was clicked`
30
+ }, {
31
+ id: currentUserContextVariableId,
32
+ title: `User who clicked Button`,
33
+ typeObject: userTypeObject,
34
+ isCollection: false,
35
+ description: `The User who triggered this automation by clicking a Button.`
36
+ }];
36
37
  };
37
- exports.getAutomationButtonContextVariables = getAutomationButtonContextVariables;
38
38
  const getTriggerCollectionFieldObject = (typeId, collectionFieldId, fiberySchema) => {
39
- if (!fiberySchema) {
40
- return undefined;
41
- }
42
- if (!Object.hasOwn(fiberySchema.typeObjectsById, typeId)) {
43
- return undefined;
44
- }
45
- if (!Object.hasOwn(fiberySchema.typeObjectsById[typeId].fieldObjectsById, collectionFieldId)) {
46
- return undefined;
47
- }
48
- return fiberySchema.typeObjectsById[typeId].fieldObjectsById[collectionFieldId];
39
+ if (!fiberySchema) return;
40
+ if (!Object.hasOwn(fiberySchema.typeObjectsById, typeId)) return;
41
+ if (!Object.hasOwn(fiberySchema.typeObjectsById[typeId].fieldObjectsById, collectionFieldId)) return;
42
+ return fiberySchema.typeObjectsById[typeId].fieldObjectsById[collectionFieldId];
49
43
  };
50
- exports.getTriggerCollectionFieldObject = getTriggerCollectionFieldObject;
51
44
  const getTriggerContextVariables = (trigger, typeId, fiberySchema) => {
52
- if (!fiberySchema) {
53
- return [];
54
- }
55
- const typeObject = fiberySchema.typeObjectsById[typeId];
56
- const userTypeObject = fiberySchema.typeObjectsByName["fibery/user"];
57
- const triggeredEntityVar = {
58
- id: exports.triggeredEntityContextVariableId,
59
- title: `Step 1 ${typeObject.singularTitle}`,
60
- typeObject,
61
- isCollection: false,
62
- description: `The ${typeObject.singularTitle} from step 1 of this Automation Rule`,
63
- };
64
- const currentUserVar = {
65
- id: exports.currentUserContextVariableId,
66
- title: `User who triggered Rule`,
67
- typeObject: userTypeObject,
68
- isCollection: false,
69
- description: `The User who made the change which triggered this Automation Rule. Empty in case the change was made by a formula or an integration.`,
70
- };
71
- if (trigger.trigger === "time-based") {
72
- return [triggeredEntityVar];
73
- }
74
- else if (trigger.trigger === "created") {
75
- return typeObject.syncSource !== null ? [triggeredEntityVar] : [triggeredEntityVar, currentUserVar];
76
- }
77
- else if (trigger.trigger === "updated") {
78
- const result = [triggeredEntityVar];
79
- const disableCurrentUserVar = trigger.args.updatedField &&
80
- Array.isArray(trigger.args.updatedField) &&
81
- trigger.args.updatedField.some((fieldId) => {
82
- if (!Object.hasOwn(typeObject.fieldObjectsById, fieldId)) {
83
- return false;
84
- }
85
- const fieldObject = typeObject.fieldObjectsById[fieldId];
86
- return fieldObject?.isReadOnly || fieldObject?.type === "Collaboration~Documents/Document";
87
- });
88
- if (!disableCurrentUserVar) {
89
- result.push(currentUserVar);
90
- }
91
- if (trigger.args.updatedField &&
92
- Array.isArray(trigger.args.updatedField) &&
93
- trigger.args.updatedField.length === 1) {
94
- const previousTriggeredEntityContextVariable = {
95
- id: exports.previousTriggeredEntityContextVariableId,
96
- title: `Step 1 ${typeObject.singularTitle} (Previous)`,
97
- typeObject,
98
- isCollection: false,
99
- description: `The previous value of ${typeObject.singularTitle} from step 1 of this Automation Rule`,
100
- };
101
- result.push(previousTriggeredEntityContextVariable);
102
- }
103
- return result;
104
- }
105
- else if (trigger.trigger === "collection-item-added" || trigger.trigger === "collection-item-removed") {
106
- const collectionItemFieldObject = (0, exports.getTriggerCollectionFieldObject)(typeId, trigger.args.changedCollectionField, fiberySchema);
107
- const collectionItemTypeObject = collectionItemFieldObject?.typeObject;
108
- const variables = [triggeredEntityVar];
109
- collectionItemTypeObject &&
110
- variables.push({
111
- id: exports.triggeredCollectionItemContextVariableId,
112
- title: `Step 1 ${trigger.trigger === "collection-item-added" ? "linked" : "unlinked"} ${collectionItemTypeObject.singularTitle}`,
113
- typeObject: collectionItemTypeObject,
114
- isCollection: false,
115
- description: `The ${collectionItemTypeObject.singularTitle} from step 1 of this Automation Rule`,
116
- });
117
- const disableCurrentUserVar = collectionItemFieldObject?.isReadOnly;
118
- !disableCurrentUserVar && variables.push(currentUserVar);
119
- return variables;
120
- }
121
- else {
122
- return [];
123
- }
45
+ if (!fiberySchema) return [];
46
+ const typeObject = fiberySchema.typeObjectsById[typeId];
47
+ const userTypeObject = fiberySchema.typeObjectsByName["fibery/user"];
48
+ const triggeredEntityVar = {
49
+ id: triggeredEntityContextVariableId,
50
+ title: `Step 1 ${typeObject.singularTitle}`,
51
+ typeObject,
52
+ isCollection: false,
53
+ description: `The ${typeObject.singularTitle} from step 1 of this Automation Rule`
54
+ };
55
+ const currentUserVar = {
56
+ id: currentUserContextVariableId,
57
+ title: `User who triggered Rule`,
58
+ typeObject: userTypeObject,
59
+ isCollection: false,
60
+ description: `The User who made the change which triggered this Automation Rule. Empty in case the change was made by a formula or an integration.`
61
+ };
62
+ if (trigger.trigger === "time-based") return [triggeredEntityVar];
63
+ else if (trigger.trigger === "created") return typeObject.syncSource !== null ? [triggeredEntityVar] : [triggeredEntityVar, currentUserVar];
64
+ else if (trigger.trigger === "updated") {
65
+ const result = [triggeredEntityVar];
66
+ if (!(trigger.args.updatedField && Array.isArray(trigger.args.updatedField) && trigger.args.updatedField.some((fieldId) => {
67
+ if (!Object.hasOwn(typeObject.fieldObjectsById, fieldId)) return false;
68
+ const fieldObject = typeObject.fieldObjectsById[fieldId];
69
+ return fieldObject?.isReadOnly || fieldObject?.type === "Collaboration~Documents/Document";
70
+ }))) result.push(currentUserVar);
71
+ if (trigger.args.updatedField && Array.isArray(trigger.args.updatedField) && trigger.args.updatedField.length === 1) {
72
+ const previousTriggeredEntityContextVariable = {
73
+ id: previousTriggeredEntityContextVariableId,
74
+ title: `Step 1 ${typeObject.singularTitle} (Previous)`,
75
+ typeObject,
76
+ isCollection: false,
77
+ description: `The previous value of ${typeObject.singularTitle} from step 1 of this Automation Rule`
78
+ };
79
+ result.push(previousTriggeredEntityContextVariable);
80
+ }
81
+ return result;
82
+ } else if (trigger.trigger === "collection-item-added" || trigger.trigger === "collection-item-removed") {
83
+ const collectionItemFieldObject = getTriggerCollectionFieldObject(typeId, trigger.args.changedCollectionField, fiberySchema);
84
+ const collectionItemTypeObject = collectionItemFieldObject?.typeObject;
85
+ const variables = [triggeredEntityVar];
86
+ collectionItemTypeObject && variables.push({
87
+ id: "triggered-collection-item",
88
+ title: `Step 1 ${trigger.trigger === "collection-item-added" ? "linked" : "unlinked"} ${collectionItemTypeObject.singularTitle}`,
89
+ typeObject: collectionItemTypeObject,
90
+ isCollection: false,
91
+ description: `The ${collectionItemTypeObject.singularTitle} from step 1 of this Automation Rule`
92
+ });
93
+ !collectionItemFieldObject?.isReadOnly && variables.push(currentUserVar);
94
+ return variables;
95
+ } else return [];
124
96
  };
125
97
  const getAutomationTriggersContextVariables = (triggers, typeId, fiberySchema) => {
126
- const triggerContextVars = triggers.flatMap((trigger) => {
127
- return getTriggerContextVariables(trigger, typeId, fiberySchema);
128
- });
129
- const filteredContextVars = triggers.length > 1
130
- ? triggerContextVars.filter((variable) => variable.id !== exports.previousTriggeredEntityContextVariableId)
131
- : triggerContextVars;
132
- return (0, uniqBy_1.default)(filteredContextVars, (variable) => `${variable.id}_${variable.typeObject.id}`);
98
+ const triggerContextVars = triggers.flatMap((trigger) => {
99
+ return getTriggerContextVariables(trigger, typeId, fiberySchema);
100
+ });
101
+ return uniqBy(triggers.length > 1 ? triggerContextVars.filter((variable) => variable.id !== previousTriggeredEntityContextVariableId) : triggerContextVars, (variable) => `${variable.id}_${variable.typeObject.id}`);
133
102
  };
134
- exports.getAutomationTriggersContextVariables = getAutomationTriggersContextVariables;
135
103
  const getEntityQueryVariables = (schema) => {
136
- const grouped = (0, groupBy_1.default)(schema.typeObjects.filter((x) => x.isDomain), (typeObject) => typeObject.pluralTitle);
137
- return (0, flatten_1.default)(Object.values(grouped).map((group) => {
138
- return group.map((typeObject) => ({
139
- typeObject,
140
- id: `entityQuery_${typeObject.id}`,
141
- title: group.length > 1 ? `${typeObject.pluralTitle} (${typeObject.nameParts.namespace})` : typeObject.pluralTitle,
142
- isCollection: true,
143
- description: `All Entities from "${typeObject.title}" Database`,
144
- }));
145
- }));
104
+ const grouped = groupBy(schema.typeObjects.filter((x) => x.isDomain), (typeObject) => typeObject.pluralTitle);
105
+ return flatten(Object.values(grouped).map((group) => {
106
+ return group.map((typeObject) => ({
107
+ typeObject,
108
+ id: `entityQuery_${typeObject.id}`,
109
+ title: group.length > 1 ? `${typeObject.pluralTitle} (${typeObject.nameParts.namespace})` : typeObject.pluralTitle,
110
+ isCollection: true,
111
+ description: `All Entities from "${typeObject.title}" Database`
112
+ }));
113
+ }));
146
114
  };
147
- exports.getEntityQueryVariables = getEntityQueryVariables;
148
- //# sourceMappingURL=context-variables.js.map
115
+ //#endregion
116
+ export { context_variables_exports, currentUserContextVariableId, getAutomationButtonContextVariables, getAutomationTriggersContextVariables, getEntityQueryVariables, getTriggerCollectionFieldObject, previousTriggeredEntityContextVariableId, triggeredCollectionItemContextVariableId, triggeredEntityContextVariableId };
@@ -1,3 +1,6 @@
1
- export declare class NotImplementedError extends Error {
2
- constructor(value: unknown, itemType?: string);
1
+ //#region src/errors.d.ts
2
+ declare class NotImplementedError extends Error {
3
+ constructor(value: unknown, itemType?: string);
3
4
  }
5
+ //#endregion
6
+ export { NotImplementedError };
package/lib/src/errors.js CHANGED
@@ -1,16 +1,16 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NotImplementedError = void 0;
1
+ //#region src/errors.ts
4
2
  const stringify = (x) => {
5
- if (x === undefined) {
6
- return "undefined";
7
- }
8
- return JSON.stringify(x);
3
+ if (x === void 0) return "undefined";
4
+ return JSON.stringify(x);
9
5
  };
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;
16
- //# sourceMappingURL=errors.js.map
6
+ var NotImplementedError = class extends Error {
7
+ constructor(value, itemType) {
8
+ super([
9
+ `"${stringify(value)}"`,
10
+ itemType,
11
+ "is not implemented"
12
+ ].filter((x) => x !== void 0).join(" "));
13
+ }
14
+ };
15
+ //#endregion
16
+ export { NotImplementedError };
@@ -1,23 +1,25 @@
1
- import type { FieldObject, TypeObject } from "@fibery/schema";
2
- import type { FieldExpression, MultiFieldAccess } from "./types";
1
+ import { ExpressionVisitor, FieldExpression, MultiFieldAccess } from "./types.js";
2
+ import { FieldObject, TypeObject } from "@fibery/schema";
3
+ //#region src/field-expression-visitor-type-aware.d.ts
3
4
  type FieldAccess = string | MultiFieldAccess;
4
5
  type OnFieldResult = {
5
- typeObject: TypeObject;
6
- fieldAccess: FieldAccess;
6
+ typeObject: TypeObject;
7
+ fieldAccess: FieldAccess;
7
8
  } | undefined;
8
9
  type OnField = (params: {
9
- fieldAccess: FieldAccess;
10
- fieldObject: FieldObject;
11
- typeObject: TypeObject;
10
+ fieldAccess: FieldAccess;
11
+ fieldObject: FieldObject;
12
+ typeObject: TypeObject;
12
13
  }) => OnFieldResult;
13
14
  type OnFieldNotFound = (params: {
14
- currentTypeObject: TypeObject;
15
- expression: FieldExpression;
16
- fieldAccess: FieldAccess;
15
+ currentTypeObject: TypeObject;
16
+ expression: FieldExpression;
17
+ fieldAccess: FieldAccess;
17
18
  }) => OnFieldResult;
18
- export declare const fieldAccessVisitorTypeAware: ({ typeObject, onField, onFieldNotFound, }: {
19
- typeObject: TypeObject;
20
- onField?: OnField;
21
- onFieldNotFound?: OnFieldNotFound;
22
- }) => Required<import("./types").ExpressionVisitor>;
23
- export {};
19
+ declare const fieldAccessVisitorTypeAware: ({ typeObject, onField, onFieldNotFound }: {
20
+ typeObject: TypeObject;
21
+ onField?: OnField;
22
+ onFieldNotFound?: OnFieldNotFound;
23
+ }) => Required<ExpressionVisitor>;
24
+ //#endregion
25
+ export { fieldAccessVisitorTypeAware };