@dyrected/core 2.4.1 → 2.5.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/dist/index.cjs CHANGED
@@ -1107,6 +1107,13 @@ var PopulationService = class {
1107
1107
  }
1108
1108
  const populatedDoc = { ...data };
1109
1109
  for (const field of fields) {
1110
+ if (field.type === "join") continue;
1111
+ if (field.type === "row" && field.fields) {
1112
+ const rowPopulated = await this.populate({ data, fields: field.fields, currentDepth, maxDepth });
1113
+ Object.assign(populatedDoc, rowPopulated);
1114
+ continue;
1115
+ }
1116
+ if (!field.name) continue;
1110
1117
  const value = populatedDoc[field.name];
1111
1118
  if (field.type === "relationship" && field.relationTo && value) {
1112
1119
  const relatedCollection = this.collections.find((c) => c.slug === field.relationTo);
@@ -1195,6 +1202,12 @@ var DefaultsService = class {
1195
1202
  static apply(fields, data = {}) {
1196
1203
  const result = { ...data || {} };
1197
1204
  fields.forEach((field) => {
1205
+ if (field.type === "join") return;
1206
+ if (field.type === "row" && field.fields) {
1207
+ Object.assign(result, this.apply(field.fields, data));
1208
+ return;
1209
+ }
1210
+ if (!field.name) return;
1198
1211
  let value = result[field.name];
1199
1212
  if ((value === void 0 || value === null) && field.renameTo) {
1200
1213
  const legacyValue = result[field.renameTo];
@@ -2455,6 +2468,7 @@ function fieldsToProperties(fields) {
2455
2468
  const props = {};
2456
2469
  const required = [];
2457
2470
  for (const field of fields) {
2471
+ if (!field.name || field.type === "join" || field.type === "row") continue;
2458
2472
  props[field.name] = fieldToSchema(field);
2459
2473
  if (field.required) {
2460
2474
  required.push(field.name);
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { D as DyrectedConfig, C as CollectionConfig, G as GlobalConfig } from './app-KApbf4XL.cjs';
2
- export { A as AccessFunction, a as AdminConfig, B as Block, b as DatabaseAdapter, c as DyrectedContext, F as Field, d as FieldHook, e as FieldType, f as FileData, H as HookFunction, I as ImageService, P as PaginatedResult, S as StorageAdapter, U as UploadConfig, g as createDyrectedApp } from './app-KApbf4XL.cjs';
1
+ import { D as DyrectedConfig, C as CollectionConfig, G as GlobalConfig } from './app-DZt5nslu.cjs';
2
+ export { A as AccessFunction, a as AdminConfig, B as Block, b as DatabaseAdapter, c as DyrectedContext, F as Field, d as FieldHook, e as FieldType, f as FileData, H as HookFunction, I as ImageService, P as PaginatedResult, S as StorageAdapter, U as UploadConfig, g as createDyrectedApp } from './app-DZt5nslu.cjs';
3
3
  import 'hono/types';
4
4
  import 'hono';
5
5
 
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { D as DyrectedConfig, C as CollectionConfig, G as GlobalConfig } from './app-KApbf4XL.js';
2
- export { A as AccessFunction, a as AdminConfig, B as Block, b as DatabaseAdapter, c as DyrectedContext, F as Field, d as FieldHook, e as FieldType, f as FileData, H as HookFunction, I as ImageService, P as PaginatedResult, S as StorageAdapter, U as UploadConfig, g as createDyrectedApp } from './app-KApbf4XL.js';
1
+ import { D as DyrectedConfig, C as CollectionConfig, G as GlobalConfig } from './app-DZt5nslu.js';
2
+ export { A as AccessFunction, a as AdminConfig, B as Block, b as DatabaseAdapter, c as DyrectedContext, F as Field, d as FieldHook, e as FieldType, f as FileData, H as HookFunction, I as ImageService, P as PaginatedResult, S as StorageAdapter, U as UploadConfig, g as createDyrectedApp } from './app-DZt5nslu.js';
3
3
  import 'hono/types';
4
4
  import 'hono';
5
5
 
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createDyrectedApp,
3
3
  normalizeConfig
4
- } from "./chunk-GZODLJ3C.js";
4
+ } from "./chunk-PH36WQYS.js";
5
5
 
6
6
  // src/utils/setup-prompt.ts
7
7
  function buildEnvironmentSection(frameworkLabel, isSelfHosted, config) {
package/dist/server.cjs CHANGED
@@ -66,6 +66,13 @@ var PopulationService = class {
66
66
  }
67
67
  const populatedDoc = { ...data };
68
68
  for (const field of fields) {
69
+ if (field.type === "join") continue;
70
+ if (field.type === "row" && field.fields) {
71
+ const rowPopulated = await this.populate({ data, fields: field.fields, currentDepth, maxDepth });
72
+ Object.assign(populatedDoc, rowPopulated);
73
+ continue;
74
+ }
75
+ if (!field.name) continue;
69
76
  const value = populatedDoc[field.name];
70
77
  if (field.type === "relationship" && field.relationTo && value) {
71
78
  const relatedCollection = this.collections.find((c) => c.slug === field.relationTo);
@@ -154,6 +161,12 @@ var DefaultsService = class {
154
161
  static apply(fields, data = {}) {
155
162
  const result = { ...data || {} };
156
163
  fields.forEach((field) => {
164
+ if (field.type === "join") return;
165
+ if (field.type === "row" && field.fields) {
166
+ Object.assign(result, this.apply(field.fields, data));
167
+ return;
168
+ }
169
+ if (!field.name) return;
157
170
  let value = result[field.name];
158
171
  if ((value === void 0 || value === null) && field.renameTo) {
159
172
  const legacyValue = result[field.renameTo];
@@ -1414,6 +1427,7 @@ function fieldsToProperties(fields) {
1414
1427
  const props = {};
1415
1428
  const required = [];
1416
1429
  for (const field of fields) {
1430
+ if (!field.name || field.type === "join" || field.type === "row") continue;
1417
1431
  props[field.name] = fieldToSchema(field);
1418
1432
  if (field.required) {
1419
1433
  required.push(field.name);
package/dist/server.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { c as DyrectedContext, D as DyrectedConfig, C as CollectionConfig, G as GlobalConfig } from './app-KApbf4XL.cjs';
2
- export { g as createDyrectedApp } from './app-KApbf4XL.cjs';
1
+ import { c as DyrectedContext, D as DyrectedConfig, C as CollectionConfig, G as GlobalConfig } from './app-DZt5nslu.cjs';
2
+ export { g as createDyrectedApp } from './app-DZt5nslu.cjs';
3
3
  import * as hono from 'hono';
4
4
  import { Hono, Context } from 'hono';
5
5
  import * as hono_utils_http_status from 'hono/utils/http-status';
package/dist/server.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { c as DyrectedContext, D as DyrectedConfig, C as CollectionConfig, G as GlobalConfig } from './app-KApbf4XL.js';
2
- export { g as createDyrectedApp } from './app-KApbf4XL.js';
1
+ import { c as DyrectedContext, D as DyrectedConfig, C as CollectionConfig, G as GlobalConfig } from './app-DZt5nslu.js';
2
+ export { g as createDyrectedApp } from './app-DZt5nslu.js';
3
3
  import * as hono from 'hono';
4
4
  import { Hono, Context } from 'hono';
5
5
  import * as hono_utils_http_status from 'hono/utils/http-status';
package/dist/server.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  PreviewController,
7
7
  createDyrectedApp,
8
8
  registerRoutes
9
- } from "./chunk-GZODLJ3C.js";
9
+ } from "./chunk-PH36WQYS.js";
10
10
  export {
11
11
  AuthController,
12
12
  CollectionController,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dyrected/core",
3
- "version": "2.4.1",
3
+ "version": "2.5.1",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -37,11 +37,11 @@
37
37
  "vitest": "^1.0.0"
38
38
  },
39
39
  "license": "BSL-1.1",
40
- "author": "Ajola Technologies Ltd",
40
+ "author": "Busola Okeowo <busolaokemoney@gmail.com>",
41
41
  "homepage": "https://dyrected.com",
42
42
  "repository": {
43
43
  "type": "git",
44
- "url": "git+https://github.com/she-WritesCode/dyrected.git"
44
+ "url": "git+https://github.com/Dyrected/dyrected.git"
45
45
  },
46
46
  "publishConfig": {
47
47
  "access": "public"