Skip to content

Commit

Permalink
Deployment (#840)
Browse files Browse the repository at this point in the history
* ci(restapi): 🎉 cut release to restapi-v1.0.0

* fix(component): dummy

* ci(restapi): 🎉 cut release to restapi-v1.0.0

* fix(component): dummy

* ci(restapi): 🎉 cut release to restapi-v1.0.1

* ci(restapi): 🎉 cut release to restapi-v1.0.1

* fix(component): dummy

* ci(restapi): 🎉 cut release to restapi-v1.0.2

* fix(component): dummy

* ci(restapi): 🎉 cut release to restapi-v1.0.2

* fix(component): dummy

* ci(restapi): 🎉 cut release to restapi-v1.0.3

* fix: success progressHook

* ci(restapi): 🎉 cut release to restapi-v1.0.4

* ci(restapi): 🎉 cut release to restapi-v1.1.0

* ci(restapi): 🎉 cut release to restapi-v1.2.0

* ci(restapi): 🎉 cut release to restapi-v1.2.0

* ci(restapi): 🎉 cut release to restapi-v1.0.0

* fix(component): dummy

* fix(component): dummy

* fix(component): dummy

* ci(restapi): 🎉 cut release to restapi-v1.0.2

* fix(component): dummy

* ci(restapi): 🎉 cut release to restapi-v1.0.3

* ci(restapi): 🎉 cut release to restapi-v1.0.4

* ci(restapi): 🎉 cut release to restapi-v1.2.1

* fix: local for local development (#295)

Co-Authored-By: aman035 <[email protected]>

* fix: version update

* ci(restapi): 🎉 cut release to restapi-v1.2.2

* ci(restapi): 🎉 cut release to restapi-v1.2.3

* ci(restapi): 🎉 cut release to restapi-v1.2.4

* ci(restapi): 🎉 cut release to restapi-v1.2.5

* ci(restapi): 🎉 cut release to restapi-v1.2.6

* ci(restapi): 🎉 cut release to restapi-v1.2.7

* ci(socket): 🎉 cut release to socket-v0.5.0

* fix: test commit

* ci(restapi): 🎉 cut release to restapi-v1.2.8

* ci(uiweb): 🎉 cut release to uiweb-v1.0.0

* ci(uiweb): 🎉 cut release to uiweb-v1.0.0

* ci(uiweb): 🎉 cut release to uiweb-v1.0.1

* fix: added ci-version-beta

* fix: added ci-version-beta

* ci(restapi): 🎉 cut beta release to restapi-v1.2.9

* fix: added releaseType

* ci(restapi): 🎉 cut beta release to restapi-v0.0.1-beta.0

* ci(restapi): 🎉 cut beta release to restapi-v0.0.1-beta.0

* ci(restapi): 🎉 cut release to restapi-v1.2.10

* ci(restapi): 🎉 cut release to restapi-v1.2.10

* ci(restapi): 🎉 cut beta release to restapi-v0.0.1-beta.1

* ci(restapi): 🎉 cut release to restapi-v1.2.11

* fix: linkedListHash test cases removed & CI version corrected

* fix: update name to beta

* ci(restapi): 🎉 cut release to restapi-v1.2.12

* ci(restapi): 🎉 cut release to restapi-v1.2.12

* ci(restapi): 🎉 cut release to restapi-v1.2.13

* ci(restapi): 🎉 cut release to restapi-v1.2.14

* ci(restapi): 🎉 cut release to restapi-v1.2.15

* fix: update package json

* fix: updated socket version

* ci(uiweb): 🎉 cut release to uiweb-v1.0.2

* fix: socket lib update

* ci(uiweb): 🎉 cut release to uiweb-v1.0.2

* ci(restapi): 🎉 cut release to restapi-v1.2.16

* ci(restapi): 🎉 cut release to restapi-v1.3.0

* ci(restapi): 🎉 cut release to restapi-v1.3.1

* ci(socket): 🎉 cut release to socket-v0.5.1

* ci(restapi): 🎉 cut release to restapi-v1.3.2

* ci(restapi): 🎉 cut release to restapi-v1.3.3

* ci(restapi): 🎉 cut release to restapi-v1.3.4

* ci(restapi): 🎉 cut release to restapi-v1.3.5

* ci(restapi): 🎉 cut release to restapi-v1.3.6

* ci(restapi): 🎉 cut release to restapi-v1.3.7

* ci(restapi): 🎉 cut release to restapi-v1.3.8

* ci(restapi): 🎉 cut release to restapi-v1.3.9

* ci(uiweb): 🎉 cut release to uiweb-v1.1.0

* ci(uiweb): 🎉 cut release to uiweb-v1.1.1

* ci(restapi): 🎉 cut release to restapi-v1.4.0

* ci(restapi): 🎉 cut release to restapi-v1.4.1

* fix: corrections

* ci(uiweb): 🎉 cut release to uiweb-v1.1.2

* ci(uiweb): 🎉 cut release to uiweb-v1.1.3

* ci(uiweb): 🎉 cut release to uiweb-v1.1.4

* ci(restapi): 🎉 cut release to restapi-v1.4.2

* Update README.md

* Update README.md

* ci(restapi): 🎉 cut release to restapi-v1.4.3

* ci(restapi): 🎉 cut release to restapi-v1.4.4

* ci(uiweb): 🎉 cut release to uiweb-v1.1.5

* ci(uiweb): 🎉 cut release to uiweb-v1.1.6

* ci(uiweb): 🎉 cut release to uiweb-v1.1.7

* ci(socket): 🎉 cut release to socket-v0.5.2

* ci(restapi): 🎉 cut release to restapi-v1.4.5

* ci(uiweb): 🎉 cut release to uiweb-v1.1.8

* ci(restapi): 🎉 cut release to restapi-v1.4.6

* ci(uiweb): 🎉 cut release to uiweb-v1.1.9

* ci(restapi): 🎉 cut release to restapi-v1.4.7

* ci(restapi): 🎉 cut release to restapi-v1.4.8

* ci(uiweb): 🎉 cut release to uiweb-v1.1.10

* ci(restapi): 🎉 cut release to restapi-v1.4.9

* ci(restapi): 🎉 cut release to restapi-v1.4.10

* ci(restapi): 🎉 cut release to restapi-v1.4.11

* ci(restapi): 🎉 cut release to restapi-v1.4.12

* ci(uiweb): 🎉 cut release to uiweb-v1.1.11

* ci(restapi): 🎉 cut release to restapi-v1.4.13

* fix: update read me file

* ci(restapi): 🎉 cut release to restapi-v1.4.14

* ci(restapi): 🎉 cut release to restapi-v1.4.15

* ci(uiweb): 🎉 cut release to uiweb-v1.1.12

* fix: dummy change

* ci(uiweb): 🎉 cut release to uiweb-v1.1.13

* ci(restapi): 🎉 cut release to restapi-v1.4.16

* ci(restapi): 🎉 cut release to restapi-v1.4.17

* ci(restapi): 🎉 cut release to restapi-v1.4.18

* ci(restapi): 🎉 cut release to restapi-v1.4.19

* ci(restapi): 🎉 cut release to restapi-v1.4.20

* ci(restapi): 🎉 cut release to restapi-v1.4.21

* ci(uiweb): 🎉 cut release to uiweb-v1.1.14

* ci(restapi): 🎉 cut release to restapi-v1.4.22

* fix: build fix

* ci(restapi): 🎉 cut release to restapi-v1.4.23

* ci(restapi): 🎉 cut release to restapi-v1.4.24

* ci(restapi): 🎉 cut release to restapi-v1.4.25

* ci(restapi): 🎉 cut release to restapi-v1.4.26

* ci(restapi): 🎉 cut release to restapi-v1.4.27

* ci(restapi): 🎉 cut release to restapi-v1.4.28

* ci(uiweb): 🎉 cut release to uiweb-v1.1.15

* ci(restapi): 🎉 cut release to restapi-v1.4.29

* ci(restapi): 🎉 cut release to restapi-v1.4.30

* ci(restapi): 🎉 cut release to restapi-v1.4.31

* ci(restapi): 🎉 cut release to restapi-v1.4.32

* ci(restapi): 🎉 cut release to restapi-v1.4.33

* ci(uiweb): 🎉 cut release to uiweb-v1.1.16

* ci(restapi): 🎉 cut release to restapi-v1.4.34

* fix: GroupMember type fix

* ci(restapi): 🎉 cut release to restapi-v1.4.35

* fix: bump examples SDK version

* fix: stream test cases fix

---------

Co-authored-by: aman035 <[email protected]>
  • Loading branch information
mohammeds1992 and Aman035 authored Nov 14, 2023
1 parent 1464b78 commit 5d0197f
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 37 deletions.
50 changes: 30 additions & 20 deletions packages/examples/sdk-backend-node/chat/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const eventlistener = async (
stream: PushStream,
eventName: string
): Promise<void> => {
stream.on(eventName, (data: any) => {
stream.on(eventName, (data: any) => {
if (showAPIResponse) {
console.log('Stream Event Received');
console.log(data);
Expand All @@ -72,25 +72,33 @@ const eventlistener = async (
export const runChatClassUseCases = async (): Promise<void> => {
const userAlice = await PushAPI.initialize(signer, { env });

const stream = await userAlice.initStream(
[CONSTANTS.STREAM.CHAT, CONSTANTS.STREAM.CHAT_OPS],
{
// stream supports other products as well, such as STREAM.CHAT, STREAM.CHAT_OPS
// more info can be found at push.org/docs/chat
const stream = await userAlice.initStream(
[CONSTANTS.STREAM.CHAT, CONSTANTS.STREAM.CHAT_OPS],
{
// stream supports other products as well, such as STREAM.CHAT, STREAM.CHAT_OPS
// more info can be found at push.org/docs/chat

filter: {
channels: ['*'],
chats: ['*'],
},
connection: {
auto: true, // should connection be automatic, else need to call stream.connect();
retries: 3, // number of retries in case of error
},
raw: true, // enable true to show all data
}
);

await stream.connect();
filter: {
channels: ['*'],
chats: ['*'],
},
connection: {
auto: true, // should connection be automatic, else need to call stream.connect();
retries: 3, // number of retries in case of error
},
raw: true, // enable true to show all data
}
);

stream.on(CONSTANTS.STREAM.CONNECT, (a) => {
console.log('Stream Connected');
});

await stream.connect();

stream.on(CONSTANTS.STREAM.DISCONNECT, () => {
console.log('Stream Disconnected');
});

const userBob = await PushAPI.initialize(secondSigner, { env });
const userKate = await PushAPI.initialize(thirdSigner, { env });
Expand All @@ -106,7 +114,9 @@ export const runChatClassUseCases = async (): Promise<void> => {
// -------------------------------------------------------------------
console.log('PushAPI.chat.list');
const aliceChats = await userAlice.chat.list(CONSTANTS.CHAT.LIST_TYPE.CHATS);
const aliceRequests = await userAlice.chat.list(CONSTANTS.CHAT.LIST_TYPE.REQUESTS);
const aliceRequests = await userAlice.chat.list(
CONSTANTS.CHAT.LIST_TYPE.REQUESTS
);
if (showAPIResponse) {
console.log(aliceChats);
console.log(aliceRequests);
Expand Down
43 changes: 31 additions & 12 deletions packages/examples/sdk-backend-node/notification/notification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,38 @@ export const runNotificationClassUseCases = async (): Promise<void> => {
// -------------------------------------------------------------------
const userAlice = await PushAPI.initialize(signer, { env });

const stream = await userAlice.stream([CONSTANTS.STREAM.NOTIF], {
// stream supports other products as well, such as STREAM.CHAT, STREAM.CHAT_OPS
// more info can be found at push.org/docs/chat
const stream = await userAlice.initStream(
[
CONSTANTS.STREAM.NOTIF,
CONSTANTS.STREAM.CHAT_OPS,
CONSTANTS.STREAM.CHAT,
CONSTANTS.STREAM.CONNECT,
CONSTANTS.STREAM.DISCONNECT,
],
{
// stream supports other products as well, such as STREAM.CHAT, STREAM.CHAT_OPS
// more info can be found at push.org/docs/chat

filter: {
channels: ['*'],
chats: ['*'],
},
connection: {
auto: true, // should connection be automatic, else need to call stream.connect();
retries: 3, // number of retries in case of error
},
raw: true, // enable true to show all data
filter: {
channels: ['*'],
chats: ['*'],
},
connection: {
auto: true, // should connection be automatic, else need to call stream.connect();
retries: 3, // number of retries in case of error
},
raw: true, // enable true to show all data
}
);

stream.on(CONSTANTS.STREAM.CONNECT, (a) => {
console.log('Stream Connected');
});

await stream.connect();

stream.on(CONSTANTS.STREAM.DISCONNECT, () => {
console.log('Stream Disconnected');
});

// Listen Stream Events for getting websocket events
Expand Down
41 changes: 38 additions & 3 deletions packages/examples/sdk-backend-node/pushAPI/stream.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PushAPI } from '@pushprotocol/restapi';
import { CONSTANTS, PushAPI } from '@pushprotocol/restapi';
import { config } from '../config';
import { generatePrivateKey, privateKeyToAccount } from 'viem/accounts';
import { createWalletClient, http } from 'viem';
Expand Down Expand Up @@ -36,7 +36,7 @@ const eventlistener = async (
pushAPI: PushAPI,
eventName: string
): Promise<void> => {
pushAPI._stream.on(eventName, (data: any) => {
pushAPI.stream.on(eventName, (data: any) => {
if (showAPIResponse) {
console.log(data);
}
Expand All @@ -47,11 +47,46 @@ const delay = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));

export const runPushAPIStreamCases = async (): Promise<void> => {
const userAlice = await PushAPI.initialize(signer, { env });

const stream = await userAlice.initStream(
[
CONSTANTS.STREAM.NOTIF,
CONSTANTS.STREAM.CHAT_OPS,
CONSTANTS.STREAM.CHAT,
CONSTANTS.STREAM.CONNECT,
CONSTANTS.STREAM.DISCONNECT,
],
{
// stream supports other products as well, such as STREAM.CHAT, STREAM.CHAT_OPS
// more info can be found at push.org/docs/chat

filter: {
channels: ['*'],
chats: ['*'],
},
connection: {
auto: true, // should connection be automatic, else need to call stream.connect();
retries: 3, // number of retries in case of error
},
raw: true, // enable true to show all data
}
);

stream.on(CONSTANTS.STREAM.CONNECT, (a) => {
console.log('Stream Connected');
});

await stream.connect();

stream.on(CONSTANTS.STREAM.DISCONNECT, () => {
console.log('Stream Disconnected');
});

const userBob = await PushAPI.initialize(secondSigner, { env });
const userKate = await PushAPI.initialize(thirdSigner, { env });
// -------------------------------------------------------------------
// -------------------------------------------------------------------
console.log(`Listening ${STREAM.PROFILE} Events`);
console.log(`Listening ${CONSTANTS.STREAM.PROFILE} Events`);
eventlistener(userAlice, STREAM.PROFILE);
console.log(`Listening ${STREAM.ENCRYPTION} Events`);
eventlistener(userAlice, STREAM.ENCRYPTION);
Expand Down
4 changes: 2 additions & 2 deletions packages/restapi/tests/lib/pushstream/initialize.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,9 @@ describe('PushStream.initialize functionality', () => {
content: "Gm gm! It's a me... Mario",
});
});

await stream.connect();

stream.on(CONSTANTS.STREAM.DISCONNECT, () => {
console.log('Stream Disconnected');
});
Expand Down

0 comments on commit 5d0197f

Please sign in to comment.