@drttix/drt-sdk 0.1.1 → 0.1.2

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 (233) hide show
  1. package/README.md +54 -54
  2. package/dist/cjs/index.d.ts +3 -0
  3. package/dist/cjs/index.js +5 -1
  4. package/dist/cjs/src/definitions/scanner.d.ts +1 -0
  5. package/dist/cjs/src/definitions/scanner.js +36 -1
  6. package/dist/cjs/src/definitions/shopper.d.ts +3 -0
  7. package/dist/cjs/src/definitions/shopper.js +43 -6
  8. package/dist/cjs/src/generated/scanner/types.d.ts +31 -0
  9. package/dist/cjs/src/generated/scanner/types.js +4 -0
  10. package/dist/cjs/src/generated/shopper/core/OpenAPI.js +1 -1
  11. package/dist/cjs/src/generated/shopper/index.d.ts +7 -0
  12. package/dist/cjs/src/generated/shopper/index.js +3 -1
  13. package/dist/cjs/src/generated/shopper/models/GiftCardApplyDto.d.ts +18 -0
  14. package/dist/cjs/src/generated/shopper/models/GiftCardApplyDto.js +2 -0
  15. package/dist/cjs/src/generated/shopper/models/GiftCardApplyResponse.d.ts +30 -0
  16. package/dist/cjs/src/generated/shopper/models/GiftCardApplyResponse.js +2 -0
  17. package/dist/cjs/src/generated/shopper/models/GiftCardCheckoutInfo.d.ts +30 -0
  18. package/dist/cjs/src/generated/shopper/models/GiftCardCheckoutInfo.js +2 -0
  19. package/dist/cjs/src/generated/shopper/models/GiftCardEditFormResponse.d.ts +10 -0
  20. package/dist/cjs/src/generated/shopper/models/GiftCardEditFormResponse.js +2 -0
  21. package/dist/cjs/src/generated/shopper/models/GiftCardLookupResponse.d.ts +18 -0
  22. package/dist/cjs/src/generated/shopper/models/GiftCardLookupResponse.js +2 -0
  23. package/dist/cjs/src/generated/shopper/models/GiftCardRemoveResponse.d.ts +14 -0
  24. package/dist/cjs/src/generated/shopper/models/GiftCardRemoveResponse.js +2 -0
  25. package/dist/cjs/src/generated/shopper/services/GiftCardService.d.ts +62 -0
  26. package/dist/cjs/src/generated/shopper/services/GiftCardService.js +142 -0
  27. package/dist/cjs/src/generated/shopper/types.d.ts +100 -0
  28. package/dist/cjs/src/generated/shopper/types.js +4 -0
  29. package/dist/cjs/src/scripts/build-all.js +28 -21
  30. package/dist/cjs/src/scripts/generate-definition.js +34 -9
  31. package/dist/esm/index.d.ts +3 -0
  32. package/dist/esm/index.js +2 -0
  33. package/dist/esm/src/definitions/scanner.d.ts +1 -0
  34. package/dist/esm/src/definitions/scanner.js +2 -0
  35. package/dist/esm/src/definitions/shopper.d.ts +3 -0
  36. package/dist/esm/src/definitions/shopper.js +4 -0
  37. package/dist/esm/src/generated/scanner/types.d.ts +31 -0
  38. package/dist/esm/src/generated/scanner/types.js +3 -0
  39. package/dist/esm/src/generated/shopper/core/OpenAPI.js +1 -1
  40. package/dist/esm/src/generated/shopper/index.d.ts +7 -0
  41. package/dist/esm/src/generated/shopper/index.js +1 -0
  42. package/dist/esm/src/generated/shopper/models/GiftCardApplyDto.d.ts +18 -0
  43. package/dist/esm/src/generated/shopper/models/GiftCardApplyDto.js +1 -0
  44. package/dist/esm/src/generated/shopper/models/GiftCardApplyResponse.d.ts +30 -0
  45. package/dist/esm/src/generated/shopper/models/GiftCardApplyResponse.js +1 -0
  46. package/dist/esm/src/generated/shopper/models/GiftCardCheckoutInfo.d.ts +30 -0
  47. package/dist/esm/src/generated/shopper/models/GiftCardCheckoutInfo.js +1 -0
  48. package/dist/esm/src/generated/shopper/models/GiftCardEditFormResponse.d.ts +10 -0
  49. package/dist/esm/src/generated/shopper/models/GiftCardEditFormResponse.js +1 -0
  50. package/dist/esm/src/generated/shopper/models/GiftCardLookupResponse.d.ts +18 -0
  51. package/dist/esm/src/generated/shopper/models/GiftCardLookupResponse.js +1 -0
  52. package/dist/esm/src/generated/shopper/models/GiftCardRemoveResponse.d.ts +14 -0
  53. package/dist/esm/src/generated/shopper/models/GiftCardRemoveResponse.js +1 -0
  54. package/dist/esm/src/generated/shopper/services/GiftCardService.d.ts +62 -0
  55. package/dist/esm/src/generated/shopper/services/GiftCardService.js +138 -0
  56. package/dist/esm/src/generated/shopper/types.d.ts +100 -0
  57. package/dist/esm/src/generated/shopper/types.js +3 -0
  58. package/dist/esm/src/scripts/build-all.js +31 -24
  59. package/dist/esm/src/scripts/generate-definition.js +36 -11
  60. package/drt-api-specs.json +10 -10
  61. package/index.ts +3 -0
  62. package/package.json +27 -27
  63. package/src/custom/custom-request.txt +382 -382
  64. package/src/definitions/scanner.ts +3 -0
  65. package/src/definitions/shopper.ts +5 -0
  66. package/src/functions/setBaseURL.ts +34 -34
  67. package/src/generated/scanner/core/ApiError.ts +1 -1
  68. package/src/generated/scanner/core/ApiRequestOptions.ts +1 -1
  69. package/src/generated/scanner/core/ApiResult.ts +1 -1
  70. package/src/generated/scanner/core/CancelablePromise.ts +1 -1
  71. package/src/generated/scanner/core/OpenAPI.ts +1 -1
  72. package/src/generated/scanner/core/request.ts +1 -1
  73. package/src/generated/scanner/models/DatabaseUpload.ts +10 -10
  74. package/src/generated/scanner/models/DatabaseUploadData.ts +10 -10
  75. package/src/generated/scanner/models/DisplayMessage.ts +10 -10
  76. package/src/generated/scanner/models/EventResponse.ts +16 -16
  77. package/src/generated/scanner/models/EventResponseStats.ts +11 -11
  78. package/src/generated/scanner/models/EventSkin.ts +23 -23
  79. package/src/generated/scanner/models/MobileReceiptResponse.ts +21 -21
  80. package/src/generated/scanner/models/OrderDetails.ts +15 -15
  81. package/src/generated/scanner/models/OrderProduct.ts +15 -15
  82. package/src/generated/scanner/models/OrderSeat.ts +19 -19
  83. package/src/generated/scanner/models/OrderSummary.ts +11 -11
  84. package/src/generated/scanner/models/Product.ts +15 -15
  85. package/src/generated/scanner/models/ProductQR.ts +8 -8
  86. package/src/generated/scanner/models/ProductScan.ts +16 -16
  87. package/src/generated/scanner/models/QueryDatabaseUnionResult.ts +13 -13
  88. package/src/generated/scanner/models/ReceiptBuyerDetails.ts +11 -11
  89. package/src/generated/scanner/models/ReceiptEventDetails.ts +12 -12
  90. package/src/generated/scanner/models/ReceiptProductDetails.ts +19 -19
  91. package/src/generated/scanner/models/ReceiptResponse.ts +21 -21
  92. package/src/generated/scanner/models/ReceiptSeatDetails.ts +15 -15
  93. package/src/generated/scanner/models/ResultMessage.ts +9 -9
  94. package/src/generated/scanner/models/RowResult.ts +8 -8
  95. package/src/generated/scanner/models/SeatQR.ts +8 -8
  96. package/src/generated/scanner/models/SeatResponse.ts +12 -12
  97. package/src/generated/scanner/models/SeatResult.ts +8 -8
  98. package/src/generated/scanner/models/SectionResult.ts +8 -8
  99. package/src/generated/scanner/models/TicketDatabase.ts +19 -19
  100. package/src/generated/scanner/models/TicketScan.ts +24 -24
  101. package/src/generated/scanner/models/TicketScanStats.ts +10 -10
  102. package/src/generated/scanner/models/TicketSeats.ts +14 -14
  103. package/src/generated/scanner/models/UploadDatabaseResponse.ts +10 -10
  104. package/src/generated/scanner/services/DatabaseService.ts +110 -110
  105. package/src/generated/scanner/services/OrdersService.ts +114 -114
  106. package/src/generated/scanner/services/ScanningService.ts +331 -331
  107. package/src/generated/scanner/types.ts +34 -0
  108. package/src/generated/shopper/core/ApiError.ts +1 -1
  109. package/src/generated/shopper/core/ApiRequestOptions.ts +1 -1
  110. package/src/generated/shopper/core/ApiResult.ts +1 -1
  111. package/src/generated/shopper/core/CancelablePromise.ts +1 -1
  112. package/src/generated/shopper/core/OpenAPI.ts +2 -2
  113. package/src/generated/shopper/core/request.ts +382 -382
  114. package/src/generated/shopper/index.ts +7 -0
  115. package/src/generated/shopper/models/Account.ts +57 -57
  116. package/src/generated/shopper/models/Album.ts +13 -13
  117. package/src/generated/shopper/models/AlbumImage.ts +13 -13
  118. package/src/generated/shopper/models/AlbumWithImages.ts +11 -11
  119. package/src/generated/shopper/models/AssignNamesReturn.ts +9 -9
  120. package/src/generated/shopper/models/BAHold.ts +10 -10
  121. package/src/generated/shopper/models/BlockOfTickets.ts +18 -18
  122. package/src/generated/shopper/models/Cart.ts +13 -13
  123. package/src/generated/shopper/models/CartWithTime.ts +10 -10
  124. package/src/generated/shopper/models/Chart.ts +13 -13
  125. package/src/generated/shopper/models/CodeDto.ts +11 -11
  126. package/src/generated/shopper/models/CompleteBody.ts +9 -9
  127. package/src/generated/shopper/models/CreateCustomerResponse.ts +9 -9
  128. package/src/generated/shopper/models/DigitalAsset.ts +21 -21
  129. package/src/generated/shopper/models/DonationContribution.ts +10 -10
  130. package/src/generated/shopper/models/DonationFund.ts +34 -34
  131. package/src/generated/shopper/models/DonationInCart.ts +19 -19
  132. package/src/generated/shopper/models/DonationResult.ts +23 -23
  133. package/src/generated/shopper/models/DonationText.ts +9 -9
  134. package/src/generated/shopper/models/DonationsandContributions.ts +17 -17
  135. package/src/generated/shopper/models/EmailUpdate.ts +12 -12
  136. package/src/generated/shopper/models/EngineSeat.ts +7 -7
  137. package/src/generated/shopper/models/EventDetails.ts +51 -51
  138. package/src/generated/shopper/models/EventGroup.ts +16 -16
  139. package/src/generated/shopper/models/ExistingRefundDetails.ts +9 -9
  140. package/src/generated/shopper/models/FullEventDetails.ts +17 -17
  141. package/src/generated/shopper/models/GAHold.ts +11 -11
  142. package/src/generated/shopper/models/GAResponse.ts +19 -19
  143. package/src/generated/shopper/models/GASeatRelease.ts +10 -10
  144. package/src/generated/shopper/models/GetEventsResponse.ts +11 -11
  145. package/src/generated/shopper/models/GiftCardApplyDto.ts +23 -0
  146. package/src/generated/shopper/models/GiftCardApplyResponse.ts +35 -0
  147. package/src/generated/shopper/models/GiftCardCheckoutInfo.ts +35 -0
  148. package/src/generated/shopper/models/GiftCardEditFormResponse.ts +15 -0
  149. package/src/generated/shopper/models/GiftCardLookupResponse.ts +23 -0
  150. package/src/generated/shopper/models/GiftCardRemoveResponse.ts +19 -0
  151. package/src/generated/shopper/models/GuidReturn.ts +8 -8
  152. package/src/generated/shopper/models/HasAccessResponse.ts +8 -8
  153. package/src/generated/shopper/models/LandingConfig.ts +27 -27
  154. package/src/generated/shopper/models/LandingPageResponse.ts +17 -17
  155. package/src/generated/shopper/models/LinkWithSuccess.ts +9 -9
  156. package/src/generated/shopper/models/NameUpdate.ts +9 -9
  157. package/src/generated/shopper/models/OrderDetails.ts +42 -42
  158. package/src/generated/shopper/models/OrderRecalc.ts +11 -11
  159. package/src/generated/shopper/models/OrderRefundDetails.ts +10 -10
  160. package/src/generated/shopper/models/OrderSeat.ts +30 -30
  161. package/src/generated/shopper/models/OrderStream.ts +16 -16
  162. package/src/generated/shopper/models/OrderTicketReceipt.ts +30 -30
  163. package/src/generated/shopper/models/PatronName.ts +10 -10
  164. package/src/generated/shopper/models/PaymentDetail.ts +40 -40
  165. package/src/generated/shopper/models/PaymentFail.ts +23 -23
  166. package/src/generated/shopper/models/PaymentSuccess.ts +23 -23
  167. package/src/generated/shopper/models/PerformerEventList.ts +9 -9
  168. package/src/generated/shopper/models/PickupReturn.ts +11 -11
  169. package/src/generated/shopper/models/PriorityCode.ts +10 -10
  170. package/src/generated/shopper/models/Product.ts +28 -28
  171. package/src/generated/shopper/models/ProductAddResponse.ts +12 -12
  172. package/src/generated/shopper/models/ProductBody.ts +12 -12
  173. package/src/generated/shopper/models/ProductData.ts +11 -11
  174. package/src/generated/shopper/models/ProductDeleteBody.ts +11 -11
  175. package/src/generated/shopper/models/ProductDetails.ts +16 -16
  176. package/src/generated/shopper/models/ProductInCart.ts +17 -17
  177. package/src/generated/shopper/models/ProductUpdateResponse.ts +10 -10
  178. package/src/generated/shopper/models/ProductVariant.ts +18 -18
  179. package/src/generated/shopper/models/RecalcResponse.ts +10 -10
  180. package/src/generated/shopper/models/RecalcReturn.ts +31 -31
  181. package/src/generated/shopper/models/Receipt.ts +38 -38
  182. package/src/generated/shopper/models/ReceiptMessages.ts +8 -8
  183. package/src/generated/shopper/models/ReceiptQuestions.ts +12 -12
  184. package/src/generated/shopper/models/Refund.ts +12 -12
  185. package/src/generated/shopper/models/RefundPolicy.ts +8 -8
  186. package/src/generated/shopper/models/RefundReason.ts +12 -12
  187. package/src/generated/shopper/models/RefundRequest.ts +13 -13
  188. package/src/generated/shopper/models/RefundRequestInfo.ts +15 -15
  189. package/src/generated/shopper/models/RegisterStreamRequest.ts +9 -9
  190. package/src/generated/shopper/models/RegisterStreamResponse.ts +10 -10
  191. package/src/generated/shopper/models/RootConfigResponse.ts +22 -22
  192. package/src/generated/shopper/models/SeatData.ts +9 -9
  193. package/src/generated/shopper/models/SeatHoldReturn.ts +11 -11
  194. package/src/generated/shopper/models/SeatInCart.ts +26 -26
  195. package/src/generated/shopper/models/SeatingTier.ts +27 -27
  196. package/src/generated/shopper/models/Section.ts +20 -20
  197. package/src/generated/shopper/models/SectionRule.ts +15 -15
  198. package/src/generated/shopper/models/SessionHeartbeatDto.ts +9 -9
  199. package/src/generated/shopper/models/SessionInfoDto.ts +20 -20
  200. package/src/generated/shopper/models/SiteDisposition.ts +10 -10
  201. package/src/generated/shopper/models/SiteTheme.ts +40 -40
  202. package/src/generated/shopper/models/StudioOrderSettings.ts +14 -14
  203. package/src/generated/shopper/models/SuccessResponse.ts +8 -8
  204. package/src/generated/shopper/models/SuccessWithTime.ts +15 -15
  205. package/src/generated/shopper/models/SummaryBody.ts +8 -8
  206. package/src/generated/shopper/models/TheatreAddresses.ts +15 -15
  207. package/src/generated/shopper/models/Ticket.ts +9 -9
  208. package/src/generated/shopper/models/TicketBlock.ts +18 -18
  209. package/src/generated/shopper/models/TicketInstructions.ts +8 -8
  210. package/src/generated/shopper/models/UniversalCodeResponse.ts +27 -27
  211. package/src/generated/shopper/models/UpdateTierData.ts +10 -10
  212. package/src/generated/shopper/models/UpdateTierFail.ts +10 -10
  213. package/src/generated/shopper/models/WaitlistResponse.ts +9 -9
  214. package/src/generated/shopper/models/WaitlistUpdate.ts +14 -14
  215. package/src/generated/shopper/services/AccountService.ts +129 -129
  216. package/src/generated/shopper/services/CartService.ts +68 -68
  217. package/src/generated/shopper/services/CodeService.ts +180 -180
  218. package/src/generated/shopper/services/DonationService.ts +77 -77
  219. package/src/generated/shopper/services/EventService.ts +144 -144
  220. package/src/generated/shopper/services/GiftCardService.ts +172 -0
  221. package/src/generated/shopper/services/OrderService.ts +513 -513
  222. package/src/generated/shopper/services/PaymentService.ts +109 -109
  223. package/src/generated/shopper/services/ProductService.ts +109 -109
  224. package/src/generated/shopper/services/SeatService.ts +231 -231
  225. package/src/generated/shopper/services/SessionService.ts +69 -69
  226. package/src/generated/shopper/types.ts +103 -0
  227. package/src/scripts/build-all.ts +95 -83
  228. package/src/scripts/check-version-not-published.ts +28 -28
  229. package/src/scripts/generate-definition.ts +89 -55
  230. package/test.ts +28 -13
  231. package/tsconfig.cjs.json +11 -11
  232. package/tsconfig.esm.json +11 -11
  233. package/tsconfig.json +16 -16
@@ -0,0 +1,10 @@
1
+ export type GiftCardEditFormResponse = {
2
+ /**
3
+ * Gift card code
4
+ */
5
+ code: string;
6
+ /**
7
+ * Amount applied from the gift card
8
+ */
9
+ amount: number;
10
+ };
@@ -0,0 +1,18 @@
1
+ export type GiftCardLookupResponse = {
2
+ /**
3
+ * Indicates the lookup was successful
4
+ */
5
+ success: boolean;
6
+ /**
7
+ * Current balance on the gift card
8
+ */
9
+ balance: number;
10
+ /**
11
+ * Available balance considering pending transactions
12
+ */
13
+ available: number;
14
+ /**
15
+ * Maximum amount needed to cover the current order
16
+ */
17
+ maxNeeded: number;
18
+ };
@@ -0,0 +1,14 @@
1
+ export type GiftCardRemoveResponse = {
2
+ /**
3
+ * Indicates the remove operation was successful
4
+ */
5
+ success: boolean;
6
+ /**
7
+ * Total payment amount before credit card (gift cards + contributions)
8
+ */
9
+ paymentBeforeCc: number;
10
+ /**
11
+ * Current order total
12
+ */
13
+ orderTotal: number;
14
+ };
@@ -0,0 +1,62 @@
1
+ import type { GiftCardApplyDto } from '../models/GiftCardApplyDto';
2
+ import type { GiftCardApplyResponse } from '../models/GiftCardApplyResponse';
3
+ import type { GiftCardCheckoutInfo } from '../models/GiftCardCheckoutInfo';
4
+ import type { GiftCardEditFormResponse } from '../models/GiftCardEditFormResponse';
5
+ import type { GiftCardLookupResponse } from '../models/GiftCardLookupResponse';
6
+ import type { GiftCardRemoveResponse } from '../models/GiftCardRemoveResponse';
7
+ import type { CancelablePromise } from '../core/CancelablePromise';
8
+ export declare class GiftCardService {
9
+ /**
10
+ * Look up a gift card by code and PIN
11
+ * Retrieves gift card balance and availability information for the specified code and PIN.
12
+ * @param code Gift card code
13
+ * @param pin Gift card PIN
14
+ * @param shopperguid Unique identifier for the shopper.
15
+ * @param accountid Unique identifier for the account.
16
+ * @param apikey API key for authentication.
17
+ * @returns GiftCardLookupResponse Returns gift card balance and availability information.
18
+ * @throws ApiError
19
+ */
20
+ static lookupGiftCard(code: string, pin: string, shopperguid: string, accountid: string, apikey: string): CancelablePromise<GiftCardLookupResponse>;
21
+ /**
22
+ * Apply a gift card to the current session
23
+ * Applies a gift card to the current shopper session. Removes any previously applied gift card.
24
+ * @param shopperguid Unique identifier for the shopper.
25
+ * @param accountid Unique identifier for the account.
26
+ * @param apikey API key for authentication.
27
+ * @param requestBody Gift card details to apply
28
+ * @returns GiftCardApplyResponse Gift card applied successfully.
29
+ * @throws ApiError
30
+ */
31
+ static applyGiftCard(shopperguid: string, accountid: string, apikey: string, requestBody: GiftCardApplyDto): CancelablePromise<GiftCardApplyResponse>;
32
+ /**
33
+ * Remove the gift card from the current session
34
+ * Removes all gift cards from the current shopper session and recalculates payment totals.
35
+ * @param shopperguid Unique identifier for the shopper.
36
+ * @param accountid Unique identifier for the account.
37
+ * @param apikey API key for authentication.
38
+ * @returns GiftCardRemoveResponse Gift card removed successfully.
39
+ * @throws ApiError
40
+ */
41
+ static removeGiftCard(shopperguid: string, accountid: string, apikey: string): CancelablePromise<GiftCardRemoveResponse>;
42
+ /**
43
+ * Get gift card checkout information
44
+ * Retrieves gift card information for the checkout page, including applied gift card details and remaining balance.
45
+ * @param shopperguid Unique identifier for the shopper.
46
+ * @param accountid Unique identifier for the account.
47
+ * @param apikey API key for authentication.
48
+ * @returns GiftCardCheckoutInfo Returns gift card checkout information.
49
+ * @throws ApiError
50
+ */
51
+ static getGiftCardCheckoutInfo(shopperguid: string, accountid: string, apikey: string): CancelablePromise<GiftCardCheckoutInfo>;
52
+ /**
53
+ * Get gift card edit form data
54
+ * Retrieves the currently applied gift card information for editing purposes.
55
+ * @param shopperguid Unique identifier for the shopper.
56
+ * @param accountid Unique identifier for the account.
57
+ * @param apikey API key for authentication.
58
+ * @returns GiftCardEditFormResponse Returns the applied gift card code and amount.
59
+ * @throws ApiError
60
+ */
61
+ static getGiftCardEditForm(shopperguid: string, accountid: string, apikey: string): CancelablePromise<GiftCardEditFormResponse>;
62
+ }
@@ -0,0 +1,138 @@
1
+ import { OpenAPI } from '../core/OpenAPI';
2
+ import { request as __request } from '../core/request';
3
+ export class GiftCardService {
4
+ /**
5
+ * Look up a gift card by code and PIN
6
+ * Retrieves gift card balance and availability information for the specified code and PIN.
7
+ * @param code Gift card code
8
+ * @param pin Gift card PIN
9
+ * @param shopperguid Unique identifier for the shopper.
10
+ * @param accountid Unique identifier for the account.
11
+ * @param apikey API key for authentication.
12
+ * @returns GiftCardLookupResponse Returns gift card balance and availability information.
13
+ * @throws ApiError
14
+ */
15
+ static lookupGiftCard(code, pin, shopperguid, accountid, apikey) {
16
+ return __request(OpenAPI, {
17
+ method: 'GET',
18
+ url: '/gift-card',
19
+ headers: {
20
+ 'shopperguid': shopperguid,
21
+ 'accountid': accountid,
22
+ 'apikey': apikey,
23
+ },
24
+ query: {
25
+ 'code': code,
26
+ 'pin': pin,
27
+ },
28
+ errors: {
29
+ 400: `Bad Request error with error details.`,
30
+ 404: `Not found error with error details.`,
31
+ 500: `Internal Server Error, please contact developers.`,
32
+ },
33
+ });
34
+ }
35
+ /**
36
+ * Apply a gift card to the current session
37
+ * Applies a gift card to the current shopper session. Removes any previously applied gift card.
38
+ * @param shopperguid Unique identifier for the shopper.
39
+ * @param accountid Unique identifier for the account.
40
+ * @param apikey API key for authentication.
41
+ * @param requestBody Gift card details to apply
42
+ * @returns GiftCardApplyResponse Gift card applied successfully.
43
+ * @throws ApiError
44
+ */
45
+ static applyGiftCard(shopperguid, accountid, apikey, requestBody) {
46
+ return __request(OpenAPI, {
47
+ method: 'POST',
48
+ url: '/gift-card',
49
+ headers: {
50
+ 'shopperguid': shopperguid,
51
+ 'accountid': accountid,
52
+ 'apikey': apikey,
53
+ },
54
+ body: requestBody,
55
+ mediaType: 'application/json',
56
+ errors: {
57
+ 400: `Bad Request error with error details.`,
58
+ 404: `Not found error with error details.`,
59
+ 500: `Internal Server Error, please contact developers.`,
60
+ },
61
+ });
62
+ }
63
+ /**
64
+ * Remove the gift card from the current session
65
+ * Removes all gift cards from the current shopper session and recalculates payment totals.
66
+ * @param shopperguid Unique identifier for the shopper.
67
+ * @param accountid Unique identifier for the account.
68
+ * @param apikey API key for authentication.
69
+ * @returns GiftCardRemoveResponse Gift card removed successfully.
70
+ * @throws ApiError
71
+ */
72
+ static removeGiftCard(shopperguid, accountid, apikey) {
73
+ return __request(OpenAPI, {
74
+ method: 'DELETE',
75
+ url: '/gift-card',
76
+ headers: {
77
+ 'shopperguid': shopperguid,
78
+ 'accountid': accountid,
79
+ 'apikey': apikey,
80
+ },
81
+ errors: {
82
+ 400: `Bad Request error with error details.`,
83
+ 404: `Not found error with error details.`,
84
+ 500: `Internal Server Error, please contact developers.`,
85
+ },
86
+ });
87
+ }
88
+ /**
89
+ * Get gift card checkout information
90
+ * Retrieves gift card information for the checkout page, including applied gift card details and remaining balance.
91
+ * @param shopperguid Unique identifier for the shopper.
92
+ * @param accountid Unique identifier for the account.
93
+ * @param apikey API key for authentication.
94
+ * @returns GiftCardCheckoutInfo Returns gift card checkout information.
95
+ * @throws ApiError
96
+ */
97
+ static getGiftCardCheckoutInfo(shopperguid, accountid, apikey) {
98
+ return __request(OpenAPI, {
99
+ method: 'GET',
100
+ url: '/gift-card/checkout',
101
+ headers: {
102
+ 'shopperguid': shopperguid,
103
+ 'accountid': accountid,
104
+ 'apikey': apikey,
105
+ },
106
+ errors: {
107
+ 400: `Bad Request error with error details.`,
108
+ 404: `Not found error with error details.`,
109
+ 500: `Internal Server Error, please contact developers.`,
110
+ },
111
+ });
112
+ }
113
+ /**
114
+ * Get gift card edit form data
115
+ * Retrieves the currently applied gift card information for editing purposes.
116
+ * @param shopperguid Unique identifier for the shopper.
117
+ * @param accountid Unique identifier for the account.
118
+ * @param apikey API key for authentication.
119
+ * @returns GiftCardEditFormResponse Returns the applied gift card code and amount.
120
+ * @throws ApiError
121
+ */
122
+ static getGiftCardEditForm(shopperguid, accountid, apikey) {
123
+ return __request(OpenAPI, {
124
+ method: 'GET',
125
+ url: '/gift-card/edit',
126
+ headers: {
127
+ 'shopperguid': shopperguid,
128
+ 'accountid': accountid,
129
+ 'apikey': apikey,
130
+ },
131
+ errors: {
132
+ 400: `Bad Request error with error details.`,
133
+ 404: `Not found error with error details.`,
134
+ 500: `Internal Server Error, please contact developers.`,
135
+ },
136
+ });
137
+ }
138
+ }
@@ -0,0 +1,100 @@
1
+ export type { Account } from './models/Account';
2
+ export type { Album } from './models/Album';
3
+ export type { AlbumImage } from './models/AlbumImage';
4
+ export type { AlbumWithImages } from './models/AlbumWithImages';
5
+ export type { AssignNamesReturn } from './models/AssignNamesReturn';
6
+ export type { BAHold } from './models/BAHold';
7
+ export type { BlockOfTickets } from './models/BlockOfTickets';
8
+ export type { Cart } from './models/Cart';
9
+ export type { CartWithTime } from './models/CartWithTime';
10
+ export type { Chart } from './models/Chart';
11
+ export type { CodeDto } from './models/CodeDto';
12
+ export type { CompleteBody } from './models/CompleteBody';
13
+ export type { CreateCustomerResponse } from './models/CreateCustomerResponse';
14
+ export type { DigitalAsset } from './models/DigitalAsset';
15
+ export type { DonationContribution } from './models/DonationContribution';
16
+ export type { DonationFund } from './models/DonationFund';
17
+ export type { DonationInCart } from './models/DonationInCart';
18
+ export type { DonationResult } from './models/DonationResult';
19
+ export type { DonationsandContributions } from './models/DonationsandContributions';
20
+ export type { DonationText } from './models/DonationText';
21
+ export type { EmailUpdate } from './models/EmailUpdate';
22
+ export type { EngineSeat } from './models/EngineSeat';
23
+ export type { EventDetails } from './models/EventDetails';
24
+ export type { EventGroup } from './models/EventGroup';
25
+ export type { ExistingRefundDetails } from './models/ExistingRefundDetails';
26
+ export type { FullEventDetails } from './models/FullEventDetails';
27
+ export type { GAHold } from './models/GAHold';
28
+ export type { GAResponse } from './models/GAResponse';
29
+ export type { GASeatRelease } from './models/GASeatRelease';
30
+ export type { GetEventsResponse } from './models/GetEventsResponse';
31
+ export type { GiftCardApplyDto } from './models/GiftCardApplyDto';
32
+ export type { GiftCardApplyResponse } from './models/GiftCardApplyResponse';
33
+ export type { GiftCardCheckoutInfo } from './models/GiftCardCheckoutInfo';
34
+ export type { GiftCardEditFormResponse } from './models/GiftCardEditFormResponse';
35
+ export type { GiftCardLookupResponse } from './models/GiftCardLookupResponse';
36
+ export type { GiftCardRemoveResponse } from './models/GiftCardRemoveResponse';
37
+ export type { GuidReturn } from './models/GuidReturn';
38
+ export type { HasAccessResponse } from './models/HasAccessResponse';
39
+ export type { LandingConfig } from './models/LandingConfig';
40
+ export type { LandingPageResponse } from './models/LandingPageResponse';
41
+ export type { LinkWithSuccess } from './models/LinkWithSuccess';
42
+ export type { NameUpdate } from './models/NameUpdate';
43
+ export type { OrderDetails } from './models/OrderDetails';
44
+ export type { OrderRecalc } from './models/OrderRecalc';
45
+ export type { OrderRefundDetails } from './models/OrderRefundDetails';
46
+ export type { OrderSeat } from './models/OrderSeat';
47
+ export type { OrderStream } from './models/OrderStream';
48
+ export type { OrderTicketReceipt } from './models/OrderTicketReceipt';
49
+ export type { PatronName } from './models/PatronName';
50
+ export type { PaymentDetail } from './models/PaymentDetail';
51
+ export type { PaymentFail } from './models/PaymentFail';
52
+ export type { PaymentSuccess } from './models/PaymentSuccess';
53
+ export type { PerformerEventList } from './models/PerformerEventList';
54
+ export type { PickupReturn } from './models/PickupReturn';
55
+ export type { PriorityCode } from './models/PriorityCode';
56
+ export type { Product } from './models/Product';
57
+ export type { ProductAddResponse } from './models/ProductAddResponse';
58
+ export type { ProductBody } from './models/ProductBody';
59
+ export type { ProductData } from './models/ProductData';
60
+ export type { ProductDeleteBody } from './models/ProductDeleteBody';
61
+ export type { ProductDetails } from './models/ProductDetails';
62
+ export type { ProductInCart } from './models/ProductInCart';
63
+ export type { ProductUpdateResponse } from './models/ProductUpdateResponse';
64
+ export type { ProductVariant } from './models/ProductVariant';
65
+ export type { RecalcResponse } from './models/RecalcResponse';
66
+ export type { RecalcReturn } from './models/RecalcReturn';
67
+ export type { Receipt } from './models/Receipt';
68
+ export type { ReceiptMessages } from './models/ReceiptMessages';
69
+ export type { ReceiptQuestions } from './models/ReceiptQuestions';
70
+ export type { Refund } from './models/Refund';
71
+ export type { RefundPolicy } from './models/RefundPolicy';
72
+ export type { RefundReason } from './models/RefundReason';
73
+ export type { RefundRequest } from './models/RefundRequest';
74
+ export type { RefundRequestInfo } from './models/RefundRequestInfo';
75
+ export type { RegisterStreamRequest } from './models/RegisterStreamRequest';
76
+ export type { RegisterStreamResponse } from './models/RegisterStreamResponse';
77
+ export type { RootConfigResponse } from './models/RootConfigResponse';
78
+ export type { SeatData } from './models/SeatData';
79
+ export type { SeatHoldReturn } from './models/SeatHoldReturn';
80
+ export type { SeatInCart } from './models/SeatInCart';
81
+ export type { SeatingTier } from './models/SeatingTier';
82
+ export type { Section } from './models/Section';
83
+ export type { SectionRule } from './models/SectionRule';
84
+ export type { SessionHeartbeatDto } from './models/SessionHeartbeatDto';
85
+ export type { SessionInfoDto } from './models/SessionInfoDto';
86
+ export type { SiteDisposition } from './models/SiteDisposition';
87
+ export type { SiteTheme } from './models/SiteTheme';
88
+ export type { StudioOrderSettings } from './models/StudioOrderSettings';
89
+ export type { SuccessResponse } from './models/SuccessResponse';
90
+ export type { SuccessWithTime } from './models/SuccessWithTime';
91
+ export type { SummaryBody } from './models/SummaryBody';
92
+ export type { TheatreAddresses } from './models/TheatreAddresses';
93
+ export type { Ticket } from './models/Ticket';
94
+ export type { TicketBlock } from './models/TicketBlock';
95
+ export type { TicketInstructions } from './models/TicketInstructions';
96
+ export type { UniversalCodeResponse } from './models/UniversalCodeResponse';
97
+ export type { UpdateTierData } from './models/UpdateTierData';
98
+ export type { UpdateTierFail } from './models/UpdateTierFail';
99
+ export type { WaitlistResponse } from './models/WaitlistResponse';
100
+ export type { WaitlistUpdate } from './models/WaitlistUpdate';
@@ -0,0 +1,3 @@
1
+ // AUTO-GENERATED FILE – DO NOT EDIT
2
+ // Re-export all types as a namespace
3
+ export {};
@@ -1,11 +1,11 @@
1
- import fs from "fs";
2
- import path from "path";
3
- import { execSync } from "child_process";
1
+ import fs from 'fs';
2
+ import path from 'path';
3
+ import { execSync } from 'child_process';
4
4
  // Load the spec list
5
- const specsPath = path.resolve("drt-api-specs.json");
6
- const specs = JSON.parse(fs.readFileSync(specsPath, "utf-8"));
7
- const GENERATED_BASE = path.resolve("src", "generated");
8
- const INDEX_FILE = path.resolve("index.ts"); // <== write to project root
5
+ const specsPath = path.resolve('drt-api-specs.json');
6
+ const specs = JSON.parse(fs.readFileSync(specsPath, 'utf-8'));
7
+ const GENERATED_BASE = path.resolve('src', 'generated');
8
+ const INDEX_FILE = path.resolve('index.ts'); // <== write to project root
9
9
  for (const spec of specs) {
10
10
  const { name, url } = spec;
11
11
  const outputDir = path.join(GENERATED_BASE, name);
@@ -14,8 +14,8 @@ for (const spec of specs) {
14
14
  const tempSpecFile = path.join(process.cwd(), `${name}-spec.json`);
15
15
  try {
16
16
  console.log(`📥 Downloading spec from ${url}...`);
17
- execSync(`curl -s -o "${tempSpecFile}" "${url}"`, { stdio: "inherit" });
18
- execSync(`npx openapi-typescript-codegen --input ${tempSpecFile} --output ${outputDir} --client fetch`, { stdio: "inherit" });
17
+ execSync(`curl -s -o "${tempSpecFile}" "${url}"`, { stdio: 'inherit' });
18
+ execSync(`npx openapi-typescript-codegen --input ${tempSpecFile} --output ${outputDir} --client fetch`, { stdio: 'inherit' });
19
19
  // Clean up temp file
20
20
  fs.unlinkSync(tempSpecFile);
21
21
  }
@@ -28,34 +28,41 @@ for (const spec of specs) {
28
28
  }
29
29
  console.log(`⚙️ Generating wrapper for ${name}...`);
30
30
  execSync(`npx tsx src/scripts/generate-definition.ts ${name}`, {
31
- stdio: "inherit",
31
+ stdio: 'inherit',
32
32
  });
33
33
  }
34
34
  // After generating all clients and definitions, replace request.ts for shopper only
35
- const customRequestPath = path.resolve("src/custom/custom-request.txt");
36
- const shopperRequestPath = path.resolve("src/generated/shopper/core/request.ts");
37
- const customRequestContent = fs.readFileSync(customRequestPath, "utf-8");
35
+ const customRequestPath = path.resolve('src/custom/custom-request.txt');
36
+ const shopperRequestPath = path.resolve('src/generated/shopper/core/request.ts');
37
+ const customRequestContent = fs.readFileSync(customRequestPath, 'utf-8');
38
38
  fs.writeFileSync(shopperRequestPath, customRequestContent);
39
- console.log("✅ Replaced shopper/core/request.ts with custom-request.txt");
39
+ console.log('✅ Replaced shopper/core/request.ts with custom-request.txt');
40
40
  // --- Generate index.ts
41
41
  console.log(`🧩 Generating DRT index...`);
42
42
  const lines = [];
43
- lines.push("// AUTO-GENERATED FILE – DO NOT EDIT");
44
- lines.push("");
43
+ lines.push('// AUTO-GENERATED FILE – DO NOT EDIT');
44
+ lines.push('');
45
45
  for (const spec of specs) {
46
46
  const name = spec.name.toLowerCase();
47
47
  lines.push(`import { ${name} } from "./src/definitions/${name}";`);
48
48
  }
49
49
  lines.push(`import { setBaseUrlsOnce } from "./src/functions/setBaseURL";`);
50
- lines.push("");
51
- lines.push("export const DRT = {");
50
+ lines.push('');
51
+ // Re-export type namespaces for easy access
52
+ for (const spec of specs) {
53
+ const name = spec.name.toLowerCase();
54
+ const typesNamespace = name.charAt(0).toUpperCase() + name.slice(1) + 'Types';
55
+ lines.push(`export { ${typesNamespace} } from "./src/definitions/${name}";`);
56
+ }
57
+ lines.push('');
58
+ lines.push('export const DRT = {');
52
59
  for (const spec of specs) {
53
60
  lines.push(` ${spec.name.toLowerCase()},`);
54
61
  }
55
- lines.push("};");
56
- lines.push("");
57
- lines.push("setBaseUrlsOnce();");
58
- lines.push("");
59
- lines.push("export type DRT = typeof DRT;");
60
- fs.writeFileSync(INDEX_FILE, lines.join("\n"));
62
+ lines.push('};');
63
+ lines.push('');
64
+ lines.push('setBaseUrlsOnce();');
65
+ lines.push('');
66
+ lines.push('export type DRT = typeof DRT;');
67
+ fs.writeFileSync(INDEX_FILE, lines.join('\n'));
61
68
  console.log(`✅ Wrote DRT entrypoint to index.ts`);
@@ -1,40 +1,65 @@
1
- import fs from "fs";
2
- import path from "path";
1
+ import fs from 'fs';
2
+ import path from 'path';
3
3
  const [, , serviceName] = process.argv;
4
4
  if (!serviceName) {
5
5
  console.error('❌ Please provide a service name as an argument (e.g., "shopper")');
6
6
  process.exit(1);
7
7
  }
8
8
  const GENERATED_INDEX = path.resolve(`src/generated/${serviceName}/index.ts`);
9
+ const GENERATED_TYPES = path.resolve(`src/generated/${serviceName}/types.ts`);
9
10
  const OUTPUT_FILE = path.resolve(`src/definitions/${serviceName}.ts`);
10
11
  if (!fs.existsSync(GENERATED_INDEX)) {
11
12
  console.error(`❌ File not found: ${GENERATED_INDEX}`);
12
13
  process.exit(1);
13
14
  }
14
- const contents = fs.readFileSync(GENERATED_INDEX, "utf-8");
15
+ const contents = fs.readFileSync(GENERATED_INDEX, 'utf-8');
16
+ // Extract service exports
15
17
  const exportLines = contents
16
- .split("\n")
17
- .filter((line) => line.startsWith("export {") && line.includes("Service"));
18
+ .split('\n')
19
+ .filter((line) => line.startsWith('export {') && line.includes('Service'));
18
20
  const services = exportLines
19
21
  .map((line) => {
20
22
  const match = line.match(/export { (\w+) } from/);
21
23
  return match === null || match === void 0 ? void 0 : match[1];
22
24
  })
23
25
  .filter(Boolean);
26
+ // Extract type exports for the types.ts file
27
+ const typeLines = contents
28
+ .split('\n')
29
+ .filter((line) => line.startsWith('export type {') && line.includes('models'));
30
+ const typeExports = typeLines
31
+ .map((line) => {
32
+ const match = line.match(/export type { (\w+) } from '\.\/models\/(\w+)'/);
33
+ if (match) {
34
+ return `export type { ${match[1]} } from './models/${match[2]}';`;
35
+ }
36
+ return null;
37
+ })
38
+ .filter(Boolean);
39
+ // Generate types.ts file
40
+ let typesOutput = `// AUTO-GENERATED FILE – DO NOT EDIT\n`;
41
+ typesOutput += `// Re-export all types as a namespace\n\n`;
42
+ typesOutput += typeExports.join('\n') + '\n';
43
+ fs.writeFileSync(GENERATED_TYPES, typesOutput);
44
+ console.log(`✅ Wrote types to: ${GENERATED_TYPES}`);
24
45
  const imports = services.map((service) => `import { ${service} } from "../generated/${serviceName}";`);
25
46
  const objectName = serviceName.toLowerCase();
47
+ const typesNamespace = serviceName.charAt(0).toUpperCase() + serviceName.slice(1) + 'Types';
26
48
  let output = `// AUTO-GENERATED FILE – DO NOT EDIT\n\n`;
27
49
  if (services.length === 1) {
28
- output += `import { ${services[0]} } from "../generated/${serviceName}";\n`;
29
- output += `export const ${objectName} = ${services[0]};\n`;
50
+ output += `import { ${services[0]} } from "../generated/${serviceName}";\n\n`;
51
+ output += `export const ${objectName} = ${services[0]};\n\n`;
30
52
  }
31
53
  else {
32
- output += `${imports.join("\n")}\n\n`;
54
+ output += `${imports.join('\n')}\n\n`;
33
55
  output += `export const ${objectName} = {\n`;
34
56
  output += services
35
- .map((s) => ` ${s.replace("Service", "").toLowerCase()}: ${s},`)
36
- .join("\n");
37
- output += `\n};\n`;
57
+ .map((s) => ` ${s.replace('Service', '').toLowerCase()}: ${s},`)
58
+ .join('\n');
59
+ output += `\n};\n\n`;
38
60
  }
61
+ // Add type namespace re-export
62
+ output += `// Re-export all types as a namespace\n`;
63
+ output += `export * as ${typesNamespace} from "../generated/${serviceName}/types";\n`;
39
64
  fs.writeFileSync(OUTPUT_FILE, output);
40
65
  console.log(`✅ Wrote ${serviceName} definition to: ${OUTPUT_FILE}`);
@@ -1,10 +1,10 @@
1
- [
2
- {
3
- "name": "shopper",
4
- "url": "https://api.drttix.com/shopper/docs-json"
5
- },
6
- {
7
- "name": "scanner",
8
- "url": "https://api.drttix.com/scanner-v3/docs-json"
9
- }
10
- ]
1
+ [
2
+ {
3
+ "name": "shopper",
4
+ "url": "https://api.drttix.com/shopper/docs-json"
5
+ },
6
+ {
7
+ "name": "scanner",
8
+ "url": "https://api.drttix.com/scanner-v3/docs-json"
9
+ }
10
+ ]
package/index.ts CHANGED
@@ -4,6 +4,9 @@ import { shopper } from "./src/definitions/shopper";
4
4
  import { scanner } from "./src/definitions/scanner";
5
5
  import { setBaseUrlsOnce } from "./src/functions/setBaseURL";
6
6
 
7
+ export { ShopperTypes } from "./src/definitions/shopper";
8
+ export { ScannerTypes } from "./src/definitions/scanner";
9
+
7
10
  export const DRT = {
8
11
  shopper,
9
12
  scanner,
package/package.json CHANGED
@@ -1,27 +1,27 @@
1
- {
2
- "name": "@drttix/drt-sdk",
3
- "description": "DRT SDK",
4
- "version": "0.1.1",
5
- "main": "dist/cjs/index.js",
6
- "module": "dist/esm/index.js",
7
- "types": "dist/esm/index.d.ts",
8
- "exports": {
9
- "import": "./dist/esm/index.js",
10
- "require": "./dist/cjs/index.js"
11
- },
12
- "type": "commonjs",
13
- "private": false,
14
- "publishConfig": {
15
- "access": "public",
16
- "registry": "https://registry.npmjs.org/"
17
- },
18
- "scripts": {
19
- "build": "npx tsc --project tsconfig.esm.json && npx tsc --project tsconfig.cjs.json",
20
- "generate": "npx tsx src/scripts/build-all.ts",
21
- "prepublishOnly": "npx tsx src/scripts/check-version-not-published.ts && npm run build"
22
- },
23
- "devDependencies": {
24
- "@types/node": "^24.0.4",
25
- "typescript": "^5.8.3"
26
- }
27
- }
1
+ {
2
+ "name": "@drttix/drt-sdk",
3
+ "description": "DRT SDK",
4
+ "version": "0.1.2",
5
+ "main": "dist/cjs/index.js",
6
+ "module": "dist/esm/index.js",
7
+ "types": "dist/esm/index.d.ts",
8
+ "exports": {
9
+ "import": "./dist/esm/index.js",
10
+ "require": "./dist/cjs/index.js"
11
+ },
12
+ "type": "commonjs",
13
+ "private": false,
14
+ "publishConfig": {
15
+ "access": "public",
16
+ "registry": "https://registry.npmjs.org/"
17
+ },
18
+ "scripts": {
19
+ "build": "npx tsc --project tsconfig.esm.json && npx tsc --project tsconfig.cjs.json",
20
+ "generate": "npx tsx src/scripts/build-all.ts",
21
+ "prepublishOnly": "npx tsx src/scripts/check-version-not-published.ts && npm run build"
22
+ },
23
+ "devDependencies": {
24
+ "@types/node": "^24.0.4",
25
+ "typescript": "^5.8.3"
26
+ }
27
+ }