@forge/realtime 1.0.0 → 1.0.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,11 @@
1
1
  # @forge/realtime
2
2
 
3
+ ## 1.0.1-next.0
4
+
5
+ ### Patch Changes
6
+
7
+ - 283c442: Tidy rate limit headers
8
+
3
9
  ## 1.0.0
4
10
 
5
11
  ### Major Changes
@@ -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;AAuED,eAAO,MAAM,OAAO,GAAU,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7D,aAAa,MAAM,EACnB,cAAc,MAAM,GAAG,CAAC,EACxB,UAAU,cAAc;;;;;;;;EA4BzB,CAAC;AAEF,eAAO,MAAM,aAAa,GAAU,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACnE,aAAa,MAAM,EACnB,cAAc,MAAM,GAAG,CAAC,EACxB,UAAU,cAAc;;;;;;;;EAqBzB,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;AAqED,eAAO,MAAM,OAAO,GAAU,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7D,aAAa,MAAM,EACnB,cAAc,MAAM,GAAG,CAAC,EACxB,UAAU,cAAc;;;;;;;;EA2BzB,CAAC;AAEF,eAAO,MAAM,aAAa,GAAU,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACnE,aAAa,MAAM,EACnB,cAAc,MAAM,GAAG,CAAC,EACxB,UAAU,cAAc;;;;;;;;EAoBzB,CAAC"}
package/out/publish.js CHANGED
@@ -36,16 +36,14 @@ const validateTokenOrReturnError = (token, channelName) => {
36
36
  }
37
37
  return null;
38
38
  };
39
- const executePublish = async (variables, contextToken, appId) => {
39
+ const executePublish = async (variables, contextToken) => {
40
40
  const response = await global.__forge_fetch__({ type: 'realtime' }, '/', {
41
41
  method: 'POST',
42
42
  body: JSON.stringify({ query: graphqlBody, variables }),
43
43
  errors: [],
44
44
  headers: {
45
45
  'Content-Type': 'application/json',
46
- 'x-forge-context-token': contextToken,
47
- 'x-rate-limit-app-id': appId,
48
- 'x-rate-limit-installation-id': variables.installationId
46
+ 'x-forge-context-token': contextToken
49
47
  }
50
48
  });
51
49
  (0, utils_1.handleProxyResponseErrors)(response);
@@ -95,7 +93,7 @@ const publish = async (channelName, eventPayload, options) => {
95
93
  payload: JSON.stringify(eventPayload),
96
94
  isGlobal: false,
97
95
  token
98
- }, realtime?.contextToken, appContext.appId);
96
+ }, realtime?.contextToken);
99
97
  };
100
98
  exports.publish = publish;
101
99
  const publishGlobal = async (channelName, eventPayload, options) => {
@@ -112,6 +110,6 @@ const publishGlobal = async (channelName, eventPayload, options) => {
112
110
  payload: JSON.stringify(eventPayload),
113
111
  isGlobal: true,
114
112
  token
115
- }, realtime?.contextToken, appContext.appId);
113
+ }, realtime?.contextToken);
116
114
  };
117
115
  exports.publishGlobal = publishGlobal;
@@ -1 +1 @@
1
- {"version":3,"file":"signRealtimeToken.d.ts","sourceRoot":"","sources":["../src/signRealtimeToken.ts"],"names":[],"mappings":"AA8BA,KAAK,gBAAgB,GAAG,WAAW,GAAG,SAAS,CAAC;AAChD,MAAM,MAAM,wBAAwB,GAAG,CAAC,gBAAgB,EAAE,GAAG,gBAAgB,EAAE,CAAC,CAAC;AAEjF,eAAO,MAAM,iBAAiB,GAC5B,aAAa,MAAM,EAEnB,QAAQ,GAAG,EACX,cAAc,wBAAwB;;;;;;;;EA0EvC,CAAC"}
1
+ {"version":3,"file":"signRealtimeToken.d.ts","sourceRoot":"","sources":["../src/signRealtimeToken.ts"],"names":[],"mappings":"AA8BA,KAAK,gBAAgB,GAAG,WAAW,GAAG,SAAS,CAAC;AAChD,MAAM,MAAM,wBAAwB,GAAG,CAAC,gBAAgB,EAAE,GAAG,gBAAgB,EAAE,CAAC,CAAC;AAEjF,eAAO,MAAM,iBAAiB,GAC5B,aAAa,MAAM,EAEnB,QAAQ,GAAG,EACX,cAAc,wBAAwB;;;;;;;;EAsEvC,CAAC"}
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.signRealtimeToken = void 0;
4
4
  const utils_1 = require("./utils");
5
- const runtime_1 = require("./runtime");
6
5
  const graphqlBody = `mutation signRealtimeToken(
7
6
  $channelName: String!
8
7
  $claims: JSON!
@@ -30,7 +29,6 @@ const graphqlBody = `mutation signRealtimeToken(
30
29
  }
31
30
  }`;
32
31
  const signRealtimeToken = async (channelName, claims, permissions) => {
33
- const { appContext } = (0, runtime_1.__getRuntime)();
34
32
  const response = await global.__forge_fetch__({
35
33
  type: 'realtime'
36
34
  }, '/', {
@@ -45,9 +43,7 @@ const signRealtimeToken = async (channelName, claims, permissions) => {
45
43
  }),
46
44
  errors: [],
47
45
  headers: {
48
- 'Content-Type': 'application/json',
49
- 'x-rate-limit-app-id': appContext.appId,
50
- 'x-rate-limit-installation-id': appContext.installationId
46
+ 'Content-Type': 'application/json'
51
47
  }
52
48
  });
53
49
  (0, utils_1.handleProxyResponseErrors)(response);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/realtime",
3
- "version": "1.0.0",
3
+ "version": "1.0.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": "^8.0.0",
17
+ "@forge/api": "^8.0.3-next.0",
18
18
  "@types/node": "20.19.1",
19
19
  "typescript": "5.9.2"
20
20
  },