@x-edu/service 0.0.4 → 0.0.6

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.
@@ -7,7 +7,8 @@ export declare const favoriteAuthAPI: ({ uc, env, sdpAppId }: {
7
7
  env: any;
8
8
  sdpAppId: any;
9
9
  }) => import('../../node_modules/@x-edu/functions/dist/request/interface').RequestInstance;
10
- export declare const favoriteAuthAPIWithError: ({ uc, env, }: {
10
+ export declare const favoriteAuthAPIWithError: ({ uc, env, sdpAppId }: {
11
11
  uc: any;
12
12
  env: any;
13
+ sdpAppId: any;
13
14
  }) => import('../../node_modules/@x-edu/functions/dist/request/interface').RequestInstance;
@@ -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;
package/dist/service.js CHANGED
@@ -17764,11 +17764,13 @@ const favoriteAuthAPI = ({
17764
17764
  });
17765
17765
  const favoriteAuthAPIWithError = ({
17766
17766
  uc,
17767
- env
17767
+ env,
17768
+ sdpAppId
17768
17769
  }) => getApi({
17769
17770
  host: config[env]["e-favorite-api"],
17770
17771
  prefix: "/v1",
17771
17772
  uc,
17773
+ sdpAppId,
17772
17774
  throwError: true
17773
17775
  });
17774
17776
  const xStudyRecordAPI = ({
@@ -18325,6 +18327,7 @@ class Assessment {
18325
18327
  class Like {
18326
18328
  constructor(props) {
18327
18329
  __publicField(this, "request");
18330
+ __publicField(this, "sdpAppId");
18328
18331
  // 获取资源点赞
18329
18332
  __publicField(this, "getResourceLikes", async ({ resId, type }) => {
18330
18333
  const { data } = await this.request.xProxy.xProxyCloudAPI.get(`/res_stats/${resId}`, {
@@ -18335,10 +18338,15 @@ class Like {
18335
18338
  return data;
18336
18339
  });
18337
18340
  __publicField(this, "postResourceLikes", async ({ resId, type = "like" }) => {
18338
- 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
+ });
18339
18346
  });
18340
- const { request } = props;
18347
+ const { request, sdpAppId } = props;
18341
18348
  this.request = request;
18349
+ this.sdpAppId = sdpAppId;
18342
18350
  }
18343
18351
  }
18344
18352
  class Feedback {
@@ -19376,7 +19384,7 @@ const _Service = class _Service {
19376
19384
  };
19377
19385
  this.service = {};
19378
19386
  Object.keys(services).forEach((key) => {
19379
- this.service[key] = new services[key]({ request: this.request, config: this.config });
19387
+ this.service[key] = new services[key]({ request: this.request, config: this.config, sdpAppId: this.sdpAppId });
19380
19388
  });
19381
19389
  }
19382
19390
  };
package/dist/service.mjs CHANGED
@@ -17762,11 +17762,13 @@ const favoriteAuthAPI = ({
17762
17762
  });
17763
17763
  const favoriteAuthAPIWithError = ({
17764
17764
  uc,
17765
- env
17765
+ env,
17766
+ sdpAppId
17766
17767
  }) => getApi({
17767
17768
  host: config[env]["e-favorite-api"],
17768
17769
  prefix: "/v1",
17769
17770
  uc,
17771
+ sdpAppId,
17770
17772
  throwError: true
17771
17773
  });
17772
17774
  const xStudyRecordAPI = ({
@@ -18323,6 +18325,7 @@ class Assessment {
18323
18325
  class Like {
18324
18326
  constructor(props) {
18325
18327
  __publicField(this, "request");
18328
+ __publicField(this, "sdpAppId");
18326
18329
  // 获取资源点赞
18327
18330
  __publicField(this, "getResourceLikes", async ({ resId, type }) => {
18328
18331
  const { data } = await this.request.xProxy.xProxyCloudAPI.get(`/res_stats/${resId}`, {
@@ -18333,10 +18336,15 @@ class Like {
18333
18336
  return data;
18334
18337
  });
18335
18338
  __publicField(this, "postResourceLikes", async ({ resId, type = "like" }) => {
18336
- 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
+ });
18337
18344
  });
18338
- const { request } = props;
18345
+ const { request, sdpAppId } = props;
18339
18346
  this.request = request;
18347
+ this.sdpAppId = sdpAppId;
18340
18348
  }
18341
18349
  }
18342
18350
  class Feedback {
@@ -19374,7 +19382,7 @@ const _Service = class _Service {
19374
19382
  };
19375
19383
  this.service = {};
19376
19384
  Object.keys(services).forEach((key) => {
19377
- this.service[key] = new services[key]({ request: this.request, config: this.config });
19385
+ this.service[key] = new services[key]({ request: this.request, config: this.config, sdpAppId: this.sdpAppId });
19378
19386
  });
19379
19387
  }
19380
19388
  };
@@ -17766,11 +17766,13 @@ var __publicField = (obj, key, value) => {
17766
17766
  });
17767
17767
  const favoriteAuthAPIWithError = ({
17768
17768
  uc,
17769
- env
17769
+ env,
17770
+ sdpAppId
17770
17771
  }) => getApi({
17771
17772
  host: config[env]["e-favorite-api"],
17772
17773
  prefix: "/v1",
17773
17774
  uc,
17775
+ sdpAppId,
17774
17776
  throwError: true
17775
17777
  });
17776
17778
  const xStudyRecordAPI = ({
@@ -18327,6 +18329,7 @@ var __publicField = (obj, key, value) => {
18327
18329
  class Like {
18328
18330
  constructor(props) {
18329
18331
  __publicField(this, "request");
18332
+ __publicField(this, "sdpAppId");
18330
18333
  // 获取资源点赞
18331
18334
  __publicField(this, "getResourceLikes", async ({ resId, type }) => {
18332
18335
  const { data } = await this.request.xProxy.xProxyCloudAPI.get(`/res_stats/${resId}`, {
@@ -18337,10 +18340,15 @@ var __publicField = (obj, key, value) => {
18337
18340
  return data;
18338
18341
  });
18339
18342
  __publicField(this, "postResourceLikes", async ({ resId, type = "like" }) => {
18340
- 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
+ });
18341
18348
  });
18342
- const { request } = props;
18349
+ const { request, sdpAppId } = props;
18343
18350
  this.request = request;
18351
+ this.sdpAppId = sdpAppId;
18344
18352
  }
18345
18353
  }
18346
18354
  class Feedback {
@@ -19378,7 +19386,7 @@ var __publicField = (obj, key, value) => {
19378
19386
  };
19379
19387
  this.service = {};
19380
19388
  Object.keys(services).forEach((key) => {
19381
- this.service[key] = new services[key]({ request: this.request, config: this.config });
19389
+ this.service[key] = new services[key]({ request: this.request, config: this.config, sdpAppId: this.sdpAppId });
19382
19390
  });
19383
19391
  }
19384
19392
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@x-edu/service",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "main": "dist/service.js",
5
5
  "module": "dist/service.mjs",
6
6
  "types": "dist/index.d.ts",