Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion jobs/reconcile-account-topics/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
Image,
Person,
PropertyValue,
} from '@fedify/fedify';
} from '@fedify/vocab';
import mysql, { type RowDataPacket } from 'mysql2/promise';

import { AccountTopicReconciler } from './lib/AccountTopicReconciler';
Expand Down
4 changes: 2 additions & 2 deletions jobs/reconcile-account-topics/lib/AccountTopicReconciler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import {
type Actor,
isActor,
lookupObject,
lookupWebFinger,
PropertyValue,
} from '@fedify/fedify';
} from '@fedify/vocab';
import { lookupWebFinger } from '@fedify/webfinger';
import type mysql from 'mysql2/promise';
import type { RowDataPacket } from 'mysql2/promise';

Expand Down
3 changes: 2 additions & 1 deletion jobs/reconcile-account-topics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"name": "reconcile-account-topics",
"private": true,
"dependencies": {
"@fedify/fedify": "1.10.11",
"@fedify/vocab": "2.2.5",
"@fedify/webfinger": "2.2.5",
"mysql2": "3.22.5"
}
}
11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"@biomejs/biome": "2.4.16",
"@cucumber/cucumber": "13.0.0",
"@faker-js/faker": "10.4.0",
"@fedify/cli": "1.10.11",
"@fedify/cli": "2.2.5",
"@types/html-to-text": "9.0.4",
"@types/jsonwebtoken": "9.0.10",
"@types/node": "22.19.20",
Expand All @@ -64,9 +64,12 @@
"wiremock-captain": "4.1.3"
},
"dependencies": {
"@fedify/fedify": "1.10.11",
"@fedify/hono": "1.10.11",
"@fedify/redis": "1.10.11",
"@fedify/fedify": "2.2.5",
"@fedify/hono": "2.2.5",
"@fedify/redis": "2.2.5",
"@fedify/vocab": "2.2.5",
"@fedify/vocab-runtime": "2.2.5",
"@fedify/webfinger": "2.2.5",
"@google-cloud/opentelemetry-cloud-trace-exporter": "3.0.0",
"@google-cloud/opentelemetry-cloud-trace-propagator": "0.21.0",
"@google-cloud/pubsub": "5.3.1",
Expand Down
10 changes: 9 additions & 1 deletion src/account/account.service.integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
vi,
} from 'vitest';

import { type Actor, isActor, lookupObject, type Note } from '@fedify/fedify';
import { type Actor, isActor, lookupObject, type Note } from '@fedify/vocab';
import type { Knex } from 'knex';

import { KnexAccountRepository } from '@/account/account.repository.knex';
Expand Down Expand Up @@ -43,6 +43,14 @@ vi.mock('@fedify/fedify', async () => {
return {
...original,
generateCryptoKeyPair: vi.fn().mockReturnValue(keyPair),
};
});

vi.mock('@fedify/vocab', async () => {
const original = await vi.importActual('@fedify/vocab');

return {
...original,
lookupObject: vi.fn(),
isActor: vi.fn(),
};
Expand Down
9 changes: 4 additions & 5 deletions src/account/account.service.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { randomUUID } from 'node:crypto';

import { exportJwk, generateCryptoKeyPair } from '@fedify/fedify';
import {
type Actor,
exportJwk,
generateCryptoKeyPair,
isActor,
lookupObject as lookupFedifyObject,
} from '@fedify/fedify';
} from '@fedify/vocab';
import type { Knex } from 'knex';

import { type Account, AccountEntity } from '@/account/account.entity';
Expand Down Expand Up @@ -117,7 +116,7 @@ export class AccountService {
const context = this.fedifyContextFactory.getFedifyContext();

const documentLoader = await context.getDocumentLoader({
handle: 'index',
identifier: 'index',
});
const potentialActor = await lookupFedifyObject(id, { documentLoader });

Expand Down Expand Up @@ -151,7 +150,7 @@ export class AccountService {
const context = this.fedifyContextFactory.getFedifyContext();

const documentLoader = await context.getDocumentLoader({
handle: 'index',
identifier: 'index',
});

let actor: Actor;
Expand Down
6 changes: 3 additions & 3 deletions src/account/account.service.unit.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { beforeEach, describe, expect, it, vi } from 'vitest';

import { isActor } from '@fedify/fedify';
import { isActor } from '@fedify/vocab';
import type { Knex } from 'knex';

import type { AccountEntity } from '@/account/account.entity';
Expand All @@ -11,8 +11,8 @@ import type { AsyncEvents } from '@/core/events';
import { error, ok } from '@/core/result';
import * as lookupHelpers from '@/lookup-helpers';

vi.mock('@fedify/fedify', async () => {
const original = await vi.importActual('@fedify/fedify');
vi.mock('@fedify/vocab', async () => {
const original = await vi.importActual('@fedify/vocab');

return {
...original,
Expand Down
2 changes: 1 addition & 1 deletion src/account/utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { isIP } from 'node:net';

import { type Actor, PropertyValue } from '@fedify/fedify';
import { type Actor, PropertyValue } from '@fedify/vocab';

import type { Account } from '@/account/account.entity';
import type { ExternalAccountData } from '@/account/types';
Expand Down
2 changes: 1 addition & 1 deletion src/account/utils.unit.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, expect, it, vi } from 'vitest';

import { type Actor, PropertyValue } from '@fedify/fedify';
import { type Actor, PropertyValue } from '@fedify/vocab';

import {
getAccountHandle,
Expand Down
2 changes: 1 addition & 1 deletion src/activity-dispatchers/reject.dispatcher.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Reject } from '@fedify/fedify';
import { Reject } from '@fedify/vocab';

import type { FedifyRequestContext } from '@/app';

Expand Down
2 changes: 1 addition & 1 deletion src/activity-handlers/create.handler.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type Create, PUBLIC_COLLECTION } from '@fedify/fedify';
import { type Create, PUBLIC_COLLECTION } from '@fedify/vocab';

import type { FedifyContext } from '@/app';
import { exhaustiveCheck, getError, isError } from '@/core/result';
Expand Down
2 changes: 1 addition & 1 deletion src/activity-handlers/create.handler.unit.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { beforeEach, describe, expect, it, vi } from 'vitest';

import { type Create, PUBLIC_COLLECTION } from '@fedify/fedify';
import { type Create, PUBLIC_COLLECTION } from '@fedify/vocab';

import type { FedifyContext } from '@/app';
import { ok } from '@/core/result';
Expand Down
2 changes: 1 addition & 1 deletion src/activity-handlers/delete.handler.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Actor, Delete } from '@fedify/fedify';
import type { Actor, Delete } from '@fedify/vocab';

import type { Account } from '@/account/account.entity';
import type { AccountService } from '@/account/account.service';
Expand Down
4 changes: 2 additions & 2 deletions src/activity-handlers/follow.handler.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Accept, type Actor, type Follow, Reject } from '@fedify/fedify';
import { Accept, type Actor, type Follow, Reject } from '@fedify/vocab';
import { v4 as uuidv4 } from 'uuid';

import type { AccountService } from '@/account/account.service';
Expand Down Expand Up @@ -72,7 +72,7 @@ export class FollowHandler {
`${followerAccount.apId} is not allowed to follow ${accountToFollow.apId}, sending reject`,
);

await this.sendReject(ctx, follow, parsed.handle, sender);
await this.sendReject(ctx, follow, parsed.identifier, sender);

return;
}
Expand Down
6 changes: 3 additions & 3 deletions src/activity-handlers/move.handler.integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
vi,
} from 'vitest';

import { lookupObject, Move, Person } from '@fedify/fedify';
import { lookupObject, Move, Person } from '@fedify/vocab';
import type { Knex } from 'knex';

import { KnexAccountRepository } from '@/account/account.repository.knex';
Expand All @@ -22,8 +22,8 @@ import { createTestDb } from '@/test/db';
import { createFixtureManager, type FixtureManager } from '@/test/fixtures';
import { MoveHandler } from './move.handler';

vi.mock('@fedify/fedify', async (importOriginal) => {
const original = await importOriginal<typeof import('@fedify/fedify')>();
vi.mock('@fedify/vocab', async (importOriginal) => {
const original = await importOriginal<typeof import('@fedify/vocab')>();

return {
...original,
Expand Down
4 changes: 2 additions & 2 deletions src/activity-handlers/move.handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
type Move,
Person,
Undo,
} from '@fedify/fedify';
} from '@fedify/vocab';
import { v4 as uuidv4 } from 'uuid';

import type { Account } from '@/account/account.entity';
Expand Down Expand Up @@ -150,7 +150,7 @@ export class MoveHandler {

try {
const documentLoader = await ctx.getDocumentLoader({
handle: 'index',
identifier: 'index',
});
target = await lookupObject(move.targetId!, { documentLoader });
} catch (err) {
Expand Down
6 changes: 3 additions & 3 deletions src/activity-handlers/move.handler.unit.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { beforeEach, describe, expect, it, vi } from 'vitest';

import { Follow, lookupObject, Move, Person, Undo } from '@fedify/fedify';
import { Follow, lookupObject, Move, Person, Undo } from '@fedify/vocab';

import type { Account } from '@/account/account.entity';
import type { AccountService } from '@/account/account.service';
Expand All @@ -13,8 +13,8 @@ import {
} from '@/test/account-entity-test-helpers';
import { MoveHandler } from './move.handler';

vi.mock('@fedify/fedify', async (importOriginal) => {
const original = await importOriginal<typeof import('@fedify/fedify')>();
vi.mock('@fedify/vocab', async (importOriginal) => {
const original = await importOriginal<typeof import('@fedify/vocab')>();

return {
...original,
Expand Down
2 changes: 1 addition & 1 deletion src/activity-handlers/update.handler.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type Actor, isActor, type Update } from '@fedify/fedify';
import { type Actor, isActor, type Update } from '@fedify/vocab';

import type { AccountService } from '@/account/account.service';
import { mapActorToExternalAccountData } from '@/account/utils';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,28 @@
"https://w3id.org/identity/v1",
"https://www.w3.org/ns/activitystreams",
"https://w3id.org/security/data-integrity/v1",
"https://gotosocial.org/ns",
{
"ChatMessage": "http://litepub.social/ns#ChatMessage",
"Emoji": "toot:Emoji",
"Hashtag": "as:Hashtag",
"QuoteAuthorization": "https://w3id.org/fep/044f#QuoteAuthorization",
"QuoteRequest": "https://w3id.org/fep/044f#QuoteRequest",
"_misskey_quote": "misskey:_misskey_quote",
"emojiReactions": {
"@id": "fedibird:emojiReactions",
"@type": "@id",
},
"fedibird": "http://fedibird.com/ns#",
"misskey": "https://misskey-hub.net/ns#",
"quote": {
"@id": "https://w3id.org/fep/044f#quote",
"@type": "@id",
},
"quoteAuthorization": {
"@id": "https://w3id.org/fep/044f#quoteAuthorization",
"@type": "@id",
},
"quoteUri": "fedibird:quoteUri",
"quoteUrl": "as:quoteUrl",
"sensitive": "as:sensitive",
Expand Down
11 changes: 11 additions & 0 deletions src/activitypub/__snapshots__/publish-note-create-activity.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,28 @@
"https://w3id.org/identity/v1",
"https://www.w3.org/ns/activitystreams",
"https://w3id.org/security/data-integrity/v1",
"https://gotosocial.org/ns",
{
"ChatMessage": "http://litepub.social/ns#ChatMessage",
"Emoji": "toot:Emoji",
"Hashtag": "as:Hashtag",
"QuoteAuthorization": "https://w3id.org/fep/044f#QuoteAuthorization",
"QuoteRequest": "https://w3id.org/fep/044f#QuoteRequest",
"_misskey_quote": "misskey:_misskey_quote",
"emojiReactions": {
"@id": "fedibird:emojiReactions",
"@type": "@id",
},
"fedibird": "http://fedibird.com/ns#",
"misskey": "https://misskey-hub.net/ns#",
"quote": {
"@id": "https://w3id.org/fep/044f#quote",
"@type": "@id",
},
"quoteAuthorization": {
"@id": "https://w3id.org/fep/044f#quoteAuthorization",
"@type": "@id",
},
"quoteUri": "fedibird:quoteUri",
"quoteUrl": "as:quoteUrl",
"sensitive": "as:sensitive",
Expand Down
11 changes: 11 additions & 0 deletions src/activitypub/__snapshots__/publish-post-create-activity.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,28 @@
"https://w3id.org/identity/v1",
"https://www.w3.org/ns/activitystreams",
"https://w3id.org/security/data-integrity/v1",
"https://gotosocial.org/ns",
{
"ChatMessage": "http://litepub.social/ns#ChatMessage",
"Emoji": "toot:Emoji",
"Hashtag": "as:Hashtag",
"QuoteAuthorization": "https://w3id.org/fep/044f#QuoteAuthorization",
"QuoteRequest": "https://w3id.org/fep/044f#QuoteRequest",
"_misskey_quote": "misskey:_misskey_quote",
"emojiReactions": {
"@id": "fedibird:emojiReactions",
"@type": "@id",
},
"fedibird": "http://fedibird.com/ns#",
"misskey": "https://misskey-hub.net/ns#",
"quote": {
"@id": "https://w3id.org/fep/044f#quote",
"@type": "@id",
},
"quoteAuthorization": {
"@id": "https://w3id.org/fep/044f#quoteAuthorization",
"@type": "@id",
},
"quoteUri": "fedibird:quoteUri",
"quoteUrl": "as:quoteUrl",
"sensitive": "as:sensitive",
Expand Down
11 changes: 11 additions & 0 deletions src/activitypub/__snapshots__/publish-post-update-activity.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@
"https://w3id.org/security/data-integrity/v1",
"https://www.w3.org/ns/did/v1",
"https://w3id.org/security/multikey/v1",
"https://gotosocial.org/ns",
{
"ChatMessage": "http://litepub.social/ns#ChatMessage",
"Emoji": "toot:Emoji",
"Hashtag": "as:Hashtag",
"PropertyValue": "schema:PropertyValue",
"QuoteAuthorization": "https://w3id.org/fep/044f#QuoteAuthorization",
"QuoteRequest": "https://w3id.org/fep/044f#QuoteRequest",
"_misskey_followedMessage": "misskey:_misskey_followedMessage",
"_misskey_quote": "misskey:_misskey_quote",
"alsoKnownAs": {
Expand Down Expand Up @@ -40,6 +43,14 @@
"@id": "as:movedTo",
"@type": "@id",
},
"quote": {
"@id": "https://w3id.org/fep/044f#quote",
"@type": "@id",
},
"quoteAuthorization": {
"@id": "https://w3id.org/fep/044f#quoteAuthorization",
"@type": "@id",
},
"quoteUri": "fedibird:quoteUri",
"quoteUrl": "as:quoteUrl",
"schema": "http://schema.org#",
Expand Down
2 changes: 1 addition & 1 deletion src/activitypub/activity.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Activity, Actor } from '@fedify/fedify';
import type { Activity, Actor } from '@fedify/vocab';

import type { FedifyRequestContext } from '@/app';

Expand Down
2 changes: 1 addition & 1 deletion src/activitypub/activity.unit.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, expect, it, vi } from 'vitest';

import type { Activity, Actor } from '@fedify/fedify';
import type { Activity, Actor } from '@fedify/vocab';

import { FedifyActivitySender } from '@/activitypub/activity';
import type { FedifyRequestContext } from '@/app';
Expand Down
2 changes: 1 addition & 1 deletion src/activitypub/actor.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Actor } from '@fedify/fedify';
import type { Actor } from '@fedify/vocab';

import type { FedifyRequestContext } from '@/app';

Expand Down
2 changes: 1 addition & 1 deletion src/activitypub/actor.unit.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, expect, it, vi } from 'vitest';

import type { Actor } from '@fedify/fedify';
import type { Actor } from '@fedify/vocab';

import { FedifyActorResolver } from '@/activitypub/actor';
import type { FedifyRequestContext } from '@/app';
Expand Down
Loading
Loading