@ibiliaze/global-vars 1.132.0 → 1.133.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/flows.js +0 -3
- package/dist/test.js +2 -2
- package/dist/ticketops/roles/account.d.ts +99 -0
- package/dist/ticketops/roles/account.js +87 -0
- package/dist/ticketops/roles/admin.d.ts +66 -0
- package/dist/ticketops/roles/admin.js +28 -0
- package/dist/ticketops/roles/ai.d.ts +6 -0
- package/dist/ticketops/roles/ai.js +11 -0
- package/dist/ticketops/roles/blog.d.ts +26 -0
- package/dist/ticketops/roles/blog.js +10 -0
- package/dist/ticketops/roles/campaign.d.ts +41 -0
- package/dist/ticketops/roles/campaign.js +13 -0
- package/dist/ticketops/roles/category.d.ts +26 -0
- package/dist/ticketops/roles/category.js +10 -0
- package/dist/ticketops/roles/checkout.d.ts +11 -0
- package/dist/ticketops/roles/checkout.js +17 -0
- package/dist/ticketops/roles/email.d.ts +16 -0
- package/dist/ticketops/roles/email.js +8 -0
- package/dist/ticketops/roles/event.d.ts +46 -0
- package/dist/ticketops/roles/event.js +14 -0
- package/dist/ticketops/roles/fail.d.ts +21 -0
- package/dist/ticketops/roles/fail.js +9 -0
- package/dist/ticketops/roles/file.d.ts +16 -0
- package/dist/ticketops/roles/file.js +23 -0
- package/dist/ticketops/roles/fixture.d.ts +26 -0
- package/dist/ticketops/roles/fixture.js +10 -0
- package/dist/ticketops/roles/flow.d.ts +31 -0
- package/dist/ticketops/roles/flow.js +11 -0
- package/dist/ticketops/roles/google.d.ts +6 -0
- package/dist/ticketops/roles/google.js +11 -0
- package/dist/ticketops/roles/group.d.ts +26 -0
- package/dist/ticketops/roles/group.js +10 -0
- package/dist/ticketops/roles/info.d.ts +6 -0
- package/dist/ticketops/roles/info.js +11 -0
- package/dist/ticketops/roles/job.d.ts +41 -0
- package/dist/ticketops/roles/job.js +13 -0
- package/dist/ticketops/roles/log.d.ts +16 -0
- package/dist/ticketops/roles/log.js +8 -0
- package/dist/ticketops/roles/notification.d.ts +31 -0
- package/dist/ticketops/roles/notification.js +11 -0
- package/dist/ticketops/roles/page.d.ts +31 -0
- package/dist/ticketops/roles/page.js +11 -0
- package/dist/ticketops/roles/product.d.ts +26 -0
- package/dist/ticketops/roles/product.js +10 -0
- package/dist/ticketops/roles/prospect.d.ts +46 -0
- package/dist/ticketops/roles/prospect.js +14 -0
- package/dist/ticketops/roles/quota.d.ts +6 -0
- package/dist/ticketops/roles/quota.js +11 -0
- package/dist/ticketops/roles/report.d.ts +26 -0
- package/dist/ticketops/roles/report.js +10 -0
- package/dist/ticketops/roles/review.d.ts +36 -0
- package/dist/ticketops/roles/review.js +12 -0
- package/dist/ticketops/roles/role.d.ts +26 -0
- package/dist/ticketops/roles/role.js +10 -0
- package/dist/ticketops/roles/sale.d.ts +36 -0
- package/dist/ticketops/roles/sale.js +17 -0
- package/dist/ticketops/roles/schema.d.ts +6 -0
- package/dist/ticketops/roles/schema.js +11 -0
- package/dist/ticketops/roles/season.d.ts +26 -0
- package/dist/ticketops/roles/season.js +10 -0
- package/dist/ticketops/roles/seat.d.ts +66 -0
- package/dist/ticketops/roles/seat.js +43 -0
- package/dist/ticketops/roles/section.d.ts +26 -0
- package/dist/ticketops/roles/section.js +10 -0
- package/dist/ticketops/roles/staff.d.ts +61 -0
- package/dist/ticketops/roles/staff.js +17 -0
- package/dist/ticketops/roles/user.d.ts +66 -0
- package/dist/ticketops/roles/user.js +23 -0
- package/dist/ticketops/roles.d.ts +2067 -3
- package/dist/ticketops/roles.js +159 -111
- package/package.json +2 -2
package/dist/ticketops/roles.js
CHANGED
|
@@ -1,114 +1,162 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
//
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
{ path: 'PUT:/quote', name: 'Update Quote' },
|
|
83
|
-
{ path: 'DELETE:/quote', name: 'Delete Quote' },
|
|
84
|
-
// REPORT
|
|
85
|
-
{ path: 'GET:/report', name: 'View Report' },
|
|
86
|
-
{ path: 'POST:/report', name: 'Create Report' },
|
|
87
|
-
{ path: 'PUT:/report', name: 'Update Report' },
|
|
88
|
-
{ path: 'DELETE:/report', name: 'Delete Report' },
|
|
89
|
-
// REVIEW
|
|
90
|
-
{ path: 'GET:/review', name: 'View Review' },
|
|
91
|
-
{ path: 'POST:/review', name: 'Create Review' },
|
|
92
|
-
{ path: 'PUT:/review', name: 'Update Review' },
|
|
93
|
-
{ path: 'DELETE:/review', name: 'Delete Review' },
|
|
94
|
-
// SALE
|
|
95
|
-
{ path: 'GET:/sale', name: 'View Sale' },
|
|
96
|
-
{ path: 'POST:/sale', name: 'Create Sale' },
|
|
97
|
-
{ path: 'PUT:/sale', name: 'Update Sale' },
|
|
98
|
-
{ path: 'DELETE:/sale', name: 'Delete Sale' },
|
|
99
|
-
// SECTION
|
|
100
|
-
{ path: 'GET:/section', name: 'View Section' },
|
|
101
|
-
{ path: 'POST:/section', name: 'Create Section' },
|
|
102
|
-
{ path: 'PUT:/section', name: 'Update Section' },
|
|
103
|
-
{ path: 'DELETE:/section', name: 'Delete Section' },
|
|
104
|
-
// TICKET
|
|
105
|
-
{ path: 'GET:/ticket', name: 'View Ticket' },
|
|
106
|
-
{ path: 'POST:/ticket', name: 'Create Ticket' },
|
|
107
|
-
{ path: 'PUT:/ticket', name: 'Update Ticket' },
|
|
108
|
-
{ path: 'DELETE:/ticket', name: 'Delete Ticket' },
|
|
109
|
-
// USER
|
|
110
|
-
{ path: 'GET:/user', name: 'View User' },
|
|
111
|
-
{ path: 'POST:/user', name: 'Create User' },
|
|
112
|
-
{ path: 'PUT:/user', name: 'Update User' },
|
|
113
|
-
{ path: 'DELETE:/user', name: 'Delete User' },
|
|
3
|
+
exports.apiGroups = exports.getRoleFor = exports.p = exports.roles = exports.apis = void 0;
|
|
4
|
+
const email_1 = require("./roles/email");
|
|
5
|
+
const account_1 = require("./roles/account");
|
|
6
|
+
const admin_1 = require("./roles/admin");
|
|
7
|
+
const blog_1 = require("./roles/blog");
|
|
8
|
+
const campaign_1 = require("./roles/campaign");
|
|
9
|
+
const category_1 = require("./roles/category");
|
|
10
|
+
const event_1 = require("./roles/event");
|
|
11
|
+
const flow_1 = require("./roles/flow");
|
|
12
|
+
const fail_1 = require("./roles/fail");
|
|
13
|
+
const fixture_1 = require("./roles/fixture");
|
|
14
|
+
const group_1 = require("./roles/group");
|
|
15
|
+
const job_1 = require("./roles/job");
|
|
16
|
+
const log_1 = require("./roles/log");
|
|
17
|
+
const notification_1 = require("./roles/notification");
|
|
18
|
+
const page_1 = require("./roles/page");
|
|
19
|
+
const product_1 = require("./roles/product");
|
|
20
|
+
const prospect_1 = require("./roles/prospect");
|
|
21
|
+
const report_1 = require("./roles/report");
|
|
22
|
+
const review_1 = require("./roles/review");
|
|
23
|
+
const sale_1 = require("./roles/sale");
|
|
24
|
+
const season_1 = require("./roles/season");
|
|
25
|
+
const seat_1 = require("./roles/seat");
|
|
26
|
+
const section_1 = require("./roles/section");
|
|
27
|
+
const staff_1 = require("./roles/staff");
|
|
28
|
+
const user_1 = require("./roles/user");
|
|
29
|
+
const ai_1 = require("./roles/ai");
|
|
30
|
+
const checkout_1 = require("./roles/checkout");
|
|
31
|
+
const file_1 = require("./roles/file");
|
|
32
|
+
const google_1 = require("./roles/google");
|
|
33
|
+
const info_1 = require("./roles/info");
|
|
34
|
+
const quota_1 = require("./roles/quota");
|
|
35
|
+
const schema_1 = require("./roles/schema");
|
|
36
|
+
const role_1 = require("./roles/role");
|
|
37
|
+
/**
|
|
38
|
+
* Generic route factory.
|
|
39
|
+
*
|
|
40
|
+
* Frontend can do:
|
|
41
|
+
* const routes = apis<string, string>();
|
|
42
|
+
*
|
|
43
|
+
* Backend can do:
|
|
44
|
+
* const routes = apis<Types.ObjectId, Date>();
|
|
45
|
+
*/
|
|
46
|
+
const apis = () => [
|
|
47
|
+
// Routes
|
|
48
|
+
...(0, account_1.accountRoleDefs)(),
|
|
49
|
+
...admin_1.adminRoleDefs,
|
|
50
|
+
...blog_1.blogRoleDefs,
|
|
51
|
+
...campaign_1.campaignRoleDefs,
|
|
52
|
+
...category_1.categoryRoleDefs,
|
|
53
|
+
...email_1.emailRoleDefs,
|
|
54
|
+
...event_1.eventRoleDefs,
|
|
55
|
+
...fail_1.failRoleDefs,
|
|
56
|
+
...flow_1.flowFlowDefs,
|
|
57
|
+
...fixture_1.fixtureRoleDefs,
|
|
58
|
+
...group_1.groupRoleDefs,
|
|
59
|
+
...job_1.jobRoleDefs,
|
|
60
|
+
...log_1.logRoleDefs,
|
|
61
|
+
...notification_1.notificationRoleDefs,
|
|
62
|
+
...page_1.pageRoleDefs,
|
|
63
|
+
...product_1.productRoleDefs,
|
|
64
|
+
...prospect_1.prospectRoleDefs,
|
|
65
|
+
...report_1.reportRoleDefs,
|
|
66
|
+
...review_1.reviewRoleDefs,
|
|
67
|
+
...role_1.roleRoleDefs,
|
|
68
|
+
...sale_1.saleRoleDefs,
|
|
69
|
+
...season_1.seasonRoleDefs,
|
|
70
|
+
...seat_1.occupanceRoleDefs,
|
|
71
|
+
...section_1.sectionRoleDefs,
|
|
72
|
+
...staff_1.staffRoleDefs,
|
|
73
|
+
...user_1.userRoleDefs,
|
|
74
|
+
// Util routes
|
|
75
|
+
...ai_1.aiRoleDefs,
|
|
76
|
+
...checkout_1.checkoutRoleDefs,
|
|
77
|
+
...file_1.fileRoleDefs,
|
|
78
|
+
...google_1.googleRoleDefs,
|
|
79
|
+
...info_1.infoRoleDefs,
|
|
80
|
+
...quota_1.quotaRoleDefs,
|
|
81
|
+
...schema_1.schemaRoleDefs,
|
|
114
82
|
];
|
|
83
|
+
exports.apis = apis;
|
|
84
|
+
// ──────────────────────────
|
|
85
|
+
// Shared maps / RoleName
|
|
86
|
+
// ─────────────────────────-
|
|
87
|
+
// Build a literal array once, using <any, any> for the generic bits,
|
|
88
|
+
// without forcing it through ApiRoute — this preserves literal role strings.
|
|
89
|
+
const allApis = [
|
|
90
|
+
...(0, account_1.accountRoleDefs)(),
|
|
91
|
+
...admin_1.adminRoleDefs,
|
|
92
|
+
...blog_1.blogRoleDefs,
|
|
93
|
+
...campaign_1.campaignRoleDefs,
|
|
94
|
+
...category_1.categoryRoleDefs,
|
|
95
|
+
...email_1.emailRoleDefs,
|
|
96
|
+
...event_1.eventRoleDefs,
|
|
97
|
+
...fail_1.failRoleDefs,
|
|
98
|
+
...flow_1.flowFlowDefs,
|
|
99
|
+
...fixture_1.fixtureRoleDefs,
|
|
100
|
+
...group_1.groupRoleDefs,
|
|
101
|
+
...job_1.jobRoleDefs,
|
|
102
|
+
...log_1.logRoleDefs,
|
|
103
|
+
...notification_1.notificationRoleDefs,
|
|
104
|
+
...page_1.pageRoleDefs,
|
|
105
|
+
...product_1.productRoleDefs,
|
|
106
|
+
...prospect_1.prospectRoleDefs,
|
|
107
|
+
...report_1.reportRoleDefs,
|
|
108
|
+
...review_1.reviewRoleDefs,
|
|
109
|
+
...role_1.roleRoleDefs,
|
|
110
|
+
...sale_1.saleRoleDefs,
|
|
111
|
+
...season_1.seasonRoleDefs,
|
|
112
|
+
...seat_1.occupanceRoleDefs,
|
|
113
|
+
...section_1.sectionRoleDefs,
|
|
114
|
+
...staff_1.staffRoleDefs,
|
|
115
|
+
...user_1.userRoleDefs,
|
|
116
|
+
...ai_1.aiRoleDefs,
|
|
117
|
+
...checkout_1.checkoutRoleDefs,
|
|
118
|
+
...file_1.fileRoleDefs,
|
|
119
|
+
...google_1.googleRoleDefs,
|
|
120
|
+
...info_1.infoRoleDefs,
|
|
121
|
+
...quota_1.quotaRoleDefs,
|
|
122
|
+
...schema_1.schemaRoleDefs,
|
|
123
|
+
];
|
|
124
|
+
exports.roles = new Map();
|
|
125
|
+
for (const api of allApis) {
|
|
126
|
+
exports.roles.set({ [api.method]: api.path }, {
|
|
127
|
+
role: api.role,
|
|
128
|
+
name: api.name,
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
// role -> path
|
|
132
|
+
const roleToPath = new Map();
|
|
133
|
+
// method+path -> role
|
|
134
|
+
const methodPathToRole = new Map();
|
|
135
|
+
for (const api of allApis) {
|
|
136
|
+
roleToPath.set(api.role, api.path);
|
|
137
|
+
const key = `${api.method.toLowerCase()}:${api.path.toLowerCase()}`;
|
|
138
|
+
methodPathToRole.set(key, api.role);
|
|
139
|
+
}
|
|
140
|
+
const p = (role) => {
|
|
141
|
+
const path = roleToPath.get(role);
|
|
142
|
+
if (!path) {
|
|
143
|
+
throw new Error(`No path found for role "${role}"`);
|
|
144
|
+
}
|
|
145
|
+
return path;
|
|
146
|
+
};
|
|
147
|
+
exports.p = p;
|
|
148
|
+
const getRoleFor = (method, path) => {
|
|
149
|
+
const key = `${method.toLowerCase()}:${path.toLowerCase()}`;
|
|
150
|
+
return methodPathToRole.get(key);
|
|
151
|
+
};
|
|
152
|
+
exports.getRoleFor = getRoleFor;
|
|
153
|
+
const apiGroups = () => allApis.reduce((acc, api) => {
|
|
154
|
+
const segments = api.path.split('/').filter(Boolean);
|
|
155
|
+
const groupKey = segments[0] || 'root';
|
|
156
|
+
if (!acc[groupKey]) {
|
|
157
|
+
acc[groupKey] = [];
|
|
158
|
+
}
|
|
159
|
+
acc[groupKey].push(api);
|
|
160
|
+
return acc;
|
|
161
|
+
}, {});
|
|
162
|
+
exports.apiGroups = apiGroups;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ibiliaze/global-vars",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.133.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"scripts": {
|
|
23
23
|
"build": "tsc",
|
|
24
24
|
"pub": "npm publish --access public",
|
|
25
|
-
"git": "git add .; git commit -m 'changes'; git tag -a v1.
|
|
25
|
+
"git": "git add .; git commit -m 'changes'; git tag -a v1.133.0 -m 'v1.133.0'; git push origin v1.133.0; git push",
|
|
26
26
|
"push": "npm run build; npm run git; npm run pub"
|
|
27
27
|
},
|
|
28
28
|
"author": "Ibi Hasanli",
|