@quesmed/types 1.4.12 → 1.4.16

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.
@@ -0,0 +1,15 @@
1
+ import { Id } from './Type';
2
+ export interface IBlogTag {
3
+ id: Id;
4
+ createdAt: number | Date;
5
+ name: string;
6
+ }
7
+ export interface IBlogPost {
8
+ id: Id;
9
+ createdAt: number | Date;
10
+ updatedAt: number | Date;
11
+ title: string;
12
+ body: string;
13
+ tags?: IBlogTag[];
14
+ relatedBlogPosts?: IBlogPost[];
15
+ }
package/models/Blog.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export {};
package/models/User.d.ts CHANGED
@@ -8,10 +8,12 @@ import { Id } from './Type';
8
8
  export declare type IClassYear = 'Year 1' | 'Year 2' | 'Year 3' | 'Year 4' | 'Year 5' | 'Graduated' | 'PhD' | 'BSc' | 'MSc' | 'Beta Tester';
9
9
  export interface IPayload {
10
10
  id: Id;
11
+ displayName: string;
11
12
  firstName: string;
12
13
  lastName: string;
13
14
  username: string;
14
15
  accessLevel: string;
16
+ tocAccepted: boolean;
15
17
  exp: number;
16
18
  stripeSubscriptionEndDate: number | null;
17
19
  stripeQBankSubscriptionEndDate: number | null;
@@ -20,9 +22,11 @@ export interface IPayload {
20
22
  }
21
23
  export interface IUser {
22
24
  id: Id;
25
+ displayName: string;
23
26
  username: string;
24
27
  firstName: string;
25
28
  lastName: string;
29
+ tocAccepted: boolean;
26
30
  classYear: IClassYear;
27
31
  graduationYear: number;
28
32
  universityId: number;
package/models/index.d.ts CHANGED
@@ -21,3 +21,4 @@ export * from './Type';
21
21
  export * from './University';
22
22
  export * from './User';
23
23
  export * from './Video';
24
+ export * from './Blog';
package/models/index.js CHANGED
@@ -33,3 +33,4 @@ __exportStar(require("./Type"), exports);
33
33
  __exportStar(require("./University"), exports);
34
34
  __exportStar(require("./User"), exports);
35
35
  __exportStar(require("./Video"), exports);
36
+ __exportStar(require("./Blog"), exports);
package/models/index.mjs CHANGED
@@ -21,3 +21,4 @@ export * from './Type';
21
21
  export * from './University';
22
22
  export * from './User';
23
23
  export * from './Video';
24
+ export * from './Blog';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quesmed/types",
3
- "version": "1.4.12",
3
+ "version": "1.4.16",
4
4
  "description": "Typescript types for Quesmed",
5
5
  "main": "index.js",
6
6
  "module": "index.mjs",
@@ -0,0 +1 @@
1
+ export declare const BLOG_POST_FIELDS: import("@apollo/client").DocumentNode;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BLOG_POST_FIELDS = void 0;
4
+ const client_1 = require("@apollo/client");
5
+ exports.BLOG_POST_FIELDS = (0, client_1.gql) `
6
+ fragment BlogPostFields on BlogPost {
7
+ id
8
+ createdAt
9
+ updatedAt
10
+ title
11
+ body
12
+ tags {
13
+ id
14
+ name
15
+ }
16
+ }
17
+ `;
@@ -0,0 +1,14 @@
1
+ import { gql } from '@apollo/client';
2
+ export const BLOG_POST_FIELDS = gql `
3
+ fragment BlogPostFields on BlogPost {
4
+ id
5
+ createdAt
6
+ updatedAt
7
+ title
8
+ body
9
+ tags {
10
+ id
11
+ name
12
+ }
13
+ }
14
+ `;
@@ -1,4 +1,5 @@
1
1
  import { IUser } from '../../../models';
2
+ import { RestrictedData } from '../../types';
2
3
  export interface IResetProgressVar {
3
4
  questions?: boolean;
4
5
  cards?: boolean;
@@ -6,6 +7,7 @@ export interface IResetProgressVar {
6
7
  export interface IResetProgressData extends IUser {
7
8
  }
8
9
  export interface IUserInput {
10
+ displayName?: string;
9
11
  firstName?: string;
10
12
  lastName?: string;
11
13
  classYear?: string;
@@ -23,3 +25,6 @@ export interface IRenewTokenVar {
23
25
  days?: number;
24
26
  }
25
27
  export declare type IRenewTokenData = string;
28
+ export declare const TOC_ACCEPT: import("@apollo/client").DocumentNode;
29
+ export declare type ITocAcceptVar = null;
30
+ export declare type ITocAcceptData = RestrictedData<string, 'tocAccept'>;
@@ -1,2 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TOC_ACCEPT = void 0;
4
+ const client_1 = require("@apollo/client");
5
+ exports.TOC_ACCEPT = (0, client_1.gql) `
6
+ mutation TocAccept {
7
+ restricted {
8
+ tocAccept
9
+ }
10
+ }
11
+ `;
@@ -1 +1,8 @@
1
- export {};
1
+ import { gql } from '@apollo/client';
2
+ export const TOC_ACCEPT = gql `
3
+ mutation TocAccept {
4
+ restricted {
5
+ tocAccept
6
+ }
7
+ }
8
+ `;
@@ -5,6 +5,7 @@ export interface ILoginUserVar {
5
5
  }
6
6
  export declare type ILoginUserData = string;
7
7
  export interface RegisterUserInput {
8
+ displayName: string;
8
9
  username: string;
9
10
  firstName: string;
10
11
  lastName: string;
@@ -0,0 +1,12 @@
1
+ import { IBlogPost } from '../../models';
2
+ import { graphqlNormalize, RootData } from '../types';
3
+ export declare const BLOG_POST: import("@apollo/client").DocumentNode;
4
+ export interface IBlogPostVar {
5
+ id: number;
6
+ }
7
+ export declare type IBlogPostData = RootData<graphqlNormalize & IBlogPost, 'blogPost'>;
8
+ export declare const BLOG_POSTS: import("@apollo/client").DocumentNode;
9
+ export interface IBlogPostsVar {
10
+ tagIds: number[];
11
+ }
12
+ export declare type IBlogPostsData = RootData<(graphqlNormalize & IBlogPost)[], 'blogPosts'>;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BLOG_POSTS = exports.BLOG_POST = void 0;
4
+ const client_1 = require("@apollo/client");
5
+ const blog_1 = require("../fragments/blog");
6
+ exports.BLOG_POST = (0, client_1.gql) `
7
+ ${blog_1.BLOG_POST_FIELDS}
8
+ query BlogPost($id: Int!) {
9
+ blogPost(id: $id) {
10
+ ...BlogPostFields
11
+ relatedBlogPosts {
12
+ ...BlogPostFields
13
+ }
14
+ }
15
+ }
16
+ `;
17
+ exports.BLOG_POSTS = (0, client_1.gql) `
18
+ ${blog_1.BLOG_POST_FIELDS}
19
+ query BlogPosts($tags: [Int]!) {
20
+ blogPosts(tags: $tags) {
21
+ ...BlogPostFields
22
+ relatedBlogPosts {
23
+ ...BlogPostFields
24
+ }
25
+ }
26
+ }
27
+ `;
@@ -0,0 +1,24 @@
1
+ import { gql } from '@apollo/client';
2
+ import { BLOG_POST_FIELDS } from '../fragments/blog';
3
+ export const BLOG_POST = gql `
4
+ ${BLOG_POST_FIELDS}
5
+ query BlogPost($id: Int!) {
6
+ blogPost(id: $id) {
7
+ ...BlogPostFields
8
+ relatedBlogPosts {
9
+ ...BlogPostFields
10
+ }
11
+ }
12
+ }
13
+ `;
14
+ export const BLOG_POSTS = gql `
15
+ ${BLOG_POST_FIELDS}
16
+ query BlogPosts($tags: [Int]!) {
17
+ blogPosts(tags: $tags) {
18
+ ...BlogPostFields
19
+ relatedBlogPosts {
20
+ ...BlogPostFields
21
+ }
22
+ }
23
+ }
24
+ `;
@@ -1,4 +1,5 @@
1
1
  export * from './author';
2
+ export * from './blog';
2
3
  export * from './book';
3
4
  export * from './feedback';
4
5
  export * from './sampleCards';
@@ -11,6 +11,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  __exportStar(require("./author"), exports);
14
+ __exportStar(require("./blog"), exports);
14
15
  __exportStar(require("./book"), exports);
15
16
  __exportStar(require("./feedback"), exports);
16
17
  __exportStar(require("./sampleCards"), exports);
@@ -1,4 +1,5 @@
1
1
  export * from './author';
2
+ export * from './blog';
2
3
  export * from './book';
3
4
  export * from './feedback';
4
5
  export * from './sampleCards';
@@ -102,6 +102,8 @@ exports.SEARCH_OSCE_STATIONS = (0, client_1.gql) `
102
102
  restricted {
103
103
  searchOsceStations(search: $search) {
104
104
  ...OsceStationFields
105
+ attempted
106
+ score
105
107
  }
106
108
  }
107
109
  }
@@ -99,6 +99,8 @@ export const SEARCH_OSCE_STATIONS = gql `
99
99
  restricted {
100
100
  searchOsceStations(search: $search) {
101
101
  ...OsceStationFields
102
+ attempted
103
+ score
102
104
  }
103
105
  }
104
106
  }
@@ -41,7 +41,7 @@ function formatPrescribeAnswer(baseAnswer) {
41
41
  .toLowerCase()
42
42
  .replace(/\s/g, '')
43
43
  .replace(/\//g, '');
44
- if (obj.route.value === 'oral') {
44
+ if (obj.route.value.includes('oral')) {
45
45
  obj.route.value = 'po';
46
46
  }
47
47
  else if (obj.route.value.includes('intravenous')) {
@@ -37,7 +37,7 @@ export function formatPrescribeAnswer(baseAnswer) {
37
37
  .toLowerCase()
38
38
  .replace(/\s/g, '')
39
39
  .replace(/\//g, '');
40
- if (obj.route.value === 'oral') {
40
+ if (obj.route.value.includes('oral')) {
41
41
  obj.route.value = 'po';
42
42
  }
43
43
  else if (obj.route.value.includes('intravenous')) {