@camstack/addon-training 0.1.42 → 0.1.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.
Files changed (20) hide show
  1. package/dist/{MotionZonesSettings-DZgoN8V_.mjs → MotionZonesSettings-YpCetvNg.mjs} +2 -2
  2. package/dist/{PrivacyMaskSettings-7L2OX3dp.mjs → PrivacyMaskSettings-DJ34xZMc.mjs} +2 -2
  3. package/dist/{SceneMonitorEditor-CwULmLkP.mjs → SceneMonitorEditor-ChyCoZy6.mjs} +1 -1
  4. package/dist/_stub.js +8 -8
  5. package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_training_page-DzsEYUgl.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_training_page-B5F2D49H.mjs} +3 -3
  6. package/dist/_virtual_mf___mfe_internal__addon_training_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-BH6lTdjB.mjs +26 -0
  7. package/dist/{dist-BtEl1kYQ.mjs → dist-C7yODd9D.mjs} +381 -0
  8. package/dist/{dist-wRpOWEq6.js → dist-ZBXOtBdC.js} +381 -0
  9. package/dist/{hostInit-1OJB0wPE.mjs → hostInit-Ci39xaf6.mjs} +2 -2
  10. package/dist/index.js +1 -1
  11. package/dist/orchestrator/training.addon.js +1 -1
  12. package/dist/orchestrator/training.addon.mjs +1 -1
  13. package/dist/{player-overlays-CqD89xkd.mjs → player-overlays-CLkmW1-R.mjs} +1 -1
  14. package/dist/providers/modal/training-modal.addon.js +1 -1
  15. package/dist/providers/modal/training-modal.addon.mjs +1 -1
  16. package/dist/remoteEntry.js +1 -1
  17. package/dist/{responsive-Dwyuxd3q.mjs → responsive-DaJFlnYN.mjs} +1 -1
  18. package/dist/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_training_page__remoteEntry_js-D0zbWJUR.mjs → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_training_page__remoteEntry_js-Cp9TxI8g.mjs} +1 -1
  19. package/package.json +1 -1
  20. package/dist/_virtual_mf___mfe_internal__addon_training_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-LhaXEy4l.mjs +0 -26
@@ -12170,6 +12170,167 @@ var ConvertResultSchema = object({
12170
12170
  files: array(string()).readonly()
12171
12171
  })).readonly()
12172
12172
  });
12173
+ /**
12174
+ * Device certificates (D855) — the wire contract shared by the hub, the admin
12175
+ * UI and the native viewer.
12176
+ *
12177
+ * A device (a phone) generates its OWN P-256 key pair in hardware (Secure
12178
+ * Enclave / Android Keystore / a non-extractable WebCrypto key). The private
12179
+ * key never travels. The hub signs the PUBLIC key into an X.509 leaf under a
12180
+ * dedicated device CA; the device later proves possession of the key by
12181
+ * signing a hub-issued nonce, and the hub answers with the same session a
12182
+ * password login opens.
12183
+ *
12184
+ * Everything on the wire is a small string (a PEM, a base64url signature):
12185
+ * D613 is about bulk bytes, and a certificate is ~600 bytes.
12186
+ */
12187
+ /** Signature algorithm of every device credential: ECDSA, curve P-256, SHA-256. */
12188
+ var DEVICE_CERT_SIGNATURE = "ecdsa-p256-sha256";
12189
+ /** First line of every signed message; a change of format bumps the version. */
12190
+ var DEVICE_SIGNATURE_MESSAGE_VERSION = "camstack-device-cert-v1";
12191
+ _enum([
12192
+ "login",
12193
+ "renew",
12194
+ "revoke"
12195
+ ]);
12196
+ var DevicePlatformSchema = _enum([
12197
+ "ios",
12198
+ "android",
12199
+ "web",
12200
+ "other"
12201
+ ]);
12202
+ var Base64UrlSchema = string().min(1).max(4096).regex(/^[A-Za-z0-9_-]+$/);
12203
+ var PemSchema = string().min(1).max(16384);
12204
+ /**
12205
+ * Why a device-certificate endpoint said no. Distinct from a transport / 5xx
12206
+ * failure: those carry no reason and mean "try again", never "the credential is
12207
+ * dead". The viewer switches on this exhaustively.
12208
+ */
12209
+ var DeviceRefusalReasonSchema = _enum([
12210
+ "revoked",
12211
+ "unknown-credential",
12212
+ "expired",
12213
+ "bad-signature",
12214
+ "nonce-invalid",
12215
+ "rate-limited",
12216
+ "invalid-certificate",
12217
+ "superseded",
12218
+ "user-gone",
12219
+ "unavailable",
12220
+ "code-invalid",
12221
+ "self-enrollment-disabled",
12222
+ "step-up-required",
12223
+ "bad-public-key"
12224
+ ]);
12225
+ var DeviceRefusalSchema = object({
12226
+ ok: literal(false),
12227
+ reason: DeviceRefusalReasonSchema,
12228
+ definitive: boolean(),
12229
+ retryAfterSeconds: number().optional()
12230
+ });
12231
+ object({
12232
+ code: string().min(1).max(256),
12233
+ /** SubjectPublicKeyInfo DER of the device's P-256 public key, base64url. */
12234
+ publicKeySpki: Base64UrlSchema,
12235
+ deviceName: string().min(1).max(80).optional(),
12236
+ platform: DevicePlatformSchema
12237
+ });
12238
+ discriminatedUnion("ok", [object({
12239
+ credentialId: string(),
12240
+ certPem: PemSchema,
12241
+ /** The device CA certificate the leaf chains to. */
12242
+ chainPem: PemSchema,
12243
+ notAfter: number(),
12244
+ user: object({
12245
+ id: string(),
12246
+ username: string()
12247
+ })
12248
+ }).extend({ ok: literal(true) }), DeviceRefusalSchema]);
12249
+ object({
12250
+ /** The single-use step-up proof (`auth.deviceEnrollProofFrom…`). */
12251
+ proof: string().min(1).max(512),
12252
+ publicKeySpki: Base64UrlSchema,
12253
+ deviceName: string().min(1).max(80),
12254
+ platform: DevicePlatformSchema
12255
+ });
12256
+ object({
12257
+ proof: string(),
12258
+ expiresAt: number()
12259
+ });
12260
+ discriminatedUnion("ok", [object({
12261
+ nonce: string(),
12262
+ /** The origin to put in the signed message. The app compares it to the hub it dialled. */
12263
+ origin: string(),
12264
+ expiresAt: number(),
12265
+ signature: literal(DEVICE_CERT_SIGNATURE)
12266
+ }).extend({ ok: literal(true) }), DeviceRefusalSchema]);
12267
+ object({
12268
+ certPem: PemSchema,
12269
+ nonce: string().min(1).max(256),
12270
+ /** ECDSA P-256 SHA-256 over {@link buildDeviceSignatureMessage}; raw r||s or DER, base64url. */
12271
+ signature: Base64UrlSchema
12272
+ });
12273
+ discriminatedUnion("ok", [object({
12274
+ credentialId: string(),
12275
+ certPem: PemSchema,
12276
+ chainPem: PemSchema,
12277
+ notAfter: number()
12278
+ }).extend({ ok: literal(true) }), DeviceRefusalSchema]);
12279
+ discriminatedUnion("ok", [object({
12280
+ ok: literal(true),
12281
+ credentialId: string(),
12282
+ sessionsEnded: number().int()
12283
+ }), DeviceRefusalSchema]);
12284
+ var DeviceCredentialStatusSchema = _enum([
12285
+ "active",
12286
+ "expired",
12287
+ "revoked"
12288
+ ]);
12289
+ var DeviceCredentialSchema = object({
12290
+ id: string(),
12291
+ userId: string(),
12292
+ username: string().nullable(),
12293
+ deviceName: string(),
12294
+ platform: DevicePlatformSchema,
12295
+ enrolledVia: _enum(["qr", "self"]),
12296
+ /** SHA-256 of the leaf certificate DER, colon-hex. */
12297
+ fingerprint: string(),
12298
+ issuedAt: number(),
12299
+ expiresAt: number(),
12300
+ lastUsedAt: number().nullable(),
12301
+ lastUsedFrom: string().nullable(),
12302
+ revokedAt: number().nullable(),
12303
+ /** `admin:<userId>` | `user:<userId>` | `device` | `user-deleted`. */
12304
+ revokedBy: string().nullable(),
12305
+ status: DeviceCredentialStatusSchema
12306
+ });
12307
+ var StartEnrollmentOutputSchema = object({
12308
+ /** Shown once; only its hash is kept. */
12309
+ code: string(),
12310
+ expiresAt: number(),
12311
+ /** `camstack://enroll?hub=…&code=…` — what the QR encodes. */
12312
+ enrollUrl: string(),
12313
+ /** The hub origin in the link, or `null` when the hub could not name one (the link then has no `hub`). */
12314
+ hubOrigin: string().nullable(),
12315
+ /** Every origin the apps may try (role `appConnections`). */
12316
+ hubOrigins: array(string())
12317
+ });
12318
+ object({
12319
+ kind: literal("device-certificate"),
12320
+ id: literal("device-certificate"),
12321
+ label: string(),
12322
+ stage: literal("primary"),
12323
+ /** tRPC paths under the hub's `auth` router, so a client names no literal. */
12324
+ challengePath: literal("auth.getDeviceChallenge"),
12325
+ revokePath: literal("auth.revokeOwnDeviceCertificate"),
12326
+ enrollSelfPath: literal("auth.enrollSelf"),
12327
+ loginPath: literal("auth.loginWithDeviceCertificate"),
12328
+ renewPath: literal("auth.renewDeviceCertificate"),
12329
+ signature: literal(DEVICE_CERT_SIGNATURE),
12330
+ messageVersion: literal(DEVICE_SIGNATURE_MESSAGE_VERSION),
12331
+ /** Which clients can execute it: a native app silently, a browser with a non-extractable WebCrypto key. */
12332
+ clients: array(_enum(["native", "web"]))
12333
+ });
12173
12334
  var ExpressionBindingSourceSchema = union([
12174
12335
  object({
12175
12336
  kind: literal("field").optional(),
@@ -15742,6 +15903,136 @@ method(object({
15742
15903
  kind: "mutation",
15743
15904
  auth: "admin"
15744
15905
  }), method(object({}), array(KeychainSecretMetaSchema).readonly(), { auth: "admin" }), method(object({}), KeychainStateSchema, { auth: "admin" });
15906
+ var DeviceCaStatusSchema = discriminatedUnion("state", [
15907
+ object({ state: literal("absent") }),
15908
+ object({
15909
+ state: literal("ready"),
15910
+ subject: string(),
15911
+ fingerprintSha256: string(),
15912
+ validTo: string()
15913
+ }),
15914
+ object({
15915
+ state: literal("unavailable"),
15916
+ reason: string()
15917
+ })
15918
+ ]);
15919
+ var DeviceCertificateSettingsSchema = object({ selfEnrollment: _enum(["allowed", "disabled"]) });
15920
+ method(object({
15921
+ userId: string().min(1).optional(),
15922
+ includeRevoked: boolean().default(false)
15923
+ }), array(DeviceCredentialSchema).readonly(), { auth: "admin" }), method(object({
15924
+ userId: string().min(1),
15925
+ deviceName: string().min(1).max(80)
15926
+ }), StartEnrollmentOutputSchema, {
15927
+ kind: "mutation",
15928
+ auth: "admin",
15929
+ caller: "required"
15930
+ }), method(object({ id: string().min(1) }), object({
15931
+ revoked: boolean(),
15932
+ sessionsEnded: number().int(),
15933
+ status: DeviceCredentialStatusSchema
15934
+ }), {
15935
+ kind: "mutation",
15936
+ auth: "admin",
15937
+ caller: "required"
15938
+ }), method(object({}), DeviceCertificateSettingsSchema, { auth: "admin" }), method(DeviceCertificateSettingsSchema, DeviceCertificateSettingsSchema, {
15939
+ kind: "mutation",
15940
+ auth: "admin"
15941
+ }), method(object({ id: string().min(1) }), object({ result: _enum([
15942
+ "deleted",
15943
+ "live",
15944
+ "unknown"
15945
+ ]) }), {
15946
+ kind: "mutation",
15947
+ auth: "admin",
15948
+ caller: "required"
15949
+ }), method(object({}), DeviceCaStatusSchema, { auth: "admin" }), method(object({
15950
+ id: string().min(1),
15951
+ deviceName: string().min(1).max(80)
15952
+ }), object({ renamed: boolean() }), {
15953
+ kind: "mutation",
15954
+ auth: "admin"
15955
+ });
15956
+ /**
15957
+ * `node-certificates` - what a node holds and the two renewals the hub drives
15958
+ * (D856): the node's MESH leaf (mutual TLS to the hub) and its HTTPS leaf (issued
15959
+ * from the hub's local CA so a device that trusts the hub root trusts the node).
15960
+ *
15961
+ * Provided by the AGENT RUNTIME (the synthetic `agent-runtime` addon id, like
15962
+ * `server-management`): the hub reaches it through the ordinary node-pinned
15963
+ * capability call - no new Moleculer action. The hub's own certificates are
15964
+ * handled in-process by the hub (`certificates` router), so this cap has no hub
15965
+ * provider.
15966
+ *
15967
+ * No private key ever crosses the mesh: the node generates its key pair, sends a
15968
+ * CSR, and the hub returns only the signed certificate.
15969
+ */
15970
+ var MeshLeafInfoSchema = object({
15971
+ cn: string(),
15972
+ serial: string(),
15973
+ fingerprintSha256: string(),
15974
+ notBefore: number(),
15975
+ notAfter: number()
15976
+ });
15977
+ var HttpsLeafInfoSchema = object({
15978
+ fingerprintSha256: string(),
15979
+ issuer: string(),
15980
+ sans: array(string()),
15981
+ notBefore: number(),
15982
+ notAfter: number()
15983
+ });
15984
+ var NodeHttpsStateSchema = discriminatedUnion("state", [object({
15985
+ state: literal("served"),
15986
+ leaf: HttpsLeafInfoSchema
15987
+ }), object({
15988
+ state: literal("not-issued"),
15989
+ reason: string()
15990
+ })]);
15991
+ method(object({}), object({
15992
+ nodeId: string(),
15993
+ mesh: MeshLeafInfoSchema.nullable(),
15994
+ https: NodeHttpsStateSchema
15995
+ }), { auth: "admin" }), method(object({}), object({ csrPem: string() }), {
15996
+ kind: "mutation",
15997
+ auth: "admin"
15998
+ }), method(object({
15999
+ certPem: string().min(1),
16000
+ caCertPem: string().min(1),
16001
+ confirmWithinMs: number().int().min(1e4).max(6e5)
16002
+ }), object({
16003
+ fingerprintSha256: string(),
16004
+ serial: string()
16005
+ }), {
16006
+ kind: "mutation",
16007
+ auth: "admin"
16008
+ }), method(object({ fingerprintSha256: string() }), object({ confirmed: boolean() }), {
16009
+ kind: "mutation",
16010
+ auth: "admin"
16011
+ }), method(object({}), object({ rolledBack: boolean() }), {
16012
+ kind: "mutation",
16013
+ auth: "admin"
16014
+ }), method(object({}), object({
16015
+ csrPem: string(),
16016
+ hostnames: array(string()),
16017
+ addresses: array(string()),
16018
+ /** SHA-256 of the hub local CA this node pinned at its first install; `null` before one. */
16019
+ pinnedCaFingerprintSha256: string().nullable()
16020
+ }), {
16021
+ kind: "mutation",
16022
+ auth: "admin"
16023
+ }), method(object({
16024
+ certPem: string().min(1),
16025
+ caCertPem: string().min(1),
16026
+ /**
16027
+ * The hub signals that its local CA was rotated (D227) and this leaf chains to the NEW
16028
+ * one. Only the hub, over the authenticated mesh, can say so; a leaf with a different CA
16029
+ * and no signal is refused.
16030
+ */
16031
+ caRotation: boolean().optional()
16032
+ }), HttpsLeafInfoSchema, {
16033
+ kind: "mutation",
16034
+ auth: "admin"
16035
+ });
15745
16036
  var KeychainKeySourceSchema = object({
15746
16037
  kind: _enum([
15747
16038
  "config-file",
@@ -61745,6 +62036,54 @@ Object.freeze({
61745
62036
  addonId: null,
61746
62037
  access: "create"
61747
62038
  },
62039
+ "deviceCredentials.deleteDeviceCredential": {
62040
+ capName: "device-credentials",
62041
+ capScope: "system",
62042
+ addonId: null,
62043
+ access: "delete"
62044
+ },
62045
+ "deviceCredentials.getDeviceCaStatus": {
62046
+ capName: "device-credentials",
62047
+ capScope: "system",
62048
+ addonId: null,
62049
+ access: "view"
62050
+ },
62051
+ "deviceCredentials.getDeviceCertificateSettings": {
62052
+ capName: "device-credentials",
62053
+ capScope: "system",
62054
+ addonId: null,
62055
+ access: "view"
62056
+ },
62057
+ "deviceCredentials.listDeviceCredentials": {
62058
+ capName: "device-credentials",
62059
+ capScope: "system",
62060
+ addonId: null,
62061
+ access: "view"
62062
+ },
62063
+ "deviceCredentials.renameDeviceCredential": {
62064
+ capName: "device-credentials",
62065
+ capScope: "system",
62066
+ addonId: null,
62067
+ access: "create"
62068
+ },
62069
+ "deviceCredentials.revokeDeviceCredential": {
62070
+ capName: "device-credentials",
62071
+ capScope: "system",
62072
+ addonId: null,
62073
+ access: "delete"
62074
+ },
62075
+ "deviceCredentials.setDeviceCertificateSettings": {
62076
+ capName: "device-credentials",
62077
+ capScope: "system",
62078
+ addonId: null,
62079
+ access: "create"
62080
+ },
62081
+ "deviceCredentials.startEnrollment": {
62082
+ capName: "device-credentials",
62083
+ capScope: "system",
62084
+ addonId: null,
62085
+ access: "create"
62086
+ },
61748
62087
  "deviceDiscovery.adoptDevice": {
61749
62088
  capName: "device-discovery",
61750
62089
  capScope: "device",
@@ -63905,6 +64244,48 @@ Object.freeze({
63905
64244
  addonId: null,
63906
64245
  access: "create"
63907
64246
  },
64247
+ "nodeCertificates.confirmMeshLeaf": {
64248
+ capName: "node-certificates",
64249
+ capScope: "system",
64250
+ addonId: null,
64251
+ access: "create"
64252
+ },
64253
+ "nodeCertificates.getCertificates": {
64254
+ capName: "node-certificates",
64255
+ capScope: "system",
64256
+ addonId: null,
64257
+ access: "view"
64258
+ },
64259
+ "nodeCertificates.installHttpsCertificate": {
64260
+ capName: "node-certificates",
64261
+ capScope: "system",
64262
+ addonId: null,
64263
+ access: "create"
64264
+ },
64265
+ "nodeCertificates.installMeshLeaf": {
64266
+ capName: "node-certificates",
64267
+ capScope: "system",
64268
+ addonId: null,
64269
+ access: "create"
64270
+ },
64271
+ "nodeCertificates.prepareHttpsCertificate": {
64272
+ capName: "node-certificates",
64273
+ capScope: "system",
64274
+ addonId: null,
64275
+ access: "create"
64276
+ },
64277
+ "nodeCertificates.prepareMeshRenewal": {
64278
+ capName: "node-certificates",
64279
+ capScope: "system",
64280
+ addonId: null,
64281
+ access: "create"
64282
+ },
64283
+ "nodeCertificates.rollbackMeshLeaf": {
64284
+ capName: "node-certificates",
64285
+ capScope: "system",
64286
+ addonId: null,
64287
+ access: "create"
64288
+ },
63908
64289
  "nodes.clusterAddonStatus": {
63909
64290
  capName: "nodes",
63910
64291
  capScope: "system",