@shipengine/js-api 4.5.1 → 4.6.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.
@@ -1,5 +1,5 @@
1
1
  import { AxiosInstance } from "axios";
2
- import { CarrierServicesListResponse, ConnectCarrierAccount, ConnectCarrierAccountResponse, ConnectionsCarrierName, ConnectionsCarrierSettingsData, ConnectionsCarrierSettingsResponse, GetCarrierConnectionFormParams, GetCarrierConnectionFormResponse, ListCarrierConnectionsParams, ListCarrierConnectionsResponse } from "./types";
2
+ import { CarrierServicesListResponse, ConnectCarrierAccount, ConnectCarrierAccountResponse, ConnectionsCarrierName, ConnectionsCarrierSettingsData, ConnectionsCarrierSettingsResponse, GetCarrierConnectionFormParams, GetCarrierConnectionFormResponse, ListCarrierConnectionsParams, ListCarrierConnectionsResponse, RequestStampsAccountUrlParams, RequestStampsAccountUrlResponse } from "./types";
3
3
  /**
4
4
  * # Connections API module - /v1/connections
5
5
  */
@@ -34,4 +34,10 @@ export declare class ConnectionsAPI {
34
34
  * identified by the `carrierName` and `carrierId`.
35
35
  */
36
36
  updateCarrierSettings: <T extends ConnectionsCarrierName>(carrierName: T, carrierId: string, formData: ConnectionsCarrierSettingsData<T>) => Promise<import("axios").AxiosResponse<void, any>>;
37
+ /**
38
+ * The `requestStampsAccountUrls` method request the Web Client Home URL from Stamps for a given
39
+ * Stamps SE Carrier ID
40
+ * @docs https://auctane.atlassian.net/wiki/spaces/SEEU/pages/6228738069/ENGINE-9471+Endicia+web+client+communication
41
+ */
42
+ requestStampsAccountUrls: ({ carrierId, ...rest }: RequestStampsAccountUrlParams) => Promise<import("axios").AxiosResponse<RequestStampsAccountUrlResponse, any>>;
37
43
  }
@@ -16,14 +16,25 @@ export type CarrierMetadata = {
16
16
  name: string;
17
17
  searchTerms?: string[] | null;
18
18
  };
19
+ export type StampsAccountUrlTypes = "account_settings" | "report_balances" | "manifest_form" | "payment_methods" | "web_client_home";
19
20
  export type ListCarrierConnectionsParams = LocaleBasedQuery;
20
21
  export type GetCarrierConnectionFormParams = LocaleBasedQuery;
22
+ export type RequestStampsAccountUrlParams = {
23
+ carrierId: string;
24
+ urlTypes: StampsAccountUrlTypes[];
25
+ };
21
26
  export type ConnectCarrierAccount = {
22
27
  nickname: string;
23
28
  } & GenericObject;
24
29
  /**
25
30
  * @category Responses
26
31
  */
32
+ export type RequestStampsAccountUrlResponse = {
33
+ urls: Array<{
34
+ url: string;
35
+ urlType: string;
36
+ }>;
37
+ };
27
38
  export type GetCarrierConnectionFormResponse = {
28
39
  formMetadata: {
29
40
  connectionNames?: string[] | null;
package/index.js CHANGED
@@ -10,17 +10,17 @@ var AccountBillingPlanChangeType = /* @__PURE__ */ ((AccountBillingPlanChangeTyp
10
10
  return AccountBillingPlanChangeType2;
11
11
  })(AccountBillingPlanChangeType || {});
12
12
 
13
- var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
14
- var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
15
- var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
16
- var __objRest$4 = (source, exclude) => {
13
+ var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
14
+ var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
15
+ var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
16
+ var __objRest$5 = (source, exclude) => {
17
17
  var target = {};
18
18
  for (var prop in source)
19
- if (__hasOwnProp$7.call(source, prop) && exclude.indexOf(prop) < 0)
19
+ if (__hasOwnProp$8.call(source, prop) && exclude.indexOf(prop) < 0)
20
20
  target[prop] = source[prop];
21
- if (source != null && __getOwnPropSymbols$7)
22
- for (var prop of __getOwnPropSymbols$7(source)) {
23
- if (exclude.indexOf(prop) < 0 && __propIsEnum$7.call(source, prop))
21
+ if (source != null && __getOwnPropSymbols$8)
22
+ for (var prop of __getOwnPropSymbols$8(source)) {
23
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$8.call(source, prop))
24
24
  target[prop] = source[prop];
25
25
  }
26
26
  return target;
@@ -34,7 +34,7 @@ class CodedError {
34
34
  this.message = message;
35
35
  }
36
36
  static fromObject(_a) {
37
- var _b = _a, { message } = _b, options = __objRest$4(_b, ["message"]);
37
+ var _b = _a, { message } = _b, options = __objRest$5(_b, ["message"]);
38
38
  return new CodedError(message, options);
39
39
  }
40
40
  }
@@ -155,17 +155,17 @@ const types = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
155
155
  RateCardStatus
156
156
  }, Symbol.toStringTag, { value: 'Module' }));
157
157
 
158
- var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
159
- var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
160
- var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
161
- var __objRest$3 = (source, exclude) => {
158
+ var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
159
+ var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
160
+ var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
161
+ var __objRest$4 = (source, exclude) => {
162
162
  var target = {};
163
163
  for (var prop in source)
164
- if (__hasOwnProp$6.call(source, prop) && exclude.indexOf(prop) < 0)
164
+ if (__hasOwnProp$7.call(source, prop) && exclude.indexOf(prop) < 0)
165
165
  target[prop] = source[prop];
166
- if (source != null && __getOwnPropSymbols$6)
167
- for (var prop of __getOwnPropSymbols$6(source)) {
168
- if (exclude.indexOf(prop) < 0 && __propIsEnum$6.call(source, prop))
166
+ if (source != null && __getOwnPropSymbols$7)
167
+ for (var prop of __getOwnPropSymbols$7(source)) {
168
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$7.call(source, prop))
169
169
  target[prop] = source[prop];
170
170
  }
171
171
  return target;
@@ -197,7 +197,7 @@ class AccountSettingsAPI {
197
197
  * The `updateImage` method updates specific image data for a given image id.
198
198
  */
199
199
  this.updateImage = (_a) => {
200
- var _b = _a, { labelImageId } = _b, data = __objRest$3(_b, ["labelImageId"]);
200
+ var _b = _a, { labelImageId } = _b, data = __objRest$4(_b, ["labelImageId"]);
201
201
  return this.client.put(`/v1/account/settings/images/${labelImageId}`, data);
202
202
  };
203
203
  /**
@@ -1123,30 +1123,30 @@ const decamelizeKeys = (obj, separator = "_") => {
1123
1123
  var __defProp$4 = Object.defineProperty;
1124
1124
  var __defProps$1 = Object.defineProperties;
1125
1125
  var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
1126
- var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
1127
- var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
1128
- var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
1126
+ var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
1127
+ var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
1128
+ var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
1129
1129
  var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1130
1130
  var __spreadValues$4 = (a, b) => {
1131
1131
  for (var prop in b || (b = {}))
1132
- if (__hasOwnProp$5.call(b, prop))
1132
+ if (__hasOwnProp$6.call(b, prop))
1133
1133
  __defNormalProp$4(a, prop, b[prop]);
1134
- if (__getOwnPropSymbols$5)
1135
- for (var prop of __getOwnPropSymbols$5(b)) {
1136
- if (__propIsEnum$5.call(b, prop))
1134
+ if (__getOwnPropSymbols$6)
1135
+ for (var prop of __getOwnPropSymbols$6(b)) {
1136
+ if (__propIsEnum$6.call(b, prop))
1137
1137
  __defNormalProp$4(a, prop, b[prop]);
1138
1138
  }
1139
1139
  return a;
1140
1140
  };
1141
1141
  var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
1142
- var __objRest$2 = (source, exclude) => {
1142
+ var __objRest$3 = (source, exclude) => {
1143
1143
  var target = {};
1144
1144
  for (var prop in source)
1145
- if (__hasOwnProp$5.call(source, prop) && exclude.indexOf(prop) < 0)
1145
+ if (__hasOwnProp$6.call(source, prop) && exclude.indexOf(prop) < 0)
1146
1146
  target[prop] = source[prop];
1147
- if (source != null && __getOwnPropSymbols$5)
1148
- for (var prop of __getOwnPropSymbols$5(source)) {
1149
- if (exclude.indexOf(prop) < 0 && __propIsEnum$5.call(source, prop))
1147
+ if (source != null && __getOwnPropSymbols$6)
1148
+ for (var prop of __getOwnPropSymbols$6(source)) {
1149
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$6.call(source, prop))
1150
1150
  target[prop] = source[prop];
1151
1151
  }
1152
1152
  return target;
@@ -1192,7 +1192,7 @@ class CarriersAPI {
1192
1192
  * The `connect` method connects a carrier account to a user's ShipEngine account.
1193
1193
  */
1194
1194
  this.connect = (_a) => __async$6(this, null, function* () {
1195
- var _b = _a, { carrierCode } = _b, connection = __objRest$2(_b, ["carrierCode"]);
1195
+ var _b = _a, { carrierCode } = _b, connection = __objRest$3(_b, ["carrierCode"]);
1196
1196
  const endUserIpAddress = yield getEndUserIpAddress();
1197
1197
  if (!endUserIpAddress)
1198
1198
  return Promise.reject([new CodedError("Unable to get IP address")]);
@@ -1282,6 +1282,21 @@ class CarriersAPI {
1282
1282
  }
1283
1283
  }
1284
1284
 
1285
+ var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
1286
+ var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
1287
+ var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
1288
+ var __objRest$2 = (source, exclude) => {
1289
+ var target = {};
1290
+ for (var prop in source)
1291
+ if (__hasOwnProp$5.call(source, prop) && exclude.indexOf(prop) < 0)
1292
+ target[prop] = source[prop];
1293
+ if (source != null && __getOwnPropSymbols$5)
1294
+ for (var prop of __getOwnPropSymbols$5(source)) {
1295
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$5.call(source, prop))
1296
+ target[prop] = source[prop];
1297
+ }
1298
+ return target;
1299
+ };
1285
1300
  var __async$5 = (__this, __arguments, generator) => {
1286
1301
  return new Promise((resolve, reject) => {
1287
1302
  var fulfilled = (value) => {
@@ -1366,6 +1381,18 @@ class ConnectionsAPI {
1366
1381
  formData
1367
1382
  );
1368
1383
  };
1384
+ /**
1385
+ * The `requestStampsAccountUrls` method request the Web Client Home URL from Stamps for a given
1386
+ * Stamps SE Carrier ID
1387
+ * @docs https://auctane.atlassian.net/wiki/spaces/SEEU/pages/6228738069/ENGINE-9471+Endicia+web+client+communication
1388
+ */
1389
+ this.requestStampsAccountUrls = (_a) => {
1390
+ var _b = _a, { carrierId } = _b, rest = __objRest$2(_b, ["carrierId"]);
1391
+ return this.client.put(
1392
+ `v1/connections/carriers/stamps_com/${carrierId}/request_account_url`,
1393
+ rest
1394
+ );
1395
+ };
1369
1396
  this.client = client;
1370
1397
  }
1371
1398
  }
package/index.mjs CHANGED
@@ -6,17 +6,17 @@ var AccountBillingPlanChangeType = /* @__PURE__ */ ((AccountBillingPlanChangeTyp
6
6
  return AccountBillingPlanChangeType2;
7
7
  })(AccountBillingPlanChangeType || {});
8
8
 
9
- var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
10
- var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
11
- var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
12
- var __objRest$4 = (source, exclude) => {
9
+ var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
10
+ var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
11
+ var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
12
+ var __objRest$5 = (source, exclude) => {
13
13
  var target = {};
14
14
  for (var prop in source)
15
- if (__hasOwnProp$7.call(source, prop) && exclude.indexOf(prop) < 0)
15
+ if (__hasOwnProp$8.call(source, prop) && exclude.indexOf(prop) < 0)
16
16
  target[prop] = source[prop];
17
- if (source != null && __getOwnPropSymbols$7)
18
- for (var prop of __getOwnPropSymbols$7(source)) {
19
- if (exclude.indexOf(prop) < 0 && __propIsEnum$7.call(source, prop))
17
+ if (source != null && __getOwnPropSymbols$8)
18
+ for (var prop of __getOwnPropSymbols$8(source)) {
19
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$8.call(source, prop))
20
20
  target[prop] = source[prop];
21
21
  }
22
22
  return target;
@@ -30,7 +30,7 @@ class CodedError {
30
30
  this.message = message;
31
31
  }
32
32
  static fromObject(_a) {
33
- var _b = _a, { message } = _b, options = __objRest$4(_b, ["message"]);
33
+ var _b = _a, { message } = _b, options = __objRest$5(_b, ["message"]);
34
34
  return new CodedError(message, options);
35
35
  }
36
36
  }
@@ -151,17 +151,17 @@ const types = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
151
151
  RateCardStatus
152
152
  }, Symbol.toStringTag, { value: 'Module' }));
153
153
 
154
- var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
155
- var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
156
- var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
157
- var __objRest$3 = (source, exclude) => {
154
+ var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
155
+ var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
156
+ var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
157
+ var __objRest$4 = (source, exclude) => {
158
158
  var target = {};
159
159
  for (var prop in source)
160
- if (__hasOwnProp$6.call(source, prop) && exclude.indexOf(prop) < 0)
160
+ if (__hasOwnProp$7.call(source, prop) && exclude.indexOf(prop) < 0)
161
161
  target[prop] = source[prop];
162
- if (source != null && __getOwnPropSymbols$6)
163
- for (var prop of __getOwnPropSymbols$6(source)) {
164
- if (exclude.indexOf(prop) < 0 && __propIsEnum$6.call(source, prop))
162
+ if (source != null && __getOwnPropSymbols$7)
163
+ for (var prop of __getOwnPropSymbols$7(source)) {
164
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$7.call(source, prop))
165
165
  target[prop] = source[prop];
166
166
  }
167
167
  return target;
@@ -193,7 +193,7 @@ class AccountSettingsAPI {
193
193
  * The `updateImage` method updates specific image data for a given image id.
194
194
  */
195
195
  this.updateImage = (_a) => {
196
- var _b = _a, { labelImageId } = _b, data = __objRest$3(_b, ["labelImageId"]);
196
+ var _b = _a, { labelImageId } = _b, data = __objRest$4(_b, ["labelImageId"]);
197
197
  return this.client.put(`/v1/account/settings/images/${labelImageId}`, data);
198
198
  };
199
199
  /**
@@ -1119,30 +1119,30 @@ const decamelizeKeys = (obj, separator = "_") => {
1119
1119
  var __defProp$4 = Object.defineProperty;
1120
1120
  var __defProps$1 = Object.defineProperties;
1121
1121
  var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
1122
- var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
1123
- var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
1124
- var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
1122
+ var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
1123
+ var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
1124
+ var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
1125
1125
  var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1126
1126
  var __spreadValues$4 = (a, b) => {
1127
1127
  for (var prop in b || (b = {}))
1128
- if (__hasOwnProp$5.call(b, prop))
1128
+ if (__hasOwnProp$6.call(b, prop))
1129
1129
  __defNormalProp$4(a, prop, b[prop]);
1130
- if (__getOwnPropSymbols$5)
1131
- for (var prop of __getOwnPropSymbols$5(b)) {
1132
- if (__propIsEnum$5.call(b, prop))
1130
+ if (__getOwnPropSymbols$6)
1131
+ for (var prop of __getOwnPropSymbols$6(b)) {
1132
+ if (__propIsEnum$6.call(b, prop))
1133
1133
  __defNormalProp$4(a, prop, b[prop]);
1134
1134
  }
1135
1135
  return a;
1136
1136
  };
1137
1137
  var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
1138
- var __objRest$2 = (source, exclude) => {
1138
+ var __objRest$3 = (source, exclude) => {
1139
1139
  var target = {};
1140
1140
  for (var prop in source)
1141
- if (__hasOwnProp$5.call(source, prop) && exclude.indexOf(prop) < 0)
1141
+ if (__hasOwnProp$6.call(source, prop) && exclude.indexOf(prop) < 0)
1142
1142
  target[prop] = source[prop];
1143
- if (source != null && __getOwnPropSymbols$5)
1144
- for (var prop of __getOwnPropSymbols$5(source)) {
1145
- if (exclude.indexOf(prop) < 0 && __propIsEnum$5.call(source, prop))
1143
+ if (source != null && __getOwnPropSymbols$6)
1144
+ for (var prop of __getOwnPropSymbols$6(source)) {
1145
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$6.call(source, prop))
1146
1146
  target[prop] = source[prop];
1147
1147
  }
1148
1148
  return target;
@@ -1188,7 +1188,7 @@ class CarriersAPI {
1188
1188
  * The `connect` method connects a carrier account to a user's ShipEngine account.
1189
1189
  */
1190
1190
  this.connect = (_a) => __async$6(this, null, function* () {
1191
- var _b = _a, { carrierCode } = _b, connection = __objRest$2(_b, ["carrierCode"]);
1191
+ var _b = _a, { carrierCode } = _b, connection = __objRest$3(_b, ["carrierCode"]);
1192
1192
  const endUserIpAddress = yield getEndUserIpAddress();
1193
1193
  if (!endUserIpAddress)
1194
1194
  return Promise.reject([new CodedError("Unable to get IP address")]);
@@ -1278,6 +1278,21 @@ class CarriersAPI {
1278
1278
  }
1279
1279
  }
1280
1280
 
1281
+ var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
1282
+ var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
1283
+ var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
1284
+ var __objRest$2 = (source, exclude) => {
1285
+ var target = {};
1286
+ for (var prop in source)
1287
+ if (__hasOwnProp$5.call(source, prop) && exclude.indexOf(prop) < 0)
1288
+ target[prop] = source[prop];
1289
+ if (source != null && __getOwnPropSymbols$5)
1290
+ for (var prop of __getOwnPropSymbols$5(source)) {
1291
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$5.call(source, prop))
1292
+ target[prop] = source[prop];
1293
+ }
1294
+ return target;
1295
+ };
1281
1296
  var __async$5 = (__this, __arguments, generator) => {
1282
1297
  return new Promise((resolve, reject) => {
1283
1298
  var fulfilled = (value) => {
@@ -1362,6 +1377,18 @@ class ConnectionsAPI {
1362
1377
  formData
1363
1378
  );
1364
1379
  };
1380
+ /**
1381
+ * The `requestStampsAccountUrls` method request the Web Client Home URL from Stamps for a given
1382
+ * Stamps SE Carrier ID
1383
+ * @docs https://auctane.atlassian.net/wiki/spaces/SEEU/pages/6228738069/ENGINE-9471+Endicia+web+client+communication
1384
+ */
1385
+ this.requestStampsAccountUrls = (_a) => {
1386
+ var _b = _a, { carrierId } = _b, rest = __objRest$2(_b, ["carrierId"]);
1387
+ return this.client.put(
1388
+ `v1/connections/carriers/stamps_com/${carrierId}/request_account_url`,
1389
+ rest
1390
+ );
1391
+ };
1365
1392
  this.client = client;
1366
1393
  }
1367
1394
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipengine/js-api",
3
- "version": "4.5.1",
3
+ "version": "4.6.0",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {