This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Superjson is awesome, but here are a few considerations for using transformers in middleware are: | |
1 - Building multi-language flows (TS + Python) become tricky if you're serializing events. | |
2 - You're locked into superjson for long running jobs, so if you want to change a serialization format, you'll have to support backcompat. | |
3 - Pass through TypeScript types for transformers like this aren't yet well supported. You may need to cast http://step.run return values until we fix that up (we plan to). | |
*/ | |
import { Inngest } from 'inngest'; | |
import { superjsonMiddleware } from './superjson-middleware'; | |
const inngest = new Inngest({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const cronJob = inngest.createFunction( | |
{ id: 'cron-job' }, | |
process.env.VERCEL_ENV === 'preview' | |
? { event: 'trigger-cron' } | |
: { cron: '45 23 * * *' }, | |
async ({ step }) => { | |
// your logic here | |
} | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { inngest } from './client'; | |
/* | |
1. Submit migration job details include video source platform, video destination platform, authentication details, and import settings, and get back a job id (provided by Inngest?) | |
2. Inngest starts the migration by listing all videos in the source platform | |
3. A request is then made to each individual video to get that specific video’s details, including a signed URL to access that video’s master file | |
4. A request is then made to PUT that video over to the destination platform either by providing the signed URL directly to the platform or by pushing chunks of the video to the destination platform as a multipart file upload | |
5. The status of the video upload/ingest is monitored via multipart upload progress or by listening for a webhook from the destination platform indicating success or failure | |
6. Each video’s status is then reported back to the client based off of the initial job ID that the client received in step one | |
7. The job is considered complete when all videos ha |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { type NextRequest } from 'next/server'; | |
import { Inngest, InngestMiddleware } from 'inngest'; | |
import { schemas } from './types'; | |
export const searchParamsMiddleware = new InngestMiddleware({ | |
name: 'query-params-pass-through', | |
init({}) { | |
return { | |
onFunctionRun() { | |
return { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { InngestMiddleware } from "inngest"; | |
export const encryptionMiddleware = ( | |
key: string = process.env.INNGEST_ENCRYPTION_KEY || "" | |
) => { | |
if (!key) { | |
throw new Error("Must provide an encryption key"); | |
} | |
const prefix = "__ENCRYPTED__"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createFunction } from "inngest"; // v0.6.1 | |
import { serve } from "inngest/cloudflare"; | |
/** | |
* Inngest serve requires "node_compat = true" to be set in your wrangler.toml | |
* | |
* Set INNGEST_SIGNING_KEY in your wrangler.toml environment variables. | |
* Get this key in your Inngest dashboard: https://app.inngest.com/secrets | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Usage `./local-deploy.sh <command> <service-name> | |
# Requirements: helm must be installed and match the version on our cluster | |
# commands: | |
# deploy Deploys the code to the cluster (requires cluster access) | |
# dry-run Prints the k8s deployment and service yaml files generates by helm | |
CMD="$1" | |
SVC="$2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 3 package approach | |
/maildev-smtp | |
/src # most of what currently is in /lib | |
/test | |
/index.js | |
/package.json | |
/maildev-ui | |
/src # all the react components, etc. | |
/public | |
/package.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: extensions/v1beta1 | |
kind: Deployment | |
metadata: | |
name: respond-server | |
namespace: reply | |
spec: | |
replicas: 12 | |
strategy: | |
rollingUpdate: | |
maxSurge: 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class MongoId implements Serializable, JsonSerializable | |
{ | |
public $id; | |
public function __construct($id) | |
{ | |
$this->id = (string) $id; | |
} |
NewerOlder