@manifoldco/manifold-subscription
Advanced tools
Comparing version 0.0.11 to 0.0.12
@@ -8,5 +8,5 @@ 'use strict'; | ||
const defineCustomElements = (win, options) => index.patchEsm().then(() => { | ||
return index.bootstrapLazy([["manifold-configured-feature_4.cjs",[[0,"manifold-configured-feature",{"label":[1],"value":[8]}],[0,"manifold-subscription-create",{"loading":[1028],"isLoadingPlanSelector":[1028,"is-loading-plan-selector"],"errors":[1040],"data":[1040],"planListData":[1040],"setupIntentStatus":[1025,"setup-intent-status"],"setupIntentError":[1025,"setup-intent-error"],"subscribing":[1028],"configuredFeatures":[1040],"calculatedCost":[1026,"calculated-cost"],"isEditing":[1028,"is-editing"],"heading":[1],"planId":[1025,"plan-id"],"ownerId":[1,"owner-id"],"stripePublishableKey":[1,"stripe-publishable-key"],"displayName":[1,"display-name"],"label":[1],"card":[32],"cardStatus":[32]},[[0,"manifold-configured-feature-change","updateConfiguredFeature"]]],[0,"manifold-subscription-details",{"subscriptionId":[1,"subscription-id"],"heading":[1],"isEditing":[4,"is-editing"]}],[0,"manifold-subscription-list",{"connection":[1040],"loading":[1028],"errors":[1040],"data":[1040],"subLinkFormat":[1025,"sub-link-format"],"heading":[1],"owner":[1]}]]]], options); | ||
return index.bootstrapLazy([["manifold-configured-feature_4.cjs",[[0,"manifold-configured-feature",{"label":[1],"value":[8]}],[0,"manifold-subscription-create",{"loading":[1028],"isLoadingPlanSelector":[1028,"is-loading-plan-selector"],"errors":[1040],"data":[1040],"planListData":[1040],"setupIntentStatus":[1025,"setup-intent-status"],"setupIntentError":[1025,"setup-intent-error"],"subscribing":[1028],"configuredFeatures":[1040],"calculatedCost":[1026,"calculated-cost"],"isEditing":[1028,"is-editing"],"heading":[1],"planId":[1025,"plan-id"],"ownerId":[1,"owner-id"],"stripePublishableKey":[1,"stripe-publishable-key"],"displayName":[1,"display-name"],"label":[1],"card":[32],"cardStatus":[32]},[[0,"manifold-configured-feature-change","updateConfiguredFeature"]]],[0,"manifold-subscription-details",{"subscriptionId":[1,"subscription-id"],"planId":[1,"plan-id"],"heading":[1],"isEditing":[4,"is-editing"],"preview":[4]}],[0,"manifold-subscription-list",{"connection":[1040],"loading":[1028],"errors":[1040],"data":[1040],"subLinkFormat":[1025,"sub-link-format"],"heading":[1],"owner":[1]}]]]], options); | ||
}); | ||
exports.defineCustomElements = defineCustomElements; |
@@ -6,3 +6,3 @@ 'use strict'; | ||
index.patchBrowser().then(options => { | ||
return index.bootstrapLazy([["manifold-configured-feature_4.cjs",[[0,"manifold-configured-feature",{"label":[1],"value":[8]}],[0,"manifold-subscription-create",{"loading":[1028],"isLoadingPlanSelector":[1028,"is-loading-plan-selector"],"errors":[1040],"data":[1040],"planListData":[1040],"setupIntentStatus":[1025,"setup-intent-status"],"setupIntentError":[1025,"setup-intent-error"],"subscribing":[1028],"configuredFeatures":[1040],"calculatedCost":[1026,"calculated-cost"],"isEditing":[1028,"is-editing"],"heading":[1],"planId":[1025,"plan-id"],"ownerId":[1,"owner-id"],"stripePublishableKey":[1,"stripe-publishable-key"],"displayName":[1,"display-name"],"label":[1],"card":[32],"cardStatus":[32]},[[0,"manifold-configured-feature-change","updateConfiguredFeature"]]],[0,"manifold-subscription-details",{"subscriptionId":[1,"subscription-id"],"heading":[1],"isEditing":[4,"is-editing"]}],[0,"manifold-subscription-list",{"connection":[1040],"loading":[1028],"errors":[1040],"data":[1040],"subLinkFormat":[1025,"sub-link-format"],"heading":[1],"owner":[1]}]]]], options); | ||
return index.bootstrapLazy([["manifold-configured-feature_4.cjs",[[0,"manifold-configured-feature",{"label":[1],"value":[8]}],[0,"manifold-subscription-create",{"loading":[1028],"isLoadingPlanSelector":[1028,"is-loading-plan-selector"],"errors":[1040],"data":[1040],"planListData":[1040],"setupIntentStatus":[1025,"setup-intent-status"],"setupIntentError":[1025,"setup-intent-error"],"subscribing":[1028],"configuredFeatures":[1040],"calculatedCost":[1026,"calculated-cost"],"isEditing":[1028,"is-editing"],"heading":[1],"planId":[1025,"plan-id"],"ownerId":[1,"owner-id"],"stripePublishableKey":[1,"stripe-publishable-key"],"displayName":[1,"display-name"],"label":[1],"card":[32],"cardStatus":[32]},[[0,"manifold-configured-feature-change","updateConfiguredFeature"]]],[0,"manifold-subscription-details",{"subscriptionId":[1,"subscription-id"],"planId":[1,"plan-id"],"heading":[1],"isEditing":[4,"is-editing"],"preview":[4]}],[0,"manifold-subscription-list",{"connection":[1040],"loading":[1028],"errors":[1040],"data":[1040],"subLinkFormat":[1025,"sub-link-format"],"heading":[1],"owner":[1]}]]]], options); | ||
}); |
@@ -14,6 +14,48 @@ var __rest = (this && this.__rest) || function (s, e) { | ||
import store from './store'; | ||
import { toFeatureMap, configurableFeatureDefaults } from '../../../utils/plan'; | ||
import subscriptionQuery from './subscription-view.graphql'; | ||
import subscriptionPlanListQuery from './subscription-edit.graphql'; | ||
import updateSubscriptionMutation from './subscription-update.graphql'; | ||
import { PlanFeatureType, } from '../../../types/graphql'; | ||
import { toFeatureMap } from '../../../utils/plan'; | ||
import subscriptionQuery from './graphql/subscription-view.graphql'; | ||
import planFragment from './graphql/plan-fragment.graphql'; | ||
import subscriptionViewPreviewQuery from './graphql/subscription-view-preview.graphql'; | ||
import subscriptionEditPreviewQuery from './graphql/subscription-edit-preview.graphql'; | ||
import subscriptionPlanListQuery from './graphql/subscription-edit.graphql'; | ||
import updateSubscriptionMutation from './graphql/subscription-update.graphql'; | ||
export function configurableFeatureDefaults(plan) { | ||
const defaultFeatures = []; | ||
const configurableFeatures = plan.configurableFeatures.edges; | ||
if (configurableFeatures) { | ||
configurableFeatures.forEach(({ node: { label, numericDetails, featureOptions, type } }) => { | ||
switch (type) { | ||
case PlanFeatureType.Boolean: { | ||
defaultFeatures.push({ | ||
node: { | ||
label, | ||
booleanValue: false, | ||
}, | ||
}); | ||
break; | ||
} | ||
case PlanFeatureType.Number: | ||
defaultFeatures.push({ | ||
node: { | ||
label, | ||
numberValue: numericDetails === null || numericDetails === void 0 ? void 0 : numericDetails.min, | ||
}, | ||
}); | ||
break; | ||
case PlanFeatureType.String: | ||
defaultFeatures.push({ | ||
node: { | ||
label, | ||
stringValue: featureOptions === null || featureOptions === void 0 ? void 0 : featureOptions[0].value, | ||
}, | ||
}); | ||
break; | ||
default: | ||
break; | ||
} | ||
}); | ||
} | ||
return { edges: defaultFeatures }; | ||
} | ||
export const setState = (path, value, state = store.state) => { | ||
@@ -28,3 +70,3 @@ set(state, path, value); | ||
export const loadCost = async (planId, features = {}) => { | ||
var _a; | ||
const { connection } = store.state; | ||
// If a request is in flight, cancel it | ||
@@ -36,3 +78,3 @@ if (controller) { | ||
try { | ||
const res = await ((_a = store.state.connection) === null || _a === void 0 ? void 0 : _a.gateway.post(`/id/plan/${planId}/cost`, { | ||
const res = await (connection === null || connection === void 0 ? void 0 : connection.gateway.post(`/id/plan/${planId}/cost`, { | ||
features, | ||
@@ -61,10 +103,39 @@ }, { signal: controller.signal })); | ||
}; | ||
// TODO separate fetch logic from state logic | ||
export const loadSubscription = async (subscriptionId) => { | ||
const fromFeatureMap = (features = {}) => Object.entries(features).map(([label, value]) => ({ | ||
label, | ||
value: `${value}`, | ||
})); | ||
const fetchSubscriptionView = async (state = store.state) => { | ||
const { preview, connection, subscriptionId, planId = '' } = state; | ||
if (preview) { | ||
const res = await (connection === null || connection === void 0 ? void 0 : connection.graphqlFetch({ | ||
query: planFragment + subscriptionViewPreviewQuery, | ||
variables: { planId }, | ||
})); | ||
if (res === null || res === void 0 ? void 0 : res.data) { | ||
return { | ||
data: { | ||
subscription: Object.assign(Object.assign({}, res.data), { status: { | ||
label: 'AVAILABLE', | ||
percentDone: 100, | ||
message: '', | ||
}, configuredFeatures: configurableFeatureDefaults(res.data.plan) }), | ||
}, | ||
}; | ||
} | ||
return { errors: res === null || res === void 0 ? void 0 : res.errors }; | ||
} | ||
return connection === null || connection === void 0 ? void 0 : connection.graphqlFetch({ | ||
query: subscriptionQuery, | ||
variables: { id: subscriptionId }, | ||
}); | ||
}; | ||
export const getSelectedPlan = () => { | ||
var _a; | ||
const { plans, selectedPlanId } = store.state.edit; | ||
return (_a = plans === null || plans === void 0 ? void 0 : plans.find(plan => plan.node.id === selectedPlanId)) === null || _a === void 0 ? void 0 : _a.node; | ||
}; | ||
export const loadSubscription = async () => { | ||
setState('view.isLoading', true); | ||
const res = await ((_a = store.state.connection) === null || _a === void 0 ? void 0 : _a.graphqlFetch({ | ||
query: subscriptionQuery, | ||
variables: { id: subscriptionId }, | ||
})); | ||
const res = await fetchSubscriptionView(); | ||
if (res === null || res === void 0 ? void 0 : res.data) { | ||
@@ -81,36 +152,42 @@ const { subscription } = res.data; | ||
const { edit } = store.state; | ||
const configuredFeatures = configurableFeatureDefaults(edit.plans, planId); | ||
const configuredFeatures = toFeatureMap(configurableFeatureDefaults(getSelectedPlan())); | ||
setState('edit', Object.assign(Object.assign({}, edit), { selectedPlanId: planId, configuredFeatures })); | ||
updateCost('edit', planId, configuredFeatures); | ||
}; | ||
export const getSelectedPlan = () => { | ||
var _a; | ||
const { plans, selectedPlanId } = store.state.edit; | ||
return (_a = plans === null || plans === void 0 ? void 0 : plans.find(plan => plan.node.id === selectedPlanId)) === null || _a === void 0 ? void 0 : _a.node; | ||
}; | ||
const fetchSubscriptionEdit = async (variables) => { | ||
var _a; | ||
const res = await ((_a = store.state.connection) === null || _a === void 0 ? void 0 : _a.graphqlFetch({ | ||
const fetchSubscriptionEdit = async (state = store.state) => { | ||
const { preview, connection, subscriptionId, planId } = state; | ||
if (preview) { | ||
const res = await (connection === null || connection === void 0 ? void 0 : connection.graphqlFetch({ | ||
query: planFragment + subscriptionEditPreviewQuery, | ||
variables: { planId }, | ||
})); | ||
if (res === null || res === void 0 ? void 0 : res.data) { | ||
const plan = res.data.plan.product.plans.edges[0].node; | ||
return { | ||
data: { | ||
subscription: Object.assign(Object.assign({}, res.data), { status: { | ||
label: 'AVAILABLE', | ||
percentDone: 100, | ||
message: '', | ||
}, configuredFeatures: configurableFeatureDefaults(plan) }), | ||
}, | ||
}; | ||
} | ||
return { errors: res === null || res === void 0 ? void 0 : res.errors }; | ||
} | ||
const res = await (connection === null || connection === void 0 ? void 0 : connection.graphqlFetch({ | ||
query: subscriptionPlanListQuery, | ||
variables, | ||
variables: { subscriptionId }, | ||
})); | ||
if (res === null || res === void 0 ? void 0 : res.data) { | ||
const { plan, configuredFeatures } = res.data.subscription; | ||
return { | ||
data: { | ||
selectedPlanId: plan.id, | ||
plans: plan.product.plans.edges, | ||
configuredFeatures, | ||
}, | ||
}; | ||
} | ||
return { errors: res === null || res === void 0 ? void 0 : res.errors }; | ||
return res; | ||
}; | ||
export const editSubscription = async () => { | ||
setState('isUpdated', false); | ||
setIsEditing(true); | ||
setState('edit.isLoading', true); | ||
const { edit, subscriptionId = '' } = store.state; | ||
const res = await fetchSubscriptionEdit({ subscriptionId }); | ||
if (res.data) { | ||
setState('edit', Object.assign(Object.assign(Object.assign({}, edit), res.data), { configuredFeatures: toFeatureMap(res.data.configuredFeatures) })); | ||
const { edit } = store.state; | ||
const res = await fetchSubscriptionEdit(); | ||
if (res === null || res === void 0 ? void 0 : res.data) { | ||
const { plan, configuredFeatures } = res.data.subscription; | ||
setState('edit', Object.assign(Object.assign({}, edit), { selectedPlanId: plan.id, plans: plan.product.plans.edges, configuredFeatures: toFeatureMap(configuredFeatures) })); | ||
} | ||
@@ -123,20 +200,32 @@ setState('edit.isLoading', false); | ||
const fetchUpdateSubscription = async (variables) => { | ||
var _a; | ||
const res = await ((_a = store.state.connection) === null || _a === void 0 ? void 0 : _a.graphqlFetch({ | ||
const { preview, connection } = store.state; | ||
if (preview) { | ||
const res = await (connection === null || connection === void 0 ? void 0 : connection.graphqlFetch({ | ||
query: planFragment + subscriptionViewPreviewQuery, | ||
variables, | ||
})); | ||
if (res === null || res === void 0 ? void 0 : res.data) { | ||
const plan = getSelectedPlan(); | ||
return { | ||
data: { | ||
updateSubscription: { | ||
data: Object.assign(Object.assign({}, res.data), { status: { | ||
label: 'AVAILABLE', | ||
percentDone: 100, | ||
message: '', | ||
}, configuredFeatures: configurableFeatureDefaults(plan) }), | ||
}, | ||
}, | ||
}; | ||
} | ||
return { errors: res === null || res === void 0 ? void 0 : res.errors }; | ||
} | ||
const res = await (connection === null || connection === void 0 ? void 0 : connection.graphqlFetch({ | ||
query: updateSubscriptionMutation, | ||
variables, | ||
})); | ||
if (res === null || res === void 0 ? void 0 : res.data) { | ||
return { | ||
data: res.data.updateSubscription.data, | ||
}; | ||
} | ||
return { errors: res === null || res === void 0 ? void 0 : res.errors }; | ||
return res; | ||
}; | ||
const fromFeatureMap = (features = {}) => Object.entries(features).map(([label, value]) => ({ | ||
label, | ||
value: `${value}`, | ||
})); | ||
export const updateSubscription = async () => { | ||
var _a; | ||
var _a, _b, _c; | ||
setState('isUpdating', true); | ||
@@ -147,3 +236,3 @@ setState('edit.errors', []); | ||
try { | ||
const { data } = await fetchUpdateSubscription({ | ||
const res = await fetchUpdateSubscription({ | ||
id: subscriptionId || '', | ||
@@ -153,2 +242,3 @@ planId, | ||
}); | ||
const data = (_c = (_b = res === null || res === void 0 ? void 0 : res.data) === null || _b === void 0 ? void 0 : _b.updateSubscription) === null || _c === void 0 ? void 0 : _c.data; | ||
if (data) { | ||
@@ -155,0 +245,0 @@ const featureMap = toFeatureMap(data.configuredFeatures); |
@@ -8,2 +8,3 @@ import { Component, h, Prop, Element } from '@stencil/core'; | ||
this.isEditing = false; | ||
this.preview = false; | ||
} | ||
@@ -15,2 +16,4 @@ // Can this be abstracted/optimized further? | ||
setState('subscriptionId', this.subscriptionId); | ||
setState('preview', this.preview); | ||
setState('planId', this.planId); | ||
if (this.isEditing) { | ||
@@ -22,3 +25,3 @@ editSubscription(); | ||
} | ||
loadSubscription(this.subscriptionId); | ||
loadSubscription(); | ||
} | ||
@@ -35,7 +38,7 @@ render() { | ||
"original": "string", | ||
"resolved": "string", | ||
"resolved": "string | undefined", | ||
"references": {} | ||
}, | ||
"required": false, | ||
"optional": false, | ||
"optional": true, | ||
"docs": { | ||
@@ -48,2 +51,19 @@ "tags": [], | ||
}, | ||
"planId": { | ||
"type": "string", | ||
"mutable": false, | ||
"complexType": { | ||
"original": "string", | ||
"resolved": "string | undefined", | ||
"references": {} | ||
}, | ||
"required": false, | ||
"optional": true, | ||
"docs": { | ||
"tags": [], | ||
"text": "" | ||
}, | ||
"attribute": "plan-id", | ||
"reflect": false | ||
}, | ||
"heading": { | ||
@@ -83,2 +103,20 @@ "type": "string", | ||
"defaultValue": "false" | ||
}, | ||
"preview": { | ||
"type": "boolean", | ||
"mutable": false, | ||
"complexType": { | ||
"original": "boolean", | ||
"resolved": "boolean | undefined", | ||
"references": {} | ||
}, | ||
"required": false, | ||
"optional": true, | ||
"docs": { | ||
"tags": [], | ||
"text": "" | ||
}, | ||
"attribute": "preview", | ||
"reflect": false, | ||
"defaultValue": "false" | ||
} | ||
@@ -85,0 +123,0 @@ }; } |
@@ -1,1 +0,1 @@ | ||
import{p as i,b as a}from"./p-a98c757b.js";i().then(i=>a([["p-1ea3c661",[[0,"manifold-configured-feature",{label:[1],value:[8]}],[0,"manifold-subscription-create",{loading:[1028],isLoadingPlanSelector:[1028,"is-loading-plan-selector"],errors:[1040],data:[1040],planListData:[1040],setupIntentStatus:[1025,"setup-intent-status"],setupIntentError:[1025,"setup-intent-error"],subscribing:[1028],configuredFeatures:[1040],calculatedCost:[1026,"calculated-cost"],isEditing:[1028,"is-editing"],heading:[1],planId:[1025,"plan-id"],ownerId:[1,"owner-id"],stripePublishableKey:[1,"stripe-publishable-key"],displayName:[1,"display-name"],label:[1],card:[32],cardStatus:[32]},[[0,"manifold-configured-feature-change","updateConfiguredFeature"]]],[0,"manifold-subscription-details",{subscriptionId:[1,"subscription-id"],heading:[1],isEditing:[4,"is-editing"]}],[0,"manifold-subscription-list",{connection:[1040],loading:[1028],errors:[1040],data:[1040],subLinkFormat:[1025,"sub-link-format"],heading:[1],owner:[1]}]]]],i)); | ||
import{p as i,b as e}from"./p-a98c757b.js";i().then(i=>e([["p-34fdb56e",[[0,"manifold-configured-feature",{label:[1],value:[8]}],[0,"manifold-subscription-create",{loading:[1028],isLoadingPlanSelector:[1028,"is-loading-plan-selector"],errors:[1040],data:[1040],planListData:[1040],setupIntentStatus:[1025,"setup-intent-status"],setupIntentError:[1025,"setup-intent-error"],subscribing:[1028],configuredFeatures:[1040],calculatedCost:[1026,"calculated-cost"],isEditing:[1028,"is-editing"],heading:[1],planId:[1025,"plan-id"],ownerId:[1,"owner-id"],stripePublishableKey:[1,"stripe-publishable-key"],displayName:[1,"display-name"],label:[1],card:[32],cardStatus:[32]},[[0,"manifold-configured-feature-change","updateConfiguredFeature"]]],[0,"manifold-subscription-details",{subscriptionId:[1,"subscription-id"],planId:[1,"plan-id"],heading:[1],isEditing:[4,"is-editing"],preview:[4]}],[0,"manifold-subscription-list",{connection:[1040],loading:[1028],errors:[1040],data:[1040],subLinkFormat:[1025,"sub-link-format"],heading:[1],owner:[1]}]]]],i)); |
@@ -1,1 +0,1 @@ | ||
System.register(["./p-a956fdd1.system.js"],(function(){"use strict";var e,t;return{setters:[function(i){e=i.p;t=i.b}],execute:function(){e().then((function(e){return t([["p-df084dbc.system",[[0,"manifold-configured-feature",{label:[1],value:[8]}],[0,"manifold-subscription-create",{loading:[1028],isLoadingPlanSelector:[1028,"is-loading-plan-selector"],errors:[1040],data:[1040],planListData:[1040],setupIntentStatus:[1025,"setup-intent-status"],setupIntentError:[1025,"setup-intent-error"],subscribing:[1028],configuredFeatures:[1040],calculatedCost:[1026,"calculated-cost"],isEditing:[1028,"is-editing"],heading:[1],planId:[1025,"plan-id"],ownerId:[1,"owner-id"],stripePublishableKey:[1,"stripe-publishable-key"],displayName:[1,"display-name"],label:[1],card:[32],cardStatus:[32]},[[0,"manifold-configured-feature-change","updateConfiguredFeature"]]],[0,"manifold-subscription-details",{subscriptionId:[1,"subscription-id"],heading:[1],isEditing:[4,"is-editing"]}],[0,"manifold-subscription-list",{connection:[1040],loading:[1028],errors:[1040],data:[1040],subLinkFormat:[1025,"sub-link-format"],heading:[1],owner:[1]}]]]],e)}))}}})); | ||
System.register(["./p-a956fdd1.system.js"],(function(){"use strict";var e,i;return{setters:[function(t){e=t.p;i=t.b}],execute:function(){e().then((function(e){return i([["p-efe5d25c.system",[[0,"manifold-configured-feature",{label:[1],value:[8]}],[0,"manifold-subscription-create",{loading:[1028],isLoadingPlanSelector:[1028,"is-loading-plan-selector"],errors:[1040],data:[1040],planListData:[1040],setupIntentStatus:[1025,"setup-intent-status"],setupIntentError:[1025,"setup-intent-error"],subscribing:[1028],configuredFeatures:[1040],calculatedCost:[1026,"calculated-cost"],isEditing:[1028,"is-editing"],heading:[1],planId:[1025,"plan-id"],ownerId:[1,"owner-id"],stripePublishableKey:[1,"stripe-publishable-key"],displayName:[1,"display-name"],label:[1],card:[32],cardStatus:[32]},[[0,"manifold-configured-feature-change","updateConfiguredFeature"]]],[0,"manifold-subscription-details",{subscriptionId:[1,"subscription-id"],planId:[1,"plan-id"],heading:[1],isEditing:[4,"is-editing"],preview:[4]}],[0,"manifold-subscription-list",{connection:[1040],loading:[1028],errors:[1040],data:[1040],subLinkFormat:[1025,"sub-link-format"],heading:[1],owner:[1]}]]]],e)}))}}})); |
@@ -59,3 +59,5 @@ /* eslint-disable */ | ||
"isEditing"?: boolean; | ||
"subscriptionId": string; | ||
"planId"?: string; | ||
"preview"?: boolean; | ||
"subscriptionId"?: string; | ||
} | ||
@@ -162,2 +164,4 @@ interface ManifoldSubscriptionList { | ||
"isEditing"?: boolean; | ||
"planId"?: string; | ||
"preview"?: boolean; | ||
"subscriptionId"?: string; | ||
@@ -164,0 +168,0 @@ } |
import { Connection } from '@manifoldco/manifold-init-types/types/v0'; | ||
import { Plan } from '../../../types/graphql'; | ||
import { FeatureMap } from '../../../utils/plan'; | ||
export declare function configurableFeatureDefaults(plan: Plan): { | ||
edges: ({ | ||
__typename?: "ConfiguredFeatureEdge" | undefined; | ||
} & { | ||
node: ({ | ||
__typename?: "NumberConfiguredFeature" | undefined; | ||
} & Pick<import("../../../types/graphql").NumberConfiguredFeature, "label"> & { | ||
numberValue: number; | ||
}) | ({ | ||
__typename?: "StringConfiguredFeature" | undefined; | ||
} & Pick<import("../../../types/graphql").StringConfiguredFeature, "label"> & { | ||
stringValue: string; | ||
}) | ({ | ||
__typename?: "BooleanConfiguredFeature" | undefined; | ||
} & Pick<import("../../../types/graphql").BooleanConfiguredFeature, "label"> & { | ||
booleanValue: boolean; | ||
}); | ||
})[]; | ||
}; | ||
export declare const setState: (path: string, value?: unknown, state?: { | ||
@@ -8,2 +28,4 @@ connection?: Connection | undefined; | ||
subscriptionId?: string | undefined; | ||
planId?: string | undefined; | ||
preview?: boolean | undefined; | ||
isUpdated?: boolean | undefined; | ||
@@ -27,3 +49,3 @@ isUpdating?: boolean | undefined; | ||
__typename?: "Plan" | undefined; | ||
} & Pick<import("../../../types/graphql").Plan, "label" | "id" | "displayName" | "free" | "cost"> & { | ||
} & Pick<Plan, "label" | "id" | "displayName" | "free" | "cost"> & { | ||
product: { | ||
@@ -99,4 +121,2 @@ __typename?: "Product" | undefined; | ||
}>; | ||
export declare const loadSubscription: (subscriptionId: string) => Promise<void>; | ||
export declare const selectPlan: (planId: string) => void; | ||
export declare const getSelectedPlan: () => ({ | ||
@@ -106,3 +126,3 @@ __typename?: "Plan" | undefined; | ||
__typename?: "Plan" | undefined; | ||
} & Pick<import("../../../types/graphql").Plan, "label" | "id" | "displayName" | "free" | "cost"> & { | ||
} & Pick<Plan, "label" | "id" | "displayName" | "free" | "cost"> & { | ||
product: { | ||
@@ -164,2 +184,4 @@ __typename?: "Product" | undefined; | ||
}) | undefined; | ||
export declare const loadSubscription: () => Promise<void>; | ||
export declare const selectPlan: (planId: string) => void; | ||
export declare const editSubscription: () => Promise<void>; | ||
@@ -166,0 +188,0 @@ export declare const cancelEditSubscription: () => void; |
@@ -25,2 +25,4 @@ import { Connection } from '@manifoldco/manifold-init-types/types/v0'; | ||
subscriptionId?: string; | ||
planId?: string; | ||
preview?: boolean; | ||
isUpdated?: boolean; | ||
@@ -27,0 +29,0 @@ isUpdating?: boolean; |
export declare class ManifoldSubscriptionDetails { | ||
el: HTMLElement; | ||
subscriptionId: string; | ||
subscriptionId?: string; | ||
planId?: string; | ||
heading?: string; | ||
isEditing?: boolean; | ||
preview?: boolean; | ||
componentWillLoad(): Promise<void>; | ||
render(): any; | ||
} |
@@ -799,2 +799,3 @@ export declare type Maybe<T> = T; | ||
id: Scalars['ID']; | ||
latest: Maybe<Scalars['Boolean']>; | ||
}; | ||
@@ -1242,5 +1243,5 @@ export declare type QueryProductArgs = { | ||
node: ({ | ||
__typename?: 'BooleanConfiguredFeature'; | ||
} & Pick<BooleanConfiguredFeature, 'label'> & { | ||
booleanValue: BooleanConfiguredFeature['value']; | ||
__typename?: 'NumberConfiguredFeature'; | ||
} & Pick<NumberConfiguredFeature, 'label'> & { | ||
numberValue: NumberConfiguredFeature['value']; | ||
}) | ({ | ||
@@ -1251,5 +1252,5 @@ __typename?: 'StringConfiguredFeature'; | ||
}) | ({ | ||
__typename?: 'NumberConfiguredFeature'; | ||
} & Pick<NumberConfiguredFeature, 'label'> & { | ||
numberValue: NumberConfiguredFeature['value']; | ||
__typename?: 'BooleanConfiguredFeature'; | ||
} & Pick<BooleanConfiguredFeature, 'label'> & { | ||
booleanValue: BooleanConfiguredFeature['value']; | ||
}); | ||
@@ -1317,2 +1318,28 @@ })>; | ||
}); | ||
export declare type SubscriptionEditPreviewQueryVariables = { | ||
planId: Scalars['ID']; | ||
}; | ||
export declare type SubscriptionEditPreviewQuery = ({ | ||
__typename?: 'Query'; | ||
} & { | ||
plan: Maybe<({ | ||
__typename?: 'Plan'; | ||
} & Pick<Plan, 'id'> & { | ||
product: Maybe<({ | ||
__typename?: 'Product'; | ||
} & { | ||
plans: Maybe<({ | ||
__typename?: 'PlanConnection'; | ||
} & { | ||
edges: Array<({ | ||
__typename?: 'PlanEdge'; | ||
} & { | ||
node: ({ | ||
__typename?: 'Plan'; | ||
} & PlanFragment); | ||
})>; | ||
})>; | ||
})>; | ||
})>; | ||
}); | ||
export declare type SubscriptionEditQueryVariables = { | ||
@@ -1377,2 +1404,12 @@ subscriptionId: Scalars['ID']; | ||
}); | ||
export declare type SubscriptionViewPreviewQueryVariables = { | ||
planId: Scalars['ID']; | ||
}; | ||
export declare type SubscriptionViewPreviewQuery = ({ | ||
__typename?: 'Query'; | ||
} & { | ||
plan: Maybe<({ | ||
__typename?: 'Plan'; | ||
} & PlanFragment)>; | ||
}); | ||
export declare type SubscriptionViewQueryVariables = { | ||
@@ -1379,0 +1416,0 @@ id: Scalars['ID']; |
{ | ||
"name": "@manifoldco/manifold-subscription", | ||
"version": "0.0.11", | ||
"version": "0.0.12", | ||
"private": false, | ||
@@ -5,0 +5,0 @@ "description": "Manifold Subscription Web Components", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1386150
21438