@nodrel-dev/n8n-nodes-ups 0.7.0 → 0.7.2

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/README.md CHANGED
@@ -264,6 +264,29 @@ npm run build # compile to dist/
264
264
  npm run dev # run locally inside n8n (Node.js >= 22.22)
265
265
  ```
266
266
 
267
+ ### End-to-end harness
268
+
269
+ Unit tests cover the pure transform cores; the operations themselves are verified against the
270
+ UPS Customer Integration Environment (CIE) in a real n8n container:
271
+
272
+ ```bash
273
+ ./scripts/harness-up.sh up # build, boot n8n in Docker, seed the credential, import workflows
274
+ ./scripts/harness-up.sh run # execute gates 1-4b headlessly and print each result
275
+ ./scripts/harness-up.sh down # tear it down
276
+ ```
277
+
278
+ `up` reads your UPS client id/secret from a gitignored `.env.local`. Gate 5 is the AI-Agent
279
+ **tool** path — it needs an Anthropic credential and the chat UI, so it is run from the browser
280
+ rather than headlessly.
281
+
282
+ ### Dependencies and security
283
+
284
+ The package ships **zero runtime dependencies**, so the production tree is empty and the
285
+ published tarball is `LICENSE` + `README` + `dist` only. Everything in `npm audit` is therefore
286
+ dev-toolchain and never reaches an installed node. Dependabot alerts and grouped weekly updates
287
+ are enabled; advisories that remain are inside `@n8n/node-cli`'s own dependency tree and clear
288
+ when it releases.
289
+
267
290
  Releases are driven by [release-please](https://github.com/googleapis/release-please): merge the auto-generated release PR on `main` and the workflow tags, publishes to npm with provenance, and scans. Never run a release or `npm publish` locally.
268
291
 
269
292
  ## Resources
@@ -0,0 +1 @@
1
+ export declare function sanitizeTrackingNumber(raw: unknown): string | null;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sanitizeTrackingNumber = sanitizeTrackingNumber;
4
+ const TRACKING_NUMBER = /^[A-Za-z0-9]{1,35}$/;
5
+ function sanitizeTrackingNumber(raw) {
6
+ if (typeof raw !== 'string')
7
+ return null;
8
+ const trimmed = raw.trim();
9
+ return TRACKING_NUMBER.test(trimmed) ? trimmed : null;
10
+ }
11
+ //# sourceMappingURL=sanitizeTrackingNumber.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sanitizeTrackingNumber.js","sourceRoot":"","sources":["../../../../nodes/Ups/core/sanitizeTrackingNumber.ts"],"names":[],"mappings":";;AAoBA,wDAIC;AAXD,MAAM,eAAe,GAAG,qBAAqB,CAAC;AAO9C,SAAgB,sBAAsB,CAAC,GAAY;IAClD,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IACzC,MAAM,OAAO,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;IAC3B,OAAO,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC;AACvD,CAAC"}
@@ -1,4 +1,5 @@
1
- import type { IExecuteSingleFunctions, IN8nHttpFullResponse, INodeExecutionData, INodeProperties } from 'n8n-workflow';
1
+ import { type IExecuteSingleFunctions, type IHttpRequestOptions, type IN8nHttpFullResponse, type INodeExecutionData, type INodeProperties } from 'n8n-workflow';
2
+ declare function trackPreSend(this: IExecuteSingleFunctions, requestOptions: IHttpRequestOptions): Promise<IHttpRequestOptions>;
2
3
  declare function trackPostReceive(this: IExecuteSingleFunctions, _items: INodeExecutionData[], response: IN8nHttpFullResponse): Promise<INodeExecutionData[]>;
3
4
  export declare const trackOperationDescription: INodeProperties[];
4
5
  export declare const trackOperationOption: {
@@ -16,6 +17,9 @@ export declare const trackOperationOption: {
16
17
  };
17
18
  ignoreHttpStatusErrors: boolean;
18
19
  };
20
+ send: {
21
+ preSend: (typeof trackPreSend)[];
22
+ };
19
23
  output: {
20
24
  postReceive: (typeof trackPostReceive)[];
21
25
  };
@@ -1,12 +1,25 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.trackOperationOption = exports.trackOperationDescription = void 0;
4
+ const n8n_workflow_1 = require("n8n-workflow");
4
5
  const mapTrackStatus_1 = require("../../core/mapTrackStatus");
5
6
  const mapUpsError_1 = require("../../core/mapUpsError");
7
+ const sanitizeTrackingNumber_1 = require("../../core/sanitizeTrackingNumber");
6
8
  const showOnlyForTrack = {
7
9
  operation: ['track'],
8
10
  resource: ['tracking'],
9
11
  };
12
+ async function trackPreSend(requestOptions) {
13
+ const raw = this.getNodeParameter('trackingNumber', '');
14
+ const trackingNumber = (0, sanitizeTrackingNumber_1.sanitizeTrackingNumber)(raw);
15
+ if (trackingNumber === null) {
16
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Invalid UPS tracking number.', {
17
+ description: 'A UPS inquiry number is letters and digits only (for example 1Z9999999999999999), up to 35 characters. Remove any spaces, slashes, or punctuation — and if this value comes from an earlier node, check it is the tracking number and not a URL or a whole record.',
18
+ });
19
+ }
20
+ requestOptions.url = `/track/v1/details/${trackingNumber}`;
21
+ return requestOptions;
22
+ }
10
23
  async function trackPostReceive(_items, response) {
11
24
  if (response.statusCode >= 400) {
12
25
  (0, mapUpsError_1.mapUpsError)(this.getNode(), response.body, response.statusCode);
@@ -65,6 +78,9 @@ exports.trackOperationOption = {
65
78
  },
66
79
  ignoreHttpStatusErrors: true,
67
80
  },
81
+ send: {
82
+ preSend: [trackPreSend],
83
+ },
68
84
  output: {
69
85
  postReceive: [trackPostReceive],
70
86
  },
@@ -1 +1 @@
1
- {"version":3,"file":"track.operation.js","sourceRoot":"","sources":["../../../../../nodes/Ups/resources/tracking/track.operation.ts"],"names":[],"mappings":";;;AAMA,8DAA6E;AAC7E,wDAAqD;AAErD,MAAM,gBAAgB,GAAG;IACxB,SAAS,EAAE,CAAC,OAAO,CAAC;IACpB,QAAQ,EAAE,CAAC,UAAU,CAAC;CACtB,CAAC;AAKF,KAAK,UAAU,gBAAgB,CAE9B,MAA4B,EAC5B,QAA8B;IAE9B,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,EAAE,CAAC;QAChC,IAAA,yBAAW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E,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE;SAC3C;KACD;CACD,CAAC;AAGW,QAAA,oBAAoB,GAAG;IACnC,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,kBAAkB;IAC1B,WAAW,EAAE,2DAA2D;IACxE,OAAO,EAAE;QACR,OAAO,EAAE;YACR,MAAM,EAAE,KAAc;YACtB,GAAG,EAAE,kDAAkD;YAMvD,OAAO,EAAE;gBACR,OAAO,EAAE,iCAAiC;gBAC1C,cAAc,EAAE,eAAe;aAC/B;YACD,sBAAsB,EAAE,IAAI;SAC5B;QACD,MAAM,EAAE;YACP,WAAW,EAAE,CAAC,gBAAgB,CAAC;SAC/B;KACD;CACD,CAAC"}
1
+ {"version":3,"file":"track.operation.js","sourceRoot":"","sources":["../../../../../nodes/Ups/resources/tracking/track.operation.ts"],"names":[],"mappings":";;;AAAA,+CAOsB;AACtB,8DAA6E;AAC7E,wDAAqD;AACrD,8EAA2E;AAE3E,MAAM,gBAAgB,GAAG;IACxB,SAAS,EAAE,CAAC,OAAO,CAAC;IACpB,QAAQ,EAAE,CAAC,UAAU,CAAC;CACtB,CAAC;AASF,KAAK,UAAU,YAAY,CAE1B,cAAmC;IAEnC,MAAM,GAAG,GAAG,IAAI,CAAC,gBAAgB,CAAC,gBAAgB,EAAE,EAAE,CAAY,CAAC;IACnE,MAAM,cAAc,GAAG,IAAA,+CAAsB,EAAC,GAAG,CAAC,CAAC;IAEnD,IAAI,cAAc,KAAK,IAAI,EAAE,CAAC;QAC7B,MAAM,IAAI,iCAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,8BAA8B,EAAE;YAC5E,WAAW,EACV,oQAAoQ;SACrQ,CAAC,CAAC;IACJ,CAAC;IAED,cAAc,CAAC,GAAG,GAAG,qBAAqB,cAAc,EAAE,CAAC;IAC3D,OAAO,cAAc,CAAC;AACvB,CAAC;AAKD,KAAK,UAAU,gBAAgB,C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AAc,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE;QAC1C,WAAW,EACV,oFAAoF;QACrF,OAAO,EAAE;YACR,IAAI,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE;SAC3C;KACD;CACD,CAAC;AAGW,QAAA,oBAAoB,GAAG;IACnC,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,kBAAkB;IAC1B,WAAW,EAAE,2DAA2D;IACxE,OAAO,EAAE;QACR,OAAO,EAAE;YACR,MAAM,EAAE,KAAc;YACtB,GAAG,EAAE,kDAAkD;YAMvD,OAAO,EAAE;gBACR,OAAO,EAAE,iCAAiC;gBAC1C,cAAc,EAAE,eAAe;aAC/B;YACD,sBAAsB,EAAE,IAAI;SAC5B;QACD,IAAI,EAAE;YACL,OAAO,EAAE,CAAC,YAAY,CAAC;SACvB;QACD,MAAM,EAAE;YACP,WAAW,EAAE,CAAC,gBAAgB,CAAC;SAC/B;KACD;CACD,CAAC"}
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nodrel-dev/n8n-nodes-ups",
3
- "version": "0.7.0",
3
+ "version": "0.7.2",
4
4
  "description": "n8n community node for UPS: rating, tracking, and address validation via the UPS REST API.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/nodrel-dev/n8n-ups-node",
@@ -47,7 +47,7 @@
47
47
  "devDependencies": {
48
48
  "@commitlint/cli": "^21.0.2",
49
49
  "@commitlint/config-conventional": "^21.0.2",
50
- "@n8n/node-cli": "*",
50
+ "@n8n/node-cli": "^0.46.4",
51
51
  "@types/node": "^22.19.21",
52
52
  "eslint": "9.32.0",
53
53
  "lefthook": "^2.1.9",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nodrel-dev/n8n-nodes-ups",
3
- "version": "0.7.0",
3
+ "version": "0.7.2",
4
4
  "description": "n8n community node for UPS: rating, tracking, and address validation via the UPS REST API.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/nodrel-dev/n8n-ups-node",
@@ -47,7 +47,7 @@
47
47
  "devDependencies": {
48
48
  "@commitlint/cli": "^21.0.2",
49
49
  "@commitlint/config-conventional": "^21.0.2",
50
- "@n8n/node-cli": "*",
50
+ "@n8n/node-cli": "^0.46.4",
51
51
  "@types/node": "^22.19.21",
52
52
  "eslint": "9.32.0",
53
53
  "lefthook": "^2.1.9",