@remit/api-http-client 0.0.42 → 0.0.43

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.
@@ -1466,6 +1466,10 @@ export const unifiedThreadOperationsListAllThreadsQueryKey = (options?: Options<
1466
1466
  * What a row is in search mode: one per message, not one per mailbox. This differs from the starred mode above, where the same mail filed in two folders is two rows sharing a `threadId`. Collapsing by `threadId` is still a client's job if it renders one row per CONVERSATION, since distinct messages in one thread remain distinct rows here.
1467
1467
  *
1468
1468
  * Callers that omit `query` are unaffected: the INBOX (and starred) listings behave exactly as before.
1469
+ *
1470
+ * Row filters: `category`, `unread` and `attachments` are columns on the ThreadMessage row, so each is a predicate inside the query rather than a pass over what a page returned. They compose with every mode above — INBOX, starred and search alike — and a page therefore comes back full of matches however rare the criterion is. This is what the cross-account collections need: filtering the pages a client happens to have loaded shows an empty list whenever the matching mail sits below the newest page (#308).
1471
+ *
1472
+ * Counting: `count=true` answers how many CONVERSATIONS match, over the whole scope and independent of `limit`. `results=false` omits the rows, which is how a header total is read without also paying for a page of mail. Conversations rather than rows because that is what this listing renders: a row is per mailbox, so the same mail filed in two folders is two rows sharing a `threadId`, and clients collapse by it. Counting rows would put a third number beside a list that shows a second one.
1469
1473
  */
1470
1474
  export const unifiedThreadOperationsListAllThreadsOptions = (options?: Options<UnifiedThreadOperationsListAllThreadsData>) => queryOptions<UnifiedThreadOperationsListAllThreadsResponse, DefaultError, UnifiedThreadOperationsListAllThreadsResponse, ReturnType<typeof unifiedThreadOperationsListAllThreadsQueryKey>>({
1471
1475
  queryFn: async ({ queryKey, signal }) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remit/api-http-client",
3
- "version": "0.0.42",
3
+ "version": "0.0.43",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./index.ts",
package/sdk.gen.ts CHANGED
@@ -891,6 +891,10 @@ export const systemOperationsApplySystemUpdate = <ThrowOnError extends boolean =
891
891
  * What a row is in search mode: one per message, not one per mailbox. This differs from the starred mode above, where the same mail filed in two folders is two rows sharing a `threadId`. Collapsing by `threadId` is still a client's job if it renders one row per CONVERSATION, since distinct messages in one thread remain distinct rows here.
892
892
  *
893
893
  * Callers that omit `query` are unaffected: the INBOX (and starred) listings behave exactly as before.
894
+ *
895
+ * Row filters: `category`, `unread` and `attachments` are columns on the ThreadMessage row, so each is a predicate inside the query rather than a pass over what a page returned. They compose with every mode above — INBOX, starred and search alike — and a page therefore comes back full of matches however rare the criterion is. This is what the cross-account collections need: filtering the pages a client happens to have loaded shows an empty list whenever the matching mail sits below the newest page (#308).
896
+ *
897
+ * Counting: `count=true` answers how many CONVERSATIONS match, over the whole scope and independent of `limit`. `results=false` omits the rows, which is how a header total is read without also paying for a page of mail. Conversations rather than rows because that is what this listing renders: a row is per mailbox, so the same mail filed in two folders is two rows sharing a `threadId`, and clients collapse by it. Counting rows would put a third number beside a list that shows a second one.
894
898
  */
895
899
  export const unifiedThreadOperationsListAllThreads = <ThrowOnError extends boolean = false>(options?: Options<UnifiedThreadOperationsListAllThreadsData, ThrowOnError>): RequestResult<UnifiedThreadOperationsListAllThreadsResponses, unknown, ThrowOnError> => (options?.client ?? client).get<UnifiedThreadOperationsListAllThreadsResponses, unknown, ThrowOnError>({
896
900
  security: [{ name: 'Authorization', type: 'apiKey' }],
package/types.gen.ts CHANGED
@@ -3049,11 +3049,18 @@ export type RemitImapThreadMessageResponse = {
3049
3049
  };
3050
3050
 
3051
3051
  /**
3052
- * Aggregate response for `searchThreads`. Carries the matching rows (`items`), a
3053
- * pagination `continuationToken`, and an optional `count` of every message the
3054
- * query matches. `items` is omitted when `results=false` (count-only); `count` is
3055
- * present only when `count=true`. Thread-specific so the shared `ResultList<T>`
3056
- * (7 endpoints) stays untouched.
3052
+ * Aggregate response for the filterable thread listings `searchThreads` and
3053
+ * `listAllThreads`. Carries the matching rows (`items`), a pagination
3054
+ * `continuationToken`, and an optional `count` of what the query matches.
3055
+ * `items` is omitted when `results=false` (count-only); `count` is present only
3056
+ * when `count=true`. Thread-specific so the shared `ResultList<T>` (7 endpoints)
3057
+ * stays untouched.
3058
+ *
3059
+ * `listAllThreads` answers with this model rather than `ResultList<T>` for that
3060
+ * same reason: it needs the count field and the shared model cannot carry one.
3061
+ * One model over both operations rather than a second of the same shape, so a
3062
+ * client reading a filtered thread listing reads one response type whether the
3063
+ * listing is scoped to a mailbox or spans every account.
3057
3064
  */
3058
3065
  export type RemitImapThreadSearchResponse = {
3059
3066
  /**
@@ -3065,7 +3072,18 @@ export type RemitImapThreadSearchResponse = {
3065
3072
  */
3066
3073
  continuationToken?: String800;
3067
3074
  /**
3068
- * How many messages the query matches, over the whole mailbox and independent of `limit`. Present only when `count=true`. With `senderTrust` or `dkimMismatch` in the query the count is over the enriched window instead, since those are resolved off the row.
3075
+ * How much the query matches, over the whole scope and independent of `limit`.
3076
+ * Present only when `count=true`.
3077
+ *
3078
+ * Each operation counts what it lists. `searchThreads` lists messages of one
3079
+ * mailbox and counts messages; with `senderTrust` or `dkimMismatch` in the
3080
+ * query that count is over the enriched window instead, since those are
3081
+ * resolved off the row. `listAllThreads` counts CONVERSATIONS across every
3082
+ * non-muted mailbox of every account — a thread holding two matching messages
3083
+ * counts once, and so does one message reachable through a real folder and a
3084
+ * virtual copy of it — because that is what the cross-account listing renders
3085
+ * after collapsing by `threadId`. A count that disagreed with the rows beneath
3086
+ * it would be a third number for the same set.
3069
3087
  */
3070
3088
  count?: number;
3071
3089
  };
@@ -3769,11 +3787,18 @@ export type RemitImapThreadMessageResponseWritable = {
3769
3787
  };
3770
3788
 
3771
3789
  /**
3772
- * Aggregate response for `searchThreads`. Carries the matching rows (`items`), a
3773
- * pagination `continuationToken`, and an optional `count` of every message the
3774
- * query matches. `items` is omitted when `results=false` (count-only); `count` is
3775
- * present only when `count=true`. Thread-specific so the shared `ResultList<T>`
3776
- * (7 endpoints) stays untouched.
3790
+ * Aggregate response for the filterable thread listings `searchThreads` and
3791
+ * `listAllThreads`. Carries the matching rows (`items`), a pagination
3792
+ * `continuationToken`, and an optional `count` of what the query matches.
3793
+ * `items` is omitted when `results=false` (count-only); `count` is present only
3794
+ * when `count=true`. Thread-specific so the shared `ResultList<T>` (7 endpoints)
3795
+ * stays untouched.
3796
+ *
3797
+ * `listAllThreads` answers with this model rather than `ResultList<T>` for that
3798
+ * same reason: it needs the count field and the shared model cannot carry one.
3799
+ * One model over both operations rather than a second of the same shape, so a
3800
+ * client reading a filtered thread listing reads one response type whether the
3801
+ * listing is scoped to a mailbox or spans every account.
3777
3802
  */
3778
3803
  export type RemitImapThreadSearchResponseWritable = {
3779
3804
  /**
@@ -3785,7 +3810,18 @@ export type RemitImapThreadSearchResponseWritable = {
3785
3810
  */
3786
3811
  continuationToken?: String800;
3787
3812
  /**
3788
- * How many messages the query matches, over the whole mailbox and independent of `limit`. Present only when `count=true`. With `senderTrust` or `dkimMismatch` in the query the count is over the enriched window instead, since those are resolved off the row.
3813
+ * How much the query matches, over the whole scope and independent of `limit`.
3814
+ * Present only when `count=true`.
3815
+ *
3816
+ * Each operation counts what it lists. `searchThreads` lists messages of one
3817
+ * mailbox and counts messages; with `senderTrust` or `dkimMismatch` in the
3818
+ * query that count is over the enriched window instead, since those are
3819
+ * resolved off the row. `listAllThreads` counts CONVERSATIONS across every
3820
+ * non-muted mailbox of every account — a thread holding two matching messages
3821
+ * counts once, and so does one message reachable through a real folder and a
3822
+ * virtual copy of it — because that is what the cross-account listing renders
3823
+ * after collapsing by `threadId`. A count that disagreed with the rows beneath
3824
+ * it would be a third number for the same set.
3789
3825
  */
3790
3826
  count?: number;
3791
3827
  };
@@ -5775,6 +5811,26 @@ export type UnifiedThreadOperationsListAllThreadsData = {
5775
5811
  * Free text to match against subject and From address. Supplying it switches the listing into search mode, which widens the scope past INBOX to every non-muted mailbox — see the operation description. Omitting it leaves the listing unchanged.
5776
5812
  */
5777
5813
  query?: string;
5814
+ /**
5815
+ * Filter to messages with one of these header-derived categories, as a union over the values given. Applied as a SQL predicate over the whole scope, so a page comes back full of matches however rare the category is. `uncategorized` is one of them — the pending state's name, never the absence of one.
5816
+ */
5817
+ category?: Array<RemitImapMessageCategory>;
5818
+ /**
5819
+ * When true, return only unread messages. A column on the row, so it narrows the query rather than the page.
5820
+ */
5821
+ unread?: boolean;
5822
+ /**
5823
+ * When true, return only messages carrying an attachment. A column on the row, so it narrows the query rather than the page.
5824
+ */
5825
+ attachments?: boolean;
5826
+ /**
5827
+ * Include how many messages the listing matches. Counted over the whole scope, independent of `limit`.
5828
+ */
5829
+ count?: boolean;
5830
+ /**
5831
+ * Return matching rows. Default true; set false for a count-only response.
5832
+ */
5833
+ results?: boolean;
5778
5834
  };
5779
5835
  url: '/threads';
5780
5836
  };
@@ -5783,13 +5839,7 @@ export type UnifiedThreadOperationsListAllThreadsResponses = {
5783
5839
  /**
5784
5840
  * The request has succeeded.
5785
5841
  */
5786
- 200: {
5787
- /**
5788
- * Opaque, server-minted cursor: absent means the first (or last) page, present means resume from here. Echo it back unchanged to fetch the next page. Every listing endpoint that accepts it rejects a token it cannot decode with 400 ValidationError rather than silently restarting from the first page (#136, #172).
5789
- */
5790
- continuationToken?: String800;
5791
- items: Array<RemitImapThreadMessageResponse>;
5792
- };
5842
+ 200: RemitImapThreadSearchResponse;
5793
5843
  };
5794
5844
 
5795
5845
  export type UnifiedThreadOperationsListAllThreadsResponse = UnifiedThreadOperationsListAllThreadsResponses[keyof UnifiedThreadOperationsListAllThreadsResponses];