@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,202 @@
1
+ /**
2
+ * @fileoverview Type definitions for Current User in the Sharetribe Marketplace API.
3
+ */
4
+ import { ApiParameter, ExtraParameterType, Relationship, RelationshipTypeMap, UUID } from "../sharetribe";
5
+ import { Permissions } from "./user";
6
+ /**
7
+ * Available endpoints
8
+ */
9
+ export type CurrentUserEndpoints = "show" | "delete" | "create" | "create_with_idp" | "update_profile" | "change_password" | "change_email" | "verify_email" | "send_verification_email";
10
+ /**
11
+ * Relationship fields
12
+ */
13
+ export type CurrentUserRelationshipsFields = "marketplace" | "profileImage" | "stripeAccount" | "stripeCustomer" | "stripeCustomer.defaultPaymentMethod" | "effectivePermissionSet";
14
+ /**
15
+ * Current User resource
16
+ */
17
+ export interface CurrentUser {
18
+ id: UUID;
19
+ type: "currentUser";
20
+ attributes: {
21
+ banned: boolean;
22
+ deleted: boolean;
23
+ createdAt: string;
24
+ email: string;
25
+ emailVerified: boolean;
26
+ pendingEmail: string | null;
27
+ stripeConnected: boolean;
28
+ stripePayoutsEnabled: boolean;
29
+ stripeChargesEnabled: boolean;
30
+ identityProviders: {
31
+ idpId: string;
32
+ userId: string;
33
+ }[];
34
+ profile: {
35
+ firstName: string;
36
+ lastName: string;
37
+ displayName: string;
38
+ abbreviatedName: string;
39
+ bio: string | null;
40
+ publicData: CurrentUserPublicData & CurrentUserCustomPublicData;
41
+ protectedData: CurrentUserProtectedData & CurrentUserCustomProtectedData;
42
+ privateData: CurrentUserPrivateData & CurrentUserCustomPrivateData;
43
+ metadata: CurrentUserMetadata & CurrentUserCustomMetadata;
44
+ };
45
+ };
46
+ }
47
+ /**
48
+ * Deleted user representation
49
+ */
50
+ export type DeletedCurrentUser = {
51
+ id: UUID;
52
+ type: "currentUser";
53
+ attributes: {
54
+ banned: false;
55
+ deleted: true;
56
+ createdAt: null;
57
+ email: null;
58
+ emailVerified: false;
59
+ pendingEmail: null;
60
+ stripeConnected: false;
61
+ stripePayoutsEnabled: false;
62
+ stripeChargesEnabled: false;
63
+ identityProviders: null;
64
+ profile: {
65
+ firstName: null;
66
+ lastName: null;
67
+ displayName: null;
68
+ abbreviatedName: null;
69
+ bio: null;
70
+ publicData: null;
71
+ protectedData: null;
72
+ privateData: null;
73
+ metadata: null;
74
+ };
75
+ };
76
+ };
77
+ /**
78
+ * Current User permission set
79
+ */
80
+ export type CurrentUserPermissionSet = {
81
+ postListings: Permissions;
82
+ initiateTransactions: Permissions;
83
+ read: Permissions;
84
+ };
85
+ /**
86
+ * With relationships
87
+ */
88
+ export interface CurrentUserWithRelationships extends CurrentUser {
89
+ relationships: {
90
+ marketplace: Relationship<false, "marketplace">;
91
+ profileImage?: Relationship<false, "profileImage">;
92
+ stripeAccount?: Relationship<false, "stripeAccount">;
93
+ stripeCustomer?: Relationship<false, "stripeCustomer">;
94
+ effectivePermissionSet: Relationship<false, "effectivePermissionSet">;
95
+ };
96
+ }
97
+ export type CurrentUserResource<R extends boolean> = R extends true ? CurrentUserWithRelationships : CurrentUser;
98
+ /**
99
+ * Base request parameters
100
+ */
101
+ export interface CurrentUserParameter extends ApiParameter {
102
+ include?: CurrentUserRelationshipsFields[];
103
+ }
104
+ /**
105
+ * Endpoint parameters
106
+ */
107
+ export type CurrentUserShowParameter = CurrentUserParameter;
108
+ export type CurrentUserDeleteParameter = void;
109
+ export type CurrentUserSendVerificationEmailParameter = void;
110
+ export interface CurrentUserCreateParameter extends CurrentUserParameter {
111
+ email: string;
112
+ password: string;
113
+ firstName: string;
114
+ lastName: string;
115
+ displayName?: string;
116
+ bio?: string;
117
+ publicData?: CurrentUserPublicData & CurrentUserCustomPublicData;
118
+ protectedData?: CurrentUserProtectedData & CurrentUserCustomProtectedData;
119
+ privateData?: CurrentUserPrivateData & CurrentUserCustomPrivateData;
120
+ }
121
+ export interface CurrentUserCreateWithIdpParameter extends CurrentUserCreateParameter {
122
+ idpId: string;
123
+ idpClientId: string;
124
+ idpToken: string;
125
+ }
126
+ export interface CurrentUserUpdateProfileParameter extends CurrentUserParameter {
127
+ firstName?: string;
128
+ lastName?: string;
129
+ displayName?: string;
130
+ bio?: string | null;
131
+ publicData?: CurrentUserPublicData & CurrentUserCustomPublicData;
132
+ protectedData?: CurrentUserProtectedData & CurrentUserCustomProtectedData;
133
+ privateData?: CurrentUserPrivateData & CurrentUserCustomPrivateData;
134
+ profileImageId?: UUID | string;
135
+ }
136
+ export interface CurrentUserChangePasswordParameter {
137
+ currentPassword: string;
138
+ newPassword: string;
139
+ }
140
+ export interface CurrentUserChangeEmailParameter {
141
+ currentPassword: string;
142
+ email: string;
143
+ }
144
+ export interface CurrentUserVerifyEmailParameter {
145
+ verificationToken: string;
146
+ }
147
+ /**
148
+ * Custom profile data
149
+ */
150
+ export interface CurrentUserPublicData {
151
+ [key: string]: any;
152
+ }
153
+ export interface CurrentUserCustomPublicData extends Record<string, unknown> {
154
+ }
155
+ export interface CurrentUserProtectedData {
156
+ [key: string]: any;
157
+ }
158
+ export interface CurrentUserCustomProtectedData extends Record<string, unknown> {
159
+ }
160
+ export interface CurrentUserPrivateData {
161
+ [key: string]: any;
162
+ }
163
+ export interface CurrentUserCustomPrivateData extends Record<string, unknown> {
164
+ }
165
+ export interface CurrentUserMetadata {
166
+ [key: string]: any;
167
+ }
168
+ export interface CurrentUserCustomMetadata extends Record<string, unknown> {
169
+ }
170
+ /**
171
+ * All parameter types
172
+ */
173
+ type AllCurrentUserParameter = CurrentUserShowParameter | CurrentUserDeleteParameter | CurrentUserCreateParameter | CurrentUserCreateWithIdpParameter | CurrentUserUpdateProfileParameter | CurrentUserChangePasswordParameter | CurrentUserChangeEmailParameter | CurrentUserVerifyEmailParameter | CurrentUserSendVerificationEmailParameter;
174
+ /**
175
+ * Include detection — fixes TS2536
176
+ */
177
+ type HasInclude<P> = P extends {
178
+ include: infer I extends readonly CurrentUserRelationshipsFields[];
179
+ } ? I : never;
180
+ type IncludesRelationships<P> = HasInclude<P> extends never ? false : true;
181
+ type IncludedResources<P> = HasInclude<P> extends infer Fields extends CurrentUserRelationshipsFields[] ? RelationshipTypeMap[Fields[number]][] : never;
182
+ /**
183
+ * Expand behavior
184
+ */
185
+ type ExpandResult<T, EP extends ExtraParameterType | undefined> = EP extends {
186
+ expand: true;
187
+ } ? T : EP extends {
188
+ expand: false;
189
+ } ? Omit<T, "attributes"> : Omit<T, "attributes">;
190
+ /**
191
+ * Response data per endpoint
192
+ */
193
+ type ResponseData<E extends CurrentUserEndpoints, P extends AllCurrentUserParameter, EP extends ExtraParameterType | undefined> = E extends "show" ? CurrentUserResource<IncludesRelationships<P>> : E extends "delete" ? Pick<DeletedCurrentUser, "id" | "type"> : E extends "create" | "create_with_idp" | "update_profile" | "change_password" | "change_email" | "verify_email" | "send_verification_email" ? ExpandResult<CurrentUserResource<IncludesRelationships<P>>, EP> : never;
194
+ /**
195
+ * Final response type
196
+ */
197
+ export type CurrentUserResponse<E extends CurrentUserEndpoints, P extends AllCurrentUserParameter, EP extends ExtraParameterType | undefined = undefined> = {
198
+ data: ResponseData<E, P, EP>;
199
+ } & (IncludesRelationships<P> extends true ? {
200
+ included: IncludedResources<P>;
201
+ } : {});
202
+ export {};
@@ -0,0 +1,65 @@
1
+ /**
2
+ * @fileoverview Type definitions for Images in the Sharetribe Marketplace API.
3
+ */
4
+ import { ApiParameter, ExtraParameterType, UUID } from "../sharetribe";
5
+ /**
6
+ * Available endpoints
7
+ */
8
+ export type ImagesEndpoints = "upload";
9
+ /**
10
+ * Standard image variant names
11
+ */
12
+ export type ImageVariantName = "default" | "landscape-crop" | "landscape-crop2x" | "landscape-crop4x" | "landscape-crop6x" | "scaled-small" | "scaled-medium" | "scaled-large" | "scaled-xlarge" | "square-small" | "square-small2x" | "facebook" | "twitter";
13
+ /**
14
+ * Image variant object
15
+ */
16
+ export interface ImageVariant {
17
+ width: number;
18
+ height: number;
19
+ url: string;
20
+ name: ImageVariantName;
21
+ }
22
+ /**
23
+ * Image resource
24
+ */
25
+ export interface Image {
26
+ id: UUID;
27
+ type: "image";
28
+ attributes: {
29
+ variants: {
30
+ [K in ImageVariantName]?: ImageVariant;
31
+ } & {
32
+ [key: string]: ImageVariant | undefined;
33
+ };
34
+ };
35
+ }
36
+ /**
37
+ * Base request parameters
38
+ */
39
+ export interface ImagesParameter extends ApiParameter {
40
+ }
41
+ /**
42
+ * Upload endpoint parameters
43
+ */
44
+ export interface ImagesUploadParameter extends ImagesParameter {
45
+ image: File;
46
+ }
47
+ /**
48
+ * Expand behavior
49
+ */
50
+ type ExpandResult<EP extends ExtraParameterType | undefined> = EP extends {
51
+ expand: true;
52
+ } ? Image : EP extends {
53
+ expand: false;
54
+ } ? Omit<Image, "attributes"> : Omit<Image, "attributes">;
55
+ /**
56
+ * Response data per endpoint
57
+ */
58
+ type ResponseData<E extends ImagesEndpoints, EP extends ExtraParameterType | undefined> = E extends "upload" ? ExpandResult<EP> : never;
59
+ /**
60
+ * Final response type
61
+ */
62
+ export type ImagesResponse<E extends ImagesEndpoints = "upload", EP extends ExtraParameterType | undefined = undefined> = {
63
+ data: ResponseData<E, EP>;
64
+ };
65
+ export {};
@@ -0,0 +1,169 @@
1
+ /**
2
+ * @fileoverview Type definitions for Listings in the Sharetribe Marketplace API.
3
+ */
4
+ import { ApiMeta, ApiParameter, ExtraParameterType, LatLng, LatLngBounds, Money, QueryMeta, QueryPub, Relationship, RelationshipTypeMap, UUID } from "../sharetribe";
5
+ import { AvailabilityPlan } from "./availabilityPlan";
6
+ /**
7
+ * Public listing states
8
+ */
9
+ export type ListingState = "published" | "closed" | "draft" | "pendingApproval";
10
+ /**
11
+ * Availability mode returned in query results
12
+ */
13
+ export type ListingAvailability = "day-full" | "day-partial" | "time-full" | "time-partial";
14
+ /**
15
+ * Listing resource
16
+ */
17
+ export interface Listing<I extends boolean = false> {
18
+ id: UUID;
19
+ type: "listing";
20
+ attributes: {
21
+ title: string;
22
+ description: string;
23
+ price: Money;
24
+ geolocation: LatLng;
25
+ state: ListingState;
26
+ deleted: boolean;
27
+ createdAt: Date;
28
+ availabilityPlan: AvailabilityPlan | null;
29
+ publicData: ListingPublicData & ListingCustomPublicData;
30
+ metadata: ListingMetadata & ListingCustomMetadata;
31
+ } & (I extends true ? {
32
+ privateData: ListingPrivateData & ListingCustomPrivateData;
33
+ } : {});
34
+ }
35
+ /**
36
+ * With relationships
37
+ */
38
+ export interface ListingWithRelationships<I extends boolean = false> extends Listing<I> {
39
+ relationships: {
40
+ marketplace: Relationship<false, "marketplace">;
41
+ author: Relationship<false, "author">;
42
+ images: Relationship<true, "images">;
43
+ currentStock?: Relationship<false, "currentStock">;
44
+ };
45
+ }
46
+ export type ListingResource<R extends boolean, I extends boolean = false> = R extends true ? ListingWithRelationships<I> : Listing<I>;
47
+ /**
48
+ * Relationship fields
49
+ */
50
+ export type ListingsRelationshipsFields = "marketplace" | "author" | "author.profileImage" | "author.marketplace" | "author.stripeAccount" | "author.effectivePermissionSet" | "images" | "currentStock";
51
+ /**
52
+ * Available endpoints
53
+ */
54
+ export type ListingsEndpoints = "show" | "query" | "create" | "update" | "close" | "open" | "approve";
55
+ /**
56
+ * Base request parameters
57
+ */
58
+ export interface ListingsParameter extends ApiParameter {
59
+ include?: ListingsRelationshipsFields[];
60
+ }
61
+ /**
62
+ * Endpoint parameters
63
+ */
64
+ export type ListingsShowParameter = ListingsParameter & {
65
+ id: UUID | string;
66
+ };
67
+ export interface ListingsQueryParameter extends ListingsParameter {
68
+ authorId?: UUID | string;
69
+ ids?: UUID[] | string[];
70
+ keywords?: string;
71
+ origin?: LatLng | string;
72
+ bounds?: LatLngBounds | string;
73
+ price?: Money | [Money, Money] | string;
74
+ start?: Date | string;
75
+ end?: Date | string;
76
+ seats?: number;
77
+ availability?: ListingAvailability;
78
+ minDuration?: number;
79
+ minStock?: number;
80
+ sort?: string;
81
+ [keyof: QueryPub]: string | undefined;
82
+ [keyof: QueryMeta]: string | undefined;
83
+ }
84
+ export interface ListingsCreateParameter extends ListingsParameter {
85
+ title: string;
86
+ authorId: UUID | string;
87
+ state: ListingState;
88
+ description?: string;
89
+ geolocation?: LatLng | string;
90
+ price?: Money | string;
91
+ availabilityPlan?: AvailabilityPlan | null;
92
+ publicData?: ListingPublicData & ListingCustomPublicData;
93
+ privateData?: ListingPrivateData & ListingCustomPrivateData;
94
+ metadata?: ListingMetadata & ListingCustomMetadata;
95
+ images?: UUID[] | string[];
96
+ }
97
+ export type ListingsUpdateParameter = ListingsParameter & {
98
+ id: UUID | string;
99
+ title?: string;
100
+ description?: string;
101
+ price?: Money | string;
102
+ availabilityPlan?: AvailabilityPlan | null;
103
+ publicData?: ListingPublicData & ListingCustomPublicData;
104
+ privateData?: ListingPrivateData & ListingCustomPrivateData;
105
+ metadata?: ListingMetadata & ListingCustomMetadata;
106
+ images?: UUID[] | string[];
107
+ };
108
+ export type ListingsCloseParameter = ListingsParameter & {
109
+ id: UUID | string;
110
+ };
111
+ export type ListingsOpenParameter = ListingsParameter & {
112
+ id: UUID | string;
113
+ };
114
+ export type ListingsApproveParameter = ListingsParameter & {
115
+ id: UUID | string;
116
+ };
117
+ /**
118
+ * Custom data
119
+ */
120
+ export interface ListingPublicData {
121
+ [key: string]: any;
122
+ }
123
+ export interface ListingCustomPublicData extends Record<string, unknown> {
124
+ }
125
+ export interface ListingPrivateData {
126
+ [key: string]: any;
127
+ }
128
+ export interface ListingCustomPrivateData extends Record<string, unknown> {
129
+ }
130
+ export interface ListingMetadata {
131
+ [key: string]: any;
132
+ }
133
+ export interface ListingCustomMetadata extends Record<string, unknown> {
134
+ }
135
+ /**
136
+ * All parameter types
137
+ */
138
+ type AllListingsParameter = ListingsShowParameter | ListingsQueryParameter | ListingsCreateParameter | ListingsUpdateParameter | ListingsCloseParameter | ListingsOpenParameter | ListingsApproveParameter;
139
+ /**
140
+ * Include detection — fixes TS2536
141
+ */
142
+ type HasInclude<P> = P extends {
143
+ include: infer I extends readonly ListingsRelationshipsFields[];
144
+ } ? I : never;
145
+ type IncludesRelationships<P> = HasInclude<P> extends never ? false : true;
146
+ type IncludedResources<P> = HasInclude<P> extends infer Fields extends ListingsRelationshipsFields[] ? RelationshipTypeMap[Fields[number]][] : never;
147
+ /**
148
+ * Expand behavior
149
+ */
150
+ type ExpandResult<T, EP extends ExtraParameterType | undefined> = EP extends {
151
+ expand: true;
152
+ } ? T : EP extends {
153
+ expand: false;
154
+ } ? Omit<T, "attributes"> : Omit<T, "attributes">;
155
+ /**
156
+ * Response data per endpoint
157
+ */
158
+ type ResponseData<E extends ListingsEndpoints, P extends AllListingsParameter, EP extends ExtraParameterType | undefined, I extends boolean = false> = E extends "query" ? ListingResource<IncludesRelationships<P>, I>[] : E extends "show" | "create" | "update" | "close" | "open" | "approve" ? ExpandResult<ListingResource<IncludesRelationships<P>, I>, EP> : never;
159
+ /**
160
+ * Final response
161
+ */
162
+ export type ListingsResponse<E extends ListingsEndpoints, P extends AllListingsParameter, EP extends ExtraParameterType | undefined = undefined, I extends boolean = false> = {
163
+ data: ResponseData<E, P, EP, I>;
164
+ } & (IncludesRelationships<P> extends true ? {
165
+ included: IncludedResources<P>;
166
+ } : {}) & (E extends "query" ? {
167
+ meta: ApiMeta;
168
+ } : {});
169
+ export {};
@@ -0,0 +1,30 @@
1
+ /**
2
+ * @fileoverview Type definitions for Marketplace in the Sharetribe Marketplace API.
3
+ */
4
+ import { UUID } from "../sharetribe";
5
+ /**
6
+ * Available endpoints
7
+ */
8
+ export type MarketplaceEndpoints = "show";
9
+ /**
10
+ * Marketplace resource
11
+ */
12
+ export interface Marketplace {
13
+ id: UUID;
14
+ type: "marketplace";
15
+ attributes: {
16
+ name: string;
17
+ description: string;
18
+ };
19
+ }
20
+ /**
21
+ * Response data per endpoint
22
+ */
23
+ type ResponseData<E extends MarketplaceEndpoints> = E extends "show" ? Marketplace : never;
24
+ /**
25
+ * Final response type
26
+ */
27
+ export type MarketplaceResponse<E extends MarketplaceEndpoints = "show"> = {
28
+ data: ResponseData<E>;
29
+ };
30
+ export {};
@@ -0,0 +1,87 @@
1
+ /**
2
+ * @fileoverview Type definitions for Messages in the Sharetribe Marketplace API.
3
+ */
4
+ import { ApiMeta, ApiParameter, ExtraParameterType, Relationship, RelationshipTypeMap, UUID } from "../sharetribe";
5
+ /**
6
+ * Available endpoints
7
+ */
8
+ export type MessagesEndpoints = "query" | "send";
9
+ /**
10
+ * Relationship fields that can be included
11
+ */
12
+ export type MessagesRelationshipsFields = "sender" | "sender.profileImage" | "sender.marketplace" | "transaction" | "transaction.marketplace" | "transaction.listing" | "transaction.provider" | "transaction.customer" | "transaction.booking" | "transaction.stockReservation" | "transaction.reviews" | "transaction.messages";
13
+ /**
14
+ * Message resource
15
+ */
16
+ export interface Message {
17
+ id: UUID;
18
+ type: "message";
19
+ attributes: {
20
+ content: string;
21
+ createdAt: Date;
22
+ };
23
+ }
24
+ /**
25
+ * With relationships
26
+ */
27
+ export interface MessageWithRelationships extends Message {
28
+ relationships: {
29
+ sender: Relationship<false, "sender">;
30
+ transaction: Relationship<false, "transaction">;
31
+ };
32
+ }
33
+ export type MessageResource<R extends boolean> = R extends true ? MessageWithRelationships : Message;
34
+ /**
35
+ * Base request parameters
36
+ */
37
+ export interface MessagesParameter extends ApiParameter {
38
+ include?: MessagesRelationshipsFields[];
39
+ }
40
+ /**
41
+ * Query messages
42
+ */
43
+ export interface MessagesQueryParameter extends MessagesParameter {
44
+ transactionId: UUID | string;
45
+ }
46
+ /**
47
+ * Send a message
48
+ */
49
+ export interface MessagesSendParameter extends MessagesParameter {
50
+ transactionId: UUID | string;
51
+ content: string;
52
+ }
53
+ /**
54
+ * All parameter types
55
+ */
56
+ type AllMessagesParameter = MessagesQueryParameter | MessagesSendParameter;
57
+ /**
58
+ * Include detection — fixes TS2536
59
+ */
60
+ type HasInclude<P> = P extends {
61
+ include: infer I extends readonly MessagesRelationshipsFields[];
62
+ } ? I : never;
63
+ type IncludesRelationships<P> = HasInclude<P> extends never ? false : true;
64
+ type IncludedResources<P> = HasInclude<P> extends infer Fields extends MessagesRelationshipsFields[] ? RelationshipTypeMap[Fields[number]][] : never;
65
+ /**
66
+ * Expand behavior
67
+ */
68
+ type ExpandResult<T, EP extends ExtraParameterType | undefined> = EP extends {
69
+ expand: true;
70
+ } ? T : EP extends {
71
+ expand: false;
72
+ } ? Omit<T, "attributes"> : Omit<T, "attributes">;
73
+ /**
74
+ * Response data per endpoint
75
+ */
76
+ type ResponseData<E extends MessagesEndpoints, P extends AllMessagesParameter, EP extends ExtraParameterType | undefined> = E extends "query" ? MessageResource<IncludesRelationships<P>>[] : E extends "send" ? ExpandResult<MessageResource<IncludesRelationships<P>>, EP> : never;
77
+ /**
78
+ * Final response type
79
+ */
80
+ export type MessagesResponse<E extends MessagesEndpoints, P extends AllMessagesParameter, EP extends ExtraParameterType | undefined = undefined> = {
81
+ data: ResponseData<E, P, EP>;
82
+ } & (IncludesRelationships<P> extends true ? {
83
+ included: IncludedResources<P>;
84
+ } : {}) & (E extends "query" ? {
85
+ meta: ApiMeta;
86
+ } : {});
87
+ export {};