@spotsdev/sdk 1.6.0 → 1.7.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.cjs.map +1 -1
- package/dist/index.d.cts +32 -184
- package/dist/index.d.ts +32 -184
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/api/entities.ts +84 -227
- package/src/api/mutations/orders.ts +10 -1
- package/src/api/queries/orders.ts +1 -1
- package/src/api/types.ts +2 -0
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AxiosInstance } from 'axios';
|
|
2
|
-
import { PostType, SpotResponseDto, PostResponseDto, PostReplyDto, ProductResponseDto, SpotImageDto, SpotVibeDto, SpotIntentionDto, OrderItemDto, NotificationResponseDto, SpotOwnerDto,
|
|
2
|
+
import { PostType, SpotResponseDto, PostResponseDto, PostReplyDto, ProductResponseDto, SpotImageDto, SpotVibeDto, SpotIntentionDto, OrderItemDto, NotificationResponseDto, SpotOwnerDto, PostUpvoteDto, ConversationDto, MessageDto, ClubDto, ClubMemberDto, PostTemplateDto, VibeDto, CityDto, FavoriteSpotDto, SpotSubscriptionDto, SpotClaimDto, OrderResponseDto, PostReportDto, PostResponseEntityDto, LifeSituationDto, PaginationMetaDto, SendOtpDto, VerifyOtpDto, CreatePostDto, CreateReplyDto, CreateResponseDto, UpdateResponseDto, UpdateUserDto, CreateConversationDto, CreateMessageDto, ClaimSpotDto, UpvoteResponseDto, PostUpvotesResponseDto, VerifyOtpWrappedResponseDto, ApiResponse, PostStatusDto, ProductType, ProductStatus, OrderStatus } 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
|
+
export { AccountStatus, AddUserInterestDto, AdjustStockDto, ApiResponse, AuthTokensDto, AuthUserDto, CityDto, ClaimSpotDto, ClaimStatus, ClubCategory, ClubDto, ClubMemberDto, ClubMemberStatus, ClubMemberWithUserDto, ClubStatus, ConversationDto, ConversationLastMessageDto, ConversationParticipantDto, CreateConversationDto, CreateIntentionDto, CreateInterestDto, CreateMediaDto, CreateMessageDto, CreateOrderDto, CreatePostDto, CreateProductDto, CreateReplyDto, CreateReportDto, CreateResponseDto, CreateSpotDto, FavoriteSpotDto, FulfillmentType, LifeSituationDto, MediaType, MessageDto, MessageSenderDto, NotificationResponseDto, NotificationType, NotificationsListResponseDto, OrderItemDto, OrderItemResponseDto, OrderResponseDto, OrderStatus, PaginatedPostsResponseDto, PaginatedProductsResponseDto, PaginatedSpotsResponseDto, PaginationMetaDto, PostReplyDto, PostReportDto, PostReportResponseDto, PostResponseDto, PostResponseEntityDto, PostSpotDto, PostStatus, PostStatusDto, PostStatusResponseDto, PostTemplateDto, PostType, PostUpvoteDto, PostUpvoterDto, PostUpvotesMetaDto, PostUpvotesResponseDto, PostUserDto, ProductResponseDto, ProductStatus, ProductType, RefreshTokenDto, RefreshTokenResponseDto, ReportReason, ReportStatus, ResponseStatus, SendOtpDto, SendOtpResponseDto, SpotCityDto, SpotClaimDto, SpotClaimResponseDto, SpotImageDto, SpotIntentionDto, SpotOwnerDto, SpotResponseDto, SpotSubscriptionDto, SpotType, SpotVibeDto, UpdateIntentionDto, UpdateInterestDto, UpdateOrderStatusDto, UpdatePostDto, UpdateProductDto, UpdateResponseDto, UpdateSpotDto, UpdateUserDto, UpvoteResponseDto, UserResponseDto, UserVibeDto, VerifyOtpDto, VibeDto } from '@spotsdev/types';
|
|
5
5
|
import { UseMutationOptions, UseMutationResult, UseQueryOptions, UseQueryResult, UseInfiniteQueryOptions, UseInfiniteQueryResult } from '@tanstack/react-query';
|
|
6
6
|
|
|
7
7
|
interface SDKConfig {
|
|
@@ -18,7 +18,7 @@ declare function getConfig(): SDKConfig;
|
|
|
18
18
|
* Spots SDK Entity Types
|
|
19
19
|
*
|
|
20
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
|
|
21
|
+
* This file re-exports them with SDK-friendly aliases.
|
|
22
22
|
*
|
|
23
23
|
* IMPORTANT: Do NOT define entity types here - they come from spots-types.
|
|
24
24
|
*/
|
|
@@ -42,184 +42,22 @@ type User = SpotOwnerDto & {
|
|
|
42
42
|
createdAt?: Date;
|
|
43
43
|
updatedAt?: Date;
|
|
44
44
|
};
|
|
45
|
-
type
|
|
46
|
-
type
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
userId: string;
|
|
62
|
-
createdAt: Date;
|
|
63
|
-
}
|
|
64
|
-
interface PostUpvoter {
|
|
65
|
-
id: string;
|
|
66
|
-
userId: string;
|
|
67
|
-
name: string | null;
|
|
68
|
-
avatarUrl: string | null;
|
|
69
|
-
createdAt: Date;
|
|
70
|
-
}
|
|
71
|
-
interface PostUpvotesResponse {
|
|
72
|
-
data: PostUpvoter[];
|
|
73
|
-
meta: {
|
|
74
|
-
total: number;
|
|
75
|
-
limit: number;
|
|
76
|
-
offset: number;
|
|
77
|
-
hasMore: boolean;
|
|
78
|
-
currentUserUpvoted: boolean;
|
|
79
|
-
isPostAuthor: boolean;
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
interface PostReport {
|
|
83
|
-
id: string;
|
|
84
|
-
postId: string;
|
|
85
|
-
userId: string;
|
|
86
|
-
reason: ReportReason;
|
|
87
|
-
details: string | null;
|
|
88
|
-
status: ReportStatus;
|
|
89
|
-
createdAt: Date;
|
|
90
|
-
updatedAt: Date;
|
|
91
|
-
}
|
|
92
|
-
interface Club {
|
|
93
|
-
id: string;
|
|
94
|
-
name: string;
|
|
95
|
-
slug: string;
|
|
96
|
-
description: string | null;
|
|
97
|
-
imageUrl: string | null;
|
|
98
|
-
isPrivate: boolean;
|
|
99
|
-
createdById: string;
|
|
100
|
-
createdAt: Date;
|
|
101
|
-
updatedAt: Date;
|
|
102
|
-
}
|
|
103
|
-
interface ClubMember {
|
|
104
|
-
id: string;
|
|
105
|
-
clubId: string;
|
|
106
|
-
userId: string;
|
|
107
|
-
role: ClubMemberRole;
|
|
108
|
-
joinedAt: Date;
|
|
109
|
-
}
|
|
110
|
-
interface Conversation {
|
|
111
|
-
id: string;
|
|
112
|
-
createdAt: Date;
|
|
113
|
-
updatedAt: Date;
|
|
114
|
-
participants?: User[];
|
|
115
|
-
messages?: Message[];
|
|
116
|
-
}
|
|
117
|
-
interface Message {
|
|
118
|
-
id: string;
|
|
119
|
-
conversationId: string;
|
|
120
|
-
senderId: string;
|
|
121
|
-
content: string;
|
|
122
|
-
createdAt: Date;
|
|
123
|
-
sender?: User;
|
|
124
|
-
}
|
|
125
|
-
interface PostTemplate {
|
|
126
|
-
id: string;
|
|
127
|
-
postType: SpotPostType;
|
|
128
|
-
emoji: string;
|
|
129
|
-
title: string;
|
|
130
|
-
placeholder: string | null;
|
|
131
|
-
isActive: boolean;
|
|
132
|
-
sortOrder: number;
|
|
133
|
-
createdAt: Date;
|
|
134
|
-
updatedAt: Date;
|
|
135
|
-
}
|
|
136
|
-
interface Vibe {
|
|
137
|
-
id: string;
|
|
138
|
-
name: string;
|
|
139
|
-
emoji: string | null;
|
|
140
|
-
createdAt: Date;
|
|
141
|
-
}
|
|
142
|
-
interface Interest {
|
|
143
|
-
id: string;
|
|
144
|
-
name: string;
|
|
145
|
-
emoji: string | null;
|
|
146
|
-
category: string | null;
|
|
147
|
-
createdAt: Date;
|
|
148
|
-
}
|
|
149
|
-
interface Intention {
|
|
150
|
-
id: string;
|
|
151
|
-
name: string;
|
|
152
|
-
emoji: string | null;
|
|
153
|
-
createdAt: Date;
|
|
154
|
-
}
|
|
155
|
-
interface LifeSituation {
|
|
156
|
-
id: string;
|
|
157
|
-
name: string;
|
|
158
|
-
emoji: string | null;
|
|
159
|
-
createdAt: Date;
|
|
160
|
-
}
|
|
161
|
-
interface UserVibe {
|
|
162
|
-
id: string;
|
|
163
|
-
name: string;
|
|
164
|
-
emoji: string | null;
|
|
165
|
-
slug?: string;
|
|
166
|
-
category?: string;
|
|
167
|
-
}
|
|
168
|
-
interface FavoriteSpot {
|
|
169
|
-
id: string;
|
|
170
|
-
userId: string;
|
|
171
|
-
spotId: string;
|
|
172
|
-
createdAt: Date;
|
|
173
|
-
spot?: Spot;
|
|
174
|
-
}
|
|
175
|
-
interface SpotSubscription {
|
|
176
|
-
id: string;
|
|
177
|
-
spotId: string;
|
|
178
|
-
userId: string;
|
|
179
|
-
createdAt: Date;
|
|
180
|
-
spot?: Spot;
|
|
181
|
-
}
|
|
182
|
-
interface SpotClaim {
|
|
183
|
-
id: string;
|
|
184
|
-
spotId: string;
|
|
185
|
-
userId: string;
|
|
186
|
-
status: ClaimStatus;
|
|
187
|
-
verificationMethod: string | null;
|
|
188
|
-
createdAt: Date;
|
|
189
|
-
updatedAt: Date;
|
|
190
|
-
}
|
|
191
|
-
interface City {
|
|
192
|
-
id: string;
|
|
193
|
-
name: string;
|
|
194
|
-
country: string;
|
|
195
|
-
latitude: number;
|
|
196
|
-
longitude: number;
|
|
197
|
-
timezone: string | null;
|
|
198
|
-
createdAt: Date;
|
|
199
|
-
}
|
|
200
|
-
interface Order {
|
|
201
|
-
id: string;
|
|
202
|
-
spotId: string;
|
|
203
|
-
userId: string;
|
|
204
|
-
status: OrderStatus;
|
|
205
|
-
subtotal: number;
|
|
206
|
-
tax: number;
|
|
207
|
-
total: number;
|
|
208
|
-
currency: string;
|
|
209
|
-
notes: string | null;
|
|
210
|
-
metadata: Record<string, unknown> | null;
|
|
211
|
-
createdAt: Date;
|
|
212
|
-
updatedAt: Date;
|
|
213
|
-
items?: OrderItem[];
|
|
214
|
-
}
|
|
215
|
-
interface PaginationMeta {
|
|
216
|
-
total: number;
|
|
217
|
-
page: number;
|
|
218
|
-
limit: number;
|
|
219
|
-
totalPages: number;
|
|
220
|
-
hasNextPage: boolean;
|
|
221
|
-
hasPreviousPage: boolean;
|
|
222
|
-
}
|
|
45
|
+
type PostUpvote = PostUpvoteDto;
|
|
46
|
+
type Conversation = ConversationDto;
|
|
47
|
+
type Message = MessageDto;
|
|
48
|
+
type Club = ClubDto;
|
|
49
|
+
type ClubMember = ClubMemberDto;
|
|
50
|
+
type PostTemplate = PostTemplateDto;
|
|
51
|
+
type Vibe = VibeDto;
|
|
52
|
+
type City = CityDto;
|
|
53
|
+
type FavoriteSpot = FavoriteSpotDto;
|
|
54
|
+
type SpotSubscription = SpotSubscriptionDto;
|
|
55
|
+
type SpotClaim = SpotClaimDto;
|
|
56
|
+
type Order = OrderResponseDto;
|
|
57
|
+
type PostReport = PostReportDto;
|
|
58
|
+
type PostResponse = PostResponseEntityDto;
|
|
59
|
+
type LifeSituation = LifeSituationDto;
|
|
60
|
+
type PaginationMeta = PaginationMetaDto;
|
|
223
61
|
interface PaginatedResponse<T> {
|
|
224
62
|
data: T[];
|
|
225
63
|
meta: PaginationMeta;
|
|
@@ -246,6 +84,7 @@ type CreateConversationRequest = CreateConversationDto;
|
|
|
246
84
|
type SendMessageRequest = CreateMessageDto;
|
|
247
85
|
type ClaimSpotRequest = ClaimSpotDto;
|
|
248
86
|
type UpvoteResponse = UpvoteResponseDto;
|
|
87
|
+
type PostUpvotesResponse = PostUpvotesResponseDto;
|
|
249
88
|
type AuthResponse = VerifyOtpWrappedResponseDto;
|
|
250
89
|
type Post = SpotPost;
|
|
251
90
|
type Template = PostTemplate;
|
|
@@ -876,7 +715,7 @@ declare const orderKeys: {
|
|
|
876
715
|
myOrders: () => readonly ["orders", "my"];
|
|
877
716
|
spotOrders: (spotId: string) => readonly ["orders", "spot", string];
|
|
878
717
|
};
|
|
879
|
-
interface OrderWithDetails extends Order {
|
|
718
|
+
interface OrderWithDetails extends Omit<Order, 'items'> {
|
|
880
719
|
items: (OrderItem & {
|
|
881
720
|
product: Pick<Product, 'id' | 'name' | 'slug' | 'type' | 'imageUrl'>;
|
|
882
721
|
})[];
|
|
@@ -1555,14 +1394,23 @@ interface CreateOrderRequest {
|
|
|
1555
1394
|
notes?: string;
|
|
1556
1395
|
deliveryAddress?: string;
|
|
1557
1396
|
}
|
|
1558
|
-
interface CreateOrderResponse extends Order {
|
|
1397
|
+
interface CreateOrderResponse extends Omit<Order, 'items'> {
|
|
1559
1398
|
items: Array<{
|
|
1560
1399
|
id: string;
|
|
1400
|
+
orderId: string;
|
|
1561
1401
|
productId: string;
|
|
1562
1402
|
productName: string;
|
|
1403
|
+
productType: string;
|
|
1563
1404
|
quantity: number;
|
|
1564
1405
|
unitPrice: number;
|
|
1565
1406
|
totalPrice: number;
|
|
1407
|
+
status: string;
|
|
1408
|
+
passCode: string | null;
|
|
1409
|
+
ticketCode: string | null;
|
|
1410
|
+
passExpiresAt: string | null;
|
|
1411
|
+
redeemedAt: string | null;
|
|
1412
|
+
specialInstructions: string | null;
|
|
1413
|
+
createdAt: string;
|
|
1566
1414
|
}>;
|
|
1567
1415
|
}
|
|
1568
1416
|
interface PaymentIntentResponse {
|
|
@@ -1644,4 +1492,4 @@ declare function useVoidRedemption(): UseMutationResult<WalletRedemption, Error,
|
|
|
1644
1492
|
reason: string;
|
|
1645
1493
|
}>;
|
|
1646
1494
|
|
|
1647
|
-
export { type AuthResponse, type CartItem, type City, type ClaimSpotRequest, type Club, type ClubMember, type
|
|
1495
|
+
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 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 PostUpvotesResponse, type Product, type ProductFilters, type ProductWithSpot, type RedeemRequest, type RedemptionLookup, type RedemptionStatus, 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 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,7 +1,7 @@
|
|
|
1
1
|
import { AxiosInstance } from 'axios';
|
|
2
|
-
import { PostType, SpotResponseDto, PostResponseDto, PostReplyDto, ProductResponseDto, SpotImageDto, SpotVibeDto, SpotIntentionDto, OrderItemDto, NotificationResponseDto, SpotOwnerDto,
|
|
2
|
+
import { PostType, SpotResponseDto, PostResponseDto, PostReplyDto, ProductResponseDto, SpotImageDto, SpotVibeDto, SpotIntentionDto, OrderItemDto, NotificationResponseDto, SpotOwnerDto, PostUpvoteDto, ConversationDto, MessageDto, ClubDto, ClubMemberDto, PostTemplateDto, VibeDto, CityDto, FavoriteSpotDto, SpotSubscriptionDto, SpotClaimDto, OrderResponseDto, PostReportDto, PostResponseEntityDto, LifeSituationDto, PaginationMetaDto, SendOtpDto, VerifyOtpDto, CreatePostDto, CreateReplyDto, CreateResponseDto, UpdateResponseDto, UpdateUserDto, CreateConversationDto, CreateMessageDto, ClaimSpotDto, UpvoteResponseDto, PostUpvotesResponseDto, VerifyOtpWrappedResponseDto, ApiResponse, PostStatusDto, ProductType, ProductStatus, OrderStatus } 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
|
+
export { AccountStatus, AddUserInterestDto, AdjustStockDto, ApiResponse, AuthTokensDto, AuthUserDto, CityDto, ClaimSpotDto, ClaimStatus, ClubCategory, ClubDto, ClubMemberDto, ClubMemberStatus, ClubMemberWithUserDto, ClubStatus, ConversationDto, ConversationLastMessageDto, ConversationParticipantDto, CreateConversationDto, CreateIntentionDto, CreateInterestDto, CreateMediaDto, CreateMessageDto, CreateOrderDto, CreatePostDto, CreateProductDto, CreateReplyDto, CreateReportDto, CreateResponseDto, CreateSpotDto, FavoriteSpotDto, FulfillmentType, LifeSituationDto, MediaType, MessageDto, MessageSenderDto, NotificationResponseDto, NotificationType, NotificationsListResponseDto, OrderItemDto, OrderItemResponseDto, OrderResponseDto, OrderStatus, PaginatedPostsResponseDto, PaginatedProductsResponseDto, PaginatedSpotsResponseDto, PaginationMetaDto, PostReplyDto, PostReportDto, PostReportResponseDto, PostResponseDto, PostResponseEntityDto, PostSpotDto, PostStatus, PostStatusDto, PostStatusResponseDto, PostTemplateDto, PostType, PostUpvoteDto, PostUpvoterDto, PostUpvotesMetaDto, PostUpvotesResponseDto, PostUserDto, ProductResponseDto, ProductStatus, ProductType, RefreshTokenDto, RefreshTokenResponseDto, ReportReason, ReportStatus, ResponseStatus, SendOtpDto, SendOtpResponseDto, SpotCityDto, SpotClaimDto, SpotClaimResponseDto, SpotImageDto, SpotIntentionDto, SpotOwnerDto, SpotResponseDto, SpotSubscriptionDto, SpotType, SpotVibeDto, UpdateIntentionDto, UpdateInterestDto, UpdateOrderStatusDto, UpdatePostDto, UpdateProductDto, UpdateResponseDto, UpdateSpotDto, UpdateUserDto, UpvoteResponseDto, UserResponseDto, UserVibeDto, VerifyOtpDto, VibeDto } from '@spotsdev/types';
|
|
5
5
|
import { UseMutationOptions, UseMutationResult, UseQueryOptions, UseQueryResult, UseInfiniteQueryOptions, UseInfiniteQueryResult } from '@tanstack/react-query';
|
|
6
6
|
|
|
7
7
|
interface SDKConfig {
|
|
@@ -18,7 +18,7 @@ declare function getConfig(): SDKConfig;
|
|
|
18
18
|
* Spots SDK Entity Types
|
|
19
19
|
*
|
|
20
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
|
|
21
|
+
* This file re-exports them with SDK-friendly aliases.
|
|
22
22
|
*
|
|
23
23
|
* IMPORTANT: Do NOT define entity types here - they come from spots-types.
|
|
24
24
|
*/
|
|
@@ -42,184 +42,22 @@ type User = SpotOwnerDto & {
|
|
|
42
42
|
createdAt?: Date;
|
|
43
43
|
updatedAt?: Date;
|
|
44
44
|
};
|
|
45
|
-
type
|
|
46
|
-
type
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
userId: string;
|
|
62
|
-
createdAt: Date;
|
|
63
|
-
}
|
|
64
|
-
interface PostUpvoter {
|
|
65
|
-
id: string;
|
|
66
|
-
userId: string;
|
|
67
|
-
name: string | null;
|
|
68
|
-
avatarUrl: string | null;
|
|
69
|
-
createdAt: Date;
|
|
70
|
-
}
|
|
71
|
-
interface PostUpvotesResponse {
|
|
72
|
-
data: PostUpvoter[];
|
|
73
|
-
meta: {
|
|
74
|
-
total: number;
|
|
75
|
-
limit: number;
|
|
76
|
-
offset: number;
|
|
77
|
-
hasMore: boolean;
|
|
78
|
-
currentUserUpvoted: boolean;
|
|
79
|
-
isPostAuthor: boolean;
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
interface PostReport {
|
|
83
|
-
id: string;
|
|
84
|
-
postId: string;
|
|
85
|
-
userId: string;
|
|
86
|
-
reason: ReportReason;
|
|
87
|
-
details: string | null;
|
|
88
|
-
status: ReportStatus;
|
|
89
|
-
createdAt: Date;
|
|
90
|
-
updatedAt: Date;
|
|
91
|
-
}
|
|
92
|
-
interface Club {
|
|
93
|
-
id: string;
|
|
94
|
-
name: string;
|
|
95
|
-
slug: string;
|
|
96
|
-
description: string | null;
|
|
97
|
-
imageUrl: string | null;
|
|
98
|
-
isPrivate: boolean;
|
|
99
|
-
createdById: string;
|
|
100
|
-
createdAt: Date;
|
|
101
|
-
updatedAt: Date;
|
|
102
|
-
}
|
|
103
|
-
interface ClubMember {
|
|
104
|
-
id: string;
|
|
105
|
-
clubId: string;
|
|
106
|
-
userId: string;
|
|
107
|
-
role: ClubMemberRole;
|
|
108
|
-
joinedAt: Date;
|
|
109
|
-
}
|
|
110
|
-
interface Conversation {
|
|
111
|
-
id: string;
|
|
112
|
-
createdAt: Date;
|
|
113
|
-
updatedAt: Date;
|
|
114
|
-
participants?: User[];
|
|
115
|
-
messages?: Message[];
|
|
116
|
-
}
|
|
117
|
-
interface Message {
|
|
118
|
-
id: string;
|
|
119
|
-
conversationId: string;
|
|
120
|
-
senderId: string;
|
|
121
|
-
content: string;
|
|
122
|
-
createdAt: Date;
|
|
123
|
-
sender?: User;
|
|
124
|
-
}
|
|
125
|
-
interface PostTemplate {
|
|
126
|
-
id: string;
|
|
127
|
-
postType: SpotPostType;
|
|
128
|
-
emoji: string;
|
|
129
|
-
title: string;
|
|
130
|
-
placeholder: string | null;
|
|
131
|
-
isActive: boolean;
|
|
132
|
-
sortOrder: number;
|
|
133
|
-
createdAt: Date;
|
|
134
|
-
updatedAt: Date;
|
|
135
|
-
}
|
|
136
|
-
interface Vibe {
|
|
137
|
-
id: string;
|
|
138
|
-
name: string;
|
|
139
|
-
emoji: string | null;
|
|
140
|
-
createdAt: Date;
|
|
141
|
-
}
|
|
142
|
-
interface Interest {
|
|
143
|
-
id: string;
|
|
144
|
-
name: string;
|
|
145
|
-
emoji: string | null;
|
|
146
|
-
category: string | null;
|
|
147
|
-
createdAt: Date;
|
|
148
|
-
}
|
|
149
|
-
interface Intention {
|
|
150
|
-
id: string;
|
|
151
|
-
name: string;
|
|
152
|
-
emoji: string | null;
|
|
153
|
-
createdAt: Date;
|
|
154
|
-
}
|
|
155
|
-
interface LifeSituation {
|
|
156
|
-
id: string;
|
|
157
|
-
name: string;
|
|
158
|
-
emoji: string | null;
|
|
159
|
-
createdAt: Date;
|
|
160
|
-
}
|
|
161
|
-
interface UserVibe {
|
|
162
|
-
id: string;
|
|
163
|
-
name: string;
|
|
164
|
-
emoji: string | null;
|
|
165
|
-
slug?: string;
|
|
166
|
-
category?: string;
|
|
167
|
-
}
|
|
168
|
-
interface FavoriteSpot {
|
|
169
|
-
id: string;
|
|
170
|
-
userId: string;
|
|
171
|
-
spotId: string;
|
|
172
|
-
createdAt: Date;
|
|
173
|
-
spot?: Spot;
|
|
174
|
-
}
|
|
175
|
-
interface SpotSubscription {
|
|
176
|
-
id: string;
|
|
177
|
-
spotId: string;
|
|
178
|
-
userId: string;
|
|
179
|
-
createdAt: Date;
|
|
180
|
-
spot?: Spot;
|
|
181
|
-
}
|
|
182
|
-
interface SpotClaim {
|
|
183
|
-
id: string;
|
|
184
|
-
spotId: string;
|
|
185
|
-
userId: string;
|
|
186
|
-
status: ClaimStatus;
|
|
187
|
-
verificationMethod: string | null;
|
|
188
|
-
createdAt: Date;
|
|
189
|
-
updatedAt: Date;
|
|
190
|
-
}
|
|
191
|
-
interface City {
|
|
192
|
-
id: string;
|
|
193
|
-
name: string;
|
|
194
|
-
country: string;
|
|
195
|
-
latitude: number;
|
|
196
|
-
longitude: number;
|
|
197
|
-
timezone: string | null;
|
|
198
|
-
createdAt: Date;
|
|
199
|
-
}
|
|
200
|
-
interface Order {
|
|
201
|
-
id: string;
|
|
202
|
-
spotId: string;
|
|
203
|
-
userId: string;
|
|
204
|
-
status: OrderStatus;
|
|
205
|
-
subtotal: number;
|
|
206
|
-
tax: number;
|
|
207
|
-
total: number;
|
|
208
|
-
currency: string;
|
|
209
|
-
notes: string | null;
|
|
210
|
-
metadata: Record<string, unknown> | null;
|
|
211
|
-
createdAt: Date;
|
|
212
|
-
updatedAt: Date;
|
|
213
|
-
items?: OrderItem[];
|
|
214
|
-
}
|
|
215
|
-
interface PaginationMeta {
|
|
216
|
-
total: number;
|
|
217
|
-
page: number;
|
|
218
|
-
limit: number;
|
|
219
|
-
totalPages: number;
|
|
220
|
-
hasNextPage: boolean;
|
|
221
|
-
hasPreviousPage: boolean;
|
|
222
|
-
}
|
|
45
|
+
type PostUpvote = PostUpvoteDto;
|
|
46
|
+
type Conversation = ConversationDto;
|
|
47
|
+
type Message = MessageDto;
|
|
48
|
+
type Club = ClubDto;
|
|
49
|
+
type ClubMember = ClubMemberDto;
|
|
50
|
+
type PostTemplate = PostTemplateDto;
|
|
51
|
+
type Vibe = VibeDto;
|
|
52
|
+
type City = CityDto;
|
|
53
|
+
type FavoriteSpot = FavoriteSpotDto;
|
|
54
|
+
type SpotSubscription = SpotSubscriptionDto;
|
|
55
|
+
type SpotClaim = SpotClaimDto;
|
|
56
|
+
type Order = OrderResponseDto;
|
|
57
|
+
type PostReport = PostReportDto;
|
|
58
|
+
type PostResponse = PostResponseEntityDto;
|
|
59
|
+
type LifeSituation = LifeSituationDto;
|
|
60
|
+
type PaginationMeta = PaginationMetaDto;
|
|
223
61
|
interface PaginatedResponse<T> {
|
|
224
62
|
data: T[];
|
|
225
63
|
meta: PaginationMeta;
|
|
@@ -246,6 +84,7 @@ type CreateConversationRequest = CreateConversationDto;
|
|
|
246
84
|
type SendMessageRequest = CreateMessageDto;
|
|
247
85
|
type ClaimSpotRequest = ClaimSpotDto;
|
|
248
86
|
type UpvoteResponse = UpvoteResponseDto;
|
|
87
|
+
type PostUpvotesResponse = PostUpvotesResponseDto;
|
|
249
88
|
type AuthResponse = VerifyOtpWrappedResponseDto;
|
|
250
89
|
type Post = SpotPost;
|
|
251
90
|
type Template = PostTemplate;
|
|
@@ -876,7 +715,7 @@ declare const orderKeys: {
|
|
|
876
715
|
myOrders: () => readonly ["orders", "my"];
|
|
877
716
|
spotOrders: (spotId: string) => readonly ["orders", "spot", string];
|
|
878
717
|
};
|
|
879
|
-
interface OrderWithDetails extends Order {
|
|
718
|
+
interface OrderWithDetails extends Omit<Order, 'items'> {
|
|
880
719
|
items: (OrderItem & {
|
|
881
720
|
product: Pick<Product, 'id' | 'name' | 'slug' | 'type' | 'imageUrl'>;
|
|
882
721
|
})[];
|
|
@@ -1555,14 +1394,23 @@ interface CreateOrderRequest {
|
|
|
1555
1394
|
notes?: string;
|
|
1556
1395
|
deliveryAddress?: string;
|
|
1557
1396
|
}
|
|
1558
|
-
interface CreateOrderResponse extends Order {
|
|
1397
|
+
interface CreateOrderResponse extends Omit<Order, 'items'> {
|
|
1559
1398
|
items: Array<{
|
|
1560
1399
|
id: string;
|
|
1400
|
+
orderId: string;
|
|
1561
1401
|
productId: string;
|
|
1562
1402
|
productName: string;
|
|
1403
|
+
productType: string;
|
|
1563
1404
|
quantity: number;
|
|
1564
1405
|
unitPrice: number;
|
|
1565
1406
|
totalPrice: number;
|
|
1407
|
+
status: string;
|
|
1408
|
+
passCode: string | null;
|
|
1409
|
+
ticketCode: string | null;
|
|
1410
|
+
passExpiresAt: string | null;
|
|
1411
|
+
redeemedAt: string | null;
|
|
1412
|
+
specialInstructions: string | null;
|
|
1413
|
+
createdAt: string;
|
|
1566
1414
|
}>;
|
|
1567
1415
|
}
|
|
1568
1416
|
interface PaymentIntentResponse {
|
|
@@ -1644,4 +1492,4 @@ declare function useVoidRedemption(): UseMutationResult<WalletRedemption, Error,
|
|
|
1644
1492
|
reason: string;
|
|
1645
1493
|
}>;
|
|
1646
1494
|
|
|
1647
|
-
export { type AuthResponse, type CartItem, type City, type ClaimSpotRequest, type Club, type ClubMember, type
|
|
1495
|
+
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 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 PostUpvotesResponse, type Product, type ProductFilters, type ProductWithSpot, type RedeemRequest, type RedemptionLookup, type RedemptionStatus, 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 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 };
|