@squidcloud/client 1.0.101 → 1.0.103

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.
@@ -1 +1,66 @@
1
- export {};
1
+ import { IntegrationSchemaType } from './integrations';
2
+ export declare const UpsertIntegrationSchemaRequestSchema: {
3
+ type: string;
4
+ required: string[];
5
+ properties: {
6
+ id: {
7
+ type: string;
8
+ nullable: boolean;
9
+ };
10
+ type: {
11
+ type: string;
12
+ nullable: boolean;
13
+ };
14
+ schema: {
15
+ oneOf: ({
16
+ type: string;
17
+ required: string[];
18
+ properties: {
19
+ type: {
20
+ const: IntegrationSchemaType;
21
+ };
22
+ collections: {
23
+ type: string;
24
+ nullable: boolean;
25
+ };
26
+ baseUrl?: undefined;
27
+ endpoints?: undefined;
28
+ introspection?: undefined;
29
+ };
30
+ } | {
31
+ type: string;
32
+ required: string[];
33
+ properties: {
34
+ type: {
35
+ const: IntegrationSchemaType;
36
+ };
37
+ baseUrl: {
38
+ type: string;
39
+ nullable: boolean;
40
+ };
41
+ endpoints: {
42
+ type: string;
43
+ nullable: boolean;
44
+ };
45
+ collections?: undefined;
46
+ introspection?: undefined;
47
+ };
48
+ } | {
49
+ type: string;
50
+ required: string[];
51
+ properties: {
52
+ type: {
53
+ const: IntegrationSchemaType;
54
+ };
55
+ introspection: {
56
+ type: string;
57
+ nullable: boolean;
58
+ };
59
+ collections?: undefined;
60
+ baseUrl?: undefined;
61
+ endpoints?: undefined;
62
+ };
63
+ })[];
64
+ };
65
+ };
66
+ };
@@ -1,5 +1,5 @@
1
1
  import { AppId, EnvironmentId, IntegrationId } from './communication.types';
2
- import { AiAssistantConfiguration, GraphQLConnectionOptions, IntegrationAiAssistantSchema, IntegrationApiSchema, IntegrationDataSchema, IntegrationGraphQLSchema, IntegrationType, MongoConnectionOptions, MssqlConnectionOptions, MySqlConnectionOptions, OpenApiDiscoveryOptions, OracleConnectionOptions, PostgresConnectionOptions, SnowflakeConnectionOptions } from './integrations';
2
+ import { AuthIntegrationType, DatabaseIntegrationType, IntegrationConfig, IntegrationConfigTypes, IntegrationSchema, IntegrationSchemaKeys, IntegrationSchemaTypes, IntegrationType, IntegrationTypeWithConfig } from './integrations';
3
3
  /** A type alias for a string that represents a webhook. */
4
4
  export type WebhookId = string;
5
5
  /** A type alias for a string that represents a named query. */
@@ -96,81 +96,6 @@ export declare enum CronExpression {
96
96
  MONDAY_TO_FRIDAY_AT_10PM = "0 0 22 * * 1-5",
97
97
  MONDAY_TO_FRIDAY_AT_11PM = "0 0 23 * * 1-5"
98
98
  }
99
- interface BaseUpsertDataIntegrationRequest extends BaseUpsertIntegrationRequest {
100
- supportsExternalChanges?: boolean;
101
- }
102
- export interface UpsertInternalIntegrationRequest extends BaseUpsertDataIntegrationRequest {
103
- type: IntegrationType.built_in_db;
104
- schema?: IntegrationDataSchema;
105
- }
106
- export interface UpsertMongoDbIntegrationRequest extends BaseUpsertDataIntegrationRequest {
107
- type: IntegrationType.mongo;
108
- schema?: IntegrationDataSchema;
109
- configuration: {
110
- connectionOptions: MongoConnectionOptions;
111
- };
112
- }
113
- export interface UpsertMySqlIntegrationRequest extends BaseUpsertDataIntegrationRequest {
114
- type: IntegrationType.mysql;
115
- schema?: IntegrationDataSchema;
116
- configuration: {
117
- connectionOptions: MySqlConnectionOptions;
118
- };
119
- }
120
- export interface UpsertOracleIntegrationRequest extends BaseUpsertDataIntegrationRequest {
121
- type: IntegrationType.oracledb;
122
- schema?: IntegrationDataSchema;
123
- configuration: {
124
- connectionOptions: OracleConnectionOptions;
125
- };
126
- }
127
- export interface UpsertMssqlIntegrationRequest extends BaseUpsertDataIntegrationRequest {
128
- type: IntegrationType.mssql;
129
- schema?: IntegrationDataSchema;
130
- configuration: {
131
- connectionOptions: MssqlConnectionOptions;
132
- };
133
- }
134
- export interface UpsertPostgresIntegrationRequest extends BaseUpsertDataIntegrationRequest {
135
- type: IntegrationType.postgres;
136
- schema?: IntegrationDataSchema;
137
- configuration: {
138
- connectionOptions: PostgresConnectionOptions;
139
- };
140
- }
141
- export interface UpsertCockroachIntegrationRequest extends BaseUpsertDataIntegrationRequest {
142
- type: IntegrationType.cockroach;
143
- schema?: IntegrationDataSchema;
144
- configuration: {
145
- connectionOptions: PostgresConnectionOptions;
146
- };
147
- }
148
- export interface UpsertSnowflakeIntegrationRequest extends BaseUpsertDataIntegrationRequest {
149
- type: IntegrationType.snowflake;
150
- schema?: IntegrationDataSchema;
151
- configuration: {
152
- connectionOptions: SnowflakeConnectionOptions;
153
- };
154
- }
155
- export interface UpsertGraphQLIntegrationRequest extends BaseUpsertIntegrationRequest {
156
- type: IntegrationType.graphql;
157
- schema?: IntegrationGraphQLSchema;
158
- configuration: {
159
- connectionOptions: GraphQLConnectionOptions;
160
- };
161
- }
162
- export interface UpsertApiIntegrationRequest extends BaseUpsertIntegrationRequest {
163
- type: IntegrationType.api;
164
- schema?: IntegrationApiSchema;
165
- configuration?: {
166
- discoveryOptions: OpenApiDiscoveryOptions;
167
- };
168
- }
169
- export interface UpsertAiAssistantIntegrationRequest extends BaseUpsertIntegrationRequest {
170
- type: IntegrationType.ai_assistant;
171
- schema?: IntegrationAiAssistantSchema;
172
- configuration: AiAssistantConfiguration;
173
- }
174
99
  export interface DeleteIntegrationRequest {
175
100
  integrationId: IntegrationId;
176
101
  }
@@ -181,4 +106,35 @@ export interface CreateEnvironmentRequest {
181
106
  sourceAppId: AppId;
182
107
  environmentId: EnvironmentId;
183
108
  }
109
+ interface BaseUpsertIntegrationRequest<T extends IntegrationTypeWithConfig, C extends IntegrationConfig> {
110
+ id: IntegrationId;
111
+ type: T;
112
+ config: Partial<C>;
113
+ }
114
+ type ConfigurationTypes = {
115
+ [K in IntegrationTypeWithConfig]: IntegrationConfigTypes[K];
116
+ };
117
+ type UpsertIntegrationRequests = {
118
+ [K in IntegrationTypeWithConfig]: BaseUpsertIntegrationRequest<K, ConfigurationTypes[K]>;
119
+ };
120
+ export type UpsertDataIntegrationRequest = UpsertIntegrationRequests[DatabaseIntegrationType];
121
+ export type UpsertGraphQLIntegrationRequest = UpsertIntegrationRequests[IntegrationType.graphql];
122
+ export type UpsertApiIntegrationRequest = UpsertIntegrationRequests[IntegrationType.api];
123
+ export type UpsertAiAssistantIntegrationRequest = UpsertIntegrationRequests[IntegrationType.ai_assistant];
124
+ export type UpsertAuthIntegrationRequest = UpsertIntegrationRequests[AuthIntegrationType];
125
+ interface BaseUpsertIntegrationSchemaRequest<T extends IntegrationType, S extends IntegrationSchema> {
126
+ id: IntegrationId;
127
+ type: T;
128
+ schema: S;
129
+ }
130
+ type SchemaTypes = {
131
+ [K in IntegrationSchemaKeys]: IntegrationSchemaTypes[K];
132
+ };
133
+ type UpsertIntegrationSchemaRequests = {
134
+ [K in IntegrationSchemaKeys]: BaseUpsertIntegrationSchemaRequest<K, SchemaTypes[K]>;
135
+ };
136
+ export type UpsertIntegrationSchemaRequest = UpsertDataIntegrationSchemaRequest | UpsertGraphQLIntegrationSchemaRequest | UpsertApiIntegrationSchemaRequest;
137
+ export type UpsertDataIntegrationSchemaRequest = UpsertIntegrationSchemaRequests[DatabaseIntegrationType];
138
+ export type UpsertGraphQLIntegrationSchemaRequest = UpsertIntegrationSchemaRequests[IntegrationType.graphql];
139
+ export type UpsertApiIntegrationSchemaRequest = UpsertIntegrationSchemaRequests[IntegrationType.api];
184
140
  export {};
@@ -51,3 +51,5 @@ export * from './utils/url';
51
51
  export * from './utils/validation';
52
52
  export * from './webhook-response';
53
53
  export * from './heartbeat.types';
54
+ export * from './utils/global.utils';
55
+ export * from './websocket.impl';
@@ -1,30 +1,24 @@
1
1
  import { BaseIntegrationConfig, IntegrationType } from './index';
2
- import { IntegrationId } from '../communication.types';
3
2
  export interface AiAssistantIntegrationConfig extends BaseIntegrationConfig {
4
3
  type: IntegrationType.ai_assistant;
5
4
  configuration: AiAssistantConfiguration;
6
- schema: IntegrationAiAssistantSchema;
7
5
  }
8
6
  export type AiAssistantConfiguration = {
9
7
  apiKey?: string;
10
8
  };
11
- export type AiAssistantProfile = {
9
+ export type AiAssistantProfileMetadata = {
12
10
  modelName: string;
13
11
  strictContext: boolean;
14
12
  instructions: Record<string, string>;
15
- contexts: Record<string, AiAssistantContextMetadata>;
16
13
  };
17
14
  export type AiAssistantContextMetadata = {
18
15
  title: string;
19
16
  text: string;
20
17
  preview: boolean;
21
18
  };
22
- export interface IntegrationAiAssistantSchema {
23
- profiles: Record<string, AiAssistantProfile>;
24
- }
25
- export interface DiscoverAiAssistantSchemaRequest {
26
- integrationId: IntegrationId;
19
+ export interface AiAssistantProfile extends AiAssistantProfileMetadata {
20
+ contexts: Record<string, AiAssistantContextMetadata>;
27
21
  }
28
- export interface DiscoverAiAssistantSchemaResponse {
29
- schema: IntegrationAiAssistantSchema;
22
+ export interface AiAssistantProfiles {
23
+ profiles: Record<string, AiAssistantProfile>;
30
24
  }
@@ -1,6 +1,6 @@
1
1
  import { FieldName } from '../document.types';
2
2
  import { IntrospectionQuery } from '../graphql.types';
3
- import { BaseIntegrationConfig, IntegrationType } from './index';
3
+ import { BaseIntegrationConfig, BaseIntegrationSchema, IntegrationSchemaType, IntegrationType } from './index';
4
4
  export type HttpMethod = 'post' | 'get' | 'delete' | 'patch' | 'put';
5
5
  export type ApiEndpointId = string;
6
6
  export type ApiParameterLocation = 'query' | 'body' | 'header' | 'path';
@@ -8,10 +8,12 @@ export type ApiResponseParameterLocation = 'header' | 'body';
8
8
  export type ApiInjectionParameterLocation = 'header' | 'query';
9
9
  export type FieldPath = string;
10
10
  export type IntegrationApiEndpoints = Record<ApiEndpointId, ApiEndpoint>;
11
- export interface IntegrationGraphQLSchema {
11
+ export interface IntegrationGraphQLSchema extends BaseIntegrationSchema {
12
+ type: IntegrationSchemaType.graphql;
12
13
  introspection: IntrospectionQuery;
13
14
  }
14
- export interface IntegrationApiSchema {
15
+ export interface IntegrationApiSchema extends BaseIntegrationSchema {
16
+ type: IntegrationSchemaType.api;
15
17
  baseUrl: string;
16
18
  endpoints: IntegrationApiEndpoints;
17
19
  injectionSchema?: ApiInjectionSchema;
@@ -49,11 +51,9 @@ export interface HttpApiIntegrationConfig extends BaseIntegrationConfig {
49
51
  configuration?: {
50
52
  discoveryOptions: OpenApiDiscoveryOptions;
51
53
  };
52
- schema: IntegrationApiSchema;
53
54
  }
54
55
  export interface GraphQLIntegrationConfig extends BaseIntegrationConfig {
55
56
  type: IntegrationType.graphql;
56
- schema?: IntegrationGraphQLSchema;
57
57
  configuration: {
58
58
  connectionOptions: GraphQLConnectionOptions;
59
59
  };
@@ -1,6 +1,6 @@
1
1
  import { CollectionName } from '../document.types';
2
2
  import { CollectionSchema } from '../schema/schema.types';
3
- import { BaseIntegrationConfig, DatabaseIntegrationType, IntegrationType } from './index';
3
+ import { BaseIntegrationConfig, BaseIntegrationSchema, DatabaseIntegrationType, IntegrationSchemaType, IntegrationType } from './index';
4
4
  export interface MongoConnectionSecretOptions {
5
5
  password?: string;
6
6
  }
@@ -78,12 +78,12 @@ export interface SnowflakeConnectionOptions {
78
78
  role: string;
79
79
  }
80
80
  type TableName = string;
81
- export interface IntegrationDataSchema {
81
+ export interface IntegrationDataSchema extends BaseIntegrationSchema {
82
+ type: IntegrationSchemaType.data;
82
83
  collections: Record<TableName, CollectionSchema>;
83
84
  }
84
85
  export interface BaseDatabaseIntegrationConfig extends BaseIntegrationConfig {
85
86
  type: DatabaseIntegrationType;
86
- schema?: IntegrationDataSchema;
87
87
  supportsExternalChanges: boolean;
88
88
  }
89
89
  export interface MySqlIntegrationConfiguration {
@@ -107,22 +107,18 @@ export interface SnowflakeIntegrationConfiguration {
107
107
  export interface MySqlIntegrationConfig extends BaseDatabaseIntegrationConfig {
108
108
  type: IntegrationType.mysql;
109
109
  configuration: MySqlIntegrationConfiguration;
110
- schema: IntegrationDataSchema;
111
110
  }
112
111
  export interface OracleIntegrationConfig extends BaseDatabaseIntegrationConfig {
113
112
  type: IntegrationType.oracledb;
114
113
  configuration: OracleIntegrationConfiguration;
115
- schema: IntegrationDataSchema;
116
114
  }
117
115
  export interface MssqlIntegrationConfig extends BaseDatabaseIntegrationConfig {
118
116
  type: IntegrationType.mssql;
119
117
  configuration: MssqlIntegrationConfiguration;
120
- schema: IntegrationDataSchema;
121
118
  }
122
119
  export interface BasePostgresIntegration extends BaseDatabaseIntegrationConfig {
123
120
  type: IntegrationType.postgres | IntegrationType.cockroach;
124
121
  configuration: PostgresIntegrationConfiguration;
125
- schema: IntegrationDataSchema;
126
122
  }
127
123
  export interface PostgresIntegrationConfig extends BasePostgresIntegration {
128
124
  type: IntegrationType.postgres;
@@ -141,7 +137,6 @@ export interface MongoIntegrationConfig extends BaseDatabaseIntegrationConfig {
141
137
  export interface SnowflakeIntegrationConfig extends BaseDatabaseIntegrationConfig {
142
138
  type: IntegrationType.snowflake;
143
139
  configuration: SnowflakeIntegrationConfiguration;
144
- schema: IntegrationDataSchema;
145
140
  supportsExternalChanges: false;
146
141
  }
147
142
  interface TestMongoDataConnectionRequest {
@@ -5,9 +5,9 @@ export * from './database.types';
5
5
  export * from './observability.types';
6
6
  import { IntegrationId } from '../communication.types';
7
7
  import { AiAssistantIntegrationConfig } from './ai_assistant.types';
8
- import { GraphQLIntegrationConfig, HttpApiIntegrationConfig, TestGraphQLDataConnectionRequest } from './api.types';
8
+ import { GraphQLIntegrationConfig, HttpApiIntegrationConfig, IntegrationApiSchema, IntegrationGraphQLSchema, TestGraphQLDataConnectionRequest } from './api.types';
9
9
  import { Auth0IntegrationConfig, CognitoIntegrationConfig, JwtHmacIntegrationConfig, JwtRsaIntegrationConfig, OktaIntegrationConfig } from './auth.types';
10
- import { BaseDatabaseIntegrationConfig, CockroachIntegrationConfig, InternalIntegrationConfig, MongoIntegrationConfig, MssqlIntegrationConfig, MySqlIntegrationConfig, OracleIntegrationConfig, PostgresIntegrationConfig, SnowflakeIntegrationConfig, TestDataConnectionRequest } from './database.types';
10
+ import { BaseDatabaseIntegrationConfig, CockroachIntegrationConfig, IntegrationDataSchema, InternalIntegrationConfig, MongoIntegrationConfig, MssqlIntegrationConfig, MySqlIntegrationConfig, OracleIntegrationConfig, PostgresIntegrationConfig, SnowflakeIntegrationConfig, TestDataConnectionRequest } from './database.types';
11
11
  import { DatadogIntegrationConfig, NewRelicIntegrationConfig } from './observability.types';
12
12
  export declare enum IntegrationCategory {
13
13
  'database' = "database",
@@ -55,6 +55,11 @@ export declare enum IntegrationType {
55
55
  'xata' = "xata",
56
56
  'azure_sql' = "azure_sql"
57
57
  }
58
+ export declare enum IntegrationSchemaType {
59
+ 'data' = "data",
60
+ 'api' = "api",
61
+ 'graphql' = "graphql"
62
+ }
58
63
  export interface IntegrationConfigTypes {
59
64
  [IntegrationType.built_in_db]: InternalIntegrationConfig;
60
65
  [IntegrationType.mongo]: MongoIntegrationConfig;
@@ -75,6 +80,22 @@ export interface IntegrationConfigTypes {
75
80
  [IntegrationType.cognito]: CognitoIntegrationConfig;
76
81
  [IntegrationType.okta]: OktaIntegrationConfig;
77
82
  }
83
+ export interface IntegrationSchemaTypes {
84
+ [IntegrationType.built_in_db]: IntegrationDataSchema;
85
+ [IntegrationType.mongo]: IntegrationDataSchema;
86
+ [IntegrationType.mysql]: IntegrationDataSchema;
87
+ [IntegrationType.oracledb]: IntegrationDataSchema;
88
+ [IntegrationType.mssql]: IntegrationDataSchema;
89
+ [IntegrationType.postgres]: IntegrationDataSchema;
90
+ [IntegrationType.cockroach]: IntegrationDataSchema;
91
+ [IntegrationType.snowflake]: IntegrationDataSchema;
92
+ [IntegrationType.api]: IntegrationApiSchema;
93
+ [IntegrationType.graphql]: IntegrationGraphQLSchema;
94
+ }
95
+ export type IntegrationTypeWithConfig = keyof IntegrationConfigTypes;
96
+ export type IntegrationSchemaKeys = keyof IntegrationSchemaTypes;
97
+ export type IntegrationConfig = IntegrationConfigTypes[IntegrationTypeWithConfig];
98
+ export type IntegrationSchema = IntegrationSchemaTypes[IntegrationSchemaKeys];
78
99
  export declare const DatabaseIntegrationTypes: readonly [IntegrationType.built_in_db, IntegrationType.mongo, IntegrationType.mysql, IntegrationType.mssql, IntegrationType.postgres, IntegrationType.cockroach, IntegrationType.snowflake, IntegrationType.oracledb];
79
100
  export type DatabaseIntegrationType = (typeof DatabaseIntegrationTypes)[number];
80
101
  export type DatabaseIntegrationConfig = IntegrationConfigTypes[DatabaseIntegrationType];
@@ -91,11 +112,13 @@ export declare function isDataIntegrationType(type: IntegrationType): type is Da
91
112
  export declare function isDataIntegration(integration: any): integration is BaseDatabaseIntegrationConfig;
92
113
  export declare function isAuthIntegrationType(type: IntegrationType): type is AuthIntegrationType;
93
114
  export declare function isAuthIntegration(integration: any): integration is AuthIntegrationConfig;
94
- export type IntegrationConfig = DatabaseIntegrationConfig | ApiIntegrationConfig | ObservabilityIntegrationConfig | AuthIntegrationConfig | AiAssistantIntegrationConfig;
95
115
  export interface BaseIntegrationConfig {
96
116
  id: IntegrationId;
97
- type: IntegrationType;
117
+ type: IntegrationTypeWithConfig;
98
118
  creationDate: Date;
99
119
  updateDate: Date;
100
120
  }
121
+ export interface BaseIntegrationSchema {
122
+ type: IntegrationSchemaType;
123
+ }
101
124
  export type TestConnectionRequest = TestDataConnectionRequest | TestGraphQLDataConnectionRequest;
@@ -2,6 +2,7 @@ import { Observable } from 'rxjs';
2
2
  import { DocumentData, FieldName, PrimitiveFieldType } from '../document.types';
3
3
  import { Operator } from '../query.types';
4
4
  import { SerializedQuery } from './serialized-query.types';
5
+ import { PaginationOptions, Pagination } from './pagination';
5
6
  export interface SnapshotEmitter<ReturnType> {
6
7
  /**
7
8
  * Returns a promise that resolves to the query results.
@@ -144,53 +145,3 @@ export interface HasDereference {
144
145
  */
145
146
  dereference(): any;
146
147
  }
147
- /** The state of a pagination. */
148
- export interface PaginationState<ReturnType> {
149
- data: Array<ReturnType>;
150
- hasNext: boolean;
151
- hasPrev: boolean;
152
- isLoading: boolean;
153
- }
154
- /** Pagination options */
155
- export interface PaginationOptions {
156
- /** Whether to show real-time updates. Defaults to true. */
157
- subscribe: boolean;
158
- /** The number of items in a page. Defaults to 100. */
159
- pageSize: number;
160
- }
161
- /** A query wrapper that provides pagination functionality. */
162
- export declare class Pagination<ReturnType> {
163
- private readonly templateSnapshotEmitter;
164
- /**
165
- * The first page data - only available when subscribe is true.
166
- * It is used for:
167
- * 1 - Telling whether there is a previous page
168
- * 2 - Used as the data when the current page has less than page size and hasNext = true
169
- */
170
- private readonly firstPageSnapshotEmitterWrapper;
171
- private readonly firstPageDataAvailable;
172
- /**
173
- * The last page data - only available when subscribe is true. Lazily initialized when calling prev.
174
- * It is used for telling whether there is a next result after calling prev.
175
- */
176
- private lastPageSnapshotEmitterWrapper;
177
- private lastPageDataAvailable;
178
- private readonly isDestroyed;
179
- private readonly destroyedObs;
180
- private readonly _observeState;
181
- /** The current snapshot emitter wrapper. */
182
- private readonly currentPageSnapshotEmitterWrapperSubject;
183
- private readonly options;
184
- /** Requests the next page. */
185
- next(): Promise<PaginationState<ReturnType>>;
186
- /** Requests the previous page. */
187
- prev(): Promise<PaginationState<ReturnType>>;
188
- /** Unsubscribe from the pagination object and from the query. */
189
- unsubscribe(): void;
190
- /** The current pagination state and data. */
191
- observeState(): Observable<PaginationState<ReturnType>>;
192
- /** Wait for the data to be available (the isLoading flag to be false). */
193
- waitForData(): Promise<PaginationState<ReturnType>>;
194
- private createLastPageSnapshotEmitterWrapper;
195
- private resetToFirstPageData;
196
- }
@@ -1,3 +1,4 @@
1
1
  export * from './query-context';
2
2
  export * from './base-query-builder';
3
3
  export * from './serialized-query.types';
4
+ export * from './pagination';
@@ -0,0 +1,44 @@
1
+ import { Observable } from 'rxjs';
2
+ /** The state of a pagination. */
3
+ export interface PaginationState<ReturnType> {
4
+ data: Array<ReturnType>;
5
+ hasNext: boolean;
6
+ hasPrev: boolean;
7
+ }
8
+ /** Pagination options */
9
+ export interface PaginationOptions {
10
+ /** Whether to show real-time updates. Defaults to true. */
11
+ subscribe: boolean;
12
+ /** The number of items in a page. Defaults to 100. */
13
+ pageSize: number;
14
+ }
15
+ interface InternalState<ReturnType> {
16
+ data: ReturnType[];
17
+ extractedData: any[];
18
+ numBefore: number;
19
+ numAfter: number;
20
+ }
21
+ export declare class Pagination<ReturnType> {
22
+ private readonly options;
23
+ private internalStateObserver;
24
+ private firstElement;
25
+ private lastElement;
26
+ private readonly isDestroyed;
27
+ private templateSnapshotEmitter;
28
+ private snapshotSubject;
29
+ private onFirstPage;
30
+ private goToFirstPage;
31
+ private static compareValues;
32
+ private compare;
33
+ dataReceived(data: Array<ReturnType>): Promise<void>;
34
+ private doNewQuery;
35
+ private waitForInternalState;
36
+ private internalStateToState;
37
+ unsubscribe(): void;
38
+ prevInternal(internalState: InternalState<ReturnType>): void;
39
+ prev(): Promise<PaginationState<ReturnType>>;
40
+ next(): Promise<PaginationState<ReturnType>>;
41
+ waitForData(): Promise<PaginationState<ReturnType>>;
42
+ observeState(): Observable<PaginationState<ReturnType>>;
43
+ }
44
+ export {};
@@ -50,6 +50,11 @@ export interface Query<Doc extends DocumentData = any> {
50
50
  conditions: Conditions<Doc>;
51
51
  sortOrder: Array<FieldSort<Doc>>;
52
52
  limit: number;
53
+ limitBy?: {
54
+ limit: number;
55
+ fields: Array<FieldName<Doc>>;
56
+ reverseSort: boolean;
57
+ };
53
58
  }
54
59
  export interface QueryRegisterRequest {
55
60
  clientRequestId: ClientRequestId;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,21 @@
1
+ interface Options {
2
+ maxAttempts?: number;
3
+ protocols?: string[];
4
+ onmessage?: (event: any) => void;
5
+ onopen?: (event: any) => void;
6
+ onclose?: (event: any) => void;
7
+ onerror?: (event: any) => void;
8
+ onreconnect?: (event: any) => void;
9
+ onmaximum?: (event: any) => void;
10
+ timeout?: number;
11
+ }
12
+ export interface WebSocketWrapper {
13
+ open: () => void;
14
+ reconnect: (e: any) => void;
15
+ json: (x: any) => void;
16
+ send: (x: string) => void;
17
+ close: (x?: number, y?: string) => void;
18
+ connected: boolean;
19
+ }
20
+ export declare function createWebSocketWrapper(url: string, opts?: Options): WebSocketWrapper;
21
+ export {};