GetStream / stream-cli

Configure & manage Stream applications from the command line. 🚀
https://yarnpkg.com/en/package/getstream-cli
BSD 3-Clause "New" or "Revised" License
85 stars 19 forks source link

CLI not doing what is expected #36

Closed SeniYG closed 2 years ago

SeniYG commented 4 years ago

According to the CLI, I would hope to get a channel if I ran a query like :

stream chat:channel:query -c league-event-15890211145eb689baeab6c

From the CLI help: $ stream chat:channel:query

OPTIONS -c, --channel=channel The unique identifier for the channel you want to query.

however, the result I got was for another channel: { id: 'league-event-15863469465e8dbbc208999', type: 'gaming', cid: 'gaming:league-event-15863469465e8dbbc208999', created_at: '2020-05-18T13:08:37.770551Z', updated_at: '2020-05-18T13:08:37.770552Z', created_by: { id: 'smitty', role: 'user', created_at: '2020-04-20T11:17:41.28747Z', updated_at: '2020-05-18T13:08:37.768163Z', banned: false, online: false, image: '/files/gallery/misc/thumbs/shawnpic_scout1580827099.png', name: 'smitty' }, frozen: false, member_count: 1, config: { created_at: '2020-04-18T19:06:32.264792Z', updated_at: '2020-05-03T18:38:19.081114Z', name: 'gaming', typing_events: true, read_events: true, connect_events: false, search: true, reactions: false, replies: false, mutes: false, uploads: true, url_enrichment: true, message_retention: 'infinite', max_message_length: 300, automod: 'disabled', automod_behavior: 'flag', commands: [ [Object], [Object], [Object], [Object] ] }, members: { aeryith: { user: [Object], role: 'member', created_at: '2020-05-18T13:08:37.907648Z', updated_at: '2020-05-19T13:28:11.959162Z' } } }

after the channel with ID "league-event-15890211145eb689baeab6c" was created, then it returned the correct channel.

stream chat:channel:query -c league-event-15890211145eb689baeab6c { id: 'league-event-15890211145eb689baeab6c', type: 'gaming', cid: 'gaming:league-event-15890211145eb689baeab6c', created_at: '2020-05-19T13:56:08.640606Z', updated_at: '2020-05-19T13:56:08.640607Z', created_by: { id: 'GyoScore', role: 'admin', created_at: '2020-04-19T22:51:31.029074Z', updated_at: '2020-05-19T13:56:08.636721Z', banned: false, online: false, image: 'https://gyo.gg/images/letters/p.png', name: 'GyoScore' }, frozen: false, member_count: 2, config: { created_at: '2020-04-18T19:06:32.264792Z', updated_at: '2020-05-03T18:38:19.081114Z', name: 'gaming', typing_events: true, read_events: true, connect_events: false, search: true, reactions: false, replies: false, mutes: false, uploads: true, url_enrichment: true, message_retention: 'infinite', max_message_length: 300, automod: 'disabled', automod_behavior: 'flag', commands: [ [Object], [Object], [Object], [Object] ] }, event: 'league-event-15890211145eb689baeab6c', name: 'aeryith v. noahhankinson', season: 'season-1-1589019460', members: { dphunct: { user: [Object], is_moderator: true, role: 'moderator', created_at: '2020-05-19T13:56:08.880307Z', updated_at: '2020-05-19T13:56:08.880307Z' }, aeryith: { user: [Object], role: 'member', created_at: '2020-05-19T13:57:21.162494Z', updated_at: '2020-05-19T13:57:21.162494Z' } } }

and just because:

gyo-webcomponents % stream chat:channel:query -c should-not-work { id: 'league-event-15890211145eb689baeab6c', type: 'gaming', cid: 'gaming:league-event-15890211145eb689baeab6c', created_at: '2020-05-19T13:56:08.640606Z', updated_at: '2020-05-19T13:56:08.640607Z', created_by: { id: 'GyoScore', role: 'admin', created_at: '2020-04-19T22:51:31.029074Z', updated_at: '2020-05-19T13:56:08.636721Z', banned: false, online: false, name: 'GyoScore', image: 'https://gyo.gg/images/letters/p.png' }, frozen: false, member_count: 2, config: { created_at: '2020-04-18T19:06:32.264792Z', updated_at: '2020-05-03T18:38:19.081114Z', name: 'gaming', typing_events: true, read_events: true, connect_events: false, search: true, reactions: false, replies: false, mutes: false, uploads: true, url_enrichment: true, message_retention: 'infinite', max_message_length: 300, automod: 'disabled', automod_behavior: 'flag', commands: [ [Object], [Object], [Object], [Object] ] }, event: 'league-event-15890211145eb689baeab6c', name: 'aeryith v. noahhankinson', season: 'season-1-1589019460', members: { dphunct: { user: [Object], is_moderator: true, role: 'moderator', created_at: '2020-05-19T13:56:08.880307Z', updated_at: '2020-05-19T13:56:08.880307Z' }, aeryith: { user: [Object], role: 'member', created_at: '2020-05-19T13:57:21.162494Z', updated_at: '2020-05-19T13:57:21.162494Z' } } }

Is this appropriate behavior? Should I get an error if the channel does not exist?

peterdeme commented 2 years ago

This isn't applicable anymore