diff --git a/libs/shared/contentful/src/__generated__/gql.ts b/libs/shared/contentful/src/__generated__/gql.ts index f0ccb0e1d5..19651a758e 100644 --- a/libs/shared/contentful/src/__generated__/gql.ts +++ b/libs/shared/contentful/src/__generated__/gql.ts @@ -13,11 +13,13 @@ import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/ * Therefore it is highly recommended to use the babel or swc plugin for production. */ const documents = { + '\n query CapabilityServiceByPriceIds (\n $skip: Int!\n $limit: Int!\n $priceIds: [String]!\n ) {\n purchaseCollection(\n skip: $skip\n limit: $limit\n where: {\n stripePlanChoices_contains_some: $priceIds\n }\n ) {\n items {\n stripePlanChoices\n linkedFrom {\n offeringCollection (\n skip: 0\n limit: 1\n ) {\n items {\n capabilitiesCollection (\n skip: $skip\n limit: $limit\n ) {\n items {\n slug\n servicesCollection (\n skip: 0\n limit: 1\n ) {\n items {\n oauthClientId\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n': + types.CapabilityServiceByPriceIdsDocument, '\n query Offering($id: String!, $locale: String!) {\n offering(id: $id, locale: $locale) {\n stripeProductId\n countries\n defaultPurchase {\n purchaseDetails {\n productName\n details\n subtitle\n webIcon\n }\n }\n }\n }\n': types.OfferingDocument, '\n query PurchaseWithDetails($id: String!, $locale: String!) {\n purchase(id: $id, locale: $locale) {\n internalName\n description\n purchaseDetails {\n productName\n details\n webIcon\n }\n }\n }\n': types.PurchaseWithDetailsDocument, - '\n query PurchaseWithDetailsOfferingContent(\n $skip: Int!\n $limit: Int!\n $locale: String!\n $stripePlanIds: [String]!\n ) {\n purchaseCollection(\n skip: $skip\n limit: $limit\n locale: $locale\n where: {\n stripePlanChoices_contains_some: $stripePlanIds\n }\n ) {\n items {\n stripePlanChoices\n purchaseDetails {\n details\n productName\n subtitle\n webIcon\n }\n linkedFrom {\n offeringCollection(\n skip: $skip\n limit: $limit\n ) {\n items {\n stripeProductId\n commonContent {\n privacyNoticeUrl\n privacyNoticeDownloadUrl\n termsOfServiceUrl\n termsOfServiceDownloadUrl\n cancellationUrl\n emailIcon\n successActionButtonUrl\n successActionButtonLabel\n }\n }\n }\n }\n }\n }\n }\n': + '\n query PurchaseWithDetailsOfferingContent(\n $skip: Int!\n $limit: Int!\n $locale: String!\n $stripePlanIds: [String]!\n ) {\n purchaseCollection(\n skip: $skip\n limit: $limit\n locale: $locale\n where: { stripePlanChoices_contains_some: $stripePlanIds }\n ) {\n items {\n stripePlanChoices\n purchaseDetails {\n details\n productName\n subtitle\n webIcon\n }\n linkedFrom {\n offeringCollection(skip: $skip, limit: $limit) {\n items {\n stripeProductId\n commonContent {\n privacyNoticeUrl\n privacyNoticeDownloadUrl\n termsOfServiceUrl\n termsOfServiceDownloadUrl\n cancellationUrl\n emailIcon\n successActionButtonUrl\n successActionButtonLabel\n }\n }\n }\n }\n }\n }\n }\n': types.PurchaseWithDetailsOfferingContentDocument, }; @@ -35,6 +37,12 @@ const documents = { */ export function graphql(source: string): unknown; +/** + * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function graphql( + source: '\n query CapabilityServiceByPriceIds (\n $skip: Int!\n $limit: Int!\n $priceIds: [String]!\n ) {\n purchaseCollection(\n skip: $skip\n limit: $limit\n where: {\n stripePlanChoices_contains_some: $priceIds\n }\n ) {\n items {\n stripePlanChoices\n linkedFrom {\n offeringCollection (\n skip: 0\n limit: 1\n ) {\n items {\n capabilitiesCollection (\n skip: $skip\n limit: $limit\n ) {\n items {\n slug\n servicesCollection (\n skip: 0\n limit: 1\n ) {\n items {\n oauthClientId\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n' +): (typeof documents)['\n query CapabilityServiceByPriceIds (\n $skip: Int!\n $limit: Int!\n $priceIds: [String]!\n ) {\n purchaseCollection(\n skip: $skip\n limit: $limit\n where: {\n stripePlanChoices_contains_some: $priceIds\n }\n ) {\n items {\n stripePlanChoices\n linkedFrom {\n offeringCollection (\n skip: 0\n limit: 1\n ) {\n items {\n capabilitiesCollection (\n skip: $skip\n limit: $limit\n ) {\n items {\n slug\n servicesCollection (\n skip: 0\n limit: 1\n ) {\n items {\n oauthClientId\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n']; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ @@ -51,8 +59,8 @@ export function graphql( * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function graphql( - source: '\n query PurchaseWithDetailsOfferingContent(\n $skip: Int!\n $limit: Int!\n $locale: String!\n $stripePlanIds: [String]!\n ) {\n purchaseCollection(\n skip: $skip\n limit: $limit\n locale: $locale\n where: {\n stripePlanChoices_contains_some: $stripePlanIds\n }\n ) {\n items {\n stripePlanChoices\n purchaseDetails {\n details\n productName\n subtitle\n webIcon\n }\n linkedFrom {\n offeringCollection(\n skip: $skip\n limit: $limit\n ) {\n items {\n stripeProductId\n commonContent {\n privacyNoticeUrl\n privacyNoticeDownloadUrl\n termsOfServiceUrl\n termsOfServiceDownloadUrl\n cancellationUrl\n emailIcon\n successActionButtonUrl\n successActionButtonLabel\n }\n }\n }\n }\n }\n }\n }\n' -): (typeof documents)['\n query PurchaseWithDetailsOfferingContent(\n $skip: Int!\n $limit: Int!\n $locale: String!\n $stripePlanIds: [String]!\n ) {\n purchaseCollection(\n skip: $skip\n limit: $limit\n locale: $locale\n where: {\n stripePlanChoices_contains_some: $stripePlanIds\n }\n ) {\n items {\n stripePlanChoices\n purchaseDetails {\n details\n productName\n subtitle\n webIcon\n }\n linkedFrom {\n offeringCollection(\n skip: $skip\n limit: $limit\n ) {\n items {\n stripeProductId\n commonContent {\n privacyNoticeUrl\n privacyNoticeDownloadUrl\n termsOfServiceUrl\n termsOfServiceDownloadUrl\n cancellationUrl\n emailIcon\n successActionButtonUrl\n successActionButtonLabel\n }\n }\n }\n }\n }\n }\n }\n']; + source: '\n query PurchaseWithDetailsOfferingContent(\n $skip: Int!\n $limit: Int!\n $locale: String!\n $stripePlanIds: [String]!\n ) {\n purchaseCollection(\n skip: $skip\n limit: $limit\n locale: $locale\n where: { stripePlanChoices_contains_some: $stripePlanIds }\n ) {\n items {\n stripePlanChoices\n purchaseDetails {\n details\n productName\n subtitle\n webIcon\n }\n linkedFrom {\n offeringCollection(skip: $skip, limit: $limit) {\n items {\n stripeProductId\n commonContent {\n privacyNoticeUrl\n privacyNoticeDownloadUrl\n termsOfServiceUrl\n termsOfServiceDownloadUrl\n cancellationUrl\n emailIcon\n successActionButtonUrl\n successActionButtonLabel\n }\n }\n }\n }\n }\n }\n }\n' +): (typeof documents)['\n query PurchaseWithDetailsOfferingContent(\n $skip: Int!\n $limit: Int!\n $locale: String!\n $stripePlanIds: [String]!\n ) {\n purchaseCollection(\n skip: $skip\n limit: $limit\n locale: $locale\n where: { stripePlanChoices_contains_some: $stripePlanIds }\n ) {\n items {\n stripePlanChoices\n purchaseDetails {\n details\n productName\n subtitle\n webIcon\n }\n linkedFrom {\n offeringCollection(skip: $skip, limit: $limit) {\n items {\n stripeProductId\n commonContent {\n privacyNoticeUrl\n privacyNoticeDownloadUrl\n termsOfServiceUrl\n termsOfServiceDownloadUrl\n cancellationUrl\n emailIcon\n successActionButtonUrl\n successActionButtonLabel\n }\n }\n }\n }\n }\n }\n }\n']; export function graphql(source: string) { return (documents as any)[source] ?? {}; diff --git a/libs/shared/contentful/src/__generated__/graphql.ts b/libs/shared/contentful/src/__generated__/graphql.ts index 24a350ceb3..caa0095735 100644 --- a/libs/shared/contentful/src/__generated__/graphql.ts +++ b/libs/shared/contentful/src/__generated__/graphql.ts @@ -2512,6 +2512,48 @@ export type CfServiceNestedFilter = { sys?: InputMaybe; }; +export type CapabilityServiceByPriceIdsQueryVariables = Exact<{ + skip: Scalars['Int']['input']; + limit: Scalars['Int']['input']; + priceIds: + | Array> + | InputMaybe; +}>; + +export type CapabilityServiceByPriceIdsQuery = { + __typename?: 'Query'; + purchaseCollection?: { + __typename?: 'PurchaseCollection'; + items: Array<{ + __typename?: 'Purchase'; + stripePlanChoices?: Array | null; + linkedFrom?: { + __typename?: 'PurchaseLinkingCollections'; + offeringCollection?: { + __typename?: 'OfferingCollection'; + items: Array<{ + __typename?: 'Offering'; + capabilitiesCollection?: { + __typename?: 'OfferingCapabilitiesCollection'; + items: Array<{ + __typename?: 'Capability'; + slug?: string | null; + servicesCollection?: { + __typename?: 'CapabilityServicesCollection'; + items: Array<{ + __typename?: 'Service'; + oauthClientId?: string | null; + } | null>; + } | null; + } | null>; + } | null; + } | null>; + } | null; + } | null; + } | null>; + } | null; +}; + export type OfferingQueryVariables = Exact<{ id: Scalars['String']['input']; locale: Scalars['String']['input']; @@ -2604,6 +2646,282 @@ export type PurchaseWithDetailsOfferingContentQuery = { } | null; }; +export const CapabilityServiceByPriceIdsDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'CapabilityServiceByPriceIds' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { kind: 'Variable', name: { kind: 'Name', value: 'skip' } }, + type: { + kind: 'NonNullType', + type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'limit' }, + }, + type: { + kind: 'NonNullType', + type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } }, + }, + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'priceIds' }, + }, + type: { + kind: 'NonNullType', + type: { + kind: 'ListType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'String' }, + }, + }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'purchaseCollection' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'skip' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'skip' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'limit' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'limit' }, + }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'where' }, + value: { + kind: 'ObjectValue', + fields: [ + { + kind: 'ObjectField', + name: { + kind: 'Name', + value: 'stripePlanChoices_contains_some', + }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'priceIds' }, + }, + }, + ], + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'items' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'stripePlanChoices' }, + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'linkedFrom' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'offeringCollection', + }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'skip' }, + value: { kind: 'IntValue', value: '0' }, + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'limit' }, + value: { kind: 'IntValue', value: '1' }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'items' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'capabilitiesCollection', + }, + arguments: [ + { + kind: 'Argument', + name: { + kind: 'Name', + value: 'skip', + }, + value: { + kind: 'Variable', + name: { + kind: 'Name', + value: 'skip', + }, + }, + }, + { + kind: 'Argument', + name: { + kind: 'Name', + value: 'limit', + }, + value: { + kind: 'Variable', + name: { + kind: 'Name', + value: 'limit', + }, + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'items', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'slug', + }, + }, + { + kind: 'Field', + name: { + kind: 'Name', + value: + 'servicesCollection', + }, + arguments: [ + { + kind: 'Argument', + name: { + kind: 'Name', + value: 'skip', + }, + value: { + kind: 'IntValue', + value: '0', + }, + }, + { + kind: 'Argument', + name: { + kind: 'Name', + value: 'limit', + }, + value: { + kind: 'IntValue', + value: '1', + }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: 'items', + }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { + kind: 'Name', + value: + 'oauthClientId', + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + CapabilityServiceByPriceIdsQuery, + CapabilityServiceByPriceIdsQueryVariables +>; export const OfferingDocument = { kind: 'Document', definitions: [ diff --git a/libs/shared/contentful/src/lib/queries/capabilityServiceByPriceIds.ts b/libs/shared/contentful/src/lib/queries/capabilityServiceByPriceIds.ts new file mode 100644 index 0000000000..c5922fffc4 --- /dev/null +++ b/libs/shared/contentful/src/lib/queries/capabilityServiceByPriceIds.ts @@ -0,0 +1,39 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +import { graphql } from '../../__generated__/gql'; + +export const capabilityServiceByPriceIdsQuery = graphql(` + query CapabilityServiceByPriceIds( + $skip: Int! + $limit: Int! + $priceIds: [String]! + ) { + purchaseCollection( + skip: $skip + limit: $limit + where: { stripePlanChoices_contains_some: $priceIds } + ) { + items { + stripePlanChoices + linkedFrom { + offeringCollection(skip: 0, limit: 1) { + items { + capabilitiesCollection(skip: $skip, limit: $limit) { + items { + slug + servicesCollection(skip: 0, limit: 1) { + items { + oauthClientId + } + } + } + } + } + } + } + } + } + } +`); diff --git a/libs/shared/contentful/src/lib/queries/purchaseWithDetailsOfferingContent.ts b/libs/shared/contentful/src/lib/queries/purchaseWithDetailsOfferingContent.ts index d06a98c9fd..44d478b0c5 100644 --- a/libs/shared/contentful/src/lib/queries/purchaseWithDetailsOfferingContent.ts +++ b/libs/shared/contentful/src/lib/queries/purchaseWithDetailsOfferingContent.ts @@ -4,7 +4,7 @@ import { graphql } from '../../__generated__/gql'; -export const purchaseWithDetailsOfferingContent = graphql(` +export const purchaseWithDetailsOfferingContentQuery = graphql(` query PurchaseWithDetailsOfferingContent( $skip: Int! $limit: Int!