@matrix-widget-toolkit/api 3.3.1 → 3.4.0

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/build/index.d.ts CHANGED
@@ -4,6 +4,7 @@
4
4
  */
5
5
 
6
6
  import { Capability } from 'matrix-widget-api';
7
+ import { IDownloadFileActionFromWidgetResponseData } from 'matrix-widget-api';
7
8
  import { IGetMediaConfigActionFromWidgetResponseData } from 'matrix-widget-api';
8
9
  import { IModalWidgetCreateData } from 'matrix-widget-api';
9
10
  import { IModalWidgetOpenRequestDataButton } from 'matrix-widget-api';
@@ -758,6 +759,12 @@ export declare type WidgetApi = {
758
759
  * @returns Resolves to the location of the uploaded file.
759
760
  */
760
761
  uploadFile(file: XMLHttpRequestBodyInit): Promise<IUploadFileActionFromWidgetResponseData>;
762
+ /**
763
+ * Download a file to the media repository on the homeserver.
764
+ * @param contentUrl - MXC URI of the file to download
765
+ * @returns resolves to an object with: file - the file contents
766
+ */
767
+ downloadFile(contentUrl: string): Promise<IDownloadFileActionFromWidgetResponseData>;
761
768
  };
762
769
 
763
770
  /**
@@ -918,6 +925,8 @@ export declare class WidgetApiImpl implements WidgetApi {
918
925
  getMediaConfig(): Promise<IGetMediaConfigActionFromWidgetResponseData>;
919
926
  /** {@inheritdoc WidgetApi.uploadFile} */
920
927
  uploadFile(file: XMLHttpRequestBodyInit): Promise<IUploadFileActionFromWidgetResponseData>;
928
+ /** {@inheritdoc WidgetApi.downloadFile} */
929
+ downloadFile(contentUrl: string): Promise<IDownloadFileActionFromWidgetResponseData>;
921
930
  }
922
931
 
923
932
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@matrix-widget-toolkit/api",
3
- "version": "3.3.1",
3
+ "version": "3.4.0",
4
4
  "description": "A simplified layer on top of matrix-widget-api to use build widgets.",
5
5
  "author": "Nordeck IT + Consulting GmbH",
6
6
  "license": "Apache-2.0",
@@ -9,17 +9,18 @@
9
9
  "types": "./build/index.d.ts",
10
10
  "devDependencies": {
11
11
  "@craco/craco": "^7.1.0",
12
+ "@rollup/plugin-commonjs": "^26.0.1",
12
13
  "@types/jest": "^27.5.2",
13
14
  "@types/node": "^20.8.6",
14
- "@types/qs": "^6.9.8",
15
- "typescript": "^5.2.2"
15
+ "@types/qs": "^6.9.15",
16
+ "typescript": "^5.5.3"
16
17
  },
17
18
  "scripts": {
18
19
  "build": "tsc && rollup --config ../../rollup.config.mjs",
19
20
  "tsc": "tsc",
20
21
  "lint": "eslint .",
21
22
  "test": "jest --watch",
22
- "depcheck": "depcheck --ignores=@types/jest,@types/node --ignore-dirs=lib",
23
+ "depcheck": "depcheck --ignores=@types/jest,@types/node,@rollup/plugin-commonjs --ignore-dirs=lib",
23
24
  "prepack": "node ../../scripts/prepack.js",
24
25
  "postpack": "node ../../scripts/postpack.js",
25
26
  "translate": "echo \"Nothing to translate\"",
@@ -27,8 +28,8 @@
27
28
  "generate-api-report": "tsc && api-extractor run --verbose --local"
28
29
  },
29
30
  "dependencies": {
30
- "matrix-widget-api": "^1.6.0",
31
- "qs": "^6.11.2",
31
+ "matrix-widget-api": "^1.9.0",
32
+ "qs": "^6.13.0",
32
33
  "rxjs": "^7.8.1"
33
34
  },
34
35
  "repository": {