arky-sdk 0.3.131 → 0.3.132
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 +31 -176
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -20
- package/dist/index.d.ts +13 -20
- package/dist/index.js +31 -176
- package/dist/index.js.map +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +31 -100
- package/dist/types.d.ts +31 -100
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Price, Payment, UpdateUserProfileParams, RequestOptions, DeleteUserParams, AddPhoneNumberParams, PhoneNumberConfirmParams, GetMeParams, SearchUsersParams, SetRoleParams, LoginUserParams, RegisterUserParams, LogoutParams, ConfirmUserParams, GetLoginUrlParams, ForgotPasswordParams, ResetForgotPasswordParams, ResetPasswordParams, UserSubscribeParams, CreateBusinessParams, UpdateBusinessParams, DeleteBusinessParams, GetBusinessParams, GetBusinessesParams, GetBusinessParentsParams, TriggerBuildsParams, GetSubscriptionPlansParams, GetSubscriptionParams, SubscribeParams, CreatePortalSessionParams, InviteUserParams, HandleInvitationParams, TestWebhookParams, GetBusinessMediaParams2, ProcessRefundParams, UploadBusinessMediaParams, DeleteBusinessMediaParams, GetBusinessMediaParams, UpdateMediaParams, CreateRoleParams, UpdateRoleParams, DeleteRoleParams, GetRoleParams, GetRolesParams, TrackEmailOpenParams, GetDeliveryStatsParams, CreatePromoCodeParams, UpdatePromoCodeParams, DeletePromoCodeParams, GetPromoCodeParams, GetPromoCodesParams, GetAnalyticsParams, 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, CreateFeatureFlagParams, FeatureFlag, GetFeatureFlagParams, GetFeatureFlagsParams, UpdateFeatureFlagParams, DeleteFeatureFlagParams, GetFeatureFlagResultsParams, FlagResults, GetVariantParams, GetVariantResponse, TrackEventParams, TrackEventResponse
|
|
1
|
+
import { Price, Payment, UpdateUserProfileParams, RequestOptions, DeleteUserParams, AddPhoneNumberParams, PhoneNumberConfirmParams, GetMeParams, SearchUsersParams, SetRoleParams, LoginUserParams, RegisterUserParams, LogoutParams, ConfirmUserParams, GetLoginUrlParams, ForgotPasswordParams, ResetForgotPasswordParams, ResetPasswordParams, UserSubscribeParams, CreateBusinessParams, UpdateBusinessParams, DeleteBusinessParams, GetBusinessParams, GetBusinessesParams, GetBusinessParentsParams, TriggerBuildsParams, GetSubscriptionPlansParams, GetSubscriptionParams, SubscribeParams, CreatePortalSessionParams, InviteUserParams, HandleInvitationParams, TestWebhookParams, GetBusinessMediaParams2, ProcessRefundParams, UploadBusinessMediaParams, DeleteBusinessMediaParams, GetBusinessMediaParams, UpdateMediaParams, CreateRoleParams, UpdateRoleParams, DeleteRoleParams, GetRoleParams, GetRolesParams, TrackEmailOpenParams, GetDeliveryStatsParams, CreatePromoCodeParams, UpdatePromoCodeParams, DeletePromoCodeParams, GetPromoCodeParams, GetPromoCodesParams, GetAnalyticsParams, 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, CreateFeatureFlagParams, FeatureFlag, GetFeatureFlagParams, GetFeatureFlagsParams, UpdateFeatureFlagParams, DeleteFeatureFlagParams, GetFeatureFlagResultsParams, FlagResults, GetVariantParams, GetVariantResponse, TrackEventParams, TrackEventResponse } from './types.cjs';
|
|
2
2
|
export { ApiResponse, Block, Business, BusinessConfig, DayAvailability, EshopCartItem, EshopStoreState, GetAvailabilityParams, GetSlotsForDateParams, Language, Location, Market, Media, MediaResolution, Node, PaginatedResponse, PaymentMethod, PaymentMethodType, PaymentProviderConfig, PaymentRefund, PromoCodeValidation, ProviderWithTimeline, Quote, ReservationCartItem, ReservationStoreState, Seo, ShippingMethod, ShippingWeightTier, SystemTemplateKey, Zone } from './types.cjs';
|
|
3
3
|
import { isValidKey, validateKey, toKey, nameToKey } from './utils.cjs';
|
|
4
4
|
|
|
@@ -155,7 +155,7 @@ declare function getSvgContentForAstro(mediaObject: any): Promise<string>;
|
|
|
155
155
|
*/
|
|
156
156
|
declare function injectSvgIntoElement(mediaObject: any, targetElement: HTMLElement, className?: string): Promise<void>;
|
|
157
157
|
|
|
158
|
-
declare const SDK_VERSION = "0.3.
|
|
158
|
+
declare const SDK_VERSION = "0.3.132";
|
|
159
159
|
declare const SUPPORTED_FRAMEWORKS: readonly ["astro", "react", "vue", "svelte", "vanilla"];
|
|
160
160
|
interface ApiConfig {
|
|
161
161
|
httpClient: any;
|
|
@@ -243,6 +243,17 @@ declare function createArkySDK(config: HttpClientConfig & {
|
|
|
243
243
|
getNodeChildren(params: GetNodeChildrenParams, options?: RequestOptions): Promise<any>;
|
|
244
244
|
generateBlocks(params: GenerateBlocksParams, options?: RequestOptions): Promise<any>;
|
|
245
245
|
getVariableMetadata(params: GetVariableMetadataParams, options?: RequestOptions): Promise<any>;
|
|
246
|
+
sendNode(params: {
|
|
247
|
+
entryId: string;
|
|
248
|
+
scheduledAt?: number;
|
|
249
|
+
}, options?: RequestOptions): Promise<any>;
|
|
250
|
+
cancelSend(params: {
|
|
251
|
+
nodeId: string;
|
|
252
|
+
sendId: string;
|
|
253
|
+
}, options?: RequestOptions): Promise<any>;
|
|
254
|
+
getSubscribers(params: {
|
|
255
|
+
nodeId: string;
|
|
256
|
+
}, options?: RequestOptions): Promise<any>;
|
|
246
257
|
};
|
|
247
258
|
eshop: {
|
|
248
259
|
createProduct(params: CreateProductParams, options?: RequestOptions): Promise<any>;
|
|
@@ -312,24 +323,6 @@ declare function createArkySDK(config: HttpClientConfig & {
|
|
|
312
323
|
getCountries(options?: RequestOptions): Promise<GetCountriesResponse>;
|
|
313
324
|
getCountryStates(countryCode: string, options?: RequestOptions): Promise<LocationCountry>;
|
|
314
325
|
};
|
|
315
|
-
newsletter: {
|
|
316
|
-
createNewsletter(params: CreateNewsletterParams, options?: RequestOptions<Newsletter>): Promise<Newsletter>;
|
|
317
|
-
getNewsletter(params: GetNewsletterParams, options?: RequestOptions<Newsletter>): Promise<Newsletter>;
|
|
318
|
-
getNewsletters(params?: GetNewslettersParams, options?: RequestOptions<Paginated<Newsletter>>): Promise<Paginated<Newsletter>>;
|
|
319
|
-
updateNewsletter(params: UpdateNewsletterParams, options?: RequestOptions<Newsletter>): Promise<Newsletter>;
|
|
320
|
-
deleteNewsletter(params: DeleteNewsletterParams, options?: RequestOptions<boolean>): Promise<boolean>;
|
|
321
|
-
getSubscribers(params: GetSubscribersParams, options?: RequestOptions<SubscriberInfo[]>): Promise<SubscriberInfo[]>;
|
|
322
|
-
createPost(params: CreateNewsletterPostParams, options?: RequestOptions<NewsletterPost>): Promise<NewsletterPost>;
|
|
323
|
-
getPost(params: GetNewsletterPostParams, options?: RequestOptions<NewsletterPost>): Promise<NewsletterPost>;
|
|
324
|
-
getPosts(params: GetNewsletterPostsParams, options?: RequestOptions<Paginated<NewsletterPost>>): Promise<Paginated<NewsletterPost>>;
|
|
325
|
-
updatePost(params: UpdateNewsletterPostParams, options?: RequestOptions<NewsletterPost>): Promise<NewsletterPost>;
|
|
326
|
-
deletePost(params: DeleteNewsletterPostParams, options?: RequestOptions<boolean>): Promise<boolean>;
|
|
327
|
-
scheduleSend(params: ScheduleSendParams, options?: RequestOptions<NewsletterPost>): Promise<NewsletterPost>;
|
|
328
|
-
cancelSend(params: CancelSendParams, options?: RequestOptions<NewsletterPost>): Promise<NewsletterPost>;
|
|
329
|
-
publishPost(newsletterId: string, postId: string): Promise<NewsletterPost>;
|
|
330
|
-
archivePost(newsletterId: string, postId: string): Promise<NewsletterPost>;
|
|
331
|
-
sendNow(newsletterId: string, postId: string): Promise<NewsletterPost>;
|
|
332
|
-
};
|
|
333
326
|
setBusinessId: (businessId: string) => void;
|
|
334
327
|
getBusinessId: () => string;
|
|
335
328
|
setMarket: (market: string) => void;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Price, Payment, UpdateUserProfileParams, RequestOptions, DeleteUserParams, AddPhoneNumberParams, PhoneNumberConfirmParams, GetMeParams, SearchUsersParams, SetRoleParams, LoginUserParams, RegisterUserParams, LogoutParams, ConfirmUserParams, GetLoginUrlParams, ForgotPasswordParams, ResetForgotPasswordParams, ResetPasswordParams, UserSubscribeParams, CreateBusinessParams, UpdateBusinessParams, DeleteBusinessParams, GetBusinessParams, GetBusinessesParams, GetBusinessParentsParams, TriggerBuildsParams, GetSubscriptionPlansParams, GetSubscriptionParams, SubscribeParams, CreatePortalSessionParams, InviteUserParams, HandleInvitationParams, TestWebhookParams, GetBusinessMediaParams2, ProcessRefundParams, UploadBusinessMediaParams, DeleteBusinessMediaParams, GetBusinessMediaParams, UpdateMediaParams, CreateRoleParams, UpdateRoleParams, DeleteRoleParams, GetRoleParams, GetRolesParams, TrackEmailOpenParams, GetDeliveryStatsParams, CreatePromoCodeParams, UpdatePromoCodeParams, DeletePromoCodeParams, GetPromoCodeParams, GetPromoCodesParams, GetAnalyticsParams, 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, CreateFeatureFlagParams, FeatureFlag, GetFeatureFlagParams, GetFeatureFlagsParams, UpdateFeatureFlagParams, DeleteFeatureFlagParams, GetFeatureFlagResultsParams, FlagResults, GetVariantParams, GetVariantResponse, TrackEventParams, TrackEventResponse
|
|
1
|
+
import { Price, Payment, UpdateUserProfileParams, RequestOptions, DeleteUserParams, AddPhoneNumberParams, PhoneNumberConfirmParams, GetMeParams, SearchUsersParams, SetRoleParams, LoginUserParams, RegisterUserParams, LogoutParams, ConfirmUserParams, GetLoginUrlParams, ForgotPasswordParams, ResetForgotPasswordParams, ResetPasswordParams, UserSubscribeParams, CreateBusinessParams, UpdateBusinessParams, DeleteBusinessParams, GetBusinessParams, GetBusinessesParams, GetBusinessParentsParams, TriggerBuildsParams, GetSubscriptionPlansParams, GetSubscriptionParams, SubscribeParams, CreatePortalSessionParams, InviteUserParams, HandleInvitationParams, TestWebhookParams, GetBusinessMediaParams2, ProcessRefundParams, UploadBusinessMediaParams, DeleteBusinessMediaParams, GetBusinessMediaParams, UpdateMediaParams, CreateRoleParams, UpdateRoleParams, DeleteRoleParams, GetRoleParams, GetRolesParams, TrackEmailOpenParams, GetDeliveryStatsParams, CreatePromoCodeParams, UpdatePromoCodeParams, DeletePromoCodeParams, GetPromoCodeParams, GetPromoCodesParams, GetAnalyticsParams, 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, CreateFeatureFlagParams, FeatureFlag, GetFeatureFlagParams, GetFeatureFlagsParams, UpdateFeatureFlagParams, DeleteFeatureFlagParams, GetFeatureFlagResultsParams, FlagResults, GetVariantParams, GetVariantResponse, TrackEventParams, TrackEventResponse } from './types.js';
|
|
2
2
|
export { ApiResponse, Block, Business, BusinessConfig, DayAvailability, EshopCartItem, EshopStoreState, GetAvailabilityParams, GetSlotsForDateParams, Language, Location, Market, Media, MediaResolution, Node, PaginatedResponse, PaymentMethod, PaymentMethodType, PaymentProviderConfig, PaymentRefund, PromoCodeValidation, ProviderWithTimeline, Quote, ReservationCartItem, ReservationStoreState, Seo, ShippingMethod, ShippingWeightTier, SystemTemplateKey, Zone } from './types.js';
|
|
3
3
|
import { isValidKey, validateKey, toKey, nameToKey } from './utils.js';
|
|
4
4
|
|
|
@@ -155,7 +155,7 @@ declare function getSvgContentForAstro(mediaObject: any): Promise<string>;
|
|
|
155
155
|
*/
|
|
156
156
|
declare function injectSvgIntoElement(mediaObject: any, targetElement: HTMLElement, className?: string): Promise<void>;
|
|
157
157
|
|
|
158
|
-
declare const SDK_VERSION = "0.3.
|
|
158
|
+
declare const SDK_VERSION = "0.3.132";
|
|
159
159
|
declare const SUPPORTED_FRAMEWORKS: readonly ["astro", "react", "vue", "svelte", "vanilla"];
|
|
160
160
|
interface ApiConfig {
|
|
161
161
|
httpClient: any;
|
|
@@ -243,6 +243,17 @@ declare function createArkySDK(config: HttpClientConfig & {
|
|
|
243
243
|
getNodeChildren(params: GetNodeChildrenParams, options?: RequestOptions): Promise<any>;
|
|
244
244
|
generateBlocks(params: GenerateBlocksParams, options?: RequestOptions): Promise<any>;
|
|
245
245
|
getVariableMetadata(params: GetVariableMetadataParams, options?: RequestOptions): Promise<any>;
|
|
246
|
+
sendNode(params: {
|
|
247
|
+
entryId: string;
|
|
248
|
+
scheduledAt?: number;
|
|
249
|
+
}, options?: RequestOptions): Promise<any>;
|
|
250
|
+
cancelSend(params: {
|
|
251
|
+
nodeId: string;
|
|
252
|
+
sendId: string;
|
|
253
|
+
}, options?: RequestOptions): Promise<any>;
|
|
254
|
+
getSubscribers(params: {
|
|
255
|
+
nodeId: string;
|
|
256
|
+
}, options?: RequestOptions): Promise<any>;
|
|
246
257
|
};
|
|
247
258
|
eshop: {
|
|
248
259
|
createProduct(params: CreateProductParams, options?: RequestOptions): Promise<any>;
|
|
@@ -312,24 +323,6 @@ declare function createArkySDK(config: HttpClientConfig & {
|
|
|
312
323
|
getCountries(options?: RequestOptions): Promise<GetCountriesResponse>;
|
|
313
324
|
getCountryStates(countryCode: string, options?: RequestOptions): Promise<LocationCountry>;
|
|
314
325
|
};
|
|
315
|
-
newsletter: {
|
|
316
|
-
createNewsletter(params: CreateNewsletterParams, options?: RequestOptions<Newsletter>): Promise<Newsletter>;
|
|
317
|
-
getNewsletter(params: GetNewsletterParams, options?: RequestOptions<Newsletter>): Promise<Newsletter>;
|
|
318
|
-
getNewsletters(params?: GetNewslettersParams, options?: RequestOptions<Paginated<Newsletter>>): Promise<Paginated<Newsletter>>;
|
|
319
|
-
updateNewsletter(params: UpdateNewsletterParams, options?: RequestOptions<Newsletter>): Promise<Newsletter>;
|
|
320
|
-
deleteNewsletter(params: DeleteNewsletterParams, options?: RequestOptions<boolean>): Promise<boolean>;
|
|
321
|
-
getSubscribers(params: GetSubscribersParams, options?: RequestOptions<SubscriberInfo[]>): Promise<SubscriberInfo[]>;
|
|
322
|
-
createPost(params: CreateNewsletterPostParams, options?: RequestOptions<NewsletterPost>): Promise<NewsletterPost>;
|
|
323
|
-
getPost(params: GetNewsletterPostParams, options?: RequestOptions<NewsletterPost>): Promise<NewsletterPost>;
|
|
324
|
-
getPosts(params: GetNewsletterPostsParams, options?: RequestOptions<Paginated<NewsletterPost>>): Promise<Paginated<NewsletterPost>>;
|
|
325
|
-
updatePost(params: UpdateNewsletterPostParams, options?: RequestOptions<NewsletterPost>): Promise<NewsletterPost>;
|
|
326
|
-
deletePost(params: DeleteNewsletterPostParams, options?: RequestOptions<boolean>): Promise<boolean>;
|
|
327
|
-
scheduleSend(params: ScheduleSendParams, options?: RequestOptions<NewsletterPost>): Promise<NewsletterPost>;
|
|
328
|
-
cancelSend(params: CancelSendParams, options?: RequestOptions<NewsletterPost>): Promise<NewsletterPost>;
|
|
329
|
-
publishPost(newsletterId: string, postId: string): Promise<NewsletterPost>;
|
|
330
|
-
archivePost(newsletterId: string, postId: string): Promise<NewsletterPost>;
|
|
331
|
-
sendNow(newsletterId: string, postId: string): Promise<NewsletterPost>;
|
|
332
|
-
};
|
|
333
326
|
setBusinessId: (businessId: string) => void;
|
|
334
327
|
getBusinessId: () => string;
|
|
335
328
|
setMarket: (market: string) => void;
|
package/dist/index.js
CHANGED
|
@@ -814,6 +814,36 @@ var createCmsApi = (apiConfig) => {
|
|
|
814
814
|
`/v1/businesses/${apiConfig.businessId}/nodes/types/${params.nodeType}/variables`,
|
|
815
815
|
options
|
|
816
816
|
);
|
|
817
|
+
},
|
|
818
|
+
/**
|
|
819
|
+
* Send a node to all subscribers (schedule or immediate)
|
|
820
|
+
*/
|
|
821
|
+
async sendNode(params, options) {
|
|
822
|
+
const { entryId, ...body } = params;
|
|
823
|
+
return apiConfig.httpClient.post(
|
|
824
|
+
`/v1/businesses/${apiConfig.businessId}/nodes/${entryId}/send`,
|
|
825
|
+
body,
|
|
826
|
+
options
|
|
827
|
+
);
|
|
828
|
+
},
|
|
829
|
+
/**
|
|
830
|
+
* Cancel a scheduled send
|
|
831
|
+
*/
|
|
832
|
+
async cancelSend(params, options) {
|
|
833
|
+
return apiConfig.httpClient.post(
|
|
834
|
+
`/v1/businesses/${apiConfig.businessId}/nodes/${params.nodeId}/send/${params.sendId}/cancel`,
|
|
835
|
+
{},
|
|
836
|
+
options
|
|
837
|
+
);
|
|
838
|
+
},
|
|
839
|
+
/**
|
|
840
|
+
* Get subscribers for a node
|
|
841
|
+
*/
|
|
842
|
+
async getSubscribers(params, options) {
|
|
843
|
+
return apiConfig.httpClient.get(
|
|
844
|
+
`/v1/businesses/${apiConfig.businessId}/nodes/${params.nodeId}/subscribers`,
|
|
845
|
+
options
|
|
846
|
+
);
|
|
817
847
|
}
|
|
818
848
|
};
|
|
819
849
|
};
|
|
@@ -1273,180 +1303,6 @@ var createLocationApi = (apiConfig) => {
|
|
|
1273
1303
|
};
|
|
1274
1304
|
};
|
|
1275
1305
|
|
|
1276
|
-
// src/api/newsletter.ts
|
|
1277
|
-
var createNewsletterApi = (apiConfig) => {
|
|
1278
|
-
return {
|
|
1279
|
-
// ===== NEWSLETTER CRUD =====
|
|
1280
|
-
/**
|
|
1281
|
-
* Create a new newsletter
|
|
1282
|
-
*/
|
|
1283
|
-
async createNewsletter(params, options) {
|
|
1284
|
-
return apiConfig.httpClient.post(
|
|
1285
|
-
`/v1/businesses/${apiConfig.businessId}/newsletters`,
|
|
1286
|
-
params,
|
|
1287
|
-
options
|
|
1288
|
-
);
|
|
1289
|
-
},
|
|
1290
|
-
/**
|
|
1291
|
-
* Get a newsletter by ID
|
|
1292
|
-
*/
|
|
1293
|
-
async getNewsletter(params, options) {
|
|
1294
|
-
return apiConfig.httpClient.get(
|
|
1295
|
-
`/v1/businesses/${apiConfig.businessId}/newsletters/${params.id}`,
|
|
1296
|
-
options
|
|
1297
|
-
);
|
|
1298
|
-
},
|
|
1299
|
-
/**
|
|
1300
|
-
* List all newsletters for the business
|
|
1301
|
-
*/
|
|
1302
|
-
async getNewsletters(params, options) {
|
|
1303
|
-
return apiConfig.httpClient.get(
|
|
1304
|
-
`/v1/businesses/${apiConfig.businessId}/newsletters`,
|
|
1305
|
-
{
|
|
1306
|
-
...options,
|
|
1307
|
-
params
|
|
1308
|
-
}
|
|
1309
|
-
);
|
|
1310
|
-
},
|
|
1311
|
-
/**
|
|
1312
|
-
* Update a newsletter
|
|
1313
|
-
*/
|
|
1314
|
-
async updateNewsletter(params, options) {
|
|
1315
|
-
const { id, ...body } = params;
|
|
1316
|
-
return apiConfig.httpClient.put(
|
|
1317
|
-
`/v1/businesses/${apiConfig.businessId}/newsletters/${id}`,
|
|
1318
|
-
body,
|
|
1319
|
-
options
|
|
1320
|
-
);
|
|
1321
|
-
},
|
|
1322
|
-
/**
|
|
1323
|
-
* Delete a newsletter
|
|
1324
|
-
*/
|
|
1325
|
-
async deleteNewsletter(params, options) {
|
|
1326
|
-
return apiConfig.httpClient.delete(
|
|
1327
|
-
`/v1/businesses/${apiConfig.businessId}/newsletters/${params.id}`,
|
|
1328
|
-
options
|
|
1329
|
-
);
|
|
1330
|
-
},
|
|
1331
|
-
/**
|
|
1332
|
-
* Get subscribers for a newsletter
|
|
1333
|
-
*/
|
|
1334
|
-
async getSubscribers(params, options) {
|
|
1335
|
-
return apiConfig.httpClient.get(
|
|
1336
|
-
`/v1/businesses/${apiConfig.businessId}/newsletters/${params.id}/subscribers`,
|
|
1337
|
-
options
|
|
1338
|
-
);
|
|
1339
|
-
},
|
|
1340
|
-
// ===== POST CRUD =====
|
|
1341
|
-
/**
|
|
1342
|
-
* Create a new post for a newsletter
|
|
1343
|
-
*/
|
|
1344
|
-
async createPost(params, options) {
|
|
1345
|
-
const { newsletterId, ...body } = params;
|
|
1346
|
-
return apiConfig.httpClient.post(
|
|
1347
|
-
`/v1/businesses/${apiConfig.businessId}/newsletters/${newsletterId}/posts`,
|
|
1348
|
-
body,
|
|
1349
|
-
options
|
|
1350
|
-
);
|
|
1351
|
-
},
|
|
1352
|
-
/**
|
|
1353
|
-
* Get a post by ID
|
|
1354
|
-
*/
|
|
1355
|
-
async getPost(params, options) {
|
|
1356
|
-
return apiConfig.httpClient.get(
|
|
1357
|
-
`/v1/businesses/${apiConfig.businessId}/newsletters/${params.newsletterId}/posts/${params.postId}`,
|
|
1358
|
-
options
|
|
1359
|
-
);
|
|
1360
|
-
},
|
|
1361
|
-
/**
|
|
1362
|
-
* List all posts for a newsletter
|
|
1363
|
-
*/
|
|
1364
|
-
async getPosts(params, options) {
|
|
1365
|
-
const { newsletterId, ...queryParams } = params;
|
|
1366
|
-
return apiConfig.httpClient.get(
|
|
1367
|
-
`/v1/businesses/${apiConfig.businessId}/newsletters/${newsletterId}/posts`,
|
|
1368
|
-
{
|
|
1369
|
-
...options,
|
|
1370
|
-
params: queryParams
|
|
1371
|
-
}
|
|
1372
|
-
);
|
|
1373
|
-
},
|
|
1374
|
-
/**
|
|
1375
|
-
* Update a post
|
|
1376
|
-
*/
|
|
1377
|
-
async updatePost(params, options) {
|
|
1378
|
-
const { newsletterId, postId, ...body } = params;
|
|
1379
|
-
return apiConfig.httpClient.put(
|
|
1380
|
-
`/v1/businesses/${apiConfig.businessId}/newsletters/${newsletterId}/posts/${postId}`,
|
|
1381
|
-
body,
|
|
1382
|
-
options
|
|
1383
|
-
);
|
|
1384
|
-
},
|
|
1385
|
-
/**
|
|
1386
|
-
* Delete a post
|
|
1387
|
-
*/
|
|
1388
|
-
async deletePost(params, options) {
|
|
1389
|
-
return apiConfig.httpClient.delete(
|
|
1390
|
-
`/v1/businesses/${apiConfig.businessId}/newsletters/${params.newsletterId}/posts/${params.postId}`,
|
|
1391
|
-
options
|
|
1392
|
-
);
|
|
1393
|
-
},
|
|
1394
|
-
// ===== SEND OPERATIONS =====
|
|
1395
|
-
/**
|
|
1396
|
-
* Schedule a send for a post
|
|
1397
|
-
*/
|
|
1398
|
-
async scheduleSend(params, options) {
|
|
1399
|
-
const { newsletterId, postId, ...body } = params;
|
|
1400
|
-
return apiConfig.httpClient.post(
|
|
1401
|
-
`/v1/businesses/${apiConfig.businessId}/newsletters/${newsletterId}/posts/${postId}/send`,
|
|
1402
|
-
body,
|
|
1403
|
-
options
|
|
1404
|
-
);
|
|
1405
|
-
},
|
|
1406
|
-
/**
|
|
1407
|
-
* Cancel a scheduled send
|
|
1408
|
-
*/
|
|
1409
|
-
async cancelSend(params, options) {
|
|
1410
|
-
const { newsletterId, postId, sendId } = params;
|
|
1411
|
-
return apiConfig.httpClient.post(
|
|
1412
|
-
`/v1/businesses/${apiConfig.businessId}/newsletters/${newsletterId}/posts/${postId}/send/${sendId}/cancel`,
|
|
1413
|
-
{},
|
|
1414
|
-
options
|
|
1415
|
-
);
|
|
1416
|
-
},
|
|
1417
|
-
// ===== CONVENIENCE METHODS =====
|
|
1418
|
-
/**
|
|
1419
|
-
* Publish a post (set status to PUBLISHED)
|
|
1420
|
-
*/
|
|
1421
|
-
async publishPost(newsletterId, postId) {
|
|
1422
|
-
return this.updatePost({
|
|
1423
|
-
newsletterId,
|
|
1424
|
-
postId,
|
|
1425
|
-
status: "PUBLISHED"
|
|
1426
|
-
});
|
|
1427
|
-
},
|
|
1428
|
-
/**
|
|
1429
|
-
* Archive a post (set status to ARCHIVED)
|
|
1430
|
-
*/
|
|
1431
|
-
async archivePost(newsletterId, postId) {
|
|
1432
|
-
return this.updatePost({
|
|
1433
|
-
newsletterId,
|
|
1434
|
-
postId,
|
|
1435
|
-
status: "ARCHIVED"
|
|
1436
|
-
});
|
|
1437
|
-
},
|
|
1438
|
-
/**
|
|
1439
|
-
* Send a post immediately
|
|
1440
|
-
*/
|
|
1441
|
-
async sendNow(newsletterId, postId) {
|
|
1442
|
-
return this.scheduleSend({
|
|
1443
|
-
newsletterId,
|
|
1444
|
-
postId
|
|
1445
|
-
});
|
|
1446
|
-
}
|
|
1447
|
-
};
|
|
1448
|
-
};
|
|
1449
|
-
|
|
1450
1306
|
// src/utils/currency.ts
|
|
1451
1307
|
function getCurrencySymbol(currency) {
|
|
1452
1308
|
const currencySymbols = {
|
|
@@ -1833,7 +1689,7 @@ function nameToKey(name) {
|
|
|
1833
1689
|
}
|
|
1834
1690
|
|
|
1835
1691
|
// src/index.ts
|
|
1836
|
-
var SDK_VERSION = "0.3.
|
|
1692
|
+
var SDK_VERSION = "0.3.132";
|
|
1837
1693
|
var SUPPORTED_FRAMEWORKS = [
|
|
1838
1694
|
"astro",
|
|
1839
1695
|
"react",
|
|
@@ -1884,7 +1740,6 @@ async function createArkySDK(config) {
|
|
|
1884
1740
|
database: createDatabaseApi(apiConfig),
|
|
1885
1741
|
featureFlags: createFeatureFlagsApi(apiConfig),
|
|
1886
1742
|
location: createLocationApi(apiConfig),
|
|
1887
|
-
newsletter: createNewsletterApi(apiConfig),
|
|
1888
1743
|
setBusinessId: (businessId) => {
|
|
1889
1744
|
apiConfig.businessId = businessId;
|
|
1890
1745
|
},
|