@inweb/client 25.9.5 → 25.9.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/client.js CHANGED
@@ -1108,9 +1108,24 @@
1108
1108
  async downloadFileRange(requestId, records, dataId, onProgress, signal) {
1109
1109
  await this.downloadResourceRange(dataId, requestId, records, onProgress, signal);
1110
1110
  }
1111
- // Reserved for future use
1112
- getReferences(signal) {
1113
- return Promise.resolve({ fileId: "", references: [] });
1111
+ /**
1112
+ * Returns a list of assembly references containing references from all the files from which
1113
+ * the assembly was created.
1114
+ *
1115
+ * References are images, fonts, or any other files to correct rendering of the assembly.
1116
+ *
1117
+ * @param signal - An
1118
+ * {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}
1119
+ * signal, which can be used to abort waiting as desired.
1120
+ */
1121
+ async getReferences(signal) {
1122
+ const references = await Promise.all(this.associatedFiles
1123
+ .map((file) => `/files/${file.fileId}/references`)
1124
+ .map((link) => this.httpClient.get(link, signal).then((response) => response.json())))
1125
+ .then((references) => references.map((x) => x.references))
1126
+ .then((references) => references.reduce((x, v) => [...v, ...x], []))
1127
+ .then((references) => [...new Set(references.map(JSON.stringify))].map((x) => JSON.parse(x)));
1128
+ return { id: "", references };
1114
1129
  }
1115
1130
  /**
1116
1131
  * Waits for assembly to be created. Assembly is created when it changes to `done` or `failed` status.
@@ -4071,7 +4086,7 @@
4071
4086
  .then((data) => ({
4072
4087
  ...data,
4073
4088
  server: data.version,
4074
- client: "25.9.5",
4089
+ client: "25.9.6",
4075
4090
  }));
4076
4091
  }
4077
4092
  /**
@@ -4786,7 +4801,7 @@
4786
4801
  // By use of this software, its documentation or related materials, you
4787
4802
  // acknowledge and accept the above terms.
4788
4803
  ///////////////////////////////////////////////////////////////////////////////
4789
- const version = "25.9.5";
4804
+ const version = "25.9.6";
4790
4805
 
4791
4806
  exports.Assembly = Assembly;
4792
4807
  exports.ClashTest = ClashTest;