@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.
- 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} +53 -41
- 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/convert-types.d.ts.map +1 -1
- package/dist/types/utils/parameter-serializer.d.ts.map +1 -1
- package/dist/types/utils/prepare-axios-instance.d.ts +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/stores/store.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 +18 -17
- 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
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Client for the Sharetribe Integration API.
|
|
3
|
+
*
|
|
4
|
+
* This is the main entry point for server-side or trusted integrations.
|
|
5
|
+
* It provides access to all privileged endpoints: availability exceptions, events,
|
|
6
|
+
* image uploads, stock management, transactions, users, and more.
|
|
7
|
+
*
|
|
8
|
+
* Requires a client secret for authentication.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* const sdk = new IntegrationSdk({
|
|
12
|
+
* clientId: "abc123",
|
|
13
|
+
* clientSecret: "super-secret",
|
|
14
|
+
* baseUrl: "https://api.sharetribe.com"
|
|
15
|
+
* });
|
|
16
|
+
*
|
|
17
|
+
* // Query recent events
|
|
18
|
+
* const { data: events } = await sdk.integration.events.query({
|
|
19
|
+
* createdAtStart: "2025-01-01T00:00:00Z"
|
|
20
|
+
* });
|
|
21
|
+
*/
|
|
22
|
+
import type { AxiosInstance } from "axios";
|
|
23
|
+
import IntegrationSdk from "../../integrationSdk";
|
|
24
|
+
import AvailabilityExceptions from "./AvailabilityExceptions";
|
|
25
|
+
import Events from "./Events";
|
|
26
|
+
import Images from "./Images";
|
|
27
|
+
import Listings from "./Listings";
|
|
28
|
+
import Marketplace from "./Marketplace";
|
|
29
|
+
import Stock from "./Stock";
|
|
30
|
+
import StockAdjustments from "./StockAdjustments";
|
|
31
|
+
import StockReservations from "./StockReservations";
|
|
32
|
+
import Transactions from "./Transactions";
|
|
33
|
+
import Users from "./Users";
|
|
34
|
+
/**
|
|
35
|
+
* Integration API client
|
|
36
|
+
*/
|
|
37
|
+
declare class IntegrationApi {
|
|
38
|
+
/** Axios instance with auth headers */
|
|
39
|
+
readonly axios: AxiosInstance;
|
|
40
|
+
/** Base URL for all Integration API endpoints */
|
|
41
|
+
readonly endpoint: string;
|
|
42
|
+
/** Default headers (includes Authorization) */
|
|
43
|
+
readonly headers: Record<string, string>;
|
|
44
|
+
/** Most endpoints require authentication */
|
|
45
|
+
readonly authRequired = true;
|
|
46
|
+
readonly availabilityExceptions: AvailabilityExceptions;
|
|
47
|
+
readonly events: Events;
|
|
48
|
+
readonly images: Images;
|
|
49
|
+
readonly listings: Listings;
|
|
50
|
+
readonly marketplace: Marketplace;
|
|
51
|
+
readonly stock: Stock;
|
|
52
|
+
readonly stockAdjustments: StockAdjustments;
|
|
53
|
+
readonly stockReservations: StockReservations;
|
|
54
|
+
readonly transactions: Transactions;
|
|
55
|
+
readonly users: Users;
|
|
56
|
+
constructor(sdk: IntegrationSdk);
|
|
57
|
+
}
|
|
58
|
+
export default IntegrationApi;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Client for managing availability exceptions in the Sharetribe Marketplace API.
|
|
3
|
+
*
|
|
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
|
|
8
|
+
*/
|
|
9
|
+
import type { AxiosResponse } from "axios";
|
|
10
|
+
import MarketplaceApi from "./index";
|
|
11
|
+
import { AvailabilityExceptionsCreateParameter, AvailabilityExceptionsDeleteParameter, AvailabilityExceptionsQueryParameter, AvailabilityExceptionsResponse, ExtraParameter } from "../../types";
|
|
12
|
+
/**
|
|
13
|
+
* Availability Exceptions API client (own listings only)
|
|
14
|
+
*/
|
|
15
|
+
declare class AvailabilityExceptions {
|
|
16
|
+
readonly authRequired = true;
|
|
17
|
+
private readonly axios;
|
|
18
|
+
private readonly endpoint;
|
|
19
|
+
private readonly headers;
|
|
20
|
+
constructor(api: MarketplaceApi);
|
|
21
|
+
/**
|
|
22
|
+
* Query your own availability exceptions
|
|
23
|
+
*
|
|
24
|
+
* @template P
|
|
25
|
+
* @param {P & AvailabilityExceptionsQueryParameter} params
|
|
26
|
+
* @returns {Promise<AxiosResponse<AvailabilityExceptionsResponse<"query", P>>>}
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* const { data } = await sdk.availabilityExceptions.query({
|
|
30
|
+
* listingId: "listing-abc123",
|
|
31
|
+
* start: "2025-12-01",
|
|
32
|
+
* end: "2025-12-31"
|
|
33
|
+
* });
|
|
34
|
+
*/
|
|
35
|
+
query<P extends AvailabilityExceptionsQueryParameter>(params: P): Promise<AxiosResponse<AvailabilityExceptionsResponse<"query", P>>>;
|
|
36
|
+
/**
|
|
37
|
+
* Create a new availability exception (e.g. block dates)
|
|
38
|
+
*
|
|
39
|
+
* @template P
|
|
40
|
+
* @template EP
|
|
41
|
+
* @param {P & AvailabilityExceptionsCreateParameter} params
|
|
42
|
+
* @param {EP} [extraParams] - Optional extra parameters (e.g. `expand: true`)
|
|
43
|
+
* @returns {Promise<AxiosResponse<AvailabilityExceptionsResponse<"create", P, EP>>>}
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
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
|
|
52
|
+
* });
|
|
53
|
+
*/
|
|
54
|
+
create<P extends AvailabilityExceptionsCreateParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<AvailabilityExceptionsResponse<"create", P, EP>>>;
|
|
55
|
+
/**
|
|
56
|
+
* Delete an availability exception
|
|
57
|
+
*
|
|
58
|
+
* @template P
|
|
59
|
+
* @template EP
|
|
60
|
+
* @param {P & AvailabilityExceptionsDeleteParameter} params
|
|
61
|
+
* @param {EP} [extraParams]
|
|
62
|
+
* @returns {Promise<AxiosResponse<AvailabilityExceptionsResponse<"delete", P, EP>>>}
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* await sdk.availabilityExceptions.delete({ id: "exc-456def" });
|
|
66
|
+
*/
|
|
67
|
+
delete<P extends AvailabilityExceptionsDeleteParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<AvailabilityExceptionsResponse<"delete", P, EP>>>;
|
|
68
|
+
}
|
|
69
|
+
export default AvailabilityExceptions;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Client for querying bookings in the Sharetribe Marketplace API.
|
|
3
|
+
*
|
|
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
|
|
8
|
+
*/
|
|
9
|
+
import type { AxiosResponse } from "axios";
|
|
10
|
+
import MarketplaceApi from "./index";
|
|
11
|
+
import { BookingsQueryParameter, BookingsResponse } from "../../types";
|
|
12
|
+
/**
|
|
13
|
+
* Bookings API client (own bookings only)
|
|
14
|
+
*/
|
|
15
|
+
declare class Bookings {
|
|
16
|
+
readonly authRequired = true;
|
|
17
|
+
private readonly axios;
|
|
18
|
+
private readonly endpoint;
|
|
19
|
+
private readonly headers;
|
|
20
|
+
constructor(api: MarketplaceApi);
|
|
21
|
+
/**
|
|
22
|
+
* Query your own bookings
|
|
23
|
+
*
|
|
24
|
+
* @template P
|
|
25
|
+
* @param {P & BookingsQueryParameter} params
|
|
26
|
+
* @returns {Promise<AxiosResponse<BookingsResponse<"query", P>>>}
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
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"
|
|
34
|
+
* });
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* // Fetch upcoming bookings
|
|
38
|
+
* await sdk.bookings.query({
|
|
39
|
+
* start: new Date().toISOString(),
|
|
40
|
+
* state: "accepted"
|
|
41
|
+
* });
|
|
42
|
+
*/
|
|
43
|
+
query<P extends BookingsQueryParameter>(params: P): Promise<AxiosResponse<BookingsResponse<"query", P>>>;
|
|
44
|
+
}
|
|
45
|
+
export default Bookings;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Client for managing the current authenticated user in the Sharetribe Marketplace API.
|
|
3
|
+
*
|
|
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
|
|
8
|
+
*/
|
|
9
|
+
import type { AxiosResponse } from "axios";
|
|
10
|
+
import MarketplaceApi from "./index";
|
|
11
|
+
import { CurrentUserChangeEmailParameter, CurrentUserChangePasswordParameter, CurrentUserCreateParameter, CurrentUserCreateWithIdpParameter, CurrentUserDeleteParameter, CurrentUserResponse, CurrentUserSendVerificationEmailParameter, CurrentUserShowParameter, CurrentUserUpdateProfileParameter, CurrentUserVerifyEmailParameter, ExtraParameter } from "../../types";
|
|
12
|
+
/**
|
|
13
|
+
* Current User API client
|
|
14
|
+
*/
|
|
15
|
+
declare class CurrentUser {
|
|
16
|
+
readonly authRequired = true;
|
|
17
|
+
private readonly axios;
|
|
18
|
+
private readonly endpoint;
|
|
19
|
+
private readonly headers;
|
|
20
|
+
constructor(api: MarketplaceApi);
|
|
21
|
+
/**
|
|
22
|
+
* Fetch current user profile
|
|
23
|
+
*
|
|
24
|
+
* @template P
|
|
25
|
+
* @param {P & CurrentUserShowParameter} params
|
|
26
|
+
* @returns {Promise<AxiosResponse<CurrentUserResponse<"show", P>>>}
|
|
27
|
+
*/
|
|
28
|
+
show<P extends CurrentUserShowParameter>(params?: P): Promise<AxiosResponse<CurrentUserResponse<"show", P>>>;
|
|
29
|
+
/**
|
|
30
|
+
* Create a new user account (signup)
|
|
31
|
+
*
|
|
32
|
+
* @template P
|
|
33
|
+
* @template EP
|
|
34
|
+
* @param {P & CurrentUserCreateParameter} params
|
|
35
|
+
* @param {EP} [extraParams]
|
|
36
|
+
* @returns {Promise<AxiosResponse<CurrentUserResponse<"create", P, EP>>>}
|
|
37
|
+
*/
|
|
38
|
+
create<P extends CurrentUserCreateParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<CurrentUserResponse<"create", P, EP>>>;
|
|
39
|
+
/**
|
|
40
|
+
* Create account via external identity provider (Google, Facebook, etc.)
|
|
41
|
+
*
|
|
42
|
+
* @template P
|
|
43
|
+
* @template EP
|
|
44
|
+
* @param {P & CurrentUserCreateWithIdpParameter} params
|
|
45
|
+
* @param {EP} [extraParams]
|
|
46
|
+
* @returns {Promise<AxiosResponse<CurrentUserResponse<"create_with_idp", P, EP>>>}
|
|
47
|
+
*/
|
|
48
|
+
createWithIdp<P extends CurrentUserCreateWithIdpParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<CurrentUserResponse<"create_with_idp", P, EP>>>;
|
|
49
|
+
/**
|
|
50
|
+
* Update current user profile
|
|
51
|
+
*
|
|
52
|
+
* @template P
|
|
53
|
+
* @template EP
|
|
54
|
+
* @param {P & CurrentUserUpdateProfileParameter} params
|
|
55
|
+
* @param {EP} [extraParams]
|
|
56
|
+
* @returns {Promise<AxiosResponse<CurrentUserResponse<"update_profile", P, EP>>>}
|
|
57
|
+
*/
|
|
58
|
+
updateProfile<P extends CurrentUserUpdateProfileParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<CurrentUserResponse<"update_profile", P, EP>>>;
|
|
59
|
+
/**
|
|
60
|
+
* Change password
|
|
61
|
+
*
|
|
62
|
+
* @template P
|
|
63
|
+
* @template EP
|
|
64
|
+
* @param {P & CurrentUserChangePasswordParameter} params
|
|
65
|
+
* @param {EP} [extraParams]
|
|
66
|
+
* @returns {Promise<AxiosResponse<CurrentUserResponse<"change_password", P, EP>>>}
|
|
67
|
+
*/
|
|
68
|
+
changePassword<P extends CurrentUserChangePasswordParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<CurrentUserResponse<"change_password", P, EP>>>;
|
|
69
|
+
/**
|
|
70
|
+
* Change email address
|
|
71
|
+
*
|
|
72
|
+
* @template P
|
|
73
|
+
* @template EP
|
|
74
|
+
* @param {P & CurrentUserChangeEmailParameter} params
|
|
75
|
+
* @param {EP} [extraParams]
|
|
76
|
+
* @returns {Promise<AxiosResponse<CurrentUserResponse<"change_email", P, EP>>>}
|
|
77
|
+
*/
|
|
78
|
+
changeEmail<P extends CurrentUserChangeEmailParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<CurrentUserResponse<"change_email", P, EP>>>;
|
|
79
|
+
/**
|
|
80
|
+
* Verify email using token from email link
|
|
81
|
+
*
|
|
82
|
+
* @template P
|
|
83
|
+
* @template EP
|
|
84
|
+
* @param {P & CurrentUserVerifyEmailParameter} params
|
|
85
|
+
* @param {EP} [extraParams]
|
|
86
|
+
* @returns {Promise<AxiosResponse<CurrentUserResponse<"verify_email", P, EP>>>}
|
|
87
|
+
*/
|
|
88
|
+
verifyEmail<P extends CurrentUserVerifyEmailParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<CurrentUserResponse<"verify_email", P, EP>>>;
|
|
89
|
+
/**
|
|
90
|
+
* Resend email verification
|
|
91
|
+
*
|
|
92
|
+
* @returns {Promise<AxiosResponse<CurrentUserResponse<"send_verification_email">>>}
|
|
93
|
+
*/
|
|
94
|
+
sendVerificationEmail<P extends CurrentUserSendVerificationEmailParameter>(): Promise<AxiosResponse<CurrentUserResponse<"send_verification_email", P>>>;
|
|
95
|
+
/**
|
|
96
|
+
* Delete current user account
|
|
97
|
+
*
|
|
98
|
+
* @returns {Promise<AxiosResponse<CurrentUserResponse<"delete">>>}
|
|
99
|
+
*/
|
|
100
|
+
delete<P extends CurrentUserDeleteParameter>(): Promise<AxiosResponse<CurrentUserResponse<"delete", P>>>;
|
|
101
|
+
/**
|
|
102
|
+
* @deprecated Use `sdk.stripeAccount.create()` instead
|
|
103
|
+
*/
|
|
104
|
+
createStripeAccount(): never;
|
|
105
|
+
/**
|
|
106
|
+
* @deprecated Use `sdk.stripeAccount.update()` instead
|
|
107
|
+
*/
|
|
108
|
+
updateStripeAccount(): never;
|
|
109
|
+
}
|
|
110
|
+
export default CurrentUser;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Client for uploading images in the Sharetribe Marketplace API.
|
|
3
|
+
*
|
|
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
|
|
8
|
+
*/
|
|
9
|
+
import type { AxiosResponse } from "axios";
|
|
10
|
+
import MarketplaceApi from "./index";
|
|
11
|
+
import { ExtraParameter, ImagesResponse, ImagesUploadParameter } from "../../types";
|
|
12
|
+
/**
|
|
13
|
+
* Images API client
|
|
14
|
+
*/
|
|
15
|
+
declare class Images {
|
|
16
|
+
readonly authRequired = true;
|
|
17
|
+
private readonly axios;
|
|
18
|
+
private readonly endpoint;
|
|
19
|
+
private readonly headers;
|
|
20
|
+
constructor(api: MarketplaceApi);
|
|
21
|
+
/**
|
|
22
|
+
* Upload an image
|
|
23
|
+
*
|
|
24
|
+
* @template P
|
|
25
|
+
* @template EP
|
|
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>>>}
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
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);
|
|
35
|
+
*/
|
|
36
|
+
upload<P extends ImagesUploadParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<ImagesResponse<"upload", EP>>>;
|
|
37
|
+
}
|
|
38
|
+
export default Images;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Client for querying public listings in the Sharetribe Marketplace API.
|
|
3
|
+
*
|
|
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
|
|
8
|
+
*/
|
|
9
|
+
import type { AxiosResponse } from "axios";
|
|
10
|
+
import MarketplaceApi from "./index";
|
|
11
|
+
import { ListingsQueryParameter, ListingsResponse, ListingsShowParameter } from "../../types";
|
|
12
|
+
/**
|
|
13
|
+
* Public Listings API client
|
|
14
|
+
*/
|
|
15
|
+
declare class Listings {
|
|
16
|
+
private readonly axios;
|
|
17
|
+
private readonly endpoint;
|
|
18
|
+
private readonly headers;
|
|
19
|
+
constructor(api: MarketplaceApi);
|
|
20
|
+
/**
|
|
21
|
+
* Fetch a single listing by ID
|
|
22
|
+
*
|
|
23
|
+
* @template P
|
|
24
|
+
* @param {P & ListingsShowParameter} params
|
|
25
|
+
* @returns {Promise<AxiosResponse<ListingsResponse<"show", P>>>}
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* const { data } = await sdk.listings.show({ id: "listing-abc123" });
|
|
29
|
+
*/
|
|
30
|
+
show<P extends ListingsShowParameter>(params: P): Promise<AxiosResponse<ListingsResponse<"show", P>>>;
|
|
31
|
+
/**
|
|
32
|
+
* Search and filter public listings
|
|
33
|
+
*
|
|
34
|
+
* @template P
|
|
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" });
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
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
|
+
* });
|
|
49
|
+
*/
|
|
50
|
+
query<P extends ListingsQueryParameter>(params: P): Promise<AxiosResponse<ListingsResponse<"query", P>>>;
|
|
51
|
+
}
|
|
52
|
+
export default Listings;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Client for fetching marketplace configuration in the Sharetribe Marketplace API.
|
|
3
|
+
*
|
|
4
|
+
* Use this to get metadata about your marketplace — name, description, currency, logo,
|
|
5
|
+
* supported countries, payout settings, and more.
|
|
6
|
+
*
|
|
7
|
+
* @see https://www.sharetribe.com/api-reference/marketplace.html#marketplace
|
|
8
|
+
*/
|
|
9
|
+
import type { AxiosResponse } from "axios";
|
|
10
|
+
import MarketplaceApi from "./index";
|
|
11
|
+
import { MarketplaceResponse } from "../../types";
|
|
12
|
+
/**
|
|
13
|
+
* Public Marketplace API client
|
|
14
|
+
*/
|
|
15
|
+
declare class Marketplace {
|
|
16
|
+
private readonly axios;
|
|
17
|
+
private readonly endpoint;
|
|
18
|
+
private readonly headers;
|
|
19
|
+
constructor(api: MarketplaceApi);
|
|
20
|
+
/**
|
|
21
|
+
* Fetch current marketplace configuration
|
|
22
|
+
*
|
|
23
|
+
* @returns {Promise<AxiosResponse<MarketplaceResponse<"show">>>}
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* const { data } = await sdk.marketplace.show();
|
|
27
|
+
* console.log(data.attributes.name); // → "My Awesome Marketplace"
|
|
28
|
+
* console.log(data.attributes.currency); // → "USD"
|
|
29
|
+
* console.log(data.attributes.country); // → "FI"
|
|
30
|
+
*/
|
|
31
|
+
show(): Promise<AxiosResponse<MarketplaceResponse<"show">>>;
|
|
32
|
+
}
|
|
33
|
+
export default Marketplace;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Client for querying and sending messages in the Sharetribe Marketplace API.
|
|
3
|
+
*
|
|
4
|
+
* Use this to read conversation history and send messages in transactions.
|
|
5
|
+
* Messages are tied to a specific transaction (order/inquiry).
|
|
6
|
+
*
|
|
7
|
+
* @see https://www.sharetribe.com/api-reference/marketplace.html#messages
|
|
8
|
+
*/
|
|
9
|
+
import type { AxiosResponse } from "axios";
|
|
10
|
+
import MarketplaceApi from "./index";
|
|
11
|
+
import { ExtraParameter, MessagesQueryParameter, MessagesResponse, MessagesSendParameter } from "../../types";
|
|
12
|
+
/**
|
|
13
|
+
* Messages API client
|
|
14
|
+
*/
|
|
15
|
+
declare class Messages {
|
|
16
|
+
readonly authRequired = true;
|
|
17
|
+
private readonly axios;
|
|
18
|
+
private readonly endpoint;
|
|
19
|
+
private readonly headers;
|
|
20
|
+
constructor(api: MarketplaceApi);
|
|
21
|
+
/**
|
|
22
|
+
* Query messages in a transaction
|
|
23
|
+
*
|
|
24
|
+
* @template P
|
|
25
|
+
* @param {P & MessagesQueryParameter} params
|
|
26
|
+
* @returns {Promise<AxiosResponse<MessagesResponse<"query", P>>>}
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* const { data } = await sdk.messages.query({
|
|
30
|
+
* transactionId: "tx-abc123"
|
|
31
|
+
* });
|
|
32
|
+
*/
|
|
33
|
+
query<P extends MessagesQueryParameter>(params: P): Promise<AxiosResponse<MessagesResponse<"query", P>>>;
|
|
34
|
+
/**
|
|
35
|
+
* Send a new message in a transaction
|
|
36
|
+
*
|
|
37
|
+
* @template P
|
|
38
|
+
* @template EP
|
|
39
|
+
* @param {P & MessagesSendParameter} params
|
|
40
|
+
* @param {EP} [extraParams] - Optional extra parameters (e.g. `expand: true`)
|
|
41
|
+
* @returns {Promise<AxiosResponse<MessagesResponse<"send", P, EP>>>}
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* await sdk.messages.send({
|
|
45
|
+
* transactionId: "tx-abc123",
|
|
46
|
+
* content: "Hi! When are you available?"
|
|
47
|
+
* });
|
|
48
|
+
*/
|
|
49
|
+
send<P extends MessagesSendParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<MessagesResponse<"send", P, EP>>>;
|
|
50
|
+
}
|
|
51
|
+
export default Messages;
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Client for managing your own listings in the Sharetribe Marketplace API.
|
|
3
|
+
*
|
|
4
|
+
* Use this to create, edit, publish, close, and manage images for listings you own.
|
|
5
|
+
* All operations require authentication.
|
|
6
|
+
*
|
|
7
|
+
* @see https://www.sharetribe.com/api-reference/marketplace.html#own-listings
|
|
8
|
+
*/
|
|
9
|
+
import type { AxiosResponse } from "axios";
|
|
10
|
+
import MarketplaceApi from "./index";
|
|
11
|
+
import { ExtraParameter, OwnListingsAddImageParameter, OwnListingsCloseParameter, OwnListingsCreateDraftParameter, OwnListingsCreateParameter, OwnListingsDiscardDraftParameter, OwnListingsOpenParameter, OwnListingsPublishDraftParameter, OwnListingsQueryParameter, OwnListingsResponse, OwnListingsShowParameter, OwnListingsUpdateParameter } from "../../types";
|
|
12
|
+
/**
|
|
13
|
+
* Own Listings API client (authenticated user)
|
|
14
|
+
*/
|
|
15
|
+
declare class OwnListings {
|
|
16
|
+
readonly authRequired = true;
|
|
17
|
+
private readonly axios;
|
|
18
|
+
private readonly endpoint;
|
|
19
|
+
private readonly headers;
|
|
20
|
+
constructor(api: MarketplaceApi);
|
|
21
|
+
/**
|
|
22
|
+
* Fetch one of your listings by ID
|
|
23
|
+
*
|
|
24
|
+
* @template P
|
|
25
|
+
* @param {P & OwnListingsShowParameter} params
|
|
26
|
+
* @returns {Promise<AxiosResponse<OwnListingsResponse<"show", P>>>}
|
|
27
|
+
*/
|
|
28
|
+
show<P extends OwnListingsShowParameter>(params: P): Promise<AxiosResponse<OwnListingsResponse<"show", P>>>;
|
|
29
|
+
/**
|
|
30
|
+
* List all your listings (drafts, published, closed)
|
|
31
|
+
*
|
|
32
|
+
* @template P
|
|
33
|
+
* @param {P & OwnListingsQueryParameter} params
|
|
34
|
+
* @returns {Promise<AxiosResponse<OwnListingsResponse<"query", P>>>}
|
|
35
|
+
*/
|
|
36
|
+
query<P extends OwnListingsQueryParameter>(params?: P): Promise<AxiosResponse<OwnListingsResponse<"query", P>>>;
|
|
37
|
+
/**
|
|
38
|
+
* Create a published listing
|
|
39
|
+
*
|
|
40
|
+
* @template P
|
|
41
|
+
* @template EP
|
|
42
|
+
* @param {P & OwnListingsCreateParameter} params
|
|
43
|
+
* @param {EP} [extraParams]
|
|
44
|
+
* @returns {Promise<AxiosResponse<OwnListingsResponse<"create", P, EP>>>}
|
|
45
|
+
*/
|
|
46
|
+
create<P extends OwnListingsCreateParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<OwnListingsResponse<"create", P, EP>>>;
|
|
47
|
+
/**
|
|
48
|
+
* Create a draft listing (for step-by-step creation)
|
|
49
|
+
*
|
|
50
|
+
* @template P
|
|
51
|
+
* @template EP
|
|
52
|
+
* @param {P & OwnListingsCreateDraftParameter} params
|
|
53
|
+
* @param {EP} [extraParams]
|
|
54
|
+
* @returns {Promise<AxiosResponse<OwnListingsResponse<"createDraft", P, EP>>>}
|
|
55
|
+
*/
|
|
56
|
+
createDraft<P extends OwnListingsCreateDraftParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<OwnListingsResponse<"createDraft", P, EP>>>;
|
|
57
|
+
/**
|
|
58
|
+
* Update a listing (draft or published)
|
|
59
|
+
*
|
|
60
|
+
* @template P
|
|
61
|
+
* @template EP
|
|
62
|
+
* @param {P & OwnListingsUpdateParameter} params
|
|
63
|
+
* @param {EP} [extraParams]
|
|
64
|
+
* @returns {Promise<AxiosResponse<OwnListingsResponse<"update", P, EP>>>}
|
|
65
|
+
*/
|
|
66
|
+
update<P extends OwnListingsUpdateParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<OwnListingsResponse<"update", P, EP>>>;
|
|
67
|
+
/**
|
|
68
|
+
* Publish a draft listing
|
|
69
|
+
*
|
|
70
|
+
* @template P
|
|
71
|
+
* @template EP
|
|
72
|
+
* @param {P & OwnListingsPublishDraftParameter} params
|
|
73
|
+
* @param {EP} [extraParams]
|
|
74
|
+
* @returns {Promise<AxiosResponse<OwnListingsResponse<"publishDraft", P, EP>>>}
|
|
75
|
+
*/
|
|
76
|
+
publishDraft<P extends OwnListingsPublishDraftParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<OwnListingsResponse<"publishDraft", P, EP>>>;
|
|
77
|
+
/**
|
|
78
|
+
* Discard a draft listing
|
|
79
|
+
*
|
|
80
|
+
* @template P
|
|
81
|
+
* @param {P & OwnListingsDiscardDraftParameter} params
|
|
82
|
+
* @returns {Promise<AxiosResponse<OwnListingsResponse<"discardDraft", P>>>}
|
|
83
|
+
*/
|
|
84
|
+
discardDraft<P extends OwnListingsDiscardDraftParameter>(params: P): Promise<AxiosResponse<OwnListingsResponse<"discardDraft", P>>>;
|
|
85
|
+
/**
|
|
86
|
+
* Close a published listing
|
|
87
|
+
*
|
|
88
|
+
* @template P
|
|
89
|
+
* @template EP
|
|
90
|
+
* @param {P & OwnListingsCloseParameter} params
|
|
91
|
+
* @param {EP} [extraParams]
|
|
92
|
+
* @returns {Promise<AxiosResponse<OwnListingsResponse<"close", P, EP>>>}
|
|
93
|
+
*/
|
|
94
|
+
close<P extends OwnListingsCloseParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<OwnListingsResponse<"close", P, EP>>>;
|
|
95
|
+
/**
|
|
96
|
+
* Re-open a closed listing
|
|
97
|
+
*
|
|
98
|
+
* @template P
|
|
99
|
+
* @template EP
|
|
100
|
+
* @param {P & OwnListingsOpenParameter} params
|
|
101
|
+
* @param {EP} [extraParams]
|
|
102
|
+
* @returns {Promise<AxiosResponse<OwnListingsResponse<"open", P, EP>>>}
|
|
103
|
+
*/
|
|
104
|
+
open<P extends OwnListingsOpenParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<OwnListingsResponse<"open", P, EP>>>;
|
|
105
|
+
/**
|
|
106
|
+
* Attach an uploaded image to a listing
|
|
107
|
+
*
|
|
108
|
+
* @template P
|
|
109
|
+
* @template EP
|
|
110
|
+
* @param {P & OwnListingsAddImageParameter} params
|
|
111
|
+
* @param {EP} [extraParams]
|
|
112
|
+
* @returns {Promise<AxiosResponse<OwnListingsResponse<"addImage", P, EP>>>}
|
|
113
|
+
*/
|
|
114
|
+
addImage<P extends OwnListingsAddImageParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<OwnListingsResponse<"addImage", P, EP>>>;
|
|
115
|
+
}
|
|
116
|
+
export default OwnListings;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Client for password reset operations in the Sharetribe Marketplace API.
|
|
3
|
+
*
|
|
4
|
+
* Use this to request a password-reset email and to complete the password reset flow.
|
|
5
|
+
*
|
|
6
|
+
* @see https://www.sharetribe.com/api-reference/marketplace.html#password-reset
|
|
7
|
+
*/
|
|
8
|
+
import type { AxiosResponse } from "axios";
|
|
9
|
+
import MarketplaceApi from "./index";
|
|
10
|
+
import { ExtraParameter, PasswordResetRequestParameter, PasswordResetResetParameter, PasswordResetResponse } from "../../types";
|
|
11
|
+
/**
|
|
12
|
+
* Password Reset API client
|
|
13
|
+
*/
|
|
14
|
+
declare class PasswordReset {
|
|
15
|
+
private readonly axios;
|
|
16
|
+
private readonly endpoint;
|
|
17
|
+
private readonly headers;
|
|
18
|
+
constructor(api: MarketplaceApi);
|
|
19
|
+
/**
|
|
20
|
+
* Request a password-reset email
|
|
21
|
+
*
|
|
22
|
+
* @template P
|
|
23
|
+
* @template EP
|
|
24
|
+
* @param {P & PasswordResetRequestParameter} params
|
|
25
|
+
* @param {EP} [extraParams]
|
|
26
|
+
* @returns {Promise<AxiosResponse<PasswordResetResponse<"request", EP>>>}
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* await sdk.passwordReset.request({ email: "user@example.com" });
|
|
30
|
+
*/
|
|
31
|
+
request<P extends PasswordResetRequestParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<PasswordResetResponse<"request", EP>>>;
|
|
32
|
+
/**
|
|
33
|
+
* Complete password reset using the token received by email
|
|
34
|
+
*
|
|
35
|
+
* @template P
|
|
36
|
+
* @template EP
|
|
37
|
+
* @param {P & PasswordResetResetParameter} params
|
|
38
|
+
* @param {EP} [extraParams]
|
|
39
|
+
* @returns {Promise<AxiosResponse<PasswordResetResponse<"reset", EP>>>}
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* await sdk.passwordReset.reset({
|
|
43
|
+
* email: "user@example.com",
|
|
44
|
+
* passwordResetToken: "abc123...",
|
|
45
|
+
* newPassword: "newSecurePassword123"
|
|
46
|
+
* });
|
|
47
|
+
*/
|
|
48
|
+
reset<P extends PasswordResetResetParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<PasswordResetResponse<"reset", EP>>>;
|
|
49
|
+
}
|
|
50
|
+
export default PasswordReset;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Client for querying process transitions in the Sharetribe Marketplace API.
|
|
3
|
+
*
|
|
4
|
+
* Process transitions define the state machine of a transaction process (e.g. booking, sale).
|
|
5
|
+
* Use this endpoint to inspect available transitions and their parameters.
|
|
6
|
+
*
|
|
7
|
+
* @see https://www.sharetribe.com/api-reference/marketplace.html#process-transitions
|
|
8
|
+
*/
|
|
9
|
+
import type { AxiosResponse } from "axios";
|
|
10
|
+
import MarketplaceApi from "./index";
|
|
11
|
+
import { ProcessTransitionsQueryParameter, ProcessTransitionsResponse } from "../../types";
|
|
12
|
+
/**
|
|
13
|
+
* Process Transitions API client
|
|
14
|
+
*/
|
|
15
|
+
declare class ProcessTransitions {
|
|
16
|
+
readonly authRequired = true;
|
|
17
|
+
private readonly axios;
|
|
18
|
+
private readonly endpoint;
|
|
19
|
+
private readonly headers;
|
|
20
|
+
constructor(api: MarketplaceApi);
|
|
21
|
+
/**
|
|
22
|
+
* Query available process transitions
|
|
23
|
+
*
|
|
24
|
+
* @template P
|
|
25
|
+
* @param {P & ProcessTransitionsQueryParameter} params
|
|
26
|
+
* @returns {Promise<AxiosResponse<ProcessTransitionsResponse<"query">>>}
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* // Fetch all transitions for the default booking process
|
|
30
|
+
* const { data } = await sdk.processTransitions.query({
|
|
31
|
+
* processAlias: "default-booking"
|
|
32
|
+
* });
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* // Inspect a specific transition
|
|
36
|
+
* await sdk.processTransitions.query({
|
|
37
|
+
* lastTransition: "transition/confirm-payment"
|
|
38
|
+
* });
|
|
39
|
+
*/
|
|
40
|
+
query<P extends ProcessTransitionsQueryParameter>(params: P): Promise<AxiosResponse<ProcessTransitionsResponse<"query">>>;
|
|
41
|
+
}
|
|
42
|
+
export default ProcessTransitions;
|