Skip to content

Commit

Permalink
Merge branch 'main' into oltp
Browse files Browse the repository at this point in the history
  • Loading branch information
llun committed Sep 14, 2024
2 parents 688d6dc + 7062614 commit 01742d8
Show file tree
Hide file tree
Showing 11 changed files with 382 additions and 369 deletions.
12 changes: 7 additions & 5 deletions app/api/inbox/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ import {
UndoAction,
UpdateAction
} from '@/lib/activities/actions/types'
import { CREATE_ANNOUNCE_JOB_NAME } from '@/lib/jobs/createAnnounceJob'
import { CREATE_NOTE_JOB_NAME } from '@/lib/jobs/createNoteJob'
import { CREATE_POLL_JOB_NAME } from '@/lib/jobs/createPollJob'
import { UPDATE_NOTE_JOB_NAME } from '@/lib/jobs/updateNoteJob'
import { UPDATE_POLL_JOB_NAME } from '@/lib/jobs/updatePollJob'
import {
CREATE_ANNOUNCE_JOB_NAME,
CREATE_NOTE_JOB_NAME,
CREATE_POLL_JOB_NAME,
UPDATE_NOTE_JOB_NAME,
UPDATE_POLL_JOB_NAME
} from '@/lib/jobs/names'
import { ActivityPubVerifySenderGuard } from '@/lib/services/guards/ActivityPubVerifyGuard'
import { getQueue } from '@/lib/services/queue'
import { HttpMethod } from '@/lib/utils/getCORSHeaders'
Expand Down
4 changes: 2 additions & 2 deletions lib/jobs/createAnnounceJob.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import { addStatusToTimelines } from '../services/timelines'
import { compact } from '../utils/jsonld'
import { ACTIVITY_STREAM_URL } from '../utils/jsonld/activitystream'
import { createJobHandle } from './createJobHandle'
import { CREATE_NOTE_JOB_NAME, createNoteJob } from './createNoteJob'
import { createNoteJob } from './createNoteJob'
import { CREATE_ANNOUNCE_JOB_NAME, CREATE_NOTE_JOB_NAME } from './names'

export const CREATE_ANNOUNCE_JOB_NAME = 'CreateAnnounceJob'
export const createAnnounceJob: JobHandle = createJobHandle(
CREATE_ANNOUNCE_JOB_NAME,
async (storage, message) => {
Expand Down
3 changes: 2 additions & 1 deletion lib/jobs/createNoteJob.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import { MockImageDocument } from '../stub/imageDocument'
import { MockLitepubNote, MockMastodonNote } from '../stub/note'
import { seedActor1 } from '../stub/seed/actor1'
import { seedStorage } from '../stub/storage'
import { CREATE_NOTE_JOB_NAME, createNoteJob } from './createNoteJob'
import { createNoteJob } from './createNoteJob'
import { CREATE_NOTE_JOB_NAME } from './names'

enableFetchMocks()

Expand Down
2 changes: 1 addition & 1 deletion lib/jobs/createNoteJob.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import { addStatusToTimelines } from '../services/timelines'
import { compact } from '../utils/jsonld'
import { ACTIVITY_STREAM_URL } from '../utils/jsonld/activitystream'
import { createJobHandle } from './createJobHandle'
import { CREATE_NOTE_JOB_NAME } from './names'

export const CREATE_NOTE_JOB_NAME = 'CreateNoteJob'
export const createNoteJob = createJobHandle(
CREATE_NOTE_JOB_NAME,
async (storage, message) => {
Expand Down
2 changes: 1 addition & 1 deletion lib/jobs/createPollJob.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { addStatusToTimelines } from '../services/timelines'
import { compact } from '../utils/jsonld'
import { ACTIVITY_STREAM_URL } from '../utils/jsonld/activitystream'
import { createJobHandle } from './createJobHandle'
import { CREATE_POLL_JOB_NAME } from './names'

export const CREATE_POLL_JOB_NAME = 'CreatePollJob'
export const createPollJob = createJobHandle(
CREATE_POLL_JOB_NAME,
async (storage, message) => {
Expand Down
16 changes: 10 additions & 6 deletions lib/jobs/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import { JobHandle } from '../services/queue/type'
import { createAnnounceJob } from './createAnnounceJob'
import { createNoteJob } from './createNoteJob'
import { createPollJob } from './createPollJob'
import {
CREATE_ANNOUNCE_JOB_NAME,
createAnnounceJob
} from './createAnnounceJob'
import { CREATE_NOTE_JOB_NAME, createNoteJob } from './createNoteJob'
import { CREATE_POLL_JOB_NAME, createPollJob } from './createPollJob'
import { UPDATE_NOTE_JOB_NAME, updateNoteJob } from './updateNoteJob'
import { UPDATE_POLL_JOB_NAME, updatePollJob } from './updatePollJob'
CREATE_NOTE_JOB_NAME,
CREATE_POLL_JOB_NAME,
UPDATE_NOTE_JOB_NAME,
UPDATE_POLL_JOB_NAME
} from './names'
import { updateNoteJob } from './updateNoteJob'
import { updatePollJob } from './updatePollJob'

export const JOBS: Record<string, JobHandle> = {
[CREATE_NOTE_JOB_NAME]: createNoteJob,
Expand Down
5 changes: 5 additions & 0 deletions lib/jobs/names.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export const CREATE_ANNOUNCE_JOB_NAME = 'CreateAnnounceJob'
export const CREATE_NOTE_JOB_NAME = 'CreateNoteJob'
export const CREATE_POLL_JOB_NAME = 'CreatePollJob'
export const UPDATE_NOTE_JOB_NAME = 'UpdateNoteJob'
export const UPDATE_POLL_JOB_NAME = 'UpdatePollJob'
2 changes: 1 addition & 1 deletion lib/jobs/updateNoteJob.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { StatusType } from '../models/status'
import { compact } from '../utils/jsonld'
import { ACTIVITY_STREAM_URL } from '../utils/jsonld/activitystream'
import { createJobHandle } from './createJobHandle'
import { UPDATE_NOTE_JOB_NAME } from './names'

export const UPDATE_NOTE_JOB_NAME = 'UpdateNoteJob'
export const updateNoteJob = createJobHandle(
UPDATE_NOTE_JOB_NAME,
async (storage, message) => {
Expand Down
2 changes: 1 addition & 1 deletion lib/jobs/updatePollJob.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { StatusType } from '../models/status'
import { compact } from '../utils/jsonld'
import { ACTIVITY_STREAM_URL } from '../utils/jsonld/activitystream'
import { createJobHandle } from './createJobHandle'
import { UPDATE_POLL_JOB_NAME } from './names'

export const UPDATE_POLL_JOB_NAME = 'UpdatePollJob'
export const updatePollJob = createJobHandle(
UPDATE_POLL_JOB_NAME,
async (storage, message) => {
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
"migrate:make": "knex migrate:make"
},
"dependencies": {
"@aws-sdk/client-lambda": "^3.650.0",
"@aws-sdk/client-s3": "^3.651.0",
"@aws-sdk/s3-presigned-post": "^3.651.0",
"@aws-sdk/client-lambda": "^3.651.1",
"@aws-sdk/client-s3": "^3.651.1",
"@aws-sdk/s3-presigned-post": "^3.651.1",
"@aws-sdk/util-utf8-node": "^3.259.0",
"@date-fns/utc": "^2.0.1",
"@date-fns/utc": "^2.1.0",
"@google-cloud/firestore": "^7.10.0",
"@google-cloud/opentelemetry-cloud-trace-exporter": "^2.3.0",
"@jmondi/oauth2-server": "^4.0.2",
Expand All @@ -42,7 +42,7 @@
"@opentelemetry/sdk-trace-node": "1.25.1",
"@opentelemetry/semantic-conventions": "1.25.1",
"@popperjs/core": "^2.11.8",
"@upstash/qstash": "2.7.6",
"@upstash/qstash": "2.7.8",
"@vercel/otel": "^1.10.0",
"bcrypt": "^5.1.1",
"better-sqlite3": "^11.3.0",
Expand Down Expand Up @@ -90,7 +90,7 @@
"@types/jsonwebtoken": "^9",
"@types/lodash": "^4.17.7",
"@types/mime-types": "^2.1.4",
"@types/node": "^22.5.4",
"@types/node": "^22.5.5",
"@types/nodemailer": "^6.4.15",
"@types/react": "18.3.5",
"@types/react-dom": "18.3.0",
Expand All @@ -107,7 +107,7 @@
"eslint-plugin-jest": "^28.8.3",
"eslint-plugin-n": "^17.10.2",
"eslint-plugin-promise": "^7.1.0",
"eslint-plugin-unused-imports": "^4.1.3",
"eslint-plugin-unused-imports": "^4.1.4",
"firebase-tools": "^13.17.0",
"jest": "^29.7.0",
"jest-extended": "^4.0.2",
Expand Down
Loading

0 comments on commit 01742d8

Please sign in to comment.