@drttix/drt-sdk 1.0.3 → 1.0.4
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/scripts/generate-definition.js +25 -0
- package/dist/cjs/src/staging/index.d.ts +5 -0
- package/dist/cjs/src/staging/portal.d.ts +10 -0
- package/dist/cjs/src/staging/portal.js +36 -25
- package/dist/esm/src/scripts/generate-definition.js +25 -0
- package/dist/esm/src/staging/index.d.ts +5 -0
- package/dist/esm/src/staging/portal.d.ts +10 -0
- package/dist/esm/src/staging/portal.js +11 -0
- package/package.json +1 -1
- package/src/scripts/generate-definition.ts +39 -4
- package/src/staging/portal.ts +12 -0
|
@@ -13,6 +13,7 @@ if (!serviceName) {
|
|
|
13
13
|
const GENERATED_INDEX = path_1.default.resolve(`src/generated/${serviceName}/index.ts`);
|
|
14
14
|
const GENERATED_TYPES = path_1.default.resolve(`src/generated/${serviceName}/types.ts`);
|
|
15
15
|
const OUTPUT_FILE = path_1.default.resolve(`src/definitions/${serviceName}.ts`);
|
|
16
|
+
const STAGING_OUTPUT_FILE = path_1.default.resolve(`src/staging/${serviceName}.ts`);
|
|
16
17
|
if (!fs_1.default.existsSync(GENERATED_INDEX)) {
|
|
17
18
|
console.error(`❌ File not found: ${GENERATED_INDEX}`);
|
|
18
19
|
process.exit(1);
|
|
@@ -68,3 +69,27 @@ output += `// Re-export all types as a namespace\n`;
|
|
|
68
69
|
output += `export * as ${typesNamespace} from "../generated/${serviceName}/types";\n`;
|
|
69
70
|
fs_1.default.writeFileSync(OUTPUT_FILE, output);
|
|
70
71
|
console.log(`✅ Wrote ${serviceName} definition to: ${OUTPUT_FILE}`);
|
|
72
|
+
if (serviceName === 'portal' && services.length > 1) {
|
|
73
|
+
const stagingImports = [
|
|
74
|
+
`// AUTO-GENERATED FILE – DO NOT EDIT`,
|
|
75
|
+
`// Staging portal services - wraps all portal services to use staging API`,
|
|
76
|
+
'',
|
|
77
|
+
`import { OpenAPI as PortalOpenAPI } from "../generated/portal/core/OpenAPI";`,
|
|
78
|
+
`import { wrapServiceForStaging, STAGING_URLS } from "./wrapService";`,
|
|
79
|
+
'',
|
|
80
|
+
...services.map((service) => `import { ${service} } from "../generated/${serviceName}";`),
|
|
81
|
+
'',
|
|
82
|
+
`const wrap = <T extends object>(service: T) =>`,
|
|
83
|
+
`\twrapServiceForStaging(service, PortalOpenAPI, STAGING_URLS.portal);`,
|
|
84
|
+
'',
|
|
85
|
+
`export const portalStaging = {`,
|
|
86
|
+
...services.map((service) => `\t${service.replace('Service', '').toLowerCase()}: wrap(${service}),`),
|
|
87
|
+
`};`,
|
|
88
|
+
'',
|
|
89
|
+
`// Re-export types`,
|
|
90
|
+
`export * as PortalTypes from "../generated/${serviceName}/types";`,
|
|
91
|
+
'',
|
|
92
|
+
];
|
|
93
|
+
fs_1.default.writeFileSync(STAGING_OUTPUT_FILE, stagingImports.join('\n'));
|
|
94
|
+
console.log(`✅ Wrote ${serviceName} staging definition to: ${STAGING_OUTPUT_FILE}`);
|
|
95
|
+
}
|
|
@@ -44,6 +44,7 @@ export declare const DRT: {
|
|
|
44
44
|
auth: typeof import("../generated/portal").AuthService;
|
|
45
45
|
bookmark: typeof import("../generated/portal").BookmarkService;
|
|
46
46
|
clienttoolsgeneratedemails: typeof import("../generated/portal").ClientToolsGeneratedEmailsService;
|
|
47
|
+
clienttoolsinterviewupdate: typeof import("../generated/portal").ClientToolsInterviewUpdateService;
|
|
47
48
|
clienttoolsparentletter: typeof import("../generated/portal").ClientToolsParentLetterService;
|
|
48
49
|
clienttoolspatrondatabase: typeof import("../generated/portal").ClientToolsPatronDatabaseService;
|
|
49
50
|
clienttoolsseatassignmenttool: typeof import("../generated/portal").ClientToolsSeatAssignmentToolService;
|
|
@@ -68,6 +69,10 @@ export declare const DRT: {
|
|
|
68
69
|
reports: typeof import("../generated/portal").ReportsService;
|
|
69
70
|
settings: typeof import("../generated/portal").SettingsService;
|
|
70
71
|
shows: typeof import("../generated/portal").ShowsService;
|
|
72
|
+
superuserabandonedcarts: typeof import("../generated/portal").SuperUserAbandonedCartsService;
|
|
73
|
+
superuserbuyerblacklist: typeof import("../generated/portal").SuperUserBuyerBlacklistService;
|
|
74
|
+
superuserreleasedtickets: typeof import("../generated/portal").SuperUserReleasedTicketsService;
|
|
75
|
+
superusersupporttickets: typeof import("../generated/portal").SuperUserSupportTicketsService;
|
|
71
76
|
};
|
|
72
77
|
init: typeof init;
|
|
73
78
|
isReady: typeof isReady;
|
|
@@ -4,6 +4,7 @@ import { AppService } from "../generated/portal";
|
|
|
4
4
|
import { AuthService } from "../generated/portal";
|
|
5
5
|
import { BookmarkService } from "../generated/portal";
|
|
6
6
|
import { ClientToolsGeneratedEmailsService } from "../generated/portal";
|
|
7
|
+
import { ClientToolsInterviewUpdateService } from "../generated/portal";
|
|
7
8
|
import { ClientToolsParentLetterService } from "../generated/portal";
|
|
8
9
|
import { ClientToolsPatronDatabaseService } from "../generated/portal";
|
|
9
10
|
import { ClientToolsSeatAssignmentToolService } from "../generated/portal";
|
|
@@ -28,6 +29,10 @@ import { OrderLookupService } from "../generated/portal";
|
|
|
28
29
|
import { ReportsService } from "../generated/portal";
|
|
29
30
|
import { SettingsService } from "../generated/portal";
|
|
30
31
|
import { ShowsService } from "../generated/portal";
|
|
32
|
+
import { SuperUserAbandonedCartsService } from "../generated/portal";
|
|
33
|
+
import { SuperUserBuyerBlacklistService } from "../generated/portal";
|
|
34
|
+
import { SuperUserReleasedTicketsService } from "../generated/portal";
|
|
35
|
+
import { SuperUserSupportTicketsService } from "../generated/portal";
|
|
31
36
|
export declare const portalStaging: {
|
|
32
37
|
account: typeof AccountService;
|
|
33
38
|
accounting: typeof AccountingService;
|
|
@@ -35,6 +40,7 @@ export declare const portalStaging: {
|
|
|
35
40
|
auth: typeof AuthService;
|
|
36
41
|
bookmark: typeof BookmarkService;
|
|
37
42
|
clienttoolsgeneratedemails: typeof ClientToolsGeneratedEmailsService;
|
|
43
|
+
clienttoolsinterviewupdate: typeof ClientToolsInterviewUpdateService;
|
|
38
44
|
clienttoolsparentletter: typeof ClientToolsParentLetterService;
|
|
39
45
|
clienttoolspatrondatabase: typeof ClientToolsPatronDatabaseService;
|
|
40
46
|
clienttoolsseatassignmenttool: typeof ClientToolsSeatAssignmentToolService;
|
|
@@ -59,5 +65,9 @@ export declare const portalStaging: {
|
|
|
59
65
|
reports: typeof ReportsService;
|
|
60
66
|
settings: typeof SettingsService;
|
|
61
67
|
shows: typeof ShowsService;
|
|
68
|
+
superuserabandonedcarts: typeof SuperUserAbandonedCartsService;
|
|
69
|
+
superuserbuyerblacklist: typeof SuperUserBuyerBlacklistService;
|
|
70
|
+
superuserreleasedtickets: typeof SuperUserReleasedTicketsService;
|
|
71
|
+
superusersupporttickets: typeof SuperUserSupportTicketsService;
|
|
62
72
|
};
|
|
63
73
|
export * as PortalTypes from "../generated/portal/types";
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
// AUTO-GENERATED FILE – DO NOT EDIT
|
|
3
|
+
// Staging portal services - wraps all portal services to use staging API
|
|
2
4
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
5
|
if (k2 === undefined) k2 = k;
|
|
4
6
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -34,7 +36,6 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
36
|
})();
|
|
35
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
38
|
exports.PortalTypes = exports.portalStaging = void 0;
|
|
37
|
-
// Staging portal services - wraps all portal services to use staging API
|
|
38
39
|
const OpenAPI_1 = require("../generated/portal/core/OpenAPI");
|
|
39
40
|
const wrapService_1 = require("./wrapService");
|
|
40
41
|
const portal_1 = require("../generated/portal");
|
|
@@ -67,6 +68,11 @@ const portal_27 = require("../generated/portal");
|
|
|
67
68
|
const portal_28 = require("../generated/portal");
|
|
68
69
|
const portal_29 = require("../generated/portal");
|
|
69
70
|
const portal_30 = require("../generated/portal");
|
|
71
|
+
const portal_31 = require("../generated/portal");
|
|
72
|
+
const portal_32 = require("../generated/portal");
|
|
73
|
+
const portal_33 = require("../generated/portal");
|
|
74
|
+
const portal_34 = require("../generated/portal");
|
|
75
|
+
const portal_35 = require("../generated/portal");
|
|
70
76
|
const wrap = (service) => (0, wrapService_1.wrapServiceForStaging)(service, OpenAPI_1.OpenAPI, wrapService_1.STAGING_URLS.portal);
|
|
71
77
|
exports.portalStaging = {
|
|
72
78
|
account: wrap(portal_1.AccountService),
|
|
@@ -75,30 +81,35 @@ exports.portalStaging = {
|
|
|
75
81
|
auth: wrap(portal_4.AuthService),
|
|
76
82
|
bookmark: wrap(portal_5.BookmarkService),
|
|
77
83
|
clienttoolsgeneratedemails: wrap(portal_6.ClientToolsGeneratedEmailsService),
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
84
|
+
clienttoolsinterviewupdate: wrap(portal_7.ClientToolsInterviewUpdateService),
|
|
85
|
+
clienttoolsparentletter: wrap(portal_8.ClientToolsParentLetterService),
|
|
86
|
+
clienttoolspatrondatabase: wrap(portal_9.ClientToolsPatronDatabaseService),
|
|
87
|
+
clienttoolsseatassignmenttool: wrap(portal_10.ClientToolsSeatAssignmentToolService),
|
|
88
|
+
clienttoolsstripeonboarding: wrap(portal_11.ClientToolsStripeOnboardingService),
|
|
89
|
+
clienttoolsthemebuilder: wrap(portal_12.ClientToolsThemeBuilderService),
|
|
90
|
+
clienttoolsthemeslibrary: wrap(portal_13.ClientToolsThemesLibraryService),
|
|
91
|
+
clienttoolsticketinglink: wrap(portal_14.ClientToolsTicketingLinkService),
|
|
92
|
+
clienttoolsticketscanning: wrap(portal_15.ClientToolsTicketScanningService),
|
|
93
|
+
clienttoolsunapprovedorders: wrap(portal_16.ClientToolsUnapprovedOrdersService),
|
|
94
|
+
clienttoolswaitlist: wrap(portal_17.ClientToolsWaitlistService),
|
|
95
|
+
dashboard: wrap(portal_18.DashboardService),
|
|
96
|
+
featuresblockedseats: wrap(portal_19.FeaturesBlockedSeatsService),
|
|
97
|
+
featurescheckoutquestions: wrap(portal_20.FeaturesCheckoutQuestionsService),
|
|
98
|
+
featuresdiscounts: wrap(portal_21.FeaturesDiscountsService),
|
|
99
|
+
featuresdonations: wrap(portal_22.FeaturesDonationsService),
|
|
100
|
+
featuresgiftcards: wrap(portal_23.FeaturesGiftCardsService),
|
|
101
|
+
featuresgoldentickets: wrap(portal_24.FeaturesGoldenTicketsService),
|
|
102
|
+
featureslandingpage: wrap(portal_25.FeaturesLandingPageService),
|
|
103
|
+
featurespriority: wrap(portal_26.FeaturesPriorityService),
|
|
104
|
+
featuresproducts: wrap(portal_27.FeaturesProductsService),
|
|
105
|
+
orderlookup: wrap(portal_28.OrderLookupService),
|
|
106
|
+
reports: wrap(portal_29.ReportsService),
|
|
107
|
+
settings: wrap(portal_30.SettingsService),
|
|
108
|
+
shows: wrap(portal_31.ShowsService),
|
|
109
|
+
superuserabandonedcarts: wrap(portal_32.SuperUserAbandonedCartsService),
|
|
110
|
+
superuserbuyerblacklist: wrap(portal_33.SuperUserBuyerBlacklistService),
|
|
111
|
+
superuserreleasedtickets: wrap(portal_34.SuperUserReleasedTicketsService),
|
|
112
|
+
superusersupporttickets: wrap(portal_35.SuperUserSupportTicketsService),
|
|
102
113
|
};
|
|
103
114
|
// Re-export types
|
|
104
115
|
exports.PortalTypes = __importStar(require("../generated/portal/types"));
|
|
@@ -8,6 +8,7 @@ if (!serviceName) {
|
|
|
8
8
|
const GENERATED_INDEX = path.resolve(`src/generated/${serviceName}/index.ts`);
|
|
9
9
|
const GENERATED_TYPES = path.resolve(`src/generated/${serviceName}/types.ts`);
|
|
10
10
|
const OUTPUT_FILE = path.resolve(`src/definitions/${serviceName}.ts`);
|
|
11
|
+
const STAGING_OUTPUT_FILE = path.resolve(`src/staging/${serviceName}.ts`);
|
|
11
12
|
if (!fs.existsSync(GENERATED_INDEX)) {
|
|
12
13
|
console.error(`❌ File not found: ${GENERATED_INDEX}`);
|
|
13
14
|
process.exit(1);
|
|
@@ -63,3 +64,27 @@ output += `// Re-export all types as a namespace\n`;
|
|
|
63
64
|
output += `export * as ${typesNamespace} from "../generated/${serviceName}/types.js";\n`;
|
|
64
65
|
fs.writeFileSync(OUTPUT_FILE, output);
|
|
65
66
|
console.log(`✅ Wrote ${serviceName} definition to: ${OUTPUT_FILE}`);
|
|
67
|
+
if (serviceName === 'portal' && services.length > 1) {
|
|
68
|
+
const stagingImports = [
|
|
69
|
+
`// AUTO-GENERATED FILE – DO NOT EDIT`,
|
|
70
|
+
`// Staging portal services - wraps all portal services to use staging API`,
|
|
71
|
+
'',
|
|
72
|
+
`import { OpenAPI as PortalOpenAPI } from "../generated/portal/core/OpenAPI.js";`,
|
|
73
|
+
`import { wrapServiceForStaging, STAGING_URLS } from "./wrapService.js";`,
|
|
74
|
+
'',
|
|
75
|
+
...services.map((service) => `import { ${service} } from "../generated/${serviceName}.js";`),
|
|
76
|
+
'',
|
|
77
|
+
`const wrap = <T extends object>(service: T) =>`,
|
|
78
|
+
`\twrapServiceForStaging(service, PortalOpenAPI, STAGING_URLS.portal);`,
|
|
79
|
+
'',
|
|
80
|
+
`export const portalStaging = {`,
|
|
81
|
+
...services.map((service) => `\t${service.replace('Service', '').toLowerCase()}: wrap(${service}),`),
|
|
82
|
+
`};`,
|
|
83
|
+
'',
|
|
84
|
+
`// Re-export types`,
|
|
85
|
+
`export * as PortalTypes from "../generated/${serviceName}/types.js";`,
|
|
86
|
+
'',
|
|
87
|
+
];
|
|
88
|
+
fs.writeFileSync(STAGING_OUTPUT_FILE, stagingImports.join('\n'));
|
|
89
|
+
console.log(`✅ Wrote ${serviceName} staging definition to: ${STAGING_OUTPUT_FILE}`);
|
|
90
|
+
}
|
|
@@ -44,6 +44,7 @@ export declare const DRT: {
|
|
|
44
44
|
auth: typeof import("../generated/portal").AuthService;
|
|
45
45
|
bookmark: typeof import("../generated/portal").BookmarkService;
|
|
46
46
|
clienttoolsgeneratedemails: typeof import("../generated/portal").ClientToolsGeneratedEmailsService;
|
|
47
|
+
clienttoolsinterviewupdate: typeof import("../generated/portal").ClientToolsInterviewUpdateService;
|
|
47
48
|
clienttoolsparentletter: typeof import("../generated/portal").ClientToolsParentLetterService;
|
|
48
49
|
clienttoolspatrondatabase: typeof import("../generated/portal").ClientToolsPatronDatabaseService;
|
|
49
50
|
clienttoolsseatassignmenttool: typeof import("../generated/portal").ClientToolsSeatAssignmentToolService;
|
|
@@ -68,6 +69,10 @@ export declare const DRT: {
|
|
|
68
69
|
reports: typeof import("../generated/portal").ReportsService;
|
|
69
70
|
settings: typeof import("../generated/portal").SettingsService;
|
|
70
71
|
shows: typeof import("../generated/portal").ShowsService;
|
|
72
|
+
superuserabandonedcarts: typeof import("../generated/portal").SuperUserAbandonedCartsService;
|
|
73
|
+
superuserbuyerblacklist: typeof import("../generated/portal").SuperUserBuyerBlacklistService;
|
|
74
|
+
superuserreleasedtickets: typeof import("../generated/portal").SuperUserReleasedTicketsService;
|
|
75
|
+
superusersupporttickets: typeof import("../generated/portal").SuperUserSupportTicketsService;
|
|
71
76
|
};
|
|
72
77
|
init: typeof init;
|
|
73
78
|
isReady: typeof isReady;
|
|
@@ -4,6 +4,7 @@ import { AppService } from "../generated/portal";
|
|
|
4
4
|
import { AuthService } from "../generated/portal";
|
|
5
5
|
import { BookmarkService } from "../generated/portal";
|
|
6
6
|
import { ClientToolsGeneratedEmailsService } from "../generated/portal";
|
|
7
|
+
import { ClientToolsInterviewUpdateService } from "../generated/portal";
|
|
7
8
|
import { ClientToolsParentLetterService } from "../generated/portal";
|
|
8
9
|
import { ClientToolsPatronDatabaseService } from "../generated/portal";
|
|
9
10
|
import { ClientToolsSeatAssignmentToolService } from "../generated/portal";
|
|
@@ -28,6 +29,10 @@ import { OrderLookupService } from "../generated/portal";
|
|
|
28
29
|
import { ReportsService } from "../generated/portal";
|
|
29
30
|
import { SettingsService } from "../generated/portal";
|
|
30
31
|
import { ShowsService } from "../generated/portal";
|
|
32
|
+
import { SuperUserAbandonedCartsService } from "../generated/portal";
|
|
33
|
+
import { SuperUserBuyerBlacklistService } from "../generated/portal";
|
|
34
|
+
import { SuperUserReleasedTicketsService } from "../generated/portal";
|
|
35
|
+
import { SuperUserSupportTicketsService } from "../generated/portal";
|
|
31
36
|
export declare const portalStaging: {
|
|
32
37
|
account: typeof AccountService;
|
|
33
38
|
accounting: typeof AccountingService;
|
|
@@ -35,6 +40,7 @@ export declare const portalStaging: {
|
|
|
35
40
|
auth: typeof AuthService;
|
|
36
41
|
bookmark: typeof BookmarkService;
|
|
37
42
|
clienttoolsgeneratedemails: typeof ClientToolsGeneratedEmailsService;
|
|
43
|
+
clienttoolsinterviewupdate: typeof ClientToolsInterviewUpdateService;
|
|
38
44
|
clienttoolsparentletter: typeof ClientToolsParentLetterService;
|
|
39
45
|
clienttoolspatrondatabase: typeof ClientToolsPatronDatabaseService;
|
|
40
46
|
clienttoolsseatassignmenttool: typeof ClientToolsSeatAssignmentToolService;
|
|
@@ -59,5 +65,9 @@ export declare const portalStaging: {
|
|
|
59
65
|
reports: typeof ReportsService;
|
|
60
66
|
settings: typeof SettingsService;
|
|
61
67
|
shows: typeof ShowsService;
|
|
68
|
+
superuserabandonedcarts: typeof SuperUserAbandonedCartsService;
|
|
69
|
+
superuserbuyerblacklist: typeof SuperUserBuyerBlacklistService;
|
|
70
|
+
superuserreleasedtickets: typeof SuperUserReleasedTicketsService;
|
|
71
|
+
superusersupporttickets: typeof SuperUserSupportTicketsService;
|
|
62
72
|
};
|
|
63
73
|
export * as PortalTypes from "../generated/portal/types";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// AUTO-GENERATED FILE – DO NOT EDIT
|
|
1
2
|
// Staging portal services - wraps all portal services to use staging API
|
|
2
3
|
import { OpenAPI as PortalOpenAPI } from "../generated/portal/core/OpenAPI.js";
|
|
3
4
|
import { wrapServiceForStaging, STAGING_URLS } from "./wrapService.js";
|
|
@@ -7,6 +8,7 @@ import { AppService } from "../generated/portal/index.js";
|
|
|
7
8
|
import { AuthService } from "../generated/portal/index.js";
|
|
8
9
|
import { BookmarkService } from "../generated/portal/index.js";
|
|
9
10
|
import { ClientToolsGeneratedEmailsService } from "../generated/portal/index.js";
|
|
11
|
+
import { ClientToolsInterviewUpdateService } from "../generated/portal/index.js";
|
|
10
12
|
import { ClientToolsParentLetterService } from "../generated/portal/index.js";
|
|
11
13
|
import { ClientToolsPatronDatabaseService } from "../generated/portal/index.js";
|
|
12
14
|
import { ClientToolsSeatAssignmentToolService } from "../generated/portal/index.js";
|
|
@@ -31,6 +33,10 @@ import { OrderLookupService } from "../generated/portal/index.js";
|
|
|
31
33
|
import { ReportsService } from "../generated/portal/index.js";
|
|
32
34
|
import { SettingsService } from "../generated/portal/index.js";
|
|
33
35
|
import { ShowsService } from "../generated/portal/index.js";
|
|
36
|
+
import { SuperUserAbandonedCartsService } from "../generated/portal/index.js";
|
|
37
|
+
import { SuperUserBuyerBlacklistService } from "../generated/portal/index.js";
|
|
38
|
+
import { SuperUserReleasedTicketsService } from "../generated/portal/index.js";
|
|
39
|
+
import { SuperUserSupportTicketsService } from "../generated/portal/index.js";
|
|
34
40
|
const wrap = (service) => wrapServiceForStaging(service, PortalOpenAPI, STAGING_URLS.portal);
|
|
35
41
|
export const portalStaging = {
|
|
36
42
|
account: wrap(AccountService),
|
|
@@ -39,6 +45,7 @@ export const portalStaging = {
|
|
|
39
45
|
auth: wrap(AuthService),
|
|
40
46
|
bookmark: wrap(BookmarkService),
|
|
41
47
|
clienttoolsgeneratedemails: wrap(ClientToolsGeneratedEmailsService),
|
|
48
|
+
clienttoolsinterviewupdate: wrap(ClientToolsInterviewUpdateService),
|
|
42
49
|
clienttoolsparentletter: wrap(ClientToolsParentLetterService),
|
|
43
50
|
clienttoolspatrondatabase: wrap(ClientToolsPatronDatabaseService),
|
|
44
51
|
clienttoolsseatassignmenttool: wrap(ClientToolsSeatAssignmentToolService),
|
|
@@ -63,6 +70,10 @@ export const portalStaging = {
|
|
|
63
70
|
reports: wrap(ReportsService),
|
|
64
71
|
settings: wrap(SettingsService),
|
|
65
72
|
shows: wrap(ShowsService),
|
|
73
|
+
superuserabandonedcarts: wrap(SuperUserAbandonedCartsService),
|
|
74
|
+
superuserbuyerblacklist: wrap(SuperUserBuyerBlacklistService),
|
|
75
|
+
superuserreleasedtickets: wrap(SuperUserReleasedTicketsService),
|
|
76
|
+
superusersupporttickets: wrap(SuperUserSupportTicketsService),
|
|
66
77
|
};
|
|
67
78
|
// Re-export types
|
|
68
79
|
export * as PortalTypes from "../generated/portal/types.js";
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@ const [, , serviceName] = process.argv;
|
|
|
5
5
|
|
|
6
6
|
if (!serviceName) {
|
|
7
7
|
console.error(
|
|
8
|
-
'❌ Please provide a service name as an argument (e.g., "shopper")'
|
|
8
|
+
'❌ Please provide a service name as an argument (e.g., "shopper")',
|
|
9
9
|
);
|
|
10
10
|
process.exit(1);
|
|
11
11
|
}
|
|
@@ -13,6 +13,7 @@ if (!serviceName) {
|
|
|
13
13
|
const GENERATED_INDEX = path.resolve(`src/generated/${serviceName}/index.ts`);
|
|
14
14
|
const GENERATED_TYPES = path.resolve(`src/generated/${serviceName}/types.ts`);
|
|
15
15
|
const OUTPUT_FILE = path.resolve(`src/definitions/${serviceName}.ts`);
|
|
16
|
+
const STAGING_OUTPUT_FILE = path.resolve(`src/staging/${serviceName}.ts`);
|
|
16
17
|
|
|
17
18
|
if (!fs.existsSync(GENERATED_INDEX)) {
|
|
18
19
|
console.error(`❌ File not found: ${GENERATED_INDEX}`);
|
|
@@ -37,13 +38,13 @@ const services = exportLines
|
|
|
37
38
|
const typeLines = contents
|
|
38
39
|
.split('\n')
|
|
39
40
|
.filter(
|
|
40
|
-
(line) => line.startsWith('export type {') && line.includes('models')
|
|
41
|
+
(line) => line.startsWith('export type {') && line.includes('models'),
|
|
41
42
|
);
|
|
42
43
|
|
|
43
44
|
const typeExports = typeLines
|
|
44
45
|
.map((line) => {
|
|
45
46
|
const match = line.match(
|
|
46
|
-
/export type { (\w+) } from '\.\/models\/(\w+)'
|
|
47
|
+
/export type { (\w+) } from '\.\/models\/(\w+)'/,
|
|
47
48
|
);
|
|
48
49
|
if (match) {
|
|
49
50
|
return `export type { ${match[1]} } from './models/${match[2]}';`;
|
|
@@ -60,7 +61,7 @@ fs.writeFileSync(GENERATED_TYPES, typesOutput);
|
|
|
60
61
|
console.log(`✅ Wrote types to: ${GENERATED_TYPES}`);
|
|
61
62
|
|
|
62
63
|
const imports = services.map(
|
|
63
|
-
(service) => `import { ${service} } from "../generated/${serviceName}"
|
|
64
|
+
(service) => `import { ${service} } from "../generated/${serviceName}";`,
|
|
64
65
|
);
|
|
65
66
|
|
|
66
67
|
const objectName = serviceName.toLowerCase();
|
|
@@ -87,3 +88,37 @@ output += `export * as ${typesNamespace} from "../generated/${serviceName}/types
|
|
|
87
88
|
|
|
88
89
|
fs.writeFileSync(OUTPUT_FILE, output);
|
|
89
90
|
console.log(`✅ Wrote ${serviceName} definition to: ${OUTPUT_FILE}`);
|
|
91
|
+
|
|
92
|
+
if (serviceName === 'portal' && services.length > 1) {
|
|
93
|
+
const stagingImports = [
|
|
94
|
+
`// AUTO-GENERATED FILE – DO NOT EDIT`,
|
|
95
|
+
`// Staging portal services - wraps all portal services to use staging API`,
|
|
96
|
+
'',
|
|
97
|
+
`import { OpenAPI as PortalOpenAPI } from "../generated/portal/core/OpenAPI";`,
|
|
98
|
+
`import { wrapServiceForStaging, STAGING_URLS } from "./wrapService";`,
|
|
99
|
+
'',
|
|
100
|
+
...services.map(
|
|
101
|
+
(service) =>
|
|
102
|
+
`import { ${service} } from "../generated/${serviceName}";`,
|
|
103
|
+
),
|
|
104
|
+
'',
|
|
105
|
+
`const wrap = <T extends object>(service: T) =>`,
|
|
106
|
+
`\twrapServiceForStaging(service, PortalOpenAPI, STAGING_URLS.portal);`,
|
|
107
|
+
'',
|
|
108
|
+
`export const portalStaging = {`,
|
|
109
|
+
...services.map(
|
|
110
|
+
(service) =>
|
|
111
|
+
`\t${service.replace('Service', '').toLowerCase()}: wrap(${service}),`,
|
|
112
|
+
),
|
|
113
|
+
`};`,
|
|
114
|
+
'',
|
|
115
|
+
`// Re-export types`,
|
|
116
|
+
`export * as PortalTypes from "../generated/${serviceName}/types";`,
|
|
117
|
+
'',
|
|
118
|
+
];
|
|
119
|
+
|
|
120
|
+
fs.writeFileSync(STAGING_OUTPUT_FILE, stagingImports.join('\n'));
|
|
121
|
+
console.log(
|
|
122
|
+
`✅ Wrote ${serviceName} staging definition to: ${STAGING_OUTPUT_FILE}`,
|
|
123
|
+
);
|
|
124
|
+
}
|
package/src/staging/portal.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
// AUTO-GENERATED FILE – DO NOT EDIT
|
|
1
2
|
// Staging portal services - wraps all portal services to use staging API
|
|
3
|
+
|
|
2
4
|
import { OpenAPI as PortalOpenAPI } from "../generated/portal/core/OpenAPI";
|
|
3
5
|
import { wrapServiceForStaging, STAGING_URLS } from "./wrapService";
|
|
4
6
|
|
|
@@ -8,6 +10,7 @@ import { AppService } from "../generated/portal";
|
|
|
8
10
|
import { AuthService } from "../generated/portal";
|
|
9
11
|
import { BookmarkService } from "../generated/portal";
|
|
10
12
|
import { ClientToolsGeneratedEmailsService } from "../generated/portal";
|
|
13
|
+
import { ClientToolsInterviewUpdateService } from "../generated/portal";
|
|
11
14
|
import { ClientToolsParentLetterService } from "../generated/portal";
|
|
12
15
|
import { ClientToolsPatronDatabaseService } from "../generated/portal";
|
|
13
16
|
import { ClientToolsSeatAssignmentToolService } from "../generated/portal";
|
|
@@ -32,6 +35,10 @@ import { OrderLookupService } from "../generated/portal";
|
|
|
32
35
|
import { ReportsService } from "../generated/portal";
|
|
33
36
|
import { SettingsService } from "../generated/portal";
|
|
34
37
|
import { ShowsService } from "../generated/portal";
|
|
38
|
+
import { SuperUserAbandonedCartsService } from "../generated/portal";
|
|
39
|
+
import { SuperUserBuyerBlacklistService } from "../generated/portal";
|
|
40
|
+
import { SuperUserReleasedTicketsService } from "../generated/portal";
|
|
41
|
+
import { SuperUserSupportTicketsService } from "../generated/portal";
|
|
35
42
|
|
|
36
43
|
const wrap = <T extends object>(service: T) =>
|
|
37
44
|
wrapServiceForStaging(service, PortalOpenAPI, STAGING_URLS.portal);
|
|
@@ -43,6 +50,7 @@ export const portalStaging = {
|
|
|
43
50
|
auth: wrap(AuthService),
|
|
44
51
|
bookmark: wrap(BookmarkService),
|
|
45
52
|
clienttoolsgeneratedemails: wrap(ClientToolsGeneratedEmailsService),
|
|
53
|
+
clienttoolsinterviewupdate: wrap(ClientToolsInterviewUpdateService),
|
|
46
54
|
clienttoolsparentletter: wrap(ClientToolsParentLetterService),
|
|
47
55
|
clienttoolspatrondatabase: wrap(ClientToolsPatronDatabaseService),
|
|
48
56
|
clienttoolsseatassignmenttool: wrap(ClientToolsSeatAssignmentToolService),
|
|
@@ -67,6 +75,10 @@ export const portalStaging = {
|
|
|
67
75
|
reports: wrap(ReportsService),
|
|
68
76
|
settings: wrap(SettingsService),
|
|
69
77
|
shows: wrap(ShowsService),
|
|
78
|
+
superuserabandonedcarts: wrap(SuperUserAbandonedCartsService),
|
|
79
|
+
superuserbuyerblacklist: wrap(SuperUserBuyerBlacklistService),
|
|
80
|
+
superuserreleasedtickets: wrap(SuperUserReleasedTicketsService),
|
|
81
|
+
superusersupporttickets: wrap(SuperUserSupportTicketsService),
|
|
70
82
|
};
|
|
71
83
|
|
|
72
84
|
// Re-export types
|