@forge/realtime 0.4.1 → 0.4.2-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.4.2-next.0
4
+
5
+ ### Patch Changes
6
+
7
+ - 4c69f6e: Add headers for rate limits
8
+
3
9
  ## 0.4.1
4
10
 
5
11
  ### Patch 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;AAED,eAAO,MAAM,OAAO,mDACL,MAAM,sCAET,cAAc;;;;;;;;EA0EzB,CAAC;AAEF,eAAO,MAAM,aAAa,mDACX,MAAM,sCAET,cAAc;;;;;;;;EA6DzB,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;;;;;;;;EA4EzB,CAAC;AAEF,eAAO,MAAM,aAAa,mDACX,MAAM,sCAET,cAAc;;;;;;;;EAgEzB,CAAC"}
package/out/publish.js CHANGED
@@ -54,7 +54,9 @@ const publish = async (channelName, eventPayload, options) => {
54
54
  errors: [],
55
55
  headers: {
56
56
  'Content-Type': 'application/json',
57
- 'x-forge-context-token': realtime?.contextToken
57
+ 'x-forge-context-token': realtime?.contextToken,
58
+ 'x-rate-limit-app-id': appContext.appId,
59
+ 'x-rate-limit-installation-id': appContext.installationId
58
60
  }
59
61
  });
60
62
  (0, utils_1.handleProxyResponseErrors)(response);
@@ -86,7 +88,7 @@ const publish = async (channelName, eventPayload, options) => {
86
88
  };
87
89
  exports.publish = publish;
88
90
  const publishGlobal = async (channelName, eventPayload, options) => {
89
- const { appContext } = (0, runtime_1.__getRuntime)();
91
+ const { appContext, realtime } = (0, runtime_1.__getRuntime)();
90
92
  const response = await global.__forge_fetch__({
91
93
  type: 'realtime'
92
94
  }, '/', {
@@ -103,7 +105,10 @@ const publishGlobal = async (channelName, eventPayload, options) => {
103
105
  }),
104
106
  errors: [],
105
107
  headers: {
106
- 'Content-Type': 'application/json'
108
+ 'Content-Type': 'application/json',
109
+ 'x-forge-context-token': realtime?.contextToken,
110
+ 'x-rate-limit-app-id': appContext.appId,
111
+ 'x-rate-limit-installation-id': appContext.installationId
107
112
  }
108
113
  });
109
114
  (0, utils_1.handleProxyResponseErrors)(response);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/realtime",
3
- "version": "0.4.1",
3
+ "version": "0.4.2-next.0",
4
4
  "description": "Forge realtime",
5
5
  "main": "out/index.js",
6
6
  "types": "out/index.d.ts",