Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@slay-pics/slay-q

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@slay-pics/slay-q - npm Package Compare versions

Comparing version 0.1.7 to 0.2.0

32

dist/index.d.ts

@@ -77,32 +77,2 @@ import { z } from 'zod';

declare class SlayQSupabaseDriver<T> implements SlayQDriver {
private readonly _client;
constructor(options?: {
supabaseUrl?: string;
supabaseServiceKey?: string;
});
addJob(jobDef: SlayQJobDefinition): Promise<SlayQRPCError | null>;
triggerWaiting(event: string, match: string, matchVal: string | number | boolean): Promise<SlayQRPCError | null>;
triggerWaitingInvokers(jobKey: string, result: any | null): Promise<SlayQRPCError | null>;
waitForEvent(jobKey: string, event: string, matchKey: string, matchValue: string | number | boolean, stepName: string, expiresAt: Date): Promise<SlayQRPCError | null>;
waitForInvocation(invokerJobKey: string, targetJobKey: string, stepName: string): Promise<SlayQRPCError | null>;
cancelPendingTasks(event: string, matchKey: string, matchVal: string | number | boolean): Promise<SlayQRPCError | null>;
}
declare class SlayQIngestRPCDriver<T> implements SlayQDriver {
private readonly _secret;
private readonly _endpointUrl;
constructor(options?: {
endpointUrl?: string;
secret?: string;
});
private sendRequest;
addJob(jobDef: SlayQJobDefinition): Promise<SlayQRPCError | null>;
triggerWaiting(event: string, match: string, matchVal: string | number | boolean): Promise<SlayQRPCError | null>;
triggerWaitingInvokers(jobKey: string, result: any | null): Promise<SlayQRPCError | null>;
waitForEvent(jobKey: string, event: string, matchKey: string, matchValue: string | number | boolean, stepName: string, expiresAt: Date): Promise<SlayQRPCError | null>;
waitForInvocation(invokerJobKey: string, targetJobKey: string, stepName: string): Promise<SlayQRPCError | null>;
cancelPendingTasks(event: string, matchKey: string, matchVal: string | number | boolean): Promise<SlayQRPCError | null>;
}
type SlayQCacheData = {

@@ -201,2 +171,2 @@ [key: string]: any;

export { SlayQClient, type SlayQClientOptions, type SlayQDriver, SlayQEmptyEvent, type SlayQEmptyEventType, type SlayQFunction, type SlayQFunctionCallback, SlayQIngestRPCDriver, type SlayQJobDefinition, SlayQJobDefinitionSchema, SlayQNoRetryError, type SlayQOptions, type SlayQRPCError, type SlayQReceiveEventPayload, SlayQReceiveEventPayloadSchema, SlayQSupabaseDriver, defineSlayQFunction };
export { SlayQClient, type SlayQClientOptions, type SlayQDriver, SlayQEmptyEvent, type SlayQEmptyEventType, type SlayQFunction, type SlayQFunctionCallback, type SlayQJobDefinition, SlayQJobDefinitionSchema, SlayQNoRetryError, type SlayQOptions, type SlayQRPCError, type SlayQReceiveEventPayload, SlayQReceiveEventPayloadSchema, defineSlayQFunction };

6

package.json
{
"name": "@slay-pics/slay-q",
"version": "0.1.7",
"version": "0.2.0",
"description": "Slay Q is a queue and background job management system inspired by Inngest. It's in production use on https://slay.pics for managing all of our media processing, notifications and other services.",

@@ -10,2 +10,4 @@ "repository": "SlayPics/SlayUtils",

"keywords": [
"slayq",
"slay-q",
"inngest",

@@ -49,6 +51,4 @@ "qstash",

"dependencies": {
"@supabase/supabase-js": "^2.39.2",
"cron-parser": "^4.9.0",
"ms": "^2.1.3",
"ofetch": "^1.3.3",
"short-uuid": "^4.2.2",

@@ -55,0 +55,0 @@ "zod": "^3.22.4",

@@ -43,2 +43,8 @@ # Slay Q

Furthermore, you'll need to select a driver package to connect to your database:
* [`@slay-pics/slay-q-supabase`](https://www.npmjs.com/package/@slay-pics/slay-q-supabase) - Supabase driver that uses `@supabase/supabase-js` to connect to supabase.
* [`@slay-pics/slay-q-postgres`](https://www.npmjs.com/package/@slay-pics/slay-q-postgres) - Driver that talks directly to Postgres via `pg` package.
* [`@slay-pics/slay-q-rpc`](https://www.npmjs.com/package/@slay-pics/slay-q-rpc) - Driver that talks to a [`slay-q-ingest`](https://github.com/SlayPics/SlayUtils/tree/main/apps/slay-ingest) instance. The Slay Q ingest is an HTTP RPC server. See the nuxt example app for an example of its use.
### Write a Function/Job

@@ -315,2 +321,3 @@ The key unit of Slay Q is an event which is represented as a function. Each event/function is made up of individual steps. When

import { SlayQClient } from "@slay-pics/slay-q";
import { SlayQSupabaseDriver } from "@slay-pics/slay-q-supabase";

@@ -353,5 +360,9 @@ import { sleepTestEvent, type SleepTestEvent } from "~/server/slay-q/testing/sleep-test";

The `driver` is the interface with the database that the client will use. Slay Q required Postgres, but we use Supabase exclusively,
so we've only included a driver for that. You must have `SUPABASE_URL` and `SUPABASE_SERVICE_KEY` environment variables defined.
The `driver` is the interface with the database that the client will use. Slay Q provides three base packages with different drivers:
* [`@slay-pics/slay-q-supabase`](https://www.npmjs.com/package/@slay-pics/slay-q-supabase) - Supabase driver that uses `@supabase/supabase-js` to connect to supabase.
* [`@slay-pics/slay-q-postgres`](https://www.npmjs.com/package/@slay-pics/slay-q-postgres) - Driver that talks directly to Postgres via `pg` package.
* [`@slay-pics/slay-q-rpc`](https://www.npmjs.com/package/@slay-pics/slay-q-rpc) - Driver that talks to a [`slay-q-ingest`](https://github.com/SlayPics/SlayUtils/tree/main/apps/slay-ingest) instance. The Slay Q ingest is an HTTP RPC server. See the nuxt example app for an example of its use.
### Dispatch Events

@@ -358,0 +369,0 @@ Once you've created the client, dispatching events is easy:

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc