diff --git a/.prettierignore b/.prettierignore index 84a4d5d0b2..2e734decf3 100644 --- a/.prettierignore +++ b/.prettierignore @@ -4,5 +4,6 @@ # Autogenerated files packages/fxa-admin-server/src/schema.gql packages/fxa-admin-server/src/graphql.ts +libs/shared/cms/src/__generated__/**/* -/.nx/workspace-data \ No newline at end of file +/.nx/workspace-data diff --git a/apps/payments/next/app/[locale]/[offeringId]/checkout/[interval]/[cartId]/layout.tsx b/apps/payments/next/app/[locale]/[offeringId]/checkout/[interval]/[cartId]/layout.tsx index 3692a7359e..8f12d145f8 100644 --- a/apps/payments/next/app/[locale]/[offeringId]/checkout/[interval]/[cartId]/layout.tsx +++ b/apps/payments/next/app/[locale]/[offeringId]/checkout/[interval]/[cartId]/layout.tsx @@ -71,10 +71,8 @@ export default async function RootLayout({ /> } purchaseDetails={ - cms.defaultPurchase.data.attributes.purchaseDetails.data.attributes.localizations.data.at( - 0 - )?.attributes || - cms.defaultPurchase.data.attributes.purchaseDetails.data.attributes + cms.defaultPurchase.purchaseDetails.localizations.at(0) || + cms.defaultPurchase.purchaseDetails } >
@@ -103,13 +98,9 @@ export default async function RootLayout({ diff --git a/apps/payments/next/app/[locale]/[offeringId]/checkout/[interval]/[cartId]/success/page.tsx b/apps/payments/next/app/[locale]/[offeringId]/checkout/[interval]/[cartId]/success/page.tsx index 0371c3fc78..807383d274 100644 --- a/apps/payments/next/app/[locale]/[offeringId]/checkout/[interval]/[cartId]/success/page.tsx +++ b/apps/payments/next/app/[locale]/[offeringId]/checkout/[interval]/[cartId]/success/page.tsx @@ -75,13 +75,10 @@ export default async function CheckoutSuccess({ ]); const { productName } = - cms.defaultPurchase.data.attributes.purchaseDetails.data.attributes.localizations.data.at( - 0 - )?.attributes || - cms.defaultPurchase.data.attributes.purchaseDetails.data.attributes; + cms.defaultPurchase.purchaseDetails.localizations.at(0) || + cms.defaultPurchase.purchaseDetails; const { successActionButtonUrl, successActionButtonLabel } = - cms.commonContent.data.attributes.localizations.data.at(0)?.attributes || - cms.commonContent.data.attributes; + cms.commonContent.localizations.at(0) || cms.commonContent; return ( <> diff --git a/libs/payments/capability/src/lib/capability.manager.spec.ts b/libs/payments/capability/src/lib/capability.manager.spec.ts index 06d4d412b3..2391e725a5 100644 --- a/libs/payments/capability/src/lib/capability.manager.spec.ts +++ b/libs/payments/capability/src/lib/capability.manager.spec.ts @@ -21,7 +21,6 @@ import { ServicesWithCapabilitiesResult, StrapiClient, MockStrapiClientConfigProvider, - StrapiEntityFactory, } from '@fxa/shared/cms'; import { MockFirestoreProvider } from '@fxa/shared/db/firestore'; import { MockStatsDProvider } from '@fxa/shared/metrics/statsd'; @@ -53,39 +52,21 @@ describe('CapabilityManager', () => { describe('getClients', () => { it('should return services with capabilities', async () => { const clientResults = [ - StrapiEntityFactory( - ServiceResultFactory({ - oauthClientId: 'client1', - capabilities: { - data: [ - StrapiEntityFactory( - CapabilitiesResultFactory({ slug: 'exampleCap8' }) - ), - StrapiEntityFactory( - CapabilitiesResultFactory({ slug: 'exampleCap0' }) - ), - StrapiEntityFactory( - CapabilitiesResultFactory({ slug: 'exampleCap2' }) - ), - StrapiEntityFactory( - CapabilitiesResultFactory({ slug: 'exampleCap4' }) - ), - StrapiEntityFactory( - CapabilitiesResultFactory({ slug: 'exampleCap5' }) - ), - StrapiEntityFactory( - CapabilitiesResultFactory({ slug: 'exampleCap6' }) - ), - ], - }, - }) - ), + ServiceResultFactory({ + oauthClientId: 'client1', + capabilities: [ + CapabilitiesResultFactory({ slug: 'exampleCap8' }), + CapabilitiesResultFactory({ slug: 'exampleCap0' }), + CapabilitiesResultFactory({ slug: 'exampleCap2' }), + CapabilitiesResultFactory({ slug: 'exampleCap4' }), + CapabilitiesResultFactory({ slug: 'exampleCap5' }), + CapabilitiesResultFactory({ slug: 'exampleCap6' }), + ], + }), ]; const mockServicesWithCapabilitiesQuery = ServicesWithCapabilitiesQueryFactory({ - services: { - data: clientResults, - }, + services: clientResults, }); jest .spyOn(productConfigurationManager, 'getServicesWithCapabilities') @@ -99,8 +80,8 @@ describe('CapabilityManager', () => { expect(result.length).toBe(1); expect(result.at(0)?.clientId).toBe('client1'); - const actualCapabilities = clientResults[0].attributes.capabilities.data - .map((capability) => capability.attributes.slug) + const actualCapabilities = clientResults[0].capabilities + .map((capability) => capability.slug) .sort(); expect(result.at(0)?.capabilities).toHaveLength(6); @@ -118,9 +99,9 @@ describe('CapabilityManager', () => { 'getPurchaseDetailsForCapabilityServiceByPlanIds' ) .mockResolvedValue( - new CapabilityServiceByPlanIdsResultUtil([ - mockCapabilityServiceByPlanIdsQuery, - ] as CapabilityServiceByPlanIdsResult[]) + new CapabilityServiceByPlanIdsResultUtil( + mockCapabilityServiceByPlanIdsQuery as CapabilityServiceByPlanIdsResult + ) ); const result = await capabilityManager.priceIdsToClientCapabilities([ 'planId1', @@ -129,30 +110,15 @@ describe('CapabilityManager', () => { }); it('should return empty results when there are no capability collection items', async () => { - const mockCapabilityOfferingResult = StrapiEntityFactory( - CapabilityOfferingResultFactory({ - capabilities: { - data: [], - }, - }) - ); - const mockCapabilityPurchaseResult = StrapiEntityFactory( - CapabilityPurchaseResultFactory({ - offering: { - data: mockCapabilityOfferingResult, - }, - }) - ); + const mockCapabilityOfferingResult = CapabilityOfferingResultFactory({ + capabilities: [], + }); + const mockCapabilityPurchaseResult = CapabilityPurchaseResultFactory({ + offering: mockCapabilityOfferingResult, + }); const mockCapabilityServiceByPlanIdsQuery = CapabilityServiceByPlanIdsQueryFactory({ - purchases: { - meta: { - pagination: { - total: 1, - }, - }, - data: [mockCapabilityPurchaseResult], - }, + purchases: [mockCapabilityPurchaseResult], }); jest .spyOn( @@ -160,9 +126,9 @@ describe('CapabilityManager', () => { 'getPurchaseDetailsForCapabilityServiceByPlanIds' ) .mockResolvedValue( - new CapabilityServiceByPlanIdsResultUtil([ - mockCapabilityServiceByPlanIdsQuery, - ] as CapabilityServiceByPlanIdsResult[]) + new CapabilityServiceByPlanIdsResultUtil( + mockCapabilityServiceByPlanIdsQuery as CapabilityServiceByPlanIdsResult + ) ); const result = await capabilityManager.priceIdsToClientCapabilities([ @@ -172,39 +138,20 @@ describe('CapabilityManager', () => { }); it('should return empty results when there are no service collection items', async () => { - const mockCapabilityOfferingResult = StrapiEntityFactory( - CapabilityOfferingResultFactory({ - capabilities: { - data: [ - StrapiEntityFactory( - CapabilityCapabilitiesResultFactory({ - slug: 'slug1', - services: { - data: [], - }, - }) - ), - ], - }, - }) - ); - const mockCapabilityPurchaseResult = StrapiEntityFactory( - CapabilityPurchaseResultFactory({ - offering: { - data: mockCapabilityOfferingResult, - }, - }) - ); + const mockCapabilityOfferingResult = CapabilityOfferingResultFactory({ + capabilities: [ + CapabilityCapabilitiesResultFactory({ + slug: 'slug1', + services: [], + }), + ], + }); + const mockCapabilityPurchaseResult = CapabilityPurchaseResultFactory({ + offering: mockCapabilityOfferingResult, + }); const mockCapabilityServiceByPlanIdsQuery = CapabilityServiceByPlanIdsQueryFactory({ - purchases: { - meta: { - pagination: { - total: 1, - }, - }, - data: [mockCapabilityPurchaseResult], - }, + purchases: [mockCapabilityPurchaseResult], }); jest .spyOn( @@ -212,9 +159,9 @@ describe('CapabilityManager', () => { 'getPurchaseDetailsForCapabilityServiceByPlanIds' ) .mockResolvedValue( - new CapabilityServiceByPlanIdsResultUtil([ - mockCapabilityServiceByPlanIdsQuery, - ] as CapabilityServiceByPlanIdsResult[]) + new CapabilityServiceByPlanIdsResultUtil( + mockCapabilityServiceByPlanIdsQuery as CapabilityServiceByPlanIdsResult + ) ); const result = await capabilityManager.priceIdsToClientCapabilities([ @@ -224,74 +171,41 @@ describe('CapabilityManager', () => { }); it('should return planIds to client capabilities', async () => { - const mockCapabilityOfferingResult = StrapiEntityFactory( - CapabilityOfferingResultFactory({ - capabilities: { - data: [ - StrapiEntityFactory( - CapabilityCapabilitiesResultFactory({ - slug: 'slug1', - services: { - data: [ - StrapiEntityFactory( - CapabilityServicesResultFactory({ - oauthClientId: 'clientId1', - }) - ), - ], - }, - }) - ), - StrapiEntityFactory( - CapabilityCapabilitiesResultFactory({ - slug: 'slug2a', - services: { - data: [ - StrapiEntityFactory( - CapabilityServicesResultFactory({ - oauthClientId: 'clientId2', - }) - ), - ], - }, - }) - ), - StrapiEntityFactory( - CapabilityCapabilitiesResultFactory({ - slug: 'slug2b', - services: { - data: [ - StrapiEntityFactory( - CapabilityServicesResultFactory({ - oauthClientId: 'clientId2', - }) - ), - ], - }, - }) - ), + const mockCapabilityOfferingResult = CapabilityOfferingResultFactory({ + capabilities: [ + CapabilityCapabilitiesResultFactory({ + slug: 'slug1', + services: [ + CapabilityServicesResultFactory({ + oauthClientId: 'clientId1', + }), ], - }, - }) - ); - const mockCapabilityPurchaseResult = StrapiEntityFactory( - CapabilityPurchaseResultFactory({ - stripePlanChoices: [{ stripePlanChoice: 'planId1' }], - offering: { - data: mockCapabilityOfferingResult, - }, - }) - ); + }), + CapabilityCapabilitiesResultFactory({ + slug: 'slug2a', + services: [ + CapabilityServicesResultFactory({ + oauthClientId: 'clientId2', + }), + ], + }), + CapabilityCapabilitiesResultFactory({ + slug: 'slug2b', + services: [ + CapabilityServicesResultFactory({ + oauthClientId: 'clientId2', + }), + ], + }), + ], + }); + const mockCapabilityPurchaseResult = CapabilityPurchaseResultFactory({ + stripePlanChoices: [{ stripePlanChoice: 'planId1' }], + offering: mockCapabilityOfferingResult, + }); const mockCapabilityServiceByPlanIdsQuery = CapabilityServiceByPlanIdsQueryFactory({ - purchases: { - meta: { - pagination: { - total: 1, - }, - }, - data: [mockCapabilityPurchaseResult], - }, + purchases: [mockCapabilityPurchaseResult], }); jest .spyOn( @@ -299,9 +213,9 @@ describe('CapabilityManager', () => { 'getPurchaseDetailsForCapabilityServiceByPlanIds' ) .mockResolvedValue( - new CapabilityServiceByPlanIdsResultUtil([ - mockCapabilityServiceByPlanIdsQuery, - ] as CapabilityServiceByPlanIdsResult[]) + new CapabilityServiceByPlanIdsResultUtil( + mockCapabilityServiceByPlanIdsQuery as CapabilityServiceByPlanIdsResult + ) ); const result = await capabilityManager.priceIdsToClientCapabilities([ diff --git a/libs/payments/capability/src/lib/capability.manager.ts b/libs/payments/capability/src/lib/capability.manager.ts index 752cbdccc2..abcb2d2771 100644 --- a/libs/payments/capability/src/lib/capability.manager.ts +++ b/libs/payments/capability/src/lib/capability.manager.ts @@ -17,8 +17,8 @@ export class CapabilityManager { ).getServices(); return clients.map((client: ServiceResult) => { - const capabilities = client.capabilities.data.map( - (capability) => capability.attributes.slug + const capabilities = client.capabilities.map( + (capability) => capability.slug ); const sortedCapabilities = capabilities.sort(); return { @@ -50,20 +50,16 @@ export class CapabilityManager { purchaseDetails.capabilityOfferingForPlanId(subscribedPrice); // continue if neither offering nor capabilities exist - if (!capabilityOffering || !capabilityOffering?.capabilities?.data) - continue; + if (!capabilityOffering || !capabilityOffering?.capabilities) continue; - for (const capabilityCollection of capabilityOffering.capabilities.data) { + for (const capabilityCollection of capabilityOffering.capabilities) { // continue if individual capability does not contain any services - if (!capabilityCollection.attributes.services.data) continue; + if (!capabilityCollection.services) continue; - for (const capability of capabilityCollection.attributes.services - .data) { - result[capability.attributes.oauthClientId] ||= []; + for (const capability of capabilityCollection.services) { + result[capability.oauthClientId] ||= []; - result[capability.attributes.oauthClientId].push( - capabilityCollection.attributes.slug - ); + result[capability.oauthClientId].push(capabilityCollection.slug); } } } diff --git a/libs/payments/eligibility/src/lib/eligibility.manager.spec.ts b/libs/payments/eligibility/src/lib/eligibility.manager.spec.ts index 1c53bb328b..b9ebca82f9 100644 --- a/libs/payments/eligibility/src/lib/eligibility.manager.spec.ts +++ b/libs/payments/eligibility/src/lib/eligibility.manager.spec.ts @@ -24,7 +24,6 @@ import { MockStrapiClientConfigProvider, ProductConfigurationManager, StrapiClient, - StrapiEntityFactory, } from '@fxa/shared/cms'; import { CartEligibilityStatus } from '@fxa/shared/db/mysql/account'; @@ -66,9 +65,9 @@ describe('EligibilityManager', () => { jest .spyOn(productConfigurationManager, 'getPurchaseDetailsForEligibility') .mockResolvedValue( - new EligibilityContentByPlanIdsResultUtil([ - EligibilityContentByPlanIdsResultFactory(), - ]) + new EligibilityContentByPlanIdsResultUtil( + EligibilityContentByPlanIdsResultFactory() + ) ); const result = await manager.getOfferingOverlap(['test'], [], 'test'); @@ -77,7 +76,7 @@ describe('EligibilityManager', () => { it('should return same offeringStripeProductIds as same comparison', async () => { const eligibilityContentByPlanIdsResultUtil = - new EligibilityContentByPlanIdsResultUtil([]); + new EligibilityContentByPlanIdsResultUtil({ purchases: [] }); jest .spyOn(productConfigurationManager, 'getPurchaseDetailsForEligibility') .mockResolvedValue(eligibilityContentByPlanIdsResultUtil); @@ -100,39 +99,27 @@ describe('EligibilityManager', () => { it('should return subgroup upgrade target offeringStripeProductIds as upgrade comparison', async () => { const mockOfferingResult = EligibilityOfferingResultFactory({ stripeProductId: 'prod_test3', - subGroups: { - data: [ - StrapiEntityFactory( - EligibilitySubgroupResultFactory({ - offerings: { - data: [ - StrapiEntityFactory( - EligibilitySubgroupOfferingResultFactory({ - stripeProductId: 'prod_test', - countries: ['usa'], - }) - ), - StrapiEntityFactory( - EligibilitySubgroupOfferingResultFactory({ - stripeProductId: 'prod_test2', - countries: ['usa'], - }) - ), - StrapiEntityFactory( - EligibilitySubgroupOfferingResultFactory({ - stripeProductId: 'prod_test3', - countries: ['usa'], - }) - ), - ], - }, - }) - ), - ], - }, + subGroups: [ + EligibilitySubgroupResultFactory({ + offerings: [ + EligibilitySubgroupOfferingResultFactory({ + stripeProductId: 'prod_test', + countries: ['usa'], + }), + EligibilitySubgroupOfferingResultFactory({ + stripeProductId: 'prod_test2', + countries: ['usa'], + }), + EligibilitySubgroupOfferingResultFactory({ + stripeProductId: 'prod_test3', + countries: ['usa'], + }), + ], + }), + ], }); const eligibilityContentByPlanIdsResultUtil = - new EligibilityContentByPlanIdsResultUtil([]); + new EligibilityContentByPlanIdsResultUtil({ purchases: [] }); jest .spyOn(productConfigurationManager, 'getPurchaseDetailsForEligibility') .mockResolvedValue(eligibilityContentByPlanIdsResultUtil); @@ -152,33 +139,23 @@ describe('EligibilityManager', () => { it('should return subgroup downgrade target offeringStripeProductIds as downgrade comparison', async () => { const mockOfferingResult = EligibilityOfferingResultFactory({ stripeProductId: 'prod_test', - subGroups: { - data: [ - StrapiEntityFactory( - EligibilitySubgroupResultFactory({ - offerings: { - data: [ - StrapiEntityFactory( - EligibilitySubgroupOfferingResultFactory({ - stripeProductId: 'prod_test', - countries: ['usa'], - }) - ), - StrapiEntityFactory( - EligibilitySubgroupOfferingResultFactory({ - stripeProductId: 'prod_test2', - countries: ['usa'], - }) - ), - ], - }, - }) - ), - ], - }, + subGroups: [ + EligibilitySubgroupResultFactory({ + offerings: [ + EligibilitySubgroupOfferingResultFactory({ + stripeProductId: 'prod_test', + countries: ['usa'], + }), + EligibilitySubgroupOfferingResultFactory({ + stripeProductId: 'prod_test2', + countries: ['usa'], + }), + ], + }), + ], }); const eligibilityContentByPlanIdsResultUtil = - new EligibilityContentByPlanIdsResultUtil([]); + new EligibilityContentByPlanIdsResultUtil({ purchases: [] }); jest .spyOn(productConfigurationManager, 'getPurchaseDetailsForEligibility') .mockResolvedValue(eligibilityContentByPlanIdsResultUtil); @@ -203,7 +180,7 @@ describe('EligibilityManager', () => { stripeProductId: 'prod_test', }); const eligibilityContentByPlanIdsResultUtil = - new EligibilityContentByPlanIdsResultUtil([]); + new EligibilityContentByPlanIdsResultUtil({ purchases: [] }); jest .spyOn(productConfigurationManager, 'getPurchaseDetailsForEligibility') .mockResolvedValue(eligibilityContentByPlanIdsResultUtil); @@ -224,36 +201,26 @@ describe('EligibilityManager', () => { it('should return upgrade comparison for upgrade priceId', async () => { const mockOfferingResult = EligibilityOfferingResultFactory({ stripeProductId: 'prod_test2', - subGroups: { - data: [ - StrapiEntityFactory( - EligibilitySubgroupResultFactory({ - offerings: { - data: [ - StrapiEntityFactory( - EligibilitySubgroupOfferingResultFactory({ - stripeProductId: 'prod_test', - countries: ['usa'], - }) - ), - StrapiEntityFactory( - EligibilitySubgroupOfferingResultFactory({ - stripeProductId: 'prod_test2', - countries: ['usa'], - }) - ), - ], - }, - }) - ), - ], - }, + subGroups: [ + EligibilitySubgroupResultFactory({ + offerings: [ + EligibilitySubgroupOfferingResultFactory({ + stripeProductId: 'prod_test', + countries: ['usa'], + }), + EligibilitySubgroupOfferingResultFactory({ + stripeProductId: 'prod_test2', + countries: ['usa'], + }), + ], + }), + ], }); const existingResult = EligibilityOfferingResultFactory({ stripeProductId: 'prod_test', }); const eligibilityContentByPlanIdsResultUtil = - new EligibilityContentByPlanIdsResultUtil([]); + new EligibilityContentByPlanIdsResultUtil({ purchases: [] }); jest .spyOn(productConfigurationManager, 'getPurchaseDetailsForEligibility') .mockResolvedValue(eligibilityContentByPlanIdsResultUtil); @@ -274,62 +241,42 @@ describe('EligibilityManager', () => { it('should return multiple comparisons in multiple subgroups', async () => { const mockOfferingResult = EligibilityOfferingResultFactory({ stripeProductId: 'prod_test2', - subGroups: { - data: [ - StrapiEntityFactory( - EligibilitySubgroupResultFactory({ - offerings: { - data: [ - StrapiEntityFactory( - EligibilitySubgroupOfferingResultFactory({ - stripeProductId: 'prod_test', - countries: ['usa'], - }) - ), - StrapiEntityFactory( - EligibilitySubgroupOfferingResultFactory({ - stripeProductId: 'prod_test2', - countries: ['usa'], - }) - ), - StrapiEntityFactory( - EligibilitySubgroupOfferingResultFactory({ - stripeProductId: 'prod_test3', - countries: ['usa'], - }) - ), - ], - }, - }) - ), - StrapiEntityFactory( - EligibilitySubgroupResultFactory({ - offerings: { - data: [ - StrapiEntityFactory( - EligibilitySubgroupOfferingResultFactory({ - stripeProductId: 'prod_test', - countries: ['usa'], - }) - ), - StrapiEntityFactory( - EligibilitySubgroupOfferingResultFactory({ - stripeProductId: 'prod_test2', - countries: ['usa'], - }) - ), - ], - }, - }) - ), - ], - }, + subGroups: [ + EligibilitySubgroupResultFactory({ + offerings: [ + EligibilitySubgroupOfferingResultFactory({ + stripeProductId: 'prod_test', + countries: ['usa'], + }), + EligibilitySubgroupOfferingResultFactory({ + stripeProductId: 'prod_test2', + countries: ['usa'], + }), + EligibilitySubgroupOfferingResultFactory({ + stripeProductId: 'prod_test3', + countries: ['usa'], + }), + ], + }), + EligibilitySubgroupResultFactory({ + offerings: [ + EligibilitySubgroupOfferingResultFactory({ + stripeProductId: 'prod_test', + countries: ['usa'], + }), + EligibilitySubgroupOfferingResultFactory({ + stripeProductId: 'prod_test2', + countries: ['usa'], + }), + ], + }), + ], }); const existingResult = EligibilityOfferingResultFactory({ stripeProductId: 'prod_test', }); const eligibilityContentByPlanIdsResultUtil = - new EligibilityContentByPlanIdsResultUtil([]); + new EligibilityContentByPlanIdsResultUtil({ purchases: [] }); jest .spyOn(productConfigurationManager, 'getPurchaseDetailsForEligibility') .mockResolvedValue(eligibilityContentByPlanIdsResultUtil); @@ -385,33 +332,21 @@ describe('EligibilityManager', () => { it('should return subgroup upgrade target offeringStripeProductIds as upgrade comparison', async () => { const mockTargetOfferingResult = EligibilityContentOfferingResultFactory({ stripeProductId: 'prod_test3', - subGroups: { - data: [ - StrapiEntityFactory( - EligibilityContentSubgroupResultFactory({ - offerings: { - data: [ - StrapiEntityFactory( - EligibilityContentSubgroupOfferingResultFactory({ - stripeProductId: 'prod_test', - }) - ), - StrapiEntityFactory( - EligibilityContentSubgroupOfferingResultFactory({ - stripeProductId: 'prod_test2', - }) - ), - StrapiEntityFactory( - EligibilityContentSubgroupOfferingResultFactory({ - stripeProductId: 'prod_test3', - }) - ), - ], - }, - }) - ), - ], - }, + subGroups: [ + EligibilityContentSubgroupResultFactory({ + offerings: [ + EligibilityContentSubgroupOfferingResultFactory({ + stripeProductId: 'prod_test', + }), + EligibilityContentSubgroupOfferingResultFactory({ + stripeProductId: 'prod_test2', + }), + EligibilityContentSubgroupOfferingResultFactory({ + stripeProductId: 'prod_test3', + }), + ], + }), + ], }); const result = manager.getProductIdOverlap( @@ -425,28 +360,18 @@ describe('EligibilityManager', () => { it('should return subgroup downgrade target offeringStripeProductIds as downgrade comparison', async () => { const mockTargetOfferingResult = EligibilityContentOfferingResultFactory({ stripeProductId: 'prod_test', - subGroups: { - data: [ - StrapiEntityFactory( - EligibilityContentSubgroupResultFactory({ - offerings: { - data: [ - StrapiEntityFactory( - EligibilityContentSubgroupOfferingResultFactory({ - stripeProductId: 'prod_test', - }) - ), - StrapiEntityFactory( - EligibilityContentSubgroupOfferingResultFactory({ - stripeProductId: 'prod_test2', - }) - ), - ], - }, - }) - ), - ], - }, + subGroups: [ + EligibilityContentSubgroupResultFactory({ + offerings: [ + EligibilityContentSubgroupOfferingResultFactory({ + stripeProductId: 'prod_test', + }), + EligibilityContentSubgroupOfferingResultFactory({ + stripeProductId: 'prod_test2', + }), + ], + }), + ], }); const result = manager.getProductIdOverlap( @@ -473,28 +398,18 @@ describe('EligibilityManager', () => { it('should return upgrade comparison for upgrade priceId', async () => { const mockTargetOfferingResult = EligibilityContentOfferingResultFactory({ stripeProductId: 'prod_test2', - subGroups: { - data: [ - StrapiEntityFactory( - EligibilityContentSubgroupResultFactory({ - offerings: { - data: [ - StrapiEntityFactory( - EligibilityContentSubgroupOfferingResultFactory({ - stripeProductId: 'prod_test', - }) - ), - StrapiEntityFactory( - EligibilityContentSubgroupOfferingResultFactory({ - stripeProductId: 'prod_test2', - }) - ), - ], - }, - }) - ), - ], - }, + subGroups: [ + EligibilityContentSubgroupResultFactory({ + offerings: [ + EligibilityContentSubgroupOfferingResultFactory({ + stripeProductId: 'prod_test', + }), + EligibilityContentSubgroupOfferingResultFactory({ + stripeProductId: 'prod_test2', + }), + ], + }), + ], }); const result = manager.getProductIdOverlap( ['prod_test'], @@ -507,51 +422,31 @@ describe('EligibilityManager', () => { it('should return multiple comparisons in multiple subgroups', async () => { const mockTargetOfferingResult = EligibilityContentOfferingResultFactory({ stripeProductId: 'prod_test2', - subGroups: { - data: [ - StrapiEntityFactory( - EligibilityContentSubgroupResultFactory({ - offerings: { - data: [ - StrapiEntityFactory( - EligibilityContentSubgroupOfferingResultFactory({ - stripeProductId: 'prod_test', - }) - ), - StrapiEntityFactory( - EligibilityContentSubgroupOfferingResultFactory({ - stripeProductId: 'prod_test2', - }) - ), - StrapiEntityFactory( - EligibilityContentSubgroupOfferingResultFactory({ - stripeProductId: 'prod_test3', - }) - ), - ], - }, - }) - ), - StrapiEntityFactory( - EligibilityContentSubgroupResultFactory({ - offerings: { - data: [ - StrapiEntityFactory( - EligibilityContentSubgroupOfferingResultFactory({ - stripeProductId: 'prod_test', - }) - ), - StrapiEntityFactory( - EligibilityContentSubgroupOfferingResultFactory({ - stripeProductId: 'prod_test2', - }) - ), - ], - }, - }) - ), - ], - }, + subGroups: [ + EligibilityContentSubgroupResultFactory({ + offerings: [ + EligibilityContentSubgroupOfferingResultFactory({ + stripeProductId: 'prod_test', + }), + EligibilityContentSubgroupOfferingResultFactory({ + stripeProductId: 'prod_test2', + }), + EligibilityContentSubgroupOfferingResultFactory({ + stripeProductId: 'prod_test3', + }), + ], + }), + EligibilityContentSubgroupResultFactory({ + offerings: [ + EligibilityContentSubgroupOfferingResultFactory({ + stripeProductId: 'prod_test', + }), + EligibilityContentSubgroupOfferingResultFactory({ + stripeProductId: 'prod_test2', + }), + ], + }), + ], }); const result = manager.getProductIdOverlap( ['prod_test2', 'prod_test3'], diff --git a/libs/payments/eligibility/src/lib/eligibility.manager.ts b/libs/payments/eligibility/src/lib/eligibility.manager.ts index 2f59e1e3b2..a003f4cb5b 100644 --- a/libs/payments/eligibility/src/lib/eligibility.manager.ts +++ b/libs/payments/eligibility/src/lib/eligibility.manager.ts @@ -112,8 +112,7 @@ export class EligibilityManager { if (overlap.comparison === OfferingComparison.DOWNGRADE) return EligibilityStatus.DOWNGRADE; - const targetPriceIds = - targetOffering.defaultPurchase.data.attributes.stripePlanChoices; + const targetPriceIds = targetOffering.defaultPurchase.stripePlanChoices; const targetPrice = await this.priceManager.retrieveByInterval( targetPriceIds.map((el) => el.stripePlanChoice), interval diff --git a/libs/payments/eligibility/src/lib/eligibility.service.spec.ts b/libs/payments/eligibility/src/lib/eligibility.service.spec.ts index 2ddb658fc0..267f259e10 100644 --- a/libs/payments/eligibility/src/lib/eligibility.service.spec.ts +++ b/libs/payments/eligibility/src/lib/eligibility.service.spec.ts @@ -20,7 +20,6 @@ import { MockStrapiClientConfigProvider, ProductConfigurationManager, StrapiClient, - StrapiEntityFactory, } from '@fxa/shared/cms'; import { MockFirestoreProvider } from '@fxa/shared/db/firestore'; import { MockStatsDProvider } from '@fxa/shared/metrics/statsd'; @@ -84,7 +83,7 @@ describe('EligibilityService', () => { .mockResolvedValue( new EligibilityContentByOfferingResultUtil( EligibilityContentByOfferingResultFactory({ - offerings: { data: [] }, + offerings: [], }) ) ); @@ -115,9 +114,7 @@ describe('EligibilityService', () => { .mockResolvedValue( new EligibilityContentByOfferingResultUtil( EligibilityContentByOfferingResultFactory({ - offerings: { - data: [StrapiEntityFactory(mockOffering)], - }, + offerings: [mockOffering], }) ) ); diff --git a/libs/payments/eligibility/src/lib/utils.ts b/libs/payments/eligibility/src/lib/utils.ts index f67d00c95e..1102668dbe 100644 --- a/libs/payments/eligibility/src/lib/utils.ts +++ b/libs/payments/eligibility/src/lib/utils.ts @@ -24,15 +24,15 @@ export const offeringComparison = ( ) => { if (targetOffering.stripeProductId === fromOfferingProductId) return OfferingComparison.SAME; - const commonSubgroups = targetOffering.subGroups.data.filter( + const commonSubgroups = targetOffering.subGroups.filter( (subgroup) => - !!subgroup.attributes.offerings.data.find( - (oc) => oc.attributes.stripeProductId === fromOfferingProductId + !!subgroup.offerings.find( + (oc) => oc.stripeProductId === fromOfferingProductId ) ); if (!commonSubgroups.length) return null; - const subgroupProductIds = commonSubgroups[0].attributes.offerings.data.map( - (o) => o.attributes.stripeProductId + const subgroupProductIds = commonSubgroups[0].offerings.map( + (o) => o.stripeProductId ); const existingIndex = subgroupProductIds.indexOf(fromOfferingProductId); const targetIndex = subgroupProductIds.indexOf( diff --git a/libs/payments/legacy/src/lib/stripe-mapper.service.spec.ts b/libs/payments/legacy/src/lib/stripe-mapper.service.spec.ts index be5f19f96f..c875399691 100644 --- a/libs/payments/legacy/src/lib/stripe-mapper.service.spec.ts +++ b/libs/payments/legacy/src/lib/stripe-mapper.service.spec.ts @@ -19,7 +19,6 @@ import { PurchaseDetailsTransformedFactory, StrapiClient, MockStrapiClientConfigProvider, - StrapiEntityFactory, } from '@fxa/shared/cms'; import { MockFirestoreProvider } from '@fxa/shared/db/firestore'; import { MockStatsDProvider } from '@fxa/shared/metrics/statsd'; @@ -149,7 +148,7 @@ describe('StripeMapperService', () => { it('should return data from cms default locale if no localization data is available', async () => { const expected = PurchaseWithDetailsOfferingContentTransformedFactory(); - expected.purchaseDetails.data.attributes.localizations.data = []; + expected.purchaseDetails.localizations = []; mockCMSConfigUtil.transformedPurchaseWithCommonContentForPlanId.mockReturnValueOnce( expected ); @@ -165,10 +164,10 @@ describe('StripeMapperService', () => { await stripeMapper.mapCMSToStripePlans([stripePlan], 'en', false); const actualProduct = mappedPlans[0].product as Stripe.Product; expect(mappedPlans[0].metadata?.['webIconURL']).toBe( - expected.purchaseDetails.data.attributes.webIcon + expected.purchaseDetails.webIcon ); expect(actualProduct.metadata?.['webIconURL']).toBe( - expected.purchaseDetails.data.attributes.webIcon + expected.purchaseDetails.webIcon ); expect(actualProduct.metadata?.['productSet']).toBe( productMetadata.productSet @@ -196,12 +195,10 @@ describe('StripeMapperService', () => { await stripeMapper.mapCMSToStripePlans([stripePlan], 'en', false); const actualProduct = mappedPlans[0].product as Stripe.Product; expect(mappedPlans[0].metadata?.['webIconURL']).toBe( - expected.purchaseDetails.data.attributes.localizations.data[0] - .attributes.webIcon + expected.purchaseDetails.localizations[0].webIcon ); expect(actualProduct.metadata?.['webIconURL']).toBe( - expected.purchaseDetails.data.attributes.localizations.data[0] - .attributes.webIcon + expected.purchaseDetails.localizations[0].webIcon ); expect(actualProduct.metadata?.['productSet']).toBe( productMetadata.productSet @@ -215,13 +212,9 @@ describe('StripeMapperService', () => { it('should return data from CMS and not error on locale plan', async () => { const expected = PurchaseWithDetailsOfferingContentTransformedFactory({ purchaseDetails: { - data: StrapiEntityFactory({ - localizations: { - data: [], - }, - ...PurchaseDetailsTransformedFactory({ - details: ['Detail 1 in English'], - }), + localizations: [], + ...PurchaseDetailsTransformedFactory({ + details: ['Detail 1 in English'], }), }, }); @@ -260,10 +253,10 @@ describe('StripeMapperService', () => { const actualProduct1 = mappedPlans[0].product as Stripe.Product; const actualProduct2 = mappedPlans[1].product as Stripe.Product; expect(mappedPlans[0].metadata?.['product:details:1']).toBe( - expected.purchaseDetails.data.attributes.details[0] + expected.purchaseDetails.details[0] ); expect(actualProduct1.metadata?.['product:details:1']).toBe( - expected.purchaseDetails.data.attributes.details[0] + expected.purchaseDetails.details[0] ); expect(mappedPlans[1].metadata?.['product:details:1']).toBe( 'Detail 1 in French' @@ -276,13 +269,9 @@ describe('StripeMapperService', () => { it('should return data from Stripe and concat errors for product', async () => { const expected = PurchaseWithDetailsOfferingContentTransformedFactory({ purchaseDetails: { - data: StrapiEntityFactory({ - localizations: { - data: [], - }, - ...PurchaseDetailsTransformedFactory({ - details: ['Detail 1 in English'], - }), + localizations: [], + ...PurchaseDetailsTransformedFactory({ + details: ['Detail 1 in English'], }), }, }); diff --git a/libs/payments/legacy/src/lib/stripe-mapper.service.ts b/libs/payments/legacy/src/lib/stripe-mapper.service.ts index 5730a222c5..dbc19b3f70 100644 --- a/libs/payments/legacy/src/lib/stripe-mapper.service.ts +++ b/libs/payments/legacy/src/lib/stripe-mapper.service.ts @@ -95,18 +95,16 @@ export class StripeMapperService { continue; } - const commonContentAttributes = - cmsConfigData.offering.data.attributes.commonContent.data.attributes; + const commonContentAttributes = cmsConfigData.offering.commonContent; const commonContentAttributesLocalized = commonContentAttributes - .localizations.data.length - ? commonContentAttributes.localizations.data[0].attributes + .localizations.length + ? commonContentAttributes.localizations[0] : commonContentAttributes; - const purchaseDetailsAttributes = - cmsConfigData.purchaseDetails.data.attributes; + const purchaseDetailsAttributes = cmsConfigData.purchaseDetails; const purchaseDetailsLocalizedAttributes = purchaseDetailsAttributes - .localizations.data.length - ? purchaseDetailsAttributes.localizations.data[0].attributes + .localizations.length + ? purchaseDetailsAttributes.localizations[0] : purchaseDetailsAttributes; const planMapper = new PlanMapperUtil( diff --git a/libs/shared/cms/src/__generated__/fragment-masking.ts b/libs/shared/cms/src/__generated__/fragment-masking.ts index e8015cefc2..aca71b1352 100644 --- a/libs/shared/cms/src/__generated__/fragment-masking.ts +++ b/libs/shared/cms/src/__generated__/fragment-masking.ts @@ -1,15 +1,13 @@ /* eslint-disable */ -import { - ResultOf, - DocumentTypeDecoration, - TypedDocumentNode, -} from '@graphql-typed-document-node/core'; +import { ResultOf, DocumentTypeDecoration, TypedDocumentNode } from '@graphql-typed-document-node/core'; import { FragmentDefinitionNode } from 'graphql'; import { Incremental } from './graphql'; -export type FragmentType< - TDocumentType extends DocumentTypeDecoration -> = TDocumentType extends DocumentTypeDecoration + +export type FragmentType> = TDocumentType extends DocumentTypeDecoration< + infer TType, + any +> ? [TType] extends [{ ' $fragmentName'?: infer TKey }] ? TKey extends string ? { ' $fragmentRefs'?: { [key in TKey]: TType } } @@ -35,10 +33,7 @@ export function useFragment( // return nullable if `fragmentType` is nullable or undefined export function useFragment( _documentNode: DocumentTypeDecoration, - fragmentType: - | FragmentType> - | null - | undefined + fragmentType: FragmentType> | null | undefined ): TType | null | undefined; // return array of non-nullable if `fragmentType` is array of non-nullable export function useFragment( @@ -48,10 +43,7 @@ export function useFragment( // return array of nullable if `fragmentType` is array of nullable export function useFragment( _documentNode: DocumentTypeDecoration, - fragmentType: - | Array>> - | null - | undefined + fragmentType: Array>> | null | undefined ): Array | null | undefined; // return readonly array of non-nullable if `fragmentType` is array of non-nullable export function useFragment( @@ -61,23 +53,16 @@ export function useFragment( // return readonly array of nullable if `fragmentType` is array of nullable export function useFragment( _documentNode: DocumentTypeDecoration, - fragmentType: - | ReadonlyArray>> - | null - | undefined + fragmentType: ReadonlyArray>> | null | undefined ): ReadonlyArray | null | undefined; export function useFragment( _documentNode: DocumentTypeDecoration, - fragmentType: - | FragmentType> - | Array>> - | ReadonlyArray>> - | null - | undefined + fragmentType: FragmentType> | Array>> | ReadonlyArray>> | null | undefined ): TType | Array | ReadonlyArray | null | undefined { return fragmentType as any; } + export function makeFragmentData< F extends DocumentTypeDecoration, FT extends ResultOf @@ -87,24 +72,16 @@ export function makeFragmentData< export function isFragmentReady( queryNode: DocumentTypeDecoration, fragmentNode: TypedDocumentNode, - data: - | FragmentType, any>> - | null - | undefined + data: FragmentType, any>> | null | undefined ): data is FragmentType { - const deferredFields = ( - queryNode as { - __meta__?: { deferredFields: Record }; - } - ).__meta__?.deferredFields; + const deferredFields = (queryNode as { __meta__?: { deferredFields: Record } }).__meta__ + ?.deferredFields; if (!deferredFields) return true; - const fragDef = fragmentNode.definitions[0] as - | FragmentDefinitionNode - | undefined; + const fragDef = fragmentNode.definitions[0] as FragmentDefinitionNode | undefined; const fragName = fragDef?.name?.value; const fields = (fragName && deferredFields[fragName]) || []; - return fields.length > 0 && fields.every((field) => data && field in data); + return fields.length > 0 && fields.every(field => data && field in data); } diff --git a/libs/shared/cms/src/__generated__/gql.ts b/libs/shared/cms/src/__generated__/gql.ts index 93d2342a18..1a5a0b70ac 100644 --- a/libs/shared/cms/src/__generated__/gql.ts +++ b/libs/shared/cms/src/__generated__/gql.ts @@ -13,22 +13,14 @@ 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 CapabilityServiceByPlanIds(\n $skip: Int!\n $limit: Int!\n $stripePlanIds: [String]!\n ) {\n purchases(\n filters: {\n or: [\n { stripePlanChoices: { stripePlanChoice: { in: $stripePlanIds } } }\n {\n offering: {\n stripeLegacyPlans: { stripeLegacyPlan: { in: $stripePlanIds } }\n }\n }\n ]\n }\n pagination: { start: $skip, limit: $limit }\n ) {\n meta {\n pagination {\n total\n }\n }\n data {\n attributes {\n stripePlanChoices {\n stripePlanChoice\n }\n offering {\n data {\n attributes {\n stripeLegacyPlans(pagination: { limit: 200 }) {\n stripeLegacyPlan\n }\n capabilities {\n data {\n attributes {\n slug\n services {\n data {\n attributes {\n oauthClientId\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n': - types.CapabilityServiceByPlanIdsDocument, - '\n query EligibilityContentByOffering($apiIdentifier: String!) {\n offerings(\n pagination: { start: 0, limit: 2 }\n filters: { apiIdentifier: { eq: $apiIdentifier } }\n ) {\n data {\n attributes {\n apiIdentifier\n stripeProductId\n defaultPurchase {\n data {\n attributes {\n stripePlanChoices {\n stripePlanChoice\n }\n }\n }\n }\n subGroups {\n data {\n attributes {\n groupName\n offerings {\n data {\n attributes {\n apiIdentifier\n stripeProductId\n defaultPurchase {\n data {\n attributes {\n stripePlanChoices {\n stripePlanChoice\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n': - types.EligibilityContentByOfferingDocument, - '\n query EligibilityContentByPlanIds(\n $skip: Int!\n $limit: Int!\n $stripePlanIds: [String]!\n ) {\n purchases(\n pagination: { start: $skip, limit: $limit }\n filters: {\n or: [\n { stripePlanChoices: { stripePlanChoice: { in: $stripePlanIds } } }\n {\n offering: {\n stripeLegacyPlans: { stripeLegacyPlan: { in: $stripePlanIds } }\n }\n }\n ]\n }\n ) {\n meta {\n pagination {\n total\n }\n }\n data {\n attributes {\n stripePlanChoices {\n stripePlanChoice\n }\n offering {\n data {\n attributes {\n stripeProductId\n stripeLegacyPlans(pagination: { limit: 200 }) {\n stripeLegacyPlan\n }\n countries\n subGroups {\n data {\n attributes {\n groupName\n offerings {\n data {\n attributes {\n stripeProductId\n stripeLegacyPlans(pagination: { limit: 200 }) {\n stripeLegacyPlan\n }\n countries\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n': - types.EligibilityContentByPlanIdsDocument, - '\n query Locales {\n i18NLocales {\n data {\n attributes {\n code\n }\n }\n }\n }\n': - types.LocalesDocument, - '\n query Offering($id: ID!, $locale: String!) {\n offering(id: $id) {\n data {\n attributes {\n stripeProductId\n countries\n defaultPurchase {\n data {\n attributes {\n purchaseDetails {\n data {\n attributes {\n productName\n details\n subtitle\n webIcon\n localizations(filters: { locale: { eq: $locale } }) {\n data {\n attributes {\n productName\n details\n subtitle\n webIcon\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n': - types.OfferingDocument, - '\n query PageContentForOffering($locale: String!, $apiIdentifier: String!) {\n offerings(\n pagination: { start: 0, limit: 2 }\n filters: { apiIdentifier: { eq: $apiIdentifier } }\n ) {\n meta {\n pagination {\n total\n }\n }\n data {\n attributes {\n apiIdentifier\n stripeProductId\n defaultPurchase {\n data {\n attributes {\n purchaseDetails {\n data {\n attributes {\n details\n productName\n subtitle\n webIcon\n localizations(filters: { locale: { eq: $locale } }) {\n data {\n attributes {\n details\n productName\n subtitle\n webIcon\n }\n }\n }\n }\n }\n }\n }\n }\n }\n commonContent {\n data {\n attributes {\n privacyNoticeUrl\n privacyNoticeDownloadUrl\n termsOfServiceUrl\n termsOfServiceDownloadUrl\n cancellationUrl\n emailIcon\n successActionButtonUrl\n successActionButtonLabel\n newsletterLabelTextCode\n newsletterSlug\n localizations(filters: { locale: { eq: $locale } }) {\n data {\n attributes {\n privacyNoticeUrl\n privacyNoticeDownloadUrl\n termsOfServiceUrl\n termsOfServiceDownloadUrl\n cancellationUrl\n emailIcon\n successActionButtonUrl\n successActionButtonLabel\n newsletterLabelTextCode\n newsletterSlug\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n': - types.PageContentForOfferingDocument, - '\n query PurchaseWithDetailsOfferingContent(\n $skip: Int!\n $limit: Int!\n $locale: String!\n $stripePlanIds: [String]!\n ) {\n purchases(\n pagination: { start: $skip, limit: $limit }\n filters: {\n or: [\n { stripePlanChoices: { stripePlanChoice: { in: $stripePlanIds } } }\n {\n offering: {\n stripeLegacyPlans: { stripeLegacyPlan: { in: $stripePlanIds } }\n }\n }\n ]\n }\n ) {\n data {\n attributes {\n stripePlanChoices {\n stripePlanChoice\n }\n purchaseDetails {\n data {\n attributes {\n details\n productName\n subtitle\n webIcon\n localizations(filters: { locale: { eq: $locale } }) {\n data {\n attributes {\n details\n productName\n subtitle\n webIcon\n }\n }\n }\n }\n }\n }\n offering {\n data {\n attributes {\n stripeProductId\n stripeLegacyPlans(pagination: { limit: 200 }) {\n stripeLegacyPlan\n }\n commonContent {\n data {\n attributes {\n privacyNoticeUrl\n privacyNoticeDownloadUrl\n termsOfServiceUrl\n termsOfServiceDownloadUrl\n cancellationUrl\n emailIcon\n successActionButtonUrl\n successActionButtonLabel\n newsletterLabelTextCode\n newsletterSlug\n localizations(filters: { locale: { eq: $locale } }) {\n data {\n attributes {\n privacyNoticeUrl\n privacyNoticeDownloadUrl\n termsOfServiceUrl\n termsOfServiceDownloadUrl\n cancellationUrl\n emailIcon\n successActionButtonUrl\n successActionButtonLabel\n newsletterLabelTextCode\n newsletterSlug\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n': - types.PurchaseWithDetailsOfferingContentDocument, - '\n query ServicesWithCapabilities($skip: Int!, $limit: Int!) {\n services(pagination: { start: $skip, limit: $limit }) {\n data {\n attributes {\n oauthClientId\n capabilities {\n data {\n attributes {\n slug\n }\n }\n }\n }\n }\n }\n }\n': - types.ServicesWithCapabilitiesDocument, + "\n query CapabilityServiceByPlanIds($stripePlanIds: [String]!) {\n purchases(\n filters: {\n or: [\n { stripePlanChoices: { stripePlanChoice: { in: $stripePlanIds } } }\n {\n offering: {\n stripeLegacyPlans: { stripeLegacyPlan: { in: $stripePlanIds } }\n }\n }\n ]\n }\n pagination: { limit: 200 }\n ) {\n stripePlanChoices {\n stripePlanChoice\n }\n offering {\n stripeLegacyPlans(pagination: { limit: 200 }) {\n stripeLegacyPlan\n }\n capabilities {\n slug\n services {\n oauthClientId\n }\n }\n }\n }\n }\n": types.CapabilityServiceByPlanIdsDocument, + "\n query EligibilityContentByOffering($apiIdentifier: String!) {\n offerings(\n filters: { apiIdentifier: { eq: $apiIdentifier } }\n pagination: { limit: 200 }\n ) {\n apiIdentifier\n stripeProductId\n defaultPurchase {\n stripePlanChoices {\n stripePlanChoice\n }\n }\n subGroups {\n groupName\n offerings {\n apiIdentifier\n stripeProductId\n defaultPurchase {\n stripePlanChoices {\n stripePlanChoice\n }\n }\n }\n }\n }\n }\n": types.EligibilityContentByOfferingDocument, + "\n query EligibilityContentByPlanIds($stripePlanIds: [String]!) {\n purchases(\n filters: {\n or: [\n { stripePlanChoices: { stripePlanChoice: { in: $stripePlanIds } } }\n {\n offering: {\n stripeLegacyPlans: { stripeLegacyPlan: { in: $stripePlanIds } }\n }\n }\n ]\n }\n pagination: { limit: 200 }\n ) {\n stripePlanChoices {\n stripePlanChoice\n }\n offering {\n stripeProductId\n stripeLegacyPlans(pagination: { limit: 200 }) {\n stripeLegacyPlan\n }\n countries\n subGroups {\n groupName\n offerings {\n stripeProductId\n stripeLegacyPlans(pagination: { limit: 200 }) {\n stripeLegacyPlan\n }\n countries\n }\n }\n }\n }\n }\n": types.EligibilityContentByPlanIdsDocument, + "\n query Locales {\n i18NLocales {\n code\n }\n }\n": types.LocalesDocument, + "\n query Offering($id: ID!, $locale: String!) {\n offering(documentId: $id) {\n stripeProductId\n countries\n defaultPurchase {\n purchaseDetails {\n productName\n details\n subtitle\n webIcon\n localizations(filters: { locale: { eq: $locale } }) {\n productName\n details\n subtitle\n webIcon\n }\n }\n }\n }\n }\n": types.OfferingDocument, + "\n query PageContentForOffering($locale: String!, $apiIdentifier: String!) {\n offerings(\n filters: { apiIdentifier: { eq: $apiIdentifier } }\n pagination: { limit: 200 }\n ) {\n apiIdentifier\n stripeProductId\n defaultPurchase {\n purchaseDetails {\n details\n productName\n subtitle\n webIcon\n localizations(filters: { locale: { eq: $locale } }) {\n details\n productName\n subtitle\n webIcon\n }\n }\n }\n commonContent {\n privacyNoticeUrl\n privacyNoticeDownloadUrl\n termsOfServiceUrl\n termsOfServiceDownloadUrl\n cancellationUrl\n emailIcon\n successActionButtonUrl\n successActionButtonLabel\n newsletterLabelTextCode\n newsletterSlug\n localizations(filters: { locale: { eq: $locale } }) {\n privacyNoticeUrl\n privacyNoticeDownloadUrl\n termsOfServiceUrl\n termsOfServiceDownloadUrl\n cancellationUrl\n emailIcon\n successActionButtonUrl\n successActionButtonLabel\n newsletterLabelTextCode\n newsletterSlug\n }\n }\n }\n }\n": types.PageContentForOfferingDocument, + "\n query PurchaseWithDetailsOfferingContent(\n $locale: String!\n $stripePlanIds: [String]!\n ) {\n purchases(\n filters: {\n or: [\n { stripePlanChoices: { stripePlanChoice: { in: $stripePlanIds } } }\n {\n offering: {\n stripeLegacyPlans: { stripeLegacyPlan: { in: $stripePlanIds } }\n }\n }\n ]\n }\n pagination: { limit: 500 }\n ) {\n stripePlanChoices {\n stripePlanChoice\n }\n purchaseDetails {\n details\n productName\n subtitle\n webIcon\n localizations(filters: { locale: { eq: $locale } }) {\n details\n productName\n subtitle\n webIcon\n }\n }\n offering {\n stripeProductId\n stripeLegacyPlans(pagination: { limit: 200 }) {\n stripeLegacyPlan\n }\n commonContent {\n privacyNoticeUrl\n privacyNoticeDownloadUrl\n termsOfServiceUrl\n termsOfServiceDownloadUrl\n cancellationUrl\n emailIcon\n successActionButtonUrl\n successActionButtonLabel\n newsletterLabelTextCode\n newsletterSlug\n localizations(filters: { locale: { eq: $locale } }) {\n privacyNoticeUrl\n privacyNoticeDownloadUrl\n termsOfServiceUrl\n termsOfServiceDownloadUrl\n cancellationUrl\n emailIcon\n successActionButtonUrl\n successActionButtonLabel\n newsletterLabelTextCode\n newsletterSlug\n }\n }\n }\n }\n }\n": types.PurchaseWithDetailsOfferingContentDocument, + "\n query ServicesWithCapabilities {\n services(pagination: { limit: 500 }) {\n oauthClientId\n capabilities {\n slug\n }\n }\n }\n": types.ServicesWithCapabilitiesDocument, }; /** @@ -48,55 +40,38 @@ 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 CapabilityServiceByPlanIds(\n $skip: Int!\n $limit: Int!\n $stripePlanIds: [String]!\n ) {\n purchases(\n filters: {\n or: [\n { stripePlanChoices: { stripePlanChoice: { in: $stripePlanIds } } }\n {\n offering: {\n stripeLegacyPlans: { stripeLegacyPlan: { in: $stripePlanIds } }\n }\n }\n ]\n }\n pagination: { start: $skip, limit: $limit }\n ) {\n meta {\n pagination {\n total\n }\n }\n data {\n attributes {\n stripePlanChoices {\n stripePlanChoice\n }\n offering {\n data {\n attributes {\n stripeLegacyPlans(pagination: { limit: 200 }) {\n stripeLegacyPlan\n }\n capabilities {\n data {\n attributes {\n slug\n services {\n data {\n attributes {\n oauthClientId\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n' -): (typeof documents)['\n query CapabilityServiceByPlanIds(\n $skip: Int!\n $limit: Int!\n $stripePlanIds: [String]!\n ) {\n purchases(\n filters: {\n or: [\n { stripePlanChoices: { stripePlanChoice: { in: $stripePlanIds } } }\n {\n offering: {\n stripeLegacyPlans: { stripeLegacyPlan: { in: $stripePlanIds } }\n }\n }\n ]\n }\n pagination: { start: $skip, limit: $limit }\n ) {\n meta {\n pagination {\n total\n }\n }\n data {\n attributes {\n stripePlanChoices {\n stripePlanChoice\n }\n offering {\n data {\n attributes {\n stripeLegacyPlans(pagination: { limit: 200 }) {\n stripeLegacyPlan\n }\n capabilities {\n data {\n attributes {\n slug\n services {\n data {\n attributes {\n oauthClientId\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n']; +export function graphql(source: "\n query CapabilityServiceByPlanIds($stripePlanIds: [String]!) {\n purchases(\n filters: {\n or: [\n { stripePlanChoices: { stripePlanChoice: { in: $stripePlanIds } } }\n {\n offering: {\n stripeLegacyPlans: { stripeLegacyPlan: { in: $stripePlanIds } }\n }\n }\n ]\n }\n pagination: { limit: 200 }\n ) {\n stripePlanChoices {\n stripePlanChoice\n }\n offering {\n stripeLegacyPlans(pagination: { limit: 200 }) {\n stripeLegacyPlan\n }\n capabilities {\n slug\n services {\n oauthClientId\n }\n }\n }\n }\n }\n"): (typeof documents)["\n query CapabilityServiceByPlanIds($stripePlanIds: [String]!) {\n purchases(\n filters: {\n or: [\n { stripePlanChoices: { stripePlanChoice: { in: $stripePlanIds } } }\n {\n offering: {\n stripeLegacyPlans: { stripeLegacyPlan: { in: $stripePlanIds } }\n }\n }\n ]\n }\n pagination: { limit: 200 }\n ) {\n stripePlanChoices {\n stripePlanChoice\n }\n offering {\n stripeLegacyPlans(pagination: { limit: 200 }) {\n stripeLegacyPlan\n }\n capabilities {\n slug\n services {\n oauthClientId\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. */ -export function graphql( - source: '\n query EligibilityContentByOffering($apiIdentifier: String!) {\n offerings(\n pagination: { start: 0, limit: 2 }\n filters: { apiIdentifier: { eq: $apiIdentifier } }\n ) {\n data {\n attributes {\n apiIdentifier\n stripeProductId\n defaultPurchase {\n data {\n attributes {\n stripePlanChoices {\n stripePlanChoice\n }\n }\n }\n }\n subGroups {\n data {\n attributes {\n groupName\n offerings {\n data {\n attributes {\n apiIdentifier\n stripeProductId\n defaultPurchase {\n data {\n attributes {\n stripePlanChoices {\n stripePlanChoice\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n' -): (typeof documents)['\n query EligibilityContentByOffering($apiIdentifier: String!) {\n offerings(\n pagination: { start: 0, limit: 2 }\n filters: { apiIdentifier: { eq: $apiIdentifier } }\n ) {\n data {\n attributes {\n apiIdentifier\n stripeProductId\n defaultPurchase {\n data {\n attributes {\n stripePlanChoices {\n stripePlanChoice\n }\n }\n }\n }\n subGroups {\n data {\n attributes {\n groupName\n offerings {\n data {\n attributes {\n apiIdentifier\n stripeProductId\n defaultPurchase {\n data {\n attributes {\n stripePlanChoices {\n stripePlanChoice\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n']; +export function graphql(source: "\n query EligibilityContentByOffering($apiIdentifier: String!) {\n offerings(\n filters: { apiIdentifier: { eq: $apiIdentifier } }\n pagination: { limit: 200 }\n ) {\n apiIdentifier\n stripeProductId\n defaultPurchase {\n stripePlanChoices {\n stripePlanChoice\n }\n }\n subGroups {\n groupName\n offerings {\n apiIdentifier\n stripeProductId\n defaultPurchase {\n stripePlanChoices {\n stripePlanChoice\n }\n }\n }\n }\n }\n }\n"): (typeof documents)["\n query EligibilityContentByOffering($apiIdentifier: String!) {\n offerings(\n filters: { apiIdentifier: { eq: $apiIdentifier } }\n pagination: { limit: 200 }\n ) {\n apiIdentifier\n stripeProductId\n defaultPurchase {\n stripePlanChoices {\n stripePlanChoice\n }\n }\n subGroups {\n groupName\n offerings {\n apiIdentifier\n stripeProductId\n defaultPurchase {\n stripePlanChoices {\n stripePlanChoice\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. */ -export function graphql( - source: '\n query EligibilityContentByPlanIds(\n $skip: Int!\n $limit: Int!\n $stripePlanIds: [String]!\n ) {\n purchases(\n pagination: { start: $skip, limit: $limit }\n filters: {\n or: [\n { stripePlanChoices: { stripePlanChoice: { in: $stripePlanIds } } }\n {\n offering: {\n stripeLegacyPlans: { stripeLegacyPlan: { in: $stripePlanIds } }\n }\n }\n ]\n }\n ) {\n meta {\n pagination {\n total\n }\n }\n data {\n attributes {\n stripePlanChoices {\n stripePlanChoice\n }\n offering {\n data {\n attributes {\n stripeProductId\n stripeLegacyPlans(pagination: { limit: 200 }) {\n stripeLegacyPlan\n }\n countries\n subGroups {\n data {\n attributes {\n groupName\n offerings {\n data {\n attributes {\n stripeProductId\n stripeLegacyPlans(pagination: { limit: 200 }) {\n stripeLegacyPlan\n }\n countries\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n' -): (typeof documents)['\n query EligibilityContentByPlanIds(\n $skip: Int!\n $limit: Int!\n $stripePlanIds: [String]!\n ) {\n purchases(\n pagination: { start: $skip, limit: $limit }\n filters: {\n or: [\n { stripePlanChoices: { stripePlanChoice: { in: $stripePlanIds } } }\n {\n offering: {\n stripeLegacyPlans: { stripeLegacyPlan: { in: $stripePlanIds } }\n }\n }\n ]\n }\n ) {\n meta {\n pagination {\n total\n }\n }\n data {\n attributes {\n stripePlanChoices {\n stripePlanChoice\n }\n offering {\n data {\n attributes {\n stripeProductId\n stripeLegacyPlans(pagination: { limit: 200 }) {\n stripeLegacyPlan\n }\n countries\n subGroups {\n data {\n attributes {\n groupName\n offerings {\n data {\n attributes {\n stripeProductId\n stripeLegacyPlans(pagination: { limit: 200 }) {\n stripeLegacyPlan\n }\n countries\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n']; +export function graphql(source: "\n query EligibilityContentByPlanIds($stripePlanIds: [String]!) {\n purchases(\n filters: {\n or: [\n { stripePlanChoices: { stripePlanChoice: { in: $stripePlanIds } } }\n {\n offering: {\n stripeLegacyPlans: { stripeLegacyPlan: { in: $stripePlanIds } }\n }\n }\n ]\n }\n pagination: { limit: 200 }\n ) {\n stripePlanChoices {\n stripePlanChoice\n }\n offering {\n stripeProductId\n stripeLegacyPlans(pagination: { limit: 200 }) {\n stripeLegacyPlan\n }\n countries\n subGroups {\n groupName\n offerings {\n stripeProductId\n stripeLegacyPlans(pagination: { limit: 200 }) {\n stripeLegacyPlan\n }\n countries\n }\n }\n }\n }\n }\n"): (typeof documents)["\n query EligibilityContentByPlanIds($stripePlanIds: [String]!) {\n purchases(\n filters: {\n or: [\n { stripePlanChoices: { stripePlanChoice: { in: $stripePlanIds } } }\n {\n offering: {\n stripeLegacyPlans: { stripeLegacyPlan: { in: $stripePlanIds } }\n }\n }\n ]\n }\n pagination: { limit: 200 }\n ) {\n stripePlanChoices {\n stripePlanChoice\n }\n offering {\n stripeProductId\n stripeLegacyPlans(pagination: { limit: 200 }) {\n stripeLegacyPlan\n }\n countries\n subGroups {\n groupName\n offerings {\n stripeProductId\n stripeLegacyPlans(pagination: { limit: 200 }) {\n stripeLegacyPlan\n }\n countries\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. */ -export function graphql( - source: '\n query Locales {\n i18NLocales {\n data {\n attributes {\n code\n }\n }\n }\n }\n' -): (typeof documents)['\n query Locales {\n i18NLocales {\n data {\n attributes {\n code\n }\n }\n }\n }\n']; +export function graphql(source: "\n query Locales {\n i18NLocales {\n code\n }\n }\n"): (typeof documents)["\n query Locales {\n i18NLocales {\n code\n }\n }\n"]; /** * 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 Offering($id: ID!, $locale: String!) {\n offering(id: $id) {\n data {\n attributes {\n stripeProductId\n countries\n defaultPurchase {\n data {\n attributes {\n purchaseDetails {\n data {\n attributes {\n productName\n details\n subtitle\n webIcon\n localizations(filters: { locale: { eq: $locale } }) {\n data {\n attributes {\n productName\n details\n subtitle\n webIcon\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n' -): (typeof documents)['\n query Offering($id: ID!, $locale: String!) {\n offering(id: $id) {\n data {\n attributes {\n stripeProductId\n countries\n defaultPurchase {\n data {\n attributes {\n purchaseDetails {\n data {\n attributes {\n productName\n details\n subtitle\n webIcon\n localizations(filters: { locale: { eq: $locale } }) {\n data {\n attributes {\n productName\n details\n subtitle\n webIcon\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n']; +export function graphql(source: "\n query Offering($id: ID!, $locale: String!) {\n offering(documentId: $id) {\n stripeProductId\n countries\n defaultPurchase {\n purchaseDetails {\n productName\n details\n subtitle\n webIcon\n localizations(filters: { locale: { eq: $locale } }) {\n productName\n details\n subtitle\n webIcon\n }\n }\n }\n }\n }\n"): (typeof documents)["\n query Offering($id: ID!, $locale: String!) {\n offering(documentId: $id) {\n stripeProductId\n countries\n defaultPurchase {\n purchaseDetails {\n productName\n details\n subtitle\n webIcon\n localizations(filters: { locale: { eq: $locale } }) {\n productName\n details\n subtitle\n webIcon\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. */ -export function graphql( - source: '\n query PageContentForOffering($locale: String!, $apiIdentifier: String!) {\n offerings(\n pagination: { start: 0, limit: 2 }\n filters: { apiIdentifier: { eq: $apiIdentifier } }\n ) {\n meta {\n pagination {\n total\n }\n }\n data {\n attributes {\n apiIdentifier\n stripeProductId\n defaultPurchase {\n data {\n attributes {\n purchaseDetails {\n data {\n attributes {\n details\n productName\n subtitle\n webIcon\n localizations(filters: { locale: { eq: $locale } }) {\n data {\n attributes {\n details\n productName\n subtitle\n webIcon\n }\n }\n }\n }\n }\n }\n }\n }\n }\n commonContent {\n data {\n attributes {\n privacyNoticeUrl\n privacyNoticeDownloadUrl\n termsOfServiceUrl\n termsOfServiceDownloadUrl\n cancellationUrl\n emailIcon\n successActionButtonUrl\n successActionButtonLabel\n newsletterLabelTextCode\n newsletterSlug\n localizations(filters: { locale: { eq: $locale } }) {\n data {\n attributes {\n privacyNoticeUrl\n privacyNoticeDownloadUrl\n termsOfServiceUrl\n termsOfServiceDownloadUrl\n cancellationUrl\n emailIcon\n successActionButtonUrl\n successActionButtonLabel\n newsletterLabelTextCode\n newsletterSlug\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n' -): (typeof documents)['\n query PageContentForOffering($locale: String!, $apiIdentifier: String!) {\n offerings(\n pagination: { start: 0, limit: 2 }\n filters: { apiIdentifier: { eq: $apiIdentifier } }\n ) {\n meta {\n pagination {\n total\n }\n }\n data {\n attributes {\n apiIdentifier\n stripeProductId\n defaultPurchase {\n data {\n attributes {\n purchaseDetails {\n data {\n attributes {\n details\n productName\n subtitle\n webIcon\n localizations(filters: { locale: { eq: $locale } }) {\n data {\n attributes {\n details\n productName\n subtitle\n webIcon\n }\n }\n }\n }\n }\n }\n }\n }\n }\n commonContent {\n data {\n attributes {\n privacyNoticeUrl\n privacyNoticeDownloadUrl\n termsOfServiceUrl\n termsOfServiceDownloadUrl\n cancellationUrl\n emailIcon\n successActionButtonUrl\n successActionButtonLabel\n newsletterLabelTextCode\n newsletterSlug\n localizations(filters: { locale: { eq: $locale } }) {\n data {\n attributes {\n privacyNoticeUrl\n privacyNoticeDownloadUrl\n termsOfServiceUrl\n termsOfServiceDownloadUrl\n cancellationUrl\n emailIcon\n successActionButtonUrl\n successActionButtonLabel\n newsletterLabelTextCode\n newsletterSlug\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n']; +export function graphql(source: "\n query PageContentForOffering($locale: String!, $apiIdentifier: String!) {\n offerings(\n filters: { apiIdentifier: { eq: $apiIdentifier } }\n pagination: { limit: 200 }\n ) {\n apiIdentifier\n stripeProductId\n defaultPurchase {\n purchaseDetails {\n details\n productName\n subtitle\n webIcon\n localizations(filters: { locale: { eq: $locale } }) {\n details\n productName\n subtitle\n webIcon\n }\n }\n }\n commonContent {\n privacyNoticeUrl\n privacyNoticeDownloadUrl\n termsOfServiceUrl\n termsOfServiceDownloadUrl\n cancellationUrl\n emailIcon\n successActionButtonUrl\n successActionButtonLabel\n newsletterLabelTextCode\n newsletterSlug\n localizations(filters: { locale: { eq: $locale } }) {\n privacyNoticeUrl\n privacyNoticeDownloadUrl\n termsOfServiceUrl\n termsOfServiceDownloadUrl\n cancellationUrl\n emailIcon\n successActionButtonUrl\n successActionButtonLabel\n newsletterLabelTextCode\n newsletterSlug\n }\n }\n }\n }\n"): (typeof documents)["\n query PageContentForOffering($locale: String!, $apiIdentifier: String!) {\n offerings(\n filters: { apiIdentifier: { eq: $apiIdentifier } }\n pagination: { limit: 200 }\n ) {\n apiIdentifier\n stripeProductId\n defaultPurchase {\n purchaseDetails {\n details\n productName\n subtitle\n webIcon\n localizations(filters: { locale: { eq: $locale } }) {\n details\n productName\n subtitle\n webIcon\n }\n }\n }\n commonContent {\n privacyNoticeUrl\n privacyNoticeDownloadUrl\n termsOfServiceUrl\n termsOfServiceDownloadUrl\n cancellationUrl\n emailIcon\n successActionButtonUrl\n successActionButtonLabel\n newsletterLabelTextCode\n newsletterSlug\n localizations(filters: { locale: { eq: $locale } }) {\n privacyNoticeUrl\n privacyNoticeDownloadUrl\n termsOfServiceUrl\n termsOfServiceDownloadUrl\n cancellationUrl\n emailIcon\n successActionButtonUrl\n successActionButtonLabel\n newsletterLabelTextCode\n newsletterSlug\n }\n }\n }\n }\n"]; /** * 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 purchases(\n pagination: { start: $skip, limit: $limit }\n filters: {\n or: [\n { stripePlanChoices: { stripePlanChoice: { in: $stripePlanIds } } }\n {\n offering: {\n stripeLegacyPlans: { stripeLegacyPlan: { in: $stripePlanIds } }\n }\n }\n ]\n }\n ) {\n data {\n attributes {\n stripePlanChoices {\n stripePlanChoice\n }\n purchaseDetails {\n data {\n attributes {\n details\n productName\n subtitle\n webIcon\n localizations(filters: { locale: { eq: $locale } }) {\n data {\n attributes {\n details\n productName\n subtitle\n webIcon\n }\n }\n }\n }\n }\n }\n offering {\n data {\n attributes {\n stripeProductId\n stripeLegacyPlans(pagination: { limit: 200 }) {\n stripeLegacyPlan\n }\n commonContent {\n data {\n attributes {\n privacyNoticeUrl\n privacyNoticeDownloadUrl\n termsOfServiceUrl\n termsOfServiceDownloadUrl\n cancellationUrl\n emailIcon\n successActionButtonUrl\n successActionButtonLabel\n newsletterLabelTextCode\n newsletterSlug\n localizations(filters: { locale: { eq: $locale } }) {\n data {\n attributes {\n privacyNoticeUrl\n privacyNoticeDownloadUrl\n termsOfServiceUrl\n termsOfServiceDownloadUrl\n cancellationUrl\n emailIcon\n successActionButtonUrl\n successActionButtonLabel\n newsletterLabelTextCode\n newsletterSlug\n }\n }\n }\n }\n }\n }\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 purchases(\n pagination: { start: $skip, limit: $limit }\n filters: {\n or: [\n { stripePlanChoices: { stripePlanChoice: { in: $stripePlanIds } } }\n {\n offering: {\n stripeLegacyPlans: { stripeLegacyPlan: { in: $stripePlanIds } }\n }\n }\n ]\n }\n ) {\n data {\n attributes {\n stripePlanChoices {\n stripePlanChoice\n }\n purchaseDetails {\n data {\n attributes {\n details\n productName\n subtitle\n webIcon\n localizations(filters: { locale: { eq: $locale } }) {\n data {\n attributes {\n details\n productName\n subtitle\n webIcon\n }\n }\n }\n }\n }\n }\n offering {\n data {\n attributes {\n stripeProductId\n stripeLegacyPlans(pagination: { limit: 200 }) {\n stripeLegacyPlan\n }\n commonContent {\n data {\n attributes {\n privacyNoticeUrl\n privacyNoticeDownloadUrl\n termsOfServiceUrl\n termsOfServiceDownloadUrl\n cancellationUrl\n emailIcon\n successActionButtonUrl\n successActionButtonLabel\n newsletterLabelTextCode\n newsletterSlug\n localizations(filters: { locale: { eq: $locale } }) {\n data {\n attributes {\n privacyNoticeUrl\n privacyNoticeDownloadUrl\n termsOfServiceUrl\n termsOfServiceDownloadUrl\n cancellationUrl\n emailIcon\n successActionButtonUrl\n successActionButtonLabel\n newsletterLabelTextCode\n newsletterSlug\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n']; +export function graphql(source: "\n query PurchaseWithDetailsOfferingContent(\n $locale: String!\n $stripePlanIds: [String]!\n ) {\n purchases(\n filters: {\n or: [\n { stripePlanChoices: { stripePlanChoice: { in: $stripePlanIds } } }\n {\n offering: {\n stripeLegacyPlans: { stripeLegacyPlan: { in: $stripePlanIds } }\n }\n }\n ]\n }\n pagination: { limit: 500 }\n ) {\n stripePlanChoices {\n stripePlanChoice\n }\n purchaseDetails {\n details\n productName\n subtitle\n webIcon\n localizations(filters: { locale: { eq: $locale } }) {\n details\n productName\n subtitle\n webIcon\n }\n }\n offering {\n stripeProductId\n stripeLegacyPlans(pagination: { limit: 200 }) {\n stripeLegacyPlan\n }\n commonContent {\n privacyNoticeUrl\n privacyNoticeDownloadUrl\n termsOfServiceUrl\n termsOfServiceDownloadUrl\n cancellationUrl\n emailIcon\n successActionButtonUrl\n successActionButtonLabel\n newsletterLabelTextCode\n newsletterSlug\n localizations(filters: { locale: { eq: $locale } }) {\n privacyNoticeUrl\n privacyNoticeDownloadUrl\n termsOfServiceUrl\n termsOfServiceDownloadUrl\n cancellationUrl\n emailIcon\n successActionButtonUrl\n successActionButtonLabel\n newsletterLabelTextCode\n newsletterSlug\n }\n }\n }\n }\n }\n"): (typeof documents)["\n query PurchaseWithDetailsOfferingContent(\n $locale: String!\n $stripePlanIds: [String]!\n ) {\n purchases(\n filters: {\n or: [\n { stripePlanChoices: { stripePlanChoice: { in: $stripePlanIds } } }\n {\n offering: {\n stripeLegacyPlans: { stripeLegacyPlan: { in: $stripePlanIds } }\n }\n }\n ]\n }\n pagination: { limit: 500 }\n ) {\n stripePlanChoices {\n stripePlanChoice\n }\n purchaseDetails {\n details\n productName\n subtitle\n webIcon\n localizations(filters: { locale: { eq: $locale } }) {\n details\n productName\n subtitle\n webIcon\n }\n }\n offering {\n stripeProductId\n stripeLegacyPlans(pagination: { limit: 200 }) {\n stripeLegacyPlan\n }\n commonContent {\n privacyNoticeUrl\n privacyNoticeDownloadUrl\n termsOfServiceUrl\n termsOfServiceDownloadUrl\n cancellationUrl\n emailIcon\n successActionButtonUrl\n successActionButtonLabel\n newsletterLabelTextCode\n newsletterSlug\n localizations(filters: { locale: { eq: $locale } }) {\n privacyNoticeUrl\n privacyNoticeDownloadUrl\n termsOfServiceUrl\n termsOfServiceDownloadUrl\n cancellationUrl\n emailIcon\n successActionButtonUrl\n successActionButtonLabel\n newsletterLabelTextCode\n newsletterSlug\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. */ -export function graphql( - source: '\n query ServicesWithCapabilities($skip: Int!, $limit: Int!) {\n services(pagination: { start: $skip, limit: $limit }) {\n data {\n attributes {\n oauthClientId\n capabilities {\n data {\n attributes {\n slug\n }\n }\n }\n }\n }\n }\n }\n' -): (typeof documents)['\n query ServicesWithCapabilities($skip: Int!, $limit: Int!) {\n services(pagination: { start: $skip, limit: $limit }) {\n data {\n attributes {\n oauthClientId\n capabilities {\n data {\n attributes {\n slug\n }\n }\n }\n }\n }\n }\n }\n']; +export function graphql(source: "\n query ServicesWithCapabilities {\n services(pagination: { limit: 500 }) {\n oauthClientId\n capabilities {\n slug\n }\n }\n }\n"): (typeof documents)["\n query ServicesWithCapabilities {\n services(pagination: { limit: 500 }) {\n oauthClientId\n capabilities {\n slug\n }\n }\n }\n"]; export function graphql(source: string) { return (documents as any)[source] ?? {}; } -export type DocumentType> = - TDocumentNode extends DocumentNode ? TType : never; +export type DocumentType> = TDocumentNode extends DocumentNode< infer TType, any> ? TType : never; \ No newline at end of file diff --git a/libs/shared/cms/src/__generated__/graphql.ts b/libs/shared/cms/src/__generated__/graphql.ts index 66c3dc56cc..a4e3d2958b 100644 --- a/libs/shared/cms/src/__generated__/graphql.ts +++ b/libs/shared/cms/src/__generated__/graphql.ts @@ -2,39 +2,24 @@ import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'; export type Maybe = T | null; export type InputMaybe = Maybe; -export type Exact = { - [K in keyof T]: T[K]; -}; -export type MakeOptional = Omit & { - [SubKey in K]?: Maybe; -}; -export type MakeMaybe = Omit & { - [SubKey in K]: Maybe; -}; -export type MakeEmpty< - T extends { [key: string]: unknown }, - K extends keyof T -> = { [_ in K]?: never }; -export type Incremental = - | T - | { - [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never; - }; +export type Exact = { [K in keyof T]: T[K] }; +export type MakeOptional = Omit & { [SubKey in K]?: Maybe }; +export type MakeMaybe = Omit & { [SubKey in K]: Maybe }; +export type MakeEmpty = { [_ in K]?: never }; +export type Incremental = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never }; /** All built-in and custom scalars, mapped to their actual values */ export type Scalars = { - ID: { input: string; output: string }; - String: { input: string; output: string }; - Boolean: { input: boolean; output: boolean }; - Int: { input: number; output: number }; - Float: { input: number; output: number }; + ID: { input: string; output: string; } + String: { input: string; output: string; } + Boolean: { input: boolean; output: boolean; } + Int: { input: number; output: number; } + Float: { input: number; output: number; } /** A date-time string at UTC, such as 2007-12-03T10:15:30Z, compliant with the `date-time` format outlined in section 5.6 of the RFC 3339 profile of the ISO 8601 standard for representation of dates and times using the Gregorian calendar. */ - DateTime: { input: any; output: any }; + DateTime: { input: any; output: any; } /** A string used to identify an i18n locale */ - I18NLocaleCode: { input: any; output: any }; + I18NLocaleCode: { input: any; output: any; } /** The `JSON` scalar type represents JSON values as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf). */ - JSON: { input: any; output: any }; - /** The `Upload` scalar type represents a file upload. */ - Upload: { input: any; output: any }; + JSON: { input: any; output: any; } }; export type BooleanFilterInput = { @@ -66,51 +51,76 @@ export type Capability = { __typename?: 'Capability'; createdAt: Maybe; description: Maybe; + documentId: Scalars['ID']['output']; internalName: Scalars['String']['output']; - offerings: Maybe; + locale: Maybe; + localizations: Array>; + localizations_connection: Maybe; + offerings: Array>; + offerings_connection: Maybe; publishedAt: Maybe; - services: Maybe; + services: Array>; + services_connection: Maybe; slug: Scalars['String']['output']; updatedAt: Maybe; }; + +export type CapabilityLocalizationsArgs = { + filters: InputMaybe; + pagination?: InputMaybe; + sort?: InputMaybe>>; +}; + + +export type CapabilityLocalizations_ConnectionArgs = { + filters: InputMaybe; + pagination?: InputMaybe; + sort?: InputMaybe>>; +}; + + export type CapabilityOfferingsArgs = { filters: InputMaybe; pagination?: InputMaybe; - publicationState?: InputMaybe; sort?: InputMaybe>>; }; + +export type CapabilityOfferings_ConnectionArgs = { + filters: InputMaybe; + pagination?: InputMaybe; + sort?: InputMaybe>>; +}; + + export type CapabilityServicesArgs = { filters: InputMaybe; pagination?: InputMaybe; - publicationState?: InputMaybe; sort?: InputMaybe>>; }; -export type CapabilityEntity = { - __typename?: 'CapabilityEntity'; - attributes: Maybe; - id: Maybe; -}; -export type CapabilityEntityResponse = { - __typename?: 'CapabilityEntityResponse'; - data: Maybe; +export type CapabilityServices_ConnectionArgs = { + filters: InputMaybe; + pagination?: InputMaybe; + sort?: InputMaybe>>; }; export type CapabilityEntityResponseCollection = { __typename?: 'CapabilityEntityResponseCollection'; - data: Array; - meta: ResponseCollectionMeta; + nodes: Array; + pageInfo: Pagination; }; export type CapabilityFiltersInput = { and: InputMaybe>>; createdAt: InputMaybe; description: InputMaybe; - id: InputMaybe; + documentId: InputMaybe; internalName: InputMaybe; + locale: InputMaybe; + localizations: InputMaybe; not: InputMaybe; offerings: InputMaybe; or: InputMaybe>>; @@ -123,6 +133,7 @@ export type CapabilityFiltersInput = { export type CapabilityInput = { description: InputMaybe; internalName: InputMaybe; + locale: InputMaybe; offerings: InputMaybe>>; publishedAt: InputMaybe; services: InputMaybe>>; @@ -131,17 +142,19 @@ export type CapabilityInput = { export type CapabilityRelationResponseCollection = { __typename?: 'CapabilityRelationResponseCollection'; - data: Array; + nodes: Array; }; export type CommonContent = { __typename?: 'CommonContent'; cancellationUrl: Maybe; createdAt: Maybe; + documentId: Scalars['ID']['output']; emailIcon: Maybe; internalName: Scalars['String']['output']; locale: Maybe; - localizations: Maybe; + localizations: Array>; + localizations_connection: Maybe; newsletterLabelTextCode: Maybe; newsletterSlug: Maybe; privacyNoticeDownloadUrl: Scalars['String']['output']; @@ -154,36 +167,32 @@ export type CommonContent = { updatedAt: Maybe; }; + export type CommonContentLocalizationsArgs = { filters: InputMaybe; pagination?: InputMaybe; - publicationState?: InputMaybe; sort?: InputMaybe>>; }; -export type CommonContentEntity = { - __typename?: 'CommonContentEntity'; - attributes: Maybe; - id: Maybe; -}; -export type CommonContentEntityResponse = { - __typename?: 'CommonContentEntityResponse'; - data: Maybe; +export type CommonContentLocalizations_ConnectionArgs = { + filters: InputMaybe; + pagination?: InputMaybe; + sort?: InputMaybe>>; }; export type CommonContentEntityResponseCollection = { __typename?: 'CommonContentEntityResponseCollection'; - data: Array; - meta: ResponseCollectionMeta; + nodes: Array; + pageInfo: Pagination; }; export type CommonContentFiltersInput = { and: InputMaybe>>; cancellationUrl: InputMaybe; createdAt: InputMaybe; + documentId: InputMaybe; emailIcon: InputMaybe; - id: InputMaybe; internalName: InputMaybe; locale: InputMaybe; localizations: InputMaybe; @@ -218,7 +227,7 @@ export type CommonContentInput = { export type CommonContentRelationResponseCollection = { __typename?: 'CommonContentRelationResponseCollection'; - data: Array; + nodes: Array; }; export type ComponentIapAppleProductIDs = { @@ -264,13 +273,9 @@ export type ComponentStripeStripeLegacyPlans = { }; export type ComponentStripeStripeLegacyPlansFiltersInput = { - and: InputMaybe< - Array> - >; + and: InputMaybe>>; not: InputMaybe; - or: InputMaybe< - Array> - >; + or: InputMaybe>>; stripeLegacyPlan: InputMaybe; }; @@ -286,13 +291,9 @@ export type ComponentStripeStripePlanChoices = { }; export type ComponentStripeStripePlanChoicesFiltersInput = { - and: InputMaybe< - Array> - >; + and: InputMaybe>>; not: InputMaybe; - or: InputMaybe< - Array> - >; + or: InputMaybe>>; stripePlanChoice: InputMaybe; }; @@ -309,13 +310,9 @@ export type ComponentStripeStripePromoCodes = { export type ComponentStripeStripePromoCodesFiltersInput = { PromoCode: InputMaybe; - and: InputMaybe< - Array> - >; + and: InputMaybe>>; not: InputMaybe; - or: InputMaybe< - Array> - >; + or: InputMaybe>>; }; export type ComponentStripeStripePromoCodesInput = { @@ -323,154 +320,55 @@ export type ComponentStripeStripePromoCodesInput = { id: InputMaybe; }; -export type ContentReleasesRelease = { - __typename?: 'ContentReleasesRelease'; - actions: Maybe; - createdAt: Maybe; - name: Scalars['String']['output']; - releasedAt: Maybe; - scheduledAt: Maybe; - timezone: Maybe; - updatedAt: Maybe; -}; - -export type ContentReleasesReleaseActionsArgs = { - filters: InputMaybe; - pagination?: InputMaybe; - sort?: InputMaybe>>; -}; - -export type ContentReleasesReleaseAction = { - __typename?: 'ContentReleasesReleaseAction'; - contentType: Scalars['String']['output']; - createdAt: Maybe; - entry: Maybe; - locale: Maybe; - release: Maybe; - type: Enum_Contentreleasesreleaseaction_Type; - updatedAt: Maybe; -}; - -export type ContentReleasesReleaseActionEntity = { - __typename?: 'ContentReleasesReleaseActionEntity'; - attributes: Maybe; - id: Maybe; -}; - -export type ContentReleasesReleaseActionEntityResponse = { - __typename?: 'ContentReleasesReleaseActionEntityResponse'; - data: Maybe; -}; - -export type ContentReleasesReleaseActionEntityResponseCollection = { - __typename?: 'ContentReleasesReleaseActionEntityResponseCollection'; - data: Array; - meta: ResponseCollectionMeta; -}; - -export type ContentReleasesReleaseActionFiltersInput = { - and: InputMaybe>>; - contentType: InputMaybe; - createdAt: InputMaybe; - id: InputMaybe; - locale: InputMaybe; - not: InputMaybe; - or: InputMaybe>>; - release: InputMaybe; - type: InputMaybe; - updatedAt: InputMaybe; -}; - -export type ContentReleasesReleaseActionInput = { - contentType: InputMaybe; - locale: InputMaybe; - release: InputMaybe; - type: InputMaybe; -}; - -export type ContentReleasesReleaseActionRelationResponseCollection = { - __typename?: 'ContentReleasesReleaseActionRelationResponseCollection'; - data: Array; -}; - -export type ContentReleasesReleaseEntity = { - __typename?: 'ContentReleasesReleaseEntity'; - attributes: Maybe; - id: Maybe; -}; - -export type ContentReleasesReleaseEntityResponse = { - __typename?: 'ContentReleasesReleaseEntityResponse'; - data: Maybe; -}; - -export type ContentReleasesReleaseEntityResponseCollection = { - __typename?: 'ContentReleasesReleaseEntityResponseCollection'; - data: Array; - meta: ResponseCollectionMeta; -}; - -export type ContentReleasesReleaseFiltersInput = { - actions: InputMaybe; - and: InputMaybe>>; - createdAt: InputMaybe; - id: InputMaybe; - name: InputMaybe; - not: InputMaybe; - or: InputMaybe>>; - releasedAt: InputMaybe; - scheduledAt: InputMaybe; - timezone: InputMaybe; - updatedAt: InputMaybe; -}; - -export type ContentReleasesReleaseInput = { - actions: InputMaybe>>; - name: InputMaybe; - releasedAt: InputMaybe; - scheduledAt: InputMaybe; - timezone: InputMaybe; -}; - export type CouponConfig = { __typename?: 'CouponConfig'; countries: Maybe; createdAt: Maybe; + documentId: Scalars['ID']['output']; internalName: Scalars['String']['output']; + locale: Maybe; + localizations: Array>; + localizations_connection: Maybe; publishedAt: Maybe; stripePromotionCodes: Maybe>>; updatedAt: Maybe; }; + +export type CouponConfigLocalizationsArgs = { + filters: InputMaybe; + pagination?: InputMaybe; + sort?: InputMaybe>>; +}; + + +export type CouponConfigLocalizations_ConnectionArgs = { + filters: InputMaybe; + pagination?: InputMaybe; + sort?: InputMaybe>>; +}; + + export type CouponConfigStripePromotionCodesArgs = { filters: InputMaybe; pagination?: InputMaybe; sort?: InputMaybe>>; }; -export type CouponConfigEntity = { - __typename?: 'CouponConfigEntity'; - attributes: Maybe; - id: Maybe; -}; - -export type CouponConfigEntityResponse = { - __typename?: 'CouponConfigEntityResponse'; - data: Maybe; -}; - export type CouponConfigEntityResponseCollection = { __typename?: 'CouponConfigEntityResponseCollection'; - data: Array; - meta: ResponseCollectionMeta; + nodes: Array; + pageInfo: Pagination; }; export type CouponConfigFiltersInput = { and: InputMaybe>>; countries: InputMaybe; createdAt: InputMaybe; - id: InputMaybe; + documentId: InputMaybe; internalName: InputMaybe; + locale: InputMaybe; + localizations: InputMaybe; not: InputMaybe; or: InputMaybe>>; publishedAt: InputMaybe; @@ -481,10 +379,14 @@ export type CouponConfigFiltersInput = { export type CouponConfigInput = { countries: InputMaybe; internalName: InputMaybe; + locale: InputMaybe; publishedAt: InputMaybe; - stripePromotionCodes: InputMaybe< - Array> - >; + stripePromotionCodes: InputMaybe>>; +}; + +export type CouponConfigRelationResponseCollection = { + __typename?: 'CouponConfigRelationResponseCollection'; + nodes: Array; }; export type DateTimeFilterInput = { @@ -512,10 +414,10 @@ export type DateTimeFilterInput = { startsWith: InputMaybe; }; -export enum Enum_Contentreleasesreleaseaction_Type { - Publish = 'publish', - Unpublish = 'unpublish', -} +export type DeleteMutationResponse = { + __typename?: 'DeleteMutationResponse'; + documentId: Scalars['ID']['output']; +}; export type FileInfoInput = { alternativeText: InputMaybe; @@ -548,66 +450,60 @@ export type FloatFilterInput = { startsWith: InputMaybe; }; -export type GenericMorph = - | Capability - | CommonContent - | ComponentIapAppleProductIDs - | ComponentIapGoogleSkUs - | ComponentStripeStripeLegacyPlans - | ComponentStripeStripePlanChoices - | ComponentStripeStripePromoCodes - | ContentReleasesRelease - | ContentReleasesReleaseAction - | CouponConfig - | I18NLocale - | Iap - | Offering - | Purchase - | PurchaseDetail - | Service - | Subgroup - | UploadFile - | UploadFolder - | UsersPermissionsPermission - | UsersPermissionsRole - | UsersPermissionsUser; +export type GenericMorph = Capability | CommonContent | ComponentIapAppleProductIDs | ComponentIapGoogleSkUs | ComponentStripeStripeLegacyPlans | ComponentStripeStripePlanChoices | ComponentStripeStripePromoCodes | CouponConfig | I18NLocale | Iap | Offering | Purchase | PurchaseDetail | ReviewWorkflowsWorkflow | ReviewWorkflowsWorkflowStage | Service | Subgroup | UploadFile | UsersPermissionsPermission | UsersPermissionsRole | UsersPermissionsUser; export type I18NLocale = { __typename?: 'I18NLocale'; code: Maybe; createdAt: Maybe; + documentId: Scalars['ID']['output']; + locale: Maybe; + localizations: Array>; + localizations_connection: Maybe; name: Maybe; + publishedAt: Maybe; updatedAt: Maybe; }; -export type I18NLocaleEntity = { - __typename?: 'I18NLocaleEntity'; - attributes: Maybe; - id: Maybe; + +export type I18NLocaleLocalizationsArgs = { + filters: InputMaybe; + pagination?: InputMaybe; + sort?: InputMaybe>>; }; -export type I18NLocaleEntityResponse = { - __typename?: 'I18NLocaleEntityResponse'; - data: Maybe; + +export type I18NLocaleLocalizations_ConnectionArgs = { + filters: InputMaybe; + pagination?: InputMaybe; + sort?: InputMaybe>>; }; export type I18NLocaleEntityResponseCollection = { __typename?: 'I18NLocaleEntityResponseCollection'; - data: Array; - meta: ResponseCollectionMeta; + nodes: Array; + pageInfo: Pagination; }; export type I18NLocaleFiltersInput = { and: InputMaybe>>; code: InputMaybe; createdAt: InputMaybe; - id: InputMaybe; + documentId: InputMaybe; + locale: InputMaybe; + localizations: InputMaybe; name: InputMaybe; not: InputMaybe; or: InputMaybe>>; + publishedAt: InputMaybe; updatedAt: InputMaybe; }; +export type I18NLocaleRelationResponseCollection = { + __typename?: 'I18NLocaleRelationResponseCollection'; + nodes: Array; +}; + export type IdFilterInput = { and: InputMaybe>>; between: InputMaybe>>; @@ -637,48 +533,59 @@ export type Iap = { __typename?: 'Iap'; appleProductIDs: Maybe>>; createdAt: Maybe; + documentId: Scalars['ID']['output']; googleSKUs: Maybe>>; internalName: Maybe; + locale: Maybe; + localizations: Array>; + localizations_connection: Maybe; publishedAt: Maybe; updatedAt: Maybe; }; + export type IapAppleProductIDsArgs = { filters: InputMaybe; pagination?: InputMaybe; sort?: InputMaybe>>; }; + export type IapGoogleSkUsArgs = { filters: InputMaybe; pagination?: InputMaybe; sort?: InputMaybe>>; }; -export type IapEntity = { - __typename?: 'IapEntity'; - attributes: Maybe; - id: Maybe; + +export type IapLocalizationsArgs = { + filters: InputMaybe; + pagination?: InputMaybe; + sort?: InputMaybe>>; }; -export type IapEntityResponse = { - __typename?: 'IapEntityResponse'; - data: Maybe; + +export type IapLocalizations_ConnectionArgs = { + filters: InputMaybe; + pagination?: InputMaybe; + sort?: InputMaybe>>; }; export type IapEntityResponseCollection = { __typename?: 'IapEntityResponseCollection'; - data: Array; - meta: ResponseCollectionMeta; + nodes: Array; + pageInfo: Pagination; }; export type IapFiltersInput = { and: InputMaybe>>; appleProductIDs: InputMaybe; createdAt: InputMaybe; + documentId: InputMaybe; googleSKUs: InputMaybe; - id: InputMaybe; internalName: InputMaybe; + locale: InputMaybe; + localizations: InputMaybe; not: InputMaybe; or: InputMaybe>>; publishedAt: InputMaybe; @@ -686,14 +593,18 @@ export type IapFiltersInput = { }; export type IapInput = { - appleProductIDs: InputMaybe< - Array> - >; + appleProductIDs: InputMaybe>>; googleSKUs: InputMaybe>>; internalName: InputMaybe; + locale: InputMaybe; publishedAt: InputMaybe; }; +export type IapRelationResponseCollection = { + __typename?: 'IapRelationResponseCollection'; + nodes: Array; +}; + export type IntFilterInput = { and: InputMaybe>>; between: InputMaybe>>; @@ -748,38 +659,33 @@ export type Mutation = { __typename?: 'Mutation'; /** Change user password. Confirm with the current password. */ changePassword: Maybe; - createCapability: Maybe; - createCommonContent: Maybe; - createCommonContentLocalization: Maybe; - createContentReleasesRelease: Maybe; - createContentReleasesReleaseAction: Maybe; - createCouponConfig: Maybe; - createIap: Maybe; - createOffering: Maybe; - createPurchase: Maybe; - createPurchaseDetail: Maybe; - createPurchaseDetailLocalization: Maybe; - createService: Maybe; - createSubgroup: Maybe; - createUploadFile: Maybe; - createUploadFolder: Maybe; + createCapability: Maybe; + createCommonContent: Maybe; + createCouponConfig: Maybe; + createIap: Maybe; + createOffering: Maybe; + createPurchase: Maybe; + createPurchaseDetail: Maybe; + createReviewWorkflowsWorkflow: Maybe; + createReviewWorkflowsWorkflowStage: Maybe; + createService: Maybe; + createSubgroup: Maybe; /** Create a new role */ createUsersPermissionsRole: Maybe; /** Create a new user */ createUsersPermissionsUser: UsersPermissionsUserEntityResponse; - deleteCapability: Maybe; - deleteCommonContent: Maybe; - deleteContentReleasesRelease: Maybe; - deleteContentReleasesReleaseAction: Maybe; - deleteCouponConfig: Maybe; - deleteIap: Maybe; - deleteOffering: Maybe; - deletePurchase: Maybe; - deletePurchaseDetail: Maybe; - deleteService: Maybe; - deleteSubgroup: Maybe; - deleteUploadFile: Maybe; - deleteUploadFolder: Maybe; + deleteCapability: Maybe; + deleteCommonContent: Maybe; + deleteCouponConfig: Maybe; + deleteIap: Maybe; + deleteOffering: Maybe; + deletePurchase: Maybe; + deletePurchaseDetail: Maybe; + deleteReviewWorkflowsWorkflow: Maybe; + deleteReviewWorkflowsWorkflowStage: Maybe; + deleteService: Maybe; + deleteSubgroup: Maybe; + deleteUploadFile: Maybe; /** Delete an existing role */ deleteUsersPermissionsRole: Maybe; /** Delete an existing user */ @@ -789,201 +695,205 @@ export type Mutation = { /** Request a reset password token */ forgotPassword: Maybe; login: UsersPermissionsLoginPayload; - multipleUpload: Array>; /** Register a user */ register: UsersPermissionsLoginPayload; - removeFile: Maybe; /** Reset user password. Confirm with a code (resetToken from forgotPassword) */ resetPassword: Maybe; - updateCapability: Maybe; - updateCommonContent: Maybe; - updateContentReleasesRelease: Maybe; - updateContentReleasesReleaseAction: Maybe; - updateCouponConfig: Maybe; - updateFileInfo: UploadFileEntityResponse; - updateIap: Maybe; - updateOffering: Maybe; - updatePurchase: Maybe; - updatePurchaseDetail: Maybe; - updateService: Maybe; - updateSubgroup: Maybe; - updateUploadFile: Maybe; - updateUploadFolder: Maybe; + updateCapability: Maybe; + updateCommonContent: Maybe; + updateCouponConfig: Maybe; + updateIap: Maybe; + updateOffering: Maybe; + updatePurchase: Maybe; + updatePurchaseDetail: Maybe; + updateReviewWorkflowsWorkflow: Maybe; + updateReviewWorkflowsWorkflowStage: Maybe; + updateService: Maybe; + updateSubgroup: Maybe; + updateUploadFile: UploadFile; /** Update an existing role */ updateUsersPermissionsRole: Maybe; /** Update an existing user */ updateUsersPermissionsUser: UsersPermissionsUserEntityResponse; - upload: UploadFileEntityResponse; }; + export type MutationChangePasswordArgs = { currentPassword: Scalars['String']['input']; password: Scalars['String']['input']; passwordConfirmation: Scalars['String']['input']; }; + export type MutationCreateCapabilityArgs = { data: CapabilityInput; + status?: InputMaybe; }; + export type MutationCreateCommonContentArgs = { data: CommonContentInput; locale: InputMaybe; + status?: InputMaybe; }; -export type MutationCreateCommonContentLocalizationArgs = { - data: InputMaybe; - id: InputMaybe; - locale: InputMaybe; -}; - -export type MutationCreateContentReleasesReleaseArgs = { - data: ContentReleasesReleaseInput; -}; - -export type MutationCreateContentReleasesReleaseActionArgs = { - data: ContentReleasesReleaseActionInput; -}; export type MutationCreateCouponConfigArgs = { data: CouponConfigInput; + status?: InputMaybe; }; + export type MutationCreateIapArgs = { data: IapInput; + status?: InputMaybe; }; + export type MutationCreateOfferingArgs = { data: OfferingInput; + status?: InputMaybe; }; + export type MutationCreatePurchaseArgs = { data: PurchaseInput; + status?: InputMaybe; }; + export type MutationCreatePurchaseDetailArgs = { data: PurchaseDetailInput; locale: InputMaybe; + status?: InputMaybe; }; -export type MutationCreatePurchaseDetailLocalizationArgs = { - data: InputMaybe; - id: InputMaybe; - locale: InputMaybe; + +export type MutationCreateReviewWorkflowsWorkflowArgs = { + data: ReviewWorkflowsWorkflowInput; + status?: InputMaybe; }; + +export type MutationCreateReviewWorkflowsWorkflowStageArgs = { + data: ReviewWorkflowsWorkflowStageInput; + status?: InputMaybe; +}; + + export type MutationCreateServiceArgs = { data: ServiceInput; + status?: InputMaybe; }; + export type MutationCreateSubgroupArgs = { data: SubgroupInput; + status?: InputMaybe; }; -export type MutationCreateUploadFileArgs = { - data: UploadFileInput; -}; - -export type MutationCreateUploadFolderArgs = { - data: UploadFolderInput; -}; export type MutationCreateUsersPermissionsRoleArgs = { data: UsersPermissionsRoleInput; }; + export type MutationCreateUsersPermissionsUserArgs = { data: UsersPermissionsUserInput; }; + export type MutationDeleteCapabilityArgs = { - id: Scalars['ID']['input']; + documentId: Scalars['ID']['input']; }; + export type MutationDeleteCommonContentArgs = { - id: Scalars['ID']['input']; + documentId: Scalars['ID']['input']; locale: InputMaybe; }; -export type MutationDeleteContentReleasesReleaseArgs = { - id: Scalars['ID']['input']; -}; - -export type MutationDeleteContentReleasesReleaseActionArgs = { - id: Scalars['ID']['input']; -}; export type MutationDeleteCouponConfigArgs = { - id: Scalars['ID']['input']; + documentId: Scalars['ID']['input']; }; + export type MutationDeleteIapArgs = { - id: Scalars['ID']['input']; + documentId: Scalars['ID']['input']; }; + export type MutationDeleteOfferingArgs = { - id: Scalars['ID']['input']; + documentId: Scalars['ID']['input']; }; + export type MutationDeletePurchaseArgs = { - id: Scalars['ID']['input']; + documentId: Scalars['ID']['input']; }; + export type MutationDeletePurchaseDetailArgs = { - id: Scalars['ID']['input']; + documentId: Scalars['ID']['input']; locale: InputMaybe; }; -export type MutationDeleteServiceArgs = { - id: Scalars['ID']['input']; + +export type MutationDeleteReviewWorkflowsWorkflowArgs = { + documentId: Scalars['ID']['input']; }; -export type MutationDeleteSubgroupArgs = { - id: Scalars['ID']['input']; + +export type MutationDeleteReviewWorkflowsWorkflowStageArgs = { + documentId: Scalars['ID']['input']; }; + +export type MutationDeleteServiceArgs = { + documentId: Scalars['ID']['input']; +}; + + +export type MutationDeleteSubgroupArgs = { + documentId: Scalars['ID']['input']; +}; + + export type MutationDeleteUploadFileArgs = { id: Scalars['ID']['input']; }; -export type MutationDeleteUploadFolderArgs = { - id: Scalars['ID']['input']; -}; export type MutationDeleteUsersPermissionsRoleArgs = { id: Scalars['ID']['input']; }; + export type MutationDeleteUsersPermissionsUserArgs = { id: Scalars['ID']['input']; }; + export type MutationEmailConfirmationArgs = { confirmation: Scalars['String']['input']; }; + export type MutationForgotPasswordArgs = { email: Scalars['String']['input']; }; + export type MutationLoginArgs = { input: UsersPermissionsLoginInput; }; -export type MutationMultipleUploadArgs = { - field: InputMaybe; - files: Array>; - ref: InputMaybe; - refId: InputMaybe; -}; export type MutationRegisterArgs = { input: UsersPermissionsRegisterInput; }; -export type MutationRemoveFileArgs = { - id: Scalars['ID']['input']; -}; export type MutationResetPasswordArgs = { code: Scalars['String']['input']; @@ -991,151 +901,182 @@ export type MutationResetPasswordArgs = { passwordConfirmation: Scalars['String']['input']; }; + export type MutationUpdateCapabilityArgs = { data: CapabilityInput; - id: Scalars['ID']['input']; + documentId: Scalars['ID']['input']; + status?: InputMaybe; }; + export type MutationUpdateCommonContentArgs = { data: CommonContentInput; - id: Scalars['ID']['input']; + documentId: Scalars['ID']['input']; locale: InputMaybe; + status?: InputMaybe; }; -export type MutationUpdateContentReleasesReleaseArgs = { - data: ContentReleasesReleaseInput; - id: Scalars['ID']['input']; -}; - -export type MutationUpdateContentReleasesReleaseActionArgs = { - data: ContentReleasesReleaseActionInput; - id: Scalars['ID']['input']; -}; export type MutationUpdateCouponConfigArgs = { data: CouponConfigInput; - id: Scalars['ID']['input']; + documentId: Scalars['ID']['input']; + status?: InputMaybe; }; -export type MutationUpdateFileInfoArgs = { + +export type MutationUpdateIapArgs = { + data: IapInput; + documentId: Scalars['ID']['input']; + status?: InputMaybe; +}; + + +export type MutationUpdateOfferingArgs = { + data: OfferingInput; + documentId: Scalars['ID']['input']; + status?: InputMaybe; +}; + + +export type MutationUpdatePurchaseArgs = { + data: PurchaseInput; + documentId: Scalars['ID']['input']; + status?: InputMaybe; +}; + + +export type MutationUpdatePurchaseDetailArgs = { + data: PurchaseDetailInput; + documentId: Scalars['ID']['input']; + locale: InputMaybe; + status?: InputMaybe; +}; + + +export type MutationUpdateReviewWorkflowsWorkflowArgs = { + data: ReviewWorkflowsWorkflowInput; + documentId: Scalars['ID']['input']; + status?: InputMaybe; +}; + + +export type MutationUpdateReviewWorkflowsWorkflowStageArgs = { + data: ReviewWorkflowsWorkflowStageInput; + documentId: Scalars['ID']['input']; + status?: InputMaybe; +}; + + +export type MutationUpdateServiceArgs = { + data: ServiceInput; + documentId: Scalars['ID']['input']; + status?: InputMaybe; +}; + + +export type MutationUpdateSubgroupArgs = { + data: SubgroupInput; + documentId: Scalars['ID']['input']; + status?: InputMaybe; +}; + + +export type MutationUpdateUploadFileArgs = { id: Scalars['ID']['input']; info: InputMaybe; }; -export type MutationUpdateIapArgs = { - data: IapInput; - id: Scalars['ID']['input']; -}; - -export type MutationUpdateOfferingArgs = { - data: OfferingInput; - id: Scalars['ID']['input']; -}; - -export type MutationUpdatePurchaseArgs = { - data: PurchaseInput; - id: Scalars['ID']['input']; -}; - -export type MutationUpdatePurchaseDetailArgs = { - data: PurchaseDetailInput; - id: Scalars['ID']['input']; - locale: InputMaybe; -}; - -export type MutationUpdateServiceArgs = { - data: ServiceInput; - id: Scalars['ID']['input']; -}; - -export type MutationUpdateSubgroupArgs = { - data: SubgroupInput; - id: Scalars['ID']['input']; -}; - -export type MutationUpdateUploadFileArgs = { - data: UploadFileInput; - id: Scalars['ID']['input']; -}; - -export type MutationUpdateUploadFolderArgs = { - data: UploadFolderInput; - id: Scalars['ID']['input']; -}; export type MutationUpdateUsersPermissionsRoleArgs = { data: UsersPermissionsRoleInput; id: Scalars['ID']['input']; }; + export type MutationUpdateUsersPermissionsUserArgs = { data: UsersPermissionsUserInput; id: Scalars['ID']['input']; }; -export type MutationUploadArgs = { - field: InputMaybe; - file: Scalars['Upload']['input']; - info: InputMaybe; - ref: InputMaybe; - refId: InputMaybe; -}; - export type Offering = { __typename?: 'Offering'; apiIdentifier: Scalars['String']['output']; - capabilities: Maybe; - commonContent: Maybe; + capabilities: Array>; + capabilities_connection: Maybe; + commonContent: Maybe; countries: Maybe; - couponConfig: Maybe; + couponConfig: Maybe; createdAt: Maybe; - defaultPurchase: Maybe; + defaultPurchase: Maybe; description: Maybe; - experimentPurchase: Maybe; - iap: Maybe; + documentId: Scalars['ID']['output']; + experimentPurchase: Maybe; + iap: Maybe; internalName: Scalars['String']['output']; + locale: Maybe; + localizations: Array>; + localizations_connection: Maybe; publishedAt: Maybe; stripeLegacyPlans: Maybe>>; stripeProductId: Scalars['String']['output']; - subGroups: Maybe; + subGroups: Array>; + subGroups_connection: Maybe; updatedAt: Maybe; }; + export type OfferingCapabilitiesArgs = { filters: InputMaybe; pagination?: InputMaybe; - publicationState?: InputMaybe; sort?: InputMaybe>>; }; + +export type OfferingCapabilities_ConnectionArgs = { + filters: InputMaybe; + pagination?: InputMaybe; + sort?: InputMaybe>>; +}; + + +export type OfferingLocalizationsArgs = { + filters: InputMaybe; + pagination?: InputMaybe; + sort?: InputMaybe>>; +}; + + +export type OfferingLocalizations_ConnectionArgs = { + filters: InputMaybe; + pagination?: InputMaybe; + sort?: InputMaybe>>; +}; + + export type OfferingStripeLegacyPlansArgs = { filters: InputMaybe; pagination?: InputMaybe; sort?: InputMaybe>>; }; + export type OfferingSubGroupsArgs = { filters: InputMaybe; pagination?: InputMaybe; - publicationState?: InputMaybe; sort?: InputMaybe>>; }; -export type OfferingEntity = { - __typename?: 'OfferingEntity'; - attributes: Maybe; - id: Maybe; -}; -export type OfferingEntityResponse = { - __typename?: 'OfferingEntityResponse'; - data: Maybe; +export type OfferingSubGroups_ConnectionArgs = { + filters: InputMaybe; + pagination?: InputMaybe; + sort?: InputMaybe>>; }; export type OfferingEntityResponseCollection = { __typename?: 'OfferingEntityResponseCollection'; - data: Array; - meta: ResponseCollectionMeta; + nodes: Array; + pageInfo: Pagination; }; export type OfferingFiltersInput = { @@ -1148,10 +1089,12 @@ export type OfferingFiltersInput = { createdAt: InputMaybe; defaultPurchase: InputMaybe; description: InputMaybe; + documentId: InputMaybe; experimentPurchase: InputMaybe; iap: InputMaybe; - id: InputMaybe; internalName: InputMaybe; + locale: InputMaybe; + localizations: InputMaybe; not: InputMaybe; or: InputMaybe>>; publishedAt: InputMaybe; @@ -1172,17 +1115,16 @@ export type OfferingInput = { experimentPurchase: InputMaybe; iap: InputMaybe; internalName: InputMaybe; + locale: InputMaybe; publishedAt: InputMaybe; - stripeLegacyPlans: InputMaybe< - Array> - >; + stripeLegacyPlans: InputMaybe>>; stripeProductId: InputMaybe; subGroups: InputMaybe>>; }; export type OfferingRelationResponseCollection = { __typename?: 'OfferingRelationResponseCollection'; - data: Array; + nodes: Array; }; export type Pagination = { @@ -1200,23 +1142,42 @@ export type PaginationArg = { start: InputMaybe; }; -export enum PublicationState { - Live = 'LIVE', - Preview = 'PREVIEW', +export enum PublicationStatus { + Draft = 'DRAFT', + Published = 'PUBLISHED' } export type Purchase = { __typename?: 'Purchase'; createdAt: Maybe; description: Maybe; + documentId: Scalars['ID']['output']; internalName: Scalars['String']['output']; - offering: Maybe; + locale: Maybe; + localizations: Array>; + localizations_connection: Maybe; + offering: Maybe; publishedAt: Maybe; - purchaseDetails: Maybe; + purchaseDetails: Maybe; stripePlanChoices: Maybe>>; updatedAt: Maybe; }; + +export type PurchaseLocalizationsArgs = { + filters: InputMaybe; + pagination?: InputMaybe; + sort?: InputMaybe>>; +}; + + +export type PurchaseLocalizations_ConnectionArgs = { + filters: InputMaybe; + pagination?: InputMaybe; + sort?: InputMaybe>>; +}; + + export type PurchaseStripePlanChoicesArgs = { filters: InputMaybe; pagination?: InputMaybe; @@ -1227,9 +1188,11 @@ export type PurchaseDetail = { __typename?: 'PurchaseDetail'; createdAt: Maybe; details: Scalars['String']['output']; + documentId: Scalars['ID']['output']; internalName: Scalars['String']['output']; locale: Maybe; - localizations: Maybe; + localizations: Array>; + localizations_connection: Maybe; productName: Scalars['String']['output']; publishedAt: Maybe; subtitle: Maybe; @@ -1237,35 +1200,31 @@ export type PurchaseDetail = { webIcon: Scalars['String']['output']; }; + export type PurchaseDetailLocalizationsArgs = { filters: InputMaybe; pagination?: InputMaybe; - publicationState?: InputMaybe; sort?: InputMaybe>>; }; -export type PurchaseDetailEntity = { - __typename?: 'PurchaseDetailEntity'; - attributes: Maybe; - id: Maybe; -}; -export type PurchaseDetailEntityResponse = { - __typename?: 'PurchaseDetailEntityResponse'; - data: Maybe; +export type PurchaseDetailLocalizations_ConnectionArgs = { + filters: InputMaybe; + pagination?: InputMaybe; + sort?: InputMaybe>>; }; export type PurchaseDetailEntityResponseCollection = { __typename?: 'PurchaseDetailEntityResponseCollection'; - data: Array; - meta: ResponseCollectionMeta; + nodes: Array; + pageInfo: Pagination; }; export type PurchaseDetailFiltersInput = { and: InputMaybe>>; createdAt: InputMaybe; details: InputMaybe; - id: InputMaybe; + documentId: InputMaybe; internalName: InputMaybe; locale: InputMaybe; localizations: InputMaybe; @@ -1289,32 +1248,23 @@ export type PurchaseDetailInput = { export type PurchaseDetailRelationResponseCollection = { __typename?: 'PurchaseDetailRelationResponseCollection'; - data: Array; -}; - -export type PurchaseEntity = { - __typename?: 'PurchaseEntity'; - attributes: Maybe; - id: Maybe; -}; - -export type PurchaseEntityResponse = { - __typename?: 'PurchaseEntityResponse'; - data: Maybe; + nodes: Array; }; export type PurchaseEntityResponseCollection = { __typename?: 'PurchaseEntityResponseCollection'; - data: Array; - meta: ResponseCollectionMeta; + nodes: Array; + pageInfo: Pagination; }; export type PurchaseFiltersInput = { and: InputMaybe>>; createdAt: InputMaybe; description: InputMaybe; - id: InputMaybe; + documentId: InputMaybe; internalName: InputMaybe; + locale: InputMaybe; + localizations: InputMaybe; not: InputMaybe; offering: InputMaybe; or: InputMaybe>>; @@ -1327,262 +1277,591 @@ export type PurchaseFiltersInput = { export type PurchaseInput = { description: InputMaybe; internalName: InputMaybe; + locale: InputMaybe; offering: InputMaybe; publishedAt: InputMaybe; purchaseDetails: InputMaybe; - stripePlanChoices: InputMaybe< - Array> - >; + stripePlanChoices: InputMaybe>>; +}; + +export type PurchaseRelationResponseCollection = { + __typename?: 'PurchaseRelationResponseCollection'; + nodes: Array; }; export type Query = { __typename?: 'Query'; - capabilities: Maybe; - capability: Maybe; - commonContent: Maybe; - commonContents: Maybe; - contentReleasesRelease: Maybe; - contentReleasesReleaseAction: Maybe; - contentReleasesReleaseActions: Maybe; - contentReleasesReleases: Maybe; - couponConfig: Maybe; - couponConfigs: Maybe; - i18NLocale: Maybe; - i18NLocales: Maybe; - iap: Maybe; - iaps: Maybe; + capabilities: Array>; + capabilities_connection: Maybe; + capability: Maybe; + commonContent: Maybe; + commonContents: Array>; + commonContents_connection: Maybe; + couponConfig: Maybe; + couponConfigs: Array>; + couponConfigs_connection: Maybe; + i18NLocale: Maybe; + i18NLocales: Array>; + i18NLocales_connection: Maybe; + iap: Maybe; + iaps: Array>; + iaps_connection: Maybe; me: Maybe; - offering: Maybe; - offerings: Maybe; - purchase: Maybe; - purchaseDetail: Maybe; - purchaseDetails: Maybe; - purchases: Maybe; - service: Maybe; - services: Maybe; - subgroup: Maybe; - subgroups: Maybe; - uploadFile: Maybe; - uploadFiles: Maybe; - uploadFolder: Maybe; - uploadFolders: Maybe; - usersPermissionsRole: Maybe; - usersPermissionsRoles: Maybe; - usersPermissionsUser: Maybe; - usersPermissionsUsers: Maybe; + offering: Maybe; + offerings: Array>; + offerings_connection: Maybe; + purchase: Maybe; + purchaseDetail: Maybe; + purchaseDetails: Array>; + purchaseDetails_connection: Maybe; + purchases: Array>; + purchases_connection: Maybe; + reviewWorkflowsWorkflow: Maybe; + reviewWorkflowsWorkflowStage: Maybe; + reviewWorkflowsWorkflowStages: Array>; + reviewWorkflowsWorkflowStages_connection: Maybe; + reviewWorkflowsWorkflows: Array>; + reviewWorkflowsWorkflows_connection: Maybe; + service: Maybe; + services: Array>; + services_connection: Maybe; + subgroup: Maybe; + subgroups: Array>; + subgroups_connection: Maybe; + uploadFile: Maybe; + uploadFiles: Array>; + uploadFiles_connection: Maybe; + usersPermissionsRole: Maybe; + usersPermissionsRoles: Array>; + usersPermissionsRoles_connection: Maybe; + usersPermissionsUser: Maybe; + usersPermissionsUsers: Array>; + usersPermissionsUsers_connection: Maybe; }; + export type QueryCapabilitiesArgs = { filters: InputMaybe; pagination?: InputMaybe; - publicationState?: InputMaybe; sort?: InputMaybe>>; + status?: InputMaybe; }; + +export type QueryCapabilities_ConnectionArgs = { + filters: InputMaybe; + pagination?: InputMaybe; + sort?: InputMaybe>>; + status?: InputMaybe; +}; + + export type QueryCapabilityArgs = { - id: InputMaybe; + documentId: Scalars['ID']['input']; + status?: InputMaybe; }; + export type QueryCommonContentArgs = { - id: InputMaybe; + documentId: Scalars['ID']['input']; locale: InputMaybe; + status?: InputMaybe; }; + export type QueryCommonContentsArgs = { filters: InputMaybe; locale: InputMaybe; pagination?: InputMaybe; - publicationState?: InputMaybe; sort?: InputMaybe>>; + status?: InputMaybe; }; -export type QueryContentReleasesReleaseArgs = { - id: InputMaybe; -}; -export type QueryContentReleasesReleaseActionArgs = { - id: InputMaybe; -}; - -export type QueryContentReleasesReleaseActionsArgs = { - filters: InputMaybe; +export type QueryCommonContents_ConnectionArgs = { + filters: InputMaybe; + locale: InputMaybe; pagination?: InputMaybe; sort?: InputMaybe>>; + status?: InputMaybe; }; -export type QueryContentReleasesReleasesArgs = { - filters: InputMaybe; - pagination?: InputMaybe; - sort?: InputMaybe>>; -}; export type QueryCouponConfigArgs = { - id: InputMaybe; + documentId: Scalars['ID']['input']; + status?: InputMaybe; }; + export type QueryCouponConfigsArgs = { filters: InputMaybe; pagination?: InputMaybe; - publicationState?: InputMaybe; sort?: InputMaybe>>; + status?: InputMaybe; }; -export type QueryI18NLocaleArgs = { - id: InputMaybe; + +export type QueryCouponConfigs_ConnectionArgs = { + filters: InputMaybe; + pagination?: InputMaybe; + sort?: InputMaybe>>; + status?: InputMaybe; }; + +export type QueryI18NLocaleArgs = { + documentId: Scalars['ID']['input']; + status?: InputMaybe; +}; + + export type QueryI18NLocalesArgs = { filters: InputMaybe; pagination?: InputMaybe; sort?: InputMaybe>>; + status?: InputMaybe; }; -export type QueryIapArgs = { - id: InputMaybe; + +export type QueryI18NLocales_ConnectionArgs = { + filters: InputMaybe; + pagination?: InputMaybe; + sort?: InputMaybe>>; + status?: InputMaybe; }; + +export type QueryIapArgs = { + documentId: Scalars['ID']['input']; + status?: InputMaybe; +}; + + export type QueryIapsArgs = { filters: InputMaybe; pagination?: InputMaybe; - publicationState?: InputMaybe; sort?: InputMaybe>>; + status?: InputMaybe; }; -export type QueryOfferingArgs = { - id: InputMaybe; + +export type QueryIaps_ConnectionArgs = { + filters: InputMaybe; + pagination?: InputMaybe; + sort?: InputMaybe>>; + status?: InputMaybe; }; + +export type QueryOfferingArgs = { + documentId: Scalars['ID']['input']; + status?: InputMaybe; +}; + + export type QueryOfferingsArgs = { filters: InputMaybe; pagination?: InputMaybe; - publicationState?: InputMaybe; sort?: InputMaybe>>; + status?: InputMaybe; }; + +export type QueryOfferings_ConnectionArgs = { + filters: InputMaybe; + pagination?: InputMaybe; + sort?: InputMaybe>>; + status?: InputMaybe; +}; + + export type QueryPurchaseArgs = { - id: InputMaybe; + documentId: Scalars['ID']['input']; + status?: InputMaybe; }; + export type QueryPurchaseDetailArgs = { - id: InputMaybe; + documentId: Scalars['ID']['input']; locale: InputMaybe; + status?: InputMaybe; }; + export type QueryPurchaseDetailsArgs = { filters: InputMaybe; locale: InputMaybe; pagination?: InputMaybe; - publicationState?: InputMaybe; sort?: InputMaybe>>; + status?: InputMaybe; }; + +export type QueryPurchaseDetails_ConnectionArgs = { + filters: InputMaybe; + locale: InputMaybe; + pagination?: InputMaybe; + sort?: InputMaybe>>; + status?: InputMaybe; +}; + + export type QueryPurchasesArgs = { filters: InputMaybe; pagination?: InputMaybe; - publicationState?: InputMaybe; sort?: InputMaybe>>; + status?: InputMaybe; }; -export type QueryServiceArgs = { - id: InputMaybe; + +export type QueryPurchases_ConnectionArgs = { + filters: InputMaybe; + pagination?: InputMaybe; + sort?: InputMaybe>>; + status?: InputMaybe; }; + +export type QueryReviewWorkflowsWorkflowArgs = { + documentId: Scalars['ID']['input']; + status?: InputMaybe; +}; + + +export type QueryReviewWorkflowsWorkflowStageArgs = { + documentId: Scalars['ID']['input']; + status?: InputMaybe; +}; + + +export type QueryReviewWorkflowsWorkflowStagesArgs = { + filters: InputMaybe; + pagination?: InputMaybe; + sort?: InputMaybe>>; + status?: InputMaybe; +}; + + +export type QueryReviewWorkflowsWorkflowStages_ConnectionArgs = { + filters: InputMaybe; + pagination?: InputMaybe; + sort?: InputMaybe>>; + status?: InputMaybe; +}; + + +export type QueryReviewWorkflowsWorkflowsArgs = { + filters: InputMaybe; + pagination?: InputMaybe; + sort?: InputMaybe>>; + status?: InputMaybe; +}; + + +export type QueryReviewWorkflowsWorkflows_ConnectionArgs = { + filters: InputMaybe; + pagination?: InputMaybe; + sort?: InputMaybe>>; + status?: InputMaybe; +}; + + +export type QueryServiceArgs = { + documentId: Scalars['ID']['input']; + status?: InputMaybe; +}; + + export type QueryServicesArgs = { filters: InputMaybe; pagination?: InputMaybe; - publicationState?: InputMaybe; sort?: InputMaybe>>; + status?: InputMaybe; }; -export type QuerySubgroupArgs = { - id: InputMaybe; + +export type QueryServices_ConnectionArgs = { + filters: InputMaybe; + pagination?: InputMaybe; + sort?: InputMaybe>>; + status?: InputMaybe; }; + +export type QuerySubgroupArgs = { + documentId: Scalars['ID']['input']; + status?: InputMaybe; +}; + + export type QuerySubgroupsArgs = { filters: InputMaybe; pagination?: InputMaybe; - publicationState?: InputMaybe; sort?: InputMaybe>>; + status?: InputMaybe; }; -export type QueryUploadFileArgs = { - id: InputMaybe; + +export type QuerySubgroups_ConnectionArgs = { + filters: InputMaybe; + pagination?: InputMaybe; + sort?: InputMaybe>>; + status?: InputMaybe; }; + +export type QueryUploadFileArgs = { + documentId: Scalars['ID']['input']; + status?: InputMaybe; +}; + + export type QueryUploadFilesArgs = { filters: InputMaybe; pagination?: InputMaybe; sort?: InputMaybe>>; + status?: InputMaybe; }; -export type QueryUploadFolderArgs = { - id: InputMaybe; -}; -export type QueryUploadFoldersArgs = { - filters: InputMaybe; +export type QueryUploadFiles_ConnectionArgs = { + filters: InputMaybe; pagination?: InputMaybe; sort?: InputMaybe>>; + status?: InputMaybe; }; + export type QueryUsersPermissionsRoleArgs = { - id: InputMaybe; + documentId: Scalars['ID']['input']; + status?: InputMaybe; }; + export type QueryUsersPermissionsRolesArgs = { filters: InputMaybe; pagination?: InputMaybe; sort?: InputMaybe>>; + status?: InputMaybe; }; -export type QueryUsersPermissionsUserArgs = { - id: InputMaybe; + +export type QueryUsersPermissionsRoles_ConnectionArgs = { + filters: InputMaybe; + pagination?: InputMaybe; + sort?: InputMaybe>>; + status?: InputMaybe; }; + +export type QueryUsersPermissionsUserArgs = { + documentId: Scalars['ID']['input']; + status?: InputMaybe; +}; + + export type QueryUsersPermissionsUsersArgs = { filters: InputMaybe; pagination?: InputMaybe; sort?: InputMaybe>>; + status?: InputMaybe; }; -export type ResponseCollectionMeta = { - __typename?: 'ResponseCollectionMeta'; - pagination: Pagination; + +export type QueryUsersPermissionsUsers_ConnectionArgs = { + filters: InputMaybe; + pagination?: InputMaybe; + sort?: InputMaybe>>; + status?: InputMaybe; +}; + +export type ReviewWorkflowsWorkflow = { + __typename?: 'ReviewWorkflowsWorkflow'; + contentTypes: Scalars['JSON']['output']; + createdAt: Maybe; + documentId: Scalars['ID']['output']; + locale: Maybe; + localizations: Array>; + localizations_connection: Maybe; + name: Scalars['String']['output']; + publishedAt: Maybe; + stages: Array>; + stages_connection: Maybe; + updatedAt: Maybe; +}; + + +export type ReviewWorkflowsWorkflowLocalizationsArgs = { + filters: InputMaybe; + pagination?: InputMaybe; + sort?: InputMaybe>>; +}; + + +export type ReviewWorkflowsWorkflowLocalizations_ConnectionArgs = { + filters: InputMaybe; + pagination?: InputMaybe; + sort?: InputMaybe>>; +}; + + +export type ReviewWorkflowsWorkflowStagesArgs = { + filters: InputMaybe; + pagination?: InputMaybe; + sort?: InputMaybe>>; +}; + + +export type ReviewWorkflowsWorkflowStages_ConnectionArgs = { + filters: InputMaybe; + pagination?: InputMaybe; + sort?: InputMaybe>>; +}; + +export type ReviewWorkflowsWorkflowEntityResponseCollection = { + __typename?: 'ReviewWorkflowsWorkflowEntityResponseCollection'; + nodes: Array; + pageInfo: Pagination; +}; + +export type ReviewWorkflowsWorkflowFiltersInput = { + and: InputMaybe>>; + contentTypes: InputMaybe; + createdAt: InputMaybe; + documentId: InputMaybe; + locale: InputMaybe; + localizations: InputMaybe; + name: InputMaybe; + not: InputMaybe; + or: InputMaybe>>; + publishedAt: InputMaybe; + stages: InputMaybe; + updatedAt: InputMaybe; +}; + +export type ReviewWorkflowsWorkflowInput = { + contentTypes: InputMaybe; + locale: InputMaybe; + name: InputMaybe; + publishedAt: InputMaybe; + stages: InputMaybe>>; +}; + +export type ReviewWorkflowsWorkflowRelationResponseCollection = { + __typename?: 'ReviewWorkflowsWorkflowRelationResponseCollection'; + nodes: Array; +}; + +export type ReviewWorkflowsWorkflowStage = { + __typename?: 'ReviewWorkflowsWorkflowStage'; + color: Maybe; + createdAt: Maybe; + documentId: Scalars['ID']['output']; + locale: Maybe; + localizations: Array>; + localizations_connection: Maybe; + name: Maybe; + publishedAt: Maybe; + updatedAt: Maybe; + workflow: Maybe; +}; + + +export type ReviewWorkflowsWorkflowStageLocalizationsArgs = { + filters: InputMaybe; + pagination?: InputMaybe; + sort?: InputMaybe>>; +}; + + +export type ReviewWorkflowsWorkflowStageLocalizations_ConnectionArgs = { + filters: InputMaybe; + pagination?: InputMaybe; + sort?: InputMaybe>>; +}; + +export type ReviewWorkflowsWorkflowStageEntityResponseCollection = { + __typename?: 'ReviewWorkflowsWorkflowStageEntityResponseCollection'; + nodes: Array; + pageInfo: Pagination; +}; + +export type ReviewWorkflowsWorkflowStageFiltersInput = { + and: InputMaybe>>; + color: InputMaybe; + createdAt: InputMaybe; + documentId: InputMaybe; + locale: InputMaybe; + localizations: InputMaybe; + name: InputMaybe; + not: InputMaybe; + or: InputMaybe>>; + publishedAt: InputMaybe; + updatedAt: InputMaybe; + workflow: InputMaybe; +}; + +export type ReviewWorkflowsWorkflowStageInput = { + color: InputMaybe; + locale: InputMaybe; + name: InputMaybe; + publishedAt: InputMaybe; + workflow: InputMaybe; +}; + +export type ReviewWorkflowsWorkflowStageRelationResponseCollection = { + __typename?: 'ReviewWorkflowsWorkflowStageRelationResponseCollection'; + nodes: Array; }; export type Service = { __typename?: 'Service'; - capabilities: Maybe; + capabilities: Array>; + capabilities_connection: Maybe; createdAt: Maybe; description: Maybe; + documentId: Scalars['ID']['output']; internalName: Scalars['String']['output']; + locale: Maybe; + localizations: Array>; + localizations_connection: Maybe; oauthClientId: Scalars['String']['output']; publishedAt: Maybe; updatedAt: Maybe; }; + export type ServiceCapabilitiesArgs = { filters: InputMaybe; pagination?: InputMaybe; - publicationState?: InputMaybe; sort?: InputMaybe>>; }; -export type ServiceEntity = { - __typename?: 'ServiceEntity'; - attributes: Maybe; - id: Maybe; + +export type ServiceCapabilities_ConnectionArgs = { + filters: InputMaybe; + pagination?: InputMaybe; + sort?: InputMaybe>>; }; -export type ServiceEntityResponse = { - __typename?: 'ServiceEntityResponse'; - data: Maybe; + +export type ServiceLocalizationsArgs = { + filters: InputMaybe; + pagination?: InputMaybe; + sort?: InputMaybe>>; +}; + + +export type ServiceLocalizations_ConnectionArgs = { + filters: InputMaybe; + pagination?: InputMaybe; + sort?: InputMaybe>>; }; export type ServiceEntityResponseCollection = { __typename?: 'ServiceEntityResponseCollection'; - data: Array; - meta: ResponseCollectionMeta; + nodes: Array; + pageInfo: Pagination; }; export type ServiceFiltersInput = { @@ -1590,8 +1869,10 @@ export type ServiceFiltersInput = { capabilities: InputMaybe; createdAt: InputMaybe; description: InputMaybe; - id: InputMaybe; + documentId: InputMaybe; internalName: InputMaybe; + locale: InputMaybe; + localizations: InputMaybe; not: InputMaybe; oauthClientId: InputMaybe; or: InputMaybe>>; @@ -1603,13 +1884,14 @@ export type ServiceInput = { capabilities: InputMaybe>>; description: InputMaybe; internalName: InputMaybe; + locale: InputMaybe; oauthClientId: InputMaybe; publishedAt: InputMaybe; }; export type ServiceRelationResponseCollection = { __typename?: 'ServiceRelationResponseCollection'; - data: Array; + nodes: Array; }; export type StringFilterInput = { @@ -1640,43 +1922,60 @@ export type StringFilterInput = { export type Subgroup = { __typename?: 'Subgroup'; createdAt: Maybe; + documentId: Scalars['ID']['output']; groupName: Maybe; internalName: Scalars['String']['output']; - offerings: Maybe; + locale: Maybe; + localizations: Array>; + localizations_connection: Maybe; + offerings: Array>; + offerings_connection: Maybe; publishedAt: Maybe; updatedAt: Maybe; }; -export type SubgroupOfferingsArgs = { - filters: InputMaybe; + +export type SubgroupLocalizationsArgs = { + filters: InputMaybe; pagination?: InputMaybe; - publicationState?: InputMaybe; sort?: InputMaybe>>; }; -export type SubgroupEntity = { - __typename?: 'SubgroupEntity'; - attributes: Maybe; - id: Maybe; + +export type SubgroupLocalizations_ConnectionArgs = { + filters: InputMaybe; + pagination?: InputMaybe; + sort?: InputMaybe>>; }; -export type SubgroupEntityResponse = { - __typename?: 'SubgroupEntityResponse'; - data: Maybe; + +export type SubgroupOfferingsArgs = { + filters: InputMaybe; + pagination?: InputMaybe; + sort?: InputMaybe>>; +}; + + +export type SubgroupOfferings_ConnectionArgs = { + filters: InputMaybe; + pagination?: InputMaybe; + sort?: InputMaybe>>; }; export type SubgroupEntityResponseCollection = { __typename?: 'SubgroupEntityResponseCollection'; - data: Array; - meta: ResponseCollectionMeta; + nodes: Array; + pageInfo: Pagination; }; export type SubgroupFiltersInput = { and: InputMaybe>>; createdAt: InputMaybe; + documentId: InputMaybe; groupName: InputMaybe; - id: InputMaybe; internalName: InputMaybe; + locale: InputMaybe; + localizations: InputMaybe; not: InputMaybe; offerings: InputMaybe; or: InputMaybe>>; @@ -1687,13 +1986,14 @@ export type SubgroupFiltersInput = { export type SubgroupInput = { groupName: InputMaybe; internalName: InputMaybe; + locale: InputMaybe; offerings: InputMaybe>>; publishedAt: InputMaybe; }; export type SubgroupRelationResponseCollection = { __typename?: 'SubgroupRelationResponseCollection'; - data: Array; + nodes: Array; }; export type UploadFile = { @@ -1701,15 +2001,20 @@ export type UploadFile = { alternativeText: Maybe; caption: Maybe; createdAt: Maybe; + documentId: Scalars['ID']['output']; ext: Maybe; formats: Maybe; hash: Scalars['String']['output']; height: Maybe; + locale: Maybe; + localizations: Array>; + localizations_connection: Maybe; mime: Scalars['String']['output']; name: Scalars['String']['output']; previewUrl: Maybe; provider: Scalars['String']['output']; provider_metadata: Maybe; + publishedAt: Maybe; related: Maybe>>; size: Scalars['Float']['output']; updatedAt: Maybe; @@ -1717,21 +2022,24 @@ export type UploadFile = { width: Maybe; }; -export type UploadFileEntity = { - __typename?: 'UploadFileEntity'; - attributes: Maybe; - id: Maybe; + +export type UploadFileLocalizationsArgs = { + filters: InputMaybe; + pagination?: InputMaybe; + sort?: InputMaybe>>; }; -export type UploadFileEntityResponse = { - __typename?: 'UploadFileEntityResponse'; - data: Maybe; + +export type UploadFileLocalizations_ConnectionArgs = { + filters: InputMaybe; + pagination?: InputMaybe; + sort?: InputMaybe>>; }; export type UploadFileEntityResponseCollection = { __typename?: 'UploadFileEntityResponseCollection'; - data: Array; - meta: ResponseCollectionMeta; + nodes: Array; + pageInfo: Pagination; }; export type UploadFileFiltersInput = { @@ -1739,13 +2047,14 @@ export type UploadFileFiltersInput = { and: InputMaybe>>; caption: InputMaybe; createdAt: InputMaybe; + documentId: InputMaybe; ext: InputMaybe; - folder: InputMaybe; folderPath: InputMaybe; formats: InputMaybe; hash: InputMaybe; height: InputMaybe; - id: InputMaybe; + locale: InputMaybe; + localizations: InputMaybe; mime: InputMaybe; name: InputMaybe; not: InputMaybe; @@ -1753,104 +2062,16 @@ export type UploadFileFiltersInput = { previewUrl: InputMaybe; provider: InputMaybe; provider_metadata: InputMaybe; + publishedAt: InputMaybe; size: InputMaybe; updatedAt: InputMaybe; url: InputMaybe; width: InputMaybe; }; -export type UploadFileInput = { - alternativeText: InputMaybe; - caption: InputMaybe; - ext: InputMaybe; - folder: InputMaybe; - folderPath: InputMaybe; - formats: InputMaybe; - hash: InputMaybe; - height: InputMaybe; - mime: InputMaybe; - name: InputMaybe; - previewUrl: InputMaybe; - provider: InputMaybe; - provider_metadata: InputMaybe; - size: InputMaybe; - url: InputMaybe; - width: InputMaybe; -}; - export type UploadFileRelationResponseCollection = { __typename?: 'UploadFileRelationResponseCollection'; - data: Array; -}; - -export type UploadFolder = { - __typename?: 'UploadFolder'; - children: Maybe; - createdAt: Maybe; - files: Maybe; - name: Scalars['String']['output']; - parent: Maybe; - path: Scalars['String']['output']; - pathId: Scalars['Int']['output']; - updatedAt: Maybe; -}; - -export type UploadFolderChildrenArgs = { - filters: InputMaybe; - pagination?: InputMaybe; - sort?: InputMaybe>>; -}; - -export type UploadFolderFilesArgs = { - filters: InputMaybe; - pagination?: InputMaybe; - sort?: InputMaybe>>; -}; - -export type UploadFolderEntity = { - __typename?: 'UploadFolderEntity'; - attributes: Maybe; - id: Maybe; -}; - -export type UploadFolderEntityResponse = { - __typename?: 'UploadFolderEntityResponse'; - data: Maybe; -}; - -export type UploadFolderEntityResponseCollection = { - __typename?: 'UploadFolderEntityResponseCollection'; - data: Array; - meta: ResponseCollectionMeta; -}; - -export type UploadFolderFiltersInput = { - and: InputMaybe>>; - children: InputMaybe; - createdAt: InputMaybe; - files: InputMaybe; - id: InputMaybe; - name: InputMaybe; - not: InputMaybe; - or: InputMaybe>>; - parent: InputMaybe; - path: InputMaybe; - pathId: InputMaybe; - updatedAt: InputMaybe; -}; - -export type UploadFolderInput = { - children: InputMaybe>>; - files: InputMaybe>>; - name: InputMaybe; - parent: InputMaybe; - path: InputMaybe; - pathId: InputMaybe; -}; - -export type UploadFolderRelationResponseCollection = { - __typename?: 'UploadFolderRelationResponseCollection'; - data: Array; + nodes: Array; }; export type UsersPermissionsCreateRolePayload = { @@ -1902,30 +2123,46 @@ export type UsersPermissionsPermission = { __typename?: 'UsersPermissionsPermission'; action: Scalars['String']['output']; createdAt: Maybe; - role: Maybe; + documentId: Scalars['ID']['output']; + locale: Maybe; + localizations: Array>; + localizations_connection: Maybe; + publishedAt: Maybe; + role: Maybe; updatedAt: Maybe; }; -export type UsersPermissionsPermissionEntity = { - __typename?: 'UsersPermissionsPermissionEntity'; - attributes: Maybe; - id: Maybe; + +export type UsersPermissionsPermissionLocalizationsArgs = { + filters: InputMaybe; + pagination?: InputMaybe; + sort?: InputMaybe>>; +}; + + +export type UsersPermissionsPermissionLocalizations_ConnectionArgs = { + filters: InputMaybe; + pagination?: InputMaybe; + sort?: InputMaybe>>; }; export type UsersPermissionsPermissionFiltersInput = { action: InputMaybe; and: InputMaybe>>; createdAt: InputMaybe; - id: InputMaybe; + documentId: InputMaybe; + locale: InputMaybe; + localizations: InputMaybe; not: InputMaybe; or: InputMaybe>>; + publishedAt: InputMaybe; role: InputMaybe; updatedAt: InputMaybe; }; export type UsersPermissionsPermissionRelationResponseCollection = { __typename?: 'UsersPermissionsPermissionRelationResponseCollection'; - data: Array; + nodes: Array; }; export type UsersPermissionsRegisterInput = { @@ -1938,51 +2175,80 @@ export type UsersPermissionsRole = { __typename?: 'UsersPermissionsRole'; createdAt: Maybe; description: Maybe; + documentId: Scalars['ID']['output']; + locale: Maybe; + localizations: Array>; + localizations_connection: Maybe; name: Scalars['String']['output']; - permissions: Maybe; + permissions: Array>; + permissions_connection: Maybe; + publishedAt: Maybe; type: Maybe; updatedAt: Maybe; - users: Maybe; + users: Array>; + users_connection: Maybe; }; + +export type UsersPermissionsRoleLocalizationsArgs = { + filters: InputMaybe; + pagination?: InputMaybe; + sort?: InputMaybe>>; +}; + + +export type UsersPermissionsRoleLocalizations_ConnectionArgs = { + filters: InputMaybe; + pagination?: InputMaybe; + sort?: InputMaybe>>; +}; + + export type UsersPermissionsRolePermissionsArgs = { filters: InputMaybe; pagination?: InputMaybe; sort?: InputMaybe>>; }; + +export type UsersPermissionsRolePermissions_ConnectionArgs = { + filters: InputMaybe; + pagination?: InputMaybe; + sort?: InputMaybe>>; +}; + + export type UsersPermissionsRoleUsersArgs = { filters: InputMaybe; pagination?: InputMaybe; sort?: InputMaybe>>; }; -export type UsersPermissionsRoleEntity = { - __typename?: 'UsersPermissionsRoleEntity'; - attributes: Maybe; - id: Maybe; -}; -export type UsersPermissionsRoleEntityResponse = { - __typename?: 'UsersPermissionsRoleEntityResponse'; - data: Maybe; +export type UsersPermissionsRoleUsers_ConnectionArgs = { + filters: InputMaybe; + pagination?: InputMaybe; + sort?: InputMaybe>>; }; export type UsersPermissionsRoleEntityResponseCollection = { __typename?: 'UsersPermissionsRoleEntityResponseCollection'; - data: Array; - meta: ResponseCollectionMeta; + nodes: Array; + pageInfo: Pagination; }; export type UsersPermissionsRoleFiltersInput = { and: InputMaybe>>; createdAt: InputMaybe; description: InputMaybe; - id: InputMaybe; + documentId: InputMaybe; + locale: InputMaybe; + localizations: InputMaybe; name: InputMaybe; not: InputMaybe; or: InputMaybe>>; permissions: InputMaybe; + publishedAt: InputMaybe; type: InputMaybe; updatedAt: InputMaybe; users: InputMaybe; @@ -1990,12 +2256,19 @@ export type UsersPermissionsRoleFiltersInput = { export type UsersPermissionsRoleInput = { description: InputMaybe; + locale: InputMaybe; name: InputMaybe; permissions: InputMaybe>>; + publishedAt: InputMaybe; type: InputMaybe; users: InputMaybe>>; }; +export type UsersPermissionsRoleRelationResponseCollection = { + __typename?: 'UsersPermissionsRoleRelationResponseCollection'; + nodes: Array; +}; + export type UsersPermissionsUpdateRolePayload = { __typename?: 'UsersPermissionsUpdateRolePayload'; ok: Scalars['Boolean']['output']; @@ -2006,28 +2279,41 @@ export type UsersPermissionsUser = { blocked: Maybe; confirmed: Maybe; createdAt: Maybe; + documentId: Scalars['ID']['output']; email: Scalars['String']['output']; + locale: Maybe; + localizations: Array>; + localizations_connection: Maybe; provider: Maybe; - role: Maybe; + publishedAt: Maybe; + role: Maybe; updatedAt: Maybe; username: Scalars['String']['output']; }; -export type UsersPermissionsUserEntity = { - __typename?: 'UsersPermissionsUserEntity'; - attributes: Maybe; - id: Maybe; + +export type UsersPermissionsUserLocalizationsArgs = { + filters: InputMaybe; + pagination?: InputMaybe; + sort?: InputMaybe>>; +}; + + +export type UsersPermissionsUserLocalizations_ConnectionArgs = { + filters: InputMaybe; + pagination?: InputMaybe; + sort?: InputMaybe>>; }; export type UsersPermissionsUserEntityResponse = { __typename?: 'UsersPermissionsUserEntityResponse'; - data: Maybe; + data: Maybe; }; export type UsersPermissionsUserEntityResponseCollection = { __typename?: 'UsersPermissionsUserEntityResponseCollection'; - data: Array; - meta: ResponseCollectionMeta; + nodes: Array; + pageInfo: Pagination; }; export type UsersPermissionsUserFiltersInput = { @@ -2036,12 +2322,15 @@ export type UsersPermissionsUserFiltersInput = { confirmationToken: InputMaybe; confirmed: InputMaybe; createdAt: InputMaybe; + documentId: InputMaybe; email: InputMaybe; - id: InputMaybe; + locale: InputMaybe; + localizations: InputMaybe; not: InputMaybe; or: InputMaybe>>; password: InputMaybe; provider: InputMaybe; + publishedAt: InputMaybe; resetPasswordToken: InputMaybe; role: InputMaybe; updatedAt: InputMaybe; @@ -2053,8 +2342,10 @@ export type UsersPermissionsUserInput = { confirmationToken: InputMaybe; confirmed: InputMaybe; email: InputMaybe; + locale: InputMaybe; password: InputMaybe; provider: InputMaybe; + publishedAt: InputMaybe; resetPasswordToken: InputMaybe; role: InputMaybe; username: InputMaybe; @@ -2062,3687 +2353,70 @@ export type UsersPermissionsUserInput = { export type UsersPermissionsUserRelationResponseCollection = { __typename?: 'UsersPermissionsUserRelationResponseCollection'; - data: Array; + nodes: Array; }; export type CapabilityServiceByPlanIdsQueryVariables = Exact<{ - skip: Scalars['Int']['input']; - limit: Scalars['Int']['input']; - stripePlanIds: - | Array> - | InputMaybe; + stripePlanIds: Array> | InputMaybe; }>; -export type CapabilityServiceByPlanIdsQuery = { - __typename?: 'Query'; - purchases: { - __typename?: 'PurchaseEntityResponseCollection'; - meta: { - __typename?: 'ResponseCollectionMeta'; - pagination: { __typename?: 'Pagination'; total: number }; - }; - data: Array<{ - __typename?: 'PurchaseEntity'; - attributes: { - __typename?: 'Purchase'; - stripePlanChoices: Array<{ - __typename?: 'ComponentStripeStripePlanChoices'; - stripePlanChoice: string | null; - } | null> | null; - offering: { - __typename?: 'OfferingEntityResponse'; - data: { - __typename?: 'OfferingEntity'; - attributes: { - __typename?: 'Offering'; - stripeLegacyPlans: Array<{ - __typename?: 'ComponentStripeStripeLegacyPlans'; - stripeLegacyPlan: string | null; - } | null> | null; - capabilities: { - __typename?: 'CapabilityRelationResponseCollection'; - data: Array<{ - __typename?: 'CapabilityEntity'; - attributes: { - __typename?: 'Capability'; - slug: string; - services: { - __typename?: 'ServiceRelationResponseCollection'; - data: Array<{ - __typename?: 'ServiceEntity'; - attributes: { - __typename?: 'Service'; - oauthClientId: string; - } | null; - }>; - } | null; - } | null; - }>; - } | null; - } | null; - } | null; - } | null; - } | null; - }>; - } | null; -}; + +export type CapabilityServiceByPlanIdsQuery = { __typename?: 'Query', purchases: Array<{ __typename?: 'Purchase', stripePlanChoices: Array<{ __typename?: 'ComponentStripeStripePlanChoices', stripePlanChoice: string | null } | null> | null, offering: { __typename?: 'Offering', stripeLegacyPlans: Array<{ __typename?: 'ComponentStripeStripeLegacyPlans', stripeLegacyPlan: string | null } | null> | null, capabilities: Array<{ __typename?: 'Capability', slug: string, services: Array<{ __typename?: 'Service', oauthClientId: string } | null> } | null> } | null } | null> }; export type EligibilityContentByOfferingQueryVariables = Exact<{ apiIdentifier: Scalars['String']['input']; }>; -export type EligibilityContentByOfferingQuery = { - __typename?: 'Query'; - offerings: { - __typename?: 'OfferingEntityResponseCollection'; - data: Array<{ - __typename?: 'OfferingEntity'; - attributes: { - __typename?: 'Offering'; - apiIdentifier: string; - stripeProductId: string; - defaultPurchase: { - __typename?: 'PurchaseEntityResponse'; - data: { - __typename?: 'PurchaseEntity'; - attributes: { - __typename?: 'Purchase'; - stripePlanChoices: Array<{ - __typename?: 'ComponentStripeStripePlanChoices'; - stripePlanChoice: string | null; - } | null> | null; - } | null; - } | null; - } | null; - subGroups: { - __typename?: 'SubgroupRelationResponseCollection'; - data: Array<{ - __typename?: 'SubgroupEntity'; - attributes: { - __typename?: 'Subgroup'; - groupName: string | null; - offerings: { - __typename?: 'OfferingRelationResponseCollection'; - data: Array<{ - __typename?: 'OfferingEntity'; - attributes: { - __typename?: 'Offering'; - apiIdentifier: string; - stripeProductId: string; - defaultPurchase: { - __typename?: 'PurchaseEntityResponse'; - data: { - __typename?: 'PurchaseEntity'; - attributes: { - __typename?: 'Purchase'; - stripePlanChoices: Array<{ - __typename?: 'ComponentStripeStripePlanChoices'; - stripePlanChoice: string | null; - } | null> | null; - } | null; - } | null; - } | null; - } | null; - }>; - } | null; - } | null; - }>; - } | null; - } | null; - }>; - } | null; -}; + +export type EligibilityContentByOfferingQuery = { __typename?: 'Query', offerings: Array<{ __typename?: 'Offering', apiIdentifier: string, stripeProductId: string, defaultPurchase: { __typename?: 'Purchase', stripePlanChoices: Array<{ __typename?: 'ComponentStripeStripePlanChoices', stripePlanChoice: string | null } | null> | null } | null, subGroups: Array<{ __typename?: 'Subgroup', groupName: string | null, offerings: Array<{ __typename?: 'Offering', apiIdentifier: string, stripeProductId: string, defaultPurchase: { __typename?: 'Purchase', stripePlanChoices: Array<{ __typename?: 'ComponentStripeStripePlanChoices', stripePlanChoice: string | null } | null> | null } | null } | null> } | null> } | null> }; export type EligibilityContentByPlanIdsQueryVariables = Exact<{ - skip: Scalars['Int']['input']; - limit: Scalars['Int']['input']; - stripePlanIds: - | Array> - | InputMaybe; + stripePlanIds: Array> | InputMaybe; }>; -export type EligibilityContentByPlanIdsQuery = { - __typename?: 'Query'; - purchases: { - __typename?: 'PurchaseEntityResponseCollection'; - meta: { - __typename?: 'ResponseCollectionMeta'; - pagination: { __typename?: 'Pagination'; total: number }; - }; - data: Array<{ - __typename?: 'PurchaseEntity'; - attributes: { - __typename?: 'Purchase'; - stripePlanChoices: Array<{ - __typename?: 'ComponentStripeStripePlanChoices'; - stripePlanChoice: string | null; - } | null> | null; - offering: { - __typename?: 'OfferingEntityResponse'; - data: { - __typename?: 'OfferingEntity'; - attributes: { - __typename?: 'Offering'; - stripeProductId: string; - countries: any | null; - stripeLegacyPlans: Array<{ - __typename?: 'ComponentStripeStripeLegacyPlans'; - stripeLegacyPlan: string | null; - } | null> | null; - subGroups: { - __typename?: 'SubgroupRelationResponseCollection'; - data: Array<{ - __typename?: 'SubgroupEntity'; - attributes: { - __typename?: 'Subgroup'; - groupName: string | null; - offerings: { - __typename?: 'OfferingRelationResponseCollection'; - data: Array<{ - __typename?: 'OfferingEntity'; - attributes: { - __typename?: 'Offering'; - stripeProductId: string; - countries: any | null; - stripeLegacyPlans: Array<{ - __typename?: 'ComponentStripeStripeLegacyPlans'; - stripeLegacyPlan: string | null; - } | null> | null; - } | null; - }>; - } | null; - } | null; - }>; - } | null; - } | null; - } | null; - } | null; - } | null; - }>; - } | null; -}; -export type LocalesQueryVariables = Exact<{ [key: string]: never }>; +export type EligibilityContentByPlanIdsQuery = { __typename?: 'Query', purchases: Array<{ __typename?: 'Purchase', stripePlanChoices: Array<{ __typename?: 'ComponentStripeStripePlanChoices', stripePlanChoice: string | null } | null> | null, offering: { __typename?: 'Offering', stripeProductId: string, countries: any | null, stripeLegacyPlans: Array<{ __typename?: 'ComponentStripeStripeLegacyPlans', stripeLegacyPlan: string | null } | null> | null, subGroups: Array<{ __typename?: 'Subgroup', groupName: string | null, offerings: Array<{ __typename?: 'Offering', stripeProductId: string, countries: any | null, stripeLegacyPlans: Array<{ __typename?: 'ComponentStripeStripeLegacyPlans', stripeLegacyPlan: string | null } | null> | null } | null> } | null> } | null } | null> }; -export type LocalesQuery = { - __typename?: 'Query'; - i18NLocales: { - __typename?: 'I18NLocaleEntityResponseCollection'; - data: Array<{ - __typename?: 'I18NLocaleEntity'; - attributes: { __typename?: 'I18NLocale'; code: string | null } | null; - }>; - } | null; -}; +export type LocalesQueryVariables = Exact<{ [key: string]: never; }>; + + +export type LocalesQuery = { __typename?: 'Query', i18NLocales: Array<{ __typename?: 'I18NLocale', code: string | null } | null> }; export type OfferingQueryVariables = Exact<{ id: Scalars['ID']['input']; locale: Scalars['String']['input']; }>; -export type OfferingQuery = { - __typename?: 'Query'; - offering: { - __typename?: 'OfferingEntityResponse'; - data: { - __typename?: 'OfferingEntity'; - attributes: { - __typename?: 'Offering'; - stripeProductId: string; - countries: any | null; - defaultPurchase: { - __typename?: 'PurchaseEntityResponse'; - data: { - __typename?: 'PurchaseEntity'; - attributes: { - __typename?: 'Purchase'; - purchaseDetails: { - __typename?: 'PurchaseDetailEntityResponse'; - data: { - __typename?: 'PurchaseDetailEntity'; - attributes: { - __typename?: 'PurchaseDetail'; - productName: string; - details: string; - subtitle: string | null; - webIcon: string; - localizations: { - __typename?: 'PurchaseDetailRelationResponseCollection'; - data: Array<{ - __typename?: 'PurchaseDetailEntity'; - attributes: { - __typename?: 'PurchaseDetail'; - productName: string; - details: string; - subtitle: string | null; - webIcon: string; - } | null; - }>; - } | null; - } | null; - } | null; - } | null; - } | null; - } | null; - } | null; - } | null; - } | null; - } | null; -}; + +export type OfferingQuery = { __typename?: 'Query', offering: { __typename?: 'Offering', stripeProductId: string, countries: any | null, defaultPurchase: { __typename?: 'Purchase', purchaseDetails: { __typename?: 'PurchaseDetail', productName: string, details: string, subtitle: string | null, webIcon: string, localizations: Array<{ __typename?: 'PurchaseDetail', productName: string, details: string, subtitle: string | null, webIcon: string } | null> } | null } | null } | null }; export type PageContentForOfferingQueryVariables = Exact<{ locale: Scalars['String']['input']; apiIdentifier: Scalars['String']['input']; }>; -export type PageContentForOfferingQuery = { - __typename?: 'Query'; - offerings: { - __typename?: 'OfferingEntityResponseCollection'; - meta: { - __typename?: 'ResponseCollectionMeta'; - pagination: { __typename?: 'Pagination'; total: number }; - }; - data: Array<{ - __typename?: 'OfferingEntity'; - attributes: { - __typename?: 'Offering'; - apiIdentifier: string; - stripeProductId: string; - defaultPurchase: { - __typename?: 'PurchaseEntityResponse'; - data: { - __typename?: 'PurchaseEntity'; - attributes: { - __typename?: 'Purchase'; - purchaseDetails: { - __typename?: 'PurchaseDetailEntityResponse'; - data: { - __typename?: 'PurchaseDetailEntity'; - attributes: { - __typename?: 'PurchaseDetail'; - details: string; - productName: string; - subtitle: string | null; - webIcon: string; - localizations: { - __typename?: 'PurchaseDetailRelationResponseCollection'; - data: Array<{ - __typename?: 'PurchaseDetailEntity'; - attributes: { - __typename?: 'PurchaseDetail'; - details: string; - productName: string; - subtitle: string | null; - webIcon: string; - } | null; - }>; - } | null; - } | null; - } | null; - } | null; - } | null; - } | null; - } | null; - commonContent: { - __typename?: 'CommonContentEntityResponse'; - data: { - __typename?: 'CommonContentEntity'; - attributes: { - __typename?: 'CommonContent'; - privacyNoticeUrl: string; - privacyNoticeDownloadUrl: string; - termsOfServiceUrl: string; - termsOfServiceDownloadUrl: string; - cancellationUrl: string | null; - emailIcon: string | null; - successActionButtonUrl: string; - successActionButtonLabel: string | null; - newsletterLabelTextCode: string | null; - newsletterSlug: any | null; - localizations: { - __typename?: 'CommonContentRelationResponseCollection'; - data: Array<{ - __typename?: 'CommonContentEntity'; - attributes: { - __typename?: 'CommonContent'; - privacyNoticeUrl: string; - privacyNoticeDownloadUrl: string; - termsOfServiceUrl: string; - termsOfServiceDownloadUrl: string; - cancellationUrl: string | null; - emailIcon: string | null; - successActionButtonUrl: string; - successActionButtonLabel: string | null; - newsletterLabelTextCode: string | null; - newsletterSlug: any | null; - } | null; - }>; - } | null; - } | null; - } | null; - } | null; - } | null; - }>; - } | null; -}; + +export type PageContentForOfferingQuery = { __typename?: 'Query', offerings: Array<{ __typename?: 'Offering', apiIdentifier: string, stripeProductId: string, defaultPurchase: { __typename?: 'Purchase', purchaseDetails: { __typename?: 'PurchaseDetail', details: string, productName: string, subtitle: string | null, webIcon: string, localizations: Array<{ __typename?: 'PurchaseDetail', details: string, productName: string, subtitle: string | null, webIcon: string } | null> } | null } | null, commonContent: { __typename?: 'CommonContent', privacyNoticeUrl: string, privacyNoticeDownloadUrl: string, termsOfServiceUrl: string, termsOfServiceDownloadUrl: string, cancellationUrl: string | null, emailIcon: string | null, successActionButtonUrl: string, successActionButtonLabel: string | null, newsletterLabelTextCode: string | null, newsletterSlug: any | null, localizations: Array<{ __typename?: 'CommonContent', privacyNoticeUrl: string, privacyNoticeDownloadUrl: string, termsOfServiceUrl: string, termsOfServiceDownloadUrl: string, cancellationUrl: string | null, emailIcon: string | null, successActionButtonUrl: string, successActionButtonLabel: string | null, newsletterLabelTextCode: string | null, newsletterSlug: any | null } | null> } | null } | null> }; export type PurchaseWithDetailsOfferingContentQueryVariables = Exact<{ - skip: Scalars['Int']['input']; - limit: Scalars['Int']['input']; locale: Scalars['String']['input']; - stripePlanIds: - | Array> - | InputMaybe; + stripePlanIds: Array> | InputMaybe; }>; -export type PurchaseWithDetailsOfferingContentQuery = { - __typename?: 'Query'; - purchases: { - __typename?: 'PurchaseEntityResponseCollection'; - data: Array<{ - __typename?: 'PurchaseEntity'; - attributes: { - __typename?: 'Purchase'; - stripePlanChoices: Array<{ - __typename?: 'ComponentStripeStripePlanChoices'; - stripePlanChoice: string | null; - } | null> | null; - purchaseDetails: { - __typename?: 'PurchaseDetailEntityResponse'; - data: { - __typename?: 'PurchaseDetailEntity'; - attributes: { - __typename?: 'PurchaseDetail'; - details: string; - productName: string; - subtitle: string | null; - webIcon: string; - localizations: { - __typename?: 'PurchaseDetailRelationResponseCollection'; - data: Array<{ - __typename?: 'PurchaseDetailEntity'; - attributes: { - __typename?: 'PurchaseDetail'; - details: string; - productName: string; - subtitle: string | null; - webIcon: string; - } | null; - }>; - } | null; - } | null; - } | null; - } | null; - offering: { - __typename?: 'OfferingEntityResponse'; - data: { - __typename?: 'OfferingEntity'; - attributes: { - __typename?: 'Offering'; - stripeProductId: string; - stripeLegacyPlans: Array<{ - __typename?: 'ComponentStripeStripeLegacyPlans'; - stripeLegacyPlan: string | null; - } | null> | null; - commonContent: { - __typename?: 'CommonContentEntityResponse'; - data: { - __typename?: 'CommonContentEntity'; - attributes: { - __typename?: 'CommonContent'; - privacyNoticeUrl: string; - privacyNoticeDownloadUrl: string; - termsOfServiceUrl: string; - termsOfServiceDownloadUrl: string; - cancellationUrl: string | null; - emailIcon: string | null; - successActionButtonUrl: string; - successActionButtonLabel: string | null; - newsletterLabelTextCode: string | null; - newsletterSlug: any | null; - localizations: { - __typename?: 'CommonContentRelationResponseCollection'; - data: Array<{ - __typename?: 'CommonContentEntity'; - attributes: { - __typename?: 'CommonContent'; - privacyNoticeUrl: string; - privacyNoticeDownloadUrl: string; - termsOfServiceUrl: string; - termsOfServiceDownloadUrl: string; - cancellationUrl: string | null; - emailIcon: string | null; - successActionButtonUrl: string; - successActionButtonLabel: string | null; - newsletterLabelTextCode: string | null; - newsletterSlug: any | null; - } | null; - }>; - } | null; - } | null; - } | null; - } | null; - } | null; - } | null; - } | null; - } | null; - }>; - } | null; -}; -export type ServicesWithCapabilitiesQueryVariables = Exact<{ - skip: Scalars['Int']['input']; - limit: Scalars['Int']['input']; -}>; +export type PurchaseWithDetailsOfferingContentQuery = { __typename?: 'Query', purchases: Array<{ __typename?: 'Purchase', stripePlanChoices: Array<{ __typename?: 'ComponentStripeStripePlanChoices', stripePlanChoice: string | null } | null> | null, purchaseDetails: { __typename?: 'PurchaseDetail', details: string, productName: string, subtitle: string | null, webIcon: string, localizations: Array<{ __typename?: 'PurchaseDetail', details: string, productName: string, subtitle: string | null, webIcon: string } | null> } | null, offering: { __typename?: 'Offering', stripeProductId: string, stripeLegacyPlans: Array<{ __typename?: 'ComponentStripeStripeLegacyPlans', stripeLegacyPlan: string | null } | null> | null, commonContent: { __typename?: 'CommonContent', privacyNoticeUrl: string, privacyNoticeDownloadUrl: string, termsOfServiceUrl: string, termsOfServiceDownloadUrl: string, cancellationUrl: string | null, emailIcon: string | null, successActionButtonUrl: string, successActionButtonLabel: string | null, newsletterLabelTextCode: string | null, newsletterSlug: any | null, localizations: Array<{ __typename?: 'CommonContent', privacyNoticeUrl: string, privacyNoticeDownloadUrl: string, termsOfServiceUrl: string, termsOfServiceDownloadUrl: string, cancellationUrl: string | null, emailIcon: string | null, successActionButtonUrl: string, successActionButtonLabel: string | null, newsletterLabelTextCode: string | null, newsletterSlug: any | null } | null> } | null } | null } | null> }; -export type ServicesWithCapabilitiesQuery = { - __typename?: 'Query'; - services: { - __typename?: 'ServiceEntityResponseCollection'; - data: Array<{ - __typename?: 'ServiceEntity'; - attributes: { - __typename?: 'Service'; - oauthClientId: string; - capabilities: { - __typename?: 'CapabilityRelationResponseCollection'; - data: Array<{ - __typename?: 'CapabilityEntity'; - attributes: { __typename?: 'Capability'; slug: string } | null; - }>; - } | null; - } | null; - }>; - } | null; -}; +export type ServicesWithCapabilitiesQueryVariables = Exact<{ [key: string]: never; }>; -export const CapabilityServiceByPlanIdsDocument = { - kind: 'Document', - definitions: [ - { - kind: 'OperationDefinition', - operation: 'query', - name: { kind: 'Name', value: 'CapabilityServiceByPlanIds' }, - 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: 'stripePlanIds' }, - }, - type: { - kind: 'NonNullType', - type: { - kind: 'ListType', - type: { - kind: 'NamedType', - name: { kind: 'Name', value: 'String' }, - }, - }, - }, - }, - ], - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'purchases' }, - arguments: [ - { - kind: 'Argument', - name: { kind: 'Name', value: 'filters' }, - value: { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { kind: 'Name', value: 'or' }, - value: { - kind: 'ListValue', - values: [ - { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { - kind: 'Name', - value: 'stripePlanChoices', - }, - value: { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { - kind: 'Name', - value: 'stripePlanChoice', - }, - value: { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { kind: 'Name', value: 'in' }, - value: { - kind: 'Variable', - name: { - kind: 'Name', - value: 'stripePlanIds', - }, - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { kind: 'Name', value: 'offering' }, - value: { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { - kind: 'Name', - value: 'stripeLegacyPlans', - }, - value: { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { - kind: 'Name', - value: 'stripeLegacyPlan', - }, - value: { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { - kind: 'Name', - value: 'in', - }, - value: { - kind: 'Variable', - name: { - kind: 'Name', - value: 'stripePlanIds', - }, - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - ], - }, - }, - ], - }, - }, - { - kind: 'Argument', - name: { kind: 'Name', value: 'pagination' }, - value: { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { kind: 'Name', value: 'start' }, - value: { - kind: 'Variable', - name: { kind: 'Name', value: 'skip' }, - }, - }, - { - kind: 'ObjectField', - name: { kind: 'Name', value: 'limit' }, - value: { - kind: 'Variable', - name: { kind: 'Name', value: 'limit' }, - }, - }, - ], - }, - }, - ], - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'meta' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'pagination' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'total' }, - }, - ], - }, - }, - ], - }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'data' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'attributes' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: 'stripePlanChoices', - }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: 'stripePlanChoice', - }, - }, - ], - }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'offering' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'data' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: 'attributes', - }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: 'stripeLegacyPlans', - }, - arguments: [ - { - kind: 'Argument', - name: { - kind: 'Name', - value: 'pagination', - }, - value: { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { - kind: 'Name', - value: 'limit', - }, - value: { - kind: 'IntValue', - value: '200', - }, - }, - ], - }, - }, - ], - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'stripeLegacyPlan', - }, - }, - ], - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: 'capabilities', - }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: 'data', - }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'attributes', - }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'slug', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'services', - }, - selectionSet: - { - kind: 'SelectionSet', - selections: - [ - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'data', - }, - selectionSet: - { - kind: 'SelectionSet', - selections: - [ - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'attributes', - }, - selectionSet: - { - kind: 'SelectionSet', - selections: - [ - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'oauthClientId', - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], -} as unknown as DocumentNode< - CapabilityServiceByPlanIdsQuery, - CapabilityServiceByPlanIdsQueryVariables ->; -export const EligibilityContentByOfferingDocument = { - kind: 'Document', - definitions: [ - { - kind: 'OperationDefinition', - operation: 'query', - name: { kind: 'Name', value: 'EligibilityContentByOffering' }, - variableDefinitions: [ - { - kind: 'VariableDefinition', - variable: { - kind: 'Variable', - name: { kind: 'Name', value: 'apiIdentifier' }, - }, - type: { - kind: 'NonNullType', - type: { - kind: 'NamedType', - name: { kind: 'Name', value: 'String' }, - }, - }, - }, - ], - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'offerings' }, - arguments: [ - { - kind: 'Argument', - name: { kind: 'Name', value: 'pagination' }, - value: { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { kind: 'Name', value: 'start' }, - value: { kind: 'IntValue', value: '0' }, - }, - { - kind: 'ObjectField', - name: { kind: 'Name', value: 'limit' }, - value: { kind: 'IntValue', value: '2' }, - }, - ], - }, - }, - { - kind: 'Argument', - name: { kind: 'Name', value: 'filters' }, - value: { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { kind: 'Name', value: 'apiIdentifier' }, - value: { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { kind: 'Name', value: 'eq' }, - value: { - kind: 'Variable', - name: { kind: 'Name', value: 'apiIdentifier' }, - }, - }, - ], - }, - }, - ], - }, - }, - ], - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'data' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'attributes' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'apiIdentifier' }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'stripeProductId' }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'defaultPurchase' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'data' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: 'attributes', - }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: 'stripePlanChoices', - }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'stripePlanChoice', - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'subGroups' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'data' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: 'attributes', - }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: 'groupName', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: 'offerings', - }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: 'data', - }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'attributes', - }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'apiIdentifier', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'stripeProductId', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'defaultPurchase', - }, - selectionSet: - { - kind: 'SelectionSet', - selections: - [ - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'data', - }, - selectionSet: - { - kind: 'SelectionSet', - selections: - [ - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'attributes', - }, - selectionSet: - { - kind: 'SelectionSet', - selections: - [ - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'stripePlanChoices', - }, - selectionSet: - { - kind: 'SelectionSet', - selections: - [ - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'stripePlanChoice', - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], -} as unknown as DocumentNode< - EligibilityContentByOfferingQuery, - EligibilityContentByOfferingQueryVariables ->; -export const EligibilityContentByPlanIdsDocument = { - kind: 'Document', - definitions: [ - { - kind: 'OperationDefinition', - operation: 'query', - name: { kind: 'Name', value: 'EligibilityContentByPlanIds' }, - 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: 'stripePlanIds' }, - }, - type: { - kind: 'NonNullType', - type: { - kind: 'ListType', - type: { - kind: 'NamedType', - name: { kind: 'Name', value: 'String' }, - }, - }, - }, - }, - ], - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'purchases' }, - arguments: [ - { - kind: 'Argument', - name: { kind: 'Name', value: 'pagination' }, - value: { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { kind: 'Name', value: 'start' }, - value: { - kind: 'Variable', - name: { kind: 'Name', value: 'skip' }, - }, - }, - { - kind: 'ObjectField', - name: { kind: 'Name', value: 'limit' }, - value: { - kind: 'Variable', - name: { kind: 'Name', value: 'limit' }, - }, - }, - ], - }, - }, - { - kind: 'Argument', - name: { kind: 'Name', value: 'filters' }, - value: { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { kind: 'Name', value: 'or' }, - value: { - kind: 'ListValue', - values: [ - { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { - kind: 'Name', - value: 'stripePlanChoices', - }, - value: { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { - kind: 'Name', - value: 'stripePlanChoice', - }, - value: { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { kind: 'Name', value: 'in' }, - value: { - kind: 'Variable', - name: { - kind: 'Name', - value: 'stripePlanIds', - }, - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { kind: 'Name', value: 'offering' }, - value: { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { - kind: 'Name', - value: 'stripeLegacyPlans', - }, - value: { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { - kind: 'Name', - value: 'stripeLegacyPlan', - }, - value: { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { - kind: 'Name', - value: 'in', - }, - value: { - kind: 'Variable', - name: { - kind: 'Name', - value: 'stripePlanIds', - }, - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - ], - }, - }, - ], - }, - }, - ], - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'meta' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'pagination' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'total' }, - }, - ], - }, - }, - ], - }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'data' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'attributes' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: 'stripePlanChoices', - }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: 'stripePlanChoice', - }, - }, - ], - }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'offering' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'data' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: 'attributes', - }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: 'stripeProductId', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: 'stripeLegacyPlans', - }, - arguments: [ - { - kind: 'Argument', - name: { - kind: 'Name', - value: 'pagination', - }, - value: { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { - kind: 'Name', - value: 'limit', - }, - value: { - kind: 'IntValue', - value: '200', - }, - }, - ], - }, - }, - ], - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'stripeLegacyPlan', - }, - }, - ], - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: 'countries', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: 'subGroups', - }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: 'data', - }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'attributes', - }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'groupName', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'offerings', - }, - selectionSet: - { - kind: 'SelectionSet', - selections: - [ - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'data', - }, - selectionSet: - { - kind: 'SelectionSet', - selections: - [ - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'attributes', - }, - selectionSet: - { - kind: 'SelectionSet', - selections: - [ - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'stripeProductId', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'stripeLegacyPlans', - }, - arguments: - [ - { - kind: 'Argument', - name: { - kind: 'Name', - value: - 'pagination', - }, - value: - { - kind: 'ObjectValue', - fields: - [ - { - kind: 'ObjectField', - name: { - kind: 'Name', - value: - 'limit', - }, - value: - { - kind: 'IntValue', - value: - '200', - }, - }, - ], - }, - }, - ], - selectionSet: - { - kind: 'SelectionSet', - selections: - [ - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'stripeLegacyPlan', - }, - }, - ], - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'countries', - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], -} as unknown as DocumentNode< - EligibilityContentByPlanIdsQuery, - EligibilityContentByPlanIdsQueryVariables ->; -export const LocalesDocument = { - kind: 'Document', - definitions: [ - { - kind: 'OperationDefinition', - operation: 'query', - name: { kind: 'Name', value: 'Locales' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'i18NLocales' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'data' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'attributes' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'code' }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], -} as unknown as DocumentNode; -export const OfferingDocument = { - kind: 'Document', - definitions: [ - { - kind: 'OperationDefinition', - operation: 'query', - name: { kind: 'Name', value: 'Offering' }, - variableDefinitions: [ - { - kind: 'VariableDefinition', - variable: { kind: 'Variable', name: { kind: 'Name', value: 'id' } }, - type: { - kind: 'NonNullType', - type: { kind: 'NamedType', name: { kind: 'Name', value: 'ID' } }, - }, - }, - { - kind: 'VariableDefinition', - variable: { - kind: 'Variable', - name: { kind: 'Name', value: 'locale' }, - }, - type: { - kind: 'NonNullType', - type: { - kind: 'NamedType', - name: { kind: 'Name', value: 'String' }, - }, - }, - }, - ], - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'offering' }, - arguments: [ - { - kind: 'Argument', - name: { kind: 'Name', value: 'id' }, - value: { - kind: 'Variable', - name: { kind: 'Name', value: 'id' }, - }, - }, - ], - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'data' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'attributes' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'stripeProductId' }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'countries' }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'defaultPurchase' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'data' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: 'attributes', - }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: 'purchaseDetails', - }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: 'data', - }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'attributes', - }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'productName', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'details', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'subtitle', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'webIcon', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'localizations', - }, - arguments: [ - { - kind: 'Argument', - name: { - kind: 'Name', - value: - 'filters', - }, - value: { - kind: 'ObjectValue', - fields: - [ - { - kind: 'ObjectField', - name: { - kind: 'Name', - value: - 'locale', - }, - value: - { - kind: 'ObjectValue', - fields: - [ - { - kind: 'ObjectField', - name: { - kind: 'Name', - value: - 'eq', - }, - value: - { - kind: 'Variable', - name: { - kind: 'Name', - value: - 'locale', - }, - }, - }, - ], - }, - }, - ], - }, - }, - ], - selectionSet: - { - kind: 'SelectionSet', - selections: - [ - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'data', - }, - selectionSet: - { - kind: 'SelectionSet', - selections: - [ - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'attributes', - }, - selectionSet: - { - kind: 'SelectionSet', - selections: - [ - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'productName', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'details', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'subtitle', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'webIcon', - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], -} as unknown as DocumentNode; -export const PageContentForOfferingDocument = { - kind: 'Document', - definitions: [ - { - kind: 'OperationDefinition', - operation: 'query', - name: { kind: 'Name', value: 'PageContentForOffering' }, - variableDefinitions: [ - { - kind: 'VariableDefinition', - variable: { - kind: 'Variable', - name: { kind: 'Name', value: 'locale' }, - }, - type: { - kind: 'NonNullType', - type: { - kind: 'NamedType', - name: { kind: 'Name', value: 'String' }, - }, - }, - }, - { - kind: 'VariableDefinition', - variable: { - kind: 'Variable', - name: { kind: 'Name', value: 'apiIdentifier' }, - }, - type: { - kind: 'NonNullType', - type: { - kind: 'NamedType', - name: { kind: 'Name', value: 'String' }, - }, - }, - }, - ], - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'offerings' }, - arguments: [ - { - kind: 'Argument', - name: { kind: 'Name', value: 'pagination' }, - value: { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { kind: 'Name', value: 'start' }, - value: { kind: 'IntValue', value: '0' }, - }, - { - kind: 'ObjectField', - name: { kind: 'Name', value: 'limit' }, - value: { kind: 'IntValue', value: '2' }, - }, - ], - }, - }, - { - kind: 'Argument', - name: { kind: 'Name', value: 'filters' }, - value: { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { kind: 'Name', value: 'apiIdentifier' }, - value: { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { kind: 'Name', value: 'eq' }, - value: { - kind: 'Variable', - name: { kind: 'Name', value: 'apiIdentifier' }, - }, - }, - ], - }, - }, - ], - }, - }, - ], - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'meta' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'pagination' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'total' }, - }, - ], - }, - }, - ], - }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'data' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'attributes' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'apiIdentifier' }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'stripeProductId' }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'defaultPurchase' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'data' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: 'attributes', - }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: 'purchaseDetails', - }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: 'data', - }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'attributes', - }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'details', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'productName', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'subtitle', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'webIcon', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'localizations', - }, - arguments: [ - { - kind: 'Argument', - name: { - kind: 'Name', - value: - 'filters', - }, - value: { - kind: 'ObjectValue', - fields: - [ - { - kind: 'ObjectField', - name: { - kind: 'Name', - value: - 'locale', - }, - value: - { - kind: 'ObjectValue', - fields: - [ - { - kind: 'ObjectField', - name: { - kind: 'Name', - value: - 'eq', - }, - value: - { - kind: 'Variable', - name: { - kind: 'Name', - value: - 'locale', - }, - }, - }, - ], - }, - }, - ], - }, - }, - ], - selectionSet: - { - kind: 'SelectionSet', - selections: - [ - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'data', - }, - selectionSet: - { - kind: 'SelectionSet', - selections: - [ - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'attributes', - }, - selectionSet: - { - kind: 'SelectionSet', - selections: - [ - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'details', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'productName', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'subtitle', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'webIcon', - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'commonContent' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'data' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: 'attributes', - }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: 'privacyNoticeUrl', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'privacyNoticeDownloadUrl', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: 'termsOfServiceUrl', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'termsOfServiceDownloadUrl', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: 'cancellationUrl', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: 'emailIcon', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'successActionButtonUrl', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'successActionButtonLabel', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'newsletterLabelTextCode', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: 'newsletterSlug', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: 'localizations', - }, - arguments: [ - { - kind: 'Argument', - name: { - kind: 'Name', - value: 'filters', - }, - value: { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { - kind: 'Name', - value: 'locale', - }, - value: { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { - kind: 'Name', - value: 'eq', - }, - value: { - kind: 'Variable', - name: { - kind: 'Name', - value: - 'locale', - }, - }, - }, - ], - }, - }, - ], - }, - }, - ], - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: 'data', - }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'attributes', - }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'privacyNoticeUrl', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'privacyNoticeDownloadUrl', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'termsOfServiceUrl', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'termsOfServiceDownloadUrl', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'cancellationUrl', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'emailIcon', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'successActionButtonUrl', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'successActionButtonLabel', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'newsletterLabelTextCode', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'newsletterSlug', - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], -} as unknown as DocumentNode< - PageContentForOfferingQuery, - PageContentForOfferingQueryVariables ->; -export const PurchaseWithDetailsOfferingContentDocument = { - kind: 'Document', - definitions: [ - { - kind: 'OperationDefinition', - operation: 'query', - name: { kind: 'Name', value: 'PurchaseWithDetailsOfferingContent' }, - 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: 'locale' }, - }, - type: { - kind: 'NonNullType', - type: { - kind: 'NamedType', - name: { kind: 'Name', value: 'String' }, - }, - }, - }, - { - kind: 'VariableDefinition', - variable: { - kind: 'Variable', - name: { kind: 'Name', value: 'stripePlanIds' }, - }, - type: { - kind: 'NonNullType', - type: { - kind: 'ListType', - type: { - kind: 'NamedType', - name: { kind: 'Name', value: 'String' }, - }, - }, - }, - }, - ], - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'purchases' }, - arguments: [ - { - kind: 'Argument', - name: { kind: 'Name', value: 'pagination' }, - value: { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { kind: 'Name', value: 'start' }, - value: { - kind: 'Variable', - name: { kind: 'Name', value: 'skip' }, - }, - }, - { - kind: 'ObjectField', - name: { kind: 'Name', value: 'limit' }, - value: { - kind: 'Variable', - name: { kind: 'Name', value: 'limit' }, - }, - }, - ], - }, - }, - { - kind: 'Argument', - name: { kind: 'Name', value: 'filters' }, - value: { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { kind: 'Name', value: 'or' }, - value: { - kind: 'ListValue', - values: [ - { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { - kind: 'Name', - value: 'stripePlanChoices', - }, - value: { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { - kind: 'Name', - value: 'stripePlanChoice', - }, - value: { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { kind: 'Name', value: 'in' }, - value: { - kind: 'Variable', - name: { - kind: 'Name', - value: 'stripePlanIds', - }, - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { kind: 'Name', value: 'offering' }, - value: { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { - kind: 'Name', - value: 'stripeLegacyPlans', - }, - value: { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { - kind: 'Name', - value: 'stripeLegacyPlan', - }, - value: { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { - kind: 'Name', - value: 'in', - }, - value: { - kind: 'Variable', - name: { - kind: 'Name', - value: 'stripePlanIds', - }, - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - ], - }, - }, - ], - }, - }, - ], - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'data' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'attributes' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: 'stripePlanChoices', - }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: 'stripePlanChoice', - }, - }, - ], - }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'purchaseDetails' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'data' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: 'attributes', - }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: 'details', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: 'productName', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: 'subtitle', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: 'webIcon', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: 'localizations', - }, - arguments: [ - { - kind: 'Argument', - name: { - kind: 'Name', - value: 'filters', - }, - value: { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { - kind: 'Name', - value: 'locale', - }, - value: { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { - kind: 'Name', - value: 'eq', - }, - value: { - kind: 'Variable', - name: { - kind: 'Name', - value: - 'locale', - }, - }, - }, - ], - }, - }, - ], - }, - }, - ], - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: 'data', - }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'attributes', - }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'details', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'productName', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'subtitle', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'webIcon', - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'offering' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'data' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: 'attributes', - }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: 'stripeProductId', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: 'stripeLegacyPlans', - }, - arguments: [ - { - kind: 'Argument', - name: { - kind: 'Name', - value: 'pagination', - }, - value: { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { - kind: 'Name', - value: 'limit', - }, - value: { - kind: 'IntValue', - value: '200', - }, - }, - ], - }, - }, - ], - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'stripeLegacyPlan', - }, - }, - ], - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: 'commonContent', - }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: 'data', - }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'attributes', - }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'privacyNoticeUrl', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'privacyNoticeDownloadUrl', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'termsOfServiceUrl', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'termsOfServiceDownloadUrl', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'cancellationUrl', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'emailIcon', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'successActionButtonUrl', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'successActionButtonLabel', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'newsletterLabelTextCode', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'newsletterSlug', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'localizations', - }, - arguments: [ - { - kind: 'Argument', - name: { - kind: 'Name', - value: - 'filters', - }, - value: { - kind: 'ObjectValue', - fields: - [ - { - kind: 'ObjectField', - name: { - kind: 'Name', - value: - 'locale', - }, - value: - { - kind: 'ObjectValue', - fields: - [ - { - kind: 'ObjectField', - name: { - kind: 'Name', - value: - 'eq', - }, - value: - { - kind: 'Variable', - name: { - kind: 'Name', - value: - 'locale', - }, - }, - }, - ], - }, - }, - ], - }, - }, - ], - selectionSet: - { - kind: 'SelectionSet', - selections: - [ - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'data', - }, - selectionSet: - { - kind: 'SelectionSet', - selections: - [ - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'attributes', - }, - selectionSet: - { - kind: 'SelectionSet', - selections: - [ - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'privacyNoticeUrl', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'privacyNoticeDownloadUrl', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'termsOfServiceUrl', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'termsOfServiceDownloadUrl', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'cancellationUrl', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'emailIcon', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'successActionButtonUrl', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'successActionButtonLabel', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'newsletterLabelTextCode', - }, - }, - { - kind: 'Field', - name: { - kind: 'Name', - value: - 'newsletterSlug', - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], -} as unknown as DocumentNode< - PurchaseWithDetailsOfferingContentQuery, - PurchaseWithDetailsOfferingContentQueryVariables ->; -export const ServicesWithCapabilitiesDocument = { - kind: 'Document', - definitions: [ - { - kind: 'OperationDefinition', - operation: 'query', - name: { kind: 'Name', value: 'ServicesWithCapabilities' }, - 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' } }, - }, - }, - ], - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'services' }, - arguments: [ - { - kind: 'Argument', - name: { kind: 'Name', value: 'pagination' }, - value: { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { kind: 'Name', value: 'start' }, - value: { - kind: 'Variable', - name: { kind: 'Name', value: 'skip' }, - }, - }, - { - kind: 'ObjectField', - name: { kind: 'Name', value: 'limit' }, - value: { - kind: 'Variable', - name: { kind: 'Name', value: 'limit' }, - }, - }, - ], - }, - }, - ], - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'data' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'attributes' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'oauthClientId' }, - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'capabilities' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'data' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: 'attributes', - }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { - kind: 'Name', - value: 'slug', - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], -} as unknown as DocumentNode< - ServicesWithCapabilitiesQuery, - ServicesWithCapabilitiesQueryVariables ->; + +export type ServicesWithCapabilitiesQuery = { __typename?: 'Query', services: Array<{ __typename?: 'Service', oauthClientId: string, capabilities: Array<{ __typename?: 'Capability', slug: string } | null> } | null> }; + + +export const CapabilityServiceByPlanIdsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"CapabilityServiceByPlanIds"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"stripePlanIds"}},"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"purchases"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"or"},"value":{"kind":"ListValue","values":[{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"stripePlanChoices"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"stripePlanChoice"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"in"},"value":{"kind":"Variable","name":{"kind":"Name","value":"stripePlanIds"}}}]}}]}}]},{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"offering"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"stripeLegacyPlans"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"stripeLegacyPlan"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"in"},"value":{"kind":"Variable","name":{"kind":"Name","value":"stripePlanIds"}}}]}}]}}]}}]}]}}]}},{"kind":"Argument","name":{"kind":"Name","value":"pagination"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"200"}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"stripePlanChoices"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"stripePlanChoice"}}]}},{"kind":"Field","name":{"kind":"Name","value":"offering"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"stripeLegacyPlans"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"pagination"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"200"}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"stripeLegacyPlan"}}]}},{"kind":"Field","name":{"kind":"Name","value":"capabilities"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"services"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"oauthClientId"}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode; +export const EligibilityContentByOfferingDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"EligibilityContentByOffering"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"apiIdentifier"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"offerings"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"apiIdentifier"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"eq"},"value":{"kind":"Variable","name":{"kind":"Name","value":"apiIdentifier"}}}]}}]}},{"kind":"Argument","name":{"kind":"Name","value":"pagination"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"200"}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"apiIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"stripeProductId"}},{"kind":"Field","name":{"kind":"Name","value":"defaultPurchase"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"stripePlanChoices"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"stripePlanChoice"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"subGroups"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"groupName"}},{"kind":"Field","name":{"kind":"Name","value":"offerings"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"apiIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"stripeProductId"}},{"kind":"Field","name":{"kind":"Name","value":"defaultPurchase"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"stripePlanChoices"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"stripePlanChoice"}}]}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode; +export const EligibilityContentByPlanIdsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"EligibilityContentByPlanIds"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"stripePlanIds"}},"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"purchases"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"or"},"value":{"kind":"ListValue","values":[{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"stripePlanChoices"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"stripePlanChoice"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"in"},"value":{"kind":"Variable","name":{"kind":"Name","value":"stripePlanIds"}}}]}}]}}]},{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"offering"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"stripeLegacyPlans"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"stripeLegacyPlan"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"in"},"value":{"kind":"Variable","name":{"kind":"Name","value":"stripePlanIds"}}}]}}]}}]}}]}]}}]}},{"kind":"Argument","name":{"kind":"Name","value":"pagination"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"200"}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"stripePlanChoices"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"stripePlanChoice"}}]}},{"kind":"Field","name":{"kind":"Name","value":"offering"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"stripeProductId"}},{"kind":"Field","name":{"kind":"Name","value":"stripeLegacyPlans"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"pagination"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"200"}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"stripeLegacyPlan"}}]}},{"kind":"Field","name":{"kind":"Name","value":"countries"}},{"kind":"Field","name":{"kind":"Name","value":"subGroups"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"groupName"}},{"kind":"Field","name":{"kind":"Name","value":"offerings"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"stripeProductId"}},{"kind":"Field","name":{"kind":"Name","value":"stripeLegacyPlans"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"pagination"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"200"}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"stripeLegacyPlan"}}]}},{"kind":"Field","name":{"kind":"Name","value":"countries"}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode; +export const LocalesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"Locales"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"i18NLocales"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"code"}}]}}]}}]} as unknown as DocumentNode; +export const OfferingDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"Offering"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"locale"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"offering"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"documentId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"stripeProductId"}},{"kind":"Field","name":{"kind":"Name","value":"countries"}},{"kind":"Field","name":{"kind":"Name","value":"defaultPurchase"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"purchaseDetails"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"productName"}},{"kind":"Field","name":{"kind":"Name","value":"details"}},{"kind":"Field","name":{"kind":"Name","value":"subtitle"}},{"kind":"Field","name":{"kind":"Name","value":"webIcon"}},{"kind":"Field","name":{"kind":"Name","value":"localizations"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"locale"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"eq"},"value":{"kind":"Variable","name":{"kind":"Name","value":"locale"}}}]}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"productName"}},{"kind":"Field","name":{"kind":"Name","value":"details"}},{"kind":"Field","name":{"kind":"Name","value":"subtitle"}},{"kind":"Field","name":{"kind":"Name","value":"webIcon"}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode; +export const PageContentForOfferingDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"PageContentForOffering"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"locale"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"apiIdentifier"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"offerings"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"apiIdentifier"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"eq"},"value":{"kind":"Variable","name":{"kind":"Name","value":"apiIdentifier"}}}]}}]}},{"kind":"Argument","name":{"kind":"Name","value":"pagination"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"200"}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"apiIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"stripeProductId"}},{"kind":"Field","name":{"kind":"Name","value":"defaultPurchase"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"purchaseDetails"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"details"}},{"kind":"Field","name":{"kind":"Name","value":"productName"}},{"kind":"Field","name":{"kind":"Name","value":"subtitle"}},{"kind":"Field","name":{"kind":"Name","value":"webIcon"}},{"kind":"Field","name":{"kind":"Name","value":"localizations"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"locale"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"eq"},"value":{"kind":"Variable","name":{"kind":"Name","value":"locale"}}}]}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"details"}},{"kind":"Field","name":{"kind":"Name","value":"productName"}},{"kind":"Field","name":{"kind":"Name","value":"subtitle"}},{"kind":"Field","name":{"kind":"Name","value":"webIcon"}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"commonContent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"privacyNoticeUrl"}},{"kind":"Field","name":{"kind":"Name","value":"privacyNoticeDownloadUrl"}},{"kind":"Field","name":{"kind":"Name","value":"termsOfServiceUrl"}},{"kind":"Field","name":{"kind":"Name","value":"termsOfServiceDownloadUrl"}},{"kind":"Field","name":{"kind":"Name","value":"cancellationUrl"}},{"kind":"Field","name":{"kind":"Name","value":"emailIcon"}},{"kind":"Field","name":{"kind":"Name","value":"successActionButtonUrl"}},{"kind":"Field","name":{"kind":"Name","value":"successActionButtonLabel"}},{"kind":"Field","name":{"kind":"Name","value":"newsletterLabelTextCode"}},{"kind":"Field","name":{"kind":"Name","value":"newsletterSlug"}},{"kind":"Field","name":{"kind":"Name","value":"localizations"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"locale"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"eq"},"value":{"kind":"Variable","name":{"kind":"Name","value":"locale"}}}]}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"privacyNoticeUrl"}},{"kind":"Field","name":{"kind":"Name","value":"privacyNoticeDownloadUrl"}},{"kind":"Field","name":{"kind":"Name","value":"termsOfServiceUrl"}},{"kind":"Field","name":{"kind":"Name","value":"termsOfServiceDownloadUrl"}},{"kind":"Field","name":{"kind":"Name","value":"cancellationUrl"}},{"kind":"Field","name":{"kind":"Name","value":"emailIcon"}},{"kind":"Field","name":{"kind":"Name","value":"successActionButtonUrl"}},{"kind":"Field","name":{"kind":"Name","value":"successActionButtonLabel"}},{"kind":"Field","name":{"kind":"Name","value":"newsletterLabelTextCode"}},{"kind":"Field","name":{"kind":"Name","value":"newsletterSlug"}}]}}]}}]}}]}}]} as unknown as DocumentNode; +export const PurchaseWithDetailsOfferingContentDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"PurchaseWithDetailsOfferingContent"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"locale"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"stripePlanIds"}},"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"purchases"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"or"},"value":{"kind":"ListValue","values":[{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"stripePlanChoices"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"stripePlanChoice"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"in"},"value":{"kind":"Variable","name":{"kind":"Name","value":"stripePlanIds"}}}]}}]}}]},{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"offering"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"stripeLegacyPlans"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"stripeLegacyPlan"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"in"},"value":{"kind":"Variable","name":{"kind":"Name","value":"stripePlanIds"}}}]}}]}}]}}]}]}}]}},{"kind":"Argument","name":{"kind":"Name","value":"pagination"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"500"}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"stripePlanChoices"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"stripePlanChoice"}}]}},{"kind":"Field","name":{"kind":"Name","value":"purchaseDetails"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"details"}},{"kind":"Field","name":{"kind":"Name","value":"productName"}},{"kind":"Field","name":{"kind":"Name","value":"subtitle"}},{"kind":"Field","name":{"kind":"Name","value":"webIcon"}},{"kind":"Field","name":{"kind":"Name","value":"localizations"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"locale"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"eq"},"value":{"kind":"Variable","name":{"kind":"Name","value":"locale"}}}]}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"details"}},{"kind":"Field","name":{"kind":"Name","value":"productName"}},{"kind":"Field","name":{"kind":"Name","value":"subtitle"}},{"kind":"Field","name":{"kind":"Name","value":"webIcon"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"offering"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"stripeProductId"}},{"kind":"Field","name":{"kind":"Name","value":"stripeLegacyPlans"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"pagination"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"200"}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"stripeLegacyPlan"}}]}},{"kind":"Field","name":{"kind":"Name","value":"commonContent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"privacyNoticeUrl"}},{"kind":"Field","name":{"kind":"Name","value":"privacyNoticeDownloadUrl"}},{"kind":"Field","name":{"kind":"Name","value":"termsOfServiceUrl"}},{"kind":"Field","name":{"kind":"Name","value":"termsOfServiceDownloadUrl"}},{"kind":"Field","name":{"kind":"Name","value":"cancellationUrl"}},{"kind":"Field","name":{"kind":"Name","value":"emailIcon"}},{"kind":"Field","name":{"kind":"Name","value":"successActionButtonUrl"}},{"kind":"Field","name":{"kind":"Name","value":"successActionButtonLabel"}},{"kind":"Field","name":{"kind":"Name","value":"newsletterLabelTextCode"}},{"kind":"Field","name":{"kind":"Name","value":"newsletterSlug"}},{"kind":"Field","name":{"kind":"Name","value":"localizations"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"locale"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"eq"},"value":{"kind":"Variable","name":{"kind":"Name","value":"locale"}}}]}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"privacyNoticeUrl"}},{"kind":"Field","name":{"kind":"Name","value":"privacyNoticeDownloadUrl"}},{"kind":"Field","name":{"kind":"Name","value":"termsOfServiceUrl"}},{"kind":"Field","name":{"kind":"Name","value":"termsOfServiceDownloadUrl"}},{"kind":"Field","name":{"kind":"Name","value":"cancellationUrl"}},{"kind":"Field","name":{"kind":"Name","value":"emailIcon"}},{"kind":"Field","name":{"kind":"Name","value":"successActionButtonUrl"}},{"kind":"Field","name":{"kind":"Name","value":"successActionButtonLabel"}},{"kind":"Field","name":{"kind":"Name","value":"newsletterLabelTextCode"}},{"kind":"Field","name":{"kind":"Name","value":"newsletterSlug"}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode; +export const ServicesWithCapabilitiesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ServicesWithCapabilities"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"services"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"pagination"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"500"}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"oauthClientId"}},{"kind":"Field","name":{"kind":"Name","value":"capabilities"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"slug"}}]}}]}}]}}]} as unknown as DocumentNode; \ No newline at end of file diff --git a/libs/shared/cms/src/__generated__/index.ts b/libs/shared/cms/src/__generated__/index.ts index c682b1e2f9..f51599168f 100644 --- a/libs/shared/cms/src/__generated__/index.ts +++ b/libs/shared/cms/src/__generated__/index.ts @@ -1,2 +1,2 @@ -export * from './fragment-masking'; -export * from './gql'; +export * from "./fragment-masking"; +export * from "./gql"; \ No newline at end of file diff --git a/libs/shared/cms/src/index.ts b/libs/shared/cms/src/index.ts index 343293944a..c33b9bce21 100644 --- a/libs/shared/cms/src/index.ts +++ b/libs/shared/cms/src/index.ts @@ -4,7 +4,6 @@ export * from './lib/cms.error'; export * from './lib/constants'; -export * from './lib/factories'; export * from './lib/product-configuration.manager'; export * from './lib/queries/capability-service-by-plan-ids'; export * from './lib/queries/eligibility-content-by-offering'; diff --git a/libs/shared/cms/src/lib/factories.ts b/libs/shared/cms/src/lib/factories.ts deleted file mode 100644 index 62ff1cf281..0000000000 --- a/libs/shared/cms/src/lib/factories.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* 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 { ApolloQueryResult, NetworkStatus } from '@apollo/client'; -import { faker } from '@faker-js/faker'; -import { TypedDocumentNode } from '@graphql-typed-document-node/core'; -import { ContentfulErrorResponse } from './types'; - -/** - * Generates a graphql response from the contentful client based on the passed query. - * Use one of the query factories to provide data for the factory result. - * - * @param query The query to generate a result for - * @param data The result of a QueryFactory matching the query passed - */ -export const ContentfulClientQueryFactory = ( - query: TypedDocumentNode, - data: Result, - override?: ApolloQueryResult -): ApolloQueryResult => ({ - data: data, // Must be used to negotiate the type inference for Result - loading: false, - networkStatus: NetworkStatus.ready, - ...override, -}); - -export const ContentfulCDNErrorFactory = ( - override?: ContentfulErrorResponse -): ContentfulErrorResponse => ({ - sys: { type: 'Error', id: faker.string.alpha() }, - message: faker.string.alpha(), - requestId: faker.string.uuid(), - ...override, -}); - -export const StrapiEntityFactory = (attributes: T) => { - return { - attributes, - }; -}; diff --git a/libs/shared/cms/src/lib/product-configuration.manager.spec.ts b/libs/shared/cms/src/lib/product-configuration.manager.spec.ts index bee0050e97..8130eb13c3 100644 --- a/libs/shared/cms/src/lib/product-configuration.manager.spec.ts +++ b/libs/shared/cms/src/lib/product-configuration.manager.spec.ts @@ -15,20 +15,16 @@ import { import { MockFirestoreProvider } from '@fxa/shared/db/firestore'; import { MockStatsDProvider, StatsDService } from '@fxa/shared/metrics/statsd'; import { - CapabilityPurchaseResult, CapabilityPurchaseResultFactory, CapabilityServiceByPlanIdsQueryFactory, CapabilityServiceByPlanIdsResultUtil, EligibilityContentByOfferingResultUtil, EligibilityContentByPlanIdsQueryFactory, EligibilityContentByPlanIdsResultUtil, - EligibilityPurchaseResult, EligibilityPurchaseResultFactory, ProductConfigError, ServicesWithCapabilitiesQueryFactory, ServicesWithCapabilitiesResultUtil, - StrapiEntity, - StrapiEntityFactory, } from '../../src'; import { ProductConfigurationManager } from './product-configuration.manager'; import { @@ -88,14 +84,7 @@ describe('productConfigurationManager', () => { it('should call statsd for incoming events', async () => { const queryData = EligibilityContentByPlanIdsQueryFactory({ - purchases: { - data: [], - meta: { - pagination: { - total: 0, - }, - }, - }, + purchases: [], }); jest.spyOn(strapiClient.client, 'request').mockResolvedValue(queryData); jest.spyOn(mockStatsd, 'timing'); @@ -139,7 +128,7 @@ describe('productConfigurationManager', () => { describe('getEligibilityContentByOffering', () => { it('should return empty result', async () => { const queryData = EligibilityContentByOfferingQueryFactory({ - offerings: { data: [] }, + offerings: [], }); jest.spyOn(strapiClient, 'query').mockResolvedValue(queryData); @@ -154,14 +143,10 @@ describe('productConfigurationManager', () => { it('should return successfully with results', async () => { const apiIdentifier = 'test'; const offeringResult = [ - StrapiEntityFactory( - EligibilityContentOfferingResultFactory({ apiIdentifier }) - ), + EligibilityContentOfferingResultFactory({ apiIdentifier }), ]; const queryData = EligibilityContentByOfferingQueryFactory({ - offerings: { - data: offeringResult, - }, + offerings: offeringResult, }); jest.spyOn(strapiClient, 'query').mockResolvedValue(queryData); @@ -178,7 +163,7 @@ describe('productConfigurationManager', () => { describe('getPageContentForOffering', () => { it('should return empty result', async () => { const queryData = PageContentForOfferingQueryFactory({ - offerings: { data: [], meta: { pagination: { total: 0 } } }, + offerings: [], }); jest.spyOn(strapiClient, 'query').mockResolvedValue(queryData); @@ -190,23 +175,16 @@ describe('productConfigurationManager', () => { 'en' ); expect(result).toBeInstanceOf(PageContentForOfferingResultUtil); - expect(result.offerings.data).toHaveLength(0); + expect(result.offerings).toHaveLength(0); }); it('should return successfully with page content for offering', async () => { const apiIdentifier = 'test'; - const offeringResult = [ - StrapiEntityFactory( - PageContentOfferingResultFactory({ - apiIdentifier, - }) - ), - ]; + const offeringResult = PageContentOfferingResultFactory({ + apiIdentifier, + }); const queryData = PageContentForOfferingQueryFactory({ - offerings: { - data: offeringResult, - meta: { pagination: { total: offeringResult.length } }, - }, + offerings: [offeringResult], }); jest.spyOn(strapiClient, 'query').mockResolvedValue(queryData); @@ -218,23 +196,14 @@ describe('productConfigurationManager', () => { 'en' ); expect(result).toBeInstanceOf(PageContentForOfferingResultUtil); - expect( - result.getOffering().defaultPurchase.data.attributes.purchaseDetails - .data.attributes - ).toEqual({ + expect(result.getOffering().defaultPurchase.purchaseDetails).toEqual({ ...result.purchaseDetailsTransform( - offeringResult[0].attributes.defaultPurchase?.data.attributes - .purchaseDetails.data.attributes + offeringResult.defaultPurchase?.purchaseDetails ), - localizations: { - data: offeringResult[0].attributes.defaultPurchase?.data.attributes.purchaseDetails.data.attributes.localizations.data.map( - (localization) => ({ - attributes: result.purchaseDetailsTransform( - localization.attributes - ), - }) + localizations: + offeringResult.defaultPurchase.purchaseDetails.localizations.map( + (localization) => result.purchaseDetailsTransform(localization) ), - }, }); }); }); @@ -242,14 +211,7 @@ describe('productConfigurationManager', () => { describe('getPurchaseDetailsForEligibility', () => { it('should return empty result', async () => { const queryData = EligibilityContentByPlanIdsQueryFactory({ - purchases: { - data: [], - meta: { - pagination: { - total: 0, - }, - }, - }, + purchases: [], }); jest.spyOn(strapiClient, 'query').mockResolvedValue(queryData); @@ -260,27 +222,18 @@ describe('productConfigurationManager', () => { ]); expect(result).toBeInstanceOf(EligibilityContentByPlanIdsResultUtil); expect(result.offeringForPlanId('test')).toBeUndefined; - expect(result.purchases.data).toHaveLength(0); + expect(result.purchases).toHaveLength(0); }); it('should return successfully with subgroups and offering', async () => { const planId = 'test'; const purchaseResult = [ - StrapiEntityFactory( - EligibilityPurchaseResultFactory({ - stripePlanChoices: [{ stripePlanChoice: planId }], - }) - ), + EligibilityPurchaseResultFactory({ + stripePlanChoices: [{ stripePlanChoice: planId }], + }), ]; const queryData = EligibilityContentByPlanIdsQueryFactory({ - purchases: { - data: purchaseResult, - meta: { - pagination: { - total: purchaseResult.length, - }, - }, - }, + purchases: purchaseResult, }); jest.spyOn(strapiClient, 'query').mockResolvedValue(queryData); @@ -290,27 +243,17 @@ describe('productConfigurationManager', () => { 'test', ]); expect(result).toBeInstanceOf(EligibilityContentByPlanIdsResultUtil); - expect(result.offeringForPlanId(planId)?.subGroups.data).toHaveLength(1); + expect(result.offeringForPlanId(planId)?.subGroups).toHaveLength(1); expect(result.offeringForPlanId(planId)).toBeDefined(); }); - it('should return successfully with paging', async () => { - const pageSize = 20; - const purchaseResult: StrapiEntity[] = []; - for (let i = 0; i < pageSize + 1; i += 1) { - purchaseResult.push( - StrapiEntityFactory(EligibilityPurchaseResultFactory()) - ); - } + it('should return successfully', async () => { + const purchaseResult = [ + EligibilityPurchaseResultFactory(), + EligibilityPurchaseResultFactory(), + ]; const queryData = EligibilityContentByPlanIdsQueryFactory({ - purchases: { - data: purchaseResult, - meta: { - pagination: { - total: purchaseResult.length, - }, - }, - }, + purchases: purchaseResult, }); jest.spyOn(strapiClient, 'query').mockResolvedValue(queryData); @@ -320,21 +263,14 @@ describe('productConfigurationManager', () => { 'test', ]); expect(result).toBeInstanceOf(EligibilityContentByPlanIdsResultUtil); - expect(strapiClient.query).toBeCalledTimes(2); + expect(strapiClient.query).toBeCalledTimes(1); }); }); describe('getPurchaseDetailsForCapabilityServiceByPlanId', () => { it('should return empty result', async () => { const queryData = CapabilityServiceByPlanIdsQueryFactory({ - purchases: { - data: [], - meta: { - pagination: { - total: 0, - }, - }, - }, + purchases: [], }); jest.spyOn(strapiClient, 'query').mockResolvedValue(queryData); @@ -349,22 +285,11 @@ describe('productConfigurationManager', () => { it('should return successfully with results', async () => { const planId = 'test'; - const purchaseResult = [ - StrapiEntityFactory( - CapabilityPurchaseResultFactory({ - stripePlanChoices: [{ stripePlanChoice: planId }], - }) - ), - ]; + const purchaseResult = CapabilityPurchaseResultFactory({ + stripePlanChoices: [{ stripePlanChoice: planId }], + }); const queryData = CapabilityServiceByPlanIdsQueryFactory({ - purchases: { - data: purchaseResult, - meta: { - pagination: { - total: purchaseResult.length, - }, - }, - }, + purchases: [purchaseResult], }); jest.spyOn(strapiClient, 'query').mockResolvedValue(queryData); @@ -377,23 +302,13 @@ describe('productConfigurationManager', () => { expect(result.capabilityOfferingForPlanId(planId)).toBeDefined(); }); - it('should return successfully with paging', async () => { - const pageSize = 20; - const purchaseResult: StrapiEntity[] = []; - for (let i = 0; i < pageSize + 1; i += 1) { - purchaseResult.push( - StrapiEntityFactory(CapabilityPurchaseResultFactory()) - ); - } + it('should return successfully', async () => { + const purchaseResult = [ + CapabilityPurchaseResultFactory(), + CapabilityPurchaseResultFactory(), + ]; const queryData = CapabilityServiceByPlanIdsQueryFactory({ - purchases: { - data: purchaseResult, - meta: { - pagination: { - total: purchaseResult.length, - }, - }, - }, + purchases: purchaseResult, }); jest.spyOn(strapiClient, 'query').mockResolvedValue(queryData); @@ -403,23 +318,21 @@ describe('productConfigurationManager', () => { ['test'] ); expect(result).toBeInstanceOf(CapabilityServiceByPlanIdsResultUtil); - expect(strapiClient.query).toBeCalledTimes(2); + expect(strapiClient.query).toBeCalledTimes(1); }); }); describe('getServicesWithCapabilities', () => { it('should return results', async () => { const queryData = ServicesWithCapabilitiesQueryFactory({ - services: { - data: [], - }, + services: [], }); jest.spyOn(strapiClient, 'query').mockResolvedValue(queryData); const result = await productConfigurationManager.getServicesWithCapabilities(); expect(result).toBeInstanceOf(ServicesWithCapabilitiesResultUtil); - expect(result.services.data).toHaveLength(0); + expect(result.services).toHaveLength(0); }); it('should return successfully with services and capabilities', async () => { @@ -430,7 +343,7 @@ describe('productConfigurationManager', () => { const result = await productConfigurationManager.getServicesWithCapabilities(); expect(result).toBeInstanceOf(ServicesWithCapabilitiesResultUtil); - expect(result.services.data).toHaveLength(1); + expect(result.services).toHaveLength(1); }); }); @@ -438,7 +351,7 @@ describe('productConfigurationManager', () => { it('should return empty result', async () => { const queryData = PurchaseWithDetailsOfferingContentByPlanIdsResultFactory({ - purchases: { data: [] }, + purchases: [], }); jest.spyOn(strapiClient, 'query').mockResolvedValue(queryData); jest.spyOn(strapiClient, 'getLocale').mockResolvedValue('en'); @@ -449,13 +362,13 @@ describe('productConfigurationManager', () => { 'en' ); expect(result).toBeInstanceOf(PurchaseWithDetailsOfferingContentUtil); - expect(result.purchases.data).toHaveLength(0); + expect(result.purchases).toHaveLength(0); }); it('should return successfully with purchase details and offering', async () => { const queryData = PurchaseWithDetailsOfferingContentByPlanIdsResultFactory(); - const queryDataItem = queryData.purchases.data[0]; + const queryDataItem = queryData.purchases[0]; jest.spyOn(strapiClient, 'query').mockResolvedValue(queryData); jest.spyOn(strapiClient, 'getLocale').mockResolvedValue('en'); @@ -465,31 +378,22 @@ describe('productConfigurationManager', () => { ['test'], 'en' ); - const { stripePlanChoice } = - result.purchases.data[0].attributes.stripePlanChoices?.[0]; + const { stripePlanChoice } = result.purchases[0].stripePlanChoices?.[0]; expect(result).toBeInstanceOf(PurchaseWithDetailsOfferingContentUtil); expect( result.transformedPurchaseWithCommonContentForPlanId( stripePlanChoice ?? '' )?.offering - ).toEqual(queryDataItem.attributes.offering); + ).toEqual(queryDataItem.offering); expect( result.transformedPurchaseWithCommonContentForPlanId( stripePlanChoice ?? '' - )?.purchaseDetails.data.attributes + )?.purchaseDetails ).toEqual({ - ...result.purchaseDetailsTransform( - queryDataItem.attributes.purchaseDetails.data.attributes + ...result.purchaseDetailsTransform(queryDataItem.purchaseDetails), + localizations: queryDataItem.purchaseDetails.localizations.map( + (localization) => result.purchaseDetailsTransform(localization) ), - localizations: { - data: queryDataItem.attributes.purchaseDetails.data.attributes.localizations.data.map( - (localization) => ({ - attributes: result.purchaseDetailsTransform( - localization.attributes - ), - }) - ), - }, }); }); }); @@ -500,11 +404,7 @@ describe('productConfigurationManager', () => { const mockPlan = StripePlanFactory(); const mockOffering = EligibilityContentOfferingResultFactory({ defaultPurchase: { - data: { - attributes: { - stripePlanChoices: [{ stripePlanChoice: mockPlan.id }], - }, - }, + stripePlanChoices: [{ stripePlanChoice: mockPlan.id }], }, }); const mockOfferingResult = {} as EligibilityContentByOfferingResultUtil; @@ -528,11 +428,7 @@ describe('productConfigurationManager', () => { const mockInterval = SubplatInterval.Monthly; const mockOffering = EligibilityContentOfferingResultFactory({ defaultPurchase: { - data: { - attributes: { - stripePlanChoices: [{ stripePlanChoice: mockPrice.id }], - }, - }, + stripePlanChoices: [{ stripePlanChoice: mockPrice.id }], }, }); diff --git a/libs/shared/cms/src/lib/product-configuration.manager.ts b/libs/shared/cms/src/lib/product-configuration.manager.ts index 79327b24a0..bb21ceebe0 100644 --- a/libs/shared/cms/src/lib/product-configuration.manager.ts +++ b/libs/shared/cms/src/lib/product-configuration.manager.ts @@ -112,66 +112,39 @@ export class ProductConfigurationManager { async getPurchaseDetailsForCapabilityServiceByPlanIds( stripePlanIds: string[] ): Promise { - let total: number | undefined; - let count = 0; - const queryResults: DeepNonNullable[] = []; - const pageSize = 20; + const queryResult = await this.strapiClient.query( + capabilityServiceByPlanIdsQuery, + { + locale: DEFAULT_LOCALE, + stripePlanIds, + } + ); - while (total === undefined || count < total) { - const queryResult = (await this.strapiClient.query( - capabilityServiceByPlanIdsQuery, - { - skip: count, - limit: pageSize, - locale: DEFAULT_LOCALE, - stripePlanIds, - } - )) as DeepNonNullable; - - queryResults.push(queryResult); - count += pageSize; - total = queryResult.purchases.meta.pagination.total; - } - - return new CapabilityServiceByPlanIdsResultUtil(queryResults); + return new CapabilityServiceByPlanIdsResultUtil( + queryResult as DeepNonNullable + ); } async getPurchaseDetailsForEligibility( stripePlanIds: string[] ): Promise { - let total: number | undefined; - let count = 0; - const queryResults: DeepNonNullable[] = - []; - const pageSize = 20; + const queryResult = await this.strapiClient.query( + eligibilityContentByPlanIdsQuery, + { + locale: DEFAULT_LOCALE, + stripePlanIds, + } + ); - while (total === undefined || count < total) { - const queryResult = (await this.strapiClient.query( - eligibilityContentByPlanIdsQuery, - { - skip: count, - limit: pageSize, - locale: DEFAULT_LOCALE, - stripePlanIds, - } - )) as DeepNonNullable; - - queryResults.push(queryResult); - count += pageSize; - total = queryResult.purchases.meta.pagination.total; - } - - return new EligibilityContentByPlanIdsResultUtil(queryResults); + return new EligibilityContentByPlanIdsResultUtil( + queryResult as DeepNonNullable + ); } async getServicesWithCapabilities(): Promise { const queryResult = await this.strapiClient.query( servicesWithCapabilitiesQuery, - { - skip: 0, - limit: 100, - locale: DEFAULT_LOCALE, - } + {} ); return new ServicesWithCapabilitiesResultUtil( @@ -184,30 +157,18 @@ export class ProductConfigurationManager { acceptLanguage: string ): Promise { const locale = await this.strapiClient.getLocale(acceptLanguage); - const queryResults: DeepNonNullable[] = - []; - const stripePlans: string[][] = []; - // reduce query size by making multiple calls to CMS - for (let i = 0; i < stripePlanIds.length; i += 100) { - stripePlans.push(stripePlanIds.slice(i, i + 100)); - } + const queryResult = await this.strapiClient.query( + purchaseWithDetailsOfferingContentQuery, + { + locale, + stripePlanIds, + } + ); - while (stripePlans.length > 0) { - const queryResult = (await this.strapiClient.query( - purchaseWithDetailsOfferingContentQuery, - { - skip: 0, - limit: 100, - locale, - stripePlanIds: stripePlans[0], - } - )) as DeepNonNullable; - queryResults.push(queryResult); - stripePlans.shift(); - } - - return new PurchaseWithDetailsOfferingContentUtil(queryResults); + return new PurchaseWithDetailsOfferingContentUtil( + queryResult as DeepNonNullable + ); } async getOfferingPlanIds(apiIdentifier: string) { @@ -215,10 +176,9 @@ export class ProductConfigurationManager { apiIdentifier ); const offering = offeringResult.getOffering(); - const planIds = - offering.defaultPurchase.data.attributes.stripePlanChoices.map( - (el) => el.stripePlanChoice - ); + const planIds = offering.defaultPurchase.stripePlanChoices.map( + (el) => el.stripePlanChoice + ); return planIds; } diff --git a/libs/shared/cms/src/lib/queries/capability-service-by-plan-ids/factories.ts b/libs/shared/cms/src/lib/queries/capability-service-by-plan-ids/factories.ts index dfe82f260f..8a666b5943 100644 --- a/libs/shared/cms/src/lib/queries/capability-service-by-plan-ids/factories.ts +++ b/libs/shared/cms/src/lib/queries/capability-service-by-plan-ids/factories.ts @@ -11,21 +11,12 @@ import { CapabilityCapabilitiesResult, CapabilityServicesResult, } from '.'; -import { StrapiEntityFactory } from '../../factories'; export const CapabilityServiceByPlanIdsQueryFactory = ( override?: Partial ): CapabilityServiceByPlanIdsQuery => { - const data = [StrapiEntityFactory(CapabilityPurchaseResultFactory())]; return { - purchases: { - meta: { - pagination: { - total: data.length, - }, - }, - data, - }, + purchases: [CapabilityPurchaseResultFactory()], ...override, }; }; @@ -38,9 +29,7 @@ export const CapabilityPurchaseResultFactory = ( stripePlanChoice: faker.string.sample(), }, ], - offering: { - data: StrapiEntityFactory(CapabilityOfferingResultFactory()), - }, + offering: CapabilityOfferingResultFactory(), ...override, }); @@ -53,9 +42,7 @@ export const CapabilityOfferingResultFactory = ( stripeLegacyPlan: faker.string.alpha(10), }) ), - capabilities: { - data: [StrapiEntityFactory(CapabilityCapabilitiesResultFactory())], - }, + capabilities: [CapabilityCapabilitiesResultFactory()], ...override, }); @@ -63,9 +50,7 @@ export const CapabilityCapabilitiesResultFactory = ( override?: Partial ): CapabilityCapabilitiesResult => ({ slug: faker.string.sample(), - services: { - data: [StrapiEntityFactory(CapabilityServicesResultFactory())], - }, + services: [CapabilityServicesResultFactory()], ...override, }); diff --git a/libs/shared/cms/src/lib/queries/capability-service-by-plan-ids/query.ts b/libs/shared/cms/src/lib/queries/capability-service-by-plan-ids/query.ts index 6a3cdec52e..d9b575e860 100644 --- a/libs/shared/cms/src/lib/queries/capability-service-by-plan-ids/query.ts +++ b/libs/shared/cms/src/lib/queries/capability-service-by-plan-ids/query.ts @@ -5,11 +5,7 @@ import { graphql } from '../../../__generated__/gql'; export const capabilityServiceByPlanIdsQuery = graphql(` - query CapabilityServiceByPlanIds( - $skip: Int! - $limit: Int! - $stripePlanIds: [String]! - ) { + query CapabilityServiceByPlanIds($stripePlanIds: [String]!) { purchases( filters: { or: [ @@ -21,40 +17,19 @@ export const capabilityServiceByPlanIdsQuery = graphql(` } ] } - pagination: { start: $skip, limit: $limit } + pagination: { limit: 200 } ) { - meta { - pagination { - total - } + stripePlanChoices { + stripePlanChoice } - data { - attributes { - stripePlanChoices { - stripePlanChoice - } - offering { - data { - attributes { - stripeLegacyPlans(pagination: { limit: 200 }) { - stripeLegacyPlan - } - capabilities { - data { - attributes { - slug - services { - data { - attributes { - oauthClientId - } - } - } - } - } - } - } - } + offering { + stripeLegacyPlans(pagination: { limit: 200 }) { + stripeLegacyPlan + } + capabilities { + slug + services { + oauthClientId } } } diff --git a/libs/shared/cms/src/lib/queries/capability-service-by-plan-ids/types.ts b/libs/shared/cms/src/lib/queries/capability-service-by-plan-ids/types.ts index c7c3ceaf51..deb936e7d1 100644 --- a/libs/shared/cms/src/lib/queries/capability-service-by-plan-ids/types.ts +++ b/libs/shared/cms/src/lib/queries/capability-service-by-plan-ids/types.ts @@ -2,44 +2,29 @@ * 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 { StrapiEntity } from '../../types'; - export interface CapabilityServicesResult { oauthClientId: string; } export interface CapabilityCapabilitiesResult { slug: string; - services: { - data: StrapiEntity[]; - }; + services: CapabilityServicesResult[]; } export interface CapabilityOfferingResult { stripeLegacyPlans: { stripeLegacyPlan: string; }[]; - capabilities: { - data: StrapiEntity[]; - }; + capabilities: CapabilityCapabilitiesResult[]; } export interface CapabilityPurchaseResult { stripePlanChoices: { stripePlanChoice: string; }[]; - offering: { - data: StrapiEntity; - }; + offering: CapabilityOfferingResult; } export interface CapabilityServiceByPlanIdsResult { - purchases: { - meta: { - pagination: { - total: number; - }; - }; - data: StrapiEntity[]; - }; + purchases: CapabilityPurchaseResult[]; } diff --git a/libs/shared/cms/src/lib/queries/capability-service-by-plan-ids/util.spec.ts b/libs/shared/cms/src/lib/queries/capability-service-by-plan-ids/util.spec.ts index cab5f46a2c..2fa7aad5e0 100644 --- a/libs/shared/cms/src/lib/queries/capability-service-by-plan-ids/util.spec.ts +++ b/libs/shared/cms/src/lib/queries/capability-service-by-plan-ids/util.spec.ts @@ -9,15 +9,12 @@ import { CapabilityServiceByPlanIdsResultUtil } from './util'; describe('CapabilityServiceByPlanIdsResultUtil', () => { it('should create a util from response', () => { const result = CapabilityServiceByPlanIdsQueryFactory(); - const purchase = result.purchases?.data[0]; - const planId = purchase?.attributes?.stripePlanChoices?.[0]; - const legacyPlanId = - purchase?.attributes?.offering?.data?.attributes?.stripeLegacyPlans?.[0]; - const result2 = CapabilityServiceByPlanIdsQueryFactory(); - const util = new CapabilityServiceByPlanIdsResultUtil([ - result as CapabilityServiceByPlanIdsResult, - result2 as CapabilityServiceByPlanIdsResult, - ]); + const purchase = result.purchases[0]; + const planId = purchase?.stripePlanChoices?.[0]; + const legacyPlanId = purchase?.offering?.stripeLegacyPlans?.[0]; + const util = new CapabilityServiceByPlanIdsResultUtil( + result as CapabilityServiceByPlanIdsResult + ); expect(util).toBeDefined(); expect( diff --git a/libs/shared/cms/src/lib/queries/capability-service-by-plan-ids/util.ts b/libs/shared/cms/src/lib/queries/capability-service-by-plan-ids/util.ts index 4af8b54234..73ff6b9ef7 100644 --- a/libs/shared/cms/src/lib/queries/capability-service-by-plan-ids/util.ts +++ b/libs/shared/cms/src/lib/queries/capability-service-by-plan-ids/util.ts @@ -11,20 +11,15 @@ import { export class CapabilityServiceByPlanIdsResultUtil { private purchaseByPlanId: Record = {}; - constructor(rawResults: CapabilityServiceByPlanIdsResult[]) { - for (const rawResult of rawResults) { - for (const purchase of rawResult.purchases.data) { - purchase.attributes.stripePlanChoices?.forEach( - ({ stripePlanChoice }) => { - this.purchaseByPlanId[stripePlanChoice] = purchase.attributes; - } - ); + constructor(rawResult: CapabilityServiceByPlanIdsResult) { + for (const purchase of rawResult.purchases) { + for (const stripePlanChoice of purchase.stripePlanChoices ?? []) { + this.purchaseByPlanId[stripePlanChoice.stripePlanChoice] = purchase; + } - purchase.attributes.offering.data.attributes.stripeLegacyPlans?.forEach( - ({ stripeLegacyPlan }) => { - this.purchaseByPlanId[stripeLegacyPlan] = purchase.attributes; - } - ); + for (const stripeLegacyPlan of purchase.offering.stripeLegacyPlans ?? + []) { + this.purchaseByPlanId[stripeLegacyPlan.stripeLegacyPlan] = purchase; } } } @@ -32,6 +27,6 @@ export class CapabilityServiceByPlanIdsResultUtil { capabilityOfferingForPlanId( planId: string ): CapabilityOfferingResult | undefined { - return this.purchaseByPlanId[planId]?.offering.data.attributes; + return this.purchaseByPlanId[planId]?.offering; } } diff --git a/libs/shared/cms/src/lib/queries/eligibility-content-by-offering/factories.ts b/libs/shared/cms/src/lib/queries/eligibility-content-by-offering/factories.ts index 74edac482a..e2adc0daae 100644 --- a/libs/shared/cms/src/lib/queries/eligibility-content-by-offering/factories.ts +++ b/libs/shared/cms/src/lib/queries/eligibility-content-by-offering/factories.ts @@ -11,15 +11,12 @@ import { EligibilityContentSubgroupResult, EligibilityContentByOfferingResult, } from '.'; -import { StrapiEntityFactory } from '../../factories'; export const EligibilityContentByOfferingQueryFactory = ( override?: Partial ): EligibilityContentByOfferingQuery => { return { - offerings: { - data: [StrapiEntityFactory(EligibilityContentOfferingResultFactory())], - }, + offerings: [EligibilityContentOfferingResultFactory()], ...override, }; }; @@ -28,9 +25,7 @@ export const EligibilityContentByOfferingResultFactory = ( override?: Partial ): EligibilityContentByOfferingResult => { return { - offerings: { - data: [StrapiEntityFactory(EligibilityContentOfferingResultFactory())], - }, + offerings: [EligibilityContentOfferingResultFactory()], ...override, }; }; @@ -41,17 +36,13 @@ export const EligibilityContentOfferingResultFactory = ( apiIdentifier: faker.string.sample(), stripeProductId: faker.string.sample(), defaultPurchase: { - data: StrapiEntityFactory({ - stripePlanChoices: [ - { - stripePlanChoice: faker.string.sample(), - }, - ], - }), - }, - subGroups: { - data: [StrapiEntityFactory(EligibilityContentSubgroupResultFactory())], + stripePlanChoices: [ + { + stripePlanChoice: faker.string.sample(), + }, + ], }, + subGroups: [EligibilityContentSubgroupResultFactory()], ...override, }); @@ -59,23 +50,7 @@ export const EligibilityContentSubgroupResultFactory = ( override?: Partial ): EligibilityContentSubgroupResult => ({ groupName: faker.string.sample(), - offerings: { - data: [ - StrapiEntityFactory({ - apiIdentifier: faker.string.sample(), - stripeProductId: faker.string.sample(), - defaultPurchase: { - data: StrapiEntityFactory({ - stripePlanChoices: [ - { - stripePlanChoice: faker.string.sample(), - }, - ], - }), - }, - }), - ], - }, + offerings: [EligibilityContentSubgroupOfferingResultFactory()], ...override, }); @@ -85,13 +60,11 @@ export const EligibilityContentSubgroupOfferingResultFactory = ( apiIdentifier: faker.string.sample(), stripeProductId: faker.string.sample(), defaultPurchase: { - data: StrapiEntityFactory({ - stripePlanChoices: [ - { - stripePlanChoice: faker.string.sample(), - }, - ], - }), + stripePlanChoices: [ + { + stripePlanChoice: faker.string.sample(), + }, + ], }, ...override, }); diff --git a/libs/shared/cms/src/lib/queries/eligibility-content-by-offering/query.ts b/libs/shared/cms/src/lib/queries/eligibility-content-by-offering/query.ts index 96d2df4e56..322c0edb8e 100644 --- a/libs/shared/cms/src/lib/queries/eligibility-content-by-offering/query.ts +++ b/libs/shared/cms/src/lib/queries/eligibility-content-by-offering/query.ts @@ -7,44 +7,24 @@ import { graphql } from '../../../__generated__/gql'; export const eligibilityContentByOfferingQuery = graphql(` query EligibilityContentByOffering($apiIdentifier: String!) { offerings( - pagination: { start: 0, limit: 2 } filters: { apiIdentifier: { eq: $apiIdentifier } } + pagination: { limit: 200 } ) { - data { - attributes { + apiIdentifier + stripeProductId + defaultPurchase { + stripePlanChoices { + stripePlanChoice + } + } + subGroups { + groupName + offerings { apiIdentifier stripeProductId defaultPurchase { - data { - attributes { - stripePlanChoices { - stripePlanChoice - } - } - } - } - subGroups { - data { - attributes { - groupName - offerings { - data { - attributes { - apiIdentifier - stripeProductId - defaultPurchase { - data { - attributes { - stripePlanChoices { - stripePlanChoice - } - } - } - } - } - } - } - } + stripePlanChoices { + stripePlanChoice } } } diff --git a/libs/shared/cms/src/lib/queries/eligibility-content-by-offering/types.ts b/libs/shared/cms/src/lib/queries/eligibility-content-by-offering/types.ts index 154558b316..0ba4038370 100644 --- a/libs/shared/cms/src/lib/queries/eligibility-content-by-offering/types.ts +++ b/libs/shared/cms/src/lib/queries/eligibility-content-by-offering/types.ts @@ -2,43 +2,32 @@ * 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 { StrapiEntity } from '../../types'; - export interface EligibilityContentSubgroupOfferingResult { apiIdentifier: string; stripeProductId: string; defaultPurchase: { - data: StrapiEntity<{ - stripePlanChoices: { - stripePlanChoice: string; - }[]; - }>; + stripePlanChoices: { + stripePlanChoice: string; + }[]; }; } export interface EligibilityContentSubgroupResult { groupName: string; - offerings: { - data: StrapiEntity[]; - }; + offerings: EligibilityContentSubgroupOfferingResult[]; } export interface EligibilityContentOfferingResult { apiIdentifier: string; stripeProductId: string; defaultPurchase: { - data: StrapiEntity<{ - stripePlanChoices: { - stripePlanChoice: string; - }[]; - }>; - }; - subGroups: { - data: StrapiEntity[]; + stripePlanChoices: { + stripePlanChoice: string; + }[]; }; + subGroups: EligibilityContentSubgroupResult[]; } + export interface EligibilityContentByOfferingResult { - offerings: { - data: StrapiEntity[]; - }; + offerings: EligibilityContentOfferingResult[]; } diff --git a/libs/shared/cms/src/lib/queries/eligibility-content-by-offering/util.spec.ts b/libs/shared/cms/src/lib/queries/eligibility-content-by-offering/util.spec.ts index a3ddfab039..a07ffbf4de 100644 --- a/libs/shared/cms/src/lib/queries/eligibility-content-by-offering/util.spec.ts +++ b/libs/shared/cms/src/lib/queries/eligibility-content-by-offering/util.spec.ts @@ -8,7 +8,6 @@ import { EligibilityContentByOfferingResultUtil, EligibilityContentOfferingResultFactory, } from '.'; -import { StrapiEntityFactory } from '../../factories'; describe('EligibilityByOfferingResultUtil', () => { it('should create a util from response', () => { @@ -18,12 +17,12 @@ describe('EligibilityByOfferingResultUtil', () => { ); expect(util).toBeDefined(); expect(util.getOffering()).toBeDefined(); - expect(util.offerings.data).toHaveLength(1); + expect(util.offerings).toHaveLength(1); }); it('returns empty if no offering is returned', () => { const result = EligibilityContentByOfferingQueryFactory({ - offerings: { data: [] }, + offerings: [], }); const util = new EligibilityContentByOfferingResultUtil( result as EligibilityContentByOfferingResult @@ -34,12 +33,12 @@ describe('EligibilityByOfferingResultUtil', () => { }); it('throws error if more than offering is returned', () => { - const data = [ - StrapiEntityFactory(EligibilityContentOfferingResultFactory()), - StrapiEntityFactory(EligibilityContentOfferingResultFactory()), + const offerings = [ + EligibilityContentOfferingResultFactory(), + EligibilityContentOfferingResultFactory(), ]; const result = EligibilityContentByOfferingQueryFactory({ - offerings: { data }, + offerings, }); const util = new EligibilityContentByOfferingResultUtil( result as EligibilityContentByOfferingResult diff --git a/libs/shared/cms/src/lib/queries/eligibility-content-by-offering/util.ts b/libs/shared/cms/src/lib/queries/eligibility-content-by-offering/util.ts index fc28fb2824..e23de2841d 100644 --- a/libs/shared/cms/src/lib/queries/eligibility-content-by-offering/util.ts +++ b/libs/shared/cms/src/lib/queries/eligibility-content-by-offering/util.ts @@ -11,11 +11,11 @@ export class EligibilityContentByOfferingResultUtil { constructor(private rawResult: EligibilityContentByOfferingResult) {} getOffering(): EligibilityContentOfferingResult { - const offering = this.offerings.data.at(0); + const offering = this.offerings.at(0); if (!offering) throw Error('getOffering - No offering exists'); - if (this.offerings.data.length > 1) + if (this.offerings.length > 1) throw Error('getOffering - More than one offering'); - return offering.attributes; + return offering; } get offerings(): EligibilityContentByOfferingResult['offerings'] { diff --git a/libs/shared/cms/src/lib/queries/eligibility-content-by-plan-ids/factories.ts b/libs/shared/cms/src/lib/queries/eligibility-content-by-plan-ids/factories.ts index 243e995199..b2b1c63294 100644 --- a/libs/shared/cms/src/lib/queries/eligibility-content-by-plan-ids/factories.ts +++ b/libs/shared/cms/src/lib/queries/eligibility-content-by-plan-ids/factories.ts @@ -12,21 +12,12 @@ import { EligibilitySubgroupResult, type EligibilityContentByPlanIdsResult, } from '.'; -import { StrapiEntityFactory } from '../../factories'; export const EligibilityContentByPlanIdsQueryFactory = ( override?: Partial ): EligibilityContentByPlanIdsQuery => { - const data = [StrapiEntityFactory(EligibilityPurchaseResultFactory())]; return { - purchases: { - meta: { - pagination: { - total: data.length, - }, - }, - data, - }, + purchases: [EligibilityPurchaseResultFactory()], ...override, }; }; @@ -34,16 +25,8 @@ export const EligibilityContentByPlanIdsQueryFactory = ( export const EligibilityContentByPlanIdsResultFactory = ( override?: Partial ): EligibilityContentByPlanIdsResult => { - const data = [StrapiEntityFactory(EligibilityPurchaseResultFactory())]; return { - purchases: { - meta: { - pagination: { - total: data.length, - }, - }, - data, - }, + purchases: [EligibilityPurchaseResultFactory()], ...override, }; }; @@ -56,9 +39,7 @@ export const EligibilityPurchaseResultFactory = ( stripePlanChoice: faker.string.sample(), }, ], - offering: { - data: StrapiEntityFactory(EligibilityOfferingResultFactory()), - }, + offering: EligibilityOfferingResultFactory(), ...override, }); @@ -73,9 +54,7 @@ export const EligibilityOfferingResultFactory = ( }) ), countries: [faker.string.sample()], - subGroups: { - data: [StrapiEntityFactory(EligibilitySubgroupResultFactory())], - }, + subGroups: [EligibilitySubgroupResultFactory()], ...override, }); @@ -83,9 +62,7 @@ export const EligibilitySubgroupResultFactory = ( override?: Partial ): EligibilitySubgroupResult => ({ groupName: faker.string.sample(), - offerings: { - data: [StrapiEntityFactory(EligibilitySubgroupOfferingResultFactory())], - }, + offerings: [EligibilitySubgroupOfferingResultFactory()], ...override, }); diff --git a/libs/shared/cms/src/lib/queries/eligibility-content-by-plan-ids/query.ts b/libs/shared/cms/src/lib/queries/eligibility-content-by-plan-ids/query.ts index bc276f21de..9871bab128 100644 --- a/libs/shared/cms/src/lib/queries/eligibility-content-by-plan-ids/query.ts +++ b/libs/shared/cms/src/lib/queries/eligibility-content-by-plan-ids/query.ts @@ -5,13 +5,8 @@ import { graphql } from '../../../__generated__/gql'; export const eligibilityContentByPlanIdsQuery = graphql(` - query EligibilityContentByPlanIds( - $skip: Int! - $limit: Int! - $stripePlanIds: [String]! - ) { + query EligibilityContentByPlanIds($stripePlanIds: [String]!) { purchases( - pagination: { start: $skip, limit: $limit } filters: { or: [ { stripePlanChoices: { stripePlanChoice: { in: $stripePlanIds } } } @@ -22,45 +17,25 @@ export const eligibilityContentByPlanIdsQuery = graphql(` } ] } + pagination: { limit: 200 } ) { - meta { - pagination { - total - } + stripePlanChoices { + stripePlanChoice } - data { - attributes { - stripePlanChoices { - stripePlanChoice - } - offering { - data { - attributes { - stripeProductId - stripeLegacyPlans(pagination: { limit: 200 }) { - stripeLegacyPlan - } - countries - subGroups { - data { - attributes { - groupName - offerings { - data { - attributes { - stripeProductId - stripeLegacyPlans(pagination: { limit: 200 }) { - stripeLegacyPlan - } - countries - } - } - } - } - } - } - } + offering { + stripeProductId + stripeLegacyPlans(pagination: { limit: 200 }) { + stripeLegacyPlan + } + countries + subGroups { + groupName + offerings { + stripeProductId + stripeLegacyPlans(pagination: { limit: 200 }) { + stripeLegacyPlan } + countries } } } diff --git a/libs/shared/cms/src/lib/queries/eligibility-content-by-plan-ids/types.ts b/libs/shared/cms/src/lib/queries/eligibility-content-by-plan-ids/types.ts index ce542abd46..1bafdde6e4 100644 --- a/libs/shared/cms/src/lib/queries/eligibility-content-by-plan-ids/types.ts +++ b/libs/shared/cms/src/lib/queries/eligibility-content-by-plan-ids/types.ts @@ -2,8 +2,6 @@ * 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 { StrapiEntity } from '../../types'; - export interface EligibilitySubgroupOfferingResult { stripeProductId: string; stripeLegacyPlans: { @@ -14,9 +12,7 @@ export interface EligibilitySubgroupOfferingResult { export interface EligibilitySubgroupResult { groupName: string; - offerings: { - data: StrapiEntity[]; - }; + offerings: EligibilitySubgroupOfferingResult[]; } export interface EligibilityOfferingResult { @@ -25,27 +21,16 @@ export interface EligibilityOfferingResult { stripeLegacyPlan: string; }[]; countries: string[]; - subGroups: { - data: StrapiEntity[]; - }; + subGroups: EligibilitySubgroupResult[]; } export interface EligibilityPurchaseResult { stripePlanChoices: { stripePlanChoice: string; }[]; - offering: { - data: StrapiEntity; - }; + offering: EligibilityOfferingResult; } export interface EligibilityContentByPlanIdsResult { - purchases: { - meta: { - pagination: { - total: number; - }; - }; - data: StrapiEntity[]; - }; + purchases: EligibilityPurchaseResult[]; } diff --git a/libs/shared/cms/src/lib/queries/eligibility-content-by-plan-ids/util.spec.ts b/libs/shared/cms/src/lib/queries/eligibility-content-by-plan-ids/util.spec.ts index 4fe327fcf5..91543e310e 100644 --- a/libs/shared/cms/src/lib/queries/eligibility-content-by-plan-ids/util.spec.ts +++ b/libs/shared/cms/src/lib/queries/eligibility-content-by-plan-ids/util.spec.ts @@ -11,13 +11,12 @@ import { describe('EligibilityContentByPlanIdsResultUtil', () => { it('should create a util from response', () => { const result = EligibilityContentByPlanIdsQueryFactory(); - const purchase = result.purchases?.data[0]; - const planId = purchase?.attributes?.stripePlanChoices?.[0]; - const legacyPlanId = - purchase?.attributes?.offering?.data?.attributes?.stripeLegacyPlans?.[0]; - const util = new EligibilityContentByPlanIdsResultUtil([ - result as EligibilityContentByPlanIdsResult, - ]); + const purchase = result.purchases[0]; + const planId = purchase?.stripePlanChoices?.[0]; + const legacyPlanId = purchase?.offering?.stripeLegacyPlans?.[0]; + const util = new EligibilityContentByPlanIdsResultUtil( + result as EligibilityContentByPlanIdsResult + ); expect(util).toBeDefined(); expect( util.offeringForPlanId(planId?.stripePlanChoice ?? '')?.stripeProductId @@ -26,6 +25,6 @@ describe('EligibilityContentByPlanIdsResultUtil', () => { util.offeringForPlanId(legacyPlanId?.stripeLegacyPlan ?? '') ?.stripeProductId ).toBeDefined(); - expect(util.purchases.data.length).toBe(1); + expect(util.purchases.length).toBe(1); }); }); diff --git a/libs/shared/cms/src/lib/queries/eligibility-content-by-plan-ids/util.ts b/libs/shared/cms/src/lib/queries/eligibility-content-by-plan-ids/util.ts index bcfd0b22ed..82558dce70 100644 --- a/libs/shared/cms/src/lib/queries/eligibility-content-by-plan-ids/util.ts +++ b/libs/shared/cms/src/lib/queries/eligibility-content-by-plan-ids/util.ts @@ -11,45 +11,23 @@ import { export class EligibilityContentByPlanIdsResultUtil { private purchaseByPlanId: Record = {}; - constructor(private rawResults: EligibilityContentByPlanIdsResult[]) { - for (const rawResult of rawResults) { - for (const purchase of rawResult.purchases.data) { - purchase.attributes.stripePlanChoices?.forEach( - ({ stripePlanChoice }) => { - this.purchaseByPlanId[stripePlanChoice] = purchase.attributes; - } - ); + constructor(private rawResult: EligibilityContentByPlanIdsResult) { + for (const purchase of rawResult.purchases) { + purchase.stripePlanChoices?.forEach(({ stripePlanChoice }) => { + this.purchaseByPlanId[stripePlanChoice] = purchase; + }); - purchase.attributes.offering.data.attributes.stripeLegacyPlans?.forEach( - ({ stripeLegacyPlan }) => { - this.purchaseByPlanId[stripeLegacyPlan] = purchase.attributes; - } - ); - } + purchase.offering.stripeLegacyPlans?.forEach(({ stripeLegacyPlan }) => { + this.purchaseByPlanId[stripeLegacyPlan] = purchase; + }); } } offeringForPlanId(planId: string): EligibilityOfferingResult | undefined { - return this.purchaseByPlanId[planId]?.offering.data.attributes; + return this.purchaseByPlanId[planId]?.offering; } - get purchases(): EligibilityContentByPlanIdsResult['purchases'] { - return { - meta: { - pagination: { - total: this.rawResults - .map((rawResult) => rawResult.purchases.meta.pagination.total) - .reduce((acc, curr) => acc + curr, 0), - }, - }, - data: [ - ...new Map( - this.rawResults - .map((rawResult) => rawResult.purchases.data) - .flat() - .map((res) => [JSON.stringify(res), res]) - ).values(), - ], - }; + get purchases(): EligibilityPurchaseResult[] { + return this.rawResult.purchases; } } diff --git a/libs/shared/cms/src/lib/queries/locales/factories.ts b/libs/shared/cms/src/lib/queries/locales/factories.ts index 4134c7e83b..1970a4ee09 100644 --- a/libs/shared/cms/src/lib/queries/locales/factories.ts +++ b/libs/shared/cms/src/lib/queries/locales/factories.ts @@ -5,14 +5,11 @@ import { faker } from '@faker-js/faker'; import { Locale, LocalesResult } from '.'; -import { StrapiEntityFactory } from '../../factories'; export const LocalesResultFactory = ( override?: Partial ): LocalesResult => ({ - i18NLocales: { - data: [StrapiEntityFactory(LocaleFactory())], - }, + i18NLocales: [LocaleFactory()], ...override, }); diff --git a/libs/shared/cms/src/lib/queries/locales/query.ts b/libs/shared/cms/src/lib/queries/locales/query.ts index d2079912c5..6003c13a9c 100644 --- a/libs/shared/cms/src/lib/queries/locales/query.ts +++ b/libs/shared/cms/src/lib/queries/locales/query.ts @@ -7,11 +7,7 @@ import { graphql } from '../../../__generated__/gql'; export const localesQuery = graphql(` query Locales { i18NLocales { - data { - attributes { - code - } - } + code } } `); diff --git a/libs/shared/cms/src/lib/queries/locales/types.ts b/libs/shared/cms/src/lib/queries/locales/types.ts index 69e60ae750..9d614c5105 100644 --- a/libs/shared/cms/src/lib/queries/locales/types.ts +++ b/libs/shared/cms/src/lib/queries/locales/types.ts @@ -2,14 +2,10 @@ * 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 { StrapiEntity } from '../../types'; - export interface Locale { code: string; } export interface LocalesResult { - i18NLocales: { - data: StrapiEntity[]; - }; + i18NLocales: Locale[]; } diff --git a/libs/shared/cms/src/lib/queries/offering/factories.ts b/libs/shared/cms/src/lib/queries/offering/factories.ts index 014168c1c1..f441f95d09 100644 --- a/libs/shared/cms/src/lib/queries/offering/factories.ts +++ b/libs/shared/cms/src/lib/queries/offering/factories.ts @@ -10,14 +10,11 @@ import { OfferingDefaultPurchaseResult, OfferingResult, } from '.'; -import { StrapiEntityFactory } from '../../factories'; export const OfferingQueryFactory = ( override?: Partial ): OfferingQuery => ({ - offering: { - data: StrapiEntityFactory(OfferingResultFactory()), - }, + offering: OfferingResultFactory(), ...override, }); @@ -27,9 +24,7 @@ export const OfferingResultFactory = ( return { stripeProductId: faker.string.sample(), countries: [faker.string.sample()], - defaultPurchase: { - data: StrapiEntityFactory(OfferingDefaultPurchaseResultFactory()), - }, + defaultPurchase: OfferingDefaultPurchaseResultFactory(), ...override, }; }; @@ -38,12 +33,8 @@ export const OfferingDefaultPurchaseResultFactory = ( override?: Partial ): OfferingDefaultPurchaseResult => ({ purchaseDetails: { - data: StrapiEntityFactory({ - ...OfferingPurchaseResultFactory(), - localizations: { - data: [StrapiEntityFactory(OfferingPurchaseResultFactory())], - }, - }), + ...OfferingPurchaseResultFactory(), + localizations: [OfferingPurchaseResultFactory()], }, ...override, }); diff --git a/libs/shared/cms/src/lib/queries/offering/query.ts b/libs/shared/cms/src/lib/queries/offering/query.ts index 972038e6d7..1b1892d56a 100644 --- a/libs/shared/cms/src/lib/queries/offering/query.ts +++ b/libs/shared/cms/src/lib/queries/offering/query.ts @@ -6,36 +6,20 @@ import { graphql } from '../../../__generated__/gql'; export const offeringQuery = graphql(` query Offering($id: ID!, $locale: String!) { - offering(id: $id) { - data { - attributes { - stripeProductId - countries - defaultPurchase { - data { - attributes { - purchaseDetails { - data { - attributes { - productName - details - subtitle - webIcon - localizations(filters: { locale: { eq: $locale } }) { - data { - attributes { - productName - details - subtitle - webIcon - } - } - } - } - } - } - } - } + offering(documentId: $id) { + stripeProductId + countries + defaultPurchase { + purchaseDetails { + productName + details + subtitle + webIcon + localizations(filters: { locale: { eq: $locale } }) { + productName + details + subtitle + webIcon } } } diff --git a/libs/shared/cms/src/lib/queries/offering/types.ts b/libs/shared/cms/src/lib/queries/offering/types.ts index 9e61c4e694..99c40eedb2 100644 --- a/libs/shared/cms/src/lib/queries/offering/types.ts +++ b/libs/shared/cms/src/lib/queries/offering/types.ts @@ -2,8 +2,6 @@ * 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 { StrapiEntity } from '../../types'; - export interface OfferingPurchaseResult { productName: string; details: string; @@ -12,21 +10,13 @@ export interface OfferingPurchaseResult { } export interface OfferingDefaultPurchaseResult { - purchaseDetails: { - data: StrapiEntity< - OfferingPurchaseResult & { - localizations: { - data: StrapiEntity[]; - }; - } - >; + purchaseDetails: OfferingPurchaseResult & { + localizations: OfferingPurchaseResult[]; }; } export interface OfferingResult { stripeProductId: string; countries: string[]; - defaultPurchase: { - data: StrapiEntity; - }; + defaultPurchase: OfferingDefaultPurchaseResult; } diff --git a/libs/shared/cms/src/lib/queries/page-content-for-offering/factories.ts b/libs/shared/cms/src/lib/queries/page-content-for-offering/factories.ts index eb9f372475..d97a5ffead 100644 --- a/libs/shared/cms/src/lib/queries/page-content-for-offering/factories.ts +++ b/libs/shared/cms/src/lib/queries/page-content-for-offering/factories.ts @@ -15,19 +15,11 @@ import { PageContentPurchaseDetailsResult, PageContentPurchaseDetailsTransformed, } from '.'; -import { StrapiEntityFactory } from '../../factories'; export const PageContentForOfferingQueryFactory = ( override?: Partial ): PageContentForOfferingQuery => ({ - offerings: { - meta: { - pagination: { - total: 1, - }, - }, - data: [StrapiEntityFactory(PageContentOfferingResultFactory())], - }, + offerings: [PageContentOfferingResultFactory()], ...override, }); @@ -35,12 +27,8 @@ export const PageContentOfferingDefaultPurchaseResultFactory = ( override?: Partial ): PageContentOfferingDefaultPurchaseResult => ({ purchaseDetails: { - data: StrapiEntityFactory({ - ...PageContentPurchaseDetailsResultFactory(), - localizations: { - data: [StrapiEntityFactory(PageContentPurchaseDetailsResultFactory())], - }, - }), + ...PageContentPurchaseDetailsResultFactory(), + localizations: [PageContentPurchaseDetailsResultFactory()], }, ...override, }); @@ -49,14 +37,8 @@ export const PageContentOfferingDefaultPurchaseTransformedFactory = ( override?: Partial ): PageContentOfferingDefaultPurchaseTransformed => ({ purchaseDetails: { - data: StrapiEntityFactory({ - ...PageContentPurchaseDetailsTransformedFactory(), - localizations: { - data: [ - StrapiEntityFactory(PageContentPurchaseDetailsTransformedFactory()), - ], - }, - }), + ...PageContentPurchaseDetailsTransformedFactory(), + localizations: [PageContentPurchaseDetailsTransformedFactory()], }, ...override, }); @@ -66,25 +48,10 @@ export const PageContentOfferingResultFactory = ( ): PageContentOfferingResult => ({ apiIdentifier: faker.string.sample(), stripeProductId: faker.string.sample(), - defaultPurchase: { - data: StrapiEntityFactory({ - ...PageContentOfferingDefaultPurchaseResultFactory(), - localizations: { - data: [ - StrapiEntityFactory( - PageContentOfferingDefaultPurchaseResultFactory() - ), - ], - }, - }), - }, + defaultPurchase: PageContentOfferingDefaultPurchaseResultFactory(), commonContent: { - data: StrapiEntityFactory({ - ...PageContentCommonContentResultFactory(), - localizations: { - data: [StrapiEntityFactory(PageContentCommonContentResultFactory())], - }, - }), + ...PageContentCommonContentResultFactory(), + localizations: [PageContentCommonContentResultFactory()], }, ...override, }); @@ -93,18 +60,7 @@ export const PageContentOfferingTransformedFactory = ( override?: Partial ): PageContentOfferingTransformed => ({ ...PageContentOfferingResultFactory(), - defaultPurchase: { - data: StrapiEntityFactory({ - ...PageContentOfferingDefaultPurchaseTransformedFactory(), - localizations: { - data: [ - StrapiEntityFactory( - PageContentOfferingDefaultPurchaseTransformedFactory() - ), - ], - }, - }), - }, + defaultPurchase: PageContentOfferingDefaultPurchaseTransformedFactory(), ...override, }); diff --git a/libs/shared/cms/src/lib/queries/page-content-for-offering/query.ts b/libs/shared/cms/src/lib/queries/page-content-for-offering/query.ts index 10264c278d..5ac8a4c25f 100644 --- a/libs/shared/cms/src/lib/queries/page-content-for-offering/query.ts +++ b/libs/shared/cms/src/lib/queries/page-content-for-offering/query.ts @@ -7,76 +7,47 @@ import { graphql } from '../../../__generated__/gql'; export const pageContentForOfferingQuery = graphql(` query PageContentForOffering($locale: String!, $apiIdentifier: String!) { offerings( - pagination: { start: 0, limit: 2 } filters: { apiIdentifier: { eq: $apiIdentifier } } + pagination: { limit: 200 } ) { - meta { - pagination { - total + apiIdentifier + stripeProductId + defaultPurchase { + purchaseDetails { + details + productName + subtitle + webIcon + localizations(filters: { locale: { eq: $locale } }) { + details + productName + subtitle + webIcon + } } } - data { - attributes { - apiIdentifier - stripeProductId - defaultPurchase { - data { - attributes { - purchaseDetails { - data { - attributes { - details - productName - subtitle - webIcon - localizations(filters: { locale: { eq: $locale } }) { - data { - attributes { - details - productName - subtitle - webIcon - } - } - } - } - } - } - } - } - } - commonContent { - data { - attributes { - privacyNoticeUrl - privacyNoticeDownloadUrl - termsOfServiceUrl - termsOfServiceDownloadUrl - cancellationUrl - emailIcon - successActionButtonUrl - successActionButtonLabel - newsletterLabelTextCode - newsletterSlug - localizations(filters: { locale: { eq: $locale } }) { - data { - attributes { - privacyNoticeUrl - privacyNoticeDownloadUrl - termsOfServiceUrl - termsOfServiceDownloadUrl - cancellationUrl - emailIcon - successActionButtonUrl - successActionButtonLabel - newsletterLabelTextCode - newsletterSlug - } - } - } - } - } - } + commonContent { + privacyNoticeUrl + privacyNoticeDownloadUrl + termsOfServiceUrl + termsOfServiceDownloadUrl + cancellationUrl + emailIcon + successActionButtonUrl + successActionButtonLabel + newsletterLabelTextCode + newsletterSlug + localizations(filters: { locale: { eq: $locale } }) { + privacyNoticeUrl + privacyNoticeDownloadUrl + termsOfServiceUrl + termsOfServiceDownloadUrl + cancellationUrl + emailIcon + successActionButtonUrl + successActionButtonLabel + newsletterLabelTextCode + newsletterSlug } } } diff --git a/libs/shared/cms/src/lib/queries/page-content-for-offering/types.ts b/libs/shared/cms/src/lib/queries/page-content-for-offering/types.ts index 4a7ea3d130..cfe8b80614 100644 --- a/libs/shared/cms/src/lib/queries/page-content-for-offering/types.ts +++ b/libs/shared/cms/src/lib/queries/page-content-for-offering/types.ts @@ -2,8 +2,6 @@ * 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 { StrapiEntity } from '../../types'; - export interface PageContentCommonContentResult { privacyNoticeUrl: string; privacyNoticeDownloadUrl: string; @@ -30,60 +28,31 @@ export interface PageContentPurchaseDetailsTransformed } export interface PageContentOfferingDefaultPurchaseResult { - purchaseDetails: { - data: StrapiEntity< - PageContentPurchaseDetailsResult & { - localizations: { - data: StrapiEntity[]; - }; - } - >; + purchaseDetails: PageContentPurchaseDetailsResult & { + localizations: PageContentPurchaseDetailsResult[]; }; } export interface PageContentOfferingDefaultPurchaseTransformed { - purchaseDetails: { - data: StrapiEntity< - PageContentPurchaseDetailsTransformed & { - localizations: { - data: StrapiEntity[]; - }; - } - >; + purchaseDetails: PageContentPurchaseDetailsTransformed & { + localizations: PageContentPurchaseDetailsTransformed[]; }; } export interface PageContentOfferingTransformed extends Omit { - defaultPurchase: { - data: StrapiEntity; - }; + defaultPurchase: PageContentOfferingDefaultPurchaseTransformed; } export interface PageContentOfferingResult { apiIdentifier: string; stripeProductId: string; - defaultPurchase: { - data: StrapiEntity; - }; - commonContent: { - data: StrapiEntity< - PageContentCommonContentResult & { - localizations: { - data: StrapiEntity[]; - }; - } - >; + defaultPurchase: PageContentOfferingDefaultPurchaseResult; + commonContent: PageContentCommonContentResult & { + localizations: PageContentCommonContentResult[]; }; } export interface PageContentForOfferingResult { - offerings: { - meta: { - pagination: { - total: number; - }; - }; - data: StrapiEntity[]; - }; + offerings: PageContentOfferingResult[]; } diff --git a/libs/shared/cms/src/lib/queries/page-content-for-offering/util.spec.ts b/libs/shared/cms/src/lib/queries/page-content-for-offering/util.spec.ts index a2342570a7..49a8e6e185 100644 --- a/libs/shared/cms/src/lib/queries/page-content-for-offering/util.spec.ts +++ b/libs/shared/cms/src/lib/queries/page-content-for-offering/util.spec.ts @@ -16,7 +16,7 @@ describe('PageContentForOfferingUtil', () => { result as PageContentForOfferingResult ); expect(util).toBeDefined(); - expect(util.offerings.data).toHaveLength(1); + expect(util.offerings).toHaveLength(1); }); describe('transformPageContentPurchaseDetails', () => { diff --git a/libs/shared/cms/src/lib/queries/page-content-for-offering/util.ts b/libs/shared/cms/src/lib/queries/page-content-for-offering/util.ts index 5b549c41fb..b55a8ba27c 100644 --- a/libs/shared/cms/src/lib/queries/page-content-for-offering/util.ts +++ b/libs/shared/cms/src/lib/queries/page-content-for-offering/util.ts @@ -17,36 +17,22 @@ export class PageContentForOfferingResultUtil { } getOffering(): PageContentOfferingTransformed { - const offering = this.offerings.data.at(0); + const offering = this.offerings.at(0); if (!offering) throw Error('getOffering - No offering exists'); - if (this.offerings.data.length > 1) + if (this.offerings.length > 1) throw Error('getOffering - More than one offering'); return { - ...offering.attributes, + ...offering, defaultPurchase: { - data: { - attributes: { - purchaseDetails: { - data: { - attributes: { - ...this.purchaseDetailsTransform( - offering.attributes.defaultPurchase.data.attributes - .purchaseDetails.data.attributes - ), - localizations: { - data: offering.attributes.defaultPurchase.data.attributes.purchaseDetails.data.attributes.localizations.data.map( - (localization) => ({ - attributes: this.purchaseDetailsTransform( - localization.attributes - ), - }) - ), - }, - }, - }, - }, - }, + purchaseDetails: { + ...this.purchaseDetailsTransform( + offering.defaultPurchase.purchaseDetails + ), + localizations: + offering.defaultPurchase.purchaseDetails.localizations.map( + (localization) => this.purchaseDetailsTransform(localization) + ), }, }, }; diff --git a/libs/shared/cms/src/lib/queries/purchase-with-details-offering-content/factories.ts b/libs/shared/cms/src/lib/queries/purchase-with-details-offering-content/factories.ts index b684c9d166..fb51816b64 100644 --- a/libs/shared/cms/src/lib/queries/purchase-with-details-offering-content/factories.ts +++ b/libs/shared/cms/src/lib/queries/purchase-with-details-offering-content/factories.ts @@ -11,7 +11,6 @@ import { PurchaseWithDetailsOfferingContentResult, PurchaseWithDetailsOfferingContentTransformed, } from './types'; -import { StrapiEntityFactory } from '../../factories'; export const PurchaseDetailsResultFactory = ( override?: Partial @@ -69,12 +68,8 @@ export const PurchaseOfferingResultFactory = ( }) ), commonContent: { - data: StrapiEntityFactory({ - ...OfferingCommonContentResultFactory(), - localizations: { - data: [StrapiEntityFactory(OfferingCommonContentResultFactory())], - }, - }), + ...OfferingCommonContentResultFactory(), + localizations: [OfferingCommonContentResultFactory()], }, ...override, }); @@ -89,16 +84,10 @@ export const PurchaseWithDetailsOfferingContentResultFactory = ( }) ), purchaseDetails: { - data: StrapiEntityFactory({ - ...PurchaseDetailsResultFactory(), - localizations: { - data: [StrapiEntityFactory(PurchaseDetailsResultFactory())], - }, - }), - }, - offering: { - data: StrapiEntityFactory(PurchaseOfferingResultFactory()), + ...PurchaseDetailsResultFactory(), + localizations: [PurchaseDetailsResultFactory()], }, + offering: PurchaseOfferingResultFactory(), ...override, }); @@ -107,12 +96,8 @@ export const PurchaseWithDetailsOfferingContentTransformedFactory = ( ): PurchaseWithDetailsOfferingContentTransformed => ({ ...PurchaseWithDetailsOfferingContentResultFactory(), purchaseDetails: { - data: StrapiEntityFactory({ - ...PurchaseDetailsTransformedFactory(), - localizations: { - data: [StrapiEntityFactory(PurchaseDetailsTransformedFactory())], - }, - }), + ...PurchaseDetailsTransformedFactory(), + localizations: [PurchaseDetailsTransformedFactory()], }, ...override, }); @@ -120,10 +105,6 @@ export const PurchaseWithDetailsOfferingContentTransformedFactory = ( export const PurchaseWithDetailsOfferingContentByPlanIdsResultFactory = ( override?: Partial ): PurchaseWithDetailsOfferingContentByPlanIdsResult => ({ - purchases: { - data: [ - StrapiEntityFactory(PurchaseWithDetailsOfferingContentResultFactory()), - ], - }, + purchases: [PurchaseWithDetailsOfferingContentResultFactory()], ...override, }); diff --git a/libs/shared/cms/src/lib/queries/purchase-with-details-offering-content/query.ts b/libs/shared/cms/src/lib/queries/purchase-with-details-offering-content/query.ts index 091f2c14ff..cfc5712baf 100644 --- a/libs/shared/cms/src/lib/queries/purchase-with-details-offering-content/query.ts +++ b/libs/shared/cms/src/lib/queries/purchase-with-details-offering-content/query.ts @@ -5,13 +5,10 @@ import { graphql } from '../../../__generated__/gql'; export const purchaseWithDetailsOfferingContentQuery = graphql(` query PurchaseWithDetailsOfferingContent( - $skip: Int! - $limit: Int! $locale: String! $stripePlanIds: [String]! ) { purchases( - pagination: { start: $skip, limit: $limit } filters: { or: [ { stripePlanChoices: { stripePlanChoice: { in: $stripePlanIds } } } @@ -22,73 +19,50 @@ export const purchaseWithDetailsOfferingContentQuery = graphql(` } ] } + pagination: { limit: 500 } ) { - data { - attributes { - stripePlanChoices { - stripePlanChoice - } - purchaseDetails { - data { - attributes { - details - productName - subtitle - webIcon - localizations(filters: { locale: { eq: $locale } }) { - data { - attributes { - details - productName - subtitle - webIcon - } - } - } - } - } - } - offering { - data { - attributes { - stripeProductId - stripeLegacyPlans(pagination: { limit: 200 }) { - stripeLegacyPlan - } - commonContent { - data { - attributes { - privacyNoticeUrl - privacyNoticeDownloadUrl - termsOfServiceUrl - termsOfServiceDownloadUrl - cancellationUrl - emailIcon - successActionButtonUrl - successActionButtonLabel - newsletterLabelTextCode - newsletterSlug - localizations(filters: { locale: { eq: $locale } }) { - data { - attributes { - privacyNoticeUrl - privacyNoticeDownloadUrl - termsOfServiceUrl - termsOfServiceDownloadUrl - cancellationUrl - emailIcon - successActionButtonUrl - successActionButtonLabel - newsletterLabelTextCode - newsletterSlug - } - } - } - } - } - } - } - } + stripePlanChoices { + stripePlanChoice + } + purchaseDetails { + details + productName + subtitle + webIcon + localizations(filters: { locale: { eq: $locale } }) { + details + productName + subtitle + webIcon + } + } + offering { + stripeProductId + stripeLegacyPlans(pagination: { limit: 200 }) { + stripeLegacyPlan + } + commonContent { + privacyNoticeUrl + privacyNoticeDownloadUrl + termsOfServiceUrl + termsOfServiceDownloadUrl + cancellationUrl + emailIcon + successActionButtonUrl + successActionButtonLabel + newsletterLabelTextCode + newsletterSlug + localizations(filters: { locale: { eq: $locale } }) { + privacyNoticeUrl + privacyNoticeDownloadUrl + termsOfServiceUrl + termsOfServiceDownloadUrl + cancellationUrl + emailIcon + successActionButtonUrl + successActionButtonLabel + newsletterLabelTextCode + newsletterSlug } } } diff --git a/libs/shared/cms/src/lib/queries/purchase-with-details-offering-content/types.ts b/libs/shared/cms/src/lib/queries/purchase-with-details-offering-content/types.ts index 2a67ff62d0..9b90528e77 100644 --- a/libs/shared/cms/src/lib/queries/purchase-with-details-offering-content/types.ts +++ b/libs/shared/cms/src/lib/queries/purchase-with-details-offering-content/types.ts @@ -2,8 +2,6 @@ * 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 { StrapiEntity } from '../../types'; - export interface PurchaseDetailsResult { details: string; productName: string; @@ -34,14 +32,8 @@ export interface PurchaseOfferingResult { stripeLegacyPlans: { stripeLegacyPlan: string; }[]; - commonContent: { - data: StrapiEntity< - OfferingCommonContentResult & { - localizations: { - data: StrapiEntity[]; - }; - } - >; + commonContent: OfferingCommonContentResult & { + localizations: OfferingCommonContentResult[]; }; } @@ -49,35 +41,19 @@ export interface PurchaseWithDetailsOfferingContentResult { stripePlanChoices: { stripePlanChoice: string; }[]; - purchaseDetails: { - data: StrapiEntity< - PurchaseDetailsResult & { - localizations: { - data: StrapiEntity[]; - }; - } - >; - }; - offering: { - data: StrapiEntity; + purchaseDetails: PurchaseDetailsResult & { + localizations: PurchaseDetailsResult[]; }; + offering: PurchaseOfferingResult; } export interface PurchaseWithDetailsOfferingContentTransformed extends Omit { - purchaseDetails: { - data: StrapiEntity< - PurchaseDetailsTransformed & { - localizations: { - data: StrapiEntity[]; - }; - } - >; + purchaseDetails: PurchaseDetailsTransformed & { + localizations: PurchaseDetailsTransformed[]; }; } export interface PurchaseWithDetailsOfferingContentByPlanIdsResult { - purchases: { - data: StrapiEntity[]; - }; + purchases: PurchaseWithDetailsOfferingContentResult[]; } diff --git a/libs/shared/cms/src/lib/queries/purchase-with-details-offering-content/util.spec.ts b/libs/shared/cms/src/lib/queries/purchase-with-details-offering-content/util.spec.ts index 6f28897b4a..bc80b06eb2 100644 --- a/libs/shared/cms/src/lib/queries/purchase-with-details-offering-content/util.spec.ts +++ b/libs/shared/cms/src/lib/queries/purchase-with-details-offering-content/util.spec.ts @@ -5,42 +5,34 @@ import { PurchaseDetailsResultFactory, PurchaseWithDetailsOfferingContentByPlanIdsResultFactory, } from './factories'; -import { PurchaseWithDetailsOfferingContentByPlanIdsResult } from './types'; import { PurchaseWithDetailsOfferingContentUtil } from './util'; describe('PurchaseWithDetailsOfferingContentUtil', () => { it('should create a util from response', () => { const result = PurchaseWithDetailsOfferingContentByPlanIdsResultFactory(); - const result2 = PurchaseWithDetailsOfferingContentByPlanIdsResultFactory(); - const purchase = result.purchases?.data[0]; - const planId = purchase.attributes.stripePlanChoices?.[0]; - const legacyPlanId = - purchase.attributes.offering.data.attributes.stripeLegacyPlans?.[0]; - const util = new PurchaseWithDetailsOfferingContentUtil([ - result as PurchaseWithDetailsOfferingContentByPlanIdsResult, - result2 as PurchaseWithDetailsOfferingContentByPlanIdsResult, - ]); + const purchase = result.purchases[0]; + const planId = purchase.stripePlanChoices?.[0]; + const legacyPlanId = purchase.offering.stripeLegacyPlans?.[0]; + const util = new PurchaseWithDetailsOfferingContentUtil(result); expect(util).toBeDefined(); expect( util.transformedPurchaseWithCommonContentForPlanId( planId.stripePlanChoice ?? '' - )?.offering.data.attributes.stripeProductId + )?.offering.stripeProductId ).toBeDefined(); expect( util.transformedPurchaseWithCommonContentForPlanId( legacyPlanId.stripeLegacyPlan ?? '' - )?.offering.data.attributes.stripeProductId + )?.offering.stripeProductId ).toBeDefined(); - expect(util.purchases.data.length).toBe(2); + expect(util.purchases.length).toBe(1); }); describe('transformPurchaseDetails', () => { let util: PurchaseWithDetailsOfferingContentUtil; beforeAll(() => { const result = PurchaseWithDetailsOfferingContentByPlanIdsResultFactory(); - util = new PurchaseWithDetailsOfferingContentUtil([ - result as PurchaseWithDetailsOfferingContentByPlanIdsResult, - ]); + util = new PurchaseWithDetailsOfferingContentUtil(result); }); it('should transform details', () => { diff --git a/libs/shared/cms/src/lib/queries/purchase-with-details-offering-content/util.ts b/libs/shared/cms/src/lib/queries/purchase-with-details-offering-content/util.ts index 3555cff99f..304c8d0456 100644 --- a/libs/shared/cms/src/lib/queries/purchase-with-details-offering-content/util.ts +++ b/libs/shared/cms/src/lib/queries/purchase-with-details-offering-content/util.ts @@ -15,61 +15,31 @@ export class PurchaseWithDetailsOfferingContentUtil { > = {}; constructor( - private rawResults: PurchaseWithDetailsOfferingContentByPlanIdsResult[] + private rawResult: PurchaseWithDetailsOfferingContentByPlanIdsResult ) { - for (const rawResult of rawResults) { - for (const purchase of rawResult.purchases.data) { - purchase.attributes.stripePlanChoices?.forEach( - ({ stripePlanChoice }) => { - this.transformedPurchaseByPlanId[stripePlanChoice] = { - ...purchase.attributes, - purchaseDetails: { - data: { - attributes: { - ...this.purchaseDetailsTransform( - purchase.attributes.purchaseDetails.data.attributes - ), - localizations: { - data: purchase.attributes.purchaseDetails.data.attributes.localizations.data.map( - (localization) => ({ - attributes: this.purchaseDetailsTransform( - localization.attributes - ), - }) - ), - }, - }, - }, - }, - }; - } - ); - purchase.attributes.offering.data.attributes.stripeLegacyPlans?.forEach( - ({ stripeLegacyPlan }) => { - this.transformedPurchaseByPlanId[stripeLegacyPlan] = { - ...purchase.attributes, - purchaseDetails: { - data: { - attributes: { - ...this.purchaseDetailsTransform( - purchase.attributes.purchaseDetails.data.attributes - ), - localizations: { - data: purchase.attributes.purchaseDetails.data.attributes.localizations.data.map( - (localization) => ({ - attributes: this.purchaseDetailsTransform( - localization.attributes - ), - }) - ), - }, - }, - }, - }, - }; - } - ); - } + for (const purchase of rawResult.purchases) { + purchase.stripePlanChoices?.forEach(({ stripePlanChoice }) => { + this.transformedPurchaseByPlanId[stripePlanChoice] = { + ...purchase, + purchaseDetails: { + ...this.purchaseDetailsTransform(purchase.purchaseDetails), + localizations: purchase.purchaseDetails.localizations.map( + (localization) => this.purchaseDetailsTransform(localization) + ), + }, + }; + }); + purchase.offering.stripeLegacyPlans?.forEach(({ stripeLegacyPlan }) => { + this.transformedPurchaseByPlanId[stripeLegacyPlan] = { + ...purchase, + purchaseDetails: { + ...this.purchaseDetailsTransform(purchase.purchaseDetails), + localizations: purchase.purchaseDetails.localizations.map( + (localization) => this.purchaseDetailsTransform(localization) + ), + }, + }; + }); } } @@ -93,17 +63,6 @@ export class PurchaseWithDetailsOfferingContentUtil { } get purchases(): PurchaseWithDetailsOfferingContentByPlanIdsResult['purchases'] { - // Deduplicating items as there could be duplicates from splitting up the - // stripePlanIds and making multiple CMS calls - return { - data: [ - ...new Map( - this.rawResults - .map((rawResult) => rawResult.purchases.data) - .flat() - .map((res) => [JSON.stringify(res), res]) - ).values(), - ], - }; + return this.rawResult.purchases; } } diff --git a/libs/shared/cms/src/lib/queries/services-with-capabilities/factories.ts b/libs/shared/cms/src/lib/queries/services-with-capabilities/factories.ts index 7acf140bd8..3cd2120f59 100644 --- a/libs/shared/cms/src/lib/queries/services-with-capabilities/factories.ts +++ b/libs/shared/cms/src/lib/queries/services-with-capabilities/factories.ts @@ -6,14 +6,11 @@ import { faker } from '@faker-js/faker'; import { ServicesWithCapabilitiesQuery } from '../../../__generated__/graphql'; import { CapabilitiesResult, ServiceResult } from '.'; -import { StrapiEntityFactory } from '../../factories'; export const ServicesWithCapabilitiesQueryFactory = ( override?: Partial ): ServicesWithCapabilitiesQuery => ({ - services: { - data: [StrapiEntityFactory(ServiceResultFactory())], - }, + services: [ServiceResultFactory()], ...override, }); @@ -21,9 +18,7 @@ export const ServiceResultFactory = ( override?: Partial ): ServiceResult => ({ oauthClientId: faker.string.sample(), - capabilities: { - data: [StrapiEntityFactory(CapabilitiesResultFactory())], - }, + capabilities: [CapabilitiesResultFactory()], ...override, }); diff --git a/libs/shared/cms/src/lib/queries/services-with-capabilities/query.ts b/libs/shared/cms/src/lib/queries/services-with-capabilities/query.ts index 17922da1c8..5655147cfb 100644 --- a/libs/shared/cms/src/lib/queries/services-with-capabilities/query.ts +++ b/libs/shared/cms/src/lib/queries/services-with-capabilities/query.ts @@ -5,19 +5,11 @@ import { graphql } from '../../../__generated__/gql'; export const servicesWithCapabilitiesQuery = graphql(` - query ServicesWithCapabilities($skip: Int!, $limit: Int!) { - services(pagination: { start: $skip, limit: $limit }) { - data { - attributes { - oauthClientId - capabilities { - data { - attributes { - slug - } - } - } - } + query ServicesWithCapabilities { + services(pagination: { limit: 500 }) { + oauthClientId + capabilities { + slug } } } diff --git a/libs/shared/cms/src/lib/queries/services-with-capabilities/types.ts b/libs/shared/cms/src/lib/queries/services-with-capabilities/types.ts index a05070d814..bf49d5421e 100644 --- a/libs/shared/cms/src/lib/queries/services-with-capabilities/types.ts +++ b/libs/shared/cms/src/lib/queries/services-with-capabilities/types.ts @@ -2,21 +2,15 @@ * 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 { StrapiEntity } from '../../types'; - export interface CapabilitiesResult { slug: string; } export interface ServiceResult { oauthClientId: string; - capabilities: { - data: StrapiEntity[]; - }; + capabilities: CapabilitiesResult[]; } export interface ServicesWithCapabilitiesResult { - services: { - data: StrapiEntity[]; - }; + services: ServiceResult[]; } diff --git a/libs/shared/cms/src/lib/queries/services-with-capabilities/util.spec.ts b/libs/shared/cms/src/lib/queries/services-with-capabilities/util.spec.ts index 9b3bb346f5..16b78c590d 100644 --- a/libs/shared/cms/src/lib/queries/services-with-capabilities/util.spec.ts +++ b/libs/shared/cms/src/lib/queries/services-with-capabilities/util.spec.ts @@ -15,7 +15,7 @@ describe('ServicesWithCapabilitiesResultUtil', () => { result as ServicesWithCapabilitiesResult ); expect(util).toBeDefined(); - expect(util.services.data.length).toBe(1); + expect(util.services.length).toBe(1); }); it('getServices - should return services and capabilities', () => { @@ -25,12 +25,11 @@ describe('ServicesWithCapabilitiesResultUtil', () => { ); expect(util.getServices()[0].oauthClientId).toBeDefined(); expect(util.getServices()[0].oauthClientId).toEqual( - result.services?.data[0]?.attributes?.oauthClientId + result.services?.[0]?.oauthClientId ); - expect(util.getServices()[0].capabilities.data).toBeDefined(); - expect(util.getServices()[0].capabilities.data[0].attributes.slug).toEqual( - result.services?.data[0]?.attributes?.capabilities?.data[0].attributes - ?.slug + expect(util.getServices()[0].capabilities).toBeDefined(); + expect(util.getServices()[0].capabilities[0].slug).toEqual( + result.services?.[0]?.capabilities?.[0]?.slug ); }); }); diff --git a/libs/shared/cms/src/lib/queries/services-with-capabilities/util.ts b/libs/shared/cms/src/lib/queries/services-with-capabilities/util.ts index e44a6ecb35..f94c49cf48 100644 --- a/libs/shared/cms/src/lib/queries/services-with-capabilities/util.ts +++ b/libs/shared/cms/src/lib/queries/services-with-capabilities/util.ts @@ -8,8 +8,9 @@ export class ServicesWithCapabilitiesResultUtil { constructor(private rawResult: ServicesWithCapabilitiesResult) {} getServices(): ServiceResult[] { - return this.services.data.map((el) => el.attributes); + return this.services; } + get services() { return this.rawResult.services; } diff --git a/libs/shared/cms/src/lib/strapi.client.spec.ts b/libs/shared/cms/src/lib/strapi.client.spec.ts index 856dbe4879..2a3268989f 100644 --- a/libs/shared/cms/src/lib/strapi.client.spec.ts +++ b/libs/shared/cms/src/lib/strapi.client.spec.ts @@ -132,12 +132,7 @@ describe('StrapiClient', () => { describe('getLocale', () => { const ACCEPT_LANGUAGE = 'en-US,fr-FR;q=0.7,de-DE;q=0.3'; const localesQueryResult = LocalesResultFactory({ - i18NLocales: { - data: [ - { attributes: { code: 'en' } }, - { attributes: { code: 'fr-FR' } }, - ], - }, + i18NLocales: [{ code: 'en' }, { code: 'fr-FR' }], }); beforeEach(() => { diff --git a/libs/shared/cms/src/lib/strapi.client.ts b/libs/shared/cms/src/lib/strapi.client.ts index 6418da9622..a26f3f05d6 100644 --- a/libs/shared/cms/src/lib/strapi.client.ts +++ b/libs/shared/cms/src/lib/strapi.client.ts @@ -144,10 +144,7 @@ export class StrapiClient { private async getLocales(): Promise { const localesResult = (await this.query(localesQuery, {})) as LocalesResult; - return ( - localesResult.i18NLocales.data.map((locale) => locale.attributes.code) || - [] - ); + return localesResult.i18NLocales.map((locale) => locale.code) || []; } private setupCacheBust() { diff --git a/libs/shared/cms/src/lib/types.ts b/libs/shared/cms/src/lib/types.ts index 3421b8fd3b..bff337d38c 100644 --- a/libs/shared/cms/src/lib/types.ts +++ b/libs/shared/cms/src/lib/types.ts @@ -17,7 +17,3 @@ export type ContentfulErrorResponse = { requestId: string; details?: NonNullable; }; - -export interface StrapiEntity { - attributes: T; -} diff --git a/packages/fxa-auth-server/test/local/payments/stripe.js b/packages/fxa-auth-server/test/local/payments/stripe.js index 2178dae543..8e3b4fe2d8 100644 --- a/packages/fxa-auth-server/test/local/payments/stripe.js +++ b/packages/fxa-auth-server/test/local/payments/stripe.js @@ -3427,8 +3427,8 @@ describe('#integration - StripeHelper', () => { transformedPurchaseWithCommonContentForPlanId: (planId) => { const mockValue = PurchaseWithDetailsOfferingContentTransformedFactory(); - mockValue.purchaseDetails.data.attributes.webIcon = newWebIconURL; - mockValue.purchaseDetails.data.attributes.localizations.data = []; + mockValue.purchaseDetails.webIcon = newWebIconURL; + mockValue.purchaseDetails.localizations = []; return mockValue; }, };