@strapi/strapi 4.10.1-experimental.0 → 4.10.2-alpha.0

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 (130) hide show
  1. package/lib/commands/actions/{build → build-command}/command.js +1 -1
  2. package/lib/commands/actions/telemetry/enable/action.js +3 -3
  3. package/lib/commands/index.js +1 -1
  4. package/lib/core/loaders/apis.js +5 -0
  5. package/lib/utils/machine-id.js +2 -2
  6. package/package.json +16 -17
  7. package/coverage/clover.xml +0 -1613
  8. package/coverage/coverage-final.json +0 -48
  9. package/coverage/lcov-report/base.css +0 -224
  10. package/coverage/lcov-report/block-navigation.js +0 -87
  11. package/coverage/lcov-report/commands/__tests__/data-transfer/shared/index.html +0 -116
  12. package/coverage/lcov-report/commands/__tests__/data-transfer/shared/transfer.test.utils.js.html +0 -133
  13. package/coverage/lcov-report/commands/admin-create.js.html +0 -424
  14. package/coverage/lcov-report/commands/admin-reset.js.html +0 -241
  15. package/coverage/lcov-report/commands/generate-template.js.html +0 -373
  16. package/coverage/lcov-report/commands/index.html +0 -146
  17. package/coverage/lcov-report/commands/transfer/export.js.html +0 -619
  18. package/coverage/lcov-report/commands/transfer/import.js.html +0 -562
  19. package/coverage/lcov-report/commands/transfer/index.html +0 -146
  20. package/coverage/lcov-report/commands/transfer/transfer.js.html +0 -532
  21. package/coverage/lcov-report/commands/utils/helpers.js.html +0 -430
  22. package/coverage/lcov-report/commands/utils/index.html +0 -116
  23. package/coverage/lcov-report/core/registries/custom-fields.js.html +0 -301
  24. package/coverage/lcov-report/core/registries/index.html +0 -116
  25. package/coverage/lcov-report/core-api/controller/collection-type.js.html +0 -418
  26. package/coverage/lcov-report/core-api/controller/index.html +0 -161
  27. package/coverage/lcov-report/core-api/controller/index.js.html +0 -220
  28. package/coverage/lcov-report/core-api/controller/single-type.js.html +0 -274
  29. package/coverage/lcov-report/core-api/controller/transform.js.html +0 -376
  30. package/coverage/lcov-report/core-api/service/collection-type.js.html +0 -325
  31. package/coverage/lcov-report/core-api/service/index.html +0 -161
  32. package/coverage/lcov-report/core-api/service/index.js.html +0 -220
  33. package/coverage/lcov-report/core-api/service/pagination.js.html +0 -460
  34. package/coverage/lcov-report/core-api/service/single-type.js.html +0 -301
  35. package/coverage/lcov-report/favicon.png +0 -0
  36. package/coverage/lcov-report/index.html +0 -386
  37. package/coverage/lcov-report/load/filepath-to-prop-path.js.html +0 -151
  38. package/coverage/lcov-report/load/index.html +0 -116
  39. package/coverage/lcov-report/prettify.css +0 -1
  40. package/coverage/lcov-report/prettify.js +0 -2
  41. package/coverage/lcov-report/services/content-api/index.html +0 -116
  42. package/coverage/lcov-report/services/content-api/index.js.html +0 -307
  43. package/coverage/lcov-report/services/content-api/permissions/engine.js.html +0 -100
  44. package/coverage/lcov-report/services/content-api/permissions/index.html +0 -131
  45. package/coverage/lcov-report/services/content-api/permissions/index.js.html +0 -529
  46. package/coverage/lcov-report/services/content-api/permissions/providers/action.js.html +0 -142
  47. package/coverage/lcov-report/services/content-api/permissions/providers/condition.js.html +0 -142
  48. package/coverage/lcov-report/services/content-api/permissions/providers/index.html +0 -146
  49. package/coverage/lcov-report/services/content-api/permissions/providers/index.js.html +0 -112
  50. package/coverage/lcov-report/services/core-store.js.html +0 -520
  51. package/coverage/lcov-report/services/entity-service/attributes/index.html +0 -131
  52. package/coverage/lcov-report/services/entity-service/attributes/index.js.html +0 -178
  53. package/coverage/lcov-report/services/entity-service/attributes/transforms.js.html +0 -145
  54. package/coverage/lcov-report/services/entity-service/components.js.html +0 -1246
  55. package/coverage/lcov-report/services/entity-service/index.html +0 -146
  56. package/coverage/lcov-report/services/entity-service/index.js.html +0 -1120
  57. package/coverage/lcov-report/services/entity-service/params.js.html +0 -112
  58. package/coverage/lcov-report/services/entity-validator/__tests__/relations/utils/index.html +0 -116
  59. package/coverage/lcov-report/services/entity-validator/__tests__/relations/utils/relations.testdata.js.html +0 -544
  60. package/coverage/lcov-report/services/entity-validator/index.html +0 -131
  61. package/coverage/lcov-report/services/entity-validator/index.js.html +0 -1231
  62. package/coverage/lcov-report/services/entity-validator/validators.js.html +0 -733
  63. package/coverage/lcov-report/services/event-hub.js.html +0 -319
  64. package/coverage/lcov-report/services/fs.js.html +0 -259
  65. package/coverage/lcov-report/services/index.html +0 -161
  66. package/coverage/lcov-report/services/metrics/admin-user-hash.js.html +0 -148
  67. package/coverage/lcov-report/services/metrics/index.html +0 -206
  68. package/coverage/lcov-report/services/metrics/index.js.html +0 -265
  69. package/coverage/lcov-report/services/metrics/is-truthy.js.html +0 -112
  70. package/coverage/lcov-report/services/metrics/middleware.js.html +0 -184
  71. package/coverage/lcov-report/services/metrics/rate-limiter.js.html +0 -166
  72. package/coverage/lcov-report/services/metrics/sender.js.html +0 -394
  73. package/coverage/lcov-report/services/metrics/stringify-deep.js.html +0 -151
  74. package/coverage/lcov-report/services/utils/index.html +0 -116
  75. package/coverage/lcov-report/services/utils/upload-files.js.html +0 -322
  76. package/coverage/lcov-report/services/worker-queue.js.html +0 -262
  77. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  78. package/coverage/lcov-report/sorter.js +0 -196
  79. package/coverage/lcov-report/utils/convert-custom-field-type.js.html +0 -151
  80. package/coverage/lcov-report/utils/index.html +0 -146
  81. package/coverage/lcov-report/utils/machine-id.js.html +0 -127
  82. package/coverage/lcov-report/utils/url-from-segments.js.html +0 -121
  83. package/lib/commands/__tests__/commands.test.js +0 -20
  84. package/lib/commands/__tests__/commands.test.utils.js +0 -16
  85. package/lib/commands/actions/admin/create-user/__tests__/admin.create-user.test.js +0 -450
  86. package/lib/commands/actions/admin/reset-user-password/__tests__/admin.reset-user-password.test.js +0 -145
  87. package/lib/commands/actions/export/__tests__/export.test.js +0 -175
  88. package/lib/commands/actions/import/__tests__/import.test.js +0 -143
  89. package/lib/commands/actions/templates/generate/__tests__/templates.generate.js +0 -118
  90. package/lib/commands/actions/transfer/__tests__/transfer.test.js +0 -178
  91. package/lib/core/registries/__tests__/custom-fields.test.js +0 -152
  92. package/lib/core-api/__tests__/controller.test.js +0 -39
  93. package/lib/core-api/controller/__tests__/transform.test.js +0 -226
  94. package/lib/core-api/service/__tests__/index.test.js +0 -127
  95. package/lib/core-api/service/__tests__/pagination.test.js +0 -275
  96. package/lib/load/__tests__/filepath-to-prop-path.test.js +0 -30
  97. package/lib/middlewares/__tests__/errors.test.js +0 -21
  98. package/lib/services/__tests__/content-api-permissions.test.js +0 -291
  99. package/lib/services/__tests__/core-store.test.js +0 -148
  100. package/lib/services/__tests__/event-hub.test.js +0 -126
  101. package/lib/services/__tests__/fs.test.js +0 -78
  102. package/lib/services/__tests__/worker-queue.test.js +0 -47
  103. package/lib/services/entity-service/__tests__/entity-service-events.test.js +0 -117
  104. package/lib/services/entity-service/__tests__/entity-service.test.js +0 -587
  105. package/lib/services/entity-validator/__tests__/biginteger-validators.test.js +0 -220
  106. package/lib/services/entity-validator/__tests__/date-validators.test.js +0 -183
  107. package/lib/services/entity-validator/__tests__/datetime-validators.test.js +0 -183
  108. package/lib/services/entity-validator/__tests__/email-validators.test.js +0 -56
  109. package/lib/services/entity-validator/__tests__/enumeration-validators.test.js +0 -43
  110. package/lib/services/entity-validator/__tests__/float-validators.test.js +0 -278
  111. package/lib/services/entity-validator/__tests__/index.test.js +0 -609
  112. package/lib/services/entity-validator/__tests__/integer-validators.test.js +0 -278
  113. package/lib/services/entity-validator/__tests__/relations/attribute-level.test.js +0 -123
  114. package/lib/services/entity-validator/__tests__/relations/component-level.test.js +0 -275
  115. package/lib/services/entity-validator/__tests__/relations/dynamic-zone-level.test.js +0 -159
  116. package/lib/services/entity-validator/__tests__/relations/media-level.test.js +0 -74
  117. package/lib/services/entity-validator/__tests__/relations/utils/relations.testdata.js +0 -153
  118. package/lib/services/entity-validator/__tests__/string-validators.test.js +0 -374
  119. package/lib/services/entity-validator/__tests__/time-validators.test.js +0 -183
  120. package/lib/services/entity-validator/__tests__/timestamp-validators.test.js +0 -204
  121. package/lib/services/entity-validator/__tests__/uid-validators.test.js +0 -229
  122. package/lib/services/metrics/__tests__/admin-user-hash.test.js +0 -41
  123. package/lib/services/metrics/__tests__/index.test.js +0 -157
  124. package/lib/services/metrics/__tests__/is-truthy.js +0 -33
  125. package/lib/services/metrics/__tests__/middleware.test.js +0 -60
  126. package/lib/services/metrics/__tests__/rate-limiter.test.js +0 -50
  127. package/lib/services/metrics/__tests__/stringify-deep.test.js +0 -27
  128. package/lib/utils/__tests__/convert-custom-field-type.test.js +0 -69
  129. package/lib/utils/__tests__/url-from-segments.test.js +0 -40
  130. /package/lib/commands/actions/{build → build-command}/action.js +0 -0
@@ -11,5 +11,5 @@ module.exports = ({ command }) => {
11
11
  .command('build')
12
12
  .option('--no-optimization', 'Build the admin app without optimizing assets')
13
13
  .description('Build the strapi admin app')
14
- .action(getLocalScript('build'));
14
+ .action(getLocalScript('build-command')); // build-command dir to avoid problems with 'build' being commonly ignored
15
15
  };
@@ -4,7 +4,7 @@ const { resolve } = require('path');
4
4
  const fse = require('fs-extra');
5
5
  const chalk = require('chalk');
6
6
  const fetch = require('node-fetch');
7
- const { v4: uuidv4 } = require('uuid');
7
+ const { randomUUID } = require('crypto');
8
8
  const machineID = require('../../../../utils/machine-id');
9
9
 
10
10
  const readPackageJSON = async (path) => {
@@ -36,7 +36,7 @@ const generateNewPackageJSON = (packageObj) => {
36
36
  return {
37
37
  ...packageObj,
38
38
  strapi: {
39
- uuid: uuidv4(),
39
+ uuid: randomUUID(),
40
40
  telemetryDisabled: false,
41
41
  },
42
42
  };
@@ -45,7 +45,7 @@ const generateNewPackageJSON = (packageObj) => {
45
45
  ...packageObj,
46
46
  strapi: {
47
47
  ...packageObj.strapi,
48
- uuid: packageObj.strapi.uuid ? packageObj.strapi.uuid : uuidv4(),
48
+ uuid: packageObj.strapi.uuid ? packageObj.strapi.uuid : randomUUID(),
49
49
  telemetryDisabled: false,
50
50
  },
51
51
  };
@@ -5,7 +5,7 @@ const { Command } = require('commander');
5
5
  const strapiCommands = {
6
6
  'admin/create-user': require('./actions/admin/create-user/command'),
7
7
  'admin/reset-user-password': require('./actions/admin/reset-user-password/command'),
8
- build: require('./actions/build/command'),
8
+ build: require('./actions/build-command/command'), // in 'build-command' to avoid problems with 'build' being commonly ignored
9
9
  'configuration/dump': require('./actions/configuration/dump/command'),
10
10
  'configuration/restore': require('./actions/configuration/restore/command'),
11
11
  console: require('./actions/console/command'),
@@ -5,6 +5,7 @@ const { existsSync } = require('fs-extra');
5
5
  const _ = require('lodash');
6
6
  const fse = require('fs-extra');
7
7
  const { isKebabCase, importDefault } = require('@strapi/utils');
8
+ const { isEmpty } = require('lodash/fp');
8
9
 
9
10
  const DEFAULT_CONTENT_TYPE = {
10
11
  schema: {},
@@ -115,6 +116,10 @@ const loadContentTypes = async (dir) => {
115
116
  const contentTypeName = normalizeName(fd.name);
116
117
  const contentType = await loadDir(join(dir, fd.name));
117
118
 
119
+ if (isEmpty(contentType) || isEmpty(contentType.schema)) {
120
+ throw new Error(`Could not load content type found at ${dir}`);
121
+ }
122
+
118
123
  contentTypes[normalizeName(contentTypeName)] = _.defaults(contentType, DEFAULT_CONTENT_TYPE);
119
124
  }
120
125
 
@@ -1,14 +1,14 @@
1
1
  'use strict';
2
2
 
3
3
  const { machineIdSync } = require('node-machine-id');
4
- const { v4: uuidv4 } = require('uuid');
4
+ const { randomUUID } = require('crypto');
5
5
 
6
6
  module.exports = () => {
7
7
  try {
8
8
  const deviceId = machineIdSync();
9
9
  return deviceId;
10
10
  } catch (error) {
11
- const deviceId = uuidv4();
11
+ const deviceId = randomUUID();
12
12
  return deviceId;
13
13
  }
14
14
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strapi/strapi",
3
- "version": "4.10.1-experimental.0",
3
+ "version": "4.10.2-alpha.0",
4
4
  "description": "An open source headless CMS solution to create and manage your own API. It provides a powerful dashboard and features to make your life easier. Databases supported: MySQL, MariaDB, PostgreSQL, SQLite",
5
5
  "keywords": [
6
6
  "strapi",
@@ -81,19 +81,19 @@
81
81
  "dependencies": {
82
82
  "@koa/cors": "3.4.3",
83
83
  "@koa/router": "10.1.1",
84
- "@strapi/admin": "4.10.1-experimental.0",
85
- "@strapi/data-transfer": "4.10.1-experimental.0",
86
- "@strapi/database": "4.10.1-experimental.0",
87
- "@strapi/generate-new": "4.10.1-experimental.0",
88
- "@strapi/generators": "4.10.1-experimental.0",
89
- "@strapi/logger": "4.10.1-experimental.0",
90
- "@strapi/permissions": "4.10.1-experimental.0",
91
- "@strapi/plugin-content-manager": "4.10.1-experimental.0",
92
- "@strapi/plugin-content-type-builder": "4.10.1-experimental.0",
93
- "@strapi/plugin-email": "4.10.1-experimental.0",
94
- "@strapi/plugin-upload": "4.10.1-experimental.0",
95
- "@strapi/typescript-utils": "4.10.1-experimental.0",
96
- "@strapi/utils": "4.10.1-experimental.0",
84
+ "@strapi/admin": "4.10.2-alpha.0",
85
+ "@strapi/data-transfer": "4.10.2-alpha.0",
86
+ "@strapi/database": "4.10.2-alpha.0",
87
+ "@strapi/generate-new": "4.10.2-alpha.0",
88
+ "@strapi/generators": "4.10.2-alpha.0",
89
+ "@strapi/logger": "4.10.2-alpha.0",
90
+ "@strapi/permissions": "4.10.2-alpha.0",
91
+ "@strapi/plugin-content-manager": "4.10.2-alpha.0",
92
+ "@strapi/plugin-content-type-builder": "4.10.2-alpha.0",
93
+ "@strapi/plugin-email": "4.10.2-alpha.0",
94
+ "@strapi/plugin-upload": "4.10.2-alpha.0",
95
+ "@strapi/typescript-utils": "4.10.2-alpha.0",
96
+ "@strapi/utils": "4.10.2-alpha.0",
97
97
  "bcryptjs": "2.4.3",
98
98
  "boxen": "5.1.2",
99
99
  "chalk": "4.1.2",
@@ -132,8 +132,7 @@
132
132
  "qs": "6.11.1",
133
133
  "resolve-cwd": "3.0.0",
134
134
  "semver": "7.3.8",
135
- "statuses": "2.0.1",
136
- "uuid": "^8.3.2"
135
+ "statuses": "2.0.1"
137
136
  },
138
137
  "devDependencies": {
139
138
  "supertest": "6.3.3",
@@ -143,5 +142,5 @@
143
142
  "node": ">=14.19.1 <=18.x.x",
144
143
  "npm": ">=6.0.0"
145
144
  },
146
- "gitHead": "ce60415a0779e850da2c2edd80799f98918c000c"
145
+ "gitHead": "bb1b2273381c3deae0b5bb865e50e8382926bd8c"
147
146
  }