stream-chat 9.43.1 → 9.43.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/cjs/index.browser.js +9 -2
- package/dist/cjs/index.browser.js.map +2 -2
- package/dist/cjs/index.node.js +14 -2
- package/dist/cjs/index.node.js.map +2 -2
- package/dist/esm/index.mjs +9 -2
- package/dist/esm/index.mjs.map +2 -2
- package/dist/types/client.d.ts +4 -4
- package/dist/types/messageComposer/middleware/textComposer/index.d.ts +1 -0
- package/dist/types/types.d.ts +121 -15
- package/package.json +1 -1
- package/src/client.ts +22 -9
- package/src/messageComposer/middleware/textComposer/index.ts +1 -0
- package/src/types.ts +133 -15
package/dist/types/client.d.ts
CHANGED
|
@@ -2039,7 +2039,7 @@ export declare class StreamChat {
|
|
|
2039
2039
|
*
|
|
2040
2040
|
* @return {Promise<PredefinedFilterResponse>} The created predefined filter
|
|
2041
2041
|
*/
|
|
2042
|
-
createPredefinedFilter(options: CreatePredefinedFilterOptions): Promise<PredefinedFilterResponse
|
|
2042
|
+
createPredefinedFilter<F extends Record<string, unknown> = Record<string, unknown>>(options: CreatePredefinedFilterOptions<F>): Promise<PredefinedFilterResponse<F>>;
|
|
2043
2043
|
/**
|
|
2044
2044
|
* getPredefinedFilter - Gets a predefined filter by name (server-side only)
|
|
2045
2045
|
*
|
|
@@ -2047,7 +2047,7 @@ export declare class StreamChat {
|
|
|
2047
2047
|
*
|
|
2048
2048
|
* @return {Promise<PredefinedFilterResponse>} The predefined filter
|
|
2049
2049
|
*/
|
|
2050
|
-
getPredefinedFilter(name: string): Promise<PredefinedFilterResponse
|
|
2050
|
+
getPredefinedFilter<F extends Record<string, unknown> = Record<string, unknown>>(name: string): Promise<PredefinedFilterResponse<F>>;
|
|
2051
2051
|
/**
|
|
2052
2052
|
* updatePredefinedFilter - Updates a predefined filter (server-side only)
|
|
2053
2053
|
*
|
|
@@ -2056,7 +2056,7 @@ export declare class StreamChat {
|
|
|
2056
2056
|
*
|
|
2057
2057
|
* @return {Promise<PredefinedFilterResponse>} The updated predefined filter
|
|
2058
2058
|
*/
|
|
2059
|
-
updatePredefinedFilter(name: string, options: UpdatePredefinedFilterOptions): Promise<PredefinedFilterResponse
|
|
2059
|
+
updatePredefinedFilter<F extends Record<string, unknown> = Record<string, unknown>>(name: string, options: UpdatePredefinedFilterOptions<F>): Promise<PredefinedFilterResponse<F>>;
|
|
2060
2060
|
/**
|
|
2061
2061
|
* deletePredefinedFilter - Deletes a predefined filter (server-side only)
|
|
2062
2062
|
*
|
|
@@ -2072,7 +2072,7 @@ export declare class StreamChat {
|
|
|
2072
2072
|
*
|
|
2073
2073
|
* @return {Promise<ListPredefinedFiltersResponse>} The list of predefined filters
|
|
2074
2074
|
*/
|
|
2075
|
-
listPredefinedFilters(options?: ListPredefinedFiltersOptions): Promise<ListPredefinedFiltersResponse
|
|
2075
|
+
listPredefinedFilters<F extends Record<string, unknown> = Record<string, unknown>>(options?: ListPredefinedFiltersOptions): Promise<ListPredefinedFiltersResponse<F>>;
|
|
2076
2076
|
/**
|
|
2077
2077
|
* setRetentionPolicy - Creates or updates a retention policy for the app.
|
|
2078
2078
|
* Server-side only.
|
|
@@ -2,6 +2,7 @@ export * from './activeCommandGuard';
|
|
|
2
2
|
export * from './commands';
|
|
3
3
|
export * from './commandEffects';
|
|
4
4
|
export * from './commandStringExtraction';
|
|
5
|
+
export * from './commandUtils';
|
|
5
6
|
export * from './mentions';
|
|
6
7
|
export * from './validation';
|
|
7
8
|
export * from './TextComposerMiddlewareExecutor';
|
package/dist/types/types.d.ts
CHANGED
|
@@ -900,13 +900,29 @@ export type ChannelOptions = {
|
|
|
900
900
|
user_id?: string;
|
|
901
901
|
watch?: boolean;
|
|
902
902
|
/**
|
|
903
|
-
* Name of a predefined filter to use instead of
|
|
904
|
-
*
|
|
903
|
+
* Name of a predefined filter to use instead of sending raw
|
|
904
|
+
* `filter_conditions`.
|
|
905
|
+
*
|
|
906
|
+
* The backend resolves the filter template by name and interpolates it using
|
|
907
|
+
* `filter_values`.
|
|
908
|
+
*
|
|
909
|
+
* A regular `sort` can still be passed to `queryChannels()`, but backend
|
|
910
|
+
* precedence rules apply:
|
|
911
|
+
*
|
|
912
|
+
* - if the predefined filter has its own stored sort template, that stored
|
|
913
|
+
* sort takes precedence and the request `sort` is ignored
|
|
914
|
+
* - if the predefined filter does not define a sort template, the request
|
|
915
|
+
* `sort` can still be used
|
|
905
916
|
*/
|
|
906
917
|
predefined_filter?: string;
|
|
907
918
|
/**
|
|
908
|
-
* Values to interpolate
|
|
909
|
-
*
|
|
919
|
+
* Values used to interpolate placeholders inside the predefined filter's
|
|
920
|
+
* `filter` template.
|
|
921
|
+
*
|
|
922
|
+
* Example: a template value like `{{user_id}}` can be resolved with
|
|
923
|
+
* `{ user_id: 'alice' }`.
|
|
924
|
+
*
|
|
925
|
+
* Only used when `predefined_filter` is provided.
|
|
910
926
|
*/
|
|
911
927
|
filter_values?: Record<string, unknown>;
|
|
912
928
|
/**
|
|
@@ -3510,33 +3526,114 @@ export type UpdateChannelsBatchResponse = {
|
|
|
3510
3526
|
*/
|
|
3511
3527
|
export type PredefinedFilterOperation = 'QueryChannels';
|
|
3512
3528
|
export type PredefinedFilterSortParam = {
|
|
3529
|
+
/**
|
|
3530
|
+
* Field name to sort by.
|
|
3531
|
+
*
|
|
3532
|
+
* This may be a literal field name such as `created_at`, or a placeholder
|
|
3533
|
+
* template such as `{{sort_field}}` that will be interpolated server-side.
|
|
3534
|
+
*/
|
|
3513
3535
|
field: string;
|
|
3536
|
+
/**
|
|
3537
|
+
* Sort direction. `1` means ascending and `-1` means descending.
|
|
3538
|
+
*
|
|
3539
|
+
* The backend defaults this to `1` when omitted.
|
|
3540
|
+
*/
|
|
3514
3541
|
direction?: AscDesc;
|
|
3542
|
+
/**
|
|
3543
|
+
* Optional server-side hint describing how the sort field value should be
|
|
3544
|
+
* interpreted.
|
|
3545
|
+
*
|
|
3546
|
+
* This is mainly relevant for predefined-filter sort templates and is not
|
|
3547
|
+
* part of the regular `queryChannels()` sort shape. Omitting it uses the
|
|
3548
|
+
* backend default string behavior. Known backend values include:
|
|
3549
|
+
*
|
|
3550
|
+
* - `number`: cast custom-field values to numeric before sorting
|
|
3551
|
+
* - `boolean`: cast custom-field values to boolean before sorting
|
|
3552
|
+
*
|
|
3553
|
+
* Other values are backend-defined. In most cases this should be omitted
|
|
3554
|
+
* unless you are sorting by a custom field whose stored JSON value is not
|
|
3555
|
+
* string-like.
|
|
3556
|
+
*/
|
|
3515
3557
|
type?: string;
|
|
3516
3558
|
};
|
|
3517
|
-
|
|
3559
|
+
/**
|
|
3560
|
+
* Stored predefined filter definition as returned by the server.
|
|
3561
|
+
*
|
|
3562
|
+
* `F` represents the raw filter template shape. It defaults to a generic record
|
|
3563
|
+
* because predefined filters are server-managed templates and may include
|
|
3564
|
+
* placeholders or app-specific structures.
|
|
3565
|
+
*/
|
|
3566
|
+
export type PredefinedFilter<F extends Record<string, unknown> = Record<string, unknown>> = {
|
|
3567
|
+
/**
|
|
3568
|
+
* Unique predefined filter name within the app.
|
|
3569
|
+
*/
|
|
3518
3570
|
name: string;
|
|
3571
|
+
/**
|
|
3572
|
+
* Operation this predefined filter is valid for.
|
|
3573
|
+
*/
|
|
3519
3574
|
operation: PredefinedFilterOperation;
|
|
3520
|
-
|
|
3575
|
+
/**
|
|
3576
|
+
* Filter template stored on the server.
|
|
3577
|
+
*
|
|
3578
|
+
* This is not necessarily the fully interpolated runtime filter; placeholder
|
|
3579
|
+
* values such as `{{user_id}}` may still be present.
|
|
3580
|
+
*/
|
|
3581
|
+
filter: F;
|
|
3582
|
+
/**
|
|
3583
|
+
* Server creation timestamp in ISO-8601 format.
|
|
3584
|
+
*/
|
|
3521
3585
|
created_at: string;
|
|
3586
|
+
/**
|
|
3587
|
+
* Server update timestamp in ISO-8601 format.
|
|
3588
|
+
*/
|
|
3522
3589
|
updated_at: string;
|
|
3590
|
+
/**
|
|
3591
|
+
* Optional human-readable description.
|
|
3592
|
+
*/
|
|
3523
3593
|
description?: string;
|
|
3594
|
+
/**
|
|
3595
|
+
* Optional sort template stored with the predefined filter.
|
|
3596
|
+
*/
|
|
3524
3597
|
sort?: PredefinedFilterSortParam[];
|
|
3598
|
+
/**
|
|
3599
|
+
* Query identifier generated by the backend for the filter/sort pattern.
|
|
3600
|
+
*
|
|
3601
|
+
* The exact value is backend-generated and primarily useful for correlating
|
|
3602
|
+
* predefined filters with query analysis / query performance data.
|
|
3603
|
+
*/
|
|
3525
3604
|
query_id?: number;
|
|
3526
3605
|
};
|
|
3527
|
-
export type CreatePredefinedFilterOptions = {
|
|
3606
|
+
export type CreatePredefinedFilterOptions<F extends Record<string, unknown> = Record<string, unknown>> = {
|
|
3607
|
+
/**
|
|
3608
|
+
* Unique predefined filter name.
|
|
3609
|
+
*/
|
|
3528
3610
|
name: string;
|
|
3611
|
+
/**
|
|
3612
|
+
* Operation this predefined filter will be used with.
|
|
3613
|
+
*/
|
|
3529
3614
|
operation: PredefinedFilterOperation;
|
|
3530
|
-
|
|
3615
|
+
/**
|
|
3616
|
+
* Filter template to store on the server.
|
|
3617
|
+
*/
|
|
3618
|
+
filter: F;
|
|
3619
|
+
/**
|
|
3620
|
+
* Optional human-readable description.
|
|
3621
|
+
*/
|
|
3531
3622
|
description?: string;
|
|
3623
|
+
/**
|
|
3624
|
+
* Optional sort template stored with the predefined filter.
|
|
3625
|
+
*/
|
|
3532
3626
|
sort?: PredefinedFilterSortParam[];
|
|
3533
3627
|
};
|
|
3534
|
-
export type UpdatePredefinedFilterOptions = Omit<CreatePredefinedFilterOptions
|
|
3535
|
-
export type PredefinedFilterResponse = APIResponse & {
|
|
3536
|
-
predefined_filter: PredefinedFilter
|
|
3628
|
+
export type UpdatePredefinedFilterOptions<F extends Record<string, unknown> = Record<string, unknown>> = Omit<CreatePredefinedFilterOptions<F>, 'name'>;
|
|
3629
|
+
export type PredefinedFilterResponse<F extends Record<string, unknown> = Record<string, unknown>> = APIResponse & {
|
|
3630
|
+
predefined_filter: PredefinedFilter<F>;
|
|
3537
3631
|
};
|
|
3538
|
-
|
|
3539
|
-
|
|
3632
|
+
/**
|
|
3633
|
+
* Paginated response returned when listing predefined filters.
|
|
3634
|
+
*/
|
|
3635
|
+
export type ListPredefinedFiltersResponse<F extends Record<string, unknown> = Record<string, unknown>> = APIResponse & {
|
|
3636
|
+
predefined_filters: PredefinedFilter<F>[];
|
|
3540
3637
|
next?: string;
|
|
3541
3638
|
prev?: string;
|
|
3542
3639
|
};
|
|
@@ -3544,9 +3641,18 @@ export type ListPredefinedFiltersResponse = APIResponse & {
|
|
|
3544
3641
|
* Contains the interpolated filter and sort from a predefined filter.
|
|
3545
3642
|
* This is returned in the QueryChannels response when using a predefined filter.
|
|
3546
3643
|
*/
|
|
3547
|
-
export type ParsedPredefinedFilterResponse = {
|
|
3644
|
+
export type ParsedPredefinedFilterResponse<F extends Record<string, unknown> = Record<string, unknown>> = {
|
|
3645
|
+
/**
|
|
3646
|
+
* Name of the predefined filter that was resolved.
|
|
3647
|
+
*/
|
|
3548
3648
|
name: string;
|
|
3549
|
-
|
|
3649
|
+
/**
|
|
3650
|
+
* Fully interpolated filter that the backend executed.
|
|
3651
|
+
*/
|
|
3652
|
+
filter: F;
|
|
3653
|
+
/**
|
|
3654
|
+
* Fully interpolated sort parameters resolved from the predefined filter.
|
|
3655
|
+
*/
|
|
3550
3656
|
sort?: PredefinedFilterSortParam[];
|
|
3551
3657
|
};
|
|
3552
3658
|
export type PredefinedFilterSort = SortParam[];
|
package/package.json
CHANGED
package/src/client.ts
CHANGED
|
@@ -1907,6 +1907,7 @@ export class StreamChat {
|
|
|
1907
1907
|
}
|
|
1908
1908
|
|
|
1909
1909
|
const { predefined_filter, filter_values, sort_values, ...restOptions } = options;
|
|
1910
|
+
const normalizedSort = normalizeQuerySort(sort);
|
|
1910
1911
|
|
|
1911
1912
|
// Build payload based on whether we're using a predefined filter or traditional filters
|
|
1912
1913
|
const payload = predefined_filter
|
|
@@ -1914,12 +1915,13 @@ export class StreamChat {
|
|
|
1914
1915
|
predefined_filter,
|
|
1915
1916
|
filter_values,
|
|
1916
1917
|
sort_values,
|
|
1918
|
+
sort: normalizedSort,
|
|
1917
1919
|
...defaultOptions,
|
|
1918
1920
|
...restOptions,
|
|
1919
1921
|
}
|
|
1920
1922
|
: {
|
|
1921
1923
|
filter_conditions: filterConditions,
|
|
1922
|
-
sort:
|
|
1924
|
+
sort: normalizedSort,
|
|
1923
1925
|
...defaultOptions,
|
|
1924
1926
|
...restOptions,
|
|
1925
1927
|
};
|
|
@@ -1929,6 +1931,9 @@ export class StreamChat {
|
|
|
1929
1931
|
payload,
|
|
1930
1932
|
);
|
|
1931
1933
|
|
|
1934
|
+
// FIXME: In the next major release, return the full QueryChannelsAPIResponse
|
|
1935
|
+
// instead of only `data.channels` so top-level metadata such as
|
|
1936
|
+
// `predefined_filter` is not lost.
|
|
1932
1937
|
return data.channels;
|
|
1933
1938
|
}
|
|
1934
1939
|
|
|
@@ -4981,9 +4986,11 @@ export class StreamChat {
|
|
|
4981
4986
|
*
|
|
4982
4987
|
* @return {Promise<PredefinedFilterResponse>} The created predefined filter
|
|
4983
4988
|
*/
|
|
4984
|
-
async createPredefinedFilter
|
|
4989
|
+
async createPredefinedFilter<
|
|
4990
|
+
F extends Record<string, unknown> = Record<string, unknown>,
|
|
4991
|
+
>(options: CreatePredefinedFilterOptions<F>) {
|
|
4985
4992
|
this.validateServerSideAuth();
|
|
4986
|
-
return await this.post<PredefinedFilterResponse
|
|
4993
|
+
return await this.post<PredefinedFilterResponse<F>>(
|
|
4987
4994
|
`${this.baseURL}/predefined_filters`,
|
|
4988
4995
|
options,
|
|
4989
4996
|
);
|
|
@@ -4996,9 +5003,11 @@ export class StreamChat {
|
|
|
4996
5003
|
*
|
|
4997
5004
|
* @return {Promise<PredefinedFilterResponse>} The predefined filter
|
|
4998
5005
|
*/
|
|
4999
|
-
async getPredefinedFilter
|
|
5006
|
+
async getPredefinedFilter<F extends Record<string, unknown> = Record<string, unknown>>(
|
|
5007
|
+
name: string,
|
|
5008
|
+
) {
|
|
5000
5009
|
this.validateServerSideAuth();
|
|
5001
|
-
return await this.get<PredefinedFilterResponse
|
|
5010
|
+
return await this.get<PredefinedFilterResponse<F>>(
|
|
5002
5011
|
`${this.baseURL}/predefined_filters/${encodeURIComponent(name)}`,
|
|
5003
5012
|
);
|
|
5004
5013
|
}
|
|
@@ -5011,9 +5020,11 @@ export class StreamChat {
|
|
|
5011
5020
|
*
|
|
5012
5021
|
* @return {Promise<PredefinedFilterResponse>} The updated predefined filter
|
|
5013
5022
|
*/
|
|
5014
|
-
async updatePredefinedFilter
|
|
5023
|
+
async updatePredefinedFilter<
|
|
5024
|
+
F extends Record<string, unknown> = Record<string, unknown>,
|
|
5025
|
+
>(name: string, options: UpdatePredefinedFilterOptions<F>) {
|
|
5015
5026
|
this.validateServerSideAuth();
|
|
5016
|
-
return await this.put<PredefinedFilterResponse
|
|
5027
|
+
return await this.put<PredefinedFilterResponse<F>>(
|
|
5017
5028
|
`${this.baseURL}/predefined_filters/${encodeURIComponent(name)}`,
|
|
5018
5029
|
options,
|
|
5019
5030
|
);
|
|
@@ -5040,10 +5051,12 @@ export class StreamChat {
|
|
|
5040
5051
|
*
|
|
5041
5052
|
* @return {Promise<ListPredefinedFiltersResponse>} The list of predefined filters
|
|
5042
5053
|
*/
|
|
5043
|
-
async listPredefinedFilters
|
|
5054
|
+
async listPredefinedFilters<
|
|
5055
|
+
F extends Record<string, unknown> = Record<string, unknown>,
|
|
5056
|
+
>(options: ListPredefinedFiltersOptions = {}) {
|
|
5044
5057
|
this.validateServerSideAuth();
|
|
5045
5058
|
const { sort, ...paginationOptions } = options;
|
|
5046
|
-
return await this.get<ListPredefinedFiltersResponse
|
|
5059
|
+
return await this.get<ListPredefinedFiltersResponse<F>>(
|
|
5047
5060
|
`${this.baseURL}/predefined_filters`,
|
|
5048
5061
|
{
|
|
5049
5062
|
...paginationOptions,
|
|
@@ -2,6 +2,7 @@ export * from './activeCommandGuard';
|
|
|
2
2
|
export * from './commands';
|
|
3
3
|
export * from './commandEffects';
|
|
4
4
|
export * from './commandStringExtraction';
|
|
5
|
+
export * from './commandUtils';
|
|
5
6
|
export * from './mentions';
|
|
6
7
|
export * from './validation';
|
|
7
8
|
export * from './TextComposerMiddlewareExecutor';
|
package/src/types.ts
CHANGED
|
@@ -1060,13 +1060,29 @@ export type ChannelOptions = {
|
|
|
1060
1060
|
user_id?: string;
|
|
1061
1061
|
watch?: boolean;
|
|
1062
1062
|
/**
|
|
1063
|
-
* Name of a predefined filter to use instead of
|
|
1064
|
-
*
|
|
1063
|
+
* Name of a predefined filter to use instead of sending raw
|
|
1064
|
+
* `filter_conditions`.
|
|
1065
|
+
*
|
|
1066
|
+
* The backend resolves the filter template by name and interpolates it using
|
|
1067
|
+
* `filter_values`.
|
|
1068
|
+
*
|
|
1069
|
+
* A regular `sort` can still be passed to `queryChannels()`, but backend
|
|
1070
|
+
* precedence rules apply:
|
|
1071
|
+
*
|
|
1072
|
+
* - if the predefined filter has its own stored sort template, that stored
|
|
1073
|
+
* sort takes precedence and the request `sort` is ignored
|
|
1074
|
+
* - if the predefined filter does not define a sort template, the request
|
|
1075
|
+
* `sort` can still be used
|
|
1065
1076
|
*/
|
|
1066
1077
|
predefined_filter?: string;
|
|
1067
1078
|
/**
|
|
1068
|
-
* Values to interpolate
|
|
1069
|
-
*
|
|
1079
|
+
* Values used to interpolate placeholders inside the predefined filter's
|
|
1080
|
+
* `filter` template.
|
|
1081
|
+
*
|
|
1082
|
+
* Example: a template value like `{{user_id}}` can be resolved with
|
|
1083
|
+
* `{ user_id: 'alice' }`.
|
|
1084
|
+
*
|
|
1085
|
+
* Only used when `predefined_filter` is provided.
|
|
1070
1086
|
*/
|
|
1071
1087
|
filter_values?: Record<string, unknown>;
|
|
1072
1088
|
/**
|
|
@@ -4755,38 +4771,129 @@ export type UpdateChannelsBatchResponse = {
|
|
|
4755
4771
|
export type PredefinedFilterOperation = 'QueryChannels';
|
|
4756
4772
|
|
|
4757
4773
|
export type PredefinedFilterSortParam = {
|
|
4774
|
+
/**
|
|
4775
|
+
* Field name to sort by.
|
|
4776
|
+
*
|
|
4777
|
+
* This may be a literal field name such as `created_at`, or a placeholder
|
|
4778
|
+
* template such as `{{sort_field}}` that will be interpolated server-side.
|
|
4779
|
+
*/
|
|
4758
4780
|
field: string;
|
|
4781
|
+
/**
|
|
4782
|
+
* Sort direction. `1` means ascending and `-1` means descending.
|
|
4783
|
+
*
|
|
4784
|
+
* The backend defaults this to `1` when omitted.
|
|
4785
|
+
*/
|
|
4759
4786
|
direction?: AscDesc;
|
|
4787
|
+
/**
|
|
4788
|
+
* Optional server-side hint describing how the sort field value should be
|
|
4789
|
+
* interpreted.
|
|
4790
|
+
*
|
|
4791
|
+
* This is mainly relevant for predefined-filter sort templates and is not
|
|
4792
|
+
* part of the regular `queryChannels()` sort shape. Omitting it uses the
|
|
4793
|
+
* backend default string behavior. Known backend values include:
|
|
4794
|
+
*
|
|
4795
|
+
* - `number`: cast custom-field values to numeric before sorting
|
|
4796
|
+
* - `boolean`: cast custom-field values to boolean before sorting
|
|
4797
|
+
*
|
|
4798
|
+
* Other values are backend-defined. In most cases this should be omitted
|
|
4799
|
+
* unless you are sorting by a custom field whose stored JSON value is not
|
|
4800
|
+
* string-like.
|
|
4801
|
+
*/
|
|
4760
4802
|
type?: string;
|
|
4761
4803
|
};
|
|
4762
4804
|
|
|
4763
|
-
|
|
4805
|
+
/**
|
|
4806
|
+
* Stored predefined filter definition as returned by the server.
|
|
4807
|
+
*
|
|
4808
|
+
* `F` represents the raw filter template shape. It defaults to a generic record
|
|
4809
|
+
* because predefined filters are server-managed templates and may include
|
|
4810
|
+
* placeholders or app-specific structures.
|
|
4811
|
+
*/
|
|
4812
|
+
export type PredefinedFilter<
|
|
4813
|
+
F extends Record<string, unknown> = Record<string, unknown>,
|
|
4814
|
+
> = {
|
|
4815
|
+
/**
|
|
4816
|
+
* Unique predefined filter name within the app.
|
|
4817
|
+
*/
|
|
4764
4818
|
name: string;
|
|
4819
|
+
/**
|
|
4820
|
+
* Operation this predefined filter is valid for.
|
|
4821
|
+
*/
|
|
4765
4822
|
operation: PredefinedFilterOperation;
|
|
4766
|
-
|
|
4823
|
+
/**
|
|
4824
|
+
* Filter template stored on the server.
|
|
4825
|
+
*
|
|
4826
|
+
* This is not necessarily the fully interpolated runtime filter; placeholder
|
|
4827
|
+
* values such as `{{user_id}}` may still be present.
|
|
4828
|
+
*/
|
|
4829
|
+
filter: F;
|
|
4830
|
+
/**
|
|
4831
|
+
* Server creation timestamp in ISO-8601 format.
|
|
4832
|
+
*/
|
|
4767
4833
|
created_at: string;
|
|
4834
|
+
/**
|
|
4835
|
+
* Server update timestamp in ISO-8601 format.
|
|
4836
|
+
*/
|
|
4768
4837
|
updated_at: string;
|
|
4838
|
+
/**
|
|
4839
|
+
* Optional human-readable description.
|
|
4840
|
+
*/
|
|
4769
4841
|
description?: string;
|
|
4842
|
+
/**
|
|
4843
|
+
* Optional sort template stored with the predefined filter.
|
|
4844
|
+
*/
|
|
4770
4845
|
sort?: PredefinedFilterSortParam[];
|
|
4846
|
+
/**
|
|
4847
|
+
* Query identifier generated by the backend for the filter/sort pattern.
|
|
4848
|
+
*
|
|
4849
|
+
* The exact value is backend-generated and primarily useful for correlating
|
|
4850
|
+
* predefined filters with query analysis / query performance data.
|
|
4851
|
+
*/
|
|
4771
4852
|
query_id?: number;
|
|
4772
4853
|
};
|
|
4773
4854
|
|
|
4774
|
-
export type CreatePredefinedFilterOptions
|
|
4855
|
+
export type CreatePredefinedFilterOptions<
|
|
4856
|
+
F extends Record<string, unknown> = Record<string, unknown>,
|
|
4857
|
+
> = {
|
|
4858
|
+
/**
|
|
4859
|
+
* Unique predefined filter name.
|
|
4860
|
+
*/
|
|
4775
4861
|
name: string;
|
|
4862
|
+
/**
|
|
4863
|
+
* Operation this predefined filter will be used with.
|
|
4864
|
+
*/
|
|
4776
4865
|
operation: PredefinedFilterOperation;
|
|
4777
|
-
|
|
4866
|
+
/**
|
|
4867
|
+
* Filter template to store on the server.
|
|
4868
|
+
*/
|
|
4869
|
+
filter: F;
|
|
4870
|
+
/**
|
|
4871
|
+
* Optional human-readable description.
|
|
4872
|
+
*/
|
|
4778
4873
|
description?: string;
|
|
4874
|
+
/**
|
|
4875
|
+
* Optional sort template stored with the predefined filter.
|
|
4876
|
+
*/
|
|
4779
4877
|
sort?: PredefinedFilterSortParam[];
|
|
4780
4878
|
};
|
|
4781
4879
|
|
|
4782
|
-
export type UpdatePredefinedFilterOptions
|
|
4880
|
+
export type UpdatePredefinedFilterOptions<
|
|
4881
|
+
F extends Record<string, unknown> = Record<string, unknown>,
|
|
4882
|
+
> = Omit<CreatePredefinedFilterOptions<F>, 'name'>;
|
|
4783
4883
|
|
|
4784
|
-
export type PredefinedFilterResponse
|
|
4785
|
-
|
|
4884
|
+
export type PredefinedFilterResponse<
|
|
4885
|
+
F extends Record<string, unknown> = Record<string, unknown>,
|
|
4886
|
+
> = APIResponse & {
|
|
4887
|
+
predefined_filter: PredefinedFilter<F>;
|
|
4786
4888
|
};
|
|
4787
4889
|
|
|
4788
|
-
|
|
4789
|
-
|
|
4890
|
+
/**
|
|
4891
|
+
* Paginated response returned when listing predefined filters.
|
|
4892
|
+
*/
|
|
4893
|
+
export type ListPredefinedFiltersResponse<
|
|
4894
|
+
F extends Record<string, unknown> = Record<string, unknown>,
|
|
4895
|
+
> = APIResponse & {
|
|
4896
|
+
predefined_filters: PredefinedFilter<F>[];
|
|
4790
4897
|
next?: string;
|
|
4791
4898
|
prev?: string;
|
|
4792
4899
|
};
|
|
@@ -4795,9 +4902,20 @@ export type ListPredefinedFiltersResponse = APIResponse & {
|
|
|
4795
4902
|
* Contains the interpolated filter and sort from a predefined filter.
|
|
4796
4903
|
* This is returned in the QueryChannels response when using a predefined filter.
|
|
4797
4904
|
*/
|
|
4798
|
-
export type ParsedPredefinedFilterResponse
|
|
4905
|
+
export type ParsedPredefinedFilterResponse<
|
|
4906
|
+
F extends Record<string, unknown> = Record<string, unknown>,
|
|
4907
|
+
> = {
|
|
4908
|
+
/**
|
|
4909
|
+
* Name of the predefined filter that was resolved.
|
|
4910
|
+
*/
|
|
4799
4911
|
name: string;
|
|
4800
|
-
|
|
4912
|
+
/**
|
|
4913
|
+
* Fully interpolated filter that the backend executed.
|
|
4914
|
+
*/
|
|
4915
|
+
filter: F;
|
|
4916
|
+
/**
|
|
4917
|
+
* Fully interpolated sort parameters resolved from the predefined filter.
|
|
4918
|
+
*/
|
|
4801
4919
|
sort?: PredefinedFilterSortParam[];
|
|
4802
4920
|
};
|
|
4803
4921
|
|