@strapi/plugin-graphql 5.37.1 → 5.38.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.
- package/dist/admin/index.js.map +1 -1
- package/dist/admin/index.mjs.map +1 -1
- package/dist/admin/package.json.js +1 -133
- package/dist/admin/package.json.js.map +1 -1
- package/dist/admin/package.json.mjs +2 -120
- package/dist/admin/package.json.mjs.map +1 -1
- package/dist/admin/utils/prefixPluginTranslations.js.map +1 -1
- package/dist/admin/utils/prefixPluginTranslations.mjs.map +1 -1
- package/dist/server/bootstrap.js.map +1 -1
- package/dist/server/bootstrap.mjs.map +1 -1
- package/dist/server/config/default-config.js.map +1 -1
- package/dist/server/config/default-config.mjs.map +1 -1
- package/dist/server/config/index.js.map +1 -1
- package/dist/server/config/index.mjs.map +1 -1
- package/dist/server/format-graphql-error.js.map +1 -1
- package/dist/server/format-graphql-error.mjs.map +1 -1
- package/dist/server/index.js +4 -4
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/services/builders/dynamic-zones.js.map +1 -1
- package/dist/server/services/builders/dynamic-zones.mjs.map +1 -1
- package/dist/server/services/builders/entity.js.map +1 -1
- package/dist/server/services/builders/entity.mjs.map +1 -1
- package/dist/server/services/builders/enums.js.map +1 -1
- package/dist/server/services/builders/enums.mjs.map +1 -1
- package/dist/server/services/builders/filters/content-type.js.map +1 -1
- package/dist/server/services/builders/filters/content-type.mjs.map +1 -1
- package/dist/server/services/builders/filters/index.js.map +1 -1
- package/dist/server/services/builders/filters/index.mjs.map +1 -1
- package/dist/server/services/builders/filters/operators/and.js.map +1 -1
- package/dist/server/services/builders/filters/operators/and.mjs.map +1 -1
- package/dist/server/services/builders/filters/operators/between.js.map +1 -1
- package/dist/server/services/builders/filters/operators/between.mjs.map +1 -1
- package/dist/server/services/builders/filters/operators/contains.js.map +1 -1
- package/dist/server/services/builders/filters/operators/contains.mjs.map +1 -1
- package/dist/server/services/builders/filters/operators/containsi.js.map +1 -1
- package/dist/server/services/builders/filters/operators/containsi.mjs.map +1 -1
- package/dist/server/services/builders/filters/operators/ends-with.js.map +1 -1
- package/dist/server/services/builders/filters/operators/ends-with.mjs.map +1 -1
- package/dist/server/services/builders/filters/operators/eq.js.map +1 -1
- package/dist/server/services/builders/filters/operators/eq.mjs.map +1 -1
- package/dist/server/services/builders/filters/operators/eqi.js.map +1 -1
- package/dist/server/services/builders/filters/operators/eqi.mjs.map +1 -1
- package/dist/server/services/builders/filters/operators/gt.js.map +1 -1
- package/dist/server/services/builders/filters/operators/gt.mjs.map +1 -1
- package/dist/server/services/builders/filters/operators/gte.js.map +1 -1
- package/dist/server/services/builders/filters/operators/gte.mjs.map +1 -1
- package/dist/server/services/builders/filters/operators/in.js.map +1 -1
- package/dist/server/services/builders/filters/operators/in.mjs.map +1 -1
- package/dist/server/services/builders/filters/operators/index.js.map +1 -1
- package/dist/server/services/builders/filters/operators/index.mjs +4 -4
- package/dist/server/services/builders/filters/operators/index.mjs.map +1 -1
- package/dist/server/services/builders/filters/operators/lt.js.map +1 -1
- package/dist/server/services/builders/filters/operators/lt.mjs.map +1 -1
- package/dist/server/services/builders/filters/operators/lte.js.map +1 -1
- package/dist/server/services/builders/filters/operators/lte.mjs.map +1 -1
- package/dist/server/services/builders/filters/operators/ne.js.map +1 -1
- package/dist/server/services/builders/filters/operators/ne.mjs.map +1 -1
- package/dist/server/services/builders/filters/operators/nei.js.map +1 -1
- package/dist/server/services/builders/filters/operators/nei.mjs.map +1 -1
- package/dist/server/services/builders/filters/operators/not-contains.js.map +1 -1
- package/dist/server/services/builders/filters/operators/not-contains.mjs.map +1 -1
- package/dist/server/services/builders/filters/operators/not-containsi.js.map +1 -1
- package/dist/server/services/builders/filters/operators/not-containsi.mjs.map +1 -1
- package/dist/server/services/builders/filters/operators/not-in.js.map +1 -1
- package/dist/server/services/builders/filters/operators/not-in.mjs.map +1 -1
- package/dist/server/services/builders/filters/operators/not-null.js.map +1 -1
- package/dist/server/services/builders/filters/operators/not-null.mjs.map +1 -1
- package/dist/server/services/builders/filters/operators/not.js.map +1 -1
- package/dist/server/services/builders/filters/operators/not.mjs.map +1 -1
- package/dist/server/services/builders/filters/operators/null.js.map +1 -1
- package/dist/server/services/builders/filters/operators/null.mjs.map +1 -1
- package/dist/server/services/builders/filters/operators/or.js.map +1 -1
- package/dist/server/services/builders/filters/operators/or.mjs.map +1 -1
- package/dist/server/services/builders/filters/operators/starts-with.js.map +1 -1
- package/dist/server/services/builders/filters/operators/starts-with.mjs.map +1 -1
- package/dist/server/services/builders/generic-morph.js.map +1 -1
- package/dist/server/services/builders/generic-morph.mjs.map +1 -1
- package/dist/server/services/builders/index.js.map +1 -1
- package/dist/server/services/builders/index.mjs.map +1 -1
- package/dist/server/services/builders/input.js.map +1 -1
- package/dist/server/services/builders/input.mjs.map +1 -1
- package/dist/server/services/builders/mutations/collection-type.js.map +1 -1
- package/dist/server/services/builders/mutations/collection-type.mjs.map +1 -1
- package/dist/server/services/builders/mutations/index.js.map +1 -1
- package/dist/server/services/builders/mutations/index.mjs.map +1 -1
- package/dist/server/services/builders/mutations/single-type.js.map +1 -1
- package/dist/server/services/builders/mutations/single-type.mjs.map +1 -1
- package/dist/server/services/builders/queries/collection-type.js.map +1 -1
- package/dist/server/services/builders/queries/collection-type.mjs.map +1 -1
- package/dist/server/services/builders/queries/index.js.map +1 -1
- package/dist/server/services/builders/queries/index.mjs.map +1 -1
- package/dist/server/services/builders/queries/single-type.js.map +1 -1
- package/dist/server/services/builders/queries/single-type.mjs.map +1 -1
- package/dist/server/services/builders/relation-response-collection.js.map +1 -1
- package/dist/server/services/builders/relation-response-collection.mjs.map +1 -1
- package/dist/server/services/builders/resolvers/association.js.map +1 -1
- package/dist/server/services/builders/resolvers/association.mjs +1 -1
- package/dist/server/services/builders/resolvers/association.mjs.map +1 -1
- package/dist/server/services/builders/resolvers/component.js.map +1 -1
- package/dist/server/services/builders/resolvers/component.mjs.map +1 -1
- package/dist/server/services/builders/resolvers/dynamic-zone.js.map +1 -1
- package/dist/server/services/builders/resolvers/dynamic-zone.mjs.map +1 -1
- package/dist/server/services/builders/resolvers/index.js.map +1 -1
- package/dist/server/services/builders/resolvers/index.mjs.map +1 -1
- package/dist/server/services/builders/resolvers/pagination.js.map +1 -1
- package/dist/server/services/builders/resolvers/pagination.mjs.map +1 -1
- package/dist/server/services/builders/resolvers/query.js.map +1 -1
- package/dist/server/services/builders/resolvers/query.mjs.map +1 -1
- package/dist/server/services/builders/response-collection.js.map +1 -1
- package/dist/server/services/builders/response-collection.mjs.map +1 -1
- package/dist/server/services/builders/response.js.map +1 -1
- package/dist/server/services/builders/response.mjs.map +1 -1
- package/dist/server/services/builders/type.js +1 -3
- package/dist/server/services/builders/type.js.map +1 -1
- package/dist/server/services/builders/type.mjs +1 -3
- package/dist/server/services/builders/type.mjs.map +1 -1
- package/dist/server/services/builders/utils.js.map +1 -1
- package/dist/server/services/builders/utils.mjs +2 -2
- package/dist/server/services/builders/utils.mjs.map +1 -1
- package/dist/server/services/constants.js.map +1 -1
- package/dist/server/services/constants.mjs.map +1 -1
- package/dist/server/services/content-api/index.js.map +1 -1
- package/dist/server/services/content-api/index.mjs.map +1 -1
- package/dist/server/services/content-api/policy.js.map +1 -1
- package/dist/server/services/content-api/policy.mjs +1 -1
- package/dist/server/services/content-api/policy.mjs.map +1 -1
- package/dist/server/services/content-api/register-functions/collection-type.js.map +1 -1
- package/dist/server/services/content-api/register-functions/collection-type.mjs.map +1 -1
- package/dist/server/services/content-api/register-functions/component.js.map +1 -1
- package/dist/server/services/content-api/register-functions/component.mjs.map +1 -1
- package/dist/server/services/content-api/register-functions/dynamic-zones.js.map +1 -1
- package/dist/server/services/content-api/register-functions/dynamic-zones.mjs.map +1 -1
- package/dist/server/services/content-api/register-functions/enums.js.map +1 -1
- package/dist/server/services/content-api/register-functions/enums.mjs.map +1 -1
- package/dist/server/services/content-api/register-functions/filters.js.map +1 -1
- package/dist/server/services/content-api/register-functions/filters.mjs.map +1 -1
- package/dist/server/services/content-api/register-functions/inputs.js.map +1 -1
- package/dist/server/services/content-api/register-functions/inputs.mjs.map +1 -1
- package/dist/server/services/content-api/register-functions/internals.js.map +1 -1
- package/dist/server/services/content-api/register-functions/internals.mjs.map +1 -1
- package/dist/server/services/content-api/register-functions/polymorphic.js.map +1 -1
- package/dist/server/services/content-api/register-functions/polymorphic.mjs.map +1 -1
- package/dist/server/services/content-api/register-functions/scalars.js.map +1 -1
- package/dist/server/services/content-api/register-functions/scalars.mjs.map +1 -1
- package/dist/server/services/content-api/register-functions/single-type.js.map +1 -1
- package/dist/server/services/content-api/register-functions/single-type.mjs.map +1 -1
- package/dist/server/services/content-api/wrap-resolvers.js.map +1 -1
- package/dist/server/services/content-api/wrap-resolvers.mjs.map +1 -1
- package/dist/server/services/extension/extension.js.map +1 -1
- package/dist/server/services/extension/extension.mjs.map +1 -1
- package/dist/server/services/extension/shadow-crud-manager.js.map +1 -1
- package/dist/server/services/extension/shadow-crud-manager.mjs.map +1 -1
- package/dist/server/services/format/index.js.map +1 -1
- package/dist/server/services/format/index.mjs.map +1 -1
- package/dist/server/services/format/return-types.js.map +1 -1
- package/dist/server/services/format/return-types.mjs.map +1 -1
- package/dist/server/services/index.js +8 -8
- package/dist/server/services/index.js.map +1 -1
- package/dist/server/services/index.mjs.map +1 -1
- package/dist/server/services/internals/args/index.js.map +1 -1
- package/dist/server/services/internals/args/index.mjs.map +1 -1
- package/dist/server/services/internals/args/pagination.js.map +1 -1
- package/dist/server/services/internals/args/pagination.mjs.map +1 -1
- package/dist/server/services/internals/args/publication-status.js.map +1 -1
- package/dist/server/services/internals/args/publication-status.mjs.map +1 -1
- package/dist/server/services/internals/args/sort.js.map +1 -1
- package/dist/server/services/internals/args/sort.mjs.map +1 -1
- package/dist/server/services/internals/helpers/get-enabled-scalars.js.map +1 -1
- package/dist/server/services/internals/helpers/get-enabled-scalars.mjs.map +1 -1
- package/dist/server/services/internals/helpers/index.js.map +1 -1
- package/dist/server/services/internals/helpers/index.mjs.map +1 -1
- package/dist/server/services/internals/index.js +8 -8
- package/dist/server/services/internals/index.js.map +1 -1
- package/dist/server/services/internals/index.mjs.map +1 -1
- package/dist/server/services/internals/scalars/date.js.map +1 -1
- package/dist/server/services/internals/scalars/date.mjs.map +1 -1
- package/dist/server/services/internals/scalars/index.js.map +1 -1
- package/dist/server/services/internals/scalars/index.mjs +1 -1
- package/dist/server/services/internals/scalars/index.mjs.map +1 -1
- package/dist/server/services/internals/scalars/time.js.map +1 -1
- package/dist/server/services/internals/scalars/time.mjs +1 -1
- package/dist/server/services/internals/scalars/time.mjs.map +1 -1
- package/dist/server/services/internals/types/delete-mutation-response.js.map +1 -1
- package/dist/server/services/internals/types/delete-mutation-response.mjs.map +1 -1
- package/dist/server/services/internals/types/error.js.map +1 -1
- package/dist/server/services/internals/types/error.mjs.map +1 -1
- package/dist/server/services/internals/types/filters.js.map +1 -1
- package/dist/server/services/internals/types/filters.mjs.map +1 -1
- package/dist/server/services/internals/types/index.js.map +1 -1
- package/dist/server/services/internals/types/index.mjs.map +1 -1
- package/dist/server/services/internals/types/pagination.js.map +1 -1
- package/dist/server/services/internals/types/pagination.mjs.map +1 -1
- package/dist/server/services/internals/types/publication-status.js.map +1 -1
- package/dist/server/services/internals/types/publication-status.mjs.map +1 -1
- package/dist/server/services/internals/types/response-collection-meta.js.map +1 -1
- package/dist/server/services/internals/types/response-collection-meta.mjs.map +1 -1
- package/dist/server/services/type-registry.js.map +1 -1
- package/dist/server/services/type-registry.mjs.map +1 -1
- package/dist/server/services/utils/attributes.js.map +1 -1
- package/dist/server/services/utils/attributes.mjs.map +1 -1
- package/dist/server/services/utils/index.js.map +1 -1
- package/dist/server/services/utils/index.mjs.map +1 -1
- package/dist/server/services/utils/mappers/entity-to-response-entity.js.map +1 -1
- package/dist/server/services/utils/mappers/entity-to-response-entity.mjs +5 -5
- package/dist/server/services/utils/mappers/entity-to-response-entity.mjs.map +1 -1
- package/dist/server/services/utils/mappers/graphql-filters-to-strapi-query.js.map +1 -1
- package/dist/server/services/utils/mappers/graphql-filters-to-strapi-query.mjs.map +1 -1
- package/dist/server/services/utils/mappers/graphql-scalar-to-operators.js.map +1 -1
- package/dist/server/services/utils/mappers/graphql-scalar-to-operators.mjs.map +1 -1
- package/dist/server/services/utils/mappers/index.js.map +1 -1
- package/dist/server/services/utils/mappers/index.mjs.map +1 -1
- package/dist/server/services/utils/mappers/strapi-scalar-to-graphql-scalar.js.map +1 -1
- package/dist/server/services/utils/mappers/strapi-scalar-to-graphql-scalar.mjs.map +1 -1
- package/dist/server/services/utils/naming.js.map +1 -1
- package/dist/server/services/utils/naming.mjs.map +1 -1
- package/dist/server/services/utils/playground.js.map +1 -1
- package/dist/server/services/utils/playground.mjs.map +1 -1
- package/package.json +8 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ne.mjs","sources":["../../../../../../server/src/services/builders/filters/operators/ne.ts"],"sourcesContent":["import type * as Nexus from 'nexus';\n\nconst NE_FIELD_NAME = 'ne';\n\nexport default () => ({\n fieldName: NE_FIELD_NAME,\n\n strapiOperator: '$ne',\n\n add(t: Nexus.blocks.ObjectDefinitionBlock<string>, type: string) {\n t.field(NE_FIELD_NAME, { type });\n },\n});\n"],"names":["NE_FIELD_NAME","fieldName","strapiOperator","add","t","type","field"],"mappings":"AAEA,MAAMA,
|
|
1
|
+
{"version":3,"file":"ne.mjs","sources":["../../../../../../server/src/services/builders/filters/operators/ne.ts"],"sourcesContent":["import type * as Nexus from 'nexus';\n\nconst NE_FIELD_NAME = 'ne';\n\nexport default () => ({\n fieldName: NE_FIELD_NAME,\n\n strapiOperator: '$ne',\n\n add(t: Nexus.blocks.ObjectDefinitionBlock<string>, type: string) {\n t.field(NE_FIELD_NAME, { type });\n },\n});\n"],"names":["NE_FIELD_NAME","fieldName","strapiOperator","add","t","type","field"],"mappings":"AAEA,MAAMA,aAAAA,GAAgB,IAAA;AAEtB,iBAAe,CAAA,KAAO;QACpBC,SAAAA,EAAWD,aAAAA;QAEXE,cAAAA,EAAgB,KAAA;QAEhBC,GAAAA,CAAAA,CAAIC,CAA6C,EAAEC,IAAY,EAAA;YAC7DD,CAAAA,CAAEE,KAAK,CAACN,aAAAA,EAAe;AAAEK,gBAAAA;AAAK,aAAA,CAAA;AAChC,QAAA;AACF,KAAA,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nei.js","sources":["../../../../../../server/src/services/builders/filters/operators/nei.ts"],"sourcesContent":["import type * as Nexus from 'nexus';\n\nconst NEI_FIELD_NAME = 'nei';\n\nexport default () => ({\n fieldName: NEI_FIELD_NAME,\n\n strapiOperator: '$nei',\n\n add(t: Nexus.blocks.ObjectDefinitionBlock<string>, type: string) {\n t.field(NEI_FIELD_NAME, { type });\n },\n});\n"],"names":["NEI_FIELD_NAME","fieldName","strapiOperator","add","t","type","field"],"mappings":";;AAEA,MAAMA,
|
|
1
|
+
{"version":3,"file":"nei.js","sources":["../../../../../../server/src/services/builders/filters/operators/nei.ts"],"sourcesContent":["import type * as Nexus from 'nexus';\n\nconst NEI_FIELD_NAME = 'nei';\n\nexport default () => ({\n fieldName: NEI_FIELD_NAME,\n\n strapiOperator: '$nei',\n\n add(t: Nexus.blocks.ObjectDefinitionBlock<string>, type: string) {\n t.field(NEI_FIELD_NAME, { type });\n },\n});\n"],"names":["NEI_FIELD_NAME","fieldName","strapiOperator","add","t","type","field"],"mappings":";;AAEA,MAAMA,cAAAA,GAAiB,KAAA;AAEvB,kBAAe,CAAA,KAAO;QACpBC,SAAAA,EAAWD,cAAAA;QAEXE,cAAAA,EAAgB,MAAA;QAEhBC,GAAAA,CAAAA,CAAIC,CAA6C,EAAEC,IAAY,EAAA;YAC7DD,CAAAA,CAAEE,KAAK,CAACN,cAAAA,EAAgB;AAAEK,gBAAAA;AAAK,aAAA,CAAA;AACjC,QAAA;AACF,KAAA,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nei.mjs","sources":["../../../../../../server/src/services/builders/filters/operators/nei.ts"],"sourcesContent":["import type * as Nexus from 'nexus';\n\nconst NEI_FIELD_NAME = 'nei';\n\nexport default () => ({\n fieldName: NEI_FIELD_NAME,\n\n strapiOperator: '$nei',\n\n add(t: Nexus.blocks.ObjectDefinitionBlock<string>, type: string) {\n t.field(NEI_FIELD_NAME, { type });\n },\n});\n"],"names":["NEI_FIELD_NAME","fieldName","strapiOperator","add","t","type","field"],"mappings":"AAEA,MAAMA,
|
|
1
|
+
{"version":3,"file":"nei.mjs","sources":["../../../../../../server/src/services/builders/filters/operators/nei.ts"],"sourcesContent":["import type * as Nexus from 'nexus';\n\nconst NEI_FIELD_NAME = 'nei';\n\nexport default () => ({\n fieldName: NEI_FIELD_NAME,\n\n strapiOperator: '$nei',\n\n add(t: Nexus.blocks.ObjectDefinitionBlock<string>, type: string) {\n t.field(NEI_FIELD_NAME, { type });\n },\n});\n"],"names":["NEI_FIELD_NAME","fieldName","strapiOperator","add","t","type","field"],"mappings":"AAEA,MAAMA,cAAAA,GAAiB,KAAA;AAEvB,kBAAe,CAAA,KAAO;QACpBC,SAAAA,EAAWD,cAAAA;QAEXE,cAAAA,EAAgB,MAAA;QAEhBC,GAAAA,CAAAA,CAAIC,CAA6C,EAAEC,IAAY,EAAA;YAC7DD,CAAAA,CAAEE,KAAK,CAACN,cAAAA,EAAgB;AAAEK,gBAAAA;AAAK,aAAA,CAAA;AACjC,QAAA;AACF,KAAA,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"not-contains.js","sources":["../../../../../../server/src/services/builders/filters/operators/not-contains.ts"],"sourcesContent":["import type * as Nexus from 'nexus';\n\nconst NOT_CONTAINS_FIELD_NAME = 'notContains';\n\nexport default () => ({\n fieldName: NOT_CONTAINS_FIELD_NAME,\n\n strapiOperator: '$notContains',\n\n add(t: Nexus.blocks.ObjectDefinitionBlock<string>, type: string) {\n t.field(NOT_CONTAINS_FIELD_NAME, { type });\n },\n});\n"],"names":["NOT_CONTAINS_FIELD_NAME","fieldName","strapiOperator","add","t","type","field"],"mappings":";;AAEA,MAAMA,
|
|
1
|
+
{"version":3,"file":"not-contains.js","sources":["../../../../../../server/src/services/builders/filters/operators/not-contains.ts"],"sourcesContent":["import type * as Nexus from 'nexus';\n\nconst NOT_CONTAINS_FIELD_NAME = 'notContains';\n\nexport default () => ({\n fieldName: NOT_CONTAINS_FIELD_NAME,\n\n strapiOperator: '$notContains',\n\n add(t: Nexus.blocks.ObjectDefinitionBlock<string>, type: string) {\n t.field(NOT_CONTAINS_FIELD_NAME, { type });\n },\n});\n"],"names":["NOT_CONTAINS_FIELD_NAME","fieldName","strapiOperator","add","t","type","field"],"mappings":";;AAEA,MAAMA,uBAAAA,GAA0B,aAAA;AAEhC,0BAAe,CAAA,KAAO;QACpBC,SAAAA,EAAWD,uBAAAA;QAEXE,cAAAA,EAAgB,cAAA;QAEhBC,GAAAA,CAAAA,CAAIC,CAA6C,EAAEC,IAAY,EAAA;YAC7DD,CAAAA,CAAEE,KAAK,CAACN,uBAAAA,EAAyB;AAAEK,gBAAAA;AAAK,aAAA,CAAA;AAC1C,QAAA;AACF,KAAA,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"not-contains.mjs","sources":["../../../../../../server/src/services/builders/filters/operators/not-contains.ts"],"sourcesContent":["import type * as Nexus from 'nexus';\n\nconst NOT_CONTAINS_FIELD_NAME = 'notContains';\n\nexport default () => ({\n fieldName: NOT_CONTAINS_FIELD_NAME,\n\n strapiOperator: '$notContains',\n\n add(t: Nexus.blocks.ObjectDefinitionBlock<string>, type: string) {\n t.field(NOT_CONTAINS_FIELD_NAME, { type });\n },\n});\n"],"names":["NOT_CONTAINS_FIELD_NAME","fieldName","strapiOperator","add","t","type","field"],"mappings":"AAEA,MAAMA,
|
|
1
|
+
{"version":3,"file":"not-contains.mjs","sources":["../../../../../../server/src/services/builders/filters/operators/not-contains.ts"],"sourcesContent":["import type * as Nexus from 'nexus';\n\nconst NOT_CONTAINS_FIELD_NAME = 'notContains';\n\nexport default () => ({\n fieldName: NOT_CONTAINS_FIELD_NAME,\n\n strapiOperator: '$notContains',\n\n add(t: Nexus.blocks.ObjectDefinitionBlock<string>, type: string) {\n t.field(NOT_CONTAINS_FIELD_NAME, { type });\n },\n});\n"],"names":["NOT_CONTAINS_FIELD_NAME","fieldName","strapiOperator","add","t","type","field"],"mappings":"AAEA,MAAMA,uBAAAA,GAA0B,aAAA;AAEhC,0BAAe,CAAA,KAAO;QACpBC,SAAAA,EAAWD,uBAAAA;QAEXE,cAAAA,EAAgB,cAAA;QAEhBC,GAAAA,CAAAA,CAAIC,CAA6C,EAAEC,IAAY,EAAA;YAC7DD,CAAAA,CAAEE,KAAK,CAACN,uBAAAA,EAAyB;AAAEK,gBAAAA;AAAK,aAAA,CAAA;AAC1C,QAAA;AACF,KAAA,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"not-containsi.js","sources":["../../../../../../server/src/services/builders/filters/operators/not-containsi.ts"],"sourcesContent":["import type * as Nexus from 'nexus';\n\nconst NOT_CONTAINSI_FIELD_NAME = 'notContainsi';\n\nexport default () => ({\n fieldName: NOT_CONTAINSI_FIELD_NAME,\n\n strapiOperator: '$notContainsi',\n\n add(t: Nexus.blocks.ObjectDefinitionBlock<string>, type: string) {\n t.field(NOT_CONTAINSI_FIELD_NAME, { type });\n },\n});\n"],"names":["NOT_CONTAINSI_FIELD_NAME","fieldName","strapiOperator","add","t","type","field"],"mappings":";;AAEA,MAAMA,
|
|
1
|
+
{"version":3,"file":"not-containsi.js","sources":["../../../../../../server/src/services/builders/filters/operators/not-containsi.ts"],"sourcesContent":["import type * as Nexus from 'nexus';\n\nconst NOT_CONTAINSI_FIELD_NAME = 'notContainsi';\n\nexport default () => ({\n fieldName: NOT_CONTAINSI_FIELD_NAME,\n\n strapiOperator: '$notContainsi',\n\n add(t: Nexus.blocks.ObjectDefinitionBlock<string>, type: string) {\n t.field(NOT_CONTAINSI_FIELD_NAME, { type });\n },\n});\n"],"names":["NOT_CONTAINSI_FIELD_NAME","fieldName","strapiOperator","add","t","type","field"],"mappings":";;AAEA,MAAMA,wBAAAA,GAA2B,cAAA;AAEjC,2BAAe,CAAA,KAAO;QACpBC,SAAAA,EAAWD,wBAAAA;QAEXE,cAAAA,EAAgB,eAAA;QAEhBC,GAAAA,CAAAA,CAAIC,CAA6C,EAAEC,IAAY,EAAA;YAC7DD,CAAAA,CAAEE,KAAK,CAACN,wBAAAA,EAA0B;AAAEK,gBAAAA;AAAK,aAAA,CAAA;AAC3C,QAAA;AACF,KAAA,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"not-containsi.mjs","sources":["../../../../../../server/src/services/builders/filters/operators/not-containsi.ts"],"sourcesContent":["import type * as Nexus from 'nexus';\n\nconst NOT_CONTAINSI_FIELD_NAME = 'notContainsi';\n\nexport default () => ({\n fieldName: NOT_CONTAINSI_FIELD_NAME,\n\n strapiOperator: '$notContainsi',\n\n add(t: Nexus.blocks.ObjectDefinitionBlock<string>, type: string) {\n t.field(NOT_CONTAINSI_FIELD_NAME, { type });\n },\n});\n"],"names":["NOT_CONTAINSI_FIELD_NAME","fieldName","strapiOperator","add","t","type","field"],"mappings":"AAEA,MAAMA,
|
|
1
|
+
{"version":3,"file":"not-containsi.mjs","sources":["../../../../../../server/src/services/builders/filters/operators/not-containsi.ts"],"sourcesContent":["import type * as Nexus from 'nexus';\n\nconst NOT_CONTAINSI_FIELD_NAME = 'notContainsi';\n\nexport default () => ({\n fieldName: NOT_CONTAINSI_FIELD_NAME,\n\n strapiOperator: '$notContainsi',\n\n add(t: Nexus.blocks.ObjectDefinitionBlock<string>, type: string) {\n t.field(NOT_CONTAINSI_FIELD_NAME, { type });\n },\n});\n"],"names":["NOT_CONTAINSI_FIELD_NAME","fieldName","strapiOperator","add","t","type","field"],"mappings":"AAEA,MAAMA,wBAAAA,GAA2B,cAAA;AAEjC,2BAAe,CAAA,KAAO;QACpBC,SAAAA,EAAWD,wBAAAA;QAEXE,cAAAA,EAAgB,eAAA;QAEhBC,GAAAA,CAAAA,CAAIC,CAA6C,EAAEC,IAAY,EAAA;YAC7DD,CAAAA,CAAEE,KAAK,CAACN,wBAAAA,EAA0B;AAAEK,gBAAAA;AAAK,aAAA,CAAA;AAC3C,QAAA;AACF,KAAA,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"not-in.js","sources":["../../../../../../server/src/services/builders/filters/operators/not-in.ts"],"sourcesContent":["import { list } from 'nexus';\nimport type * as Nexus from 'nexus';\n\nconst NOT_IN_FIELD_NAME = 'notIn';\n\nexport default () => ({\n fieldName: NOT_IN_FIELD_NAME,\n\n strapiOperator: '$notIn',\n\n add(t: Nexus.blocks.ObjectDefinitionBlock<string>, type: string) {\n t.field(NOT_IN_FIELD_NAME, { type: list(type) });\n },\n});\n"],"names":["NOT_IN_FIELD_NAME","fieldName","strapiOperator","add","t","type","field","list"],"mappings":";;;;AAGA,MAAMA,
|
|
1
|
+
{"version":3,"file":"not-in.js","sources":["../../../../../../server/src/services/builders/filters/operators/not-in.ts"],"sourcesContent":["import { list } from 'nexus';\nimport type * as Nexus from 'nexus';\n\nconst NOT_IN_FIELD_NAME = 'notIn';\n\nexport default () => ({\n fieldName: NOT_IN_FIELD_NAME,\n\n strapiOperator: '$notIn',\n\n add(t: Nexus.blocks.ObjectDefinitionBlock<string>, type: string) {\n t.field(NOT_IN_FIELD_NAME, { type: list(type) });\n },\n});\n"],"names":["NOT_IN_FIELD_NAME","fieldName","strapiOperator","add","t","type","field","list"],"mappings":";;;;AAGA,MAAMA,iBAAAA,GAAoB,OAAA;AAE1B,oBAAe,CAAA,KAAO;QACpBC,SAAAA,EAAWD,iBAAAA;QAEXE,cAAAA,EAAgB,QAAA;QAEhBC,GAAAA,CAAAA,CAAIC,CAA6C,EAAEC,IAAY,EAAA;YAC7DD,CAAAA,CAAEE,KAAK,CAACN,iBAAAA,EAAmB;AAAEK,gBAAAA,IAAAA,EAAME,UAAAA,CAAKF,IAAAA;AAAM,aAAA,CAAA;AAChD,QAAA;AACF,KAAA,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"not-in.mjs","sources":["../../../../../../server/src/services/builders/filters/operators/not-in.ts"],"sourcesContent":["import { list } from 'nexus';\nimport type * as Nexus from 'nexus';\n\nconst NOT_IN_FIELD_NAME = 'notIn';\n\nexport default () => ({\n fieldName: NOT_IN_FIELD_NAME,\n\n strapiOperator: '$notIn',\n\n add(t: Nexus.blocks.ObjectDefinitionBlock<string>, type: string) {\n t.field(NOT_IN_FIELD_NAME, { type: list(type) });\n },\n});\n"],"names":["NOT_IN_FIELD_NAME","fieldName","strapiOperator","add","t","type","field","list"],"mappings":";;AAGA,MAAMA,
|
|
1
|
+
{"version":3,"file":"not-in.mjs","sources":["../../../../../../server/src/services/builders/filters/operators/not-in.ts"],"sourcesContent":["import { list } from 'nexus';\nimport type * as Nexus from 'nexus';\n\nconst NOT_IN_FIELD_NAME = 'notIn';\n\nexport default () => ({\n fieldName: NOT_IN_FIELD_NAME,\n\n strapiOperator: '$notIn',\n\n add(t: Nexus.blocks.ObjectDefinitionBlock<string>, type: string) {\n t.field(NOT_IN_FIELD_NAME, { type: list(type) });\n },\n});\n"],"names":["NOT_IN_FIELD_NAME","fieldName","strapiOperator","add","t","type","field","list"],"mappings":";;AAGA,MAAMA,iBAAAA,GAAoB,OAAA;AAE1B,oBAAe,CAAA,KAAO;QACpBC,SAAAA,EAAWD,iBAAAA;QAEXE,cAAAA,EAAgB,QAAA;QAEhBC,GAAAA,CAAAA,CAAIC,CAA6C,EAAEC,IAAY,EAAA;YAC7DD,CAAAA,CAAEE,KAAK,CAACN,iBAAAA,EAAmB;AAAEK,gBAAAA,IAAAA,EAAME,IAAAA,CAAKF,IAAAA;AAAM,aAAA,CAAA;AAChD,QAAA;AACF,KAAA,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"not-null.js","sources":["../../../../../../server/src/services/builders/filters/operators/not-null.ts"],"sourcesContent":["import type * as Nexus from 'nexus';\n\nconst NOT_NULL_FIELD_NAME = 'notNull';\n\nexport default () => ({\n fieldName: NOT_NULL_FIELD_NAME,\n\n strapiOperator: '$notNull',\n\n add(t: Nexus.blocks.ObjectDefinitionBlock<string>) {\n t.boolean(NOT_NULL_FIELD_NAME);\n },\n});\n"],"names":["NOT_NULL_FIELD_NAME","fieldName","strapiOperator","add","t","boolean"],"mappings":";;AAEA,MAAMA,
|
|
1
|
+
{"version":3,"file":"not-null.js","sources":["../../../../../../server/src/services/builders/filters/operators/not-null.ts"],"sourcesContent":["import type * as Nexus from 'nexus';\n\nconst NOT_NULL_FIELD_NAME = 'notNull';\n\nexport default () => ({\n fieldName: NOT_NULL_FIELD_NAME,\n\n strapiOperator: '$notNull',\n\n add(t: Nexus.blocks.ObjectDefinitionBlock<string>) {\n t.boolean(NOT_NULL_FIELD_NAME);\n },\n});\n"],"names":["NOT_NULL_FIELD_NAME","fieldName","strapiOperator","add","t","boolean"],"mappings":";;AAEA,MAAMA,mBAAAA,GAAsB,SAAA;AAE5B,sBAAe,CAAA,KAAO;QACpBC,SAAAA,EAAWD,mBAAAA;QAEXE,cAAAA,EAAgB,UAAA;AAEhBC,QAAAA,GAAAA,CAAAA,CAAIC,CAA6C,EAAA;AAC/CA,YAAAA,CAAAA,CAAEC,OAAO,CAACL,mBAAAA,CAAAA;AACZ,QAAA;AACF,KAAA,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"not-null.mjs","sources":["../../../../../../server/src/services/builders/filters/operators/not-null.ts"],"sourcesContent":["import type * as Nexus from 'nexus';\n\nconst NOT_NULL_FIELD_NAME = 'notNull';\n\nexport default () => ({\n fieldName: NOT_NULL_FIELD_NAME,\n\n strapiOperator: '$notNull',\n\n add(t: Nexus.blocks.ObjectDefinitionBlock<string>) {\n t.boolean(NOT_NULL_FIELD_NAME);\n },\n});\n"],"names":["NOT_NULL_FIELD_NAME","fieldName","strapiOperator","add","t","boolean"],"mappings":"AAEA,MAAMA,
|
|
1
|
+
{"version":3,"file":"not-null.mjs","sources":["../../../../../../server/src/services/builders/filters/operators/not-null.ts"],"sourcesContent":["import type * as Nexus from 'nexus';\n\nconst NOT_NULL_FIELD_NAME = 'notNull';\n\nexport default () => ({\n fieldName: NOT_NULL_FIELD_NAME,\n\n strapiOperator: '$notNull',\n\n add(t: Nexus.blocks.ObjectDefinitionBlock<string>) {\n t.boolean(NOT_NULL_FIELD_NAME);\n },\n});\n"],"names":["NOT_NULL_FIELD_NAME","fieldName","strapiOperator","add","t","boolean"],"mappings":"AAEA,MAAMA,mBAAAA,GAAsB,SAAA;AAE5B,sBAAe,CAAA,KAAO;QACpBC,SAAAA,EAAWD,mBAAAA;QAEXE,cAAAA,EAAgB,UAAA;AAEhBC,QAAAA,GAAAA,CAAAA,CAAIC,CAA6C,EAAA;AAC/CA,YAAAA,CAAAA,CAAEC,OAAO,CAACL,mBAAAA,CAAAA;AACZ,QAAA;AACF,KAAA,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"not.js","sources":["../../../../../../server/src/services/builders/filters/operators/not.ts"],"sourcesContent":["import type * as Nexus from 'nexus';\nimport type { Core } from '@strapi/types';\n\nconst NOT_FIELD_NAME = 'not';\n\nexport default ({ strapi }: { strapi: Core.Strapi }) => ({\n fieldName: NOT_FIELD_NAME,\n\n strapiOperator: '$not',\n\n add(t: Nexus.blocks.ObjectDefinitionBlock<string>, type: string) {\n const { naming, attributes } = strapi.plugin('graphql').service('utils');\n\n if (attributes.isGraphQLScalar({ type })) {\n t.field(NOT_FIELD_NAME, { type: naming.getScalarFilterInputTypeName(type) });\n } else {\n t.field(NOT_FIELD_NAME, { type });\n }\n },\n});\n"],"names":["NOT_FIELD_NAME","strapi","fieldName","strapiOperator","add","t","type","naming","attributes","plugin","service","isGraphQLScalar","field","getScalarFilterInputTypeName"],"mappings":";;AAGA,MAAMA,
|
|
1
|
+
{"version":3,"file":"not.js","sources":["../../../../../../server/src/services/builders/filters/operators/not.ts"],"sourcesContent":["import type * as Nexus from 'nexus';\nimport type { Core } from '@strapi/types';\n\nconst NOT_FIELD_NAME = 'not';\n\nexport default ({ strapi }: { strapi: Core.Strapi }) => ({\n fieldName: NOT_FIELD_NAME,\n\n strapiOperator: '$not',\n\n add(t: Nexus.blocks.ObjectDefinitionBlock<string>, type: string) {\n const { naming, attributes } = strapi.plugin('graphql').service('utils');\n\n if (attributes.isGraphQLScalar({ type })) {\n t.field(NOT_FIELD_NAME, { type: naming.getScalarFilterInputTypeName(type) });\n } else {\n t.field(NOT_FIELD_NAME, { type });\n }\n },\n});\n"],"names":["NOT_FIELD_NAME","strapi","fieldName","strapiOperator","add","t","type","naming","attributes","plugin","service","isGraphQLScalar","field","getScalarFilterInputTypeName"],"mappings":";;AAGA,MAAMA,cAAAA,GAAiB,KAAA;AAEvB,kBAAe,CAAA,CAAC,EAAEC,MAAM,EAA2B,IAAM;QACvDC,SAAAA,EAAWF,cAAAA;QAEXG,cAAAA,EAAgB,MAAA;QAEhBC,GAAAA,CAAAA,CAAIC,CAA6C,EAAEC,IAAY,EAAA;YAC7D,MAAM,EAAEC,MAAM,EAAEC,UAAU,EAAE,GAAGP,MAAAA,CAAOQ,MAAM,CAAC,SAAA,CAAA,CAAWC,OAAO,CAAC,OAAA,CAAA;YAEhE,IAAIF,UAAAA,CAAWG,eAAe,CAAC;AAAEL,gBAAAA;aAAK,CAAA,EAAI;gBACxCD,CAAAA,CAAEO,KAAK,CAACZ,cAAAA,EAAgB;oBAAEM,IAAAA,EAAMC,MAAAA,CAAOM,4BAA4B,CAACP,IAAAA;AAAM,iBAAA,CAAA;YAC5E,CAAA,MAAO;gBACLD,CAAAA,CAAEO,KAAK,CAACZ,cAAAA,EAAgB;AAAEM,oBAAAA;AAAK,iBAAA,CAAA;AACjC,YAAA;AACF,QAAA;AACF,KAAA,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"not.mjs","sources":["../../../../../../server/src/services/builders/filters/operators/not.ts"],"sourcesContent":["import type * as Nexus from 'nexus';\nimport type { Core } from '@strapi/types';\n\nconst NOT_FIELD_NAME = 'not';\n\nexport default ({ strapi }: { strapi: Core.Strapi }) => ({\n fieldName: NOT_FIELD_NAME,\n\n strapiOperator: '$not',\n\n add(t: Nexus.blocks.ObjectDefinitionBlock<string>, type: string) {\n const { naming, attributes } = strapi.plugin('graphql').service('utils');\n\n if (attributes.isGraphQLScalar({ type })) {\n t.field(NOT_FIELD_NAME, { type: naming.getScalarFilterInputTypeName(type) });\n } else {\n t.field(NOT_FIELD_NAME, { type });\n }\n },\n});\n"],"names":["NOT_FIELD_NAME","strapi","fieldName","strapiOperator","add","t","type","naming","attributes","plugin","service","isGraphQLScalar","field","getScalarFilterInputTypeName"],"mappings":"AAGA,MAAMA,
|
|
1
|
+
{"version":3,"file":"not.mjs","sources":["../../../../../../server/src/services/builders/filters/operators/not.ts"],"sourcesContent":["import type * as Nexus from 'nexus';\nimport type { Core } from '@strapi/types';\n\nconst NOT_FIELD_NAME = 'not';\n\nexport default ({ strapi }: { strapi: Core.Strapi }) => ({\n fieldName: NOT_FIELD_NAME,\n\n strapiOperator: '$not',\n\n add(t: Nexus.blocks.ObjectDefinitionBlock<string>, type: string) {\n const { naming, attributes } = strapi.plugin('graphql').service('utils');\n\n if (attributes.isGraphQLScalar({ type })) {\n t.field(NOT_FIELD_NAME, { type: naming.getScalarFilterInputTypeName(type) });\n } else {\n t.field(NOT_FIELD_NAME, { type });\n }\n },\n});\n"],"names":["NOT_FIELD_NAME","strapi","fieldName","strapiOperator","add","t","type","naming","attributes","plugin","service","isGraphQLScalar","field","getScalarFilterInputTypeName"],"mappings":"AAGA,MAAMA,cAAAA,GAAiB,KAAA;AAEvB,kBAAe,CAAA,CAAC,EAAEC,MAAM,EAA2B,IAAM;QACvDC,SAAAA,EAAWF,cAAAA;QAEXG,cAAAA,EAAgB,MAAA;QAEhBC,GAAAA,CAAAA,CAAIC,CAA6C,EAAEC,IAAY,EAAA;YAC7D,MAAM,EAAEC,MAAM,EAAEC,UAAU,EAAE,GAAGP,MAAAA,CAAOQ,MAAM,CAAC,SAAA,CAAA,CAAWC,OAAO,CAAC,OAAA,CAAA;YAEhE,IAAIF,UAAAA,CAAWG,eAAe,CAAC;AAAEL,gBAAAA;aAAK,CAAA,EAAI;gBACxCD,CAAAA,CAAEO,KAAK,CAACZ,cAAAA,EAAgB;oBAAEM,IAAAA,EAAMC,MAAAA,CAAOM,4BAA4B,CAACP,IAAAA;AAAM,iBAAA,CAAA;YAC5E,CAAA,MAAO;gBACLD,CAAAA,CAAEO,KAAK,CAACZ,cAAAA,EAAgB;AAAEM,oBAAAA;AAAK,iBAAA,CAAA;AACjC,YAAA;AACF,QAAA;AACF,KAAA,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"null.js","sources":["../../../../../../server/src/services/builders/filters/operators/null.ts"],"sourcesContent":["import type * as Nexus from 'nexus';\n\nconst NULL_FIELD_NAME = 'null';\n\nexport default () => ({\n fieldName: NULL_FIELD_NAME,\n\n strapiOperator: '$null',\n\n add(t: Nexus.blocks.ObjectDefinitionBlock<string>) {\n t.boolean(NULL_FIELD_NAME);\n },\n});\n"],"names":["NULL_FIELD_NAME","fieldName","strapiOperator","add","t","boolean"],"mappings":";;AAEA,MAAMA,
|
|
1
|
+
{"version":3,"file":"null.js","sources":["../../../../../../server/src/services/builders/filters/operators/null.ts"],"sourcesContent":["import type * as Nexus from 'nexus';\n\nconst NULL_FIELD_NAME = 'null';\n\nexport default () => ({\n fieldName: NULL_FIELD_NAME,\n\n strapiOperator: '$null',\n\n add(t: Nexus.blocks.ObjectDefinitionBlock<string>) {\n t.boolean(NULL_FIELD_NAME);\n },\n});\n"],"names":["NULL_FIELD_NAME","fieldName","strapiOperator","add","t","boolean"],"mappings":";;AAEA,MAAMA,eAAAA,GAAkB,MAAA;AAExB,mBAAe,CAAA,KAAO;QACpBC,SAAAA,EAAWD,eAAAA;QAEXE,cAAAA,EAAgB,OAAA;AAEhBC,QAAAA,GAAAA,CAAAA,CAAIC,CAA6C,EAAA;AAC/CA,YAAAA,CAAAA,CAAEC,OAAO,CAACL,eAAAA,CAAAA;AACZ,QAAA;AACF,KAAA,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"null.mjs","sources":["../../../../../../server/src/services/builders/filters/operators/null.ts"],"sourcesContent":["import type * as Nexus from 'nexus';\n\nconst NULL_FIELD_NAME = 'null';\n\nexport default () => ({\n fieldName: NULL_FIELD_NAME,\n\n strapiOperator: '$null',\n\n add(t: Nexus.blocks.ObjectDefinitionBlock<string>) {\n t.boolean(NULL_FIELD_NAME);\n },\n});\n"],"names":["NULL_FIELD_NAME","fieldName","strapiOperator","add","t","boolean"],"mappings":"AAEA,MAAMA,
|
|
1
|
+
{"version":3,"file":"null.mjs","sources":["../../../../../../server/src/services/builders/filters/operators/null.ts"],"sourcesContent":["import type * as Nexus from 'nexus';\n\nconst NULL_FIELD_NAME = 'null';\n\nexport default () => ({\n fieldName: NULL_FIELD_NAME,\n\n strapiOperator: '$null',\n\n add(t: Nexus.blocks.ObjectDefinitionBlock<string>) {\n t.boolean(NULL_FIELD_NAME);\n },\n});\n"],"names":["NULL_FIELD_NAME","fieldName","strapiOperator","add","t","boolean"],"mappings":"AAEA,MAAMA,eAAAA,GAAkB,MAAA;AAExB,mBAAe,CAAA,KAAO;QACpBC,SAAAA,EAAWD,eAAAA;QAEXE,cAAAA,EAAgB,OAAA;AAEhBC,QAAAA,GAAAA,CAAAA,CAAIC,CAA6C,EAAA;AAC/CA,YAAAA,CAAAA,CAAEC,OAAO,CAACL,eAAAA,CAAAA;AACZ,QAAA;AACF,KAAA,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"or.js","sources":["../../../../../../server/src/services/builders/filters/operators/or.ts"],"sourcesContent":["import { list } from 'nexus';\nimport type * as Nexus from 'nexus';\n\nconst OR_FIELD_NAME = 'or';\n\nexport default () => ({\n fieldName: OR_FIELD_NAME,\n\n strapiOperator: '$or',\n\n add(t: Nexus.blocks.ObjectDefinitionBlock<string>, type: string) {\n t.field(OR_FIELD_NAME, { type: list(type) });\n },\n});\n"],"names":["OR_FIELD_NAME","fieldName","strapiOperator","add","t","type","field","list"],"mappings":";;;;AAGA,MAAMA,
|
|
1
|
+
{"version":3,"file":"or.js","sources":["../../../../../../server/src/services/builders/filters/operators/or.ts"],"sourcesContent":["import { list } from 'nexus';\nimport type * as Nexus from 'nexus';\n\nconst OR_FIELD_NAME = 'or';\n\nexport default () => ({\n fieldName: OR_FIELD_NAME,\n\n strapiOperator: '$or',\n\n add(t: Nexus.blocks.ObjectDefinitionBlock<string>, type: string) {\n t.field(OR_FIELD_NAME, { type: list(type) });\n },\n});\n"],"names":["OR_FIELD_NAME","fieldName","strapiOperator","add","t","type","field","list"],"mappings":";;;;AAGA,MAAMA,aAAAA,GAAgB,IAAA;AAEtB,iBAAe,CAAA,KAAO;QACpBC,SAAAA,EAAWD,aAAAA;QAEXE,cAAAA,EAAgB,KAAA;QAEhBC,GAAAA,CAAAA,CAAIC,CAA6C,EAAEC,IAAY,EAAA;YAC7DD,CAAAA,CAAEE,KAAK,CAACN,aAAAA,EAAe;AAAEK,gBAAAA,IAAAA,EAAME,UAAAA,CAAKF,IAAAA;AAAM,aAAA,CAAA;AAC5C,QAAA;AACF,KAAA,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"or.mjs","sources":["../../../../../../server/src/services/builders/filters/operators/or.ts"],"sourcesContent":["import { list } from 'nexus';\nimport type * as Nexus from 'nexus';\n\nconst OR_FIELD_NAME = 'or';\n\nexport default () => ({\n fieldName: OR_FIELD_NAME,\n\n strapiOperator: '$or',\n\n add(t: Nexus.blocks.ObjectDefinitionBlock<string>, type: string) {\n t.field(OR_FIELD_NAME, { type: list(type) });\n },\n});\n"],"names":["OR_FIELD_NAME","fieldName","strapiOperator","add","t","type","field","list"],"mappings":";;AAGA,MAAMA,
|
|
1
|
+
{"version":3,"file":"or.mjs","sources":["../../../../../../server/src/services/builders/filters/operators/or.ts"],"sourcesContent":["import { list } from 'nexus';\nimport type * as Nexus from 'nexus';\n\nconst OR_FIELD_NAME = 'or';\n\nexport default () => ({\n fieldName: OR_FIELD_NAME,\n\n strapiOperator: '$or',\n\n add(t: Nexus.blocks.ObjectDefinitionBlock<string>, type: string) {\n t.field(OR_FIELD_NAME, { type: list(type) });\n },\n});\n"],"names":["OR_FIELD_NAME","fieldName","strapiOperator","add","t","type","field","list"],"mappings":";;AAGA,MAAMA,aAAAA,GAAgB,IAAA;AAEtB,iBAAe,CAAA,KAAO;QACpBC,SAAAA,EAAWD,aAAAA;QAEXE,cAAAA,EAAgB,KAAA;QAEhBC,GAAAA,CAAAA,CAAIC,CAA6C,EAAEC,IAAY,EAAA;YAC7DD,CAAAA,CAAEE,KAAK,CAACN,aAAAA,EAAe;AAAEK,gBAAAA,IAAAA,EAAME,IAAAA,CAAKF,IAAAA;AAAM,aAAA,CAAA;AAC5C,QAAA;AACF,KAAA,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"starts-with.js","sources":["../../../../../../server/src/services/builders/filters/operators/starts-with.ts"],"sourcesContent":["import type * as Nexus from 'nexus';\n\nconst STARTS_WITH_FIELD_NAME = 'startsWith';\n\nexport default () => ({\n fieldName: STARTS_WITH_FIELD_NAME,\n\n strapiOperator: '$startsWith',\n\n add(t: Nexus.blocks.ObjectDefinitionBlock<string>, type: string) {\n t.field(STARTS_WITH_FIELD_NAME, { type });\n },\n});\n"],"names":["STARTS_WITH_FIELD_NAME","fieldName","strapiOperator","add","t","type","field"],"mappings":";;AAEA,MAAMA,
|
|
1
|
+
{"version":3,"file":"starts-with.js","sources":["../../../../../../server/src/services/builders/filters/operators/starts-with.ts"],"sourcesContent":["import type * as Nexus from 'nexus';\n\nconst STARTS_WITH_FIELD_NAME = 'startsWith';\n\nexport default () => ({\n fieldName: STARTS_WITH_FIELD_NAME,\n\n strapiOperator: '$startsWith',\n\n add(t: Nexus.blocks.ObjectDefinitionBlock<string>, type: string) {\n t.field(STARTS_WITH_FIELD_NAME, { type });\n },\n});\n"],"names":["STARTS_WITH_FIELD_NAME","fieldName","strapiOperator","add","t","type","field"],"mappings":";;AAEA,MAAMA,sBAAAA,GAAyB,YAAA;AAE/B,yBAAe,CAAA,KAAO;QACpBC,SAAAA,EAAWD,sBAAAA;QAEXE,cAAAA,EAAgB,aAAA;QAEhBC,GAAAA,CAAAA,CAAIC,CAA6C,EAAEC,IAAY,EAAA;YAC7DD,CAAAA,CAAEE,KAAK,CAACN,sBAAAA,EAAwB;AAAEK,gBAAAA;AAAK,aAAA,CAAA;AACzC,QAAA;AACF,KAAA,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"starts-with.mjs","sources":["../../../../../../server/src/services/builders/filters/operators/starts-with.ts"],"sourcesContent":["import type * as Nexus from 'nexus';\n\nconst STARTS_WITH_FIELD_NAME = 'startsWith';\n\nexport default () => ({\n fieldName: STARTS_WITH_FIELD_NAME,\n\n strapiOperator: '$startsWith',\n\n add(t: Nexus.blocks.ObjectDefinitionBlock<string>, type: string) {\n t.field(STARTS_WITH_FIELD_NAME, { type });\n },\n});\n"],"names":["STARTS_WITH_FIELD_NAME","fieldName","strapiOperator","add","t","type","field"],"mappings":"AAEA,MAAMA,
|
|
1
|
+
{"version":3,"file":"starts-with.mjs","sources":["../../../../../../server/src/services/builders/filters/operators/starts-with.ts"],"sourcesContent":["import type * as Nexus from 'nexus';\n\nconst STARTS_WITH_FIELD_NAME = 'startsWith';\n\nexport default () => ({\n fieldName: STARTS_WITH_FIELD_NAME,\n\n strapiOperator: '$startsWith',\n\n add(t: Nexus.blocks.ObjectDefinitionBlock<string>, type: string) {\n t.field(STARTS_WITH_FIELD_NAME, { type });\n },\n});\n"],"names":["STARTS_WITH_FIELD_NAME","fieldName","strapiOperator","add","t","type","field"],"mappings":"AAEA,MAAMA,sBAAAA,GAAyB,YAAA;AAE/B,yBAAe,CAAA,KAAO;QACpBC,SAAAA,EAAWD,sBAAAA;QAEXE,cAAAA,EAAgB,aAAA;QAEhBC,GAAAA,CAAAA,CAAIC,CAA6C,EAAEC,IAAY,EAAA;YAC7DD,CAAAA,CAAEE,KAAK,CAACN,sBAAAA,EAAwB;AAAEK,gBAAAA;AAAK,aAAA,CAAA;AACzC,QAAA;AACF,KAAA,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generic-morph.js","sources":["../../../../server/src/services/builders/generic-morph.ts"],"sourcesContent":["import { unionType } from 'nexus';\nimport { prop } from 'lodash/fp';\n\nimport type { Context } from '../types';\n\nexport default ({ strapi, registry }: Context) => {\n const { naming } = strapi.plugin('graphql').service('utils');\n const { KINDS, GENERIC_MORPH_TYPENAME } = strapi.plugin('graphql').service('constants');\n\n return {\n buildGenericMorphDefinition() {\n return unionType({\n name: GENERIC_MORPH_TYPENAME,\n\n resolveType(obj: any) {\n const contentType = strapi.getModel(obj.__type);\n\n if (!contentType) {\n return null;\n }\n\n if (contentType.modelType === 'component') {\n return naming.getComponentName(contentType);\n }\n\n return naming.getTypeName(contentType);\n },\n\n definition(t: any) {\n const members = registry\n // Resolve every content-type or component\n .where(({ config }) => [KINDS.type, KINDS.component].includes(config.kind))\n // Only keep their name (the type's id)\n .map(prop('name'));\n\n t.members(...members);\n },\n });\n },\n };\n};\n"],"names":["strapi","registry","naming","plugin","service","KINDS","GENERIC_MORPH_TYPENAME","buildGenericMorphDefinition","unionType","name","resolveType","obj","contentType","getModel","__type","modelType","getComponentName","getTypeName","definition","t","members","where","config","type","component","includes","kind","map","prop"],"mappings":";;;;;AAKA,mBAAe,CAAA,CAAC,EAAEA,MAAM,EAAEC,QAAQ,EAAW,GAAA;IAC3C,MAAM,EAAEC,MAAM,EAAE,GAAGF,OAAOG,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"generic-morph.js","sources":["../../../../server/src/services/builders/generic-morph.ts"],"sourcesContent":["import { unionType } from 'nexus';\nimport { prop } from 'lodash/fp';\n\nimport type { Context } from '../types';\n\nexport default ({ strapi, registry }: Context) => {\n const { naming } = strapi.plugin('graphql').service('utils');\n const { KINDS, GENERIC_MORPH_TYPENAME } = strapi.plugin('graphql').service('constants');\n\n return {\n buildGenericMorphDefinition() {\n return unionType({\n name: GENERIC_MORPH_TYPENAME,\n\n resolveType(obj: any) {\n const contentType = strapi.getModel(obj.__type);\n\n if (!contentType) {\n return null;\n }\n\n if (contentType.modelType === 'component') {\n return naming.getComponentName(contentType);\n }\n\n return naming.getTypeName(contentType);\n },\n\n definition(t: any) {\n const members = registry\n // Resolve every content-type or component\n .where(({ config }) => [KINDS.type, KINDS.component].includes(config.kind))\n // Only keep their name (the type's id)\n .map(prop('name'));\n\n t.members(...members);\n },\n });\n },\n };\n};\n"],"names":["strapi","registry","naming","plugin","service","KINDS","GENERIC_MORPH_TYPENAME","buildGenericMorphDefinition","unionType","name","resolveType","obj","contentType","getModel","__type","modelType","getComponentName","getTypeName","definition","t","members","where","config","type","component","includes","kind","map","prop"],"mappings":";;;;;AAKA,mBAAe,CAAA,CAAC,EAAEA,MAAM,EAAEC,QAAQ,EAAW,GAAA;IAC3C,MAAM,EAAEC,MAAM,EAAE,GAAGF,OAAOG,MAAM,CAAC,SAAA,CAAA,CAAWC,OAAO,CAAC,OAAA,CAAA;IACpD,MAAM,EAAEC,KAAK,EAAEC,sBAAsB,EAAE,GAAGN,MAAAA,CAAOG,MAAM,CAAC,SAAA,CAAA,CAAWC,OAAO,CAAC,WAAA,CAAA;IAE3E,OAAO;AACLG,QAAAA,2BAAAA,CAAAA,GAAAA;AACE,YAAA,OAAOC,eAAAA,CAAU;gBACfC,IAAAA,EAAMH,sBAAAA;AAENI,gBAAAA,WAAAA,CAAAA,CAAYC,GAAQ,EAAA;AAClB,oBAAA,MAAMC,WAAAA,GAAcZ,MAAAA,CAAOa,QAAQ,CAACF,IAAIG,MAAM,CAAA;AAE9C,oBAAA,IAAI,CAACF,WAAAA,EAAa;wBAChB,OAAO,IAAA;AACT,oBAAA;oBAEA,IAAIA,WAAAA,CAAYG,SAAS,KAAK,WAAA,EAAa;wBACzC,OAAOb,MAAAA,CAAOc,gBAAgB,CAACJ,WAAAA,CAAAA;AACjC,oBAAA;oBAEA,OAAOV,MAAAA,CAAOe,WAAW,CAACL,WAAAA,CAAAA;AAC5B,gBAAA,CAAA;AAEAM,gBAAAA,UAAAA,CAAAA,CAAWC,CAAM,EAAA;oBACf,MAAMC,OAAAA,GAAUnB,QACd;AACCoB,qBAAAA,KAAK,CAAC,CAAC,EAAEC,MAAM,EAAE,GAAK;AAACjB,4BAAAA,KAAAA,CAAMkB,IAAI;AAAElB,4BAAAA,KAAAA,CAAMmB;AAAU,yBAAA,CAACC,QAAQ,CAACH,MAAAA,CAAOI,IAAI,EACzE;AACCC,qBAAAA,GAAG,CAACC,OAAAA,CAAK,MAAA,CAAA,CAAA;AAEZT,oBAAAA,CAAAA,CAAEC,OAAO,CAAA,GAAIA,OAAAA,CAAAA;AACf,gBAAA;AACF,aAAA,CAAA;AACF,QAAA;AACF,KAAA;AACF,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generic-morph.mjs","sources":["../../../../server/src/services/builders/generic-morph.ts"],"sourcesContent":["import { unionType } from 'nexus';\nimport { prop } from 'lodash/fp';\n\nimport type { Context } from '../types';\n\nexport default ({ strapi, registry }: Context) => {\n const { naming } = strapi.plugin('graphql').service('utils');\n const { KINDS, GENERIC_MORPH_TYPENAME } = strapi.plugin('graphql').service('constants');\n\n return {\n buildGenericMorphDefinition() {\n return unionType({\n name: GENERIC_MORPH_TYPENAME,\n\n resolveType(obj: any) {\n const contentType = strapi.getModel(obj.__type);\n\n if (!contentType) {\n return null;\n }\n\n if (contentType.modelType === 'component') {\n return naming.getComponentName(contentType);\n }\n\n return naming.getTypeName(contentType);\n },\n\n definition(t: any) {\n const members = registry\n // Resolve every content-type or component\n .where(({ config }) => [KINDS.type, KINDS.component].includes(config.kind))\n // Only keep their name (the type's id)\n .map(prop('name'));\n\n t.members(...members);\n },\n });\n },\n };\n};\n"],"names":["strapi","registry","naming","plugin","service","KINDS","GENERIC_MORPH_TYPENAME","buildGenericMorphDefinition","unionType","name","resolveType","obj","contentType","getModel","__type","modelType","getComponentName","getTypeName","definition","t","members","where","config","type","component","includes","kind","map","prop"],"mappings":";;;AAKA,mBAAe,CAAA,CAAC,EAAEA,MAAM,EAAEC,QAAQ,EAAW,GAAA;IAC3C,MAAM,EAAEC,MAAM,EAAE,GAAGF,OAAOG,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"generic-morph.mjs","sources":["../../../../server/src/services/builders/generic-morph.ts"],"sourcesContent":["import { unionType } from 'nexus';\nimport { prop } from 'lodash/fp';\n\nimport type { Context } from '../types';\n\nexport default ({ strapi, registry }: Context) => {\n const { naming } = strapi.plugin('graphql').service('utils');\n const { KINDS, GENERIC_MORPH_TYPENAME } = strapi.plugin('graphql').service('constants');\n\n return {\n buildGenericMorphDefinition() {\n return unionType({\n name: GENERIC_MORPH_TYPENAME,\n\n resolveType(obj: any) {\n const contentType = strapi.getModel(obj.__type);\n\n if (!contentType) {\n return null;\n }\n\n if (contentType.modelType === 'component') {\n return naming.getComponentName(contentType);\n }\n\n return naming.getTypeName(contentType);\n },\n\n definition(t: any) {\n const members = registry\n // Resolve every content-type or component\n .where(({ config }) => [KINDS.type, KINDS.component].includes(config.kind))\n // Only keep their name (the type's id)\n .map(prop('name'));\n\n t.members(...members);\n },\n });\n },\n };\n};\n"],"names":["strapi","registry","naming","plugin","service","KINDS","GENERIC_MORPH_TYPENAME","buildGenericMorphDefinition","unionType","name","resolveType","obj","contentType","getModel","__type","modelType","getComponentName","getTypeName","definition","t","members","where","config","type","component","includes","kind","map","prop"],"mappings":";;;AAKA,mBAAe,CAAA,CAAC,EAAEA,MAAM,EAAEC,QAAQ,EAAW,GAAA;IAC3C,MAAM,EAAEC,MAAM,EAAE,GAAGF,OAAOG,MAAM,CAAC,SAAA,CAAA,CAAWC,OAAO,CAAC,OAAA,CAAA;IACpD,MAAM,EAAEC,KAAK,EAAEC,sBAAsB,EAAE,GAAGN,MAAAA,CAAOG,MAAM,CAAC,SAAA,CAAA,CAAWC,OAAO,CAAC,WAAA,CAAA;IAE3E,OAAO;AACLG,QAAAA,2BAAAA,CAAAA,GAAAA;AACE,YAAA,OAAOC,SAAAA,CAAU;gBACfC,IAAAA,EAAMH,sBAAAA;AAENI,gBAAAA,WAAAA,CAAAA,CAAYC,GAAQ,EAAA;AAClB,oBAAA,MAAMC,WAAAA,GAAcZ,MAAAA,CAAOa,QAAQ,CAACF,IAAIG,MAAM,CAAA;AAE9C,oBAAA,IAAI,CAACF,WAAAA,EAAa;wBAChB,OAAO,IAAA;AACT,oBAAA;oBAEA,IAAIA,WAAAA,CAAYG,SAAS,KAAK,WAAA,EAAa;wBACzC,OAAOb,MAAAA,CAAOc,gBAAgB,CAACJ,WAAAA,CAAAA;AACjC,oBAAA;oBAEA,OAAOV,MAAAA,CAAOe,WAAW,CAACL,WAAAA,CAAAA;AAC5B,gBAAA,CAAA;AAEAM,gBAAAA,UAAAA,CAAAA,CAAWC,CAAM,EAAA;oBACf,MAAMC,OAAAA,GAAUnB,QACd;AACCoB,qBAAAA,KAAK,CAAC,CAAC,EAAEC,MAAM,EAAE,GAAK;AAACjB,4BAAAA,KAAAA,CAAMkB,IAAI;AAAElB,4BAAAA,KAAAA,CAAMmB;AAAU,yBAAA,CAACC,QAAQ,CAACH,MAAAA,CAAOI,IAAI,EACzE;AACCC,qBAAAA,GAAG,CAACC,IAAAA,CAAK,MAAA,CAAA,CAAA;AAEZT,oBAAAA,CAAAA,CAAEC,OAAO,CAAA,GAAIA,OAAAA,CAAAA;AACf,gBAAA;AACF,aAAA,CAAA;AACF,QAAA;AACF,KAAA;AACF,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../server/src/services/builders/index.ts"],"sourcesContent":["import { merge, map, pipe, reduce } from 'lodash/fp';\nimport type { Core } from '@strapi/types';\n\n// Builders Factories\n\nimport enums from './enums';\nimport dynamicZone from './dynamic-zones';\nimport entity from './entity';\nimport typeBuilder from './type';\nimport response from './response';\nimport responseCollection from './response-collection';\nimport relationResponseCollection from './relation-response-collection';\nimport queries from './queries';\nimport mutations from './mutations';\nimport filters from './filters';\nimport inputs from './input';\nimport genericMorph from './generic-morph';\nimport resolvers from './resolvers';\n\n// Misc\n\nimport operators from './filters/operators';\nimport utils from './utils';\nimport type { TypeRegistry } from '../type-registry';\n\nconst buildersFactories = [\n enums,\n dynamicZone,\n entity,\n typeBuilder,\n response,\n responseCollection,\n relationResponseCollection,\n queries,\n mutations,\n filters,\n inputs,\n genericMorph,\n resolvers,\n];\n\nexport default ({ strapi }: { strapi: Core.Strapi }) => {\n const buildersMap = new Map();\n\n return {\n /**\n * Instantiate every builder with a strapi instance & a type registry\n */\n new(name: string, registry: TypeRegistry) {\n const context = { strapi, registry };\n\n const builders = pipe(\n // Create a new instance of every builders\n map((factory: any) => factory(context)),\n // Merge every builder into the same object\n reduce(merge, {})\n ).call(null, buildersFactories);\n\n buildersMap.set(name, builders);\n\n return builders;\n },\n\n /**\n * Delete a set of builders instances from\n * the builders map for a given name\n */\n delete(name: string) {\n buildersMap.delete(name);\n },\n\n /**\n * Retrieve a set of builders instances from\n * the builders map for a given name\n */\n get(name: string) {\n return buildersMap.get(name);\n },\n\n filters: {\n operators: operators({ strapi }),\n },\n\n utils: utils({ strapi }),\n };\n};\n"],"names":["buildersFactories","enums","dynamicZone","entity","typeBuilder","response","responseCollection","relationResponseCollection","queries","mutations","filters","inputs","genericMorph","resolvers","strapi","buildersMap","Map","new","name","registry","context","builders","pipe","map","factory","reduce","merge","call","set","delete","get","operators","utils"],"mappings":";;;;;;;;;;;;;;;;;;;AAyBA,MAAMA,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../server/src/services/builders/index.ts"],"sourcesContent":["import { merge, map, pipe, reduce } from 'lodash/fp';\nimport type { Core } from '@strapi/types';\n\n// Builders Factories\n\nimport enums from './enums';\nimport dynamicZone from './dynamic-zones';\nimport entity from './entity';\nimport typeBuilder from './type';\nimport response from './response';\nimport responseCollection from './response-collection';\nimport relationResponseCollection from './relation-response-collection';\nimport queries from './queries';\nimport mutations from './mutations';\nimport filters from './filters';\nimport inputs from './input';\nimport genericMorph from './generic-morph';\nimport resolvers from './resolvers';\n\n// Misc\n\nimport operators from './filters/operators';\nimport utils from './utils';\nimport type { TypeRegistry } from '../type-registry';\n\nconst buildersFactories = [\n enums,\n dynamicZone,\n entity,\n typeBuilder,\n response,\n responseCollection,\n relationResponseCollection,\n queries,\n mutations,\n filters,\n inputs,\n genericMorph,\n resolvers,\n];\n\nexport default ({ strapi }: { strapi: Core.Strapi }) => {\n const buildersMap = new Map();\n\n return {\n /**\n * Instantiate every builder with a strapi instance & a type registry\n */\n new(name: string, registry: TypeRegistry) {\n const context = { strapi, registry };\n\n const builders = pipe(\n // Create a new instance of every builders\n map((factory: any) => factory(context)),\n // Merge every builder into the same object\n reduce(merge, {})\n ).call(null, buildersFactories);\n\n buildersMap.set(name, builders);\n\n return builders;\n },\n\n /**\n * Delete a set of builders instances from\n * the builders map for a given name\n */\n delete(name: string) {\n buildersMap.delete(name);\n },\n\n /**\n * Retrieve a set of builders instances from\n * the builders map for a given name\n */\n get(name: string) {\n return buildersMap.get(name);\n },\n\n filters: {\n operators: operators({ strapi }),\n },\n\n utils: utils({ strapi }),\n };\n};\n"],"names":["buildersFactories","enums","dynamicZone","entity","typeBuilder","response","responseCollection","relationResponseCollection","queries","mutations","filters","inputs","genericMorph","resolvers","strapi","buildersMap","Map","new","name","registry","context","builders","pipe","map","factory","reduce","merge","call","set","delete","get","operators","utils"],"mappings":";;;;;;;;;;;;;;;;;;;AAyBA,MAAMA,iBAAAA,GAAoB;AACxBC,IAAAA,KAAAA;AACAC,IAAAA,YAAAA;AACAC,IAAAA,MAAAA;AACAC,IAAAA,IAAAA;AACAC,IAAAA,QAAAA;AACAC,IAAAA,kBAAAA;AACAC,IAAAA,0BAAAA;AACAC,IAAAA,OAAAA;AACAC,IAAAA,OAAAA;AACAC,IAAAA,OAAAA;AACAC,IAAAA,KAAAA;AACAC,IAAAA,YAAAA;AACAC,IAAAA;AACD,CAAA;AAED,eAAe,CAAA,CAAC,EAAEC,MAAM,EAA2B,GAAA;AACjD,IAAA,MAAMC,cAAc,IAAIC,GAAAA,EAAAA;IAExB,OAAO;AACL;;QAGAC,GAAAA,CAAAA,CAAIC,IAAY,EAAEC,QAAsB,EAAA;AACtC,YAAA,MAAMC,OAAAA,GAAU;AAAEN,gBAAAA,MAAAA;AAAQK,gBAAAA;AAAS,aAAA;YAEnC,MAAME,QAAAA,GAAWC;AAEfC,YAAAA,MAAAA,CAAI,CAACC,OAAAA,GAAiBA,OAAAA,CAAQJ,OAAAA,CAAAA,CAAAA;AAE9BK,YAAAA,SAAAA,CAAOC,QAAAA,EAAO,EAAC,CAAA,CAAA,CACfC,IAAI,CAAC,IAAA,EAAM3B,iBAAAA,CAAAA;YAEbe,WAAAA,CAAYa,GAAG,CAACV,IAAAA,EAAMG,QAAAA,CAAAA;YAEtB,OAAOA,QAAAA;AACT,QAAA,CAAA;AAEA;;;AAGC,QACDQ,QAAOX,IAAY,EAAA;AACjBH,YAAAA,WAAAA,CAAYc,MAAM,CAACX,IAAAA,CAAAA;AACrB,QAAA,CAAA;AAEA;;;AAGC,QACDY,KAAIZ,IAAY,EAAA;YACd,OAAOH,WAAAA,CAAYe,GAAG,CAACZ,IAAAA,CAAAA;AACzB,QAAA,CAAA;QAEAR,OAAAA,EAAS;AACPqB,YAAAA,SAAAA,EAAWA,KAAAA,CAAU;AAAEjB,gBAAAA;AAAO,aAAA;AAChC,SAAA;AAEAkB,QAAAA,KAAAA,EAAOA,KAAAA,CAAM;AAAElB,YAAAA;AAAO,SAAA;AACxB,KAAA;AACF,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../../server/src/services/builders/index.ts"],"sourcesContent":["import { merge, map, pipe, reduce } from 'lodash/fp';\nimport type { Core } from '@strapi/types';\n\n// Builders Factories\n\nimport enums from './enums';\nimport dynamicZone from './dynamic-zones';\nimport entity from './entity';\nimport typeBuilder from './type';\nimport response from './response';\nimport responseCollection from './response-collection';\nimport relationResponseCollection from './relation-response-collection';\nimport queries from './queries';\nimport mutations from './mutations';\nimport filters from './filters';\nimport inputs from './input';\nimport genericMorph from './generic-morph';\nimport resolvers from './resolvers';\n\n// Misc\n\nimport operators from './filters/operators';\nimport utils from './utils';\nimport type { TypeRegistry } from '../type-registry';\n\nconst buildersFactories = [\n enums,\n dynamicZone,\n entity,\n typeBuilder,\n response,\n responseCollection,\n relationResponseCollection,\n queries,\n mutations,\n filters,\n inputs,\n genericMorph,\n resolvers,\n];\n\nexport default ({ strapi }: { strapi: Core.Strapi }) => {\n const buildersMap = new Map();\n\n return {\n /**\n * Instantiate every builder with a strapi instance & a type registry\n */\n new(name: string, registry: TypeRegistry) {\n const context = { strapi, registry };\n\n const builders = pipe(\n // Create a new instance of every builders\n map((factory: any) => factory(context)),\n // Merge every builder into the same object\n reduce(merge, {})\n ).call(null, buildersFactories);\n\n buildersMap.set(name, builders);\n\n return builders;\n },\n\n /**\n * Delete a set of builders instances from\n * the builders map for a given name\n */\n delete(name: string) {\n buildersMap.delete(name);\n },\n\n /**\n * Retrieve a set of builders instances from\n * the builders map for a given name\n */\n get(name: string) {\n return buildersMap.get(name);\n },\n\n filters: {\n operators: operators({ strapi }),\n },\n\n utils: utils({ strapi }),\n };\n};\n"],"names":["buildersFactories","enums","dynamicZone","entity","typeBuilder","response","responseCollection","relationResponseCollection","queries","mutations","filters","inputs","genericMorph","resolvers","strapi","buildersMap","Map","new","name","registry","context","builders","pipe","map","factory","reduce","merge","call","set","delete","get","operators","utils"],"mappings":";;;;;;;;;;;;;;;;;AAyBA,MAAMA,
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../server/src/services/builders/index.ts"],"sourcesContent":["import { merge, map, pipe, reduce } from 'lodash/fp';\nimport type { Core } from '@strapi/types';\n\n// Builders Factories\n\nimport enums from './enums';\nimport dynamicZone from './dynamic-zones';\nimport entity from './entity';\nimport typeBuilder from './type';\nimport response from './response';\nimport responseCollection from './response-collection';\nimport relationResponseCollection from './relation-response-collection';\nimport queries from './queries';\nimport mutations from './mutations';\nimport filters from './filters';\nimport inputs from './input';\nimport genericMorph from './generic-morph';\nimport resolvers from './resolvers';\n\n// Misc\n\nimport operators from './filters/operators';\nimport utils from './utils';\nimport type { TypeRegistry } from '../type-registry';\n\nconst buildersFactories = [\n enums,\n dynamicZone,\n entity,\n typeBuilder,\n response,\n responseCollection,\n relationResponseCollection,\n queries,\n mutations,\n filters,\n inputs,\n genericMorph,\n resolvers,\n];\n\nexport default ({ strapi }: { strapi: Core.Strapi }) => {\n const buildersMap = new Map();\n\n return {\n /**\n * Instantiate every builder with a strapi instance & a type registry\n */\n new(name: string, registry: TypeRegistry) {\n const context = { strapi, registry };\n\n const builders = pipe(\n // Create a new instance of every builders\n map((factory: any) => factory(context)),\n // Merge every builder into the same object\n reduce(merge, {})\n ).call(null, buildersFactories);\n\n buildersMap.set(name, builders);\n\n return builders;\n },\n\n /**\n * Delete a set of builders instances from\n * the builders map for a given name\n */\n delete(name: string) {\n buildersMap.delete(name);\n },\n\n /**\n * Retrieve a set of builders instances from\n * the builders map for a given name\n */\n get(name: string) {\n return buildersMap.get(name);\n },\n\n filters: {\n operators: operators({ strapi }),\n },\n\n utils: utils({ strapi }),\n };\n};\n"],"names":["buildersFactories","enums","dynamicZone","entity","typeBuilder","response","responseCollection","relationResponseCollection","queries","mutations","filters","inputs","genericMorph","resolvers","strapi","buildersMap","Map","new","name","registry","context","builders","pipe","map","factory","reduce","merge","call","set","delete","get","operators","utils"],"mappings":";;;;;;;;;;;;;;;;;AAyBA,MAAMA,iBAAAA,GAAoB;AACxBC,IAAAA,KAAAA;AACAC,IAAAA,WAAAA;AACAC,IAAAA,MAAAA;AACAC,IAAAA,WAAAA;AACAC,IAAAA,QAAAA;AACAC,IAAAA,kBAAAA;AACAC,IAAAA,0BAAAA;AACAC,IAAAA,OAAAA;AACAC,IAAAA,SAAAA;AACAC,IAAAA,OAAAA;AACAC,IAAAA,MAAAA;AACAC,IAAAA,YAAAA;AACAC,IAAAA;AACD,CAAA;AAED,eAAe,CAAA,CAAC,EAAEC,MAAM,EAA2B,GAAA;AACjD,IAAA,MAAMC,cAAc,IAAIC,GAAAA,EAAAA;IAExB,OAAO;AACL;;QAGAC,GAAAA,CAAAA,CAAIC,IAAY,EAAEC,QAAsB,EAAA;AACtC,YAAA,MAAMC,OAAAA,GAAU;AAAEN,gBAAAA,MAAAA;AAAQK,gBAAAA;AAAS,aAAA;YAEnC,MAAME,QAAAA,GAAWC;AAEfC,YAAAA,GAAAA,CAAI,CAACC,OAAAA,GAAiBA,OAAAA,CAAQJ,OAAAA,CAAAA,CAAAA;AAE9BK,YAAAA,MAAAA,CAAOC,KAAAA,EAAO,EAAC,CAAA,CAAA,CACfC,IAAI,CAAC,IAAA,EAAM3B,iBAAAA,CAAAA;YAEbe,WAAAA,CAAYa,GAAG,CAACV,IAAAA,EAAMG,QAAAA,CAAAA;YAEtB,OAAOA,QAAAA;AACT,QAAA,CAAA;AAEA;;;AAGC,QACDQ,QAAOX,IAAY,EAAA;AACjBH,YAAAA,WAAAA,CAAYc,MAAM,CAACX,IAAAA,CAAAA;AACrB,QAAA,CAAA;AAEA;;;AAGC,QACDY,KAAIZ,IAAY,EAAA;YACd,OAAOH,WAAAA,CAAYe,GAAG,CAACZ,IAAAA,CAAAA;AACzB,QAAA,CAAA;QAEAR,OAAAA,EAAS;AACPqB,YAAAA,SAAAA,EAAWA,SAAAA,CAAU;AAAEjB,gBAAAA;AAAO,aAAA;AAChC,SAAA;AAEAkB,QAAAA,KAAAA,EAAOA,KAAAA,CAAM;AAAElB,YAAAA;AAAO,SAAA;AACxB,KAAA;AACF,CAAA;;;;"}
|
|
@@ -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,
|
|
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;AAEF,IAAA,MAAM,EACJU,cAAc,EACdC,UAAU,EACVC,eAAe,EACfC,OAAO,EACPC,aAAa,EACbC,WAAW,EACXC,aAAa,EACd,GAAGd,UAAAA;IAEJ,OAAO;AACLe,QAAAA,cAAAA,CAAAA,CAAeC,WAA0B,EAAA;AACvC,YAAA,MAAM,EAAEhB,UAAU,EAAEiB,SAAS,EAAE,GAAGD,WAAAA;YAElC,MAAME,IAAAA,GAAO,CACXD,SAAAA,KAAc,WAAA,GAAcb,wBAAwBC,uBAAsB,EAC1Ec,IAAI,CAAC,IAAA,EAAMH,WAAAA,CAAAA;AAEb,YAAA,OAAOI,qBAAAA,CAAgB;AACrBF,gBAAAA,IAAAA;AAEAG,gBAAAA,UAAAA,CAAAA,CAAWC,CAAC,EAAA;AACV,oBAAA,MAAMC,iBAAiB,CAACC,SAAAA,GAAAA;wBACtB,OAAOrB,SAAAA,CAAUsB,UAAU,CAACT,WAAAA,CAAYU,GAAG,CAAA,CAAEC,KAAK,CAACH,SAAAA,CAAAA,CAAWI,eAAe,EAAA;AAC/E,oBAAA,CAAA;AAEA,oBAAA,MAAMC,eAAAA,GAAkBC,MAAAA,CAAOC,OAAO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;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 +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;AAEhC,aAAe,CAAA,CAAC,EAAEC,MAAM,EAAW,GAAA;AACjC,IAAA,MAAM,EAAEC,MAAM,EAAEC,OAAO,EAAEC,UAAU,EAAE,GAAGH,
|
|
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;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;AAEF,IAAA,MAAM,EACJU,cAAc,EACdC,UAAU,EACVC,eAAe,EACfC,OAAO,EACPC,aAAa,EACbC,WAAW,EACXC,aAAa,EACd,GAAGd,UAAAA;IAEJ,OAAO;AACLe,QAAAA,cAAAA,CAAAA,CAAeC,WAA0B,EAAA;AACvC,YAAA,MAAM,EAAEhB,UAAU,EAAEiB,SAAS,EAAE,GAAGD,WAAAA;YAElC,MAAME,IAAAA,GAAO,CACXD,SAAAA,KAAc,WAAA,GAAcb,wBAAwBC,uBAAsB,EAC1Ec,IAAI,CAAC,IAAA,EAAMH,WAAAA,CAAAA;AAEb,YAAA,OAAOI,eAAAA,CAAgB;AACrBF,gBAAAA,IAAAA;AAEAG,gBAAAA,UAAAA,CAAAA,CAAWC,CAAC,EAAA;AACV,oBAAA,MAAMC,iBAAiB,CAACC,SAAAA,GAAAA;wBACtB,OAAOrB,SAAAA,CAAUsB,UAAU,CAACT,WAAAA,CAAYU,GAAG,CAAA,CAAEC,KAAK,CAACH,SAAAA,CAAAA,CAAWI,eAAe,EAAA;AAC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M,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,OAAAA,CAAQD,WAAAA;AAAa,6BAAA,CAAA;AAC3D,wBAAA;AACF,oBAAA,CAAA,CAAA;AACF,gBAAA;AACF,aAAA,CAAA;AACF,QAAA;AACF,KAAA;AACF,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collection-type.js","sources":["../../../../../server/src/services/builders/mutations/collection-type.ts"],"sourcesContent":["import { extendType, nonNull, idArg } from 'nexus';\nimport type * as Nexus from 'nexus';\nimport type { Struct } from '@strapi/types';\nimport type { Context } from '../../types';\n\nexport default ({ strapi }: Context) => {\n const { service: getService } = strapi.plugin('graphql');\n\n const { naming } = getService('utils');\n const { args } = getService('internals');\n\n const {\n getCreateMutationTypeName,\n getUpdateMutationTypeName,\n getDeleteMutationTypeName,\n getContentTypeInputName,\n getTypeName,\n } = naming;\n\n const addCreateMutation = (\n t: Nexus.blocks.ObjectDefinitionBlock<'Mutation'>,\n contentType: Struct.CollectionTypeSchema\n ) => {\n const { uid } = contentType;\n\n const createMutationName = getCreateMutationTypeName(contentType);\n const typeName = getTypeName(contentType);\n\n t.field(createMutationName, {\n type: typeName,\n\n extensions: {\n strapi: {\n contentType,\n },\n },\n\n args: {\n // Create payload\n status: args.PublicationStatusArg,\n data: nonNull(getContentTypeInputName(contentType)),\n },\n\n async resolve(parent, args, context) {\n const { auth } = context.state;\n\n // Sanitize input data\n const sanitizedInputData = await strapi.contentAPI.sanitize.input(args.data, contentType, {\n auth,\n });\n\n return strapi.documents!(uid).create({\n ...args,\n data: sanitizedInputData,\n });\n },\n });\n };\n\n const addUpdateMutation = (\n t: Nexus.blocks.ObjectDefinitionBlock<'Mutation'>,\n contentType: Struct.CollectionTypeSchema\n ) => {\n const { uid } = contentType;\n\n const updateMutationName = getUpdateMutationTypeName(contentType);\n const typeName = getTypeName(contentType);\n\n t.field(updateMutationName, {\n type: typeName,\n\n extensions: {\n strapi: {\n contentType,\n },\n },\n\n args: {\n documentId: nonNull(idArg()),\n status: args.PublicationStatusArg,\n data: nonNull(getContentTypeInputName(contentType)),\n },\n\n async resolve(parent, args, context) {\n const { auth } = context.state;\n\n const { data, ...restParams } = args;\n\n // Sanitize input data\n const sanitizedInputData = await strapi.contentAPI.sanitize.input(data, contentType, {\n auth,\n });\n\n return strapi.documents!(uid).update({\n ...restParams,\n data: sanitizedInputData,\n });\n },\n });\n };\n\n const addDeleteMutation = (\n t: Nexus.blocks.ObjectDefinitionBlock<'Mutation'>,\n contentType: Struct.CollectionTypeSchema\n ) => {\n const { uid } = contentType;\n\n const deleteMutationName = getDeleteMutationTypeName(contentType);\n\n const { DELETE_MUTATION_RESPONSE_TYPE_NAME } = strapi.plugin('graphql').service('constants');\n\n t.field(deleteMutationName, {\n type: DELETE_MUTATION_RESPONSE_TYPE_NAME,\n\n extensions: {\n strapi: {\n contentType,\n },\n },\n\n args: {\n documentId: nonNull(idArg()),\n },\n\n async resolve(parent, args) {\n const { documentId } = args;\n\n await strapi.documents!(uid).delete({ documentId });\n\n return { documentId };\n },\n });\n };\n\n return {\n buildCollectionTypeMutations(contentType: Struct.CollectionTypeSchema) {\n const createMutationName = `Mutation.${getCreateMutationTypeName(contentType)}`;\n const updateMutationName = `Mutation.${getUpdateMutationTypeName(contentType)}`;\n const deleteMutationName = `Mutation.${getDeleteMutationTypeName(contentType)}`;\n\n const extension = getService('extension');\n\n const registerAuthConfig = (action: string, auth: any) => {\n return extension.use({ resolversConfig: { [action]: { auth } } });\n };\n\n const isActionEnabled = (action: string) => {\n return extension.shadowCRUD(contentType.uid).isActionEnabled(action);\n };\n\n const isCreateEnabled = isActionEnabled('create');\n const isUpdateEnabled = isActionEnabled('update');\n const isDeleteEnabled = isActionEnabled('delete');\n\n if (isCreateEnabled) {\n registerAuthConfig(createMutationName, { scope: [`${contentType.uid}.create`] });\n }\n\n if (isUpdateEnabled) {\n registerAuthConfig(updateMutationName, { scope: [`${contentType.uid}.update`] });\n }\n\n if (isDeleteEnabled) {\n registerAuthConfig(deleteMutationName, { scope: [`${contentType.uid}.delete`] });\n }\n\n return extendType({\n type: 'Mutation',\n\n definition(t) {\n if (isCreateEnabled) {\n addCreateMutation(t, contentType);\n }\n\n if (isUpdateEnabled) {\n addUpdateMutation(t, contentType);\n }\n\n if (isDeleteEnabled) {\n addDeleteMutation(t, contentType);\n }\n },\n });\n },\n };\n};\n"],"names":["strapi","service","getService","plugin","naming","args","getCreateMutationTypeName","getUpdateMutationTypeName","getDeleteMutationTypeName","getContentTypeInputName","getTypeName","addCreateMutation","t","contentType","uid","createMutationName","typeName","field","type","extensions","status","PublicationStatusArg","data","nonNull","resolve","parent","context","auth","state","sanitizedInputData","contentAPI","sanitize","input","documents","create","addUpdateMutation","updateMutationName","documentId","idArg","restParams","update","addDeleteMutation","deleteMutationName","DELETE_MUTATION_RESPONSE_TYPE_NAME","delete","buildCollectionTypeMutations","extension","registerAuthConfig","action","use","resolversConfig","isActionEnabled","shadowCRUD","isCreateEnabled","isUpdateEnabled","isDeleteEnabled","scope","extendType","definition"],"mappings":";;;;AAKA,2CAAe,CAAA,CAAC,EAAEA,MAAM,EAAW,GAAA;AACjC,IAAA,MAAM,EAAEC,OAASC,EAAAA,UAAU,EAAE,GAAGF,MAAAA,CAAOG,MAAM,CAAC,SAAA,CAAA;AAE9C,IAAA,MAAM,EAAEC,MAAM,EAAE,GAAGF,UAAW,CAAA,OAAA,CAAA;AAC9B,IAAA,MAAM,EAAEG,IAAI,EAAE,GAAGH,UAAW,CAAA,WAAA,CAAA;IAE5B,MAAM,EACJ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oBAAA,IAAI0C,eAAiB,EAAA;AACnBd,wBAAAA,iBAAAA,CAAkB7B,CAAGC,EAAAA,WAAAA,CAAAA;AACvB;AACF;AACF,aAAA,CAAA;AACF;AACF,KAAA;AACF,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"collection-type.js","sources":["../../../../../server/src/services/builders/mutations/collection-type.ts"],"sourcesContent":["import { extendType, nonNull, idArg } from 'nexus';\nimport type * as Nexus from 'nexus';\nimport type { Struct } from '@strapi/types';\nimport type { Context } from '../../types';\n\nexport default ({ strapi }: Context) => {\n const { service: getService } = strapi.plugin('graphql');\n\n const { naming } = getService('utils');\n const { args } = getService('internals');\n\n const {\n getCreateMutationTypeName,\n getUpdateMutationTypeName,\n getDeleteMutationTypeName,\n getContentTypeInputName,\n getTypeName,\n } = naming;\n\n const addCreateMutation = (\n t: Nexus.blocks.ObjectDefinitionBlock<'Mutation'>,\n contentType: Struct.CollectionTypeSchema\n ) => {\n const { uid } = contentType;\n\n const createMutationName = getCreateMutationTypeName(contentType);\n const typeName = getTypeName(contentType);\n\n t.field(createMutationName, {\n type: typeName,\n\n extensions: {\n strapi: {\n contentType,\n },\n },\n\n args: {\n // Create payload\n status: args.PublicationStatusArg,\n data: nonNull(getContentTypeInputName(contentType)),\n },\n\n async resolve(parent, args, context) {\n const { auth } = context.state;\n\n // Sanitize input data\n const sanitizedInputData = await strapi.contentAPI.sanitize.input(args.data, contentType, {\n auth,\n });\n\n return strapi.documents!(uid).create({\n ...args,\n data: sanitizedInputData,\n });\n },\n });\n };\n\n const addUpdateMutation = (\n t: Nexus.blocks.ObjectDefinitionBlock<'Mutation'>,\n contentType: Struct.CollectionTypeSchema\n ) => {\n const { uid } = contentType;\n\n const updateMutationName = getUpdateMutationTypeName(contentType);\n const typeName = getTypeName(contentType);\n\n t.field(updateMutationName, {\n type: typeName,\n\n extensions: {\n strapi: {\n contentType,\n },\n },\n\n args: {\n documentId: nonNull(idArg()),\n status: args.PublicationStatusArg,\n data: nonNull(getContentTypeInputName(contentType)),\n },\n\n async resolve(parent, args, context) {\n const { auth } = context.state;\n\n const { data, ...restParams } = args;\n\n // Sanitize input data\n const sanitizedInputData = await strapi.contentAPI.sanitize.input(data, contentType, {\n auth,\n });\n\n return strapi.documents!(uid).update({\n ...restParams,\n data: sanitizedInputData,\n });\n },\n });\n };\n\n const addDeleteMutation = (\n t: Nexus.blocks.ObjectDefinitionBlock<'Mutation'>,\n contentType: Struct.CollectionTypeSchema\n ) => {\n const { uid } = contentType;\n\n const deleteMutationName = getDeleteMutationTypeName(contentType);\n\n const { DELETE_MUTATION_RESPONSE_TYPE_NAME } = strapi.plugin('graphql').service('constants');\n\n t.field(deleteMutationName, {\n type: DELETE_MUTATION_RESPONSE_TYPE_NAME,\n\n extensions: {\n strapi: {\n contentType,\n },\n },\n\n args: {\n documentId: nonNull(idArg()),\n },\n\n async resolve(parent, args) {\n const { documentId } = args;\n\n await strapi.documents!(uid).delete({ documentId });\n\n return { documentId };\n },\n });\n };\n\n return {\n buildCollectionTypeMutations(contentType: Struct.CollectionTypeSchema) {\n const createMutationName = `Mutation.${getCreateMutationTypeName(contentType)}`;\n const updateMutationName = `Mutation.${getUpdateMutationTypeName(contentType)}`;\n const deleteMutationName = `Mutation.${getDeleteMutationTypeName(contentType)}`;\n\n const extension = getService('extension');\n\n const registerAuthConfig = (action: string, auth: any) => {\n return extension.use({ resolversConfig: { [action]: { auth } } });\n };\n\n const isActionEnabled = (action: string) => {\n return extension.shadowCRUD(contentType.uid).isActionEnabled(action);\n };\n\n const isCreateEnabled = isActionEnabled('create');\n const isUpdateEnabled = isActionEnabled('update');\n const isDeleteEnabled = isActionEnabled('delete');\n\n if (isCreateEnabled) {\n registerAuthConfig(createMutationName, { scope: [`${contentType.uid}.create`] });\n }\n\n if (isUpdateEnabled) {\n registerAuthConfig(updateMutationName, { scope: [`${contentType.uid}.update`] });\n }\n\n if (isDeleteEnabled) {\n registerAuthConfig(deleteMutationName, { scope: [`${contentType.uid}.delete`] });\n }\n\n return extendType({\n type: 'Mutation',\n\n definition(t) {\n if (isCreateEnabled) {\n addCreateMutation(t, contentType);\n }\n\n if (isUpdateEnabled) {\n addUpdateMutation(t, contentType);\n }\n\n if (isDeleteEnabled) {\n addDeleteMutation(t, contentType);\n }\n },\n });\n },\n };\n};\n"],"names":["strapi","service","getService","plugin","naming","args","getCreateMutationTypeName","getUpdateMutationTypeName","getDeleteMutationTypeName","getContentTypeInputName","getTypeName","addCreateMutation","t","contentType","uid","createMutationName","typeName","field","type","extensions","status","PublicationStatusArg","data","nonNull","resolve","parent","context","auth","state","sanitizedInputData","contentAPI","sanitize","input","documents","create","addUpdateMutation","updateMutationName","documentId","idArg","restParams","update","addDeleteMutation","deleteMutationName","DELETE_MUTATION_RESPONSE_TYPE_NAME","delete","buildCollectionTypeMutations","extension","registerAuthConfig","action","use","resolversConfig","isActionEnabled","shadowCRUD","isCreateEnabled","isUpdateEnabled","isDeleteEnabled","scope","extendType","definition"],"mappings":";;;;AAKA,2CAAe,CAAA,CAAC,EAAEA,MAAM,EAAW,GAAA;AACjC,IAAA,MAAM,EAAEC,OAAAA,EAASC,UAAU,EAAE,GAAGF,MAAAA,CAAOG,MAAM,CAAC,SAAA,CAAA;AAE9C,IAAA,MAAM,EAAEC,MAAM,EAAE,GAAGF,UAAAA,CAAW,OAAA,CAAA;AAC9B,IAAA,MAAM,EAAEG,IAAI,EAAE,GAAGH,UAAAA,CAAW,WAAA,CAAA;IAE5B,MAAM,EACJI,yBAAyB,EACzBC,yBAAyB,EACzBC,yBAAyB,EACzBC,uBAAuB,EACvBC,WAAW,EACZ,GAAGN,MAAAA;IAEJ,MAAMO,iBAAAA,GAAoB,CACxBC,CAAAA,EACAC,WAAAA,GAAAA;QAEA,MAAM,EAAEC,GAAG,EAAE,GAAGD,WAAAA;AAEhB,QAAA,MAAME,qBAAqBT,yBAAAA,CAA0BO,WAAAA,CAAAA;AACrD,QAAA,MAAMG,WAAWN,WAAAA,CAAYG,WAAAA,CAA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 -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collection-type.mjs","sources":["../../../../../server/src/services/builders/mutations/collection-type.ts"],"sourcesContent":["import { extendType, nonNull, idArg } from 'nexus';\nimport type * as Nexus from 'nexus';\nimport type { Struct } from '@strapi/types';\nimport type { Context } from '../../types';\n\nexport default ({ strapi }: Context) => {\n const { service: getService } = strapi.plugin('graphql');\n\n const { naming } = getService('utils');\n const { args } = getService('internals');\n\n const {\n getCreateMutationTypeName,\n getUpdateMutationTypeName,\n getDeleteMutationTypeName,\n getContentTypeInputName,\n getTypeName,\n } = naming;\n\n const addCreateMutation = (\n t: Nexus.blocks.ObjectDefinitionBlock<'Mutation'>,\n contentType: Struct.CollectionTypeSchema\n ) => {\n const { uid } = contentType;\n\n const createMutationName = getCreateMutationTypeName(contentType);\n const typeName = getTypeName(contentType);\n\n t.field(createMutationName, {\n type: typeName,\n\n extensions: {\n strapi: {\n contentType,\n },\n },\n\n args: {\n // Create payload\n status: args.PublicationStatusArg,\n data: nonNull(getContentTypeInputName(contentType)),\n },\n\n async resolve(parent, args, context) {\n const { auth } = context.state;\n\n // Sanitize input data\n const sanitizedInputData = await strapi.contentAPI.sanitize.input(args.data, contentType, {\n auth,\n });\n\n return strapi.documents!(uid).create({\n ...args,\n data: sanitizedInputData,\n });\n },\n });\n };\n\n const addUpdateMutation = (\n t: Nexus.blocks.ObjectDefinitionBlock<'Mutation'>,\n contentType: Struct.CollectionTypeSchema\n ) => {\n const { uid } = contentType;\n\n const updateMutationName = getUpdateMutationTypeName(contentType);\n const typeName = getTypeName(contentType);\n\n t.field(updateMutationName, {\n type: typeName,\n\n extensions: {\n strapi: {\n contentType,\n },\n },\n\n args: {\n documentId: nonNull(idArg()),\n status: args.PublicationStatusArg,\n data: nonNull(getContentTypeInputName(contentType)),\n },\n\n async resolve(parent, args, context) {\n const { auth } = context.state;\n\n const { data, ...restParams } = args;\n\n // Sanitize input data\n const sanitizedInputData = await strapi.contentAPI.sanitize.input(data, contentType, {\n auth,\n });\n\n return strapi.documents!(uid).update({\n ...restParams,\n data: sanitizedInputData,\n });\n },\n });\n };\n\n const addDeleteMutation = (\n t: Nexus.blocks.ObjectDefinitionBlock<'Mutation'>,\n contentType: Struct.CollectionTypeSchema\n ) => {\n const { uid } = contentType;\n\n const deleteMutationName = getDeleteMutationTypeName(contentType);\n\n const { DELETE_MUTATION_RESPONSE_TYPE_NAME } = strapi.plugin('graphql').service('constants');\n\n t.field(deleteMutationName, {\n type: DELETE_MUTATION_RESPONSE_TYPE_NAME,\n\n extensions: {\n strapi: {\n contentType,\n },\n },\n\n args: {\n documentId: nonNull(idArg()),\n },\n\n async resolve(parent, args) {\n const { documentId } = args;\n\n await strapi.documents!(uid).delete({ documentId });\n\n return { documentId };\n },\n });\n };\n\n return {\n buildCollectionTypeMutations(contentType: Struct.CollectionTypeSchema) {\n const createMutationName = `Mutation.${getCreateMutationTypeName(contentType)}`;\n const updateMutationName = `Mutation.${getUpdateMutationTypeName(contentType)}`;\n const deleteMutationName = `Mutation.${getDeleteMutationTypeName(contentType)}`;\n\n const extension = getService('extension');\n\n const registerAuthConfig = (action: string, auth: any) => {\n return extension.use({ resolversConfig: { [action]: { auth } } });\n };\n\n const isActionEnabled = (action: string) => {\n return extension.shadowCRUD(contentType.uid).isActionEnabled(action);\n };\n\n const isCreateEnabled = isActionEnabled('create');\n const isUpdateEnabled = isActionEnabled('update');\n const isDeleteEnabled = isActionEnabled('delete');\n\n if (isCreateEnabled) {\n registerAuthConfig(createMutationName, { scope: [`${contentType.uid}.create`] });\n }\n\n if (isUpdateEnabled) {\n registerAuthConfig(updateMutationName, { scope: [`${contentType.uid}.update`] });\n }\n\n if (isDeleteEnabled) {\n registerAuthConfig(deleteMutationName, { scope: [`${contentType.uid}.delete`] });\n }\n\n return extendType({\n type: 'Mutation',\n\n definition(t) {\n if (isCreateEnabled) {\n addCreateMutation(t, contentType);\n }\n\n if (isUpdateEnabled) {\n addUpdateMutation(t, contentType);\n }\n\n if (isDeleteEnabled) {\n addDeleteMutation(t, contentType);\n }\n },\n });\n },\n };\n};\n"],"names":["strapi","service","getService","plugin","naming","args","getCreateMutationTypeName","getUpdateMutationTypeName","getDeleteMutationTypeName","getContentTypeInputName","getTypeName","addCreateMutation","t","contentType","uid","createMutationName","typeName","field","type","extensions","status","PublicationStatusArg","data","nonNull","resolve","parent","context","auth","state","sanitizedInputData","contentAPI","sanitize","input","documents","create","addUpdateMutation","updateMutationName","documentId","idArg","restParams","update","addDeleteMutation","deleteMutationName","DELETE_MUTATION_RESPONSE_TYPE_NAME","delete","buildCollectionTypeMutations","extension","registerAuthConfig","action","use","resolversConfig","isActionEnabled","shadowCRUD","isCreateEnabled","isUpdateEnabled","isDeleteEnabled","scope","extendType","definition"],"mappings":";;AAKA,2CAAe,CAAA,CAAC,EAAEA,MAAM,EAAW,GAAA;AACjC,IAAA,MAAM,EAAEC,OAASC,EAAAA,UAAU,EAAE,GAAGF,MAAAA,CAAOG,MAAM,CAAC,SAAA,CAAA;AAE9C,IAAA,MAAM,EAAEC,MAAM,EAAE,GAAGF,UAAW,CAAA,OAAA,CAAA;AAC9B,IAAA,MAAM,EAAEG,IAAI,EAAE,GAAGH,UAAW,CAAA,WAAA,CAAA;IAE5B,MAAM,EACJI,yBAAyB,EACzBC,yBAAyB,EACzBC,yBAAyB,EACzBC,uBAAuB,EACvBC,WAAW,EACZ,GAAGN,MAAAA;IAEJ,MAAMO,iBAAAA,GAAoB,CACxBC,CACAC,EAAAA,WAAAA,GAAAA;QAEA,MAAM,EAAEC,GAAG,EAAE,GAAGD,WAAAA;AAEhB,QAAA,MAAME,qBAAqBT,yBAA0BO,CAAAA,WAAAA,CAAAA;AACrD,QAAA,MAAMG,WAAWN,WAAYG,CAAAA,WAAAA,CAAAA;QAE7BD,CAAEK,CAAAA,KAAK,CAACF,kBAAoB,EAAA;YAC1BG,IAAMF,EAAAA,QAAAA;YAENG,UAAY,EAAA;gBACVnB,MAAQ,EAAA;AACNa,oBAAAA;AACF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C,WAAYC,CAAAA,GAAG,CAAC,OAAO;AAAE;AAAC,iBAAA,CAAA;AAChF;AAEA,YAAA,IAAIwC,eAAiB,EAAA;AACnBP,gBAAAA,kBAAAA,CAAmBX,kBAAoB,EAAA;oBAAEoB,KAAO,EAAA;AAAC,wBAAA,CAAA,EAAG3C,WAAYC,CAAAA,GAAG,CAAC,OAAO;AAAE;AAAC,iBAAA,CAAA;AAChF;AAEA,YAAA,IAAIyC,eAAiB,EAAA;AACnBR,gBAAAA,kBAAAA,CAAmBL,kBAAoB,EAAA;oBAAEc,KAAO,EAAA;AAAC,wBAAA,CAAA,EAAG3C,WAAYC,CAAAA,GAAG,CAAC,OAAO;AAAE;AAAC,iBAAA,CAAA;AAChF;AAEA,YAAA,OAAO2C,UAAW,CAAA;gBAChBvC,IAAM,EAAA,UAAA;AAENwC,gBAAAA,UAAAA,CAAAA,CAAW9C,CAAC,EAAA;AACV,oBAAA,IAAIyC,eAAiB,EAAA;AACnB1C,wBAAAA,iBAAAA,CAAkBC,CAAGC,EAAAA,WAAAA,CAAAA;AACvB;AAEA,oBAAA,IAAIyC,eAAiB,EAAA;AACnBnB,wBAAAA,iBAAAA,CAAkBvB,CAAGC,EAAAA,WAAAA,CAAAA;AACvB;AAEA,oBAAA,IAAI0C,eAAiB,EAAA;AACnBd,wBAAAA,iBAAAA,CAAkB7B,CAAGC,EAAAA,WAAAA,CAAAA;AACvB;AACF;AACF,aAAA,CAAA;AACF;AACF,KAAA;AACF,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"collection-type.mjs","sources":["../../../../../server/src/services/builders/mutations/collection-type.ts"],"sourcesContent":["import { extendType, nonNull, idArg } from 'nexus';\nimport type * as Nexus from 'nexus';\nimport type { Struct } from '@strapi/types';\nimport type { Context } from '../../types';\n\nexport default ({ strapi }: Context) => {\n const { service: getService } = strapi.plugin('graphql');\n\n const { naming } = getService('utils');\n const { args } = getService('internals');\n\n const {\n getCreateMutationTypeName,\n getUpdateMutationTypeName,\n getDeleteMutationTypeName,\n getContentTypeInputName,\n getTypeName,\n } = naming;\n\n const addCreateMutation = (\n t: Nexus.blocks.ObjectDefinitionBlock<'Mutation'>,\n contentType: Struct.CollectionTypeSchema\n ) => {\n const { uid } = contentType;\n\n const createMutationName = getCreateMutationTypeName(contentType);\n const typeName = getTypeName(contentType);\n\n t.field(createMutationName, {\n type: typeName,\n\n extensions: {\n strapi: {\n contentType,\n },\n },\n\n args: {\n // Create payload\n status: args.PublicationStatusArg,\n data: nonNull(getContentTypeInputName(contentType)),\n },\n\n async resolve(parent, args, context) {\n const { auth } = context.state;\n\n // Sanitize input data\n const sanitizedInputData = await strapi.contentAPI.sanitize.input(args.data, contentType, {\n auth,\n });\n\n return strapi.documents!(uid).create({\n ...args,\n data: sanitizedInputData,\n });\n },\n });\n };\n\n const addUpdateMutation = (\n t: Nexus.blocks.ObjectDefinitionBlock<'Mutation'>,\n contentType: Struct.CollectionTypeSchema\n ) => {\n const { uid } = contentType;\n\n const updateMutationName = getUpdateMutationTypeName(contentType);\n const typeName = getTypeName(contentType);\n\n t.field(updateMutationName, {\n type: typeName,\n\n extensions: {\n strapi: {\n contentType,\n },\n },\n\n args: {\n documentId: nonNull(idArg()),\n status: args.PublicationStatusArg,\n data: nonNull(getContentTypeInputName(contentType)),\n },\n\n async resolve(parent, args, context) {\n const { auth } = context.state;\n\n const { data, ...restParams } = args;\n\n // Sanitize input data\n const sanitizedInputData = await strapi.contentAPI.sanitize.input(data, contentType, {\n auth,\n });\n\n return strapi.documents!(uid).update({\n ...restParams,\n data: sanitizedInputData,\n });\n },\n });\n };\n\n const addDeleteMutation = (\n t: Nexus.blocks.ObjectDefinitionBlock<'Mutation'>,\n contentType: Struct.CollectionTypeSchema\n ) => {\n const { uid } = contentType;\n\n const deleteMutationName = getDeleteMutationTypeName(contentType);\n\n const { DELETE_MUTATION_RESPONSE_TYPE_NAME } = strapi.plugin('graphql').service('constants');\n\n t.field(deleteMutationName, {\n type: DELETE_MUTATION_RESPONSE_TYPE_NAME,\n\n extensions: {\n strapi: {\n contentType,\n },\n },\n\n args: {\n documentId: nonNull(idArg()),\n },\n\n async resolve(parent, args) {\n const { documentId } = args;\n\n await strapi.documents!(uid).delete({ documentId });\n\n return { documentId };\n },\n });\n };\n\n return {\n buildCollectionTypeMutations(contentType: Struct.CollectionTypeSchema) {\n const createMutationName = `Mutation.${getCreateMutationTypeName(contentType)}`;\n const updateMutationName = `Mutation.${getUpdateMutationTypeName(contentType)}`;\n const deleteMutationName = `Mutation.${getDeleteMutationTypeName(contentType)}`;\n\n const extension = getService('extension');\n\n const registerAuthConfig = (action: string, auth: any) => {\n return extension.use({ resolversConfig: { [action]: { auth } } });\n };\n\n const isActionEnabled = (action: string) => {\n return extension.shadowCRUD(contentType.uid).isActionEnabled(action);\n };\n\n const isCreateEnabled = isActionEnabled('create');\n const isUpdateEnabled = isActionEnabled('update');\n const isDeleteEnabled = isActionEnabled('delete');\n\n if (isCreateEnabled) {\n registerAuthConfig(createMutationName, { scope: [`${contentType.uid}.create`] });\n }\n\n if (isUpdateEnabled) {\n registerAuthConfig(updateMutationName, { scope: [`${contentType.uid}.update`] });\n }\n\n if (isDeleteEnabled) {\n registerAuthConfig(deleteMutationName, { scope: [`${contentType.uid}.delete`] });\n }\n\n return extendType({\n type: 'Mutation',\n\n definition(t) {\n if (isCreateEnabled) {\n addCreateMutation(t, contentType);\n }\n\n if (isUpdateEnabled) {\n addUpdateMutation(t, contentType);\n }\n\n if (isDeleteEnabled) {\n addDeleteMutation(t, contentType);\n }\n },\n });\n },\n };\n};\n"],"names":["strapi","service","getService","plugin","naming","args","getCreateMutationTypeName","getUpdateMutationTypeName","getDeleteMutationTypeName","getContentTypeInputName","getTypeName","addCreateMutation","t","contentType","uid","createMutationName","typeName","field","type","extensions","status","PublicationStatusArg","data","nonNull","resolve","parent","context","auth","state","sanitizedInputData","contentAPI","sanitize","input","documents","create","addUpdateMutation","updateMutationName","documentId","idArg","restParams","update","addDeleteMutation","deleteMutationName","DELETE_MUTATION_RESPONSE_TYPE_NAME","delete","buildCollectionTypeMutations","extension","registerAuthConfig","action","use","resolversConfig","isActionEnabled","shadowCRUD","isCreateEnabled","isUpdateEnabled","isDeleteEnabled","scope","extendType","definition"],"mappings":";;AAKA,2CAAe,CAAA,CAAC,EAAEA,MAAM,EAAW,GAAA;AACjC,IAAA,MAAM,EAAEC,OAAAA,EAASC,UAAU,EAAE,GAAGF,MAAAA,CAAOG,MAAM,CAAC,SAAA,CAAA;AAE9C,IAAA,MAAM,EAAEC,MAAM,EAAE,GAAGF,UAAAA,CAAW,OAAA,CAAA;AAC9B,IAAA,MAAM,EAAEG,IAAI,EAAE,GAAGH,UAAAA,CAAW,WAAA,CAAA;IAE5B,MAAM,EACJI,yBAAyB,EACzBC,yBAAyB,EACzBC,yBAAyB,EACzBC,uBAAuB,EACvBC,WAAW,EACZ,GAAGN,MAAAA;IAEJ,MAAMO,iBAAAA,GAAoB,CACxBC,CAAAA,EACAC,WAAAA,GAAAA;QAEA,MAAM,EAAEC,GAAG,EAAE,GAAGD,WAAAA;AAEhB,QAAA,MAAME,qBAAqBT,yBAAAA,CAA0BO,WAAAA,CAAAA;AACrD,QAAA,MAAMG,WAAWN,WAAAA,CAAYG,WAAAA,CAAAA;QAE7BD,CAAAA,CAAEK,KAAK,CAACF,kBAAAA,EAAoB;YAC1BG,IAAAA,EAAMF,QAAAA;YAENG,UAAAA,EAAY;gBACVnB,MAAAA,EAAQ;AACNa,oBAAAA;AACF;AACF,aAAA;YAEAR,IAAAA,EAAM;;AAEJe,gBAAAA,MAAAA,EAAQf,KAAKgB,oBAAoB;AACjCC,gBAAAA,IAAAA,EAAMC,QAAQd,uBAAAA,CAAwBI,WAAAA,CAAAA;AACxC,aAAA;AAEA,YAAA,MAAMW,OAAAA,CAAAA,CAAQC,MAAM,EAAEpB,IAAI,EAAEqB,OAAO,EAAA;AACjC,gBAAA,MAAM,EAAEC,IAAI,EAAE,GAAGD,QAAQE,KAAK;;AAG9B,g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AAC,OAAO;AAAE;AAAC,iBAAA,CAAA;AAChF,YAAA;AAEA,YAAA,IAAIyC,eAAAA,EAAiB;AACnBR,gBAAAA,kBAAAA,CAAmBL,kBAAAA,EAAoB;oBAAEc,KAAAA,EAAO;AAAC,wBAAA,CAAA,EAAG3C,WAAAA,CAAYC,GAAG,CAAC,OAAO;AAAE;AAAC,iBAAA,CAAA;AAChF,YAAA;AAEA,YAAA,OAAO2C,UAAAA,CAAW;gBAChBvC,IAAAA,EAAM,UAAA;AAENwC,gBAAAA,UAAAA,CAAAA,CAAW9C,CAAC,EAAA;AACV,oBAAA,IAAIyC,eAAAA,EAAiB;AACnB1C,wBAAAA,iBAAAA,CAAkBC,CAAAA,EAAGC,WAAAA,CAAAA;AACvB,oBAAA;AAEA,oBAAA,IAAIyC,eAAAA,EAAiB;AACnBnB,wBAAAA,iBAAAA,CAAkBvB,CAAAA,EAAGC,WAAAA,CAAAA;AACvB,oBAAA;AAEA,oBAAA,IAAI0C,eAAAA,EAAiB;AACnBd,wBAAAA,iBAAAA,CAAkB7B,CAAAA,EAAGC,WAAAA,CAAAA;AACvB,oBAAA;AACF,gBAAA;AACF,aAAA,CAAA;AACF,QAAA;AACF,KAAA;AACF,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../server/src/services/builders/mutations/index.ts"],"sourcesContent":["import createCollectionTypeMutationsBuilder from './collection-type';\nimport createSingleTypeMutationsBuilder from './single-type';\nimport type { Context } from '../../types';\n\nexport default (context: Context) => ({\n ...createCollectionTypeMutationsBuilder(context),\n ...createSingleTypeMutationsBuilder(context),\n});\n"],"names":["context","createCollectionTypeMutationsBuilder","createSingleTypeMutationsBuilder"],"mappings":";;;;;AAIA,gBAAe,CAAA,CAACA,OAAAA,IAAsB;AACpC,QAAA,GAAGC,eAAqCD,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../server/src/services/builders/mutations/index.ts"],"sourcesContent":["import createCollectionTypeMutationsBuilder from './collection-type';\nimport createSingleTypeMutationsBuilder from './single-type';\nimport type { Context } from '../../types';\n\nexport default (context: Context) => ({\n ...createCollectionTypeMutationsBuilder(context),\n ...createSingleTypeMutationsBuilder(context),\n});\n"],"names":["context","createCollectionTypeMutationsBuilder","createSingleTypeMutationsBuilder"],"mappings":";;;;;AAIA,gBAAe,CAAA,CAACA,OAAAA,IAAsB;AACpC,QAAA,GAAGC,eAAqCD,OAAAA,CAAQ;AAChD,QAAA,GAAGE,WAAiCF,OAAAA;AACtC,KAAA,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../../../server/src/services/builders/mutations/index.ts"],"sourcesContent":["import createCollectionTypeMutationsBuilder from './collection-type';\nimport createSingleTypeMutationsBuilder from './single-type';\nimport type { Context } from '../../types';\n\nexport default (context: Context) => ({\n ...createCollectionTypeMutationsBuilder(context),\n ...createSingleTypeMutationsBuilder(context),\n});\n"],"names":["context","createCollectionTypeMutationsBuilder","createSingleTypeMutationsBuilder"],"mappings":";;;AAIA,gBAAe,CAAA,CAACA,OAAAA,IAAsB;AACpC,QAAA,GAAGC,qCAAqCD,
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../../server/src/services/builders/mutations/index.ts"],"sourcesContent":["import createCollectionTypeMutationsBuilder from './collection-type';\nimport createSingleTypeMutationsBuilder from './single-type';\nimport type { Context } from '../../types';\n\nexport default (context: Context) => ({\n ...createCollectionTypeMutationsBuilder(context),\n ...createSingleTypeMutationsBuilder(context),\n});\n"],"names":["context","createCollectionTypeMutationsBuilder","createSingleTypeMutationsBuilder"],"mappings":";;;AAIA,gBAAe,CAAA,CAACA,OAAAA,IAAsB;AACpC,QAAA,GAAGC,qCAAqCD,OAAAA,CAAQ;AAChD,QAAA,GAAGE,iCAAiCF,OAAAA;AACtC,KAAA,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"single-type.js","sources":["../../../../../server/src/services/builders/mutations/single-type.ts"],"sourcesContent":["import { extendType, nonNull } from 'nexus';\nimport { errors } from '@strapi/utils';\nimport type * as Nexus from 'nexus';\nimport type { Struct } from '@strapi/types';\nimport type { Context } from '../../types';\n\nconst { NotFoundError } = errors;\n\nexport default ({ strapi }: Context) => {\n const { service: getService } = strapi.plugin('graphql');\n\n const { naming } = getService('utils');\n const { args } = getService('internals');\n\n const {\n getUpdateMutationTypeName,\n getTypeName,\n getContentTypeInputName,\n getDeleteMutationTypeName,\n } = naming;\n\n const addUpdateMutation = (\n t: Nexus.blocks.ObjectDefinitionBlock<'Mutation'>,\n contentType: Struct.SingleTypeSchema\n ) => {\n const { uid } = contentType;\n\n const updateMutationName = getUpdateMutationTypeName(contentType);\n const typeName = getTypeName(contentType);\n\n t.field(updateMutationName, {\n type: typeName,\n\n extensions: {\n strapi: {\n contentType,\n },\n },\n\n args: {\n // Update payload\n status: args.PublicationStatusArg,\n data: nonNull(getContentTypeInputName(contentType)),\n },\n\n async resolve(parent, args, context) {\n const { auth } = context.state;\n\n // Sanitize input data\n const sanitizedInputData = await strapi.contentAPI.sanitize.input(args.data, contentType, {\n auth,\n });\n\n const document = await strapi.db?.query(uid).findOne();\n\n if (document) {\n return strapi.documents!(uid).update({\n ...args,\n documentId: document.documentId,\n data: sanitizedInputData,\n });\n }\n\n return strapi.documents!(uid).create({\n ...args,\n data: sanitizedInputData,\n });\n },\n });\n };\n\n const addDeleteMutation = (\n t: Nexus.blocks.ObjectDefinitionBlock<'Mutation'>,\n contentType: Struct.SingleTypeSchema\n ) => {\n const { uid } = contentType;\n\n const deleteMutationName = getDeleteMutationTypeName(contentType);\n const { DELETE_MUTATION_RESPONSE_TYPE_NAME } = strapi.plugin('graphql').service('constants');\n\n t.field(deleteMutationName, {\n type: DELETE_MUTATION_RESPONSE_TYPE_NAME,\n\n extensions: {\n strapi: {\n contentType,\n },\n },\n\n args: {},\n\n async resolve(parent, args) {\n const document = await strapi.db?.query(uid).findOne();\n\n if (!document) {\n throw new NotFoundError('Document not found');\n }\n\n await strapi.documents!(uid).delete({ ...args, documentId: document.documentId });\n\n return document;\n },\n });\n };\n\n return {\n buildSingleTypeMutations(contentType: Struct.SingleTypeSchema) {\n const updateMutationName = `Mutation.${getUpdateMutationTypeName(contentType)}`;\n const deleteMutationName = `Mutation.${getDeleteMutationTypeName(contentType)}`;\n\n const extension = getService('extension');\n\n const registerAuthConfig = (action: string, auth: any) => {\n return extension.use({ resolversConfig: { [action]: { auth } } });\n };\n\n const isActionEnabled = (action: string) => {\n return extension.shadowCRUD(contentType.uid).isActionEnabled(action);\n };\n\n const isUpdateEnabled = isActionEnabled('update');\n const isDeleteEnabled = isActionEnabled('delete');\n\n if (isUpdateEnabled) {\n registerAuthConfig(updateMutationName, { scope: [`${contentType.uid}.update`] });\n }\n\n if (isDeleteEnabled) {\n registerAuthConfig(deleteMutationName, { scope: [`${contentType.uid}.delete`] });\n }\n\n return extendType({\n type: 'Mutation',\n\n definition(t) {\n if (isUpdateEnabled) {\n addUpdateMutation(t, contentType);\n }\n\n if (isDeleteEnabled) {\n addDeleteMutation(t, contentType);\n }\n },\n });\n },\n };\n};\n"],"names":["NotFoundError","errors","strapi","service","getService","plugin","naming","args","getUpdateMutationTypeName","getTypeName","getContentTypeInputName","getDeleteMutationTypeName","addUpdateMutation","t","contentType","uid","updateMutationName","typeName","field","type","extensions","status","PublicationStatusArg","data","nonNull","resolve","parent","context","auth","state","sanitizedInputData","contentAPI","sanitize","input","document","db","query","findOne","documents","update","documentId","create","addDeleteMutation","deleteMutationName","DELETE_MUTATION_RESPONSE_TYPE_NAME","delete","buildSingleTypeMutations","extension","registerAuthConfig","action","use","resolversConfig","isActionEnabled","shadowCRUD","isUpdateEnabled","isDeleteEnabled","scope","extendType","definition"],"mappings":";;;;;AAMA,MAAM,EAAEA,aAAa,EAAE,GAAGC,YAAAA;AAE1B,uCAAe,CAAA,CAAC,EAAEC,MAAM,EAAW,GAAA;AACjC,IAAA,MAAM,EAAEC,
|
|
1
|
+
{"version":3,"file":"single-type.js","sources":["../../../../../server/src/services/builders/mutations/single-type.ts"],"sourcesContent":["import { extendType, nonNull } from 'nexus';\nimport { errors } from '@strapi/utils';\nimport type * as Nexus from 'nexus';\nimport type { Struct } from '@strapi/types';\nimport type { Context } from '../../types';\n\nconst { NotFoundError } = errors;\n\nexport default ({ strapi }: Context) => {\n const { service: getService } = strapi.plugin('graphql');\n\n const { naming } = getService('utils');\n const { args } = getService('internals');\n\n const {\n getUpdateMutationTypeName,\n getTypeName,\n getContentTypeInputName,\n getDeleteMutationTypeName,\n } = naming;\n\n const addUpdateMutation = (\n t: Nexus.blocks.ObjectDefinitionBlock<'Mutation'>,\n contentType: Struct.SingleTypeSchema\n ) => {\n const { uid } = contentType;\n\n const updateMutationName = getUpdateMutationTypeName(contentType);\n const typeName = getTypeName(contentType);\n\n t.field(updateMutationName, {\n type: typeName,\n\n extensions: {\n strapi: {\n contentType,\n },\n },\n\n args: {\n // Update payload\n status: args.PublicationStatusArg,\n data: nonNull(getContentTypeInputName(contentType)),\n },\n\n async resolve(parent, args, context) {\n const { auth } = context.state;\n\n // Sanitize input data\n const sanitizedInputData = await strapi.contentAPI.sanitize.input(args.data, contentType, {\n auth,\n });\n\n const document = await strapi.db?.query(uid).findOne();\n\n if (document) {\n return strapi.documents!(uid).update({\n ...args,\n documentId: document.documentId,\n data: sanitizedInputData,\n });\n }\n\n return strapi.documents!(uid).create({\n ...args,\n data: sanitizedInputData,\n });\n },\n });\n };\n\n const addDeleteMutation = (\n t: Nexus.blocks.ObjectDefinitionBlock<'Mutation'>,\n contentType: Struct.SingleTypeSchema\n ) => {\n const { uid } = contentType;\n\n const deleteMutationName = getDeleteMutationTypeName(contentType);\n const { DELETE_MUTATION_RESPONSE_TYPE_NAME } = strapi.plugin('graphql').service('constants');\n\n t.field(deleteMutationName, {\n type: DELETE_MUTATION_RESPONSE_TYPE_NAME,\n\n extensions: {\n strapi: {\n contentType,\n },\n },\n\n args: {},\n\n async resolve(parent, args) {\n const document = await strapi.db?.query(uid).findOne();\n\n if (!document) {\n throw new NotFoundError('Document not found');\n }\n\n await strapi.documents!(uid).delete({ ...args, documentId: document.documentId });\n\n return document;\n },\n });\n };\n\n return {\n buildSingleTypeMutations(contentType: Struct.SingleTypeSchema) {\n const updateMutationName = `Mutation.${getUpdateMutationTypeName(contentType)}`;\n const deleteMutationName = `Mutation.${getDeleteMutationTypeName(contentType)}`;\n\n const extension = getService('extension');\n\n const registerAuthConfig = (action: string, auth: any) => {\n return extension.use({ resolversConfig: { [action]: { auth } } });\n };\n\n const isActionEnabled = (action: string) => {\n return extension.shadowCRUD(contentType.uid).isActionEnabled(action);\n };\n\n const isUpdateEnabled = isActionEnabled('update');\n const isDeleteEnabled = isActionEnabled('delete');\n\n if (isUpdateEnabled) {\n registerAuthConfig(updateMutationName, { scope: [`${contentType.uid}.update`] });\n }\n\n if (isDeleteEnabled) {\n registerAuthConfig(deleteMutationName, { scope: [`${contentType.uid}.delete`] });\n }\n\n return extendType({\n type: 'Mutation',\n\n definition(t) {\n if (isUpdateEnabled) {\n addUpdateMutation(t, contentType);\n }\n\n if (isDeleteEnabled) {\n addDeleteMutation(t, contentType);\n }\n },\n });\n },\n };\n};\n"],"names":["NotFoundError","errors","strapi","service","getService","plugin","naming","args","getUpdateMutationTypeName","getTypeName","getContentTypeInputName","getDeleteMutationTypeName","addUpdateMutation","t","contentType","uid","updateMutationName","typeName","field","type","extensions","status","PublicationStatusArg","data","nonNull","resolve","parent","context","auth","state","sanitizedInputData","contentAPI","sanitize","input","document","db","query","findOne","documents","update","documentId","create","addDeleteMutation","deleteMutationName","DELETE_MUTATION_RESPONSE_TYPE_NAME","delete","buildSingleTypeMutations","extension","registerAuthConfig","action","use","resolversConfig","isActionEnabled","shadowCRUD","isUpdateEnabled","isDeleteEnabled","scope","extendType","definition"],"mappings":";;;;;AAMA,MAAM,EAAEA,aAAa,EAAE,GAAGC,YAAAA;AAE1B,uCAAe,CAAA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