speedly 2.1.3 → 2.2.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.
@@ -58,6 +58,7 @@ function translateYupSchema(schema) {
58
58
  schema = resolveYupSchema(schema);
59
59
  if (!schema)
60
60
  return null;
61
+ console.log('document', 75, schema);
61
62
  const described = schema.describe();
62
63
  const properties = Object.entries(described.fields ?? {}).reduce((acc, [name, field]) => {
63
64
  acc[name] = translateField(field);
@@ -28,7 +28,7 @@ exports.default = (destination = "/image", filename, config = configs) => {
28
28
  splitPath.forEach((folder) => {
29
29
  currentPath = path_1.default.join(currentPath, folder);
30
30
  if (!fs_1.default.existsSync(currentPath)) {
31
- fs_1.default.mkdirSync(currentPath);
31
+ fs_1.default.mkdirSync(currentPath, { recursive: true });
32
32
  }
33
33
  });
34
34
  cb(null, path_1.default.join(configs.path, dest));
@@ -133,7 +133,7 @@ yup.addMethod(yup.array, "media", function (typeSchema = { ...types }) {
133
133
  path,
134
134
  message: `file ${i} does'nt exist in database`,
135
135
  });
136
- if (!fs_1.default.existsSync(path_1.default.join(__dirname, configs.uploader.path, mediaDoc.dirPath, mediaDoc.name)) && mediaDoc.type != 'script')
136
+ if (!fs_1.default.existsSync(path_1.default.join(configs.uploader.path, mediaDoc.dirPath, mediaDoc.name)) && mediaDoc.type != 'script')
137
137
  return createError({
138
138
  path,
139
139
  message: `file ${i} does'nt exist in files`,
@@ -58,6 +58,7 @@ function translateYupSchema(schema) {
58
58
  schema = resolveYupSchema(schema);
59
59
  if (!schema)
60
60
  return null;
61
+ console.log('document', 75, schema);
61
62
  const described = schema.describe();
62
63
  const properties = Object.entries(described.fields ?? {}).reduce((acc, [name, field]) => {
63
64
  acc[name] = translateField(field);
@@ -28,7 +28,7 @@ exports.default = (destination = "/image", filename, config = configs) => {
28
28
  splitPath.forEach((folder) => {
29
29
  currentPath = path_1.default.join(currentPath, folder);
30
30
  if (!fs_1.default.existsSync(currentPath)) {
31
- fs_1.default.mkdirSync(currentPath);
31
+ fs_1.default.mkdirSync(currentPath, { recursive: true });
32
32
  }
33
33
  });
34
34
  cb(null, path_1.default.join(configs.path, dest));
@@ -133,7 +133,7 @@ yup.addMethod(yup.array, "media", function (typeSchema = { ...types }) {
133
133
  path,
134
134
  message: `file ${i} does'nt exist in database`,
135
135
  });
136
- if (!fs_1.default.existsSync(path_1.default.join(__dirname, configs.uploader.path, mediaDoc.dirPath, mediaDoc.name)) && mediaDoc.type != 'script')
136
+ if (!fs_1.default.existsSync(path_1.default.join(configs.uploader.path, mediaDoc.dirPath, mediaDoc.name)) && mediaDoc.type != 'script')
137
137
  return createError({
138
138
  path,
139
139
  message: `file ${i} does'nt exist in files`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "speedly",
3
- "version": "2.1.3",
3
+ "version": "2.2.1",
4
4
  "description": "Schema-driven backend framework for rapid API and admin panel development",
5
5
  "author": "MAHSERIN",
6
6
  "license": "MIT",