@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,84 +1,87 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.campaignRoleDefs = void 0;
4
- exports.campaignRoleDefs = [
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
- },
84
- ];
4
+ const campaignRoleDefs = () => {
5
+ return [
6
+ // POST /campaign – create
7
+ {
8
+ method: 'post',
9
+ path: '/campaign',
10
+ role: 'postCampaign',
11
+ name: 'Create campaign',
12
+ response_201: {},
13
+ response_500: {},
14
+ },
15
+ // POST /campaign/start/:id – start & schedule
16
+ {
17
+ method: 'post',
18
+ path: '/campaign/start/:id',
19
+ role: 'postCampaignStartById',
20
+ name: 'Start campaign by ID',
21
+ response_200: {},
22
+ response_400: {}, // invalid stage/time/type/schedule error
23
+ response_401: {}, // active limit exceeded
24
+ response_404: {}, // not found
25
+ response_500: {},
26
+ },
27
+ // POST /campaign/stop/:id – stop
28
+ {
29
+ method: 'post',
30
+ path: '/campaign/stop/:id',
31
+ role: 'postCampaignStopById',
32
+ name: 'Stop campaign by ID',
33
+ response_200: {},
34
+ response_404: {}, // not found
35
+ response_500: {},
36
+ },
37
+ // GET /campaign – list
38
+ {
39
+ method: 'get',
40
+ path: '/campaign',
41
+ role: 'getCampaigns',
42
+ name: 'Get campaigns',
43
+ response_200: {},
44
+ response_500: {},
45
+ },
46
+ // GET /campaign/insight/:id – insights
47
+ {
48
+ method: 'get',
49
+ path: '/campaign/insight/:id',
50
+ role: 'getCampaignInsightById',
51
+ name: 'Get campaign insight',
52
+ response_200: {},
53
+ response_400: {}, // "Campaign not found"
54
+ response_500: {}, // from insights or catch
55
+ },
56
+ // GET /campaign/:id – one
57
+ {
58
+ method: 'get',
59
+ path: '/campaign/:id',
60
+ role: 'getCampaignById',
61
+ name: 'Get campaign',
62
+ response_200: {},
63
+ response_404: {},
64
+ },
65
+ // PUT /campaign/:id – update
66
+ {
67
+ method: 'put',
68
+ path: '/campaign/:id',
69
+ role: 'putCampaignById',
70
+ name: 'Update campaign',
71
+ response_200: {},
72
+ response_404: {},
73
+ response_500: {},
74
+ },
75
+ // DELETE /campaign/:id – delete
76
+ {
77
+ method: 'delete',
78
+ path: '/campaign/:id',
79
+ role: 'deleteCampaignById',
80
+ name: 'Delete campaign',
81
+ response_200: {},
82
+ response_404: {},
83
+ response_500: {},
84
+ },
85
+ ];
86
+ };
87
+ exports.campaignRoleDefs = campaignRoleDefs;
@@ -1,26 +1,75 @@
1
- export declare const categoryRoleDefs: readonly [{
1
+ import type { CategoryBase } from '../inputsDefault';
2
+ export declare const categoryRoleDefs: <TId, TDate>() => readonly [{
2
3
  readonly method: "post";
3
4
  readonly path: "/category";
4
5
  readonly role: "postCategory";
5
6
  readonly name: "Create category";
7
+ readonly response_201: {
8
+ category: CategoryBase<TId, TDate>;
9
+ message: string;
10
+ };
11
+ readonly response_500: {
12
+ message: string;
13
+ error: string;
14
+ };
6
15
  }, {
7
16
  readonly method: "get";
8
17
  readonly path: "/category";
9
18
  readonly role: "getCategories";
10
19
  readonly name: "Get categories";
20
+ readonly response_200: {
21
+ categories: CategoryBase<TId, TDate>[];
22
+ count: number;
23
+ };
24
+ readonly response_500: {
25
+ message: string;
26
+ error: string;
27
+ };
11
28
  }, {
12
29
  readonly method: "get";
13
30
  readonly path: "/category/:id";
14
31
  readonly role: "getCategoryById";
15
32
  readonly name: "Get category";
33
+ readonly response_200: {
34
+ category: CategoryBase<TId, TDate> | null;
35
+ message: string;
36
+ };
37
+ readonly response_404: {
38
+ message: string;
39
+ error: string;
40
+ };
16
41
  }, {
17
42
  readonly method: "put";
18
43
  readonly path: "/category/:id";
19
44
  readonly role: "putCategoryById";
20
45
  readonly name: "Update category";
46
+ readonly response_200: {
47
+ category: CategoryBase<TId, TDate>;
48
+ message: string;
49
+ };
50
+ readonly response_404: {
51
+ category: CategoryBase<TId, TDate> | null;
52
+ message: string;
53
+ };
54
+ readonly response_500: {
55
+ message: string;
56
+ error: string;
57
+ };
21
58
  }, {
22
59
  readonly method: "delete";
23
60
  readonly path: "/category/:id";
24
61
  readonly role: "deleteCategoryById";
25
62
  readonly name: "Delete category";
63
+ readonly response_200: {
64
+ category: CategoryBase<TId, TDate>;
65
+ message: string;
66
+ };
67
+ readonly response_404: {
68
+ category: CategoryBase<TId, TDate> | null;
69
+ message: string;
70
+ };
71
+ readonly response_500: {
72
+ message: string;
73
+ error: string;
74
+ };
26
75
  }];
@@ -1,10 +1,55 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.categoryRoleDefs = void 0;
4
- exports.categoryRoleDefs = [
5
- { method: 'post', path: '/category', role: 'postCategory', name: 'Create category' },
6
- { method: 'get', path: '/category', role: 'getCategories', name: 'Get categories' },
7
- { method: 'get', path: '/category/:id', role: 'getCategoryById', name: 'Get category' },
8
- { method: 'put', path: '/category/:id', role: 'putCategoryById', name: 'Update category' },
9
- { method: 'delete', path: '/category/:id', role: 'deleteCategoryById', name: 'Delete category' },
10
- ];
4
+ const categoryRoleDefs = () => {
5
+ return [
6
+ // POST /category create
7
+ {
8
+ method: 'post',
9
+ path: '/category',
10
+ role: 'postCategory',
11
+ name: 'Create category',
12
+ response_201: {},
13
+ response_500: {},
14
+ },
15
+ // GET /category – list
16
+ {
17
+ method: 'get',
18
+ path: '/category',
19
+ role: 'getCategories',
20
+ name: 'Get categories',
21
+ response_200: {},
22
+ response_500: {},
23
+ },
24
+ // GET /category/:id – get one
25
+ {
26
+ method: 'get',
27
+ path: '/category/:id',
28
+ role: 'getCategoryById',
29
+ name: 'Get category',
30
+ response_200: {},
31
+ response_404: {},
32
+ },
33
+ // PUT /category/:id – update
34
+ {
35
+ method: 'put',
36
+ path: '/category/:id',
37
+ role: 'putCategoryById',
38
+ name: 'Update category',
39
+ response_200: {},
40
+ response_404: {},
41
+ response_500: {},
42
+ },
43
+ // DELETE /category/:id – delete
44
+ {
45
+ method: 'delete',
46
+ path: '/category/:id',
47
+ role: 'deleteCategoryById',
48
+ name: 'Delete category',
49
+ response_200: {},
50
+ response_404: {},
51
+ response_500: {},
52
+ },
53
+ ];
54
+ };
55
+ exports.categoryRoleDefs = categoryRoleDefs;
@@ -1,46 +1,132 @@
1
- export declare const eventRoleDefs: readonly [{
1
+ import type { EventBase } from '../inputsDefault';
2
+ export declare const eventRoleDefs: <TId, TDate>() => readonly [{
2
3
  readonly method: "post";
3
4
  readonly path: "/event/book";
4
5
  readonly role: "postEventBook";
5
6
  readonly name: "Book event";
7
+ readonly response_201: {
8
+ event: EventBase<TId, TDate>;
9
+ message: string;
10
+ };
11
+ readonly response_400: {
12
+ message: string;
13
+ };
14
+ readonly response_500: {
15
+ message: string;
16
+ error: string;
17
+ };
6
18
  }, {
7
19
  readonly method: "post";
8
20
  readonly path: "/event";
9
21
  readonly role: "postEvent";
10
22
  readonly name: "Create event";
23
+ readonly response_201: {
24
+ event: EventBase<TId, TDate>;
25
+ message: string;
26
+ };
27
+ readonly response_500: {
28
+ message: string;
29
+ error: string;
30
+ };
11
31
  }, {
12
32
  readonly method: "post";
13
33
  readonly path: "/events";
14
34
  readonly role: "postEvents";
15
35
  readonly name: "Create many events";
36
+ readonly response_201: {
37
+ events: EventBase<TId, TDate>[];
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: "/event/book/cancel";
19
47
  readonly role: "postEventBookCancel";
20
48
  readonly name: "Request booking cancel";
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: "get";
23
61
  readonly path: "/event";
24
62
  readonly role: "getEvents";
25
63
  readonly name: "Get events";
64
+ readonly response_200: {
65
+ events: EventBase<TId, TDate>[];
66
+ count: number;
67
+ };
68
+ readonly response_500: {
69
+ message: string;
70
+ error: string;
71
+ };
26
72
  }, {
27
73
  readonly method: "get";
28
74
  readonly path: "/event/:id";
29
75
  readonly role: "getEventById";
30
76
  readonly name: "Get event";
77
+ readonly response_200: {
78
+ event: EventBase<TId, TDate> | null;
79
+ message: string;
80
+ };
81
+ readonly response_404: {
82
+ message: string;
83
+ error: string;
84
+ };
31
85
  }, {
32
86
  readonly method: "put";
33
87
  readonly path: "/event/:id";
34
88
  readonly role: "putEventById";
35
89
  readonly name: "Update event";
90
+ readonly response_200: {
91
+ event: EventBase<TId, TDate>;
92
+ message: string;
93
+ };
94
+ readonly response_404: {
95
+ event: EventBase<TId, TDate> | null;
96
+ message: string;
97
+ };
98
+ readonly response_500: {
99
+ message: string;
100
+ error: string;
101
+ };
36
102
  }, {
37
103
  readonly method: "delete";
38
104
  readonly path: "/events";
39
105
  readonly role: "deleteEvents";
40
106
  readonly name: "Delete many events";
107
+ readonly response_200: {
108
+ deletedCount: number;
109
+ message: string;
110
+ };
111
+ readonly response_500: {
112
+ message: string;
113
+ error: string;
114
+ };
41
115
  }, {
42
116
  readonly method: "delete";
43
117
  readonly path: "/event/:id";
44
118
  readonly role: "deleteEventById";
45
119
  readonly name: "Delete event";
120
+ readonly response_200: {
121
+ event: EventBase<TId, TDate>;
122
+ message: string;
123
+ };
124
+ readonly response_404: {
125
+ event: EventBase<TId, TDate> | null;
126
+ message: string;
127
+ };
128
+ readonly response_500: {
129
+ message: string;
130
+ error: string;
131
+ };
46
132
  }];
@@ -1,14 +1,84 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.eventRoleDefs = void 0;
4
- exports.eventRoleDefs = [
5
- { method: 'post', path: '/event/book', role: 'postEventBook', name: 'Book event' },
6
- { method: 'post', path: '/event', role: 'postEvent', name: 'Create event' },
7
- { method: 'post', path: '/events', role: 'postEvents', name: 'Create many events' },
8
- { method: 'post', path: '/event/book/cancel', role: 'postEventBookCancel', name: 'Request booking cancel' },
9
- { method: 'get', path: '/event', role: 'getEvents', name: 'Get events' },
10
- { method: 'get', path: '/event/:id', role: 'getEventById', name: 'Get event' },
11
- { method: 'put', path: '/event/:id', role: 'putEventById', name: 'Update event' },
12
- { method: 'delete', path: '/events', role: 'deleteEvents', name: 'Delete many events' },
13
- { method: 'delete', path: '/event/:id', role: 'deleteEventById', name: 'Delete event' },
14
- ];
4
+ const eventRoleDefs = () => {
5
+ return [
6
+ {
7
+ method: 'post',
8
+ path: '/event/book',
9
+ role: 'postEventBook',
10
+ name: 'Book event',
11
+ response_201: {},
12
+ response_400: {},
13
+ response_500: {},
14
+ },
15
+ {
16
+ method: 'post',
17
+ path: '/event',
18
+ role: 'postEvent',
19
+ name: 'Create event',
20
+ response_201: {},
21
+ response_500: {},
22
+ },
23
+ {
24
+ method: 'post',
25
+ path: '/events',
26
+ role: 'postEvents',
27
+ name: 'Create many events',
28
+ response_201: {},
29
+ response_500: {},
30
+ },
31
+ {
32
+ method: 'post',
33
+ path: '/event/book/cancel',
34
+ role: 'postEventBookCancel',
35
+ name: 'Request booking cancel',
36
+ response_200: {},
37
+ response_400: {},
38
+ response_500: {},
39
+ },
40
+ {
41
+ method: 'get',
42
+ path: '/event',
43
+ role: 'getEvents',
44
+ name: 'Get events',
45
+ response_200: {},
46
+ response_500: {},
47
+ },
48
+ {
49
+ method: 'get',
50
+ path: '/event/:id',
51
+ role: 'getEventById',
52
+ name: 'Get event',
53
+ response_200: {},
54
+ response_404: {},
55
+ },
56
+ {
57
+ method: 'put',
58
+ path: '/event/:id',
59
+ role: 'putEventById',
60
+ name: 'Update event',
61
+ response_200: {},
62
+ response_404: {},
63
+ response_500: {},
64
+ },
65
+ {
66
+ method: 'delete',
67
+ path: '/events',
68
+ role: 'deleteEvents',
69
+ name: 'Delete many events',
70
+ response_200: {},
71
+ response_500: {},
72
+ },
73
+ {
74
+ method: 'delete',
75
+ path: '/event/:id',
76
+ role: 'deleteEventById',
77
+ name: 'Delete event',
78
+ response_200: {},
79
+ response_404: {},
80
+ response_500: {},
81
+ },
82
+ ];
83
+ };
84
+ exports.eventRoleDefs = eventRoleDefs;
@@ -1,26 +1,75 @@
1
- export declare const fixtureRoleDefs: readonly [{
1
+ import type { FixtureBase } from '../inputsDefault';
2
+ export declare const fixtureRoleDefs: <TId, TDate>() => readonly [{
2
3
  readonly method: "post";
3
4
  readonly path: "/fixture";
4
5
  readonly role: "postFixture";
5
6
  readonly name: "Create fixture";
7
+ readonly response_201: {
8
+ fixture: FixtureBase<TId, TDate>;
9
+ message: string;
10
+ };
11
+ readonly response_500: {
12
+ message: string;
13
+ error: string;
14
+ };
6
15
  }, {
7
16
  readonly method: "get";
8
17
  readonly path: "/fixture";
9
18
  readonly role: "getFixtures";
10
19
  readonly name: "Get fixtures";
20
+ readonly response_200: {
21
+ fixtures: FixtureBase<TId, TDate>[];
22
+ count: number;
23
+ };
24
+ readonly response_500: {
25
+ message: string;
26
+ error: string;
27
+ };
11
28
  }, {
12
29
  readonly method: "get";
13
30
  readonly path: "/fixture/:id";
14
31
  readonly role: "getFixtureById";
15
32
  readonly name: "Get fixture";
33
+ readonly response_200: {
34
+ fixture: FixtureBase<TId, TDate> | null;
35
+ message: string;
36
+ };
37
+ readonly response_404: {
38
+ message: string;
39
+ error: string;
40
+ };
16
41
  }, {
17
42
  readonly method: "put";
18
43
  readonly path: "/fixture/:id";
19
44
  readonly role: "putFixtureById";
20
45
  readonly name: "Update fixture";
46
+ readonly response_200: {
47
+ fixture: FixtureBase<TId, TDate>;
48
+ message: string;
49
+ };
50
+ readonly response_404: {
51
+ fixture: FixtureBase<TId, TDate> | null;
52
+ message: string;
53
+ };
54
+ readonly response_500: {
55
+ message: string;
56
+ error: string;
57
+ };
21
58
  }, {
22
59
  readonly method: "delete";
23
60
  readonly path: "/fixture/:id";
24
61
  readonly role: "deleteFixtureById";
25
62
  readonly name: "Delete fixture";
63
+ readonly response_200: {
64
+ fixture: FixtureBase<TId, TDate>;
65
+ message: string;
66
+ };
67
+ readonly response_404: {
68
+ fixture: FixtureBase<TId, TDate> | null;
69
+ message: string;
70
+ };
71
+ readonly response_500: {
72
+ message: string;
73
+ error: string;
74
+ };
26
75
  }];
@@ -1,10 +1,50 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.fixtureRoleDefs = void 0;
4
- exports.fixtureRoleDefs = [
5
- { method: 'post', path: '/fixture', role: 'postFixture', name: 'Create fixture' },
6
- { method: 'get', path: '/fixture', role: 'getFixtures', name: 'Get fixtures' },
7
- { method: 'get', path: '/fixture/:id', role: 'getFixtureById', name: 'Get fixture' },
8
- { method: 'put', path: '/fixture/:id', role: 'putFixtureById', name: 'Update fixture' },
9
- { method: 'delete', path: '/fixture/:id', role: 'deleteFixtureById', name: 'Delete fixture' },
10
- ];
4
+ const fixtureRoleDefs = () => {
5
+ return [
6
+ {
7
+ method: 'post',
8
+ path: '/fixture',
9
+ role: 'postFixture',
10
+ name: 'Create fixture',
11
+ response_201: {},
12
+ response_500: {},
13
+ },
14
+ {
15
+ method: 'get',
16
+ path: '/fixture',
17
+ role: 'getFixtures',
18
+ name: 'Get fixtures',
19
+ response_200: {},
20
+ response_500: {},
21
+ },
22
+ {
23
+ method: 'get',
24
+ path: '/fixture/:id',
25
+ role: 'getFixtureById',
26
+ name: 'Get fixture',
27
+ response_200: {},
28
+ response_404: {},
29
+ },
30
+ {
31
+ method: 'put',
32
+ path: '/fixture/:id',
33
+ role: 'putFixtureById',
34
+ name: 'Update fixture',
35
+ response_200: {},
36
+ response_404: {},
37
+ response_500: {},
38
+ },
39
+ {
40
+ method: 'delete',
41
+ path: '/fixture/:id',
42
+ role: 'deleteFixtureById',
43
+ name: 'Delete fixture',
44
+ response_200: {},
45
+ response_404: {},
46
+ response_500: {},
47
+ },
48
+ ];
49
+ };
50
+ exports.fixtureRoleDefs = fixtureRoleDefs;