@slay-pics/slay-q
Advanced tools
Comparing version 0.1.7 to 0.2.0
@@ -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 }; |
{ | ||
"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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 3 instances in 1 package
6
439
3
71239
1097
- Removed@supabase/supabase-js@^2.39.2
- Removedofetch@^1.3.3
- Removed@supabase/auth-js@2.65.1(transitive)
- Removed@supabase/functions-js@2.4.3(transitive)
- Removed@supabase/node-fetch@2.6.15(transitive)
- Removed@supabase/postgrest-js@1.16.3(transitive)
- Removed@supabase/realtime-js@2.10.7(transitive)
- Removed@supabase/storage-js@2.7.1(transitive)
- Removed@supabase/supabase-js@2.46.1(transitive)
- Removed@types/node@22.9.0(transitive)
- Removed@types/phoenix@1.6.5(transitive)
- Removed@types/ws@8.5.13(transitive)
- Removeddestr@2.0.3(transitive)
- Removednode-fetch-native@1.6.4(transitive)
- Removedofetch@1.4.1(transitive)
- Removedtr46@0.0.3(transitive)
- Removedufo@1.5.4(transitive)
- Removedundici-types@6.19.8(transitive)
- Removedwebidl-conversions@3.0.1(transitive)
- Removedwhatwg-url@5.0.0(transitive)
- Removedws@8.18.0(transitive)