@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.
Files changed (184) hide show
  1. package/LICENSE.txt +21 -0
  2. package/README.md +191 -0
  3. package/dist/ts-sharetribe-flex-sdk.cjs +3 -0
  4. package/dist/ts-sharetribe-flex-sdk.cjs.LICENSE.txt +701 -0
  5. package/dist/ts-sharetribe-flex-sdk.cjs.map +1 -0
  6. package/dist/ts-sharetribe-flex-sdk.js +3 -0
  7. package/dist/ts-sharetribe-flex-sdk.js.LICENSE.txt +701 -0
  8. package/dist/ts-sharetribe-flex-sdk.js.map +1 -0
  9. package/dist/ts-sharetribe-flex-sdk.mjs +3 -0
  10. package/dist/ts-sharetribe-flex-sdk.mjs.LICENSE.txt +701 -0
  11. package/dist/ts-sharetribe-flex-sdk.mjs.map +1 -0
  12. package/dist/types/endpoints/assets/index.d.ts +62 -0
  13. package/dist/types/endpoints/assets/index.d.ts.map +1 -0
  14. package/dist/types/endpoints/auth/index.d.ts +59 -0
  15. package/dist/types/endpoints/auth/index.d.ts.map +1 -0
  16. package/dist/types/endpoints/integrationApi/AvailabilityExceptions.d.ts +86 -0
  17. package/dist/types/endpoints/integrationApi/AvailabilityExceptions.d.ts.map +1 -0
  18. package/dist/types/endpoints/integrationApi/Events.d.ts +48 -0
  19. package/dist/types/endpoints/integrationApi/Events.d.ts.map +1 -0
  20. package/dist/types/endpoints/integrationApi/Images.d.ts +48 -0
  21. package/dist/types/endpoints/integrationApi/Images.d.ts.map +1 -0
  22. package/dist/types/endpoints/integrationApi/Listings.d.ts +150 -0
  23. package/dist/types/endpoints/integrationApi/Listings.d.ts.map +1 -0
  24. package/dist/types/endpoints/integrationApi/Marketplace.d.ts +39 -0
  25. package/dist/types/endpoints/integrationApi/Marketplace.d.ts.map +1 -0
  26. package/dist/types/endpoints/integrationApi/Stock.d.ts +48 -0
  27. package/dist/types/endpoints/integrationApi/Stock.d.ts.map +1 -0
  28. package/dist/types/endpoints/integrationApi/StockAdjustments.d.ts +65 -0
  29. package/dist/types/endpoints/integrationApi/StockAdjustments.d.ts.map +1 -0
  30. package/dist/types/endpoints/integrationApi/StockReservation.d.ts +43 -0
  31. package/dist/types/endpoints/integrationApi/StockReservation.d.ts.map +1 -0
  32. package/dist/types/endpoints/integrationApi/Transactions.d.ts +121 -0
  33. package/dist/types/endpoints/integrationApi/Transactions.d.ts.map +1 -0
  34. package/dist/types/endpoints/integrationApi/Users.d.ts +108 -0
  35. package/dist/types/endpoints/integrationApi/Users.d.ts.map +1 -0
  36. package/dist/types/endpoints/integrationApi/index.d.ts +59 -0
  37. package/dist/types/endpoints/integrationApi/index.d.ts.map +1 -0
  38. package/dist/types/endpoints/marketplace/AvailabilityExceptions.d.ts +84 -0
  39. package/dist/types/endpoints/marketplace/AvailabilityExceptions.d.ts.map +1 -0
  40. package/dist/types/endpoints/marketplace/Bookings.d.ts +45 -0
  41. package/dist/types/endpoints/marketplace/Bookings.d.ts.map +1 -0
  42. package/dist/types/endpoints/marketplace/CurrentUser.d.ts +182 -0
  43. package/dist/types/endpoints/marketplace/CurrentUser.d.ts.map +1 -0
  44. package/dist/types/endpoints/marketplace/Images.d.ts +47 -0
  45. package/dist/types/endpoints/marketplace/Images.d.ts.map +1 -0
  46. package/dist/types/endpoints/marketplace/Listings.d.ts +52 -0
  47. package/dist/types/endpoints/marketplace/Listings.d.ts.map +1 -0
  48. package/dist/types/endpoints/marketplace/Marketplace.d.ts +38 -0
  49. package/dist/types/endpoints/marketplace/Marketplace.d.ts.map +1 -0
  50. package/dist/types/endpoints/marketplace/Messages.d.ts +57 -0
  51. package/dist/types/endpoints/marketplace/Messages.d.ts.map +1 -0
  52. package/dist/types/endpoints/marketplace/OwnListings.d.ts +181 -0
  53. package/dist/types/endpoints/marketplace/OwnListings.d.ts.map +1 -0
  54. package/dist/types/endpoints/marketplace/PasswordReset.d.ts +63 -0
  55. package/dist/types/endpoints/marketplace/PasswordReset.d.ts.map +1 -0
  56. package/dist/types/endpoints/marketplace/ProcessTransitions.d.ts +43 -0
  57. package/dist/types/endpoints/marketplace/ProcessTransitions.d.ts.map +1 -0
  58. package/dist/types/endpoints/marketplace/Reviews.d.ts +52 -0
  59. package/dist/types/endpoints/marketplace/Reviews.d.ts.map +1 -0
  60. package/dist/types/endpoints/marketplace/Stock.d.ts +47 -0
  61. package/dist/types/endpoints/marketplace/Stock.d.ts.map +1 -0
  62. package/dist/types/endpoints/marketplace/StockAdjustments.d.ts +63 -0
  63. package/dist/types/endpoints/marketplace/StockAdjustments.d.ts.map +1 -0
  64. package/dist/types/endpoints/marketplace/StripeAccount.d.ts +78 -0
  65. package/dist/types/endpoints/marketplace/StripeAccount.d.ts.map +1 -0
  66. package/dist/types/endpoints/marketplace/StripeAccountLinks.d.ts +52 -0
  67. package/dist/types/endpoints/marketplace/StripeAccountLinks.d.ts.map +1 -0
  68. package/dist/types/endpoints/marketplace/StripeCustomer.d.ts +77 -0
  69. package/dist/types/endpoints/marketplace/StripeCustomer.d.ts.map +1 -0
  70. package/dist/types/endpoints/marketplace/StripePersons.d.ts +46 -0
  71. package/dist/types/endpoints/marketplace/StripePersons.d.ts.map +1 -0
  72. package/dist/types/endpoints/marketplace/StripeSetupIntents.d.ts +43 -0
  73. package/dist/types/endpoints/marketplace/StripeSetupIntents.d.ts.map +1 -0
  74. package/dist/types/endpoints/marketplace/TimeSlots.d.ts +44 -0
  75. package/dist/types/endpoints/marketplace/TimeSlots.d.ts.map +1 -0
  76. package/dist/types/endpoints/marketplace/Transactions.d.ts +126 -0
  77. package/dist/types/endpoints/marketplace/Transactions.d.ts.map +1 -0
  78. package/dist/types/endpoints/marketplace/Users.d.ts +42 -0
  79. package/dist/types/endpoints/marketplace/Users.d.ts.map +1 -0
  80. package/dist/types/endpoints/marketplace/index.d.ts +71 -0
  81. package/dist/types/endpoints/marketplace/index.d.ts.map +1 -0
  82. package/dist/types/index.d.ts +143 -0
  83. package/dist/types/index.d.ts.map +1 -0
  84. package/dist/types/integrationSdk.d.ts +121 -0
  85. package/dist/types/integrationSdk.d.ts.map +1 -0
  86. package/dist/types/sdk.d.ts +213 -0
  87. package/dist/types/sdk.d.ts.map +1 -0
  88. package/dist/types/sdkTypes/BigDecimal.d.ts +31 -0
  89. package/dist/types/sdkTypes/BigDecimal.d.ts.map +1 -0
  90. package/dist/types/sdkTypes/LatLng.d.ts +35 -0
  91. package/dist/types/sdkTypes/LatLng.d.ts.map +1 -0
  92. package/dist/types/sdkTypes/LatLngBounds.d.ts +52 -0
  93. package/dist/types/sdkTypes/LatLngBounds.d.ts.map +1 -0
  94. package/dist/types/sdkTypes/Money.d.ts +29 -0
  95. package/dist/types/sdkTypes/Money.d.ts.map +1 -0
  96. package/dist/types/sdkTypes/UUID.d.ts +39 -0
  97. package/dist/types/sdkTypes/UUID.d.ts.map +1 -0
  98. package/dist/types/types/apiConfigs.d.ts +105 -0
  99. package/dist/types/types/apiConfigs.d.ts.map +1 -0
  100. package/dist/types/types/assets/index.d.ts +64 -0
  101. package/dist/types/types/assets/index.d.ts.map +1 -0
  102. package/dist/types/types/authentication/index.d.ts +102 -0
  103. package/dist/types/types/authentication/index.d.ts.map +1 -0
  104. package/dist/types/types/axios.d.ts +11 -0
  105. package/dist/types/types/axios.d.ts.map +1 -0
  106. package/dist/types/types/config.d.ts +138 -0
  107. package/dist/types/types/config.d.ts.map +1 -0
  108. package/dist/types/types/integration/events.d.ts +56 -0
  109. package/dist/types/types/integration/events.d.ts.map +1 -0
  110. package/dist/types/types/marketplace/availabilityExceptions.d.ts +57 -0
  111. package/dist/types/types/marketplace/availabilityExceptions.d.ts.map +1 -0
  112. package/dist/types/types/marketplace/bookings.d.ts +47 -0
  113. package/dist/types/types/marketplace/bookings.d.ts.map +1 -0
  114. package/dist/types/types/marketplace/currentUser.d.ts +159 -0
  115. package/dist/types/types/marketplace/currentUser.d.ts.map +1 -0
  116. package/dist/types/types/marketplace/images.d.ts +40 -0
  117. package/dist/types/types/marketplace/images.d.ts.map +1 -0
  118. package/dist/types/types/marketplace/listings.d.ts +140 -0
  119. package/dist/types/types/marketplace/listings.d.ts.map +1 -0
  120. package/dist/types/types/marketplace/marketplace.d.ts +21 -0
  121. package/dist/types/types/marketplace/marketplace.d.ts.map +1 -0
  122. package/dist/types/types/marketplace/messages.d.ts +50 -0
  123. package/dist/types/types/marketplace/messages.d.ts.map +1 -0
  124. package/dist/types/types/marketplace/ownListings.d.ts +129 -0
  125. package/dist/types/types/marketplace/ownListings.d.ts.map +1 -0
  126. package/dist/types/types/marketplace/passwordReset.d.ts +32 -0
  127. package/dist/types/types/marketplace/passwordReset.d.ts.map +1 -0
  128. package/dist/types/types/marketplace/processTransitions.d.ts +38 -0
  129. package/dist/types/types/marketplace/processTransitions.d.ts.map +1 -0
  130. package/dist/types/types/marketplace/reviews.d.ts +60 -0
  131. package/dist/types/types/marketplace/reviews.d.ts.map +1 -0
  132. package/dist/types/types/marketplace/stock.d.ts +29 -0
  133. package/dist/types/types/marketplace/stock.d.ts.map +1 -0
  134. package/dist/types/types/marketplace/stockAdjustment.d.ts +52 -0
  135. package/dist/types/types/marketplace/stockAdjustment.d.ts.map +1 -0
  136. package/dist/types/types/marketplace/stockReservations.d.ts +45 -0
  137. package/dist/types/types/marketplace/stockReservations.d.ts.map +1 -0
  138. package/dist/types/types/marketplace/stripeAccount.d.ts +45 -0
  139. package/dist/types/types/marketplace/stripeAccount.d.ts.map +1 -0
  140. package/dist/types/types/marketplace/stripeAccountLinks.d.ts +36 -0
  141. package/dist/types/types/marketplace/stripeAccountLinks.d.ts.map +1 -0
  142. package/dist/types/types/marketplace/stripeCustomer.d.ts +48 -0
  143. package/dist/types/types/marketplace/stripeCustomer.d.ts.map +1 -0
  144. package/dist/types/types/marketplace/stripePaymentMethod.d.ts +23 -0
  145. package/dist/types/types/marketplace/stripePaymentMethod.d.ts.map +1 -0
  146. package/dist/types/types/marketplace/stripePersons.d.ts +47 -0
  147. package/dist/types/types/marketplace/stripePersons.d.ts.map +1 -0
  148. package/dist/types/types/marketplace/stripeSetupIntents.d.ts +47 -0
  149. package/dist/types/types/marketplace/stripeSetupIntents.d.ts.map +1 -0
  150. package/dist/types/types/marketplace/timeSlots.d.ts +54 -0
  151. package/dist/types/types/marketplace/timeSlots.d.ts.map +1 -0
  152. package/dist/types/types/marketplace/transactions.d.ts +191 -0
  153. package/dist/types/types/marketplace/transactions.d.ts.map +1 -0
  154. package/dist/types/types/marketplace/user.d.ts +166 -0
  155. package/dist/types/types/marketplace/user.d.ts.map +1 -0
  156. package/dist/types/types/sdk-types.d.ts +11 -0
  157. package/dist/types/types/sdk-types.d.ts.map +1 -0
  158. package/dist/types/types/sharetribe.d.ts +177 -0
  159. package/dist/types/types/sharetribe.d.ts.map +1 -0
  160. package/dist/types/types/store.d.ts +34 -0
  161. package/dist/types/types/store.d.ts.map +1 -0
  162. package/dist/types/utils/apis.d.ts +9 -0
  163. package/dist/types/utils/apis.d.ts.map +1 -0
  164. package/dist/types/utils/config.d.ts +16 -0
  165. package/dist/types/utils/config.d.ts.map +1 -0
  166. package/dist/types/utils/convert-types.d.ts +14 -0
  167. package/dist/types/utils/convert-types.d.ts.map +1 -0
  168. package/dist/types/utils/parameter-serializer.d.ts +24 -0
  169. package/dist/types/utils/parameter-serializer.d.ts.map +1 -0
  170. package/dist/types/utils/prepare-axios-instance.d.ts +14 -0
  171. package/dist/types/utils/prepare-axios-instance.d.ts.map +1 -0
  172. package/dist/types/utils/stores/BrowserStore.d.ts +39 -0
  173. package/dist/types/utils/stores/BrowserStore.d.ts.map +1 -0
  174. package/dist/types/utils/stores/ExpressStore.d.ts +50 -0
  175. package/dist/types/utils/stores/ExpressStore.d.ts.map +1 -0
  176. package/dist/types/utils/stores/MemoryStore.d.ts +25 -0
  177. package/dist/types/utils/stores/MemoryStore.d.ts.map +1 -0
  178. package/dist/types/utils/stores/store.d.ts +9 -0
  179. package/dist/types/utils/stores/store.d.ts.map +1 -0
  180. package/dist/types/utils/transit.d.ts +30 -0
  181. package/dist/types/utils/transit.d.ts.map +1 -0
  182. package/dist/types/utils/util.d.ts +13 -0
  183. package/dist/types/utils/util.d.ts.map +1 -0
  184. package/package.json +90 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transactions.d.ts","sourceRoot":"","sources":["../../../../src/types/marketplace/transactions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,KAAK,EACL,YAAY,EACZ,mBAAmB,EACnB,IAAI,EACL,MAAM,eAAe,CAAC;AAEvB;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAC7B,MAAM,GACN,OAAO,GACP,UAAU,GACV,qBAAqB,GACrB,YAAY,GACZ,uBAAuB,GACvB,gBAAgB,CAAC;AAErB;;GAEG;AACH,MAAM,MAAM,+BAA+B,GACvC,aAAa,GACb,SAAS,GACT,qBAAqB,GACrB,gBAAgB,GAChB,gBAAgB,GAChB,sBAAsB,GACtB,UAAU,GACV,uBAAuB,GACvB,wBAAwB,GACxB,iCAAiC,GACjC,UAAU,GACV,uBAAuB,GACvB,wBAAwB,GACxB,iCAAiC,GACjC,SAAS,GACT,kBAAkB,GAClB,SAAS,GACT,gBAAgB,GAChB,iBAAiB,GACjB,UAAU,GACV,iBAAiB,CAAC;AAEtB;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,UAAU,GAAG,UAAU,CAAC;AAE1D;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,OAAO,CAAC;AAEnD;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,KAAK,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC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,CAAC,CAAC,GAChD,KAAK,GACP,KAAK,CAAC;AAEZ,KAAK,gBAAgB,CAAC,CAAC,SAAS,wBAAwB,EAAE,EAAE,IAAI,EAAE,SAAS;IACzE,MAAM,EAAE,IAAI,CAAC;CACd,GACG,eAAe,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,GACpC,EAAE,SAAS;IAAE,MAAM,EAAE,KAAK,CAAA;CAAE,GAC5B,IAAI,CAAC,eAAe,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,GACxD,IAAI,CAAC,eAAe,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC;AAE7D;;GAEG;AACH,KAAK,QAAQ,CACX,CAAC,SAAS,qBAAqB,EAC/B,CAAC,SAAS,wBAAwB,EAClC,EAAE,SAAS,kBAAkB,GAAG,SAAS,IACvC,CAAC,SAAS,MAAM,GAChB,eAAe,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,GACpC,CAAC,SAAS,OAAO,GACjB,eAAe,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,EAAE,GACtC,CAAC,SAAS,YAAY,GACtB,gBAAgB,CAAC,CAAC,EAAE,EAAE,CAAC,GACvB,KAAK,CAAC;AAEV;;GAEG;AACH,MAAM,MAAM,oBAAoB,CAC9B,CAAC,SAAS,qBAAqB,EAC/B,CAAC,SAAS,wBAAwB,EAClC,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,CAAC"}
@@ -0,0 +1,166 @@
1
+ /**
2
+ * @fileoverview Type definitions for Users in the Sharetribe Marketplace API.
3
+ * This file defines the structure of users, their parameters, and response types for API requests.
4
+ */
5
+ import { ApiMeta, ApiParameter, ExtraParameter, ExtraParameterType, QueryMeta, QueryPriv, QueryProt, QueryPub, Relationship, RelationshipTypeMap, UUID } from "../sharetribe";
6
+ /**
7
+ * Available endpoints for the Users API.
8
+ */
9
+ export type UsersEndpoints = "show" | "query" | "updateProfile" | "approve" | "updatePermissions";
10
+ /**
11
+ * Fields available for relationships in users.
12
+ */
13
+ export type UsersRelationshipsFields = "marketplace" | "profileImage" | "stripeAccount" | "effectivePermissionSet";
14
+ /**
15
+ * Possible states for a user.
16
+ */
17
+ export type UserState = "active" | "banned" | "pendingApproval";
18
+ /**
19
+ * Permission levels for user actions.
20
+ */
21
+ export type Permissions = "permission/allow" | "permission/deny";
22
+ /**
23
+ * Defines the structure of a user.
24
+ */
25
+ export interface User<I extends boolean = false> {
26
+ id: UUID;
27
+ type: "user";
28
+ attributes: UserAttributes<I>;
29
+ }
30
+ type UserAttributes<I extends boolean> = {
31
+ banned: boolean;
32
+ deleted: boolean;
33
+ createdAt: Date;
34
+ profile: UserAttributesProfile<I>;
35
+ } & (I extends true ? {
36
+ state: UserState;
37
+ email: string;
38
+ emailVerified: boolean;
39
+ pendingEmail: string | null;
40
+ stripeConnected: boolean;
41
+ identityProviders: {
42
+ idpId: string;
43
+ userId: string;
44
+ }[];
45
+ } : {});
46
+ type UserAttributesProfile<I extends boolean> = {
47
+ displayName: string;
48
+ abbreviatedName: string;
49
+ bio: string;
50
+ publicData: UserCustomProfilePublicData;
51
+ metadata: UserCustomProfileMetadata;
52
+ } & (I extends true ? {
53
+ firstName: string;
54
+ lastName: string;
55
+ protectedData: UserCustomProfileProtectedData;
56
+ privateData: UserCustomProfilePrivateData;
57
+ permissions: {
58
+ postListings: Permissions;
59
+ initiateTransactions: Permissions;
60
+ read: Permissions;
61
+ };
62
+ } : {});
63
+ /**
64
+ * User with additional relationship information.
65
+ */
66
+ export interface UserWithRelationships<I extends boolean = false> extends User<I> {
67
+ relationships: {
68
+ marketplace: Relationship<false, "marketplace">;
69
+ profileImage: Relationship<false, "profileImage">;
70
+ };
71
+ }
72
+ export type UserType<R extends boolean, I extends boolean = false> = R extends true ? UserWithRelationships<I> : User<I>;
73
+ /**
74
+ * Base parameters for Users API requests.
75
+ */
76
+ export interface UsersParameter extends ApiParameter {
77
+ include?: UsersRelationshipsFields[];
78
+ }
79
+ /**
80
+ * Parameters for fetching a specific user.
81
+ */
82
+ export type UsersShowParameter<I extends boolean = false> = {
83
+ id: UUID | string;
84
+ } & UsersParameter & (I extends false ? {
85
+ id: UUID | string;
86
+ } : {
87
+ id?: UUID | string;
88
+ email?: string;
89
+ });
90
+ /**
91
+ * Parameters for querying users.
92
+ */
93
+ export interface UsersQueryParameter extends UsersParameter {
94
+ createdAtStart?: Date | string;
95
+ createdAtEnd?: Date | string;
96
+ [keyof: QueryPub]: string;
97
+ [keyof: QueryMeta]: string;
98
+ [keyof: QueryPriv]: string;
99
+ [keyof: QueryProt]: string;
100
+ sort?: string;
101
+ }
102
+ /**
103
+ * Parameters for updating a user's profile.
104
+ */
105
+ export interface UsersUpdateProfileParameter extends UsersParameter {
106
+ id: UUID | string;
107
+ firstName?: string;
108
+ lastName?: string;
109
+ displayName?: string;
110
+ bio?: string;
111
+ publicData?: UserCustomProfilePublicData;
112
+ protectedData?: UserCustomProfileProtectedData;
113
+ privateData?: UserCustomProfilePrivateData;
114
+ metadata?: UserCustomProfileMetadata;
115
+ profileImageId?: UUID | string;
116
+ }
117
+ /**
118
+ * Parameters for approving a user.
119
+ */
120
+ export interface UsersApproveParameter extends UsersParameter {
121
+ id: UUID | string;
122
+ }
123
+ /**
124
+ * Parameters for updating a user's permissions.
125
+ */
126
+ export interface UsersUpdatePermissionsParameter extends UsersParameter {
127
+ id: UUID | string;
128
+ postListings?: Permissions;
129
+ initiateTransactions?: Permissions;
130
+ read?: Permissions;
131
+ }
132
+ /**
133
+ * Custom data types for user profiles.
134
+ */
135
+ export interface UserCustomProfilePublicData {
136
+ }
137
+ export interface UserCustomProfileProtectedData {
138
+ }
139
+ export interface UserCustomProfilePrivateData {
140
+ }
141
+ export interface UserCustomProfileMetadata {
142
+ }
143
+ type AllUsersParameter = UsersShowParameter | UsersQueryParameter | UsersUpdateProfileParameter | UsersApproveParameter | UsersUpdatePermissionsParameter;
144
+ type UsersType<P extends AllUsersParameter> = "include" extends keyof P ? P["include"] extends UsersRelationshipsFields[] ? true : false : false;
145
+ type IncludedType<P extends AllUsersParameter, I extends boolean> = "include" extends keyof P ? P["include"] extends (keyof RelationshipTypeMap<I>)[] ? Array<RelationshipTypeMap<I>[P["include"][number]]> : never : never;
146
+ type ExpandReturnType<P extends AllUsersParameter, EP> = EP extends {
147
+ expand: true;
148
+ } ? UserType<UsersType<P>> : EP extends {
149
+ expand: false;
150
+ } ? Omit<UserType<UsersType<P>>, "attributes"> : Omit<UserType<UsersType<P>>, "attributes">;
151
+ /**
152
+ * Defines the data type based on the Users API endpoint and parameters.
153
+ */
154
+ type DataType<E extends UsersEndpoints, P extends AllUsersParameter, EP extends ExtraParameter | undefined, I extends boolean = false> = (E extends "show" ? UserType<UsersType<P>, I> : never) | (E extends "query" ? UserType<UsersType<P>, I>[] : never) | (E extends "updateProfile" | "approve" | "updatePermissions" ? ExpandReturnType<P, EP> : never);
155
+ /**
156
+ * Response structure for Users API calls.
157
+ */
158
+ export type UsersResponse<E extends UsersEndpoints, P extends AllUsersParameter, EP extends ExtraParameterType = undefined, I extends boolean = false> = {
159
+ data: DataType<E, P, EP, I>;
160
+ } & ("include" extends keyof P ? {
161
+ included: IncludedType<P, I>;
162
+ } : {}) & (E extends "query" ? {
163
+ meta: ApiMeta;
164
+ } : {});
165
+ export {};
166
+ //# sourceMappingURL=user.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../../../src/types/marketplace/user.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,OAAO,EACP,YAAY,EACZ,cAAc,EACd,kBAAkB,EACl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G,SAAS,EACrC,CAAC,SAAS,OAAO,GAAG,KAAK,IAEvB,CAAC,CAAC,SAAS,MAAM,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,KAAK,CAAC,GACtD,CAAC,CAAC,SAAS,OAAO,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,CAAC,GACzD,CAAC,CAAC,SAAS,eAAe,GAAG,SAAS,GAAG,mBAAmB,GACxD,gBAAgB,CAAC,CAAC,EAAE,EAAE,CAAC,GACvB,KAAK,CAAC,CAAC;AAEf;;GAEG;AACH,MAAM,MAAM,aAAa,CACvB,CAAC,SAAS,cAAc,EACxB,CAAC,SAAS,iBAAiB,EAC3B,EAAE,SAAS,kBAAkB,GAAG,SAAS,EACzC,CAAC,SAAS,OAAO,GAAG,KAAK,IACvB;IACF,IAAI,EAAE,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;CAC7B,GAAG,CAAC,SAAS,SAAS,MAAM,CAAC,GAAG;IAAE,QAAQ,EAAE,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;CAAE,GAAG,EAAE,CAAC,GACrE,CAAC,CAAC,SAAS,OAAO,GAAG;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,GAAG,EAAE,CAAC,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Base interface for all SDK type classes.
3
+ * Implementing this interface helps preserve class names during bundling.
4
+ */
5
+ export interface SdkType {
6
+ /**
7
+ * Type identifier for SDK type classes.
8
+ */
9
+ readonly _sdkType: string;
10
+ }
11
+ //# sourceMappingURL=sdk-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sdk-types.d.ts","sourceRoot":"","sources":["../../../src/types/sdk-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,OAAO;IACtB;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B"}
@@ -0,0 +1,177 @@
1
+ import UUIDClass from "../sdkTypes/UUID";
2
+ import { User } from "./marketplace/user";
3
+ import { Booking } from "./marketplace/bookings";
4
+ import { Stock } from "./marketplace/stock";
5
+ import { StripePaymentMethod } from "./marketplace/stripePaymentMethod";
6
+ import { Image } from "./marketplace/images";
7
+ import { Listing } from "./marketplace/listings";
8
+ import Marketplace from "../endpoints/marketplace";
9
+ import { Message } from "./marketplace/messages";
10
+ import { OwnListing } from "./marketplace/ownListings";
11
+ import { Review } from "./marketplace/reviews";
12
+ import { StockReservation } from "./marketplace/stockReservations";
13
+ import { StripeAccount } from "./marketplace/stripeAccount";
14
+ import { StripeCustomer } from "./marketplace/stripeCustomer";
15
+ import { Transaction } from "./marketplace/transactions";
16
+ import { CurrentUserPermissionSet } from "./marketplace/currentUser";
17
+ /**
18
+ * A mapping of relationship types to their corresponding entities.
19
+ */
20
+ export type RelationshipTypeMap<I extends boolean = false> = {
21
+ author: User<I>;
22
+ "author.marketplace": Marketplace;
23
+ "author.profileImage": Image;
24
+ "author.stripeAccount": StripeAccount;
25
+ "author.effectivePermissionSet": CurrentUserPermissionSet;
26
+ booking: Booking;
27
+ "booking.transaction": Transaction;
28
+ currentStock: Stock;
29
+ customer: User<I>;
30
+ "customer.marketplace": Marketplace;
31
+ "customer.profileImage": Image;
32
+ "customer.stripeAccount": StripeAccount;
33
+ "customer.effectivePermissionSet": CurrentUserPermissionSet;
34
+ defaultPaymentMethod: StripePaymentMethod;
35
+ images: Image;
36
+ listing: Listing<I>;
37
+ "listing.marketplace": Marketplace;
38
+ "listing.author": User<I>;
39
+ "listing.images": Image;
40
+ "listing.currentStock": Stock;
41
+ marketplace: Marketplace;
42
+ messages: Message;
43
+ "messages.sender": User<I>;
44
+ "messages.transaction": Transaction;
45
+ ownListing: OwnListing;
46
+ "ownListing.marketplace": Marketplace;
47
+ "ownListing.author": User<I>;
48
+ "ownListing.images": Image;
49
+ "ownListing.currentStock": Stock;
50
+ profileImage: Image;
51
+ provider: User<I>;
52
+ "provider.marketplace": Marketplace;
53
+ "provider.profileImage": Image;
54
+ "provider.stripeAccount": StripeAccount;
55
+ "provider.effectivePermissionSet": CurrentUserPermissionSet;
56
+ reviews: Review;
57
+ "reviews.author": User<I>;
58
+ "reviews.listing": Listing<I>;
59
+ "reviews.subject": User<I>;
60
+ sender: User<I>;
61
+ "sender.marketplace": Marketplace;
62
+ "sender.profileImage": Image;
63
+ "sender.stripeAccount": StripeAccount;
64
+ "sender.effectivePermissionSet": CurrentUserPermissionSet;
65
+ stockReservation: StockReservation;
66
+ "stockReservation.transaction": Transaction;
67
+ stripeAccount: StripeAccount;
68
+ stripeCustomer: StripeCustomer;
69
+ "stripeCustomer.defaultPaymentMethod": StripePaymentMethod;
70
+ subject: User<I>;
71
+ "subject.marketplace": Marketplace;
72
+ "subject.profileImage": Image;
73
+ "subject.stripeAccount": StripeAccount;
74
+ "subject.effectivePermissionSet": CurrentUserPermissionSet;
75
+ transaction: Transaction;
76
+ "transaction.marketplace": Marketplace;
77
+ "transaction.listing": Listing<I>;
78
+ "transaction.provider": User<I>;
79
+ "transaction.customer": User<I>;
80
+ "transaction.booking": Booking;
81
+ "transaction.stockReservation": StockReservation;
82
+ };
83
+ /**
84
+ * Represents an API error returned by the backend.
85
+ */
86
+ export type ApiError = {
87
+ data: {
88
+ id: string;
89
+ status: number;
90
+ code: string;
91
+ title: string;
92
+ details?: string;
93
+ source?: {
94
+ path: string[];
95
+ type: string;
96
+ };
97
+ };
98
+ };
99
+ /**
100
+ * Represents a universally unique identifier (UUID).
101
+ */
102
+ export type UUID = InstanceType<typeof UUIDClass>;
103
+ /**
104
+ * Metadata for paginated API responses.
105
+ */
106
+ export type ApiMeta = {
107
+ totalItems: number;
108
+ totalPages: number;
109
+ page: number;
110
+ paginationLimit: number;
111
+ perPage: number;
112
+ };
113
+ /**
114
+ * Represents a relationship to another entity in the API.
115
+ */
116
+ export type Relationship<A extends boolean, T extends string> = {
117
+ data: A extends true ? {
118
+ id: UUID;
119
+ type: T;
120
+ }[] : {
121
+ id: UUID;
122
+ type: T;
123
+ };
124
+ };
125
+ /**
126
+ * Types for query fields, limits, and image variants.
127
+ */
128
+ export type QueryFields = `fields.${string}`;
129
+ export type QueryLimit = `limit.${string}`;
130
+ export type ImageVariant = `imageVariant.${string}`;
131
+ /**
132
+ * Extra parameter to expand or contract API responses.
133
+ */
134
+ export interface ExtraParameter {
135
+ expand?: boolean;
136
+ }
137
+ /**
138
+ * Generic parameters used in API requests.
139
+ */
140
+ export interface ApiParameter {
141
+ [keyof: QueryFields]: string[] | never;
142
+ [keyof: QueryLimit]: number | never;
143
+ [keyof: ImageVariant]: string | never;
144
+ }
145
+ /**
146
+ * Represents a generic API response, optionally containing errors and metadata.
147
+ */
148
+ export interface ApiResponse {
149
+ errors?: ApiError[];
150
+ meta?: ApiMeta;
151
+ }
152
+ /**
153
+ * Represents a latitude/longitude coordinate.
154
+ */
155
+ export type LatLng = {
156
+ lat: number;
157
+ lng: number;
158
+ };
159
+ /**
160
+ * Query types for public, metadata, private, and protected data.
161
+ */
162
+ export type QueryPub = `pub_${string}`;
163
+ export type QueryMeta = `meta_${string}`;
164
+ export type QueryPriv = `priv_${string}`;
165
+ export type QueryProt = `prot_${string}`;
166
+ /**
167
+ * Additional parameters for API requests.
168
+ */
169
+ export type ExtraParameterType = ExtraParameter | undefined;
170
+ /**
171
+ * Represents a monetary value.
172
+ */
173
+ export type Money = {
174
+ amount: number;
175
+ currency: string;
176
+ };
177
+ //# sourceMappingURL=sharetribe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sharetribe.d.ts","sourceRoot":"","sources":["../../../src/types/sharetribe.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,w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,kBAAkB,GAAG,cAAc,GAAG,SAAS,CAAC;AAE5D;;GAEG;AACH,MAAM,MAAM,KAAK,GAAG;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC"}
@@ -0,0 +1,34 @@
1
+ import { AuthToken } from "./authentication";
2
+ /**
3
+ * Represents the possible scopes for authentication tokens.
4
+ */
5
+ type Scope = "public-read" | "trusted:user" | "user" | "integ";
6
+ /**
7
+ * Interface for managing authentication tokens in a store.
8
+ */
9
+ export interface TokenStore {
10
+ token?: AuthToken | null;
11
+ expiration?: number;
12
+ /**
13
+ * Retrieves the current authentication token.
14
+ * @returns A promise resolving to the current token or null if no token exists.
15
+ */
16
+ getToken: () => AuthToken | null;
17
+ /**
18
+ * Sets a new authentication token.
19
+ * @param args - Object containing the token's details.
20
+ */
21
+ setToken: (args: {
22
+ access_token: string;
23
+ token_type: "bearer";
24
+ expires_in: number;
25
+ scope?: Scope;
26
+ refresh_token?: string;
27
+ }) => void;
28
+ /**
29
+ * Removes the current authentication token.
30
+ */
31
+ removeToken: () => void;
32
+ }
33
+ export {};
34
+ //# sourceMappingURL=store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/types/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C;;GAEG;AACH,KAAK,KAAK,GAAG,aAAa,GAAG,cAAc,GAAG,MAAM,GAAG,OAAO,CAAC;AAE/D;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,QAAQ,EAAE,MAAM,SAAS,GAAG,IAAI,CAAC;IAEjC;;;OAGG;IACH,QAAQ,EAAE,CAAC,IAAI,EAAE;QACf,YAAY,EAAE,MAAM,CAAC;QACrB,UAAU,EAAE,QAAQ,CAAC;QACrB,UAAU,EAAE,MAAM,CAAC;QACnB,KAAK,CAAC,EAAE,KAAK,CAAC;QACd,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB,KAAK,IAAI,CAAC;IAEX;;OAEG;IACH,WAAW,EAAE,MAAM,IAAI,CAAC;CACzB"}
@@ -0,0 +1,9 @@
1
+ import { ApiConfigs } from "../types/apiConfigs";
2
+ /**
3
+ * Creates API configurations for the SDK.
4
+ *
5
+ * @param isIntegrationSdk - Determines whether the configuration is for the Integration SDK (default: false).
6
+ * @returns An object containing API configurations for the standard SDK or Integration SDK.
7
+ */
8
+ export declare const createApisConfigs: <I extends boolean = false>(isIntegrationSdk?: I) => ApiConfigs<I>;
9
+ //# sourceMappingURL=apis.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apis.d.ts","sourceRoot":"","sources":["../../../src/utils/apis.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,GAAI,CAAC,SAAS,OAAO,6BAC/B,CAAC,KAClB,UAAU,CAAC,CAAC,CA0Cd,CAAC"}
@@ -0,0 +1,16 @@
1
+ import MemoryStore from "./stores/MemoryStore";
2
+ import { TypeHandler } from "../types/config";
3
+ type DefaultSdkConfigType = {
4
+ baseUrl: string;
5
+ assetCdnBaseUrl: string;
6
+ version: string;
7
+ transitVerbose: boolean;
8
+ tokenStore: MemoryStore;
9
+ typeHandlers: TypeHandler[];
10
+ };
11
+ /**
12
+ * Default SDK configuration object for the Sharetribe Flex API.
13
+ */
14
+ export declare const DefaultSdkConfig: DefaultSdkConfigType;
15
+ export {};
16
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/utils/config.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG9C,KAAK,oBAAoB,GAAG;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,OAAO,CAAC;IACxB,UAAU,EAAE,WAAW,CAAC;IACxB,YAAY,EAAE,WAAW,EAAE,CAAC;CAC7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,oBAO9B,CAAC"}
@@ -0,0 +1,14 @@
1
+ import Money from "../sdkTypes/Money";
2
+ import LatLng from "../sdkTypes/LatLng";
3
+ import LatLngBounds from "../sdkTypes/LatLngBounds";
4
+ import UUID from "../sdkTypes/UUID";
5
+ import BigDecimal from "../sdkTypes/BigDecimal";
6
+ /**
7
+ * Converts a value based on its `_sdkType` property to the appropriate SDK type.
8
+ * @param {*} value - The value to convert.
9
+ * @returns {*} The converted value or the original value if no conversion is needed.
10
+ */
11
+ export declare function toSdkTypes(value: any): LatLng | LatLngBounds | UUID | Money | BigDecimal | any;
12
+ export declare const replacer: (key: string, value: any) => any;
13
+ export declare const reviver: (key: string, value: any) => any;
14
+ //# sourceMappingURL=convert-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convert-types.d.ts","sourceRoot":"","sources":["../../../src/utils/convert-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,mBAAmB,CAAC;AACtC,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,YAAY,MAAM,0BAA0B,CAAC;AACpD,OAAO,IAAI,MAAM,kBAAkB,CAAC;AACpC,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAEhD;;;;GAIG;AACH,wBAAgB,UAAU,CACxB,KAAK,EAAE,GAAG,GACT,MAAM,GAAG,YAAY,GAAG,IAAI,GAAG,KAAK,GAAG,UAAU,GAAG,GAAG,CAiBzD;AAYD,eAAO,MAAM,QAAQ,QAAS,MAAM,SAAS,GAAG,QAAU,CAAC;AAK3D,eAAO,MAAM,OAAO,QAAS,MAAM,SAAS,GAAG,QAAsB,CAAC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Serializes a value into a string representation for URL query parameters.
3
+ *
4
+ * @param {*} value - The value to serialize. Supported types:
5
+ * - `UUID` instance: serialized as its `uuid` string.
6
+ * - `LatLng` instance: serialized as "lat,lng".
7
+ * - `LatLngBounds` instance: serialized as "ne.lat,ne.lng,sw.lat,sw.lng".
8
+ * - `Array`: serialized by recursively serializing each element.
9
+ * - `Date`: serialized as an ISO string.
10
+ * - Primitive types and `null`: returned as-is.
11
+ * @throws {Error} Will throw an error if the value type is unsupported.
12
+ * @returns {string|*} The serialized value.
13
+ */
14
+ export declare const serializeValue: (value: any) => any;
15
+ /**
16
+ * Serializes a record of parameters into a query string.
17
+ *
18
+ * @param {Record<string, any>} params - The parameters to serialize. Each value is serialized
19
+ * using the `serializeValue` function.
20
+ * @returns {string} A URL-encoded query string.
21
+ */
22
+ declare function parameterSerializer(params: Record<string, any>): string;
23
+ export default parameterSerializer;
24
+ //# sourceMappingURL=parameter-serializer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parameter-serializer.d.ts","sourceRoot":"","sources":["../../../src/utils/parameter-serializer.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,cAAc,UAAW,GAAG,QAsBxC,CAAC;AAEF;;;;;;GAMG;AACH,iBAAS,mBAAmB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAMhE;AAED,eAAe,mBAAmB,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { AxiosError, AxiosRequestConfig, AxiosResponse, InternalAxiosRequestConfig } from "axios";
2
+ import SharetribeSdk from "../sdk";
3
+ import IntegrationSdk from "../integrationSdk";
4
+ export declare const QUERY_PARAMETERS: string[];
5
+ export declare const isTokenUnauthorized: (status: number) => boolean;
6
+ export declare const isTokenExpired: (status: number) => boolean;
7
+ export declare const routeNeedsTrustedUser: (requestConfig: InternalAxiosRequestConfig, sdk: SharetribeSdk | IntegrationSdk) => boolean | undefined;
8
+ export declare const prepareAuthorizationHeader: (data: any) => string;
9
+ export declare function handleResponseSuccess(sdk: SharetribeSdk | IntegrationSdk): (response: AxiosResponse) => AxiosResponse;
10
+ export declare function handleResponseFailure(sdk: SharetribeSdk | IntegrationSdk, error: AxiosError | any): Promise<AxiosResponse<any, any>>;
11
+ export declare function handleRequestSuccess(sdk: SharetribeSdk | IntegrationSdk, requestConfig: InternalAxiosRequestConfig): Promise<InternalAxiosRequestConfig>;
12
+ export declare function createAxiosConfig(sdk: SharetribeSdk | IntegrationSdk, config: AxiosRequestConfig): AxiosRequestConfig<any>;
13
+ export declare function prepareAxiosInstance(sdk: SharetribeSdk | IntegrationSdk): void;
14
+ //# sourceMappingURL=prepare-axios-instance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prepare-axios-instance.d.ts","sourceRoot":"","sources":["../../../src/utils/prepare-axios-instance.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,kBAAkB,EAClB,aAAa,EACb,0BAA0B,EAC3B,MAAM,OAAO,CAAC;AAEf,OAAO,aAAa,MAAM,QAAQ,CAAC;AAEnC,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAG/C,eAAO,MAAM,gBAAgB,UAO5B,CAAC;AAiBF,eAAO,MAAM,mBAAmB,WAAY,MAAM,YAA2B,CAAC;AAC9E,eAAO,MAAM,cAAc,WAAY,MAAM,YAAgC,CAAC;AAC9E,eAAO,MAAM,qBAAqB,kBACjB,0BAA0B,OACpC,aAAa,GAAG,cAAc,wBAepC,CAAC;AAEF,eAAO,MAAM,0BAA0B,SAAU,GAAG,WACT,CAAC;AAG5C,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,aAAa,GAAG,cAAc,cACjC,aAAa,KAAG,aAAa,CAoBpE;AAED,wBAAsB,qBAAqB,CACzC,GAAG,EAAE,aAAa,GAAG,cAAc,EACnC,KAAK,EAAE,UAAU,GAAG,GAAG,oCAyCxB;AAED,wBAAsB,oBAAoB,CACxC,GAAG,EAAE,aAAa,GAAG,cAAc,EACnC,aAAa,EAAE,0BAA0B,GACxC,OAAO,CAAC,0BAA0B,CAAC,CAiFrC;AAED,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,aAAa,GAAG,cAAc,EACnC,MAAM,EAAE,kBAAkB,2BAY3B;AAGD,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,aAAa,GAAG,cAAc,QASvE"}
@@ -0,0 +1,39 @@
1
+ import { TokenStore } from "../../types/store";
2
+ import { AuthToken } from "../../types/authentication";
3
+ /**
4
+ * Configuration options for the `BrowserStore`.
5
+ */
6
+ export type BrowserStoreOptions = {
7
+ clientId: string;
8
+ secure?: boolean;
9
+ };
10
+ /**
11
+ * `BrowserStore` is an implementation of the `TokenStore` interface for storing authentication tokens in browser cookies.
12
+ */
13
+ declare class BrowserStore implements TokenStore {
14
+ expiration: number;
15
+ private namespace;
16
+ private readonly key;
17
+ private readonly secure;
18
+ /**
19
+ * Initializes the `BrowserStore` with client-specific options.
20
+ * @param options - Configuration options for the store.
21
+ */
22
+ constructor({ clientId, secure }: BrowserStoreOptions);
23
+ /**
24
+ * Retrieves the authentication token from browser cookies.
25
+ * @returns A promise that resolves to the `AuthToken` or null if no token exists.
26
+ */
27
+ getToken(): AuthToken | null;
28
+ /**
29
+ * Stores the authentication token in a browser cookie.
30
+ * @param token - The authentication token to store.
31
+ */
32
+ setToken(token: AuthToken): void;
33
+ /**
34
+ * Removes the authentication token from browser cookies.
35
+ */
36
+ removeToken(): void;
37
+ }
38
+ export default BrowserStore;
39
+ //# sourceMappingURL=BrowserStore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BrowserStore.d.ts","sourceRoot":"","sources":["../../../../src/utils/stores/BrowserStore.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAEvD;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF;;GAEG;AACH,cAAM,YAAa,YAAW,UAAU;IACtC,UAAU,EAAE,MAAM,CAAM;IACxB,OAAO,CAAC,SAAS,CAAgB;IACjC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAS;IAC7B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAsB;IAE7C;;;OAGG;gBACS,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,mBAAmB;IAKrD;;;OAGG;IACH,QAAQ,IAAI,SAAS,GAAG,IAAI;IAK5B;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI;IAQhC;;OAEG;IACH,WAAW,IAAI,IAAI;CAGpB;AAED,eAAe,YAAY,CAAC"}
@@ -0,0 +1,50 @@
1
+ import { Request, Response } from "express";
2
+ import { TokenStore } from "../../types/store";
3
+ import { AuthToken } from "../../types/authentication";
4
+ /**
5
+ * Configuration options for the `ExpressStore`.
6
+ */
7
+ export type ExpressStoreOptions = {
8
+ clientId: string;
9
+ req: Request;
10
+ res: Response;
11
+ secure?: boolean;
12
+ };
13
+ /**
14
+ * `ExpressStore` is an implementation of the `TokenStore` interface for managing authentication tokens via cookies in an Express application.
15
+ */
16
+ declare class ExpressStore implements TokenStore {
17
+ expiration: number;
18
+ private namespace;
19
+ private key;
20
+ private secure;
21
+ private req;
22
+ private res;
23
+ private currentToken;
24
+ /**
25
+ * Initializes the `ExpressStore` with client-specific options.
26
+ * @param options - Configuration options for the store.
27
+ */
28
+ constructor({ clientId, req, res, secure }: ExpressStoreOptions);
29
+ /**
30
+ * Reads the authentication token from the request cookies.
31
+ * @returns The `AuthToken` if present in cookies, otherwise null.
32
+ */
33
+ private readCookie;
34
+ /**
35
+ * Retrieves the authentication token, either from cache or from the request cookies.
36
+ * @returns A promise that resolves to the `AuthToken` or null if no token exists.
37
+ */
38
+ getToken(): AuthToken | null;
39
+ /**
40
+ * Stores the authentication token in a response cookie.
41
+ * @param token - The authentication token to store.
42
+ */
43
+ setToken(token: AuthToken): void;
44
+ /**
45
+ * Removes the authentication token from the response cookies.
46
+ */
47
+ removeToken(): void;
48
+ }
49
+ export default ExpressStore;
50
+ //# sourceMappingURL=ExpressStore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpressStore.d.ts","sourceRoot":"","sources":["../../../../src/utils/stores/ExpressStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAE5C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAEvD;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,OAAO,CAAC;IACb,GAAG,EAAE,QAAQ,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF;;GAEG;AACH,cAAM,YAAa,YAAW,UAAU;IACtC,UAAU,EAAE,MAAM,CAAO;IACzB,OAAO,CAAC,SAAS,CAAgB;IACjC,OAAO,CAAC,GAAG,CAAS;IACpB,OAAO,CAAC,MAAM,CAAsB;IACpC,OAAO,CAAC,GAAG,CAAU;IACrB,OAAO,CAAC,GAAG,CAAW;IACtB,OAAO,CAAC,YAAY,CAA0B;IAE9C;;;OAGG;gBACS,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,mBAAmB;IAO/D;;;OAGG;IACH,OAAO,CAAC,UAAU;IAKlB;;;OAGG;IACH,QAAQ,IAAI,SAAS,GAAG,IAAI;IAK5B;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI;IAUhC;;OAEG;IACH,WAAW,IAAI,IAAI;CAIpB;AAED,eAAe,YAAY,CAAC"}