fix core types

This commit is contained in:
Michael Puckett 2023-07-22 12:15:20 -04:00
parent b1f157891a
commit e8761a8139
29 changed files with 361 additions and 6 deletions

21
packages/core/lib/adapters/Auth.d.ts vendored Normal file
View File

@ -0,0 +1,21 @@
import { DbAdapter } from './Db';
export type AuthAdapter = {
adapters?: {
db: DbAdapter;
};
params?: Record<string, unknown>;
getTokenByUserId: (userId: string) => Promise<string>;
createUser: (this: AuthAdapter, { email, password, preferredUsername, }: {
email: string;
password?: string;
preferredUsername: string;
}) => Promise<{
uid: string;
token: string;
}>;
getUserIdByToken: (this: AuthAdapter, token: string) => Promise<string>;
authenticatePassword: (this: AuthAdapter, email: string, password: string) => Promise<{
uid: string;
token: string;
} | null>;
};

View File

@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=Auth.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"Auth.js","sourceRoot":"","sources":["../../src/adapters/Auth.ts"],"names":[],"mappings":""}

17
packages/core/lib/adapters/Crypto.d.ts vendored Normal file
View File

@ -0,0 +1,17 @@
/// <reference types="node" />
export type CryptoAdapter = {
params?: {
[key: string]: unknown;
};
hashPassword(this: CryptoAdapter, password: string, salt: string): Promise<string>;
generateKeyPair: (this: CryptoAdapter) => Promise<{
privateKey: string;
publicKey: string;
}>;
getHttpSignature(this: CryptoAdapter, foreignTarget: URL, actorId: URL, privateKey: string, entity?: Record<string, unknown>): Promise<{
dateHeader: string;
digestHeader?: string;
signatureHeader: string;
}>;
randomBytes: (this: CryptoAdapter, numberOfBytes: number) => Promise<string>;
};

View File

@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=Crypto.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"Crypto.js","sourceRoot":"","sources":["../../src/adapters/Crypto.ts"],"names":[],"mappings":""}

20
packages/core/lib/adapters/Db.d.ts vendored Normal file
View File

@ -0,0 +1,20 @@
/// <reference types="node" />
import * as AP from '../activitypub';
export declare const DbOptions: {
readonly CASE_INSENSITIVE: "CASE_INSENSITIVE";
readonly CASE_SENSITIVE: "CASE_SENSITIVE";
};
export type DbAdapter = {
db?: unknown;
initializeDb?: (this: DbAdapter) => Promise<void>;
findAll: (this: DbAdapter, collection: string, matchingObject: Record<string, unknown>) => Promise<AP.Entity[] | null>;
findOne: (this: DbAdapter, collection: string, matchingObject: Record<string, unknown>, options?: Array<keyof typeof DbOptions>) => Promise<AP.Entity | null>;
findStringIdByValue: (this: DbAdapter, dbCollection: string, value: string) => Promise<string>;
findStringValueById: (this: DbAdapter, dbCollection: string, _id: string) => Promise<string>;
insertItem: (this: DbAdapter, path: URL, url: URL) => Promise<void>;
removeItem: (this: DbAdapter, path: URL, url: URL) => Promise<void>;
insertOrderedItem: (this: DbAdapter, path: URL, url: URL) => Promise<void>;
removeOrderedItem: (this: DbAdapter, path: URL, url: URL) => Promise<void>;
saveEntity: (this: DbAdapter, entity: AP.Entity) => Promise<void>;
saveString: (this: DbAdapter, dbCollection: string, _id: string, value: string) => Promise<void>;
};

View File

@ -0,0 +1,8 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DbOptions = void 0;
exports.DbOptions = {
CASE_INSENSITIVE: 'CASE_INSENSITIVE',
CASE_SENSITIVE: 'CASE_SENSITIVE',
};
//# sourceMappingURL=Db.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"Db.js","sourceRoot":"","sources":["../../src/adapters/Db.ts"],"names":[],"mappings":";;;AAEa,QAAA,SAAS,GAAG;IACvB,gBAAgB,EAAE,kBAAkB;IACpC,cAAc,EAAE,gBAAgB;CACxB,CAAC"}

View File

@ -0,0 +1,101 @@
/// <reference types="node" />
/// <reference types="node" />
declare let fetch: (input: RequestInfo, init?: RequestInit) => Promise<Response>;
export type FetchPolyfill = typeof fetch;
declare type HeadersInit = Headers | string[][] | Record<string, string>;
declare class Headers {
constructor(init?: HeadersInit);
append(name: string, value: string): void;
delete(name: string): void;
get(name: string): string | null;
has(name: string): boolean;
set(name: string, value: string): void;
entries(): IterableIterator<[string, string]>;
forEach(callback: (value: string, index: number, headers: Headers) => void, thisArg?: unknown): void;
keys(): IterableIterator<string>;
values(): IterableIterator<string>;
[Symbol.iterator](): IterableIterator<[string, string]>;
}
declare type BodyInit = Blob | ArrayBufferView | ArrayBuffer | string;
declare type ResponseBodyInit = BodyInit;
interface Body {
readonly bodyUsed: boolean;
arrayBuffer(): Promise<ArrayBuffer>;
blob(): Promise<Blob>;
json(): Promise<JSON>;
json<T>(): Promise<T>;
text(): Promise<string>;
}
declare type RequestInfo = Request | string;
declare class Request implements Body {
constructor(input: RequestInfo, init?: RequestInit);
readonly method: string;
readonly url: string;
readonly headers: Headers;
readonly type: RequestType;
readonly destination: RequestDestination;
readonly referrer: string;
readonly referrerPolicy: ReferrerPolicy;
readonly mode: RequestMode;
readonly credentials: RequestCredentials;
readonly cache: RequestCache;
readonly redirect: RequestRedirect;
readonly integrity: string;
readonly keepalive: boolean;
readonly bodyUsed: boolean;
arrayBuffer(): Promise<ArrayBuffer>;
blob(): Promise<Blob>;
json(): Promise<JSON>;
json<T>(): Promise<T>;
text(): Promise<string>;
clone(): Request;
}
interface RequestInit {
signal?: AbortSignal;
method?: string;
headers?: HeadersInit;
body?: BodyInit;
referrer?: string;
referrerPolicy?: ReferrerPolicy;
mode?: RequestMode;
credentials?: RequestCredentials;
cache?: RequestCache;
redirect?: RequestRedirect;
integrity?: string;
window?: null;
}
type RequestType = '' | 'audio' | 'font' | 'image' | 'script' | 'style' | 'track' | 'video';
type RequestDestination = '' | 'document' | 'embed' | 'font' | 'image' | 'manifest' | 'media' | 'object' | 'report' | 'script' | 'serviceworker' | 'sharedworker' | 'style' | 'worker' | 'xslt';
type RequestMode = 'navigate' | 'same-origin' | 'no-cors' | 'cors';
type RequestCredentials = 'omit' | 'same-origin' | 'include';
type RequestCache = 'default' | 'no-store' | 'reload' | 'no-cache' | 'force-cache' | 'only-if-cached';
type RequestRedirect = 'follow' | 'error' | 'manual';
type ReferrerPolicy = '' | 'no-referrer' | 'no-referrer-when-downgrade' | 'same-origin' | 'origin' | 'strict-origin' | 'origin-when-cross-origin' | 'strict-origin-when-cross-origin' | 'unsafe-url';
declare class Response implements Body {
constructor(body?: ResponseBodyInit, init?: ResponseInit);
static error(): Response;
static redirect(url: string, status?: number): Response;
readonly type: ResponseType;
readonly url: string;
readonly redirected: boolean;
readonly status: number;
readonly ok: boolean;
readonly statusText: string;
readonly headers: Headers;
readonly body: Body | null;
readonly trailer: Promise<Headers>;
readonly bodyUsed: boolean;
arrayBuffer(): Promise<ArrayBuffer>;
blob(): Promise<Blob>;
json(): Promise<Record<string, unknown>>;
json<T>(): Promise<T>;
text(): Promise<string>;
clone(): Response;
}
interface ResponseInit {
status?: number;
statusText?: string;
headers?: HeadersInit;
}
type ResponseType = 'basic' | 'cors' | 'default' | 'error' | 'opaque' | 'opaqueredirect';
export {};

View File

@ -0,0 +1,4 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
let fetch;
//# sourceMappingURL=FetchPolyfill.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"FetchPolyfill.js","sourceRoot":"","sources":["../../src/adapters/FetchPolyfill.ts"],"names":[],"mappings":";;AAAA,IAAI,KAAoE,CAAC"}

46
packages/core/lib/adapters/Plugin.d.ts vendored Normal file
View File

@ -0,0 +1,46 @@
import * as AP from '../activitypub';
import { CoreLibrary, Routes } from './';
export type Plugin = {
handleCreateUserActor?: (this: {
core: CoreLibrary;
routes: Routes;
activity: AP.Activity & {
object: AP.Actor;
};
}) => Promise<AP.Activity & {
object: AP.Actor;
}>;
handleOutboxSideEffect?: (this: {
activity: AP.Activity;
actor: AP.Actor;
core: CoreLibrary;
routes: Routes;
}) => Promise<void>;
handleInboxSideEffect?: (this: {
core: CoreLibrary;
routes: Routes;
}, activity: AP.Activity, recipient: AP.Actor) => Promise<void>;
generateActorId?: (this: {
core: CoreLibrary;
routes: Routes;
}, preferredUsername: string) => string;
generateActorBaseId?: (this: {
core: CoreLibrary;
routes: Routes;
}, preferredUsername: string) => string;
generateActorOutboxId?: (this: {
core: CoreLibrary;
routes: Routes;
}, preferredUsername: string) => string;
generateObjectId?: (object: AP.ExtendedObject) => string;
getHomePageProps?: (this: {
core: CoreLibrary;
routes: Routes;
}, actor: AP.Actor, rawUrl: string) => Promise<object>;
getEntityPageProps?: (this: {
core: CoreLibrary;
routes: Routes;
}, entity: AP.Entity) => Promise<object>;
getIsEntityGetRequest?: (url: string) => boolean;
declareUserActorStreams?: () => string[];
};

View File

@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=Plugin.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"Plugin.js","sourceRoot":"","sources":["../../src/adapters/Plugin.ts"],"names":[],"mappings":""}

63
packages/core/lib/adapters/Routes.d.ts vendored Normal file
View File

@ -0,0 +1,63 @@
export type Routes = {
serverActor: string;
serverInbox: string;
serverOutbox: string;
serverFollowers: string;
serverFollowing: string;
serverHashtags: string;
person: string;
group: string;
application: string;
service: string;
organization: string;
article: string;
event: string;
note: string;
page: string;
place: string;
relationship: string;
profile: string;
video: string;
document: string;
audio: string;
image: string;
hashtag: string;
accept: string;
follow: string;
delete: string;
create: string;
arrive: string;
add: string;
offer: string;
like: string;
leave: string;
ignore: string;
join: string;
reject: string;
invite: string;
tentativeReject: string;
tentativeAccept: string;
view: string;
update: string;
undo: string;
remove: string;
read: string;
listen: string;
move: string;
travel: string;
announce: string;
block: string;
flag: string;
dislike: string;
question: string;
inbox: string;
outbox: string;
followers: string;
following: string;
liked: string;
stream: string;
endpoint: string;
likes: string;
shares: string;
replies: string;
};

View File

@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=Routes.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"Routes.js","sourceRoot":"","sources":["../../src/adapters/Routes.ts"],"names":[],"mappings":""}

View File

@ -0,0 +1,6 @@
/// <reference types="node" />
import type { File } from 'formidable';
export type StorageAdapter = {
params?: Record<string, unknown>;
upload: (this: StorageAdapter, file: File) => Promise<URL>;
};

View File

@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=Storage.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"Storage.js","sourceRoot":"","sources":["../../src/adapters/Storage.ts"],"names":[],"mappings":""}

38
packages/core/lib/adapters/index.d.ts vendored Normal file
View File

@ -0,0 +1,38 @@
/// <reference types="node" />
import * as AP from '..';
import { AuthAdapter } from './Auth';
import { CryptoAdapter } from './Crypto';
import { DbAdapter } from './Db';
import { StorageAdapter } from './Storage';
import { FetchPolyfill } from './FetchPolyfill';
export { AuthAdapter } from './Auth';
export { DbAdapter, DbOptions } from './Db';
export { StorageAdapter } from './Storage';
export { CryptoAdapter } from './Crypto';
export { Plugin } from './Plugin';
export { Routes } from './Routes';
export { FetchPolyfill } from './FetchPolyfill';
export type Adapters = {
auth: AuthAdapter;
db: DbAdapter;
storage: StorageAdapter;
crypto: CryptoAdapter;
};
export type CoreLibrary = AuthAdapter & DbAdapter & StorageAdapter & CryptoAdapter & {
fetch: FetchPolyfill;
getGuid: () => Promise<string>;
findEntityById: (this: CoreLibrary, id: URL) => Promise<AP.Entity | null>;
getActorByUserId: (this: CoreLibrary, userId: string) => Promise<AP.Actor | null>;
getPrivateKey: (this: CoreLibrary, actor: AP.Actor) => Promise<string>;
getStreamByName: (this: CoreLibrary, actor: AP.Actor, name: string) => Promise<AP.EitherCollection | null>;
fetchEntityById: (this: CoreLibrary, id: URL) => Promise<AP.Entity | null>;
queryById: (this: CoreLibrary, id: URL) => Promise<AP.Entity | null>;
expandEntity: (this: CoreLibrary, originalEntity: AP.Entity) => Promise<AP.Entity>;
getCollectionItems: (this: CoreLibrary, entity: AP.Collection | AP.OrderedCollection) => Promise<AP.EntityReference[]>;
getPaginatedCollectionItems: (this: CoreLibrary, collection: AP.Collection | AP.OrderedCollection) => Promise<AP.EntityReference[]>;
expandCollection: (this: CoreLibrary, collection: AP.EitherCollectionReference) => Promise<null | AP.EitherCollection>;
getRecipientInboxUrls: (this: CoreLibrary, activity: AP.Activity, actor: AP.Actor, inboxesOnly?: boolean) => Promise<URL[]>;
getRecipientUrls: (this: CoreLibrary, activity: AP.Activity) => Promise<URL[]>;
broadcast: (this: CoreLibrary, activity: AP.Activity, actor: AP.Actor) => Promise<unknown>;
signAndSendToForeignActorInbox: (this: CoreLibrary, foreignActorInbox: URL, actor: AP.Actor, activity: AP.Activity) => Promise<unknown>;
};

View File

@ -0,0 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DbOptions = void 0;
var Db_1 = require("./Db");
Object.defineProperty(exports, "DbOptions", { enumerable: true, get: function () { return Db_1.DbOptions; } });
//# sourceMappingURL=index.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/adapters/index.ts"],"names":[],"mappings":";;;AASA,2BAA4C;AAAxB,+FAAA,SAAS,OAAA"}

View File

@ -1,3 +1,3 @@
import { Core } from '.';
import * as AP from '@activity-kit/types';
export declare function getPrivateKey(this: Core, actor: AP.Actor): Promise<any>;
export declare function getPrivateKey(this: Core, actor: AP.Actor): Promise<string>;

View File

@ -1,4 +1,4 @@
import { AuthAdapter, CryptoAdapter, DbAdapter, FetchPolyfill, StorageAdapter, CoreLibrary } from '@activity-kit/types';
import { AuthAdapter, CryptoAdapter, DbAdapter, FetchPolyfill, StorageAdapter, CoreLibrary } from './adapters';
import { findEntityById } from './findEntityById';
import { fetchEntityById } from './fetchEntityById';
import { queryById } from './queryById';

View File

@ -1 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,wEAAqC;AAarC,qDAAkD;AAClD,uDAAoD;AACpD,2CAAwC;AACxC,iDAA8C;AAC9C,mDAAgD;AAChD,6DAA0D;AAC1D,+EAA4E;AA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SAAS,GAAG,qBAAS,CAAC;IAItB,YAAY,GAAG,2BAAY,CAAC;IAC5B,kBAAkB,GAAG,uCAAkB,CAAC;IACxC,2BAA2B,GAAG,yDAA2B,CAAC;IAC1D,gBAAgB,GAAG,mCAAgB,CAAC;IAIpC,qBAAqB,GAAG,6CAAqB,CAAC;IAC9C,gBAAgB,GAAG,mCAAgB,CAAC;IACpC,SAAS,GAAG,qBAAS,CAAC;IACtB,8BAA8B,GAAG,+DAA8B,CAAC;CACxE;AA3JD,oBA2JC"}

View File

@ -1,7 +1,6 @@
import fetch from 'isomorphic-fetch';
import {
AP,
AuthAdapter,
CryptoAdapter,
DbAdapter,
@ -9,7 +8,7 @@ import {
FetchPolyfill,
StorageAdapter,
CoreLibrary,
} from '@activity-kit/types';
} from './adapters';
import { findEntityById } from './findEntityById';
import { fetchEntityById } from './fetchEntityById';

View File

@ -1,5 +1,5 @@
{
"name": "type-utilities",
"name": "@activity-kit/type-utilities",
"version": "0.4.45",
"description": "> TODO: description",
"author": "Michael Puckett <michaelcpuckett@gmail.com>",
@ -12,6 +12,9 @@
"files": [
"lib"
],
"publishConfig": {
"access": "public"
},
"scripts": {
"build": "node .build.js",
"format": "prettier --config .prettierrc \"**/*.ts\" --write",