@vansite/ts-sharetribe-flex-sdk 1.0.33 → 2.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 (271) 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/Stock.d.ts +50 -0
  27. package/dist/endpoints/marketplace/StockAdjustments.d.ts +64 -0
  28. package/dist/endpoints/marketplace/StripeAccount.d.ts +56 -0
  29. package/dist/endpoints/marketplace/StripeAccountLinks.d.ts +42 -0
  30. package/dist/endpoints/marketplace/StripeCustomer.d.ts +62 -0
  31. package/dist/endpoints/marketplace/StripePersons.d.ts +37 -0
  32. package/dist/endpoints/marketplace/StripeSetupIntents.d.ts +42 -0
  33. package/dist/endpoints/marketplace/TimeSlots.d.ts +40 -0
  34. package/dist/endpoints/marketplace/Transactions.d.ts +89 -0
  35. package/dist/endpoints/marketplace/Users.d.ts +34 -0
  36. package/dist/endpoints/marketplace/index.d.ts +80 -0
  37. package/dist/index.d.ts +161 -0
  38. package/dist/index.js +3 -0
  39. package/dist/{ts-sharetribe-flex-sdk.cjs.LICENSE.txt → index.js.LICENSE.txt} +53 -41
  40. package/dist/index.js.map +1 -0
  41. package/dist/index.mjs +3 -0
  42. package/dist/{ts-sharetribe-flex-sdk.js.LICENSE.txt → index.mjs.LICENSE.txt} +13 -5
  43. package/dist/index.mjs.map +1 -0
  44. package/dist/index.umd.js +3 -0
  45. package/dist/{ts-sharetribe-flex-sdk.mjs.LICENSE.txt → index.umd.js.LICENSE.txt} +13 -5
  46. package/dist/index.umd.js.map +1 -0
  47. package/dist/integrationSdk.d.ts +119 -0
  48. package/dist/sdk.d.ts +211 -0
  49. package/dist/sdkTypes/BigDecimal.d.ts +30 -0
  50. package/dist/sdkTypes/LatLng.d.ts +34 -0
  51. package/dist/sdkTypes/LatLngBounds.d.ts +51 -0
  52. package/dist/sdkTypes/Money.d.ts +28 -0
  53. package/dist/sdkTypes/UUID.d.ts +38 -0
  54. package/dist/types/apiConfigs.d.ts +104 -0
  55. package/dist/types/assets/index.d.ts +101 -0
  56. package/dist/types/authentication/index.d.ts +152 -0
  57. package/dist/types/axios.d.ts +10 -0
  58. package/dist/types/config.d.ts +99 -0
  59. package/dist/types/endpoints/assets/index.d.ts +22 -36
  60. package/dist/types/endpoints/assets/index.d.ts.map +1 -1
  61. package/dist/types/endpoints/auth/index.d.ts +20 -41
  62. package/dist/types/endpoints/auth/index.d.ts.map +1 -1
  63. package/dist/types/endpoints/integrationApi/AvailabilityExceptions.d.ts +30 -49
  64. package/dist/types/endpoints/integrationApi/AvailabilityExceptions.d.ts.map +1 -1
  65. package/dist/types/endpoints/integrationApi/Events.d.ts +23 -27
  66. package/dist/types/endpoints/integrationApi/Events.d.ts.map +1 -1
  67. package/dist/types/endpoints/integrationApi/Images.d.ts +17 -28
  68. package/dist/types/endpoints/integrationApi/Images.d.ts.map +1 -1
  69. package/dist/types/endpoints/integrationApi/Listings.d.ts +42 -104
  70. package/dist/types/endpoints/integrationApi/Listings.d.ts.map +1 -1
  71. package/dist/types/endpoints/integrationApi/Marketplace.d.ts +12 -20
  72. package/dist/types/endpoints/integrationApi/Marketplace.d.ts.map +1 -1
  73. package/dist/types/endpoints/integrationApi/Stock.d.ts +22 -28
  74. package/dist/types/endpoints/integrationApi/Stock.d.ts.map +1 -1
  75. package/dist/types/endpoints/integrationApi/StockAdjustments.d.ts +35 -35
  76. package/dist/types/endpoints/integrationApi/StockAdjustments.d.ts.map +1 -1
  77. package/dist/types/endpoints/integrationApi/StockReservations.d.ts +43 -0
  78. package/dist/types/endpoints/integrationApi/StockReservations.d.ts.map +1 -0
  79. package/dist/types/endpoints/integrationApi/Transactions.d.ts +36 -80
  80. package/dist/types/endpoints/integrationApi/Transactions.d.ts.map +1 -1
  81. package/dist/types/endpoints/integrationApi/Users.d.ts +35 -70
  82. package/dist/types/endpoints/integrationApi/Users.d.ts.map +1 -1
  83. package/dist/types/endpoints/integrationApi/index.d.ts +40 -40
  84. package/dist/types/endpoints/integrationApi/index.d.ts.map +1 -1
  85. package/dist/types/endpoints/marketplace/AvailabilityExceptions.d.ts +34 -48
  86. package/dist/types/endpoints/marketplace/AvailabilityExceptions.d.ts.map +1 -1
  87. package/dist/types/endpoints/marketplace/Bookings.d.ts +24 -23
  88. package/dist/types/endpoints/marketplace/Bookings.d.ts.map +1 -1
  89. package/dist/types/endpoints/marketplace/CurrentUser.d.ts +54 -125
  90. package/dist/types/endpoints/marketplace/CurrentUser.d.ts.map +1 -1
  91. package/dist/types/endpoints/marketplace/Images.d.ts +19 -27
  92. package/dist/types/endpoints/marketplace/Images.d.ts.map +1 -1
  93. package/dist/types/endpoints/marketplace/Listings.d.ts +26 -25
  94. package/dist/types/endpoints/marketplace/Listings.d.ts.map +1 -1
  95. package/dist/types/endpoints/marketplace/Marketplace.d.ts +15 -19
  96. package/dist/types/endpoints/marketplace/Marketplace.d.ts.map +1 -1
  97. package/dist/types/endpoints/marketplace/Messages.d.ts +24 -29
  98. package/dist/types/endpoints/marketplace/Messages.d.ts.map +1 -1
  99. package/dist/types/endpoints/marketplace/OwnListings.d.ts +55 -119
  100. package/dist/types/endpoints/marketplace/OwnListings.d.ts.map +1 -1
  101. package/dist/types/endpoints/marketplace/PasswordReset.d.ts +23 -35
  102. package/dist/types/endpoints/marketplace/PasswordReset.d.ts.map +1 -1
  103. package/dist/types/endpoints/marketplace/ProcessTransitions.d.ts +22 -22
  104. package/dist/types/endpoints/marketplace/ProcessTransitions.d.ts.map +1 -1
  105. package/dist/types/endpoints/marketplace/Reviews.d.ts +23 -25
  106. package/dist/types/endpoints/marketplace/Reviews.d.ts.map +1 -1
  107. package/dist/types/endpoints/marketplace/Stock.d.ts +30 -26
  108. package/dist/types/endpoints/marketplace/Stock.d.ts.map +1 -1
  109. package/dist/types/endpoints/marketplace/StockAdjustments.d.ts +36 -34
  110. package/dist/types/endpoints/marketplace/StockAdjustments.d.ts.map +1 -1
  111. package/dist/types/endpoints/marketplace/StripeAccount.d.ts +28 -49
  112. package/dist/types/endpoints/marketplace/StripeAccount.d.ts.map +1 -1
  113. package/dist/types/endpoints/marketplace/StripeAccountLinks.d.ts +22 -31
  114. package/dist/types/endpoints/marketplace/StripeAccountLinks.d.ts.map +1 -1
  115. package/dist/types/endpoints/marketplace/StripeCustomer.d.ts +32 -46
  116. package/dist/types/endpoints/marketplace/StripeCustomer.d.ts.map +1 -1
  117. package/dist/types/endpoints/marketplace/StripePersons.d.ts +17 -25
  118. package/dist/types/endpoints/marketplace/StripePersons.d.ts.map +1 -1
  119. package/dist/types/endpoints/marketplace/StripeSetupIntents.d.ts +24 -24
  120. package/dist/types/endpoints/marketplace/StripeSetupIntents.d.ts.map +1 -1
  121. package/dist/types/endpoints/marketplace/TimeSlots.d.ts +20 -23
  122. package/dist/types/endpoints/marketplace/TimeSlots.d.ts.map +1 -1
  123. package/dist/types/endpoints/marketplace/Transactions.d.ts +45 -81
  124. package/dist/types/endpoints/marketplace/Transactions.d.ts.map +1 -1
  125. package/dist/types/endpoints/marketplace/Users.d.ts +15 -22
  126. package/dist/types/endpoints/marketplace/Users.d.ts.map +1 -1
  127. package/dist/types/endpoints/marketplace/index.d.ts +50 -40
  128. package/dist/types/endpoints/marketplace/index.d.ts.map +1 -1
  129. package/dist/types/index.d.ts +15 -30
  130. package/dist/types/index.d.ts.map +1 -1
  131. package/dist/types/integration/events.d.ts +87 -0
  132. package/dist/types/integrationSdk.d.ts +4 -5
  133. package/dist/types/integrationSdk.d.ts.map +1 -1
  134. package/dist/types/marketplace/availabilityExceptions.d.ts +99 -0
  135. package/dist/types/marketplace/availabilityPlan.d.ts +17 -0
  136. package/dist/types/marketplace/bookings.d.ts +80 -0
  137. package/dist/types/marketplace/currentUser.d.ts +202 -0
  138. package/dist/types/marketplace/images.d.ts +65 -0
  139. package/dist/types/marketplace/listings.d.ts +169 -0
  140. package/dist/types/marketplace/marketplace.d.ts +30 -0
  141. package/dist/types/marketplace/messages.d.ts +87 -0
  142. package/dist/types/marketplace/ownListings.d.ts +155 -0
  143. package/dist/types/marketplace/passwordReset.d.ts +54 -0
  144. package/dist/types/marketplace/processTransitions.d.ts +56 -0
  145. package/dist/types/marketplace/reviews.d.ts +108 -0
  146. package/dist/types/marketplace/stock.d.ts +45 -0
  147. package/dist/types/marketplace/stockAdjustment.d.ts +97 -0
  148. package/dist/types/marketplace/stockReservations.d.ts +89 -0
  149. package/dist/types/marketplace/stripeAccount.d.ts +67 -0
  150. package/dist/types/marketplace/stripeAccountLinks.d.ts +55 -0
  151. package/dist/types/marketplace/stripeCustomer.d.ts +94 -0
  152. package/dist/types/marketplace/stripePaymentMethod.d.ts +21 -0
  153. package/dist/types/marketplace/stripePersons.d.ts +48 -0
  154. package/dist/types/marketplace/stripeSetupIntents.d.ts +48 -0
  155. package/dist/types/marketplace/timeSlots.d.ts +51 -0
  156. package/dist/types/marketplace/transactions.d.ts +200 -0
  157. package/dist/types/marketplace/user.d.ts +200 -0
  158. package/dist/types/sdk-types.d.ts +10 -0
  159. package/dist/types/sdk.d.ts +6 -7
  160. package/dist/types/sdk.d.ts.map +1 -1
  161. package/dist/types/sdkTypes/BigDecimal.d.ts +1 -1
  162. package/dist/types/sdkTypes/BigDecimal.d.ts.map +1 -1
  163. package/dist/types/sdkTypes/LatLng.d.ts +1 -1
  164. package/dist/types/sdkTypes/LatLng.d.ts.map +1 -1
  165. package/dist/types/sdkTypes/LatLngBounds.d.ts +1 -1
  166. package/dist/types/sdkTypes/LatLngBounds.d.ts.map +1 -1
  167. package/dist/types/sdkTypes/Money.d.ts +1 -1
  168. package/dist/types/sdkTypes/Money.d.ts.map +1 -1
  169. package/dist/types/sdkTypes/UUID.d.ts +1 -1
  170. package/dist/types/sdkTypes/UUID.d.ts.map +1 -1
  171. package/dist/types/sharetribe.d.ts +227 -0
  172. package/dist/types/store.d.ts +22 -0
  173. package/dist/types/types/apiConfigs.d.ts.map +1 -1
  174. package/dist/types/types/assets/index.d.ts +74 -36
  175. package/dist/types/types/assets/index.d.ts.map +1 -1
  176. package/dist/types/types/authentication/index.d.ts +111 -60
  177. package/dist/types/types/authentication/index.d.ts.map +1 -1
  178. package/dist/types/types/axios.d.ts.map +1 -1
  179. package/dist/types/types/config.d.ts +1 -39
  180. package/dist/types/types/config.d.ts.map +1 -1
  181. package/dist/types/types/integration/events.d.ts +52 -20
  182. package/dist/types/types/integration/events.d.ts.map +1 -1
  183. package/dist/types/types/marketplace/availabilityExceptions.d.ts +59 -16
  184. package/dist/types/types/marketplace/availabilityExceptions.d.ts.map +1 -1
  185. package/dist/types/types/marketplace/availabilityPlan.d.ts +18 -0
  186. package/dist/types/types/marketplace/availabilityPlan.d.ts.map +1 -0
  187. package/dist/types/types/marketplace/bookings.d.ts +48 -14
  188. package/dist/types/types/marketplace/bookings.d.ts.map +1 -1
  189. package/dist/types/types/marketplace/currentUser.d.ts +99 -55
  190. package/dist/types/types/marketplace/currentUser.d.ts.map +1 -1
  191. package/dist/types/types/marketplace/images.d.ts +40 -14
  192. package/dist/types/types/marketplace/images.d.ts.map +1 -1
  193. package/dist/types/types/marketplace/listings.d.ts +96 -66
  194. package/dist/types/types/marketplace/listings.d.ts.map +1 -1
  195. package/dist/types/types/marketplace/marketplace.d.ts +16 -6
  196. package/dist/types/types/marketplace/marketplace.d.ts.map +1 -1
  197. package/dist/types/types/marketplace/messages.d.ts +53 -15
  198. package/dist/types/types/marketplace/messages.d.ts.map +1 -1
  199. package/dist/types/types/marketplace/ownListings.d.ts +92 -65
  200. package/dist/types/types/marketplace/ownListings.d.ts.map +1 -1
  201. package/dist/types/types/marketplace/passwordReset.d.ts +32 -9
  202. package/dist/types/types/marketplace/passwordReset.d.ts.map +1 -1
  203. package/dist/types/types/marketplace/processTransitions.d.ts +33 -14
  204. package/dist/types/types/marketplace/processTransitions.d.ts.map +1 -1
  205. package/dist/types/types/marketplace/reviews.d.ts +72 -23
  206. package/dist/types/types/marketplace/reviews.d.ts.map +1 -1
  207. package/dist/types/types/marketplace/stock.d.ts +23 -6
  208. package/dist/types/types/marketplace/stock.d.ts.map +1 -1
  209. package/dist/types/types/marketplace/stockAdjustment.d.ts +60 -14
  210. package/dist/types/types/marketplace/stockAdjustment.d.ts.map +1 -1
  211. package/dist/types/types/marketplace/stockReservations.d.ts +59 -14
  212. package/dist/types/types/marketplace/stockReservations.d.ts.map +1 -1
  213. package/dist/types/types/marketplace/stripeAccount.d.ts +28 -5
  214. package/dist/types/types/marketplace/stripeAccount.d.ts.map +1 -1
  215. package/dist/types/types/marketplace/stripeAccountLinks.d.ts +26 -6
  216. package/dist/types/types/marketplace/stripeAccountLinks.d.ts.map +1 -1
  217. package/dist/types/types/marketplace/stripeCustomer.d.ts +60 -13
  218. package/dist/types/types/marketplace/stripeCustomer.d.ts.map +1 -1
  219. package/dist/types/types/marketplace/stripePaymentMethod.d.ts +1 -2
  220. package/dist/types/types/marketplace/stripePaymentMethod.d.ts.map +1 -1
  221. package/dist/types/types/marketplace/stripePersons.d.ts +17 -15
  222. package/dist/types/types/marketplace/stripePersons.d.ts.map +1 -1
  223. package/dist/types/types/marketplace/stripeSetupIntents.d.ts +16 -14
  224. package/dist/types/types/marketplace/stripeSetupIntents.d.ts.map +1 -1
  225. package/dist/types/types/marketplace/timeSlots.d.ts +13 -15
  226. package/dist/types/types/marketplace/timeSlots.d.ts.map +1 -1
  227. package/dist/types/types/marketplace/transactions.d.ts +77 -83
  228. package/dist/types/types/marketplace/transactions.d.ts.map +1 -1
  229. package/dist/types/types/marketplace/user.d.ts +85 -64
  230. package/dist/types/types/marketplace/user.d.ts.map +1 -1
  231. package/dist/types/types/sharetribe.d.ts +130 -92
  232. package/dist/types/types/sharetribe.d.ts.map +1 -1
  233. package/dist/types/types/store.d.ts +3 -14
  234. package/dist/types/types/store.d.ts.map +1 -1
  235. package/dist/types/utils/apis.d.ts +1 -1
  236. package/dist/types/utils/apis.d.ts.map +1 -1
  237. package/dist/types/utils/config.d.ts.map +1 -1
  238. package/dist/types/utils/convert-types.d.ts.map +1 -1
  239. package/dist/types/utils/parameter-serializer.d.ts.map +1 -1
  240. package/dist/types/utils/prepare-axios-instance.d.ts +1 -1
  241. package/dist/types/utils/prepare-axios-instance.d.ts.map +1 -1
  242. package/dist/types/utils/stores/BrowserStore.d.ts +1 -2
  243. package/dist/types/utils/stores/BrowserStore.d.ts.map +1 -1
  244. package/dist/types/utils/stores/ExpressStore.d.ts +6 -7
  245. package/dist/types/utils/stores/ExpressStore.d.ts.map +1 -1
  246. package/dist/types/utils/stores/MemoryStore.d.ts +1 -2
  247. package/dist/types/utils/stores/MemoryStore.d.ts.map +1 -1
  248. package/dist/types/utils/stores/store.d.ts.map +1 -1
  249. package/dist/types/utils/transit.d.ts +1 -1
  250. package/dist/types/utils/transit.d.ts.map +1 -1
  251. package/dist/types/utils/util.d.ts +2 -2
  252. package/dist/types/utils/util.d.ts.map +1 -1
  253. package/dist/utils/apis.d.ts +8 -0
  254. package/dist/utils/config.d.ts +32 -0
  255. package/dist/utils/convert-types.d.ts +13 -0
  256. package/dist/utils/parameter-serializer.d.ts +23 -0
  257. package/dist/utils/prepare-axios-instance.d.ts +14 -0
  258. package/dist/utils/stores/BrowserStore.d.ts +37 -0
  259. package/dist/utils/stores/ExpressStore.d.ts +48 -0
  260. package/dist/utils/stores/MemoryStore.d.ts +23 -0
  261. package/dist/utils/stores/store.d.ts +8 -0
  262. package/dist/utils/transit.d.ts +28 -0
  263. package/dist/utils/util.d.ts +15 -0
  264. package/package.json +18 -17
  265. package/dist/ts-sharetribe-flex-sdk.cjs +0 -3
  266. package/dist/ts-sharetribe-flex-sdk.cjs.map +0 -1
  267. package/dist/ts-sharetribe-flex-sdk.js +0 -3
  268. package/dist/ts-sharetribe-flex-sdk.js.map +0 -1
  269. package/dist/ts-sharetribe-flex-sdk.mjs +0 -3
  270. package/dist/ts-sharetribe-flex-sdk.mjs.map +0 -1
  271. package/dist/types/endpoints/integrationApi/StockReservation.d.ts.map +0 -1
@@ -0,0 +1,119 @@
1
+ import { ApiConfigs, SdkConfig } from "./types";
2
+ import { AxiosInstance } from "axios";
3
+ import IntegrationApi from "./endpoints/integrationApi";
4
+ import AuthenticationApi from "./endpoints/auth";
5
+ import AvailabilityExceptions from "./endpoints/integrationApi/AvailabilityExceptions";
6
+ import Events from "./endpoints/integrationApi/Events";
7
+ import Images from "./endpoints/integrationApi/Images";
8
+ import Listings from "./endpoints/integrationApi/Listings";
9
+ import Marketplace from "./endpoints/integrationApi/Marketplace";
10
+ import Stock from "./endpoints/integrationApi/Stock";
11
+ import StockAdjustments from "./endpoints/integrationApi/StockAdjustments";
12
+ import StockReservations from "./endpoints/integrationApi/StockReservations";
13
+ import Transactions from "./endpoints/integrationApi/Transactions";
14
+ import Users from "./endpoints/integrationApi/Users";
15
+ /**
16
+ * The main Sharetribe Integration SDK for interacting with the Sharetribe Integration API.
17
+ *
18
+ * @class
19
+ */
20
+ declare class IntegrationSdk {
21
+ /**
22
+ * Configuration for the SDK.
23
+ *
24
+ * @type {SdkConfig}
25
+ */
26
+ sdkConfig: SdkConfig;
27
+ /**
28
+ * Configuration for the API endpoints.
29
+ *
30
+ * @type {ApiConfigs<true>}
31
+ */
32
+ apisConfigs: ApiConfigs<true>;
33
+ /**
34
+ * Axios instance used for making API requests.
35
+ *
36
+ * @type {AxiosInstance}
37
+ */
38
+ axios: AxiosInstance;
39
+ /**
40
+ * Endpoint for handling authentication.
41
+ *
42
+ * @type {AuthenticationApi}
43
+ */
44
+ auth: AuthenticationApi;
45
+ /**
46
+ * Main integration API.
47
+ *
48
+ * @type {IntegrationApi}
49
+ */
50
+ integration_api: IntegrationApi;
51
+ /**
52
+ * Endpoint for managing availability exceptions.
53
+ *
54
+ * @type {AvailabilityExceptions}
55
+ */
56
+ availabilityExceptions: AvailabilityExceptions;
57
+ /**
58
+ * Endpoint for retrieving and managing events.
59
+ *
60
+ * @type {Events}
61
+ */
62
+ events: Events;
63
+ /**
64
+ * Endpoint for handling image-related operations.
65
+ *
66
+ * @type {Images}
67
+ */
68
+ images: Images;
69
+ /**
70
+ * Endpoint for managing listings.
71
+ *
72
+ * @type {Listings}
73
+ */
74
+ listings: Listings;
75
+ /**
76
+ * Endpoint for accessing marketplace details.
77
+ *
78
+ * @type {Marketplace}
79
+ */
80
+ marketplace: Marketplace;
81
+ /**
82
+ * Endpoint for managing stock.
83
+ *
84
+ * @type {Stock}
85
+ */
86
+ stock: Stock;
87
+ /**
88
+ * Endpoint for handling stock adjustments.
89
+ *
90
+ * @type {StockAdjustments}
91
+ */
92
+ stockAdjustments: StockAdjustments;
93
+ /**
94
+ * Endpoint for managing stock reservations.
95
+ *
96
+ * @type {StockReservations}
97
+ */
98
+ stockReservations: StockReservations;
99
+ /**
100
+ * Endpoint for managing transactions.
101
+ *
102
+ * @type {Transactions}
103
+ */
104
+ transactions: Transactions;
105
+ /**
106
+ * Endpoint for managing user data.
107
+ *
108
+ * @type {Users}
109
+ */
110
+ users: Users;
111
+ /**
112
+ * Initializes a new instance of the SharetribeIntegrationSdk class.
113
+ *
114
+ * @constructor
115
+ * @param {SdkConfig} config - The configuration object for the SDK.
116
+ */
117
+ constructor(config: SdkConfig);
118
+ }
119
+ export default IntegrationSdk;
package/dist/sdk.d.ts ADDED
@@ -0,0 +1,211 @@
1
+ import { ApiConfigs, SdkConfig } from "./types";
2
+ import { AxiosInstance, AxiosResponse } from "axios";
3
+ import AuthenticationApi from "./endpoints/auth";
4
+ import MarketplaceApi from "./endpoints/marketplace";
5
+ import Listings from "./endpoints/marketplace/Listings";
6
+ import AvailabilityExceptions from "./endpoints/marketplace/AvailabilityExceptions";
7
+ import Bookings from "./endpoints/marketplace/Bookings";
8
+ import CurrentUser from "./endpoints/marketplace/CurrentUser";
9
+ import Images from "./endpoints/marketplace/Images";
10
+ import Marketplace from "./endpoints/marketplace/Marketplace";
11
+ import Messages from "./endpoints/marketplace/Messages";
12
+ import OwnListings from "./endpoints/marketplace/OwnListings";
13
+ import PasswordReset from "./endpoints/marketplace/PasswordReset";
14
+ import ProcessTransitions from "./endpoints/marketplace/ProcessTransitions";
15
+ import Reviews from "./endpoints/marketplace/Reviews";
16
+ import Stock from "./endpoints/marketplace/Stock";
17
+ import StockAdjustments from "./endpoints/marketplace/StockAdjustments";
18
+ import StripeAccount from "./endpoints/marketplace/StripeAccount";
19
+ import StripeAccountLinks from "./endpoints/marketplace/StripeAccountLinks";
20
+ import StripeCustomer from "./endpoints/marketplace/StripeCustomer";
21
+ import StripePersons from "./endpoints/marketplace/StripePersons";
22
+ import StripeSetupIntents from "./endpoints/marketplace/StripeSetupIntents";
23
+ import TimeSlots from "./endpoints/marketplace/TimeSlots";
24
+ import Transactions from "./endpoints/marketplace/Transactions";
25
+ import Users from "./endpoints/marketplace/Users";
26
+ import { AuthInfoResponse, LoginParameter, LoginWithIdpParameter, RevokeResponse, TokenResponse, TrustedUserTokenRequest, UserTokenRequest, UserTokenRequestWithAuthCode } from "./types";
27
+ import AssetsApi from "./endpoints/assets";
28
+ declare class SharetribeSdk {
29
+ /**
30
+ * The SDK configuration object.
31
+ * @type {SdkConfig}
32
+ */
33
+ sdkConfig: SdkConfig;
34
+ /**
35
+ * The API configuration object.
36
+ * @type {ApiConfigs}
37
+ */
38
+ apisConfigs: ApiConfigs;
39
+ /**
40
+ * Axios instance for making HTTP requests.
41
+ * @type {AxiosInstance}
42
+ */
43
+ axios: AxiosInstance;
44
+ /**
45
+ * Endpoint for handling authentication.
46
+ * @type {AuthenticationApi}
47
+ */
48
+ auth: AuthenticationApi;
49
+ /**
50
+ * Main marketplace API instance.
51
+ * @type {MarketplaceApi}
52
+ */
53
+ api: MarketplaceApi;
54
+ /**
55
+ * Assets API instance for managing assets.
56
+ * @type {AssetsApi}
57
+ */
58
+ assetsApi: AssetsApi;
59
+ /**
60
+ * Endpoint for managing listings.
61
+ * @type {Listings}
62
+ */
63
+ listings: Listings;
64
+ /**
65
+ * Endpoint for managing availability exceptions.
66
+ * @type {AvailabilityExceptions}
67
+ */
68
+ availabilityExceptions: AvailabilityExceptions;
69
+ /**
70
+ * Endpoint for managing bookings.
71
+ * @type {Bookings}
72
+ * */
73
+ bookings: Bookings;
74
+ /**
75
+ * Endpoint for managing the current user.
76
+ * @type {CurrentUser}
77
+ */
78
+ currentUser: CurrentUser;
79
+ /**
80
+ * Endpoint for handling images.
81
+ * @type {Images}
82
+ */
83
+ images: Images;
84
+ /**
85
+ * Endpoint for accessing marketplace details.
86
+ * @type {Marketplace}
87
+ */
88
+ marketplace: Marketplace;
89
+ /**
90
+ * Endpoint for managing messages.
91
+ * @type {Messages}
92
+ */
93
+ messages: Messages;
94
+ /**
95
+ * Endpoint for managing own listings.
96
+ * @type {OwnListings} */
97
+ ownListings: OwnListings;
98
+ /**
99
+ * Endpoint for managing password resets.
100
+ * @type {PasswordReset} */
101
+ passwordReset: PasswordReset;
102
+ /**
103
+ * Endpoint for managing process transitions.
104
+ * @type {ProcessTransitions} */
105
+ processTransitions: ProcessTransitions;
106
+ /**
107
+ * Endpoint for managing reviews.
108
+ * @type {Reviews} */
109
+ reviews: Reviews;
110
+ /**
111
+ * Endpoint for managing stock.
112
+ * @type {Stock} */
113
+ stock: Stock;
114
+ /**
115
+ * Endpoint for managing stock adjustments.
116
+ * @type {StockAdjustments} */
117
+ stockAdjustments: StockAdjustments;
118
+ /**
119
+ * Endpoint for managing stripe accounts.
120
+ * @type {StripeAccount} */
121
+ stripeAccount: StripeAccount;
122
+ /**
123
+ * Endpoint for managing stripe account links.
124
+ * @type {StripeAccountLinks} */
125
+ stripeAccountLinks: StripeAccountLinks;
126
+ /**
127
+ * Endpoint for managing stripe customers.
128
+ * @type {StripeCustomer} */
129
+ stripeCustomer: StripeCustomer;
130
+ /**
131
+ * Endpoint for managing stripe persons.
132
+ * @type {StripePersons} */
133
+ stripePersons: StripePersons;
134
+ /**
135
+ * Endpoint for managing stripe setup intents.
136
+ * @type {StripeSetupIntents} */
137
+ stripeSetupIntents: StripeSetupIntents;
138
+ /**
139
+ * Endpoint for managing timeslots.
140
+ * @type {TimeSlots} */
141
+ timeslots: TimeSlots;
142
+ /**
143
+ * Endpoint for managing transactions.
144
+ * @type {Transactions} */
145
+ transactions: Transactions;
146
+ /**
147
+ * Endpoint for managing users.
148
+ * @type {Users} */
149
+ users: Users;
150
+ /** @type {AssetsApi['assetByAlias']} */
151
+ assetByAlias: AssetsApi["assetByAlias"];
152
+ /** @type {AssetsApi['assetsByAlias']} */
153
+ assetsByAlias: AssetsApi["assetsByAlias"];
154
+ /** @type {AssetsApi['assetByVersion']} */
155
+ assetByVersion: AssetsApi["assetByVersion"];
156
+ /** @type {AssetsApi['assetsByVersion']} */
157
+ assetsByVersion: AssetsApi["assetsByVersion"];
158
+ /**
159
+ * Creates an instance of the Sharetribe SDK.
160
+ *
161
+ * @constructor
162
+ * @param {SdkConfig} config - The configuration object for the SDK.
163
+ */
164
+ constructor(config: SdkConfig);
165
+ /**
166
+ * Logs in a user using their credentials.
167
+ *
168
+ * @async
169
+ * @param {LoginParameter} params - The login parameters.
170
+ * @returns {Promise<AuthToken>} - The authentication token.
171
+ */
172
+ login(params: LoginParameter<'user'>): Promise<AxiosResponse<TokenResponse<UserTokenRequest>>>;
173
+ /**
174
+ * Logs in the marketplace operator as the marketplace user and returns a Promise
175
+ *
176
+ * @async
177
+ * @param {LoginParameter} params - The login parameters.
178
+ * @returns {Promise<AuthToken>} - The authentication token.
179
+ */
180
+ loginAs(params: LoginParameter<'auth_code'>): Promise<AxiosResponse<TokenResponse<UserTokenRequestWithAuthCode>>>;
181
+ /**
182
+ * Logs in a user using an identity provider (IDP).
183
+ *
184
+ * @async
185
+ * @param {LoginWithIdpParameter} params - The IDP login parameters.
186
+ * @returns {Promise<AuthToken>} - The authentication token.
187
+ */
188
+ loginWithIdp(params: LoginWithIdpParameter): Promise<AxiosResponse<TokenResponse<UserTokenRequest>>>;
189
+ /**
190
+ * Logs out the current user.
191
+ *
192
+ * @async
193
+ * @returns {Promise<void>} - Resolves when the user is logged out.
194
+ */
195
+ logout(): Promise<AxiosResponse<RevokeResponse>>;
196
+ /**
197
+ * Exchanges the current token for a trusted user token.
198
+ *
199
+ * @async
200
+ * @returns {Promise<AuthToken>} - The exchanged token.
201
+ */
202
+ exchangeToken(): Promise<AxiosResponse<TokenResponse<TrustedUserTokenRequest>>>;
203
+ /**
204
+ * Retrieves authentication info for the current user.
205
+ *
206
+ * @async
207
+ * @returns {Promise<AuthInfoResponse>} - The authentication info.
208
+ */
209
+ authInfo(): Promise<AuthInfoResponse>;
210
+ }
211
+ export default SharetribeSdk;
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Class representing a high-precision decimal number.
3
+ *
4
+ * The BigDecimal class ensures that large decimal numbers are stored as strings
5
+ * to avoid precision loss during computations.
6
+ */
7
+ import { SdkType } from "../types";
8
+ declare const BIGDECIMAL_SDK_TYPE = "BigDecimal";
9
+ declare class BigDecimal implements SdkType {
10
+ value: string;
11
+ readonly _sdkType: typeof BIGDECIMAL_SDK_TYPE;
12
+ /**
13
+ * Creates an instance of the BigDecimal class.
14
+ *
15
+ * @param {any} value - The value to be stored as a BigDecimal. It must be convertible to a string.
16
+ * @example
17
+ * const bigDecimal = new BigDecimal('123456789.123456789');
18
+ */
19
+ constructor(value: any);
20
+ /**
21
+ * Converts the BigDecimal instance to a string representation.
22
+ *
23
+ * @returns {string} - The string representation of the BigDecimal.
24
+ * @example
25
+ * const bigDecimal = new BigDecimal('123456789.123456789');
26
+ * console.log(bigDecimal.toString()); // Outputs: '123456789.123456789'
27
+ */
28
+ toString(): string;
29
+ }
30
+ export default BigDecimal;
@@ -0,0 +1,34 @@
1
+ /**
2
+ * @fileoverview Provides the LatLng class for representing geographical coordinates.
3
+ * This class encapsulates a latitude and longitude pair, with validation for numeric input.
4
+ */
5
+ import { SdkType } from "../types";
6
+ declare const LATLNG_SDK_TYPE = "LatLng";
7
+ /**
8
+ * Class representing a geographical coordinate pair (latitude and longitude).
9
+ */
10
+ declare class LatLng implements SdkType {
11
+ lat: number | string;
12
+ lng: number | string;
13
+ readonly _sdkType: typeof LATLNG_SDK_TYPE;
14
+ /**
15
+ * Creates an instance of the LatLng class.
16
+ *
17
+ * @param {string | number} lat - The latitude value. Must be a number or a string that represents a number.
18
+ * @param {string | number} lng - The longitude value. Must be a number or a string that represents a number.
19
+ * @example
20
+ * const coordinates = new LatLng(37.7749, -122.4194);
21
+ * console.log(coordinates.toString()); // Outputs: '37.7749,-122.4194'
22
+ */
23
+ constructor(lat: string | number, lng: string | number);
24
+ /**
25
+ * Converts the LatLng instance to a string representation.
26
+ *
27
+ * @returns {string} - A string in the format "latitude,longitude".
28
+ * @example
29
+ * const coordinates = new LatLng(37.7749, -122.4194);
30
+ * console.log(coordinates.toString()); // Outputs: '37.7749,-122.4194'
31
+ */
32
+ toString(): string;
33
+ }
34
+ export default LatLng;
@@ -0,0 +1,51 @@
1
+ /**
2
+ * @fileoverview Provides the LatLngBounds class for representing geographical bounding boxes.
3
+ * This class encapsulates a northeast (NE) and southwest (SW) pair of coordinates to define a rectangular area.
4
+ */
5
+ import LatLng from "./LatLng";
6
+ import { SdkType } from "../types";
7
+ declare const LATLNGBOUNDS_SDK_TYPE = "LatLngBounds";
8
+ /**
9
+ * Class representing a geographical bounding box with NE and SW coordinates.
10
+ */
11
+ declare class LatLngBounds implements SdkType {
12
+ ne: LatLng | {
13
+ lat: number | string;
14
+ lng: number | string;
15
+ };
16
+ sw: LatLng | {
17
+ lat: number | string;
18
+ lng: number | string;
19
+ };
20
+ readonly _sdkType: typeof LATLNGBOUNDS_SDK_TYPE;
21
+ /**
22
+ * Creates an instance of the LatLngBounds class.
23
+ *
24
+ * @param {LatLng | { lat: number; lng: number }} ne - The northeast coordinate.
25
+ * @param {LatLng | { lat: number; lng: number }} sw - The southwest coordinate.
26
+ * @example
27
+ * const ne = new LatLng(40.7128, -74.0060);
28
+ * const sw = new LatLng(34.0522, -118.2437);
29
+ * const bounds = new LatLngBounds(ne, sw);
30
+ * console.log(bounds.toString()); // Outputs: '40.7128,-74.0060,34.0522,-118.2437'
31
+ */
32
+ constructor(ne: LatLng | {
33
+ lat: number;
34
+ lng: number;
35
+ }, sw: LatLng | {
36
+ lat: number;
37
+ lng: number;
38
+ });
39
+ /**
40
+ * Converts the LatLngBounds instance to a string representation.
41
+ *
42
+ * @returns {string} - A string in the format "NE_lat,NE_lng,SW_lat,SW_lng".
43
+ * @example
44
+ * const ne = new LatLng(40.7128, -74.0060);
45
+ * const sw = new LatLng(34.0522, -118.2437);
46
+ * const bounds = new LatLngBounds(ne, sw);
47
+ * console.log(bounds.toString()); // Outputs: '40.7128,-74.0060,34.0522,-118.2437'
48
+ */
49
+ toString(): string;
50
+ }
51
+ export default LatLngBounds;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * @fileoverview Provides the Money class for handling monetary values.
3
+ * This class ensures proper structure and validation of monetary values with an amount and a currency.
4
+ */
5
+ import { SdkType } from "../types";
6
+ declare const MONEY_SDK_TYPE = "Money";
7
+ /**
8
+ * Class representing a monetary value.
9
+ *
10
+ * The Money class encapsulates an amount in the smallest unit of the currency (e.g., cents)
11
+ * and a currency code (e.g., "USD").
12
+ */
13
+ declare class Money implements SdkType {
14
+ amount: number;
15
+ currency: string;
16
+ readonly _sdkType: typeof MONEY_SDK_TYPE;
17
+ /**
18
+ * Creates an instance of the Money class.
19
+ *
20
+ * @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").
22
+ * @example
23
+ * const money = new Money(1000, 'USD');
24
+ * console.log(money); // Outputs: Money { amount: 1000, currency: 'USD' }
25
+ */
26
+ constructor(amount: number, currency: string);
27
+ }
28
+ export default Money;
@@ -0,0 +1,38 @@
1
+ /**
2
+ * @fileoverview Provides the UUID class for handling universally unique identifiers (UUIDs).
3
+ * This class allows for the creation and validation of UUIDs, using the `uuid` library.
4
+ */
5
+ import { SdkType } from "../types";
6
+ declare const UUID_SDK_TYPE = "UUID";
7
+ /**
8
+ * Class representing a UUID (Universally Unique Identifier).
9
+ *
10
+ * The UUID class ensures that a valid UUID is created or used, with the option to generate one if none is provided.
11
+ */
12
+ declare class UUID implements SdkType {
13
+ uuid: string;
14
+ readonly _sdkType: typeof UUID_SDK_TYPE;
15
+ /**
16
+ * Creates an instance of the UUID class.
17
+ *
18
+ * @param {string} [uuid] - An optional UUID string. If not provided, a new UUID will be generated.
19
+ * @example
20
+ * const id = new UUID();
21
+ * console.log(id.toString()); // Outputs a newly generated UUID.
22
+ *
23
+ * const predefinedId = new UUID('123e4567-e89b-12d3-a456-426614174000');
24
+ * console.log(predefinedId.toString()); // Outputs: '123e4567-e89b-12d3-a456-426614174000'
25
+ */
26
+ constructor(uuid?: string);
27
+ /**
28
+ * Converts the UUID instance to its string representation.
29
+ *
30
+ * @returns {string} - The string representation of the UUID.
31
+ * @example
32
+ * const id = new UUID();
33
+ * console.log(id.toString()); // Outputs the UUID as a string.
34
+ */
35
+ toString(): string;
36
+ }
37
+ export default UUID;
38
+ export type UUIDInstance = InstanceType<typeof UUID>;
@@ -0,0 +1,104 @@
1
+ /**
2
+ * @fileoverview Defines API configuration types for different environments and endpoints.
3
+ */
4
+ import { SdkConfig } from "./config";
5
+ /**
6
+ * Configuration type for various API endpoints.
7
+ *
8
+ * - When `I` is `false`, provides configurations for `api`, `auth`, and `assets` endpoints.
9
+ * - When `I` is `true`, provides configurations for the `integrationApi` endpoint.
10
+ */
11
+ export type ApiConfigs<I extends boolean = false> = I extends false ? {
12
+ /**
13
+ * Configuration for the main API.
14
+ */
15
+ api: (config: SdkConfig) => {
16
+ headers: {
17
+ /**
18
+ * Optional header to enable verbose transit responses.
19
+ */
20
+ "X-Transit-Verbose"?: "true" | "false";
21
+ /**
22
+ * Header indicating the format for API responses.
23
+ */
24
+ Accept: "application/transit+json";
25
+ };
26
+ /**
27
+ * Base URL for the main API.
28
+ */
29
+ baseUrl: string;
30
+ };
31
+ /**
32
+ * Configuration for the authentication API.
33
+ */
34
+ auth: (config: SdkConfig) => {
35
+ headers: {
36
+ /**
37
+ * Header indicating the content type for authentication requests.
38
+ */
39
+ "Content-Type": "application/x-www-form-urlencoded";
40
+ /**
41
+ * Header indicating the format for authentication API responses.
42
+ */
43
+ Accept: "application/json";
44
+ };
45
+ /**
46
+ * Base URL for the authentication API.
47
+ */
48
+ baseUrl: string;
49
+ };
50
+ /**
51
+ * Configuration for the assets API.
52
+ */
53
+ assets: (config: SdkConfig) => {
54
+ headers: {
55
+ /**
56
+ * Header indicating the format for assets API responses.
57
+ */
58
+ Accept: "application/json";
59
+ };
60
+ /**
61
+ * Base URL for the assets API.
62
+ */
63
+ baseUrl: string;
64
+ };
65
+ } : {
66
+ /**
67
+ * Configuration for the authentication API.
68
+ */
69
+ auth: (config: SdkConfig) => {
70
+ headers: {
71
+ /**
72
+ * Header indicating the content type for authentication requests.
73
+ */
74
+ "Content-Type": "application/x-www-form-urlencoded";
75
+ /**
76
+ * Header indicating the format for authentication API responses.
77
+ */
78
+ Accept: "application/json";
79
+ };
80
+ /**
81
+ * Base URL for the authentication API.
82
+ */
83
+ baseUrl: string;
84
+ };
85
+ /**
86
+ * Configuration for the integration API.
87
+ */
88
+ integrationApi: (config: SdkConfig) => {
89
+ headers: {
90
+ /**
91
+ * Optional header to enable verbose transit responses.
92
+ */
93
+ "X-Transit-Verbose"?: "true" | "false";
94
+ /**
95
+ * Header indicating the format for integration API responses.
96
+ */
97
+ Accept: "application/transit+json";
98
+ };
99
+ /**
100
+ * Base URL for the integration API.
101
+ */
102
+ baseUrl: string;
103
+ };
104
+ };