@webiny/api-headless-cms 5.19.0-beta.3 → 5.19.0-beta.4
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.
|
@@ -116,6 +116,20 @@ const buildReferenceFieldPaths = params => {
|
|
|
116
116
|
}, []);
|
|
117
117
|
};
|
|
118
118
|
|
|
119
|
+
const getReferenceFieldValue = ref => {
|
|
120
|
+
if (!ref) {
|
|
121
|
+
return {
|
|
122
|
+
id: null,
|
|
123
|
+
modelId: null
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
return {
|
|
128
|
+
id: (ref.id || ref.entryId || "").trim() || null,
|
|
129
|
+
modelId: (ref.modelId || "").trim() || null
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
|
|
119
133
|
const referenceFieldsMapping = async params => {
|
|
120
134
|
const {
|
|
121
135
|
context,
|
|
@@ -141,21 +155,26 @@ const referenceFieldsMapping = async params => {
|
|
|
141
155
|
for (const path of referenceFieldPaths) {
|
|
142
156
|
const ref = _dotProp.default.get(output, path);
|
|
143
157
|
|
|
144
|
-
|
|
158
|
+
const {
|
|
159
|
+
id,
|
|
160
|
+
modelId
|
|
161
|
+
} = getReferenceFieldValue(ref);
|
|
162
|
+
|
|
163
|
+
if (!id || !modelId) {
|
|
145
164
|
continue;
|
|
146
165
|
}
|
|
147
166
|
|
|
148
|
-
if (!referencesByModel[
|
|
149
|
-
referencesByModel[
|
|
167
|
+
if (!referencesByModel[modelId]) {
|
|
168
|
+
referencesByModel[modelId] = [];
|
|
150
169
|
}
|
|
151
170
|
|
|
152
|
-
referencesByModel[
|
|
171
|
+
referencesByModel[modelId].push(id);
|
|
153
172
|
|
|
154
|
-
if (!pathsByReferenceId[
|
|
155
|
-
pathsByReferenceId[
|
|
173
|
+
if (!pathsByReferenceId[id]) {
|
|
174
|
+
pathsByReferenceId[id] = [];
|
|
156
175
|
}
|
|
157
176
|
|
|
158
|
-
pathsByReferenceId[
|
|
177
|
+
pathsByReferenceId[id].push(path);
|
|
159
178
|
}
|
|
160
179
|
/**
|
|
161
180
|
* Again, no point in going further.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/api-headless-cms",
|
|
3
|
-
"version": "5.19.0-beta.
|
|
3
|
+
"version": "5.19.0-beta.4",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cms:base"
|
|
@@ -21,23 +21,23 @@
|
|
|
21
21
|
"@babel/runtime": "7.16.3",
|
|
22
22
|
"@commodo/fields": "1.1.2-beta.20",
|
|
23
23
|
"@graphql-tools/schema": "7.1.5",
|
|
24
|
-
"@webiny/api-file-manager": "5.19.0-beta.
|
|
25
|
-
"@webiny/api-i18n": "5.19.0-beta.
|
|
26
|
-
"@webiny/api-i18n-content": "5.19.0-beta.
|
|
27
|
-
"@webiny/api-i18n-ddb": "5.19.0-beta.
|
|
28
|
-
"@webiny/api-security": "5.19.0-beta.
|
|
29
|
-
"@webiny/api-tenancy": "5.19.0-beta.
|
|
30
|
-
"@webiny/api-upgrade": "5.19.0-beta.
|
|
31
|
-
"@webiny/error": "5.19.0-beta.
|
|
32
|
-
"@webiny/handler": "5.19.0-beta.
|
|
33
|
-
"@webiny/handler-aws": "5.19.0-beta.
|
|
34
|
-
"@webiny/handler-db": "5.19.0-beta.
|
|
35
|
-
"@webiny/handler-graphql": "5.19.0-beta.
|
|
36
|
-
"@webiny/handler-http": "5.19.0-beta.
|
|
37
|
-
"@webiny/plugins": "5.19.0-beta.
|
|
38
|
-
"@webiny/pubsub": "5.19.0-beta.
|
|
39
|
-
"@webiny/utils": "5.19.0-beta.
|
|
40
|
-
"@webiny/validation": "5.19.0-beta.
|
|
24
|
+
"@webiny/api-file-manager": "5.19.0-beta.4",
|
|
25
|
+
"@webiny/api-i18n": "5.19.0-beta.4",
|
|
26
|
+
"@webiny/api-i18n-content": "5.19.0-beta.4",
|
|
27
|
+
"@webiny/api-i18n-ddb": "5.19.0-beta.4",
|
|
28
|
+
"@webiny/api-security": "5.19.0-beta.4",
|
|
29
|
+
"@webiny/api-tenancy": "5.19.0-beta.4",
|
|
30
|
+
"@webiny/api-upgrade": "5.19.0-beta.4",
|
|
31
|
+
"@webiny/error": "5.19.0-beta.4",
|
|
32
|
+
"@webiny/handler": "5.19.0-beta.4",
|
|
33
|
+
"@webiny/handler-aws": "5.19.0-beta.4",
|
|
34
|
+
"@webiny/handler-db": "5.19.0-beta.4",
|
|
35
|
+
"@webiny/handler-graphql": "5.19.0-beta.4",
|
|
36
|
+
"@webiny/handler-http": "5.19.0-beta.4",
|
|
37
|
+
"@webiny/plugins": "5.19.0-beta.4",
|
|
38
|
+
"@webiny/pubsub": "5.19.0-beta.4",
|
|
39
|
+
"@webiny/utils": "5.19.0-beta.4",
|
|
40
|
+
"@webiny/validation": "5.19.0-beta.4",
|
|
41
41
|
"boolean": "3.1.4",
|
|
42
42
|
"commodo-fields-object": "1.0.6",
|
|
43
43
|
"dataloader": "2.0.0",
|
|
@@ -54,10 +54,10 @@
|
|
|
54
54
|
"@babel/core": "^7.5.5",
|
|
55
55
|
"@babel/preset-env": "^7.5.5",
|
|
56
56
|
"@babel/preset-flow": "^7.0.0",
|
|
57
|
-
"@webiny/api-security-so-ddb": "^5.19.0-beta.
|
|
58
|
-
"@webiny/api-tenancy-so-ddb": "^5.19.0-beta.
|
|
59
|
-
"@webiny/cli": "^5.19.0-beta.
|
|
60
|
-
"@webiny/project-utils": "^5.19.0-beta.
|
|
57
|
+
"@webiny/api-security-so-ddb": "^5.19.0-beta.4",
|
|
58
|
+
"@webiny/api-tenancy-so-ddb": "^5.19.0-beta.4",
|
|
59
|
+
"@webiny/cli": "^5.19.0-beta.4",
|
|
60
|
+
"@webiny/project-utils": "^5.19.0-beta.4",
|
|
61
61
|
"apollo-graphql": "^0.4.1",
|
|
62
62
|
"get-yarn-workspaces": "^1.0.2",
|
|
63
63
|
"graphql": "^14.6.0",
|
|
@@ -77,5 +77,5 @@
|
|
|
77
77
|
"build": "yarn webiny run build",
|
|
78
78
|
"watch": "yarn webiny run watch"
|
|
79
79
|
},
|
|
80
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "d115a87beb3ad3979c91a4ddf14082883be241f0"
|
|
81
81
|
}
|