@blazetrails/activejob 0.0.0-stage → 0.1.0-alpha0.1
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/LICENSE +21 -0
- package/README.md +43 -2
- package/dist/active-job.d.ts +3 -0
- package/dist/active-job.js +11 -0
- package/dist/active-job.js.map +1 -0
- package/dist/arguments.d.ts +20 -0
- package/dist/arguments.js +222 -0
- package/dist/arguments.js.map +1 -0
- package/dist/base.d.ts +70 -0
- package/dist/base.js +71 -0
- package/dist/base.js.map +1 -0
- package/dist/callbacks.d.ts +17 -0
- package/dist/callbacks.js +35 -0
- package/dist/callbacks.js.map +1 -0
- package/dist/configured-job.d.ts +8 -0
- package/dist/configured-job.js +17 -0
- package/dist/configured-job.js.map +1 -0
- package/dist/constants.generated.d.ts +2 -0
- package/dist/constants.generated.js +85 -0
- package/dist/constants.generated.js.map +1 -0
- package/dist/constants.test-case.generated.d.ts +2 -0
- package/dist/constants.test-case.generated.js +4 -0
- package/dist/constants.test-case.generated.js.map +1 -0
- package/dist/constants.test-helper.generated.d.ts +2 -0
- package/dist/constants.test-helper.generated.js +8 -0
- package/dist/constants.test-helper.generated.js.map +1 -0
- package/dist/core.d.ts +80 -0
- package/dist/core.js +185 -0
- package/dist/core.js.map +1 -0
- package/dist/deprecator.d.ts +3 -0
- package/dist/deprecator.js +6 -0
- package/dist/deprecator.js.map +1 -0
- package/dist/enqueue-after-transaction-commit.d.ts +10 -0
- package/dist/enqueue-after-transaction-commit.js +49 -0
- package/dist/enqueue-after-transaction-commit.js.map +1 -0
- package/dist/enqueuing.d.ts +30 -0
- package/dist/enqueuing.js +98 -0
- package/dist/enqueuing.js.map +1 -0
- package/dist/exceptions.d.ts +50 -0
- package/dist/exceptions.js +140 -0
- package/dist/exceptions.js.map +1 -0
- package/dist/execution.d.ts +32 -0
- package/dist/execution.js +46 -0
- package/dist/execution.js.map +1 -0
- package/dist/gem-version.d.ts +10 -0
- package/dist/gem-version.js +16 -0
- package/dist/gem-version.js.map +1 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +24 -0
- package/dist/index.js.map +1 -0
- package/dist/instrumentation.d.ts +24 -0
- package/dist/instrumentation.js +48 -0
- package/dist/instrumentation.js.map +1 -0
- package/dist/log-subscriber.d.ts +33 -0
- package/dist/log-subscriber.js +233 -0
- package/dist/log-subscriber.js.map +1 -0
- package/dist/logging.d.ts +19 -0
- package/dist/logging.js +33 -0
- package/dist/logging.js.map +1 -0
- package/dist/namespaces.d.ts +96 -0
- package/dist/namespaces.js +50 -0
- package/dist/namespaces.js.map +1 -0
- package/dist/queue-adapter.d.ts +25 -0
- package/dist/queue-adapter.js +75 -0
- package/dist/queue-adapter.js.map +1 -0
- package/dist/queue-adapters/abstract-adapter.d.ts +5 -0
- package/dist/queue-adapters/abstract-adapter.js +12 -0
- package/dist/queue-adapters/abstract-adapter.js.map +1 -0
- package/dist/queue-adapters/async-adapter.d.ts +51 -0
- package/dist/queue-adapters/async-adapter.js +81 -0
- package/dist/queue-adapters/async-adapter.js.map +1 -0
- package/dist/queue-adapters/inline-adapter.d.ts +8 -0
- package/dist/queue-adapters/inline-adapter.js +14 -0
- package/dist/queue-adapters/inline-adapter.js.map +1 -0
- package/dist/queue-adapters/test-adapter.d.ts +38 -0
- package/dist/queue-adapters/test-adapter.js +98 -0
- package/dist/queue-adapters/test-adapter.js.map +1 -0
- package/dist/queue-adapters.d.ts +8 -0
- package/dist/queue-adapters.js +19 -0
- package/dist/queue-adapters.js.map +1 -0
- package/dist/queue-name.d.ts +27 -0
- package/dist/queue-name.js +43 -0
- package/dist/queue-name.js.map +1 -0
- package/dist/queue-priority.d.ts +20 -0
- package/dist/queue-priority.js +33 -0
- package/dist/queue-priority.js.map +1 -0
- package/dist/serializers/big-decimal-serializer.d.ts +9 -0
- package/dist/serializers/big-decimal-serializer.js +17 -0
- package/dist/serializers/big-decimal-serializer.js.map +1 -0
- package/dist/serializers/date-serializer.d.ts +10 -0
- package/dist/serializers/date-serializer.js +22 -0
- package/dist/serializers/date-serializer.js.map +1 -0
- package/dist/serializers/date-time-serializer.d.ts +8 -0
- package/dist/serializers/date-time-serializer.js +15 -0
- package/dist/serializers/date-time-serializer.js.map +1 -0
- package/dist/serializers/duration-serializer.d.ts +9 -0
- package/dist/serializers/duration-serializer.js +23 -0
- package/dist/serializers/duration-serializer.js.map +1 -0
- package/dist/serializers/module-serializer.d.ts +9 -0
- package/dist/serializers/module-serializer.js +20 -0
- package/dist/serializers/module-serializer.js.map +1 -0
- package/dist/serializers/object-serializer.d.ts +12 -0
- package/dist/serializers/object-serializer.js +35 -0
- package/dist/serializers/object-serializer.js.map +1 -0
- package/dist/serializers/range-serializer.d.ts +10 -0
- package/dist/serializers/range-serializer.js +19 -0
- package/dist/serializers/range-serializer.js.map +1 -0
- package/dist/serializers/symbol-serializer.d.ts +9 -0
- package/dist/serializers/symbol-serializer.js +17 -0
- package/dist/serializers/symbol-serializer.js.map +1 -0
- package/dist/serializers/time-object-serializer.d.ts +9 -0
- package/dist/serializers/time-object-serializer.js +15 -0
- package/dist/serializers/time-object-serializer.js.map +1 -0
- package/dist/serializers/time-serializer.d.ts +8 -0
- package/dist/serializers/time-serializer.js +15 -0
- package/dist/serializers/time-serializer.js.map +1 -0
- package/dist/serializers/time-with-zone-serializer.d.ts +11 -0
- package/dist/serializers/time-with-zone-serializer.js +23 -0
- package/dist/serializers/time-with-zone-serializer.js.map +1 -0
- package/dist/serializers.d.ts +7 -0
- package/dist/serializers.js +57 -0
- package/dist/serializers.js.map +1 -0
- package/dist/test-case.d.ts +8 -0
- package/dist/test-case.js +13 -0
- package/dist/test-case.js.map +1 -0
- package/dist/test-helper.d.ts +127 -0
- package/dist/test-helper.js +410 -0
- package/dist/test-helper.js.map +1 -0
- package/dist/timezones.d.ts +2 -0
- package/dist/timezones.js +10 -0
- package/dist/timezones.js.map +1 -0
- package/dist/translation.d.ts +2 -0
- package/dist/translation.js +11 -0
- package/dist/translation.js.map +1 -0
- package/dist/version.d.ts +3 -0
- package/dist/version.js +5 -0
- package/dist/version.js.map +1 -0
- package/package.json +55 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Dean Marano and Trails contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,44 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @blazetrails/activejob
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The port of Rails' `activejob` gem (`vendor/rails/v8.0.5.2/activejob/`).
|
|
4
|
+
|
|
5
|
+
## Constant names
|
|
6
|
+
|
|
7
|
+
Job data names classes by their Ruby constant path and resolves them again
|
|
8
|
+
with `constantize`: `Core#serialize` writes `"job_class" => self.class.name`
|
|
9
|
+
(`vendor/rails/v8.0.5.2/activejob/lib/active_job/core.rb:109`) and
|
|
10
|
+
`Core::ClassMethods#deserialize` reads it back with
|
|
11
|
+
`job_data["job_class"].constantize` (`:63`);
|
|
12
|
+
`ObjectSerializer#serialize` writes `"_aj_serialized" => self.class.name`
|
|
13
|
+
(`serializers/object_serializer.rb:40`) and `Serializers.deserialize` resolves
|
|
14
|
+
it with `safe_constantize` (`serializers.rb:43`).
|
|
15
|
+
|
|
16
|
+
A JS class's own `name` is only the last segment of that path, so ActiveJob
|
|
17
|
+
uses the repo's one constant mechanism, and nothing of its own. Today only
|
|
18
|
+
`ActiveJob::Base` is ported and seated. The rest of this section is the rule
|
|
19
|
+
each story that ports a file follows:
|
|
20
|
+
|
|
21
|
+
- **A framework class is seated by its defining module** with
|
|
22
|
+
`constSet(Owner, "Name", klass)` from `@blazetrails/ruby-compat`, on the
|
|
23
|
+
namespace object from `lib/namespaces.ts`, as `base.ts` does with
|
|
24
|
+
`constSet(ActiveJob, "Base", Base)`. A serializer is seated on
|
|
25
|
+
`Serializers`, an adapter on `QueueAdapters`, an error class on `ActiveJob`.
|
|
26
|
+
As Ruby's `const_set` does, the seat is also what names the class:
|
|
27
|
+
`ActiveJob::Base`.
|
|
28
|
+
- **`self.class.name` is ported as `rbModName(this.constructor)`**, Ruby's
|
|
29
|
+
`Module#name`. A call site does not read `constructor.name` itself:
|
|
30
|
+
`ActiveJob.adapter_name` `demodulize`s the full path (`queue_adapter.rb:11`).
|
|
31
|
+
`rbModName` answers the seated path, and for a class with no seat falls back
|
|
32
|
+
to the name its definition gave it, which then has no seat for `constantize`
|
|
33
|
+
to find.
|
|
34
|
+
- **`constantize` resolves the path** by walking the seats: `ActiveJob`, then
|
|
35
|
+
`Base`.
|
|
36
|
+
- **A job class defined outside the framework is registered under its Ruby
|
|
37
|
+
name** with `registerConstant("HelloJob", HelloJob)`, which seats it at the
|
|
38
|
+
top level and names it. A namespaced job is registered under its full path,
|
|
39
|
+
`registerConstant("Admin::HelloJob", HelloJob)`.
|
|
40
|
+
|
|
41
|
+
A job class that was never registered is an unloadable constant: `constantize`
|
|
42
|
+
raises `NameError` (`uninitialized constant HelloJob`).
|
|
43
|
+
`Core::ClassMethods#deserialize` has no rescue around its `constantize`
|
|
44
|
+
(`core.rb:63`), so its port must let that `NameError` propagate.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ActiveJob } from "./namespaces.js";
|
|
2
|
+
let _verboseEnqueueLogs;
|
|
3
|
+
export function verboseEnqueueLogs() {
|
|
4
|
+
return _verboseEnqueueLogs;
|
|
5
|
+
}
|
|
6
|
+
export function setVerboseEnqueueLogs(verboseEnqueueLogs) {
|
|
7
|
+
_verboseEnqueueLogs = verboseEnqueueLogs;
|
|
8
|
+
}
|
|
9
|
+
Object.assign(ActiveJob, { verboseEnqueueLogs, setVerboseEnqueueLogs });
|
|
10
|
+
setVerboseEnqueueLogs(false);
|
|
11
|
+
//# sourceMappingURL=active-job.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"active-job.js","sourceRoot":"","sources":["../lib/active-job.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,IAAI,mBAA4B,CAAC;AAEjC,MAAM,UAAU,kBAAkB;IAChC,OAAO,mBAAmB,CAAC;AAC7B,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,kBAA2B;IAC/D,mBAAmB,GAAG,kBAAkB,CAAC;AAC3C,CAAC;AAED,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,CAAC,CAAC;AACxE,qBAAqB,CAAC,KAAK,CAAC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ArgumentError, StandardError } from "@blazetrails/ruby-compat";
|
|
2
|
+
export declare class DeserializationError extends StandardError {
|
|
3
|
+
constructor(errinfo: unknown);
|
|
4
|
+
}
|
|
5
|
+
export declare class SerializationError extends ArgumentError {
|
|
6
|
+
constructor(message?: string);
|
|
7
|
+
}
|
|
8
|
+
type Enumerable = Iterable<unknown> | Record<string, unknown>;
|
|
9
|
+
/** @inventedArm entries — PERMANENT */
|
|
10
|
+
export declare function serialize(arguments_: Enumerable): unknown[];
|
|
11
|
+
/** @inventedArm entries — PERMANENT */
|
|
12
|
+
export declare function deserialize(arguments_: Enumerable): Promise<unknown[]>;
|
|
13
|
+
export declare const OBJECT_SERIALIZER_KEY = "_aj_serialized";
|
|
14
|
+
export declare const Arguments: {
|
|
15
|
+
serialize: typeof serialize;
|
|
16
|
+
deserialize: typeof deserialize;
|
|
17
|
+
OBJECT_SERIALIZER_KEY: string;
|
|
18
|
+
};
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=arguments.d.ts.map
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import { HashWithIndifferentAccess, transformKeys, withIndifferentAccess, } from "@blazetrails/activesupport";
|
|
2
|
+
import { ArgumentError, eachKey, eachPair, Exception, excBacktrace, excSetupMessage, excSetBacktrace, hashAref, hashAset, hasKey, hashDelete, Hash, rbCFloat, rbCInteger, rbCString, rbHashSRuby2KeywordsHash, rbHashSRuby2KeywordsHashP, rbInspect, rbModName, rbObjClass, rbObjIsKindOf, rbObjRespondTo, size, rtest, StandardError, isSymbol, stringToSym, symbolToS, toH, transformValues, } from "@blazetrails/ruby-compat";
|
|
3
|
+
import { GlobalID, Locator, MissingModelIdError } from "@blazetrails/globalid";
|
|
4
|
+
import { ActiveJob } from "./namespaces.js";
|
|
5
|
+
import { Serializers } from "./serializers.js";
|
|
6
|
+
export class DeserializationError extends StandardError {
|
|
7
|
+
constructor(errinfo) {
|
|
8
|
+
super(`Error while trying to deserialize arguments: ${errinfo.message}`, {
|
|
9
|
+
cause: errinfo,
|
|
10
|
+
});
|
|
11
|
+
this.name = "ActiveJob::DeserializationError";
|
|
12
|
+
excSetBacktrace(this, excBacktrace(errinfo));
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
ActiveJob.DeserializationError = DeserializationError;
|
|
16
|
+
export class SerializationError extends ArgumentError {
|
|
17
|
+
constructor(message) {
|
|
18
|
+
super(message);
|
|
19
|
+
this.name = "ActiveJob::SerializationError";
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
ActiveJob.SerializationError = SerializationError;
|
|
23
|
+
/** @inventedArm entries — PERMANENT */
|
|
24
|
+
export function serialize(arguments_) {
|
|
25
|
+
return Array.from(Symbol.iterator in Object(arguments_)
|
|
26
|
+
? arguments_
|
|
27
|
+
: Object.entries(arguments_), (argument) => serializeArgument(argument));
|
|
28
|
+
}
|
|
29
|
+
/** @inventedArm entries — PERMANENT */
|
|
30
|
+
export async function deserialize(arguments_) {
|
|
31
|
+
try {
|
|
32
|
+
return await Promise.all(Array.from(Symbol.iterator in Object(arguments_)
|
|
33
|
+
? arguments_
|
|
34
|
+
: Object.entries(arguments_), (argument) => deserializeArgument(argument)));
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
if (error instanceof Exception && !(error instanceof StandardError))
|
|
38
|
+
throw error;
|
|
39
|
+
throw new DeserializationError(error);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
const GLOBALID_KEY = "_aj_globalid";
|
|
43
|
+
const SYMBOL_KEYS_KEY = "_aj_symbol_keys";
|
|
44
|
+
const RUBY2_KEYWORDS_KEY = "_aj_ruby2_keywords";
|
|
45
|
+
const WITH_INDIFFERENT_ACCESS_KEY = "_aj_hash_with_indifferent_access";
|
|
46
|
+
export const OBJECT_SERIALIZER_KEY = "_aj_serialized";
|
|
47
|
+
const RESERVED_KEYS = [
|
|
48
|
+
GLOBALID_KEY,
|
|
49
|
+
stringToSym(GLOBALID_KEY),
|
|
50
|
+
SYMBOL_KEYS_KEY,
|
|
51
|
+
stringToSym(SYMBOL_KEYS_KEY),
|
|
52
|
+
RUBY2_KEYWORDS_KEY,
|
|
53
|
+
stringToSym(RUBY2_KEYWORDS_KEY),
|
|
54
|
+
OBJECT_SERIALIZER_KEY,
|
|
55
|
+
stringToSym(OBJECT_SERIALIZER_KEY),
|
|
56
|
+
WITH_INDIFFERENT_ACCESS_KEY,
|
|
57
|
+
stringToSym(WITH_INDIFFERENT_ACCESS_KEY),
|
|
58
|
+
];
|
|
59
|
+
/** @internal */
|
|
60
|
+
function serializeArgument(argument) {
|
|
61
|
+
if (argument == null ||
|
|
62
|
+
argument === true ||
|
|
63
|
+
argument === false ||
|
|
64
|
+
rbObjIsKindOf(argument, rbCInteger) ||
|
|
65
|
+
rbObjIsKindOf(argument, rbCFloat)) {
|
|
66
|
+
return argument;
|
|
67
|
+
}
|
|
68
|
+
else if (rbObjIsKindOf(argument, rbCString)) {
|
|
69
|
+
if (rbObjClass(argument) === rbCString) {
|
|
70
|
+
return argument;
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
try {
|
|
74
|
+
return Serializers.serialize(argument);
|
|
75
|
+
}
|
|
76
|
+
catch (error) {
|
|
77
|
+
if (!(error instanceof SerializationError))
|
|
78
|
+
throw error;
|
|
79
|
+
return argument;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
else if (rbObjIsKindOf(argument, GlobalID.Identification)) {
|
|
84
|
+
return convertToGlobalIdHash(argument);
|
|
85
|
+
}
|
|
86
|
+
else if (Array.isArray(argument)) {
|
|
87
|
+
return argument.map((arg) => serializeArgument(arg));
|
|
88
|
+
}
|
|
89
|
+
else if (argument instanceof HashWithIndifferentAccess) {
|
|
90
|
+
return serializeIndifferentHash(argument);
|
|
91
|
+
}
|
|
92
|
+
else if (rbObjIsKindOf(argument, Hash)) {
|
|
93
|
+
const symbolKeys = eachKey(argument)
|
|
94
|
+
.filter((key) => isSymbol(key))
|
|
95
|
+
.map((key) => symbolToS(key));
|
|
96
|
+
const ajHashKey = rbHashSRuby2KeywordsHashP(argument) ? RUBY2_KEYWORDS_KEY : SYMBOL_KEYS_KEY;
|
|
97
|
+
const result = serializeHash(argument);
|
|
98
|
+
result[ajHashKey] = symbolKeys;
|
|
99
|
+
return result;
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
if (rbObjRespondTo(argument, "isPermitted") && rbObjRespondTo(argument, "toH")) {
|
|
103
|
+
return serializeIndifferentHash(argument.toH());
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
return Serializers.serialize(argument);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
/** @internal */
|
|
111
|
+
async function deserializeArgument(argument) {
|
|
112
|
+
if (argument == null ||
|
|
113
|
+
argument === true ||
|
|
114
|
+
argument === false ||
|
|
115
|
+
rbObjIsKindOf(argument, rbCString) ||
|
|
116
|
+
rbObjIsKindOf(argument, rbCInteger) ||
|
|
117
|
+
rbObjIsKindOf(argument, rbCFloat)) {
|
|
118
|
+
return argument;
|
|
119
|
+
}
|
|
120
|
+
else if (Array.isArray(argument)) {
|
|
121
|
+
return Promise.all(argument.map((arg) => deserializeArgument(arg)));
|
|
122
|
+
}
|
|
123
|
+
else if (rbObjIsKindOf(argument, Hash)) {
|
|
124
|
+
if (isSerializedGlobalId(argument)) {
|
|
125
|
+
return deserializeGlobalId(argument);
|
|
126
|
+
}
|
|
127
|
+
else if (isCustomSerialized(argument)) {
|
|
128
|
+
return Serializers.deserialize(argument);
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
return deserializeHash(argument);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
throw new ArgumentError(`Can only deserialize primitive arguments: ${rbInspect(argument)}`);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
/** @internal */
|
|
139
|
+
function isSerializedGlobalId(hash) {
|
|
140
|
+
return size(hash) === 1 && hasKey(hash, GLOBALID_KEY);
|
|
141
|
+
}
|
|
142
|
+
/** @internal */
|
|
143
|
+
function deserializeGlobalId(hash) {
|
|
144
|
+
return Locator.locate(hashAref(hash, GLOBALID_KEY));
|
|
145
|
+
}
|
|
146
|
+
/** @internal */
|
|
147
|
+
function isCustomSerialized(hash) {
|
|
148
|
+
return hasKey(hash, OBJECT_SERIALIZER_KEY);
|
|
149
|
+
}
|
|
150
|
+
/** @internal */
|
|
151
|
+
function serializeHash(argument) {
|
|
152
|
+
const hash = {};
|
|
153
|
+
eachPair(argument, (key, value) => {
|
|
154
|
+
hashAset(hash, serializeHashKey(key), serializeArgument(value));
|
|
155
|
+
});
|
|
156
|
+
return hash;
|
|
157
|
+
}
|
|
158
|
+
/** @internal */
|
|
159
|
+
async function deserializeHash(serializedHash) {
|
|
160
|
+
let result = transformValues(serializedHash, (v) => deserializeArgument(v));
|
|
161
|
+
for (const key of eachKey(result))
|
|
162
|
+
hashAset(result, key, await hashAref(result, key));
|
|
163
|
+
let symbolKeys;
|
|
164
|
+
if (rtest(hashDelete(result, WITH_INDIFFERENT_ACCESS_KEY))) {
|
|
165
|
+
result = withIndifferentAccess(result);
|
|
166
|
+
}
|
|
167
|
+
else if (rtest((symbolKeys = hashDelete(result, SYMBOL_KEYS_KEY)))) {
|
|
168
|
+
result = transformSymbolKeys(result, symbolKeys);
|
|
169
|
+
}
|
|
170
|
+
else if (rtest((symbolKeys = hashDelete(result, RUBY2_KEYWORDS_KEY)))) {
|
|
171
|
+
result = transformSymbolKeys(result, symbolKeys);
|
|
172
|
+
result = rbHashSRuby2KeywordsHash(result);
|
|
173
|
+
}
|
|
174
|
+
return result;
|
|
175
|
+
}
|
|
176
|
+
/** @internal */
|
|
177
|
+
function serializeHashKey(key) {
|
|
178
|
+
if (RESERVED_KEYS.includes(key)) {
|
|
179
|
+
throw new SerializationError(`Can't serialize a Hash with reserved key ${rbInspect(key)}`);
|
|
180
|
+
}
|
|
181
|
+
else if (typeof key === "string") {
|
|
182
|
+
return isSymbol(key) ? symbolToS(key) : key;
|
|
183
|
+
}
|
|
184
|
+
else {
|
|
185
|
+
throw new SerializationError(`Only string and symbol hash keys may be serialized as job arguments, but ${rbInspect(key)} is a ${rbModName(rbObjClass(key))}`);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
/** @internal */
|
|
189
|
+
function serializeIndifferentHash(indifferentHash) {
|
|
190
|
+
const result = serializeHash(indifferentHash);
|
|
191
|
+
result[WITH_INDIFFERENT_ACCESS_KEY] = serializeArgument(true);
|
|
192
|
+
return result;
|
|
193
|
+
}
|
|
194
|
+
/** @internal */
|
|
195
|
+
function transformSymbolKeys(hash, symbolKeys) {
|
|
196
|
+
return transformKeys(toH(hash), (key) => {
|
|
197
|
+
if (symbolKeys.includes(key)) {
|
|
198
|
+
return stringToSym(key);
|
|
199
|
+
}
|
|
200
|
+
else {
|
|
201
|
+
return key;
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
/** @internal */
|
|
206
|
+
function convertToGlobalIdHash(argument) {
|
|
207
|
+
try {
|
|
208
|
+
return {
|
|
209
|
+
[GLOBALID_KEY]: argument
|
|
210
|
+
.toGlobalId()
|
|
211
|
+
.toString(),
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
catch (error) {
|
|
215
|
+
if (!(error instanceof MissingModelIdError))
|
|
216
|
+
throw error;
|
|
217
|
+
throw excSetupMessage(new SerializationError(`Unable to serialize ${rbModName(rbObjClass(argument))} without an id. (Maybe you forgot to call save?)`), error);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
export const Arguments = { serialize, deserialize, OBJECT_SERIALIZER_KEY };
|
|
221
|
+
ActiveJob.Arguments = Arguments;
|
|
222
|
+
//# sourceMappingURL=arguments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arguments.js","sourceRoot":"","sources":["../lib/arguments.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,aAAa,EACb,qBAAqB,GACtB,MAAM,4BAA4B,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S,EAAE,WAAW,EAAE,qBAAqB,EAAE,CAAC;AAC3E,SAAS,CAAC,SAAS,GAAG,SAAS,CAAC"}
|
package/dist/base.d.ts
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Callbacks as ASCallbacks, type Included, type Logger, Rescuable } from "@blazetrails/activesupport";
|
|
2
|
+
import { ClassMethods as CallbacksClassMethods } from "./callbacks.js";
|
|
3
|
+
import { ClassMethods, Core } from "./core.js";
|
|
4
|
+
import { Enqueuing, ClassMethods as EnqueuingClassMethods } from "./enqueuing.js";
|
|
5
|
+
import { ClassMethods as ExceptionsClassMethods, Exceptions } from "./exceptions.js";
|
|
6
|
+
import { ClassMethods as ExecutionClassMethods, Execution } from "./execution.js";
|
|
7
|
+
import "./configured-job.js";
|
|
8
|
+
import { Instrumentation } from "./instrumentation.js";
|
|
9
|
+
import "./log-subscriber.js";
|
|
10
|
+
import { ClassMethods as QueueAdapterClassMethods, QueueAdapter } from "./queue-adapter.js";
|
|
11
|
+
import "./queue-adapters.js";
|
|
12
|
+
import { ClassMethods as QueueNameClassMethods } from "./queue-name.js";
|
|
13
|
+
import { ClassMethods as QueuePriorityClassMethods } from "./queue-priority.js";
|
|
14
|
+
export interface Base extends Core, QueueAdapter, Enqueuing, Execution, Exceptions, Rescuable, Included<typeof ASCallbacks>, Pick<Included<typeof Instrumentation>, "instrument"> {
|
|
15
|
+
get logger(): Logger | null;
|
|
16
|
+
set logger(logger: Logger | null);
|
|
17
|
+
}
|
|
18
|
+
export declare class Base {
|
|
19
|
+
static deserialize: typeof ClassMethods.deserialize;
|
|
20
|
+
static set: typeof ClassMethods.set;
|
|
21
|
+
static queueAdapter: unknown;
|
|
22
|
+
static queueAdapterName: string;
|
|
23
|
+
static _queueAdapterName: string | null;
|
|
24
|
+
static _queueAdapter: unknown;
|
|
25
|
+
/** @internal */
|
|
26
|
+
static assignAdapter: typeof QueueAdapterClassMethods.assignAdapter;
|
|
27
|
+
/** @internal */
|
|
28
|
+
static isQueueAdapter: typeof QueueAdapterClassMethods.isQueueAdapter;
|
|
29
|
+
static defaultQueueName: unknown;
|
|
30
|
+
static setCallback: typeof ASCallbacks.ClassMethods.setCallback;
|
|
31
|
+
static beforePerform: typeof CallbacksClassMethods.beforePerform;
|
|
32
|
+
static afterPerform: typeof CallbacksClassMethods.afterPerform;
|
|
33
|
+
static aroundPerform: typeof CallbacksClassMethods.aroundPerform;
|
|
34
|
+
static beforeEnqueue: typeof CallbacksClassMethods.beforeEnqueue;
|
|
35
|
+
static afterEnqueue: typeof CallbacksClassMethods.afterEnqueue;
|
|
36
|
+
static aroundEnqueue: typeof CallbacksClassMethods.aroundEnqueue;
|
|
37
|
+
static queueAs: typeof QueueNameClassMethods.queueAs;
|
|
38
|
+
static queueNameFromPart: typeof QueueNameClassMethods.queueNameFromPart;
|
|
39
|
+
static queueName: unknown;
|
|
40
|
+
static queueNameDelimiter: string;
|
|
41
|
+
static isQueueNameDelimiter: boolean;
|
|
42
|
+
static queueNamePrefix: unknown;
|
|
43
|
+
static defaultPriority: unknown;
|
|
44
|
+
static queueWithPriority: typeof QueuePriorityClassMethods.queueWithPriority;
|
|
45
|
+
static priority: unknown;
|
|
46
|
+
static enqueueAfterTransactionCommit: boolean | string;
|
|
47
|
+
static performLater: typeof EnqueuingClassMethods.performLater;
|
|
48
|
+
static jobOrInstantiate: typeof EnqueuingClassMethods.jobOrInstantiate;
|
|
49
|
+
static performNow: typeof ExecutionClassMethods.performNow;
|
|
50
|
+
static execute: typeof ExecutionClassMethods.execute;
|
|
51
|
+
static rescueFrom: typeof Rescuable.ClassMethods.rescueFrom;
|
|
52
|
+
static afterDiscardProcs: Exceptions["afterDiscardProcs"];
|
|
53
|
+
static isAfterDiscardProcs: boolean;
|
|
54
|
+
static retryJitter: number;
|
|
55
|
+
static retryOn: typeof ExceptionsClassMethods.retryOn;
|
|
56
|
+
static discardOn: typeof ExceptionsClassMethods.discardOn;
|
|
57
|
+
static afterDiscard: typeof ExceptionsClassMethods.afterDiscard;
|
|
58
|
+
static logger: Logger | null;
|
|
59
|
+
static logArguments: boolean;
|
|
60
|
+
static isLogArguments: boolean;
|
|
61
|
+
static rescueHandlers: unknown[][];
|
|
62
|
+
/**
|
|
63
|
+
* @inventedArm if — PERMANENT
|
|
64
|
+
* @inventedArm getPrototypeOf — PERMANENT
|
|
65
|
+
* @inventedArm throw — PERMANENT
|
|
66
|
+
* @inlinedFrom ActiveJob::Core#initialize rails/v8.0.5.2/activejob/lib/active_job/core.rb:93-102
|
|
67
|
+
*/
|
|
68
|
+
constructor(...arguments_: unknown[]);
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=base.d.ts.map
|
package/dist/base.js
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { runLoadHooks, zone, } from "@blazetrails/activesupport";
|
|
2
|
+
import { extend, Hash, include, isModuleIncluded, NoMethodError, rbHashSRuby2KeywordsHash, rbObjClass, rbObjIsKindOf, SecureRandom, TopLevel, } from "@blazetrails/ruby-compat";
|
|
3
|
+
import { Callbacks } from "./callbacks.js";
|
|
4
|
+
import { ClassMethods, Core } from "./core.js";
|
|
5
|
+
import { Enqueuing } from "./enqueuing.js";
|
|
6
|
+
import { Exceptions } from "./exceptions.js";
|
|
7
|
+
import { Execution } from "./execution.js";
|
|
8
|
+
import "./configured-job.js";
|
|
9
|
+
import { Instrumentation } from "./instrumentation.js";
|
|
10
|
+
import "./log-subscriber.js";
|
|
11
|
+
import { Logging } from "./logging.js";
|
|
12
|
+
import { ActiveJob } from "./namespaces.js";
|
|
13
|
+
import { QueueAdapter } from "./queue-adapter.js";
|
|
14
|
+
import "./queue-adapters.js";
|
|
15
|
+
import { QueueName } from "./queue-name.js";
|
|
16
|
+
import { QueuePriority } from "./queue-priority.js";
|
|
17
|
+
import { Timezones } from "./timezones.js";
|
|
18
|
+
import { Translation } from "./translation.js";
|
|
19
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging
|
|
20
|
+
export class Base {
|
|
21
|
+
/**
|
|
22
|
+
* @inventedArm if — PERMANENT
|
|
23
|
+
* @inventedArm getPrototypeOf — PERMANENT
|
|
24
|
+
* @inventedArm throw — PERMANENT
|
|
25
|
+
* @inlinedFrom ActiveJob::Core#initialize rails/v8.0.5.2/activejob/lib/active_job/core.rb:93-102
|
|
26
|
+
*/
|
|
27
|
+
constructor(...arguments_) {
|
|
28
|
+
const last = arguments_[arguments_.length - 1];
|
|
29
|
+
if (typeof last === "object" &&
|
|
30
|
+
last !== null &&
|
|
31
|
+
Object.getPrototypeOf(last) === Object.prototype &&
|
|
32
|
+
rbObjIsKindOf(last, Hash)) {
|
|
33
|
+
arguments_[arguments_.length - 1] = rbHashSRuby2KeywordsHash(last);
|
|
34
|
+
}
|
|
35
|
+
const klass = rbObjClass(this);
|
|
36
|
+
this._arguments = arguments_;
|
|
37
|
+
this.jobId = SecureRandom.uuid();
|
|
38
|
+
this.queueName = klass.queueName;
|
|
39
|
+
this.scheduledAt = null;
|
|
40
|
+
this.priority = klass.priority;
|
|
41
|
+
this.executions = 0;
|
|
42
|
+
this.exceptionExecutions = {};
|
|
43
|
+
const timeZone = zone();
|
|
44
|
+
if (timeZone === false)
|
|
45
|
+
throw new NoMethodError("undefined method `name' for false", "name");
|
|
46
|
+
this.timezone = timeZone?.name ?? null;
|
|
47
|
+
/** @inventedArm if — PERMANENT */
|
|
48
|
+
if (isModuleIncluded(new.target, ActiveJob.BatchId)) {
|
|
49
|
+
const host = this;
|
|
50
|
+
if (host.isSolidQueueJob()) {
|
|
51
|
+
host.batchId = TopLevel.SolidQueue.Batch.currentBatchId();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
include(Base, Core);
|
|
57
|
+
include(Base, QueueAdapter);
|
|
58
|
+
include(Base, QueueName);
|
|
59
|
+
include(Base, QueuePriority);
|
|
60
|
+
extend(Base, ClassMethods);
|
|
61
|
+
include(Base, Enqueuing);
|
|
62
|
+
include(Base, Execution);
|
|
63
|
+
include(Base, Callbacks);
|
|
64
|
+
include(Base, Exceptions);
|
|
65
|
+
include(Base, Instrumentation);
|
|
66
|
+
include(Base, Logging);
|
|
67
|
+
include(Base, Timezones);
|
|
68
|
+
include(Base, Translation);
|
|
69
|
+
ActiveJob.Base = Base;
|
|
70
|
+
runLoadHooks("active_job", Base);
|
|
71
|
+
//# sourceMappingURL=base.js.map
|
package/dist/base.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.js","sourceRoot":"","sources":["../lib/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,YAAY,EACZ,IAAI,GACL,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,MAAM,EACN,IAAI,EACJ,OAAO,EACP,gBAAgB,EAChB,aAAa,EACb,wBAAwB,EACxB,UAAU,EACV,aAAa,EACb,YAAY,EACZ,QAAQ,GACT,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,SAAS,EAAyC,MAAM,gBAAgB,CAAC;AAClF,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAyC,MAAM,gBAAgB,CAAC;AAClF,OAAO,EAA0C,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACrF,OAAO,EAAyC,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAClF,OAAO,qBAAqB,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,qBAAqB,CAAC;AAC7B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAA4C,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC5F,OAAO,qBAAqB,CAAC;AAC7B,OAAO,EAAyC,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACnF,OAAO,EAA6C,aAAa,EAAE,MAAM,qBAA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CAAC,OAAgB,CAAC,EAAE,CAAC;YAC7D,MAAM,IAAI,GAAG,IAAgE,CAAC;YAC9E,IAAI,IAAI,CAAC,eAAe,EAAE,EAAE,CAAC;gBAC3B,IAAI,CAAC,OAAO,GACV,QACD,CAAC,UAAW,CAAC,KAAK,CAAC,cAAc,EAAE,CAAC;YACvC,CAAC;QACH,CAAC;IACH,CAAC;CACF;AACD,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AACpB,OAAO,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;AAC5B,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;AACzB,OAAO,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;AAC7B,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;AAC3B,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;AACzB,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;AACzB,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;AACzB,OAAO,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;AAC1B,OAAO,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;AAC/B,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACvB,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;AACzB,OAAO,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;AAC3B,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC;AAEtB,YAAY,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type FilterListEntry } from "@blazetrails/activesupport";
|
|
2
|
+
interface CallbacksClassMethodsHost {
|
|
3
|
+
setCallback(name: string, ...filterList: FilterListEntry[]): void;
|
|
4
|
+
}
|
|
5
|
+
export declare class ClassMethods {
|
|
6
|
+
static beforePerform(this: CallbacksClassMethodsHost, ...filters: FilterListEntry[]): void;
|
|
7
|
+
static afterPerform(this: CallbacksClassMethodsHost, ...filters: FilterListEntry[]): void;
|
|
8
|
+
static aroundPerform(this: CallbacksClassMethodsHost, ...filters: FilterListEntry[]): void;
|
|
9
|
+
static beforeEnqueue(this: CallbacksClassMethodsHost, ...filters: FilterListEntry[]): void;
|
|
10
|
+
static afterEnqueue(this: CallbacksClassMethodsHost, ...filters: FilterListEntry[]): void;
|
|
11
|
+
static aroundEnqueue(this: CallbacksClassMethodsHost, ...filters: FilterListEntry[]): void;
|
|
12
|
+
}
|
|
13
|
+
export declare const Callbacks: {
|
|
14
|
+
runCallbacks(kind: string, block?: () => unknown): unknown;
|
|
15
|
+
};
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=callbacks.d.ts.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Callbacks as ASCallbacks, Concern, extend, } from "@blazetrails/activesupport";
|
|
2
|
+
import { defineModule, include, rbObjSingletonClass } from "@blazetrails/ruby-compat";
|
|
3
|
+
import { ActiveJob } from "./namespaces.js";
|
|
4
|
+
export class ClassMethods {
|
|
5
|
+
static beforePerform(...filters) {
|
|
6
|
+
this.setCallback("perform", "before", ...filters);
|
|
7
|
+
}
|
|
8
|
+
static afterPerform(...filters) {
|
|
9
|
+
this.setCallback("perform", "after", ...filters);
|
|
10
|
+
}
|
|
11
|
+
static aroundPerform(...filters) {
|
|
12
|
+
this.setCallback("perform", "around", ...filters);
|
|
13
|
+
}
|
|
14
|
+
static beforeEnqueue(...filters) {
|
|
15
|
+
this.setCallback("enqueue", "before", ...filters);
|
|
16
|
+
}
|
|
17
|
+
static afterEnqueue(...filters) {
|
|
18
|
+
this.setCallback("enqueue", "after", ...filters);
|
|
19
|
+
}
|
|
20
|
+
static aroundEnqueue(...filters) {
|
|
21
|
+
this.setCallback("enqueue", "around", ...filters);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export const Callbacks = defineModule({});
|
|
25
|
+
extend(Callbacks, Concern);
|
|
26
|
+
include(Callbacks, ASCallbacks);
|
|
27
|
+
Object.defineProperty(Callbacks, "ClassMethods", { value: ClassMethods });
|
|
28
|
+
include(rbObjSingletonClass(Callbacks), ASCallbacks);
|
|
29
|
+
rbObjSingletonClass(Callbacks).defineCallbacks("execute");
|
|
30
|
+
Concern.included.call(Callbacks, null, function () {
|
|
31
|
+
this.defineCallbacks("perform", { skipAfterCallbacksIfTerminated: true });
|
|
32
|
+
this.defineCallbacks("enqueue", { skipAfterCallbacksIfTerminated: true });
|
|
33
|
+
});
|
|
34
|
+
ActiveJob.Callbacks = Callbacks;
|
|
35
|
+
//# sourceMappingURL=callbacks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"callbacks.js","sourceRoot":"","sources":["../lib/callbacks.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,IAAI,WAAW,EACxB,OAAO,EACP,MAAM,GAEP,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACtF,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAU5C,MAAM,OAAO,YAAY;IACvB,MAAM,CAAC,aAAa,CAAkC,GAAG,OAA0B;QACjF,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,CAAC;IACpD,CAAC;IAED,MAAM,CAAC,YAAY,CAAkC,GAAG,OAA0B;QAChF,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,CAAC;IACnD,CAAC;IAED,MAAM,CAAC,aAAa,CAAkC,GAAG,OAA0B;QACjF,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,CAAC;IACpD,CAAC;IAED,MAAM,CAAC,aAAa,CAAkC,GAAG,OAA0B;QACjF,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,CAAC;IACpD,CAAC;IAED,MAAM,CAAC,YAAY,CAAkC,GAAG,OAA0B;QAChF,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,CAAC;IACnD,CAAC;IAED,MAAM,CAAC,aAAa,CAAkC,GAAG,OAA0B;QACjF,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,CAAC;IACpD,CAAC;CACF;AAED,MAAM,CAAC,MAAM,SAAS,GAAG,YAAY,CAAC,EAAE,CAEvC,CAAC;AACF,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AAC3B,OAAO,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;AAChC,MAAM,CAAC,cAAc,CAAC,SAAS,EAAE,cAAc,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,CAAC;AAE1E,OAAO,CAAC,mBAAmB,CAAC,SAAS,CAAC,EAAE,WAAW,CAAC,CAAC;AACpD,mBAAmB,CAAC,SAAS,CAA+B,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;AAEzF,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE;IACrC,IAAI,CAAC,eAAe,CAAC,SAAS,EAAE,EAAE,8BAA8B,EAAE,IAAI,EAAE,CAAC,CAAC;IAC1E,IAAI,CAAC,eAAe,CAAC,SAAS,EAAE,EAAE,8BAA8B,EAAE,IAAI,EAAE,CAAC,CAAC;AAC5E,CAAC,CAAC,CAAC;AAEH,SAAS,CAAC,SAAS,GAAG,SAAS,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare class ConfiguredJob {
|
|
2
|
+
private _options;
|
|
3
|
+
private _jobClass;
|
|
4
|
+
constructor(jobClass: unknown, options?: Record<string, unknown>);
|
|
5
|
+
performNow(...args: unknown[]): Promise<unknown>;
|
|
6
|
+
performLater(...args: unknown[]): Promise<unknown>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=configured-job.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ActiveJob } from "./namespaces.js";
|
|
2
|
+
export class ConfiguredJob {
|
|
3
|
+
_options;
|
|
4
|
+
_jobClass;
|
|
5
|
+
constructor(jobClass, options = {}) {
|
|
6
|
+
this._options = options;
|
|
7
|
+
this._jobClass = jobClass;
|
|
8
|
+
}
|
|
9
|
+
async performNow(...args) {
|
|
10
|
+
return await new this._jobClass(...args).set(this._options).performNow();
|
|
11
|
+
}
|
|
12
|
+
async performLater(...args) {
|
|
13
|
+
return await new this._jobClass(...args).enqueue(this._options);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
ActiveJob.ConfiguredJob = ConfiguredJob;
|
|
17
|
+
//# sourceMappingURL=configured-job.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configured-job.js","sourceRoot":"","sources":["../lib/configured-job.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAS5C,MAAM,OAAO,aAAa;IAChB,QAAQ,CAA0B;IAClC,SAAS,CAAqB;IAEtC,YAAY,QAAiB,EAAE,OAAO,GAA4B,EAAE;QAClE,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,SAAS,GAAG,QAA8B,CAAC;IAClD,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,GAAG,IAAe;QACjC,OAAO,MAAM,IAAI,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,UAAU,EAAE,CAAC;IAC3E,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,GAAG,IAAe;QACnC,OAAO,MAAM,IAAI,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAClE,CAAC;CACF;AACD,SAAS,CAAC,aAAa,GAAG,aAAa,CAAC"}
|