Skip to content

Commit

Permalink
More gateway dependency upgrades
Browse files Browse the repository at this point in the history
  • Loading branch information
knpwrs committed Dec 20, 2024
1 parent b37c501 commit cd2d20c
Show file tree
Hide file tree
Showing 15 changed files with 93 additions and 96 deletions.
Binary file modified services/gateway/bun.lockb
Binary file not shown.
61 changes: 29 additions & 32 deletions services/gateway/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@
},
"license": "UNLICENSE",
"dependencies": {
"@aws-sdk/client-s3": "^3.714.0",
"@aws-sdk/s3-request-presigner": "^3.714.0",
"@aws-sdk/client-s3": "^3.715.0",
"@aws-sdk/s3-request-presigner": "^3.715.0",
"@axiomhq/pino": "^1.3.1",
"@bitpatty/imgproxy-url-builder": "^1.7.0",
"@elastic/elasticsearch": "^8.17.0",
"@envelop/disable-introspection": "^4.0.6",
"@faker-js/faker": "^8.4.1",
"@envelop/disable-introspection": "^6.0.0",
"@faker-js/faker": "^9.3.0",
"@hono/node-server": "^1.13.7",
"@inquirer/prompts": "^1.0.1",
"@knpwrs/envariant": "^1.1.1",
Expand All @@ -80,21 +80,21 @@
"@pothos/plugin-tracing": "^0.5.8",
"@pothos/plugin-validation": "^3.10.1",
"@prisma/client": "^5.22.0",
"@sentry/node": "^7.75.0",
"@sentry/node": "^8.47.0",
"@sindresorhus/slugify": "^2.2.1",
"@temporalio/activity": "^1.11.5",
"@temporalio/client": "^1.11.5",
"@temporalio/worker": "^1.11.5",
"@temporalio/workflow": "^1.11.5",
"@zxcvbn-ts/core": "^2.2.1",
"@zxcvbn-ts/language-common": "^2.0.1",
"@zxcvbn-ts/language-en": "^2.1.0",
"@zxcvbn-ts/core": "^3.0.4",
"@zxcvbn-ts/language-common": "^3.0.4",
"@zxcvbn-ts/language-en": "^3.0.2",
"argon2": "^0.41.1",
"blurhash": "^2.0.5",
"camelcase-keys": "^8.0.2",
"camelcase-keys": "^9.1.3",
"countries-list": "^3.1.1",
"dot-prop": "^7.2.0",
"execa": "^7.0.0",
"dot-prop": "^9.0.0",
"execa": "^9.5.2",
"expiry-map": "^2.0.0",
"fast-glob": "^3.3.2",
"graphql-parse-resolve-info": "^4.13.0",
Expand All @@ -106,37 +106,37 @@
"it-all": "^3.0.6",
"it-filter": "^3.1.1",
"jest-diff": "^29.7.0",
"jose": "^4.13.1",
"jose": "^5.9.6",
"lexorank": "^1.0.5",
"libphonenumber-js": "^1.11.17",
"lodash-es": "^4.17.21",
"m3u8-parser": "^7.2.0",
"mime": "^3.0.0",
"mime": "^4.0.6",
"mjml": "^4.15.3",
"mkdirp": "^2.1.5",
"nanoid": "^4.0.2",
"mkdirp": "^3.0.1",
"nanoid": "^5.0.9",
"nodemailer": "^6.9.16",
"ora": "^6.3.1",
"p-all": "^4.0.0",
"p-filter": "^3.0.0",
"p-lazy": "^4.0.0",
"p-map": "^5.5.0",
"ora": "^8.1.1",
"p-all": "^5.0.0",
"p-filter": "^4.1.0",
"p-lazy": "^5.0.0",
"p-map": "^7.0.3",
"p-memoize": "^7.1.1",
"p-one": "^2.0.0",
"p-queue": "^7.3.4",
"p-retry": "^5.1.2",
"p-queue": "^8.0.1",
"p-retry": "^6.2.1",
"picocolors": "^1.1.1",
"pino": "^8.15.3",
"pino-pretty": "^10.2.0",
"pino": "^9.5.0",
"pino-pretty": "^13.0.0",
"proper-tags": "^2.0.2",
"rimraf": "^4.3.1",
"rimraf": "^6.0.1",
"sanitize-filename": "^1.6.3",
"sharp": "^0.33.5",
"short-uuid": "^4.2.2",
"short-uuid": "^5.2.0",
"subtitle": "^4.2.1",
"tiny-invariant": "^1.3.3",
"uuid": "^9.0.0",
"wait-on": "^7.0.1",
"uuid": "^11.0.3",
"wait-on": "^8.0.1",
"xss": "^1.0.15",
"zod": "^3.24.1"
},
Expand All @@ -146,15 +146,12 @@
"@types/bun": "^1.1.14",
"@types/html-minifier": "^4.0.5",
"@types/lodash-es": "^4.17.12",
"@types/mime": "^3.0.1",
"@types/mime": "^4.0.0",
"@types/mjml": "^4.7.4",
"@types/mkdirp": "^1.0.2",
"@types/node": "^22.10.2",
"@types/nodemailer": "^6.4.17",
"@types/request-ip": "^0.0.41",
"@types/rimraf": "^3.0.2",
"@types/sharp": "^0.32.0",
"@types/uuid": "^9.0.1",
"@types/wait-on": "^5.3.4",
"@typescript-eslint/eslint-plugin": "^6.7.3",
"@typescript-eslint/parser": "^6.7.3",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { join } from 'node:path';
import { Context } from '@temporalio/activity';
import mkdirp from 'mkdirp';
import { mkdirp } from 'mkdirp';
import mime from 'mime';
import rimraf from 'rimraf';
import { rimraf } from 'rimraf';
import { nanoid } from 'nanoid';
import { retryablePutFile, streamObjectToFile } from '../../../util/s3';
import {
Expand Down Expand Up @@ -57,7 +57,7 @@ export default async function processImage(
key: `${s3UploadKey}.imagemagick.json`,
contentType: 'application/json',
body: Buffer.from(JSON.stringify(json, null, 2)),
signal: Context.current().cancellationSignal,
cancelSignal: Context.current().cancellationSignal,
});

if (json.format === 'JPEG') {
Expand All @@ -79,7 +79,7 @@ export default async function processImage(
key: path,
contentType: json.mimeType,
path: downloadPath,
signal: Context.current().cancellationSignal,
cancelSignal: Context.current().cancellationSignal,
});

Context.current().heartbeat();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default async function restitchTranscript(uploadRecordId: string) {
contentType: 'text/vtt',
body: fixedVtt,
contentLength: fixedVtt.length,
signal: Context.current().cancellationSignal,
cancelSignal: Context.current().cancellationSignal,
});

activityLogger.info(`done uploading transcript.vtt`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import { createWriteStream } from 'node:fs';
import { basename, extname, join } from 'node:path';
import { pipeline } from 'node:stream/promises';
import { execa } from 'execa';
import rimraf from 'rimraf';
import { rimraf } from 'rimraf';
import { z } from 'zod';
import { v4 as uuid } from 'uuid';
import mime from 'mime';
import fastGlob from 'fast-glob';
import invariant from 'tiny-invariant';
import mkdirp from 'mkdirp';
import { mkdirp } from 'mkdirp';
import { noop } from 'lodash-es';
import { Context } from '@temporalio/activity';
import type { Prisma } from '@prisma/client';
Expand Down
10 changes: 5 additions & 5 deletions services/gateway/src/temporal/activities/probe/probe.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { join } from 'node:path';
import invariant from 'tiny-invariant';
import { Context } from '@temporalio/activity';
import mkdirp from 'mkdirp';
import rimraf from 'rimraf';
import { mkdirp } from 'mkdirp';
import { rimraf } from 'rimraf';
import {
headObject,
retryablePutFile,
Expand Down Expand Up @@ -31,7 +31,7 @@ export default async function probe(
},
});

const cancellationSignal = Context.current().cancellationSignal;
const cancelSignal = Context.current().cancellationSignal;

const workingDir = join(WORK_DIR, uploadRecordId);

Expand All @@ -54,7 +54,7 @@ export default async function probe(

activityLogger.info(`Probing ${downloadPath}`);

const proc = runFfprobe(workingDir, downloadPath, cancellationSignal);
const proc = runFfprobe(workingDir, downloadPath, cancelSignal);

proc.stdout?.on('data', (data) => {
stdOutLines.push(String(data));
Expand All @@ -75,7 +75,7 @@ export default async function probe(
key: `${uploadRecordId}/probe.json`,
contentType: 'application/json',
body: Buffer.from(probeJson),
signal: cancellationSignal,
cancelSignal,
});

await updateUploadRecord(uploadRecordId, {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { basename, join } from 'node:path';
import { stat } from 'node:fs/promises';
import mkdirp from 'mkdirp';
import { mkdirp } from 'mkdirp';
import { Context } from '@temporalio/activity';
import pMap from 'p-map';
import fastGlob from 'fast-glob';
import { chunk, compact, maxBy } from 'lodash-es';
import pRetry from 'p-retry';
import rimraf from 'rimraf';
import { rimraf } from 'rimraf';
import { retryablePutFile, streamObjectToFile } from '../../../util/s3';
import { runFfmpegThumbnails } from '../../../util/ffmpeg';
import { concatThumbs, imageToBlurhash } from '../../../util/images';
Expand Down Expand Up @@ -80,7 +80,7 @@ export default async function createThumbnails(
contentType: 'image/jpeg',
path: largestThumbnail,
contentLength: (await stat(largestThumbnail)).size,
signal: Context.current().cancellationSignal,
cancelSignal: Context.current().cancellationSignal,
});
await pRetry(
async (attempt) => {
Expand Down Expand Up @@ -121,7 +121,7 @@ export default async function createThumbnails(
contentType: 'image/jpeg',
path,
contentLength: (await stat(path)).size,
signal: Context.current().cancellationSignal,
cancelSignal: Context.current().cancellationSignal,
});
Context.current().heartbeat();
activityLogger.info(`Done uploading thumbnail: ${path}`);
Expand All @@ -140,7 +140,7 @@ export default async function createThumbnails(
key: `${uploadRecordId}/hovernail.jpg`,
contentType: 'image/jpeg',
path: join(workingDir, 'hovernail.jpg'),
signal: Context.current().cancellationSignal,
cancelSignal: Context.current().cancellationSignal,
});
Context.current().heartbeat();
activityLogger.info('Done uploading hovernail');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { join } from 'node:path';
import { stat } from 'node:fs/promises';
import { Context } from '@temporalio/activity';
import mkdirp from 'mkdirp';
import rimraf from 'rimraf';
import { mkdirp } from 'mkdirp';
import { rimraf } from 'rimraf';
import { runAudiowaveform } from '../../../util/audiowaveform';
import { retryablePutFile, streamObjectToFile } from '../../../util/s3';
import logger from '../../../util/logger';
Expand All @@ -26,7 +26,7 @@ export default async function generatePeaks(
});

Context.current().heartbeat('job start');
const cancellationSignal = Context.current().cancellationSignal;
const cancelSignal = Context.current().cancellationSignal;
const workingDir = join(WORK_DIR, uploadRecordId);

try {
Expand All @@ -44,7 +44,7 @@ export default async function generatePeaks(
const peakFiles = await runAudiowaveform(
workingDir,
downloadPath,
cancellationSignal,
cancelSignal,
() => Context.current().heartbeat('audiowaveform'),
);

Expand All @@ -57,7 +57,7 @@ export default async function generatePeaks(
contentType: 'application/json',
path: peakFiles.json,
contentLength: (await stat(peakFiles.json)).size,
signal: cancellationSignal,
cancelSignal,
});
Context.current().heartbeat('Uploaded peak json');
activityLogger.info('Uploaded peak json');
Expand All @@ -69,7 +69,7 @@ export default async function generatePeaks(
contentType: 'application/octet-stream',
path: peakFiles.dat,
contentLength: (await stat(peakFiles.dat)).size,
signal: cancellationSignal,
cancelSignal,
});
Context.current().heartbeat('Uploaded peak dat');
activityLogger.info('Uploaded peak dat');
Expand Down
Loading

0 comments on commit cd2d20c

Please sign in to comment.