@diffsome/sdk 3.2.7 → 3.2.8
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.mts +84 -11
- package/dist/index.d.ts +84 -11
- package/dist/index.js +37 -0
- package/dist/index.mjs +37 -0
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -7659,9 +7659,9 @@ interface operations {
|
|
|
7659
7659
|
"product.index": {
|
|
7660
7660
|
parameters: {
|
|
7661
7661
|
query?: {
|
|
7662
|
+
type?: string;
|
|
7662
7663
|
category_id?: string;
|
|
7663
7664
|
category?: string;
|
|
7664
|
-
type?: string;
|
|
7665
7665
|
min_price?: string;
|
|
7666
7666
|
max_price?: string;
|
|
7667
7667
|
search?: string;
|
|
@@ -9220,7 +9220,7 @@ interface operations {
|
|
|
9220
9220
|
message: "Success";
|
|
9221
9221
|
data: {
|
|
9222
9222
|
subscriptions: {
|
|
9223
|
-
id:
|
|
9223
|
+
id: number;
|
|
9224
9224
|
product: {
|
|
9225
9225
|
id: number;
|
|
9226
9226
|
name: string;
|
|
@@ -9313,7 +9313,7 @@ interface operations {
|
|
|
9313
9313
|
message: 201;
|
|
9314
9314
|
data: {
|
|
9315
9315
|
subscription: {
|
|
9316
|
-
id:
|
|
9316
|
+
id: number;
|
|
9317
9317
|
product: {
|
|
9318
9318
|
id: number;
|
|
9319
9319
|
name: string;
|
|
@@ -9419,7 +9419,7 @@ interface operations {
|
|
|
9419
9419
|
message: "Success";
|
|
9420
9420
|
data: {
|
|
9421
9421
|
subscription: {
|
|
9422
|
-
id:
|
|
9422
|
+
id: number;
|
|
9423
9423
|
product: {
|
|
9424
9424
|
id: number;
|
|
9425
9425
|
name: string;
|
|
@@ -9602,7 +9602,7 @@ interface operations {
|
|
|
9602
9602
|
message: "Success";
|
|
9603
9603
|
data: {
|
|
9604
9604
|
subscription: {
|
|
9605
|
-
id:
|
|
9605
|
+
id: number;
|
|
9606
9606
|
product: {
|
|
9607
9607
|
id: number;
|
|
9608
9608
|
name: string;
|
|
@@ -9696,7 +9696,7 @@ interface operations {
|
|
|
9696
9696
|
message: "Success";
|
|
9697
9697
|
data: {
|
|
9698
9698
|
subscription: {
|
|
9699
|
-
id:
|
|
9699
|
+
id: number;
|
|
9700
9700
|
product: {
|
|
9701
9701
|
id: number;
|
|
9702
9702
|
name: string;
|
|
@@ -9807,7 +9807,7 @@ interface operations {
|
|
|
9807
9807
|
message: "Success";
|
|
9808
9808
|
data: {
|
|
9809
9809
|
subscription: {
|
|
9810
|
-
id:
|
|
9810
|
+
id: number;
|
|
9811
9811
|
product: {
|
|
9812
9812
|
id: number;
|
|
9813
9813
|
name: string;
|
|
@@ -9918,7 +9918,7 @@ interface operations {
|
|
|
9918
9918
|
message: "Success";
|
|
9919
9919
|
data: {
|
|
9920
9920
|
subscription: {
|
|
9921
|
-
id:
|
|
9921
|
+
id: number;
|
|
9922
9922
|
product: {
|
|
9923
9923
|
id: number;
|
|
9924
9924
|
name: string;
|
|
@@ -10690,11 +10690,23 @@ type BoardPost = Schemas['BoardPostResource'];
|
|
|
10690
10690
|
type BoardCollection = Schemas['BoardCollection'];
|
|
10691
10691
|
type BoardPostCollection = Schemas['BoardPostCollection'];
|
|
10692
10692
|
type Member = Schemas['MemberResource'];
|
|
10693
|
-
type Product = Schemas['ProductResource']
|
|
10693
|
+
type Product = Schemas['ProductResource'] & {
|
|
10694
|
+
/** Formatted sale price with currency symbol */
|
|
10695
|
+
formatted_sale_price?: string;
|
|
10696
|
+
/** Formatted regular price with currency symbol */
|
|
10697
|
+
formatted_regular_price?: string | null;
|
|
10698
|
+
};
|
|
10694
10699
|
type ProductCategory = Schemas['ProductCategoryResource'];
|
|
10695
10700
|
type ProductAttribute = Schemas['ProductAttributeResource'];
|
|
10696
10701
|
type ProductAttributeValue = Schemas['ProductAttributeValueResource'];
|
|
10697
|
-
type ProductVariant = Schemas['ProductVariantResource']
|
|
10702
|
+
type ProductVariant = Schemas['ProductVariantResource'] & {
|
|
10703
|
+
/** Formatted sale price with currency symbol */
|
|
10704
|
+
formatted_sale_price?: string | null;
|
|
10705
|
+
/** Formatted regular price with currency symbol */
|
|
10706
|
+
formatted_regular_price?: string | null;
|
|
10707
|
+
/** Formatted final price with currency symbol */
|
|
10708
|
+
formatted_final_price?: string;
|
|
10709
|
+
};
|
|
10698
10710
|
type ProductCollection = Schemas['ProductCollection'];
|
|
10699
10711
|
type ProductCategoryCollection = Schemas['ProductCategoryCollection'];
|
|
10700
10712
|
/** @deprecated Use ProductAttribute instead */
|
|
@@ -11072,7 +11084,14 @@ interface StripeVerifyResponse {
|
|
|
11072
11084
|
approved_at?: string;
|
|
11073
11085
|
};
|
|
11074
11086
|
}
|
|
11087
|
+
interface CurrencyInfo {
|
|
11088
|
+
code: string;
|
|
11089
|
+
symbol: string;
|
|
11090
|
+
position: 'before' | 'after';
|
|
11091
|
+
decimals: number;
|
|
11092
|
+
}
|
|
11075
11093
|
interface PaymentStatusResponse {
|
|
11094
|
+
currency: CurrencyInfo;
|
|
11076
11095
|
toss: {
|
|
11077
11096
|
available: boolean;
|
|
11078
11097
|
};
|
|
@@ -11509,6 +11528,34 @@ interface BundlePricing {
|
|
|
11509
11528
|
interface ProductListParamsExtended extends ProductListParams {
|
|
11510
11529
|
type?: ProductType;
|
|
11511
11530
|
}
|
|
11531
|
+
interface SiteInfo {
|
|
11532
|
+
id: string;
|
|
11533
|
+
name: string;
|
|
11534
|
+
tagline?: string;
|
|
11535
|
+
description?: string;
|
|
11536
|
+
logo?: string;
|
|
11537
|
+
favicon?: string;
|
|
11538
|
+
currency: CurrencyInfo;
|
|
11539
|
+
timezone: string;
|
|
11540
|
+
language: string;
|
|
11541
|
+
seo: {
|
|
11542
|
+
title?: string;
|
|
11543
|
+
description?: string;
|
|
11544
|
+
keywords?: string;
|
|
11545
|
+
og_image?: string;
|
|
11546
|
+
};
|
|
11547
|
+
social: {
|
|
11548
|
+
facebook?: string;
|
|
11549
|
+
instagram?: string;
|
|
11550
|
+
twitter?: string;
|
|
11551
|
+
youtube?: string;
|
|
11552
|
+
};
|
|
11553
|
+
contact: {
|
|
11554
|
+
email?: string;
|
|
11555
|
+
phone?: string;
|
|
11556
|
+
address?: string;
|
|
11557
|
+
};
|
|
11558
|
+
}
|
|
11512
11559
|
|
|
11513
11560
|
/**
|
|
11514
11561
|
* HTTP Client for Diffsome SDK
|
|
@@ -12510,6 +12557,30 @@ declare class ReservationResource {
|
|
|
12510
12557
|
cancel(reservationNumber: string, reason?: string): Promise<Reservation>;
|
|
12511
12558
|
}
|
|
12512
12559
|
|
|
12560
|
+
/**
|
|
12561
|
+
* Site Resource for Diffsome SDK
|
|
12562
|
+
*/
|
|
12563
|
+
|
|
12564
|
+
declare class SiteResource {
|
|
12565
|
+
private http;
|
|
12566
|
+
constructor(http: HttpClient);
|
|
12567
|
+
/**
|
|
12568
|
+
* Get site information
|
|
12569
|
+
* Returns site settings including currency, SEO, contact info
|
|
12570
|
+
*/
|
|
12571
|
+
getInfo(): Promise<SiteInfo>;
|
|
12572
|
+
/**
|
|
12573
|
+
* Get currency info only (lightweight)
|
|
12574
|
+
*/
|
|
12575
|
+
getCurrency(): Promise<CurrencyInfo>;
|
|
12576
|
+
/**
|
|
12577
|
+
* Format price with site's currency settings
|
|
12578
|
+
* @param amount - The amount to format
|
|
12579
|
+
* @param currency - Optional currency info (uses fetched currency if not provided)
|
|
12580
|
+
*/
|
|
12581
|
+
formatPrice(amount: number, currency: CurrencyInfo): string;
|
|
12582
|
+
}
|
|
12583
|
+
|
|
12513
12584
|
/**
|
|
12514
12585
|
* Diffsome SDK
|
|
12515
12586
|
*
|
|
@@ -12552,6 +12623,8 @@ declare class Diffsome {
|
|
|
12552
12623
|
readonly entities: EntitiesResource;
|
|
12553
12624
|
/** Reservations - booking services and time slots */
|
|
12554
12625
|
readonly reservation: ReservationResource;
|
|
12626
|
+
/** Site settings - currency, SEO, contact info */
|
|
12627
|
+
readonly site: SiteResource;
|
|
12555
12628
|
constructor(config: DiffsomeConfig);
|
|
12556
12629
|
/**
|
|
12557
12630
|
* Check if user is authenticated
|
|
@@ -12587,4 +12660,4 @@ declare class Diffsome {
|
|
|
12587
12660
|
getApiKey(): string | null;
|
|
12588
12661
|
}
|
|
12589
12662
|
|
|
12590
|
-
export { type $defs, type AddToCartData, type AddToWishlistData, type ApiError, type ApplyCouponData, type AuthResponse, type AvailableDatesParams, type AvailableSlotsParams, type BlogCategory, type BlogListParams, type BlogPost, type BlogPostCollection, type Board, type BoardCollection, type BoardComment, type BoardListParams, type BoardPost, type BoardPostCollection, type BoardPostListParams, type BundleItem, type BundlePricing, type CanReviewResponse, type Cart, type CartItem, type CartShippingInfo, type Comment, type CommentCollection, type CommentListParams$1 as CommentListParams, type Coupon, type CouponType, type CouponValidation, type CreateBoardPostData, type CreateCommentData, type CreateEntityData, type CreateEntityRecordData, type CreateOrderData, type CreatePostData, type CreateProductReviewData, type CreateReservationData, type CreateReservationResult, type CreateSubscriptionData, type CreateSubscriptionResult, type CustomEntity, Diffsome, type DiffsomeConfig, DiffsomeError, type DigitalDownloadLink, type DigitalFile, type Entity, type EntityField, type EntityListParams, type EntityRecord, type EntitySchema, type ForgotPasswordData, type Form, type FormListParams, type FormSubmission, type FormSubmissionData, type ListParams, type ListResponse, type LoginCredentials, type Media, type Member, type MemberSubscription, type Order, type OrderItem, type OrderListParams, type OrderOrderer, type OrderShipping, type OrderStatus, type PaginatedResponse, type PaginationMeta, type Payment, type PaymentCancelData, type PaymentConfirmData, type PaymentMethod, type PaymentReadyData, type PaymentStatus, type PaymentStatusResponse, type PostListParams, type Product, type ProductAttribute, type ProductAttributeValue, type ProductCategory, type ProductCategoryCollection, type ProductCollection, type ProductListParams, type ProductListParamsExtended, type ProductOption, type ProductOptionValue, type ProductReview, type ProductReviewAuthor, type ProductReviewListParams, type ProductReviewStats, type ProductStatus, type ProductType, type ProductVariant, Diffsome as Promptly, type PromptlyConfig, DiffsomeError as PromptlyError, type RegisterData, type Reservation, type ReservationListParams, type ReservationService, type ReservationServiceStaff, type ReservationSettings, type ReservationSlot, type ReservationStaff, type ResetPasswordData, type SetupIntentResult, type SocialAuthUrl, type SocialProvider, type StripeCheckoutData, type StripeCheckoutResponse, type StripeVerifyData, type StripeVerifyResponse, type SubmissionListParams, type SubmitFormData, type SubscriptionInterval, type SubscriptionPlan, type SubscriptionStatus, type TossPaymentConfirmData, type TossPaymentConfirmResponse, type TossPaymentReadyData, type TossPaymentReadyResponse, type UpdateBoardPostData, type UpdateCartItemData, type UpdateCommentData, type UpdateEntityData, type UpdateEntityRecordData, type UpdatePostData, type UpdateProductReviewData, type UpdateProfileData, type WishlistCheckBulkResult, type WishlistCheckResult, type WishlistItem, type WishlistListParams, type WishlistMoveToCartResult, type WishlistToggleResult, type components, Diffsome as default, type operations, type paths, type webhooks };
|
|
12663
|
+
export { type $defs, type AddToCartData, type AddToWishlistData, type ApiError, type ApplyCouponData, type AuthResponse, type AvailableDatesParams, type AvailableSlotsParams, type BlogCategory, type BlogListParams, type BlogPost, type BlogPostCollection, type Board, type BoardCollection, type BoardComment, type BoardListParams, type BoardPost, type BoardPostCollection, type BoardPostListParams, type BundleItem, type BundlePricing, type CanReviewResponse, type Cart, type CartItem, type CartShippingInfo, type Comment, type CommentCollection, type CommentListParams$1 as CommentListParams, type Coupon, type CouponType, type CouponValidation, type CreateBoardPostData, type CreateCommentData, type CreateEntityData, type CreateEntityRecordData, type CreateOrderData, type CreatePostData, type CreateProductReviewData, type CreateReservationData, type CreateReservationResult, type CreateSubscriptionData, type CreateSubscriptionResult, type CurrencyInfo, type CustomEntity, Diffsome, type DiffsomeConfig, DiffsomeError, type DigitalDownloadLink, type DigitalFile, type Entity, type EntityField, type EntityListParams, type EntityRecord, type EntitySchema, type ForgotPasswordData, type Form, type FormListParams, type FormSubmission, type FormSubmissionData, type ListParams, type ListResponse, type LoginCredentials, type Media, type Member, type MemberSubscription, type Order, type OrderItem, type OrderListParams, type OrderOrderer, type OrderShipping, type OrderStatus, type PaginatedResponse, type PaginationMeta, type Payment, type PaymentCancelData, type PaymentConfirmData, type PaymentMethod, type PaymentReadyData, type PaymentStatus, type PaymentStatusResponse, type PostListParams, type Product, type ProductAttribute, type ProductAttributeValue, type ProductCategory, type ProductCategoryCollection, type ProductCollection, type ProductListParams, type ProductListParamsExtended, type ProductOption, type ProductOptionValue, type ProductReview, type ProductReviewAuthor, type ProductReviewListParams, type ProductReviewStats, type ProductStatus, type ProductType, type ProductVariant, Diffsome as Promptly, type PromptlyConfig, DiffsomeError as PromptlyError, type RegisterData, type Reservation, type ReservationListParams, type ReservationService, type ReservationServiceStaff, type ReservationSettings, type ReservationSlot, type ReservationStaff, type ResetPasswordData, type SetupIntentResult, type SiteInfo, type SocialAuthUrl, type SocialProvider, type StripeCheckoutData, type StripeCheckoutResponse, type StripeVerifyData, type StripeVerifyResponse, type SubmissionListParams, type SubmitFormData, type SubscriptionInterval, type SubscriptionPlan, type SubscriptionStatus, type TossPaymentConfirmData, type TossPaymentConfirmResponse, type TossPaymentReadyData, type TossPaymentReadyResponse, type UpdateBoardPostData, type UpdateCartItemData, type UpdateCommentData, type UpdateEntityData, type UpdateEntityRecordData, type UpdatePostData, type UpdateProductReviewData, type UpdateProfileData, type WishlistCheckBulkResult, type WishlistCheckResult, type WishlistItem, type WishlistListParams, type WishlistMoveToCartResult, type WishlistToggleResult, type components, Diffsome as default, type operations, type paths, type webhooks };
|
package/dist/index.d.ts
CHANGED
|
@@ -7659,9 +7659,9 @@ interface operations {
|
|
|
7659
7659
|
"product.index": {
|
|
7660
7660
|
parameters: {
|
|
7661
7661
|
query?: {
|
|
7662
|
+
type?: string;
|
|
7662
7663
|
category_id?: string;
|
|
7663
7664
|
category?: string;
|
|
7664
|
-
type?: string;
|
|
7665
7665
|
min_price?: string;
|
|
7666
7666
|
max_price?: string;
|
|
7667
7667
|
search?: string;
|
|
@@ -9220,7 +9220,7 @@ interface operations {
|
|
|
9220
9220
|
message: "Success";
|
|
9221
9221
|
data: {
|
|
9222
9222
|
subscriptions: {
|
|
9223
|
-
id:
|
|
9223
|
+
id: number;
|
|
9224
9224
|
product: {
|
|
9225
9225
|
id: number;
|
|
9226
9226
|
name: string;
|
|
@@ -9313,7 +9313,7 @@ interface operations {
|
|
|
9313
9313
|
message: 201;
|
|
9314
9314
|
data: {
|
|
9315
9315
|
subscription: {
|
|
9316
|
-
id:
|
|
9316
|
+
id: number;
|
|
9317
9317
|
product: {
|
|
9318
9318
|
id: number;
|
|
9319
9319
|
name: string;
|
|
@@ -9419,7 +9419,7 @@ interface operations {
|
|
|
9419
9419
|
message: "Success";
|
|
9420
9420
|
data: {
|
|
9421
9421
|
subscription: {
|
|
9422
|
-
id:
|
|
9422
|
+
id: number;
|
|
9423
9423
|
product: {
|
|
9424
9424
|
id: number;
|
|
9425
9425
|
name: string;
|
|
@@ -9602,7 +9602,7 @@ interface operations {
|
|
|
9602
9602
|
message: "Success";
|
|
9603
9603
|
data: {
|
|
9604
9604
|
subscription: {
|
|
9605
|
-
id:
|
|
9605
|
+
id: number;
|
|
9606
9606
|
product: {
|
|
9607
9607
|
id: number;
|
|
9608
9608
|
name: string;
|
|
@@ -9696,7 +9696,7 @@ interface operations {
|
|
|
9696
9696
|
message: "Success";
|
|
9697
9697
|
data: {
|
|
9698
9698
|
subscription: {
|
|
9699
|
-
id:
|
|
9699
|
+
id: number;
|
|
9700
9700
|
product: {
|
|
9701
9701
|
id: number;
|
|
9702
9702
|
name: string;
|
|
@@ -9807,7 +9807,7 @@ interface operations {
|
|
|
9807
9807
|
message: "Success";
|
|
9808
9808
|
data: {
|
|
9809
9809
|
subscription: {
|
|
9810
|
-
id:
|
|
9810
|
+
id: number;
|
|
9811
9811
|
product: {
|
|
9812
9812
|
id: number;
|
|
9813
9813
|
name: string;
|
|
@@ -9918,7 +9918,7 @@ interface operations {
|
|
|
9918
9918
|
message: "Success";
|
|
9919
9919
|
data: {
|
|
9920
9920
|
subscription: {
|
|
9921
|
-
id:
|
|
9921
|
+
id: number;
|
|
9922
9922
|
product: {
|
|
9923
9923
|
id: number;
|
|
9924
9924
|
name: string;
|
|
@@ -10690,11 +10690,23 @@ type BoardPost = Schemas['BoardPostResource'];
|
|
|
10690
10690
|
type BoardCollection = Schemas['BoardCollection'];
|
|
10691
10691
|
type BoardPostCollection = Schemas['BoardPostCollection'];
|
|
10692
10692
|
type Member = Schemas['MemberResource'];
|
|
10693
|
-
type Product = Schemas['ProductResource']
|
|
10693
|
+
type Product = Schemas['ProductResource'] & {
|
|
10694
|
+
/** Formatted sale price with currency symbol */
|
|
10695
|
+
formatted_sale_price?: string;
|
|
10696
|
+
/** Formatted regular price with currency symbol */
|
|
10697
|
+
formatted_regular_price?: string | null;
|
|
10698
|
+
};
|
|
10694
10699
|
type ProductCategory = Schemas['ProductCategoryResource'];
|
|
10695
10700
|
type ProductAttribute = Schemas['ProductAttributeResource'];
|
|
10696
10701
|
type ProductAttributeValue = Schemas['ProductAttributeValueResource'];
|
|
10697
|
-
type ProductVariant = Schemas['ProductVariantResource']
|
|
10702
|
+
type ProductVariant = Schemas['ProductVariantResource'] & {
|
|
10703
|
+
/** Formatted sale price with currency symbol */
|
|
10704
|
+
formatted_sale_price?: string | null;
|
|
10705
|
+
/** Formatted regular price with currency symbol */
|
|
10706
|
+
formatted_regular_price?: string | null;
|
|
10707
|
+
/** Formatted final price with currency symbol */
|
|
10708
|
+
formatted_final_price?: string;
|
|
10709
|
+
};
|
|
10698
10710
|
type ProductCollection = Schemas['ProductCollection'];
|
|
10699
10711
|
type ProductCategoryCollection = Schemas['ProductCategoryCollection'];
|
|
10700
10712
|
/** @deprecated Use ProductAttribute instead */
|
|
@@ -11072,7 +11084,14 @@ interface StripeVerifyResponse {
|
|
|
11072
11084
|
approved_at?: string;
|
|
11073
11085
|
};
|
|
11074
11086
|
}
|
|
11087
|
+
interface CurrencyInfo {
|
|
11088
|
+
code: string;
|
|
11089
|
+
symbol: string;
|
|
11090
|
+
position: 'before' | 'after';
|
|
11091
|
+
decimals: number;
|
|
11092
|
+
}
|
|
11075
11093
|
interface PaymentStatusResponse {
|
|
11094
|
+
currency: CurrencyInfo;
|
|
11076
11095
|
toss: {
|
|
11077
11096
|
available: boolean;
|
|
11078
11097
|
};
|
|
@@ -11509,6 +11528,34 @@ interface BundlePricing {
|
|
|
11509
11528
|
interface ProductListParamsExtended extends ProductListParams {
|
|
11510
11529
|
type?: ProductType;
|
|
11511
11530
|
}
|
|
11531
|
+
interface SiteInfo {
|
|
11532
|
+
id: string;
|
|
11533
|
+
name: string;
|
|
11534
|
+
tagline?: string;
|
|
11535
|
+
description?: string;
|
|
11536
|
+
logo?: string;
|
|
11537
|
+
favicon?: string;
|
|
11538
|
+
currency: CurrencyInfo;
|
|
11539
|
+
timezone: string;
|
|
11540
|
+
language: string;
|
|
11541
|
+
seo: {
|
|
11542
|
+
title?: string;
|
|
11543
|
+
description?: string;
|
|
11544
|
+
keywords?: string;
|
|
11545
|
+
og_image?: string;
|
|
11546
|
+
};
|
|
11547
|
+
social: {
|
|
11548
|
+
facebook?: string;
|
|
11549
|
+
instagram?: string;
|
|
11550
|
+
twitter?: string;
|
|
11551
|
+
youtube?: string;
|
|
11552
|
+
};
|
|
11553
|
+
contact: {
|
|
11554
|
+
email?: string;
|
|
11555
|
+
phone?: string;
|
|
11556
|
+
address?: string;
|
|
11557
|
+
};
|
|
11558
|
+
}
|
|
11512
11559
|
|
|
11513
11560
|
/**
|
|
11514
11561
|
* HTTP Client for Diffsome SDK
|
|
@@ -12510,6 +12557,30 @@ declare class ReservationResource {
|
|
|
12510
12557
|
cancel(reservationNumber: string, reason?: string): Promise<Reservation>;
|
|
12511
12558
|
}
|
|
12512
12559
|
|
|
12560
|
+
/**
|
|
12561
|
+
* Site Resource for Diffsome SDK
|
|
12562
|
+
*/
|
|
12563
|
+
|
|
12564
|
+
declare class SiteResource {
|
|
12565
|
+
private http;
|
|
12566
|
+
constructor(http: HttpClient);
|
|
12567
|
+
/**
|
|
12568
|
+
* Get site information
|
|
12569
|
+
* Returns site settings including currency, SEO, contact info
|
|
12570
|
+
*/
|
|
12571
|
+
getInfo(): Promise<SiteInfo>;
|
|
12572
|
+
/**
|
|
12573
|
+
* Get currency info only (lightweight)
|
|
12574
|
+
*/
|
|
12575
|
+
getCurrency(): Promise<CurrencyInfo>;
|
|
12576
|
+
/**
|
|
12577
|
+
* Format price with site's currency settings
|
|
12578
|
+
* @param amount - The amount to format
|
|
12579
|
+
* @param currency - Optional currency info (uses fetched currency if not provided)
|
|
12580
|
+
*/
|
|
12581
|
+
formatPrice(amount: number, currency: CurrencyInfo): string;
|
|
12582
|
+
}
|
|
12583
|
+
|
|
12513
12584
|
/**
|
|
12514
12585
|
* Diffsome SDK
|
|
12515
12586
|
*
|
|
@@ -12552,6 +12623,8 @@ declare class Diffsome {
|
|
|
12552
12623
|
readonly entities: EntitiesResource;
|
|
12553
12624
|
/** Reservations - booking services and time slots */
|
|
12554
12625
|
readonly reservation: ReservationResource;
|
|
12626
|
+
/** Site settings - currency, SEO, contact info */
|
|
12627
|
+
readonly site: SiteResource;
|
|
12555
12628
|
constructor(config: DiffsomeConfig);
|
|
12556
12629
|
/**
|
|
12557
12630
|
* Check if user is authenticated
|
|
@@ -12587,4 +12660,4 @@ declare class Diffsome {
|
|
|
12587
12660
|
getApiKey(): string | null;
|
|
12588
12661
|
}
|
|
12589
12662
|
|
|
12590
|
-
export { type $defs, type AddToCartData, type AddToWishlistData, type ApiError, type ApplyCouponData, type AuthResponse, type AvailableDatesParams, type AvailableSlotsParams, type BlogCategory, type BlogListParams, type BlogPost, type BlogPostCollection, type Board, type BoardCollection, type BoardComment, type BoardListParams, type BoardPost, type BoardPostCollection, type BoardPostListParams, type BundleItem, type BundlePricing, type CanReviewResponse, type Cart, type CartItem, type CartShippingInfo, type Comment, type CommentCollection, type CommentListParams$1 as CommentListParams, type Coupon, type CouponType, type CouponValidation, type CreateBoardPostData, type CreateCommentData, type CreateEntityData, type CreateEntityRecordData, type CreateOrderData, type CreatePostData, type CreateProductReviewData, type CreateReservationData, type CreateReservationResult, type CreateSubscriptionData, type CreateSubscriptionResult, type CustomEntity, Diffsome, type DiffsomeConfig, DiffsomeError, type DigitalDownloadLink, type DigitalFile, type Entity, type EntityField, type EntityListParams, type EntityRecord, type EntitySchema, type ForgotPasswordData, type Form, type FormListParams, type FormSubmission, type FormSubmissionData, type ListParams, type ListResponse, type LoginCredentials, type Media, type Member, type MemberSubscription, type Order, type OrderItem, type OrderListParams, type OrderOrderer, type OrderShipping, type OrderStatus, type PaginatedResponse, type PaginationMeta, type Payment, type PaymentCancelData, type PaymentConfirmData, type PaymentMethod, type PaymentReadyData, type PaymentStatus, type PaymentStatusResponse, type PostListParams, type Product, type ProductAttribute, type ProductAttributeValue, type ProductCategory, type ProductCategoryCollection, type ProductCollection, type ProductListParams, type ProductListParamsExtended, type ProductOption, type ProductOptionValue, type ProductReview, type ProductReviewAuthor, type ProductReviewListParams, type ProductReviewStats, type ProductStatus, type ProductType, type ProductVariant, Diffsome as Promptly, type PromptlyConfig, DiffsomeError as PromptlyError, type RegisterData, type Reservation, type ReservationListParams, type ReservationService, type ReservationServiceStaff, type ReservationSettings, type ReservationSlot, type ReservationStaff, type ResetPasswordData, type SetupIntentResult, type SocialAuthUrl, type SocialProvider, type StripeCheckoutData, type StripeCheckoutResponse, type StripeVerifyData, type StripeVerifyResponse, type SubmissionListParams, type SubmitFormData, type SubscriptionInterval, type SubscriptionPlan, type SubscriptionStatus, type TossPaymentConfirmData, type TossPaymentConfirmResponse, type TossPaymentReadyData, type TossPaymentReadyResponse, type UpdateBoardPostData, type UpdateCartItemData, type UpdateCommentData, type UpdateEntityData, type UpdateEntityRecordData, type UpdatePostData, type UpdateProductReviewData, type UpdateProfileData, type WishlistCheckBulkResult, type WishlistCheckResult, type WishlistItem, type WishlistListParams, type WishlistMoveToCartResult, type WishlistToggleResult, type components, Diffsome as default, type operations, type paths, type webhooks };
|
|
12663
|
+
export { type $defs, type AddToCartData, type AddToWishlistData, type ApiError, type ApplyCouponData, type AuthResponse, type AvailableDatesParams, type AvailableSlotsParams, type BlogCategory, type BlogListParams, type BlogPost, type BlogPostCollection, type Board, type BoardCollection, type BoardComment, type BoardListParams, type BoardPost, type BoardPostCollection, type BoardPostListParams, type BundleItem, type BundlePricing, type CanReviewResponse, type Cart, type CartItem, type CartShippingInfo, type Comment, type CommentCollection, type CommentListParams$1 as CommentListParams, type Coupon, type CouponType, type CouponValidation, type CreateBoardPostData, type CreateCommentData, type CreateEntityData, type CreateEntityRecordData, type CreateOrderData, type CreatePostData, type CreateProductReviewData, type CreateReservationData, type CreateReservationResult, type CreateSubscriptionData, type CreateSubscriptionResult, type CurrencyInfo, type CustomEntity, Diffsome, type DiffsomeConfig, DiffsomeError, type DigitalDownloadLink, type DigitalFile, type Entity, type EntityField, type EntityListParams, type EntityRecord, type EntitySchema, type ForgotPasswordData, type Form, type FormListParams, type FormSubmission, type FormSubmissionData, type ListParams, type ListResponse, type LoginCredentials, type Media, type Member, type MemberSubscription, type Order, type OrderItem, type OrderListParams, type OrderOrderer, type OrderShipping, type OrderStatus, type PaginatedResponse, type PaginationMeta, type Payment, type PaymentCancelData, type PaymentConfirmData, type PaymentMethod, type PaymentReadyData, type PaymentStatus, type PaymentStatusResponse, type PostListParams, type Product, type ProductAttribute, type ProductAttributeValue, type ProductCategory, type ProductCategoryCollection, type ProductCollection, type ProductListParams, type ProductListParamsExtended, type ProductOption, type ProductOptionValue, type ProductReview, type ProductReviewAuthor, type ProductReviewListParams, type ProductReviewStats, type ProductStatus, type ProductType, type ProductVariant, Diffsome as Promptly, type PromptlyConfig, DiffsomeError as PromptlyError, type RegisterData, type Reservation, type ReservationListParams, type ReservationService, type ReservationServiceStaff, type ReservationSettings, type ReservationSlot, type ReservationStaff, type ResetPasswordData, type SetupIntentResult, type SiteInfo, type SocialAuthUrl, type SocialProvider, type StripeCheckoutData, type StripeCheckoutResponse, type StripeVerifyData, type StripeVerifyResponse, type SubmissionListParams, type SubmitFormData, type SubscriptionInterval, type SubscriptionPlan, type SubscriptionStatus, type TossPaymentConfirmData, type TossPaymentConfirmResponse, type TossPaymentReadyData, type TossPaymentReadyResponse, type UpdateBoardPostData, type UpdateCartItemData, type UpdateCommentData, type UpdateEntityData, type UpdateEntityRecordData, type UpdatePostData, type UpdateProductReviewData, type UpdateProfileData, type WishlistCheckBulkResult, type WishlistCheckResult, type WishlistItem, type WishlistListParams, type WishlistMoveToCartResult, type WishlistToggleResult, type components, Diffsome as default, type operations, type paths, type webhooks };
|
package/dist/index.js
CHANGED
|
@@ -1669,6 +1669,42 @@ var ReservationResource = class {
|
|
|
1669
1669
|
}
|
|
1670
1670
|
};
|
|
1671
1671
|
|
|
1672
|
+
// src/resources/site.ts
|
|
1673
|
+
var SiteResource = class {
|
|
1674
|
+
constructor(http) {
|
|
1675
|
+
this.http = http;
|
|
1676
|
+
}
|
|
1677
|
+
/**
|
|
1678
|
+
* Get site information
|
|
1679
|
+
* Returns site settings including currency, SEO, contact info
|
|
1680
|
+
*/
|
|
1681
|
+
async getInfo() {
|
|
1682
|
+
return this.http.get("/site");
|
|
1683
|
+
}
|
|
1684
|
+
/**
|
|
1685
|
+
* Get currency info only (lightweight)
|
|
1686
|
+
*/
|
|
1687
|
+
async getCurrency() {
|
|
1688
|
+
const response = await this.http.get("/site/currency");
|
|
1689
|
+
return response.currency;
|
|
1690
|
+
}
|
|
1691
|
+
/**
|
|
1692
|
+
* Format price with site's currency settings
|
|
1693
|
+
* @param amount - The amount to format
|
|
1694
|
+
* @param currency - Optional currency info (uses fetched currency if not provided)
|
|
1695
|
+
*/
|
|
1696
|
+
formatPrice(amount, currency) {
|
|
1697
|
+
const formatted = amount.toLocaleString(void 0, {
|
|
1698
|
+
minimumFractionDigits: currency.decimals,
|
|
1699
|
+
maximumFractionDigits: currency.decimals
|
|
1700
|
+
});
|
|
1701
|
+
if (currency.position === "after") {
|
|
1702
|
+
return `${formatted}${currency.symbol}`;
|
|
1703
|
+
}
|
|
1704
|
+
return `${currency.symbol}${formatted}`;
|
|
1705
|
+
}
|
|
1706
|
+
};
|
|
1707
|
+
|
|
1672
1708
|
// src/index.ts
|
|
1673
1709
|
var Diffsome = class {
|
|
1674
1710
|
constructor(config) {
|
|
@@ -1685,6 +1721,7 @@ var Diffsome = class {
|
|
|
1685
1721
|
this.media = new MediaResource(this.http);
|
|
1686
1722
|
this.entities = new EntitiesResource(this.http);
|
|
1687
1723
|
this.reservation = new ReservationResource(this.http);
|
|
1724
|
+
this.site = new SiteResource(this.http);
|
|
1688
1725
|
}
|
|
1689
1726
|
/**
|
|
1690
1727
|
* Check if user is authenticated
|
package/dist/index.mjs
CHANGED
|
@@ -1639,6 +1639,42 @@ var ReservationResource = class {
|
|
|
1639
1639
|
}
|
|
1640
1640
|
};
|
|
1641
1641
|
|
|
1642
|
+
// src/resources/site.ts
|
|
1643
|
+
var SiteResource = class {
|
|
1644
|
+
constructor(http) {
|
|
1645
|
+
this.http = http;
|
|
1646
|
+
}
|
|
1647
|
+
/**
|
|
1648
|
+
* Get site information
|
|
1649
|
+
* Returns site settings including currency, SEO, contact info
|
|
1650
|
+
*/
|
|
1651
|
+
async getInfo() {
|
|
1652
|
+
return this.http.get("/site");
|
|
1653
|
+
}
|
|
1654
|
+
/**
|
|
1655
|
+
* Get currency info only (lightweight)
|
|
1656
|
+
*/
|
|
1657
|
+
async getCurrency() {
|
|
1658
|
+
const response = await this.http.get("/site/currency");
|
|
1659
|
+
return response.currency;
|
|
1660
|
+
}
|
|
1661
|
+
/**
|
|
1662
|
+
* Format price with site's currency settings
|
|
1663
|
+
* @param amount - The amount to format
|
|
1664
|
+
* @param currency - Optional currency info (uses fetched currency if not provided)
|
|
1665
|
+
*/
|
|
1666
|
+
formatPrice(amount, currency) {
|
|
1667
|
+
const formatted = amount.toLocaleString(void 0, {
|
|
1668
|
+
minimumFractionDigits: currency.decimals,
|
|
1669
|
+
maximumFractionDigits: currency.decimals
|
|
1670
|
+
});
|
|
1671
|
+
if (currency.position === "after") {
|
|
1672
|
+
return `${formatted}${currency.symbol}`;
|
|
1673
|
+
}
|
|
1674
|
+
return `${currency.symbol}${formatted}`;
|
|
1675
|
+
}
|
|
1676
|
+
};
|
|
1677
|
+
|
|
1642
1678
|
// src/index.ts
|
|
1643
1679
|
var Diffsome = class {
|
|
1644
1680
|
constructor(config) {
|
|
@@ -1655,6 +1691,7 @@ var Diffsome = class {
|
|
|
1655
1691
|
this.media = new MediaResource(this.http);
|
|
1656
1692
|
this.entities = new EntitiesResource(this.http);
|
|
1657
1693
|
this.reservation = new ReservationResource(this.http);
|
|
1694
|
+
this.site = new SiteResource(this.http);
|
|
1658
1695
|
}
|
|
1659
1696
|
/**
|
|
1660
1697
|
* Check if user is authenticated
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@diffsome/sdk",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.8",
|
|
4
4
|
"description": "Diffsome SDK for JavaScript/TypeScript - Different + Awesome",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"license": "MIT",
|
|
34
34
|
"repository": {
|
|
35
35
|
"type": "git",
|
|
36
|
-
"url": "https://github.com/diffsome/sdk.git"
|
|
36
|
+
"url": "https://github.com/diffsome/diffsome-sdk.git"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"openapi-typescript": "^7.10.1",
|