@mymehq/sdk 4.9.0 → 5.0.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.
@@ -142,12 +142,12 @@ var StoredTokenProvider = class {
142
142
  try {
143
143
  const res = await this.fetch(`${this.issuer}/auth/token`, {
144
144
  method: "POST",
145
- headers: { "Content-Type": "application/json" },
146
- body: JSON.stringify({
145
+ headers: { "Content-Type": "application/x-www-form-urlencoded" },
146
+ body: new URLSearchParams({
147
147
  grant_type: "refresh_token",
148
148
  refresh_token: refreshToken,
149
149
  client_id: this.clientId
150
- })
150
+ }).toString()
151
151
  });
152
152
  const body = await res.json();
153
153
  if (!res.ok || !body.access_token) {
@@ -269,14 +269,14 @@ var MymeAuth = class {
269
269
  }
270
270
  const res = await this.fetch(`${this.issuer}/auth/token`, {
271
271
  method: "POST",
272
- headers: { "Content-Type": "application/json" },
273
- body: JSON.stringify({
272
+ headers: { "Content-Type": "application/x-www-form-urlencoded" },
273
+ body: new URLSearchParams({
274
274
  grant_type: "authorization_code",
275
275
  code,
276
276
  code_verifier: pending.verifier,
277
277
  redirect_uri: pending.redirectUri,
278
278
  client_id: this.clientId
279
- })
279
+ }).toString()
280
280
  });
281
281
  const body = await res.json();
282
282
  if (!res.ok || !body.access_token || !body.refresh_token) {
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
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';
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
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
  /**
@@ -524,7 +524,7 @@ declare class MymeClient {
524
524
  readonly keys: {
525
525
  /** Creates an API key. The raw key value is returned exactly once on
526
526
  * creation; the rest of the shape mirrors the persisted ApiKey record
527
- * (source, default_origin, default_tier, type_permissions, and
527
+ * (source, default_tier, type_permissions, and
528
528
  * extension_permissions are all stamped at create time and visible
529
529
  * here so the caller doesn't need a follow-up GET /keys to inspect
530
530
  * them). */
@@ -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
package/dist/index.js CHANGED
@@ -818,7 +818,7 @@ var MymeClient = class {
818
818
  keys = {
819
819
  /** Creates an API key. The raw key value is returned exactly once on
820
820
  * creation; the rest of the shape mirrors the persisted ApiKey record
821
- * (source, default_origin, default_tier, type_permissions, and
821
+ * (source, default_tier, type_permissions, and
822
822
  * extension_permissions are all stamped at create time and visible
823
823
  * here so the caller doesn't need a follow-up GET /keys to inspect
824
824
  * them). */
@@ -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) ----
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mymehq/sdk",
3
- "version": "4.9.0",
3
+ "version": "5.0.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.9.0"
23
+ "@mymehq/shared": "5.0.0"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@types/node": "^22.0.0",