@nodrel-dev/n8n-nodes-fedex 0.1.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 (57) hide show
  1. package/README.md +113 -0
  2. package/dist/credentials/FedexOAuth2Api.credentials.d.ts +9 -0
  3. package/dist/credentials/FedexOAuth2Api.credentials.js +57 -0
  4. package/dist/credentials/FedexOAuth2Api.credentials.js.map +1 -0
  5. package/dist/credentials/fedex.dark.svg +5 -0
  6. package/dist/credentials/fedex.svg +5 -0
  7. package/dist/nodes/Fedex/Fedex.node.d.ts +4 -0
  8. package/dist/nodes/Fedex/Fedex.node.js +50 -0
  9. package/dist/nodes/Fedex/Fedex.node.js.map +1 -0
  10. package/dist/nodes/Fedex/Fedex.node.json +18 -0
  11. package/dist/nodes/Fedex/constants.d.ts +8 -0
  12. package/dist/nodes/Fedex/constants.js +50 -0
  13. package/dist/nodes/Fedex/constants.js.map +1 -0
  14. package/dist/nodes/Fedex/cores/extractLabel.d.ts +15 -0
  15. package/dist/nodes/Fedex/cores/extractLabel.js +49 -0
  16. package/dist/nodes/Fedex/cores/extractLabel.js.map +1 -0
  17. package/dist/nodes/Fedex/cores/fedexTypes.d.ts +27 -0
  18. package/dist/nodes/Fedex/cores/fedexTypes.js +3 -0
  19. package/dist/nodes/Fedex/cores/fedexTypes.js.map +1 -0
  20. package/dist/nodes/Fedex/cores/shapeRates.d.ts +8 -0
  21. package/dist/nodes/Fedex/cores/shapeRates.js +24 -0
  22. package/dist/nodes/Fedex/cores/shapeRates.js.map +1 -0
  23. package/dist/nodes/Fedex/cores/toFedexAddress.d.ts +10 -0
  24. package/dist/nodes/Fedex/cores/toFedexAddress.js +24 -0
  25. package/dist/nodes/Fedex/cores/toFedexAddress.js.map +1 -0
  26. package/dist/nodes/Fedex/cores/toFedexContact.d.ts +8 -0
  27. package/dist/nodes/Fedex/cores/toFedexContact.js +16 -0
  28. package/dist/nodes/Fedex/cores/toFedexContact.js.map +1 -0
  29. package/dist/nodes/Fedex/fedex.dark.svg +5 -0
  30. package/dist/nodes/Fedex/fedex.svg +5 -0
  31. package/dist/nodes/Fedex/fields.d.ts +16 -0
  32. package/dist/nodes/Fedex/fields.js +201 -0
  33. package/dist/nodes/Fedex/fields.js.map +1 -0
  34. package/dist/nodes/Fedex/resources/address/index.d.ts +2 -0
  35. package/dist/nodes/Fedex/resources/address/index.js +30 -0
  36. package/dist/nodes/Fedex/resources/address/index.js.map +1 -0
  37. package/dist/nodes/Fedex/resources/address/validate.d.ts +3 -0
  38. package/dist/nodes/Fedex/resources/address/validate.js +48 -0
  39. package/dist/nodes/Fedex/resources/address/validate.js.map +1 -0
  40. package/dist/nodes/Fedex/resources/shared.d.ts +12 -0
  41. package/dist/nodes/Fedex/resources/shared.js +69 -0
  42. package/dist/nodes/Fedex/resources/shared.js.map +1 -0
  43. package/dist/nodes/Fedex/resources/shipment/create.d.ts +4 -0
  44. package/dist/nodes/Fedex/resources/shipment/create.js +86 -0
  45. package/dist/nodes/Fedex/resources/shipment/create.js.map +1 -0
  46. package/dist/nodes/Fedex/resources/shipment/getRates.d.ts +4 -0
  47. package/dist/nodes/Fedex/resources/shipment/getRates.js +38 -0
  48. package/dist/nodes/Fedex/resources/shipment/getRates.js.map +1 -0
  49. package/dist/nodes/Fedex/resources/shipment/index.d.ts +2 -0
  50. package/dist/nodes/Fedex/resources/shipment/index.js +56 -0
  51. package/dist/nodes/Fedex/resources/shipment/index.js.map +1 -0
  52. package/dist/nodes/Fedex/resources/shipment/track.d.ts +3 -0
  53. package/dist/nodes/Fedex/resources/shipment/track.js +61 -0
  54. package/dist/nodes/Fedex/resources/shipment/track.js.map +1 -0
  55. package/dist/package.json +42 -0
  56. package/dist/tsconfig.tsbuildinfo +1 -0
  57. package/package.json +42 -0
package/README.md ADDED
@@ -0,0 +1,113 @@
1
+ # n8n-nodes-fedex
2
+
3
+ This is an [n8n](https://n8n.io/) community node. It lets you use the **FedEx REST API** directly in your n8n workflows — track shipments, validate addresses, quote rates, and create shipping labels against your own FedEx account, with no aggregator in the middle.
4
+
5
+ Because the node talks straight to FedEx with your API credentials, you get **your own negotiated rates** and your account is billed directly.
6
+
7
+ [n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/sustainable-use-license/) workflow automation platform.
8
+
9
+ [Installation](#installation)
10
+ [Operations](#operations)
11
+ [Credentials](#credentials)
12
+ [Compatibility](#compatibility)
13
+ [Usage](#usage)
14
+ [Resources](#resources)
15
+ [Version history](#version-history)
16
+
17
+ ## Installation
18
+
19
+ Follow the [installation guide](https://docs.n8n.io/integrations/community-nodes/installation/) in the n8n community nodes documentation. In n8n, go to **Settings → Community Nodes → Install** and enter `@nodrel-dev/n8n-nodes-fedex`.
20
+
21
+ ## Operations
22
+
23
+ The node exposes two resources: **Shipment** and **Address**.
24
+
25
+ ### Shipment
26
+
27
+ - **Track** — Get the status and scan history for one or more tracking numbers (`POST /track/v1/trackingnumbers`). Toggle **Track Multiple Numbers** to pass a comma-separated list, and **Include Detailed Scans** for the full scan event history.
28
+ - **Get Rates** — Quote negotiated and list rates for available services (`POST /rate/v1/rates/quotes`). Leave **Service Type** as _All Available Services_ to compare every eligible service, or pin a single one. Requires a **Shipping Account Number**.
29
+ - **Create** — Buy a shipment and get a printable label plus tracking number (`POST /ship/v1/shipments`). The label is returned as **n8n binary data** (see [Usage](#usage)). Requires a **Shipping Account Number**.
30
+
31
+ ### Address
32
+
33
+ - **Validate** — Standardize an address and classify it residential vs commercial (`POST /address/v1/addresses/resolve`).
34
+
35
+ ## Credentials
36
+
37
+ You authenticate with a FedEx **API Key** and **Secret Key** using OAuth2 client-credentials. n8n performs the token exchange and refreshes the ~1 hour token automatically — you never handle tokens yourself.
38
+
39
+ ### Prerequisites
40
+
41
+ 1. Create a free account on the [FedEx Developer Portal](https://developer.fedex.com/).
42
+ 2. Create a project and add the APIs you need (Track, Address Validation, Rate, Ship).
43
+ 3. The portal issues an **API Key** (client ID) and **Secret Key** (client secret) for both a **test/sandbox** project and, once approved, a **production** project.
44
+ 4. For Get Rates and Create you also need your FedEx **shipping account number**.
45
+
46
+ ### Set up the credential in n8n
47
+
48
+ 1. Add a new **FedEx OAuth2 API** credential.
49
+ 2. Set **Environment** to **Sandbox (Test)** while developing, or **Production (Live)** for real shipments. This single switch points both the OAuth token URL and every API request at the matching FedEx host, so a request can never straddle sandbox and production.
50
+ 3. Enter your **Client ID** (FedEx API Key) and **Client Secret** (FedEx Secret Key).
51
+ 4. Save — n8n will fetch a token to confirm the credentials work.
52
+
53
+ > **Sandbox vs production:** the credential defaults to **Sandbox** on purpose, so a half-configured connection can't hit a live account. Switch to **Production** only when you are ready to create real, billable shipments.
54
+
55
+ ### You will likely need two FedEx projects (and two credentials)
56
+
57
+ The FedEx Developer Portal provisions the **Track API** in a different group from the **shipping** APIs (Rate, Ship, Address Validation), so a single portal project usually cannot hold all four — each project issues its own API Key / Secret Key.
58
+
59
+ This node handles that cleanly: create **two** _FedEx OAuth2 API_ credentials in n8n and select the right one per node.
60
+
61
+ - **Track credential** → from the project that has the Track API → use on **Track** nodes.
62
+ - **Shipping credential** → from the project that has Rate + Ship + Address Validation → use on **Get Rates**, **Create**, and **Validate** nodes.
63
+
64
+ (If your portal account does provision all four APIs in one project, a single credential is fine.)
65
+
66
+ ### Production: Create (Ship) requires FedEx label certification
67
+
68
+ Sandbox label creation works immediately. **Production** is different: before FedEx authorizes your production credentials to transmit live label transactions, you must complete the [FedEx Shipper Validation](https://developer.fedex.com/) process — generate sample labels, submit them to the FedEx Bar Code Analysis group, and wait for approval (about a three-business-day turnaround). Approval is **per project**. Track, Get Rates, and Validate do not require this; only Ship does.
69
+
70
+ ## Compatibility
71
+
72
+ - Requires n8n with `n8nNodesApiVersion: 1`.
73
+ - Built and tested against the FedEx REST API (Track v1, Address v1, Rate v1, Ship v1).
74
+ - The shipping **account number** is never defaulted or hardcoded — it always comes from the node field, and your API keys live only in the credential.
75
+
76
+ ## Security & dependencies
77
+
78
+ The published package ships only `dist/` with **zero runtime dependencies** (`n8n-workflow` is a peer, provided by your n8n instance). Any `pnpm audit` / Dependabot findings are confined to the build, test, and release tooling or the host-provided peer — none of them reach an installed node. Outstanding upstream advisories (waiting on newer `@n8n/node-cli` and `n8n-workflow` releases) are tracked in [#2](https://github.com/nodrel-dev/n8n-fedex-node/issues/2).
79
+
80
+ ## Usage
81
+
82
+ ### Get Rates and Create
83
+
84
+ Both operations share the same **Shipper** and **Recipient** address/contact fields, so values carry over when you switch between them. Package dimensions (length/width/height) are optional and only sent to FedEx when all three are greater than zero.
85
+
86
+ ### The label binary (Create)
87
+
88
+ Create returns the label as proper n8n **binary data** on the output property named `label` — not a base64 string buried in JSON. Choose the format with **Label Format**:
89
+
90
+ | Label Format | MIME type | Typical use |
91
+ |---|---|---|
92
+ | PDF | `application/pdf` | Office printers |
93
+ | PNG | `image/png` | Preview / embedding |
94
+ | Thermal (ZPLII) | `application/octet-stream` | Zebra thermal printers |
95
+ | Thermal (EPL2) | `application/octet-stream` | Eltron thermal printers |
96
+
97
+ The tracking number and rate details are passed through on the main JSON output. Wire the `label` binary into **Write Binary File**, **Send Email** (as an attachment), or any node that consumes binary data.
98
+
99
+ ### Errors and Continue On Fail
100
+
101
+ FedEx error messages (`errors[].message`) are surfaced directly through n8n's error handling, and the node honors **Continue On Fail** — failed items emit an `error` entry and the workflow keeps processing the rest.
102
+
103
+ ## Resources
104
+
105
+ - [n8n community nodes documentation](https://docs.n8n.io/integrations/#community-nodes)
106
+ - [FedEx Developer Portal](https://developer.fedex.com/)
107
+ - [FedEx API documentation](https://developer.fedex.com/api/en-us/catalog.html)
108
+
109
+ ## Version history
110
+
111
+ ### 0.1.0
112
+
113
+ Initial release. Shipment (Track, Get Rates, Create) and Address (Validate) operations, sandbox/production environment switch, and label-as-binary output.
@@ -0,0 +1,9 @@
1
+ import type { Icon, ICredentialType, INodeProperties } from 'n8n-workflow';
2
+ export declare class FedexOAuth2Api implements ICredentialType {
3
+ name: string;
4
+ extends: string[];
5
+ displayName: string;
6
+ documentationUrl: string;
7
+ icon: Icon;
8
+ properties: INodeProperties[];
9
+ }
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FedexOAuth2Api = void 0;
4
+ class FedexOAuth2Api {
5
+ constructor() {
6
+ this.name = 'fedexOAuth2Api';
7
+ this.extends = ['oAuth2Api'];
8
+ this.displayName = 'FedEx OAuth2 API';
9
+ this.documentationUrl = 'https://github.com/nodrel-dev/n8n-fedex-node#credentials';
10
+ this.icon = { light: 'file:fedex.svg', dark: 'file:fedex.dark.svg' };
11
+ this.properties = [
12
+ {
13
+ displayName: 'Environment',
14
+ name: 'environment',
15
+ type: 'options',
16
+ options: [
17
+ { name: 'Sandbox (Test)', value: 'sandbox' },
18
+ { name: 'Production (Live)', value: 'production' },
19
+ ],
20
+ default: 'sandbox',
21
+ description: 'Which FedEx environment to target. Defaults to sandbox so a half-configured connection cannot hit a live account.',
22
+ },
23
+ {
24
+ displayName: 'Grant Type',
25
+ name: 'grantType',
26
+ type: 'hidden',
27
+ default: 'clientCredentials',
28
+ },
29
+ {
30
+ displayName: 'Access Token URL',
31
+ name: 'accessTokenUrl',
32
+ type: 'hidden',
33
+ default: '={{ $self["environment"] === "production" ? "https://apis.fedex.com/oauth/token" : "https://apis-sandbox.fedex.com/oauth/token" }}',
34
+ },
35
+ {
36
+ displayName: 'Scope',
37
+ name: 'scope',
38
+ type: 'hidden',
39
+ default: '',
40
+ },
41
+ {
42
+ displayName: 'Auth URI Query Parameters',
43
+ name: 'authQueryParameters',
44
+ type: 'hidden',
45
+ default: '',
46
+ },
47
+ {
48
+ displayName: 'Authentication',
49
+ name: 'authentication',
50
+ type: 'hidden',
51
+ default: 'body',
52
+ },
53
+ ];
54
+ }
55
+ }
56
+ exports.FedexOAuth2Api = FedexOAuth2Api;
57
+ //# sourceMappingURL=FedexOAuth2Api.credentials.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FedexOAuth2Api.credentials.js","sourceRoot":"","sources":["../../credentials/FedexOAuth2Api.credentials.ts"],"names":[],"mappings":";;;AASA,MAAa,cAAc;IAA3B;QACC,SAAI,GAAG,gBAAgB,CAAC;QAExB,YAAO,GAAG,CAAC,WAAW,CAAC,CAAC;QAExB,gBAAW,GAAG,kBAAkB,CAAC;QAEjC,qBAAgB,GAAG,0DAA0D,CAAC;QAE9E,SAAI,GAAS,EAAE,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,qBAAqB,EAAE,CAAC;QAEtE,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,aAAa;gBAC1B,IAAI,EAAE,aAAa;gBACnB,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE;oBACR,EAAE,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,SAAS,EAAE;oBAC5C,EAAE,IAAI,EAAE,mBAAmB,EAAE,KAAK,EAAE,YAAY,EAAE;iBAClD;gBACD,OAAO,EAAE,SAAS;gBAClB,WAAW,EACV,mHAAmH;aACpH;YACD;gBACC,WAAW,EAAE,YAAY;gBACzB,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,mBAAmB;aAC5B;YACD;gBACC,WAAW,EAAE,kBAAkB;gBAC/B,IAAI,EAAE,gBAAgB;gBACtB,IAAI,EAAE,QAAQ;gBACd,OAAO,EACN,oIAAoI;aACrI;YACD;gBACC,WAAW,EAAE,OAAO;gBACpB,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,QAAQ;gBAId,OAAO,EAAE,EAAE;aACX;YACD;gBACC,WAAW,EAAE,2BAA2B;gBACxC,IAAI,EAAE,qBAAqB;gBAC3B,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;aACX;YACD;gBACC,WAAW,EAAE,gBAAgB;gBAC7B,IAAI,EAAE,gBAAgB;gBACtB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,MAAM;aACf;SACD,CAAC;IACH,CAAC;CAAA;AA3DD,wCA2DC"}
@@ -0,0 +1,5 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
2
+ <rect x="1" y="1" width="22" height="22" rx="5" fill="#6E1FB1"/>
3
+ <path d="M4.5 12 H14" fill="none" stroke="#FF7A1A" stroke-width="2.6" stroke-linecap="round"/>
4
+ <path d="M12.4 7.4 L17.6 12 L12.4 16.6" fill="none" stroke="#FF7A1A" stroke-width="2.6" stroke-linecap="round" stroke-linejoin="round"/>
5
+ </svg>
@@ -0,0 +1,5 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
2
+ <rect x="1" y="1" width="22" height="22" rx="5" fill="#4D148C"/>
3
+ <path d="M4.5 12 H14" fill="none" stroke="#FF6600" stroke-width="2.6" stroke-linecap="round"/>
4
+ <path d="M12.4 7.4 L17.6 12 L12.4 16.6" fill="none" stroke="#FF6600" stroke-width="2.6" stroke-linecap="round" stroke-linejoin="round"/>
5
+ </svg>
@@ -0,0 +1,4 @@
1
+ import { type INodeType, type INodeTypeDescription } from 'n8n-workflow';
2
+ export declare class Fedex implements INodeType {
3
+ description: INodeTypeDescription;
4
+ }
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Fedex = void 0;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ const shipment_1 = require("./resources/shipment");
6
+ const address_1 = require("./resources/address");
7
+ class Fedex {
8
+ constructor() {
9
+ this.description = {
10
+ displayName: 'FedEx',
11
+ name: 'fedex',
12
+ icon: { light: 'file:fedex.svg', dark: 'file:fedex.dark.svg' },
13
+ group: ['transform'],
14
+ version: 1,
15
+ subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
16
+ description: 'Track shipments, validate addresses, get rates, and create labels with your own FedEx account',
17
+ defaults: {
18
+ name: 'FedEx',
19
+ },
20
+ usableAsTool: true,
21
+ inputs: [n8n_workflow_1.NodeConnectionTypes.Main],
22
+ outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
23
+ credentials: [{ name: 'fedexOAuth2Api', required: true }],
24
+ requestDefaults: {
25
+ baseURL: '={{ $credentials.environment === "production" ? "https://apis.fedex.com" : "https://apis-sandbox.fedex.com" }}',
26
+ headers: {
27
+ Accept: 'application/json',
28
+ 'Content-Type': 'application/json',
29
+ },
30
+ },
31
+ properties: [
32
+ {
33
+ displayName: 'Resource',
34
+ name: 'resource',
35
+ type: 'options',
36
+ noDataExpression: true,
37
+ options: [
38
+ { name: 'Address', value: 'address' },
39
+ { name: 'Shipment', value: 'shipment' },
40
+ ],
41
+ default: 'shipment',
42
+ },
43
+ ...shipment_1.shipmentDescription,
44
+ ...address_1.addressDescription,
45
+ ],
46
+ };
47
+ }
48
+ }
49
+ exports.Fedex = Fedex;
50
+ //# sourceMappingURL=Fedex.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Fedex.node.js","sourceRoot":"","sources":["../../../nodes/Fedex/Fedex.node.ts"],"names":[],"mappings":";;;AAAA,+CAA8F;AAC9F,mDAA2D;AAC3D,iDAAyD;AAEzD,MAAa,KAAK;IAAlB;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,OAAO;YACpB,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,EAAE,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,qBAAqB,EAAE;YAC9D,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,8DAA8D;YACxE,WAAW,EACV,+FAA+F;YAChG,QAAQ,EAAE;gBACT,IAAI,EAAE,OAAO;aACb;YAID,YAAY,EAAE,IAAI;YAClB,MAAM,EAAE,CAAC,kCAAmB,CAAC,IAAI,CAAC;YAClC,OAAO,EAAE,CAAC,kCAAmB,CAAC,IAAI,CAAC;YACnC,WAAW,EAAE,CAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;YACzD,eAAe,EAAE;gBAGhB,OAAO,EACN,gHAAgH;gBACjH,OAAO,EAAE;oBACR,MAAM,EAAE,kBAAkB;oBAC1B,cAAc,EAAE,kBAAkB;iBAClC;aACD;YACD,UAAU,EAAE;gBACX;oBACC,WAAW,EAAE,UAAU;oBACvB,IAAI,EAAE,UAAU;oBAChB,IAAI,EAAE,SAAS;oBACf,gBAAgB,EAAE,IAAI;oBACtB,OAAO,EAAE;wBACR,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;wBACrC,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE;qBACvC;oBACD,OAAO,EAAE,UAAU;iBACnB;gBACD,GAAG,8BAAmB;gBACtB,GAAG,4BAAkB;aACrB;SACD,CAAC;IACH,CAAC;CAAA;AA9CD,sBA8CC"}
@@ -0,0 +1,18 @@
1
+ {
2
+ "node": "n8n-nodes-fedex",
3
+ "nodeVersion": "1.0",
4
+ "codexVersion": "1.0",
5
+ "categories": ["Development", "Developer Tools"],
6
+ "resources": {
7
+ "credentialDocumentation": [
8
+ {
9
+ "url": "https://github.com/org/repo?tab=readme-ov-file#credentials"
10
+ }
11
+ ],
12
+ "primaryDocumentation": [
13
+ {
14
+ "url": "https://github.com/org/repo?tab=readme-ov-file"
15
+ }
16
+ ]
17
+ }
18
+ }
@@ -0,0 +1,8 @@
1
+ import type { INodePropertyOptions } from 'n8n-workflow';
2
+ export declare const SERVICE_TYPE_OPTIONS: INodePropertyOptions[];
3
+ export declare const PACKAGING_TYPE_OPTIONS: INodePropertyOptions[];
4
+ export declare const PICKUP_TYPE_OPTIONS: INodePropertyOptions[];
5
+ export declare const LABEL_IMAGE_OPTIONS: INodePropertyOptions[];
6
+ export declare const LABEL_STOCK_OPTIONS: INodePropertyOptions[];
7
+ export declare const WEIGHT_UNIT_OPTIONS: INodePropertyOptions[];
8
+ export declare const DIMENSION_UNIT_OPTIONS: INodePropertyOptions[];
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DIMENSION_UNIT_OPTIONS = exports.WEIGHT_UNIT_OPTIONS = exports.LABEL_STOCK_OPTIONS = exports.LABEL_IMAGE_OPTIONS = exports.PICKUP_TYPE_OPTIONS = exports.PACKAGING_TYPE_OPTIONS = exports.SERVICE_TYPE_OPTIONS = void 0;
4
+ exports.SERVICE_TYPE_OPTIONS = [
5
+ { name: 'FedEx Ground', value: 'FEDEX_GROUND' },
6
+ { name: 'FedEx Home Delivery', value: 'GROUND_HOME_DELIVERY' },
7
+ { name: 'FedEx Express Saver', value: 'FEDEX_EXPRESS_SAVER' },
8
+ { name: 'FedEx 2Day', value: 'FEDEX_2_DAY' },
9
+ { name: 'FedEx 2Day A.M.', value: 'FEDEX_2_DAY_AM' },
10
+ { name: 'FedEx Standard Overnight', value: 'STANDARD_OVERNIGHT' },
11
+ { name: 'FedEx Priority Overnight', value: 'PRIORITY_OVERNIGHT' },
12
+ { name: 'FedEx First Overnight', value: 'FIRST_OVERNIGHT' },
13
+ ];
14
+ exports.PACKAGING_TYPE_OPTIONS = [
15
+ { name: 'Your Packaging', value: 'YOUR_PACKAGING' },
16
+ { name: 'FedEx Envelope', value: 'FEDEX_ENVELOPE' },
17
+ { name: 'FedEx Pak', value: 'FEDEX_PAK' },
18
+ { name: 'FedEx Small Box', value: 'FEDEX_SMALL_BOX' },
19
+ { name: 'FedEx Medium Box', value: 'FEDEX_MEDIUM_BOX' },
20
+ { name: 'FedEx Large Box', value: 'FEDEX_LARGE_BOX' },
21
+ { name: 'FedEx Extra Large Box', value: 'FEDEX_EXTRA_LARGE_BOX' },
22
+ { name: 'FedEx Tube', value: 'FEDEX_TUBE' },
23
+ ];
24
+ exports.PICKUP_TYPE_OPTIONS = [
25
+ { name: 'Use Scheduled Pickup', value: 'USE_SCHEDULED_PICKUP' },
26
+ { name: 'Drop Off at FedEx Location', value: 'DROPOFF_AT_FEDEX_LOCATION' },
27
+ { name: 'Contact FedEx to Schedule', value: 'CONTACT_FEDEX_TO_SCHEDULE' },
28
+ ];
29
+ exports.LABEL_IMAGE_OPTIONS = [
30
+ { name: 'PDF', value: 'PDF' },
31
+ { name: 'PNG', value: 'PNG' },
32
+ { name: 'Thermal (ZPLII)', value: 'ZPLII' },
33
+ { name: 'Thermal (EPL2)', value: 'EPL2' },
34
+ ];
35
+ exports.LABEL_STOCK_OPTIONS = [
36
+ { name: 'Paper 4x6', value: 'PAPER_4X6' },
37
+ { name: 'Paper 4x8', value: 'PAPER_4X8' },
38
+ { name: 'Paper Letter', value: 'PAPER_LETTER' },
39
+ { name: 'Stock 4x6.75', value: 'STOCK_4X675' },
40
+ { name: 'Stock 4x8', value: 'STOCK_4X8' },
41
+ ];
42
+ exports.WEIGHT_UNIT_OPTIONS = [
43
+ { name: 'Pounds (LB)', value: 'LB' },
44
+ { name: 'Kilograms (KG)', value: 'KG' },
45
+ ];
46
+ exports.DIMENSION_UNIT_OPTIONS = [
47
+ { name: 'Inches (IN)', value: 'IN' },
48
+ { name: 'Centimeters (CM)', value: 'CM' },
49
+ ];
50
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../nodes/Fedex/constants.ts"],"names":[],"mappings":";;;AAIa,QAAA,oBAAoB,GAA2B;IAC3D,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,cAAc,EAAE;IAC/C,EAAE,IAAI,EAAE,qBAAqB,EAAE,KAAK,EAAE,sBAAsB,EAAE;IAC9D,EAAE,IAAI,EAAE,qBAAqB,EAAE,KAAK,EAAE,qBAAqB,EAAE;IAC7D,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,aAAa,EAAE;IAC5C,EAAE,IAAI,EAAE,iBAAiB,EAAE,KAAK,EAAE,gBAAgB,EAAE;IACpD,EAAE,IAAI,EAAE,0BAA0B,EAAE,KAAK,EAAE,oBAAoB,EAAE;IACjE,EAAE,IAAI,EAAE,0BAA0B,EAAE,KAAK,EAAE,oBAAoB,EAAE;IACjE,EAAE,IAAI,EAAE,uBAAuB,EAAE,KAAK,EAAE,iBAAiB,EAAE;CAC3D,CAAC;AAEW,QAAA,sBAAsB,GAA2B;IAC7D,EAAE,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,gBAAgB,EAAE;IACnD,EAAE,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,gBAAgB,EAAE;IACnD,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE;IACzC,EAAE,IAAI,EAAE,iBAAiB,EAAE,KAAK,EAAE,iBAAiB,EAAE;IACrD,EAAE,IAAI,EAAE,kBAAkB,EAAE,KAAK,EAAE,kBAAkB,EAAE;IACvD,EAAE,IAAI,EAAE,iBAAiB,EAAE,KAAK,EAAE,iBAAiB,EAAE;IACrD,EAAE,IAAI,EAAE,uBAAuB,EAAE,KAAK,EAAE,uBAAuB,EAAE;IACjE,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE;CAC3C,CAAC;AAEW,QAAA,mBAAmB,GAA2B;IAC1D,EAAE,IAAI,EAAE,sBAAsB,EAAE,KAAK,EAAE,sBAAsB,EAAE;IAC/D,EAAE,IAAI,EAAE,4BAA4B,EAAE,KAAK,EAAE,2BAA2B,EAAE;IAC1E,EAAE,IAAI,EAAE,2BAA2B,EAAE,KAAK,EAAE,2BAA2B,EAAE;CACzE,CAAC;AAGW,QAAA,mBAAmB,GAA2B;IAC1D,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE;IAC7B,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE;IAC7B,EAAE,IAAI,EAAE,iBAAiB,EAAE,KAAK,EAAE,OAAO,EAAE;IAC3C,EAAE,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,EAAE;CACzC,CAAC;AAEW,QAAA,mBAAmB,GAA2B;IAC1D,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE;IACzC,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE;IACzC,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,cAAc,EAAE;IAC/C,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,aAAa,EAAE;IAC9C,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE;CACzC,CAAC;AAEW,QAAA,mBAAmB,GAA2B;IAC1D,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,IAAI,EAAE;IACpC,EAAE,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,IAAI,EAAE;CACvC,CAAC;AAEW,QAAA,sBAAsB,GAA2B;IAC7D,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,IAAI,EAAE;IACpC,EAAE,IAAI,EAAE,kBAAkB,EAAE,KAAK,EAAE,IAAI,EAAE;CACzC,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { JsonObject } from './fedexTypes';
2
+ export interface LabelMime {
3
+ mime: string;
4
+ ext: string;
5
+ }
6
+ export declare const LABEL_MIME: Record<string, LabelMime>;
7
+ export declare const MAX_LABEL_BYTES: number;
8
+ export interface ExtractedLabel {
9
+ buffer: Buffer;
10
+ fileName: string;
11
+ mimeType: string;
12
+ trackingNumber: string;
13
+ json: JsonObject;
14
+ }
15
+ export declare function extractLabel(response: unknown, imageType: string): ExtractedLabel;
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MAX_LABEL_BYTES = exports.LABEL_MIME = void 0;
4
+ exports.extractLabel = extractLabel;
5
+ exports.LABEL_MIME = {
6
+ PDF: { mime: 'application/pdf', ext: 'pdf' },
7
+ PNG: { mime: 'image/png', ext: 'png' },
8
+ ZPLII: { mime: 'application/octet-stream', ext: 'zpl' },
9
+ EPL2: { mime: 'application/octet-stream', ext: 'epl' },
10
+ };
11
+ exports.MAX_LABEL_BYTES = 20 * 1024 * 1024;
12
+ function safeFileNamePart(value) {
13
+ const cleaned = value.replace(/[^\w.-]/g, '_');
14
+ return cleaned.length > 0 ? cleaned : 'unknown';
15
+ }
16
+ function stripEncodedLabels(value) {
17
+ if (Array.isArray(value)) {
18
+ return value.map(stripEncodedLabels);
19
+ }
20
+ if (value && typeof value === 'object') {
21
+ return Object.fromEntries(Object.entries(value)
22
+ .filter(([key]) => key !== 'encodedLabel')
23
+ .map(([key, nested]) => [key, stripEncodedLabels(nested)]));
24
+ }
25
+ return value;
26
+ }
27
+ function extractLabel(response, imageType) {
28
+ var _a, _b, _c, _d, _e, _f, _g;
29
+ const output = response === null || response === void 0 ? void 0 : response.output;
30
+ const piece = (_c = (_b = (_a = output === null || output === void 0 ? void 0 : output.transactionShipments) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.pieceResponses) === null || _c === void 0 ? void 0 : _c[0];
31
+ const encodedLabel = (_e = (_d = piece === null || piece === void 0 ? void 0 : piece.packageDocuments) === null || _d === void 0 ? void 0 : _d.find((doc) => doc.encodedLabel)) === null || _e === void 0 ? void 0 : _e.encodedLabel;
32
+ if (!encodedLabel) {
33
+ throw new Error('FedEx did not return an encoded label. Ensure Label Response Options is set to LABEL and the shipment request is valid.');
34
+ }
35
+ const trackingNumber = (_f = piece === null || piece === void 0 ? void 0 : piece.trackingNumber) !== null && _f !== void 0 ? _f : 'unknown';
36
+ const mime = (_g = exports.LABEL_MIME[imageType]) !== null && _g !== void 0 ? _g : exports.LABEL_MIME.PDF;
37
+ const buffer = Buffer.from(encodedLabel, 'base64');
38
+ if (buffer.length > exports.MAX_LABEL_BYTES) {
39
+ throw new Error(`FedEx returned an unexpectedly large label (${buffer.length} bytes, limit ${exports.MAX_LABEL_BYTES}).`);
40
+ }
41
+ return {
42
+ buffer,
43
+ fileName: `label-${safeFileNamePart(trackingNumber)}.${mime.ext}`,
44
+ mimeType: mime.mime,
45
+ trackingNumber,
46
+ json: stripEncodedLabels(output),
47
+ };
48
+ }
49
+ //# sourceMappingURL=extractLabel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extractLabel.js","sourceRoot":"","sources":["../../../../nodes/Fedex/cores/extractLabel.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,27 @@
1
+ export interface FedexAddress {
2
+ streetLines: string[];
3
+ city: string;
4
+ stateOrProvinceCode?: string;
5
+ postalCode: string;
6
+ countryCode: string;
7
+ residential?: boolean;
8
+ }
9
+ export interface FedexContact {
10
+ personName?: string;
11
+ companyName?: string;
12
+ phoneNumber: string;
13
+ emailAddress?: string;
14
+ }
15
+ export type WeightUnit = 'LB' | 'KG';
16
+ export type DimensionUnit = 'IN' | 'CM';
17
+ export interface FedexWeight {
18
+ units: WeightUnit;
19
+ value: number;
20
+ }
21
+ export interface FedexDimensions {
22
+ length: number;
23
+ width: number;
24
+ height: number;
25
+ units: DimensionUnit;
26
+ }
27
+ export type JsonObject = Record<string, unknown>;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=fedexTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fedexTypes.js","sourceRoot":"","sources":["../../../../nodes/Fedex/cores/fedexTypes.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ export interface ShapedRate {
2
+ serviceType: string;
3
+ serviceName: string;
4
+ negotiatedRate: number | null;
5
+ listRate: number | null;
6
+ currency: string | null;
7
+ }
8
+ export declare function shapeRates(response: unknown): ShapedRate[];
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.shapeRates = shapeRates;
4
+ const isAccount = (detail) => { var _a; return /ACCOUNT/i.test((_a = detail.rateType) !== null && _a !== void 0 ? _a : ''); };
5
+ const isList = (detail) => { var _a; return /LIST/i.test((_a = detail.rateType) !== null && _a !== void 0 ? _a : ''); };
6
+ function shapeRates(response) {
7
+ var _a, _b;
8
+ const details = (_b = (_a = response === null || response === void 0 ? void 0 : response.output) === null || _a === void 0 ? void 0 : _a.rateReplyDetails) !== null && _b !== void 0 ? _b : [];
9
+ return details.map((service) => {
10
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
11
+ const rated = (_a = service.ratedShipmentDetails) !== null && _a !== void 0 ? _a : [];
12
+ const list = rated.find(isList);
13
+ const negotiated = (_c = (_b = rated.find(isAccount)) !== null && _b !== void 0 ? _b : rated.find((detail) => detail !== list)) !== null && _c !== void 0 ? _c : null;
14
+ const currencySource = (_d = negotiated !== null && negotiated !== void 0 ? negotiated : list) !== null && _d !== void 0 ? _d : null;
15
+ return {
16
+ serviceType: (_e = service.serviceType) !== null && _e !== void 0 ? _e : '',
17
+ serviceName: (_f = service.serviceName) !== null && _f !== void 0 ? _f : '',
18
+ negotiatedRate: (_g = negotiated === null || negotiated === void 0 ? void 0 : negotiated.totalNetCharge) !== null && _g !== void 0 ? _g : null,
19
+ listRate: (_h = list === null || list === void 0 ? void 0 : list.totalNetCharge) !== null && _h !== void 0 ? _h : null,
20
+ currency: (_k = (_j = currencySource === null || currencySource === void 0 ? void 0 : currencySource.shipmentRateDetail) === null || _j === void 0 ? void 0 : _j.currency) !== null && _k !== void 0 ? _k : null,
21
+ };
22
+ });
23
+ }
24
+ //# sourceMappingURL=shapeRates.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shapeRates.js","sourceRoot":"","sources":["../../../../nodes/Fedex/cores/shapeRates.ts"],"names":[],"mappings":";;AAgCA,gCAmBC;AAtBD,MAAM,SAAS,GAAG,CAAC,MAA2B,EAAW,EAAE,WAAC,OAAA,UAAU,CAAC,IAAI,CAAC,MAAA,MAAM,CAAC,QAAQ,mCAAI,EAAE,CAAC,CAAA,EAAA,CAAC;AACnG,MAAM,MAAM,GAAG,CAAC,MAA2B,EAAW,EAAE,WAAC,OAAA,OAAO,CAAC,IAAI,CAAC,MAAA,MAAM,CAAC,QAAQ,mCAAI,EAAE,CAAC,CAAA,EAAA,CAAC;AAE7F,SAAgB,UAAU,CAAC,QAAiB;;IAC3C,MAAM,OAAO,GAAG,MAAA,MAAC,QAAqC,aAArC,QAAQ,uBAAR,QAAQ,CAA+B,MAAM,0CAAE,gBAAgB,mCAAI,EAAE,CAAC;IAEvF,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;;QAC9B,MAAM,KAAK,GAAG,MAAA,OAAO,CAAC,oBAAoB,mCAAI,EAAE,CAAC;QACjD,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAGhC,MAAM,UAAU,GAAG,MAAA,MAAA,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,mCAAI,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,KAAK,IAAI,CAAC,mCAAI,IAAI,CAAC;QAC5F,MAAM,cAAc,GAAG,MAAA,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,IAAI,mCAAI,IAAI,CAAC;QAElD,OAAO;YACN,WAAW,EAAE,MAAA,OAAO,CAAC,WAAW,mCAAI,EAAE;YACtC,WAAW,EAAE,MAAA,OAAO,CAAC,WAAW,mCAAI,EAAE;YACtC,cAAc,EAAE,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,cAAc,mCAAI,IAAI;YAClD,QAAQ,EAAE,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,cAAc,mCAAI,IAAI;YACtC,QAAQ,EAAE,MAAA,MAAA,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,kBAAkB,0CAAE,QAAQ,mCAAI,IAAI;SAC9D,CAAC;IACH,CAAC,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { FedexAddress } from './fedexTypes';
2
+ export interface AddressInput {
3
+ streetLines?: string;
4
+ city?: string;
5
+ stateOrProvinceCode?: string;
6
+ postalCode?: string;
7
+ countryCode?: string;
8
+ residential?: boolean;
9
+ }
10
+ export declare function toFedexAddress(input: AddressInput): FedexAddress;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toFedexAddress = toFedexAddress;
4
+ const MAX_STREET_LINES = 3;
5
+ const DEFAULT_COUNTRY = 'US';
6
+ function toFedexAddress(input) {
7
+ var _a, _b, _c, _d, _e;
8
+ const streetLines = ((_a = input.streetLines) !== null && _a !== void 0 ? _a : '')
9
+ .split('\n')
10
+ .map((line) => line.trim())
11
+ .filter((line) => line.length > 0)
12
+ .slice(0, MAX_STREET_LINES);
13
+ const state = ((_b = input.stateOrProvinceCode) !== null && _b !== void 0 ? _b : '').trim();
14
+ const country = ((_c = input.countryCode) !== null && _c !== void 0 ? _c : '').trim() || DEFAULT_COUNTRY;
15
+ return {
16
+ streetLines,
17
+ city: ((_d = input.city) !== null && _d !== void 0 ? _d : '').trim(),
18
+ postalCode: ((_e = input.postalCode) !== null && _e !== void 0 ? _e : '').trim(),
19
+ countryCode: country,
20
+ ...(state ? { stateOrProvinceCode: state } : {}),
21
+ ...(input.residential !== undefined ? { residential: input.residential } : {}),
22
+ };
23
+ }
24
+ //# sourceMappingURL=toFedexAddress.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toFedexAddress.js","sourceRoot":"","sources":["../../../../nodes/Fedex/cores/toFedexAddress.ts"],"names":[],"mappings":";;AAqBA,wCAkBC;AArCD,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAC3B,MAAM,eAAe,GAAG,IAAI,CAAC;AAkB7B,SAAgB,cAAc,CAAC,KAAmB;;IACjD,MAAM,WAAW,GAAG,CAAC,MAAA,KAAK,CAAC,WAAW,mCAAI,EAAE,CAAC;SAC3C,KAAK,CAAC,IAAI,CAAC;SACX,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;SAC1B,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;SACjC,KAAK,CAAC,CAAC,EAAE,gBAAgB,CAAC,CAAC;IAE7B,MAAM,KAAK,GAAG,CAAC,MAAA,KAAK,CAAC,mBAAmB,mCAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACvD,MAAM,OAAO,GAAG,CAAC,MAAA,KAAK,CAAC,WAAW,mCAAI,EAAE,CAAC,CAAC,IAAI,EAAE,IAAI,eAAe,CAAC;IAEpE,OAAO;QACN,WAAW;QACX,IAAI,EAAE,CAAC,MAAA,KAAK,CAAC,IAAI,mCAAI,EAAE,CAAC,CAAC,IAAI,EAAE;QAC/B,UAAU,EAAE,CAAC,MAAA,KAAK,CAAC,UAAU,mCAAI,EAAE,CAAC,CAAC,IAAI,EAAE;QAC3C,WAAW,EAAE,OAAO;QACpB,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,mBAAmB,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAChD,GAAG,CAAC,KAAK,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC9E,CAAC;AACH,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { FedexContact } from './fedexTypes';
2
+ export interface ContactInput {
3
+ personName?: string;
4
+ companyName?: string;
5
+ phoneNumber?: string;
6
+ emailAddress?: string;
7
+ }
8
+ export declare function toFedexContact(input: ContactInput): FedexContact;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toFedexContact = toFedexContact;
4
+ function toFedexContact(input) {
5
+ var _a, _b, _c, _d;
6
+ const personName = ((_a = input.personName) !== null && _a !== void 0 ? _a : '').trim();
7
+ const companyName = ((_b = input.companyName) !== null && _b !== void 0 ? _b : '').trim();
8
+ const emailAddress = ((_c = input.emailAddress) !== null && _c !== void 0 ? _c : '').trim();
9
+ return {
10
+ phoneNumber: ((_d = input.phoneNumber) !== null && _d !== void 0 ? _d : '').trim(),
11
+ ...(personName ? { personName } : {}),
12
+ ...(companyName ? { companyName } : {}),
13
+ ...(emailAddress ? { emailAddress } : {}),
14
+ };
15
+ }
16
+ //# sourceMappingURL=toFedexContact.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toFedexContact.js","sourceRoot":"","sources":["../../../../nodes/Fedex/cores/toFedexContact.ts"],"names":[],"mappings":";;AAcA,wCAWC;AAXD,SAAgB,cAAc,CAAC,KAAmB;;IACjD,MAAM,UAAU,GAAG,CAAC,MAAA,KAAK,CAAC,UAAU,mCAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACnD,MAAM,WAAW,GAAG,CAAC,MAAA,KAAK,CAAC,WAAW,mCAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACrD,MAAM,YAAY,GAAG,CAAC,MAAA,KAAK,CAAC,YAAY,mCAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IAEvD,OAAO;QACN,WAAW,EAAE,CAAC,MAAA,KAAK,CAAC,WAAW,mCAAI,EAAE,CAAC,CAAC,IAAI,EAAE;QAC7C,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACrC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACvC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACzC,CAAC;AACH,CAAC"}
@@ -0,0 +1,5 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
2
+ <rect x="1" y="1" width="22" height="22" rx="5" fill="#6E1FB1"/>
3
+ <path d="M4.5 12 H14" fill="none" stroke="#FF7A1A" stroke-width="2.6" stroke-linecap="round"/>
4
+ <path d="M12.4 7.4 L17.6 12 L12.4 16.6" fill="none" stroke="#FF7A1A" stroke-width="2.6" stroke-linecap="round" stroke-linejoin="round"/>
5
+ </svg>
@@ -0,0 +1,5 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
2
+ <rect x="1" y="1" width="22" height="22" rx="5" fill="#4D148C"/>
3
+ <path d="M4.5 12 H14" fill="none" stroke="#FF6600" stroke-width="2.6" stroke-linecap="round"/>
4
+ <path d="M12.4 7.4 L17.6 12 L12.4 16.6" fill="none" stroke="#FF6600" stroke-width="2.6" stroke-linecap="round" stroke-linejoin="round"/>
5
+ </svg>
@@ -0,0 +1,16 @@
1
+ import type { INodeProperties } from 'n8n-workflow';
2
+ type Show = {
3
+ resource: string[];
4
+ operation: string[];
5
+ };
6
+ type Role = 'shipper' | 'recipient';
7
+ export declare function accountNumberField(show: Show): INodeProperties;
8
+ export declare function addressFields(role: Role, show: Show, opts?: {
9
+ residential?: boolean;
10
+ }): INodeProperties[];
11
+ export declare function contactFields(role: Role, show: Show): INodeProperties[];
12
+ export declare function pickupTypeField(show: Show): INodeProperties;
13
+ export declare function serviceTypeField(show: Show, required: boolean): INodeProperties;
14
+ export declare function packagingTypeField(show: Show): INodeProperties;
15
+ export declare function packageFields(show: Show): INodeProperties[];
16
+ export {};