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