@vansite/ts-sharetribe-flex-sdk 1.0.34 → 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.
- package/README.md +1 -1
- package/dist/endpoints/assets/index.d.ts +47 -0
- package/dist/endpoints/auth/index.d.ts +45 -0
- package/dist/endpoints/integrationApi/AvailabilityExceptions.d.ts +66 -0
- package/dist/endpoints/integrationApi/Events.d.ts +43 -0
- package/dist/endpoints/integrationApi/Images.d.ts +36 -0
- package/dist/endpoints/integrationApi/Listings.d.ts +87 -0
- package/dist/endpoints/integrationApi/Marketplace.d.ts +30 -0
- package/dist/endpoints/integrationApi/Stock.d.ts +42 -0
- package/dist/endpoints/integrationApi/StockAdjustments.d.ts +64 -0
- package/dist/{types/endpoints/integrationApi/StockReservation.d.ts → endpoints/integrationApi/StockReservations.d.ts} +3 -4
- package/dist/endpoints/integrationApi/Transactions.d.ts +76 -0
- package/dist/endpoints/integrationApi/Users.d.ts +72 -0
- package/dist/endpoints/integrationApi/index.d.ts +58 -0
- package/dist/endpoints/marketplace/AvailabilityExceptions.d.ts +69 -0
- package/dist/endpoints/marketplace/Bookings.d.ts +45 -0
- package/dist/endpoints/marketplace/CurrentUser.d.ts +110 -0
- package/dist/endpoints/marketplace/Images.d.ts +38 -0
- package/dist/endpoints/marketplace/Listings.d.ts +52 -0
- package/dist/endpoints/marketplace/Marketplace.d.ts +33 -0
- package/dist/endpoints/marketplace/Messages.d.ts +51 -0
- package/dist/endpoints/marketplace/OwnListings.d.ts +116 -0
- package/dist/endpoints/marketplace/PasswordReset.d.ts +50 -0
- package/dist/endpoints/marketplace/ProcessTransitions.d.ts +42 -0
- package/dist/endpoints/marketplace/Reviews.d.ts +49 -0
- package/dist/endpoints/marketplace/Stock.d.ts +50 -0
- package/dist/endpoints/marketplace/StockAdjustments.d.ts +64 -0
- package/dist/endpoints/marketplace/StripeAccount.d.ts +56 -0
- package/dist/endpoints/marketplace/StripeAccountLinks.d.ts +42 -0
- package/dist/endpoints/marketplace/StripeCustomer.d.ts +62 -0
- package/dist/endpoints/marketplace/StripePersons.d.ts +37 -0
- package/dist/endpoints/marketplace/StripeSetupIntents.d.ts +42 -0
- package/dist/endpoints/marketplace/TimeSlots.d.ts +40 -0
- package/dist/endpoints/marketplace/Transactions.d.ts +89 -0
- package/dist/endpoints/marketplace/Users.d.ts +34 -0
- package/dist/endpoints/marketplace/index.d.ts +80 -0
- package/dist/index.d.ts +161 -0
- package/dist/index.js +3 -0
- package/dist/{ts-sharetribe-flex-sdk.cjs.LICENSE.txt → index.js.LICENSE.txt} +13 -5
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +3 -0
- package/dist/{ts-sharetribe-flex-sdk.js.LICENSE.txt → index.mjs.LICENSE.txt} +13 -5
- package/dist/index.mjs.map +1 -0
- package/dist/index.umd.js +3 -0
- package/dist/{ts-sharetribe-flex-sdk.mjs.LICENSE.txt → index.umd.js.LICENSE.txt} +13 -5
- package/dist/index.umd.js.map +1 -0
- package/dist/integrationSdk.d.ts +119 -0
- package/dist/sdk.d.ts +211 -0
- package/dist/sdkTypes/BigDecimal.d.ts +30 -0
- package/dist/sdkTypes/LatLng.d.ts +34 -0
- package/dist/sdkTypes/LatLngBounds.d.ts +51 -0
- package/dist/sdkTypes/Money.d.ts +28 -0
- package/dist/sdkTypes/UUID.d.ts +38 -0
- package/dist/types/apiConfigs.d.ts +104 -0
- package/dist/types/assets/index.d.ts +101 -0
- package/dist/types/authentication/index.d.ts +152 -0
- package/dist/types/axios.d.ts +10 -0
- package/dist/types/config.d.ts +99 -0
- package/dist/types/endpoints/assets/index.d.ts +22 -36
- package/dist/types/endpoints/assets/index.d.ts.map +1 -1
- package/dist/types/endpoints/auth/index.d.ts +20 -41
- package/dist/types/endpoints/auth/index.d.ts.map +1 -1
- package/dist/types/endpoints/integrationApi/AvailabilityExceptions.d.ts +30 -49
- package/dist/types/endpoints/integrationApi/AvailabilityExceptions.d.ts.map +1 -1
- package/dist/types/endpoints/integrationApi/Events.d.ts +23 -27
- package/dist/types/endpoints/integrationApi/Events.d.ts.map +1 -1
- package/dist/types/endpoints/integrationApi/Images.d.ts +17 -28
- package/dist/types/endpoints/integrationApi/Images.d.ts.map +1 -1
- package/dist/types/endpoints/integrationApi/Listings.d.ts +42 -104
- package/dist/types/endpoints/integrationApi/Listings.d.ts.map +1 -1
- package/dist/types/endpoints/integrationApi/Marketplace.d.ts +12 -20
- package/dist/types/endpoints/integrationApi/Marketplace.d.ts.map +1 -1
- package/dist/types/endpoints/integrationApi/Stock.d.ts +22 -28
- package/dist/types/endpoints/integrationApi/Stock.d.ts.map +1 -1
- package/dist/types/endpoints/integrationApi/StockAdjustments.d.ts +35 -35
- package/dist/types/endpoints/integrationApi/StockAdjustments.d.ts.map +1 -1
- package/dist/types/endpoints/integrationApi/StockReservations.d.ts +43 -0
- package/dist/types/endpoints/integrationApi/StockReservations.d.ts.map +1 -0
- package/dist/types/endpoints/integrationApi/Transactions.d.ts +36 -80
- package/dist/types/endpoints/integrationApi/Transactions.d.ts.map +1 -1
- package/dist/types/endpoints/integrationApi/Users.d.ts +35 -70
- package/dist/types/endpoints/integrationApi/Users.d.ts.map +1 -1
- package/dist/types/endpoints/integrationApi/index.d.ts +40 -40
- package/dist/types/endpoints/integrationApi/index.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/AvailabilityExceptions.d.ts +34 -48
- package/dist/types/endpoints/marketplace/AvailabilityExceptions.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/Bookings.d.ts +24 -23
- package/dist/types/endpoints/marketplace/Bookings.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/CurrentUser.d.ts +54 -125
- package/dist/types/endpoints/marketplace/CurrentUser.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/Images.d.ts +19 -27
- package/dist/types/endpoints/marketplace/Images.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/Listings.d.ts +26 -25
- package/dist/types/endpoints/marketplace/Listings.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/Marketplace.d.ts +15 -19
- package/dist/types/endpoints/marketplace/Marketplace.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/Messages.d.ts +24 -29
- package/dist/types/endpoints/marketplace/Messages.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/OwnListings.d.ts +55 -119
- package/dist/types/endpoints/marketplace/OwnListings.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/PasswordReset.d.ts +23 -35
- package/dist/types/endpoints/marketplace/PasswordReset.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/ProcessTransitions.d.ts +22 -22
- package/dist/types/endpoints/marketplace/ProcessTransitions.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/Reviews.d.ts +23 -25
- package/dist/types/endpoints/marketplace/Reviews.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/Stock.d.ts +30 -26
- package/dist/types/endpoints/marketplace/Stock.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/StockAdjustments.d.ts +36 -34
- package/dist/types/endpoints/marketplace/StockAdjustments.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/StripeAccount.d.ts +28 -49
- package/dist/types/endpoints/marketplace/StripeAccount.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/StripeAccountLinks.d.ts +22 -31
- package/dist/types/endpoints/marketplace/StripeAccountLinks.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/StripeCustomer.d.ts +32 -46
- package/dist/types/endpoints/marketplace/StripeCustomer.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/StripePersons.d.ts +17 -25
- package/dist/types/endpoints/marketplace/StripePersons.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/StripeSetupIntents.d.ts +24 -24
- package/dist/types/endpoints/marketplace/StripeSetupIntents.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/TimeSlots.d.ts +20 -23
- package/dist/types/endpoints/marketplace/TimeSlots.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/Transactions.d.ts +45 -81
- package/dist/types/endpoints/marketplace/Transactions.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/Users.d.ts +15 -22
- package/dist/types/endpoints/marketplace/Users.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/index.d.ts +50 -40
- package/dist/types/endpoints/marketplace/index.d.ts.map +1 -1
- package/dist/types/index.d.ts +15 -30
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/integration/events.d.ts +87 -0
- package/dist/types/integrationSdk.d.ts +4 -5
- package/dist/types/integrationSdk.d.ts.map +1 -1
- package/dist/types/marketplace/availabilityExceptions.d.ts +99 -0
- package/dist/types/marketplace/availabilityPlan.d.ts +17 -0
- package/dist/types/marketplace/bookings.d.ts +80 -0
- package/dist/types/marketplace/currentUser.d.ts +202 -0
- package/dist/types/marketplace/images.d.ts +65 -0
- package/dist/types/marketplace/listings.d.ts +169 -0
- package/dist/types/marketplace/marketplace.d.ts +30 -0
- package/dist/types/marketplace/messages.d.ts +87 -0
- package/dist/types/marketplace/ownListings.d.ts +155 -0
- package/dist/types/marketplace/passwordReset.d.ts +54 -0
- package/dist/types/marketplace/processTransitions.d.ts +56 -0
- package/dist/types/marketplace/reviews.d.ts +108 -0
- package/dist/types/marketplace/stock.d.ts +45 -0
- package/dist/types/marketplace/stockAdjustment.d.ts +97 -0
- package/dist/types/marketplace/stockReservations.d.ts +89 -0
- package/dist/types/marketplace/stripeAccount.d.ts +67 -0
- package/dist/types/marketplace/stripeAccountLinks.d.ts +55 -0
- package/dist/types/marketplace/stripeCustomer.d.ts +94 -0
- package/dist/types/marketplace/stripePaymentMethod.d.ts +21 -0
- package/dist/types/marketplace/stripePersons.d.ts +48 -0
- package/dist/types/marketplace/stripeSetupIntents.d.ts +48 -0
- package/dist/types/marketplace/timeSlots.d.ts +51 -0
- package/dist/types/marketplace/transactions.d.ts +200 -0
- package/dist/types/marketplace/user.d.ts +200 -0
- package/dist/types/sdk-types.d.ts +10 -0
- package/dist/types/sdk.d.ts +6 -7
- package/dist/types/sdk.d.ts.map +1 -1
- package/dist/types/sdkTypes/BigDecimal.d.ts +1 -1
- package/dist/types/sdkTypes/BigDecimal.d.ts.map +1 -1
- package/dist/types/sdkTypes/LatLng.d.ts +1 -1
- package/dist/types/sdkTypes/LatLng.d.ts.map +1 -1
- package/dist/types/sdkTypes/LatLngBounds.d.ts +1 -1
- package/dist/types/sdkTypes/LatLngBounds.d.ts.map +1 -1
- package/dist/types/sdkTypes/Money.d.ts +1 -1
- package/dist/types/sdkTypes/Money.d.ts.map +1 -1
- package/dist/types/sdkTypes/UUID.d.ts +1 -1
- package/dist/types/sdkTypes/UUID.d.ts.map +1 -1
- package/dist/types/sharetribe.d.ts +227 -0
- package/dist/types/store.d.ts +22 -0
- package/dist/types/types/apiConfigs.d.ts.map +1 -1
- package/dist/types/types/assets/index.d.ts +74 -36
- package/dist/types/types/assets/index.d.ts.map +1 -1
- package/dist/types/types/authentication/index.d.ts +111 -60
- package/dist/types/types/authentication/index.d.ts.map +1 -1
- package/dist/types/types/axios.d.ts.map +1 -1
- package/dist/types/types/config.d.ts +1 -39
- package/dist/types/types/config.d.ts.map +1 -1
- package/dist/types/types/integration/events.d.ts +52 -20
- package/dist/types/types/integration/events.d.ts.map +1 -1
- package/dist/types/types/marketplace/availabilityExceptions.d.ts +59 -16
- package/dist/types/types/marketplace/availabilityExceptions.d.ts.map +1 -1
- package/dist/types/types/marketplace/availabilityPlan.d.ts +18 -0
- package/dist/types/types/marketplace/availabilityPlan.d.ts.map +1 -0
- package/dist/types/types/marketplace/bookings.d.ts +48 -14
- package/dist/types/types/marketplace/bookings.d.ts.map +1 -1
- package/dist/types/types/marketplace/currentUser.d.ts +99 -55
- package/dist/types/types/marketplace/currentUser.d.ts.map +1 -1
- package/dist/types/types/marketplace/images.d.ts +40 -14
- package/dist/types/types/marketplace/images.d.ts.map +1 -1
- package/dist/types/types/marketplace/listings.d.ts +96 -66
- package/dist/types/types/marketplace/listings.d.ts.map +1 -1
- package/dist/types/types/marketplace/marketplace.d.ts +16 -6
- package/dist/types/types/marketplace/marketplace.d.ts.map +1 -1
- package/dist/types/types/marketplace/messages.d.ts +53 -15
- package/dist/types/types/marketplace/messages.d.ts.map +1 -1
- package/dist/types/types/marketplace/ownListings.d.ts +92 -65
- package/dist/types/types/marketplace/ownListings.d.ts.map +1 -1
- package/dist/types/types/marketplace/passwordReset.d.ts +32 -9
- package/dist/types/types/marketplace/passwordReset.d.ts.map +1 -1
- package/dist/types/types/marketplace/processTransitions.d.ts +33 -14
- package/dist/types/types/marketplace/processTransitions.d.ts.map +1 -1
- package/dist/types/types/marketplace/reviews.d.ts +72 -23
- package/dist/types/types/marketplace/reviews.d.ts.map +1 -1
- package/dist/types/types/marketplace/stock.d.ts +23 -6
- package/dist/types/types/marketplace/stock.d.ts.map +1 -1
- package/dist/types/types/marketplace/stockAdjustment.d.ts +60 -14
- package/dist/types/types/marketplace/stockAdjustment.d.ts.map +1 -1
- package/dist/types/types/marketplace/stockReservations.d.ts +59 -14
- package/dist/types/types/marketplace/stockReservations.d.ts.map +1 -1
- package/dist/types/types/marketplace/stripeAccount.d.ts +28 -5
- package/dist/types/types/marketplace/stripeAccount.d.ts.map +1 -1
- package/dist/types/types/marketplace/stripeAccountLinks.d.ts +26 -6
- package/dist/types/types/marketplace/stripeAccountLinks.d.ts.map +1 -1
- package/dist/types/types/marketplace/stripeCustomer.d.ts +60 -13
- package/dist/types/types/marketplace/stripeCustomer.d.ts.map +1 -1
- package/dist/types/types/marketplace/stripePaymentMethod.d.ts +1 -2
- package/dist/types/types/marketplace/stripePaymentMethod.d.ts.map +1 -1
- package/dist/types/types/marketplace/stripePersons.d.ts +17 -15
- package/dist/types/types/marketplace/stripePersons.d.ts.map +1 -1
- package/dist/types/types/marketplace/stripeSetupIntents.d.ts +16 -14
- package/dist/types/types/marketplace/stripeSetupIntents.d.ts.map +1 -1
- package/dist/types/types/marketplace/timeSlots.d.ts +13 -15
- package/dist/types/types/marketplace/timeSlots.d.ts.map +1 -1
- package/dist/types/types/marketplace/transactions.d.ts +77 -83
- package/dist/types/types/marketplace/transactions.d.ts.map +1 -1
- package/dist/types/types/marketplace/user.d.ts +85 -64
- package/dist/types/types/marketplace/user.d.ts.map +1 -1
- package/dist/types/types/sharetribe.d.ts +130 -92
- package/dist/types/types/sharetribe.d.ts.map +1 -1
- package/dist/types/types/store.d.ts +3 -14
- package/dist/types/types/store.d.ts.map +1 -1
- package/dist/types/utils/apis.d.ts +1 -1
- package/dist/types/utils/apis.d.ts.map +1 -1
- package/dist/types/utils/config.d.ts.map +1 -1
- package/dist/types/utils/prepare-axios-instance.d.ts.map +1 -1
- package/dist/types/utils/stores/BrowserStore.d.ts +1 -2
- package/dist/types/utils/stores/BrowserStore.d.ts.map +1 -1
- package/dist/types/utils/stores/ExpressStore.d.ts +6 -7
- package/dist/types/utils/stores/ExpressStore.d.ts.map +1 -1
- package/dist/types/utils/stores/MemoryStore.d.ts +1 -2
- package/dist/types/utils/stores/MemoryStore.d.ts.map +1 -1
- package/dist/types/utils/transit.d.ts +1 -1
- package/dist/types/utils/transit.d.ts.map +1 -1
- package/dist/types/utils/util.d.ts +2 -2
- package/dist/types/utils/util.d.ts.map +1 -1
- package/dist/utils/apis.d.ts +8 -0
- package/dist/utils/config.d.ts +32 -0
- package/dist/utils/convert-types.d.ts +13 -0
- package/dist/utils/parameter-serializer.d.ts +23 -0
- package/dist/utils/prepare-axios-instance.d.ts +14 -0
- package/dist/utils/stores/BrowserStore.d.ts +37 -0
- package/dist/utils/stores/ExpressStore.d.ts +48 -0
- package/dist/utils/stores/MemoryStore.d.ts +23 -0
- package/dist/utils/stores/store.d.ts +8 -0
- package/dist/utils/transit.d.ts +28 -0
- package/dist/utils/util.d.ts +15 -0
- package/package.json +16 -14
- package/dist/ts-sharetribe-flex-sdk.cjs +0 -3
- package/dist/ts-sharetribe-flex-sdk.cjs.map +0 -1
- package/dist/ts-sharetribe-flex-sdk.js +0 -3
- package/dist/ts-sharetribe-flex-sdk.js.map +0 -1
- package/dist/ts-sharetribe-flex-sdk.mjs +0 -3
- package/dist/ts-sharetribe-flex-sdk.mjs.map +0 -1
- package/dist/types/endpoints/integrationApi/StockReservation.d.ts.map +0 -1
|
@@ -1,84 +1,70 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @fileoverview
|
|
3
|
-
* This class allows querying, creating, and deleting availability exceptions for listings.
|
|
2
|
+
* @fileoverview Client for managing availability exceptions in the Sharetribe Marketplace API.
|
|
4
3
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Availability exceptions allow users to block or open specific time ranges on their listings,
|
|
5
|
+
* overriding the default availability plan (e.g. closing for holidays, maintenance, or personal use).
|
|
6
|
+
*
|
|
7
|
+
* @see https://www.sharetribe.com/api-reference/marketplace.html#availability-exceptions
|
|
7
8
|
*/
|
|
8
|
-
import { AxiosResponse } from "axios";
|
|
9
|
+
import type { AxiosResponse } from "axios";
|
|
9
10
|
import MarketplaceApi from "./index";
|
|
10
|
-
import { AvailabilityExceptionsCreateParameter, AvailabilityExceptionsDeleteParameter, AvailabilityExceptionsQueryParameter, AvailabilityExceptionsResponse } from "../../types
|
|
11
|
-
import { ExtraParameter } from "../../types/sharetribe";
|
|
11
|
+
import { AvailabilityExceptionsCreateParameter, AvailabilityExceptionsDeleteParameter, AvailabilityExceptionsQueryParameter, AvailabilityExceptionsResponse, ExtraParameter } from "../../types";
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* The AvailabilityExceptions API provides methods to manage availability exceptions for listings, such as querying existing exceptions, creating new ones, and deleting them.
|
|
13
|
+
* Availability Exceptions API client (own listings only)
|
|
16
14
|
*/
|
|
17
15
|
declare class AvailabilityExceptions {
|
|
18
|
-
|
|
16
|
+
readonly authRequired = true;
|
|
19
17
|
private readonly axios;
|
|
18
|
+
private readonly endpoint;
|
|
20
19
|
private readonly headers;
|
|
21
|
-
readonly authRequired = true;
|
|
22
|
-
/**
|
|
23
|
-
* Creates an instance of the AvailabilityExceptions class.
|
|
24
|
-
*
|
|
25
|
-
* @param {MarketplaceApi} api - The Marketplace API instance providing configuration and request handling.
|
|
26
|
-
*/
|
|
27
20
|
constructor(api: MarketplaceApi);
|
|
28
21
|
/**
|
|
29
|
-
*
|
|
22
|
+
* Query your own availability exceptions
|
|
30
23
|
*
|
|
31
24
|
* @template P
|
|
32
|
-
* @param {P & AvailabilityExceptionsQueryParameter} params
|
|
33
|
-
* @returns {Promise<AxiosResponse<AvailabilityExceptionsResponse<
|
|
25
|
+
* @param {P & AvailabilityExceptionsQueryParameter} params
|
|
26
|
+
* @returns {Promise<AxiosResponse<AvailabilityExceptionsResponse<"query", P>>>}
|
|
34
27
|
*
|
|
35
28
|
* @example
|
|
36
|
-
* const
|
|
37
|
-
* listingId:
|
|
38
|
-
* start:
|
|
39
|
-
* end:
|
|
29
|
+
* const { data } = await sdk.availabilityExceptions.query({
|
|
30
|
+
* listingId: "listing-abc123",
|
|
31
|
+
* start: "2025-12-01",
|
|
32
|
+
* end: "2025-12-31"
|
|
40
33
|
* });
|
|
41
|
-
*
|
|
42
|
-
* const exceptions = response.data;
|
|
43
34
|
*/
|
|
44
35
|
query<P extends AvailabilityExceptionsQueryParameter>(params: P): Promise<AxiosResponse<AvailabilityExceptionsResponse<"query", P>>>;
|
|
45
36
|
/**
|
|
46
|
-
*
|
|
37
|
+
* Create a new availability exception (e.g. block dates)
|
|
47
38
|
*
|
|
48
39
|
* @template P
|
|
49
40
|
* @template EP
|
|
50
|
-
* @param {P & AvailabilityExceptionsCreateParameter} params
|
|
51
|
-
* @param {EP
|
|
52
|
-
* @returns {Promise<AxiosResponse<AvailabilityExceptionsResponse<
|
|
41
|
+
* @param {P & AvailabilityExceptionsCreateParameter} params
|
|
42
|
+
* @param {EP} [extraParams] - Optional extra parameters (e.g. `expand: true`)
|
|
43
|
+
* @returns {Promise<AxiosResponse<AvailabilityExceptionsResponse<"create", P, EP>>>}
|
|
53
44
|
*
|
|
54
45
|
* @example
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
46
|
+
* // Block Christmas day
|
|
47
|
+
* await sdk.availabilityExceptions.create({
|
|
48
|
+
* listingId: "listing-abc123",
|
|
49
|
+
* start: "2025-12-25T00:00:00Z",
|
|
50
|
+
* end: "2025-12-26T00:00:00Z",
|
|
51
|
+
* seats: 0
|
|
60
52
|
* });
|
|
61
|
-
*
|
|
62
|
-
* const newException = response.data;
|
|
63
53
|
*/
|
|
64
|
-
create<P extends AvailabilityExceptionsCreateParameter, EP extends ExtraParameter>(params: P, extraParams?: EP): Promise<AxiosResponse<AvailabilityExceptionsResponse<"create", P, EP>>>;
|
|
54
|
+
create<P extends AvailabilityExceptionsCreateParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<AvailabilityExceptionsResponse<"create", P, EP>>>;
|
|
65
55
|
/**
|
|
66
|
-
*
|
|
56
|
+
* Delete an availability exception
|
|
67
57
|
*
|
|
68
58
|
* @template P
|
|
69
59
|
* @template EP
|
|
70
|
-
* @param {P & AvailabilityExceptionsDeleteParameter} params
|
|
71
|
-
* @param {EP
|
|
72
|
-
* @returns {Promise<AxiosResponse<AvailabilityExceptionsResponse<
|
|
60
|
+
* @param {P & AvailabilityExceptionsDeleteParameter} params
|
|
61
|
+
* @param {EP} [extraParams]
|
|
62
|
+
* @returns {Promise<AxiosResponse<AvailabilityExceptionsResponse<"delete", P, EP>>>}
|
|
73
63
|
*
|
|
74
64
|
* @example
|
|
75
|
-
*
|
|
76
|
-
* id: 'exception-id',
|
|
77
|
-
* });
|
|
78
|
-
*
|
|
79
|
-
* const deletionResult = response.data;
|
|
65
|
+
* await sdk.availabilityExceptions.delete({ id: "exc-456def" });
|
|
80
66
|
*/
|
|
81
|
-
delete<P extends AvailabilityExceptionsDeleteParameter, EP extends ExtraParameter>(params: P, extraParams?: EP): Promise<AxiosResponse<AvailabilityExceptionsResponse<"delete", P, EP>>>;
|
|
67
|
+
delete<P extends AvailabilityExceptionsDeleteParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<AvailabilityExceptionsResponse<"delete", P, EP>>>;
|
|
82
68
|
}
|
|
83
69
|
export default AvailabilityExceptions;
|
|
84
70
|
//# sourceMappingURL=AvailabilityExceptions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvailabilityExceptions.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/marketplace/AvailabilityExceptions.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"AvailabilityExceptions.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/marketplace/AvailabilityExceptions.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAgB,aAAa,EAAC,MAAM,OAAO,CAAC;AACxD,OAAO,cAAc,MAAM,SAAS,CAAC;AACrC,OAAO,EACL,qCAAqC,EACrC,qCAAqC,EACrC,oCAAoC,EACpC,8BAA8B,EAC9B,cAAc,EACf,MAAM,aAAa,CAAC;AAErB;;GAEG;AACH,cAAM,sBAAsB;IAC1B,SAAgB,YAAY,QAAQ;IACpC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAgB;IACtC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAyB;gBAErC,GAAG,EAAE,cAAc;IAM/B;;;;;;;;;;;;;OAaG;IACG,KAAK,CAAC,CAAC,SAAS,oCAAoC,EACxD,MAAM,EAAE,CAAC,GACR,OAAO,CAAC,aAAa,CAAC,8BAA8B,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;IAOrE;;;;;;;;;;;;;;;;;OAiBG;IACG,MAAM,CACV,CAAC,SAAS,qCAAqC,EAC/C,EAAE,SAAS,cAAc,GAAG,SAAS,GAAG,SAAS,EAEjD,MAAM,EAAE,CAAC,EACT,WAAW,CAAC,EAAE,EAAE,GACf,OAAO,CAAC,aAAa,CAAC,8BAA8B,CAAC,QAAQ,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IAQ1E;;;;;;;;;;;OAWG;IACG,MAAM,CACV,CAAC,SAAS,qCAAqC,EAC/C,EAAE,SAAS,cAAc,GAAG,SAAS,GAAG,SAAS,EAEjD,MAAM,EAAE,CAAC,EACT,WAAW,CAAC,EAAE,EAAE,GACf,OAAO,CAAC,aAAa,CAAC,8BAA8B,CAAC,QAAQ,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;CAO3E;AAED,eAAe,sBAAsB,CAAC"}
|
|
@@ -1,43 +1,44 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @fileoverview
|
|
3
|
-
* This class allows querying booking records.
|
|
2
|
+
* @fileoverview Client for querying bookings in the Sharetribe Marketplace API.
|
|
4
3
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Use this to fetch your own bookings or bookings for listings you own.
|
|
5
|
+
* Only returns data the current user is authorized to see.
|
|
6
|
+
*
|
|
7
|
+
* @see https://www.sharetribe.com/api-reference/marketplace.html#bookings
|
|
7
8
|
*/
|
|
8
|
-
import { AxiosResponse } from "axios";
|
|
9
|
+
import type { AxiosResponse } from "axios";
|
|
9
10
|
import MarketplaceApi from "./index";
|
|
10
|
-
import { BookingsQueryParameter, BookingsResponse } from "../../types
|
|
11
|
+
import { BookingsQueryParameter, BookingsResponse } from "../../types";
|
|
11
12
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* The Bookings API provides methods to query booking records for marketplace resources.
|
|
13
|
+
* Bookings API client (own bookings only)
|
|
15
14
|
*/
|
|
16
15
|
declare class Bookings {
|
|
17
|
-
|
|
16
|
+
readonly authRequired = true;
|
|
18
17
|
private readonly axios;
|
|
18
|
+
private readonly endpoint;
|
|
19
19
|
private readonly headers;
|
|
20
|
-
/**
|
|
21
|
-
* Creates an instance of the Bookings class.
|
|
22
|
-
*
|
|
23
|
-
* @param {MarketplaceApi} api - The Marketplace API instance providing configuration and request handling.
|
|
24
|
-
*/
|
|
25
20
|
constructor(api: MarketplaceApi);
|
|
26
21
|
/**
|
|
27
|
-
*
|
|
22
|
+
* Query your own bookings
|
|
28
23
|
*
|
|
29
24
|
* @template P
|
|
30
|
-
* @param {P & BookingsQueryParameter} params
|
|
31
|
-
* @returns {Promise<AxiosResponse<BookingsResponse<
|
|
25
|
+
* @param {P & BookingsQueryParameter} params
|
|
26
|
+
* @returns {Promise<AxiosResponse<BookingsResponse<"query", P>>>}
|
|
32
27
|
*
|
|
33
28
|
* @example
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
29
|
+
* // Fetch all bookings for one of your listings
|
|
30
|
+
* const { data } = await sdk.bookings.query({
|
|
31
|
+
* listingId: "listing-abc123",
|
|
32
|
+
* start: "2025-01-01",
|
|
33
|
+
* end: "2025-01-31"
|
|
38
34
|
* });
|
|
39
35
|
*
|
|
40
|
-
*
|
|
36
|
+
* @example
|
|
37
|
+
* // Fetch upcoming bookings
|
|
38
|
+
* await sdk.bookings.query({
|
|
39
|
+
* start: new Date().toISOString(),
|
|
40
|
+
* state: "accepted"
|
|
41
|
+
* });
|
|
41
42
|
*/
|
|
42
43
|
query<P extends BookingsQueryParameter>(params: P): Promise<AxiosResponse<BookingsResponse<"query", P>>>;
|
|
43
44
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Bookings.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/marketplace/Bookings.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"Bookings.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/marketplace/Bookings.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAgB,aAAa,EAAC,MAAM,OAAO,CAAC;AACxD,OAAO,cAAc,MAAM,SAAS,CAAC;AACrC,OAAO,EAAC,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEtE;;GAEG;AACH,cAAM,QAAQ;IACZ,SAAgB,YAAY,QAAQ;IACpC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAgB;IACtC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAyB;gBAErC,GAAG,EAAE,cAAc;IAM/B;;;;;;;;;;;;;;;;;;;;;OAqBG;IACG,KAAK,CAAC,CAAC,SAAS,sBAAsB,EAC1C,MAAM,EAAE,CAAC,GACR,OAAO,CAAC,aAAa,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;CAMxD;AAED,eAAe,QAAQ,CAAC"}
|
|
@@ -1,182 +1,111 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @fileoverview
|
|
3
|
-
* This class includes methods for retrieving, creating, updating, and deleting the current authenticated user.
|
|
2
|
+
* @fileoverview Client for managing the current authenticated user in the Sharetribe Marketplace API.
|
|
4
3
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* This API allows users to view their profile, update personal info, change password/email,
|
|
5
|
+
* verify email, and manage account lifecycle (signup, delete).
|
|
6
|
+
*
|
|
7
|
+
* @see https://www.sharetribe.com/api-reference/marketplace.html#current-user
|
|
7
8
|
*/
|
|
8
|
-
import { AxiosResponse } from "axios";
|
|
9
|
+
import type { AxiosResponse } from "axios";
|
|
9
10
|
import MarketplaceApi from "./index";
|
|
10
|
-
import { CurrentUserChangeEmailParameter, CurrentUserChangePasswordParameter, CurrentUserCreateParameter, CurrentUserCreateWithIdpParameter, CurrentUserDeleteParameter, CurrentUserResponse, CurrentUserShowParameter, CurrentUserUpdateProfileParameter, CurrentUserVerifyEmailParameter } from "../../types
|
|
11
|
-
import { ExtraParameter } from "../../types/sharetribe";
|
|
11
|
+
import { CurrentUserChangeEmailParameter, CurrentUserChangePasswordParameter, CurrentUserCreateParameter, CurrentUserCreateWithIdpParameter, CurrentUserDeleteParameter, CurrentUserResponse, CurrentUserSendVerificationEmailParameter, CurrentUserShowParameter, CurrentUserUpdateProfileParameter, CurrentUserVerifyEmailParameter, ExtraParameter } from "../../types";
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* This class provides methods to manage the current authenticated user's account,
|
|
16
|
-
* including viewing, creating, updating, and deleting the user profile.
|
|
13
|
+
* Current User API client
|
|
17
14
|
*/
|
|
18
15
|
declare class CurrentUser {
|
|
19
|
-
|
|
16
|
+
readonly authRequired = true;
|
|
20
17
|
private readonly axios;
|
|
18
|
+
private readonly endpoint;
|
|
21
19
|
private readonly headers;
|
|
22
|
-
readonly authRequired = true;
|
|
23
|
-
/**
|
|
24
|
-
* Creates an instance of the CurrentUser class.
|
|
25
|
-
*
|
|
26
|
-
* @param {MarketplaceApi} api - The Marketplace API instance providing configuration and request handling.
|
|
27
|
-
*/
|
|
28
20
|
constructor(api: MarketplaceApi);
|
|
29
21
|
/**
|
|
30
|
-
*
|
|
22
|
+
* Fetch current user profile
|
|
31
23
|
*
|
|
32
24
|
* @template P
|
|
33
|
-
* @param {P & CurrentUserShowParameter} params
|
|
34
|
-
* @returns {Promise<CurrentUserResponse<
|
|
35
|
-
*
|
|
36
|
-
* @example
|
|
37
|
-
* const response = await sdk.currentUser.show({});
|
|
38
|
-
* const user = response.data;
|
|
25
|
+
* @param {P & CurrentUserShowParameter} params
|
|
26
|
+
* @returns {Promise<AxiosResponse<CurrentUserResponse<"show", P>>>}
|
|
39
27
|
*/
|
|
40
|
-
show<P extends CurrentUserShowParameter>(params
|
|
28
|
+
show<P extends CurrentUserShowParameter>(params?: P): Promise<AxiosResponse<CurrentUserResponse<"show", P>>>;
|
|
41
29
|
/**
|
|
42
|
-
*
|
|
30
|
+
* Create a new user account (signup)
|
|
43
31
|
*
|
|
44
32
|
* @template P
|
|
45
33
|
* @template EP
|
|
46
|
-
* @param {P &
|
|
47
|
-
* @param {EP} extraParams
|
|
48
|
-
* @returns {Promise<CurrentUserResponse<
|
|
49
|
-
*
|
|
50
|
-
* @example
|
|
51
|
-
* const response = await sdk.currentUser.delete();
|
|
52
|
-
* const result = response.data;
|
|
34
|
+
* @param {P & CurrentUserCreateParameter} params
|
|
35
|
+
* @param {EP} [extraParams]
|
|
36
|
+
* @returns {Promise<AxiosResponse<CurrentUserResponse<"create", P, EP>>>}
|
|
53
37
|
*/
|
|
54
|
-
|
|
38
|
+
create<P extends CurrentUserCreateParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<CurrentUserResponse<"create", P, EP>>>;
|
|
55
39
|
/**
|
|
56
|
-
*
|
|
40
|
+
* Create account via external identity provider (Google, Facebook, etc.)
|
|
57
41
|
*
|
|
58
42
|
* @template P
|
|
59
43
|
* @template EP
|
|
60
|
-
* @param {P &
|
|
61
|
-
* @param {EP} extraParams
|
|
62
|
-
* @returns {Promise<CurrentUserResponse<
|
|
63
|
-
*
|
|
64
|
-
* @example
|
|
65
|
-
* const response = await sdk.currentUser.create({
|
|
66
|
-
* email: 'user@example.com',
|
|
67
|
-
* password: 'secure-password',
|
|
68
|
-
* firstName: 'First',
|
|
69
|
-
* lastName: 'Last'
|
|
70
|
-
* });
|
|
71
|
-
* const newUser = response.data;
|
|
44
|
+
* @param {P & CurrentUserCreateWithIdpParameter} params
|
|
45
|
+
* @param {EP} [extraParams]
|
|
46
|
+
* @returns {Promise<AxiosResponse<CurrentUserResponse<"create_with_idp", P, EP>>>}
|
|
72
47
|
*/
|
|
73
|
-
|
|
48
|
+
createWithIdp<P extends CurrentUserCreateWithIdpParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<CurrentUserResponse<"create_with_idp", P, EP>>>;
|
|
74
49
|
/**
|
|
75
|
-
*
|
|
50
|
+
* Update current user profile
|
|
76
51
|
*
|
|
77
52
|
* @template P
|
|
78
53
|
* @template EP
|
|
79
|
-
* @param {P &
|
|
80
|
-
* @param {EP} extraParams
|
|
81
|
-
* @returns {Promise<CurrentUserResponse<
|
|
82
|
-
*
|
|
83
|
-
* @example
|
|
84
|
-
* const response = await sdk.currentUser.createWithIdp({
|
|
85
|
-
* idpId: 'provider-id',
|
|
86
|
-
* idpClientId: 'provider-client-id',
|
|
87
|
-
* idpToken: 'provider-token'
|
|
88
|
-
* });
|
|
89
|
-
* const newUser = response.data;
|
|
54
|
+
* @param {P & CurrentUserUpdateProfileParameter} params
|
|
55
|
+
* @param {EP} [extraParams]
|
|
56
|
+
* @returns {Promise<AxiosResponse<CurrentUserResponse<"update_profile", P, EP>>>}
|
|
90
57
|
*/
|
|
91
|
-
|
|
58
|
+
updateProfile<P extends CurrentUserUpdateProfileParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<CurrentUserResponse<"update_profile", P, EP>>>;
|
|
92
59
|
/**
|
|
93
|
-
*
|
|
60
|
+
* Change password
|
|
94
61
|
*
|
|
95
62
|
* @template P
|
|
96
63
|
* @template EP
|
|
97
|
-
* @param {P &
|
|
98
|
-
* @param {EP} extraParams
|
|
99
|
-
* @returns {Promise<CurrentUserResponse<
|
|
100
|
-
*
|
|
101
|
-
* @example
|
|
102
|
-
* const response = await sdk.currentUser.updateProfile({
|
|
103
|
-
* firstName: 'UpdatedFirst',
|
|
104
|
-
* lastName: 'UpdatedLast'
|
|
105
|
-
* });
|
|
106
|
-
* const updatedUser = response.data;
|
|
64
|
+
* @param {P & CurrentUserChangePasswordParameter} params
|
|
65
|
+
* @param {EP} [extraParams]
|
|
66
|
+
* @returns {Promise<AxiosResponse<CurrentUserResponse<"change_password", P, EP>>>}
|
|
107
67
|
*/
|
|
108
|
-
|
|
68
|
+
changePassword<P extends CurrentUserChangePasswordParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<CurrentUserResponse<"change_password", P, EP>>>;
|
|
109
69
|
/**
|
|
110
|
-
*
|
|
70
|
+
* Change email address
|
|
111
71
|
*
|
|
112
72
|
* @template P
|
|
113
73
|
* @template EP
|
|
114
|
-
* @param {P &
|
|
115
|
-
* @param {EP} extraParams
|
|
116
|
-
* @returns {Promise<CurrentUserResponse<
|
|
117
|
-
*
|
|
118
|
-
* @example
|
|
119
|
-
* const response = await sdk.currentUser.changePassword({
|
|
120
|
-
* currentPassword: 'old-password',
|
|
121
|
-
* newPassword: 'new-secure-password'
|
|
122
|
-
* });
|
|
123
|
-
* const result = response.data;
|
|
74
|
+
* @param {P & CurrentUserChangeEmailParameter} params
|
|
75
|
+
* @param {EP} [extraParams]
|
|
76
|
+
* @returns {Promise<AxiosResponse<CurrentUserResponse<"change_email", P, EP>>>}
|
|
124
77
|
*/
|
|
125
|
-
|
|
78
|
+
changeEmail<P extends CurrentUserChangeEmailParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<CurrentUserResponse<"change_email", P, EP>>>;
|
|
126
79
|
/**
|
|
127
|
-
*
|
|
80
|
+
* Verify email using token from email link
|
|
128
81
|
*
|
|
129
82
|
* @template P
|
|
130
83
|
* @template EP
|
|
131
|
-
* @param {P &
|
|
132
|
-
* @param {EP} extraParams
|
|
133
|
-
* @returns {Promise<CurrentUserResponse<
|
|
134
|
-
*
|
|
135
|
-
* @example
|
|
136
|
-
* const response = await sdk.currentUser.changeEmail({
|
|
137
|
-
* newEmail: 'new-email@example.com',
|
|
138
|
-
* currentPassword: 'current-password'
|
|
139
|
-
* });
|
|
140
|
-
* const result = response.data;
|
|
84
|
+
* @param {P & CurrentUserVerifyEmailParameter} params
|
|
85
|
+
* @param {EP} [extraParams]
|
|
86
|
+
* @returns {Promise<AxiosResponse<CurrentUserResponse<"verify_email", P, EP>>>}
|
|
141
87
|
*/
|
|
142
|
-
|
|
88
|
+
verifyEmail<P extends CurrentUserVerifyEmailParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<CurrentUserResponse<"verify_email", P, EP>>>;
|
|
143
89
|
/**
|
|
144
|
-
*
|
|
90
|
+
* Resend email verification
|
|
145
91
|
*
|
|
146
|
-
* @
|
|
147
|
-
* @template EP
|
|
148
|
-
* @param {P & CurrentUserVerifyEmailParameter} params - Parameters for verifying the email address.
|
|
149
|
-
* @param {EP} extraParams - Optional extra parameters for the request.
|
|
150
|
-
* @returns {Promise<CurrentUserResponse<'verify_email', P>>} - A promise resolving to the email verification confirmation.
|
|
151
|
-
*
|
|
152
|
-
* @example
|
|
153
|
-
* const response = await sdk.currentUser.verifyEmail({
|
|
154
|
-
* verificationToken: 'verification-token'
|
|
155
|
-
* });
|
|
156
|
-
* const result = response.data;
|
|
92
|
+
* @returns {Promise<AxiosResponse<CurrentUserResponse<"send_verification_email">>>}
|
|
157
93
|
*/
|
|
158
|
-
|
|
94
|
+
sendVerificationEmail<P extends CurrentUserSendVerificationEmailParameter>(): Promise<AxiosResponse<CurrentUserResponse<"send_verification_email", P>>>;
|
|
159
95
|
/**
|
|
160
|
-
*
|
|
161
|
-
*
|
|
162
|
-
* @template P
|
|
163
|
-
* @returns {Promise<CurrentUserResponse<'send_verification_email', P>>} - A promise resolving to the email sending confirmation.
|
|
96
|
+
* Delete current user account
|
|
164
97
|
*
|
|
165
|
-
* @
|
|
166
|
-
* const response = await sdk.currentUser.sendVerificationEmail();
|
|
167
|
-
* const result = response.data;
|
|
98
|
+
* @returns {Promise<AxiosResponse<CurrentUserResponse<"delete">>>}
|
|
168
99
|
*/
|
|
169
|
-
|
|
100
|
+
delete<P extends CurrentUserDeleteParameter>(): Promise<AxiosResponse<CurrentUserResponse<"delete", P>>>;
|
|
170
101
|
/**
|
|
171
|
-
* @deprecated
|
|
172
|
-
* Throws an error to indicate that this method should not be used.
|
|
102
|
+
* @deprecated Use `sdk.stripeAccount.create()` instead
|
|
173
103
|
*/
|
|
174
|
-
createStripeAccount():
|
|
104
|
+
createStripeAccount(): never;
|
|
175
105
|
/**
|
|
176
|
-
* @deprecated
|
|
177
|
-
* Throws an error to indicate that this method should not be used.
|
|
106
|
+
* @deprecated Use `sdk.stripeAccount.update()` instead
|
|
178
107
|
*/
|
|
179
|
-
updateStripeAccount():
|
|
108
|
+
updateStripeAccount(): never;
|
|
180
109
|
}
|
|
181
110
|
export default CurrentUser;
|
|
182
111
|
//# sourceMappingURL=CurrentUser.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CurrentUser.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/marketplace/CurrentUser.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"CurrentUser.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/marketplace/CurrentUser.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,47 +1,39 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @fileoverview
|
|
3
|
-
* This class allows uploading images for marketplace listings and resources.
|
|
2
|
+
* @fileoverview Client for uploading images in the Sharetribe Marketplace API.
|
|
4
3
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Use this to upload images for listings, user profiles, or other resources.
|
|
5
|
+
* Returns an image resource with variants ready for responsive display.
|
|
6
|
+
*
|
|
7
|
+
* @see https://www.sharetribe.com/api-reference/marketplace.html#images
|
|
7
8
|
*/
|
|
8
|
-
import { AxiosResponse } from "axios";
|
|
9
|
+
import type { AxiosResponse } from "axios";
|
|
9
10
|
import MarketplaceApi from "./index";
|
|
10
|
-
import { ImagesResponse, ImagesUploadParameter } from "../../types
|
|
11
|
-
import { ExtraParameter } from "../../types/sharetribe";
|
|
11
|
+
import { ExtraParameter, ImagesResponse, ImagesUploadParameter } from "../../types";
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* The Images API provides methods to upload images for marketplace resources.
|
|
13
|
+
* Images API client
|
|
16
14
|
*/
|
|
17
15
|
declare class Images {
|
|
18
|
-
|
|
16
|
+
readonly authRequired = true;
|
|
19
17
|
private readonly axios;
|
|
18
|
+
private readonly endpoint;
|
|
20
19
|
private readonly headers;
|
|
21
|
-
readonly authRequired = true;
|
|
22
|
-
/**
|
|
23
|
-
* Creates an instance of the Images class.
|
|
24
|
-
*
|
|
25
|
-
* @param {MarketplaceApi} api - The Marketplace API instance providing configuration and request handling.
|
|
26
|
-
*/
|
|
27
20
|
constructor(api: MarketplaceApi);
|
|
28
21
|
/**
|
|
29
|
-
*
|
|
22
|
+
* Upload an image
|
|
30
23
|
*
|
|
31
24
|
* @template P
|
|
32
25
|
* @template EP
|
|
33
|
-
* @param {P & ImagesUploadParameter} params -
|
|
34
|
-
* @param {EP
|
|
35
|
-
* @returns {Promise<AxiosResponse<ImagesResponse<
|
|
26
|
+
* @param {P & ImagesUploadParameter} params - Must include `image: File`
|
|
27
|
+
* @param {EP} [extraParams] - Optional extra parameters (e.g. `expand: true`)
|
|
28
|
+
* @returns {Promise<AxiosResponse<ImagesResponse<"upload", EP>>>}
|
|
36
29
|
*
|
|
37
30
|
* @example
|
|
38
|
-
* const
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
* const uploadedImage = response.data;
|
|
31
|
+
* const file = inputElement.files[0];
|
|
32
|
+
* const { data } = await sdk.images.upload({ image: file });
|
|
33
|
+
* console.log(data.id); // → "img-abc123"
|
|
34
|
+
* console.log(data.attributes.variants["square-small"]?.url);
|
|
43
35
|
*/
|
|
44
|
-
upload<P extends ImagesUploadParameter, EP extends ExtraParameter>(params: P, extraParams?: EP
|
|
36
|
+
upload<P extends ImagesUploadParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<ImagesResponse<"upload", EP>>>;
|
|
45
37
|
}
|
|
46
38
|
export default Images;
|
|
47
39
|
//# sourceMappingURL=Images.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Images.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/marketplace/Images.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"Images.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/marketplace/Images.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAgB,aAAa,EAAC,MAAM,OAAO,CAAC;AACxD,OAAO,cAAc,MAAM,SAAS,CAAC;AACrC,OAAO,EAAC,cAAc,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAEnF;;GAEG;AACH,cAAM,MAAM;IACV,SAAgB,YAAY,QAAQ;IACpC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAgB;IACtC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAyB;gBAErC,GAAG,EAAE,cAAc;IAM/B;;;;;;;;;;;;;;OAcG;IACG,MAAM,CACV,CAAC,SAAS,qBAAqB,EAC/B,EAAE,SAAS,cAAc,GAAG,SAAS,GAAG,SAAS,EAEjD,MAAM,EAAE,CAAC,EACT,WAAW,CAAC,EAAE,EAAE,GACf,OAAO,CAAC,aAAa,CAAC,cAAc,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;CAkBxD;AAED,eAAe,MAAM,CAAC"}
|
|
@@ -1,50 +1,51 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @fileoverview
|
|
3
|
-
* This class allows querying and retrieving details of listings.
|
|
2
|
+
* @fileoverview Client for querying public listings in the Sharetribe Marketplace API.
|
|
4
3
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Use this to search and fetch listing details in your frontend.
|
|
5
|
+
* Only returns publicly visible data — no privileged operations.
|
|
6
|
+
*
|
|
7
|
+
* @see https://www.sharetribe.com/api-reference/marketplace.html#listings
|
|
7
8
|
*/
|
|
8
|
-
import { AxiosResponse } from "axios";
|
|
9
|
+
import type { AxiosResponse } from "axios";
|
|
9
10
|
import MarketplaceApi from "./index";
|
|
10
|
-
import {
|
|
11
|
+
import { ListingsQueryParameter, ListingsResponse, ListingsShowParameter } from "../../types";
|
|
11
12
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* The Listings API provides methods to query and retrieve details of marketplace listings.
|
|
13
|
+
* Public Listings API client
|
|
15
14
|
*/
|
|
16
15
|
declare class Listings {
|
|
17
|
-
private readonly endpoint;
|
|
18
16
|
private readonly axios;
|
|
17
|
+
private readonly endpoint;
|
|
19
18
|
private readonly headers;
|
|
20
|
-
/**
|
|
21
|
-
* Creates an instance of the Listings class.
|
|
22
|
-
*
|
|
23
|
-
* @param {MarketplaceApi} api - The Marketplace API instance providing configuration and request handling.
|
|
24
|
-
*/
|
|
25
19
|
constructor(api: MarketplaceApi);
|
|
26
20
|
/**
|
|
27
|
-
*
|
|
21
|
+
* Fetch a single listing by ID
|
|
28
22
|
*
|
|
29
23
|
* @template P
|
|
30
|
-
* @param {P & ListingsShowParameter} params
|
|
31
|
-
* @returns {Promise<AxiosResponse<ListingsResponse<
|
|
24
|
+
* @param {P & ListingsShowParameter} params
|
|
25
|
+
* @returns {Promise<AxiosResponse<ListingsResponse<"show", P>>>}
|
|
32
26
|
*
|
|
33
27
|
* @example
|
|
34
|
-
* const
|
|
35
|
-
* const listing = response.data;
|
|
28
|
+
* const { data } = await sdk.listings.show({ id: "listing-abc123" });
|
|
36
29
|
*/
|
|
37
30
|
show<P extends ListingsShowParameter>(params: P): Promise<AxiosResponse<ListingsResponse<"show", P>>>;
|
|
38
31
|
/**
|
|
39
|
-
*
|
|
32
|
+
* Search and filter public listings
|
|
40
33
|
*
|
|
41
34
|
* @template P
|
|
42
|
-
* @param {P & ListingsQueryParameter} params
|
|
43
|
-
* @returns {Promise<AxiosResponse<ListingsResponse<
|
|
35
|
+
* @param {P & ListingsQueryParameter} params
|
|
36
|
+
* @returns {Promise<AxiosResponse<ListingsResponse<"query", P>>>}
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* // Basic keyword search
|
|
40
|
+
* await sdk.listings.query({ keywords: "yoga class" });
|
|
44
41
|
*
|
|
45
42
|
* @example
|
|
46
|
-
*
|
|
47
|
-
*
|
|
43
|
+
* // Geo + price filter
|
|
44
|
+
* await sdk.listings.query({
|
|
45
|
+
* origin: "60.1699,24.9384",
|
|
46
|
+
* bounds: "60.2,25.0,60.1,24.8",
|
|
47
|
+
* price: [0, 100]
|
|
48
|
+
* });
|
|
48
49
|
*/
|
|
49
50
|
query<P extends ListingsQueryParameter>(params: P): Promise<AxiosResponse<ListingsResponse<"query", P>>>;
|
|
50
51
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Listings.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/marketplace/Listings.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"Listings.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/marketplace/Listings.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAgB,aAAa,EAAC,MAAM,OAAO,CAAC;AACxD,OAAO,cAAc,MAAM,SAAS,CAAC;AACrC,OAAO,EAAC,sBAAsB,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAE7F;;GAEG;AACH,cAAM,QAAQ;IACZ,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAgB;IACtC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAyB;gBAErC,GAAG,EAAE,cAAc;IAM/B;;;;;;;;;OASG;IACG,IAAI,CAAC,CAAC,SAAS,qBAAqB,EACxC,MAAM,EAAE,CAAC,GACR,OAAO,CAAC,aAAa,CAAC,gBAAgB,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC;IAOtD;;;;;;;;;;;;;;;;;;OAkBG;IACG,KAAK,CAAC,CAAC,SAAS,sBAAsB,EAC1C,MAAM,EAAE,CAAC,GACR,OAAO,CAAC,aAAa,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;CAMxD;AAED,eAAe,QAAQ,CAAC"}
|