strapi-plugin-comments 3.2.0 → 3.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.
- package/dist/_chunks/{index-DV3FvCxv.js → index-B19IlxIY.js} +36 -36
- package/dist/_chunks/{index-5LPolIUr.js → index-B9qwk6Sf.js} +1 -1
- package/dist/_chunks/{index-BHaPiDDi.js → index-BLBuBesY.js} +1 -1
- package/dist/_chunks/{index-rxGUTZN1.mjs → index-Bos1nB7H.mjs} +5716 -5680
- package/dist/_chunks/{index-D1CAoT0G.mjs → index-BvWdv1a2.mjs} +1 -1
- package/dist/_chunks/{index-CaQhYHpU.js → index-CD-Ke6qY.js} +1 -1
- package/dist/_chunks/{index-DCg7dWuW.mjs → index-CrjZ1-we.mjs} +2 -2
- package/dist/_chunks/{index-Bu69cWq9.mjs → index-xIUKJDL-.mjs} +1 -1
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/admin/src/hooks/useSanitizedHTML.d.ts +1 -0
- package/dist/server/index.js +16 -16
- package/dist/server/index.mjs +375 -328
- package/dist/server/src/index.d.ts +3 -0
- package/dist/server/src/services/admin/admin.service.d.ts +1 -0
- package/dist/server/src/services/client.service.d.ts +1 -0
- package/dist/server/src/services/common.service.d.ts +1 -0
- package/dist/server/src/services/index.d.ts +3 -0
- package/package.json +2 -4
- package/dist/assets/configuration.png +0 -0
- package/dist/assets/logo.png +0 -0
- package/dist/assets/marketplace.png +0 -0
- package/dist/assets/preview.png +0 -0
package/dist/server/index.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z as v } from "zod";
|
|
2
2
|
import { isProfane as Ov, replaceProfanities as Cv } from "no-profanity";
|
|
3
|
+
import Iv from "sanitize-html";
|
|
3
4
|
import "fs";
|
|
4
5
|
import "path";
|
|
5
6
|
const vm = {
|
|
@@ -16,7 +17,7 @@ const vm = {
|
|
|
16
17
|
AUTHOR_BLOCKED_PROPS: "blockedAuthorProps"
|
|
17
18
|
};
|
|
18
19
|
var Ui = /* @__PURE__ */ ((i) => (i.PENDING = "PENDING", i.APPROVED = "APPROVED", i.REJECTED = "REJECTED", i))(Ui || {}), Zt = /* @__PURE__ */ ((i) => (i.BAD_LANGUAGE = "BAD_LANGUAGE", i.DISCRIMINATION = "DISCRIMINATION", i.OTHER = "OTHER", i))(Zt || {});
|
|
19
|
-
const
|
|
20
|
+
const Rv = "plugin::comments", xv = {
|
|
20
21
|
collectionName: "plugin_comments_comments",
|
|
21
22
|
info: {
|
|
22
23
|
tableName: "plugin-comments-comments",
|
|
@@ -110,9 +111,9 @@ const Iv = "plugin::comments", Rv = {
|
|
|
110
111
|
configurable: !1
|
|
111
112
|
}
|
|
112
113
|
}
|
|
113
|
-
}, xv = {
|
|
114
|
-
schema: Rv
|
|
115
114
|
}, Nv = {
|
|
115
|
+
schema: xv
|
|
116
|
+
}, Lv = {
|
|
116
117
|
collectionName: "plugin_comments_reports",
|
|
117
118
|
info: {
|
|
118
119
|
tableName: "plugin-comments-reports",
|
|
@@ -158,25 +159,25 @@ const Iv = "plugin::comments", Rv = {
|
|
|
158
159
|
configurable: !1
|
|
159
160
|
}
|
|
160
161
|
}
|
|
161
|
-
}, Lv = {
|
|
162
|
-
schema: Nv
|
|
163
162
|
}, Dv = {
|
|
164
|
-
|
|
165
|
-
"comment-report": Lv
|
|
163
|
+
schema: Lv
|
|
166
164
|
}, Pv = {
|
|
165
|
+
comment: Nv,
|
|
166
|
+
"comment-report": Dv
|
|
167
|
+
}, Fv = {
|
|
167
168
|
name: "comments",
|
|
168
169
|
plugin: "comments",
|
|
169
170
|
type: "json"
|
|
170
|
-
},
|
|
171
|
-
if (!
|
|
171
|
+
}, Uv = ({ strapi: i }) => {
|
|
172
|
+
if (!Mv({ strapi: i })) {
|
|
172
173
|
i.log.warn(
|
|
173
174
|
"[Comments Plugin] Custom fields disabled. Upgrade Strapi to use custom fields."
|
|
174
175
|
);
|
|
175
176
|
return;
|
|
176
177
|
}
|
|
177
|
-
i.customFields.register(
|
|
178
|
-
},
|
|
179
|
-
|
|
178
|
+
i.customFields.register(Fv);
|
|
179
|
+
}, Mv = ({ strapi: i }) => !!i.customFields, ft = (i, u) => i.plugin("comments").service(u), Wv = (i) => {
|
|
180
|
+
Uv(i);
|
|
180
181
|
const u = ft(i.strapi, "common");
|
|
181
182
|
i.strapi.documents.use(async (o, h) => {
|
|
182
183
|
if (o.action === "delete" && o.uid.startsWith("api::")) {
|
|
@@ -196,7 +197,7 @@ const Iv = "plugin::comments", Rv = {
|
|
|
196
197
|
function ym(i) {
|
|
197
198
|
return typeof i == "string" ? i.split(":") : "createdAt:desc".split(":");
|
|
198
199
|
}
|
|
199
|
-
const
|
|
200
|
+
const Bv = (i) => {
|
|
200
201
|
const { gql: { auth: u = !1 } = {} } = i;
|
|
201
202
|
return {
|
|
202
203
|
"Query.findAllFlat": { auth: u },
|
|
@@ -206,7 +207,7 @@ const Wv = (i) => {
|
|
|
206
207
|
"Mutation.getRemoveComment": { auth: u },
|
|
207
208
|
"Mutation.getCreateAbuseReport": { auth: u }
|
|
208
209
|
};
|
|
209
|
-
},
|
|
210
|
+
}, jv = (i, u) => {
|
|
210
211
|
const { nonNull: o } = u;
|
|
211
212
|
return {
|
|
212
213
|
type: o("Report"),
|
|
@@ -225,7 +226,7 @@ const Wv = (i) => {
|
|
|
225
226
|
}
|
|
226
227
|
}
|
|
227
228
|
};
|
|
228
|
-
},
|
|
229
|
+
}, $v = (i, u) => {
|
|
229
230
|
const { nonNull: o } = u;
|
|
230
231
|
return {
|
|
231
232
|
type: o("CommentSingle"),
|
|
@@ -244,7 +245,7 @@ const Wv = (i) => {
|
|
|
244
245
|
}
|
|
245
246
|
}
|
|
246
247
|
};
|
|
247
|
-
},
|
|
248
|
+
}, kv = (i, u) => {
|
|
248
249
|
const { nonNull: o } = u;
|
|
249
250
|
return {
|
|
250
251
|
type: o("CommentSingle"),
|
|
@@ -263,7 +264,7 @@ const Wv = (i) => {
|
|
|
263
264
|
}
|
|
264
265
|
}
|
|
265
266
|
};
|
|
266
|
-
},
|
|
267
|
+
}, Vv = (i, u) => {
|
|
267
268
|
const { nonNull: o } = u;
|
|
268
269
|
return {
|
|
269
270
|
type: o("CommentSingle"),
|
|
@@ -282,12 +283,12 @@ const Wv = (i) => {
|
|
|
282
283
|
}
|
|
283
284
|
}
|
|
284
285
|
};
|
|
285
|
-
},
|
|
286
|
+
}, Gv = (i, u) => {
|
|
286
287
|
const o = {
|
|
287
|
-
getCreateComment:
|
|
288
|
-
getUpdateComment:
|
|
289
|
-
getRemoveComment:
|
|
290
|
-
getCreateAbuseReport:
|
|
288
|
+
getCreateComment: $v,
|
|
289
|
+
getUpdateComment: Vv,
|
|
290
|
+
getRemoveComment: kv,
|
|
291
|
+
getCreateAbuseReport: jv
|
|
291
292
|
};
|
|
292
293
|
return u.extendType({
|
|
293
294
|
type: "Mutation",
|
|
@@ -4074,7 +4075,7 @@ const ua = (i) => {
|
|
|
4074
4075
|
fields: o,
|
|
4075
4076
|
omit: h
|
|
4076
4077
|
};
|
|
4077
|
-
},
|
|
4078
|
+
}, zv = (i, u) => {
|
|
4078
4079
|
const { nonNull: o, stringArg: h } = u, { service: m } = i.plugin("graphql"), { args: A } = m("internals"), S = i.contentType(lr(i, "comment"));
|
|
4079
4080
|
return {
|
|
4080
4081
|
type: "ResponseFindAll",
|
|
@@ -4097,7 +4098,7 @@ const ua = (i) => {
|
|
|
4097
4098
|
);
|
|
4098
4099
|
}
|
|
4099
4100
|
};
|
|
4100
|
-
},
|
|
4101
|
+
}, qv = (i, u) => {
|
|
4101
4102
|
const { nonNull: o, list: h, stringArg: m } = u, { service: A } = i.plugin("graphql"), { args: S } = A("internals"), { naming: { getFiltersInputTypeName: C } } = A("utils"), R = i.contentType(lr(i, "comment"));
|
|
4102
4103
|
return {
|
|
4103
4104
|
type: o(h("CommentNested")),
|
|
@@ -4128,9 +4129,9 @@ const ua = (i) => {
|
|
|
4128
4129
|
}, ul = {
|
|
4129
4130
|
GENERIC: "GENERIC",
|
|
4130
4131
|
STRAPI: "STRAPI"
|
|
4131
|
-
},
|
|
4132
|
+
}, Hv = {
|
|
4132
4133
|
relatedUid: /^(?<uid>[a-z0-9-]+\:{2}[a-z0-9-]+\.[a-z0-9-]+)\:{1}(?<id>[a-z0-9-]+)$/i
|
|
4133
|
-
},
|
|
4134
|
+
}, Yv = (i, u) => {
|
|
4134
4135
|
const { nonNull: o, intArg: h, arg: m } = u, { service: A } = i.plugin("graphql"), { args: S } = A("internals"), { naming: { getFiltersInputTypeName: C } } = A("utils"), R = i.contentType(lr(i, "comment"));
|
|
4135
4136
|
return {
|
|
4136
4137
|
type: "ResponseFindAllPerAuthor",
|
|
@@ -4155,11 +4156,11 @@ const ua = (i) => {
|
|
|
4155
4156
|
);
|
|
4156
4157
|
}
|
|
4157
4158
|
};
|
|
4158
|
-
},
|
|
4159
|
+
}, Qv = (i, u) => {
|
|
4159
4160
|
const o = {
|
|
4160
|
-
findAllFlat:
|
|
4161
|
-
findAllInHierarchy:
|
|
4162
|
-
findAllPerAuthor:
|
|
4161
|
+
findAllFlat: zv,
|
|
4162
|
+
findAllInHierarchy: qv,
|
|
4163
|
+
findAllPerAuthor: Yv
|
|
4163
4164
|
};
|
|
4164
4165
|
return u.extendType({
|
|
4165
4166
|
type: "Query",
|
|
@@ -4170,36 +4171,36 @@ const ua = (i) => {
|
|
|
4170
4171
|
}
|
|
4171
4172
|
}
|
|
4172
4173
|
});
|
|
4173
|
-
},
|
|
4174
|
+
}, Jv = (i) => i.objectType({
|
|
4174
4175
|
name: "CommentSingle",
|
|
4175
4176
|
definition(u) {
|
|
4176
4177
|
u.id("id"), u.string("documentId"), u.nonNull.string("content"), u.boolean("blocked"), u.boolean("blockedThread"), u.boolean("removed"), u.string("approvalStatus"), u.field("threadOf", { type: "CommentSingle" }), u.field("author", { type: "CommentAuthor" }), u.string("createdAt"), u.string("updatedAt");
|
|
4177
4178
|
}
|
|
4178
|
-
}),
|
|
4179
|
+
}), Xv = (i) => i.objectType({
|
|
4179
4180
|
name: "CommentAuthor",
|
|
4180
4181
|
definition(u) {
|
|
4181
4182
|
u.id("id"), u.nonNull.string("name"), u.nonNull.string("email"), u.string("avatar");
|
|
4182
4183
|
}
|
|
4183
|
-
}),
|
|
4184
|
+
}), Zv = (i) => i.enumType({
|
|
4184
4185
|
name: "CommentAuthorType",
|
|
4185
4186
|
description: "User type which was the author of comment - Strapi built-in or generic",
|
|
4186
4187
|
members: Object.values(ul)
|
|
4187
|
-
}),
|
|
4188
|
+
}), Kv = (i) => i.objectType({
|
|
4188
4189
|
name: "CommentNested",
|
|
4189
4190
|
definition(u) {
|
|
4190
4191
|
u.id("id"), u.string("documentId"), u.nonNull.string("content"), u.boolean("blocked"), u.boolean("blockedThread"), u.string("approvalStatus"), u.boolean("removed"), u.field("threadOf", { type: "CommentSingle" }), u.list.field("children", { type: "CommentNested" }), u.field("author", { type: "CommentAuthor" }), u.string("createdAt"), u.string("updatedAt");
|
|
4191
4192
|
}
|
|
4192
|
-
}),
|
|
4193
|
+
}), e0 = (i) => i.inputObjectType({
|
|
4193
4194
|
name: "CreateComment",
|
|
4194
4195
|
definition(u) {
|
|
4195
4196
|
u.nonNull.string("content"), u.nonNull.string("relation"), u.id("threadOf"), u.field("author", { type: "CreateCommentAuthor" });
|
|
4196
4197
|
}
|
|
4197
|
-
}),
|
|
4198
|
+
}), t0 = (i) => i.inputObjectType({
|
|
4198
4199
|
name: "CreateCommentAuthor",
|
|
4199
4200
|
definition(u) {
|
|
4200
4201
|
u.nonNull.id("id"), u.nonNull.string("name"), u.string("email"), u.string("avatar");
|
|
4201
4202
|
}
|
|
4202
|
-
}),
|
|
4203
|
+
}), n0 = (i) => i.inputObjectType({
|
|
4203
4204
|
name: "CreateReport",
|
|
4204
4205
|
definition(u) {
|
|
4205
4206
|
u.id("commentId"), u.nonNull.string("relation"), u.nonNull.string("content"), u.field("reason", { type: "ReportReason" });
|
|
@@ -4212,17 +4213,17 @@ function He(i, u) {
|
|
|
4212
4213
|
function Ym(i) {
|
|
4213
4214
|
return typeof i == "object" && i !== null;
|
|
4214
4215
|
}
|
|
4215
|
-
function
|
|
4216
|
+
function r0(i, u) {
|
|
4216
4217
|
if (!!!i)
|
|
4217
4218
|
throw new Error(
|
|
4218
4219
|
"Unexpected invariant triggered."
|
|
4219
4220
|
);
|
|
4220
4221
|
}
|
|
4221
|
-
const
|
|
4222
|
+
const i0 = /\r\n|[\n\r]/g;
|
|
4222
4223
|
function _m(i, u) {
|
|
4223
4224
|
let o = 0, h = 1;
|
|
4224
|
-
for (const m of i.body.matchAll(
|
|
4225
|
-
if (typeof m.index == "number" ||
|
|
4225
|
+
for (const m of i.body.matchAll(i0)) {
|
|
4226
|
+
if (typeof m.index == "number" || r0(!1), m.index >= u)
|
|
4226
4227
|
break;
|
|
4227
4228
|
o = m.index + m[0].length, h += 1;
|
|
4228
4229
|
}
|
|
@@ -4231,7 +4232,7 @@ function _m(i, u) {
|
|
|
4231
4232
|
column: u + 1 - o
|
|
4232
4233
|
};
|
|
4233
4234
|
}
|
|
4234
|
-
function
|
|
4235
|
+
function o0(i) {
|
|
4235
4236
|
return Qm(
|
|
4236
4237
|
i.source,
|
|
4237
4238
|
_m(i.source, i.start)
|
|
@@ -4264,7 +4265,7 @@ function Lm(i) {
|
|
|
4264
4265
|
return u.map(([h, m]) => h.padStart(o) + (m ? " " + m : "")).join(`
|
|
4265
4266
|
`);
|
|
4266
4267
|
}
|
|
4267
|
-
function
|
|
4268
|
+
function u0(i) {
|
|
4268
4269
|
const u = i[0];
|
|
4269
4270
|
return u == null || "kind" in u || "length" in u ? {
|
|
4270
4271
|
nodes: u,
|
|
@@ -4316,7 +4317,7 @@ class jn extends Error {
|
|
|
4316
4317
|
*/
|
|
4317
4318
|
constructor(u, ...o) {
|
|
4318
4319
|
var h, m, A;
|
|
4319
|
-
const { nodes: S, source: C, positions: R, path: N, originalError: O, extensions: U } =
|
|
4320
|
+
const { nodes: S, source: C, positions: R, path: N, originalError: O, extensions: U } = u0(o);
|
|
4320
4321
|
super(u), this.name = "GraphQLError", this.path = N ?? void 0, this.originalError = O ?? void 0, this.nodes = Dm(
|
|
4321
4322
|
Array.isArray(S) ? S : S ? [S] : void 0
|
|
4322
4323
|
);
|
|
@@ -4366,7 +4367,7 @@ class jn extends Error {
|
|
|
4366
4367
|
for (const o of this.nodes)
|
|
4367
4368
|
o.loc && (u += `
|
|
4368
4369
|
|
|
4369
|
-
` +
|
|
4370
|
+
` + o0(o.loc));
|
|
4370
4371
|
else if (this.source && this.locations)
|
|
4371
4372
|
for (const o of this.locations)
|
|
4372
4373
|
u += `
|
|
@@ -4471,10 +4472,10 @@ const Jm = {
|
|
|
4471
4472
|
ArgumentCoordinate: ["name", "fieldName", "argumentName"],
|
|
4472
4473
|
DirectiveCoordinate: ["name"],
|
|
4473
4474
|
DirectiveArgumentCoordinate: ["name", "argumentName"]
|
|
4474
|
-
},
|
|
4475
|
+
}, a0 = new Set(Object.keys(Jm));
|
|
4475
4476
|
function Pm(i) {
|
|
4476
4477
|
const u = i?.kind;
|
|
4477
|
-
return typeof u == "string" &&
|
|
4478
|
+
return typeof u == "string" && a0.has(u);
|
|
4478
4479
|
}
|
|
4479
4480
|
var Fm;
|
|
4480
4481
|
(function(i) {
|
|
@@ -4487,20 +4488,20 @@ var Xt;
|
|
|
4487
4488
|
function Um(i) {
|
|
4488
4489
|
return i === 9 || i === 32;
|
|
4489
4490
|
}
|
|
4490
|
-
function
|
|
4491
|
+
function s0(i) {
|
|
4491
4492
|
return i >= 48 && i <= 57;
|
|
4492
4493
|
}
|
|
4493
4494
|
function Xm(i) {
|
|
4494
4495
|
return i >= 97 && i <= 122 || // A-Z
|
|
4495
4496
|
i >= 65 && i <= 90;
|
|
4496
4497
|
}
|
|
4497
|
-
function
|
|
4498
|
+
function l0(i) {
|
|
4498
4499
|
return Xm(i) || i === 95;
|
|
4499
4500
|
}
|
|
4500
|
-
function
|
|
4501
|
-
return Xm(i) ||
|
|
4501
|
+
function c0(i) {
|
|
4502
|
+
return Xm(i) || s0(i) || i === 95;
|
|
4502
4503
|
}
|
|
4503
|
-
function
|
|
4504
|
+
function f0(i, u) {
|
|
4504
4505
|
const o = i.replace(/"""/g, '\\"""'), h = o.split(/\r\n|[\n\r]/g), m = h.length === 1, A = h.length > 1 && h.slice(1).every((Q) => Q.length === 0 || Um(Q.charCodeAt(0))), S = o.endsWith('\\"""'), C = i.endsWith('"') && !S, R = i.endsWith("\\"), N = C || R, O = (
|
|
4505
4506
|
// add leading and trailing new lines only if it improves readability
|
|
4506
4507
|
!m || i.length > 70 || N || A || S
|
|
@@ -4511,7 +4512,7 @@ function c0(i, u) {
|
|
|
4511
4512
|
`), U += o, (O || N) && (U += `
|
|
4512
4513
|
`), '"""' + U + '"""';
|
|
4513
4514
|
}
|
|
4514
|
-
const
|
|
4515
|
+
const h0 = 10, Zm = 2;
|
|
4515
4516
|
function $n(i) {
|
|
4516
4517
|
return Pf(i, []);
|
|
4517
4518
|
}
|
|
@@ -4522,45 +4523,45 @@ function Pf(i, u) {
|
|
|
4522
4523
|
case "function":
|
|
4523
4524
|
return i.name ? `[function ${i.name}]` : "[function]";
|
|
4524
4525
|
case "object":
|
|
4525
|
-
return
|
|
4526
|
+
return p0(i, u);
|
|
4526
4527
|
default:
|
|
4527
4528
|
return String(i);
|
|
4528
4529
|
}
|
|
4529
4530
|
}
|
|
4530
|
-
function
|
|
4531
|
+
function p0(i, u) {
|
|
4531
4532
|
if (i === null)
|
|
4532
4533
|
return "null";
|
|
4533
4534
|
if (u.includes(i))
|
|
4534
4535
|
return "[Circular]";
|
|
4535
4536
|
const o = [...u, i];
|
|
4536
|
-
if (
|
|
4537
|
+
if (d0(i)) {
|
|
4537
4538
|
const h = i.toJSON();
|
|
4538
4539
|
if (h !== i)
|
|
4539
4540
|
return typeof h == "string" ? h : Pf(h, o);
|
|
4540
4541
|
} else if (Array.isArray(i))
|
|
4541
|
-
return
|
|
4542
|
-
return
|
|
4542
|
+
return m0(i, o);
|
|
4543
|
+
return g0(i, o);
|
|
4543
4544
|
}
|
|
4544
|
-
function
|
|
4545
|
+
function d0(i) {
|
|
4545
4546
|
return typeof i.toJSON == "function";
|
|
4546
4547
|
}
|
|
4547
|
-
function
|
|
4548
|
+
function g0(i, u) {
|
|
4548
4549
|
const o = Object.entries(i);
|
|
4549
|
-
return o.length === 0 ? "{}" : u.length > Zm ? "[" +
|
|
4550
|
+
return o.length === 0 ? "{}" : u.length > Zm ? "[" + v0(i) + "]" : "{ " + o.map(
|
|
4550
4551
|
([m, A]) => m + ": " + Pf(A, u)
|
|
4551
4552
|
).join(", ") + " }";
|
|
4552
4553
|
}
|
|
4553
|
-
function
|
|
4554
|
+
function m0(i, u) {
|
|
4554
4555
|
if (i.length === 0)
|
|
4555
4556
|
return "[]";
|
|
4556
4557
|
if (u.length > Zm)
|
|
4557
4558
|
return "[Array]";
|
|
4558
|
-
const o = Math.min(
|
|
4559
|
+
const o = Math.min(h0, i.length), h = i.length - o, m = [];
|
|
4559
4560
|
for (let A = 0; A < o; ++A)
|
|
4560
4561
|
m.push(Pf(i[A], u));
|
|
4561
4562
|
return h === 1 ? m.push("... 1 more item") : h > 1 && m.push(`... ${h} more items`), "[" + m.join(", ") + "]";
|
|
4562
4563
|
}
|
|
4563
|
-
function
|
|
4564
|
+
function v0(i) {
|
|
4564
4565
|
const u = Object.prototype.toString.call(i).replace(/^\[object /, "").replace(/]$/, "");
|
|
4565
4566
|
if (u === "Object" && typeof i.constructor == "function") {
|
|
4566
4567
|
const o = i.constructor.name;
|
|
@@ -4569,11 +4570,11 @@ function m0(i) {
|
|
|
4569
4570
|
}
|
|
4570
4571
|
return u;
|
|
4571
4572
|
}
|
|
4572
|
-
const
|
|
4573
|
+
const y0 = globalThis.process && // eslint-disable-next-line no-undef
|
|
4573
4574
|
process.env.NODE_ENV === "production", Mi = (
|
|
4574
4575
|
/* c8 ignore next 6 */
|
|
4575
4576
|
// FIXME: https://github.com/graphql/graphql-js/issues/2317
|
|
4576
|
-
|
|
4577
|
+
y0 ? function(u, o) {
|
|
4577
4578
|
return u instanceof o;
|
|
4578
4579
|
} : function(u, o) {
|
|
4579
4580
|
if (u instanceof o)
|
|
@@ -4602,8 +4603,8 @@ spurious results.`);
|
|
|
4602
4603
|
}
|
|
4603
4604
|
return !1;
|
|
4604
4605
|
}
|
|
4605
|
-
),
|
|
4606
|
-
function
|
|
4606
|
+
), _0 = 5;
|
|
4607
|
+
function b0(i, u) {
|
|
4607
4608
|
const [o, h] = u ? [i, u] : [void 0, i];
|
|
4608
4609
|
let m = " Did you mean ";
|
|
4609
4610
|
o && (m += o + " ");
|
|
@@ -4616,13 +4617,13 @@ function _0(i, u) {
|
|
|
4616
4617
|
case 2:
|
|
4617
4618
|
return m + A[0] + " or " + A[1] + "?";
|
|
4618
4619
|
}
|
|
4619
|
-
const S = A.slice(0,
|
|
4620
|
+
const S = A.slice(0, _0), C = S.pop();
|
|
4620
4621
|
return m + S.join(", ") + ", or " + C + "?";
|
|
4621
4622
|
}
|
|
4622
4623
|
function Mm(i) {
|
|
4623
4624
|
return i;
|
|
4624
4625
|
}
|
|
4625
|
-
function
|
|
4626
|
+
function w0(i, u) {
|
|
4626
4627
|
const o = /* @__PURE__ */ Object.create(null);
|
|
4627
4628
|
for (const h of i)
|
|
4628
4629
|
o[u(h)] = h;
|
|
@@ -4640,7 +4641,7 @@ function Ff(i, u) {
|
|
|
4640
4641
|
o[h] = u(i[h], h);
|
|
4641
4642
|
return o;
|
|
4642
4643
|
}
|
|
4643
|
-
function
|
|
4644
|
+
function A0(i, u) {
|
|
4644
4645
|
let o = 0, h = 0;
|
|
4645
4646
|
for (; o < i.length && h < u.length; ) {
|
|
4646
4647
|
let m = i.charCodeAt(o), A = u.charCodeAt(h);
|
|
@@ -4667,22 +4668,22 @@ function w0(i, u) {
|
|
|
4667
4668
|
}
|
|
4668
4669
|
return i.length - u.length;
|
|
4669
4670
|
}
|
|
4670
|
-
const bm = 48,
|
|
4671
|
+
const bm = 48, E0 = 57;
|
|
4671
4672
|
function Sf(i) {
|
|
4672
|
-
return !isNaN(i) && bm <= i && i <=
|
|
4673
|
+
return !isNaN(i) && bm <= i && i <= E0;
|
|
4673
4674
|
}
|
|
4674
|
-
function
|
|
4675
|
-
const o = /* @__PURE__ */ Object.create(null), h = new
|
|
4675
|
+
function S0(i, u) {
|
|
4676
|
+
const o = /* @__PURE__ */ Object.create(null), h = new T0(i), m = Math.floor(i.length * 0.4) + 1;
|
|
4676
4677
|
for (const A of u) {
|
|
4677
4678
|
const S = h.measure(A, m);
|
|
4678
4679
|
S !== void 0 && (o[A] = S);
|
|
4679
4680
|
}
|
|
4680
4681
|
return Object.keys(o).sort((A, S) => {
|
|
4681
4682
|
const C = o[A] - o[S];
|
|
4682
|
-
return C !== 0 ? C :
|
|
4683
|
+
return C !== 0 ? C : A0(A, S);
|
|
4683
4684
|
});
|
|
4684
4685
|
}
|
|
4685
|
-
class
|
|
4686
|
+
class T0 {
|
|
4686
4687
|
constructor(u) {
|
|
4687
4688
|
this._input = u, this._inputLowerCase = u.toLowerCase(), this._inputArray = Wm(this._inputLowerCase), this._rows = [
|
|
4688
4689
|
new Array(u.length + 1).fill(0),
|
|
@@ -4749,14 +4750,14 @@ function xr(i) {
|
|
|
4749
4750
|
u[o] = h;
|
|
4750
4751
|
return u;
|
|
4751
4752
|
}
|
|
4752
|
-
function
|
|
4753
|
-
return `"${i.replace(
|
|
4753
|
+
function O0(i) {
|
|
4754
|
+
return `"${i.replace(C0, I0)}"`;
|
|
4754
4755
|
}
|
|
4755
|
-
const
|
|
4756
|
-
function
|
|
4757
|
-
return
|
|
4756
|
+
const C0 = /[\x00-\x1f\x22\x5c\x7f-\x9f]/g;
|
|
4757
|
+
function I0(i) {
|
|
4758
|
+
return R0[i.charCodeAt(0)];
|
|
4758
4759
|
}
|
|
4759
|
-
const
|
|
4760
|
+
const R0 = [
|
|
4760
4761
|
"\\u0000",
|
|
4761
4762
|
"\\u0001",
|
|
4762
4763
|
"\\u0002",
|
|
@@ -4922,11 +4923,11 @@ const I0 = [
|
|
|
4922
4923
|
"\\u009D",
|
|
4923
4924
|
"\\u009E",
|
|
4924
4925
|
"\\u009F"
|
|
4925
|
-
],
|
|
4926
|
-
function
|
|
4926
|
+
], x0 = Object.freeze({});
|
|
4927
|
+
function N0(i, u, o = Jm) {
|
|
4927
4928
|
const h = /* @__PURE__ */ new Map();
|
|
4928
4929
|
for (const X of Object.values(Xt))
|
|
4929
|
-
h.set(X,
|
|
4930
|
+
h.set(X, L0(u, X));
|
|
4930
4931
|
let m, A = Array.isArray(i), S = [i], C = -1, R = [], N = i, O, U;
|
|
4931
4932
|
const M = [], Q = [];
|
|
4932
4933
|
do {
|
|
@@ -4957,7 +4958,7 @@ function x0(i, u, o = Jm) {
|
|
|
4957
4958
|
var $, J;
|
|
4958
4959
|
Pm(N) || He(!1, `Invalid AST Node: ${$n(N)}.`);
|
|
4959
4960
|
const De = X ? ($ = h.get(N.kind)) === null || $ === void 0 ? void 0 : $.leave : (J = h.get(N.kind)) === null || J === void 0 ? void 0 : J.enter;
|
|
4960
|
-
if (_e = De?.call(u, N, O, U, M, Q), _e ===
|
|
4961
|
+
if (_e = De?.call(u, N, O, U, M, Q), _e === x0)
|
|
4961
4962
|
break;
|
|
4962
4963
|
if (_e === !1) {
|
|
4963
4964
|
if (!X) {
|
|
@@ -4987,7 +4988,7 @@ function x0(i, u, o = Jm) {
|
|
|
4987
4988
|
} while (m !== void 0);
|
|
4988
4989
|
return R.length !== 0 ? R[R.length - 1][1] : i;
|
|
4989
4990
|
}
|
|
4990
|
-
function
|
|
4991
|
+
function L0(i, u) {
|
|
4991
4992
|
const o = i[u];
|
|
4992
4993
|
return typeof o == "object" ? o : typeof o == "function" ? {
|
|
4993
4994
|
enter: o,
|
|
@@ -4998,9 +4999,9 @@ function N0(i, u) {
|
|
|
4998
4999
|
};
|
|
4999
5000
|
}
|
|
5000
5001
|
function Bm(i) {
|
|
5001
|
-
return
|
|
5002
|
+
return N0(i, P0);
|
|
5002
5003
|
}
|
|
5003
|
-
const
|
|
5004
|
+
const D0 = 80, P0 = {
|
|
5004
5005
|
Name: {
|
|
5005
5006
|
leave: (i) => i.value
|
|
5006
5007
|
},
|
|
@@ -5041,7 +5042,7 @@ const L0 = 80, D0 = {
|
|
|
5041
5042
|
leave({ alias: i, name: u, arguments: o, directives: h, selectionSet: m }) {
|
|
5042
5043
|
const A = ue("", i, ": ") + u;
|
|
5043
5044
|
let S = A + ue("(", V(o, ", "), ")");
|
|
5044
|
-
return S.length >
|
|
5045
|
+
return S.length > D0 && (S = A + ue(`(
|
|
5045
5046
|
`, If(V(o, `
|
|
5046
5047
|
`)), `
|
|
5047
5048
|
)`)), V([S, V(h, " "), m], " ");
|
|
@@ -5086,7 +5087,7 @@ const L0 = 80, D0 = {
|
|
|
5086
5087
|
leave: ({ value: i }) => i
|
|
5087
5088
|
},
|
|
5088
5089
|
StringValue: {
|
|
5089
|
-
leave: ({ value: i, block: u }) => u ?
|
|
5090
|
+
leave: ({ value: i, block: u }) => u ? f0(i) : O0(i)
|
|
5090
5091
|
},
|
|
5091
5092
|
BooleanValue: {
|
|
5092
5093
|
leave: ({ value: i }) => i ? "true" : "false"
|
|
@@ -5317,49 +5318,49 @@ function cr(i) {
|
|
|
5317
5318
|
if (i != null || He(!1, "Must provide name."), typeof i == "string" || He(!1, "Expected name to be a string."), i.length === 0)
|
|
5318
5319
|
throw new jn("Expected name to be a non-empty string.");
|
|
5319
5320
|
for (let u = 1; u < i.length; ++u)
|
|
5320
|
-
if (!
|
|
5321
|
+
if (!c0(i.charCodeAt(u)))
|
|
5321
5322
|
throw new jn(
|
|
5322
5323
|
`Names must only contain [_a-zA-Z0-9] but "${i}" does not.`
|
|
5323
5324
|
);
|
|
5324
|
-
if (!
|
|
5325
|
+
if (!l0(i.charCodeAt(0)))
|
|
5325
5326
|
throw new jn(
|
|
5326
5327
|
`Names must start with [_a-zA-Z] but "${i}" does not.`
|
|
5327
5328
|
);
|
|
5328
5329
|
return i;
|
|
5329
5330
|
}
|
|
5330
|
-
function
|
|
5331
|
+
function F0(i) {
|
|
5331
5332
|
if (i === "true" || i === "false" || i === "null")
|
|
5332
5333
|
throw new jn(`Enum values cannot be named: ${i}`);
|
|
5333
5334
|
return cr(i);
|
|
5334
5335
|
}
|
|
5335
5336
|
function ll(i) {
|
|
5336
|
-
return
|
|
5337
|
-
}
|
|
5338
|
-
function F0(i) {
|
|
5339
|
-
return Mi(i, tv);
|
|
5337
|
+
return U0(i) || M0(i) || W0(i) || B0(i) || j0(i) || $0(i) || k0(i) || Rm(i);
|
|
5340
5338
|
}
|
|
5341
5339
|
function U0(i) {
|
|
5342
|
-
return Mi(i,
|
|
5340
|
+
return Mi(i, tv);
|
|
5343
5341
|
}
|
|
5344
5342
|
function M0(i) {
|
|
5345
|
-
return Mi(i,
|
|
5343
|
+
return Mi(i, q0);
|
|
5346
5344
|
}
|
|
5347
5345
|
function W0(i) {
|
|
5348
5346
|
return Mi(i, Q0);
|
|
5349
5347
|
}
|
|
5350
5348
|
function B0(i) {
|
|
5351
|
-
return Mi(i,
|
|
5349
|
+
return Mi(i, J0);
|
|
5352
5350
|
}
|
|
5353
5351
|
function j0(i) {
|
|
5354
5352
|
return Mi(i, Z0);
|
|
5355
5353
|
}
|
|
5356
5354
|
function $0(i) {
|
|
5357
|
-
return Mi(i,
|
|
5355
|
+
return Mi(i, K0);
|
|
5358
5356
|
}
|
|
5359
|
-
function
|
|
5357
|
+
function k0(i) {
|
|
5360
5358
|
return Mi(i, V0);
|
|
5361
5359
|
}
|
|
5362
|
-
|
|
5360
|
+
function Rm(i) {
|
|
5361
|
+
return Mi(i, G0);
|
|
5362
|
+
}
|
|
5363
|
+
class V0 {
|
|
5363
5364
|
constructor(u) {
|
|
5364
5365
|
ll(u) || He(!1, `Expected ${$n(u)} to be a GraphQL type.`), this.ofType = u;
|
|
5365
5366
|
}
|
|
@@ -5373,9 +5374,9 @@ class k0 {
|
|
|
5373
5374
|
return this.toString();
|
|
5374
5375
|
}
|
|
5375
5376
|
}
|
|
5376
|
-
class
|
|
5377
|
+
class G0 {
|
|
5377
5378
|
constructor(u) {
|
|
5378
|
-
|
|
5379
|
+
z0(u) || He(
|
|
5379
5380
|
!1,
|
|
5380
5381
|
`Expected ${$n(u)} to be a GraphQL nullable type.`
|
|
5381
5382
|
), this.ofType = u;
|
|
@@ -5390,7 +5391,7 @@ class V0 {
|
|
|
5390
5391
|
return this.toString();
|
|
5391
5392
|
}
|
|
5392
5393
|
}
|
|
5393
|
-
function
|
|
5394
|
+
function z0(i) {
|
|
5394
5395
|
return ll(i) && !Rm(i);
|
|
5395
5396
|
}
|
|
5396
5397
|
function Km(i) {
|
|
@@ -5437,7 +5438,7 @@ class tv {
|
|
|
5437
5438
|
return this.toString();
|
|
5438
5439
|
}
|
|
5439
5440
|
}
|
|
5440
|
-
class
|
|
5441
|
+
class q0 {
|
|
5441
5442
|
constructor(u) {
|
|
5442
5443
|
var o;
|
|
5443
5444
|
this.name = cr(u.name), this.description = u.description, this.isTypeOf = u.isTypeOf, this.extensions = xr(u.extensions), this.astNode = u.astNode, this.extensionASTNodes = (o = u.extensionASTNodes) !== null && o !== void 0 ? o : [], this._fields = () => rv(u), this._interfaces = () => nv(u), u.isTypeOf == null || typeof u.isTypeOf == "function" || He(
|
|
@@ -5505,7 +5506,7 @@ function rv(i) {
|
|
|
5505
5506
|
name: cr(h),
|
|
5506
5507
|
description: o.description,
|
|
5507
5508
|
type: o.type,
|
|
5508
|
-
args:
|
|
5509
|
+
args: H0(A),
|
|
5509
5510
|
resolve: o.resolve,
|
|
5510
5511
|
subscribe: o.subscribe,
|
|
5511
5512
|
deprecationReason: o.deprecationReason,
|
|
@@ -5514,7 +5515,7 @@ function rv(i) {
|
|
|
5514
5515
|
};
|
|
5515
5516
|
});
|
|
5516
5517
|
}
|
|
5517
|
-
function
|
|
5518
|
+
function H0(i) {
|
|
5518
5519
|
return Object.entries(i).map(([u, o]) => ({
|
|
5519
5520
|
name: cr(u),
|
|
5520
5521
|
description: o.description,
|
|
@@ -5532,7 +5533,7 @@ function iv(i) {
|
|
|
5532
5533
|
return Ff(i, (u) => ({
|
|
5533
5534
|
description: u.description,
|
|
5534
5535
|
type: u.type,
|
|
5535
|
-
args:
|
|
5536
|
+
args: Y0(u.args),
|
|
5536
5537
|
resolve: u.resolve,
|
|
5537
5538
|
subscribe: u.subscribe,
|
|
5538
5539
|
deprecationReason: u.deprecationReason,
|
|
@@ -5540,7 +5541,7 @@ function iv(i) {
|
|
|
5540
5541
|
astNode: u.astNode
|
|
5541
5542
|
}));
|
|
5542
5543
|
}
|
|
5543
|
-
function
|
|
5544
|
+
function Y0(i) {
|
|
5544
5545
|
return Im(
|
|
5545
5546
|
i,
|
|
5546
5547
|
(u) => u.name,
|
|
@@ -5554,7 +5555,7 @@ function H0(i) {
|
|
|
5554
5555
|
})
|
|
5555
5556
|
);
|
|
5556
5557
|
}
|
|
5557
|
-
class
|
|
5558
|
+
class Q0 {
|
|
5558
5559
|
constructor(u) {
|
|
5559
5560
|
var o;
|
|
5560
5561
|
this.name = cr(u.name), this.description = u.description, this.resolveType = u.resolveType, this.extensions = xr(u.extensions), this.astNode = u.astNode, this.extensionASTNodes = (o = u.extensionASTNodes) !== null && o !== void 0 ? o : [], this._fields = rv.bind(void 0, u), this._interfaces = nv.bind(void 0, u), u.resolveType == null || typeof u.resolveType == "function" || He(
|
|
@@ -5590,10 +5591,10 @@ class Y0 {
|
|
|
5590
5591
|
return this.toString();
|
|
5591
5592
|
}
|
|
5592
5593
|
}
|
|
5593
|
-
class
|
|
5594
|
+
class J0 {
|
|
5594
5595
|
constructor(u) {
|
|
5595
5596
|
var o;
|
|
5596
|
-
this.name = cr(u.name), this.description = u.description, this.resolveType = u.resolveType, this.extensions = xr(u.extensions), this.astNode = u.astNode, this.extensionASTNodes = (o = u.extensionASTNodes) !== null && o !== void 0 ? o : [], this._types =
|
|
5597
|
+
this.name = cr(u.name), this.description = u.description, this.resolveType = u.resolveType, this.extensions = xr(u.extensions), this.astNode = u.astNode, this.extensionASTNodes = (o = u.extensionASTNodes) !== null && o !== void 0 ? o : [], this._types = X0.bind(void 0, u), u.resolveType == null || typeof u.resolveType == "function" || He(
|
|
5597
5598
|
!1,
|
|
5598
5599
|
`${this.name} must provide "resolveType" as a function, but got: ${$n(u.resolveType)}.`
|
|
5599
5600
|
);
|
|
@@ -5622,14 +5623,14 @@ class Q0 {
|
|
|
5622
5623
|
return this.toString();
|
|
5623
5624
|
}
|
|
5624
5625
|
}
|
|
5625
|
-
function
|
|
5626
|
+
function X0(i) {
|
|
5626
5627
|
const u = Km(i.types);
|
|
5627
5628
|
return Array.isArray(u) || He(
|
|
5628
5629
|
!1,
|
|
5629
5630
|
`Must provide Array of types or a function which returns such an array for Union ${i.name}.`
|
|
5630
5631
|
), u;
|
|
5631
5632
|
}
|
|
5632
|
-
class
|
|
5633
|
+
class Z0 {
|
|
5633
5634
|
/* <T> */
|
|
5634
5635
|
constructor(u) {
|
|
5635
5636
|
var o;
|
|
@@ -5642,7 +5643,7 @@ class X0 {
|
|
|
5642
5643
|
return typeof this._values == "function" && (this._values = jm(this.name, this._values())), this._values;
|
|
5643
5644
|
}
|
|
5644
5645
|
getValue(u) {
|
|
5645
|
-
return this._nameLookup === null && (this._nameLookup =
|
|
5646
|
+
return this._nameLookup === null && (this._nameLookup = w0(this.getValues(), (o) => o.name)), this._nameLookup[u];
|
|
5646
5647
|
}
|
|
5647
5648
|
serialize(u) {
|
|
5648
5649
|
this._valueLookup === null && (this._valueLookup = new Map(
|
|
@@ -5720,8 +5721,8 @@ class X0 {
|
|
|
5720
5721
|
}
|
|
5721
5722
|
}
|
|
5722
5723
|
function Tf(i, u) {
|
|
5723
|
-
const o = i.getValues().map((m) => m.name), h =
|
|
5724
|
-
return
|
|
5724
|
+
const o = i.getValues().map((m) => m.name), h = S0(u, o);
|
|
5725
|
+
return b0("the enum value", h);
|
|
5725
5726
|
}
|
|
5726
5727
|
function jm(i, u) {
|
|
5727
5728
|
return aa(u) || He(
|
|
@@ -5731,7 +5732,7 @@ function jm(i, u) {
|
|
|
5731
5732
|
!1,
|
|
5732
5733
|
`${i}.${o} must refer to an object with a "value" key representing an internal value but got: ${$n(h)}.`
|
|
5733
5734
|
), {
|
|
5734
|
-
name:
|
|
5735
|
+
name: F0(o),
|
|
5735
5736
|
description: h.description,
|
|
5736
5737
|
value: h.value !== void 0 ? h.value : o,
|
|
5737
5738
|
deprecationReason: h.deprecationReason,
|
|
@@ -5739,10 +5740,10 @@ function jm(i, u) {
|
|
|
5739
5740
|
astNode: h.astNode
|
|
5740
5741
|
}));
|
|
5741
5742
|
}
|
|
5742
|
-
class
|
|
5743
|
+
class K0 {
|
|
5743
5744
|
constructor(u) {
|
|
5744
5745
|
var o, h;
|
|
5745
|
-
this.name = cr(u.name), this.description = u.description, this.extensions = xr(u.extensions), this.astNode = u.astNode, this.extensionASTNodes = (o = u.extensionASTNodes) !== null && o !== void 0 ? o : [], this.isOneOf = (h = u.isOneOf) !== null && h !== void 0 ? h : !1, this._fields =
|
|
5746
|
+
this.name = cr(u.name), this.description = u.description, this.extensions = xr(u.extensions), this.astNode = u.astNode, this.extensionASTNodes = (o = u.extensionASTNodes) !== null && o !== void 0 ? o : [], this.isOneOf = (h = u.isOneOf) !== null && h !== void 0 ? h : !1, this._fields = ey.bind(void 0, u);
|
|
5746
5747
|
}
|
|
5747
5748
|
get [Symbol.toStringTag]() {
|
|
5748
5749
|
return "GraphQLInputObjectType";
|
|
@@ -5776,7 +5777,7 @@ class Z0 {
|
|
|
5776
5777
|
return this.toString();
|
|
5777
5778
|
}
|
|
5778
5779
|
}
|
|
5779
|
-
function
|
|
5780
|
+
function ey(i) {
|
|
5780
5781
|
const u = ev(i.fields);
|
|
5781
5782
|
return aa(u) || He(
|
|
5782
5783
|
!1,
|
|
@@ -5795,12 +5796,12 @@ function K0(i) {
|
|
|
5795
5796
|
}));
|
|
5796
5797
|
}
|
|
5797
5798
|
function Wi(i) {
|
|
5798
|
-
const u =
|
|
5799
|
+
const u = ty(i);
|
|
5799
5800
|
if (u)
|
|
5800
5801
|
throw u;
|
|
5801
5802
|
return i;
|
|
5802
5803
|
}
|
|
5803
|
-
function
|
|
5804
|
+
function ty(i) {
|
|
5804
5805
|
if (typeof i == "string" || He(!1, "Expected name to be a string."), i.startsWith("__"))
|
|
5805
5806
|
return new jn(
|
|
5806
5807
|
`Name "${i}" must not begin with "__", which is reserved by GraphQL introspection.`
|
|
@@ -5811,7 +5812,7 @@ function ey(i) {
|
|
|
5811
5812
|
return u;
|
|
5812
5813
|
}
|
|
5813
5814
|
}
|
|
5814
|
-
const
|
|
5815
|
+
const ny = (i) => i.scalarType({
|
|
5815
5816
|
name: "ID",
|
|
5816
5817
|
asNexusMethod: "id",
|
|
5817
5818
|
description: "id as string or integer",
|
|
@@ -5823,77 +5824,77 @@ const ty = (i) => i.scalarType({
|
|
|
5823
5824
|
parseLiteral(u) {
|
|
5824
5825
|
return u.kind === Xt.INT || u.kind === Xt.STRING ? u.value : null;
|
|
5825
5826
|
}
|
|
5826
|
-
}),
|
|
5827
|
+
}), ry = (i) => i.inputObjectType({
|
|
5827
5828
|
name: "IdentifyCommentAuthor",
|
|
5828
5829
|
definition(u) {
|
|
5829
5830
|
u.nonNull.id("id");
|
|
5830
5831
|
}
|
|
5831
|
-
}),
|
|
5832
|
+
}), iy = (i) => i.inputObjectType({
|
|
5832
5833
|
name: "RemoveComment",
|
|
5833
5834
|
definition(u) {
|
|
5834
5835
|
u.id("id"), u.nonNull.string("relation"), u.field("author", { type: "IdentifyCommentAuthor" });
|
|
5835
5836
|
}
|
|
5836
|
-
}),
|
|
5837
|
+
}), oy = (i) => i.objectType({
|
|
5837
5838
|
name: "Report",
|
|
5838
5839
|
definition(u) {
|
|
5839
5840
|
u.id("id"), u.nonNull.string("content"), u.field("reason", { type: "ReportReason" }), u.field("related", { type: "CommentSingle" }), u.string("createdAt"), u.string("updatedAt");
|
|
5840
5841
|
}
|
|
5841
|
-
}),
|
|
5842
|
+
}), uy = (i, { reportReasons: u }) => i.enumType({
|
|
5842
5843
|
name: "ReportReason",
|
|
5843
5844
|
description: "Reason of abuse report",
|
|
5844
5845
|
members: Object.values(u)
|
|
5845
|
-
}),
|
|
5846
|
+
}), ay = (i) => i.objectType({
|
|
5846
5847
|
name: "ResponseFindAll",
|
|
5847
5848
|
definition(u) {
|
|
5848
5849
|
u.nonNull.list.field("data", { type: "CommentSingle" }), u.field("meta", { type: "ResponseMeta" });
|
|
5849
5850
|
}
|
|
5850
|
-
}),
|
|
5851
|
+
}), sy = (i) => i.objectType({
|
|
5851
5852
|
name: "ResponseFindAllPerAuthor",
|
|
5852
5853
|
definition(u) {
|
|
5853
5854
|
u.nonNull.list.field("data", { type: "CommentSingle" }), u.field("meta", { type: "ResponseMeta" });
|
|
5854
5855
|
}
|
|
5855
|
-
}),
|
|
5856
|
+
}), ly = (i) => i.objectType({
|
|
5856
5857
|
name: "ResponseMeta",
|
|
5857
5858
|
definition(u) {
|
|
5858
5859
|
u.field("pagination", { type: "ResponsePagination" });
|
|
5859
5860
|
}
|
|
5860
|
-
}),
|
|
5861
|
+
}), cy = (i) => i.objectType({
|
|
5861
5862
|
name: "ResponsePagination",
|
|
5862
5863
|
definition(u) {
|
|
5863
5864
|
u.int("page"), u.int("pageSize"), u.int("pageCount"), u.int("total"), u.int("start"), u.int("limit");
|
|
5864
5865
|
}
|
|
5865
|
-
}),
|
|
5866
|
+
}), fy = (i) => i.inputObjectType({
|
|
5866
5867
|
name: "UpdateComment",
|
|
5867
5868
|
definition(u) {
|
|
5868
5869
|
u.id("id"), u.nonNull.string("content"), u.nonNull.string("relation"), u.field("author", { type: "IdentifyCommentAuthor" });
|
|
5869
5870
|
}
|
|
5870
|
-
}),
|
|
5871
|
-
Qv,
|
|
5871
|
+
}), hy = [
|
|
5872
5872
|
Jv,
|
|
5873
5873
|
Xv,
|
|
5874
5874
|
Zv,
|
|
5875
5875
|
Kv,
|
|
5876
5876
|
e0,
|
|
5877
5877
|
t0,
|
|
5878
|
-
|
|
5878
|
+
n0,
|
|
5879
5879
|
ny,
|
|
5880
5880
|
ry,
|
|
5881
|
-
|
|
5881
|
+
iy,
|
|
5882
5882
|
uy,
|
|
5883
5883
|
ay,
|
|
5884
5884
|
sy,
|
|
5885
5885
|
ly,
|
|
5886
5886
|
cy,
|
|
5887
|
-
|
|
5888
|
-
|
|
5887
|
+
fy,
|
|
5888
|
+
oy
|
|
5889
|
+
], py = (i, u) => hy.map((o) => o(u, i)), ov = (i) => i.plugin("graphql").service("extension"), dy = (i) => {
|
|
5889
5890
|
const u = ov(i);
|
|
5890
5891
|
u.shadowCRUD(lr(i, "comment")).disable(), u.shadowCRUD(lr(i, "comment")).disableQueries(), u.shadowCRUD(lr(i, "comment")).disableMutations(), u.shadowCRUD(lr(i, "comment-report")).disable(), u.shadowCRUD(lr(i, "comment-report")).disableQueries(), u.shadowCRUD(lr(i, "comment-report")).disableMutations();
|
|
5891
|
-
},
|
|
5892
|
-
i.plugin("graphql") && (
|
|
5893
|
-
},
|
|
5892
|
+
}, gy = async ({ strapi: i }) => {
|
|
5893
|
+
i.plugin("graphql") && (dy(i), (await ft(i, "common").getConfig(oa.ENABLED_COLLECTIONS, [])).length && await my(i));
|
|
5894
|
+
}, my = async (i) => {
|
|
5894
5895
|
const u = ov(i), o = await ft(i, "common").getConfig();
|
|
5895
5896
|
u.use(({ strapi: h, nexus: m }) => {
|
|
5896
|
-
const A =
|
|
5897
|
+
const A = py(o, m), S = Qv(h, m), C = Gv(h, m), R = Bv(o);
|
|
5897
5898
|
return {
|
|
5898
5899
|
types: [A, S, C],
|
|
5899
5900
|
resolversConfig: R
|
|
@@ -5912,8 +5913,8 @@ const ty = (i) => i.scalarType({
|
|
|
5912
5913
|
read: "settings-read",
|
|
5913
5914
|
change: "settings-change"
|
|
5914
5915
|
}
|
|
5915
|
-
},
|
|
5916
|
-
if (i.plugin("graphql") && await
|
|
5916
|
+
}, vy = async ({ strapi: i }) => {
|
|
5917
|
+
if (i.plugin("graphql") && await gy({ strapi: i }), Object.keys(i.plugins).indexOf("users-permissions") === -1)
|
|
5917
5918
|
throw new Error(
|
|
5918
5919
|
"In order to make the comments plugin work the users-permissions plugin is required"
|
|
5919
5920
|
);
|
|
@@ -5956,7 +5957,7 @@ const ty = (i) => i.scalarType({
|
|
|
5956
5957
|
}
|
|
5957
5958
|
];
|
|
5958
5959
|
await i.admin.services.permission.actionProvider.registerMany(u);
|
|
5959
|
-
},
|
|
5960
|
+
}, yy = {
|
|
5960
5961
|
isValidationEnabled: !0,
|
|
5961
5962
|
enabledCollections: [],
|
|
5962
5963
|
moderatorRoles: [],
|
|
@@ -5970,13 +5971,13 @@ const ty = (i) => i.scalarType({
|
|
|
5970
5971
|
OTHER: Zt.OTHER
|
|
5971
5972
|
},
|
|
5972
5973
|
blockedAuthorProps: []
|
|
5973
|
-
},
|
|
5974
|
+
}, _y = v.object({
|
|
5974
5975
|
[Zt.BAD_LANGUAGE]: v.literal(Zt.BAD_LANGUAGE),
|
|
5975
5976
|
[Zt.OTHER]: v.literal(Zt.OTHER),
|
|
5976
5977
|
[Zt.DISCRIMINATION]: v.literal(Zt.DISCRIMINATION)
|
|
5977
5978
|
}), Am = v.object({
|
|
5978
5979
|
isValidationEnabled: v.boolean().optional(),
|
|
5979
|
-
reportReasons:
|
|
5980
|
+
reportReasons: _y.optional(),
|
|
5980
5981
|
isGQLPluginEnabled: v.boolean().optional(),
|
|
5981
5982
|
[Cr.ENABLED_COLLECTIONS]: v.array(v.string()),
|
|
5982
5983
|
[Cr.MODERATOR_ROLES]: v.array(v.string()),
|
|
@@ -5991,8 +5992,8 @@ const ty = (i) => i.scalarType({
|
|
|
5991
5992
|
url: v.string().nullable(),
|
|
5992
5993
|
contactEmail: v.string().nullable()
|
|
5993
5994
|
}).default({ url: null, contactEmail: null })
|
|
5994
|
-
}),
|
|
5995
|
-
default: Am.parse(
|
|
5995
|
+
}), by = {
|
|
5996
|
+
default: Am.parse(yy),
|
|
5996
5997
|
validate: (i) => Am.safeParse(i)
|
|
5997
5998
|
}, Y = ({
|
|
5998
5999
|
left: i,
|
|
@@ -6011,7 +6012,7 @@ const ty = (i) => i.scalarType({
|
|
|
6011
6012
|
throw new Error(
|
|
6012
6013
|
"Received no left or right values at runtime when opening Either"
|
|
6013
6014
|
);
|
|
6014
|
-
},
|
|
6015
|
+
}, wy = (i) => i.left !== void 0, pe = (i) => i.right !== void 0, uv = (i) => ({ left: i }), ol = (i) => ({ right: i });
|
|
6015
6016
|
let An = class av extends Error {
|
|
6016
6017
|
constructor(u, o, h = void 0) {
|
|
6017
6018
|
super(), this.name = "Strapi:Plugin:Comments", this.status = u || 500, this.message = o || "Internal error", this.payload = h, Object.setPrototypeOf(this, av.prototype);
|
|
@@ -6027,40 +6028,39 @@ let An = class av extends Error {
|
|
|
6027
6028
|
} : this;
|
|
6028
6029
|
}
|
|
6029
6030
|
};
|
|
6030
|
-
const ce = (i, u) => u instanceof An ? i.throw(u.status, JSON.stringify(u)) : u,
|
|
6031
|
+
const ce = (i, u) => u instanceof An ? i.throw(u.status, JSON.stringify(u)) : u, Ay = v.union([
|
|
6031
6032
|
v.object({ $eq: v.string().min(1) }),
|
|
6032
6033
|
v.object({ $eqi: v.string().min(1) })
|
|
6033
|
-
]),
|
|
6034
|
+
]), Ey = v.union([
|
|
6034
6035
|
v.object({ $ne: v.string().min(1) }),
|
|
6035
6036
|
v.object({ $nei: v.string().min(1) })
|
|
6036
|
-
]),
|
|
6037
|
+
]), Sy = v.union([
|
|
6037
6038
|
v.object({ $gt: v.string().min(1) }),
|
|
6038
6039
|
v.object({ $gte: v.string().min(1) })
|
|
6039
|
-
]),
|
|
6040
|
+
]), Ty = v.union([
|
|
6040
6041
|
v.object({ $lt: v.string().min(1) }),
|
|
6041
6042
|
v.object({ $lte: v.string().min(1) })
|
|
6042
|
-
]),
|
|
6043
|
+
]), Oy = v.union([
|
|
6043
6044
|
v.object({ $startsWith: v.string().min(1) }),
|
|
6044
6045
|
v.object({ $startsWithi: v.string().min(1) })
|
|
6045
|
-
]),
|
|
6046
|
+
]), Cy = v.union([
|
|
6046
6047
|
v.object({ $endsWith: v.string().min(1) }),
|
|
6047
6048
|
v.object({ $endsWithi: v.string().min(1) })
|
|
6048
|
-
]),
|
|
6049
|
+
]), Iy = v.union([
|
|
6049
6050
|
v.object({ $contains: v.string().min(1) }),
|
|
6050
6051
|
v.object({ $containsi: v.string().min(1) })
|
|
6051
|
-
]),
|
|
6052
|
+
]), Ry = v.union([
|
|
6052
6053
|
v.object({ $notContains: v.string().min(1) }),
|
|
6053
6054
|
v.object({ $notContainsi: v.string().min(1) })
|
|
6054
|
-
]), Xr = v.union([v.string(), v.number()]).transform((i) => Number(i)).pipe(v.number()), Em = v.union([v.string(), v.boolean()]).transform((i) => typeof i == "string" ? ["t", "true"].includes(i) : i).pipe(v.boolean()),
|
|
6055
|
+
]), Xr = v.union([v.string(), v.number()]).transform((i) => Number(i)).pipe(v.number()), Em = v.union([v.string(), v.boolean()]).transform((i) => typeof i == "string" ? ["t", "true"].includes(i) : i).pipe(v.boolean()), xy = v.object({
|
|
6055
6056
|
_q: v.string().optional()
|
|
6056
6057
|
}), sv = v.string().regex(
|
|
6057
6058
|
// TODO: check sort options
|
|
6058
6059
|
/^(content|createdAt|updatedAt|id):(desc|asc|ASC|DESC)$/,
|
|
6059
6060
|
"Invalid orderBy options"
|
|
6060
|
-
),
|
|
6061
|
+
), Ny = v.union([
|
|
6061
6062
|
v.string(),
|
|
6062
6063
|
v.number(),
|
|
6063
|
-
wy,
|
|
6064
6064
|
Ay,
|
|
6065
6065
|
Ey,
|
|
6066
6066
|
Sy,
|
|
@@ -6068,13 +6068,14 @@ const ce = (i, u) => u instanceof An ? i.throw(u.status, JSON.stringify(u)) : u,
|
|
|
6068
6068
|
Oy,
|
|
6069
6069
|
Cy,
|
|
6070
6070
|
Iy,
|
|
6071
|
+
Ry,
|
|
6071
6072
|
v.object({ $null: Em }),
|
|
6072
6073
|
v.object({ $notNull: Em })
|
|
6073
6074
|
]), Sm = (i) => v.object(
|
|
6074
6075
|
Object.keys(i).reduce(
|
|
6075
6076
|
(u, o) => ({
|
|
6076
6077
|
...u,
|
|
6077
|
-
[o]:
|
|
6078
|
+
[o]: Ny.optional()
|
|
6078
6079
|
}),
|
|
6079
6080
|
{}
|
|
6080
6081
|
)
|
|
@@ -6090,10 +6091,10 @@ const ce = (i, u) => u instanceof An ? i.throw(u.status, JSON.stringify(u)) : u,
|
|
|
6090
6091
|
{}
|
|
6091
6092
|
);
|
|
6092
6093
|
return v.object(u);
|
|
6093
|
-
},
|
|
6094
|
+
}, Ly = v.object({
|
|
6094
6095
|
pageSize: Xr.default(10),
|
|
6095
6096
|
page: Xr.default(1)
|
|
6096
|
-
}).merge(
|
|
6097
|
+
}).merge(xy).merge(
|
|
6097
6098
|
v.object({
|
|
6098
6099
|
orderBy: sv.optional().nullable()
|
|
6099
6100
|
})
|
|
@@ -6125,23 +6126,23 @@ const ce = (i, u) => u instanceof An ? i.throw(u.status, JSON.stringify(u)) : u,
|
|
|
6125
6126
|
}).refine(
|
|
6126
6127
|
(u) => i.some((o) => u.startsWith(o)),
|
|
6127
6128
|
"Invalid relation or not enabled collections"
|
|
6128
|
-
),
|
|
6129
|
+
), Dy = v.object({
|
|
6129
6130
|
id: v.union([v.number(), v.string()]),
|
|
6130
6131
|
name: v.string().min(1).max(100).optional(),
|
|
6131
6132
|
email: v.string().email(),
|
|
6132
6133
|
avatar: v.string().url().optional()
|
|
6133
6134
|
});
|
|
6134
6135
|
v.union([v.string(), v.number(), v.boolean()]);
|
|
6135
|
-
const lv =
|
|
6136
|
+
const lv = Ly.merge(v.object({ _q: v.string().optional() })), Jr = (i) => Nt(sa({ id: Zr.single }).safeParse(i)), Py = (i) => Nt(lv.safeParse(i)), Fy = (i) => Nt(lv.safeParse(i)), Uy = (i, u) => {
|
|
6136
6137
|
const o = sa({ id: Zr.single }).merge(v.object({ removed: v.string().optional().transform((h) => h === "true") })).safeParse({ ...u, id: i });
|
|
6137
6138
|
return Nt(o);
|
|
6138
|
-
},
|
|
6139
|
+
}, My = (i) => Nt(sa({ id: Zr.single, reportId: Zr.single }).safeParse(i)), Wy = (i) => {
|
|
6139
6140
|
const u = sa({ id: Zr.single, reportIds: Zr.array }).safeParse(i);
|
|
6140
6141
|
return Nt(u);
|
|
6141
|
-
},
|
|
6142
|
+
}, By = (i) => {
|
|
6142
6143
|
const u = sa({ reportIds: Zr.array }).safeParse(i);
|
|
6143
6144
|
return Nt(u);
|
|
6144
|
-
},
|
|
6145
|
+
}, jy = v.object({
|
|
6145
6146
|
id: v.union([v.string(), v.number()]),
|
|
6146
6147
|
email: v.string().email(),
|
|
6147
6148
|
lastname: v.string().nullable().optional(),
|
|
@@ -6150,28 +6151,28 @@ const lv = Ny.merge(v.object({ _q: v.string().optional() })), Jr = (i) => Nt(sa(
|
|
|
6150
6151
|
}), cv = v.object({
|
|
6151
6152
|
id: v.union([v.string(), v.number()]),
|
|
6152
6153
|
content: v.string(),
|
|
6153
|
-
author:
|
|
6154
|
-
}),
|
|
6154
|
+
author: jy
|
|
6155
|
+
}), $y = (i) => Nt(cv.safeParse(i)), ky = (i) => Nt(cv.pick({ content: !0, id: !0 }).safeParse(i)), Vy = (i) => Nt(Am.safeParse(i)), fv = (i) => v.object({
|
|
6155
6156
|
relation: Uf(i),
|
|
6156
6157
|
content: v.string().min(1),
|
|
6157
|
-
author:
|
|
6158
|
+
author: Dy.optional(),
|
|
6158
6159
|
threadOf: v.union([v.string(), v.number()]).optional(),
|
|
6159
6160
|
approvalStatus: v.nativeEnum(Ui).optional(),
|
|
6160
6161
|
locale: v.string().optional()
|
|
6161
|
-
}),
|
|
6162
|
+
}), Gy = (i, u, o) => Nt(fv(i).safeParse({
|
|
6162
6163
|
...o,
|
|
6163
6164
|
relation: u
|
|
6164
|
-
})),
|
|
6165
|
+
})), zy = (i, u) => Nt(
|
|
6165
6166
|
fv(i).pick({ content: !0, relation: !0, author: !0 }).merge(sa({ commentId: Zr.single })).safeParse(u)
|
|
6166
|
-
),
|
|
6167
|
+
), qy = (i) => v.object({
|
|
6167
6168
|
relation: Uf(i)
|
|
6168
|
-
}),
|
|
6169
|
+
}), Hy = v.object({
|
|
6169
6170
|
pagination: v.object({
|
|
6170
6171
|
pageSize: Xr.default(10),
|
|
6171
6172
|
page: Xr.default(1),
|
|
6172
6173
|
withCount: Em.optional().default(!1)
|
|
6173
6174
|
}).optional()
|
|
6174
|
-
}),
|
|
6175
|
+
}), Yy = v.record(v.union([
|
|
6175
6176
|
v.union([
|
|
6176
6177
|
v.boolean(),
|
|
6177
6178
|
v.literal("true").transform(() => !0),
|
|
@@ -6206,15 +6207,15 @@ const lv = Ny.merge(v.object({ _q: v.string().optional() })), Jr = (i) => Nt(sa(
|
|
|
6206
6207
|
})
|
|
6207
6208
|
).optional(),
|
|
6208
6209
|
isAdmin: v.boolean().optional().default(!1),
|
|
6209
|
-
populate:
|
|
6210
|
+
populate: Yy,
|
|
6210
6211
|
limit: Xr.optional(),
|
|
6211
6212
|
skip: Xr.optional(),
|
|
6212
6213
|
locale: v.string().optional()
|
|
6213
|
-
}).merge(
|
|
6214
|
-
},
|
|
6214
|
+
}).merge(qy(i)).merge(Hy);
|
|
6215
|
+
}, Qy = (i, u, o) => Nt(xm(i).safeParse({
|
|
6215
6216
|
...o,
|
|
6216
6217
|
relation: u
|
|
6217
|
-
})),
|
|
6218
|
+
})), Jy = (i, u, o) => {
|
|
6218
6219
|
const h = xm(i).pick({
|
|
6219
6220
|
sort: !0,
|
|
6220
6221
|
fields: !0,
|
|
@@ -6235,7 +6236,7 @@ const lv = Ny.merge(v.object({ _q: v.string().optional() })), Jr = (i) => Nt(sa(
|
|
|
6235
6236
|
...o,
|
|
6236
6237
|
relation: u
|
|
6237
6238
|
}));
|
|
6238
|
-
},
|
|
6239
|
+
}, Xy = (i, u) => {
|
|
6239
6240
|
const o = xm([]).pick({
|
|
6240
6241
|
sort: !0,
|
|
6241
6242
|
fields: !0,
|
|
@@ -6255,33 +6256,33 @@ const lv = Ny.merge(v.object({ _q: v.string().optional() })), Jr = (i) => Nt(sa(
|
|
|
6255
6256
|
...u,
|
|
6256
6257
|
...i
|
|
6257
6258
|
}));
|
|
6258
|
-
},
|
|
6259
|
+
}, Zy = (i) => v.object({
|
|
6259
6260
|
relation: Uf(i[Cr.ENABLED_COLLECTIONS]),
|
|
6260
6261
|
commentId: Xr,
|
|
6261
6262
|
content: v.string().min(1),
|
|
6262
6263
|
reason: v.nativeEnum(i.reportReasons)
|
|
6263
|
-
}),
|
|
6264
|
+
}), Ky = (i, u) => Nt(Zy(i).safeParse(u)), e_ = (i) => v.object({
|
|
6264
6265
|
relation: Uf(i),
|
|
6265
6266
|
commentId: v.union([v.string(), v.number()]),
|
|
6266
6267
|
authorId: v.union([v.string(), v.number()])
|
|
6267
|
-
}),
|
|
6268
|
+
}), t_ = (i, u) => Nt(e_(i).safeParse(u)), n_ = ({ strapi: i }) => ({
|
|
6268
6269
|
getService(u) {
|
|
6269
6270
|
return ft(i, u);
|
|
6270
6271
|
},
|
|
6271
6272
|
async findAll(u) {
|
|
6272
|
-
const o =
|
|
6273
|
+
const o = Py(u.query);
|
|
6273
6274
|
if (pe(o))
|
|
6274
6275
|
return this.getService("admin").findAll(Y(o));
|
|
6275
6276
|
throw ce(u, Y(o));
|
|
6276
6277
|
},
|
|
6277
6278
|
async findReports(u) {
|
|
6278
|
-
const o =
|
|
6279
|
+
const o = Fy(u.query);
|
|
6279
6280
|
if (pe(o))
|
|
6280
6281
|
return this.getService("admin").findReports(Y(o));
|
|
6281
6282
|
throw ce(u, Y(o));
|
|
6282
6283
|
},
|
|
6283
6284
|
async findOne(u) {
|
|
6284
|
-
const o =
|
|
6285
|
+
const o = Uy(u.params.id, u.query);
|
|
6285
6286
|
if (pe(o))
|
|
6286
6287
|
return this.getService("admin").findOneAndThread(Y(o));
|
|
6287
6288
|
throw ce(u, Y(o));
|
|
@@ -6317,13 +6318,13 @@ const lv = Ny.merge(v.object({ _q: v.string().optional() })), Jr = (i) => Nt(sa(
|
|
|
6317
6318
|
throw ce(u, Y(o));
|
|
6318
6319
|
},
|
|
6319
6320
|
async resolveAbuseReport(u) {
|
|
6320
|
-
const o =
|
|
6321
|
+
const o = My(u.params);
|
|
6321
6322
|
if (pe(o))
|
|
6322
6323
|
return this.getService("admin").resolveAbuseReport(Y(o));
|
|
6323
6324
|
throw ce(u, Y(o));
|
|
6324
6325
|
},
|
|
6325
6326
|
async resolveCommentMultipleAbuseReports(u) {
|
|
6326
|
-
const o =
|
|
6327
|
+
const o = Wy({
|
|
6327
6328
|
...u.request.body,
|
|
6328
6329
|
id: u.params.id
|
|
6329
6330
|
});
|
|
@@ -6344,13 +6345,13 @@ const lv = Ny.merge(v.object({ _q: v.string().optional() })), Jr = (i) => Nt(sa(
|
|
|
6344
6345
|
throw ce(u, Y(o));
|
|
6345
6346
|
},
|
|
6346
6347
|
async resolveMultipleAbuseReports(u) {
|
|
6347
|
-
const o =
|
|
6348
|
+
const o = By(u.request.body);
|
|
6348
6349
|
if (pe(o))
|
|
6349
6350
|
return this.getService("admin").resolveMultipleAbuseReports(Y(o));
|
|
6350
6351
|
throw ce(u, Y(o));
|
|
6351
6352
|
},
|
|
6352
6353
|
async postComment(u) {
|
|
6353
|
-
const o =
|
|
6354
|
+
const o = $y({
|
|
6354
6355
|
id: u.params.id,
|
|
6355
6356
|
content: u.request.body.content,
|
|
6356
6357
|
author: u.request.body.author
|
|
@@ -6360,7 +6361,7 @@ const lv = Ny.merge(v.object({ _q: v.string().optional() })), Jr = (i) => Nt(sa(
|
|
|
6360
6361
|
throw ce(u, Y(o));
|
|
6361
6362
|
},
|
|
6362
6363
|
async updateComment(u) {
|
|
6363
|
-
const o =
|
|
6364
|
+
const o = ky({
|
|
6364
6365
|
id: u.params.id,
|
|
6365
6366
|
content: u.request.body.content
|
|
6366
6367
|
});
|
|
@@ -6426,7 +6427,7 @@ const lv = Ny.merge(v.object({ _q: v.string().optional() })), Jr = (i) => Nt(sa(
|
|
|
6426
6427
|
pageSize: v.number(),
|
|
6427
6428
|
pageCount: v.number(),
|
|
6428
6429
|
total: v.number()
|
|
6429
|
-
}), Fi = (i, u) => (o) => i ? u.parseAsync(o) : Promise.resolve(o), gv = (i, u) => (o) => i ? u.parseAsync(o) : Promise.resolve(o),
|
|
6430
|
+
}), Fi = (i, u) => (o) => i ? u.parseAsync(o) : Promise.resolve(o), gv = (i, u) => (o) => i ? u.parseAsync(o) : Promise.resolve(o), r_ = v.object({
|
|
6430
6431
|
id: v.number(),
|
|
6431
6432
|
documentId: v.string().nullable(),
|
|
6432
6433
|
content: v.string(),
|
|
@@ -6441,13 +6442,13 @@ const lv = Ny.merge(v.object({ _q: v.string().optional() })), Jr = (i) => Nt(sa(
|
|
|
6441
6442
|
{
|
|
6442
6443
|
gotThread: v.boolean().nullable().optional(),
|
|
6443
6444
|
threadFirstItemId: v.number().nullable().optional(),
|
|
6444
|
-
reports: v.array(
|
|
6445
|
+
reports: v.array(r_).default([]),
|
|
6445
6446
|
author: v.any().nullable().optional()
|
|
6446
6447
|
}
|
|
6447
6448
|
)
|
|
6448
6449
|
), al = $m.extend({
|
|
6449
6450
|
threadOf: v.lazy(() => v.union([v.number(), $m])).nullable().optional()
|
|
6450
|
-
}),
|
|
6451
|
+
}), i_ = v.object({
|
|
6451
6452
|
id: v.number(),
|
|
6452
6453
|
uid: v.string(),
|
|
6453
6454
|
documentId: v.string(),
|
|
@@ -6455,17 +6456,17 @@ const lv = Ny.merge(v.object({ _q: v.string().optional() })), Jr = (i) => Nt(sa(
|
|
|
6455
6456
|
locale: v.string().nullable().optional()
|
|
6456
6457
|
});
|
|
6457
6458
|
al.omit({ related: !0 }).extend({
|
|
6458
|
-
related:
|
|
6459
|
+
related: i_.nullable().optional()
|
|
6459
6460
|
});
|
|
6460
|
-
const
|
|
6461
|
+
const o_ = v.array(al), u_ = v.object({
|
|
6461
6462
|
pagination: dv,
|
|
6462
6463
|
results: v.array(al)
|
|
6463
6464
|
}), ia = {
|
|
6464
|
-
findMany:
|
|
6465
|
-
findWithCount:
|
|
6465
|
+
findMany: o_,
|
|
6466
|
+
findWithCount: u_,
|
|
6466
6467
|
findOne: al,
|
|
6467
6468
|
create: al
|
|
6468
|
-
},
|
|
6469
|
+
}, a_ = v.object({
|
|
6469
6470
|
id: v.number(),
|
|
6470
6471
|
documentId: v.string(),
|
|
6471
6472
|
content: v.string(),
|
|
@@ -6503,11 +6504,11 @@ const i_ = v.array(al), o_ = v.object({
|
|
|
6503
6504
|
updatedAt: v.string(),
|
|
6504
6505
|
publishedAt: v.string().nullable(),
|
|
6505
6506
|
locale: v.string().nullable(),
|
|
6506
|
-
related:
|
|
6507
|
-
}),
|
|
6507
|
+
related: a_.nullable().optional()
|
|
6508
|
+
}), s_ = v.object({
|
|
6508
6509
|
results: v.array(mv),
|
|
6509
6510
|
pagination: dv
|
|
6510
|
-
}),
|
|
6511
|
+
}), l_ = v.object({
|
|
6511
6512
|
id: v.number(),
|
|
6512
6513
|
documentId: v.string().nullable(),
|
|
6513
6514
|
content: v.string(),
|
|
@@ -6517,7 +6518,7 @@ const i_ = v.array(al), o_ = v.object({
|
|
|
6517
6518
|
updatedAt: v.string(),
|
|
6518
6519
|
publishedAt: v.string().nullable(),
|
|
6519
6520
|
locale: v.string().nullable()
|
|
6520
|
-
}),
|
|
6521
|
+
}), c_ = v.array(v.object({
|
|
6521
6522
|
id: v.number(),
|
|
6522
6523
|
documentId: v.string().nullable(),
|
|
6523
6524
|
content: v.string(),
|
|
@@ -6529,11 +6530,11 @@ const i_ = v.array(al), o_ = v.object({
|
|
|
6529
6530
|
locale: v.string().nullable(),
|
|
6530
6531
|
related: pv.nullable()
|
|
6531
6532
|
})), Of = {
|
|
6532
|
-
findMany:
|
|
6533
|
-
findPage:
|
|
6534
|
-
update:
|
|
6533
|
+
findMany: c_,
|
|
6534
|
+
findPage: s_,
|
|
6535
|
+
update: l_,
|
|
6535
6536
|
create: mv
|
|
6536
|
-
},
|
|
6537
|
+
}, f_ = (i) => {
|
|
6537
6538
|
const u = lr(i, "comment-report"), o = i.query(u);
|
|
6538
6539
|
return {
|
|
6539
6540
|
async findPage(h) {
|
|
@@ -6556,7 +6557,7 @@ const i_ = v.array(al), o_ = v.object({
|
|
|
6556
6557
|
return o.create(h).then(Fi(m, Of.create));
|
|
6557
6558
|
}
|
|
6558
6559
|
};
|
|
6559
|
-
}, Pi = Le.once(
|
|
6560
|
+
}, Pi = Le.once(f_), h_ = (i) => {
|
|
6560
6561
|
const u = lr(i, "comment");
|
|
6561
6562
|
return {
|
|
6562
6563
|
async findMany(o) {
|
|
@@ -6590,9 +6591,9 @@ const i_ = v.array(al), o_ = v.object({
|
|
|
6590
6591
|
return i.query(u).create(o).then(Fi(h, ia.create));
|
|
6591
6592
|
}
|
|
6592
6593
|
};
|
|
6593
|
-
}, it = Le.once(
|
|
6594
|
+
}, it = Le.once(h_), p_ = (i) => ({
|
|
6594
6595
|
getLocalConfig(u, o) {
|
|
6595
|
-
return i.config.get([
|
|
6596
|
+
return i.config.get([Rv, u].filter(Boolean).join("."), o);
|
|
6596
6597
|
},
|
|
6597
6598
|
async getStore() {
|
|
6598
6599
|
return await i.store({ type: "plugin", name: "comments" });
|
|
@@ -6651,7 +6652,7 @@ const i_ = v.array(al), o_ = v.object({
|
|
|
6651
6652
|
async restore() {
|
|
6652
6653
|
return await (await this.getStore()).delete({ key: "config" }), this.get();
|
|
6653
6654
|
}
|
|
6654
|
-
}), Mf = Le.once(
|
|
6655
|
+
}), Mf = Le.once(p_), d_ = ({ strapi: i }) => ({
|
|
6655
6656
|
getService(u) {
|
|
6656
6657
|
return ft(i, u);
|
|
6657
6658
|
},
|
|
@@ -6661,7 +6662,7 @@ const i_ = v.array(al), o_ = v.object({
|
|
|
6661
6662
|
async post(u) {
|
|
6662
6663
|
const o = await this.getStoreRepository().get(!0);
|
|
6663
6664
|
if (pe(o)) {
|
|
6664
|
-
const h = Y(o), m =
|
|
6665
|
+
const h = Y(o), m = Gy(h.enabledCollections, u.params.relation, u.request.body);
|
|
6665
6666
|
if (pe(m))
|
|
6666
6667
|
return this.getService("client").create(m.right, u.state.user);
|
|
6667
6668
|
throw ce(u, Y(m));
|
|
@@ -6671,7 +6672,7 @@ const i_ = v.array(al), o_ = v.object({
|
|
|
6671
6672
|
async findAllFlat(u) {
|
|
6672
6673
|
const o = await this.getStoreRepository().get(!0);
|
|
6673
6674
|
if (pe(o)) {
|
|
6674
|
-
const h = Y(o), m =
|
|
6675
|
+
const h = Y(o), m = Qy(h.enabledCollections, u.params.relation, u.query);
|
|
6675
6676
|
if (pe(m))
|
|
6676
6677
|
return this.getService("common").findAllFlat(
|
|
6677
6678
|
ua(m.right)
|
|
@@ -6683,7 +6684,7 @@ const i_ = v.array(al), o_ = v.object({
|
|
|
6683
6684
|
async findAllInHierarchy(u) {
|
|
6684
6685
|
const o = await this.getStoreRepository().get(!0);
|
|
6685
6686
|
if (pe(o)) {
|
|
6686
|
-
const h = Y(o), m =
|
|
6687
|
+
const h = Y(o), m = Jy(h.enabledCollections, u.params.relation, u.query);
|
|
6687
6688
|
if (pe(m))
|
|
6688
6689
|
return this.getService("common").findAllInHierarchy(
|
|
6689
6690
|
ua(m.right)
|
|
@@ -6693,7 +6694,7 @@ const i_ = v.array(al), o_ = v.object({
|
|
|
6693
6694
|
throw ce(u, Y(o));
|
|
6694
6695
|
},
|
|
6695
6696
|
async findAllPerAuthor(u) {
|
|
6696
|
-
const o =
|
|
6697
|
+
const o = Xy(u.params, u.query);
|
|
6697
6698
|
if (pe(o))
|
|
6698
6699
|
return this.getService("common").findAllPerAuthor(
|
|
6699
6700
|
ua(o.right),
|
|
@@ -6704,7 +6705,7 @@ const i_ = v.array(al), o_ = v.object({
|
|
|
6704
6705
|
async put(u) {
|
|
6705
6706
|
const { user: o } = u.state, h = await this.getStoreRepository().get(!0);
|
|
6706
6707
|
if (pe(h)) {
|
|
6707
|
-
const m = Y(h), A =
|
|
6708
|
+
const m = Y(h), A = zy(m.enabledCollections, {
|
|
6708
6709
|
...u.params,
|
|
6709
6710
|
content: u.request.body.content,
|
|
6710
6711
|
author: u.request.body.author
|
|
@@ -6721,7 +6722,7 @@ const i_ = v.array(al), o_ = v.object({
|
|
|
6721
6722
|
async reportAbuse(u) {
|
|
6722
6723
|
const { state: o } = u, { user: h } = o, m = await this.getStoreRepository().get(!0);
|
|
6723
6724
|
if (pe(m)) {
|
|
6724
|
-
const A = Y(m), S =
|
|
6725
|
+
const A = Y(m), S = Ky(A, {
|
|
6725
6726
|
...u.request.body,
|
|
6726
6727
|
...u.params
|
|
6727
6728
|
});
|
|
@@ -6737,7 +6738,7 @@ const i_ = v.array(al), o_ = v.object({
|
|
|
6737
6738
|
async removeComment(u) {
|
|
6738
6739
|
const { state: o } = u, { user: h } = o, m = await this.getStoreRepository().get(!0);
|
|
6739
6740
|
if (pe(m)) {
|
|
6740
|
-
const A = Y(m), S =
|
|
6741
|
+
const A = Y(m), S = t_(A.enabledCollections, {
|
|
6741
6742
|
...u.query,
|
|
6742
6743
|
...u.params
|
|
6743
6744
|
});
|
|
@@ -6750,7 +6751,7 @@ const i_ = v.array(al), o_ = v.object({
|
|
|
6750
6751
|
}
|
|
6751
6752
|
throw ce(u, Y(m));
|
|
6752
6753
|
}
|
|
6753
|
-
}),
|
|
6754
|
+
}), g_ = ({ strapi: i }) => {
|
|
6754
6755
|
const u = ft(i, "settings");
|
|
6755
6756
|
return {
|
|
6756
6757
|
async get(o) {
|
|
@@ -6768,7 +6769,7 @@ const i_ = v.array(al), o_ = v.object({
|
|
|
6768
6769
|
}
|
|
6769
6770
|
},
|
|
6770
6771
|
async update(o) {
|
|
6771
|
-
const h =
|
|
6772
|
+
const h = Vy(o.request.body);
|
|
6772
6773
|
if (pe(h))
|
|
6773
6774
|
return await u.update(Y(h));
|
|
6774
6775
|
throw ce(o, Y(h));
|
|
@@ -6788,11 +6789,11 @@ const i_ = v.array(al), o_ = v.object({
|
|
|
6788
6789
|
}
|
|
6789
6790
|
}
|
|
6790
6791
|
};
|
|
6791
|
-
},
|
|
6792
|
-
admin:
|
|
6793
|
-
client:
|
|
6794
|
-
settings:
|
|
6795
|
-
},
|
|
6792
|
+
}, m_ = {
|
|
6793
|
+
admin: n_,
|
|
6794
|
+
client: d_,
|
|
6795
|
+
settings: g_
|
|
6796
|
+
}, v_ = [
|
|
6796
6797
|
{
|
|
6797
6798
|
method: "GET",
|
|
6798
6799
|
path: "/moderate/all",
|
|
@@ -6929,7 +6930,7 @@ const i_ = v.array(al), o_ = v.object({
|
|
|
6929
6930
|
policies: []
|
|
6930
6931
|
}
|
|
6931
6932
|
}
|
|
6932
|
-
],
|
|
6933
|
+
], y_ = [
|
|
6933
6934
|
{
|
|
6934
6935
|
method: "PUT",
|
|
6935
6936
|
path: "/settings/config",
|
|
@@ -6970,10 +6971,10 @@ const i_ = v.array(al), o_ = v.object({
|
|
|
6970
6971
|
policies: []
|
|
6971
6972
|
}
|
|
6972
6973
|
}
|
|
6973
|
-
], y_ = [
|
|
6974
|
-
...m_,
|
|
6975
|
-
...v_
|
|
6976
6974
|
], __ = [
|
|
6975
|
+
...v_,
|
|
6976
|
+
...y_
|
|
6977
|
+
], b_ = [
|
|
6977
6978
|
{
|
|
6978
6979
|
method: "GET",
|
|
6979
6980
|
path: "/:relation",
|
|
@@ -7086,14 +7087,14 @@ const i_ = v.array(al), o_ = v.object({
|
|
|
7086
7087
|
}
|
|
7087
7088
|
}
|
|
7088
7089
|
}
|
|
7089
|
-
],
|
|
7090
|
+
], w_ = {
|
|
7090
7091
|
"content-api": {
|
|
7091
7092
|
type: "content-api",
|
|
7092
|
-
routes:
|
|
7093
|
+
routes: b_
|
|
7093
7094
|
},
|
|
7094
7095
|
admin: {
|
|
7095
7096
|
type: "admin",
|
|
7096
|
-
routes:
|
|
7097
|
+
routes: __
|
|
7097
7098
|
}
|
|
7098
7099
|
};
|
|
7099
7100
|
class fn extends Error {
|
|
@@ -7111,7 +7112,7 @@ class fn extends Error {
|
|
|
7111
7112
|
} : this;
|
|
7112
7113
|
}
|
|
7113
7114
|
}
|
|
7114
|
-
const km = (i) => i.split(
|
|
7115
|
+
const km = (i) => i.split(Hv.relatedUid).filter((u) => u && u.length > 0), vv = (i) => i && {
|
|
7115
7116
|
...i,
|
|
7116
7117
|
reports: (i.reports || []).filter((u) => !u.resolved)
|
|
7117
7118
|
}, Vm = (i, u, o = []) => {
|
|
@@ -7152,10 +7153,10 @@ const km = (i) => i.split(qv.relatedUid).filter((u) => u && u.length > 0), vv =
|
|
|
7152
7153
|
};
|
|
7153
7154
|
}, Cf = (i) => {
|
|
7154
7155
|
throw i ? new fn(401, "Not authenticated") : new fn(403, "Not authorized");
|
|
7155
|
-
},
|
|
7156
|
+
}, A_ = (i) => {
|
|
7156
7157
|
const { lastname: u, username: o, firstname: h } = i;
|
|
7157
7158
|
return u && h ? `${h} ${u}` : o || h || "";
|
|
7158
|
-
},
|
|
7159
|
+
}, E_ = Le.once((i) => ({
|
|
7159
7160
|
findAll: {
|
|
7160
7161
|
createParams(u, o, h, m, A) {
|
|
7161
7162
|
const [S, C] = ym(u), R = {
|
|
@@ -7235,8 +7236,8 @@ const km = (i) => i.split(qv.relatedUid).filter((u) => u && u.length > 0), vv =
|
|
|
7235
7236
|
};
|
|
7236
7237
|
}
|
|
7237
7238
|
}
|
|
7238
|
-
})),
|
|
7239
|
-
const u =
|
|
7239
|
+
})), S_ = ({ strapi: i }) => {
|
|
7240
|
+
const u = E_(i);
|
|
7240
7241
|
return {
|
|
7241
7242
|
getCommonService() {
|
|
7242
7243
|
return ft(i, "common");
|
|
@@ -7485,10 +7486,10 @@ const km = (i) => i.split(qv.relatedUid).filter((u) => u && u.length > 0), vv =
|
|
|
7485
7486
|
throw new An(404, "Not found");
|
|
7486
7487
|
return it(i).create({
|
|
7487
7488
|
data: {
|
|
7488
|
-
content: m,
|
|
7489
|
+
content: this.getCommonService().sanitizeCommentContent(m),
|
|
7489
7490
|
threadOf: o,
|
|
7490
7491
|
authorId: h.id,
|
|
7491
|
-
authorName:
|
|
7492
|
+
authorName: A_(h),
|
|
7492
7493
|
authorEmail: h.email,
|
|
7493
7494
|
related: A.related,
|
|
7494
7495
|
isAdminComment: !0
|
|
@@ -7498,20 +7499,20 @@ const km = (i) => i.split(qv.relatedUid).filter((u) => u && u.length > 0), vv =
|
|
|
7498
7499
|
async updateComment({ id: o, content: h }) {
|
|
7499
7500
|
const m = await it(i).update({
|
|
7500
7501
|
where: { id: o },
|
|
7501
|
-
data: { content: h }
|
|
7502
|
+
data: { content: this.getCommonService().sanitizeCommentContent(h) }
|
|
7502
7503
|
});
|
|
7503
7504
|
if (!m)
|
|
7504
7505
|
throw new An(404, "Not found");
|
|
7505
7506
|
return this.getCommonService().sanitizeCommentEntity(m, []);
|
|
7506
7507
|
}
|
|
7507
7508
|
};
|
|
7508
|
-
},
|
|
7509
|
+
}, T_ = async (i, u) => {
|
|
7509
7510
|
try {
|
|
7510
7511
|
return ol(await i());
|
|
7511
7512
|
} catch {
|
|
7512
7513
|
return uv(u);
|
|
7513
7514
|
}
|
|
7514
|
-
},
|
|
7515
|
+
}, O_ = ({ strapi: i }) => {
|
|
7515
7516
|
const u = async (o, h) => {
|
|
7516
7517
|
if (h)
|
|
7517
7518
|
return {
|
|
@@ -7540,11 +7541,11 @@ const km = (i) => i.split(qv.relatedUid).filter((u) => u && u.length > 0), vv =
|
|
|
7540
7541
|
const Q = (await this.getCommonService().getConfig(oa.APPROVAL_FLOW, [])).includes(N) || U.requireCommentsApproval, $ = await this.getCommonService().getConfig(
|
|
7541
7542
|
oa.AUTHOR_BLOCKED_PROPS,
|
|
7542
7543
|
[]
|
|
7543
|
-
), J = await
|
|
7544
|
+
), J = await T_(
|
|
7544
7545
|
async () => m ? await this.getCommonService().findOne({ id: m, related: o, locale: C || null }) : null,
|
|
7545
7546
|
new fn(400, "Thread does not exist")
|
|
7546
7547
|
);
|
|
7547
|
-
if (
|
|
7548
|
+
if (wy(J))
|
|
7548
7549
|
throw Y(J);
|
|
7549
7550
|
const te = Y(J);
|
|
7550
7551
|
if (!A && !this.getCommonService().isValidUserContext(R))
|
|
@@ -7563,7 +7564,7 @@ const km = (i) => i.split(qv.relatedUid).filter((u) => u && u.length > 0), vv =
|
|
|
7563
7564
|
...ye,
|
|
7564
7565
|
threadOf: m,
|
|
7565
7566
|
locale: C,
|
|
7566
|
-
content: X,
|
|
7567
|
+
content: this.getCommonService().sanitizeCommentContent(X),
|
|
7567
7568
|
related: o,
|
|
7568
7569
|
approvalStatus: Q ? Ui.PENDING : Ui.APPROVED
|
|
7569
7570
|
},
|
|
@@ -7590,7 +7591,7 @@ const km = (i) => i.split(qv.relatedUid).filter((u) => u && u.length > 0), vv =
|
|
|
7590
7591
|
if (N && N.author?.id?.toString() === C?.toString()) {
|
|
7591
7592
|
const O = await it(i).update({
|
|
7592
7593
|
where: { id: o },
|
|
7593
|
-
data: { content: h },
|
|
7594
|
+
data: { content: this.getCommonService().sanitizeCommentContent(h) },
|
|
7594
7595
|
populate: { threadOf: !0, authorUser: { populate: ["avatar"] } }
|
|
7595
7596
|
});
|
|
7596
7597
|
return this.getCommonService().sanitizeCommentEntity(O, R);
|
|
@@ -7745,7 +7746,7 @@ const km = (i) => i.split(qv.relatedUid).filter((u) => u && u.length > 0), vv =
|
|
|
7745
7746
|
}
|
|
7746
7747
|
}
|
|
7747
7748
|
};
|
|
7748
|
-
},
|
|
7749
|
+
}, C_ = 10, I_ = ["id"], R_ = ({ strapi: i }) => ({
|
|
7749
7750
|
async getConfig(u, o, h = !1) {
|
|
7750
7751
|
const m = Mf(i), A = await m.getConfig();
|
|
7751
7752
|
return u && !h ? Le.get(A, u, o) : h ? m.getLocalConfig(u, o) : A;
|
|
@@ -7783,7 +7784,7 @@ const km = (i) => i.split(qv.relatedUid).filter((u) => u && u.length > 0), vv =
|
|
|
7783
7784
|
filters: N = {},
|
|
7784
7785
|
locale: O
|
|
7785
7786
|
}, U) {
|
|
7786
|
-
const M = S.filter((Qe) => !
|
|
7787
|
+
const M = S.filter((Qe) => !I_.includes(Qe)), Q = ["id", "related"].filter((Qe) => !M.includes(Qe)), $ = {
|
|
7787
7788
|
authorUser: {
|
|
7788
7789
|
populate: !0,
|
|
7789
7790
|
avatar: { populate: !0 }
|
|
@@ -7799,7 +7800,7 @@ const km = (i) => i.split(qv.relatedUid).filter((u) => u && u.length > 0), vv =
|
|
|
7799
7800
|
},
|
|
7800
7801
|
populate: $,
|
|
7801
7802
|
...ye,
|
|
7802
|
-
pageSize: R?.pageSize || o ||
|
|
7803
|
+
pageSize: R?.pageSize || o || C_,
|
|
7803
7804
|
page: R?.page || (h ? Math.floor(h / o) : 1) || 1
|
|
7804
7805
|
}, { results: De, pagination: Ge } = await it(i).findWithCount(_e), Ye = await Promise.all(
|
|
7805
7806
|
De.map(async (Qe) => {
|
|
@@ -8091,6 +8092,52 @@ const km = (i) => i.split(qv.relatedUid).filter((u) => u && u.length > 0), vv =
|
|
|
8091
8092
|
}
|
|
8092
8093
|
});
|
|
8093
8094
|
},
|
|
8095
|
+
sanitizeCommentContent(u) {
|
|
8096
|
+
return Iv(u, {
|
|
8097
|
+
allowedTags: [
|
|
8098
|
+
"p",
|
|
8099
|
+
"br",
|
|
8100
|
+
"hr",
|
|
8101
|
+
"div",
|
|
8102
|
+
"span",
|
|
8103
|
+
"h1",
|
|
8104
|
+
"h2",
|
|
8105
|
+
"h3",
|
|
8106
|
+
"h4",
|
|
8107
|
+
"h5",
|
|
8108
|
+
"h6",
|
|
8109
|
+
"strong",
|
|
8110
|
+
"i",
|
|
8111
|
+
"em",
|
|
8112
|
+
"del",
|
|
8113
|
+
"blockquote",
|
|
8114
|
+
"ul",
|
|
8115
|
+
"ol",
|
|
8116
|
+
"li",
|
|
8117
|
+
"pre",
|
|
8118
|
+
"code",
|
|
8119
|
+
"a",
|
|
8120
|
+
"img",
|
|
8121
|
+
"table",
|
|
8122
|
+
"thead",
|
|
8123
|
+
"tbody",
|
|
8124
|
+
"tr",
|
|
8125
|
+
"th",
|
|
8126
|
+
"td",
|
|
8127
|
+
"video",
|
|
8128
|
+
"audio",
|
|
8129
|
+
"source"
|
|
8130
|
+
],
|
|
8131
|
+
allowedAttributes: {
|
|
8132
|
+
"*": ["href", "align", "alt", "center", "width", "height", "type", "controls", "target"],
|
|
8133
|
+
img: ["src", "alt"],
|
|
8134
|
+
source: ["src", "type"],
|
|
8135
|
+
video: ["src", "controls", "width", "height"],
|
|
8136
|
+
audio: ["src", "controls"]
|
|
8137
|
+
},
|
|
8138
|
+
allowedSchemes: ["http", "https", "mailto"]
|
|
8139
|
+
});
|
|
8140
|
+
},
|
|
8094
8141
|
registerLifecycleHook() {
|
|
8095
8142
|
},
|
|
8096
8143
|
async runLifecycleHook() {
|
|
@@ -11235,7 +11282,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
11235
11282
|
Hn ? ((Hn.exports = mn)._ = mn, Pa._ = mn) : at._ = mn;
|
|
11236
11283
|
}).call(Rr);
|
|
11237
11284
|
})(xf, xf.exports);
|
|
11238
|
-
var
|
|
11285
|
+
var x_ = xf.exports, yv = {};
|
|
11239
11286
|
(function(i) {
|
|
11240
11287
|
i.aliasToReal = {
|
|
11241
11288
|
// Lodash aliases.
|
|
@@ -11739,8 +11786,8 @@ var R_ = xf.exports, yv = {};
|
|
|
11739
11786
|
zipObjectDeep: !0
|
|
11740
11787
|
};
|
|
11741
11788
|
})(yv);
|
|
11742
|
-
var
|
|
11743
|
-
function
|
|
11789
|
+
var N_ = {}, ct = yv, L_ = N_, Gm = Array.prototype.push;
|
|
11790
|
+
function D_(i, u) {
|
|
11744
11791
|
return u == 2 ? function(o, h) {
|
|
11745
11792
|
return i.apply(void 0, arguments);
|
|
11746
11793
|
} : function(o) {
|
|
@@ -11759,12 +11806,12 @@ function zm(i) {
|
|
|
11759
11806
|
o[u] = i[u];
|
|
11760
11807
|
return o;
|
|
11761
11808
|
}
|
|
11762
|
-
function
|
|
11809
|
+
function P_(i) {
|
|
11763
11810
|
return function(u) {
|
|
11764
11811
|
return i({}, u);
|
|
11765
11812
|
};
|
|
11766
11813
|
}
|
|
11767
|
-
function
|
|
11814
|
+
function F_(i, u) {
|
|
11768
11815
|
return function() {
|
|
11769
11816
|
for (var o = arguments.length, h = o - 1, m = Array(o); o--; )
|
|
11770
11817
|
m[o] = arguments[o];
|
|
@@ -11794,7 +11841,7 @@ function Tm(i, u, o, h) {
|
|
|
11794
11841
|
fixed: "fixed" in h ? h.fixed : !0,
|
|
11795
11842
|
immutable: "immutable" in h ? h.immutable : !0,
|
|
11796
11843
|
rearg: "rearg" in h ? h.rearg : !0
|
|
11797
|
-
}, C = m ? o :
|
|
11844
|
+
}, C = m ? o : L_, R = "curry" in h && h.curry, N = "fixed" in h && h.fixed, O = "rearg" in h && h.rearg, U = m ? o.runInContext() : void 0, M = m ? o : {
|
|
11798
11845
|
ary: i.ary,
|
|
11799
11846
|
assign: i.assign,
|
|
11800
11847
|
clone: i.clone,
|
|
@@ -11871,7 +11918,7 @@ function Tm(i, u, o, h) {
|
|
|
11871
11918
|
function fr(z, B, G) {
|
|
11872
11919
|
if (S.fixed && (N || !ct.skipFixed[z])) {
|
|
11873
11920
|
var q = ct.methodSpread[z], re = q && q.start;
|
|
11874
|
-
return re === void 0 ? Q(B, G) :
|
|
11921
|
+
return re === void 0 ? Q(B, G) : F_(B, re);
|
|
11875
11922
|
}
|
|
11876
11923
|
return B;
|
|
11877
11924
|
}
|
|
@@ -11904,7 +11951,7 @@ function Tm(i, u, o, h) {
|
|
|
11904
11951
|
function ei(z, B) {
|
|
11905
11952
|
return Wt(z, function(G) {
|
|
11906
11953
|
var q = B.length;
|
|
11907
|
-
return
|
|
11954
|
+
return D_(We(gm(G, q), B), q);
|
|
11908
11955
|
});
|
|
11909
11956
|
}
|
|
11910
11957
|
function Wt(z, B) {
|
|
@@ -11920,7 +11967,7 @@ function Tm(i, u, o, h) {
|
|
|
11920
11967
|
}
|
|
11921
11968
|
function xo(z, B, G) {
|
|
11922
11969
|
var q, re = ct.aliasToReal[z] || z, ot = B, wt = En[re];
|
|
11923
|
-
return wt ? ot = wt(B) : S.immutable && (ct.mutate.array[re] ? ot = mm(B, zm) : ct.mutate.object[re] ? ot = mm(B,
|
|
11970
|
+
return wt ? ot = wt(B) : S.immutable && (ct.mutate.array[re] ? ot = mm(B, zm) : ct.mutate.object[re] ? ot = mm(B, P_(B)) : ct.mutate.set[re] && (ot = mm(B, Bi))), X(Qe, function(ut) {
|
|
11924
11971
|
return X(ct.aryMethod[ut], function(Ke) {
|
|
11925
11972
|
if (re == Ke) {
|
|
11926
11973
|
var Pe = ct.methodSpread[re], hr = Pe && Pe.afterRearg;
|
|
@@ -11955,7 +12002,7 @@ function Tm(i, u, o, h) {
|
|
|
11955
12002
|
});
|
|
11956
12003
|
}), ze;
|
|
11957
12004
|
}
|
|
11958
|
-
var
|
|
12005
|
+
var U_ = Tm, qm = x_.runInContext(), rl = U_(qm, qm), Ie;
|
|
11959
12006
|
(function(i) {
|
|
11960
12007
|
i.Arg = "Arg", i.DynamicInput = "DynamicInput", i.DynamicOutputMethod = "DynamicOutputMethod", i.DynamicOutputProperty = "DynamicOutputProperty", i.Enum = "Enum", i.ExtendInputObject = "ExtendInputObject", i.ExtendObject = "ExtendObject", i.InputField = "InputField", i.InputObject = "InputObject", i.Interface = "Interface", i.List = "List", i.NonNull = "NonNull", i.Null = "Null", i.Object = "Object", i.OutputField = "OutputField", i.Plugin = "Plugin", i.PrintedGenTyping = "PrintedGenTyping", i.PrintedGenTypingImport = "PrintedGenTypingImport", i.Scalar = "Scalar", i.Union = "Union";
|
|
11961
12008
|
})(Ie || (Ie = {}));
|
|
@@ -11963,7 +12010,7 @@ const Wf = Symbol.for("@nexus/wrapped");
|
|
|
11963
12010
|
function bt(i, u) {
|
|
11964
12011
|
i.prototype[Wf] = u;
|
|
11965
12012
|
}
|
|
11966
|
-
class
|
|
12013
|
+
class M_ {
|
|
11967
12014
|
constructor(u, o) {
|
|
11968
12015
|
this.name = u, this.config = o, Wi(u);
|
|
11969
12016
|
}
|
|
@@ -11971,8 +12018,8 @@ class U_ {
|
|
|
11971
12018
|
return this.config;
|
|
11972
12019
|
}
|
|
11973
12020
|
}
|
|
11974
|
-
bt(
|
|
11975
|
-
class
|
|
12021
|
+
bt(M_, Ie.Interface);
|
|
12022
|
+
class W_ {
|
|
11976
12023
|
constructor(u, o) {
|
|
11977
12024
|
this.name = u, this.config = o, Wi(u);
|
|
11978
12025
|
}
|
|
@@ -11980,8 +12027,8 @@ class M_ {
|
|
|
11980
12027
|
return this.config;
|
|
11981
12028
|
}
|
|
11982
12029
|
}
|
|
11983
|
-
bt(
|
|
11984
|
-
class
|
|
12030
|
+
bt(W_, Ie.Object);
|
|
12031
|
+
class B_ {
|
|
11985
12032
|
constructor(u, o) {
|
|
11986
12033
|
this.name = u, this.config = o, Wi(u);
|
|
11987
12034
|
}
|
|
@@ -11989,34 +12036,34 @@ class W_ {
|
|
|
11989
12036
|
return this.config;
|
|
11990
12037
|
}
|
|
11991
12038
|
}
|
|
11992
|
-
bt(
|
|
11993
|
-
function
|
|
12039
|
+
bt(B_, Ie.Union);
|
|
12040
|
+
function j_(i, u) {
|
|
11994
12041
|
var o;
|
|
11995
12042
|
return i.extensions = Object.assign(Object.assign({}, i.extensions), { nexus: Object.assign(Object.assign({}, Object((o = i.extensions) === null || o === void 0 ? void 0 : o.nexus)), u) }), i;
|
|
11996
12043
|
}
|
|
11997
|
-
const Nf = Symbol.for("@nexus/meta/NEXUS_TYPE"),
|
|
11998
|
-
function $_(i) {
|
|
11999
|
-
return !!(i && typeof sl.get(i, j_) == "function");
|
|
12000
|
-
}
|
|
12044
|
+
const Nf = Symbol.for("@nexus/meta/NEXUS_TYPE"), $_ = Symbol.for("@nexus/meta/NEXUS_BUILD");
|
|
12001
12045
|
function k_(i) {
|
|
12002
|
-
return
|
|
12046
|
+
return !!(i && typeof sl.get(i, $_) == "function");
|
|
12003
12047
|
}
|
|
12004
12048
|
function V_(i) {
|
|
12049
|
+
return G_(i) || _v(i);
|
|
12050
|
+
}
|
|
12051
|
+
function G_(i) {
|
|
12005
12052
|
return !!(i && sl.has(i, Nf) && la(sl.get(i, Nf)));
|
|
12006
12053
|
}
|
|
12007
12054
|
function _v(i) {
|
|
12008
12055
|
return !!(i && sl.has(i, Nf) && typeof sl.get(i, Nf) == "function");
|
|
12009
12056
|
}
|
|
12010
12057
|
function Nm(i) {
|
|
12011
|
-
return
|
|
12058
|
+
return k_(i) || V_(i) || _v(i);
|
|
12012
12059
|
}
|
|
12013
|
-
class
|
|
12060
|
+
class z_ {
|
|
12014
12061
|
constructor(u) {
|
|
12015
12062
|
this.config = u;
|
|
12016
12063
|
}
|
|
12017
12064
|
}
|
|
12018
|
-
bt(
|
|
12019
|
-
class
|
|
12065
|
+
bt(z_, Ie.PrintedGenTypingImport);
|
|
12066
|
+
class q_ {
|
|
12020
12067
|
constructor(u) {
|
|
12021
12068
|
this.config = u;
|
|
12022
12069
|
}
|
|
@@ -12035,8 +12082,8 @@ ${this.config.description.split(`
|
|
|
12035
12082
|
return u += `${o}: ${this.config.type}`, u;
|
|
12036
12083
|
}
|
|
12037
12084
|
}
|
|
12038
|
-
bt(
|
|
12039
|
-
|
|
12085
|
+
bt(q_, Ie.PrintedGenTyping);
|
|
12086
|
+
j_(new tv({
|
|
12040
12087
|
name: "NEXUS__UNKNOWN__TYPE",
|
|
12041
12088
|
description: `
|
|
12042
12089
|
This scalar should never make it into production. It is used as a placeholder for situations
|
|
@@ -12087,13 +12134,13 @@ function wv(i) {
|
|
|
12087
12134
|
function jf(i) {
|
|
12088
12135
|
return Bf(Object.assign({ type: "Int" }, i));
|
|
12089
12136
|
}
|
|
12090
|
-
class
|
|
12137
|
+
class H_ {
|
|
12091
12138
|
constructor(u) {
|
|
12092
12139
|
if (this.ofNexusType = u, this._isNexusListDef = !0, typeof u != "string" && !la(u) && !Nm(u) && !ll(u))
|
|
12093
12140
|
throw new Error("Cannot wrap unknown types in list(). Saw " + u);
|
|
12094
12141
|
}
|
|
12095
12142
|
}
|
|
12096
|
-
bt(
|
|
12143
|
+
bt(H_, Ie.List);
|
|
12097
12144
|
class Om {
|
|
12098
12145
|
constructor(u) {
|
|
12099
12146
|
if (this.ofNexusType = u, this._isNexusNonNullDef = !0, typeof u != "string" && !la(u) && !Nm(u) && !ll(u))
|
|
@@ -12124,13 +12171,13 @@ function Ev(i) {
|
|
|
12124
12171
|
function Sv(i) {
|
|
12125
12172
|
return la(i) && i[Wf] === Ie.Null;
|
|
12126
12173
|
}
|
|
12127
|
-
class
|
|
12174
|
+
class Y_ {
|
|
12128
12175
|
constructor(u) {
|
|
12129
12176
|
this.config = u;
|
|
12130
12177
|
}
|
|
12131
12178
|
}
|
|
12132
|
-
bt(
|
|
12133
|
-
class
|
|
12179
|
+
bt(Y_, Ie.Plugin);
|
|
12180
|
+
class Q_ {
|
|
12134
12181
|
constructor(u, o) {
|
|
12135
12182
|
this.name = u, this.config = o;
|
|
12136
12183
|
}
|
|
@@ -12138,8 +12185,8 @@ class Y_ {
|
|
|
12138
12185
|
return this.config;
|
|
12139
12186
|
}
|
|
12140
12187
|
}
|
|
12141
|
-
bt(
|
|
12142
|
-
class
|
|
12188
|
+
bt(Q_, Ie.DynamicInput);
|
|
12189
|
+
class J_ {
|
|
12143
12190
|
constructor(u, o) {
|
|
12144
12191
|
this.name = u, this.config = o;
|
|
12145
12192
|
}
|
|
@@ -12147,21 +12194,21 @@ class Q_ {
|
|
|
12147
12194
|
return this.config;
|
|
12148
12195
|
}
|
|
12149
12196
|
}
|
|
12150
|
-
bt(
|
|
12151
|
-
const
|
|
12197
|
+
bt(J_, Ie.DynamicOutputMethod);
|
|
12198
|
+
const X_ = {
|
|
12152
12199
|
first: Lf(jf({ description: "Returns the first n elements from the list." })),
|
|
12153
12200
|
after: Lf(wv({ description: "Returns the elements in the list that come after the specified cursor" }))
|
|
12154
12201
|
};
|
|
12155
|
-
Object.assign(Object.assign({},
|
|
12156
|
-
const
|
|
12202
|
+
Object.assign(Object.assign({}, X_), { first: Av(jf({ description: "Returns the first n elements from the list." })) });
|
|
12203
|
+
const Z_ = {
|
|
12157
12204
|
last: Lf(jf({ description: "Returns the last n elements from the list." })),
|
|
12158
12205
|
before: Lf(wv({ description: "Returns the elements in the list that come before the specified cursor" }))
|
|
12159
12206
|
};
|
|
12160
|
-
Object.assign(Object.assign({},
|
|
12207
|
+
Object.assign(Object.assign({}, Z_), { last: Av(jf({ description: "Returns the last n elements from the list." })) });
|
|
12161
12208
|
var Df = typeof Symbol == "function" ? Symbol : void 0;
|
|
12162
12209
|
Df && Df.iterator;
|
|
12163
12210
|
Df && Df.asyncIterator;
|
|
12164
|
-
class
|
|
12211
|
+
class K_ {
|
|
12165
12212
|
constructor(u, o) {
|
|
12166
12213
|
this.name = u, this.config = o, Wi(u);
|
|
12167
12214
|
}
|
|
@@ -12180,7 +12227,7 @@ class Z_ {
|
|
|
12180
12227
|
return Bf(Object.assign(Object.assign({}, u), { type: this }));
|
|
12181
12228
|
}
|
|
12182
12229
|
}
|
|
12183
|
-
bt(
|
|
12230
|
+
bt(K_, Ie.Enum);
|
|
12184
12231
|
class Tv {
|
|
12185
12232
|
constructor(u, o) {
|
|
12186
12233
|
this.name = u, this.config = o, Wi(u);
|
|
@@ -12201,10 +12248,10 @@ class Tv {
|
|
|
12201
12248
|
}
|
|
12202
12249
|
}
|
|
12203
12250
|
bt(Tv, Ie.InputObject);
|
|
12204
|
-
function
|
|
12251
|
+
function e1(i) {
|
|
12205
12252
|
return new Tv(i.name, i);
|
|
12206
12253
|
}
|
|
12207
|
-
class
|
|
12254
|
+
class t1 {
|
|
12208
12255
|
constructor(u, o) {
|
|
12209
12256
|
this.name = u, this.config = o, Wi(u);
|
|
12210
12257
|
}
|
|
@@ -12212,8 +12259,8 @@ class e1 {
|
|
|
12212
12259
|
return this.config;
|
|
12213
12260
|
}
|
|
12214
12261
|
}
|
|
12215
|
-
bt(
|
|
12216
|
-
class
|
|
12262
|
+
bt(t1, Ie.Scalar);
|
|
12263
|
+
class n1 {
|
|
12217
12264
|
constructor(u, o) {
|
|
12218
12265
|
this.name = u, this.config = o, Wi(u);
|
|
12219
12266
|
}
|
|
@@ -12221,8 +12268,8 @@ class t1 {
|
|
|
12221
12268
|
return this.config;
|
|
12222
12269
|
}
|
|
12223
12270
|
}
|
|
12224
|
-
bt(
|
|
12225
|
-
class
|
|
12271
|
+
bt(n1, Ie.ExtendInputObject);
|
|
12272
|
+
class r1 {
|
|
12226
12273
|
constructor(u, o) {
|
|
12227
12274
|
this.name = u, this.config = o, Wi(u);
|
|
12228
12275
|
}
|
|
@@ -12230,8 +12277,8 @@ class n1 {
|
|
|
12230
12277
|
return this.config;
|
|
12231
12278
|
}
|
|
12232
12279
|
}
|
|
12233
|
-
bt(
|
|
12234
|
-
class
|
|
12280
|
+
bt(r1, Ie.ExtendObject);
|
|
12281
|
+
class i1 {
|
|
12235
12282
|
constructor(u, o) {
|
|
12236
12283
|
this.name = u, this.config = o;
|
|
12237
12284
|
}
|
|
@@ -12239,16 +12286,16 @@ class r1 {
|
|
|
12239
12286
|
return this.config;
|
|
12240
12287
|
}
|
|
12241
12288
|
}
|
|
12242
|
-
bt(
|
|
12243
|
-
const Hm = ["id"],
|
|
12289
|
+
bt(i1, Ie.DynamicOutputProperty);
|
|
12290
|
+
const Hm = ["id"], o1 = (i, u, o) => {
|
|
12244
12291
|
const { naming: h, mappers: m } = strapi.plugin("graphql").service("utils"), A = m.strapiScalarToGraphQLScalar(o.type);
|
|
12245
12292
|
i.field(u, {
|
|
12246
12293
|
type: h.getScalarFilterInputTypeName(A)
|
|
12247
12294
|
});
|
|
12248
|
-
},
|
|
12295
|
+
}, u1 = (i, u, o) => {
|
|
12249
12296
|
const h = strapi.plugin("graphql").service("utils"), m = strapi.plugin("graphql").service("extension"), { getFiltersInputTypeName: A } = h.naming, { isMorphRelation: S } = h.attributes, C = strapi.getModel(o.target);
|
|
12250
12297
|
!C || S(o) || m.shadowCRUD(C.uid).isDisabled() || i.field(u, { type: A(C) });
|
|
12251
|
-
},
|
|
12298
|
+
}, a1 = ({ strapi: i }) => {
|
|
12252
12299
|
const { service: u } = i.plugin("graphql"), o = (A) => {
|
|
12253
12300
|
const { operators: S } = u("builders").filters;
|
|
12254
12301
|
if (Array.isArray(A))
|
|
@@ -12298,7 +12345,7 @@ const Hm = ["id"], i1 = (i, u, o) => {
|
|
|
12298
12345
|
graphQLFiltersToStrapiQuery: m,
|
|
12299
12346
|
buildContentTypeFilters(A) {
|
|
12300
12347
|
const S = i.plugin("graphql").service("utils"), C = i.plugin("graphql").service("extension"), { getFiltersInputTypeName: R, getScalarFilterInputTypeName: N } = S.naming, { isStrapiScalar: O, isRelation: U } = S.attributes, { attributes: M } = A, Q = R(A);
|
|
12301
|
-
return
|
|
12348
|
+
return e1({
|
|
12302
12349
|
name: Q,
|
|
12303
12350
|
definition($) {
|
|
12304
12351
|
const J = Object.entries(M).filter(
|
|
@@ -12306,14 +12353,14 @@ const Hm = ["id"], i1 = (i, u, o) => {
|
|
|
12306
12353
|
), te = C.shadowCRUD(A.uid).field("id").hasFiltersEnabeld();
|
|
12307
12354
|
A.kind === "collectionType" && te && $.field("id", { type: N("ID") });
|
|
12308
12355
|
for (const [X, ye] of J)
|
|
12309
|
-
O(ye) ?
|
|
12356
|
+
O(ye) ? o1($, X, ye) : U(ye) && u1($, X, ye);
|
|
12310
12357
|
for (const X of h())
|
|
12311
12358
|
X.add($, Q);
|
|
12312
12359
|
}
|
|
12313
12360
|
});
|
|
12314
12361
|
}
|
|
12315
12362
|
};
|
|
12316
|
-
},
|
|
12363
|
+
}, s1 = ({ strapi: i }) => {
|
|
12317
12364
|
const u = Mf(i);
|
|
12318
12365
|
return {
|
|
12319
12366
|
getConfig: async (o = !1) => {
|
|
@@ -12336,21 +12383,21 @@ const Hm = ["id"], i1 = (i, u, o) => {
|
|
|
12336
12383
|
},
|
|
12337
12384
|
restart: () => i.reload()
|
|
12338
12385
|
};
|
|
12339
|
-
},
|
|
12340
|
-
admin:
|
|
12341
|
-
client:
|
|
12342
|
-
common:
|
|
12343
|
-
settings:
|
|
12344
|
-
gql:
|
|
12345
|
-
},
|
|
12346
|
-
register:
|
|
12347
|
-
bootstrap:
|
|
12348
|
-
config:
|
|
12349
|
-
controllers:
|
|
12350
|
-
routes:
|
|
12351
|
-
services:
|
|
12352
|
-
contentTypes:
|
|
12386
|
+
}, l1 = {
|
|
12387
|
+
admin: S_,
|
|
12388
|
+
client: O_,
|
|
12389
|
+
common: R_,
|
|
12390
|
+
settings: s1,
|
|
12391
|
+
gql: a1
|
|
12392
|
+
}, g1 = {
|
|
12393
|
+
register: Wv,
|
|
12394
|
+
bootstrap: vy,
|
|
12395
|
+
config: by,
|
|
12396
|
+
controllers: m_,
|
|
12397
|
+
routes: w_,
|
|
12398
|
+
services: l1,
|
|
12399
|
+
contentTypes: Pv
|
|
12353
12400
|
};
|
|
12354
12401
|
export {
|
|
12355
|
-
|
|
12402
|
+
g1 as default
|
|
12356
12403
|
};
|