Skip to content

Commit 6c0e642

Browse files
committed
Merge branch 'release/1.1.0'
2 parents 5a1560f + 9293e45 commit 6c0e642

File tree

7 files changed

+24
-6
lines changed

7 files changed

+24
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "channelape-sdk",
3-
"version": "1.0.3",
3+
"version": "1.1.0",
44
"description": "A client for interacting with ChannelApe's API",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

src/ChannelApeClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export default class ChannelApeClient {
3434
this.maximumRequestRetryTimeout =
3535
(clientConfiguration.maximumRequestRetryTimeout == null ||
3636
clientConfiguration.maximumRequestRetryTimeout < TWO_SECONDS_IN_MS)
37-
? THREE_MINUTES_IN_MS : clientConfiguration.maximumRequestRetryTimeout;
37+
? THREE_MINUTES_IN_MS : clientConfiguration.maximumRequestRetryTimeout;
3838
this.logLevel = (clientConfiguration.logLevel == null) ? LogLevel.OFF : clientConfiguration.logLevel;
3939

4040
const client = request.defaults({

src/model/ChannelApeError.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ export default class ChannelApeError extends Error {
66
private readonly responseStatusCode: number;
77
private readonly responseStatusMessage: string;
88

9-
109
constructor(
1110
message: string,
1211
response: Response | undefined,

src/orders/model/Fulfillment.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ export default interface Fulfillment {
1111
shippingCompany?: string;
1212
shippingMethod?: string;
1313
trackingNumber?: string;
14+
trackingUrls?: string[];
1415
}

test/orders/resources/singleClosedOrderWithFulfillments.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,8 @@ export default {
513513
vendor: 'Black Rifle Coffee Company'
514514
}
515515
],
516-
status: 'OPEN'
516+
status: 'OPEN',
517+
trackingUrls: ['https://ups1.com/tracking-url1', 'https://ups1.com/tracking-url2']
517518
}
518519
],
519520
id: '9dc34b92-70d1-42d8-8b4e-ae7fb3deca70',

test/orders/resources/singleOrderWithOneLineItemAndOneFulfillment.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,8 @@ export default {
542542
vendor: 'Black Rifle Coffee Company'
543543
}
544544
],
545-
status: 'OPEN'
545+
status: 'OPEN',
546+
trackingUrls: ['https://ups1.com/tracking-url1', 'https://ups1.com/tracking-url2']
546547
}],
547548
id: '06b70c49-a13e-42ca-a490-404d29c7fa46',
548549
lineItems: [{

test/orders/service/OrdersService.spec.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,17 @@ describe('OrdersService', () => {
119119
return ordersService.get(orderId).then((actualOrder) => {
120120
expect(actualOrder.lineItems.length).to.equal(1);
121121
if (typeof actualOrder.fulfillments === 'undefined') {
122-
throw new Error('fulfillments length should be 0');
122+
throw new Error('fulfillments length should be 1');
123123
}
124124
expect(actualOrder.fulfillments.length).to.equal(1);
125+
126+
const fulfillment1 = actualOrder.fulfillments[0];
127+
if (typeof fulfillment1.trackingUrls === 'undefined') {
128+
throw new Error('tracking urls for fulfillment 1 length should be 1');
129+
}
130+
expect(fulfillment1.trackingUrls.length).to.equal(2);
131+
expect(fulfillment1.trackingUrls).to.contain('https://ups1.com/tracking-url1');
132+
expect(fulfillment1.trackingUrls).to.contain('https://ups1.com/tracking-url2');
125133
expect(clientGetStub.args[0][0]).to.equal(`/${Version.V1}${Resource.ORDERS}/${orderId}`);
126134
});
127135
});
@@ -143,6 +151,14 @@ describe('OrdersService', () => {
143151
expect(actualOrder.fulfillments.length).to.equal(1);
144152
expect(actualOrder.fulfillments[0].lineItems.length).to.equal(6);
145153
expect(actualOrder.fulfillments[0].lineItems[0].price).to.equal(15.91);
154+
155+
const fulfillment1 = actualOrder.fulfillments[0];
156+
if (typeof fulfillment1.trackingUrls === 'undefined') {
157+
throw new Error('tracking urls for fulfillment 1 length should be 1');
158+
}
159+
expect(fulfillment1.trackingUrls.length).to.equal(2);
160+
expect(fulfillment1.trackingUrls).to.contain('https://ups1.com/tracking-url1');
161+
expect(fulfillment1.trackingUrls).to.contain('https://ups1.com/tracking-url2');
146162
expect(clientGetStub.args[0][0]).to.equal(`/${Version.V1}${Resource.ORDERS}/${orderId}`);
147163
});
148164
});

0 commit comments

Comments
 (0)