@strapi/plugin-graphql 5.50.1 → 5.51.0

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.
Files changed (28) hide show
  1. package/dist/admin/index.js +1 -0
  2. package/dist/admin/index.js.map +1 -1
  3. package/dist/admin/index.mjs +1 -0
  4. package/dist/admin/index.mjs.map +1 -1
  5. package/dist/admin/translations/ko.json.js +10 -0
  6. package/dist/admin/translations/ko.json.js.map +1 -0
  7. package/dist/admin/translations/ko.json.mjs +8 -0
  8. package/dist/admin/translations/ko.json.mjs.map +1 -0
  9. package/dist/server/services/builders/input.js +1 -2
  10. package/dist/server/services/builders/input.js.map +1 -1
  11. package/dist/server/services/builders/input.mjs +1 -2
  12. package/dist/server/services/builders/input.mjs.map +1 -1
  13. package/dist/server/src/index.d.ts +42 -42
  14. package/dist/server/src/index.d.ts.map +1 -1
  15. package/dist/server/src/services/builders/filters/index.d.ts +1 -1
  16. package/dist/server/src/services/builders/index.d.ts +5 -5
  17. package/dist/server/src/services/builders/input.d.ts.map +1 -1
  18. package/dist/server/src/services/builders/mutations/index.d.ts +2 -2
  19. package/dist/server/src/services/builders/queries/index.d.ts +2 -2
  20. package/dist/server/src/services/builders/resolvers/index.d.ts +7 -7
  21. package/dist/server/src/services/builders/resolvers/query.d.ts +3 -3
  22. package/dist/server/src/services/builders/utils.d.ts +1 -1
  23. package/dist/server/src/services/index.d.ts +42 -42
  24. package/dist/server/src/services/index.d.ts.map +1 -1
  25. package/dist/server/src/services/utils/index.d.ts +34 -34
  26. package/dist/server/src/services/utils/index.d.ts.map +1 -1
  27. package/dist/server/src/services/utils/mappers/index.d.ts +7 -7
  28. package/package.json +14 -9
@@ -13,6 +13,7 @@ function __variableDynamicImportRuntime0__(path) {
13
13
  case './translations/en.json': return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespaceDefaultOnly(require('./translations/en.json.js')); });
14
14
  case './translations/es.json': return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespaceDefaultOnly(require('./translations/es.json.js')); });
15
15
  case './translations/fr.json': return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespaceDefaultOnly(require('./translations/fr.json.js')); });
16
+ case './translations/ko.json': return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespaceDefaultOnly(require('./translations/ko.json.js')); });
16
17
  case './translations/pl.json': return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespaceDefaultOnly(require('./translations/pl.json.js')); });
17
18
  case './translations/ru.json': return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespaceDefaultOnly(require('./translations/ru.json.js')); });
18
19
  case './translations/sk.json': return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespaceDefaultOnly(require('./translations/sk.json.js')); });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../admin/src/index.ts"],"sourcesContent":["import pluginPkg from '../../package.json';\n\nimport { pluginId } from './pluginId';\nimport { prefixPluginTranslations } from './utils/prefixPluginTranslations';\n\nimport type { StrapiApp } from '@strapi/admin/strapi-admin';\n\nconst name = pluginPkg.strapi.name;\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n register(app: StrapiApp) {\n app.registerPlugin({\n id: pluginId,\n name,\n });\n },\n bootstrap() {},\n async registerTrads({ locales }: { locales: string[] }) {\n const importedTrads = await Promise.all(\n locales.map((locale) => {\n return import(`./translations/${locale}.json`)\n .then(({ default: data }) => {\n return {\n data: prefixPluginTranslations(data, pluginId),\n locale,\n };\n })\n .catch(() => {\n return {\n data: {},\n locale,\n };\n });\n })\n );\n\n return Promise.resolve(importedTrads);\n },\n};\n"],"names":["name","pluginPkg","strapi","register","app","registerPlugin","id","pluginId","bootstrap","registerTrads","locales","importedTrads","Promise","all","map","locale","then","default","data","prefixPluginTranslations","catch","resolve"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,MAAMA,IAAAA,GAAOC,gBAAAA,CAAUC,MAAM,CAACF,IAAI;AAElC;AACA,YAAe;AACbG,IAAAA,QAAAA,CAAAA,CAASC,GAAc,EAAA;AACrBA,QAAAA,GAAAA,CAAIC,cAAc,CAAC;YACjBC,EAAAA,EAAIC,iBAAAA;AACJP,YAAAA;AACF,SAAA,CAAA;AACF,IAAA,CAAA;IACAQ,SAAAA,CAAAA,GAAAA,CAAa,CAAA;IACb,MAAMC,aAAAA,CAAAA,CAAc,EAAEC,OAAO,EAAyB,EAAA;QACpD,MAAMC,aAAAA,GAAgB,MAAMC,OAAAA,CAAQC,GAAG,CACrCH,OAAAA,CAAQI,GAAG,CAAC,CAACC,MAAAA,GAAAA;AACX,YAAA,OAAO,iCAAM,CAAC,CAAC,eAAe,EAAEA,MAAAA,CAAO,KAAK,CAAC,CAAA,CAC1CC,IAAI,CAAC,CAAC,EAAEC,OAAAA,EAASC,IAAI,EAAE,GAAA;gBACtB,OAAO;AACLA,oBAAAA,IAAAA,EAAMC,kDAAyBD,IAAAA,EAAMX,iBAAAA,CAAAA;AACrCQ,oBAAAA;AACF,iBAAA;AACF,YAAA,CAAA,CAAA,CACCK,KAAK,CAAC,IAAA;gBACL,OAAO;AACLF,oBAAAA,IAAAA,EAAM,EAAC;AACPH,oBAAAA;AACF,iBAAA;AACF,YAAA,CAAA,CAAA;AACJ,QAAA,CAAA,CAAA,CAAA;QAGF,OAAOH,OAAAA,CAAQS,OAAO,CAACV,aAAAA,CAAAA;AACzB,IAAA;AACF,CAAA;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../admin/src/index.ts"],"sourcesContent":["import pluginPkg from '../../package.json';\n\nimport { pluginId } from './pluginId';\nimport { prefixPluginTranslations } from './utils/prefixPluginTranslations';\n\nimport type { StrapiApp } from '@strapi/admin/strapi-admin';\n\nconst name = pluginPkg.strapi.name;\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n register(app: StrapiApp) {\n app.registerPlugin({\n id: pluginId,\n name,\n });\n },\n bootstrap() {},\n async registerTrads({ locales }: { locales: string[] }) {\n const importedTrads = await Promise.all(\n locales.map((locale) => {\n return import(`./translations/${locale}.json`)\n .then(({ default: data }) => {\n return {\n data: prefixPluginTranslations(data, pluginId),\n locale,\n };\n })\n .catch(() => {\n return {\n data: {},\n locale,\n };\n });\n })\n );\n\n return Promise.resolve(importedTrads);\n },\n};\n"],"names":["name","pluginPkg","strapi","register","app","registerPlugin","id","pluginId","bootstrap","registerTrads","locales","importedTrads","Promise","all","map","locale","then","default","data","prefixPluginTranslations","catch","resolve"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,MAAMA,IAAAA,GAAOC,gBAAAA,CAAUC,MAAM,CAACF,IAAI;AAElC;AACA,YAAe;AACbG,IAAAA,QAAAA,CAAAA,CAASC,GAAc,EAAA;AACrBA,QAAAA,GAAAA,CAAIC,cAAc,CAAC;YACjBC,EAAAA,EAAIC,iBAAAA;AACJP,YAAAA;AACF,SAAA,CAAA;AACF,IAAA,CAAA;IACAQ,SAAAA,CAAAA,GAAAA,CAAa,CAAA;IACb,MAAMC,aAAAA,CAAAA,CAAc,EAAEC,OAAO,EAAyB,EAAA;QACpD,MAAMC,aAAAA,GAAgB,MAAMC,OAAAA,CAAQC,GAAG,CACrCH,OAAAA,CAAQI,GAAG,CAAC,CAACC,MAAAA,GAAAA;AACX,YAAA,OAAO,iCAAM,CAAC,CAAC,eAAe,EAAEA,MAAAA,CAAO,KAAK,CAAC,CAAA,CAC1CC,IAAI,CAAC,CAAC,EAAEC,OAAAA,EAASC,IAAI,EAAE,GAAA;gBACtB,OAAO;AACLA,oBAAAA,IAAAA,EAAMC,kDAAyBD,IAAAA,EAAMX,iBAAAA,CAAAA;AACrCQ,oBAAAA;AACF,iBAAA;AACF,YAAA,CAAA,CAAA,CACCK,KAAK,CAAC,IAAA;gBACL,OAAO;AACLF,oBAAAA,IAAAA,EAAM,EAAC;AACPH,oBAAAA;AACF,iBAAA;AACF,YAAA,CAAA,CAAA;AACJ,QAAA,CAAA,CAAA,CAAA;QAGF,OAAOH,OAAAA,CAAQS,OAAO,CAACV,aAAAA,CAAAA;AACzB,IAAA;AACF,CAAA;;;;"}
@@ -9,6 +9,7 @@ function __variableDynamicImportRuntime0__(path) {
9
9
  case './translations/en.json': return import('./translations/en.json.mjs');
10
10
  case './translations/es.json': return import('./translations/es.json.mjs');
11
11
  case './translations/fr.json': return import('./translations/fr.json.mjs');
12
+ case './translations/ko.json': return import('./translations/ko.json.mjs');
12
13
  case './translations/pl.json': return import('./translations/pl.json.mjs');
13
14
  case './translations/ru.json': return import('./translations/ru.json.mjs');
14
15
  case './translations/sk.json': return import('./translations/sk.json.mjs');
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../admin/src/index.ts"],"sourcesContent":["import pluginPkg from '../../package.json';\n\nimport { pluginId } from './pluginId';\nimport { prefixPluginTranslations } from './utils/prefixPluginTranslations';\n\nimport type { StrapiApp } from '@strapi/admin/strapi-admin';\n\nconst name = pluginPkg.strapi.name;\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n register(app: StrapiApp) {\n app.registerPlugin({\n id: pluginId,\n name,\n });\n },\n bootstrap() {},\n async registerTrads({ locales }: { locales: string[] }) {\n const importedTrads = await Promise.all(\n locales.map((locale) => {\n return import(`./translations/${locale}.json`)\n .then(({ default: data }) => {\n return {\n data: prefixPluginTranslations(data, pluginId),\n locale,\n };\n })\n .catch(() => {\n return {\n data: {},\n locale,\n };\n });\n })\n );\n\n return Promise.resolve(importedTrads);\n },\n};\n"],"names":["name","pluginPkg","strapi","register","app","registerPlugin","id","pluginId","bootstrap","registerTrads","locales","importedTrads","Promise","all","map","locale","then","default","data","prefixPluginTranslations","catch","resolve"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,MAAMA,IAAAA,GAAOC,SAAAA,CAAUC,MAAM,CAACF,IAAI;AAElC;AACA,YAAe;AACbG,IAAAA,QAAAA,CAAAA,CAASC,GAAc,EAAA;AACrBA,QAAAA,GAAAA,CAAIC,cAAc,CAAC;YACjBC,EAAAA,EAAIC,QAAAA;AACJP,YAAAA;AACF,SAAA,CAAA;AACF,IAAA,CAAA;IACAQ,SAAAA,CAAAA,GAAAA,CAAa,CAAA;IACb,MAAMC,aAAAA,CAAAA,CAAc,EAAEC,OAAO,EAAyB,EAAA;QACpD,MAAMC,aAAAA,GAAgB,MAAMC,OAAAA,CAAQC,GAAG,CACrCH,OAAAA,CAAQI,GAAG,CAAC,CAACC,MAAAA,GAAAA;AACX,YAAA,OAAO,iCAAM,CAAC,CAAC,eAAe,EAAEA,MAAAA,CAAO,KAAK,CAAC,CAAA,CAC1CC,IAAI,CAAC,CAAC,EAAEC,OAAAA,EAASC,IAAI,EAAE,GAAA;gBACtB,OAAO;AACLA,oBAAAA,IAAAA,EAAMC,yBAAyBD,IAAAA,EAAMX,QAAAA,CAAAA;AACrCQ,oBAAAA;AACF,iBAAA;AACF,YAAA,CAAA,CAAA,CACCK,KAAK,CAAC,IAAA;gBACL,OAAO;AACLF,oBAAAA,IAAAA,EAAM,EAAC;AACPH,oBAAAA;AACF,iBAAA;AACF,YAAA,CAAA,CAAA;AACJ,QAAA,CAAA,CAAA,CAAA;QAGF,OAAOH,OAAAA,CAAQS,OAAO,CAACV,aAAAA,CAAAA;AACzB,IAAA;AACF,CAAA;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../admin/src/index.ts"],"sourcesContent":["import pluginPkg from '../../package.json';\n\nimport { pluginId } from './pluginId';\nimport { prefixPluginTranslations } from './utils/prefixPluginTranslations';\n\nimport type { StrapiApp } from '@strapi/admin/strapi-admin';\n\nconst name = pluginPkg.strapi.name;\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n register(app: StrapiApp) {\n app.registerPlugin({\n id: pluginId,\n name,\n });\n },\n bootstrap() {},\n async registerTrads({ locales }: { locales: string[] }) {\n const importedTrads = await Promise.all(\n locales.map((locale) => {\n return import(`./translations/${locale}.json`)\n .then(({ default: data }) => {\n return {\n data: prefixPluginTranslations(data, pluginId),\n locale,\n };\n })\n .catch(() => {\n return {\n data: {},\n locale,\n };\n });\n })\n );\n\n return Promise.resolve(importedTrads);\n },\n};\n"],"names":["name","pluginPkg","strapi","register","app","registerPlugin","id","pluginId","bootstrap","registerTrads","locales","importedTrads","Promise","all","map","locale","then","default","data","prefixPluginTranslations","catch","resolve"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,MAAMA,IAAAA,GAAOC,SAAAA,CAAUC,MAAM,CAACF,IAAI;AAElC;AACA,YAAe;AACbG,IAAAA,QAAAA,CAAAA,CAASC,GAAc,EAAA;AACrBA,QAAAA,GAAAA,CAAIC,cAAc,CAAC;YACjBC,EAAAA,EAAIC,QAAAA;AACJP,YAAAA;AACF,SAAA,CAAA;AACF,IAAA,CAAA;IACAQ,SAAAA,CAAAA,GAAAA,CAAa,CAAA;IACb,MAAMC,aAAAA,CAAAA,CAAc,EAAEC,OAAO,EAAyB,EAAA;QACpD,MAAMC,aAAAA,GAAgB,MAAMC,OAAAA,CAAQC,GAAG,CACrCH,OAAAA,CAAQI,GAAG,CAAC,CAACC,MAAAA,GAAAA;AACX,YAAA,OAAO,iCAAM,CAAC,CAAC,eAAe,EAAEA,MAAAA,CAAO,KAAK,CAAC,CAAA,CAC1CC,IAAI,CAAC,CAAC,EAAEC,OAAAA,EAASC,IAAI,EAAE,GAAA;gBACtB,OAAO;AACLA,oBAAAA,IAAAA,EAAMC,yBAAyBD,IAAAA,EAAMX,QAAAA,CAAAA;AACrCQ,oBAAAA;AACF,iBAAA;AACF,YAAA,CAAA,CAAA,CACCK,KAAK,CAAC,IAAA;gBACL,OAAO;AACLF,oBAAAA,IAAAA,EAAM,EAAC;AACPH,oBAAAA;AACF,iBAAA;AACF,YAAA,CAAA,CAAA;AACJ,QAAA,CAAA,CAAA,CAAA;QAGF,OAAOH,OAAAA,CAAQS,OAAO,CAACV,aAAAA,CAAAA;AACzB,IAAA;AACF,CAAA;;;;"}
@@ -0,0 +1,10 @@
1
+ 'use strict';
2
+
3
+ var ko = {
4
+ "plugin.description.long": "기본 API 메서드를 포함한 GraphQL 엔드포인트를 추가합니다.",
5
+ "plugin.description.short": "기본 API 메서드를 포함한 GraphQL 엔드포인트를 추가합니다.",
6
+ "plugin.name": "GraphQL"
7
+ };
8
+
9
+ module.exports = ko;
10
+ //# sourceMappingURL=ko.json.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ko.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
@@ -0,0 +1,8 @@
1
+ var ko = {
2
+ "plugin.description.long": "기본 API 메서드를 포함한 GraphQL 엔드포인트를 추가합니다.",
3
+ "plugin.description.short": "기본 API 메서드를 포함한 GraphQL 엔드포인트를 추가합니다.",
4
+ "plugin.name": "GraphQL"
5
+ };
6
+
7
+ export { ko as default };
8
+ //# sourceMappingURL=ko.json.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ko.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
@@ -19,8 +19,7 @@ var inputs = (({ strapi })=>{
19
19
  const isFieldEnabled = (fieldName)=>{
20
20
  return extension.shadowCRUD(contentType.uid).field(fieldName).hasInputEnabled();
21
21
  };
22
- const validAttributes = Object.entries(attributes)// Remove private attributes
23
- .filter(([attributeName])=>!utils.contentTypes.isPrivateAttribute(contentType, attributeName))// Remove non-writable attributes
22
+ const validAttributes = Object.entries(attributes)// Remove non-writable attributes
24
23
  .filter(([attributeName])=>isWritableAttribute(contentType, attributeName))// Remove filters that have been disabled using the shadow CRUD extension API
25
24
  .filter(([attributeName])=>isFieldEnabled(attributeName));
26
25
  // Add the ID for the component to enable inplace updates
@@ -1 +1 @@
1
- {"version":3,"file":"input.js","sources":["../../../../server/src/services/builders/input.ts"],"sourcesContent":["import { inputObjectType, nonNull } from 'nexus';\nimport { contentTypes } from '@strapi/utils';\nimport type { Struct } from '@strapi/types';\nimport type { Context } from '../types';\n\nconst { isWritableAttribute } = contentTypes;\n\nexport default ({ strapi }: Context) => {\n const { naming, mappers, attributes } = strapi.plugin('graphql').service('utils');\n const extension = strapi.plugin('graphql').service('extension');\n\n const { getComponentInputName, getContentTypeInputName, getEnumName, getDynamicZoneInputName } =\n naming;\n\n const {\n isStrapiScalar,\n isRelation,\n isMorphRelation,\n isMedia,\n isEnumeration,\n isComponent,\n isDynamicZone,\n } = attributes;\n\n return {\n buildInputType(contentType: Struct.Schema) {\n const { attributes, modelType } = contentType;\n\n const name = (\n modelType === 'component' ? getComponentInputName : getContentTypeInputName\n ).call(null, contentType);\n\n return inputObjectType({\n name,\n\n definition(t) {\n const isFieldEnabled = (fieldName: string) => {\n return extension.shadowCRUD(contentType.uid).field(fieldName).hasInputEnabled();\n };\n\n const validAttributes = Object.entries(attributes)\n // Remove private attributes\n .filter(\n ([attributeName]) => !contentTypes.isPrivateAttribute(contentType, attributeName)\n )\n // Remove non-writable attributes\n .filter(([attributeName]) => isWritableAttribute(contentType, attributeName))\n // Remove filters that have been disabled using the shadow CRUD extension API\n .filter(([attributeName]) => isFieldEnabled(attributeName));\n\n // Add the ID for the component to enable inplace updates\n if (modelType === 'component' && isFieldEnabled('id')) {\n t.id('id');\n }\n\n validAttributes.forEach(([attributeName, attribute]: [string, any]) => {\n // Enums\n if (isEnumeration(attribute)) {\n const enumTypeName = getEnumName(contentType, attributeName);\n\n t.field(attributeName, { type: enumTypeName });\n }\n\n // Scalars\n else if (isStrapiScalar(attribute)) {\n const gqlScalar = mappers.strapiScalarToGraphQLScalar(attribute.type);\n\n t.field(attributeName, { type: gqlScalar });\n }\n\n // Media\n else if (isMedia(attribute)) {\n const isMultiple = attribute.multiple === true;\n\n if (extension.shadowCRUD('plugin::upload.file').isDisabled()) {\n return;\n }\n\n if (isMultiple) {\n t.list.id(attributeName);\n } else {\n t.id(attributeName);\n }\n }\n\n // Regular Relations (ignore polymorphic relations)\n else if (isRelation(attribute) && !isMorphRelation(attribute)) {\n if (extension.shadowCRUD(attribute.target).isDisabled()) {\n return;\n }\n\n const isToManyRelation = attribute.relation.endsWith('Many');\n\n if (isToManyRelation) {\n t.list.id(attributeName);\n } else {\n t.id(attributeName);\n }\n }\n\n // Components\n else if (isComponent(attribute)) {\n const isRepeatable = attribute.repeatable === true;\n const component = strapi.components[attribute.component];\n const componentInputType = getComponentInputName(component);\n\n if (isRepeatable) {\n t.list.field(attributeName, { type: componentInputType });\n } else {\n t.field(attributeName, { type: componentInputType });\n }\n }\n\n // Dynamic Zones\n else if (isDynamicZone(attribute)) {\n const dzInputName = getDynamicZoneInputName(contentType, attributeName);\n\n t.list.field(attributeName, { type: nonNull(dzInputName) });\n }\n });\n },\n });\n },\n };\n};\n"],"names":["isWritableAttribute","contentTypes","strapi","naming","mappers","attributes","plugin","service","extension","getComponentInputName","getContentTypeInputName","getEnumName","getDynamicZoneInputName","isStrapiScalar","isRelation","isMorphRelation","isMedia","isEnumeration","isComponent","isDynamicZone","buildInputType","contentType","modelType","name","call","inputObjectType","definition","t","isFieldEnabled","fieldName","shadowCRUD","uid","field","hasInputEnabled","validAttributes","Object","entries","filter","attributeName","isPrivateAttribute","id","forEach","attribute","enumTypeName","type","gqlScalar","strapiScalarToGraphQLScalar","isMultiple","multiple","isDisabled","list","target","isToManyRelation","relation","endsWith","isRepeatable","repeatable","component","components","componentInputType","dzInputName","nonNull"],"mappings":";;;;;AAKA,MAAM,EAAEA,mBAAmB,EAAE,GAAGC,kBAAAA;AAEhC,aAAe,CAAA,CAAC,EAAEC,MAAM,EAAW,GAAA;AACjC,IAAA,MAAM,EAAEC,MAAM,EAAEC,OAAO,EAAEC,UAAU,EAAE,GAAGH,MAAAA,CAAOI,MAAM,CAAC,SAAA,CAAA,CAAWC,OAAO,CAAC,OAAA,CAAA;AACzE,IAAA,MAAMC,YAAYN,MAAAA,CAAOI,MAAM,CAAC,SAAA,CAAA,CAAWC,OAAO,CAAC,WAAA,CAAA;IAEnD,MAAM,EAAEE,qBAAqB,EAAEC,uBAAuB,EAAEC,WAAW,EAAEC,uBAAuB,EAAE,GAC5FT,MAAAA;A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AA;AAErD,4BAAA,IAAIF,gBAAAA,EAAkB;gCACpBzB,CAAAA,CAAEuB,IAAI,CAACV,EAAE,CAACF,aAAAA,CAAAA;4BACZ,CAAA,MAAO;AACLX,gCAAAA,CAAAA,CAAEa,EAAE,CAACF,aAAAA,CAAAA;AACP,4BAAA;wBACF,CAAA,MAGK,IAAIpB,YAAYwB,SAAAA,CAAAA,EAAY;4BAC/B,MAAMa,YAAAA,GAAeb,SAAAA,CAAUc,UAAU,KAAK,IAAA;AAC9C,4BAAA,MAAMC,YAAYvD,MAAAA,CAAOwD,UAAU,CAAChB,SAAAA,CAAUe,SAAS,CAAC;AACxD,4BAAA,MAAME,qBAAqBlD,qBAAAA,CAAsBgD,SAAAA,CAAAA;AAEjD,4BAAA,IAAIF,YAAAA,EAAc;AAChB5B,gCAAAA,CAAAA,CAAEuB,IAAI,CAAClB,KAAK,CAACM,aAAAA,EAAe;oCAAEM,IAAAA,EAAMe;AAAmB,iCAAA,CAAA;4BACzD,CAAA,MAAO;gCACLhC,CAAAA,CAAEK,KAAK,CAACM,aAAAA,EAAe;oCAAEM,IAAAA,EAAMe;AAAmB,iCAAA,CAAA;AACpD,4BAAA;wBACF,CAAA,MAGK,IAAIxC,cAAcuB,SAAAA,CAAAA,EAAY;4BACjC,MAAMkB,WAAAA,GAAchD,wBAAwBS,WAAAA,EAAaiB,aAAAA,CAAAA;AAEzDX,4BAAAA,CAAAA,CAAEuB,IAAI,CAAClB,KAAK,CAACM,aAAAA,EAAe;AAAEM,gCAAAA,IAAAA,EAAMiB,aAAAA,CAAQD,WAAAA;AAAa,6BAAA,CAAA;AAC3D,wBAAA;AACF,oBAAA,CAAA,CAAA;AACF,gBAAA;AACF,aAAA,CAAA;AACF,QAAA;AACF,KAAA;AACF,CAAA;;;;"}
1
+ {"version":3,"file":"input.js","sources":["../../../../server/src/services/builders/input.ts"],"sourcesContent":["import { inputObjectType, nonNull } from 'nexus';\nimport { contentTypes } from '@strapi/utils';\nimport type { Struct } from '@strapi/types';\nimport type { Context } from '../types';\n\nconst { isWritableAttribute } = contentTypes;\n\nexport default ({ strapi }: Context) => {\n const { naming, mappers, attributes } = strapi.plugin('graphql').service('utils');\n const extension = strapi.plugin('graphql').service('extension');\n\n const { getComponentInputName, getContentTypeInputName, getEnumName, getDynamicZoneInputName } =\n naming;\n\n const {\n isStrapiScalar,\n isRelation,\n isMorphRelation,\n isMedia,\n isEnumeration,\n isComponent,\n isDynamicZone,\n } = attributes;\n\n return {\n buildInputType(contentType: Struct.Schema) {\n const { attributes, modelType } = contentType;\n\n const name = (\n modelType === 'component' ? getComponentInputName : getContentTypeInputName\n ).call(null, contentType);\n\n return inputObjectType({\n name,\n\n definition(t) {\n const isFieldEnabled = (fieldName: string) => {\n return extension.shadowCRUD(contentType.uid).field(fieldName).hasInputEnabled();\n };\n\n const validAttributes = Object.entries(attributes)\n // Remove non-writable attributes\n .filter(([attributeName]) => isWritableAttribute(contentType, attributeName))\n // Remove filters that have been disabled using the shadow CRUD extension API\n .filter(([attributeName]) => isFieldEnabled(attributeName));\n\n // Add the ID for the component to enable inplace updates\n if (modelType === 'component' && isFieldEnabled('id')) {\n t.id('id');\n }\n\n validAttributes.forEach(([attributeName, attribute]: [string, any]) => {\n // Enums\n if (isEnumeration(attribute)) {\n const enumTypeName = getEnumName(contentType, attributeName);\n\n t.field(attributeName, { type: enumTypeName });\n }\n\n // Scalars\n else if (isStrapiScalar(attribute)) {\n const gqlScalar = mappers.strapiScalarToGraphQLScalar(attribute.type);\n\n t.field(attributeName, { type: gqlScalar });\n }\n\n // Media\n else if (isMedia(attribute)) {\n const isMultiple = attribute.multiple === true;\n\n if (extension.shadowCRUD('plugin::upload.file').isDisabled()) {\n return;\n }\n\n if (isMultiple) {\n t.list.id(attributeName);\n } else {\n t.id(attributeName);\n }\n }\n\n // Regular Relations (ignore polymorphic relations)\n else if (isRelation(attribute) && !isMorphRelation(attribute)) {\n if (extension.shadowCRUD(attribute.target).isDisabled()) {\n return;\n }\n\n const isToManyRelation = attribute.relation.endsWith('Many');\n\n if (isToManyRelation) {\n t.list.id(attributeName);\n } else {\n t.id(attributeName);\n }\n }\n\n // Components\n else if (isComponent(attribute)) {\n const isRepeatable = attribute.repeatable === true;\n const component = strapi.components[attribute.component];\n const componentInputType = getComponentInputName(component);\n\n if (isRepeatable) {\n t.list.field(attributeName, { type: componentInputType });\n } else {\n t.field(attributeName, { type: componentInputType });\n }\n }\n\n // Dynamic Zones\n else if (isDynamicZone(attribute)) {\n const dzInputName = getDynamicZoneInputName(contentType, attributeName);\n\n t.list.field(attributeName, { type: nonNull(dzInputName) });\n }\n });\n },\n });\n },\n };\n};\n"],"names":["isWritableAttribute","contentTypes","strapi","naming","mappers","attributes","plugin","service","extension","getComponentInputName","getContentTypeInputName","getEnumName","getDynamicZoneInputName","isStrapiScalar","isRelation","isMorphRelation","isMedia","isEnumeration","isComponent","isDynamicZone","buildInputType","contentType","modelType","name","call","inputObjectType","definition","t","isFieldEnabled","fieldName","shadowCRUD","uid","field","hasInputEnabled","validAttributes","Object","entries","filter","attributeName","id","forEach","attribute","enumTypeName","type","gqlScalar","strapiScalarToGraphQLScalar","isMultiple","multiple","isDisabled","list","target","isToManyRelation","relation","endsWith","isRepeatable","repeatable","component","components","componentInputType","dzInputName","nonNull"],"mappings":";;;;;AAKA,MAAM,EAAEA,mBAAmB,EAAE,GAAGC,kBAAAA;AAEhC,aAAe,CAAA,CAAC,EAAEC,MAAM,EAAW,GAAA;AACjC,IAAA,MAAM,EAAEC,MAAM,EAAEC,OAAO,EAAEC,UAAU,EAAE,GAAGH,MAAAA,CAAOI,MAAM,CAAC,SAAA,CAAA,CAAWC,OAAO,CAAC,OAAA,CAAA;AACzE,IAAA,MAAMC,YAAYN,MAAAA,CAAOI,MAAM,CAAC,SAAA,CAAA,CAAWC,OAAO,CAAC,WAAA,CAAA;IAEnD,MAAM,EAAEE,qBAAqB,EAAEC,uBAAuB,EAAEC,WAAW,EAAEC,uBAAuB,EAAE,GAC5FT,M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AAO;AACLX,gCAAAA,CAAAA,CAAEY,EAAE,CAACD,aAAAA,CAAAA;AACP,4BAAA;wBACF,CAAA,MAGK,IAAIpB,YAAYuB,SAAAA,CAAAA,EAAY;4BAC/B,MAAMa,YAAAA,GAAeb,SAAAA,CAAUc,UAAU,KAAK,IAAA;AAC9C,4BAAA,MAAMC,YAAYtD,MAAAA,CAAOuD,UAAU,CAAChB,SAAAA,CAAUe,SAAS,CAAC;AACxD,4BAAA,MAAME,qBAAqBjD,qBAAAA,CAAsB+C,SAAAA,CAAAA;AAEjD,4BAAA,IAAIF,YAAAA,EAAc;AAChB3B,gCAAAA,CAAAA,CAAEsB,IAAI,CAACjB,KAAK,CAACM,aAAAA,EAAe;oCAAEK,IAAAA,EAAMe;AAAmB,iCAAA,CAAA;4BACzD,CAAA,MAAO;gCACL/B,CAAAA,CAAEK,KAAK,CAACM,aAAAA,EAAe;oCAAEK,IAAAA,EAAMe;AAAmB,iCAAA,CAAA;AACpD,4BAAA;wBACF,CAAA,MAGK,IAAIvC,cAAcsB,SAAAA,CAAAA,EAAY;4BACjC,MAAMkB,WAAAA,GAAc/C,wBAAwBS,WAAAA,EAAaiB,aAAAA,CAAAA;AAEzDX,4BAAAA,CAAAA,CAAEsB,IAAI,CAACjB,KAAK,CAACM,aAAAA,EAAe;AAAEK,gCAAAA,IAAAA,EAAMiB,aAAAA,CAAQD,WAAAA;AAAa,6BAAA,CAAA;AAC3D,wBAAA;AACF,oBAAA,CAAA,CAAA;AACF,gBAAA;AACF,aAAA,CAAA;AACF,QAAA;AACF,KAAA;AACF,CAAA;;;;"}
@@ -17,8 +17,7 @@ var inputs = (({ strapi })=>{
17
17
  const isFieldEnabled = (fieldName)=>{
18
18
  return extension.shadowCRUD(contentType.uid).field(fieldName).hasInputEnabled();
19
19
  };
20
- const validAttributes = Object.entries(attributes)// Remove private attributes
21
- .filter(([attributeName])=>!contentTypes.isPrivateAttribute(contentType, attributeName))// Remove non-writable attributes
20
+ const validAttributes = Object.entries(attributes)// Remove non-writable attributes
22
21
  .filter(([attributeName])=>isWritableAttribute(contentType, attributeName))// Remove filters that have been disabled using the shadow CRUD extension API
23
22
  .filter(([attributeName])=>isFieldEnabled(attributeName));
24
23
  // Add the ID for the component to enable inplace updates
@@ -1 +1 @@
1
- {"version":3,"file":"input.mjs","sources":["../../../../server/src/services/builders/input.ts"],"sourcesContent":["import { inputObjectType, nonNull } from 'nexus';\nimport { contentTypes } from '@strapi/utils';\nimport type { Struct } from '@strapi/types';\nimport type { Context } from '../types';\n\nconst { isWritableAttribute } = contentTypes;\n\nexport default ({ strapi }: Context) => {\n const { naming, mappers, attributes } = strapi.plugin('graphql').service('utils');\n const extension = strapi.plugin('graphql').service('extension');\n\n const { getComponentInputName, getContentTypeInputName, getEnumName, getDynamicZoneInputName } =\n naming;\n\n const {\n isStrapiScalar,\n isRelation,\n isMorphRelation,\n isMedia,\n isEnumeration,\n isComponent,\n isDynamicZone,\n } = attributes;\n\n return {\n buildInputType(contentType: Struct.Schema) {\n const { attributes, modelType } = contentType;\n\n const name = (\n modelType === 'component' ? getComponentInputName : getContentTypeInputName\n ).call(null, contentType);\n\n return inputObjectType({\n name,\n\n definition(t) {\n const isFieldEnabled = (fieldName: string) => {\n return extension.shadowCRUD(contentType.uid).field(fieldName).hasInputEnabled();\n };\n\n const validAttributes = Object.entries(attributes)\n // Remove private attributes\n .filter(\n ([attributeName]) => !contentTypes.isPrivateAttribute(contentType, attributeName)\n )\n // Remove non-writable attributes\n .filter(([attributeName]) => isWritableAttribute(contentType, attributeName))\n // Remove filters that have been disabled using the shadow CRUD extension API\n .filter(([attributeName]) => isFieldEnabled(attributeName));\n\n // Add the ID for the component to enable inplace updates\n if (modelType === 'component' && isFieldEnabled('id')) {\n t.id('id');\n }\n\n validAttributes.forEach(([attributeName, attribute]: [string, any]) => {\n // Enums\n if (isEnumeration(attribute)) {\n const enumTypeName = getEnumName(contentType, attributeName);\n\n t.field(attributeName, { type: enumTypeName });\n }\n\n // Scalars\n else if (isStrapiScalar(attribute)) {\n const gqlScalar = mappers.strapiScalarToGraphQLScalar(attribute.type);\n\n t.field(attributeName, { type: gqlScalar });\n }\n\n // Media\n else if (isMedia(attribute)) {\n const isMultiple = attribute.multiple === true;\n\n if (extension.shadowCRUD('plugin::upload.file').isDisabled()) {\n return;\n }\n\n if (isMultiple) {\n t.list.id(attributeName);\n } else {\n t.id(attributeName);\n }\n }\n\n // Regular Relations (ignore polymorphic relations)\n else if (isRelation(attribute) && !isMorphRelation(attribute)) {\n if (extension.shadowCRUD(attribute.target).isDisabled()) {\n return;\n }\n\n const isToManyRelation = attribute.relation.endsWith('Many');\n\n if (isToManyRelation) {\n t.list.id(attributeName);\n } else {\n t.id(attributeName);\n }\n }\n\n // Components\n else if (isComponent(attribute)) {\n const isRepeatable = attribute.repeatable === true;\n const component = strapi.components[attribute.component];\n const componentInputType = getComponentInputName(component);\n\n if (isRepeatable) {\n t.list.field(attributeName, { type: componentInputType });\n } else {\n t.field(attributeName, { type: componentInputType });\n }\n }\n\n // Dynamic Zones\n else if (isDynamicZone(attribute)) {\n const dzInputName = getDynamicZoneInputName(contentType, attributeName);\n\n t.list.field(attributeName, { type: nonNull(dzInputName) });\n }\n });\n },\n });\n },\n };\n};\n"],"names":["isWritableAttribute","contentTypes","strapi","naming","mappers","attributes","plugin","service","extension","getComponentInputName","getContentTypeInputName","getEnumName","getDynamicZoneInputName","isStrapiScalar","isRelation","isMorphRelation","isMedia","isEnumeration","isComponent","isDynamicZone","buildInputType","contentType","modelType","name","call","inputObjectType","definition","t","isFieldEnabled","fieldName","shadowCRUD","uid","field","hasInputEnabled","validAttributes","Object","entries","filter","attributeName","isPrivateAttribute","id","forEach","attribute","enumTypeName","type","gqlScalar","strapiScalarToGraphQLScalar","isMultiple","multiple","isDisabled","list","target","isToManyRelation","relation","endsWith","isRepeatable","repeatable","component","components","componentInputType","dzInputName","nonNull"],"mappings":";;;AAKA,MAAM,EAAEA,mBAAmB,EAAE,GAAGC,YAAAA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AAA;AAEzDX,4BAAAA,CAAAA,CAAEuB,IAAI,CAAClB,KAAK,CAACM,aAAAA,EAAe;AAAEM,gCAAAA,IAAAA,EAAMiB,OAAAA,CAAQD,WAAAA;AAAa,6BAAA,CAAA;AAC3D,wBAAA;AACF,oBAAA,CAAA,CAAA;AACF,gBAAA;AACF,aAAA,CAAA;AACF,QAAA;AACF,KAAA;AACF,CAAA;;;;"}
1
+ {"version":3,"file":"input.mjs","sources":["../../../../server/src/services/builders/input.ts"],"sourcesContent":["import { inputObjectType, nonNull } from 'nexus';\nimport { contentTypes } from '@strapi/utils';\nimport type { Struct } from '@strapi/types';\nimport type { Context } from '../types';\n\nconst { isWritableAttribute } = contentTypes;\n\nexport default ({ strapi }: Context) => {\n const { naming, mappers, attributes } = strapi.plugin('graphql').service('utils');\n const extension = strapi.plugin('graphql').service('extension');\n\n const { getComponentInputName, getContentTypeInputName, getEnumName, getDynamicZoneInputName } =\n naming;\n\n const {\n isStrapiScalar,\n isRelation,\n isMorphRelation,\n isMedia,\n isEnumeration,\n isComponent,\n isDynamicZone,\n } = attributes;\n\n return {\n buildInputType(contentType: Struct.Schema) {\n const { attributes, modelType } = contentType;\n\n const name = (\n modelType === 'component' ? getComponentInputName : getContentTypeInputName\n ).call(null, contentType);\n\n return inputObjectType({\n name,\n\n definition(t) {\n const isFieldEnabled = (fieldName: string) => {\n return extension.shadowCRUD(contentType.uid).field(fieldName).hasInputEnabled();\n };\n\n const validAttributes = Object.entries(attributes)\n // Remove non-writable attributes\n .filter(([attributeName]) => isWritableAttribute(contentType, attributeName))\n // Remove filters that have been disabled using the shadow CRUD extension API\n .filter(([attributeName]) => isFieldEnabled(attributeName));\n\n // Add the ID for the component to enable inplace updates\n if (modelType === 'component' && isFieldEnabled('id')) {\n t.id('id');\n }\n\n validAttributes.forEach(([attributeName, attribute]: [string, any]) => {\n // Enums\n if (isEnumeration(attribute)) {\n const enumTypeName = getEnumName(contentType, attributeName);\n\n t.field(attributeName, { type: enumTypeName });\n }\n\n // Scalars\n else if (isStrapiScalar(attribute)) {\n const gqlScalar = mappers.strapiScalarToGraphQLScalar(attribute.type);\n\n t.field(attributeName, { type: gqlScalar });\n }\n\n // Media\n else if (isMedia(attribute)) {\n const isMultiple = attribute.multiple === true;\n\n if (extension.shadowCRUD('plugin::upload.file').isDisabled()) {\n return;\n }\n\n if (isMultiple) {\n t.list.id(attributeName);\n } else {\n t.id(attributeName);\n }\n }\n\n // Regular Relations (ignore polymorphic relations)\n else if (isRelation(attribute) && !isMorphRelation(attribute)) {\n if (extension.shadowCRUD(attribute.target).isDisabled()) {\n return;\n }\n\n const isToManyRelation = attribute.relation.endsWith('Many');\n\n if (isToManyRelation) {\n t.list.id(attributeName);\n } else {\n t.id(attributeName);\n }\n }\n\n // Components\n else if (isComponent(attribute)) {\n const isRepeatable = attribute.repeatable === true;\n const component = strapi.components[attribute.component];\n const componentInputType = getComponentInputName(component);\n\n if (isRepeatable) {\n t.list.field(attributeName, { type: componentInputType });\n } else {\n t.field(attributeName, { type: componentInputType });\n }\n }\n\n // Dynamic Zones\n else if (isDynamicZone(attribute)) {\n const dzInputName = getDynamicZoneInputName(contentType, attributeName);\n\n t.list.field(attributeName, { type: nonNull(dzInputName) });\n }\n });\n },\n });\n },\n };\n};\n"],"names":["isWritableAttribute","contentTypes","strapi","naming","mappers","attributes","plugin","service","extension","getComponentInputName","getContentTypeInputName","getEnumName","getDynamicZoneInputName","isStrapiScalar","isRelation","isMorphRelation","isMedia","isEnumeration","isComponent","isDynamicZone","buildInputType","contentType","modelType","name","call","inputObjectType","definition","t","isFieldEnabled","fieldName","shadowCRUD","uid","field","hasInputEnabled","validAttributes","Object","entries","filter","attributeName","id","forEach","attribute","enumTypeName","type","gqlScalar","strapiScalarToGraphQLScalar","isMultiple","multiple","isDisabled","list","target","isToManyRelation","relation","endsWith","isRepeatable","repeatable","component","components","componentInputType","dzInputName","nonNull"],"mappings":";;;AAKA,MAAM,EAAEA,mBAAmB,EAAE,GAAGC,YA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D,WAAAA;AAAa,6BAAA,CAAA;AAC3D,wBAAA;AACF,oBAAA,CAAA,CAAA;AACF,gBAAA;AACF,aAAA,CAAA;AACF,QAAA;AACF,KAAA;AACF,CAAA;;;;"}
@@ -13,7 +13,7 @@ declare const _default: {
13
13
  bootstrap: typeof bootstrap;
14
14
  services: {
15
15
  builders: ({ strapi }: {
16
- strapi: import("@strapi/types/dist/core").Strapi;
16
+ strapi: import("@strapi/types/dist/core/strapi.js").Strapi;
17
17
  }) => {
18
18
  "new"(name: string, registry: import("./services/type-registry").TypeRegistry): unknown;
19
19
  delete(name: string): void;
@@ -26,7 +26,7 @@ declare const _default: {
26
26
  }>;
27
27
  };
28
28
  utils: {
29
- getContentTypeArgs(contentType: import("@strapi/types/dist/struct").Schema, { multiple, isNested }?: {
29
+ getContentTypeArgs(contentType: import("@strapi/types/dist/struct/schema.js").Schema, { multiple, isNested }?: {
30
30
  multiple?: boolean;
31
31
  isNested?: boolean;
32
32
  }): Record<string, unknown> | {
@@ -42,18 +42,18 @@ declare const _default: {
42
42
  pagination?: undefined;
43
43
  sort?: undefined;
44
44
  } | undefined;
45
- getUniqueScalarAttributes(attributes: import("@strapi/types/dist/struct").SchemaAttributes): {
46
- [k: string]: import("@strapi/types/dist/schema/attribute").AnyAttribute;
45
+ getUniqueScalarAttributes(attributes: import("@strapi/types/dist/struct/schema.js").SchemaAttributes): {
46
+ [k: string]: import("@strapi/types/dist/schema/attribute/common.js").AnyAttribute;
47
47
  };
48
- scalarAttributesToFiltersMap(attributes: import("@strapi/types/dist/struct").SchemaAttributes): import("lodash").Dictionary<any>;
48
+ scalarAttributesToFiltersMap(attributes: import("@strapi/types/dist/struct/schema.js").SchemaAttributes): import("lodash").Dictionary<any>;
49
49
  transformArgs(args: any, { contentType, usePagination, }: {
50
- contentType: import("@strapi/types/dist/struct").ContentTypeSchema;
50
+ contentType: import("@strapi/types/dist/struct/schema.js").ContentTypeSchema;
51
51
  usePagination?: boolean;
52
52
  }): import("lodash").Omit<any, "filters" | "pagination">;
53
53
  };
54
54
  };
55
55
  'content-api': ({ strapi }: {
56
- strapi: import("@strapi/types/dist/core").Strapi;
56
+ strapi: import("@strapi/types/dist/core/strapi.js").Strapi;
57
57
  }) => {
58
58
  buildSchema: () => import("graphql").GraphQLSchema;
59
59
  getBuiltInQueryFields: () => Set<string>;
@@ -123,7 +123,7 @@ declare const _default: {
123
123
  ERROR_TYPE_NAME: string;
124
124
  };
125
125
  extension: ({ strapi }: {
126
- strapi: import("@strapi/types/dist/core").Strapi;
126
+ strapi: import("@strapi/types/dist/core/strapi.js").Strapi;
127
127
  }) => {
128
128
  shadowCRUD: (uid: string) => {
129
129
  isEnabled(): boolean;
@@ -236,43 +236,43 @@ declare const _default: {
236
236
  isEnabled(): boolean;
237
237
  };
238
238
  naming: {
239
- getEnumName: (contentType: import("@strapi/types/dist/struct").Schema, attributeName: string) => string;
240
- getTypeName: (contentType: import("@strapi/types/dist/struct").Schema, { plurality, }?: {
239
+ getEnumName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema, attributeName: string) => string;
240
+ getTypeName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema, { plurality, }?: {
241
241
  plurality?: "singular" | "plural";
242
242
  }) => string;
243
- getEntityName: (contentType: import("@strapi/types/dist/struct").Schema) => string;
244
- getEntityMetaName: (contentType: import("@strapi/types/dist/struct").Schema) => string;
245
- getEntityResponseName: (contentType: import("@strapi/types/dist/struct").Schema) => string;
246
- getEntityResponseCollectionName: (contentType: import("@strapi/types/dist/struct").Schema) => string;
247
- getRelationResponseCollectionName: (contentType: import("@strapi/types/dist/struct").Schema) => string;
248
- getComponentName: (contentType: import("@strapi/types/dist/struct").Schema) => string;
249
- getComponentNameFromAttribute: (attribute: import("@strapi/types/dist/schema/attribute").Component) => string;
250
- getDynamicZoneName: (contentType: import("@strapi/types/dist/struct").Schema, attributeName: string) => string;
251
- getDynamicZoneInputName: (contentType: import("@strapi/types/dist/struct").Schema, attributeName: string) => string;
252
- getComponentInputName: (contentType: import("@strapi/types/dist/struct").Schema) => string;
253
- getContentTypeInputName: (contentType: import("@strapi/types/dist/struct").Schema) => string;
254
- getEntityQueriesTypeName: (contentType: import("@strapi/types/dist/struct").Schema) => string;
255
- getEntityMutationsTypeName: (contentType: import("@strapi/types/dist/struct").Schema) => string;
256
- getFiltersInputTypeName: (contentType: import("@strapi/types/dist/struct").Schema) => string;
243
+ getEntityName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema) => string;
244
+ getEntityMetaName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema) => string;
245
+ getEntityResponseName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema) => string;
246
+ getEntityResponseCollectionName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema) => string;
247
+ getRelationResponseCollectionName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema) => string;
248
+ getComponentName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema) => string;
249
+ getComponentNameFromAttribute: (attribute: import("@strapi/types/dist/schema/attribute/index.js").Component) => string;
250
+ getDynamicZoneName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema, attributeName: string) => string;
251
+ getDynamicZoneInputName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema, attributeName: string) => string;
252
+ getComponentInputName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema) => string;
253
+ getContentTypeInputName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema) => string;
254
+ getEntityQueriesTypeName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema) => string;
255
+ getEntityMutationsTypeName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema) => string;
256
+ getFiltersInputTypeName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema) => string;
257
257
  getScalarFilterInputTypeName: (scalarType: string) => string;
258
- getMorphRelationTypeName: (contentType: import("@strapi/types/dist/struct").Schema, attributeName: string) => string;
258
+ getMorphRelationTypeName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema, attributeName: string) => string;
259
259
  buildCustomTypeNameGenerator: (options: {
260
260
  prefix?: string;
261
261
  suffix?: string;
262
262
  firstLetterCase?: "upper" | "lower";
263
263
  plurality?: "plural" | "singular";
264
- }) => (contentType: import("@strapi/types/dist/struct").Schema) => string;
265
- getFindQueryName: (contentType: import("@strapi/types/dist/struct").Schema) => string;
266
- getFindOneQueryName: (contentType: import("@strapi/types/dist/struct").Schema) => string;
267
- getCreateMutationTypeName: (contentType: import("@strapi/types/dist/struct").Schema) => string;
268
- getUpdateMutationTypeName: (contentType: import("@strapi/types/dist/struct").Schema) => string;
269
- getDeleteMutationTypeName: (contentType: import("@strapi/types/dist/struct").Schema) => string;
270
- getFindConnectionQueryName: (contentType: import("@strapi/types/dist/struct").Schema) => string;
264
+ }) => (contentType: import("@strapi/types/dist/struct/schema.js").Schema) => string;
265
+ getFindQueryName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema) => string;
266
+ getFindOneQueryName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema) => string;
267
+ getCreateMutationTypeName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema) => string;
268
+ getUpdateMutationTypeName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema) => string;
269
+ getDeleteMutationTypeName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema) => string;
270
+ getFindConnectionQueryName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema) => string;
271
271
  };
272
272
  attributes: {
273
- isStrapiScalar: (attribute: import("@strapi/types/dist/schema/attribute").AnyAttribute) => any;
274
- isGraphQLScalar: (attribute: import("@strapi/types/dist/schema/attribute").AnyAttribute) => any;
275
- isMorphRelation: (attribute: import("@strapi/types/dist/schema/attribute").AnyAttribute) => boolean;
273
+ isStrapiScalar: (attribute: import("@strapi/types/dist/schema/attribute/common.js").AnyAttribute) => any;
274
+ isGraphQLScalar: (attribute: import("@strapi/types/dist/schema/attribute/common.js").AnyAttribute) => any;
275
+ isMorphRelation: (attribute: import("@strapi/types/dist/schema/attribute/common.js").AnyAttribute) => boolean;
276
276
  isMedia: (value: any) => boolean;
277
277
  isRelation: (value: any) => boolean;
278
278
  isEnumeration: (value: any) => boolean;
@@ -281,33 +281,33 @@ declare const _default: {
281
281
  };
282
282
  mappers: {
283
283
  entityToResponseEntity: (entity: {
284
- id: import("@strapi/types/dist/data").ID;
284
+ id: import("@strapi/types/dist/data/constants.js").ID;
285
285
  [key: keyof any]: unknown;
286
286
  }) => {
287
- id: import("@strapi/types/dist/data").ID;
287
+ id: import("@strapi/types/dist/data/constants.js").ID;
288
288
  attributes: {
289
289
  [key: string]: unknown;
290
290
  [key: number]: unknown;
291
291
  [key: symbol]: unknown;
292
- id: import("@strapi/types/dist/data").ID;
292
+ id: import("@strapi/types/dist/data/constants.js").ID;
293
293
  };
294
294
  };
295
295
  entitiesToResponseEntities: import("lodash/fp").LodashMap1x1<{
296
296
  [key: string]: unknown;
297
297
  [key: number]: unknown;
298
298
  [key: symbol]: unknown;
299
- id: import("@strapi/types/dist/data").ID;
299
+ id: import("@strapi/types/dist/data/constants.js").ID;
300
300
  }, {
301
- id: import("@strapi/types/dist/data").ID;
301
+ id: import("@strapi/types/dist/data/constants.js").ID;
302
302
  attributes: {
303
303
  [key: string]: unknown;
304
304
  [key: number]: unknown;
305
305
  [key: symbol]: unknown;
306
- id: import("@strapi/types/dist/data").ID;
306
+ id: import("@strapi/types/dist/data/constants.js").ID;
307
307
  };
308
308
  }>;
309
309
  graphqlScalarToOperators(graphqlScalar: string): boolean;
310
- graphQLFiltersToStrapiQuery(filters: any, contentType: import("@strapi/types/dist/struct").Schema): any;
310
+ graphQLFiltersToStrapiQuery(filters: any, contentType: import("@strapi/types/dist/struct/schema.js").Schema): any;
311
311
  strapiScalarToGraphQLScalar(strapiScalar: string): any;
312
312
  };
313
313
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../server/src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAQ6jI,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BAAxsG,CAAC;;;;;;;;;;;;;;;;;;;0BAAg9I,CAAC;0BAAoB,CAAC;mCAA6B,CAAC;6BAAkC,CAAC;uBAA2iB,uDAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAL3gM,wBAIE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../server/src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAQ6jI,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BAAxsG,CAAC;;;;;;;;;;;;;;;;;;;0BAAg9I,CAAC;0BAAoB,CAAC;mCAA6B,CAAC;6BAAkC,CAAC;uBAA2iB,iEAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAL3gM,wBAIE"}
@@ -1,6 +1,6 @@
1
1
  import type { Context } from '../../types';
2
2
  declare const _default: (context: Context) => {
3
- buildContentTypeFilters: (contentType: import("@strapi/types/dist/struct").ContentTypeSchema) => import("nexus/dist/core").NexusInputObjectTypeDef<any>;
3
+ buildContentTypeFilters: (contentType: import("@strapi/types/dist/struct/schema.js").ContentTypeSchema) => import("nexus/dist/core").NexusInputObjectTypeDef<any>;
4
4
  };
5
5
  export default _default;
6
6
  //# sourceMappingURL=index.d.ts.map
@@ -25,7 +25,7 @@ declare const _default: ({ strapi }: {
25
25
  }>;
26
26
  };
27
27
  utils: {
28
- getContentTypeArgs(contentType: import("@strapi/types/dist/struct").Schema, { multiple, isNested }?: {
28
+ getContentTypeArgs(contentType: import("@strapi/types/dist/struct/schema.js").Schema, { multiple, isNested }?: {
29
29
  multiple?: boolean;
30
30
  isNested?: boolean;
31
31
  }): Record<string, unknown> | {
@@ -41,12 +41,12 @@ declare const _default: ({ strapi }: {
41
41
  pagination?: undefined;
42
42
  sort?: undefined;
43
43
  } | undefined;
44
- getUniqueScalarAttributes(attributes: import("@strapi/types/dist/struct").SchemaAttributes): {
45
- [k: string]: import("@strapi/types/dist/schema/attribute").AnyAttribute;
44
+ getUniqueScalarAttributes(attributes: import("@strapi/types/dist/struct/schema.js").SchemaAttributes): {
45
+ [k: string]: import("@strapi/types/dist/schema/attribute/common.js").AnyAttribute;
46
46
  };
47
- scalarAttributesToFiltersMap(attributes: import("@strapi/types/dist/struct").SchemaAttributes): import("lodash").Dictionary<any>;
47
+ scalarAttributesToFiltersMap(attributes: import("@strapi/types/dist/struct/schema.js").SchemaAttributes): import("lodash").Dictionary<any>;
48
48
  transformArgs(args: any, { contentType, usePagination, }: {
49
- contentType: import("@strapi/types/dist/struct").ContentTypeSchema;
49
+ contentType: import("@strapi/types/dist/struct/schema.js").ContentTypeSchema;
50
50
  usePagination?: boolean;
51
51
  }): import("lodash").Omit<any, "filters" | "pagination">;
52
52
  };
@@ -1 +1 @@
1
- {"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../../../server/src/services/builders/input.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;yBAIxB,YAAY,OAAO;gCAkBH,MAAM,CAAC,MAAM;;AAlB7C,wBAqHE"}
1
+ {"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../../../server/src/services/builders/input.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;yBAIxB,YAAY,OAAO;gCAkBH,MAAM,CAAC,MAAM;;AAlB7C,wBAiHE"}
@@ -1,7 +1,7 @@
1
1
  import type { Context } from '../../types';
2
2
  declare const _default: (context: Context) => {
3
- buildSingleTypeMutations(contentType: import("@strapi/types/dist/struct").SingleTypeSchema): import("nexus/dist/core").NexusExtendTypeDef<any>;
4
- buildCollectionTypeMutations(contentType: import("@strapi/types/dist/struct").CollectionTypeSchema): import("nexus/dist/core").NexusExtendTypeDef<any>;
3
+ buildSingleTypeMutations(contentType: import("@strapi/types/dist/struct/schema.js").SingleTypeSchema): import("nexus/dist/core").NexusExtendTypeDef<any>;
4
+ buildCollectionTypeMutations(contentType: import("@strapi/types/dist/struct/schema.js").CollectionTypeSchema): import("nexus/dist/core").NexusExtendTypeDef<any>;
5
5
  };
6
6
  export default _default;
7
7
  //# sourceMappingURL=index.d.ts.map
@@ -1,7 +1,7 @@
1
1
  import type { Context } from '../../types';
2
2
  declare const _default: (context: Context) => {
3
- buildSingleTypeQueries: (contentType: import("@strapi/types/dist/struct").SingleTypeSchema) => import("nexus/dist/core").NexusExtendTypeDef<any>;
4
- buildCollectionTypeQueries: (contentType: import("@strapi/types/dist/struct").CollectionTypeSchema) => import("nexus/dist/core").NexusExtendTypeDef<any>;
3
+ buildSingleTypeQueries: (contentType: import("@strapi/types/dist/struct/schema.js").SingleTypeSchema) => import("nexus/dist/core").NexusExtendTypeDef<any>;
4
+ buildCollectionTypeQueries: (contentType: import("@strapi/types/dist/struct/schema.js").CollectionTypeSchema) => import("nexus/dist/core").NexusExtendTypeDef<any>;
5
5
  };
6
6
  export default _default;
7
7
  //# sourceMappingURL=index.d.ts.map
@@ -7,22 +7,22 @@ declare const _default: (context: Context) => {
7
7
  pageCount: number;
8
8
  }>;
9
9
  buildDynamicZoneResolver({ contentTypeUID, attributeName, }: {
10
- contentTypeUID: import("@strapi/types/dist/internal/uid").ContentType;
10
+ contentTypeUID: import("@strapi/types/dist/internal/uid.js").ContentType;
11
11
  attributeName: string;
12
12
  }): (parent: any) => Promise<any>;
13
13
  buildComponentResolver({ contentTypeUID, attributeName, }: {
14
- contentTypeUID: import("@strapi/types/dist/internal/uid").ContentType;
14
+ contentTypeUID: import("@strapi/types/dist/internal/uid.js").ContentType;
15
15
  attributeName: string;
16
16
  }): (parent: any, args: any, ctx: any) => Promise<any>;
17
17
  buildQueriesResolvers({ contentType }: {
18
- contentType: import("@strapi/types/dist/schema").ContentType;
18
+ contentType: import("@strapi/types/dist/schema/index.js").ContentType;
19
19
  }): {
20
- findMany(parent: any, args: any, ctx: any): Promise<import("@strapi/types/dist/modules/documents").AnyDocument[]>;
21
- findFirst(parent: any, args: any, ctx: any): Promise<import("@strapi/types/dist/modules/documents").AnyDocument | null>;
22
- findOne(parent: any, args: any, ctx: any): Promise<import("@strapi/types/dist/modules/documents").AnyDocument | null>;
20
+ findMany(parent: any, args: any, ctx: any): Promise<import("@strapi/types/dist/modules/documents/index.js").AnyDocument[]>;
21
+ findFirst(parent: any, args: any, ctx: any): Promise<import("@strapi/types/dist/modules/documents/index.js").AnyDocument | null>;
22
+ findOne(parent: any, args: any, ctx: any): Promise<import("@strapi/types/dist/modules/documents/index.js").AnyDocument | null>;
23
23
  };
24
24
  buildAssociationResolver({ contentTypeUID, attributeName, }: {
25
- contentTypeUID: import("@strapi/types/dist/internal/uid").ContentType;
25
+ contentTypeUID: import("@strapi/types/dist/internal/uid.js").ContentType;
26
26
  attributeName: string;
27
27
  }): (parent: any, args: any, context: any, info: any) => Promise<any>;
28
28
  };
@@ -4,9 +4,9 @@ declare const _default: ({ strapi }: Context) => {
4
4
  buildQueriesResolvers({ contentType }: {
5
5
  contentType: Schema.ContentType;
6
6
  }): {
7
- findMany(parent: any, args: any, ctx: any): Promise<import("@strapi/types/dist/modules/documents").AnyDocument[]>;
8
- findFirst(parent: any, args: any, ctx: any): Promise<import("@strapi/types/dist/modules/documents").AnyDocument | null>;
9
- findOne(parent: any, args: any, ctx: any): Promise<import("@strapi/types/dist/modules/documents").AnyDocument | null>;
7
+ findMany(parent: any, args: any, ctx: any): Promise<import("@strapi/types/dist/modules/documents/index.js").AnyDocument[]>;
8
+ findFirst(parent: any, args: any, ctx: any): Promise<import("@strapi/types/dist/modules/documents/index.js").AnyDocument | null>;
9
+ findOne(parent: any, args: any, ctx: any): Promise<import("@strapi/types/dist/modules/documents/index.js").AnyDocument | null>;
10
10
  };
11
11
  };
12
12
  export default _default;
@@ -23,7 +23,7 @@ declare const _default: ({ strapi }: {
23
23
  * Filter an object entries and keep only those whose value is a unique scalar attribute
24
24
  */
25
25
  getUniqueScalarAttributes(attributes: Struct.SchemaAttributes): {
26
- [k: string]: import("@strapi/types/dist/schema/attribute").AnyAttribute;
26
+ [k: string]: import("@strapi/types/dist/schema/attribute/common.js").AnyAttribute;
27
27
  };
28
28
  /**
29
29
  * Map each value from an attribute to a FiltersInput type name
@@ -1,6 +1,6 @@
1
1
  export declare const services: {
2
2
  builders: ({ strapi }: {
3
- strapi: import("@strapi/types/dist/core").Strapi;
3
+ strapi: import("@strapi/types/dist/core/strapi.js").Strapi;
4
4
  }) => {
5
5
  "new"(name: string, registry: import("./type-registry").TypeRegistry): unknown;
6
6
  delete(name: string): void;
@@ -13,7 +13,7 @@ export declare const services: {
13
13
  }>;
14
14
  };
15
15
  utils: {
16
- getContentTypeArgs(contentType: import("@strapi/types/dist/struct").Schema, { multiple, isNested }?: {
16
+ getContentTypeArgs(contentType: import("@strapi/types/dist/struct/schema.js").Schema, { multiple, isNested }?: {
17
17
  multiple?: boolean;
18
18
  isNested?: boolean;
19
19
  }): Record<string, unknown> | {
@@ -29,18 +29,18 @@ export declare const services: {
29
29
  pagination?: undefined;
30
30
  sort?: undefined;
31
31
  } | undefined;
32
- getUniqueScalarAttributes(attributes: import("@strapi/types/dist/struct").SchemaAttributes): {
33
- [k: string]: import("@strapi/types/dist/schema/attribute").AnyAttribute;
32
+ getUniqueScalarAttributes(attributes: import("@strapi/types/dist/struct/schema.js").SchemaAttributes): {
33
+ [k: string]: import("@strapi/types/dist/schema/attribute/common.js").AnyAttribute;
34
34
  };
35
- scalarAttributesToFiltersMap(attributes: import("@strapi/types/dist/struct").SchemaAttributes): import("lodash").Dictionary<any>;
35
+ scalarAttributesToFiltersMap(attributes: import("@strapi/types/dist/struct/schema.js").SchemaAttributes): import("lodash").Dictionary<any>;
36
36
  transformArgs(args: any, { contentType, usePagination, }: {
37
- contentType: import("@strapi/types/dist/struct").ContentTypeSchema;
37
+ contentType: import("@strapi/types/dist/struct/schema.js").ContentTypeSchema;
38
38
  usePagination?: boolean;
39
39
  }): import("lodash").Omit<any, "filters" | "pagination">;
40
40
  };
41
41
  };
42
42
  'content-api': ({ strapi }: {
43
- strapi: import("@strapi/types/dist/core").Strapi;
43
+ strapi: import("@strapi/types/dist/core/strapi.js").Strapi;
44
44
  }) => {
45
45
  buildSchema: () => import("graphql").GraphQLSchema;
46
46
  getBuiltInQueryFields: () => Set<string>;
@@ -110,7 +110,7 @@ export declare const services: {
110
110
  ERROR_TYPE_NAME: string;
111
111
  };
112
112
  extension: ({ strapi }: {
113
- strapi: import("@strapi/types/dist/core").Strapi;
113
+ strapi: import("@strapi/types/dist/core/strapi.js").Strapi;
114
114
  }) => {
115
115
  shadowCRUD: (uid: string) => {
116
116
  isEnabled(): boolean;
@@ -223,43 +223,43 @@ export declare const services: {
223
223
  isEnabled(): boolean;
224
224
  };
225
225
  naming: {
226
- getEnumName: (contentType: import("@strapi/types/dist/struct").Schema, attributeName: string) => string;
227
- getTypeName: (contentType: import("@strapi/types/dist/struct").Schema, { plurality, }?: {
226
+ getEnumName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema, attributeName: string) => string;
227
+ getTypeName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema, { plurality, }?: {
228
228
  plurality?: "singular" | "plural";
229
229
  }) => string;
230
- getEntityName: (contentType: import("@strapi/types/dist/struct").Schema) => string;
231
- getEntityMetaName: (contentType: import("@strapi/types/dist/struct").Schema) => string;
232
- getEntityResponseName: (contentType: import("@strapi/types/dist/struct").Schema) => string;
233
- getEntityResponseCollectionName: (contentType: import("@strapi/types/dist/struct").Schema) => string;
234
- getRelationResponseCollectionName: (contentType: import("@strapi/types/dist/struct").Schema) => string;
235
- getComponentName: (contentType: import("@strapi/types/dist/struct").Schema) => string;
236
- getComponentNameFromAttribute: (attribute: import("@strapi/types/dist/schema/attribute").Component) => string;
237
- getDynamicZoneName: (contentType: import("@strapi/types/dist/struct").Schema, attributeName: string) => string;
238
- getDynamicZoneInputName: (contentType: import("@strapi/types/dist/struct").Schema, attributeName: string) => string;
239
- getComponentInputName: (contentType: import("@strapi/types/dist/struct").Schema) => string;
240
- getContentTypeInputName: (contentType: import("@strapi/types/dist/struct").Schema) => string;
241
- getEntityQueriesTypeName: (contentType: import("@strapi/types/dist/struct").Schema) => string;
242
- getEntityMutationsTypeName: (contentType: import("@strapi/types/dist/struct").Schema) => string;
243
- getFiltersInputTypeName: (contentType: import("@strapi/types/dist/struct").Schema) => string;
230
+ getEntityName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema) => string;
231
+ getEntityMetaName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema) => string;
232
+ getEntityResponseName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema) => string;
233
+ getEntityResponseCollectionName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema) => string;
234
+ getRelationResponseCollectionName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema) => string;
235
+ getComponentName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema) => string;
236
+ getComponentNameFromAttribute: (attribute: import("@strapi/types/dist/schema/attribute/index.js").Component) => string;
237
+ getDynamicZoneName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema, attributeName: string) => string;
238
+ getDynamicZoneInputName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema, attributeName: string) => string;
239
+ getComponentInputName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema) => string;
240
+ getContentTypeInputName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema) => string;
241
+ getEntityQueriesTypeName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema) => string;
242
+ getEntityMutationsTypeName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema) => string;
243
+ getFiltersInputTypeName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema) => string;
244
244
  getScalarFilterInputTypeName: (scalarType: string) => string;
245
- getMorphRelationTypeName: (contentType: import("@strapi/types/dist/struct").Schema, attributeName: string) => string;
245
+ getMorphRelationTypeName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema, attributeName: string) => string;
246
246
  buildCustomTypeNameGenerator: (options: {
247
247
  prefix?: string;
248
248
  suffix?: string;
249
249
  firstLetterCase?: "upper" | "lower";
250
250
  plurality?: "plural" | "singular";
251
- }) => (contentType: import("@strapi/types/dist/struct").Schema) => string;
252
- getFindQueryName: (contentType: import("@strapi/types/dist/struct").Schema) => string;
253
- getFindOneQueryName: (contentType: import("@strapi/types/dist/struct").Schema) => string;
254
- getCreateMutationTypeName: (contentType: import("@strapi/types/dist/struct").Schema) => string;
255
- getUpdateMutationTypeName: (contentType: import("@strapi/types/dist/struct").Schema) => string;
256
- getDeleteMutationTypeName: (contentType: import("@strapi/types/dist/struct").Schema) => string;
257
- getFindConnectionQueryName: (contentType: import("@strapi/types/dist/struct").Schema) => string;
251
+ }) => (contentType: import("@strapi/types/dist/struct/schema.js").Schema) => string;
252
+ getFindQueryName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema) => string;
253
+ getFindOneQueryName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema) => string;
254
+ getCreateMutationTypeName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema) => string;
255
+ getUpdateMutationTypeName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema) => string;
256
+ getDeleteMutationTypeName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema) => string;
257
+ getFindConnectionQueryName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema) => string;
258
258
  };
259
259
  attributes: {
260
- isStrapiScalar: (attribute: import("@strapi/types/dist/schema/attribute").AnyAttribute) => any;
261
- isGraphQLScalar: (attribute: import("@strapi/types/dist/schema/attribute").AnyAttribute) => any;
262
- isMorphRelation: (attribute: import("@strapi/types/dist/schema/attribute").AnyAttribute) => boolean;
260
+ isStrapiScalar: (attribute: import("@strapi/types/dist/schema/attribute/common.js").AnyAttribute) => any;
261
+ isGraphQLScalar: (attribute: import("@strapi/types/dist/schema/attribute/common.js").AnyAttribute) => any;
262
+ isMorphRelation: (attribute: import("@strapi/types/dist/schema/attribute/common.js").AnyAttribute) => boolean;
263
263
  isMedia: (value: any) => boolean;
264
264
  isRelation: (value: any) => boolean;
265
265
  isEnumeration: (value: any) => boolean;
@@ -268,33 +268,33 @@ export declare const services: {
268
268
  };
269
269
  mappers: {
270
270
  entityToResponseEntity: (entity: {
271
- id: import("@strapi/types/dist/data").ID;
271
+ id: import("@strapi/types/dist/data/constants.js").ID;
272
272
  [key: keyof any]: unknown;
273
273
  }) => {
274
- id: import("@strapi/types/dist/data").ID;
274
+ id: import("@strapi/types/dist/data/constants.js").ID;
275
275
  attributes: {
276
276
  [key: string]: unknown;
277
277
  [key: number]: unknown;
278
278
  [key: symbol]: unknown;
279
- id: import("@strapi/types/dist/data").ID;
279
+ id: import("@strapi/types/dist/data/constants.js").ID;
280
280
  };
281
281
  };
282
282
  entitiesToResponseEntities: import("lodash/fp").LodashMap1x1<{
283
283
  [key: string]: unknown;
284
284
  [key: number]: unknown;
285
285
  [key: symbol]: unknown;
286
- id: import("@strapi/types/dist/data").ID;
286
+ id: import("@strapi/types/dist/data/constants.js").ID;
287
287
  }, {
288
- id: import("@strapi/types/dist/data").ID;
288
+ id: import("@strapi/types/dist/data/constants.js").ID;
289
289
  attributes: {
290
290
  [key: string]: unknown;
291
291
  [key: number]: unknown;
292
292
  [key: symbol]: unknown;
293
- id: import("@strapi/types/dist/data").ID;
293
+ id: import("@strapi/types/dist/data/constants.js").ID;
294
294
  };
295
295
  }>;
296
296
  graphqlScalarToOperators(graphqlScalar: string): boolean;
297
- graphQLFiltersToStrapiQuery(filters: any, contentType: import("@strapi/types/dist/struct").Schema): any;
297
+ graphQLFiltersToStrapiQuery(filters: any, contentType: import("@strapi/types/dist/struct/schema.js").Schema): any;
298
298
  strapiScalarToGraphQLScalar(strapiScalar: string): any;
299
299
  };
300
300
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/src/services/index.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BAUuzH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAxsG,CAAC;;;;;;;;;;;;;;;;;;;sBAAg9I,CAAC;sBAAoB,CAAC;+BAA6B,CAAC;yBAAkC,CAAC;mBAA2iB,uDAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CADjvL,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/src/services/index.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BAUuzH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAxsG,CAAC;;;;;;;;;;;;;;;;;;;sBAAg9I,CAAC;sBAAoB,CAAC;+BAA6B,CAAC;yBAAkC,CAAC;mBAA2iB,iEAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CADjvL,CAAC"}
@@ -5,43 +5,43 @@ declare const _default: (context: Context) => {
5
5
  isEnabled(): boolean;
6
6
  };
7
7
  naming: {
8
- getEnumName: (contentType: import("@strapi/types/dist/struct").Schema, attributeName: string) => string;
9
- getTypeName: (contentType: import("@strapi/types/dist/struct").Schema, { plurality, }?: {
8
+ getEnumName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema, attributeName: string) => string;
9
+ getTypeName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema, { plurality, }?: {
10
10
  plurality?: "singular" | "plural";
11
11
  }) => string;
12
- getEntityName: (contentType: import("@strapi/types/dist/struct").Schema) => string;
13
- getEntityMetaName: (contentType: import("@strapi/types/dist/struct").Schema) => string;
14
- getEntityResponseName: (contentType: import("@strapi/types/dist/struct").Schema) => string;
15
- getEntityResponseCollectionName: (contentType: import("@strapi/types/dist/struct").Schema) => string;
16
- getRelationResponseCollectionName: (contentType: import("@strapi/types/dist/struct").Schema) => string;
17
- getComponentName: (contentType: import("@strapi/types/dist/struct").Schema) => string;
18
- getComponentNameFromAttribute: (attribute: import("@strapi/types/dist/schema/attribute").Component) => string;
19
- getDynamicZoneName: (contentType: import("@strapi/types/dist/struct").Schema, attributeName: string) => string;
20
- getDynamicZoneInputName: (contentType: import("@strapi/types/dist/struct").Schema, attributeName: string) => string;
21
- getComponentInputName: (contentType: import("@strapi/types/dist/struct").Schema) => string;
22
- getContentTypeInputName: (contentType: import("@strapi/types/dist/struct").Schema) => string;
23
- getEntityQueriesTypeName: (contentType: import("@strapi/types/dist/struct").Schema) => string;
24
- getEntityMutationsTypeName: (contentType: import("@strapi/types/dist/struct").Schema) => string;
25
- getFiltersInputTypeName: (contentType: import("@strapi/types/dist/struct").Schema) => string;
12
+ getEntityName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema) => string;
13
+ getEntityMetaName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema) => string;
14
+ getEntityResponseName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema) => string;
15
+ getEntityResponseCollectionName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema) => string;
16
+ getRelationResponseCollectionName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema) => string;
17
+ getComponentName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema) => string;
18
+ getComponentNameFromAttribute: (attribute: import("@strapi/types/dist/schema/attribute/index.js").Component) => string;
19
+ getDynamicZoneName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema, attributeName: string) => string;
20
+ getDynamicZoneInputName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema, attributeName: string) => string;
21
+ getComponentInputName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema) => string;
22
+ getContentTypeInputName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema) => string;
23
+ getEntityQueriesTypeName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema) => string;
24
+ getEntityMutationsTypeName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema) => string;
25
+ getFiltersInputTypeName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema) => string;
26
26
  getScalarFilterInputTypeName: (scalarType: string) => string;
27
- getMorphRelationTypeName: (contentType: import("@strapi/types/dist/struct").Schema, attributeName: string) => string;
27
+ getMorphRelationTypeName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema, attributeName: string) => string;
28
28
  buildCustomTypeNameGenerator: (options: {
29
29
  prefix?: string;
30
30
  suffix?: string;
31
31
  firstLetterCase?: "upper" | "lower";
32
32
  plurality?: "plural" | "singular";
33
- }) => (contentType: import("@strapi/types/dist/struct").Schema) => string;
34
- getFindQueryName: (contentType: import("@strapi/types/dist/struct").Schema) => string;
35
- getFindOneQueryName: (contentType: import("@strapi/types/dist/struct").Schema) => string;
36
- getCreateMutationTypeName: (contentType: import("@strapi/types/dist/struct").Schema) => string;
37
- getUpdateMutationTypeName: (contentType: import("@strapi/types/dist/struct").Schema) => string;
38
- getDeleteMutationTypeName: (contentType: import("@strapi/types/dist/struct").Schema) => string;
39
- getFindConnectionQueryName: (contentType: import("@strapi/types/dist/struct").Schema) => string;
33
+ }) => (contentType: import("@strapi/types/dist/struct/schema.js").Schema) => string;
34
+ getFindQueryName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema) => string;
35
+ getFindOneQueryName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema) => string;
36
+ getCreateMutationTypeName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema) => string;
37
+ getUpdateMutationTypeName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema) => string;
38
+ getDeleteMutationTypeName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema) => string;
39
+ getFindConnectionQueryName: (contentType: import("@strapi/types/dist/struct/schema.js").Schema) => string;
40
40
  };
41
41
  attributes: {
42
- isStrapiScalar: (attribute: import("@strapi/types/dist/schema/attribute").AnyAttribute) => any;
43
- isGraphQLScalar: (attribute: import("@strapi/types/dist/schema/attribute").AnyAttribute) => any;
44
- isMorphRelation: (attribute: import("@strapi/types/dist/schema/attribute").AnyAttribute) => boolean;
42
+ isStrapiScalar: (attribute: import("@strapi/types/dist/schema/attribute/common.js").AnyAttribute) => any;
43
+ isGraphQLScalar: (attribute: import("@strapi/types/dist/schema/attribute/common.js").AnyAttribute) => any;
44
+ isMorphRelation: (attribute: import("@strapi/types/dist/schema/attribute/common.js").AnyAttribute) => boolean;
45
45
  isMedia: (value: any) => boolean;
46
46
  isRelation: (value: any) => boolean;
47
47
  isEnumeration: (value: any) => boolean;
@@ -50,33 +50,33 @@ declare const _default: (context: Context) => {
50
50
  };
51
51
  mappers: {
52
52
  entityToResponseEntity: (entity: {
53
- id: import("@strapi/types/dist/data").ID;
53
+ id: import("@strapi/types/dist/data/constants.js").ID;
54
54
  [key: keyof any]: unknown;
55
55
  }) => {
56
- id: import("@strapi/types/dist/data").ID;
56
+ id: import("@strapi/types/dist/data/constants.js").ID;
57
57
  attributes: {
58
58
  [key: string]: unknown;
59
59
  [key: number]: unknown;
60
60
  [key: symbol]: unknown;
61
- id: import("@strapi/types/dist/data").ID;
61
+ id: import("@strapi/types/dist/data/constants.js").ID;
62
62
  };
63
63
  };
64
64
  entitiesToResponseEntities: import("lodash/fp").LodashMap1x1<{
65
65
  [key: string]: unknown;
66
66
  [key: number]: unknown;
67
67
  [key: symbol]: unknown;
68
- id: import("@strapi/types/dist/data").ID;
68
+ id: import("@strapi/types/dist/data/constants.js").ID;
69
69
  }, {
70
- id: import("@strapi/types/dist/data").ID;
70
+ id: import("@strapi/types/dist/data/constants.js").ID;
71
71
  attributes: {
72
72
  [key: string]: unknown;
73
73
  [key: number]: unknown;
74
74
  [key: symbol]: unknown;
75
- id: import("@strapi/types/dist/data").ID;
75
+ id: import("@strapi/types/dist/data/constants.js").ID;
76
76
  };
77
77
  }>;
78
78
  graphqlScalarToOperators(graphqlScalar: string): boolean;
79
- graphQLFiltersToStrapiQuery(filters: any, contentType: import("@strapi/types/dist/struct").Schema): any;
79
+ graphQLFiltersToStrapiQuery(filters: any, contentType: import("@strapi/types/dist/struct/schema.js").Schema): any;
80
80
  strapiScalarToGraphQLScalar(strapiScalar: string): any;
81
81
  };
82
82
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../server/src/services/utils/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;yBAExB,SAAS,OAAO;;;;;;;;qBAMssB,CAAC;;;;;;;;;;;;;;;;;;;kBAAg9I,CAAC;kBAAoB,CAAC;2BAA6B,CAAC;qBAAkC,CAAC;eAA2iB,uDAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AANn1L,wBAKG"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../server/src/services/utils/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;yBAExB,SAAS,OAAO;;;;;;;;qBAMssB,CAAC;;;;;;;;;;;;;;;;;;;kBAAg9I,CAAC;kBAAoB,CAAC;2BAA6B,CAAC;qBAAkC,CAAC;eAA2iB,iEAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AANn1L,wBAKG"}
@@ -1,33 +1,33 @@
1
1
  import type { Context } from '../../types';
2
2
  declare const _default: (context: Context) => {
3
3
  entityToResponseEntity: (entity: {
4
- id: import("@strapi/types/dist/data").ID;
4
+ id: import("@strapi/types/dist/data/constants.js").ID;
5
5
  [key: keyof any]: unknown;
6
6
  }) => {
7
- id: import("@strapi/types/dist/data").ID;
7
+ id: import("@strapi/types/dist/data/constants.js").ID;
8
8
  attributes: {
9
9
  [key: string]: unknown;
10
10
  [key: number]: unknown;
11
11
  [key: symbol]: unknown;
12
- id: import("@strapi/types/dist/data").ID;
12
+ id: import("@strapi/types/dist/data/constants.js").ID;
13
13
  };
14
14
  };
15
15
  entitiesToResponseEntities: import("lodash/fp").LodashMap1x1<{
16
16
  [key: string]: unknown;
17
17
  [key: number]: unknown;
18
18
  [key: symbol]: unknown;
19
- id: import("@strapi/types/dist/data").ID;
19
+ id: import("@strapi/types/dist/data/constants.js").ID;
20
20
  }, {
21
- id: import("@strapi/types/dist/data").ID;
21
+ id: import("@strapi/types/dist/data/constants.js").ID;
22
22
  attributes: {
23
23
  [key: string]: unknown;
24
24
  [key: number]: unknown;
25
25
  [key: symbol]: unknown;
26
- id: import("@strapi/types/dist/data").ID;
26
+ id: import("@strapi/types/dist/data/constants.js").ID;
27
27
  };
28
28
  }>;
29
29
  graphqlScalarToOperators(graphqlScalar: string): boolean;
30
- graphQLFiltersToStrapiQuery(filters: any, contentType: import("@strapi/types/dist/struct").Schema): any;
30
+ graphQLFiltersToStrapiQuery(filters: any, contentType: import("@strapi/types/dist/struct/schema.js").Schema): any;
31
31
  strapiScalarToGraphQLScalar(strapiScalar: string): any;
32
32
  };
33
33
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strapi/plugin-graphql",
3
- "version": "5.50.1",
3
+ "version": "5.51.0",
4
4
  "description": "Adds GraphQL endpoint with default API methods.",
5
5
  "homepage": "https://strapi.io",
6
6
  "bugs": {
@@ -52,7 +52,9 @@
52
52
  "build:types:server": "run -T tsc -p server/tsconfig.build.json --emitDeclarationOnly",
53
53
  "build:types:admin": "run -T tsc -p admin/tsconfig.build.json --emitDeclarationOnly",
54
54
  "clean": "run -T rimraf ./dist",
55
- "lint": "run -T eslint .",
55
+ "lint": "run -T eslint . --max-warnings=0",
56
+ "test:ts:back": "run -T tsc -p server/tsconfig.json",
57
+ "test:ts:front": "run -T tsc -p admin/tsconfig.json",
56
58
  "test:unit": "run -T jest --passWithNoTests",
57
59
  "test:unit:watch": "run -T jest --watch",
58
60
  "watch": "run -T rollup -c -w"
@@ -63,9 +65,9 @@
63
65
  "@graphql-tools/schema": "10.0.3",
64
66
  "@graphql-tools/utils": "^10.1.3",
65
67
  "@koa/cors": "5.0.0",
66
- "@strapi/design-system": "2.2.1",
67
- "@strapi/icons": "2.2.1",
68
- "@strapi/utils": "5.50.1",
68
+ "@strapi/design-system": "2.2.3",
69
+ "@strapi/icons": "2.2.3",
70
+ "@strapi/utils": "5.51.0",
69
71
  "graphql": "^16.8.1",
70
72
  "graphql-depth-limit": "^1.1.0",
71
73
  "graphql-playground-middleware-koa": "^1.6.21",
@@ -77,19 +79,22 @@
77
79
  "pluralize": "8.0.0"
78
80
  },
79
81
  "devDependencies": {
80
- "@strapi/strapi": "5.50.1",
81
- "@strapi/types": "5.50.1",
82
+ "@strapi/strapi": "5.51.0",
83
+ "@strapi/types": "5.51.0",
82
84
  "@types/graphql-depth-limit": "1.1.5",
85
+ "@types/jest": "29.5.2",
83
86
  "@types/koa-bodyparser": "4.3.12",
84
87
  "@types/koa__cors": "5.0.0",
88
+ "@types/node": "20.19.41",
85
89
  "cross-env": "^7.0.3",
86
- "eslint-config-custom": "5.50.1",
90
+ "eslint-config-custom": "5.51.0",
91
+ "jest": "29.6.0",
87
92
  "koa": "2.16.4",
88
93
  "react": "18.3.1",
89
94
  "react-dom": "18.3.1",
90
95
  "react-router-dom": "6.30.3",
91
96
  "styled-components": "6.4.1",
92
- "tsconfig": "5.50.1",
97
+ "tsconfig": "5.51.0",
93
98
  "typescript": "5.9.3"
94
99
  },
95
100
  "peerDependencies": {