add eslint

This commit is contained in:
Michael Puckett 2022-10-14 22:32:58 -04:00
parent cd72417743
commit b416f53bb9
148 changed files with 1996 additions and 1258 deletions

View File

@ -1,3 +0,0 @@
{
"extends": "next/core-web-vitals"
}

1258
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -9,6 +9,8 @@
"ts-node": "^10.9.1"
},
"scripts": {
"package": "lerna exec npm publish"
"publish": "lerna publish",
"package": "lerna exec npm publish",
"build": "lerna run build"
}
}

View File

@ -0,0 +1,9 @@
{
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": ["@typescript-eslint"],
"extends": ["plugin:@typescript-eslint/recommended"]
}

View File

@ -1,7 +1,3 @@
import { DeliveryService } from '.';
import { AP } from 'activitypub-core-types';
export declare function broadcast(
this: DeliveryService,
activity: AP.Activity,
actor: AP.Actor,
): Promise<any[]>;
export declare function broadcast(this: DeliveryService, activity: AP.Activity, actor: AP.Actor): Promise<any[]>;

View File

@ -1 +1 @@
{"version":3,"file":"broadcast.js","sourceRoot":"","sources":["../src/broadcast.ts"],"names":[],"mappings":";;;AAEA,2EAAwD;AACxD,2EAAwD;AACxD,2EAA4D;AAMrD,KAAK,UAAU,SAAS,CAE7B,QAAqB,EACrB,KAAe;IAEf,MAAM,cAAc,GAAG,IAAA,uCAAU,EAAC,IAAA,uCAAU,EAAC,IAAA,2CAAc,EAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAExE,IAAI,CAAC,CAAC,OAAO,IAAI,cAAc,CAAC,EAAE;QAChC,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;KACrC;IAED,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,qBAAqB,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IAEpE,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,CAChC,UAAU,CAAC,GAAG,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE;QACjC,OAAO,MAAM,IAAI,CAAC,8BAA8B,CAC9C,SAAS,EACT,KAAK,EACL,cAAc,CACf,CAAC;IACJ,CAAC,CAAC,CACH,CAAC;IAEF,OAAO,OAAO,CAAC;AACjB,CAAC;AAxBD,8BAwBC"}
{"version":3,"file":"broadcast.js","sourceRoot":"","sources":["../src/broadcast.ts"],"names":[],"mappings":";;;AAEA,2EAAwD;AACxD,2EAAwD;AACxD,2EAA4D;AAMrD,KAAK,UAAU,SAAS,CAE7B,QAAqB,EACrB,KAAe;IAEf,MAAM,cAAc,GAAG,IAAA,uCAAU,EAAC,IAAA,uCAAU,EAAC,IAAA,2CAAc,EAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAExE,IAAI,CAAC,CAAC,OAAO,IAAI,cAAc,CAAC,EAAE;QAChC,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;KACrC;IAED,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,qBAAqB,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IAErE,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,CAC/B,UAAU,CAAC,GAAG,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE;QACjC,OAAO,MAAM,IAAI,CAAC,8BAA8B,CAC9C,SAAS,EACT,KAAK,EACL,cAAc,CACf,CAAC;IACJ,CAAC,CAAC,CACH,CAAC;IAEF,OAAO,OAAO,CAAC;AACjB,CAAC;AAxBD,8BAwBC"}

View File

@ -1,6 +1,3 @@
import { DeliveryService } from '.';
import { AP } from 'activitypub-core-types';
export declare function getPrivateKey(
this: DeliveryService,
actor: AP.Actor,
): Promise<any>;
export declare function getPrivateKey(this: DeliveryService, actor: AP.Actor): Promise<any>;

View File

@ -1,8 +1,4 @@
/// <reference types="node" />
import { DeliveryService } from '.';
import { AP } from 'activitypub-core-types';
export declare function getRecipientInboxUrls(
this: DeliveryService,
activity: AP.Activity,
actor: AP.Actor,
): Promise<URL[]>;
export declare function getRecipientInboxUrls(this: DeliveryService, activity: AP.Activity, actor: AP.Actor): Promise<URL[]>;

View File

@ -1,7 +1,4 @@
/// <reference types="node" />
import { AP } from 'activitypub-core-types';
import { DeliveryService } from '.';
export declare function getRecipientsList(
this: DeliveryService,
to: AP.EntityReference | AP.EntityReference[],
): Promise<URL[]>;
export declare function getRecipientsList(this: DeliveryService, to: AP.EntityReference | AP.EntityReference[]): Promise<URL[]>;

View File

@ -5,12 +5,12 @@ import { getRecipientInboxUrls } from './getRecipientInboxUrls';
import { getRecipientsList } from './getRecipientsList';
import { signAndSendToForeignActorInbox } from './signAndSendToForeignActorInbox';
export declare class DeliveryService {
databaseService: Database;
fetch: Function;
constructor(databaseService: Database, fetchFn?: Function);
getPrivateKey: typeof getPrivateKey;
signAndSendToForeignActorInbox: typeof signAndSendToForeignActorInbox;
broadcast: typeof broadcast;
getRecipientInboxUrls: typeof getRecipientInboxUrls;
getRecipientsList: typeof getRecipientsList;
databaseService: Database;
fetch: Function;
constructor(databaseService: Database, fetchFn?: Function);
getPrivateKey: typeof getPrivateKey;
signAndSendToForeignActorInbox: typeof signAndSendToForeignActorInbox;
broadcast: typeof broadcast;
getRecipientInboxUrls: typeof getRecipientInboxUrls;
getRecipientsList: typeof getRecipientsList;
}

View File

@ -1,9 +1,4 @@
/// <reference types="node" />
import { AP } from 'activitypub-core-types';
import { DeliveryService } from '.';
export declare function signAndSendToForeignActorInbox(
this: DeliveryService,
foreignActorInbox: URL,
actor: AP.Actor,
activity: AP.Activity,
): Promise<any>;
export declare function signAndSendToForeignActorInbox(this: DeliveryService, foreignActorInbox: URL, actor: AP.Actor, activity: AP.Activity): Promise<any>;

View File

@ -21,7 +21,8 @@
"build": "tsc --project tsconfig.json",
"test": "node --experimental-vm-modules ./node_modules/jest/bin/jest.js",
"dev": "node --experimental-vm-modules ./node_modules/jest/bin/jest.js --watch",
"format": "prettier --config .prettierrc \"**/*.ts\" --write"
"format": "prettier --config .prettierrc \"**/*.ts\" --write",
"lint": "eslint src/**/*.ts"
},
"bugs": {
"url": "https://github.com/michaelcpuckett/activitypub-core/issues"
@ -34,7 +35,10 @@
"devDependencies": {
"@types/jest": "^29.1.2",
"@types/jsonld": "^1.5.6",
"@typescript-eslint/eslint-plugin": "^5.40.0",
"@typescript-eslint/parser": "^5.40.0",
"dotenv": "^16.0.3",
"eslint": "^8.25.0",
"jest": "^29.1.2",
"prettier": "^2.7.1",
"ts-jest": "^29.0.3",

View File

@ -22,8 +22,7 @@
},
"scripts": {
"build": "tsc --project tsconfig.json",
"dev": "ts-node ./src/index.tsx",
"server": "node ./lib/index.js"
"serve": "ts-node ./src/index.tsx"
},
"dependencies": {
"activitypub-core-delivery": "^0.0.55",

View File

@ -19,8 +19,7 @@
},
"scripts": {
"build": "tsc --project tsconfig.json",
"dev": "ts-node ./src/index.tsx",
"server": "node ./lib/index.js"
"serve": "ts-node ./src/index.tsx"
},
"dependencies": {
"activitypub-core-delivery": "^0.0.55",

View File

@ -0,0 +1,9 @@
{
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": ["@typescript-eslint"],
"extends": ["plugin:@typescript-eslint/recommended"]
}

View File

@ -4,33 +4,17 @@ import { AP } from 'activitypub-core-types';
import type { ServiceAccount } from 'firebase-admin';
import { DeliveryService } from 'activitypub-core-delivery';
import type { Database } from 'activitypub-core-types/index';
export declare const activityPub: (
{
renderIndex,
renderHome,
renderEntity,
}: {
export declare const activityPub: ({ renderIndex, renderHome, renderEntity, }: {
renderIndex: () => Promise<string>;
renderHome: ({ actor }: { actor: AP.Actor }) => Promise<string>;
renderEntity: ({
entity,
actor,
}: {
entity: AP.Entity;
actor?: AP.Actor;
renderHome: ({ actor }: {
actor: AP.Actor;
}) => Promise<string>;
},
{
serviceAccount,
databaseService,
deliveryService,
}: {
renderEntity: ({ entity, actor, }: {
entity: AP.Entity;
actor?: AP.Actor;
}) => Promise<string>;
}, { serviceAccount, databaseService, deliveryService, }: {
serviceAccount: ServiceAccount;
databaseService: Database;
deliveryService: DeliveryService;
},
) => (
req: IncomingMessage,
res: ServerResponse,
next: NextFunction,
) => Promise<void>;
}) => (req: IncomingMessage, res: ServerResponse, next: NextFunction) => Promise<void>;

View File

@ -26,7 +26,9 @@ const activityPub = ({ renderIndex, renderHome, renderEntity, }, { serviceAccoun
}
if (req.url.startsWith('/actor/') && req.url.endsWith('/outbox')) {
const result = await (0, activitypub_core_1.outboxHandler)(req, res, serviceAccount, databaseService, deliveryService);
if (result.props && Object.keys(result.props).length && 'entity' in result.props) {
if (result.props &&
Object.keys(result.props).length &&
'entity' in result.props) {
res.statusCode = 200;
res.setHeader(activitypub_core_utilities_1.CONTENT_TYPE_HEADER, activitypub_core_utilities_1.HTML_CONTENT_TYPE);
res.write(await renderEntity({
@ -64,7 +66,9 @@ const activityPub = ({ renderIndex, renderHome, renderEntity, }, { serviceAccoun
res.end();
return;
}
if (req.url.startsWith('/object/') || req.url.startsWith('/actor/') || req.url.startsWith('/activity/')) {
if (req.url.startsWith('/object/') ||
req.url.startsWith('/actor/') ||
req.url.startsWith('/activity/')) {
const result = await (0, activitypub_core_1.entityGetHandler)(req, res, serviceAccount, databaseService);
if (result.props && Object.keys(result.props).length) {
res.statusCode = 200;

View File

@ -1 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAEA,uDAAsI;AAKtI,2EAA0G;AAEnG,MAAM,WAAW,GAAG,CAAC,EAC1B,WAAW,EACX,UAAU,EACV,YAAY,GAKb,EAAE,EACD,cAAc,EACd,eAAe,EACf,eAAe,GAKhB,EAAE,EAAE,CAAC,KAAK,EAAE,GAAoB,EAAE,GAAmB,EAAE,IAAkB,EAAE,EAAE;IAC5E,IAAI,GAAG,CAAC,GAAG,KAAK,OAAO,IAAI,GAAG,CAAC,MAAM,KAAK,MAAM,EAAE;QAChD,MAAM,IAAA,kCAAe,EAAC,GAAG,EAAE,GAAG,EAAE,cAAc,EAAE,eAAe,CAAC,CAAC;QAC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B,CAAC,CAAC;YACtD,GAAG,CAAC,KAAK,CACP,MAAM,YAAY,CAChB,IAAA,iDAAoB,EAAC,MAAM,CAAC,KAAK,CAGhC,CACF,CACF,CAAC;YACF,GAAG,CAAC,GAAG,EAAE,CAAC;YACV,OAAO;SACR;QAED,GAAG,CAAC,UAAU,GAAG,GAAG,CAAC;QACrB,GAAG,CAAC,GAAG,EAAE,CAAC;QACV,OAAO;KACR;IAED,IAAI,EAAE,CAAC;AACT,CAAC,CAAC;AAzKS,QAAA,WAAW,eAyKpB"}

View File

@ -13,13 +13,17 @@
"lib"
],
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.40.0",
"@typescript-eslint/parser": "^5.40.0",
"eslint": "^8.25.0",
"prettier": "^2.7.1",
"ts-node": "^10.9.1"
},
"scripts": {
"build": "tsc --project tsconfig.json",
"dev": "ts-node ./src/index.ts",
"format": "prettier --config .prettierrc \"**/*.ts\" --write"
"format": "prettier --config .prettierrc \"**/*.ts\" --write",
"lint": "eslint src/**/*.ts"
},
"dependencies": {
"activitypub-core": "^0.0.55",

View File

@ -0,0 +1,9 @@
{
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": ["@typescript-eslint"],
"extends": ["plugin:@typescript-eslint/recommended"]
}

View File

@ -1,9 +1,6 @@
/// <reference types="react" />
import { AP } from 'activitypub-core-types';
export declare function ActivityEntity({
activity,
headingLevel,
}: {
activity: AP.Activity;
headingLevel: number;
export declare function ActivityEntity({ activity, headingLevel }: {
activity: AP.Activity;
headingLevel: number;
}): JSX.Element;

View File

@ -1,9 +1,6 @@
/// <reference types="react" />
import { AP } from 'activitypub-core-types';
export declare function ActorEntity({
actor,
headingLevel,
}: {
actor: AP.Actor;
headingLevel: number;
export declare function ActorEntity({ actor, headingLevel }: {
actor: AP.Actor;
headingLevel: number;
}): JSX.Element;

View File

@ -1,11 +1,7 @@
/// <reference types="react" />
import { AP } from 'activitypub-core-types';
export declare function CollectionEntity({
collection,
actor,
headingLevel,
}: {
collection: AP.Collection;
actor: AP.Actor;
headingLevel: number;
export declare function CollectionEntity({ collection, actor, headingLevel }: {
collection: AP.Collection;
actor: AP.Actor;
headingLevel: number;
}): JSX.Element;

View File

@ -1,7 +1,5 @@
/// <reference types="react" />
import { AP } from 'activitypub-core-types';
export declare function CollectionPageEntity({
collectionPage,
}: {
collectionPage: AP.CollectionPage;
export declare function CollectionPageEntity({ collectionPage }: {
collectionPage: AP.CollectionPage;
}): JSX.Element;

View File

@ -1,3 +1,5 @@
/// <reference types="react" />
import { AP } from 'activitypub-core-types';
export declare function LinkEntity({ link }: { link: AP.Link }): JSX.Element;
export declare function LinkEntity({ link }: {
link: AP.Link;
}): JSX.Element;

View File

@ -1,9 +1,6 @@
/// <reference types="react" />
import { AP } from 'activitypub-core-types';
export declare function NoteEntity({
note,
headingLevel,
}: {
note: AP.Note;
headingLevel: number;
export declare function NoteEntity({ note, headingLevel }: {
note: AP.Note;
headingLevel: number;
}): JSX.Element;

View File

@ -1,9 +1,6 @@
/// <reference types="react" />
import { AP } from 'activitypub-core-types';
export declare function ObjectEntity({
object,
headingLevel,
}: {
object: AP.ExtendedObject;
headingLevel: number;
export declare function ObjectEntity({ object, headingLevel }: {
object: AP.ExtendedObject;
headingLevel: number;
}): JSX.Element;

View File

@ -1,9 +1,6 @@
/// <reference types="react" />
import { AP } from 'activitypub-core-types';
export declare function OrderedCollectionEntity({
collection,
headingLevel,
}: {
collection: AP.OrderedCollection;
headingLevel: number;
export declare function OrderedCollectionEntity({ collection, headingLevel }: {
collection: AP.OrderedCollection;
headingLevel: number;
}): JSX.Element;

View File

@ -1,7 +1,5 @@
/// <reference types="react" />
import { AP } from 'activitypub-core-types';
export declare function OrderedCollectionPageEntity({
orderedCollectionPage,
}: {
orderedCollectionPage: AP.OrderedCollectionPage;
export declare function OrderedCollectionPageEntity({ orderedCollectionPage }: {
orderedCollectionPage: AP.OrderedCollectionPage;
}): JSX.Element;

View File

@ -1,9 +1,6 @@
/// <reference types="react" />
import { AP } from 'activitypub-core-types';
export declare function EntityPage({
entity,
actor,
}: {
entity: AP.Entity;
actor?: AP.Actor;
export declare function EntityPage({ entity, actor, }: {
entity: AP.Entity;
actor?: AP.Actor;
}): JSX.Element;

View File

@ -1,9 +1,6 @@
/// <reference types="react" />
import { AP } from 'activitypub-core-types';
export declare function CreateForm({
actor,
headingLevel,
}: {
actor: AP.Actor;
headingLevel: number;
export declare function CreateForm({ actor, headingLevel }: {
actor: AP.Actor;
headingLevel: number;
}): JSX.Element;

View File

@ -1,3 +1,5 @@
/// <reference types="react" />
import { AP } from 'activitypub-core-types';
export declare function Sidebar({ actor }: { actor?: AP.Actor }): JSX.Element;
export declare function Sidebar({ actor }: {
actor?: AP.Actor;
}): JSX.Element;

View File

@ -1,9 +1,6 @@
/// <reference types="react" />
import { AP } from 'activitypub-core-types';
export declare function Welcome({
actor,
headingLevel,
}: {
actor: AP.Actor;
headingLevel: number;
export declare function Welcome({ actor, headingLevel }: {
actor: AP.Actor;
headingLevel: number;
}): JSX.Element;

View File

@ -1,7 +1,7 @@
/// <reference types="react" />
import { AP } from 'activitypub-core-types';
declare type Data = {
actor: AP.Actor;
actor: AP.Actor;
};
export declare function HomePage({ actor }: Data): JSX.Element;
export {};

View File

@ -17,10 +17,14 @@
"scripts": {
"build": "tsc --project tsconfig.json",
"dev": "ts-node ./src/index.ts",
"format": "prettier --config .prettierrc \"**/*.ts\" --write"
"format": "prettier --config .prettierrc \"**/*.ts\" --write",
"lint": "eslint src/**/*.ts"
},
"devDependencies": {
"@types/react": "^18.0.21",
"@typescript-eslint/eslint-plugin": "^5.40.0",
"@typescript-eslint/parser": "^5.40.0",
"eslint": "^8.25.0",
"prettier": "^2.7.1",
"ts-node": "^10.9.1"
},

View File

@ -0,0 +1,9 @@
{
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": ["@typescript-eslint"],
"extends": ["plugin:@typescript-eslint/recommended"]
}

View File

@ -1,6 +1,3 @@
import { MongoDatabase } from '.';
import { AP } from 'activitypub-core-types';
export declare function expandCollection(
this: MongoDatabase,
collection: AP.EitherCollectionReference,
): Promise<null | AP.EitherCollection>;
export declare function expandCollection(this: MongoDatabase, collection: AP.EitherCollectionReference): Promise<null | AP.EitherCollection>;

View File

@ -1,6 +1,3 @@
import { MongoDatabase } from '.';
import { AP } from 'activitypub-core-types';
export declare function expandEntity(
this: MongoDatabase,
originalEntity: AP.Entity,
): Promise<AP.Entity>;
export declare function expandEntity(this: MongoDatabase, originalEntity: AP.Entity): Promise<AP.Entity>;

View File

@ -1,7 +1,4 @@
/// <reference types="node" />
import { MongoDatabase } from '.';
import { AP } from 'activitypub-core-types';
export declare function fetchEntityById(
this: MongoDatabase,
id: URL,
): Promise<AP.Entity | null>;
export declare function fetchEntityById(this: MongoDatabase, id: URL): Promise<AP.Entity | null>;

View File

@ -1 +1 @@
{"version":3,"file":"fetchEntityById.js","sourceRoot":"","sources":["../src/fetchEntityById.ts"],"names":[],"mappings":";;;AAEA,2EAIoC;AACpC,2EAA4D;AAC5D,2EAAkE;AAClE,2EAA4D;AAErD,KAAK,UAAU,eAAe,CAEnC,EAAO;IAEP,IAAI,OAAO,IAAI,CAAC,KAAK,KAAK,UAAU,EAAE;QACpC,OAAO,IAAI,CAAC;KACb;IAID,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,QAAQ,EAAE,EAAE;QACnD,OAAO,EAAE;YACP,CAAC,gDAAmB,CAAC,EAAE,yDAA4B;YACnD,CAAC,0CAAa,CAAC,EAAE,yDAA4B;SAC9C;KACF,CACA;SACE,IAAI,CAAC,KAAK,EAAE,QAEZ,EAAE,EAAE;QACH,OAAO,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;IAC/B,CAAC,CAAC;SACD,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;QACxB,OAAO,CAAC,GAAG,CAAC,MAAM,CAA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,EAAE,EAAE;QACtE,OAAO,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;IAC/B,CAAC,CACF;SACA,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;QACxB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAC3B,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;IAEL,IACE,CAAC,CACC,OAAO,YAAY,KAAK,QAAQ;QAChC,YAAY;QACZ,MAAM,IAAI,YAAY,CACvB,EACD;QACA,OAAO,IAAI,CAAC;KACb;IAED,MAAM,eAAe,GAAG,IAAA,iDAAoB,EAAC,YAAY,CAAC,CAAC;IAE3D,IACE,CAAC,CAAC,MAAM,IAAI,eAAe,CAAC;QAC5B,OAAO,eAAe,CAAC,IAAI,KAAK,QAAQ,EACxC;QACA,OAAO,IAAI,CAAC;KACb;IAED,MAAM,uBAAuB,GAGzB;QACF,GAAG,eAAe;QAClB,IAAI,EAAE,eAAe,CAAC,IAAI;KAC3B,CAAC;IAEF,MAAM,UAAU,GAAG,IAAA,2CAAc,EAAC,uBAAuB,CAAC,CAAC;IAE3D,IAAI,CAAC,UAAU,EAAE;QACf,OAAO,IAAI,CAAC;KACb;IAED,MAAM,gBAAgB,GAAG,IAAA,2CAAc,EAAC,UAAU,CAAC,CAAC;IAKpD,OAAO,IAAA,iDAAoB,EAAC,gBAA8C,CAAC,CAAC;AAC9E,CAAC;AAjED,0CAiEC"}

View File

@ -1,9 +1,5 @@
import { MongoDatabase } from '.';
import { AP } from 'activitypub-core-types';
export declare function findAll(
this: MongoDatabase,
collection: string,
matchingObject: {
export declare function findAll(this: MongoDatabase, collection: string, matchingObject: {
[key: string]: unknown;
},
): Promise<AP.Entity[] | null>;
}): Promise<AP.Entity[] | null>;

View File

@ -1,7 +1,4 @@
/// <reference types="node" />
import { MongoDatabase } from '.';
import { AP } from 'activitypub-core-types';
export declare function findEntityById(
this: MongoDatabase,
id: URL,
): Promise<AP.Entity | null>;
export declare function findEntityById(this: MongoDatabase, id: URL): Promise<AP.Entity | null>;

View File

@ -1,9 +1,5 @@
import { MongoDatabase } from '.';
import { AP } from 'activitypub-core-types';
export declare function findOne(
this: MongoDatabase,
collection: string,
matchingObject: {
export declare function findOne(this: MongoDatabase, collection: string, matchingObject: {
[key: string]: unknown;
},
): Promise<AP.Entity | null>;
}): Promise<AP.Entity | null>;

View File

@ -1,6 +1,2 @@
import { MongoDatabase } from '.';
export declare function findStringIdByValue(
this: MongoDatabase,
dbCollection: string,
value: string,
): Promise<string>;
export declare function findStringIdByValue(this: MongoDatabase, dbCollection: string, value: string): Promise<string>;

View File

@ -1,6 +1,2 @@
import { MongoDatabase } from '.';
export declare function findStringValueById(
this: MongoDatabase,
dbCollection: string,
_id: string,
): Promise<string>;
export declare function findStringValueById(this: MongoDatabase, dbCollection: string, _id: string): Promise<string>;

View File

@ -1,8 +1,4 @@
import { MongoDatabase } from '.';
import { AP } from 'activitypub-core-types';
import { ServiceAccount } from 'firebase-admin';
export declare function getActorByToken(
this: MongoDatabase,
token: string,
credentials: ServiceAccount,
): Promise<AP.Actor | null>;
export declare function getActorByToken(this: MongoDatabase, token: string, credentials: ServiceAccount): Promise<AP.Actor | null>;

View File

@ -1,7 +1,3 @@
import { MongoDatabase } from '.';
import { ServiceAccount } from 'firebase-admin';
export declare function getAuthenticatedUserIdByToken(
this: MongoDatabase,
token: string,
serviceAccount: ServiceAccount,
): Promise<string | null>;
export declare function getAuthenticatedUserIdByToken(this: MongoDatabase, token: string, serviceAccount: ServiceAccount): Promise<string | null>;

View File

@ -1 +1 @@
{"version":3,"file":"getAuthenticatedUserIdByToken.js","sourceRoot":"","sources":["../src/getAuthenticatedUserIdByToken.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,8DAAgD;AAGzC,KAAK,UAAU,6BAA6B,CAEjD,KAAa,EACb,cAA8B;IAE9B,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,EAAE;Q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AAI,EAAE;aACN,aAAa,CAAC,KAAK,CAAC;aACpB,IAAI,CAAC,KAAK,EAAE,cAAc,EAAE,EAAE;YAC7B,OAAO,cAAc,IAAI,IAAI,CAAC;QAChC,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;YACxB,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YAC7B,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CAAC;IAET,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE;QACd,OAAO,IAAI,CAAC;KACb;IAED,OAAO,IAAI,CAAC,GAAG,CAAC;AAClB,CAAC;AAhCD,sEAgCC"}

View File

@ -1,7 +1,4 @@
/// <reference types="node" />
import { MongoDatabase } from '.';
import { AP } from 'activitypub-core-types';
export declare function getCollectionItems(
this: MongoDatabase,
entity: URL | AP.Collection | AP.OrderedCollection,
): Promise<AP.EntityReference[]>;
export declare function getCollectionItems(this: MongoDatabase, entity: URL | AP.Collection | AP.OrderedCollection): Promise<AP.EntityReference[]>;

View File

@ -30,10 +30,12 @@ async function getCollectionItems(entity) {
for (const item of collectionItems) {
if (item instanceof URL) {
const foundEntity = await this.queryById(item);
result.push(foundEntity ? await this.expandEntity(foundEntity) : {
type: activitypub_core_types_1.AP.CoreObjectTypes.TOMBSTONE,
content: 'Not found',
});
result.push(foundEntity
? await this.expandEntity(foundEntity)
: {
type: activitypub_core_types_1.AP.CoreObjectTypes.TOMBSTONE,
content: 'Not found',
});
}
else if (!Array.isArray(item) && item.id instanceof URL) {
const foundEntity = await this.queryById(item.id);

View File

@ -1 +1 @@
{"version":3,"file":"getCollectionItems.js","sourceRoot":"","sources":["../src/getCollectionItems.ts"],"names":[],"mappings":";;;AACA,mEAA4C;AAC5C,2EAAmD;AAE5C,KAAK,UAAU,kBAAkB,CAEtC,MAAkD;IAElD,MAAM,EAAE,GAAG,IAAA,kCAAK,EAAC,MAAM,CAAC,CAAC;IAEzB,IAAI,CA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CAAC;IAEvB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE;QACnC,OAAO,EAAE,CAAC;KACX;IAED,MAAM,MAAM,GAAyB,EAAE,CAAC;IAExC,KAAK,MAAM,IAAI,IAAI,eAAe,EAAE;QAClC,IAAI,IAAI,YAAY,GAAG,EAAE;YACvB,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;YAE/C,MAAM,CAAC,IAAI,CACT,WAAW;gBACT,CAAC,CAAC,MAAM,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC;gBACtC,CAAC,CAAC;oBACE,IAAI,EAAE,2BAAE,CAAC,eAAe,CAAC,SAAS;oBAClC,OAAO,EAAE,WAAW;iBACrB,CACN,CAAC;SACH;aAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,EAAE,YAAY,GAAG,EAAE;YACzD,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YAElD,MAAM,CAAC,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,CAAC;SAClC;KACF;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AA/DD,gDA+DC"}

View File

@ -5,12 +5,7 @@ import { findStringValueById } from './findStringValueById';
import { findStringIdByValue } from './findStringIdByValue';
import { saveEntity } from './saveEntity';
import { saveString } from './saveString';
import {
insertItem,
removeOrderedItem,
insertOrderedItem,
removeItem,
} from './insert';
import { insertItem, removeOrderedItem, insertOrderedItem, removeItem } from './insert';
import { fetchEntityById } from './fetchEntityById';
import { queryById } from './queryById';
import { expandEntity } from './expandEntity';
@ -21,28 +16,28 @@ import { getAuthenticatedUserIdByToken } from './getAuthenticatedUserIdByToken';
import { getActorByToken } from './getActorByToken';
import type { Database, DatabaseService } from 'activitypub-core-types/index';
export declare class MongoDatabase implements Database {
db: Db;
fetch: Function;
constructor(db: Db, fetchFn?: Function);
findOne: typeof findOne;
findAll: typeof findAll;
findEntityById: typeof findEntityById;
findStringValueById: typeof findStringValueById;
findStringIdByValue: typeof findStringIdByValue;
getAuthenticatedUserIdByToken: typeof getAuthenticatedUserIdByToken;
getActorByToken: typeof getActorByToken;
saveEntity: typeof saveEntity;
saveString: typeof saveString;
insertItem: typeof insertItem;
removeItem: typeof removeItem;
insertOrderedItem: typeof insertOrderedItem;
removeOrderedItem: typeof removeOrderedItem;
fetchEntityById: typeof fetchEntityById;
queryById: typeof queryById;
expandEntity: typeof expandEntity;
getCollectionItems: typeof getCollectionItems;
expandCollection: typeof expandCollection;
db: Db;
fetch: Function;
constructor(db: Db, fetchFn?: Function);
findOne: typeof findOne;
findAll: typeof findAll;
findEntityById: typeof findEntityById;
findStringValueById: typeof findStringValueById;
findStringIdByValue: typeof findStringIdByValue;
getAuthenticatedUserIdByToken: typeof getAuthenticatedUserIdByToken;
getActorByToken: typeof getActorByToken;
saveEntity: typeof saveEntity;
saveString: typeof saveString;
insertItem: typeof insertItem;
removeItem: typeof removeItem;
insertOrderedItem: typeof insertOrderedItem;
removeOrderedItem: typeof removeOrderedItem;
fetchEntityById: typeof fetchEntityById;
queryById: typeof queryById;
expandEntity: typeof expandEntity;
getCollectionItems: typeof getCollectionItems;
expandCollection: typeof expandCollection;
}
export declare class MongoDatabaseService implements DatabaseService {
connect(): Promise<MongoDatabase>;
connect(): Promise<MongoDatabase>;
}

View File

@ -49,7 +49,6 @@ class MongoDatabase {
expandCollection = expandCollection_1.expandCollection;
}
exports.MongoDatabase = MongoDatabase;
;
class MongoDatabaseService {
async connect() {
const client = new mongodb_1.MongoClient(activitypub_core_utilities_1.MONGO_CLIENT_URL, {

View File

@ -1 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,2EAAuE;AACvE,wEAAqC;AACrC,qCAA0C;AAE1C,uCAAoC;AACpC,qDAAkD;AAClD,+DAA4D;AAC5D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AC;CAC5C;AA5CD,sCA4CC;AAED,MAAa,oBAAoB;IAC/B,KAAK,CAAC,OAAO;QACX,MAAM,MAAM,GAAG,IAAI,qBAAW,CAAC,6CAAgB,EAAE;YAC/C,WAAW,EAAE,EAAE;SAChB,CAAC,CAAC;QACH,MAAM,MAAM,CAAC,OAAO,EAAE,CAAC;QACvB,MAAM,EAAE,GAAG,MAAM,CAAC,EAAE,CAAC,oCAAO,CAAC,CAAC;QAC9B,OAAO,IAAI,aAAa,CAAC,EAAE,EAAE,0BAAK,CAAC,CAAC;IACtC,CAAC;CACF;AATD,oDASC"}

View File

@ -1,22 +1,6 @@
/// <reference types="node" />
import { MongoDatabase } from '.';
export declare function insertOrderedItem(
this: MongoDatabase,
path: URL,
url: URL,
): Promise<void>;
export declare function removeOrderedItem(
this: MongoDatabase,
path: URL,
url: URL,
): Promise<void>;
export declare function insertItem(
this: MongoDatabase,
path: URL,
url: URL,
): Promise<void>;
export declare function removeItem(
this: MongoDatabase,
path: URL,
url: URL,
): Promise<void>;
export declare function insertOrderedItem(this: MongoDatabase, path: URL, url: URL): Promise<void>;
export declare function removeOrderedItem(this: MongoDatabase, path: URL, url: URL): Promise<void>;
export declare function insertItem(this: MongoDatabase, path: URL, url: URL): Promise<void>;
export declare function removeItem(this: MongoDatabase, path: URL, url: URL): Promise<void>;

View File

@ -1,7 +1,4 @@
/// <reference types="node" />
import { MongoDatabase } from '.';
import { AP } from 'activitypub-core-types';
export declare function queryById(
this: MongoDatabase,
id: URL,
): Promise<AP.Entity | null>;
export declare function queryById(this: MongoDatabase, id: URL): Promise<AP.Entity | null>;

View File

@ -1,6 +1,3 @@
import { MongoDatabase } from '.';
import { AP } from 'activitypub-core-types';
export declare function saveEntity(
this: MongoDatabase,
entity: AP.Entity,
): Promise<import('bson').Document | import('mongodb').UpdateResult>;
export declare function saveEntity(this: MongoDatabase, entity: AP.Entity): Promise<import("bson").Document | import("mongodb").UpdateResult>;

View File

@ -1 +1 @@
{"version":3,"file":"saveEntity.js","sourceRoot":"","sources":["../src/saveEntity.ts"],"names":[],"mappings":";;;AAEA,2EAAkH;AAE3G,KAAK,UAAU,UAAU,CAAsB,MAAiB;IACrE,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE;QACd,MAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC;KAC3B;IAED,MAAM,cAAc,GAAG,IAAA,mDAAsB,EAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACzD,MAAM,GAAG,GAAG,MAAM,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC;IACjC,MAAM,eAAe,GAAG,IAAA,uCAAU,EAAC,IAAA,iDAAoB,EAAC,IAAA,uCAAU,EAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAE7E,OAAO,MAAM,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC,UAAU,CACxD;QACE,GAAG;KACJ,EACD,eAAe,EACf;QACE,MAAM,EAAE,IAAI;KACb,CACF,CAAC;AACJ,CAAC;AAlBD,gCAkBC"}
{"version":3,"file":"saveEntity.js","sourceRoot":"","sources":["../src/saveEntity.ts"],"names":[],"mappings":";;;AAEA,2EAKoC;AAE7B,KAAK,UAAU,UAAU,CAAsB,MAAiB;IACrE,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE;QACd,MAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC;KAC3B;IAED,MAAM,cAAc,GAAG,IAAA,mDAAsB,EAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACzD,MAAM,GAAG,GAAG,MAAM,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC;IACjC,MAAM,eAAe,GAAG,IAAA,uCAAU,EAAC,IAAA,iDAAoB,EAAC,IAAA,uCAAU,EAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAE7E,OAAO,MAAM,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC,UAAU,CACxD;QACE,GAAG;KACJ,EACD,eAAe,EACf;QACE,MAAM,EAAE,IAAI;KACb,CACF,CAAC;AACJ,CAAC;AAlBD,gCAkBC"}

View File

@ -1,7 +1,2 @@
import { MongoDatabase } from '.';
export declare function saveString(
this: MongoDatabase,
dbCollection: string,
_id: string,
value: string,
): Promise<import('bson').Document | import('mongodb').UpdateResult>;
export declare function saveString(this: MongoDatabase, dbCollection: string, _id: string, value: string): Promise<import("bson").Document | import("mongodb").UpdateResult>;

View File

@ -21,7 +21,8 @@
"build": "tsc --project tsconfig.json",
"test": "node --experimental-vm-modules ./node_modules/jest/bin/jest.js",
"dev": "node --experimental-vm-modules ./node_modules/jest/bin/jest.js --watch",
"format": "prettier --config .prettierrc \"**/*.ts\" --write"
"format": "prettier --config .prettierrc \"**/*.ts\" --write",
"lint": "eslint src/**/*.ts"
},
"bugs": {
"url": "https://github.com/michaelcpuckett/activitypub-core/issues"
@ -35,7 +36,10 @@
},
"devDependencies": {
"@types/jest": "^29.1.2",
"@typescript-eslint/eslint-plugin": "^5.40.0",
"@typescript-eslint/parser": "^5.40.0",
"dotenv": "^16.0.3",
"eslint": "^8.25.0",
"jest": "^29.1.2",
"prettier": "^2.7.1",
"ts-jest": "^29.0.3",

View File

@ -0,0 +1,9 @@
{
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": ["@typescript-eslint"],
"extends": ["plugin:@typescript-eslint/recommended"]
}

View File

@ -4,45 +4,42 @@ import type { EntityReference } from '.';
import type { StringReferenceMap } from '../util/values';
import type { ImageReference } from '../Extended/ExtendedObject';
import type { LinkReference } from './Link';
import type {
CollectionReference,
OrderedCollectionReference,
} from '../Extended/Collection';
import type { CollectionReference, OrderedCollectionReference } from '../Extended/Collection';
export interface BaseCoreObject extends BaseEntity {
type: typeof CoreObjectTypes[keyof typeof CoreObjectTypes];
attachment?: EntityReference | EntityReference[];
attributedTo?: EntityReference | EntityReference[];
audience?: EntityReference | EntityReference[];
bcc?: EntityReference | EntityReference[];
bto?: EntityReference | EntityReference[];
cc?: EntityReference | EntityReference[];
content?: string;
contentMap?: StringReferenceMap;
context?: EntityReference | EntityReference[];
duration?: string;
endTime?: Date;
generator?: EntityReference | EntityReference[];
icon?: ImageReference | ImageReference[] | LinkReference | LinkReference[];
image?: ImageReference | ImageReference[] | LinkReference | LinkReference[];
inReplyTo?: EntityReference | EntityReference[];
location?: EntityReference | EntityReference[];
mediaType?: string;
name?: string;
nameMap?: StringReferenceMap;
preview?: EntityReference | EntityReference[];
published?: Date;
replies?: CollectionReference;
startTime?: Date;
summary?: string;
summaryMap?: StringReferenceMap;
tag?: EntityReference | EntityReference[];
to?: EntityReference | EntityReference[];
updated?: Date;
url?: LinkReference | LinkReference[];
likes?: OrderedCollectionReference;
shares?: OrderedCollectionReference;
source?: {
type: typeof CoreObjectTypes[keyof typeof CoreObjectTypes];
attachment?: EntityReference | EntityReference[];
attributedTo?: EntityReference | EntityReference[];
audience?: EntityReference | EntityReference[];
bcc?: EntityReference | EntityReference[];
bto?: EntityReference | EntityReference[];
cc?: EntityReference | EntityReference[];
content?: string;
contentMap?: StringReferenceMap;
};
context?: EntityReference | EntityReference[];
duration?: string;
endTime?: Date;
generator?: EntityReference | EntityReference[];
icon?: ImageReference | ImageReference[] | LinkReference | LinkReference[];
image?: ImageReference | ImageReference[] | LinkReference | LinkReference[];
inReplyTo?: EntityReference | EntityReference[];
location?: EntityReference | EntityReference[];
mediaType?: string;
name?: string;
nameMap?: StringReferenceMap;
preview?: EntityReference | EntityReference[];
published?: Date;
replies?: CollectionReference;
startTime?: Date;
summary?: string;
summaryMap?: StringReferenceMap;
tag?: EntityReference | EntityReference[];
to?: EntityReference | EntityReference[];
updated?: Date;
url?: LinkReference | LinkReference[];
likes?: OrderedCollectionReference;
shares?: OrderedCollectionReference;
source?: {
content?: string;
contentMap?: StringReferenceMap;
};
}

View File

@ -1,7 +1,7 @@
/// <reference types="node" />
import { AllTypes } from '../util/const';
export declare type BaseEntity = {
'@context'?: URL | URL[] | unknown;
id?: URL | null;
type: typeof AllTypes[keyof typeof AllTypes];
'@context'?: URL | URL[] | unknown;
id?: URL | null;
type: typeof AllTypes[keyof typeof AllTypes];
};

View File

@ -4,19 +4,19 @@ import { LinkTypes } from '../util/const';
import { StringReferenceMap } from '../util/values';
import { EntityReference } from '.';
export interface BaseLink extends BaseEntity {
type: typeof LinkTypes[keyof typeof LinkTypes];
height?: number;
href?: URL;
hrefLang?: string;
mediaType?: string;
name?: string;
nameMap?: StringReferenceMap;
preview?: EntityReference | EntityReference[];
rel?: string | string[];
width?: number;
type: typeof LinkTypes[keyof typeof LinkTypes];
height?: number;
href?: URL;
hrefLang?: string;
mediaType?: string;
name?: string;
nameMap?: StringReferenceMap;
preview?: EntityReference | EntityReference[];
rel?: string | string[];
width?: number;
}
export interface Mention extends BaseLink {
type: typeof LinkTypes.MENTION;
type: typeof LinkTypes.MENTION;
}
export declare type Link = BaseLink | Mention;
export declare type LinkReference = URL | Link;

View File

@ -6,14 +6,7 @@ import { Activity } from '../Extended/Activity';
import { Collection, OrderedCollection } from '../Extended/Collection';
import { CollectionPage, OrderedCollectionPage } from '../Extended/Collection';
export type { Link, LinkReference, Mention } from './Link';
export declare type CoreObject =
| ExtendedObject
| Actor
| Activity
| Collection
| OrderedCollection
| CollectionPage
| OrderedCollectionPage;
export declare type CoreObject = ExtendedObject | Actor | Activity | Collection | OrderedCollection | CollectionPage | OrderedCollectionPage;
export declare type CoreObjectReference = URL | CoreObject;
export declare type Entity = CoreObject | Link;
export declare type EntityReference = URL | CoreObject | Link;

View File

@ -3,133 +3,105 @@ import { BaseCoreObject } from '../Core/CoreObject';
import { ActivityTypes } from '../util/const';
import { EntityReference } from '../Core';
declare type BaseActivity = BaseCoreObject & {
type: typeof ActivityTypes[keyof typeof ActivityTypes];
actor: EntityReference | EntityReference[];
object?: EntityReference | EntityReference[];
target?: EntityReference | EntityReference[];
result?: EntityReference | EntityReference[];
origin?: EntityReference | EntityReference[];
instrument?: EntityReference | EntityReference[];
type: typeof ActivityTypes[keyof typeof ActivityTypes];
actor: EntityReference | EntityReference[];
object?: EntityReference | EntityReference[];
target?: EntityReference | EntityReference[];
result?: EntityReference | EntityReference[];
origin?: EntityReference | EntityReference[];
instrument?: EntityReference | EntityReference[];
};
export declare type IntransitiveActivity = Omit<BaseActivity, 'object'>;
export declare type TransitiveActivity = BaseActivity & {
object: EntityReference | EntityReference[];
object: EntityReference | EntityReference[];
};
export declare type Accept = BaseActivity & {
type: typeof ActivityTypes.ACCEPT;
type: typeof ActivityTypes.ACCEPT;
};
export declare type TentativeAccept = Accept & {
type: typeof ActivityTypes.TENTATIVE_ACCEPT;
type: typeof ActivityTypes.TENTATIVE_ACCEPT;
};
export declare type Add = BaseActivity & {
type: typeof ActivityTypes.ADD;
type: typeof ActivityTypes.ADD;
};
export declare type Arrive = IntransitiveActivity & {
type: typeof ActivityTypes.ARRIVE;
type: typeof ActivityTypes.ARRIVE;
};
export declare type Create = BaseActivity & {
type: typeof ActivityTypes.CREATE;
type: typeof ActivityTypes.CREATE;
};
export declare type Delete = BaseActivity & {
type: typeof ActivityTypes.DELETE;
type: typeof ActivityTypes.DELETE;
};
export declare type Follow = BaseActivity & {
type: typeof ActivityTypes.FOLLOW;
type: typeof ActivityTypes.FOLLOW;
};
export declare type Ignore = BaseActivity & {
type: typeof ActivityTypes.IGNORE;
type: typeof ActivityTypes.IGNORE;
};
export declare type Join = BaseActivity & {
type: typeof ActivityTypes.JOIN;
type: typeof ActivityTypes.JOIN;
};
export declare type Leave = BaseActivity & {
type: typeof ActivityTypes.LEAVE;
type: typeof ActivityTypes.LEAVE;
};
export declare type Like = BaseActivity & {
type: typeof ActivityTypes.LIKE;
type: typeof ActivityTypes.LIKE;
};
export declare type Offer = BaseActivity & {
type: typeof ActivityTypes.OFFER;
type: typeof ActivityTypes.OFFER;
};
export declare type Invite = Offer & {
type: typeof ActivityTypes.INVITE;
type: typeof ActivityTypes.INVITE;
};
export declare type Reject = BaseActivity & {
type: typeof ActivityTypes.REJECT;
type: typeof ActivityTypes.REJECT;
};
export declare type TentativeReject = Reject & {
type: typeof ActivityTypes.TENTATIVE_REJECT;
type: typeof ActivityTypes.TENTATIVE_REJECT;
};
export declare type Remove = BaseActivity & {
type: typeof ActivityTypes.REMOVE;
type: typeof ActivityTypes.REMOVE;
};
export declare type Undo = BaseActivity & {
type: typeof ActivityTypes.UNDO;
type: typeof ActivityTypes.UNDO;
};
export declare type Update = BaseActivity & {
type: typeof ActivityTypes.UPDATE;
type: typeof ActivityTypes.UPDATE;
};
export declare type View = BaseActivity & {
type: typeof ActivityTypes.VIEW;
type: typeof ActivityTypes.VIEW;
};
export declare type Listen = BaseActivity & {
type: typeof ActivityTypes.LISTEN;
type: typeof ActivityTypes.LISTEN;
};
export declare type Read = BaseActivity & {
type: typeof ActivityTypes.READ;
type: typeof ActivityTypes.READ;
};
export declare type Move = BaseActivity & {
type: typeof ActivityTypes.MOVE;
type: typeof ActivityTypes.MOVE;
};
export declare type Travel = IntransitiveActivity & {
type: typeof ActivityTypes.TRAVEL;
type: typeof ActivityTypes.TRAVEL;
};
export declare type Announce = BaseActivity & {
type: typeof ActivityTypes.ANNOUNCE;
type: typeof ActivityTypes.ANNOUNCE;
};
export declare type Block = Ignore & {
type: typeof ActivityTypes.BLOCK;
type: typeof ActivityTypes.BLOCK;
};
export declare type Flag = BaseActivity & {
type: typeof ActivityTypes.FLAG;
type: typeof ActivityTypes.FLAG;
};
export declare type Dislike = BaseActivity & {
type: typeof ActivityTypes.DISLIKE;
type: typeof ActivityTypes.DISLIKE;
};
export declare type Question = IntransitiveActivity & {
type: typeof ActivityTypes.QUESTION;
oneOf: EntityReference | EntityReference[];
anyOf: EntityReference | EntityReference[];
closed: EntityReference | Date | boolean;
type: typeof ActivityTypes.QUESTION;
oneOf: EntityReference | EntityReference[];
anyOf: EntityReference | EntityReference[];
closed: EntityReference | Date | boolean;
};
export declare type Activity =
| Accept
| Follow
| Delete
| Create
| Arrive
| Add
| Offer
| Like
| Leave
| Ignore
| Join
| Reject
| Invite
| TentativeReject
| TentativeAccept
| View
| Update
| Undo
| Remove
| Read
| Listen
| Move
| Travel
| Announce
| Block
| Flag
| Dislike
| Question;
export declare type Activity = Accept | Follow | Delete | Create | Arrive | Add | Offer | Like | Leave | Ignore | Join | Reject | Invite | TentativeReject | TentativeAccept | View | Update | Undo | Remove | Read | Listen | Move | Travel | Announce | Block | Flag | Dislike | Question;
export declare type ActivityReference = URL | Activity;
export {};

View File

@ -1,57 +1,48 @@
/// <reference types="node" />
import { BaseCoreObject } from '../Core/CoreObject';
import { ActorTypes } from '../util/const';
import {
CollectionReference,
EitherCollectionReference,
OrderedCollectionReference,
} from './Collection';
import { CollectionReference, EitherCollectionReference, OrderedCollectionReference } from './Collection';
import { StringReferenceMap } from '../util/values';
declare type BaseActor = BaseCoreObject & {
type: typeof ActorTypes[keyof typeof ActorTypes];
inbox: OrderedCollectionReference;
outbox: OrderedCollectionReference;
following?: CollectionReference;
followers?: CollectionReference;
liked?: EitherCollectionReference;
preferredUsername?: string;
preferredUsernameMap?: StringReferenceMap;
streams?: EitherCollectionReference[];
endpoints?: {
[key: string]: URL | string | undefined;
proxyUrl?: URL;
oauthAuthorizationEndpoint?: string;
oauthTokenEndpoint?: string;
provideClientKey?: string;
signClientKey?: string;
sharedInbox?: URL;
};
publicKey?: {
id: string;
owner: string;
publicKeyPem: string;
};
type: typeof ActorTypes[keyof typeof ActorTypes];
inbox: OrderedCollectionReference;
outbox: OrderedCollectionReference;
following?: CollectionReference;
followers?: CollectionReference;
liked?: EitherCollectionReference;
preferredUsername?: string;
preferredUsernameMap?: StringReferenceMap;
streams?: EitherCollectionReference[];
endpoints?: {
[key: string]: URL | string | undefined;
proxyUrl?: URL;
oauthAuthorizationEndpoint?: string;
oauthTokenEndpoint?: string;
provideClientKey?: string;
signClientKey?: string;
sharedInbox?: URL;
};
publicKey?: {
id: string;
owner: string;
publicKeyPem: string;
};
};
export declare type Application = BaseActor & {
type: typeof ActorTypes.APPLICATION;
type: typeof ActorTypes.APPLICATION;
};
export declare type Person = BaseActor & {
type: typeof ActorTypes.PERSON;
type: typeof ActorTypes.PERSON;
};
export declare type Group = BaseActor & {
type: typeof ActorTypes.GROUP;
type: typeof ActorTypes.GROUP;
};
export declare type Service = BaseActor & {
type: typeof ActorTypes.SERVICE;
type: typeof ActorTypes.SERVICE;
};
export declare type Organization = BaseActor & {
type: typeof ActorTypes.ORGANIZATION;
type: typeof ActorTypes.ORGANIZATION;
};
export declare type Actor =
| Application
| Service
| Group
| Organization
| Person;
export declare type Actor = Application | Service | Group | Organization | Person;
export declare type ActorReference = URL | Actor;
export {};

View File

@ -4,46 +4,40 @@ import { BaseCoreObject } from '../Core/CoreObject';
import { EntityReference } from '../Core';
import { Link } from '../Core/Link';
declare type BaseCollection = BaseCoreObject & {
type:
| typeof CollectionTypes[keyof typeof CollectionTypes]
| typeof CollectionPageTypes[keyof typeof CollectionPageTypes];
totalItems?: number;
items?: EntityReference | EntityReference[];
current?: URL | CollectionPage | Link;
first?: URL | CollectionPage | Link;
last?: URL | CollectionPage | Link;
type: typeof CollectionTypes[keyof typeof CollectionTypes] | typeof CollectionPageTypes[keyof typeof CollectionPageTypes];
totalItems?: number;
items?: EntityReference | EntityReference[];
current?: URL | CollectionPage | Link;
first?: URL | CollectionPage | Link;
last?: URL | CollectionPage | Link;
};
export declare type Collection = BaseCollection & {
type: typeof CollectionTypes.COLLECTION;
type: typeof CollectionTypes.COLLECTION;
};
export declare type OrderedCollection = BaseCollection & {
type: typeof CollectionTypes.ORDERED_COLLECTION;
orderedItems?: EntityReference | EntityReference[];
type: typeof CollectionTypes.ORDERED_COLLECTION;
orderedItems?: EntityReference | EntityReference[];
};
declare type BaseCollectionPage = BaseCollection & {
type: typeof CollectionPageTypes[keyof typeof CollectionPageTypes];
current?: URL | CollectionPage | Link;
first?: URL | CollectionPage | Link;
last?: URL | CollectionPage | Link;
type: typeof CollectionPageTypes[keyof typeof CollectionPageTypes];
current?: URL | CollectionPage | Link;
first?: URL | CollectionPage | Link;
last?: URL | CollectionPage | Link;
};
export declare type CollectionPage = BaseCollectionPage & {
type: typeof CollectionPageTypes.COLLECTION_PAGE;
type: typeof CollectionPageTypes.COLLECTION_PAGE;
};
export declare type OrderedCollectionPage = BaseCollectionPage & {
type: typeof CollectionPageTypes.ORDERED_COLLECTION_PAGE;
startIndex?: number;
orderedItems?: EntityReference | EntityReference[];
type: typeof CollectionPageTypes.ORDERED_COLLECTION_PAGE;
startIndex?: number;
orderedItems?: EntityReference | EntityReference[];
};
export declare type CollectionReference = URL | Collection;
export declare type OrderedCollectionReference = URL | OrderedCollection;
export declare type CollectionPageReference = URL | CollectionPage;
export declare type OrderedCollectionPageReference =
| URL
| OrderedCollectionPage;
export declare type OrderedCollectionPageReference = URL | OrderedCollectionPage;
export declare type EitherCollection = Collection | OrderedCollection;
export declare type EitherCollectionPage =
| CollectionPage
| OrderedCollectionPage;
export declare type EitherCollectionPage = CollectionPage | OrderedCollectionPage;
export declare type EitherCollectionReference = URL | EitherCollection;
export declare type EitherCollectionPageReference = URL | EitherCollectionPage;
export {};

View File

@ -3,71 +3,57 @@ import { AllTypes, ExtendedObjectTypes } from '../util/const';
import { BaseCoreObject } from '../Core/CoreObject';
import { EntityReference, CoreObjectReference } from '../Core';
declare type BaseExtendedObject = BaseCoreObject & {
type: typeof ExtendedObjectTypes[keyof typeof ExtendedObjectTypes];
type: typeof ExtendedObjectTypes[keyof typeof ExtendedObjectTypes];
};
export declare type Tombstone = BaseExtendedObject & {
type: typeof ExtendedObjectTypes.TOMBSTONE;
formerType?:
| typeof AllTypes[keyof typeof AllTypes]
| Array<typeof AllTypes[keyof typeof AllTypes]>;
deleted?: Date;
type: typeof ExtendedObjectTypes.TOMBSTONE;
formerType?: typeof AllTypes[keyof typeof AllTypes] | Array<typeof AllTypes[keyof typeof AllTypes]>;
deleted?: Date;
};
export declare type Relationship = BaseExtendedObject & {
type: typeof ExtendedObjectTypes.RELATIONSHIP;
subject?: EntityReference;
object?: EntityReference | EntityReference[];
relationship?: CoreObjectReference;
type: typeof ExtendedObjectTypes.RELATIONSHIP;
subject?: EntityReference;
object?: EntityReference | EntityReference[];
relationship?: CoreObjectReference;
};
export declare type Article = BaseExtendedObject & {
type: typeof ExtendedObjectTypes.ARTICLE;
type: typeof ExtendedObjectTypes.ARTICLE;
};
export declare type Note = BaseExtendedObject & {
type: typeof ExtendedObjectTypes.NOTE;
type: typeof ExtendedObjectTypes.NOTE;
};
export declare type Page = BaseExtendedObject & {
type: typeof ExtendedObjectTypes.PAGE;
type: typeof ExtendedObjectTypes.PAGE;
};
export declare type Event = BaseExtendedObject & {
type: typeof ExtendedObjectTypes.EVENT;
type: typeof ExtendedObjectTypes.EVENT;
};
export declare type Place = BaseExtendedObject & {
type: typeof ExtendedObjectTypes.PLACE;
accuracy?: number;
altitude?: number;
latitude?: number;
longitude?: number;
radius?: number;
units?: string;
type: typeof ExtendedObjectTypes.PLACE;
accuracy?: number;
altitude?: number;
latitude?: number;
longitude?: number;
radius?: number;
units?: string;
};
export declare type Document = BaseExtendedObject & {
type: typeof ExtendedObjectTypes.DOCUMENT;
type: typeof ExtendedObjectTypes.DOCUMENT;
};
export declare type Image = Document & {
type: typeof ExtendedObjectTypes.IMAGE;
type: typeof ExtendedObjectTypes.IMAGE;
};
export declare type Audio = Document & {
type: typeof ExtendedObjectTypes.IMAGE;
type: typeof ExtendedObjectTypes.IMAGE;
};
export declare type Video = Document & {
type: typeof ExtendedObjectTypes.IMAGE;
type: typeof ExtendedObjectTypes.IMAGE;
};
export declare type Profile = BaseExtendedObject & {
type: typeof ExtendedObjectTypes.PROFILE;
describes?: CoreObjectReference;
type: typeof ExtendedObjectTypes.PROFILE;
describes?: CoreObjectReference;
};
export declare type ExtendedObject =
| Article
| Event
| Note
| Page
| Place
| Relationship
| Tombstone
| Profile
| Video
| Document
| Audio
| Image;
export declare type ExtendedObject = Article | Event | Note | Page | Place | Relationship | Tombstone | Profile | Video | Document | Audio | Image;
export declare type ExtendedObjectReference = URL | ExtendedObject;
export declare type ImageReference = URL | Image;
export {};

View File

@ -1,72 +1,10 @@
export type {
Activity,
ActivityReference,
IntransitiveActivity,
TransitiveActivity,
Accept,
Follow,
Delete,
Create,
Arrive,
Add,
Offer,
Like,
Leave,
Ignore,
Join,
Reject,
Invite,
TentativeReject,
TentativeAccept,
View,
Update,
Undo,
Remove,
Read,
Listen,
Move,
Travel,
Announce,
Block,
Flag,
Dislike,
Question,
} from './Activity';
export type {
Actor,
ActorReference,
Person,
Service,
Group,
Organization,
Application,
} from './Actor';
export type {
ExtendedObject,
ExtendedObjectReference,
Article,
Event,
Note,
Page,
Place,
Relationship,
Tombstone,
Profile,
Video,
Document,
Audio,
Image,
} from './ExtendedObject';
export type { Activity, ActivityReference, IntransitiveActivity, TransitiveActivity, Accept, Follow, Delete, Create, Arrive, Add, Offer, Like, Leave, Ignore, Join, Reject, Invite, TentativeReject, TentativeAccept, View, Update, Undo, Remove, Read, Listen, Move, Travel, Announce, Block, Flag, Dislike, Question, } from './Activity';
export type { Actor, ActorReference, Person, Service, Group, Organization, Application, } from './Actor';
export type { ExtendedObject, ExtendedObjectReference, Article, Event, Note, Page, Place, Relationship, Tombstone, Profile, Video, Document, Audio, Image, } from './ExtendedObject';
export type { Collection, CollectionReference } from './Collection';
export type {
OrderedCollection,
OrderedCollectionReference,
} from './Collection';
export type { OrderedCollection, OrderedCollectionReference, } from './Collection';
export type { CollectionPage, CollectionPageReference } from './Collection';
export type {
OrderedCollectionPage,
OrderedCollectionPageReference,
} from './Collection';
export type { OrderedCollectionPage, OrderedCollectionPageReference, } from './Collection';
export type { EitherCollection } from './Collection';
export type { EitherCollectionReference } from './Collection';
export type { EitherCollectionPage } from './Collection';

View File

@ -1,89 +1,12 @@
export {
CoreObjectTypes,
LinkTypes,
TransitiveActivityTypes,
IntransitiveActivityTypes,
ActivityTypes,
ActorTypes,
ExtendedObjectTypes,
CollectionTypes,
CollectionPageTypes,
AllTypes,
} from './util/const';
export type {
Entity,
EntityReference,
CoreObject,
CoreObjectReference,
Link,
LinkReference,
} from './Core';
export type {
Activity,
ActivityReference,
IntransitiveActivity,
TransitiveActivity,
Accept,
Follow,
Delete,
Create,
Arrive,
Add,
Offer,
Like,
Leave,
Ignore,
Join,
Reject,
Invite,
TentativeReject,
TentativeAccept,
View,
Update,
Undo,
Remove,
Read,
Listen,
Move,
Travel,
Announce,
Block,
Flag,
Dislike,
Question,
} from './Extended';
export type {
Actor,
ActorReference,
Person,
Service,
Group,
Organization,
Application,
} from './Extended';
export type {
ExtendedObject,
ExtendedObjectReference,
Article,
Event,
Note,
Page,
Place,
Relationship,
Tombstone,
Profile,
Video,
Document,
Audio,
Image,
} from './Extended';
export { CoreObjectTypes, LinkTypes, TransitiveActivityTypes, IntransitiveActivityTypes, ActivityTypes, ActorTypes, ExtendedObjectTypes, CollectionTypes, CollectionPageTypes, AllTypes, } from './util/const';
export type { Entity, EntityReference, CoreObject, CoreObjectReference, Link, LinkReference, } from './Core';
export type { Activity, ActivityReference, IntransitiveActivity, TransitiveActivity, Accept, Follow, Delete, Create, Arrive, Add, Offer, Like, Leave, Ignore, Join, Reject, Invite, TentativeReject, TentativeAccept, View, Update, Undo, Remove, Read, Listen, Move, Travel, Announce, Block, Flag, Dislike, Question, } from './Extended';
export type { Actor, ActorReference, Person, Service, Group, Organization, Application, } from './Extended';
export type { ExtendedObject, ExtendedObjectReference, Article, Event, Note, Page, Place, Relationship, Tombstone, Profile, Video, Document, Audio, Image, } from './Extended';
export type { Collection, CollectionReference } from './Extended';
export type { OrderedCollection, OrderedCollectionReference } from './Extended';
export type { CollectionPage, CollectionPageReference } from './Extended';
export type {
OrderedCollectionPage,
OrderedCollectionPageReference,
} from './Extended';
export type { OrderedCollectionPage, OrderedCollectionPageReference, } from './Extended';
export type { EitherCollection } from './Extended';
export type { EitherCollectionReference } from './Extended';
export type { EitherCollectionPage } from './Extended';

View File

@ -1,199 +1,199 @@
export declare const ExtendedObjectTypes: {
readonly ARTICLE: 'Article';
readonly AUDIO: 'Audio';
readonly DOCUMENT: 'Document';
readonly EVENT: 'Event';
readonly IMAGE: 'Image';
readonly NOTE: 'Note';
readonly PAGE: 'Page';
readonly PLACE: 'Place';
readonly PROFILE: 'Profile';
readonly RELATIONSHIP: 'Relationship';
readonly TOMBSTONE: 'Tombstone';
readonly VIDEO: 'Video';
readonly ARTICLE: "Article";
readonly AUDIO: "Audio";
readonly DOCUMENT: "Document";
readonly EVENT: "Event";
readonly IMAGE: "Image";
readonly NOTE: "Note";
readonly PAGE: "Page";
readonly PLACE: "Place";
readonly PROFILE: "Profile";
readonly RELATIONSHIP: "Relationship";
readonly TOMBSTONE: "Tombstone";
readonly VIDEO: "Video";
};
export declare const LinkTypes: {
readonly LINK: 'Link';
readonly MENTION: 'Mention';
readonly LINK: "Link";
readonly MENTION: "Mention";
};
export declare const ActorTypes: {
readonly APPLICATION: 'Application';
readonly GROUP: 'Group';
readonly ORGANIZATION: 'Organization';
readonly PERSON: 'Person';
readonly SERVICE: 'Service';
readonly APPLICATION: "Application";
readonly GROUP: "Group";
readonly ORGANIZATION: "Organization";
readonly PERSON: "Person";
readonly SERVICE: "Service";
};
export declare const TransitiveActivityTypes: {
readonly ACCEPT: 'Accept';
readonly ADD: 'Add';
readonly ANNOUNCE: 'Announce';
readonly BLOCK: 'Block';
readonly IGNORE: 'Ignore';
readonly CREATE: 'Create';
readonly DELETE: 'Delete';
readonly DISLIKE: 'Dislike';
readonly FLAG: 'Flag';
readonly FOLLOW: 'Follow';
readonly INVITE: 'Invite';
readonly JOIN: 'Join';
readonly LEAVE: 'Leave';
readonly LIKE: 'Like';
readonly LISTEN: 'Listen';
readonly MOVE: 'Move';
readonly OFFER: 'Offer';
readonly READ: 'Read';
readonly REJECT: 'Reject';
readonly REMOVE: 'Remove';
readonly TENTATIVE_ACCEPT: 'TentativeAccept';
readonly TENTATIVE_REJECT: 'TentativeReject';
readonly UNDO: 'Undo';
readonly UPDATE: 'Update';
readonly VIEW: 'View';
readonly ACCEPT: "Accept";
readonly ADD: "Add";
readonly ANNOUNCE: "Announce";
readonly BLOCK: "Block";
readonly IGNORE: "Ignore";
readonly CREATE: "Create";
readonly DELETE: "Delete";
readonly DISLIKE: "Dislike";
readonly FLAG: "Flag";
readonly FOLLOW: "Follow";
readonly INVITE: "Invite";
readonly JOIN: "Join";
readonly LEAVE: "Leave";
readonly LIKE: "Like";
readonly LISTEN: "Listen";
readonly MOVE: "Move";
readonly OFFER: "Offer";
readonly READ: "Read";
readonly REJECT: "Reject";
readonly REMOVE: "Remove";
readonly TENTATIVE_ACCEPT: "TentativeAccept";
readonly TENTATIVE_REJECT: "TentativeReject";
readonly UNDO: "Undo";
readonly UPDATE: "Update";
readonly VIEW: "View";
};
export declare const IntransitiveActivityTypes: {
readonly ARRIVE: 'Arrive';
readonly TRAVEL: 'Travel';
readonly QUESTION: 'Question';
readonly ARRIVE: "Arrive";
readonly TRAVEL: "Travel";
readonly QUESTION: "Question";
};
export declare const ActivityTypes: {
readonly ARRIVE: 'Arrive';
readonly TRAVEL: 'Travel';
readonly QUESTION: 'Question';
readonly ACCEPT: 'Accept';
readonly ADD: 'Add';
readonly ANNOUNCE: 'Announce';
readonly BLOCK: 'Block';
readonly IGNORE: 'Ignore';
readonly CREATE: 'Create';
readonly DELETE: 'Delete';
readonly DISLIKE: 'Dislike';
readonly FLAG: 'Flag';
readonly FOLLOW: 'Follow';
readonly INVITE: 'Invite';
readonly JOIN: 'Join';
readonly LEAVE: 'Leave';
readonly LIKE: 'Like';
readonly LISTEN: 'Listen';
readonly MOVE: 'Move';
readonly OFFER: 'Offer';
readonly READ: 'Read';
readonly REJECT: 'Reject';
readonly REMOVE: 'Remove';
readonly TENTATIVE_ACCEPT: 'TentativeAccept';
readonly TENTATIVE_REJECT: 'TentativeReject';
readonly UNDO: 'Undo';
readonly UPDATE: 'Update';
readonly VIEW: 'View';
readonly ARRIVE: "Arrive";
readonly TRAVEL: "Travel";
readonly QUESTION: "Question";
readonly ACCEPT: "Accept";
readonly ADD: "Add";
readonly ANNOUNCE: "Announce";
readonly BLOCK: "Block";
readonly IGNORE: "Ignore";
readonly CREATE: "Create";
readonly DELETE: "Delete";
readonly DISLIKE: "Dislike";
readonly FLAG: "Flag";
readonly FOLLOW: "Follow";
readonly INVITE: "Invite";
readonly JOIN: "Join";
readonly LEAVE: "Leave";
readonly LIKE: "Like";
readonly LISTEN: "Listen";
readonly MOVE: "Move";
readonly OFFER: "Offer";
readonly READ: "Read";
readonly REJECT: "Reject";
readonly REMOVE: "Remove";
readonly TENTATIVE_ACCEPT: "TentativeAccept";
readonly TENTATIVE_REJECT: "TentativeReject";
readonly UNDO: "Undo";
readonly UPDATE: "Update";
readonly VIEW: "View";
};
export declare const CollectionTypes: {
readonly COLLECTION: 'Collection';
readonly ORDERED_COLLECTION: 'OrderedCollection';
readonly COLLECTION: "Collection";
readonly ORDERED_COLLECTION: "OrderedCollection";
};
export declare const CollectionPageTypes: {
readonly COLLECTION_PAGE: 'CollectionPage';
readonly ORDERED_COLLECTION_PAGE: 'OrderedCollectionPage';
readonly COLLECTION_PAGE: "CollectionPage";
readonly ORDERED_COLLECTION_PAGE: "OrderedCollectionPage";
};
export declare const CoreObjectTypes: {
readonly COLLECTION_PAGE: 'CollectionPage';
readonly ORDERED_COLLECTION_PAGE: 'OrderedCollectionPage';
readonly COLLECTION: 'Collection';
readonly ORDERED_COLLECTION: 'OrderedCollection';
readonly ARRIVE: 'Arrive';
readonly TRAVEL: 'Travel';
readonly QUESTION: 'Question';
readonly ACCEPT: 'Accept';
readonly ADD: 'Add';
readonly ANNOUNCE: 'Announce';
readonly BLOCK: 'Block';
readonly IGNORE: 'Ignore';
readonly CREATE: 'Create';
readonly DELETE: 'Delete';
readonly DISLIKE: 'Dislike';
readonly FLAG: 'Flag';
readonly FOLLOW: 'Follow';
readonly INVITE: 'Invite';
readonly JOIN: 'Join';
readonly LEAVE: 'Leave';
readonly LIKE: 'Like';
readonly LISTEN: 'Listen';
readonly MOVE: 'Move';
readonly OFFER: 'Offer';
readonly READ: 'Read';
readonly REJECT: 'Reject';
readonly REMOVE: 'Remove';
readonly TENTATIVE_ACCEPT: 'TentativeAccept';
readonly TENTATIVE_REJECT: 'TentativeReject';
readonly UNDO: 'Undo';
readonly UPDATE: 'Update';
readonly VIEW: 'View';
readonly APPLICATION: 'Application';
readonly GROUP: 'Group';
readonly ORGANIZATION: 'Organization';
readonly PERSON: 'Person';
readonly SERVICE: 'Service';
readonly ARTICLE: 'Article';
readonly AUDIO: 'Audio';
readonly DOCUMENT: 'Document';
readonly EVENT: 'Event';
readonly IMAGE: 'Image';
readonly NOTE: 'Note';
readonly PAGE: 'Page';
readonly PLACE: 'Place';
readonly PROFILE: 'Profile';
readonly RELATIONSHIP: 'Relationship';
readonly TOMBSTONE: 'Tombstone';
readonly VIDEO: 'Video';
readonly COLLECTION_PAGE: "CollectionPage";
readonly ORDERED_COLLECTION_PAGE: "OrderedCollectionPage";
readonly COLLECTION: "Collection";
readonly ORDERED_COLLECTION: "OrderedCollection";
readonly ARRIVE: "Arrive";
readonly TRAVEL: "Travel";
readonly QUESTION: "Question";
readonly ACCEPT: "Accept";
readonly ADD: "Add";
readonly ANNOUNCE: "Announce";
readonly BLOCK: "Block";
readonly IGNORE: "Ignore";
readonly CREATE: "Create";
readonly DELETE: "Delete";
readonly DISLIKE: "Dislike";
readonly FLAG: "Flag";
readonly FOLLOW: "Follow";
readonly INVITE: "Invite";
readonly JOIN: "Join";
readonly LEAVE: "Leave";
readonly LIKE: "Like";
readonly LISTEN: "Listen";
readonly MOVE: "Move";
readonly OFFER: "Offer";
readonly READ: "Read";
readonly REJECT: "Reject";
readonly REMOVE: "Remove";
readonly TENTATIVE_ACCEPT: "TentativeAccept";
readonly TENTATIVE_REJECT: "TentativeReject";
readonly UNDO: "Undo";
readonly UPDATE: "Update";
readonly VIEW: "View";
readonly APPLICATION: "Application";
readonly GROUP: "Group";
readonly ORGANIZATION: "Organization";
readonly PERSON: "Person";
readonly SERVICE: "Service";
readonly ARTICLE: "Article";
readonly AUDIO: "Audio";
readonly DOCUMENT: "Document";
readonly EVENT: "Event";
readonly IMAGE: "Image";
readonly NOTE: "Note";
readonly PAGE: "Page";
readonly PLACE: "Place";
readonly PROFILE: "Profile";
readonly RELATIONSHIP: "Relationship";
readonly TOMBSTONE: "Tombstone";
readonly VIDEO: "Video";
};
export declare const AllTypes: {
readonly LINK: 'Link';
readonly MENTION: 'Mention';
readonly COLLECTION_PAGE: 'CollectionPage';
readonly ORDERED_COLLECTION_PAGE: 'OrderedCollectionPage';
readonly COLLECTION: 'Collection';
readonly ORDERED_COLLECTION: 'OrderedCollection';
readonly ARRIVE: 'Arrive';
readonly TRAVEL: 'Travel';
readonly QUESTION: 'Question';
readonly ACCEPT: 'Accept';
readonly ADD: 'Add';
readonly ANNOUNCE: 'Announce';
readonly BLOCK: 'Block';
readonly IGNORE: 'Ignore';
readonly CREATE: 'Create';
readonly DELETE: 'Delete';
readonly DISLIKE: 'Dislike';
readonly FLAG: 'Flag';
readonly FOLLOW: 'Follow';
readonly INVITE: 'Invite';
readonly JOIN: 'Join';
readonly LEAVE: 'Leave';
readonly LIKE: 'Like';
readonly LISTEN: 'Listen';
readonly MOVE: 'Move';
readonly OFFER: 'Offer';
readonly READ: 'Read';
readonly REJECT: 'Reject';
readonly REMOVE: 'Remove';
readonly TENTATIVE_ACCEPT: 'TentativeAccept';
readonly TENTATIVE_REJECT: 'TentativeReject';
readonly UNDO: 'Undo';
readonly UPDATE: 'Update';
readonly VIEW: 'View';
readonly APPLICATION: 'Application';
readonly GROUP: 'Group';
readonly ORGANIZATION: 'Organization';
readonly PERSON: 'Person';
readonly SERVICE: 'Service';
readonly ARTICLE: 'Article';
readonly AUDIO: 'Audio';
readonly DOCUMENT: 'Document';
readonly EVENT: 'Event';
readonly IMAGE: 'Image';
readonly NOTE: 'Note';
readonly PAGE: 'Page';
readonly PLACE: 'Place';
readonly PROFILE: 'Profile';
readonly RELATIONSHIP: 'Relationship';
readonly TOMBSTONE: 'Tombstone';
readonly VIDEO: 'Video';
readonly LINK: "Link";
readonly MENTION: "Mention";
readonly COLLECTION_PAGE: "CollectionPage";
readonly ORDERED_COLLECTION_PAGE: "OrderedCollectionPage";
readonly COLLECTION: "Collection";
readonly ORDERED_COLLECTION: "OrderedCollection";
readonly ARRIVE: "Arrive";
readonly TRAVEL: "Travel";
readonly QUESTION: "Question";
readonly ACCEPT: "Accept";
readonly ADD: "Add";
readonly ANNOUNCE: "Announce";
readonly BLOCK: "Block";
readonly IGNORE: "Ignore";
readonly CREATE: "Create";
readonly DELETE: "Delete";
readonly DISLIKE: "Dislike";
readonly FLAG: "Flag";
readonly FOLLOW: "Follow";
readonly INVITE: "Invite";
readonly JOIN: "Join";
readonly LEAVE: "Leave";
readonly LIKE: "Like";
readonly LISTEN: "Listen";
readonly MOVE: "Move";
readonly OFFER: "Offer";
readonly READ: "Read";
readonly REJECT: "Reject";
readonly REMOVE: "Remove";
readonly TENTATIVE_ACCEPT: "TentativeAccept";
readonly TENTATIVE_REJECT: "TentativeReject";
readonly UNDO: "Undo";
readonly UPDATE: "Update";
readonly VIEW: "View";
readonly APPLICATION: "Application";
readonly GROUP: "Group";
readonly ORGANIZATION: "Organization";
readonly PERSON: "Person";
readonly SERVICE: "Service";
readonly ARTICLE: "Article";
readonly AUDIO: "Audio";
readonly DOCUMENT: "Document";
readonly EVENT: "Event";
readonly IMAGE: "Image";
readonly NOTE: "Note";
readonly PAGE: "Page";
readonly PLACE: "Place";
readonly PROFILE: "Profile";
readonly RELATIONSHIP: "Relationship";
readonly TOMBSTONE: "Tombstone";
readonly VIDEO: "Video";
};

View File

@ -1,3 +1,3 @@
export declare type StringReferenceMap = {
[key: string]: string;
[key: string]: string;
};

View File

@ -1,24 +1,24 @@
export * as AP from './activitypub';
export declare type Database = {
expandCollection: Function;
expandEntity: Function;
fetchEntityById: Function;
findAll: Function;
findEntityById: Function;
findOne: Function;
findStringIdByValue: Function;
findStringValueById: Function;
getActorByToken: Function;
getAuthenticatedUserIdByToken: Function;
getCollectionItems: Function;
insertItem: Function;
removeItem: Function;
insertOrderedItem: Function;
removeOrderedItem: Function;
queryById: Function;
saveEntity: Function;
saveString: Function;
expandCollection: Function;
expandEntity: Function;
fetchEntityById: Function;
findAll: Function;
findEntityById: Function;
findOne: Function;
findStringIdByValue: Function;
findStringValueById: Function;
getActorByToken: Function;
getAuthenticatedUserIdByToken: Function;
getCollectionItems: Function;
insertItem: Function;
removeItem: Function;
insertOrderedItem: Function;
removeOrderedItem: Function;
queryById: Function;
saveEntity: Function;
saveString: Function;
};
export interface DatabaseService {
connect(): Promise<Database>;
connect(): Promise<Database>;
}

View File

@ -25,5 +25,4 @@ var __importStar = (this && this.__importStar) || function (mod) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.AP = void 0;
exports.AP = __importStar(require("./activitypub"));
;
//# sourceMappingURL=index.js.map

View File

@ -1 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAoC;AAyBnC,CAAC"}
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAoC"}

View File

@ -15,9 +15,13 @@
"scripts": {
"build": "tsc --project tsconfig.json",
"dev": "ts-node ./src/index.ts",
"format": "prettier --config .prettierrc \"**/*.ts\" --write"
"format": "prettier --config .prettierrc \"**/*.ts\" --write",
"lint": "eslint activitypub/**/*.ts"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.40.0",
"@typescript-eslint/parser": "^5.40.0",
"eslint": "^8.25.0",
"prettier": "^2.7.1",
"ts-node": "^10.9.1"
},

View File

@ -0,0 +1,9 @@
{
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": ["@typescript-eslint"],
"extends": ["plugin:@typescript-eslint/recommended"]
}

View File

@ -1,4 +1,4 @@
import { AP } from 'activitypub-core-types';
export declare function addContext(entity: AP.Entity): AP.Entity & {
'@context': unknown;
'@context': unknown;
};

View File

@ -1 +1 @@
{"version":3,"file":"combineAddresses.js","sourceRoot":"","sources":["../src/combineAddresses.ts"],"names":[],"mappings":";;;AAAA,mEAA4C;AAC5C,mCAAgC;AAEhC,SAAgB,gBAAgB,CAAC,QAAqB;IACpD,IACE,QAAQ,CAAC,IAAI,KAAK,2BAAE,CAAC,aAAa,CAAC,MAAM;QACzC,QAAQ,IAAI,QAAQ;QACpB,QAAQ,CAAC,MAAM;QACf,MAAM,IAAI,QAAQ,CAAC,MAAM,EACzB;QACA,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,MAAM,CAAC,2BAAE,CAAC,eAAe,CAAC,EAAE;YACpD,IAAI,IAAI,KAAK,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE;gBACjC,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;oBAC3C,CAAC,CAAC,QAAQ,CAAC,EAAE;oBACb,CAAC,CAAC,QAAQ,CAAC,EAAE;wBACX,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC;wBACf,CAAC,CAAC,EAAE,CAAC;gBACT,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;oBAC3C,CAAC,CAAC,QAAQ,CAAC,EAAE;oBACb,CAAC,CAAC,QAAQ,CAAC,EAAE;wBACX,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC;wBACf,CAAC,CAAC,EAAE,CAAC;gBACT,MAAM,WAAW,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC;oBAC7C,CAAC,CAAC,QAAQ,CAAC,GAAG;oBACd,CAAC,CAAC,QAAQ,CAAC,GAAG;wBACZ,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,C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AAM,QAAQ,GAAG;oBACf,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,gBAAgB,EAAE,GAAG,cAAc,CAAC,CAAC,GAAG,CAAC,aAAK,CAAC,CAAC;iBAChE,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC;gBAEzB,QAAQ,CAAC,EAAE,GAAG,EAAW,CAAC;gBAC1B,QAAQ,CAAC,GAAG,GAAG,GAAY,CAAC;gBAC5B,QAAQ,CAAC,EAAE,GAAG,EAAW,CAAC;gBAC1B,QAAQ,CAAC,GAAG,GAAG,GAAY,CAAC;gBAC5B,QAAQ,CAAC,QAAQ,GAAG,QAAiB,CAAC;gBAEtC,QAAQ,CAAC,MAAM,CAAC,EAAE,GAAG,EAAW,CAAC;gBACjC,QAAQ,CAAC,MAAM,CAAC,GAAG,GAAG,GAAY,CAAC;gBACnC,QAAQ,CAAC,MAAM,CAAC,EAAE,GAAG,EAAW,CAAC;gBACjC,QAAQ,CAAC,MAAM,CAAC,GAAG,GAAG,GAAY,CAAC;gBACnC,QAAQ,CAAC,MAAM,CAAC,QAAQ,GAAG,QAAiB,CAAC;aAC9C;SACF;KACF;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AA5FD,4CA4FC"}

View File

@ -4,7 +4,9 @@ exports.compressEntity = void 0;
function compressEntity(entity) {
const compressed = { ...entity };
for (const [key, value] of Object.entries(entity)) {
if (value instanceof URL || value instanceof Date || typeof value === 'string') {
if (value instanceof URL ||
value instanceof Date ||
typeof value === 'string') {
continue;
}
else if (Array.isArray(value)) {
@ -25,7 +27,9 @@ function compressEntity(entity) {
exports.compressEntity = compressEntity;
function compressArray(array) {
return array.map((item) => {
if (item instanceof URL || item instanceof Date || typeof item === 'string') {
if (item instanceof URL ||
item instanceof Date ||
typeof item === 'string') {
return item;
}
else if (Array.isArray(item)) {

View File

@ -1 +1 @@
{"version":3,"file":"compressEntity.js","sourceRoot":"","sources":["../src/compressEntity.ts"],"names":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,CAAC,CAAC;AACL,CAAC"}

View File

@ -1,5 +1,5 @@
export declare const convertFromJsonLd: (entity: {
[key: string]: unknown;
[key: string]: unknown;
}) => Promise<{
[key: string]: unknown;
[key: string]: unknown;
}>;

View File

@ -1,4 +1,4 @@
import { AP } from 'activitypub-core-types';
export declare function convertStringsToUrls(originalEntity: {
[key: string]: unknown;
[key: string]: unknown;
}): AP.Entity;

View File

@ -27,7 +27,7 @@ function convertStringsToUrls(originalEntity) {
continue;
}
else if (Array.isArray(value)) {
entity[key] = value.map(item => {
entity[key] = value.map((item) => {
if (typeof item === 'string') {
try {
return new URL(item);

View File

@ -1 +1 @@
{"version":3,"file":"convertStringsToUrls.js","sourceRoot":"","sources":["../src/convertStringsToUrls.ts"],"names":[],"mappings":";;;AAEA,SAAgB,oBAAoB,CAAC,cAA0C;IAC7E,MAAM,MAAM,GAA+B,EAAE,GAAG,cAAc,EAAE,CAAC;IAEjE,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;QACjD,IAAI,CAAC,MAAM,EAAE;YACX,SAAS;SACV;QAED,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC7B,IAAI;gBACF,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC;aAC9B;YAAC,OAAO,KAAK,EAAE;gBACd,IAAI;oBACF,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;oBAE/B,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE;wBACvB,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC;qBAC9B;iBACF;gBAAC,OAAO,KAAK,EAAE;oBACd,SAAS;iBACV;aACF;SACF;aAAM,IAAI,KAAK,YAAY,GAAG,IAAI,KAAK,YAAY,IAAI,EAAE;YACxD,SAAS;SACV;aA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BACF;wBAAC,OAAO,KAAK,EAAE;4BACd,OAAO,IAAI,CAAC;yBACb;qBACF;iBACF;qBAAM,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;oBAC9B,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,SAAoB,EAAE,EAAE,CACvC,oBAAoB,CAAC,SAAuC,CAAC,CAC9D,CAAC;iBACH;qBAAM,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;oBAC7C,OAAO,oBAAoB,CAAC,IAAI,CAAC,CAAC;iBACnC;qBAAM;oBACL,OAAO,IAAI,CAAC;iBACb;YACH,CAAC,CAAC,CAAC;SACJ;aAAM,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC7C,MAAM,CAAC,GAAG,CAAC,GAAG,oBAAoB,CAAC,KAAmC,CAAC,CAAC;SACzE;KACF;IAED,OAAO,MAA8B,CAAC;AACxC,CAAC;AA5DD,oDA4DC"}

View File

@ -1 +1 @@
{"version":3,"file":"convertUrlsToStrings.js","sourceRoot":"","sources":["../src/convertUrlsToStrings.ts"],"names":[],"mappings":";;;AACA,yCAAsC;AAE/B,MAAM,oBAAoB,GAAG,CAAC,MAAiB,EAAa,EAAE;IACnE,OAAO,IAAI,CAAC,KAAK,CAAC,IAAA,qBAAS,EAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;AAC5C,CAAC,CAAA;AAFY,QAAA,oBAAoB,wBAEhC"}
{"version":3,"file":"convertUrlsToStrings.js","sourceRoot":"","sources":["../src/convertUrlsToStrings.ts"],"names":[],"mappings":";;;AACA,yCAAsC;AAE/B,MAAM,oBAAoB,GAAG,CAAC,MAAiB,EAAa,EAAE;IACnE,OAAO,IAAI,CAAC,KAAK,CAAC,IAAA,qBAAS,EAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;AAC5C,CAAC,CAAC;AAFW,QAAA,oBAAoB,wBAE/B"}

View File

@ -1,4 +1,4 @@
export declare function generateKeyPair(): Promise<{
privateKey: string;
publicKey: string;
privateKey: string;
publicKey: string;
}>;

Some files were not shown because too many files have changed in this diff Show More