@cstar.help/js 0.14.0 → 0.15.1

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.
@@ -187,6 +187,403 @@ interface CommunityPostDetail {
187
187
  comments: CommunityComment[];
188
188
  }
189
189
 
190
+ /**
191
+ * Error classes for the cStar SDK.
192
+ *
193
+ * NEW-v3-01 — Cross-subpath instanceof identity.
194
+ *
195
+ * Each public subpath (`/library`, `/auth`, `/community`, `/quickhelp`, ...)
196
+ * is bundled as a separate tsup entry with `splitting: false`, so each one
197
+ * carries its own copy of this module. Without deduplication, errors thrown
198
+ * by `LibraryClient` carry the LibraryClient-bundled `CStarError` class —
199
+ * not the one a consumer imports from `@cstar.help/js`. That makes
200
+ * `instanceof CStarError` checks fail silently, invalidating every "did the
201
+ * SDK throw a typed cStar error?" branch in user code.
202
+ *
203
+ * Fix: register each class on a `Symbol.for(...)` slot of `globalThis`. The
204
+ * symbol is realm-shared, so every bundled copy of this module resolves to
205
+ * the SAME class identity at runtime — the first copy to load wins, and all
206
+ * subsequent copies surface the canonical class via the same slot. The
207
+ * inline `Impl` definitions are only used as the seed for the very first
208
+ * copy to register. Internal `parseError` / `parsePublicError` reference the
209
+ * EXPORTED canonical names so instances they construct also land on the
210
+ * canonical class.
211
+ */
212
+ /** Error type constants matching the cStar API. */
213
+ declare const ErrorType: {
214
+ readonly AUTHENTICATION_ERROR: "authentication_error";
215
+ readonly PERMISSION_ERROR: "permission_error";
216
+ readonly INVALID_REQUEST_ERROR: "invalid_request_error";
217
+ readonly NOT_FOUND_ERROR: "not_found_error";
218
+ readonly CONFLICT_ERROR: "conflict_error";
219
+ readonly RATE_LIMIT_ERROR: "rate_limit_error";
220
+ readonly FEATURE_NOT_CONFIGURED: "feature_not_configured";
221
+ readonly API_ERROR: "api_error";
222
+ readonly SERVER_ERROR: "server_error";
223
+ };
224
+ /** Shape of the error object returned by the cStar API. */
225
+ interface ApiErrorBody {
226
+ type: string;
227
+ code: string;
228
+ message: string;
229
+ param?: string;
230
+ doc_url: string;
231
+ request_id?: string;
232
+ feature?: string;
233
+ enable_url?: string;
234
+ }
235
+ /** Base error class for all cStar API errors. */
236
+ declare const CStarErrorImpl: {
237
+ new (messageOrStatus: string | number, body?: ApiErrorBody): {
238
+ readonly type: string;
239
+ readonly code: string;
240
+ readonly param?: string;
241
+ readonly docUrl: string;
242
+ readonly requestId?: string;
243
+ readonly statusCode: number;
244
+ name: string;
245
+ message: string;
246
+ stack?: string;
247
+ };
248
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
249
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
250
+ stackTraceLimit: number;
251
+ };
252
+ declare const CStarAuthenticationErrorImpl: {
253
+ new (messageOrStatus: string | number, body?: ApiErrorBody): {
254
+ readonly type: string;
255
+ readonly code: string;
256
+ readonly param?: string;
257
+ readonly docUrl: string;
258
+ readonly requestId?: string;
259
+ readonly statusCode: number;
260
+ name: string;
261
+ message: string;
262
+ stack?: string;
263
+ };
264
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
265
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
266
+ stackTraceLimit: number;
267
+ };
268
+ declare const CStarRateLimitErrorImpl: {
269
+ new (messageOrStatus: string | number, body?: ApiErrorBody, retryAfter?: number): {
270
+ readonly retryAfter: number;
271
+ readonly type: string;
272
+ readonly code: string;
273
+ readonly param?: string;
274
+ readonly docUrl: string;
275
+ readonly requestId?: string;
276
+ readonly statusCode: number;
277
+ name: string;
278
+ message: string;
279
+ stack?: string;
280
+ };
281
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
282
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
283
+ stackTraceLimit: number;
284
+ };
285
+ declare const CStarNotFoundErrorImpl: {
286
+ new (messageOrStatus: string | number, body?: ApiErrorBody): {
287
+ readonly type: string;
288
+ readonly code: string;
289
+ readonly param?: string;
290
+ readonly docUrl: string;
291
+ readonly requestId?: string;
292
+ readonly statusCode: number;
293
+ name: string;
294
+ message: string;
295
+ stack?: string;
296
+ };
297
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
298
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
299
+ stackTraceLimit: number;
300
+ };
301
+ declare const CStarValidationErrorImpl: {
302
+ new (messageOrStatus: string | number, body?: ApiErrorBody): {
303
+ readonly type: string;
304
+ readonly code: string;
305
+ readonly param?: string;
306
+ readonly docUrl: string;
307
+ readonly requestId?: string;
308
+ readonly statusCode: number;
309
+ name: string;
310
+ message: string;
311
+ stack?: string;
312
+ };
313
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
314
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
315
+ stackTraceLimit: number;
316
+ };
317
+ declare const CStarPermissionErrorImpl: {
318
+ new (messageOrStatus: string | number, body?: ApiErrorBody): {
319
+ readonly type: string;
320
+ readonly code: string;
321
+ readonly param?: string;
322
+ readonly docUrl: string;
323
+ readonly requestId?: string;
324
+ readonly statusCode: number;
325
+ name: string;
326
+ message: string;
327
+ stack?: string;
328
+ };
329
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
330
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
331
+ stackTraceLimit: number;
332
+ };
333
+ declare const CStarConflictErrorImpl: {
334
+ new (messageOrStatus: string | number, body?: ApiErrorBody): {
335
+ readonly type: string;
336
+ readonly code: string;
337
+ readonly param?: string;
338
+ readonly docUrl: string;
339
+ readonly requestId?: string;
340
+ readonly statusCode: number;
341
+ name: string;
342
+ message: string;
343
+ stack?: string;
344
+ };
345
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
346
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
347
+ stackTraceLimit: number;
348
+ };
349
+ declare const CStarServerErrorImpl: {
350
+ new (messageOrStatus: string | number, body?: ApiErrorBody): {
351
+ readonly type: string;
352
+ readonly code: string;
353
+ readonly param?: string;
354
+ readonly docUrl: string;
355
+ readonly requestId?: string;
356
+ readonly statusCode: number;
357
+ name: string;
358
+ message: string;
359
+ stack?: string;
360
+ };
361
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
362
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
363
+ stackTraceLimit: number;
364
+ };
365
+ declare const CStarFeatureDisabledErrorImpl: {
366
+ new (messageOrStatus: string | number, body?: ApiErrorBody): {
367
+ readonly feature: string;
368
+ readonly enableUrl: string;
369
+ readonly type: string;
370
+ readonly code: string;
371
+ readonly param?: string;
372
+ readonly docUrl: string;
373
+ readonly requestId?: string;
374
+ readonly statusCode: number;
375
+ name: string;
376
+ message: string;
377
+ stack?: string;
378
+ };
379
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
380
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
381
+ stackTraceLimit: number;
382
+ };
383
+ declare const CStarRealtimeUnavailableErrorImpl: {
384
+ new (message?: string): {
385
+ readonly type: string;
386
+ readonly code: string;
387
+ readonly param?: string;
388
+ readonly docUrl: string;
389
+ readonly requestId?: string;
390
+ readonly statusCode: number;
391
+ name: string;
392
+ message: string;
393
+ stack?: string;
394
+ };
395
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
396
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
397
+ stackTraceLimit: number;
398
+ };
399
+ declare const CStarError: {
400
+ new (messageOrStatus: string | number, body?: ApiErrorBody): {
401
+ readonly type: string;
402
+ readonly code: string;
403
+ readonly param?: string;
404
+ readonly docUrl: string;
405
+ readonly requestId?: string;
406
+ readonly statusCode: number;
407
+ name: string;
408
+ message: string;
409
+ stack?: string;
410
+ };
411
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
412
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
413
+ stackTraceLimit: number;
414
+ };
415
+ type CStarError = InstanceType<typeof CStarErrorImpl>;
416
+ declare const CStarAuthenticationError: {
417
+ new (messageOrStatus: string | number, body?: ApiErrorBody): {
418
+ readonly type: string;
419
+ readonly code: string;
420
+ readonly param?: string;
421
+ readonly docUrl: string;
422
+ readonly requestId?: string;
423
+ readonly statusCode: number;
424
+ name: string;
425
+ message: string;
426
+ stack?: string;
427
+ };
428
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
429
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
430
+ stackTraceLimit: number;
431
+ };
432
+ type CStarAuthenticationError = InstanceType<typeof CStarAuthenticationErrorImpl>;
433
+ declare const CStarRateLimitError: {
434
+ new (messageOrStatus: string | number, body?: ApiErrorBody, retryAfter?: number): {
435
+ readonly retryAfter: number;
436
+ readonly type: string;
437
+ readonly code: string;
438
+ readonly param?: string;
439
+ readonly docUrl: string;
440
+ readonly requestId?: string;
441
+ readonly statusCode: number;
442
+ name: string;
443
+ message: string;
444
+ stack?: string;
445
+ };
446
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
447
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
448
+ stackTraceLimit: number;
449
+ };
450
+ type CStarRateLimitError = InstanceType<typeof CStarRateLimitErrorImpl>;
451
+ declare const CStarNotFoundError: {
452
+ new (messageOrStatus: string | number, body?: ApiErrorBody): {
453
+ readonly type: string;
454
+ readonly code: string;
455
+ readonly param?: string;
456
+ readonly docUrl: string;
457
+ readonly requestId?: string;
458
+ readonly statusCode: number;
459
+ name: string;
460
+ message: string;
461
+ stack?: string;
462
+ };
463
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
464
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
465
+ stackTraceLimit: number;
466
+ };
467
+ type CStarNotFoundError = InstanceType<typeof CStarNotFoundErrorImpl>;
468
+ declare const CStarValidationError: {
469
+ new (messageOrStatus: string | number, body?: ApiErrorBody): {
470
+ readonly type: string;
471
+ readonly code: string;
472
+ readonly param?: string;
473
+ readonly docUrl: string;
474
+ readonly requestId?: string;
475
+ readonly statusCode: number;
476
+ name: string;
477
+ message: string;
478
+ stack?: string;
479
+ };
480
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
481
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
482
+ stackTraceLimit: number;
483
+ };
484
+ type CStarValidationError = InstanceType<typeof CStarValidationErrorImpl>;
485
+ declare const CStarPermissionError: {
486
+ new (messageOrStatus: string | number, body?: ApiErrorBody): {
487
+ readonly type: string;
488
+ readonly code: string;
489
+ readonly param?: string;
490
+ readonly docUrl: string;
491
+ readonly requestId?: string;
492
+ readonly statusCode: number;
493
+ name: string;
494
+ message: string;
495
+ stack?: string;
496
+ };
497
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
498
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
499
+ stackTraceLimit: number;
500
+ };
501
+ type CStarPermissionError = InstanceType<typeof CStarPermissionErrorImpl>;
502
+ declare const CStarConflictError: {
503
+ new (messageOrStatus: string | number, body?: ApiErrorBody): {
504
+ readonly type: string;
505
+ readonly code: string;
506
+ readonly param?: string;
507
+ readonly docUrl: string;
508
+ readonly requestId?: string;
509
+ readonly statusCode: number;
510
+ name: string;
511
+ message: string;
512
+ stack?: string;
513
+ };
514
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
515
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
516
+ stackTraceLimit: number;
517
+ };
518
+ type CStarConflictError = InstanceType<typeof CStarConflictErrorImpl>;
519
+ declare const CStarServerError: {
520
+ new (messageOrStatus: string | number, body?: ApiErrorBody): {
521
+ readonly type: string;
522
+ readonly code: string;
523
+ readonly param?: string;
524
+ readonly docUrl: string;
525
+ readonly requestId?: string;
526
+ readonly statusCode: number;
527
+ name: string;
528
+ message: string;
529
+ stack?: string;
530
+ };
531
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
532
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
533
+ stackTraceLimit: number;
534
+ };
535
+ type CStarServerError = InstanceType<typeof CStarServerErrorImpl>;
536
+ declare const CStarFeatureDisabledError: {
537
+ new (messageOrStatus: string | number, body?: ApiErrorBody): {
538
+ readonly feature: string;
539
+ readonly enableUrl: string;
540
+ readonly type: string;
541
+ readonly code: string;
542
+ readonly param?: string;
543
+ readonly docUrl: string;
544
+ readonly requestId?: string;
545
+ readonly statusCode: number;
546
+ name: string;
547
+ message: string;
548
+ stack?: string;
549
+ };
550
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
551
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
552
+ stackTraceLimit: number;
553
+ };
554
+ type CStarFeatureDisabledError = InstanceType<typeof CStarFeatureDisabledErrorImpl>;
555
+ declare const CStarRealtimeUnavailableError: {
556
+ new (message?: string): {
557
+ readonly type: string;
558
+ readonly code: string;
559
+ readonly param?: string;
560
+ readonly docUrl: string;
561
+ readonly requestId?: string;
562
+ readonly statusCode: number;
563
+ name: string;
564
+ message: string;
565
+ stack?: string;
566
+ };
567
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
568
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
569
+ stackTraceLimit: number;
570
+ };
571
+ type CStarRealtimeUnavailableError = InstanceType<typeof CStarRealtimeUnavailableErrorImpl>;
572
+ /**
573
+ * Parse a public-route response (anonymous LibraryClient, CommunityClient,
574
+ * QuickHelpClient, AuthClient) into a typed `CStarError`.
575
+ *
576
+ * Public routes don't always emit the structured `{error: {type, code,
577
+ * doc_url, ...}}` envelope — many emit `{error: 'message string'}` or
578
+ * `{message: '...'}`. This helper normalizes both shapes and dispatches
579
+ * on HTTP status (closes F-026 and F-034 — Library/Auth used to throw
580
+ * plain `Error`).
581
+ */
582
+ declare function parsePublicError(status: number, body: unknown, fallbackMessage: string): CStarError;
583
+ declare function parseError(statusCode: number, body: {
584
+ error?: ApiErrorBody;
585
+ } | null, retryAfter?: number): CStarError;
586
+
190
587
  /**
191
588
  * Public community client. No authentication required.
192
589
  *
@@ -291,4 +688,4 @@ declare class CommunityClient {
291
688
  private fetch;
292
689
  }
293
690
 
294
- export { CommunityClient, type CommunityComment, type CommunityConfig, type CommunityCreateCommentParams, type CommunityCreatePostParams, type CommunityCreatedComment, type CommunityCreatedPost, type CommunityFollowResult, type CommunityPost, type CommunityPostDetail, type CommunityPostListParams, type CommunitySearchResult, type CommunityTopic, type CommunityUpdateCommentParams, type CommunityUpdatePostParams, type CommunityVoteResult };
691
+ export { type ApiErrorBody, CStarAuthenticationError, CStarConflictError, CStarError, CStarFeatureDisabledError, CStarNotFoundError, CStarPermissionError, CStarRateLimitError, CStarRealtimeUnavailableError, CStarServerError, CStarValidationError, CommunityClient, type CommunityComment, type CommunityConfig, type CommunityCreateCommentParams, type CommunityCreatePostParams, type CommunityCreatedComment, type CommunityCreatedPost, type CommunityFollowResult, type CommunityPost, type CommunityPostDetail, type CommunityPostListParams, type CommunitySearchResult, type CommunityTopic, type CommunityUpdateCommentParams, type CommunityUpdatePostParams, type CommunityVoteResult, ErrorType, parseError, parsePublicError };
@@ -35,7 +35,7 @@ function normalizeArgs(messageOrStatus, maybeBody, defaults) {
35
35
  }
36
36
  };
37
37
  }
38
- var CStarError = class extends Error {
38
+ var CStarErrorImpl = class extends Error {
39
39
  constructor(messageOrStatus, body) {
40
40
  const { statusCode, body: resolved } = normalizeArgs(messageOrStatus, body);
41
41
  super(resolved.message);
@@ -48,7 +48,7 @@ var CStarError = class extends Error {
48
48
  this.statusCode = statusCode;
49
49
  }
50
50
  };
51
- var CStarAuthenticationError = class extends CStarError {
51
+ var CStarAuthenticationErrorImpl = class extends CStarErrorImpl {
52
52
  constructor(messageOrStatus, body) {
53
53
  const { statusCode, body: resolved } = normalizeArgs(messageOrStatus, body, {
54
54
  type: ErrorType.AUTHENTICATION_ERROR,
@@ -59,7 +59,7 @@ var CStarAuthenticationError = class extends CStarError {
59
59
  this.name = "CStarAuthenticationError";
60
60
  }
61
61
  };
62
- var CStarRateLimitError = class extends CStarError {
62
+ var CStarRateLimitErrorImpl = class extends CStarErrorImpl {
63
63
  constructor(messageOrStatus, body, retryAfter) {
64
64
  const { statusCode, body: resolved } = normalizeArgs(messageOrStatus, body, {
65
65
  type: ErrorType.RATE_LIMIT_ERROR,
@@ -71,7 +71,7 @@ var CStarRateLimitError = class extends CStarError {
71
71
  this.retryAfter = retryAfter ?? 60;
72
72
  }
73
73
  };
74
- var CStarNotFoundError = class extends CStarError {
74
+ var CStarNotFoundErrorImpl = class extends CStarErrorImpl {
75
75
  constructor(messageOrStatus, body) {
76
76
  const { statusCode, body: resolved } = normalizeArgs(messageOrStatus, body, {
77
77
  type: ErrorType.NOT_FOUND_ERROR,
@@ -82,7 +82,7 @@ var CStarNotFoundError = class extends CStarError {
82
82
  this.name = "CStarNotFoundError";
83
83
  }
84
84
  };
85
- var CStarValidationError = class extends CStarError {
85
+ var CStarValidationErrorImpl = class extends CStarErrorImpl {
86
86
  constructor(messageOrStatus, body) {
87
87
  const { statusCode, body: resolved } = normalizeArgs(messageOrStatus, body, {
88
88
  type: ErrorType.INVALID_REQUEST_ERROR,
@@ -93,7 +93,7 @@ var CStarValidationError = class extends CStarError {
93
93
  this.name = "CStarValidationError";
94
94
  }
95
95
  };
96
- var CStarPermissionError = class extends CStarError {
96
+ var CStarPermissionErrorImpl = class extends CStarErrorImpl {
97
97
  constructor(messageOrStatus, body) {
98
98
  const { statusCode, body: resolved } = normalizeArgs(messageOrStatus, body, {
99
99
  type: ErrorType.PERMISSION_ERROR,
@@ -104,7 +104,7 @@ var CStarPermissionError = class extends CStarError {
104
104
  this.name = "CStarPermissionError";
105
105
  }
106
106
  };
107
- var CStarConflictError = class extends CStarError {
107
+ var CStarConflictErrorImpl = class extends CStarErrorImpl {
108
108
  constructor(messageOrStatus, body) {
109
109
  const { statusCode, body: resolved } = normalizeArgs(messageOrStatus, body, {
110
110
  type: ErrorType.CONFLICT_ERROR,
@@ -115,7 +115,7 @@ var CStarConflictError = class extends CStarError {
115
115
  this.name = "CStarConflictError";
116
116
  }
117
117
  };
118
- var CStarServerError = class extends CStarError {
118
+ var CStarServerErrorImpl = class extends CStarErrorImpl {
119
119
  constructor(messageOrStatus, body) {
120
120
  const { statusCode, body: resolved } = normalizeArgs(messageOrStatus, body, {
121
121
  type: ErrorType.SERVER_ERROR,
@@ -126,7 +126,7 @@ var CStarServerError = class extends CStarError {
126
126
  this.name = "CStarServerError";
127
127
  }
128
128
  };
129
- var CStarFeatureDisabledError = class extends CStarError {
129
+ var CStarFeatureDisabledErrorImpl = class extends CStarErrorImpl {
130
130
  constructor(messageOrStatus, body) {
131
131
  const { statusCode, body: resolved } = normalizeArgs(messageOrStatus, body, {
132
132
  type: ErrorType.FEATURE_NOT_CONFIGURED,
@@ -139,6 +139,62 @@ var CStarFeatureDisabledError = class extends CStarError {
139
139
  this.enableUrl = resolved.enable_url ?? "";
140
140
  }
141
141
  };
142
+ var CStarRealtimeUnavailableErrorImpl = class extends CStarErrorImpl {
143
+ constructor(message) {
144
+ const resolved = message ?? "EventSource is not available in this environment. Real-time subscriptions only work in the browser. Move the call to a client-only path (`useEffect` / `onMount`), or pass an `eventSource` polyfill via the realtime options. See https://cstar.help/developers/sdk/realtime#ssr";
145
+ super(0, {
146
+ type: ErrorType.API_ERROR,
147
+ code: "realtime_unavailable",
148
+ message: resolved,
149
+ doc_url: "https://cstar.help/developers/sdk/realtime#ssr"
150
+ });
151
+ this.name = "CStarRealtimeUnavailableError";
152
+ }
153
+ };
154
+ var REGISTRY_KEY = /* @__PURE__ */ Symbol.for("@cstar.help/js/errors/v1");
155
+ var globalSlot = globalThis;
156
+ var registry = globalSlot[REGISTRY_KEY] ?? (globalSlot[REGISTRY_KEY] = {
157
+ CStarError: CStarErrorImpl,
158
+ CStarAuthenticationError: CStarAuthenticationErrorImpl,
159
+ CStarRateLimitError: CStarRateLimitErrorImpl,
160
+ CStarNotFoundError: CStarNotFoundErrorImpl,
161
+ CStarValidationError: CStarValidationErrorImpl,
162
+ CStarPermissionError: CStarPermissionErrorImpl,
163
+ CStarConflictError: CStarConflictErrorImpl,
164
+ CStarServerError: CStarServerErrorImpl,
165
+ CStarFeatureDisabledError: CStarFeatureDisabledErrorImpl,
166
+ CStarRealtimeUnavailableError: CStarRealtimeUnavailableErrorImpl
167
+ });
168
+ var NAME_FIXES = [
169
+ "CStarError",
170
+ "CStarAuthenticationError",
171
+ "CStarRateLimitError",
172
+ "CStarNotFoundError",
173
+ "CStarValidationError",
174
+ "CStarPermissionError",
175
+ "CStarConflictError",
176
+ "CStarServerError",
177
+ "CStarFeatureDisabledError",
178
+ "CStarRealtimeUnavailableError"
179
+ ];
180
+ for (const key of NAME_FIXES) {
181
+ if (registry[key].name !== key) {
182
+ Object.defineProperty(registry[key], "name", {
183
+ value: key,
184
+ configurable: true
185
+ });
186
+ }
187
+ }
188
+ var CStarError = registry.CStarError;
189
+ var CStarAuthenticationError = registry.CStarAuthenticationError;
190
+ var CStarRateLimitError = registry.CStarRateLimitError;
191
+ var CStarNotFoundError = registry.CStarNotFoundError;
192
+ var CStarValidationError = registry.CStarValidationError;
193
+ var CStarPermissionError = registry.CStarPermissionError;
194
+ var CStarConflictError = registry.CStarConflictError;
195
+ var CStarServerError = registry.CStarServerError;
196
+ var CStarFeatureDisabledError = registry.CStarFeatureDisabledError;
197
+ var CStarRealtimeUnavailableError = registry.CStarRealtimeUnavailableError;
142
198
  function parsePublicError(status, body, fallbackMessage) {
143
199
  const obj = body && typeof body === "object" ? body : null;
144
200
  const errVal = obj?.error;
@@ -502,5 +558,18 @@ var CommunityClient = class {
502
558
  }
503
559
  };
504
560
  export {
505
- CommunityClient
561
+ CStarAuthenticationError,
562
+ CStarConflictError,
563
+ CStarError,
564
+ CStarFeatureDisabledError,
565
+ CStarNotFoundError,
566
+ CStarPermissionError,
567
+ CStarRateLimitError,
568
+ CStarRealtimeUnavailableError,
569
+ CStarServerError,
570
+ CStarValidationError,
571
+ CommunityClient,
572
+ ErrorType,
573
+ parseError,
574
+ parsePublicError
506
575
  };