@dyrected/core 2.5.5 → 2.5.7
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/LICENSE.md +7 -7
- package/dist/chunk-TIJHR54M.js +1879 -0
- package/dist/index.cjs +9 -5
- package/dist/index.js +1 -1
- package/dist/server.cjs +9 -5
- package/dist/server.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -904,13 +904,16 @@ var AUDIT_COLLECTION = {
|
|
|
904
904
|
admin: { hidden: true }
|
|
905
905
|
};
|
|
906
906
|
function normalizeConfig(config) {
|
|
907
|
-
const
|
|
908
|
-
const
|
|
909
|
-
|
|
907
|
+
const collections = config?.collections || [];
|
|
908
|
+
const globals = config?.globals || [];
|
|
909
|
+
const needsAudit = collections.some((col) => col.audit);
|
|
910
|
+
const normalizedCollections = collections.map((col) => {
|
|
911
|
+
const fields = col.fields || [];
|
|
912
|
+
const existingFieldNames = new Set(fields.map((f) => f.name));
|
|
910
913
|
const fieldsToInject = SYSTEM_FIELDS.filter((f) => !existingFieldNames.has(f.name));
|
|
911
914
|
return {
|
|
912
915
|
...col,
|
|
913
|
-
fields: [...
|
|
916
|
+
fields: [...fields, ...fieldsToInject]
|
|
914
917
|
};
|
|
915
918
|
});
|
|
916
919
|
const hasAuditCollection = normalizedCollections.some(
|
|
@@ -921,7 +924,8 @@ function normalizeConfig(config) {
|
|
|
921
924
|
collections: [
|
|
922
925
|
...normalizedCollections,
|
|
923
926
|
...needsAudit && !hasAuditCollection ? [AUDIT_COLLECTION] : []
|
|
924
|
-
]
|
|
927
|
+
],
|
|
928
|
+
globals
|
|
925
929
|
};
|
|
926
930
|
}
|
|
927
931
|
|
package/dist/index.js
CHANGED
package/dist/server.cjs
CHANGED
|
@@ -1847,13 +1847,16 @@ var AUDIT_COLLECTION = {
|
|
|
1847
1847
|
admin: { hidden: true }
|
|
1848
1848
|
};
|
|
1849
1849
|
function normalizeConfig(config) {
|
|
1850
|
-
const
|
|
1851
|
-
const
|
|
1852
|
-
|
|
1850
|
+
const collections = config?.collections || [];
|
|
1851
|
+
const globals = config?.globals || [];
|
|
1852
|
+
const needsAudit = collections.some((col) => col.audit);
|
|
1853
|
+
const normalizedCollections = collections.map((col) => {
|
|
1854
|
+
const fields = col.fields || [];
|
|
1855
|
+
const existingFieldNames = new Set(fields.map((f) => f.name));
|
|
1853
1856
|
const fieldsToInject = SYSTEM_FIELDS.filter((f) => !existingFieldNames.has(f.name));
|
|
1854
1857
|
return {
|
|
1855
1858
|
...col,
|
|
1856
|
-
fields: [...
|
|
1859
|
+
fields: [...fields, ...fieldsToInject]
|
|
1857
1860
|
};
|
|
1858
1861
|
});
|
|
1859
1862
|
const hasAuditCollection = normalizedCollections.some(
|
|
@@ -1864,7 +1867,8 @@ function normalizeConfig(config) {
|
|
|
1864
1867
|
collections: [
|
|
1865
1868
|
...normalizedCollections,
|
|
1866
1869
|
...needsAudit && !hasAuditCollection ? [AUDIT_COLLECTION] : []
|
|
1867
|
-
]
|
|
1870
|
+
],
|
|
1871
|
+
globals
|
|
1868
1872
|
};
|
|
1869
1873
|
}
|
|
1870
1874
|
|
package/dist/server.js
CHANGED