@x-edu/service 0.0.6 → 0.0.8

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.
@@ -31,6 +31,7 @@ declare const config: {
31
31
  'e-favorite-api': string;
32
32
  'x-study-record': string;
33
33
  cdn: string;
34
+ 'cdn-hot-proxy': string;
34
35
  'site-config': string;
35
36
  serviceName: {
36
37
  site: string;
@@ -41,6 +42,7 @@ declare const config: {
41
42
  };
42
43
  defaultAreaSite: string;
43
44
  'elearning-library': string;
45
+ uc: string;
44
46
  };
45
47
  };
46
48
  export default config;
package/dist/index.d.ts CHANGED
@@ -48,6 +48,7 @@ export declare const serviceConfig: {
48
48
  'e-favorite-api': string;
49
49
  'x-study-record': string;
50
50
  cdn: string;
51
+ 'cdn-hot-proxy': string;
51
52
  'site-config': string;
52
53
  serviceName: {
53
54
  site: string;
@@ -58,5 +59,6 @@ export declare const serviceConfig: {
58
59
  };
59
60
  defaultAreaSite: string;
60
61
  'elearning-library': string;
62
+ uc: string;
61
63
  };
62
64
  };
@@ -7,3 +7,6 @@ export declare const cdnSFileAPI: ({ env, }: {
7
7
  export declare const cdnBdcsFileAPI: ({ env, }: {
8
8
  env: any;
9
9
  }) => import('../../node_modules/@x-edu/functions/dist/request/interface').RequestInstance;
10
+ export declare const cdnHotProxyAPI: ({ env }: {
11
+ env: any;
12
+ }) => import('../../node_modules/@x-edu/functions/dist/request/interface').RequestInstance;
@@ -0,0 +1,5 @@
1
+ export declare const ucAPI: ({ uc, env, sdpAppId }: {
2
+ uc: any;
3
+ env: any;
4
+ sdpAppId: any;
5
+ }) => import('../../node_modules/@x-edu/functions/dist/request/interface').RequestInstance;
@@ -0,0 +1,59 @@
1
+ declare class Ndr {
2
+ request: any;
3
+ config: any;
4
+ constructor(props: any);
5
+ getResourceDetail: ({ contentId, serviceName }: {
6
+ contentId: any;
7
+ serviceName: any;
8
+ }) => Promise<any>;
9
+ getThematicCourseTree: ({ contentId, serviceName }: {
10
+ contentId: any;
11
+ serviceName: any;
12
+ }) => Promise<any>;
13
+ getThematicList: ({ contentId, serviceName }: {
14
+ contentId: any;
15
+ serviceName: any;
16
+ }) => Promise<any>;
17
+ fetchRegionLessonCourseList: ({ regionId, businessType, teachingmaterialId }: {
18
+ regionId: any;
19
+ businessType: any;
20
+ teachingmaterialId: any;
21
+ }) => Promise<never[]>;
22
+ BusinessType: {
23
+ AutoLearning: string;
24
+ Prepare: string;
25
+ };
26
+ fetchPrepareLessonChapter: ({ id, serviceName }: {
27
+ id: any;
28
+ serviceName: any;
29
+ }) => Promise<any>;
30
+ fetchPrepareLessonTreeCourseList: ({ id, serviceName }: {
31
+ id: any;
32
+ serviceName: any;
33
+ }) => Promise<never[]>;
34
+ fetchPrepareType: ({ serviceName }: {
35
+ serviceName: any;
36
+ }) => Promise<any>;
37
+ fetchNationalLessonChapter: ({ id, serviceName }: {
38
+ id: any;
39
+ serviceName: any;
40
+ }) => Promise<any>;
41
+ fetchNationalLessonCourseList: ({ id, serviceName }: {
42
+ id: any;
43
+ serviceName: any;
44
+ }) => Promise<never[]>;
45
+ fetchNationalLessonDetail: ({ id, serviceName }: {
46
+ id: any;
47
+ serviceName: any;
48
+ }) => Promise<any>;
49
+ fetchPrepareLessonRelate: ({}: {}) => Promise<void>;
50
+ fetchPrepareLesson: ({}: {}) => Promise<void>;
51
+ fetchPrepareLessonSubResource: ({}: {}) => Promise<void>;
52
+ fetchNationalLessonCourseDetail: ({}: {}) => Promise<void>;
53
+ fetchPrepareLessonDetail: ({}: {}) => Promise<void>;
54
+ fetchRegionResourceDetail: ({}: {}) => Promise<void>;
55
+ fetchRegionLessonRelate: ({}: {}) => Promise<void>;
56
+ fetchQualityCourse: ({}: {}) => Promise<void>;
57
+ fetchTeachingLessonDetail: ({}: {}) => Promise<void>;
58
+ }
59
+ export default Ndr;
@@ -23,9 +23,10 @@ declare class TCourse {
23
23
  activitySetId: any;
24
24
  siteRelaId: any;
25
25
  }) => Promise<any>;
26
- getVideoActivity: ({ activityId, siteRelaId }: {
26
+ getVideoActivity: ({ activityId, siteRelaId, serviceName }: {
27
27
  activityId: any;
28
28
  siteRelaId: any;
29
+ serviceName: any;
29
30
  }) => Promise<any>;
30
31
  getDocumentActivity: ({ activityId, siteRelaId }: {
31
32
  activityId: any;
package/dist/service.js CHANGED
@@ -15161,7 +15161,7 @@ var Auth = /* @__PURE__ */ function() {
15161
15161
  });
15162
15162
  _defineProperty(this, "getIndentity", /* @__PURE__ */ _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee9() {
15163
15163
  var _this$userInfo;
15164
- var userId, force, userIdentities, _userIdentities$userI, _userIdentities$userI2, ucAPI, url, _ref15, _ref15$items, items, identities, _getUserIdentitiesCac, userIdentitiesCache, _args9 = arguments;
15164
+ var userId, force, userIdentities, _userIdentities$userI, _userIdentities$userI2, ucAPI2, url, _ref15, _ref15$items, items, identities, _getUserIdentitiesCac, userIdentitiesCache, _args9 = arguments;
15165
15165
  return _regeneratorRuntime().wrap(function _callee9$(_context9) {
15166
15166
  while (1)
15167
15167
  switch (_context9.prev = _context9.next) {
@@ -15176,14 +15176,14 @@ var Auth = /* @__PURE__ */ function() {
15176
15176
  case 4:
15177
15177
  userIdentities = _this.userIdentities;
15178
15178
  _context9.prev = 5;
15179
- ucAPI = _this.ucApi();
15179
+ ucAPI2 = _this.ucApi();
15180
15180
  if (!(!((_userIdentities$userI = userIdentities[userId]) !== null && _userIdentities$userI !== void 0 && (_userIdentities$userI = _userIdentities$userI.data) !== null && _userIdentities$userI !== void 0 && (_userIdentities$userI = _userIdentities$userI.items) !== null && _userIdentities$userI !== void 0 && _userIdentities$userI.length) || force)) {
15181
15181
  _context9.next = 12;
15182
15182
  break;
15183
15183
  }
15184
15184
  url = `/users/${userId}/identities`;
15185
15185
  _context9.next = 11;
15186
- return ucAPI.get(url);
15186
+ return ucAPI2.get(url);
15187
15187
  case 11:
15188
15188
  userIdentities[userId] = _context9.sent;
15189
15189
  case 12:
@@ -15260,7 +15260,7 @@ var Auth = /* @__PURE__ */ function() {
15260
15260
  _defineProperty(this, "addUserIdentities", /* @__PURE__ */ function() {
15261
15261
  var _ref19 = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee11(_ref18) {
15262
15262
  var _this$userInfo2;
15263
- var _ref18$userId, userId, code, ucAPI;
15263
+ var _ref18$userId, userId, code, ucAPI2;
15264
15264
  return _regeneratorRuntime().wrap(function _callee11$(_context11) {
15265
15265
  while (1)
15266
15266
  switch (_context11.prev = _context11.next) {
@@ -15272,9 +15272,9 @@ var Auth = /* @__PURE__ */ function() {
15272
15272
  }
15273
15273
  return _context11.abrupt("return");
15274
15274
  case 3:
15275
- ucAPI = _this.ucApi();
15275
+ ucAPI2 = _this.ucApi();
15276
15276
  _context11.next = 6;
15277
- return ucAPI.post(`/users/${userId}/identities`, {
15277
+ return ucAPI2.post(`/users/${userId}/identities`, {
15278
15278
  identity_code: code
15279
15279
  });
15280
15280
  case 6:
@@ -15337,7 +15337,7 @@ var Auth = /* @__PURE__ */ function() {
15337
15337
  }());
15338
15338
  _defineProperty(this, "isStudent", /* @__PURE__ */ function() {
15339
15339
  var _ref21 = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee13(curUserInfo) {
15340
- var checkOrg, ucAPI, checkIsStudent, isStudent, response, inst, _args13 = arguments;
15340
+ var checkOrg, ucAPI2, checkIsStudent, isStudent, response, inst, _args13 = arguments;
15341
15341
  return _regeneratorRuntime().wrap(function _callee13$(_context13) {
15342
15342
  while (1)
15343
15343
  switch (_context13.prev = _context13.next) {
@@ -15349,7 +15349,7 @@ var Auth = /* @__PURE__ */ function() {
15349
15349
  }
15350
15350
  return _context13.abrupt("return", false);
15351
15351
  case 3:
15352
- ucAPI = _this.ucApi();
15352
+ ucAPI2 = _this.ucApi();
15353
15353
  checkIsStudent = true;
15354
15354
  isStudent = false;
15355
15355
  if (!checkOrg) {
@@ -15357,7 +15357,7 @@ var Auth = /* @__PURE__ */ function() {
15357
15357
  break;
15358
15358
  }
15359
15359
  _context13.next = 9;
15360
- return ucAPI.get("/institutions/actions/search", {
15360
+ return ucAPI2.get("/institutions/actions/search", {
15361
15361
  params: {
15362
15362
  app_id: _this.getSdpAppId()
15363
15363
  }
@@ -17654,6 +17654,7 @@ const config = {
17654
17654
  // 学习记录
17655
17655
  "x-study-record": "//x-study-record-api.beta.101.com",
17656
17656
  cdn: "//ndcs-pre.101.com",
17657
+ "cdn-hot-proxy": "//betacs.101.com",
17657
17658
  // 站点配置(存在灰度能力)
17658
17659
  "site-config": "//grey-config-web.ykt.cbern.com.cn",
17659
17660
  serviceName: {
@@ -17665,7 +17666,8 @@ const config = {
17665
17666
  },
17666
17667
  defaultAreaSite: "hn",
17667
17668
  // 内容库
17668
- "elearning-library": "//elearning-library-gateway.beta.101.com"
17669
+ "elearning-library": "//elearning-library-gateway.beta.101.com",
17670
+ uc: "https://uc-gateway.sdp.101.com"
17669
17671
  }
17670
17672
  };
17671
17673
  const recommendAPIV2 = ({
@@ -17806,6 +17808,12 @@ const cdnBdcsFileAPI = ({
17806
17808
  prefix: "",
17807
17809
  noSdpAppId: true
17808
17810
  });
17811
+ const cdnHotProxyAPI = ({
17812
+ env
17813
+ }) => getApi({
17814
+ host: config[env]["cdn-hot-proxy"],
17815
+ prefix: "/v0.1/static"
17816
+ });
17809
17817
  const siteConfigAPI = ({
17810
17818
  env,
17811
17819
  sdpAppId
@@ -17824,6 +17832,16 @@ const eLearningLibraryAPI = ({
17824
17832
  uc,
17825
17833
  sdpAppId
17826
17834
  });
17835
+ const ucAPI = ({
17836
+ uc,
17837
+ env,
17838
+ sdpAppId
17839
+ }) => getApi({
17840
+ host: config[env]["uc"],
17841
+ prefix: "/v1.1",
17842
+ uc,
17843
+ sdpAppId
17844
+ });
17827
17845
  async function getStatByChunk(resIds, requestFn, ...args) {
17828
17846
  try {
17829
17847
  const chunkSize = 100;
@@ -18274,7 +18292,7 @@ class Assessment {
18274
18292
  return assessmentVo;
18275
18293
  });
18276
18294
  __publicField(this, "getUserAssessmentRate", async ({ assessmentId, assessmentType = "course", userInfo }) => {
18277
- const cacheKey = assessmentRateCacheKey(assessmentId, userInfo.user_id);
18295
+ const cacheKey = assessmentRateCacheKey(assessmentId, userInfo == null ? void 0 : userInfo.user_id);
18278
18296
  let userAssessmentVo = localStorage.getItem(cacheKey);
18279
18297
  if (userAssessmentVo) {
18280
18298
  try {
@@ -18966,11 +18984,18 @@ class TCourse {
18966
18984
  return data;
18967
18985
  });
18968
18986
  // 获取视频活动课时
18969
- __publicField(this, "getVideoActivity", async ({ activityId, siteRelaId }) => {
18970
- const { data } = await this.request.cdn.cdnAPI.get(
18971
- `/${this.config.serviceName.zxxRegion}/${siteRelaId}/s_course/v1/video_activity/${activityId}.json`
18972
- );
18973
- return data;
18987
+ __publicField(this, "getVideoActivity", async ({ activityId, siteRelaId, serviceName: serviceName2 }) => {
18988
+ if (siteRelaId) {
18989
+ const { data } = await this.request.cdn.cdnAPI.get(
18990
+ `/${this.config.serviceName.zxxRegion}/${siteRelaId}/s_course/v1/video_activity/${activityId}.json`
18991
+ );
18992
+ return data;
18993
+ } else {
18994
+ const { data } = await this.request.cdn.cdnAPI.get(
18995
+ `/${serviceName2}/s_course/v1/video_activity/${activityId}.json`
18996
+ );
18997
+ return data;
18998
+ }
18974
18999
  });
18975
19000
  // 获取文档活动课时
18976
19001
  __publicField(this, "getDocumentActivity", async ({ activityId, siteRelaId }) => {
@@ -19284,6 +19309,110 @@ class Library {
19284
19309
  this.config = config2;
19285
19310
  }
19286
19311
  }
19312
+ class Ndr {
19313
+ constructor(props) {
19314
+ __publicField(this, "request");
19315
+ __publicField(this, "config");
19316
+ __publicField(this, "getResourceDetail", async ({ contentId, serviceName: serviceName2 }) => {
19317
+ const { data } = await this.request.cdn.cdnAPI.get(
19318
+ `${serviceName2}/ndrs/special_edu/resources/details/${contentId}.json`
19319
+ );
19320
+ return data;
19321
+ });
19322
+ __publicField(this, "getThematicCourseTree", async ({ contentId, serviceName: serviceName2 }) => {
19323
+ const { data } = await this.request.cdn.cdnAPI.get(
19324
+ `${serviceName2}/ndrs/special_edu/thematic_course/trees/${contentId}.json`
19325
+ );
19326
+ return data;
19327
+ });
19328
+ __publicField(this, "getThematicList", async ({ contentId, serviceName: serviceName2 }) => {
19329
+ const { data } = await this.request.cdn.cdnAPI.get(
19330
+ `${serviceName2}/ndrs/special_edu/thematic_course/${contentId}/resources/list.json`
19331
+ );
19332
+ return data;
19333
+ });
19334
+ __publicField(this, "fetchRegionLessonCourseList", async ({ regionId, businessType, teachingmaterialId }) => {
19335
+ const { zxxRegion } = this.config.serviceName;
19336
+ const { data } = await this.request.cdn.cdnAPI.get(
19337
+ `${zxxRegion}/${regionId}/${businessType}/teachingmaterials/${teachingmaterialId}/resources/parts.json`
19338
+ );
19339
+ const result = [];
19340
+ await Promise.all(
19341
+ data.map(async (t2, index) => {
19342
+ const { data: partData } = await this.request.cdn.cdnAPI.get(t2);
19343
+ result[index] = partData;
19344
+ })
19345
+ );
19346
+ return [].concat(...result);
19347
+ });
19348
+ __publicField(this, "BusinessType", {
19349
+ AutoLearning: "auto_learning",
19350
+ Prepare: "prepare"
19351
+ });
19352
+ __publicField(this, "fetchPrepareLessonChapter", async ({ id, serviceName: serviceName2 }) => {
19353
+ const { data } = await this.request.cdn.cdnAPI.get(`${serviceName2}/ndrs/resources/trees/${id}.json`);
19354
+ return data;
19355
+ });
19356
+ __publicField(this, "fetchPrepareLessonTreeCourseList", async ({ id, serviceName: serviceName2 }) => {
19357
+ const { data } = await this.request.cdn.cdnAPI.get(
19358
+ `${serviceName2}/ndrs/teachingmaterials/${id}/resources/parts.json`
19359
+ );
19360
+ const result = [];
19361
+ await Promise.all(
19362
+ data.map(async (t2, index) => {
19363
+ const { data: partData } = await this.request.cdn.cdnAPI.get(t2);
19364
+ result[index] = partData;
19365
+ })
19366
+ );
19367
+ return [].concat(...result);
19368
+ });
19369
+ __publicField(this, "fetchPrepareType", async ({ serviceName: serviceName2 }) => {
19370
+ var _a2, _b2;
19371
+ const { data } = await this.request.cdn.cdnAPI.get(`${serviceName2}/ndrs/tags/res_types.json`);
19372
+ return (_b2 = (_a2 = data == null ? void 0 : data.hierarchies) == null ? void 0 : _a2[0]) == null ? void 0 : _b2.children;
19373
+ });
19374
+ __publicField(this, "fetchNationalLessonChapter", async ({ id, serviceName: serviceName2 }) => {
19375
+ const { data } = await this.request.cdn.cdnAPI.get(`${serviceName2}/ndrs/lessons/trees/${id}.json`);
19376
+ return data;
19377
+ });
19378
+ __publicField(this, "fetchNationalLessonCourseList", async ({ id, serviceName: serviceName2 }) => {
19379
+ const { data } = await this.request.cdn.cdnAPI.get(`${serviceName2}/ndrs/teachingmaterials/${id}/lessons/parts.json`);
19380
+ const result = [];
19381
+ await Promise.all(
19382
+ data.map(async (t2, index) => {
19383
+ const { data: partData } = await this.request.cdn.cdnAPI.get(t2);
19384
+ result[index] = partData;
19385
+ })
19386
+ );
19387
+ return [].concat(...result);
19388
+ });
19389
+ __publicField(this, "fetchNationalLessonDetail", async ({ id, serviceName: serviceName2 }) => {
19390
+ const { data } = await this.request.cdn.cdnAPI.get(`${serviceName2}/ndrs/teachingmaterials/details/${id}.json`);
19391
+ return data;
19392
+ });
19393
+ __publicField(this, "fetchPrepareLessonRelate", async ({}) => {
19394
+ });
19395
+ __publicField(this, "fetchPrepareLesson", async ({}) => {
19396
+ });
19397
+ __publicField(this, "fetchPrepareLessonSubResource", async ({}) => {
19398
+ });
19399
+ __publicField(this, "fetchNationalLessonCourseDetail", async ({}) => {
19400
+ });
19401
+ __publicField(this, "fetchPrepareLessonDetail", async ({}) => {
19402
+ });
19403
+ __publicField(this, "fetchRegionResourceDetail", async ({}) => {
19404
+ });
19405
+ __publicField(this, "fetchRegionLessonRelate", async ({}) => {
19406
+ });
19407
+ __publicField(this, "fetchQualityCourse", async ({}) => {
19408
+ });
19409
+ __publicField(this, "fetchTeachingLessonDetail", async ({}) => {
19410
+ });
19411
+ const { request, config: config2 } = props;
19412
+ this.request = request;
19413
+ this.config = config2;
19414
+ }
19415
+ }
19287
19416
  const _Service = class _Service {
19288
19417
  constructor(props) {
19289
19418
  __publicField(this, "env");
@@ -19353,13 +19482,17 @@ const _Service = class _Service {
19353
19482
  cdn: {
19354
19483
  cdnAPI,
19355
19484
  cdnBdcsFileAPI,
19356
- cdnSFileAPI
19485
+ cdnSFileAPI,
19486
+ cdnHotProxyAPI
19357
19487
  },
19358
19488
  siteConfig: {
19359
19489
  siteConfigAPI
19360
19490
  },
19361
19491
  elearningLibrary: {
19362
19492
  eLearningLibraryAPI
19493
+ },
19494
+ uc: {
19495
+ ucAPI
19363
19496
  }
19364
19497
  };
19365
19498
  this.request = {};
@@ -19380,7 +19513,8 @@ const _Service = class _Service {
19380
19513
  channel: Channel,
19381
19514
  elearningTrain: ElearningTrain,
19382
19515
  siteConfig: SiteConfig,
19383
- library: Library
19516
+ library: Library,
19517
+ Ndr
19384
19518
  };
19385
19519
  this.service = {};
19386
19520
  Object.keys(services).forEach((key) => {
package/dist/service.mjs CHANGED
@@ -15159,7 +15159,7 @@ var Auth = /* @__PURE__ */ function() {
15159
15159
  });
15160
15160
  _defineProperty(this, "getIndentity", /* @__PURE__ */ _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee9() {
15161
15161
  var _this$userInfo;
15162
- var userId, force, userIdentities, _userIdentities$userI, _userIdentities$userI2, ucAPI, url, _ref15, _ref15$items, items, identities, _getUserIdentitiesCac, userIdentitiesCache, _args9 = arguments;
15162
+ var userId, force, userIdentities, _userIdentities$userI, _userIdentities$userI2, ucAPI2, url, _ref15, _ref15$items, items, identities, _getUserIdentitiesCac, userIdentitiesCache, _args9 = arguments;
15163
15163
  return _regeneratorRuntime().wrap(function _callee9$(_context9) {
15164
15164
  while (1)
15165
15165
  switch (_context9.prev = _context9.next) {
@@ -15174,14 +15174,14 @@ var Auth = /* @__PURE__ */ function() {
15174
15174
  case 4:
15175
15175
  userIdentities = _this.userIdentities;
15176
15176
  _context9.prev = 5;
15177
- ucAPI = _this.ucApi();
15177
+ ucAPI2 = _this.ucApi();
15178
15178
  if (!(!((_userIdentities$userI = userIdentities[userId]) !== null && _userIdentities$userI !== void 0 && (_userIdentities$userI = _userIdentities$userI.data) !== null && _userIdentities$userI !== void 0 && (_userIdentities$userI = _userIdentities$userI.items) !== null && _userIdentities$userI !== void 0 && _userIdentities$userI.length) || force)) {
15179
15179
  _context9.next = 12;
15180
15180
  break;
15181
15181
  }
15182
15182
  url = `/users/${userId}/identities`;
15183
15183
  _context9.next = 11;
15184
- return ucAPI.get(url);
15184
+ return ucAPI2.get(url);
15185
15185
  case 11:
15186
15186
  userIdentities[userId] = _context9.sent;
15187
15187
  case 12:
@@ -15258,7 +15258,7 @@ var Auth = /* @__PURE__ */ function() {
15258
15258
  _defineProperty(this, "addUserIdentities", /* @__PURE__ */ function() {
15259
15259
  var _ref19 = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee11(_ref18) {
15260
15260
  var _this$userInfo2;
15261
- var _ref18$userId, userId, code, ucAPI;
15261
+ var _ref18$userId, userId, code, ucAPI2;
15262
15262
  return _regeneratorRuntime().wrap(function _callee11$(_context11) {
15263
15263
  while (1)
15264
15264
  switch (_context11.prev = _context11.next) {
@@ -15270,9 +15270,9 @@ var Auth = /* @__PURE__ */ function() {
15270
15270
  }
15271
15271
  return _context11.abrupt("return");
15272
15272
  case 3:
15273
- ucAPI = _this.ucApi();
15273
+ ucAPI2 = _this.ucApi();
15274
15274
  _context11.next = 6;
15275
- return ucAPI.post(`/users/${userId}/identities`, {
15275
+ return ucAPI2.post(`/users/${userId}/identities`, {
15276
15276
  identity_code: code
15277
15277
  });
15278
15278
  case 6:
@@ -15335,7 +15335,7 @@ var Auth = /* @__PURE__ */ function() {
15335
15335
  }());
15336
15336
  _defineProperty(this, "isStudent", /* @__PURE__ */ function() {
15337
15337
  var _ref21 = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee13(curUserInfo) {
15338
- var checkOrg, ucAPI, checkIsStudent, isStudent, response, inst, _args13 = arguments;
15338
+ var checkOrg, ucAPI2, checkIsStudent, isStudent, response, inst, _args13 = arguments;
15339
15339
  return _regeneratorRuntime().wrap(function _callee13$(_context13) {
15340
15340
  while (1)
15341
15341
  switch (_context13.prev = _context13.next) {
@@ -15347,7 +15347,7 @@ var Auth = /* @__PURE__ */ function() {
15347
15347
  }
15348
15348
  return _context13.abrupt("return", false);
15349
15349
  case 3:
15350
- ucAPI = _this.ucApi();
15350
+ ucAPI2 = _this.ucApi();
15351
15351
  checkIsStudent = true;
15352
15352
  isStudent = false;
15353
15353
  if (!checkOrg) {
@@ -15355,7 +15355,7 @@ var Auth = /* @__PURE__ */ function() {
15355
15355
  break;
15356
15356
  }
15357
15357
  _context13.next = 9;
15358
- return ucAPI.get("/institutions/actions/search", {
15358
+ return ucAPI2.get("/institutions/actions/search", {
15359
15359
  params: {
15360
15360
  app_id: _this.getSdpAppId()
15361
15361
  }
@@ -17652,6 +17652,7 @@ const config = {
17652
17652
  // 学习记录
17653
17653
  "x-study-record": "//x-study-record-api.beta.101.com",
17654
17654
  cdn: "//ndcs-pre.101.com",
17655
+ "cdn-hot-proxy": "//betacs.101.com",
17655
17656
  // 站点配置(存在灰度能力)
17656
17657
  "site-config": "//grey-config-web.ykt.cbern.com.cn",
17657
17658
  serviceName: {
@@ -17663,7 +17664,8 @@ const config = {
17663
17664
  },
17664
17665
  defaultAreaSite: "hn",
17665
17666
  // 内容库
17666
- "elearning-library": "//elearning-library-gateway.beta.101.com"
17667
+ "elearning-library": "//elearning-library-gateway.beta.101.com",
17668
+ uc: "https://uc-gateway.sdp.101.com"
17667
17669
  }
17668
17670
  };
17669
17671
  const recommendAPIV2 = ({
@@ -17804,6 +17806,12 @@ const cdnBdcsFileAPI = ({
17804
17806
  prefix: "",
17805
17807
  noSdpAppId: true
17806
17808
  });
17809
+ const cdnHotProxyAPI = ({
17810
+ env
17811
+ }) => getApi({
17812
+ host: config[env]["cdn-hot-proxy"],
17813
+ prefix: "/v0.1/static"
17814
+ });
17807
17815
  const siteConfigAPI = ({
17808
17816
  env,
17809
17817
  sdpAppId
@@ -17822,6 +17830,16 @@ const eLearningLibraryAPI = ({
17822
17830
  uc,
17823
17831
  sdpAppId
17824
17832
  });
17833
+ const ucAPI = ({
17834
+ uc,
17835
+ env,
17836
+ sdpAppId
17837
+ }) => getApi({
17838
+ host: config[env]["uc"],
17839
+ prefix: "/v1.1",
17840
+ uc,
17841
+ sdpAppId
17842
+ });
17825
17843
  async function getStatByChunk(resIds, requestFn, ...args) {
17826
17844
  try {
17827
17845
  const chunkSize = 100;
@@ -18272,7 +18290,7 @@ class Assessment {
18272
18290
  return assessmentVo;
18273
18291
  });
18274
18292
  __publicField(this, "getUserAssessmentRate", async ({ assessmentId, assessmentType = "course", userInfo }) => {
18275
- const cacheKey = assessmentRateCacheKey(assessmentId, userInfo.user_id);
18293
+ const cacheKey = assessmentRateCacheKey(assessmentId, userInfo == null ? void 0 : userInfo.user_id);
18276
18294
  let userAssessmentVo = localStorage.getItem(cacheKey);
18277
18295
  if (userAssessmentVo) {
18278
18296
  try {
@@ -18964,11 +18982,18 @@ class TCourse {
18964
18982
  return data;
18965
18983
  });
18966
18984
  // 获取视频活动课时
18967
- __publicField(this, "getVideoActivity", async ({ activityId, siteRelaId }) => {
18968
- const { data } = await this.request.cdn.cdnAPI.get(
18969
- `/${this.config.serviceName.zxxRegion}/${siteRelaId}/s_course/v1/video_activity/${activityId}.json`
18970
- );
18971
- return data;
18985
+ __publicField(this, "getVideoActivity", async ({ activityId, siteRelaId, serviceName: serviceName2 }) => {
18986
+ if (siteRelaId) {
18987
+ const { data } = await this.request.cdn.cdnAPI.get(
18988
+ `/${this.config.serviceName.zxxRegion}/${siteRelaId}/s_course/v1/video_activity/${activityId}.json`
18989
+ );
18990
+ return data;
18991
+ } else {
18992
+ const { data } = await this.request.cdn.cdnAPI.get(
18993
+ `/${serviceName2}/s_course/v1/video_activity/${activityId}.json`
18994
+ );
18995
+ return data;
18996
+ }
18972
18997
  });
18973
18998
  // 获取文档活动课时
18974
18999
  __publicField(this, "getDocumentActivity", async ({ activityId, siteRelaId }) => {
@@ -19282,6 +19307,110 @@ class Library {
19282
19307
  this.config = config2;
19283
19308
  }
19284
19309
  }
19310
+ class Ndr {
19311
+ constructor(props) {
19312
+ __publicField(this, "request");
19313
+ __publicField(this, "config");
19314
+ __publicField(this, "getResourceDetail", async ({ contentId, serviceName: serviceName2 }) => {
19315
+ const { data } = await this.request.cdn.cdnAPI.get(
19316
+ `${serviceName2}/ndrs/special_edu/resources/details/${contentId}.json`
19317
+ );
19318
+ return data;
19319
+ });
19320
+ __publicField(this, "getThematicCourseTree", async ({ contentId, serviceName: serviceName2 }) => {
19321
+ const { data } = await this.request.cdn.cdnAPI.get(
19322
+ `${serviceName2}/ndrs/special_edu/thematic_course/trees/${contentId}.json`
19323
+ );
19324
+ return data;
19325
+ });
19326
+ __publicField(this, "getThematicList", async ({ contentId, serviceName: serviceName2 }) => {
19327
+ const { data } = await this.request.cdn.cdnAPI.get(
19328
+ `${serviceName2}/ndrs/special_edu/thematic_course/${contentId}/resources/list.json`
19329
+ );
19330
+ return data;
19331
+ });
19332
+ __publicField(this, "fetchRegionLessonCourseList", async ({ regionId, businessType, teachingmaterialId }) => {
19333
+ const { zxxRegion } = this.config.serviceName;
19334
+ const { data } = await this.request.cdn.cdnAPI.get(
19335
+ `${zxxRegion}/${regionId}/${businessType}/teachingmaterials/${teachingmaterialId}/resources/parts.json`
19336
+ );
19337
+ const result = [];
19338
+ await Promise.all(
19339
+ data.map(async (t2, index) => {
19340
+ const { data: partData } = await this.request.cdn.cdnAPI.get(t2);
19341
+ result[index] = partData;
19342
+ })
19343
+ );
19344
+ return [].concat(...result);
19345
+ });
19346
+ __publicField(this, "BusinessType", {
19347
+ AutoLearning: "auto_learning",
19348
+ Prepare: "prepare"
19349
+ });
19350
+ __publicField(this, "fetchPrepareLessonChapter", async ({ id, serviceName: serviceName2 }) => {
19351
+ const { data } = await this.request.cdn.cdnAPI.get(`${serviceName2}/ndrs/resources/trees/${id}.json`);
19352
+ return data;
19353
+ });
19354
+ __publicField(this, "fetchPrepareLessonTreeCourseList", async ({ id, serviceName: serviceName2 }) => {
19355
+ const { data } = await this.request.cdn.cdnAPI.get(
19356
+ `${serviceName2}/ndrs/teachingmaterials/${id}/resources/parts.json`
19357
+ );
19358
+ const result = [];
19359
+ await Promise.all(
19360
+ data.map(async (t2, index) => {
19361
+ const { data: partData } = await this.request.cdn.cdnAPI.get(t2);
19362
+ result[index] = partData;
19363
+ })
19364
+ );
19365
+ return [].concat(...result);
19366
+ });
19367
+ __publicField(this, "fetchPrepareType", async ({ serviceName: serviceName2 }) => {
19368
+ var _a2, _b2;
19369
+ const { data } = await this.request.cdn.cdnAPI.get(`${serviceName2}/ndrs/tags/res_types.json`);
19370
+ return (_b2 = (_a2 = data == null ? void 0 : data.hierarchies) == null ? void 0 : _a2[0]) == null ? void 0 : _b2.children;
19371
+ });
19372
+ __publicField(this, "fetchNationalLessonChapter", async ({ id, serviceName: serviceName2 }) => {
19373
+ const { data } = await this.request.cdn.cdnAPI.get(`${serviceName2}/ndrs/lessons/trees/${id}.json`);
19374
+ return data;
19375
+ });
19376
+ __publicField(this, "fetchNationalLessonCourseList", async ({ id, serviceName: serviceName2 }) => {
19377
+ const { data } = await this.request.cdn.cdnAPI.get(`${serviceName2}/ndrs/teachingmaterials/${id}/lessons/parts.json`);
19378
+ const result = [];
19379
+ await Promise.all(
19380
+ data.map(async (t2, index) => {
19381
+ const { data: partData } = await this.request.cdn.cdnAPI.get(t2);
19382
+ result[index] = partData;
19383
+ })
19384
+ );
19385
+ return [].concat(...result);
19386
+ });
19387
+ __publicField(this, "fetchNationalLessonDetail", async ({ id, serviceName: serviceName2 }) => {
19388
+ const { data } = await this.request.cdn.cdnAPI.get(`${serviceName2}/ndrs/teachingmaterials/details/${id}.json`);
19389
+ return data;
19390
+ });
19391
+ __publicField(this, "fetchPrepareLessonRelate", async ({}) => {
19392
+ });
19393
+ __publicField(this, "fetchPrepareLesson", async ({}) => {
19394
+ });
19395
+ __publicField(this, "fetchPrepareLessonSubResource", async ({}) => {
19396
+ });
19397
+ __publicField(this, "fetchNationalLessonCourseDetail", async ({}) => {
19398
+ });
19399
+ __publicField(this, "fetchPrepareLessonDetail", async ({}) => {
19400
+ });
19401
+ __publicField(this, "fetchRegionResourceDetail", async ({}) => {
19402
+ });
19403
+ __publicField(this, "fetchRegionLessonRelate", async ({}) => {
19404
+ });
19405
+ __publicField(this, "fetchQualityCourse", async ({}) => {
19406
+ });
19407
+ __publicField(this, "fetchTeachingLessonDetail", async ({}) => {
19408
+ });
19409
+ const { request, config: config2 } = props;
19410
+ this.request = request;
19411
+ this.config = config2;
19412
+ }
19413
+ }
19285
19414
  const _Service = class _Service {
19286
19415
  constructor(props) {
19287
19416
  __publicField(this, "env");
@@ -19351,13 +19480,17 @@ const _Service = class _Service {
19351
19480
  cdn: {
19352
19481
  cdnAPI,
19353
19482
  cdnBdcsFileAPI,
19354
- cdnSFileAPI
19483
+ cdnSFileAPI,
19484
+ cdnHotProxyAPI
19355
19485
  },
19356
19486
  siteConfig: {
19357
19487
  siteConfigAPI
19358
19488
  },
19359
19489
  elearningLibrary: {
19360
19490
  eLearningLibraryAPI
19491
+ },
19492
+ uc: {
19493
+ ucAPI
19361
19494
  }
19362
19495
  };
19363
19496
  this.request = {};
@@ -19378,7 +19511,8 @@ const _Service = class _Service {
19378
19511
  channel: Channel,
19379
19512
  elearningTrain: ElearningTrain,
19380
19513
  siteConfig: SiteConfig,
19381
- library: Library
19514
+ library: Library,
19515
+ Ndr
19382
19516
  };
19383
19517
  this.service = {};
19384
19518
  Object.keys(services).forEach((key) => {
@@ -15163,7 +15163,7 @@ var __publicField = (obj, key, value) => {
15163
15163
  });
15164
15164
  _defineProperty(this, "getIndentity", /* @__PURE__ */ _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee9() {
15165
15165
  var _this$userInfo;
15166
- var userId, force, userIdentities, _userIdentities$userI, _userIdentities$userI2, ucAPI, url, _ref15, _ref15$items, items, identities, _getUserIdentitiesCac, userIdentitiesCache, _args9 = arguments;
15166
+ var userId, force, userIdentities, _userIdentities$userI, _userIdentities$userI2, ucAPI2, url, _ref15, _ref15$items, items, identities, _getUserIdentitiesCac, userIdentitiesCache, _args9 = arguments;
15167
15167
  return _regeneratorRuntime().wrap(function _callee9$(_context9) {
15168
15168
  while (1)
15169
15169
  switch (_context9.prev = _context9.next) {
@@ -15178,14 +15178,14 @@ var __publicField = (obj, key, value) => {
15178
15178
  case 4:
15179
15179
  userIdentities = _this.userIdentities;
15180
15180
  _context9.prev = 5;
15181
- ucAPI = _this.ucApi();
15181
+ ucAPI2 = _this.ucApi();
15182
15182
  if (!(!((_userIdentities$userI = userIdentities[userId]) !== null && _userIdentities$userI !== void 0 && (_userIdentities$userI = _userIdentities$userI.data) !== null && _userIdentities$userI !== void 0 && (_userIdentities$userI = _userIdentities$userI.items) !== null && _userIdentities$userI !== void 0 && _userIdentities$userI.length) || force)) {
15183
15183
  _context9.next = 12;
15184
15184
  break;
15185
15185
  }
15186
15186
  url = `/users/${userId}/identities`;
15187
15187
  _context9.next = 11;
15188
- return ucAPI.get(url);
15188
+ return ucAPI2.get(url);
15189
15189
  case 11:
15190
15190
  userIdentities[userId] = _context9.sent;
15191
15191
  case 12:
@@ -15262,7 +15262,7 @@ var __publicField = (obj, key, value) => {
15262
15262
  _defineProperty(this, "addUserIdentities", /* @__PURE__ */ function() {
15263
15263
  var _ref19 = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee11(_ref18) {
15264
15264
  var _this$userInfo2;
15265
- var _ref18$userId, userId, code, ucAPI;
15265
+ var _ref18$userId, userId, code, ucAPI2;
15266
15266
  return _regeneratorRuntime().wrap(function _callee11$(_context11) {
15267
15267
  while (1)
15268
15268
  switch (_context11.prev = _context11.next) {
@@ -15274,9 +15274,9 @@ var __publicField = (obj, key, value) => {
15274
15274
  }
15275
15275
  return _context11.abrupt("return");
15276
15276
  case 3:
15277
- ucAPI = _this.ucApi();
15277
+ ucAPI2 = _this.ucApi();
15278
15278
  _context11.next = 6;
15279
- return ucAPI.post(`/users/${userId}/identities`, {
15279
+ return ucAPI2.post(`/users/${userId}/identities`, {
15280
15280
  identity_code: code
15281
15281
  });
15282
15282
  case 6:
@@ -15339,7 +15339,7 @@ var __publicField = (obj, key, value) => {
15339
15339
  }());
15340
15340
  _defineProperty(this, "isStudent", /* @__PURE__ */ function() {
15341
15341
  var _ref21 = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee13(curUserInfo) {
15342
- var checkOrg, ucAPI, checkIsStudent, isStudent, response, inst, _args13 = arguments;
15342
+ var checkOrg, ucAPI2, checkIsStudent, isStudent, response, inst, _args13 = arguments;
15343
15343
  return _regeneratorRuntime().wrap(function _callee13$(_context13) {
15344
15344
  while (1)
15345
15345
  switch (_context13.prev = _context13.next) {
@@ -15351,7 +15351,7 @@ var __publicField = (obj, key, value) => {
15351
15351
  }
15352
15352
  return _context13.abrupt("return", false);
15353
15353
  case 3:
15354
- ucAPI = _this.ucApi();
15354
+ ucAPI2 = _this.ucApi();
15355
15355
  checkIsStudent = true;
15356
15356
  isStudent = false;
15357
15357
  if (!checkOrg) {
@@ -15359,7 +15359,7 @@ var __publicField = (obj, key, value) => {
15359
15359
  break;
15360
15360
  }
15361
15361
  _context13.next = 9;
15362
- return ucAPI.get("/institutions/actions/search", {
15362
+ return ucAPI2.get("/institutions/actions/search", {
15363
15363
  params: {
15364
15364
  app_id: _this.getSdpAppId()
15365
15365
  }
@@ -17656,6 +17656,7 @@ var __publicField = (obj, key, value) => {
17656
17656
  // 学习记录
17657
17657
  "x-study-record": "//x-study-record-api.beta.101.com",
17658
17658
  cdn: "//ndcs-pre.101.com",
17659
+ "cdn-hot-proxy": "//betacs.101.com",
17659
17660
  // 站点配置(存在灰度能力)
17660
17661
  "site-config": "//grey-config-web.ykt.cbern.com.cn",
17661
17662
  serviceName: {
@@ -17667,7 +17668,8 @@ var __publicField = (obj, key, value) => {
17667
17668
  },
17668
17669
  defaultAreaSite: "hn",
17669
17670
  // 内容库
17670
- "elearning-library": "//elearning-library-gateway.beta.101.com"
17671
+ "elearning-library": "//elearning-library-gateway.beta.101.com",
17672
+ uc: "https://uc-gateway.sdp.101.com"
17671
17673
  }
17672
17674
  };
17673
17675
  const recommendAPIV2 = ({
@@ -17808,6 +17810,12 @@ var __publicField = (obj, key, value) => {
17808
17810
  prefix: "",
17809
17811
  noSdpAppId: true
17810
17812
  });
17813
+ const cdnHotProxyAPI = ({
17814
+ env
17815
+ }) => getApi({
17816
+ host: config[env]["cdn-hot-proxy"],
17817
+ prefix: "/v0.1/static"
17818
+ });
17811
17819
  const siteConfigAPI = ({
17812
17820
  env,
17813
17821
  sdpAppId
@@ -17826,6 +17834,16 @@ var __publicField = (obj, key, value) => {
17826
17834
  uc,
17827
17835
  sdpAppId
17828
17836
  });
17837
+ const ucAPI = ({
17838
+ uc,
17839
+ env,
17840
+ sdpAppId
17841
+ }) => getApi({
17842
+ host: config[env]["uc"],
17843
+ prefix: "/v1.1",
17844
+ uc,
17845
+ sdpAppId
17846
+ });
17829
17847
  async function getStatByChunk(resIds, requestFn, ...args) {
17830
17848
  try {
17831
17849
  const chunkSize = 100;
@@ -18276,7 +18294,7 @@ var __publicField = (obj, key, value) => {
18276
18294
  return assessmentVo;
18277
18295
  });
18278
18296
  __publicField(this, "getUserAssessmentRate", async ({ assessmentId, assessmentType = "course", userInfo }) => {
18279
- const cacheKey = assessmentRateCacheKey(assessmentId, userInfo.user_id);
18297
+ const cacheKey = assessmentRateCacheKey(assessmentId, userInfo == null ? void 0 : userInfo.user_id);
18280
18298
  let userAssessmentVo = localStorage.getItem(cacheKey);
18281
18299
  if (userAssessmentVo) {
18282
18300
  try {
@@ -18968,11 +18986,18 @@ var __publicField = (obj, key, value) => {
18968
18986
  return data;
18969
18987
  });
18970
18988
  // 获取视频活动课时
18971
- __publicField(this, "getVideoActivity", async ({ activityId, siteRelaId }) => {
18972
- const { data } = await this.request.cdn.cdnAPI.get(
18973
- `/${this.config.serviceName.zxxRegion}/${siteRelaId}/s_course/v1/video_activity/${activityId}.json`
18974
- );
18975
- return data;
18989
+ __publicField(this, "getVideoActivity", async ({ activityId, siteRelaId, serviceName: serviceName2 }) => {
18990
+ if (siteRelaId) {
18991
+ const { data } = await this.request.cdn.cdnAPI.get(
18992
+ `/${this.config.serviceName.zxxRegion}/${siteRelaId}/s_course/v1/video_activity/${activityId}.json`
18993
+ );
18994
+ return data;
18995
+ } else {
18996
+ const { data } = await this.request.cdn.cdnAPI.get(
18997
+ `/${serviceName2}/s_course/v1/video_activity/${activityId}.json`
18998
+ );
18999
+ return data;
19000
+ }
18976
19001
  });
18977
19002
  // 获取文档活动课时
18978
19003
  __publicField(this, "getDocumentActivity", async ({ activityId, siteRelaId }) => {
@@ -19286,6 +19311,110 @@ var __publicField = (obj, key, value) => {
19286
19311
  this.config = config2;
19287
19312
  }
19288
19313
  }
19314
+ class Ndr {
19315
+ constructor(props) {
19316
+ __publicField(this, "request");
19317
+ __publicField(this, "config");
19318
+ __publicField(this, "getResourceDetail", async ({ contentId, serviceName: serviceName2 }) => {
19319
+ const { data } = await this.request.cdn.cdnAPI.get(
19320
+ `${serviceName2}/ndrs/special_edu/resources/details/${contentId}.json`
19321
+ );
19322
+ return data;
19323
+ });
19324
+ __publicField(this, "getThematicCourseTree", async ({ contentId, serviceName: serviceName2 }) => {
19325
+ const { data } = await this.request.cdn.cdnAPI.get(
19326
+ `${serviceName2}/ndrs/special_edu/thematic_course/trees/${contentId}.json`
19327
+ );
19328
+ return data;
19329
+ });
19330
+ __publicField(this, "getThematicList", async ({ contentId, serviceName: serviceName2 }) => {
19331
+ const { data } = await this.request.cdn.cdnAPI.get(
19332
+ `${serviceName2}/ndrs/special_edu/thematic_course/${contentId}/resources/list.json`
19333
+ );
19334
+ return data;
19335
+ });
19336
+ __publicField(this, "fetchRegionLessonCourseList", async ({ regionId, businessType, teachingmaterialId }) => {
19337
+ const { zxxRegion } = this.config.serviceName;
19338
+ const { data } = await this.request.cdn.cdnAPI.get(
19339
+ `${zxxRegion}/${regionId}/${businessType}/teachingmaterials/${teachingmaterialId}/resources/parts.json`
19340
+ );
19341
+ const result = [];
19342
+ await Promise.all(
19343
+ data.map(async (t2, index) => {
19344
+ const { data: partData } = await this.request.cdn.cdnAPI.get(t2);
19345
+ result[index] = partData;
19346
+ })
19347
+ );
19348
+ return [].concat(...result);
19349
+ });
19350
+ __publicField(this, "BusinessType", {
19351
+ AutoLearning: "auto_learning",
19352
+ Prepare: "prepare"
19353
+ });
19354
+ __publicField(this, "fetchPrepareLessonChapter", async ({ id, serviceName: serviceName2 }) => {
19355
+ const { data } = await this.request.cdn.cdnAPI.get(`${serviceName2}/ndrs/resources/trees/${id}.json`);
19356
+ return data;
19357
+ });
19358
+ __publicField(this, "fetchPrepareLessonTreeCourseList", async ({ id, serviceName: serviceName2 }) => {
19359
+ const { data } = await this.request.cdn.cdnAPI.get(
19360
+ `${serviceName2}/ndrs/teachingmaterials/${id}/resources/parts.json`
19361
+ );
19362
+ const result = [];
19363
+ await Promise.all(
19364
+ data.map(async (t2, index) => {
19365
+ const { data: partData } = await this.request.cdn.cdnAPI.get(t2);
19366
+ result[index] = partData;
19367
+ })
19368
+ );
19369
+ return [].concat(...result);
19370
+ });
19371
+ __publicField(this, "fetchPrepareType", async ({ serviceName: serviceName2 }) => {
19372
+ var _a2, _b2;
19373
+ const { data } = await this.request.cdn.cdnAPI.get(`${serviceName2}/ndrs/tags/res_types.json`);
19374
+ return (_b2 = (_a2 = data == null ? void 0 : data.hierarchies) == null ? void 0 : _a2[0]) == null ? void 0 : _b2.children;
19375
+ });
19376
+ __publicField(this, "fetchNationalLessonChapter", async ({ id, serviceName: serviceName2 }) => {
19377
+ const { data } = await this.request.cdn.cdnAPI.get(`${serviceName2}/ndrs/lessons/trees/${id}.json`);
19378
+ return data;
19379
+ });
19380
+ __publicField(this, "fetchNationalLessonCourseList", async ({ id, serviceName: serviceName2 }) => {
19381
+ const { data } = await this.request.cdn.cdnAPI.get(`${serviceName2}/ndrs/teachingmaterials/${id}/lessons/parts.json`);
19382
+ const result = [];
19383
+ await Promise.all(
19384
+ data.map(async (t2, index) => {
19385
+ const { data: partData } = await this.request.cdn.cdnAPI.get(t2);
19386
+ result[index] = partData;
19387
+ })
19388
+ );
19389
+ return [].concat(...result);
19390
+ });
19391
+ __publicField(this, "fetchNationalLessonDetail", async ({ id, serviceName: serviceName2 }) => {
19392
+ const { data } = await this.request.cdn.cdnAPI.get(`${serviceName2}/ndrs/teachingmaterials/details/${id}.json`);
19393
+ return data;
19394
+ });
19395
+ __publicField(this, "fetchPrepareLessonRelate", async ({}) => {
19396
+ });
19397
+ __publicField(this, "fetchPrepareLesson", async ({}) => {
19398
+ });
19399
+ __publicField(this, "fetchPrepareLessonSubResource", async ({}) => {
19400
+ });
19401
+ __publicField(this, "fetchNationalLessonCourseDetail", async ({}) => {
19402
+ });
19403
+ __publicField(this, "fetchPrepareLessonDetail", async ({}) => {
19404
+ });
19405
+ __publicField(this, "fetchRegionResourceDetail", async ({}) => {
19406
+ });
19407
+ __publicField(this, "fetchRegionLessonRelate", async ({}) => {
19408
+ });
19409
+ __publicField(this, "fetchQualityCourse", async ({}) => {
19410
+ });
19411
+ __publicField(this, "fetchTeachingLessonDetail", async ({}) => {
19412
+ });
19413
+ const { request, config: config2 } = props;
19414
+ this.request = request;
19415
+ this.config = config2;
19416
+ }
19417
+ }
19289
19418
  const _Service = class _Service {
19290
19419
  constructor(props) {
19291
19420
  __publicField(this, "env");
@@ -19355,13 +19484,17 @@ var __publicField = (obj, key, value) => {
19355
19484
  cdn: {
19356
19485
  cdnAPI,
19357
19486
  cdnBdcsFileAPI,
19358
- cdnSFileAPI
19487
+ cdnSFileAPI,
19488
+ cdnHotProxyAPI
19359
19489
  },
19360
19490
  siteConfig: {
19361
19491
  siteConfigAPI
19362
19492
  },
19363
19493
  elearningLibrary: {
19364
19494
  eLearningLibraryAPI
19495
+ },
19496
+ uc: {
19497
+ ucAPI
19365
19498
  }
19366
19499
  };
19367
19500
  this.request = {};
@@ -19382,7 +19515,8 @@ var __publicField = (obj, key, value) => {
19382
19515
  channel: Channel,
19383
19516
  elearningTrain: ElearningTrain,
19384
19517
  siteConfig: SiteConfig,
19385
- library: Library
19518
+ library: Library,
19519
+ Ndr
19386
19520
  };
19387
19521
  this.service = {};
19388
19522
  Object.keys(services).forEach((key) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@x-edu/service",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "main": "dist/service.js",
5
5
  "module": "dist/service.mjs",
6
6
  "types": "dist/index.d.ts",