@forge/realtime 0.2.3 → 0.3.0-next.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/CHANGELOG.md +12 -0
- package/out/publish.d.ts.map +1 -1
- package/out/publish.js +0 -6
- package/out/signRealtimeToken.d.ts.map +1 -1
- package/out/signRealtimeToken.js +0 -5
- package/out/utils.d.ts +0 -1
- package/out/utils.d.ts.map +1 -1
- package/out/utils.js +1 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @forge/realtime
|
|
2
2
|
|
|
3
|
+
## 0.3.0-next.1
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 1d129f0: Allow objects in event payloads. The object must be JSON-serializable.
|
|
8
|
+
|
|
9
|
+
## 0.3.0-next.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- b607fd6: Remove blocker for production apps
|
|
14
|
+
|
|
3
15
|
## 0.2.3
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/out/publish.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publish.d.ts","sourceRoot":"","sources":["../src/publish.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AA2BlD,UAAU,cAAc;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,cAAc,EAAE,CAAC;CACrC;AAED,eAAO,MAAM,OAAO,gBAAuB,MAAM,gBAAgB,MAAM,YAAY,cAAc;;;;;;;;
|
|
1
|
+
{"version":3,"file":"publish.d.ts","sourceRoot":"","sources":["../src/publish.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AA2BlD,UAAU,cAAc;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,cAAc,EAAE,CAAC;CACrC;AAED,eAAO,MAAM,OAAO,gBAAuB,MAAM,gBAAgB,MAAM,YAAY,cAAc;;;;;;;;EAyEhG,CAAC;AAEF,eAAO,MAAM,aAAa,gBAAuB,MAAM,gBAAgB,MAAM,YAAY,cAAc;;;;;;;;EA4DtG,CAAC"}
|
package/out/publish.js
CHANGED
|
@@ -27,9 +27,6 @@ const graphqlBody = `mutation publishRealtimeChannel(
|
|
|
27
27
|
}`;
|
|
28
28
|
const publish = async (channelName, eventPayload, options) => {
|
|
29
29
|
const { appContext, realtime } = (0, runtime_1.__getRuntime)();
|
|
30
|
-
if (appContext?.environmentType === 'PRODUCTION') {
|
|
31
|
-
throw new Error(utils_1.prodEnvErrorMessage);
|
|
32
|
-
}
|
|
33
30
|
const { token, contextOverrides } = options || {};
|
|
34
31
|
if (contextOverrides && !Array.isArray(contextOverrides)) {
|
|
35
32
|
throw new Error('Invalid value for contextOverrides. Please provide an array of valid context properties.');
|
|
@@ -90,9 +87,6 @@ const publish = async (channelName, eventPayload, options) => {
|
|
|
90
87
|
exports.publish = publish;
|
|
91
88
|
const publishGlobal = async (channelName, eventPayload, options) => {
|
|
92
89
|
const { appContext } = (0, runtime_1.__getRuntime)();
|
|
93
|
-
if (appContext?.environmentType === 'PRODUCTION') {
|
|
94
|
-
throw new Error(utils_1.prodEnvErrorMessage);
|
|
95
|
-
}
|
|
96
90
|
const response = await global.__forge_fetch__({
|
|
97
91
|
type: 'realtime'
|
|
98
92
|
}, '/', {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signRealtimeToken.d.ts","sourceRoot":"","sources":["../src/signRealtimeToken.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"signRealtimeToken.d.ts","sourceRoot":"","sources":["../src/signRealtimeToken.ts"],"names":[],"mappings":"AA2BA,eAAO,MAAM,iBAAiB,gBAAuB,MAAM,UAAU,GAAG;;;;;;;;EAuDvE,CAAC"}
|
package/out/signRealtimeToken.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.signRealtimeToken = void 0;
|
|
4
|
-
const runtime_1 = require("./runtime");
|
|
5
4
|
const utils_1 = require("./utils");
|
|
6
5
|
const graphqlBody = `mutation signRealtimeToken(
|
|
7
6
|
$channelName: String!
|
|
@@ -28,10 +27,6 @@ const graphqlBody = `mutation signRealtimeToken(
|
|
|
28
27
|
}
|
|
29
28
|
}`;
|
|
30
29
|
const signRealtimeToken = async (channelName, claims) => {
|
|
31
|
-
const { appContext } = (0, runtime_1.__getRuntime)();
|
|
32
|
-
if (appContext?.environmentType === 'PRODUCTION') {
|
|
33
|
-
throw new Error(utils_1.prodEnvErrorMessage);
|
|
34
|
-
}
|
|
35
30
|
const response = await global.__forge_fetch__({
|
|
36
31
|
type: 'realtime'
|
|
37
32
|
}, '/', {
|
package/out/utils.d.ts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
export declare const handleProxyResponseErrors: (response: Response) => void;
|
|
2
|
-
export declare const prodEnvErrorMessage = "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.";
|
|
3
2
|
//# sourceMappingURL=utils.d.ts.map
|
package/out/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,yBAAyB,aAAc,QAAQ,KAAG,IAK9D,CAAC
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,yBAAyB,aAAc,QAAQ,KAAG,IAK9D,CAAC"}
|
package/out/utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.handleProxyResponseErrors = void 0;
|
|
4
4
|
const api_1 = require("@forge/api");
|
|
5
5
|
const getForgeProxyError = (response) => response.headers.get('forge-proxy-error');
|
|
6
6
|
const handleProxyResponseErrors = (response) => {
|
|
@@ -10,4 +10,3 @@ const handleProxyResponseErrors = (response) => {
|
|
|
10
10
|
}
|
|
11
11
|
};
|
|
12
12
|
exports.handleProxyResponseErrors = handleProxyResponseErrors;
|
|
13
|
-
exports.prodEnvErrorMessage = '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.';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forge/realtime",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0-next.1",
|
|
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.1.
|
|
17
|
+
"@forge/api": "6.1.6-next.0",
|
|
18
18
|
"@types/node": "20.19.1"
|
|
19
19
|
},
|
|
20
20
|
"publishConfig": {
|