mirror of
https://github.com/kokonect-link/cherrypick
synced 2024-11-30 15:58:19 +09:00
CherryPick🍒
This commit is contained in:
parent
366198445c
commit
43addcbd00
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "Misskey",
|
"name": "CherryPick",
|
||||||
"dockerComposeFile": "docker-compose.yml",
|
"dockerComposeFile": "docker-compose.yml",
|
||||||
"service": "app",
|
"service": "app",
|
||||||
"workspaceFolder": "/workspace",
|
"workspaceFolder": "/workspace",
|
||||||
|
@ -90,7 +90,7 @@ export default class Logger {
|
|||||||
|
|
||||||
const projectId = this.clConfig.projectId;
|
const projectId = this.clConfig.projectId;
|
||||||
const logging = new Logging({ projectId: projectId, keyFilename: this.clConfig.saKeyPath });
|
const logging = new Logging({ projectId: projectId, keyFilename: this.clConfig.saKeyPath });
|
||||||
const logName = this.clConfig.logName ?? 'misskey';
|
const logName = this.clConfig.logName ?? 'cherrypick';
|
||||||
const log = logging.log(logName);
|
const log = logging.log(logName);
|
||||||
const logMessage = stripAnsi(message);
|
const logMessage = stripAnsi(message);
|
||||||
|
|
||||||
|
@ -462,7 +462,7 @@ export class Meta {
|
|||||||
public serverRules: string[];
|
public serverRules: string[];
|
||||||
|
|
||||||
@Column('varchar', {
|
@Column('varchar', {
|
||||||
length: 1024, array: true, default: '{ "admin", "administrator", "root", "system", "maintainer", "host", "mod", "moderator", "owner", "superuser", "staff", "auth", "i", "me", "everyone", "all", "mention", "mentions", "example", "user", "users", "account", "accounts", "official", "help", "helps", "support", "supports", "info", "information", "informations", "announce", "announces", "announcement", "announcements", "notice", "notification", "notifications", "dev", "developer", "developers", "tech", "misskey" }',
|
length: 1024, array: true, default: '{ "admin", "administrator", "root", "system", "maintainer", "host", "mod", "moderator", "owner", "superuser", "staff", "auth", "i", "me", "everyone", "all", "mention", "mentions", "example", "user", "users", "account", "accounts", "official", "help", "helps", "support", "supports", "info", "information", "informations", "announce", "announces", "announcement", "announcements", "notice", "notification", "notifications", "dev", "developer", "developers", "tech", "misskey", "cherrypick" }',
|
||||||
})
|
})
|
||||||
public preservedUsernames: string[];
|
public preservedUsernames: string[];
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ export function genOpenapiSpec(config: Config) {
|
|||||||
|
|
||||||
info: {
|
info: {
|
||||||
version: config.version,
|
version: config.version,
|
||||||
title: 'Misskey API',
|
title: 'CherryPick API',
|
||||||
'x-logo': { url: '/static-assets/api-doc.png' },
|
'x-logo': { url: '/static-assets/api-doc.png' },
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ import * as Misskey from '../src';
|
|||||||
describe('API', () => {
|
describe('API', () => {
|
||||||
test('success', async () => {
|
test('success', async () => {
|
||||||
const cli = new Misskey.api.APIClient({
|
const cli = new Misskey.api.APIClient({
|
||||||
origin: 'https://misskey.test',
|
origin: 'https://cherrypick.test',
|
||||||
credential: 'TOKEN'
|
credential: 'TOKEN'
|
||||||
});
|
});
|
||||||
const res = await cli.request('meta', { detail: true });
|
const res = await cli.request('meta', { detail: true });
|
||||||
@ -13,7 +13,7 @@ describe('API', () => {
|
|||||||
|
|
||||||
test('conditional respose type (meta)', async () => {
|
test('conditional respose type (meta)', async () => {
|
||||||
const cli = new Misskey.api.APIClient({
|
const cli = new Misskey.api.APIClient({
|
||||||
origin: 'https://misskey.test',
|
origin: 'https://cherrypick.test',
|
||||||
credential: 'TOKEN'
|
credential: 'TOKEN'
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -32,7 +32,7 @@ describe('API', () => {
|
|||||||
|
|
||||||
test('conditional respose type (users/show)', async () => {
|
test('conditional respose type (users/show)', async () => {
|
||||||
const cli = new Misskey.api.APIClient({
|
const cli = new Misskey.api.APIClient({
|
||||||
origin: 'https://misskey.test',
|
origin: 'https://cherrypick.test',
|
||||||
credential: 'TOKEN'
|
credential: 'TOKEN'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ describe('API', () => {
|
|||||||
fetchMock.resetMocks();
|
fetchMock.resetMocks();
|
||||||
fetchMock.mockResponse(async (req) => {
|
fetchMock.mockResponse(async (req) => {
|
||||||
const body = await req.json();
|
const body = await req.json();
|
||||||
if (req.method == 'POST' && req.url == 'https://misskey.test/api/i') {
|
if (req.method == 'POST' && req.url == 'https://cherrypick.test/api/i') {
|
||||||
if (body.i === 'TOKEN') {
|
if (body.i === 'TOKEN') {
|
||||||
return JSON.stringify({ id: 'foo' });
|
return JSON.stringify({ id: 'foo' });
|
||||||
} else {
|
} else {
|
||||||
@ -32,7 +32,7 @@ describe('API', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const cli = new APIClient({
|
const cli = new APIClient({
|
||||||
origin: 'https://misskey.test',
|
origin: 'https://cherrypick.test',
|
||||||
credential: 'TOKEN',
|
credential: 'TOKEN',
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ describe('API', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
expect(getFetchCall(fetchMock.mock.calls[0])).toEqual({
|
expect(getFetchCall(fetchMock.mock.calls[0])).toEqual({
|
||||||
url: 'https://misskey.test/api/i',
|
url: 'https://cherrypick.test/api/i',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: { i: 'TOKEN' }
|
body: { i: 'TOKEN' }
|
||||||
});
|
});
|
||||||
@ -53,7 +53,7 @@ describe('API', () => {
|
|||||||
fetchMock.resetMocks();
|
fetchMock.resetMocks();
|
||||||
fetchMock.mockResponse(async (req) => {
|
fetchMock.mockResponse(async (req) => {
|
||||||
const body = await req.json();
|
const body = await req.json();
|
||||||
if (req.method == 'POST' && req.url == 'https://misskey.test/api/notes/show') {
|
if (req.method == 'POST' && req.url == 'https://cherrypick.test/api/notes/show') {
|
||||||
if (body.i === 'TOKEN' && body.noteId === 'aaaaa') {
|
if (body.i === 'TOKEN' && body.noteId === 'aaaaa') {
|
||||||
return JSON.stringify({ id: 'foo' });
|
return JSON.stringify({ id: 'foo' });
|
||||||
} else {
|
} else {
|
||||||
@ -65,7 +65,7 @@ describe('API', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const cli = new APIClient({
|
const cli = new APIClient({
|
||||||
origin: 'https://misskey.test',
|
origin: 'https://cherrypick.test',
|
||||||
credential: 'TOKEN',
|
credential: 'TOKEN',
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -76,7 +76,7 @@ describe('API', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
expect(getFetchCall(fetchMock.mock.calls[0])).toEqual({
|
expect(getFetchCall(fetchMock.mock.calls[0])).toEqual({
|
||||||
url: 'https://misskey.test/api/notes/show',
|
url: 'https://cherrypick.test/api/notes/show',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: { i: 'TOKEN', noteId: 'aaaaa' }
|
body: { i: 'TOKEN', noteId: 'aaaaa' }
|
||||||
});
|
});
|
||||||
@ -85,7 +85,7 @@ describe('API', () => {
|
|||||||
test('204 No Content で null が返る', async () => {
|
test('204 No Content で null が返る', async () => {
|
||||||
fetchMock.resetMocks();
|
fetchMock.resetMocks();
|
||||||
fetchMock.mockResponse(async (req) => {
|
fetchMock.mockResponse(async (req) => {
|
||||||
if (req.method == 'POST' && req.url == 'https://misskey.test/api/reset-password') {
|
if (req.method == 'POST' && req.url == 'https://cherrypick.test/api/reset-password') {
|
||||||
return { status: 204 };
|
return { status: 204 };
|
||||||
} else {
|
} else {
|
||||||
return { status: 404 };
|
return { status: 404 };
|
||||||
@ -93,7 +93,7 @@ describe('API', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const cli = new APIClient({
|
const cli = new APIClient({
|
||||||
origin: 'https://misskey.test',
|
origin: 'https://cherrypick.test',
|
||||||
credential: 'TOKEN',
|
credential: 'TOKEN',
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -102,7 +102,7 @@ describe('API', () => {
|
|||||||
expect(res).toEqual(null);
|
expect(res).toEqual(null);
|
||||||
|
|
||||||
expect(getFetchCall(fetchMock.mock.calls[0])).toEqual({
|
expect(getFetchCall(fetchMock.mock.calls[0])).toEqual({
|
||||||
url: 'https://misskey.test/api/reset-password',
|
url: 'https://cherrypick.test/api/reset-password',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: { i: 'TOKEN', token: 'aaa', password: 'aaa' }
|
body: { i: 'TOKEN', token: 'aaa', password: 'aaa' }
|
||||||
});
|
});
|
||||||
@ -112,7 +112,7 @@ describe('API', () => {
|
|||||||
fetchMock.resetMocks();
|
fetchMock.resetMocks();
|
||||||
fetchMock.mockResponse(async (req) => {
|
fetchMock.mockResponse(async (req) => {
|
||||||
const body = await req.json();
|
const body = await req.json();
|
||||||
if (req.method == 'POST' && req.url == 'https://misskey.test/api/i') {
|
if (req.method == 'POST' && req.url == 'https://cherrypick.test/api/i') {
|
||||||
if (typeof body.i === 'string') {
|
if (typeof body.i === 'string') {
|
||||||
return JSON.stringify({ id: 'foo' });
|
return JSON.stringify({ id: 'foo' });
|
||||||
} else {
|
} else {
|
||||||
@ -134,7 +134,7 @@ describe('API', () => {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const cli = new APIClient({
|
const cli = new APIClient({
|
||||||
origin: 'https://misskey.test',
|
origin: 'https://cherrypick.test',
|
||||||
credential: 'TOKEN',
|
credential: 'TOKEN',
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -162,7 +162,7 @@ describe('API', () => {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const cli = new APIClient({
|
const cli = new APIClient({
|
||||||
origin: 'https://misskey.test',
|
origin: 'https://cherrypick.test',
|
||||||
credential: 'TOKEN',
|
credential: 'TOKEN',
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -179,7 +179,7 @@ describe('API', () => {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const cli = new APIClient({
|
const cli = new APIClient({
|
||||||
origin: 'https://misskey.test',
|
origin: 'https://cherrypick.test',
|
||||||
credential: 'TOKEN',
|
credential: 'TOKEN',
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -200,7 +200,7 @@ describe('API', () => {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const cli = new APIClient({
|
const cli = new APIClient({
|
||||||
origin: 'https://misskey.test',
|
origin: 'https://cherrypick.test',
|
||||||
credential: 'TOKEN',
|
credential: 'TOKEN',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ import Stream from '../src/streaming';
|
|||||||
|
|
||||||
describe('Streaming', () => {
|
describe('Streaming', () => {
|
||||||
test('useChannel', async () => {
|
test('useChannel', async () => {
|
||||||
const server = new WS('wss://misskey.test/streaming');
|
const server = new WS('wss://cherrypick.test/streaming');
|
||||||
const stream = new Stream('https://misskey.test', { token: 'TOKEN' });
|
const stream = new Stream('https://cherrypick.test', { token: 'TOKEN' });
|
||||||
const mainChannelReceived: any[] = [];
|
const mainChannelReceived: any[] = [];
|
||||||
const main = stream.useChannel('main');
|
const main = stream.useChannel('main');
|
||||||
main.on('meUpdated', payload => {
|
main.on('meUpdated', payload => {
|
||||||
@ -40,8 +40,8 @@ describe('Streaming', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('useChannel with parameters', async () => {
|
test('useChannel with parameters', async () => {
|
||||||
const server = new WS('wss://misskey.test/streaming');
|
const server = new WS('wss://cherrypick.test/streaming');
|
||||||
const stream = new Stream('https://misskey.test', { token: 'TOKEN' });
|
const stream = new Stream('https://cherrypick.test', { token: 'TOKEN' });
|
||||||
const messagingChannelReceived: any[] = [];
|
const messagingChannelReceived: any[] = [];
|
||||||
const messaging = stream.useChannel('messaging', { otherparty: 'aaa' });
|
const messaging = stream.useChannel('messaging', { otherparty: 'aaa' });
|
||||||
messaging.on('message', payload => {
|
messaging.on('message', payload => {
|
||||||
@ -78,8 +78,8 @@ describe('Streaming', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('ちゃんとチャンネルごとにidが異なる', async () => {
|
test('ちゃんとチャンネルごとにidが異なる', async () => {
|
||||||
const server = new WS('wss://misskey.test/streaming');
|
const server = new WS('wss://cherrypick.test/streaming');
|
||||||
const stream = new Stream('https://misskey.test', { token: 'TOKEN' });
|
const stream = new Stream('https://cherrypick.test', { token: 'TOKEN' });
|
||||||
|
|
||||||
stream.useChannel('messaging', { otherparty: 'aaa' });
|
stream.useChannel('messaging', { otherparty: 'aaa' });
|
||||||
stream.useChannel('messaging', { otherparty: 'bbb' });
|
stream.useChannel('messaging', { otherparty: 'bbb' });
|
||||||
@ -101,8 +101,8 @@ describe('Streaming', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('Connection#send', async () => {
|
test('Connection#send', async () => {
|
||||||
const server = new WS('wss://misskey.test/streaming');
|
const server = new WS('wss://cherrypick.test/streaming');
|
||||||
const stream = new Stream('https://misskey.test', { token: 'TOKEN' });
|
const stream = new Stream('https://cherrypick.test', { token: 'TOKEN' });
|
||||||
|
|
||||||
const messaging = stream.useChannel('messaging', { otherparty: 'aaa' });
|
const messaging = stream.useChannel('messaging', { otherparty: 'aaa' });
|
||||||
messaging.send('read', { id: 'aaa' });
|
messaging.send('read', { id: 'aaa' });
|
||||||
@ -124,8 +124,8 @@ describe('Streaming', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('Connection#dispose', async () => {
|
test('Connection#dispose', async () => {
|
||||||
const server = new WS('wss://misskey.test/streaming');
|
const server = new WS('wss://cherrypick.test/streaming');
|
||||||
const stream = new Stream('https://misskey.test', { token: 'TOKEN' });
|
const stream = new Stream('https://cherrypick.test', { token: 'TOKEN' });
|
||||||
const mainChannelReceived: any[] = [];
|
const mainChannelReceived: any[] = [];
|
||||||
const main = stream.useChannel('main');
|
const main = stream.useChannel('main');
|
||||||
main.on('meUpdated', payload => {
|
main.on('meUpdated', payload => {
|
||||||
|
@ -22,7 +22,7 @@ export const Default = {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
template: '<MkA v-bind="props">Misskey</MkA>',
|
template: '<MkA v-bind="props">CherryPick</MkA>',
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
async play({ canvasElement }) {
|
async play({ canvasElement }) {
|
||||||
|
@ -48,7 +48,7 @@ export const Long = {
|
|||||||
user: {
|
user: {
|
||||||
...userDetailed(),
|
...userDetailed(),
|
||||||
username: 'the_quick_brown_fox_jumped_over_the_lazy_dog',
|
username: 'the_quick_brown_fox_jumped_over_the_lazy_dog',
|
||||||
host: 'misskey.example',
|
host: 'cherrypick.example',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
decorators: [
|
decorators: [
|
||||||
|
@ -73,7 +73,7 @@ describe('MkMediaImage', () => {
|
|||||||
test('Attaching image with an alt message should show an ALT indicator', async () => {
|
test('Attaching image with an alt message should show an ALT indicator', async () => {
|
||||||
const mkMediaImage = renderMediaImage({
|
const mkMediaImage = renderMediaImage({
|
||||||
type: 'image/png',
|
type: 'image/png',
|
||||||
comment: 'Misskeyのロゴです',
|
comment: 'CherryPickのロゴです',
|
||||||
});
|
});
|
||||||
const [gif, alt] = await Promise.all([
|
const [gif, alt] = await Promise.all([
|
||||||
mkMediaImage.queryByText('GIF'),
|
mkMediaImage.queryByText('GIF'),
|
||||||
@ -86,7 +86,7 @@ describe('MkMediaImage', () => {
|
|||||||
test('Attaching GIF image with an alt message should show a GIF and an ALT indicator', async () => {
|
test('Attaching GIF image with an alt message should show a GIF and an ALT indicator', async () => {
|
||||||
const mkMediaImage = renderMediaImage({
|
const mkMediaImage = renderMediaImage({
|
||||||
type: 'image/gif',
|
type: 'image/gif',
|
||||||
comment: 'Misskeyのロゴです',
|
comment: 'CherryPickのロゴです',
|
||||||
});
|
});
|
||||||
const [gif, alt] = await Promise.all([
|
const [gif, alt] = await Promise.all([
|
||||||
mkMediaImage.queryByText('GIF'),
|
mkMediaImage.queryByText('GIF'),
|
||||||
|
@ -18,7 +18,7 @@ const iconUrl = (name: BadgeNames): string => `/static-assets/tabler-badges/${na
|
|||||||
/* How to add a new badge:
|
/* How to add a new badge:
|
||||||
* 1. Find the icon and download png from https://tabler-icons.io/
|
* 1. Find the icon and download png from https://tabler-icons.io/
|
||||||
* 2. vips resize ~/Downloads/icon-name.png vipswork.png 0.4; vips scRGB2BW vipswork.png ~/icon-name.png"[compression=9,strip]"; rm vipswork.png;
|
* 2. vips resize ~/Downloads/icon-name.png vipswork.png 0.4; vips scRGB2BW vipswork.png ~/icon-name.png"[compression=9,strip]"; rm vipswork.png;
|
||||||
* 3. mv ~/icon-name.png ~/misskey/packages/backend/assets/tabler-badges/
|
* 3. mv ~/icon-name.png ~/cherrypick/packages/backend/assets/tabler-badges/
|
||||||
* 4. Add 'icon-name' to BadgeNames
|
* 4. Add 'icon-name' to BadgeNames
|
||||||
* 5. Add `badge: iconUrl('icon-name'),`
|
* 5. Add `badge: iconUrl('icon-name'),`
|
||||||
*/
|
*/
|
||||||
@ -265,7 +265,7 @@ export async function createEmptyNotification(): Promise<void> {
|
|||||||
await globalThis.registration.showNotification(
|
await globalThis.registration.showNotification(
|
||||||
(new URL(origin)).host,
|
(new URL(origin)).host,
|
||||||
{
|
{
|
||||||
body: `Misskey v${_VERSION_}`,
|
body: `CherryPick v${_VERSION_}`,
|
||||||
silent: true,
|
silent: true,
|
||||||
badge: iconUrl('null'),
|
badge: iconUrl('null'),
|
||||||
tag: 'read_notification',
|
tag: 'read_notification',
|
||||||
|
Loading…
Reference in New Issue
Block a user