@shipengine/js-api 0.43.0 → 0.44.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/account-settings/api.d.ts +17 -1
- package/account-settings/types.d.ts +16 -0
- package/index.js +49 -9
- package/index.mjs +49 -9
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AxiosInstance } from "axios";
|
|
2
|
-
import { AccountSettings } from "./types";
|
|
2
|
+
import { AccountImage, AccountImageResponse, AccountImagesResponse, AccountSettings, UpdateAccountImage } from "./types";
|
|
3
3
|
/**
|
|
4
4
|
* # Account Settings API module - /v1/account/settings
|
|
5
5
|
*/
|
|
@@ -16,4 +16,20 @@ export declare class AccountSettingsAPI {
|
|
|
16
16
|
* @params Partial<AccountSettings> The account settings to update.
|
|
17
17
|
*/
|
|
18
18
|
update: (settings: Partial<AccountSettings>) => Promise<import("axios").AxiosResponse<AccountSettings, any>>;
|
|
19
|
+
/**
|
|
20
|
+
* The `createImage` method creates an image that can be used in your printed labels.
|
|
21
|
+
*/
|
|
22
|
+
createImage: (data: AccountImage) => Promise<import("axios").AxiosResponse<AccountImageResponse, any>>;
|
|
23
|
+
/**
|
|
24
|
+
* The `updateImage` method updates specific image data for a given image id.
|
|
25
|
+
*/
|
|
26
|
+
updateImage: ({ labelImageId, ...data }: UpdateAccountImage) => Promise<import("axios").AxiosResponse<void, any>>;
|
|
27
|
+
/**
|
|
28
|
+
* The `getImages` method retrieves a list of images for a given user.
|
|
29
|
+
*/
|
|
30
|
+
getImages: () => Promise<import("axios").AxiosResponse<AccountImagesResponse, any>>;
|
|
31
|
+
/**
|
|
32
|
+
* The `deleteAccountImage` method deletes an image by id.
|
|
33
|
+
*/
|
|
34
|
+
deleteImage: (labelImageId: string) => Promise<import("axios").AxiosResponse<void, any>>;
|
|
19
35
|
}
|
|
@@ -1,8 +1,24 @@
|
|
|
1
1
|
import { DimensionUnit } from "../dimensions";
|
|
2
2
|
import { LabelLayout } from "../labels";
|
|
3
|
+
import { PageableResult } from "../resources";
|
|
3
4
|
import { WeightUnit } from "../weight";
|
|
4
5
|
export interface AccountSettings {
|
|
5
6
|
defaultLabelLayout: LabelLayout;
|
|
6
7
|
dimensionsUnit: DimensionUnit;
|
|
7
8
|
weightUnit: WeightUnit;
|
|
8
9
|
}
|
|
10
|
+
export type AccountImage = {
|
|
11
|
+
imageContentType: string;
|
|
12
|
+
imageData: string;
|
|
13
|
+
isDefault: boolean;
|
|
14
|
+
name: string;
|
|
15
|
+
};
|
|
16
|
+
export type AccountImageResponse = AccountImage & {
|
|
17
|
+
createdAt: string;
|
|
18
|
+
labelImageId: string;
|
|
19
|
+
modifiedAt: string;
|
|
20
|
+
};
|
|
21
|
+
export type AccountImagesResponse = {
|
|
22
|
+
images: AccountImageResponse[];
|
|
23
|
+
} & PageableResult;
|
|
24
|
+
export type UpdateAccountImage = Partial<Omit<AccountImageResponse, "isDefault" | "createdAt" | "modifiedAt">> & Pick<AccountImageResponse, "isDefault">;
|
package/index.js
CHANGED
|
@@ -10,17 +10,17 @@ var AccountBillingPlanChangeType = /* @__PURE__ */ ((AccountBillingPlanChangeTyp
|
|
|
10
10
|
return AccountBillingPlanChangeType2;
|
|
11
11
|
})(AccountBillingPlanChangeType || {});
|
|
12
12
|
|
|
13
|
-
var __getOwnPropSymbols$
|
|
14
|
-
var __hasOwnProp$
|
|
15
|
-
var __propIsEnum$
|
|
16
|
-
var __objRest$
|
|
13
|
+
var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
|
|
14
|
+
var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
|
|
15
|
+
var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
|
|
16
|
+
var __objRest$2 = (source, exclude) => {
|
|
17
17
|
var target = {};
|
|
18
18
|
for (var prop in source)
|
|
19
|
-
if (__hasOwnProp$
|
|
19
|
+
if (__hasOwnProp$4.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
20
20
|
target[prop] = source[prop];
|
|
21
|
-
if (source != null && __getOwnPropSymbols$
|
|
22
|
-
for (var prop of __getOwnPropSymbols$
|
|
23
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
21
|
+
if (source != null && __getOwnPropSymbols$4)
|
|
22
|
+
for (var prop of __getOwnPropSymbols$4(source)) {
|
|
23
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$4.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$
|
|
37
|
+
var _b = _a, { message } = _b, options = __objRest$2(_b, ["message"]);
|
|
38
38
|
return new CodedError(message, options);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
@@ -142,6 +142,21 @@ const types = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
|
|
|
142
142
|
RateCardStatus
|
|
143
143
|
}, Symbol.toStringTag, { value: 'Module' }));
|
|
144
144
|
|
|
145
|
+
var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
|
|
146
|
+
var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
|
|
147
|
+
var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
|
|
148
|
+
var __objRest$1 = (source, exclude) => {
|
|
149
|
+
var target = {};
|
|
150
|
+
for (var prop in source)
|
|
151
|
+
if (__hasOwnProp$3.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
152
|
+
target[prop] = source[prop];
|
|
153
|
+
if (source != null && __getOwnPropSymbols$3)
|
|
154
|
+
for (var prop of __getOwnPropSymbols$3(source)) {
|
|
155
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$3.call(source, prop))
|
|
156
|
+
target[prop] = source[prop];
|
|
157
|
+
}
|
|
158
|
+
return target;
|
|
159
|
+
};
|
|
145
160
|
class AccountSettingsAPI {
|
|
146
161
|
constructor(client) {
|
|
147
162
|
this.client = client;
|
|
@@ -159,6 +174,31 @@ class AccountSettingsAPI {
|
|
|
159
174
|
this.update = (settings) => {
|
|
160
175
|
return this.client.put("/v1/account/settings", settings);
|
|
161
176
|
};
|
|
177
|
+
/**
|
|
178
|
+
* The `createImage` method creates an image that can be used in your printed labels.
|
|
179
|
+
*/
|
|
180
|
+
this.createImage = (data) => {
|
|
181
|
+
return this.client.post("/v1/account/settings/images", data);
|
|
182
|
+
};
|
|
183
|
+
/**
|
|
184
|
+
* The `updateImage` method updates specific image data for a given image id.
|
|
185
|
+
*/
|
|
186
|
+
this.updateImage = (_a) => {
|
|
187
|
+
var _b = _a, { labelImageId } = _b, data = __objRest$1(_b, ["labelImageId"]);
|
|
188
|
+
return this.client.put(`/v1/account/settings/images/${labelImageId}`, data);
|
|
189
|
+
};
|
|
190
|
+
/**
|
|
191
|
+
* The `getImages` method retrieves a list of images for a given user.
|
|
192
|
+
*/
|
|
193
|
+
this.getImages = () => {
|
|
194
|
+
return this.client.get("/v1/account/settings/images");
|
|
195
|
+
};
|
|
196
|
+
/**
|
|
197
|
+
* The `deleteAccountImage` method deletes an image by id.
|
|
198
|
+
*/
|
|
199
|
+
this.deleteImage = (labelImageId) => {
|
|
200
|
+
return this.client.delete(`/v1/account/settings/images/${labelImageId}`);
|
|
201
|
+
};
|
|
162
202
|
this.client = client;
|
|
163
203
|
}
|
|
164
204
|
}
|
package/index.mjs
CHANGED
|
@@ -6,17 +6,17 @@ var AccountBillingPlanChangeType = /* @__PURE__ */ ((AccountBillingPlanChangeTyp
|
|
|
6
6
|
return AccountBillingPlanChangeType2;
|
|
7
7
|
})(AccountBillingPlanChangeType || {});
|
|
8
8
|
|
|
9
|
-
var __getOwnPropSymbols$
|
|
10
|
-
var __hasOwnProp$
|
|
11
|
-
var __propIsEnum$
|
|
12
|
-
var __objRest$
|
|
9
|
+
var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
|
|
10
|
+
var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
|
|
11
|
+
var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
|
|
12
|
+
var __objRest$2 = (source, exclude) => {
|
|
13
13
|
var target = {};
|
|
14
14
|
for (var prop in source)
|
|
15
|
-
if (__hasOwnProp$
|
|
15
|
+
if (__hasOwnProp$4.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
16
16
|
target[prop] = source[prop];
|
|
17
|
-
if (source != null && __getOwnPropSymbols$
|
|
18
|
-
for (var prop of __getOwnPropSymbols$
|
|
19
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
17
|
+
if (source != null && __getOwnPropSymbols$4)
|
|
18
|
+
for (var prop of __getOwnPropSymbols$4(source)) {
|
|
19
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$4.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$
|
|
33
|
+
var _b = _a, { message } = _b, options = __objRest$2(_b, ["message"]);
|
|
34
34
|
return new CodedError(message, options);
|
|
35
35
|
}
|
|
36
36
|
}
|
|
@@ -138,6 +138,21 @@ const types = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
|
|
|
138
138
|
RateCardStatus
|
|
139
139
|
}, Symbol.toStringTag, { value: 'Module' }));
|
|
140
140
|
|
|
141
|
+
var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
|
|
142
|
+
var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
|
|
143
|
+
var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
|
|
144
|
+
var __objRest$1 = (source, exclude) => {
|
|
145
|
+
var target = {};
|
|
146
|
+
for (var prop in source)
|
|
147
|
+
if (__hasOwnProp$3.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
148
|
+
target[prop] = source[prop];
|
|
149
|
+
if (source != null && __getOwnPropSymbols$3)
|
|
150
|
+
for (var prop of __getOwnPropSymbols$3(source)) {
|
|
151
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$3.call(source, prop))
|
|
152
|
+
target[prop] = source[prop];
|
|
153
|
+
}
|
|
154
|
+
return target;
|
|
155
|
+
};
|
|
141
156
|
class AccountSettingsAPI {
|
|
142
157
|
constructor(client) {
|
|
143
158
|
this.client = client;
|
|
@@ -155,6 +170,31 @@ class AccountSettingsAPI {
|
|
|
155
170
|
this.update = (settings) => {
|
|
156
171
|
return this.client.put("/v1/account/settings", settings);
|
|
157
172
|
};
|
|
173
|
+
/**
|
|
174
|
+
* The `createImage` method creates an image that can be used in your printed labels.
|
|
175
|
+
*/
|
|
176
|
+
this.createImage = (data) => {
|
|
177
|
+
return this.client.post("/v1/account/settings/images", data);
|
|
178
|
+
};
|
|
179
|
+
/**
|
|
180
|
+
* The `updateImage` method updates specific image data for a given image id.
|
|
181
|
+
*/
|
|
182
|
+
this.updateImage = (_a) => {
|
|
183
|
+
var _b = _a, { labelImageId } = _b, data = __objRest$1(_b, ["labelImageId"]);
|
|
184
|
+
return this.client.put(`/v1/account/settings/images/${labelImageId}`, data);
|
|
185
|
+
};
|
|
186
|
+
/**
|
|
187
|
+
* The `getImages` method retrieves a list of images for a given user.
|
|
188
|
+
*/
|
|
189
|
+
this.getImages = () => {
|
|
190
|
+
return this.client.get("/v1/account/settings/images");
|
|
191
|
+
};
|
|
192
|
+
/**
|
|
193
|
+
* The `deleteAccountImage` method deletes an image by id.
|
|
194
|
+
*/
|
|
195
|
+
this.deleteImage = (labelImageId) => {
|
|
196
|
+
return this.client.delete(`/v1/account/settings/images/${labelImageId}`);
|
|
197
|
+
};
|
|
158
198
|
this.client = client;
|
|
159
199
|
}
|
|
160
200
|
}
|