@vansite/ts-sharetribe-flex-sdk 1.0.33 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/endpoints/assets/index.d.ts +47 -0
- package/dist/endpoints/auth/index.d.ts +45 -0
- package/dist/endpoints/integrationApi/AvailabilityExceptions.d.ts +66 -0
- package/dist/endpoints/integrationApi/Events.d.ts +43 -0
- package/dist/endpoints/integrationApi/Images.d.ts +36 -0
- package/dist/endpoints/integrationApi/Listings.d.ts +87 -0
- package/dist/endpoints/integrationApi/Marketplace.d.ts +30 -0
- package/dist/endpoints/integrationApi/Stock.d.ts +42 -0
- package/dist/endpoints/integrationApi/StockAdjustments.d.ts +64 -0
- package/dist/{types/endpoints/integrationApi/StockReservation.d.ts → endpoints/integrationApi/StockReservations.d.ts} +3 -4
- package/dist/endpoints/integrationApi/Transactions.d.ts +76 -0
- package/dist/endpoints/integrationApi/Users.d.ts +72 -0
- package/dist/endpoints/integrationApi/index.d.ts +58 -0
- package/dist/endpoints/marketplace/AvailabilityExceptions.d.ts +69 -0
- package/dist/endpoints/marketplace/Bookings.d.ts +45 -0
- package/dist/endpoints/marketplace/CurrentUser.d.ts +110 -0
- package/dist/endpoints/marketplace/Images.d.ts +38 -0
- package/dist/endpoints/marketplace/Listings.d.ts +52 -0
- package/dist/endpoints/marketplace/Marketplace.d.ts +33 -0
- package/dist/endpoints/marketplace/Messages.d.ts +51 -0
- package/dist/endpoints/marketplace/OwnListings.d.ts +116 -0
- package/dist/endpoints/marketplace/PasswordReset.d.ts +50 -0
- package/dist/endpoints/marketplace/ProcessTransitions.d.ts +42 -0
- package/dist/endpoints/marketplace/Reviews.d.ts +49 -0
- package/dist/endpoints/marketplace/Stock.d.ts +50 -0
- package/dist/endpoints/marketplace/StockAdjustments.d.ts +64 -0
- package/dist/endpoints/marketplace/StripeAccount.d.ts +56 -0
- package/dist/endpoints/marketplace/StripeAccountLinks.d.ts +42 -0
- package/dist/endpoints/marketplace/StripeCustomer.d.ts +62 -0
- package/dist/endpoints/marketplace/StripePersons.d.ts +37 -0
- package/dist/endpoints/marketplace/StripeSetupIntents.d.ts +42 -0
- package/dist/endpoints/marketplace/TimeSlots.d.ts +40 -0
- package/dist/endpoints/marketplace/Transactions.d.ts +89 -0
- package/dist/endpoints/marketplace/Users.d.ts +34 -0
- package/dist/endpoints/marketplace/index.d.ts +80 -0
- package/dist/index.d.ts +161 -0
- package/dist/index.js +3 -0
- package/dist/{ts-sharetribe-flex-sdk.cjs.LICENSE.txt → index.js.LICENSE.txt} +53 -41
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +3 -0
- package/dist/{ts-sharetribe-flex-sdk.js.LICENSE.txt → index.mjs.LICENSE.txt} +13 -5
- package/dist/index.mjs.map +1 -0
- package/dist/index.umd.js +3 -0
- package/dist/{ts-sharetribe-flex-sdk.mjs.LICENSE.txt → index.umd.js.LICENSE.txt} +13 -5
- package/dist/index.umd.js.map +1 -0
- package/dist/integrationSdk.d.ts +119 -0
- package/dist/sdk.d.ts +211 -0
- package/dist/sdkTypes/BigDecimal.d.ts +30 -0
- package/dist/sdkTypes/LatLng.d.ts +34 -0
- package/dist/sdkTypes/LatLngBounds.d.ts +51 -0
- package/dist/sdkTypes/Money.d.ts +28 -0
- package/dist/sdkTypes/UUID.d.ts +38 -0
- package/dist/types/apiConfigs.d.ts +104 -0
- package/dist/types/assets/index.d.ts +101 -0
- package/dist/types/authentication/index.d.ts +152 -0
- package/dist/types/axios.d.ts +10 -0
- package/dist/types/config.d.ts +99 -0
- package/dist/types/endpoints/assets/index.d.ts +22 -36
- package/dist/types/endpoints/assets/index.d.ts.map +1 -1
- package/dist/types/endpoints/auth/index.d.ts +20 -41
- package/dist/types/endpoints/auth/index.d.ts.map +1 -1
- package/dist/types/endpoints/integrationApi/AvailabilityExceptions.d.ts +30 -49
- package/dist/types/endpoints/integrationApi/AvailabilityExceptions.d.ts.map +1 -1
- package/dist/types/endpoints/integrationApi/Events.d.ts +23 -27
- package/dist/types/endpoints/integrationApi/Events.d.ts.map +1 -1
- package/dist/types/endpoints/integrationApi/Images.d.ts +17 -28
- package/dist/types/endpoints/integrationApi/Images.d.ts.map +1 -1
- package/dist/types/endpoints/integrationApi/Listings.d.ts +42 -104
- package/dist/types/endpoints/integrationApi/Listings.d.ts.map +1 -1
- package/dist/types/endpoints/integrationApi/Marketplace.d.ts +12 -20
- package/dist/types/endpoints/integrationApi/Marketplace.d.ts.map +1 -1
- package/dist/types/endpoints/integrationApi/Stock.d.ts +22 -28
- package/dist/types/endpoints/integrationApi/Stock.d.ts.map +1 -1
- package/dist/types/endpoints/integrationApi/StockAdjustments.d.ts +35 -35
- package/dist/types/endpoints/integrationApi/StockAdjustments.d.ts.map +1 -1
- package/dist/types/endpoints/integrationApi/StockReservations.d.ts +43 -0
- package/dist/types/endpoints/integrationApi/StockReservations.d.ts.map +1 -0
- package/dist/types/endpoints/integrationApi/Transactions.d.ts +36 -80
- package/dist/types/endpoints/integrationApi/Transactions.d.ts.map +1 -1
- package/dist/types/endpoints/integrationApi/Users.d.ts +35 -70
- package/dist/types/endpoints/integrationApi/Users.d.ts.map +1 -1
- package/dist/types/endpoints/integrationApi/index.d.ts +40 -40
- package/dist/types/endpoints/integrationApi/index.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/AvailabilityExceptions.d.ts +34 -48
- package/dist/types/endpoints/marketplace/AvailabilityExceptions.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/Bookings.d.ts +24 -23
- package/dist/types/endpoints/marketplace/Bookings.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/CurrentUser.d.ts +54 -125
- package/dist/types/endpoints/marketplace/CurrentUser.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/Images.d.ts +19 -27
- package/dist/types/endpoints/marketplace/Images.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/Listings.d.ts +26 -25
- package/dist/types/endpoints/marketplace/Listings.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/Marketplace.d.ts +15 -19
- package/dist/types/endpoints/marketplace/Marketplace.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/Messages.d.ts +24 -29
- package/dist/types/endpoints/marketplace/Messages.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/OwnListings.d.ts +55 -119
- package/dist/types/endpoints/marketplace/OwnListings.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/PasswordReset.d.ts +23 -35
- package/dist/types/endpoints/marketplace/PasswordReset.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/ProcessTransitions.d.ts +22 -22
- package/dist/types/endpoints/marketplace/ProcessTransitions.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/Reviews.d.ts +23 -25
- package/dist/types/endpoints/marketplace/Reviews.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/Stock.d.ts +30 -26
- package/dist/types/endpoints/marketplace/Stock.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/StockAdjustments.d.ts +36 -34
- package/dist/types/endpoints/marketplace/StockAdjustments.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/StripeAccount.d.ts +28 -49
- package/dist/types/endpoints/marketplace/StripeAccount.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/StripeAccountLinks.d.ts +22 -31
- package/dist/types/endpoints/marketplace/StripeAccountLinks.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/StripeCustomer.d.ts +32 -46
- package/dist/types/endpoints/marketplace/StripeCustomer.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/StripePersons.d.ts +17 -25
- package/dist/types/endpoints/marketplace/StripePersons.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/StripeSetupIntents.d.ts +24 -24
- package/dist/types/endpoints/marketplace/StripeSetupIntents.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/TimeSlots.d.ts +20 -23
- package/dist/types/endpoints/marketplace/TimeSlots.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/Transactions.d.ts +45 -81
- package/dist/types/endpoints/marketplace/Transactions.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/Users.d.ts +15 -22
- package/dist/types/endpoints/marketplace/Users.d.ts.map +1 -1
- package/dist/types/endpoints/marketplace/index.d.ts +50 -40
- package/dist/types/endpoints/marketplace/index.d.ts.map +1 -1
- package/dist/types/index.d.ts +15 -30
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/integration/events.d.ts +87 -0
- package/dist/types/integrationSdk.d.ts +4 -5
- package/dist/types/integrationSdk.d.ts.map +1 -1
- package/dist/types/marketplace/availabilityExceptions.d.ts +99 -0
- package/dist/types/marketplace/availabilityPlan.d.ts +17 -0
- package/dist/types/marketplace/bookings.d.ts +80 -0
- package/dist/types/marketplace/currentUser.d.ts +202 -0
- package/dist/types/marketplace/images.d.ts +65 -0
- package/dist/types/marketplace/listings.d.ts +169 -0
- package/dist/types/marketplace/marketplace.d.ts +30 -0
- package/dist/types/marketplace/messages.d.ts +87 -0
- package/dist/types/marketplace/ownListings.d.ts +155 -0
- package/dist/types/marketplace/passwordReset.d.ts +54 -0
- package/dist/types/marketplace/processTransitions.d.ts +56 -0
- package/dist/types/marketplace/reviews.d.ts +108 -0
- package/dist/types/marketplace/stock.d.ts +45 -0
- package/dist/types/marketplace/stockAdjustment.d.ts +97 -0
- package/dist/types/marketplace/stockReservations.d.ts +89 -0
- package/dist/types/marketplace/stripeAccount.d.ts +67 -0
- package/dist/types/marketplace/stripeAccountLinks.d.ts +55 -0
- package/dist/types/marketplace/stripeCustomer.d.ts +94 -0
- package/dist/types/marketplace/stripePaymentMethod.d.ts +21 -0
- package/dist/types/marketplace/stripePersons.d.ts +48 -0
- package/dist/types/marketplace/stripeSetupIntents.d.ts +48 -0
- package/dist/types/marketplace/timeSlots.d.ts +51 -0
- package/dist/types/marketplace/transactions.d.ts +200 -0
- package/dist/types/marketplace/user.d.ts +200 -0
- package/dist/types/sdk-types.d.ts +10 -0
- package/dist/types/sdk.d.ts +6 -7
- package/dist/types/sdk.d.ts.map +1 -1
- package/dist/types/sdkTypes/BigDecimal.d.ts +1 -1
- package/dist/types/sdkTypes/BigDecimal.d.ts.map +1 -1
- package/dist/types/sdkTypes/LatLng.d.ts +1 -1
- package/dist/types/sdkTypes/LatLng.d.ts.map +1 -1
- package/dist/types/sdkTypes/LatLngBounds.d.ts +1 -1
- package/dist/types/sdkTypes/LatLngBounds.d.ts.map +1 -1
- package/dist/types/sdkTypes/Money.d.ts +1 -1
- package/dist/types/sdkTypes/Money.d.ts.map +1 -1
- package/dist/types/sdkTypes/UUID.d.ts +1 -1
- package/dist/types/sdkTypes/UUID.d.ts.map +1 -1
- package/dist/types/sharetribe.d.ts +227 -0
- package/dist/types/store.d.ts +22 -0
- package/dist/types/types/apiConfigs.d.ts.map +1 -1
- package/dist/types/types/assets/index.d.ts +74 -36
- package/dist/types/types/assets/index.d.ts.map +1 -1
- package/dist/types/types/authentication/index.d.ts +111 -60
- package/dist/types/types/authentication/index.d.ts.map +1 -1
- package/dist/types/types/axios.d.ts.map +1 -1
- package/dist/types/types/config.d.ts +1 -39
- package/dist/types/types/config.d.ts.map +1 -1
- package/dist/types/types/integration/events.d.ts +52 -20
- package/dist/types/types/integration/events.d.ts.map +1 -1
- package/dist/types/types/marketplace/availabilityExceptions.d.ts +59 -16
- package/dist/types/types/marketplace/availabilityExceptions.d.ts.map +1 -1
- package/dist/types/types/marketplace/availabilityPlan.d.ts +18 -0
- package/dist/types/types/marketplace/availabilityPlan.d.ts.map +1 -0
- package/dist/types/types/marketplace/bookings.d.ts +48 -14
- package/dist/types/types/marketplace/bookings.d.ts.map +1 -1
- package/dist/types/types/marketplace/currentUser.d.ts +99 -55
- package/dist/types/types/marketplace/currentUser.d.ts.map +1 -1
- package/dist/types/types/marketplace/images.d.ts +40 -14
- package/dist/types/types/marketplace/images.d.ts.map +1 -1
- package/dist/types/types/marketplace/listings.d.ts +96 -66
- package/dist/types/types/marketplace/listings.d.ts.map +1 -1
- package/dist/types/types/marketplace/marketplace.d.ts +16 -6
- package/dist/types/types/marketplace/marketplace.d.ts.map +1 -1
- package/dist/types/types/marketplace/messages.d.ts +53 -15
- package/dist/types/types/marketplace/messages.d.ts.map +1 -1
- package/dist/types/types/marketplace/ownListings.d.ts +92 -65
- package/dist/types/types/marketplace/ownListings.d.ts.map +1 -1
- package/dist/types/types/marketplace/passwordReset.d.ts +32 -9
- package/dist/types/types/marketplace/passwordReset.d.ts.map +1 -1
- package/dist/types/types/marketplace/processTransitions.d.ts +33 -14
- package/dist/types/types/marketplace/processTransitions.d.ts.map +1 -1
- package/dist/types/types/marketplace/reviews.d.ts +72 -23
- package/dist/types/types/marketplace/reviews.d.ts.map +1 -1
- package/dist/types/types/marketplace/stock.d.ts +23 -6
- package/dist/types/types/marketplace/stock.d.ts.map +1 -1
- package/dist/types/types/marketplace/stockAdjustment.d.ts +60 -14
- package/dist/types/types/marketplace/stockAdjustment.d.ts.map +1 -1
- package/dist/types/types/marketplace/stockReservations.d.ts +59 -14
- package/dist/types/types/marketplace/stockReservations.d.ts.map +1 -1
- package/dist/types/types/marketplace/stripeAccount.d.ts +28 -5
- package/dist/types/types/marketplace/stripeAccount.d.ts.map +1 -1
- package/dist/types/types/marketplace/stripeAccountLinks.d.ts +26 -6
- package/dist/types/types/marketplace/stripeAccountLinks.d.ts.map +1 -1
- package/dist/types/types/marketplace/stripeCustomer.d.ts +60 -13
- package/dist/types/types/marketplace/stripeCustomer.d.ts.map +1 -1
- package/dist/types/types/marketplace/stripePaymentMethod.d.ts +1 -2
- package/dist/types/types/marketplace/stripePaymentMethod.d.ts.map +1 -1
- package/dist/types/types/marketplace/stripePersons.d.ts +17 -15
- package/dist/types/types/marketplace/stripePersons.d.ts.map +1 -1
- package/dist/types/types/marketplace/stripeSetupIntents.d.ts +16 -14
- package/dist/types/types/marketplace/stripeSetupIntents.d.ts.map +1 -1
- package/dist/types/types/marketplace/timeSlots.d.ts +13 -15
- package/dist/types/types/marketplace/timeSlots.d.ts.map +1 -1
- package/dist/types/types/marketplace/transactions.d.ts +77 -83
- package/dist/types/types/marketplace/transactions.d.ts.map +1 -1
- package/dist/types/types/marketplace/user.d.ts +85 -64
- package/dist/types/types/marketplace/user.d.ts.map +1 -1
- package/dist/types/types/sharetribe.d.ts +130 -92
- package/dist/types/types/sharetribe.d.ts.map +1 -1
- package/dist/types/types/store.d.ts +3 -14
- package/dist/types/types/store.d.ts.map +1 -1
- package/dist/types/utils/apis.d.ts +1 -1
- package/dist/types/utils/apis.d.ts.map +1 -1
- package/dist/types/utils/config.d.ts.map +1 -1
- package/dist/types/utils/convert-types.d.ts.map +1 -1
- package/dist/types/utils/parameter-serializer.d.ts.map +1 -1
- package/dist/types/utils/prepare-axios-instance.d.ts +1 -1
- package/dist/types/utils/prepare-axios-instance.d.ts.map +1 -1
- package/dist/types/utils/stores/BrowserStore.d.ts +1 -2
- package/dist/types/utils/stores/BrowserStore.d.ts.map +1 -1
- package/dist/types/utils/stores/ExpressStore.d.ts +6 -7
- package/dist/types/utils/stores/ExpressStore.d.ts.map +1 -1
- package/dist/types/utils/stores/MemoryStore.d.ts +1 -2
- package/dist/types/utils/stores/MemoryStore.d.ts.map +1 -1
- package/dist/types/utils/stores/store.d.ts.map +1 -1
- package/dist/types/utils/transit.d.ts +1 -1
- package/dist/types/utils/transit.d.ts.map +1 -1
- package/dist/types/utils/util.d.ts +2 -2
- package/dist/types/utils/util.d.ts.map +1 -1
- package/dist/utils/apis.d.ts +8 -0
- package/dist/utils/config.d.ts +32 -0
- package/dist/utils/convert-types.d.ts +13 -0
- package/dist/utils/parameter-serializer.d.ts +23 -0
- package/dist/utils/prepare-axios-instance.d.ts +14 -0
- package/dist/utils/stores/BrowserStore.d.ts +37 -0
- package/dist/utils/stores/ExpressStore.d.ts +48 -0
- package/dist/utils/stores/MemoryStore.d.ts +23 -0
- package/dist/utils/stores/store.d.ts +8 -0
- package/dist/utils/transit.d.ts +28 -0
- package/dist/utils/util.d.ts +15 -0
- package/package.json +18 -17
- package/dist/ts-sharetribe-flex-sdk.cjs +0 -3
- package/dist/ts-sharetribe-flex-sdk.cjs.map +0 -1
- package/dist/ts-sharetribe-flex-sdk.js +0 -3
- package/dist/ts-sharetribe-flex-sdk.js.map +0 -1
- package/dist/ts-sharetribe-flex-sdk.mjs +0 -3
- package/dist/ts-sharetribe-flex-sdk.mjs.map +0 -1
- package/dist/types/endpoints/integrationApi/StockReservation.d.ts.map +0 -1
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @fileoverview Type definitions for Stripe Customer operations in the Sharetribe Marketplace API.
|
|
3
|
-
* This file defines the structure of parameters and responses for the Stripe Customer API endpoints.
|
|
4
3
|
*/
|
|
5
|
-
import { ApiParameter,
|
|
4
|
+
import { ApiParameter, ExtraParameterType, Relationship, RelationshipTypeMap, UUID } from "../sharetribe";
|
|
5
|
+
/**
|
|
6
|
+
* Available endpoints
|
|
7
|
+
*/
|
|
6
8
|
export type StripeCustomerEndpoints = "create" | "addPaymentMethod" | "deletePaymentMethod";
|
|
9
|
+
/**
|
|
10
|
+
* Relationship fields that can be included
|
|
11
|
+
*/
|
|
7
12
|
export type StripeCustomerRelationshipsFields = "defaultPaymentMethod";
|
|
13
|
+
/**
|
|
14
|
+
* Stripe Customer resource
|
|
15
|
+
*/
|
|
8
16
|
export interface StripeCustomer {
|
|
9
17
|
id: UUID;
|
|
10
18
|
type: "stripeCustomer";
|
|
@@ -12,37 +20,76 @@ export interface StripeCustomer {
|
|
|
12
20
|
stripeCustomerId: string;
|
|
13
21
|
};
|
|
14
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* Stripe Customer with relationships
|
|
25
|
+
*/
|
|
15
26
|
export interface StripeCustomerWithRelationships extends StripeCustomer {
|
|
16
27
|
relationships: {
|
|
17
28
|
defaultPaymentMethod: Relationship<false, "defaultPaymentMethod">;
|
|
18
29
|
};
|
|
19
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* Select type based on include
|
|
33
|
+
*/
|
|
20
34
|
export type StripeCustomerType<R extends boolean> = R extends true ? StripeCustomerWithRelationships : StripeCustomer;
|
|
35
|
+
/**
|
|
36
|
+
* Base request parameters
|
|
37
|
+
*/
|
|
21
38
|
export interface StripeCustomerParameter extends ApiParameter {
|
|
22
39
|
include?: StripeCustomerRelationshipsFields[];
|
|
23
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Create endpoint
|
|
43
|
+
*/
|
|
24
44
|
export interface StripeCustomerCreateParameter extends StripeCustomerParameter {
|
|
25
45
|
stripePaymentMethodId?: string;
|
|
26
46
|
stripeCustomerEmail?: string;
|
|
27
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* Add payment method
|
|
50
|
+
*/
|
|
28
51
|
export interface StripeCustomerAddPaymentMethodParameter extends StripeCustomerParameter {
|
|
29
52
|
stripePaymentMethodId: string;
|
|
30
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* Delete payment method (no body required)
|
|
56
|
+
*/
|
|
31
57
|
export interface StripeCustomerDeletePaymentMethodParameter extends StripeCustomerParameter {
|
|
32
58
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
type
|
|
59
|
+
/**
|
|
60
|
+
* All parameter types
|
|
61
|
+
*/
|
|
62
|
+
type AllStripeCustomerParameter = StripeCustomerCreateParameter | StripeCustomerAddPaymentMethodParameter | StripeCustomerDeletePaymentMethodParameter;
|
|
63
|
+
/**
|
|
64
|
+
* Detect if relationships are requested
|
|
65
|
+
*/
|
|
66
|
+
type HasInclude<P> = P extends {
|
|
67
|
+
include: infer I extends StripeCustomerRelationshipsFields[];
|
|
68
|
+
} ? I : never;
|
|
69
|
+
type IncludesRelationships<P> = HasInclude<P> extends never ? false : true;
|
|
70
|
+
/**
|
|
71
|
+
* Included resources (when include is used)
|
|
72
|
+
*/
|
|
73
|
+
type IncludedResources<P> = HasInclude<P> extends infer Fields extends StripeCustomerRelationshipsFields[] ? RelationshipTypeMap[Fields[number]][] : never;
|
|
74
|
+
/**
|
|
75
|
+
* Expand behavior
|
|
76
|
+
*/
|
|
77
|
+
type ExpandResult<T, EP extends ExtraParameterType | undefined> = EP extends {
|
|
37
78
|
expand: true;
|
|
38
|
-
} ?
|
|
79
|
+
} ? T : EP extends {
|
|
39
80
|
expand: false;
|
|
40
|
-
} ? Omit<
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
81
|
+
} ? Omit<T, "attributes"> : Omit<T, "attributes">;
|
|
82
|
+
/**
|
|
83
|
+
* Response data per endpoint
|
|
84
|
+
*/
|
|
85
|
+
type ResponseData<E extends StripeCustomerEndpoints, P extends AllStripeCustomerParameter, EP extends ExtraParameterType | undefined> = E extends "create" | "addPaymentMethod" | "deletePaymentMethod" ? ExpandResult<StripeCustomerType<IncludesRelationships<P>>, EP> : never;
|
|
86
|
+
/**
|
|
87
|
+
* Final response type
|
|
88
|
+
*/
|
|
89
|
+
export type StripeCustomerResponse<E extends StripeCustomerEndpoints, P extends AllStripeCustomerParameter, EP extends ExtraParameterType | undefined = undefined> = {
|
|
90
|
+
data: ResponseData<E, P, EP>;
|
|
91
|
+
} & (IncludesRelationships<P> extends true ? {
|
|
92
|
+
included: IncludedResources<P>;
|
|
46
93
|
} : {});
|
|
47
94
|
export {};
|
|
48
95
|
//# sourceMappingURL=stripeCustomer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stripeCustomer.d.ts","sourceRoot":"","sources":["../../../../src/types/marketplace/stripeCustomer.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"stripeCustomer.d.ts","sourceRoot":"","sources":["../../../../src/types/marketplace/stripeCustomer.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @fileoverview Type definition for Stripe Payment Method objects in the Sharetribe Marketplace API.
|
|
3
|
-
* This file defines the structure of a Stripe Payment Method, including its attributes.
|
|
4
3
|
*/
|
|
5
4
|
import { UUID } from "../sharetribe";
|
|
6
5
|
/**
|
|
7
|
-
*
|
|
6
|
+
* Stripe Payment Method resource
|
|
8
7
|
*/
|
|
9
8
|
export interface StripePaymentMethod {
|
|
10
9
|
id: UUID;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stripePaymentMethod.d.ts","sourceRoot":"","sources":["../../../../src/types/marketplace/stripePaymentMethod.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"stripePaymentMethod.d.ts","sourceRoot":"","sources":["../../../../src/types/marketplace/stripePaymentMethod.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAC,IAAI,EAAC,MAAM,eAAe,CAAC;AAEnC;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,IAAI,CAAC;IACT,IAAI,EAAE,qBAAqB,CAAC;IAC5B,UAAU,EAAE;QACV,IAAI,EAAE,MAAM,CAAC;QACb,qBAAqB,EAAE,MAAM,CAAC;QAC9B,IAAI,EAAE;YACJ,KAAK,EAAE,MAAM,CAAC;YACd,WAAW,EAAE,MAAM,CAAC;YACpB,cAAc,EAAE,MAAM,CAAC;YACvB,eAAe,EAAE,MAAM,CAAC;SACzB,CAAC;KACH,CAAC;CACH"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @fileoverview Type definitions for Stripe Persons in the Sharetribe Marketplace API.
|
|
3
|
-
* This file includes the structure of Stripe Persons, their attributes, parameters, and response types.
|
|
4
3
|
*/
|
|
5
|
-
export type StripePersonsEndpoints = "create";
|
|
6
4
|
import { ApiParameter, ExtraParameterType, UUID } from "../sharetribe";
|
|
7
5
|
/**
|
|
8
|
-
*
|
|
6
|
+
* Available endpoints
|
|
7
|
+
*/
|
|
8
|
+
export type StripePersonsEndpoints = "create";
|
|
9
|
+
/**
|
|
10
|
+
* Stripe Person resource
|
|
9
11
|
*/
|
|
10
|
-
export interface
|
|
12
|
+
export interface StripePerson {
|
|
11
13
|
id: UUID;
|
|
12
14
|
type: "stripePerson";
|
|
13
15
|
attributes: {
|
|
@@ -15,33 +17,33 @@ export interface StripePersons {
|
|
|
15
17
|
};
|
|
16
18
|
}
|
|
17
19
|
/**
|
|
18
|
-
*
|
|
20
|
+
* Base request parameters
|
|
19
21
|
*/
|
|
20
22
|
export interface StripePersonsParameter extends ApiParameter {
|
|
21
23
|
}
|
|
22
24
|
/**
|
|
23
|
-
* Parameters for creating a Stripe Person
|
|
25
|
+
* Parameters for creating a Stripe Person
|
|
24
26
|
*/
|
|
25
27
|
export interface StripePersonsCreateParameter extends StripePersonsParameter {
|
|
26
28
|
personToken: string;
|
|
27
29
|
}
|
|
28
30
|
/**
|
|
29
|
-
*
|
|
31
|
+
* Expand behavior (controls inclusion of `attributes`)
|
|
30
32
|
*/
|
|
31
|
-
type
|
|
33
|
+
type ExpandResult<EP extends ExtraParameterType | undefined> = EP extends {
|
|
32
34
|
expand: true;
|
|
33
|
-
} ?
|
|
35
|
+
} ? StripePerson : EP extends {
|
|
34
36
|
expand: false;
|
|
35
|
-
} ? Omit<
|
|
37
|
+
} ? Omit<StripePerson, "attributes"> : Omit<StripePerson, "attributes">;
|
|
36
38
|
/**
|
|
37
|
-
*
|
|
39
|
+
* Response data per endpoint
|
|
38
40
|
*/
|
|
39
|
-
type
|
|
41
|
+
type ResponseData<E extends StripePersonsEndpoints, EP extends ExtraParameterType | undefined> = E extends "create" ? ExpandResult<EP> : never;
|
|
40
42
|
/**
|
|
41
|
-
*
|
|
43
|
+
* Final response type
|
|
42
44
|
*/
|
|
43
|
-
export type StripePersonsResponse<E extends StripePersonsEndpoints, EP extends ExtraParameterType = undefined> = {
|
|
44
|
-
data:
|
|
45
|
+
export type StripePersonsResponse<E extends StripePersonsEndpoints = "create", EP extends ExtraParameterType | undefined = undefined> = {
|
|
46
|
+
data: ResponseData<E, EP>;
|
|
45
47
|
};
|
|
46
48
|
export {};
|
|
47
49
|
//# sourceMappingURL=stripePersons.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stripePersons.d.ts","sourceRoot":"","sources":["../../../../src/types/marketplace/stripePersons.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"stripePersons.d.ts","sourceRoot":"","sources":["../../../../src/types/marketplace/stripePersons.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAC,YAAY,EAAE,kBAAkB,EAAE,IAAI,EAAC,MAAM,eAAe,CAAC;AAErE;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,QAAQ,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,IAAI,CAAC;IACT,IAAI,EAAE,cAAc,CAAC;IACrB,UAAU,EAAE;QACV,cAAc,EAAE,MAAM,CAAC;KACxB,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,sBAAuB,SAAQ,YAAY;CAC3D;AAED;;GAEG;AACH,MAAM,WAAW,4BAA6B,SAAQ,sBAAsB;IAC1E,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,KAAK,YAAY,CAAC,EAAE,SAAS,kBAAkB,GAAG,SAAS,IACzD,EAAE,SAAS;IAAE,MAAM,EAAE,IAAI,CAAA;CAAE,GACvB,YAAY,GACZ,EAAE,SAAS;IAAE,MAAM,EAAE,KAAK,CAAA;CAAE,GAC1B,IAAI,CAAC,YAAY,EAAE,YAAY,CAAC,GAChC,IAAI,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;AAEzC;;GAEG;AACH,KAAK,YAAY,CACf,CAAC,SAAS,sBAAsB,EAChC,EAAE,SAAS,kBAAkB,GAAG,SAAS,IACvC,CAAC,SAAS,QAAQ,GAAG,YAAY,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC;AAElD;;GAEG;AACH,MAAM,MAAM,qBAAqB,CAC/B,CAAC,SAAS,sBAAsB,GAAG,QAAQ,EAC3C,EAAE,SAAS,kBAAkB,GAAG,SAAS,GAAG,SAAS,IACnD;IACF,IAAI,EAAE,YAAY,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;CAC3B,CAAC"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @fileoverview Type definitions for Stripe Setup Intents in the Sharetribe Marketplace API.
|
|
3
|
-
* This file includes the structure of Stripe Setup Intents, their attributes, parameters, and response types.
|
|
4
3
|
*/
|
|
5
4
|
import { ApiParameter, ExtraParameterType, UUID } from "../sharetribe";
|
|
5
|
+
/**
|
|
6
|
+
* Available endpoints
|
|
7
|
+
*/
|
|
6
8
|
export type StripeSetupIntentsEndpoints = "create";
|
|
7
9
|
/**
|
|
8
|
-
*
|
|
10
|
+
* Stripe Setup Intent resource
|
|
9
11
|
*/
|
|
10
|
-
export interface
|
|
12
|
+
export interface StripeSetupIntent {
|
|
11
13
|
id: UUID;
|
|
12
14
|
type: "stripeSetupIntent";
|
|
13
15
|
attributes: {
|
|
@@ -16,32 +18,32 @@ export interface StripeSetupIntents {
|
|
|
16
18
|
};
|
|
17
19
|
}
|
|
18
20
|
/**
|
|
19
|
-
*
|
|
21
|
+
* Base request parameters
|
|
20
22
|
*/
|
|
21
23
|
export interface StripeSetupIntentsParameter extends ApiParameter {
|
|
22
24
|
}
|
|
23
25
|
/**
|
|
24
|
-
* Parameters for creating a
|
|
26
|
+
* Parameters for creating a setup intent
|
|
25
27
|
*/
|
|
26
28
|
export interface StripeSetupIntentsCreateParameter extends StripeSetupIntentsParameter {
|
|
27
29
|
}
|
|
28
30
|
/**
|
|
29
|
-
*
|
|
31
|
+
* Expand behavior (controls whether `attributes` is included)
|
|
30
32
|
*/
|
|
31
|
-
type
|
|
33
|
+
type ExpandResult<EP extends ExtraParameterType | undefined> = EP extends {
|
|
32
34
|
expand: true;
|
|
33
|
-
} ?
|
|
35
|
+
} ? StripeSetupIntent : EP extends {
|
|
34
36
|
expand: false;
|
|
35
|
-
} ? Omit<
|
|
37
|
+
} ? Omit<StripeSetupIntent, "attributes"> : Omit<StripeSetupIntent, "attributes">;
|
|
36
38
|
/**
|
|
37
|
-
*
|
|
39
|
+
* Response data per endpoint
|
|
38
40
|
*/
|
|
39
|
-
type
|
|
41
|
+
type ResponseData<E extends StripeSetupIntentsEndpoints, EP extends ExtraParameterType | undefined> = E extends "create" ? ExpandResult<EP> : never;
|
|
40
42
|
/**
|
|
41
|
-
*
|
|
43
|
+
* Final response type
|
|
42
44
|
*/
|
|
43
|
-
export type StripeSetupIntentsResponse<E extends StripeSetupIntentsEndpoints, EP extends ExtraParameterType = undefined> = {
|
|
44
|
-
data:
|
|
45
|
+
export type StripeSetupIntentsResponse<E extends StripeSetupIntentsEndpoints = "create", EP extends ExtraParameterType | undefined = undefined> = {
|
|
46
|
+
data: ResponseData<E, EP>;
|
|
45
47
|
};
|
|
46
48
|
export {};
|
|
47
49
|
//# sourceMappingURL=stripeSetupIntents.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stripeSetupIntents.d.ts","sourceRoot":"","sources":["../../../../src/types/marketplace/stripeSetupIntents.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"stripeSetupIntents.d.ts","sourceRoot":"","sources":["../../../../src/types/marketplace/stripeSetupIntents.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAC,YAAY,EAAE,kBAAkB,EAAE,IAAI,EAAC,MAAM,eAAe,CAAC;AAErE;;GAEG;AACH,MAAM,MAAM,2BAA2B,GAAG,QAAQ,CAAC;AAEnD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,IAAI,CAAC;IACT,IAAI,EAAE,mBAAmB,CAAC;IAC1B,UAAU,EAAE;QACV,mBAAmB,EAAE,MAAM,CAAC;QAC5B,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,2BAA4B,SAAQ,YAAY;CAChE;AAED;;GAEG;AACH,MAAM,WAAW,iCACf,SAAQ,2BAA2B;CACpC;AAED;;GAEG;AACH,KAAK,YAAY,CAAC,EAAE,SAAS,kBAAkB,GAAG,SAAS,IACzD,EAAE,SAAS;IAAE,MAAM,EAAE,IAAI,CAAA;CAAE,GACvB,iBAAiB,GACjB,EAAE,SAAS;IAAE,MAAM,EAAE,KAAK,CAAA;CAAE,GAC1B,IAAI,CAAC,iBAAiB,EAAE,YAAY,CAAC,GACrC,IAAI,CAAC,iBAAiB,EAAE,YAAY,CAAC,CAAC;AAE9C;;GAEG;AACH,KAAK,YAAY,CACf,CAAC,SAAS,2BAA2B,EACrC,EAAE,SAAS,kBAAkB,GAAG,SAAS,IACvC,CAAC,SAAS,QAAQ,GAAG,YAAY,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC;AAElD;;GAEG;AACH,MAAM,MAAM,0BAA0B,CACpC,CAAC,SAAS,2BAA2B,GAAG,QAAQ,EAChD,EAAE,SAAS,kBAAkB,GAAG,SAAS,GAAG,SAAS,IACnD;IACF,IAAI,EAAE,YAAY,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;CAC3B,CAAC"}
|
|
@@ -1,37 +1,35 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @fileoverview Type definitions for Time Slots in the Sharetribe Marketplace API.
|
|
3
|
-
* This file defines the structure of Time Slots, their parameters, and response types for API requests.
|
|
4
3
|
*/
|
|
5
|
-
import { ApiMeta, ApiParameter } from "../sharetribe";
|
|
6
|
-
import UUID from "../../sdkTypes/UUID";
|
|
4
|
+
import { ApiMeta, ApiParameter, UUID } from "../sharetribe";
|
|
7
5
|
/**
|
|
8
|
-
*
|
|
6
|
+
* Supported time slot types
|
|
9
7
|
*/
|
|
10
|
-
export type
|
|
8
|
+
export type TimeSlotType = "time-slot/day" | "time-slot/time";
|
|
11
9
|
/**
|
|
12
|
-
*
|
|
10
|
+
* Available endpoints
|
|
13
11
|
*/
|
|
14
12
|
export type TimeSlotsEndpoints = "query";
|
|
15
13
|
/**
|
|
16
|
-
*
|
|
14
|
+
* Time slot resource
|
|
17
15
|
*/
|
|
18
16
|
export interface TimeSlot {
|
|
19
17
|
id: UUID;
|
|
20
18
|
type: "timeSlot";
|
|
21
19
|
attributes: {
|
|
22
|
-
type:
|
|
20
|
+
type: TimeSlotType;
|
|
23
21
|
seats: number;
|
|
24
22
|
start: Date;
|
|
25
23
|
end: Date;
|
|
26
24
|
};
|
|
27
25
|
}
|
|
28
26
|
/**
|
|
29
|
-
* Base parameters
|
|
27
|
+
* Base request parameters
|
|
30
28
|
*/
|
|
31
29
|
export interface TimeSlotsParameter extends ApiParameter {
|
|
32
30
|
}
|
|
33
31
|
/**
|
|
34
|
-
*
|
|
32
|
+
* Query parameters for fetching availability
|
|
35
33
|
*/
|
|
36
34
|
export interface TimeSlotsQueryParameter extends TimeSlotsParameter {
|
|
37
35
|
listingId: UUID | string;
|
|
@@ -39,14 +37,14 @@ export interface TimeSlotsQueryParameter extends TimeSlotsParameter {
|
|
|
39
37
|
end: Date | string;
|
|
40
38
|
}
|
|
41
39
|
/**
|
|
42
|
-
*
|
|
40
|
+
* Response data per endpoint
|
|
43
41
|
*/
|
|
44
|
-
type
|
|
42
|
+
type TimeSlotsResponseData<E extends TimeSlotsEndpoints> = E extends "query" ? TimeSlot[] : never;
|
|
45
43
|
/**
|
|
46
|
-
*
|
|
44
|
+
* Final API response type
|
|
47
45
|
*/
|
|
48
|
-
export type TimeSlotsResponse<E extends TimeSlotsEndpoints> = {
|
|
49
|
-
data:
|
|
46
|
+
export type TimeSlotsResponse<E extends TimeSlotsEndpoints = "query"> = {
|
|
47
|
+
data: TimeSlotsResponseData<E>;
|
|
50
48
|
} & (E extends "query" ? {
|
|
51
49
|
meta: ApiMeta;
|
|
52
50
|
} : {});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeSlots.d.ts","sourceRoot":"","sources":["../../../../src/types/marketplace/timeSlots.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"timeSlots.d.ts","sourceRoot":"","sources":["../../../../src/types/marketplace/timeSlots.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAC,OAAO,EAAE,YAAY,EAAE,IAAI,EAAC,MAAM,eAAe,CAAC;AAE1D;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,eAAe,GAAG,gBAAgB,CAAC;AAE9D;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,CAAC;AAEzC;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,IAAI,CAAC;IACT,IAAI,EAAE,UAAU,CAAC;IACjB,UAAU,EAAE;QACV,IAAI,EAAE,YAAY,CAAC;QACnB,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,IAAI,CAAC;QACZ,GAAG,EAAE,IAAI,CAAC;KACX,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,kBAAmB,SAAQ,YAAY;CACvD;AAED;;GAEG;AACH,MAAM,WAAW,uBAAwB,SAAQ,kBAAkB;IACjE,SAAS,EAAE,IAAI,GAAG,MAAM,CAAC;IACzB,KAAK,EAAE,IAAI,GAAG,MAAM,CAAC;IACrB,GAAG,EAAE,IAAI,GAAG,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,KAAK,qBAAqB,CAAC,CAAC,SAAS,kBAAkB,IACrD,CAAC,SAAS,OAAO,GAAG,QAAQ,EAAE,GAAG,KAAK,CAAC;AAEzC;;GAEG;AACH,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,kBAAkB,GAAG,OAAO,IAAI;IACtE,IAAI,EAAE,qBAAqB,CAAC,CAAC,CAAC,CAAC;CAChC,GAAG,CAAC,CAAC,SAAS,OAAO,GAAG;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,GAAG,EAAE,CAAC,CAAC"}
|
|
@@ -1,27 +1,26 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @fileoverview Type definitions for Transactions in the Sharetribe Marketplace API.
|
|
3
|
-
* This file defines the structure of transactions, their parameters, and response types for API requests.
|
|
4
3
|
*/
|
|
5
|
-
import { ApiMeta, ApiParameter, ExtraParameterType, Money, QueryMeta, QueryProt, Relationship, RelationshipTypeMap, UUID } from "../sharetribe";
|
|
4
|
+
import { ApiMeta, ApiParameter, ExtraParameter, ExtraParameterType, Money, QueryMeta, QueryProt, Relationship, RelationshipTypeMap, UUID } from "../sharetribe";
|
|
6
5
|
import { BookingState } from "./bookings";
|
|
7
6
|
/**
|
|
8
|
-
* Available endpoints
|
|
7
|
+
* Available endpoints
|
|
9
8
|
*/
|
|
10
9
|
export type TransactionsEndpoints = "show" | "query" | "initiate" | "initiateSpeculative" | "transition" | "transitionSpeculative" | "updateMetadata";
|
|
11
10
|
/**
|
|
12
|
-
*
|
|
11
|
+
* Relationship fields that can be included
|
|
13
12
|
*/
|
|
14
13
|
export type TransactionsRelationshipsFields = "marketplace" | "listing" | "listing.marketplace" | "listing.author" | "listing.images" | "listing.currentStock" | "provider" | "provider.profileImage" | "provider.stripeAccount" | "provider.effectivePermissionSet" | "customer" | "customer.profileImage" | "customer.stripeAccount" | "customer.effectivePermissionSet" | "booking" | "stockReservation" | "reviews" | "reviews.author" | "reviews.subject" | "messages" | "messages.sender";
|
|
15
14
|
/**
|
|
16
|
-
* Roles
|
|
15
|
+
* Roles in a transaction
|
|
17
16
|
*/
|
|
18
|
-
export type
|
|
17
|
+
export type TransactionParty = "customer" | "provider";
|
|
19
18
|
/**
|
|
20
|
-
*
|
|
19
|
+
* Transaction variety
|
|
21
20
|
*/
|
|
22
|
-
export type
|
|
21
|
+
export type TransactionVariety = "sale" | "order";
|
|
23
22
|
/**
|
|
24
|
-
*
|
|
23
|
+
* Line item in a transaction
|
|
25
24
|
*/
|
|
26
25
|
export interface LineItem {
|
|
27
26
|
code: string;
|
|
@@ -32,45 +31,49 @@ export interface LineItem {
|
|
|
32
31
|
percentage?: number;
|
|
33
32
|
reversal?: boolean;
|
|
34
33
|
lineTotal: Money;
|
|
35
|
-
includeFor:
|
|
34
|
+
includeFor: TransactionParty[];
|
|
36
35
|
}
|
|
37
36
|
/**
|
|
38
|
-
*
|
|
37
|
+
* Process transition record
|
|
39
38
|
*/
|
|
40
|
-
export
|
|
39
|
+
export interface Transition {
|
|
41
40
|
transition: string;
|
|
42
41
|
createdAt: Date | string;
|
|
43
|
-
by:
|
|
44
|
-
}
|
|
42
|
+
by: TransactionParty;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Core transaction attributes (always present)
|
|
46
|
+
*/
|
|
47
|
+
export interface TransactionAttributes {
|
|
48
|
+
createdAt: Date;
|
|
49
|
+
processName: string;
|
|
50
|
+
processVersion: number;
|
|
51
|
+
lastTransition: string;
|
|
52
|
+
lastTransitionedAt: string | Date;
|
|
53
|
+
payinTotal: Money;
|
|
54
|
+
payoutTotal: Money;
|
|
55
|
+
lineItems: LineItem[];
|
|
56
|
+
protectedData: TransactionProtectedData & TransactionCustomProtectedData;
|
|
57
|
+
metadata: TransactionMetadata & TransactionCustomMetadata;
|
|
58
|
+
transitions: Transition[];
|
|
59
|
+
}
|
|
45
60
|
/**
|
|
46
|
-
*
|
|
61
|
+
* Base transaction type
|
|
47
62
|
*/
|
|
48
63
|
export interface Transaction {
|
|
49
64
|
id: UUID;
|
|
50
65
|
type: "transaction";
|
|
51
|
-
attributes:
|
|
52
|
-
createdAt: Date;
|
|
53
|
-
processName: string;
|
|
54
|
-
processVersion: number;
|
|
55
|
-
lastTransition: string;
|
|
56
|
-
lastTransitionedAt: string;
|
|
57
|
-
payinTotal: Money;
|
|
58
|
-
payoutTotal: Money;
|
|
59
|
-
lineItems: LineItem[];
|
|
60
|
-
protectedData: TransactionProtectedData & TransactionCustomProtectedData;
|
|
61
|
-
metadata: TransactionMetadata & TransactionCustomMetadata;
|
|
62
|
-
transitions: Transition[];
|
|
63
|
-
};
|
|
66
|
+
attributes: TransactionAttributes;
|
|
64
67
|
}
|
|
65
68
|
/**
|
|
66
|
-
* Transaction with
|
|
69
|
+
* Transaction with relationships
|
|
67
70
|
*/
|
|
68
71
|
export interface TransactionWithRelationships extends Transaction {
|
|
69
72
|
relationships: {
|
|
70
73
|
marketplace: Relationship<false, "marketplace">;
|
|
71
74
|
listing: Relationship<false, "listing">;
|
|
72
|
-
provider: Relationship<false, "
|
|
73
|
-
customer: Relationship<false, "
|
|
75
|
+
provider: Relationship<false, "provider">;
|
|
76
|
+
customer: Relationship<false, "customer">;
|
|
74
77
|
booking: Relationship<false, "booking">;
|
|
75
78
|
stockReservation: Relationship<false, "stockReservation">;
|
|
76
79
|
reviews: Relationship<true, "reviews">;
|
|
@@ -78,30 +81,28 @@ export interface TransactionWithRelationships extends Transaction {
|
|
|
78
81
|
};
|
|
79
82
|
}
|
|
80
83
|
/**
|
|
81
|
-
*
|
|
84
|
+
* Select type based on include
|
|
82
85
|
*/
|
|
83
86
|
export type TransactionType<R extends boolean> = R extends true ? TransactionWithRelationships : Transaction;
|
|
84
87
|
/**
|
|
85
|
-
* Base
|
|
88
|
+
* Base API parameter
|
|
86
89
|
*/
|
|
87
90
|
export interface TransactionsParameter extends ApiParameter {
|
|
88
91
|
include?: TransactionsRelationshipsFields[];
|
|
89
92
|
}
|
|
90
93
|
/**
|
|
91
|
-
*
|
|
94
|
+
* Show endpoint
|
|
92
95
|
*/
|
|
93
96
|
export interface TransactionsShowParameter extends TransactionsParameter {
|
|
94
97
|
id: UUID | string;
|
|
95
98
|
}
|
|
96
99
|
/**
|
|
97
|
-
*
|
|
100
|
+
* Query endpoint (with optional privileged fields when I = true)
|
|
98
101
|
*/
|
|
99
102
|
export type TransactionsQueryParameter<I extends boolean = false> = TransactionsParameter & {
|
|
100
|
-
[keyof: QueryMeta]: string;
|
|
101
|
-
[keyof: QueryProt]: string;
|
|
102
103
|
bookingEnd?: string;
|
|
103
104
|
bookingStart?: string;
|
|
104
|
-
bookingStates?:
|
|
105
|
+
bookingStates?: BookingState[];
|
|
105
106
|
createdAtEnd?: string;
|
|
106
107
|
createdAtStart?: string;
|
|
107
108
|
hasBooking?: boolean;
|
|
@@ -111,95 +112,88 @@ export type TransactionsQueryParameter<I extends boolean = false> = Transactions
|
|
|
111
112
|
lastTransitionedAtStart?: string;
|
|
112
113
|
lastTransitions?: string[];
|
|
113
114
|
listingId?: UUID | string;
|
|
114
|
-
only?:
|
|
115
|
+
only?: TransactionVariety;
|
|
115
116
|
processName?: string;
|
|
116
|
-
sort?: "bookingEnd" | "bookingStart" | "createdAt" | "lastMessageAt" | "lastTransitionedAt" | `meta_${string}` | `prot_${string}`;
|
|
117
117
|
stockReservationStates?: string[];
|
|
118
118
|
userId?: UUID | string;
|
|
119
|
+
sort?: "bookingEnd" | "bookingStart" | "createdAt" | "lastMessageAt" | "lastTransitionedAt" | `meta_${string}` | `prot_${string}`;
|
|
120
|
+
[keyof: QueryMeta]: string | undefined;
|
|
121
|
+
[keyof: QueryProt]: string | undefined;
|
|
119
122
|
} & (I extends true ? {
|
|
120
123
|
customerId?: UUID | string;
|
|
121
124
|
providerId?: UUID | string;
|
|
122
125
|
} : {});
|
|
123
126
|
/**
|
|
124
|
-
*
|
|
127
|
+
* Initiate / Speculative initiate
|
|
125
128
|
*/
|
|
126
129
|
export interface TransactionsInitiateParameter extends TransactionsParameter {
|
|
127
130
|
processAlias: string;
|
|
128
131
|
transition: string;
|
|
129
|
-
params
|
|
132
|
+
params?: unknown;
|
|
130
133
|
}
|
|
131
|
-
|
|
132
|
-
* Parameters for speculative initiation of a transaction.
|
|
133
|
-
*/
|
|
134
|
-
export interface TransactionsInitiateSpeculativeParameter extends TransactionsParameter {
|
|
135
|
-
processAlias: string;
|
|
136
|
-
transition: string;
|
|
137
|
-
params: unknown;
|
|
134
|
+
export interface TransactionsInitiateSpeculativeParameter extends TransactionsInitiateParameter {
|
|
138
135
|
}
|
|
139
136
|
/**
|
|
140
|
-
*
|
|
137
|
+
* Transition / Speculative transition
|
|
141
138
|
*/
|
|
142
139
|
export interface TransactionsTransitionParameter extends TransactionsParameter {
|
|
143
140
|
id: UUID | string;
|
|
144
141
|
transition: string;
|
|
145
|
-
params
|
|
142
|
+
params?: unknown;
|
|
146
143
|
}
|
|
147
|
-
|
|
148
|
-
* Parameters for speculative transitioning of a transaction.
|
|
149
|
-
*/
|
|
150
|
-
export interface TransactionsTransitionSpeculativeParameter extends TransactionsParameter {
|
|
151
|
-
id: UUID | string;
|
|
152
|
-
transition: string;
|
|
153
|
-
params: unknown;
|
|
144
|
+
export interface TransactionsTransitionSpeculativeParameter extends TransactionsTransitionParameter {
|
|
154
145
|
}
|
|
155
146
|
/**
|
|
156
|
-
*
|
|
147
|
+
* Update metadata
|
|
157
148
|
*/
|
|
158
149
|
export interface TransactionsUpdateMetadataParameter extends TransactionsParameter {
|
|
159
150
|
id: UUID | string;
|
|
160
|
-
metadata
|
|
151
|
+
metadata?: TransactionMetadata & TransactionCustomMetadata;
|
|
161
152
|
}
|
|
162
153
|
/**
|
|
163
|
-
*
|
|
154
|
+
* Custom data structures
|
|
164
155
|
*/
|
|
165
156
|
export interface TransactionProtectedData {
|
|
166
157
|
[key: string]: any;
|
|
167
158
|
}
|
|
168
|
-
|
|
169
|
-
* Custom protected data structure for a transaction.
|
|
170
|
-
*/
|
|
171
|
-
export interface TransactionCustomProtectedData {
|
|
159
|
+
export interface TransactionCustomProtectedData extends Record<string, unknown> {
|
|
172
160
|
}
|
|
173
|
-
/**
|
|
174
|
-
* Metadata structure for a transaction.
|
|
175
|
-
*/
|
|
176
161
|
export interface TransactionMetadata {
|
|
177
162
|
[key: string]: any;
|
|
178
163
|
}
|
|
164
|
+
export interface TransactionCustomMetadata extends Record<string, unknown> {
|
|
165
|
+
}
|
|
179
166
|
/**
|
|
180
|
-
*
|
|
167
|
+
* Helpers
|
|
181
168
|
*/
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
type
|
|
186
|
-
type
|
|
187
|
-
|
|
169
|
+
type HasInclude<P> = P extends {
|
|
170
|
+
include: infer I extends TransactionsRelationshipsFields[];
|
|
171
|
+
} ? I : never;
|
|
172
|
+
type IncludesRelationships<P> = HasInclude<P> extends never ? false : true;
|
|
173
|
+
type IncludedResources<P> = HasInclude<P> extends infer Fields extends TransactionsRelationshipsFields[] ? RelationshipTypeMap[Fields[number]][] : never;
|
|
174
|
+
/**
|
|
175
|
+
* Expand behavior (for transition responses)
|
|
176
|
+
*/
|
|
177
|
+
type ExpandResult<T, EP extends ExtraParameter | undefined> = EP extends {
|
|
188
178
|
expand: true;
|
|
189
|
-
} ?
|
|
179
|
+
} ? T : EP extends {
|
|
190
180
|
expand: false;
|
|
191
|
-
} ? Omit<
|
|
181
|
+
} ? Omit<T, "attributes"> : Omit<T, "attributes">;
|
|
182
|
+
/**
|
|
183
|
+
* Union of all parameter types
|
|
184
|
+
*/
|
|
185
|
+
type AllTransactionsParameter = TransactionsShowParameter | TransactionsQueryParameter<any> | TransactionsInitiateParameter | TransactionsInitiateSpeculativeParameter | TransactionsTransitionParameter | TransactionsTransitionSpeculativeParameter | TransactionsUpdateMetadataParameter;
|
|
192
186
|
/**
|
|
193
|
-
*
|
|
187
|
+
* Final response data type
|
|
194
188
|
*/
|
|
195
|
-
type
|
|
189
|
+
type TransactionsResponseData<E extends TransactionsEndpoints, P extends AllTransactionsParameter, EP extends ExtraParameter | undefined> = E extends "show" ? TransactionType<IncludesRelationships<P>> : E extends "query" ? TransactionType<IncludesRelationships<P>>[] : E extends "initiate" | "initiateSpeculative" | "transition" | "transitionSpeculative" | "updateMetadata" ? ExpandResult<TransactionType<IncludesRelationships<P>>, EP> : never;
|
|
196
190
|
/**
|
|
197
|
-
*
|
|
191
|
+
* Final response type
|
|
198
192
|
*/
|
|
199
193
|
export type TransactionsResponse<E extends TransactionsEndpoints, P extends AllTransactionsParameter, EP extends ExtraParameterType = undefined> = {
|
|
200
|
-
data:
|
|
201
|
-
} & (
|
|
202
|
-
included:
|
|
194
|
+
data: TransactionsResponseData<E, P, EP>;
|
|
195
|
+
} & (IncludesRelationships<P> extends true ? {
|
|
196
|
+
included: IncludedResources<P>;
|
|
203
197
|
} : {}) & (E extends "query" ? {
|
|
204
198
|
meta: ApiMeta;
|
|
205
199
|
} : {});
|