@structured-id/proto 0.15.0 → 0.17.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.
Files changed (41) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/generated/sid/v1/admin/admin.d.ts +48 -17
  3. package/dist/generated/sid/v1/admin/admin.js +55 -62
  4. package/dist/generated/sid/v1/admin/admin.js.map +1 -1
  5. package/dist/generated/sid/v1/admin/branding.d.ts +54 -26
  6. package/dist/generated/sid/v1/admin/branding.js +87 -98
  7. package/dist/generated/sid/v1/admin/branding.js.map +1 -1
  8. package/dist/generated/sid/v1/admin/enrollment.d.ts +63 -44
  9. package/dist/generated/sid/v1/admin/enrollment.js +109 -107
  10. package/dist/generated/sid/v1/admin/enrollment.js.map +1 -1
  11. package/dist/generated/sid/v1/admin/flow.d.ts +90 -42
  12. package/dist/generated/sid/v1/admin/flow.js +143 -155
  13. package/dist/generated/sid/v1/admin/flow.js.map +1 -1
  14. package/dist/generated/sid/v1/admin/security.d.ts +11 -4
  15. package/dist/generated/sid/v1/admin/security.js +14 -14
  16. package/dist/generated/sid/v1/admin/security.js.map +1 -1
  17. package/dist/generated/sid/v1/admin/sessions.d.ts +18 -8
  18. package/dist/generated/sid/v1/admin/sessions.js +27 -29
  19. package/dist/generated/sid/v1/admin/sessions.js.map +1 -1
  20. package/dist/generated/sid/v1/attestation/attestation.client.d.ts +51 -17
  21. package/dist/generated/sid/v1/attestation/attestation.client.js +50 -12
  22. package/dist/generated/sid/v1/attestation/attestation.client.js.map +1 -1
  23. package/dist/generated/sid/v1/attestation/attestation.d.ts +257 -51
  24. package/dist/generated/sid/v1/attestation/attestation.js +321 -135
  25. package/dist/generated/sid/v1/attestation/attestation.js.map +1 -1
  26. package/dist/generated/sid/v1/authn/auth.d.ts +13 -7
  27. package/dist/generated/sid/v1/authn/auth.js +20 -20
  28. package/dist/generated/sid/v1/authn/auth.js.map +1 -1
  29. package/dist/generated/sid/v1/common/types.d.ts +29 -0
  30. package/dist/generated/sid/v1/common/types.js +47 -0
  31. package/dist/generated/sid/v1/common/types.js.map +1 -1
  32. package/dist/generated/sid/v1/federation/upstream.d.ts +34 -16
  33. package/dist/generated/sid/v1/federation/upstream.js +53 -59
  34. package/dist/generated/sid/v1/federation/upstream.js.map +1 -1
  35. package/dist/generated/sid/v1/ids/ids.d.ts +12 -0
  36. package/dist/generated/sid/v1/ids/ids.js +6 -0
  37. package/dist/generated/sid/v1/ids/ids.js.map +1 -1
  38. package/dist/ip.d.ts +31 -0
  39. package/dist/ip.js +84 -0
  40. package/dist/ip.js.map +1 -0
  41. package/package.json +6 -2
@@ -10,6 +10,10 @@ export declare const ProfilePhoneId: MessageType<wire.ProfilePhoneId>;
10
10
  export type ProfilePhoneId = wire.ProfilePhoneId;
11
11
  export declare const DeviceId: MessageType<wire.DeviceId>;
12
12
  export type DeviceId = wire.DeviceId;
13
+ export declare const DeviceEnrollmentId: MessageType<wire.DeviceEnrollmentId>;
14
+ export type DeviceEnrollmentId = wire.DeviceEnrollmentId;
15
+ export declare const DeviceAttestationId: MessageType<wire.DeviceAttestationId>;
16
+ export type DeviceAttestationId = wire.DeviceAttestationId;
13
17
  export declare const BindingId: MessageType<wire.BindingId>;
14
18
  export type BindingId = wire.BindingId;
15
19
  export declare const OrgId: MessageType<wire.OrgId>;
@@ -60,3 +64,11 @@ export declare const InitialAccessTokenId: MessageType<wire.InitialAccessTokenId
60
64
  export type InitialAccessTokenId = wire.InitialAccessTokenId;
61
65
  export declare const PatId: MessageType<wire.PatId>;
62
66
  export type PatId = wire.PatId;
67
+ export declare const BrandingConfigId: MessageType<wire.BrandingConfigId>;
68
+ export type BrandingConfigId = wire.BrandingConfigId;
69
+ export declare const FlowActionId: MessageType<wire.FlowActionId>;
70
+ export type FlowActionId = wire.FlowActionId;
71
+ export declare const InviteId: MessageType<wire.InviteId>;
72
+ export type InviteId = wire.InviteId;
73
+ export declare const UpstreamProviderId: MessageType<wire.UpstreamProviderId>;
74
+ export type UpstreamProviderId = wire.UpstreamProviderId;
@@ -4,6 +4,8 @@ export const PrincipalId = wire.PrincipalId;
4
4
  export const ProfileEmailId = wire.ProfileEmailId;
5
5
  export const ProfilePhoneId = wire.ProfilePhoneId;
6
6
  export const DeviceId = wire.DeviceId;
7
+ export const DeviceEnrollmentId = wire.DeviceEnrollmentId;
8
+ export const DeviceAttestationId = wire.DeviceAttestationId;
7
9
  export const BindingId = wire.BindingId;
8
10
  export const OrgId = wire.OrgId;
9
11
  export const IssuerId = wire.IssuerId;
@@ -29,4 +31,8 @@ export const CedarPolicyId = wire.CedarPolicyId;
29
31
  export const AccessRequestId = wire.AccessRequestId;
30
32
  export const InitialAccessTokenId = wire.InitialAccessTokenId;
31
33
  export const PatId = wire.PatId;
34
+ export const BrandingConfigId = wire.BrandingConfigId;
35
+ export const FlowActionId = wire.FlowActionId;
36
+ export const InviteId = wire.InviteId;
37
+ export const UpstreamProviderId = wire.UpstreamProviderId;
32
38
  //# sourceMappingURL=ids.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ids.js","sourceRoot":"","sources":["../../../../../src/generated/sid/v1/ids/ids.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C,MAAM,CAAC,MAAM,SAAS,GAAgC,IAAI,CAAC,SAAS,CAAC;AAErE,MAAM,CAAC,MAAM,WAAW,GAAkC,IAAI,CAAC,WAAW,CAAC;AAE3E,MAAM,CAAC,MAAM,cAAc,GAAqC,IAAI,CAAC,cAAc,CAAC;AAEpF,MAAM,CAAC,MAAM,cAAc,GAAqC,IAAI,CAAC,cAAc,CAAC;AAEpF,MAAM,CAAC,MAAM,QAAQ,GAA+B,IAAI,CAAC,QAAQ,CAAC;AAElE,MAAM,CAAC,MAAM,SAAS,GAAgC,IAAI,CAAC,SAAS,CAAC;AAErE,MAAM,CAAC,MAAM,KAAK,GAA4B,IAAI,CAAC,KAAK,CAAC;AAEzD,MAAM,CAAC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,IAAI,CAAC,aAAa,CAAC;AAEjF,MAAM,CAAC,MAAM,eAAe,GAAsC,IAAI,CAAC,eAAe,CAAC;AAEvF,MAAM,CAAC,MAAM,oBAAoB,GAA2C,IAAI,CAAC,oBAAoB,CAAC;AAEtG,MAAM,CAAC,MAAM,KAAK,GAA4B,IAAI,CAAC,KAAK,CAAC","sourcesContent":["// The sid.v1.ids messages are owned by @structured-id/ids; this module\n// re-exports its objects so generated messages that carry an identifier\n// share them instead of a second generated copy.\nimport type { MessageType } from \"@protobuf-ts/runtime\";\nimport { wire } from \"@structured-id/ids\";\n\nexport const ProfileId: MessageType<wire.ProfileId> = wire.ProfileId;\nexport type ProfileId = wire.ProfileId;\nexport const PrincipalId: MessageType<wire.PrincipalId> = wire.PrincipalId;\nexport type PrincipalId = wire.PrincipalId;\nexport const ProfileEmailId: MessageType<wire.ProfileEmailId> = wire.ProfileEmailId;\nexport type ProfileEmailId = wire.ProfileEmailId;\nexport const ProfilePhoneId: MessageType<wire.ProfilePhoneId> = wire.ProfilePhoneId;\nexport type ProfilePhoneId = wire.ProfilePhoneId;\nexport const DeviceId: MessageType<wire.DeviceId> = wire.DeviceId;\nexport type DeviceId = wire.DeviceId;\nexport const BindingId: MessageType<wire.BindingId> = wire.BindingId;\nexport type BindingId = wire.BindingId;\nexport const OrgId: MessageType<wire.OrgId> = wire.OrgId;\nexport type OrgId = wire.OrgId;\nexport const IssuerId: MessageType<wire.IssuerId> = wire.IssuerId;\nexport type IssuerId = wire.IssuerId;\nexport const ApplicationId: MessageType<wire.ApplicationId> = wire.ApplicationId;\nexport type ApplicationId = wire.ApplicationId;\nexport const PasswordOperationId: MessageType<wire.PasswordOperationId> = wire.PasswordOperationId;\nexport type PasswordOperationId = wire.PasswordOperationId;\nexport const OpaqueLoginId: MessageType<wire.OpaqueLoginId> = wire.OpaqueLoginId;\nexport type OpaqueLoginId = wire.OpaqueLoginId;\nexport const SessionId: MessageType<wire.SessionId> = wire.SessionId;\nexport type SessionId = wire.SessionId;\nexport const CredentialId: MessageType<wire.CredentialId> = wire.CredentialId;\nexport type CredentialId = wire.CredentialId;\nexport const OtpSessionId: MessageType<wire.OtpSessionId> = wire.OtpSessionId;\nexport type OtpSessionId = wire.OtpSessionId;\nexport const MagicLinkId: MessageType<wire.MagicLinkId> = wire.MagicLinkId;\nexport type MagicLinkId = wire.MagicLinkId;\nexport const StepUpChallengeId: MessageType<wire.StepUpChallengeId> = wire.StepUpChallengeId;\nexport type StepUpChallengeId = wire.StepUpChallengeId;\nexport const ResetSessionId: MessageType<wire.ResetSessionId> = wire.ResetSessionId;\nexport type ResetSessionId = wire.ResetSessionId;\nexport const ImportedPasswordUpgradeId: MessageType<wire.ImportedPasswordUpgradeId> = wire.ImportedPasswordUpgradeId;\nexport type ImportedPasswordUpgradeId = wire.ImportedPasswordUpgradeId;\nexport const MachineUserId: MessageType<wire.MachineUserId> = wire.MachineUserId;\nexport type MachineUserId = wire.MachineUserId;\nexport const ProvisioningConnectorId: MessageType<wire.ProvisioningConnectorId> = wire.ProvisioningConnectorId;\nexport type ProvisioningConnectorId = wire.ProvisioningConnectorId;\nexport const ResourceId: MessageType<wire.ResourceId> = wire.ResourceId;\nexport type ResourceId = wire.ResourceId;\nexport const ProvisioningCredentialId: MessageType<wire.ProvisioningCredentialId> = wire.ProvisioningCredentialId;\nexport type ProvisioningCredentialId = wire.ProvisioningCredentialId;\nexport const ProjectId: MessageType<wire.ProjectId> = wire.ProjectId;\nexport type ProjectId = wire.ProjectId;\nexport const RoleId: MessageType<wire.RoleId> = wire.RoleId;\nexport type RoleId = wire.RoleId;\nexport const GroupId: MessageType<wire.GroupId> = wire.GroupId;\nexport type GroupId = wire.GroupId;\nexport const RoleAssignmentId: MessageType<wire.RoleAssignmentId> = wire.RoleAssignmentId;\nexport type RoleAssignmentId = wire.RoleAssignmentId;\nexport const CedarPolicyId: MessageType<wire.CedarPolicyId> = wire.CedarPolicyId;\nexport type CedarPolicyId = wire.CedarPolicyId;\nexport const AccessRequestId: MessageType<wire.AccessRequestId> = wire.AccessRequestId;\nexport type AccessRequestId = wire.AccessRequestId;\nexport const InitialAccessTokenId: MessageType<wire.InitialAccessTokenId> = wire.InitialAccessTokenId;\nexport type InitialAccessTokenId = wire.InitialAccessTokenId;\nexport const PatId: MessageType<wire.PatId> = wire.PatId;\nexport type PatId = wire.PatId;\n"]}
1
+ {"version":3,"file":"ids.js","sourceRoot":"","sources":["../../../../../src/generated/sid/v1/ids/ids.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C,MAAM,CAAC,MAAM,SAAS,GAAgC,IAAI,CAAC,SAAS,CAAC;AAErE,MAAM,CAAC,MAAM,WAAW,GAAkC,IAAI,CAAC,WAAW,CAAC;AAE3E,MAAM,CAAC,MAAM,cAAc,GAAqC,IAAI,CAAC,cAAc,CAAC;AAEpF,MAAM,CAAC,MAAM,cAAc,GAAqC,IAAI,CAAC,cAAc,CAAC;AAEpF,MAAM,CAAC,MAAM,QAAQ,GAA+B,IAAI,CAAC,QAAQ,CAAC;AAElE,MAAM,CAAC,MAAM,kBAAkB,GAAyC,IAAI,CAAC,kBAAkB,CAAC;AAEhG,MAAM,CAAC,MAAM,mBAAmB,GAA0C,IAAI,CAAC,mBAAmB,CAAC;AAEnG,MAAM,CAAC,MAAM,SAAS,GAAgC,IAAI,CAAC,SAAS,CAAC;AAErE,MAAM,CAAC,MAAM,KAAK,GAA4B,IAAI,CAAC,KAAK,CAAC;AAEzD,MAAM,CAAC,MAAM,QAAQ,GAA+B,IAAI,CAAC,QAAQ,CAAC;AAElE,MAAM,CAAC,MAAM,aAAa,GAAoC,IAAI,CAAC,aAAa,CAAC;AAEjF,MAAM,CAAC,MAAM,mBAAmB,GAA0C,IAAI,CAAC,mBAAmB,CAAC;AAEnG,MAAM,CAAC,MAAM,aAAa,GAAoC,IAAI,CAAC,aAAa,CAAC;AAEjF,MAAM,CAAC,MAAM,SAAS,GAAgC,IAAI,C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;AAE1F,MAAM,CAAC,MAAM,YAAY,GAAmC,IAAI,CAAC,YAAY,CAAC;AAE9E,MAAM,CAAC,MAAM,QAAQ,GAA+B,IAAI,CAAC,QAAQ,CAAC;AAElE,MAAM,CAAC,MAAM,kBAAkB,GAAyC,IAAI,CAAC,kBAAkB,CAAC","sourcesContent":["// The sid.v1.ids messages are owned by @structured-id/ids; this module\n// re-exports its objects so generated messages that carry an identifier\n// share them instead of a second generated copy.\nimport type { MessageType } from \"@protobuf-ts/runtime\";\nimport { wire } from \"@structured-id/ids\";\n\nexport const ProfileId: MessageType<wire.ProfileId> = wire.ProfileId;\nexport type ProfileId = wire.ProfileId;\nexport const PrincipalId: MessageType<wire.PrincipalId> = wire.PrincipalId;\nexport type PrincipalId = wire.PrincipalId;\nexport const ProfileEmailId: MessageType<wire.ProfileEmailId> = wire.ProfileEmailId;\nexport type ProfileEmailId = wire.ProfileEmailId;\nexport const ProfilePhoneId: MessageType<wire.ProfilePhoneId> = wire.ProfilePhoneId;\nexport type ProfilePhoneId = wire.ProfilePhoneId;\nexport const DeviceId: MessageType<wire.DeviceId> = wire.DeviceId;\nexport type DeviceId = wire.DeviceId;\nexport const DeviceEnrollmentId: MessageType<wire.DeviceEnrollmentId> = wire.DeviceEnrollmentId;\nexport type DeviceEnrollmentId = wire.DeviceEnrollmentId;\nexport const DeviceAttestationId: MessageType<wire.DeviceAttestationId> = wire.DeviceAttestationId;\nexport type DeviceAttestationId = wire.DeviceAttestationId;\nexport const BindingId: MessageType<wire.BindingId> = wire.BindingId;\nexport type BindingId = wire.BindingId;\nexport const OrgId: MessageType<wire.OrgId> = wire.OrgId;\nexport type OrgId = wire.OrgId;\nexport const IssuerId: MessageType<wire.IssuerId> = wire.IssuerId;\nexport type IssuerId = wire.IssuerId;\nexport const ApplicationId: MessageType<wire.ApplicationId> = wire.ApplicationId;\nexport type ApplicationId = wire.ApplicationId;\nexport const PasswordOperationId: MessageType<wire.PasswordOperationId> = wire.PasswordOperationId;\nexport type PasswordOperationId = wire.PasswordOperationId;\nexport const OpaqueLoginId: MessageType<wire.OpaqueLoginId> = wire.OpaqueLoginId;\nexport type OpaqueLoginId = wire.OpaqueLoginId;\nexport const SessionId: MessageType<wire.SessionId> = wire.SessionId;\nexport type SessionId = wire.SessionId;\nexport const CredentialId: MessageType<wire.CredentialId> = wire.CredentialId;\nexport type CredentialId = wire.CredentialId;\nexport const OtpSessionId: MessageType<wire.OtpSessionId> = wire.OtpSessionId;\nexport type OtpSessionId = wire.OtpSessionId;\nexport const MagicLinkId: MessageType<wire.MagicLinkId> = wire.MagicLinkId;\nexport type MagicLinkId = wire.MagicLinkId;\nexport const StepUpChallengeId: MessageType<wire.StepUpChallengeId> = wire.StepUpChallengeId;\nexport type StepUpChallengeId = wire.StepUpChallengeId;\nexport const ResetSessionId: MessageType<wire.ResetSessionId> = wire.ResetSessionId;\nexport type ResetSessionId = wire.ResetSessionId;\nexport const ImportedPasswordUpgradeId: MessageType<wire.ImportedPasswordUpgradeId> = wire.ImportedPasswordUpgradeId;\nexport type ImportedPasswordUpgradeId = wire.ImportedPasswordUpgradeId;\nexport const MachineUserId: MessageType<wire.MachineUserId> = wire.MachineUserId;\nexport type MachineUserId = wire.MachineUserId;\nexport const ProvisioningConnectorId: MessageType<wire.ProvisioningConnectorId> = wire.ProvisioningConnectorId;\nexport type ProvisioningConnectorId = wire.ProvisioningConnectorId;\nexport const ResourceId: MessageType<wire.ResourceId> = wire.ResourceId;\nexport type ResourceId = wire.ResourceId;\nexport const ProvisioningCredentialId: MessageType<wire.ProvisioningCredentialId> = wire.ProvisioningCredentialId;\nexport type ProvisioningCredentialId = wire.ProvisioningCredentialId;\nexport const ProjectId: MessageType<wire.ProjectId> = wire.ProjectId;\nexport type ProjectId = wire.ProjectId;\nexport const RoleId: MessageType<wire.RoleId> = wire.RoleId;\nexport type RoleId = wire.RoleId;\nexport const GroupId: MessageType<wire.GroupId> = wire.GroupId;\nexport type GroupId = wire.GroupId;\nexport const RoleAssignmentId: MessageType<wire.RoleAssignmentId> = wire.RoleAssignmentId;\nexport type RoleAssignmentId = wire.RoleAssignmentId;\nexport const CedarPolicyId: MessageType<wire.CedarPolicyId> = wire.CedarPolicyId;\nexport type CedarPolicyId = wire.CedarPolicyId;\nexport const AccessRequestId: MessageType<wire.AccessRequestId> = wire.AccessRequestId;\nexport type AccessRequestId = wire.AccessRequestId;\nexport const InitialAccessTokenId: MessageType<wire.InitialAccessTokenId> = wire.InitialAccessTokenId;\nexport type InitialAccessTokenId = wire.InitialAccessTokenId;\nexport const PatId: MessageType<wire.PatId> = wire.PatId;\nexport type PatId = wire.PatId;\nexport const BrandingConfigId: MessageType<wire.BrandingConfigId> = wire.BrandingConfigId;\nexport type BrandingConfigId = wire.BrandingConfigId;\nexport const FlowActionId: MessageType<wire.FlowActionId> = wire.FlowActionId;\nexport type FlowActionId = wire.FlowActionId;\nexport const InviteId: MessageType<wire.InviteId> = wire.InviteId;\nexport type InviteId = wire.InviteId;\nexport const UpstreamProviderId: MessageType<wire.UpstreamProviderId> = wire.UpstreamProviderId;\nexport type UpstreamProviderId = wire.UpstreamProviderId;\n"]}
package/dist/ip.d.ts ADDED
@@ -0,0 +1,31 @@
1
+ /**
2
+ * The checked reading of `sid.v1.common.IpAddress` and its text for display.
3
+ * The message carries one IP host address as data: 4 bytes for IPv4 or 16
4
+ * for IPv6 in network order, the length giving the family. An absent field
5
+ * means the address is unknown or was not recorded.
6
+ */
7
+ import type { IpAddress } from "./generated/sid/v1/common/types.js";
8
+ /** An address's family, as the message's length gives it. */
9
+ export type IpFamily = "ipv4" | "ipv6";
10
+ /** An address read from its message: the family and a copy of its octets. */
11
+ export interface CheckedIpAddress {
12
+ readonly family: IpFamily;
13
+ /** 4 octets for IPv4, 16 for IPv6, in network order. */
14
+ readonly octets: Uint8Array;
15
+ }
16
+ /** A message whose value is not 4 or 16 bytes. Names the length only. */
17
+ export declare class IpAddressError extends Error {
18
+ readonly length: number;
19
+ constructor(length: number);
20
+ }
21
+ /** The address `message` carries, or `IpAddressError` for another length. */
22
+ export declare function readIpAddress(message: IpAddress): CheckedIpAddress;
23
+ /**
24
+ * The address of an optional field: an absent message stays absent (unknown
25
+ * or unrecorded); a present one is read as `readIpAddress` reads it.
26
+ */
27
+ export declare function optionalIpAddress(message: IpAddress | undefined): CheckedIpAddress | undefined;
28
+ /** The message carrying `address`. */
29
+ export declare function toIpAddress(address: CheckedIpAddress): IpAddress;
30
+ /** The text an address is shown as: dotted IPv4, or RFC 5952 IPv6. */
31
+ export declare function ipAddressText(address: CheckedIpAddress): string;
package/dist/ip.js ADDED
@@ -0,0 +1,84 @@
1
+ /** A message whose value is not 4 or 16 bytes. Names the length only. */
2
+ export class IpAddressError extends Error {
3
+ length;
4
+ constructor(length) {
5
+ super(`an IP address is 4 or 16 bytes, not ${length}`);
6
+ this.length = length;
7
+ this.name = "IpAddressError";
8
+ }
9
+ }
10
+ /** The address `message` carries, or `IpAddressError` for another length. */
11
+ export function readIpAddress(message) {
12
+ const { length } = message.value;
13
+ // A copy into a plain Uint8Array: a Buffer's own slice would share memory.
14
+ if (length === 4)
15
+ return { family: "ipv4", octets: Uint8Array.from(message.value) };
16
+ if (length === 16)
17
+ return { family: "ipv6", octets: Uint8Array.from(message.value) };
18
+ throw new IpAddressError(length);
19
+ }
20
+ /**
21
+ * The address of an optional field: an absent message stays absent (unknown
22
+ * or unrecorded); a present one is read as `readIpAddress` reads it.
23
+ */
24
+ export function optionalIpAddress(message) {
25
+ return message === undefined ? undefined : readIpAddress(message);
26
+ }
27
+ /** The message carrying `address`. */
28
+ export function toIpAddress(address) {
29
+ return { value: Uint8Array.from(address.octets) };
30
+ }
31
+ /** Dotted-decimal text of 4 octets. */
32
+ function dotted(octets) {
33
+ return Array.from(octets).join(".");
34
+ }
35
+ /** Whether 16 octets are an IPv4-mapped IPv6 address (RFC 4291 section 2.5.5.2). */
36
+ function isMapped(octets) {
37
+ for (let i = 0; i < 10; i++)
38
+ if (octets[i] !== 0)
39
+ return false;
40
+ return octets[10] === 0xff && octets[11] === 0xff;
41
+ }
42
+ /**
43
+ * RFC 5952 text of 16 octets: lowercase hexadecimal groups without leading
44
+ * zeros, the longest run of two or more zero groups (the first of equal
45
+ * runs) shortened to `::`. An IPv4-mapped address is written
46
+ * `::ffff:a.b.c.d` (RFC 5952 section 5); it stays IPv6.
47
+ */
48
+ function ipv6Text(octets) {
49
+ if (isMapped(octets))
50
+ return `::ffff:${dotted(octets.subarray(12))}`;
51
+ const groups = [];
52
+ for (let i = 0; i < 16; i += 2)
53
+ groups.push((octets[i] << 8) | octets[i + 1]);
54
+ let bestStart = -1;
55
+ let bestLength = 1;
56
+ for (let i = 0; i < 8;) {
57
+ if (groups[i] !== 0) {
58
+ i++;
59
+ continue;
60
+ }
61
+ let j = i;
62
+ while (j < 8 && groups[j] === 0)
63
+ j++;
64
+ if (j - i > bestLength) {
65
+ bestStart = i;
66
+ bestLength = j - i;
67
+ }
68
+ i = j;
69
+ }
70
+ const hex = (g) => g.toString(16);
71
+ if (bestStart < 0)
72
+ return groups.map(hex).join(":");
73
+ const head = groups.slice(0, bestStart).map(hex).join(":");
74
+ const tail = groups
75
+ .slice(bestStart + bestLength)
76
+ .map(hex)
77
+ .join(":");
78
+ return `${head}::${tail}`;
79
+ }
80
+ /** The text an address is shown as: dotted IPv4, or RFC 5952 IPv6. */
81
+ export function ipAddressText(address) {
82
+ return address.family === "ipv4" ? dotted(address.octets) : ipv6Text(address.octets);
83
+ }
84
+ //# sourceMappingURL=ip.js.map
package/dist/ip.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ip.js","sourceRoot":"","sources":["../src/ip.ts"],"names":[],"mappings":"AAkBA,yEAAyE;AACzE,MAAM,OAAO,cAAe,SAAQ,KAAK;IAClB;IAArB,YAAqB,MAAc;QACjC,KAAK,CAAC,uCAAuC,MAAM,EAAE,CAAC,CAAC;QADpC,WAAM,GAAN,MAAM,CAAQ;QAEjC,IAAI,CAAC,IAAI,GAAG,gBAA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,CAAC;IACpD,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC3D,MAAM,IAAI,GAAG,MAAM;SAChB,KAAK,CAAC,SAAS,GAAG,UAAU,CAAC;SAC7B,GAAG,CAAC,GAAG,CAAC;SACR,IAAI,CAAC,GAAG,CAAC,CAAC;IACb,OAAO,GAAG,IAAI,KAAK,IAAI,EAAE,CAAC;AAC5B,CAAC;AAED,sEAAsE;AACtE,MAAM,UAAU,aAAa,CAAC,OAAyB;IACrD,OAAO,OAAO,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;AACvF,CAAC","sourcesContent":["/**\n * The checked reading of `sid.v1.common.IpAddress` and its text for display.\n * The message carries one IP host address as data: 4 bytes for IPv4 or 16\n * for IPv6 in network order, the length giving the family. An absent field\n * means the address is unknown or was not recorded.\n */\nimport type { IpAddress } from \"./generated/sid/v1/common/types.js\";\n\n/** An address's family, as the message's length gives it. */\nexport type IpFamily = \"ipv4\" | \"ipv6\";\n\n/** An address read from its message: the family and a copy of its octets. */\nexport interface CheckedIpAddress {\n readonly family: IpFamily;\n /** 4 octets for IPv4, 16 for IPv6, in network order. */\n readonly octets: Uint8Array;\n}\n\n/** A message whose value is not 4 or 16 bytes. Names the length only. */\nexport class IpAddressError extends Error {\n constructor(readonly length: number) {\n super(`an IP address is 4 or 16 bytes, not ${length}`);\n this.name = \"IpAddressError\";\n }\n}\n\n/** The address `message` carries, or `IpAddressError` for another length. */\nexport function readIpAddress(message: IpAddress): CheckedIpAddress {\n const { length } = message.value;\n // A copy into a plain Uint8Array: a Buffer's own slice would share memory.\n if (length === 4) return { family: \"ipv4\", octets: Uint8Array.from(message.value) };\n if (length === 16) return { family: \"ipv6\", octets: Uint8Array.from(message.value) };\n throw new IpAddressError(length);\n}\n\n/**\n * The address of an optional field: an absent message stays absent (unknown\n * or unrecorded); a present one is read as `readIpAddress` reads it.\n */\nexport function optionalIpAddress(message: IpAddress | undefined): CheckedIpAddress | undefined {\n return message === undefined ? undefined : readIpAddress(message);\n}\n\n/** The message carrying `address`. */\nexport function toIpAddress(address: CheckedIpAddress): IpAddress {\n return { value: Uint8Array.from(address.octets) };\n}\n\n/** Dotted-decimal text of 4 octets. */\nfunction dotted(octets: Uint8Array): string {\n return Array.from(octets).join(\".\");\n}\n\n/** Whether 16 octets are an IPv4-mapped IPv6 address (RFC 4291 section 2.5.5.2). */\nfunction isMapped(octets: Uint8Array): boolean {\n for (let i = 0; i < 10; i++) if (octets[i] !== 0) return false;\n return octets[10] === 0xff && octets[11] === 0xff;\n}\n\n/**\n * RFC 5952 text of 16 octets: lowercase hexadecimal groups without leading\n * zeros, the longest run of two or more zero groups (the first of equal\n * runs) shortened to `::`. An IPv4-mapped address is written\n * `::ffff:a.b.c.d` (RFC 5952 section 5); it stays IPv6.\n */\nfunction ipv6Text(octets: Uint8Array): string {\n if (isMapped(octets)) return `::ffff:${dotted(octets.subarray(12))}`;\n const groups: number[] = [];\n for (let i = 0; i < 16; i += 2) groups.push((octets[i]! << 8) | octets[i + 1]!);\n let bestStart = -1;\n let bestLength = 1;\n for (let i = 0; i < 8;) {\n if (groups[i] !== 0) {\n i++;\n continue;\n }\n let j = i;\n while (j < 8 && groups[j] === 0) j++;\n if (j - i > bestLength) {\n bestStart = i;\n bestLength = j - i;\n }\n i = j;\n }\n const hex = (g: number) => g.toString(16);\n if (bestStart < 0) return groups.map(hex).join(\":\");\n const head = groups.slice(0, bestStart).map(hex).join(\":\");\n const tail = groups\n .slice(bestStart + bestLength)\n .map(hex)\n .join(\":\");\n return `${head}::${tail}`;\n}\n\n/** The text an address is shown as: dotted IPv4, or RFC 5952 IPv6. */\nexport function ipAddressText(address: CheckedIpAddress): string {\n return address.family === \"ipv4\" ? dotted(address.octets) : ipv6Text(address.octets);\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@structured-id/proto",
3
- "version": "0.15.0",
3
+ "version": "0.17.0",
4
4
  "type": "module",
5
5
  "description": "StructuredID public sid.v1 API for TypeScript: generated messages and clients for gRPC and gRPC-web.",
6
6
  "exports": {
@@ -8,6 +8,10 @@
8
8
  "types": "./dist/totp.d.ts",
9
9
  "default": "./dist/totp.js"
10
10
  },
11
+ "./ip": {
12
+ "types": "./dist/ip.d.ts",
13
+ "default": "./dist/ip.js"
14
+ },
11
15
  "./sid/v1/*": {
12
16
  "types": "./dist/generated/sid/v1/*.d.ts",
13
17
  "default": "./dist/generated/sid/v1/*.js"
@@ -57,7 +61,7 @@
57
61
  "dependencies": {
58
62
  "@protobuf-ts/runtime": "^2.11.1",
59
63
  "@protobuf-ts/runtime-rpc": "^2.11.1",
60
- "@structured-id/ids": "^0.8.0"
64
+ "@structured-id/ids": "^0.9.0"
61
65
  },
62
66
  "devDependencies": {
63
67
  "@bufbuild/buf": "^1.75.0",