@ibiliaze/global-vars 1.0.5 → 1.2.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.
@@ -0,0 +1,34 @@
1
+ export interface Checkout {
2
+ stripe: {};
3
+ epoint: Epoint;
4
+ local: Local;
5
+ }
6
+ export interface Epoint {
7
+ orderId: string | number;
8
+ amountAZN: string | number;
9
+ description?: string;
10
+ lang?: EpointLang;
11
+ successUrl?: string;
12
+ errorUrl?: string;
13
+ }
14
+ export interface Local {
15
+ email: string;
16
+ name: string;
17
+ tel: string;
18
+ address: string;
19
+ promoDiscount: number;
20
+ promoCode: string;
21
+ subscription: boolean;
22
+ successPath?: string;
23
+ cancelPath?: string;
24
+ items: LocalItem[];
25
+ }
26
+ export interface LocalItem {
27
+ _id: string;
28
+ type: 'product' | 'ticket';
29
+ subscriptionPeriod: '' | 'day' | 'week' | 'month' | 'year';
30
+ quantity: number;
31
+ price: number;
32
+ selectedAddonIds?: string[];
33
+ }
34
+ export type EpointLang = 'az' | 'en' | 'ru';
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export * from './checkout';
1
2
  declare const _default: GlobalVars;
2
3
  export default _default;
3
4
  export interface Cart {
@@ -13,4 +14,8 @@ export type GlobalVars = {
13
14
  export interface Globals {
14
15
  cart?: Cart;
15
16
  user?: User;
17
+ roles?: {
18
+ path: string;
19
+ name: string;
20
+ }[];
16
21
  }
package/dist/index.js CHANGED
@@ -1,13 +1,31 @@
1
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
+ };
2
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ const ticketops_1 = require("./ticketops");
18
+ __exportStar(require("./checkout"), exports);
3
19
  exports.default = {
4
20
  TradeOps_a: {},
5
21
  TicketOps_a: {
6
22
  cart: { timer: 10 * 60 * 1000 },
7
23
  user: { auth: true },
24
+ roles: ticketops_1.roles,
8
25
  },
9
26
  TicketOps_b: {
10
27
  cart: { timer: 10 * 60 * 1000 },
11
28
  user: { auth: false },
29
+ roles: ticketops_1.roles,
12
30
  },
13
31
  };
@@ -0,0 +1,4 @@
1
+ export declare const roles: {
2
+ path: string;
3
+ name: string;
4
+ }[];
@@ -0,0 +1,115 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.roles = void 0;
4
+ exports.roles = [
5
+ // ALBUM
6
+ { path: 'GET:/album', name: 'View Album' },
7
+ { path: 'POST:/album', name: 'Create Album' },
8
+ { path: 'PUT:/album', name: 'Update Album' },
9
+ { path: 'DELETE:/album', name: 'Delete Album' },
10
+ // BLOG
11
+ { path: 'GET:/blog', name: 'View Blog' },
12
+ { path: 'POST:/blog', name: 'Create Blog' },
13
+ { path: 'PUT:/blog', name: 'Update Blog' },
14
+ { path: 'DELETE:/blog', name: 'Delete Blog' },
15
+ // CAMPAIGN
16
+ { path: 'GET:/campaign', name: 'View Campaign' },
17
+ { path: 'POST:/campaign', name: 'Create Campaign' },
18
+ { path: 'PUT:/campaign', name: 'Update Campaign' },
19
+ { path: 'DELETE:/campaign', name: 'Delete Campaign' },
20
+ // EMAIL
21
+ { path: 'GET:/email', name: 'View Email' },
22
+ { path: 'POST:/email', name: 'Create Email' },
23
+ { path: 'PUT:/email', name: 'Update Email' },
24
+ { path: 'DELETE:/email', name: 'Delete Email' },
25
+ // ESTIMATOR
26
+ { path: 'GET:/estimator', name: 'View Estimator' },
27
+ { path: 'POST:/estimator', name: 'Create Estimator' },
28
+ { path: 'PUT:/estimator', name: 'Update Estimator' },
29
+ { path: 'DELETE:/estimator', name: 'Delete Estimator' },
30
+ // EVENT
31
+ { path: 'GET:/event', name: 'View Event' },
32
+ { path: 'POST:/event', name: 'Create Event' },
33
+ { path: 'PUT:/event', name: 'Update Event' },
34
+ { path: 'DELETE:/event', name: 'Delete Event' },
35
+ // FIXTURE
36
+ { path: 'GET:/fixture', name: 'View Fixture' },
37
+ { path: 'POST:/fixture', name: 'Create Fixture' },
38
+ { path: 'PUT:/fixture', name: 'Update Fixture' },
39
+ { path: 'DELETE:/fixture', name: 'Delete Fixture' },
40
+ // GROUP
41
+ { path: 'GET:/group', name: 'View Group' },
42
+ { path: 'POST:/group', name: 'Create Group' },
43
+ { path: 'PUT:/group', name: 'Update Group' },
44
+ { path: 'DELETE:/group', name: 'Delete Group' },
45
+ // JOB
46
+ { path: 'GET:/job', name: 'View Job' },
47
+ { path: 'POST:/job', name: 'Create Job' },
48
+ { path: 'PUT:/job', name: 'Update Job' },
49
+ { path: 'DELETE:/job', name: 'Delete Job' },
50
+ // LOG
51
+ { path: 'GET:/log', name: 'View Log' },
52
+ { path: 'POST:/log', name: 'Create Log' },
53
+ { path: 'PUT:/log', name: 'Update Log' },
54
+ { path: 'DELETE:/log', name: 'Delete Log' },
55
+ // PAGE
56
+ { path: 'GET:/page', name: 'View Page' },
57
+ { path: 'POST:/page', name: 'Create Page' },
58
+ { path: 'PUT:/page', name: 'Update Page' },
59
+ { path: 'DELETE:/page', name: 'Delete Page' },
60
+ // PIPELINE
61
+ { path: 'GET:/pipeline', name: 'View Pipeline' },
62
+ { path: 'POST:/pipeline', name: 'Create Pipeline' },
63
+ { path: 'PUT:/pipeline', name: 'Update Pipeline' },
64
+ { path: 'DELETE:/pipeline', name: 'Delete Pipeline' },
65
+ // PRODUCT
66
+ { path: 'GET:/product', name: 'View Product' },
67
+ { path: 'POST:/product', name: 'Create Product' },
68
+ { path: 'PUT:/product', name: 'Update Product' },
69
+ { path: 'DELETE:/product', name: 'Delete Product' },
70
+ // PROJECT
71
+ { path: 'GET:/project', name: 'View Project' },
72
+ { path: 'POST:/project', name: 'Create Project' },
73
+ { path: 'PUT:/project', name: 'Update Project' },
74
+ { path: 'DELETE:/project', name: 'Delete Project' },
75
+ // PROSPECT
76
+ { path: 'GET:/prospect', name: 'View Prospect' },
77
+ { path: 'POST:/prospect', name: 'Create Prospect' },
78
+ { path: 'PUT:/prospect', name: 'Update Prospect' },
79
+ { path: 'DELETE:/prospect', name: 'Delete Prospect' },
80
+ // QUOTE
81
+ { path: 'GET:/quote', name: 'View Quote' },
82
+ { path: 'POST:/quote', name: 'Create Quote' },
83
+ { path: 'PUT:/quote', name: 'Update Quote' },
84
+ { path: 'DELETE:/quote', name: 'Delete Quote' },
85
+ // REPORT
86
+ { path: 'GET:/report', name: 'View Report' },
87
+ { path: 'POST:/report', name: 'Create Report' },
88
+ { path: 'PUT:/report', name: 'Update Report' },
89
+ { path: 'DELETE:/report', name: 'Delete Report' },
90
+ // REVIEW
91
+ { path: 'GET:/review', name: 'View Review' },
92
+ { path: 'POST:/review', name: 'Create Review' },
93
+ { path: 'PUT:/review', name: 'Update Review' },
94
+ { path: 'DELETE:/review', name: 'Delete Review' },
95
+ // SALE
96
+ { path: 'GET:/sale', name: 'View Sale' },
97
+ { path: 'POST:/sale', name: 'Create Sale' },
98
+ { path: 'PUT:/sale', name: 'Update Sale' },
99
+ { path: 'DELETE:/sale', name: 'Delete Sale' },
100
+ // SECTION
101
+ { path: 'GET:/section', name: 'View Section' },
102
+ { path: 'POST:/section', name: 'Create Section' },
103
+ { path: 'PUT:/section', name: 'Update Section' },
104
+ { path: 'DELETE:/section', name: 'Delete Section' },
105
+ // TICKET
106
+ { path: 'GET:/ticket', name: 'View Ticket' },
107
+ { path: 'POST:/ticket', name: 'Create Ticket' },
108
+ { path: 'PUT:/ticket', name: 'Update Ticket' },
109
+ { path: 'DELETE:/ticket', name: 'Delete Ticket' },
110
+ // USER
111
+ { path: 'GET:/user', name: 'View User' },
112
+ { path: 'POST:/user', name: 'Create User' },
113
+ { path: 'PUT:/user', name: 'Update User' },
114
+ { path: 'DELETE:/user', name: 'Delete User' },
115
+ ];
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@ibiliaze/global-vars",
3
- "version": "1.0.5",
3
+ "version": "1.2.0",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "scripts": {
8
8
  "build": "tsc",
9
9
  "pub": "npm publish --access public",
10
- "git": "git add .; git commit -m 'changes'; git tag -a v1.0.5 -m 'v1.0.5'; git push origin v1.0.5; git push",
10
+ "git": "git add .; git commit -m 'changes'; git tag -a v1.2.0 -m 'v1.2.0'; git push origin v1.2.0; git push",
11
11
  "push": "npm run build; npm run git; npm run pub"
12
12
  },
13
13
  "author": "Ibi Hasanli",
@@ -0,0 +1,38 @@
1
+ export interface Checkout {
2
+ stripe: {};
3
+ epoint: Epoint;
4
+ local: Local;
5
+ }
6
+
7
+ export interface Epoint {
8
+ orderId: string | number;
9
+ amountAZN: string | number;
10
+ description?: string;
11
+ lang?: EpointLang;
12
+ successUrl?: string;
13
+ errorUrl?: string;
14
+ }
15
+
16
+ export interface Local {
17
+ email: string;
18
+ name: string;
19
+ tel: string;
20
+ address: string;
21
+ promoDiscount: number;
22
+ promoCode: string;
23
+ subscription: boolean;
24
+ successPath?: string;
25
+ cancelPath?: string;
26
+ items: LocalItem[];
27
+ }
28
+
29
+ export interface LocalItem {
30
+ _id: string;
31
+ type: 'product' | 'ticket';
32
+ subscriptionPeriod: '' | 'day' | 'week' | 'month' | 'year';
33
+ quantity: number;
34
+ price: number;
35
+ selectedAddonIds?: string[];
36
+ }
37
+
38
+ export type EpointLang = 'az' | 'en' | 'ru';
package/src/index.ts CHANGED
@@ -1,12 +1,17 @@
1
+ import { roles } from './ticketops';
2
+
3
+ export * from './checkout';
1
4
  export default {
2
5
  TradeOps_a: {},
3
6
  TicketOps_a: {
4
7
  cart: { timer: 10 * 60 * 1000 },
5
8
  user: { auth: true },
9
+ roles: roles,
6
10
  },
7
11
  TicketOps_b: {
8
12
  cart: { timer: 10 * 60 * 1000 },
9
13
  user: { auth: false },
14
+ roles: roles,
10
15
  },
11
16
  } as GlobalVars;
12
17
 
@@ -27,4 +32,5 @@ export type GlobalVars = {
27
32
  export interface Globals {
28
33
  cart?: Cart;
29
34
  user?: User;
35
+ roles?: { path: string; name: string }[];
30
36
  }
@@ -0,0 +1,133 @@
1
+ export const roles = [
2
+ // ALBUM
3
+ { path: 'GET:/album', name: 'View Album' },
4
+ { path: 'POST:/album', name: 'Create Album' },
5
+ { path: 'PUT:/album', name: 'Update Album' },
6
+ { path: 'DELETE:/album', name: 'Delete Album' },
7
+
8
+ // BLOG
9
+ { path: 'GET:/blog', name: 'View Blog' },
10
+ { path: 'POST:/blog', name: 'Create Blog' },
11
+ { path: 'PUT:/blog', name: 'Update Blog' },
12
+ { path: 'DELETE:/blog', name: 'Delete Blog' },
13
+
14
+ // CAMPAIGN
15
+ { path: 'GET:/campaign', name: 'View Campaign' },
16
+ { path: 'POST:/campaign', name: 'Create Campaign' },
17
+ { path: 'PUT:/campaign', name: 'Update Campaign' },
18
+ { path: 'DELETE:/campaign', name: 'Delete Campaign' },
19
+
20
+ // EMAIL
21
+ { path: 'GET:/email', name: 'View Email' },
22
+ { path: 'POST:/email', name: 'Create Email' },
23
+ { path: 'PUT:/email', name: 'Update Email' },
24
+ { path: 'DELETE:/email', name: 'Delete Email' },
25
+
26
+ // ESTIMATOR
27
+ { path: 'GET:/estimator', name: 'View Estimator' },
28
+ { path: 'POST:/estimator', name: 'Create Estimator' },
29
+ { path: 'PUT:/estimator', name: 'Update Estimator' },
30
+ { path: 'DELETE:/estimator', name: 'Delete Estimator' },
31
+
32
+ // EVENT
33
+ { path: 'GET:/event', name: 'View Event' },
34
+ { path: 'POST:/event', name: 'Create Event' },
35
+ { path: 'PUT:/event', name: 'Update Event' },
36
+ { path: 'DELETE:/event', name: 'Delete Event' },
37
+
38
+ // FIXTURE
39
+ { path: 'GET:/fixture', name: 'View Fixture' },
40
+ { path: 'POST:/fixture', name: 'Create Fixture' },
41
+ { path: 'PUT:/fixture', name: 'Update Fixture' },
42
+ { path: 'DELETE:/fixture', name: 'Delete Fixture' },
43
+
44
+ // GROUP
45
+ { path: 'GET:/group', name: 'View Group' },
46
+ { path: 'POST:/group', name: 'Create Group' },
47
+ { path: 'PUT:/group', name: 'Update Group' },
48
+ { path: 'DELETE:/group', name: 'Delete Group' },
49
+
50
+ // JOB
51
+ { path: 'GET:/job', name: 'View Job' },
52
+ { path: 'POST:/job', name: 'Create Job' },
53
+ { path: 'PUT:/job', name: 'Update Job' },
54
+ { path: 'DELETE:/job', name: 'Delete Job' },
55
+
56
+ // LOG
57
+ { path: 'GET:/log', name: 'View Log' },
58
+ { path: 'POST:/log', name: 'Create Log' },
59
+ { path: 'PUT:/log', name: 'Update Log' },
60
+ { path: 'DELETE:/log', name: 'Delete Log' },
61
+
62
+ // PAGE
63
+ { path: 'GET:/page', name: 'View Page' },
64
+ { path: 'POST:/page', name: 'Create Page' },
65
+ { path: 'PUT:/page', name: 'Update Page' },
66
+ { path: 'DELETE:/page', name: 'Delete Page' },
67
+
68
+ // PIPELINE
69
+ { path: 'GET:/pipeline', name: 'View Pipeline' },
70
+ { path: 'POST:/pipeline', name: 'Create Pipeline' },
71
+ { path: 'PUT:/pipeline', name: 'Update Pipeline' },
72
+ { path: 'DELETE:/pipeline', name: 'Delete Pipeline' },
73
+
74
+ // PRODUCT
75
+ { path: 'GET:/product', name: 'View Product' },
76
+ { path: 'POST:/product', name: 'Create Product' },
77
+ { path: 'PUT:/product', name: 'Update Product' },
78
+ { path: 'DELETE:/product', name: 'Delete Product' },
79
+
80
+ // PROJECT
81
+ { path: 'GET:/project', name: 'View Project' },
82
+ { path: 'POST:/project', name: 'Create Project' },
83
+ { path: 'PUT:/project', name: 'Update Project' },
84
+ { path: 'DELETE:/project', name: 'Delete Project' },
85
+
86
+ // PROSPECT
87
+ { path: 'GET:/prospect', name: 'View Prospect' },
88
+ { path: 'POST:/prospect', name: 'Create Prospect' },
89
+ { path: 'PUT:/prospect', name: 'Update Prospect' },
90
+ { path: 'DELETE:/prospect', name: 'Delete Prospect' },
91
+
92
+ // QUOTE
93
+ { path: 'GET:/quote', name: 'View Quote' },
94
+ { path: 'POST:/quote', name: 'Create Quote' },
95
+ { path: 'PUT:/quote', name: 'Update Quote' },
96
+ { path: 'DELETE:/quote', name: 'Delete Quote' },
97
+
98
+ // REPORT
99
+ { path: 'GET:/report', name: 'View Report' },
100
+ { path: 'POST:/report', name: 'Create Report' },
101
+ { path: 'PUT:/report', name: 'Update Report' },
102
+ { path: 'DELETE:/report', name: 'Delete Report' },
103
+
104
+ // REVIEW
105
+ { path: 'GET:/review', name: 'View Review' },
106
+ { path: 'POST:/review', name: 'Create Review' },
107
+ { path: 'PUT:/review', name: 'Update Review' },
108
+ { path: 'DELETE:/review', name: 'Delete Review' },
109
+
110
+ // SALE
111
+ { path: 'GET:/sale', name: 'View Sale' },
112
+ { path: 'POST:/sale', name: 'Create Sale' },
113
+ { path: 'PUT:/sale', name: 'Update Sale' },
114
+ { path: 'DELETE:/sale', name: 'Delete Sale' },
115
+
116
+ // SECTION
117
+ { path: 'GET:/section', name: 'View Section' },
118
+ { path: 'POST:/section', name: 'Create Section' },
119
+ { path: 'PUT:/section', name: 'Update Section' },
120
+ { path: 'DELETE:/section', name: 'Delete Section' },
121
+
122
+ // TICKET
123
+ { path: 'GET:/ticket', name: 'View Ticket' },
124
+ { path: 'POST:/ticket', name: 'Create Ticket' },
125
+ { path: 'PUT:/ticket', name: 'Update Ticket' },
126
+ { path: 'DELETE:/ticket', name: 'Delete Ticket' },
127
+
128
+ // USER
129
+ { path: 'GET:/user', name: 'View User' },
130
+ { path: 'POST:/user', name: 'Create User' },
131
+ { path: 'PUT:/user', name: 'Update User' },
132
+ { path: 'DELETE:/user', name: 'Delete User' },
133
+ ] satisfies { path: string; name: string }[];