@spotsdev/sdk 1.5.0 → 1.5.2

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,6 +1,7 @@
1
1
  import { AxiosInstance } from 'axios';
2
- import { PostType, AccountStatus, SpotType, ResponseStatus, ReportReason, NotificationType, ClaimStatus, ProductResponseDto, OrderStatus, SendOtpDto, VerifyOtpDto, CreatePostDto, CreateReplyDto, CreateResponseDto, UpdateResponseDto, UpdateUserDto, CreateConversationDto, CreateMessageDto, ClaimSpotDto, UpvoteResponseDto, VerifyOtpWrappedResponseDto, ApiResponse, PostStatusDto, ProductType, ProductStatus } from '@spotsdev/types';
2
+ import { PostType, SpotResponseDto, PostResponseDto, PostReplyDto, ProductResponseDto, SpotImageDto, SpotVibeDto, SpotIntentionDto, OrderItemDto, NotificationResponseDto, SpotOwnerDto, ResponseStatus, ReportReason, ClaimStatus, OrderStatus, SendOtpDto, VerifyOtpDto, CreatePostDto, CreateReplyDto, CreateResponseDto, UpdateResponseDto, UpdateUserDto, CreateConversationDto, CreateMessageDto, ClaimSpotDto, UpvoteResponseDto, VerifyOtpWrappedResponseDto, ApiResponse, PostStatusDto, ProductType, ProductStatus } from '@spotsdev/types';
3
3
  export * from '@spotsdev/types';
4
+ export { AccountStatus, AddUserInterestDto, AdjustStockDto, ApiResponse, AuthTokensDto, AuthUserDto, ClaimSpotDto, ClaimStatus, CreateConversationDto, CreateIntentionDto, CreateInterestDto, CreateMediaDto, CreateMessageDto, CreateOrderDto, CreatePostDto, CreateProductDto, CreateReplyDto, CreateReportDto, CreateResponseDto, CreateSpotDto, FulfillmentType, MediaType, NotificationResponseDto, NotificationType, NotificationsListResponseDto, OrderItemDto, OrderStatus, PaginatedPostsResponseDto, PaginatedProductsResponseDto, PaginatedSpotsResponseDto, PostReplyDto, PostReportResponseDto, PostResponseDto, PostSpotDto, PostStatus, PostStatusDto, PostStatusResponseDto, PostType, PostUserDto, ProductResponseDto, ProductStatus, ProductType, RefreshTokenDto, RefreshTokenResponseDto, ReportReason, ResponseStatus, SendOtpDto, SendOtpResponseDto, SpotCityDto, SpotClaimResponseDto, SpotImageDto, SpotIntentionDto, SpotOwnerDto, SpotResponseDto, SpotType, SpotVibeDto, UpdateIntentionDto, UpdateInterestDto, UpdateOrderStatusDto, UpdatePostDto, UpdateProductDto, UpdateResponseDto, UpdateSpotDto, UpdateUserDto, UpvoteResponseDto, UserResponseDto, VerifyOtpDto } from '@spotsdev/types';
4
5
  import { UseMutationOptions, UseMutationResult, UseQueryOptions, UseQueryResult, UseInfiniteQueryOptions, UseInfiniteQueryResult } from '@tanstack/react-query';
5
6
 
6
7
  interface SDKConfig {
@@ -16,87 +17,33 @@ declare function getConfig(): SDKConfig;
16
17
  /**
17
18
  * Spots SDK Entity Types
18
19
  *
19
- * These types mirror the Prisma schema entities but without @prisma/client dependency.
20
- * This allows the SDK to work in React Native where Prisma is not available.
20
+ * ALL entity and enum types are imported from @spotsdev/types (generated from OpenAPI spec).
21
+ * This file re-exports them with SDK-friendly aliases and adds SDK-specific types.
21
22
  *
22
- * IMPORTANT: Enum types are imported from @spotsdev/types (generated from OpenAPI spec).
23
- * types.ts handles re-exporting from spots-types - this file only defines entity interfaces
24
- * and SDK-specific types not in the OpenAPI spec.
23
+ * IMPORTANT: Do NOT define entity types here - they come from spots-types.
25
24
  */
26
25
 
27
26
  type SpotPostType = PostType;
27
+ type Spot = SpotResponseDto;
28
+ type SpotPost = PostResponseDto;
29
+ type PostReply = PostReplyDto;
30
+ type Product = ProductResponseDto;
31
+ type SpotImage = SpotImageDto;
32
+ type SpotVibe = SpotVibeDto;
33
+ type SpotIntention = SpotIntentionDto;
34
+ type OrderItem = OrderItemDto;
35
+ type Notification = NotificationResponseDto;
36
+ type User = SpotOwnerDto & {
37
+ phone?: string | null;
38
+ email?: string | null;
39
+ bio?: string | null;
40
+ onboardingCompleted?: boolean;
41
+ lastActiveAt?: Date | null;
42
+ createdAt?: Date;
43
+ updatedAt?: Date;
44
+ };
28
45
  type ReportStatus = 'PENDING' | 'REVIEWED' | 'RESOLVED' | 'DISMISSED';
29
- interface UserVibe {
30
- id: string;
31
- name: string;
32
- emoji: string | null;
33
- slug?: string;
34
- category?: string;
35
- }
36
- interface User {
37
- id: string;
38
- phone: string | null;
39
- email: string | null;
40
- name: string | null;
41
- bio: string | null;
42
- avatarUrl: string | null;
43
- status: AccountStatus;
44
- onboardingCompleted: boolean;
45
- vibes?: UserVibe[];
46
- lastActiveAt: Date | null;
47
- createdAt: Date;
48
- updatedAt: Date;
49
- }
50
- interface Spot {
51
- id: string;
52
- name: string;
53
- slug: string;
54
- description: string | null;
55
- address: string | null;
56
- city: string | null;
57
- country: string | null;
58
- latitude: number | null;
59
- longitude: number | null;
60
- lat?: number | null;
61
- lng?: number | null;
62
- type: SpotType;
63
- googlePlaceId: string | null;
64
- website: string | null;
65
- phone: string | null;
66
- imageUrl: string | null;
67
- ownerId: string | null;
68
- isVerified: boolean;
69
- marketplaceEnabled: boolean;
70
- createdAt: Date | string;
71
- updatedAt: Date | string;
72
- }
73
- interface SpotPost {
74
- id: string;
75
- spotId: string;
76
- userId: string;
77
- postType: SpotPostType;
78
- title: string;
79
- content: string | null;
80
- emoji: string | null;
81
- expiresAt: Date | null;
82
- status: 'ACTIVE' | 'FULFILLED' | 'EXPIRED' | 'DELETED';
83
- upvoteCount: number;
84
- responseCount: number;
85
- replyCount: number;
86
- createdAt: Date;
87
- updatedAt: Date;
88
- user?: User;
89
- spot?: Spot;
90
- }
91
- interface PostReply {
92
- id: string;
93
- postId: string;
94
- userId: string;
95
- content: string;
96
- createdAt: Date;
97
- updatedAt: Date;
98
- user?: User;
99
- }
46
+ type ClubMemberRole = 'MEMBER' | 'ADMIN' | 'OWNER';
100
47
  interface PostResponse {
101
48
  id: string;
102
49
  postId: string;
@@ -114,9 +61,6 @@ interface PostUpvote {
114
61
  userId: string;
115
62
  createdAt: Date;
116
63
  }
117
- /**
118
- * PostUpvoter - user who upvoted a post (from /posts/:id/upvotes endpoint)
119
- */
120
64
  interface PostUpvoter {
121
65
  id: string;
122
66
  userId: string;
@@ -124,9 +68,6 @@ interface PostUpvoter {
124
68
  avatarUrl: string | null;
125
69
  createdAt: Date;
126
70
  }
127
- /**
128
- * PostUpvotesResponse - response from /posts/:id/upvotes endpoint
129
- */
130
71
  interface PostUpvotesResponse {
131
72
  data: PostUpvoter[];
132
73
  meta: {
@@ -163,7 +104,7 @@ interface ClubMember {
163
104
  id: string;
164
105
  clubId: string;
165
106
  userId: string;
166
- role: 'MEMBER' | 'ADMIN' | 'OWNER';
107
+ role: ClubMemberRole;
167
108
  joinedAt: Date;
168
109
  }
169
110
  interface Conversation {
@@ -181,16 +122,6 @@ interface Message {
181
122
  createdAt: Date;
182
123
  sender?: User;
183
124
  }
184
- interface Notification {
185
- id: string;
186
- userId: string;
187
- type: NotificationType;
188
- title: string;
189
- body: string | null;
190
- data: Record<string, unknown> | null;
191
- isRead: boolean;
192
- createdAt: Date;
193
- }
194
125
  interface PostTemplate {
195
126
  id: string;
196
127
  postType: SpotPostType;
@@ -227,6 +158,13 @@ interface LifeSituation {
227
158
  emoji: string | null;
228
159
  createdAt: Date;
229
160
  }
161
+ interface UserVibe {
162
+ id: string;
163
+ name: string;
164
+ emoji: string | null;
165
+ slug?: string;
166
+ category?: string;
167
+ }
230
168
  interface FavoriteSpot {
231
169
  id: string;
232
170
  userId: string;
@@ -234,25 +172,12 @@ interface FavoriteSpot {
234
172
  createdAt: Date;
235
173
  spot?: Spot;
236
174
  }
237
- interface SpotImage {
175
+ interface SpotSubscription {
238
176
  id: string;
239
177
  spotId: string;
240
- url: string;
241
- caption: string | null;
242
- sortOrder: number;
178
+ userId: string;
243
179
  createdAt: Date;
244
- }
245
- interface SpotVibe {
246
- id: string;
247
- spotId: string;
248
- vibeId: string;
249
- vibe?: Vibe;
250
- }
251
- interface SpotIntention {
252
- id: string;
253
- spotId: string;
254
- intentionId: string;
255
- intention?: Intention;
180
+ spot?: Spot;
256
181
  }
257
182
  interface SpotClaim {
258
183
  id: string;
@@ -263,13 +188,6 @@ interface SpotClaim {
263
188
  createdAt: Date;
264
189
  updatedAt: Date;
265
190
  }
266
- interface SpotSubscription {
267
- id: string;
268
- spotId: string;
269
- userId: string;
270
- createdAt: Date;
271
- spot?: Spot;
272
- }
273
191
  interface City {
274
192
  id: string;
275
193
  name: string;
@@ -279,22 +197,6 @@ interface City {
279
197
  timezone: string | null;
280
198
  createdAt: Date;
281
199
  }
282
- /**
283
- * Paginated response with meta information
284
- */
285
- interface PaginatedResponse<T> {
286
- data: T[];
287
- meta: PaginationMeta;
288
- }
289
- interface PaginationMeta {
290
- total: number;
291
- page: number;
292
- limit: number;
293
- totalPages: number;
294
- hasNextPage: boolean;
295
- hasPreviousPage: boolean;
296
- }
297
- type Product = ProductResponseDto;
298
200
  interface Order {
299
201
  id: string;
300
202
  spotId: string;
@@ -308,15 +210,19 @@ interface Order {
308
210
  metadata: Record<string, unknown> | null;
309
211
  createdAt: Date;
310
212
  updatedAt: Date;
213
+ items?: OrderItem[];
311
214
  }
312
- interface OrderItem {
313
- id: string;
314
- orderId: string;
315
- productId: string;
316
- quantity: number;
317
- unitPrice: number;
215
+ interface PaginationMeta {
318
216
  total: number;
319
- createdAt: Date;
217
+ page: number;
218
+ limit: number;
219
+ totalPages: number;
220
+ hasNextPage: boolean;
221
+ hasPreviousPage: boolean;
222
+ }
223
+ interface PaginatedResponse<T> {
224
+ data: T[];
225
+ meta: PaginationMeta;
320
226
  }
321
227
 
322
228
  /**
@@ -1110,6 +1016,37 @@ declare function useSpotRedemptions(spotId: string, params?: {
1110
1016
  limit?: number;
1111
1017
  }, options?: Omit<UseQueryOptions<WalletHistoryResponse>, 'queryKey' | 'queryFn'>): UseQueryResult<WalletHistoryResponse>;
1112
1018
 
1019
+ /**
1020
+ * Payments Query Hooks
1021
+ *
1022
+ * TanStack Query hooks for payment configuration.
1023
+ */
1024
+
1025
+ declare const paymentKeys: {
1026
+ all: readonly ["payments"];
1027
+ config: () => readonly ["payments", "config"];
1028
+ };
1029
+ /**
1030
+ * Payment configuration returned by GET /payments/config
1031
+ */
1032
+ interface PaymentConfig {
1033
+ stripe: {
1034
+ publishableKey: string | null;
1035
+ enabled: boolean;
1036
+ };
1037
+ coinbase: {
1038
+ enabled: boolean;
1039
+ };
1040
+ supportedMethods: Array<'card' | 'apple_pay' | 'google_pay' | 'crypto'>;
1041
+ }
1042
+ /**
1043
+ * Get payment configuration
1044
+ * Returns publishable keys and enabled payment methods
1045
+ *
1046
+ * @endpoint GET /payments/config
1047
+ */
1048
+ declare function usePaymentConfig(options?: Omit<UseQueryOptions<PaymentConfig>, 'queryKey' | 'queryFn'>): UseQueryResult<PaymentConfig>;
1049
+
1113
1050
  /**
1114
1051
  * Users Mutation Hooks
1115
1052
  *
@@ -1538,6 +1475,7 @@ declare function useRemoveDeviceToken(options?: Omit<UseMutationOptions<void, Er
1538
1475
  interface CreateProductRequest {
1539
1476
  spotId: string;
1540
1477
  name: string;
1478
+ slug?: string;
1541
1479
  description?: string;
1542
1480
  type: ProductType;
1543
1481
  price: number;
@@ -1715,4 +1653,4 @@ declare function useVoidRedemption(): UseMutationResult<WalletRedemption, Error,
1715
1653
  reason: string;
1716
1654
  }>;
1717
1655
 
1718
- export { type AuthResponse, type CartItem, type City, type ClaimSpotRequest, type Club, type ClubMember, type CoinbaseChargeResponse, type Conversation, type CreateConversationRequest, type CreateOrderRequest, type CreateOrderResponse, type CreatePostRequest, type CreateProductRequest, type CreateReplyRequest, type FavoriteSpot, type InfiniteSpotsParams, type Intention, type Interest, type LifeSituation, type Message, type Notification, type Order, type OrderFilters, type OrderItem, type OrderWithDetails, type PaginatedResponse, type PaginationMeta, type PaymentIntentResponse, type Post, type PostReply, type PostReport, type PostResponse, type PostTemplate, type PostUpvote, type PostUpvoter, type PostUpvotesResponse, type Product, type ProductFilters, type ProductWithSpot, type RedeemRequest, type RedemptionLookup, type RedemptionStatus, type ReportStatus, type RespondToPostRequest, type SDKConfig, type SendMessageRequest, type SendOtpRequest, type Spot, type SpotClaim, type SpotImage, type SpotIntention, type SpotPost, type SpotPostType, type SpotSubscription, type SpotSummary, type SpotVibe, type SpotsSummaryMeta, type SpotsSummaryResponse, type Template, type UpdateProductRequest, type UpdateProfileRequest, type UpdateResponseRequest, type UpvoteResponse, type User, type UserVibe, type VerifyOtpRequest, type Vibe, type VoidRedemptionRequest, type WalletHistoryResponse, type WalletOrder, type WalletOrderItem, type WalletProduct, type WalletRedemption, clubKeys, configureSDK, conversationKeys, getApiClient, getConfig, miscKeys, notificationKeys, orderKeys, postKeys, productKeys, spotKeys, templateKeys, useAdjustStock, useBlockUser, useBlockedUsers, useCancelOrder, useCities, useClaimSpot, useClub, useClubBySlug, useClubMembership, useClubsBySpot, useClubsByUser, useCompleteOnboardingStep, useConversation, useConversationMessages, useConversations, useCreateClub, useCreateCoinbaseCharge, useCreateConversation, useCreateDirectConversation, useCreateOrder, useCreatePost, useCreateProduct, useCreateReply, useCreateSpot, useCreateStripeIntent, useCurrentUser, useDeleteAccount, useDeletePost, useDeleteProduct, useDeleteReply, useFavoriteSpot, useFulfillPost, useInfiniteSpots, useJoinClub, useLeaveClub, useLifeSituations, useMarkConversationAsRead, useMarkNotificationsRead, useMyOrders, useNotifications, useOrder, useOwnedSpots, usePost, usePostResponses, usePostStatus, usePostUpvotes, usePosts, usePostsFeed, useProduct, useProductBySlug, useRateSpot, useRedeem, useRedemptionLookup, useRefreshToken, useRegisterDeviceToken, useRemoveDeviceToken, useReportPost, useReportSpot, useRespondToPost, useSendMessage, useSendOtp, useSendTypingIndicator, useSpot, useSpotByQR, useSpotBySlug, useSpotFavoriteStatus, useSpotImages, useSpotOrders, useSpotPosts, useSpotProducts, useSpotRedemptions, useSpots, useSubscribeToSpot, useTemplate, useTemplateBySlug, useTemplates, useUnblockUser, useUnreadNotificationCount, useUnsubscribeFromSpot, useUpdateClub, useUpdateInterests, useUpdateOrderStatus, useUpdatePost, useUpdatePostStatus, useUpdateProduct, useUpdateProfile, useUpdateResponse, useUpdateSpot, useUpdateVibes, useUploadAvatar, useUpvotePost, useUserActivity, useUserClubs, useUserFavorites, useUserPosts, useUserSpotsSummary, useUserStats, useUserSubscriptions, useVerifyOtp, useVibes, useVoidRedemption, useWallet, useWalletHistory, userKeys, walletKeys };
1656
+ export { type AuthResponse, type CartItem, type City, type ClaimSpotRequest, type Club, type ClubMember, type ClubMemberRole, type CoinbaseChargeResponse, type Conversation, type CreateConversationRequest, type CreateOrderRequest, type CreateOrderResponse, type CreatePostRequest, type CreateProductRequest, type CreateReplyRequest, type FavoriteSpot, type InfiniteSpotsParams, type Intention, type Interest, type LifeSituation, type Message, type Notification, type Order, type OrderFilters, type OrderItem, type OrderWithDetails, type PaginatedResponse, type PaginationMeta, type PaymentConfig, type PaymentIntentResponse, type Post, type PostReply, type PostReport, type PostResponse, type PostTemplate, type PostUpvote, type PostUpvoter, type PostUpvotesResponse, type Product, type ProductFilters, type ProductWithSpot, type RedeemRequest, type RedemptionLookup, type RedemptionStatus, type ReportStatus, type RespondToPostRequest, type SDKConfig, type SendMessageRequest, type SendOtpRequest, type Spot, type SpotClaim, type SpotImage, type SpotIntention, type SpotPost, type SpotPostType, type SpotSubscription, type SpotSummary, type SpotVibe, type SpotsSummaryMeta, type SpotsSummaryResponse, type Template, type UpdateProductRequest, type UpdateProfileRequest, type UpdateResponseRequest, type UpvoteResponse, type User, type UserVibe, type VerifyOtpRequest, type Vibe, type VoidRedemptionRequest, type WalletHistoryResponse, type WalletOrder, type WalletOrderItem, type WalletProduct, type WalletRedemption, clubKeys, configureSDK, conversationKeys, getApiClient, getConfig, miscKeys, notificationKeys, orderKeys, paymentKeys, postKeys, productKeys, spotKeys, templateKeys, useAdjustStock, useBlockUser, useBlockedUsers, useCancelOrder, useCities, useClaimSpot, useClub, useClubBySlug, useClubMembership, useClubsBySpot, useClubsByUser, useCompleteOnboardingStep, useConversation, useConversationMessages, useConversations, useCreateClub, useCreateCoinbaseCharge, useCreateConversation, useCreateDirectConversation, useCreateOrder, useCreatePost, useCreateProduct, useCreateReply, useCreateSpot, useCreateStripeIntent, useCurrentUser, useDeleteAccount, useDeletePost, useDeleteProduct, useDeleteReply, useFavoriteSpot, useFulfillPost, useInfiniteSpots, useJoinClub, useLeaveClub, useLifeSituations, useMarkConversationAsRead, useMarkNotificationsRead, useMyOrders, useNotifications, useOrder, useOwnedSpots, usePaymentConfig, usePost, usePostResponses, usePostStatus, usePostUpvotes, usePosts, usePostsFeed, useProduct, useProductBySlug, useRateSpot, useRedeem, useRedemptionLookup, useRefreshToken, useRegisterDeviceToken, useRemoveDeviceToken, useReportPost, useReportSpot, useRespondToPost, useSendMessage, useSendOtp, useSendTypingIndicator, useSpot, useSpotByQR, useSpotBySlug, useSpotFavoriteStatus, useSpotImages, useSpotOrders, useSpotPosts, useSpotProducts, useSpotRedemptions, useSpots, useSubscribeToSpot, useTemplate, useTemplateBySlug, useTemplates, useUnblockUser, useUnreadNotificationCount, useUnsubscribeFromSpot, useUpdateClub, useUpdateInterests, useUpdateOrderStatus, useUpdatePost, useUpdatePostStatus, useUpdateProduct, useUpdateProfile, useUpdateResponse, useUpdateSpot, useUpdateVibes, useUploadAvatar, useUpvotePost, useUserActivity, useUserClubs, useUserFavorites, useUserPosts, useUserSpotsSummary, useUserStats, useUserSubscriptions, useVerifyOtp, useVibes, useVoidRedemption, useWallet, useWalletHistory, userKeys, walletKeys };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { AxiosInstance } from 'axios';
2
- import { PostType, AccountStatus, SpotType, ResponseStatus, ReportReason, NotificationType, ClaimStatus, ProductResponseDto, OrderStatus, SendOtpDto, VerifyOtpDto, CreatePostDto, CreateReplyDto, CreateResponseDto, UpdateResponseDto, UpdateUserDto, CreateConversationDto, CreateMessageDto, ClaimSpotDto, UpvoteResponseDto, VerifyOtpWrappedResponseDto, ApiResponse, PostStatusDto, ProductType, ProductStatus } from '@spotsdev/types';
2
+ import { PostType, SpotResponseDto, PostResponseDto, PostReplyDto, ProductResponseDto, SpotImageDto, SpotVibeDto, SpotIntentionDto, OrderItemDto, NotificationResponseDto, SpotOwnerDto, ResponseStatus, ReportReason, ClaimStatus, OrderStatus, SendOtpDto, VerifyOtpDto, CreatePostDto, CreateReplyDto, CreateResponseDto, UpdateResponseDto, UpdateUserDto, CreateConversationDto, CreateMessageDto, ClaimSpotDto, UpvoteResponseDto, VerifyOtpWrappedResponseDto, ApiResponse, PostStatusDto, ProductType, ProductStatus } from '@spotsdev/types';
3
3
  export * from '@spotsdev/types';
4
+ export { AccountStatus, AddUserInterestDto, AdjustStockDto, ApiResponse, AuthTokensDto, AuthUserDto, ClaimSpotDto, ClaimStatus, CreateConversationDto, CreateIntentionDto, CreateInterestDto, CreateMediaDto, CreateMessageDto, CreateOrderDto, CreatePostDto, CreateProductDto, CreateReplyDto, CreateReportDto, CreateResponseDto, CreateSpotDto, FulfillmentType, MediaType, NotificationResponseDto, NotificationType, NotificationsListResponseDto, OrderItemDto, OrderStatus, PaginatedPostsResponseDto, PaginatedProductsResponseDto, PaginatedSpotsResponseDto, PostReplyDto, PostReportResponseDto, PostResponseDto, PostSpotDto, PostStatus, PostStatusDto, PostStatusResponseDto, PostType, PostUserDto, ProductResponseDto, ProductStatus, ProductType, RefreshTokenDto, RefreshTokenResponseDto, ReportReason, ResponseStatus, SendOtpDto, SendOtpResponseDto, SpotCityDto, SpotClaimResponseDto, SpotImageDto, SpotIntentionDto, SpotOwnerDto, SpotResponseDto, SpotType, SpotVibeDto, UpdateIntentionDto, UpdateInterestDto, UpdateOrderStatusDto, UpdatePostDto, UpdateProductDto, UpdateResponseDto, UpdateSpotDto, UpdateUserDto, UpvoteResponseDto, UserResponseDto, VerifyOtpDto } from '@spotsdev/types';
4
5
  import { UseMutationOptions, UseMutationResult, UseQueryOptions, UseQueryResult, UseInfiniteQueryOptions, UseInfiniteQueryResult } from '@tanstack/react-query';
5
6
 
6
7
  interface SDKConfig {
@@ -16,87 +17,33 @@ declare function getConfig(): SDKConfig;
16
17
  /**
17
18
  * Spots SDK Entity Types
18
19
  *
19
- * These types mirror the Prisma schema entities but without @prisma/client dependency.
20
- * This allows the SDK to work in React Native where Prisma is not available.
20
+ * ALL entity and enum types are imported from @spotsdev/types (generated from OpenAPI spec).
21
+ * This file re-exports them with SDK-friendly aliases and adds SDK-specific types.
21
22
  *
22
- * IMPORTANT: Enum types are imported from @spotsdev/types (generated from OpenAPI spec).
23
- * types.ts handles re-exporting from spots-types - this file only defines entity interfaces
24
- * and SDK-specific types not in the OpenAPI spec.
23
+ * IMPORTANT: Do NOT define entity types here - they come from spots-types.
25
24
  */
26
25
 
27
26
  type SpotPostType = PostType;
27
+ type Spot = SpotResponseDto;
28
+ type SpotPost = PostResponseDto;
29
+ type PostReply = PostReplyDto;
30
+ type Product = ProductResponseDto;
31
+ type SpotImage = SpotImageDto;
32
+ type SpotVibe = SpotVibeDto;
33
+ type SpotIntention = SpotIntentionDto;
34
+ type OrderItem = OrderItemDto;
35
+ type Notification = NotificationResponseDto;
36
+ type User = SpotOwnerDto & {
37
+ phone?: string | null;
38
+ email?: string | null;
39
+ bio?: string | null;
40
+ onboardingCompleted?: boolean;
41
+ lastActiveAt?: Date | null;
42
+ createdAt?: Date;
43
+ updatedAt?: Date;
44
+ };
28
45
  type ReportStatus = 'PENDING' | 'REVIEWED' | 'RESOLVED' | 'DISMISSED';
29
- interface UserVibe {
30
- id: string;
31
- name: string;
32
- emoji: string | null;
33
- slug?: string;
34
- category?: string;
35
- }
36
- interface User {
37
- id: string;
38
- phone: string | null;
39
- email: string | null;
40
- name: string | null;
41
- bio: string | null;
42
- avatarUrl: string | null;
43
- status: AccountStatus;
44
- onboardingCompleted: boolean;
45
- vibes?: UserVibe[];
46
- lastActiveAt: Date | null;
47
- createdAt: Date;
48
- updatedAt: Date;
49
- }
50
- interface Spot {
51
- id: string;
52
- name: string;
53
- slug: string;
54
- description: string | null;
55
- address: string | null;
56
- city: string | null;
57
- country: string | null;
58
- latitude: number | null;
59
- longitude: number | null;
60
- lat?: number | null;
61
- lng?: number | null;
62
- type: SpotType;
63
- googlePlaceId: string | null;
64
- website: string | null;
65
- phone: string | null;
66
- imageUrl: string | null;
67
- ownerId: string | null;
68
- isVerified: boolean;
69
- marketplaceEnabled: boolean;
70
- createdAt: Date | string;
71
- updatedAt: Date | string;
72
- }
73
- interface SpotPost {
74
- id: string;
75
- spotId: string;
76
- userId: string;
77
- postType: SpotPostType;
78
- title: string;
79
- content: string | null;
80
- emoji: string | null;
81
- expiresAt: Date | null;
82
- status: 'ACTIVE' | 'FULFILLED' | 'EXPIRED' | 'DELETED';
83
- upvoteCount: number;
84
- responseCount: number;
85
- replyCount: number;
86
- createdAt: Date;
87
- updatedAt: Date;
88
- user?: User;
89
- spot?: Spot;
90
- }
91
- interface PostReply {
92
- id: string;
93
- postId: string;
94
- userId: string;
95
- content: string;
96
- createdAt: Date;
97
- updatedAt: Date;
98
- user?: User;
99
- }
46
+ type ClubMemberRole = 'MEMBER' | 'ADMIN' | 'OWNER';
100
47
  interface PostResponse {
101
48
  id: string;
102
49
  postId: string;
@@ -114,9 +61,6 @@ interface PostUpvote {
114
61
  userId: string;
115
62
  createdAt: Date;
116
63
  }
117
- /**
118
- * PostUpvoter - user who upvoted a post (from /posts/:id/upvotes endpoint)
119
- */
120
64
  interface PostUpvoter {
121
65
  id: string;
122
66
  userId: string;
@@ -124,9 +68,6 @@ interface PostUpvoter {
124
68
  avatarUrl: string | null;
125
69
  createdAt: Date;
126
70
  }
127
- /**
128
- * PostUpvotesResponse - response from /posts/:id/upvotes endpoint
129
- */
130
71
  interface PostUpvotesResponse {
131
72
  data: PostUpvoter[];
132
73
  meta: {
@@ -163,7 +104,7 @@ interface ClubMember {
163
104
  id: string;
164
105
  clubId: string;
165
106
  userId: string;
166
- role: 'MEMBER' | 'ADMIN' | 'OWNER';
107
+ role: ClubMemberRole;
167
108
  joinedAt: Date;
168
109
  }
169
110
  interface Conversation {
@@ -181,16 +122,6 @@ interface Message {
181
122
  createdAt: Date;
182
123
  sender?: User;
183
124
  }
184
- interface Notification {
185
- id: string;
186
- userId: string;
187
- type: NotificationType;
188
- title: string;
189
- body: string | null;
190
- data: Record<string, unknown> | null;
191
- isRead: boolean;
192
- createdAt: Date;
193
- }
194
125
  interface PostTemplate {
195
126
  id: string;
196
127
  postType: SpotPostType;
@@ -227,6 +158,13 @@ interface LifeSituation {
227
158
  emoji: string | null;
228
159
  createdAt: Date;
229
160
  }
161
+ interface UserVibe {
162
+ id: string;
163
+ name: string;
164
+ emoji: string | null;
165
+ slug?: string;
166
+ category?: string;
167
+ }
230
168
  interface FavoriteSpot {
231
169
  id: string;
232
170
  userId: string;
@@ -234,25 +172,12 @@ interface FavoriteSpot {
234
172
  createdAt: Date;
235
173
  spot?: Spot;
236
174
  }
237
- interface SpotImage {
175
+ interface SpotSubscription {
238
176
  id: string;
239
177
  spotId: string;
240
- url: string;
241
- caption: string | null;
242
- sortOrder: number;
178
+ userId: string;
243
179
  createdAt: Date;
244
- }
245
- interface SpotVibe {
246
- id: string;
247
- spotId: string;
248
- vibeId: string;
249
- vibe?: Vibe;
250
- }
251
- interface SpotIntention {
252
- id: string;
253
- spotId: string;
254
- intentionId: string;
255
- intention?: Intention;
180
+ spot?: Spot;
256
181
  }
257
182
  interface SpotClaim {
258
183
  id: string;
@@ -263,13 +188,6 @@ interface SpotClaim {
263
188
  createdAt: Date;
264
189
  updatedAt: Date;
265
190
  }
266
- interface SpotSubscription {
267
- id: string;
268
- spotId: string;
269
- userId: string;
270
- createdAt: Date;
271
- spot?: Spot;
272
- }
273
191
  interface City {
274
192
  id: string;
275
193
  name: string;
@@ -279,22 +197,6 @@ interface City {
279
197
  timezone: string | null;
280
198
  createdAt: Date;
281
199
  }
282
- /**
283
- * Paginated response with meta information
284
- */
285
- interface PaginatedResponse<T> {
286
- data: T[];
287
- meta: PaginationMeta;
288
- }
289
- interface PaginationMeta {
290
- total: number;
291
- page: number;
292
- limit: number;
293
- totalPages: number;
294
- hasNextPage: boolean;
295
- hasPreviousPage: boolean;
296
- }
297
- type Product = ProductResponseDto;
298
200
  interface Order {
299
201
  id: string;
300
202
  spotId: string;
@@ -308,15 +210,19 @@ interface Order {
308
210
  metadata: Record<string, unknown> | null;
309
211
  createdAt: Date;
310
212
  updatedAt: Date;
213
+ items?: OrderItem[];
311
214
  }
312
- interface OrderItem {
313
- id: string;
314
- orderId: string;
315
- productId: string;
316
- quantity: number;
317
- unitPrice: number;
215
+ interface PaginationMeta {
318
216
  total: number;
319
- createdAt: Date;
217
+ page: number;
218
+ limit: number;
219
+ totalPages: number;
220
+ hasNextPage: boolean;
221
+ hasPreviousPage: boolean;
222
+ }
223
+ interface PaginatedResponse<T> {
224
+ data: T[];
225
+ meta: PaginationMeta;
320
226
  }
321
227
 
322
228
  /**
@@ -1110,6 +1016,37 @@ declare function useSpotRedemptions(spotId: string, params?: {
1110
1016
  limit?: number;
1111
1017
  }, options?: Omit<UseQueryOptions<WalletHistoryResponse>, 'queryKey' | 'queryFn'>): UseQueryResult<WalletHistoryResponse>;
1112
1018
 
1019
+ /**
1020
+ * Payments Query Hooks
1021
+ *
1022
+ * TanStack Query hooks for payment configuration.
1023
+ */
1024
+
1025
+ declare const paymentKeys: {
1026
+ all: readonly ["payments"];
1027
+ config: () => readonly ["payments", "config"];
1028
+ };
1029
+ /**
1030
+ * Payment configuration returned by GET /payments/config
1031
+ */
1032
+ interface PaymentConfig {
1033
+ stripe: {
1034
+ publishableKey: string | null;
1035
+ enabled: boolean;
1036
+ };
1037
+ coinbase: {
1038
+ enabled: boolean;
1039
+ };
1040
+ supportedMethods: Array<'card' | 'apple_pay' | 'google_pay' | 'crypto'>;
1041
+ }
1042
+ /**
1043
+ * Get payment configuration
1044
+ * Returns publishable keys and enabled payment methods
1045
+ *
1046
+ * @endpoint GET /payments/config
1047
+ */
1048
+ declare function usePaymentConfig(options?: Omit<UseQueryOptions<PaymentConfig>, 'queryKey' | 'queryFn'>): UseQueryResult<PaymentConfig>;
1049
+
1113
1050
  /**
1114
1051
  * Users Mutation Hooks
1115
1052
  *
@@ -1538,6 +1475,7 @@ declare function useRemoveDeviceToken(options?: Omit<UseMutationOptions<void, Er
1538
1475
  interface CreateProductRequest {
1539
1476
  spotId: string;
1540
1477
  name: string;
1478
+ slug?: string;
1541
1479
  description?: string;
1542
1480
  type: ProductType;
1543
1481
  price: number;
@@ -1715,4 +1653,4 @@ declare function useVoidRedemption(): UseMutationResult<WalletRedemption, Error,
1715
1653
  reason: string;
1716
1654
  }>;
1717
1655
 
1718
- export { type AuthResponse, type CartItem, type City, type ClaimSpotRequest, type Club, type ClubMember, type CoinbaseChargeResponse, type Conversation, type CreateConversationRequest, type CreateOrderRequest, type CreateOrderResponse, type CreatePostRequest, type CreateProductRequest, type CreateReplyRequest, type FavoriteSpot, type InfiniteSpotsParams, type Intention, type Interest, type LifeSituation, type Message, type Notification, type Order, type OrderFilters, type OrderItem, type OrderWithDetails, type PaginatedResponse, type PaginationMeta, type PaymentIntentResponse, type Post, type PostReply, type PostReport, type PostResponse, type PostTemplate, type PostUpvote, type PostUpvoter, type PostUpvotesResponse, type Product, type ProductFilters, type ProductWithSpot, type RedeemRequest, type RedemptionLookup, type RedemptionStatus, type ReportStatus, type RespondToPostRequest, type SDKConfig, type SendMessageRequest, type SendOtpRequest, type Spot, type SpotClaim, type SpotImage, type SpotIntention, type SpotPost, type SpotPostType, type SpotSubscription, type SpotSummary, type SpotVibe, type SpotsSummaryMeta, type SpotsSummaryResponse, type Template, type UpdateProductRequest, type UpdateProfileRequest, type UpdateResponseRequest, type UpvoteResponse, type User, type UserVibe, type VerifyOtpRequest, type Vibe, type VoidRedemptionRequest, type WalletHistoryResponse, type WalletOrder, type WalletOrderItem, type WalletProduct, type WalletRedemption, clubKeys, configureSDK, conversationKeys, getApiClient, getConfig, miscKeys, notificationKeys, orderKeys, postKeys, productKeys, spotKeys, templateKeys, useAdjustStock, useBlockUser, useBlockedUsers, useCancelOrder, useCities, useClaimSpot, useClub, useClubBySlug, useClubMembership, useClubsBySpot, useClubsByUser, useCompleteOnboardingStep, useConversation, useConversationMessages, useConversations, useCreateClub, useCreateCoinbaseCharge, useCreateConversation, useCreateDirectConversation, useCreateOrder, useCreatePost, useCreateProduct, useCreateReply, useCreateSpot, useCreateStripeIntent, useCurrentUser, useDeleteAccount, useDeletePost, useDeleteProduct, useDeleteReply, useFavoriteSpot, useFulfillPost, useInfiniteSpots, useJoinClub, useLeaveClub, useLifeSituations, useMarkConversationAsRead, useMarkNotificationsRead, useMyOrders, useNotifications, useOrder, useOwnedSpots, usePost, usePostResponses, usePostStatus, usePostUpvotes, usePosts, usePostsFeed, useProduct, useProductBySlug, useRateSpot, useRedeem, useRedemptionLookup, useRefreshToken, useRegisterDeviceToken, useRemoveDeviceToken, useReportPost, useReportSpot, useRespondToPost, useSendMessage, useSendOtp, useSendTypingIndicator, useSpot, useSpotByQR, useSpotBySlug, useSpotFavoriteStatus, useSpotImages, useSpotOrders, useSpotPosts, useSpotProducts, useSpotRedemptions, useSpots, useSubscribeToSpot, useTemplate, useTemplateBySlug, useTemplates, useUnblockUser, useUnreadNotificationCount, useUnsubscribeFromSpot, useUpdateClub, useUpdateInterests, useUpdateOrderStatus, useUpdatePost, useUpdatePostStatus, useUpdateProduct, useUpdateProfile, useUpdateResponse, useUpdateSpot, useUpdateVibes, useUploadAvatar, useUpvotePost, useUserActivity, useUserClubs, useUserFavorites, useUserPosts, useUserSpotsSummary, useUserStats, useUserSubscriptions, useVerifyOtp, useVibes, useVoidRedemption, useWallet, useWalletHistory, userKeys, walletKeys };
1656
+ export { type AuthResponse, type CartItem, type City, type ClaimSpotRequest, type Club, type ClubMember, type ClubMemberRole, type CoinbaseChargeResponse, type Conversation, type CreateConversationRequest, type CreateOrderRequest, type CreateOrderResponse, type CreatePostRequest, type CreateProductRequest, type CreateReplyRequest, type FavoriteSpot, type InfiniteSpotsParams, type Intention, type Interest, type LifeSituation, type Message, type Notification, type Order, type OrderFilters, type OrderItem, type OrderWithDetails, type PaginatedResponse, type PaginationMeta, type PaymentConfig, type PaymentIntentResponse, type Post, type PostReply, type PostReport, type PostResponse, type PostTemplate, type PostUpvote, type PostUpvoter, type PostUpvotesResponse, type Product, type ProductFilters, type ProductWithSpot, type RedeemRequest, type RedemptionLookup, type RedemptionStatus, type ReportStatus, type RespondToPostRequest, type SDKConfig, type SendMessageRequest, type SendOtpRequest, type Spot, type SpotClaim, type SpotImage, type SpotIntention, type SpotPost, type SpotPostType, type SpotSubscription, type SpotSummary, type SpotVibe, type SpotsSummaryMeta, type SpotsSummaryResponse, type Template, type UpdateProductRequest, type UpdateProfileRequest, type UpdateResponseRequest, type UpvoteResponse, type User, type UserVibe, type VerifyOtpRequest, type Vibe, type VoidRedemptionRequest, type WalletHistoryResponse, type WalletOrder, type WalletOrderItem, type WalletProduct, type WalletRedemption, clubKeys, configureSDK, conversationKeys, getApiClient, getConfig, miscKeys, notificationKeys, orderKeys, paymentKeys, postKeys, productKeys, spotKeys, templateKeys, useAdjustStock, useBlockUser, useBlockedUsers, useCancelOrder, useCities, useClaimSpot, useClub, useClubBySlug, useClubMembership, useClubsBySpot, useClubsByUser, useCompleteOnboardingStep, useConversation, useConversationMessages, useConversations, useCreateClub, useCreateCoinbaseCharge, useCreateConversation, useCreateDirectConversation, useCreateOrder, useCreatePost, useCreateProduct, useCreateReply, useCreateSpot, useCreateStripeIntent, useCurrentUser, useDeleteAccount, useDeletePost, useDeleteProduct, useDeleteReply, useFavoriteSpot, useFulfillPost, useInfiniteSpots, useJoinClub, useLeaveClub, useLifeSituations, useMarkConversationAsRead, useMarkNotificationsRead, useMyOrders, useNotifications, useOrder, useOwnedSpots, usePaymentConfig, usePost, usePostResponses, usePostStatus, usePostUpvotes, usePosts, usePostsFeed, useProduct, useProductBySlug, useRateSpot, useRedeem, useRedemptionLookup, useRefreshToken, useRegisterDeviceToken, useRemoveDeviceToken, useReportPost, useReportSpot, useRespondToPost, useSendMessage, useSendOtp, useSendTypingIndicator, useSpot, useSpotByQR, useSpotBySlug, useSpotFavoriteStatus, useSpotImages, useSpotOrders, useSpotPosts, useSpotProducts, useSpotRedemptions, useSpots, useSubscribeToSpot, useTemplate, useTemplateBySlug, useTemplates, useUnblockUser, useUnreadNotificationCount, useUnsubscribeFromSpot, useUpdateClub, useUpdateInterests, useUpdateOrderStatus, useUpdatePost, useUpdatePostStatus, useUpdateProduct, useUpdateProfile, useUpdateResponse, useUpdateSpot, useUpdateVibes, useUploadAvatar, useUpvotePost, useUserActivity, useUserClubs, useUserFavorites, useUserPosts, useUserSpotsSummary, useUserStats, useUserSubscriptions, useVerifyOtp, useVibes, useVoidRedemption, useWallet, useWalletHistory, userKeys, walletKeys };