hanbiro-react16-sdk 1.0.32 → 1.0.34
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/components/ChatAIDraft/helper.js +27 -2
- package/dist/hanbiro-react16-sdk.style.css +2 -2
- package/dist/hanbiro-react16-sdk.umd.js +2664 -701
- package/dist/index.js +2 -2
- package/dist/node_modules/@hanbiro/signer-core/dist/index.js +932 -0
- package/dist/utils/api.d.ts +1 -0
- package/dist/utils/api.js +17 -3
- package/package.json +3 -2
package/dist/utils/api.d.ts
CHANGED
package/dist/utils/api.js
CHANGED
|
@@ -35,12 +35,25 @@ var __async = (__this, __arguments, generator) => {
|
|
|
35
35
|
});
|
|
36
36
|
};
|
|
37
37
|
import { getBaseUrl } from "./url.js";
|
|
38
|
+
import { ClientSigner as W } from "../node_modules/@hanbiro/signer-core/dist/index.js";
|
|
39
|
+
const getSigner = () => {
|
|
40
|
+
var _a;
|
|
41
|
+
const existed = (_a = window == null ? void 0 : window.parent) == null ? void 0 : _a.HanSigCommon;
|
|
42
|
+
if (existed) {
|
|
43
|
+
return existed;
|
|
44
|
+
} else {
|
|
45
|
+
return new W({ baseUrl: getBaseUrl() });
|
|
46
|
+
}
|
|
47
|
+
};
|
|
38
48
|
const apiGet = (url, opts) => __async(void 0, null, function* () {
|
|
49
|
+
var _a;
|
|
50
|
+
const sigConfig = { method: "POST", baseURL: getBaseUrl(), url };
|
|
51
|
+
const sigHeaders = yield (_a = getSigner()) == null ? void 0 : _a.generateHeaders(sigConfig);
|
|
39
52
|
const response = yield fetch(getBaseUrl() + url, {
|
|
40
|
-
headers: __spreadValues({
|
|
53
|
+
headers: __spreadValues(__spreadValues({
|
|
41
54
|
Accept: "application/json, text/plain, */*",
|
|
42
55
|
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8"
|
|
43
|
-
}, opts == null ? void 0 : opts.headers)
|
|
56
|
+
}, opts == null ? void 0 : opts.headers), sigHeaders)
|
|
44
57
|
});
|
|
45
58
|
let data = null;
|
|
46
59
|
if (response.ok) {
|
|
@@ -51,5 +64,6 @@ const apiGet = (url, opts) => __async(void 0, null, function* () {
|
|
|
51
64
|
return { data, code: response.status, ok: response.ok };
|
|
52
65
|
});
|
|
53
66
|
export {
|
|
54
|
-
apiGet
|
|
67
|
+
apiGet,
|
|
68
|
+
getSigner
|
|
55
69
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hanbiro-react16-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.34",
|
|
4
4
|
"description": "React 16.2.0 compatible UI components for Hanbiro",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"main": "./dist/hanbiro-react16-sdk.umd.js",
|
|
@@ -75,7 +75,8 @@
|
|
|
75
75
|
"sass-embedded": "^1.98.0",
|
|
76
76
|
"typescript": "^5.5.0",
|
|
77
77
|
"vite": "^5.4.0",
|
|
78
|
-
"vite-plugin-dts": "^3.9.1"
|
|
78
|
+
"vite-plugin-dts": "^3.9.1",
|
|
79
|
+
"@hanbiro/signer-core": "git+ssh://git@git.hanbiro.com:2222/dev/groupware.client-api-sdk.git#main"
|
|
79
80
|
},
|
|
80
81
|
"dependencies": {
|
|
81
82
|
"@tinymce/tinymce-react": "^4.3.0",
|