@vansite/ts-sharetribe-flex-sdk 1.0.34 → 3.0.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.
Files changed (274) hide show
  1. package/README.md +1 -1
  2. package/dist/endpoints/assets/index.d.ts +47 -0
  3. package/dist/endpoints/auth/index.d.ts +45 -0
  4. package/dist/endpoints/integrationApi/AvailabilityExceptions.d.ts +66 -0
  5. package/dist/endpoints/integrationApi/Events.d.ts +43 -0
  6. package/dist/endpoints/integrationApi/Images.d.ts +36 -0
  7. package/dist/endpoints/integrationApi/Listings.d.ts +87 -0
  8. package/dist/endpoints/integrationApi/Marketplace.d.ts +30 -0
  9. package/dist/endpoints/integrationApi/Stock.d.ts +42 -0
  10. package/dist/endpoints/integrationApi/StockAdjustments.d.ts +64 -0
  11. package/dist/{types/endpoints/integrationApi/StockReservation.d.ts → endpoints/integrationApi/StockReservations.d.ts} +3 -4
  12. package/dist/endpoints/integrationApi/Transactions.d.ts +76 -0
  13. package/dist/endpoints/integrationApi/Users.d.ts +72 -0
  14. package/dist/endpoints/integrationApi/index.d.ts +58 -0
  15. package/dist/endpoints/marketplace/AvailabilityExceptions.d.ts +69 -0
  16. package/dist/endpoints/marketplace/Bookings.d.ts +45 -0
  17. package/dist/endpoints/marketplace/CurrentUser.d.ts +110 -0
  18. package/dist/endpoints/marketplace/Images.d.ts +38 -0
  19. package/dist/endpoints/marketplace/Listings.d.ts +52 -0
  20. package/dist/endpoints/marketplace/Marketplace.d.ts +33 -0
  21. package/dist/endpoints/marketplace/Messages.d.ts +51 -0
  22. package/dist/endpoints/marketplace/OwnListings.d.ts +116 -0
  23. package/dist/endpoints/marketplace/PasswordReset.d.ts +50 -0
  24. package/dist/endpoints/marketplace/ProcessTransitions.d.ts +42 -0
  25. package/dist/endpoints/marketplace/Reviews.d.ts +49 -0
  26. package/dist/endpoints/marketplace/SitemapData.d.ts +60 -0
  27. package/dist/endpoints/marketplace/Stock.d.ts +50 -0
  28. package/dist/endpoints/marketplace/StockAdjustments.d.ts +64 -0
  29. package/dist/endpoints/marketplace/StripeAccount.d.ts +56 -0
  30. package/dist/endpoints/marketplace/StripeAccountLinks.d.ts +42 -0
  31. package/dist/endpoints/marketplace/StripeCustomer.d.ts +62 -0
  32. package/dist/endpoints/marketplace/StripePersons.d.ts +37 -0
  33. package/dist/endpoints/marketplace/StripeSetupIntents.d.ts +42 -0
  34. package/dist/endpoints/marketplace/TimeSlots.d.ts +40 -0
  35. package/dist/endpoints/marketplace/Transactions.d.ts +89 -0
  36. package/dist/endpoints/marketplace/Users.d.ts +34 -0
  37. package/dist/endpoints/marketplace/index.d.ts +82 -0
  38. package/dist/index.d.ts +161 -0
  39. package/dist/index.js +3 -0
  40. package/dist/{ts-sharetribe-flex-sdk.cjs.LICENSE.txt → index.js.LICENSE.txt} +35 -5
  41. package/dist/index.js.map +1 -0
  42. package/dist/index.mjs +3 -0
  43. package/dist/{ts-sharetribe-flex-sdk.js.LICENSE.txt → index.mjs.LICENSE.txt} +35 -5
  44. package/dist/index.mjs.map +1 -0
  45. package/dist/index.umd.js +3 -0
  46. package/dist/{ts-sharetribe-flex-sdk.mjs.LICENSE.txt → index.umd.js.LICENSE.txt} +35 -5
  47. package/dist/index.umd.js.map +1 -0
  48. package/dist/integrationSdk.d.ts +119 -0
  49. package/dist/sdk.d.ts +211 -0
  50. package/dist/sdkTypes/BigDecimal.d.ts +30 -0
  51. package/dist/sdkTypes/LatLng.d.ts +34 -0
  52. package/dist/sdkTypes/LatLngBounds.d.ts +51 -0
  53. package/dist/sdkTypes/Money.d.ts +35 -0
  54. package/dist/sdkTypes/UUID.d.ts +45 -0
  55. package/dist/types/apiConfigs.d.ts +104 -0
  56. package/dist/types/assets/index.d.ts +101 -0
  57. package/dist/types/authentication/index.d.ts +152 -0
  58. package/dist/types/axios.d.ts +10 -0
  59. package/dist/types/config.d.ts +99 -0
  60. package/dist/types/endpoints/assets/index.d.ts +22 -36
  61. package/dist/types/endpoints/assets/index.d.ts.map +1 -1
  62. package/dist/types/endpoints/auth/index.d.ts +20 -41
  63. package/dist/types/endpoints/auth/index.d.ts.map +1 -1
  64. package/dist/types/endpoints/integrationApi/AvailabilityExceptions.d.ts +30 -49
  65. package/dist/types/endpoints/integrationApi/AvailabilityExceptions.d.ts.map +1 -1
  66. package/dist/types/endpoints/integrationApi/Events.d.ts +23 -27
  67. package/dist/types/endpoints/integrationApi/Events.d.ts.map +1 -1
  68. package/dist/types/endpoints/integrationApi/Images.d.ts +17 -28
  69. package/dist/types/endpoints/integrationApi/Images.d.ts.map +1 -1
  70. package/dist/types/endpoints/integrationApi/Listings.d.ts +42 -104
  71. package/dist/types/endpoints/integrationApi/Listings.d.ts.map +1 -1
  72. package/dist/types/endpoints/integrationApi/Marketplace.d.ts +12 -20
  73. package/dist/types/endpoints/integrationApi/Marketplace.d.ts.map +1 -1
  74. package/dist/types/endpoints/integrationApi/Stock.d.ts +22 -28
  75. package/dist/types/endpoints/integrationApi/Stock.d.ts.map +1 -1
  76. package/dist/types/endpoints/integrationApi/StockAdjustments.d.ts +35 -35
  77. package/dist/types/endpoints/integrationApi/StockAdjustments.d.ts.map +1 -1
  78. package/dist/types/endpoints/integrationApi/StockReservations.d.ts +43 -0
  79. package/dist/types/endpoints/integrationApi/StockReservations.d.ts.map +1 -0
  80. package/dist/types/endpoints/integrationApi/Transactions.d.ts +36 -80
  81. package/dist/types/endpoints/integrationApi/Transactions.d.ts.map +1 -1
  82. package/dist/types/endpoints/integrationApi/Users.d.ts +35 -70
  83. package/dist/types/endpoints/integrationApi/Users.d.ts.map +1 -1
  84. package/dist/types/endpoints/integrationApi/index.d.ts +40 -40
  85. package/dist/types/endpoints/integrationApi/index.d.ts.map +1 -1
  86. package/dist/types/endpoints/marketplace/AvailabilityExceptions.d.ts +34 -48
  87. package/dist/types/endpoints/marketplace/AvailabilityExceptions.d.ts.map +1 -1
  88. package/dist/types/endpoints/marketplace/Bookings.d.ts +24 -23
  89. package/dist/types/endpoints/marketplace/Bookings.d.ts.map +1 -1
  90. package/dist/types/endpoints/marketplace/CurrentUser.d.ts +54 -125
  91. package/dist/types/endpoints/marketplace/CurrentUser.d.ts.map +1 -1
  92. package/dist/types/endpoints/marketplace/Images.d.ts +19 -27
  93. package/dist/types/endpoints/marketplace/Images.d.ts.map +1 -1
  94. package/dist/types/endpoints/marketplace/Listings.d.ts +26 -25
  95. package/dist/types/endpoints/marketplace/Listings.d.ts.map +1 -1
  96. package/dist/types/endpoints/marketplace/Marketplace.d.ts +15 -19
  97. package/dist/types/endpoints/marketplace/Marketplace.d.ts.map +1 -1
  98. package/dist/types/endpoints/marketplace/Messages.d.ts +24 -29
  99. package/dist/types/endpoints/marketplace/Messages.d.ts.map +1 -1
  100. package/dist/types/endpoints/marketplace/OwnListings.d.ts +55 -119
  101. package/dist/types/endpoints/marketplace/OwnListings.d.ts.map +1 -1
  102. package/dist/types/endpoints/marketplace/PasswordReset.d.ts +23 -35
  103. package/dist/types/endpoints/marketplace/PasswordReset.d.ts.map +1 -1
  104. package/dist/types/endpoints/marketplace/ProcessTransitions.d.ts +22 -22
  105. package/dist/types/endpoints/marketplace/ProcessTransitions.d.ts.map +1 -1
  106. package/dist/types/endpoints/marketplace/Reviews.d.ts +23 -25
  107. package/dist/types/endpoints/marketplace/Reviews.d.ts.map +1 -1
  108. package/dist/types/endpoints/marketplace/SitemapData.d.ts +61 -0
  109. package/dist/types/endpoints/marketplace/SitemapData.d.ts.map +1 -0
  110. package/dist/types/endpoints/marketplace/Stock.d.ts +30 -26
  111. package/dist/types/endpoints/marketplace/Stock.d.ts.map +1 -1
  112. package/dist/types/endpoints/marketplace/StockAdjustments.d.ts +36 -34
  113. package/dist/types/endpoints/marketplace/StockAdjustments.d.ts.map +1 -1
  114. package/dist/types/endpoints/marketplace/StripeAccount.d.ts +28 -49
  115. package/dist/types/endpoints/marketplace/StripeAccount.d.ts.map +1 -1
  116. package/dist/types/endpoints/marketplace/StripeAccountLinks.d.ts +22 -31
  117. package/dist/types/endpoints/marketplace/StripeAccountLinks.d.ts.map +1 -1
  118. package/dist/types/endpoints/marketplace/StripeCustomer.d.ts +32 -46
  119. package/dist/types/endpoints/marketplace/StripeCustomer.d.ts.map +1 -1
  120. package/dist/types/endpoints/marketplace/StripePersons.d.ts +17 -25
  121. package/dist/types/endpoints/marketplace/StripePersons.d.ts.map +1 -1
  122. package/dist/types/endpoints/marketplace/StripeSetupIntents.d.ts +24 -24
  123. package/dist/types/endpoints/marketplace/StripeSetupIntents.d.ts.map +1 -1
  124. package/dist/types/endpoints/marketplace/TimeSlots.d.ts +20 -23
  125. package/dist/types/endpoints/marketplace/TimeSlots.d.ts.map +1 -1
  126. package/dist/types/endpoints/marketplace/Transactions.d.ts +45 -81
  127. package/dist/types/endpoints/marketplace/Transactions.d.ts.map +1 -1
  128. package/dist/types/endpoints/marketplace/Users.d.ts +15 -22
  129. package/dist/types/endpoints/marketplace/Users.d.ts.map +1 -1
  130. package/dist/types/endpoints/marketplace/index.d.ts +52 -40
  131. package/dist/types/endpoints/marketplace/index.d.ts.map +1 -1
  132. package/dist/types/index.d.ts +15 -30
  133. package/dist/types/index.d.ts.map +1 -1
  134. package/dist/types/integration/events.d.ts +87 -0
  135. package/dist/types/integrationSdk.d.ts +4 -5
  136. package/dist/types/integrationSdk.d.ts.map +1 -1
  137. package/dist/types/marketplace/availabilityExceptions.d.ts +99 -0
  138. package/dist/types/marketplace/availabilityPlan.d.ts +17 -0
  139. package/dist/types/marketplace/bookings.d.ts +80 -0
  140. package/dist/types/marketplace/currentUser.d.ts +202 -0
  141. package/dist/types/marketplace/images.d.ts +65 -0
  142. package/dist/types/marketplace/listings.d.ts +169 -0
  143. package/dist/types/marketplace/marketplace.d.ts +30 -0
  144. package/dist/types/marketplace/messages.d.ts +87 -0
  145. package/dist/types/marketplace/ownListings.d.ts +155 -0
  146. package/dist/types/marketplace/passwordReset.d.ts +54 -0
  147. package/dist/types/marketplace/processTransitions.d.ts +56 -0
  148. package/dist/types/marketplace/reviews.d.ts +108 -0
  149. package/dist/types/marketplace/sitemapData.d.ts +47 -0
  150. package/dist/types/marketplace/stock.d.ts +45 -0
  151. package/dist/types/marketplace/stockAdjustment.d.ts +97 -0
  152. package/dist/types/marketplace/stockReservations.d.ts +89 -0
  153. package/dist/types/marketplace/stripeAccount.d.ts +67 -0
  154. package/dist/types/marketplace/stripeAccountLinks.d.ts +55 -0
  155. package/dist/types/marketplace/stripeCustomer.d.ts +94 -0
  156. package/dist/types/marketplace/stripePaymentMethod.d.ts +21 -0
  157. package/dist/types/marketplace/stripePersons.d.ts +48 -0
  158. package/dist/types/marketplace/stripeSetupIntents.d.ts +48 -0
  159. package/dist/types/marketplace/timeSlots.d.ts +51 -0
  160. package/dist/types/marketplace/transactions.d.ts +200 -0
  161. package/dist/types/marketplace/user.d.ts +200 -0
  162. package/dist/types/sdk-types.d.ts +10 -0
  163. package/dist/types/sdk.d.ts +6 -7
  164. package/dist/types/sdk.d.ts.map +1 -1
  165. package/dist/types/sdkTypes/BigDecimal.d.ts +1 -1
  166. package/dist/types/sdkTypes/BigDecimal.d.ts.map +1 -1
  167. package/dist/types/sdkTypes/LatLng.d.ts +1 -1
  168. package/dist/types/sdkTypes/LatLng.d.ts.map +1 -1
  169. package/dist/types/sdkTypes/LatLngBounds.d.ts +1 -1
  170. package/dist/types/sdkTypes/LatLngBounds.d.ts.map +1 -1
  171. package/dist/types/sdkTypes/Money.d.ts +9 -2
  172. package/dist/types/sdkTypes/Money.d.ts.map +1 -1
  173. package/dist/types/sdkTypes/UUID.d.ts +8 -1
  174. package/dist/types/sdkTypes/UUID.d.ts.map +1 -1
  175. package/dist/types/sharetribe.d.ts +227 -0
  176. package/dist/types/store.d.ts +22 -0
  177. package/dist/types/types/apiConfigs.d.ts.map +1 -1
  178. package/dist/types/types/assets/index.d.ts +74 -36
  179. package/dist/types/types/assets/index.d.ts.map +1 -1
  180. package/dist/types/types/authentication/index.d.ts +111 -60
  181. package/dist/types/types/authentication/index.d.ts.map +1 -1
  182. package/dist/types/types/axios.d.ts.map +1 -1
  183. package/dist/types/types/config.d.ts +1 -39
  184. package/dist/types/types/config.d.ts.map +1 -1
  185. package/dist/types/types/integration/events.d.ts +52 -20
  186. package/dist/types/types/integration/events.d.ts.map +1 -1
  187. package/dist/types/types/marketplace/availabilityExceptions.d.ts +59 -16
  188. package/dist/types/types/marketplace/availabilityExceptions.d.ts.map +1 -1
  189. package/dist/types/types/marketplace/availabilityPlan.d.ts +18 -0
  190. package/dist/types/types/marketplace/availabilityPlan.d.ts.map +1 -0
  191. package/dist/types/types/marketplace/bookings.d.ts +48 -14
  192. package/dist/types/types/marketplace/bookings.d.ts.map +1 -1
  193. package/dist/types/types/marketplace/currentUser.d.ts +99 -55
  194. package/dist/types/types/marketplace/currentUser.d.ts.map +1 -1
  195. package/dist/types/types/marketplace/images.d.ts +40 -14
  196. package/dist/types/types/marketplace/images.d.ts.map +1 -1
  197. package/dist/types/types/marketplace/listings.d.ts +96 -66
  198. package/dist/types/types/marketplace/listings.d.ts.map +1 -1
  199. package/dist/types/types/marketplace/marketplace.d.ts +16 -6
  200. package/dist/types/types/marketplace/marketplace.d.ts.map +1 -1
  201. package/dist/types/types/marketplace/messages.d.ts +53 -15
  202. package/dist/types/types/marketplace/messages.d.ts.map +1 -1
  203. package/dist/types/types/marketplace/ownListings.d.ts +92 -65
  204. package/dist/types/types/marketplace/ownListings.d.ts.map +1 -1
  205. package/dist/types/types/marketplace/passwordReset.d.ts +32 -9
  206. package/dist/types/types/marketplace/passwordReset.d.ts.map +1 -1
  207. package/dist/types/types/marketplace/processTransitions.d.ts +33 -14
  208. package/dist/types/types/marketplace/processTransitions.d.ts.map +1 -1
  209. package/dist/types/types/marketplace/reviews.d.ts +72 -23
  210. package/dist/types/types/marketplace/reviews.d.ts.map +1 -1
  211. package/dist/types/types/marketplace/sitemapData.d.ts +48 -0
  212. package/dist/types/types/marketplace/sitemapData.d.ts.map +1 -0
  213. package/dist/types/types/marketplace/stock.d.ts +23 -6
  214. package/dist/types/types/marketplace/stock.d.ts.map +1 -1
  215. package/dist/types/types/marketplace/stockAdjustment.d.ts +60 -14
  216. package/dist/types/types/marketplace/stockAdjustment.d.ts.map +1 -1
  217. package/dist/types/types/marketplace/stockReservations.d.ts +59 -14
  218. package/dist/types/types/marketplace/stockReservations.d.ts.map +1 -1
  219. package/dist/types/types/marketplace/stripeAccount.d.ts +28 -5
  220. package/dist/types/types/marketplace/stripeAccount.d.ts.map +1 -1
  221. package/dist/types/types/marketplace/stripeAccountLinks.d.ts +26 -6
  222. package/dist/types/types/marketplace/stripeAccountLinks.d.ts.map +1 -1
  223. package/dist/types/types/marketplace/stripeCustomer.d.ts +60 -13
  224. package/dist/types/types/marketplace/stripeCustomer.d.ts.map +1 -1
  225. package/dist/types/types/marketplace/stripePaymentMethod.d.ts +1 -2
  226. package/dist/types/types/marketplace/stripePaymentMethod.d.ts.map +1 -1
  227. package/dist/types/types/marketplace/stripePersons.d.ts +17 -15
  228. package/dist/types/types/marketplace/stripePersons.d.ts.map +1 -1
  229. package/dist/types/types/marketplace/stripeSetupIntents.d.ts +16 -14
  230. package/dist/types/types/marketplace/stripeSetupIntents.d.ts.map +1 -1
  231. package/dist/types/types/marketplace/timeSlots.d.ts +13 -15
  232. package/dist/types/types/marketplace/timeSlots.d.ts.map +1 -1
  233. package/dist/types/types/marketplace/transactions.d.ts +77 -83
  234. package/dist/types/types/marketplace/transactions.d.ts.map +1 -1
  235. package/dist/types/types/marketplace/user.d.ts +85 -64
  236. package/dist/types/types/marketplace/user.d.ts.map +1 -1
  237. package/dist/types/types/sharetribe.d.ts +130 -92
  238. package/dist/types/types/sharetribe.d.ts.map +1 -1
  239. package/dist/types/types/store.d.ts +3 -14
  240. package/dist/types/types/store.d.ts.map +1 -1
  241. package/dist/types/utils/apis.d.ts +1 -1
  242. package/dist/types/utils/apis.d.ts.map +1 -1
  243. package/dist/types/utils/config.d.ts.map +1 -1
  244. package/dist/types/utils/prepare-axios-instance.d.ts +1 -1
  245. package/dist/types/utils/prepare-axios-instance.d.ts.map +1 -1
  246. package/dist/types/utils/stores/BrowserStore.d.ts +17 -4
  247. package/dist/types/utils/stores/BrowserStore.d.ts.map +1 -1
  248. package/dist/types/utils/stores/ExpressStore.d.ts +26 -8
  249. package/dist/types/utils/stores/ExpressStore.d.ts.map +1 -1
  250. package/dist/types/utils/stores/MemoryStore.d.ts +1 -2
  251. package/dist/types/utils/stores/MemoryStore.d.ts.map +1 -1
  252. package/dist/types/utils/transit.d.ts +1 -1
  253. package/dist/types/utils/transit.d.ts.map +1 -1
  254. package/dist/types/utils/util.d.ts +2 -2
  255. package/dist/types/utils/util.d.ts.map +1 -1
  256. package/dist/utils/apis.d.ts +8 -0
  257. package/dist/utils/config.d.ts +32 -0
  258. package/dist/utils/convert-types.d.ts +13 -0
  259. package/dist/utils/parameter-serializer.d.ts +23 -0
  260. package/dist/utils/prepare-axios-instance.d.ts +14 -0
  261. package/dist/utils/stores/BrowserStore.d.ts +51 -0
  262. package/dist/utils/stores/ExpressStore.d.ts +67 -0
  263. package/dist/utils/stores/MemoryStore.d.ts +23 -0
  264. package/dist/utils/stores/store.d.ts +8 -0
  265. package/dist/utils/transit.d.ts +28 -0
  266. package/dist/utils/util.d.ts +15 -0
  267. package/package.json +16 -14
  268. package/dist/ts-sharetribe-flex-sdk.cjs +0 -3
  269. package/dist/ts-sharetribe-flex-sdk.cjs.map +0 -1
  270. package/dist/ts-sharetribe-flex-sdk.js +0 -3
  271. package/dist/ts-sharetribe-flex-sdk.js.map +0 -1
  272. package/dist/ts-sharetribe-flex-sdk.mjs +0 -3
  273. package/dist/ts-sharetribe-flex-sdk.mjs.map +0 -1
  274. package/dist/types/endpoints/integrationApi/StockReservation.d.ts.map +0 -1
@@ -0,0 +1,200 @@
1
+ /**
2
+ * @fileoverview Type definitions for Users in the Sharetribe Marketplace API.
3
+ */
4
+ import { ApiMeta, ApiParameter, ExtraParameter, ExtraParameterType, QueryMeta, QueryPriv, QueryProt, QueryPub, Relationship, RelationshipTypeMap, UUID } from "../sharetribe";
5
+ /**
6
+ * Available endpoints for the Users API.
7
+ */
8
+ export type UsersEndpoints = "show" | "query" | "updateProfile" | "approve" | "updatePermissions";
9
+ /**
10
+ * Fields available for relationships in users.
11
+ */
12
+ export type UsersRelationshipsFields = "marketplace" | "profileImage" | "stripeAccount" | "effectivePermissionSet";
13
+ /**
14
+ * Possible states for a user.
15
+ */
16
+ export type UserState = "active" | "banned" | "pendingApproval";
17
+ /**
18
+ * Permission levels.
19
+ */
20
+ export type Permissions = "permission/allow" | "permission/deny";
21
+ /**
22
+ * Core user attributes (always present)
23
+ */
24
+ interface BaseUserAttributes {
25
+ banned: boolean;
26
+ deleted: boolean;
27
+ createdAt: Date;
28
+ profile: {
29
+ displayName: string;
30
+ abbreviatedName: string;
31
+ bio: string | null;
32
+ publicData: UserProfilePublicData & UserCustomProfilePublicData;
33
+ metadata: UserProfileMetadata & UserCustomProfileMetadata;
34
+ };
35
+ }
36
+ /**
37
+ * Private/admin-only attributes (only when I = true)
38
+ */
39
+ interface PrivateUserAttributes {
40
+ state: UserState;
41
+ email: string;
42
+ emailVerified: boolean;
43
+ pendingEmail: string | null;
44
+ stripeConnected: boolean;
45
+ identityProviders: {
46
+ idpId: string;
47
+ userId: string;
48
+ }[];
49
+ profile: {
50
+ firstName: string;
51
+ lastName: string;
52
+ protectedData: UserProfileProtectedData & UserCustomProfileProtectedData;
53
+ privateData: UserProfilePrivateData & UserCustomProfilePrivateData;
54
+ permissions: {
55
+ postListings: Permissions;
56
+ initiateTransactions: Permissions;
57
+ read: Permissions;
58
+ };
59
+ };
60
+ }
61
+ /**
62
+ * Main User type with conditional private fields
63
+ */
64
+ export interface User<I extends boolean = false> {
65
+ id: UUID;
66
+ type: "user";
67
+ attributes: BaseUserAttributes & (I extends true ? PrivateUserAttributes : {});
68
+ }
69
+ /**
70
+ * User with relationships
71
+ */
72
+ export interface UserWithRelationships<I extends boolean = false> extends User<I> {
73
+ relationships: {
74
+ marketplace: Relationship<false, "marketplace">;
75
+ profileImage: Relationship<false, "profileImage">;
76
+ stripeAccount: Relationship<false, "stripeAccount">;
77
+ effectivePermissionSet: Relationship<false, "effectivePermissionSet">;
78
+ };
79
+ }
80
+ /**
81
+ * Select user type based on whether relationships are included
82
+ */
83
+ export type UserType<R extends boolean, I extends boolean = false> = R extends true ? UserWithRelationships<I> : User<I>;
84
+ /**
85
+ * Base parameter shared across user endpoints
86
+ */
87
+ export interface UsersParameter extends ApiParameter {
88
+ include?: UsersRelationshipsFields[];
89
+ }
90
+ /**
91
+ * Show endpoint parameters
92
+ */
93
+ export type UsersShowParameter<I extends boolean = false> = UsersParameter & (I extends true ? {
94
+ id?: UUID | string;
95
+ email?: string;
96
+ } : {
97
+ id: UUID | string;
98
+ });
99
+ /**
100
+ * Query endpoint parameters
101
+ */
102
+ export interface UsersQueryParameter extends UsersParameter {
103
+ createdAtStart?: Date | string;
104
+ createdAtEnd?: Date | string;
105
+ sort?: string;
106
+ [keyof: QueryPub]: string | undefined;
107
+ [keyof: QueryMeta]: string | undefined;
108
+ [keyof: QueryPriv]: string | undefined;
109
+ [keyof: QueryProt]: string | undefined;
110
+ }
111
+ /**
112
+ * Update profile parameters
113
+ */
114
+ export interface UsersUpdateProfileParameter extends UsersParameter {
115
+ id: UUID | string;
116
+ firstName?: string;
117
+ lastName?: string;
118
+ displayName?: string;
119
+ bio?: string | null;
120
+ publicData?: UserProfilePublicData & UserCustomProfilePublicData;
121
+ protectedData?: UserProfileProtectedData & UserCustomProfileProtectedData;
122
+ privateData?: UserProfilePrivateData & UserCustomProfilePrivateData;
123
+ metadata?: UserProfileMetadata & UserCustomProfileMetadata;
124
+ profileImageId?: UUID | string;
125
+ }
126
+ /**
127
+ * Approve & permissions parameters
128
+ */
129
+ export interface UsersApproveParameter extends UsersParameter {
130
+ id: UUID | string;
131
+ }
132
+ export interface UsersUpdatePermissionsParameter extends UsersParameter {
133
+ id: UUID | string;
134
+ postListings?: Permissions;
135
+ initiateTransactions?: Permissions;
136
+ read?: Permissions;
137
+ }
138
+ /**
139
+ * Custom profile data types (extensible but typed)
140
+ */
141
+ export interface UserProfilePublicData {
142
+ [key: string]: any;
143
+ }
144
+ export interface UserCustomProfilePublicData extends Record<string, unknown> {
145
+ }
146
+ export interface UserProfileProtectedData {
147
+ [key: string]: any;
148
+ }
149
+ export interface UserCustomProfileProtectedData extends Record<string, unknown> {
150
+ }
151
+ export interface UserProfilePrivateData {
152
+ [key: string]: any;
153
+ }
154
+ export interface UserCustomProfilePrivateData extends Record<string, unknown> {
155
+ }
156
+ export interface UserProfileMetadata {
157
+ [key: string]: any;
158
+ }
159
+ export interface UserCustomProfileMetadata extends Record<string, unknown> {
160
+ }
161
+ /**
162
+ * Helper: does the parameter request includes?
163
+ */
164
+ type HasInclude<P> = P extends {
165
+ include: infer T extends UsersRelationshipsFields[];
166
+ } ? T : never;
167
+ type IncludesRelationships<P> = HasInclude<P> extends never ? false : true;
168
+ /**
169
+ * Helper: extract included resources
170
+ */
171
+ type IncludedResources<P, I> = P extends {
172
+ include: infer I extends readonly UsersRelationshipsFields[];
173
+ } ? RelationshipTypeMap[I[number]][] : never;
174
+ /**
175
+ * Expand behavior
176
+ */
177
+ type ExpandReturnType<T, EP extends ExtraParameter | undefined> = EP extends {
178
+ expand: true;
179
+ } ? T : EP extends {
180
+ expand: false;
181
+ } ? Omit<T, "attributes"> : Omit<T, "attributes">;
182
+ /**
183
+ * Final response data type per endpoint
184
+ */
185
+ type UsersResponseData<E extends UsersEndpoints, P extends AllUsersParameter, EP extends ExtraParameter | undefined, I extends boolean> = E extends "show" ? UserType<IncludesRelationships<P>, I> : E extends "query" ? UserType<IncludesRelationships<P>, I>[] : E extends "updateProfile" | "approve" | "updatePermissions" ? ExpandReturnType<UserType<IncludesRelationships<P>, I>, EP> : never;
186
+ /**
187
+ * Union of all valid parameter types
188
+ */
189
+ type AllUsersParameter = UsersShowParameter<any> | UsersQueryParameter | UsersUpdateProfileParameter | UsersApproveParameter | UsersUpdatePermissionsParameter;
190
+ /**
191
+ * Final response type
192
+ */
193
+ export type UsersResponse<E extends UsersEndpoints, P extends AllUsersParameter, EP extends ExtraParameterType = undefined, I extends boolean = false> = {
194
+ data: UsersResponseData<E, P, EP, I>;
195
+ } & (IncludesRelationships<P> extends true ? {
196
+ included: IncludedResources<P, I>;
197
+ } : {}) & (E extends "query" ? {
198
+ meta: ApiMeta;
199
+ } : {});
200
+ export {};
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Base interface for all SDK type classes.
3
+ * Implementing this interface helps preserve class names during bundling.
4
+ */
5
+ export interface SdkType {
6
+ /**
7
+ * Type identifier for SDK type classes.
8
+ */
9
+ readonly _sdkType: string;
10
+ }
@@ -1,5 +1,4 @@
1
- import { SdkConfig } from "./types/config";
2
- import { ApiConfigs } from "./types/apiConfigs";
1
+ import { ApiConfigs, SdkConfig } from "./types";
3
2
  import { AxiosInstance, AxiosResponse } from "axios";
4
3
  import AuthenticationApi from "./endpoints/auth";
5
4
  import MarketplaceApi from "./endpoints/marketplace";
@@ -24,7 +23,7 @@ import StripeSetupIntents from "./endpoints/marketplace/StripeSetupIntents";
24
23
  import TimeSlots from "./endpoints/marketplace/TimeSlots";
25
24
  import Transactions from "./endpoints/marketplace/Transactions";
26
25
  import Users from "./endpoints/marketplace/Users";
27
- import { AuthInfoResponse, LoginParameter, LoginParameterType, LoginWithIdpParameter, RevokeResponse, TokenResponse } from "./types/authentication";
26
+ import { AuthInfoResponse, LoginParameter, LoginWithIdpParameter, RevokeResponse, TokenResponse, TrustedUserTokenRequest, UserTokenRequest, UserTokenRequestWithAuthCode } from "./types";
28
27
  import AssetsApi from "./endpoints/assets";
29
28
  declare class SharetribeSdk {
30
29
  /**
@@ -170,7 +169,7 @@ declare class SharetribeSdk {
170
169
  * @param {LoginParameter} params - The login parameters.
171
170
  * @returns {Promise<AuthToken>} - The authentication token.
172
171
  */
173
- login<T extends LoginParameterType>(params: LoginParameter<T>): Promise<AxiosResponse<TokenResponse<"user">>>;
172
+ login(params: LoginParameter<'user'>): Promise<AxiosResponse<TokenResponse<UserTokenRequest>>>;
174
173
  /**
175
174
  * Logs in the marketplace operator as the marketplace user and returns a Promise
176
175
  *
@@ -178,7 +177,7 @@ declare class SharetribeSdk {
178
177
  * @param {LoginParameter} params - The login parameters.
179
178
  * @returns {Promise<AuthToken>} - The authentication token.
180
179
  */
181
- loginAs(params: LoginParameter<"auth_code">): Promise<AxiosResponse<TokenResponse<"user">>>;
180
+ loginAs(params: LoginParameter<'auth_code'>): Promise<AxiosResponse<TokenResponse<UserTokenRequestWithAuthCode>>>;
182
181
  /**
183
182
  * Logs in a user using an identity provider (IDP).
184
183
  *
@@ -186,7 +185,7 @@ declare class SharetribeSdk {
186
185
  * @param {LoginWithIdpParameter} params - The IDP login parameters.
187
186
  * @returns {Promise<AuthToken>} - The authentication token.
188
187
  */
189
- loginWithIdp(params: LoginWithIdpParameter): Promise<AxiosResponse<TokenResponse<"user">>>;
188
+ loginWithIdp(params: LoginWithIdpParameter): Promise<AxiosResponse<TokenResponse<UserTokenRequest>>>;
190
189
  /**
191
190
  * Logs out the current user.
192
191
  *
@@ -200,7 +199,7 @@ declare class SharetribeSdk {
200
199
  * @async
201
200
  * @returns {Promise<AuthToken>} - The exchanged token.
202
201
  */
203
- exchangeToken(): Promise<AxiosResponse<TokenResponse<"trusted:user">>>;
202
+ exchangeToken(): Promise<AxiosResponse<TokenResponse<TrustedUserTokenRequest>>>;
204
203
  /**
205
204
  * Retrieves authentication info for the current user.
206
205
  *
@@ -1 +1 @@
1
- {"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../src/sdk.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAc,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC5D,OAAO,iBAA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AAC;IAE9C;;;;;OAKG;gBACS,MAAM,EAAE,SAAS;IAkD7B;;;;;;OAMG;IACG,KAAK,CACT,MAAM,EAAE,cAAc,CAAC,MAAM,CAAC,GAC7B,OAAO,CAAC,aAAa,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAS1D;;;;;;OAMG;IACG,OAAO,CACX,MAAM,EAAE,cAAc,CAAC,WAAW,CAAC,GAClC,OAAO,CAAC,aAAa,CAAC,aAAa,CAAC,4BAA4B,CAAC,CAAC,CAAC;IAStE;;;;;;OAMG;IACG,YAAY,CAChB,MAAM,EAAE,qBAAqB,GAC5B,OAAO,CAAC,aAAa,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAW1D;;;;;OAKG;IACG,MAAM,IAAI,OAAO,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC;IAKtD;;;;;OAKG;IACG,aAAa,IAAI,OAAO,CAAC,aAAa,CAAC,aAAa,CAAC,uBAAuB,CAAC,CAAC,CAAC;IAcrF;;;;;OAKG;IACG,QAAQ,IAAI,OAAO,CAAC,gBAAgB,CAAC;CAoC5C;AAED,eAAe,aAAa,CAAC"}
@@ -4,7 +4,7 @@
4
4
  * The BigDecimal class ensures that large decimal numbers are stored as strings
5
5
  * to avoid precision loss during computations.
6
6
  */
7
- import { SdkType } from "../types/sdk-types";
7
+ import { SdkType } from "../types";
8
8
  declare const BIGDECIMAL_SDK_TYPE = "BigDecimal";
9
9
  declare class BigDecimal implements SdkType {
10
10
  value: string;
@@ -1 +1 @@
1
- {"version":3,"file":"BigDecimal.d.ts","sourceRoot":"","sources":["../../../src/sdkTypes/BigDecimal.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAG7C,QAAA,MAAM,mBAAmB,eAAe,CAAC;AAEzC,cAAM,UAAW,YAAW,OAAO;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,QAAQ,EAAE,OAAO,mBAAmB,CAAC;IAE9C;;;;;;OAMG;gBACS,KAAK,EAAE,GAAG;IAYtB;;;;;;;OAOG;IACH,QAAQ,IAAI,MAAM;CAGnB;AAGD,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"BigDecimal.d.ts","sourceRoot":"","sources":["../../../src/sdkTypes/BigDecimal.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAC,OAAO,EAAC,MAAM,UAAU,CAAC;AAGjC,QAAA,MAAM,mBAAmB,eAAe,CAAC;AAEzC,cAAM,UAAW,YAAW,OAAO;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,QAAQ,EAAE,OAAO,mBAAmB,CAAC;IAE9C;;;;;;OAMG;gBACS,KAAK,EAAE,GAAG;IAYtB;;;;;;;OAOG;IACH,QAAQ,IAAI,MAAM;CAGnB;AAGD,eAAe,UAAU,CAAC"}
@@ -2,7 +2,7 @@
2
2
  * @fileoverview Provides the LatLng class for representing geographical coordinates.
3
3
  * This class encapsulates a latitude and longitude pair, with validation for numeric input.
4
4
  */
5
- import { SdkType } from "../types/sdk-types";
5
+ import { SdkType } from "../types";
6
6
  declare const LATLNG_SDK_TYPE = "LatLng";
7
7
  /**
8
8
  * Class representing a geographical coordinate pair (latitude and longitude).
@@ -1 +1 @@
1
- {"version":3,"file":"LatLng.d.ts","sourceRoot":"","sources":["../../../src/sdkTypes/LatLng.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAG7C,QAAA,MAAM,eAAe,WAAW,CAAC;AAEjC;;GAEG;AACH,cAAM,MAAO,YAAW,OAAO;IAC7B,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,QAAQ,CAAC,QAAQ,EAAE,OAAO,eAAe,CAAC;IAE1C;;;;;;;;OAQG;gBACS,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM;IA4BtD;;;;;;;OAOG;IACH,QAAQ,IAAI,MAAM;CAGnB;AAGD,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"LatLng.d.ts","sourceRoot":"","sources":["../../../src/sdkTypes/LatLng.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAC,OAAO,EAAC,MAAM,UAAU,CAAC;AAGjC,QAAA,MAAM,eAAe,WAAW,CAAC;AAEjC;;GAEG;AACH,cAAM,MAAO,YAAW,OAAO;IAC7B,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,QAAQ,CAAC,QAAQ,EAAE,OAAO,eAAe,CAAC;IAE1C;;;;;;;;OAQG;gBACS,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM;IA4BtD;;;;;;;OAOG;IACH,QAAQ,IAAI,MAAM;CAGnB;AAGD,eAAe,MAAM,CAAC"}
@@ -3,7 +3,7 @@
3
3
  * This class encapsulates a northeast (NE) and southwest (SW) pair of coordinates to define a rectangular area.
4
4
  */
5
5
  import LatLng from "./LatLng";
6
- import { SdkType } from "../types/sdk-types";
6
+ import { SdkType } from "../types";
7
7
  declare const LATLNGBOUNDS_SDK_TYPE = "LatLngBounds";
8
8
  /**
9
9
  * Class representing a geographical bounding box with NE and SW coordinates.
@@ -1 +1 @@
1
- {"version":3,"file":"LatLngBounds.d.ts","sourceRoot":"","sources":["../../../src/sdkTypes/LatLngBounds.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C,QAAA,MAAM,qBAAqB,iBAAiB,CAAC;AAE7C;;GAEG;AACH,cAAM,YAAa,YAAW,OAAO;IACnC,EAAE,EAAE,MAAM,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AAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,EACzC,EAAE,EAAE,MAAM,GAAG;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE;IAmD3C;;;;;;;;;OASG;IACH,QAAQ,IAAI,MAAM;CAGnB;AAGD,eAAe,YAAY,CAAC"}
@@ -2,8 +2,14 @@
2
2
  * @fileoverview Provides the Money class for handling monetary values.
3
3
  * This class ensures proper structure and validation of monetary values with an amount and a currency.
4
4
  */
5
- import { SdkType } from "../types/sdk-types";
5
+ import { SdkType } from "../types";
6
6
  declare const MONEY_SDK_TYPE = "Money";
7
+ /**
8
+ * Error thrown when invalid Money values are provided.
9
+ */
10
+ export declare class InvalidMoneyError extends Error {
11
+ constructor(message: string);
12
+ }
7
13
  /**
8
14
  * Class representing a monetary value.
9
15
  *
@@ -18,7 +24,8 @@ declare class Money implements SdkType {
18
24
  * Creates an instance of the Money class.
19
25
  *
20
26
  * @param {number} amount - The monetary amount, represented in the smallest unit of the currency (e.g., cents for USD).
21
- * @param {string} currency - The currency code, represented as a three-character string (e.g., "USD").
27
+ * @param {string} currency - The currency code, represented as a three-character uppercase string (e.g., "USD").
28
+ * @throws {InvalidMoneyError} If the amount is not an integer or currency is not a valid ISO 4217 code.
22
29
  * @example
23
30
  * const money = new Money(1000, 'USD');
24
31
  * console.log(money); // Outputs: Money { amount: 1000, currency: 'USD' }
@@ -1 +1 @@
1
- {"version":3,"file":"Money.d.ts","sourceRoot":"","sources":["../../../src/sdkTypes/Money.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C,QAAA,MAAM,cAAc,UAAU,CAAC;AAE/B;;;;;GAKG;AACH,cAAM,KAAM,YAAW,OAAO;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,QAAQ,EAAE,OAAO,cAAc,CAAC;IAEzC;;;;;;;;OAQG;gBACS,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;CAwB7C;AAGD,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"Money.d.ts","sourceRoot":"","sources":["../../../src/sdkTypes/Money.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAC,OAAO,EAAC,MAAM,UAAU,CAAC;AAGjC,QAAA,MAAM,cAAc,UAAU,CAAC;AAK/B;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,KAAK;gBAC9B,OAAO,EAAE,MAAM;CAI5B;AAED;;;;;GAKG;AACH,cAAM,KAAM,YAAW,OAAO;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,QAAQ,EAAE,OAAO,cAAc,CAAC;IAEzC;;;;;;;;;OASG;gBACS,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;CAgB7C;AAGD,eAAe,KAAK,CAAC"}
@@ -2,8 +2,14 @@
2
2
  * @fileoverview Provides the UUID class for handling universally unique identifiers (UUIDs).
3
3
  * This class allows for the creation and validation of UUIDs, using the `uuid` library.
4
4
  */
5
- import { SdkType } from "../types/sdk-types";
5
+ import { SdkType } from "../types";
6
6
  declare const UUID_SDK_TYPE = "UUID";
7
+ /**
8
+ * Error thrown when an invalid UUID is provided.
9
+ */
10
+ export declare class InvalidUUIDError extends Error {
11
+ constructor(value: unknown);
12
+ }
7
13
  /**
8
14
  * Class representing a UUID (Universally Unique Identifier).
9
15
  *
@@ -16,6 +22,7 @@ declare class UUID implements SdkType {
16
22
  * Creates an instance of the UUID class.
17
23
  *
18
24
  * @param {string} [uuid] - An optional UUID string. If not provided, a new UUID will be generated.
25
+ * @throws {InvalidUUIDError} If the provided value is not a valid UUID string.
19
26
  * @example
20
27
  * const id = new UUID();
21
28
  * console.log(id.toString()); // Outputs a newly generated UUID.
@@ -1 +1 @@
1
- {"version":3,"file":"UUID.d.ts","sourceRoot":"","sources":["../../../src/sdkTypes/UUID.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAG7C,QAAA,MAAM,aAAa,SAAS,CAAC;AAE7B;;;;GAIG;AACH,cAAM,IAAK,YAAW,OAAO;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,QAAQ,EAAE,OAAO,aAAa,CAAC;IAExC;;;;;;;;;;OAUG;gBACS,IAAI,CAAC,EAAE,MAAM;IAazB;;;;;;;OAOG;IACH,QAAQ,IAAI,MAAM;CAGnB;AAGD,eAAe,IAAI,CAAC;AAGpB,MAAM,MAAM,YAAY,GAAG,YAAY,CAAC,OAAO,IAAI,CAAC,CAAC"}
1
+ {"version":3,"file":"UUID.d.ts","sourceRoot":"","sources":["../../../src/sdkTypes/UUID.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAC,OAAO,EAAC,MAAM,UAAU,CAAC;AAGjC,QAAA,MAAM,aAAa,SAAS,CAAC;AAE7B;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,KAAK;gBAC7B,KAAK,EAAE,OAAO;CAI3B;AAED;;;;GAIG;AACH,cAAM,IAAK,YAAW,OAAO;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,QAAQ,EAAE,OAAO,aAAa,CAAC;IAExC;;;;;;;;;;;OAWG;gBACS,IAAI,CAAC,EAAE,MAAM;IAezB;;;;;;;OAOG;IACH,QAAQ,IAAI,MAAM;CAGnB;AAGD,eAAe,IAAI,CAAC;AAGpB,MAAM,MAAM,YAAY,GAAG,YAAY,CAAC,OAAO,IAAI,CAAC,CAAC"}
@@ -0,0 +1,227 @@
1
+ import UUIDClass from "../sdkTypes/UUID";
2
+ import { User } from "./marketplace/user";
3
+ import { Booking } from "./marketplace/bookings";
4
+ import { Stock } from "./marketplace/stock";
5
+ import { StripePaymentMethod } from "./marketplace/stripePaymentMethod";
6
+ import { Image } from "./marketplace/images";
7
+ import { Listing } from "./marketplace/listings";
8
+ import { Marketplace } from "./marketplace/marketplace";
9
+ import { Message } from "./marketplace/messages";
10
+ import { OwnListing } from "./marketplace/ownListings";
11
+ import { Review } from "./marketplace/reviews";
12
+ import { StockReservation } from "./marketplace/stockReservations";
13
+ import { StripeAccount } from "./marketplace/stripeAccount";
14
+ import { StripeCustomer } from "./marketplace/stripeCustomer";
15
+ import { Transaction } from "./marketplace/transactions";
16
+ import { CurrentUserPermissionSet } from "./marketplace/currentUser";
17
+ import { StockAdjustment } from "./marketplace/stockAdjustment";
18
+ import { ImageAsset } from "./assets";
19
+ /**
20
+ * A mapping of relationship types to their corresponding entities.
21
+ * The `I` flag controls whether private/protected user data is included.
22
+ */
23
+ export type RelationshipTypeMap<I extends boolean = false> = {
24
+ "author.effectivePermissionSet": CurrentUserPermissionSet;
25
+ "author.marketplace": Marketplace;
26
+ "author.profileImage": Image;
27
+ "author.stripeAccount": StripeAccount;
28
+ "booking.transaction": Transaction;
29
+ "customer.effectivePermissionSet": CurrentUserPermissionSet;
30
+ "customer.marketplace": Marketplace;
31
+ "customer.profileImage": Image;
32
+ "customer.stripeAccount": StripeAccount;
33
+ "effectivePermissionSet": CurrentUserPermissionSet;
34
+ "listing.author": User<I>;
35
+ "listing.currentStock": Stock;
36
+ "listing.images": Image;
37
+ "listing.marketplace": Marketplace;
38
+ "messages.sender": User<I>;
39
+ "messages.transaction": Transaction;
40
+ "ownListing.author": User<I>;
41
+ "ownListing.currentStock": Stock;
42
+ "ownListing.images": Image;
43
+ "ownListing.marketplace": Marketplace;
44
+ "provider.effectivePermissionSet": CurrentUserPermissionSet;
45
+ "provider.marketplace": Marketplace;
46
+ "provider.profileImage": Image;
47
+ "provider.stripeAccount": StripeAccount;
48
+ "reviews.author": User<I>;
49
+ "reviews.author.profileImage": Image;
50
+ "reviews.listing": Listing<I>;
51
+ "reviews.subject": User<I>;
52
+ "sender.effectivePermissionSet": CurrentUserPermissionSet;
53
+ "sender.marketplace": Marketplace;
54
+ "sender.profileImage": Image;
55
+ "sender.stripeAccount": StripeAccount;
56
+ "stockReservation.transaction": Transaction;
57
+ "stripeCustomer.defaultPaymentMethod": StripePaymentMethod;
58
+ "subject.effectivePermissionSet": CurrentUserPermissionSet;
59
+ "subject.marketplace": Marketplace;
60
+ "subject.profileImage": Image;
61
+ "subject.stripeAccount": StripeAccount;
62
+ "transaction.booking": Booking;
63
+ "transaction.customer": User<I>;
64
+ "transaction.listing": Listing<I>;
65
+ "transaction.marketplace": Marketplace;
66
+ "transaction.messages": Message;
67
+ "transaction.provider": User<I>;
68
+ "transaction.reviews": Review;
69
+ "transaction.stockReservation": StockReservation;
70
+ author: User<I>;
71
+ booking: Booking;
72
+ currentStock: Stock;
73
+ customer: User<I>;
74
+ defaultPaymentMethod: StripePaymentMethod;
75
+ imageAsset: ImageAsset;
76
+ images: Image;
77
+ listing: Listing<I>;
78
+ marketplace: Marketplace;
79
+ messages: Message;
80
+ ownListing: OwnListing;
81
+ profileImage: Image;
82
+ provider: User<I>;
83
+ reviews: Review;
84
+ sender: User<I>;
85
+ stockAdjustment: StockAdjustment;
86
+ stockReservation: StockReservation;
87
+ stripeAccount: StripeAccount;
88
+ stripeCustomer: StripeCustomer;
89
+ subject: User<I>;
90
+ transaction: Transaction;
91
+ };
92
+ /**
93
+ * HTTP status codes that can return API errors
94
+ */
95
+ export declare const ApiErrorStatuses: {
96
+ readonly BadRequest: 400;
97
+ readonly Unauthorized: 401;
98
+ readonly PaymentRequired: 402;
99
+ readonly Forbidden: 403;
100
+ readonly NotFound: 404;
101
+ readonly Conflict: 409;
102
+ readonly PayloadTooLarge: 413;
103
+ readonly TooManyRequests: 429;
104
+ readonly ServerError: 500;
105
+ };
106
+ export type ApiErrorStatus = typeof ApiErrorStatuses[keyof typeof ApiErrorStatuses];
107
+ /**
108
+ * Strongly typed error codes per status
109
+ */
110
+ export type ApiErrorCode = "unsupported-content-type" | "bad-request" | "validation-disallowed-key" | "validation-invalid-value" | "validation-invalid-params" | "validation-missing-key" | "auth-invalid-access-token" | "auth-missing-access-token" | "transaction-payment-failed" | "forbidden" | "not-found" | "conflict" | "image-invalid" | "image-invalid-content" | "email-taken" | "email-already-verified" | "email-unverified" | "email-not-found" | "listing-not-found" | "listing-invalid-state" | "stripe-account-not-found" | "stripe-missing-api-key" | "stripe-invalid-payment-intent-status" | "stripe-customer-not-found" | "stripe-multiple-payment-methods-not-supported" | "stripe-payment-method-type-not-supported" | "user-missing-stripe-account" | "user-is-banned" | "user-not-found" | "transaction-locked" | "transaction-not-found" | "transaction-listing-not-found" | "transaction-booking-state-not-pending" | "transaction-booking-state-not-accepted" | "transaction-invalid-transition" | "transaction-invalid-action-sequence" | "transaction-missing-listing-price" | "transaction-missing-stripe-account" | "transaction-same-author-and-customer" | "transaction-stripe-account-disabled-charges" | "transaction-stripe-account-disabled-payouts" | "transaction-charge-zero-payin" | "transaction-charge-zero-payout" | "transaction-zero-payin" | "transaction-unknown-alias" | "transaction-provider-banned-or-deleted" | "transaction-customer-banned-or-deleted" | "request-larger-than-content-length" | "request-upload-over-limit" | "too-many-requests";
111
+ /**
112
+ * Single API error object
113
+ */
114
+ export interface ApiError {
115
+ id: string;
116
+ status: ApiErrorStatus;
117
+ code: ApiErrorCode;
118
+ title: string;
119
+ detail?: string;
120
+ source?: {
121
+ pointer?: string;
122
+ parameter?: string;
123
+ };
124
+ meta?: Record<string, unknown>;
125
+ }
126
+ /**
127
+ * Full error response from Sharetribe API
128
+ */
129
+ export interface ApiErrorResponse {
130
+ errors: ApiError[];
131
+ }
132
+ /**
133
+ *
134
+ */
135
+ export interface SharetribeApiError {
136
+ name: string;
137
+ message: string;
138
+ status?: number;
139
+ statusText?: string;
140
+ data: any;
141
+ }
142
+ /**
143
+ * UUID wrapper instance
144
+ */
145
+ export type UUID = InstanceType<typeof UUIDClass>;
146
+ /**
147
+ * Pagination metadata
148
+ */
149
+ export interface ApiMeta {
150
+ totalItems: number;
151
+ totalPages: number;
152
+ page: number;
153
+ perPage: number;
154
+ paginationLimit?: number;
155
+ }
156
+ /**
157
+ * Relationship object in API responses
158
+ */
159
+ export type Relationship<IsArray extends boolean = false, Type extends keyof RelationshipTypeMap = keyof RelationshipTypeMap> = IsArray extends true ? {
160
+ data: {
161
+ id: UUID;
162
+ type: Type;
163
+ }[];
164
+ } : {
165
+ data: {
166
+ id: UUID;
167
+ type: Type;
168
+ } | null;
169
+ };
170
+ /**
171
+ * Query parameter prefixes
172
+ */
173
+ export type QueryFields = `fields.${string}`;
174
+ export type QueryLimit = `limit.${string}`;
175
+ export type QueryImageVariant = `imageVariant.${string}`;
176
+ /**
177
+ * Public, metadata, private, protected data query keys
178
+ */
179
+ export type QueryPub = `pub_${string}`;
180
+ export type QueryMeta = `meta_${string}`;
181
+ export type QueryPriv = `priv_${string}`;
182
+ export type QueryProt = `prot_${string}`;
183
+ /**
184
+ * Optional expand control
185
+ */
186
+ export interface ExpandParam {
187
+ expand?: boolean;
188
+ }
189
+ export type ExtraParameter = ExpandParam | undefined;
190
+ export type ExtraParameterType = ExtraParameter;
191
+ /**
192
+ * Base API parameter interface (index signatures are now safe)
193
+ */
194
+ export interface ApiParameter {
195
+ /** Select fields: fields.listings=title,description */
196
+ [K: QueryFields]: string | undefined;
197
+ /** Pagination limits per resource type */
198
+ [K: QueryLimit]: number | undefined;
199
+ /** Image variants */
200
+ [K: QueryImageVariant]: string | undefined;
201
+ /** Public custom fields */
202
+ [K: QueryPub]: string | undefined;
203
+ /** Metadata fields */
204
+ [K: QueryMeta]: string | undefined;
205
+ /** Private fields (admin only) */
206
+ [K: QueryPriv]: string | undefined;
207
+ /** Protected fields (trusted user) */
208
+ [K: QueryProt]: string | undefined;
209
+ }
210
+ /**
211
+ * Geographic types
212
+ */
213
+ export interface LatLng {
214
+ lat: number;
215
+ lng: number;
216
+ }
217
+ export interface LatLngBounds {
218
+ ne: LatLng;
219
+ sw: LatLng;
220
+ }
221
+ /**
222
+ * Money amount with currency
223
+ */
224
+ export interface Money {
225
+ amount: number;
226
+ currency: string;
227
+ }
@@ -0,0 +1,22 @@
1
+ import { AuthToken } from "./authentication";
2
+ /**
3
+ * Interface for managing authentication tokens in a store.
4
+ */
5
+ export interface TokenStore {
6
+ token?: AuthToken | null;
7
+ expiration?: number;
8
+ /**
9
+ * Retrieves the current authentication token.
10
+ * @returns A promise resolving to the current token or null if no token exists.
11
+ */
12
+ getToken: (() => AuthToken | null) | (() => Promise<AuthToken | null>);
13
+ /**
14
+ * Sets a new authentication token.
15
+ * @param args - Object containing the token's details.
16
+ */
17
+ setToken: ((args: AuthToken) => void) | ((args: AuthToken) => Promise<void>);
18
+ /**
19
+ * Removes the current authentication token.
20
+ */
21
+ removeToken: (() => void) | (() => Promise<void>);
22
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"apiConfigs.d.ts","sourceRoot":"","sources":["../../../src/types/apiConfigs.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC;;;;;GAKG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,OAAO,GAAG,KAAK,IAAI,CAAC,SAAS,KAAK,GAC/D;IACE;;OAEG;IACH,GAAG,EAAE,CAAC,MAAM,EAAE,SAAS,KAAK;QAC1B,OAAO,EAAE;YACP;;eAEG;YACH,mBAAmB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;YACvC;;eAEG;YACH,MAAM,EAAE,0BAA0B,CAAC;SACpC,CAAC;QACF;;WAEG;QACH,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IAEF;;OAEG;IACH,IAAI,EAAE,CAAC,MAAM,EAAE,SAAS,KAAK;QAC3B,OAAO,EAAE;YACP;;eAEG;YACH,cAAc,EAAE,mCAAmC,CAAC;YACpD;;eAEG;YACH,MAAM,EAAE,kBAAkB,CAAC;SAC5B,CAAC;QACF;;WAEG;QACH,OAAO,EAAE,MAAM,CA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