@forge/realtime 0.5.0-next.1-experimental-ad10820 → 0.5.0-next.2
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 +2 -6
- package/out/publish.d.ts.map +1 -1
- package/out/publish.js +19 -3
- package/out/signRealtimeToken.js +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
# @forge/realtime
|
|
2
2
|
|
|
3
|
-
## 0.5.0-next.
|
|
4
|
-
|
|
5
|
-
### Minor Changes
|
|
6
|
-
|
|
7
|
-
- 68e1229: Adds pre validation for the forge realtime token in publish methods
|
|
3
|
+
## 0.5.0-next.2
|
|
8
4
|
|
|
9
5
|
### Patch Changes
|
|
10
6
|
|
|
11
|
-
-
|
|
7
|
+
- 64e72aa: Updates error return to be consistent
|
|
12
8
|
|
|
13
9
|
## 0.5.0-next.1
|
|
14
10
|
|
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,mDACL,MAAM,sCAET,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,mDACL,MAAM,sCAET,cAAc;;;;;;;;EA2FzB,CAAC;AAEF,eAAO,MAAM,aAAa,mDACX,MAAM,sCAET,cAAc;;;;;;;;EAiFzB,CAAC"}
|
package/out/publish.js
CHANGED
|
@@ -34,7 +34,15 @@ const publish = async (channelName, eventPayload, options) => {
|
|
|
34
34
|
if (token) {
|
|
35
35
|
const { valid, error } = (0, utils_1.validateToken)(token, channelName);
|
|
36
36
|
if (!valid) {
|
|
37
|
-
return {
|
|
37
|
+
return {
|
|
38
|
+
eventId: null,
|
|
39
|
+
eventTimestamp: null,
|
|
40
|
+
errors: [
|
|
41
|
+
{
|
|
42
|
+
message: `Realtime token validation failed: ${error}`
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
};
|
|
38
46
|
}
|
|
39
47
|
}
|
|
40
48
|
const channelContext = contextOverrides
|
|
@@ -99,7 +107,15 @@ const publishGlobal = async (channelName, eventPayload, options) => {
|
|
|
99
107
|
if (token) {
|
|
100
108
|
const { valid, error } = (0, utils_1.validateToken)(token, channelName);
|
|
101
109
|
if (!valid) {
|
|
102
|
-
return {
|
|
110
|
+
return {
|
|
111
|
+
eventId: null,
|
|
112
|
+
eventTimestamp: null,
|
|
113
|
+
errors: [
|
|
114
|
+
{
|
|
115
|
+
message: `Realtime token validation failed: ${error}`
|
|
116
|
+
}
|
|
117
|
+
]
|
|
118
|
+
};
|
|
103
119
|
}
|
|
104
120
|
}
|
|
105
121
|
const response = await global.__forge_fetch__({
|
|
@@ -140,7 +156,7 @@ const publishGlobal = async (channelName, eventPayload, options) => {
|
|
|
140
156
|
eventTimestamp: null,
|
|
141
157
|
errors: [
|
|
142
158
|
{
|
|
143
|
-
message: 'Error publishing
|
|
159
|
+
message: 'Error publishing event to channel.'
|
|
144
160
|
}
|
|
145
161
|
]
|
|
146
162
|
};
|
package/out/signRealtimeToken.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forge/realtime",
|
|
3
|
-
"version": "0.5.0-next.
|
|
3
|
+
"version": "0.5.0-next.2",
|
|
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.2-next.0
|
|
17
|
+
"@forge/api": "^7.2.2-next.0",
|
|
18
18
|
"@types/node": "20.19.1"
|
|
19
19
|
},
|
|
20
20
|
"publishConfig": {
|