@matrix-widget-toolkit/api 3.1.0 → 3.2.1
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/cjs/index.js +23 -0
- package/build/esm/index.js +23 -0
- package/build/index.d.ts +27 -0
- package/package.json +5 -5
package/build/cjs/index.js
CHANGED
|
@@ -1632,6 +1632,29 @@ var WidgetApiImpl = /** @class */ (function () {
|
|
|
1632
1632
|
});
|
|
1633
1633
|
}));
|
|
1634
1634
|
};
|
|
1635
|
+
/** {@inheritdoc WidgetApi.searchUserDirectory} */
|
|
1636
|
+
WidgetApiImpl.prototype.searchUserDirectory = function (searchTerm, options) {
|
|
1637
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1638
|
+
var results;
|
|
1639
|
+
return __generator(this, function (_a) {
|
|
1640
|
+
switch (_a.label) {
|
|
1641
|
+
case 0: return [4 /*yield*/, this.matrixWidgetApi.searchUserDirectory(searchTerm, options === null || options === void 0 ? void 0 : options.limit)];
|
|
1642
|
+
case 1:
|
|
1643
|
+
results = (_a.sent()).results;
|
|
1644
|
+
return [2 /*return*/, {
|
|
1645
|
+
results: results.map(function (_a) {
|
|
1646
|
+
var user_id = _a.user_id, display_name = _a.display_name, avatar_url = _a.avatar_url;
|
|
1647
|
+
return ({
|
|
1648
|
+
userId: user_id,
|
|
1649
|
+
displayName: display_name,
|
|
1650
|
+
avatarUrl: avatar_url,
|
|
1651
|
+
});
|
|
1652
|
+
}),
|
|
1653
|
+
}];
|
|
1654
|
+
}
|
|
1655
|
+
});
|
|
1656
|
+
});
|
|
1657
|
+
};
|
|
1635
1658
|
return WidgetApiImpl;
|
|
1636
1659
|
}());
|
|
1637
1660
|
|
package/build/esm/index.js
CHANGED
|
@@ -1630,6 +1630,29 @@ var WidgetApiImpl = /** @class */ (function () {
|
|
|
1630
1630
|
});
|
|
1631
1631
|
}));
|
|
1632
1632
|
};
|
|
1633
|
+
/** {@inheritdoc WidgetApi.searchUserDirectory} */
|
|
1634
|
+
WidgetApiImpl.prototype.searchUserDirectory = function (searchTerm, options) {
|
|
1635
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1636
|
+
var results;
|
|
1637
|
+
return __generator(this, function (_a) {
|
|
1638
|
+
switch (_a.label) {
|
|
1639
|
+
case 0: return [4 /*yield*/, this.matrixWidgetApi.searchUserDirectory(searchTerm, options === null || options === void 0 ? void 0 : options.limit)];
|
|
1640
|
+
case 1:
|
|
1641
|
+
results = (_a.sent()).results;
|
|
1642
|
+
return [2 /*return*/, {
|
|
1643
|
+
results: results.map(function (_a) {
|
|
1644
|
+
var user_id = _a.user_id, display_name = _a.display_name, avatar_url = _a.avatar_url;
|
|
1645
|
+
return ({
|
|
1646
|
+
userId: user_id,
|
|
1647
|
+
displayName: display_name,
|
|
1648
|
+
avatarUrl: avatar_url,
|
|
1649
|
+
});
|
|
1650
|
+
}),
|
|
1651
|
+
}];
|
|
1652
|
+
}
|
|
1653
|
+
});
|
|
1654
|
+
});
|
|
1655
|
+
};
|
|
1633
1656
|
return WidgetApiImpl;
|
|
1634
1657
|
}());
|
|
1635
1658
|
|
package/build/index.d.ts
CHANGED
|
@@ -727,6 +727,23 @@ export declare type WidgetApi = {
|
|
|
727
727
|
* servers, if available.
|
|
728
728
|
*/
|
|
729
729
|
observeTurnServers(): Observable<TurnServer>;
|
|
730
|
+
/**
|
|
731
|
+
* Search for users in the user directory.
|
|
732
|
+
*
|
|
733
|
+
* @param searchTerm - The term to search for.
|
|
734
|
+
* @param options - Options for searching.
|
|
735
|
+
* Use `limit` to limit the number of results to return.
|
|
736
|
+
* @returns The search results.
|
|
737
|
+
*/
|
|
738
|
+
searchUserDirectory(searchTerm: string, options?: {
|
|
739
|
+
limit?: number;
|
|
740
|
+
}): Promise<{
|
|
741
|
+
results: Array<{
|
|
742
|
+
userId: string;
|
|
743
|
+
displayName?: string;
|
|
744
|
+
avatarUrl?: string;
|
|
745
|
+
}>;
|
|
746
|
+
}>;
|
|
730
747
|
};
|
|
731
748
|
|
|
732
749
|
/**
|
|
@@ -873,6 +890,16 @@ export declare class WidgetApiImpl implements WidgetApi {
|
|
|
873
890
|
private requestOpenIDConnectTokenInternal;
|
|
874
891
|
/** {@inheritdoc WidgetApi.observeTurnServers} */
|
|
875
892
|
observeTurnServers(): Observable<TurnServer>;
|
|
893
|
+
/** {@inheritdoc WidgetApi.searchUserDirectory} */
|
|
894
|
+
searchUserDirectory(searchTerm: string, options?: {
|
|
895
|
+
limit?: number | undefined;
|
|
896
|
+
} | undefined): Promise<{
|
|
897
|
+
results: Array<{
|
|
898
|
+
userId: string;
|
|
899
|
+
displayName?: string;
|
|
900
|
+
avatarUrl?: string;
|
|
901
|
+
}>;
|
|
902
|
+
}>;
|
|
876
903
|
}
|
|
877
904
|
|
|
878
905
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@matrix-widget-toolkit/api",
|
|
3
|
-
"version": "3.1
|
|
3
|
+
"version": "3.2.1",
|
|
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",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"devDependencies": {
|
|
11
11
|
"@craco/craco": "^6.4.5",
|
|
12
12
|
"@types/jest": "^27.5.2",
|
|
13
|
-
"@types/node": "^16.18.
|
|
13
|
+
"@types/node": "^16.18.34",
|
|
14
14
|
"@types/qs": "^6.9.7",
|
|
15
15
|
"typescript": "^4.8.4"
|
|
16
16
|
},
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"generate-api-report": "tsc && api-extractor run --verbose --local"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"matrix-widget-api": "^1.
|
|
31
|
-
"qs": "^6.11.
|
|
32
|
-
"rxjs": "^7.8.
|
|
30
|
+
"matrix-widget-api": "^1.3.1",
|
|
31
|
+
"qs": "^6.11.2",
|
|
32
|
+
"rxjs": "^7.8.1"
|
|
33
33
|
},
|
|
34
34
|
"repository": {
|
|
35
35
|
"type": "git",
|