@nocobase/test 1.8.25 → 1.8.26

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.
@@ -0,0 +1,767 @@
1
+ // Generated by Grafana k6 Studio (1.7.0) on 2025-09-11T15:31:05.716Z
2
+
3
+ import { group, sleep, check } from 'k6';
4
+ import http from 'k6/http';
5
+
6
+ import { uid } from '../../utils.js';
7
+
8
+ export const options = {
9
+ stages: [
10
+ // { target: 1, duration: '1s' },
11
+ // { target: 100, duration: '1s' },
12
+ // { target: 100, duration: '58s' },
13
+ // { target: 0, duration: '1s' },
14
+ { target: 100, duration: '30s' },
15
+ { target: 200, duration: '1m' },
16
+ { target: 200, duration: '1m' },
17
+ { target: 100, duration: '30s' },
18
+ { target: 0, duration: '30s' },
19
+ ],
20
+ };
21
+
22
+ export default function () {
23
+ let params;
24
+ let resp;
25
+ let match;
26
+ let regex;
27
+ let url;
28
+ let token;
29
+ const correlation_vars = {};
30
+
31
+ group('Default group', function () {
32
+ params = {
33
+ headers: {
34
+ 'Proxy-Connection': `keep-alive`,
35
+ 'Upgrade-Insecure-Requests': `1`,
36
+ Accept: `text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7`,
37
+ 'Accept-Encoding': `gzip, deflate`,
38
+ 'Accept-Language': `zh-CN,zh;q=0.9`,
39
+ },
40
+ cookies: {},
41
+ };
42
+
43
+ url = http.url`${__ENV.TARGET_ORIGIN}/admin/`;
44
+ resp = http.request('GET', url, null, params);
45
+
46
+ check(resp, { 'status equals 200': (r) => r.status === 200 });
47
+
48
+ params = {
49
+ headers: {
50
+ 'Proxy-Connection': `keep-alive`,
51
+ 'X-Role': `anonymous`,
52
+ Accept: `application/json, text/plain, */*`,
53
+ 'X-Timezone': `+08:00`,
54
+ 'X-With-ACL-Meta': `true`,
55
+ Referer: `${__ENV.TARGET_ORIGIN}/admin/`,
56
+ 'Accept-Encoding': `gzip, deflate`,
57
+ 'Accept-Language': `zh-CN,zh;q=0.9`,
58
+ },
59
+ cookies: {},
60
+ };
61
+
62
+ url = http.url`${__ENV.TARGET_ORIGIN}/api/app:getLang`;
63
+ resp = http.request('GET', url, null, params);
64
+
65
+ check(resp, { 'status equals 200': (r) => r.status === 200 });
66
+
67
+ params = {
68
+ headers: {
69
+ 'Proxy-Connection': `keep-alive`,
70
+ Accept: `application/json, text/plain, */*`,
71
+ 'X-Timezone': `+08:00`,
72
+ 'X-With-ACL-Meta': `true`,
73
+ 'X-Locale': `en-US`,
74
+ Referer: `${__ENV.TARGET_ORIGIN}/admin/`,
75
+ 'Accept-Encoding': `gzip, deflate`,
76
+ 'Accept-Language': `zh-CN,zh;q=0.9`,
77
+ },
78
+ cookies: {},
79
+ };
80
+
81
+ url = http.url`${__ENV.TARGET_ORIGIN}/api/pm:listEnabled`;
82
+ resp = http.request('GET', url, null, params);
83
+
84
+ check(resp, { 'status equals 200': (r) => r.status === 200 });
85
+
86
+ params = {
87
+ headers: {
88
+ 'Proxy-Connection': `keep-alive`,
89
+ Accept: `application/json, text/plain, */*`,
90
+ 'X-Timezone': `+08:00`,
91
+ 'X-With-ACL-Meta': `true`,
92
+ 'X-Locale': `en-US`,
93
+ Referer: `${__ENV.TARGET_ORIGIN}/admin/`,
94
+ 'Accept-Encoding': `gzip, deflate`,
95
+ 'Accept-Language': `zh-CN,zh;q=0.9`,
96
+ },
97
+ cookies: {},
98
+ };
99
+
100
+ url = http.url`${__ENV.TARGET_ORIGIN}/api/auth:check`;
101
+ resp = http.request('GET', url, null, params);
102
+
103
+ check(resp, { 'status equals 401': (r) => r.status === 401 });
104
+
105
+ params = {
106
+ headers: {
107
+ 'Proxy-Connection': `keep-alive`,
108
+ Accept: `application/json, text/plain, */*`,
109
+ 'X-Timezone': `+08:00`,
110
+ 'X-With-ACL-Meta': `true`,
111
+ 'X-Locale': `en-US`,
112
+ Referer: `${__ENV.TARGET_ORIGIN}/admin/`,
113
+ 'Accept-Encoding': `gzip, deflate`,
114
+ 'Accept-Language': `zh-CN,zh;q=0.9`,
115
+ },
116
+ cookies: {},
117
+ };
118
+
119
+ url = http.url`${__ENV.TARGET_ORIGIN}/api/systemSettings:get`;
120
+ resp = http.request('GET', url, null, params);
121
+
122
+ check(resp, { 'status equals 200': (r) => r.status === 200 });
123
+
124
+ params = {
125
+ headers: {
126
+ 'Proxy-Connection': `keep-alive`,
127
+ Accept: `application/json, text/plain, */*`,
128
+ 'X-Timezone': `+08:00`,
129
+ 'X-With-ACL-Meta': `true`,
130
+ 'X-Locale': `en-US`,
131
+ Referer: `${__ENV.TARGET_ORIGIN}/admin/`,
132
+ 'Accept-Encoding': `gzip, deflate`,
133
+ 'Accept-Language': `zh-CN,zh;q=0.9`,
134
+ },
135
+ cookies: {},
136
+ };
137
+
138
+ url = http.url`${__ENV.TARGET_ORIGIN}/api/roles:check`;
139
+ resp = http.request('GET', url, null, params);
140
+
141
+ check(resp, { 'status equals 401': (r) => r.status === 401 });
142
+
143
+ params = {
144
+ headers: {
145
+ 'Proxy-Connection': `keep-alive`,
146
+ Accept: `application/json, text/plain, */*`,
147
+ 'X-Timezone': `+08:00`,
148
+ 'X-With-ACL-Meta': `true`,
149
+ 'X-Locale': `en-US`,
150
+ Referer: `${__ENV.TARGET_ORIGIN}/admin/`,
151
+ 'Accept-Encoding': `gzip, deflate`,
152
+ 'Accept-Language': `zh-CN,zh;q=0.9`,
153
+ },
154
+ cookies: {},
155
+ };
156
+
157
+ url = http.url`${__ENV.TARGET_ORIGIN}/api/themeConfig:list?sort=id&paginate=false`;
158
+ resp = http.request('GET', url, null, params);
159
+
160
+ check(resp, { 'status equals 200': (r) => r.status === 200 });
161
+
162
+ params = {
163
+ headers: {
164
+ 'Proxy-Connection': `keep-alive`,
165
+ Accept: `application/json, text/plain, */*`,
166
+ 'X-Timezone': `+08:00`,
167
+ 'Content-Type': `application/json`,
168
+ 'X-With-ACL-Meta': `true`,
169
+ 'X-Locale': `en-US`,
170
+ Origin: `${__ENV.ORIGIN}`,
171
+ Referer: `${__ENV.ORIGIN}/signin?redirect=/admin/`,
172
+ 'Accept-Encoding': `gzip, deflate`,
173
+ 'Accept-Language': `zh-CN,zh;q=0.9`,
174
+ },
175
+ cookies: {},
176
+ };
177
+
178
+ url = http.url`${__ENV.TARGET_ORIGIN}/api/authenticators:publicList`;
179
+ resp = http.request('POST', url, `{}`, params);
180
+
181
+ check(resp, { 'status equals 200': (r) => r.status === 200 });
182
+
183
+ params = {
184
+ headers: {
185
+ 'Proxy-Connection': `keep-alive`,
186
+ 'X-Authenticator': `basic`,
187
+ 'X-Timezone': `+08:00`,
188
+ Accept: `application/json, text/plain, */*`,
189
+ 'X-With-ACL-Meta': `true`,
190
+ 'Content-Type': `application/json`,
191
+ 'X-Locale': `en-US`,
192
+ Origin: `${__ENV.ORIGIN}`,
193
+ Referer: `${__ENV.ORIGIN}/signin?redirect=/admin/`,
194
+ 'Accept-Encoding': `gzip, deflate`,
195
+ 'Accept-Language': `zh-CN,zh;q=0.9`,
196
+ },
197
+ cookies: {},
198
+ };
199
+
200
+ url = http.url`${__ENV.TARGET_ORIGIN}/api/auth:signIn`;
201
+ resp = http.request('POST', url, JSON.stringify({ account: __ENV.USERNAME, password: __ENV.PASSWORD }), params);
202
+
203
+ check(resp, { 'status equals 200': (r) => r.status === 200 });
204
+
205
+ token = resp.json('data.token');
206
+
207
+ params = {
208
+ headers: {
209
+ 'Proxy-Connection': `keep-alive`,
210
+ Authorization: `Bearer ${token}`,
211
+ 'X-Authenticator': `basic`,
212
+ 'X-Timezone': `+08:00`,
213
+ Accept: `application/json, text/plain, */*`,
214
+ 'X-With-ACL-Meta': `true`,
215
+ 'X-Locale': `en-US`,
216
+ Referer: `${__ENV.ORIGIN}/signin?redirect=/admin/`,
217
+ 'Accept-Encoding': `gzip, deflate`,
218
+ 'Accept-Language': `zh-CN,zh;q=0.9`,
219
+ },
220
+ cookies: {},
221
+ };
222
+
223
+ url = http.url`${__ENV.TARGET_ORIGIN}/api/auth:check`;
224
+ resp = http.request('GET', url, null, params);
225
+
226
+ check(resp, { 'status equals 200': (r) => r.status === 200 });
227
+
228
+ params = {
229
+ headers: {
230
+ 'Proxy-Connection': `keep-alive`,
231
+ Authorization: `Bearer ${token}`,
232
+ 'X-Authenticator': `basic`,
233
+ 'X-Timezone': `+08:00`,
234
+ Accept: `application/json, text/plain, */*`,
235
+ 'X-With-ACL-Meta': `true`,
236
+ 'X-Locale': `en-US`,
237
+ Referer: `${__ENV.TARGET_ORIGIN}/admin/`,
238
+ 'Accept-Encoding': `gzip, deflate`,
239
+ 'Accept-Language': `zh-CN,zh;q=0.9`,
240
+ },
241
+ cookies: {},
242
+ };
243
+
244
+ url = http.url`${__ENV.TARGET_ORIGIN}/api/roles:check`;
245
+ resp = http.request('GET', url, null, params);
246
+
247
+ check(resp, { 'status equals 200': (r) => r.status === 200 });
248
+
249
+ params = {
250
+ headers: {
251
+ 'Proxy-Connection': `keep-alive`,
252
+ Authorization: `Bearer ${token}`,
253
+ 'X-Authenticator': `basic`,
254
+ 'X-Timezone': `+08:00`,
255
+ Accept: `application/json, text/plain, */*`,
256
+ 'X-With-ACL-Meta': `true`,
257
+ 'X-Locale': `en-US`,
258
+ Referer: `${__ENV.TARGET_ORIGIN}/admin/`,
259
+ 'Accept-Encoding': `gzip, deflate`,
260
+ 'Accept-Language': `zh-CN,zh;q=0.9`,
261
+ },
262
+ cookies: {},
263
+ };
264
+
265
+ url = http.url`${__ENV.TARGET_ORIGIN}/api/blockTemplates:list?filter[configured][$isTruly]=true&filter[type][$ne]=Mobile&paginate=false`;
266
+ resp = http.request('GET', url, null, params);
267
+
268
+ check(resp, { 'status equals 200': (r) => r.status === 200 });
269
+
270
+ params = {
271
+ headers: {
272
+ 'Proxy-Connection': `keep-alive`,
273
+ Authorization: `Bearer ${token}`,
274
+ 'X-Authenticator': `basic`,
275
+ 'X-Timezone': `+08:00`,
276
+ Accept: `application/json, text/plain, */*`,
277
+ 'X-With-ACL-Meta': `true`,
278
+ 'X-Locale': `en-US`,
279
+ Referer: `${__ENV.TARGET_ORIGIN}/admin/`,
280
+ 'Accept-Encoding': `gzip, deflate`,
281
+ 'Accept-Language': `zh-CN,zh;q=0.9`,
282
+ },
283
+ cookies: {},
284
+ };
285
+
286
+ url = http.url`${__ENV.TARGET_ORIGIN}/api/themeConfig:list?sort=id&paginate=false`;
287
+ resp = http.request('GET', url, null, params);
288
+
289
+ check(resp, { 'status equals 200': (r) => r.status === 200 });
290
+
291
+ params = {
292
+ headers: {
293
+ 'Proxy-Connection': `keep-alive`,
294
+ Authorization: `Bearer ${token}`,
295
+ 'X-Authenticator': `basic`,
296
+ 'X-Timezone': `+08:00`,
297
+ Accept: `application/json, text/plain, */*`,
298
+ 'X-With-ACL-Meta': `true`,
299
+ 'Content-Type': `application/json`,
300
+ 'X-Locale': `en-US`,
301
+ Origin: `${__ENV.ORIGIN}`,
302
+ Referer: `${__ENV.TARGET_ORIGIN}/admin/`,
303
+ 'Accept-Encoding': `gzip, deflate`,
304
+ 'Accept-Language': `zh-CN,zh;q=0.9`,
305
+ },
306
+ cookies: {},
307
+ };
308
+
309
+ url = http.url`${__ENV.TARGET_ORIGIN}/api/userWorkflowTasks:listMine?filter=%7B%22type%22:[]%7D`;
310
+ resp = http.request('POST', url, `{}`, params);
311
+
312
+ check(resp, { 'status equals 200': (r) => r.status === 200 });
313
+
314
+ params = {
315
+ headers: {
316
+ 'Proxy-Connection': `keep-alive`,
317
+ Authorization: `Bearer ${token}`,
318
+ 'X-Authenticator': `basic`,
319
+ 'X-Timezone': `+08:00`,
320
+ Accept: `application/json, text/plain, */*`,
321
+ 'X-With-ACL-Meta': `true`,
322
+ 'X-Locale': `en-US`,
323
+ Referer: `${__ENV.TARGET_ORIGIN}/admin/`,
324
+ 'Accept-Encoding': `gzip, deflate`,
325
+ 'Accept-Language': `zh-CN,zh;q=0.9`,
326
+ },
327
+ cookies: {},
328
+ };
329
+
330
+ url = http.url`${__ENV.TARGET_ORIGIN}/api/environmentVariables?paginate=false`;
331
+ resp = http.request('GET', url, null, params);
332
+
333
+ check(resp, { 'status equals 200': (r) => r.status === 200 });
334
+
335
+ params = {
336
+ headers: {
337
+ 'Proxy-Connection': `keep-alive`,
338
+ Authorization: `Bearer ${token}`,
339
+ 'X-Authenticator': `basic`,
340
+ 'X-Timezone': `+08:00`,
341
+ Accept: `application/json, text/plain, */*`,
342
+ 'X-With-ACL-Meta': `true`,
343
+ 'X-Locale': `en-US`,
344
+ Referer: `${__ENV.TARGET_ORIGIN}/admin/`,
345
+ 'Accept-Encoding': `gzip, deflate`,
346
+ 'Accept-Language': `zh-CN,zh;q=0.9`,
347
+ },
348
+ cookies: {},
349
+ };
350
+
351
+ url = http.url`${__ENV.TARGET_ORIGIN}/api/systemSettings:get`;
352
+ resp = http.request('GET', url, null, params);
353
+
354
+ check(resp, { 'status equals 200': (r) => r.status === 200 });
355
+
356
+ params = {
357
+ headers: {
358
+ 'Proxy-Connection': `keep-alive`,
359
+ Authorization: `Bearer ${token}`,
360
+ 'X-Authenticator': `basic`,
361
+ 'X-Timezone': `+08:00`,
362
+ 'X-Role': `root`,
363
+ Accept: `application/json, text/plain, */*`,
364
+ 'X-With-ACL-Meta': `true`,
365
+ 'X-Locale': `en-US`,
366
+ Referer: `${__ENV.TARGET_ORIGIN}/admin/`,
367
+ 'Accept-Encoding': `gzip, deflate`,
368
+ 'Accept-Language': `zh-CN,zh;q=0.9`,
369
+ },
370
+ cookies: {},
371
+ };
372
+
373
+ url = http.url`${__ENV.TARGET_ORIGIN}/api/desktopRoutes:listAccessible?tree=true&sort=sort`;
374
+ resp = http.request('GET', url, null, params);
375
+
376
+ check(resp, { 'status equals 200': (r) => r.status === 200 });
377
+
378
+ params = {
379
+ headers: {
380
+ 'Proxy-Connection': `keep-alive`,
381
+ Authorization: `Bearer ${token}`,
382
+ 'X-Authenticator': `basic`,
383
+ 'X-Timezone': `+08:00`,
384
+ 'X-Role': `root`,
385
+ Accept: `application/json, text/plain, */*`,
386
+ 'X-With-ACL-Meta': `true`,
387
+ 'X-Locale': `en-US`,
388
+ Referer: `${__ENV.TARGET_ORIGIN}/admin/flwak70a1tp`,
389
+ 'Accept-Encoding': `gzip, deflate`,
390
+ 'Accept-Language': `zh-CN,zh;q=0.9`,
391
+ },
392
+ cookies: {},
393
+ };
394
+
395
+ url = http.url`${__ENV.TARGET_ORIGIN}/api/asyncTasks:list`;
396
+ resp = http.request('GET', url, null, params);
397
+
398
+ check(resp, { 'status equals 200': (r) => r.status === 200 });
399
+
400
+ params = {
401
+ headers: {
402
+ 'Proxy-Connection': `keep-alive`,
403
+ Authorization: `Bearer ${token}`,
404
+ 'X-Authenticator': `basic`,
405
+ 'X-Timezone': `+08:00`,
406
+ 'X-Role': `root`,
407
+ Accept: `application/json, text/plain, */*`,
408
+ 'X-With-ACL-Meta': `true`,
409
+ 'X-Locale': `en-US`,
410
+ Referer: `${__ENV.TARGET_ORIGIN}/admin/flwak70a1tp`,
411
+ 'Accept-Encoding': `gzip, deflate`,
412
+ 'Accept-Language': `zh-CN,zh;q=0.9`,
413
+ },
414
+ cookies: {},
415
+ };
416
+
417
+ url = http.url`${__ENV.TARGET_ORIGIN}/api/myInAppMessages:count?filter[status]=unread`;
418
+ resp = http.request('GET', url, null, params);
419
+
420
+ check(resp, { 'status equals 200': (r) => r.status === 200 });
421
+
422
+ params = {
423
+ headers: {
424
+ 'Proxy-Connection': `keep-alive`,
425
+ Authorization: `Bearer ${token}`,
426
+ 'X-Authenticator': `basic`,
427
+ 'X-Timezone': `+08:00`,
428
+ 'X-Role': `root`,
429
+ Accept: `application/json, text/plain, */*`,
430
+ 'X-With-ACL-Meta': `true`,
431
+ 'X-Locale': `en-US`,
432
+ Referer: `${__ENV.TARGET_ORIGIN}/admin/flwak70a1tp`,
433
+ 'Accept-Encoding': `gzip, deflate`,
434
+ 'Accept-Language': `zh-CN,zh;q=0.9`,
435
+ },
436
+ cookies: {},
437
+ };
438
+
439
+ url = http.url`${__ENV.TARGET_ORIGIN}/api/uiSchemaTemplates:list?paginate=false`;
440
+ resp = http.request('GET', url, null, params);
441
+
442
+ check(resp, { 'status equals 200': (r) => r.status === 200 });
443
+
444
+ params = {
445
+ headers: {
446
+ 'Proxy-Connection': `keep-alive`,
447
+ Authorization: `Bearer ${token}`,
448
+ 'X-Authenticator': `basic`,
449
+ 'X-Timezone': `+08:00`,
450
+ 'X-Role': `root`,
451
+ Accept: `application/json, text/plain, */*`,
452
+ 'X-With-ACL-Meta': `true`,
453
+ 'X-Locale': `en-US`,
454
+ Referer: `${__ENV.TARGET_ORIGIN}/admin/flwak70a1tp`,
455
+ 'Accept-Encoding': `gzip, deflate`,
456
+ 'Accept-Language': `zh-CN,zh;q=0.9`,
457
+ },
458
+ cookies: {},
459
+ };
460
+
461
+ url = http.url`${__ENV.TARGET_ORIGIN}/api/app:getInfo`;
462
+ resp = http.request('GET', url, null, params);
463
+
464
+ check(resp, { 'status equals 200': (r) => r.status === 200 });
465
+
466
+ params = {
467
+ headers: {
468
+ 'Proxy-Connection': `keep-alive`,
469
+ Authorization: `Bearer ${token}`,
470
+ 'X-Authenticator': `basic`,
471
+ 'X-Timezone': `+08:00`,
472
+ 'X-Role': `root`,
473
+ Accept: `application/json, text/plain, */*`,
474
+ 'X-With-ACL-Meta': `true`,
475
+ 'Content-Type': `application/json`,
476
+ 'X-Locale': `en-US`,
477
+ Origin: `${__ENV.ORIGIN}`,
478
+ Referer: `${__ENV.TARGET_ORIGIN}/admin/flwak70a1tp`,
479
+ 'Accept-Encoding': `gzip, deflate`,
480
+ 'Accept-Language': `zh-CN,zh;q=0.9`,
481
+ },
482
+ cookies: {},
483
+ };
484
+
485
+ url = http.url`${__ENV.TARGET_ORIGIN}/api/dataSources:listEnabled?paginate=false&appends[]=collections`;
486
+ resp = http.request('POST', url, `{}`, params);
487
+
488
+ check(resp, { 'status equals 200': (r) => r.status === 200 });
489
+
490
+ params = {
491
+ headers: {
492
+ 'Proxy-Connection': `keep-alive`,
493
+ Authorization: `Bearer ${token}`,
494
+ 'X-Authenticator': `basic`,
495
+ 'X-Timezone': `+08:00`,
496
+ 'X-Role': `root`,
497
+ Accept: `application/json, text/plain, */*`,
498
+ 'X-With-ACL-Meta': `true`,
499
+ 'X-Locale': `en-US`,
500
+ Referer: `${__ENV.TARGET_ORIGIN}/admin/flwak70a1tp`,
501
+ 'Accept-Encoding': `gzip, deflate`,
502
+ 'Accept-Language': `zh-CN,zh;q=0.9`,
503
+ },
504
+ cookies: {},
505
+ };
506
+
507
+ url = http.url`${__ENV.TARGET_ORIGIN}/api/uiSchemas:getJsonSchema/flwak70a1tp`;
508
+ resp = http.request('GET', url, null, params);
509
+
510
+ check(resp, { 'status equals 200': (r) => r.status === 200 });
511
+
512
+ params = {
513
+ headers: {
514
+ 'Proxy-Connection': `keep-alive`,
515
+ Authorization: `Bearer ${token}`,
516
+ 'X-Authenticator': `basic`,
517
+ 'X-Timezone': `+08:00`,
518
+ 'X-Role': `root`,
519
+ Accept: `application/json, text/plain, */*`,
520
+ 'X-With-ACL-Meta': `true`,
521
+ 'Content-Type': `application/json`,
522
+ 'X-Locale': `en-US`,
523
+ Origin: `${__ENV.ORIGIN}`,
524
+ Referer: `${__ENV.TARGET_ORIGIN}/admin/flwak70a1tp`,
525
+ 'Accept-Encoding': `gzip, deflate`,
526
+ 'Accept-Language': `zh-CN,zh;q=0.9`,
527
+ },
528
+ cookies: {},
529
+ };
530
+
531
+ url = http.url`${__ENV.TARGET_ORIGIN}/api/collections:listMeta`;
532
+ resp = http.request('POST', url, `{}`, params);
533
+
534
+ check(resp, { 'status equals 200': (r) => r.status === 200 });
535
+
536
+ params = {
537
+ headers: {
538
+ 'Proxy-Connection': `keep-alive`,
539
+ Authorization: `Bearer ${token}`,
540
+ 'X-Authenticator': `basic`,
541
+ 'X-Timezone': `+08:00`,
542
+ 'X-Role': `root`,
543
+ Accept: `application/json, text/plain, */*`,
544
+ 'X-With-ACL-Meta': `true`,
545
+ 'X-Locale': `en-US`,
546
+ Referer: `${__ENV.TARGET_ORIGIN}/admin/flwak70a1tp`,
547
+ 'Accept-Encoding': `gzip, deflate`,
548
+ 'Accept-Language': `zh-CN,zh;q=0.9`,
549
+ },
550
+ cookies: {},
551
+ };
552
+
553
+ url = http.url`${__ENV.TARGET_ORIGIN}/api/uiSchemas:getJsonSchema/p8r7e2uagi2`;
554
+ resp = http.request('GET', url, null, params);
555
+
556
+ check(resp, { 'status equals 200': (r) => r.status === 200 });
557
+
558
+ params = {
559
+ headers: {
560
+ 'Proxy-Connection': `keep-alive`,
561
+ Authorization: `Bearer ${token}`,
562
+ 'X-Authenticator': `basic`,
563
+ 'X-Timezone': `+08:00`,
564
+ 'X-Role': `root`,
565
+ Accept: `application/json, text/plain, */*`,
566
+ 'X-With-ACL-Meta': `true`,
567
+ 'X-Locale': `en-US`,
568
+ Referer: `${__ENV.TARGET_ORIGIN}/admin/flwak70a1tp`,
569
+ 'Accept-Encoding': `gzip, deflate`,
570
+ 'Accept-Language': `zh-CN,zh;q=0.9`,
571
+ },
572
+ cookies: {},
573
+ };
574
+
575
+ url = http.url`${__ENV.TARGET_ORIGIN}/api/posts:list?pageSize=20&appends[]=category&appends[]=tags&appends[]=createdBy&appends[]=updatedBy&filter=%7B%7D`;
576
+ resp = http.request('GET', url, null, params);
577
+
578
+ check(resp, { 'status equals 200': (r) => r.status === 200 });
579
+
580
+ params = {
581
+ headers: {
582
+ 'Proxy-Connection': `keep-alive`,
583
+ Authorization: `Bearer ${token}`,
584
+ 'X-Authenticator': `basic`,
585
+ 'X-Timezone': `+08:00`,
586
+ 'X-Role': `root`,
587
+ Accept: `application/json, text/plain, */*`,
588
+ 'X-With-ACL-Meta': `true`,
589
+ 'X-Locale': `en-US`,
590
+ Referer: `${__ENV.TARGET_ORIGIN}/admin/flwak70a1tp/popups/6jpajycbqcl`,
591
+ 'Accept-Encoding': `gzip, deflate`,
592
+ 'Accept-Language': `zh-CN,zh;q=0.9`,
593
+ },
594
+ cookies: {},
595
+ };
596
+
597
+ url = http.url`${__ENV.TARGET_ORIGIN}/api/categories:list?pageSize=200&filter=%7B%7D`;
598
+ resp = http.request('GET', url, null, params);
599
+
600
+ check(resp, { 'status equals 200': (r) => r.status === 200 });
601
+
602
+ params = {
603
+ headers: {
604
+ 'Proxy-Connection': `keep-alive`,
605
+ Authorization: `Bearer ${token}`,
606
+ 'X-Authenticator': `basic`,
607
+ 'X-Timezone': `+08:00`,
608
+ 'X-Role': `root`,
609
+ Accept: `application/json, text/plain, */*`,
610
+ 'X-With-ACL-Meta': `true`,
611
+ 'X-Locale': `en-US`,
612
+ Referer: `${__ENV.TARGET_ORIGIN}/admin/flwak70a1tp/popups/6jpajycbqcl`,
613
+ 'Accept-Encoding': `gzip, deflate`,
614
+ 'Accept-Language': `zh-CN,zh;q=0.9`,
615
+ },
616
+ cookies: {},
617
+ };
618
+
619
+ url = http.url`${__ENV.TARGET_ORIGIN}/api/tags:list?pageSize=200&filter=%7B%7D`;
620
+ resp = http.request('GET', url, null, params);
621
+
622
+ check(resp, { 'status equals 200': (r) => r.status === 200 });
623
+
624
+ params = {
625
+ headers: {
626
+ 'Proxy-Connection': `keep-alive`,
627
+ Authorization: `Bearer ${token}`,
628
+ 'X-Authenticator': `basic`,
629
+ 'X-Timezone': `+08:00`,
630
+ 'X-Role': `root`,
631
+ Accept: `application/json, text/plain, */*`,
632
+ 'X-With-ACL-Meta': `true`,
633
+ 'Content-Type': `application/json`,
634
+ 'X-Locale': `en-US`,
635
+ Origin: `${__ENV.ORIGIN}`,
636
+ Referer: `${__ENV.TARGET_ORIGIN}/admin/flwak70a1tp/popups/6jpajycbqcl`,
637
+ 'Accept-Encoding': `gzip, deflate`,
638
+ 'Accept-Language': `zh-CN,zh;q=0.9`,
639
+ },
640
+ cookies: {},
641
+ };
642
+
643
+ url = http.url`${__ENV.TARGET_ORIGIN}/api/posts:create`;
644
+ resp = http.request(
645
+ 'POST',
646
+ url,
647
+ JSON.stringify({
648
+ allowComments: true,
649
+ featured: false,
650
+ viewCount: 3,
651
+ read: 0,
652
+ score: 0,
653
+ title: uid(),
654
+ subTitle: uid(),
655
+ content: uid(),
656
+ slug: uid(),
657
+ musicUrl: uid(),
658
+ excerpt: uid(),
659
+ coverImage: uid(),
660
+ publishedAt: '2025-09-11T15:25:28.000Z',
661
+ category: {
662
+ lastPostedAt: null,
663
+ id: 11,
664
+ createdAt: '2025-09-09T18:55:29.470Z',
665
+ updatedAt: '2025-09-09T18:55:29.470Z',
666
+ title: 'ducimus fugit suspendo',
667
+ subTitle: 'Subiungo cresco texo admiratio velit canonicus patria adsidue ex.',
668
+ description:
669
+ 'Adduco iusto laudantium. Ratione umerus totidem cursus vergo conventus pectus explicabo. Sonitus vilicus creator vester ubi crur.',
670
+ slug: '0wpdu0easwd',
671
+ sort: 10,
672
+ coverImageUrl: 'https://loremflickr.com/640/480?lock=3311738422296576',
673
+ url: 'https://frightening-antling.info',
674
+ followerCount: 1061,
675
+ articleCount: 0,
676
+ hidden: false,
677
+ themeColor: '#7c181c',
678
+ icon: '🕳️',
679
+ allowComments: true,
680
+ parentId: null,
681
+ moderatorId: null,
682
+ createdById: null,
683
+ updatedById: null,
684
+ },
685
+ tags: [
686
+ {
687
+ lastUsedAt: null,
688
+ id: 6,
689
+ createdAt: '2025-09-09T18:55:29.510Z',
690
+ updatedAt: '2025-09-09T18:55:29.510Z',
691
+ name: '9q74kvldzix',
692
+ description: 'Studio abutor quia cilicium sumptus defessus.',
693
+ color: '#342624',
694
+ icon: '🚈',
695
+ slug: 'o78niik6cpf',
696
+ isFeatured: false,
697
+ usageCount: 0,
698
+ followerCount: 2921,
699
+ synonyms: null,
700
+ isOfficial: false,
701
+ moderationStatus: 'approved',
702
+ group: 'tertius',
703
+ seoTitle: 'Thermae constans atqui vinculum adfectus quibusdam demergo venia vespillo.',
704
+ seoDescription:
705
+ 'Laboriosam acerbitas sui. Usque tametsi absens uredo minus condico creptio crux tamisium. Coerceo spes debeo ocer adsidue paulatim.',
706
+ reviewNotes: null,
707
+ curatorId: null,
708
+ createdById: null,
709
+ updatedById: null,
710
+ },
711
+ {
712
+ lastUsedAt: null,
713
+ id: 5,
714
+ createdAt: '2025-09-09T18:55:29.510Z',
715
+ updatedAt: '2025-09-09T18:55:29.510Z',
716
+ name: '028oixvc0gq',
717
+ description: 'Acsi vilis somniculosus vobis temeritas.',
718
+ color: '#52143f',
719
+ icon: '🔧',
720
+ slug: 's4d4nd925dp',
721
+ isFeatured: true,
722
+ usageCount: 0,
723
+ followerCount: 682,
724
+ synonyms: null,
725
+ isOfficial: true,
726
+ moderationStatus: 'approved',
727
+ group: 'tepesco',
728
+ seoTitle: 'Apostolus acerbitas vespillo adversus decimus toties.',
729
+ seoDescription:
730
+ 'Vicissitudo sum admoneo ambulo decimus sufficio. Derideo clamo veritatis canonicus. Arca cura valeo suffoco decimus delego thesis aeneus cultura sophismata.',
731
+ reviewNotes: null,
732
+ curatorId: null,
733
+ createdById: null,
734
+ updatedById: null,
735
+ },
736
+ ],
737
+ }),
738
+ params,
739
+ );
740
+
741
+ check(resp, { 'status equals 200': (r) => r.status === 200 });
742
+
743
+ params = {
744
+ headers: {
745
+ 'Proxy-Connection': `keep-alive`,
746
+ Authorization: `Bearer ${token}`,
747
+ 'X-Authenticator': `basic`,
748
+ 'X-Timezone': `+08:00`,
749
+ 'X-Role': `root`,
750
+ Accept: `application/json, text/plain, */*`,
751
+ 'X-With-ACL-Meta': `true`,
752
+ 'X-Locale': `en-US`,
753
+ Referer: `${__ENV.TARGET_ORIGIN}/admin/flwak70a1tp/popups/6jpajycbqcl`,
754
+ 'Accept-Encoding': `gzip, deflate`,
755
+ 'Accept-Language': `zh-CN,zh;q=0.9`,
756
+ },
757
+ cookies: {},
758
+ };
759
+
760
+ url = http.url`${__ENV.TARGET_ORIGIN}/api/posts:list?pageSize=20&appends[]=category&appends[]=tags&appends[]=createdBy&appends[]=updatedBy&filter=%7B%7D`;
761
+ resp = http.request('GET', url, null, params);
762
+
763
+ check(resp, { 'status equals 200': (r) => r.status === 200 });
764
+ });
765
+
766
+ sleep(1);
767
+ }