wirejs-deploy-amplify-basic 0.0.93-realtime → 0.0.95-realtime

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.
@@ -35,7 +35,7 @@ export class RealtimeService extends Construct {
35
35
  this.authHandler = new NodejsFunction(this, 'realtime-auth', {
36
36
  runtime: Runtime.NODEJS_22_X,
37
37
  handler: 'handler',
38
- entry: path.join(__dirname, 'handler-lambda.ts'),
38
+ entry: path.join(__dirname, 'authorizer-lambda.ts'),
39
39
  timeout: Duration.seconds(30),
40
40
  environment: {
41
41
  // must match wirejs-deploy-amplify-basic/wirejs-resources-overrides/services/realtime.ts:SECRET_ID
@@ -3,6 +3,6 @@
3
3
  "dependencies": {
4
4
  "jsdom": "^25.0.1",
5
5
  "wirejs-dom": "^1.0.41",
6
- "wirejs-resources": "^0.1.61-realtime"
6
+ "wirejs-resources": "^0.1.63-realtime"
7
7
  }
8
8
  }
@@ -7,6 +7,6 @@ export declare class RealtimeService<T = any> extends Resource {
7
7
  * The address the client will need to connect to.
8
8
  */
9
9
  get address(): string;
10
- publish(channel: string, events: T[]): Promise<void>;
10
+ publish(channel: string, data: T | T[]): Promise<void>;
11
11
  getStream(channel: string): Promise<any>;
12
12
  }
@@ -37,9 +37,10 @@ export class RealtimeService extends Resource {
37
37
  get address() {
38
38
  return `ws://${process.env.REALTIME_WS_DOMAIN}/event`;
39
39
  }
40
- async publish(channel, events) {
40
+ async publish(channel, data) {
41
41
  this.#validateChannelName(channel);
42
42
  console.log('Publishing to channels:', channel);
43
+ const events = Array.isArray(data) ? data : [data];
43
44
  // AppSync allows batches of no more than 5. Hence, if we have more than 5,
44
45
  // we need to perform batching on our end.
45
46
  if (events.length > 5) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wirejs-deploy-amplify-basic",
3
- "version": "0.0.93-realtime",
3
+ "version": "0.0.95-realtime",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -41,7 +41,7 @@
41
41
  "recursive-copy": "^2.0.14",
42
42
  "rimraf": "^6.0.1",
43
43
  "wirejs-dom": "^1.0.41",
44
- "wirejs-resources": "^0.1.61-realtime"
44
+ "wirejs-resources": "^0.1.63-realtime"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@aws-amplify/backend": "^1.14.0",