@vansite/ts-sharetribe-flex-sdk 1.0.34 → 3.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/SitemapData.d.ts +60 -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 +82 -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} +35 -5
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +3 -0
- package/dist/{ts-sharetribe-flex-sdk.js.LICENSE.txt → index.mjs.LICENSE.txt} +35 -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} +35 -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 +35 -0
- package/dist/sdkTypes/UUID.d.ts +45 -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/SitemapData.d.ts +61 -0
- package/dist/types/endpoints/marketplace/SitemapData.d.ts.map +1 -0
- 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 +52 -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/sitemapData.d.ts +47 -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 +9 -2
- package/dist/types/sdkTypes/Money.d.ts.map +1 -1
- package/dist/types/sdkTypes/UUID.d.ts +8 -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/sitemapData.d.ts +48 -0
- package/dist/types/types/marketplace/sitemapData.d.ts.map +1 -0
- package/dist/types/types/marketplace/stock.d.ts +23 -6
- package/dist/types/types/marketplace/stock.d.ts.map +1 -1
- package/dist/types/types/marketplace/stockAdjustment.d.ts +60 -14
- package/dist/types/types/marketplace/stockAdjustment.d.ts.map +1 -1
- package/dist/types/types/marketplace/stockReservations.d.ts +59 -14
- package/dist/types/types/marketplace/stockReservations.d.ts.map +1 -1
- package/dist/types/types/marketplace/stripeAccount.d.ts +28 -5
- package/dist/types/types/marketplace/stripeAccount.d.ts.map +1 -1
- package/dist/types/types/marketplace/stripeAccountLinks.d.ts +26 -6
- package/dist/types/types/marketplace/stripeAccountLinks.d.ts.map +1 -1
- package/dist/types/types/marketplace/stripeCustomer.d.ts +60 -13
- package/dist/types/types/marketplace/stripeCustomer.d.ts.map +1 -1
- package/dist/types/types/marketplace/stripePaymentMethod.d.ts +1 -2
- package/dist/types/types/marketplace/stripePaymentMethod.d.ts.map +1 -1
- package/dist/types/types/marketplace/stripePersons.d.ts +17 -15
- package/dist/types/types/marketplace/stripePersons.d.ts.map +1 -1
- package/dist/types/types/marketplace/stripeSetupIntents.d.ts +16 -14
- package/dist/types/types/marketplace/stripeSetupIntents.d.ts.map +1 -1
- package/dist/types/types/marketplace/timeSlots.d.ts +13 -15
- package/dist/types/types/marketplace/timeSlots.d.ts.map +1 -1
- package/dist/types/types/marketplace/transactions.d.ts +77 -83
- package/dist/types/types/marketplace/transactions.d.ts.map +1 -1
- package/dist/types/types/marketplace/user.d.ts +85 -64
- package/dist/types/types/marketplace/user.d.ts.map +1 -1
- package/dist/types/types/sharetribe.d.ts +130 -92
- package/dist/types/types/sharetribe.d.ts.map +1 -1
- package/dist/types/types/store.d.ts +3 -14
- package/dist/types/types/store.d.ts.map +1 -1
- package/dist/types/utils/apis.d.ts +1 -1
- package/dist/types/utils/apis.d.ts.map +1 -1
- package/dist/types/utils/config.d.ts.map +1 -1
- package/dist/types/utils/prepare-axios-instance.d.ts +1 -1
- package/dist/types/utils/prepare-axios-instance.d.ts.map +1 -1
- package/dist/types/utils/stores/BrowserStore.d.ts +17 -4
- package/dist/types/utils/stores/BrowserStore.d.ts.map +1 -1
- package/dist/types/utils/stores/ExpressStore.d.ts +26 -8
- package/dist/types/utils/stores/ExpressStore.d.ts.map +1 -1
- package/dist/types/utils/stores/MemoryStore.d.ts +1 -2
- package/dist/types/utils/stores/MemoryStore.d.ts.map +1 -1
- package/dist/types/utils/transit.d.ts +1 -1
- package/dist/types/utils/transit.d.ts.map +1 -1
- package/dist/types/utils/util.d.ts +2 -2
- package/dist/types/utils/util.d.ts.map +1 -1
- package/dist/utils/apis.d.ts +8 -0
- package/dist/utils/config.d.ts +32 -0
- package/dist/utils/convert-types.d.ts +13 -0
- package/dist/utils/parameter-serializer.d.ts +23 -0
- package/dist/utils/prepare-axios-instance.d.ts +14 -0
- package/dist/utils/stores/BrowserStore.d.ts +51 -0
- package/dist/utils/stores/ExpressStore.d.ts +67 -0
- package/dist/utils/stores/MemoryStore.d.ts +23 -0
- package/dist/utils/stores/store.d.ts +8 -0
- package/dist/utils/transit.d.ts +28 -0
- package/dist/utils/util.d.ts +15 -0
- package/package.json +16 -14
- package/dist/ts-sharetribe-flex-sdk.cjs +0 -3
- package/dist/ts-sharetribe-flex-sdk.cjs.map +0 -1
- package/dist/ts-sharetribe-flex-sdk.js +0 -3
- package/dist/ts-sharetribe-flex-sdk.js.map +0 -1
- package/dist/ts-sharetribe-flex-sdk.mjs +0 -3
- package/dist/ts-sharetribe-flex-sdk.mjs.map +0 -1
- package/dist/types/endpoints/integrationApi/StockReservation.d.ts.map +0 -1
|
@@ -1,55 +1,98 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @fileoverview Type definitions for
|
|
3
|
-
* These types define the structure of availability exception-related parameters, responses, and relationships.
|
|
2
|
+
* @fileoverview Type definitions for Availability Exceptions in the Sharetribe Marketplace API.
|
|
4
3
|
*/
|
|
5
4
|
import { ApiMeta, ApiParameter, ExtraParameterType, Relationship, RelationshipTypeMap, UUID } from "../sharetribe";
|
|
5
|
+
/**
|
|
6
|
+
* Available endpoints
|
|
7
|
+
*/
|
|
6
8
|
export type AvailabilityExceptionsEndpoints = "query" | "create" | "delete";
|
|
9
|
+
/**
|
|
10
|
+
* Relationship fields that can be included
|
|
11
|
+
*/
|
|
7
12
|
export type AvailabilityExceptionsRelationshipsFields = "ownListing" | "ownListing.marketplace" | "ownListing.author" | "ownListing.images" | "ownListing.currentStock";
|
|
13
|
+
/**
|
|
14
|
+
* Availability Exception resource
|
|
15
|
+
*/
|
|
8
16
|
export interface AvailabilityException {
|
|
9
17
|
id: UUID;
|
|
10
18
|
type: "availabilityException";
|
|
11
|
-
attributes
|
|
19
|
+
attributes: {
|
|
12
20
|
seats: number;
|
|
13
21
|
start: Date;
|
|
14
22
|
end: Date;
|
|
15
23
|
};
|
|
16
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* With relationships
|
|
27
|
+
*/
|
|
17
28
|
export interface AvailabilityExceptionWithRelationships extends AvailabilityException {
|
|
18
29
|
relationships: {
|
|
19
30
|
ownListing: Relationship<false, "ownListing">;
|
|
20
31
|
};
|
|
21
32
|
}
|
|
22
|
-
export type
|
|
33
|
+
export type AvailabilityExceptionResource<R extends boolean> = R extends true ? AvailabilityExceptionWithRelationships : AvailabilityException;
|
|
34
|
+
/**
|
|
35
|
+
* Base request parameters
|
|
36
|
+
*/
|
|
23
37
|
export interface AvailabilityExceptionsParameter extends ApiParameter {
|
|
24
38
|
include?: AvailabilityExceptionsRelationshipsFields[];
|
|
25
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* Query endpoint
|
|
42
|
+
*/
|
|
26
43
|
export interface AvailabilityExceptionsQueryParameter extends AvailabilityExceptionsParameter {
|
|
27
44
|
listingId: UUID | string;
|
|
28
45
|
start: Date | string;
|
|
29
46
|
end: Date | string;
|
|
30
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* Create endpoint
|
|
50
|
+
*/
|
|
31
51
|
export interface AvailabilityExceptionsCreateParameter extends AvailabilityExceptionsParameter {
|
|
32
52
|
listingId: UUID | string;
|
|
33
53
|
seats: number;
|
|
34
54
|
start: Date | string;
|
|
35
55
|
end: Date | string;
|
|
36
56
|
}
|
|
37
|
-
|
|
57
|
+
/**
|
|
58
|
+
* Delete endpoint
|
|
59
|
+
*/
|
|
60
|
+
export type AvailabilityExceptionsDeleteParameter = {
|
|
38
61
|
id: UUID | string;
|
|
39
|
-
}
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* All parameter types
|
|
65
|
+
*/
|
|
40
66
|
type AllAvailabilityExceptionsParameter = AvailabilityExceptionsQueryParameter | AvailabilityExceptionsCreateParameter | AvailabilityExceptionsDeleteParameter;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
67
|
+
/**
|
|
68
|
+
* Include detection — fixes TS2536
|
|
69
|
+
*/
|
|
70
|
+
type HasInclude<P> = P extends {
|
|
71
|
+
include: infer I extends readonly AvailabilityExceptionsRelationshipsFields[];
|
|
72
|
+
} ? I : never;
|
|
73
|
+
type IncludesRelationships<P> = HasInclude<P> extends never ? false : true;
|
|
74
|
+
type IncludedResources<P> = P extends {
|
|
75
|
+
include: infer I extends readonly AvailabilityExceptionsRelationshipsFields[];
|
|
76
|
+
} ? RelationshipTypeMap[I[number]][] : never;
|
|
77
|
+
/**
|
|
78
|
+
* Expand behavior
|
|
79
|
+
*/
|
|
80
|
+
type ExpandResult<T, EP extends ExtraParameterType | undefined> = EP extends {
|
|
44
81
|
expand: true;
|
|
45
|
-
} ?
|
|
82
|
+
} ? T : EP extends {
|
|
46
83
|
expand: false;
|
|
47
|
-
} ? Omit<
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
84
|
+
} ? Omit<T, "attributes"> : Omit<T, "attributes">;
|
|
85
|
+
/**
|
|
86
|
+
* Response data per endpoint
|
|
87
|
+
*/
|
|
88
|
+
type ResponseData<E extends AvailabilityExceptionsEndpoints, P extends AllAvailabilityExceptionsParameter, EP extends ExtraParameterType | undefined> = E extends "query" ? AvailabilityExceptionResource<IncludesRelationships<P>>[] : E extends "create" ? ExpandResult<AvailabilityExceptionResource<IncludesRelationships<P>>, EP> : E extends "delete" ? Pick<AvailabilityException, "id" | "type"> : never;
|
|
89
|
+
/**
|
|
90
|
+
* Final response type
|
|
91
|
+
*/
|
|
92
|
+
export type AvailabilityExceptionsResponse<E extends AvailabilityExceptionsEndpoints, P extends AllAvailabilityExceptionsParameter, EP extends ExtraParameterType | undefined = undefined> = {
|
|
93
|
+
data: ResponseData<E, P, EP>;
|
|
94
|
+
} & (IncludesRelationships<P> extends true ? {
|
|
95
|
+
included: IncludedResources<P>;
|
|
53
96
|
} : {}) & (E extends "query" ? {
|
|
54
97
|
meta: ApiMeta;
|
|
55
98
|
} : {});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"availabilityExceptions.d.ts","sourceRoot":"","sources":["../../../../src/types/marketplace/availabilityExceptions.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"availabilityExceptions.d.ts","sourceRoot":"","sources":["../../../../src/types/marketplace/availabilityExceptions.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAC,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,YAAY,EAAE,mBAAmB,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAElH;;GAEG;AACH,MAAM,MAAM,+BAA+B,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE5E;;GAEG;AACH,MAAM,MAAM,yCAAyC,GACjD,YAAY,GACZ,wBAAwB,GACxB,mBAAmB,GACnB,mBAAmB,GACnB,yBAAyB,CAAC;AAE9B;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,EAAE,EAAE,IAAI,CAAC;IACT,IAAI,EAAE,uBAAuB,CAAC;IAC9B,UAAU,EAAE;QACV,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,IAAI,CAAC;QACZ,GAAG,EAAE,IAAI,CAAC;KACX,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,sCACf,SAAQ,qBAAqB;IAC7B,aAAa,EAAE;QACb,UAAU,EAAE,YAAY,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;KAC/C,CAAC;CACH;AAED,MAAM,MAAM,6BAA6B,CAAC,CAAC,SAAS,OAAO,IACzD,CAAC,SAAS,IAAI,GAAG,sCAAsC,GAAG,qBAAqB,CAAC;AAElF;;GAEG;AACH,MAAM,WAAW,+BAAgC,SAAQ,YAAY;IACnE,OAAO,CAAC,EAAE,yCAAyC,EAAE,CAAC;CACvD;AAED;;GAEG;AACH,MAAM,WAAW,oCACf,SAAQ,+BAA+B;IACvC,SAAS,EAAE,IAAI,GAAG,MAAM,CAAC;IACzB,KAAK,EAAE,IAAI,GAAG,MAAM,CAAC;IACrB,GAAG,EAA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EACzC,CAAC,SAAS,kCAAkC,EAC5C,EAAE,SAAS,kBAAkB,GAAG,SAAS,IAEzC,CAAC,SAAS,OAAO,GACb,6BAA6B,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,EAAE,GACzD,CAAC,SAAS,QAAQ,GAChB,YAAY,CAAC,6BAA6B,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GACzE,CAAC,SAAS,QAAQ,GAChB,IAAI,CAAC,qBAAqB,EAAE,IAAI,GAAG,MAAM,CAAC,GAC1C,KAAK,CAAC;AAEhB;;GAEG;AACH,MAAM,MAAM,8BAA8B,CACxC,CAAC,SAAS,+BAA+B,EACzC,CAAC,SAAS,kCAAkC,EAC5C,EAAE,SAAS,kBAAkB,GAAG,SAAS,GAAG,SAAS,IACnD;IACF,IAAI,EAAE,YAAY,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;CAC9B,GAAG,CAAC,qBAAqB,CAAC,CAAC,CAAC,SAAS,IAAI,GAAG;IAAE,QAAQ,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAA;CAAE,GAAG,EAAE,CAAC,GACnF,CAAC,CAAC,SAAS,OAAO,GAAG;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,GAAG,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Availability plan types
|
|
3
|
+
*/
|
|
4
|
+
type AvailabilityPlanType = "availability-plan/day" | "availability-plan/time";
|
|
5
|
+
type AvailabilityPlanEntry<T extends AvailabilityPlanType = AvailabilityPlanType> = {
|
|
6
|
+
dayOfWeek: "mon" | "tue" | "wed" | "thu" | "fri" | "sat" | "sun";
|
|
7
|
+
seats: number;
|
|
8
|
+
} & (T extends "availability-plan/time" ? {
|
|
9
|
+
startTime: string;
|
|
10
|
+
endTime: string;
|
|
11
|
+
} : {});
|
|
12
|
+
export type AvailabilityPlan<T extends AvailabilityPlanType = "availability-plan/day"> = {
|
|
13
|
+
type: T;
|
|
14
|
+
timezone: string;
|
|
15
|
+
entries: Array<AvailabilityPlanEntry<T>>;
|
|
16
|
+
};
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=availabilityPlan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"availabilityPlan.d.ts","sourceRoot":"","sources":["../../../../src/types/marketplace/availabilityPlan.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,KAAK,oBAAoB,GAAG,uBAAuB,GAAG,wBAAwB,CAAC;AAE/E,KAAK,qBAAqB,CAAC,CAAC,SAAS,oBAAoB,GAAG,oBAAoB,IAAI;IAClF,SAAS,EAAE,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;IACjE,KAAK,EAAE,MAAM,CAAC;CACf,GAAG,CAAC,CAAC,SAAS,wBAAwB,GAAG;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,EAAE,CAAC,CAAC;AAEvF,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,oBAAoB,GAAG,uBAAuB,IAAI;IACvF,IAAI,EAAE,CAAC,CAAC;IACR,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,KAAK,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,CAAC;CAC1C,CAAC"}
|
|
@@ -1,11 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @fileoverview Type definitions for
|
|
3
|
-
|
|
2
|
+
* @fileoverview Type definitions for Bookings in the Sharetribe Marketplace API.
|
|
3
|
+
*/
|
|
4
|
+
import { ApiMeta, ApiParameter, Relationship, RelationshipTypeMap, UUID } from "../sharetribe";
|
|
5
|
+
/**
|
|
6
|
+
* Available endpoints
|
|
4
7
|
*/
|
|
5
|
-
import { ApiMeta, ApiParameter, UUID, Relationship, RelationshipTypeMap } from "../sharetribe";
|
|
6
8
|
export type BookingsEndpoints = "query";
|
|
9
|
+
/**
|
|
10
|
+
* Relationship fields that can be included
|
|
11
|
+
*/
|
|
7
12
|
export type BookingsRelationshipsFields = "transaction" | "transaction.marketplace" | "transaction.listing" | "transaction.provider" | "transaction.customer" | "transaction.booking" | "transaction.stockReservation" | "transaction.reviews" | "transaction.messages";
|
|
13
|
+
/**
|
|
14
|
+
* Booking states
|
|
15
|
+
*/
|
|
8
16
|
export type BookingState = "pending" | "proposed" | "accepted" | "declined" | "cancelled";
|
|
17
|
+
/**
|
|
18
|
+
* Booking resource
|
|
19
|
+
*/
|
|
9
20
|
export interface Booking {
|
|
10
21
|
id: UUID;
|
|
11
22
|
type: "booking";
|
|
@@ -18,30 +29,53 @@ export interface Booking {
|
|
|
18
29
|
state: BookingState;
|
|
19
30
|
};
|
|
20
31
|
}
|
|
21
|
-
|
|
32
|
+
/**
|
|
33
|
+
* With relationships
|
|
34
|
+
*/
|
|
35
|
+
export interface BookingWithRelationships extends Booking {
|
|
22
36
|
relationships: {
|
|
23
37
|
transaction: Relationship<false, "transaction">;
|
|
24
38
|
};
|
|
25
39
|
}
|
|
26
|
-
export type
|
|
40
|
+
export type BookingResource<R extends boolean> = R extends true ? BookingWithRelationships : Booking;
|
|
41
|
+
/**
|
|
42
|
+
* Base request parameters
|
|
43
|
+
*/
|
|
27
44
|
export interface BookingsParameter extends ApiParameter {
|
|
28
45
|
include?: BookingsRelationshipsFields[];
|
|
29
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* Query parameters
|
|
49
|
+
*/
|
|
30
50
|
export interface BookingsQueryParameter extends BookingsParameter {
|
|
31
51
|
listingId: UUID | string;
|
|
32
52
|
start: Date | string;
|
|
33
53
|
end: Date | string;
|
|
34
54
|
state?: BookingState;
|
|
35
55
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
56
|
+
/**
|
|
57
|
+
* Include detection — fixes TS2536
|
|
58
|
+
*/
|
|
59
|
+
type HasInclude<P> = P extends {
|
|
60
|
+
include: infer I extends readonly BookingsRelationshipsFields[];
|
|
61
|
+
} ? I : never;
|
|
62
|
+
type IncludesRelationships<P> = HasInclude<P> extends never ? false : true;
|
|
63
|
+
type IncludedResources<P> = P extends {
|
|
64
|
+
include: infer Fields extends readonly BookingsRelationshipsFields[];
|
|
65
|
+
} ? RelationshipTypeMap[Fields[number]][] : never;
|
|
66
|
+
/**
|
|
67
|
+
* Response data
|
|
68
|
+
*/
|
|
69
|
+
type ResponseData<E extends BookingsEndpoints, P extends BookingsQueryParameter> = E extends "query" ? BookingResource<IncludesRelationships<P>>[] : never;
|
|
70
|
+
/**
|
|
71
|
+
* Final response type
|
|
72
|
+
*/
|
|
73
|
+
export type BookingsResponse<E extends BookingsEndpoints = "query", P extends BookingsQueryParameter = BookingsQueryParameter> = {
|
|
74
|
+
data: ResponseData<E, P>;
|
|
75
|
+
} & (IncludesRelationships<P> extends true ? {
|
|
76
|
+
included: IncludedResources<P>;
|
|
77
|
+
} : {}) & {
|
|
44
78
|
meta: ApiMeta;
|
|
45
|
-
}
|
|
79
|
+
};
|
|
46
80
|
export {};
|
|
47
81
|
//# sourceMappingURL=bookings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bookings.d.ts","sourceRoot":"","sources":["../../../../src/types/marketplace/bookings.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"bookings.d.ts","sourceRoot":"","sources":["../../../../src/types/marketplace/bookings.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAC,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,mBAAmB,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAE9F;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,OAAO,CAAC;AAExC;;GAEG;AACH,MAAM,MAAM,2BAA2B,GAC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A;CAAE,GAAG,CAAC,GAAG,KAAK,CAAC;AAC/G,KAAK,qBAAqB,CAAC,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,SAAS,KAAK,GAAG,KAAK,GAAG,IAAI,CAAC;AAE3E,KAAK,iBAAiB,CAAC,CAAC,IACtB,CAAC,SAAS;IAAE,OAAO,EAAE,MAAM,MAAM,SAAS,SAAS,2BAA2B,EAAE,CAAA;CAAE,GAC9E,mBAAmB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,GACrC,KAAK,CAAC;AAEZ;;GAEG;AACH,KAAK,YAAY,CACf,CAAC,SAAS,iBAAiB,EAC3B,CAAC,SAAS,sBAAsB,IAC9B,CAAC,SAAS,OAAO,GACjB,eAAe,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,EAAE,GAC3C,KAAK,CAAC;AAEV;;GAEG;AACH,MAAM,MAAM,gBAAgB,CAC1B,CAAC,SAAS,iBAAiB,GAAG,OAAO,EACrC,CAAC,SAAS,sBAAsB,GAAG,sBAAsB,IACvD;IACF,IAAI,EAAE,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;CAC1B,GAAG,CAAC,qBAAqB,CAAC,CAAC,CAAC,SAAS,IAAI,GAAG;IAAE,QAAQ,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAA;CAAE,GAAG,EAAE,CAAC,GACnF;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC"}
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @fileoverview Type definitions for
|
|
3
|
-
|
|
2
|
+
* @fileoverview Type definitions for Current User in the Sharetribe Marketplace API.
|
|
3
|
+
*/
|
|
4
|
+
import { ApiParameter, ExtraParameterType, Relationship, RelationshipTypeMap, UUID } from "../sharetribe";
|
|
5
|
+
import { Permissions } from "./user";
|
|
6
|
+
/**
|
|
7
|
+
* Available endpoints
|
|
4
8
|
*/
|
|
5
|
-
import { ApiParameter, ExtraParameter, ExtraParameterType, Relationship, RelationshipTypeMap, UUID } from "../sharetribe";
|
|
6
9
|
export type CurrentUserEndpoints = "show" | "delete" | "create" | "create_with_idp" | "update_profile" | "change_password" | "change_email" | "verify_email" | "send_verification_email";
|
|
10
|
+
/**
|
|
11
|
+
* Relationship fields
|
|
12
|
+
*/
|
|
7
13
|
export type CurrentUserRelationshipsFields = "marketplace" | "profileImage" | "stripeAccount" | "stripeCustomer" | "stripeCustomer.defaultPaymentMethod" | "effectivePermissionSet";
|
|
14
|
+
/**
|
|
15
|
+
* Current User resource
|
|
16
|
+
*/
|
|
8
17
|
export interface CurrentUser {
|
|
9
18
|
id: UUID;
|
|
10
19
|
type: "currentUser";
|
|
@@ -14,7 +23,7 @@ export interface CurrentUser {
|
|
|
14
23
|
createdAt: string;
|
|
15
24
|
email: string;
|
|
16
25
|
emailVerified: boolean;
|
|
17
|
-
pendingEmail:
|
|
26
|
+
pendingEmail: string | null;
|
|
18
27
|
stripeConnected: boolean;
|
|
19
28
|
stripePayoutsEnabled: boolean;
|
|
20
29
|
stripeChargesEnabled: boolean;
|
|
@@ -27,15 +36,18 @@ export interface CurrentUser {
|
|
|
27
36
|
lastName: string;
|
|
28
37
|
displayName: string;
|
|
29
38
|
abbreviatedName: string;
|
|
30
|
-
bio: string;
|
|
31
|
-
publicData:
|
|
32
|
-
protectedData:
|
|
33
|
-
privateData:
|
|
34
|
-
metadata:
|
|
39
|
+
bio: string | null;
|
|
40
|
+
publicData: CurrentUserPublicData & CurrentUserCustomPublicData;
|
|
41
|
+
protectedData: CurrentUserProtectedData & CurrentUserCustomProtectedData;
|
|
42
|
+
privateData: CurrentUserPrivateData & CurrentUserCustomPrivateData;
|
|
43
|
+
metadata: CurrentUserMetadata & CurrentUserCustomMetadata;
|
|
35
44
|
};
|
|
36
45
|
};
|
|
37
46
|
}
|
|
38
|
-
|
|
47
|
+
/**
|
|
48
|
+
* Deleted user representation
|
|
49
|
+
*/
|
|
50
|
+
export type DeletedCurrentUser = {
|
|
39
51
|
id: UUID;
|
|
40
52
|
type: "currentUser";
|
|
41
53
|
attributes: {
|
|
@@ -61,29 +73,40 @@ export interface DeleteCurrentUser {
|
|
|
61
73
|
metadata: null;
|
|
62
74
|
};
|
|
63
75
|
};
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* Current User permission set
|
|
79
|
+
*/
|
|
80
|
+
export type CurrentUserPermissionSet = {
|
|
81
|
+
postListings: Permissions;
|
|
82
|
+
initiateTransactions: Permissions;
|
|
83
|
+
read: Permissions;
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* With relationships
|
|
87
|
+
*/
|
|
70
88
|
export interface CurrentUserWithRelationships extends CurrentUser {
|
|
71
89
|
relationships: {
|
|
72
90
|
marketplace: Relationship<false, "marketplace">;
|
|
73
|
-
profileImage
|
|
74
|
-
stripeAccount
|
|
75
|
-
stripeCustomer
|
|
76
|
-
effectivePermissionSet: Relationship<false, "
|
|
91
|
+
profileImage?: Relationship<false, "profileImage">;
|
|
92
|
+
stripeAccount?: Relationship<false, "stripeAccount">;
|
|
93
|
+
stripeCustomer?: Relationship<false, "stripeCustomer">;
|
|
94
|
+
effectivePermissionSet: Relationship<false, "effectivePermissionSet">;
|
|
77
95
|
};
|
|
78
96
|
}
|
|
79
|
-
export type
|
|
97
|
+
export type CurrentUserResource<R extends boolean> = R extends true ? CurrentUserWithRelationships : CurrentUser;
|
|
98
|
+
/**
|
|
99
|
+
* Base request parameters
|
|
100
|
+
*/
|
|
80
101
|
export interface CurrentUserParameter extends ApiParameter {
|
|
81
102
|
include?: CurrentUserRelationshipsFields[];
|
|
82
103
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
104
|
+
/**
|
|
105
|
+
* Endpoint parameters
|
|
106
|
+
*/
|
|
107
|
+
export type CurrentUserShowParameter = CurrentUserParameter;
|
|
108
|
+
export type CurrentUserDeleteParameter = void;
|
|
109
|
+
export type CurrentUserSendVerificationEmailParameter = void;
|
|
87
110
|
export interface CurrentUserCreateParameter extends CurrentUserParameter {
|
|
88
111
|
email: string;
|
|
89
112
|
password: string;
|
|
@@ -91,9 +114,9 @@ export interface CurrentUserCreateParameter extends CurrentUserParameter {
|
|
|
91
114
|
lastName: string;
|
|
92
115
|
displayName?: string;
|
|
93
116
|
bio?: string;
|
|
94
|
-
publicData?:
|
|
95
|
-
protectedData?:
|
|
96
|
-
privateData?:
|
|
117
|
+
publicData?: CurrentUserPublicData & CurrentUserCustomPublicData;
|
|
118
|
+
protectedData?: CurrentUserProtectedData & CurrentUserCustomProtectedData;
|
|
119
|
+
privateData?: CurrentUserPrivateData & CurrentUserCustomPrivateData;
|
|
97
120
|
}
|
|
98
121
|
export interface CurrentUserCreateWithIdpParameter extends CurrentUserCreateParameter {
|
|
99
122
|
idpId: string;
|
|
@@ -104,56 +127,77 @@ export interface CurrentUserUpdateProfileParameter extends CurrentUserParameter
|
|
|
104
127
|
firstName?: string;
|
|
105
128
|
lastName?: string;
|
|
106
129
|
displayName?: string;
|
|
107
|
-
bio?: string;
|
|
108
|
-
publicData?:
|
|
109
|
-
protectedData?:
|
|
110
|
-
privateData?:
|
|
111
|
-
profileImageId?: string;
|
|
130
|
+
bio?: string | null;
|
|
131
|
+
publicData?: CurrentUserPublicData & CurrentUserCustomPublicData;
|
|
132
|
+
protectedData?: CurrentUserProtectedData & CurrentUserCustomProtectedData;
|
|
133
|
+
privateData?: CurrentUserPrivateData & CurrentUserCustomPrivateData;
|
|
134
|
+
profileImageId?: UUID | string;
|
|
112
135
|
}
|
|
113
|
-
export interface CurrentUserChangePasswordParameter
|
|
136
|
+
export interface CurrentUserChangePasswordParameter {
|
|
114
137
|
currentPassword: string;
|
|
115
138
|
newPassword: string;
|
|
116
139
|
}
|
|
117
|
-
export interface CurrentUserChangeEmailParameter
|
|
140
|
+
export interface CurrentUserChangeEmailParameter {
|
|
118
141
|
currentPassword: string;
|
|
119
142
|
email: string;
|
|
120
143
|
}
|
|
121
|
-
export interface CurrentUserVerifyEmailParameter
|
|
144
|
+
export interface CurrentUserVerifyEmailParameter {
|
|
122
145
|
verificationToken: string;
|
|
123
146
|
}
|
|
124
|
-
|
|
147
|
+
/**
|
|
148
|
+
* Custom profile data
|
|
149
|
+
*/
|
|
150
|
+
export interface CurrentUserPublicData {
|
|
125
151
|
[key: string]: any;
|
|
126
152
|
}
|
|
127
|
-
export interface
|
|
153
|
+
export interface CurrentUserCustomPublicData extends Record<string, unknown> {
|
|
128
154
|
}
|
|
129
|
-
export interface
|
|
155
|
+
export interface CurrentUserProtectedData {
|
|
130
156
|
[key: string]: any;
|
|
131
157
|
}
|
|
132
|
-
export interface
|
|
158
|
+
export interface CurrentUserCustomProtectedData extends Record<string, unknown> {
|
|
133
159
|
}
|
|
134
|
-
export interface
|
|
160
|
+
export interface CurrentUserPrivateData {
|
|
135
161
|
[key: string]: any;
|
|
136
162
|
}
|
|
137
|
-
export interface
|
|
163
|
+
export interface CurrentUserCustomPrivateData extends Record<string, unknown> {
|
|
138
164
|
}
|
|
139
|
-
export interface
|
|
165
|
+
export interface CurrentUserMetadata {
|
|
140
166
|
[key: string]: any;
|
|
141
167
|
}
|
|
142
|
-
export interface
|
|
168
|
+
export interface CurrentUserCustomMetadata extends Record<string, unknown> {
|
|
143
169
|
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
type
|
|
170
|
+
/**
|
|
171
|
+
* All parameter types
|
|
172
|
+
*/
|
|
173
|
+
type AllCurrentUserParameter = CurrentUserShowParameter | CurrentUserDeleteParameter | CurrentUserCreateParameter | CurrentUserCreateWithIdpParameter | CurrentUserUpdateProfileParameter | CurrentUserChangePasswordParameter | CurrentUserChangeEmailParameter | CurrentUserVerifyEmailParameter | CurrentUserSendVerificationEmailParameter;
|
|
174
|
+
/**
|
|
175
|
+
* Include detection — fixes TS2536
|
|
176
|
+
*/
|
|
177
|
+
type HasInclude<P> = P extends {
|
|
178
|
+
include: infer I extends readonly CurrentUserRelationshipsFields[];
|
|
179
|
+
} ? I : never;
|
|
180
|
+
type IncludesRelationships<P> = HasInclude<P> extends never ? false : true;
|
|
181
|
+
type IncludedResources<P> = HasInclude<P> extends infer Fields extends CurrentUserRelationshipsFields[] ? RelationshipTypeMap[Fields[number]][] : never;
|
|
182
|
+
/**
|
|
183
|
+
* Expand behavior
|
|
184
|
+
*/
|
|
185
|
+
type ExpandResult<T, EP extends ExtraParameterType | undefined> = EP extends {
|
|
148
186
|
expand: true;
|
|
149
|
-
} ?
|
|
187
|
+
} ? T : EP extends {
|
|
150
188
|
expand: false;
|
|
151
|
-
} ? Omit<
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
189
|
+
} ? Omit<T, "attributes"> : Omit<T, "attributes">;
|
|
190
|
+
/**
|
|
191
|
+
* Response data per endpoint
|
|
192
|
+
*/
|
|
193
|
+
type ResponseData<E extends CurrentUserEndpoints, P extends AllCurrentUserParameter, EP extends ExtraParameterType | undefined> = E extends "show" ? CurrentUserResource<IncludesRelationships<P>> : E extends "delete" ? Pick<DeletedCurrentUser, "id" | "type"> : E extends "create" | "create_with_idp" | "update_profile" | "change_password" | "change_email" | "verify_email" | "send_verification_email" ? ExpandResult<CurrentUserResource<IncludesRelationships<P>>, EP> : never;
|
|
194
|
+
/**
|
|
195
|
+
* Final response type
|
|
196
|
+
*/
|
|
197
|
+
export type CurrentUserResponse<E extends CurrentUserEndpoints, P extends AllCurrentUserParameter, EP extends ExtraParameterType | undefined = undefined> = {
|
|
198
|
+
data: ResponseData<E, P, EP>;
|
|
199
|
+
} & (IncludesRelationships<P> extends true ? {
|
|
200
|
+
included: IncludedResources<P>;
|
|
157
201
|
} : {});
|
|
158
202
|
export {};
|
|
159
203
|
//# sourceMappingURL=currentUser.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"currentUser.d.ts","sourceRoot":"","sources":["../../../../src/types/marketplace/currentUser.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"currentUser.d.ts","sourceRoot":"","sources":["../../../../src/types/marketplace/currentUser.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAC,YAAY,EAAE,kBAAkB,EAAE,YAAY,EAAE,mBAAmB,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACzG,OAAO,EAAC,WAAW,EAAC,MAAM,QAAQ,CAAC;AAEnC;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAC5B,MAAM,GACN,QAAQ,GACR,QAAQ,GACR,iBAAiB,GACjB,gBAAgB,GAChB,iBAAiB,GACjB,cAAc,GACd,cAAc,GACd,yBAAyB,CAAC;AAE9B;;GAEG;AACH,MAAM,MAAM,8BAA8B,GACtC,aAAa,GACb,cAAc,GACd,eAAe,GACf,gBAAgB,GAChB,qCAAqC,GACrC,wBAAwB,CAAC;AAE7B;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,IAAI,CAAC;IACT,IAAI,EAAE,aAAa,CAAC;IACpB,UAAU,EAAE;QACV,MAAM,EAAE,OAAO,CAAC;QAChB,OAAO,EAAE,OAAO,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;QAClB,KAAK,EAAE,MAAM,CAAC;QACd,aAAa,EAAE,OAAO,CAAC;QACvB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;QAC5B,eAAe,EAAE,OAAO,CAAC;QACzB,oBAAoB,EAAE,OAAO,CAAC;QAC9B,oBAAoB,EAAE,OAAO,CAAC;QAC9B,iBAAiB,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAA;SAAE,EAAE,CAAC;QACvD,OAAO,EAAE;YACP,SAAS,EAAE,MAAM,CAAC;YAClB,QAAQ,EAAE,MAAM,CAAC;YACjB,WAAW,EAAE,MAAM,CAAC;YACpB,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ChB,IAAI,CAAC,kBAAkB,EAAE,IAAI,GAAG,MAAM,CAAC,GACvC,CAAC,SAAS,QAAQ,GAAG,iBAAiB,GAAG,gBAAgB,GAAG,iBAAiB,GAAG,cAAc,GAAG,cAAc,GAAG,yBAAyB,GACzI,YAAY,CAAC,mBAAmB,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAC/D,KAAK,CAAC;AAEhB;;GAEG;AACH,MAAM,MAAM,mBAAmB,CAC7B,CAAC,SAAS,oBAAoB,EAC9B,CAAC,SAAS,uBAAuB,EACjC,EAAE,SAAS,kBAAkB,GAAG,SAAS,GAAG,SAAS,IACnD;IACF,IAAI,EAAE,YAAY,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;CAC9B,GAAG,CAAC,qBAAqB,CAAC,CAAC,CAAC,SAAS,IAAI,GAAG;IAAE,QAAQ,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAA;CAAE,GAAG,EAAE,CAAC,CAAC"}
|
|
@@ -1,40 +1,66 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @fileoverview Type definitions for
|
|
3
|
-
|
|
2
|
+
* @fileoverview Type definitions for Images in the Sharetribe Marketplace API.
|
|
3
|
+
*/
|
|
4
|
+
import { ApiParameter, ExtraParameterType, UUID } from "../sharetribe";
|
|
5
|
+
/**
|
|
6
|
+
* Available endpoints
|
|
4
7
|
*/
|
|
5
|
-
import { ApiParameter, ExtraParameter, ExtraParameterType, UUID } from "../sharetribe";
|
|
6
8
|
export type ImagesEndpoints = "upload";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Standard image variant names
|
|
11
|
+
*/
|
|
12
|
+
export type ImageVariantName = "default" | "landscape-crop" | "landscape-crop2x" | "landscape-crop4x" | "landscape-crop6x" | "scaled-small" | "scaled-medium" | "scaled-large" | "scaled-xlarge" | "square-small" | "square-small2x" | "facebook" | "twitter";
|
|
13
|
+
/**
|
|
14
|
+
* Image variant object
|
|
15
|
+
*/
|
|
16
|
+
export interface ImageVariant {
|
|
10
17
|
width: number;
|
|
18
|
+
height: number;
|
|
11
19
|
url: string;
|
|
12
|
-
name:
|
|
13
|
-
}
|
|
20
|
+
name: ImageVariantName;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Image resource
|
|
24
|
+
*/
|
|
14
25
|
export interface Image {
|
|
15
26
|
id: UUID;
|
|
16
27
|
type: "image";
|
|
17
28
|
attributes: {
|
|
18
29
|
variants: {
|
|
19
|
-
[
|
|
30
|
+
[K in ImageVariantName]?: ImageVariant;
|
|
20
31
|
} & {
|
|
21
|
-
[key: string]:
|
|
32
|
+
[key: string]: ImageVariant | undefined;
|
|
22
33
|
};
|
|
23
34
|
};
|
|
24
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* Base request parameters
|
|
38
|
+
*/
|
|
25
39
|
export interface ImagesParameter extends ApiParameter {
|
|
26
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Upload endpoint parameters
|
|
43
|
+
*/
|
|
27
44
|
export interface ImagesUploadParameter extends ImagesParameter {
|
|
28
45
|
image: File;
|
|
29
46
|
}
|
|
30
|
-
|
|
47
|
+
/**
|
|
48
|
+
* Expand behavior
|
|
49
|
+
*/
|
|
50
|
+
type ExpandResult<EP extends ExtraParameterType | undefined> = EP extends {
|
|
31
51
|
expand: true;
|
|
32
52
|
} ? Image : EP extends {
|
|
33
53
|
expand: false;
|
|
34
54
|
} ? Omit<Image, "attributes"> : Omit<Image, "attributes">;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
55
|
+
/**
|
|
56
|
+
* Response data per endpoint
|
|
57
|
+
*/
|
|
58
|
+
type ResponseData<E extends ImagesEndpoints, EP extends ExtraParameterType | undefined> = E extends "upload" ? ExpandResult<EP> : never;
|
|
59
|
+
/**
|
|
60
|
+
* Final response type
|
|
61
|
+
*/
|
|
62
|
+
export type ImagesResponse<E extends ImagesEndpoints = "upload", EP extends ExtraParameterType | undefined = undefined> = {
|
|
63
|
+
data: ResponseData<E, EP>;
|
|
38
64
|
};
|
|
39
65
|
export {};
|
|
40
66
|
//# sourceMappingURL=images.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"images.d.ts","sourceRoot":"","sources":["../../../../src/types/marketplace/images.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"images.d.ts","sourceRoot":"","sources":["../../../../src/types/marketplace/images.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAC,YAAY,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAEtE;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC;AAEvC;;GAEG;AACH,MAAM,MAAM,gBAAgB,GACxB,SAAS,GACT,gBAAgB,GAChB,kBAAkB,GAClB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,GACf,cAAc,GACd,eAAe,GACf,cAAc,GACd,gBAAgB,GAChB,UAAU,GACV,SAAS,CAAC;AAEd;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,gBAAgB,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,KAAK;IACpB,EAAE,EAAE,IAAI,CAAC;IACT,IAAI,EAAE,OAAO,CAAC;IACd,UAAU,EAAE;QACV,QAAQ,EAAE;aACP,CAAC,IAAI,gBAAgB,CAAC,CAAC,EAAE,YAAY;SACvC,GAAG;YACF,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAAC;SACzC,CAAC;KACH,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,eAAgB,SAAQ,YAAY;CACpD;AAED;;GAEG;AACH,MAAM,WAAW,qBAAsB,SAAQ,eAAe;IAC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