spaps-sdk 1.2.1 → 1.3.0
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 +23 -2
- package/dist/index.d.ts +23 -2
- package/dist/index.js +30 -0
- package/dist/index.mjs +30 -0
- package/package.json +6 -4
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as spaps_types from 'spaps-types';
|
|
2
|
-
import { CreateProductRequest, Product, UpdateProductRequest, CreatePriceRequest, Price, ProductSyncResult, CryptoReconcileRequest, CreateSecureMessageRequest, SecureMessage, AuthResponse, User as User$1, CreateCryptoInvoiceRequest, CryptoInvoiceStatusSnapshot, CheckoutSession, Subscription, UsageBalance, VerifyCryptoWebhookSignatureOptions } from 'spaps-types';
|
|
3
|
-
export { AdminPermission, AdminRole, AdminUser, ApiResponse, AuthResponse, CheckoutSession, CreateCryptoInvoiceRequest, CreatePriceRequest, CreateProductRequest, CreateSecureMessageInput, CreateSecureMessageRequest, CryptoInvoice, CryptoInvoiceResponse, CryptoInvoiceStatusSnapshot, CryptoReconcileRequest, Price, Product, ProductSyncResult, SecureMessage, SecureMessageOutput, Subscription, TokenPair, UpdateProductRequest, UsageBalance, User, UserProfile, UserRole, UserWallet, VerifyCryptoWebhookSignatureOptions, createSecureMessageRequestSchema, secureMessageMetadataSchema, secureMessageSchema } from 'spaps-types';
|
|
2
|
+
import { CreateProductRequest, Product, UpdateProductRequest, CreatePriceRequest, Price, ProductSyncResult, CryptoReconcileRequest, CreateSecureMessageRequest, SecureMessage, AuthResponse, User as User$1, CreateCryptoInvoiceRequest, CryptoInvoiceStatusSnapshot, CheckoutSession, DayrateAvailabilityResponse, DayrateBookingRequest, DayrateBookingResponse, DayrateMultiBookingRequest, DayrateMultiBookingResponse, Subscription, UsageBalance, VerifyCryptoWebhookSignatureOptions } from 'spaps-types';
|
|
3
|
+
export { AdminPermission, AdminRole, AdminUser, ApiResponse, AuthResponse, CheckoutSession, CreateCryptoInvoiceRequest, CreatePriceRequest, CreateProductRequest, CreateSecureMessageInput, CreateSecureMessageRequest, CryptoInvoice, CryptoInvoiceResponse, CryptoInvoiceStatusSnapshot, CryptoReconcileRequest, DayrateAvailabilityResponse, DayrateAvailableSlot, DayrateBookingRequest, DayrateBookingResponse, DayrateDayOfWeek, DayrateMultiBookingRequest, DayrateMultiBookingResponse, DayratePriceBreakdown, DayrateSlotType, Price, Product, ProductSyncResult, SecureMessage, SecureMessageOutput, Subscription, TokenPair, UpdateProductRequest, UsageBalance, User, UserProfile, UserRole, UserWallet, VerifyCryptoWebhookSignatureOptions, createSecureMessageRequestSchema, secureMessageMetadataSchema, secureMessageSchema } from 'spaps-types';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Permission checking utilities for SPAPS SDK
|
|
@@ -446,6 +446,27 @@ declare class SPAPSClient<SecureMessageMetadata extends Record<string, any> = Re
|
|
|
446
446
|
message: string;
|
|
447
447
|
}>;
|
|
448
448
|
};
|
|
449
|
+
/**
|
|
450
|
+
* DayRate (Dynamic Scheduling) namespace
|
|
451
|
+
* For booking half-day sessions with dynamic pricing
|
|
452
|
+
*/
|
|
453
|
+
dayrate: {
|
|
454
|
+
/**
|
|
455
|
+
* Get available slots with current pricing
|
|
456
|
+
* Public endpoint - no authentication required
|
|
457
|
+
*/
|
|
458
|
+
getAvailability: () => Promise<DayrateAvailabilityResponse>;
|
|
459
|
+
/**
|
|
460
|
+
* Create a single-slot booking and get Stripe checkout URL
|
|
461
|
+
* Returns a 10-minute reservation with checkout link
|
|
462
|
+
*/
|
|
463
|
+
createBooking: (payload: DayrateBookingRequest) => Promise<DayrateBookingResponse>;
|
|
464
|
+
/**
|
|
465
|
+
* Create a multi-slot booking and get Stripe checkout URL
|
|
466
|
+
* Reserves multiple slots with a single checkout session
|
|
467
|
+
*/
|
|
468
|
+
createMultiBooking: (payload: DayrateMultiBookingRequest) => Promise<DayrateMultiBookingResponse>;
|
|
469
|
+
};
|
|
449
470
|
createCheckoutSession(priceId: string, successUrl: string, cancelUrl?: string): Promise<{
|
|
450
471
|
data: CheckoutSession;
|
|
451
472
|
}>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as spaps_types from 'spaps-types';
|
|
2
|
-
import { CreateProductRequest, Product, UpdateProductRequest, CreatePriceRequest, Price, ProductSyncResult, CryptoReconcileRequest, CreateSecureMessageRequest, SecureMessage, AuthResponse, User as User$1, CreateCryptoInvoiceRequest, CryptoInvoiceStatusSnapshot, CheckoutSession, Subscription, UsageBalance, VerifyCryptoWebhookSignatureOptions } from 'spaps-types';
|
|
3
|
-
export { AdminPermission, AdminRole, AdminUser, ApiResponse, AuthResponse, CheckoutSession, CreateCryptoInvoiceRequest, CreatePriceRequest, CreateProductRequest, CreateSecureMessageInput, CreateSecureMessageRequest, CryptoInvoice, CryptoInvoiceResponse, CryptoInvoiceStatusSnapshot, CryptoReconcileRequest, Price, Product, ProductSyncResult, SecureMessage, SecureMessageOutput, Subscription, TokenPair, UpdateProductRequest, UsageBalance, User, UserProfile, UserRole, UserWallet, VerifyCryptoWebhookSignatureOptions, createSecureMessageRequestSchema, secureMessageMetadataSchema, secureMessageSchema } from 'spaps-types';
|
|
2
|
+
import { CreateProductRequest, Product, UpdateProductRequest, CreatePriceRequest, Price, ProductSyncResult, CryptoReconcileRequest, CreateSecureMessageRequest, SecureMessage, AuthResponse, User as User$1, CreateCryptoInvoiceRequest, CryptoInvoiceStatusSnapshot, CheckoutSession, DayrateAvailabilityResponse, DayrateBookingRequest, DayrateBookingResponse, DayrateMultiBookingRequest, DayrateMultiBookingResponse, Subscription, UsageBalance, VerifyCryptoWebhookSignatureOptions } from 'spaps-types';
|
|
3
|
+
export { AdminPermission, AdminRole, AdminUser, ApiResponse, AuthResponse, CheckoutSession, CreateCryptoInvoiceRequest, CreatePriceRequest, CreateProductRequest, CreateSecureMessageInput, CreateSecureMessageRequest, CryptoInvoice, CryptoInvoiceResponse, CryptoInvoiceStatusSnapshot, CryptoReconcileRequest, DayrateAvailabilityResponse, DayrateAvailableSlot, DayrateBookingRequest, DayrateBookingResponse, DayrateDayOfWeek, DayrateMultiBookingRequest, DayrateMultiBookingResponse, DayratePriceBreakdown, DayrateSlotType, Price, Product, ProductSyncResult, SecureMessage, SecureMessageOutput, Subscription, TokenPair, UpdateProductRequest, UsageBalance, User, UserProfile, UserRole, UserWallet, VerifyCryptoWebhookSignatureOptions, createSecureMessageRequestSchema, secureMessageMetadataSchema, secureMessageSchema } from 'spaps-types';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Permission checking utilities for SPAPS SDK
|
|
@@ -446,6 +446,27 @@ declare class SPAPSClient<SecureMessageMetadata extends Record<string, any> = Re
|
|
|
446
446
|
message: string;
|
|
447
447
|
}>;
|
|
448
448
|
};
|
|
449
|
+
/**
|
|
450
|
+
* DayRate (Dynamic Scheduling) namespace
|
|
451
|
+
* For booking half-day sessions with dynamic pricing
|
|
452
|
+
*/
|
|
453
|
+
dayrate: {
|
|
454
|
+
/**
|
|
455
|
+
* Get available slots with current pricing
|
|
456
|
+
* Public endpoint - no authentication required
|
|
457
|
+
*/
|
|
458
|
+
getAvailability: () => Promise<DayrateAvailabilityResponse>;
|
|
459
|
+
/**
|
|
460
|
+
* Create a single-slot booking and get Stripe checkout URL
|
|
461
|
+
* Returns a 10-minute reservation with checkout link
|
|
462
|
+
*/
|
|
463
|
+
createBooking: (payload: DayrateBookingRequest) => Promise<DayrateBookingResponse>;
|
|
464
|
+
/**
|
|
465
|
+
* Create a multi-slot booking and get Stripe checkout URL
|
|
466
|
+
* Reserves multiple slots with a single checkout session
|
|
467
|
+
*/
|
|
468
|
+
createMultiBooking: (payload: DayrateMultiBookingRequest) => Promise<DayrateMultiBookingResponse>;
|
|
469
|
+
};
|
|
449
470
|
createCheckoutSession(priceId: string, successUrl: string, cancelUrl?: string): Promise<{
|
|
450
471
|
data: CheckoutSession;
|
|
451
472
|
}>;
|
package/dist/index.js
CHANGED
|
@@ -837,6 +837,36 @@ var SPAPSClient = class {
|
|
|
837
837
|
return this.unwrapApiResponse(res, "Failed to disconnect");
|
|
838
838
|
}
|
|
839
839
|
};
|
|
840
|
+
/**
|
|
841
|
+
* DayRate (Dynamic Scheduling) namespace
|
|
842
|
+
* For booking half-day sessions with dynamic pricing
|
|
843
|
+
*/
|
|
844
|
+
dayrate = {
|
|
845
|
+
/**
|
|
846
|
+
* Get available slots with current pricing
|
|
847
|
+
* Public endpoint - no authentication required
|
|
848
|
+
*/
|
|
849
|
+
getAvailability: async () => {
|
|
850
|
+
const res = await this.client.get("/api/dayrate/availability");
|
|
851
|
+
return this.unwrapApiResponse(res, "Failed to get availability");
|
|
852
|
+
},
|
|
853
|
+
/**
|
|
854
|
+
* Create a single-slot booking and get Stripe checkout URL
|
|
855
|
+
* Returns a 10-minute reservation with checkout link
|
|
856
|
+
*/
|
|
857
|
+
createBooking: async (payload) => {
|
|
858
|
+
const res = await this.client.post("/api/dayrate/book", payload);
|
|
859
|
+
return this.unwrapApiResponse(res, "Failed to create booking");
|
|
860
|
+
},
|
|
861
|
+
/**
|
|
862
|
+
* Create a multi-slot booking and get Stripe checkout URL
|
|
863
|
+
* Reserves multiple slots with a single checkout session
|
|
864
|
+
*/
|
|
865
|
+
createMultiBooking: async (payload) => {
|
|
866
|
+
const res = await this.client.post("/api/dayrate/book-multi", payload);
|
|
867
|
+
return this.unwrapApiResponse(res, "Failed to create multi-booking");
|
|
868
|
+
}
|
|
869
|
+
};
|
|
840
870
|
// Stripe Methods
|
|
841
871
|
async createCheckoutSession(priceId, successUrl, cancelUrl) {
|
|
842
872
|
return this.client.post("/api/stripe/create-checkout-session", {
|
package/dist/index.mjs
CHANGED
|
@@ -810,6 +810,36 @@ var SPAPSClient = class {
|
|
|
810
810
|
return this.unwrapApiResponse(res, "Failed to disconnect");
|
|
811
811
|
}
|
|
812
812
|
};
|
|
813
|
+
/**
|
|
814
|
+
* DayRate (Dynamic Scheduling) namespace
|
|
815
|
+
* For booking half-day sessions with dynamic pricing
|
|
816
|
+
*/
|
|
817
|
+
dayrate = {
|
|
818
|
+
/**
|
|
819
|
+
* Get available slots with current pricing
|
|
820
|
+
* Public endpoint - no authentication required
|
|
821
|
+
*/
|
|
822
|
+
getAvailability: async () => {
|
|
823
|
+
const res = await this.client.get("/api/dayrate/availability");
|
|
824
|
+
return this.unwrapApiResponse(res, "Failed to get availability");
|
|
825
|
+
},
|
|
826
|
+
/**
|
|
827
|
+
* Create a single-slot booking and get Stripe checkout URL
|
|
828
|
+
* Returns a 10-minute reservation with checkout link
|
|
829
|
+
*/
|
|
830
|
+
createBooking: async (payload) => {
|
|
831
|
+
const res = await this.client.post("/api/dayrate/book", payload);
|
|
832
|
+
return this.unwrapApiResponse(res, "Failed to create booking");
|
|
833
|
+
},
|
|
834
|
+
/**
|
|
835
|
+
* Create a multi-slot booking and get Stripe checkout URL
|
|
836
|
+
* Reserves multiple slots with a single checkout session
|
|
837
|
+
*/
|
|
838
|
+
createMultiBooking: async (payload) => {
|
|
839
|
+
const res = await this.client.post("/api/dayrate/book-multi", payload);
|
|
840
|
+
return this.unwrapApiResponse(res, "Failed to create multi-booking");
|
|
841
|
+
}
|
|
842
|
+
};
|
|
813
843
|
// Stripe Methods
|
|
814
844
|
async createCheckoutSession(priceId, successUrl, cancelUrl) {
|
|
815
845
|
return this.client.post("/api/stripe/create-checkout-session", {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "spaps-sdk",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "Sweet Potato Authentication & Payment Service SDK - Zero-config client with built-in permission checking
|
|
3
|
+
"version": "1.3.0",
|
|
4
|
+
"description": "Sweet Potato Authentication & Payment Service SDK - Zero-config client with built-in permission checking, role-based access control, and dayrate scheduling",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"exports": {
|
|
@@ -31,7 +31,9 @@
|
|
|
31
31
|
"sdk",
|
|
32
32
|
"client",
|
|
33
33
|
"sweet-potato",
|
|
34
|
-
"wallet-auth"
|
|
34
|
+
"wallet-auth",
|
|
35
|
+
"dayrate",
|
|
36
|
+
"scheduling"
|
|
35
37
|
],
|
|
36
38
|
"author": "buildooor",
|
|
37
39
|
"license": "UNLICENSED",
|
|
@@ -72,4 +74,4 @@
|
|
|
72
74
|
"engines": {
|
|
73
75
|
"node": ">=14.0.0"
|
|
74
76
|
}
|
|
75
|
-
}
|
|
77
|
+
}
|