@cpzxrobot/sdk 1.2.88 → 1.2.90

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/dist/index.js CHANGED
@@ -102,6 +102,7 @@ class Cpzxrobot {
102
102
  const fetchWithAuth = async (input, init) => {
103
103
  const headers = new Headers(init === null || init === void 0 ? void 0 : init.headers);
104
104
  headers.set('Authorization', this.token);
105
+ headers.set('Miniapp-Code', this.appCode);
105
106
  const response = await fetch(baseURL + input.toString(), Object.assign(Object.assign({}, init), { headers }));
106
107
  if (!response.ok) {
107
108
  throw new Error(`HTTP error! status: ${response.status}`);
@@ -111,6 +112,7 @@ class Cpzxrobot {
111
112
  const streamWithAuth = async (input, init, fn) => {
112
113
  const headers = new Headers(init === null || init === void 0 ? void 0 : init.headers);
113
114
  headers.set('Authorization', this.token);
115
+ headers.set('Miniapp-Code', this.appCode);
114
116
  const response = await fetch(baseURL + input.toString(), Object.assign(Object.assign({}, init), { headers }));
115
117
  var reader = response.body.getReader();
116
118
  const decoder = new TextDecoder("utf-8");
package/index.ts CHANGED
@@ -118,6 +118,7 @@ export class Cpzxrobot {
118
118
  const fetchWithAuth = async (input: RequestInfo, init?: RequestInit) => {
119
119
  const headers = new Headers(init?.headers);
120
120
  headers.set('Authorization', this.token);
121
+ headers.set('Miniapp-Code', this.appCode);
121
122
  const response = await fetch(baseURL + input.toString(), {
122
123
  ...init,
123
124
  headers
@@ -132,6 +133,7 @@ export class Cpzxrobot {
132
133
  const streamWithAuth = async (input: RequestInfo, init?: RequestInit, fn?: Function) => {
133
134
  const headers = new Headers(init?.headers);
134
135
  headers.set('Authorization', this.token);
136
+ headers.set('Miniapp-Code', this.appCode);
135
137
  const response = await fetch(baseURL + input.toString(), {
136
138
  ...init,
137
139
  headers
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpzxrobot/sdk",
3
- "version": "1.2.88",
3
+ "version": "1.2.90",
4
4
  "description": "提供给上海正芯数智APP第三方H5应用使用的SDK",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {