memorysync-sdk 1.0.2 → 1.1.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.js CHANGED
@@ -21,6 +21,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
21
21
  var index_exports = {};
22
22
  __export(index_exports, {
23
23
  AuthError: () => AuthError,
24
+ ControlPlaneClient: () => ControlPlaneClient,
24
25
  MemorySyncClient: () => MemorySyncClient,
25
26
  MemorySyncError: () => MemorySyncError,
26
27
  NotFoundError: () => NotFoundError,
@@ -29,47 +30,453 @@ __export(index_exports, {
29
30
  ValidationError: () => ValidationError
30
31
  });
31
32
  module.exports = __toCommonJS(index_exports);
33
+
34
+ // src/errors.ts
32
35
  var MemorySyncError = class extends Error {
33
- constructor(message, opts = {}) {
36
+ constructor(message, options = {}) {
34
37
  super(message);
35
38
  this.name = "MemorySyncError";
36
- this.statusCode = opts.statusCode;
37
- this.response = opts.response;
38
- this.requestId = opts.requestId;
39
+ this.statusCode = options.statusCode;
40
+ this.response = options.response;
41
+ this.requestId = options.requestId;
39
42
  }
40
43
  };
41
44
  var AuthError = class extends MemorySyncError {
42
- constructor(message, opts) {
43
- super(message, opts);
45
+ constructor(message, options) {
46
+ super(message, options);
44
47
  this.name = "AuthError";
45
48
  }
46
49
  };
47
50
  var ValidationError = class extends MemorySyncError {
48
- constructor(message, opts) {
49
- super(message, opts);
51
+ constructor(message, options) {
52
+ super(message, options);
50
53
  this.name = "ValidationError";
51
54
  }
52
55
  };
53
56
  var NotFoundError = class extends MemorySyncError {
54
- constructor(message, opts) {
55
- super(message, opts);
57
+ constructor(message, options) {
58
+ super(message, options);
56
59
  this.name = "NotFoundError";
57
60
  }
58
61
  };
59
62
  var RateLimitError = class extends MemorySyncError {
60
- constructor(message, retryAfterSeconds, opts) {
61
- super(message, opts);
63
+ constructor(message, retryAfterSeconds, options) {
64
+ super(message, options);
62
65
  this.name = "RateLimitError";
63
66
  this.retryAfterSeconds = retryAfterSeconds;
64
67
  }
65
68
  };
66
69
  var ServerError = class extends MemorySyncError {
67
- constructor(message, opts) {
68
- super(message, opts);
70
+ constructor(message, options) {
71
+ super(message, options);
69
72
  this.name = "ServerError";
70
73
  }
71
74
  };
72
- var SDK_VERSION = "1.0.1";
75
+
76
+ // src/control-plane.ts
77
+ var SDK_VERSION = "1.1.0";
78
+ function safeJson(text) {
79
+ try {
80
+ return JSON.parse(text);
81
+ } catch {
82
+ return text;
83
+ }
84
+ }
85
+ function extractDetail(body) {
86
+ if (!body || typeof body !== "object") return void 0;
87
+ const value = body;
88
+ if (typeof value.detail === "string") return value.detail;
89
+ if (value.error && typeof value.error === "object") {
90
+ const error = value.error;
91
+ if (typeof error.message === "string") return error.message;
92
+ }
93
+ if (Array.isArray(value.detail) && value.detail.length > 0) {
94
+ const first = value.detail[0];
95
+ if (first && typeof first === "object" && typeof first.msg === "string") {
96
+ return first.msg;
97
+ }
98
+ }
99
+ return void 0;
100
+ }
101
+ function extractBodyRetryAfter(body) {
102
+ if (!body || typeof body !== "object") return 0;
103
+ const value = body;
104
+ if (typeof value.retry_after === "number") return value.retry_after;
105
+ if (value.error && typeof value.error === "object") {
106
+ const retryAfter = value.error.retry_after;
107
+ if (typeof retryAfter === "number") return retryAfter;
108
+ }
109
+ return 0;
110
+ }
111
+ function parseRetryAfter(value) {
112
+ if (!value) return void 0;
113
+ const seconds = Number(value);
114
+ if (Number.isFinite(seconds) && seconds >= 0) return seconds;
115
+ const date = Date.parse(value);
116
+ if (Number.isNaN(date)) return void 0;
117
+ return Math.max(0, Math.ceil((date - Date.now()) / 1e3));
118
+ }
119
+ function snakeToCamel(key) {
120
+ return key.replace(/_([a-z0-9])/g, (_, character) => character.toUpperCase());
121
+ }
122
+ var OPAQUE_RESPONSE_KEYS = /* @__PURE__ */ new Set(["payload", "metadata", "geo", "configuration"]);
123
+ function normalizeResponse(value) {
124
+ if (Array.isArray(value)) return value.map(normalizeResponse);
125
+ if (!value || typeof value !== "object") return value;
126
+ const normalized = {};
127
+ for (const [key, item] of Object.entries(value)) {
128
+ const camelKey = snakeToCamel(key);
129
+ normalized[camelKey] = OPAQUE_RESPONSE_KEYS.has(camelKey) ? item : normalizeResponse(item);
130
+ }
131
+ return normalized;
132
+ }
133
+ function queryString(values) {
134
+ const params = new URLSearchParams();
135
+ for (const [key, value] of Object.entries(values)) {
136
+ if (value !== void 0 && value !== null) params.set(key, String(value));
137
+ }
138
+ const encoded = params.toString();
139
+ return encoded ? `?${encoded}` : "";
140
+ }
141
+ function positiveId(value, name) {
142
+ if (!Number.isInteger(value) || value <= 0) {
143
+ throw new ValidationError(`${name} must be a positive integer`);
144
+ }
145
+ }
146
+ function nonEmpty(value, name) {
147
+ if (!value.trim()) throw new ValidationError(`${name} must not be empty`);
148
+ }
149
+ function webhookRetryConfig(config) {
150
+ const wire = {};
151
+ if (config.enabled !== void 0) wire.enabled = config.enabled;
152
+ if (config.maxRetries !== void 0) wire.max_retries = config.maxRetries;
153
+ if (config.initialDelaySeconds !== void 0) wire.initial_delay_seconds = config.initialDelaySeconds;
154
+ if (config.maxDelaySeconds !== void 0) wire.max_delay_seconds = config.maxDelaySeconds;
155
+ if (config.backoffMultiplier !== void 0) wire.backoff_multiplier = config.backoffMultiplier;
156
+ if (config.retryStatusCodes !== void 0) wire.retry_status_codes = config.retryStatusCodes;
157
+ return wire;
158
+ }
159
+ function webhookSignatureConfig(config) {
160
+ const wire = {};
161
+ if (config.algorithm !== void 0) wire.algorithm = config.algorithm;
162
+ if (config.headerName !== void 0) wire.header_name = config.headerName;
163
+ if (config.timestampHeader !== void 0) wire.timestamp_header = config.timestampHeader;
164
+ if (config.toleranceSeconds !== void 0) wire.tolerance_seconds = config.toleranceSeconds;
165
+ return wire;
166
+ }
167
+ function validateWebhook(name, url, events) {
168
+ nonEmpty(name, "name");
169
+ if (name.length > 128) throw new ValidationError("name may contain at most 128 characters");
170
+ if (!Array.isArray(events) || events.length === 0 || events.some((event) => !event.trim())) {
171
+ throw new ValidationError("events must contain at least one non-empty event type");
172
+ }
173
+ let parsed;
174
+ try {
175
+ parsed = new URL(url);
176
+ } catch {
177
+ throw new ValidationError("url must be a valid HTTP or HTTPS URL");
178
+ }
179
+ if (parsed.protocol !== "http:" && parsed.protocol !== "https:") {
180
+ throw new ValidationError("url must be a valid HTTP or HTTPS URL");
181
+ }
182
+ if (parsed.username || parsed.password) throw new ValidationError("url must not contain credentials");
183
+ }
184
+ var ControlPlaneClient = class {
185
+ constructor(config) {
186
+ if (!config.baseUrl?.trim()) throw new ValidationError("baseUrl is required");
187
+ let parsed;
188
+ try {
189
+ parsed = new URL(config.baseUrl);
190
+ } catch {
191
+ throw new ValidationError("baseUrl must be an absolute HTTP or HTTPS URL");
192
+ }
193
+ if (parsed.protocol !== "http:" && parsed.protocol !== "https:") {
194
+ throw new ValidationError("baseUrl must be an absolute HTTP or HTTPS URL");
195
+ }
196
+ if (config.accessToken !== void 0 && !config.accessToken.trim()) {
197
+ throw new ValidationError("accessToken must not be empty when provided");
198
+ }
199
+ if (config.projectId !== void 0 && !config.projectId.trim()) {
200
+ throw new ValidationError("projectId must not be empty when provided");
201
+ }
202
+ if (config.timeoutMs !== void 0 && (!Number.isFinite(config.timeoutMs) || config.timeoutMs <= 0)) {
203
+ throw new ValidationError("timeoutMs must be greater than zero");
204
+ }
205
+ this.baseUrl = config.baseUrl.replace(/\/+$/, "");
206
+ this.accessToken = config.accessToken?.trim();
207
+ this.projectId = config.projectId?.trim();
208
+ this.timeoutMs = config.timeoutMs ?? 3e4;
209
+ const implementation = config.fetch ?? (typeof fetch !== "undefined" ? fetch : void 0);
210
+ if (!implementation) {
211
+ throw new Error("No fetch implementation available. Pass `fetch` in config or use Node 18+.");
212
+ }
213
+ this.fetchImpl = implementation;
214
+ }
215
+ async request(method, path, options = {}) {
216
+ const requiresAuth = options.auth !== false;
217
+ if (requiresAuth && !this.accessToken) {
218
+ throw new AuthError("accessToken is required for this operation");
219
+ }
220
+ if (options.projectId !== void 0 && !options.projectId.trim()) {
221
+ throw new ValidationError("projectId override must not be empty");
222
+ }
223
+ const headers = {
224
+ Accept: "application/json",
225
+ "User-Agent": `memorysync-sdk-js/${SDK_VERSION}`
226
+ };
227
+ if (requiresAuth) headers.Authorization = `Bearer ${this.accessToken}`;
228
+ const selectedProject = options.projectId?.trim() ?? this.projectId;
229
+ if (selectedProject) headers["X-Project-ID"] = selectedProject;
230
+ if (options.body !== void 0) headers["Content-Type"] = "application/json";
231
+ const controller = new AbortController();
232
+ const timer = setTimeout(() => controller.abort(), this.timeoutMs);
233
+ try {
234
+ const response = await this.fetchImpl(`${this.baseUrl}${path}`, {
235
+ method,
236
+ headers,
237
+ body: options.body === void 0 ? void 0 : JSON.stringify(options.body),
238
+ signal: controller.signal
239
+ });
240
+ const requestId = response.headers.get("X-Request-ID") ?? void 0;
241
+ if (response.status === 204) return void 0;
242
+ const text = await response.text();
243
+ const parsedBody = text ? safeJson(text) : null;
244
+ if (!response.ok) {
245
+ this.throwForStatus(response.status, parsedBody, requestId, response.headers.get("Retry-After"));
246
+ }
247
+ return normalizeResponse(parsedBody);
248
+ } catch (error) {
249
+ if (error instanceof MemorySyncError) throw error;
250
+ if (error instanceof Error && error.name === "AbortError") {
251
+ throw new MemorySyncError(`Request timed out after ${this.timeoutMs}ms`);
252
+ }
253
+ const message = error instanceof Error ? error.message : String(error);
254
+ throw new MemorySyncError(`Network error: ${message}`);
255
+ } finally {
256
+ clearTimeout(timer);
257
+ }
258
+ }
259
+ throwForStatus(status, body, requestId, retryAfterHeader) {
260
+ const detail = extractDetail(body);
261
+ const options = { statusCode: status, response: body, requestId };
262
+ if (status === 401) throw new AuthError(detail || "Unauthenticated", options);
263
+ if (status === 403) throw new AuthError(detail || "Forbidden", options);
264
+ if (status === 404) throw new NotFoundError(detail || "Not found", options);
265
+ if (status === 400 || status === 409 || status === 422) {
266
+ throw new ValidationError(detail || "Validation error", options);
267
+ }
268
+ if (status === 429) {
269
+ const retryAfter = parseRetryAfter(retryAfterHeader) ?? extractBodyRetryAfter(body);
270
+ throw new RateLimitError(detail || "Rate limited", retryAfter, options);
271
+ }
272
+ if (status >= 500) throw new ServerError(detail || `Server error (${status})`, options);
273
+ throw new MemorySyncError(detail || `Unexpected status ${status}`, options);
274
+ }
275
+ async bulkRevokeApiKeys(request, options = {}) {
276
+ if (!Array.isArray(request.keyIds) || request.keyIds.length < 1 || request.keyIds.length > 100) {
277
+ throw new ValidationError("keyIds must contain between 1 and 100 entries");
278
+ }
279
+ request.keyIds.forEach((id) => positiveId(id, "keyIds entry"));
280
+ return this.request("POST", "/org/api-keys/bulk-revoke", {
281
+ ...options,
282
+ body: { key_ids: request.keyIds }
283
+ });
284
+ }
285
+ async testApiKey(keyId, options = {}) {
286
+ positiveId(keyId, "keyId");
287
+ return this.request("POST", `/org/api-keys/${keyId}/test`, options);
288
+ }
289
+ async login(request, options = {}) {
290
+ nonEmpty(request.email, "email");
291
+ nonEmpty(request.password, "password");
292
+ if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(request.email)) {
293
+ throw new ValidationError("email must be a valid email address");
294
+ }
295
+ return this.request("POST", "/auth/login", {
296
+ ...options,
297
+ auth: false,
298
+ body: { email: request.email, password: request.password }
299
+ });
300
+ }
301
+ async getCurrentPlan(options = {}) {
302
+ return this.request("GET", "/org/billing/current-plan", options);
303
+ }
304
+ async listTeamMembers(options = {}) {
305
+ return this.request("GET", "/admin/team/members", options);
306
+ }
307
+ async suspendTeamMember(memberId, options = {}) {
308
+ positiveId(memberId, "memberId");
309
+ return this.request("PATCH", `/admin/team/members/${memberId}`, {
310
+ ...options,
311
+ body: { status: "suspended" }
312
+ });
313
+ }
314
+ async removeTeamMember(memberId, options = {}) {
315
+ positiveId(memberId, "memberId");
316
+ return this.request("DELETE", `/admin/team/members/${memberId}`, options);
317
+ }
318
+ async listSessions(options = {}) {
319
+ return this.request("GET", "/auth/sessions", options);
320
+ }
321
+ async revokeSession(sessionId, options = {}) {
322
+ positiveId(sessionId, "sessionId");
323
+ return this.request("POST", `/auth/sessions/${sessionId}/revoke`, options);
324
+ }
325
+ async listAuditEvents(query = {}, options = {}) {
326
+ if (query.limit !== void 0) positiveId(query.limit, "limit");
327
+ if (query.cursor !== void 0) positiveId(query.cursor, "cursor");
328
+ if (query.skip !== void 0 && (!Number.isInteger(query.skip) || query.skip < 0)) {
329
+ throw new ValidationError("skip must be a non-negative integer");
330
+ }
331
+ const path = "/admin/audit-logs" + queryString({
332
+ limit: query.limit,
333
+ cursor: query.cursor,
334
+ skip: query.skip,
335
+ sort: query.sortDirection,
336
+ tenant_id: query.tenantId,
337
+ actor: query.actor,
338
+ actor_email: query.actorEmail,
339
+ ip: query.ip,
340
+ action: query.action,
341
+ resource_type: query.resourceType,
342
+ resource_id: query.resourceId,
343
+ severity: query.severity,
344
+ category: query.category,
345
+ start: query.start,
346
+ end: query.end,
347
+ success: query.success,
348
+ source: query.source,
349
+ ingest_method: query.ingestMethod,
350
+ search: query.search
351
+ });
352
+ const raw = await this.request("GET", path, options);
353
+ return {
354
+ events: raw.logs ?? [],
355
+ nextCursor: raw.nextCursor ?? null,
356
+ stats: raw.stats ?? null,
357
+ sort: raw.sort ?? query.sortDirection ?? "desc"
358
+ };
359
+ }
360
+ async listIntegrations(query = {}, options = {}) {
361
+ const path = "/api/v1/integrations/catalog" + queryString({ category: query.category });
362
+ return this.request("GET", path, options);
363
+ }
364
+ async createOrganization(request, options = {}) {
365
+ nonEmpty(request.name, "name");
366
+ if (request.domain !== void 0) nonEmpty(request.domain, "domain");
367
+ const body = { name: request.name };
368
+ if (request.domain !== void 0) body.domain = request.domain;
369
+ return this.request("POST", "/organizations", { ...options, body });
370
+ }
371
+ async listOrganizations(options = {}) {
372
+ return this.request("GET", "/organizations", options);
373
+ }
374
+ async listOrganizationMembers(options = {}) {
375
+ return this.listTeamMembers(options);
376
+ }
377
+ async getOrganizationSettings(query = {}, options = {}) {
378
+ if (query.tenantId !== void 0) nonEmpty(query.tenantId, "tenantId");
379
+ const path = "/admin/tenant-settings" + queryString({ tenant_id: query.tenantId });
380
+ return this.request("GET", path, options);
381
+ }
382
+ async listProjects(options = {}) {
383
+ return this.request("GET", "/org/projects", options);
384
+ }
385
+ async createWebhook(request, options = {}) {
386
+ validateWebhook(request.name, request.url, request.events);
387
+ if (request.description !== void 0 && request.description.length > 500) {
388
+ throw new ValidationError("description may contain at most 500 characters");
389
+ }
390
+ if (request.projectId !== void 0) nonEmpty(request.projectId, "projectId");
391
+ const body = { name: request.name, url: request.url, events: request.events };
392
+ if (request.description !== void 0) body.description = request.description;
393
+ if (request.retryConfig !== void 0) body.retry_config = webhookRetryConfig(request.retryConfig);
394
+ if (request.signatureConfig !== void 0) body.signature_config = webhookSignatureConfig(request.signatureConfig);
395
+ if (request.projectId !== void 0) body.project_id = request.projectId;
396
+ return this.request("POST", "/org/webhooks", { ...options, body });
397
+ }
398
+ async listWebhooks(options = {}) {
399
+ return this.request("GET", "/org/webhooks", options);
400
+ }
401
+ async updateWebhook(endpointId, request, options = {}) {
402
+ positiveId(endpointId, "endpointId");
403
+ const body = {};
404
+ if (request.name !== void 0) {
405
+ nonEmpty(request.name, "name");
406
+ if (request.name.length > 128) throw new ValidationError("name may contain at most 128 characters");
407
+ body.name = request.name;
408
+ }
409
+ if (request.url !== void 0) {
410
+ validateWebhook("update", request.url, ["validation"]);
411
+ body.url = request.url;
412
+ }
413
+ if (request.description !== void 0) {
414
+ if (request.description.length > 500) {
415
+ throw new ValidationError("description may contain at most 500 characters");
416
+ }
417
+ body.description = request.description;
418
+ }
419
+ if (request.events !== void 0) {
420
+ if (request.events.length === 0 || request.events.some((event) => !event.trim())) {
421
+ throw new ValidationError("events must contain at least one non-empty event type");
422
+ }
423
+ body.events = request.events;
424
+ }
425
+ if (request.retryConfig !== void 0) body.retry_config = webhookRetryConfig(request.retryConfig);
426
+ if (request.signatureConfig !== void 0) body.signature_config = webhookSignatureConfig(request.signatureConfig);
427
+ if (Object.keys(body).length === 0) {
428
+ throw new ValidationError("updateWebhook requires at least one editable field");
429
+ }
430
+ return this.request("PATCH", `/org/webhooks/${endpointId}`, { ...options, body });
431
+ }
432
+ async deleteWebhook(endpointId, options = {}) {
433
+ positiveId(endpointId, "endpointId");
434
+ return this.request("DELETE", `/org/webhooks/${endpointId}`, options);
435
+ }
436
+ async testWebhook(endpointId, request = {}, options = {}) {
437
+ positiveId(endpointId, "endpointId");
438
+ const body = {};
439
+ if (request.eventType !== void 0) {
440
+ nonEmpty(request.eventType, "eventType");
441
+ body.event_type = request.eventType;
442
+ }
443
+ return this.request("POST", `/org/webhooks/${endpointId}/test`, { ...options, body });
444
+ }
445
+ async replayWebhookDeliveries(endpointId, request = {}, options = {}) {
446
+ positiveId(endpointId, "endpointId");
447
+ if (request.sinceMinutes !== void 0 && (!Number.isInteger(request.sinceMinutes) || request.sinceMinutes < 1 || request.sinceMinutes > 10080)) {
448
+ throw new ValidationError("sinceMinutes must be an integer between 1 and 10080");
449
+ }
450
+ if (request.limit !== void 0 && (!Number.isInteger(request.limit) || request.limit < 1 || request.limit > 1e3)) {
451
+ throw new ValidationError("limit must be an integer between 1 and 1000");
452
+ }
453
+ if (request.statuses !== void 0 && (request.statuses.length === 0 || request.statuses.some((status) => !status.trim()))) {
454
+ throw new ValidationError("statuses must contain at least one non-empty status");
455
+ }
456
+ const body = {};
457
+ if (request.sinceMinutes !== void 0) body.since_minutes = request.sinceMinutes;
458
+ if (request.statuses !== void 0) body.statuses = request.statuses;
459
+ if (request.limit !== void 0) body.limit = request.limit;
460
+ return this.request("POST", `/org/webhooks/${endpointId}/replay`, { ...options, body });
461
+ }
462
+ async listWebhookDeliveries(endpointId, query = {}, options = {}) {
463
+ positiveId(endpointId, "endpointId");
464
+ if (query.page !== void 0) positiveId(query.page, "page");
465
+ if (query.pageSize !== void 0 && (!Number.isInteger(query.pageSize) || query.pageSize < 1 || query.pageSize > 100)) {
466
+ throw new ValidationError("pageSize must be an integer between 1 and 100");
467
+ }
468
+ if (query.status !== void 0) nonEmpty(query.status, "status");
469
+ const path = `/org/webhooks/${endpointId}/deliveries` + queryString({
470
+ page: query.page,
471
+ page_size: query.pageSize,
472
+ status_filter: query.status
473
+ });
474
+ return this.request("GET", path, options);
475
+ }
476
+ };
477
+
478
+ // src/index.ts
479
+ var SDK_VERSION2 = "1.1.0";
73
480
  function camelToSnakeKey(key) {
74
481
  return key.replace(/([A-Z])/g, "_$1").toLowerCase();
75
482
  }
@@ -98,14 +505,14 @@ function snakeToCamelMemory(m) {
98
505
  score: m.score ?? null
99
506
  };
100
507
  }
101
- function safeJson(text) {
508
+ function safeJson2(text) {
102
509
  try {
103
510
  return JSON.parse(text);
104
511
  } catch {
105
512
  return text;
106
513
  }
107
514
  }
108
- function extractDetail(body) {
515
+ function extractDetail2(body) {
109
516
  if (!body || typeof body !== "object") return void 0;
110
517
  const b = body;
111
518
  if (typeof b.detail === "string") return b.detail;
@@ -149,7 +556,7 @@ var MemorySyncClient = class {
149
556
  "X-API-Key": this.apiKey,
150
557
  "Content-Type": "application/json",
151
558
  "Accept": "application/json",
152
- "User-Agent": `memorysync-sdk-js/${SDK_VERSION}`,
559
+ "User-Agent": `memorysync-sdk-js/${SDK_VERSION2}`,
153
560
  ...extra
154
561
  };
155
562
  if (this.projectId) h["X-Project-ID"] = this.projectId;
@@ -173,7 +580,7 @@ var MemorySyncClient = class {
173
580
  const requestId = res.headers.get("X-Request-ID") ?? void 0;
174
581
  if (res.status === 204) return void 0;
175
582
  const text = await res.text();
176
- const parsed = text ? safeJson(text) : null;
583
+ const parsed = text ? safeJson2(text) : null;
177
584
  if (!res.ok) this.throwForStatus(res.status, parsed, requestId);
178
585
  return parsed;
179
586
  } catch (e) {
@@ -187,7 +594,7 @@ var MemorySyncClient = class {
187
594
  }
188
595
  }
189
596
  throwForStatus(status, body, requestId) {
190
- const detail = extractDetail(body);
597
+ const detail = extractDetail2(body);
191
598
  const opts = { statusCode: status, response: body, requestId };
192
599
  if (status === 401) throw new AuthError(detail || "Unauthenticated", opts);
193
600
  if (status === 403) throw new AuthError(detail || "Forbidden", opts);
@@ -363,6 +770,7 @@ var MemorySyncClient = class {
363
770
  // Annotate the CommonJS export names for ESM import in node:
364
771
  0 && (module.exports = {
365
772
  AuthError,
773
+ ControlPlaneClient,
366
774
  MemorySyncClient,
367
775
  MemorySyncError,
368
776
  NotFoundError,