@cstar.help/js 0.15.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.
@@ -101,64 +101,341 @@ interface ApiErrorBody {
101
101
  enable_url?: string;
102
102
  }
103
103
  /** Base error class for all cStar API errors. */
104
- declare class CStarErrorImpl extends Error {
105
- readonly type: string;
106
- readonly code: string;
107
- readonly param?: string;
108
- readonly docUrl: string;
109
- readonly requestId?: string;
110
- readonly statusCode: number;
111
- constructor(messageOrStatus: string | number, body?: ApiErrorBody);
112
- }
113
- declare class CStarAuthenticationErrorImpl extends CStarErrorImpl {
114
- constructor(messageOrStatus: string | number, body?: ApiErrorBody);
115
- }
116
- declare class CStarRateLimitErrorImpl extends CStarErrorImpl {
117
- readonly retryAfter: number;
118
- constructor(messageOrStatus: string | number, body?: ApiErrorBody, retryAfter?: number);
119
- }
120
- declare class CStarNotFoundErrorImpl extends CStarErrorImpl {
121
- constructor(messageOrStatus: string | number, body?: ApiErrorBody);
122
- }
123
- declare class CStarValidationErrorImpl extends CStarErrorImpl {
124
- constructor(messageOrStatus: string | number, body?: ApiErrorBody);
125
- }
126
- declare class CStarPermissionErrorImpl extends CStarErrorImpl {
127
- constructor(messageOrStatus: string | number, body?: ApiErrorBody);
128
- }
129
- declare class CStarConflictErrorImpl extends CStarErrorImpl {
130
- constructor(messageOrStatus: string | number, body?: ApiErrorBody);
131
- }
132
- declare class CStarServerErrorImpl extends CStarErrorImpl {
133
- constructor(messageOrStatus: string | number, body?: ApiErrorBody);
134
- }
135
- declare class CStarFeatureDisabledErrorImpl extends CStarErrorImpl {
136
- readonly feature: string;
137
- readonly enableUrl: string;
138
- constructor(messageOrStatus: string | number, body?: ApiErrorBody);
139
- }
140
- declare class CStarRealtimeUnavailableErrorImpl extends CStarErrorImpl {
141
- constructor(message?: string);
142
- }
143
- declare const CStarError: typeof CStarErrorImpl;
104
+ declare const CStarErrorImpl: {
105
+ new (messageOrStatus: string | number, body?: ApiErrorBody): {
106
+ readonly type: string;
107
+ readonly code: string;
108
+ readonly param?: string;
109
+ readonly docUrl: string;
110
+ readonly requestId?: string;
111
+ readonly statusCode: number;
112
+ name: string;
113
+ message: string;
114
+ stack?: string;
115
+ };
116
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
117
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
118
+ stackTraceLimit: number;
119
+ };
120
+ declare const CStarAuthenticationErrorImpl: {
121
+ new (messageOrStatus: string | number, body?: ApiErrorBody): {
122
+ readonly type: string;
123
+ readonly code: string;
124
+ readonly param?: string;
125
+ readonly docUrl: string;
126
+ readonly requestId?: string;
127
+ readonly statusCode: number;
128
+ name: string;
129
+ message: string;
130
+ stack?: string;
131
+ };
132
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
133
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
134
+ stackTraceLimit: number;
135
+ };
136
+ declare const CStarRateLimitErrorImpl: {
137
+ new (messageOrStatus: string | number, body?: ApiErrorBody, retryAfter?: number): {
138
+ readonly retryAfter: number;
139
+ readonly type: string;
140
+ readonly code: string;
141
+ readonly param?: string;
142
+ readonly docUrl: string;
143
+ readonly requestId?: string;
144
+ readonly statusCode: number;
145
+ name: string;
146
+ message: string;
147
+ stack?: string;
148
+ };
149
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
150
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
151
+ stackTraceLimit: number;
152
+ };
153
+ declare const CStarNotFoundErrorImpl: {
154
+ new (messageOrStatus: string | number, body?: ApiErrorBody): {
155
+ readonly type: string;
156
+ readonly code: string;
157
+ readonly param?: string;
158
+ readonly docUrl: string;
159
+ readonly requestId?: string;
160
+ readonly statusCode: number;
161
+ name: string;
162
+ message: string;
163
+ stack?: string;
164
+ };
165
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
166
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
167
+ stackTraceLimit: number;
168
+ };
169
+ declare const CStarValidationErrorImpl: {
170
+ new (messageOrStatus: string | number, body?: ApiErrorBody): {
171
+ readonly type: string;
172
+ readonly code: string;
173
+ readonly param?: string;
174
+ readonly docUrl: string;
175
+ readonly requestId?: string;
176
+ readonly statusCode: number;
177
+ name: string;
178
+ message: string;
179
+ stack?: string;
180
+ };
181
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
182
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
183
+ stackTraceLimit: number;
184
+ };
185
+ declare const CStarPermissionErrorImpl: {
186
+ new (messageOrStatus: string | number, body?: ApiErrorBody): {
187
+ readonly type: string;
188
+ readonly code: string;
189
+ readonly param?: string;
190
+ readonly docUrl: string;
191
+ readonly requestId?: string;
192
+ readonly statusCode: number;
193
+ name: string;
194
+ message: string;
195
+ stack?: string;
196
+ };
197
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
198
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
199
+ stackTraceLimit: number;
200
+ };
201
+ declare const CStarConflictErrorImpl: {
202
+ new (messageOrStatus: string | number, body?: ApiErrorBody): {
203
+ readonly type: string;
204
+ readonly code: string;
205
+ readonly param?: string;
206
+ readonly docUrl: string;
207
+ readonly requestId?: string;
208
+ readonly statusCode: number;
209
+ name: string;
210
+ message: string;
211
+ stack?: string;
212
+ };
213
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
214
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
215
+ stackTraceLimit: number;
216
+ };
217
+ declare const CStarServerErrorImpl: {
218
+ new (messageOrStatus: string | number, body?: ApiErrorBody): {
219
+ readonly type: string;
220
+ readonly code: string;
221
+ readonly param?: string;
222
+ readonly docUrl: string;
223
+ readonly requestId?: string;
224
+ readonly statusCode: number;
225
+ name: string;
226
+ message: string;
227
+ stack?: string;
228
+ };
229
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
230
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
231
+ stackTraceLimit: number;
232
+ };
233
+ declare const CStarFeatureDisabledErrorImpl: {
234
+ new (messageOrStatus: string | number, body?: ApiErrorBody): {
235
+ readonly feature: string;
236
+ readonly enableUrl: string;
237
+ readonly type: string;
238
+ readonly code: string;
239
+ readonly param?: string;
240
+ readonly docUrl: string;
241
+ readonly requestId?: string;
242
+ readonly statusCode: number;
243
+ name: string;
244
+ message: string;
245
+ stack?: string;
246
+ };
247
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
248
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
249
+ stackTraceLimit: number;
250
+ };
251
+ declare const CStarRealtimeUnavailableErrorImpl: {
252
+ new (message?: string): {
253
+ readonly type: string;
254
+ readonly code: string;
255
+ readonly param?: string;
256
+ readonly docUrl: string;
257
+ readonly requestId?: string;
258
+ readonly statusCode: number;
259
+ name: string;
260
+ message: string;
261
+ stack?: string;
262
+ };
263
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
264
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
265
+ stackTraceLimit: number;
266
+ };
267
+ declare const CStarError: {
268
+ new (messageOrStatus: string | number, body?: ApiErrorBody): {
269
+ readonly type: string;
270
+ readonly code: string;
271
+ readonly param?: string;
272
+ readonly docUrl: string;
273
+ readonly requestId?: string;
274
+ readonly statusCode: number;
275
+ name: string;
276
+ message: string;
277
+ stack?: string;
278
+ };
279
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
280
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
281
+ stackTraceLimit: number;
282
+ };
144
283
  type CStarError = InstanceType<typeof CStarErrorImpl>;
145
- declare const CStarAuthenticationError: typeof CStarAuthenticationErrorImpl;
284
+ declare const CStarAuthenticationError: {
285
+ new (messageOrStatus: string | number, body?: ApiErrorBody): {
286
+ readonly type: string;
287
+ readonly code: string;
288
+ readonly param?: string;
289
+ readonly docUrl: string;
290
+ readonly requestId?: string;
291
+ readonly statusCode: number;
292
+ name: string;
293
+ message: string;
294
+ stack?: string;
295
+ };
296
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
297
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
298
+ stackTraceLimit: number;
299
+ };
146
300
  type CStarAuthenticationError = InstanceType<typeof CStarAuthenticationErrorImpl>;
147
- declare const CStarRateLimitError: typeof CStarRateLimitErrorImpl;
301
+ declare const CStarRateLimitError: {
302
+ new (messageOrStatus: string | number, body?: ApiErrorBody, retryAfter?: number): {
303
+ readonly retryAfter: number;
304
+ readonly type: string;
305
+ readonly code: string;
306
+ readonly param?: string;
307
+ readonly docUrl: string;
308
+ readonly requestId?: string;
309
+ readonly statusCode: number;
310
+ name: string;
311
+ message: string;
312
+ stack?: string;
313
+ };
314
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
315
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
316
+ stackTraceLimit: number;
317
+ };
148
318
  type CStarRateLimitError = InstanceType<typeof CStarRateLimitErrorImpl>;
149
- declare const CStarNotFoundError: typeof CStarNotFoundErrorImpl;
319
+ declare const CStarNotFoundError: {
320
+ new (messageOrStatus: string | number, body?: ApiErrorBody): {
321
+ readonly type: string;
322
+ readonly code: string;
323
+ readonly param?: string;
324
+ readonly docUrl: string;
325
+ readonly requestId?: string;
326
+ readonly statusCode: number;
327
+ name: string;
328
+ message: string;
329
+ stack?: string;
330
+ };
331
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
332
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
333
+ stackTraceLimit: number;
334
+ };
150
335
  type CStarNotFoundError = InstanceType<typeof CStarNotFoundErrorImpl>;
151
- declare const CStarValidationError: typeof CStarValidationErrorImpl;
336
+ declare const CStarValidationError: {
337
+ new (messageOrStatus: string | number, body?: ApiErrorBody): {
338
+ readonly type: string;
339
+ readonly code: string;
340
+ readonly param?: string;
341
+ readonly docUrl: string;
342
+ readonly requestId?: string;
343
+ readonly statusCode: number;
344
+ name: string;
345
+ message: string;
346
+ stack?: string;
347
+ };
348
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
349
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
350
+ stackTraceLimit: number;
351
+ };
152
352
  type CStarValidationError = InstanceType<typeof CStarValidationErrorImpl>;
153
- declare const CStarPermissionError: typeof CStarPermissionErrorImpl;
353
+ declare const CStarPermissionError: {
354
+ new (messageOrStatus: string | number, body?: ApiErrorBody): {
355
+ readonly type: string;
356
+ readonly code: string;
357
+ readonly param?: string;
358
+ readonly docUrl: string;
359
+ readonly requestId?: string;
360
+ readonly statusCode: number;
361
+ name: string;
362
+ message: string;
363
+ stack?: string;
364
+ };
365
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
366
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
367
+ stackTraceLimit: number;
368
+ };
154
369
  type CStarPermissionError = InstanceType<typeof CStarPermissionErrorImpl>;
155
- declare const CStarConflictError: typeof CStarConflictErrorImpl;
370
+ declare const CStarConflictError: {
371
+ new (messageOrStatus: string | number, body?: ApiErrorBody): {
372
+ readonly type: string;
373
+ readonly code: string;
374
+ readonly param?: string;
375
+ readonly docUrl: string;
376
+ readonly requestId?: string;
377
+ readonly statusCode: number;
378
+ name: string;
379
+ message: string;
380
+ stack?: string;
381
+ };
382
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
383
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
384
+ stackTraceLimit: number;
385
+ };
156
386
  type CStarConflictError = InstanceType<typeof CStarConflictErrorImpl>;
157
- declare const CStarServerError: typeof CStarServerErrorImpl;
387
+ declare const CStarServerError: {
388
+ new (messageOrStatus: string | number, body?: ApiErrorBody): {
389
+ readonly type: string;
390
+ readonly code: string;
391
+ readonly param?: string;
392
+ readonly docUrl: string;
393
+ readonly requestId?: string;
394
+ readonly statusCode: number;
395
+ name: string;
396
+ message: string;
397
+ stack?: string;
398
+ };
399
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
400
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
401
+ stackTraceLimit: number;
402
+ };
158
403
  type CStarServerError = InstanceType<typeof CStarServerErrorImpl>;
159
- declare const CStarFeatureDisabledError: typeof CStarFeatureDisabledErrorImpl;
404
+ declare const CStarFeatureDisabledError: {
405
+ new (messageOrStatus: string | number, body?: ApiErrorBody): {
406
+ readonly feature: string;
407
+ readonly enableUrl: string;
408
+ readonly type: string;
409
+ readonly code: string;
410
+ readonly param?: string;
411
+ readonly docUrl: string;
412
+ readonly requestId?: string;
413
+ readonly statusCode: number;
414
+ name: string;
415
+ message: string;
416
+ stack?: string;
417
+ };
418
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
419
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
420
+ stackTraceLimit: number;
421
+ };
160
422
  type CStarFeatureDisabledError = InstanceType<typeof CStarFeatureDisabledErrorImpl>;
161
- declare const CStarRealtimeUnavailableError: typeof CStarRealtimeUnavailableErrorImpl;
423
+ declare const CStarRealtimeUnavailableError: {
424
+ new (message?: string): {
425
+ readonly type: string;
426
+ readonly code: string;
427
+ readonly param?: string;
428
+ readonly docUrl: string;
429
+ readonly requestId?: string;
430
+ readonly statusCode: number;
431
+ name: string;
432
+ message: string;
433
+ stack?: string;
434
+ };
435
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
436
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
437
+ stackTraceLimit: number;
438
+ };
162
439
  type CStarRealtimeUnavailableError = InstanceType<typeof CStarRealtimeUnavailableErrorImpl>;
163
440
  /**
164
441
  * Parse a public-route response (anonymous LibraryClient, CommunityClient,
@@ -165,6 +165,26 @@ var registry = globalSlot[REGISTRY_KEY] ?? (globalSlot[REGISTRY_KEY] = {
165
165
  CStarFeatureDisabledError: CStarFeatureDisabledErrorImpl,
166
166
  CStarRealtimeUnavailableError: CStarRealtimeUnavailableErrorImpl
167
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
+ }
168
188
  var CStarError = registry.CStarError;
169
189
  var CStarAuthenticationError = registry.CStarAuthenticationError;
170
190
  var CStarRateLimitError = registry.CStarRateLimitError;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cstar.help/js",
3
- "version": "0.15.0",
3
+ "version": "0.15.1",
4
4
  "description": "Official TypeScript SDK for the cStar customer support platform",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",