@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,101 @@
1
+ /**
2
+ * @fileoverview Type definitions for Assets in the Sharetribe Marketplace API.
3
+ */
4
+ import type { ApiParameter, Relationship, RelationshipTypeMap, UUID } from "../sharetribe";
5
+ import type { ImageVariant, ImageVariantName } from "../marketplace/images";
6
+ /**
7
+ * Available endpoints
8
+ */
9
+ export type AssetEndpoints = "assetByAlias" | "assetsByAlias" | "assetByVersion" | "assetsByVersion";
10
+ /**
11
+ * Relationship fields
12
+ */
13
+ export type AssetRelationshipsFields = "imageAsset";
14
+ /**
15
+ * Image asset resource
16
+ */
17
+ export interface ImageAsset {
18
+ id: UUID;
19
+ type: "imageAsset";
20
+ attributes: {
21
+ assetPath: string;
22
+ variants: Partial<Record<ImageVariantName, ImageVariant>>;
23
+ };
24
+ }
25
+ /**
26
+ * Generic JSON asset (e.g. config, translations)
27
+ */
28
+ export type JsonAsset = Record<string, unknown>;
29
+ /**
30
+ * JSON asset with embedded image relationships
31
+ */
32
+ export interface JsonAssetWithRelationships {
33
+ images: Relationship<true, "imageAsset">;
34
+ }
35
+ /**
36
+ * Base request parameters
37
+ */
38
+ export interface AssetParameter extends ApiParameter {
39
+ include?: AssetRelationshipsFields[];
40
+ }
41
+ /**
42
+ * Single asset by alias/version
43
+ */
44
+ export interface AssetByAliasParameter extends AssetParameter {
45
+ path: string;
46
+ alias: string;
47
+ }
48
+ export interface AssetByVersionParameter extends AssetParameter {
49
+ path: string;
50
+ version: string;
51
+ }
52
+ /**
53
+ * Multiple assets by alias/version
54
+ */
55
+ export interface AssetsByAliasParameter extends AssetParameter {
56
+ paths: string[];
57
+ alias: string;
58
+ }
59
+ export interface AssetsByVersionParameter extends AssetParameter {
60
+ paths: string[];
61
+ version: string;
62
+ }
63
+ /**
64
+ * All parameter types
65
+ */
66
+ type AllAssetParameter = AssetByAliasParameter | AssetsByAliasParameter | AssetByVersionParameter | AssetsByVersionParameter;
67
+ /**
68
+ * Detect if path ends with .json
69
+ */
70
+ type IsJsonPath<Path extends string> = Path extends `${string}.json` ? true : false;
71
+ /**
72
+ * Resolve asset data type from path(s)
73
+ */
74
+ type ResolveAssetType<P extends AllAssetParameter> = P extends {
75
+ path: infer Path extends string;
76
+ } ? IsJsonPath<Path> extends true ? JsonAsset : ImageAsset : P extends {
77
+ paths: infer Paths extends string[];
78
+ } ? Paths extends [string] ? IsJsonPath<Paths[0]> extends true ? JsonAsset : ImageAsset : JsonAsset | ImageAsset : never;
79
+ /**
80
+ * Include detection — fixes TS2536
81
+ */
82
+ type HasInclude<P> = P extends {
83
+ include: infer I extends readonly AssetRelationshipsFields[];
84
+ } ? I : never;
85
+ type IncludesRelationships<P> = HasInclude<P> extends never ? false : true;
86
+ type IncludedResources<P> = P extends {
87
+ include: infer I extends readonly AssetRelationshipsFields[];
88
+ } ? RelationshipTypeMap["imageAsset"][] : never;
89
+ /**
90
+ * Response data per endpoint
91
+ */
92
+ type ResponseData<E extends AssetEndpoints, P extends AllAssetParameter> = ResolveAssetType<P>;
93
+ /**
94
+ * Final response type
95
+ */
96
+ export type AssetResponse<E extends AssetEndpoints, P extends AllAssetParameter> = {
97
+ data: ResponseData<E, P>;
98
+ } & (IncludesRelationships<P> extends true ? {
99
+ included: IncludedResources<P>;
100
+ } : {});
101
+ export {};
@@ -0,0 +1,152 @@
1
+ /**
2
+ * @fileoverview Type definitions for Sharetribe Authentication API (OAuth2)
3
+ *
4
+ * @see https://www.sharetribe.com/api-reference/authentication.html
5
+ */
6
+ import type { UUID } from "../sharetribe";
7
+ /**
8
+ * OAuth2 grant types
9
+ */
10
+ export type GrantType = "client_credentials" | "password" | "authorization_code" | "refresh_token" | "token_exchange";
11
+ /**
12
+ * Available scopes
13
+ */
14
+ export type Scope = "public-read" | "user" | "trusted:user" | "integ" | "details" | "refresh-token";
15
+ /**
16
+ * Identity provider ID (built-in + custom)
17
+ */
18
+ export type IdentityProviderId = "facebook" | "google" | string;
19
+ export type LoginParameterType = "user" | "auth_code";
20
+ /**
21
+ * Base token request
22
+ */
23
+ interface BaseTokenRequest {
24
+ client_id: string;
25
+ }
26
+ /**
27
+ * Public read access (anonymous)
28
+ */
29
+ export type AnonymousTokenRequest = BaseTokenRequest & {
30
+ grant_type: "client_credentials";
31
+ scope: "public-read";
32
+ };
33
+ /**
34
+ * User authentication (password or authorization code)
35
+ */
36
+ export type UserTokenRequest = BaseTokenRequest & {
37
+ scope: "user";
38
+ grant_type: "password";
39
+ username: string;
40
+ password: string;
41
+ };
42
+ export type UserTokenRequestWithAuthCode = BaseTokenRequest & {
43
+ scope: "user";
44
+ grant_type: "authorization_code";
45
+ code: string;
46
+ redirect_uri: string;
47
+ code_verifier: string;
48
+ };
49
+ /**
50
+ * Admin "login as" flow
51
+ */
52
+ export type LoginAsTokenRequest = BaseTokenRequest & {
53
+ grant_type: "authorization_code";
54
+ scope: "user";
55
+ code: string;
56
+ redirect_uri: string;
57
+ code_verifier: string;
58
+ };
59
+ /**
60
+ * Trusted impersonation
61
+ */
62
+ export type TrustedUserTokenRequest = BaseTokenRequest & {
63
+ client_secret: string;
64
+ grant_type: "token_exchange";
65
+ scope: "trusted:user";
66
+ subject_token: string;
67
+ };
68
+ /**
69
+ * Integration API access
70
+ */
71
+ export type IntegrationTokenRequest = BaseTokenRequest & {
72
+ client_secret: string;
73
+ grant_type: "client_credentials";
74
+ scope: "integ";
75
+ };
76
+ /**
77
+ * Refresh token
78
+ */
79
+ export type RefreshTokenRequest = BaseTokenRequest & {
80
+ grant_type: "refresh_token";
81
+ refresh_token: string;
82
+ };
83
+ /**
84
+ * Token introspection endpoint (no body)
85
+ */
86
+ export type DetailsRequest = void;
87
+ /**
88
+ * All valid token request types
89
+ */
90
+ export type TokenRequest = AnonymousTokenRequest | UserTokenRequest | UserTokenRequestWithAuthCode | LoginAsTokenRequest | TrustedUserTokenRequest | IntegrationTokenRequest | RefreshTokenRequest | DetailsRequest;
91
+ /**
92
+ * Login parameter
93
+ */
94
+ export type LoginParameter<T extends LoginParameterType> = T extends "user" ? {
95
+ username: string;
96
+ password: string;
97
+ } : T extends "auth_code" ? {
98
+ code: string;
99
+ redirect_uri: string;
100
+ code_verifier: string;
101
+ } : never;
102
+ export type LoginWithIdpParameter = {
103
+ idpId: IdentityProviderId;
104
+ idpClientId: string;
105
+ idpToken: string;
106
+ };
107
+ /**
108
+ * Login with external IdP
109
+ */
110
+ export type AuthWithIdpParameter = {
111
+ client_id: string;
112
+ client_secret: string;
113
+ } & LoginWithIdpParameter;
114
+ /**
115
+ * Successful token response
116
+ */
117
+ export interface AuthToken {
118
+ access_token: string;
119
+ token_type: "bearer";
120
+ expires_in: number;
121
+ scope?: Scope | Scope[];
122
+ refresh_token?: string;
123
+ }
124
+ /**
125
+ * Token introspection response
126
+ */
127
+ export interface TokenDetails {
128
+ "client-id": string;
129
+ exp: number;
130
+ scope: Scope[];
131
+ isLoggedInAs?: UUID | null;
132
+ }
133
+ /**
134
+ * Token response by endpoint
135
+ */
136
+ export type TokenResponse<T extends TokenRequest> = T extends DetailsRequest ? TokenDetails : AuthToken;
137
+ /**
138
+ * Revoke response
139
+ */
140
+ export interface RevokeResponse {
141
+ revoked: boolean;
142
+ }
143
+ /**
144
+ * Auth info response
145
+ */
146
+ export type AuthInfoResponse = {
147
+ scopes?: Scope[];
148
+ isAnonymous?: boolean;
149
+ grantType?: GrantType;
150
+ isLoggedInAs?: string;
151
+ };
152
+ export {};
@@ -0,0 +1,10 @@
1
+ import { InternalAxiosRequestConfig } from "axios";
2
+ /**
3
+ * Extended type for Axios internal request configuration to include a retry flag.
4
+ */
5
+ export type ExtendedInternalAxiosRequestConfig = InternalAxiosRequestConfig & {
6
+ /**
7
+ * Indicates whether the request has been retried.
8
+ */
9
+ _retry: boolean;
10
+ };
@@ -0,0 +1,99 @@
1
+ import UUID from "../sdkTypes/UUID";
2
+ import LatLng from "../sdkTypes/LatLng";
3
+ import Money from "../sdkTypes/Money";
4
+ import LatLngBounds from "../sdkTypes/LatLngBounds";
5
+ import BigDecimal from "../sdkTypes/BigDecimal";
6
+ import { Agent as HttpAgent } from "http";
7
+ import { Agent as HttpsAgent } from "https";
8
+ import { TokenStore } from "./store";
9
+ /**
10
+ * Supported SDK type classes.
11
+ */
12
+ type SdkTypeClass = typeof UUID | typeof LatLng | typeof Money | typeof LatLngBounds | typeof BigDecimal;
13
+ /**
14
+ * Supported SDK type instances.
15
+ */
16
+ type SdkTypeInstance = UUID | LatLng | Money | LatLngBounds | BigDecimal;
17
+ /**
18
+ * Represents application-specific types.
19
+ * `AppType` is set to `any` to allow flexibility.
20
+ */
21
+ type AppType = any;
22
+ /**
23
+ * Interface for handling type transformations between SDK and application-specific types.
24
+ * T represents the specific SDK type instance (e.g., UUID, Money)
25
+ * U represents the specific application type
26
+ */
27
+ export interface TypeHandler<T extends SdkTypeInstance = SdkTypeInstance, U = any> {
28
+ sdkType: SdkTypeClass;
29
+ appType: AppType;
30
+ /**
31
+ * Function to read and transform a specific SDK type instance into an application-specific type.
32
+ */
33
+ reader?: (value: T) => U;
34
+ /**
35
+ * Function to write and transform an application-specific type into a specific SDK type instance.
36
+ */
37
+ writer?: (value: U) => T;
38
+ /**
39
+ * Function to determine if a handler can process a specific key-value pair.
40
+ */
41
+ canHandle?: (args: {
42
+ key: string;
43
+ value: any;
44
+ }) => boolean;
45
+ }
46
+ /**
47
+ * Interface for SDK configuration settings.
48
+ */
49
+ export interface SdkConfig {
50
+ /**
51
+ * The client ID. Must be non-empty (enforced at runtime).
52
+ */
53
+ clientId: string;
54
+ /**
55
+ * The client secret (optional).
56
+ */
57
+ clientSecret?: string;
58
+ /**
59
+ * Base URL for the SDK. Should not end with '/' (enforced at runtime).
60
+ */
61
+ baseUrl?: string;
62
+ /**
63
+ * Base URL for asset CDN. Should not end with '/' (enforced at runtime).
64
+ */
65
+ assetCdnBaseUrl?: string;
66
+ /**
67
+ * SDK version (optional).
68
+ */
69
+ version?: string;
70
+ /**
71
+ * Token store for managing authentication tokens.
72
+ */
73
+ tokenStore?: TokenStore;
74
+ /**
75
+ * Whether to use secure connections.
76
+ */
77
+ secure?: boolean;
78
+ /**
79
+ * Whether to enable verbose mode for Transit serialization.
80
+ */
81
+ transitVerbose?: boolean;
82
+ /**
83
+ * Predefined authentication token.
84
+ */
85
+ authToken?: string;
86
+ /**
87
+ * Custom type handlers for transforming data.
88
+ */
89
+ typeHandlers?: TypeHandler<any, any>[];
90
+ /**
91
+ * Http Agent
92
+ */
93
+ httpAgent?: HttpAgent;
94
+ /**
95
+ * Https Agent
96
+ */
97
+ httpsAgent?: HttpsAgent;
98
+ }
99
+ export {};
@@ -1,62 +1,48 @@
1
1
  /**
2
2
  * @fileoverview Provides the AssetsApi class for interacting with the Sharetribe Asset Delivery API.
3
- * This class includes methods to retrieve assets by alias or version.
4
3
  *
5
- * For more information, refer to the Asset Delivery API reference:
6
- * https://www.sharetribe.com/api-reference/asset-delivery-api.html
4
+ * @see https://www.sharetribe.com/api-reference/asset-delivery-api.html
7
5
  */
6
+ import type { AxiosResponse } from "axios";
8
7
  import SharetribeSdk from "../../sdk";
9
- import { AxiosInstance, AxiosResponse } from "axios";
10
- import { AssetByAliasParameter, AssetByVersionParameter, AssetResponse, AssetsByAliasParameter, AssetsByVersionParameter } from "../../types/assets";
11
- /**
12
- * Class representing the Assets API for interacting with the Sharetribe Asset Delivery API.
13
- */
8
+ import { AssetByAliasParameter, AssetByVersionParameter, AssetResponse, AssetsByAliasParameter, AssetsByVersionParameter } from "../../types";
14
9
  declare class AssetsApi {
15
- axios: AxiosInstance;
16
- endpoint: string;
17
- headers: Record<string, string>;
18
- /**
19
- * Creates an instance of AssetsApi.
20
- *
21
- * @param {SharetribeSdk} sdk - The Sharetribe SDK instance for configuration and request handling.
22
- */
10
+ private readonly axios;
11
+ private readonly endpoint;
12
+ private readonly headers;
23
13
  constructor(sdk: SharetribeSdk);
24
14
  /**
25
- * Retrieves a single asset by alias.
15
+ * Fetch a single asset by alias (e.g. "latest")
26
16
  *
27
17
  * @template P
28
- * @param {P & AssetByAliasParameter} params - Parameters including alias and path for the asset.
29
- * @returns {Promise<AssetResponse<'assetByAlias', P>>} - A promise resolving to the asset response.
30
- * @throws {Error} If the path starts with a leading slash.
18
+ * @param {P & AssetByAliasParameter} params
19
+ * @returns {Promise<AxiosResponse<AssetResponse<"assetByAlias", P & AssetByAliasParameter>>>}
31
20
  */
32
- assetByAlias<P extends AssetByAliasParameter>(params: P): Promise<AxiosResponse<AssetResponse<"assetByAlias", P>>>;
21
+ assetByAlias<P extends AssetByAliasParameter>(params: P & AssetByAliasParameter): Promise<AxiosResponse<AssetResponse<"assetByAlias", P & AssetByAliasParameter>>>;
33
22
  /**
34
- * Retrieves multiple assets by alias.
23
+ * Fetch multiple assets by alias from the same directory
35
24
  *
36
25
  * @template P
37
- * @param {P & AssetsByAliasParameter} params - Parameters including alias and paths for the assets.
38
- * @returns {Promise<AssetResponse<'assetsByAlias', P>>} - A promise resolving to the assets response.
39
- * @throws {Error} If any path starts with a leading slash or if paths are empty.
26
+ * @param {P & AssetsByAliasParameter} params
27
+ * @returns {Promise<AxiosResponse<AssetResponse<"assetsByAlias", P & AssetsByAliasParameter>>>}
40
28
  */
41
- assetsByAlias<P extends AssetsByAliasParameter>(params: P): Promise<AxiosResponse<AssetResponse<"assetsByAlias", P>>>;
29
+ assetsByAlias<P extends AssetsByAliasParameter>(params: P & AssetsByAliasParameter): Promise<AxiosResponse<AssetResponse<"assetsByAlias", P & AssetsByAliasParameter>>>;
42
30
  /**
43
- * Retrieves a single asset by version.
31
+ * Fetch a single asset by version
44
32
  *
45
33
  * @template P
46
- * @param {P & AssetByVersionParameter} params - Parameters including version and path for the asset.
47
- * @returns {Promise<AssetResponse<'assetByVersion', P>>} - A promise resolving to the asset response.
48
- * @throws {Error} If the path starts with a leading slash.
34
+ * @param {P & AssetByVersionParameter} params
35
+ * @returns {Promise<AxiosResponse<AssetResponse<"assetByVersion", P & AssetByVersionParameter>>>}
49
36
  */
50
- assetByVersion<P extends AssetByVersionParameter>(params: P): Promise<AxiosResponse<AssetResponse<"assetByVersion", P>>>;
37
+ assetByVersion<P extends AssetByVersionParameter>(params: P & AssetByVersionParameter): Promise<AxiosResponse<AssetResponse<"assetByVersion", P & AssetByVersionParameter>>>;
51
38
  /**
52
- * Retrieves multiple assets by version.
39
+ * Fetch multiple assets by version from the same directory
53
40
  *
54
41
  * @template P
55
- * @param {P & AssetsByVersionParameter} params - Parameters including version and paths for the assets.
56
- * @returns {Promise<AssetResponse<'assetsByVersion', P>>} - A promise resolving to the assets response.
57
- * @throws {Error} If any path starts with a leading slash.
42
+ * @param {P & AssetsByVersionParameter} params
43
+ * @returns {Promise<AxiosResponse<AssetResponse<"assetsByVersion", P & AssetsByVersionParameter>>>}
58
44
  */
59
- assetsByVersion<P extends AssetsByVersionParameter>(params: P): Promise<AxiosResponse<AssetResponse<"assetsByVersion", P>>>;
45
+ assetsByVersion<P extends AssetsByVersionParameter>(params: P & AssetsByVersionParameter): Promise<AxiosResponse<AssetResponse<"assetsByVersion", P & AssetsByVersionParameter>>>;
60
46
  }
61
47
  export default AssetsApi;
62
48
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/assets/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,aAAa,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,aAAa,EACb,sBAAsB,EACtB,wBAAwB,EACzB,MAAM,oBAAoB,CAAC;AAyB5B;;GAEG;AACH,cAAM,SAAS;IACb,KAAK,EAAE,aAAa,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEhC;;;;OAIG;gBACS,GAAG,EAAE,aAAa;IAO9B;;;;;;;OAOG;IACG,YAAY,CAAC,CAAC,SAAS,qBAAqB,EAChD,MAAM,EAAE,CAAC,GACR,OAAO,CAAC,aAAa,CAAC,aAAa,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,CAAC;IAY3D;;;;;;;OAOG;IACG,aAAa,CAAC,CAAC,SAAS,sBAAsB,EAClD,MAAM,EAAE,CAAC,GACR,OAAO,CAAC,aAAa,CAAC,aAAa,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC,CAAC;IAmB5D;;;;;;;OAOG;IACG,cAAc,CAAC,CAAC,SAAS,uBAAuB,EACpD,MAAM,EAAE,CAAC,GACR,OAAO,CAAC,aAAa,CAAC,aAAa,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC,CAAC;IAY7D;;;;;;;OAOG;IACG,eAAe,CAAC,CAAC,SAAS,wBAAwB,EACtD,MAAM,EAAE,CAAC,GACR,OAAO,CAAC,aAAa,CAAC,aAAa,CAAC,iBAAiB,EAAE,CAAC,CAAC,CAAC,CAAC;CAe/D;AAED,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/assets/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAgB,aAAa,EAAC,MAAM,OAAO,CAAC;AACxD,OAAO,aAAa,MAAM,WAAW,CAAC;AACtC,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,aAAa,EACb,sBAAsB,EACtB,wBAAwB,EACzB,MAAM,aAAa,CAAC;AA8BrB,cAAM,SAAS;IACb,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAgB;IACtC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAyB;gBAErC,GAAG,EAAE,aAAa;IAO9B;;;;;;OAMG;IACG,YAAY,CAAC,CAAC,SAAS,qBAAqB,EAChD,MAAM,EAAE,CAAC,GAAG,qBAAqB,GAChC,OAAO,CAAC,aAAa,CAAC,aAAa,CAAC,cAAc,EAAE,CAAC,GAAG,qBAAqB,CAAC,CAAC,CAAC;IAQnF;;;;;;OAMG;IACG,aAAa,CAAC,CAAC,SAAS,sBAAsB,EAClD,MAAM,EAAE,CAAC,GAAG,sBAAsB,GACjC,OAAO,CAAC,aAAa,CAAC,aAAa,CAAC,eAAe,EAAE,CAAC,GAAG,sBAAsB,CAAC,CAAC,CAAC;IAerF;;;;;;OAMG;IACG,cAAc,CAAC,CAAC,SAAS,uBAAuB,EACpD,MAAM,EAAE,CAAC,GAAG,uBAAuB,GAClC,OAAO,CAAC,aAAa,CAAC,aAAa,CAAC,gBAAgB,EAAE,CAAC,GAAG,uBAAuB,CAAC,CAAC,CAAC;IAQvF;;;;;;OAMG;IACG,eAAe,CAAC,CAAC,SAAS,wBAAwB,EACtD,MAAM,EAAE,CAAC,GAAG,wBAAwB,GACnC,OAAO,CAAC,aAAa,CAAC,aAAa,CAAC,iBAAiB,EAAE,CAAC,GAAG,wBAAwB,CAAC,CAAC,CAAC;CAc1F;AAED,eAAe,SAAS,CAAC"}
@@ -1,67 +1,46 @@
1
1
  /**
2
- * @fileoverview Provides the AuthenticationApi class for interacting with the Sharetribe Authentication API.
3
- * This class includes methods to obtain and manage access tokens for authenticating requests to the Marketplace API and Integration API.
2
+ * @fileoverview Client for Sharetribe Authentication API (OAuth2)
4
3
  *
5
- * For more information, refer to the Authentication API reference:
6
- * https://www.sharetribe.com/api-reference/authentication.html
4
+ * @see https://www.sharetribe.com/api-reference/authentication.html
7
5
  */
8
- import { AuthWithIdpParameter, Endpoint, RevokeResponse, ScopeType, TokenResponse } from "../../types/authentication";
9
- import { AxiosResponse } from "axios";
6
+ import type { AxiosResponse } from "axios";
10
7
  import SharetribeSdk from "../../sdk";
11
8
  import IntegrationSdk from "../../integrationSdk";
9
+ import { AuthWithIdpParameter, RevokeResponse, TokenDetails, TokenRequest, TokenResponse, UserTokenRequest } from "../../types";
12
10
  /**
13
- * Converts an object to URL-encoded form data string.
14
- * Properly handles nested objects, arrays, and special types.
15
- *
16
- * @param {Record<string, any> | void} obj - The object to convert
17
- * @returns {string} URL-encoded form data string
18
- */
19
- export declare function urlEncodeFormData(obj: Record<string, any> | null | undefined | void): string;
20
- /**
21
- * Class representing the Authentication API for obtaining and managing access tokens.
22
- *
23
- * The Authentication API follows the OAuth2 framework and supports various grant types to issue tokens for authenticating requests.
24
- *
25
- * @see https://www.sharetribe.com/api-reference/authentication.html
11
+ * Encodes object as application/x-www-form-urlencoded
26
12
  */
13
+ export declare const urlEncodeFormData: (obj: Record<string, any> | null) => string;
27
14
  declare class AuthenticationApi {
15
+ private readonly axios;
28
16
  private readonly endpoint;
29
17
  private readonly headers;
30
- private axios;
31
- /**
32
- * Creates an instance of AuthenticationApi.
33
- *
34
- * @param {SharetribeSdk | IntegrationSdk} sdk - The Sharetribe SDK or Integration SDK instance for configuration and request handling.
35
- */
36
18
  constructor(sdk: SharetribeSdk | IntegrationSdk);
37
19
  /**
38
- * Obtains an access token using the specified grant type and parameters.
20
+ * Request a token using any supported OAuth2 grant
39
21
  *
40
- * @template S
41
- * @param {Endpoint<S>} params - Parameters including grant type and necessary credentials.
42
- * @returns {Promise<TokenResponse<S>>} - A promise resolving to the token response.
22
+ * @template T - Token request type
23
+ * @param {T} params - OAuth2 token request parameters
24
+ * @returns {Promise<AxiosResponse<TokenResponse<T>>>}
43
25
  */
44
- token<S extends ScopeType>(params: Endpoint<S>): Promise<AxiosResponse<TokenResponse<S>>>;
26
+ token<T extends TokenRequest>(params: T): Promise<AxiosResponse<TokenResponse<T>>>;
45
27
  /**
46
- * Authenticates a user using an external identity provider (IdP) and obtains an access token.
28
+ * Authenticate via external Identity Provider
47
29
  *
48
- * @param {AuthWithIdpParameter} params - Parameters including IdP token and provider details.
49
- * @returns {Promise<TokenResponse<'user'>>} - A promise resolving to the token response.
30
+ * @param {AuthWithIdpParameter} params
31
+ * @returns {Promise<AxiosResponse<TokenResponse<UserTokenRequest>>>}
50
32
  */
51
- authWithIdp<P extends AuthWithIdpParameter>(params: P): Promise<AxiosResponse<TokenResponse<"user">>>;
33
+ authWithIdp(params: AuthWithIdpParameter): Promise<AxiosResponse<TokenResponse<UserTokenRequest>>>;
52
34
  /**
53
- * Revokes a refresh token, effectively invalidating any associated access tokens.
35
+ * Revoke a refresh token
54
36
  *
55
- * @param {string} token - The refresh token to be revoked.
56
- * @returns {Promise<RevokeResponse>} - A promise resolving to the revoke response.
37
+ * @param {string} token - Refresh token to revoke
57
38
  */
58
39
  revoke(token: string): Promise<AxiosResponse<RevokeResponse>>;
59
40
  /**
60
- * Retrieves details about the current access token.
61
- *
62
- * @returns {Promise<TokenResponse<'details'>>} - A promise resolving to the token details response.
41
+ * Introspect current access token
63
42
  */
64
- details(): Promise<AxiosResponse<TokenResponse<"details">>>;
43
+ details(): Promise<AxiosResponse<TokenDetails>>;
65
44
  }
66
45
  export default AuthenticationApi;
67
46
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/auth/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,oBAAoB,EACpB,QAAQ,EACR,cAAc,EACd,SAAS,EACT,aAAa,EACd,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAiB,aAAa,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,aAAa,MAAM,WAAW,CAAC;AACtC,OAAO,cAAc,MAAM,sBAAsB,CAAC;AAElD;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,GACjD,MAAM,CAiCR;AAED;;;;;;GAMG;AACH,cAAM,iBAAiB;IACrB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAyB;IACjD,OAAO,CAAC,KAAK,CAAgB;IAE7B;;;;OAIG;gBACS,GAAG,EAAE,aAAa,GAAG,cAAc;IAO/C;;;;;;OAMG;IACG,KAAK,CAAC,CAAC,SAAS,SAAS,EAC7B,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,GAClB,OAAO,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;IAQ3C;;;;;OAKG;IACG,WAAW,CAAC,CAAC,SAAS,oBAAoB,EAC9C,MAAM,EAAE,CAAC,GACR,OAAO,CAAC,aAAa,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;IAQhD;;;;;OAKG;IACG,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC;IAQnE;;;;OAIG;IACG,OAAO,IAAI,OAAO,CAAC,aAAa,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC;CAMlE;AAED,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/auth/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAgB,aAAa,EAAC,MAAM,OAAO,CAAC;AACxD,OAAO,aAAa,MAAM,WAAW,CAAC;AACtC,OAAO,cAAc,MAAM,sBAAsB,CAAC;AAClD,OAAO,EACL,oBAAoB,EACpB,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,gBAAgB,EACjB,MAAM,aAAa,CAAC;AAErB;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAAI,KAAK,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,KAAG,MAenE,CAAC;AAEF,cAAM,iBAAiB;IACrB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAgB;IACtC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAyB;gBAErC,GAAG,EAAE,aAAa,GAAG,cAAc;IAO/C;;;;;;OAMG;IACG,KAAK,CAAC,CAAC,SAAS,YAAY,EAChC,MAAM,EAAE,CAAC,GACR,OAAO,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;IAQ3C;;;;;OAKG;IACG,WAAW,CACf,MAAM,EAAE,oBAAoB,GAC3B,OAAO,CAAC,aAAa,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAQ1D;;;;OAIG;IACG,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC;IAQnE;;OAEG;IACG,OAAO,IAAI,OAAO,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;CAKtD;AAED,eAAe,iBAAiB,CAAC"}