n8n-nodes-ups 0.2.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.
Files changed (80) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +103 -0
  3. package/dist/credentials/UpsOAuth2Api.credentials.d.ts +10 -0
  4. package/dist/credentials/UpsOAuth2Api.credentials.js +76 -0
  5. package/dist/credentials/UpsOAuth2Api.credentials.js.map +1 -0
  6. package/dist/credentials/ups.svg +5 -0
  7. package/dist/nodes/Ups/Ups.node.d.ts +4 -0
  8. package/dist/nodes/Ups/Ups.node.js +53 -0
  9. package/dist/nodes/Ups/Ups.node.js.map +1 -0
  10. package/dist/nodes/Ups/Ups.node.json +18 -0
  11. package/dist/nodes/Ups/core/buildCommodities.d.ts +10 -0
  12. package/dist/nodes/Ups/core/buildCommodities.js +21 -0
  13. package/dist/nodes/Ups/core/buildCommodities.js.map +1 -0
  14. package/dist/nodes/Ups/core/buildInternationalForms.d.ts +17 -0
  15. package/dist/nodes/Ups/core/buildInternationalForms.js +34 -0
  16. package/dist/nodes/Ups/core/buildInternationalForms.js.map +1 -0
  17. package/dist/nodes/Ups/core/extractCharges.d.ts +20 -0
  18. package/dist/nodes/Ups/core/extractCharges.js +13 -0
  19. package/dist/nodes/Ups/core/extractCharges.js.map +1 -0
  20. package/dist/nodes/Ups/core/extractForms.d.ts +23 -0
  21. package/dist/nodes/Ups/core/extractForms.js +25 -0
  22. package/dist/nodes/Ups/core/extractForms.js.map +1 -0
  23. package/dist/nodes/Ups/core/extractLabel.d.ts +30 -0
  24. package/dist/nodes/Ups/core/extractLabel.js +35 -0
  25. package/dist/nodes/Ups/core/extractLabel.js.map +1 -0
  26. package/dist/nodes/Ups/core/flattenRates.d.ts +36 -0
  27. package/dist/nodes/Ups/core/flattenRates.js +58 -0
  28. package/dist/nodes/Ups/core/flattenRates.js.map +1 -0
  29. package/dist/nodes/Ups/core/isInternational.d.ts +9 -0
  30. package/dist/nodes/Ups/core/isInternational.js +15 -0
  31. package/dist/nodes/Ups/core/isInternational.js.map +1 -0
  32. package/dist/nodes/Ups/core/mapTrackStatus.d.ts +48 -0
  33. package/dist/nodes/Ups/core/mapTrackStatus.js +55 -0
  34. package/dist/nodes/Ups/core/mapTrackStatus.js.map +1 -0
  35. package/dist/nodes/Ups/core/mapUpsError.d.ts +2 -0
  36. package/dist/nodes/Ups/core/mapUpsError.js +52 -0
  37. package/dist/nodes/Ups/core/mapUpsError.js.map +1 -0
  38. package/dist/nodes/Ups/core/shapeCandidates.d.ts +37 -0
  39. package/dist/nodes/Ups/core/shapeCandidates.js +68 -0
  40. package/dist/nodes/Ups/core/shapeCandidates.js.map +1 -0
  41. package/dist/nodes/Ups/core/toMoney.d.ts +6 -0
  42. package/dist/nodes/Ups/core/toMoney.js +16 -0
  43. package/dist/nodes/Ups/core/toMoney.js.map +1 -0
  44. package/dist/nodes/Ups/core/toUpsAddress.d.ts +12 -0
  45. package/dist/nodes/Ups/core/toUpsAddress.js +17 -0
  46. package/dist/nodes/Ups/core/toUpsAddress.js.map +1 -0
  47. package/dist/nodes/Ups/core/toXavAddress.d.ts +16 -0
  48. package/dist/nodes/Ups/core/toXavAddress.js +26 -0
  49. package/dist/nodes/Ups/core/toXavAddress.js.map +1 -0
  50. package/dist/nodes/Ups/core/types.d.ts +73 -0
  51. package/dist/nodes/Ups/core/types.js +3 -0
  52. package/dist/nodes/Ups/core/types.js.map +1 -0
  53. package/dist/nodes/Ups/resources/address/index.d.ts +2 -0
  54. package/dist/nodes/Ups/resources/address/index.js +20 -0
  55. package/dist/nodes/Ups/resources/address/index.js.map +1 -0
  56. package/dist/nodes/Ups/resources/address/validate.operation.d.ts +24 -0
  57. package/dist/nodes/Ups/resources/address/validate.operation.js +109 -0
  58. package/dist/nodes/Ups/resources/address/validate.operation.js.map +1 -0
  59. package/dist/nodes/Ups/resources/shipping/create.operation.d.ts +24 -0
  60. package/dist/nodes/Ups/resources/shipping/create.operation.js +363 -0
  61. package/dist/nodes/Ups/resources/shipping/create.operation.js.map +1 -0
  62. package/dist/nodes/Ups/resources/shipping/getRates.operation.d.ts +24 -0
  63. package/dist/nodes/Ups/resources/shipping/getRates.operation.js +126 -0
  64. package/dist/nodes/Ups/resources/shipping/getRates.operation.js.map +1 -0
  65. package/dist/nodes/Ups/resources/shipping/index.d.ts +2 -0
  66. package/dist/nodes/Ups/resources/shipping/index.js +22 -0
  67. package/dist/nodes/Ups/resources/shipping/index.js.map +1 -0
  68. package/dist/nodes/Ups/resources/shipping/shared.d.ts +34 -0
  69. package/dist/nodes/Ups/resources/shipping/shared.js +165 -0
  70. package/dist/nodes/Ups/resources/shipping/shared.js.map +1 -0
  71. package/dist/nodes/Ups/resources/tracking/index.d.ts +2 -0
  72. package/dist/nodes/Ups/resources/tracking/index.js +20 -0
  73. package/dist/nodes/Ups/resources/tracking/index.js.map +1 -0
  74. package/dist/nodes/Ups/resources/tracking/track.operation.d.ts +24 -0
  75. package/dist/nodes/Ups/resources/tracking/track.operation.js +73 -0
  76. package/dist/nodes/Ups/resources/tracking/track.operation.js.map +1 -0
  77. package/dist/nodes/Ups/ups.dark.svg +13 -0
  78. package/dist/nodes/Ups/ups.svg +13 -0
  79. package/dist/package.json +61 -0
  80. package/package.json +61 -0
@@ -0,0 +1,109 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateOperationOption = exports.validateOperationDescription = void 0;
4
+ const toXavAddress_1 = require("../../core/toXavAddress");
5
+ const shapeCandidates_1 = require("../../core/shapeCandidates");
6
+ const mapUpsError_1 = require("../../core/mapUpsError");
7
+ const showOnlyForValidate = {
8
+ operation: ['validate'],
9
+ resource: ['address'],
10
+ };
11
+ function readAddress(ctx) {
12
+ const line1 = ctx.getNodeParameter('addressLine1', '');
13
+ const line2 = ctx.getNodeParameter('addressLine2', '');
14
+ return {
15
+ addressLines: [line1, line2].filter((l) => l && l.trim().length > 0),
16
+ city: ctx.getNodeParameter('city', ''),
17
+ stateProvinceCode: ctx.getNodeParameter('stateProvinceCode', ''),
18
+ postalCode: ctx.getNodeParameter('postalCode', ''),
19
+ countryCode: ctx.getNodeParameter('countryCode', 'US'),
20
+ };
21
+ }
22
+ async function validatePreSend(requestOptions) {
23
+ requestOptions.body = {
24
+ XAVRequest: {
25
+ AddressKeyFormat: (0, toXavAddress_1.toXavAddress)(readAddress(this)),
26
+ },
27
+ };
28
+ return requestOptions;
29
+ }
30
+ async function validatePostReceive(_items, response) {
31
+ if (response.statusCode >= 400) {
32
+ (0, mapUpsError_1.mapUpsError)(this.getNode(), response.body, response.statusCode);
33
+ }
34
+ const result = (0, shapeCandidates_1.shapeCandidates)(response.body);
35
+ return [{ json: result }];
36
+ }
37
+ exports.validateOperationDescription = [
38
+ {
39
+ displayName: 'Address Line 1',
40
+ name: 'addressLine1',
41
+ type: 'string',
42
+ required: true,
43
+ default: '',
44
+ displayOptions: { show: showOnlyForValidate },
45
+ description: 'Street address line 1',
46
+ },
47
+ {
48
+ displayName: 'Address Line 2',
49
+ name: 'addressLine2',
50
+ type: 'string',
51
+ default: '',
52
+ displayOptions: { show: showOnlyForValidate },
53
+ description: 'Street address line 2 (optional)',
54
+ },
55
+ {
56
+ displayName: 'City',
57
+ name: 'city',
58
+ type: 'string',
59
+ default: '',
60
+ displayOptions: { show: showOnlyForValidate },
61
+ description: 'City (maps to PoliticalDivision2)',
62
+ },
63
+ {
64
+ displayName: 'State / Province Code',
65
+ name: 'stateProvinceCode',
66
+ type: 'string',
67
+ default: '',
68
+ placeholder: 'NY',
69
+ displayOptions: { show: showOnlyForValidate },
70
+ description: 'Two-letter state or province code (maps to PoliticalDivision1)',
71
+ },
72
+ {
73
+ displayName: 'Postal Code',
74
+ name: 'postalCode',
75
+ type: 'string',
76
+ default: '',
77
+ placeholder: '14201 or 14201-1234',
78
+ displayOptions: { show: showOnlyForValidate },
79
+ description: 'Postal code; a ZIP+4 is split into primary/extended automatically',
80
+ },
81
+ {
82
+ displayName: 'Country Code',
83
+ name: 'countryCode',
84
+ type: 'string',
85
+ default: 'US',
86
+ displayOptions: { show: showOnlyForValidate },
87
+ description: 'Two-letter country code. Note: the CIE returns street-level validation for US NY/CA addresses only.',
88
+ },
89
+ ];
90
+ exports.validateOperationOption = {
91
+ name: 'Validate',
92
+ value: 'validate',
93
+ action: 'Validate an address',
94
+ description: 'Validate and classify an address (residential/commercial)',
95
+ routing: {
96
+ request: {
97
+ method: 'POST',
98
+ url: '/addressvalidation/v2/3',
99
+ ignoreHttpStatusErrors: true,
100
+ },
101
+ send: {
102
+ preSend: [validatePreSend],
103
+ },
104
+ output: {
105
+ postReceive: [validatePostReceive],
106
+ },
107
+ },
108
+ };
109
+ //# sourceMappingURL=validate.operation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate.operation.js","sourceRoot":"","sources":["../../../../../nodes/Ups/resources/address/validate.operation.ts"],"names":[],"mappings":";;;AAOA,0DAAoF;AACpF,gEAA6D;AAC7D,wDAAqD;AAErD,MAAM,mBAAmB,GAAG;IAC3B,SAAS,EAAE,CAAC,UAAU,CAAC;IACvB,QAAQ,EAAE,CAAC,SAAS,CAAC;CACrB,CAAC;AAEF,SAAS,WAAW,CAAC,GAA4B;IAChD,MAAM,KAAK,GAAG,GAAG,CAAC,gBAAgB,CAAC,cAAc,EAAE,EAAE,CAAW,CAAC;IACjE,MAAM,KAAK,GAAG,GAAG,CAAC,gBAAgB,CAAC,cAAc,EAAE,EAAE,CAAW,CAAC;IACjE,OAAO;QACN,YAAY,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;QACpE,IAAI,EAAE,GAAG,CAAC,gBAAgB,CAAC,MAAM,EAAE,EAAE,CAAW;QAChD,iBAAiB,EAAE,GAAG,CAAC,gBAAgB,CAAC,mBAAmB,EAAE,EAAE,CAAW;QAC1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,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,cAAc,EAAE,EAAE,IAAI,EAAE,mBAAmB,EAAE;QAC7C,WAAW,EAAE,mCAAmC;KAChD;IACD;QACC,WAAW,EAAE,uBAAuB;QACpC,IAAI,EAAE,mBAAmB;QACzB,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,IAAI;QACjB,cAAc,EAAE,EAAE,IAAI,EAAE,mBAAmB,EAAE;QAC7C,WAAW,EAAE,gEAAgE;KAC7E;IACD;QACC,WAAW,EAAE,aAAa;QAC1B,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,qBAAqB;QAClC,cAAc,EAAE,EAAE,IAAI,EAAE,mBAAmB,EAAE;QAC7C,WAAW,EAAE,mEAAmE;KAChF;IACD;QACC,WAAW,EAAE,cAAc;QAC3B,IAAI,EAAE,aAAa;QACnB,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,IAAI;QACb,cAAc,EAAE,EAAE,IAAI,EAAE,mBAAmB,EAAE;QAC7C,WAAW,EACV,qGAAqG;KACtG;CACD,CAAC;AAEW,QAAA,uBAAuB,GAAG;IACtC,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,UAAU;IACjB,MAAM,EAAE,qBAAqB;IAC7B,WAAW,EAAE,2DAA2D;IACxE,OAAO,EAAE;QACR,OAAO,EAAE;YACR,MAAM,EAAE,MAAe;YAEvB,GAAG,EAAE,yBAAyB;YAC9B,sBAAsB,EAAE,IAAI;SAC5B;QACD,IAAI,EAAE;YACL,OAAO,EAAE,CAAC,eAAe,CAAC;SAC1B;QACD,MAAM,EAAE;YACP,WAAW,EAAE,CAAC,mBAAmB,CAAC;SAClC;KACD;CACD,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { type IExecuteSingleFunctions, type IHttpRequestOptions, type IN8nHttpFullResponse, type INodeExecutionData, type INodeProperties } from 'n8n-workflow';
2
+ declare function createPreSend(this: IExecuteSingleFunctions, requestOptions: IHttpRequestOptions): Promise<IHttpRequestOptions>;
3
+ declare function createPostReceive(this: IExecuteSingleFunctions, _items: INodeExecutionData[], response: IN8nHttpFullResponse): Promise<INodeExecutionData[]>;
4
+ export declare const createOperationDescription: INodeProperties[];
5
+ export declare const createOperationOption: {
6
+ name: string;
7
+ value: string;
8
+ action: string;
9
+ description: string;
10
+ routing: {
11
+ request: {
12
+ method: "POST";
13
+ url: string;
14
+ ignoreHttpStatusErrors: boolean;
15
+ };
16
+ send: {
17
+ preSend: (typeof createPreSend)[];
18
+ };
19
+ output: {
20
+ postReceive: (typeof createPostReceive)[];
21
+ };
22
+ };
23
+ };
24
+ export {};
@@ -0,0 +1,363 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createOperationOption = exports.createOperationDescription = void 0;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ const toUpsAddress_1 = require("../../core/toUpsAddress");
6
+ const isInternational_1 = require("../../core/isInternational");
7
+ const buildCommodities_1 = require("../../core/buildCommodities");
8
+ const buildInternationalForms_1 = require("../../core/buildInternationalForms");
9
+ const extractLabel_1 = require("../../core/extractLabel");
10
+ const extractForms_1 = require("../../core/extractForms");
11
+ const extractCharges_1 = require("../../core/extractCharges");
12
+ const mapUpsError_1 = require("../../core/mapUpsError");
13
+ const shared_1 = require("./shared");
14
+ const showOnlyForCreate = {
15
+ operation: ['create'],
16
+ resource: ['shipping'],
17
+ };
18
+ function readCommodities(get) {
19
+ var _a;
20
+ const rows = (_a = get('commodities.line', [])) !== null && _a !== void 0 ? _a : [];
21
+ return rows
22
+ .filter((r) => { var _a; return ((_a = r.description) !== null && _a !== void 0 ? _a : '').trim().length > 0; })
23
+ .map((r) => {
24
+ var _a, _b;
25
+ return ({
26
+ description: r.description,
27
+ quantity: (_a = r.quantity) !== null && _a !== void 0 ? _a : 1,
28
+ unitValue: (_b = r.unitValue) !== null && _b !== void 0 ? _b : 0,
29
+ unitOfMeasure: r.unitOfMeasure || 'EA',
30
+ commodityCode: r.commodityCode || undefined,
31
+ originCountry: r.originCountry || undefined,
32
+ });
33
+ });
34
+ }
35
+ function todayYyyyMmdd() {
36
+ return new Date().toISOString().slice(0, 10).replace(/-/g, '');
37
+ }
38
+ function readCustoms(get) {
39
+ const soldTo = (0, shared_1.readAddress)(get, 'soldTo');
40
+ return {
41
+ reasonForExport: get('customsReasonForExport', 'SALE'),
42
+ currency: get('customsCurrency', 'USD'),
43
+ termsOfShipment: get('customsTermsOfShipment', 'DDU'),
44
+ invoiceNumber: get('customsInvoiceNumber', '') || undefined,
45
+ invoiceDate: get('customsInvoiceDate', '').trim() || todayYyyyMmdd(),
46
+ soldTo: {
47
+ name: get('soldToName', ''),
48
+ addressLines: soldTo.addressLines,
49
+ city: soldTo.city,
50
+ stateProvinceCode: soldTo.stateProvinceCode || undefined,
51
+ postalCode: soldTo.postalCode || undefined,
52
+ countryCode: soldTo.countryCode,
53
+ },
54
+ };
55
+ }
56
+ function buildShipmentBody(get, international) {
57
+ const accountNumber = get('accountNumber', '').trim();
58
+ const service = get('service', '03');
59
+ const labelFormat = get('labelFormat', 'GIF');
60
+ const shipper = (0, shared_1.readAddress)(get, 'shipper');
61
+ const shipTo = (0, shared_1.readAddress)(get, 'shipTo');
62
+ const shipFrom = (0, shared_1.readAddress)(get, 'shipFrom');
63
+ const hasShipFrom = shipFrom.addressLines.length > 0 || shipFrom.city.length > 0;
64
+ const effectiveShipFrom = hasShipFrom ? shipFrom : shipper;
65
+ const shipperName = get('shipperName', '');
66
+ const shipToName = get('shipToName', '');
67
+ const shipFromName = get('shipFromName', shipperName) || shipperName;
68
+ const shipperPhone = get('shipperPhone', '');
69
+ const shipToPhone = get('shipToPhone', '');
70
+ const shipment = {
71
+ Description: 'Shipment',
72
+ Shipper: {
73
+ Name: shipperName,
74
+ ...(shipperName ? { AttentionName: shipperName } : {}),
75
+ ShipperNumber: accountNumber,
76
+ ...(shipperPhone ? { Phone: { Number: shipperPhone } } : {}),
77
+ Address: (0, toUpsAddress_1.toUpsAddress)(shipper),
78
+ },
79
+ ShipTo: {
80
+ Name: shipToName,
81
+ ...(shipToName ? { AttentionName: shipToName } : {}),
82
+ ...(shipToPhone ? { Phone: { Number: shipToPhone } } : {}),
83
+ Address: (0, toUpsAddress_1.toUpsAddress)(shipTo),
84
+ },
85
+ ShipFrom: {
86
+ Name: shipFromName,
87
+ ...(shipFromName ? { AttentionName: shipFromName } : {}),
88
+ Address: (0, toUpsAddress_1.toUpsAddress)(effectiveShipFrom),
89
+ },
90
+ PaymentInformation: {
91
+ ShipmentCharge: { Type: '01', BillShipper: { AccountNumber: accountNumber } },
92
+ },
93
+ ShipmentRatingOptions: { NegotiatedRatesIndicator: '' },
94
+ Service: { Code: service },
95
+ Package: {
96
+ Packaging: { Code: '02' },
97
+ ...(0, shared_1.readPackage)(get),
98
+ },
99
+ };
100
+ if (international) {
101
+ const commodities = (0, buildCommodities_1.buildCommodities)(readCommodities(get));
102
+ shipment.ShipmentServiceOptions = {
103
+ InternationalForms: (0, buildInternationalForms_1.buildInternationalForms)(readCustoms(get), commodities),
104
+ };
105
+ }
106
+ const labelSpecification = { LabelImageFormat: { Code: labelFormat } };
107
+ if (labelFormat !== 'GIF') {
108
+ labelSpecification.LabelStockSize = { Height: '6', Width: '4' };
109
+ }
110
+ return {
111
+ ShipmentRequest: {
112
+ Request: { RequestOption: 'nonvalidate' },
113
+ Shipment: shipment,
114
+ LabelSpecification: labelSpecification,
115
+ },
116
+ };
117
+ }
118
+ async function createPreSend(requestOptions) {
119
+ const node = this.getNode();
120
+ const get = (name, fallback) => this.getNodeParameter(name, fallback);
121
+ const accountNumber = get('accountNumber', '').trim();
122
+ if (!accountNumber) {
123
+ throw new n8n_workflow_1.NodeOperationError(node, 'An account number is required to create a shipment.');
124
+ }
125
+ const shipper = (0, shared_1.readAddress)(get, 'shipper');
126
+ const shipTo = (0, shared_1.readAddress)(get, 'shipTo');
127
+ const shipFrom = (0, shared_1.readAddress)(get, 'shipFrom');
128
+ const hasShipFrom = shipFrom.addressLines.length > 0 || shipFrom.city.length > 0;
129
+ const international = (0, isInternational_1.isInternational)({
130
+ shipFrom: hasShipFrom ? shipFrom : shipper,
131
+ shipper,
132
+ shipTo,
133
+ });
134
+ if (international && readCommodities(get).length === 0) {
135
+ throw new n8n_workflow_1.NodeOperationError(node, 'International shipments require at least one customs commodity line.');
136
+ }
137
+ requestOptions.body = buildShipmentBody(get, international);
138
+ return requestOptions;
139
+ }
140
+ async function createPostReceive(_items, response) {
141
+ if (response.statusCode >= 400) {
142
+ (0, mapUpsError_1.mapUpsError)(this.getNode(), response.body, response.statusCode);
143
+ }
144
+ const labelFormat = this.getNodeParameter('labelFormat', 'GIF');
145
+ const label = (0, extractLabel_1.extractLabel)(response.body, labelFormat);
146
+ const forms = (0, extractForms_1.extractForms)(response.body);
147
+ const charges = (0, extractCharges_1.extractCharges)(response.body);
148
+ const binary = {};
149
+ if (label.labels[0]) {
150
+ const l = label.labels[0];
151
+ binary.label = await this.helpers.prepareBinaryData(Buffer.from(l.base64, 'base64'), l.filename, l.mime);
152
+ }
153
+ if (forms[0]) {
154
+ binary.customsInvoice = await this.helpers.prepareBinaryData(Buffer.from(forms[0].base64, 'base64'), forms[0].filename, forms[0].mime);
155
+ }
156
+ return [
157
+ {
158
+ json: {
159
+ shipmentId: label.shipmentId,
160
+ trackingNumbers: label.labels.map((x) => x.trackingNumber),
161
+ international: forms.length > 0,
162
+ charges,
163
+ },
164
+ binary: Object.keys(binary).length > 0 ? binary : undefined,
165
+ },
166
+ ];
167
+ }
168
+ exports.createOperationDescription = [
169
+ {
170
+ displayName: 'Account Number',
171
+ name: 'accountNumber',
172
+ type: 'string',
173
+ required: true,
174
+ default: '',
175
+ displayOptions: { show: showOnlyForCreate },
176
+ description: 'Your UPS account number (ShipperNumber). Billed as the shipper (Type 01).',
177
+ },
178
+ {
179
+ displayName: 'Service Code',
180
+ name: 'service',
181
+ type: 'string',
182
+ required: true,
183
+ default: '03',
184
+ placeholder: '03 = Ground',
185
+ displayOptions: { show: showOnlyForCreate },
186
+ description: 'UPS service code (e.g. 03 Ground, 02 2nd Day Air, 01 Next Day Air)',
187
+ },
188
+ ...(0, shared_1.addressFields)({
189
+ prefix: 'shipper',
190
+ label: 'Shipper',
191
+ show: showOnlyForCreate,
192
+ includeName: true,
193
+ includePhone: true,
194
+ required: true,
195
+ }),
196
+ ...(0, shared_1.addressFields)({
197
+ prefix: 'shipFrom',
198
+ label: 'Ship From (optional, defaults to Shipper)',
199
+ show: showOnlyForCreate,
200
+ includeName: true,
201
+ }),
202
+ ...(0, shared_1.addressFields)({
203
+ prefix: 'shipTo',
204
+ label: 'Ship To',
205
+ show: showOnlyForCreate,
206
+ includeName: true,
207
+ includePhone: true,
208
+ includeResidential: true,
209
+ required: true,
210
+ }),
211
+ {
212
+ displayName: 'Weight',
213
+ name: 'weight',
214
+ type: 'number',
215
+ default: 1,
216
+ required: true,
217
+ displayOptions: { show: showOnlyForCreate },
218
+ },
219
+ {
220
+ displayName: 'Weight Unit',
221
+ name: 'weightUnit',
222
+ type: 'options',
223
+ options: [
224
+ { name: 'Pounds (LBS)', value: 'LBS' },
225
+ { name: 'Kilograms (KGS)', value: 'KGS' },
226
+ ],
227
+ default: 'LBS',
228
+ displayOptions: { show: showOnlyForCreate },
229
+ },
230
+ {
231
+ displayName: 'Dimensions',
232
+ name: 'dimensions',
233
+ type: 'fixedCollection',
234
+ default: {},
235
+ displayOptions: { show: showOnlyForCreate },
236
+ options: [
237
+ {
238
+ displayName: 'Dimension',
239
+ name: 'dimension',
240
+ values: [
241
+ { displayName: 'Height', name: 'height', type: 'number', default: 0 },
242
+ { displayName: 'Length', name: 'length', type: 'number', default: 0 },
243
+ { displayName: 'Width', name: 'width', type: 'number', default: 0 },
244
+ ],
245
+ },
246
+ ],
247
+ },
248
+ {
249
+ displayName: 'Dimension Unit',
250
+ name: 'dimensionUnit',
251
+ type: 'options',
252
+ options: [
253
+ { name: 'Centimeters (CM)', value: 'CM' },
254
+ { name: 'Inches (IN)', value: 'IN' },
255
+ ],
256
+ default: 'IN',
257
+ displayOptions: { show: showOnlyForCreate },
258
+ },
259
+ {
260
+ displayName: 'Label Format',
261
+ name: 'labelFormat',
262
+ type: 'options',
263
+ options: [
264
+ { name: 'EPL', value: 'EPL' },
265
+ { name: 'GIF', value: 'GIF' },
266
+ { name: 'SPL', value: 'SPL' },
267
+ { name: 'ZPL', value: 'ZPL' },
268
+ ],
269
+ default: 'GIF',
270
+ displayOptions: { show: showOnlyForCreate },
271
+ description: 'Label image format. No PDF label is offered (delta 13.6).',
272
+ },
273
+ {
274
+ displayName: 'The customs fields below are REQUIRED when the origin and destination countries differ (international). Leave them empty for domestic shipments.',
275
+ name: 'customsNotice',
276
+ type: 'notice',
277
+ default: '',
278
+ displayOptions: { show: showOnlyForCreate },
279
+ },
280
+ {
281
+ displayName: 'Reason For Export',
282
+ name: 'customsReasonForExport',
283
+ type: 'string',
284
+ default: 'SALE',
285
+ displayOptions: { show: showOnlyForCreate },
286
+ },
287
+ {
288
+ displayName: 'Customs Currency',
289
+ name: 'customsCurrency',
290
+ type: 'string',
291
+ default: 'USD',
292
+ displayOptions: { show: showOnlyForCreate },
293
+ },
294
+ {
295
+ displayName: 'Terms Of Shipment',
296
+ name: 'customsTermsOfShipment',
297
+ type: 'string',
298
+ default: 'DDU',
299
+ displayOptions: { show: showOnlyForCreate },
300
+ description: 'Incoterms. v1 bills duties to the receiver (DDU).',
301
+ },
302
+ {
303
+ displayName: 'Invoice Number',
304
+ name: 'customsInvoiceNumber',
305
+ type: 'string',
306
+ default: '',
307
+ displayOptions: { show: showOnlyForCreate },
308
+ },
309
+ {
310
+ displayName: 'Invoice Date',
311
+ name: 'customsInvoiceDate',
312
+ type: 'string',
313
+ default: '',
314
+ placeholder: 'yyyyMMdd',
315
+ displayOptions: { show: showOnlyForCreate },
316
+ description: 'Commercial-invoice date in yyyyMMdd format. UPS requires it for international shipments; leave blank to use today (UTC).',
317
+ },
318
+ ...(0, shared_1.addressFields)({
319
+ prefix: 'soldTo',
320
+ label: 'Sold To (International)',
321
+ show: showOnlyForCreate,
322
+ includeName: true,
323
+ }),
324
+ {
325
+ displayName: 'Commodities',
326
+ name: 'commodities',
327
+ type: 'fixedCollection',
328
+ typeOptions: { multipleValues: true },
329
+ default: {},
330
+ displayOptions: { show: showOnlyForCreate },
331
+ description: 'Customs commodity lines (international only)',
332
+ options: [
333
+ {
334
+ displayName: 'Commodity',
335
+ name: 'line',
336
+ values: [
337
+ { displayName: 'Commodity Code', name: 'commodityCode', type: 'string', default: '' },
338
+ { displayName: 'Description', name: 'description', type: 'string', default: '' },
339
+ { displayName: 'Origin Country', name: 'originCountry', type: 'string', default: '' },
340
+ { displayName: 'Quantity', name: 'quantity', type: 'number', default: 1 },
341
+ { displayName: 'Unit Of Measure', name: 'unitOfMeasure', type: 'string', default: 'EA' },
342
+ { displayName: 'Unit Value', name: 'unitValue', type: 'number', default: 0 },
343
+ ],
344
+ },
345
+ ],
346
+ },
347
+ ];
348
+ exports.createOperationOption = {
349
+ name: 'Create',
350
+ value: 'create',
351
+ action: 'Create a shipment and get a label',
352
+ description: 'Create a shipment and return the tracking number plus a label (and customs invoice for international)',
353
+ routing: {
354
+ request: {
355
+ method: 'POST',
356
+ url: '/shipments/v2409/ship',
357
+ ignoreHttpStatusErrors: true,
358
+ },
359
+ send: { preSend: [createPreSend] },
360
+ output: { postReceive: [createPostReceive] },
361
+ },
362
+ };
363
+ //# sourceMappingURL=create.operation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.operation.js","sourceRoot":"","sources":["../../../../../nodes/Ups/resources/shipping/create.operation.ts"],"names":[],"mappings":";;;AAAA,+CAQsB;AACtB,0DAAuD;AACvD,gEAA6D;AAC7D,kEAAwF;AACxF,gFAAgG;AAChG,0DAAyE;AACzE,0DAAuD;AACvD,8DAA2D;AAC3D,wDAAqD;AACrD,q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,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,EAAE;oBACzE,EAAE,WAAW,EAAE,iBAAiB,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE;oBACxF,EAAE,WAAW,EAAE,YAAY,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,EAAE;iBAC5E;aACD;SACD;KACD;CACD,CAAC;AAEW,QAAA,qBAAqB,GAAG;IACpC,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,QAAQ;IACf,MAAM,EAAE,mCAAmC;IAC3C,WAAW,EACV,uGAAuG;IACxG,OAAO,EAAE;QACR,OAAO,EAAE;YACR,MAAM,EAAE,MAAe;YACvB,GAAG,EAAE,uBAAuB;YAC5B,sBAAsB,EAAE,IAAI;SAC5B;QACD,IAAI,EAAE,EAAE,OAAO,EAAE,CAAC,aAAa,CAAC,EAAE;QAClC,MAAM,EAAE,EAAE,WAAW,EAAE,CAAC,iBAAiB,CAAC,EAAE;KAC5C;CACD,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { type IExecuteSingleFunctions, type IHttpRequestOptions, type IN8nHttpFullResponse, type INodeExecutionData, type INodeProperties } from 'n8n-workflow';
2
+ declare function ratesPreSend(this: IExecuteSingleFunctions, requestOptions: IHttpRequestOptions): Promise<IHttpRequestOptions>;
3
+ declare function ratesPostReceive(this: IExecuteSingleFunctions, _items: INodeExecutionData[], response: IN8nHttpFullResponse): Promise<INodeExecutionData[]>;
4
+ export declare const getRatesOperationDescription: INodeProperties[];
5
+ export declare const getRatesOperationOption: {
6
+ name: string;
7
+ value: string;
8
+ action: string;
9
+ description: string;
10
+ routing: {
11
+ request: {
12
+ method: "POST";
13
+ url: string;
14
+ ignoreHttpStatusErrors: boolean;
15
+ };
16
+ send: {
17
+ preSend: (typeof ratesPreSend)[];
18
+ };
19
+ output: {
20
+ postReceive: (typeof ratesPostReceive)[];
21
+ };
22
+ };
23
+ };
24
+ export {};