@cstar.help/js 0.3.0 → 0.3.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/dist/index.cjs +8 -0
- package/dist/index.d.cts +48 -4
- package/dist/index.d.ts +48 -4
- package/dist/index.js +8 -0
- package/dist/webhook/index.d.cts +1 -1
- package/dist/webhook/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -328,6 +328,13 @@ var WebhooksResource = class extends BaseResource {
|
|
|
328
328
|
}
|
|
329
329
|
};
|
|
330
330
|
|
|
331
|
+
// src/resources/categories.ts
|
|
332
|
+
var CategoriesResource = class extends BaseResource {
|
|
333
|
+
constructor(client) {
|
|
334
|
+
super(client, "/categories");
|
|
335
|
+
}
|
|
336
|
+
};
|
|
337
|
+
|
|
331
338
|
// src/index.ts
|
|
332
339
|
var CStarClient = class {
|
|
333
340
|
constructor(config) {
|
|
@@ -336,6 +343,7 @@ var CStarClient = class {
|
|
|
336
343
|
this.customers = new CustomersResource(this.client);
|
|
337
344
|
this.articles = new ArticlesResource(this.client);
|
|
338
345
|
this.webhooks = new WebhooksResource(this.client);
|
|
346
|
+
this.categories = new CategoriesResource(this.client);
|
|
339
347
|
}
|
|
340
348
|
/** Whether this client is using test mode keys (sk_test_* or pk_test_*). */
|
|
341
349
|
get isTestMode() {
|
package/dist/index.d.cts
CHANGED
|
@@ -278,7 +278,7 @@ interface Article {
|
|
|
278
278
|
slug: string | null;
|
|
279
279
|
excerpt: string | null;
|
|
280
280
|
content: string | null;
|
|
281
|
-
|
|
281
|
+
categoryId: string | null;
|
|
282
282
|
status: 'draft' | 'published';
|
|
283
283
|
tags: string[];
|
|
284
284
|
notes: string | null;
|
|
@@ -306,7 +306,7 @@ interface ArticleCreateParams {
|
|
|
306
306
|
title: string;
|
|
307
307
|
content?: string;
|
|
308
308
|
excerpt?: string;
|
|
309
|
-
|
|
309
|
+
categoryId?: string;
|
|
310
310
|
status?: 'draft' | 'published';
|
|
311
311
|
tags?: string[];
|
|
312
312
|
notes?: string;
|
|
@@ -320,7 +320,7 @@ interface ArticleUpdateParams {
|
|
|
320
320
|
title?: string;
|
|
321
321
|
content?: string;
|
|
322
322
|
excerpt?: string;
|
|
323
|
-
|
|
323
|
+
categoryId?: string;
|
|
324
324
|
status?: 'draft' | 'published';
|
|
325
325
|
tags?: string[];
|
|
326
326
|
notes?: string;
|
|
@@ -429,6 +429,48 @@ declare class WebhooksResource extends BaseResource<Webhook, WebhookListParams,
|
|
|
429
429
|
}): Promise<ApiResponse<WebhookTestResult>>;
|
|
430
430
|
}
|
|
431
431
|
|
|
432
|
+
/** A cStar article category. */
|
|
433
|
+
interface Category {
|
|
434
|
+
id: string;
|
|
435
|
+
object: 'category';
|
|
436
|
+
name: string;
|
|
437
|
+
slug: string;
|
|
438
|
+
description: string | null;
|
|
439
|
+
icon: string | null;
|
|
440
|
+
color: string | null;
|
|
441
|
+
sortOrder: number;
|
|
442
|
+
isPublic: boolean;
|
|
443
|
+
createdAt: string;
|
|
444
|
+
updatedAt: string;
|
|
445
|
+
}
|
|
446
|
+
/** Parameters for listing categories. */
|
|
447
|
+
interface CategoryListParams extends PaginationParams {
|
|
448
|
+
isPublic?: boolean;
|
|
449
|
+
}
|
|
450
|
+
/** Parameters for creating a category. */
|
|
451
|
+
interface CategoryCreateParams {
|
|
452
|
+
name: string;
|
|
453
|
+
description?: string;
|
|
454
|
+
icon?: string;
|
|
455
|
+
color?: string;
|
|
456
|
+
sortOrder?: number;
|
|
457
|
+
isPublic?: boolean;
|
|
458
|
+
}
|
|
459
|
+
/** Parameters for updating a category. */
|
|
460
|
+
interface CategoryUpdateParams {
|
|
461
|
+
name?: string;
|
|
462
|
+
description?: string;
|
|
463
|
+
icon?: string;
|
|
464
|
+
color?: string;
|
|
465
|
+
sortOrder?: number;
|
|
466
|
+
isPublic?: boolean;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
/** Manage article categories. */
|
|
470
|
+
declare class CategoriesResource extends BaseResource<Category, CategoryListParams, CategoryCreateParams, CategoryUpdateParams> {
|
|
471
|
+
constructor(client: HttpClient);
|
|
472
|
+
}
|
|
473
|
+
|
|
432
474
|
/** Error type constants matching the cStar API. */
|
|
433
475
|
declare const ErrorType: {
|
|
434
476
|
readonly AUTHENTICATION_ERROR: "authentication_error";
|
|
@@ -510,10 +552,12 @@ declare class CStarClient {
|
|
|
510
552
|
readonly articles: ArticlesResource;
|
|
511
553
|
/** Manage webhook endpoints. */
|
|
512
554
|
readonly webhooks: WebhooksResource;
|
|
555
|
+
/** Manage article categories. */
|
|
556
|
+
readonly categories: CategoriesResource;
|
|
513
557
|
private readonly client;
|
|
514
558
|
constructor(config: CStarClientConfig);
|
|
515
559
|
/** Whether this client is using test mode keys (sk_test_* or pk_test_*). */
|
|
516
560
|
get isTestMode(): boolean;
|
|
517
561
|
}
|
|
518
562
|
|
|
519
|
-
export { type ApiErrorBody, type ApiResponse, type Article, type ArticleCreateParams, type ArticleListParams, type ArticleUpdateParams, CStarAuthenticationError, CStarClient, type CStarClientConfig, CStarError, CStarNotFoundError, CStarRateLimitError, CStarValidationError, type Customer, type CustomerCreateParams, type CustomerListParams, type CustomerUpdateParams, type DeleteResponse, ErrorType, type ListResponse, type Message, type MessageCreateParams, type Metadata, type PaginationInfo, type PaginationParams, type RequestOptions, type Ticket, type TicketCreateParams, type TicketCustomerSummary, type TicketListParams, type TicketUpdateParams, type Webhook, type WebhookCreateParams, type WebhookEvent, type WebhookEventData, type WebhookEventType, type WebhookListParams, type WebhookTestResult, type WebhookUpdateParams };
|
|
563
|
+
export { type ApiErrorBody, type ApiResponse, type Article, type ArticleCreateParams, type ArticleListParams, type ArticleUpdateParams, CStarAuthenticationError, CStarClient, type CStarClientConfig, CStarError, CStarNotFoundError, CStarRateLimitError, CStarValidationError, type Category, type CategoryCreateParams, type CategoryListParams, type CategoryUpdateParams, type Customer, type CustomerCreateParams, type CustomerListParams, type CustomerUpdateParams, type DeleteResponse, ErrorType, type ListResponse, type Message, type MessageCreateParams, type Metadata, type PaginationInfo, type PaginationParams, type RequestOptions, type Ticket, type TicketCreateParams, type TicketCustomerSummary, type TicketListParams, type TicketUpdateParams, type Webhook, type WebhookCreateParams, type WebhookEvent, type WebhookEventData, type WebhookEventType, type WebhookListParams, type WebhookTestResult, type WebhookUpdateParams };
|
package/dist/index.d.ts
CHANGED
|
@@ -278,7 +278,7 @@ interface Article {
|
|
|
278
278
|
slug: string | null;
|
|
279
279
|
excerpt: string | null;
|
|
280
280
|
content: string | null;
|
|
281
|
-
|
|
281
|
+
categoryId: string | null;
|
|
282
282
|
status: 'draft' | 'published';
|
|
283
283
|
tags: string[];
|
|
284
284
|
notes: string | null;
|
|
@@ -306,7 +306,7 @@ interface ArticleCreateParams {
|
|
|
306
306
|
title: string;
|
|
307
307
|
content?: string;
|
|
308
308
|
excerpt?: string;
|
|
309
|
-
|
|
309
|
+
categoryId?: string;
|
|
310
310
|
status?: 'draft' | 'published';
|
|
311
311
|
tags?: string[];
|
|
312
312
|
notes?: string;
|
|
@@ -320,7 +320,7 @@ interface ArticleUpdateParams {
|
|
|
320
320
|
title?: string;
|
|
321
321
|
content?: string;
|
|
322
322
|
excerpt?: string;
|
|
323
|
-
|
|
323
|
+
categoryId?: string;
|
|
324
324
|
status?: 'draft' | 'published';
|
|
325
325
|
tags?: string[];
|
|
326
326
|
notes?: string;
|
|
@@ -429,6 +429,48 @@ declare class WebhooksResource extends BaseResource<Webhook, WebhookListParams,
|
|
|
429
429
|
}): Promise<ApiResponse<WebhookTestResult>>;
|
|
430
430
|
}
|
|
431
431
|
|
|
432
|
+
/** A cStar article category. */
|
|
433
|
+
interface Category {
|
|
434
|
+
id: string;
|
|
435
|
+
object: 'category';
|
|
436
|
+
name: string;
|
|
437
|
+
slug: string;
|
|
438
|
+
description: string | null;
|
|
439
|
+
icon: string | null;
|
|
440
|
+
color: string | null;
|
|
441
|
+
sortOrder: number;
|
|
442
|
+
isPublic: boolean;
|
|
443
|
+
createdAt: string;
|
|
444
|
+
updatedAt: string;
|
|
445
|
+
}
|
|
446
|
+
/** Parameters for listing categories. */
|
|
447
|
+
interface CategoryListParams extends PaginationParams {
|
|
448
|
+
isPublic?: boolean;
|
|
449
|
+
}
|
|
450
|
+
/** Parameters for creating a category. */
|
|
451
|
+
interface CategoryCreateParams {
|
|
452
|
+
name: string;
|
|
453
|
+
description?: string;
|
|
454
|
+
icon?: string;
|
|
455
|
+
color?: string;
|
|
456
|
+
sortOrder?: number;
|
|
457
|
+
isPublic?: boolean;
|
|
458
|
+
}
|
|
459
|
+
/** Parameters for updating a category. */
|
|
460
|
+
interface CategoryUpdateParams {
|
|
461
|
+
name?: string;
|
|
462
|
+
description?: string;
|
|
463
|
+
icon?: string;
|
|
464
|
+
color?: string;
|
|
465
|
+
sortOrder?: number;
|
|
466
|
+
isPublic?: boolean;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
/** Manage article categories. */
|
|
470
|
+
declare class CategoriesResource extends BaseResource<Category, CategoryListParams, CategoryCreateParams, CategoryUpdateParams> {
|
|
471
|
+
constructor(client: HttpClient);
|
|
472
|
+
}
|
|
473
|
+
|
|
432
474
|
/** Error type constants matching the cStar API. */
|
|
433
475
|
declare const ErrorType: {
|
|
434
476
|
readonly AUTHENTICATION_ERROR: "authentication_error";
|
|
@@ -510,10 +552,12 @@ declare class CStarClient {
|
|
|
510
552
|
readonly articles: ArticlesResource;
|
|
511
553
|
/** Manage webhook endpoints. */
|
|
512
554
|
readonly webhooks: WebhooksResource;
|
|
555
|
+
/** Manage article categories. */
|
|
556
|
+
readonly categories: CategoriesResource;
|
|
513
557
|
private readonly client;
|
|
514
558
|
constructor(config: CStarClientConfig);
|
|
515
559
|
/** Whether this client is using test mode keys (sk_test_* or pk_test_*). */
|
|
516
560
|
get isTestMode(): boolean;
|
|
517
561
|
}
|
|
518
562
|
|
|
519
|
-
export { type ApiErrorBody, type ApiResponse, type Article, type ArticleCreateParams, type ArticleListParams, type ArticleUpdateParams, CStarAuthenticationError, CStarClient, type CStarClientConfig, CStarError, CStarNotFoundError, CStarRateLimitError, CStarValidationError, type Customer, type CustomerCreateParams, type CustomerListParams, type CustomerUpdateParams, type DeleteResponse, ErrorType, type ListResponse, type Message, type MessageCreateParams, type Metadata, type PaginationInfo, type PaginationParams, type RequestOptions, type Ticket, type TicketCreateParams, type TicketCustomerSummary, type TicketListParams, type TicketUpdateParams, type Webhook, type WebhookCreateParams, type WebhookEvent, type WebhookEventData, type WebhookEventType, type WebhookListParams, type WebhookTestResult, type WebhookUpdateParams };
|
|
563
|
+
export { type ApiErrorBody, type ApiResponse, type Article, type ArticleCreateParams, type ArticleListParams, type ArticleUpdateParams, CStarAuthenticationError, CStarClient, type CStarClientConfig, CStarError, CStarNotFoundError, CStarRateLimitError, CStarValidationError, type Category, type CategoryCreateParams, type CategoryListParams, type CategoryUpdateParams, type Customer, type CustomerCreateParams, type CustomerListParams, type CustomerUpdateParams, type DeleteResponse, ErrorType, type ListResponse, type Message, type MessageCreateParams, type Metadata, type PaginationInfo, type PaginationParams, type RequestOptions, type Ticket, type TicketCreateParams, type TicketCustomerSummary, type TicketListParams, type TicketUpdateParams, type Webhook, type WebhookCreateParams, type WebhookEvent, type WebhookEventData, type WebhookEventType, type WebhookListParams, type WebhookTestResult, type WebhookUpdateParams };
|
package/dist/index.js
CHANGED
|
@@ -296,6 +296,13 @@ var WebhooksResource = class extends BaseResource {
|
|
|
296
296
|
}
|
|
297
297
|
};
|
|
298
298
|
|
|
299
|
+
// src/resources/categories.ts
|
|
300
|
+
var CategoriesResource = class extends BaseResource {
|
|
301
|
+
constructor(client) {
|
|
302
|
+
super(client, "/categories");
|
|
303
|
+
}
|
|
304
|
+
};
|
|
305
|
+
|
|
299
306
|
// src/index.ts
|
|
300
307
|
var CStarClient = class {
|
|
301
308
|
constructor(config) {
|
|
@@ -304,6 +311,7 @@ var CStarClient = class {
|
|
|
304
311
|
this.customers = new CustomersResource(this.client);
|
|
305
312
|
this.articles = new ArticlesResource(this.client);
|
|
306
313
|
this.webhooks = new WebhooksResource(this.client);
|
|
314
|
+
this.categories = new CategoriesResource(this.client);
|
|
307
315
|
}
|
|
308
316
|
/** Whether this client is using test mode keys (sk_test_* or pk_test_*). */
|
|
309
317
|
get isTestMode() {
|
package/dist/webhook/index.d.cts
CHANGED
package/dist/webhook/index.d.ts
CHANGED