hylid-bridge 4.0.0-alpha.18 → 4.0.0-alpha.19

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.
@@ -42,8 +42,8 @@ declare const _default: {
42
42
  navigateToBizScene: (args?: any) => void;
43
43
  navigateToMiniProgram: (args: NavigateToMiniProgramArgs) => void;
44
44
  alert: typeof alert;
45
- clearStorage: typeof clearStorage;
46
- clearStorageSync: typeof clearStorageSync;
45
+ clearStorage: (args?: AsyncCallback<any> | undefined) => void;
46
+ clearStorageSync: () => void;
47
47
  confirm: typeof confirm;
48
48
  exitApp: typeof exitApp;
49
49
  getClipboard: typeof getClipboard;
@@ -1,2 +1,2 @@
1
- /// <reference types="miniprogram" />
2
- export default function clearStorage(options?: AsyncCallback): void;
1
+ declare const _default: (args?: AsyncCallback<any> | undefined) => void;
2
+ export default _default;
@@ -1,4 +1,13 @@
1
- import { clearStorage as baseClearStorage } from 'miniapp-web-jsapi/lib/web/jsapi/storage';
2
- export default function clearStorage(options) {
3
- return baseClearStorage(options);
4
- }
1
+ export default (function (opt) {
2
+ var _a = opt || {},
3
+ success = _a.success,
4
+ fail = _a.fail,
5
+ complete = _a.complete;
6
+ try {
7
+ localStorage.clear();
8
+ success === null || success === void 0 ? void 0 : success(undefined);
9
+ } catch (e) {
10
+ fail === null || fail === void 0 ? void 0 : fail(e);
11
+ }
12
+ complete === null || complete === void 0 ? void 0 : complete();
13
+ });
@@ -1 +1,2 @@
1
- export default function clearStorageSync(): void;
1
+ declare const _default: () => void;
2
+ export default _default;
@@ -1,4 +1,3 @@
1
- import { clearStorageSync as baseClearStorageSync } from 'miniapp-web-jsapi/lib/web/jsapi/storage';
2
- export default function clearStorageSync() {
3
- return baseClearStorageSync();
4
- }
1
+ export default (function () {
2
+ localStorage.clear();
3
+ });
@@ -156,11 +156,11 @@ export var implRpcWithAuth = function implRpcWithAuth(siteName, getStorage, setS
156
156
  };
157
157
  var rpcWithAuthMiniRequest = implAsyncBridge(function (args, resolve, reject) {
158
158
  return __awaiter(void 0, void 0, void 0, function () {
159
- var oldHeader, otherArgs, httpRequest, error_1, signData, headers;
159
+ var oldHeader, workspaceId, otherArgs, httpRequest, error_1, signData, headers;
160
160
  return __generator(this, function (_a) {
161
161
  switch (_a.label) {
162
162
  case 0:
163
- oldHeader = args.headers, otherArgs = __rest(args, ["headers"]);
163
+ oldHeader = args.headers, workspaceId = args.workspaceId, otherArgs = __rest(args, ["headers", "workspaceId"]);
164
164
  // 强制把 requestData 设置为 string 类型,确保加签JSON序列化的格式一致
165
165
  if (typeof otherArgs.requestData !== 'string') {
166
166
  otherArgs.requestData = JSON.stringify(otherArgs.requestData);
@@ -168,10 +168,12 @@ export var implRpcWithAuth = function implRpcWithAuth(siteName, getStorage, setS
168
168
  httpRequest = function httpRequest(_a) {
169
169
  var httpRequestHeaders = _a.headers,
170
170
  operationType = _a.operationType,
171
- requestData = _a.requestData;
171
+ requestData = _a.requestData,
172
+ workspaceId = _a.workspaceId;
172
173
  return new Promise(function (httpRequestResolve, httpRequestReject) {
173
174
  nonLoginRpc(__assign(__assign({}, otherArgs), {
174
175
  requestData: requestData,
176
+ workspaceId: workspaceId,
175
177
  headers: __assign(__assign(__assign({}, oldHeader), httpRequestHeaders), {
176
178
  'Operation-Type': operationType
177
179
  }),
@@ -209,6 +211,7 @@ export var implRpcWithAuth = function implRpcWithAuth(siteName, getStorage, setS
209
211
  headers = __assign(__assign({}, oldHeader), signData);
210
212
  nonLoginRpc(__assign(__assign({}, otherArgs), {
211
213
  headers: headers,
214
+ workspaceId: workspaceId,
212
215
  success: function success(response) {
213
216
  var _a, _b;
214
217
  var resultStatus = (_b = (_a = response.headers) === null || _a === void 0 ? void 0 : _a['result-status']) === null || _b === void 0 ? void 0 : _b.toString();