@shipengine/alchemy 5.4.3 → 5.4.4

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 (3) hide show
  1. package/index.js +27 -3
  2. package/index.mjs +27 -4
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -16215,8 +16215,9 @@ class FundingSourcesAPI {
16215
16215
  */
16216
16216
  this.create = (createFundingSource) => __async$J(this, null, function* () {
16217
16217
  const endUserIpAddress = yield getEndUserIpAddress();
16218
- if (!endUserIpAddress)
16218
+ if (!endUserIpAddress) {
16219
16219
  return Promise.reject([new CodedError("Unable to get IP address")]);
16220
+ }
16220
16221
  return yield this.client.post("/v1/funding_sources", __spreadValues$b({
16221
16222
  endUserIpAddress
16222
16223
  }, createFundingSource));
@@ -16228,8 +16229,9 @@ class FundingSourcesAPI {
16228
16229
  */
16229
16230
  this.update = (billingInfo, creditCardInfo, fundingSourceId) => __async$J(this, null, function* () {
16230
16231
  const endUserIpAddress = yield getEndUserIpAddress();
16231
- if (!endUserIpAddress)
16232
+ if (!endUserIpAddress) {
16232
16233
  return Promise.reject([new CodedError("Unable to get IP address")]);
16234
+ }
16233
16235
  return yield this.client.put(
16234
16236
  `/v1/funding_sources/${fundingSourceId}`,
16235
16237
  {
@@ -16245,8 +16247,9 @@ class FundingSourcesAPI {
16245
16247
  */
16246
16248
  this.registerCarrier = (carrier) => __async$J(this, null, function* () {
16247
16249
  const endUserIpAddress = yield getEndUserIpAddress();
16248
- if (!endUserIpAddress)
16250
+ if (!endUserIpAddress) {
16249
16251
  return Promise.reject([new CodedError("Unable to get IP address")]);
16252
+ }
16250
16253
  return yield this.client.post("/v1/registration/funding_source", __spreadValues$b({
16251
16254
  endUserIpAddress
16252
16255
  }, carrier));
@@ -16279,6 +16282,16 @@ class FundingSourcesAPI {
16279
16282
  }
16280
16283
  );
16281
16284
  };
16285
+ /**
16286
+ * Now we can attach insurance providers to the user's Funding Source.
16287
+ * This endpoint will retrieve all accepted insurance terms. For example
16288
+ * if "ParcelGuard" appears here that means the user its using it.
16289
+ */
16290
+ this.insuranceAcceptedTerms = () => {
16291
+ return this.client.get(
16292
+ "/v1/insurance/funding_source/accepted_terms"
16293
+ );
16294
+ };
16282
16295
  this.client = client;
16283
16296
  }
16284
16297
  }
@@ -35218,6 +35231,16 @@ const useGetFundingSourceTransactions = (fundingSourceId, params) => {
35218
35231
  });
35219
35232
  };
35220
35233
 
35234
+ const useGetInsuranceFundingSourceAcceptedTerms = () => {
35235
+ const { client } = useShipEngine();
35236
+ return reactQuery.useQuery({
35237
+ onError,
35238
+ queryFn: () => client.fundingSources.insuranceAcceptedTerms(),
35239
+ queryKey: ["useGetInsuranceFundingSourceAcceptedTerms"],
35240
+ select: (result) => result.data
35241
+ });
35242
+ };
35243
+
35221
35244
  const useGetInsuranceAccount = (insuranceProvider) => {
35222
35245
  const { client } = useShipEngine();
35223
35246
  return reactQuery.useQuery({
@@ -37912,6 +37935,7 @@ exports.useGetFundingSourceById = useGetFundingSourceById;
37912
37935
  exports.useGetFundingSourceMetadata = useGetFundingSourceMetadata;
37913
37936
  exports.useGetFundingSourceTransactions = useGetFundingSourceTransactions;
37914
37937
  exports.useGetInsuranceAccount = useGetInsuranceAccount;
37938
+ exports.useGetInsuranceFundingSourceAcceptedTerms = useGetInsuranceFundingSourceAcceptedTerms;
37915
37939
  exports.useGetLabel = useGetLabel;
37916
37940
  exports.useGetPackageRatingGroupByCarrier = useGetPackageRatingGroupByCarrier;
37917
37941
  exports.useGetRateCardById = useGetRateCardById;
package/index.mjs CHANGED
@@ -16193,8 +16193,9 @@ class FundingSourcesAPI {
16193
16193
  */
16194
16194
  this.create = (createFundingSource) => __async$J(this, null, function* () {
16195
16195
  const endUserIpAddress = yield getEndUserIpAddress();
16196
- if (!endUserIpAddress)
16196
+ if (!endUserIpAddress) {
16197
16197
  return Promise.reject([new CodedError("Unable to get IP address")]);
16198
+ }
16198
16199
  return yield this.client.post("/v1/funding_sources", __spreadValues$b({
16199
16200
  endUserIpAddress
16200
16201
  }, createFundingSource));
@@ -16206,8 +16207,9 @@ class FundingSourcesAPI {
16206
16207
  */
16207
16208
  this.update = (billingInfo, creditCardInfo, fundingSourceId) => __async$J(this, null, function* () {
16208
16209
  const endUserIpAddress = yield getEndUserIpAddress();
16209
- if (!endUserIpAddress)
16210
+ if (!endUserIpAddress) {
16210
16211
  return Promise.reject([new CodedError("Unable to get IP address")]);
16212
+ }
16211
16213
  return yield this.client.put(
16212
16214
  `/v1/funding_sources/${fundingSourceId}`,
16213
16215
  {
@@ -16223,8 +16225,9 @@ class FundingSourcesAPI {
16223
16225
  */
16224
16226
  this.registerCarrier = (carrier) => __async$J(this, null, function* () {
16225
16227
  const endUserIpAddress = yield getEndUserIpAddress();
16226
- if (!endUserIpAddress)
16228
+ if (!endUserIpAddress) {
16227
16229
  return Promise.reject([new CodedError("Unable to get IP address")]);
16230
+ }
16228
16231
  return yield this.client.post("/v1/registration/funding_source", __spreadValues$b({
16229
16232
  endUserIpAddress
16230
16233
  }, carrier));
@@ -16257,6 +16260,16 @@ class FundingSourcesAPI {
16257
16260
  }
16258
16261
  );
16259
16262
  };
16263
+ /**
16264
+ * Now we can attach insurance providers to the user's Funding Source.
16265
+ * This endpoint will retrieve all accepted insurance terms. For example
16266
+ * if "ParcelGuard" appears here that means the user its using it.
16267
+ */
16268
+ this.insuranceAcceptedTerms = () => {
16269
+ return this.client.get(
16270
+ "/v1/insurance/funding_source/accepted_terms"
16271
+ );
16272
+ };
16260
16273
  this.client = client;
16261
16274
  }
16262
16275
  }
@@ -35196,6 +35209,16 @@ const useGetFundingSourceTransactions = (fundingSourceId, params) => {
35196
35209
  });
35197
35210
  };
35198
35211
 
35212
+ const useGetInsuranceFundingSourceAcceptedTerms = () => {
35213
+ const { client } = useShipEngine();
35214
+ return useQuery({
35215
+ onError,
35216
+ queryFn: () => client.fundingSources.insuranceAcceptedTerms(),
35217
+ queryKey: ["useGetInsuranceFundingSourceAcceptedTerms"],
35218
+ select: (result) => result.data
35219
+ });
35220
+ };
35221
+
35199
35222
  const useGetInsuranceAccount = (insuranceProvider) => {
35200
35223
  const { client } = useShipEngine();
35201
35224
  return useQuery({
@@ -37797,4 +37820,4 @@ const alchemy = {
37797
37820
  createElement
37798
37821
  };
37799
37822
 
37800
- export { AccountSettingsAPI, AddressesAPI, AlchemyContext, AlchemyProvider, AlchemyTestProvider, CarriersAPI, CodedError, ConfirmationType, ConnectionsAPI, CreditCardVendor, Currency, CustomPackagesAPI, CustomsContentsType, CustomsNonDeliveryType, Element, ErrorBoundary, FundingSourcesAPI, InsuranceAPI, InsuranceProviderType, LabelsAPI, MetadataCapability, MetadataRequirement, MetadataSatisfyingFormTypes, OrderSourcesAPI, RateCardStatus, RateCardsAPI, RatesAPI, types as SE, SalesOrderShipmentsAPI, SalesOrdersAPI, SellersAPI, ServicePointsAPI, ShipEngine, ShipEngineAPI, ShipEngineContext, ShipmentsAPI, ShippingRulesAPI, ThemesAPI, WarehousesAPI, WebhooksAPI, alchemy, alchemy as default, delay, getEmotionCache, getEndUserIpAddress, isCodedError, isCodedErrors, isDataCodedErrors, isInvalidTokenError, logger, onError, parseError, retryUntil, useAddFunds, useAddInsuranceFunds, useAddSandboxCarriers, useAlchemy, useCalculateRates, useCarrierConnectionsServicesList, useConnectCarrier, useConnectCarrierAccount, useCreateAccountImage, useCreateFundingSource, useCreateLabel, useCreateRateCard, useCreateSalesOrderShipment, useCreateSandboxSeller, useCreateShipment, useCreateShippingRule, useCreateWarehouse, useCreateWebhook, useDeactivateOrderSource, useDeleteAccountImage, useDeleteCarrier, useDeleteRateCard, useDeleteShippingRule, useDeleteWarehouse, useDeleteWebhook, useDownloadRateCard, useEditShippingRule, useFundingSourcesAddFunds, useGetAccountBillingPlan, useGetAccountImages, useGetAccountSettings, useGetAutoFundingConfiguration, useGetCarrierById, useGetCarrierConnectionForm, useGetCountriesByCarrier, useGetCurrenciesByCarrier, useGetFundingSourceById, useGetFundingSourceMetadata, useGetFundingSourceTransactions, useGetInsuranceAccount, useGetLabel, useGetPackageRatingGroupByCarrier, useGetRateCardById, useGetSalesOrder, useGetSalesOrderShipment, useGetServicePoint, useGetServicesByCarrier, useGetShipment, useGetShipmentRates, useGetShippingRuleById, useGetShippingRuleConditionsOptions, useGetThemeById, useGetZonesByCarrier, useI18n, useListCarrierConnections, useListCarriers, useListCustomPackageTypes, useListFundingSources, useListLabels, useListOrderSources, useListRateCards, useListSalesOrderShipments, useListSalesOrders, useListSandboxSellerIds, useListServicePoints, useListShipments, useListShippingRules, useListWarehouses, useListWebhooks, useLoadIcons, useNotifySalesOrderShipped, useParseAddress, usePublishRateCard, useRefreshOrderSource, useRefreshOrderSourceAsync, useRegisterCarrier, useShipEngine, useUpdateAccountBillingPlan, useUpdateAccountImage, useUpdateAccountSettings, useUpdateAutoFunding, useUpdateFundingSource, useUpdateRateCard, useUpdateSalesOrderShipment, useUpdateWarehouse, useUpdateWebhook, useUploadRateCard, useValidateAddresses, useVoidLabel };
37823
+ export { AccountSettingsAPI, AddressesAPI, AlchemyContext, AlchemyProvider, AlchemyTestProvider, CarriersAPI, CodedError, ConfirmationType, ConnectionsAPI, CreditCardVendor, Currency, CustomPackagesAPI, CustomsContentsType, CustomsNonDeliveryType, Element, ErrorBoundary, FundingSourcesAPI, InsuranceAPI, InsuranceProviderType, LabelsAPI, MetadataCapability, MetadataRequirement, MetadataSatisfyingFormTypes, OrderSourcesAPI, RateCardStatus, RateCardsAPI, RatesAPI, types as SE, SalesOrderShipmentsAPI, SalesOrdersAPI, SellersAPI, ServicePointsAPI, ShipEngine, ShipEngineAPI, ShipEngineContext, ShipmentsAPI, ShippingRulesAPI, ThemesAPI, WarehousesAPI, WebhooksAPI, alchemy, alchemy as default, delay, getEmotionCache, getEndUserIpAddress, isCodedError, isCodedErrors, isDataCodedErrors, isInvalidTokenError, logger, onError, parseError, retryUntil, useAddFunds, useAddInsuranceFunds, useAddSandboxCarriers, useAlchemy, useCalculateRates, useCarrierConnectionsServicesList, useConnectCarrier, useConnectCarrierAccount, useCreateAccountImage, useCreateFundingSource, useCreateLabel, useCreateRateCard, useCreateSalesOrderShipment, useCreateSandboxSeller, useCreateShipment, useCreateShippingRule, useCreateWarehouse, useCreateWebhook, useDeactivateOrderSource, useDeleteAccountImage, useDeleteCarrier, useDeleteRateCard, useDeleteShippingRule, useDeleteWarehouse, useDeleteWebhook, useDownloadRateCard, useEditShippingRule, useFundingSourcesAddFunds, useGetAccountBillingPlan, useGetAccountImages, useGetAccountSettings, useGetAutoFundingConfiguration, useGetCarrierById, useGetCarrierConnectionForm, useGetCountriesByCarrier, useGetCurrenciesByCarrier, useGetFundingSourceById, useGetFundingSourceMetadata, useGetFundingSourceTransactions, useGetInsuranceAccount, useGetInsuranceFundingSourceAcceptedTerms, useGetLabel, useGetPackageRatingGroupByCarrier, useGetRateCardById, useGetSalesOrder, useGetSalesOrderShipment, useGetServicePoint, useGetServicesByCarrier, useGetShipment, useGetShipmentRates, useGetShippingRuleById, useGetShippingRuleConditionsOptions, useGetThemeById, useGetZonesByCarrier, useI18n, useListCarrierConnections, useListCarriers, useListCustomPackageTypes, useListFundingSources, useListLabels, useListOrderSources, useListRateCards, useListSalesOrderShipments, useListSalesOrders, useListSandboxSellerIds, useListServicePoints, useListShipments, useListShippingRules, useListWarehouses, useListWebhooks, useLoadIcons, useNotifySalesOrderShipped, useParseAddress, usePublishRateCard, useRefreshOrderSource, useRefreshOrderSourceAsync, useRegisterCarrier, useShipEngine, useUpdateAccountBillingPlan, useUpdateAccountImage, useUpdateAccountSettings, useUpdateAutoFunding, useUpdateFundingSource, useUpdateRateCard, useUpdateSalesOrderShipment, useUpdateWarehouse, useUpdateWebhook, useUploadRateCard, useValidateAddresses, useVoidLabel };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipengine/alchemy",
3
- "version": "5.4.3",
3
+ "version": "5.4.4",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {