@forge/realtime 0.3.0-next.1 → 0.3.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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @forge/realtime
2
2
 
3
+ ## 0.3.0-next.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 80ed8eb: Support object payloads in published events
8
+
3
9
  ## 0.3.0-next.1
4
10
 
5
11
  ### Minor Changes
package/out/publish.d.ts CHANGED
@@ -3,7 +3,7 @@ interface PublishOptions {
3
3
  token?: string;
4
4
  contextOverrides?: ProductContext[];
5
5
  }
6
- export declare const publish: (channelName: string, eventPayload: string, options?: PublishOptions) => Promise<{
6
+ export declare const publish: <T extends Record<string, unknown>>(channelName: string, eventPayload: string | T, options?: PublishOptions) => Promise<{
7
7
  eventId: null;
8
8
  eventTimestamp: null;
9
9
  errors: any;
@@ -12,7 +12,7 @@ export declare const publish: (channelName: string, eventPayload: string, option
12
12
  eventTimestamp: any;
13
13
  errors?: undefined;
14
14
  }>;
15
- export declare const publishGlobal: (channelName: string, eventPayload: string, options?: PublishOptions) => Promise<{
15
+ export declare const publishGlobal: <T extends Record<string, unknown>>(channelName: string, eventPayload: string | T, options?: PublishOptions) => Promise<{
16
16
  eventId: null;
17
17
  eventTimestamp: null;
18
18
  errors: any;
@@ -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;;;;;;;;EAyEhG,CAAC;AAEF,eAAO,MAAM,aAAa,gBAAuB,MAAM,gBAAgB,MAAM,YAAY,cAAc;;;;;;;;EA4DtG,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;;;;;;;;EA0EzB,CAAC;AAEF,eAAO,MAAM,aAAa,mDACX,MAAM,sCAET,cAAc;;;;;;;;EA6DzB,CAAC"}
package/out/publish.js CHANGED
@@ -46,7 +46,7 @@ const publish = async (channelName, eventPayload, options) => {
46
46
  installationId: appContext.installationId,
47
47
  name: channelName,
48
48
  context: channelContext,
49
- payload: eventPayload,
49
+ payload: JSON.stringify(eventPayload),
50
50
  isGlobal: false,
51
51
  token: token
52
52
  }
@@ -96,7 +96,7 @@ const publishGlobal = async (channelName, eventPayload, options) => {
96
96
  variables: {
97
97
  installationId: appContext.installationId,
98
98
  name: channelName,
99
- payload: eventPayload,
99
+ payload: JSON.stringify(eventPayload),
100
100
  isGlobal: true,
101
101
  token: options?.token
102
102
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/realtime",
3
- "version": "0.3.0-next.1",
3
+ "version": "0.3.0-next.2",
4
4
  "description": "Forge realtime",
5
5
  "main": "out/index.js",
6
6
  "types": "out/index.d.ts",