arky-sdk 0.7.24 → 0.7.26

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.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { RequestOptions, MagicLinkVerifyParams, MagicLinkRequestParams, UpdateAccountProfileParams, DeleteAccountParams, GetMeParams, SearchAccountsParams, CreateBusinessParams, UpdateBusinessParams, DeleteBusinessParams, GetBusinessParams, GetBusinessesParams, GetSubscriptionPlansParams, SubscribeParams, CreatePortalSessionParams, InviteUserParams, RemoveMemberParams, HandleInvitationParams, TestWebhookParams, GetBusinessMediaParams2, ProcessRefundParams, OAuthConnectParams, OAuthDisconnectParams, ListIntegrationsParams, CreateIntegrationParams, UpdateIntegrationParams, DeleteIntegrationParams, ListWebhooksParams, CreateWebhookParams, UpdateWebhookParams, DeleteWebhookParams, GetMediaParams, UploadBusinessMediaParams, DeleteBusinessMediaParams, GetBusinessMediaParams, UpdateMediaParams, TrackEmailOpenParams, TriggerNotificationParams, CreatePromoCodeParams, UpdatePromoCodeParams, DeletePromoCodeParams, GetPromoCodeParams, GetPromoCodesParams, CreateNodeParams, UpdateNodeParams, DeleteNodeParams, GetNodeParams, GetNodesParams, GetNodeChildrenParams, CreateProductParams, UpdateProductParams, DeleteProductParams, GetProductParams, GetProductsParams, CreateOrderParams, UpdateOrderParams, GetOrderParams, GetOrdersParams, GetQuoteParams, OrderCheckoutParams, Slot, CreateBookingParams, UpdateBookingParams, BookingCheckoutParams, GetBookingParams, SearchBookingsParams, GetBookingQuoteParams, GetAvailabilityParams, AvailabilityResponse, CreateServiceParams, UpdateServiceParams, DeleteServiceParams, GetServiceParams, GetServicesParams, CreateProviderParams, UpdateProviderParams, DeleteProviderParams, GetProviderParams, GetProvidersParams, FindServiceProvidersParams, CreateServiceProviderParams, UpdateServiceProviderParams, DeleteServiceProviderParams, CreateCustomerParams, GetCustomerParams, ConnectCustomerParams, FindCustomersParams, UpdateCustomerParams, MergeCustomersParams, CreateAudienceParams, UpdateAudienceParams, GetAudienceParams, GetAudiencesParams, SubscribeAudienceParams, GetAudienceSubscribersParams, AddAudienceSubscriberParams, RemoveAudienceSubscriberParams, CreateNetworkParams, GetNetworkParams, FindNetworksParams, UpdateNetworkParams, DeleteNetworkParams, CreateWorkflowParams, UpdateWorkflowParams, DeleteWorkflowParams, GetWorkflowParams, GetWorkflowsParams, TriggerWorkflowParams, GetWorkflowExecutionsParams, GetWorkflowExecutionParams, GetShippingRatesParams, ShippingRate, ShipParams, ShipResult, CreateAgentParams, UpdateAgentParams, DeleteAgentParams, GetAgentParams, GetAgentsParams, RunAgentParams, GetAgentChatsParams, GetAgentChatParams, UpdateAgentChatParams, RateAgentChatParams, GetBusinessChatsParams, CreateEmailTemplateParams, UpdateEmailTemplateParams, DeleteEmailTemplateParams, GetEmailTemplateParams, GetEmailTemplatesParams, CreateFormParams, UpdateFormParams, DeleteFormParams, GetFormParams, GetFormsParams, SubmitFormParams, GetFormSubmissionsParams, GetFormSubmissionParams, UpdateFormSubmissionParams, CreateTaxonomyParams, UpdateTaxonomyParams, DeleteTaxonomyParams, GetTaxonomyParams, GetTaxonomiesParams, GetTaxonomyChildrenParams } from './types.cjs';
2
- export { Access, Address, AgentStatus, ApiResponse, Audience, AudienceAccessResponse, AudienceSubscribeResponse, AudienceSubscriber, AvailabilitySlot, Block, BookingCartItem, BookingStoreState, Business, BusinessConfig, CustomsDeclaration, CustomsItem, DaySlots, EshopCartItem, EshopStoreState, Event, EventAction, ExecutionStatus, GeoLocation, GeoLocationBlock, Integration, IntegrationProvider, Language, Location, Market, Media, MediaResolution, Network, NetworkNode, Node, NodeResult, OrderShipping, PaginatedResponse, Parcel, Payment, PaymentMethod, PaymentMethodType, PaymentRefund, Price, PromoCodeValidation, ProviderAvailability, ProviderWithTimeline, PurchaseLabelResult, Quote, Shipment, ShipmentLine, ShippingAddress, ShippingMethod, ShippingStatus, ShippingWeightTier, SystemTemplateKey, Webhook, WebhookEventSubscription, Workflow, WorkflowConnection, WorkflowExecution, WorkflowHttpMethod, WorkflowHttpNode, WorkflowNode, WorkflowSwitchNode, WorkflowTransformNode, WorkflowTriggerNode, Zone, ZoneLocation } from './types.cjs';
1
+ import { Block, RequestOptions, MagicLinkVerifyParams, MagicLinkRequestParams, UpdateAccountProfileParams, DeleteAccountParams, GetMeParams, SearchAccountsParams, CreateBusinessParams, UpdateBusinessParams, DeleteBusinessParams, GetBusinessParams, GetBusinessesParams, GetSubscriptionPlansParams, SubscribeParams, CreatePortalSessionParams, InviteUserParams, RemoveMemberParams, HandleInvitationParams, TestWebhookParams, GetBusinessMediaParams2, ProcessRefundParams, OAuthConnectParams, OAuthDisconnectParams, ListIntegrationsParams, CreateIntegrationParams, UpdateIntegrationParams, DeleteIntegrationParams, ListWebhooksParams, CreateWebhookParams, UpdateWebhookParams, DeleteWebhookParams, GetMediaParams, UploadBusinessMediaParams, DeleteBusinessMediaParams, GetBusinessMediaParams, UpdateMediaParams, TrackEmailOpenParams, TriggerNotificationParams, CreatePromoCodeParams, UpdatePromoCodeParams, DeletePromoCodeParams, GetPromoCodeParams, GetPromoCodesParams, CreateNodeParams, UpdateNodeParams, DeleteNodeParams, GetNodeParams, GetNodesParams, GetNodeChildrenParams, CreateProductParams, UpdateProductParams, DeleteProductParams, GetProductParams, GetProductsParams, CreateOrderParams, UpdateOrderParams, GetOrderParams, GetOrdersParams, GetQuoteParams, OrderCheckoutParams, Slot, CreateBookingParams, UpdateBookingParams, BookingCheckoutParams, GetBookingParams, SearchBookingsParams, GetBookingQuoteParams, GetAvailabilityParams, AvailabilityResponse, CreateServiceParams, UpdateServiceParams, DeleteServiceParams, GetServiceParams, GetServicesParams, CreateProviderParams, UpdateProviderParams, DeleteProviderParams, GetProviderParams, GetProvidersParams, FindServiceProvidersParams, CreateServiceProviderParams, UpdateServiceProviderParams, DeleteServiceProviderParams, Location, CreateLocationParams, UpdateLocationParams, DeleteLocationParams, Zone, CreateZoneParams, UpdateZoneParams, DeleteZoneParams, CreateCustomerParams, GetCustomerParams, ConnectCustomerParams, FindCustomersParams, UpdateCustomerParams, MergeCustomersParams, CreateAudienceParams, UpdateAudienceParams, GetAudienceParams, GetAudiencesParams, SubscribeAudienceParams, GetAudienceSubscribersParams, AddAudienceSubscriberParams, RemoveAudienceSubscriberParams, CreateNetworkParams, GetNetworkParams, FindNetworksParams, UpdateNetworkParams, DeleteNetworkParams, CreateWorkflowParams, UpdateWorkflowParams, DeleteWorkflowParams, GetWorkflowParams, GetWorkflowsParams, TriggerWorkflowParams, GetWorkflowExecutionsParams, GetWorkflowExecutionParams, GetShippingRatesParams, ShippingRate, ShipParams, ShipResult, CreateAgentParams, UpdateAgentParams, DeleteAgentParams, GetAgentParams, GetAgentsParams, RunAgentParams, GetAgentChatsParams, GetAgentChatParams, UpdateAgentChatParams, RateAgentChatParams, GetBusinessChatsParams, CreateEmailTemplateParams, UpdateEmailTemplateParams, DeleteEmailTemplateParams, GetEmailTemplateParams, GetEmailTemplatesParams, CreateFormParams, UpdateFormParams, DeleteFormParams, GetFormParams, GetFormsParams, SubmitFormParams, GetFormSubmissionsParams, GetFormSubmissionParams, UpdateFormSubmissionParams, CreateTaxonomyParams, UpdateTaxonomyParams, DeleteTaxonomyParams, GetTaxonomyParams, GetTaxonomiesParams, GetTaxonomyChildrenParams } from './types.cjs';
2
+ export { Access, Address, AgentStatus, ApiResponse, Audience, AudienceAccessResponse, AudienceSubscribeResponse, AudienceSubscriber, AvailabilitySlot, BookingCartItem, BookingStoreState, Business, BusinessConfig, CustomsDeclaration, CustomsItem, DaySlots, EshopCartItem, EshopStoreState, Event, EventAction, ExecutionStatus, GeoLocation, GeoLocationBlock, Integration, IntegrationProvider, Language, Market, Media, MediaResolution, Network, NetworkNode, Node, NodeResult, OrderShipping, PaginatedResponse, Parcel, Payment, PaymentMethod, PaymentMethodType, PaymentRefund, Price, PromoCodeValidation, ProviderAvailability, ProviderWithTimeline, PurchaseLabelResult, Quote, Shipment, ShipmentLine, ShippingAddress, ShippingMethod, ShippingStatus, ShippingWeightTier, SystemTemplateKey, Webhook, WebhookEventSubscription, Workflow, WorkflowConnection, WorkflowExecution, WorkflowHttpMethod, WorkflowHttpNode, WorkflowNode, WorkflowSwitchNode, WorkflowTransformNode, WorkflowTriggerNode, ZoneLocation } 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-BzBZVueX.cjs';
4
4
 
5
5
  interface AuthTokens {
@@ -19,6 +19,79 @@ interface HttpClientConfig {
19
19
  isAuthenticated?: () => boolean;
20
20
  }
21
21
 
22
+ type ReactionTargetType = "product" | "service" | "provider" | "booking" | "node";
23
+ type ReactionStatus = "pending" | "published" | "hidden" | "removed";
24
+ interface ReactionTarget {
25
+ type: ReactionTargetType;
26
+ id: string;
27
+ }
28
+ interface Reaction {
29
+ id: string;
30
+ businessId: string;
31
+ customerId: string;
32
+ targetType: ReactionTargetType;
33
+ targetId: string;
34
+ parentId?: string | null;
35
+ kind: string;
36
+ blocks: Block[];
37
+ taxonomies: any[];
38
+ status: ReactionStatus;
39
+ createdAt: number;
40
+ updatedAt: number;
41
+ }
42
+ interface CreateReactionParams {
43
+ businessId?: string;
44
+ target: ReactionTarget;
45
+ kind: string;
46
+ blocks?: Block[];
47
+ parentId?: string;
48
+ taxonomies?: any[];
49
+ }
50
+ interface UpdateReactionParams {
51
+ id: string;
52
+ businessId?: string;
53
+ blocks?: Block[];
54
+ taxonomies?: any[];
55
+ }
56
+ interface GetReactionParams {
57
+ id: string;
58
+ businessId?: string;
59
+ }
60
+ interface FindReactionsParams {
61
+ businessId?: string;
62
+ targetType?: ReactionTargetType;
63
+ targetId?: string;
64
+ parentId?: string;
65
+ customerId?: string;
66
+ kind?: string;
67
+ status?: ReactionStatus;
68
+ contentOnly?: boolean;
69
+ limit?: number;
70
+ cursor?: string;
71
+ }
72
+ interface ModerateReactionParams {
73
+ id: string;
74
+ businessId?: string;
75
+ status: ReactionStatus;
76
+ }
77
+ interface EngagementSummaryParams {
78
+ businessId?: string;
79
+ targetType: ReactionTargetType;
80
+ targetId: string;
81
+ parentId?: string;
82
+ }
83
+ interface EngagementSummary {
84
+ counts: Record<string, number>;
85
+ mine: Reaction[];
86
+ }
87
+ declare const DEFAULT_REACTION_KINDS: readonly ["like", "love", "laugh", "wow", "sad", "insightful", "review", "comment", "star_1", "star_2", "star_3", "star_4", "star_5"];
88
+ declare const REACTION_KIND_REGEX: RegExp;
89
+ declare function isValidReactionKind(kind: string): boolean;
90
+ declare function computeAverageStars(counts: Record<string, number>): {
91
+ average: number;
92
+ count: number;
93
+ };
94
+
22
95
  interface LocationState {
23
96
  code: string;
24
97
  name: string;
@@ -71,7 +144,7 @@ declare global {
71
144
  }
72
145
  declare function track(eventName: string, params?: Record<string, any>): void;
73
146
 
74
- declare const SDK_VERSION = "0.5.32";
147
+ declare const SDK_VERSION = "0.7.26";
75
148
  declare const SUPPORTED_FRAMEWORKS: readonly ["astro", "react", "vue", "svelte", "vanilla"];
76
149
  interface ApiConfig {
77
150
  httpClient: any;
@@ -213,6 +286,22 @@ declare function createArkySDK(config: HttpClientConfig & {
213
286
  location: {
214
287
  getCountries(options?: RequestOptions): Promise<GetCountriesResponse>;
215
288
  getCountry(countryCode: string, options?: RequestOptions): Promise<LocationCountry>;
289
+ list(options?: RequestOptions): Promise<Location[]>;
290
+ get(id: string, options?: RequestOptions): Promise<Location>;
291
+ create(params: CreateLocationParams, options?: RequestOptions): Promise<Location>;
292
+ update(params: UpdateLocationParams, options?: RequestOptions): Promise<Location>;
293
+ delete(params: DeleteLocationParams, options?: RequestOptions): Promise<{
294
+ deleted: boolean;
295
+ }>;
296
+ };
297
+ zone: {
298
+ list(options?: RequestOptions): Promise<Zone[]>;
299
+ get(id: string, options?: RequestOptions): Promise<Zone>;
300
+ create(params: CreateZoneParams, options?: RequestOptions): Promise<Zone>;
301
+ update(params: UpdateZoneParams, options?: RequestOptions): Promise<Zone>;
302
+ delete(params: DeleteZoneParams, options?: RequestOptions): Promise<{
303
+ deleted: boolean;
304
+ }>;
216
305
  };
217
306
  crm: {
218
307
  requestCode(params: {
@@ -261,6 +350,26 @@ declare function createArkySDK(config: HttpClientConfig & {
261
350
  removeSubscriber(params: RemoveAudienceSubscriberParams, options?: RequestOptions): Promise<any>;
262
351
  };
263
352
  };
353
+ reaction: {
354
+ DEFAULT_REACTION_KINDS: readonly ["like", "love", "laugh", "wow", "sad", "insightful", "review", "comment", "star_1", "star_2", "star_3", "star_4", "star_5"];
355
+ isValidReactionKind: typeof isValidReactionKind;
356
+ computeAverageStars: typeof computeAverageStars;
357
+ create(params: CreateReactionParams, options?: RequestOptions): Promise<any>;
358
+ get(params: GetReactionParams, options?: RequestOptions): Promise<any>;
359
+ find(params?: FindReactionsParams, options?: RequestOptions): Promise<any>;
360
+ update(params: UpdateReactionParams, options?: RequestOptions): Promise<any>;
361
+ remove(params: {
362
+ id: string;
363
+ businessId?: string;
364
+ }, options?: RequestOptions): Promise<any>;
365
+ moderate(params: ModerateReactionParams, options?: RequestOptions): Promise<any>;
366
+ listAdmin(params: {
367
+ businessId?: string;
368
+ limit?: number;
369
+ cursor?: string;
370
+ }, options?: RequestOptions): Promise<any>;
371
+ summary(params: EngagementSummaryParams, options?: RequestOptions): Promise<any>;
372
+ };
264
373
  network: {
265
374
  create(params: CreateNetworkParams, options?: RequestOptions): Promise<any>;
266
375
  get(params: GetNetworkParams, options?: RequestOptions): Promise<any>;
@@ -385,4 +494,4 @@ declare function createArkySDK(config: HttpClientConfig & {
385
494
  };
386
495
  }>;
387
496
 
388
- export { type ApiConfig, AvailabilityResponse, CreateAgentParams, CreateNetworkParams, DeleteNetworkParams, FindNetworksParams, GetAgentParams, GetAgentsParams, GetAvailabilityParams, type GetCountriesResponse, GetNetworkParams, GetShippingRatesParams, type HttpClientConfig, type LocationCountry, type LocationState, SDK_VERSION, SUPPORTED_FRAMEWORKS, ShipParams, ShipResult, ShippingRate, Slot, UpdateAgentParams, UpdateNetworkParams, createArkySDK };
497
+ export { type ApiConfig, AvailabilityResponse, Block, CreateAgentParams, CreateLocationParams, CreateNetworkParams, type CreateReactionParams, CreateZoneParams, DEFAULT_REACTION_KINDS, DeleteLocationParams, DeleteNetworkParams, DeleteZoneParams, type EngagementSummary, type EngagementSummaryParams, FindNetworksParams, type FindReactionsParams, GetAgentParams, GetAgentsParams, GetAvailabilityParams, type GetCountriesResponse, GetNetworkParams, type GetReactionParams, GetShippingRatesParams, type HttpClientConfig, Location, type LocationCountry, type LocationState, type ModerateReactionParams, REACTION_KIND_REGEX, type Reaction, type ReactionStatus, type ReactionTarget, type ReactionTargetType, SDK_VERSION, SUPPORTED_FRAMEWORKS, ShipParams, ShipResult, ShippingRate, Slot, UpdateAgentParams, UpdateLocationParams, UpdateNetworkParams, type UpdateReactionParams, UpdateZoneParams, Zone, computeAverageStars, createArkySDK, isValidReactionKind };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { RequestOptions, MagicLinkVerifyParams, MagicLinkRequestParams, UpdateAccountProfileParams, DeleteAccountParams, GetMeParams, SearchAccountsParams, CreateBusinessParams, UpdateBusinessParams, DeleteBusinessParams, GetBusinessParams, GetBusinessesParams, GetSubscriptionPlansParams, SubscribeParams, CreatePortalSessionParams, InviteUserParams, RemoveMemberParams, HandleInvitationParams, TestWebhookParams, GetBusinessMediaParams2, ProcessRefundParams, OAuthConnectParams, OAuthDisconnectParams, ListIntegrationsParams, CreateIntegrationParams, UpdateIntegrationParams, DeleteIntegrationParams, ListWebhooksParams, CreateWebhookParams, UpdateWebhookParams, DeleteWebhookParams, GetMediaParams, UploadBusinessMediaParams, DeleteBusinessMediaParams, GetBusinessMediaParams, UpdateMediaParams, TrackEmailOpenParams, TriggerNotificationParams, CreatePromoCodeParams, UpdatePromoCodeParams, DeletePromoCodeParams, GetPromoCodeParams, GetPromoCodesParams, CreateNodeParams, UpdateNodeParams, DeleteNodeParams, GetNodeParams, GetNodesParams, GetNodeChildrenParams, CreateProductParams, UpdateProductParams, DeleteProductParams, GetProductParams, GetProductsParams, CreateOrderParams, UpdateOrderParams, GetOrderParams, GetOrdersParams, GetQuoteParams, OrderCheckoutParams, Slot, CreateBookingParams, UpdateBookingParams, BookingCheckoutParams, GetBookingParams, SearchBookingsParams, GetBookingQuoteParams, GetAvailabilityParams, AvailabilityResponse, CreateServiceParams, UpdateServiceParams, DeleteServiceParams, GetServiceParams, GetServicesParams, CreateProviderParams, UpdateProviderParams, DeleteProviderParams, GetProviderParams, GetProvidersParams, FindServiceProvidersParams, CreateServiceProviderParams, UpdateServiceProviderParams, DeleteServiceProviderParams, CreateCustomerParams, GetCustomerParams, ConnectCustomerParams, FindCustomersParams, UpdateCustomerParams, MergeCustomersParams, CreateAudienceParams, UpdateAudienceParams, GetAudienceParams, GetAudiencesParams, SubscribeAudienceParams, GetAudienceSubscribersParams, AddAudienceSubscriberParams, RemoveAudienceSubscriberParams, CreateNetworkParams, GetNetworkParams, FindNetworksParams, UpdateNetworkParams, DeleteNetworkParams, CreateWorkflowParams, UpdateWorkflowParams, DeleteWorkflowParams, GetWorkflowParams, GetWorkflowsParams, TriggerWorkflowParams, GetWorkflowExecutionsParams, GetWorkflowExecutionParams, GetShippingRatesParams, ShippingRate, ShipParams, ShipResult, CreateAgentParams, UpdateAgentParams, DeleteAgentParams, GetAgentParams, GetAgentsParams, RunAgentParams, GetAgentChatsParams, GetAgentChatParams, UpdateAgentChatParams, RateAgentChatParams, GetBusinessChatsParams, CreateEmailTemplateParams, UpdateEmailTemplateParams, DeleteEmailTemplateParams, GetEmailTemplateParams, GetEmailTemplatesParams, CreateFormParams, UpdateFormParams, DeleteFormParams, GetFormParams, GetFormsParams, SubmitFormParams, GetFormSubmissionsParams, GetFormSubmissionParams, UpdateFormSubmissionParams, CreateTaxonomyParams, UpdateTaxonomyParams, DeleteTaxonomyParams, GetTaxonomyParams, GetTaxonomiesParams, GetTaxonomyChildrenParams } from './types.js';
2
- export { Access, Address, AgentStatus, ApiResponse, Audience, AudienceAccessResponse, AudienceSubscribeResponse, AudienceSubscriber, AvailabilitySlot, Block, BookingCartItem, BookingStoreState, Business, BusinessConfig, CustomsDeclaration, CustomsItem, DaySlots, EshopCartItem, EshopStoreState, Event, EventAction, ExecutionStatus, GeoLocation, GeoLocationBlock, Integration, IntegrationProvider, Language, Location, Market, Media, MediaResolution, Network, NetworkNode, Node, NodeResult, OrderShipping, PaginatedResponse, Parcel, Payment, PaymentMethod, PaymentMethodType, PaymentRefund, Price, PromoCodeValidation, ProviderAvailability, ProviderWithTimeline, PurchaseLabelResult, Quote, Shipment, ShipmentLine, ShippingAddress, ShippingMethod, ShippingStatus, ShippingWeightTier, SystemTemplateKey, Webhook, WebhookEventSubscription, Workflow, WorkflowConnection, WorkflowExecution, WorkflowHttpMethod, WorkflowHttpNode, WorkflowNode, WorkflowSwitchNode, WorkflowTransformNode, WorkflowTriggerNode, Zone, ZoneLocation } from './types.js';
1
+ import { Block, RequestOptions, MagicLinkVerifyParams, MagicLinkRequestParams, UpdateAccountProfileParams, DeleteAccountParams, GetMeParams, SearchAccountsParams, CreateBusinessParams, UpdateBusinessParams, DeleteBusinessParams, GetBusinessParams, GetBusinessesParams, GetSubscriptionPlansParams, SubscribeParams, CreatePortalSessionParams, InviteUserParams, RemoveMemberParams, HandleInvitationParams, TestWebhookParams, GetBusinessMediaParams2, ProcessRefundParams, OAuthConnectParams, OAuthDisconnectParams, ListIntegrationsParams, CreateIntegrationParams, UpdateIntegrationParams, DeleteIntegrationParams, ListWebhooksParams, CreateWebhookParams, UpdateWebhookParams, DeleteWebhookParams, GetMediaParams, UploadBusinessMediaParams, DeleteBusinessMediaParams, GetBusinessMediaParams, UpdateMediaParams, TrackEmailOpenParams, TriggerNotificationParams, CreatePromoCodeParams, UpdatePromoCodeParams, DeletePromoCodeParams, GetPromoCodeParams, GetPromoCodesParams, CreateNodeParams, UpdateNodeParams, DeleteNodeParams, GetNodeParams, GetNodesParams, GetNodeChildrenParams, CreateProductParams, UpdateProductParams, DeleteProductParams, GetProductParams, GetProductsParams, CreateOrderParams, UpdateOrderParams, GetOrderParams, GetOrdersParams, GetQuoteParams, OrderCheckoutParams, Slot, CreateBookingParams, UpdateBookingParams, BookingCheckoutParams, GetBookingParams, SearchBookingsParams, GetBookingQuoteParams, GetAvailabilityParams, AvailabilityResponse, CreateServiceParams, UpdateServiceParams, DeleteServiceParams, GetServiceParams, GetServicesParams, CreateProviderParams, UpdateProviderParams, DeleteProviderParams, GetProviderParams, GetProvidersParams, FindServiceProvidersParams, CreateServiceProviderParams, UpdateServiceProviderParams, DeleteServiceProviderParams, Location, CreateLocationParams, UpdateLocationParams, DeleteLocationParams, Zone, CreateZoneParams, UpdateZoneParams, DeleteZoneParams, CreateCustomerParams, GetCustomerParams, ConnectCustomerParams, FindCustomersParams, UpdateCustomerParams, MergeCustomersParams, CreateAudienceParams, UpdateAudienceParams, GetAudienceParams, GetAudiencesParams, SubscribeAudienceParams, GetAudienceSubscribersParams, AddAudienceSubscriberParams, RemoveAudienceSubscriberParams, CreateNetworkParams, GetNetworkParams, FindNetworksParams, UpdateNetworkParams, DeleteNetworkParams, CreateWorkflowParams, UpdateWorkflowParams, DeleteWorkflowParams, GetWorkflowParams, GetWorkflowsParams, TriggerWorkflowParams, GetWorkflowExecutionsParams, GetWorkflowExecutionParams, GetShippingRatesParams, ShippingRate, ShipParams, ShipResult, CreateAgentParams, UpdateAgentParams, DeleteAgentParams, GetAgentParams, GetAgentsParams, RunAgentParams, GetAgentChatsParams, GetAgentChatParams, UpdateAgentChatParams, RateAgentChatParams, GetBusinessChatsParams, CreateEmailTemplateParams, UpdateEmailTemplateParams, DeleteEmailTemplateParams, GetEmailTemplateParams, GetEmailTemplatesParams, CreateFormParams, UpdateFormParams, DeleteFormParams, GetFormParams, GetFormsParams, SubmitFormParams, GetFormSubmissionsParams, GetFormSubmissionParams, UpdateFormSubmissionParams, CreateTaxonomyParams, UpdateTaxonomyParams, DeleteTaxonomyParams, GetTaxonomyParams, GetTaxonomiesParams, GetTaxonomyChildrenParams } from './types.js';
2
+ export { Access, Address, AgentStatus, ApiResponse, Audience, AudienceAccessResponse, AudienceSubscribeResponse, AudienceSubscriber, AvailabilitySlot, BookingCartItem, BookingStoreState, Business, BusinessConfig, CustomsDeclaration, CustomsItem, DaySlots, EshopCartItem, EshopStoreState, Event, EventAction, ExecutionStatus, GeoLocation, GeoLocationBlock, Integration, IntegrationProvider, Language, Market, Media, MediaResolution, Network, NetworkNode, Node, NodeResult, OrderShipping, PaginatedResponse, Parcel, Payment, PaymentMethod, PaymentMethodType, PaymentRefund, Price, PromoCodeValidation, ProviderAvailability, ProviderWithTimeline, PurchaseLabelResult, Quote, Shipment, ShipmentLine, ShippingAddress, ShippingMethod, ShippingStatus, ShippingWeightTier, SystemTemplateKey, Webhook, WebhookEventSubscription, Workflow, WorkflowConnection, WorkflowExecution, WorkflowHttpMethod, WorkflowHttpNode, WorkflowNode, WorkflowSwitchNode, WorkflowTransformNode, WorkflowTriggerNode, ZoneLocation } 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-CkyDsYWA.js';
4
4
 
5
5
  interface AuthTokens {
@@ -19,6 +19,79 @@ interface HttpClientConfig {
19
19
  isAuthenticated?: () => boolean;
20
20
  }
21
21
 
22
+ type ReactionTargetType = "product" | "service" | "provider" | "booking" | "node";
23
+ type ReactionStatus = "pending" | "published" | "hidden" | "removed";
24
+ interface ReactionTarget {
25
+ type: ReactionTargetType;
26
+ id: string;
27
+ }
28
+ interface Reaction {
29
+ id: string;
30
+ businessId: string;
31
+ customerId: string;
32
+ targetType: ReactionTargetType;
33
+ targetId: string;
34
+ parentId?: string | null;
35
+ kind: string;
36
+ blocks: Block[];
37
+ taxonomies: any[];
38
+ status: ReactionStatus;
39
+ createdAt: number;
40
+ updatedAt: number;
41
+ }
42
+ interface CreateReactionParams {
43
+ businessId?: string;
44
+ target: ReactionTarget;
45
+ kind: string;
46
+ blocks?: Block[];
47
+ parentId?: string;
48
+ taxonomies?: any[];
49
+ }
50
+ interface UpdateReactionParams {
51
+ id: string;
52
+ businessId?: string;
53
+ blocks?: Block[];
54
+ taxonomies?: any[];
55
+ }
56
+ interface GetReactionParams {
57
+ id: string;
58
+ businessId?: string;
59
+ }
60
+ interface FindReactionsParams {
61
+ businessId?: string;
62
+ targetType?: ReactionTargetType;
63
+ targetId?: string;
64
+ parentId?: string;
65
+ customerId?: string;
66
+ kind?: string;
67
+ status?: ReactionStatus;
68
+ contentOnly?: boolean;
69
+ limit?: number;
70
+ cursor?: string;
71
+ }
72
+ interface ModerateReactionParams {
73
+ id: string;
74
+ businessId?: string;
75
+ status: ReactionStatus;
76
+ }
77
+ interface EngagementSummaryParams {
78
+ businessId?: string;
79
+ targetType: ReactionTargetType;
80
+ targetId: string;
81
+ parentId?: string;
82
+ }
83
+ interface EngagementSummary {
84
+ counts: Record<string, number>;
85
+ mine: Reaction[];
86
+ }
87
+ declare const DEFAULT_REACTION_KINDS: readonly ["like", "love", "laugh", "wow", "sad", "insightful", "review", "comment", "star_1", "star_2", "star_3", "star_4", "star_5"];
88
+ declare const REACTION_KIND_REGEX: RegExp;
89
+ declare function isValidReactionKind(kind: string): boolean;
90
+ declare function computeAverageStars(counts: Record<string, number>): {
91
+ average: number;
92
+ count: number;
93
+ };
94
+
22
95
  interface LocationState {
23
96
  code: string;
24
97
  name: string;
@@ -71,7 +144,7 @@ declare global {
71
144
  }
72
145
  declare function track(eventName: string, params?: Record<string, any>): void;
73
146
 
74
- declare const SDK_VERSION = "0.5.32";
147
+ declare const SDK_VERSION = "0.7.26";
75
148
  declare const SUPPORTED_FRAMEWORKS: readonly ["astro", "react", "vue", "svelte", "vanilla"];
76
149
  interface ApiConfig {
77
150
  httpClient: any;
@@ -213,6 +286,22 @@ declare function createArkySDK(config: HttpClientConfig & {
213
286
  location: {
214
287
  getCountries(options?: RequestOptions): Promise<GetCountriesResponse>;
215
288
  getCountry(countryCode: string, options?: RequestOptions): Promise<LocationCountry>;
289
+ list(options?: RequestOptions): Promise<Location[]>;
290
+ get(id: string, options?: RequestOptions): Promise<Location>;
291
+ create(params: CreateLocationParams, options?: RequestOptions): Promise<Location>;
292
+ update(params: UpdateLocationParams, options?: RequestOptions): Promise<Location>;
293
+ delete(params: DeleteLocationParams, options?: RequestOptions): Promise<{
294
+ deleted: boolean;
295
+ }>;
296
+ };
297
+ zone: {
298
+ list(options?: RequestOptions): Promise<Zone[]>;
299
+ get(id: string, options?: RequestOptions): Promise<Zone>;
300
+ create(params: CreateZoneParams, options?: RequestOptions): Promise<Zone>;
301
+ update(params: UpdateZoneParams, options?: RequestOptions): Promise<Zone>;
302
+ delete(params: DeleteZoneParams, options?: RequestOptions): Promise<{
303
+ deleted: boolean;
304
+ }>;
216
305
  };
217
306
  crm: {
218
307
  requestCode(params: {
@@ -261,6 +350,26 @@ declare function createArkySDK(config: HttpClientConfig & {
261
350
  removeSubscriber(params: RemoveAudienceSubscriberParams, options?: RequestOptions): Promise<any>;
262
351
  };
263
352
  };
353
+ reaction: {
354
+ DEFAULT_REACTION_KINDS: readonly ["like", "love", "laugh", "wow", "sad", "insightful", "review", "comment", "star_1", "star_2", "star_3", "star_4", "star_5"];
355
+ isValidReactionKind: typeof isValidReactionKind;
356
+ computeAverageStars: typeof computeAverageStars;
357
+ create(params: CreateReactionParams, options?: RequestOptions): Promise<any>;
358
+ get(params: GetReactionParams, options?: RequestOptions): Promise<any>;
359
+ find(params?: FindReactionsParams, options?: RequestOptions): Promise<any>;
360
+ update(params: UpdateReactionParams, options?: RequestOptions): Promise<any>;
361
+ remove(params: {
362
+ id: string;
363
+ businessId?: string;
364
+ }, options?: RequestOptions): Promise<any>;
365
+ moderate(params: ModerateReactionParams, options?: RequestOptions): Promise<any>;
366
+ listAdmin(params: {
367
+ businessId?: string;
368
+ limit?: number;
369
+ cursor?: string;
370
+ }, options?: RequestOptions): Promise<any>;
371
+ summary(params: EngagementSummaryParams, options?: RequestOptions): Promise<any>;
372
+ };
264
373
  network: {
265
374
  create(params: CreateNetworkParams, options?: RequestOptions): Promise<any>;
266
375
  get(params: GetNetworkParams, options?: RequestOptions): Promise<any>;
@@ -385,4 +494,4 @@ declare function createArkySDK(config: HttpClientConfig & {
385
494
  };
386
495
  }>;
387
496
 
388
- export { type ApiConfig, AvailabilityResponse, CreateAgentParams, CreateNetworkParams, DeleteNetworkParams, FindNetworksParams, GetAgentParams, GetAgentsParams, GetAvailabilityParams, type GetCountriesResponse, GetNetworkParams, GetShippingRatesParams, type HttpClientConfig, type LocationCountry, type LocationState, SDK_VERSION, SUPPORTED_FRAMEWORKS, ShipParams, ShipResult, ShippingRate, Slot, UpdateAgentParams, UpdateNetworkParams, createArkySDK };
497
+ export { type ApiConfig, AvailabilityResponse, Block, CreateAgentParams, CreateLocationParams, CreateNetworkParams, type CreateReactionParams, CreateZoneParams, DEFAULT_REACTION_KINDS, DeleteLocationParams, DeleteNetworkParams, DeleteZoneParams, type EngagementSummary, type EngagementSummaryParams, FindNetworksParams, type FindReactionsParams, GetAgentParams, GetAgentsParams, GetAvailabilityParams, type GetCountriesResponse, GetNetworkParams, type GetReactionParams, GetShippingRatesParams, type HttpClientConfig, Location, type LocationCountry, type LocationState, type ModerateReactionParams, REACTION_KIND_REGEX, type Reaction, type ReactionStatus, type ReactionTarget, type ReactionTargetType, SDK_VERSION, SUPPORTED_FRAMEWORKS, ShipParams, ShipResult, ShippingRate, Slot, UpdateAgentParams, UpdateLocationParams, UpdateNetworkParams, type UpdateReactionParams, UpdateZoneParams, Zone, computeAverageStars, createArkySDK, isValidReactionKind };
package/dist/index.js CHANGED
@@ -1111,6 +1111,79 @@ var createLocationApi = (apiConfig) => {
1111
1111
  `/v1/platform/countries/${countryCode}`,
1112
1112
  options
1113
1113
  );
1114
+ },
1115
+ // Business location CRUD. Locations are now first-class entities (their own
1116
+ // table) and are no longer embedded in BusinessConfigs. Reads and writes go
1117
+ // through these endpoints.
1118
+ async list(options) {
1119
+ return apiConfig.httpClient.get(
1120
+ `/v1/businesses/${apiConfig.businessId}/locations`,
1121
+ options
1122
+ );
1123
+ },
1124
+ async get(id, options) {
1125
+ return apiConfig.httpClient.get(
1126
+ `/v1/businesses/${apiConfig.businessId}/locations/${id}`,
1127
+ options
1128
+ );
1129
+ },
1130
+ async create(params, options) {
1131
+ return apiConfig.httpClient.post(
1132
+ `/v1/businesses/${apiConfig.businessId}/locations`,
1133
+ { ...params, businessId: apiConfig.businessId },
1134
+ options
1135
+ );
1136
+ },
1137
+ async update(params, options) {
1138
+ return apiConfig.httpClient.put(
1139
+ `/v1/businesses/${apiConfig.businessId}/locations/${params.id}`,
1140
+ { ...params, businessId: apiConfig.businessId },
1141
+ options
1142
+ );
1143
+ },
1144
+ async delete(params, options) {
1145
+ return apiConfig.httpClient.delete(
1146
+ `/v1/businesses/${apiConfig.businessId}/locations/${params.id}`,
1147
+ options
1148
+ );
1149
+ }
1150
+ };
1151
+ };
1152
+
1153
+ // src/api/zone.ts
1154
+ var createZoneApi = (apiConfig) => {
1155
+ return {
1156
+ async list(options) {
1157
+ return apiConfig.httpClient.get(
1158
+ `/v1/businesses/${apiConfig.businessId}/zones`,
1159
+ options
1160
+ );
1161
+ },
1162
+ async get(id, options) {
1163
+ return apiConfig.httpClient.get(
1164
+ `/v1/businesses/${apiConfig.businessId}/zones/${id}`,
1165
+ options
1166
+ );
1167
+ },
1168
+ async create(params, options) {
1169
+ return apiConfig.httpClient.post(
1170
+ `/v1/businesses/${apiConfig.businessId}/zones`,
1171
+ { ...params, businessId: apiConfig.businessId },
1172
+ options
1173
+ );
1174
+ },
1175
+ async update(params, options) {
1176
+ return apiConfig.httpClient.put(
1177
+ `/v1/businesses/${apiConfig.businessId}/zones/${params.id}`,
1178
+ { ...params, businessId: apiConfig.businessId },
1179
+ options
1180
+ );
1181
+ },
1182
+ async delete(params, options) {
1183
+ return apiConfig.httpClient.delete(
1184
+ `/v1/businesses/${apiConfig.businessId}/zones/${params.id}`,
1185
+ options
1186
+ );
1114
1187
  }
1115
1188
  };
1116
1189
  };
@@ -1303,6 +1376,145 @@ var createCustomerApi = (apiConfig) => {
1303
1376
  };
1304
1377
  };
1305
1378
 
1379
+ // src/api/reaction.ts
1380
+ var DEFAULT_REACTION_KINDS = [
1381
+ "like",
1382
+ "love",
1383
+ "laugh",
1384
+ "wow",
1385
+ "sad",
1386
+ "insightful",
1387
+ "review",
1388
+ "comment",
1389
+ "star_1",
1390
+ "star_2",
1391
+ "star_3",
1392
+ "star_4",
1393
+ "star_5"
1394
+ ];
1395
+ var REACTION_KIND_REGEX = /^[a-z0-9_]{1,32}$/;
1396
+ function isValidReactionKind(kind) {
1397
+ return REACTION_KIND_REGEX.test(kind);
1398
+ }
1399
+ function computeAverageStars(counts) {
1400
+ let total = 0;
1401
+ let weighted = 0;
1402
+ for (let i = 1; i <= 5; i++) {
1403
+ const c = counts[`star_${i}`] ?? 0;
1404
+ total += c;
1405
+ weighted += c * i;
1406
+ }
1407
+ return {
1408
+ average: total > 0 ? weighted / total : 0,
1409
+ count: total
1410
+ };
1411
+ }
1412
+ var createReactionApi = (apiConfig) => {
1413
+ const base = (businessId) => `/v1/businesses/${businessId || apiConfig.businessId}/reactions`;
1414
+ return {
1415
+ DEFAULT_REACTION_KINDS,
1416
+ isValidReactionKind,
1417
+ computeAverageStars,
1418
+ async create(params, options) {
1419
+ const businessId = params.businessId || apiConfig.businessId;
1420
+ return apiConfig.httpClient.post(
1421
+ base(businessId),
1422
+ {
1423
+ businessId,
1424
+ target: params.target,
1425
+ kind: params.kind,
1426
+ blocks: params.blocks || [],
1427
+ parentId: params.parentId,
1428
+ taxonomies: params.taxonomies || []
1429
+ },
1430
+ options
1431
+ );
1432
+ },
1433
+ async get(params, options) {
1434
+ const businessId = params.businessId || apiConfig.businessId;
1435
+ return apiConfig.httpClient.get(
1436
+ `${base(businessId)}/${params.id}`,
1437
+ options
1438
+ );
1439
+ },
1440
+ async find(params, options) {
1441
+ const businessId = params?.businessId || apiConfig.businessId;
1442
+ const queryParams = {};
1443
+ if (params?.targetType) queryParams.targetType = params.targetType;
1444
+ if (params?.targetId) queryParams.targetId = params.targetId;
1445
+ if (params?.parentId) queryParams.parentId = params.parentId;
1446
+ if (params?.customerId) queryParams.customerId = params.customerId;
1447
+ if (params?.kind) queryParams.kind = params.kind;
1448
+ if (params?.status) queryParams.status = params.status;
1449
+ if (params?.contentOnly !== void 0)
1450
+ queryParams.contentOnly = params.contentOnly;
1451
+ if (params?.limit !== void 0) queryParams.limit = params.limit;
1452
+ if (params?.cursor) queryParams.cursor = params.cursor;
1453
+ return apiConfig.httpClient.get(
1454
+ base(businessId),
1455
+ { ...options, params: queryParams }
1456
+ );
1457
+ },
1458
+ async update(params, options) {
1459
+ const businessId = params.businessId || apiConfig.businessId;
1460
+ return apiConfig.httpClient.put(
1461
+ `${base(businessId)}/${params.id}`,
1462
+ {
1463
+ id: params.id,
1464
+ businessId,
1465
+ blocks: params.blocks,
1466
+ taxonomies: params.taxonomies
1467
+ },
1468
+ options
1469
+ );
1470
+ },
1471
+ async remove(params, options) {
1472
+ const businessId = params.businessId || apiConfig.businessId;
1473
+ return apiConfig.httpClient.delete(
1474
+ `${base(businessId)}/${params.id}`,
1475
+ options
1476
+ );
1477
+ },
1478
+ async moderate(params, options) {
1479
+ const businessId = params.businessId || apiConfig.businessId;
1480
+ return apiConfig.httpClient.post(
1481
+ `${base(businessId)}/${params.id}/moderate`,
1482
+ {
1483
+ id: params.id,
1484
+ businessId,
1485
+ status: params.status
1486
+ },
1487
+ options
1488
+ );
1489
+ },
1490
+ async listAdmin(params, options) {
1491
+ const businessId = params.businessId || apiConfig.businessId;
1492
+ const queryParams = { businessId };
1493
+ if (params.limit !== void 0) queryParams.limit = params.limit;
1494
+ if (params.cursor) queryParams.cursor = params.cursor;
1495
+ return apiConfig.httpClient.get(
1496
+ `${base(businessId)}/admin`,
1497
+ { ...options, params: queryParams }
1498
+ );
1499
+ },
1500
+ async summary(params, options) {
1501
+ const businessId = params.businessId || apiConfig.businessId;
1502
+ return apiConfig.httpClient.get(
1503
+ `${base(businessId)}/summary`,
1504
+ {
1505
+ ...options,
1506
+ params: {
1507
+ businessId,
1508
+ targetType: params.targetType,
1509
+ targetId: params.targetId,
1510
+ parentId: params.parentId
1511
+ }
1512
+ }
1513
+ );
1514
+ }
1515
+ };
1516
+ };
1517
+
1306
1518
  // src/api/network.ts
1307
1519
  var createNetworkApi = (apiConfig) => {
1308
1520
  return {
@@ -2024,7 +2236,7 @@ function getFirstAvailableFCId(variant, quantity = 1) {
2024
2236
  }
2025
2237
 
2026
2238
  // src/index.ts
2027
- var SDK_VERSION = "0.5.32";
2239
+ var SDK_VERSION = "0.7.26";
2028
2240
  var SUPPORTED_FRAMEWORKS = [
2029
2241
  "astro",
2030
2242
  "react",
@@ -2071,7 +2283,9 @@ async function createArkySDK(config) {
2071
2283
  eshop: createEshopApi(apiConfig),
2072
2284
  booking: createBookingApi(apiConfig),
2073
2285
  location: createLocationApi(apiConfig),
2286
+ zone: createZoneApi(apiConfig),
2074
2287
  crm: createCustomerApi(apiConfig),
2288
+ reaction: createReactionApi(apiConfig),
2075
2289
  network: createNetworkApi(apiConfig),
2076
2290
  workflow: createWorkflowApi(apiConfig),
2077
2291
  shipping: createShippingApi(apiConfig),
@@ -2140,6 +2354,6 @@ async function createArkySDK(config) {
2140
2354
  return sdk;
2141
2355
  }
2142
2356
 
2143
- export { PaymentMethodType, SDK_VERSION, SUPPORTED_FRAMEWORKS, createArkySDK };
2357
+ export { DEFAULT_REACTION_KINDS, PaymentMethodType, REACTION_KIND_REGEX, SDK_VERSION, SUPPORTED_FRAMEWORKS, computeAverageStars, createArkySDK, isValidReactionKind };
2144
2358
  //# sourceMappingURL=index.js.map
2145
2359
  //# sourceMappingURL=index.js.map