@tryghost/adapter-base-scheduling 0.1.0 → 0.1.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.
Files changed (3) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/README.md +63 -11
  3. package/package.json +2 -2
package/CHANGELOG.md ADDED
@@ -0,0 +1,9 @@
1
+ # @tryghost/adapter-base-scheduling
2
+
3
+ ## 0.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated README documentation
8
+
9
+ - Update @tryghost deps to latest
package/README.md CHANGED
@@ -1,6 +1,65 @@
1
1
  # @tryghost/adapter-base-scheduling
2
2
 
3
- The adapter-base-scheduling package for Ghost.
3
+ Base class for Ghost scheduling adapters. A scheduling adapter is responsible
4
+ for firing Ghost's time-based jobs — publishing scheduled posts, sending
5
+ scheduled newsletters, automations, gift reminders — by calling back into
6
+ Ghost's API at the requested time.
7
+
8
+ See the [Ghost adapters documentation](https://docs.ghost.org/config#adapters)
9
+ for how adapters are configured and loaded.
10
+
11
+ ## Usage
12
+
13
+ Install the base class alongside your adapter:
14
+
15
+ ```bash
16
+ npm install @tryghost/adapter-base-scheduling
17
+ ```
18
+
19
+ Extend `SchedulingBase` and implement every method listed in `requiredFns`:
20
+ `run`, `schedule`, and `unschedule`. `register` and `rescheduleAll` are
21
+ inherited from the base class.
22
+
23
+ Each job has a `time` (unix timestamp), a `url` to call back (carrying a
24
+ JWT-signed admin token), and an `extra` object holding the `httpMethod` to use.
25
+ At `time`, the adapter fires the HTTP request described by the job.
26
+
27
+ ```js
28
+ const {SchedulingBase} = require('@tryghost/adapter-base-scheduling');
29
+
30
+ class MyScheduler extends SchedulingBase {
31
+ constructor(options) {
32
+ super();
33
+ // `options` is the settings block from your Ghost config
34
+ }
35
+
36
+ // Called on boot. Fire any jobs whose time has already passed and start
37
+ // watching for upcoming ones.
38
+ run() { /* ... */ }
39
+
40
+ // Queue `job` to fire at job.time via job.extra.httpMethod against job.url.
41
+ schedule(job) { /* ... */ }
42
+
43
+ // Remove a previously-scheduled job.
44
+ unschedule(job, options) { /* ... */ }
45
+ }
46
+
47
+ module.exports = MyScheduler;
48
+ ```
49
+
50
+ ### Installing and activating
51
+
52
+ Place the adapter at `content/adapters/scheduling/MyScheduler/index.js` and
53
+ activate it in your Ghost config:
54
+
55
+ ```json
56
+ {
57
+ "scheduling": {
58
+ "active": "MyScheduler",
59
+ "MyScheduler": {}
60
+ }
61
+ }
62
+ ```
4
63
 
5
64
  ## Develop
6
65
 
@@ -12,18 +71,11 @@ pnpm --filter @tryghost/adapter-base-scheduling test # type-check + unit test
12
71
  pnpm --filter @tryghost/adapter-base-scheduling dev # rebuild on change
13
72
  ```
14
73
 
15
- In-monorepo consumers resolve this package via the `source` export condition
16
- (raw `src/*.ts`, no build needed in dev/test). Production and any published
17
- tarball use the compiled `build/` output.
18
-
19
74
  This package is ESM-only and compiled with `tsc` (`module: nodenext`). Relative
20
75
  imports in `src/` must carry an explicit extension; write the real `.ts` one —
21
76
  `import {x} from './x.ts'` — and `tsc` rewrites it to `.js` on emit
22
77
  (`rewriteRelativeImportExtensions`).
23
78
 
24
- `ghost/core` is CommonJS but consumes this package via `require()`, which works
25
- on Ghost's Node version (22.13+/24) through Node's `require(esm)` support. That
26
- support has one hard constraint: **no top-level `await`** anywhere in this
27
- package's module graph — it makes the graph async and `require()` of it throws
28
- `ERR_REQUIRE_ASYNC_MODULE`. Keep module-level initialization synchronous. (An
29
- ESLint rule enforces this.)
79
+ # Copyright & License
80
+
81
+ Copyright (c) 2013-2026 Ghost Foundation - Released under the [MIT license](LICENSE). Ghost and the Ghost Logo are trademarks of Ghost Foundation Ltd. Please see our [trademark policy](https://ghost.org/trademark/) for info on acceptable usage.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tryghost/adapter-base-scheduling",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "The adapter-base-scheduling package for Ghost.",
5
5
  "type": "module",
6
6
  "repository": {
@@ -22,7 +22,7 @@
22
22
  "build"
23
23
  ],
24
24
  "dependencies": {
25
- "@tryghost/logging": "4.2.1"
25
+ "@tryghost/logging": "5.3.0"
26
26
  },
27
27
  "scripts": {
28
28
  "build": "tsc",