-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathconstants.js
More file actions
184 lines (183 loc) · 5 KB
/
constants.js
File metadata and controls
184 lines (183 loc) · 5 KB
1
2
3
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
/**
* This file have 2 objects
* 1. requiredParams: Every api have some required params, and we need to validate that params are
* present or not, so what every the required parms need that particuler api, you have to add it
* here and follow the same structure.
*
* 2. forumStrings: At some places we need some strings, instead of hard coading those string at every plase
* add those string here and import the json where ever and use this strings.
*
*/
const Settings = require.main.require('./src/settings');
module.exports = {
requiredParams: {
'/api/forum/v3/category/:cid/privileges': [
{
type: 'array',
name: 'groups'
}
],
'/api/forum/v3/groups/users': [
{
type: 'any',
name: 'cid'
}
],
'/api/forum/v3/group/membership': [
{
type: 'array',
name: 'groups'
},
{
type: 'array',
name: 'members'
},
],
'/api/privileges/v2/copy': [
{
type: 'any',
name: 'pid'
},
{
type: 'any',
name: 'cid'
}
],
'/api/category/list': [
{
type: 'array',
name: 'cids'
}
],
'/api/tags/list': [
{
type: 'array',
name: 'cid'
},
{
type: 'string',
name: 'tag'
}
],
'/api/forum/v3/remove': [
{
type: 'string',
name: 'sbType'
},
{
type: 'string',
name: 'sbIdentifier'
},
{
type: 'array',
name: 'cid'
}
],
'/api/forum/v2/read': [
{
type: 'string',
name: 'type'
},
{
type: 'string',
name: 'identifier'
}
],
'/api/forum/v2/create': [
{
type: 'string',
name: 'sbType'
},
{
type: 'string',
name: 'sbIdentifier'
},
{
type: 'array',
name: 'cid'
}
],
'/api/forum/v2/remove': [
{
type: 'string',
name: 'sbType'
},
{
type: 'string',
name: 'sbIdentifier'
},
{
type: 'array',
name: 'cid'
}
],
'/api/forum/v2/uids': [
{
type: 'array',
name: 'sbIdentifiers'
}
],
'/api/forum/v3/create': [
{
type: 'string',
name: 'name'
},
{
type: 'any',
name: 'pid'
},
{
type: 'array',
name: 'context'
}
],
'/api/forum/v3/user/profile': [
{
name: 'fullname',
type: 'string'
},
{
name: 'sbIdentifier',
type: 'any'
}
],
'/api/forum/v2/sunbird/uids': [
{
name: 'uids',
type: 'array'
}
]
},
forumStrings: {
payloadError: 'Request payload error',
statusSuccess: 'Success',
resCode: 'OK',
statusFailed: 'failed',
serverError: 'SERVER_ERROR',
http_protocal: 'http',
apiPrefix: '/api',
oAuthKey: 'sunbird-oidc',
privilegesCopy: 'Privileges copied successfuly',
emptyDataForGroups: 'You have to pass both sbUid and sbUserName',
removeForumFailMsg: 'Invalid input parameter | Data does not exist',
removeForumSuccessMsg: 'Forum remove for context success',
contextError: 'Bad context data',
categoryError: 'Category creation failed',
subCategoryError: 'Subcategories should contain either groups or privileges but not both',
privilegeGroupErrorMsg: 'Request have both groups and privileges but request should contain either groups or privileges',
userFields: ['fullname'],
userDataError: 'User not found.',
userDataSave: 'User profile updated successfully.',
pluginSettings: new Settings('fusionauth-oidc', '1.0.0', {
clientId: null,
clientSecret: null,
emailClaim: 'email',
discoveryBaseURL: null,
authorizationEndpoint: null,
tokenEndpoint: null,
ssoTokenEndpoint: null,
userInfoEndpoint: null,
emailDomain: null
}, false, false)
}
}