@nodrel-dev/n8n-nodes-ups 0.3.1 → 0.4.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 (37) hide show
  1. package/README.md +45 -13
  2. package/dist/credentials/UpsOAuth2Api.credentials.js +1 -1
  3. package/dist/credentials/UpsOAuth2Api.credentials.js.map +1 -1
  4. package/dist/credentials/UpsShipperProfileApi.credentials.d.ts +8 -0
  5. package/dist/credentials/UpsShipperProfileApi.credentials.js +76 -0
  6. package/dist/credentials/UpsShipperProfileApi.credentials.js.map +1 -0
  7. package/dist/nodes/Ups/Ups.node.d.ts +6 -1
  8. package/dist/nodes/Ups/Ups.node.js +37 -1
  9. package/dist/nodes/Ups/Ups.node.js.map +1 -1
  10. package/dist/nodes/Ups/Ups.node.json +2 -2
  11. package/dist/nodes/Ups/core/buildRateRequest.d.ts +34 -0
  12. package/dist/nodes/Ups/core/buildRateRequest.js +33 -0
  13. package/dist/nodes/Ups/core/buildRateRequest.js.map +1 -0
  14. package/dist/nodes/Ups/core/buildShipmentRequest.d.ts +33 -0
  15. package/dist/nodes/Ups/core/buildShipmentRequest.js +57 -0
  16. package/dist/nodes/Ups/core/buildShipmentRequest.js.map +1 -0
  17. package/dist/nodes/Ups/core/buildShipmentResult.d.ts +18 -0
  18. package/dist/nodes/Ups/core/buildShipmentResult.js +34 -0
  19. package/dist/nodes/Ups/core/buildShipmentResult.js.map +1 -0
  20. package/dist/nodes/Ups/resources/address/validate.operation.js +8 -1
  21. package/dist/nodes/Ups/resources/address/validate.operation.js.map +1 -1
  22. package/dist/nodes/Ups/resources/shipping/create.operation.js +150 -202
  23. package/dist/nodes/Ups/resources/shipping/create.operation.js.map +1 -1
  24. package/dist/nodes/Ups/resources/shipping/getRates.operation.js +50 -48
  25. package/dist/nodes/Ups/resources/shipping/getRates.operation.js.map +1 -1
  26. package/dist/nodes/Ups/resources/shipping/{shared.d.ts → readParties.d.ts} +13 -13
  27. package/dist/nodes/Ups/resources/shipping/readParties.js +60 -0
  28. package/dist/nodes/Ups/resources/shipping/readParties.js.map +1 -0
  29. package/dist/nodes/Ups/resources/shipping/shipperProfile.d.ts +25 -0
  30. package/dist/nodes/Ups/resources/shipping/shipperProfile.js +40 -0
  31. package/dist/nodes/Ups/resources/shipping/shipperProfile.js.map +1 -0
  32. package/dist/nodes/Ups/resources/shipping/shippingFields.d.ts +18 -0
  33. package/dist/nodes/Ups/resources/shipping/{shared.js → shippingFields.js} +52 -44
  34. package/dist/nodes/Ups/resources/shipping/shippingFields.js.map +1 -0
  35. package/dist/package.json +5 -4
  36. package/package.json +5 -4
  37. package/dist/nodes/Ups/resources/shipping/shared.js.map +0 -1
@@ -2,15 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createOperationOption = exports.createOperationDescription = void 0;
4
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");
5
+ const buildShipmentRequest_1 = require("../../core/buildShipmentRequest");
6
+ const buildShipmentResult_1 = require("../../core/buildShipmentResult");
12
7
  const mapUpsError_1 = require("../../core/mapUpsError");
13
- const shared_1 = require("./shared");
8
+ const shippingFields_1 = require("./shippingFields");
9
+ const readParties_1 = require("./readParties");
10
+ const shipperProfile_1 = require("./shipperProfile");
14
11
  const showOnlyForCreate = {
15
12
  operation: ['create'],
16
13
  resource: ['shipping'],
@@ -36,13 +33,14 @@ function todayYyyyMmdd() {
36
33
  return new Date().toISOString().slice(0, 10).replace(/-/g, '');
37
34
  }
38
35
  function readCustoms(get) {
39
- const soldTo = (0, shared_1.readAddress)(get, 'soldTo');
36
+ const soldTo = (0, readParties_1.readAddress)(get, 'soldTo');
37
+ const customs = get('customs', {});
40
38
  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(),
39
+ reasonForExport: customs.reasonForExport || 'SALE',
40
+ currency: customs.currency || 'USD',
41
+ termsOfShipment: customs.termsOfShipment || 'DDU',
42
+ invoiceNumber: (customs.invoiceNumber || '').trim() || undefined,
43
+ invoiceDate: (customs.invoiceDate || '').trim() || todayYyyyMmdd(),
46
44
  soldTo: {
47
45
  name: get('soldToName', ''),
48
46
  addressLines: soldTo.addressLines,
@@ -53,88 +51,40 @@ function readCustoms(get) {
53
51
  },
54
52
  };
55
53
  }
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', '');
54
+ function buildShipmentBody(get, parties) {
55
+ const shipperName = parties.shipper.name;
67
56
  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),
57
+ return (0, buildShipmentRequest_1.buildShipmentRequest)({
58
+ accountNumber: parties.accountNumber,
59
+ service: get('service', '03'),
60
+ labelFormat: get('labelFormat', 'GIF'),
61
+ international: parties.international,
62
+ shipper: { address: parties.shipper.address, name: shipperName, phone: parties.shipper.phone },
63
+ shipTo: {
64
+ address: parties.shipTo,
65
+ name: get('shipToName', ''),
66
+ phone: get('shipToPhone', ''),
78
67
  },
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
- };
68
+ shipFrom: { address: parties.effectiveShipFrom, name: shipFromName },
69
+ package: (0, readParties_1.readPackage)(get),
70
+ customs: readCustoms(get),
71
+ commodities: readCommodities(get),
72
+ });
117
73
  }
118
74
  async function createPreSend(requestOptions) {
119
75
  const node = this.getNode();
120
76
  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.');
77
+ const profile = await (0, shipperProfile_1.loadShipperProfile)(this);
78
+ const parties = (0, readParties_1.resolveShipmentParties)(get, profile);
79
+ if (!parties.accountNumber) {
80
+ throw new n8n_workflow_1.NodeOperationError(node, 'An account number is required to create a shipment.', {
81
+ description: 'Enter your UPS account number (ShipperNumber), or attach a UPS Shipper Profile credential that supplies one.',
82
+ });
124
83
  }
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) {
84
+ if (parties.international && readCommodities(get).length === 0) {
135
85
  throw new n8n_workflow_1.NodeOperationError(node, 'International shipments require at least one customs commodity line.');
136
86
  }
137
- requestOptions.body = buildShipmentBody(get, international);
87
+ requestOptions.body = buildShipmentBody(get, parties);
138
88
  return requestOptions;
139
89
  }
140
90
  async function createPostReceive(_items, response) {
@@ -142,26 +92,15 @@ async function createPostReceive(_items, response) {
142
92
  (0, mapUpsError_1.mapUpsError)(this.getNode(), response.body, response.statusCode);
143
93
  }
144
94
  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);
95
+ const result = (0, buildShipmentResult_1.buildShipmentResult)(response.body, labelFormat);
148
96
  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);
97
+ for (const part of result.binaryParts) {
98
+ binary[part.key] = await this.helpers.prepareBinaryData(Buffer.from(part.base64, 'base64'), part.filename, part.mime);
155
99
  }
156
100
  return [
157
101
  {
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,
102
+ json: result.json,
103
+ binary: result.binaryParts.length > 0 ? binary : undefined,
165
104
  },
166
105
  ];
167
106
  }
@@ -170,36 +109,71 @@ exports.createOperationDescription = [
170
109
  displayName: 'Account Number',
171
110
  name: 'accountNumber',
172
111
  type: 'string',
173
- required: true,
174
112
  default: '',
175
113
  displayOptions: { show: showOnlyForCreate },
176
- description: 'Your UPS account number (ShipperNumber). Billed as the shipper (Type 01).',
114
+ description: 'Your UPS account number (ShipperNumber). Billed as the shipper (Type 01). Leave blank only if a UPS Shipper Profile credential supplies it.',
177
115
  },
178
116
  {
179
- displayName: 'Service Code',
117
+ displayName: 'Service',
180
118
  name: 'service',
181
- type: 'string',
119
+ type: 'options',
182
120
  required: true,
121
+ options: [
122
+ { name: 'Next Day Air (01)', value: '01' },
123
+ { name: '2nd Day Air (02)', value: '02' },
124
+ { name: 'Ground (03)', value: '03' },
125
+ { name: 'Express (07)', value: '07' },
126
+ { name: 'Expedited (08)', value: '08' },
127
+ { name: 'UPS Standard (11)', value: '11' },
128
+ { name: '3 Day Select (12)', value: '12' },
129
+ { name: 'Next Day Air Saver (13)', value: '13' },
130
+ { name: 'Next Day Air Early (14)', value: '14' },
131
+ { name: 'Worldwide Economy DDU (17)', value: '17' },
132
+ { name: 'Express Plus (54)', value: '54' },
133
+ { name: '2nd Day Air A.M. (59)', value: '59' },
134
+ { name: 'UPS Saver (65)', value: '65' },
135
+ { name: 'Access Point Economy (70)', value: '70' },
136
+ { name: 'Worldwide Express Freight Midday (71)', value: '71' },
137
+ { name: 'Worldwide Economy DDP (72)', value: '72' },
138
+ { name: 'Express 12:00 (74)', value: '74' },
139
+ { name: 'UPS Heavy Goods (75)', value: '75' },
140
+ { name: 'UPS Today Standard (82)', value: '82' },
141
+ { name: 'UPS Today Dedicated Courier (83)', value: '83' },
142
+ { name: 'UPS Today Intercity (84)', value: '84' },
143
+ { name: 'First Class Mail (M2)', value: 'M2' },
144
+ { name: 'Priority Mail (M3)', value: 'M3' },
145
+ { name: 'Expedited Mail Innovations (M4)', value: 'M4' },
146
+ { name: 'Priority Mail Innovations (M5)', value: 'M5' },
147
+ { name: 'Economy Mail Innovations (M6)', value: 'M6' },
148
+ { name: 'Mail Innovations Returns (M7)', value: 'M7' },
149
+ ],
183
150
  default: '03',
184
- placeholder: '03 = Ground',
185
151
  displayOptions: { show: showOnlyForCreate },
186
- description: 'UPS service code (e.g. 03 Ground, 02 2nd Day Air, 01 Next Day Air)',
152
+ description: 'UPS service. Availability depends on the lane and account; codes shown in parentheses match UPS Service.Code.',
187
153
  },
188
- ...(0, shared_1.addressFields)({
154
+ {
155
+ displayName: 'The Shipper fields below (and Account Number) can be supplied by an optional UPS Shipper Profile credential. An explicit value here always overrides the profile; leave a field blank to inherit it from the profile.',
156
+ name: 'shipperProfileNoticeCreate',
157
+ type: 'notice',
158
+ default: '',
159
+ displayOptions: { show: showOnlyForCreate },
160
+ },
161
+ ...(0, shippingFields_1.addressFields)({
189
162
  prefix: 'shipper',
190
163
  label: 'Shipper',
191
164
  show: showOnlyForCreate,
192
165
  includeName: true,
193
166
  includePhone: true,
194
- required: true,
167
+ countryDefault: '',
195
168
  }),
196
- ...(0, shared_1.addressFields)({
169
+ ...(0, shippingFields_1.addressFields)({
197
170
  prefix: 'shipFrom',
198
- label: 'Ship From (optional, defaults to Shipper)',
171
+ label: 'Ship From',
199
172
  show: showOnlyForCreate,
200
173
  includeName: true,
174
+ hint: 'Optional. Defaults to the Shipper address when left blank.',
201
175
  }),
202
- ...(0, shared_1.addressFields)({
176
+ ...(0, shippingFields_1.addressFields)({
203
177
  prefix: 'shipTo',
204
178
  label: 'Ship To',
205
179
  show: showOnlyForCreate,
@@ -208,54 +182,7 @@ exports.createOperationDescription = [
208
182
  includeResidential: true,
209
183
  required: true,
210
184
  }),
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
- },
185
+ ...(0, shippingFields_1.packageFields)(showOnlyForCreate),
259
186
  {
260
187
  displayName: 'Label Format',
261
188
  name: 'labelFormat',
@@ -271,55 +198,64 @@ exports.createOperationDescription = [
271
198
  description: 'Label image format. No PDF label is offered (delta 13.6).',
272
199
  },
273
200
  {
274
- displayName: 'The customs fields below are REQUIRED when the origin and destination countries differ (international). Leave them empty for domestic shipments.',
201
+ displayName: 'The Customs, Sold To, and Commodities fields below are REQUIRED when the origin and destination countries differ (international). Leave them empty for domestic shipments — sensible defaults are applied automatically.',
275
202
  name: 'customsNotice',
276
203
  type: 'notice',
277
204
  default: '',
278
205
  displayOptions: { show: showOnlyForCreate },
279
206
  },
280
207
  {
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',
208
+ displayName: 'Customs',
209
+ name: 'customs',
210
+ type: 'collection',
211
+ placeholder: 'Add Customs Field',
212
+ default: {},
315
213
  displayOptions: { show: showOnlyForCreate },
316
- description: 'Commercial-invoice date in yyyyMMdd format. UPS requires it for international shipments; leave blank to use today (UTC).',
214
+ description: 'Commercial-invoice details for international shipments',
215
+ options: [
216
+ {
217
+ displayName: 'Customs Currency',
218
+ name: 'currency',
219
+ type: 'options',
220
+ options: shippingFields_1.CURRENCY_OPTIONS,
221
+ default: 'USD',
222
+ description: 'Commercial-invoice currency. Pick a common code, or use an expression for any ISO 4217 code.',
223
+ },
224
+ {
225
+ displayName: 'Invoice Date',
226
+ name: 'invoiceDate',
227
+ type: 'string',
228
+ default: '',
229
+ placeholder: 'yyyyMMdd',
230
+ description: 'Commercial-invoice date in yyyyMMdd format. UPS requires it for international shipments; leave blank to use today (UTC).',
231
+ },
232
+ {
233
+ displayName: 'Invoice Number',
234
+ name: 'invoiceNumber',
235
+ type: 'string',
236
+ default: '',
237
+ },
238
+ {
239
+ displayName: 'Reason For Export',
240
+ name: 'reasonForExport',
241
+ type: 'string',
242
+ default: 'SALE',
243
+ },
244
+ {
245
+ displayName: 'Terms Of Shipment',
246
+ name: 'termsOfShipment',
247
+ type: 'string',
248
+ default: 'DDU',
249
+ description: 'Incoterms. v1 bills duties to the receiver (DDU).',
250
+ },
251
+ ],
317
252
  },
318
- ...(0, shared_1.addressFields)({
253
+ ...(0, shippingFields_1.addressFields)({
319
254
  prefix: 'soldTo',
320
- label: 'Sold To (International)',
255
+ label: 'Sold To',
321
256
  show: showOnlyForCreate,
322
257
  includeName: true,
258
+ hint: 'International shipments only. The party the goods are sold to (commercial invoice).',
323
259
  }),
324
260
  {
325
261
  displayName: 'Commodities',
@@ -337,9 +273,21 @@ exports.createOperationDescription = [
337
273
  { displayName: 'Commodity Code', name: 'commodityCode', type: 'string', default: '' },
338
274
  { displayName: 'Description', name: 'description', type: 'string', default: '' },
339
275
  { displayName: 'Origin Country', name: 'originCountry', type: 'string', default: '' },
340
- { displayName: 'Quantity', name: 'quantity', type: 'number', default: 1 },
276
+ {
277
+ displayName: 'Quantity',
278
+ name: 'quantity',
279
+ type: 'number',
280
+ default: 1,
281
+ typeOptions: { minValue: 0 },
282
+ },
341
283
  { displayName: 'Unit Of Measure', name: 'unitOfMeasure', type: 'string', default: 'EA' },
342
- { displayName: 'Unit Value', name: 'unitValue', type: 'number', default: 0 },
284
+ {
285
+ displayName: 'Unit Value',
286
+ name: 'unitValue',
287
+ type: 'number',
288
+ default: 0,
289
+ typeOptions: { minValue: 0 },
290
+ },
343
291
  ],
344
292
  },
345
293
  ],
@@ -1 +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,qCAAqF;AAErF,MAAM,iBAAiB,GAAG;IACzB,SAAS,EAAE,CAAC,QAAQ,CAAC;IACrB,QAAQ,EAAE,CAAC,UAAU,CAAC;CACtB,CAAC;AAmBF,SAAS,eAAe,CAAC,GAAgB;;IACxC,MAAM,IAAI,GAAG,MAAC,GAAG,CAAC,kBAAkB,EAAE,EAAE,CAAoB,mCAAI,EAAE,CAAC;IACnE,OAAO,IAAI;SACT,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,WAAC,OAAA,CAAC,MAAA,CAAC,CAAC,WAAW,mCAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAA,EAAA,CAAC;SACtD,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;;QAAC,OAAA,CAAC;YACZ,WAAW,EAAE,CAAC,CAAC,WAAqB;YACpC,QAAQ,EAAE,MAAA,CAAC,CAAC,QAAQ,mCAAI,CAAC;YACzB,SAAS,EAAE,MAAA,CAAC,CAAC,SAAS,mCAAI,CAAC;YAC3B,aAAa,EAAE,CAAC,CAAC,aAAa,IAAI,IAAI;YACtC,aAAa,EAAE,CAAC,CAAC,aAAa,IAAI,SAAS;YAC3C,aAAa,EAAE,CAAC,CAAC,aAAa,IAAI,SAAS;SAC3C,CAAC,CAAA;KAAA,CAAC,CAAC;AACN,CAAC;AAKD,SAAS,aAAa;IACrB,OAAO,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AAChE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aAAa,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;oBAChF,EAAE,WAAW,EAAE,gBAAgB,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;oBACrF,EAAE,WAAW,EAAE,UAAU,EAAE,IAAI,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"}
1
+ {"version":3,"file":"create.operation.js","sourceRoot":"","sources":["../../../../../nodes/Ups/resources/shipping/create.operation.ts"],"names":[],"mappings":";;;AAAA,+CAQsB;AAGtB,0EAAuE;AACvE,wEAAqE;AAErE,wDAAqD;AACrD,qDAAkF;AAClF,+CAMuB;AACvB,qDAAsD;AAEtD,MAAM,iBAAiB,GAAG;IACzB,SAAS,EAAE,CAAC,QAAQ,CAAC;IACrB,QAAQ,EAAE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AE,CAAC,EAAE;qBAC5B;oBACD,EAAE,WAAW,EAAE,iBAAiB,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE;oBACxF;wBACC,WAAW,EAAE,YAAY;wBACzB,IAAI,EAAE,WAAW;wBACjB,IAAI,EAAE,QAAQ;wBACd,OAAO,EAAE,CAAC;wBACV,WAAW,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE;qBAC5B;iBACD;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"}
@@ -2,11 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getRatesOperationOption = exports.getRatesOperationDescription = void 0;
4
4
  const n8n_workflow_1 = require("n8n-workflow");
5
- const toUpsAddress_1 = require("../../core/toUpsAddress");
5
+ const buildRateRequest_1 = require("../../core/buildRateRequest");
6
6
  const flattenRates_1 = require("../../core/flattenRates");
7
- const isInternational_1 = require("../../core/isInternational");
8
7
  const mapUpsError_1 = require("../../core/mapUpsError");
9
- const shared_1 = require("./shared");
8
+ const shippingFields_1 = require("./shippingFields");
9
+ const readParties_1 = require("./readParties");
10
+ const shipperProfile_1 = require("./shipperProfile");
10
11
  const showOnlyForRates = {
11
12
  operation: ['getRates'],
12
13
  resource: ['shipping'],
@@ -14,50 +15,30 @@ const showOnlyForRates = {
14
15
  async function ratesPreSend(requestOptions) {
15
16
  const node = this.getNode();
16
17
  const get = (name, fallback) => this.getNodeParameter(name, fallback);
17
- const accountNumber = get('accountNumber', '').trim();
18
- if (!accountNumber) {
18
+ const profile = await (0, shipperProfile_1.loadShipperProfile)(this);
19
+ const parties = (0, readParties_1.resolveShipmentParties)(get, profile);
20
+ if (!parties.accountNumber) {
19
21
  throw new n8n_workflow_1.NodeOperationError(node, 'An account number is required to request rates.', {
20
- description: 'Enter your UPS account number (ShipperNumber) on the Get Rates operation.',
22
+ description: 'Enter your UPS account number (ShipperNumber) on the Get Rates operation, or attach a UPS Shipper Profile credential that supplies one.',
21
23
  });
22
24
  }
23
- const shipper = (0, shared_1.readAddress)(get, 'shipper');
24
- const shipTo = (0, shared_1.readAddress)(get, 'shipTo');
25
- const shipFrom = (0, shared_1.readAddress)(get, 'shipFrom');
26
- const hasShipFrom = shipFrom.addressLines.length > 0 || shipFrom.city.length > 0;
27
- const effectiveShipFrom = hasShipFrom ? shipFrom : shipper;
28
25
  const customsValue = get('customsValue', 0) || 0;
29
- if ((0, isInternational_1.isInternational)({ shipFrom: effectiveShipFrom, shipper, shipTo }) && customsValue <= 0) {
26
+ if (parties.international && customsValue <= 0) {
30
27
  throw new n8n_workflow_1.NodeOperationError(node, 'A customs value is required for an international shipment.', {
31
28
  description: 'The origin and destination countries differ; enter the customs value of the goods.',
32
29
  });
33
30
  }
34
- const pkg = (0, shared_1.readPackage)(get);
35
- const currency = get('customsCurrency', 'USD') || 'USD';
36
- const weight = get('weight', 1) || 0;
37
- const weightUnit = get('weightUnit', 'LBS') || 'LBS';
38
- const shipment = {
39
- Shipper: { ShipperNumber: accountNumber, Address: (0, toUpsAddress_1.toUpsAddress)(shipper) },
40
- ShipTo: { Address: (0, toUpsAddress_1.toUpsAddress)(shipTo) },
41
- ShipFrom: { Address: (0, toUpsAddress_1.toUpsAddress)(effectiveShipFrom) },
42
- PickupType: { Code: '01' },
43
- DeliveryTimeInformation: { PackageBillType: '03' },
44
- ShipmentTotalWeight: {
45
- UnitOfMeasurement: { Code: weightUnit, Description: weightUnit },
46
- Weight: String(weight),
47
- },
48
- ShipmentRatingOptions: { NegotiatedRatesIndicator: '' },
49
- Package: { PackagingType: { Code: '02' }, ...pkg },
50
- };
51
- if (customsValue > 0) {
52
- shipment.InvoiceLineTotal = { CurrencyCode: currency, MonetaryValue: String(customsValue) };
53
- }
54
- requestOptions.body = {
55
- RateRequest: {
56
- Request: { TransactionReference: { CustomerContext: 'n8n-nodes-ups rate' } },
57
- PickupType: { Code: '01' },
58
- Shipment: shipment,
59
- },
60
- };
31
+ requestOptions.body = (0, buildRateRequest_1.buildRateRequest)({
32
+ accountNumber: parties.accountNumber,
33
+ shipper: parties.shipper.address,
34
+ shipTo: parties.shipTo,
35
+ effectiveShipFrom: parties.effectiveShipFrom,
36
+ package: (0, readParties_1.readPackage)(get),
37
+ weight: get('weight', 1) || 0,
38
+ weightUnit: get('weightUnit', 'LBS') || 'LBS',
39
+ customsValue,
40
+ currency: get('customsCurrency', 'USD') || 'USD',
41
+ });
61
42
  return requestOptions;
62
43
  }
63
44
  async function ratesPostReceive(_items, response) {
@@ -72,40 +53,61 @@ exports.getRatesOperationDescription = [
72
53
  displayName: 'Account Number',
73
54
  name: 'accountNumber',
74
55
  type: 'string',
75
- required: true,
76
56
  default: '',
77
57
  displayOptions: { show: showOnlyForRates },
78
- description: 'Your UPS account number (ShipperNumber). Required; also requests negotiated rates.',
58
+ description: 'Your UPS account number (ShipperNumber). Required (also requests negotiated rates) — leave blank only if a UPS Shipper Profile credential supplies it.',
59
+ },
60
+ {
61
+ displayName: 'The Shipper fields below (and Account Number) can be supplied by an optional UPS Shipper Profile credential. An explicit value here always overrides the profile; leave a field blank to inherit it from the profile.',
62
+ name: 'shipperProfileNoticeRates',
63
+ type: 'notice',
64
+ default: '',
65
+ displayOptions: { show: showOnlyForRates },
79
66
  },
80
- ...(0, shared_1.addressFields)({ prefix: 'shipper', label: 'Shipper', show: showOnlyForRates, required: true }),
81
- ...(0, shared_1.addressFields)({
67
+ ...(0, shippingFields_1.addressFields)({
68
+ prefix: 'shipper',
69
+ label: 'Shipper',
70
+ show: showOnlyForRates,
71
+ countryDefault: '',
72
+ }),
73
+ ...(0, shippingFields_1.addressFields)({
82
74
  prefix: 'shipFrom',
83
- label: 'Ship From (optional, defaults to Shipper)',
75
+ label: 'Ship From',
84
76
  show: showOnlyForRates,
77
+ hint: 'Optional. Defaults to the Shipper address when left blank.',
85
78
  }),
86
- ...(0, shared_1.addressFields)({
79
+ ...(0, shippingFields_1.addressFields)({
87
80
  prefix: 'shipTo',
88
81
  label: 'Ship To',
89
82
  show: showOnlyForRates,
90
83
  required: true,
91
84
  includeResidential: true,
92
85
  }),
93
- ...(0, shared_1.packageFields)(showOnlyForRates),
86
+ ...(0, shippingFields_1.packageFields)(showOnlyForRates),
87
+ {
88
+ displayName: 'The customs fields below are REQUIRED when the origin and destination countries differ (international). Leave them at their defaults for domestic shipments.',
89
+ name: 'ratesCustomsNotice',
90
+ type: 'notice',
91
+ default: '',
92
+ displayOptions: { show: showOnlyForRates },
93
+ },
94
94
  {
95
95
  displayName: 'Customs Value',
96
96
  name: 'customsValue',
97
97
  type: 'number',
98
98
  default: 0,
99
+ typeOptions: { minValue: 0 },
99
100
  displayOptions: { show: showOnlyForRates },
100
101
  description: 'Declared value of goods. Required when origin and destination countries differ (international).',
101
102
  },
102
103
  {
103
104
  displayName: 'Customs Currency',
104
105
  name: 'customsCurrency',
105
- type: 'string',
106
+ type: 'options',
107
+ options: shippingFields_1.CURRENCY_OPTIONS,
106
108
  default: 'USD',
107
109
  displayOptions: { show: showOnlyForRates },
108
- description: 'Currency code for the customs value',
110
+ description: 'Currency for the customs value. Pick a common code, or use an expression to set any ISO 4217 code.',
109
111
  },
110
112
  ];
111
113
  exports.getRatesOperationOption = {