@shipengine/connect-carrier-api 4.0.0-beta.2 → 4.0.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.
Files changed (107) hide show
  1. package/lib/app/create-endpoint-mapping.js +2 -0
  2. package/lib/app/create-endpoint-mapping.js.map +1 -1
  3. package/lib/constants.d.ts +1 -0
  4. package/lib/constants.js +6 -0
  5. package/lib/constants.js.map +1 -0
  6. package/lib/index.d.ts +1 -0
  7. package/lib/index.js +1 -0
  8. package/lib/index.js.map +1 -1
  9. package/lib/models/advanced-options.d.ts +5 -0
  10. package/lib/models/advanced-options.js.map +1 -1
  11. package/lib/models/bill-to.d.ts +14 -0
  12. package/lib/models/bill-to.js +14 -0
  13. package/lib/models/bill-to.js.map +1 -0
  14. package/lib/models/billing/billing-to-party.d.ts +10 -0
  15. package/lib/models/billing/billing-to-party.js +15 -0
  16. package/lib/models/billing/billing-to-party.js.map +1 -0
  17. package/lib/models/billing/index.d.ts +1 -0
  18. package/lib/models/billing/index.js +1 -0
  19. package/lib/models/billing/index.js.map +1 -1
  20. package/lib/models/cod-payment-type.d.ts +9 -0
  21. package/lib/models/cod-payment-type.js +14 -0
  22. package/lib/models/cod-payment-type.js.map +1 -0
  23. package/lib/models/collect-on-delivery.d.ts +9 -0
  24. package/lib/models/collect-on-delivery.js +8 -0
  25. package/lib/models/collect-on-delivery.js.map +1 -0
  26. package/lib/models/customs/customs-charges.d.ts +2 -0
  27. package/lib/models/customs/customs-charges.js.map +1 -1
  28. package/lib/models/customs/customs.d.ts +1 -1
  29. package/lib/models/index.d.ts +4 -0
  30. package/lib/models/index.js +4 -0
  31. package/lib/models/index.js.map +1 -1
  32. package/lib/models/native-rating/context-results.d.ts +3 -0
  33. package/lib/models/native-rating/context-results.js +3 -0
  34. package/lib/models/native-rating/context-results.js.map +1 -0
  35. package/lib/models/native-rating/get-rates.d.ts +7 -0
  36. package/lib/models/native-rating/get-rates.js +3 -0
  37. package/lib/models/native-rating/get-rates.js.map +1 -0
  38. package/lib/models/native-rating/get-variables.d.ts +6 -0
  39. package/lib/models/native-rating/get-variables.js +3 -0
  40. package/lib/models/native-rating/get-variables.js.map +1 -0
  41. package/lib/models/native-rating/get-zone.d.ts +6 -0
  42. package/lib/models/native-rating/get-zone.js +3 -0
  43. package/lib/models/native-rating/get-zone.js.map +1 -0
  44. package/lib/models/native-rating/implementation-type.d.ts +30 -0
  45. package/lib/models/native-rating/implementation-type.js +8 -0
  46. package/lib/models/native-rating/implementation-type.js.map +1 -0
  47. package/lib/models/native-rating/index.d.ts +7 -0
  48. package/lib/models/native-rating/index.js +11 -0
  49. package/lib/models/native-rating/index.js.map +1 -0
  50. package/lib/models/native-rating/numeric-currency.d.ts +5 -0
  51. package/lib/models/native-rating/numeric-currency.js +3 -0
  52. package/lib/models/native-rating/numeric-currency.js.map +1 -0
  53. package/lib/models/native-rating/rating-context.d.ts +15 -0
  54. package/lib/models/native-rating/rating-context.js +3 -0
  55. package/lib/models/native-rating/rating-context.js.map +1 -0
  56. package/lib/models/taxes/tax-identifier.d.ts +3 -1
  57. package/lib/models/taxes/tax-identifier.js.map +1 -1
  58. package/lib/requests/create-label-request.d.ts +3 -1
  59. package/lib/requests/create-label-request.js.map +1 -1
  60. package/lib/requests/get-rates-request.d.ts +3 -1
  61. package/lib/requests/get-rates-request.js.map +1 -1
  62. package/package.json +4 -4
  63. package/spec.json +54 -1
  64. package/src/app/create-endpoint-mapping.ts +2 -0
  65. package/src/constants.ts +2 -0
  66. package/src/index.ts +1 -0
  67. package/src/models/advanced-options.ts +5 -0
  68. package/src/models/bill-to.ts +15 -0
  69. package/src/models/billing/billing-to-party.ts +10 -0
  70. package/src/models/billing/index.ts +1 -0
  71. package/src/models/cod-payment-type.ts +9 -0
  72. package/src/models/collect-on-delivery.ts +10 -0
  73. package/src/models/customs/customs-charges.ts +2 -0
  74. package/src/models/customs/customs.ts +1 -1
  75. package/src/models/index.ts +4 -0
  76. package/src/models/native-rating/context-results.ts +3 -0
  77. package/src/models/native-rating/get-rates.ts +9 -0
  78. package/src/models/native-rating/get-variables.ts +8 -0
  79. package/src/models/native-rating/get-zone.ts +9 -0
  80. package/src/models/native-rating/implementation-type.ts +33 -0
  81. package/src/models/native-rating/index.ts +7 -0
  82. package/src/models/native-rating/numeric-currency.ts +5 -0
  83. package/src/models/native-rating/rating-context.ts +19 -0
  84. package/src/models/taxes/tax-identifier.ts +3 -1
  85. package/src/requests/create-label-request.ts +3 -0
  86. package/src/requests/get-rates-request.ts +3 -0
  87. package/tsconfig.tsbuildinfo +1 -1
  88. package/lib/models/addresses/address-base-schema.d.ts +0 -2
  89. package/lib/models/addresses/address-base-schema.js +0 -24
  90. package/lib/models/addresses/address-base-schema.js.map +0 -1
  91. package/lib/models/addresses/pudo-location-schema.d.ts +0 -2
  92. package/lib/models/addresses/pudo-location-schema.js +0 -11
  93. package/lib/models/addresses/pudo-location-schema.js.map +0 -1
  94. package/lib/models/addresses/ship-to-schema.d.ts +0 -2
  95. package/lib/models/addresses/ship-to-schema.js +0 -11
  96. package/lib/models/addresses/ship-to-schema.js.map +0 -1
  97. package/lib/models/pickup/shipped-shipment-schema.d.ts +0 -3
  98. package/lib/models/pickup/shipped-shipment-schema.js +0 -21
  99. package/lib/models/pickup/shipped-shipment-schema.js.map +0 -1
  100. package/lib/requests/cancel-notification-request-schema.d.ts +0 -2
  101. package/lib/requests/cancel-notification-request-schema.js +0 -12
  102. package/lib/requests/cancel-notification-request-schema.js.map +0 -1
  103. package/src/models/addresses/address-base-schema.ts +0 -20
  104. package/src/models/addresses/pudo-location-schema.ts +0 -7
  105. package/src/models/addresses/ship-to-schema.ts +0 -7
  106. package/src/models/pickup/shipped-shipment-schema.ts +0 -18
  107. package/src/requests/cancel-notification-request-schema.ts +0 -8
@@ -4,6 +4,8 @@ exports.createEndpointMapping = void 0;
4
4
  const connect_runtime_1 = require("@shipengine/connect-runtime");
5
5
  const constants_1 = require("./constants");
6
6
  const createEndpointMapping = (definition) => [
7
+ //TODO: Remove `Method.POST` from this and all other maps since they are ALL post
8
+ //TODO: Remove JOI validation from all endpoints and replace them with OpenAPI validation
7
9
  [connect_runtime_1.Method.POST, constants_1.ApiEndpoints.CancelNotification, definition.CancelNotification],
8
10
  [connect_runtime_1.Method.POST, constants_1.ApiEndpoints.CancelPickup, definition.CancelPickup],
9
11
  [connect_runtime_1.Method.POST, constants_1.ApiEndpoints.CreateLabel, definition.CreateLabel],
@@ -1 +1 @@
1
- {"version":3,"file":"create-endpoint-mapping.js","sourceRoot":"","sources":["../../src/app/create-endpoint-mapping.ts"],"names":[],"mappings":";;;AAAA,iEAAqD;AACrD,2CAA2C;AAGpC,MAAM,qBAAqB,GAAG,CACnC,UAAgC,EAC0C,EAAE,CAAC;IAC7E,CAAC,wBAAM,CAAC,IAAI,EAAE,wBAAY,CAAC,kBAAkB,EAAE,UAAU,CAAC,kBAAkB,CAAC;IAC7E,CAAC,wBAAM,CAAC,IAAI,EAAE,wBAAY,CAAC,YAAY,EAAE,UAAU,CAAC,YAAY,CAAC;IACjE,CAAC,wBAAM,CAAC,IAAI,EAAE,wBAAY,CAAC,WAAW,EAAE,UAAU,CAAC,WAAW,CAAC;IAC/D,CAAC,wBAAM,CAAC,IAAI,EAAE,wBAAY,CAAC,cAAc,EAAE,UAAU,CAAC,cAAc,CAAC;IACrE,CAAC,wBAAM,CAAC,IAAI,EAAE,wBAAY,CAAC,WAAW,EAAE,UAAU,CAAC,WAAW,CAAC;IAC/D,CAAC,wBAAM,CAAC,IAAI,EAAE,wBAAY,CAAC,kBAAkB,EAAE,UAAU,CAAC,kBAAkB,CAAC;IAC7E,CAAC,wBAAM,CAAC,IAAI,EAAE,wBAAY,CAAC,QAAQ,EAAE,UAAU,CAAC,QAAQ,CAAC;IACzD,CAAC,wBAAM,CAAC,IAAI,EAAE,wBAAY,CAAC,qBAAqB,EAAE,UAAU,CAAC,qBAAqB,CAAC;IACnF,CAAC,wBAAM,CAAC,IAAI,EAAE,wBAA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AAE,wBAAY,CAAC,oBAAoB,EAAE,UAAU,CAAC,oBAAoB,CAAC;CAClF,CAAC;AAtBW,QAAA,qBAAqB,yBAsBhC"}
@@ -0,0 +1 @@
1
+ export declare const rateLogicName = "rate-shipments.js";
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.rateLogicName = void 0;
4
+ // Name of the file that will contain rating logic used by Native Rating
5
+ exports.rateLogicName = 'rate-shipments.js';
6
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAAA,wEAAwE;AAC3D,QAAA,aAAa,GAAG,mBAAmB,CAAC"}
package/lib/index.d.ts CHANGED
@@ -2,6 +2,7 @@ export * as models from './models';
2
2
  export * as requests from './requests';
3
3
  export * as responses from './responses';
4
4
  export * from './app';
5
+ export * from './constants';
5
6
  export * from './models';
6
7
  export * from './requests';
7
8
  export * from './responses';
package/lib/index.js CHANGED
@@ -6,6 +6,7 @@ exports.models = tslib_1.__importStar(require("./models"));
6
6
  exports.requests = tslib_1.__importStar(require("./requests"));
7
7
  exports.responses = tslib_1.__importStar(require("./responses"));
8
8
  tslib_1.__exportStar(require("./app"), exports);
9
+ tslib_1.__exportStar(require("./constants"), exports);
9
10
  tslib_1.__exportStar(require("./models"), exports);
10
11
  tslib_1.__exportStar(require("./requests"), exports);
11
12
  tslib_1.__exportStar(require("./responses"), exports);
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,2DAAmC;AACnC,+DAAuC;AACvC,iEAAyC;AAEzC,gDAAsB;AACtB,mDAAyB;AACzB,qDAA2B;AAC3B,sDAA4B;AAC5B,iDAAuB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,2DAAmC;AACnC,+DAAuC;AACvC,iEAAyC;AAEzC,gDAAsB;AACtB,sDAA4B;AAC5B,mDAAyB;AACzB,qDAA2B;AAC3B,sDAA4B;AAC5B,iDAAuB"}
@@ -1,3 +1,4 @@
1
+ import { CollectOnDelivery } from './collect-on-delivery';
1
2
  import { Currency } from './currency';
2
3
  /** @description Basic structure for shipping options */
3
4
  export declare class AdvancedOptions {
@@ -13,6 +14,10 @@ export declare class AdvancedOptions {
13
14
  saturday_delivery?: boolean;
14
15
  /** @description Amount to be paid to the driver, used for local delivery and courier services */
15
16
  tip?: Currency;
17
+ /** @description Describes whether Additional Handling is requested for the shipment */
18
+ additional_handling?: boolean;
19
+ /** @description Describes details for Collect on Delivery (COD) if requested for the shipment */
20
+ collect_on_delivery?: CollectOnDelivery;
16
21
  /** @description Any other custom shipping options */
17
22
  [key: string]: any;
18
23
  }
@@ -1 +1 @@
1
- {"version":3,"file":"advanced-options.js","sourceRoot":"","sources":["../../src/models/advanced-options.ts"],"names":[],"mappings":";;;AAEA,wDAAwD;AACxD,MAAa,eAAe;CAe3B;AAfD,0CAeC"}
1
+ {"version":3,"file":"advanced-options.js","sourceRoot":"","sources":["../../src/models/advanced-options.ts"],"names":[],"mappings":";;;AAGA,wDAAwD;AACxD,MAAa,eAAe;CAmB3B;AAnBD,0CAmBC"}
@@ -0,0 +1,14 @@
1
+ import { AddressBase } from './addresses';
2
+ import { BillToParty } from './billing';
3
+ /**
4
+ * @description Bill to is a generic object used for billing a part of the shipment, duties, taxes, or otherwise to a party
5
+ other than the shipper (the shipper is considered the default party responsible). Ref: BillTo extends AddressBase.
6
+ since address fields are often required when associating billing to
7
+ another account. Additionally, this allows for a contact to be specified, if necessary.
8
+ */
9
+ export declare class BillTo extends AddressBase {
10
+ /** @description The bill_to_party mentions the type of billing option*/
11
+ bill_to_party?: BillToParty;
12
+ /** @description Specified if there is an account number associated with the Bill To Party, and the Bill To Party is not the account holder. */
13
+ account_number?: string;
14
+ }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BillTo = void 0;
4
+ const addresses_1 = require("./addresses");
5
+ /**
6
+ * @description Bill to is a generic object used for billing a part of the shipment, duties, taxes, or otherwise to a party
7
+ other than the shipper (the shipper is considered the default party responsible). Ref: BillTo extends AddressBase.
8
+ since address fields are often required when associating billing to
9
+ another account. Additionally, this allows for a contact to be specified, if necessary.
10
+ */
11
+ class BillTo extends addresses_1.AddressBase {
12
+ }
13
+ exports.BillTo = BillTo;
14
+ //# sourceMappingURL=bill-to.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bill-to.js","sourceRoot":"","sources":["../../src/models/bill-to.ts"],"names":[],"mappings":";;;AAAA,2CAA0C;AAG1C;;;;;GAKG;AACH,MAAa,MAAO,SAAQ,uBAAW;CAKtC;AALD,wBAKC"}
@@ -0,0 +1,10 @@
1
+ /** @description The type of party responsible for a given category of charges associated with a shipment, such as
2
+ * shipping charges or import duties. */
3
+ export declare enum BillToParty {
4
+ /** @description The shipper is generally regarded as the party responsible for the billing. */
5
+ Shipper = "shipper",
6
+ /** @description The recipient may be responsible for the billing of some entities, that could include the shipping cost. */
7
+ Recipient = "recipient",
8
+ /** @description A shipper may want to bill to a third-party; especially common for 3PLs and larger volume. merchants */
9
+ ThirdPartyAccount = "third_party_account"
10
+ }
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BillToParty = void 0;
4
+ /** @description The type of party responsible for a given category of charges associated with a shipment, such as
5
+ * shipping charges or import duties. */
6
+ var BillToParty;
7
+ (function (BillToParty) {
8
+ /** @description The shipper is generally regarded as the party responsible for the billing. */
9
+ BillToParty["Shipper"] = "shipper";
10
+ /** @description The recipient may be responsible for the billing of some entities, that could include the shipping cost. */
11
+ BillToParty["Recipient"] = "recipient";
12
+ /** @description A shipper may want to bill to a third-party; especially common for 3PLs and larger volume. merchants */
13
+ BillToParty["ThirdPartyAccount"] = "third_party_account";
14
+ })(BillToParty = exports.BillToParty || (exports.BillToParty = {}));
15
+ //# sourceMappingURL=billing-to-party.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"billing-to-party.js","sourceRoot":"","sources":["../../../src/models/billing/billing-to-party.ts"],"names":[],"mappings":";;;AAAA;wCACwC;AACxC,IAAY,WAOX;AAPD,WAAY,WAAW;IACrB,+FAA+F;IAC/F,kCAAmB,CAAA;IACnB,4HAA4H;IAC5H,sCAAuB,CAAA;IACvB,wHAAwH;IACxH,wDAAyC,CAAA;AAC3C,CAAC,EAPW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAOtB"}
@@ -2,3 +2,4 @@ export * from './billing-categories';
2
2
  export * from './billing-categories-schema';
3
3
  export * from './billing-line-item';
4
4
  export * from './billing-line-item-schema';
5
+ export * from './billing-to-party';
@@ -5,4 +5,5 @@ tslib_1.__exportStar(require("./billing-categories"), exports);
5
5
  tslib_1.__exportStar(require("./billing-categories-schema"), exports);
6
6
  tslib_1.__exportStar(require("./billing-line-item"), exports);
7
7
  tslib_1.__exportStar(require("./billing-line-item-schema"), exports);
8
+ tslib_1.__exportStar(require("./billing-to-party"), exports);
8
9
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/models/billing/index.ts"],"names":[],"mappings":";;;AAAA,+DAAqC;AACrC,sEAA4C;AAC5C,8DAAoC;AACpC,qEAA2C"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/models/billing/index.ts"],"names":[],"mappings":";;;AAAA,+DAAqC;AACrC,sEAA4C;AAC5C,8DAAoC;AACpC,qEAA2C;AAC3C,6DAAmC"}
@@ -0,0 +1,9 @@
1
+ /** @description Specifies which payment method is permitted when Collect on Delivery (COD) is requested on a shipment */
2
+ export declare enum CodPaymentType {
3
+ /** @description Any payment method is permitted */
4
+ Any = "any",
5
+ /** @description Only cash is permitted */
6
+ Cash = "cash",
7
+ /** @description Only guaranteed funds are permitted, such as a money order or cashier's check */
8
+ GuaranteedFunds = "guaranteed_funds"
9
+ }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CodPaymentType = void 0;
4
+ /** @description Specifies which payment method is permitted when Collect on Delivery (COD) is requested on a shipment */
5
+ var CodPaymentType;
6
+ (function (CodPaymentType) {
7
+ /** @description Any payment method is permitted */
8
+ CodPaymentType["Any"] = "any";
9
+ /** @description Only cash is permitted */
10
+ CodPaymentType["Cash"] = "cash";
11
+ /** @description Only guaranteed funds are permitted, such as a money order or cashier's check */
12
+ CodPaymentType["GuaranteedFunds"] = "guaranteed_funds";
13
+ })(CodPaymentType = exports.CodPaymentType || (exports.CodPaymentType = {}));
14
+ //# sourceMappingURL=cod-payment-type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cod-payment-type.js","sourceRoot":"","sources":["../../src/models/cod-payment-type.ts"],"names":[],"mappings":";;;AAAA,yHAAyH;AACzH,IAAY,cAOX;AAPD,WAAY,cAAc;IACxB,mDAAmD;IACnD,6BAAW,CAAA;IACX,0CAA0C;IAC1C,+BAAa,CAAA;IACb,iGAAiG;IACjG,sDAAoC,CAAA;AACtC,CAAC,EAPW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAOzB"}
@@ -0,0 +1,9 @@
1
+ import { CodPaymentType } from './cod-payment-type';
2
+ import { Currency } from './currency';
3
+ /** @description This model represents the option to defer payment for a shipment, otherwise known as Collect on Delivery (COD) */
4
+ export declare class CollectOnDelivery {
5
+ /** @description The payment amount for Collect on Delivery (COD) */
6
+ payment_amount: Currency;
7
+ /** @description The payment method permitted for Collect on Delivery (COD) */
8
+ payment_type?: CodPaymentType;
9
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CollectOnDelivery = void 0;
4
+ /** @description This model represents the option to defer payment for a shipment, otherwise known as Collect on Delivery (COD) */
5
+ class CollectOnDelivery {
6
+ }
7
+ exports.CollectOnDelivery = CollectOnDelivery;
8
+ //# sourceMappingURL=collect-on-delivery.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collect-on-delivery.js","sourceRoot":"","sources":["../../src/models/collect-on-delivery.ts"],"names":[],"mappings":";;;AAGA,kIAAkI;AAClI,MAAa,iBAAiB;CAK7B;AALD,8CAKC"}
@@ -5,6 +5,8 @@ export declare class CustomsCharges {
5
5
  freight_charge?: Currency;
6
6
  /** @description Other charge for international shipments. */
7
7
  other_charge?: Currency;
8
+ /** @description : Description for other charge for international shipments.*/
9
+ other_charge_description?: string;
8
10
  /** @description Insurance charge for international shipments. */
9
11
  insurance_charge?: Currency;
10
12
  /** @description Discount for international shipments. */
@@ -1 +1 @@
1
- {"version":3,"file":"customs-charges.js","sourceRoot":"","sources":["../../../src/models/customs/customs-charges.ts"],"names":[],"mappings":";;;AAEA,2EAA2E;AAC3E,MAAa,cAAc;CAS1B;AATD,wCASC"}
1
+ {"version":3,"file":"customs-charges.js","sourceRoot":"","sources":["../../../src/models/customs/customs-charges.ts"],"names":[],"mappings":";;;AAEA,2EAA2E;AAC3E,MAAa,cAAc;CAW1B;AAXD,wCAWC"}
@@ -20,7 +20,7 @@ export declare class Customs {
20
20
  /** @description Declaration statement to be placed on the commercial invoice */
21
21
  declaration?: string;
22
22
  /** @description Incoterms specify who is responsible for paying for and managing the shipment*/
23
- termsOfTradeCode?: TermsOfTradeCode;
23
+ terms_of_trade_code?: TermsOfTradeCode;
24
24
  /** @description The owner or purchaser of the products being imported into a destination country.*/
25
25
  importer_of_record?: ImporterOfRecord;
26
26
  /** @description The charges related with customs.*/
@@ -1,6 +1,8 @@
1
1
  export * from './addresses';
2
2
  export * from './advanced-options';
3
3
  export * from './authorization';
4
+ export * from './cod-payment-type';
5
+ export * from './collect-on-delivery';
4
6
  export * from './billing';
5
7
  export * from './confirmation-types';
6
8
  export * from './currency-schema';
@@ -18,6 +20,7 @@ export * from './inbound-content-types';
18
20
  export * from './insurance-providers';
19
21
  export * from './labels';
20
22
  export * from './manifests';
23
+ export * from './native-rating';
21
24
  export * from './package';
22
25
  export * from './pickup';
23
26
  export * from './rates';
@@ -30,3 +33,4 @@ export * from './time-window-schema';
30
33
  export * from './time-window';
31
34
  export * from './tracking';
32
35
  export * from './units';
36
+ export * from './bill-to';
@@ -4,6 +4,8 @@ const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./addresses"), exports);
5
5
  tslib_1.__exportStar(require("./advanced-options"), exports);
6
6
  tslib_1.__exportStar(require("./authorization"), exports);
7
+ tslib_1.__exportStar(require("./cod-payment-type"), exports);
8
+ tslib_1.__exportStar(require("./collect-on-delivery"), exports);
7
9
  tslib_1.__exportStar(require("./billing"), exports);
8
10
  tslib_1.__exportStar(require("./confirmation-types"), exports);
9
11
  tslib_1.__exportStar(require("./currency-schema"), exports);
@@ -21,6 +23,7 @@ tslib_1.__exportStar(require("./inbound-content-types"), exports);
21
23
  tslib_1.__exportStar(require("./insurance-providers"), exports);
22
24
  tslib_1.__exportStar(require("./labels"), exports);
23
25
  tslib_1.__exportStar(require("./manifests"), exports);
26
+ tslib_1.__exportStar(require("./native-rating"), exports);
24
27
  tslib_1.__exportStar(require("./package"), exports);
25
28
  tslib_1.__exportStar(require("./pickup"), exports);
26
29
  tslib_1.__exportStar(require("./rates"), exports);
@@ -33,4 +36,5 @@ tslib_1.__exportStar(require("./time-window-schema"), exports);
33
36
  tslib_1.__exportStar(require("./time-window"), exports);
34
37
  tslib_1.__exportStar(require("./tracking"), exports);
35
38
  tslib_1.__exportStar(require("./units"), exports);
39
+ tslib_1.__exportStar(require("./bill-to"), exports);
36
40
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":";;;AAAA,sDAA4B;AAC5B,6DAAmC;AACnC,0DAAgC;AAChC,oDAA0B;AAC1B,+DAAqC;AACrC,4DAAkC;AAClC,qDAA2B;AAC3B,oDAA0B;AAC1B,kEAAwC;AACxC,2DAAiC;AACjC,sDAA4B;AAC5B,mDAAyB;AACzB,8DAAoC;AACpC,8DAAoC;AACpC,uDAA6B;AAC7B,yEAA+C;AAC/C,kEAAwC;AACxC,gEAAsC;AACtC,mDAAyB;AACzB,sDAA4B;AAC5B,oDAA0B;AAC1B,mDAAyB;AACzB,kDAAwB;AACxB,yDAA+B;AAC/B,yDAA+B;AAC/B,qEAA2C;AAC3C,8DAAoC;AACpC,kDAAwB;AACxB,+DAAqC;AACrC,wDAA8B;AAC9B,qDAA2B;AAC3B,kDAAwB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":";;;AAAA,sDAA4B;AAC5B,6DAAmC;AACnC,0DAAgC;AAChC,6DAAmC;AACnC,gEAAsC;AACtC,oDAA0B;AAC1B,+DAAqC;AACrC,4DAAkC;AAClC,qDAA2B;AAC3B,oDAA0B;AAC1B,kEAAwC;AACxC,2DAAiC;AACjC,sDAA4B;AAC5B,mDAAyB;AACzB,8DAAoC;AACpC,8DAAoC;AACpC,uDAA6B;AAC7B,yEAA+C;AAC/C,kEAAwC;AACxC,gEAAsC;AACtC,mDAAyB;AACzB,sDAA4B;AAC5B,0DAAgC;AAChC,oDAA0B;AAC1B,mDAAyB;AACzB,kDAAwB;AACxB,yDAA+B;AAC/B,yDAA+B;AAC/B,qEAA2C;AAC3C,8DAAoC;AACpC,kDAAwB;AACxB,+DAAqC;AACrC,wDAA8B;AAC9B,qDAA2B;AAC3B,kDAAwB;AACxB,oDAA0B"}
@@ -0,0 +1,3 @@
1
+ export interface ContextResults<T> {
2
+ [dataKey: string]: T;
3
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=context-results.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-results.js","sourceRoot":"","sources":["../../../src/models/native-rating/context-results.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ import { ContextResults } from './context-results';
2
+ import { NumericCurrency } from './numeric-currency';
3
+ export type GetRatesResults = ContextResults<NumericCurrency>;
4
+ /** Function to get rates from the context */
5
+ export interface GetRates {
6
+ (dataKeys: string[]): Promise<GetRatesResults>;
7
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=get-rates.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-rates.js","sourceRoot":"","sources":["../../../src/models/native-rating/get-rates.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ import { ContextResults } from './context-results';
2
+ export type GetVariableResults = ContextResults<any>;
3
+ /** Function to get rating variables from the context */
4
+ export interface GetVariables {
5
+ (dataKeys: string[]): Promise<GetVariableResults>;
6
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=get-variables.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-variables.js","sourceRoot":"","sources":["../../../src/models/native-rating/get-variables.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ import { ContextResults } from './context-results';
2
+ export type GetZoneResults = ContextResults<any>;
3
+ /** Function to get zone data from the context */
4
+ export interface GetZone {
5
+ (dataKeys: string[]): Promise<GetZoneResults>;
6
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=get-zone.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-zone.js","sourceRoot":"","sources":["../../../src/models/native-rating/get-zone.ts"],"names":[],"mappings":""}
@@ -0,0 +1,30 @@
1
+ import type { GetRatesRequest, Rate } from '@shipengine/connect-carrier-api';
2
+ import type { RatingContext } from './rating-context';
3
+ /** A rate request shipment with its corresponding id */
4
+ export interface ShipmentAndId {
5
+ /** rate_request_identifier for the rate request */
6
+ id: string;
7
+ /** Shipment for the rate request */
8
+ shipment: GetRatesRequest;
9
+ }
10
+ /** Rate results with its corresponding rate request id */
11
+ export interface RateResultsAndId {
12
+ /** rate_request_identifier for the corresponding rate request */
13
+ id: string;
14
+ /** Error, if any */
15
+ error?: unknown;
16
+ /** Rates for a given rate request */
17
+ rates: Rate[];
18
+ }
19
+ /** Implementation of a carrier */
20
+ export interface RatingCarrier {
21
+ /** Rate shipments
22
+ * @param context Native Rating context that can be used by the implementation to interact with the underlying service
23
+ * @param shipment Shipments that should be rated
24
+ * @returns List of rates for the given shipments
25
+ */
26
+ rateShipments: (context: RatingContext, shipment: ShipmentAndId[]) => Promise<RateResultsAndId[]>;
27
+ }
28
+ /** Signify a validation error from the carrier */
29
+ export declare class CarrierValidationError extends Error {
30
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CarrierValidationError = void 0;
4
+ /** Signify a validation error from the carrier */
5
+ class CarrierValidationError extends Error {
6
+ }
7
+ exports.CarrierValidationError = CarrierValidationError;
8
+ //# sourceMappingURL=implementation-type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"implementation-type.js","sourceRoot":"","sources":["../../../src/models/native-rating/implementation-type.ts"],"names":[],"mappings":";;;AA+BA,kDAAkD;AAClD,MAAa,sBAAuB,SAAQ,KAAK;CAAG;AAApD,wDAAoD"}
@@ -0,0 +1,7 @@
1
+ export * from './context-results';
2
+ export * from './get-rates';
3
+ export * from './get-variables';
4
+ export * from './get-zone';
5
+ export * from './implementation-type';
6
+ export * from './numeric-currency';
7
+ export * from './rating-context';
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./context-results"), exports);
5
+ tslib_1.__exportStar(require("./get-rates"), exports);
6
+ tslib_1.__exportStar(require("./get-variables"), exports);
7
+ tslib_1.__exportStar(require("./get-zone"), exports);
8
+ tslib_1.__exportStar(require("./implementation-type"), exports);
9
+ tslib_1.__exportStar(require("./numeric-currency"), exports);
10
+ tslib_1.__exportStar(require("./rating-context"), exports);
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/models/native-rating/index.ts"],"names":[],"mappings":";;;AAAA,4DAAkC;AAClC,sDAA4B;AAC5B,0DAAgC;AAChC,qDAA2B;AAC3B,gEAAsC;AACtC,6DAAmC;AACnC,2DAAiC"}
@@ -0,0 +1,5 @@
1
+ /** NumericCurrency so that we don't have to convert from the string Currency all over the place */
2
+ export interface NumericCurrency {
3
+ currency: string;
4
+ amount: number | undefined;
5
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=numeric-currency.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"numeric-currency.js","sourceRoot":"","sources":["../../../src/models/native-rating/numeric-currency.ts"],"names":[],"mappings":""}
@@ -0,0 +1,15 @@
1
+ import { Logger } from 'winston';
2
+ import { GetVariables } from './get-variables';
3
+ import { GetRates } from './get-rates';
4
+ import { GetZone } from './get-zone';
5
+ /** Rates request context */
6
+ export interface RatingContext {
7
+ /** Function to get rates for given keys */
8
+ getRates: GetRates;
9
+ /** Function to get variables for given keys */
10
+ getVariables: GetVariables;
11
+ /** Function to get zone for given keys */
12
+ getZone: GetZone;
13
+ /** Logger that implementers can use */
14
+ log: Logger;
15
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=rating-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rating-context.js","sourceRoot":"","sources":["../../../src/models/native-rating/rating-context.ts"],"names":[],"mappings":""}
@@ -5,8 +5,10 @@ export declare class TaxIdentifier {
5
5
  id: string;
6
6
  /** @description The Tax ID type */
7
7
  type: TaxIdentifierType;
8
- /** @description The country where the Tax ID is registered with */
8
+ /** @deprecated This property has been deprecated, please use registration_country instead */
9
9
  registration_county?: string;
10
+ /** @description The country where the Tax ID is registered with */
11
+ registration_country?: string;
10
12
  /** @description Description of the tax ID that may give the customs agent more context */
11
13
  description?: string;
12
14
  }
@@ -1 +1 @@
1
- {"version":3,"file":"tax-identifier.js","sourceRoot":"","sources":["../../../src/models/taxes/tax-identifier.ts"],"names":[],"mappings":";;;AAEA,sGAAsG;AACtG,MAAa,aAAa;CASzB;AATD,sCASC"}
1
+ {"version":3,"file":"tax-identifier.js","sourceRoot":"","sources":["../../../src/models/taxes/tax-identifier.ts"],"names":[],"mappings":";;;AAEA,sGAAsG;AACtG,MAAa,aAAa;CAWzB;AAXD,sCAWC"}
@@ -1,5 +1,5 @@
1
1
  import { BaseRequest } from './base-request';
2
- import { AdvancedOptions, ConfirmationTypes, FulfillmentPlanDetails, InsuranceProviders, DocumentFormat, LabelLayouts, Package, ReturnLabelDetails, ShipFrom, PudoLocation, ShipFromDisplay, ShipTo, Document, TimeWindow, RelayPointDetails, DisplayScheme, Customs } from '../models';
2
+ import { AdvancedOptions, ConfirmationTypes, FulfillmentPlanDetails, InsuranceProviders, DocumentFormat, LabelLayouts, Package, ReturnLabelDetails, ShipFrom, PudoLocation, ShipFromDisplay, ShipTo, Document, TimeWindow, RelayPointDetails, DisplayScheme, Customs, BillTo } from '../models';
3
3
  /** @description Basic structure for a request to create a label */
4
4
  export declare class CreateLabelRequest extends BaseRequest {
5
5
  service_code?: string;
@@ -35,4 +35,6 @@ export declare class CreateLabelRequest extends BaseRequest {
35
35
  /** @description Display schemes that the label will be returned in. Label is returned by default */
36
36
  display_schemes?: DisplayScheme[];
37
37
  customs?: Customs;
38
+ /** @description Bill the shipping charges to this entity. If null, it should be assumed the "shipper" is responsible for the shipping charges. */
39
+ bill_shipping_to?: BillTo;
38
40
  }
@@ -1 +1 @@
1
- {"version":3,"file":"create-label-request.js","sourceRoot":"","sources":["../../src/requests/create-label-request.ts"],"names":[],"mappings":";;;AAAA,iDAA6C;AAqB7C,mEAAmE;AACnE,MAAa,kBAAmB,SAAQ,0BAAW;CAkClD;AAlCD,gDAkCC"}
1
+ {"version":3,"file":"create-label-request.js","sourceRoot":"","sources":["../../src/requests/create-label-request.ts"],"names":[],"mappings":";;;AAAA,iDAA6C;AAsB7C,mEAAmE;AACnE,MAAa,kBAAmB,SAAQ,0BAAW;CAoClD;AApCD,gDAoCC"}
@@ -1,5 +1,5 @@
1
1
  import { BaseRequest } from './base-request';
2
- import { ConfirmationTypes, AdvancedOptions, InsuranceProviders, Package, Customs, ShipFrom, ShipTo, PudoLocation, FulfillmentPlanDetails, TimeWindow } from '../models';
2
+ import { ConfirmationTypes, AdvancedOptions, InsuranceProviders, Package, Customs, ShipFrom, ShipTo, PudoLocation, FulfillmentPlanDetails, TimeWindow, BillTo } from '../models';
3
3
  import { ShipmentItem } from '../models/shipment-item';
4
4
  /** @description Basic structure for a request to get rates */
5
5
  export declare class GetRatesRequest extends BaseRequest {
@@ -21,4 +21,6 @@ export declare class GetRatesRequest extends BaseRequest {
21
21
  carrier_pickup_window?: TimeWindow;
22
22
  /** Items included in the shipment */
23
23
  items?: ShipmentItem[];
24
+ /** @description Bill the shipping charges to this entity. If null, it should be assumed the "shipper" is responsible for the shipping charges. */
25
+ bill_shipping_to?: BillTo;
24
26
  }
@@ -1 +1 @@
1
- {"version":3,"file":"get-rates-request.js","sourceRoot":"","sources":["../../src/requests/get-rates-request.ts"],"names":[],"mappings":";;;AAAA,iDAA6C;AAe7C,8DAA8D;AAC9D,MAAa,eAAgB,SAAQ,0BAAW;CAmB/C;AAnBD,0CAmBC"}
1
+ {"version":3,"file":"get-rates-request.js","sourceRoot":"","sources":["../../src/requests/get-rates-request.ts"],"names":[],"mappings":";;;AAAA,iDAA6C;AAgB7C,8DAA8D;AAC9D,MAAa,eAAgB,SAAQ,0BAAW;CAqB/C;AArBD,0CAqBC"}
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@shipengine/connect-carrier-api",
3
- "version": "4.0.0-beta.2",
3
+ "version": "4.0.0",
4
4
  "description": "This is the typescript/javascript definitions for carrier api",
5
- "homepage": "https://github.com/ShipEngine/connect",
5
+ "homepage": "https://connect.shipengine.com",
6
6
  "main": "./lib/index.js",
7
7
  "types": "./lib/index.d.ts",
8
8
  "scripts": {
@@ -37,14 +37,14 @@
37
37
  "vitest": "^0.23.4"
38
38
  },
39
39
  "optionalDependencies": {
40
- "vm2": "^3.9.16"
40
+ "vm2": "^3.9.18"
41
41
  },
42
42
  "dependencies": {
43
43
  "joi": "^17.4.2",
44
44
  "tslib": "^2.5.0"
45
45
  },
46
46
  "peerDependencies": {
47
- "@shipengine/connect-runtime": "^4.0.0-beta.2",
47
+ "@shipengine/connect-runtime": "^4.0.0",
48
48
  "express": "^4.18.2",
49
49
  "winston": "^3.8.2"
50
50
  }