@strapi/admin 4.6.0 → 4.6.1

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.
Files changed (144) hide show
  1. package/.browserslistrc +2 -1
  2. package/admin/src/components/AuthenticatedApp/utils/api.js +5 -4
  3. package/admin/src/components/LeftMenu/index.js +9 -3
  4. package/admin/src/content-manager/components/CollectionTypeFormWrapper/index.js +20 -16
  5. package/admin/src/content-manager/components/DynamicTable/CellContent/RelationMultiple/index.js +5 -5
  6. package/admin/src/content-manager/components/EditViewDataManagerProvider/utils/findLeafByPathAndReplace.js +1 -3
  7. package/admin/src/content-manager/components/EditViewDataManagerProvider/utils/schema.js +6 -5
  8. package/admin/src/content-manager/components/InputUID/index.js +4 -4
  9. package/admin/src/content-manager/components/Inputs/index.js +0 -2
  10. package/admin/src/content-manager/components/SingleTypeFormWrapper/index.js +35 -14
  11. package/admin/src/content-manager/hooks/useFetchContentTypeLayout/index.js +4 -3
  12. package/admin/src/content-manager/hooks/useLazyComponents/index.js +9 -13
  13. package/admin/src/content-manager/hooks/useRelation/useRelation.js +4 -4
  14. package/admin/src/content-manager/pages/App/useModels.js +8 -3
  15. package/admin/src/content-manager/pages/App/utils/getContentTypeLinks.js +3 -2
  16. package/admin/src/content-manager/pages/ComponentSetttingsView/index.js +4 -4
  17. package/admin/src/content-manager/pages/EditSettingsView/utils/api.js +4 -2
  18. package/admin/src/content-manager/pages/ListSettingsView/utils/api.js +4 -2
  19. package/admin/src/content-manager/pages/ListView/index.js +9 -9
  20. package/admin/src/core/utils/index.js +0 -1
  21. package/admin/src/hooks/useFetchEnabledPlugins/utils/api.js +3 -2
  22. package/admin/src/hooks/useInjectReducer/index.js +1 -0
  23. package/admin/src/hooks/useInjectReducer/useInjectReducer.js +19 -0
  24. package/admin/src/hooks/useRegenerate/index.js +3 -3
  25. package/admin/src/hooks/useRolesList/index.js +5 -3
  26. package/admin/src/index.js +4 -3
  27. package/admin/src/pages/ProfilePage/utils/api.js +5 -3
  28. package/admin/src/pages/SettingsPage/{pages/Users/ListPage → components}/Filters/index.js +0 -0
  29. package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/index.js +6 -5
  30. package/admin/src/pages/SettingsPage/pages/ApiTokens/ListView/index.js +4 -3
  31. package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/utils/api.js +5 -3
  32. package/admin/src/pages/SettingsPage/pages/Users/EditPage/utils/api.js +6 -3
  33. package/admin/src/pages/SettingsPage/pages/Users/ListPage/ModalForm/index.js +9 -3
  34. package/admin/src/pages/SettingsPage/pages/Users/ListPage/index.js +1 -1
  35. package/admin/src/pages/SettingsPage/pages/Users/ListPage/utils/api.js +6 -3
  36. package/admin/src/pages/SettingsPage/pages/Users/components/SelectRoles/index.js +3 -2
  37. package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/index.js +3 -2
  38. package/admin/src/translations/en.json +7 -5
  39. package/admin/src/translations/eu.json +796 -0
  40. package/admin/src/translations/languageNativeNames.js +1 -0
  41. package/admin/src/translations/ru.json +9 -9
  42. package/build/1412.936ed920.chunk.js +159 -0
  43. package/build/1683.c8aa7b7c.chunk.js +268 -0
  44. package/build/2607.2e48dbf8.chunk.js +66 -0
  45. package/build/2743.6d1632f9.chunk.js +45 -0
  46. package/build/3075.dc3894fe.chunk.js +108 -0
  47. package/build/3632.0317b618.chunk.js +138 -0
  48. package/build/4318.f96a9d4d.chunk.js +30 -0
  49. package/build/{5910.a5374848.chunk.js → 4855.bd092921.chunk.js} +65 -65
  50. package/build/8633.00ccd382.chunk.js +1 -0
  51. package/build/9707.7290fd92.chunk.js +96 -0
  52. package/build/Admin-authenticatedApp.ce646f66.chunk.js +75 -0
  53. package/build/{Admin_homePage.79ab880c.chunk.js → Admin_homePage.b1730882.chunk.js} +1 -1
  54. package/build/{Admin_marketplace.eabf21b2.chunk.js → Admin_marketplace.ea0316c2.chunk.js} +2 -2
  55. package/build/Admin_pluginsPage.5c24f963.chunk.js +6 -0
  56. package/build/Admin_profilePage.59af1978.chunk.js +15 -0
  57. package/build/Admin_settingsPage.d1493824.chunk.js +178 -0
  58. package/build/admin-app.25934eaa.chunk.js +112 -0
  59. package/build/admin-edit-roles-page.446b69dc.chunk.js +1 -0
  60. package/build/admin-edit-users.2ed69bfd.chunk.js +10 -0
  61. package/build/admin-users.fc003b10.chunk.js +11 -0
  62. package/build/{api-tokens-create-page.0e686c30.chunk.js → api-tokens-create-page.d248362d.chunk.js} +1 -1
  63. package/build/{api-tokens-edit-page.d6c7487b.chunk.js → api-tokens-edit-page.8516fa20.chunk.js} +1 -1
  64. package/build/api-tokens-list-page.44a79fda.chunk.js +16 -0
  65. package/build/audit-logs-settings-page.c3dce30d.chunk.js +1 -0
  66. package/build/content-manager.35ff9726.chunk.js +1139 -0
  67. package/build/{content-type-builder-list-view.4243b2b1.chunk.js → content-type-builder-list-view.79e84b36.chunk.js} +1 -6
  68. package/build/{content-type-builder.365b6bf4.chunk.js → content-type-builder.855db321.chunk.js} +16 -15
  69. package/build/{email-settings-page.379552b1.chunk.js → email-settings-page.d1fcc7a3.chunk.js} +4 -9
  70. package/build/en-json.1f137a90.chunk.js +1 -0
  71. package/build/eu-json.fceecd8b.chunk.js +1 -0
  72. package/build/i18n-settings-page.b8d8753e.chunk.js +60 -0
  73. package/build/index.html +1 -1
  74. package/build/main.7b151630.js +4377 -0
  75. package/build/ru-json.aa5cd123.chunk.js +1 -0
  76. package/build/runtime~main.a20d633b.js +2 -0
  77. package/build/sso-settings-page.b85ad080.chunk.js +41 -0
  78. package/build/upload-settings.ef64bbf9.chunk.js +84 -0
  79. package/build/upload.c5730dfa.chunk.js +33 -0
  80. package/build/users-advanced-settings-page.fce9908e.chunk.js +8 -0
  81. package/build/users-email-settings-page.343d0ad2.chunk.js +23 -0
  82. package/build/users-providers-settings-page.e5a9a3f1.chunk.js +99 -0
  83. package/build/users-roles-settings-page.66312f31.chunk.js +30 -0
  84. package/build/webhook-edit-page.73e51e64.chunk.js +75 -0
  85. package/build/{webhook-list-page.f75ba3f2.chunk.js → webhook-list-page.1134f130.chunk.js} +1 -1
  86. package/ee/admin/pages/SettingsPage/pages/AuditLogs/ListView/ComboboxFilter/index.js +41 -0
  87. package/ee/admin/pages/SettingsPage/pages/AuditLogs/ListView/Modal/ActionBody.js +1 -3
  88. package/ee/admin/pages/SettingsPage/pages/AuditLogs/ListView/TableRows/index.js +1 -1
  89. package/ee/admin/pages/SettingsPage/pages/AuditLogs/ListView/hooks/useAuditLogsData.js +47 -0
  90. package/ee/admin/pages/SettingsPage/pages/AuditLogs/ListView/index.js +30 -31
  91. package/ee/admin/pages/SettingsPage/pages/AuditLogs/ListView/utils/getActionTypesDefaultMessages.js +7 -9
  92. package/ee/admin/pages/SettingsPage/pages/AuditLogs/ListView/utils/getDisplayedFilters.js +88 -0
  93. package/ee/admin/pages/SettingsPage/pages/Roles/ListPage/index.js +4 -2
  94. package/ee/server/migrations/audit-logs-table.js +45 -0
  95. package/ee/server/register.js +2 -0
  96. package/ee/server/services/audit-logs.js +11 -1
  97. package/package.json +27 -27
  98. package/server/controllers/admin.js +16 -0
  99. package/admin/src/content-manager/components/InputJSON/FieldWrapper.js +0 -40
  100. package/admin/src/content-manager/components/InputJSON/Label.js +0 -35
  101. package/admin/src/content-manager/components/InputJSON/components.js +0 -36
  102. package/admin/src/content-manager/components/InputJSON/index.js +0 -223
  103. package/admin/src/content-manager/components/InputJSON/jsonlint.js +0 -680
  104. package/admin/src/core/utils/axiosInstance.js +0 -40
  105. package/build/2607.ce06608e.chunk.js +0 -66
  106. package/build/2743.dea372fb.chunk.js +0 -42
  107. package/build/3075.03ebe93d.chunk.js +0 -115
  108. package/build/3632.963ac97d.chunk.js +0 -138
  109. package/build/4318.8cb388a5.chunk.js +0 -30
  110. package/build/4656.a0d43cca.chunk.js +0 -159
  111. package/build/8633.4af74a50.chunk.js +0 -1
  112. package/build/9641.a311b612.chunk.js +0 -276
  113. package/build/9707.62831b4d.chunk.js +0 -101
  114. package/build/Admin-authenticatedApp.50dc27f9.chunk.js +0 -75
  115. package/build/Admin_pluginsPage.953e796b.chunk.js +0 -6
  116. package/build/Admin_profilePage.5c2efda5.chunk.js +0 -15
  117. package/build/Admin_settingsPage.19cfb9ca.chunk.js +0 -178
  118. package/build/admin-app.34295b50.chunk.js +0 -112
  119. package/build/admin-edit-roles-page.d50d9654.chunk.js +0 -1
  120. package/build/admin-edit-users.912b856d.chunk.js +0 -10
  121. package/build/admin-users.e36e7111.chunk.js +0 -11
  122. package/build/api-tokens-list-page.1cd86136.chunk.js +0 -16
  123. package/build/audit-logs-settings-page.308a6250.chunk.js +0 -1
  124. package/build/codemirror-addon-closebrackets.71aa4bbd.chunk.js +0 -2
  125. package/build/codemirror-addon-lint-js.405f70fb.chunk.js +0 -1
  126. package/build/codemirror-addon-lint.8487ad3d.chunk.js +0 -1
  127. package/build/codemirror-addon-mark-selection.1928c849.chunk.js +0 -1
  128. package/build/codemirror-css.359a2a4b.chunk.js +0 -345
  129. package/build/codemirror-javacript.af237b68.chunk.js +0 -1
  130. package/build/codemirror-theme.2fe63a16.chunk.js +0 -33
  131. package/build/content-manager.851f40ce.chunk.js +0 -1170
  132. package/build/en-json.38d182e5.chunk.js +0 -1
  133. package/build/i18n-settings-page.3ab28b1a.chunk.js +0 -65
  134. package/build/main.9f31732e.js +0 -4454
  135. package/build/ru-json.3b411a39.chunk.js +0 -1
  136. package/build/runtime~main.2b8e2318.js +0 -2
  137. package/build/sso-settings-page.b64a44e8.chunk.js +0 -41
  138. package/build/upload-settings.6c26ff37.chunk.js +0 -89
  139. package/build/upload.2c69d238.chunk.js +0 -38
  140. package/build/users-advanced-settings-page.c4270682.chunk.js +0 -13
  141. package/build/users-email-settings-page.60422a2f.chunk.js +0 -28
  142. package/build/users-providers-settings-page.e1834060.chunk.js +0 -104
  143. package/build/users-roles-settings-page.3ef35132.chunk.js +0 -30
  144. package/build/webhook-edit-page.c0080dc1.chunk.js +0 -75
@@ -1,680 +0,0 @@
1
- /* Jison generated parser */
2
- /* eslint-disable */
3
- var jsonlint = (function () {
4
- var parser = {
5
- trace: function trace() {},
6
- yy: {},
7
- symbols_: {
8
- error: 2,
9
- JSONString: 3,
10
- STRING: 4,
11
- JSONNumber: 5,
12
- NUMBER: 6,
13
- JSONNullLiteral: 7,
14
- NULL: 8,
15
- JSONBooleanLiteral: 9,
16
- TRUE: 10,
17
- FALSE: 11,
18
- JSONText: 12,
19
- JSONValue: 13,
20
- EOF: 14,
21
- JSONObject: 15,
22
- JSONArray: 16,
23
- '{': 17,
24
- '}': 18,
25
- JSONMemberList: 19,
26
- JSONMember: 20,
27
- ':': 21,
28
- ',': 22,
29
- '[': 23,
30
- ']': 24,
31
- JSONElementList: 25,
32
- $accept: 0,
33
- $end: 1,
34
- },
35
- terminals_: {
36
- 2: 'error',
37
- 4: 'STRING',
38
- 6: 'NUMBER',
39
- 8: 'NULL',
40
- 10: 'TRUE',
41
- 11: 'FALSE',
42
- 14: 'EOF',
43
- 17: '{',
44
- 18: '}',
45
- 21: ':',
46
- 22: ',',
47
- 23: '[',
48
- 24: ']',
49
- },
50
- productions_: [
51
- 0,
52
- [3, 1],
53
- [5, 1],
54
- [7, 1],
55
- [9, 1],
56
- [9, 1],
57
- [12, 2],
58
- [13, 1],
59
- [13, 1],
60
- [13, 1],
61
- [13, 1],
62
- [13, 1],
63
- [13, 1],
64
- [15, 2],
65
- [15, 3],
66
- [20, 3],
67
- [19, 1],
68
- [19, 3],
69
- [16, 2],
70
- [16, 3],
71
- [25, 1],
72
- [25, 3],
73
- ],
74
- performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
75
- var $0 = $$.length - 1;
76
- switch (yystate) {
77
- case 1: // replace escaped characters with actual character
78
- this.$ = yytext
79
- .replace(/\\(\\|")/g, '$' + '1')
80
- .replace(/\\n/g, '\n')
81
- .replace(/\\r/g, '\r')
82
- .replace(/\\t/g, '\t')
83
- .replace(/\\v/g, '\v')
84
- .replace(/\\f/g, '\f')
85
- .replace(/\\b/g, '\b');
86
-
87
- break;
88
- case 2:
89
- this.$ = Number(yytext);
90
- break;
91
- case 3:
92
- this.$ = null;
93
- break;
94
- case 4:
95
- this.$ = true;
96
- break;
97
- case 5:
98
- this.$ = false;
99
- break;
100
- case 6:
101
- return (this.$ = $$[$0 - 1]);
102
- break;
103
- case 13:
104
- this.$ = {};
105
- break;
106
- case 14:
107
- this.$ = $$[$0 - 1];
108
- break;
109
- case 15:
110
- this.$ = [$$[$0 - 2], $$[$0]];
111
- break;
112
- case 16:
113
- this.$ = {};
114
- this.$[$$[$0][0]] = $$[$0][1];
115
- break;
116
- case 17:
117
- this.$ = $$[$0 - 2];
118
- $$[$0 - 2][$$[$0][0]] = $$[$0][1];
119
- break;
120
- case 18:
121
- this.$ = [];
122
- break;
123
- case 19:
124
- this.$ = $$[$0 - 1];
125
- break;
126
- case 20:
127
- this.$ = [$$[$0]];
128
- break;
129
- case 21:
130
- this.$ = $$[$0 - 2];
131
- $$[$0 - 2].push($$[$0]);
132
- break;
133
- }
134
- },
135
- table: [
136
- {
137
- 3: 5,
138
- 4: [1, 12],
139
- 5: 6,
140
- 6: [1, 13],
141
- 7: 3,
142
- 8: [1, 9],
143
- 9: 4,
144
- 10: [1, 10],
145
- 11: [1, 11],
146
- 12: 1,
147
- 13: 2,
148
- 15: 7,
149
- 16: 8,
150
- 17: [1, 14],
151
- 23: [1, 15],
152
- },
153
- { 1: [3] },
154
- { 14: [1, 16] },
155
- { 14: [2, 7], 18: [2, 7], 22: [2, 7], 24: [2, 7] },
156
- { 14: [2, 8], 18: [2, 8], 22: [2, 8], 24: [2, 8] },
157
- { 14: [2, 9], 18: [2, 9], 22: [2, 9], 24: [2, 9] },
158
- { 14: [2, 10], 18: [2, 10], 22: [2, 10], 24: [2, 10] },
159
- { 14: [2, 11], 18: [2, 11], 22: [2, 11], 24: [2, 11] },
160
- { 14: [2, 12], 18: [2, 12], 22: [2, 12], 24: [2, 12] },
161
- { 14: [2, 3], 18: [2, 3], 22: [2, 3], 24: [2, 3] },
162
- { 14: [2, 4], 18: [2, 4], 22: [2, 4], 24: [2, 4] },
163
- { 14: [2, 5], 18: [2, 5], 22: [2, 5], 24: [2, 5] },
164
- { 14: [2, 1], 18: [2, 1], 21: [2, 1], 22: [2, 1], 24: [2, 1] },
165
- { 14: [2, 2], 18: [2, 2], 22: [2, 2], 24: [2, 2] },
166
- { 3: 20, 4: [1, 12], 18: [1, 17], 19: 18, 20: 19 },
167
- {
168
- 3: 5,
169
- 4: [1, 12],
170
- 5: 6,
171
- 6: [1, 13],
172
- 7: 3,
173
- 8: [1, 9],
174
- 9: 4,
175
- 10: [1, 10],
176
- 11: [1, 11],
177
- 13: 23,
178
- 15: 7,
179
- 16: 8,
180
- 17: [1, 14],
181
- 23: [1, 15],
182
- 24: [1, 21],
183
- 25: 22,
184
- },
185
- { 1: [2, 6] },
186
- { 14: [2, 13], 18: [2, 13], 22: [2, 13], 24: [2, 13] },
187
- { 18: [1, 24], 22: [1, 25] },
188
- { 18: [2, 16], 22: [2, 16] },
189
- { 21: [1, 26] },
190
- { 14: [2, 18], 18: [2, 18], 22: [2, 18], 24: [2, 18] },
191
- { 22: [1, 28], 24: [1, 27] },
192
- { 22: [2, 20], 24: [2, 20] },
193
- { 14: [2, 14], 18: [2, 14], 22: [2, 14], 24: [2, 14] },
194
- { 3: 20, 4: [1, 12], 20: 29 },
195
- {
196
- 3: 5,
197
- 4: [1, 12],
198
- 5: 6,
199
- 6: [1, 13],
200
- 7: 3,
201
- 8: [1, 9],
202
- 9: 4,
203
- 10: [1, 10],
204
- 11: [1, 11],
205
- 13: 30,
206
- 15: 7,
207
- 16: 8,
208
- 17: [1, 14],
209
- 23: [1, 15],
210
- },
211
- { 14: [2, 19], 18: [2, 19], 22: [2, 19], 24: [2, 19] },
212
- {
213
- 3: 5,
214
- 4: [1, 12],
215
- 5: 6,
216
- 6: [1, 13],
217
- 7: 3,
218
- 8: [1, 9],
219
- 9: 4,
220
- 10: [1, 10],
221
- 11: [1, 11],
222
- 13: 31,
223
- 15: 7,
224
- 16: 8,
225
- 17: [1, 14],
226
- 23: [1, 15],
227
- },
228
- { 18: [2, 17], 22: [2, 17] },
229
- { 18: [2, 15], 22: [2, 15] },
230
- { 22: [2, 21], 24: [2, 21] },
231
- ],
232
- defaultActions: { 16: [2, 6] },
233
- parseError: function parseError(str, hash) {
234
- throw new Error(str);
235
- },
236
- parse: function parse(input) {
237
- var self = this,
238
- stack = [0],
239
- vstack = [null], // semantic value stack
240
- lstack = [], // location stack
241
- table = this.table,
242
- yytext = '',
243
- yylineno = 0,
244
- yyleng = 0,
245
- recovering = 0,
246
- TERROR = 2,
247
- EOF = 1;
248
-
249
- //this.reductionCount = this.shiftCount = 0;
250
-
251
- this.lexer.setInput(input);
252
- this.lexer.yy = this.yy;
253
- this.yy.lexer = this.lexer;
254
- if (typeof this.lexer.yylloc == 'undefined') this.lexer.yylloc = {};
255
- var yyloc = this.lexer.yylloc;
256
- lstack.push(yyloc);
257
-
258
- if (typeof this.yy.parseError === 'function') this.parseError = this.yy.parseError;
259
-
260
- function popStack(n) {
261
- stack.length = stack.length - 2 * n;
262
- vstack.length = vstack.length - n;
263
- lstack.length = lstack.length - n;
264
- }
265
-
266
- function lex() {
267
- var token;
268
- token = self.lexer.lex() || 1; // $end = 1
269
- // if token isn't its numeric value, convert
270
- if (typeof token !== 'number') {
271
- token = self.symbols_[token] || token;
272
- }
273
- return token;
274
- }
275
-
276
- var symbol,
277
- preErrorSymbol,
278
- state,
279
- action,
280
- a,
281
- r,
282
- yyval = {},
283
- p,
284
- len,
285
- newState,
286
- expected;
287
- while (true) {
288
- // retreive state number from top of stack
289
- state = stack[stack.length - 1];
290
-
291
- // use default actions if available
292
- if (this.defaultActions[state]) {
293
- action = this.defaultActions[state];
294
- } else {
295
- if (symbol == null) symbol = lex();
296
- // read action for current state and first input
297
- action = table[state] && table[state][symbol];
298
- }
299
-
300
- // handle parse error
301
- _handle_error: if (typeof action === 'undefined' || !action.length || !action[0]) {
302
- if (!recovering) {
303
- // Report error
304
- expected = [];
305
- for (p in table[state])
306
- if (this.terminals_[p] && p > 2) {
307
- expected.push("'" + this.terminals_[p] + "'");
308
- }
309
- var errStr = '';
310
- if (this.lexer.showPosition) {
311
- errStr =
312
- 'Parse error on line ' +
313
- (yylineno + 1) +
314
- ':\n' +
315
- this.lexer.showPosition() +
316
- '\nExpecting ' +
317
- expected.join(', ') +
318
- ", got '" +
319
- this.terminals_[symbol] +
320
- "'";
321
- } else {
322
- errStr =
323
- 'Parse error on line ' +
324
- (yylineno + 1) +
325
- ': Unexpected ' +
326
- (symbol == 1 /*EOF*/
327
- ? 'end of input'
328
- : "'" + (this.terminals_[symbol] || symbol) + "'");
329
- }
330
- this.parseError(errStr, {
331
- text: this.lexer.match,
332
- token: this.terminals_[symbol] || symbol,
333
- line: this.lexer.yylineno,
334
- loc: yyloc,
335
- expected: expected,
336
- });
337
- }
338
-
339
- // just recovered from another error
340
- if (recovering == 3) {
341
- if (symbol == EOF) {
342
- throw new Error(errStr || 'Parsing halted.');
343
- }
344
-
345
- // discard current lookahead and grab another
346
- yyleng = this.lexer.yyleng;
347
- yytext = this.lexer.yytext;
348
- yylineno = this.lexer.yylineno;
349
- yyloc = this.lexer.yylloc;
350
- symbol = lex();
351
- }
352
-
353
- // try to recover from error
354
- while (1) {
355
- // check for error recovery rule in this state
356
- if (TERROR.toString() in table[state]) {
357
- break;
358
- }
359
- if (state == 0) {
360
- throw new Error(errStr || 'Parsing halted.');
361
- }
362
- popStack(1);
363
- state = stack[stack.length - 1];
364
- }
365
-
366
- preErrorSymbol = symbol; // save the lookahead token
367
- symbol = TERROR; // insert generic error symbol as new lookahead
368
- state = stack[stack.length - 1];
369
- action = table[state] && table[state][TERROR];
370
- recovering = 3; // allow 3 real symbols to be shifted before reporting a new error
371
- }
372
-
373
- // this shouldn't happen, unless resolve defaults are off
374
- if (action[0] instanceof Array && action.length > 1) {
375
- throw new Error(
376
- 'Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol
377
- );
378
- }
379
-
380
- switch (action[0]) {
381
- case 1: // shift
382
- //this.shiftCount++;
383
-
384
- stack.push(symbol);
385
- vstack.push(this.lexer.yytext);
386
- lstack.push(this.lexer.yylloc);
387
- stack.push(action[1]); // push state
388
- symbol = null;
389
- if (!preErrorSymbol) {
390
- // normal execution/no error
391
- yyleng = this.lexer.yyleng;
392
- yytext = this.lexer.yytext;
393
- yylineno = this.lexer.yylineno;
394
- yyloc = this.lexer.yylloc;
395
- if (recovering > 0) recovering--;
396
- } else {
397
- // error just occurred, resume old lookahead f/ before error
398
- symbol = preErrorSymbol;
399
- preErrorSymbol = null;
400
- }
401
- break;
402
-
403
- case 2: // reduce
404
- //this.reductionCount++;
405
-
406
- len = this.productions_[action[1]][1];
407
-
408
- // perform semantic action
409
- yyval.$ = vstack[vstack.length - len]; // default to $$ = $1
410
- // default location, uses first token for firsts, last for lasts
411
- yyval._$ = {
412
- first_line: lstack[lstack.length - (len || 1)].first_line,
413
- last_line: lstack[lstack.length - 1].last_line,
414
- first_column: lstack[lstack.length - (len || 1)].first_column,
415
- last_column: lstack[lstack.length - 1].last_column,
416
- };
417
- r = this.performAction.call(
418
- yyval,
419
- yytext,
420
- yyleng,
421
- yylineno,
422
- this.yy,
423
- action[1],
424
- vstack,
425
- lstack
426
- );
427
-
428
- if (typeof r !== 'undefined') {
429
- return r;
430
- }
431
-
432
- // pop off stack
433
- if (len) {
434
- stack = stack.slice(0, -1 * len * 2);
435
- vstack = vstack.slice(0, -1 * len);
436
- lstack = lstack.slice(0, -1 * len);
437
- }
438
-
439
- stack.push(this.productions_[action[1]][0]); // push nonterminal (reduce)
440
- vstack.push(yyval.$);
441
- lstack.push(yyval._$);
442
- // goto new state = table[STATE][NONTERMINAL]
443
- newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
444
- stack.push(newState);
445
- break;
446
-
447
- case 3: // accept
448
- return true;
449
- }
450
- }
451
-
452
- return true;
453
- },
454
- };
455
- /* Jison generated lexer */
456
- var lexer = (function () {
457
- var lexer = {
458
- EOF: 1,
459
- parseError: function parseError(str, hash) {
460
- if (this.yy.parseError) {
461
- this.yy.parseError(str, hash);
462
- } else {
463
- throw new Error(str);
464
- }
465
- },
466
- setInput: function (input) {
467
- this._input = input;
468
- this._more = this._less = this.done = false;
469
- this.yylineno = this.yyleng = 0;
470
- this.yytext = this.matched = this.match = '';
471
- this.conditionStack = ['INITIAL'];
472
- this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 };
473
- return this;
474
- },
475
- input: function () {
476
- var ch = this._input[0];
477
- this.yytext += ch;
478
- this.yyleng++;
479
- this.match += ch;
480
- this.matched += ch;
481
- var lines = ch.match(/\n/);
482
- if (lines) this.yylineno++;
483
- this._input = this._input.slice(1);
484
- return ch;
485
- },
486
- unput: function (ch) {
487
- this._input = ch + this._input;
488
- return this;
489
- },
490
- more: function () {
491
- this._more = true;
492
- return this;
493
- },
494
- less: function (n) {
495
- this._input = this.match.slice(n) + this._input;
496
- },
497
- pastInput: function () {
498
- var past = this.matched.substr(0, this.matched.length - this.match.length);
499
- return (past.length > 20 ? '...' : '') + past.substr(-20).replace(/\n/g, '');
500
- },
501
- upcomingInput: function () {
502
- var next = this.match;
503
- if (next.length < 20) {
504
- next += this._input.substr(0, 20 - next.length);
505
- }
506
- return (next.substr(0, 20) + (next.length > 20 ? '...' : '')).replace(/\n/g, '');
507
- },
508
- showPosition: function () {
509
- var pre = this.pastInput();
510
- var c = new Array(pre.length + 1).join('-');
511
- return pre + this.upcomingInput() + '\n' + c + '^';
512
- },
513
- next: function () {
514
- if (this.done) {
515
- return this.EOF;
516
- }
517
- if (!this._input) this.done = true;
518
-
519
- var token, match, tempMatch, index, col, lines;
520
- if (!this._more) {
521
- this.yytext = '';
522
- this.match = '';
523
- }
524
- var rules = this._currentRules();
525
- for (var i = 0; i < rules.length; i++) {
526
- tempMatch = this._input.match(this.rules[rules[i]]);
527
- if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
528
- match = tempMatch;
529
- index = i;
530
- if (!this.options.flex) break;
531
- }
532
- }
533
- if (match) {
534
- lines = match[0].match(/\n.*/g);
535
- if (lines) this.yylineno += lines.length;
536
- this.yylloc = {
537
- first_line: this.yylloc.last_line,
538
- last_line: this.yylineno + 1,
539
- first_column: this.yylloc.last_column,
540
- last_column: lines
541
- ? lines[lines.length - 1].length - 1
542
- : this.yylloc.last_column + match[0].length,
543
- };
544
- this.yytext += match[0];
545
- this.match += match[0];
546
- this.yyleng = this.yytext.length;
547
- this._more = false;
548
- this._input = this._input.slice(match[0].length);
549
- this.matched += match[0];
550
- token = this.performAction.call(
551
- this,
552
- this.yy,
553
- this,
554
- rules[index],
555
- this.conditionStack[this.conditionStack.length - 1]
556
- );
557
- if (this.done && this._input) this.done = false;
558
- if (token) return token;
559
- else return;
560
- }
561
- if (this._input === '') {
562
- return this.EOF;
563
- } else {
564
- this.parseError(
565
- 'Lexical error on line ' +
566
- (this.yylineno + 1) +
567
- '. Unrecognized text.\n' +
568
- this.showPosition(),
569
- { text: '', token: null, line: this.yylineno }
570
- );
571
- }
572
- },
573
- lex: function lex() {
574
- var r = this.next();
575
- if (typeof r !== 'undefined') {
576
- return r;
577
- } else {
578
- return this.lex();
579
- }
580
- },
581
- begin: function begin(condition) {
582
- this.conditionStack.push(condition);
583
- },
584
- popState: function popState() {
585
- return this.conditionStack.pop();
586
- },
587
- _currentRules: function _currentRules() {
588
- return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
589
- },
590
- topState: function () {
591
- return this.conditionStack[this.conditionStack.length - 2];
592
- },
593
- pushState: function begin(condition) {
594
- this.begin(condition);
595
- },
596
- };
597
- lexer.options = {};
598
- lexer.performAction = function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
599
- var YYSTATE = YY_START;
600
- switch ($avoiding_name_collisions) {
601
- case 0 /* skip whitespace */:
602
- break;
603
- case 1:
604
- return 6;
605
- break;
606
- case 2:
607
- yy_.yytext = yy_.yytext.substr(1, yy_.yyleng - 2);
608
- return 4;
609
- break;
610
- case 3:
611
- return 17;
612
- break;
613
- case 4:
614
- return 18;
615
- break;
616
- case 5:
617
- return 23;
618
- break;
619
- case 6:
620
- return 24;
621
- break;
622
- case 7:
623
- return 22;
624
- break;
625
- case 8:
626
- return 21;
627
- break;
628
- case 9:
629
- return 10;
630
- break;
631
- case 10:
632
- return 11;
633
- break;
634
- case 11:
635
- return 8;
636
- break;
637
- case 12:
638
- return 14;
639
- break;
640
- case 13:
641
- return 'INVALID';
642
- break;
643
- }
644
- };
645
- lexer.rules = [
646
- /^(?:\s+)/,
647
- /^(?:(-?([0-9]|[1-9][0-9]+))(\.[0-9]+)?([eE][-+]?[0-9]+)?\b)/,
648
- /^(?:"(?:\\[\\"bfnrt/]|\\u[a-fA-F0-9]{4}|[^\\\0-\x09\x0a-\x1f"])*")/,
649
- /^(?:\{)/,
650
- /^(?:\})/,
651
- /^(?:\[)/,
652
- /^(?:\])/,
653
- /^(?:,)/,
654
- /^(?::)/,
655
- /^(?:true\b)/,
656
- /^(?:false\b)/,
657
- /^(?:null\b)/,
658
- /^(?:$)/,
659
- /^(?:.)/,
660
- ];
661
- lexer.conditions = {
662
- INITIAL: { rules: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13], inclusive: true },
663
- };
664
-
665
- return lexer;
666
- })();
667
- parser.lexer = lexer;
668
- return parser;
669
- })();
670
- if (typeof require !== 'undefined' && typeof exports !== 'undefined') {
671
- exports.parser = jsonlint;
672
- exports.parse = function () {
673
- return jsonlint.parse.apply(jsonlint, arguments);
674
- };
675
- exports.main = function commonjsMain(args) {
676
- if (!args[1]) {
677
- throw new Error('Usage: ' + args[0] + ' FILE');
678
- }
679
- };
680
- }
@@ -1,40 +0,0 @@
1
- import axios from 'axios';
2
- import { auth, wrapAxiosInstance } from '@strapi/helper-plugin';
3
-
4
- const instance = axios.create({
5
- baseURL: process.env.STRAPI_ADMIN_BACKEND_URL,
6
- headers: {
7
- Accept: 'application/json',
8
- 'Content-Type': 'application/json',
9
- },
10
- });
11
-
12
- instance.interceptors.request.use(
13
- async (config) => {
14
- config.headers = {
15
- Authorization: `Bearer ${auth.getToken()}`,
16
- };
17
-
18
- return config;
19
- },
20
- (error) => {
21
- Promise.reject(error);
22
- }
23
- );
24
-
25
- instance.interceptors.response.use(
26
- (response) => response,
27
- (error) => {
28
- // whatever you want to do with the error
29
- if (error?.response?.status === 401) {
30
- auth.clearAppStorage();
31
- window.location.reload();
32
- }
33
-
34
- throw error;
35
- }
36
- );
37
-
38
- const wrapper = wrapAxiosInstance(instance);
39
-
40
- export default wrapper;