@crombolo/server 0.73.0 → 0.73.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crombolo/server",
3
- "version": "0.73.0",
3
+ "version": "0.73.2",
4
4
  "description": "Internal to crombolo, with no compatibility promise: use @crombolo/crombolo. The crombolo HTTP server: routing, configuration, media stores and background jobs.",
5
5
  "license": "MIT",
6
6
  "author": "Crombolo",
@@ -32,19 +32,19 @@
32
32
  "access": "public"
33
33
  },
34
34
  "dependencies": {
35
- "@crombolo/api-delivery": "0.73.0",
36
- "@crombolo/api-management": "0.73.0",
37
- "@crombolo/auth": "0.73.0",
38
- "@crombolo/backoffice-host": "0.73.0",
39
- "@crombolo/common": "0.73.0",
40
- "@crombolo/content": "0.73.0",
41
- "@crombolo/contracts": "0.73.0",
42
- "@crombolo/core": "0.73.0",
43
- "@crombolo/data": "0.73.0",
44
- "@crombolo/extension": "0.73.0",
45
- "@crombolo/render": "0.73.0",
46
- "@crombolo/schema": "0.73.0",
47
- "@crombolo/transfer": "0.73.0",
35
+ "@crombolo/api-delivery": "0.73.2",
36
+ "@crombolo/api-management": "0.73.2",
37
+ "@crombolo/auth": "0.73.2",
38
+ "@crombolo/backoffice-host": "0.73.2",
39
+ "@crombolo/common": "0.73.2",
40
+ "@crombolo/content": "0.73.2",
41
+ "@crombolo/contracts": "0.73.2",
42
+ "@crombolo/core": "0.73.2",
43
+ "@crombolo/data": "0.73.2",
44
+ "@crombolo/extension": "0.73.2",
45
+ "@crombolo/render": "0.73.2",
46
+ "@crombolo/schema": "0.73.2",
47
+ "@crombolo/transfer": "0.73.2",
48
48
  "@logtape/logtape": "^2.3.8",
49
49
  "@opentelemetry/api": "1.10.0",
50
50
  "@opentelemetry/context-async-hooks": "3.0.0",
package/src/config.ts CHANGED
@@ -1492,7 +1492,7 @@ export function describeDatabase(
1492
1492
  }
1493
1493
  }
1494
1494
 
1495
- export const VERSION = '0.73.0'
1495
+ export const VERSION = '0.73.2'
1496
1496
 
1497
1497
  /** A whole number of seconds from the environment; undefined when unset or not one. */
1498
1498
  /** A positive number from a setting, else the default. */
@@ -138,7 +138,16 @@ export function createContentEventSink(options: ContentEventSinkOptions): EventS
138
138
  if (scheduled || schedule.length > 0)
139
139
  await changes.scheduleOf(userKey, { key, kind: 'document' }, scheduleEntries(schedule))
140
140
  const closed = await changes.publishedBy(userKey, { key, kind: 'document' })
141
- if (!closed) return
141
+ if (closed) await announceChange(tx, key, closed, actor)
142
+ }
143
+
144
+ /** `Crombolo.ChangePublished` for a page's change, as an outbox event in its transaction. */
145
+ async function announceChange(
146
+ tx: Db,
147
+ key: string,
148
+ closed: { key: string; name: string | null; from?: 'own-workspace' },
149
+ actor: Actor,
150
+ ) {
142
151
  const change = { ...closed, ...(await madeBy()), ...(await needsOf(tx, key)) }
143
152
  const hook = { alias: CHANGE_PUBLISHED, key }
144
153
  await new ContentEventRepository(tx).record({
@@ -156,6 +165,17 @@ export function createContentEventSink(options: ContentEventSinkOptions): EventS
156
165
  }
157
166
 
158
167
  return {
168
+ async ownPublished(tx, published, actor) {
169
+ if (!options.changes) return
170
+ const change = await new ChangeRepository(tx).byId(published.changeId)
171
+ if (!change) return
172
+ await announceChange(
173
+ tx,
174
+ published.key,
175
+ { key: change.key, name: change.name, from: 'own-workspace' },
176
+ actor,
177
+ )
178
+ },
159
179
  async record(tx: Db, event, actor) {
160
180
  if (options.changes) await recordInChange(tx, event, actor as Actor)
161
181
  const entry = auditEntryFor(event, actor)
package/src/webhooks.ts CHANGED
@@ -251,6 +251,8 @@ export interface WebhookFacts extends RaisedWebhookEvent {
251
251
  name: string | null
252
252
  items: Array<{ kind: string; alias: string }>
253
253
  }>
254
+ /** Story 397: published in the person's own workspace, merging that page alone. */
255
+ from?: 'own-workspace'
254
256
  }
255
257
  }
256
258
 
@@ -269,6 +271,7 @@ const changeOf = (change: NonNullable<WebhookFacts['change']>) => ({
269
271
  })),
270
272
  }
271
273
  : {}),
274
+ ...(change.from ? { From: change.from } : {}),
272
275
  })
273
276
 
274
277
  /** An event as the site's own handler receives it (story 298). Pure. */