@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
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|

|
|
4
4
|

|
|
5
|
-

|
|
6
6
|
|
|
7
7
|
This is a **TypeScript SDK** for the [Sharetribe Flex API](https://www.sharetribe.com/api-reference/). It simplifies interaction with the API, providing a more user-friendly and intuitive interface for developers and reduces the size of the SDK.
|
|
8
8
|
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Provides the AssetsApi class for interacting with the Sharetribe Asset Delivery API.
|
|
3
|
+
*
|
|
4
|
+
* @see https://www.sharetribe.com/api-reference/asset-delivery-api.html
|
|
5
|
+
*/
|
|
6
|
+
import type { AxiosResponse } from "axios";
|
|
7
|
+
import SharetribeSdk from "../../sdk";
|
|
8
|
+
import { AssetByAliasParameter, AssetByVersionParameter, AssetResponse, AssetsByAliasParameter, AssetsByVersionParameter } from "../../types";
|
|
9
|
+
declare class AssetsApi {
|
|
10
|
+
private readonly axios;
|
|
11
|
+
private readonly endpoint;
|
|
12
|
+
private readonly headers;
|
|
13
|
+
constructor(sdk: SharetribeSdk);
|
|
14
|
+
/**
|
|
15
|
+
* Fetch a single asset by alias (e.g. "latest")
|
|
16
|
+
*
|
|
17
|
+
* @template P
|
|
18
|
+
* @param {P & AssetByAliasParameter} params
|
|
19
|
+
* @returns {Promise<AxiosResponse<AssetResponse<"assetByAlias", P & AssetByAliasParameter>>>}
|
|
20
|
+
*/
|
|
21
|
+
assetByAlias<P extends AssetByAliasParameter>(params: P & AssetByAliasParameter): Promise<AxiosResponse<AssetResponse<"assetByAlias", P & AssetByAliasParameter>>>;
|
|
22
|
+
/**
|
|
23
|
+
* Fetch multiple assets by alias from the same directory
|
|
24
|
+
*
|
|
25
|
+
* @template P
|
|
26
|
+
* @param {P & AssetsByAliasParameter} params
|
|
27
|
+
* @returns {Promise<AxiosResponse<AssetResponse<"assetsByAlias", P & AssetsByAliasParameter>>>}
|
|
28
|
+
*/
|
|
29
|
+
assetsByAlias<P extends AssetsByAliasParameter>(params: P & AssetsByAliasParameter): Promise<AxiosResponse<AssetResponse<"assetsByAlias", P & AssetsByAliasParameter>>>;
|
|
30
|
+
/**
|
|
31
|
+
* Fetch a single asset by version
|
|
32
|
+
*
|
|
33
|
+
* @template P
|
|
34
|
+
* @param {P & AssetByVersionParameter} params
|
|
35
|
+
* @returns {Promise<AxiosResponse<AssetResponse<"assetByVersion", P & AssetByVersionParameter>>>}
|
|
36
|
+
*/
|
|
37
|
+
assetByVersion<P extends AssetByVersionParameter>(params: P & AssetByVersionParameter): Promise<AxiosResponse<AssetResponse<"assetByVersion", P & AssetByVersionParameter>>>;
|
|
38
|
+
/**
|
|
39
|
+
* Fetch multiple assets by version from the same directory
|
|
40
|
+
*
|
|
41
|
+
* @template P
|
|
42
|
+
* @param {P & AssetsByVersionParameter} params
|
|
43
|
+
* @returns {Promise<AxiosResponse<AssetResponse<"assetsByVersion", P & AssetsByVersionParameter>>>}
|
|
44
|
+
*/
|
|
45
|
+
assetsByVersion<P extends AssetsByVersionParameter>(params: P & AssetsByVersionParameter): Promise<AxiosResponse<AssetResponse<"assetsByVersion", P & AssetsByVersionParameter>>>;
|
|
46
|
+
}
|
|
47
|
+
export default AssetsApi;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Client for Sharetribe Authentication API (OAuth2)
|
|
3
|
+
*
|
|
4
|
+
* @see https://www.sharetribe.com/api-reference/authentication.html
|
|
5
|
+
*/
|
|
6
|
+
import type { AxiosResponse } from "axios";
|
|
7
|
+
import SharetribeSdk from "../../sdk";
|
|
8
|
+
import IntegrationSdk from "../../integrationSdk";
|
|
9
|
+
import { AuthWithIdpParameter, RevokeResponse, TokenDetails, TokenRequest, TokenResponse, UserTokenRequest } from "../../types";
|
|
10
|
+
/**
|
|
11
|
+
* Encodes object as application/x-www-form-urlencoded
|
|
12
|
+
*/
|
|
13
|
+
export declare const urlEncodeFormData: (obj: Record<string, any> | null) => string;
|
|
14
|
+
declare class AuthenticationApi {
|
|
15
|
+
private readonly axios;
|
|
16
|
+
private readonly endpoint;
|
|
17
|
+
private readonly headers;
|
|
18
|
+
constructor(sdk: SharetribeSdk | IntegrationSdk);
|
|
19
|
+
/**
|
|
20
|
+
* Request a token using any supported OAuth2 grant
|
|
21
|
+
*
|
|
22
|
+
* @template T - Token request type
|
|
23
|
+
* @param {T} params - OAuth2 token request parameters
|
|
24
|
+
* @returns {Promise<AxiosResponse<TokenResponse<T>>>}
|
|
25
|
+
*/
|
|
26
|
+
token<T extends TokenRequest>(params: T): Promise<AxiosResponse<TokenResponse<T>>>;
|
|
27
|
+
/**
|
|
28
|
+
* Authenticate via external Identity Provider
|
|
29
|
+
*
|
|
30
|
+
* @param {AuthWithIdpParameter} params
|
|
31
|
+
* @returns {Promise<AxiosResponse<TokenResponse<UserTokenRequest>>>}
|
|
32
|
+
*/
|
|
33
|
+
authWithIdp(params: AuthWithIdpParameter): Promise<AxiosResponse<TokenResponse<UserTokenRequest>>>;
|
|
34
|
+
/**
|
|
35
|
+
* Revoke a refresh token
|
|
36
|
+
*
|
|
37
|
+
* @param {string} token - Refresh token to revoke
|
|
38
|
+
*/
|
|
39
|
+
revoke(token: string): Promise<AxiosResponse<RevokeResponse>>;
|
|
40
|
+
/**
|
|
41
|
+
* Introspect current access token
|
|
42
|
+
*/
|
|
43
|
+
details(): Promise<AxiosResponse<TokenDetails>>;
|
|
44
|
+
}
|
|
45
|
+
export default AuthenticationApi;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Client for managing availability exceptions in the Sharetribe Integration API.
|
|
3
|
+
*
|
|
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
|
|
8
|
+
*/
|
|
9
|
+
import type { AxiosResponse } from "axios";
|
|
10
|
+
import IntegrationApi from "./index";
|
|
11
|
+
import { AvailabilityExceptionsCreateParameter, AvailabilityExceptionsDeleteParameter, AvailabilityExceptionsQueryParameter, AvailabilityExceptionsResponse, ExtraParameter } from "../../types";
|
|
12
|
+
/**
|
|
13
|
+
* Availability exceptions API client
|
|
14
|
+
*/
|
|
15
|
+
declare class AvailabilityExceptions {
|
|
16
|
+
readonly authRequired = true;
|
|
17
|
+
private readonly axios;
|
|
18
|
+
private readonly endpoint;
|
|
19
|
+
private readonly headers;
|
|
20
|
+
constructor(api: IntegrationApi);
|
|
21
|
+
/**
|
|
22
|
+
* Query availability exceptions
|
|
23
|
+
*
|
|
24
|
+
* @template P
|
|
25
|
+
* @param {P & AvailabilityExceptionsQueryParameter} params
|
|
26
|
+
* @returns {Promise<AxiosResponse<AvailabilityExceptionsResponse<"query", P>>>}
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* const { data } = await sdk.availabilityExceptions.query({
|
|
30
|
+
* listingId: "123-abc",
|
|
31
|
+
* start: "2025-01-01",
|
|
32
|
+
* end: "2025-01-31"
|
|
33
|
+
* });
|
|
34
|
+
*/
|
|
35
|
+
query<P extends AvailabilityExceptionsQueryParameter>(params: P): Promise<AxiosResponse<AvailabilityExceptionsResponse<"query", P>>>;
|
|
36
|
+
/**
|
|
37
|
+
* Create a new availability exception
|
|
38
|
+
*
|
|
39
|
+
* @template P
|
|
40
|
+
* @template EP
|
|
41
|
+
* @param {P & AvailabilityExceptionsCreateParameter} params
|
|
42
|
+
* @param {EP} [extraParams] - Optional extra parameters (e.g. expand)
|
|
43
|
+
* @returns {Promise<AxiosResponse<AvailabilityExceptionsResponse<"create", P, EP>>>}
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* await sdk.availabilityExceptions.create({
|
|
47
|
+
* listingId: "123-abc",
|
|
48
|
+
* start: "2025-12-24",
|
|
49
|
+
* end: "2025-12-26",
|
|
50
|
+
* seats: 0
|
|
51
|
+
* });
|
|
52
|
+
*/
|
|
53
|
+
create<P extends AvailabilityExceptionsCreateParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<AvailabilityExceptionsResponse<"create", P, EP>>>;
|
|
54
|
+
/**
|
|
55
|
+
* Delete an availability exception
|
|
56
|
+
*
|
|
57
|
+
* @template P
|
|
58
|
+
* @param {P & AvailabilityExceptionsDeleteParameter} params
|
|
59
|
+
* @returns {Promise<AxiosResponse<AvailabilityExceptionsResponse<"delete", P>>>}
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* await sdk.availabilityExceptions.delete({ id: "exc-456-def" });
|
|
63
|
+
*/
|
|
64
|
+
delete<P extends AvailabilityExceptionsDeleteParameter>(params: P): Promise<AxiosResponse<AvailabilityExceptionsResponse<"delete", P>>>;
|
|
65
|
+
}
|
|
66
|
+
export default AvailabilityExceptions;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Client for querying events in the Sharetribe Integration API.
|
|
3
|
+
*
|
|
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
|
|
8
|
+
*/
|
|
9
|
+
import type { AxiosResponse } from "axios";
|
|
10
|
+
import IntegrationApi from "./index";
|
|
11
|
+
import { EventsQueryParameter, EventsResponse } from "../../types";
|
|
12
|
+
/**
|
|
13
|
+
* Events API client
|
|
14
|
+
*/
|
|
15
|
+
declare class Events {
|
|
16
|
+
private readonly axios;
|
|
17
|
+
private readonly endpoint;
|
|
18
|
+
private readonly headers;
|
|
19
|
+
constructor(api: IntegrationApi);
|
|
20
|
+
/**
|
|
21
|
+
* Query marketplace events
|
|
22
|
+
*
|
|
23
|
+
* @template P
|
|
24
|
+
* @param {P & EventsQueryParameter} params - Query filters and pagination
|
|
25
|
+
* @returns {Promise<AxiosResponse<EventsResponse<"query">>>}
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* // Fetch events after a specific sequence ID
|
|
29
|
+
* const response = await sdk.events.query({
|
|
30
|
+
* startAfterSequenceId: 12345,
|
|
31
|
+
* eventTypes: ["transaction/initiated", "booking/created"]
|
|
32
|
+
* });
|
|
33
|
+
*
|
|
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
|
+
* });
|
|
40
|
+
*/
|
|
41
|
+
query<P extends EventsQueryParameter>(params: P): Promise<AxiosResponse<EventsResponse<"query">>>;
|
|
42
|
+
}
|
|
43
|
+
export default Events;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Client for uploading images in the Sharetribe Integration API.
|
|
3
|
+
*
|
|
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
|
+
*/
|
|
8
|
+
import type { AxiosResponse } from "axios";
|
|
9
|
+
import IntegrationApi from "./index";
|
|
10
|
+
import { ExtraParameter, ImagesResponse, ImagesUploadParameter } from "../../types";
|
|
11
|
+
/**
|
|
12
|
+
* Images API client
|
|
13
|
+
*/
|
|
14
|
+
declare class Images {
|
|
15
|
+
readonly authRequired = true;
|
|
16
|
+
private readonly axios;
|
|
17
|
+
private readonly endpoint;
|
|
18
|
+
private readonly headers;
|
|
19
|
+
constructor(api: IntegrationApi);
|
|
20
|
+
/**
|
|
21
|
+
* Upload an image
|
|
22
|
+
*
|
|
23
|
+
* @template P
|
|
24
|
+
* @template EP
|
|
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>>>}
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* const file = input.files[0];
|
|
31
|
+
* const { data } = await sdk.images.upload({ image: file });
|
|
32
|
+
* console.log(data.id); // → "img-abc123"
|
|
33
|
+
*/
|
|
34
|
+
upload<P extends ImagesUploadParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<ImagesResponse<"upload", EP>>>;
|
|
35
|
+
}
|
|
36
|
+
export default Images;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Client for managing listings in the Sharetribe Integration API.
|
|
3
|
+
*
|
|
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
|
|
8
|
+
*/
|
|
9
|
+
import type { AxiosResponse } from "axios";
|
|
10
|
+
import IntegrationApi from "./index";
|
|
11
|
+
import { ExtraParameter, ListingsApproveParameter, ListingsCloseParameter, ListingsCreateParameter, ListingsOpenParameter, ListingsQueryParameter, ListingsResponse, ListingsShowParameter, ListingsUpdateParameter } from "../../types";
|
|
12
|
+
/**
|
|
13
|
+
* Listings API client (privileged)
|
|
14
|
+
*/
|
|
15
|
+
declare class Listings {
|
|
16
|
+
private readonly axios;
|
|
17
|
+
private readonly endpoint;
|
|
18
|
+
private readonly headers;
|
|
19
|
+
constructor(api: IntegrationApi);
|
|
20
|
+
/**
|
|
21
|
+
* Fetch a single listing by ID
|
|
22
|
+
*
|
|
23
|
+
* @template P
|
|
24
|
+
* @param {P & ListingsShowParameter} params
|
|
25
|
+
* @returns {Promise<AxiosResponse<ListingsResponse<"show", P>>>}
|
|
26
|
+
*/
|
|
27
|
+
show<P extends ListingsShowParameter>(params: P): Promise<AxiosResponse<ListingsResponse<"show", P>>>;
|
|
28
|
+
/**
|
|
29
|
+
* Query listings with filters
|
|
30
|
+
*
|
|
31
|
+
* @template P
|
|
32
|
+
* @param {P & ListingsQueryParameter} params
|
|
33
|
+
* @returns {Promise<AxiosResponse<ListingsResponse<"query", P>>>}
|
|
34
|
+
*/
|
|
35
|
+
query<P extends ListingsQueryParameter>(params: P): Promise<AxiosResponse<ListingsResponse<"query", P>>>;
|
|
36
|
+
/**
|
|
37
|
+
* Create a new listing
|
|
38
|
+
*
|
|
39
|
+
* @template P
|
|
40
|
+
* @template EP
|
|
41
|
+
* @param {P & ListingsCreateParameter} params
|
|
42
|
+
* @param {EP} [extraParams] - Optional extra parameters (e.g. `expand: true`)
|
|
43
|
+
* @returns {Promise<AxiosResponse<ListingsResponse<"create", P, EP>>>}
|
|
44
|
+
*/
|
|
45
|
+
create<P extends ListingsCreateParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<ListingsResponse<"create", P, EP>>>;
|
|
46
|
+
/**
|
|
47
|
+
* Update an existing listing
|
|
48
|
+
*
|
|
49
|
+
* @template P
|
|
50
|
+
* @template EP
|
|
51
|
+
* @param {P & ListingsUpdateParameter} params
|
|
52
|
+
* @param {EP} [extraParams]
|
|
53
|
+
* @returns {Promise<AxiosResponse<ListingsResponse<"update", P, EP>>>}
|
|
54
|
+
*/
|
|
55
|
+
update<P extends ListingsUpdateParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<ListingsResponse<"update", P, EP>>>;
|
|
56
|
+
/**
|
|
57
|
+
* Close a listing
|
|
58
|
+
*
|
|
59
|
+
* @template P
|
|
60
|
+
* @template EP
|
|
61
|
+
* @param {P & ListingsCloseParameter} params
|
|
62
|
+
* @param {EP} [extraParams]
|
|
63
|
+
* @returns {Promise<AxiosResponse<ListingsResponse<"close", P, EP>>>}
|
|
64
|
+
*/
|
|
65
|
+
close<P extends ListingsCloseParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<ListingsResponse<"close", P, EP>>>;
|
|
66
|
+
/**
|
|
67
|
+
* Open a previously closed listing
|
|
68
|
+
*
|
|
69
|
+
* @template P
|
|
70
|
+
* @template EP
|
|
71
|
+
* @param {P & ListingsOpenParameter} params
|
|
72
|
+
* @param {EP} [extraParams]
|
|
73
|
+
* @returns {Promise<AxiosResponse<ListingsResponse<"open", P, EP>>>}
|
|
74
|
+
*/
|
|
75
|
+
open<P extends ListingsOpenParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<ListingsResponse<"open", P, EP>>>;
|
|
76
|
+
/**
|
|
77
|
+
* Approve a pending listing (admin only)
|
|
78
|
+
*
|
|
79
|
+
* @template P
|
|
80
|
+
* @template EP
|
|
81
|
+
* @param {P & ListingsApproveParameter} params
|
|
82
|
+
* @param {EP} [extraParams]
|
|
83
|
+
* @returns {Promise<AxiosResponse<ListingsResponse<"approve", P, EP>>>}
|
|
84
|
+
*/
|
|
85
|
+
approve<P extends ListingsApproveParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<ListingsResponse<"approve", P, EP>>>;
|
|
86
|
+
}
|
|
87
|
+
export default Listings;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Client for fetching marketplace configuration in the Sharetribe Integration API.
|
|
3
|
+
*
|
|
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
|
+
*/
|
|
8
|
+
import type { AxiosResponse } from "axios";
|
|
9
|
+
import IntegrationApi from "./index";
|
|
10
|
+
import { MarketplaceResponse } from "../../types";
|
|
11
|
+
/**
|
|
12
|
+
* Marketplace API client
|
|
13
|
+
*/
|
|
14
|
+
declare class Marketplace {
|
|
15
|
+
private readonly axios;
|
|
16
|
+
private readonly endpoint;
|
|
17
|
+
private readonly headers;
|
|
18
|
+
constructor(api: IntegrationApi);
|
|
19
|
+
/**
|
|
20
|
+
* Fetch current marketplace configuration
|
|
21
|
+
*
|
|
22
|
+
* @returns {Promise<AxiosResponse<MarketplaceResponse<"show">>>}
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* const { data } = await sdk.marketplace.show();
|
|
26
|
+
* console.log(data.attributes.name); // → "My Awesome Marketplace"
|
|
27
|
+
*/
|
|
28
|
+
show(): Promise<AxiosResponse<MarketplaceResponse<"show">>>;
|
|
29
|
+
}
|
|
30
|
+
export default Marketplace;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Client for managing stock levels in the Sharetribe Integration API.
|
|
3
|
+
*
|
|
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
|
|
8
|
+
*/
|
|
9
|
+
import type { AxiosResponse } from "axios";
|
|
10
|
+
import IntegrationApi from "./index";
|
|
11
|
+
import { ExtraParameter, StockCompareAndSetParameter, StockResponse } from "../../types";
|
|
12
|
+
/**
|
|
13
|
+
* Stock API client (privileged)
|
|
14
|
+
*/
|
|
15
|
+
declare class Stock {
|
|
16
|
+
readonly authRequired = true;
|
|
17
|
+
private readonly axios;
|
|
18
|
+
private readonly endpoint;
|
|
19
|
+
private readonly headers;
|
|
20
|
+
constructor(api: IntegrationApi);
|
|
21
|
+
/**
|
|
22
|
+
* Atomically update stock using compare-and-set
|
|
23
|
+
*
|
|
24
|
+
* Fails if current stock doesn't match `oldTotal` — prevents race conditions.
|
|
25
|
+
*
|
|
26
|
+
* @template P
|
|
27
|
+
* @template EP
|
|
28
|
+
* @param {P & StockCompareAndSetParameter} params
|
|
29
|
+
* @param {EP} [extraParams] - Optional extra parameters (e.g. `expand: true`)
|
|
30
|
+
* @returns {Promise<AxiosResponse<StockResponse<"compareAndSet", EP>>>}
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* // Reserve 2 units if current stock is 10
|
|
34
|
+
* await sdk.stock.compareAndSet({
|
|
35
|
+
* listingId: "listing-abc123",
|
|
36
|
+
* oldTotal: 10,
|
|
37
|
+
* newTotal: 8
|
|
38
|
+
* });
|
|
39
|
+
*/
|
|
40
|
+
compareAndSet<P extends StockCompareAndSetParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<StockResponse<"compareAndSet", EP>>>;
|
|
41
|
+
}
|
|
42
|
+
export default Stock;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Client for managing stock adjustments in the Sharetribe Integration API.
|
|
3
|
+
*
|
|
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
|
|
8
|
+
*/
|
|
9
|
+
import type { AxiosResponse } from "axios";
|
|
10
|
+
import IntegrationApi from "./index";
|
|
11
|
+
import { ExtraParameter, StockAdjustmentsCreateParameter, StockAdjustmentsQueryParameter, StockAdjustmentsResponse } from "../../types";
|
|
12
|
+
/**
|
|
13
|
+
* Stock Adjustments API client (privileged)
|
|
14
|
+
*/
|
|
15
|
+
declare class StockAdjustments {
|
|
16
|
+
readonly authRequired = true;
|
|
17
|
+
private readonly axios;
|
|
18
|
+
private readonly endpoint;
|
|
19
|
+
private readonly headers;
|
|
20
|
+
constructor(api: IntegrationApi);
|
|
21
|
+
/**
|
|
22
|
+
* Query stock adjustment history
|
|
23
|
+
*
|
|
24
|
+
* @template P
|
|
25
|
+
* @param {P & StockAdjustmentsQueryParameter} params
|
|
26
|
+
* @returns {Promise<AxiosResponse<StockAdjustmentsResponse<"query", P>>>}
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* const { data } = await sdk.stockAdjustments.query({
|
|
30
|
+
* listingId: "listing-abc123",
|
|
31
|
+
* start: "2025-01-01",
|
|
32
|
+
* end: "2025-01-31"
|
|
33
|
+
* });
|
|
34
|
+
*/
|
|
35
|
+
query<P extends StockAdjustmentsQueryParameter>(params: P): Promise<AxiosResponse<StockAdjustmentsResponse<"query", P>>>;
|
|
36
|
+
/**
|
|
37
|
+
* Create a manual stock adjustment
|
|
38
|
+
*
|
|
39
|
+
* Positive `quantity` = add stock
|
|
40
|
+
* Negative `quantity` = remove stock
|
|
41
|
+
*
|
|
42
|
+
* @template P
|
|
43
|
+
* @template EP
|
|
44
|
+
* @param {P & StockAdjustmentsCreateParameter} params
|
|
45
|
+
* @param {EP} [extraParams] - Optional extra parameters (e.g. `expand: true`)
|
|
46
|
+
* @returns {Promise<AxiosResponse<StockAdjustmentsResponse<"create", P, EP>>>}
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* // Restock 50 units
|
|
50
|
+
* await sdk.stockAdjustments.create({
|
|
51
|
+
* listingId: "listing-abc123",
|
|
52
|
+
* quantity: 50
|
|
53
|
+
* });
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* // Write off 3 damaged units
|
|
57
|
+
* await sdk.stockAdjustments.create({
|
|
58
|
+
* listingId: "listing-abc123",
|
|
59
|
+
* quantity: -3
|
|
60
|
+
* });
|
|
61
|
+
*/
|
|
62
|
+
create<P extends StockAdjustmentsCreateParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<StockAdjustmentsResponse<"create", P, EP>>>;
|
|
63
|
+
}
|
|
64
|
+
export default StockAdjustments;
|
|
@@ -7,13 +7,13 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { AxiosResponse } from "axios";
|
|
9
9
|
import IntegrationApi from "./index";
|
|
10
|
-
import { StockReservationShowParameter, StockReservationsResponse } from "../../types
|
|
10
|
+
import { StockReservationShowParameter, StockReservationsResponse } from "../../types";
|
|
11
11
|
/**
|
|
12
12
|
* Class representing the Stock Reservations API.
|
|
13
13
|
*
|
|
14
14
|
* The Stock Reservations API provides methods to manage stock reservations for marketplace resources.
|
|
15
15
|
*/
|
|
16
|
-
declare class
|
|
16
|
+
declare class StockReservations {
|
|
17
17
|
private readonly endpoint;
|
|
18
18
|
private readonly axios;
|
|
19
19
|
private readonly headers;
|
|
@@ -39,5 +39,4 @@ declare class StockReservation {
|
|
|
39
39
|
*/
|
|
40
40
|
show<P extends StockReservationShowParameter>(params: P): Promise<AxiosResponse<StockReservationsResponse<"show", P>>>;
|
|
41
41
|
}
|
|
42
|
-
export default
|
|
43
|
-
//# sourceMappingURL=StockReservation.d.ts.map
|
|
42
|
+
export default StockReservations;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Client for managing transactions in the Sharetribe Integration API.
|
|
3
|
+
*
|
|
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
|
|
8
|
+
*/
|
|
9
|
+
import type { AxiosResponse } from "axios";
|
|
10
|
+
import IntegrationApi from "./index";
|
|
11
|
+
import { ExtraParameter, TransactionsQueryParameter, TransactionsResponse, TransactionsShowParameter, TransactionsTransitionParameter, TransactionsTransitionSpeculativeParameter, TransactionsUpdateMetadataParameter } from "../../types";
|
|
12
|
+
/**
|
|
13
|
+
* Transactions API client (privileged)
|
|
14
|
+
*/
|
|
15
|
+
declare class Transactions {
|
|
16
|
+
readonly authRequired = true;
|
|
17
|
+
private readonly axios;
|
|
18
|
+
private readonly endpoint;
|
|
19
|
+
private readonly headers;
|
|
20
|
+
constructor(api: IntegrationApi);
|
|
21
|
+
/**
|
|
22
|
+
* Fetch a single transaction by ID
|
|
23
|
+
*
|
|
24
|
+
* @template P
|
|
25
|
+
* @param {P & TransactionsShowParameter} params
|
|
26
|
+
* @returns {Promise<AxiosResponse<TransactionsResponse<"show", P>>>}
|
|
27
|
+
*/
|
|
28
|
+
show<P extends TransactionsShowParameter>(params: P): Promise<AxiosResponse<TransactionsResponse<"show", P>>>;
|
|
29
|
+
/**
|
|
30
|
+
* Query transactions with privileged filters
|
|
31
|
+
*
|
|
32
|
+
* @template P
|
|
33
|
+
* @param {P & TransactionsQueryParameter<true>} params - Note: `true` enables privileged fields like `customerId`, `providerId`
|
|
34
|
+
* @returns {Promise<AxiosResponse<TransactionsResponse<"query", P>>>}
|
|
35
|
+
*/
|
|
36
|
+
query<P extends TransactionsQueryParameter<true>>(params: P): Promise<AxiosResponse<TransactionsResponse<"query", P>>>;
|
|
37
|
+
/**
|
|
38
|
+
* Transition a transaction to a new state
|
|
39
|
+
*
|
|
40
|
+
* @template P
|
|
41
|
+
* @template EP
|
|
42
|
+
* @param {P & TransactionsTransitionParameter} params
|
|
43
|
+
* @param {EP} [extraParams] - Optional extra parameters (e.g. `expand: true`)
|
|
44
|
+
* @returns {Promise<AxiosResponse<TransactionsResponse<"transition", P, EP>>>}
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* await sdk.transactions.transition({
|
|
48
|
+
* id: "tx-abc123",
|
|
49
|
+
* transition: "transition/confirm-payment"
|
|
50
|
+
* });
|
|
51
|
+
*/
|
|
52
|
+
transition<P extends TransactionsTransitionParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<TransactionsResponse<"transition", P, EP>>>;
|
|
53
|
+
/**
|
|
54
|
+
* Perform a speculative transition (dry-run)
|
|
55
|
+
*
|
|
56
|
+
* Does not persist changes — useful for validation before real transition.
|
|
57
|
+
*
|
|
58
|
+
* @template P
|
|
59
|
+
* @template EP
|
|
60
|
+
* @param {P & TransactionsTransitionSpeculativeParameter} params
|
|
61
|
+
* @param {EP} [extraParams]
|
|
62
|
+
* @returns {Promise<AxiosResponse<TransactionsResponse<"transitionSpeculative", P, EP>>>}
|
|
63
|
+
*/
|
|
64
|
+
transitionSpeculative<P extends TransactionsTransitionSpeculativeParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<TransactionsResponse<"transitionSpeculative", P, EP>>>;
|
|
65
|
+
/**
|
|
66
|
+
* Update transaction metadata
|
|
67
|
+
*
|
|
68
|
+
* @template P
|
|
69
|
+
* @template EP
|
|
70
|
+
* @param {P & TransactionsUpdateMetadataParameter} params
|
|
71
|
+
* @param {EP} [extraParams]
|
|
72
|
+
* @returns {Promise<AxiosResponse<TransactionsResponse<"updateMetadata", P, EP>>>}
|
|
73
|
+
*/
|
|
74
|
+
updateMetadata<P extends TransactionsUpdateMetadataParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<TransactionsResponse<"updateMetadata", P, EP>>>;
|
|
75
|
+
}
|
|
76
|
+
export default Transactions;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Client for managing users in the Sharetribe Integration API.
|
|
3
|
+
*
|
|
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
|
|
8
|
+
*/
|
|
9
|
+
import type { AxiosResponse } from "axios";
|
|
10
|
+
import IntegrationApi from "./index";
|
|
11
|
+
import { ExtraParameter, UsersApproveParameter, UsersQueryParameter, UsersResponse, UsersShowParameter, UsersUpdatePermissionsParameter, UsersUpdateProfileParameter } from "../../types";
|
|
12
|
+
/**
|
|
13
|
+
* Users API client (privileged)
|
|
14
|
+
*/
|
|
15
|
+
declare class Users {
|
|
16
|
+
readonly authRequired = true;
|
|
17
|
+
private readonly axios;
|
|
18
|
+
private readonly endpoint;
|
|
19
|
+
private readonly headers;
|
|
20
|
+
constructor(api: IntegrationApi);
|
|
21
|
+
/**
|
|
22
|
+
* Fetch a single user by ID or email
|
|
23
|
+
*
|
|
24
|
+
* @template P
|
|
25
|
+
* @param {P & UsersShowParameter<true>} params - Either `id` or `email` is required
|
|
26
|
+
* @returns {Promise<AxiosResponse<UsersResponse<"show", P>>>}
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* const { data } = await sdk.users.show({ id: "user-abc123" });
|
|
30
|
+
* const { data: userByEmail } = await sdk.users.show({ email: "john@example.com" });
|
|
31
|
+
*/
|
|
32
|
+
show<P extends UsersShowParameter<true>>(params: P): Promise<AxiosResponse<UsersResponse<"show", P>>>;
|
|
33
|
+
/**
|
|
34
|
+
* Query users with privileged filters
|
|
35
|
+
*
|
|
36
|
+
* @template P
|
|
37
|
+
* @param {P & UsersQueryParameter} params
|
|
38
|
+
* @returns {Promise<AxiosResponse<UsersResponse<"query", P>>>}
|
|
39
|
+
*/
|
|
40
|
+
query<P extends UsersQueryParameter>(params: P): Promise<AxiosResponse<UsersResponse<"query", P>>>;
|
|
41
|
+
/**
|
|
42
|
+
* Update a user's profile
|
|
43
|
+
*
|
|
44
|
+
* @template P
|
|
45
|
+
* @template EP
|
|
46
|
+
* @param {P & UsersUpdateProfileParameter} params
|
|
47
|
+
* @param {EP} [extraParams]
|
|
48
|
+
* @returns {Promise<AxiosResponse<UsersResponse<"updateProfile", P, EP>>>}
|
|
49
|
+
*/
|
|
50
|
+
updateProfile<P extends UsersUpdateProfileParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<UsersResponse<"updateProfile", P, EP>>>;
|
|
51
|
+
/**
|
|
52
|
+
* Approve a pending user account
|
|
53
|
+
*
|
|
54
|
+
* @template P
|
|
55
|
+
* @template EP
|
|
56
|
+
* @param {P & UsersApproveParameter} params
|
|
57
|
+
* @param {EP} [extraParams]
|
|
58
|
+
* @returns {Promise<AxiosResponse<UsersResponse<"approve", P, EP>>>}
|
|
59
|
+
*/
|
|
60
|
+
approve<P extends UsersApproveParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<UsersResponse<"approve", P, EP>>>;
|
|
61
|
+
/**
|
|
62
|
+
* Update a user's permissions
|
|
63
|
+
*
|
|
64
|
+
* @template P
|
|
65
|
+
* @template EP
|
|
66
|
+
* @param {P & UsersUpdatePermissionsParameter} params
|
|
67
|
+
* @param {EP} [extraParams]
|
|
68
|
+
* @returns {Promise<AxiosResponse<UsersResponse<"updatePermissions", P, EP>>>}
|
|
69
|
+
*/
|
|
70
|
+
updatePermissions<P extends UsersUpdatePermissionsParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<UsersResponse<"updatePermissions", P, EP>>>;
|
|
71
|
+
}
|
|
72
|
+
export default Users;
|