@shipengine/connect-carrier-api 2.6.4 → 2.8.1
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/lib/app/carrier-app-definition.d.ts +12 -2
- package/lib/app/carrier-app.js +10 -0
- package/lib/app/carrier-app.js.map +1 -1
- package/lib/app/constants.d.ts +3 -1
- package/lib/app/constants.js +2 -0
- package/lib/app/constants.js.map +1 -1
- package/lib/app/metadata/carrier-app-metadata.js +1 -3
- package/lib/app/metadata/carrier-app-metadata.js.map +1 -1
- package/lib/app/metadata/carrier.js +1 -3
- package/lib/app/metadata/carrier.js.map +1 -1
- package/lib/app/metadata/package-type.js +1 -3
- package/lib/app/metadata/package-type.js.map +1 -1
- package/lib/app/metadata/service-point-feature.d.ts +9 -0
- package/lib/app/metadata/service-point-feature.js +15 -0
- package/lib/app/metadata/service-point-feature.js.map +1 -0
- package/lib/app/metadata/shipping-service.js +1 -3
- package/lib/app/metadata/shipping-service.js.map +1 -1
- package/lib/models/addresses/service-point-address.d.ts +7 -0
- package/lib/models/addresses/service-point-address.js +9 -0
- package/lib/models/addresses/service-point-address.js.map +1 -0
- package/lib/models/billing/billing-line-item.d.ts +3 -1
- package/lib/models/billing/billing-line-item.js +1 -0
- package/lib/models/billing/billing-line-item.js.map +1 -1
- package/lib/models/service-points/hours-of-operation.d.ts +9 -0
- package/lib/models/service-points/hours-of-operation.js +14 -0
- package/lib/models/service-points/hours-of-operation.js.map +1 -0
- package/lib/models/service-points/index.d.ts +3 -0
- package/lib/models/service-points/index.js +7 -0
- package/lib/models/service-points/index.js.map +1 -0
- package/lib/models/service-points/search-radius-unit.d.ts +5 -0
- package/lib/models/service-points/search-radius-unit.js +10 -0
- package/lib/models/service-points/search-radius-unit.js.map +1 -0
- package/lib/models/service-points/search-radius.d.ts +12 -0
- package/lib/models/service-points/search-radius.js +8 -0
- package/lib/models/service-points/search-radius.js.map +1 -0
- package/lib/models/service-points/service-point-response-address.d.ts +8 -0
- package/lib/models/service-points/service-point-response-address.js +23 -0
- package/lib/models/service-points/service-point-response-address.js.map +1 -0
- package/lib/models/service-points/service-point.d.ts +16 -0
- package/lib/models/service-points/service-point.js +19 -0
- package/lib/models/service-points/service-point.js.map +1 -0
- package/lib/models/service-points/weekly-hours-of-operation.d.ts +13 -0
- package/lib/models/service-points/weekly-hours-of-operation.js +20 -0
- package/lib/models/service-points/weekly-hours-of-operation.js.map +1 -0
- package/lib/requests/get-service-point-request.d.ts +8 -0
- package/lib/requests/get-service-point-request.js +9 -0
- package/lib/requests/get-service-point-request.js.map +1 -0
- package/lib/requests/get-service-points-request.d.ts +14 -0
- package/lib/requests/get-service-points-request.js +9 -0
- package/lib/requests/get-service-points-request.js.map +1 -0
- package/lib/requests/index.d.ts +2 -0
- package/lib/requests/index.js +2 -0
- package/lib/requests/index.js.map +1 -1
- package/lib/responses/get-service-point-response.d.ts +8 -0
- package/lib/responses/get-service-point-response.js +13 -0
- package/lib/responses/get-service-point-response.js.map +1 -0
- package/lib/responses/get-service-points-response.d.ts +9 -0
- package/lib/responses/get-service-points-response.js +15 -0
- package/lib/responses/get-service-points-response.js.map +1 -0
- package/lib/responses/index.d.ts +2 -0
- package/lib/responses/index.js +2 -0
- package/lib/responses/index.js.map +1 -1
- package/package.json +1 -1
- package/src/app/carrier-app-definition.ts +18 -0
- package/src/app/carrier-app.ts +14 -0
- package/src/app/constants.ts +2 -0
- package/src/app/metadata/carrier-app-metadata.ts +1 -3
- package/src/app/metadata/carrier.ts +1 -3
- package/src/app/metadata/package-type.ts +1 -3
- package/src/app/metadata/service-point-feature.ts +13 -0
- package/src/app/metadata/shipping-service.ts +1 -3
- package/src/models/addresses/service-point-address.ts +8 -0
- package/src/models/billing/billing-line-item.ts +4 -1
- package/src/models/service-points/hours-of-operation.ts +14 -0
- package/src/models/service-points/index.ts +3 -0
- package/src/models/service-points/search-radius-unit.ts +5 -0
- package/src/models/service-points/search-radius.ts +13 -0
- package/src/models/service-points/service-point-response-address.ts +21 -0
- package/src/models/service-points/service-point.ts +29 -0
- package/src/models/service-points/weekly-hours-of-operation.ts +23 -0
- package/src/requests/get-service-point-request.ts +9 -0
- package/src/requests/get-service-points-request.ts +15 -0
- package/src/requests/index.ts +2 -0
- package/src/responses/get-service-point-response.ts +12 -0
- package/src/responses/get-service-points-response.ts +13 -0
- package/src/responses/index.ts +2 -0
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetServicePointsResponseSchema = exports.GetServicePointsResponse = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const base_response_1 = require("./base-response");
|
|
6
|
+
const joi_1 = tslib_1.__importDefault(require("joi"));
|
|
7
|
+
const service_points_1 = require("../models/service-points");
|
|
8
|
+
/** @description Basic structure for a response to get service points */
|
|
9
|
+
class GetServicePointsResponse extends base_response_1.BaseResponse {
|
|
10
|
+
}
|
|
11
|
+
exports.GetServicePointsResponse = GetServicePointsResponse;
|
|
12
|
+
exports.GetServicePointsResponseSchema = base_response_1.BaseResponseSchema.keys({
|
|
13
|
+
service_points: joi_1.default.array().required().items(service_points_1.ServicePointSchema),
|
|
14
|
+
});
|
|
15
|
+
//# sourceMappingURL=get-service-points-response.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-service-points-response.js","sourceRoot":"","sources":["../../src/responses/get-service-points-response.ts"],"names":[],"mappings":";;;;AAAA,mDAAmE;AACnE,sDAAsB;AACtB,6DAA4E;AAE5E,wEAAwE;AACxE,MAAa,wBAAyB,SAAQ,4BAAY;CAGzD;AAHD,4DAGC;AAEY,QAAA,8BAA8B,GAAG,kCAAkB,CAAC,IAAI,CAAC;IACpE,cAAc,EAAE,aAAG,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,mCAAkB,CAAC;CACjE,CAAC,CAAC"}
|
package/lib/responses/index.d.ts
CHANGED
|
@@ -12,3 +12,5 @@ export * from './create-notification-response';
|
|
|
12
12
|
export * from './validate-inbound-data-response';
|
|
13
13
|
export * from './normalize-tracking-data-response';
|
|
14
14
|
export * from './get-relay-points-response';
|
|
15
|
+
export * from './get-service-points-response';
|
|
16
|
+
export * from './get-service-point-response';
|
package/lib/responses/index.js
CHANGED
|
@@ -15,4 +15,6 @@ tslib_1.__exportStar(require("./create-notification-response"), exports);
|
|
|
15
15
|
tslib_1.__exportStar(require("./validate-inbound-data-response"), exports);
|
|
16
16
|
tslib_1.__exportStar(require("./normalize-tracking-data-response"), exports);
|
|
17
17
|
tslib_1.__exportStar(require("./get-relay-points-response"), exports);
|
|
18
|
+
tslib_1.__exportStar(require("./get-service-points-response"), exports);
|
|
19
|
+
tslib_1.__exportStar(require("./get-service-point-response"), exports);
|
|
18
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/responses/index.ts"],"names":[],"mappings":";;;AAAA,mEAAyC;AACzC,kEAAwC;AACxC,qEAA2C;AAC3C,+DAAqC;AACrC,8DAAoC;AACpC,qEAA2C;AAC3C,8DAAoC;AACpC,iEAAuC;AACvC,2DAAiC;AACjC,yEAA+C;AAC/C,yEAA+C;AAC/C,2EAAiD;AACjD,6EAAmD;AACnD,sEAA4C"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/responses/index.ts"],"names":[],"mappings":";;;AAAA,mEAAyC;AACzC,kEAAwC;AACxC,qEAA2C;AAC3C,+DAAqC;AACrC,8DAAoC;AACpC,qEAA2C;AAC3C,8DAAoC;AACpC,iEAAuC;AACvC,2DAAiC;AACjC,yEAA+C;AAC/C,yEAA+C;AAC/C,2EAAiD;AACjD,6EAAmD;AACnD,sEAA4C;AAC5C,wEAA8C;AAC9C,uEAA6C"}
|
package/package.json
CHANGED
|
@@ -13,6 +13,8 @@ import {
|
|
|
13
13
|
ValidateInboundDataRequest,
|
|
14
14
|
NormalizeTrackingDataRequest,
|
|
15
15
|
GetRelayPointsRequest,
|
|
16
|
+
GetServicePointsRequest,
|
|
17
|
+
GetServicePointRequest,
|
|
16
18
|
} from '../requests';
|
|
17
19
|
|
|
18
20
|
import {
|
|
@@ -29,6 +31,8 @@ import {
|
|
|
29
31
|
ValidateInboundDataResponse,
|
|
30
32
|
NormalizeTrackingDataResponse,
|
|
31
33
|
GetRelayPointsResponse,
|
|
34
|
+
GetServicePointsResponse,
|
|
35
|
+
GetServicePointResponse,
|
|
32
36
|
} from '../responses';
|
|
33
37
|
|
|
34
38
|
import { CarrierAppMetadata } from './metadata/carrier-app-metadata';
|
|
@@ -126,4 +130,18 @@ export interface CarrierAppDefinition {
|
|
|
126
130
|
GetRelayPoints?: (
|
|
127
131
|
request: GetRelayPointsRequest,
|
|
128
132
|
) => GetRelayPointsResponse | Promise<GetRelayPointsResponse>;
|
|
133
|
+
/**
|
|
134
|
+
* @description This endpoint is used to get carrier service points
|
|
135
|
+
* @param request Data needed by the provider about the service points to be returned
|
|
136
|
+
*/
|
|
137
|
+
GetServicePoints?: (
|
|
138
|
+
request: GetServicePointsRequest,
|
|
139
|
+
) => GetServicePointsResponse | Promise<GetServicePointsResponse>;
|
|
140
|
+
/**
|
|
141
|
+
* @description This endpoint is used to get a carrier service point by id
|
|
142
|
+
* @param request Data needed by the provider about the service point to be returned
|
|
143
|
+
*/
|
|
144
|
+
GetServicePoint?: (
|
|
145
|
+
request: GetServicePointRequest,
|
|
146
|
+
) => GetServicePointResponse | Promise<GetServicePointResponse>;
|
|
129
147
|
}
|
package/src/app/carrier-app.ts
CHANGED
|
@@ -20,6 +20,8 @@ import {
|
|
|
20
20
|
ValidateInboundDataResponseSchema,
|
|
21
21
|
NormalizeTrackingDataResponseSchema,
|
|
22
22
|
GetRelayPointsResponseSchema,
|
|
23
|
+
GetServicePointsResponseSchema,
|
|
24
|
+
GetServicePointResponseSchema,
|
|
23
25
|
} from '../responses';
|
|
24
26
|
import { Schema } from 'joi';
|
|
25
27
|
|
|
@@ -113,6 +115,18 @@ export class CarrierApp implements ConnectRuntimeApp {
|
|
|
113
115
|
definition.GetRelayPoints,
|
|
114
116
|
GetRelayPointsResponseSchema,
|
|
115
117
|
],
|
|
118
|
+
[
|
|
119
|
+
Method.POST,
|
|
120
|
+
ApiEndpoints.GetServicePoints,
|
|
121
|
+
definition.GetServicePoints,
|
|
122
|
+
GetServicePointsResponseSchema,
|
|
123
|
+
],
|
|
124
|
+
[
|
|
125
|
+
Method.POST,
|
|
126
|
+
ApiEndpoints.GetServicePoint,
|
|
127
|
+
definition.GetServicePoint,
|
|
128
|
+
GetServicePointResponseSchema,
|
|
129
|
+
],
|
|
116
130
|
).forEach(([method, path, implementation, schema]) => {
|
|
117
131
|
if (implementation) {
|
|
118
132
|
this.routes.push({
|
package/src/app/constants.ts
CHANGED
|
@@ -13,9 +13,7 @@ export interface CarrierAppMetadata {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
export const CarrierAppMetadataSchema = Joi.object({
|
|
16
|
-
Id: Joi.string()
|
|
17
|
-
.uuid({ version: ['uuidv4'] })
|
|
18
|
-
.required(),
|
|
16
|
+
Id: Joi.string().uuid().required(),
|
|
19
17
|
Name: Joi.string().required(),
|
|
20
18
|
AuthProcess: AuthSpecificationSchema.optional(),
|
|
21
19
|
Carriers: Joi.array()
|
|
@@ -93,9 +93,7 @@ export const CarrierSchema = Joi.object({
|
|
|
93
93
|
ApiCode: Joi.string()
|
|
94
94
|
.optional()
|
|
95
95
|
.pattern(/^[a-z][a-z0-9_]*[a-z]$/, 'ApiCode'),
|
|
96
|
-
Id: Joi.string()
|
|
97
|
-
.uuid({ version: ['uuidv4'] })
|
|
98
|
-
.required(),
|
|
96
|
+
Id: Joi.string().uuid().required(),
|
|
99
97
|
Images: Joi.object({
|
|
100
98
|
Icon: Joi.string()
|
|
101
99
|
.required()
|
|
@@ -32,9 +32,7 @@ export enum PackageAttribute {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
export const PackageTypeSchema = Joi.object({
|
|
35
|
-
Id: Joi.string()
|
|
36
|
-
.uuid({ version: ['uuidv4'] })
|
|
37
|
-
.required(),
|
|
35
|
+
Id: Joi.string().uuid().required(),
|
|
38
36
|
Name: Joi.string().required().max(50),
|
|
39
37
|
ApiCode: Joi.string()
|
|
40
38
|
.optional()
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import Joi from 'joi';
|
|
2
|
+
|
|
3
|
+
export enum ServicePointFeaturesEnum {
|
|
4
|
+
DropOffPoint = 'DropOffPoint',
|
|
5
|
+
PickupPoint = 'PickupPoint',
|
|
6
|
+
PrintServices = 'PrintServices',
|
|
7
|
+
AfterHoursLocker = 'AfterHoursLocker',
|
|
8
|
+
AfterHoursDropbox = 'AfterHoursDropbox',
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const ServicePointFeaturesEnumSchema = Joi.string().valid(
|
|
12
|
+
...Object.values(ServicePointFeaturesEnum),
|
|
13
|
+
);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { LatLong } from '../tracking/lat-long';
|
|
2
|
+
import { AddressBase } from './address-base';
|
|
3
|
+
|
|
4
|
+
/** @description The basic address type related to service points */
|
|
5
|
+
export class ServicePointAddress extends AddressBase {
|
|
6
|
+
/** @description Geographical location */
|
|
7
|
+
geo?: LatLong;
|
|
8
|
+
}
|
|
@@ -12,8 +12,10 @@ export class BillingLineItem {
|
|
|
12
12
|
carrier_billing_code?: string;
|
|
13
13
|
/** @description This will often be empty; however, if there was additionally specific information about the charge it should go here, could also be a reference number. Maximum length of 250 characters. */
|
|
14
14
|
memo?: string;
|
|
15
|
-
/** @description Total amount of the line item */
|
|
15
|
+
/** @description Total amount of the line item displayed and charged to the buyer */
|
|
16
16
|
amount!: Currency;
|
|
17
|
+
/** @description Total amount of the line item billed by the provider. This should only be populated if it differs from 'amount' **/
|
|
18
|
+
provider_billed_amount?: Currency;
|
|
17
19
|
}
|
|
18
20
|
|
|
19
21
|
export const BillingLineItemSchema = Joi.object({
|
|
@@ -22,4 +24,5 @@ export const BillingLineItemSchema = Joi.object({
|
|
|
22
24
|
carrier_billing_code: Joi.string().optional().empty(),
|
|
23
25
|
memo: Joi.string().optional().empty().max(250),
|
|
24
26
|
amount: CurrencySchema.required(),
|
|
27
|
+
provider_billed_amount: CurrencySchema.optional(),
|
|
25
28
|
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import Joi from 'joi';
|
|
2
|
+
|
|
3
|
+
/** @description Indicates a specific time window that a service point is open */
|
|
4
|
+
export class HoursOfOperation {
|
|
5
|
+
/** @description The open time expressed in ISO 8601 time only format */
|
|
6
|
+
open?: string;
|
|
7
|
+
/** @description The close time expressed in ISO 8601 time only format */
|
|
8
|
+
close?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const HoursOfOperationSchema = Joi.object({
|
|
12
|
+
open: Joi.string().optional().empty(),
|
|
13
|
+
close: Joi.string().optional().empty(),
|
|
14
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SearchRadiusUnit } from './search-radius-unit';
|
|
2
|
+
|
|
3
|
+
/** @description Basic structure for service point search radius */
|
|
4
|
+
export class SearchRadius {
|
|
5
|
+
/** @description Search radius in miles */
|
|
6
|
+
radius_in_miles?: number;
|
|
7
|
+
/** @description Search radius in kilometers */
|
|
8
|
+
radius_in_kilometers?: number;
|
|
9
|
+
/** @description Search radius in the original unit */
|
|
10
|
+
source_radius?: number;
|
|
11
|
+
/** @description Search radius unit */
|
|
12
|
+
source_radius_unit!: SearchRadiusUnit;
|
|
13
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import Joi from 'joi';
|
|
2
|
+
import { ServicePointAddress } from '../addresses/service-point-address';
|
|
3
|
+
import { LatLongSchema } from '../tracking/lat-long';
|
|
4
|
+
|
|
5
|
+
/** @description The address information corresponding to a specific service point */
|
|
6
|
+
export class ServicePointResponseAddress extends ServicePointAddress {
|
|
7
|
+
/** @description Description of the location */
|
|
8
|
+
description?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const ServicePointResponseAddressSchema = Joi.object({
|
|
12
|
+
phone_number: Joi.string().optional().empty(),
|
|
13
|
+
company_name: Joi.string().optional().empty(),
|
|
14
|
+
description: Joi.string().optional().empty(),
|
|
15
|
+
geo: LatLongSchema.optional(),
|
|
16
|
+
address_lines: Joi.array().items(Joi.string()).required(),
|
|
17
|
+
city_locality: Joi.string().required(),
|
|
18
|
+
state_province: Joi.string().required(),
|
|
19
|
+
postal_code: Joi.string().required(),
|
|
20
|
+
country_code: Joi.string().required(),
|
|
21
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import Joi from 'joi';
|
|
2
|
+
import {
|
|
3
|
+
ServicePointFeaturesEnum,
|
|
4
|
+
ServicePointFeaturesEnumSchema,
|
|
5
|
+
} from '../../app/metadata/service-point-feature';
|
|
6
|
+
import {
|
|
7
|
+
ServicePointResponseAddress,
|
|
8
|
+
ServicePointResponseAddressSchema,
|
|
9
|
+
} from './service-point-response-address';
|
|
10
|
+
import { WeeklyHoursOfOperation, WeeklyHoursOfOperationSchema } from './weekly-hours-of-operation';
|
|
11
|
+
|
|
12
|
+
/** @description Basic structure for a service point */
|
|
13
|
+
export class ServicePoint {
|
|
14
|
+
/** @description The identifier for the carrier's service point */
|
|
15
|
+
service_point_id!: string;
|
|
16
|
+
/** @description The address where the service point is located */
|
|
17
|
+
address!: ServicePointResponseAddress;
|
|
18
|
+
/** @description Weekly hours of operation for the service point */
|
|
19
|
+
hours_of_operation!: WeeklyHoursOfOperation;
|
|
20
|
+
/** @description Features supported by the service point */
|
|
21
|
+
features?: ServicePointFeaturesEnum[];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const ServicePointSchema = Joi.object({
|
|
25
|
+
service_point_id: Joi.string().required(),
|
|
26
|
+
address: ServicePointResponseAddressSchema.required(),
|
|
27
|
+
hours_of_operation: WeeklyHoursOfOperationSchema.required(),
|
|
28
|
+
features: Joi.array().items(ServicePointFeaturesEnumSchema).optional(),
|
|
29
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import Joi from 'joi';
|
|
2
|
+
import { HoursOfOperation, HoursOfOperationSchema } from './hours-of-operation';
|
|
3
|
+
|
|
4
|
+
/** @description The times during the week that the relay point is open */
|
|
5
|
+
export class WeeklyHoursOfOperation {
|
|
6
|
+
monday?: HoursOfOperation[];
|
|
7
|
+
tuesday?: HoursOfOperation[];
|
|
8
|
+
wednesday?: HoursOfOperation[];
|
|
9
|
+
thursday?: HoursOfOperation[];
|
|
10
|
+
friday?: HoursOfOperation[];
|
|
11
|
+
saturday?: HoursOfOperation[];
|
|
12
|
+
sunday?: HoursOfOperation[];
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const WeeklyHoursOfOperationSchema = Joi.object({
|
|
16
|
+
monday: HoursOfOperationSchema.optional(),
|
|
17
|
+
tuesday: HoursOfOperationSchema.optional(),
|
|
18
|
+
wednesday: HoursOfOperationSchema.optional(),
|
|
19
|
+
thursday: HoursOfOperationSchema.optional(),
|
|
20
|
+
friday: HoursOfOperationSchema.optional(),
|
|
21
|
+
saturday: HoursOfOperationSchema.optional(),
|
|
22
|
+
sunday: HoursOfOperationSchema.optional(),
|
|
23
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BaseRequest } from './base-request';
|
|
2
|
+
|
|
3
|
+
/** @description Basic structure for a request to get a single service point by id */
|
|
4
|
+
export class GetServicePointRequest extends BaseRequest {
|
|
5
|
+
/** @description The service point id to get */
|
|
6
|
+
service_point_id!: string;
|
|
7
|
+
/** @description The two character country code of the service point. The codes are specified by ISO 3166-1 alpha-2 */
|
|
8
|
+
country_code!: string;
|
|
9
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ServicePointAddress } from '../models/addresses/service-point-address';
|
|
2
|
+
import { SearchRadius } from '../models/service-points/search-radius';
|
|
3
|
+
import { BaseRequest } from './base-request';
|
|
4
|
+
|
|
5
|
+
/** @description Basic structure for a request to get service points */
|
|
6
|
+
export class GetServicePointsRequest extends BaseRequest {
|
|
7
|
+
/** @description The service code uniquely identifies a shipping service */
|
|
8
|
+
service_code?: string;
|
|
9
|
+
/** @description The address input for searching nearby carrier service points */
|
|
10
|
+
address!: ServicePointAddress;
|
|
11
|
+
/** @description The desired search radius around the given address */
|
|
12
|
+
search_radius?: SearchRadius;
|
|
13
|
+
/** @description The maximum number of service points to return */
|
|
14
|
+
max_results?: number;
|
|
15
|
+
}
|
package/src/requests/index.ts
CHANGED
|
@@ -12,3 +12,5 @@ export * from './cancel-notification-request';
|
|
|
12
12
|
export * from './validate-inbound-data-request';
|
|
13
13
|
export * from './normalize-tracking-data-request';
|
|
14
14
|
export * from './get-relay-points-request';
|
|
15
|
+
export * from './get-service-points-request';
|
|
16
|
+
export * from './get-service-point-request';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseResponse, BaseResponseSchema } from './base-response';
|
|
2
|
+
import { ServicePoint, ServicePointSchema } from '../models/service-points';
|
|
3
|
+
|
|
4
|
+
/** @description Basic structure for a response to get a single service point by id */
|
|
5
|
+
export class GetServicePointResponse extends BaseResponse {
|
|
6
|
+
/** @description The resulting service point */
|
|
7
|
+
service_point!: ServicePoint;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const GetServicePointResponseSchema = BaseResponseSchema.keys({
|
|
11
|
+
service_point: ServicePointSchema.required(),
|
|
12
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BaseResponse, BaseResponseSchema } from './base-response';
|
|
2
|
+
import Joi from 'joi';
|
|
3
|
+
import { ServicePoint, ServicePointSchema } from '../models/service-points';
|
|
4
|
+
|
|
5
|
+
/** @description Basic structure for a response to get service points */
|
|
6
|
+
export class GetServicePointsResponse extends BaseResponse {
|
|
7
|
+
/** @description The resulting service points */
|
|
8
|
+
service_points!: ServicePoint[];
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const GetServicePointsResponseSchema = BaseResponseSchema.keys({
|
|
12
|
+
service_points: Joi.array().required().items(ServicePointSchema),
|
|
13
|
+
});
|
package/src/responses/index.ts
CHANGED
|
@@ -12,3 +12,5 @@ export * from './create-notification-response';
|
|
|
12
12
|
export * from './validate-inbound-data-response';
|
|
13
13
|
export * from './normalize-tracking-data-response';
|
|
14
14
|
export * from './get-relay-points-response';
|
|
15
|
+
export * from './get-service-points-response';
|
|
16
|
+
export * from './get-service-point-response';
|