@camstack/addon-mqtt-broker 1.2.42 → 1.2.43

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.
@@ -8068,18 +8068,61 @@ var RelocateFootageInputSchema = object({
8068
8068
  * `RecordingConfig.enabled` or camera wrapper bindings. */
8069
8069
  var StorageMigrationLeaseInputSchema = object({ leaseId: string().min(1) });
8070
8070
  var StorageMigrationFootageMoveInputSchema = RelocateFootageInputSchema.extend({ leaseId: string().min(1) });
8071
+ /**
8072
+ * What a `relocateMedia` pass DOES. One engine, three passes — never a second
8073
+ * mover (the engine already walks both collections with a timestamp cursor and
8074
+ * already has a stamp-without-copy path).
8075
+ *
8076
+ * - `move` — the default and the historical behaviour: event-media and
8077
+ * retrain blobs move to `toLocationId` and their rows are
8078
+ * stamped. The enrolled gallery is skipped (D197).
8079
+ * - `seal` — ROWS ONLY, no bytes. Every row whose `locationId` is NULL is
8080
+ * stamped with `toLocationId`. `toLocationId` here is the id the
8081
+ * bytes ALREADY sit on — today's `eventMedia` default — because
8082
+ * a NULL row means "wherever `eventMedia` points *now*", and the
8083
+ * instant a repoint moves that pointer the row reads from the
8084
+ * new disk while its bytes are on the old one.
8085
+ * - `gallery` — the inverse selection of `move`: ONLY the retention-exempt
8086
+ * (enrolled-gallery) rows, which `move` deliberately skips.
8087
+ * `galleryMedia` is `cardinality: 'single'`, so this pass can
8088
+ * never run beside a live second location: it is stop-the-world
8089
+ * by construction, which is acceptable only because the gallery
8090
+ * is a few KB per enrolled sample.
8091
+ */
8092
+ var MediaRelocateModeSchema = _enum([
8093
+ "move",
8094
+ "seal",
8095
+ "gallery"
8096
+ ]);
8071
8097
  var RelocateMediaInputSchema = object({
8072
8098
  toLocationId: string(),
8073
- throttleMbps: number().min(1).max(1e3).optional()
8099
+ throttleMbps: number().min(1).max(1e3).optional(),
8100
+ /** Omitted = `move`, the pre-existing behaviour. */
8101
+ mode: MediaRelocateModeSchema.optional()
8102
+ });
8103
+ /** How many rows still carry NO `locationId` — the population a repoint would
8104
+ * silently re-aim at a disk that does not hold their bytes. Zero is the only
8105
+ * value that permits a non-blocking `eventMedia` cutover. */
8106
+ var UnstampedEventMediaCountSchema = object({
8107
+ media: number().int().nonnegative(),
8108
+ retrainFrames: number().int().nonnegative(),
8109
+ total: number().int().nonnegative()
8074
8110
  });
8075
8111
  var StorageMigrationMediaMoveInputSchema = RelocateMediaInputSchema.extend({ leaseId: string().min(1) });
8076
- /** The independently selectable logical storage classes. `recordings`
8077
- * encompasses the high and mid segment profiles; `recordingsLow` is low
8078
- * segments; `eventMedia` is post-analysis blobs. */
8112
+ /** The independently selectable logical storage classes — every class
8113
+ * `storage.listLocationDeclarations` reports, so an operator never meets a
8114
+ * Zod enum error where they should meet an explanation.
8115
+ *
8116
+ * `recordings` encompasses the high and mid segment profiles; `recordingsLow`
8117
+ * is low segments; `eventMedia` is post-analysis blobs; `galleryMedia` is the
8118
+ * enrolled gallery; `backups` is the system backup archive. The last two have
8119
+ * their own rules — see {@link StorageMigrationFindingCodeSchema}. */
8079
8120
  var StorageMigrationClassSchema = _enum([
8080
8121
  "recordings",
8081
8122
  "recordingsLow",
8082
- "eventMedia"
8123
+ "eventMedia",
8124
+ "backups",
8125
+ "galleryMedia"
8083
8126
  ]);
8084
8127
  /** A destination is always an existing, fully-qualified location id. The
8085
8128
  * migration API intentionally never changes a source location's `basePath`:
@@ -8087,20 +8130,56 @@ var StorageMigrationClassSchema = _enum([
8087
8130
  var StorageMigrationDestinationsSchema = object({
8088
8131
  recordings: string().min(1).optional(),
8089
8132
  recordingsLow: string().min(1).optional(),
8090
- eventMedia: string().min(1).optional()
8133
+ eventMedia: string().min(1).optional(),
8134
+ backups: string().min(1).optional(),
8135
+ galleryMedia: string().min(1).optional()
8091
8136
  }).refine((value) => Object.keys(value).length > 0, { message: "select at least one storage class" });
8137
+ /**
8138
+ * How a migration sequences the cutover against the byte move.
8139
+ *
8140
+ * - `blocking` — the historical order: pause, move every byte, repoint,
8141
+ * resume. Recording is stopped for the whole move. Right
8142
+ * for a small or a cold class, and the only legal mode for
8143
+ * a `cardinality: 'single'` class.
8144
+ * - `nonBlocking` — repoint FIRST, drain behind: seal, pause, repoint,
8145
+ * refresh, resume, then move the past with everything
8146
+ * running. The pause is three bounded instants (a detach +
8147
+ * attach round, a write-gate drain, a lease) instead of one
8148
+ * bounded by bytes. 1.09 TB at 7–14 MB/s is thirty hours of
8149
+ * stopped recording under `blocking`; the same move is
8150
+ * seconds of stopped recording under `nonBlocking`.
8151
+ *
8152
+ * The mode is on the JOB, not only on the input, because `status` is where an
8153
+ * operator finds out which one is running.
8154
+ */
8155
+ var StorageMigrationModeSchema = _enum(["blocking", "nonBlocking"]);
8092
8156
  /** Shared input for planning and starting an orchestrated storage migration. */
8093
8157
  var StorageMigrationInputSchema = object({
8094
8158
  destinations: StorageMigrationDestinationsSchema,
8095
- throttleMbps: number().min(1).max(1e3).optional()
8159
+ throttleMbps: number().min(1).max(1e3).optional(),
8160
+ /** Omitted = `blocking`, which stays the default. */
8161
+ mode: StorageMigrationModeSchema.optional()
8096
8162
  });
8097
- /** The durable coordinator state machine. The only phase that changes default
8098
- * locations is `repointing`, after every selected mover has completed and been
8099
- * verified. */
8163
+ /**
8164
+ * The durable coordinator state machine.
8165
+ *
8166
+ * `blocking`:
8167
+ * planning → pausing → moving → verifying → repointing → refreshing → resuming → done
8168
+ *
8169
+ * `nonBlocking`:
8170
+ * planning → sealing → pausing → repointing → refreshing → resuming → draining → verifying → done
8171
+ *
8172
+ * Same phases, different order plus two new ones — not a second mover.
8173
+ * `sealing` closes the `eventMedia` NULL-row hole BEFORE anything is paused;
8174
+ * `draining` runs the same movers UNLEASED, after every writer is back up.
8175
+ * `repointing` is still the only phase that changes a default location.
8176
+ */
8100
8177
  var StorageMigrationPhaseSchema = _enum([
8101
8178
  "planning",
8179
+ "sealing",
8102
8180
  "pausing",
8103
8181
  "moving",
8182
+ "draining",
8104
8183
  "verifying",
8105
8184
  "repointing",
8106
8185
  "refreshing",
@@ -8125,6 +8204,9 @@ var StorageMigrationMoveSchema = object({
8125
8204
  var StorageMigrationJobSchema = object({
8126
8205
  jobId: string(),
8127
8206
  phase: StorageMigrationPhaseSchema,
8207
+ /** Which order this job is running. `status` is the only place an operator
8208
+ * can tell a seconds-long cutover from a thirty-hour one. */
8209
+ mode: StorageMigrationModeSchema,
8128
8210
  destinations: StorageMigrationDestinationsSchema,
8129
8211
  throttleMbps: number(),
8130
8212
  moves: array(StorageMigrationMoveSchema),
@@ -8137,13 +8219,30 @@ var StorageMigrationJobSchema = object({
8137
8219
  finishedAt: number().nullable(),
8138
8220
  error: string().nullable()
8139
8221
  });
8222
+ var StorageMigrationFindingSchema = object({
8223
+ code: _enum([
8224
+ "sharesDeviceWithSource",
8225
+ "deviceIdentityUnknown",
8226
+ "unstampedEventMediaRows",
8227
+ "blockingOnly",
8228
+ "noMover"
8229
+ ]),
8230
+ storageClass: StorageMigrationClassSchema,
8231
+ /** Human-readable, already carrying the ids and counts. */
8232
+ message: string()
8233
+ });
8140
8234
  var StorageMigrationPlanSchema = object({
8141
8235
  destinations: StorageMigrationDestinationsSchema,
8236
+ /** The mode this plan was built for. A plan is only valid for its mode: the
8237
+ * `eventMedia` seal gate and the single-cardinality refusal both depend on
8238
+ * it. */
8239
+ mode: StorageMigrationModeSchema,
8142
8240
  moves: array(object({
8143
8241
  storageClass: StorageMigrationClassSchema,
8144
8242
  fromLocationId: string(),
8145
8243
  toLocationId: string()
8146
- }))
8244
+ })),
8245
+ findings: array(StorageMigrationFindingSchema)
8147
8246
  });
8148
8247
  /**
8149
8248
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
@@ -18722,7 +18821,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
18722
18821
  }), method(RelocateMediaInputSchema, object({ jobId: string() }), {
18723
18822
  kind: "mutation",
18724
18823
  auth: "admin"
18725
- }), method(object({}), array(RelocateJobSchema).readonly(), {
18824
+ }), method(object({}), UnstampedEventMediaCountSchema, { auth: "admin" }), method(object({}), array(RelocateJobSchema).readonly(), {
18726
18825
  kind: "query",
18727
18826
  auth: "admin"
18728
18827
  }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
@@ -20629,7 +20728,10 @@ method(object({
20629
20728
  }), StorageLocationSchema, {
20630
20729
  kind: "mutation",
20631
20730
  auth: "admin"
20632
- }), method(object({ id: string() }), _void(), {
20731
+ }), method(object({
20732
+ id: string(),
20733
+ force: boolean().optional()
20734
+ }), _void(), {
20633
20735
  kind: "mutation",
20634
20736
  auth: "admin"
20635
20737
  }), method(object({ id: string() }), object({
@@ -31102,6 +31204,12 @@ Object.freeze({
31102
31204
  addonId: null,
31103
31205
  access: "create"
31104
31206
  },
31207
+ "pipelineAnalytics.countUnstampedEventMedia": {
31208
+ capName: "pipeline-analytics",
31209
+ capScope: "device",
31210
+ addonId: null,
31211
+ access: "view"
31212
+ },
31105
31213
  "pipelineAnalytics.deleteDeviceEvents": {
31106
31214
  capName: "pipeline-analytics",
31107
31215
  capScope: "device",
@@ -8063,18 +8063,61 @@ var RelocateFootageInputSchema = object({
8063
8063
  * `RecordingConfig.enabled` or camera wrapper bindings. */
8064
8064
  var StorageMigrationLeaseInputSchema = object({ leaseId: string().min(1) });
8065
8065
  var StorageMigrationFootageMoveInputSchema = RelocateFootageInputSchema.extend({ leaseId: string().min(1) });
8066
+ /**
8067
+ * What a `relocateMedia` pass DOES. One engine, three passes — never a second
8068
+ * mover (the engine already walks both collections with a timestamp cursor and
8069
+ * already has a stamp-without-copy path).
8070
+ *
8071
+ * - `move` — the default and the historical behaviour: event-media and
8072
+ * retrain blobs move to `toLocationId` and their rows are
8073
+ * stamped. The enrolled gallery is skipped (D197).
8074
+ * - `seal` — ROWS ONLY, no bytes. Every row whose `locationId` is NULL is
8075
+ * stamped with `toLocationId`. `toLocationId` here is the id the
8076
+ * bytes ALREADY sit on — today's `eventMedia` default — because
8077
+ * a NULL row means "wherever `eventMedia` points *now*", and the
8078
+ * instant a repoint moves that pointer the row reads from the
8079
+ * new disk while its bytes are on the old one.
8080
+ * - `gallery` — the inverse selection of `move`: ONLY the retention-exempt
8081
+ * (enrolled-gallery) rows, which `move` deliberately skips.
8082
+ * `galleryMedia` is `cardinality: 'single'`, so this pass can
8083
+ * never run beside a live second location: it is stop-the-world
8084
+ * by construction, which is acceptable only because the gallery
8085
+ * is a few KB per enrolled sample.
8086
+ */
8087
+ var MediaRelocateModeSchema = _enum([
8088
+ "move",
8089
+ "seal",
8090
+ "gallery"
8091
+ ]);
8066
8092
  var RelocateMediaInputSchema = object({
8067
8093
  toLocationId: string(),
8068
- throttleMbps: number().min(1).max(1e3).optional()
8094
+ throttleMbps: number().min(1).max(1e3).optional(),
8095
+ /** Omitted = `move`, the pre-existing behaviour. */
8096
+ mode: MediaRelocateModeSchema.optional()
8097
+ });
8098
+ /** How many rows still carry NO `locationId` — the population a repoint would
8099
+ * silently re-aim at a disk that does not hold their bytes. Zero is the only
8100
+ * value that permits a non-blocking `eventMedia` cutover. */
8101
+ var UnstampedEventMediaCountSchema = object({
8102
+ media: number().int().nonnegative(),
8103
+ retrainFrames: number().int().nonnegative(),
8104
+ total: number().int().nonnegative()
8069
8105
  });
8070
8106
  var StorageMigrationMediaMoveInputSchema = RelocateMediaInputSchema.extend({ leaseId: string().min(1) });
8071
- /** The independently selectable logical storage classes. `recordings`
8072
- * encompasses the high and mid segment profiles; `recordingsLow` is low
8073
- * segments; `eventMedia` is post-analysis blobs. */
8107
+ /** The independently selectable logical storage classes — every class
8108
+ * `storage.listLocationDeclarations` reports, so an operator never meets a
8109
+ * Zod enum error where they should meet an explanation.
8110
+ *
8111
+ * `recordings` encompasses the high and mid segment profiles; `recordingsLow`
8112
+ * is low segments; `eventMedia` is post-analysis blobs; `galleryMedia` is the
8113
+ * enrolled gallery; `backups` is the system backup archive. The last two have
8114
+ * their own rules — see {@link StorageMigrationFindingCodeSchema}. */
8074
8115
  var StorageMigrationClassSchema = _enum([
8075
8116
  "recordings",
8076
8117
  "recordingsLow",
8077
- "eventMedia"
8118
+ "eventMedia",
8119
+ "backups",
8120
+ "galleryMedia"
8078
8121
  ]);
8079
8122
  /** A destination is always an existing, fully-qualified location id. The
8080
8123
  * migration API intentionally never changes a source location's `basePath`:
@@ -8082,20 +8125,56 @@ var StorageMigrationClassSchema = _enum([
8082
8125
  var StorageMigrationDestinationsSchema = object({
8083
8126
  recordings: string().min(1).optional(),
8084
8127
  recordingsLow: string().min(1).optional(),
8085
- eventMedia: string().min(1).optional()
8128
+ eventMedia: string().min(1).optional(),
8129
+ backups: string().min(1).optional(),
8130
+ galleryMedia: string().min(1).optional()
8086
8131
  }).refine((value) => Object.keys(value).length > 0, { message: "select at least one storage class" });
8132
+ /**
8133
+ * How a migration sequences the cutover against the byte move.
8134
+ *
8135
+ * - `blocking` — the historical order: pause, move every byte, repoint,
8136
+ * resume. Recording is stopped for the whole move. Right
8137
+ * for a small or a cold class, and the only legal mode for
8138
+ * a `cardinality: 'single'` class.
8139
+ * - `nonBlocking` — repoint FIRST, drain behind: seal, pause, repoint,
8140
+ * refresh, resume, then move the past with everything
8141
+ * running. The pause is three bounded instants (a detach +
8142
+ * attach round, a write-gate drain, a lease) instead of one
8143
+ * bounded by bytes. 1.09 TB at 7–14 MB/s is thirty hours of
8144
+ * stopped recording under `blocking`; the same move is
8145
+ * seconds of stopped recording under `nonBlocking`.
8146
+ *
8147
+ * The mode is on the JOB, not only on the input, because `status` is where an
8148
+ * operator finds out which one is running.
8149
+ */
8150
+ var StorageMigrationModeSchema = _enum(["blocking", "nonBlocking"]);
8087
8151
  /** Shared input for planning and starting an orchestrated storage migration. */
8088
8152
  var StorageMigrationInputSchema = object({
8089
8153
  destinations: StorageMigrationDestinationsSchema,
8090
- throttleMbps: number().min(1).max(1e3).optional()
8154
+ throttleMbps: number().min(1).max(1e3).optional(),
8155
+ /** Omitted = `blocking`, which stays the default. */
8156
+ mode: StorageMigrationModeSchema.optional()
8091
8157
  });
8092
- /** The durable coordinator state machine. The only phase that changes default
8093
- * locations is `repointing`, after every selected mover has completed and been
8094
- * verified. */
8158
+ /**
8159
+ * The durable coordinator state machine.
8160
+ *
8161
+ * `blocking`:
8162
+ * planning → pausing → moving → verifying → repointing → refreshing → resuming → done
8163
+ *
8164
+ * `nonBlocking`:
8165
+ * planning → sealing → pausing → repointing → refreshing → resuming → draining → verifying → done
8166
+ *
8167
+ * Same phases, different order plus two new ones — not a second mover.
8168
+ * `sealing` closes the `eventMedia` NULL-row hole BEFORE anything is paused;
8169
+ * `draining` runs the same movers UNLEASED, after every writer is back up.
8170
+ * `repointing` is still the only phase that changes a default location.
8171
+ */
8095
8172
  var StorageMigrationPhaseSchema = _enum([
8096
8173
  "planning",
8174
+ "sealing",
8097
8175
  "pausing",
8098
8176
  "moving",
8177
+ "draining",
8099
8178
  "verifying",
8100
8179
  "repointing",
8101
8180
  "refreshing",
@@ -8120,6 +8199,9 @@ var StorageMigrationMoveSchema = object({
8120
8199
  var StorageMigrationJobSchema = object({
8121
8200
  jobId: string(),
8122
8201
  phase: StorageMigrationPhaseSchema,
8202
+ /** Which order this job is running. `status` is the only place an operator
8203
+ * can tell a seconds-long cutover from a thirty-hour one. */
8204
+ mode: StorageMigrationModeSchema,
8123
8205
  destinations: StorageMigrationDestinationsSchema,
8124
8206
  throttleMbps: number(),
8125
8207
  moves: array(StorageMigrationMoveSchema),
@@ -8132,13 +8214,30 @@ var StorageMigrationJobSchema = object({
8132
8214
  finishedAt: number().nullable(),
8133
8215
  error: string().nullable()
8134
8216
  });
8217
+ var StorageMigrationFindingSchema = object({
8218
+ code: _enum([
8219
+ "sharesDeviceWithSource",
8220
+ "deviceIdentityUnknown",
8221
+ "unstampedEventMediaRows",
8222
+ "blockingOnly",
8223
+ "noMover"
8224
+ ]),
8225
+ storageClass: StorageMigrationClassSchema,
8226
+ /** Human-readable, already carrying the ids and counts. */
8227
+ message: string()
8228
+ });
8135
8229
  var StorageMigrationPlanSchema = object({
8136
8230
  destinations: StorageMigrationDestinationsSchema,
8231
+ /** The mode this plan was built for. A plan is only valid for its mode: the
8232
+ * `eventMedia` seal gate and the single-cardinality refusal both depend on
8233
+ * it. */
8234
+ mode: StorageMigrationModeSchema,
8137
8235
  moves: array(object({
8138
8236
  storageClass: StorageMigrationClassSchema,
8139
8237
  fromLocationId: string(),
8140
8238
  toLocationId: string()
8141
- }))
8239
+ })),
8240
+ findings: array(StorageMigrationFindingSchema)
8142
8241
  });
8143
8242
  /**
8144
8243
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
@@ -18717,7 +18816,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
18717
18816
  }), method(RelocateMediaInputSchema, object({ jobId: string() }), {
18718
18817
  kind: "mutation",
18719
18818
  auth: "admin"
18720
- }), method(object({}), array(RelocateJobSchema).readonly(), {
18819
+ }), method(object({}), UnstampedEventMediaCountSchema, { auth: "admin" }), method(object({}), array(RelocateJobSchema).readonly(), {
18721
18820
  kind: "query",
18722
18821
  auth: "admin"
18723
18822
  }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
@@ -20624,7 +20723,10 @@ method(object({
20624
20723
  }), StorageLocationSchema, {
20625
20724
  kind: "mutation",
20626
20725
  auth: "admin"
20627
- }), method(object({ id: string() }), _void(), {
20726
+ }), method(object({
20727
+ id: string(),
20728
+ force: boolean().optional()
20729
+ }), _void(), {
20628
20730
  kind: "mutation",
20629
20731
  auth: "admin"
20630
20732
  }), method(object({ id: string() }), object({
@@ -31097,6 +31199,12 @@ Object.freeze({
31097
31199
  addonId: null,
31098
31200
  access: "create"
31099
31201
  },
31202
+ "pipelineAnalytics.countUnstampedEventMedia": {
31203
+ capName: "pipeline-analytics",
31204
+ capScope: "device",
31205
+ addonId: null,
31206
+ access: "view"
31207
+ },
31100
31208
  "pipelineAnalytics.deleteDeviceEvents": {
31101
31209
  capName: "pipeline-analytics",
31102
31210
  capScope: "device",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-mqtt-broker",
3
- "version": "1.2.42",
3
+ "version": "1.2.43",
4
4
  "description": "MQTT broker registry addon for CamStack — manages external broker entries + an optional embedded aedes broker. Consumers spin up their own `mqtt.js` clients via the `mqtt-broker` cap.",
5
5
  "keywords": [
6
6
  "camstack",