@quesmed/types-rn 2.6.66 → 2.6.67

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quesmed/types-rn",
3
- "version": "2.6.66",
3
+ "version": "2.6.67",
4
4
  "description": "Typescript types for Quesmed",
5
5
  "keywords": [
6
6
  "quesmed",
@@ -29,3 +29,25 @@ export interface IAddChapterHighlightVar {
29
29
  export type IAddChapterHighlightData = RestrictedData<(graphqlNormalize & IChapterHighlight)[], 'addChapterHighlight'>;
30
30
  export declare const ADD_CHAPTER_HIGHLIGHT: import("@apollo/client").DocumentNode;
31
31
  export declare const updateChapterHighlights: (cache: ApolloCache<any>, result: ApolloUpdateResultRestricted<IAddChapterHighlightData>, options: ApolloUpdateOptions<IAddChapterHighlightVar>) => void;
32
+ export declare const getChapterHighlightOptimisticResponse: (userId: number, highlights: IHighlightNode[], chapterId: number) => {
33
+ restricted: {
34
+ addChapterHighlight: {
35
+ chapterId: number;
36
+ id: number;
37
+ userId: number;
38
+ createdAt: number;
39
+ updatedAt: number;
40
+ deletedAt: number;
41
+ highlights: {
42
+ start: number;
43
+ end: number;
44
+ text: string;
45
+ color: string;
46
+ part?: string | undefined;
47
+ tag: string;
48
+ __typename: string;
49
+ }[];
50
+ __typename: string;
51
+ }[];
52
+ };
53
+ };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updateChapterHighlights = exports.ADD_CHAPTER_HIGHLIGHT = exports.optimisticUpsertChapterNote = exports.updateCacheOnUpsertChapterNote = exports.UPSERT_CHAPTER_NOTE = void 0;
3
+ exports.getChapterHighlightOptimisticResponse = exports.updateChapterHighlights = exports.ADD_CHAPTER_HIGHLIGHT = exports.optimisticUpsertChapterNote = exports.updateCacheOnUpsertChapterNote = exports.UPSERT_CHAPTER_NOTE = void 0;
4
4
  const client_1 = require("@apollo/client");
5
5
  const fragments_1 = require("../../fragments");
6
6
  /**
@@ -96,3 +96,28 @@ const updateChapterHighlights = (cache, result, options) => {
96
96
  }
97
97
  };
98
98
  exports.updateChapterHighlights = updateChapterHighlights;
99
+ const getChapterHighlightOptimisticResponse = (userId, highlights, chapterId) => {
100
+ const date = new Date().getTime();
101
+ return {
102
+ restricted: {
103
+ addChapterHighlight: [
104
+ {
105
+ chapterId,
106
+ id: date,
107
+ userId,
108
+ createdAt: date,
109
+ updatedAt: date,
110
+ deletedAt: date,
111
+ highlights: highlights.map((highlight) => ({
112
+ __typename: 'HighlightNode',
113
+ tag: '',
114
+ color: '',
115
+ ...highlight,
116
+ })),
117
+ __typename: 'ChapterHighlight',
118
+ },
119
+ ],
120
+ },
121
+ };
122
+ };
123
+ exports.getChapterHighlightOptimisticResponse = getChapterHighlightOptimisticResponse;
@@ -62,4 +62,26 @@ export interface IAddQuestionHighlightVar {
62
62
  export type IAddQuestionHighlightData = RestrictedData<(graphqlNormalize & IQuestionHighlight)[], 'addQuestionHighlight'>;
63
63
  export declare const ADD_QUESTION_HIGHLIGHT: import("@apollo/client").DocumentNode;
64
64
  export declare const updateQuestionHighlights: (typeId: EQuestionType) => (cache: ApolloCache<any>, result: ApolloUpdateResultRestricted<IAddQuestionHighlightData>, options: ApolloUpdateOptions<IAddQuestionHighlightVar>) => void;
65
+ export declare const getQuestionHighlightOptimisticResponse: (userId: number, highlights: IHighlightNode[], questionId: number) => {
66
+ restricted: {
67
+ addQuestionHighlight: {
68
+ questionId: number;
69
+ id: number;
70
+ userId: number;
71
+ createdAt: number;
72
+ updatedAt: number;
73
+ deletedAt: number;
74
+ highlights: {
75
+ start: number;
76
+ end: number;
77
+ text: string;
78
+ color: string;
79
+ part?: string | undefined;
80
+ tag: string;
81
+ __typename: string;
82
+ }[];
83
+ __typename: string;
84
+ }[];
85
+ };
86
+ };
65
87
  export {};
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updateQuestionHighlights = exports.ADD_QUESTION_HIGHLIGHT = exports.optimisticQuestionCommentRemove = exports.updateQuestionCommentsRemove = exports.QUESTION_COMMENT_REMOVE = exports.optimisticCommentLike = exports.QUESTION_COMMENT_LIKE = exports.optimisticQuestionComment = exports.updateQuestionComments = exports.QUESTION_COMMENTS = exports.optimisticQuestionLike = exports.QUESTION_LIKE = exports.getQuestionTypeName = exports.getLikeData = void 0;
3
+ exports.getQuestionHighlightOptimisticResponse = exports.updateQuestionHighlights = exports.ADD_QUESTION_HIGHLIGHT = exports.optimisticQuestionCommentRemove = exports.updateQuestionCommentsRemove = exports.QUESTION_COMMENT_REMOVE = exports.optimisticCommentLike = exports.QUESTION_COMMENT_LIKE = exports.optimisticQuestionComment = exports.updateQuestionComments = exports.QUESTION_COMMENTS = exports.optimisticQuestionLike = exports.QUESTION_LIKE = exports.getQuestionTypeName = exports.getLikeData = void 0;
4
4
  const client_1 = require("@apollo/client");
5
5
  const luxon_1 = require("luxon");
6
6
  const models_1 = require("../../../models");
@@ -378,3 +378,28 @@ const updateQuestionHighlights = (typeId) => (cache, result, options) => {
378
378
  }
379
379
  };
380
380
  exports.updateQuestionHighlights = updateQuestionHighlights;
381
+ const getQuestionHighlightOptimisticResponse = (userId, highlights, questionId) => {
382
+ const date = new Date().getTime();
383
+ return {
384
+ restricted: {
385
+ addQuestionHighlight: [
386
+ {
387
+ questionId,
388
+ id: date,
389
+ userId,
390
+ createdAt: date,
391
+ updatedAt: date,
392
+ deletedAt: date,
393
+ highlights: highlights.map((highlight) => ({
394
+ __typename: 'HighlightNode',
395
+ tag: '',
396
+ color: '',
397
+ ...highlight,
398
+ })),
399
+ __typename: 'ChapterHighlight',
400
+ },
401
+ ],
402
+ },
403
+ };
404
+ };
405
+ exports.getQuestionHighlightOptimisticResponse = getQuestionHighlightOptimisticResponse;