# frozen_string_literal: true module Stigg module Fragment CouponFragment = <<~GRAPHQL fragment CouponFragment on Coupon { id discountValue type additionalMetaData refId name description createdAt updatedAt billingId billingLinkUrl status syncStates { vendorIdentifier status } } GRAPHQL PriceTierFragment = <<~GRAPHQL fragment PriceTierFragment on PriceTier { upTo unitPrice { amount currency } flatPrice { amount currency } } GRAPHQL PriceFragment = <<~GRAPHQL fragment PriceFragment on Price { billingModel billingPeriod billingCadence billingId minUnitQuantity maxUnitQuantity billingCountryCode price { amount currency } tiersMode tiers { ...PriceTierFragment } feature { refId featureUnits featureUnitsPlural displayName description } blockSize } GRAPHQL OveragePriceFragment = <<~GRAPHQL fragment OveragePriceFragment on Price { billingModel billingPeriod billingId billingCountryCode price { amount currency } tiersMode tiers { ...PriceTierFragment } feature { refId featureUnits featureUnitsPlural displayName description } } GRAPHQL TotalPriceFragment = <<~GRAPHQL fragment TotalPriceFragment on CustomerSubscriptionTotalPrice { subTotal { amount currency } total { amount currency } } GRAPHQL PackageEntitlementFragment = <<~GRAPHQL fragment PackageEntitlementFragment on PackageEntitlement { usageLimit hasUnlimitedUsage hasSoftLimit featureId resetPeriod hiddenFromWidgets isCustom displayNameOverride feature { featureType meterType featureUnits featureUnitsPlural displayName description refId additionalMetaData } } GRAPHQL AddonFragment = <<~GRAPHQL fragment AddonFragment on Addon { id refId billingId displayName description additionalMetaData entitlements { ...PackageEntitlementFragment } prices { ...PriceFragment } overagePrices { ...OveragePriceFragment } pricingType maxQuantity dependencies { ...AddonDependencyFragment } } GRAPHQL AddonDependencyFragment = <<~GRAPHQL fragment AddonDependencyFragment on Addon { id refId displayName description } GRAPHQL PlanFragment = <<~GRAPHQL fragment PlanFragment on Plan { id refId displayName description billingId versionNumber additionalMetaData hiddenFromWidgets product { ...ProductFragment } basePlan { refId displayName } entitlements { ...PackageEntitlementFragment } inheritedEntitlements { ...PackageEntitlementFragment } compatibleAddons { ...AddonFragment } compatiblePackageGroups { ...PlanCompatiblePackageGroupsFragment } prices { ...PriceFragment } overagePrices { ...OveragePriceFragment } pricingType defaultTrialConfig { duration units budget { limit } } } GRAPHQL PlanCompatiblePackageGroupsFragment = <<~GRAPHQL fragment PlanCompatiblePackageGroupsFragment on PlanCompatiblePackageGroups { packageGroupId displayName addons { ...AddonFragment } options { minItems freeItems } } GRAPHQL CustomerResourceFragment = <<~GRAPHQL fragment CustomerResourceFragment on CustomerResource { resourceId } GRAPHQL SlimSubscriptionFragmentV2 = <<~GRAPHQL fragment SlimSubscriptionFragmentV2 on CustomerSubscription { subscriptionId status pricingType startDate currentBillingPeriodEnd customer { customerId } payingCustomer { customerId } resource { resourceId } plan { planId: refId displayName } addons { quantity addon { addonId: refId } } } GRAPHQL SlimSubscriptionFragment = <<~GRAPHQL fragment SlimSubscriptionFragment on CustomerSubscription { id subscriptionId refId status additionalMetaData billingId billingLinkUrl effectiveEndDate currentBillingPeriodEnd pricingType latestInvoice { ...SubscriptionInvoiceFragment } paymentCollection billingSyncError resource { ...CustomerResourceFragment } experimentInfo { name id groupType groupName } prices { usageLimit price { ...PriceFragment } } totalPrice { ...TotalPriceFragment } plan { id refId } addons { quantity addon { id refId } } customer { id refId } } GRAPHQL SubscriptionScheduledUpdateData = <<~GRAPHQL fragment SubscriptionScheduledUpdateData on SubscriptionScheduledUpdate { subscriptionScheduleType scheduleStatus scheduledExecutionTime targetPackage { id refId displayName } scheduleVariables { ...ScheduleVariablesFragment } } GRAPHQL SubscriptionFutureUpdateData = <<~GRAPHQL fragment SubscriptionFutureUpdateData on SubscriptionFutureUpdate { subscriptionScheduleType scheduleStatus scheduledExecutionTime targetPackage { id refId displayName } scheduleVariables { ...ScheduleVariablesFragment } } GRAPHQL SubscriptionInvoiceFragment = <<~GRAPHQL fragment SubscriptionInvoiceFragment on SubscriptionInvoice { billingId status createdAt updatedAt errorMessage requiresAction paymentSecret paymentUrl pdfUrl billingReason currency subTotal subTotalExcludingTax total totalExcludingTax tax amountDue } GRAPHQL SubscriptionFragment = <<~GRAPHQL fragment SubscriptionFragment on CustomerSubscription { id subscriptionId payingCustomer { ...SlimCustomerFragment } startDate endDate trialEndDate cancellationDate effectiveEndDate status refId currentBillingPeriodEnd additionalMetaData billingId billingLinkUrl latestInvoice { ...SubscriptionInvoiceFragment } paymentCollection paymentCollectionMethod billingSyncError resource { ...CustomerResourceFragment } experimentInfo { name groupType groupName id } prices { usageLimit price { ...PriceFragment } } totalPrice { ...TotalPriceFragment } pricingType plan { ...PlanFragment } addons { id quantity addon { ...AddonFragment } } scheduledUpdates { ...SubscriptionScheduledUpdateData } futureUpdates { ...SubscriptionFutureUpdateData } } GRAPHQL PromotionalEntitlementFragment = <<~GRAPHQL fragment PromotionalEntitlementFragment on PromotionalEntitlement { status usageLimit featureId hasUnlimitedUsage hasSoftLimit resetPeriod endDate isVisible feature { featureType meterType featureUnits featureUnitsPlural displayName description refId additionalMetaData } } GRAPHQL SlimCustomerFragment = <<~GRAPHQL fragment SlimCustomerFragment on Customer { id name email createdAt updatedAt refId customerId billingId additionalMetaData awsMarketplaceCustomerId } GRAPHQL CustomerFragment = <<~GRAPHQL fragment CustomerFragment on Customer { ...SlimCustomerFragment hasPaymentMethod hasActiveSubscription defaultPaymentExpirationMonth defaultPaymentExpirationYear defaultPaymentMethodLast4Digits trialedPlans { productId productRefId planRefId planId } experimentInfo { groupType groupName id name } coupon { ...CouponFragment } eligibleForTrial { productId productRefId eligible } promotionalEntitlements { ...PromotionalEntitlementFragment } } GRAPHQL CustomerWithSubscriptionsFragment = <<~GRAPHQL fragment CustomerWithSubscriptionsFragment on Customer { ...CustomerFragment subscriptions { ...SubscriptionFragment } } GRAPHQL CustomerStatisticsFragment = <<~GRAPHQL fragment CustomerStatisticsFragment on Customer { statistics { activeSubscriptionsByPricingType { pricingType totalCount } } } GRAPHQL SubscriptionPreviewFragment = <<~GRAPHQL fragment SubscriptionPreviewFragment on SubscriptionPreview { subTotal { amount currency } totalExcludingTax { amount currency } total { amount currency } discountAmount { amount currency } taxDetails { displayName percentage inclusive } tax { amount currency } billingPeriodRange { start end } discount { name type value durationType durationInMonths } subscription { subTotal { amount currency } totalExcludingTax { amount currency } total { amount currency } tax { amount currency } discountAmount { amount currency } taxDetails { displayName percentage inclusive } discount { name type value durationType durationInMonths } } proration { prorationDate credit { amount currency } debit { amount currency } netAmount { amount currency } } isPlanDowngrade hasScheduledUpdates credits { initial { amount currency } used { amount currency } remaining { amount currency } } } GRAPHQL SubscriptionPreviewInvoiceFragment = <<~GRAPHQL fragment SubscriptionPreviewInvoiceFragment on SubscriptionPreviewInvoice { total { amount currency } subTotal { amount currency } totalExcludingTax { amount currency } tax { amount currency } discount { amount currency } taxDetails { displayName percentage inclusive } discountDetails { type value durationType durationInMonths } } GRAPHQL ImmediateSubscriptionPreviewInvoiceFragment = <<~GRAPHQL fragment ImmediateSubscriptionPreviewInvoiceFragment on ImmediateSubscriptionPreviewInvoice { total { amount currency } subTotal { amount currency } totalExcludingTax { amount currency } tax { amount currency } discount { amount currency } taxDetails { displayName percentage inclusive } discountDetails { type value durationType durationInMonths } credits { initial { amount currency } used { amount currency } remaining { amount currency } } proration { prorationDate hasProrations credit { amount currency } debit { amount currency } netAmount { amount currency } } } GRAPHQL SubscriptionPreviewV2Fragment = <<~GRAPHQL fragment SubscriptionPreviewV2Fragment on SubscriptionPreviewV2 { immediateInvoice { ...ImmediateSubscriptionPreviewInvoiceFragment } recurringInvoice { ...SubscriptionPreviewInvoiceFragment } billingPeriodRange { start end } isPlanDowngrade hasScheduledUpdates } GRAPHQL SubscriptionInvoicePreviewFragment = <<~GRAPHQL fragment SubscriptionInvoicePreviewFragment on SubscriptionInvoicePreview { amountDue { amount currency } minimumSpendAdjustment { amount currency } total { amount currency } totalExcludingTax { amount currency } subTotal { amount currency } subTotalExcludingTax { amount currency } tax { amount currency } taxDetails { displayName percentage inclusive } discount { amount currency } discountDetails { name type value durationType durationInMonths } credits { initial { amount currency } used { amount currency } remaining { amount currency } } lastUpdatedAt lines { type description costDescription amount { amount currency } unitPrice { amount currency } quantity proration price { ...PriceFragment } usageLimit period { start end } hasSoftLimit lines { type description costDescription quantity proration usageLimit hasSoftLimit } } } GRAPHQL FeatureFragment = <<~GRAPHQL fragment FeatureFragment on EntitlementFeature { __typename featureType meterType featureUnits featureUnitsPlural description displayName refId unitTransformation { divide round } } GRAPHQL ResetPeriodConfigurationFragment = <<~GRAPHQL fragment ResetPeriodConfigurationFragment on ResetPeriodConfiguration { __typename ... on MonthlyResetPeriodConfig { monthlyAccordingTo } ... on WeeklyResetPeriodConfig { weeklyAccordingTo } } GRAPHQL UsageUpdatedFragment = <<~GRAPHQL fragment UsageUpdatedFragment on UsageMeasurementUpdated { customerId resourceId featureId currentUsage usagePeriodStart usagePeriodEnd nextResetDate } GRAPHQL EntitlementFragment = <<~GRAPHQL fragment EntitlementFragment on Entitlement { __typename isGranted accessDeniedReason customerId resourceId usageLimit hasUnlimitedUsage hasSoftLimit currentUsage requestedUsage entitlementUpdatedAt usageUpdatedAt usagePeriodAnchor usagePeriodStart usagePeriodEnd nextResetDate resetPeriod resetPeriodConfiguration { ...ResetPeriodConfigurationFragment } feature { ...FeatureFragment } } GRAPHQL TypographyConfigurationFragment = <<~GRAPHQL fragment TypographyConfigurationFragment on TypographyConfiguration { fontFamily h1 { ...FontVariantFragment } h2 { ...FontVariantFragment } h3 { ...FontVariantFragment } body { ...FontVariantFragment } } GRAPHQL FontVariantFragment = <<~GRAPHQL fragment FontVariantFragment on FontVariant { fontSize fontWeight } GRAPHQL LayoutConfigurationFragment = <<~GRAPHQL fragment LayoutConfigurationFragment on PaywallLayoutConfiguration { alignment planWidth planMargin planPadding } GRAPHQL PaywallConfigurationFragment = <<~GRAPHQL fragment PaywallConfigurationFragment on PaywallConfiguration { palette { primary textColor backgroundColor borderColor currentPlanBackground } typography { ...TypographyConfigurationFragment } layout { ...LayoutConfigurationFragment } customCss } GRAPHQL PaywallCurrencyFragment = <<~GRAPHQL fragment PaywallCurrencyFragment on PaywallCurrency { code symbol } GRAPHQL ProductFragment = <<~GRAPHQL fragment ProductFragment on Product { refId displayName description additionalMetaData productSettings { downgradePlan { refId displayName } } } GRAPHQL EntitlementsUpdatedPayload = <<~GRAPHQL fragment EntitlementsUpdatedPayload on EntitlementsUpdated { customerId resourceId entitlements { ...EntitlementFragment } } GRAPHQL EntitlementUsageUpdated = <<~GRAPHQL fragment EntitlementUsageUpdated on UsageUpdated { usage { ...UsageUpdatedFragment } entitlement { ...EntitlementFragment } } GRAPHQL PackagePublishedPayload = <<~GRAPHQL fragment PackagePublishedPayload on PackagePublished { accountId environmentId packageType packageRefId packageVersion migrationType } GRAPHQL CustomerPortalFragment = <<~GRAPHQL fragment CustomerPortalFragment on CustomerPortal { subscriptions { ...CustomerPortalSubscriptionFragment } entitlements { ...CustomerPortalEntitlementFragment } promotionalEntitlements { ...CustomerPortalPromotionalEntitlementFragment } billingInformation { ...CustomerPortalBillingInformationFragment } showWatermark billingPortalUrl canUpgradeSubscription configuration { ...CustomerPortalConfigurationFragment } resource { ...CustomerResourceFragment } } GRAPHQL CheckoutStateFragment = <<~GRAPHQL fragment CheckoutStateFragment on CheckoutState { configuration { ...CheckoutConfigurationFragment } setupSecret customer { ...CustomerFragment } activeSubscription { ...SubscriptionFragment } resource { ...CustomerResourceFragment } plan { ...PlanFragment } billingIntegration { billingIdentifier credentials { accountId publicKey } } } GRAPHQL CheckoutConfigurationFragment = <<~GRAPHQL fragment CheckoutConfigurationFragment on CheckoutConfiguration { palette { primary textColor backgroundColor borderColor summaryBackgroundColor __typename } typography { ...TypographyConfigurationFragment __typename } customCss content { collectPhoneNumber } __typename } GRAPHQL CustomerPortalConfigurationFragment = <<~GRAPHQL fragment CustomerPortalConfigurationFragment on CustomerPortalConfiguration { palette { primary textColor backgroundColor borderColor currentPlanBackground iconsColor paywallBackgroundColor } typography { ...TypographyConfigurationFragment } customCss } GRAPHQL CustomerPortalSubscriptionPriceFragment = <<~GRAPHQL fragment CustomerPortalSubscriptionPriceFragment on CustomerPortalSubscriptionPrice { billingPeriod billingModel price { amount currency } feature { id refId displayName featureUnits featureUnitsPlural } } GRAPHQL CustomerPortalSubscriptionFragment = <<~GRAPHQL fragment CustomerPortalSubscriptionFragment on CustomerPortalSubscription { subscriptionId planId planName pricingType prices { ...CustomerPortalSubscriptionPriceFragment } pricing { unitQuantity billingPeriod billingModel pricingType usageBasedEstimatedBill price { amount currency } feature { featureUnits featureUnitsPlural displayName } } status trialRemainingDays billingPeriodRange { start end } totalPrice { subTotal { amount currency } total { amount currency } addonsTotal { amount currency } } addons { ...CustomerPortalSubscriptionAddonFragment } scheduledUpdates { ...CustomerPortalSubscriptionScheduledUpdateDataFragment } } GRAPHQL CustomerPortalSubscriptionAddonFragment = <<~GRAPHQL fragment CustomerPortalSubscriptionAddonFragment on CustomerPortalAddon { addonId description displayName quantity } GRAPHQL CustomerPortalSubscriptionScheduledUpdateDataFragment = <<~GRAPHQL fragment CustomerPortalSubscriptionScheduledUpdateDataFragment on SubscriptionScheduledUpdate { subscriptionScheduleType scheduleStatus scheduledExecutionTime targetPackage { id refId displayName pricingType } scheduleVariables { ...ScheduleVariablesFragment } } GRAPHQL CustomerPortalEntitlementFragment = <<~GRAPHQL fragment CustomerPortalEntitlementFragment on Entitlement { isGranted usageLimit currentUsage hasUnlimitedUsage hasSoftLimit usagePeriodStart usagePeriodEnd nextResetDate resetPeriod resetPeriodConfiguration { ...ResetPeriodConfigurationFragment } feature { ...FeatureFragment } } GRAPHQL CustomerPortalPromotionalEntitlementFragment = <<~GRAPHQL fragment CustomerPortalPromotionalEntitlementFragment on CustomerPortalPromotionalEntitlement { displayName hasUnlimitedUsage hasSoftLimit usageLimit period startDate endDate } GRAPHQL CustomerPortalBillingInformationFragment = <<~GRAPHQL fragment CustomerPortalBillingInformationFragment on CustomerPortalBillingInformation { email name defaultPaymentMethodLast4Digits defaultPaymentMethodId defaultPaymentExpirationMonth defaultPaymentExpirationYear } GRAPHQL MockPaywallPlanFragment = <<~GRAPHQL fragment MockPaywallPlanFragment on PaywallPlan { refId description displayName billingId additionalMetaData product { refId displayName description additionalMetaData } basePlan { refId displayName } entitlements { ...MockPaywallPackageEntitlementFragment } inheritedEntitlements { ...MockPaywallPackageEntitlementFragment } prices { ...MockPaywallPriceFragment } pricingType defaultTrialConfig { duration units budget { limit } } compatibleAddons { ...MockPaywallAddonFragment } compatiblePackageGroups { ...MockPaywallPlanCompatiblePackageGroupsFragment } } GRAPHQL MockPaywallPackageEntitlementFragment = <<~GRAPHQL fragment MockPaywallPackageEntitlementFragment on Entitlement { usageLimit hasUnlimitedUsage hasSoftLimit resetPeriod hiddenFromWidgets displayNameOverride feature { featureType meterType featureUnits featureUnitsPlural displayName description refId additionalMetaData } } GRAPHQL MockPaywallPriceFragment = <<~GRAPHQL fragment MockPaywallPriceFragment on PaywallPrice { billingModel billingPeriod billingId minUnitQuantity maxUnitQuantity billingCountryCode price { amount currency } tiersMode tiers { ...PriceTierFragment } feature { refId featureUnits featureUnitsPlural displayName } blockSize } GRAPHQL PaywallCalculatedPricePointsFragment = <<~GRAPHQL fragment PaywallCalculatedPricePointsFragment on PaywallPricePoint { planId additionalChargesMayApply billingPeriod amount currency billingCountryCode feature { refId featureUnits featureUnitsPlural displayName description } } GRAPHQL MockPaywallPlanCompatiblePackageGroupsFragment = <<~GRAPHQL fragment MockPaywallPlanCompatiblePackageGroupsFragment on PaywallPlanCompatiblePackageGroup { packageGroupId displayName description addons { ...MockPaywallAddonFragment } options { minItems freeItems } } GRAPHQL MockPaywallAddonDependencyFragment = <<~GRAPHQL fragment MockPaywallAddonDependencyFragment on PaywallAddon { refId displayName description } GRAPHQL MockPaywallAddonFragment = <<~GRAPHQL fragment MockPaywallAddonFragment on PaywallAddon { refId displayName description additionalMetaData billingId maxQuantity dependencies { ...MockPaywallAddonDependencyFragment } entitlements { ...MockPaywallPackageEntitlementFragment } prices { ...MockPaywallPriceFragment } pricingType } GRAPHQL PaywallFragment = <<~GRAPHQL fragment PaywallFragment on Paywall { plans { ...PlanFragment } currency { ...PaywallCurrencyFragment } configuration { ...PaywallConfigurationFragment } customer { ...CustomerFragment } activeSubscriptions { ...SubscriptionFragment } resource { ...CustomerResourceFragment } paywallCalculatedPricePoints { ...PaywallCalculatedPricePointsFragment } } GRAPHQL UsageHistoryFragment = <<~GRAPHQL fragment UsageHistoryFragment on UsageHistory { startDate endDate usageMeasurements { date value isResetPoint } groups { groupInfo { key value } usageMeasurements { date value isResetPoint } } } GRAPHQL ProvisionCustomerFragment = <<~GRAPHQL fragment ProvisionCustomerFragment on ProvisionedCustomer { customer { ...SlimCustomerFragment } subscriptionDecisionStrategy subscription { ...SlimSubscriptionFragment } entitlements { ...EntitlementFragment } } GRAPHQL ApplySubscriptionFragment = <<~GRAPHQL fragment ApplySubscriptionFragment on ApplySubscription { subscription { ...SubscriptionFragment } entitlements { ...EntitlementFragment } } GRAPHQL ProvisionSubscriptionFragment = <<~GRAPHQL fragment ProvisionSubscriptionFragment on ProvisionSubscriptionResult { status checkoutUrl checkoutBillingId subscription { ...SlimSubscriptionFragment } entitlements { ...EntitlementFragment } } GRAPHQL ReportUsageFragment = <<~GRAPHQL fragment ReportUsageFragment on UsageMeasurementWithCurrentUsage { id featureId customerId resourceId currentUsage usagePeriodStart usagePeriodEnd nextResetDate timestamp } GRAPHQL ScheduleVariablesFragment = <<~GRAPHQL fragment ScheduleVariablesFragment on ScheduleVariables { __typename ... on PlanChangeVariables { planRefId changeType billingPeriod billableFeatures { featureId quantity } addons { addonRefId quantity } } ... on DowngradeChangeVariables { downgradePlanRefId billingPeriod billableFeatures { featureId quantity } addons { addonRefId quantity } } ... on BillingPeriodChangeVariables { billingPeriod } ... on UnitAmountChangeVariables { newUnitAmount featureId } ... on AddonChangeVariables { addonRefId newQuantity } } GRAPHQL end module Mutation ProvisionCustomer = <<~GRAPHQL mutation ProvisionCustomer($input: ProvisionCustomerInput!) { provisionCustomer(input: $input) { ...ProvisionCustomerFragment } } #{Fragment::ProvisionCustomerFragment} #{Fragment::SlimCustomerFragment} #{Fragment::SlimSubscriptionFragment} #{Fragment::SubscriptionInvoiceFragment} #{Fragment::CustomerResourceFragment} #{Fragment::PriceFragment} #{Fragment::PriceTierFragment} #{Fragment::TotalPriceFragment} #{Fragment::EntitlementFragment} #{Fragment::ResetPeriodConfigurationFragment} #{Fragment::FeatureFragment} GRAPHQL ImportCustomerBulk = <<~GRAPHQL mutation ImportCustomerBulk($input: ImportCustomerBulkInput!) { importCustomersBulk(input: $input) } GRAPHQL ImportCustomer = <<~GRAPHQL mutation ImportCustomer($input: ImportCustomerInput!) { importCustomer: importOneCustomer(input: $input) { ...SlimCustomerFragment } } #{Fragment::SlimCustomerFragment} GRAPHQL UpdateCustomer = <<~GRAPHQL mutation UpdateCustomer($input: UpdateCustomerInput!) { updateCustomer: updateOneCustomer(input: $input) { ...SlimCustomerFragment } } #{Fragment::SlimCustomerFragment} GRAPHQL DetachCustomerPaymentMethod = <<~GRAPHQL mutation DetachCustomerPaymentMethod($input: DetachCustomerPaymentMethodInput!) { detachCustomerPaymentMethod(input: $input) { ...SlimCustomerFragment } } #{Fragment::SlimCustomerFragment} GRAPHQL GrantPromotionalEntitlements = <<~GRAPHQL mutation GrantPromotionalEntitlements( $input: GrantPromotionalEntitlementsInput! ) { grantPromotionalEntitlements(input: $input) { ...PromotionalEntitlementFragment } } #{Fragment::PromotionalEntitlementFragment} GRAPHQL RevokePromotionalEntitlement = <<~GRAPHQL mutation RevokePromotionalEntitlement( $input: RevokePromotionalEntitlementInput! ) { revokePromotionalEntitlement(input: $input) { id } } GRAPHQL ProvisionSubscription = <<~GRAPHQL mutation ProvisionSubscription($input: ProvisionSubscriptionInput!) { provisionSubscription: provisionSubscriptionV2(input: $input) { ...ProvisionSubscriptionFragment } } #{Fragment::ProvisionSubscriptionFragment} #{Fragment::SlimSubscriptionFragment} #{Fragment::SubscriptionInvoiceFragment} #{Fragment::CustomerResourceFragment} #{Fragment::PriceFragment} #{Fragment::PriceTierFragment} #{Fragment::TotalPriceFragment} #{Fragment::EntitlementFragment} #{Fragment::ResetPeriodConfigurationFragment} #{Fragment::FeatureFragment} GRAPHQL ApplySubscription = <<~GRAPHQL mutation ApplySubscription($input: ApplySubscriptionInput!) { applySubscription(input: $input) { ...ApplySubscriptionFragment } } #{Fragment::ApplySubscriptionFragment} #{Fragment::SubscriptionFragment} #{Fragment::SlimCustomerFragment} #{Fragment::SubscriptionInvoiceFragment} #{Fragment::CustomerResourceFragment} #{Fragment::PriceFragment} #{Fragment::PriceTierFragment} #{Fragment::TotalPriceFragment} #{Fragment::PlanFragment} #{Fragment::ProductFragment} #{Fragment::PackageEntitlementFragment} #{Fragment::AddonFragment} #{Fragment::OveragePriceFragment} #{Fragment::AddonDependencyFragment} #{Fragment::PlanCompatiblePackageGroupsFragment} #{Fragment::SubscriptionScheduledUpdateData} #{Fragment::ScheduleVariablesFragment} #{Fragment::SubscriptionFutureUpdateData} #{Fragment::EntitlementFragment} #{Fragment::ResetPeriodConfigurationFragment} #{Fragment::FeatureFragment} GRAPHQL ImportSubscriptionsBulk = <<~GRAPHQL mutation ImportSubscriptionsBulk($input: ImportSubscriptionsBulkInput!) { importSubscriptionsBulk(input: $input) } GRAPHQL UpdateSubscription = <<~GRAPHQL mutation UpdateSubscription($input: UpdateSubscriptionInput!) { updateSubscription: updateOneSubscription(input: $input) { ...SlimSubscriptionFragment } } #{Fragment::SlimSubscriptionFragment} #{Fragment::SubscriptionInvoiceFragment} #{Fragment::CustomerResourceFragment} #{Fragment::PriceFragment} #{Fragment::PriceTierFragment} #{Fragment::TotalPriceFragment} GRAPHQL CancelSubscription = <<~GRAPHQL mutation CancelSubscription($input: SubscriptionCancellationInput!) { cancelSubscription(input: $input) { ...SlimSubscriptionFragment } } #{Fragment::SlimSubscriptionFragment} #{Fragment::SubscriptionInvoiceFragment} #{Fragment::CustomerResourceFragment} #{Fragment::PriceFragment} #{Fragment::PriceTierFragment} #{Fragment::TotalPriceFragment} GRAPHQL EstimateSubscription = <<~GRAPHQL mutation EstimateSubscription($input: EstimateSubscriptionInput!) { estimateSubscription(input: $input) { ...SubscriptionPreviewFragment } } #{Fragment::SubscriptionPreviewFragment} GRAPHQL EstimateSubscriptionUpdate = <<~GRAPHQL mutation EstimateSubscriptionUpdate($input: EstimateSubscriptionUpdateInput!) { estimateSubscriptionUpdate(input: $input) { ...SubscriptionPreviewFragment } } #{Fragment::SubscriptionPreviewFragment} GRAPHQL PreviewSubscription = <<~GRAPHQL mutation PreviewSubscription($input: PreviewSubscriptionInput!) { previewSubscription(input: $input) { ...SubscriptionPreviewV2Fragment } } #{Fragment::SubscriptionPreviewV2Fragment} #{Fragment::ImmediateSubscriptionPreviewInvoiceFragment} #{Fragment::SubscriptionPreviewInvoiceFragment} GRAPHQL PreviewNextInvoice = <<~GRAPHQL mutation PreviewNextInvoice($input: PreviewNextInvoiceInput!) { previewNextInvoice(input: $input) { ...SubscriptionInvoicePreviewFragment } } #{Fragment::SubscriptionInvoicePreviewFragment} #{Fragment::PriceFragment} #{Fragment::PriceTierFragment} GRAPHQL CancelSubscriptionUpdates = <<~GRAPHQL mutation CancelSubscriptionUpdates( $input: SubscriptionUpdateScheduleCancellationInput! ) { cancelSchedule(input: $input) } GRAPHQL ReportUsage = <<~GRAPHQL mutation ReportUsage($input: ReportUsageInput!) { reportUsage(input: $input) { ...ReportUsageFragment } } #{Fragment::ReportUsageFragment} GRAPHQL ReportUsageBulk = <<~GRAPHQL mutation ReportUsageBulk($input: ReportUsageBulkInput!) { reportUsageBulk(input: $input) { ...ReportUsageFragment } } #{Fragment::ReportUsageFragment} GRAPHQL ReportEvent = <<~GRAPHQL mutation ReportEvent($input: UsageEventsReportInput!) { reportEvent(events: $input) } GRAPHQL ReportEntitlementCheckRequested = <<~GRAPHQL mutation ReportEntitlementCheckRequested( $entitlementCheckRequested: EntitlementCheckRequested! ) { reportEntitlementCheckRequested( entitlementCheckRequested: $entitlementCheckRequested ) } GRAPHQL CreateSubscription = <<~GRAPHQL mutation CreateSubscription($input: SubscriptionInput!) { createSubscription(subscription: $input) { ...SlimSubscriptionFragment } } #{Fragment::SlimSubscriptionFragment} #{Fragment::SubscriptionInvoiceFragment} #{Fragment::CustomerResourceFragment} #{Fragment::PriceFragment} #{Fragment::PriceTierFragment} #{Fragment::TotalPriceFragment} GRAPHQL MigrateSubscriptionToLatest = <<~GRAPHQL mutation MigrateSubscriptionToLatest($input: SubscriptionMigrationInput!) { migrateSubscriptionToLatest(input: $input) { subscriptionId } } GRAPHQL ArchiveCustomer = <<~GRAPHQL mutation ArchiveCustomer($input: ArchiveCustomerInput!) { archiveCustomer(input: $input) { customerId } } GRAPHQL UnarchiveCustomer = <<~GRAPHQL mutation UnarchiveCustomer($input: UnarchiveCustomerInput!) { unarchiveCustomer(input: $input) { ...SlimCustomerFragment } } #{Fragment::SlimCustomerFragment} GRAPHQL TransferSubscription = <<~GRAPHQL mutation TransferSubscription($input: TransferSubscriptionInput!) { transferSubscription(input: $input) { ...SlimSubscriptionFragment } } #{Fragment::SlimSubscriptionFragment} #{Fragment::SubscriptionInvoiceFragment} #{Fragment::CustomerResourceFragment} #{Fragment::PriceFragment} #{Fragment::PriceTierFragment} #{Fragment::TotalPriceFragment} GRAPHQL end module Query GetCustomerById = <<~GRAPHQL query GetCustomerById($input: GetCustomerByRefIdInput!) { getCustomerByRefId(input: $input) { ...CustomerWithSubscriptionsFragment } } #{Fragment::CustomerWithSubscriptionsFragment} #{Fragment::CustomerFragment} #{Fragment::SlimCustomerFragment} #{Fragment::CouponFragment} #{Fragment::PromotionalEntitlementFragment} #{Fragment::SubscriptionFragment} #{Fragment::SubscriptionInvoiceFragment} #{Fragment::CustomerResourceFragment} #{Fragment::PriceFragment} #{Fragment::PriceTierFragment} #{Fragment::TotalPriceFragment} #{Fragment::PlanFragment} #{Fragment::ProductFragment} #{Fragment::PackageEntitlementFragment} #{Fragment::AddonFragment} #{Fragment::OveragePriceFragment} #{Fragment::AddonDependencyFragment} #{Fragment::PlanCompatiblePackageGroupsFragment} #{Fragment::SubscriptionScheduledUpdateData} #{Fragment::ScheduleVariablesFragment} #{Fragment::SubscriptionFutureUpdateData} GRAPHQL GetCustomerStatistics = <<~GRAPHQL query GetCustomerStatistics($input: GetCustomerByRefIdInput!) { getCustomerByRefId(input: $input) { ...CustomerStatisticsFragment, } } #{Fragment::CustomerStatisticsFragment} GRAPHQL GetActiveSubscriptions = <<~GRAPHQL query GetActiveSubscriptions($input: GetActiveSubscriptionsInput!) { getActiveSubscriptions(input: $input) { ...SubscriptionFragment } } #{Fragment::SubscriptionFragment} #{Fragment::SlimCustomerFragment} #{Fragment::SubscriptionInvoiceFragment} #{Fragment::CustomerResourceFragment} #{Fragment::PriceFragment} #{Fragment::PriceTierFragment} #{Fragment::TotalPriceFragment} #{Fragment::PlanFragment} #{Fragment::ProductFragment} #{Fragment::PackageEntitlementFragment} #{Fragment::AddonFragment} #{Fragment::OveragePriceFragment} #{Fragment::AddonDependencyFragment} #{Fragment::PlanCompatiblePackageGroupsFragment} #{Fragment::SubscriptionScheduledUpdateData} #{Fragment::ScheduleVariablesFragment} #{Fragment::SubscriptionFutureUpdateData} GRAPHQL GetActiveSubscriptionsList = <<~GRAPHQL query GetActiveSubscriptionsList($input: GetActiveSubscriptionsInput!) { getActiveSubscriptions(input: $input) { ...SlimSubscriptionFragmentV2 } } #{Fragment::SlimSubscriptionFragmentV2} GRAPHQL GetSubscription = <<~GRAPHQL query GetSubscription($input: GetSubscriptionInput!) { getSubscription(input: $input) { ...SubscriptionFragment } } #{Fragment::SubscriptionFragment} #{Fragment::SlimCustomerFragment} #{Fragment::SubscriptionInvoiceFragment} #{Fragment::CustomerResourceFragment} #{Fragment::PriceFragment} #{Fragment::PriceTierFragment} #{Fragment::TotalPriceFragment} #{Fragment::PlanFragment} #{Fragment::ProductFragment} #{Fragment::PackageEntitlementFragment} #{Fragment::AddonFragment} #{Fragment::OveragePriceFragment} #{Fragment::AddonDependencyFragment} #{Fragment::PlanCompatiblePackageGroupsFragment} #{Fragment::SubscriptionScheduledUpdateData} #{Fragment::ScheduleVariablesFragment} #{Fragment::SubscriptionFutureUpdateData} GRAPHQL GetCoupons = <<~GRAPHQL query GetCoupons { coupons(filter: { status: { eq: ACTIVE } }, paging: { first: 50 }) { edges { node { ...CouponFragment } } } } #{Fragment::CouponFragment} GRAPHQL GetPaywall = <<~GRAPHQL query GetPaywall($input: GetPaywallInput!) { paywall(input: $input) { ...PaywallFragment } } #{Fragment::PaywallFragment} #{Fragment::PlanFragment} #{Fragment::ProductFragment} #{Fragment::PackageEntitlementFragment} #{Fragment::AddonFragment} #{Fragment::PriceFragment} #{Fragment::PriceTierFragment} #{Fragment::OveragePriceFragment} #{Fragment::AddonDependencyFragment} #{Fragment::PlanCompatiblePackageGroupsFragment} #{Fragment::PaywallCurrencyFragment} #{Fragment::PaywallConfigurationFragment} #{Fragment::TypographyConfigurationFragment} #{Fragment::FontVariantFragment} #{Fragment::LayoutConfigurationFragment} #{Fragment::CustomerFragment} #{Fragment::SlimCustomerFragment} #{Fragment::CouponFragment} #{Fragment::PromotionalEntitlementFragment} #{Fragment::SubscriptionFragment} #{Fragment::SubscriptionInvoiceFragment} #{Fragment::CustomerResourceFragment} #{Fragment::TotalPriceFragment} #{Fragment::SubscriptionScheduledUpdateData} #{Fragment::ScheduleVariablesFragment} #{Fragment::SubscriptionFutureUpdateData} #{Fragment::PaywallCalculatedPricePointsFragment} GRAPHQL GetEntitlements = <<~GRAPHQL query GetEntitlements($query: FetchEntitlementsQuery!) { entitlements: cachedEntitlements(query: $query) { ...EntitlementFragment } } #{Fragment::EntitlementFragment} #{Fragment::ResetPeriodConfigurationFragment} #{Fragment::FeatureFragment} GRAPHQL GetEntitlement = <<~GRAPHQL query GetEntitlement($query: FetchEntitlementQuery!) { entitlement(query: $query) { ...EntitlementFragment } } #{Fragment::EntitlementFragment} #{Fragment::ResetPeriodConfigurationFragment} #{Fragment::FeatureFragment} GRAPHQL GetProducts = <<~GRAPHQL query GetProducts { products(paging: { first: 50 }) { edges { node { ...ProductFragment } } } } #{Fragment::ProductFragment} GRAPHQL GetSdkConfiguration = <<~GRAPHQL query GetSdkConfiguration { sdkConfiguration { sentryDsn isWidgetWatermarkEnabled } } GRAPHQL GetCustomerPortalByRefId = <<~GRAPHQL query GetCustomerPortalByRefId($input: CustomerPortalInput!) { customerPortal(input: $input) { ...CustomerPortalFragment } } #{Fragment::CustomerPortalFragment} #{Fragment::CustomerPortalSubscriptionFragment} #{Fragment::CustomerPortalSubscriptionPriceFragment} #{Fragment::CustomerPortalSubscriptionAddonFragment} #{Fragment::CustomerPortalSubscriptionScheduledUpdateDataFragment} #{Fragment::ScheduleVariablesFragment} #{Fragment::CustomerPortalEntitlementFragment} #{Fragment::ResetPeriodConfigurationFragment} #{Fragment::FeatureFragment} #{Fragment::CustomerPortalPromotionalEntitlementFragment} #{Fragment::CustomerPortalBillingInformationFragment} #{Fragment::CustomerPortalConfigurationFragment} #{Fragment::TypographyConfigurationFragment} #{Fragment::FontVariantFragment} #{Fragment::CustomerResourceFragment} GRAPHQL GetCheckoutState = <<~GRAPHQL query GetCheckoutState($input: CheckoutStateInput!) { checkoutState(input: $input) { ...CheckoutStateFragment } } #{Fragment::CheckoutStateFragment} #{Fragment::CheckoutConfigurationFragment} #{Fragment::TypographyConfigurationFragment} #{Fragment::FontVariantFragment} #{Fragment::CustomerFragment} #{Fragment::SlimCustomerFragment} #{Fragment::CouponFragment} #{Fragment::PromotionalEntitlementFragment} #{Fragment::SubscriptionFragment} #{Fragment::SubscriptionInvoiceFragment} #{Fragment::CustomerResourceFragment} #{Fragment::PriceFragment} #{Fragment::PriceTierFragment} #{Fragment::TotalPriceFragment} #{Fragment::PlanFragment} #{Fragment::ProductFragment} #{Fragment::PackageEntitlementFragment} #{Fragment::AddonFragment} #{Fragment::OveragePriceFragment} #{Fragment::AddonDependencyFragment} #{Fragment::PlanCompatiblePackageGroupsFragment} #{Fragment::SubscriptionScheduledUpdateData} #{Fragment::ScheduleVariablesFragment} #{Fragment::SubscriptionFutureUpdateData} GRAPHQL GetMockPaywall = <<~GRAPHQL query GetMockPaywall($input: GetPaywallInput!) { mockPaywall(input: $input) { plans { ...MockPaywallPlanFragment } configuration { ...PaywallConfigurationFragment } } } #{Fragment::MockPaywallPlanFragment} #{Fragment::MockPaywallPackageEntitlementFragment} #{Fragment::MockPaywallPriceFragment} #{Fragment::PriceTierFragment} #{Fragment::MockPaywallAddonFragment} #{Fragment::MockPaywallAddonDependencyFragment} #{Fragment::MockPaywallPlanCompatiblePackageGroupsFragment} #{Fragment::PaywallConfigurationFragment} #{Fragment::TypographyConfigurationFragment} #{Fragment::FontVariantFragment} #{Fragment::LayoutConfigurationFragment} GRAPHQL GetUsageHistory = <<~GRAPHQL query GetUsageHistory($usageHistoryInput: UsageHistoryInput!) { usageHistory(usageHistoryInput: $usageHistoryInput) { ...UsageHistoryFragment } } #{Fragment::UsageHistoryFragment} GRAPHQL OnEntitlementsUpdated = <<~GRAPHQL subscription OnEntitlementsUpdated { entitlementsUpdated { ...EntitlementsUpdatedPayload } } #{Fragment::EntitlementsUpdatedPayload} #{Fragment::EntitlementFragment} #{Fragment::ResetPeriodConfigurationFragment} #{Fragment::FeatureFragment} GRAPHQL OnUsageUpdated = <<~GRAPHQL subscription OnUsageUpdated { usageUpdated { ...EntitlementUsageUpdated } } #{Fragment::EntitlementUsageUpdated} #{Fragment::UsageUpdatedFragment} #{Fragment::EntitlementFragment} #{Fragment::ResetPeriodConfigurationFragment} #{Fragment::FeatureFragment} GRAPHQL OnPackagePublished = <<~GRAPHQL subscription OnPackagePublished { packagePublished { ...PackagePublishedPayload } } #{Fragment::PackagePublishedPayload} GRAPHQL end end