arky-sdk 0.4.40 → 0.4.42
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/dist/index.cjs +33 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -3
- package/dist/index.d.ts +9 -3
- package/dist/index.js +33 -0
- package/dist/index.js.map +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +84 -7
- package/dist/types.d.ts +84 -7
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { RequestOptions, MagicLinkVerifyParams, MagicLinkRequestParams, UpdateAccountProfileParams, DeleteAccountParams, AddPhoneNumberParams, PhoneNumberConfirmParams, GetMeParams, SearchAccountsParams, AccountSubscribeParams, CreateBusinessParams, UpdateBusinessParams, DeleteBusinessParams, GetBusinessParams, GetBusinessesParams, GetBusinessParentsParams, TriggerBuildsParams, GetSubscriptionPlansParams, GetSubscriptionParams, SubscribeParams, CreatePortalSessionParams, InviteUserParams, HandleInvitationParams, TestWebhookParams, GetBusinessMediaParams2, ProcessRefundParams, GetBusinessEventsParams, UpdateBusinessEventParams, ConnectStripeParams, DisconnectStripeParams, UploadBusinessMediaParams, DeleteBusinessMediaParams, GetBusinessMediaParams, UpdateMediaParams, TrackEmailOpenParams, GetDeliveryStatsParams, CreatePromoCodeParams, UpdatePromoCodeParams, DeletePromoCodeParams, GetPromoCodeParams, GetPromoCodesParams, CreateNodeParams, UpdateNodeParams, DeleteNodeParams, GetNodeParams, GetNodesParams, GetNodeChildrenParams, GenerateBlocksParams, GetVariableMetadataParams, CreateProductParams, UpdateProductParams, DeleteProductParams, GetProductParams, GetProductsParams, CreateOrderParams, UpdateOrderParams, GetOrderParams, GetOrdersParams, GetQuoteParams, OrderCheckoutParams, Slot, CreateReservationParams, UpdateReservationParams, ReservationCheckoutParams, GetReservationParams, SearchReservationsParams, GetReservationQuoteParams, CreateServiceParams, UpdateServiceParams, DeleteServiceParams, BulkScheduleParams, GetServiceParams, GetServicesParams, CreateProviderParams, UpdateProviderParams, DeleteProviderParams, GetProviderParams, GetProvidersParams, GetBusinessServiceWorkingTimeParams, CreateWorkflowParams, UpdateWorkflowParams, DeleteWorkflowParams, GetWorkflowParams, GetWorkflowsParams, TriggerWorkflowParams, CreateAudienceParams, UpdateAudienceParams, GetAudienceParams, GetAudiencesParams, SubscribeAudienceParams, GetAudienceSubscribersParams, RevokeAudienceSubscriptionParams } from './types.cjs';
|
|
2
|
-
export { Access, AnalyticsConfig, ApiResponse, Audience, AudienceAccessResponse, AudienceSubscribeResponse, AudienceSubscriber, Block, Business, BusinessConfig, BusinessEvent, BusinessEventAction, DayAvailability, EshopCartItem, EshopStoreState, GetAvailabilityParams, GetSlotsForDateParams, Language, Location, Market, Media, MediaResolution, Node, PaginatedResponse, Payment, PaymentMethod, PaymentMethodType, PaymentProviderConfig, PaymentRefund, Price, PromoCodeValidation, ProviderWithTimeline, Quote, ReservationCartItem, ReservationStoreState, ShippingMethod, ShippingWeightTier, SystemTemplateKey, Workflow, WorkflowEdge, WorkflowHttpMethod, WorkflowHttpNode, WorkflowIfNode, WorkflowLoopNode, WorkflowNode, WorkflowTriggerNode, WorkflowWaitNode, Zone } from './types.cjs';
|
|
1
|
+
import { RequestOptions, MagicLinkVerifyParams, MagicLinkRequestParams, UpdateAccountProfileParams, DeleteAccountParams, AddPhoneNumberParams, PhoneNumberConfirmParams, GetMeParams, SearchAccountsParams, AccountSubscribeParams, CreateBusinessParams, UpdateBusinessParams, DeleteBusinessParams, GetBusinessParams, GetBusinessesParams, GetBusinessParentsParams, TriggerBuildsParams, GetSubscriptionPlansParams, GetSubscriptionParams, SubscribeParams, CreatePortalSessionParams, InviteUserParams, HandleInvitationParams, TestWebhookParams, GetBusinessMediaParams2, ProcessRefundParams, GetBusinessEventsParams, UpdateBusinessEventParams, ConnectStripeParams, DisconnectStripeParams, UploadBusinessMediaParams, DeleteBusinessMediaParams, GetBusinessMediaParams, UpdateMediaParams, TrackEmailOpenParams, GetDeliveryStatsParams, CreatePromoCodeParams, UpdatePromoCodeParams, DeletePromoCodeParams, GetPromoCodeParams, GetPromoCodesParams, CreateNodeParams, UpdateNodeParams, DeleteNodeParams, GetNodeParams, GetNodesParams, GetNodeChildrenParams, GenerateBlocksParams, GetVariableMetadataParams, CreateProductParams, UpdateProductParams, DeleteProductParams, GetProductParams, GetProductsParams, CreateOrderParams, UpdateOrderParams, GetOrderParams, GetOrdersParams, GetQuoteParams, OrderCheckoutParams, Slot, CreateReservationParams, UpdateReservationParams, ReservationCheckoutParams, GetReservationParams, SearchReservationsParams, GetReservationQuoteParams, CreateServiceParams, UpdateServiceParams, DeleteServiceParams, BulkScheduleParams, GetServiceParams, GetServicesParams, CreateProviderParams, UpdateProviderParams, DeleteProviderParams, GetProviderParams, GetProvidersParams, GetBusinessServiceWorkingTimeParams, CreateWorkflowParams, UpdateWorkflowParams, DeleteWorkflowParams, GetWorkflowParams, GetWorkflowsParams, TriggerWorkflowParams, CreateAudienceParams, UpdateAudienceParams, GetAudienceParams, GetAudiencesParams, SubscribeAudienceParams, GetAudienceSubscribersParams, RevokeAudienceSubscriptionParams, GetShippingRatesParams, ShippingRate, PurchaseLabelParams, PurchaseLabelResult } from './types.cjs';
|
|
2
|
+
export { Access, AnalyticsConfig, ApiResponse, Audience, AudienceAccessResponse, AudienceSubscribeResponse, AudienceSubscriber, Block, Business, BusinessConfig, BusinessEvent, BusinessEventAction, BusinessShippingProvider, DayAvailability, EshopCartItem, EshopStoreState, GetAvailabilityParams, GetSlotsForDateParams, Language, Location, Market, Media, MediaResolution, Node, OrderShipping, PaginatedResponse, Parcel, Payment, PaymentMethod, PaymentMethodType, PaymentProviderConfig, PaymentRefund, Price, PromoCodeValidation, ProviderWithTimeline, Quote, ReservationCartItem, ReservationStoreState, ShippingAddress, ShippingMethod, ShippingProviderShippo, ShippingProviderStatus, ShippingStatus, ShippingWeightTier, SystemTemplateKey, Workflow, WorkflowEdge, WorkflowHttpMethod, WorkflowHttpNode, WorkflowIfNode, WorkflowLoopNode, WorkflowNode, WorkflowTriggerNode, WorkflowWaitNode, Zone } from './types.cjs';
|
|
3
3
|
import { f as formatPayment, a as formatMinor, g as getCurrencySymbol, b as getCurrencyName, i as isValidKey, v as validateKey, t as toKey, n as nameToKey, c as getAvailableStock, d as getReservedStock, h as hasStock, e as getInventoryAt, j as getFirstAvailableFCId } from './index-C28uWlRE.cjs';
|
|
4
4
|
|
|
5
5
|
interface AuthTokens {
|
|
@@ -287,6 +287,12 @@ declare function createArkySDK(config: HttpClientConfig & {
|
|
|
287
287
|
getSubscribers(params: GetAudienceSubscribersParams, options?: RequestOptions): Promise<any>;
|
|
288
288
|
revokeSubscription(params: RevokeAudienceSubscriptionParams, options?: RequestOptions): Promise<any>;
|
|
289
289
|
};
|
|
290
|
+
shipping: {
|
|
291
|
+
getRates(params: GetShippingRatesParams, options?: RequestOptions): Promise<{
|
|
292
|
+
rates: ShippingRate[];
|
|
293
|
+
}>;
|
|
294
|
+
purchaseLabel(params: PurchaseLabelParams, options?: RequestOptions): Promise<PurchaseLabelResult>;
|
|
295
|
+
};
|
|
290
296
|
analytics: {
|
|
291
297
|
track: typeof track;
|
|
292
298
|
};
|
|
@@ -349,4 +355,4 @@ declare function createArkySDK(config: HttpClientConfig & {
|
|
|
349
355
|
getStripeConnectClientId: () => string;
|
|
350
356
|
}>;
|
|
351
357
|
|
|
352
|
-
export { type ApiConfig, type GetCountriesResponse, type HttpClientConfig, type LocationCountry, type LocationState, SDK_VERSION, SUPPORTED_FRAMEWORKS, Slot, createArkySDK };
|
|
358
|
+
export { type ApiConfig, type GetCountriesResponse, GetShippingRatesParams, type HttpClientConfig, type LocationCountry, type LocationState, PurchaseLabelParams, PurchaseLabelResult, SDK_VERSION, SUPPORTED_FRAMEWORKS, ShippingRate, Slot, createArkySDK };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { RequestOptions, MagicLinkVerifyParams, MagicLinkRequestParams, UpdateAccountProfileParams, DeleteAccountParams, AddPhoneNumberParams, PhoneNumberConfirmParams, GetMeParams, SearchAccountsParams, AccountSubscribeParams, CreateBusinessParams, UpdateBusinessParams, DeleteBusinessParams, GetBusinessParams, GetBusinessesParams, GetBusinessParentsParams, TriggerBuildsParams, GetSubscriptionPlansParams, GetSubscriptionParams, SubscribeParams, CreatePortalSessionParams, InviteUserParams, HandleInvitationParams, TestWebhookParams, GetBusinessMediaParams2, ProcessRefundParams, GetBusinessEventsParams, UpdateBusinessEventParams, ConnectStripeParams, DisconnectStripeParams, UploadBusinessMediaParams, DeleteBusinessMediaParams, GetBusinessMediaParams, UpdateMediaParams, TrackEmailOpenParams, GetDeliveryStatsParams, CreatePromoCodeParams, UpdatePromoCodeParams, DeletePromoCodeParams, GetPromoCodeParams, GetPromoCodesParams, CreateNodeParams, UpdateNodeParams, DeleteNodeParams, GetNodeParams, GetNodesParams, GetNodeChildrenParams, GenerateBlocksParams, GetVariableMetadataParams, CreateProductParams, UpdateProductParams, DeleteProductParams, GetProductParams, GetProductsParams, CreateOrderParams, UpdateOrderParams, GetOrderParams, GetOrdersParams, GetQuoteParams, OrderCheckoutParams, Slot, CreateReservationParams, UpdateReservationParams, ReservationCheckoutParams, GetReservationParams, SearchReservationsParams, GetReservationQuoteParams, CreateServiceParams, UpdateServiceParams, DeleteServiceParams, BulkScheduleParams, GetServiceParams, GetServicesParams, CreateProviderParams, UpdateProviderParams, DeleteProviderParams, GetProviderParams, GetProvidersParams, GetBusinessServiceWorkingTimeParams, CreateWorkflowParams, UpdateWorkflowParams, DeleteWorkflowParams, GetWorkflowParams, GetWorkflowsParams, TriggerWorkflowParams, CreateAudienceParams, UpdateAudienceParams, GetAudienceParams, GetAudiencesParams, SubscribeAudienceParams, GetAudienceSubscribersParams, RevokeAudienceSubscriptionParams } from './types.js';
|
|
2
|
-
export { Access, AnalyticsConfig, ApiResponse, Audience, AudienceAccessResponse, AudienceSubscribeResponse, AudienceSubscriber, Block, Business, BusinessConfig, BusinessEvent, BusinessEventAction, DayAvailability, EshopCartItem, EshopStoreState, GetAvailabilityParams, GetSlotsForDateParams, Language, Location, Market, Media, MediaResolution, Node, PaginatedResponse, Payment, PaymentMethod, PaymentMethodType, PaymentProviderConfig, PaymentRefund, Price, PromoCodeValidation, ProviderWithTimeline, Quote, ReservationCartItem, ReservationStoreState, ShippingMethod, ShippingWeightTier, SystemTemplateKey, Workflow, WorkflowEdge, WorkflowHttpMethod, WorkflowHttpNode, WorkflowIfNode, WorkflowLoopNode, WorkflowNode, WorkflowTriggerNode, WorkflowWaitNode, Zone } from './types.js';
|
|
1
|
+
import { RequestOptions, MagicLinkVerifyParams, MagicLinkRequestParams, UpdateAccountProfileParams, DeleteAccountParams, AddPhoneNumberParams, PhoneNumberConfirmParams, GetMeParams, SearchAccountsParams, AccountSubscribeParams, CreateBusinessParams, UpdateBusinessParams, DeleteBusinessParams, GetBusinessParams, GetBusinessesParams, GetBusinessParentsParams, TriggerBuildsParams, GetSubscriptionPlansParams, GetSubscriptionParams, SubscribeParams, CreatePortalSessionParams, InviteUserParams, HandleInvitationParams, TestWebhookParams, GetBusinessMediaParams2, ProcessRefundParams, GetBusinessEventsParams, UpdateBusinessEventParams, ConnectStripeParams, DisconnectStripeParams, UploadBusinessMediaParams, DeleteBusinessMediaParams, GetBusinessMediaParams, UpdateMediaParams, TrackEmailOpenParams, GetDeliveryStatsParams, CreatePromoCodeParams, UpdatePromoCodeParams, DeletePromoCodeParams, GetPromoCodeParams, GetPromoCodesParams, CreateNodeParams, UpdateNodeParams, DeleteNodeParams, GetNodeParams, GetNodesParams, GetNodeChildrenParams, GenerateBlocksParams, GetVariableMetadataParams, CreateProductParams, UpdateProductParams, DeleteProductParams, GetProductParams, GetProductsParams, CreateOrderParams, UpdateOrderParams, GetOrderParams, GetOrdersParams, GetQuoteParams, OrderCheckoutParams, Slot, CreateReservationParams, UpdateReservationParams, ReservationCheckoutParams, GetReservationParams, SearchReservationsParams, GetReservationQuoteParams, CreateServiceParams, UpdateServiceParams, DeleteServiceParams, BulkScheduleParams, GetServiceParams, GetServicesParams, CreateProviderParams, UpdateProviderParams, DeleteProviderParams, GetProviderParams, GetProvidersParams, GetBusinessServiceWorkingTimeParams, CreateWorkflowParams, UpdateWorkflowParams, DeleteWorkflowParams, GetWorkflowParams, GetWorkflowsParams, TriggerWorkflowParams, CreateAudienceParams, UpdateAudienceParams, GetAudienceParams, GetAudiencesParams, SubscribeAudienceParams, GetAudienceSubscribersParams, RevokeAudienceSubscriptionParams, GetShippingRatesParams, ShippingRate, PurchaseLabelParams, PurchaseLabelResult } from './types.js';
|
|
2
|
+
export { Access, AnalyticsConfig, ApiResponse, Audience, AudienceAccessResponse, AudienceSubscribeResponse, AudienceSubscriber, Block, Business, BusinessConfig, BusinessEvent, BusinessEventAction, BusinessShippingProvider, DayAvailability, EshopCartItem, EshopStoreState, GetAvailabilityParams, GetSlotsForDateParams, Language, Location, Market, Media, MediaResolution, Node, OrderShipping, PaginatedResponse, Parcel, Payment, PaymentMethod, PaymentMethodType, PaymentProviderConfig, PaymentRefund, Price, PromoCodeValidation, ProviderWithTimeline, Quote, ReservationCartItem, ReservationStoreState, ShippingAddress, ShippingMethod, ShippingProviderShippo, ShippingProviderStatus, ShippingStatus, ShippingWeightTier, SystemTemplateKey, Workflow, WorkflowEdge, WorkflowHttpMethod, WorkflowHttpNode, WorkflowIfNode, WorkflowLoopNode, WorkflowNode, WorkflowTriggerNode, WorkflowWaitNode, Zone } from './types.js';
|
|
3
3
|
import { f as formatPayment, a as formatMinor, g as getCurrencySymbol, b as getCurrencyName, i as isValidKey, v as validateKey, t as toKey, n as nameToKey, c as getAvailableStock, d as getReservedStock, h as hasStock, e as getInventoryAt, j as getFirstAvailableFCId } from './index-GZfY5CmP.js';
|
|
4
4
|
|
|
5
5
|
interface AuthTokens {
|
|
@@ -287,6 +287,12 @@ declare function createArkySDK(config: HttpClientConfig & {
|
|
|
287
287
|
getSubscribers(params: GetAudienceSubscribersParams, options?: RequestOptions): Promise<any>;
|
|
288
288
|
revokeSubscription(params: RevokeAudienceSubscriptionParams, options?: RequestOptions): Promise<any>;
|
|
289
289
|
};
|
|
290
|
+
shipping: {
|
|
291
|
+
getRates(params: GetShippingRatesParams, options?: RequestOptions): Promise<{
|
|
292
|
+
rates: ShippingRate[];
|
|
293
|
+
}>;
|
|
294
|
+
purchaseLabel(params: PurchaseLabelParams, options?: RequestOptions): Promise<PurchaseLabelResult>;
|
|
295
|
+
};
|
|
290
296
|
analytics: {
|
|
291
297
|
track: typeof track;
|
|
292
298
|
};
|
|
@@ -349,4 +355,4 @@ declare function createArkySDK(config: HttpClientConfig & {
|
|
|
349
355
|
getStripeConnectClientId: () => string;
|
|
350
356
|
}>;
|
|
351
357
|
|
|
352
|
-
export { type ApiConfig, type GetCountriesResponse, type HttpClientConfig, type LocationCountry, type LocationState, SDK_VERSION, SUPPORTED_FRAMEWORKS, Slot, createArkySDK };
|
|
358
|
+
export { type ApiConfig, type GetCountriesResponse, GetShippingRatesParams, type HttpClientConfig, type LocationCountry, type LocationState, PurchaseLabelParams, PurchaseLabelResult, SDK_VERSION, SUPPORTED_FRAMEWORKS, ShippingRate, Slot, createArkySDK };
|
package/dist/index.js
CHANGED
|
@@ -1371,6 +1371,38 @@ var createPlatformApi = (apiConfig) => {
|
|
|
1371
1371
|
};
|
|
1372
1372
|
};
|
|
1373
1373
|
|
|
1374
|
+
// src/api/shipping.ts
|
|
1375
|
+
var createShippingApi = (apiConfig) => {
|
|
1376
|
+
return {
|
|
1377
|
+
/**
|
|
1378
|
+
* Get available shipping rates for an order
|
|
1379
|
+
*/
|
|
1380
|
+
async getRates(params, options) {
|
|
1381
|
+
return apiConfig.httpClient.post(
|
|
1382
|
+
`/v1/businesses/${apiConfig.businessId}/orders/${params.orderId}/shipping/rates`,
|
|
1383
|
+
{
|
|
1384
|
+
parcel: params.parcel
|
|
1385
|
+
},
|
|
1386
|
+
options
|
|
1387
|
+
);
|
|
1388
|
+
},
|
|
1389
|
+
/**
|
|
1390
|
+
* Purchase a shipping label using a selected rate
|
|
1391
|
+
*/
|
|
1392
|
+
async purchaseLabel(params, options) {
|
|
1393
|
+
return apiConfig.httpClient.post(
|
|
1394
|
+
`/v1/businesses/${apiConfig.businessId}/orders/${params.orderId}/shipping/purchase`,
|
|
1395
|
+
{
|
|
1396
|
+
rateId: params.rateId,
|
|
1397
|
+
carrier: params.carrier,
|
|
1398
|
+
service: params.service
|
|
1399
|
+
},
|
|
1400
|
+
options
|
|
1401
|
+
);
|
|
1402
|
+
}
|
|
1403
|
+
};
|
|
1404
|
+
};
|
|
1405
|
+
|
|
1374
1406
|
// src/utils/price.ts
|
|
1375
1407
|
function formatCurrency(amount, currencyCode, locale = "en") {
|
|
1376
1408
|
return new Intl.NumberFormat(locale, {
|
|
@@ -1691,6 +1723,7 @@ async function createArkySDK(config) {
|
|
|
1691
1723
|
network: createNetworkApi(apiConfig),
|
|
1692
1724
|
workflow: createWorkflowApi(apiConfig),
|
|
1693
1725
|
audience: createAudienceApi(apiConfig),
|
|
1726
|
+
shipping: createShippingApi(apiConfig),
|
|
1694
1727
|
analytics: {
|
|
1695
1728
|
track
|
|
1696
1729
|
},
|