@oak-digital/types-4-strapi-2 0.5.5 → 1.0.0-beta.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/.eslintrc.json +2 -1
- package/CHANGELOG.md +7 -0
- package/README.md +17 -5
- package/lib/attributes/Attributes.d.ts +4 -3
- package/lib/attributes/Attributes.js +102 -78
- package/lib/content-types/reader.js +49 -145
- package/lib/extra-types/ExtraType.d.ts +2 -2
- package/lib/extra-types/ExtraType.js +19 -38
- package/lib/extra-types/createExtraTypes.d.ts +1 -1
- package/lib/extra-types/createExtraTypes.js +11 -12
- package/lib/file/File.d.ts +1 -1
- package/lib/file/File.js +44 -43
- package/lib/index.js +57 -19
- package/lib/interface/BuiltinComponentInterface.js +9 -27
- package/lib/interface/BuiltinInterface.d.ts +0 -1
- package/lib/interface/BuiltinInterface.js +5 -26
- package/lib/interface/ComponentInterface.d.ts +2 -1
- package/lib/interface/ComponentInterface.js +30 -48
- package/lib/interface/Interface.d.ts +6 -2
- package/lib/interface/Interface.js +69 -70
- package/lib/interface/builtinInterfaces.d.ts +1941 -2
- package/lib/interface/builtinInterfaces.js +56 -46
- package/lib/plugins/PluginManager.d.ts +8 -2
- package/lib/plugins/PluginManager.js +28 -35
- package/lib/plugins/draft-and-publish/index.d.ts +1 -1
- package/lib/plugins/draft-and-publish/index.js +17 -21
- package/lib/plugins/i18n/index.d.ts +1 -1
- package/lib/plugins/i18n/index.js +17 -22
- package/lib/plugins/index.js +4 -4
- package/lib/plugins/types.d.ts +1 -1
- package/lib/plugins/types.js +1 -4
- package/lib/plugins/url-alias/index.js +12 -15
- package/lib/plugins/url-alias/type.js +21 -32
- package/lib/program/InterfaceManager.d.ts +374 -24
- package/lib/program/InterfaceManager.js +128 -376
- package/lib/readers/by-file.d.ts +321 -0
- package/lib/readers/by-file.js +116 -0
- package/lib/readers/load-strapi/index.d.ts +319 -0
- package/lib/readers/load-strapi/index.js +106 -0
- package/lib/readers/types/attributes.d.ts +1639 -0
- package/lib/readers/types/attributes.js +144 -0
- package/lib/readers/types/component.d.ts +723 -0
- package/lib/readers/types/component.js +11 -0
- package/lib/readers/types/content-type-reader.d.ts +16 -0
- package/lib/readers/types/content-type-reader.js +2 -0
- package/lib/readers/types/content-type.d.ts +766 -0
- package/lib/readers/types/content-type.js +16 -0
- package/lib/utils/casing/index.js +2 -2
- package/lib/utils/index.js +5 -39
- package/lib/writers/basic-writer.d.ts +24 -0
- package/lib/writers/basic-writer.js +75 -0
- package/lib/writers/types/writer.d.ts +4 -0
- package/lib/writers/types/writer.js +2 -0
- package/package.json +4 -2
- package/tests/strapi-project/.editorconfig +16 -0
- package/tests/strapi-project/.env.example +6 -0
- package/tests/strapi-project/README.md +57 -0
- package/tests/strapi-project/config/admin.ts +13 -0
- package/tests/strapi-project/config/api.ts +7 -0
- package/tests/strapi-project/config/database.ts +93 -0
- package/tests/strapi-project/config/middlewares.ts +12 -0
- package/tests/strapi-project/config/server.ts +10 -0
- package/tests/strapi-project/database/migrations/.gitkeep +0 -0
- package/tests/strapi-project/favicon.png +0 -0
- package/tests/strapi-project/package-lock.json +16125 -0
- package/tests/strapi-project/package.json +30 -0
- package/tests/strapi-project/public/robots.txt +3 -0
- package/tests/strapi-project/public/uploads/.gitkeep +0 -0
- package/tests/strapi-project/src/admin/app.example.tsx +35 -0
- package/tests/strapi-project/src/admin/webpack.config.example.js +9 -0
- package/tests/strapi-project/src/api/.gitkeep +0 -0
- package/tests/strapi-project/src/api/collection-1/content-types/collection-1/schema.json +18 -0
- package/tests/strapi-project/src/api/collection-1/content-types/generated-type/schema.json +18 -0
- package/tests/strapi-project/src/api/collection-1/controllers/collection-1.ts +7 -0
- package/tests/strapi-project/src/api/collection-1/controllers/generated-type.ts +7 -0
- package/tests/strapi-project/src/api/collection-1/routes/collection-1.ts +7 -0
- package/tests/strapi-project/src/api/collection-1/routes/generated-type.ts +7 -0
- package/tests/strapi-project/src/api/collection-1/services/collection-1.ts +7 -0
- package/tests/strapi-project/src/api/collection-1/services/generated-type.ts +7 -0
- package/tests/strapi-project/src/api/standalone-controller/controllers/standalone-controller.ts +13 -0
- package/tests/strapi-project/src/components/my-category/all-types.json +88 -0
- package/tests/strapi-project/src/components/other-category/sub-component.json +12 -0
- package/tests/strapi-project/src/extensions/.gitkeep +0 -0
- package/tests/strapi-project/src/index.ts +18 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "strapi-project",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"description": "A Strapi application",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"develop": "strapi develop",
|
|
8
|
+
"start": "strapi start",
|
|
9
|
+
"build": "strapi build",
|
|
10
|
+
"strapi": "strapi"
|
|
11
|
+
},
|
|
12
|
+
"devDependencies": {},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"@strapi/strapi": "4.10.5",
|
|
15
|
+
"@strapi/plugin-users-permissions": "4.10.5",
|
|
16
|
+
"@strapi/plugin-i18n": "4.10.5",
|
|
17
|
+
"better-sqlite3": "8.0.1"
|
|
18
|
+
},
|
|
19
|
+
"author": {
|
|
20
|
+
"name": "A Strapi developer"
|
|
21
|
+
},
|
|
22
|
+
"strapi": {
|
|
23
|
+
"uuid": "06c55e27-9078-4e51-a92e-0f4c5b1fdea4"
|
|
24
|
+
},
|
|
25
|
+
"engines": {
|
|
26
|
+
"node": ">=14.19.1 <=18.x.x",
|
|
27
|
+
"npm": ">=6.0.0"
|
|
28
|
+
},
|
|
29
|
+
"license": "MIT"
|
|
30
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
config: {
|
|
3
|
+
locales: [
|
|
4
|
+
// 'ar',
|
|
5
|
+
// 'fr',
|
|
6
|
+
// 'cs',
|
|
7
|
+
// 'de',
|
|
8
|
+
// 'dk',
|
|
9
|
+
// 'es',
|
|
10
|
+
// 'he',
|
|
11
|
+
// 'id',
|
|
12
|
+
// 'it',
|
|
13
|
+
// 'ja',
|
|
14
|
+
// 'ko',
|
|
15
|
+
// 'ms',
|
|
16
|
+
// 'nl',
|
|
17
|
+
// 'no',
|
|
18
|
+
// 'pl',
|
|
19
|
+
// 'pt-BR',
|
|
20
|
+
// 'pt',
|
|
21
|
+
// 'ru',
|
|
22
|
+
// 'sk',
|
|
23
|
+
// 'sv',
|
|
24
|
+
// 'th',
|
|
25
|
+
// 'tr',
|
|
26
|
+
// 'uk',
|
|
27
|
+
// 'vi',
|
|
28
|
+
// 'zh-Hans',
|
|
29
|
+
// 'zh',
|
|
30
|
+
],
|
|
31
|
+
},
|
|
32
|
+
bootstrap(app) {
|
|
33
|
+
console.log(app);
|
|
34
|
+
},
|
|
35
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/* eslint-disable no-unused-vars */
|
|
4
|
+
module.exports = (config, webpack) => {
|
|
5
|
+
// Note: we provide webpack above so you should not `require` it
|
|
6
|
+
// Perform customizations to webpack config
|
|
7
|
+
// Important: return the modified config
|
|
8
|
+
return config;
|
|
9
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"kind": "collectionType",
|
|
3
|
+
"collectionName": "collection_1s",
|
|
4
|
+
"info": {
|
|
5
|
+
"singularName": "collection-1",
|
|
6
|
+
"pluralName": "collection-1s",
|
|
7
|
+
"displayName": "Collection 1"
|
|
8
|
+
},
|
|
9
|
+
"options": {
|
|
10
|
+
"draftAndPublish": true
|
|
11
|
+
},
|
|
12
|
+
"pluginOptions": {},
|
|
13
|
+
"attributes": {
|
|
14
|
+
"text": {
|
|
15
|
+
"type": "string"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"kind": "collectionType",
|
|
3
|
+
"collectionName": "generated_types",
|
|
4
|
+
"info": {
|
|
5
|
+
"singularName": "generated-type",
|
|
6
|
+
"pluralName": "generated-types",
|
|
7
|
+
"displayName": "Generated type"
|
|
8
|
+
},
|
|
9
|
+
"options": {
|
|
10
|
+
"draftAndPublish": false,
|
|
11
|
+
"comment": ""
|
|
12
|
+
},
|
|
13
|
+
"attributes": {
|
|
14
|
+
"text": {
|
|
15
|
+
"type": "string"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
{
|
|
2
|
+
"collectionName": "components_my_category_all_types",
|
|
3
|
+
"info": {
|
|
4
|
+
"displayName": "All types",
|
|
5
|
+
"description": ""
|
|
6
|
+
},
|
|
7
|
+
"options": {},
|
|
8
|
+
"attributes": {
|
|
9
|
+
"text": {
|
|
10
|
+
"type": "string"
|
|
11
|
+
},
|
|
12
|
+
"email": {
|
|
13
|
+
"type": "email"
|
|
14
|
+
},
|
|
15
|
+
"rich": {
|
|
16
|
+
"type": "richtext"
|
|
17
|
+
},
|
|
18
|
+
"pswd": {
|
|
19
|
+
"type": "password"
|
|
20
|
+
},
|
|
21
|
+
"int": {
|
|
22
|
+
"type": "integer"
|
|
23
|
+
},
|
|
24
|
+
"bigint": {
|
|
25
|
+
"type": "biginteger"
|
|
26
|
+
},
|
|
27
|
+
"decimal": {
|
|
28
|
+
"type": "decimal"
|
|
29
|
+
},
|
|
30
|
+
"float": {
|
|
31
|
+
"type": "float"
|
|
32
|
+
},
|
|
33
|
+
"enum": {
|
|
34
|
+
"type": "enumeration",
|
|
35
|
+
"enum": [
|
|
36
|
+
"a",
|
|
37
|
+
"b",
|
|
38
|
+
"c"
|
|
39
|
+
]
|
|
40
|
+
},
|
|
41
|
+
"date": {
|
|
42
|
+
"type": "date"
|
|
43
|
+
},
|
|
44
|
+
"datetime": {
|
|
45
|
+
"type": "datetime"
|
|
46
|
+
},
|
|
47
|
+
"time": {
|
|
48
|
+
"type": "time"
|
|
49
|
+
},
|
|
50
|
+
"multipleMedia": {
|
|
51
|
+
"type": "media",
|
|
52
|
+
"multiple": true,
|
|
53
|
+
"required": false,
|
|
54
|
+
"allowedTypes": [
|
|
55
|
+
"images",
|
|
56
|
+
"files",
|
|
57
|
+
"videos",
|
|
58
|
+
"audios"
|
|
59
|
+
]
|
|
60
|
+
},
|
|
61
|
+
"singleImage": {
|
|
62
|
+
"type": "media",
|
|
63
|
+
"multiple": false,
|
|
64
|
+
"required": false,
|
|
65
|
+
"allowedTypes": [
|
|
66
|
+
"images"
|
|
67
|
+
]
|
|
68
|
+
},
|
|
69
|
+
"bool": {
|
|
70
|
+
"type": "boolean",
|
|
71
|
+
"required": true
|
|
72
|
+
},
|
|
73
|
+
"json": {
|
|
74
|
+
"type": "json"
|
|
75
|
+
},
|
|
76
|
+
"repeatable": {
|
|
77
|
+
"displayName": "subComponent",
|
|
78
|
+
"type": "component",
|
|
79
|
+
"repeatable": true,
|
|
80
|
+
"component": "other-category.sub-component"
|
|
81
|
+
},
|
|
82
|
+
"component": {
|
|
83
|
+
"type": "component",
|
|
84
|
+
"repeatable": false,
|
|
85
|
+
"component": "other-category.sub-component"
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
/**
|
|
3
|
+
* An asynchronous register function that runs before
|
|
4
|
+
* your application is initialized.
|
|
5
|
+
*
|
|
6
|
+
* This gives you an opportunity to extend code.
|
|
7
|
+
*/
|
|
8
|
+
register(/*{ strapi }*/) {},
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* An asynchronous bootstrap function that runs before
|
|
12
|
+
* your application gets started.
|
|
13
|
+
*
|
|
14
|
+
* This gives you an opportunity to set up your data model,
|
|
15
|
+
* run jobs, or perform some special logic.
|
|
16
|
+
*/
|
|
17
|
+
bootstrap(/*{ strapi }*/) {},
|
|
18
|
+
};
|