polfan-server-js-client 0.2.39 → 0.2.41

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.
@@ -4,10 +4,7 @@
4
4
  <option name="autoReloadType" value="SELECTIVE" />
5
5
  </component>
6
6
  <component name="ChangeListManager">
7
- <list default="true" id="831dae43-0da1-47fd-a5f7-33dd5eec2992" name="Changes" comment="Adapt FilesClient to new files API">
8
- <change beforePath="$PROJECT_DIR$/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/package.json" afterDir="false" />
9
- <change beforePath="$PROJECT_DIR$/src/FilesClient.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/FilesClient.ts" afterDir="false" />
10
- </list>
7
+ <list default="true" id="831dae43-0da1-47fd-a5f7-33dd5eec2992" name="Changes" comment="Adapt FilesClient to new files API" />
11
8
  <option name="SHOW_DIALOG" value="false" />
12
9
  <option name="HIGHLIGHT_CONFLICTS" value="true" />
13
10
  <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
@@ -121,7 +118,7 @@
121
118
  <workItem from="1751811595978" duration="792000" />
122
119
  <workItem from="1752705788150" duration="3566000" />
123
120
  <workItem from="1752756543261" duration="1956000" />
124
- <workItem from="1752834023436" duration="1731000" />
121
+ <workItem from="1752834023436" duration="2601000" />
125
122
  </task>
126
123
  <task id="LOCAL-00001" summary="Emoticons objects">
127
124
  <option name="closed" value="true" />
@@ -451,7 +448,15 @@
451
448
  <option name="project" value="LOCAL" />
452
449
  <updated>1752756683365</updated>
453
450
  </task>
454
- <option name="localTasksCounter" value="42" />
451
+ <task id="LOCAL-00042" summary="Adapt FilesClient to new files API">
452
+ <option name="closed" value="true" />
453
+ <created>1752966028333</created>
454
+ <option name="number" value="00042" />
455
+ <option name="presentableId" value="LOCAL-00042" />
456
+ <option name="project" value="LOCAL" />
457
+ <updated>1752966028333</updated>
458
+ </task>
459
+ <option name="localTasksCounter" value="43" />
455
460
  <servers />
456
461
  </component>
457
462
  <component name="TypeScriptGeneratedFilesManager">
@@ -1825,7 +1825,8 @@ class EmoticonsManager {
1825
1825
  this.tracker.client.on('Session', () => this.handleSession());
1826
1826
  }
1827
1827
  async get(spaceId) {
1828
- if (this.emoticonsPromises.notExist(spaceId)) {
1828
+ const key = spaceId ?? GLOBAL_KEY;
1829
+ if (this.emoticonsPromises.notExist(key)) {
1829
1830
  this.emoticonsPromises.registerByFunction(async () => {
1830
1831
  const result = await this.tracker.client.send('GetEmoticons', {
1831
1832
  spaceId
@@ -1834,10 +1835,10 @@ class EmoticonsManager {
1834
1835
  throw result.error;
1835
1836
  }
1836
1837
  this.handleEmoticons(result.data);
1837
- }, spaceId ?? GLOBAL_KEY);
1838
+ }, key);
1838
1839
  }
1839
- await this.emoticonsPromises.get(spaceId);
1840
- return this.list.get(spaceId);
1840
+ await this.emoticonsPromises.get(key);
1841
+ return this.list.get(key);
1841
1842
  }
1842
1843
  handleEmoticons(event) {
1843
1844
  const spaceId = event.location.spaceId ?? GLOBAL_KEY;
@@ -2238,10 +2239,11 @@ class FilesClient extends AbstractRestClient {
2238
2239
  FilesClient_defineProperty(this, "defaultUrl", 'https://files.devana.pl');
2239
2240
  }
2240
2241
  async uploadFile(file) {
2242
+ const name = encodeURIComponent(file.name ?? '');
2241
2243
  let headers = {
2242
2244
  ...this.getAuthHeaders(),
2243
2245
  Accept: 'application/json',
2244
- 'Content-Disposition': `attachment; filename="${file.name ?? ''}"`,
2246
+ 'Content-Disposition': `attachment; filename="${name}"`,
2245
2247
  'Content-Length': file.size
2246
2248
  };
2247
2249
  const response = await fetch(this.getUrl('files'), {