@mymehq/sdk 4.8.0 → 4.9.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, 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.
@@ -631,6 +631,35 @@ declare class MymeClient {
631
631
  }) => Promise<TenantQuota>;
632
632
  };
633
633
  };
634
+ /**
635
+ * The calling user's profile. `system.profile` is a virtual type —
636
+ * served by a dedicated endpoint over the `users` table joined to
637
+ * `auth_user` for the canonical email. Username changes go through
638
+ * the same handle validators as `PUT /auth/me/handle`.
639
+ *
640
+ * Apps that need a third-party-OAuth-style read should use the
641
+ * standard OIDC `profile` / `email` scopes via `/auth/userinfo`
642
+ * instead — this surface is for first-party callers (CLI, MCP, the
643
+ * user themselves) holding a tenant-scoped bearer.
644
+ */
645
+ readonly profile: {
646
+ /** Read the calling user's profile. */
647
+ get: () => Promise<Profile>;
648
+ /**
649
+ * Update the calling user's profile. Every field optional; `null`
650
+ * clears (where applicable). `username` runs through the
651
+ * reserved-handle / collision validators server-side.
652
+ */
653
+ update: (input: UpdateProfileInput) => Promise<Profile>;
654
+ /**
655
+ * Upload an avatar. Accepts a Blob/File or a Uint8Array. The server
656
+ * stores the bytes in the existing R2-backed blob layer and stamps
657
+ * the content-addressed hash onto the user row.
658
+ */
659
+ setAvatar: (data: Blob | Uint8Array, mimeType?: string) => Promise<Profile>;
660
+ /** Clear the avatar; reverts to the deterministic placeholder. */
661
+ clearAvatar: () => Promise<Profile>;
662
+ };
634
663
  private throwRawError;
635
664
  }
636
665
 
package/dist/index.js CHANGED
@@ -991,6 +991,60 @@ var MymeClient = class {
991
991
  }
992
992
  }
993
993
  };
994
+ // ---- Profile (T-074) ----
995
+ /**
996
+ * The calling user's profile. `system.profile` is a virtual type —
997
+ * served by a dedicated endpoint over the `users` table joined to
998
+ * `auth_user` for the canonical email. Username changes go through
999
+ * the same handle validators as `PUT /auth/me/handle`.
1000
+ *
1001
+ * Apps that need a third-party-OAuth-style read should use the
1002
+ * standard OIDC `profile` / `email` scopes via `/auth/userinfo`
1003
+ * instead — this surface is for first-party callers (CLI, MCP, the
1004
+ * user themselves) holding a tenant-scoped bearer.
1005
+ */
1006
+ profile = {
1007
+ /** Read the calling user's profile. */
1008
+ get: async () => {
1009
+ return this.transport.request("GET", "/profile/me");
1010
+ },
1011
+ /**
1012
+ * Update the calling user's profile. Every field optional; `null`
1013
+ * clears (where applicable). `username` runs through the
1014
+ * reserved-handle / collision validators server-side.
1015
+ */
1016
+ update: async (input) => {
1017
+ return this.transport.request("PATCH", "/profile/me", {
1018
+ body: input
1019
+ });
1020
+ },
1021
+ /**
1022
+ * Upload an avatar. Accepts a Blob/File or a Uint8Array. The server
1023
+ * stores the bytes in the existing R2-backed blob layer and stamps
1024
+ * the content-addressed hash onto the user row.
1025
+ */
1026
+ setAvatar: async (data, mimeType) => {
1027
+ const form = new FormData();
1028
+ const blob = data instanceof Blob ? data : new Blob([new Uint8Array(data)], {
1029
+ type: mimeType ?? "application/octet-stream"
1030
+ });
1031
+ form.append("file", blob, "avatar");
1032
+ const response = await this.transport.rawRequest(
1033
+ "POST",
1034
+ "/profile/me/avatar",
1035
+ { rawBody: form }
1036
+ );
1037
+ const result = await response.json();
1038
+ if (!response.ok) {
1039
+ this.throwRawError(response.status, result);
1040
+ }
1041
+ return result;
1042
+ },
1043
+ /** Clear the avatar; reverts to the deterministic placeholder. */
1044
+ clearAvatar: async () => {
1045
+ return this.transport.request("DELETE", "/profile/me/avatar");
1046
+ }
1047
+ };
994
1048
  // ---- Internal ----
995
1049
  throwRawError(status, body) {
996
1050
  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.9.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.9.0"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@types/node": "^22.0.0",