@vansite/ts-sharetribe-flex-sdk 1.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/LICENSE.txt +21 -0
- package/README.md +191 -0
- package/dist/ts-sharetribe-flex-sdk.cjs +3 -0
- package/dist/ts-sharetribe-flex-sdk.cjs.LICENSE.txt +701 -0
- package/dist/ts-sharetribe-flex-sdk.cjs.map +1 -0
- package/dist/ts-sharetribe-flex-sdk.js +3 -0
- package/dist/ts-sharetribe-flex-sdk.js.LICENSE.txt +701 -0
- package/dist/ts-sharetribe-flex-sdk.js.map +1 -0
- package/dist/ts-sharetribe-flex-sdk.mjs +3 -0
- package/dist/ts-sharetribe-flex-sdk.mjs.LICENSE.txt +701 -0
- package/dist/ts-sharetribe-flex-sdk.mjs.map +1 -0
- package/dist/types/endpoints/assets/index.d.ts +62 -0
- package/dist/types/endpoints/assets/index.d.ts.map +1 -0
- package/dist/types/endpoints/auth/index.d.ts +59 -0
- package/dist/types/endpoints/auth/index.d.ts.map +1 -0
- package/dist/types/endpoints/integrationApi/AvailabilityExceptions.d.ts +86 -0
- package/dist/types/endpoints/integrationApi/AvailabilityExceptions.d.ts.map +1 -0
- package/dist/types/endpoints/integrationApi/Events.d.ts +48 -0
- package/dist/types/endpoints/integrationApi/Events.d.ts.map +1 -0
- package/dist/types/endpoints/integrationApi/Images.d.ts +48 -0
- package/dist/types/endpoints/integrationApi/Images.d.ts.map +1 -0
- package/dist/types/endpoints/integrationApi/Listings.d.ts +150 -0
- package/dist/types/endpoints/integrationApi/Listings.d.ts.map +1 -0
- package/dist/types/endpoints/integrationApi/Marketplace.d.ts +39 -0
- package/dist/types/endpoints/integrationApi/Marketplace.d.ts.map +1 -0
- package/dist/types/endpoints/integrationApi/Stock.d.ts +48 -0
- package/dist/types/endpoints/integrationApi/Stock.d.ts.map +1 -0
- package/dist/types/endpoints/integrationApi/StockAdjustments.d.ts +65 -0
- package/dist/types/endpoints/integrationApi/StockAdjustments.d.ts.map +1 -0
- package/dist/types/endpoints/integrationApi/StockReservation.d.ts +43 -0
- package/dist/types/endpoints/integrationApi/StockReservation.d.ts.map +1 -0
- package/dist/types/endpoints/integrationApi/Transactions.d.ts +121 -0
- package/dist/types/endpoints/integrationApi/Transactions.d.ts.map +1 -0
- package/dist/types/endpoints/integrationApi/Users.d.ts +108 -0
- package/dist/types/endpoints/integrationApi/Users.d.ts.map +1 -0
- package/dist/types/endpoints/integrationApi/index.d.ts +59 -0
- package/dist/types/endpoints/integrationApi/index.d.ts.map +1 -0
- package/dist/types/endpoints/marketplace/AvailabilityExceptions.d.ts +84 -0
- package/dist/types/endpoints/marketplace/AvailabilityExceptions.d.ts.map +1 -0
- package/dist/types/endpoints/marketplace/Bookings.d.ts +45 -0
- package/dist/types/endpoints/marketplace/Bookings.d.ts.map +1 -0
- package/dist/types/endpoints/marketplace/CurrentUser.d.ts +182 -0
- package/dist/types/endpoints/marketplace/CurrentUser.d.ts.map +1 -0
- package/dist/types/endpoints/marketplace/Images.d.ts +47 -0
- package/dist/types/endpoints/marketplace/Images.d.ts.map +1 -0
- package/dist/types/endpoints/marketplace/Listings.d.ts +52 -0
- package/dist/types/endpoints/marketplace/Listings.d.ts.map +1 -0
- package/dist/types/endpoints/marketplace/Marketplace.d.ts +38 -0
- package/dist/types/endpoints/marketplace/Marketplace.d.ts.map +1 -0
- package/dist/types/endpoints/marketplace/Messages.d.ts +57 -0
- package/dist/types/endpoints/marketplace/Messages.d.ts.map +1 -0
- package/dist/types/endpoints/marketplace/OwnListings.d.ts +181 -0
- package/dist/types/endpoints/marketplace/OwnListings.d.ts.map +1 -0
- package/dist/types/endpoints/marketplace/PasswordReset.d.ts +63 -0
- package/dist/types/endpoints/marketplace/PasswordReset.d.ts.map +1 -0
- package/dist/types/endpoints/marketplace/ProcessTransitions.d.ts +43 -0
- package/dist/types/endpoints/marketplace/ProcessTransitions.d.ts.map +1 -0
- package/dist/types/endpoints/marketplace/Reviews.d.ts +52 -0
- package/dist/types/endpoints/marketplace/Reviews.d.ts.map +1 -0
- package/dist/types/endpoints/marketplace/Stock.d.ts +47 -0
- package/dist/types/endpoints/marketplace/Stock.d.ts.map +1 -0
- package/dist/types/endpoints/marketplace/StockAdjustments.d.ts +63 -0
- package/dist/types/endpoints/marketplace/StockAdjustments.d.ts.map +1 -0
- package/dist/types/endpoints/marketplace/StripeAccount.d.ts +78 -0
- package/dist/types/endpoints/marketplace/StripeAccount.d.ts.map +1 -0
- package/dist/types/endpoints/marketplace/StripeAccountLinks.d.ts +52 -0
- package/dist/types/endpoints/marketplace/StripeAccountLinks.d.ts.map +1 -0
- package/dist/types/endpoints/marketplace/StripeCustomer.d.ts +77 -0
- package/dist/types/endpoints/marketplace/StripeCustomer.d.ts.map +1 -0
- package/dist/types/endpoints/marketplace/StripePersons.d.ts +46 -0
- package/dist/types/endpoints/marketplace/StripePersons.d.ts.map +1 -0
- package/dist/types/endpoints/marketplace/StripeSetupIntents.d.ts +43 -0
- package/dist/types/endpoints/marketplace/StripeSetupIntents.d.ts.map +1 -0
- package/dist/types/endpoints/marketplace/TimeSlots.d.ts +44 -0
- package/dist/types/endpoints/marketplace/TimeSlots.d.ts.map +1 -0
- package/dist/types/endpoints/marketplace/Transactions.d.ts +126 -0
- package/dist/types/endpoints/marketplace/Transactions.d.ts.map +1 -0
- package/dist/types/endpoints/marketplace/Users.d.ts +42 -0
- package/dist/types/endpoints/marketplace/Users.d.ts.map +1 -0
- package/dist/types/endpoints/marketplace/index.d.ts +71 -0
- package/dist/types/endpoints/marketplace/index.d.ts.map +1 -0
- package/dist/types/index.d.ts +143 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/integrationSdk.d.ts +121 -0
- package/dist/types/integrationSdk.d.ts.map +1 -0
- package/dist/types/sdk.d.ts +213 -0
- package/dist/types/sdk.d.ts.map +1 -0
- package/dist/types/sdkTypes/BigDecimal.d.ts +31 -0
- package/dist/types/sdkTypes/BigDecimal.d.ts.map +1 -0
- package/dist/types/sdkTypes/LatLng.d.ts +35 -0
- package/dist/types/sdkTypes/LatLng.d.ts.map +1 -0
- package/dist/types/sdkTypes/LatLngBounds.d.ts +52 -0
- package/dist/types/sdkTypes/LatLngBounds.d.ts.map +1 -0
- package/dist/types/sdkTypes/Money.d.ts +29 -0
- package/dist/types/sdkTypes/Money.d.ts.map +1 -0
- package/dist/types/sdkTypes/UUID.d.ts +39 -0
- package/dist/types/sdkTypes/UUID.d.ts.map +1 -0
- package/dist/types/types/apiConfigs.d.ts +105 -0
- package/dist/types/types/apiConfigs.d.ts.map +1 -0
- package/dist/types/types/assets/index.d.ts +64 -0
- package/dist/types/types/assets/index.d.ts.map +1 -0
- package/dist/types/types/authentication/index.d.ts +102 -0
- package/dist/types/types/authentication/index.d.ts.map +1 -0
- package/dist/types/types/axios.d.ts +11 -0
- package/dist/types/types/axios.d.ts.map +1 -0
- package/dist/types/types/config.d.ts +138 -0
- package/dist/types/types/config.d.ts.map +1 -0
- package/dist/types/types/integration/events.d.ts +56 -0
- package/dist/types/types/integration/events.d.ts.map +1 -0
- package/dist/types/types/marketplace/availabilityExceptions.d.ts +57 -0
- package/dist/types/types/marketplace/availabilityExceptions.d.ts.map +1 -0
- package/dist/types/types/marketplace/bookings.d.ts +47 -0
- package/dist/types/types/marketplace/bookings.d.ts.map +1 -0
- package/dist/types/types/marketplace/currentUser.d.ts +159 -0
- package/dist/types/types/marketplace/currentUser.d.ts.map +1 -0
- package/dist/types/types/marketplace/images.d.ts +40 -0
- package/dist/types/types/marketplace/images.d.ts.map +1 -0
- package/dist/types/types/marketplace/listings.d.ts +140 -0
- package/dist/types/types/marketplace/listings.d.ts.map +1 -0
- package/dist/types/types/marketplace/marketplace.d.ts +21 -0
- package/dist/types/types/marketplace/marketplace.d.ts.map +1 -0
- package/dist/types/types/marketplace/messages.d.ts +50 -0
- package/dist/types/types/marketplace/messages.d.ts.map +1 -0
- package/dist/types/types/marketplace/ownListings.d.ts +129 -0
- package/dist/types/types/marketplace/ownListings.d.ts.map +1 -0
- package/dist/types/types/marketplace/passwordReset.d.ts +32 -0
- package/dist/types/types/marketplace/passwordReset.d.ts.map +1 -0
- package/dist/types/types/marketplace/processTransitions.d.ts +38 -0
- package/dist/types/types/marketplace/processTransitions.d.ts.map +1 -0
- package/dist/types/types/marketplace/reviews.d.ts +60 -0
- package/dist/types/types/marketplace/reviews.d.ts.map +1 -0
- package/dist/types/types/marketplace/stock.d.ts +29 -0
- package/dist/types/types/marketplace/stock.d.ts.map +1 -0
- package/dist/types/types/marketplace/stockAdjustment.d.ts +52 -0
- package/dist/types/types/marketplace/stockAdjustment.d.ts.map +1 -0
- package/dist/types/types/marketplace/stockReservations.d.ts +45 -0
- package/dist/types/types/marketplace/stockReservations.d.ts.map +1 -0
- package/dist/types/types/marketplace/stripeAccount.d.ts +45 -0
- package/dist/types/types/marketplace/stripeAccount.d.ts.map +1 -0
- package/dist/types/types/marketplace/stripeAccountLinks.d.ts +36 -0
- package/dist/types/types/marketplace/stripeAccountLinks.d.ts.map +1 -0
- package/dist/types/types/marketplace/stripeCustomer.d.ts +48 -0
- package/dist/types/types/marketplace/stripeCustomer.d.ts.map +1 -0
- package/dist/types/types/marketplace/stripePaymentMethod.d.ts +23 -0
- package/dist/types/types/marketplace/stripePaymentMethod.d.ts.map +1 -0
- package/dist/types/types/marketplace/stripePersons.d.ts +47 -0
- package/dist/types/types/marketplace/stripePersons.d.ts.map +1 -0
- package/dist/types/types/marketplace/stripeSetupIntents.d.ts +47 -0
- package/dist/types/types/marketplace/stripeSetupIntents.d.ts.map +1 -0
- package/dist/types/types/marketplace/timeSlots.d.ts +54 -0
- package/dist/types/types/marketplace/timeSlots.d.ts.map +1 -0
- package/dist/types/types/marketplace/transactions.d.ts +191 -0
- package/dist/types/types/marketplace/transactions.d.ts.map +1 -0
- package/dist/types/types/marketplace/user.d.ts +166 -0
- package/dist/types/types/marketplace/user.d.ts.map +1 -0
- package/dist/types/types/sdk-types.d.ts +11 -0
- package/dist/types/types/sdk-types.d.ts.map +1 -0
- package/dist/types/types/sharetribe.d.ts +177 -0
- package/dist/types/types/sharetribe.d.ts.map +1 -0
- package/dist/types/types/store.d.ts +34 -0
- package/dist/types/types/store.d.ts.map +1 -0
- package/dist/types/utils/apis.d.ts +9 -0
- package/dist/types/utils/apis.d.ts.map +1 -0
- package/dist/types/utils/config.d.ts +16 -0
- package/dist/types/utils/config.d.ts.map +1 -0
- package/dist/types/utils/convert-types.d.ts +14 -0
- package/dist/types/utils/convert-types.d.ts.map +1 -0
- package/dist/types/utils/parameter-serializer.d.ts +24 -0
- package/dist/types/utils/parameter-serializer.d.ts.map +1 -0
- package/dist/types/utils/prepare-axios-instance.d.ts +14 -0
- package/dist/types/utils/prepare-axios-instance.d.ts.map +1 -0
- package/dist/types/utils/stores/BrowserStore.d.ts +39 -0
- package/dist/types/utils/stores/BrowserStore.d.ts.map +1 -0
- package/dist/types/utils/stores/ExpressStore.d.ts +50 -0
- package/dist/types/utils/stores/ExpressStore.d.ts.map +1 -0
- package/dist/types/utils/stores/MemoryStore.d.ts +25 -0
- package/dist/types/utils/stores/MemoryStore.d.ts.map +1 -0
- package/dist/types/utils/stores/store.d.ts +9 -0
- package/dist/types/utils/stores/store.d.ts.map +1 -0
- package/dist/types/utils/transit.d.ts +30 -0
- package/dist/types/utils/transit.d.ts.map +1 -0
- package/dist/types/utils/util.d.ts +13 -0
- package/dist/types/utils/util.d.ts.map +1 -0
- package/package.json +90 -0
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Provides the CurrentUser class for managing the current user's account in the Sharetribe Marketplace API.
|
|
3
|
+
* This class includes methods for retrieving, creating, updating, and deleting the current authenticated user.
|
|
4
|
+
*
|
|
5
|
+
* For more details, refer to the Marketplace API documentation:
|
|
6
|
+
* https://www.sharetribe.com/api-reference/marketplace.html#current-user
|
|
7
|
+
*/
|
|
8
|
+
import { AxiosResponse } from "axios";
|
|
9
|
+
import MarketplaceApi from "./index";
|
|
10
|
+
import { CurrentUserChangeEmailParameter, CurrentUserChangePasswordParameter, CurrentUserCreateParameter, CurrentUserCreateWithIdpParameter, CurrentUserDeleteParameter, CurrentUserResponse, CurrentUserShowParameter, CurrentUserUpdateProfileParameter, CurrentUserVerifyEmailParameter } from "../../types/marketplace/currentUser";
|
|
11
|
+
import { ExtraParameter } from "../../types/sharetribe";
|
|
12
|
+
/**
|
|
13
|
+
* Class representing the Current User API.
|
|
14
|
+
*
|
|
15
|
+
* This class provides methods to manage the current authenticated user's account,
|
|
16
|
+
* including viewing, creating, updating, and deleting the user profile.
|
|
17
|
+
*/
|
|
18
|
+
declare class CurrentUser {
|
|
19
|
+
private readonly endpoint;
|
|
20
|
+
private readonly axios;
|
|
21
|
+
private readonly headers;
|
|
22
|
+
readonly authRequired = true;
|
|
23
|
+
/**
|
|
24
|
+
* Creates an instance of the CurrentUser class.
|
|
25
|
+
*
|
|
26
|
+
* @param {MarketplaceApi} api - The Marketplace API instance providing configuration and request handling.
|
|
27
|
+
*/
|
|
28
|
+
constructor(api: MarketplaceApi);
|
|
29
|
+
/**
|
|
30
|
+
* Retrieves the current authenticated user's details.
|
|
31
|
+
*
|
|
32
|
+
* @template P
|
|
33
|
+
* @param {P & CurrentUserShowParameter} params - Parameters for the request.
|
|
34
|
+
* @returns {Promise<CurrentUserResponse<'show', P>>} - A promise resolving to the user's details.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* const response = await sdk.currentUser.show({});
|
|
38
|
+
* const user = response.data;
|
|
39
|
+
*/
|
|
40
|
+
show<P extends CurrentUserShowParameter>(params: P): Promise<AxiosResponse<CurrentUserResponse<"show", P>>>;
|
|
41
|
+
/**
|
|
42
|
+
* Deletes the current authenticated user's account.
|
|
43
|
+
*
|
|
44
|
+
* @template P
|
|
45
|
+
* @template EP
|
|
46
|
+
* @param {P & CurrentUserDeleteParameter} params - Parameters for the request.
|
|
47
|
+
* @param {EP} extraParams - Optional extra parameters for the request.
|
|
48
|
+
* @returns {Promise<CurrentUserResponse<'delete', P>>} - A promise resolving to the deletion confirmation.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* const response = await sdk.currentUser.delete();
|
|
52
|
+
* const result = response.data;
|
|
53
|
+
*/
|
|
54
|
+
delete<P extends CurrentUserDeleteParameter, EP extends ExtraParameter>(params: P, extraParams: EP): Promise<AxiosResponse<CurrentUserResponse<"delete", P>>>;
|
|
55
|
+
/**
|
|
56
|
+
* Creates a new user account.
|
|
57
|
+
*
|
|
58
|
+
* @template P
|
|
59
|
+
* @template EP
|
|
60
|
+
* @param {P & CurrentUserCreateParameter} params - Parameters for the new user.
|
|
61
|
+
* @param {EP} extraParams - Optional extra parameters for the request.
|
|
62
|
+
* @returns {Promise<CurrentUserResponse<'create', P>>} - A promise resolving to the created user's details.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* const response = await sdk.currentUser.create({
|
|
66
|
+
* email: 'user@example.com',
|
|
67
|
+
* password: 'secure-password',
|
|
68
|
+
* firstName: 'First',
|
|
69
|
+
* lastName: 'Last'
|
|
70
|
+
* });
|
|
71
|
+
* const newUser = response.data;
|
|
72
|
+
*/
|
|
73
|
+
create<P extends CurrentUserCreateParameter, EP extends ExtraParameter>(params: P, extraParams: EP): Promise<AxiosResponse<CurrentUserResponse<"create", P>>>;
|
|
74
|
+
/**
|
|
75
|
+
* Creates a new user account using an identity provider.
|
|
76
|
+
*
|
|
77
|
+
* @template P
|
|
78
|
+
* @template EP
|
|
79
|
+
* @param {P & CurrentUserCreateWithIdpParameter} params - Parameters for the new user with identity provider details.
|
|
80
|
+
* @param {EP} extraParams - Optional extra parameters for the request.
|
|
81
|
+
* @returns {Promise<CurrentUserResponse<'create_with_idp', P>>} - A promise resolving to the created user's details.
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* const response = await sdk.currentUser.createWithIdp({
|
|
85
|
+
* idpId: 'provider-id',
|
|
86
|
+
* idpClientId: 'provider-client-id',
|
|
87
|
+
* idpToken: 'provider-token'
|
|
88
|
+
* });
|
|
89
|
+
* const newUser = response.data;
|
|
90
|
+
*/
|
|
91
|
+
createWithIdp<P extends CurrentUserCreateWithIdpParameter, EP extends ExtraParameter>(params: P, extraParams: EP): Promise<AxiosResponse<CurrentUserResponse<"create_with_idp", P>>>;
|
|
92
|
+
/**
|
|
93
|
+
* Updates the current authenticated user's profile.
|
|
94
|
+
*
|
|
95
|
+
* @template P
|
|
96
|
+
* @template EP
|
|
97
|
+
* @param {P & CurrentUserUpdateProfileParameter} params - Parameters for updating the profile.
|
|
98
|
+
* @param {EP} extraParams - Optional extra parameters for the request.
|
|
99
|
+
* @returns {Promise<CurrentUserResponse<'update_profile', P>>} - A promise resolving to the updated user's details.
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* const response = await sdk.currentUser.updateProfile({
|
|
103
|
+
* firstName: 'UpdatedFirst',
|
|
104
|
+
* lastName: 'UpdatedLast'
|
|
105
|
+
* });
|
|
106
|
+
* const updatedUser = response.data;
|
|
107
|
+
*/
|
|
108
|
+
updateProfile<P extends CurrentUserUpdateProfileParameter, EP extends ExtraParameter>(params: P, extraParams: EP): Promise<AxiosResponse<CurrentUserResponse<"update_profile", P>>>;
|
|
109
|
+
/**
|
|
110
|
+
* Changes the current authenticated user's password.
|
|
111
|
+
*
|
|
112
|
+
* @template P
|
|
113
|
+
* @template EP
|
|
114
|
+
* @param {P & CurrentUserChangePasswordParameter} params - Parameters for changing the password.
|
|
115
|
+
* @param {EP} extraParams - Optional extra parameters for the request.
|
|
116
|
+
* @returns {Promise<CurrentUserResponse<'change_password', P>>} - A promise resolving to the password change confirmation.
|
|
117
|
+
*
|
|
118
|
+
* @example
|
|
119
|
+
* const response = await sdk.currentUser.changePassword({
|
|
120
|
+
* currentPassword: 'old-password',
|
|
121
|
+
* newPassword: 'new-secure-password'
|
|
122
|
+
* });
|
|
123
|
+
* const result = response.data;
|
|
124
|
+
*/
|
|
125
|
+
changePassword<P extends CurrentUserChangePasswordParameter, EP extends ExtraParameter>(params: P, extraParams: EP): Promise<AxiosResponse<CurrentUserResponse<"change_password", P>>>;
|
|
126
|
+
/**
|
|
127
|
+
* Changes the current authenticated user's email address.
|
|
128
|
+
*
|
|
129
|
+
* @template P
|
|
130
|
+
* @template EP
|
|
131
|
+
* @param {P & CurrentUserChangeEmailParameter} params - Parameters for changing the email address.
|
|
132
|
+
* @param {EP} extraParams - Optional extra parameters for the request.
|
|
133
|
+
* @returns {Promise<CurrentUserResponse<'change_email', P>>} - A promise resolving to the email change confirmation.
|
|
134
|
+
*
|
|
135
|
+
* @example
|
|
136
|
+
* const response = await sdk.currentUser.changeEmail({
|
|
137
|
+
* newEmail: 'new-email@example.com',
|
|
138
|
+
* currentPassword: 'current-password'
|
|
139
|
+
* });
|
|
140
|
+
* const result = response.data;
|
|
141
|
+
*/
|
|
142
|
+
changeEmail<P extends CurrentUserChangeEmailParameter, EP extends ExtraParameter>(params: P, extraParams: EP): Promise<AxiosResponse<CurrentUserResponse<"change_email", P>>>;
|
|
143
|
+
/**
|
|
144
|
+
* Verifies the current authenticated user's email address.
|
|
145
|
+
*
|
|
146
|
+
* @template P
|
|
147
|
+
* @template EP
|
|
148
|
+
* @param {P & CurrentUserVerifyEmailParameter} params - Parameters for verifying the email address.
|
|
149
|
+
* @param {EP} extraParams - Optional extra parameters for the request.
|
|
150
|
+
* @returns {Promise<CurrentUserResponse<'verify_email', P>>} - A promise resolving to the email verification confirmation.
|
|
151
|
+
*
|
|
152
|
+
* @example
|
|
153
|
+
* const response = await sdk.currentUser.verifyEmail({
|
|
154
|
+
* verificationToken: 'verification-token'
|
|
155
|
+
* });
|
|
156
|
+
* const result = response.data;
|
|
157
|
+
*/
|
|
158
|
+
verifyEmail<P extends CurrentUserVerifyEmailParameter, EP extends ExtraParameter>(params: P, extraParams: EP): Promise<AxiosResponse<CurrentUserResponse<"verify_email", P>>>;
|
|
159
|
+
/**
|
|
160
|
+
* Sends a verification email to the current authenticated user.
|
|
161
|
+
*
|
|
162
|
+
* @template P
|
|
163
|
+
* @returns {Promise<CurrentUserResponse<'send_verification_email', P>>} - A promise resolving to the email sending confirmation.
|
|
164
|
+
*
|
|
165
|
+
* @example
|
|
166
|
+
* const response = await sdk.currentUser.sendVerificationEmail();
|
|
167
|
+
* const result = response.data;
|
|
168
|
+
*/
|
|
169
|
+
sendVerificationEmail<P extends void>(): Promise<AxiosResponse<CurrentUserResponse<"send_verification_email", P>>>;
|
|
170
|
+
/**
|
|
171
|
+
* @deprecated This API endpoint is DEPRECATED. Use /stripe_account/create instead!
|
|
172
|
+
* Throws an error to indicate that this method should not be used.
|
|
173
|
+
*/
|
|
174
|
+
createStripeAccount(): Promise<void>;
|
|
175
|
+
/**
|
|
176
|
+
* @deprecated This API endpoint is DEPRECATED. Use /stripe_account/update instead!
|
|
177
|
+
* Throws an error to indicate that this method should not be used.
|
|
178
|
+
*/
|
|
179
|
+
updateStripeAccount(): Promise<void>;
|
|
180
|
+
}
|
|
181
|
+
export default CurrentUser;
|
|
182
|
+
//# sourceMappingURL=CurrentUser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CurrentUser.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/marketplace/CurrentUser.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Provides the Images class for managing images in the Sharetribe Marketplace API.
|
|
3
|
+
* This class allows uploading images for marketplace listings and resources.
|
|
4
|
+
*
|
|
5
|
+
* For more details, refer to the Marketplace API documentation:
|
|
6
|
+
* https://www.sharetribe.com/api-reference/marketplace.html#images
|
|
7
|
+
*/
|
|
8
|
+
import { AxiosResponse } from "axios";
|
|
9
|
+
import MarketplaceApi from "./index";
|
|
10
|
+
import { ImagesResponse, ImagesUploadParameter } from "../../types/marketplace/images";
|
|
11
|
+
import { ExtraParameter } from "../../types/sharetribe";
|
|
12
|
+
/**
|
|
13
|
+
* Class representing the Images API.
|
|
14
|
+
*
|
|
15
|
+
* The Images API provides methods to upload images for marketplace resources.
|
|
16
|
+
*/
|
|
17
|
+
declare class Images {
|
|
18
|
+
private readonly endpoint;
|
|
19
|
+
private readonly axios;
|
|
20
|
+
private readonly headers;
|
|
21
|
+
readonly authRequired = true;
|
|
22
|
+
/**
|
|
23
|
+
* Creates an instance of the Images class.
|
|
24
|
+
*
|
|
25
|
+
* @param {MarketplaceApi} api - The Marketplace API instance providing configuration and request handling.
|
|
26
|
+
*/
|
|
27
|
+
constructor(api: MarketplaceApi);
|
|
28
|
+
/**
|
|
29
|
+
* Uploads an image to the marketplace.
|
|
30
|
+
*
|
|
31
|
+
* @template P
|
|
32
|
+
* @template EP
|
|
33
|
+
* @param {P & ImagesUploadParameter} params - The image upload parameters, including the image file and metadata.
|
|
34
|
+
* @param {EP & ExtraParameter} extraParams - Optional extra parameters for the request.
|
|
35
|
+
* @returns {Promise<AxiosResponse<ImagesResponse<'upload', EP>>>} - A promise resolving to the uploaded image details.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* const response = await sdk.images.upload({
|
|
39
|
+
* image: file,
|
|
40
|
+
* });
|
|
41
|
+
*
|
|
42
|
+
* const uploadedImage = response.data;
|
|
43
|
+
*/
|
|
44
|
+
upload<P extends ImagesUploadParameter, EP extends ExtraParameter>(params: P, extraParams: EP): Promise<AxiosResponse<ImagesResponse<"upload", EP>>>;
|
|
45
|
+
}
|
|
46
|
+
export default Images;
|
|
47
|
+
//# sourceMappingURL=Images.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Images.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/marketplace/Images.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAiB,aAAa,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,cAAc,MAAM,SAAS,CAAC;AACrC,OAAO,EACL,cAAc,EACd,qBAAqB,EACtB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD;;;;GAIG;AACH,cAAM,MAAM;IACV,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAgB;IACtC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAyB;IACjD,SAAgB,YAAY,QAAQ;IAEpC;;;;OAIG;gBACS,GAAG,EAAE,cAAc;IAM/B;;;;;;;;;;;;;;;OAeG;IACG,MAAM,CAAC,CAAC,SAAS,qBAAqB,EAAE,EAAE,SAAS,cAAc,EACrE,MAAM,EAAE,CAAC,EACT,WAAW,EAAE,EAAE,GACd,OAAO,CAAC,aAAa,CAAC,cAAc,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;CAOxD;AAED,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Provides the Listings class for managing listings in the Sharetribe Marketplace API.
|
|
3
|
+
* This class allows querying and retrieving details of listings.
|
|
4
|
+
*
|
|
5
|
+
* For more details, refer to the Marketplace API documentation:
|
|
6
|
+
* https://www.sharetribe.com/api-reference/marketplace.html#listings
|
|
7
|
+
*/
|
|
8
|
+
import { AxiosResponse } from "axios";
|
|
9
|
+
import MarketplaceApi from "./index";
|
|
10
|
+
import { ListingsShowParameter, ListingsResponse, ListingsQueryParameter } from "../../types/marketplace/listings";
|
|
11
|
+
/**
|
|
12
|
+
* Class representing the Listings API.
|
|
13
|
+
*
|
|
14
|
+
* The Listings API provides methods to query and retrieve details of marketplace listings.
|
|
15
|
+
*/
|
|
16
|
+
declare class Listings {
|
|
17
|
+
private readonly endpoint;
|
|
18
|
+
private readonly axios;
|
|
19
|
+
private readonly headers;
|
|
20
|
+
/**
|
|
21
|
+
* Creates an instance of the Listings class.
|
|
22
|
+
*
|
|
23
|
+
* @param {MarketplaceApi} api - The Marketplace API instance providing configuration and request handling.
|
|
24
|
+
*/
|
|
25
|
+
constructor(api: MarketplaceApi);
|
|
26
|
+
/**
|
|
27
|
+
* Retrieves details of a specific listing.
|
|
28
|
+
*
|
|
29
|
+
* @template P
|
|
30
|
+
* @param {P & ListingsShowParameter} params - The parameters to identify the listing.
|
|
31
|
+
* @returns {Promise<AxiosResponse<ListingsResponse<'show', P>>>} - A promise resolving to the listing details.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* const response = await sdk.listings.show({ id: 'listing-id' });
|
|
35
|
+
* const listing = response.data;
|
|
36
|
+
*/
|
|
37
|
+
show<P extends ListingsShowParameter>(params: P): Promise<AxiosResponse<ListingsResponse<"show", P>>>;
|
|
38
|
+
/**
|
|
39
|
+
* Queries listings based on specified filters.
|
|
40
|
+
*
|
|
41
|
+
* @template P
|
|
42
|
+
* @param {P & ListingsQueryParameter} params - Query parameters to filter listings.
|
|
43
|
+
* @returns {Promise<AxiosResponse<ListingsResponse<'query', P>>>} - A promise resolving to the query results.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* const response = await sdk.listings.query({ ids: ['listing-id-1', 'listing-id-2'] });
|
|
47
|
+
* const listings = response.data;
|
|
48
|
+
*/
|
|
49
|
+
query<P extends ListingsQueryParameter>(params: P): Promise<AxiosResponse<ListingsResponse<"query", P>>>;
|
|
50
|
+
}
|
|
51
|
+
export default Listings;
|
|
52
|
+
//# sourceMappingURL=Listings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Listings.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/marketplace/Listings.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAiB,aAAa,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,cAAc,MAAM,SAAS,CAAC;AACrC,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,sBAAsB,EACvB,MAAM,kCAAkC,CAAC;AAE1C;;;;GAIG;AACH,cAAM,QAAQ;IACZ,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAgB;IACtC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAyB;IAEjD;;;;OAIG;gBACS,GAAG,EAAE,cAAc;IAM/B;;;;;;;;;;OAUG;IACG,IAAI,CAAC,CAAC,SAAS,qBAAqB,EACxC,MAAM,EAAE,CAAC,GACR,OAAO,CAAC,aAAa,CAAC,gBAAgB,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC;IAUtD;;;;;;;;;;OAUG;IACG,KAAK,CAAC,CAAC,SAAS,sBAAsB,EAC1C,MAAM,EAAE,CAAC,GACR,OAAO,CAAC,aAAa,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;CASxD;AAED,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Provides the Marketplace class for retrieving marketplace details from the Sharetribe Marketplace API.
|
|
3
|
+
* This class allows accessing configuration and metadata about the marketplace.
|
|
4
|
+
*
|
|
5
|
+
* For more details, refer to the Marketplace API documentation:
|
|
6
|
+
* https://www.sharetribe.com/api-reference/marketplace.html#marketplace
|
|
7
|
+
*/
|
|
8
|
+
import { AxiosResponse } from "axios";
|
|
9
|
+
import MarketplaceApi from "./index";
|
|
10
|
+
import { MarketplaceResponse } from "../../types/marketplace/marketplace";
|
|
11
|
+
/**
|
|
12
|
+
* Class representing the Marketplace API.
|
|
13
|
+
*
|
|
14
|
+
* The Marketplace API provides methods to retrieve configuration and metadata about the marketplace.
|
|
15
|
+
*/
|
|
16
|
+
declare class Marketplace {
|
|
17
|
+
private readonly endpoint;
|
|
18
|
+
private readonly axios;
|
|
19
|
+
private readonly headers;
|
|
20
|
+
/**
|
|
21
|
+
* Creates an instance of the Marketplace class.
|
|
22
|
+
*
|
|
23
|
+
* @param {MarketplaceApi} api - The Marketplace API instance providing configuration and request handling.
|
|
24
|
+
*/
|
|
25
|
+
constructor(api: MarketplaceApi);
|
|
26
|
+
/**
|
|
27
|
+
* Retrieves the configuration and metadata of the marketplace.
|
|
28
|
+
*
|
|
29
|
+
* @returns {Promise<AxiosResponse<MarketplaceResponse<'show'>>>} - A promise resolving to the marketplace details.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* const response = await sdk.marketplace.show();
|
|
33
|
+
* const marketplaceDetails = response.data;
|
|
34
|
+
*/
|
|
35
|
+
show(): Promise<AxiosResponse<MarketplaceResponse<"show">>>;
|
|
36
|
+
}
|
|
37
|
+
export default Marketplace;
|
|
38
|
+
//# sourceMappingURL=Marketplace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Marketplace.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/marketplace/Marketplace.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAiB,aAAa,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,cAAc,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAE1E;;;;GAIG;AACH,cAAM,WAAW;IACf,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAgB;IACtC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAyB;IAEjD;;;;OAIG;gBACS,GAAG,EAAE,cAAc;IAM/B;;;;;;;;OAQG;IACG,IAAI,IAAI,OAAO,CAAC,aAAa,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAAC;CAQlE;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Provides the Messages class for managing messages in the Sharetribe Marketplace API.
|
|
3
|
+
* This class allows querying and sending messages.
|
|
4
|
+
*
|
|
5
|
+
* For more details, refer to the Marketplace API documentation:
|
|
6
|
+
* https://www.sharetribe.com/api-reference/marketplace.html#messages
|
|
7
|
+
*/
|
|
8
|
+
import { AxiosResponse } from "axios";
|
|
9
|
+
import MarketplaceApi from "./index";
|
|
10
|
+
import { ExtraParameter } from "../../types/sharetribe";
|
|
11
|
+
import { MessagesQueryParameter, MessagesResponse, MessagesSendParameter } from "../../types/marketplace/messages";
|
|
12
|
+
/**
|
|
13
|
+
* Class representing the Messages API.
|
|
14
|
+
*
|
|
15
|
+
* The Messages API provides methods to query and send messages in the marketplace.
|
|
16
|
+
*/
|
|
17
|
+
declare class Messages {
|
|
18
|
+
private readonly endpoint;
|
|
19
|
+
private readonly axios;
|
|
20
|
+
private readonly headers;
|
|
21
|
+
/**
|
|
22
|
+
* Creates an instance of the Messages class.
|
|
23
|
+
*
|
|
24
|
+
* @param {MarketplaceApi} api - The Marketplace API instance providing configuration and request handling.
|
|
25
|
+
*/
|
|
26
|
+
constructor(api: MarketplaceApi);
|
|
27
|
+
/**
|
|
28
|
+
* Queries messages based on specified filters.
|
|
29
|
+
*
|
|
30
|
+
* @template P
|
|
31
|
+
* @param {P & MessagesQueryParameter} params - Query parameters to filter messages.
|
|
32
|
+
* @returns {Promise<AxiosResponse<MessagesResponse<'query', P>>>} - A promise resolving to the query results.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* const response = await sdk.messages.query({ transactionId: 'transaction-id' });
|
|
36
|
+
* const messages = response.data;
|
|
37
|
+
*/
|
|
38
|
+
query<P extends MessagesQueryParameter>(params: P): Promise<AxiosResponse<MessagesResponse<"query", P>>>;
|
|
39
|
+
/**
|
|
40
|
+
* Sends a new message.
|
|
41
|
+
*
|
|
42
|
+
* @template P
|
|
43
|
+
* @template EP
|
|
44
|
+
* @param {P & MessagesSendParameter} params - Parameters specifying the message content and recipient.
|
|
45
|
+
* @param {EP | void} extraParams - Optional extra parameters for the request.
|
|
46
|
+
* @returns {Promise<AxiosResponse<MessagesResponse<'send', P, EP>>>} - A promise resolving to the sent message details.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* const response = await sdk.messages.send({
|
|
50
|
+
* transactionId: 'transaction-id', content: 'Hello!'
|
|
51
|
+
* });
|
|
52
|
+
* const sentMessage = response.data;
|
|
53
|
+
*/
|
|
54
|
+
send<P extends MessagesSendParameter, EP extends ExtraParameter>(params: P, extraParams: EP | void): Promise<AxiosResponse<MessagesResponse<"send", P, EP>>>;
|
|
55
|
+
}
|
|
56
|
+
export default Messages;
|
|
57
|
+
//# sourceMappingURL=Messages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Messages.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/marketplace/Messages.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAiB,aAAa,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,cAAc,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EACL,sBAAsB,EACtB,gBAAgB,EAChB,qBAAqB,EACtB,MAAM,kCAAkC,CAAC;AAE1C;;;;GAIG;AACH,cAAM,QAAQ;IACZ,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAgB;IACtC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAyB;IAEjD;;;;OAIG;gBACS,GAAG,EAAE,cAAc;IAM/B;;;;;;;;;;OAUG;IACG,KAAK,CAAC,CAAC,SAAS,sBAAsB,EAC1C,MAAM,EAAE,CAAC,GACR,OAAO,CAAC,aAAa,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;IAUvD;;;;;;;;;;;;;;OAcG;IACG,IAAI,CAAC,CAAC,SAAS,qBAAqB,EAAE,EAAE,SAAS,cAAc,EACnE,MAAM,EAAE,CAAC,EACT,WAAW,EAAE,EAAE,GAAG,IAAI,GACrB,OAAO,CAAC,aAAa,CAAC,gBAAgB,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;CAO3D;AAED,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Provides the OwnListings class for managing the authenticated user's listings in the Sharetribe Marketplace API.
|
|
3
|
+
* This class includes methods for creating, updating, publishing, and managing the lifecycle of listings.
|
|
4
|
+
*
|
|
5
|
+
* For more details, refer to the Marketplace API documentation:
|
|
6
|
+
* https://www.sharetribe.com/api-reference/marketplace.html#own-listings
|
|
7
|
+
*/
|
|
8
|
+
import { AxiosResponse } from "axios";
|
|
9
|
+
import MarketplaceApi from "./index";
|
|
10
|
+
import { OwnListingsAddImageParameter, OwnListingsCloseParameter, OwnListingsCreateDraftParameter, OwnListingsCreateParameter, OwnListingsDiscardDraftParameter, OwnListingsOpenParameter, OwnListingsPublishDraftParameter, OwnListingsQueryParameter, OwnListingsResponse, OwnListingsShowParameter, OwnListingsUpdateParameter } from "../../types/marketplace/ownListings";
|
|
11
|
+
import { ExtraParameter } from "../../types/sharetribe";
|
|
12
|
+
/**
|
|
13
|
+
* Class representing the Own Listings API.
|
|
14
|
+
*
|
|
15
|
+
* This class provides methods for the authenticated user to manage their listings, including creating, updating, publishing drafts, and adding images.
|
|
16
|
+
*/
|
|
17
|
+
declare class OwnListings {
|
|
18
|
+
private readonly endpoint;
|
|
19
|
+
private readonly axios;
|
|
20
|
+
private readonly headers;
|
|
21
|
+
readonly authRequired = true;
|
|
22
|
+
/**
|
|
23
|
+
* Creates an instance of the OwnListings class.
|
|
24
|
+
*
|
|
25
|
+
* @param {MarketplaceApi} api - The Marketplace API instance providing configuration and request handling.
|
|
26
|
+
*/
|
|
27
|
+
constructor(api: MarketplaceApi);
|
|
28
|
+
/**
|
|
29
|
+
* Retrieves details of a specific listing.
|
|
30
|
+
*
|
|
31
|
+
* @template P
|
|
32
|
+
* @param {OwnListingsShowParameter} params - Parameters identifying the listing.
|
|
33
|
+
* @returns {Promise<AxiosResponse<OwnListingsResponse<'show', P>>>} - A promise resolving to the listing details.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* const response = await sdk.ownListings.show({ id: 'listing-id' });
|
|
37
|
+
* const listing = response.data;
|
|
38
|
+
*/
|
|
39
|
+
show<P extends OwnListingsShowParameter>(params: P): Promise<AxiosResponse<OwnListingsResponse<"show", P>>>;
|
|
40
|
+
/**
|
|
41
|
+
* Queries the user's listings based on specified filters.
|
|
42
|
+
*
|
|
43
|
+
* @template P
|
|
44
|
+
* @param {OwnListingsQueryParameter} params - Query parameters to filter listings.
|
|
45
|
+
* @returns {Promise<AxiosResponse<OwnListingsResponse<'query', P>>>} - A promise resolving to the query results.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* const response = await sdk.ownListings.query({});
|
|
49
|
+
* const listings = response.data;
|
|
50
|
+
*/
|
|
51
|
+
query<P extends OwnListingsQueryParameter>(params: P): Promise<AxiosResponse<OwnListingsResponse<"query", P>>>;
|
|
52
|
+
/**
|
|
53
|
+
* Creates a new listing.
|
|
54
|
+
*
|
|
55
|
+
* @template P
|
|
56
|
+
* @template EP
|
|
57
|
+
* @param {P & OwnListingsCreateParameter} params - Parameters for the new listing.
|
|
58
|
+
* @param {EP | void} extraParams - Optional extra parameters for the request.
|
|
59
|
+
* @returns {Promise<AxiosResponse<OwnListingsResponse<'create', P, EP>>>} - A promise resolving to the created listing details.
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* const response = await sdk.ownListings.create({
|
|
63
|
+
* title: 'New Listing',
|
|
64
|
+
* description: 'Description',
|
|
65
|
+
* price: {
|
|
66
|
+
* amount: 1000,
|
|
67
|
+
* currency: 'USD'
|
|
68
|
+
* }
|
|
69
|
+
* });
|
|
70
|
+
* const newListing = response.data;
|
|
71
|
+
*/
|
|
72
|
+
create<P extends OwnListingsCreateParameter, EP extends ExtraParameter>(params: P, extraParams?: EP): Promise<AxiosResponse<OwnListingsResponse<"create", P, EP>>>;
|
|
73
|
+
/**
|
|
74
|
+
* Creates a draft listing.
|
|
75
|
+
*
|
|
76
|
+
* @template P
|
|
77
|
+
* @template EP
|
|
78
|
+
* @param {P & OwnListingsCreateDraftParameter} params - Parameters for the draft listing.
|
|
79
|
+
* @param {EP | void} extraParams - Optional extra parameters for the request.
|
|
80
|
+
* @returns {Promise<AxiosResponse<OwnListingsResponse<'createDraft', P, EP>>>} - A promise resolving to the created draft details.
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* const response = await sdk.ownListings.createDraft({
|
|
84
|
+
* title: 'Draft Listing',
|
|
85
|
+
* description: 'This is a draft',
|
|
86
|
+
* });
|
|
87
|
+
* const draft = response.data;
|
|
88
|
+
*/
|
|
89
|
+
createDraft<P extends OwnListingsCreateDraftParameter, EP extends ExtraParameter>(params: P, extraParams?: EP): Promise<AxiosResponse<OwnListingsResponse<"createDraft", P, EP>>>;
|
|
90
|
+
/**
|
|
91
|
+
* Updates an existing listing.
|
|
92
|
+
*
|
|
93
|
+
* @template P
|
|
94
|
+
* @template EP
|
|
95
|
+
* @param {P & OwnListingsUpdateParameter} params - Parameters for updating the listing.
|
|
96
|
+
* @param {EP | void} extraParams - Optional extra parameters for the request.
|
|
97
|
+
* @returns {Promise<AxiosResponse<OwnListingsResponse<'update', P, EP>>>} - A promise resolving to the updated listing details.
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* const response = await sdk.ownListings.update({
|
|
101
|
+
* id: 'listing-id',
|
|
102
|
+
* title: 'Updated Listing Title',
|
|
103
|
+
* });
|
|
104
|
+
* const updatedListing = response.data;
|
|
105
|
+
*/
|
|
106
|
+
update<P extends OwnListingsUpdateParameter, EP extends ExtraParameter>(params: P, extraParams?: EP): Promise<AxiosResponse<OwnListingsResponse<"update", P, EP>>>;
|
|
107
|
+
/**
|
|
108
|
+
* Publishes a draft listing.
|
|
109
|
+
*
|
|
110
|
+
* @template P
|
|
111
|
+
* @template EP
|
|
112
|
+
* @param {P & OwnListingsPublishDraftParameter} params - Parameters for publishing the draft listing.
|
|
113
|
+
* @param {EP | void} extraParams - Optional extra parameters for the request.
|
|
114
|
+
* @returns {Promise<AxiosResponse<OwnListingsResponse<'publishDraft', P, EP>>>} - A promise resolving to the published listing details.
|
|
115
|
+
*
|
|
116
|
+
* @example
|
|
117
|
+
* const response = await sdk.ownListings.publishDraft({
|
|
118
|
+
* id: 'draft-id',
|
|
119
|
+
* });
|
|
120
|
+
* const publishedListing = response.data;
|
|
121
|
+
*/
|
|
122
|
+
publishDraft<P extends OwnListingsPublishDraftParameter, EP extends ExtraParameter>(params: P, extraParams?: EP): Promise<AxiosResponse<OwnListingsResponse<"publishDraft", P, EP>>>;
|
|
123
|
+
/**
|
|
124
|
+
* Discards a draft listing.
|
|
125
|
+
*
|
|
126
|
+
* @template P
|
|
127
|
+
* @param {P & OwnListingsDiscardDraftParameter} params - Parameters for discarding the draft.
|
|
128
|
+
* @returns {Promise<AxiosResponse<OwnListingsResponse<'discardDraft', P>>>} - A promise resolving to the discard confirmation.
|
|
129
|
+
*
|
|
130
|
+
* @example
|
|
131
|
+
* const response = await sdk.ownListings.discardDraft({ id: 'draft-id' });
|
|
132
|
+
* const result = response.data;
|
|
133
|
+
*/
|
|
134
|
+
discardDraft<P extends OwnListingsDiscardDraftParameter>(params: P): Promise<AxiosResponse<OwnListingsResponse<"discardDraft", P>>>;
|
|
135
|
+
/**
|
|
136
|
+
* Closes a listing.
|
|
137
|
+
*
|
|
138
|
+
* @template P
|
|
139
|
+
* @template EP
|
|
140
|
+
* @param {P & OwnListingsCloseParameter} params - Parameters for closing the listing.
|
|
141
|
+
* @param {EP | void} extraParams - Optional extra parameters for the request.
|
|
142
|
+
* @returns {Promise<AxiosResponse<OwnListingsResponse<'close', P>>>} - A promise resolving to the closed listing details.
|
|
143
|
+
*
|
|
144
|
+
* @example
|
|
145
|
+
* const response = await sdk.ownListings.close({ id: 'listing-id' });
|
|
146
|
+
* const closedListing = response.data;
|
|
147
|
+
*/
|
|
148
|
+
close<P extends OwnListingsCloseParameter, EP extends ExtraParameter>(params: P, extraParams?: EP): Promise<AxiosResponse<OwnListingsResponse<"close", P>>>;
|
|
149
|
+
/**
|
|
150
|
+
* Opens a listing.
|
|
151
|
+
*
|
|
152
|
+
* @template P
|
|
153
|
+
* @template EP
|
|
154
|
+
* @param {P & OwnListingsOpenParameter} params - Parameters for opening the listing.
|
|
155
|
+
* @param {EP | void} extraParams - Optional extra parameters for the request.
|
|
156
|
+
* @returns {Promise<AxiosResponse<OwnListingsResponse<'open', P>>>} - A promise resolving to the opened listing details.
|
|
157
|
+
*
|
|
158
|
+
* @example
|
|
159
|
+
* const response = await sdk.ownListings.open({ id: 'listing-id' });
|
|
160
|
+
* const openedListing = response.data;
|
|
161
|
+
*/
|
|
162
|
+
open<P extends OwnListingsOpenParameter, EP extends ExtraParameter>(params: P, extraParams?: EP): Promise<AxiosResponse<OwnListingsResponse<"open", P>>>;
|
|
163
|
+
/**
|
|
164
|
+
* Adds an image to a listing.
|
|
165
|
+
*
|
|
166
|
+
* @template P
|
|
167
|
+
* @template EP
|
|
168
|
+
* @param {P & OwnListingsAddImageParameter} params - Parameters specifying the image to add.
|
|
169
|
+
* @param {EP | void} extraParams - Optional extra parameters for the request.
|
|
170
|
+
* @returns {Promise<AxiosResponse<OwnListingsResponse<'addImage', P>>>} - A promise resolving to the updated listing details.
|
|
171
|
+
*
|
|
172
|
+
* @example
|
|
173
|
+
* const response = await sdk.ownListings.addImage({
|
|
174
|
+
* id: 'listing-id', imageId: 'image-id'
|
|
175
|
+
* });
|
|
176
|
+
* const updatedListing = response.data;
|
|
177
|
+
*/
|
|
178
|
+
addImage<P extends OwnListingsAddImageParameter, EP extends ExtraParameter>(params: P, extraParams?: EP): Promise<AxiosResponse<OwnListingsResponse<"addImage", P>>>;
|
|
179
|
+
}
|
|
180
|
+
export default OwnListings;
|
|
181
|
+
//# sourceMappingURL=OwnListings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OwnListings.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/marketplace/OwnListings.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Provides the PasswordReset class for managing password reset requests and operations in the Sharetribe Marketplace API.
|
|
3
|
+
* This class includes methods for requesting a password reset and resetting the password using a token.
|
|
4
|
+
*
|
|
5
|
+
* For more details, refer to the Marketplace API documentation:
|
|
6
|
+
* https://www.sharetribe.com/api-reference/marketplace.html#password-reset
|
|
7
|
+
*/
|
|
8
|
+
import { AxiosResponse } from "axios";
|
|
9
|
+
import MarketplaceApi from "./index";
|
|
10
|
+
import { PasswordResetRequestParams, PasswordResetResetParams, PasswordResetResponse } from "../../types/marketplace/passwordReset";
|
|
11
|
+
import { ExtraParameter } from "../../types/sharetribe";
|
|
12
|
+
/**
|
|
13
|
+
* Class representing the Password Reset API.
|
|
14
|
+
*
|
|
15
|
+
* The Password Reset API provides methods for requesting a password reset email and resetting the password.
|
|
16
|
+
*/
|
|
17
|
+
declare class PasswordReset {
|
|
18
|
+
private readonly endpoint;
|
|
19
|
+
private readonly axios;
|
|
20
|
+
private readonly headers;
|
|
21
|
+
/**
|
|
22
|
+
* Creates an instance of the PasswordReset class.
|
|
23
|
+
*
|
|
24
|
+
* @param {MarketplaceApi} api - The Marketplace API instance providing configuration and request handling.
|
|
25
|
+
*/
|
|
26
|
+
constructor(api: MarketplaceApi);
|
|
27
|
+
/**
|
|
28
|
+
* Requests a password reset email.
|
|
29
|
+
*
|
|
30
|
+
* @template P
|
|
31
|
+
* @template EP
|
|
32
|
+
* @param {P & PasswordResetRequestParams} params - Parameters for the password reset request.
|
|
33
|
+
* @param {EP | void} extraParams - Optional extra parameters for the request.
|
|
34
|
+
* @returns {Promise<AxiosResponse<PasswordResetResponse<'request', EP>>>} - A promise resolving to the password reset request response.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* const response = await sdk.passwordReset.request({
|
|
38
|
+
* email: 'user@example.com',
|
|
39
|
+
* });
|
|
40
|
+
* const result = response.data;
|
|
41
|
+
*/
|
|
42
|
+
request<P extends PasswordResetRequestParams, EP extends ExtraParameter>(params: P, extraParams?: EP): Promise<AxiosResponse<PasswordResetResponse<"request", EP>>>;
|
|
43
|
+
/**
|
|
44
|
+
* Resets the user's password using a token.
|
|
45
|
+
*
|
|
46
|
+
* @template P
|
|
47
|
+
* @template EP
|
|
48
|
+
* @param {P & PasswordResetResetParams} params - Parameters for resetting the password.
|
|
49
|
+
* @param {EP | void} extraParams - Optional extra parameters for the request.
|
|
50
|
+
* @returns {Promise<AxiosResponse<PasswordResetResponse<'reset', EP>>>} - A promise resolving to the password reset confirmation response.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* const response = await sdk.passwordReset.reset({
|
|
54
|
+
* email: 'user@example.com',
|
|
55
|
+
* passwordResetToken: 'password-reset-token',
|
|
56
|
+
* newPassword: 'new-password',
|
|
57
|
+
* });
|
|
58
|
+
* const result = response.data;
|
|
59
|
+
*/
|
|
60
|
+
reset<P extends PasswordResetResetParams, EP extends ExtraParameter>(params: P, extraParams?: EP): Promise<AxiosResponse<PasswordResetResponse<"reset", EP>>>;
|
|
61
|
+
}
|
|
62
|
+
export default PasswordReset;
|
|
63
|
+
//# sourceMappingURL=PasswordReset.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PasswordReset.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/marketplace/PasswordReset.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAiB,aAAa,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,cAAc,MAAM,SAAS,CAAC;AACrC,OAAO,EACL,0BAA0B,EAC1B,wBAAwB,EACxB,qBAAqB,EACtB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD;;;;GAIG;AACH,cAAM,aAAa;IACjB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAgB;IACtC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAyB;IAEjD;;;;OAIG;gBACS,GAAG,EAAE,cAAc;IAM/B;;;;;;;;;;;;;;OAcG;IACG,OAAO,CACX,CAAC,SAAS,0BAA0B,EACpC,EAAE,SAAS,cAAc,EAEzB,MAAM,EAAE,CAAC,EACT,WAAW,CAAC,EAAE,EAAE,GACf,OAAO,CAAC,aAAa,CAAC,qBAAqB,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC;IAQ/D;;;;;;;;;;;;;;;;OAgBG;IACG,KAAK,CAAC,CAAC,SAAS,wBAAwB,EAAE,EAAE,SAAS,cAAc,EACvE,MAAM,EAAE,CAAC,EACT,WAAW,CAAC,EAAE,EAAE,GACf,OAAO,CAAC,aAAa,CAAC,qBAAqB,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;CAO9D;AAED,eAAe,aAAa,CAAC"}
|