@memberjunction/ai-agents 2.64.0 → 2.66.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.
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.formatPathWithOperations = exports.isOperationAllowed = exports.parsePathsWithOperations = exports.parsePathWithOperations = exports.ALL_OPERATIONS = void 0;
4
+ exports.ALL_OPERATIONS = ['add', 'update', 'delete'];
5
+ function parsePathWithOperations(pathSpec) {
6
+ if (!pathSpec || typeof pathSpec !== 'string') {
7
+ return { path: '', operations: [], allOperations: false };
8
+ }
9
+ const colonIndex = pathSpec.lastIndexOf(':');
10
+ if (colonIndex === -1) {
11
+ return {
12
+ path: pathSpec,
13
+ operations: [...exports.ALL_OPERATIONS],
14
+ allOperations: true
15
+ };
16
+ }
17
+ const path = pathSpec.substring(0, colonIndex);
18
+ const opsString = pathSpec.substring(colonIndex + 1);
19
+ const operations = [];
20
+ if (opsString) {
21
+ const opsList = opsString.split(',').map(op => op.trim().toLowerCase());
22
+ for (const op of opsList) {
23
+ if (op === 'add' || op === 'update' || op === 'delete') {
24
+ if (!operations.includes(op)) {
25
+ operations.push(op);
26
+ }
27
+ }
28
+ }
29
+ }
30
+ if (operations.length === 0) {
31
+ return { path, operations: [], allOperations: false };
32
+ }
33
+ return {
34
+ path,
35
+ operations,
36
+ allOperations: operations.length === exports.ALL_OPERATIONS.length &&
37
+ exports.ALL_OPERATIONS.every(op => operations.includes(op))
38
+ };
39
+ }
40
+ exports.parsePathWithOperations = parsePathWithOperations;
41
+ function parsePathsWithOperations(pathSpecs) {
42
+ if (!Array.isArray(pathSpecs)) {
43
+ return [];
44
+ }
45
+ return pathSpecs.map(spec => parsePathWithOperations(spec));
46
+ }
47
+ exports.parsePathsWithOperations = parsePathsWithOperations;
48
+ function isOperationAllowed(parsedPath, operation) {
49
+ return parsedPath.allOperations || parsedPath.operations.includes(operation);
50
+ }
51
+ exports.isOperationAllowed = isOperationAllowed;
52
+ function formatPathWithOperations(parsedPath) {
53
+ if (parsedPath.allOperations) {
54
+ return parsedPath.path;
55
+ }
56
+ if (parsedPath.operations.length === 0) {
57
+ return `${parsedPath.path}:none`;
58
+ }
59
+ return `${parsedPath.path}:${parsedPath.operations.join(',')}`;
60
+ }
61
+ exports.formatPathWithOperations = formatPathWithOperations;
62
+ //# sourceMappingURL=payload-operations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payload-operations.js","sourceRoot":"","sources":["../../src/types/payload-operations.ts"],"names":[],"mappings":";;;AAiBa,QAAA,cAAc,GAAuB,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;AA0B9E,SAAgB,uBAAuB,CAAC,QAAgB;IACpD,IAAI,CAAC,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAC5C,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC;IAC9D,CAAC;IAED,MAAM,UAAU,GAAG,QAAQ,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAG7C,IAAI,UAAU,KAAK,CAAC,CAAC,EAAE,CAAC;QACpB,OAAO;YACH,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE,CAAC,GAAG,sBAAc,CAAC;YAC/B,aAAa,EAAE,IAAI;SACtB,CAAC;IACN,CAAC;IAED,MAAM,IAAI,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;IAC/C,MAAM,SAAS,GAAG,QAAQ,CAAC,SAAS,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC;IAGrD,MAAM,UAAU,GAAuB,EAAE,CAAC;IAC1C,IAAI,SAAS,EAAE,CAAC;QACZ,MAAM,OAAO,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,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CAAC,aAAa,EAAE,CAAC;QAC3B,OAAO,UAAU,CAAC,IAAI,CAAC;IAC3B,CAAC;IAED,IAAI,UAAU,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACrC,OAAO,GAAG,UAAU,CAAC,IAAI,OAAO,CAAC;IACrC,CAAC;IAED,OAAO,GAAG,UAAU,CAAC,IAAI,IAAI,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;AACnE,CAAC;AAVD,4DAUC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memberjunction/ai-agents",
3
- "version": "2.64.0",
3
+ "version": "2.66.0",
4
4
  "description": "MemberJunction: AI Agent Execution and Management",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -15,15 +15,15 @@
15
15
  "author": "MemberJunction.com",
16
16
  "license": "ISC",
17
17
  "dependencies": {
18
- "@memberjunction/core": "2.64.0",
19
- "@memberjunction/global": "2.64.0",
20
- "@memberjunction/core-entities": "2.64.0",
21
- "@memberjunction/ai": "2.64.0",
22
- "@memberjunction/ai-core-plus": "2.64.0",
23
- "@memberjunction/aiengine": "2.64.0",
24
- "@memberjunction/ai-prompts": "2.64.0",
25
- "@memberjunction/actions": "2.64.0",
26
- "@memberjunction/actions-base": "2.64.0",
18
+ "@memberjunction/core": "2.66.0",
19
+ "@memberjunction/global": "2.66.0",
20
+ "@memberjunction/core-entities": "2.66.0",
21
+ "@memberjunction/ai": "2.66.0",
22
+ "@memberjunction/ai-core-plus": "2.66.0",
23
+ "@memberjunction/aiengine": "2.66.0",
24
+ "@memberjunction/ai-prompts": "2.66.0",
25
+ "@memberjunction/actions": "2.66.0",
26
+ "@memberjunction/actions-base": "2.66.0",
27
27
  "dotenv": "^16.4.1",
28
28
  "lodash": "^4.17.21",
29
29
  "rxjs": "^7.8.1"