laravel-echo-api-gateway 0.5.2 → 0.5.4

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.
@@ -57,9 +57,9 @@ jobs:
57
57
  steps:
58
58
  - uses: actions/checkout@v2
59
59
  - name: Install dependencies
60
- run: yarn install
60
+ run: npm install
61
61
  - name: Run ESLint
62
- run: yarn run lint
62
+ run: npm run lint
63
63
 
64
64
  jest:
65
65
  runs-on: ubuntu-latest
@@ -70,9 +70,9 @@ jobs:
70
70
  with:
71
71
  node-version: '15'
72
72
  - name: Install dependencies
73
- run: yarn install
73
+ run: npm install
74
74
  - name: Run Jest
75
- run: yarn test --coverage --coverageDirectory=test-results/jest
75
+ run: npm run test --coverage --coverageDirectory=test-results/jest
76
76
  - name: Upload coverage to Codecov
77
77
  if: always()
78
78
  uses: codecov/codecov-action@v1
@@ -14,17 +14,17 @@ jobs:
14
14
  with:
15
15
  ref: ${{ github.event.release.target_commitish }}
16
16
  - name: Use Node.js 12
17
- uses: actions/setup-node@v1
17
+ uses: actions/setup-node@v4
18
18
  with:
19
- node-version: 12
19
+ node-version: 18
20
20
  registry-url: https://registry.npmjs.org/
21
- - run: yarn install --frozen-lockfile
21
+ - run: npm ci --verbose
22
22
  - run: git config --global user.name "GitHub CD bot"
23
23
  - run: git config --global user.email "github-cd-bot@github.com"
24
- - run: yarn version --new-version ${{ github.event.release.tag_name }} --no-git-tag-version
25
- # - run: yarn run build
26
- # - run: yarn test
27
- - run: yarn publish --verbose --access public --tag latest
24
+ - run: npm --no-git-tag-version version ${{ github.event.release.tag_name }}
25
+ # - run: npm run build
26
+ # - run: npm run test
27
+ - run: npm publish --verbose --access public --tag latest
28
28
  env:
29
29
  NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
30
30
  - run: git add package.json
@@ -37,31 +37,32 @@ export declare class Channel extends BaseChannel implements PresenceChannel {
37
37
  /**
38
38
  * Listen for an event on the channel instance.
39
39
  */
40
- listen(event: string, callback: Function): Channel;
40
+ listen(event: string, callback: Function): this;
41
41
  /**
42
42
  * Stop listening for an event on the channel instance.
43
43
  */
44
- stopListening(event: string, callback?: Function): Channel;
44
+ stopListening(event: string, callback?: Function): this;
45
45
  /**
46
46
  * Register a callback to be called anytime a subscription succeeds.
47
47
  */
48
- subscribed(callback: Function): Channel;
48
+ subscribed(callback: Function): this;
49
49
  /**
50
50
  * Register a callback to be called anytime a subscription error occurs.
51
51
  */
52
- error(callback: Function): Channel;
52
+ error(callback: Function): this;
53
53
  /**
54
54
  * Bind a channel to an event.
55
55
  */
56
56
  on(event: string, callback: Function): Channel;
57
- whisper(event: string, data: object): Channel;
58
- here(callback: Function): Channel;
57
+ whisper(event: string, data: object): this;
58
+ here(callback: Function): this;
59
59
  /**
60
60
  * Listen for someone joining the channel.
61
61
  */
62
- joining(callback: Function): Channel;
62
+ joining(callback: Function): this;
63
63
  /**
64
64
  * Listen for someone leaving the channel.
65
65
  */
66
- leaving(callback: Function): Channel;
66
+ leaving(callback: Function): this;
67
67
  }
68
+ export { PresenceChannel };
@@ -3,9 +3,6 @@ import { Websocket } from "./Websocket";
3
3
  import { Channel } from "./Channel";
4
4
  export declare const broadcaster: (options: object) => Connector;
5
5
  export declare class Connector extends BaseConnector {
6
- /**
7
- * The Socket.io connection instance.
8
- */
9
6
  socket: Websocket;
10
7
  /**
11
8
  * All of the subscribed channel names.
@@ -13,6 +10,10 @@ export declare class Connector extends BaseConnector {
13
10
  channels: {
14
11
  [name: string]: Channel;
15
12
  };
13
+ /**
14
+ * Create a new class instance.
15
+ */
16
+ constructor(options: any);
16
17
  /**
17
18
  * Create a fresh Socket.io connection.
18
19
  */
@@ -1,12 +1,12 @@
1
1
  import { Channel } from "./Channel";
2
- export declare type Options = {
2
+ export type Options = {
3
3
  authEndpoint: string;
4
4
  host: string;
5
5
  bearerToken: string;
6
6
  auth: any;
7
7
  debug: boolean;
8
8
  };
9
- export declare type MessageBody = {
9
+ export type MessageBody = {
10
10
  event: string;
11
11
  channel?: string;
12
12
  data: object;
@@ -22,8 +22,8 @@ export declare class Websocket {
22
22
  private closing;
23
23
  private hasConnected;
24
24
  private pingInterval;
25
- private connect;
26
25
  constructor(options: Options);
26
+ private connect;
27
27
  protected parseMessage(body: string): MessageBody;
28
28
  getSocketId(): string;
29
29
  private socketIsReady;