@ibiliaze/global-vars 1.138.0 → 1.139.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.
@@ -1,4 +1,5 @@
1
- export declare const adminRoleDefs: readonly [{
1
+ import type { AdminBase } from '../inputsDefault';
2
+ export declare const adminRoleDefs: <TId, TDate>() => readonly [{
2
3
  readonly method: "post";
3
4
  readonly path: "/admin";
4
5
  readonly role: "postAdminRegister";
@@ -19,7 +20,7 @@ export declare const adminRoleDefs: readonly [{
19
20
  readonly role: "postAdminToken";
20
21
  readonly name: "Login admin";
21
22
  readonly response_200: {
22
- admin: any;
23
+ admin: AdminBase<TId, TDate>;
23
24
  message: string;
24
25
  };
25
26
  readonly response_401: {
@@ -62,7 +63,7 @@ export declare const adminRoleDefs: readonly [{
62
63
  readonly role: "postAdminLogout";
63
64
  readonly name: "Logout admin";
64
65
  readonly response_200: {
65
- admin: any;
66
+ admin: AdminBase<TId, TDate>;
66
67
  message: string;
67
68
  };
68
69
  readonly response_500: {
@@ -75,7 +76,7 @@ export declare const adminRoleDefs: readonly [{
75
76
  readonly role: "postAdminLogoutAll";
76
77
  readonly name: "Logout all sessions";
77
78
  readonly response_200: {
78
- admin: any;
79
+ admin: AdminBase<TId, TDate>;
79
80
  message: string;
80
81
  };
81
82
  readonly response_500: {
@@ -88,7 +89,7 @@ export declare const adminRoleDefs: readonly [{
88
89
  readonly role: "postAdminLogoutBySessionId";
89
90
  readonly name: "Logout session by ID";
90
91
  readonly response_200: {
91
- admin: any;
92
+ admin: AdminBase<TId, TDate>;
92
93
  message: string;
93
94
  };
94
95
  readonly response_500: {
@@ -101,7 +102,7 @@ export declare const adminRoleDefs: readonly [{
101
102
  readonly role: "getAdmin";
102
103
  readonly name: "Get admin";
103
104
  readonly response_200: {
104
- admin: any;
105
+ admin: AdminBase<TId, TDate>;
105
106
  };
106
107
  readonly response_500: {
107
108
  message: string;
@@ -126,7 +127,7 @@ export declare const adminRoleDefs: readonly [{
126
127
  readonly role: "getAdminPublic";
127
128
  readonly name: "Get public admin";
128
129
  readonly response_200: {
129
- admin: Partial<any>;
130
+ admin: Partial<AdminBase<TId, TDate>>;
130
131
  };
131
132
  readonly response_400: {
132
133
  message: string;
@@ -144,11 +145,11 @@ export declare const adminRoleDefs: readonly [{
144
145
  readonly role: "putAdmin";
145
146
  readonly name: "Update admin";
146
147
  readonly response_200: {
147
- admin: any;
148
+ admin: AdminBase<TId, TDate>;
148
149
  message: string;
149
150
  };
150
151
  readonly response_404: {
151
- admin: any | null;
152
+ admin: AdminBase<TId, TDate> | null;
152
153
  message: string;
153
154
  };
154
155
  readonly response_500: {
@@ -161,11 +162,11 @@ export declare const adminRoleDefs: readonly [{
161
162
  readonly role: "putAdminPassword";
162
163
  readonly name: "Update admin password";
163
164
  readonly response_200: {
164
- admin: any;
165
+ admin: AdminBase<TId, TDate>;
165
166
  message: string;
166
167
  };
167
168
  readonly response_404: {
168
- admin: any | null;
169
+ admin: AdminBase<TId, TDate> | null;
169
170
  message: string;
170
171
  };
171
172
  readonly response_500: {
@@ -178,7 +179,7 @@ export declare const adminRoleDefs: readonly [{
178
179
  readonly role: "deleteAdmin";
179
180
  readonly name: "Delete admin";
180
181
  readonly response_200: {
181
- admin: any;
182
+ admin: AdminBase<TId, TDate>;
182
183
  message: string;
183
184
  };
184
185
  readonly response_500: {
@@ -1,130 +1,133 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.adminRoleDefs = void 0;
4
- exports.adminRoleDefs = [
5
- // POST /admin – register
6
- {
7
- method: 'post',
8
- path: '/admin',
9
- role: 'postAdminRegister',
10
- name: 'Register admin',
11
- response_201: {},
12
- response_400: {}, // "Account is already registered"
13
- response_500: {},
14
- },
15
- // POST /admin/token – login
16
- {
17
- method: 'post',
18
- path: '/admin/token',
19
- role: 'postAdminToken',
20
- name: 'Login admin',
21
- response_200: {},
22
- response_401: {},
23
- },
24
- // POST /admin/google/backup
25
- {
26
- method: 'post',
27
- path: '/admin/google/backup',
28
- role: 'postAdminGoogleBackup',
29
- name: 'Google backup',
30
- response_200: {},
31
- response_400: {}, // error from backup()
32
- response_500: {},
33
- },
34
- // POST /admin/google/backup/restore
35
- {
36
- method: 'post',
37
- path: '/admin/google/backup/restore',
38
- role: 'postAdminGoogleBackupRestore',
39
- name: 'Restore Google backup',
40
- response_200: {},
41
- response_400: {},
42
- response_500: {},
43
- },
44
- // POST /admin/logout
45
- {
46
- method: 'post',
47
- path: '/admin/logout',
48
- role: 'postAdminLogout',
49
- name: 'Logout admin',
50
- response_200: {},
51
- response_500: {},
52
- },
53
- // POST /admin/logout/all
54
- {
55
- method: 'post',
56
- path: '/admin/logout/all',
57
- role: 'postAdminLogoutAll',
58
- name: 'Logout all sessions',
59
- response_200: {},
60
- response_500: {},
61
- },
62
- // POST /admin/logout/:id
63
- {
64
- method: 'post',
65
- path: '/admin/logout/:id',
66
- role: 'postAdminLogoutBySessionId',
67
- name: 'Logout session by ID',
68
- response_200: {},
69
- response_500: {},
70
- },
71
- // GET /admin – get current admin
72
- {
73
- method: 'get',
74
- path: '/admin',
75
- role: 'getAdmin',
76
- name: 'Get admin',
77
- response_200: {},
78
- response_500: {},
79
- },
80
- // GET /admin/exists/:email
81
- {
82
- method: 'get',
83
- path: '/admin/exists/:email',
84
- role: 'getAdminExistsByEmail',
85
- name: 'Check admin exists by email',
86
- response_200: {}, // empty body on 200
87
- response_409: {},
88
- response_500: {},
89
- },
90
- // GET /admin/public
91
- {
92
- method: 'get',
93
- path: '/admin/public',
94
- role: 'getAdminPublic',
95
- name: 'Get public admin',
96
- response_200: {},
97
- response_400: {}, // "Invalid select"
98
- response_404: {}, // "No account found"
99
- response_500: {},
100
- },
101
- // PUT /admin – update admin
102
- {
103
- method: 'put',
104
- path: '/admin',
105
- role: 'putAdmin',
106
- name: 'Update admin',
107
- response_200: {},
108
- response_404: {},
109
- response_500: {},
110
- },
111
- // PUT /admin/password – update password
112
- {
113
- method: 'put',
114
- path: '/admin/password',
115
- role: 'putAdminPassword',
116
- name: 'Update admin password',
117
- response_200: {},
118
- response_404: {},
119
- response_500: {},
120
- },
121
- // DELETE /admin – delete account
122
- {
123
- method: 'delete',
124
- path: '/admin',
125
- role: 'deleteAdmin',
126
- name: 'Delete admin',
127
- response_200: {},
128
- response_500: {},
129
- },
130
- ];
4
+ const adminRoleDefs = () => {
5
+ return [
6
+ // POST /admin – register
7
+ {
8
+ method: 'post',
9
+ path: '/admin',
10
+ role: 'postAdminRegister',
11
+ name: 'Register admin',
12
+ response_201: {},
13
+ response_400: {}, // "Account is already registered"
14
+ response_500: {},
15
+ },
16
+ // POST /admin/token – login
17
+ {
18
+ method: 'post',
19
+ path: '/admin/token',
20
+ role: 'postAdminToken',
21
+ name: 'Login admin',
22
+ response_200: {},
23
+ response_401: {},
24
+ },
25
+ // POST /admin/google/backup
26
+ {
27
+ method: 'post',
28
+ path: '/admin/google/backup',
29
+ role: 'postAdminGoogleBackup',
30
+ name: 'Google backup',
31
+ response_200: {},
32
+ response_400: {}, // error from backup()
33
+ response_500: {},
34
+ },
35
+ // POST /admin/google/backup/restore
36
+ {
37
+ method: 'post',
38
+ path: '/admin/google/backup/restore',
39
+ role: 'postAdminGoogleBackupRestore',
40
+ name: 'Restore Google backup',
41
+ response_200: {},
42
+ response_400: {},
43
+ response_500: {},
44
+ },
45
+ // POST /admin/logout
46
+ {
47
+ method: 'post',
48
+ path: '/admin/logout',
49
+ role: 'postAdminLogout',
50
+ name: 'Logout admin',
51
+ response_200: {},
52
+ response_500: {},
53
+ },
54
+ // POST /admin/logout/all
55
+ {
56
+ method: 'post',
57
+ path: '/admin/logout/all',
58
+ role: 'postAdminLogoutAll',
59
+ name: 'Logout all sessions',
60
+ response_200: {},
61
+ response_500: {},
62
+ },
63
+ // POST /admin/logout/:id
64
+ {
65
+ method: 'post',
66
+ path: '/admin/logout/:id',
67
+ role: 'postAdminLogoutBySessionId',
68
+ name: 'Logout session by ID',
69
+ response_200: {},
70
+ response_500: {},
71
+ },
72
+ // GET /admin – get current admin
73
+ {
74
+ method: 'get',
75
+ path: '/admin',
76
+ role: 'getAdmin',
77
+ name: 'Get admin',
78
+ response_200: {},
79
+ response_500: {},
80
+ },
81
+ // GET /admin/exists/:email
82
+ {
83
+ method: 'get',
84
+ path: '/admin/exists/:email',
85
+ role: 'getAdminExistsByEmail',
86
+ name: 'Check admin exists by email',
87
+ response_200: {}, // empty body on 200
88
+ response_409: {},
89
+ response_500: {},
90
+ },
91
+ // GET /admin/public
92
+ {
93
+ method: 'get',
94
+ path: '/admin/public',
95
+ role: 'getAdminPublic',
96
+ name: 'Get public admin',
97
+ response_200: {},
98
+ response_400: {}, // "Invalid select"
99
+ response_404: {}, // "No account found"
100
+ response_500: {},
101
+ },
102
+ // PUT /admin – update admin
103
+ {
104
+ method: 'put',
105
+ path: '/admin',
106
+ role: 'putAdmin',
107
+ name: 'Update admin',
108
+ response_200: {},
109
+ response_404: {},
110
+ response_500: {},
111
+ },
112
+ // PUT /admin/password – update password
113
+ {
114
+ method: 'put',
115
+ path: '/admin/password',
116
+ role: 'putAdminPassword',
117
+ name: 'Update admin password',
118
+ response_200: {},
119
+ response_404: {},
120
+ response_500: {},
121
+ },
122
+ // DELETE /admin – delete account
123
+ {
124
+ method: 'delete',
125
+ path: '/admin',
126
+ role: 'deleteAdmin',
127
+ name: 'Delete admin',
128
+ response_200: {},
129
+ response_500: {},
130
+ },
131
+ ];
132
+ };
133
+ exports.adminRoleDefs = adminRoleDefs;
@@ -1,10 +1,11 @@
1
- export declare const blogRoleDefs: readonly [{
1
+ import type { BlogBase } from '../inputsDefault';
2
+ export declare const blogRoleDefs: <TId, TDate>() => readonly [{
2
3
  readonly method: "post";
3
4
  readonly path: "/blog";
4
5
  readonly role: "postBlog";
5
6
  readonly name: "Create blog";
6
7
  readonly response_201: {
7
- blog: any;
8
+ blog: BlogBase<TId, TDate>;
8
9
  message: string;
9
10
  };
10
11
  readonly response_500: {
@@ -17,7 +18,7 @@ export declare const blogRoleDefs: readonly [{
17
18
  readonly role: "getBlogs";
18
19
  readonly name: "Get blogs";
19
20
  readonly response_200: {
20
- blogs: any[];
21
+ blogs: BlogBase<TId, TDate>[];
21
22
  count: number;
22
23
  };
23
24
  readonly response_500: {
@@ -30,7 +31,7 @@ export declare const blogRoleDefs: readonly [{
30
31
  readonly role: "getBlogById";
31
32
  readonly name: "Get blog";
32
33
  readonly response_200: {
33
- blog: any | null;
34
+ blog: BlogBase<TId, TDate> | null;
34
35
  message: string;
35
36
  };
36
37
  readonly response_404: {
@@ -43,11 +44,11 @@ export declare const blogRoleDefs: readonly [{
43
44
  readonly role: "putBlogById";
44
45
  readonly name: "Update blog";
45
46
  readonly response_200: {
46
- blog: any;
47
+ blog: BlogBase<TId, TDate>;
47
48
  message: string;
48
49
  };
49
50
  readonly response_404: {
50
- blog: any | null;
51
+ blog: BlogBase<TId, TDate> | null;
51
52
  message: string;
52
53
  };
53
54
  readonly response_500: {
@@ -60,11 +61,11 @@ export declare const blogRoleDefs: readonly [{
60
61
  readonly role: "deleteBlogById";
61
62
  readonly name: "Delete blog";
62
63
  readonly response_200: {
63
- blog: any;
64
+ blog: BlogBase<TId, TDate>;
64
65
  message: string;
65
66
  };
66
67
  readonly response_404: {
67
- blog: any | null;
68
+ blog: BlogBase<TId, TDate> | null;
68
69
  message: string;
69
70
  };
70
71
  readonly response_500: {
@@ -1,52 +1,55 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.blogRoleDefs = void 0;
4
- exports.blogRoleDefs = [
5
- // POST /blog – create
6
- {
7
- method: 'post',
8
- path: '/blog',
9
- role: 'postBlog',
10
- name: 'Create blog',
11
- response_201: {},
12
- response_500: {},
13
- },
14
- // GET /blog – list
15
- {
16
- method: 'get',
17
- path: '/blog',
18
- role: 'getBlogs',
19
- name: 'Get blogs',
20
- response_200: {},
21
- response_500: {},
22
- },
23
- // GET /blog/:id – get one
24
- {
25
- method: 'get',
26
- path: '/blog/:id',
27
- role: 'getBlogById',
28
- name: 'Get blog',
29
- response_200: {},
30
- response_404: {},
31
- },
32
- // PUT /blog/:id – update
33
- {
34
- method: 'put',
35
- path: '/blog/:id',
36
- role: 'putBlogById',
37
- name: 'Update blog',
38
- response_200: {},
39
- response_404: {},
40
- response_500: {},
41
- },
42
- // DELETE /blog/:id – delete
43
- {
44
- method: 'delete',
45
- path: '/blog/:id',
46
- role: 'deleteBlogById',
47
- name: 'Delete blog',
48
- response_200: {},
49
- response_404: {},
50
- response_500: {},
51
- },
52
- ];
4
+ const blogRoleDefs = () => {
5
+ return [
6
+ // POST /blog – create
7
+ {
8
+ method: 'post',
9
+ path: '/blog',
10
+ role: 'postBlog',
11
+ name: 'Create blog',
12
+ response_201: {},
13
+ response_500: {},
14
+ },
15
+ // GET /blog – list
16
+ {
17
+ method: 'get',
18
+ path: '/blog',
19
+ role: 'getBlogs',
20
+ name: 'Get blogs',
21
+ response_200: {},
22
+ response_500: {},
23
+ },
24
+ // GET /blog/:id – get one
25
+ {
26
+ method: 'get',
27
+ path: '/blog/:id',
28
+ role: 'getBlogById',
29
+ name: 'Get blog',
30
+ response_200: {},
31
+ response_404: {},
32
+ },
33
+ // PUT /blog/:id – update
34
+ {
35
+ method: 'put',
36
+ path: '/blog/:id',
37
+ role: 'putBlogById',
38
+ name: 'Update blog',
39
+ response_200: {},
40
+ response_404: {},
41
+ response_500: {},
42
+ },
43
+ // DELETE /blog/:id – delete
44
+ {
45
+ method: 'delete',
46
+ path: '/blog/:id',
47
+ role: 'deleteBlogById',
48
+ name: 'Delete blog',
49
+ response_200: {},
50
+ response_404: {},
51
+ response_500: {},
52
+ },
53
+ ];
54
+ };
55
+ exports.blogRoleDefs = blogRoleDefs;
@@ -1,10 +1,11 @@
1
- export declare const campaignRoleDefs: readonly [{
1
+ import type { CampaignBase, CampaignStageBase } from '../inputsDefault';
2
+ export declare const campaignRoleDefs: <TId, TDate>() => readonly [{
2
3
  readonly method: "post";
3
4
  readonly path: "/campaign";
4
5
  readonly role: "postCampaign";
5
6
  readonly name: "Create campaign";
6
7
  readonly response_201: {
7
- campaign: any;
8
+ campaign: CampaignBase<TId, TDate>;
8
9
  message: string;
9
10
  };
10
11
  readonly response_500: {
@@ -17,7 +18,7 @@ export declare const campaignRoleDefs: readonly [{
17
18
  readonly role: "postCampaignStartById";
18
19
  readonly name: "Start campaign by ID";
19
20
  readonly response_200: {
20
- campaign: any;
21
+ campaign: CampaignBase<TId, TDate>;
21
22
  message: string;
22
23
  };
23
24
  readonly response_400: {
@@ -39,7 +40,7 @@ export declare const campaignRoleDefs: readonly [{
39
40
  readonly role: "postCampaignStopById";
40
41
  readonly name: "Stop campaign by ID";
41
42
  readonly response_200: {
42
- campaign: any;
43
+ campaign: CampaignBase<TId, TDate>;
43
44
  message: string;
44
45
  };
45
46
  readonly response_404: {
@@ -55,7 +56,7 @@ export declare const campaignRoleDefs: readonly [{
55
56
  readonly role: "getCampaigns";
56
57
  readonly name: "Get campaigns";
57
58
  readonly response_200: {
58
- campaigns: any[];
59
+ campaigns: CampaignBase<TId, TDate>[];
59
60
  count: number;
60
61
  };
61
62
  readonly response_500: {
@@ -68,7 +69,9 @@ export declare const campaignRoleDefs: readonly [{
68
69
  readonly role: "getCampaignInsightById";
69
70
  readonly name: "Get campaign insight";
70
71
  readonly response_200: {
71
- stages: any[];
72
+ stages: (CampaignStageBase<TId> & {
73
+ stageId: string;
74
+ }[]) | null;
72
75
  };
73
76
  readonly response_400: {
74
77
  message: string;
@@ -83,7 +86,7 @@ export declare const campaignRoleDefs: readonly [{
83
86
  readonly role: "getCampaignById";
84
87
  readonly name: "Get campaign";
85
88
  readonly response_200: {
86
- campaign: any | null;
89
+ campaign: CampaignBase<TId, TDate> | null;
87
90
  message: string;
88
91
  };
89
92
  readonly response_404: {
@@ -96,11 +99,11 @@ export declare const campaignRoleDefs: readonly [{
96
99
  readonly role: "putCampaignById";
97
100
  readonly name: "Update campaign";
98
101
  readonly response_200: {
99
- campaign: any;
102
+ campaign: CampaignBase<TId, TDate>;
100
103
  message: string;
101
104
  };
102
105
  readonly response_404: {
103
- campaign: any | null;
106
+ campaign: CampaignBase<TId, TDate> | null;
104
107
  message: string;
105
108
  };
106
109
  readonly response_500: {
@@ -113,11 +116,11 @@ export declare const campaignRoleDefs: readonly [{
113
116
  readonly role: "deleteCampaignById";
114
117
  readonly name: "Delete campaign";
115
118
  readonly response_200: {
116
- campaign: any;
119
+ campaign: CampaignBase<TId, TDate>;
117
120
  message: string;
118
121
  };
119
122
  readonly response_404: {
120
- campaign: any | null;
123
+ campaign: CampaignBase<TId, TDate> | null;
121
124
  message: string;
122
125
  };
123
126
  readonly response_500: {