@dugjason/front-node 0.0.2 → 0.0.4

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.d.mts CHANGED
@@ -8274,17 +8274,15 @@ type PaginationInfo = Record<string, unknown> & {
8274
8274
  * If `next` is not a URL or has no `page_token`, returns `next` unchanged.
8275
8275
  *
8276
8276
  * @param next Value of `_pagination.next` from the raw API.
8277
- * @param baseUrl API origin (used to resolve relative `next` links).
8278
8277
  */
8279
- declare const pageTokenFromPaginationNextUrl: (next: string | null | undefined, baseUrl: string) => string | null | undefined;
8278
+ declare const pageTokenFromPaginationNextUrl: (next?: string | null) => string | null | undefined;
8280
8279
  /**
8281
- * Walk JSON from the Front API: rename `_pagination` → `pagination` and replace `pagination.next`
8282
- * full URLs with the `page_token` query value. Recurses into objects and arrays.
8280
+ * Rename `_pagination` → `pagination` and replace `pagination.next` full URLs with the
8281
+ * `page_token` query value.
8283
8282
  *
8284
8283
  * @param value Parsed JSON body.
8285
- * @param baseUrl Same origin as the client (`FrontBase` / `Front` `baseUrl`).
8286
8284
  */
8287
- declare const normalizeFrontResponse: <T>(value: T, baseUrl: string) => T;
8285
+ declare const normalizeFrontResponse: <T>(value: T) => WithNormalizedPagination<T>;
8288
8286
  //#endregion
8289
8287
  //#region src/resource.d.ts
8290
8288
  /**
@@ -8587,6 +8585,7 @@ declare class FrontApplications {
8587
8585
  //#endregion
8588
8586
  //#region src/resources/channels.d.ts
8589
8587
  type ChannelResponse = components["schemas"]["ChannelResponse"];
8588
+ type CreateChannel = components["schemas"]["CreateChannel"];
8590
8589
  type UpdateChannel = components["schemas"]["UpdateChannel"];
8591
8590
  type CreateDraft = components["schemas"]["CreateDraft"];
8592
8591
  type CustomMessage = components["schemas"]["CustomMessage"];
@@ -8619,7 +8618,7 @@ declare class FrontChannel extends FrontResource<ChannelResponse, UpdateChannel>
8619
8618
  /**
8620
8619
  * The Front API does not expose `DELETE /channels/{channel_id}`.
8621
8620
  *
8622
- * @throws Error always — use the Front product or inbox channel management instead.
8621
+ * @throws {Error} always — use the Front product or inbox channel management instead.
8623
8622
  */
8624
8623
  delete(): Promise<void>;
8625
8624
  /**
@@ -8695,6 +8694,14 @@ declare class FrontChannels {
8695
8694
  * @see https://dev.frontapp.com/reference/get-channel
8696
8695
  */
8697
8696
  get(channelId: string): Promise<FrontChannel>;
8697
+ /**
8698
+ * Create a channel in an inbox (`POST /inboxes/{inbox_id}/channels`). The API returns `204`.
8699
+ *
8700
+ * **Required scope:** `channels:write`
8701
+ *
8702
+ * @see https://dev.frontapp.com/reference/post_inboxes-inbox-id-channels
8703
+ */
8704
+ create(inboxId: string, body: CreateChannel): Promise<void>;
8698
8705
  }
8699
8706
  //#endregion
8700
8707
  //#region src/resources/comments.d.ts
@@ -9553,7 +9560,6 @@ declare class FrontEvents {
9553
9560
  //#region src/resources/inboxes.d.ts
9554
9561
  type InboxResponse = components["schemas"]["InboxResponse"];
9555
9562
  type CreateInbox = components["schemas"]["CreateInbox"];
9556
- type CreateChannel = components["schemas"]["CreateChannel"];
9557
9563
  type ImportMessage = components["schemas"]["ImportMessage"];
9558
9564
  type TeammateIds = components["schemas"]["TeammateIds"];
9559
9565
  type InboxSnapshot = InboxResponse & {
@@ -9592,12 +9598,6 @@ declare class FrontInbox {
9592
9598
  * **Required scope:** `channels:read`
9593
9599
  */
9594
9600
  listChannels(): Promise<WithNormalizedPagination<ListInboxChannelsResponse>>;
9595
- /**
9596
- * Create a channel in this inbox (`POST /inboxes/{inbox_id}/channels`). The API returns `204`.
9597
- *
9598
- * **Required scope:** `channels:write`
9599
- */
9600
- createChannel(body: CreateChannel): Promise<void>;
9601
9601
  /**
9602
9602
  * List conversations in this inbox (`GET /inboxes/{inbox_id}/conversations`).
9603
9603
  *
@@ -9637,6 +9637,7 @@ declare class FrontInbox {
9637
9637
  declare class FrontInboxes {
9638
9638
  private readonly base;
9639
9639
  constructor(base: FrontBase);
9640
+ private inbox;
9640
9641
  /**
9641
9642
  * List inboxes (`GET /inboxes`).
9642
9643
  *
@@ -9661,6 +9662,42 @@ declare class FrontInboxes {
9661
9662
  * **Required scope:** `inboxes:read`
9662
9663
  */
9663
9664
  get(inboxId: string): Promise<FrontInbox>;
9665
+ /**
9666
+ * List channels in an inbox (`GET /inboxes/{inbox_id}/channels`).
9667
+ *
9668
+ * **Required scope:** `channels:read`
9669
+ */
9670
+ listChannels(inboxId: string): Promise<WithNormalizedPagination<ListInboxChannelsResponse>>;
9671
+ /**
9672
+ * List conversations in an inbox (`GET /inboxes/{inbox_id}/conversations`).
9673
+ *
9674
+ * **Required scope:** `conversations:read`
9675
+ */
9676
+ listConversations(inboxId: string, query?: ListInboxConversationsQuery): Promise<WithNormalizedPagination<ListInboxConversationsResponse>>;
9677
+ /**
9678
+ * Import a message into an inbox (`POST /inboxes/{inbox_id}/imported_messages`).
9679
+ *
9680
+ * **Required scope:** `messages:write`
9681
+ */
9682
+ importMessage(inboxId: string, body: ImportMessage): Promise<ImportInboxMessageResponse>;
9683
+ /**
9684
+ * List teammates with access (`GET /inboxes/{inbox_id}/teammates`).
9685
+ *
9686
+ * **Required scope:** `teammates:read`
9687
+ */
9688
+ listTeammateAccess(inboxId: string): Promise<WithNormalizedPagination<ListInboxAccessResponse>>;
9689
+ /**
9690
+ * Add teammate access (`POST /inboxes/{inbox_id}/teammates`). The API returns `204`.
9691
+ *
9692
+ * **Required scope:** `inboxes:write`
9693
+ */
9694
+ addTeammateAccess(inboxId: string, body: TeammateIds): Promise<void>;
9695
+ /**
9696
+ * Remove teammate access (`DELETE /inboxes/{inbox_id}/teammates`). The API returns `204`.
9697
+ *
9698
+ * **Required scope:** `inboxes:write`
9699
+ */
9700
+ removeTeammateAccess(inboxId: string, body: TeammateIds): Promise<void>;
9664
9701
  }
9665
9702
  //#endregion
9666
9703
  //#region src/resources/knowledge.d.ts
@@ -11042,7 +11079,7 @@ declare class Front extends FrontBase {
11042
11079
  readonly views: FrontViews;
11043
11080
  /**
11044
11081
  * @param options API credentials and optional HTTP overrides. A token is required either here or via `FRONT_API_TOKEN`.
11045
- * @throws Error when no API token can be resolved.
11082
+ * @throws {Error} when no API token can be resolved.
11046
11083
  */
11047
11084
  constructor(options?: FrontOptions);
11048
11085
  }