@x-edu/service 0.0.5 → 0.0.7

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.
@@ -3,6 +3,7 @@
3
3
  */
4
4
  declare class Like {
5
5
  request: any;
6
+ sdpAppId: any;
6
7
  constructor(props: any);
7
8
  getResourceLikes: ({ resId, type }: {
8
9
  resId: any;
@@ -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
@@ -18327,6 +18327,7 @@ class Assessment {
18327
18327
  class Like {
18328
18328
  constructor(props) {
18329
18329
  __publicField(this, "request");
18330
+ __publicField(this, "sdpAppId");
18330
18331
  // 获取资源点赞
18331
18332
  __publicField(this, "getResourceLikes", async ({ resId, type }) => {
18332
18333
  const { data } = await this.request.xProxy.xProxyCloudAPI.get(`/res_stats/${resId}`, {
@@ -18337,10 +18338,15 @@ class Like {
18337
18338
  return data;
18338
18339
  });
18339
18340
  __publicField(this, "postResourceLikes", async ({ resId, type = "like" }) => {
18340
- await this.request.xCloudWeb.xCloudWebAPI.post(`/res_stats/${resId}?type=${type}`);
18341
+ await this.request.xCloudWeb.xCloudWebAPI.post(`/res_stats/${resId}?type=${type}`, {
18342
+ Headers: {
18343
+ "sdp-app-id": this.sdpAppId
18344
+ }
18345
+ });
18341
18346
  });
18342
- const { request } = props;
18347
+ const { request, sdpAppId } = props;
18343
18348
  this.request = request;
18349
+ this.sdpAppId = sdpAppId;
18344
18350
  }
18345
18351
  }
18346
18352
  class Feedback {
@@ -18960,11 +18966,18 @@ class TCourse {
18960
18966
  return data;
18961
18967
  });
18962
18968
  // 获取视频活动课时
18963
- __publicField(this, "getVideoActivity", async ({ activityId, siteRelaId }) => {
18964
- const { data } = await this.request.cdn.cdnAPI.get(
18965
- `/${this.config.serviceName.zxxRegion}/${siteRelaId}/s_course/v1/video_activity/${activityId}.json`
18966
- );
18967
- return data;
18969
+ __publicField(this, "getVideoActivity", async ({ activityId, siteRelaId, serviceName: serviceName2 }) => {
18970
+ if (siteRelaId) {
18971
+ const { data } = await this.request.cdn.cdnAPI.get(
18972
+ `/${this.config.serviceName.zxxRegion}/${siteRelaId}/s_course/v1/video_activity/${activityId}.json`
18973
+ );
18974
+ return data;
18975
+ } else {
18976
+ const { data } = await this.request.cdn.cdnAPI.get(
18977
+ `/${serviceName2}/s_course/v1/video_activity/${activityId}.json`
18978
+ );
18979
+ return data;
18980
+ }
18968
18981
  });
18969
18982
  // 获取文档活动课时
18970
18983
  __publicField(this, "getDocumentActivity", async ({ activityId, siteRelaId }) => {
@@ -19378,7 +19391,7 @@ const _Service = class _Service {
19378
19391
  };
19379
19392
  this.service = {};
19380
19393
  Object.keys(services).forEach((key) => {
19381
- this.service[key] = new services[key]({ request: this.request, config: this.config });
19394
+ this.service[key] = new services[key]({ request: this.request, config: this.config, sdpAppId: this.sdpAppId });
19382
19395
  });
19383
19396
  }
19384
19397
  };
package/dist/service.mjs CHANGED
@@ -18325,6 +18325,7 @@ class Assessment {
18325
18325
  class Like {
18326
18326
  constructor(props) {
18327
18327
  __publicField(this, "request");
18328
+ __publicField(this, "sdpAppId");
18328
18329
  // 获取资源点赞
18329
18330
  __publicField(this, "getResourceLikes", async ({ resId, type }) => {
18330
18331
  const { data } = await this.request.xProxy.xProxyCloudAPI.get(`/res_stats/${resId}`, {
@@ -18335,10 +18336,15 @@ class Like {
18335
18336
  return data;
18336
18337
  });
18337
18338
  __publicField(this, "postResourceLikes", async ({ resId, type = "like" }) => {
18338
- await this.request.xCloudWeb.xCloudWebAPI.post(`/res_stats/${resId}?type=${type}`);
18339
+ await this.request.xCloudWeb.xCloudWebAPI.post(`/res_stats/${resId}?type=${type}`, {
18340
+ Headers: {
18341
+ "sdp-app-id": this.sdpAppId
18342
+ }
18343
+ });
18339
18344
  });
18340
- const { request } = props;
18345
+ const { request, sdpAppId } = props;
18341
18346
  this.request = request;
18347
+ this.sdpAppId = sdpAppId;
18342
18348
  }
18343
18349
  }
18344
18350
  class Feedback {
@@ -18958,11 +18964,18 @@ class TCourse {
18958
18964
  return data;
18959
18965
  });
18960
18966
  // 获取视频活动课时
18961
- __publicField(this, "getVideoActivity", async ({ activityId, siteRelaId }) => {
18962
- const { data } = await this.request.cdn.cdnAPI.get(
18963
- `/${this.config.serviceName.zxxRegion}/${siteRelaId}/s_course/v1/video_activity/${activityId}.json`
18964
- );
18965
- return data;
18967
+ __publicField(this, "getVideoActivity", async ({ activityId, siteRelaId, serviceName: serviceName2 }) => {
18968
+ if (siteRelaId) {
18969
+ const { data } = await this.request.cdn.cdnAPI.get(
18970
+ `/${this.config.serviceName.zxxRegion}/${siteRelaId}/s_course/v1/video_activity/${activityId}.json`
18971
+ );
18972
+ return data;
18973
+ } else {
18974
+ const { data } = await this.request.cdn.cdnAPI.get(
18975
+ `/${serviceName2}/s_course/v1/video_activity/${activityId}.json`
18976
+ );
18977
+ return data;
18978
+ }
18966
18979
  });
18967
18980
  // 获取文档活动课时
18968
18981
  __publicField(this, "getDocumentActivity", async ({ activityId, siteRelaId }) => {
@@ -19376,7 +19389,7 @@ const _Service = class _Service {
19376
19389
  };
19377
19390
  this.service = {};
19378
19391
  Object.keys(services).forEach((key) => {
19379
- this.service[key] = new services[key]({ request: this.request, config: this.config });
19392
+ this.service[key] = new services[key]({ request: this.request, config: this.config, sdpAppId: this.sdpAppId });
19380
19393
  });
19381
19394
  }
19382
19395
  };
@@ -18329,6 +18329,7 @@ var __publicField = (obj, key, value) => {
18329
18329
  class Like {
18330
18330
  constructor(props) {
18331
18331
  __publicField(this, "request");
18332
+ __publicField(this, "sdpAppId");
18332
18333
  // 获取资源点赞
18333
18334
  __publicField(this, "getResourceLikes", async ({ resId, type }) => {
18334
18335
  const { data } = await this.request.xProxy.xProxyCloudAPI.get(`/res_stats/${resId}`, {
@@ -18339,10 +18340,15 @@ var __publicField = (obj, key, value) => {
18339
18340
  return data;
18340
18341
  });
18341
18342
  __publicField(this, "postResourceLikes", async ({ resId, type = "like" }) => {
18342
- await this.request.xCloudWeb.xCloudWebAPI.post(`/res_stats/${resId}?type=${type}`);
18343
+ await this.request.xCloudWeb.xCloudWebAPI.post(`/res_stats/${resId}?type=${type}`, {
18344
+ Headers: {
18345
+ "sdp-app-id": this.sdpAppId
18346
+ }
18347
+ });
18343
18348
  });
18344
- const { request } = props;
18349
+ const { request, sdpAppId } = props;
18345
18350
  this.request = request;
18351
+ this.sdpAppId = sdpAppId;
18346
18352
  }
18347
18353
  }
18348
18354
  class Feedback {
@@ -18962,11 +18968,18 @@ var __publicField = (obj, key, value) => {
18962
18968
  return data;
18963
18969
  });
18964
18970
  // 获取视频活动课时
18965
- __publicField(this, "getVideoActivity", async ({ activityId, siteRelaId }) => {
18966
- const { data } = await this.request.cdn.cdnAPI.get(
18967
- `/${this.config.serviceName.zxxRegion}/${siteRelaId}/s_course/v1/video_activity/${activityId}.json`
18968
- );
18969
- return data;
18971
+ __publicField(this, "getVideoActivity", async ({ activityId, siteRelaId, serviceName: serviceName2 }) => {
18972
+ if (siteRelaId) {
18973
+ const { data } = await this.request.cdn.cdnAPI.get(
18974
+ `/${this.config.serviceName.zxxRegion}/${siteRelaId}/s_course/v1/video_activity/${activityId}.json`
18975
+ );
18976
+ return data;
18977
+ } else {
18978
+ const { data } = await this.request.cdn.cdnAPI.get(
18979
+ `/${serviceName2}/s_course/v1/video_activity/${activityId}.json`
18980
+ );
18981
+ return data;
18982
+ }
18970
18983
  });
18971
18984
  // 获取文档活动课时
18972
18985
  __publicField(this, "getDocumentActivity", async ({ activityId, siteRelaId }) => {
@@ -19380,7 +19393,7 @@ var __publicField = (obj, key, value) => {
19380
19393
  };
19381
19394
  this.service = {};
19382
19395
  Object.keys(services).forEach((key) => {
19383
- this.service[key] = new services[key]({ request: this.request, config: this.config });
19396
+ this.service[key] = new services[key]({ request: this.request, config: this.config, sdpAppId: this.sdpAppId });
19384
19397
  });
19385
19398
  }
19386
19399
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@x-edu/service",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "main": "dist/service.js",
5
5
  "module": "dist/service.mjs",
6
6
  "types": "dist/index.d.ts",