@mymehq/sdk 4.8.0 → 4.10.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.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { MergeStrategy, ConflictSnapshot, MergePolicy, ItemState, Tier, Item, CreateItemInput, PaginatedResult, ItemWithMetadata, Version, Edge, Metadata, SearchResult, CreateEdgeInput, EdgeTypeSchema, TypeSchema, CreateKeyInput, ApiKey, UpdateKeyInput, CreateWebhookInput, Webhook, UpdateWebhookInput, WebhookDelivery, ConnectionInstallResult, ConnectionUninstallResult, TenantConfig, TenantQuota } from '@mymehq/shared';
2
- export { ApiKey, ConflictSnapshot, CreateItemInput, CreateKeyInput, Item, ItemState, MergePolicy, MergeStrategy, Metadata, PaginatedResult, SearchResult, TypeSchema, UpdateKeyInput, Version } from '@mymehq/shared';
1
+ import { MergeStrategy, ConflictSnapshot, MergePolicy, ItemState, Tier, Item, CreateItemInput, PaginatedResult, ItemWithMetadata, Version, Edge, Metadata, SearchResult, CreateEdgeInput, EdgeTypeSchema, TypeSchema, CreateKeyInput, ApiKey, UpdateKeyInput, CreateWebhookInput, Webhook, UpdateWebhookInput, WebhookDelivery, ConnectionInstallResult, ConnectionUninstallResult, PreviewEventRequest, PreviewEventResult, TenantConfig, TenantQuota, Profile, UpdateProfileInput } from '@mymehq/shared';
2
+ export { ApiKey, ConflictSnapshot, CreateItemInput, CreateKeyInput, Item, ItemState, MergePolicy, MergeStrategy, Metadata, PaginatedResult, Profile, SearchResult, TypeSchema, UpdateKeyInput, UpdateProfileInput, Version } from '@mymehq/shared';
3
3
 
4
4
  /**
5
5
  * Conflict resolution strategy for item updates.
@@ -592,6 +592,21 @@ declare class MymeClient {
592
592
  * can uninstall connections in their own tenant scope.
593
593
  */
594
594
  uninstall: (id: string) => Promise<ConnectionUninstallResult>;
595
+ /**
596
+ * Preview the wire envelopes the reactive-run bridge would emit for
597
+ * a synthetic item-event, without dispatching anything. Operator
598
+ * debugging surface (T-083): given an existing item id and an event
599
+ * type, the route returns one row per subscribing connection — either
600
+ * `would_dispatch: true` with the synthesised envelope, or
601
+ * `would_dispatch: false` with a `dispatch_reason` (`self_event`,
602
+ * `cross_tenant`, `hop_budget_exceeded`, `subscription_inactive`).
603
+ *
604
+ * Defaults to all subscribers in the caller's tenant; pass
605
+ * `connection_id` to filter to one. The optional `cycle` override
606
+ * lets you reproduce reactive scenarios ("what if hop_count was N?").
607
+ * Workspace-admin only.
608
+ */
609
+ previewEvent: (input: PreviewEventRequest) => Promise<PreviewEventResult>;
595
610
  };
596
611
  /** Tenant-scoped configuration. Controls feed-tier retention per type
597
612
  * and the three optional schema-enforcement levers (TSC42 §5). All
@@ -631,6 +646,35 @@ declare class MymeClient {
631
646
  }) => Promise<TenantQuota>;
632
647
  };
633
648
  };
649
+ /**
650
+ * The calling user's profile. `system.profile` is a virtual type —
651
+ * served by a dedicated endpoint over the `users` table joined to
652
+ * `auth_user` for the canonical email. Username changes go through
653
+ * the same handle validators as `PUT /auth/me/handle`.
654
+ *
655
+ * Apps that need a third-party-OAuth-style read should use the
656
+ * standard OIDC `profile` / `email` scopes via `/auth/userinfo`
657
+ * instead — this surface is for first-party callers (CLI, MCP, the
658
+ * user themselves) holding a tenant-scoped bearer.
659
+ */
660
+ readonly profile: {
661
+ /** Read the calling user's profile. */
662
+ get: () => Promise<Profile>;
663
+ /**
664
+ * Update the calling user's profile. Every field optional; `null`
665
+ * clears (where applicable). `username` runs through the
666
+ * reserved-handle / collision validators server-side.
667
+ */
668
+ update: (input: UpdateProfileInput) => Promise<Profile>;
669
+ /**
670
+ * Upload an avatar. Accepts a Blob/File or a Uint8Array. The server
671
+ * stores the bytes in the existing R2-backed blob layer and stamps
672
+ * the content-addressed hash onto the user row.
673
+ */
674
+ setAvatar: (data: Blob | Uint8Array, mimeType?: string) => Promise<Profile>;
675
+ /** Clear the avatar; reverts to the deterministic placeholder. */
676
+ clearAvatar: () => Promise<Profile>;
677
+ };
634
678
  private throwRawError;
635
679
  }
636
680
 
package/dist/index.js CHANGED
@@ -932,6 +932,27 @@ var MymeClient = class {
932
932
  "POST",
933
933
  `/connections/${id}/uninstall`
934
934
  );
935
+ },
936
+ /**
937
+ * Preview the wire envelopes the reactive-run bridge would emit for
938
+ * a synthetic item-event, without dispatching anything. Operator
939
+ * debugging surface (T-083): given an existing item id and an event
940
+ * type, the route returns one row per subscribing connection — either
941
+ * `would_dispatch: true` with the synthesised envelope, or
942
+ * `would_dispatch: false` with a `dispatch_reason` (`self_event`,
943
+ * `cross_tenant`, `hop_budget_exceeded`, `subscription_inactive`).
944
+ *
945
+ * Defaults to all subscribers in the caller's tenant; pass
946
+ * `connection_id` to filter to one. The optional `cycle` override
947
+ * lets you reproduce reactive scenarios ("what if hop_count was N?").
948
+ * Workspace-admin only.
949
+ */
950
+ previewEvent: async (input) => {
951
+ return this.transport.request(
952
+ "POST",
953
+ "/connections/preview-event",
954
+ { body: input }
955
+ );
935
956
  }
936
957
  };
937
958
  // ---- Tenants (admin) ----
@@ -991,6 +1012,60 @@ var MymeClient = class {
991
1012
  }
992
1013
  }
993
1014
  };
1015
+ // ---- Profile (T-074) ----
1016
+ /**
1017
+ * The calling user's profile. `system.profile` is a virtual type —
1018
+ * served by a dedicated endpoint over the `users` table joined to
1019
+ * `auth_user` for the canonical email. Username changes go through
1020
+ * the same handle validators as `PUT /auth/me/handle`.
1021
+ *
1022
+ * Apps that need a third-party-OAuth-style read should use the
1023
+ * standard OIDC `profile` / `email` scopes via `/auth/userinfo`
1024
+ * instead — this surface is for first-party callers (CLI, MCP, the
1025
+ * user themselves) holding a tenant-scoped bearer.
1026
+ */
1027
+ profile = {
1028
+ /** Read the calling user's profile. */
1029
+ get: async () => {
1030
+ return this.transport.request("GET", "/profile/me");
1031
+ },
1032
+ /**
1033
+ * Update the calling user's profile. Every field optional; `null`
1034
+ * clears (where applicable). `username` runs through the
1035
+ * reserved-handle / collision validators server-side.
1036
+ */
1037
+ update: async (input) => {
1038
+ return this.transport.request("PATCH", "/profile/me", {
1039
+ body: input
1040
+ });
1041
+ },
1042
+ /**
1043
+ * Upload an avatar. Accepts a Blob/File or a Uint8Array. The server
1044
+ * stores the bytes in the existing R2-backed blob layer and stamps
1045
+ * the content-addressed hash onto the user row.
1046
+ */
1047
+ setAvatar: async (data, mimeType) => {
1048
+ const form = new FormData();
1049
+ const blob = data instanceof Blob ? data : new Blob([new Uint8Array(data)], {
1050
+ type: mimeType ?? "application/octet-stream"
1051
+ });
1052
+ form.append("file", blob, "avatar");
1053
+ const response = await this.transport.rawRequest(
1054
+ "POST",
1055
+ "/profile/me/avatar",
1056
+ { rawBody: form }
1057
+ );
1058
+ const result = await response.json();
1059
+ if (!response.ok) {
1060
+ this.throwRawError(response.status, result);
1061
+ }
1062
+ return result;
1063
+ },
1064
+ /** Clear the avatar; reverts to the deterministic placeholder. */
1065
+ clearAvatar: async () => {
1066
+ return this.transport.request("DELETE", "/profile/me/avatar");
1067
+ }
1068
+ };
994
1069
  // ---- Internal ----
995
1070
  throwRawError(status, body) {
996
1071
  const parsed = body;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mymehq/sdk",
3
- "version": "4.8.0",
3
+ "version": "4.10.0",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org",
@@ -20,7 +20,7 @@
20
20
  "dist"
21
21
  ],
22
22
  "dependencies": {
23
- "@mymehq/shared": "4.8.0"
23
+ "@mymehq/shared": "4.10.0"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@types/node": "^22.0.0",