@shipengine/connect-carrier-api 4.26.0 → 4.26.2

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.
Files changed (29) hide show
  1. package/lib/models/addresses/address-base-schema.js +2 -14
  2. package/lib/models/addresses/address-base-schema.js.map +1 -1
  3. package/lib/models/addresses/address-base.d.ts +2 -30
  4. package/lib/models/addresses/address-base.js +2 -27
  5. package/lib/models/addresses/address-base.js.map +1 -1
  6. package/lib/models/addresses/address-common-schema.d.ts +2 -0
  7. package/lib/models/addresses/address-common-schema.js +21 -0
  8. package/lib/models/addresses/address-common-schema.js.map +1 -0
  9. package/lib/models/addresses/address-common.d.ts +31 -0
  10. package/lib/models/addresses/address-common.js +33 -0
  11. package/lib/models/addresses/address-common.js.map +1 -0
  12. package/lib/models/addresses/index.d.ts +1 -0
  13. package/lib/models/addresses/index.js +1 -0
  14. package/lib/models/addresses/index.js.map +1 -1
  15. package/lib/models/addresses/pudo-location-schema.js +10 -0
  16. package/lib/models/addresses/pudo-location-schema.js.map +1 -1
  17. package/lib/models/addresses/pudo-location.d.ts +16 -3
  18. package/lib/models/addresses/pudo-location.js +16 -3
  19. package/lib/models/addresses/pudo-location.js.map +1 -1
  20. package/package.json +1 -1
  21. package/spec.json +14 -5
  22. package/src/models/addresses/address-base-schema.ts +2 -14
  23. package/src/models/addresses/address-base.ts +2 -28
  24. package/src/models/addresses/address-common-schema.ts +17 -0
  25. package/src/models/addresses/address-common.ts +30 -0
  26. package/src/models/addresses/index.ts +1 -0
  27. package/src/models/addresses/pudo-location-schema.ts +10 -0
  28. package/src/models/addresses/pudo-location.ts +16 -3
  29. package/tsconfig.tsbuildinfo +1 -1
@@ -3,21 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AddressBaseSchema = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const joi_1 = tslib_1.__importDefault(require("joi"));
6
- exports.AddressBaseSchema = joi_1.default.object({
7
- name: joi_1.default.string().optional().empty(),
8
- first_name: joi_1.default.string().optional().empty(),
9
- last_name: joi_1.default.string().optional().empty(),
10
- email: joi_1.default.string().email().optional().empty(),
11
- phone_number: joi_1.default.string().optional().empty(),
12
- company_name: joi_1.default.string().optional().empty(),
13
- address_lines: joi_1.default.array().items(joi_1.default.string()).optional(),
14
- city_locality: joi_1.default.string().optional().empty(),
15
- state_province: joi_1.default.string().optional().empty(),
6
+ const address_common_schema_1 = require("./address-common-schema");
7
+ exports.AddressBaseSchema = address_common_schema_1.AddressCommonSchema.keys({
16
8
  postal_code: joi_1.default.string().required(),
17
9
  country_code: joi_1.default.string().required(),
18
- address_residential_indicator: joi_1.default.string().optional().empty(),
19
- is_eu: joi_1.default.boolean().optional(),
20
- address_metadata: joi_1.default.object().optional().empty(),
21
- instructions: joi_1.default.string().optional().empty(),
22
10
  });
23
11
  //# sourceMappingURL=address-base-schema.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"address-base-schema.js","sourceRoot":"","sources":["../../../src/models/addresses/address-base-schema.ts"],"names":[],"mappings":";;;;AAAA,sDAAsB;AAET,QAAA,iBAAiB,GAAG,aAAG,CAAC,MAAM,CAAC;IAC1C,IAAI,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE;IACrC,UAAU,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE;IAC3C,SAAS,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE;IAC1C,KAAK,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE;IAC9C,YAAY,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE;IAC7C,YAAY,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE;IAC7C,aAAa,EAAE,aAAG,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,aAAG,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACzD,aAAa,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE;IAC9C,cAAc,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE;IAC/C,WAAW,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACpC,YAAY,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACrC,6BAA6B,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE;IAC9D,KAAK,EAAE,aAAG,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC/B,gBAAgB,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE;IACjD,YAAY,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE;CAC9C,CAAC,CAAC"}
1
+ {"version":3,"file":"address-base-schema.js","sourceRoot":"","sources":["../../../src/models/addresses/address-base-schema.ts"],"names":[],"mappings":";;;;AAAA,sDAAsB;AACtB,mEAA8D;AAEjD,QAAA,iBAAiB,GAAG,2CAAmB,CAAC,IAAI,CAAC;IACxD,WAAW,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACpC,YAAY,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACtC,CAAC,CAAC"}
@@ -1,35 +1,7 @@
1
- import { AddressResidentialIndicator } from './address-residential-indicator';
2
- export declare class AddressBase {
3
- /** @description The full name of the contact contact associated with the address */
4
- name?: string;
5
- /** @description The first name of the contact associated with the address */
6
- first_name?: string;
7
- /** @description The last name of the contact associated with the address */
8
- last_name?: string;
9
- /** @description The email of the contact associated with the address */
10
- email?: string;
11
- /** @description The phone number of the contact associated with the address (No Newline Characters) */
12
- phone_number?: string;
13
- /** @description The name of the company associated with this address (No Newline Characters) max length 100 characters */
14
- company_name?: string;
15
- /** @description The address lines of the address (No Newline Characters) max length 100 characters */
16
- address_lines?: string[];
17
- /** @description City or locality (No Newline Characters) */
18
- city_locality?: string;
19
- /** @description State or province (No Newline Characters) */
20
- state_province?: string;
1
+ import { AddressCommon } from './address-common';
2
+ export declare class AddressBase extends AddressCommon {
21
3
  /** @description Zip or postal code (No Newline Characters) */
22
4
  postal_code: string;
23
5
  /** @description ISO 3166-1 two-letter country code max length 2 characters */
24
6
  country_code: string;
25
- /** @description Whether the address is residential or commercial */
26
- address_residential_indicator?: AddressResidentialIndicator;
27
- /** @description Whether the country of the shipment address is a member of the EU */
28
- is_eu?: boolean;
29
- /** @description Additional metadata provided for specific requests */
30
- address_metadata?: {
31
- [key: string]: string;
32
- };
33
- /** @description Instructions to help the carrier navigate to the address */
34
- instructions?: string;
35
7
  }
@@ -1,37 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AddressBase = void 0;
4
- class AddressBase {
5
- /** @description The full name of the contact contact associated with the address */
6
- name;
7
- /** @description The first name of the contact associated with the address */
8
- first_name;
9
- /** @description The last name of the contact associated with the address */
10
- last_name;
11
- /** @description The email of the contact associated with the address */
12
- email;
13
- /** @description The phone number of the contact associated with the address (No Newline Characters) */
14
- phone_number;
15
- /** @description The name of the company associated with this address (No Newline Characters) max length 100 characters */
16
- company_name;
17
- /** @description The address lines of the address (No Newline Characters) max length 100 characters */
18
- address_lines;
19
- /** @description City or locality (No Newline Characters) */
20
- city_locality;
21
- /** @description State or province (No Newline Characters) */
22
- state_province;
4
+ const address_common_1 = require("./address-common");
5
+ class AddressBase extends address_common_1.AddressCommon {
23
6
  /** @description Zip or postal code (No Newline Characters) */
24
7
  postal_code;
25
8
  /** @description ISO 3166-1 two-letter country code max length 2 characters */
26
9
  country_code;
27
- /** @description Whether the address is residential or commercial */
28
- address_residential_indicator;
29
- /** @description Whether the country of the shipment address is a member of the EU */
30
- is_eu;
31
- /** @description Additional metadata provided for specific requests */
32
- address_metadata;
33
- /** @description Instructions to help the carrier navigate to the address */
34
- instructions;
35
10
  }
36
11
  exports.AddressBase = AddressBase;
37
12
  //# sourceMappingURL=address-base.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"address-base.js","sourceRoot":"","sources":["../../../src/models/addresses/address-base.ts"],"names":[],"mappings":";;;AAEA,MAAa,WAAW;IACtB,oFAAoF;IACpF,IAAI,CAAU;IACd,6EAA6E;IAC7E,UAAU,CAAU;IACpB,4EAA4E;IAC5E,SAAS,CAAU;IACnB,wEAAwE;IACxE,KAAK,CAAU;IACf,uGAAuG;IACvG,YAAY,CAAU;IACtB,0HAA0H;IAC1H,YAAY,CAAU;IACtB,sGAAsG;IACtG,aAAa,CAAY;IACzB,4DAA4D;IAC5D,aAAa,CAAU;IACvB,6DAA6D;IAC7D,cAAc,CAAU;IACxB,8DAA8D;IAC9D,WAAW,CAAU;IACrB,+EAA+E;IAC/E,YAAY,CAAU;IACtB,oEAAoE;IACpE,6BAA6B,CAA+B;IAC5D,qFAAqF;IACrF,KAAK,CAAW;IAChB,sEAAsE;IACtE,gBAAgB,CAA6B;IAC7C,4EAA4E;IAC5E,YAAY,CAAU;CACvB;AA/BD,kCA+BC"}
1
+ {"version":3,"file":"address-base.js","sourceRoot":"","sources":["../../../src/models/addresses/address-base.ts"],"names":[],"mappings":";;;AAAA,qDAAiD;AAEjD,MAAa,WAAY,SAAQ,8BAAa;IAC5C,8DAA8D;IAC9D,WAAW,CAAU;IACrB,+EAA+E;IAC/E,YAAY,CAAU;CACvB;AALD,kCAKC"}
@@ -0,0 +1,2 @@
1
+ import Joi from 'joi';
2
+ export declare const AddressCommonSchema: Joi.ObjectSchema<any>;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AddressCommonSchema = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const joi_1 = tslib_1.__importDefault(require("joi"));
6
+ exports.AddressCommonSchema = joi_1.default.object({
7
+ name: joi_1.default.string().optional().empty(),
8
+ first_name: joi_1.default.string().optional().empty(),
9
+ last_name: joi_1.default.string().optional().empty(),
10
+ email: joi_1.default.string().email().optional().empty(),
11
+ phone_number: joi_1.default.string().optional().empty(),
12
+ company_name: joi_1.default.string().optional().empty(),
13
+ address_lines: joi_1.default.array().items(joi_1.default.string()).optional(),
14
+ city_locality: joi_1.default.string().optional().empty(),
15
+ state_province: joi_1.default.string().optional().empty(),
16
+ address_residential_indicator: joi_1.default.string().optional().empty(),
17
+ is_eu: joi_1.default.boolean().optional(),
18
+ address_metadata: joi_1.default.object().optional().empty(),
19
+ instructions: joi_1.default.string().optional().empty(),
20
+ });
21
+ //# sourceMappingURL=address-common-schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"address-common-schema.js","sourceRoot":"","sources":["../../../src/models/addresses/address-common-schema.ts"],"names":[],"mappings":";;;;AAAA,sDAAsB;AAET,QAAA,mBAAmB,GAAG,aAAG,CAAC,MAAM,CAAC;IAC5C,IAAI,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE;IACrC,UAAU,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE;IAC3C,SAAS,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE;IAC1C,KAAK,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE;IAC9C,YAAY,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE;IAC7C,YAAY,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE;IAC7C,aAAa,EAAE,aAAG,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,aAAG,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACzD,aAAa,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE;IAC9C,cAAc,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE;IAC/C,6BAA6B,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE;IAC9D,KAAK,EAAE,aAAG,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC/B,gBAAgB,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE;IACjD,YAAY,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE;CAC9C,CAAC,CAAC"}
@@ -0,0 +1,31 @@
1
+ import { AddressResidentialIndicator } from './address-residential-indicator';
2
+ export declare class AddressCommon {
3
+ /** @description The full name of the contact associated with the address */
4
+ name?: string;
5
+ /** @description The first name of the contact associated with the address */
6
+ first_name?: string;
7
+ /** @description The last name of the contact associated with the address */
8
+ last_name?: string;
9
+ /** @description The email of the contact associated with the address */
10
+ email?: string;
11
+ /** @description The phone number of the contact associated with the address (No Newline Characters) */
12
+ phone_number?: string;
13
+ /** @description The name of the company associated with this address (No Newline Characters) max length 100 characters */
14
+ company_name?: string;
15
+ /** @description The address lines of the address (No Newline Characters) max length 100 characters */
16
+ address_lines?: string[];
17
+ /** @description City or locality (No Newline Characters) */
18
+ city_locality?: string;
19
+ /** @description State or province (No Newline Characters) */
20
+ state_province?: string;
21
+ /** @description Whether the address is residential or commercial */
22
+ address_residential_indicator?: AddressResidentialIndicator;
23
+ /** @description Whether the country of the shipment address is a member of the EU */
24
+ is_eu?: boolean;
25
+ /** @description Additional metadata provided for specific requests */
26
+ address_metadata?: {
27
+ [key: string]: string;
28
+ };
29
+ /** @description Instructions to help the carrier navigate to the address */
30
+ instructions?: string;
31
+ }
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AddressCommon = void 0;
4
+ class AddressCommon {
5
+ /** @description The full name of the contact associated with the address */
6
+ name;
7
+ /** @description The first name of the contact associated with the address */
8
+ first_name;
9
+ /** @description The last name of the contact associated with the address */
10
+ last_name;
11
+ /** @description The email of the contact associated with the address */
12
+ email;
13
+ /** @description The phone number of the contact associated with the address (No Newline Characters) */
14
+ phone_number;
15
+ /** @description The name of the company associated with this address (No Newline Characters) max length 100 characters */
16
+ company_name;
17
+ /** @description The address lines of the address (No Newline Characters) max length 100 characters */
18
+ address_lines;
19
+ /** @description City or locality (No Newline Characters) */
20
+ city_locality;
21
+ /** @description State or province (No Newline Characters) */
22
+ state_province;
23
+ /** @description Whether the address is residential or commercial */
24
+ address_residential_indicator;
25
+ /** @description Whether the country of the shipment address is a member of the EU */
26
+ is_eu;
27
+ /** @description Additional metadata provided for specific requests */
28
+ address_metadata;
29
+ /** @description Instructions to help the carrier navigate to the address */
30
+ instructions;
31
+ }
32
+ exports.AddressCommon = AddressCommon;
33
+ //# sourceMappingURL=address-common.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"address-common.js","sourceRoot":"","sources":["../../../src/models/addresses/address-common.ts"],"names":[],"mappings":";;;AAEA,MAAa,aAAa;IACxB,4EAA4E;IAC5E,IAAI,CAAU;IACd,6EAA6E;IAC7E,UAAU,CAAU;IACpB,4EAA4E;IAC5E,SAAS,CAAU;IACnB,wEAAwE;IACxE,KAAK,CAAU;IACf,uGAAuG;IACvG,YAAY,CAAU;IACtB,0HAA0H;IAC1H,YAAY,CAAU;IACtB,sGAAsG;IACtG,aAAa,CAAY;IACzB,4DAA4D;IAC5D,aAAa,CAAU;IACvB,6DAA6D;IAC7D,cAAc,CAAU;IACxB,oEAAoE;IACpE,6BAA6B,CAA+B;IAC5D,qFAAqF;IACrF,KAAK,CAAW;IAChB,sEAAsE;IACtE,gBAAgB,CAA6B;IAC7C,4EAA4E;IAC5E,YAAY,CAAU;CACvB;AA3BD,sCA2BC"}
@@ -1,4 +1,5 @@
1
1
  export * from './address-base';
2
+ export * from './address-common';
2
3
  export * from './address-residential-indicator';
3
4
  export * from './ship-from';
4
5
  export * from './ship-from-display';
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./address-base"), exports);
5
+ tslib_1.__exportStar(require("./address-common"), exports);
5
6
  tslib_1.__exportStar(require("./address-residential-indicator"), exports);
6
7
  tslib_1.__exportStar(require("./ship-from"), exports);
7
8
  tslib_1.__exportStar(require("./ship-from-display"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/models/addresses/index.ts"],"names":[],"mappings":";;;AAAA,yDAA+B;AAC/B,0EAAgD;AAChD,sDAA4B;AAC5B,8DAAoC;AACpC,oDAA0B;AAC1B,0DAAgC;AAChC,iEAAuC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/models/addresses/index.ts"],"names":[],"mappings":";;;AAAA,yDAA+B;AAC/B,2DAAiC;AACjC,0EAAgD;AAChD,sDAA4B;AAC5B,8DAAoC;AACpC,oDAA0B;AAC1B,0DAAgC;AAChC,iEAAuC"}
@@ -7,5 +7,15 @@ const address_base_schema_1 = require("./address-base-schema");
7
7
  exports.PudoLocationSchema = address_base_schema_1.AddressBaseSchema.keys({
8
8
  carrier_code: joi_1.default.string().optional(),
9
9
  location_id: joi_1.default.string().optional(),
10
+ postal_code: joi_1.default.string().when('location_id', {
11
+ is: joi_1.default.exist(),
12
+ then: joi_1.default.optional().allow(''),
13
+ otherwise: joi_1.default.required(),
14
+ }),
15
+ country_code: joi_1.default.string().when('location_id', {
16
+ is: joi_1.default.exist(),
17
+ then: joi_1.default.optional().allow(''),
18
+ otherwise: joi_1.default.required(),
19
+ }),
10
20
  });
11
21
  //# sourceMappingURL=pudo-location-schema.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pudo-location-schema.js","sourceRoot":"","sources":["../../../src/models/addresses/pudo-location-schema.ts"],"names":[],"mappings":";;;;AAAA,sDAAsB;AACtB,+DAA0D;AAE7C,QAAA,kBAAkB,GAAG,uCAAiB,CAAC,IAAI,CAAC;IACvD,YAAY,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACrC,WAAW,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACrC,CAAC,CAAC"}
1
+ {"version":3,"file":"pudo-location-schema.js","sourceRoot":"","sources":["../../../src/models/addresses/pudo-location-schema.ts"],"names":[],"mappings":";;;;AAAA,sDAAsB;AACtB,+DAA0D;AAE7C,QAAA,kBAAkB,GAAG,uCAAiB,CAAC,IAAI,CAAC;IACvD,YAAY,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACrC,WAAW,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACpC,WAAW,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,aAAa,EAAE;QAC5C,EAAE,EAAE,aAAG,CAAC,KAAK,EAAE;QACf,IAAI,EAAE,aAAG,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC;QAC9B,SAAS,EAAE,aAAG,CAAC,QAAQ,EAAE;KAC1B,CAAC;IACF,YAAY,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,aAAa,EAAE;QAC7C,EAAE,EAAE,aAAG,CAAC,KAAK,EAAE;QACf,IAAI,EAAE,aAAG,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC;QAC9B,SAAS,EAAE,aAAG,CAAC,QAAQ,EAAE;KAC1B,CAAC;CACH,CAAC,CAAC"}
@@ -1,8 +1,21 @@
1
- import { AddressBase } from './address-base';
1
+ import { AddressCommon } from './address-common';
2
2
  /** @description Pickup/Dropoff location used by carriers */
3
- export declare class PudoLocation extends AddressBase {
3
+ export declare class PudoLocation extends AddressCommon {
4
+ /**
5
+ * @description Zip or postal code (No Newline Characters)
6
+ * Required if `location_id` is not provided
7
+ */
8
+ postal_code?: string;
9
+ /**
10
+ * @description ISO 3166-1 two-letter country code max length 2 characters
11
+ * Required if `location_id` is not provided
12
+ */
13
+ country_code?: string;
4
14
  /** @description Standardized carrier code the location id belongs to */
5
15
  carrier_code?: string;
6
- /** @description Location id needed to look up the location */
16
+ /**
17
+ * @description Location id needed to look up the location.
18
+ * Required if `postal_code` or `country_code` is not provided.
19
+ */
7
20
  location_id?: string;
8
21
  }
@@ -1,12 +1,25 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PudoLocation = void 0;
4
- const address_base_1 = require("./address-base");
4
+ const address_common_1 = require("./address-common");
5
5
  /** @description Pickup/Dropoff location used by carriers */
6
- class PudoLocation extends address_base_1.AddressBase {
6
+ class PudoLocation extends address_common_1.AddressCommon {
7
+ /**
8
+ * @description Zip or postal code (No Newline Characters)
9
+ * Required if `location_id` is not provided
10
+ */
11
+ postal_code;
12
+ /**
13
+ * @description ISO 3166-1 two-letter country code max length 2 characters
14
+ * Required if `location_id` is not provided
15
+ */
16
+ country_code;
7
17
  /** @description Standardized carrier code the location id belongs to */
8
18
  carrier_code;
9
- /** @description Location id needed to look up the location */
19
+ /**
20
+ * @description Location id needed to look up the location.
21
+ * Required if `postal_code` or `country_code` is not provided.
22
+ */
10
23
  location_id;
11
24
  }
12
25
  exports.PudoLocation = PudoLocation;
@@ -1 +1 @@
1
- {"version":3,"file":"pudo-location.js","sourceRoot":"","sources":["../../../src/models/addresses/pudo-location.ts"],"names":[],"mappings":";;;AAAA,iDAA6C;AAE7C,4DAA4D;AAC5D,MAAa,YAAa,SAAQ,0BAAW;IAC3C,wEAAwE;IACxE,YAAY,CAAU;IACtB,8DAA8D;IAC9D,WAAW,CAAU;CACtB;AALD,oCAKC"}
1
+ {"version":3,"file":"pudo-location.js","sourceRoot":"","sources":["../../../src/models/addresses/pudo-location.ts"],"names":[],"mappings":";;;AAAA,qDAAiD;AAEjD,4DAA4D;AAC5D,MAAa,YAAa,SAAQ,8BAAa;IAC7C;;;OAGG;IACH,WAAW,CAAU;IACrB;;;OAGG;IACH,YAAY,CAAU;IACtB,wEAAwE;IACxE,YAAY,CAAU;IACtB;;;OAGG;IACH,WAAW,CAAU;CACtB;AAlBD,oCAkBC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipengine/connect-carrier-api",
3
- "version": "4.26.0",
3
+ "version": "4.26.2",
4
4
  "description": "This is the typescript/javascript definitions for carrier api",
5
5
  "homepage": "https://connect.shipengine.com",
6
6
  "main": "./lib/index.js",
package/spec.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "info": {
4
4
  "title": "Shipping API",
5
5
  "description": "This API specification describes the canonical ShipEngine Shipping API connector module.",
6
- "version": "1.39.0"
6
+ "version": "1.39.1"
7
7
  },
8
8
  "paths": {
9
9
  "/Register": {
@@ -3921,16 +3921,25 @@
3921
3921
  "description": "Base class for all subscription channel protocols"
3922
3922
  },
3923
3923
  "PudoLocation": {
3924
- "required": [
3925
- "postal_code",
3926
- "country_code"
3927
- ],
3928
3924
  "type": "object",
3929
3925
  "allOf": [
3930
3926
  {
3931
3927
  "$ref": "#/components/schemas/AddressWithContact"
3932
3928
  }
3933
3929
  ],
3930
+ "anyOf": [
3931
+ {
3932
+ "required": [
3933
+ "location_id"
3934
+ ]
3935
+ },
3936
+ {
3937
+ "required": [
3938
+ "postal_code",
3939
+ "country_code"
3940
+ ]
3941
+ }
3942
+ ],
3934
3943
  "properties": {
3935
3944
  "carrier_code": {
3936
3945
  "type": "string",
@@ -1,19 +1,7 @@
1
1
  import Joi from 'joi';
2
+ import { AddressCommonSchema } from './address-common-schema';
2
3
 
3
- export const AddressBaseSchema = Joi.object({
4
- name: Joi.string().optional().empty(),
5
- first_name: Joi.string().optional().empty(),
6
- last_name: Joi.string().optional().empty(),
7
- email: Joi.string().email().optional().empty(),
8
- phone_number: Joi.string().optional().empty(),
9
- company_name: Joi.string().optional().empty(),
10
- address_lines: Joi.array().items(Joi.string()).optional(),
11
- city_locality: Joi.string().optional().empty(),
12
- state_province: Joi.string().optional().empty(),
4
+ export const AddressBaseSchema = AddressCommonSchema.keys({
13
5
  postal_code: Joi.string().required(),
14
6
  country_code: Joi.string().required(),
15
- address_residential_indicator: Joi.string().optional().empty(),
16
- is_eu: Joi.boolean().optional(),
17
- address_metadata: Joi.object().optional().empty(),
18
- instructions: Joi.string().optional().empty(),
19
7
  });
@@ -1,34 +1,8 @@
1
- import { AddressResidentialIndicator } from './address-residential-indicator';
1
+ import { AddressCommon } from './address-common';
2
2
 
3
- export class AddressBase {
4
- /** @description The full name of the contact contact associated with the address */
5
- name?: string;
6
- /** @description The first name of the contact associated with the address */
7
- first_name?: string;
8
- /** @description The last name of the contact associated with the address */
9
- last_name?: string;
10
- /** @description The email of the contact associated with the address */
11
- email?: string;
12
- /** @description The phone number of the contact associated with the address (No Newline Characters) */
13
- phone_number?: string;
14
- /** @description The name of the company associated with this address (No Newline Characters) max length 100 characters */
15
- company_name?: string;
16
- /** @description The address lines of the address (No Newline Characters) max length 100 characters */
17
- address_lines?: string[];
18
- /** @description City or locality (No Newline Characters) */
19
- city_locality?: string;
20
- /** @description State or province (No Newline Characters) */
21
- state_province?: string;
3
+ export class AddressBase extends AddressCommon {
22
4
  /** @description Zip or postal code (No Newline Characters) */
23
5
  postal_code!: string;
24
6
  /** @description ISO 3166-1 two-letter country code max length 2 characters */
25
7
  country_code!: string;
26
- /** @description Whether the address is residential or commercial */
27
- address_residential_indicator?: AddressResidentialIndicator;
28
- /** @description Whether the country of the shipment address is a member of the EU */
29
- is_eu?: boolean;
30
- /** @description Additional metadata provided for specific requests */
31
- address_metadata?: { [key: string]: string };
32
- /** @description Instructions to help the carrier navigate to the address */
33
- instructions?: string;
34
8
  }
@@ -0,0 +1,17 @@
1
+ import Joi from 'joi';
2
+
3
+ export const AddressCommonSchema = Joi.object({
4
+ name: Joi.string().optional().empty(),
5
+ first_name: Joi.string().optional().empty(),
6
+ last_name: Joi.string().optional().empty(),
7
+ email: Joi.string().email().optional().empty(),
8
+ phone_number: Joi.string().optional().empty(),
9
+ company_name: Joi.string().optional().empty(),
10
+ address_lines: Joi.array().items(Joi.string()).optional(),
11
+ city_locality: Joi.string().optional().empty(),
12
+ state_province: Joi.string().optional().empty(),
13
+ address_residential_indicator: Joi.string().optional().empty(),
14
+ is_eu: Joi.boolean().optional(),
15
+ address_metadata: Joi.object().optional().empty(),
16
+ instructions: Joi.string().optional().empty(),
17
+ });
@@ -0,0 +1,30 @@
1
+ import { AddressResidentialIndicator } from './address-residential-indicator';
2
+
3
+ export class AddressCommon {
4
+ /** @description The full name of the contact associated with the address */
5
+ name?: string;
6
+ /** @description The first name of the contact associated with the address */
7
+ first_name?: string;
8
+ /** @description The last name of the contact associated with the address */
9
+ last_name?: string;
10
+ /** @description The email of the contact associated with the address */
11
+ email?: string;
12
+ /** @description The phone number of the contact associated with the address (No Newline Characters) */
13
+ phone_number?: string;
14
+ /** @description The name of the company associated with this address (No Newline Characters) max length 100 characters */
15
+ company_name?: string;
16
+ /** @description The address lines of the address (No Newline Characters) max length 100 characters */
17
+ address_lines?: string[];
18
+ /** @description City or locality (No Newline Characters) */
19
+ city_locality?: string;
20
+ /** @description State or province (No Newline Characters) */
21
+ state_province?: string;
22
+ /** @description Whether the address is residential or commercial */
23
+ address_residential_indicator?: AddressResidentialIndicator;
24
+ /** @description Whether the country of the shipment address is a member of the EU */
25
+ is_eu?: boolean;
26
+ /** @description Additional metadata provided for specific requests */
27
+ address_metadata?: { [key: string]: string };
28
+ /** @description Instructions to help the carrier navigate to the address */
29
+ instructions?: string;
30
+ }
@@ -1,4 +1,5 @@
1
1
  export * from './address-base';
2
+ export * from './address-common';
2
3
  export * from './address-residential-indicator';
3
4
  export * from './ship-from';
4
5
  export * from './ship-from-display';
@@ -4,4 +4,14 @@ import { AddressBaseSchema } from './address-base-schema';
4
4
  export const PudoLocationSchema = AddressBaseSchema.keys({
5
5
  carrier_code: Joi.string().optional(),
6
6
  location_id: Joi.string().optional(),
7
+ postal_code: Joi.string().when('location_id', {
8
+ is: Joi.exist(),
9
+ then: Joi.optional().allow(''),
10
+ otherwise: Joi.required(),
11
+ }),
12
+ country_code: Joi.string().when('location_id', {
13
+ is: Joi.exist(),
14
+ then: Joi.optional().allow(''),
15
+ otherwise: Joi.required(),
16
+ }),
7
17
  });
@@ -1,9 +1,22 @@
1
- import { AddressBase } from './address-base';
1
+ import { AddressCommon } from './address-common';
2
2
 
3
3
  /** @description Pickup/Dropoff location used by carriers */
4
- export class PudoLocation extends AddressBase {
4
+ export class PudoLocation extends AddressCommon {
5
+ /**
6
+ * @description Zip or postal code (No Newline Characters)
7
+ * Required if `location_id` is not provided
8
+ */
9
+ postal_code?: string;
10
+ /**
11
+ * @description ISO 3166-1 two-letter country code max length 2 characters
12
+ * Required if `location_id` is not provided
13
+ */
14
+ country_code?: string;
5
15
  /** @description Standardized carrier code the location id belongs to */
6
16
  carrier_code?: string;
7
- /** @description Location id needed to look up the location */
17
+ /**
18
+ * @description Location id needed to look up the location.
19
+ * Required if `postal_code` or `country_code` is not provided.
20
+ */
8
21
  location_id?: string;
9
22
  }