@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,65 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @fileoverview
|
|
3
|
-
* This class allows querying, creating, and deleting availability exceptions for resources in a Sharetribe marketplace.
|
|
2
|
+
* @fileoverview Client for managing availability exceptions in the Sharetribe Integration API.
|
|
4
3
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Availability exceptions override default availability rules for specific time ranges
|
|
5
|
+
* (e.g. blocking off dates for maintenance or special events).
|
|
6
|
+
*
|
|
7
|
+
* @see https://www.sharetribe.com/api-reference/integration.html#availability-exceptions
|
|
7
8
|
*/
|
|
8
|
-
import { AxiosResponse } from "axios";
|
|
9
|
+
import type { AxiosResponse } from "axios";
|
|
9
10
|
import IntegrationApi 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
|
-
* Availability exceptions are used to override default availability rules for specific time ranges.
|
|
16
|
-
* This class provides methods to query, create, and delete such exceptions.
|
|
13
|
+
* Availability exceptions API client
|
|
17
14
|
*/
|
|
18
15
|
declare class AvailabilityExceptions {
|
|
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 AvailabilityExceptions class.
|
|
25
|
-
*
|
|
26
|
-
* @param {MarketplaceApi} api - The Marketplace API instance providing configuration and request handling.
|
|
27
|
-
*/
|
|
28
20
|
constructor(api: IntegrationApi);
|
|
29
21
|
/**
|
|
30
|
-
*
|
|
22
|
+
* Query availability exceptions
|
|
31
23
|
*
|
|
32
24
|
* @template P
|
|
33
|
-
* @param {P & AvailabilityExceptionsQueryParameter} params
|
|
34
|
-
* @returns {Promise<AvailabilityExceptionsResponse<
|
|
25
|
+
* @param {P & AvailabilityExceptionsQueryParameter} params
|
|
26
|
+
* @returns {Promise<AxiosResponse<AvailabilityExceptionsResponse<"query", P>>>}
|
|
35
27
|
*
|
|
36
28
|
* @example
|
|
37
|
-
* const
|
|
38
|
-
* listingId:
|
|
39
|
-
* start:
|
|
40
|
-
* end:
|
|
29
|
+
* const { data } = await sdk.availabilityExceptions.query({
|
|
30
|
+
* listingId: "123-abc",
|
|
31
|
+
* start: "2025-01-01",
|
|
32
|
+
* end: "2025-01-31"
|
|
41
33
|
* });
|
|
42
|
-
*
|
|
43
|
-
* // Access the list of exceptions
|
|
44
|
-
* const exceptions = response.data;
|
|
45
34
|
*/
|
|
46
35
|
query<P extends AvailabilityExceptionsQueryParameter>(params: P): Promise<AxiosResponse<AvailabilityExceptionsResponse<"query", P>>>;
|
|
47
36
|
/**
|
|
48
|
-
*
|
|
37
|
+
* Create a new availability exception
|
|
49
38
|
*
|
|
50
39
|
* @template P
|
|
51
40
|
* @template EP
|
|
52
|
-
* @param {P & AvailabilityExceptionsCreateParameter} params
|
|
53
|
-
* @param {EP
|
|
54
|
-
* @returns {Promise<AvailabilityExceptionsResponse<
|
|
41
|
+
* @param {P & AvailabilityExceptionsCreateParameter} params
|
|
42
|
+
* @param {EP} [extraParams] - Optional extra parameters (e.g. expand)
|
|
43
|
+
* @returns {Promise<AxiosResponse<AvailabilityExceptionsResponse<"create", P, EP>>>}
|
|
55
44
|
*
|
|
56
45
|
* @example
|
|
57
|
-
*
|
|
58
|
-
* listingId:
|
|
59
|
-
* start:
|
|
60
|
-
* end:
|
|
46
|
+
* await sdk.availabilityExceptions.create({
|
|
47
|
+
* listingId: "123-abc",
|
|
48
|
+
* start: "2025-12-24",
|
|
49
|
+
* end: "2025-12-26",
|
|
61
50
|
* seats: 0
|
|
62
51
|
* });
|
|
63
|
-
*
|
|
64
|
-
* // Access the created exception
|
|
65
|
-
* const createdException = response.data;
|
|
66
52
|
*/
|
|
67
|
-
create<P extends AvailabilityExceptionsCreateParameter, EP extends ExtraParameter>(params: P, extraParams?: EP
|
|
53
|
+
create<P extends AvailabilityExceptionsCreateParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<AvailabilityExceptionsResponse<"create", P, EP>>>;
|
|
68
54
|
/**
|
|
69
|
-
*
|
|
55
|
+
* Delete an availability exception
|
|
70
56
|
*
|
|
71
57
|
* @template P
|
|
72
|
-
* @param {P & AvailabilityExceptionsDeleteParameter} params
|
|
73
|
-
* @returns {Promise<AvailabilityExceptionsResponse<
|
|
58
|
+
* @param {P & AvailabilityExceptionsDeleteParameter} params
|
|
59
|
+
* @returns {Promise<AxiosResponse<AvailabilityExceptionsResponse<"delete", P>>>}
|
|
74
60
|
*
|
|
75
61
|
* @example
|
|
76
|
-
*
|
|
77
|
-
* id: 'exception-id'
|
|
78
|
-
* });
|
|
79
|
-
*
|
|
80
|
-
* // Check the deletion result
|
|
81
|
-
* const result = response.data;
|
|
62
|
+
* await sdk.availabilityExceptions.delete({ id: "exc-456-def" });
|
|
82
63
|
*/
|
|
83
64
|
delete<P extends AvailabilityExceptionsDeleteParameter>(params: P): Promise<AxiosResponse<AvailabilityExceptionsResponse<"delete", P>>>;
|
|
84
65
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvailabilityExceptions.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/integrationApi/AvailabilityExceptions.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"AvailabilityExceptions.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/integrationApi/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;;;;;;;;;;;;;;;;OAgBG;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;;;;;;;;;OASG;IACG,MAAM,CAAC,CAAC,SAAS,qCAAqC,EAC1D,MAAM,EAAE,CAAC,GACR,OAAO,CAAC,aAAa,CAAC,8BAA8B,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC;CAKvE;AAED,eAAe,sBAAsB,CAAC"}
|
|
@@ -1,48 +1,44 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @fileoverview
|
|
3
|
-
* This class allows querying events related to bookings or other entities in a Sharetribe marketplace.
|
|
2
|
+
* @fileoverview Client for querying events in the Sharetribe Integration API.
|
|
4
3
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* The Events API provides a stream of marketplace events (e.g. listing created, transaction transitioned)
|
|
5
|
+
* for building integrations, webhooks, analytics, or real-time features.
|
|
6
|
+
*
|
|
7
|
+
* @see https://www.sharetribe.com/api-reference/integration.html#events
|
|
7
8
|
*/
|
|
8
|
-
import { AxiosResponse } from "axios";
|
|
9
|
+
import type { AxiosResponse } from "axios";
|
|
9
10
|
import IntegrationApi from "./index";
|
|
10
|
-
import {
|
|
11
|
+
import { EventsQueryParameter, EventsResponse } from "../../types";
|
|
11
12
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* The Events API provides access to event data, such as booking events, allowing integration with external systems.
|
|
13
|
+
* Events API client
|
|
15
14
|
*/
|
|
16
15
|
declare class Events {
|
|
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 Events class.
|
|
22
|
-
*
|
|
23
|
-
* @param {MarketplaceApi} api - The Marketplace API instance providing configuration and request handling.
|
|
24
|
-
*/
|
|
25
19
|
constructor(api: IntegrationApi);
|
|
26
20
|
/**
|
|
27
|
-
*
|
|
21
|
+
* Query marketplace events
|
|
28
22
|
*
|
|
29
23
|
* @template P
|
|
30
|
-
* @param {P &
|
|
31
|
-
* @returns {Promise<EventsResponse<
|
|
24
|
+
* @param {P & EventsQueryParameter} params - Query filters and pagination
|
|
25
|
+
* @returns {Promise<AxiosResponse<EventsResponse<"query">>>}
|
|
32
26
|
*
|
|
33
27
|
* @example
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* relatedResourceId: 'related-resource-id',
|
|
39
|
-
* eventTypes: ['eventType1', 'eventType2'],
|
|
28
|
+
* // Fetch events after a specific sequence ID
|
|
29
|
+
* const response = await sdk.events.query({
|
|
30
|
+
* startAfterSequenceId: 12345,
|
|
31
|
+
* eventTypes: ["transaction/initiated", "booking/created"]
|
|
40
32
|
* });
|
|
41
33
|
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
34
|
+
* @example
|
|
35
|
+
* // Fetch recent events for a specific listing
|
|
36
|
+
* await sdk.events.query({
|
|
37
|
+
* resourceId: "listing-abc-123",
|
|
38
|
+
* createdAtStart: "2025-01-01T00:00:00Z"
|
|
39
|
+
* });
|
|
44
40
|
*/
|
|
45
|
-
query<P extends
|
|
41
|
+
query<P extends EventsQueryParameter>(params: P): Promise<AxiosResponse<EventsResponse<"query">>>;
|
|
46
42
|
}
|
|
47
43
|
export default Events;
|
|
48
44
|
//# sourceMappingURL=Events.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Events.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/integrationApi/Events.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"Events.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/integrationApi/Events.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAgB,aAAa,EAAC,MAAM,OAAO,CAAC;AACxD,OAAO,cAAc,MAAM,SAAS,CAAC;AACrC,OAAO,EAAC,oBAAoB,EAAE,cAAc,EAAC,MAAM,aAAa,CAAC;AAEjE;;GAEG;AACH,cAAM,MAAM;IACV,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;;;;;;;;;;;;;;;;;;;;OAoBG;IACG,KAAK,CAAC,CAAC,SAAS,oBAAoB,EACxC,MAAM,EAAE,CAAC,GACR,OAAO,CAAC,aAAa,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;CAMnD;AAED,eAAe,MAAM,CAAC"}
|
|
@@ -1,48 +1,37 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @fileoverview
|
|
3
|
-
* This class allows uploading images to be used as resources in a Sharetribe marketplace.
|
|
2
|
+
* @fileoverview Client for uploading images in the Sharetribe Integration API.
|
|
4
3
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Images uploaded via this endpoint can be attached to listings, user profiles, or used as assets.
|
|
5
|
+
*
|
|
6
|
+
* @see https://www.sharetribe.com/api-reference/integration.html#images
|
|
7
7
|
*/
|
|
8
|
-
import { AxiosResponse } from "axios";
|
|
8
|
+
import type { AxiosResponse } from "axios";
|
|
9
9
|
import IntegrationApi from "./index";
|
|
10
|
-
import { ImagesResponse, ImagesUploadParameter } from "../../types
|
|
11
|
-
import { ExtraParameter } from "../../types/sharetribe";
|
|
10
|
+
import { ExtraParameter, ImagesResponse, ImagesUploadParameter } from "../../types";
|
|
12
11
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* The Images API allows uploading images to the marketplace for use in listings or other resources.
|
|
12
|
+
* Images API client
|
|
16
13
|
*/
|
|
17
14
|
declare class Images {
|
|
18
|
-
|
|
15
|
+
readonly authRequired = true;
|
|
19
16
|
private readonly axios;
|
|
17
|
+
private readonly endpoint;
|
|
20
18
|
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
19
|
constructor(api: IntegrationApi);
|
|
28
20
|
/**
|
|
29
|
-
*
|
|
21
|
+
* Upload an image
|
|
30
22
|
*
|
|
31
23
|
* @template P
|
|
32
24
|
* @template EP
|
|
33
|
-
* @param {P & ImagesUploadParameter} params -
|
|
34
|
-
* @param {EP
|
|
35
|
-
* @returns {Promise<ImagesResponse<
|
|
25
|
+
* @param {P & ImagesUploadParameter} params - Upload parameters (must include `image: File`)
|
|
26
|
+
* @param {EP} [extraParams] - Optional extra parameters (e.g. `expand: true`)
|
|
27
|
+
* @returns {Promise<AxiosResponse<ImagesResponse<"upload", EP>>>}
|
|
36
28
|
*
|
|
37
29
|
* @example
|
|
38
|
-
* const
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
* // Access the uploaded image details
|
|
43
|
-
* const imageDetails = response.data;
|
|
30
|
+
* const file = input.files[0];
|
|
31
|
+
* const { data } = await sdk.images.upload({ image: file });
|
|
32
|
+
* console.log(data.id); // → "img-abc123"
|
|
44
33
|
*/
|
|
45
|
-
upload<P extends ImagesUploadParameter, EP extends ExtraParameter>(params: P, extraParams?: EP
|
|
34
|
+
upload<P extends ImagesUploadParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<ImagesResponse<"upload", EP>>>;
|
|
46
35
|
}
|
|
47
36
|
export default Images;
|
|
48
37
|
//# sourceMappingURL=Images.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Images.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/integrationApi/Images.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"Images.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/integrationApi/Images.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAgB,aAAa,EAAC,MAAM,OAAO,CAAC;AACxD,OAAO,cAAc,MAAM,SAAS,CAAC;AACrC,OAAO,EAAC,cAAc,EAAE,cAAc,EAAE,qBAAqB,EAAC,MAAM,aAAa,CAAC;AAElF;;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;;;;;;;;;;;;;OAaG;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,150 +1,88 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @fileoverview
|
|
3
|
-
* This class allows creating, updating, querying, and performing other operations on marketplace listings.
|
|
2
|
+
* @fileoverview Client for managing listings in the Sharetribe Integration API.
|
|
4
3
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* This privileged API allows creating, updating, querying, approving, opening, and closing listings
|
|
5
|
+
* on behalf of users — typically used by admin tools, onboarding flows, or backend services.
|
|
6
|
+
*
|
|
7
|
+
* @see https://www.sharetribe.com/api-reference/integration.html#listings
|
|
7
8
|
*/
|
|
8
|
-
import { AxiosResponse } from "axios";
|
|
9
|
+
import type { AxiosResponse } from "axios";
|
|
9
10
|
import IntegrationApi from "./index";
|
|
10
|
-
import { ListingsApproveParameter, ListingsCloseParameter, ListingsCreateParameter, ListingsOpenParameter, ListingsQueryParameter, ListingsResponse, ListingsShowParameter, ListingsUpdateParameter } from "../../types
|
|
11
|
-
import { ExtraParameter } from "../../types/sharetribe";
|
|
11
|
+
import { ExtraParameter, ListingsApproveParameter, ListingsCloseParameter, ListingsCreateParameter, ListingsOpenParameter, ListingsQueryParameter, ListingsResponse, ListingsShowParameter, ListingsUpdateParameter } from "../../types";
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* The Listings API provides methods to manage marketplace listings, such as creating, updating, querying, and approving listings.
|
|
13
|
+
* Listings API client (privileged)
|
|
16
14
|
*/
|
|
17
15
|
declare class Listings {
|
|
18
|
-
private readonly endpoint;
|
|
19
16
|
private readonly axios;
|
|
17
|
+
private readonly endpoint;
|
|
20
18
|
private readonly headers;
|
|
21
|
-
/**
|
|
22
|
-
* Creates an instance of the Listings class.
|
|
23
|
-
*
|
|
24
|
-
* @param {IntegrationApi} api - The Marketplace API instance providing configuration and request handling.
|
|
25
|
-
*/
|
|
26
19
|
constructor(api: IntegrationApi);
|
|
27
20
|
/**
|
|
28
|
-
*
|
|
21
|
+
* Fetch a single listing by ID
|
|
29
22
|
*
|
|
30
23
|
* @template P
|
|
31
|
-
* @param {P & ListingsShowParameter} params
|
|
32
|
-
* @returns {Promise<ListingsResponse<
|
|
33
|
-
*
|
|
34
|
-
* @example
|
|
35
|
-
* const response = await integrationSdk.listings.show({
|
|
36
|
-
* id: 'listing-id'
|
|
37
|
-
* });
|
|
38
|
-
*
|
|
39
|
-
* const listing = response.data;
|
|
24
|
+
* @param {P & ListingsShowParameter} params
|
|
25
|
+
* @returns {Promise<AxiosResponse<ListingsResponse<"show", P>>>}
|
|
40
26
|
*/
|
|
41
|
-
show<P extends ListingsShowParameter>(params: P): Promise<AxiosResponse<ListingsResponse<"show", P
|
|
27
|
+
show<P extends ListingsShowParameter>(params: P): Promise<AxiosResponse<ListingsResponse<"show", P>>>;
|
|
42
28
|
/**
|
|
43
|
-
*
|
|
29
|
+
* Query listings with filters
|
|
44
30
|
*
|
|
45
31
|
* @template P
|
|
46
|
-
* @param {P & ListingsQueryParameter} params
|
|
47
|
-
* @returns {Promise<ListingsResponse<
|
|
48
|
-
*
|
|
49
|
-
* @example
|
|
50
|
-
* const response = await integrationSdk.listings.query({
|
|
51
|
-
* ids: ['listing-id-1', 'listing-id-2'],
|
|
52
|
-
* per_page: 10,
|
|
53
|
-
* page: 1
|
|
54
|
-
* });
|
|
55
|
-
*
|
|
56
|
-
* const listings = response.data;
|
|
32
|
+
* @param {P & ListingsQueryParameter} params
|
|
33
|
+
* @returns {Promise<AxiosResponse<ListingsResponse<"query", P>>>}
|
|
57
34
|
*/
|
|
58
|
-
query<P extends ListingsQueryParameter>(params: P): Promise<AxiosResponse<ListingsResponse<"query", P
|
|
35
|
+
query<P extends ListingsQueryParameter>(params: P): Promise<AxiosResponse<ListingsResponse<"query", P>>>;
|
|
59
36
|
/**
|
|
60
|
-
*
|
|
37
|
+
* Create a new listing
|
|
61
38
|
*
|
|
62
39
|
* @template P
|
|
63
40
|
* @template EP
|
|
64
|
-
* @param {P & ListingsCreateParameter} params
|
|
65
|
-
* @param {EP
|
|
66
|
-
* @returns {Promise<ListingsResponse<
|
|
67
|
-
*
|
|
68
|
-
* @example
|
|
69
|
-
* const response = await integrationSdk.listings.create({
|
|
70
|
-
* title: 'New Listing',
|
|
71
|
-
* description: 'Description of the listing',
|
|
72
|
-
* authorId: 'user-id',
|
|
73
|
-
* state: 'published'
|
|
74
|
-
* });
|
|
75
|
-
*
|
|
76
|
-
* const newListing = response.data;
|
|
41
|
+
* @param {P & ListingsCreateParameter} params
|
|
42
|
+
* @param {EP} [extraParams] - Optional extra parameters (e.g. `expand: true`)
|
|
43
|
+
* @returns {Promise<AxiosResponse<ListingsResponse<"create", P, EP>>>}
|
|
77
44
|
*/
|
|
78
|
-
create<P extends ListingsCreateParameter, EP extends ExtraParameter>(params: P, extraParams?: EP): Promise<AxiosResponse<ListingsResponse<"create", P, EP
|
|
45
|
+
create<P extends ListingsCreateParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<ListingsResponse<"create", P, EP>>>;
|
|
79
46
|
/**
|
|
80
|
-
*
|
|
47
|
+
* Update an existing listing
|
|
81
48
|
*
|
|
82
49
|
* @template P
|
|
83
50
|
* @template EP
|
|
84
|
-
* @param {P & ListingsUpdateParameter} params
|
|
85
|
-
* @param {EP
|
|
86
|
-
* @returns {Promise<ListingsResponse<
|
|
87
|
-
*
|
|
88
|
-
* @example
|
|
89
|
-
* const response = await integrationSdk.listings.update({
|
|
90
|
-
* id: 'listing-id',
|
|
91
|
-
* title: 'Updated Title'
|
|
92
|
-
* });
|
|
93
|
-
*
|
|
94
|
-
* const updatedListing = response.data;
|
|
51
|
+
* @param {P & ListingsUpdateParameter} params
|
|
52
|
+
* @param {EP} [extraParams]
|
|
53
|
+
* @returns {Promise<AxiosResponse<ListingsResponse<"update", P, EP>>>}
|
|
95
54
|
*/
|
|
96
|
-
update<P extends ListingsUpdateParameter, EP extends ExtraParameter>(params: P, extraParams?: EP): Promise<AxiosResponse<ListingsResponse<"update", P, EP
|
|
55
|
+
update<P extends ListingsUpdateParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<ListingsResponse<"update", P, EP>>>;
|
|
97
56
|
/**
|
|
98
|
-
*
|
|
57
|
+
* Close a listing
|
|
99
58
|
*
|
|
100
59
|
* @template P
|
|
101
60
|
* @template EP
|
|
102
|
-
* @param {P & ListingsCloseParameter} params
|
|
103
|
-
* @param {EP
|
|
104
|
-
* @returns {Promise<ListingsResponse<
|
|
105
|
-
*
|
|
106
|
-
* @example
|
|
107
|
-
* const response = await integrationSdk.listings.close({
|
|
108
|
-
* id: 'listing-id'
|
|
109
|
-
* });
|
|
110
|
-
*
|
|
111
|
-
* const closedListing = response.data;
|
|
61
|
+
* @param {P & ListingsCloseParameter} params
|
|
62
|
+
* @param {EP} [extraParams]
|
|
63
|
+
* @returns {Promise<AxiosResponse<ListingsResponse<"close", P, EP>>>}
|
|
112
64
|
*/
|
|
113
|
-
close<P extends ListingsCloseParameter, EP extends ExtraParameter>(params: P, extraParams?: EP): Promise<AxiosResponse<ListingsResponse<"close", P, EP
|
|
65
|
+
close<P extends ListingsCloseParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<ListingsResponse<"close", P, EP>>>;
|
|
114
66
|
/**
|
|
115
|
-
*
|
|
67
|
+
* Open a previously closed listing
|
|
116
68
|
*
|
|
117
69
|
* @template P
|
|
118
70
|
* @template EP
|
|
119
|
-
* @param {P & ListingsOpenParameter} params
|
|
120
|
-
* @param {EP
|
|
121
|
-
* @returns {Promise<ListingsResponse<
|
|
122
|
-
*
|
|
123
|
-
* @example
|
|
124
|
-
* const response = await integrationSdk.listings.open({
|
|
125
|
-
* id: 'listing-id'
|
|
126
|
-
* });
|
|
127
|
-
*
|
|
128
|
-
* const openedListing = response.data;
|
|
71
|
+
* @param {P & ListingsOpenParameter} params
|
|
72
|
+
* @param {EP} [extraParams]
|
|
73
|
+
* @returns {Promise<AxiosResponse<ListingsResponse<"open", P, EP>>>}
|
|
129
74
|
*/
|
|
130
|
-
open<P extends ListingsOpenParameter, EP extends ExtraParameter>(params: P, extraParams?: EP): Promise<AxiosResponse<ListingsResponse<"open", P, EP
|
|
75
|
+
open<P extends ListingsOpenParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<ListingsResponse<"open", P, EP>>>;
|
|
131
76
|
/**
|
|
132
|
-
*
|
|
77
|
+
* Approve a pending listing (admin only)
|
|
133
78
|
*
|
|
134
79
|
* @template P
|
|
135
80
|
* @template EP
|
|
136
|
-
* @param {P & ListingsApproveParameter} params
|
|
137
|
-
* @param {EP
|
|
138
|
-
* @returns {Promise<ListingsResponse<
|
|
139
|
-
*
|
|
140
|
-
* @example
|
|
141
|
-
* const response = await integrationSdk.listings.approve({
|
|
142
|
-
* id: 'listing-id'
|
|
143
|
-
* });
|
|
144
|
-
*
|
|
145
|
-
* const approvedListing = response.data;
|
|
81
|
+
* @param {P & ListingsApproveParameter} params
|
|
82
|
+
* @param {EP} [extraParams]
|
|
83
|
+
* @returns {Promise<AxiosResponse<ListingsResponse<"approve", P, EP>>>}
|
|
146
84
|
*/
|
|
147
|
-
approve<P extends ListingsApproveParameter, EP extends ExtraParameter>(params: P, extraParams?: EP): Promise<AxiosResponse<ListingsResponse<"approve", P, EP
|
|
85
|
+
approve<P extends ListingsApproveParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<ListingsResponse<"approve", P, EP>>>;
|
|
148
86
|
}
|
|
149
87
|
export default Listings;
|
|
150
88
|
//# sourceMappingURL=Listings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Listings.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/integrationApi/Listings.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"Listings.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/integrationApi/Listings.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAgB,aAAa,EAAC,MAAM,OAAO,CAAC;AACxD,OAAO,cAAc,MAAM,SAAS,CAAC;AACrC,OAAO,EACL,cAAc,EACd,wBAAwB,EACxB,sBAAsB,EACtB,uBAAuB,EACvB,qBAAqB,EACrB,sBAAsB,EACtB,gBAAgB,EAChB,qBAAqB,EACrB,uBAAuB,EACxB,MAAM,aAAa,CAAC;AAErB;;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;;;;;;OAMG;IACG,IAAI,CAAC,CAAC,SAAS,qBAAqB,EACxC,MAAM,EAAE,CAAC,GACR,OAAO,CAAC,aAAa,CAAC,gBAAgB,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC;IAOtD;;;;;;OAMG;IACG,KAAK,CAAC,CAAC,SAAS,sBAAsB,EAC1C,MAAM,EAAE,CAAC,GACR,OAAO,CAAC,aAAa,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;IAOvD;;;;;;;;OAQG;IACG,MAAM,CACV,CAAC,SAAS,uBAAuB,EACjC,EAAE,SAAS,cAAc,GAAG,SAAS,GAAG,SAAS,EAEjD,MAAM,EAAE,CAAC,EACT,WAAW,CAAC,EAAE,EAAE,GACf,OAAO,CAAC,aAAa,CAAC,gBAAgB,CAAC,QAAQ,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IAQ5D;;;;;;;;OAQG;IACG,MAAM,CACV,CAAC,SAAS,uBAAuB,EACjC,EAAE,SAAS,cAAc,GAAG,SAAS,GAAG,SAAS,EAEjD,MAAM,EAAE,CAAC,EACT,WAAW,CAAC,EAAE,EAAE,GACf,OAAO,CAAC,aAAa,CAAC,gBAAgB,CAAC,QAAQ,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IAQ5D;;;;;;;;OAQG;IACG,KAAK,CACT,CAAC,SAAS,sBAAsB,EAChC,EAAE,SAAS,cAAc,GAAG,SAAS,GAAG,SAAS,EAEjD,MAAM,EAAE,CAAC,EACT,WAAW,CAAC,EAAE,EAAE,GACf,OAAO,CAAC,aAAa,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IAQ3D;;;;;;;;OAQG;IACG,IAAI,CACR,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,gBAAgB,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IAQ1D;;;;;;;;OAQG;IACG,OAAO,CACX,CAAC,SAAS,wBAAwB,EAClC,EAAE,SAAS,cAAc,GAAG,SAAS,GAAG,SAAS,EAEjD,MAAM,EAAE,CAAC,EACT,WAAW,CAAC,EAAE,EAAE,GACf,OAAO,CAAC,aAAa,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;CAO9D;AAED,eAAe,QAAQ,CAAC"}
|
|
@@ -1,37 +1,29 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @fileoverview
|
|
3
|
-
* This class allows fetching details about the marketplace configuration.
|
|
2
|
+
* @fileoverview Client for fetching marketplace configuration in the Sharetribe Integration API.
|
|
4
3
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Use this to retrieve metadata about the marketplace (name, description, currency, etc.).
|
|
5
|
+
*
|
|
6
|
+
* @see https://www.sharetribe.com/api-reference/integration.html#marketplace
|
|
7
7
|
*/
|
|
8
|
-
import { AxiosResponse } from "axios";
|
|
8
|
+
import type { AxiosResponse } from "axios";
|
|
9
9
|
import IntegrationApi from "./index";
|
|
10
|
-
import { MarketplaceResponse } from "../../types
|
|
10
|
+
import { MarketplaceResponse } from "../../types";
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* The Marketplace API provides methods to retrieve marketplace configuration details.
|
|
12
|
+
* Marketplace API client
|
|
15
13
|
*/
|
|
16
14
|
declare class Marketplace {
|
|
17
|
-
private readonly endpoint;
|
|
18
15
|
private readonly axios;
|
|
16
|
+
private readonly endpoint;
|
|
19
17
|
private readonly headers;
|
|
20
|
-
/**
|
|
21
|
-
* Creates an instance of the Marketplace class.
|
|
22
|
-
*
|
|
23
|
-
* @param {MarketplaceApi} api - The Marketplace API instance providing configuration and request handling.
|
|
24
|
-
*/
|
|
25
18
|
constructor(api: IntegrationApi);
|
|
26
19
|
/**
|
|
27
|
-
*
|
|
20
|
+
* Fetch current marketplace configuration
|
|
28
21
|
*
|
|
29
|
-
* @returns {Promise<AxiosResponse<MarketplaceResponse<
|
|
22
|
+
* @returns {Promise<AxiosResponse<MarketplaceResponse<"show">>>}
|
|
30
23
|
*
|
|
31
24
|
* @example
|
|
32
|
-
* const
|
|
33
|
-
*
|
|
34
|
-
* const marketplaceDetails = response.data;
|
|
25
|
+
* const { data } = await sdk.marketplace.show();
|
|
26
|
+
* console.log(data.attributes.name); // → "My Awesome Marketplace"
|
|
35
27
|
*/
|
|
36
28
|
show(): Promise<AxiosResponse<MarketplaceResponse<"show">>>;
|
|
37
29
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Marketplace.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/integrationApi/Marketplace.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"Marketplace.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/integrationApi/Marketplace.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAgB,aAAa,EAAC,MAAM,OAAO,CAAC;AACxD,OAAO,cAAc,MAAM,SAAS,CAAC;AACrC,OAAO,EAAC,mBAAmB,EAAC,MAAM,aAAa,CAAC;AAEhD;;GAEG;AACH,cAAM,WAAW;IACf,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;;;;;;;;OAQG;IACG,IAAI,IAAI,OAAO,CAAC,aAAa,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAAC;CAKlE;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -1,49 +1,43 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @fileoverview
|
|
3
|
-
* This class allows performing operations on stock, such as compare-and-set updates.
|
|
2
|
+
* @fileoverview Client for managing stock levels in the Sharetribe Integration API.
|
|
4
3
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* The Stock API provides atomic `compareAndSet` operations to safely update listing stock
|
|
5
|
+
* in concurrent environments (e.g. during checkout or inventory sync).
|
|
6
|
+
*
|
|
7
|
+
* @see https://www.sharetribe.com/api-reference/integration.html#stock
|
|
7
8
|
*/
|
|
8
|
-
import { AxiosResponse } from "axios";
|
|
9
|
+
import type { AxiosResponse } from "axios";
|
|
9
10
|
import IntegrationApi from "./index";
|
|
10
|
-
import { StockCompareAndSetParameter, StockResponse } from "../../types
|
|
11
|
-
import { ExtraParameter } from "../../types/sharetribe";
|
|
11
|
+
import { ExtraParameter, StockCompareAndSetParameter, StockResponse } from "../../types";
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* The Stock API provides methods to manage stock levels for marketplace resources.
|
|
13
|
+
* Stock API client (privileged)
|
|
16
14
|
*/
|
|
17
15
|
declare class Stock {
|
|
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 Stock class.
|
|
24
|
-
*
|
|
25
|
-
* @param {MarketplaceApi} api - The Marketplace API instance providing configuration and request handling.
|
|
26
|
-
*/
|
|
27
20
|
constructor(api: IntegrationApi);
|
|
28
21
|
/**
|
|
29
|
-
*
|
|
22
|
+
* Atomically update stock using compare-and-set
|
|
23
|
+
*
|
|
24
|
+
* Fails if current stock doesn't match `oldTotal` — prevents race conditions.
|
|
30
25
|
*
|
|
31
26
|
* @template P
|
|
32
27
|
* @template EP
|
|
33
|
-
* @param {P & StockCompareAndSetParameter} params
|
|
34
|
-
* @param {EP
|
|
35
|
-
* @returns {Promise<AxiosResponse<StockResponse<
|
|
28
|
+
* @param {P & StockCompareAndSetParameter} params
|
|
29
|
+
* @param {EP} [extraParams] - Optional extra parameters (e.g. `expand: true`)
|
|
30
|
+
* @returns {Promise<AxiosResponse<StockResponse<"compareAndSet", EP>>>}
|
|
36
31
|
*
|
|
37
32
|
* @example
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
33
|
+
* // Reserve 2 units if current stock is 10
|
|
34
|
+
* await sdk.stock.compareAndSet({
|
|
35
|
+
* listingId: "listing-abc123",
|
|
36
|
+
* oldTotal: 10,
|
|
37
|
+
* newTotal: 8
|
|
42
38
|
* });
|
|
43
|
-
*
|
|
44
|
-
* const updatedStock = response.data;
|
|
45
39
|
*/
|
|
46
|
-
compareAndSet<P extends StockCompareAndSetParameter, EP extends ExtraParameter>(params: P, extraParams?: EP
|
|
40
|
+
compareAndSet<P extends StockCompareAndSetParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<StockResponse<"compareAndSet", EP>>>;
|
|
47
41
|
}
|
|
48
42
|
export default Stock;
|
|
49
43
|
//# sourceMappingURL=Stock.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stock.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/integrationApi/Stock.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"Stock.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/integrationApi/Stock.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,2BAA2B,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAExF;;GAEG;AACH,cAAM,KAAK;IACT,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;;;;;;;;;;;;;;;;;;OAkBG;IACG,aAAa,CACjB,CAAC,SAAS,2BAA2B,EACrC,EAAE,SAAS,cAAc,GAAG,SAAS,GAAG,SAAS,EAEjD,MAAM,EAAE,CAAC,EACT,WAAW,CAAC,EAAE,EAAE,GACf,OAAO,CAAC,aAAa,CAAC,aAAa,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC,CAAC;CAO9D;AAED,eAAe,KAAK,CAAC"}
|