save whole subscription object

This commit is contained in:
adueck 2022-10-15 09:55:37 +05:00
parent 8fd749dcae
commit dc1a5af77a
3 changed files with 25 additions and 2 deletions

View File

@ -39,6 +39,7 @@
"react-router-dom": "^5.2.0",
"react-scripts": "4.0.3",
"relevancy": "^0.2.0",
"stripe": "^10.14.0",
"supermemo": "^2.0.17",
"typescript": "^4.2.3",
"web-vitals": "^0.2.4",

View File

@ -15,7 +15,7 @@ export type GoogleProfile = WoutRJ<import("passport-google-oauth").Profile> & {
export type GitHubProfile = WoutRJ<import("passport-github2").Profile> & { accessToken: string };
export type TwitterProfile = WoutRJ<import("passport-twitter").Profile> & { token: string, tokenSecret: string };
export type ProviderProfile = GoogleProfile | GitHubProfile | TwitterProfile;
export type UserLevel = "basic" | "student" | "editor";
export type UserLevel = "basic" | "student" | "editor";
export type UserTextOptions = Omit<import("@lingdocs/ps-react").Types.TextOptions, "pTextSize">;
@ -30,6 +30,8 @@ export type TestResult = {
id: string,
}
export type StripeSubscription = import("stripe").Stripe.Subscription;
// TODO: TYPE GUARDING SO WE NEVER HAVE A USER WITH NO Id or Password
export type LingdocsUser = {
userId: UUID,
@ -56,7 +58,7 @@ export type LingdocsUser = {
level: "student" | "editor",
couchDbPassword: UserDbPassword,
wordlistDbName: WordlistDbName,
subscriptionId: string | undefined,
subscription?: StripeSubscription,
}
) & import("nano").MaybeDocument;

View File

@ -2856,6 +2856,11 @@
resolved "https://registry.yarnpkg.com/@types/node/-/node-16.6.1.tgz#aee62c7b966f55fc66c7b6dfa1d58db2a616da61"
integrity sha512-Sr7BhXEAer9xyGuCN3Ek9eg9xPviCF2gfu9kTfuU2HkTVAMYSDeX40fvpmo72n5nansg3nsBjuQBrsS28r+NUw==
"@types/node@>=8.1.0":
version "18.11.0"
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.0.tgz#f38c7139247a1d619f6cc6f27b072606af7c289d"
integrity sha512-IOXCvVRToe7e0ny7HpT/X9Rb2RYtElG1a+VshjwT00HxrM2dWBApHQoqsI6WiY7Q03vdf2bCrIGzVrkF/5t10w==
"@types/node@^14.14.33":
version "14.17.9"
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.17.9.tgz#b97c057e6138adb7b720df2bd0264b03c9f504fd"
@ -11148,6 +11153,13 @@ qs@6.10.3:
dependencies:
side-channel "^1.0.4"
qs@^6.11.0:
version "6.11.0"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.0.tgz#fd0d963446f7a65e1367e01abd85429453f0c37a"
integrity sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==
dependencies:
side-channel "^1.0.4"
qs@^6.9.4:
version "6.10.1"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.10.1.tgz#4931482fa8d647a5aab799c5271d2133b981fb6a"
@ -12808,6 +12820,14 @@ strip-json-comments@^3.1.0, strip-json-comments@^3.1.1:
resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006"
integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==
stripe@^10.14.0:
version "10.14.0"
resolved "https://registry.yarnpkg.com/stripe/-/stripe-10.14.0.tgz#3db35b434321bb1f1231267c6c960bfa442573ac"
integrity sha512-cXqUdZvrU20KElhLjzw/kW5t2SLLUENqeEftaiQXLogkUdNHyz/L12S4WHmQ8h0KHHFhxO39I7Q9GkJO1MMzzw==
dependencies:
"@types/node" ">=8.1.0"
qs "^6.11.0"
style-loader@1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-1.3.0.tgz#828b4a3b3b7e7aa5847ce7bae9e874512114249e"