@pc-nexus/bridge 0.5.0-next.27 → 0.5.0-next.28

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.
@@ -66,21 +66,21 @@ if (typeof window !== "undefined") {
66
66
 
67
67
  function validateOpenOptions(options) {
68
68
  if (typeof options !== "object" || options === null) {
69
- throw new BridgeAPIError('"options" must be an object in dialog open.');
69
+ throw new BridgeAPIError('Parameter "options" must be an object in "dialog.open".');
70
70
  }
71
71
  if (!options.resource) {
72
- throw new BridgeAPIError('"resource" is required in dialog open options.');
72
+ throw new BridgeAPIError('Parameter "resource" is required in "dialog.open" options.');
73
73
  }
74
74
  }
75
75
  function validateConfirmOptions(options) {
76
76
  if (typeof options !== "object" || options === null) {
77
- throw new BridgeAPIError('"options" must be an object in dialog confirm.');
77
+ throw new BridgeAPIError('Parameter "options" must be an object in "dialog.confirm".');
78
78
  }
79
79
  if (!options.content) {
80
- throw new BridgeAPIError('"content" is required in dialog confirm options.');
80
+ throw new BridgeAPIError('Parameter "content" is required in "dialog.confirm" options.');
81
81
  }
82
82
  if (typeof options.onConfirm !== "function") {
83
- throw new BridgeAPIError('"onConfirm" must be a function in dialog confirm options.');
83
+ throw new BridgeAPIError('Parameter "onConfirm" must be a function in "dialog.confirm" options.');
84
84
  }
85
85
  }
86
86
  class NexusDialog {
@@ -100,12 +100,12 @@ function validatePayload(payload) {
100
100
  return;
101
101
  }
102
102
  if (Object.values(payload).some((value) => typeof value === "function")) {
103
- throw new BridgeAPIError("Passing functions as part of the payload in invoke is not supported.");
103
+ throw new BridgeAPIError('Parameter "payload" must not include functions in "invoke".');
104
104
  }
105
105
  }
106
106
  async function invoke(functionKey, payload) {
107
107
  if (typeof functionKey !== "string") {
108
- throw new BridgeAPIError('"functionKey" must be a string in invoke.');
108
+ throw new BridgeAPIError('Parameter "functionKey" must be a string in "invoke".');
109
109
  }
110
110
  validatePayload(payload);
111
111
  const params = {
@@ -117,16 +117,21 @@ async function invoke(functionKey, payload) {
117
117
  return result;
118
118
  }
119
119
 
120
+ function validateNavigationLocation(location, apiName) {
121
+ if (!location?.target) {
122
+ throw new BridgeAPIError(`Parameter "target" is required in "${apiName}" location.`);
123
+ }
124
+ if (!location?.id) {
125
+ throw new BridgeAPIError(`Parameter "id" is required in "${apiName}" location.`);
126
+ }
127
+ }
120
128
  class NexusRouter {
121
129
  async navigate(urlOrLocation) {
122
130
  if (typeof urlOrLocation === "string") {
123
131
  await NexusBridge.call("routerNavigate", { urlOrLocation });
124
132
  }
125
133
  else {
126
- if (!urlOrLocation.target) {
127
- const errorMessage = '"target" is required in router navigate.';
128
- throw new BridgeAPIError(errorMessage);
129
- }
134
+ validateNavigationLocation(urlOrLocation, "router.navigate");
130
135
  await NexusBridge.call("routerNavigate", { urlOrLocation });
131
136
  }
132
137
  }
@@ -135,18 +140,12 @@ class NexusRouter {
135
140
  await NexusBridge.call("routerOpen", { urlOrLocation });
136
141
  }
137
142
  else {
138
- if (!urlOrLocation.target) {
139
- const errorMessage = '"target" is required in router open.';
140
- throw new BridgeAPIError(errorMessage);
141
- }
143
+ validateNavigationLocation(urlOrLocation, "router.open");
142
144
  await NexusBridge.call("routerOpen", { urlOrLocation });
143
145
  }
144
146
  }
145
147
  async generateUrl(location) {
146
- if (!(location === null || location === void 0 ? void 0 : location.target)) {
147
- const errorMessage = '"target" is required in router generateUrl.';
148
- throw new BridgeAPIError(errorMessage);
149
- }
148
+ validateNavigationLocation(location, "router.generateUrl");
150
149
  const urlString = await NexusBridge.call("routerGenerateUrl", { location });
151
150
  return new URL(urlString);
152
151
  }
@@ -162,26 +161,26 @@ class NexusView {
162
161
  }
163
162
  async setWindowTitle(title) {
164
163
  if (!title) {
165
- throw new BridgeAPIError('"title" is required in view setWindowTitle.');
164
+ throw new BridgeAPIError('Parameter "title" is required in "view.setWindowTitle".');
166
165
  }
167
166
  if (typeof title !== "string") {
168
- throw new BridgeAPIError('"title" must be a string in view setWindowTitle.');
167
+ throw new BridgeAPIError('Parameter "title" must be a string in "view.setWindowTitle".');
169
168
  }
170
169
  const success = await NexusBridge.call("setWindowTitle", { title });
171
170
  if (!success) {
172
- throw new BridgeAPIError("setWindowTitle API is not available within this module.");
171
+ throw new BridgeAPIError('API "setWindowTitle" is not available within this module.');
173
172
  }
174
173
  }
175
174
  async refresh() {
176
175
  const success = await NexusBridge.call("viewRefresh");
177
176
  if (success === false) {
178
- throw new BridgeAPIError("this resource's view is not refreshable.");
177
+ throw new BridgeAPIError("This resource's view is not refreshable.");
179
178
  }
180
179
  }
181
180
  async close(payload) {
182
181
  const success = await NexusBridge.call("viewClose", payload);
183
182
  if (!success) {
184
- const errorMessage = "this resource's view is not closable.";
183
+ const errorMessage = "This resource's view is not closable.";
185
184
  throw new BridgeAPIError(errorMessage);
186
185
  }
187
186
  }
@@ -190,12 +189,12 @@ class NexusView {
190
189
  */
191
190
  async onClose(payload) {
192
191
  if (typeof payload !== "function") {
193
- const errorMessage = '"payload" must be a function in view onClose.';
192
+ const errorMessage = 'Parameter "payload" must be a function in "view.onClose".';
194
193
  throw new BridgeAPIError(errorMessage);
195
194
  }
196
195
  const success = await NexusBridge.call("viewOnClose", { payload });
197
196
  if (!success) {
198
- throw new BridgeAPIError("`onClose` failed because this resource's view is not closable.");
197
+ throw new BridgeAPIError("This resource's view is not closable.");
199
198
  }
200
199
  }
201
200
  async isDialog() {
@@ -204,7 +203,7 @@ class NexusView {
204
203
  async createHistory() {
205
204
  const history = await NexusBridge.call("createHistory");
206
205
  if (!history) {
207
- throw new BridgeAPIError("createHistory API is not available within this module.");
206
+ throw new BridgeAPIError('API "createHistory" is not available within this module.');
208
207
  }
209
208
  await history.listen((update) => {
210
209
  history.action = update.action;
@@ -215,7 +214,7 @@ class NexusView {
215
214
  async submit(payload) {
216
215
  const result = await NexusBridge.call("viewSubmit", payload);
217
216
  if (!result) {
218
- throw new BridgeAPIError("this resource's view is not submittable.");
217
+ throw new BridgeAPIError("This resource's view is not submittable.");
219
218
  }
220
219
  return result;
221
220
  }
@@ -334,24 +333,24 @@ const containsSerialisedBlobs = (payload) => {
334
333
 
335
334
  function validateOnPayload(eventName, callback) {
336
335
  if (!eventName) {
337
- throw new BridgeAPIError('"eventName" is required in events on.');
336
+ throw new BridgeAPIError('Parameter "eventName" is required in "events.on".');
338
337
  }
339
338
  if (typeof eventName !== "string") {
340
- throw new BridgeAPIError('"eventName" must be a string in events on.');
339
+ throw new BridgeAPIError('Parameter "eventName" must be a string in "events.on".');
341
340
  }
342
341
  if (!callback) {
343
- throw new BridgeAPIError('"callback" is required in events on.');
342
+ throw new BridgeAPIError('Parameter "callback" is required in "events.on".');
344
343
  }
345
344
  if (typeof callback !== "function") {
346
- throw new BridgeAPIError('"callback" must be a function in events on.');
345
+ throw new BridgeAPIError('Parameter "callback" must be a function in "events.on".');
347
346
  }
348
347
  }
349
348
  function validateEmitPayload(eventName) {
350
349
  if (!eventName) {
351
- throw new BridgeAPIError('"eventName" is required in events emit.');
350
+ throw new BridgeAPIError('Parameter "eventName" is required in "events.emit".');
352
351
  }
353
352
  if (typeof eventName !== "string") {
354
- throw new BridgeAPIError('"eventName" must be a string in events emit.');
353
+ throw new BridgeAPIError('Parameter "eventName" must be a string in "events.emit".');
355
354
  }
356
355
  }
357
356
  async function on(eventName, callback) {
@@ -387,7 +386,7 @@ class NexusI18n {
387
386
  }
388
387
  else {
389
388
  if (!SUPPORTED_LOCALE_CODES.includes(locale)) {
390
- throw new BridgeAPIError(`"locale" must be a valid locale code, supported codes: ${SUPPORTED_LOCALE_CODES.join(", ")}.`);
389
+ throw new BridgeAPIError(`Parameter "locale" must be a valid locale code, supported codes: ${SUPPORTED_LOCALE_CODES.join(", ")} in "i18n.getTranslations".`);
391
390
  }
392
391
  }
393
392
  const translations = await this.loadTranslations(locale);
@@ -399,7 +398,7 @@ class NexusI18n {
399
398
  }
400
399
  else {
401
400
  if (!SUPPORTED_LOCALE_CODES.includes(locale)) {
402
- throw new BridgeAPIError(`"locale" must be a valid locale code, supported codes: ${SUPPORTED_LOCALE_CODES.join(", ")}.`);
401
+ throw new BridgeAPIError(`Parameter "locale" must be a valid locale code, supported codes: ${SUPPORTED_LOCALE_CODES.join(", ")} in "i18n.createTranslator".`);
403
402
  }
404
403
  }
405
404
  const translations = await this.loadTranslations(locale);
@@ -424,7 +423,7 @@ class NexusI18n {
424
423
  throw error;
425
424
  }
426
425
  else {
427
- throw new BridgeAPIError(`Failed to load translations for locale ${locale}, cause: ${error}`);
426
+ throw new BridgeAPIError(`Failed to load translations for locale ${locale}. ${error}`);
428
427
  }
429
428
  });
430
429
  }
@@ -435,7 +434,7 @@ class NexusI18n {
435
434
  }
436
435
  translate(key, translations, params) {
437
436
  if (!key) {
438
- throw new BridgeAPIError('"key" is required in i18n translate.');
437
+ throw new BridgeAPIError('Parameter "key" is required in "i18n.translate".');
439
438
  }
440
439
  // 获取值(扁平或嵌套)
441
440
  let value = translations[key] ?? this.getValue(translations, key);
@@ -553,7 +552,7 @@ async function callInvokeBridge(handlerName, payload) {
553
552
  class NexusRestApi {
554
553
  async invoke(path, options) {
555
554
  if (typeof path !== "string") {
556
- throw new BridgeAPIError('"path" must be a string in api.invoke.');
555
+ throw new BridgeAPIError('Parameter "path" must be a string in "api.invoke".');
557
556
  }
558
557
  const validatedOptions = validateFetchOptions(options);
559
558
  return callInvokeBridge("apiInvoke", { path, ...validatedOptions });
@@ -617,20 +616,20 @@ function uploadFile(url, file, key) {
617
616
  class NexusObjectStore {
618
617
  async upload(functionKey, objects) {
619
618
  if (!functionKey || functionKey.length === 0) {
620
- throw new BridgeAPIError('"functionKey" is required in store upload.');
619
+ throw new BridgeAPIError('Parameter "functionKey" is required in "store.upload".');
621
620
  }
622
621
  if (!Array.isArray(objects) || objects.length === 0) {
623
- throw new BridgeAPIError('"objects" is required and cannot be empty in store upload.');
622
+ throw new BridgeAPIError('Parameter "objects" is required and cannot be empty in "store.upload".');
624
623
  }
625
624
  const files = objects.map((obj, index) => {
626
625
  if (obj instanceof File || obj instanceof Blob)
627
626
  return obj;
628
- throw new BridgeAPIError(`Invalid object type at index ${index}. Only Blob/File objects are accepted.`);
627
+ throw new BridgeAPIError(`Parameter "objects" at index ${index} must be a Blob or File in "store.upload".`);
629
628
  });
630
629
  const allObjectMetadata = await Promise.all(files.map((file) => buildObjectMetadata(file)));
631
630
  const presignedURLsToObjectMetadata = await invoke(functionKey, allObjectMetadata);
632
631
  if (!presignedURLsToObjectMetadata || typeof presignedURLsToObjectMetadata !== "object") {
633
- throw new BridgeAPIError("Invalid response from functionKey");
632
+ throw new BridgeAPIError('Failed to get a valid response from "invoke".');
634
633
  }
635
634
  const checksumMap = buildChecksumToFileMap(files, allObjectMetadata);
636
635
  const uploadPromises = Object.entries(presignedURLsToObjectMetadata).map(([presignedUrl, { key, checksum }]) => {
@@ -658,14 +657,14 @@ class NexusObjectStore {
658
657
  }
659
658
  async download(functionKey, keys) {
660
659
  if (!functionKey || functionKey.length === 0) {
661
- throw new BridgeAPIError('"functionKey" is required in store download.');
660
+ throw new BridgeAPIError('Parameter "functionKey" is required in "store.download".');
662
661
  }
663
662
  if (!Array.isArray(keys) || keys.length === 0) {
664
- throw new BridgeAPIError('"keys" is required and cannot be empty in store download.');
663
+ throw new BridgeAPIError('Parameter "keys" is required and cannot be empty in "store.download".');
665
664
  }
666
665
  const downloadUrlsTokeys = await invoke(functionKey, keys);
667
666
  if (!downloadUrlsTokeys || typeof downloadUrlsTokeys !== "object") {
668
- throw new BridgeAPIError("Invalid response from functionKey");
667
+ throw new BridgeAPIError('Failed to get a valid response from "invoke".');
669
668
  }
670
669
  const downloadPromises = Object.entries(downloadUrlsTokeys).map(async ([downloadUrl, key]) => {
671
670
  try {
@@ -704,17 +703,17 @@ class NexusObjectStore {
704
703
  }
705
704
  async getMetadata(functionKey, keys) {
706
705
  if (!functionKey || functionKey.length === 0) {
707
- throw new BridgeAPIError('"functionKey" is required in store getMetadata.');
706
+ throw new BridgeAPIError('Parameter "functionKey" is required in "store.getMetadata".');
708
707
  }
709
708
  if (!Array.isArray(keys) || keys.length === 0) {
710
- throw new BridgeAPIError('"keys" is required and cannot be empty in store getMetadata.');
709
+ throw new BridgeAPIError('Parameter "keys" is required and cannot be empty in "store.getMetadata".');
711
710
  }
712
711
  const results = await Promise.all(keys.map(async (key) => {
713
712
  const result = await invoke(functionKey, key);
714
713
  if (!result || typeof result !== "object") {
715
714
  return {
716
715
  key,
717
- error: "Invalid response from functionKey",
716
+ error: 'Failed to get a valid response from "invoke".',
718
717
  };
719
718
  }
720
719
  return result;
@@ -723,10 +722,10 @@ class NexusObjectStore {
723
722
  }
724
723
  async delete(functionKey, keys) {
725
724
  if (!functionKey || functionKey.length === 0) {
726
- throw new BridgeAPIError('"functionKey" is required in store delete.');
725
+ throw new BridgeAPIError('Parameter "functionKey" is required in "store.delete".');
727
726
  }
728
727
  if (!Array.isArray(keys) || keys.length === 0) {
729
- throw new BridgeAPIError('"keys" is required and cannot be empty in store delete.');
728
+ throw new BridgeAPIError('Parameter "keys" is required and cannot be empty in "store.delete".');
730
729
  }
731
730
  await Promise.all(keys.map(async (key) => {
732
731
  await invoke(functionKey, key);
@@ -810,10 +809,10 @@ function sha256(buffer) {
810
809
  class NexusRemote {
811
810
  async invoke(options) {
812
811
  if (!options || typeof options !== "object") {
813
- throw new BridgeAPIError('"options" must be an object in remote invoke.');
812
+ throw new BridgeAPIError('Parameter "options" must be an object in "remote.invoke".');
814
813
  }
815
814
  if (typeof options.path !== "string" || options.path.trim().length === 0) {
816
- throw new BridgeAPIError('"path" is required and cannot be empty in remote invoke options.');
815
+ throw new BridgeAPIError('Parameter "path" is required and cannot be empty in "remote.invoke" options.');
817
816
  }
818
817
  const payload = await buildPayloadByRequestInit(options);
819
818
  const { status, headers, body } = await NexusBridge.call("remoteInvoke", payload);
@@ -821,10 +820,10 @@ class NexusRemote {
821
820
  }
822
821
  async request(remoteKey, options) {
823
822
  if (typeof remoteKey !== "string" || remoteKey.trim().length === 0) {
824
- throw new BridgeAPIError('"remoteKey" is required and cannot be empty in remote request.');
823
+ throw new BridgeAPIError('Parameter "remoteKey" is required and cannot be empty in "remote.request".');
825
824
  }
826
825
  if (options !== undefined && (!options || typeof options !== "object")) {
827
- throw new BridgeAPIError('"options" must be an object in remote request.');
826
+ throw new BridgeAPIError('Parameter "options" must be an object in "remote.request".');
828
827
  }
829
828
  const requestOptions = {
830
829
  path: "",
@@ -832,7 +831,7 @@ class NexusRemote {
832
831
  };
833
832
  const { path } = requestOptions;
834
833
  if (options !== undefined && (typeof path !== "string" || path.trim().length === 0)) {
835
- throw new BridgeAPIError('"path" is required and cannot be empty in remote request options.');
834
+ throw new BridgeAPIError('Parameter "path" is required and cannot be empty in "remote.request" options.');
836
835
  }
837
836
  const payload = await buildRemoteRequestPayload(remoteKey, requestOptions);
838
837
  const response = await NexusBridge.call("remoteRequest", payload);
@@ -1 +1 @@
1
- {"version":3,"file":"pc-nexus-bridge.mjs","sources":["../../../../web/bridge/src/window.ts","../../../../web/bridge/src/bridge.ts","../../../../web/bridge/src/error.ts","../../../../web/bridge/src/dialog.ts","../../../../web/bridge/src/invoke.ts","../../../../web/bridge/src/router.ts","../../../../web/bridge/src/view.ts","../../../../web/bridge/src/utils/blob-parser.ts","../../../../web/bridge/src/events.ts","../../../../web/bridge/src/i18n.ts","../../../../web/bridge/src/utils/request.ts","../../../../web/bridge/src/api.ts","../../../../web/bridge/src/store.ts","../../../../web/bridge/src/remote.ts","../../../../web/bridge/src/pc-nexus-bridge.ts"],"sourcesContent":["export type SafeAny = any;\n\nexport function attachObjectToWindow<T>(key: string, value: T) {\n (window as SafeAny)[key] = value;\n}\n\nexport function getObjectFromWindow<T>(key: string) {\n return (window as SafeAny)[key];\n}\n","import { getObjectFromWindow } from \"./window\";\n\ninterface HostMessageEvent<T = unknown> {\n source: Window | null;\n origin: string;\n data: T;\n}\n\ninterface Cancelable {\n cancel: () => void;\n}\n\ninterface GlobalBridge {\n call<T>(name: string, payload?: object | undefined): Promise<T>;\n on<T>(name: string, handler: (event: HostMessageEvent<T>) => void): Cancelable;\n}\n\nfunction getBridge() {\n const bridge = getObjectFromWindow<GlobalBridge>(\"__pc_nexus_bridge__\");\n return bridge;\n}\n\nexport class NexusBridge {\n static getBridgeCall<T>(): (name: string, payload?: object) => Promise<T> {\n if (!getBridge()) {\n throw new Error(`\n Unable to establish a connection with the PingCode nexus bridge.\n If you are trying to run your app locally, Nexus apps only work in the context of PingCode products. Refer to https://developer.pingcode.com for how to tunnel when using a local development server.\n `);\n }\n return getBridge().call;\n }\n\n static async call<T>(name: string, payload?: any): Promise<T> {\n const result = await NexusBridge.getBridgeCall<T>()(name, payload);\n return result as T;\n }\n\n /**\n * 订阅宿主 host 发来的消息。\n * @param name 消息名称\n * @param handler 收到消息时的回调,event 包含 source、origin、data\n * @returns 返回带 cancel() 的对象,调用可取消订阅\n */\n static on<T>(name: string, handler: (event: HostMessageEvent<T>) => void): Cancelable {\n const bridge = getBridge();\n if (!bridge) {\n throw new Error(`\n Unable to establish a connection with the PingCode nexus bridge.\n If you are trying to run your app locally, Nexus apps only work in the context of PingCode products. Refer to https://developer.pingcode.com for how to tunnel when using a local development server.\n `);\n }\n return bridge.on(name, handler);\n }\n}\n","export class BridgeAPIError extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"BridgeAPIError\";\n Object.setPrototypeOf(this, BridgeAPIError.prototype);\n }\n}\n\n// 自动注册:所有未 catch 的 Promise rejection 均以 \"Uncaught (in promise)\" 格式输出,无需用户配置\nif (typeof window !== \"undefined\") {\n window.addEventListener(\n \"unhandledrejection\",\n (event: PromiseRejectionEvent) => {\n const reason = event.reason;\n const error = reason instanceof Error ? reason : new Error(String(reason));\n const firstLine = `Uncaught (in promise) ${error.name}: ${error.message}`;\n const stack = error.stack?.replace(/^[^\\n]*\\n?/, \"\").trim() || \"\";\n console.error(stack ? `${firstLine}\\n${stack}` : firstLine);\n event.preventDefault();\n event.stopImmediatePropagation();\n },\n true,\n );\n}\n","import { NexusBridge } from \"./bridge\";\nimport { BridgeAPIError } from \"./error\";\nimport { DialogConfirmOptions, DialogOpenOptions, DialogRef } from \"./models\";\n\nfunction validateOpenOptions(options: DialogOpenOptions) {\n if (typeof options !== \"object\" || options === null) {\n throw new BridgeAPIError('\"options\" must be an object in dialog open.');\n }\n if (!options.resource) {\n throw new BridgeAPIError('\"resource\" is required in dialog open options.');\n }\n}\n\nfunction validateConfirmOptions(options: DialogConfirmOptions) {\n if (typeof options !== \"object\" || options === null) {\n throw new BridgeAPIError('\"options\" must be an object in dialog confirm.');\n }\n if (!options.content) {\n throw new BridgeAPIError('\"content\" is required in dialog confirm options.');\n }\n if (typeof options.onConfirm !== \"function\") {\n throw new BridgeAPIError('\"onConfirm\" must be a function in dialog confirm options.');\n }\n}\n\nclass NexusDialog {\n async open<T>(options: DialogOpenOptions): Promise<DialogRef<T>> {\n validateOpenOptions(options);\n return await NexusBridge.call<DialogRef<T>>(\"openDialog\", options);\n }\n\n async confirm<T>(options: DialogConfirmOptions): Promise<void> {\n validateConfirmOptions(options);\n return await NexusBridge.call<void>(\"confirm\", options);\n }\n}\n\nexport const dialog = new NexusDialog();\n","import { NexusBridge } from \"./bridge\";\nimport { BridgeAPIError } from \"./error\";\nimport { InvokeFunctionParams } from \"./models\";\nimport { getObjectFromWindow } from \"./window\";\n\nfunction validatePayload<TPayload>(payload?: TPayload) {\n if (!payload) {\n return;\n }\n if (Object.values(payload).some((value) => typeof value === \"function\")) {\n throw new BridgeAPIError(\"Passing functions as part of the payload in invoke is not supported.\");\n }\n}\n\nexport async function invoke<TPayload = any, TResult = any>(functionKey: string, payload?: TPayload): Promise<TResult> {\n if (typeof functionKey !== \"string\") {\n throw new BridgeAPIError('\"functionKey\" must be a string in invoke.');\n }\n validatePayload(payload);\n\n const params: InvokeFunctionParams = {\n function: functionKey,\n payload: payload,\n tunnel_token: getObjectFromWindow(\"__TUNNEL_TOKEN__\"),\n } as InvokeFunctionParams;\n const result = await NexusBridge.call(\"invokeFunction\", params);\n return result as TResult;\n}\n","import { NexusBridge } from \"./bridge\";\nimport { BridgeAPIError } from \"./error\";\nimport { NavigationLocation } from \"./models\";\n\nclass NexusRouter {\n async navigate(urlOrLocation: string | NavigationLocation): Promise<void> {\n if (typeof urlOrLocation === \"string\") {\n await NexusBridge.call<void>(\"routerNavigate\", { urlOrLocation });\n } else {\n if (!urlOrLocation.target) {\n const errorMessage = '\"target\" is required in router navigate.';\n throw new BridgeAPIError(errorMessage);\n }\n await NexusBridge.call<void>(\"routerNavigate\", { urlOrLocation });\n }\n }\n\n async open(urlOrLocation: string | NavigationLocation): Promise<void> {\n if (typeof urlOrLocation === \"string\") {\n await NexusBridge.call<void>(\"routerOpen\", { urlOrLocation });\n } else {\n if (!urlOrLocation.target) {\n const errorMessage = '\"target\" is required in router open.';\n throw new BridgeAPIError(errorMessage);\n }\n await NexusBridge.call<void>(\"routerOpen\", { urlOrLocation });\n }\n }\n\n async generateUrl(location: NavigationLocation): Promise<URL> {\n if (!(location === null || location === void 0 ? void 0 : location.target)) {\n const errorMessage = '\"target\" is required in router generateUrl.';\n throw new BridgeAPIError(errorMessage);\n }\n const urlString = await NexusBridge.call<string>(\"routerGenerateUrl\", { location });\n return new URL(urlString);\n }\n\n async reload(): Promise<void> {\n await NexusBridge.call<void>(\"routerReload\", {});\n }\n}\n\nexport const router = new NexusRouter();\n","import { NexusBridge } from \"./bridge\";\nimport { BridgeAPIError } from \"./error\";\nimport { ExtensionData, NexusAppContext, NexusHistory, HistoryUpdate } from \"./models\";\n\nclass NexusView {\n async getContext<T = ExtensionData>(): Promise<NexusAppContext<T>> {\n return await NexusBridge.call(\"getContext\");\n }\n\n async setWindowTitle(title: string): Promise<void> {\n if (!title) {\n throw new BridgeAPIError('\"title\" is required in view setWindowTitle.');\n }\n if (typeof title !== \"string\") {\n throw new BridgeAPIError('\"title\" must be a string in view setWindowTitle.');\n }\n\n const success = await NexusBridge.call<boolean>(\"setWindowTitle\", { title });\n if (!success) {\n throw new BridgeAPIError(\"setWindowTitle API is not available within this module.\");\n }\n }\n\n async refresh(): Promise<void> {\n const success = await NexusBridge.call<boolean>(\"viewRefresh\");\n if (success === false) {\n throw new BridgeAPIError(\"this resource's view is not refreshable.\");\n }\n }\n\n async close(payload?: unknown): Promise<void> {\n const success = await NexusBridge.call<boolean>(\"viewClose\", payload);\n if (!success) {\n const errorMessage = \"this resource's view is not closable.\";\n throw new BridgeAPIError(errorMessage);\n }\n }\n\n /**\n * 非弹窗场景调用无效。\n */\n async onClose(payload: () => Promise<void>): Promise<void> {\n if (typeof payload !== \"function\") {\n const errorMessage = '\"payload\" must be a function in view onClose.';\n throw new BridgeAPIError(errorMessage);\n }\n const success = await NexusBridge.call<boolean>(\"viewOnClose\", { payload });\n if (!success) {\n throw new BridgeAPIError(\"`onClose` failed because this resource's view is not closable.\");\n }\n }\n\n async isDialog(): Promise<boolean> {\n return await NexusBridge.call<boolean>(\"viewIsDialog\");\n }\n\n async createHistory(): Promise<NexusHistory> {\n const history = await NexusBridge.call<NexusHistory>(\"createHistory\");\n if (!history) {\n throw new BridgeAPIError(\"createHistory API is not available within this module.\");\n }\n await history.listen((update: HistoryUpdate) => {\n history.action = update.action;\n history.location = update.location;\n });\n return history;\n }\n\n async submit<T = any>(payload?: T): Promise<boolean> {\n const result = await NexusBridge.call<boolean>(\"viewSubmit\", payload);\n if (!result) {\n throw new BridgeAPIError(\"this resource's view is not submittable.\");\n }\n return result;\n }\n}\n\nexport const view = new NexusView();\n","const isPlainObject = (value: any) => {\n if (typeof value !== \"object\" || value === null) {\n return false;\n }\n if (Object.prototype.toString.call(value) !== \"[object Object]\") {\n return false;\n }\n const proto = Object.getPrototypeOf(value);\n if (proto === null) {\n return true;\n }\n const constructor = Object.prototype.hasOwnProperty.call(proto, \"constructor\") && proto.constructor;\n return (\n typeof constructor === \"function\" &&\n constructor instanceof constructor &&\n Function.prototype.call(constructor) === Function.prototype.call(value)\n );\n};\n\nexport const base64ToBlob = (b64string: string, mimeType: string) => {\n if (!b64string) {\n return null;\n }\n const base64String = b64string.includes(\",\") ? b64string.split(\",\")[1] : b64string;\n const byteCharacters = atob(base64String);\n const byteNumbers = new Array(byteCharacters.length);\n for (let i = 0; i < byteCharacters.length; i++) {\n byteNumbers[i] = byteCharacters.charCodeAt(i);\n }\n\n const byteArray = new Uint8Array(byteNumbers);\n return new Blob([byteArray], { type: mimeType });\n};\n\nexport const blobToBase64 = (blob: Blob): Promise<string> => {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onloadend = () => {\n resolve(reader.result as string);\n };\n reader.onerror = reject;\n reader.readAsDataURL(blob);\n });\n};\n\nexport const blobToArrayBuffer = (blob: Blob): Promise<ArrayBuffer> => {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onloadend = () => {\n resolve(reader.result as ArrayBuffer);\n };\n reader.onerror = reject;\n reader.readAsArrayBuffer(blob);\n });\n};\n\nexport const serialiseBlobsInPayload = async (payload: any): Promise<any> => {\n if (payload instanceof Blob) {\n const base64Data = await blobToBase64(payload);\n return {\n data: base64Data,\n type: payload.type,\n name: payload instanceof File ? payload.name : undefined,\n __isBlobData: true,\n };\n }\n if (Array.isArray(payload)) {\n return Promise.all(payload.map((item) => serialiseBlobsInPayload(item)));\n }\n if (payload && isPlainObject(payload)) {\n const entries = await Promise.all(Object.entries(payload).map(async ([key, value]) => [key, await serialiseBlobsInPayload(value)]));\n return Object.fromEntries(entries);\n }\n return payload;\n};\n\nexport const deserialiseBlobsInPayload = (payload: any): any => {\n if (payload && isPlainObject(payload) && \"__isBlobData\" in payload) {\n const typedData = payload;\n return base64ToBlob(typedData.data, typedData.type);\n }\n if (Array.isArray(payload)) {\n return payload.map((item) => deserialiseBlobsInPayload(item));\n }\n if (payload && isPlainObject(payload)) {\n const result = {};\n for (const [key, value] of Object.entries(payload)) {\n (result as any)[key] = deserialiseBlobsInPayload(value);\n }\n return result;\n }\n return payload;\n};\n\nexport const containsBlobs = (payload: any): boolean => {\n if (payload instanceof Blob) {\n return true;\n }\n if (Array.isArray(payload)) {\n return payload.some((item) => containsBlobs(item));\n }\n if (payload && isPlainObject(payload)) {\n return Object.values(payload).some((value) => containsBlobs(value));\n }\n return false;\n};\n\nexport const containsSerialisedBlobs = (payload: any): boolean => {\n if (payload && isPlainObject(payload) && \"__isBlobData\" in payload) {\n return true;\n }\n if (Array.isArray(payload)) {\n return payload.some((item) => containsSerialisedBlobs(item));\n }\n if (payload && isPlainObject(payload)) {\n return Object.values(payload).some((value) => containsSerialisedBlobs(value));\n }\n return false;\n};\n","import { NexusBridge } from \"./bridge\";\nimport { BridgeAPIError } from \"./error\";\nimport { Subscription } from \"./models\";\nimport { containsBlobs, serialiseBlobsInPayload, containsSerialisedBlobs, deserialiseBlobsInPayload } from \"./utils\";\n\nfunction validateOnPayload<T>(eventName: string, callback: (payload?: T) => any) {\n if (!eventName) {\n throw new BridgeAPIError('\"eventName\" is required in events on.');\n }\n if (typeof eventName !== \"string\") {\n throw new BridgeAPIError('\"eventName\" must be a string in events on.');\n }\n if (!callback) {\n throw new BridgeAPIError('\"callback\" is required in events on.');\n }\n if (typeof callback !== \"function\") {\n throw new BridgeAPIError('\"callback\" must be a function in events on.');\n }\n}\n\nfunction validateEmitPayload<T>(eventName: string) {\n if (!eventName) {\n throw new BridgeAPIError('\"eventName\" is required in events emit.');\n }\n if (typeof eventName !== \"string\") {\n throw new BridgeAPIError('\"eventName\" must be a string in events emit.');\n }\n}\n\nasync function on<T = any>(eventName: string, callback: (payload?: T) => any): Promise<Subscription> {\n validateOnPayload<T>(eventName, callback);\n\n const wrappedCallback = (payload: T) => {\n let newPayload = payload;\n if (containsSerialisedBlobs(payload)) {\n newPayload = deserialiseBlobsInPayload(payload);\n }\n return callback(newPayload);\n };\n return NexusBridge.call(\"on\", { eventName, callback: wrappedCallback });\n}\n\nasync function emit<T = any>(eventName: string, payload?: T): Promise<void> {\n validateEmitPayload<T>(eventName);\n\n let newPayload = payload;\n if (containsBlobs(payload)) {\n newPayload = await serialiseBlobsInPayload(payload);\n }\n return NexusBridge.call(\"emit\", { eventName, payload: newPayload });\n}\n\nexport const events = {\n on,\n emit,\n};\n","import { Translator, GetTranslationsResult, SupportedLocaleCode, TranslationsResourceContent, SUPPORTED_LOCALE_CODES } from \"./models\";\nimport { view } from \"./view\";\nimport { BridgeAPIError } from \"./error\";\n\nclass NexusI18n {\n private translationsCache: Partial<Record<SupportedLocaleCode, Promise<TranslationsResourceContent>>> = {};\n\n private i18nFolderName = \"__LOCALES__\";\n\n async getTranslations(locale?: SupportedLocaleCode): Promise<GetTranslationsResult> {\n if (!locale) {\n locale = (await view.getContext()).user.locale;\n } else {\n if (!SUPPORTED_LOCALE_CODES.includes(locale)) {\n throw new BridgeAPIError(`\"locale\" must be a valid locale code, supported codes: ${SUPPORTED_LOCALE_CODES.join(\", \")}.`);\n }\n }\n const translations = await this.loadTranslations(locale!);\n return { locale: locale!, translations };\n }\n\n async createTranslator(locale?: SupportedLocaleCode): Promise<Translator> {\n if (!locale) {\n locale = (await view.getContext()).user.locale;\n } else {\n if (!SUPPORTED_LOCALE_CODES.includes(locale)) {\n throw new BridgeAPIError(`\"locale\" must be a valid locale code, supported codes: ${SUPPORTED_LOCALE_CODES.join(\", \")}.`);\n }\n }\n const translations = await this.loadTranslations(locale!);\n return {\n translate: (key: string, params: Record<string, any> = {}) => this.translate(key, translations, params),\n };\n }\n\n private loadTranslations(locale: SupportedLocaleCode): Promise<TranslationsResourceContent> {\n const url = `../${this.i18nFolderName}/${locale}.json`;\n if (!this.translationsCache[locale]) {\n this.translationsCache[locale] = fetch(url)\n .then((response) => {\n if (!response.ok) {\n throw new BridgeAPIError(\n `Failed to load translations for locale ${locale}. HTTP ${response.status}: ${response.statusText}`,\n );\n }\n return response.json();\n })\n .catch((error) => {\n // 请求失败要清理缓存\n delete this.translationsCache[locale];\n if (error instanceof BridgeAPIError) {\n throw error;\n } else {\n throw new BridgeAPIError(`Failed to load translations for locale ${locale}, cause: ${error}`);\n }\n });\n }\n\n return this.translationsCache[locale]!;\n }\n\n private getValue(obj: any, path: string): any {\n return path.split(\".\").reduce((o, k) => (o != null && typeof o === \"object\" ? o[k] : undefined), obj);\n }\n\n private translate(\n key: string,\n translations: TranslationsResourceContent,\n params?: Record<string, any>,\n ): TranslationsResourceContent | string {\n if (!key) {\n throw new BridgeAPIError('\"key\" is required in i18n translate.');\n }\n // 获取值(扁平或嵌套)\n let value: any = translations[key] ?? this.getValue(translations, key);\n\n // key 不存在 → 返回 key\n if (value == null) return key;\n\n // 如果 value 是对象 → 直接返回\n if (typeof value === \"object\") return value;\n\n // 确保 value 是字符串\n if (typeof value !== \"string\") value = String(value);\n\n // 无参数 → 直接返回\n if (!params) return value;\n\n // 参数替换\n return value.replace(/\\{\\{\\s*(.*?)\\s*\\}\\}/g, (_: string, k: string) => {\n const paramValue = this.getValue(params, k.trim());\n return paramValue != null ? String(paramValue) : `{{${k}}}`;\n });\n }\n}\n\nexport const i18n = new NexusI18n();\n","import {\n RemoteRequestOptions,\n RemoteRequestPayload,\n RemoteRequestResponseData,\n RemoteSerializedFormDataEntry,\n InvokeResponseData,\n ApiInvokeOptions,\n} from \"../models\";\nimport { base64ToBlob, blobToArrayBuffer, serialiseBlobsInPayload } from \"./blob-parser\";\n\nexport const validateFetchOptions = (init?: ApiInvokeOptions) => {\n if (!init) {\n return init;\n }\n if (\"signal\" in init) {\n const { signal: _signal, ...rest } = init;\n console.error(\"Signal is not supported in @pc-nexus/bridge and was removed from fetch options.\");\n return rest;\n }\n return init;\n};\n\nexport async function buildPayloadByRequestInit<TPayload extends RequestInit = RequestInit>(init?: TPayload) {\n const requestBody = init === null || init === void 0 ? void 0 : init.body;\n const requestMethod = init === null || init === void 0 ? void 0 : init.method;\n const requestHeaders = init === null || init === void 0 ? void 0 : init.headers;\n const req = new Request(\"\", {\n body: requestBody,\n method: requestMethod,\n headers: requestHeaders,\n });\n const headers = Object.fromEntries(req.headers.entries());\n const body = req.method !== \"GET\" ? await req.text() : undefined;\n return {\n ...init,\n body: body,\n headers,\n method: requestMethod ?? \"GET\",\n };\n}\n\nexport async function parseToResponseData(res: InvokeResponseData): Promise<Response> {\n const response = new Response(\n res.body == null ? undefined : typeof res.body === \"object\" ? JSON.stringify(res.body) : (res.body as BodyInit),\n {\n status: res.status,\n headers: new Headers(res.headers),\n },\n );\n\n return response;\n}\n\nasync function parseFormData(formData: FormData): Promise<RemoteSerializedFormDataEntry[]> {\n const entries: RemoteSerializedFormDataEntry[] = [];\n for (const [name, value] of formData.entries()) {\n entries.push({\n name,\n value: typeof value === \"string\" ? value : await serialiseBlobsInPayload(value),\n });\n }\n return entries;\n}\n\nexport async function buildRemoteRequestPayload(remoteKey: string, options: RemoteRequestOptions): Promise<RemoteRequestPayload> {\n const { path = \"\", ...requestOptions } = options;\n const isMultipartFormData = requestOptions.body instanceof FormData;\n const request = new Request(\"\", {\n body: requestOptions.body,\n method: requestOptions.method,\n headers: requestOptions.headers,\n });\n const headers = Object.fromEntries(request.headers.entries());\n let body: RemoteRequestPayload[\"requestInit\"][\"body\"];\n if (isMultipartFormData) {\n body = await parseFormData(requestOptions.body as FormData);\n } else if (request.method !== \"GET\") {\n body = await request.text();\n }\n\n return {\n remoteKey,\n path,\n isMultipartFormData,\n requestInit: {\n ...requestOptions,\n body,\n method: requestOptions.method ?? \"GET\",\n headers,\n },\n };\n}\n\nexport async function parseRemoteResponseData(res: RemoteRequestResponseData): Promise<Response> {\n const headers = new Headers(res.headers);\n const blob = res.isBinaryContent && res.body ? base64ToBlob(res.body, headers.get(\"content-type\") ?? \"\") : undefined;\n const responseBody = blob ? await blobToArrayBuffer(blob) : res.body;\n\n return new Response((responseBody as BodyInit) ?? null, {\n status: res.status,\n statusText: res.statusText,\n headers,\n });\n}\n","import { NexusBridge } from \"./bridge\";\nimport { BridgeAPIError } from \"./error\";\nimport { InvokeResponseData, ApiInvokeOptions } from \"./models\";\nimport { buildPayloadByRequestInit, parseToResponseData, validateFetchOptions } from \"./utils/request\";\n\ninterface InvokeApiParams extends ApiInvokeOptions {\n path: string;\n}\n\nasync function callInvokeBridge<TPayload extends ApiInvokeOptions = ApiInvokeOptions>(\n handlerName: string,\n payload: TPayload,\n): Promise<Response> {\n const postPayload = await buildPayloadByRequestInit<TPayload>(payload);\n const { status, headers, body } = await NexusBridge.call<InvokeResponseData>(handlerName, postPayload);\n return parseToResponseData({ status, headers, body });\n}\n\nclass NexusRestApi {\n async invoke(path: string, options?: ApiInvokeOptions): Promise<Response> {\n if (typeof path !== \"string\") {\n throw new BridgeAPIError('\"path\" must be a string in api.invoke.');\n }\n\n const validatedOptions = validateFetchOptions(options);\n return callInvokeBridge<InvokeApiParams>(\"apiInvoke\", { path, ...validatedOptions });\n }\n}\n\nexport const api = new NexusRestApi();\n","import { BridgeAPIError } from \"./error\";\nimport { invoke } from \"./invoke\";\nimport { UploadResult, DownloadResult, GetMetadataResult } from \"./models\";\n\ntype UploadInput = File | Blob;\n\ninterface GeneratedMetadata {\n size: number;\n checksum: string;\n checksum_type: \"SHA1\" | \"SHA256\" | \"CRC32\" | \"CRC32C\";\n}\n\ninterface FileMetadata extends GeneratedMetadata {\n key: string;\n overwrite?: boolean;\n}\n\ntype PresignedURLMapping = Record<string, FileMetadata>;\n\nasync function buildObjectMetadata(file: UploadInput): Promise<GeneratedMetadata> {\n const size = file.size;\n const arrayBuffer = await file.arrayBuffer();\n let checksum: string;\n const checksum_type = \"SHA256\";\n\n // crypto.subtle 只能在安全上下文(HTTPS 或 localhost)中使用\n // sha256 兼容模拟器非安全上下文\n if (typeof crypto !== \"undefined\" && crypto.subtle) {\n const hashBuffer = await crypto.subtle.digest(\"SHA-256\", arrayBuffer);\n const hashArray = new Uint8Array(hashBuffer);\n checksum = btoa(String.fromCharCode(...hashArray));\n } else {\n const jsHash = await sha256(arrayBuffer);\n checksum = btoa(String.fromCharCode(...new Uint8Array(jsHash)));\n }\n\n return {\n size,\n checksum,\n checksum_type,\n };\n}\n\nfunction buildChecksumToFileMap(files: UploadInput[], metadata: GeneratedMetadata[]) {\n const map = new Map<string, { file: UploadInput; index: number }>();\n\n files.forEach((file, index) => {\n map.set(metadata[index].checksum, {\n file,\n index,\n });\n });\n\n return map;\n}\n\nfunction uploadFile(url: string, file: UploadInput, key: string) {\n const formData = new FormData();\n const fileName = (file as File).name || key;\n formData.append(\"file\", file, fileName);\n\n return fetch(url, {\n method: \"PUT\",\n body: formData,\n })\n .then((response) => ({\n success: response.ok,\n key,\n status: response.status,\n error: response.ok ? undefined : `Upload failed with status ${response.status}`,\n }))\n .catch((error) => ({\n success: false,\n key,\n status: 503,\n error: error instanceof Error ? error.message : \"Upload failed\",\n }));\n}\n\nclass NexusObjectStore {\n async upload(functionKey: string, objects: UploadInput[]): Promise<UploadResult[]> {\n if (!functionKey || functionKey.length === 0) {\n throw new BridgeAPIError('\"functionKey\" is required in store upload.');\n }\n if (!Array.isArray(objects) || objects.length === 0) {\n throw new BridgeAPIError('\"objects\" is required and cannot be empty in store upload.');\n }\n\n const files = objects.map((obj, index) => {\n if (obj instanceof File || obj instanceof Blob) return obj;\n throw new BridgeAPIError(`Invalid object type at index ${index}. Only Blob/File objects are accepted.`);\n });\n\n const allObjectMetadata: GeneratedMetadata[] = await Promise.all(files.map((file) => buildObjectMetadata(file)));\n\n const presignedURLsToObjectMetadata: PresignedURLMapping = await invoke(functionKey, allObjectMetadata);\n\n if (!presignedURLsToObjectMetadata || typeof presignedURLsToObjectMetadata !== \"object\") {\n throw new BridgeAPIError(\"Invalid response from functionKey\");\n }\n\n const checksumMap: Map<string, { file: UploadInput; index: number }> = buildChecksumToFileMap(files, allObjectMetadata);\n\n const uploadPromises = Object.entries(presignedURLsToObjectMetadata).map(([presignedUrl, { key, checksum }]) => {\n const fileInfo = checksumMap.get(checksum);\n\n if (!fileInfo) {\n return {\n promise: Promise.resolve({\n success: false,\n key,\n error: `File not found for checksum ${checksum}`,\n }),\n index: -1,\n };\n }\n\n const { file, index } = fileInfo;\n\n const promise = uploadFile(presignedUrl, file, key);\n\n return {\n promise,\n index,\n objectType: file.type,\n objectSize: file.size,\n };\n });\n\n return await Promise.all(uploadPromises.map((t) => t.promise));\n }\n\n async download(functionKey: string, keys: string[]): Promise<DownloadResult[]> {\n if (!functionKey || functionKey.length === 0) {\n throw new BridgeAPIError('\"functionKey\" is required in store download.');\n }\n if (!Array.isArray(keys) || keys.length === 0) {\n throw new BridgeAPIError('\"keys\" is required and cannot be empty in store download.');\n }\n\n const downloadUrlsTokeys: Record<string, string> = await invoke(functionKey, keys);\n\n if (!downloadUrlsTokeys || typeof downloadUrlsTokeys !== \"object\") {\n throw new BridgeAPIError(\"Invalid response from functionKey\");\n }\n\n const downloadPromises = Object.entries(downloadUrlsTokeys).map(async ([downloadUrl, key]) => {\n try {\n const response = await fetch(downloadUrl, {\n method: \"GET\",\n });\n if (!response.ok) {\n return {\n success: false,\n key: key,\n status: response.status,\n error: `Download failed with status ${response.status}`,\n };\n }\n const blob = await response.blob();\n const disposition = response.headers.get(\"Content-Disposition\") ?? \"\";\n const name = disposition.match(/filename\\*=UTF-8''([^;]+)/)?.[1] ?? disposition.match(/filename=\"?([^\"]+)\"?/)?.[1] ?? \"\";\n\n return {\n success: true,\n key: key,\n blob,\n name,\n status: response.status,\n };\n } catch (error) {\n return {\n success: false,\n key: key,\n status: 503,\n error: error instanceof Error ? error.message : \"Download failed\",\n };\n }\n });\n\n return await Promise.all(downloadPromises);\n }\n\n async getMetadata(functionKey: string, keys: string[]): Promise<GetMetadataResult[]> {\n if (!functionKey || functionKey.length === 0) {\n throw new BridgeAPIError('\"functionKey\" is required in store getMetadata.');\n }\n if (!Array.isArray(keys) || keys.length === 0) {\n throw new BridgeAPIError('\"keys\" is required and cannot be empty in store getMetadata.');\n }\n const results = await Promise.all(\n keys.map(async (key) => {\n const result = await invoke(functionKey, key);\n if (!result || typeof result !== \"object\") {\n return {\n key,\n error: \"Invalid response from functionKey\",\n };\n }\n return result;\n }),\n );\n\n return results;\n }\n\n async delete(functionKey: string, keys: string[]): Promise<void> {\n if (!functionKey || functionKey.length === 0) {\n throw new BridgeAPIError('\"functionKey\" is required in store delete.');\n }\n if (!Array.isArray(keys) || keys.length === 0) {\n throw new BridgeAPIError('\"keys\" is required and cannot be empty in store delete.');\n }\n await Promise.all(\n keys.map(async (key) => {\n await invoke(functionKey, key);\n }),\n );\n }\n}\n\nexport const store = new NexusObjectStore();\n\nexport function sha256(buffer: ArrayBuffer): ArrayBuffer {\n const bytes = new Uint8Array(buffer);\n const len = bytes.length;\n const blockSize = 64;\n const hashSize = 32;\n\n const K = new Uint32Array([\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be,\n 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa,\n 0x5cb0a9dc, 0x76f988da, 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, 0x27b70a85,\n 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3,\n 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f,\n 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2,\n ]);\n\n let h0 = 0x6a09e667,\n h1 = 0xbb67ae85,\n h2 = 0x3c6ef372,\n h3 = 0xa54ff53a;\n let h4 = 0x510e527f,\n h5 = 0x9b05688c,\n h6 = 0x1f83d9ab,\n h7 = 0x5be0cd19;\n\n const totalBits = BigInt(len) * 8n;\n const paddingLen = len % blockSize < 56 ? 56 - (len % blockSize) : 120 - (len % blockSize);\n const paddedLen = len + paddingLen + 8;\n const padded = new Uint8Array(paddedLen);\n padded.set(bytes);\n padded[len] = 0x80;\n\n const view = new DataView(padded.buffer, padded.byteOffset);\n view.setUint32(paddedLen - 4, Number((totalBits >> 32n) & 0xffffffffn));\n view.setUint32(paddedLen - 8, Number(totalBits & 0xffffffffn));\n\n for (let i = 0; i < paddedLen; i += blockSize) {\n const w = new Uint32Array(64);\n for (let j = 0; j < 16; j++) {\n w[j] = view.getUint32(i + j * 4);\n }\n\n for (let j = 16; j < 64; j++) {\n const s0 = ((w[j - 15] >>> 7) | (w[j - 15] << 25)) ^ ((w[j - 15] >>> 18) | (w[j - 15] << 14)) ^ (w[j - 15] >>> 3);\n const s1 = ((w[j - 2] >>> 17) | (w[j - 2] << 15)) ^ ((w[j - 2] >>> 19) | (w[j - 2] << 13)) ^ (w[j - 2] >>> 10);\n w[j] = (w[j - 16] + s0 + w[j - 7] + s1) >>> 0;\n }\n\n let a = h0,\n b = h1,\n c = h2,\n d = h3,\n e = h4,\n f = h5,\n g = h6,\n h = h7;\n\n for (let j = 0; j < 64; j++) {\n const S1 = ((e >>> 6) | (e << 26)) ^ ((e >>> 11) | (e << 21)) ^ ((e >>> 25) | (e << 7));\n const ch = (e & f) ^ (~e & g);\n const temp1 = (h + S1 + ch + K[j] + w[j]) >>> 0;\n const S0 = ((a >>> 2) | (a << 30)) ^ ((a >>> 13) | (a << 19)) ^ ((a >>> 22) | (a << 10));\n const maj = (a & b) ^ (a & c) ^ (b & c);\n const temp2 = (S0 + maj) >>> 0;\n\n h = g;\n g = f;\n f = e;\n e = (d + temp1) >>> 0;\n d = c;\n c = b;\n b = a;\n a = (temp1 + temp2) >>> 0;\n }\n\n h0 = (h0 + a) >>> 0;\n h1 = (h1 + b) >>> 0;\n h2 = (h2 + c) >>> 0;\n h3 = (h3 + d) >>> 0;\n h4 = (h4 + e) >>> 0;\n h5 = (h5 + f) >>> 0;\n h6 = (h6 + g) >>> 0;\n h7 = (h7 + h) >>> 0;\n }\n\n const result = new ArrayBuffer(hashSize);\n const resultView = new DataView(result);\n resultView.setUint32(0, h0);\n resultView.setUint32(4, h1);\n resultView.setUint32(8, h2);\n resultView.setUint32(12, h3);\n resultView.setUint32(16, h4);\n resultView.setUint32(20, h5);\n resultView.setUint32(24, h6);\n resultView.setUint32(28, h7);\n return result;\n}\n","import { NexusBridge } from \"./bridge\";\nimport { BridgeAPIError } from \"./error\";\nimport { InvokeResponseData, RemoteInvokeOptions, RemoteRequestOptions, RemoteRequestResponseData } from \"./models\";\nimport {\n buildPayloadByRequestInit,\n buildRemoteRequestPayload,\n parseRemoteResponseData,\n parseToResponseData,\n validateFetchOptions,\n} from \"./utils/request\";\n\nclass NexusRemote {\n async invoke(options: RemoteInvokeOptions): Promise<Response> {\n if (!options || typeof options !== \"object\") {\n throw new BridgeAPIError('\"options\" must be an object in remote invoke.');\n }\n if (typeof options.path !== \"string\" || options.path.trim().length === 0) {\n throw new BridgeAPIError('\"path\" is required and cannot be empty in remote invoke options.');\n }\n\n const payload = await buildPayloadByRequestInit(options);\n const { status, headers, body } = await NexusBridge.call<InvokeResponseData>(\"remoteInvoke\", payload);\n return parseToResponseData({ status, headers, body });\n }\n\n async request(remoteKey: string, options?: RemoteRequestOptions): Promise<Response> {\n if (typeof remoteKey !== \"string\" || remoteKey.trim().length === 0) {\n throw new BridgeAPIError('\"remoteKey\" is required and cannot be empty in remote request.');\n }\n if (options !== undefined && (!options || typeof options !== \"object\")) {\n throw new BridgeAPIError('\"options\" must be an object in remote request.');\n }\n\n const requestOptions = {\n path: \"\",\n ...validateFetchOptions(options),\n };\n const { path } = requestOptions;\n if (options !== undefined && (typeof path !== \"string\" || path.trim().length === 0)) {\n throw new BridgeAPIError('\"path\" is required and cannot be empty in remote request options.');\n }\n\n const payload = await buildRemoteRequestPayload(remoteKey, requestOptions);\n const response = await NexusBridge.call<RemoteRequestResponseData>(\"remoteRequest\", payload);\n return parseRemoteResponseData(response);\n }\n}\n\nexport const remote = new NexusRemote();\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;AAEM,SAAU,oBAAoB,CAAI,GAAW,EAAE,KAAQ,EAAA;AACxD,IAAA,MAAkB,CAAC,GAAG,CAAC,GAAG,KAAK;AACpC;AAEM,SAAU,mBAAmB,CAAI,GAAW,EAAA;AAC9C,IAAA,OAAQ,MAAkB,CAAC,GAAG,CAAC;AACnC;;ACSA,SAAS,SAAS,GAAA;AACd,IAAA,MAAM,MAAM,GAAG,mBAAmB,CAAe,qBAAqB,CAAC;AACvE,IAAA,OAAO,MAAM;AACjB;MAEa,WAAW,CAAA;AACpB,IAAA,OAAO,aAAa,GAAA;AAChB,QAAA,IAAI,CAAC,SAAS,EAAE,EAAE;YACd,MAAM,IAAI,KAAK,CAAC;;;AAGnB,QAAA,CAAA,CAAC;QACF;AACA,QAAA,OAAO,SAAS,EAAE,CAAC,IAAI;IAC3B;AAEA,IAAA,aAAa,IAAI,CAAI,IAAY,EAAE,OAAa,EAAA;AAC5C,QAAA,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,aAAa,EAAK,CAAC,IAAI,EAAE,OAAO,CAAC;AAClE,QAAA,OAAO,MAAW;IACtB;AAEA;;;;;AAKG;AACH,IAAA,OAAO,EAAE,CAAI,IAAY,EAAE,OAA6C,EAAA;AACpE,QAAA,MAAM,MAAM,GAAG,SAAS,EAAE;QAC1B,IAAI,CAAC,MAAM,EAAE;YACT,MAAM,IAAI,KAAK,CAAC;;;AAGnB,QAAA,CAAA,CAAC;QACF;QACA,OAAO,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC;IACnC;AACH;;ACtDK,MAAO,cAAe,SAAQ,KAAK,CAAA;AACrC,IAAA,WAAA,CAAY,OAAe,EAAA;QACvB,KAAK,CAAC,OAAO,CAAC;AACd,QA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AAI,OAAO,SAAS,KAAK,QAAQ,IAAI,SAAS,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE;AAChE,YAAA,MAAM,IAAI,cAAc,CAAC,gEAAgE,CAAC;QAC9F;AACA,QAAA,IAAI,OAAO,KAAK,SAAS,KAAK,CAAC,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,CAAC,EAAE;AACpE,YAAA,MAAM,IAAI,cAAc,CAAC,gDAAgD,CAAC;QAC9E;AAEA,QAAA,MAAM,cAAc,GAAG;AACnB,YAAA,IAAI,EAAE,EAAE;YACR,GAAG,oBAAoB,CAAC,OAAO,CAAC;SACnC;AACD,QAAA,MAAM,EAAE,IAAI,EAAE,GAAG,cAAc;QAC/B,IAAI,OAAO,KAAK,SAAS,KAAK,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,CAAC,EAAE;AACjF,YAAA,MAAM,IAAI,cAAc,CAAC,mEAAmE,CAAC;QACjG;QAEA,MAAM,OAAO,GAAG,MAAM,yBAAyB,CAAC,SAAS,EAAE,cAAc,CAAC;QAC1E,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,IAAI,CAA4B,eAAe,EAAE,OAAO,CAAC;AAC5F,QAAA,OAAO,uBAAuB,CAAC,QAAQ,CAAC;IAC5C;AACH;AAEM,MAAM,MAAM,GAAG,IAAI,WAAW;;AChDrC;;AAEG;;;;"}
1
+ {"version":3,"file":"pc-nexus-bridge.mjs","sources":["../../../../web/bridge/src/window.ts","../../../../web/bridge/src/bridge.ts","../../../../web/bridge/src/error.ts","../../../../web/bridge/src/dialog.ts","../../../../web/bridge/src/invoke.ts","../../../../web/bridge/src/router.ts","../../../../web/bridge/src/view.ts","../../../../web/bridge/src/utils/blob-parser.ts","../../../../web/bridge/src/events.ts","../../../../web/bridge/src/i18n.ts","../../../../web/bridge/src/utils/request.ts","../../../../web/bridge/src/api.ts","../../../../web/bridge/src/store.ts","../../../../web/bridge/src/remote.ts","../../../../web/bridge/src/pc-nexus-bridge.ts"],"sourcesContent":["export type SafeAny = any;\n\nexport function attachObjectToWindow<T>(key: string, value: T) {\n (window as SafeAny)[key] = value;\n}\n\nexport function getObjectFromWindow<T>(key: string) {\n return (window as SafeAny)[key];\n}\n","import { getObjectFromWindow } from \"./window\";\n\ninterface HostMessageEvent<T = unknown> {\n source: Window | null;\n origin: string;\n data: T;\n}\n\ninterface Cancelable {\n cancel: () => void;\n}\n\ninterface GlobalBridge {\n call<T>(name: string, payload?: object | undefined): Promise<T>;\n on<T>(name: string, handler: (event: HostMessageEvent<T>) => void): Cancelable;\n}\n\nfunction getBridge() {\n const bridge = getObjectFromWindow<GlobalBridge>(\"__pc_nexus_bridge__\");\n return bridge;\n}\n\nexport class NexusBridge {\n static getBridgeCall<T>(): (name: string, payload?: object) => Promise<T> {\n if (!getBridge()) {\n throw new Error(`\n Unable to establish a connection with the PingCode nexus bridge.\n If you are trying to run your app locally, Nexus apps only work in the context of PingCode products. Refer to https://developer.pingcode.com for how to tunnel when using a local development server.\n `);\n }\n return getBridge().call;\n }\n\n static async call<T>(name: string, payload?: any): Promise<T> {\n const result = await NexusBridge.getBridgeCall<T>()(name, payload);\n return result as T;\n }\n\n /**\n * 订阅宿主 host 发来的消息。\n * @param name 消息名称\n * @param handler 收到消息时的回调,event 包含 source、origin、data\n * @returns 返回带 cancel() 的对象,调用可取消订阅\n */\n static on<T>(name: string, handler: (event: HostMessageEvent<T>) => void): Cancelable {\n const bridge = getBridge();\n if (!bridge) {\n throw new Error(`\n Unable to establish a connection with the PingCode nexus bridge.\n If you are trying to run your app locally, Nexus apps only work in the context of PingCode products. Refer to https://developer.pingcode.com for how to tunnel when using a local development server.\n `);\n }\n return bridge.on(name, handler);\n }\n}\n","export class BridgeAPIError extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"BridgeAPIError\";\n Object.setPrototypeOf(this, BridgeAPIError.prototype);\n }\n}\n\n// 自动注册:所有未 catch 的 Promise rejection 均以 \"Uncaught (in promise)\" 格式输出,无需用户配置\nif (typeof window !== \"undefined\") {\n window.addEventListener(\n \"unhandledrejection\",\n (event: PromiseRejectionEvent) => {\n const reason = event.reason;\n const error = reason instanceof Error ? reason : new Error(String(reason));\n const firstLine = `Uncaught (in promise) ${error.name}: ${error.message}`;\n const stack = error.stack?.replace(/^[^\\n]*\\n?/, \"\").trim() || \"\";\n console.error(stack ? `${firstLine}\\n${stack}` : firstLine);\n event.preventDefault();\n event.stopImmediatePropagation();\n },\n true,\n );\n}\n","import { NexusBridge } from \"./bridge\";\nimport { BridgeAPIError } from \"./error\";\nimport { DialogConfirmOptions, DialogOpenOptions, DialogRef } from \"./models\";\n\nfunction validateOpenOptions(options: DialogOpenOptions) {\n if (typeof options !== \"object\" || options === null) {\n throw new BridgeAPIError('Parameter \"options\" must be an object in \"dialog.open\".');\n }\n if (!options.resource) {\n throw new BridgeAPIError('Parameter \"resource\" is required in \"dialog.open\" options.');\n }\n}\n\nfunction validateConfirmOptions(options: DialogConfirmOptions) {\n if (typeof options !== \"object\" || options === null) {\n throw new BridgeAPIError('Parameter \"options\" must be an object in \"dialog.confirm\".');\n }\n if (!options.content) {\n throw new BridgeAPIError('Parameter \"content\" is required in \"dialog.confirm\" options.');\n }\n if (typeof options.onConfirm !== \"function\") {\n throw new BridgeAPIError('Parameter \"onConfirm\" must be a function in \"dialog.confirm\" options.');\n }\n}\n\nclass NexusDialog {\n async open<T>(options: DialogOpenOptions): Promise<DialogRef<T>> {\n validateOpenOptions(options);\n return await NexusBridge.call<DialogRef<T>>(\"openDialog\", options);\n }\n\n async confirm<T>(options: DialogConfirmOptions): Promise<void> {\n validateConfirmOptions(options);\n return await NexusBridge.call<void>(\"confirm\", options);\n }\n}\n\nexport const dialog = new NexusDialog();\n","import { NexusBridge } from \"./bridge\";\nimport { BridgeAPIError } from \"./error\";\nimport { InvokeFunctionParams } from \"./models\";\nimport { getObjectFromWindow } from \"./window\";\n\nfunction validatePayload<TPayload>(payload?: TPayload) {\n if (!payload) {\n return;\n }\n if (Object.values(payload).some((value) => typeof value === \"function\")) {\n throw new BridgeAPIError('Parameter \"payload\" must not include functions in \"invoke\".');\n }\n}\n\nexport async function invoke<TPayload = any, TResult = any>(functionKey: string, payload?: TPayload): Promise<TResult> {\n if (typeof functionKey !== \"string\") {\n throw new BridgeAPIError('Parameter \"functionKey\" must be a string in \"invoke\".');\n }\n validatePayload(payload);\n\n const params: InvokeFunctionParams = {\n function: functionKey,\n payload: payload,\n tunnel_token: getObjectFromWindow(\"__TUNNEL_TOKEN__\"),\n } as InvokeFunctionParams;\n const result = await NexusBridge.call(\"invokeFunction\", params);\n return result as TResult;\n}\n","import { NexusBridge } from \"./bridge\";\nimport { BridgeAPIError } from \"./error\";\nimport { NavigationLocation } from \"./models\";\n\nfunction validateNavigationLocation(location: NavigationLocation, apiName: string): void {\n if (!location?.target) {\n throw new BridgeAPIError(`Parameter \"target\" is required in \"${apiName}\" location.`);\n }\n if (!location?.id) {\n throw new BridgeAPIError(`Parameter \"id\" is required in \"${apiName}\" location.`);\n }\n}\n\nclass NexusRouter {\n async navigate(urlOrLocation: string | NavigationLocation): Promise<void> {\n if (typeof urlOrLocation === \"string\") {\n await NexusBridge.call<void>(\"routerNavigate\", { urlOrLocation });\n } else {\n validateNavigationLocation(urlOrLocation, \"router.navigate\");\n await NexusBridge.call<void>(\"routerNavigate\", { urlOrLocation });\n }\n }\n\n async open(urlOrLocation: string | NavigationLocation): Promise<void> {\n if (typeof urlOrLocation === \"string\") {\n await NexusBridge.call<void>(\"routerOpen\", { urlOrLocation });\n } else {\n validateNavigationLocation(urlOrLocation, \"router.open\");\n await NexusBridge.call<void>(\"routerOpen\", { urlOrLocation });\n }\n }\n\n async generateUrl(location: NavigationLocation): Promise<URL> {\n validateNavigationLocation(location, \"router.generateUrl\");\n const urlString = await NexusBridge.call<string>(\"routerGenerateUrl\", { location });\n return new URL(urlString);\n }\n\n async reload(): Promise<void> {\n await NexusBridge.call<void>(\"routerReload\", {});\n }\n}\n\nexport const router = new NexusRouter();\n","import { NexusBridge } from \"./bridge\";\nimport { BridgeAPIError } from \"./error\";\nimport { ExtensionData, NexusAppContext, NexusHistory, HistoryUpdate } from \"./models\";\n\nclass NexusView {\n async getContext<T = ExtensionData>(): Promise<NexusAppContext<T>> {\n return await NexusBridge.call(\"getContext\");\n }\n\n async setWindowTitle(title: string): Promise<void> {\n if (!title) {\n throw new BridgeAPIError('Parameter \"title\" is required in \"view.setWindowTitle\".');\n }\n if (typeof title !== \"string\") {\n throw new BridgeAPIError('Parameter \"title\" must be a string in \"view.setWindowTitle\".');\n }\n\n const success = await NexusBridge.call<boolean>(\"setWindowTitle\", { title });\n if (!success) {\n throw new BridgeAPIError('API \"setWindowTitle\" is not available within this module.');\n }\n }\n\n async refresh(): Promise<void> {\n const success = await NexusBridge.call<boolean>(\"viewRefresh\");\n if (success === false) {\n throw new BridgeAPIError(\"This resource's view is not refreshable.\");\n }\n }\n\n async close(payload?: unknown): Promise<void> {\n const success = await NexusBridge.call<boolean>(\"viewClose\", payload);\n if (!success) {\n const errorMessage = \"This resource's view is not closable.\";\n throw new BridgeAPIError(errorMessage);\n }\n }\n\n /**\n * 非弹窗场景调用无效。\n */\n async onClose(payload: () => Promise<void>): Promise<void> {\n if (typeof payload !== \"function\") {\n const errorMessage = 'Parameter \"payload\" must be a function in \"view.onClose\".';\n throw new BridgeAPIError(errorMessage);\n }\n const success = await NexusBridge.call<boolean>(\"viewOnClose\", { payload });\n if (!success) {\n throw new BridgeAPIError(\"This resource's view is not closable.\");\n }\n }\n\n async isDialog(): Promise<boolean> {\n return await NexusBridge.call<boolean>(\"viewIsDialog\");\n }\n\n async createHistory(): Promise<NexusHistory> {\n const history = await NexusBridge.call<NexusHistory>(\"createHistory\");\n if (!history) {\n throw new BridgeAPIError('API \"createHistory\" is not available within this module.');\n }\n await history.listen((update: HistoryUpdate) => {\n history.action = update.action;\n history.location = update.location;\n });\n return history;\n }\n\n async submit<T = any>(payload?: T): Promise<boolean> {\n const result = await NexusBridge.call<boolean>(\"viewSubmit\", payload);\n if (!result) {\n throw new BridgeAPIError(\"This resource's view is not submittable.\");\n }\n return result;\n }\n}\n\nexport const view = new NexusView();\n","const isPlainObject = (value: any) => {\n if (typeof value !== \"object\" || value === null) {\n return false;\n }\n if (Object.prototype.toString.call(value) !== \"[object Object]\") {\n return false;\n }\n const proto = Object.getPrototypeOf(value);\n if (proto === null) {\n return true;\n }\n const constructor = Object.prototype.hasOwnProperty.call(proto, \"constructor\") && proto.constructor;\n return (\n typeof constructor === \"function\" &&\n constructor instanceof constructor &&\n Function.prototype.call(constructor) === Function.prototype.call(value)\n );\n};\n\nexport const base64ToBlob = (b64string: string, mimeType: string) => {\n if (!b64string) {\n return null;\n }\n const base64String = b64string.includes(\",\") ? b64string.split(\",\")[1] : b64string;\n const byteCharacters = atob(base64String);\n const byteNumbers = new Array(byteCharacters.length);\n for (let i = 0; i < byteCharacters.length; i++) {\n byteNumbers[i] = byteCharacters.charCodeAt(i);\n }\n\n const byteArray = new Uint8Array(byteNumbers);\n return new Blob([byteArray], { type: mimeType });\n};\n\nexport const blobToBase64 = (blob: Blob): Promise<string> => {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onloadend = () => {\n resolve(reader.result as string);\n };\n reader.onerror = reject;\n reader.readAsDataURL(blob);\n });\n};\n\nexport const blobToArrayBuffer = (blob: Blob): Promise<ArrayBuffer> => {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onloadend = () => {\n resolve(reader.result as ArrayBuffer);\n };\n reader.onerror = reject;\n reader.readAsArrayBuffer(blob);\n });\n};\n\nexport const serialiseBlobsInPayload = async (payload: any): Promise<any> => {\n if (payload instanceof Blob) {\n const base64Data = await blobToBase64(payload);\n return {\n data: base64Data,\n type: payload.type,\n name: payload instanceof File ? payload.name : undefined,\n __isBlobData: true,\n };\n }\n if (Array.isArray(payload)) {\n return Promise.all(payload.map((item) => serialiseBlobsInPayload(item)));\n }\n if (payload && isPlainObject(payload)) {\n const entries = await Promise.all(Object.entries(payload).map(async ([key, value]) => [key, await serialiseBlobsInPayload(value)]));\n return Object.fromEntries(entries);\n }\n return payload;\n};\n\nexport const deserialiseBlobsInPayload = (payload: any): any => {\n if (payload && isPlainObject(payload) && \"__isBlobData\" in payload) {\n const typedData = payload;\n return base64ToBlob(typedData.data, typedData.type);\n }\n if (Array.isArray(payload)) {\n return payload.map((item) => deserialiseBlobsInPayload(item));\n }\n if (payload && isPlainObject(payload)) {\n const result = {};\n for (const [key, value] of Object.entries(payload)) {\n (result as any)[key] = deserialiseBlobsInPayload(value);\n }\n return result;\n }\n return payload;\n};\n\nexport const containsBlobs = (payload: any): boolean => {\n if (payload instanceof Blob) {\n return true;\n }\n if (Array.isArray(payload)) {\n return payload.some((item) => containsBlobs(item));\n }\n if (payload && isPlainObject(payload)) {\n return Object.values(payload).some((value) => containsBlobs(value));\n }\n return false;\n};\n\nexport const containsSerialisedBlobs = (payload: any): boolean => {\n if (payload && isPlainObject(payload) && \"__isBlobData\" in payload) {\n return true;\n }\n if (Array.isArray(payload)) {\n return payload.some((item) => containsSerialisedBlobs(item));\n }\n if (payload && isPlainObject(payload)) {\n return Object.values(payload).some((value) => containsSerialisedBlobs(value));\n }\n return false;\n};\n","import { NexusBridge } from \"./bridge\";\nimport { BridgeAPIError } from \"./error\";\nimport { Subscription } from \"./models\";\nimport { containsBlobs, serialiseBlobsInPayload, containsSerialisedBlobs, deserialiseBlobsInPayload } from \"./utils\";\n\nfunction validateOnPayload<T>(eventName: string, callback: (payload?: T) => any) {\n if (!eventName) {\n throw new BridgeAPIError('Parameter \"eventName\" is required in \"events.on\".');\n }\n if (typeof eventName !== \"string\") {\n throw new BridgeAPIError('Parameter \"eventName\" must be a string in \"events.on\".');\n }\n if (!callback) {\n throw new BridgeAPIError('Parameter \"callback\" is required in \"events.on\".');\n }\n if (typeof callback !== \"function\") {\n throw new BridgeAPIError('Parameter \"callback\" must be a function in \"events.on\".');\n }\n}\n\nfunction validateEmitPayload<T>(eventName: string) {\n if (!eventName) {\n throw new BridgeAPIError('Parameter \"eventName\" is required in \"events.emit\".');\n }\n if (typeof eventName !== \"string\") {\n throw new BridgeAPIError('Parameter \"eventName\" must be a string in \"events.emit\".');\n }\n}\n\nasync function on<T = any>(eventName: string, callback: (payload?: T) => any): Promise<Subscription> {\n validateOnPayload<T>(eventName, callback);\n\n const wrappedCallback = (payload: T) => {\n let newPayload = payload;\n if (containsSerialisedBlobs(payload)) {\n newPayload = deserialiseBlobsInPayload(payload);\n }\n return callback(newPayload);\n };\n return NexusBridge.call(\"on\", { eventName, callback: wrappedCallback });\n}\n\nasync function emit<T = any>(eventName: string, payload?: T): Promise<void> {\n validateEmitPayload<T>(eventName);\n\n let newPayload = payload;\n if (containsBlobs(payload)) {\n newPayload = await serialiseBlobsInPayload(payload);\n }\n return NexusBridge.call(\"emit\", { eventName, payload: newPayload });\n}\n\nexport const events = {\n on,\n emit,\n};\n","import { Translator, GetTranslationsResult, SupportedLocaleCode, TranslationsResourceContent, SUPPORTED_LOCALE_CODES } from \"./models\";\nimport { view } from \"./view\";\nimport { BridgeAPIError } from \"./error\";\n\nclass NexusI18n {\n private translationsCache: Partial<Record<SupportedLocaleCode, Promise<TranslationsResourceContent>>> = {};\n\n private i18nFolderName = \"__LOCALES__\";\n\n async getTranslations(locale?: SupportedLocaleCode): Promise<GetTranslationsResult> {\n if (!locale) {\n locale = (await view.getContext()).user.locale;\n } else {\n if (!SUPPORTED_LOCALE_CODES.includes(locale)) {\n throw new BridgeAPIError(\n `Parameter \"locale\" must be a valid locale code, supported codes: ${SUPPORTED_LOCALE_CODES.join(\", \")} in \"i18n.getTranslations\".`,\n );\n }\n }\n const translations = await this.loadTranslations(locale!);\n return { locale: locale!, translations };\n }\n\n async createTranslator(locale?: SupportedLocaleCode): Promise<Translator> {\n if (!locale) {\n locale = (await view.getContext()).user.locale;\n } else {\n if (!SUPPORTED_LOCALE_CODES.includes(locale)) {\n throw new BridgeAPIError(\n `Parameter \"locale\" must be a valid locale code, supported codes: ${SUPPORTED_LOCALE_CODES.join(\", \")} in \"i18n.createTranslator\".`,\n );\n }\n }\n const translations = await this.loadTranslations(locale!);\n return {\n translate: (key: string, params: Record<string, any> = {}) => this.translate(key, translations, params),\n };\n }\n\n private loadTranslations(locale: SupportedLocaleCode): Promise<TranslationsResourceContent> {\n const url = `../${this.i18nFolderName}/${locale}.json`;\n if (!this.translationsCache[locale]) {\n this.translationsCache[locale] = fetch(url)\n .then((response) => {\n if (!response.ok) {\n throw new BridgeAPIError(\n `Failed to load translations for locale ${locale}. HTTP ${response.status}: ${response.statusText}`,\n );\n }\n return response.json();\n })\n .catch((error) => {\n // 请求失败要清理缓存\n delete this.translationsCache[locale];\n if (error instanceof BridgeAPIError) {\n throw error;\n } else {\n throw new BridgeAPIError(`Failed to load translations for locale ${locale}. ${error}`);\n }\n });\n }\n\n return this.translationsCache[locale]!;\n }\n\n private getValue(obj: any, path: string): any {\n return path.split(\".\").reduce((o, k) => (o != null && typeof o === \"object\" ? o[k] : undefined), obj);\n }\n\n private translate(\n key: string,\n translations: TranslationsResourceContent,\n params?: Record<string, any>,\n ): TranslationsResourceContent | string {\n if (!key) {\n throw new BridgeAPIError('Parameter \"key\" is required in \"i18n.translate\".');\n }\n // 获取值(扁平或嵌套)\n let value: any = translations[key] ?? this.getValue(translations, key);\n\n // key 不存在 → 返回 key\n if (value == null) return key;\n\n // 如果 value 是对象 → 直接返回\n if (typeof value === \"object\") return value;\n\n // 确保 value 是字符串\n if (typeof value !== \"string\") value = String(value);\n\n // 无参数 → 直接返回\n if (!params) return value;\n\n // 参数替换\n return value.replace(/\\{\\{\\s*(.*?)\\s*\\}\\}/g, (_: string, k: string) => {\n const paramValue = this.getValue(params, k.trim());\n return paramValue != null ? String(paramValue) : `{{${k}}}`;\n });\n }\n}\n\nexport const i18n = new NexusI18n();\n","import {\n RemoteRequestOptions,\n RemoteRequestPayload,\n RemoteRequestResponseData,\n RemoteSerializedFormDataEntry,\n InvokeResponseData,\n ApiInvokeOptions,\n} from \"../models\";\nimport { base64ToBlob, blobToArrayBuffer, serialiseBlobsInPayload } from \"./blob-parser\";\n\nexport const validateFetchOptions = (init?: ApiInvokeOptions) => {\n if (!init) {\n return init;\n }\n if (\"signal\" in init) {\n const { signal: _signal, ...rest } = init;\n console.error(\"Signal is not supported in @pc-nexus/bridge and was removed from fetch options.\");\n return rest;\n }\n return init;\n};\n\nexport async function buildPayloadByRequestInit<TPayload extends RequestInit = RequestInit>(init?: TPayload) {\n const requestBody = init === null || init === void 0 ? void 0 : init.body;\n const requestMethod = init === null || init === void 0 ? void 0 : init.method;\n const requestHeaders = init === null || init === void 0 ? void 0 : init.headers;\n const req = new Request(\"\", {\n body: requestBody,\n method: requestMethod,\n headers: requestHeaders,\n });\n const headers = Object.fromEntries(req.headers.entries());\n const body = req.method !== \"GET\" ? await req.text() : undefined;\n return {\n ...init,\n body: body,\n headers,\n method: requestMethod ?? \"GET\",\n };\n}\n\nexport async function parseToResponseData(res: InvokeResponseData): Promise<Response> {\n const response = new Response(\n res.body == null ? undefined : typeof res.body === \"object\" ? JSON.stringify(res.body) : (res.body as BodyInit),\n {\n status: res.status,\n headers: new Headers(res.headers),\n },\n );\n\n return response;\n}\n\nasync function parseFormData(formData: FormData): Promise<RemoteSerializedFormDataEntry[]> {\n const entries: RemoteSerializedFormDataEntry[] = [];\n for (const [name, value] of formData.entries()) {\n entries.push({\n name,\n value: typeof value === \"string\" ? value : await serialiseBlobsInPayload(value),\n });\n }\n return entries;\n}\n\nexport async function buildRemoteRequestPayload(remoteKey: string, options: RemoteRequestOptions): Promise<RemoteRequestPayload> {\n const { path = \"\", ...requestOptions } = options;\n const isMultipartFormData = requestOptions.body instanceof FormData;\n const request = new Request(\"\", {\n body: requestOptions.body,\n method: requestOptions.method,\n headers: requestOptions.headers,\n });\n const headers = Object.fromEntries(request.headers.entries());\n let body: RemoteRequestPayload[\"requestInit\"][\"body\"];\n if (isMultipartFormData) {\n body = await parseFormData(requestOptions.body as FormData);\n } else if (request.method !== \"GET\") {\n body = await request.text();\n }\n\n return {\n remoteKey,\n path,\n isMultipartFormData,\n requestInit: {\n ...requestOptions,\n body,\n method: requestOptions.method ?? \"GET\",\n headers,\n },\n };\n}\n\nexport async function parseRemoteResponseData(res: RemoteRequestResponseData): Promise<Response> {\n const headers = new Headers(res.headers);\n const blob = res.isBinaryContent && res.body ? base64ToBlob(res.body, headers.get(\"content-type\") ?? \"\") : undefined;\n const responseBody = blob ? await blobToArrayBuffer(blob) : res.body;\n\n return new Response((responseBody as BodyInit) ?? null, {\n status: res.status,\n statusText: res.statusText,\n headers,\n });\n}\n","import { NexusBridge } from \"./bridge\";\nimport { BridgeAPIError } from \"./error\";\nimport { InvokeResponseData, ApiInvokeOptions } from \"./models\";\nimport { buildPayloadByRequestInit, parseToResponseData, validateFetchOptions } from \"./utils/request\";\n\ninterface InvokeApiParams extends ApiInvokeOptions {\n path: string;\n}\n\nasync function callInvokeBridge<TPayload extends ApiInvokeOptions = ApiInvokeOptions>(\n handlerName: string,\n payload: TPayload,\n): Promise<Response> {\n const postPayload = await buildPayloadByRequestInit<TPayload>(payload);\n const { status, headers, body } = await NexusBridge.call<InvokeResponseData>(handlerName, postPayload);\n return parseToResponseData({ status, headers, body });\n}\n\nclass NexusRestApi {\n async invoke(path: string, options?: ApiInvokeOptions): Promise<Response> {\n if (typeof path !== \"string\") {\n throw new BridgeAPIError('Parameter \"path\" must be a string in \"api.invoke\".');\n }\n\n const validatedOptions = validateFetchOptions(options);\n return callInvokeBridge<InvokeApiParams>(\"apiInvoke\", { path, ...validatedOptions });\n }\n}\n\nexport const api = new NexusRestApi();\n","import { BridgeAPIError } from \"./error\";\nimport { invoke } from \"./invoke\";\nimport { DownloadResult, GetMetadataResult, UploadResult } from \"./models\";\n\ntype UploadInput = File | Blob;\n\ninterface GeneratedMetadata {\n size: number;\n checksum: string;\n checksum_type: \"SHA1\" | \"SHA256\" | \"CRC32\" | \"CRC32C\";\n}\n\ninterface FileMetadata extends GeneratedMetadata {\n key: string;\n overwrite?: boolean;\n}\n\ntype PresignedURLMapping = Record<string, FileMetadata>;\n\nasync function buildObjectMetadata(file: UploadInput): Promise<GeneratedMetadata> {\n const size = file.size;\n const arrayBuffer = await file.arrayBuffer();\n let checksum: string;\n const checksum_type = \"SHA256\";\n\n // crypto.subtle 只能在安全上下文(HTTPS 或 localhost)中使用\n // sha256 兼容模拟器非安全上下文\n if (typeof crypto !== \"undefined\" && crypto.subtle) {\n const hashBuffer = await crypto.subtle.digest(\"SHA-256\", arrayBuffer);\n const hashArray = new Uint8Array(hashBuffer);\n checksum = btoa(String.fromCharCode(...hashArray));\n } else {\n const jsHash = await sha256(arrayBuffer);\n checksum = btoa(String.fromCharCode(...new Uint8Array(jsHash)));\n }\n\n return {\n size,\n checksum,\n checksum_type,\n };\n}\n\nfunction buildChecksumToFileMap(files: UploadInput[], metadata: GeneratedMetadata[]) {\n const map = new Map<string, { file: UploadInput; index: number }>();\n\n files.forEach((file, index) => {\n map.set(metadata[index].checksum, {\n file,\n index,\n });\n });\n\n return map;\n}\n\nfunction uploadFile(url: string, file: UploadInput, key: string) {\n const formData = new FormData();\n const fileName = (file as File).name || key;\n formData.append(\"file\", file, fileName);\n\n return fetch(url, {\n method: \"PUT\",\n body: formData,\n })\n .then((response) => ({\n success: response.ok,\n key,\n status: response.status,\n error: response.ok ? undefined : `Upload failed with status ${response.status}`,\n }))\n .catch((error) => ({\n success: false,\n key,\n status: 503,\n error: error instanceof Error ? error.message : \"Upload failed\",\n }));\n}\n\nclass NexusObjectStore {\n async upload(functionKey: string, objects: UploadInput[]): Promise<UploadResult[]> {\n if (!functionKey || functionKey.length === 0) {\n throw new BridgeAPIError('Parameter \"functionKey\" is required in \"store.upload\".');\n }\n if (!Array.isArray(objects) || objects.length === 0) {\n throw new BridgeAPIError('Parameter \"objects\" is required and cannot be empty in \"store.upload\".');\n }\n\n const files = objects.map((obj, index) => {\n if (obj instanceof File || obj instanceof Blob) return obj;\n throw new BridgeAPIError(`Parameter \"objects\" at index ${index} must be a Blob or File in \"store.upload\".`);\n });\n\n const allObjectMetadata: GeneratedMetadata[] = await Promise.all(files.map((file) => buildObjectMetadata(file)));\n\n const presignedURLsToObjectMetadata: PresignedURLMapping = await invoke(functionKey, allObjectMetadata);\n\n if (!presignedURLsToObjectMetadata || typeof presignedURLsToObjectMetadata !== \"object\") {\n throw new BridgeAPIError('Failed to get a valid response from \"invoke\".');\n }\n\n const checksumMap: Map<string, { file: UploadInput; index: number }> = buildChecksumToFileMap(files, allObjectMetadata);\n\n const uploadPromises = Object.entries(presignedURLsToObjectMetadata).map(([presignedUrl, { key, checksum }]) => {\n const fileInfo = checksumMap.get(checksum);\n\n if (!fileInfo) {\n return {\n promise: Promise.resolve({\n success: false,\n key,\n error: `File not found for checksum ${checksum}`,\n }),\n index: -1,\n };\n }\n\n const { file, index } = fileInfo;\n\n const promise = uploadFile(presignedUrl, file, key);\n\n return {\n promise,\n index,\n objectType: file.type,\n objectSize: file.size,\n };\n });\n\n return await Promise.all(uploadPromises.map((t) => t.promise));\n }\n\n async download(functionKey: string, keys: string[]): Promise<DownloadResult[]> {\n if (!functionKey || functionKey.length === 0) {\n throw new BridgeAPIError('Parameter \"functionKey\" is required in \"store.download\".');\n }\n if (!Array.isArray(keys) || keys.length === 0) {\n throw new BridgeAPIError('Parameter \"keys\" is required and cannot be empty in \"store.download\".');\n }\n\n const downloadUrlsTokeys: Record<string, string> = await invoke(functionKey, keys);\n\n if (!downloadUrlsTokeys || typeof downloadUrlsTokeys !== \"object\") {\n throw new BridgeAPIError('Failed to get a valid response from \"invoke\".');\n }\n\n const downloadPromises = Object.entries(downloadUrlsTokeys).map(async ([downloadUrl, key]) => {\n try {\n const response = await fetch(downloadUrl, {\n method: \"GET\",\n });\n if (!response.ok) {\n return {\n success: false,\n key: key,\n status: response.status,\n error: `Download failed with status ${response.status}`,\n };\n }\n const blob = await response.blob();\n const disposition = response.headers.get(\"Content-Disposition\") ?? \"\";\n const name = disposition.match(/filename\\*=UTF-8''([^;]+)/)?.[1] ?? disposition.match(/filename=\"?([^\"]+)\"?/)?.[1] ?? \"\";\n\n return {\n success: true,\n key: key,\n blob,\n name,\n status: response.status,\n };\n } catch (error) {\n return {\n success: false,\n key: key,\n status: 503,\n error: error instanceof Error ? error.message : \"Download failed\",\n };\n }\n });\n\n return await Promise.all(downloadPromises);\n }\n\n async getMetadata(functionKey: string, keys: string[]): Promise<GetMetadataResult[]> {\n if (!functionKey || functionKey.length === 0) {\n throw new BridgeAPIError('Parameter \"functionKey\" is required in \"store.getMetadata\".');\n }\n if (!Array.isArray(keys) || keys.length === 0) {\n throw new BridgeAPIError('Parameter \"keys\" is required and cannot be empty in \"store.getMetadata\".');\n }\n const results = await Promise.all(\n keys.map(async (key) => {\n const result = await invoke(functionKey, key);\n if (!result || typeof result !== \"object\") {\n return {\n key,\n error: 'Failed to get a valid response from \"invoke\".',\n };\n }\n return result;\n }),\n );\n\n return results;\n }\n\n async delete(functionKey: string, keys: string[]): Promise<void> {\n if (!functionKey || functionKey.length === 0) {\n throw new BridgeAPIError('Parameter \"functionKey\" is required in \"store.delete\".');\n }\n if (!Array.isArray(keys) || keys.length === 0) {\n throw new BridgeAPIError('Parameter \"keys\" is required and cannot be empty in \"store.delete\".');\n }\n await Promise.all(\n keys.map(async (key) => {\n await invoke(functionKey, key);\n }),\n );\n }\n}\n\nexport const store = new NexusObjectStore();\n\nexport function sha256(buffer: ArrayBuffer): ArrayBuffer {\n const bytes = new Uint8Array(buffer);\n const len = bytes.length;\n const blockSize = 64;\n const hashSize = 32;\n\n const K = new Uint32Array([\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be,\n 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa,\n 0x5cb0a9dc, 0x76f988da, 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, 0x27b70a85,\n 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3,\n 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f,\n 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2,\n ]);\n\n let h0 = 0x6a09e667,\n h1 = 0xbb67ae85,\n h2 = 0x3c6ef372,\n h3 = 0xa54ff53a;\n let h4 = 0x510e527f,\n h5 = 0x9b05688c,\n h6 = 0x1f83d9ab,\n h7 = 0x5be0cd19;\n\n const totalBits = BigInt(len) * 8n;\n const paddingLen = len % blockSize < 56 ? 56 - (len % blockSize) : 120 - (len % blockSize);\n const paddedLen = len + paddingLen + 8;\n const padded = new Uint8Array(paddedLen);\n padded.set(bytes);\n padded[len] = 0x80;\n\n const view = new DataView(padded.buffer, padded.byteOffset);\n view.setUint32(paddedLen - 4, Number((totalBits >> 32n) & 0xffffffffn));\n view.setUint32(paddedLen - 8, Number(totalBits & 0xffffffffn));\n\n for (let i = 0; i < paddedLen; i += blockSize) {\n const w = new Uint32Array(64);\n for (let j = 0; j < 16; j++) {\n w[j] = view.getUint32(i + j * 4);\n }\n\n for (let j = 16; j < 64; j++) {\n const s0 = ((w[j - 15] >>> 7) | (w[j - 15] << 25)) ^ ((w[j - 15] >>> 18) | (w[j - 15] << 14)) ^ (w[j - 15] >>> 3);\n const s1 = ((w[j - 2] >>> 17) | (w[j - 2] << 15)) ^ ((w[j - 2] >>> 19) | (w[j - 2] << 13)) ^ (w[j - 2] >>> 10);\n w[j] = (w[j - 16] + s0 + w[j - 7] + s1) >>> 0;\n }\n\n let a = h0,\n b = h1,\n c = h2,\n d = h3,\n e = h4,\n f = h5,\n g = h6,\n h = h7;\n\n for (let j = 0; j < 64; j++) {\n const S1 = ((e >>> 6) | (e << 26)) ^ ((e >>> 11) | (e << 21)) ^ ((e >>> 25) | (e << 7));\n const ch = (e & f) ^ (~e & g);\n const temp1 = (h + S1 + ch + K[j] + w[j]) >>> 0;\n const S0 = ((a >>> 2) | (a << 30)) ^ ((a >>> 13) | (a << 19)) ^ ((a >>> 22) | (a << 10));\n const maj = (a & b) ^ (a & c) ^ (b & c);\n const temp2 = (S0 + maj) >>> 0;\n\n h = g;\n g = f;\n f = e;\n e = (d + temp1) >>> 0;\n d = c;\n c = b;\n b = a;\n a = (temp1 + temp2) >>> 0;\n }\n\n h0 = (h0 + a) >>> 0;\n h1 = (h1 + b) >>> 0;\n h2 = (h2 + c) >>> 0;\n h3 = (h3 + d) >>> 0;\n h4 = (h4 + e) >>> 0;\n h5 = (h5 + f) >>> 0;\n h6 = (h6 + g) >>> 0;\n h7 = (h7 + h) >>> 0;\n }\n\n const result = new ArrayBuffer(hashSize);\n const resultView = new DataView(result);\n resultView.setUint32(0, h0);\n resultView.setUint32(4, h1);\n resultView.setUint32(8, h2);\n resultView.setUint32(12, h3);\n resultView.setUint32(16, h4);\n resultView.setUint32(20, h5);\n resultView.setUint32(24, h6);\n resultView.setUint32(28, h7);\n return result;\n}\n","import { NexusBridge } from \"./bridge\";\nimport { BridgeAPIError } from \"./error\";\nimport { InvokeResponseData, RemoteInvokeOptions, RemoteRequestOptions, RemoteRequestResponseData } from \"./models\";\nimport {\n buildPayloadByRequestInit,\n buildRemoteRequestPayload,\n parseRemoteResponseData,\n parseToResponseData,\n validateFetchOptions,\n} from \"./utils/request\";\n\nclass NexusRemote {\n async invoke(options: RemoteInvokeOptions): Promise<Response> {\n if (!options || typeof options !== \"object\") {\n throw new BridgeAPIError('Parameter \"options\" must be an object in \"remote.invoke\".');\n }\n if (typeof options.path !== \"string\" || options.path.trim().length === 0) {\n throw new BridgeAPIError('Parameter \"path\" is required and cannot be empty in \"remote.invoke\" options.');\n }\n\n const payload = await buildPayloadByRequestInit(options);\n const { status, headers, body } = await NexusBridge.call<InvokeResponseData>(\"remoteInvoke\", payload);\n return parseToResponseData({ status, headers, body });\n }\n\n async request(remoteKey: string, options?: RemoteRequestOptions): Promise<Response> {\n if (typeof remoteKey !== \"string\" || remoteKey.trim().length === 0) {\n throw new BridgeAPIError('Parameter \"remoteKey\" is required and cannot be empty in \"remote.request\".');\n }\n if (options !== undefined && (!options || typeof options !== \"object\")) {\n throw new BridgeAPIError('Parameter \"options\" must be an object in \"remote.request\".');\n }\n\n const requestOptions = {\n path: \"\",\n ...validateFetchOptions(options),\n };\n const { path } = requestOptions;\n if (options !== undefined && (typeof path !== \"string\" || path.trim().length === 0)) {\n throw new BridgeAPIError('Parameter \"path\" is required and cannot be empty in \"remote.request\" options.');\n }\n\n const payload = await buildRemoteRequestPayload(remoteKey, requestOptions);\n const response = await NexusBridge.call<RemoteRequestResponseData>(\"remoteRequest\", payload);\n return parseRemoteResponseData(response);\n }\n}\n\nexport const remote = new NexusRemote();\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;AAEM,SAAU,oBAAoB,CAAI,GAAW,EAAE,KAAQ,EAAA;AACxD,IAAA,MAAkB,CAAC,GAAG,CAAC,GAAG,KAAK;AACpC;AAEM,SAAU,mBAAmB,CAAI,GAAW,EAAA;AAC9C,IAAA,OAAQ,MAAkB,CAAC,GAAG,CAAC;AACnC;;ACSA,SAAS,SAAS,GAAA;AACd,IAAA,MAAM,MAAM,GAAG,mBAAmB,CAAe,qBAAqB,CAAC;AACvE,IAAA,OAAO,MAAM;AACjB;MAEa,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AO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,CAAC,EAAE;AACjF,YAAA,MAAM,IAAI,cAAc,CAAC,+EAA+E,CAAC;QAC7G;QAEA,MAAM,OAAO,GAAG,MAAM,yBAAyB,CAAC,SAAS,EAAE,cAAc,CAAC;QAC1E,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,IAAI,CAA4B,eAAe,EAAE,OAAO,CAAC;AAC5F,QAAA,OAAO,uBAAuB,CAAC,QAAQ,CAAC;IAC5C;AACH;AAEM,MAAM,MAAM,GAAG,IAAI,WAAW;;AChDrC;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@pc-nexus/bridge",
3
- "version": "0.5.0-next.27",
3
+ "version": "0.5.0-next.28",
4
4
  "peerDependencies": {},
5
5
  "dependencies": {
6
- "@pc-nexus/models": "0.5.0-next.27",
6
+ "@pc-nexus/models": "0.5.0-next.28",
7
7
  "tslib": "^2.3.0"
8
8
  },
9
9
  "sideEffects": false,