@cargolift-cdi/lib-payload 0.1.2 → 0.1.3

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.
@@ -1,4 +1,5 @@
1
1
  export * from "./payload-validation/payload-validation.js";
2
2
  export * from "./payload-validation/payload-validation.interface.js";
3
3
  export * from "./payload-response-interpreter/payload-response-interpreter.js";
4
+ export * from "./payload-transformation/payload-transformation.js";
4
5
  export * from "./util/util.js";
@@ -0,0 +1,11 @@
1
+ import jsonata from "jsonata";
2
+ export interface PayloadTransformationResult {
3
+ success: boolean;
4
+ result: any;
5
+ error?: string;
6
+ }
7
+ export declare class PayloadTransformation {
8
+ static transform(expression: string, payload: any): Promise<PayloadTransformationResult>;
9
+ static compileExpression(expression: string): jsonata.Expression | null;
10
+ static evaluateCompiled(compiled: jsonata.Expression, payload: any): Promise<PayloadTransformationResult>;
11
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cargolift-cdi/lib-payload",
3
3
  "private": false,
4
- "version": "0.1.2",
4
+ "version": "0.1.3",
5
5
  "description": "Lib de tratamento e validação de payloads para serviços do middleware da Cargolift CDI",
6
6
  "license": "MIT",
7
7
  "type": "module",
@@ -35,7 +35,7 @@
35
35
  "smoke": "npm run build:smoke && node ./dist/smoke/smoke-run.js",
36
36
  "smoke_debug": "npm run build:smoke && node ./dist/smoke/smoke-debug.js",
37
37
  "prepare": "npm run build",
38
- "prepublishOnly": "npm run build && npm test",
38
+ "prepublishOnly": "npm run build && npm test && npm version patch --no-git-tag-version",
39
39
  "test": "vitest run --reporter=dot",
40
40
  "test:watch": "vitest"
41
41
  },
@@ -49,6 +49,7 @@
49
49
  },
50
50
  "dependencies": {
51
51
  "@cargolift-cdi/common": "^1.0.62",
52
- "@cargolift-cdi/types": "^0.1.67"
52
+ "@cargolift-cdi/types": "^0.1.67",
53
+ "jsonata": "^2.1.0"
53
54
  }
54
55
  }