@moltzap/protocol 2026.329.0 → 2026.401.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.
@@ -0,0 +1,3 @@
1
+ export { ContactRequestEventSchema, ContactAcceptedEventSchema, } from "../schema/events.js";
2
+ export { EventNames } from "../schema/events.js";
3
+ //# sourceMappingURL=contact-events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contact-events.d.ts","sourceRoot":"","sources":["../../src/optional/contact-events.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,yBAAyB,EACzB,0BAA0B,GAC3B,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,5 @@
1
+ // Contact-specific events — optional subpath export
2
+ // Import via "@moltzap/protocol/contact-events" or from the main entry (backward compat)
3
+ export { ContactRequestEventSchema, ContactAcceptedEventSchema, } from "../schema/events.js";
4
+ export { EventNames } from "../schema/events.js";
5
+ //# sourceMappingURL=contact-events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contact-events.js","sourceRoot":"","sources":["../../src/optional/contact-events.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,yFAAyF;AACzF,OAAO,EACL,yBAAyB,EACzB,0BAA0B,GAC3B,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { ContactsListParamsSchema, ContactsListResultSchema, ContactsAddParamsSchema, ContactsAddResultSchema, ContactsAcceptParamsSchema, ContactsAcceptResultSchema, ContactIdParamsSchema, ContactsDiscoverParamsSchema, ContactsDiscoverResultSchema, EmptyResultSchema, } from "../schema/methods/contacts.js";
2
+ export type { ContactsListParams, ContactsListResult, ContactsAddParams, ContactsAddResult, ContactsAcceptParams, ContactsAcceptResult, ContactIdParams, ContactsDiscoverParams, ContactsDiscoverResult, } from "../schema/methods/contacts.js";
3
+ export { ContactsSyncParamsSchema, ContactsSyncResultSchema, } from "../schema/methods/phone-contacts.js";
4
+ export type { ContactsSyncParams, ContactsSyncResult, } from "../schema/methods/phone-contacts.js";
5
+ //# sourceMappingURL=contact-methods.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contact-methods.d.ts","sourceRoot":"","sources":["../../src/optional/contact-methods.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,wBAAwB,EACxB,wBAAwB,EACxB,uBAAuB,EACvB,uBAAuB,EACvB,0BAA0B,EAC1B,0BAA0B,EAC1B,qBAAqB,EACrB,4BAA4B,EAC5B,4BAA4B,EAC5B,iBAAiB,GAClB,MAAM,+BAA+B,CAAC;AAEvC,YAAY,EACV,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACpB,eAAe,EACf,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EACL,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,qCAAqC,CAAC;AAE7C,YAAY,EACV,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,qCAAqC,CAAC"}
@@ -0,0 +1,5 @@
1
+ // Contact-specific RPC method schemas — optional subpath export
2
+ // Import via "@moltzap/protocol/contact-methods" or from the main entry (backward compat)
3
+ export { ContactsListParamsSchema, ContactsListResultSchema, ContactsAddParamsSchema, ContactsAddResultSchema, ContactsAcceptParamsSchema, ContactsAcceptResultSchema, ContactIdParamsSchema, ContactsDiscoverParamsSchema, ContactsDiscoverResultSchema, EmptyResultSchema, } from "../schema/methods/contacts.js";
4
+ export { ContactsSyncParamsSchema, ContactsSyncResultSchema, } from "../schema/methods/phone-contacts.js";
5
+ //# sourceMappingURL=contact-methods.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contact-methods.js","sourceRoot":"","sources":["../../src/optional/contact-methods.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,0FAA0F;AAC1F,OAAO,EACL,wBAAwB,EACxB,wBAAwB,EACxB,uBAAuB,EACvB,uBAAuB,EACvB,0BAA0B,EAC1B,0BAA0B,EAC1B,qBAAqB,EACrB,4BAA4B,EAC5B,4BAA4B,EAC5B,iBAAiB,GAClB,MAAM,+BAA+B,CAAC;AAcvC,OAAO,EACL,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,qCAAqC,CAAC"}
@@ -1,3 +1,8 @@
1
+ /**
2
+ * Ensure phone has E.164 '+' prefix.
3
+ * GoTrue strips '+' from phone numbers in API responses.
4
+ */
5
+ export declare function normalizeE164(phone: string): string;
1
6
  /** SHA-256 hash of an E.164 phone number for privacy-preserving contact discovery. */
2
7
  export declare function hashPhone(e164Phone: string): string;
3
8
  /** Validates that a string is a 64-character lowercase hex SHA-256 hash. */
@@ -1 +1 @@
1
- {"version":3,"file":"phone-hash.d.ts","sourceRoot":"","sources":["../src/phone-hash.ts"],"names":[],"mappings":"AAEA,sFAAsF;AACtF,wBAAgB,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED,4EAA4E;AAC5E,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEtD"}
1
+ {"version":3,"file":"phone-hash.d.ts","sourceRoot":"","sources":["../src/phone-hash.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED,sFAAsF;AACtF,wBAAgB,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED,4EAA4E;AAC5E,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEtD"}
@@ -1,4 +1,11 @@
1
1
  import { createHash } from "node:crypto";
2
+ /**
3
+ * Ensure phone has E.164 '+' prefix.
4
+ * GoTrue strips '+' from phone numbers in API responses.
5
+ */
6
+ export function normalizeE164(phone) {
7
+ return phone.startsWith("+") ? phone : `+${phone}`;
8
+ }
2
9
  /** SHA-256 hash of an E.164 phone number for privacy-preserving contact discovery. */
3
10
  export function hashPhone(e164Phone) {
4
11
  return createHash("sha256").update(e164Phone).digest("hex");
@@ -1 +1 @@
1
- {"version":3,"file":"phone-hash.js","sourceRoot":"","sources":["../src/phone-hash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,sFAAsF;AACtF,MAAM,UAAU,SAAS,CAAC,SAAiB;IACzC,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC9D,CAAC;AAED,4EAA4E;AAC5E,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,OAAO,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACrC,CAAC"}
1
+ {"version":3,"file":"phone-hash.js","sourceRoot":"","sources":["../src/phone-hash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,KAAa;IACzC,OAAO,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,EAAE,CAAC;AACrD,CAAC;AAED,sFAAsF;AACtF,MAAM,UAAU,SAAS,CAAC,SAAiB;IACzC,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC9D,CAAC;AAED,4EAA4E;AAC5E,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,OAAO,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACrC,CAAC"}
@@ -6,7 +6,7 @@ export declare const ParticipantRefSchema: import("@sinclair/typebox").TObject<{
6
6
  }>;
7
7
  export declare const UserSchema: import("@sinclair/typebox").TObject<{
8
8
  id: import("@sinclair/typebox").TString;
9
- phone: import("@sinclair/typebox").TString;
9
+ phone: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
10
10
  displayName: import("@sinclair/typebox").TString;
11
11
  avatarUrl: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
12
12
  status: import("@sinclair/typebox").TUnsafe<"active" | "deactivated">;
@@ -9,7 +9,7 @@ export const ParticipantRefSchema = Type.Object({
9
9
  }, { additionalProperties: false });
10
10
  export const UserSchema = Type.Object({
11
11
  id: UserId,
12
- phone: Type.String(),
12
+ phone: Type.Optional(Type.String()),
13
13
  displayName: Type.String({ minLength: 1 }),
14
14
  avatarUrl: Type.Optional(Type.String({ format: "uri" })),
15
15
  status: stringEnum(["active", "deactivated"]),
@@ -1 +1 @@
1
- {"version":3,"file":"identity.js","sourceRoot":"","sources":["../../src/schema/identity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAe,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAElD,wFAAwF;AACxF,MAAM,CAAC,MAAM,mBAAmB,GAAG,UAAU,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAEjE,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,CAAC,MAAM,CAC7C;IACE,IAAI,EAAE,mBAAmB;IACzB,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;CACpC,EACD,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAChC,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CACnC;IACE,EAAE,EAAE,MAAM;IACV,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE;IACpB,WAAW,EAAE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AS,EAAE,cAAc;CAC1B,EACD,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAChC,CAAC"}
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const PROTOCOL_VERSION = "2026.329.0";
1
+ export declare const PROTOCOL_VERSION = "2026.401.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/dist/version.js CHANGED
@@ -1,3 +1,3 @@
1
1
  // Auto-bumped by publish workflow
2
- export const PROTOCOL_VERSION = "2026.329.0";
2
+ export const PROTOCOL_VERSION = "2026.401.0";
3
3
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moltzap/protocol",
3
- "version": "2026.329.0",
3
+ "version": "2026.401.0",
4
4
  "description": "Protocol types and validators for MoltZap messaging",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -33,6 +33,14 @@
33
33
  "./test-fixtures/phone-hashes": {
34
34
  "types": "./dist/test-fixtures/phone-hashes.d.ts",
35
35
  "import": "./dist/test-fixtures/phone-hashes.js"
36
+ },
37
+ "./contact-events": {
38
+ "types": "./dist/optional/contact-events.d.ts",
39
+ "import": "./dist/optional/contact-events.js"
40
+ },
41
+ "./contact-methods": {
42
+ "types": "./dist/optional/contact-methods.d.ts",
43
+ "import": "./dist/optional/contact-methods.js"
36
44
  }
37
45
  },
38
46
  "peerDependencies": {
@@ -49,6 +57,7 @@
49
57
  "ajv-formats": "^3.0.0"
50
58
  },
51
59
  "devDependencies": {
60
+ "@types/node": "^25.5.0",
52
61
  "@types/ws": "^8.5.0",
53
62
  "tsx": "^4.19.0",
54
63
  "typescript": "^5.7.0",