@wrelik/jobs 0.1.0 → 0.1.2
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/.turbo/turbo-build.log +23 -0
- package/CHANGELOG.md +12 -0
- package/dist/index.d.mts +30 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.js +53 -0
- package/dist/index.mjs +25 -0
- package/dist/unsupported.d.mts +2 -0
- package/dist/unsupported.d.ts +2 -0
- package/dist/unsupported.js +6 -0
- package/dist/unsupported.mjs +4 -0
- package/package.json +13 -4
- package/src/index.ts +6 -2
- package/src/unsupported.ts +4 -0
- package/tsconfig.json +1 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
|
|
2
|
+
> @wrelik/jobs@0.1.2 build /home/runner/work/wrelik-kit/wrelik-kit/packages/jobs
|
|
3
|
+
> tsup src/index.ts src/unsupported.ts --format cjs,esm --dts --clean
|
|
4
|
+
|
|
5
|
+
[34mCLI[39m Building entry: src/index.ts, src/unsupported.ts
|
|
6
|
+
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
7
|
+
[34mCLI[39m tsup v8.5.1
|
|
8
|
+
[34mCLI[39m Target: es2022
|
|
9
|
+
[34mCLI[39m Cleaning output folder
|
|
10
|
+
[34mCJS[39m Build start
|
|
11
|
+
[34mESM[39m Build start
|
|
12
|
+
[32mCJS[39m [1mdist/index.js [22m[32m1.60 KB[39m
|
|
13
|
+
[32mCJS[39m [1mdist/unsupported.js [22m[32m192.00 B[39m
|
|
14
|
+
[32mCJS[39m ⚡️ Build success in 54ms
|
|
15
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m537.00 B[39m
|
|
16
|
+
[32mESM[39m [1mdist/unsupported.mjs [22m[32m177.00 B[39m
|
|
17
|
+
[32mESM[39m ⚡️ Build success in 51ms
|
|
18
|
+
[34mDTS[39m Build start
|
|
19
|
+
[32mDTS[39m ⚡️ Build success in 2292ms
|
|
20
|
+
[32mDTS[39m [1mdist/unsupported.d.ts [22m[32m13.00 B[39m
|
|
21
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m1.18 KB[39m
|
|
22
|
+
[32mDTS[39m [1mdist/unsupported.d.mts [22m[32m13.00 B[39m
|
|
23
|
+
[32mDTS[39m [1mdist/index.d.mts [22m[32m1.18 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @wrelik/jobs
|
|
2
2
|
|
|
3
|
+
## 0.1.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- a38ebcb: Add React Native / Expo support and enforce server-only boundaries.
|
|
8
|
+
|
|
9
|
+
## 0.1.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Update publishConfig to access:public for all packages.
|
|
14
|
+
|
|
3
15
|
## 0.1.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as inngest_types from 'inngest/types';
|
|
2
|
+
import * as inngest from 'inngest';
|
|
3
|
+
import { Inngest } from 'inngest';
|
|
4
|
+
|
|
5
|
+
declare let client: Inngest;
|
|
6
|
+
declare function initJobs(appId: string): void;
|
|
7
|
+
declare function emit(eventName: string, payload: any): Promise<inngest_types.SendEventOutput<inngest.ClientOptions>>;
|
|
8
|
+
declare function createFunction(name: string, trigger: {
|
|
9
|
+
event: string;
|
|
10
|
+
} | {
|
|
11
|
+
cron: string;
|
|
12
|
+
}, handler: (args: any) => Promise<any>): inngest.InngestFunction<Omit<inngest.InngestFunction.Options<Inngest<inngest.ClientOptions>, inngest.InngestMiddleware.Stack, [{
|
|
13
|
+
event: string;
|
|
14
|
+
}] | [{
|
|
15
|
+
cron: string;
|
|
16
|
+
}], inngest.Handler<Inngest<inngest.ClientOptions>, string, {
|
|
17
|
+
event: inngest.FailureEventPayload<inngest.EventPayload<any>>;
|
|
18
|
+
logger: inngest.Logger;
|
|
19
|
+
error: Error;
|
|
20
|
+
}>>, "triggers">, (args: any) => Promise<any>, inngest.Handler<Inngest<inngest.ClientOptions>, string, {
|
|
21
|
+
event: inngest.FailureEventPayload<inngest.EventPayload<any>>;
|
|
22
|
+
logger: inngest.Logger;
|
|
23
|
+
error: Error;
|
|
24
|
+
}>, Inngest<inngest.ClientOptions>, inngest.InngestMiddleware.Stack, [{
|
|
25
|
+
event: string;
|
|
26
|
+
}] | [{
|
|
27
|
+
cron: string;
|
|
28
|
+
}]>;
|
|
29
|
+
|
|
30
|
+
export { createFunction, emit, initJobs, client as inngest };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as inngest_types from 'inngest/types';
|
|
2
|
+
import * as inngest from 'inngest';
|
|
3
|
+
import { Inngest } from 'inngest';
|
|
4
|
+
|
|
5
|
+
declare let client: Inngest;
|
|
6
|
+
declare function initJobs(appId: string): void;
|
|
7
|
+
declare function emit(eventName: string, payload: any): Promise<inngest_types.SendEventOutput<inngest.ClientOptions>>;
|
|
8
|
+
declare function createFunction(name: string, trigger: {
|
|
9
|
+
event: string;
|
|
10
|
+
} | {
|
|
11
|
+
cron: string;
|
|
12
|
+
}, handler: (args: any) => Promise<any>): inngest.InngestFunction<Omit<inngest.InngestFunction.Options<Inngest<inngest.ClientOptions>, inngest.InngestMiddleware.Stack, [{
|
|
13
|
+
event: string;
|
|
14
|
+
}] | [{
|
|
15
|
+
cron: string;
|
|
16
|
+
}], inngest.Handler<Inngest<inngest.ClientOptions>, string, {
|
|
17
|
+
event: inngest.FailureEventPayload<inngest.EventPayload<any>>;
|
|
18
|
+
logger: inngest.Logger;
|
|
19
|
+
error: Error;
|
|
20
|
+
}>>, "triggers">, (args: any) => Promise<any>, inngest.Handler<Inngest<inngest.ClientOptions>, string, {
|
|
21
|
+
event: inngest.FailureEventPayload<inngest.EventPayload<any>>;
|
|
22
|
+
logger: inngest.Logger;
|
|
23
|
+
error: Error;
|
|
24
|
+
}>, Inngest<inngest.ClientOptions>, inngest.InngestMiddleware.Stack, [{
|
|
25
|
+
event: string;
|
|
26
|
+
}] | [{
|
|
27
|
+
cron: string;
|
|
28
|
+
}]>;
|
|
29
|
+
|
|
30
|
+
export { createFunction, emit, initJobs, client as inngest };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
createFunction: () => createFunction,
|
|
24
|
+
emit: () => emit,
|
|
25
|
+
initJobs: () => initJobs,
|
|
26
|
+
inngest: () => client
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(index_exports);
|
|
29
|
+
var import_inngest = require("inngest");
|
|
30
|
+
var client;
|
|
31
|
+
function initJobs(appId) {
|
|
32
|
+
client = new import_inngest.Inngest({ id: appId });
|
|
33
|
+
}
|
|
34
|
+
function getClient() {
|
|
35
|
+
if (!client) throw new Error("Jobs not initialized");
|
|
36
|
+
return client;
|
|
37
|
+
}
|
|
38
|
+
async function emit(eventName, payload) {
|
|
39
|
+
return getClient().send({
|
|
40
|
+
name: eventName,
|
|
41
|
+
data: payload
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
function createFunction(name, trigger, handler) {
|
|
45
|
+
return getClient().createFunction({ id: name }, trigger, handler);
|
|
46
|
+
}
|
|
47
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
48
|
+
0 && (module.exports = {
|
|
49
|
+
createFunction,
|
|
50
|
+
emit,
|
|
51
|
+
initJobs,
|
|
52
|
+
inngest
|
|
53
|
+
});
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// src/index.ts
|
|
2
|
+
import { Inngest } from "inngest";
|
|
3
|
+
var client;
|
|
4
|
+
function initJobs(appId) {
|
|
5
|
+
client = new Inngest({ id: appId });
|
|
6
|
+
}
|
|
7
|
+
function getClient() {
|
|
8
|
+
if (!client) throw new Error("Jobs not initialized");
|
|
9
|
+
return client;
|
|
10
|
+
}
|
|
11
|
+
async function emit(eventName, payload) {
|
|
12
|
+
return getClient().send({
|
|
13
|
+
name: eventName,
|
|
14
|
+
data: payload
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
function createFunction(name, trigger, handler) {
|
|
18
|
+
return getClient().createFunction({ id: name }, trigger, handler);
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
createFunction,
|
|
22
|
+
emit,
|
|
23
|
+
initJobs,
|
|
24
|
+
client as inngest
|
|
25
|
+
};
|
package/package.json
CHANGED
|
@@ -1,19 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wrelik/jobs",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"publishConfig": {
|
|
5
|
+
"access": "public"
|
|
6
|
+
},
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/lwhite702/wrelik-kit.git",
|
|
10
|
+
"directory": "packages/jobs"
|
|
11
|
+
},
|
|
4
12
|
"main": "./dist/index.js",
|
|
5
13
|
"types": "./dist/index.d.ts",
|
|
14
|
+
"react-native": "./dist/unsupported.js",
|
|
6
15
|
"dependencies": {
|
|
7
16
|
"inngest": "^3.11.0"
|
|
8
17
|
},
|
|
9
18
|
"devDependencies": {
|
|
10
19
|
"tsup": "^8.0.1",
|
|
11
20
|
"vitest": "^1.2.2",
|
|
12
|
-
"@wrelik/eslint-config": "0.1.
|
|
13
|
-
"@wrelik/tsconfig": "0.1.
|
|
21
|
+
"@wrelik/eslint-config": "0.1.1",
|
|
22
|
+
"@wrelik/tsconfig": "0.1.1"
|
|
14
23
|
},
|
|
15
24
|
"scripts": {
|
|
16
|
-
"build": "tsup src/index.ts --format cjs,esm --dts --clean",
|
|
25
|
+
"build": "tsup src/index.ts src/unsupported.ts --format cjs,esm --dts --clean",
|
|
17
26
|
"lint": "eslint src/",
|
|
18
27
|
"test": "vitest run --passWithNoTests"
|
|
19
28
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
// eslint-disable-next-line no-restricted-imports
|
|
2
|
+
import { Inngest } from 'inngest';
|
|
2
3
|
|
|
3
4
|
// Define the event types map that apps can extend via module augmentation?
|
|
4
5
|
// For now, we use a generic approach or require strict schemas.
|
|
@@ -7,7 +8,8 @@ import { Inngest, EventSchemas, type GetEvents } from 'inngest';
|
|
|
7
8
|
|
|
8
9
|
let client: Inngest;
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12
|
+
export function initJobs(appId: string) {
|
|
11
13
|
// We can pass schemas if we want strict typing
|
|
12
14
|
client = new Inngest({ id: appId });
|
|
13
15
|
}
|
|
@@ -17,6 +19,7 @@ function getClient() {
|
|
|
17
19
|
return client;
|
|
18
20
|
}
|
|
19
21
|
|
|
22
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
20
23
|
export async function emit(eventName: string, payload: any) {
|
|
21
24
|
return getClient().send({
|
|
22
25
|
name: eventName,
|
|
@@ -28,6 +31,7 @@ export async function emit(eventName: string, payload: any) {
|
|
|
28
31
|
export function createFunction(
|
|
29
32
|
name: string,
|
|
30
33
|
trigger: { event: string } | { cron: string },
|
|
34
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
31
35
|
handler: (args: any) => Promise<any>,
|
|
32
36
|
) {
|
|
33
37
|
return getClient().createFunction({ id: name }, trigger, handler);
|