@strapi/strapi 4.10.0 → 4.10.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.
- package/coverage/clover.xml +1613 -0
- package/coverage/coverage-final.json +48 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/commands/__tests__/data-transfer/shared/index.html +116 -0
- package/coverage/lcov-report/commands/__tests__/data-transfer/shared/transfer.test.utils.js.html +133 -0
- package/coverage/lcov-report/commands/admin-create.js.html +424 -0
- package/coverage/lcov-report/commands/admin-reset.js.html +241 -0
- package/coverage/lcov-report/commands/generate-template.js.html +373 -0
- package/coverage/lcov-report/commands/index.html +146 -0
- package/coverage/lcov-report/commands/transfer/export.js.html +619 -0
- package/coverage/lcov-report/commands/transfer/import.js.html +562 -0
- package/coverage/lcov-report/commands/transfer/index.html +146 -0
- package/coverage/lcov-report/commands/transfer/transfer.js.html +532 -0
- package/coverage/lcov-report/commands/utils/helpers.js.html +430 -0
- package/coverage/lcov-report/commands/utils/index.html +116 -0
- package/coverage/lcov-report/core/registries/custom-fields.js.html +301 -0
- package/coverage/lcov-report/core/registries/index.html +116 -0
- package/coverage/lcov-report/core-api/controller/collection-type.js.html +418 -0
- package/coverage/lcov-report/core-api/controller/index.html +161 -0
- package/coverage/lcov-report/core-api/controller/index.js.html +220 -0
- package/coverage/lcov-report/core-api/controller/single-type.js.html +274 -0
- package/coverage/lcov-report/core-api/controller/transform.js.html +376 -0
- package/coverage/lcov-report/core-api/service/collection-type.js.html +325 -0
- package/coverage/lcov-report/core-api/service/index.html +161 -0
- package/coverage/lcov-report/core-api/service/index.js.html +220 -0
- package/coverage/lcov-report/core-api/service/pagination.js.html +460 -0
- package/coverage/lcov-report/core-api/service/single-type.js.html +301 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +386 -0
- package/coverage/lcov-report/load/filepath-to-prop-path.js.html +151 -0
- package/coverage/lcov-report/load/index.html +116 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/services/content-api/index.html +116 -0
- package/coverage/lcov-report/services/content-api/index.js.html +307 -0
- package/coverage/lcov-report/services/content-api/permissions/engine.js.html +100 -0
- package/coverage/lcov-report/services/content-api/permissions/index.html +131 -0
- package/coverage/lcov-report/services/content-api/permissions/index.js.html +529 -0
- package/coverage/lcov-report/services/content-api/permissions/providers/action.js.html +142 -0
- package/coverage/lcov-report/services/content-api/permissions/providers/condition.js.html +142 -0
- package/coverage/lcov-report/services/content-api/permissions/providers/index.html +146 -0
- package/coverage/lcov-report/services/content-api/permissions/providers/index.js.html +112 -0
- package/coverage/lcov-report/services/core-store.js.html +520 -0
- package/coverage/lcov-report/services/entity-service/attributes/index.html +131 -0
- package/coverage/lcov-report/services/entity-service/attributes/index.js.html +178 -0
- package/coverage/lcov-report/services/entity-service/attributes/transforms.js.html +145 -0
- package/coverage/lcov-report/services/entity-service/components.js.html +1246 -0
- package/coverage/lcov-report/services/entity-service/index.html +146 -0
- package/coverage/lcov-report/services/entity-service/index.js.html +1120 -0
- package/coverage/lcov-report/services/entity-service/params.js.html +112 -0
- package/coverage/lcov-report/services/entity-validator/__tests__/relations/utils/index.html +116 -0
- package/coverage/lcov-report/services/entity-validator/__tests__/relations/utils/relations.testdata.js.html +544 -0
- package/coverage/lcov-report/services/entity-validator/index.html +131 -0
- package/coverage/lcov-report/services/entity-validator/index.js.html +1231 -0
- package/coverage/lcov-report/services/entity-validator/validators.js.html +733 -0
- package/coverage/lcov-report/services/event-hub.js.html +319 -0
- package/coverage/lcov-report/services/fs.js.html +259 -0
- package/coverage/lcov-report/services/index.html +161 -0
- package/coverage/lcov-report/services/metrics/admin-user-hash.js.html +148 -0
- package/coverage/lcov-report/services/metrics/index.html +206 -0
- package/coverage/lcov-report/services/metrics/index.js.html +265 -0
- package/coverage/lcov-report/services/metrics/is-truthy.js.html +112 -0
- package/coverage/lcov-report/services/metrics/middleware.js.html +184 -0
- package/coverage/lcov-report/services/metrics/rate-limiter.js.html +166 -0
- package/coverage/lcov-report/services/metrics/sender.js.html +394 -0
- package/coverage/lcov-report/services/metrics/stringify-deep.js.html +151 -0
- package/coverage/lcov-report/services/utils/index.html +116 -0
- package/coverage/lcov-report/services/utils/upload-files.js.html +322 -0
- package/coverage/lcov-report/services/worker-queue.js.html +262 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +196 -0
- package/coverage/lcov-report/utils/convert-custom-field-type.js.html +151 -0
- package/coverage/lcov-report/utils/index.html +146 -0
- package/coverage/lcov-report/utils/machine-id.js.html +127 -0
- package/coverage/lcov-report/utils/url-from-segments.js.html +121 -0
- package/lib/commands/__tests__/commands.test.js +20 -0
- package/lib/commands/__tests__/commands.test.utils.js +16 -0
- package/lib/commands/actions/admin/create-user/__tests__/admin.create-user.test.js +450 -0
- package/lib/commands/actions/admin/reset-user-password/__tests__/admin.reset-user-password.test.js +145 -0
- package/lib/commands/actions/build/action.js +18 -0
- package/lib/commands/actions/build/command.js +15 -0
- package/lib/commands/actions/export/__tests__/export.test.js +175 -0
- package/lib/commands/actions/import/__tests__/import.test.js +143 -0
- package/lib/commands/actions/templates/generate/__tests__/templates.generate.js +118 -0
- package/lib/commands/actions/transfer/__tests__/transfer.test.js +178 -0
- package/lib/core/registries/__tests__/custom-fields.test.js +152 -0
- package/lib/core-api/__tests__/controller.test.js +39 -0
- package/lib/core-api/controller/__tests__/transform.test.js +226 -0
- package/lib/core-api/service/__tests__/index.test.js +127 -0
- package/lib/core-api/service/__tests__/pagination.test.js +275 -0
- package/lib/load/__tests__/filepath-to-prop-path.test.js +30 -0
- package/lib/middlewares/__tests__/errors.test.js +21 -0
- package/lib/services/__tests__/content-api-permissions.test.js +291 -0
- package/lib/services/__tests__/core-store.test.js +148 -0
- package/lib/services/__tests__/event-hub.test.js +126 -0
- package/lib/services/__tests__/fs.test.js +78 -0
- package/lib/services/__tests__/worker-queue.test.js +47 -0
- package/lib/services/entity-service/__tests__/entity-service-events.test.js +117 -0
- package/lib/services/entity-service/__tests__/entity-service.test.js +587 -0
- package/lib/services/entity-validator/__tests__/biginteger-validators.test.js +220 -0
- package/lib/services/entity-validator/__tests__/date-validators.test.js +183 -0
- package/lib/services/entity-validator/__tests__/datetime-validators.test.js +183 -0
- package/lib/services/entity-validator/__tests__/email-validators.test.js +56 -0
- package/lib/services/entity-validator/__tests__/enumeration-validators.test.js +43 -0
- package/lib/services/entity-validator/__tests__/float-validators.test.js +278 -0
- package/lib/services/entity-validator/__tests__/index.test.js +609 -0
- package/lib/services/entity-validator/__tests__/integer-validators.test.js +278 -0
- package/lib/services/entity-validator/__tests__/relations/attribute-level.test.js +123 -0
- package/lib/services/entity-validator/__tests__/relations/component-level.test.js +275 -0
- package/lib/services/entity-validator/__tests__/relations/dynamic-zone-level.test.js +159 -0
- package/lib/services/entity-validator/__tests__/relations/media-level.test.js +74 -0
- package/lib/services/entity-validator/__tests__/relations/utils/relations.testdata.js +153 -0
- package/lib/services/entity-validator/__tests__/string-validators.test.js +374 -0
- package/lib/services/entity-validator/__tests__/time-validators.test.js +183 -0
- package/lib/services/entity-validator/__tests__/timestamp-validators.test.js +204 -0
- package/lib/services/entity-validator/__tests__/uid-validators.test.js +229 -0
- package/lib/services/metrics/__tests__/admin-user-hash.test.js +41 -0
- package/lib/services/metrics/__tests__/index.test.js +157 -0
- package/lib/services/metrics/__tests__/is-truthy.js +33 -0
- package/lib/services/metrics/__tests__/middleware.test.js +60 -0
- package/lib/services/metrics/__tests__/rate-limiter.test.js +50 -0
- package/lib/services/metrics/__tests__/stringify-deep.test.js +27 -0
- package/lib/utils/__tests__/convert-custom-field-type.test.js +69 -0
- package/lib/utils/__tests__/url-from-segments.test.js +40 -0
- package/package.json +15 -15
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const { ValidationError } = require('@strapi/utils').errors;
|
|
4
|
+
|
|
5
|
+
const entityValidator = require('../..');
|
|
6
|
+
const { models, nonExistentIds, existentIDs } = require('./utils/relations.testdata');
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Test that relations can be successfully validated and non existent relations
|
|
10
|
+
* can be detected at the Dynamic Zone level.
|
|
11
|
+
*/
|
|
12
|
+
describe('Entity validator | Relations | Dynamic Zone', () => {
|
|
13
|
+
const strapi = {
|
|
14
|
+
components: {
|
|
15
|
+
'basic.dev-compo': {},
|
|
16
|
+
},
|
|
17
|
+
db: {
|
|
18
|
+
query() {
|
|
19
|
+
return {
|
|
20
|
+
count: ({
|
|
21
|
+
where: {
|
|
22
|
+
id: { $in },
|
|
23
|
+
},
|
|
24
|
+
}) => existentIDs.filter((value) => $in.includes(value)).length,
|
|
25
|
+
};
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
errors: {
|
|
29
|
+
badRequest: jest.fn(),
|
|
30
|
+
},
|
|
31
|
+
getModel: (uid) => models.get(uid),
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
describe('Success', () => {
|
|
35
|
+
const testData = [
|
|
36
|
+
[
|
|
37
|
+
'Connect',
|
|
38
|
+
{
|
|
39
|
+
DZ: [
|
|
40
|
+
{
|
|
41
|
+
__component: 'basic.dev-compo',
|
|
42
|
+
categories: {
|
|
43
|
+
disconnect: [],
|
|
44
|
+
connect: existentIDs.slice(-3).map((id) => ({
|
|
45
|
+
id,
|
|
46
|
+
})),
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
[
|
|
53
|
+
'Set',
|
|
54
|
+
{
|
|
55
|
+
DZ: [
|
|
56
|
+
{
|
|
57
|
+
__component: 'basic.dev-compo',
|
|
58
|
+
categories: {
|
|
59
|
+
set: existentIDs.slice(-3).map((id) => ({
|
|
60
|
+
id,
|
|
61
|
+
})),
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
[
|
|
68
|
+
'Number',
|
|
69
|
+
{
|
|
70
|
+
DZ: [
|
|
71
|
+
{
|
|
72
|
+
__component: 'basic.dev-compo',
|
|
73
|
+
categories: existentIDs[0],
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
[
|
|
79
|
+
'Array',
|
|
80
|
+
{
|
|
81
|
+
DZ: [
|
|
82
|
+
{
|
|
83
|
+
__component: 'basic.dev-compo',
|
|
84
|
+
categories: existentIDs.slice(-3),
|
|
85
|
+
},
|
|
86
|
+
],
|
|
87
|
+
},
|
|
88
|
+
],
|
|
89
|
+
];
|
|
90
|
+
|
|
91
|
+
test.each(testData)('%s', async (__, input = {}) => {
|
|
92
|
+
global.strapi = strapi;
|
|
93
|
+
const res = entityValidator.validateEntityCreation(models.get('api::dev.dev'), input, {
|
|
94
|
+
isDraft: true,
|
|
95
|
+
});
|
|
96
|
+
await expect(res).resolves.not.toThrowError();
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
describe('Error', () => {
|
|
101
|
+
const expectedError = new ValidationError(
|
|
102
|
+
`2 relation(s) of type api::category.category associated with this entity do not exist`
|
|
103
|
+
);
|
|
104
|
+
const testData = [
|
|
105
|
+
[
|
|
106
|
+
'Connect',
|
|
107
|
+
{
|
|
108
|
+
DZ: [
|
|
109
|
+
{
|
|
110
|
+
__component: 'basic.dev-compo',
|
|
111
|
+
categories: {
|
|
112
|
+
disconnect: [],
|
|
113
|
+
connect: [existentIDs[0], ...nonExistentIds.slice(-2)].map((id) => ({
|
|
114
|
+
id,
|
|
115
|
+
})),
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
],
|
|
119
|
+
},
|
|
120
|
+
],
|
|
121
|
+
[
|
|
122
|
+
'Set',
|
|
123
|
+
{
|
|
124
|
+
DZ: [
|
|
125
|
+
{
|
|
126
|
+
__component: 'basic.dev-compo',
|
|
127
|
+
categories: {
|
|
128
|
+
set: [existentIDs[0], ...nonExistentIds.slice(-2)].map((id) => ({
|
|
129
|
+
id,
|
|
130
|
+
})),
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
],
|
|
134
|
+
},
|
|
135
|
+
],
|
|
136
|
+
[
|
|
137
|
+
'Array',
|
|
138
|
+
{
|
|
139
|
+
DZ: [
|
|
140
|
+
{
|
|
141
|
+
__component: 'basic.dev-compo',
|
|
142
|
+
categories: [existentIDs[0], ...nonExistentIds.slice(-2)].map((id) => ({
|
|
143
|
+
id,
|
|
144
|
+
})),
|
|
145
|
+
},
|
|
146
|
+
],
|
|
147
|
+
},
|
|
148
|
+
],
|
|
149
|
+
];
|
|
150
|
+
|
|
151
|
+
test.each(testData)('%s', async (__, input = {}) => {
|
|
152
|
+
global.strapi = strapi;
|
|
153
|
+
const res = entityValidator.validateEntityCreation(models.get('api::dev.dev'), input, {
|
|
154
|
+
isDraft: true,
|
|
155
|
+
});
|
|
156
|
+
await expect(res).rejects.toThrowError(expectedError);
|
|
157
|
+
});
|
|
158
|
+
});
|
|
159
|
+
});
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const { ValidationError } = require('@strapi/utils').errors;
|
|
4
|
+
|
|
5
|
+
const entityValidator = require('../..');
|
|
6
|
+
const { models, existentIDs, nonExistentIds } = require('./utils/relations.testdata');
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Test that relations can be successfully validated and non existent relations
|
|
10
|
+
* can be detected at the Media level.
|
|
11
|
+
*/
|
|
12
|
+
describe('Entity validator | Relations | Media', () => {
|
|
13
|
+
const strapi = {
|
|
14
|
+
components: {
|
|
15
|
+
'basic.dev-compo': {},
|
|
16
|
+
},
|
|
17
|
+
db: {
|
|
18
|
+
query() {
|
|
19
|
+
return {
|
|
20
|
+
count: ({
|
|
21
|
+
where: {
|
|
22
|
+
id: { $in },
|
|
23
|
+
},
|
|
24
|
+
}) => existentIDs.filter((value) => $in.includes(value)).length,
|
|
25
|
+
};
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
errors: {
|
|
29
|
+
badRequest: jest.fn(),
|
|
30
|
+
},
|
|
31
|
+
getModel: (uid) => models.get(uid),
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
it('Success', async () => {
|
|
35
|
+
global.strapi = strapi;
|
|
36
|
+
const input = {
|
|
37
|
+
media: [
|
|
38
|
+
{
|
|
39
|
+
id: existentIDs[0],
|
|
40
|
+
name: 'img.jpeg',
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const res = entityValidator.validateEntityCreation(models.get('api::dev.dev'), input, {
|
|
46
|
+
isDraft: true,
|
|
47
|
+
});
|
|
48
|
+
await expect(res).resolves.not.toThrowError();
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it('Error', async () => {
|
|
52
|
+
global.strapi = strapi;
|
|
53
|
+
const expectedError = new ValidationError(
|
|
54
|
+
`1 relation(s) of type plugin::upload.file associated with this entity do not exist`
|
|
55
|
+
);
|
|
56
|
+
const input = {
|
|
57
|
+
media: [
|
|
58
|
+
{
|
|
59
|
+
id: nonExistentIds[0],
|
|
60
|
+
name: 'img.jpeg',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
id: existentIDs[0],
|
|
64
|
+
name: 'img.jpeg',
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
const res = entityValidator.validateEntityCreation(models.get('api::dev.dev'), input, {
|
|
70
|
+
isDraft: true,
|
|
71
|
+
});
|
|
72
|
+
await expect(res).rejects.toThrowError(expectedError);
|
|
73
|
+
});
|
|
74
|
+
});
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const models = new Map();
|
|
4
|
+
models.set('api::dev.dev', {
|
|
5
|
+
kind: 'collectionType',
|
|
6
|
+
collectionName: 'devs',
|
|
7
|
+
modelType: 'contentType',
|
|
8
|
+
modelName: 'dev',
|
|
9
|
+
connection: 'default',
|
|
10
|
+
uid: 'api::dev.dev',
|
|
11
|
+
apiName: 'dev',
|
|
12
|
+
globalId: 'Dev',
|
|
13
|
+
info: {
|
|
14
|
+
singularName: 'dev',
|
|
15
|
+
pluralName: 'devs',
|
|
16
|
+
displayName: 'Dev',
|
|
17
|
+
description: '',
|
|
18
|
+
},
|
|
19
|
+
attributes: {
|
|
20
|
+
categories: {
|
|
21
|
+
type: 'relation',
|
|
22
|
+
relation: 'manyToMany',
|
|
23
|
+
target: 'api::category.category',
|
|
24
|
+
inversedBy: 'devs',
|
|
25
|
+
},
|
|
26
|
+
sCom: {
|
|
27
|
+
type: 'component',
|
|
28
|
+
repeatable: false,
|
|
29
|
+
component: 'basic.dev-compo',
|
|
30
|
+
},
|
|
31
|
+
rCom: {
|
|
32
|
+
type: 'component',
|
|
33
|
+
repeatable: true,
|
|
34
|
+
component: 'basic.dev-compo',
|
|
35
|
+
},
|
|
36
|
+
DZ: {
|
|
37
|
+
type: 'dynamiczone',
|
|
38
|
+
components: ['basic.dev-compo'],
|
|
39
|
+
},
|
|
40
|
+
media: {
|
|
41
|
+
allowedTypes: ['images', 'files', 'videos', 'audios'],
|
|
42
|
+
type: 'media',
|
|
43
|
+
multiple: true,
|
|
44
|
+
},
|
|
45
|
+
createdAt: {
|
|
46
|
+
type: 'datetime',
|
|
47
|
+
},
|
|
48
|
+
updatedAt: {
|
|
49
|
+
type: 'datetime',
|
|
50
|
+
},
|
|
51
|
+
publishedAt: {
|
|
52
|
+
type: 'datetime',
|
|
53
|
+
configurable: false,
|
|
54
|
+
writable: true,
|
|
55
|
+
visible: false,
|
|
56
|
+
},
|
|
57
|
+
createdBy: {
|
|
58
|
+
type: 'relation',
|
|
59
|
+
relation: 'oneToOne',
|
|
60
|
+
target: 'admin::user',
|
|
61
|
+
configurable: false,
|
|
62
|
+
writable: false,
|
|
63
|
+
visible: false,
|
|
64
|
+
useJoinTable: false,
|
|
65
|
+
private: true,
|
|
66
|
+
},
|
|
67
|
+
updatedBy: {
|
|
68
|
+
type: 'relation',
|
|
69
|
+
relation: 'oneToOne',
|
|
70
|
+
target: 'admin::user',
|
|
71
|
+
configurable: false,
|
|
72
|
+
writable: false,
|
|
73
|
+
visible: false,
|
|
74
|
+
useJoinTable: false,
|
|
75
|
+
private: true,
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
});
|
|
79
|
+
models.set('api::category.category', {
|
|
80
|
+
kind: 'collectionType',
|
|
81
|
+
collectionName: 'categories',
|
|
82
|
+
modelType: 'contentType',
|
|
83
|
+
modelName: 'category',
|
|
84
|
+
connection: 'default',
|
|
85
|
+
uid: 'api::category.category',
|
|
86
|
+
apiName: 'category',
|
|
87
|
+
globalId: 'Category',
|
|
88
|
+
info: {
|
|
89
|
+
displayName: 'Category',
|
|
90
|
+
singularName: 'category',
|
|
91
|
+
pluralName: 'categories',
|
|
92
|
+
description: '',
|
|
93
|
+
name: 'Category',
|
|
94
|
+
},
|
|
95
|
+
attributes: {
|
|
96
|
+
name: {
|
|
97
|
+
type: 'string',
|
|
98
|
+
pluginOptions: {
|
|
99
|
+
i18n: {
|
|
100
|
+
localized: true,
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
});
|
|
106
|
+
models.set('basic.dev-compo', {
|
|
107
|
+
collectionName: 'components_basic_dev_compos',
|
|
108
|
+
uid: 'basic.dev-compo',
|
|
109
|
+
category: 'basic',
|
|
110
|
+
modelType: 'component',
|
|
111
|
+
modelName: 'dev-compo',
|
|
112
|
+
globalId: 'ComponentBasicDevCompo',
|
|
113
|
+
info: {
|
|
114
|
+
displayName: 'DevCompo',
|
|
115
|
+
icon: 'allergies',
|
|
116
|
+
},
|
|
117
|
+
attributes: {
|
|
118
|
+
categories: {
|
|
119
|
+
type: 'relation',
|
|
120
|
+
relation: 'oneToMany',
|
|
121
|
+
target: 'api::category.category',
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
});
|
|
125
|
+
models.set('plugin::upload.file', {
|
|
126
|
+
collectionName: 'files',
|
|
127
|
+
info: {
|
|
128
|
+
singularName: 'file',
|
|
129
|
+
pluralName: 'files',
|
|
130
|
+
displayName: 'File',
|
|
131
|
+
description: '',
|
|
132
|
+
},
|
|
133
|
+
attributes: {
|
|
134
|
+
name: {
|
|
135
|
+
type: 'string',
|
|
136
|
+
configurable: false,
|
|
137
|
+
required: true,
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
kind: 'collectionType',
|
|
141
|
+
modelType: 'contentType',
|
|
142
|
+
modelName: 'file',
|
|
143
|
+
connection: 'default',
|
|
144
|
+
uid: 'plugin::upload.file',
|
|
145
|
+
plugin: 'upload',
|
|
146
|
+
globalId: 'UploadFile',
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
module.exports = {
|
|
150
|
+
models,
|
|
151
|
+
existentIDs: [1, 2, 3, 4, 5, 6],
|
|
152
|
+
nonExistentIds: [10, 11, 12, 13, 14, 15, 16],
|
|
153
|
+
};
|