polfan-server-js-client 0.2.37 → 0.2.39
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/.idea/workspace.xml +36 -4
- package/build/index.cjs.js +8 -8
- package/build/index.cjs.js.map +1 -1
- package/build/index.umd.js +1 -1
- package/build/index.umd.js.map +1 -1
- package/build/types/FilesClient.d.ts +1 -1
- package/package.json +1 -1
- package/src/FilesClient.ts +17 -11
package/.idea/workspace.xml
CHANGED
|
@@ -4,7 +4,8 @@
|
|
|
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="
|
|
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" />
|
|
8
9
|
<change beforePath="$PROJECT_DIR$/src/FilesClient.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/FilesClient.ts" afterDir="false" />
|
|
9
10
|
</list>
|
|
10
11
|
<option name="SHOW_DIALOG" value="false" />
|
|
@@ -27,6 +28,18 @@
|
|
|
27
28
|
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
|
28
29
|
<option name="ROOT_SYNC" value="DONT_SYNC" />
|
|
29
30
|
</component>
|
|
31
|
+
<component name="GitHubPullRequestSearchHistory">{
|
|
32
|
+
"lastFilter": {
|
|
33
|
+
"state": "OPEN",
|
|
34
|
+
"assignee": "szado"
|
|
35
|
+
}
|
|
36
|
+
}</component>
|
|
37
|
+
<component name="GithubPullRequestsUISettings">{
|
|
38
|
+
"selectedUrlAndAccountId": {
|
|
39
|
+
"url": "https://github.com/szado/pserv-ts-types",
|
|
40
|
+
"accountId": "3584fcfe-fe67-4c7c-94f9-c35acfe7b7c6"
|
|
41
|
+
}
|
|
42
|
+
}</component>
|
|
30
43
|
<component name="PhpWorkspaceProjectConfiguration" interpreter_name="C:\php\php.exe" />
|
|
31
44
|
<component name="ProjectColorInfo">{
|
|
32
45
|
"associatedIndex": 5
|
|
@@ -106,7 +119,9 @@
|
|
|
106
119
|
<workItem from="1751561070286" duration="2044000" />
|
|
107
120
|
<workItem from="1751802125669" duration="1542000" />
|
|
108
121
|
<workItem from="1751811595978" duration="792000" />
|
|
109
|
-
<workItem from="1752705788150" duration="
|
|
122
|
+
<workItem from="1752705788150" duration="3566000" />
|
|
123
|
+
<workItem from="1752756543261" duration="1956000" />
|
|
124
|
+
<workItem from="1752834023436" duration="1731000" />
|
|
110
125
|
</task>
|
|
111
126
|
<task id="LOCAL-00001" summary="Emoticons objects">
|
|
112
127
|
<option name="closed" value="true" />
|
|
@@ -420,7 +435,23 @@
|
|
|
420
435
|
<option name="project" value="LOCAL" />
|
|
421
436
|
<updated>1751562062024</updated>
|
|
422
437
|
</task>
|
|
423
|
-
<
|
|
438
|
+
<task id="LOCAL-00040" summary="Adapt FilesClient to new files API">
|
|
439
|
+
<option name="closed" value="true" />
|
|
440
|
+
<created>1752752404949</created>
|
|
441
|
+
<option name="number" value="00040" />
|
|
442
|
+
<option name="presentableId" value="LOCAL-00040" />
|
|
443
|
+
<option name="project" value="LOCAL" />
|
|
444
|
+
<updated>1752752404949</updated>
|
|
445
|
+
</task>
|
|
446
|
+
<task id="LOCAL-00041" summary="Adapt FilesClient to new files API">
|
|
447
|
+
<option name="closed" value="true" />
|
|
448
|
+
<created>1752756683365</created>
|
|
449
|
+
<option name="number" value="00041" />
|
|
450
|
+
<option name="presentableId" value="LOCAL-00041" />
|
|
451
|
+
<option name="project" value="LOCAL" />
|
|
452
|
+
<updated>1752756683365</updated>
|
|
453
|
+
</task>
|
|
454
|
+
<option name="localTasksCounter" value="42" />
|
|
424
455
|
<servers />
|
|
425
456
|
</component>
|
|
426
457
|
<component name="TypeScriptGeneratedFilesManager">
|
|
@@ -461,6 +492,7 @@
|
|
|
461
492
|
<MESSAGE value="New message type" />
|
|
462
493
|
<MESSAGE value="Dedicated event for user status change" />
|
|
463
494
|
<MESSAGE value="Fix update the latest message in a room default topic" />
|
|
464
|
-
<
|
|
495
|
+
<MESSAGE value="Adapt FilesClient to new files API" />
|
|
496
|
+
<option name="LAST_COMMIT_MESSAGE" value="Adapt FilesClient to new files API" />
|
|
465
497
|
</component>
|
|
466
498
|
</project>
|
package/build/index.cjs.js
CHANGED
|
@@ -2235,29 +2235,29 @@ function FilesClient_toPrimitive(input, hint) { if (typeof input !== "object" ||
|
|
|
2235
2235
|
class FilesClient extends AbstractRestClient {
|
|
2236
2236
|
constructor(...args) {
|
|
2237
2237
|
super(...args);
|
|
2238
|
-
FilesClient_defineProperty(this, "defaultUrl", 'https://files.devana.pl
|
|
2238
|
+
FilesClient_defineProperty(this, "defaultUrl", 'https://files.devana.pl');
|
|
2239
2239
|
}
|
|
2240
2240
|
async uploadFile(file) {
|
|
2241
|
-
const formData = new FormData();
|
|
2242
|
-
formData.append('file', file);
|
|
2243
2241
|
let headers = {
|
|
2244
2242
|
...this.getAuthHeaders(),
|
|
2245
|
-
Accept: 'application/json'
|
|
2243
|
+
Accept: 'application/json',
|
|
2244
|
+
'Content-Disposition': `attachment; filename="${file.name ?? ''}"`,
|
|
2245
|
+
'Content-Length': file.size
|
|
2246
2246
|
};
|
|
2247
|
-
const response = await fetch(this.
|
|
2247
|
+
const response = await fetch(this.getUrl('files'), {
|
|
2248
2248
|
method: 'POST',
|
|
2249
|
-
body:
|
|
2249
|
+
body: file,
|
|
2250
2250
|
headers
|
|
2251
2251
|
});
|
|
2252
2252
|
return this.convertFetchResponse(response);
|
|
2253
2253
|
}
|
|
2254
2254
|
async getFileMeta(id) {
|
|
2255
|
-
return this.send('GET', '/' + id);
|
|
2255
|
+
return this.send('GET', 'files/' + id);
|
|
2256
2256
|
}
|
|
2257
2257
|
async getFileMetaBulk(ids) {
|
|
2258
2258
|
const searchParams = new URLSearchParams();
|
|
2259
2259
|
ids.forEach(id => searchParams.append('id[]', id));
|
|
2260
|
-
return this.send('GET', '?' + searchParams);
|
|
2260
|
+
return this.send('GET', 'files?' + searchParams);
|
|
2261
2261
|
}
|
|
2262
2262
|
}
|
|
2263
2263
|
;// CONCATENATED MODULE: ./src/index.ts
|