@flexops/sdk 3.0.0 → 3.2.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.
package/dist/index.js CHANGED
@@ -101,13 +101,18 @@ var TrackingEmailEvent = {
101
101
  ReturnToSender: 5
102
102
  };
103
103
  var FlexOpsError = class extends Error {
104
- constructor(message, status, code, errors) {
104
+ constructor(message, status, code, errors, data) {
105
105
  super(message);
106
106
  this.status = status;
107
107
  this.code = code;
108
108
  this.errors = errors;
109
+ this.data = data;
109
110
  this.name = "FlexOpsError";
110
111
  }
112
+ status;
113
+ code;
114
+ errors;
115
+ data;
111
116
  };
112
117
  var FlexOpsRateLimitError = class extends FlexOpsError {
113
118
  constructor(message, retryAfter) {
@@ -115,6 +120,7 @@ var FlexOpsRateLimitError = class extends FlexOpsError {
115
120
  this.retryAfter = retryAfter;
116
121
  this.name = "FlexOpsRateLimitError";
117
122
  }
123
+ retryAfter;
118
124
  };
119
125
  var FlexOpsAuthError = class extends FlexOpsError {
120
126
  constructor(message) {
@@ -239,7 +245,8 @@ var HttpClient = class {
239
245
  errorBody.message ?? `HTTP ${response.status}: ${response.statusText}`,
240
246
  response.status,
241
247
  code ?? (response.status === 403 ? "FORBIDDEN" : void 0),
242
- errorBody.errors
248
+ errorBody.errors,
249
+ errorBody.data ?? void 0
243
250
  );
244
251
  if (this.isRetryable(verb, response.status, code)) {
245
252
  lastError = error;
@@ -314,6 +321,7 @@ var AuthResource = class {
314
321
  constructor(http) {
315
322
  this.http = http;
316
323
  }
324
+ http;
317
325
  /**
318
326
  * Authenticate with email and password. On success the returned access token (`data.token`) is
319
327
  * used for later requests. When `data.requiresTwoFactor` is true no token is issued yet.
@@ -357,6 +365,8 @@ var WorkspacesResource = class {
357
365
  this.http = http;
358
366
  this.getWorkspaceId = getWorkspaceId;
359
367
  }
368
+ http;
369
+ getWorkspaceId;
360
370
  wsPath(suffix) {
361
371
  const id = this.getWorkspaceId();
362
372
  if (!id) throw new Error("workspaceId is required. Set it via client.workspaceId or config.");
@@ -395,6 +405,8 @@ var ShippingResource = class {
395
405
  this.http = http;
396
406
  this.getWorkspaceId = getWorkspaceId;
397
407
  }
408
+ http;
409
+ getWorkspaceId;
398
410
  wsPath(suffix) {
399
411
  const id = this.getWorkspaceId();
400
412
  if (!id) throw new Error("workspaceId is required.");
@@ -489,14 +501,9 @@ var ShippingResource = class {
489
501
  country: a.countryCode ?? "US"
490
502
  });
491
503
  }
492
- // -----------------------------------------------------------------------
493
- // Batch Labels
494
- // -----------------------------------------------------------------------
495
- /** Create labels in batch. */
496
504
  async createBatch(request) {
497
505
  return this.http.post(this.wsPath("labels/batch"), request);
498
506
  }
499
- /** Preview a batch without purchasing (dry-run). */
500
507
  async previewBatch(request) {
501
508
  return this.http.post(this.wsPath("labels/batch/preview"), request);
502
509
  }
@@ -509,6 +516,28 @@ var ShippingResource = class {
509
516
  return this.http.get(this.wsPath(`labels/batch/${jobId}/items/${itemId}/label`));
510
517
  }
511
518
  // -----------------------------------------------------------------------
519
+ // Multi-Package Labels
520
+ // -----------------------------------------------------------------------
521
+ /**
522
+ * Buy labels for one order shipped in several boxes (1 to 99) with the same carrier and service.
523
+ * Every box's label slot is reserved before any label is bought; a box that fails does not stop the
524
+ * others, and each box reports its own `success`, `errorMessage` and `errorCode`.
525
+ *
526
+ * Resolves when at least one label was bought (check `failedPackages`). When none was, the Gateway
527
+ * answers 422 `AllPackagesFailed`, or 409 `OutcomeUnknown` when a box's carrier outcome is unknown and
528
+ * a label may exist: both throw a `FlexOpsError` whose `data` is the `MultiPackageShipmentResponse`.
529
+ * After `OutcomeUnknown`, check the order before buying again.
530
+ *
531
+ * `hazmatClassification` accepts only `HazmatClassification.None` or nothing. Pass a stable
532
+ * `idempotencyKey` to retry safely across processes; otherwise one is generated for this call.
533
+ */
534
+ async createMultiPackage(request, idempotencyKey) {
535
+ return this.http.request("POST", "/api/shipping/multi-package", {
536
+ body: request,
537
+ ...idempotencyKey ? { headers: { "Idempotency-Key": idempotencyKey } } : {}
538
+ });
539
+ }
540
+ // -----------------------------------------------------------------------
512
541
  // Carriers
513
542
  // -----------------------------------------------------------------------
514
543
  /** List available carriers and their services. */
@@ -579,6 +608,7 @@ var CarriersResource = class {
579
608
  constructor(http) {
580
609
  this.http = http;
581
610
  }
611
+ http;
582
612
  proxy(path) {
583
613
  return `/api/ApiProxy/${path.replace(/^\//, "")}`;
584
614
  }
@@ -1010,6 +1040,8 @@ var WebhooksResource = class {
1010
1040
  this.http = http;
1011
1041
  this.getWorkspaceId = getWorkspaceId;
1012
1042
  }
1043
+ http;
1044
+ getWorkspaceId;
1013
1045
  wsPath(suffix) {
1014
1046
  const id = this.getWorkspaceId();
1015
1047
  if (!id) throw new Error("workspaceId is required.");
@@ -1035,9 +1067,9 @@ var WebhooksResource = class {
1035
1067
  async update(webhookId, data) {
1036
1068
  return this.http.put(this.wsPath(webhookId), toWireRequest(data));
1037
1069
  }
1038
- /** Delete a webhook subscription. */
1070
+ /** Delete a webhook subscription. The Gateway answers 204 No Content, so there is no result. */
1039
1071
  async delete(webhookId) {
1040
- return this.http.delete(this.wsPath(webhookId));
1072
+ await this.http.delete(this.wsPath(webhookId));
1041
1073
  }
1042
1074
  /** Rotate the signing secret for a webhook. */
1043
1075
  async rotateSecret(webhookId) {
@@ -1128,6 +1160,8 @@ var WalletResource = class {
1128
1160
  this.http = http;
1129
1161
  this.getWorkspaceId = getWorkspaceId;
1130
1162
  }
1163
+ http;
1164
+ getWorkspaceId;
1131
1165
  /** Get the configured workspace's wallet balance. */
1132
1166
  async getBalance() {
1133
1167
  const id = this.getWorkspaceId();
@@ -1142,6 +1176,8 @@ var InsuranceResource = class {
1142
1176
  this.http = http;
1143
1177
  this.getWorkspaceId = getWorkspaceId;
1144
1178
  }
1179
+ http;
1180
+ getWorkspaceId;
1145
1181
  wsPath(suffix) {
1146
1182
  const id = this.getWorkspaceId();
1147
1183
  if (!id) throw new Error("workspaceId is required.");
@@ -1185,23 +1221,39 @@ var ReturnsResource = class {
1185
1221
  this.http = http;
1186
1222
  this.getWorkspaceId = getWorkspaceId;
1187
1223
  }
1224
+ http;
1225
+ getWorkspaceId;
1188
1226
  wsPath(suffix) {
1189
1227
  const id = this.getWorkspaceId();
1190
1228
  if (!id) throw new Error("workspaceId is required.");
1191
1229
  return `/api/workspaces/${id}/returns${suffix ? `/${suffix}` : ""}`;
1192
1230
  }
1193
- /** List return authorizations, optionally created between `startDate` and `endDate` (ISO 8601). */
1231
+ /**
1232
+ * List received returns, optionally between `startDate` and `endDate` (ISO 8601). The Gateway
1233
+ * defaults to the last 30 days. To list return authorizations, use `listRmas()`.
1234
+ */
1194
1235
  async list(query) {
1195
1236
  return this.http.get(
1196
1237
  this.wsPath(""),
1197
1238
  query
1198
1239
  );
1199
1240
  }
1200
- /** Get a return authorization by ID. */
1241
+ /**
1242
+ * Get a received return by its numeric return id (`ReturnSummary.returnId` or `Rma.returnId`).
1243
+ * An RMA number is not a return id: the Gateway has no route for it here. Use `getRma()`.
1244
+ */
1201
1245
  async get(returnId) {
1202
- return this.http.get(this.wsPath(returnId));
1246
+ return this.http.get(this.wsPath(String(returnId)));
1203
1247
  }
1204
- /** Create a return authorization (RMA) for an order. */
1248
+ /** List return authorizations (RMAs), one page at a time. */
1249
+ async listRmas(query) {
1250
+ return this.http.get(this.wsPath("rma"), query);
1251
+ }
1252
+ /** Get a return authorization by its RMA number, for example `RMA-1001`. */
1253
+ async getRma(rmaNumber) {
1254
+ return this.http.get(this.wsPath(`rma/${encodeURIComponent(rmaNumber)}`));
1255
+ }
1256
+ /** Create a return authorization (RMA) for an order. The Gateway answers 201 with the RMA. */
1205
1257
  async create(request) {
1206
1258
  return this.http.post(this.wsPath("rma"), request);
1207
1259
  }
@@ -1216,7 +1268,7 @@ var ReturnsResource = class {
1216
1268
  async generateLabel(rmaNumber, request = {}) {
1217
1269
  return this.http.post(this.wsPath(`${rmaNumber}/label`), request);
1218
1270
  }
1219
- /** Record the inspected items of a returned package at a warehouse. */
1271
+ /** Record the inspected items of a returned package at a warehouse. `rmaId` is the numeric `Rma.rmaId`. */
1220
1272
  async markReceived(rmaId, request) {
1221
1273
  return this.http.post(this.wsPath(`${rmaId}/receive`), request);
1222
1274
  }
@@ -1227,6 +1279,7 @@ var AnalyticsResource = class {
1227
1279
  constructor(http) {
1228
1280
  this.http = http;
1229
1281
  }
1282
+ http;
1230
1283
  path(endpoint) {
1231
1284
  return `/api/ApiProxy/api/v4/Analytics/${endpoint}`;
1232
1285
  }
@@ -1297,6 +1350,7 @@ var OrdersResource = class {
1297
1350
  constructor(http) {
1298
1351
  this.http = http;
1299
1352
  }
1353
+ http;
1300
1354
  path(endpoint) {
1301
1355
  return `/api/ApiProxy/api/v1/Order/${endpoint}`;
1302
1356
  }
@@ -1347,6 +1401,7 @@ var InventoryResource = class {
1347
1401
  constructor(http) {
1348
1402
  this.http = http;
1349
1403
  }
1404
+ http;
1350
1405
  /** Get a warehouse inventory snapshot. */
1351
1406
  async getWarehouseSnapshot(params) {
1352
1407
  return this.http.get("/api/ApiProxy/api/v1/Inventory/getWarehouseInventorySnapshot", params);
@@ -1367,6 +1422,8 @@ var PickupsResource = class {
1367
1422
  this.http = http;
1368
1423
  this.getWorkspaceId = getWorkspaceId;
1369
1424
  }
1425
+ http;
1426
+ getWorkspaceId;
1370
1427
  wsPath(suffix) {
1371
1428
  const id = this.getWorkspaceId();
1372
1429
  if (!id) throw new Error("workspaceId is required.");
@@ -1396,6 +1453,8 @@ var ScanFormsResource = class {
1396
1453
  this.http = http;
1397
1454
  this.getWorkspaceId = getWorkspaceId;
1398
1455
  }
1456
+ http;
1457
+ getWorkspaceId;
1399
1458
  wsPath(suffix) {
1400
1459
  const id = this.getWorkspaceId();
1401
1460
  if (!id) throw new Error("workspaceId is required.");
@@ -1421,6 +1480,8 @@ var RulesResource = class {
1421
1480
  this.http = http;
1422
1481
  this.getWorkspaceId = getWorkspaceId;
1423
1482
  }
1483
+ http;
1484
+ getWorkspaceId;
1424
1485
  wsPath(suffix) {
1425
1486
  const id = this.getWorkspaceId();
1426
1487
  if (!id) throw new Error("workspaceId is required.");
@@ -1442,9 +1503,9 @@ var RulesResource = class {
1442
1503
  async update(ruleId, rule) {
1443
1504
  return this.http.put(this.wsPath(ruleId), rule);
1444
1505
  }
1445
- /** Delete a shipping rule. */
1506
+ /** Delete a shipping rule. The Gateway answers 204 No Content, so there is no result. */
1446
1507
  async delete(ruleId) {
1447
- return this.http.delete(this.wsPath(ruleId));
1508
+ await this.http.delete(this.wsPath(ruleId));
1448
1509
  }
1449
1510
  /** Reorder rules: each listed rule gets its position in `ruleIds` as its priority (0 first). */
1450
1511
  async reorder(ruleIds) {
@@ -1464,6 +1525,8 @@ var CarbonOffsetsResource = class {
1464
1525
  this.http = http;
1465
1526
  this.getWorkspaceId = getWorkspaceId;
1466
1527
  }
1528
+ http;
1529
+ getWorkspaceId;
1467
1530
  wsPath(suffix = "") {
1468
1531
  const id = this.getWorkspaceId();
1469
1532
  if (!id) throw new Error("workspaceId is required.");
@@ -1515,6 +1578,8 @@ var RecurringShipmentsResource = class {
1515
1578
  this.http = http;
1516
1579
  this.getWorkspaceId = getWorkspaceId;
1517
1580
  }
1581
+ http;
1582
+ getWorkspaceId;
1518
1583
  wsPath(suffix = "") {
1519
1584
  const id = this.getWorkspaceId();
1520
1585
  if (!id) throw new Error("workspaceId is required.");
@@ -1565,6 +1630,8 @@ var ReportSchedulesResource = class {
1565
1630
  this.http = http;
1566
1631
  this.getWorkspaceId = getWorkspaceId;
1567
1632
  }
1633
+ http;
1634
+ getWorkspaceId;
1568
1635
  wsPath(suffix = "") {
1569
1636
  const id = this.getWorkspaceId();
1570
1637
  if (!id) throw new Error("workspaceId is required.");
@@ -1602,6 +1669,8 @@ var EmailTemplatesResource = class {
1602
1669
  this.http = http;
1603
1670
  this.getWorkspaceId = getWorkspaceId;
1604
1671
  }
1672
+ http;
1673
+ getWorkspaceId;
1605
1674
  wsPath(suffix = "") {
1606
1675
  const id = this.getWorkspaceId();
1607
1676
  if (!id) throw new Error("workspaceId is required.");
@@ -1634,6 +1703,7 @@ var HsCodesResource = class {
1634
1703
  constructor(http) {
1635
1704
  this.http = http;
1636
1705
  }
1706
+ http;
1637
1707
  /** Search for HS codes by product description. Requires Enterprise plan. */
1638
1708
  async search(query, options) {
1639
1709
  return this.http.get("/api/shipping/hs-codes/search", { query, ...options });
package/dist/index.mjs CHANGED
@@ -53,13 +53,18 @@ var TrackingEmailEvent = {
53
53
  ReturnToSender: 5
54
54
  };
55
55
  var FlexOpsError = class extends Error {
56
- constructor(message, status, code, errors) {
56
+ constructor(message, status, code, errors, data) {
57
57
  super(message);
58
58
  this.status = status;
59
59
  this.code = code;
60
60
  this.errors = errors;
61
+ this.data = data;
61
62
  this.name = "FlexOpsError";
62
63
  }
64
+ status;
65
+ code;
66
+ errors;
67
+ data;
63
68
  };
64
69
  var FlexOpsRateLimitError = class extends FlexOpsError {
65
70
  constructor(message, retryAfter) {
@@ -67,6 +72,7 @@ var FlexOpsRateLimitError = class extends FlexOpsError {
67
72
  this.retryAfter = retryAfter;
68
73
  this.name = "FlexOpsRateLimitError";
69
74
  }
75
+ retryAfter;
70
76
  };
71
77
  var FlexOpsAuthError = class extends FlexOpsError {
72
78
  constructor(message) {
@@ -191,7 +197,8 @@ var HttpClient = class {
191
197
  errorBody.message ?? `HTTP ${response.status}: ${response.statusText}`,
192
198
  response.status,
193
199
  code ?? (response.status === 403 ? "FORBIDDEN" : void 0),
194
- errorBody.errors
200
+ errorBody.errors,
201
+ errorBody.data ?? void 0
195
202
  );
196
203
  if (this.isRetryable(verb, response.status, code)) {
197
204
  lastError = error;
@@ -266,6 +273,7 @@ var AuthResource = class {
266
273
  constructor(http) {
267
274
  this.http = http;
268
275
  }
276
+ http;
269
277
  /**
270
278
  * Authenticate with email and password. On success the returned access token (`data.token`) is
271
279
  * used for later requests. When `data.requiresTwoFactor` is true no token is issued yet.
@@ -309,6 +317,8 @@ var WorkspacesResource = class {
309
317
  this.http = http;
310
318
  this.getWorkspaceId = getWorkspaceId;
311
319
  }
320
+ http;
321
+ getWorkspaceId;
312
322
  wsPath(suffix) {
313
323
  const id = this.getWorkspaceId();
314
324
  if (!id) throw new Error("workspaceId is required. Set it via client.workspaceId or config.");
@@ -347,6 +357,8 @@ var ShippingResource = class {
347
357
  this.http = http;
348
358
  this.getWorkspaceId = getWorkspaceId;
349
359
  }
360
+ http;
361
+ getWorkspaceId;
350
362
  wsPath(suffix) {
351
363
  const id = this.getWorkspaceId();
352
364
  if (!id) throw new Error("workspaceId is required.");
@@ -441,14 +453,9 @@ var ShippingResource = class {
441
453
  country: a.countryCode ?? "US"
442
454
  });
443
455
  }
444
- // -----------------------------------------------------------------------
445
- // Batch Labels
446
- // -----------------------------------------------------------------------
447
- /** Create labels in batch. */
448
456
  async createBatch(request) {
449
457
  return this.http.post(this.wsPath("labels/batch"), request);
450
458
  }
451
- /** Preview a batch without purchasing (dry-run). */
452
459
  async previewBatch(request) {
453
460
  return this.http.post(this.wsPath("labels/batch/preview"), request);
454
461
  }
@@ -461,6 +468,28 @@ var ShippingResource = class {
461
468
  return this.http.get(this.wsPath(`labels/batch/${jobId}/items/${itemId}/label`));
462
469
  }
463
470
  // -----------------------------------------------------------------------
471
+ // Multi-Package Labels
472
+ // -----------------------------------------------------------------------
473
+ /**
474
+ * Buy labels for one order shipped in several boxes (1 to 99) with the same carrier and service.
475
+ * Every box's label slot is reserved before any label is bought; a box that fails does not stop the
476
+ * others, and each box reports its own `success`, `errorMessage` and `errorCode`.
477
+ *
478
+ * Resolves when at least one label was bought (check `failedPackages`). When none was, the Gateway
479
+ * answers 422 `AllPackagesFailed`, or 409 `OutcomeUnknown` when a box's carrier outcome is unknown and
480
+ * a label may exist: both throw a `FlexOpsError` whose `data` is the `MultiPackageShipmentResponse`.
481
+ * After `OutcomeUnknown`, check the order before buying again.
482
+ *
483
+ * `hazmatClassification` accepts only `HazmatClassification.None` or nothing. Pass a stable
484
+ * `idempotencyKey` to retry safely across processes; otherwise one is generated for this call.
485
+ */
486
+ async createMultiPackage(request, idempotencyKey) {
487
+ return this.http.request("POST", "/api/shipping/multi-package", {
488
+ body: request,
489
+ ...idempotencyKey ? { headers: { "Idempotency-Key": idempotencyKey } } : {}
490
+ });
491
+ }
492
+ // -----------------------------------------------------------------------
464
493
  // Carriers
465
494
  // -----------------------------------------------------------------------
466
495
  /** List available carriers and their services. */
@@ -531,6 +560,7 @@ var CarriersResource = class {
531
560
  constructor(http) {
532
561
  this.http = http;
533
562
  }
563
+ http;
534
564
  proxy(path) {
535
565
  return `/api/ApiProxy/${path.replace(/^\//, "")}`;
536
566
  }
@@ -962,6 +992,8 @@ var WebhooksResource = class {
962
992
  this.http = http;
963
993
  this.getWorkspaceId = getWorkspaceId;
964
994
  }
995
+ http;
996
+ getWorkspaceId;
965
997
  wsPath(suffix) {
966
998
  const id = this.getWorkspaceId();
967
999
  if (!id) throw new Error("workspaceId is required.");
@@ -987,9 +1019,9 @@ var WebhooksResource = class {
987
1019
  async update(webhookId, data) {
988
1020
  return this.http.put(this.wsPath(webhookId), toWireRequest(data));
989
1021
  }
990
- /** Delete a webhook subscription. */
1022
+ /** Delete a webhook subscription. The Gateway answers 204 No Content, so there is no result. */
991
1023
  async delete(webhookId) {
992
- return this.http.delete(this.wsPath(webhookId));
1024
+ await this.http.delete(this.wsPath(webhookId));
993
1025
  }
994
1026
  /** Rotate the signing secret for a webhook. */
995
1027
  async rotateSecret(webhookId) {
@@ -1080,6 +1112,8 @@ var WalletResource = class {
1080
1112
  this.http = http;
1081
1113
  this.getWorkspaceId = getWorkspaceId;
1082
1114
  }
1115
+ http;
1116
+ getWorkspaceId;
1083
1117
  /** Get the configured workspace's wallet balance. */
1084
1118
  async getBalance() {
1085
1119
  const id = this.getWorkspaceId();
@@ -1094,6 +1128,8 @@ var InsuranceResource = class {
1094
1128
  this.http = http;
1095
1129
  this.getWorkspaceId = getWorkspaceId;
1096
1130
  }
1131
+ http;
1132
+ getWorkspaceId;
1097
1133
  wsPath(suffix) {
1098
1134
  const id = this.getWorkspaceId();
1099
1135
  if (!id) throw new Error("workspaceId is required.");
@@ -1137,23 +1173,39 @@ var ReturnsResource = class {
1137
1173
  this.http = http;
1138
1174
  this.getWorkspaceId = getWorkspaceId;
1139
1175
  }
1176
+ http;
1177
+ getWorkspaceId;
1140
1178
  wsPath(suffix) {
1141
1179
  const id = this.getWorkspaceId();
1142
1180
  if (!id) throw new Error("workspaceId is required.");
1143
1181
  return `/api/workspaces/${id}/returns${suffix ? `/${suffix}` : ""}`;
1144
1182
  }
1145
- /** List return authorizations, optionally created between `startDate` and `endDate` (ISO 8601). */
1183
+ /**
1184
+ * List received returns, optionally between `startDate` and `endDate` (ISO 8601). The Gateway
1185
+ * defaults to the last 30 days. To list return authorizations, use `listRmas()`.
1186
+ */
1146
1187
  async list(query) {
1147
1188
  return this.http.get(
1148
1189
  this.wsPath(""),
1149
1190
  query
1150
1191
  );
1151
1192
  }
1152
- /** Get a return authorization by ID. */
1193
+ /**
1194
+ * Get a received return by its numeric return id (`ReturnSummary.returnId` or `Rma.returnId`).
1195
+ * An RMA number is not a return id: the Gateway has no route for it here. Use `getRma()`.
1196
+ */
1153
1197
  async get(returnId) {
1154
- return this.http.get(this.wsPath(returnId));
1198
+ return this.http.get(this.wsPath(String(returnId)));
1155
1199
  }
1156
- /** Create a return authorization (RMA) for an order. */
1200
+ /** List return authorizations (RMAs), one page at a time. */
1201
+ async listRmas(query) {
1202
+ return this.http.get(this.wsPath("rma"), query);
1203
+ }
1204
+ /** Get a return authorization by its RMA number, for example `RMA-1001`. */
1205
+ async getRma(rmaNumber) {
1206
+ return this.http.get(this.wsPath(`rma/${encodeURIComponent(rmaNumber)}`));
1207
+ }
1208
+ /** Create a return authorization (RMA) for an order. The Gateway answers 201 with the RMA. */
1157
1209
  async create(request) {
1158
1210
  return this.http.post(this.wsPath("rma"), request);
1159
1211
  }
@@ -1168,7 +1220,7 @@ var ReturnsResource = class {
1168
1220
  async generateLabel(rmaNumber, request = {}) {
1169
1221
  return this.http.post(this.wsPath(`${rmaNumber}/label`), request);
1170
1222
  }
1171
- /** Record the inspected items of a returned package at a warehouse. */
1223
+ /** Record the inspected items of a returned package at a warehouse. `rmaId` is the numeric `Rma.rmaId`. */
1172
1224
  async markReceived(rmaId, request) {
1173
1225
  return this.http.post(this.wsPath(`${rmaId}/receive`), request);
1174
1226
  }
@@ -1179,6 +1231,7 @@ var AnalyticsResource = class {
1179
1231
  constructor(http) {
1180
1232
  this.http = http;
1181
1233
  }
1234
+ http;
1182
1235
  path(endpoint) {
1183
1236
  return `/api/ApiProxy/api/v4/Analytics/${endpoint}`;
1184
1237
  }
@@ -1249,6 +1302,7 @@ var OrdersResource = class {
1249
1302
  constructor(http) {
1250
1303
  this.http = http;
1251
1304
  }
1305
+ http;
1252
1306
  path(endpoint) {
1253
1307
  return `/api/ApiProxy/api/v1/Order/${endpoint}`;
1254
1308
  }
@@ -1299,6 +1353,7 @@ var InventoryResource = class {
1299
1353
  constructor(http) {
1300
1354
  this.http = http;
1301
1355
  }
1356
+ http;
1302
1357
  /** Get a warehouse inventory snapshot. */
1303
1358
  async getWarehouseSnapshot(params) {
1304
1359
  return this.http.get("/api/ApiProxy/api/v1/Inventory/getWarehouseInventorySnapshot", params);
@@ -1319,6 +1374,8 @@ var PickupsResource = class {
1319
1374
  this.http = http;
1320
1375
  this.getWorkspaceId = getWorkspaceId;
1321
1376
  }
1377
+ http;
1378
+ getWorkspaceId;
1322
1379
  wsPath(suffix) {
1323
1380
  const id = this.getWorkspaceId();
1324
1381
  if (!id) throw new Error("workspaceId is required.");
@@ -1348,6 +1405,8 @@ var ScanFormsResource = class {
1348
1405
  this.http = http;
1349
1406
  this.getWorkspaceId = getWorkspaceId;
1350
1407
  }
1408
+ http;
1409
+ getWorkspaceId;
1351
1410
  wsPath(suffix) {
1352
1411
  const id = this.getWorkspaceId();
1353
1412
  if (!id) throw new Error("workspaceId is required.");
@@ -1373,6 +1432,8 @@ var RulesResource = class {
1373
1432
  this.http = http;
1374
1433
  this.getWorkspaceId = getWorkspaceId;
1375
1434
  }
1435
+ http;
1436
+ getWorkspaceId;
1376
1437
  wsPath(suffix) {
1377
1438
  const id = this.getWorkspaceId();
1378
1439
  if (!id) throw new Error("workspaceId is required.");
@@ -1394,9 +1455,9 @@ var RulesResource = class {
1394
1455
  async update(ruleId, rule) {
1395
1456
  return this.http.put(this.wsPath(ruleId), rule);
1396
1457
  }
1397
- /** Delete a shipping rule. */
1458
+ /** Delete a shipping rule. The Gateway answers 204 No Content, so there is no result. */
1398
1459
  async delete(ruleId) {
1399
- return this.http.delete(this.wsPath(ruleId));
1460
+ await this.http.delete(this.wsPath(ruleId));
1400
1461
  }
1401
1462
  /** Reorder rules: each listed rule gets its position in `ruleIds` as its priority (0 first). */
1402
1463
  async reorder(ruleIds) {
@@ -1416,6 +1477,8 @@ var CarbonOffsetsResource = class {
1416
1477
  this.http = http;
1417
1478
  this.getWorkspaceId = getWorkspaceId;
1418
1479
  }
1480
+ http;
1481
+ getWorkspaceId;
1419
1482
  wsPath(suffix = "") {
1420
1483
  const id = this.getWorkspaceId();
1421
1484
  if (!id) throw new Error("workspaceId is required.");
@@ -1467,6 +1530,8 @@ var RecurringShipmentsResource = class {
1467
1530
  this.http = http;
1468
1531
  this.getWorkspaceId = getWorkspaceId;
1469
1532
  }
1533
+ http;
1534
+ getWorkspaceId;
1470
1535
  wsPath(suffix = "") {
1471
1536
  const id = this.getWorkspaceId();
1472
1537
  if (!id) throw new Error("workspaceId is required.");
@@ -1517,6 +1582,8 @@ var ReportSchedulesResource = class {
1517
1582
  this.http = http;
1518
1583
  this.getWorkspaceId = getWorkspaceId;
1519
1584
  }
1585
+ http;
1586
+ getWorkspaceId;
1520
1587
  wsPath(suffix = "") {
1521
1588
  const id = this.getWorkspaceId();
1522
1589
  if (!id) throw new Error("workspaceId is required.");
@@ -1554,6 +1621,8 @@ var EmailTemplatesResource = class {
1554
1621
  this.http = http;
1555
1622
  this.getWorkspaceId = getWorkspaceId;
1556
1623
  }
1624
+ http;
1625
+ getWorkspaceId;
1557
1626
  wsPath(suffix = "") {
1558
1627
  const id = this.getWorkspaceId();
1559
1628
  if (!id) throw new Error("workspaceId is required.");
@@ -1586,6 +1655,7 @@ var HsCodesResource = class {
1586
1655
  constructor(http) {
1587
1656
  this.http = http;
1588
1657
  }
1658
+ http;
1589
1659
  /** Search for HS codes by product description. Requires Enterprise plan. */
1590
1660
  async search(query, options) {
1591
1661
  return this.http.get("/api/shipping/hs-codes/search", { query, ...options });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flexops/sdk",
3
- "version": "3.0.0",
3
+ "version": "3.2.0",
4
4
  "description": "Official FlexOps Platform Node.js/TypeScript SDK — multi-carrier shipping, order management, and logistics API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -57,7 +57,7 @@
57
57
  "@openapitools/openapi-generator-cli": "^2.16.3",
58
58
  "@types/node": "^26.1.2",
59
59
  "eslint": "^10.8.0",
60
- "tsup": "^8.4.0",
60
+ "tsup": "^9.0.0",
61
61
  "typescript": "^5.8.0",
62
62
  "typescript-eslint": "^8.65.0",
63
63
  "vitest": "^5.0.0"