@drttix/drt-sdk 0.8.5 → 0.9.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/dist/cjs/src/functions/setBaseURL.js +6 -6
- package/dist/cjs/src/generated/portal/core/OpenAPI.js +1 -1
- package/dist/cjs/src/generated/portal/index.d.ts +0 -1
- package/dist/cjs/src/generated/portal/models/DiscountAccessRequestDto.d.ts +0 -1
- package/dist/cjs/src/generated/portal/models/OrderRecalculateRequestDto.d.ts +0 -3
- package/dist/cjs/src/generated/portal/models/PatronAccessRequestDto.d.ts +0 -1
- package/dist/cjs/src/generated/portal/types.d.ts +0 -1
- package/dist/cjs/src/staging/index.d.ts +77 -0
- package/dist/cjs/src/staging/index.js +40 -0
- package/dist/cjs/src/staging/portal.d.ts +63 -0
- package/dist/cjs/src/staging/portal.js +104 -0
- package/dist/cjs/src/staging/wrapService.d.ts +15 -0
- package/dist/cjs/src/staging/wrapService.js +44 -0
- package/dist/cjs/staging.d.ts +1 -0
- package/dist/cjs/staging.js +18 -0
- package/dist/esm/src/functions/setBaseURL.js +9 -9
- package/dist/esm/src/generated/portal/core/OpenAPI.js +1 -1
- package/dist/esm/src/generated/portal/index.d.ts +0 -1
- package/dist/esm/src/generated/portal/models/DiscountAccessRequestDto.d.ts +0 -1
- package/dist/esm/src/generated/portal/models/OrderRecalculateRequestDto.d.ts +0 -3
- package/dist/esm/src/generated/portal/models/PatronAccessRequestDto.d.ts +0 -1
- package/dist/esm/src/generated/portal/types.d.ts +0 -1
- package/dist/esm/src/staging/index.d.ts +77 -0
- package/dist/esm/src/staging/index.js +34 -0
- package/dist/esm/src/staging/portal.d.ts +63 -0
- package/dist/esm/src/staging/portal.js +68 -0
- package/dist/esm/src/staging/wrapService.d.ts +15 -0
- package/dist/esm/src/staging/wrapService.js +40 -0
- package/dist/esm/staging.d.ts +1 -0
- package/dist/esm/staging.js +2 -0
- package/drt-api-specs.json +5 -5
- package/package.json +38 -30
- package/src/functions/setBaseURL.ts +21 -21
- package/src/generated/portal/core/OpenAPI.ts +31 -31
- package/src/generated/portal/index.ts +373 -374
- package/src/generated/portal/models/DiscountAccessRequestDto.ts +0 -1
- package/src/generated/portal/models/OrderRecalculateRequestDto.ts +0 -3
- package/src/generated/portal/models/PatronAccessRequestDto.ts +0 -1
- package/src/generated/portal/types.ts +336 -337
- package/src/staging/index.ts +39 -0
- package/src/staging/portal.ts +73 -0
- package/src/staging/wrapService.ts +51 -0
- package/staging.ts +2 -0
- package/tsconfig.cjs.json +1 -1
- package/tsconfig.esm.json +1 -1
- package/dist/cjs/src/generated/portal/models/ShowSeatTierPair.d.ts +0 -5
- package/dist/cjs/src/generated/portal/models/ShowSeatTierPair.js +0 -2
- package/dist/esm/src/generated/portal/models/ShowSeatTierPair.d.ts +0 -5
- package/dist/esm/src/generated/portal/models/ShowSeatTierPair.js +0 -1
- package/src/generated/portal/models/ShowSeatTierPair.ts +0 -10
|
@@ -9,9 +9,9 @@ const OpenAPI_3 = require("../generated/portal/core/OpenAPI");
|
|
|
9
9
|
OpenAPI_3.OpenAPI.WITH_CREDENTIALS = true;
|
|
10
10
|
// Public API endpoints (default)
|
|
11
11
|
const PUBLIC_API = {
|
|
12
|
-
shopper:
|
|
13
|
-
scanner:
|
|
14
|
-
portal:
|
|
12
|
+
shopper: "https://api.drttix.com/shopper",
|
|
13
|
+
scanner: "https://api.drttix.com/scanner-v3",
|
|
14
|
+
portal: "https://api.drttix.com/admin-portal",
|
|
15
15
|
};
|
|
16
16
|
// One-time base URL initialization guard
|
|
17
17
|
let didSetBaseUrls = false;
|
|
@@ -33,10 +33,10 @@ function setBaseUrlsOnce() {
|
|
|
33
33
|
// - If `globalThis.DRT_API_BASE_URL` is provided (e.g. window.DRT_API_BASE_URL), use it.
|
|
34
34
|
// - If `globalThis.DRT_API_LOCAL` is set to true (boolean) or "true" (string), use localhost.
|
|
35
35
|
// - Otherwise, fall back to PUBLIC_API defaults.
|
|
36
|
-
const globalEnv = typeof globalThis !==
|
|
36
|
+
const globalEnv = typeof globalThis !== "undefined" ? globalThis : {};
|
|
37
37
|
const customBase = (_a = globalEnv.DRT_API_BASE_URL) !== null && _a !== void 0 ? _a : null;
|
|
38
|
-
const useLocal = globalEnv.DRT_API_LOCAL === true || globalEnv.DRT_API_LOCAL ===
|
|
39
|
-
const base = customBase || (useLocal ?
|
|
38
|
+
const useLocal = globalEnv.DRT_API_LOCAL === true || globalEnv.DRT_API_LOCAL === "true";
|
|
39
|
+
const base = customBase || (useLocal ? "http://localhost:3000" : null);
|
|
40
40
|
OpenAPI_1.OpenAPI.BASE = base ? `${base}/shopper` : PUBLIC_API.shopper;
|
|
41
41
|
OpenAPI_2.OpenAPI.BASE = base ? `${base}/scanner-v3` : PUBLIC_API.scanner;
|
|
42
42
|
OpenAPI_3.OpenAPI.BASE = base ? `${base}/portal` : PUBLIC_API.portal;
|
|
@@ -247,7 +247,6 @@ export type { ShowReportListResponseDto } from './models/ShowReportListResponseD
|
|
|
247
247
|
export type { Shows } from './models/Shows';
|
|
248
248
|
export type { ShowSeatDetailResponseDto } from './models/ShowSeatDetailResponseDto';
|
|
249
249
|
export type { ShowSeatPair } from './models/ShowSeatPair';
|
|
250
|
-
export type { ShowSeatTierPair } from './models/ShowSeatTierPair';
|
|
251
250
|
export type { ShowSectionDetail } from './models/ShowSectionDetail';
|
|
252
251
|
export type { ShowsList } from './models/ShowsList';
|
|
253
252
|
export type { ShowSnapshotResponseDto } from './models/ShowSnapshotResponseDto';
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import type { ShowSeatPair } from './ShowSeatPair';
|
|
2
|
-
import type { ShowSeatTierPair } from './ShowSeatTierPair';
|
|
3
2
|
export type OrderRecalculateRequestDto = {
|
|
4
3
|
coupon: string;
|
|
5
4
|
orderGuid: string;
|
|
6
5
|
removeAllSeats: number;
|
|
7
|
-
keepFee: number;
|
|
8
6
|
ticket: Array<ShowSeatPair>;
|
|
9
|
-
tiers: Array<ShowSeatTierPair>;
|
|
10
7
|
};
|
|
@@ -243,7 +243,6 @@ export type { ShowReportListResponseDto } from './models/ShowReportListResponseD
|
|
|
243
243
|
export type { Shows } from './models/Shows';
|
|
244
244
|
export type { ShowSeatDetailResponseDto } from './models/ShowSeatDetailResponseDto';
|
|
245
245
|
export type { ShowSeatPair } from './models/ShowSeatPair';
|
|
246
|
-
export type { ShowSeatTierPair } from './models/ShowSeatTierPair';
|
|
247
246
|
export type { ShowSectionDetail } from './models/ShowSectionDetail';
|
|
248
247
|
export type { ShowsList } from './models/ShowsList';
|
|
249
248
|
export type { ShowSnapshotResponseDto } from './models/ShowSnapshotResponseDto';
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { init, isReady, getConfig, reset } from "../functions/sdkConfig";
|
|
2
|
+
export { ShopperTypes } from "../definitions/shopper";
|
|
3
|
+
export { ScannerTypes } from "../definitions/scanner";
|
|
4
|
+
export { PortalTypes } from "./portal";
|
|
5
|
+
/**
|
|
6
|
+
* DRT SDK configured for staging environment.
|
|
7
|
+
*
|
|
8
|
+
* - portal: Uses staging API (https://api.staging.drttix.com/admin-portal)
|
|
9
|
+
* - shopper: Uses production API (unchanged)
|
|
10
|
+
* - scanner: Uses production API (unchanged)
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* import { DRT } from '@drttix/drt-sdk/staging';
|
|
15
|
+
*
|
|
16
|
+
* // Portal calls go to staging
|
|
17
|
+
* const data = await DRT.portal.auth.login({ ... });
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare const DRT: {
|
|
21
|
+
shopper: {
|
|
22
|
+
account: typeof import("../generated/shopper").AccountService;
|
|
23
|
+
cart: typeof import("../generated/shopper").CartService;
|
|
24
|
+
checkout: typeof import("../generated/shopper").CheckoutService;
|
|
25
|
+
code: typeof import("../generated/shopper").CodeService;
|
|
26
|
+
donation: typeof import("../generated/shopper").DonationService;
|
|
27
|
+
event: typeof import("../generated/shopper").EventService;
|
|
28
|
+
giftcard: typeof import("../generated/shopper").GiftCardService;
|
|
29
|
+
order: typeof import("../generated/shopper").OrderService;
|
|
30
|
+
payment: typeof import("../generated/shopper").PaymentService;
|
|
31
|
+
product: typeof import("../generated/shopper").ProductService;
|
|
32
|
+
seat: typeof import("../generated/shopper").SeatService;
|
|
33
|
+
session: typeof import("../generated/shopper").SessionService;
|
|
34
|
+
};
|
|
35
|
+
scanner: {
|
|
36
|
+
database: typeof import("../generated/scanner").DatabaseService;
|
|
37
|
+
orders: typeof import("../generated/scanner").OrdersService;
|
|
38
|
+
scanning: typeof import("../generated/scanner").ScanningService;
|
|
39
|
+
};
|
|
40
|
+
portal: {
|
|
41
|
+
account: typeof import("../generated/portal").AccountService;
|
|
42
|
+
accounting: typeof import("../generated/portal").AccountingService;
|
|
43
|
+
app: typeof import("../generated/portal").AppService;
|
|
44
|
+
auth: typeof import("../generated/portal").AuthService;
|
|
45
|
+
bookmark: typeof import("../generated/portal").BookmarkService;
|
|
46
|
+
clienttoolsgeneratedemails: typeof import("../generated/portal").ClientToolsGeneratedEmailsService;
|
|
47
|
+
clienttoolsparentletter: typeof import("../generated/portal").ClientToolsParentLetterService;
|
|
48
|
+
clienttoolspatrondatabase: typeof import("../generated/portal").ClientToolsPatronDatabaseService;
|
|
49
|
+
clienttoolsseatassignmenttool: typeof import("../generated/portal").ClientToolsSeatAssignmentToolService;
|
|
50
|
+
clienttoolsstripeonboarding: typeof import("../generated/portal").ClientToolsStripeOnboardingService;
|
|
51
|
+
clienttoolsthemebuilder: typeof import("../generated/portal").ClientToolsThemeBuilderService;
|
|
52
|
+
clienttoolsthemeslibrary: typeof import("../generated/portal").ClientToolsThemesLibraryService;
|
|
53
|
+
clienttoolsticketinglink: typeof import("../generated/portal").ClientToolsTicketingLinkService;
|
|
54
|
+
clienttoolsticketscanning: typeof import("../generated/portal").ClientToolsTicketScanningService;
|
|
55
|
+
clienttoolsunapprovedorders: typeof import("../generated/portal").ClientToolsUnapprovedOrdersService;
|
|
56
|
+
clienttoolswaitlist: typeof import("../generated/portal").ClientToolsWaitlistService;
|
|
57
|
+
dashboard: typeof import("../generated/portal").DashboardService;
|
|
58
|
+
featuresblockedseats: typeof import("../generated/portal").FeaturesBlockedSeatsService;
|
|
59
|
+
featurescheckoutquestions: typeof import("../generated/portal").FeaturesCheckoutQuestionsService;
|
|
60
|
+
featuresdiscounts: typeof import("../generated/portal").FeaturesDiscountsService;
|
|
61
|
+
featuresdonations: typeof import("../generated/portal").FeaturesDonationsService;
|
|
62
|
+
featuresgiftcards: typeof import("../generated/portal").FeaturesGiftCardsService;
|
|
63
|
+
featuresgoldentickets: typeof import("../generated/portal").FeaturesGoldenTicketsService;
|
|
64
|
+
featureslandingpage: typeof import("../generated/portal").FeaturesLandingPageService;
|
|
65
|
+
featurespriority: typeof import("../generated/portal").FeaturesPriorityService;
|
|
66
|
+
featuresproducts: typeof import("../generated/portal").FeaturesProductsService;
|
|
67
|
+
orderlookup: typeof import("../generated/portal").OrderLookupService;
|
|
68
|
+
reports: typeof import("../generated/portal").ReportsService;
|
|
69
|
+
settings: typeof import("../generated/portal").SettingsService;
|
|
70
|
+
shows: typeof import("../generated/portal").ShowsService;
|
|
71
|
+
};
|
|
72
|
+
init: typeof init;
|
|
73
|
+
isReady: typeof isReady;
|
|
74
|
+
getConfig: typeof getConfig;
|
|
75
|
+
reset: typeof reset;
|
|
76
|
+
};
|
|
77
|
+
export type DRT = typeof DRT;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Staging entry point - exports DRT configured for staging APIs
|
|
3
|
+
// Usage: import { DRT } from '@drttix/drt-sdk/staging';
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.DRT = exports.PortalTypes = exports.ScannerTypes = exports.ShopperTypes = void 0;
|
|
6
|
+
const shopper_1 = require("../definitions/shopper");
|
|
7
|
+
const scanner_1 = require("../definitions/scanner");
|
|
8
|
+
const portal_1 = require("./portal");
|
|
9
|
+
const sdkConfig_1 = require("../functions/sdkConfig");
|
|
10
|
+
// Re-export types
|
|
11
|
+
var shopper_2 = require("../definitions/shopper");
|
|
12
|
+
Object.defineProperty(exports, "ShopperTypes", { enumerable: true, get: function () { return shopper_2.ShopperTypes; } });
|
|
13
|
+
var scanner_2 = require("../definitions/scanner");
|
|
14
|
+
Object.defineProperty(exports, "ScannerTypes", { enumerable: true, get: function () { return scanner_2.ScannerTypes; } });
|
|
15
|
+
var portal_2 = require("./portal");
|
|
16
|
+
Object.defineProperty(exports, "PortalTypes", { enumerable: true, get: function () { return portal_2.PortalTypes; } });
|
|
17
|
+
/**
|
|
18
|
+
* DRT SDK configured for staging environment.
|
|
19
|
+
*
|
|
20
|
+
* - portal: Uses staging API (https://api.staging.drttix.com/admin-portal)
|
|
21
|
+
* - shopper: Uses production API (unchanged)
|
|
22
|
+
* - scanner: Uses production API (unchanged)
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```typescript
|
|
26
|
+
* import { DRT } from '@drttix/drt-sdk/staging';
|
|
27
|
+
*
|
|
28
|
+
* // Portal calls go to staging
|
|
29
|
+
* const data = await DRT.portal.auth.login({ ... });
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
exports.DRT = {
|
|
33
|
+
shopper: shopper_1.shopper,
|
|
34
|
+
scanner: scanner_1.scanner,
|
|
35
|
+
portal: portal_1.portalStaging,
|
|
36
|
+
init: sdkConfig_1.init,
|
|
37
|
+
isReady: sdkConfig_1.isReady,
|
|
38
|
+
getConfig: sdkConfig_1.getConfig,
|
|
39
|
+
reset: sdkConfig_1.reset,
|
|
40
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { AccountService } from "../generated/portal";
|
|
2
|
+
import { AccountingService } from "../generated/portal";
|
|
3
|
+
import { AppService } from "../generated/portal";
|
|
4
|
+
import { AuthService } from "../generated/portal";
|
|
5
|
+
import { BookmarkService } from "../generated/portal";
|
|
6
|
+
import { ClientToolsGeneratedEmailsService } from "../generated/portal";
|
|
7
|
+
import { ClientToolsParentLetterService } from "../generated/portal";
|
|
8
|
+
import { ClientToolsPatronDatabaseService } from "../generated/portal";
|
|
9
|
+
import { ClientToolsSeatAssignmentToolService } from "../generated/portal";
|
|
10
|
+
import { ClientToolsStripeOnboardingService } from "../generated/portal";
|
|
11
|
+
import { ClientToolsThemeBuilderService } from "../generated/portal";
|
|
12
|
+
import { ClientToolsThemesLibraryService } from "../generated/portal";
|
|
13
|
+
import { ClientToolsTicketingLinkService } from "../generated/portal";
|
|
14
|
+
import { ClientToolsTicketScanningService } from "../generated/portal";
|
|
15
|
+
import { ClientToolsUnapprovedOrdersService } from "../generated/portal";
|
|
16
|
+
import { ClientToolsWaitlistService } from "../generated/portal";
|
|
17
|
+
import { DashboardService } from "../generated/portal";
|
|
18
|
+
import { FeaturesBlockedSeatsService } from "../generated/portal";
|
|
19
|
+
import { FeaturesCheckoutQuestionsService } from "../generated/portal";
|
|
20
|
+
import { FeaturesDiscountsService } from "../generated/portal";
|
|
21
|
+
import { FeaturesDonationsService } from "../generated/portal";
|
|
22
|
+
import { FeaturesGiftCardsService } from "../generated/portal";
|
|
23
|
+
import { FeaturesGoldenTicketsService } from "../generated/portal";
|
|
24
|
+
import { FeaturesLandingPageService } from "../generated/portal";
|
|
25
|
+
import { FeaturesPriorityService } from "../generated/portal";
|
|
26
|
+
import { FeaturesProductsService } from "../generated/portal";
|
|
27
|
+
import { OrderLookupService } from "../generated/portal";
|
|
28
|
+
import { ReportsService } from "../generated/portal";
|
|
29
|
+
import { SettingsService } from "../generated/portal";
|
|
30
|
+
import { ShowsService } from "../generated/portal";
|
|
31
|
+
export declare const portalStaging: {
|
|
32
|
+
account: typeof AccountService;
|
|
33
|
+
accounting: typeof AccountingService;
|
|
34
|
+
app: typeof AppService;
|
|
35
|
+
auth: typeof AuthService;
|
|
36
|
+
bookmark: typeof BookmarkService;
|
|
37
|
+
clienttoolsgeneratedemails: typeof ClientToolsGeneratedEmailsService;
|
|
38
|
+
clienttoolsparentletter: typeof ClientToolsParentLetterService;
|
|
39
|
+
clienttoolspatrondatabase: typeof ClientToolsPatronDatabaseService;
|
|
40
|
+
clienttoolsseatassignmenttool: typeof ClientToolsSeatAssignmentToolService;
|
|
41
|
+
clienttoolsstripeonboarding: typeof ClientToolsStripeOnboardingService;
|
|
42
|
+
clienttoolsthemebuilder: typeof ClientToolsThemeBuilderService;
|
|
43
|
+
clienttoolsthemeslibrary: typeof ClientToolsThemesLibraryService;
|
|
44
|
+
clienttoolsticketinglink: typeof ClientToolsTicketingLinkService;
|
|
45
|
+
clienttoolsticketscanning: typeof ClientToolsTicketScanningService;
|
|
46
|
+
clienttoolsunapprovedorders: typeof ClientToolsUnapprovedOrdersService;
|
|
47
|
+
clienttoolswaitlist: typeof ClientToolsWaitlistService;
|
|
48
|
+
dashboard: typeof DashboardService;
|
|
49
|
+
featuresblockedseats: typeof FeaturesBlockedSeatsService;
|
|
50
|
+
featurescheckoutquestions: typeof FeaturesCheckoutQuestionsService;
|
|
51
|
+
featuresdiscounts: typeof FeaturesDiscountsService;
|
|
52
|
+
featuresdonations: typeof FeaturesDonationsService;
|
|
53
|
+
featuresgiftcards: typeof FeaturesGiftCardsService;
|
|
54
|
+
featuresgoldentickets: typeof FeaturesGoldenTicketsService;
|
|
55
|
+
featureslandingpage: typeof FeaturesLandingPageService;
|
|
56
|
+
featurespriority: typeof FeaturesPriorityService;
|
|
57
|
+
featuresproducts: typeof FeaturesProductsService;
|
|
58
|
+
orderlookup: typeof OrderLookupService;
|
|
59
|
+
reports: typeof ReportsService;
|
|
60
|
+
settings: typeof SettingsService;
|
|
61
|
+
shows: typeof ShowsService;
|
|
62
|
+
};
|
|
63
|
+
export * as PortalTypes from "../generated/portal/types";
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.PortalTypes = exports.portalStaging = void 0;
|
|
37
|
+
// Staging portal services - wraps all portal services to use staging API
|
|
38
|
+
const OpenAPI_1 = require("../generated/portal/core/OpenAPI");
|
|
39
|
+
const wrapService_1 = require("./wrapService");
|
|
40
|
+
const portal_1 = require("../generated/portal");
|
|
41
|
+
const portal_2 = require("../generated/portal");
|
|
42
|
+
const portal_3 = require("../generated/portal");
|
|
43
|
+
const portal_4 = require("../generated/portal");
|
|
44
|
+
const portal_5 = require("../generated/portal");
|
|
45
|
+
const portal_6 = require("../generated/portal");
|
|
46
|
+
const portal_7 = require("../generated/portal");
|
|
47
|
+
const portal_8 = require("../generated/portal");
|
|
48
|
+
const portal_9 = require("../generated/portal");
|
|
49
|
+
const portal_10 = require("../generated/portal");
|
|
50
|
+
const portal_11 = require("../generated/portal");
|
|
51
|
+
const portal_12 = require("../generated/portal");
|
|
52
|
+
const portal_13 = require("../generated/portal");
|
|
53
|
+
const portal_14 = require("../generated/portal");
|
|
54
|
+
const portal_15 = require("../generated/portal");
|
|
55
|
+
const portal_16 = require("../generated/portal");
|
|
56
|
+
const portal_17 = require("../generated/portal");
|
|
57
|
+
const portal_18 = require("../generated/portal");
|
|
58
|
+
const portal_19 = require("../generated/portal");
|
|
59
|
+
const portal_20 = require("../generated/portal");
|
|
60
|
+
const portal_21 = require("../generated/portal");
|
|
61
|
+
const portal_22 = require("../generated/portal");
|
|
62
|
+
const portal_23 = require("../generated/portal");
|
|
63
|
+
const portal_24 = require("../generated/portal");
|
|
64
|
+
const portal_25 = require("../generated/portal");
|
|
65
|
+
const portal_26 = require("../generated/portal");
|
|
66
|
+
const portal_27 = require("../generated/portal");
|
|
67
|
+
const portal_28 = require("../generated/portal");
|
|
68
|
+
const portal_29 = require("../generated/portal");
|
|
69
|
+
const portal_30 = require("../generated/portal");
|
|
70
|
+
const wrap = (service) => (0, wrapService_1.wrapServiceForStaging)(service, OpenAPI_1.OpenAPI, wrapService_1.STAGING_URLS.portal);
|
|
71
|
+
exports.portalStaging = {
|
|
72
|
+
account: wrap(portal_1.AccountService),
|
|
73
|
+
accounting: wrap(portal_2.AccountingService),
|
|
74
|
+
app: wrap(portal_3.AppService),
|
|
75
|
+
auth: wrap(portal_4.AuthService),
|
|
76
|
+
bookmark: wrap(portal_5.BookmarkService),
|
|
77
|
+
clienttoolsgeneratedemails: wrap(portal_6.ClientToolsGeneratedEmailsService),
|
|
78
|
+
clienttoolsparentletter: wrap(portal_7.ClientToolsParentLetterService),
|
|
79
|
+
clienttoolspatrondatabase: wrap(portal_8.ClientToolsPatronDatabaseService),
|
|
80
|
+
clienttoolsseatassignmenttool: wrap(portal_9.ClientToolsSeatAssignmentToolService),
|
|
81
|
+
clienttoolsstripeonboarding: wrap(portal_10.ClientToolsStripeOnboardingService),
|
|
82
|
+
clienttoolsthemebuilder: wrap(portal_11.ClientToolsThemeBuilderService),
|
|
83
|
+
clienttoolsthemeslibrary: wrap(portal_12.ClientToolsThemesLibraryService),
|
|
84
|
+
clienttoolsticketinglink: wrap(portal_13.ClientToolsTicketingLinkService),
|
|
85
|
+
clienttoolsticketscanning: wrap(portal_14.ClientToolsTicketScanningService),
|
|
86
|
+
clienttoolsunapprovedorders: wrap(portal_15.ClientToolsUnapprovedOrdersService),
|
|
87
|
+
clienttoolswaitlist: wrap(portal_16.ClientToolsWaitlistService),
|
|
88
|
+
dashboard: wrap(portal_17.DashboardService),
|
|
89
|
+
featuresblockedseats: wrap(portal_18.FeaturesBlockedSeatsService),
|
|
90
|
+
featurescheckoutquestions: wrap(portal_19.FeaturesCheckoutQuestionsService),
|
|
91
|
+
featuresdiscounts: wrap(portal_20.FeaturesDiscountsService),
|
|
92
|
+
featuresdonations: wrap(portal_21.FeaturesDonationsService),
|
|
93
|
+
featuresgiftcards: wrap(portal_22.FeaturesGiftCardsService),
|
|
94
|
+
featuresgoldentickets: wrap(portal_23.FeaturesGoldenTicketsService),
|
|
95
|
+
featureslandingpage: wrap(portal_24.FeaturesLandingPageService),
|
|
96
|
+
featurespriority: wrap(portal_25.FeaturesPriorityService),
|
|
97
|
+
featuresproducts: wrap(portal_26.FeaturesProductsService),
|
|
98
|
+
orderlookup: wrap(portal_27.OrderLookupService),
|
|
99
|
+
reports: wrap(portal_28.ReportsService),
|
|
100
|
+
settings: wrap(portal_29.SettingsService),
|
|
101
|
+
shows: wrap(portal_30.ShowsService),
|
|
102
|
+
};
|
|
103
|
+
// Re-export types
|
|
104
|
+
exports.PortalTypes = __importStar(require("../generated/portal/types"));
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a proxy wrapper around a service class that temporarily
|
|
3
|
+
* swaps the OpenAPI.BASE to a staging URL for each method call.
|
|
4
|
+
*
|
|
5
|
+
* This works because the URL is built synchronously in the request function
|
|
6
|
+
* before any async operations begin.
|
|
7
|
+
*/
|
|
8
|
+
export declare function wrapServiceForStaging<T extends object>(ServiceClass: T, openAPIConfig: {
|
|
9
|
+
BASE: string;
|
|
10
|
+
}, stagingBase: string): T;
|
|
11
|
+
export declare const STAGING_URLS: {
|
|
12
|
+
portal: string;
|
|
13
|
+
shopper: string;
|
|
14
|
+
scanner: string;
|
|
15
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.STAGING_URLS = void 0;
|
|
4
|
+
exports.wrapServiceForStaging = wrapServiceForStaging;
|
|
5
|
+
/**
|
|
6
|
+
* Creates a proxy wrapper around a service class that temporarily
|
|
7
|
+
* swaps the OpenAPI.BASE to a staging URL for each method call.
|
|
8
|
+
*
|
|
9
|
+
* This works because the URL is built synchronously in the request function
|
|
10
|
+
* before any async operations begin.
|
|
11
|
+
*/
|
|
12
|
+
function wrapServiceForStaging(ServiceClass, openAPIConfig, stagingBase) {
|
|
13
|
+
return new Proxy(ServiceClass, {
|
|
14
|
+
get(target, prop, receiver) {
|
|
15
|
+
const original = Reflect.get(target, prop, receiver);
|
|
16
|
+
if (typeof original === "function") {
|
|
17
|
+
return function (...args) {
|
|
18
|
+
// Save the original BASE
|
|
19
|
+
const originalBase = openAPIConfig.BASE;
|
|
20
|
+
// Temporarily set to staging
|
|
21
|
+
openAPIConfig.BASE = stagingBase;
|
|
22
|
+
try {
|
|
23
|
+
// Call the original method - URL is built synchronously here
|
|
24
|
+
const result = original.apply(target, args);
|
|
25
|
+
return result;
|
|
26
|
+
}
|
|
27
|
+
finally {
|
|
28
|
+
// Restore original BASE immediately after the sync call
|
|
29
|
+
openAPIConfig.BASE = originalBase;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
return original;
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
// Staging base URLs
|
|
38
|
+
// Scanner doesn't have a staging
|
|
39
|
+
// TODO: Update shopper to use production URL
|
|
40
|
+
exports.STAGING_URLS = {
|
|
41
|
+
portal: "https://api.staging.drttix.com/admin-portal",
|
|
42
|
+
shopper: "https://api.staging.drttix.com/shopper",
|
|
43
|
+
scanner: "https://api.drttix.com/scanner-v3",
|
|
44
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./src/staging/index";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
// Staging entry point re-export
|
|
18
|
+
__exportStar(require("./src/staging/index"), exports);
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
// Centralized base URL initialization for all services
|
|
2
|
-
import { OpenAPI as ShopperAPI } from
|
|
3
|
-
import { OpenAPI as ScannerAPI } from
|
|
4
|
-
import { OpenAPI as PortalAPI } from
|
|
2
|
+
import { OpenAPI as ShopperAPI } from "../generated/shopper/core/OpenAPI.js";
|
|
3
|
+
import { OpenAPI as ScannerAPI } from "../generated/scanner/core/OpenAPI.js";
|
|
4
|
+
import { OpenAPI as PortalAPI } from "../generated/portal/core/OpenAPI.js";
|
|
5
5
|
// Override fetch for the portal API client
|
|
6
6
|
PortalAPI.WITH_CREDENTIALS = true;
|
|
7
7
|
// Public API endpoints (default)
|
|
8
8
|
const PUBLIC_API = {
|
|
9
|
-
shopper:
|
|
10
|
-
scanner:
|
|
11
|
-
portal:
|
|
9
|
+
shopper: "https://api.drttix.com/shopper",
|
|
10
|
+
scanner: "https://api.drttix.com/scanner-v3",
|
|
11
|
+
portal: "https://api.drttix.com/admin-portal",
|
|
12
12
|
};
|
|
13
13
|
// One-time base URL initialization guard
|
|
14
14
|
let didSetBaseUrls = false;
|
|
@@ -30,10 +30,10 @@ export function setBaseUrlsOnce() {
|
|
|
30
30
|
// - If `globalThis.DRT_API_BASE_URL` is provided (e.g. window.DRT_API_BASE_URL), use it.
|
|
31
31
|
// - If `globalThis.DRT_API_LOCAL` is set to true (boolean) or "true" (string), use localhost.
|
|
32
32
|
// - Otherwise, fall back to PUBLIC_API defaults.
|
|
33
|
-
const globalEnv = typeof globalThis !==
|
|
33
|
+
const globalEnv = typeof globalThis !== "undefined" ? globalThis : {};
|
|
34
34
|
const customBase = (_a = globalEnv.DRT_API_BASE_URL) !== null && _a !== void 0 ? _a : null;
|
|
35
|
-
const useLocal = globalEnv.DRT_API_LOCAL === true || globalEnv.DRT_API_LOCAL ===
|
|
36
|
-
const base = customBase || (useLocal ?
|
|
35
|
+
const useLocal = globalEnv.DRT_API_LOCAL === true || globalEnv.DRT_API_LOCAL === "true";
|
|
36
|
+
const base = customBase || (useLocal ? "http://localhost:3000" : null);
|
|
37
37
|
ShopperAPI.BASE = base ? `${base}/shopper` : PUBLIC_API.shopper;
|
|
38
38
|
ScannerAPI.BASE = base ? `${base}/scanner-v3` : PUBLIC_API.scanner;
|
|
39
39
|
PortalAPI.BASE = base ? `${base}/portal` : PUBLIC_API.portal;
|
|
@@ -247,7 +247,6 @@ export type { ShowReportListResponseDto } from './models/ShowReportListResponseD
|
|
|
247
247
|
export type { Shows } from './models/Shows';
|
|
248
248
|
export type { ShowSeatDetailResponseDto } from './models/ShowSeatDetailResponseDto';
|
|
249
249
|
export type { ShowSeatPair } from './models/ShowSeatPair';
|
|
250
|
-
export type { ShowSeatTierPair } from './models/ShowSeatTierPair';
|
|
251
250
|
export type { ShowSectionDetail } from './models/ShowSectionDetail';
|
|
252
251
|
export type { ShowsList } from './models/ShowsList';
|
|
253
252
|
export type { ShowSnapshotResponseDto } from './models/ShowSnapshotResponseDto';
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import type { ShowSeatPair } from './ShowSeatPair';
|
|
2
|
-
import type { ShowSeatTierPair } from './ShowSeatTierPair';
|
|
3
2
|
export type OrderRecalculateRequestDto = {
|
|
4
3
|
coupon: string;
|
|
5
4
|
orderGuid: string;
|
|
6
5
|
removeAllSeats: number;
|
|
7
|
-
keepFee: number;
|
|
8
6
|
ticket: Array<ShowSeatPair>;
|
|
9
|
-
tiers: Array<ShowSeatTierPair>;
|
|
10
7
|
};
|
|
@@ -243,7 +243,6 @@ export type { ShowReportListResponseDto } from './models/ShowReportListResponseD
|
|
|
243
243
|
export type { Shows } from './models/Shows';
|
|
244
244
|
export type { ShowSeatDetailResponseDto } from './models/ShowSeatDetailResponseDto';
|
|
245
245
|
export type { ShowSeatPair } from './models/ShowSeatPair';
|
|
246
|
-
export type { ShowSeatTierPair } from './models/ShowSeatTierPair';
|
|
247
246
|
export type { ShowSectionDetail } from './models/ShowSectionDetail';
|
|
248
247
|
export type { ShowsList } from './models/ShowsList';
|
|
249
248
|
export type { ShowSnapshotResponseDto } from './models/ShowSnapshotResponseDto';
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { init, isReady, getConfig, reset } from "../functions/sdkConfig";
|
|
2
|
+
export { ShopperTypes } from "../definitions/shopper";
|
|
3
|
+
export { ScannerTypes } from "../definitions/scanner";
|
|
4
|
+
export { PortalTypes } from "./portal";
|
|
5
|
+
/**
|
|
6
|
+
* DRT SDK configured for staging environment.
|
|
7
|
+
*
|
|
8
|
+
* - portal: Uses staging API (https://api.staging.drttix.com/admin-portal)
|
|
9
|
+
* - shopper: Uses production API (unchanged)
|
|
10
|
+
* - scanner: Uses production API (unchanged)
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* import { DRT } from '@drttix/drt-sdk/staging';
|
|
15
|
+
*
|
|
16
|
+
* // Portal calls go to staging
|
|
17
|
+
* const data = await DRT.portal.auth.login({ ... });
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare const DRT: {
|
|
21
|
+
shopper: {
|
|
22
|
+
account: typeof import("../generated/shopper").AccountService;
|
|
23
|
+
cart: typeof import("../generated/shopper").CartService;
|
|
24
|
+
checkout: typeof import("../generated/shopper").CheckoutService;
|
|
25
|
+
code: typeof import("../generated/shopper").CodeService;
|
|
26
|
+
donation: typeof import("../generated/shopper").DonationService;
|
|
27
|
+
event: typeof import("../generated/shopper").EventService;
|
|
28
|
+
giftcard: typeof import("../generated/shopper").GiftCardService;
|
|
29
|
+
order: typeof import("../generated/shopper").OrderService;
|
|
30
|
+
payment: typeof import("../generated/shopper").PaymentService;
|
|
31
|
+
product: typeof import("../generated/shopper").ProductService;
|
|
32
|
+
seat: typeof import("../generated/shopper").SeatService;
|
|
33
|
+
session: typeof import("../generated/shopper").SessionService;
|
|
34
|
+
};
|
|
35
|
+
scanner: {
|
|
36
|
+
database: typeof import("../generated/scanner").DatabaseService;
|
|
37
|
+
orders: typeof import("../generated/scanner").OrdersService;
|
|
38
|
+
scanning: typeof import("../generated/scanner").ScanningService;
|
|
39
|
+
};
|
|
40
|
+
portal: {
|
|
41
|
+
account: typeof import("../generated/portal").AccountService;
|
|
42
|
+
accounting: typeof import("../generated/portal").AccountingService;
|
|
43
|
+
app: typeof import("../generated/portal").AppService;
|
|
44
|
+
auth: typeof import("../generated/portal").AuthService;
|
|
45
|
+
bookmark: typeof import("../generated/portal").BookmarkService;
|
|
46
|
+
clienttoolsgeneratedemails: typeof import("../generated/portal").ClientToolsGeneratedEmailsService;
|
|
47
|
+
clienttoolsparentletter: typeof import("../generated/portal").ClientToolsParentLetterService;
|
|
48
|
+
clienttoolspatrondatabase: typeof import("../generated/portal").ClientToolsPatronDatabaseService;
|
|
49
|
+
clienttoolsseatassignmenttool: typeof import("../generated/portal").ClientToolsSeatAssignmentToolService;
|
|
50
|
+
clienttoolsstripeonboarding: typeof import("../generated/portal").ClientToolsStripeOnboardingService;
|
|
51
|
+
clienttoolsthemebuilder: typeof import("../generated/portal").ClientToolsThemeBuilderService;
|
|
52
|
+
clienttoolsthemeslibrary: typeof import("../generated/portal").ClientToolsThemesLibraryService;
|
|
53
|
+
clienttoolsticketinglink: typeof import("../generated/portal").ClientToolsTicketingLinkService;
|
|
54
|
+
clienttoolsticketscanning: typeof import("../generated/portal").ClientToolsTicketScanningService;
|
|
55
|
+
clienttoolsunapprovedorders: typeof import("../generated/portal").ClientToolsUnapprovedOrdersService;
|
|
56
|
+
clienttoolswaitlist: typeof import("../generated/portal").ClientToolsWaitlistService;
|
|
57
|
+
dashboard: typeof import("../generated/portal").DashboardService;
|
|
58
|
+
featuresblockedseats: typeof import("../generated/portal").FeaturesBlockedSeatsService;
|
|
59
|
+
featurescheckoutquestions: typeof import("../generated/portal").FeaturesCheckoutQuestionsService;
|
|
60
|
+
featuresdiscounts: typeof import("../generated/portal").FeaturesDiscountsService;
|
|
61
|
+
featuresdonations: typeof import("../generated/portal").FeaturesDonationsService;
|
|
62
|
+
featuresgiftcards: typeof import("../generated/portal").FeaturesGiftCardsService;
|
|
63
|
+
featuresgoldentickets: typeof import("../generated/portal").FeaturesGoldenTicketsService;
|
|
64
|
+
featureslandingpage: typeof import("../generated/portal").FeaturesLandingPageService;
|
|
65
|
+
featurespriority: typeof import("../generated/portal").FeaturesPriorityService;
|
|
66
|
+
featuresproducts: typeof import("../generated/portal").FeaturesProductsService;
|
|
67
|
+
orderlookup: typeof import("../generated/portal").OrderLookupService;
|
|
68
|
+
reports: typeof import("../generated/portal").ReportsService;
|
|
69
|
+
settings: typeof import("../generated/portal").SettingsService;
|
|
70
|
+
shows: typeof import("../generated/portal").ShowsService;
|
|
71
|
+
};
|
|
72
|
+
init: typeof init;
|
|
73
|
+
isReady: typeof isReady;
|
|
74
|
+
getConfig: typeof getConfig;
|
|
75
|
+
reset: typeof reset;
|
|
76
|
+
};
|
|
77
|
+
export type DRT = typeof DRT;
|