@forge/realtime 0.4.0-next.2 → 0.4.1-next.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/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @forge/realtime
2
2
 
3
+ ## 0.4.1-next.0
4
+
5
+ ### Patch Changes
6
+
7
+ - 15f7630: Adds optional permissions field to the signRealtimeToken API
8
+
9
+ ## 0.4.0
10
+
11
+ ### Patch Changes
12
+
13
+ - 0643bc3: No changes
14
+ - 7d660c1: Update isActive -> active in License
15
+
3
16
  ## 0.4.0-next.2
4
17
 
5
18
  ### Patch Changes
@@ -1,4 +1,5 @@
1
- export declare const signRealtimeToken: (channelName: string, claims: any) => Promise<{
1
+ declare type RealtimeTokenPermissions = ['subscribe'] | ['publish'] | ['subscribe', 'publish'] | ['publish', 'subscribe'];
2
+ export declare const signRealtimeToken: (channelName: string, claims: any, permissions?: RealtimeTokenPermissions) => Promise<{
2
3
  token: null;
3
4
  expiresAt: null;
4
5
  errors: any;
@@ -7,4 +8,5 @@ export declare const signRealtimeToken: (channelName: string, claims: any) => Pr
7
8
  expiresAt: any;
8
9
  errors?: undefined;
9
10
  }>;
11
+ export {};
10
12
  //# sourceMappingURL=signRealtimeToken.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"signRealtimeToken.d.ts","sourceRoot":"","sources":["../src/signRealtimeToken.ts"],"names":[],"mappings":"AA2BA,eAAO,MAAM,iBAAiB,gBACf,MAAM,UAEX,GAAG;;;;;;;;EAwDZ,CAAC"}
1
+ {"version":3,"file":"signRealtimeToken.d.ts","sourceRoot":"","sources":["../src/signRealtimeToken.ts"],"names":[],"mappings":"AA6BA,aAAK,wBAAwB,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,WAAW,EAAE,SAAS,CAAC,GAAG,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;AAElH,eAAO,MAAM,iBAAiB,gBACf,MAAM,UAEX,GAAG,gBACG,wBAAwB;;;;;;;;EAyDvC,CAAC"}
@@ -5,11 +5,13 @@ const utils_1 = require("./utils");
5
5
  const graphqlBody = `mutation signRealtimeToken(
6
6
  $channelName: String!
7
7
  $claims: JSON!
8
+ $permissions: [RealtimeTokenPermission!]
8
9
  ){
9
10
  ecosystem {
10
11
  signRealtimeToken(
11
12
  channelName: $channelName
12
13
  claims: $claims
14
+ permissions: $permissions
13
15
  ) {
14
16
  errors {
15
17
  message
@@ -26,7 +28,7 @@ const graphqlBody = `mutation signRealtimeToken(
26
28
  }
27
29
  }
28
30
  }`;
29
- const signRealtimeToken = async (channelName, claims) => {
31
+ const signRealtimeToken = async (channelName, claims, permissions) => {
30
32
  const response = await global.__forge_fetch__({
31
33
  type: 'realtime'
32
34
  }, '/', {
@@ -35,7 +37,8 @@ const signRealtimeToken = async (channelName, claims) => {
35
37
  query: graphqlBody,
36
38
  variables: {
37
39
  channelName,
38
- claims
40
+ claims,
41
+ permissions
39
42
  }
40
43
  }),
41
44
  errors: [],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/realtime",
3
- "version": "0.4.0-next.2",
3
+ "version": "0.4.1-next.0",
4
4
  "description": "Forge realtime",
5
5
  "main": "out/index.js",
6
6
  "types": "out/index.d.ts",
@@ -14,7 +14,7 @@
14
14
  },
15
15
  "devDependencies": {
16
16
  "@atlassian/metrics-interface": "4.0.0",
17
- "@forge/api": "^7.2.0-next.1",
17
+ "@forge/api": "^7.2.1-next.1",
18
18
  "@types/node": "20.19.1"
19
19
  },
20
20
  "publishConfig": {