@mymehq/sdk 3.7.0 → 3.8.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
@@ -217,6 +217,47 @@ interface BulkResult {
217
217
  /** Present only on archive-restore paths. */
218
218
  blobs_imported?: number;
219
219
  }
220
+ /** One edge to create or upsert in a `POST /edges/bulk` call. */
221
+ interface BulkEdgeInputItem {
222
+ /** Optional server-id override. Server-generated UUIDv7 otherwise. */
223
+ id?: string;
224
+ source_id: string;
225
+ target_id: string;
226
+ edge_type: string;
227
+ properties?: Record<string, unknown>;
228
+ }
229
+ interface BulkEdgeInput {
230
+ edges: BulkEdgeInputItem[];
231
+ /** Default: `"upsert"`. On duplicate `(source_id, target_id, edge_type)`:
232
+ * `"upsert"` replaces properties in place; `"create_only"` skips with
233
+ * reason `"duplicate_edge"`. */
234
+ mode?: BulkMode;
235
+ /** Default: `true`. When false, errors are collected per edge and the
236
+ * batch continues past failures. */
237
+ atomic?: boolean;
238
+ /** Default: `false`. Per-edge `edge.created` / `edge.deleted` webhook
239
+ * events are suppressed on bulk writes unless the caller opts in. */
240
+ emit_events?: boolean;
241
+ }
242
+ interface BulkEdgeResultEntry {
243
+ index: number;
244
+ outcome: BulkOutcome;
245
+ id?: string;
246
+ reason?: string;
247
+ error?: {
248
+ code: string;
249
+ message: string;
250
+ };
251
+ }
252
+ interface BulkEdgeResult {
253
+ counts: {
254
+ created: number;
255
+ updated: number;
256
+ skipped: number;
257
+ errored: number;
258
+ };
259
+ results: BulkEdgeResultEntry[];
260
+ }
220
261
  /** Filter shape for `POST /items/bulk_action`. Mirrors the `GET /items`
221
262
  * query grammar — every field is AND-composed, `filter` accepts the
222
263
  * full filter-SQL DSL. */
@@ -388,6 +429,21 @@ declare class MymeClient {
388
429
  * are immutable; server rejects with 400. */
389
430
  update: (id: string, properties: Record<string, unknown>) => Promise<Edge>;
390
431
  delete: (id: string) => Promise<void>;
432
+ /**
433
+ * Create or upsert many edges in one call (admin-only). Up to 5000
434
+ * edges per call.
435
+ *
436
+ * Modes: `"upsert"` (default) replaces properties on existing
437
+ * `(source_id, target_id, edge_type)` triples; `"create_only"` surfaces
438
+ * duplicates as `skipped` with reason `"duplicate_edge"`. `atomic: true`
439
+ * (default) rolls back the whole batch on any failure — per-edge errors
440
+ * for non-atomic mode land in each result entry.
441
+ *
442
+ * Sibling to `items.bulk` for the edges half of mode-transition
443
+ * migrations (where cross-item edges can't reliably ride along as
444
+ * inline-edge payloads on the item writes).
445
+ */
446
+ bulk: (input: BulkEdgeInput) => Promise<BulkEdgeResult>;
391
447
  /** Outbound edges — items where this id is source. Filter by edge type
392
448
  * (comma-separated string or array of type ids). */
393
449
  listFromSource: (sourceId: string, filters?: {
@@ -570,4 +626,4 @@ interface VerifyWebhookSignatureInput {
570
626
  */
571
627
  declare function verifyWebhookSignature(input: VerifyWebhookSignatureInput): WebhookVerifyResult;
572
628
 
573
- export { type BulkActionErrorEntry, type BulkActionFilter, type BulkActionInput, type BulkActionResult, type BulkInput, type BulkItemInput, type BulkMode, type BulkOutcome, type BulkResult, type BulkResultEntry, type ClientConfig, type ConflictAutoMergeListener, type ConflictAutoMergedEvent, type ConflictData, ConflictError, type ConflictResolver, type ConflictStrategy, ForbiddenError, type ItemWithExtensions, type ListFilters, type MetadataInput, MymeClient, MymeError, NotFoundError, type SearchFilters, UnauthorizedError, type UpdateOptions, ValidationError, type VerifyWebhookSignatureInput, type WebhookVerifyReason, type WebhookVerifyResult, verifyWebhookSignature };
629
+ export { type BulkActionErrorEntry, type BulkActionFilter, type BulkActionInput, type BulkActionResult, type BulkEdgeInput, type BulkEdgeInputItem, type BulkEdgeResult, type BulkEdgeResultEntry, type BulkInput, type BulkItemInput, type BulkMode, type BulkOutcome, type BulkResult, type BulkResultEntry, type ClientConfig, type ConflictAutoMergeListener, type ConflictAutoMergedEvent, type ConflictData, ConflictError, type ConflictResolver, type ConflictStrategy, ForbiddenError, type ItemWithExtensions, type ListFilters, type MetadataInput, MymeClient, MymeError, NotFoundError, type SearchFilters, UnauthorizedError, type UpdateOptions, ValidationError, type VerifyWebhookSignatureInput, type WebhookVerifyReason, type WebhookVerifyResult, verifyWebhookSignature };
package/dist/index.js CHANGED
@@ -613,6 +613,25 @@ var MymeClient = class {
613
613
  delete: async (id) => {
614
614
  await this.transport.request("DELETE", `/edges/${id}`);
615
615
  },
616
+ /**
617
+ * Create or upsert many edges in one call (admin-only). Up to 5000
618
+ * edges per call.
619
+ *
620
+ * Modes: `"upsert"` (default) replaces properties on existing
621
+ * `(source_id, target_id, edge_type)` triples; `"create_only"` surfaces
622
+ * duplicates as `skipped` with reason `"duplicate_edge"`. `atomic: true`
623
+ * (default) rolls back the whole batch on any failure — per-edge errors
624
+ * for non-atomic mode land in each result entry.
625
+ *
626
+ * Sibling to `items.bulk` for the edges half of mode-transition
627
+ * migrations (where cross-item edges can't reliably ride along as
628
+ * inline-edge payloads on the item writes).
629
+ */
630
+ bulk: async (input) => {
631
+ return this.transport.request("POST", "/edges/bulk", {
632
+ body: input
633
+ });
634
+ },
616
635
  /** Outbound edges — items where this id is source. Filter by edge type
617
636
  * (comma-separated string or array of type ids). */
618
637
  listFromSource: async (sourceId, filters) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mymehq/sdk",
3
- "version": "3.7.0",
3
+ "version": "3.8.0",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org",