@forge/realtime 0.0.4 → 0.0.5-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,11 @@
1
1
  # @forge/realtime
2
2
 
3
+ ## 0.0.5-next.0
4
+
5
+ ### Patch Changes
6
+
7
+ - 75203c4: Enabled realtime use for Forge apps deployed in non-production environments
8
+
3
9
  ## 0.0.4
4
10
 
5
11
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/realtime",
3
- "version": "0.0.4",
3
+ "version": "0.0.5-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": "6.0.2",
17
+ "@forge/api": "6.0.3-next.0",
18
18
  "@types/node": "20.19.1"
19
19
  },
20
20
  "publishConfig": {
package/src/publish.ts CHANGED
@@ -13,6 +13,11 @@ export const handleProxyResponseErrors = (response: Response): void => {
13
13
  export const publish = async (channelName: string, eventPayload: string) => {
14
14
  const { contextAri, appContext } = __getRuntime();
15
15
 
16
+ if (appContext?.environmentType === 'PRODUCTION') {
17
+ throw new Error(
18
+ 'Forge realtime usage is restricted to Forge apps in a non-production environment. Please see https://developer.atlassian.com/platform/forge/cli-reference/environments/ for reference on Forge app environments.'
19
+ );
20
+ }
16
21
  // Do not change the whitespace of the context object it has to be this exactly to match https://bitbucket.org/atlassian/app-client-events-service/src/master/
17
22
  const graphqlBody = `mutation publishRealtimeChannel(
18
23
  $installationId: ID!