@stream-io/video-react-bindings 0.0.1-alpha.59 → 0.0.1-alpha.61

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/CHANGELOG.md CHANGED
@@ -2,6 +2,37 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [0.0.1-alpha.61](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-bindings-0.0.1-alpha.60...@stream-io/video-react-bindings-0.0.1-alpha.61) (2023-05-23)
6
+
7
+
8
+ ### Features
9
+
10
+ * Add useCallPermissionRequest hook ([#538](https://github.com/GetStream/stream-video-js/issues/538)) ([185af85](https://github.com/GetStream/stream-video-js/commit/185af854637befc06c2e9f4bd4a816a8f1d18faf))
11
+
12
+
13
+
14
+ ## [0.0.1-alpha.61](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-bindings-0.0.1-alpha.60...@stream-io/video-react-bindings-0.0.1-alpha.61) (2023-05-23)
15
+
16
+
17
+ ### Features
18
+
19
+ * Add useCallPermissionRequest hook ([#538](https://github.com/GetStream/stream-video-js/issues/538)) ([185af85](https://github.com/GetStream/stream-video-js/commit/185af854637befc06c2e9f4bd4a816a8f1d18faf))
20
+
21
+
22
+
23
+ ## [0.0.1-alpha.61](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-bindings-0.0.1-alpha.60...@stream-io/video-react-bindings-0.0.1-alpha.61) (2023-05-23)
24
+
25
+
26
+ ### Features
27
+
28
+ * Add useCallPermissionRequest hook ([#538](https://github.com/GetStream/stream-video-js/issues/538)) ([185af85](https://github.com/GetStream/stream-video-js/commit/185af854637befc06c2e9f4bd4a816a8f1d18faf))
29
+
30
+
31
+
32
+ ## [0.0.1-alpha.60](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-bindings-0.0.1-alpha.59...@stream-io/video-react-bindings-0.0.1-alpha.60) (2023-05-23)
33
+
34
+
35
+
5
36
  ## [0.0.1-alpha.59](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-bindings-0.0.1-alpha.58...@stream-io/video-react-bindings-0.0.1-alpha.59) (2023-05-22)
6
37
 
7
38
 
@@ -1,4 +1,4 @@
1
- import { OwnCapability } from '@stream-io/video-client';
1
+ import { OwnCapability, PermissionRequestEvent } from '@stream-io/video-client';
2
2
  /**
3
3
  * Hook that returns true if the current user has all the given permissions.
4
4
  *
@@ -13,3 +13,9 @@ export declare const useHasPermissions: (...permissions: OwnCapability[]) => boo
13
13
  * @category Call State
14
14
  */
15
15
  export declare const useOwnCapabilities: () => OwnCapability[];
16
+ /**
17
+ * A hook which returns the latest call permission request.
18
+ *
19
+ * @category Call State
20
+ */
21
+ export declare const useCallPermissionRequest: () => PermissionRequestEvent | undefined;
@@ -1,4 +1,6 @@
1
1
  import { useCallMetadata } from './call';
2
+ import { useCallState } from './store';
3
+ import { useObservableValue } from './helpers/useObservableValue';
2
4
  /**
3
5
  * Hook that returns true if the current user has all the given permissions.
4
6
  *
@@ -21,4 +23,13 @@ export const useOwnCapabilities = () => {
21
23
  const metadata = useCallMetadata();
22
24
  return (metadata === null || metadata === void 0 ? void 0 : metadata.own_capabilities) || [];
23
25
  };
26
+ /**
27
+ * A hook which returns the latest call permission request.
28
+ *
29
+ * @category Call State
30
+ */
31
+ export const useCallPermissionRequest = () => {
32
+ const { callPermissionRequest$ } = useCallState();
33
+ return useObservableValue(callPermissionRequest$);
34
+ };
24
35
  //# sourceMappingURL=permissions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"permissions.js","sourceRoot":"","sources":["../../../src/hooks/permissions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAEzC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,GAAG,WAA4B,EAAE,EAAE;IACnE,MAAM,QAAQ,GAAG,eAAe,EAAE,CAAC;IACnC,IAAI,CAAC,QAAQ;QAAE,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AAE,sBAAsB,EAAE,GAAG,YAAY,EAAE,CAAC;IAClD,OAAO,kBAAkB,CAAC,sBAAsB,CAAC,CAAC;AACpD,CAAC,CAAC"}
package/package.json CHANGED
@@ -23,13 +23,13 @@
23
23
  "rxjs": "~7.8.1"
24
24
  },
25
25
  "peerDependencies": {
26
- "@stream-io/i18n": "^0.0.1-alpha.48",
27
- "@stream-io/video-client": "^0.0.1-alpha.172",
26
+ "@stream-io/i18n": "^0.0.1-alpha.50",
27
+ "@stream-io/video-client": "^0.0.1-alpha.174",
28
28
  "react": ">=17.0.0"
29
29
  },
30
30
  "devDependencies": {
31
- "@stream-io/i18n": "^0.0.1-alpha.48",
32
- "@stream-io/video-client": "^0.0.1-alpha.172",
31
+ "@stream-io/i18n": "^0.0.1-alpha.50",
32
+ "@stream-io/video-client": "^0.0.1-alpha.174",
33
33
  "@types/react": "^18.0.26",
34
34
  "@types/rimraf": "^3.0.2",
35
35
  "react": "^18.2.0",
@@ -39,5 +39,5 @@
39
39
  "typedoc-plugin-markdown": "^3.15.3",
40
40
  "typescript": "^4.9.5"
41
41
  },
42
- "version": "0.0.1-alpha.59"
42
+ "version": "0.0.1-alpha.61"
43
43
  }
@@ -1,5 +1,7 @@
1
- import { OwnCapability } from '@stream-io/video-client';
1
+ import { OwnCapability, PermissionRequestEvent } from '@stream-io/video-client';
2
2
  import { useCallMetadata } from './call';
3
+ import { useCallState } from './store';
4
+ import { useObservableValue } from './helpers/useObservableValue';
3
5
 
4
6
  /**
5
7
  * Hook that returns true if the current user has all the given permissions.
@@ -25,3 +27,15 @@ export const useOwnCapabilities = (): OwnCapability[] => {
25
27
  const metadata = useCallMetadata();
26
28
  return metadata?.own_capabilities || [];
27
29
  };
30
+
31
+ /**
32
+ * A hook which returns the latest call permission request.
33
+ *
34
+ * @category Call State
35
+ */
36
+ export const useCallPermissionRequest = ():
37
+ | PermissionRequestEvent
38
+ | undefined => {
39
+ const { callPermissionRequest$ } = useCallState();
40
+ return useObservableValue(callPermissionRequest$);
41
+ };