@cstar.help/js 0.18.1 → 0.18.2

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/README.md CHANGED
@@ -483,14 +483,14 @@ const ticket = await cstar.tickets.create(
483
483
  For 24 hours, the same request with the same key returns the first successful
484
484
  response. The same key with a different body throws `CStarValidationError`
485
485
  (`idempotency_key_reused`, 422). While the first request is still running, the
486
- API answers `409 idempotency_key_in_use` with `Retry-After`. From 0.18.1
487
- (unreleased), the client waits and retries within `maxRetries`; 0.18.0 throws
486
+ API answers `409 idempotency_key_in_use` with `Retry-After`. From 0.18.1, the client waits and retries within `maxRetries`; 0.18.0 throws
488
487
  `CStarConflictError`.
489
488
 
490
489
  The API ignores the key on `webhooks.create`, `webhooks.listen` and
491
- `export.create`, so a key does not make their retries safe: the client still
492
- retries a network error or 5xx. Leave the key off those calls (without one the
493
- client does not retry them), or use a client with `maxRetries: 0`. Check
490
+ `export.create`, so a key does not make their retries safe. From 0.18.2 the
491
+ client does not send the key on those calls and does not retry a network error
492
+ or 5xx; 0.18.1 and earlier still retry them, so there leave the key off (without
493
+ one the client does not retry them) or use a client with `maxRetries: 0`. Check
494
494
  `webhooks.list()` before you retry `webhooks.create`. A repeated `export.create`
495
495
  only reads your data again (nothing is stored). A repeated `webhooks.listen` is a
496
496
  second CLI listener: remove it with `webhooks.unlisten(id)`, or it is swept after
@@ -1,4 +1,4 @@
1
- import { C as CommunityCreatePostParams, a as CommunityCreatedPost, b as CommunityUpdatePostParams, c as CommunityUpdateCommentParams, d as CommunityCreatedComment, e as CommunityVoteResult, f as CommunityCreateCommentParams, g as CommunityFollowResult } from '../types-DF7GprCV.cjs';
1
+ import { C as CommunityCreatePostParams, a as CommunityCreatedPost, b as CommunityUpdatePostParams, c as CommunityUpdateCommentParams, d as CommunityCreatedComment, e as CommunityVoteResult, f as CommunityCreateCommentParams, g as CommunityFollowResult } from '../types-BHCahwev.cjs';
2
2
 
3
3
  /** Configuration for the ChatClient. */
4
4
  interface ChatConfig {
@@ -1,4 +1,4 @@
1
- import { C as CommunityCreatePostParams, a as CommunityCreatedPost, b as CommunityUpdatePostParams, c as CommunityUpdateCommentParams, d as CommunityCreatedComment, e as CommunityVoteResult, f as CommunityCreateCommentParams, g as CommunityFollowResult } from '../types-DF7GprCV.js';
1
+ import { C as CommunityCreatePostParams, a as CommunityCreatedPost, b as CommunityUpdatePostParams, c as CommunityUpdateCommentParams, d as CommunityCreatedComment, e as CommunityVoteResult, f as CommunityCreateCommentParams, g as CommunityFollowResult } from '../types-BHCahwev.js';
2
2
 
3
3
  /** Configuration for the ChatClient. */
4
4
  interface ChatConfig {
@@ -1,5 +1,5 @@
1
- import { h as CommunityConfig, i as CommunityTopic, j as CommunityPostListParams, k as CommunityPost, l as CommunityPostDetail, m as CommunitySearchResult, C as CommunityCreatePostParams, a as CommunityCreatedPost, b as CommunityUpdatePostParams, c as CommunityUpdateCommentParams, d as CommunityCreatedComment, e as CommunityVoteResult, f as CommunityCreateCommentParams, g as CommunityFollowResult } from '../types-DF7GprCV.cjs';
2
- export { n as CommunityComment } from '../types-DF7GprCV.cjs';
1
+ import { h as CommunityConfig, i as CommunityTopic, j as CommunityPostListParams, k as CommunityPost, l as CommunityPostDetail, m as CommunitySearchResult, C as CommunityCreatePostParams, a as CommunityCreatedPost, b as CommunityUpdatePostParams, c as CommunityUpdateCommentParams, d as CommunityCreatedComment, e as CommunityVoteResult, f as CommunityCreateCommentParams, g as CommunityFollowResult } from '../types-BHCahwev.cjs';
2
+ export { n as CommunityComment } from '../types-BHCahwev.cjs';
3
3
  export { A as ApiErrorBody, C as CStarAuthenticationError, a as CStarConflictError, b as CStarError, c as CStarFeatureDisabledError, d as CStarNotFoundError, e as CStarPermissionError, f as CStarRateLimitError, g as CStarRealtimeUnavailableError, h as CStarServerError, i as CStarValidationError, E as ErrorType, p as parseError, j as parsePublicError } from '../errors-bW8CwTn4.cjs';
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
- import { h as CommunityConfig, i as CommunityTopic, j as CommunityPostListParams, k as CommunityPost, l as CommunityPostDetail, m as CommunitySearchResult, C as CommunityCreatePostParams, a as CommunityCreatedPost, b as CommunityUpdatePostParams, c as CommunityUpdateCommentParams, d as CommunityCreatedComment, e as CommunityVoteResult, f as CommunityCreateCommentParams, g as CommunityFollowResult } from '../types-DF7GprCV.js';
2
- export { n as CommunityComment } from '../types-DF7GprCV.js';
1
+ import { h as CommunityConfig, i as CommunityTopic, j as CommunityPostListParams, k as CommunityPost, l as CommunityPostDetail, m as CommunitySearchResult, C as CommunityCreatePostParams, a as CommunityCreatedPost, b as CommunityUpdatePostParams, c as CommunityUpdateCommentParams, d as CommunityCreatedComment, e as CommunityVoteResult, f as CommunityCreateCommentParams, g as CommunityFollowResult } from '../types-BHCahwev.js';
2
+ export { n as CommunityComment } from '../types-BHCahwev.js';
3
3
  export { A as ApiErrorBody, C as CStarAuthenticationError, a as CStarConflictError, b as CStarError, c as CStarFeatureDisabledError, d as CStarNotFoundError, e as CStarPermissionError, f as CStarRateLimitError, g as CStarRealtimeUnavailableError, h as CStarServerError, i as CStarValidationError, E as ErrorType, p as parseError, j as parsePublicError } from '../errors-bW8CwTn4.js';
4
4
 
5
5
  /**
package/dist/index.cjs CHANGED
@@ -278,7 +278,7 @@ function parseError(statusCode, body, retryAfter) {
278
278
  }
279
279
 
280
280
  // src/client.ts
281
- var SDK_VERSION = "0.18.1";
281
+ var SDK_VERSION = "0.18.2";
282
282
  var DEFAULT_BASE_URL = "https://www.cstar.help";
283
283
  var DEFAULT_API_VERSION = "2026-03-01";
284
284
  var DEFAULT_MAX_RETRIES = 3;
@@ -1252,6 +1252,15 @@ var WebhooksResource = class extends BaseResource {
1252
1252
  constructor(client) {
1253
1253
  super(client, "/webhooks");
1254
1254
  }
1255
+ /**
1256
+ * Create a webhook endpoint. Its answer carries the signing secret, so the
1257
+ * API keeps it out of the Idempotency-Key cache: an `idempotencyKey` is
1258
+ * not sent, and a network error or 5xx is not retried, since the webhook
1259
+ * may already exist. List webhooks before creating it again.
1260
+ */
1261
+ async create(params, _options) {
1262
+ return this.client.request("POST", this.basePath, { body: params });
1263
+ }
1255
1264
  /** Send a test delivery to a webhook endpoint. */
1256
1265
  async test(webhookId, params) {
1257
1266
  return this.client.request(
@@ -1286,11 +1295,14 @@ var WebhooksResource = class extends BaseResource {
1286
1295
  async unsubscribe(subscriptionId) {
1287
1296
  await this.client.request("DELETE", `/webhooks/subscribe/${subscriptionId}`);
1288
1297
  }
1289
- /** Register a CLI listener (returns listenerId and signing secret). */
1290
- async listen(params, options) {
1298
+ /**
1299
+ * Register a CLI listener (returns listenerId and signing secret). The API
1300
+ * ignores Idempotency-Key here (the answer is a secret), so an
1301
+ * `idempotencyKey` is not sent and a network error or 5xx is not retried.
1302
+ */
1303
+ async listen(params, _options) {
1291
1304
  return this.client.request("POST", "/webhooks/listen", {
1292
- body: params,
1293
- idempotencyKey: options?.idempotencyKey
1305
+ body: params
1294
1306
  });
1295
1307
  }
1296
1308
  /** Deregister a CLI listener. */
@@ -1878,10 +1890,9 @@ var ExportResource = class {
1878
1890
  constructor(client) {
1879
1891
  this.client = client;
1880
1892
  }
1881
- async create(params, options) {
1893
+ async create(params, _options) {
1882
1894
  return this.client.request("POST", "/export", {
1883
1895
  body: params,
1884
- idempotencyKey: options?.idempotencyKey,
1885
1896
  responseType: params.format === "csv" ? "text" : "json"
1886
1897
  });
1887
1898
  }
package/dist/index.d.cts CHANGED
@@ -772,6 +772,13 @@ interface WebhookTriggerTestResult {
772
772
  /** Manage webhook endpoints. */
773
773
  declare class WebhooksResource extends BaseResource<Webhook, WebhookListParams, WebhookCreateParams, WebhookUpdateParams> {
774
774
  constructor(client: HttpClient);
775
+ /**
776
+ * Create a webhook endpoint. Its answer carries the signing secret, so the
777
+ * API keeps it out of the Idempotency-Key cache: an `idempotencyKey` is
778
+ * not sent, and a network error or 5xx is not retried, since the webhook
779
+ * may already exist. List webhooks before creating it again.
780
+ */
781
+ create(params: WebhookCreateParams, _options?: RequestOptions): Promise<Webhook>;
775
782
  /** Send a test delivery to a webhook endpoint. */
776
783
  test(webhookId: string, params?: {
777
784
  event?: WebhookEventType;
@@ -784,8 +791,12 @@ declare class WebhooksResource extends BaseResource<Webhook, WebhookListParams,
784
791
  restSubscribe(params: WebhookSubscribeParams, options?: RequestOptions): Promise<ApiResponse<WebhookSubscription>>;
785
792
  /** Unsubscribe from an event (REST Hooks / Zapier protocol). Returns void (204 No Content). */
786
793
  unsubscribe(subscriptionId: string): Promise<void>;
787
- /** Register a CLI listener (returns listenerId and signing secret). */
788
- listen(params: WebhookListenerParams, options?: RequestOptions): Promise<ApiResponse<WebhookListener>>;
794
+ /**
795
+ * Register a CLI listener (returns listenerId and signing secret). The API
796
+ * ignores Idempotency-Key here (the answer is a secret), so an
797
+ * `idempotencyKey` is not sent and a network error or 5xx is not retried.
798
+ */
799
+ listen(params: WebhookListenerParams, _options?: RequestOptions): Promise<ApiResponse<WebhookListener>>;
789
800
  /** Deregister a CLI listener. */
790
801
  unlisten(listenerId: string): Promise<ApiResponse<{
791
802
  deleted: true;
@@ -2052,7 +2063,12 @@ interface ImportCreateParams {
2052
2063
  * read is named in `warnings`.
2053
2064
  */
2054
2065
  records: Record<string, unknown>[];
2055
- /** How to handle duplicates. Defaults to `'overwrite'`. */
2066
+ /**
2067
+ * What a customer row does when the team already has a customer with its
2068
+ * email: `'skip'` (the default) leaves that customer alone and reports the
2069
+ * row in `warnings`, `'overwrite'` updates it, `'merge'` fills only its
2070
+ * empty fields. A row repeating an earlier row's email is skipped.
2071
+ */
2056
2072
  mergeStrategy?: 'skip' | 'overwrite' | 'merge';
2057
2073
  }
2058
2074
  /** Import result. */
@@ -2107,7 +2123,11 @@ interface ImportLogListParams extends PaginationParams {
2107
2123
  resource?: 'tickets' | 'customers' | 'articles';
2108
2124
  }
2109
2125
 
2110
- /** Export data from your team. */
2126
+ /**
2127
+ * Export data from your team. The API ignores Idempotency-Key on exports, so
2128
+ * `options.idempotencyKey` is accepted but not sent, and an export that
2129
+ * fails with a network error or 5xx is not retried.
2130
+ */
2111
2131
  declare class ExportResource {
2112
2132
  private readonly client;
2113
2133
  constructor(client: HttpClient);
package/dist/index.d.ts CHANGED
@@ -772,6 +772,13 @@ interface WebhookTriggerTestResult {
772
772
  /** Manage webhook endpoints. */
773
773
  declare class WebhooksResource extends BaseResource<Webhook, WebhookListParams, WebhookCreateParams, WebhookUpdateParams> {
774
774
  constructor(client: HttpClient);
775
+ /**
776
+ * Create a webhook endpoint. Its answer carries the signing secret, so the
777
+ * API keeps it out of the Idempotency-Key cache: an `idempotencyKey` is
778
+ * not sent, and a network error or 5xx is not retried, since the webhook
779
+ * may already exist. List webhooks before creating it again.
780
+ */
781
+ create(params: WebhookCreateParams, _options?: RequestOptions): Promise<Webhook>;
775
782
  /** Send a test delivery to a webhook endpoint. */
776
783
  test(webhookId: string, params?: {
777
784
  event?: WebhookEventType;
@@ -784,8 +791,12 @@ declare class WebhooksResource extends BaseResource<Webhook, WebhookListParams,
784
791
  restSubscribe(params: WebhookSubscribeParams, options?: RequestOptions): Promise<ApiResponse<WebhookSubscription>>;
785
792
  /** Unsubscribe from an event (REST Hooks / Zapier protocol). Returns void (204 No Content). */
786
793
  unsubscribe(subscriptionId: string): Promise<void>;
787
- /** Register a CLI listener (returns listenerId and signing secret). */
788
- listen(params: WebhookListenerParams, options?: RequestOptions): Promise<ApiResponse<WebhookListener>>;
794
+ /**
795
+ * Register a CLI listener (returns listenerId and signing secret). The API
796
+ * ignores Idempotency-Key here (the answer is a secret), so an
797
+ * `idempotencyKey` is not sent and a network error or 5xx is not retried.
798
+ */
799
+ listen(params: WebhookListenerParams, _options?: RequestOptions): Promise<ApiResponse<WebhookListener>>;
789
800
  /** Deregister a CLI listener. */
790
801
  unlisten(listenerId: string): Promise<ApiResponse<{
791
802
  deleted: true;
@@ -2052,7 +2063,12 @@ interface ImportCreateParams {
2052
2063
  * read is named in `warnings`.
2053
2064
  */
2054
2065
  records: Record<string, unknown>[];
2055
- /** How to handle duplicates. Defaults to `'overwrite'`. */
2066
+ /**
2067
+ * What a customer row does when the team already has a customer with its
2068
+ * email: `'skip'` (the default) leaves that customer alone and reports the
2069
+ * row in `warnings`, `'overwrite'` updates it, `'merge'` fills only its
2070
+ * empty fields. A row repeating an earlier row's email is skipped.
2071
+ */
2056
2072
  mergeStrategy?: 'skip' | 'overwrite' | 'merge';
2057
2073
  }
2058
2074
  /** Import result. */
@@ -2107,7 +2123,11 @@ interface ImportLogListParams extends PaginationParams {
2107
2123
  resource?: 'tickets' | 'customers' | 'articles';
2108
2124
  }
2109
2125
 
2110
- /** Export data from your team. */
2126
+ /**
2127
+ * Export data from your team. The API ignores Idempotency-Key on exports, so
2128
+ * `options.idempotencyKey` is accepted but not sent, and an export that
2129
+ * fails with a network error or 5xx is not retried.
2130
+ */
2111
2131
  declare class ExportResource {
2112
2132
  private readonly client;
2113
2133
  constructor(client: HttpClient);
package/dist/index.js CHANGED
@@ -237,7 +237,7 @@ function parseError(statusCode, body, retryAfter) {
237
237
  }
238
238
 
239
239
  // src/client.ts
240
- var SDK_VERSION = "0.18.1";
240
+ var SDK_VERSION = "0.18.2";
241
241
  var DEFAULT_BASE_URL = "https://www.cstar.help";
242
242
  var DEFAULT_API_VERSION = "2026-03-01";
243
243
  var DEFAULT_MAX_RETRIES = 3;
@@ -1211,6 +1211,15 @@ var WebhooksResource = class extends BaseResource {
1211
1211
  constructor(client) {
1212
1212
  super(client, "/webhooks");
1213
1213
  }
1214
+ /**
1215
+ * Create a webhook endpoint. Its answer carries the signing secret, so the
1216
+ * API keeps it out of the Idempotency-Key cache: an `idempotencyKey` is
1217
+ * not sent, and a network error or 5xx is not retried, since the webhook
1218
+ * may already exist. List webhooks before creating it again.
1219
+ */
1220
+ async create(params, _options) {
1221
+ return this.client.request("POST", this.basePath, { body: params });
1222
+ }
1214
1223
  /** Send a test delivery to a webhook endpoint. */
1215
1224
  async test(webhookId, params) {
1216
1225
  return this.client.request(
@@ -1245,11 +1254,14 @@ var WebhooksResource = class extends BaseResource {
1245
1254
  async unsubscribe(subscriptionId) {
1246
1255
  await this.client.request("DELETE", `/webhooks/subscribe/${subscriptionId}`);
1247
1256
  }
1248
- /** Register a CLI listener (returns listenerId and signing secret). */
1249
- async listen(params, options) {
1257
+ /**
1258
+ * Register a CLI listener (returns listenerId and signing secret). The API
1259
+ * ignores Idempotency-Key here (the answer is a secret), so an
1260
+ * `idempotencyKey` is not sent and a network error or 5xx is not retried.
1261
+ */
1262
+ async listen(params, _options) {
1250
1263
  return this.client.request("POST", "/webhooks/listen", {
1251
- body: params,
1252
- idempotencyKey: options?.idempotencyKey
1264
+ body: params
1253
1265
  });
1254
1266
  }
1255
1267
  /** Deregister a CLI listener. */
@@ -1837,10 +1849,9 @@ var ExportResource = class {
1837
1849
  constructor(client) {
1838
1850
  this.client = client;
1839
1851
  }
1840
- async create(params, options) {
1852
+ async create(params, _options) {
1841
1853
  return this.client.request("POST", "/export", {
1842
1854
  body: params,
1843
- idempotencyKey: options?.idempotencyKey,
1844
1855
  responseType: params.format === "csv" ? "text" : "json"
1845
1856
  });
1846
1857
  }
@@ -1,4 +1,4 @@
1
- /** Attachment metadata for community posts and comments (images only, max 5MB each). */
1
+ /** Attachment metadata for community posts and comments (images only, max 4 MB each). */
2
2
  interface CommunityAttachment {
3
3
  filename: string;
4
4
  content_type: string;
@@ -30,7 +30,7 @@ interface CommunityCreatePostParams {
30
30
  topicId: string;
31
31
  /** Custom field values keyed by field definition ID. */
32
32
  customFields?: Record<string, string>;
33
- /** Image attachments (max 10, images only, 5MB each). */
33
+ /** Image attachments (max 10, images only, 4 MB each). */
34
34
  attachments?: CommunityAttachment[];
35
35
  }
36
36
  /** Parameters for updating a post as the original author. */
@@ -53,7 +53,7 @@ interface CommunityCreateCommentParams {
53
53
  body: string;
54
54
  /** Parent comment ID for replies (optional, 1-level nesting). */
55
55
  parentCommentId?: string | null;
56
- /** Image attachments (max 5, images only, 5MB each). */
56
+ /** Image attachments (max 5, images only, 4 MB each). */
57
57
  attachments?: CommunityAttachment[];
58
58
  }
59
59
  /** Response from creating a post. */
@@ -1,4 +1,4 @@
1
- /** Attachment metadata for community posts and comments (images only, max 5MB each). */
1
+ /** Attachment metadata for community posts and comments (images only, max 4 MB each). */
2
2
  interface CommunityAttachment {
3
3
  filename: string;
4
4
  content_type: string;
@@ -30,7 +30,7 @@ interface CommunityCreatePostParams {
30
30
  topicId: string;
31
31
  /** Custom field values keyed by field definition ID. */
32
32
  customFields?: Record<string, string>;
33
- /** Image attachments (max 10, images only, 5MB each). */
33
+ /** Image attachments (max 10, images only, 4 MB each). */
34
34
  attachments?: CommunityAttachment[];
35
35
  }
36
36
  /** Parameters for updating a post as the original author. */
@@ -53,7 +53,7 @@ interface CommunityCreateCommentParams {
53
53
  body: string;
54
54
  /** Parent comment ID for replies (optional, 1-level nesting). */
55
55
  parentCommentId?: string | null;
56
- /** Image attachments (max 5, images only, 5MB each). */
56
+ /** Image attachments (max 5, images only, 4 MB each). */
57
57
  attachments?: CommunityAttachment[];
58
58
  }
59
59
  /** Response from creating a post. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cstar.help/js",
3
- "version": "0.18.1",
3
+ "version": "0.18.2",
4
4
  "description": "Official TypeScript SDK for the cStar customer support platform",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",