From 80468b1529114da15913fdfcb51d4220cd2b0263 Mon Sep 17 00:00:00 2001 From: Francis Dinh Date: Fri, 23 Sep 2022 11:21:29 -0400 Subject: [PATCH 1/3] foundkey-js: Change Misskey import to foundkey --- packages/foundkey-js/test-d/api.ts | 22 +++++++++++----------- packages/foundkey-js/test-d/streaming.ts | 10 +++++----- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/packages/foundkey-js/test-d/api.ts b/packages/foundkey-js/test-d/api.ts index ce793f6fd..596ad82bd 100644 --- a/packages/foundkey-js/test-d/api.ts +++ b/packages/foundkey-js/test-d/api.ts @@ -1,45 +1,45 @@ import { expectType } from 'tsd'; -import * as Misskey from '../src'; +import * as foundkey from '../src'; describe('API', () => { test('success', async () => { - const cli = new Misskey.api.APIClient({ + const cli = new foundkey.api.APIClient({ origin: 'https://misskey.test', credential: 'TOKEN' }); const res = await cli.request('meta', { detail: true }); - expectType(res); + expectType(res); }); test('conditional respose type (meta)', async () => { - const cli = new Misskey.api.APIClient({ + const cli = new foundkey.api.APIClient({ origin: 'https://misskey.test', credential: 'TOKEN' }); const res = await cli.request('meta', { detail: true }); - expectType(res); + expectType(res); const res2 = await cli.request('meta', { detail: false }); - expectType(res2); + expectType(res2); const res3 = await cli.request('meta', { }); - expectType(res3); + expectType(res3); const res4 = await cli.request('meta', { detail: true as boolean }); - expectType(res4); + expectType(res4); }); test('conditional respose type (users/show)', async () => { - const cli = new Misskey.api.APIClient({ + const cli = new foundkey.api.APIClient({ origin: 'https://misskey.test', credential: 'TOKEN' }); const res = await cli.request('users/show', { userId: 'xxxxxxxx' }); - expectType(res); + expectType(res); const res2 = await cli.request('users/show', { userIds: ['xxxxxxxx'] }); - expectType(res2); + expectType(res2); }); }); diff --git a/packages/foundkey-js/test-d/streaming.ts b/packages/foundkey-js/test-d/streaming.ts index 7ff7f9599..63faa7975 100644 --- a/packages/foundkey-js/test-d/streaming.ts +++ b/packages/foundkey-js/test-d/streaming.ts @@ -1,17 +1,17 @@ import { expectType } from 'tsd'; -import * as Misskey from '../src'; +import * as foundkey from '../src'; describe('Streaming', () => { test('emit type', async () => { - const stream = new Misskey.Stream('https://misskey.test', { token: 'TOKEN' }); + const stream = new foundkey.Stream('https://misskey.test', { token: 'TOKEN' }); const mainChannel = stream.useChannel('main'); mainChannel.on('notification', notification => { - expectType(notification); + expectType(notification); }); }); test('params type', async () => { - const stream = new Misskey.Stream('https://misskey.test', { token: 'TOKEN' }); + const stream = new foundkey.Stream('https://misskey.test', { token: 'TOKEN' }); // TODO: 「stream.useChannel の第二引数として受け入れる型が // { // otherparty?: User['id'] | null; @@ -20,7 +20,7 @@ describe('Streaming', () => { // になっている」というテストを行いたいけどtsdでの書き方がわからない const messagingChannel = stream.useChannel('messaging', { otherparty: 'aaa' }); messagingChannel.on('message', message => { - expectType(message); + expectType(message); }); }); }); From 54b717a3f42902f30bd55dd59049884b67732a6f Mon Sep 17 00:00:00 2001 From: Francis Dinh Date: Fri, 23 Sep 2022 11:22:25 -0400 Subject: [PATCH 2/3] client: Update repo url from Misskey to FoundKey Changelog: Changed --- packages/client/src/ui/visitor/b.vue | 2 +- packages/client/src/ui/visitor/kanban.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/client/src/ui/visitor/b.vue b/packages/client/src/ui/visitor/b.vue index aaaa19568..3482d8fae 100644 --- a/packages/client/src/ui/visitor/b.vue +++ b/packages/client/src/ui/visitor/b.vue @@ -16,7 +16,7 @@
{{ host }} - Powered by Misskey + Powered by FoundKey
diff --git a/packages/client/src/ui/visitor/kanban.vue b/packages/client/src/ui/visitor/kanban.vue index c5818d6cc..63046a361 100644 --- a/packages/client/src/ui/visitor/kanban.vue +++ b/packages/client/src/ui/visitor/kanban.vue @@ -29,7 +29,7 @@
{{ host }} - Powered by Misskey + Powered by FoundKey
From 79662272ba6abd997be0d65da7ba4fdf7aa120a7 Mon Sep 17 00:00:00 2001 From: Francis Dinh Date: Fri, 23 Sep 2022 11:42:30 -0400 Subject: [PATCH 3/3] foundkey-js: update test domain to foundkey.test --- packages/foundkey-js/test-d/api.ts | 6 ++--- packages/foundkey-js/test-d/streaming.ts | 4 ++-- packages/foundkey-js/test/api.ts | 28 ++++++++++++------------ packages/foundkey-js/test/streaming.ts | 20 ++++++++--------- 4 files changed, 29 insertions(+), 29 deletions(-) diff --git a/packages/foundkey-js/test-d/api.ts b/packages/foundkey-js/test-d/api.ts index 596ad82bd..0ff2c6f2b 100644 --- a/packages/foundkey-js/test-d/api.ts +++ b/packages/foundkey-js/test-d/api.ts @@ -4,7 +4,7 @@ import * as foundkey from '../src'; describe('API', () => { test('success', async () => { const cli = new foundkey.api.APIClient({ - origin: 'https://misskey.test', + origin: 'https://foundkey.test', credential: 'TOKEN' }); const res = await cli.request('meta', { detail: true }); @@ -13,7 +13,7 @@ describe('API', () => { test('conditional respose type (meta)', async () => { const cli = new foundkey.api.APIClient({ - origin: 'https://misskey.test', + origin: 'https://foundkey.test', credential: 'TOKEN' }); @@ -32,7 +32,7 @@ describe('API', () => { test('conditional respose type (users/show)', async () => { const cli = new foundkey.api.APIClient({ - origin: 'https://misskey.test', + origin: 'https://foundkey.test', credential: 'TOKEN' }); diff --git a/packages/foundkey-js/test-d/streaming.ts b/packages/foundkey-js/test-d/streaming.ts index 63faa7975..7f257ca4d 100644 --- a/packages/foundkey-js/test-d/streaming.ts +++ b/packages/foundkey-js/test-d/streaming.ts @@ -3,7 +3,7 @@ import * as foundkey from '../src'; describe('Streaming', () => { test('emit type', async () => { - const stream = new foundkey.Stream('https://misskey.test', { token: 'TOKEN' }); + const stream = new foundkey.Stream('https://foundkey.test', { token: 'TOKEN' }); const mainChannel = stream.useChannel('main'); mainChannel.on('notification', notification => { expectType(notification); @@ -11,7 +11,7 @@ describe('Streaming', () => { }); test('params type', async () => { - const stream = new foundkey.Stream('https://misskey.test', { token: 'TOKEN' }); + const stream = new foundkey.Stream('https://foundkey.test', { token: 'TOKEN' }); // TODO: 「stream.useChannel の第二引数として受け入れる型が // { // otherparty?: User['id'] | null; diff --git a/packages/foundkey-js/test/api.ts b/packages/foundkey-js/test/api.ts index 47c837801..ae3ca7181 100644 --- a/packages/foundkey-js/test/api.ts +++ b/packages/foundkey-js/test/api.ts @@ -20,7 +20,7 @@ describe('API', () => { fetchMock.resetMocks(); fetchMock.mockResponse(async (req) => { const body = await req.json(); - if (req.method == 'POST' && req.url == 'https://misskey.test/api/i') { + if (req.method == 'POST' && req.url == 'https://foundkey.test/api/i') { if (body.i === 'TOKEN') { return JSON.stringify({ id: 'foo' }); } else { @@ -32,7 +32,7 @@ describe('API', () => { }); const cli = new APIClient({ - origin: 'https://misskey.test', + origin: 'https://foundkey.test', credential: 'TOKEN', }); @@ -43,7 +43,7 @@ describe('API', () => { }); expect(getFetchCall(fetchMock.mock.calls[0])).toEqual({ - url: 'https://misskey.test/api/i', + url: 'https://foundkey.test/api/i', method: 'POST', body: { i: 'TOKEN' } }); @@ -53,7 +53,7 @@ describe('API', () => { fetchMock.resetMocks(); fetchMock.mockResponse(async (req) => { const body = await req.json(); - if (req.method == 'POST' && req.url == 'https://misskey.test/api/notes/show') { + if (req.method == 'POST' && req.url == 'https://foundkey.test/api/notes/show') { if (body.i === 'TOKEN' && body.noteId === 'aaaaa') { return JSON.stringify({ id: 'foo' }); } else { @@ -65,7 +65,7 @@ describe('API', () => { }); const cli = new APIClient({ - origin: 'https://misskey.test', + origin: 'https://foundkey.test', credential: 'TOKEN', }); @@ -76,7 +76,7 @@ describe('API', () => { }); expect(getFetchCall(fetchMock.mock.calls[0])).toEqual({ - url: 'https://misskey.test/api/notes/show', + url: 'https://foundkey.test/api/notes/show', method: 'POST', body: { i: 'TOKEN', noteId: 'aaaaa' } }); @@ -85,7 +85,7 @@ describe('API', () => { test('204 No Content で null が返る', async () => { fetchMock.resetMocks(); fetchMock.mockResponse(async (req) => { - if (req.method == 'POST' && req.url == 'https://misskey.test/api/reset-password') { + if (req.method == 'POST' && req.url == 'https://foundkey.test/api/reset-password') { return { status: 204 }; } else { return { status: 404 }; @@ -93,7 +93,7 @@ describe('API', () => { }); const cli = new APIClient({ - origin: 'https://misskey.test', + origin: 'https://foundkey.test', credential: 'TOKEN', }); @@ -102,7 +102,7 @@ describe('API', () => { expect(res).toEqual(null); expect(getFetchCall(fetchMock.mock.calls[0])).toEqual({ - url: 'https://misskey.test/api/reset-password', + url: 'https://foundkey.test/api/reset-password', method: 'POST', body: { i: 'TOKEN', token: 'aaa', password: 'aaa' } }); @@ -112,7 +112,7 @@ describe('API', () => { fetchMock.resetMocks(); fetchMock.mockResponse(async (req) => { const body = await req.json(); - if (req.method == 'POST' && req.url == 'https://misskey.test/api/i') { + if (req.method == 'POST' && req.url == 'https://foundkey.test/api/i') { if (typeof body.i === 'string') { return JSON.stringify({ id: 'foo' }); } else { @@ -134,7 +134,7 @@ describe('API', () => { try { const cli = new APIClient({ - origin: 'https://misskey.test', + origin: 'https://foundkey.test', credential: 'TOKEN', }); @@ -162,7 +162,7 @@ describe('API', () => { try { const cli = new APIClient({ - origin: 'https://misskey.test', + origin: 'https://foundkey.test', credential: 'TOKEN', }); @@ -179,7 +179,7 @@ describe('API', () => { try { const cli = new APIClient({ - origin: 'https://misskey.test', + origin: 'https://foundkey.test', credential: 'TOKEN', }); @@ -200,7 +200,7 @@ describe('API', () => { try { const cli = new APIClient({ - origin: 'https://misskey.test', + origin: 'https://foundkey.test', credential: 'TOKEN', }); diff --git a/packages/foundkey-js/test/streaming.ts b/packages/foundkey-js/test/streaming.ts index 913db8b28..7fbb8e2f2 100644 --- a/packages/foundkey-js/test/streaming.ts +++ b/packages/foundkey-js/test/streaming.ts @@ -3,8 +3,8 @@ import Stream from '../src/streaming'; describe('Streaming', () => { test('useChannel', async () => { - const server = new WS('wss://misskey.test/streaming'); - const stream = new Stream('https://misskey.test', { token: 'TOKEN' }); + const server = new WS('wss://foundkey.test/streaming'); + const stream = new Stream('https://foundkey.test', { token: 'TOKEN' }); const mainChannelReceived: any[] = []; const main = stream.useChannel('main'); main.on('meUpdated', payload => { @@ -40,8 +40,8 @@ describe('Streaming', () => { }); test('useChannel with parameters', async () => { - const server = new WS('wss://misskey.test/streaming'); - const stream = new Stream('https://misskey.test', { token: 'TOKEN' }); + const server = new WS('wss://foundkey.test/streaming'); + const stream = new Stream('https://foundkey.test', { token: 'TOKEN' }); const messagingChannelReceived: any[] = []; const messaging = stream.useChannel('messaging', { otherparty: 'aaa' }); messaging.on('message', payload => { @@ -78,8 +78,8 @@ describe('Streaming', () => { }); test('ちゃんとチャンネルごとにidが異なる', async () => { - const server = new WS('wss://misskey.test/streaming'); - const stream = new Stream('https://misskey.test', { token: 'TOKEN' }); + const server = new WS('wss://foundkey.test/streaming'); + const stream = new Stream('https://foundkey.test', { token: 'TOKEN' }); stream.useChannel('messaging', { otherparty: 'aaa' }); stream.useChannel('messaging', { otherparty: 'bbb' }); @@ -101,8 +101,8 @@ describe('Streaming', () => { }); test('Connection#send', async () => { - const server = new WS('wss://misskey.test/streaming'); - const stream = new Stream('https://misskey.test', { token: 'TOKEN' }); + const server = new WS('wss://foundkey.test/streaming'); + const stream = new Stream('https://foundkey.test', { token: 'TOKEN' }); const messaging = stream.useChannel('messaging', { otherparty: 'aaa' }); messaging.send('read', { id: 'aaa' }); @@ -124,8 +124,8 @@ describe('Streaming', () => { }); test('Connection#dispose', async () => { - const server = new WS('wss://misskey.test/streaming'); - const stream = new Stream('https://misskey.test', { token: 'TOKEN' }); + const server = new WS('wss://foundkey.test/streaming'); + const stream = new Stream('https://foundkey.test', { token: 'TOKEN' }); const mainChannelReceived: any[] = []; const main = stream.useChannel('main'); main.on('meUpdated', payload => {