@quesmed/types 1.4.13 → 1.4.14

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/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.13",
3
+ "version": "1.4.14",
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
+ `;
@@ -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
+ tags: 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';
@@ -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')) {