gristlabs_grist-core/app/common/Features-ti.ts
Jarosław Sadziński 60423edc17 (core) Customizable stripe plans.
Summary:
- Reading plans from Stripe, and allowing Stripe to define custom plans.
- Storing product features (aka limits) in Stripe, that override those in db.
- Adding hierarchical data in Stripe. All features are defined at Product level but can be overwritten on Price levels.
- New options for Support user to
-- Override product for team site (if he is added as a billing manager)
-- Override subscription and customer id for a team site
-- Attach an "offer", an custom plan configured in stripe that a team site can use
-- Enabling wire transfer for subscription by allowing subscription to be created without a payment method (which is customizable)

Test Plan: Updated and new.

Reviewers: georgegevoian

Reviewed By: georgegevoian

Differential Revision: https://phab.getgrist.com/D4201
2024-05-19 09:09:19 +02:00

53 lines
1.5 KiB
TypeScript

/**
* This module was automatically generated by `ts-interface-builder`
*/
import * as t from "ts-interface-checker";
// tslint:disable:object-literal-key-quotes
export const SnapshotWindow = t.iface([], {
"count": "number",
"unit": t.union(t.lit('days'), t.lit('month'), t.lit('year')),
});
export const Product = t.iface([], {
"name": "string",
"features": "Features",
});
export const Features = t.iface([], {
"vanityDomain": t.opt("boolean"),
"workspaces": t.opt("boolean"),
"maxSharesPerDoc": t.opt("number"),
"maxSharesPerDocPerRole": t.opt(t.iface([], {
[t.indexKey]: "number",
})),
"maxSharesPerWorkspace": t.opt("number"),
"maxDocsPerOrg": t.opt("number"),
"maxWorkspacesPerOrg": t.opt("number"),
"readOnlyDocs": t.opt("boolean"),
"snapshotWindow": t.opt("SnapshotWindow"),
"baseMaxRowsPerDocument": t.opt("number"),
"baseMaxApiUnitsPerDocumentPerDay": t.opt("number"),
"baseMaxDataSizePerDocument": t.opt("number"),
"baseMaxAttachmentsBytesPerDocument": t.opt("number"),
"gracePeriodDays": t.opt("number"),
"baseMaxAssistantCalls": t.opt("number"),
"minimumUnits": t.opt("number"),
});
export const StripeMetaValues = t.iface([], {
"isStandard": t.opt("boolean"),
"gristProduct": t.opt("string"),
"gristLimit": t.opt("string"),
"family": t.opt("string"),
"trialPeriodDays": t.opt("number"),
});
const exportedTypeSuite: t.ITypeSuite = {
SnapshotWindow,
Product,
Features,
StripeMetaValues,
};
export default exportedTypeSuite;