@mymehq/sdk 5.4.0 → 5.5.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
@@ -113,6 +113,14 @@ interface UpdateOptions {
113
113
  /** Toggle the tier (`library` ↔ `feed`). Independent of the version-merge
114
114
  * path for `properties`; a tier-only update never conflicts. */
115
115
  tier?: Tier;
116
+ /**
117
+ * Repoint the item at a new natural-key identifier under the caller's
118
+ * stamped `source`. The server enforces `(source, source_id)` uniqueness
119
+ * per tenant — a collision returns HTTP 409 `source_id_conflict`. PATCHing
120
+ * the value the item already carries is a no-op success. Used by the
121
+ * sync-agent (T-118) to preserve item identity through file renames.
122
+ */
123
+ source_id?: string;
116
124
  /**
117
125
  * Item type. Required by the `auto` strategy when a `keep_both_copies`
118
126
  * conflict spawns a sibling item. Omit to let the SDK pre-fetch it —
package/dist/index.js CHANGED
@@ -289,7 +289,7 @@ function toConflictError(response, clientPatch) {
289
289
  clientPatch
290
290
  );
291
291
  }
292
- async function handleConflictUpdate(transport, itemId, itemType, clientPatch, version, strategy, resolver, tier, onAutoMerge) {
292
+ async function handleConflictUpdate(transport, itemId, itemType, clientPatch, version, strategy, resolver, tier, onAutoMerge, sourceId) {
293
293
  let properties = clientPatch;
294
294
  let currentVersion = version;
295
295
  let pendingAutoMergeEvent;
@@ -298,7 +298,8 @@ async function handleConflictUpdate(transport, itemId, itemType, clientPatch, ve
298
298
  body: {
299
299
  properties,
300
300
  version: currentVersion,
301
- ...tier !== void 0 && { tier }
301
+ ...tier !== void 0 && { tier },
302
+ ...sourceId !== void 0 && { source_id: sourceId }
302
303
  }
303
304
  });
304
305
  if (!isConflictResponse(result)) {
@@ -473,7 +474,8 @@ var MymeClient = class {
473
474
  strategy,
474
475
  options?.resolve,
475
476
  options?.tier,
476
- onAutoMerge
477
+ onAutoMerge,
478
+ options?.source_id
477
479
  );
478
480
  },
479
481
  delete: async (id) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mymehq/sdk",
3
- "version": "5.4.0",
3
+ "version": "5.5.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": "5.4.0"
23
+ "@mymehq/shared": "5.5.0"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@types/node": "^22.0.0",