@vansite/ts-sharetribe-flex-sdk 1.0.33 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/endpoints/assets/index.d.ts +47 -0
- package/dist/endpoints/auth/index.d.ts +45 -0
- package/dist/endpoints/integrationApi/AvailabilityExceptions.d.ts +66 -0
- package/dist/endpoints/integrationApi/Events.d.ts +43 -0
- package/dist/endpoints/integrationApi/Images.d.ts +36 -0
- package/dist/endpoints/integrationApi/Listings.d.ts +87 -0
- package/dist/endpoints/integrationApi/Marketplace.d.ts +30 -0
- package/dist/endpoints/integrationApi/Stock.d.ts +42 -0
- package/dist/endpoints/integrationApi/StockAdjustments.d.ts +64 -0
- package/dist/{types/endpoints/integrationApi/StockReservation.d.ts → endpoints/integrationApi/StockReservations.d.ts} +3 -4
- package/dist/endpoints/integrationApi/Transactions.d.ts +76 -0
- package/dist/endpoints/integrationApi/Users.d.ts +72 -0
- package/dist/endpoints/integrationApi/index.d.ts +58 -0
- package/dist/endpoints/marketplace/AvailabilityExceptions.d.ts +69 -0
- package/dist/endpoints/marketplace/Bookings.d.ts +45 -0
- package/dist/endpoints/marketplace/CurrentUser.d.ts +110 -0
- package/dist/endpoints/marketplace/Images.d.ts +38 -0
- package/dist/endpoints/marketplace/Listings.d.ts +52 -0
- package/dist/endpoints/marketplace/Marketplace.d.ts +33 -0
- package/dist/endpoints/marketplace/Messages.d.ts +51 -0
- package/dist/endpoints/marketplace/OwnListings.d.ts +116 -0
- package/dist/endpoints/marketplace/PasswordReset.d.ts +50 -0
- package/dist/endpoints/marketplace/ProcessTransitions.d.ts +42 -0
- package/dist/endpoints/marketplace/Reviews.d.ts +49 -0
- package/dist/endpoints/marketplace/Stock.d.ts +50 -0
- package/dist/endpoints/marketplace/StockAdjustments.d.ts +64 -0
- package/dist/endpoints/marketplace/StripeAccount.d.ts +56 -0
- package/dist/endpoints/marketplace/StripeAccountLinks.d.ts +42 -0
- package/dist/endpoints/marketplace/StripeCustomer.d.ts +62 -0
- package/dist/endpoints/marketplace/StripePersons.d.ts +37 -0
- package/dist/endpoints/marketplace/StripeSetupIntents.d.ts +42 -0
- package/dist/endpoints/marketplace/TimeSlots.d.ts +40 -0
- package/dist/endpoints/marketplace/Transactions.d.ts +89 -0
- package/dist/endpoints/marketplace/Users.d.ts +34 -0
- package/dist/endpoints/marketplace/index.d.ts +80 -0
- package/dist/index.d.ts +161 -0
- package/dist/index.js +3 -0
- package/dist/{ts-sharetribe-flex-sdk.cjs.LICENSE.txt → index.js.LICENSE.txt} +53 -41
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +3 -0
- package/dist/{ts-sharetribe-flex-sdk.js.LICENSE.txt → index.mjs.LICENSE.txt} +13 -5
- package/dist/index.mjs.map +1 -0
- package/dist/index.umd.js +3 -0
- package/dist/{ts-sharetribe-flex-sdk.mjs.LICENSE.txt → index.umd.js.LICENSE.txt} +13 -5
- package/dist/index.umd.js.map +1 -0
- package/dist/integrationSdk.d.ts +119 -0
- package/dist/sdk.d.ts +211 -0
- package/dist/sdkTypes/BigDecimal.d.ts +30 -0
- package/dist/sdkTypes/LatLng.d.ts +34 -0
- package/dist/sdkTypes/LatLngBounds.d.ts +51 -0
- package/dist/sdkTypes/Money.d.ts +28 -0
- package/dist/sdkTypes/UUID.d.ts +38 -0
- package/dist/types/apiConfigs.d.ts +104 -0
- package/dist/types/assets/index.d.ts +101 -0
- package/dist/types/authentication/index.d.ts +152 -0
- package/dist/types/axios.d.ts +10 -0
- package/dist/types/config.d.ts +99 -0
- package/dist/types/endpoints/assets/index.d.ts +22 -36
- package/dist/types/endpoints/assets/index.d.ts.map +1 -1
- package/dist/types/endpoints/auth/index.d.ts +20 -41
- package/dist/types/endpoints/auth/index.d.ts.map +1 -1
- package/dist/types/endpoints/integrationApi/AvailabilityExceptions.d.ts +30 -49
- package/dist/types/endpoints/integrationApi/AvailabilityExceptions.d.ts.map +1 -1
- package/dist/types/endpoints/integrationApi/Events.d.ts +23 -27
- package/dist/types/endpoints/integrationApi/Events.d.ts.map +1 -1
- package/dist/types/endpoints/integrationApi/Images.d.ts +17 -28
- package/dist/types/endpoints/integrationApi/Images.d.ts.map +1 -1
- package/dist/types/endpoints/integrationApi/Listings.d.ts +42 -104
- package/dist/types/endpoints/integrationApi/Listings.d.ts.map +1 -1
- package/dist/types/endpoints/integrationApi/Marketplace.d.ts +12 -20
- package/dist/types/endpoints/integrationApi/Marketplace.d.ts.map +1 -1
- package/dist/types/endpoints/integrationApi/Stock.d.ts +22 -28
- package/dist/types/endpoints/integrationApi/Stock.d.ts.map +1 -1
- package/dist/types/endpoints/integrationApi/StockAdjustments.d.ts +35 -35
- package/dist/types/endpoints/integrationApi/StockAdjustments.d.ts.map +1 -1
- package/dist/types/endpoints/integrationApi/StockReservations.d.ts +43 -0
- package/dist/types/endpoints/integrationApi/StockReservations.d.ts.map +1 -0
- package/dist/types/endpoints/integrationApi/Transactions.d.ts +36 -80
- package/dist/types/endpoints/integrationApi/Transactions.d.ts.map +1 -1
- package/dist/types/endpoints/integrationApi/Users.d.ts +35 -70
- package/dist/types/endpoints/integrationApi/Users.d.ts.map +1 -1
- package/dist/types/endpoints/integrationApi/index.d.ts +40 -40
- package/dist/types/endpoints/integrationApi/index.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/AvailabilityExceptions.d.ts +34 -48
- package/dist/types/endpoints/marketplace/AvailabilityExceptions.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/Bookings.d.ts +24 -23
- package/dist/types/endpoints/marketplace/Bookings.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/CurrentUser.d.ts +54 -125
- package/dist/types/endpoints/marketplace/CurrentUser.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/Images.d.ts +19 -27
- package/dist/types/endpoints/marketplace/Images.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/Listings.d.ts +26 -25
- package/dist/types/endpoints/marketplace/Listings.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/Marketplace.d.ts +15 -19
- package/dist/types/endpoints/marketplace/Marketplace.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/Messages.d.ts +24 -29
- package/dist/types/endpoints/marketplace/Messages.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/OwnListings.d.ts +55 -119
- package/dist/types/endpoints/marketplace/OwnListings.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/PasswordReset.d.ts +23 -35
- package/dist/types/endpoints/marketplace/PasswordReset.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/ProcessTransitions.d.ts +22 -22
- package/dist/types/endpoints/marketplace/ProcessTransitions.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/Reviews.d.ts +23 -25
- package/dist/types/endpoints/marketplace/Reviews.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/Stock.d.ts +30 -26
- package/dist/types/endpoints/marketplace/Stock.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/StockAdjustments.d.ts +36 -34
- package/dist/types/endpoints/marketplace/StockAdjustments.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/StripeAccount.d.ts +28 -49
- package/dist/types/endpoints/marketplace/StripeAccount.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/StripeAccountLinks.d.ts +22 -31
- package/dist/types/endpoints/marketplace/StripeAccountLinks.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/StripeCustomer.d.ts +32 -46
- package/dist/types/endpoints/marketplace/StripeCustomer.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/StripePersons.d.ts +17 -25
- package/dist/types/endpoints/marketplace/StripePersons.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/StripeSetupIntents.d.ts +24 -24
- package/dist/types/endpoints/marketplace/StripeSetupIntents.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/TimeSlots.d.ts +20 -23
- package/dist/types/endpoints/marketplace/TimeSlots.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/Transactions.d.ts +45 -81
- package/dist/types/endpoints/marketplace/Transactions.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/Users.d.ts +15 -22
- package/dist/types/endpoints/marketplace/Users.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/index.d.ts +50 -40
- package/dist/types/endpoints/marketplace/index.d.ts.map +1 -1
- package/dist/types/index.d.ts +15 -30
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/integration/events.d.ts +87 -0
- package/dist/types/integrationSdk.d.ts +4 -5
- package/dist/types/integrationSdk.d.ts.map +1 -1
- package/dist/types/marketplace/availabilityExceptions.d.ts +99 -0
- package/dist/types/marketplace/availabilityPlan.d.ts +17 -0
- package/dist/types/marketplace/bookings.d.ts +80 -0
- package/dist/types/marketplace/currentUser.d.ts +202 -0
- package/dist/types/marketplace/images.d.ts +65 -0
- package/dist/types/marketplace/listings.d.ts +169 -0
- package/dist/types/marketplace/marketplace.d.ts +30 -0
- package/dist/types/marketplace/messages.d.ts +87 -0
- package/dist/types/marketplace/ownListings.d.ts +155 -0
- package/dist/types/marketplace/passwordReset.d.ts +54 -0
- package/dist/types/marketplace/processTransitions.d.ts +56 -0
- package/dist/types/marketplace/reviews.d.ts +108 -0
- package/dist/types/marketplace/stock.d.ts +45 -0
- package/dist/types/marketplace/stockAdjustment.d.ts +97 -0
- package/dist/types/marketplace/stockReservations.d.ts +89 -0
- package/dist/types/marketplace/stripeAccount.d.ts +67 -0
- package/dist/types/marketplace/stripeAccountLinks.d.ts +55 -0
- package/dist/types/marketplace/stripeCustomer.d.ts +94 -0
- package/dist/types/marketplace/stripePaymentMethod.d.ts +21 -0
- package/dist/types/marketplace/stripePersons.d.ts +48 -0
- package/dist/types/marketplace/stripeSetupIntents.d.ts +48 -0
- package/dist/types/marketplace/timeSlots.d.ts +51 -0
- package/dist/types/marketplace/transactions.d.ts +200 -0
- package/dist/types/marketplace/user.d.ts +200 -0
- package/dist/types/sdk-types.d.ts +10 -0
- package/dist/types/sdk.d.ts +6 -7
- package/dist/types/sdk.d.ts.map +1 -1
- package/dist/types/sdkTypes/BigDecimal.d.ts +1 -1
- package/dist/types/sdkTypes/BigDecimal.d.ts.map +1 -1
- package/dist/types/sdkTypes/LatLng.d.ts +1 -1
- package/dist/types/sdkTypes/LatLng.d.ts.map +1 -1
- package/dist/types/sdkTypes/LatLngBounds.d.ts +1 -1
- package/dist/types/sdkTypes/LatLngBounds.d.ts.map +1 -1
- package/dist/types/sdkTypes/Money.d.ts +1 -1
- package/dist/types/sdkTypes/Money.d.ts.map +1 -1
- package/dist/types/sdkTypes/UUID.d.ts +1 -1
- package/dist/types/sdkTypes/UUID.d.ts.map +1 -1
- package/dist/types/sharetribe.d.ts +227 -0
- package/dist/types/store.d.ts +22 -0
- package/dist/types/types/apiConfigs.d.ts.map +1 -1
- package/dist/types/types/assets/index.d.ts +74 -36
- package/dist/types/types/assets/index.d.ts.map +1 -1
- package/dist/types/types/authentication/index.d.ts +111 -60
- package/dist/types/types/authentication/index.d.ts.map +1 -1
- package/dist/types/types/axios.d.ts.map +1 -1
- package/dist/types/types/config.d.ts +1 -39
- package/dist/types/types/config.d.ts.map +1 -1
- package/dist/types/types/integration/events.d.ts +52 -20
- package/dist/types/types/integration/events.d.ts.map +1 -1
- package/dist/types/types/marketplace/availabilityExceptions.d.ts +59 -16
- package/dist/types/types/marketplace/availabilityExceptions.d.ts.map +1 -1
- package/dist/types/types/marketplace/availabilityPlan.d.ts +18 -0
- package/dist/types/types/marketplace/availabilityPlan.d.ts.map +1 -0
- package/dist/types/types/marketplace/bookings.d.ts +48 -14
- package/dist/types/types/marketplace/bookings.d.ts.map +1 -1
- package/dist/types/types/marketplace/currentUser.d.ts +99 -55
- package/dist/types/types/marketplace/currentUser.d.ts.map +1 -1
- package/dist/types/types/marketplace/images.d.ts +40 -14
- package/dist/types/types/marketplace/images.d.ts.map +1 -1
- package/dist/types/types/marketplace/listings.d.ts +96 -66
- package/dist/types/types/marketplace/listings.d.ts.map +1 -1
- package/dist/types/types/marketplace/marketplace.d.ts +16 -6
- package/dist/types/types/marketplace/marketplace.d.ts.map +1 -1
- package/dist/types/types/marketplace/messages.d.ts +53 -15
- package/dist/types/types/marketplace/messages.d.ts.map +1 -1
- package/dist/types/types/marketplace/ownListings.d.ts +92 -65
- package/dist/types/types/marketplace/ownListings.d.ts.map +1 -1
- package/dist/types/types/marketplace/passwordReset.d.ts +32 -9
- package/dist/types/types/marketplace/passwordReset.d.ts.map +1 -1
- package/dist/types/types/marketplace/processTransitions.d.ts +33 -14
- package/dist/types/types/marketplace/processTransitions.d.ts.map +1 -1
- package/dist/types/types/marketplace/reviews.d.ts +72 -23
- package/dist/types/types/marketplace/reviews.d.ts.map +1 -1
- package/dist/types/types/marketplace/stock.d.ts +23 -6
- package/dist/types/types/marketplace/stock.d.ts.map +1 -1
- package/dist/types/types/marketplace/stockAdjustment.d.ts +60 -14
- package/dist/types/types/marketplace/stockAdjustment.d.ts.map +1 -1
- package/dist/types/types/marketplace/stockReservations.d.ts +59 -14
- package/dist/types/types/marketplace/stockReservations.d.ts.map +1 -1
- package/dist/types/types/marketplace/stripeAccount.d.ts +28 -5
- package/dist/types/types/marketplace/stripeAccount.d.ts.map +1 -1
- package/dist/types/types/marketplace/stripeAccountLinks.d.ts +26 -6
- package/dist/types/types/marketplace/stripeAccountLinks.d.ts.map +1 -1
- package/dist/types/types/marketplace/stripeCustomer.d.ts +60 -13
- package/dist/types/types/marketplace/stripeCustomer.d.ts.map +1 -1
- package/dist/types/types/marketplace/stripePaymentMethod.d.ts +1 -2
- package/dist/types/types/marketplace/stripePaymentMethod.d.ts.map +1 -1
- package/dist/types/types/marketplace/stripePersons.d.ts +17 -15
- package/dist/types/types/marketplace/stripePersons.d.ts.map +1 -1
- package/dist/types/types/marketplace/stripeSetupIntents.d.ts +16 -14
- package/dist/types/types/marketplace/stripeSetupIntents.d.ts.map +1 -1
- package/dist/types/types/marketplace/timeSlots.d.ts +13 -15
- package/dist/types/types/marketplace/timeSlots.d.ts.map +1 -1
- package/dist/types/types/marketplace/transactions.d.ts +77 -83
- package/dist/types/types/marketplace/transactions.d.ts.map +1 -1
- package/dist/types/types/marketplace/user.d.ts +85 -64
- package/dist/types/types/marketplace/user.d.ts.map +1 -1
- package/dist/types/types/sharetribe.d.ts +130 -92
- package/dist/types/types/sharetribe.d.ts.map +1 -1
- package/dist/types/types/store.d.ts +3 -14
- package/dist/types/types/store.d.ts.map +1 -1
- package/dist/types/utils/apis.d.ts +1 -1
- package/dist/types/utils/apis.d.ts.map +1 -1
- package/dist/types/utils/config.d.ts.map +1 -1
- package/dist/types/utils/convert-types.d.ts.map +1 -1
- package/dist/types/utils/parameter-serializer.d.ts.map +1 -1
- package/dist/types/utils/prepare-axios-instance.d.ts +1 -1
- package/dist/types/utils/prepare-axios-instance.d.ts.map +1 -1
- package/dist/types/utils/stores/BrowserStore.d.ts +1 -2
- package/dist/types/utils/stores/BrowserStore.d.ts.map +1 -1
- package/dist/types/utils/stores/ExpressStore.d.ts +6 -7
- package/dist/types/utils/stores/ExpressStore.d.ts.map +1 -1
- package/dist/types/utils/stores/MemoryStore.d.ts +1 -2
- package/dist/types/utils/stores/MemoryStore.d.ts.map +1 -1
- package/dist/types/utils/stores/store.d.ts.map +1 -1
- package/dist/types/utils/transit.d.ts +1 -1
- package/dist/types/utils/transit.d.ts.map +1 -1
- package/dist/types/utils/util.d.ts +2 -2
- package/dist/types/utils/util.d.ts.map +1 -1
- package/dist/utils/apis.d.ts +8 -0
- package/dist/utils/config.d.ts +32 -0
- package/dist/utils/convert-types.d.ts +13 -0
- package/dist/utils/parameter-serializer.d.ts +23 -0
- package/dist/utils/prepare-axios-instance.d.ts +14 -0
- package/dist/utils/stores/BrowserStore.d.ts +37 -0
- package/dist/utils/stores/ExpressStore.d.ts +48 -0
- package/dist/utils/stores/MemoryStore.d.ts +23 -0
- package/dist/utils/stores/store.d.ts +8 -0
- package/dist/utils/transit.d.ts +28 -0
- package/dist/utils/util.d.ts +15 -0
- package/package.json +18 -17
- package/dist/ts-sharetribe-flex-sdk.cjs +0 -3
- package/dist/ts-sharetribe-flex-sdk.cjs.map +0 -1
- package/dist/ts-sharetribe-flex-sdk.js +0 -3
- package/dist/ts-sharetribe-flex-sdk.js.map +0 -1
- package/dist/ts-sharetribe-flex-sdk.mjs +0 -3
- package/dist/ts-sharetribe-flex-sdk.mjs.map +0 -1
- package/dist/types/endpoints/integrationApi/StockReservation.d.ts.map +0 -1
|
@@ -1,50 +1,48 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @fileoverview
|
|
3
|
-
* This class includes methods for querying and retrieving details of reviews.
|
|
2
|
+
* @fileoverview Client for querying reviews in the Sharetribe Marketplace API.
|
|
4
3
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Use this to fetch your own reviews or reviews for listings you own.
|
|
5
|
+
* Only returns reviews the current user is authorized to see.
|
|
6
|
+
*
|
|
7
|
+
* @see https://www.sharetribe.com/api-reference/marketplace.html#reviews
|
|
7
8
|
*/
|
|
8
|
-
import { AxiosResponse } from "axios";
|
|
9
|
+
import type { AxiosResponse } from "axios";
|
|
9
10
|
import MarketplaceApi from "./index";
|
|
10
|
-
import { ReviewsQueryParameter, ReviewsResponse, ReviewsShowParameter } from "../../types
|
|
11
|
+
import { ReviewsQueryParameter, ReviewsResponse, ReviewsShowParameter } from "../../types";
|
|
11
12
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* The Reviews API provides methods for querying and retrieving details of reviews within the marketplace.
|
|
13
|
+
* Reviews API client (own reviews only)
|
|
15
14
|
*/
|
|
16
15
|
declare class Reviews {
|
|
17
|
-
|
|
16
|
+
readonly authRequired = true;
|
|
18
17
|
private readonly axios;
|
|
18
|
+
private readonly endpoint;
|
|
19
19
|
private readonly headers;
|
|
20
|
-
/**
|
|
21
|
-
* Creates an instance of the Reviews class.
|
|
22
|
-
*
|
|
23
|
-
* @param {MarketplaceApi} api - The Marketplace API instance providing configuration and request handling.
|
|
24
|
-
*/
|
|
25
20
|
constructor(api: MarketplaceApi);
|
|
26
21
|
/**
|
|
27
|
-
*
|
|
22
|
+
* Fetch a single review by ID
|
|
28
23
|
*
|
|
29
24
|
* @template P
|
|
30
|
-
* @param {P & ReviewsShowParameter} params
|
|
31
|
-
* @returns {Promise<AxiosResponse<ReviewsResponse<
|
|
25
|
+
* @param {P & ReviewsShowParameter} params
|
|
26
|
+
* @returns {Promise<AxiosResponse<ReviewsResponse<"show", P>>>}
|
|
32
27
|
*
|
|
33
28
|
* @example
|
|
34
|
-
* const
|
|
35
|
-
* const review = response.data;
|
|
29
|
+
* const { data } = await sdk.reviews.show({ id: "rev-abc123" });
|
|
36
30
|
*/
|
|
37
31
|
show<P extends ReviewsShowParameter>(params: P): Promise<AxiosResponse<ReviewsResponse<"show", P>>>;
|
|
38
32
|
/**
|
|
39
|
-
*
|
|
33
|
+
* Query your own reviews or reviews for your listings
|
|
40
34
|
*
|
|
41
35
|
* @template P
|
|
42
|
-
* @param {P & ReviewsQueryParameter} params
|
|
43
|
-
* @returns {Promise<AxiosResponse<ReviewsResponse<
|
|
36
|
+
* @param {P & ReviewsQueryParameter} params
|
|
37
|
+
* @returns {Promise<AxiosResponse<ReviewsResponse<"query", P>>>}
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* // All reviews you've received
|
|
41
|
+
* const { data } = await sdk.reviews.query({ subjectId: "current" });
|
|
44
42
|
*
|
|
45
43
|
* @example
|
|
46
|
-
*
|
|
47
|
-
*
|
|
44
|
+
* // Reviews for one of your listings
|
|
45
|
+
* await sdk.reviews.query({ listingId: "listing-abc123" });
|
|
48
46
|
*/
|
|
49
47
|
query<P extends ReviewsQueryParameter>(params: P): Promise<AxiosResponse<ReviewsResponse<"query", P>>>;
|
|
50
48
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Reviews.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/marketplace/Reviews.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"Reviews.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/marketplace/Reviews.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAgB,aAAa,EAAC,MAAM,OAAO,CAAC;AACxD,OAAO,cAAc,MAAM,SAAS,CAAC;AACrC,OAAO,EAAC,qBAAqB,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAE1F;;GAEG;AACH,cAAM,OAAO;IACX,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;;;;;;;;;OASG;IACG,IAAI,CAAC,CAAC,SAAS,oBAAoB,EACvC,MAAM,EAAE,CAAC,GACR,OAAO,CAAC,aAAa,CAAC,eAAe,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC;IAOrD;;;;;;;;;;;;;;OAcG;IACG,KAAK,CAAC,CAAC,SAAS,qBAAqB,EACzC,MAAM,EAAE,CAAC,GACR,OAAO,CAAC,aAAa,CAAC,eAAe,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;CAMvD;AAED,eAAe,OAAO,CAAC"}
|
|
@@ -1,47 +1,51 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @fileoverview
|
|
3
|
-
* This class includes methods for comparing and setting stock levels.
|
|
2
|
+
* @fileoverview Client for managing listing stock in the Sharetribe Marketplace API.
|
|
4
3
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Use this to safely update stock levels using atomic compare-and-set operations.
|
|
5
|
+
* Prevents race conditions when multiple users try to book simultaneously.
|
|
6
|
+
*
|
|
7
|
+
* @see https://www.sharetribe.com/api-reference/marketplace.html#stock
|
|
7
8
|
*/
|
|
8
|
-
import { AxiosResponse } from "axios";
|
|
9
|
+
import type { AxiosResponse } from "axios";
|
|
9
10
|
import MarketplaceApi from "./index";
|
|
10
|
-
import { StockCompareAndSetParameter, StockResponse } from "../../types
|
|
11
|
-
import { ExtraParameter } from "../../types/sharetribe";
|
|
11
|
+
import { ExtraParameter, StockCompareAndSetParameter, StockResponse } from "../../types";
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* The Stock API provides methods for comparing and setting stock levels for marketplace resources.
|
|
13
|
+
* Stock API client (own listings only)
|
|
16
14
|
*/
|
|
17
15
|
declare class Stock {
|
|
18
|
-
private readonly endpoint;
|
|
19
|
-
private readonly axios;
|
|
20
16
|
readonly authRequired = true;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
* @param {MarketplaceApi} api - The Marketplace API instance providing configuration and request handling.
|
|
25
|
-
*/
|
|
17
|
+
private readonly axios;
|
|
18
|
+
private readonly endpoint;
|
|
19
|
+
private readonly headers;
|
|
26
20
|
constructor(api: MarketplaceApi);
|
|
27
21
|
/**
|
|
28
|
-
*
|
|
22
|
+
* Atomically update stock using compare-and-set
|
|
23
|
+
*
|
|
24
|
+
* Fails if current stock doesn't match `oldTotal` — prevents overselling.
|
|
29
25
|
*
|
|
30
26
|
* @template P
|
|
31
27
|
* @template EP
|
|
32
|
-
* @param {P & StockCompareAndSetParameter} params
|
|
33
|
-
* @param {EP} extraParams - Optional extra parameters
|
|
34
|
-
* @returns {Promise<AxiosResponse<StockResponse<
|
|
28
|
+
* @param {P & StockCompareAndSetParameter} params
|
|
29
|
+
* @param {EP} [extraParams] - Optional extra parameters (e.g. `expand: true`)
|
|
30
|
+
* @returns {Promise<AxiosResponse<StockResponse<"compareAndSet", EP>>>}
|
|
35
31
|
*
|
|
36
32
|
* @example
|
|
37
|
-
*
|
|
38
|
-
*
|
|
33
|
+
* // Reserve 2 units if current stock is 10
|
|
34
|
+
* await sdk.stock.compareAndSet({
|
|
35
|
+
* listingId: "listing-abc123",
|
|
39
36
|
* oldTotal: 10,
|
|
40
|
-
* newTotal:
|
|
37
|
+
* newTotal: 8
|
|
38
|
+
* });
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* // Restock from 5 to 50
|
|
42
|
+
* await sdk.stock.compareAndSet({
|
|
43
|
+
* listingId: "listing-abc123",
|
|
44
|
+
* oldTotal: 5,
|
|
45
|
+
* newTotal: 50
|
|
41
46
|
* });
|
|
42
|
-
* const stockUpdateResult = response.data;
|
|
43
47
|
*/
|
|
44
|
-
compareAndSet<P extends StockCompareAndSetParameter, EP extends ExtraParameter>(params: P, extraParams?: EP
|
|
48
|
+
compareAndSet<P extends StockCompareAndSetParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<StockResponse<"compareAndSet", EP>>>;
|
|
45
49
|
}
|
|
46
50
|
export default Stock;
|
|
47
51
|
//# sourceMappingURL=Stock.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stock.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/marketplace/Stock.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"Stock.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/marketplace/Stock.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAgB,aAAa,EAAC,MAAM,OAAO,CAAC;AACxD,OAAO,cAAc,MAAM,SAAS,CAAC;AACrC,OAAO,EAAC,cAAc,EAAE,2BAA2B,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAExF;;GAEG;AACH,cAAM,KAAK;IACT,SAAgB,YAAY,QAAQ;IACpC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAgB;IACtC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAyB;gBAErC,GAAG,EAAE,cAAc;IAM/B;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACG,aAAa,CACjB,CAAC,SAAS,2BAA2B,EACrC,EAAE,SAAS,cAAc,GAAG,SAAS,GAAG,SAAS,EAEjD,MAAM,EAAE,CAAC,EACT,WAAW,CAAC,EAAE,EAAE,GACf,OAAO,CAAC,aAAa,CAAC,aAAa,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC,CAAC;CAO9D;AAED,eAAe,KAAK,CAAC"}
|
|
@@ -1,63 +1,65 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @fileoverview
|
|
3
|
-
* This class includes methods for querying and creating stock adjustments.
|
|
2
|
+
* @fileoverview Client for managing manual stock adjustments in the Sharetribe Marketplace API.
|
|
4
3
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Stock adjustments are used for restocking, write-offs, corrections, or any manual change
|
|
5
|
+
* that doesn’t come from a booking or reservation.
|
|
6
|
+
*
|
|
7
|
+
* @see https://www.sharetribe.com/api-reference/marketplace.html#stock-adjustments
|
|
7
8
|
*/
|
|
8
|
-
import { AxiosResponse } from "axios";
|
|
9
|
+
import type { AxiosResponse } from "axios";
|
|
9
10
|
import MarketplaceApi 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 for querying and creating adjustments to stock levels.
|
|
13
|
+
* Stock Adjustments API client (own listings only)
|
|
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 {MarketplaceApi} api - The Marketplace API instance providing configuration and request handling.
|
|
26
|
-
*/
|
|
27
20
|
constructor(api: MarketplaceApi);
|
|
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
|
-
* const stockAdjustments = response.data;
|
|
42
34
|
*/
|
|
43
35
|
query<P extends StockAdjustmentsQueryParameter>(params: P): Promise<AxiosResponse<StockAdjustmentsResponse<"query", P>>>;
|
|
44
36
|
/**
|
|
45
|
-
*
|
|
37
|
+
* Create a manual stock adjustment
|
|
38
|
+
*
|
|
39
|
+
* Positive quantity → add stock
|
|
40
|
+
* Negative quantity → remove stock
|
|
46
41
|
*
|
|
47
42
|
* @template P
|
|
48
43
|
* @template EP
|
|
49
|
-
* @param {P & StockAdjustmentsCreateParameter} params
|
|
50
|
-
* @param {EP
|
|
51
|
-
* @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>>>}
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* // Restock 50 units
|
|
50
|
+
* await sdk.stockAdjustments.create({
|
|
51
|
+
* listingId: "listing-abc123",
|
|
52
|
+
* quantity: 50
|
|
53
|
+
* });
|
|
52
54
|
*
|
|
53
55
|
* @example
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
56
|
+
* // Write off 3 damaged units
|
|
57
|
+
* await sdk.stockAdjustments.create({
|
|
58
|
+
* listingId: "listing-abc123",
|
|
59
|
+
* quantity: -3
|
|
57
60
|
* });
|
|
58
|
-
* const createdAdjustment = response.data;
|
|
59
61
|
*/
|
|
60
|
-
create<P extends StockAdjustmentsCreateParameter, EP extends ExtraParameter | undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<StockAdjustmentsResponse<"create", P, EP>>>;
|
|
62
|
+
create<P extends StockAdjustmentsCreateParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<StockAdjustmentsResponse<"create", P, EP>>>;
|
|
61
63
|
}
|
|
62
64
|
export default StockAdjustments;
|
|
63
65
|
//# sourceMappingURL=StockAdjustments.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StockAdjustments.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/marketplace/StockAdjustments.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"StockAdjustments.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/marketplace/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"}
|
|
@@ -1,78 +1,57 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @fileoverview
|
|
3
|
-
* This class includes methods for fetching, creating, and updating Stripe accounts.
|
|
2
|
+
* @fileoverview Client for managing the current user's Stripe account in the Sharetribe Marketplace API.
|
|
4
3
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Use this to:
|
|
5
|
+
* - Fetch existing Stripe account status
|
|
6
|
+
* - Create a new Stripe Connect account
|
|
7
|
+
* - Update account details or capabilities
|
|
8
|
+
*
|
|
9
|
+
* Requires authentication.
|
|
10
|
+
*
|
|
11
|
+
* @see https://www.sharetribe.com/api-reference/marketplace.html#stripe-account
|
|
7
12
|
*/
|
|
8
|
-
import { AxiosResponse } from "axios";
|
|
13
|
+
import type { AxiosResponse } from "axios";
|
|
9
14
|
import MarketplaceApi from "./index";
|
|
10
|
-
import { StripeAccountCreateParameter, StripeAccountResponse, StripeAccountUpdateParameter } from "../../types
|
|
11
|
-
import { ExtraParameter } from "../../types/sharetribe";
|
|
15
|
+
import { ExtraParameter, StripeAccountCreateParameter, StripeAccountResponse, StripeAccountUpdateParameter } from "../../types";
|
|
12
16
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* The Stripe Account API provides methods for managing Stripe accounts associated with the marketplace.
|
|
17
|
+
* Stripe Account API client (current user)
|
|
16
18
|
*/
|
|
17
19
|
declare class StripeAccount {
|
|
18
|
-
|
|
20
|
+
readonly authRequired = true;
|
|
19
21
|
private readonly axios;
|
|
22
|
+
private readonly endpoint;
|
|
20
23
|
private readonly headers;
|
|
21
|
-
readonly authRequired = true;
|
|
22
|
-
/**
|
|
23
|
-
* Creates an instance of the StripeAccount class.
|
|
24
|
-
*
|
|
25
|
-
* @param {MarketplaceApi} api - The Marketplace API instance providing configuration and request handling.
|
|
26
|
-
*/
|
|
27
24
|
constructor(api: MarketplaceApi);
|
|
28
25
|
/**
|
|
29
|
-
*
|
|
26
|
+
* Fetch current user's Stripe account
|
|
30
27
|
*
|
|
31
|
-
* @returns {Promise<AxiosResponse<StripeAccountResponse<
|
|
28
|
+
* @returns {Promise<AxiosResponse<StripeAccountResponse<"fetch">>>}
|
|
32
29
|
*
|
|
33
30
|
* @example
|
|
34
|
-
* const
|
|
35
|
-
*
|
|
31
|
+
* const { data } = await sdk.stripeAccount.fetch();
|
|
32
|
+
* console.log(data.attributes.stripeAccountData.capabilities);
|
|
36
33
|
*/
|
|
37
34
|
fetch(): Promise<AxiosResponse<StripeAccountResponse<"fetch">>>;
|
|
38
35
|
/**
|
|
39
|
-
*
|
|
36
|
+
* Create a new Stripe Connect account
|
|
40
37
|
*
|
|
41
38
|
* @template P
|
|
42
39
|
* @template EP
|
|
43
|
-
* @param {P & StripeAccountCreateParameter} params
|
|
44
|
-
* @param {EP
|
|
45
|
-
* @returns {Promise<AxiosResponse<StripeAccountResponse<
|
|
46
|
-
*
|
|
47
|
-
* @example
|
|
48
|
-
* const response = await sdk.stripeAccount.create({
|
|
49
|
-
* country: 'US',
|
|
50
|
-
* accountToken: 'account-token',
|
|
51
|
-
* bankAccountToken: 'bank-account-token',
|
|
52
|
-
* businessProfileMCC: '1234',
|
|
53
|
-
* businessProfileURL: 'https://example.com',
|
|
54
|
-
* businessProfileProductDescription: 'Product description',
|
|
55
|
-
* requestedCapabilities: ['card_payments', 'transfers'],
|
|
56
|
-
* });
|
|
57
|
-
* const createdStripeAccount = response.data;
|
|
40
|
+
* @param {P & StripeAccountCreateParameter} params
|
|
41
|
+
* @param {EP} [extraParams]
|
|
42
|
+
* @returns {Promise<AxiosResponse<StripeAccountResponse<"create", EP>>>}
|
|
58
43
|
*/
|
|
59
|
-
create<P extends StripeAccountCreateParameter, EP extends ExtraParameter>(params: P, extraParams?: EP): Promise<AxiosResponse<StripeAccountResponse<"create", EP>>>;
|
|
44
|
+
create<P extends StripeAccountCreateParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<StripeAccountResponse<"create", EP>>>;
|
|
60
45
|
/**
|
|
61
|
-
*
|
|
46
|
+
* Update existing Stripe Connect account
|
|
62
47
|
*
|
|
63
48
|
* @template P
|
|
64
49
|
* @template EP
|
|
65
|
-
* @param {P & StripeAccountUpdateParameter} params
|
|
66
|
-
* @param {EP
|
|
67
|
-
* @returns {Promise<AxiosResponse<StripeAccountResponse<
|
|
68
|
-
*
|
|
69
|
-
* @example
|
|
70
|
-
* const response = await sdk.stripeAccount.update({
|
|
71
|
-
* accountToken: 'new-account-token',
|
|
72
|
-
* });
|
|
73
|
-
* const updatedStripeAccount = response.data;
|
|
50
|
+
* @param {P & StripeAccountUpdateParameter} params
|
|
51
|
+
* @param {EP} [extraParams]
|
|
52
|
+
* @returns {Promise<AxiosResponse<StripeAccountResponse<"update", EP>>>}
|
|
74
53
|
*/
|
|
75
|
-
update<P extends StripeAccountUpdateParameter, EP extends ExtraParameter>(params: P, extraParams?: EP): Promise<AxiosResponse<StripeAccountResponse<"update", EP>>>;
|
|
54
|
+
update<P extends StripeAccountUpdateParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<StripeAccountResponse<"update", EP>>>;
|
|
76
55
|
}
|
|
77
56
|
export default StripeAccount;
|
|
78
57
|
//# sourceMappingURL=StripeAccount.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StripeAccount.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/marketplace/StripeAccount.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"StripeAccount.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/marketplace/StripeAccount.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAgB,aAAa,EAAC,MAAM,OAAO,CAAC;AACxD,OAAO,cAAc,MAAM,SAAS,CAAC;AACrC,OAAO,EACL,cAAc,EACd,4BAA4B,EAC5B,qBAAqB,EACrB,4BAA4B,EAC7B,MAAM,aAAa,CAAC;AAErB;;GAEG;AACH,cAAM,aAAa;IACjB,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;;;;;;;;OAQG;IACG,KAAK,IAAI,OAAO,CAAC,aAAa,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC,CAAC;IAMrE;;;;;;;;OAQG;IACG,MAAM,CACV,CAAC,SAAS,4BAA4B,EACtC,EAAE,SAAS,cAAc,GAAG,SAAS,GAAG,SAAS,EAEjD,MAAM,EAAE,CAAC,EACT,WAAW,CAAC,EAAE,EAAE,GACf,OAAO,CAAC,aAAa,CAAC,qBAAqB,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;IAQ9D;;;;;;;;OAQG;IACG,MAAM,CACV,CAAC,SAAS,4BAA4B,EACtC,EAAE,SAAS,cAAc,GAAG,SAAS,GAAG,SAAS,EAEjD,MAAM,EAAE,CAAC,EACT,WAAW,CAAC,EAAE,EAAE,GACf,OAAO,CAAC,aAAa,CAAC,qBAAqB,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;CAO/D;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -1,52 +1,43 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @fileoverview
|
|
3
|
-
* This class includes methods for creating account links to manage Stripe accounts.
|
|
2
|
+
* @fileoverview Client for creating Stripe Account Links in the Sharetribe Marketplace API.
|
|
4
3
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Use this to generate onboarding or verification links for the current user's Stripe Connect account.
|
|
5
|
+
* The returned link redirects the user to Stripe to complete account setup or provide missing info.
|
|
6
|
+
*
|
|
7
|
+
* @see https://www.sharetribe.com/api-reference/marketplace.html#stripe-account-links
|
|
7
8
|
*/
|
|
8
|
-
import { AxiosResponse } from "axios";
|
|
9
|
+
import type { AxiosResponse } from "axios";
|
|
9
10
|
import MarketplaceApi from "./index";
|
|
10
|
-
import { StripeAccountLinksCreateParameter, StripeAccountLinksResponse } from "../../types
|
|
11
|
-
import { ExtraParameter } from "../../types/sharetribe";
|
|
11
|
+
import { ExtraParameter, StripeAccountLinksCreateParameter, StripeAccountLinksResponse } from "../../types";
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* The Stripe Account Links API provides methods for creating links to manage Stripe accounts, such as onboarding links.
|
|
13
|
+
* Stripe Account Links API client (current user)
|
|
16
14
|
*/
|
|
17
15
|
declare class StripeAccountLinks {
|
|
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 StripeAccountLinks class.
|
|
24
|
-
*
|
|
25
|
-
* @param {MarketplaceApi} api - The Marketplace API instance providing configuration and request handling.
|
|
26
|
-
*/
|
|
27
20
|
constructor(api: MarketplaceApi);
|
|
28
21
|
/**
|
|
29
|
-
*
|
|
22
|
+
* Create a Stripe Account Link (onboarding or verification)
|
|
30
23
|
*
|
|
31
24
|
* @template P
|
|
32
25
|
* @template EP
|
|
33
|
-
* @param {P & StripeAccountLinksCreateParameter} params
|
|
34
|
-
* @param {EP
|
|
35
|
-
* @returns {Promise<AxiosResponse<StripeAccountLinksResponse<
|
|
26
|
+
* @param {P & StripeAccountLinksCreateParameter} params
|
|
27
|
+
* @param {EP} [extraParams]
|
|
28
|
+
* @returns {Promise<AxiosResponse<StripeAccountLinksResponse<"create", EP>>>}
|
|
36
29
|
*
|
|
37
30
|
* @example
|
|
38
|
-
* const
|
|
39
|
-
* failureURL:
|
|
40
|
-
* successURL:
|
|
41
|
-
* type:
|
|
42
|
-
* collectionOptions: {
|
|
43
|
-
* fields: ['currently_due', 'eventually_due'],
|
|
44
|
-
* future_requirements: ['include', 'omit'],
|
|
45
|
-
* },
|
|
31
|
+
* const { data } = await sdk.stripeAccountLinks.create({
|
|
32
|
+
* failureURL: "https://yoursite.com/stripe/failure",
|
|
33
|
+
* successURL: "https://yoursite.com/stripe/success",
|
|
34
|
+
* type: "account_onboarding",
|
|
46
35
|
* });
|
|
47
|
-
*
|
|
36
|
+
*
|
|
37
|
+
* // Redirect user
|
|
38
|
+
* window.location.href = data.attributes.url;
|
|
48
39
|
*/
|
|
49
|
-
create<P extends StripeAccountLinksCreateParameter, EP extends ExtraParameter>(params: P, extraParams?: EP): Promise<AxiosResponse<StripeAccountLinksResponse<"create", EP>>>;
|
|
40
|
+
create<P extends StripeAccountLinksCreateParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<StripeAccountLinksResponse<"create", EP>>>;
|
|
50
41
|
}
|
|
51
42
|
export default StripeAccountLinks;
|
|
52
43
|
//# sourceMappingURL=StripeAccountLinks.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StripeAccountLinks.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/marketplace/StripeAccountLinks.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"StripeAccountLinks.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/marketplace/StripeAccountLinks.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAgB,aAAa,EAAC,MAAM,OAAO,CAAC;AACxD,OAAO,cAAc,MAAM,SAAS,CAAC;AACrC,OAAO,EAAC,cAAc,EAAE,iCAAiC,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAE3G;;GAEG;AACH,cAAM,kBAAkB;IACtB,SAAgB,YAAY,QAAQ;IACpC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAgB;IACtC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAyB;gBAErC,GAAG,EAAE,cAAc;IAM/B;;;;;;;;;;;;;;;;;;OAkBG;IACG,MAAM,CACV,CAAC,SAAS,iCAAiC,EAC3C,EAAE,SAAS,cAAc,GAAG,SAAS,GAAG,SAAS,EAEjD,MAAM,EAAE,CAAC,EACT,WAAW,CAAC,EAAE,EAAE,GACf,OAAO,CAAC,aAAa,CAAC,0BAA0B,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;CAOpE;AAED,eAAe,kBAAkB,CAAC"}
|
|
@@ -1,77 +1,63 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @fileoverview
|
|
3
|
-
* This class includes methods for creating customers, adding payment methods, and deleting payment methods.
|
|
2
|
+
* @fileoverview Client for managing the current user's Stripe Customer object in the Sharetribe Marketplace API.
|
|
4
3
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Use this to:
|
|
5
|
+
* - Create a Stripe Customer (required for charging users)
|
|
6
|
+
* - Attach payment methods (e.g. saved cards)
|
|
7
|
+
* - Remove payment methods
|
|
8
|
+
*
|
|
9
|
+
* All operations are performed on the current authenticated user.
|
|
10
|
+
*
|
|
11
|
+
* @see https://www.sharetribe.com/api-reference/marketplace.html#stripe-customer
|
|
7
12
|
*/
|
|
8
|
-
import { AxiosResponse } from "axios";
|
|
13
|
+
import type { AxiosResponse } from "axios";
|
|
9
14
|
import MarketplaceApi from "./index";
|
|
10
|
-
import { StripeCustomerAddPaymentMethodParameter, StripeCustomerCreateParameter, StripeCustomerDeletePaymentMethodParameter, StripeCustomerResponse } from "../../types
|
|
11
|
-
import { ExtraParameter } from "../../types/sharetribe";
|
|
15
|
+
import { ExtraParameter, StripeCustomerAddPaymentMethodParameter, StripeCustomerCreateParameter, StripeCustomerDeletePaymentMethodParameter, StripeCustomerResponse } from "../../types";
|
|
12
16
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* The Stripe Customer API provides methods for managing Stripe customers, including creating customers and managing payment methods.
|
|
17
|
+
* Stripe Customer API client (current user)
|
|
16
18
|
*/
|
|
17
19
|
declare class StripeCustomer {
|
|
18
|
-
|
|
20
|
+
readonly authRequired = true;
|
|
19
21
|
private readonly axios;
|
|
22
|
+
private readonly endpoint;
|
|
20
23
|
private readonly headers;
|
|
21
|
-
readonly authRequired = true;
|
|
22
|
-
/**
|
|
23
|
-
* Creates an instance of the StripeCustomer class.
|
|
24
|
-
*
|
|
25
|
-
* @param {MarketplaceApi} api - The Marketplace API instance providing configuration and request handling.
|
|
26
|
-
*/
|
|
27
24
|
constructor(api: MarketplaceApi);
|
|
28
25
|
/**
|
|
29
|
-
*
|
|
26
|
+
* Create a Stripe Customer for the current user
|
|
30
27
|
*
|
|
31
28
|
* @template P
|
|
32
29
|
* @template EP
|
|
33
|
-
* @param {P & StripeCustomerCreateParameter} params
|
|
34
|
-
* @param {EP
|
|
35
|
-
* @returns {Promise<AxiosResponse<StripeCustomerResponse<
|
|
30
|
+
* @param {P & StripeCustomerCreateParameter} params
|
|
31
|
+
* @param {EP} [extraParams]
|
|
32
|
+
* @returns {Promise<AxiosResponse<StripeCustomerResponse<"create", P, EP>>>}
|
|
36
33
|
*
|
|
37
34
|
* @example
|
|
38
|
-
*
|
|
39
|
-
* stripePaymentMethodId:
|
|
40
|
-
* stripeCustomerEmail:
|
|
35
|
+
* await sdk.stripeCustomer.create({
|
|
36
|
+
* stripePaymentMethodId: "pm_card_visa",
|
|
37
|
+
* stripeCustomerEmail: "user@example.com"
|
|
41
38
|
* });
|
|
42
|
-
* const customer = response.data;
|
|
43
39
|
*/
|
|
44
|
-
create<P extends StripeCustomerCreateParameter, EP extends ExtraParameter>(params: P, extraParams?: EP): Promise<AxiosResponse<StripeCustomerResponse<"create", P, EP>>>;
|
|
40
|
+
create<P extends StripeCustomerCreateParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<StripeCustomerResponse<"create", P, EP>>>;
|
|
45
41
|
/**
|
|
46
|
-
*
|
|
42
|
+
* Attach a new payment method to the current user's Stripe Customer
|
|
47
43
|
*
|
|
48
44
|
* @template P
|
|
49
45
|
* @template EP
|
|
50
|
-
* @param {P & StripeCustomerAddPaymentMethodParameter} params
|
|
51
|
-
* @param {EP
|
|
52
|
-
* @returns {Promise<AxiosResponse<StripeCustomerResponse<
|
|
53
|
-
*
|
|
54
|
-
* @example
|
|
55
|
-
* const response = await sdk.stripeCustomer.addPaymentMethod({
|
|
56
|
-
* stripePaymentMethodId: 'payment-method-id'
|
|
57
|
-
* });
|
|
58
|
-
* const updatedCustomer = response.data;
|
|
46
|
+
* @param {P & StripeCustomerAddPaymentMethodParameter} params
|
|
47
|
+
* @param {EP} [extraParams]
|
|
48
|
+
* @returns {Promise<AxiosResponse<StripeCustomerResponse<"addPaymentMethod", P, EP>>>}
|
|
59
49
|
*/
|
|
60
|
-
addPaymentMethod<P extends StripeCustomerAddPaymentMethodParameter, EP extends ExtraParameter>(params: P, extraParams?: EP): Promise<AxiosResponse<StripeCustomerResponse<"addPaymentMethod", P, EP>>>;
|
|
50
|
+
addPaymentMethod<P extends StripeCustomerAddPaymentMethodParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<StripeCustomerResponse<"addPaymentMethod", P, EP>>>;
|
|
61
51
|
/**
|
|
62
|
-
*
|
|
52
|
+
* Remove a saved payment method
|
|
63
53
|
*
|
|
64
54
|
* @template P
|
|
65
55
|
* @template EP
|
|
66
|
-
* @param {P & StripeCustomerDeletePaymentMethodParameter} params
|
|
67
|
-
* @param {EP
|
|
68
|
-
* @returns {Promise<AxiosResponse<StripeCustomerResponse<
|
|
69
|
-
*
|
|
70
|
-
* @example
|
|
71
|
-
* const response = await sdk.stripeCustomer.deletePaymentMethod({ customer_id: 'customer-id', payment_method_id: 'payment-method-id' });
|
|
72
|
-
* const result = response.data;
|
|
56
|
+
* @param {P & StripeCustomerDeletePaymentMethodParameter} params
|
|
57
|
+
* @param {EP} [extraParams]
|
|
58
|
+
* @returns {Promise<AxiosResponse<StripeCustomerResponse<"deletePaymentMethod", P, EP>>>}
|
|
73
59
|
*/
|
|
74
|
-
deletePaymentMethod<P extends StripeCustomerDeletePaymentMethodParameter, EP extends ExtraParameter>(params: P, extraParams?: EP): Promise<AxiosResponse<StripeCustomerResponse<"deletePaymentMethod", P, EP>>>;
|
|
60
|
+
deletePaymentMethod<P extends StripeCustomerDeletePaymentMethodParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<StripeCustomerResponse<"deletePaymentMethod", P, EP>>>;
|
|
75
61
|
}
|
|
76
62
|
export default StripeCustomer;
|
|
77
63
|
//# sourceMappingURL=StripeCustomer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StripeCustomer.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/marketplace/StripeCustomer.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"StripeCustomer.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/marketplace/StripeCustomer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAgB,aAAa,EAAC,MAAM,OAAO,CAAC;AACxD,OAAO,cAAc,MAAM,SAAS,CAAC;AACrC,OAAO,EACL,cAAc,EACd,uCAAuC,EACvC,6BAA6B,EAC7B,0CAA0C,EAC1C,sBAAsB,EACvB,MAAM,aAAa,CAAC;AAErB;;GAEG;AACH,cAAM,cAAc;IAClB,SAAgB,YAAY,QAAQ;IACpC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAgB;IACtC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAyB;gBAErC,GAAG,EAAE,cAAc;IAM/B;;;;;;;;;;;;;;OAcG;IACG,MAAM,CACV,CAAC,SAAS,6BAA6B,EACvC,EAAE,SAAS,cAAc,GAAG,SAAS,GAAG,SAAS,EAEjD,MAAM,EAAE,CAAC,EACT,WAAW,CAAC,EAAE,EAAE,GACf,OAAO,CAAC,aAAa,CAAC,sBAAsB,CAAC,QAAQ,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IAQlE;;;;;;;;OAQG;IACG,gBAAgB,CACpB,CAAC,SAAS,uCAAuC,EACjD,EAAE,SAAS,cAAc,GAAG,SAAS,GAAG,SAAS,EAEjD,MAAM,EAAE,CAAC,EACT,WAAW,CAAC,EAAE,EAAE,GACf,OAAO,CAAC,aAAa,CAAC,sBAAsB,CAAC,kBAAkB,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IAQ5E;;;;;;;;OAQG;IACG,mBAAmB,CACvB,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,sBAAsB,CAAC,qBAAqB,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;CAOhF;AAED,eAAe,cAAc,CAAC"}
|