@cuemath/leap 3.1.2-beta-0.1 → 3.1.2-beta-0.2

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.
@@ -1,13 +1,13 @@
1
- import { createGetAllAPI as r } from "@cuemath/rest-api";
2
- import { BASE_URL_V3_1 as n } from "../../../../constants/api.js";
3
- const { useGetAll: a, invalidate: l } = r({
4
- getURL: (e) => {
5
- const { milestone_state_group: t, student_id: s, course_stream: o } = e;
6
- return `${n}/user-milestones/users/${s}/course-streams/${o}/${t}/count`;
1
+ import { createGetAPI as r } from "@cuemath/rest-api";
2
+ import { BASE_URL_V3 as n } from "../../../../constants/api.js";
3
+ const { useGet: m, invalidate: c } = r({
4
+ getURL: (e, u, t) => {
5
+ const { milestone_state_group: s, course_stream: o } = t;
6
+ return `${n}/user-milestones/users/${e}/course-streams/${o}/${s}/count`;
7
7
  }
8
8
  });
9
9
  export {
10
- l as invalidatePastMilestoneCount,
11
- a as useGetPastMilestoneCount
10
+ c as invalidatePastMilestoneCount,
11
+ m as useGetPastMilestoneCount
12
12
  };
13
13
  //# sourceMappingURL=get-past-milestone-count.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-past-milestone-count.js","sources":["../../../../../src/features/milestone/milestone-list-container/api/get-past-milestone-count.ts"],"sourcesContent":["import type { TCourseStream } from '../../create/milestone-create-types';\nimport type { IMilestoneData } from '../milestone-list/milestone-list-types';\n\nimport { createGetAllAPI } from '@cuemath/rest-api';\n\nimport { BASE_URL_V3_1 } from '../../../../constants/api';\n\ntype TQuery = {\n milestone_state_group: 'ALL' | 'DRAFT' | 'STUDENT_ALL' | 'LIVE' | 'STUDENT_LIVE' | 'INACTIVE';\n student_id: string;\n course_stream: TCourseStream;\n};\n\nconst { useGetAll: useGetPastMilestoneCount, invalidate: invalidatePastMilestoneCount } =\n createGetAllAPI<IMilestoneData, TQuery>({\n getURL: query => {\n const { milestone_state_group, student_id, course_stream } = query;\n\n return `${BASE_URL_V3_1}/user-milestones/users/${student_id}/course-streams/${course_stream}/${milestone_state_group}/count`;\n },\n });\n\nexport { useGetPastMilestoneCount, invalidatePastMilestoneCount };\n"],"names":["useGetPastMilestoneCount","invalidatePastMilestoneCount","createGetAllAPI","query","milestone_state_group","student_id","course_stream","BASE_URL_V3_1"],"mappings":";;AAaA,MAAM,EAAE,WAAWA,GAA0B,YAAYC,EAAA,IACvDC,EAAwC;AAAA,EACtC,QAAQ,CAASC,MAAA;AACf,UAAM,EAAE,uBAAAC,GAAuB,YAAAC,GAAY,eAAAC,EAAA,IAAkBH;AAE7D,WAAO,GAAGI,CAAa,0BAA0BF,CAAU,mBAAmBC,CAAa,IAAIF,CAAqB;AAAA,EACtH;AACF,CAAC;"}
1
+ {"version":3,"file":"get-past-milestone-count.js","sources":["../../../../../src/features/milestone/milestone-list-container/api/get-past-milestone-count.ts"],"sourcesContent":["import type { TCourseStream } from '../../create/milestone-create-types';\nimport type { IMilestoneData } from '../milestone-list/milestone-list-types';\n\nimport { createGetAPI } from '@cuemath/rest-api';\n\nimport { BASE_URL_V3 } from '../../../../constants/api';\n\ntype TQuery = {\n milestone_state_group: 'ALL' | 'DRAFT' | 'STUDENT_ALL' | 'LIVE' | 'STUDENT_LIVE' | 'INACTIVE';\n student_id: string;\n course_stream: TCourseStream;\n};\n\nconst { useGet: useGetPastMilestoneCount, invalidate: invalidatePastMilestoneCount } = createGetAPI<\n IMilestoneData,\n void,\n TQuery\n>({\n getURL: (studentId, _, query) => {\n const { milestone_state_group, course_stream } = query;\n\n return `${BASE_URL_V3}/user-milestones/users/${studentId}/course-streams/${course_stream}/${milestone_state_group}/count`;\n },\n});\n\nexport { useGetPastMilestoneCount, invalidatePastMilestoneCount };\n"],"names":["useGetPastMilestoneCount","invalidatePastMilestoneCount","createGetAPI","studentId","_","query","milestone_state_group","course_stream","BASE_URL_V3"],"mappings":";;AAaA,MAAM,EAAE,QAAQA,GAA0B,YAAYC,EAAA,IAAiCC,EAIrF;AAAA,EACA,QAAQ,CAACC,GAAWC,GAAGC,MAAU;AACzB,UAAA,EAAE,uBAAAC,GAAuB,eAAAC,EAAkB,IAAAF;AAEjD,WAAO,GAAGG,CAAW,0BAA0BL,CAAS,mBAAmBI,CAAa,IAAID,CAAqB;AAAA,EACnH;AACF,CAAC;"}
package/dist/index.d.ts CHANGED
@@ -2477,7 +2477,7 @@ export declare const invalidateMilestoneResources: (id: string, query?: void | u
2477
2477
 
2478
2478
  export declare const invalidateMilestonesData: (query?: TQuery | undefined) => void;
2479
2479
 
2480
- export declare const invalidatePastMilestoneCount: (query?: TQuery_2 | undefined) => void;
2480
+ export declare const invalidatePastMilestoneCount: (id: string, query?: void | undefined, allIdsInvalid?: boolean) => void;
2481
2481
 
2482
2482
  export declare const invalidateTestHelpData: (id: string, query?: void | undefined, allIdsInvalid?: boolean) => void;
2483
2483
 
@@ -5774,10 +5774,10 @@ export declare const useGetMilestoneResources: (initialId?: string, initialQuery
5774
5774
  } & Record<string, unknown>) | undefined;
5775
5775
  };
5776
5776
 
5777
- export declare const useGetPastMilestoneCount: (initialQuery?: TQuery_2 | undefined) => {
5778
- getAll: (query: TQuery_2, meta: void) => Promise<void>;
5779
- resource: ResourceModel<IMilestoneData[]> | undefined;
5780
- data: IMilestoneData[] | undefined;
5777
+ export declare const useGetPastMilestoneCount: (initialId?: string, initialQuery?: void | undefined) => {
5778
+ get: (id: string, query: void, meta: TQuery_2) => Promise<void>;
5779
+ resource: ResourceModel<IMilestoneData> | undefined;
5780
+ data: IMilestoneData | undefined;
5781
5781
  permissions: Record<string, unknown> | undefined;
5782
5782
  isProcessing: boolean;
5783
5783
  isProcessed: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cuemath/leap",
3
- "version": "3.1.2-beta-0.1",
3
+ "version": "3.1.2-beta-0.2",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"