@constructive-io/knative-job-service 0.8.1 → 0.8.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/README.md +58 -0
- package/esm/index.js +345 -0
- package/{src/run.ts → esm/run.js} +1 -4
- package/esm/types.js +1 -0
- package/package.json +25 -19
- package/CHANGELOG.md +0 -244
- package/__fixtures__/jobs.seed.sql +0 -67
- package/__tests__/jobs.e2e.test.ts +0 -662
- package/jest.config.js +0 -18
- package/src/index.ts +0 -445
- package/src/types.ts +0 -30
- package/tsconfig.esm.json +0 -9
- package/tsconfig.json +0 -9
- /package/{dist/index.d.ts → index.d.ts} +0 -0
- /package/{dist/index.js → index.js} +0 -0
- /package/{dist/run.d.ts → run.d.ts} +0 -0
- /package/{dist/run.js → run.js} +0 -0
- /package/{dist/types.d.ts → types.d.ts} +0 -0
- /package/{dist/types.js → types.js} +0 -0
package/README.md
CHANGED
|
@@ -1 +1,59 @@
|
|
|
1
1
|
# knative-job-service
|
|
2
|
+
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
## Education and Tutorials
|
|
6
|
+
|
|
7
|
+
1. 🚀 [Quickstart: Getting Up and Running](https://constructive.io/learn/quickstart)
|
|
8
|
+
Get started with modular databases in minutes. Install prerequisites and deploy your first module.
|
|
9
|
+
|
|
10
|
+
2. 📦 [Modular PostgreSQL Development with Database Packages](https://constructive.io/learn/modular-postgres)
|
|
11
|
+
Learn to organize PostgreSQL projects with pgpm workspaces and reusable database modules.
|
|
12
|
+
|
|
13
|
+
3. ✏️ [Authoring Database Changes](https://constructive.io/learn/authoring-database-changes)
|
|
14
|
+
Master the workflow for adding, organizing, and managing database changes with pgpm.
|
|
15
|
+
|
|
16
|
+
4. 🧪 [End-to-End PostgreSQL Testing with TypeScript](https://constructive.io/learn/e2e-postgres-testing)
|
|
17
|
+
Master end-to-end PostgreSQL testing with ephemeral databases, RLS testing, and CI/CD automation.
|
|
18
|
+
|
|
19
|
+
5. ⚡ [Supabase Testing](https://constructive.io/learn/supabase)
|
|
20
|
+
Use TypeScript-first tools to test Supabase projects with realistic RLS, policies, and auth contexts.
|
|
21
|
+
|
|
22
|
+
6. 💧 [Drizzle ORM Testing](https://constructive.io/learn/drizzle-testing)
|
|
23
|
+
Run full-stack tests with Drizzle ORM, including database setup, teardown, and RLS enforcement.
|
|
24
|
+
|
|
25
|
+
7. 🔧 [Troubleshooting](https://constructive.io/learn/troubleshooting)
|
|
26
|
+
Common issues and solutions for pgpm, PostgreSQL, and testing.
|
|
27
|
+
|
|
28
|
+
## Related Constructive Tooling
|
|
29
|
+
|
|
30
|
+
### 📦 Package Management
|
|
31
|
+
|
|
32
|
+
* [pgpm](https://github.com/constructive-io/constructive/tree/main/pgpm/pgpm): **🖥️ PostgreSQL Package Manager** for modular Postgres development. Works with database workspaces, scaffolding, migrations, seeding, and installing database packages.
|
|
33
|
+
|
|
34
|
+
### 🧪 Testing
|
|
35
|
+
|
|
36
|
+
* [pgsql-test](https://github.com/constructive-io/constructive/tree/main/postgres/pgsql-test): **📊 Isolated testing environments** with per-test transaction rollbacks—ideal for integration tests, complex migrations, and RLS simulation.
|
|
37
|
+
* [pgsql-seed](https://github.com/constructive-io/constructive/tree/main/postgres/pgsql-seed): **🌱 PostgreSQL seeding utilities** for CSV, JSON, SQL data loading, and pgpm deployment.
|
|
38
|
+
* [supabase-test](https://github.com/constructive-io/constructive/tree/main/postgres/supabase-test): **🧪 Supabase-native test harness** preconfigured for the local Supabase stack—per-test rollbacks, JWT/role context helpers, and CI/GitHub Actions ready.
|
|
39
|
+
* [graphile-test](https://github.com/constructive-io/constructive/tree/main/graphile/graphile-test): **🔐 Authentication mocking** for Graphile-focused test helpers and emulating row-level security contexts.
|
|
40
|
+
* [pg-query-context](https://github.com/constructive-io/constructive/tree/main/postgres/pg-query-context): **🔒 Session context injection** to add session-local context (e.g., `SET LOCAL`) into queries—ideal for setting `role`, `jwt.claims`, and other session settings.
|
|
41
|
+
|
|
42
|
+
### 🧠 Parsing & AST
|
|
43
|
+
|
|
44
|
+
* [pgsql-parser](https://www.npmjs.com/package/pgsql-parser): **🔄 SQL conversion engine** that interprets and converts PostgreSQL syntax.
|
|
45
|
+
* [libpg-query-node](https://www.npmjs.com/package/libpg-query): **🌉 Node.js bindings** for `libpg_query`, converting SQL into parse trees.
|
|
46
|
+
* [pg-proto-parser](https://www.npmjs.com/package/pg-proto-parser): **📦 Protobuf parser** for parsing PostgreSQL Protocol Buffers definitions to generate TypeScript interfaces, utility functions, and JSON mappings for enums.
|
|
47
|
+
* [@pgsql/enums](https://www.npmjs.com/package/@pgsql/enums): **🏷️ TypeScript enums** for PostgreSQL AST for safe and ergonomic parsing logic.
|
|
48
|
+
* [@pgsql/types](https://www.npmjs.com/package/@pgsql/types): **📝 Type definitions** for PostgreSQL AST nodes in TypeScript.
|
|
49
|
+
* [@pgsql/utils](https://www.npmjs.com/package/@pgsql/utils): **🛠️ AST utilities** for constructing and transforming PostgreSQL syntax trees.
|
|
50
|
+
|
|
51
|
+
## Credits
|
|
52
|
+
|
|
53
|
+
**🛠 Built by the [Constructive](https://constructive.io) team — creators of modular Postgres tooling for secure, composable backends. If you like our work, contribute on [GitHub](https://github.com/constructive-io).**
|
|
54
|
+
|
|
55
|
+
## Disclaimer
|
|
56
|
+
|
|
57
|
+
AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED "AS IS", AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND.
|
|
58
|
+
|
|
59
|
+
No developer or entity involved in creating this software will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of the code, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value.
|
package/esm/index.js
ADDED
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
import jobServerFactory from '@constructive-io/knative-job-server';
|
|
2
|
+
import Worker from '@constructive-io/knative-job-worker';
|
|
3
|
+
import Scheduler from '@constructive-io/job-scheduler';
|
|
4
|
+
import poolManager from '@constructive-io/job-pg';
|
|
5
|
+
import { getJobPgConfig, getJobSchema, getJobSupported, getJobsCallbackPort, getSchedulerHostname, getWorkerHostname } from '@constructive-io/job-utils';
|
|
6
|
+
import { parseEnvBoolean } from '@pgpmjs/env';
|
|
7
|
+
import { Logger } from '@pgpmjs/logger';
|
|
8
|
+
import retry from 'async-retry';
|
|
9
|
+
import { Client } from 'pg';
|
|
10
|
+
import { createRequire } from 'module';
|
|
11
|
+
const functionRegistry = {
|
|
12
|
+
'simple-email': {
|
|
13
|
+
moduleName: '@constructive-io/simple-email-fn',
|
|
14
|
+
defaultPort: 8081
|
|
15
|
+
},
|
|
16
|
+
'send-email-link': {
|
|
17
|
+
moduleName: '@constructive-io/send-email-link-fn',
|
|
18
|
+
defaultPort: 8082
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
const log = new Logger('knative-job-service');
|
|
22
|
+
const requireFn = createRequire(__filename);
|
|
23
|
+
const resolveFunctionEntry = (name) => {
|
|
24
|
+
const entry = functionRegistry[name];
|
|
25
|
+
if (!entry) {
|
|
26
|
+
throw new Error(`Unknown function "${name}".`);
|
|
27
|
+
}
|
|
28
|
+
return entry;
|
|
29
|
+
};
|
|
30
|
+
const loadFunctionApp = (moduleName) => {
|
|
31
|
+
const knativeModuleId = requireFn.resolve('@constructive-io/knative-job-fn');
|
|
32
|
+
delete requireFn.cache[knativeModuleId];
|
|
33
|
+
const moduleId = requireFn.resolve(moduleName);
|
|
34
|
+
delete requireFn.cache[moduleId];
|
|
35
|
+
const mod = requireFn(moduleName);
|
|
36
|
+
const app = mod.default ?? mod;
|
|
37
|
+
if (!app || typeof app.listen !== 'function') {
|
|
38
|
+
throw new Error(`Function module "${moduleName}" does not export a listenable app.`);
|
|
39
|
+
}
|
|
40
|
+
return app;
|
|
41
|
+
};
|
|
42
|
+
const shouldEnableFunctions = (options) => {
|
|
43
|
+
if (!options)
|
|
44
|
+
return false;
|
|
45
|
+
if (typeof options.enabled === 'boolean')
|
|
46
|
+
return options.enabled;
|
|
47
|
+
return Boolean(options.services?.length);
|
|
48
|
+
};
|
|
49
|
+
const normalizeFunctionServices = (options) => {
|
|
50
|
+
if (!shouldEnableFunctions(options))
|
|
51
|
+
return [];
|
|
52
|
+
if (!options?.services?.length) {
|
|
53
|
+
return Object.keys(functionRegistry).map((name) => ({
|
|
54
|
+
name: name
|
|
55
|
+
}));
|
|
56
|
+
}
|
|
57
|
+
return options.services;
|
|
58
|
+
};
|
|
59
|
+
const resolveFunctionPort = (service) => {
|
|
60
|
+
const entry = resolveFunctionEntry(service.name);
|
|
61
|
+
return service.port ?? entry.defaultPort;
|
|
62
|
+
};
|
|
63
|
+
const ensureUniquePorts = (services) => {
|
|
64
|
+
const usedPorts = new Set();
|
|
65
|
+
for (const service of services) {
|
|
66
|
+
const port = resolveFunctionPort(service);
|
|
67
|
+
if (usedPorts.has(port)) {
|
|
68
|
+
throw new Error(`Function port ${port} is assigned more than once.`);
|
|
69
|
+
}
|
|
70
|
+
usedPorts.add(port);
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
const startFunction = async (service, functionServers) => {
|
|
74
|
+
const entry = resolveFunctionEntry(service.name);
|
|
75
|
+
const port = resolveFunctionPort(service);
|
|
76
|
+
const app = loadFunctionApp(entry.moduleName);
|
|
77
|
+
await new Promise((resolve, reject) => {
|
|
78
|
+
const server = app.listen(port, () => {
|
|
79
|
+
log.info(`function:${service.name} listening on ${port}`);
|
|
80
|
+
resolve();
|
|
81
|
+
});
|
|
82
|
+
if (server?.on) {
|
|
83
|
+
server.on('error', (err) => {
|
|
84
|
+
log.error(`function:${service.name} failed to start`, err);
|
|
85
|
+
reject(err);
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
functionServers.set(service.name, server);
|
|
89
|
+
});
|
|
90
|
+
return { name: service.name, port };
|
|
91
|
+
};
|
|
92
|
+
const startFunctions = async (options, functionServers) => {
|
|
93
|
+
const services = normalizeFunctionServices(options);
|
|
94
|
+
if (!services.length)
|
|
95
|
+
return [];
|
|
96
|
+
ensureUniquePorts(services);
|
|
97
|
+
const started = [];
|
|
98
|
+
for (const service of services) {
|
|
99
|
+
started.push(await startFunction(service, functionServers));
|
|
100
|
+
}
|
|
101
|
+
return started;
|
|
102
|
+
};
|
|
103
|
+
const listenApp = async (app, port, host) => new Promise((resolveListen, rejectListen) => {
|
|
104
|
+
const server = host ? app.listen(port, host) : app.listen(port);
|
|
105
|
+
const cleanup = () => {
|
|
106
|
+
server.off('listening', handleListen);
|
|
107
|
+
server.off('error', handleError);
|
|
108
|
+
};
|
|
109
|
+
const handleListen = () => {
|
|
110
|
+
cleanup();
|
|
111
|
+
resolveListen(server);
|
|
112
|
+
};
|
|
113
|
+
const handleError = (err) => {
|
|
114
|
+
cleanup();
|
|
115
|
+
rejectListen(err);
|
|
116
|
+
};
|
|
117
|
+
server.once('listening', handleListen);
|
|
118
|
+
server.once('error', handleError);
|
|
119
|
+
});
|
|
120
|
+
const closeServer = async (server) => {
|
|
121
|
+
if (!server || !server.listening)
|
|
122
|
+
return;
|
|
123
|
+
await new Promise((resolveClose, rejectClose) => {
|
|
124
|
+
server.close((err) => {
|
|
125
|
+
if (err) {
|
|
126
|
+
rejectClose(err);
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
resolveClose();
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
};
|
|
133
|
+
export class KnativeJobsSvc {
|
|
134
|
+
options;
|
|
135
|
+
started = false;
|
|
136
|
+
result = {
|
|
137
|
+
functions: [],
|
|
138
|
+
jobs: false
|
|
139
|
+
};
|
|
140
|
+
functionServers = new Map();
|
|
141
|
+
jobsHttpServer;
|
|
142
|
+
worker;
|
|
143
|
+
scheduler;
|
|
144
|
+
jobsPoolManager;
|
|
145
|
+
constructor(options = {}) {
|
|
146
|
+
this.options = options;
|
|
147
|
+
}
|
|
148
|
+
async start() {
|
|
149
|
+
if (this.started)
|
|
150
|
+
return this.result;
|
|
151
|
+
this.started = true;
|
|
152
|
+
this.result = {
|
|
153
|
+
functions: [],
|
|
154
|
+
jobs: false
|
|
155
|
+
};
|
|
156
|
+
if (shouldEnableFunctions(this.options.functions)) {
|
|
157
|
+
log.info('starting functions');
|
|
158
|
+
this.result.functions = await startFunctions(this.options.functions, this.functionServers);
|
|
159
|
+
}
|
|
160
|
+
if (this.options.jobs?.enabled) {
|
|
161
|
+
log.info('starting jobs service');
|
|
162
|
+
await this.startJobs();
|
|
163
|
+
this.result.jobs = true;
|
|
164
|
+
}
|
|
165
|
+
return this.result;
|
|
166
|
+
}
|
|
167
|
+
async stop() {
|
|
168
|
+
if (!this.started)
|
|
169
|
+
return;
|
|
170
|
+
this.started = false;
|
|
171
|
+
if (this.worker?.stop) {
|
|
172
|
+
await this.worker.stop();
|
|
173
|
+
}
|
|
174
|
+
if (this.scheduler?.stop) {
|
|
175
|
+
await this.scheduler.stop();
|
|
176
|
+
}
|
|
177
|
+
this.worker = undefined;
|
|
178
|
+
this.scheduler = undefined;
|
|
179
|
+
await closeServer(this.jobsHttpServer);
|
|
180
|
+
this.jobsHttpServer = undefined;
|
|
181
|
+
if (this.jobsPoolManager) {
|
|
182
|
+
await this.jobsPoolManager.close();
|
|
183
|
+
this.jobsPoolManager = undefined;
|
|
184
|
+
}
|
|
185
|
+
for (const server of this.functionServers.values()) {
|
|
186
|
+
await closeServer(server);
|
|
187
|
+
}
|
|
188
|
+
this.functionServers.clear();
|
|
189
|
+
}
|
|
190
|
+
async startJobs() {
|
|
191
|
+
const pgPool = poolManager.getPool();
|
|
192
|
+
const jobsApp = jobServerFactory(pgPool);
|
|
193
|
+
const callbackPort = getJobsCallbackPort();
|
|
194
|
+
this.jobsHttpServer = await listenApp(jobsApp, callbackPort);
|
|
195
|
+
const tasks = getJobSupported();
|
|
196
|
+
this.worker = new Worker({
|
|
197
|
+
pgPool,
|
|
198
|
+
tasks,
|
|
199
|
+
workerId: getWorkerHostname()
|
|
200
|
+
});
|
|
201
|
+
this.scheduler = new Scheduler({
|
|
202
|
+
pgPool,
|
|
203
|
+
tasks,
|
|
204
|
+
workerId: getSchedulerHostname()
|
|
205
|
+
});
|
|
206
|
+
this.jobsPoolManager = poolManager;
|
|
207
|
+
this.worker.listen();
|
|
208
|
+
this.scheduler.listen();
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
const parseList = (value) => {
|
|
212
|
+
if (!value)
|
|
213
|
+
return [];
|
|
214
|
+
return value
|
|
215
|
+
.split(',')
|
|
216
|
+
.map((item) => item.trim())
|
|
217
|
+
.filter(Boolean);
|
|
218
|
+
};
|
|
219
|
+
const parsePortMap = (value) => {
|
|
220
|
+
if (!value)
|
|
221
|
+
return {};
|
|
222
|
+
const trimmed = value.trim();
|
|
223
|
+
if (!trimmed)
|
|
224
|
+
return {};
|
|
225
|
+
if (trimmed.startsWith('{')) {
|
|
226
|
+
try {
|
|
227
|
+
const parsed = JSON.parse(trimmed);
|
|
228
|
+
return Object.entries(parsed).reduce((acc, [key, port]) => {
|
|
229
|
+
const portNumber = Number(port);
|
|
230
|
+
if (Number.isFinite(portNumber)) {
|
|
231
|
+
acc[key] = portNumber;
|
|
232
|
+
}
|
|
233
|
+
return acc;
|
|
234
|
+
}, {});
|
|
235
|
+
}
|
|
236
|
+
catch {
|
|
237
|
+
return {};
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
return trimmed.split(',').reduce((acc, pair) => {
|
|
241
|
+
const [rawName, rawPort] = pair.split(/[:=]/).map((item) => item.trim());
|
|
242
|
+
const port = Number(rawPort);
|
|
243
|
+
if (rawName && Number.isFinite(port)) {
|
|
244
|
+
acc[rawName] = port;
|
|
245
|
+
}
|
|
246
|
+
return acc;
|
|
247
|
+
}, {});
|
|
248
|
+
};
|
|
249
|
+
const buildFunctionsOptionsFromEnv = () => {
|
|
250
|
+
const rawFunctions = (process.env.CONSTRUCTIVE_FUNCTIONS || '').trim();
|
|
251
|
+
if (!rawFunctions)
|
|
252
|
+
return undefined;
|
|
253
|
+
const portMap = parsePortMap(process.env.CONSTRUCTIVE_FUNCTION_PORTS);
|
|
254
|
+
const normalized = rawFunctions.toLowerCase();
|
|
255
|
+
if (normalized === 'all' || normalized === '*') {
|
|
256
|
+
return { enabled: true };
|
|
257
|
+
}
|
|
258
|
+
const names = parseList(rawFunctions);
|
|
259
|
+
if (!names.length)
|
|
260
|
+
return undefined;
|
|
261
|
+
const services = names.map((name) => ({
|
|
262
|
+
name,
|
|
263
|
+
port: portMap[name]
|
|
264
|
+
}));
|
|
265
|
+
return {
|
|
266
|
+
enabled: true,
|
|
267
|
+
services
|
|
268
|
+
};
|
|
269
|
+
};
|
|
270
|
+
export const buildKnativeJobsSvcOptionsFromEnv = () => ({
|
|
271
|
+
jobs: {
|
|
272
|
+
enabled: parseEnvBoolean(process.env.CONSTRUCTIVE_JOBS_ENABLED) ?? true
|
|
273
|
+
},
|
|
274
|
+
functions: buildFunctionsOptionsFromEnv()
|
|
275
|
+
});
|
|
276
|
+
export const startKnativeJobsSvcFromEnv = async () => {
|
|
277
|
+
const server = new KnativeJobsSvc(buildKnativeJobsSvcOptionsFromEnv());
|
|
278
|
+
return server.start();
|
|
279
|
+
};
|
|
280
|
+
export const startJobsServices = () => {
|
|
281
|
+
log.info('starting jobs services...');
|
|
282
|
+
const pgPool = poolManager.getPool();
|
|
283
|
+
const app = jobServerFactory(pgPool);
|
|
284
|
+
const callbackPort = getJobsCallbackPort();
|
|
285
|
+
const httpServer = app.listen(callbackPort, () => {
|
|
286
|
+
log.info(`listening ON ${callbackPort}`);
|
|
287
|
+
const tasks = getJobSupported();
|
|
288
|
+
const worker = new Worker({
|
|
289
|
+
pgPool,
|
|
290
|
+
workerId: getWorkerHostname(),
|
|
291
|
+
tasks
|
|
292
|
+
});
|
|
293
|
+
const scheduler = new Scheduler({
|
|
294
|
+
pgPool,
|
|
295
|
+
workerId: getSchedulerHostname(),
|
|
296
|
+
tasks
|
|
297
|
+
});
|
|
298
|
+
worker.listen();
|
|
299
|
+
scheduler.listen();
|
|
300
|
+
});
|
|
301
|
+
return { pgPool, httpServer };
|
|
302
|
+
};
|
|
303
|
+
export const waitForJobsPrereqs = async () => {
|
|
304
|
+
log.info('waiting for jobs prereqs');
|
|
305
|
+
let client = null;
|
|
306
|
+
try {
|
|
307
|
+
const cfg = getJobPgConfig();
|
|
308
|
+
client = new Client({
|
|
309
|
+
host: cfg.host,
|
|
310
|
+
port: cfg.port,
|
|
311
|
+
user: cfg.user,
|
|
312
|
+
password: cfg.password,
|
|
313
|
+
database: cfg.database
|
|
314
|
+
});
|
|
315
|
+
await client.connect();
|
|
316
|
+
const schema = getJobSchema();
|
|
317
|
+
await client.query(`SELECT * FROM "${schema}".jobs LIMIT 1;`);
|
|
318
|
+
}
|
|
319
|
+
catch (error) {
|
|
320
|
+
log.error(error);
|
|
321
|
+
throw new Error('jobs server boot failed...');
|
|
322
|
+
}
|
|
323
|
+
finally {
|
|
324
|
+
if (client) {
|
|
325
|
+
void client.end();
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
};
|
|
329
|
+
export const bootJobs = async () => {
|
|
330
|
+
log.info('attempting to boot jobs');
|
|
331
|
+
await retry(async () => {
|
|
332
|
+
await waitForJobsPrereqs();
|
|
333
|
+
}, {
|
|
334
|
+
retries: 10,
|
|
335
|
+
factor: 2
|
|
336
|
+
});
|
|
337
|
+
const options = buildKnativeJobsSvcOptionsFromEnv();
|
|
338
|
+
if (options.jobs?.enabled === false) {
|
|
339
|
+
log.info('jobs disabled; skipping startup');
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
const server = new KnativeJobsSvc(options);
|
|
343
|
+
await server.start();
|
|
344
|
+
};
|
|
345
|
+
export * from './types';
|
package/esm/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,28 +1,33 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@constructive-io/knative-job-service",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.2",
|
|
4
4
|
"description": "knative job service",
|
|
5
5
|
"author": "Constructive <developers@constructive.io>",
|
|
6
6
|
"homepage": "https://github.com/constructive-io/jobs/tree/master/packages/knative-job-service#readme",
|
|
7
7
|
"license": "SEE LICENSE IN LICENSE",
|
|
8
|
-
"main": "
|
|
8
|
+
"main": "index.js",
|
|
9
|
+
"module": "esm/index.js",
|
|
10
|
+
"types": "index.d.ts",
|
|
9
11
|
"directories": {
|
|
10
12
|
"lib": "src",
|
|
11
13
|
"test": "__tests__"
|
|
12
14
|
},
|
|
13
15
|
"bin": {
|
|
14
|
-
"faas-job-service": "
|
|
16
|
+
"faas-job-service": "run.js"
|
|
15
17
|
},
|
|
16
18
|
"publishConfig": {
|
|
17
|
-
"access": "public"
|
|
19
|
+
"access": "public",
|
|
20
|
+
"directory": "dist"
|
|
18
21
|
},
|
|
19
22
|
"repository": {
|
|
20
23
|
"type": "git",
|
|
21
24
|
"url": "https://github.com/constructive-io/jobs"
|
|
22
25
|
},
|
|
23
26
|
"scripts": {
|
|
24
|
-
"
|
|
25
|
-
"
|
|
27
|
+
"clean": "makage clean",
|
|
28
|
+
"prepack": "npm run build",
|
|
29
|
+
"build": "makage build",
|
|
30
|
+
"build:dev": "makage build --dev",
|
|
26
31
|
"start": "node dist/run.js",
|
|
27
32
|
"dev": "ts-node --transpile-only src/run.ts",
|
|
28
33
|
"test": "jest --passWithNoTests",
|
|
@@ -33,7 +38,7 @@
|
|
|
33
38
|
"url": "https://github.com/constructive-io/jobs/issues"
|
|
34
39
|
},
|
|
35
40
|
"devDependencies": {
|
|
36
|
-
"@constructive-io/graphql-server": "^2.18.
|
|
41
|
+
"@constructive-io/graphql-server": "^2.18.2",
|
|
37
42
|
"@constructive-io/graphql-types": "^2.13.0",
|
|
38
43
|
"@pgpm/database-jobs": "^0.16.0",
|
|
39
44
|
"@pgpm/inflection": "^0.16.0",
|
|
@@ -42,25 +47,26 @@
|
|
|
42
47
|
"@pgpm/services": "^0.16.1",
|
|
43
48
|
"@pgpm/types": "^0.16.0",
|
|
44
49
|
"@pgpm/verify": "^0.16.0",
|
|
45
|
-
"@pgpmjs/core": "^4.16.
|
|
50
|
+
"@pgpmjs/core": "^4.16.1",
|
|
46
51
|
"@types/supertest": "^6.0.3",
|
|
47
|
-
"
|
|
52
|
+
"makage": "^0.1.10",
|
|
53
|
+
"pgsql-test": "^2.25.1",
|
|
48
54
|
"supertest": "^7.2.2",
|
|
49
55
|
"ts-node": "^10.9.2"
|
|
50
56
|
},
|
|
51
57
|
"dependencies": {
|
|
52
|
-
"@constructive-io/job-pg": "^0.4.
|
|
53
|
-
"@constructive-io/job-scheduler": "^0.4.
|
|
54
|
-
"@constructive-io/job-utils": "^0.6.
|
|
55
|
-
"@constructive-io/knative-job-fn": "^0.3.
|
|
56
|
-
"@constructive-io/knative-job-server": "^0.4.
|
|
57
|
-
"@constructive-io/knative-job-worker": "^0.8.
|
|
58
|
-
"@constructive-io/send-email-link-fn": "^0.3.
|
|
59
|
-
"@constructive-io/simple-email-fn": "^0.3.
|
|
58
|
+
"@constructive-io/job-pg": "^0.4.1",
|
|
59
|
+
"@constructive-io/job-scheduler": "^0.4.1",
|
|
60
|
+
"@constructive-io/job-utils": "^0.6.1",
|
|
61
|
+
"@constructive-io/knative-job-fn": "^0.3.1",
|
|
62
|
+
"@constructive-io/knative-job-server": "^0.4.1",
|
|
63
|
+
"@constructive-io/knative-job-worker": "^0.8.1",
|
|
64
|
+
"@constructive-io/send-email-link-fn": "^0.3.1",
|
|
65
|
+
"@constructive-io/simple-email-fn": "^0.3.1",
|
|
60
66
|
"@pgpmjs/env": "^2.10.0",
|
|
61
67
|
"@pgpmjs/logger": "^1.4.0",
|
|
62
68
|
"async-retry": "1.3.1",
|
|
63
|
-
"pg": "8.
|
|
69
|
+
"pg": "8.17.1"
|
|
64
70
|
},
|
|
65
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "3ffd5718e86ea5fa9ca6e0930aeb510cf392f343"
|
|
66
72
|
}
|