@workglow/supabase 0.2.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/job-queue/SupabaseQueueStorage.d.ts +196 -0
- package/dist/job-queue/SupabaseQueueStorage.d.ts.map +1 -0
- package/dist/job-queue/SupabaseRateLimiterStorage.d.ts +54 -0
- package/dist/job-queue/SupabaseRateLimiterStorage.d.ts.map +1 -0
- package/dist/job-queue/browser.d.ts +7 -0
- package/dist/job-queue/browser.d.ts.map +1 -0
- package/dist/job-queue/browser.js +765 -0
- package/dist/job-queue/browser.js.map +11 -0
- package/dist/job-queue/bun.d.ts +7 -0
- package/dist/job-queue/bun.d.ts.map +1 -0
- package/dist/job-queue/common.d.ts +8 -0
- package/dist/job-queue/common.d.ts.map +1 -0
- package/dist/job-queue/node.d.ts +7 -0
- package/dist/job-queue/node.d.ts.map +1 -0
- package/dist/job-queue/node.js +765 -0
- package/dist/job-queue/node.js.map +11 -0
- package/dist/storage/SupabaseKvStorage.d.ts +32 -0
- package/dist/storage/SupabaseKvStorage.d.ts.map +1 -0
- package/dist/storage/SupabaseTabularStorage.d.ts +172 -0
- package/dist/storage/SupabaseTabularStorage.d.ts.map +1 -0
- package/dist/storage/browser.d.ts +7 -0
- package/dist/storage/browser.d.ts.map +1 -0
- package/dist/storage/browser.js +590 -0
- package/dist/storage/browser.js.map +11 -0
- package/dist/storage/bun.d.ts +7 -0
- package/dist/storage/bun.d.ts.map +1 -0
- package/dist/storage/common.d.ts +8 -0
- package/dist/storage/common.d.ts.map +1 -0
- package/dist/storage/node.d.ts +7 -0
- package/dist/storage/node.d.ts.map +1 -0
- package/dist/storage/node.js +590 -0
- package/dist/storage/node.js.map +11 -0
- package/package.json +76 -0
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Steven Roussey <sroussey@gmail.com>
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import type { SupabaseClient } from "@supabase/supabase-js";
|
|
7
|
+
import { JobStatus } from "@workglow/job-queue";
|
|
8
|
+
import type { IQueueStorage, JobStorageFormat, PrefixColumn, QueueChangePayload, QueueStorageOptions, QueueSubscribeOptions } from "@workglow/job-queue";
|
|
9
|
+
export declare const SUPABASE_QUEUE_STORAGE: import("@workglow/util").ServiceToken<IQueueStorage<any, any>>;
|
|
10
|
+
/**
|
|
11
|
+
* Supabase implementation of a job queue.
|
|
12
|
+
* Provides storage and retrieval for job execution states using Supabase.
|
|
13
|
+
*/
|
|
14
|
+
export declare class SupabaseQueueStorage<Input, Output> implements IQueueStorage<Input, Output> {
|
|
15
|
+
protected readonly queueName: string;
|
|
16
|
+
readonly scope: "cluster";
|
|
17
|
+
protected readonly client: SupabaseClient;
|
|
18
|
+
protected readonly prefixes: readonly PrefixColumn[];
|
|
19
|
+
protected readonly prefixValues: Readonly<Record<string, string | number>>;
|
|
20
|
+
protected readonly tableName: string;
|
|
21
|
+
private realtimeChannel;
|
|
22
|
+
private pollingManager;
|
|
23
|
+
constructor(client: SupabaseClient, queueName: string, options?: QueueStorageOptions);
|
|
24
|
+
/**
|
|
25
|
+
* Gets the SQL column type for a prefix column (Supabase supports UUID natively)
|
|
26
|
+
*/
|
|
27
|
+
private getPrefixColumnType;
|
|
28
|
+
/**
|
|
29
|
+
* Builds the prefix columns SQL for CREATE TABLE
|
|
30
|
+
*/
|
|
31
|
+
private buildPrefixColumnsSql;
|
|
32
|
+
/**
|
|
33
|
+
* Builds prefix column names for use in queries
|
|
34
|
+
*/
|
|
35
|
+
private getPrefixColumnNames;
|
|
36
|
+
/**
|
|
37
|
+
* Applies prefix filters to a Supabase query builder
|
|
38
|
+
*/
|
|
39
|
+
private applyPrefixFilters;
|
|
40
|
+
/**
|
|
41
|
+
* Gets prefix values as an object for inserts
|
|
42
|
+
*/
|
|
43
|
+
private getPrefixInsertValues;
|
|
44
|
+
/**
|
|
45
|
+
* Builds WHERE clause conditions for prefix filtering with inline values (for raw SQL)
|
|
46
|
+
* @returns SQL conditions string with values inlined
|
|
47
|
+
*/
|
|
48
|
+
private buildPrefixWhereSql;
|
|
49
|
+
/**
|
|
50
|
+
* Regex for validating SQL literal-safe strings.
|
|
51
|
+
* Used for quoted values (e.g. queue names/IDs) and only allows alphanumeric
|
|
52
|
+
* characters, underscores, hyphens, colons, and periods.
|
|
53
|
+
*/
|
|
54
|
+
private static readonly SAFE_SQL_VALUE_RE;
|
|
55
|
+
/**
|
|
56
|
+
* Validates that a string value is safe for use as a quoted SQL literal.
|
|
57
|
+
* Throws an error if the value contains characters outside SAFE_SQL_VALUE_RE.
|
|
58
|
+
*/
|
|
59
|
+
private validateSqlValue;
|
|
60
|
+
/**
|
|
61
|
+
* Escapes a string value for use in SQL
|
|
62
|
+
*/
|
|
63
|
+
private escapeSqlString;
|
|
64
|
+
setupDatabase(): Promise<void>;
|
|
65
|
+
/**
|
|
66
|
+
* Adds a new job to the queue.
|
|
67
|
+
* @param job - The job to add
|
|
68
|
+
* @returns The ID of the added job
|
|
69
|
+
*/
|
|
70
|
+
add(job: JobStorageFormat<Input, Output>): Promise<unknown>;
|
|
71
|
+
/**
|
|
72
|
+
* Retrieves a job by its ID.
|
|
73
|
+
* @param id - The ID of the job to retrieve
|
|
74
|
+
* @returns The job if found, undefined otherwise
|
|
75
|
+
*/
|
|
76
|
+
get(id: unknown): Promise<JobStorageFormat<Input, Output> | undefined>;
|
|
77
|
+
/**
|
|
78
|
+
* Retrieves a slice of jobs from the queue.
|
|
79
|
+
* @param status - The status to filter by
|
|
80
|
+
* @param num - Maximum number of jobs to return
|
|
81
|
+
* @returns An array of jobs
|
|
82
|
+
*/
|
|
83
|
+
peek(status?: JobStatus, num?: number): Promise<JobStorageFormat<Input, Output>[]>;
|
|
84
|
+
/**
|
|
85
|
+
* Retrieves the next available job that is ready to be processed.
|
|
86
|
+
* Uses atomic UPDATE with subquery SELECT FOR UPDATE SKIP LOCKED to prevent race conditions.
|
|
87
|
+
* @param workerId - Worker ID to associate with the job (required)
|
|
88
|
+
* @returns The next job or undefined if no job is available
|
|
89
|
+
*/
|
|
90
|
+
next(workerId: string): Promise<JobStorageFormat<Input, Output> | undefined>;
|
|
91
|
+
/**
|
|
92
|
+
* Retrieves the number of jobs in the queue with a specific status.
|
|
93
|
+
* @param status - The status of the jobs to count
|
|
94
|
+
* @returns The count of jobs with the specified status
|
|
95
|
+
*/
|
|
96
|
+
size(status?: "PENDING"): Promise<number>;
|
|
97
|
+
private getAllJobs;
|
|
98
|
+
/**
|
|
99
|
+
* Marks a job as complete with its output or error.
|
|
100
|
+
* Enhanced error handling:
|
|
101
|
+
* - For a retryable error, increments run_attempts and updates run_after.
|
|
102
|
+
* - Marks a job as FAILED immediately for permanent or generic errors.
|
|
103
|
+
*/
|
|
104
|
+
complete(jobDetails: JobStorageFormat<Input, Output>): Promise<void>;
|
|
105
|
+
/**
|
|
106
|
+
* Releases a claimed job without consuming a retry attempt.
|
|
107
|
+
*/
|
|
108
|
+
release(jobId: unknown): Promise<void>;
|
|
109
|
+
/**
|
|
110
|
+
* Clears all jobs from the queue.
|
|
111
|
+
*/
|
|
112
|
+
deleteAll(): Promise<void>;
|
|
113
|
+
/**
|
|
114
|
+
* Looks up cached output for a given input
|
|
115
|
+
* Uses input fingerprinting for efficient matching
|
|
116
|
+
* @returns The cached output or null if not found
|
|
117
|
+
*/
|
|
118
|
+
outputForInput(input: Input): Promise<Output | null>;
|
|
119
|
+
/**
|
|
120
|
+
* Aborts a job by setting its status to "ABORTING".
|
|
121
|
+
* This method will signal the corresponding AbortController so that
|
|
122
|
+
* the job's execute() method (if it supports an AbortSignal parameter)
|
|
123
|
+
* can clean up and exit.
|
|
124
|
+
*/
|
|
125
|
+
abort(jobId: unknown): Promise<void>;
|
|
126
|
+
/**
|
|
127
|
+
* Retrieves all jobs for a given job run ID.
|
|
128
|
+
* @param job_run_id - The ID of the job run to retrieve
|
|
129
|
+
* @returns An array of jobs
|
|
130
|
+
*/
|
|
131
|
+
getByRunId(job_run_id: string): Promise<Array<JobStorageFormat<Input, Output>>>;
|
|
132
|
+
/**
|
|
133
|
+
* Implements the saveProgress method
|
|
134
|
+
*/
|
|
135
|
+
saveProgress(jobId: unknown, progress: number, message: string, details: Record<string, any>): Promise<void>;
|
|
136
|
+
/**
|
|
137
|
+
* Deletes a job by its ID
|
|
138
|
+
*/
|
|
139
|
+
delete(jobId: unknown): Promise<void>;
|
|
140
|
+
/**
|
|
141
|
+
* Delete jobs with a specific status older than a cutoff date
|
|
142
|
+
* @param status - Status of jobs to delete
|
|
143
|
+
* @param olderThanMs - Delete jobs completed more than this many milliseconds ago
|
|
144
|
+
*/
|
|
145
|
+
deleteJobsByStatusAndAge(status: JobStatus, olderThanMs: number): Promise<void>;
|
|
146
|
+
/**
|
|
147
|
+
* Checks if a job from a realtime payload matches the specified prefix filter
|
|
148
|
+
* @param job - The job record from the realtime payload
|
|
149
|
+
* @param prefixFilter - The prefix filter to match against (undefined = use instance prefixes, {} = no filter)
|
|
150
|
+
*/
|
|
151
|
+
private matchesPrefixFilter;
|
|
152
|
+
/**
|
|
153
|
+
* Checks if a prefix filter is custom (different from instance's prefixes).
|
|
154
|
+
*/
|
|
155
|
+
private isCustomPrefixFilter;
|
|
156
|
+
private getAllJobsWithFilter;
|
|
157
|
+
/**
|
|
158
|
+
* Subscribes to changes in the queue.
|
|
159
|
+
* Uses Supabase realtime by default.
|
|
160
|
+
*
|
|
161
|
+
* @param callback - Function called when a change occurs
|
|
162
|
+
* @param options - Subscription options including prefix filter
|
|
163
|
+
* @returns Unsubscribe function
|
|
164
|
+
*/
|
|
165
|
+
subscribeToChanges(callback: (change: QueueChangePayload<Input, Output>) => void, options?: QueueSubscribeOptions): () => void;
|
|
166
|
+
/**
|
|
167
|
+
* Subscribe using Supabase realtime (protected).
|
|
168
|
+
*
|
|
169
|
+
* @param callback - Function called when a change occurs
|
|
170
|
+
* @param prefixFilter - Optional prefix filter (undefined = use instance prefixes, {} = no filter)
|
|
171
|
+
* @returns Unsubscribe function
|
|
172
|
+
*/
|
|
173
|
+
protected subscribeToChangesWithRealtime(callback: (change: QueueChangePayload<Input, Output>) => void, prefixFilter?: Readonly<Record<string, string | number>>): () => void;
|
|
174
|
+
/**
|
|
175
|
+
* Gets or creates the shared polling subscription manager for normal subscriptions (fallback).
|
|
176
|
+
* This ensures all normal subscriptions share a single polling loop per interval.
|
|
177
|
+
*/
|
|
178
|
+
private getPollingManager;
|
|
179
|
+
/**
|
|
180
|
+
* Creates a dedicated polling subscription for custom prefix filters (fallback).
|
|
181
|
+
* This runs separately from the normal polling manager with DB-level filtering.
|
|
182
|
+
*/
|
|
183
|
+
private subscribeWithCustomPrefixFilterPolling;
|
|
184
|
+
/**
|
|
185
|
+
* Subscribe using polling (protected, available as fallback).
|
|
186
|
+
*
|
|
187
|
+
* Normal subscriptions (no custom prefix filter) share a single polling loop for efficiency.
|
|
188
|
+
* Custom prefix filter subscriptions get their own dedicated polling loop with DB-level filtering.
|
|
189
|
+
*
|
|
190
|
+
* @param callback - Function called when a change occurs
|
|
191
|
+
* @param options - Subscription options including interval and prefix filter
|
|
192
|
+
* @returns Unsubscribe function
|
|
193
|
+
*/
|
|
194
|
+
protected subscribeToChangesWithPolling(callback: (change: QueueChangePayload<Input, Output>) => void, options?: QueueSubscribeOptions): () => void;
|
|
195
|
+
}
|
|
196
|
+
//# sourceMappingURL=SupabaseQueueStorage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SupabaseQueueStorage.d.ts","sourceRoot":"","sources":["../../src/job-queue/SupabaseQueueStorage.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAmB,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAG7E,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,kBAAkB,EAEl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<sroussey@gmail.com>
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { SupabaseClient } from "@supabase/supabase-js";
|
|
7
|
+
import type { PrefixColumn } from "@workglow/job-queue";
|
|
8
|
+
import type { IRateLimiterStorage, RateLimiterStorageOptions, RateLimiterStorageScope } from "@workglow/job-queue";
|
|
9
|
+
export declare const SUPABASE_RATE_LIMITER_STORAGE: import("@workglow/util").ServiceToken<IRateLimiterStorage>;
|
|
10
|
+
/**
|
|
11
|
+
* Supabase implementation of rate limiter storage.
|
|
12
|
+
* Manages execution records and next available times for rate limiting.
|
|
13
|
+
*/
|
|
14
|
+
export declare class SupabaseRateLimiterStorage implements IRateLimiterStorage {
|
|
15
|
+
readonly scope: RateLimiterStorageScope;
|
|
16
|
+
protected readonly client: SupabaseClient;
|
|
17
|
+
protected readonly prefixes: readonly PrefixColumn[];
|
|
18
|
+
protected readonly prefixValues: Readonly<Record<string, string | number>>;
|
|
19
|
+
protected readonly executionTableName: string;
|
|
20
|
+
protected readonly nextAvailableTableName: string;
|
|
21
|
+
constructor(client: unknown, options?: RateLimiterStorageOptions);
|
|
22
|
+
/**
|
|
23
|
+
* Gets the SQL column type for a prefix column (Supabase supports UUID natively).
|
|
24
|
+
*/
|
|
25
|
+
private getPrefixColumnType;
|
|
26
|
+
/**
|
|
27
|
+
* Builds the prefix columns SQL for CREATE TABLE.
|
|
28
|
+
*/
|
|
29
|
+
private buildPrefixColumnsSql;
|
|
30
|
+
/**
|
|
31
|
+
* Builds prefix column names for use in queries.
|
|
32
|
+
*/
|
|
33
|
+
private getPrefixColumnNames;
|
|
34
|
+
/**
|
|
35
|
+
* Applies prefix filters to a Supabase query builder.
|
|
36
|
+
*/
|
|
37
|
+
private applyPrefixFilters;
|
|
38
|
+
/**
|
|
39
|
+
* Gets prefix values as an object for inserts.
|
|
40
|
+
*/
|
|
41
|
+
private getPrefixInsertValues;
|
|
42
|
+
setupDatabase(): Promise<void>;
|
|
43
|
+
/** Stable function name derived from table name (Postgres identifiers ≤63 chars). */
|
|
44
|
+
private atomicReserveFunctionName;
|
|
45
|
+
tryReserveExecution(queueName: string, maxExecutions: number, windowMs: number): Promise<unknown | null>;
|
|
46
|
+
releaseExecution(queueName: string, token: unknown): Promise<void>;
|
|
47
|
+
recordExecution(queueName: string): Promise<void>;
|
|
48
|
+
getExecutionCount(queueName: string, windowStartTime: string): Promise<number>;
|
|
49
|
+
getOldestExecutionAtOffset(queueName: string, offset: number): Promise<string | undefined>;
|
|
50
|
+
getNextAvailableTime(queueName: string): Promise<string | undefined>;
|
|
51
|
+
setNextAvailableTime(queueName: string, nextAvailableAt: string): Promise<void>;
|
|
52
|
+
clear(queueName: string): Promise<void>;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=SupabaseRateLimiterStorage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SupabaseRateLimiterStorage.d.ts","sourceRoot":"","sources":["../../src/job-queue/SupabaseRateLimiterStorage.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EACV,mBAAmB,EACnB,yBAAyB,EACzB,uBAAuB,EACxB,MAAM,qBAAqB,CAAC;AAE7B,eAAO,MAAM,6BAA6B,4DAEzC,CAAC;AAEF;;;GAGG;AACH,qBAAa,0BAA2B,YAAW,mBAAmB;IACpE,SAAgB,KAAK,EAAE,uBAAuB,CAAa;IAC3D,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;IAC1C,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,SAAS,YAAY,EAAE,CAAC;IACrD,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,C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