@quesmed/types 2.6.303 → 2.6.306

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -51,7 +51,11 @@ export interface IStudyGroupProduct {
51
51
  stripePriceId: string;
52
52
  }
53
53
  export interface IGroupDiscountOffer {
54
- product: IStudyGroupProduct;
54
+ productTypeId: EProductType;
55
+ /** Product type name, e.g. "MRCP PACES Video Course" */
56
+ productName: string;
57
+ /** Every public plan of the product, cheapest first; joiners can buy any of them */
58
+ plans: IStudyGroupProduct[];
55
59
  tiers: IGroupDiscountTier[];
56
60
  maxMembers: number;
57
61
  windowDays: number;
@@ -76,7 +80,11 @@ export interface IStudyGroupInvite {
76
80
  closesAt: number | Date;
77
81
  state: EStudyGroupInviteState;
78
82
  viewerState: EStudyGroupViewerState;
79
- product: IStudyGroupProduct;
83
+ productTypeId: EProductType;
84
+ /** Product type name, e.g. "MRCP PACES Video Course" */
85
+ productName: string;
86
+ /** Every public plan of the product, cheapest first; joiners can buy any of them */
87
+ plans: IStudyGroupProduct[];
80
88
  }
81
89
  export interface IStudyGroupMember {
82
90
  id: number;
@@ -109,7 +117,11 @@ export interface IStudyGroup {
109
117
  opensAt: number | Date;
110
118
  closesAt: number | Date;
111
119
  closedAt: number | Date | null;
112
- product: IStudyGroupProduct;
120
+ productTypeId: EProductType;
121
+ /** Product type name, e.g. "MRCP PACES Video Course" */
122
+ productName: string;
123
+ /** Every public plan of the product, cheapest first; joiners can buy any of them */
124
+ plans: IStudyGroupProduct[];
113
125
  tiers: IGroupDiscountTier[];
114
126
  maxMembers: number;
115
127
  memberCount: number;
@@ -16,7 +16,9 @@ exports.STUDY_GROUP_PRODUCT_FIELDS = (0, client_1.gql) `
16
16
  exports.GROUP_DISCOUNT_OFFER_FIELDS = (0, client_1.gql) `
17
17
  ${exports.STUDY_GROUP_PRODUCT_FIELDS}
18
18
  fragment GroupDiscountOfferFields on GroupDiscountOffer {
19
- product {
19
+ productTypeId
20
+ productName
21
+ plans {
20
22
  ...StudyGroupProductFields
21
23
  }
22
24
  tiers {
@@ -38,7 +40,9 @@ exports.STUDY_GROUP_FIELDS = (0, client_1.gql) `
38
40
  opensAt
39
41
  closesAt
40
42
  closedAt
41
- product {
43
+ productTypeId
44
+ productName
45
+ plans {
42
46
  ...StudyGroupProductFields
43
47
  }
44
48
  tiers {
@@ -21,6 +21,23 @@ export interface ILoginUserVar {
21
21
  days: number;
22
22
  }
23
23
  export type ILoginUserData = RootData<string, 'loginUser'>;
24
+ export declare const LOGIN_WITH_SSO: import("@apollo/client").DocumentNode;
25
+ export interface ILoginWithSsoVar {
26
+ code: string;
27
+ days: number;
28
+ codeVerifier?: string;
29
+ }
30
+ export type ILoginWithSsoData = RootData<string, 'loginWithSso'>;
31
+ export type ISsoCheckResponse = {
32
+ enabled: false;
33
+ } | {
34
+ enabled: true;
35
+ required: boolean;
36
+ name: string;
37
+ slug: string;
38
+ };
39
+ export type SsoCallbackError = 'no_connection' | 'no_account' | 'invalid_state' | 'idp_error' | 'invalid_request';
40
+ export declare const SSO_REQUIRED_MESSAGE = "Your university requires sign-in with university SSO.";
24
41
  export declare const REGISTER_USER: import("@apollo/client").DocumentNode;
25
42
  export interface RegisterUserInput {
26
43
  displayName?: string;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RESET_PASSWORD = exports.RESET_PASSWORD_PREP = exports.REGISTER_USER = exports.LOGIN_USER = exports.REGISTER_ADMIN = exports.LOGIN_ADMIN = void 0;
3
+ exports.RESET_PASSWORD = exports.RESET_PASSWORD_PREP = exports.REGISTER_USER = exports.SSO_REQUIRED_MESSAGE = exports.LOGIN_WITH_SSO = exports.LOGIN_USER = exports.REGISTER_ADMIN = exports.LOGIN_ADMIN = void 0;
4
4
  const client_1 = require("@apollo/client");
5
5
  exports.LOGIN_ADMIN = (0, client_1.gql) `
6
6
  mutation LoginAdmin($username: String!, $password: String!, $days: Int!) {
@@ -27,6 +27,13 @@ exports.LOGIN_USER = (0, client_1.gql) `
27
27
  loginUser(username: $username, password: $password, days: $days)
28
28
  }
29
29
  `;
30
+ exports.LOGIN_WITH_SSO = (0, client_1.gql) `
31
+ mutation LoginWithSso($code: String!, $days: Int!, $codeVerifier: String) {
32
+ loginWithSso(code: $code, days: $days, codeVerifier: $codeVerifier)
33
+ }
34
+ `;
35
+ // loginUser / resetPasswordPrep / resetPassword error when ssoRequired is on
36
+ exports.SSO_REQUIRED_MESSAGE = 'Your university requires sign-in with university SSO.';
30
37
  exports.REGISTER_USER = (0, client_1.gql) `
31
38
  mutation RegisterUser($userData: RegisterUser!) {
32
39
  registerUser(userData: $userData)
@@ -1,6 +1,7 @@
1
1
  export declare const CREATE_STUDY_GROUP_CHECKOUT_SESSION: import("@apollo/client").DocumentNode;
2
2
  export interface ICreateStudyGroupCheckoutSessionVar {
3
3
  code: string;
4
+ productId: number;
4
5
  successUrl?: string;
5
6
  cancelUrl?: string;
6
7
  }
@@ -3,16 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CREATE_STUDY_GROUP_CHECKOUT_SESSION = void 0;
4
4
  const client_1 = require("@apollo/client");
5
5
  // Returns the Stripe Checkout session id (same as CREATE_NEW_SUBSCRIPTION_CHECKOUT_SESSION).
6
- // Promo codes are disabled on this session.
6
+ // productId is any plan from the group's `plans`. Promo codes are disabled on this session.
7
7
  exports.CREATE_STUDY_GROUP_CHECKOUT_SESSION = (0, client_1.gql) `
8
8
  mutation CreateStudyGroupCheckoutSession(
9
9
  $code: String!
10
+ $productId: Int!
10
11
  $successUrl: String
11
12
  $cancelUrl: String
12
13
  ) {
13
14
  validUserToken {
14
15
  createStudyGroupCheckoutSession(
15
16
  code: $code
17
+ productId: $productId
16
18
  successUrl: $successUrl
17
19
  cancelUrl: $cancelUrl
18
20
  )
@@ -1,10 +1,10 @@
1
1
  import { EProductType, IGroupDiscountOffer, IStudyGroupInvite } from '../../models';
2
2
  import { RootData, graphqlNormalize } from '../types';
3
- export type IGroupDiscountOffersData = RootData<(graphqlNormalize & IGroupDiscountOffer)[], 'groupDiscountOffers'>;
4
- export interface IGroupDiscountOffersVar {
3
+ export type IGroupDiscountOfferData = RootData<(graphqlNormalize & IGroupDiscountOffer) | null, 'groupDiscountOffer'>;
4
+ export interface IGroupDiscountOfferVar {
5
5
  productTypeId: EProductType;
6
6
  }
7
- export declare const GROUP_DISCOUNT_OFFERS: import("@apollo/client").DocumentNode;
7
+ export declare const GROUP_DISCOUNT_OFFER: import("@apollo/client").DocumentNode;
8
8
  export type IStudyGroupInviteData = RootData<(graphqlNormalize & IStudyGroupInvite) | null, 'studyGroupInvite'>;
9
9
  export interface IStudyGroupInviteVar {
10
10
  code: string;
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.STUDY_GROUP_INVITE = exports.GROUP_DISCOUNT_OFFERS = void 0;
3
+ exports.STUDY_GROUP_INVITE = exports.GROUP_DISCOUNT_OFFER = void 0;
4
4
  const client_1 = require("@apollo/client");
5
5
  const fragments_1 = require("../fragments");
6
- exports.GROUP_DISCOUNT_OFFERS = (0, client_1.gql) `
6
+ exports.GROUP_DISCOUNT_OFFER = (0, client_1.gql) `
7
7
  ${fragments_1.GROUP_DISCOUNT_OFFER_FIELDS}
8
- query GroupDiscountOffers($productTypeId: Int!) {
9
- groupDiscountOffers(productTypeId: $productTypeId) {
8
+ query GroupDiscountOffer($productTypeId: Int!) {
9
+ groupDiscountOffer(productTypeId: $productTypeId) {
10
10
  ...GroupDiscountOfferFields
11
11
  }
12
12
  }
@@ -35,7 +35,9 @@ exports.STUDY_GROUP_INVITE = (0, client_1.gql) `
35
35
  closesAt
36
36
  state
37
37
  viewerState
38
- product {
38
+ productTypeId
39
+ productName
40
+ plans {
39
41
  ...StudyGroupProductFields
40
42
  }
41
43
  }
@@ -51,7 +51,11 @@ export interface IStudyGroupProduct {
51
51
  stripePriceId: string;
52
52
  }
53
53
  export interface IGroupDiscountOffer {
54
- product: IStudyGroupProduct;
54
+ productTypeId: EProductType;
55
+ /** Product type name, e.g. "MRCP PACES Video Course" */
56
+ productName: string;
57
+ /** Every public plan of the product, cheapest first; joiners can buy any of them */
58
+ plans: IStudyGroupProduct[];
55
59
  tiers: IGroupDiscountTier[];
56
60
  maxMembers: number;
57
61
  windowDays: number;
@@ -76,7 +80,11 @@ export interface IStudyGroupInvite {
76
80
  closesAt: number | Date;
77
81
  state: EStudyGroupInviteState;
78
82
  viewerState: EStudyGroupViewerState;
79
- product: IStudyGroupProduct;
83
+ productTypeId: EProductType;
84
+ /** Product type name, e.g. "MRCP PACES Video Course" */
85
+ productName: string;
86
+ /** Every public plan of the product, cheapest first; joiners can buy any of them */
87
+ plans: IStudyGroupProduct[];
80
88
  }
81
89
  export interface IStudyGroupMember {
82
90
  id: number;
@@ -109,7 +117,11 @@ export interface IStudyGroup {
109
117
  opensAt: number | Date;
110
118
  closesAt: number | Date;
111
119
  closedAt: number | Date | null;
112
- product: IStudyGroupProduct;
120
+ productTypeId: EProductType;
121
+ /** Product type name, e.g. "MRCP PACES Video Course" */
122
+ productName: string;
123
+ /** Every public plan of the product, cheapest first; joiners can buy any of them */
124
+ plans: IStudyGroupProduct[];
113
125
  tiers: IGroupDiscountTier[];
114
126
  maxMembers: number;
115
127
  memberCount: number;
@@ -13,7 +13,9 @@ export const STUDY_GROUP_PRODUCT_FIELDS = gql `
13
13
  export const GROUP_DISCOUNT_OFFER_FIELDS = gql `
14
14
  ${STUDY_GROUP_PRODUCT_FIELDS}
15
15
  fragment GroupDiscountOfferFields on GroupDiscountOffer {
16
- product {
16
+ productTypeId
17
+ productName
18
+ plans {
17
19
  ...StudyGroupProductFields
18
20
  }
19
21
  tiers {
@@ -35,7 +37,9 @@ export const STUDY_GROUP_FIELDS = gql `
35
37
  opensAt
36
38
  closesAt
37
39
  closedAt
38
- product {
40
+ productTypeId
41
+ productName
42
+ plans {
39
43
  ...StudyGroupProductFields
40
44
  }
41
45
  tiers {
@@ -21,6 +21,23 @@ export interface ILoginUserVar {
21
21
  days: number;
22
22
  }
23
23
  export type ILoginUserData = RootData<string, 'loginUser'>;
24
+ export declare const LOGIN_WITH_SSO: import("@apollo/client").DocumentNode;
25
+ export interface ILoginWithSsoVar {
26
+ code: string;
27
+ days: number;
28
+ codeVerifier?: string;
29
+ }
30
+ export type ILoginWithSsoData = RootData<string, 'loginWithSso'>;
31
+ export type ISsoCheckResponse = {
32
+ enabled: false;
33
+ } | {
34
+ enabled: true;
35
+ required: boolean;
36
+ name: string;
37
+ slug: string;
38
+ };
39
+ export type SsoCallbackError = 'no_connection' | 'no_account' | 'invalid_state' | 'idp_error' | 'invalid_request';
40
+ export declare const SSO_REQUIRED_MESSAGE = "Your university requires sign-in with university SSO.";
24
41
  export declare const REGISTER_USER: import("@apollo/client").DocumentNode;
25
42
  export interface RegisterUserInput {
26
43
  displayName?: string;
@@ -24,6 +24,13 @@ export const LOGIN_USER = gql `
24
24
  loginUser(username: $username, password: $password, days: $days)
25
25
  }
26
26
  `;
27
+ export const LOGIN_WITH_SSO = gql `
28
+ mutation LoginWithSso($code: String!, $days: Int!, $codeVerifier: String) {
29
+ loginWithSso(code: $code, days: $days, codeVerifier: $codeVerifier)
30
+ }
31
+ `;
32
+ // loginUser / resetPasswordPrep / resetPassword error when ssoRequired is on
33
+ export const SSO_REQUIRED_MESSAGE = 'Your university requires sign-in with university SSO.';
27
34
  export const REGISTER_USER = gql `
28
35
  mutation RegisterUser($userData: RegisterUser!) {
29
36
  registerUser(userData: $userData)
@@ -1,6 +1,7 @@
1
1
  export declare const CREATE_STUDY_GROUP_CHECKOUT_SESSION: import("@apollo/client").DocumentNode;
2
2
  export interface ICreateStudyGroupCheckoutSessionVar {
3
3
  code: string;
4
+ productId: number;
4
5
  successUrl?: string;
5
6
  cancelUrl?: string;
6
7
  }
@@ -1,15 +1,17 @@
1
1
  import { gql } from '@apollo/client';
2
2
  // Returns the Stripe Checkout session id (same as CREATE_NEW_SUBSCRIPTION_CHECKOUT_SESSION).
3
- // Promo codes are disabled on this session.
3
+ // productId is any plan from the group's `plans`. Promo codes are disabled on this session.
4
4
  export const CREATE_STUDY_GROUP_CHECKOUT_SESSION = gql `
5
5
  mutation CreateStudyGroupCheckoutSession(
6
6
  $code: String!
7
+ $productId: Int!
7
8
  $successUrl: String
8
9
  $cancelUrl: String
9
10
  ) {
10
11
  validUserToken {
11
12
  createStudyGroupCheckoutSession(
12
13
  code: $code
14
+ productId: $productId
13
15
  successUrl: $successUrl
14
16
  cancelUrl: $cancelUrl
15
17
  )
@@ -1,10 +1,10 @@
1
1
  import { EProductType, IGroupDiscountOffer, IStudyGroupInvite } from '../../models';
2
2
  import { RootData, graphqlNormalize } from '../types';
3
- export type IGroupDiscountOffersData = RootData<(graphqlNormalize & IGroupDiscountOffer)[], 'groupDiscountOffers'>;
4
- export interface IGroupDiscountOffersVar {
3
+ export type IGroupDiscountOfferData = RootData<(graphqlNormalize & IGroupDiscountOffer) | null, 'groupDiscountOffer'>;
4
+ export interface IGroupDiscountOfferVar {
5
5
  productTypeId: EProductType;
6
6
  }
7
- export declare const GROUP_DISCOUNT_OFFERS: import("@apollo/client").DocumentNode;
7
+ export declare const GROUP_DISCOUNT_OFFER: import("@apollo/client").DocumentNode;
8
8
  export type IStudyGroupInviteData = RootData<(graphqlNormalize & IStudyGroupInvite) | null, 'studyGroupInvite'>;
9
9
  export interface IStudyGroupInviteVar {
10
10
  code: string;
@@ -1,9 +1,9 @@
1
1
  import { gql } from '@apollo/client';
2
2
  import { GROUP_DISCOUNT_OFFER_FIELDS, STUDY_GROUP_PRODUCT_FIELDS, } from '../fragments';
3
- export const GROUP_DISCOUNT_OFFERS = gql `
3
+ export const GROUP_DISCOUNT_OFFER = gql `
4
4
  ${GROUP_DISCOUNT_OFFER_FIELDS}
5
- query GroupDiscountOffers($productTypeId: Int!) {
6
- groupDiscountOffers(productTypeId: $productTypeId) {
5
+ query GroupDiscountOffer($productTypeId: Int!) {
6
+ groupDiscountOffer(productTypeId: $productTypeId) {
7
7
  ...GroupDiscountOfferFields
8
8
  }
9
9
  }
@@ -32,7 +32,9 @@ export const STUDY_GROUP_INVITE = gql `
32
32
  closesAt
33
33
  state
34
34
  viewerState
35
- product {
35
+ productTypeId
36
+ productName
37
+ plans {
36
38
  ...StudyGroupProductFields
37
39
  }
38
40
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quesmed/types",
3
- "version": "2.6.303",
3
+ "version": "2.6.306",
4
4
  "description": "Typescript types for Quesmed",
5
5
  "keywords": [
6
6
  "quesmed",