@mymehq/sdk 5.4.0 → 5.6.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 +26 -0
- package/dist/index.js +22 -3
- package/package.json +2 -2
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 —
|
|
@@ -789,6 +797,24 @@ declare class MymeClient {
|
|
|
789
797
|
* surface for emergency revocation — pair with `client.keys.revoke`. */
|
|
790
798
|
list: (tenantId: string) => Promise<TenantApiKeySummary[]>;
|
|
791
799
|
};
|
|
800
|
+
accountDeletion: {
|
|
801
|
+
/**
|
|
802
|
+
* Force a one-shot run of the pending-delete purger (T-124).
|
|
803
|
+
* Returns the number of accounts purged this tick. Useful when
|
|
804
|
+
* an account has just passed its grace window and the operator
|
|
805
|
+
* doesn't want to wait for the next scheduled sweep (default
|
|
806
|
+
* cadence: 1 hour).
|
|
807
|
+
*
|
|
808
|
+
* Idempotent: re-running with no eligible rows returns 0. Only
|
|
809
|
+
* sweeps accounts already past `pending_deletion_at + grace_days`
|
|
810
|
+
* — does not bypass the grace window. The `run_at` timestamp is
|
|
811
|
+
* server-stamped at the moment `runOnce()` begins.
|
|
812
|
+
*/
|
|
813
|
+
purgeNow: () => Promise<{
|
|
814
|
+
purged_count: number;
|
|
815
|
+
run_at: string;
|
|
816
|
+
}>;
|
|
817
|
+
};
|
|
792
818
|
};
|
|
793
819
|
/**
|
|
794
820
|
* Account-lifecycle surface (T-116).
|
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) => {
|
|
@@ -1198,6 +1200,23 @@ var MymeClient = class {
|
|
|
1198
1200
|
const res = await this.transport.request("GET", `/admin/tenants/${encodeURIComponent(tenantId)}/keys`);
|
|
1199
1201
|
return res.data;
|
|
1200
1202
|
}
|
|
1203
|
+
},
|
|
1204
|
+
accountDeletion: {
|
|
1205
|
+
/**
|
|
1206
|
+
* Force a one-shot run of the pending-delete purger (T-124).
|
|
1207
|
+
* Returns the number of accounts purged this tick. Useful when
|
|
1208
|
+
* an account has just passed its grace window and the operator
|
|
1209
|
+
* doesn't want to wait for the next scheduled sweep (default
|
|
1210
|
+
* cadence: 1 hour).
|
|
1211
|
+
*
|
|
1212
|
+
* Idempotent: re-running with no eligible rows returns 0. Only
|
|
1213
|
+
* sweeps accounts already past `pending_deletion_at + grace_days`
|
|
1214
|
+
* — does not bypass the grace window. The `run_at` timestamp is
|
|
1215
|
+
* server-stamped at the moment `runOnce()` begins.
|
|
1216
|
+
*/
|
|
1217
|
+
purgeNow: async () => {
|
|
1218
|
+
return this.transport.request("POST", "/admin/account-deletion/purge-now");
|
|
1219
|
+
}
|
|
1201
1220
|
}
|
|
1202
1221
|
};
|
|
1203
1222
|
// ---- Auth (T-116) ----
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mymehq/sdk",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.6.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.
|
|
23
|
+
"@mymehq/shared": "5.6.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@types/node": "^22.0.0",
|