@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,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Type definitions for authentication in the Sharetribe Marketplace API.
|
|
3
|
+
* These types define the structure of authentication-related parameters, endpoints, and responses.
|
|
4
|
+
*/
|
|
5
|
+
export type TokenTypes = "access_token" | "refresh_token";
|
|
6
|
+
export type GrantType = "client_credentials" | "password" | "refresh_token" | "token_exchange" | "authorization_code";
|
|
7
|
+
export type Scope = "public-read" | "user" | "trusted:user" | "integ";
|
|
8
|
+
export type ScopeType = "public-read" | "user" | "trusted:user" | "integ" | "details" | "refresh-token";
|
|
9
|
+
export type IdentityProviderType = "facebook" | "google" | string;
|
|
10
|
+
export type LoginParameterType = "user" | "auth_code";
|
|
11
|
+
export type LoginParameter<T extends LoginParameterType> = T extends "user" ? {
|
|
12
|
+
username?: string;
|
|
13
|
+
password?: string;
|
|
14
|
+
} : T extends "auth_code" ? {
|
|
15
|
+
code?: string;
|
|
16
|
+
redirect_uri?: string;
|
|
17
|
+
code_verifier?: string;
|
|
18
|
+
} : never;
|
|
19
|
+
export type LoginWithIdpParameter = {
|
|
20
|
+
idpId: string;
|
|
21
|
+
idpClientId: string;
|
|
22
|
+
idpToken: string;
|
|
23
|
+
};
|
|
24
|
+
export type AuthWithIdpParameter = {
|
|
25
|
+
client_id: string;
|
|
26
|
+
client_secret: string;
|
|
27
|
+
} & LoginWithIdpParameter;
|
|
28
|
+
export type IdentityProvider<P extends IdentityProviderType> = {
|
|
29
|
+
idpId: P;
|
|
30
|
+
idpToken: string;
|
|
31
|
+
};
|
|
32
|
+
type BaseEndpoint = {
|
|
33
|
+
client_id: string;
|
|
34
|
+
};
|
|
35
|
+
export type AnonymousEndpoint = BaseEndpoint & {
|
|
36
|
+
grant_type: "client_credentials";
|
|
37
|
+
scope: "public-read";
|
|
38
|
+
};
|
|
39
|
+
type UserEndpoint = BaseEndpoint & {
|
|
40
|
+
scope: "user";
|
|
41
|
+
};
|
|
42
|
+
export type UserPasswordEndpoint = UserEndpoint & {
|
|
43
|
+
grant_type: "password" | "authorization_code";
|
|
44
|
+
username?: string;
|
|
45
|
+
password?: string;
|
|
46
|
+
code?: string;
|
|
47
|
+
redirect_uri?: string;
|
|
48
|
+
code_verifier?: string;
|
|
49
|
+
};
|
|
50
|
+
export type UserLoginAsEndpoint = UserEndpoint & {
|
|
51
|
+
grant_type: "authorization_code";
|
|
52
|
+
code: string;
|
|
53
|
+
redirect_uri: string;
|
|
54
|
+
code_verifier: string;
|
|
55
|
+
};
|
|
56
|
+
export type TrustedUserEndpoint = BaseEndpoint & {
|
|
57
|
+
client_secret: string;
|
|
58
|
+
subject_token: string;
|
|
59
|
+
grant_type: "token_exchange";
|
|
60
|
+
scope: "trusted:user";
|
|
61
|
+
};
|
|
62
|
+
type IntegEndpoint = BaseEndpoint & {
|
|
63
|
+
scope: "integ";
|
|
64
|
+
};
|
|
65
|
+
export type IntegClientCredentialsEndpoint = IntegEndpoint & {
|
|
66
|
+
grant_type: "client_credentials";
|
|
67
|
+
client_secret: string;
|
|
68
|
+
};
|
|
69
|
+
export type RefreshTokenEndpoint = BaseEndpoint & {
|
|
70
|
+
grant_type: "refresh_token";
|
|
71
|
+
refresh_token: string;
|
|
72
|
+
};
|
|
73
|
+
export type DetailsEndpoint = void;
|
|
74
|
+
export type Endpoint<S extends ScopeType> = S extends "public-read" ? AnonymousEndpoint : S extends "user" ? UserPasswordEndpoint | UserLoginAsEndpoint | UserLoginAsEndpoint : S extends "trusted:user" ? TrustedUserEndpoint : S extends "integ" ? IntegClientCredentialsEndpoint : S extends "details" ? DetailsEndpoint : S extends "refresh-token" ? RefreshTokenEndpoint : never;
|
|
75
|
+
/**
|
|
76
|
+
* Represents an authentication token used for API requests.
|
|
77
|
+
*/
|
|
78
|
+
export interface AuthToken {
|
|
79
|
+
access_token: string;
|
|
80
|
+
token_type: "bearer";
|
|
81
|
+
expires_in: number;
|
|
82
|
+
scope?: Scope;
|
|
83
|
+
refresh_token?: string;
|
|
84
|
+
}
|
|
85
|
+
export type TokenDetails = {
|
|
86
|
+
"client-id": string;
|
|
87
|
+
exp: number;
|
|
88
|
+
scope: Scope;
|
|
89
|
+
isLoggedInAs: boolean;
|
|
90
|
+
};
|
|
91
|
+
export type TokenResponse<S extends ScopeType> = S extends "public-read" | "user" | "trusted:user" | "integ" | "refresh-token" ? AuthToken : S extends "details" ? TokenDetails : never;
|
|
92
|
+
export type RevokeResponse = {
|
|
93
|
+
revoked: boolean;
|
|
94
|
+
};
|
|
95
|
+
export type AuthInfoResponse = {
|
|
96
|
+
scopes?: Scope[];
|
|
97
|
+
isAnonymous?: boolean;
|
|
98
|
+
grantType?: GrantType;
|
|
99
|
+
isLoggedInAs?: string;
|
|
100
|
+
};
|
|
101
|
+
export {};
|
|
102
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/authentication/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,MAAM,MAAM,UAAU,GAAG,cAAc,GAAG,eAAe,CAAC;AAC1D,MAAM,MAAM,SAAS,GACjB,oBAAoB,GACpB,UAAU,GACV,eAAe,GACf,gBAAgB,GAChB,oBAAoB,CAAC;AACzB,MAAM,MAAM,KAAK,GAAG,aAAa,GAAG,MAAM,GAAG,cAAc,GAAG,OAAO,CAAC;AACtE,MAAM,MAAM,SAAS,GACjB,aAAa,GACb,MAAM,GACN,cAAc,GACd,OAAO,GACP,SAAS,GACT,eAAe,CAAC;AACpB,MAAM,MAAM,oBAAoB,GAAG,UAAU,GAAG,QAAQ,GAAG,MAAM,CAAC;AAElE,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,WAAW,CAAC;AAGtD,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,kBAAkB,IAAI,CAAC,SAAS,MAAM,GACvE;IACE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,GACD,CAAC,SAAS,WAAW,GACrB;IACE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,GACD,KAAK,CAAC;AAEV,MAAM,MAAM,qBAAqB,GAAG;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAA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G;IAC7B,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { InternalAxiosRequestConfig } from "axios";
|
|
2
|
+
/**
|
|
3
|
+
* Extended type for Axios internal request configuration to include a retry flag.
|
|
4
|
+
*/
|
|
5
|
+
export type ExtendedInternalAxiosRequestConfig = InternalAxiosRequestConfig & {
|
|
6
|
+
/**
|
|
7
|
+
* Indicates whether the request has been retried.
|
|
8
|
+
*/
|
|
9
|
+
_retry: boolean;
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=axios.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"axios.d.ts","sourceRoot":"","sources":["../../../src/types/axios.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,OAAO,CAAC;AAEnD;;GAEG;AACH,MAAM,MAAM,kCAAkC,GAAG,0BAA0B,GAAG;IAC5E;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import UUID from "../sdkTypes/UUID";
|
|
2
|
+
import LatLng from "../sdkTypes/LatLng";
|
|
3
|
+
import Money from "../sdkTypes/Money";
|
|
4
|
+
import LatLngBounds from "../sdkTypes/LatLngBounds";
|
|
5
|
+
import BigDecimal from "../sdkTypes/BigDecimal";
|
|
6
|
+
import { Agent as HttpAgent } from "http";
|
|
7
|
+
import { Agent as HttpsAgent } from "https";
|
|
8
|
+
/**
|
|
9
|
+
* Supported SDK type classes.
|
|
10
|
+
*/
|
|
11
|
+
type SdkTypeClass = typeof UUID | typeof LatLng | typeof Money | typeof LatLngBounds | typeof BigDecimal;
|
|
12
|
+
/**
|
|
13
|
+
* Supported SDK type instances.
|
|
14
|
+
*/
|
|
15
|
+
type SdkTypeInstance = UUID | LatLng | Money | LatLngBounds | BigDecimal;
|
|
16
|
+
/**
|
|
17
|
+
* Represents application-specific types.
|
|
18
|
+
* `AppType` is set to `any` to allow flexibility.
|
|
19
|
+
*/
|
|
20
|
+
type AppType = any;
|
|
21
|
+
/**
|
|
22
|
+
* Interface for handling type transformations between SDK and application-specific types.
|
|
23
|
+
* T represents the specific SDK type instance (e.g., UUID, Money)
|
|
24
|
+
* U represents the specific application type
|
|
25
|
+
*/
|
|
26
|
+
export interface TypeHandler<T extends SdkTypeInstance = SdkTypeInstance, U = any> {
|
|
27
|
+
sdkType: SdkTypeClass;
|
|
28
|
+
appType: AppType;
|
|
29
|
+
/**
|
|
30
|
+
* Function to read and transform a specific SDK type instance into an application-specific type.
|
|
31
|
+
*/
|
|
32
|
+
reader?: (value: T) => U;
|
|
33
|
+
/**
|
|
34
|
+
* Function to write and transform an application-specific type into a specific SDK type instance.
|
|
35
|
+
*/
|
|
36
|
+
writer?: (value: U) => T;
|
|
37
|
+
/**
|
|
38
|
+
* Function to determine if a handler can process a specific key-value pair.
|
|
39
|
+
*/
|
|
40
|
+
canHandle?: (args: {
|
|
41
|
+
key: string;
|
|
42
|
+
value: any;
|
|
43
|
+
}) => boolean;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Interface for storing and managing authentication tokens.
|
|
47
|
+
*/
|
|
48
|
+
export interface TokenStore {
|
|
49
|
+
token?: {
|
|
50
|
+
access_token: string;
|
|
51
|
+
token_type: "bearer";
|
|
52
|
+
expires_in: number;
|
|
53
|
+
scope?: "public-read" | "trusted:user" | "user" | "integ";
|
|
54
|
+
refresh_token?: string;
|
|
55
|
+
} | null;
|
|
56
|
+
expiration?: number;
|
|
57
|
+
/**
|
|
58
|
+
* Retrieves the current token.
|
|
59
|
+
* @returns A promise resolving to the token or null if no token is available.
|
|
60
|
+
*/
|
|
61
|
+
getToken: () => {
|
|
62
|
+
access_token: string;
|
|
63
|
+
token_type: "bearer";
|
|
64
|
+
expires_in: number;
|
|
65
|
+
scope?: "public-read" | "trusted:user" | "user" | "integ";
|
|
66
|
+
refresh_token?: string;
|
|
67
|
+
} | null;
|
|
68
|
+
/**
|
|
69
|
+
* Sets a new token.
|
|
70
|
+
* @param args - The token details.
|
|
71
|
+
*/
|
|
72
|
+
setToken: (args: {
|
|
73
|
+
access_token: string;
|
|
74
|
+
token_type: "bearer";
|
|
75
|
+
expires_in: number;
|
|
76
|
+
scope?: "public-read" | "trusted:user" | "user" | "integ";
|
|
77
|
+
refresh_token?: string;
|
|
78
|
+
}) => void;
|
|
79
|
+
/**
|
|
80
|
+
* Removes the current token.
|
|
81
|
+
*/
|
|
82
|
+
removeToken: () => void;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Interface for SDK configuration settings.
|
|
86
|
+
*/
|
|
87
|
+
export interface SdkConfig {
|
|
88
|
+
/**
|
|
89
|
+
* The client ID. Must be non-empty (enforced at runtime).
|
|
90
|
+
*/
|
|
91
|
+
clientId: string;
|
|
92
|
+
/**
|
|
93
|
+
* The client secret (optional).
|
|
94
|
+
*/
|
|
95
|
+
clientSecret?: string;
|
|
96
|
+
/**
|
|
97
|
+
* Base URL for the SDK. Should not end with '/' (enforced at runtime).
|
|
98
|
+
*/
|
|
99
|
+
baseUrl?: string;
|
|
100
|
+
/**
|
|
101
|
+
* Base URL for asset CDN. Should not end with '/' (enforced at runtime).
|
|
102
|
+
*/
|
|
103
|
+
assetCdnBaseUrl?: string;
|
|
104
|
+
/**
|
|
105
|
+
* SDK version (optional).
|
|
106
|
+
*/
|
|
107
|
+
version?: string;
|
|
108
|
+
/**
|
|
109
|
+
* Token store for managing authentication tokens.
|
|
110
|
+
*/
|
|
111
|
+
tokenStore?: TokenStore;
|
|
112
|
+
/**
|
|
113
|
+
* Whether to use secure connections.
|
|
114
|
+
*/
|
|
115
|
+
secure?: boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Whether to enable verbose mode for Transit serialization.
|
|
118
|
+
*/
|
|
119
|
+
transitVerbose?: boolean;
|
|
120
|
+
/**
|
|
121
|
+
* Predefined authentication token.
|
|
122
|
+
*/
|
|
123
|
+
authToken?: string;
|
|
124
|
+
/**
|
|
125
|
+
* Custom type handlers for transforming data.
|
|
126
|
+
*/
|
|
127
|
+
typeHandlers?: TypeHandler<any, any>[];
|
|
128
|
+
/**
|
|
129
|
+
* Http Agent
|
|
130
|
+
*/
|
|
131
|
+
httpAgent?: HttpAgent;
|
|
132
|
+
/**
|
|
133
|
+
* Https Agent
|
|
134
|
+
*/
|
|
135
|
+
httpsAgent?: HttpsAgent;
|
|
136
|
+
}
|
|
137
|
+
export {};
|
|
138
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/types/config.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,kBAAkB,CAAC;AACpC,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,KAAK,MAAM,mBAAmB,CAAC;AACtC,OAAO,YAAY,MAAM,0BAA0B,CAAC;AACpD,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,EAAE,KAAK,IAAI,UAAU,EAAE,MAAM,OAAO,CAAC;AAE5C;;GAEG;AACH,KAAK,YAAY,GACb,OAAO,IAAI,GACX,OAAO,MAAM,GACb,OAAO,KAAK,GACZ,OAAO,YAAY,GACnB,OAAO,UAAU,CAAC;AAEtB;;GAEG;AACH,KAAK,eAAe,GAAG,IAAI,GAAG,MAAM,GAAG,KAAK,GAAG,YAAY,GAAG,UAAU,CAAC;AAEzE;;;GAGG;AACH,KAAK,OAAO,GAAG,GAAG,CAAC;AAEnB;;;;GAIG;AACH,MAAM,WAAW,WAAW,CAC1B,CAAC,SAAS,eAAe,GAAG,eAAe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AAI,CAAC;IAEX;;OAEG;IACH,WAAW,EAAE,MAAM,IAAI,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,YAAY,CAAC,EAAE,WAAW,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;IACvC;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;OAEG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Type definitions for Events in the Sharetribe Marketplace API.
|
|
3
|
+
* These types define the structure of events, event parameters, and responses for querying events.
|
|
4
|
+
*/
|
|
5
|
+
import { ApiMeta, UUID } from "../sharetribe";
|
|
6
|
+
import { ListingWithRelationships } from "../marketplace/listings";
|
|
7
|
+
import { UserWithRelationships } from "../marketplace/user";
|
|
8
|
+
import { AvailabilityExceptionWithRelationships } from "../marketplace/availabilityExceptions";
|
|
9
|
+
import { MessageWithRelationships } from "../marketplace/messages";
|
|
10
|
+
import { TransactionWithRelationships } from "../marketplace/transactions";
|
|
11
|
+
import { BookingWithRelationShips } from "../marketplace/bookings";
|
|
12
|
+
import { ReviewWithRelationships } from "../marketplace/reviews";
|
|
13
|
+
import { StockAdjustmentWithRelationships } from "../marketplace/stockAdjustment";
|
|
14
|
+
import { StockReservationWithRelationships } from "../marketplace/stockReservations";
|
|
15
|
+
export type EventsEndpoints = "query";
|
|
16
|
+
export type EventTypes = "listing/created" | "listing/updated" | "listing/deleted" | "user/created" | "user/updated" | "user/deleted" | "availabilityException/created" | "availabilityException/updated" | "availabilityException/deleted" | "message/created" | "message/updated" | "message/deleted" | "transaction/initiated" | "transaction/transitioned" | "transaction/updated" | "transaction/deleted" | "booking/created" | "booking/updated" | "booking/deleted" | "review/created" | "review/updated" | "review/deleted" | "stockAdjustment/created" | "stockAdjustment/updated" | "stockAdjustment/deleted" | "stockReservation/created" | "stockReservation/updated" | "stockReservation/deleted";
|
|
17
|
+
export type EventSource = "source/marketplace-api" | "source/integration-api" | "source/transaction" | "source/console" | "source/admin";
|
|
18
|
+
export type EventResourceType = "listing" | "user" | "availabilityException" | "message" | "transaction" | "booking" | "review" | "stockAdjustment" | "stockReservation";
|
|
19
|
+
export type EventResource<T extends EventResourceType = any> = T extends "listing" ? ListingWithRelationships<true> : T extends "user" ? UserWithRelationships<true> : T extends "availabilityException" ? AvailabilityExceptionWithRelationships : T extends "message" ? MessageWithRelationships : T extends "transaction" ? TransactionWithRelationships : T extends "booking" ? BookingWithRelationShips : T extends "review" ? ReviewWithRelationships : T extends "stockAdjustment" ? StockAdjustmentWithRelationships : T extends "stockReservation" ? StockReservationWithRelationships : never;
|
|
20
|
+
export type EventAuditData = {
|
|
21
|
+
userId: UUID;
|
|
22
|
+
adminId: UUID;
|
|
23
|
+
clientId: UUID;
|
|
24
|
+
requestId: UUID;
|
|
25
|
+
};
|
|
26
|
+
export interface Event {
|
|
27
|
+
id: UUID;
|
|
28
|
+
type: "event";
|
|
29
|
+
attributes: {
|
|
30
|
+
createdAt: Date;
|
|
31
|
+
sequenceId: number;
|
|
32
|
+
marketplaceId: UUID;
|
|
33
|
+
eventType: EventTypes;
|
|
34
|
+
source: EventSource;
|
|
35
|
+
resourceId: UUID;
|
|
36
|
+
resourceType: EventResourceType;
|
|
37
|
+
resource: EventResource;
|
|
38
|
+
previousValues: any;
|
|
39
|
+
auditData: EventAuditData;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
export interface EventQueryParameter {
|
|
43
|
+
startAfterSequenceId?: number;
|
|
44
|
+
createdAtStart?: Date | string;
|
|
45
|
+
resourceId?: UUID | string;
|
|
46
|
+
relatedResourceId?: UUID | string;
|
|
47
|
+
eventTypes?: EventTypes[];
|
|
48
|
+
}
|
|
49
|
+
type DataType<E extends EventsEndpoints> = E extends "query" ? Event[] : never;
|
|
50
|
+
export type EventsResponse<E extends EventsEndpoints> = {
|
|
51
|
+
data: DataType<E>;
|
|
52
|
+
} & (E extends "query" ? {
|
|
53
|
+
meta: ApiMeta;
|
|
54
|
+
} : {});
|
|
55
|
+
export {};
|
|
56
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../../src/types/integration/events.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,sCAAsC,EAAE,MAAM,uCAAuC,CAAC;AAC/F,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAC;AAC3E,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,gCAAgC,EAAE,MAAM,gCAAgC,CAAC;AAClF,OAAO,EAAE,iCAAiC,EAAE,MAAM,kCAAkC,CAAC;AAGrF,MAAM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AE,IAAI,CAAC;IACb,OAAO,EAAE,IAAI,CAAC;IACd,QAAQ,EAAE,IAAI,CAAC;IACf,SAAS,EAAE,IAAI,CAAC;CACjB,CAAC;AAGF,MAAM,WAAW,KAAK;IACpB,EAAE,EAAE,IAAI,CAAC;IACT,IAAI,EAAE,OAAO,CAAC;IACd,UAAU,EAAE;QACV,SAAS,EAAE,IAAI,CAAC;QAChB,UAAU,EAAE,MAAM,CAAC;QACnB,aAAa,EAAE,IAAI,CAAC;QACpB,SAAS,EAAE,UAAU,CAAC;QACtB,MAAM,EAAE,WAAW,CAAC;QACpB,UAAU,EAAE,IAAI,CAAC;QACjB,YAAY,EAAE,iBAAiB,CAAC;QAChC,QAAQ,EAAE,aAAa,CAAC;QACxB,cAAc,EAAE,GAAG,CAAC;QACpB,SAAS,EAAE,cAAc,CAAC;KAC3B,CAAC;CACH;AAGD,MAAM,WAAW,mBAAmB;IAClC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,cAAc,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAC/B,UAAU,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAC3B,iBAAiB,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAClC,UAAU,CAAC,EAAE,UAAU,EAAE,CAAC;CAC3B;AAGD,KAAK,QAAQ,CAAC,CAAC,SAAS,eAAe,IAAI,CAAC,SAAS,OAAO,GAAG,KAAK,EAAE,GAAG,KAAK,CAAC;AAG/E,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,eAAe,IAAI;IACtD,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;CACnB,GAAG,CAAC,CAAC,SAAS,OAAO,GAAG;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,GAAG,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Type definitions for managing availability exceptions in the Sharetribe Marketplace API.
|
|
3
|
+
* These types define the structure of availability exception-related parameters, responses, and relationships.
|
|
4
|
+
*/
|
|
5
|
+
import { ApiMeta, ApiParameter, ExtraParameterType, Relationship, RelationshipTypeMap, UUID } from "../sharetribe";
|
|
6
|
+
export type AvailabilityExceptionsEndpoints = "query" | "create" | "delete";
|
|
7
|
+
export type AvailabilityExceptionsRelationshipsFields = "ownListing" | "ownListing.marketplace" | "ownListing.author" | "ownListing.images" | "ownListing.currentStock";
|
|
8
|
+
export interface AvailabilityException {
|
|
9
|
+
id: UUID;
|
|
10
|
+
type: "availabilityException";
|
|
11
|
+
attributes?: {
|
|
12
|
+
seats: number;
|
|
13
|
+
start: Date;
|
|
14
|
+
end: Date;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export interface AvailabilityExceptionWithRelationships extends AvailabilityException {
|
|
18
|
+
relationships: {
|
|
19
|
+
ownListing: Relationship<false, "ownListing">;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export type AvailabilityExceptionType<R extends boolean> = R extends true ? AvailabilityExceptionWithRelationships : AvailabilityException;
|
|
23
|
+
export interface AvailabilityExceptionsParameter extends ApiParameter {
|
|
24
|
+
include?: AvailabilityExceptionsRelationshipsFields[];
|
|
25
|
+
}
|
|
26
|
+
export interface AvailabilityExceptionsQueryParameter extends AvailabilityExceptionsParameter {
|
|
27
|
+
listingId: UUID | string;
|
|
28
|
+
start: Date | string;
|
|
29
|
+
end: Date | string;
|
|
30
|
+
}
|
|
31
|
+
export interface AvailabilityExceptionsCreateParameter extends AvailabilityExceptionsParameter {
|
|
32
|
+
listingId: UUID | string;
|
|
33
|
+
seats: number;
|
|
34
|
+
start: Date | string;
|
|
35
|
+
end: Date | string;
|
|
36
|
+
}
|
|
37
|
+
export interface AvailabilityExceptionsDeleteParameter {
|
|
38
|
+
id: UUID | string;
|
|
39
|
+
}
|
|
40
|
+
type AllAvailabilityExceptionsParameter = AvailabilityExceptionsQueryParameter | AvailabilityExceptionsCreateParameter | AvailabilityExceptionsDeleteParameter;
|
|
41
|
+
type AvailabilityExceptionsType<P extends AllAvailabilityExceptionsParameter> = "include" extends keyof P ? P["include"] extends AvailabilityExceptionsRelationshipsFields[] ? true : false : false;
|
|
42
|
+
type IncludedType<P extends AllAvailabilityExceptionsParameter> = "include" extends keyof P ? P["include"] extends (keyof RelationshipTypeMap)[] ? Array<RelationshipTypeMap[P["include"][number]]>[] : never : never;
|
|
43
|
+
type ExpandReturnType<P extends AllAvailabilityExceptionsParameter, EP> = EP extends {
|
|
44
|
+
expand: true;
|
|
45
|
+
} ? AvailabilityExceptionType<AvailabilityExceptionsType<P>> : EP extends {
|
|
46
|
+
expand: false;
|
|
47
|
+
} ? Omit<AvailabilityExceptionType<AvailabilityExceptionsType<P>>, "attributes"> : Omit<AvailabilityExceptionType<AvailabilityExceptionsType<P>>, "attributes">;
|
|
48
|
+
type DataType<E extends AvailabilityExceptionsEndpoints, P extends AllAvailabilityExceptionsParameter, EP extends ExtraParameterType> = E extends "query" ? AvailabilityExceptionType<AvailabilityExceptionsType<P>>[] : E extends "create" ? ExpandReturnType<P, EP> : E extends "delete" ? Pick<AvailabilityException, "id" | "type"> : never;
|
|
49
|
+
export type AvailabilityExceptionsResponse<E extends AvailabilityExceptionsEndpoints, P extends AllAvailabilityExceptionsParameter, EP extends ExtraParameterType = undefined> = {
|
|
50
|
+
data: DataType<E, P, EP>;
|
|
51
|
+
} & ("include" extends keyof P ? {
|
|
52
|
+
included: IncludedType<P>;
|
|
53
|
+
} : {}) & (E extends "query" ? {
|
|
54
|
+
meta: ApiMeta;
|
|
55
|
+
} : {});
|
|
56
|
+
export {};
|
|
57
|
+
//# sourceMappingURL=availabilityExceptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"availabilityExceptions.d.ts","sourceRoot":"","sources":["../../../../src/types/marketplace/availabilityExceptions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,OAAO,EACP,YAAY,EACZ,kBAAkB,EAClB,Y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,CAAC,GAC1C,KAAK,CAAC;AAGV,MAAM,MAAM,8BAA8B,CACxC,CAAC,SAAS,+BAA+B,EACzC,CAAC,SAAS,kCAAkC,EAC5C,EAAE,SAAS,kBAAkB,GAAG,SAAS,IACvC;IACF,IAAI,EAAE,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;CAC1B,GAAG,CAAC,SAAS,SAAS,MAAM,CAAC,GAAG;IAAE,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,CAAA;CAAE,GAAG,EAAE,CAAC,GAClE,CAAC,CAAC,SAAS,OAAO,GAAG;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,GAAG,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Type definitions for managing bookings in the Sharetribe Marketplace API.
|
|
3
|
+
* These types define the structure of booking-related parameters, responses, and relationships.
|
|
4
|
+
*/
|
|
5
|
+
import { ApiMeta, ApiParameter, UUID, Relationship, RelationshipTypeMap } from "../sharetribe";
|
|
6
|
+
export type BookingsEndpoints = "query";
|
|
7
|
+
export type BookingsRelationshipsFields = "transaction" | "transaction.marketplace" | "transaction.listing" | "transaction.provider" | "transaction.customer" | "transaction.booking" | "transaction.stockReservation" | "transaction.reviews" | "transaction.messages";
|
|
8
|
+
export type BookingState = "pending" | "proposed" | "accepted" | "declined" | "cancelled";
|
|
9
|
+
export interface Booking {
|
|
10
|
+
id: UUID;
|
|
11
|
+
type: "booking";
|
|
12
|
+
attributes: {
|
|
13
|
+
seats: number;
|
|
14
|
+
start: Date;
|
|
15
|
+
end: Date;
|
|
16
|
+
displayStart: Date;
|
|
17
|
+
displayEnd: Date;
|
|
18
|
+
state: BookingState;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export interface BookingWithRelationShips extends Booking {
|
|
22
|
+
relationships: {
|
|
23
|
+
transaction: Relationship<false, "transaction">;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export type BookingType<R extends boolean> = R extends true ? BookingWithRelationShips : Booking;
|
|
27
|
+
export interface BookingsParameter extends ApiParameter {
|
|
28
|
+
include?: BookingsRelationshipsFields[];
|
|
29
|
+
}
|
|
30
|
+
export interface BookingsQueryParameter extends BookingsParameter {
|
|
31
|
+
listingId: UUID | string;
|
|
32
|
+
start: Date | string;
|
|
33
|
+
end: Date | string;
|
|
34
|
+
state?: BookingState;
|
|
35
|
+
}
|
|
36
|
+
type BookingsType<P extends BookingsQueryParameter> = "include" extends keyof P ? P["include"] extends BookingsRelationshipsFields[] ? true : false : false;
|
|
37
|
+
type IncludedType<P extends BookingsParameter> = "include" extends keyof P ? P["include"] extends (keyof RelationshipTypeMap)[] ? Array<RelationshipTypeMap[P["include"][number]]> : never : never;
|
|
38
|
+
type DataType<E extends BookingsEndpoints, P extends BookingsQueryParameter> = E extends "query" ? BookingType<BookingsType<P>>[] : never;
|
|
39
|
+
export type BookingsResponse<E extends BookingsEndpoints, P extends BookingsQueryParameter> = {
|
|
40
|
+
data: DataType<E, P>;
|
|
41
|
+
} & ("include" extends keyof P ? {
|
|
42
|
+
included: IncludedType<P>;
|
|
43
|
+
} : {}) & (E extends "query" ? {
|
|
44
|
+
meta: ApiMeta;
|
|
45
|
+
} : {});
|
|
46
|
+
export {};
|
|
47
|
+
//# sourceMappingURL=bookings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bookings.d.ts","sourceRoot":"","sources":["../../../../src/types/marketplace/bookings.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,OAAO,EACP,YAAY,EACZ,IAAI,EACJ,YAAY,EACZ,mBAAmB,EACpB,MAAM,eAAe,CAAC;AAGvB,MAAM,MAAM,iBAAiB,GAAG,OAAO,CAAC;AAGxC,MAAM,MAAM,2BAA2B,GACnC,aAAa,GACb,yBAAyB,GACzB,qBAAqB,GACrB,sBAAsB,GACtB,sBAAsB,GACtB,qBA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,CAAC,SAAS,CAAC,SAAS,CAAC,MAAM,mBAAmB,CAAC,EAAE,GAChD,KAAK,CAAC,mBAAmB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAChD,KAAK,GACP,KAAK,CAAC;AAGV,KAAK,QAAQ,CACX,CAAC,SAAS,iBAAiB,EAC3B,CAAC,SAAS,sBAAsB,IAC9B,CAAC,SAAS,OAAO,GAAG,WAAW,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,CAAC;AAG/D,MAAM,MAAM,gBAAgB,CAC1B,CAAC,SAAS,iBAAiB,EAC3B,CAAC,SAAS,sBAAsB,IAC9B;IACF,IAAI,EAAE,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;CACtB,GAAG,CAAC,SAAS,SAAS,MAAM,CAAC,GAAG;IAAE,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,CAAA;CAAE,GAAG,EAAE,CAAC,GAClE,CAAC,CAAC,SAAS,OAAO,GAAG;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,GAAG,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Type definitions for managing the current user in the Sharetribe Marketplace API.
|
|
3
|
+
* These types define the structure of current user-related parameters, responses, and relationships.
|
|
4
|
+
*/
|
|
5
|
+
import { ApiParameter, ExtraParameter, ExtraParameterType, Relationship, RelationshipTypeMap, UUID } from "../sharetribe";
|
|
6
|
+
export type CurrentUserEndpoints = "show" | "delete" | "create" | "create_with_idp" | "update_profile" | "change_password" | "change_email" | "verify_email" | "send_verification_email";
|
|
7
|
+
export type CurrentUserRelationshipsFields = "marketplace" | "profileImage" | "stripeAccount" | "stripeCustomer" | "stripeCustomer.defaultPaymentMethod" | "effectivePermissionSet";
|
|
8
|
+
export interface CurrentUser {
|
|
9
|
+
id: UUID;
|
|
10
|
+
type: "currentUser";
|
|
11
|
+
attributes: {
|
|
12
|
+
banned: boolean;
|
|
13
|
+
deleted: boolean;
|
|
14
|
+
createdAt: string;
|
|
15
|
+
email: string;
|
|
16
|
+
emailVerified: boolean;
|
|
17
|
+
pendingEmail: boolean;
|
|
18
|
+
stripeConnected: boolean;
|
|
19
|
+
stripePayoutsEnabled: boolean;
|
|
20
|
+
stripeChargesEnabled: boolean;
|
|
21
|
+
identityProviders: {
|
|
22
|
+
idpId: string;
|
|
23
|
+
userId: string;
|
|
24
|
+
}[];
|
|
25
|
+
profile: {
|
|
26
|
+
firstName: string;
|
|
27
|
+
lastName: string;
|
|
28
|
+
displayName: string;
|
|
29
|
+
abbreviatedName: string;
|
|
30
|
+
bio: string;
|
|
31
|
+
publicData: CurrentUserProfilePublicData & CurrentUserCustomProfilePublicData;
|
|
32
|
+
protectedData: CurrentUserProfileProtectedData & CurrentUserCustomProfileProtectedData;
|
|
33
|
+
privateData: CurrentUserProfilePrivateData & CurrentUserCustomProfilePrivateData;
|
|
34
|
+
metadata: CurrentUserProfileMetadata & CurrentUserCustomProfileMetadata;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export interface DeleteCurrentUser {
|
|
39
|
+
id: UUID;
|
|
40
|
+
type: "currentUser";
|
|
41
|
+
attributes: {
|
|
42
|
+
banned: false;
|
|
43
|
+
deleted: true;
|
|
44
|
+
createdAt: null;
|
|
45
|
+
email: null;
|
|
46
|
+
emailVerified: false;
|
|
47
|
+
pendingEmail: null;
|
|
48
|
+
stripeConnected: false;
|
|
49
|
+
stripePayoutsEnabled: false;
|
|
50
|
+
stripeChargesEnabled: false;
|
|
51
|
+
identityProviders: null;
|
|
52
|
+
profile: {
|
|
53
|
+
firstName: null;
|
|
54
|
+
lastName: null;
|
|
55
|
+
displayName: null;
|
|
56
|
+
abbreviatedName: null;
|
|
57
|
+
bio: null;
|
|
58
|
+
publicData: null;
|
|
59
|
+
protectedData: null;
|
|
60
|
+
privateData: null;
|
|
61
|
+
metadata: null;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
export interface CurrentUserPermissionSet {
|
|
66
|
+
postListings: "POST /own_listings/create_draft" | "POST /own_listings/publish_draft" | "POST /own_listings/create" | "POST /own_listings/open";
|
|
67
|
+
initiateTransactions: "POST /transactions/initiate";
|
|
68
|
+
read: "GET /listings/query" | "GET /listings/show" | "GET /users/show" | "GET /timeslots/query" | "GET /reviews/query" | "GET /reviews/show";
|
|
69
|
+
}
|
|
70
|
+
export interface CurrentUserWithRelationships extends CurrentUser {
|
|
71
|
+
relationships: {
|
|
72
|
+
marketplace: Relationship<false, "marketplace">;
|
|
73
|
+
profileImage: Relationship<false, "image">;
|
|
74
|
+
stripeAccount: Relationship<false, "stripeAccount">;
|
|
75
|
+
stripeCustomer: Relationship<false, "stripeCustomer">;
|
|
76
|
+
effectivePermissionSet: Relationship<false, "permissionSet">;
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
export type CurrentUserType<R extends boolean> = R extends true ? CurrentUserWithRelationships : CurrentUser;
|
|
80
|
+
export interface CurrentUserParameter extends ApiParameter {
|
|
81
|
+
include?: CurrentUserRelationshipsFields[];
|
|
82
|
+
}
|
|
83
|
+
export interface CurrentUserShowParameter extends CurrentUserParameter {
|
|
84
|
+
}
|
|
85
|
+
export interface CurrentUserDeleteParameter {
|
|
86
|
+
}
|
|
87
|
+
export interface CurrentUserCreateParameter extends CurrentUserParameter {
|
|
88
|
+
email: string;
|
|
89
|
+
password: string;
|
|
90
|
+
firstName: string;
|
|
91
|
+
lastName: string;
|
|
92
|
+
displayName?: string;
|
|
93
|
+
bio?: string;
|
|
94
|
+
publicData?: unknown;
|
|
95
|
+
protectedData?: unknown;
|
|
96
|
+
privateData?: unknown;
|
|
97
|
+
}
|
|
98
|
+
export interface CurrentUserCreateWithIdpParameter extends CurrentUserCreateParameter {
|
|
99
|
+
idpId: string;
|
|
100
|
+
idpClientId: string;
|
|
101
|
+
idpToken: string;
|
|
102
|
+
}
|
|
103
|
+
export interface CurrentUserUpdateProfileParameter extends CurrentUserParameter {
|
|
104
|
+
firstName?: string;
|
|
105
|
+
lastName?: string;
|
|
106
|
+
displayName?: string;
|
|
107
|
+
bio?: string;
|
|
108
|
+
publicData?: unknown;
|
|
109
|
+
protectedData?: unknown;
|
|
110
|
+
privateData?: unknown;
|
|
111
|
+
profileImageId?: string;
|
|
112
|
+
}
|
|
113
|
+
export interface CurrentUserChangePasswordParameter extends CurrentUserParameter {
|
|
114
|
+
currentPassword: string;
|
|
115
|
+
newPassword: string;
|
|
116
|
+
}
|
|
117
|
+
export interface CurrentUserChangeEmailParameter extends CurrentUserParameter {
|
|
118
|
+
currentPassword: string;
|
|
119
|
+
email: string;
|
|
120
|
+
}
|
|
121
|
+
export interface CurrentUserVerifyEmailParameter extends CurrentUserParameter {
|
|
122
|
+
verificationToken: string;
|
|
123
|
+
}
|
|
124
|
+
export interface CurrentUserProfilePublicData {
|
|
125
|
+
[key: string]: any;
|
|
126
|
+
}
|
|
127
|
+
export interface CurrentUserCustomProfilePublicData {
|
|
128
|
+
}
|
|
129
|
+
export interface CurrentUserProfileProtectedData {
|
|
130
|
+
[key: string]: any;
|
|
131
|
+
}
|
|
132
|
+
export interface CurrentUserCustomProfileProtectedData {
|
|
133
|
+
}
|
|
134
|
+
export interface CurrentUserProfilePrivateData {
|
|
135
|
+
[key: string]: any;
|
|
136
|
+
}
|
|
137
|
+
export interface CurrentUserCustomProfilePrivateData {
|
|
138
|
+
}
|
|
139
|
+
export interface CurrentUserProfileMetadata {
|
|
140
|
+
[key: string]: any;
|
|
141
|
+
}
|
|
142
|
+
export interface CurrentUserCustomProfileMetadata {
|
|
143
|
+
}
|
|
144
|
+
type AllCurrentUserParameter = CurrentUserShowParameter | CurrentUserDeleteParameter | CurrentUserCreateParameter | CurrentUserCreateWithIdpParameter | CurrentUserUpdateProfileParameter | CurrentUserChangePasswordParameter | CurrentUserChangeEmailParameter | CurrentUserVerifyEmailParameter | void;
|
|
145
|
+
type CurrentUserTypeType<P extends AllCurrentUserParameter> = "include" extends keyof P ? P["include"] extends CurrentUserRelationshipsFields[] ? true : false : false;
|
|
146
|
+
type IncludedType<P extends AllCurrentUserParameter> = "include" extends keyof P ? P["include"] extends (keyof RelationshipTypeMap)[] ? Array<RelationshipTypeMap[P["include"][number]]> : never : never;
|
|
147
|
+
type ExpandReturnType<P extends AllCurrentUserParameter, EP> = EP extends {
|
|
148
|
+
expand: true;
|
|
149
|
+
} ? CurrentUserType<CurrentUserTypeType<P>> : EP extends {
|
|
150
|
+
expand: false;
|
|
151
|
+
} ? Omit<CurrentUserType<CurrentUserTypeType<P>>, "attributes"> : CurrentUserType<CurrentUserTypeType<P>>;
|
|
152
|
+
type DataType<E extends CurrentUserEndpoints, P extends AllCurrentUserParameter, EP extends ExtraParameter | undefined> = E extends "show" ? CurrentUserType<CurrentUserTypeType<P>> : E extends "delete" ? Pick<DeleteCurrentUser, "id" | "type"> : E extends "create" | "create_with_idp" | "update_profile" | "change_password" | "change_email" | "verify_email" ? ExpandReturnType<P, EP> : never;
|
|
153
|
+
export type CurrentUserResponse<E extends CurrentUserEndpoints, P extends AllCurrentUserParameter, EP extends ExtraParameterType = undefined> = {
|
|
154
|
+
data: DataType<E, P, EP>;
|
|
155
|
+
} & ("include" extends keyof P ? {
|
|
156
|
+
included: IncludedType<P>;
|
|
157
|
+
} : {});
|
|
158
|
+
export {};
|
|
159
|
+
//# sourceMappingURL=currentUser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"currentUser.d.ts","sourceRoot":"","sources":["../../../../src/types/marketplace/currentUser.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,YAAY,EACZ,mBAAmB,EACnB,IAAI,EACL,MAAM,eAAe,CAAC;AAGvB,MAAM,MAAM,oBAAoB,GAC5B,MAAM,GACN,QAAQ,GACR,QAAQ,GAC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