@structured-id/proto 0.10.0 → 0.12.0

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.
@@ -5,7 +5,14 @@ import type { BinaryReadOptions } from "@protobuf-ts/runtime";
5
5
  import type { IBinaryReader } from "@protobuf-ts/runtime";
6
6
  import type { PartialMessage } from "@protobuf-ts/runtime";
7
7
  import { MessageType } from "@protobuf-ts/runtime";
8
+ import { DeviceId } from "../ids/ids.js";
9
+ import { SessionId } from "../ids/ids.js";
10
+ import { CredentialId } from "../ids/ids.js";
11
+ import { ProfilePhoneId } from "../ids/ids.js";
12
+ import { ProfileEmailId } from "../ids/ids.js";
13
+ import { PrincipalId } from "../ids/ids.js";
8
14
  import { Timestamp } from "../../../google/protobuf/timestamp.js";
15
+ import { ProfileId } from "../ids/ids.js";
9
16
  /**
10
17
  * Profile represents a user identity in StructuredID: the Profile is the
11
18
  * user (there is no separate User entity).
@@ -14,11 +21,12 @@ import { Timestamp } from "../../../google/protobuf/timestamp.js";
14
21
  */
15
22
  export interface Profile {
16
23
  /**
17
- * Unique identifier (UUIDv7).
24
+ * The Profile, issued by SID at its creation. Internal to the
25
+ * installation; an external service never receives it.
18
26
  *
19
- * @generated from protobuf field: string id = 1
27
+ * @generated from protobuf field: sid.v1.ids.ProfileId id = 21
20
28
  */
21
- id: string;
29
+ id?: ProfileId;
22
30
  /**
23
31
  * Profile type (personal or corporate).
24
32
  *
@@ -128,11 +136,11 @@ export interface Profile {
128
136
  */
129
137
  export interface Principal {
130
138
  /**
131
- * Unique principal identifier (UUIDv7).
139
+ * The login handle, issued by SID when the Profile claimed it.
132
140
  *
133
- * @generated from protobuf field: string id = 1
141
+ * @generated from protobuf field: sid.v1.ids.PrincipalId id = 13
134
142
  */
135
- id: string;
143
+ id?: PrincipalId;
136
144
  /**
137
145
  * Principal type: email, phone, username, face_embedding, nfc_tag.
138
146
  *
@@ -175,13 +183,13 @@ export interface Principal {
175
183
  */
176
184
  sourceField?: string;
177
185
  /**
178
- * The ProfileEmail (UUID) whose address this email handle delivers to,
179
- * in the spelling given; absent for other types and for a handle whose
180
- * address is not known.
186
+ * The ProfileEmail whose address this email handle delivers to, in the
187
+ * spelling given; absent for other types and for a handle whose address is
188
+ * not known.
181
189
  *
182
- * @generated from protobuf field: optional string source_email_id = 11
190
+ * @generated from protobuf field: sid.v1.ids.ProfileEmailId source_email_id = 14
183
191
  */
184
- sourceEmailId?: string;
192
+ sourceEmailId?: ProfileEmailId;
185
193
  /**
186
194
  * An email handle written before the installation's email policy
187
195
  * revisions, its address unknown: still reserved for the account, but no
@@ -200,9 +208,11 @@ export interface Principal {
200
208
  */
201
209
  export interface ProfilePhone {
202
210
  /**
203
- * @generated from protobuf field: string id = 1
211
+ * The phone record, issued by SID when it was added.
212
+ *
213
+ * @generated from protobuf field: sid.v1.ids.ProfilePhoneId id = 12
204
214
  */
205
- id: string;
215
+ id?: ProfilePhoneId;
206
216
  /**
207
217
  * @generated from protobuf field: uint64 e164 = 2
208
218
  */
@@ -252,9 +262,11 @@ export interface ProfilePhone {
252
262
  */
253
263
  export interface ProfileEmail {
254
264
  /**
255
- * @generated from protobuf field: string id = 1
265
+ * The email record, issued by SID when it was added.
266
+ *
267
+ * @generated from protobuf field: sid.v1.ids.ProfileEmailId id = 8
256
268
  */
257
- id: string;
269
+ id?: ProfileEmailId;
258
270
  /**
259
271
  * @generated from protobuf field: string email = 2
260
272
  */
@@ -281,19 +293,18 @@ export interface ProfileEmail {
281
293
  verifiedAt?: Timestamp;
282
294
  }
283
295
  /**
284
- * Credential represents an authentication factor.
296
+ * Credential represents an authentication factor of the Profile the listing
297
+ * named.
285
298
  *
286
299
  * @generated from protobuf message sid.v1.identity.Credential
287
300
  */
288
301
  export interface Credential {
289
302
  /**
290
- * @generated from protobuf field: string id = 1
291
- */
292
- id: string;
293
- /**
294
- * @generated from protobuf field: string profile_id = 2
303
+ * The credential, issued by SID when it was added.
304
+ *
305
+ * @generated from protobuf field: sid.v1.ids.CredentialId id = 10
295
306
  */
296
- profileId: string;
307
+ id?: CredentialId;
297
308
  /**
298
309
  * @generated from protobuf field: sid.v1.identity.CredentialType type = 3
299
310
  */
@@ -406,34 +417,32 @@ export interface WebAuthnCredentialInfo {
406
417
  userVerified: boolean;
407
418
  }
408
419
  /**
409
- * Session represents an active user session.
420
+ * Session represents an active session of the Profile the listing named.
410
421
  *
411
422
  * @generated from protobuf message sid.v1.identity.Session
412
423
  */
413
424
  export interface Session {
414
425
  /**
415
- * @generated from protobuf field: string id = 1
416
- */
417
- id: string;
418
- /**
419
- * @generated from protobuf field: string profile_id = 2
426
+ * The session, issued by SID when it opened.
427
+ *
428
+ * @generated from protobuf field: sid.v1.ids.SessionId id = 11
420
429
  */
421
- profileId: string;
430
+ id?: SessionId;
422
431
  /**
423
- * Client info.
432
+ * OAuth `client_id` (RFC 6749 §2.2) of the client the session was opened
433
+ * for: the protocol's own text.
424
434
  *
425
435
  * @generated from protobuf field: string client_id = 3
426
436
  */
427
437
  clientId: string;
428
438
  /**
429
- * Device the session was issued on (`Device.id`, UUIDv7); unset when the
430
- * session is not associated with a registered device. A revocation
431
- * association (removing the device ends the session), not proof of key
432
- * possession.
439
+ * Device the session was issued on (`Device.id`); unset when the session
440
+ * is not associated with a registered device. A revocation association
441
+ * (removing the device ends the session), not proof of key possession.
433
442
  *
434
- * @generated from protobuf field: optional string device_id = 4
443
+ * @generated from protobuf field: sid.v1.ids.DeviceId device_id = 12
435
444
  */
436
- deviceId?: string;
445
+ deviceId?: DeviceId;
437
446
  /**
438
447
  * Session metadata.
439
448
  *
@@ -525,11 +534,12 @@ export interface CreateProfileRequest {
525
534
  */
526
535
  inviteCode?: string;
527
536
  /**
528
- * Optional referrer profile ID (tracked for analytics).
537
+ * The Profile that referred this registration, tracked for analytics;
538
+ * absent when none did. It must name an existing Profile.
529
539
  *
530
- * @generated from protobuf field: optional string referrer_id = 11
540
+ * @generated from protobuf field: sid.v1.ids.ProfileId referrer_id = 18
531
541
  */
532
- referrerId?: string;
542
+ referrerId?: ProfileId;
533
543
  /**
534
544
  * Optional UTM parameters captured from registration URL.
535
545
  *
@@ -583,18 +593,24 @@ export interface GetProfileRequest {
583
593
  identifier: {
584
594
  oneofKind: "id";
585
595
  /**
586
- * @generated from protobuf field: string id = 1
596
+ * The Profile itself.
597
+ *
598
+ * @generated from protobuf field: sid.v1.ids.ProfileId id = 4
587
599
  */
588
- id: string;
600
+ id: ProfileId;
589
601
  } | {
590
602
  oneofKind: "username";
591
603
  /**
604
+ * A username handle the Profile claims.
605
+ *
592
606
  * @generated from protobuf field: string username = 2
593
607
  */
594
608
  username: string;
595
609
  } | {
596
610
  oneofKind: "email";
597
611
  /**
612
+ * An email handle the Profile claims.
613
+ *
598
614
  * @generated from protobuf field: string email = 3
599
615
  */
600
616
  email: string;
@@ -623,9 +639,11 @@ export interface GetProfileResponse {
623
639
  */
624
640
  export interface UpdateProfileRequest {
625
641
  /**
626
- * @generated from protobuf field: string id = 1
642
+ * The Profile to update.
643
+ *
644
+ * @generated from protobuf field: sid.v1.ids.ProfileId id = 8
627
645
  */
628
- id: string;
646
+ id?: ProfileId;
629
647
  /**
630
648
  * @generated from protobuf field: optional string given_name = 2
631
649
  */
@@ -665,9 +683,11 @@ export interface UpdateProfileResponse {
665
683
  */
666
684
  export interface DeleteProfileRequest {
667
685
  /**
668
- * @generated from protobuf field: string id = 1
686
+ * The Profile to delete.
687
+ *
688
+ * @generated from protobuf field: sid.v1.ids.ProfileId id = 2
669
689
  */
670
- id: string;
690
+ id?: ProfileId;
671
691
  }
672
692
  /**
673
693
  * @generated from protobuf message sid.v1.identity.DeleteProfileResponse
@@ -705,9 +725,12 @@ export interface ListProfilesResponse {
705
725
  */
706
726
  export interface AddCredentialRequest {
707
727
  /**
708
- * @generated from protobuf field: string profile_id = 1
728
+ * The Profile to add to; absent for the caller's own (resolved from its
729
+ * session). Another Profile requires administrator authority.
730
+ *
731
+ * @generated from protobuf field: sid.v1.ids.ProfileId profile_id = 5
709
732
  */
710
- profileId: string;
733
+ profileId?: ProfileId;
711
734
  /**
712
735
  * @generated from protobuf field: sid.v1.identity.CredentialType type = 2
713
736
  */
@@ -735,9 +758,12 @@ export interface AddCredentialResponse {
735
758
  */
736
759
  export interface ListCredentialsRequest {
737
760
  /**
738
- * @generated from protobuf field: string profile_id = 1
761
+ * The Profile whose credentials to list; absent for the caller's own.
762
+ * Another Profile requires administrator authority.
763
+ *
764
+ * @generated from protobuf field: sid.v1.ids.ProfileId profile_id = 2
739
765
  */
740
- profileId: string;
766
+ profileId?: ProfileId;
741
767
  }
742
768
  /**
743
769
  * @generated from protobuf message sid.v1.identity.ListCredentialsResponse
@@ -753,9 +779,11 @@ export interface ListCredentialsResponse {
753
779
  */
754
780
  export interface UpdateCredentialRequest {
755
781
  /**
756
- * @generated from protobuf field: string credential_id = 1
782
+ * The credential to update (`Credential.id`).
783
+ *
784
+ * @generated from protobuf field: sid.v1.ids.CredentialId credential_id = 3
757
785
  */
758
- credentialId: string;
786
+ credentialId?: CredentialId;
759
787
  /**
760
788
  * Currently only label can be updated.
761
789
  * Cryptographic material is immutable after registration.
@@ -778,9 +806,11 @@ export interface UpdateCredentialResponse {
778
806
  */
779
807
  export interface RevokeCredentialRequest {
780
808
  /**
781
- * @generated from protobuf field: string credential_id = 1
809
+ * The credential to revoke (`Credential.id`).
810
+ *
811
+ * @generated from protobuf field: sid.v1.ids.CredentialId credential_id = 2
782
812
  */
783
- credentialId: string;
813
+ credentialId?: CredentialId;
784
814
  }
785
815
  /**
786
816
  * @generated from protobuf message sid.v1.identity.RevokeCredentialResponse
@@ -792,9 +822,12 @@ export interface RevokeCredentialResponse {
792
822
  */
793
823
  export interface ListSessionsRequest {
794
824
  /**
795
- * @generated from protobuf field: string profile_id = 1
825
+ * The Profile whose sessions to list; absent for the caller's own.
826
+ * Another Profile requires administrator authority.
827
+ *
828
+ * @generated from protobuf field: sid.v1.ids.ProfileId profile_id = 2
796
829
  */
797
- profileId: string;
830
+ profileId?: ProfileId;
798
831
  }
799
832
  /**
800
833
  * @generated from protobuf message sid.v1.identity.ListSessionsResponse
@@ -810,9 +843,11 @@ export interface ListSessionsResponse {
810
843
  */
811
844
  export interface RevokeSessionRequest {
812
845
  /**
813
- * @generated from protobuf field: string session_id = 1
846
+ * The session to end (`Session.id`).
847
+ *
848
+ * @generated from protobuf field: sid.v1.ids.SessionId session_id = 2
814
849
  */
815
- sessionId: string;
850
+ sessionId?: SessionId;
816
851
  }
817
852
  /**
818
853
  * @generated from protobuf message sid.v1.identity.RevokeSessionResponse
@@ -824,9 +859,12 @@ export interface RevokeSessionResponse {
824
859
  */
825
860
  export interface AddPrincipalRequest {
826
861
  /**
827
- * @generated from protobuf field: string profile_id = 1
862
+ * The Profile to add to; absent for the caller's own. Another Profile
863
+ * requires administrator authority.
864
+ *
865
+ * @generated from protobuf field: sid.v1.ids.ProfileId profile_id = 4
828
866
  */
829
- profileId: string;
867
+ profileId?: ProfileId;
830
868
  /**
831
869
  * @generated from protobuf field: sid.v1.identity.PrincipalType type = 2
832
870
  */
@@ -850,9 +888,12 @@ export interface AddPrincipalResponse {
850
888
  */
851
889
  export interface ListPrincipalsRequest {
852
890
  /**
853
- * @generated from protobuf field: string profile_id = 1
891
+ * The Profile whose principals to list; absent for the caller's own.
892
+ * Another Profile requires administrator authority.
893
+ *
894
+ * @generated from protobuf field: sid.v1.ids.ProfileId profile_id = 2
854
895
  */
855
- profileId: string;
896
+ profileId?: ProfileId;
856
897
  }
857
898
  /**
858
899
  * @generated from protobuf message sid.v1.identity.ListPrincipalsResponse
@@ -868,9 +909,11 @@ export interface ListPrincipalsResponse {
868
909
  */
869
910
  export interface RemovePrincipalRequest {
870
911
  /**
871
- * @generated from protobuf field: string principal_id = 1
912
+ * The principal to remove (`Principal.id`).
913
+ *
914
+ * @generated from protobuf field: sid.v1.ids.PrincipalId principal_id = 2
872
915
  */
873
- principalId: string;
916
+ principalId?: PrincipalId;
874
917
  }
875
918
  /**
876
919
  * @generated from protobuf message sid.v1.identity.RemovePrincipalResponse
@@ -935,9 +978,11 @@ export interface RecordPasskeyPromptDismissalResponse {
935
978
  */
936
979
  export interface RevokeProfileRequest {
937
980
  /**
938
- * @generated from protobuf field: string profile_id = 1
981
+ * The Profile to revoke, named explicitly even by its owner.
982
+ *
983
+ * @generated from protobuf field: sid.v1.ids.ProfileId profile_id = 3
939
984
  */
940
- profileId: string;
985
+ profileId?: ProfileId;
941
986
  /**
942
987
  * @generated from protobuf field: string reason = 2
943
988
  */
@@ -970,13 +1015,11 @@ export interface RequestClosureRequest {
970
1015
  courtReference?: string;
971
1016
  }
972
1017
  /**
1018
+ * The closure of the caller's own Profile.
1019
+ *
973
1020
  * @generated from protobuf message sid.v1.identity.RequestClosureResponse
974
1021
  */
975
1022
  export interface RequestClosureResponse {
976
- /**
977
- * @generated from protobuf field: string profile_id = 1
978
- */
979
- profileId: string;
980
1023
  /**
981
1024
  * @generated from protobuf field: sid.v1.identity.ClosureMode mode = 2
982
1025
  */
@@ -1045,10 +1088,6 @@ export interface PrepareExportRequest {
1045
1088
  * @generated from protobuf message sid.v1.identity.PrepareExportResponse
1046
1089
  */
1047
1090
  export interface PrepareExportResponse {
1048
- /**
1049
- * @generated from protobuf field: string export_id = 1
1050
- */
1051
- exportId: string;
1052
1091
  /**
1053
1092
  * @generated from protobuf field: google.protobuf.Timestamp estimated_ready = 2
1054
1093
  */
@@ -1076,11 +1115,12 @@ export interface GetExportStatusResponse {
1076
1115
  */
1077
1116
  sizeBytes?: bigint;
1078
1117
  /**
1079
- * SHA-256 checksum of the export archive. Set when status >= READY.
1118
+ * SHA-256 digest (FIPS 180-4) of the export archive, the 32 raw bytes.
1119
+ * Set when status >= READY.
1080
1120
  *
1081
- * @generated from protobuf field: optional string checksum_sha256 = 3
1121
+ * @generated from protobuf field: optional bytes checksum_sha256 = 6
1082
1122
  */
1083
- checksumSha256?: string;
1123
+ checksumSha256?: Uint8Array;
1084
1124
  /**
1085
1125
  * Timestamp when the export became ready for download.
1086
1126
  *
@@ -1129,21 +1169,14 @@ export interface AcknowledgeExportRequest {
1129
1169
  */
1130
1170
  export interface Device {
1131
1171
  /**
1132
- * Device identifier: UUIDv7 in canonical lowercase hyphenated form. Issued by
1133
- * SID when the device is registered in the owning Profile's scope; the same
1134
- * value is carried as `device_id` in session and attestation messages.
1135
- * Knowing it grants no authority and does not prove key possession.
1136
- *
1137
- * @generated from protobuf field: string id = 1
1138
- */
1139
- id: string;
1140
- /**
1141
- * Owning Profile identifier (UUIDv7). Internal identity; never exposed to
1142
- * external or federated services.
1172
+ * The device, issued by SID when it is registered in the owning Profile's
1173
+ * scope; the same value is carried as `device_id` in session and
1174
+ * attestation messages. Knowing it grants no authority and does not prove
1175
+ * key possession.
1143
1176
  *
1144
- * @generated from protobuf field: string profile_id = 2
1177
+ * @generated from protobuf field: sid.v1.ids.DeviceId id = 12
1145
1178
  */
1146
- profileId: string;
1179
+ id?: DeviceId;
1147
1180
  /**
1148
1181
  * User-given label for the device (e.g. "Work laptop"). Set by the Profile
1149
1182
  * owner via UpdateDevice; unset until the user names the device.
@@ -1211,12 +1244,12 @@ export interface Device {
1211
1244
  */
1212
1245
  export interface ListDevicesRequest {
1213
1246
  /**
1214
- * Profile whose devices to list (UUIDv7). Must match the caller's
1215
- * authorized Profile scope.
1247
+ * The Profile whose devices to list; absent for the caller's own. Another
1248
+ * Profile requires administrator authority.
1216
1249
  *
1217
- * @generated from protobuf field: string profile_id = 1
1250
+ * @generated from protobuf field: sid.v1.ids.ProfileId profile_id = 2
1218
1251
  */
1219
- profileId: string;
1252
+ profileId?: ProfileId;
1220
1253
  }
1221
1254
  /**
1222
1255
  * @generated from protobuf message sid.v1.identity.ListDevicesResponse
@@ -1234,24 +1267,24 @@ export interface ListDevicesResponse {
1234
1267
  */
1235
1268
  export interface GetDeviceRequest {
1236
1269
  /**
1237
- * Device to fetch (`Device.id`, UUIDv7). Must belong to the caller's
1238
- * authorized Profile scope.
1270
+ * Device to fetch (`Device.id`). Must belong to the caller's authorized
1271
+ * Profile scope.
1239
1272
  *
1240
- * @generated from protobuf field: string device_id = 1
1273
+ * @generated from protobuf field: sid.v1.ids.DeviceId device_id = 2
1241
1274
  */
1242
- deviceId: string;
1275
+ deviceId?: DeviceId;
1243
1276
  }
1244
1277
  /**
1245
1278
  * @generated from protobuf message sid.v1.identity.UpdateDeviceRequest
1246
1279
  */
1247
1280
  export interface UpdateDeviceRequest {
1248
1281
  /**
1249
- * Device to update (`Device.id`, UUIDv7). Must belong to the caller's
1250
- * authorized Profile scope.
1282
+ * Device to update (`Device.id`). Must belong to the caller's authorized
1283
+ * Profile scope.
1251
1284
  *
1252
- * @generated from protobuf field: string device_id = 1
1285
+ * @generated from protobuf field: sid.v1.ids.DeviceId device_id = 3
1253
1286
  */
1254
- deviceId: string;
1287
+ deviceId?: DeviceId;
1255
1288
  /**
1256
1289
  * New user-given label; unset leaves the current label unchanged.
1257
1290
  *
@@ -1264,34 +1297,34 @@ export interface UpdateDeviceRequest {
1264
1297
  */
1265
1298
  export interface RemoveDeviceRequest {
1266
1299
  /**
1267
- * Device to remove (`Device.id`, UUIDv7). Removal kills the device's
1268
- * sessions and revokes its keys in sid-attestation.
1300
+ * Device to remove (`Device.id`). Removal kills the device's sessions and
1301
+ * revokes its keys in sid-attestation.
1269
1302
  *
1270
- * @generated from protobuf field: string device_id = 1
1303
+ * @generated from protobuf field: sid.v1.ids.DeviceId device_id = 2
1271
1304
  */
1272
- deviceId: string;
1305
+ deviceId?: DeviceId;
1273
1306
  }
1274
1307
  /**
1275
1308
  * @generated from protobuf message sid.v1.identity.TrustDeviceRequest
1276
1309
  */
1277
1310
  export interface TrustDeviceRequest {
1278
1311
  /**
1279
- * Device the Profile owner marks as trusted (`Device.id`, UUIDv7).
1312
+ * Device the Profile owner marks as trusted (`Device.id`).
1280
1313
  *
1281
- * @generated from protobuf field: string device_id = 1
1314
+ * @generated from protobuf field: sid.v1.ids.DeviceId device_id = 2
1282
1315
  */
1283
- deviceId: string;
1316
+ deviceId?: DeviceId;
1284
1317
  }
1285
1318
  /**
1286
1319
  * @generated from protobuf message sid.v1.identity.RevokeDeviceTrustRequest
1287
1320
  */
1288
1321
  export interface RevokeDeviceTrustRequest {
1289
1322
  /**
1290
- * Device whose explicit trust is withdrawn (`Device.id`, UUIDv7).
1323
+ * Device whose explicit trust is withdrawn (`Device.id`).
1291
1324
  *
1292
- * @generated from protobuf field: string device_id = 1
1325
+ * @generated from protobuf field: sid.v1.ids.DeviceId device_id = 2
1293
1326
  */
1294
- deviceId: string;
1327
+ deviceId?: DeviceId;
1295
1328
  }
1296
1329
  /**
1297
1330
  * @generated from protobuf enum sid.v1.identity.PrincipalType