@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,65 +1,65 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @fileoverview
|
|
3
|
-
* This class allows querying and creating stock adjustment records.
|
|
2
|
+
* @fileoverview Client for managing stock adjustments in the Sharetribe Integration API.
|
|
4
3
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Stock adjustments are manual changes to listing stock (e.g. restocking, corrections, damage write-offs).
|
|
5
|
+
* They appear in the stock history and are separate from automatic reservation-based changes.
|
|
6
|
+
*
|
|
7
|
+
* @see https://www.sharetribe.com/api-reference/integration.html#stock-adjustments
|
|
7
8
|
*/
|
|
8
|
-
import { AxiosResponse } from "axios";
|
|
9
|
+
import type { AxiosResponse } from "axios";
|
|
9
10
|
import IntegrationApi from "./index";
|
|
10
|
-
import { StockAdjustmentsCreateParameter, StockAdjustmentsQueryParameter, StockAdjustmentsResponse } from "../../types
|
|
11
|
-
import { ExtraParameter } from "../../types/sharetribe";
|
|
11
|
+
import { ExtraParameter, StockAdjustmentsCreateParameter, StockAdjustmentsQueryParameter, StockAdjustmentsResponse } from "../../types";
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* The Stock Adjustments API provides methods to query and create stock adjustments for marketplace resources.
|
|
13
|
+
* Stock Adjustments API client (privileged)
|
|
16
14
|
*/
|
|
17
15
|
declare class StockAdjustments {
|
|
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 StockAdjustments class.
|
|
24
|
-
*
|
|
25
|
-
* @param {IntegrationApi} api - The Integration API instance providing configuration and request handling.
|
|
26
|
-
*/
|
|
27
20
|
constructor(api: IntegrationApi);
|
|
28
21
|
/**
|
|
29
|
-
*
|
|
22
|
+
* Query stock adjustment history
|
|
30
23
|
*
|
|
31
24
|
* @template P
|
|
32
|
-
* @param {P & StockAdjustmentsQueryParameter} params
|
|
33
|
-
* @returns {Promise<AxiosResponse<StockAdjustmentsResponse<
|
|
25
|
+
* @param {P & StockAdjustmentsQueryParameter} params
|
|
26
|
+
* @returns {Promise<AxiosResponse<StockAdjustmentsResponse<"query", P>>>}
|
|
34
27
|
*
|
|
35
28
|
* @example
|
|
36
|
-
* const
|
|
37
|
-
* listingId:
|
|
38
|
-
* start:
|
|
39
|
-
* end:
|
|
29
|
+
* const { data } = await sdk.stockAdjustments.query({
|
|
30
|
+
* listingId: "listing-abc123",
|
|
31
|
+
* start: "2025-01-01",
|
|
32
|
+
* end: "2025-01-31"
|
|
40
33
|
* });
|
|
41
|
-
*
|
|
42
|
-
* const adjustments = response.data;
|
|
43
34
|
*/
|
|
44
35
|
query<P extends StockAdjustmentsQueryParameter>(params: P): Promise<AxiosResponse<StockAdjustmentsResponse<"query", P>>>;
|
|
45
36
|
/**
|
|
46
|
-
*
|
|
37
|
+
* Create a manual stock adjustment
|
|
38
|
+
*
|
|
39
|
+
* Positive `quantity` = add stock
|
|
40
|
+
* Negative `quantity` = remove stock
|
|
47
41
|
*
|
|
48
42
|
* @template P
|
|
49
43
|
* @template EP
|
|
50
|
-
* @param {P & StockAdjustmentsCreateParameter} params
|
|
51
|
-
* @param {EP
|
|
52
|
-
* @returns {Promise<AxiosResponse<StockAdjustmentsResponse<
|
|
44
|
+
* @param {P & StockAdjustmentsCreateParameter} params
|
|
45
|
+
* @param {EP} [extraParams] - Optional extra parameters (e.g. `expand: true`)
|
|
46
|
+
* @returns {Promise<AxiosResponse<StockAdjustmentsResponse<"create", P, EP>>>}
|
|
53
47
|
*
|
|
54
48
|
* @example
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
49
|
+
* // Restock 50 units
|
|
50
|
+
* await sdk.stockAdjustments.create({
|
|
51
|
+
* listingId: "listing-abc123",
|
|
52
|
+
* quantity: 50
|
|
58
53
|
* });
|
|
59
54
|
*
|
|
60
|
-
*
|
|
55
|
+
* @example
|
|
56
|
+
* // Write off 3 damaged units
|
|
57
|
+
* await sdk.stockAdjustments.create({
|
|
58
|
+
* listingId: "listing-abc123",
|
|
59
|
+
* quantity: -3
|
|
60
|
+
* });
|
|
61
61
|
*/
|
|
62
|
-
create<P extends StockAdjustmentsCreateParameter, EP extends ExtraParameter | undefined>(params: P, extraParams?: EP
|
|
62
|
+
create<P extends StockAdjustmentsCreateParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<StockAdjustmentsResponse<"create", P, EP>>>;
|
|
63
63
|
}
|
|
64
64
|
export default StockAdjustments;
|
|
65
65
|
//# sourceMappingURL=StockAdjustments.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StockAdjustments.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/integrationApi/StockAdjustments.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"StockAdjustments.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/integrationApi/StockAdjustments.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,+BAA+B,EAC/B,8BAA8B,EAC9B,wBAAwB,EACzB,MAAM,aAAa,CAAC;AAErB;;GAEG;AACH,cAAM,gBAAgB;IACpB,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,8BAA8B,EAClD,MAAM,EAAE,CAAC,GACR,OAAO,CAAC,aAAa,CAAC,wBAAwB,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;IAO/D;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACG,MAAM,CACV,CAAC,SAAS,+BAA+B,EACzC,EAAE,SAAS,cAAc,GAAG,SAAS,GAAG,SAAS,EAEjD,MAAM,EAAE,CAAC,EACT,WAAW,CAAC,EAAE,EAAE,GACf,OAAO,CAAC,aAAa,CAAC,wBAAwB,CAAC,QAAQ,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;CAOrE;AAED,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Provides the StockReservation class for managing stock reservations in the Sharetribe Integration API.
|
|
3
|
+
* This class allows retrieving details about stock reservations.
|
|
4
|
+
*
|
|
5
|
+
* For more details, refer to the Integration API documentation:
|
|
6
|
+
* https://www.sharetribe.com/api-reference/integration.html#stock-reservations
|
|
7
|
+
*/
|
|
8
|
+
import { AxiosResponse } from "axios";
|
|
9
|
+
import IntegrationApi from "./index";
|
|
10
|
+
import { StockReservationShowParameter, StockReservationsResponse } from "../../types";
|
|
11
|
+
/**
|
|
12
|
+
* Class representing the Stock Reservations API.
|
|
13
|
+
*
|
|
14
|
+
* The Stock Reservations API provides methods to manage stock reservations for marketplace resources.
|
|
15
|
+
*/
|
|
16
|
+
declare class StockReservations {
|
|
17
|
+
private readonly endpoint;
|
|
18
|
+
private readonly axios;
|
|
19
|
+
private readonly headers;
|
|
20
|
+
/**
|
|
21
|
+
* Creates an instance of the StockReservation class.
|
|
22
|
+
*
|
|
23
|
+
* @param {IntegrationApi} api - The Integration API instance providing configuration and request handling.
|
|
24
|
+
*/
|
|
25
|
+
constructor(api: IntegrationApi);
|
|
26
|
+
/**
|
|
27
|
+
* Retrieves details about a specific stock reservation.
|
|
28
|
+
*
|
|
29
|
+
* @template P
|
|
30
|
+
* @param {P & StockReservationShowParameter} params - The parameters to identify the stock reservation.
|
|
31
|
+
* @returns {Promise<AxiosResponse<StockReservationsResponse<'show', P>>>} - A promise resolving to the stock reservation details.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* const response = await integrationSdk.stockReservations.show({
|
|
35
|
+
* id: 'reservation-id',
|
|
36
|
+
* });
|
|
37
|
+
*
|
|
38
|
+
* const reservationDetails = response.data;
|
|
39
|
+
*/
|
|
40
|
+
show<P extends StockReservationShowParameter>(params: P): Promise<AxiosResponse<StockReservationsResponse<"show", P>>>;
|
|
41
|
+
}
|
|
42
|
+
export default StockReservations;
|
|
43
|
+
//# sourceMappingURL=StockReservations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StockReservations.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/integrationApi/StockReservations.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAgB,aAAa,EAAC,MAAM,OAAO,CAAC;AACnD,OAAO,cAAc,MAAM,SAAS,CAAC;AACrC,OAAO,EAAC,6BAA6B,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAEtF;;;;GAIG;AACH,cAAM,iBAAiB;IACrB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAgB;IACtC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAyB;IAEjD;;;;OAIG;gBACS,GAAG,EAAE,cAAc;IAM/B;;;;;;;;;;;;;OAaG;IACG,IAAI,CAAC,CAAC,SAAS,6BAA6B,EAChD,MAAM,EAAE,CAAC,GACR,OAAO,CAAC,aAAa,CAAC,yBAAyB,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC;CAMhE;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,121 +1,77 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @fileoverview
|
|
3
|
-
* This class allows querying, transitioning, and updating metadata for transactions.
|
|
2
|
+
* @fileoverview Client for managing transactions in the Sharetribe Integration API.
|
|
4
3
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* This privileged API allows querying, transitioning, and updating metadata for transactions.
|
|
5
|
+
* Use it for admin tools, backend services, or automated workflows.
|
|
6
|
+
*
|
|
7
|
+
* @see https://www.sharetribe.com/api-reference/integration.html#transactions
|
|
7
8
|
*/
|
|
8
|
-
import { AxiosResponse } from "axios";
|
|
9
|
+
import type { AxiosResponse } from "axios";
|
|
9
10
|
import IntegrationApi from "./index";
|
|
10
|
-
import { TransactionsQueryParameter, TransactionsResponse, TransactionsShowParameter, TransactionsTransitionParameter, TransactionsTransitionSpeculativeParameter, TransactionsUpdateMetadataParameter } from "../../types
|
|
11
|
-
import { ExtraParameter } from "../../types/sharetribe";
|
|
11
|
+
import { ExtraParameter, TransactionsQueryParameter, TransactionsResponse, TransactionsShowParameter, TransactionsTransitionParameter, TransactionsTransitionSpeculativeParameter, TransactionsUpdateMetadataParameter } from "../../types";
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* The Transactions API provides methods to query, transition, and manage metadata for marketplace transactions.
|
|
13
|
+
* Transactions API client (privileged)
|
|
16
14
|
*/
|
|
17
15
|
declare class Transactions {
|
|
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 Transactions class.
|
|
24
|
-
*
|
|
25
|
-
* @param {IntegrationApi} api - The Integration API instance providing configuration and request handling.
|
|
26
|
-
*/
|
|
27
20
|
constructor(api: IntegrationApi);
|
|
28
21
|
/**
|
|
29
|
-
*
|
|
22
|
+
* Fetch a single transaction by ID
|
|
30
23
|
*
|
|
31
24
|
* @template P
|
|
32
|
-
* @param {P & TransactionsShowParameter} params
|
|
33
|
-
* @returns {Promise<AxiosResponse<TransactionsResponse<
|
|
34
|
-
*
|
|
35
|
-
* @example
|
|
36
|
-
* const response = await integrationSdk.transactions.show({
|
|
37
|
-
* id: 'transaction-id',
|
|
38
|
-
* });
|
|
39
|
-
*
|
|
40
|
-
* const transactionDetails = response.data;
|
|
25
|
+
* @param {P & TransactionsShowParameter} params
|
|
26
|
+
* @returns {Promise<AxiosResponse<TransactionsResponse<"show", P>>>}
|
|
41
27
|
*/
|
|
42
28
|
show<P extends TransactionsShowParameter>(params: P): Promise<AxiosResponse<TransactionsResponse<"show", P>>>;
|
|
43
29
|
/**
|
|
44
|
-
*
|
|
30
|
+
* Query transactions with privileged filters
|
|
45
31
|
*
|
|
46
32
|
* @template P
|
|
47
|
-
* @param {P & TransactionsQueryParameter<true>} params -
|
|
48
|
-
* @returns {Promise<AxiosResponse<TransactionsResponse<
|
|
49
|
-
*
|
|
50
|
-
* @example
|
|
51
|
-
* const response = await integrationSdk.transactions.query({
|
|
52
|
-
* createdAtStart: '2021-01-01T00:00:00Z',
|
|
53
|
-
* createdAtEnd: '2021-01-31T23:59:59Z',
|
|
54
|
-
* userId: 'user-id',
|
|
55
|
-
* customerId: 'customer-id',
|
|
56
|
-
* providerId: 'provider-id',
|
|
57
|
-
* listingId: 'listing-id',
|
|
58
|
-
* });
|
|
59
|
-
*
|
|
60
|
-
* const transactions = response.data;
|
|
33
|
+
* @param {P & TransactionsQueryParameter<true>} params - Note: `true` enables privileged fields like `customerId`, `providerId`
|
|
34
|
+
* @returns {Promise<AxiosResponse<TransactionsResponse<"query", P>>>}
|
|
61
35
|
*/
|
|
62
36
|
query<P extends TransactionsQueryParameter<true>>(params: P): Promise<AxiosResponse<TransactionsResponse<"query", P>>>;
|
|
63
37
|
/**
|
|
64
|
-
*
|
|
38
|
+
* Transition a transaction to a new state
|
|
65
39
|
*
|
|
66
40
|
* @template P
|
|
67
41
|
* @template EP
|
|
68
|
-
* @param {P & TransactionsTransitionParameter} params
|
|
69
|
-
* @param {EP
|
|
70
|
-
* @returns {Promise<AxiosResponse<TransactionsResponse<
|
|
42
|
+
* @param {P & TransactionsTransitionParameter} params
|
|
43
|
+
* @param {EP} [extraParams] - Optional extra parameters (e.g. `expand: true`)
|
|
44
|
+
* @returns {Promise<AxiosResponse<TransactionsResponse<"transition", P, EP>>>}
|
|
71
45
|
*
|
|
72
46
|
* @example
|
|
73
|
-
*
|
|
74
|
-
* id:
|
|
75
|
-
* transition:
|
|
76
|
-
* params: { key: 'value' },
|
|
47
|
+
* await sdk.transactions.transition({
|
|
48
|
+
* id: "tx-abc123",
|
|
49
|
+
* transition: "transition/confirm-payment"
|
|
77
50
|
* });
|
|
78
|
-
*
|
|
79
|
-
* const updatedTransaction = response.data;
|
|
80
51
|
*/
|
|
81
|
-
transition<P extends TransactionsTransitionParameter, EP extends ExtraParameter>(params: P, extraParams?: EP
|
|
52
|
+
transition<P extends TransactionsTransitionParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<TransactionsResponse<"transition", P, EP>>>;
|
|
82
53
|
/**
|
|
83
|
-
*
|
|
54
|
+
* Perform a speculative transition (dry-run)
|
|
55
|
+
*
|
|
56
|
+
* Does not persist changes — useful for validation before real transition.
|
|
84
57
|
*
|
|
85
58
|
* @template P
|
|
86
59
|
* @template EP
|
|
87
|
-
* @param {P & TransactionsTransitionSpeculativeParameter} params
|
|
88
|
-
* @param {EP
|
|
89
|
-
* @returns {Promise<AxiosResponse<TransactionsResponse<
|
|
90
|
-
*
|
|
91
|
-
* @example
|
|
92
|
-
* const response = await integrationSdk.transactions.transitionSpeculative({
|
|
93
|
-
* id: 'transaction-id',
|
|
94
|
-
* transition: 'accept',
|
|
95
|
-
* params: { key: 'value' },
|
|
96
|
-
* });
|
|
97
|
-
*
|
|
98
|
-
* const speculativeResult = response.data;
|
|
60
|
+
* @param {P & TransactionsTransitionSpeculativeParameter} params
|
|
61
|
+
* @param {EP} [extraParams]
|
|
62
|
+
* @returns {Promise<AxiosResponse<TransactionsResponse<"transitionSpeculative", P, EP>>>}
|
|
99
63
|
*/
|
|
100
|
-
transitionSpeculative<P extends TransactionsTransitionSpeculativeParameter, EP extends ExtraParameter>(params: P, extraParams?: EP
|
|
64
|
+
transitionSpeculative<P extends TransactionsTransitionSpeculativeParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<TransactionsResponse<"transitionSpeculative", P, EP>>>;
|
|
101
65
|
/**
|
|
102
|
-
*
|
|
66
|
+
* Update transaction metadata
|
|
103
67
|
*
|
|
104
68
|
* @template P
|
|
105
69
|
* @template EP
|
|
106
|
-
* @param {P & TransactionsUpdateMetadataParameter} params
|
|
107
|
-
* @param {EP
|
|
108
|
-
* @returns {Promise<AxiosResponse<TransactionsResponse<
|
|
109
|
-
*
|
|
110
|
-
* @example
|
|
111
|
-
* const response = await integrationSdk.transactions.updateMetadata({
|
|
112
|
-
* id: 'transaction-id',
|
|
113
|
-
* metadata: { key: 'value' },
|
|
114
|
-
* });
|
|
115
|
-
*
|
|
116
|
-
* const updatedMetadata = response.data;
|
|
70
|
+
* @param {P & TransactionsUpdateMetadataParameter} params
|
|
71
|
+
* @param {EP} [extraParams]
|
|
72
|
+
* @returns {Promise<AxiosResponse<TransactionsResponse<"updateMetadata", P, EP>>>}
|
|
117
73
|
*/
|
|
118
|
-
updateMetadata<P extends TransactionsUpdateMetadataParameter, EP extends ExtraParameter>(params: P, extraParams?: EP
|
|
74
|
+
updateMetadata<P extends TransactionsUpdateMetadataParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<TransactionsResponse<"updateMetadata", P, EP>>>;
|
|
119
75
|
}
|
|
120
76
|
export default Transactions;
|
|
121
77
|
//# sourceMappingURL=Transactions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Transactions.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/integrationApi/Transactions.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"Transactions.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/integrationApi/Transactions.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,0BAA0B,EAC1B,oBAAoB,EACpB,yBAAyB,EACzB,+BAA+B,EAC/B,0CAA0C,EAC1C,mCAAmC,EACpC,MAAM,aAAa,CAAC;AAErB;;GAEG;AACH,cAAM,YAAY;IAChB,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;;;;;;OAMG;IACG,IAAI,CAAC,CAAC,SAAS,yBAAyB,EAC5C,MAAM,EAAE,CAAC,GACR,OAAO,CAAC,aAAa,CAAC,oBAAoB,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC;IAO1D;;;;;;OAMG;IACG,KAAK,CAAC,CAAC,SAAS,0BAA0B,CAAC,IAAI,CAAC,EACpD,MAAM,EAAE,CAAC,GACR,OAAO,CAAC,aAAa,CAAC,oBAAoB,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;IAO3D;;;;;;;;;;;;;;OAcG;IACG,UAAU,CACd,CAAC,SAAS,+BAA+B,EACzC,EAAE,SAAS,cAAc,GAAG,SAAS,GAAG,SAAS,EAEjD,MAAM,EAAE,CAAC,EACT,WAAW,CAAC,EAAE,EAAE,GACf,OAAO,CAAC,aAAa,CAAC,oBAAoB,CAAC,YAAY,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IAQpE;;;;;;;;;;OAUG;IACG,qBAAqB,CACzB,CAAC,SAAS,0CAA0C,EACpD,EAAE,SAAS,cAAc,GAAG,SAAS,GAAG,SAAS,EAEjD,MAAM,EAAE,CAAC,EACT,WAAW,CAAC,EAAE,EAAE,GACf,OAAO,CAAC,aAAa,CAAC,oBAAoB,CAAC,uBAAuB,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IAQ/E;;;;;;;;OAQG;IACG,cAAc,CAClB,CAAC,SAAS,mCAAmC,EAC7C,EAAE,SAAS,cAAc,GAAG,SAAS,GAAG,SAAS,EAEjD,MAAM,EAAE,CAAC,EACT,WAAW,CAAC,EAAE,EAAE,GACf,OAAO,CAAC,aAAa,CAAC,oBAAoB,CAAC,gBAAgB,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;CAOzE;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -1,108 +1,73 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @fileoverview
|
|
3
|
-
* This class allows retrieving details about a specific user.
|
|
2
|
+
* @fileoverview Client for managing users in the Sharetribe Integration API.
|
|
4
3
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* This privileged API allows querying users, updating profiles, approving accounts,
|
|
5
|
+
* and managing permissions — typically used by admin tools or backend services.
|
|
6
|
+
*
|
|
7
|
+
* @see https://www.sharetribe.com/api-reference/integration.html#users
|
|
7
8
|
*/
|
|
8
|
-
import { AxiosResponse } from "axios";
|
|
9
|
+
import type { AxiosResponse } from "axios";
|
|
9
10
|
import IntegrationApi from "./index";
|
|
10
|
-
import { UsersApproveParameter, UsersQueryParameter, UsersResponse, UsersShowParameter, UsersUpdatePermissionsParameter, UsersUpdateProfileParameter } from "../../types
|
|
11
|
-
import { ExtraParameter } from "../../types/sharetribe";
|
|
11
|
+
import { ExtraParameter, UsersApproveParameter, UsersQueryParameter, UsersResponse, UsersShowParameter, UsersUpdatePermissionsParameter, UsersUpdateProfileParameter } from "../../types";
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* The Users API provides methods to retrieve user data for marketplace resources.
|
|
13
|
+
* Users API client (privileged)
|
|
16
14
|
*/
|
|
17
15
|
declare class Users {
|
|
18
|
-
|
|
16
|
+
readonly authRequired = true;
|
|
19
17
|
private readonly axios;
|
|
18
|
+
private readonly endpoint;
|
|
20
19
|
private readonly headers;
|
|
21
|
-
/**
|
|
22
|
-
* Creates an instance of the Users class.
|
|
23
|
-
*
|
|
24
|
-
* @param {IntegrationApi} api - The Integration API instance providing configuration and request handling.
|
|
25
|
-
*/
|
|
26
20
|
constructor(api: IntegrationApi);
|
|
27
21
|
/**
|
|
28
|
-
*
|
|
22
|
+
* Fetch a single user by ID or email
|
|
29
23
|
*
|
|
30
24
|
* @template P
|
|
31
|
-
* @param {P & UsersShowParameter} params -
|
|
32
|
-
* @returns {Promise<AxiosResponse<UsersResponse<
|
|
25
|
+
* @param {P & UsersShowParameter<true>} params - Either `id` or `email` is required
|
|
26
|
+
* @returns {Promise<AxiosResponse<UsersResponse<"show", P>>>}
|
|
33
27
|
*
|
|
34
28
|
* @example
|
|
35
|
-
* const
|
|
36
|
-
*
|
|
37
|
-
* });
|
|
38
|
-
*
|
|
39
|
-
* const userDetails = response.data;
|
|
29
|
+
* const { data } = await sdk.users.show({ id: "user-abc123" });
|
|
30
|
+
* const { data: userByEmail } = await sdk.users.show({ email: "john@example.com" });
|
|
40
31
|
*/
|
|
41
|
-
show<P extends UsersShowParameter<true>>(params: P): Promise<AxiosResponse<UsersResponse<"show", P
|
|
32
|
+
show<P extends UsersShowParameter<true>>(params: P): Promise<AxiosResponse<UsersResponse<"show", P>>>;
|
|
42
33
|
/**
|
|
43
|
-
*
|
|
34
|
+
* Query users with privileged filters
|
|
44
35
|
*
|
|
45
36
|
* @template P
|
|
46
|
-
* @param {P & UsersQueryParameter} params
|
|
47
|
-
* @returns {Promise<AxiosResponse<UsersResponse<
|
|
48
|
-
*
|
|
49
|
-
* @example
|
|
50
|
-
* const response = await integrationSdk.users.query({
|
|
51
|
-
* createdAtStart: '2021-01-01T00:00:00Z'
|
|
52
|
-
* });
|
|
53
|
-
* const users = response.data;
|
|
37
|
+
* @param {P & UsersQueryParameter} params
|
|
38
|
+
* @returns {Promise<AxiosResponse<UsersResponse<"query", P>>>}
|
|
54
39
|
*/
|
|
55
|
-
query<P extends UsersQueryParameter>(params: P): Promise<AxiosResponse<UsersResponse<"query", P
|
|
40
|
+
query<P extends UsersQueryParameter>(params: P): Promise<AxiosResponse<UsersResponse<"query", P>>>;
|
|
56
41
|
/**
|
|
57
|
-
*
|
|
42
|
+
* Update a user's profile
|
|
58
43
|
*
|
|
59
44
|
* @template P
|
|
60
45
|
* @template EP
|
|
61
|
-
* @param {P & UsersUpdateProfileParameter} params
|
|
62
|
-
* @param {EP
|
|
63
|
-
* @returns {Promise<AxiosResponse<UsersResponse<
|
|
64
|
-
*
|
|
65
|
-
* @example
|
|
66
|
-
* const response = await integrationSdk.users.updateProfile({
|
|
67
|
-
* id: 'user-id',
|
|
68
|
-
* firstName: 'John',
|
|
69
|
-
* lastName: 'Doe',
|
|
70
|
-
* displayName: 'John Doe',
|
|
71
|
-
* });
|
|
72
|
-
* const updatedProfile = response.data;
|
|
46
|
+
* @param {P & UsersUpdateProfileParameter} params
|
|
47
|
+
* @param {EP} [extraParams]
|
|
48
|
+
* @returns {Promise<AxiosResponse<UsersResponse<"updateProfile", P, EP>>>}
|
|
73
49
|
*/
|
|
74
|
-
updateProfile<P extends UsersUpdateProfileParameter, EP extends ExtraParameter>(params: P, extraParams?: EP): Promise<AxiosResponse<UsersResponse<"updateProfile", P, EP
|
|
50
|
+
updateProfile<P extends UsersUpdateProfileParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<UsersResponse<"updateProfile", P, EP>>>;
|
|
75
51
|
/**
|
|
76
|
-
*
|
|
52
|
+
* Approve a pending user account
|
|
77
53
|
*
|
|
78
54
|
* @template P
|
|
79
55
|
* @template EP
|
|
80
|
-
* @param {P & UsersApproveParameter} params
|
|
81
|
-
* @param {EP
|
|
82
|
-
* @returns {Promise<AxiosResponse<UsersResponse<
|
|
83
|
-
*
|
|
84
|
-
* @example
|
|
85
|
-
* const response = await integrationSdk.users.approve({ id: 'user-id' });
|
|
86
|
-
* const approvalResult = response.data;
|
|
56
|
+
* @param {P & UsersApproveParameter} params
|
|
57
|
+
* @param {EP} [extraParams]
|
|
58
|
+
* @returns {Promise<AxiosResponse<UsersResponse<"approve", P, EP>>>}
|
|
87
59
|
*/
|
|
88
|
-
approve<P extends UsersApproveParameter, EP extends ExtraParameter>(params: P, extraParams?: EP): Promise<AxiosResponse<UsersResponse<"approve", P, EP
|
|
60
|
+
approve<P extends UsersApproveParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<UsersResponse<"approve", P, EP>>>;
|
|
89
61
|
/**
|
|
90
|
-
*
|
|
62
|
+
* Update a user's permissions
|
|
91
63
|
*
|
|
92
64
|
* @template P
|
|
93
65
|
* @template EP
|
|
94
|
-
* @param {P & UsersUpdatePermissionsParameter} params
|
|
95
|
-
* @param {EP
|
|
96
|
-
* @returns {Promise<AxiosResponse<UsersResponse<
|
|
97
|
-
*
|
|
98
|
-
* @example
|
|
99
|
-
* const response = await integrationSdk.users.updatePermissions(
|
|
100
|
-
* { id: 'user-id', permissions: ['permission-1', 'permission-2'] },
|
|
101
|
-
* { additionalParam: 'value' }
|
|
102
|
-
* );
|
|
103
|
-
* const updatedPermissions = response.data;
|
|
66
|
+
* @param {P & UsersUpdatePermissionsParameter} params
|
|
67
|
+
* @param {EP} [extraParams]
|
|
68
|
+
* @returns {Promise<AxiosResponse<UsersResponse<"updatePermissions", P, EP>>>}
|
|
104
69
|
*/
|
|
105
|
-
updatePermissions<P extends UsersUpdatePermissionsParameter, EP extends ExtraParameter>(params: P, extraParams?: EP): Promise<AxiosResponse<UsersResponse<"updatePermissions", P, EP
|
|
70
|
+
updatePermissions<P extends UsersUpdatePermissionsParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<UsersResponse<"updatePermissions", P, EP>>>;
|
|
106
71
|
}
|
|
107
72
|
export default Users;
|
|
108
73
|
//# sourceMappingURL=Users.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Users.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/integrationApi/Users.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"Users.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/integrationApi/Users.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,qBAAqB,EACrB,mBAAmB,EACnB,aAAa,EACb,kBAAkB,EAClB,+BAA+B,EAC/B,2BAA2B,EAC5B,MAAM,aAAa,CAAC;AAErB;;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;;;;;;;;;;OAUG;IACG,IAAI,CAAC,CAAC,SAAS,kBAAkB,CAAC,IAAI,CAAC,EAC3C,MAAM,EAAE,CAAC,GACR,OAAO,CAAC,aAAa,CAAC,aAAa,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC;IAWnD;;;;;;OAMG;IACG,KAAK,CAAC,CAAC,SAAS,mBAAmB,EACvC,MAAM,EAAE,CAAC,GACR,OAAO,CAAC,aAAa,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;IAOpD;;;;;;;;OAQG;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,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IAQhE;;;;;;;;OAQG;IACG,OAAO,CACX,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,aAAa,CAAC,SAAS,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IAQ1D;;;;;;;;OAQG;IACG,iBAAiB,CACrB,CAAC,SAAS,+BAA+B,EACzC,EAAE,SAAS,cAAc,GAAG,SAAS,GAAG,SAAS,EAEjD,MAAM,EAAE,CAAC,EACT,WAAW,CAAC,EAAE,EAAE,GACf,OAAO,CAAC,aAAa,CAAC,aAAa,CAAC,mBAAmB,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;CAOrE;AAED,eAAe,KAAK,CAAC"}
|
|
@@ -1,8 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @fileoverview
|
|
3
|
-
*
|
|
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
|
+
* });
|
|
4
21
|
*/
|
|
5
|
-
import { AxiosInstance } from "axios";
|
|
22
|
+
import type { AxiosInstance } from "axios";
|
|
6
23
|
import IntegrationSdk from "../../integrationSdk";
|
|
7
24
|
import AvailabilityExceptions from "./AvailabilityExceptions";
|
|
8
25
|
import Events from "./Events";
|
|
@@ -11,48 +28,31 @@ import Listings from "./Listings";
|
|
|
11
28
|
import Marketplace from "./Marketplace";
|
|
12
29
|
import Stock from "./Stock";
|
|
13
30
|
import StockAdjustments from "./StockAdjustments";
|
|
14
|
-
import
|
|
31
|
+
import StockReservations from "./StockReservations";
|
|
15
32
|
import Transactions from "./Transactions";
|
|
16
33
|
import Users from "./Users";
|
|
17
34
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* This class provides access to various sub-APIs for managing marketplace resources such as availability exceptions,
|
|
21
|
-
* events, images, listings, stock, transactions, and users.
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* const sdk = new IntegrationSdk(sdkConfig);
|
|
25
|
-
* const integrationApi = new IntegrationApi(sdk);
|
|
26
|
-
*
|
|
27
|
-
* // Example: Query availability exceptions
|
|
28
|
-
* const response = await integrationApi.availabilityExceptions.query({
|
|
29
|
-
* resource_id: 'resource-id',
|
|
30
|
-
* start: '2024-12-01T00:00:00Z',
|
|
31
|
-
* end: '2024-12-31T23:59:59Z'
|
|
32
|
-
* });
|
|
33
|
-
*
|
|
34
|
-
* const exceptions = response.data;
|
|
35
|
+
* Integration API client
|
|
35
36
|
*/
|
|
36
37
|
declare class IntegrationApi {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
*/
|
|
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
56
|
constructor(sdk: IntegrationSdk);
|
|
57
57
|
}
|
|
58
58
|
export default IntegrationApi;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/integrationApi/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/integrationApi/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,OAAO,CAAC;AACzC,OAAO,cAAc,MAAM,sBAAsB,CAAC;AAElD,OAAO,sBAAsB,MAAM,0BAA0B,CAAC;AAC9D,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,SAAS,CAAC;AAE5B;;GAEG;AACH,cAAM,cAAc;IAClB,uCAAuC;IACvC,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;IAE9B,iDAAiD;IACjD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAE1B,+CAA+C;IAC/C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEzC,4CAA4C;IAC5C,QAAQ,CAAC,YAAY,QAAQ;IAG7B,QAAQ,CAAC,sBAAsB,EAAE,sBAAsB,CAAC;IACxD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAClC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IACtB,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAC5C,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAC9C,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IACpC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;gBAEV,GAAG,EAAE,cAAc;CAmBhC;AAED,eAAe,cAAc,CAAC"}
|