@squidcloud/client 1.0.72 → 1.0.73

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.
@@ -10,13 +10,3 @@ export declare const allEnvironmentIds: Array<EnvironmentId>;
10
10
  /** A type alias for an integration id. */
11
11
  export type IntegrationId = string;
12
12
  export type SquidDeveloperId = string;
13
- export interface ParsedAppId {
14
- appId: AppId;
15
- environmentId: EnvironmentId;
16
- squidDeveloperId?: SquidDeveloperId;
17
- }
18
- export declare function parseAppId(appId: AppId): ParsedAppId;
19
- export declare function appIdWithEnvironmentId(appId: AppId, environmentId: EnvironmentId | undefined): AppId;
20
- export declare function validateEnvironment(appId: AppId): ParsedAppId;
21
- export declare function verifyWithSquidDevId(appId: AppId): void;
22
- export declare function omitSquidDevId(appId: AppId): AppId;
@@ -0,0 +1 @@
1
+ export declare function checkAllHeartbeatProviders(heartbeatProviders: Record<string, HeartbeatProvider>): Promise<void>;
@@ -4,7 +4,6 @@ export * from './api-call.context';
4
4
  export * from './api.types';
5
5
  export * from './application.schemas';
6
6
  export * from './application.types';
7
- export * from './auth.types';
8
7
  export * from './backend-function.schemas';
9
8
  export * from './backend-function.types';
10
9
  export * from './backend-run.types';
@@ -52,3 +51,4 @@ export * from './utils/transforms';
52
51
  export * from './utils/url';
53
52
  export * from './utils/validation';
54
53
  export * from './webhook-response';
54
+ export * from './heartbeat.types';
@@ -1,4 +1,3 @@
1
- import { Validations } from '../auth.types';
2
1
  import { BaseIntegrationConfig, IntegrationType } from './index';
3
2
  export interface Auth0IntegrationConfig extends BaseIntegrationConfig {
4
3
  type: IntegrationType.auth0;
@@ -7,11 +6,22 @@ export interface Auth0IntegrationConfig extends BaseIntegrationConfig {
7
6
  domain: string;
8
7
  };
9
8
  }
9
+ export interface CognitoIntegrationConfig extends BaseIntegrationConfig {
10
+ type: IntegrationType.cognito;
11
+ configuration: {
12
+ region: string;
13
+ userPoolId: string;
14
+ appClientId: string;
15
+ };
16
+ }
10
17
  export interface JwtRsaIntegrationConfig extends BaseIntegrationConfig {
11
18
  type: IntegrationType.jwt_rsa;
12
19
  configuration: {
13
20
  jwksUri: string;
14
- validations?: Validations;
21
+ validations?: {
22
+ aud?: string;
23
+ iss?: string;
24
+ };
15
25
  };
16
26
  }
17
27
  export interface JwtHmacIntegrationConfig extends BaseIntegrationConfig {
@@ -6,7 +6,7 @@ export * from './observability.types';
6
6
  import { IntegrationId } from '../communication.types';
7
7
  import { AiAssistantIntegrationConfig } from './ai_assistant.types';
8
8
  import { GraphQLIntegrationConfig, HttpApiIntegrationConfig, TestGraphQLDataConnectionRequest } from './api.types';
9
- import { Auth0IntegrationConfig, JwtHmacIntegrationConfig, JwtRsaIntegrationConfig } from './auth.types';
9
+ import { Auth0IntegrationConfig, CognitoIntegrationConfig, JwtHmacIntegrationConfig, JwtRsaIntegrationConfig } from './auth.types';
10
10
  import { BaseDatabaseIntegrationConfig, CockroachIntegrationConfig, 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 {
@@ -33,6 +33,7 @@ export declare enum IntegrationType {
33
33
  'jwt_rsa' = "jwt_rsa",
34
34
  'jwt_hmac' = "jwt_hmac",
35
35
  'ai_assistant' = "ai_assistant",
36
+ 'cognito' = "cognito",
36
37
  'algolia' = "algolia",
37
38
  'elastic_observability' = "elastic_observability",
38
39
  'elastic_search' = "elastic_search",
@@ -70,13 +71,14 @@ export interface IntegrationConfigTypes {
70
71
  [IntegrationType.jwt_rsa]: JwtRsaIntegrationConfig;
71
72
  [IntegrationType.jwt_hmac]: JwtHmacIntegrationConfig;
72
73
  [IntegrationType.ai_assistant]: AiAssistantIntegrationConfig;
74
+ [IntegrationType.cognito]: CognitoIntegrationConfig;
73
75
  }
74
76
  export declare const DatabaseIntegrationTypes: readonly [IntegrationType.built_in_db, IntegrationType.mongo, IntegrationType.mysql, IntegrationType.mssql, IntegrationType.postgres, IntegrationType.cockroach, IntegrationType.snowflake, IntegrationType.oracledb];
75
77
  export type DatabaseIntegrationType = (typeof DatabaseIntegrationTypes)[number];
76
78
  export type DatabaseIntegrationConfig = IntegrationConfigTypes[DatabaseIntegrationType];
77
79
  export declare const ApiIntegrationTypes: readonly [IntegrationType.api, IntegrationType.graphql];
78
80
  export declare const ObservabilityIntegrationTypes: readonly [IntegrationType.datadog, IntegrationType.newrelic];
79
- export declare const AuthIntegrationTypes: readonly [IntegrationType.auth0, IntegrationType.jwt_rsa, IntegrationType.jwt_hmac];
81
+ export declare const AuthIntegrationTypes: readonly [IntegrationType.auth0, IntegrationType.jwt_rsa, IntegrationType.jwt_hmac, IntegrationType.cognito];
80
82
  export type ApiIntegrationType = (typeof ApiIntegrationTypes)[number];
81
83
  export type ApiIntegrationConfig = IntegrationConfigTypes[ApiIntegrationType];
82
84
  export type ObservabilityIntegrationType = (typeof ObservabilityIntegrationTypes)[number];
@@ -1,5 +1,5 @@
1
1
  import { IntegrationId } from '../communication.types';
2
- import { CollectionName, FieldName } from '../document.types';
2
+ import { CollectionName, DocumentData, FieldName } from '../document.types';
3
3
  import { AllOperators, ContextCondition, ContextConditions, FieldSort, GeneralCondition, GeneralConditions, GenericValue, Query } from '../query.types';
4
4
  import { PartialBy, Paths } from '../types';
5
5
  export declare class QueryContext<T = any> {
@@ -21,6 +21,11 @@ export declare class QueryContext<T = any> {
21
21
  isSubsetOfQuery(query: Query<T>): boolean;
22
22
  getConditionsFor<K extends FieldName<T>>(...fieldNames: K[]): ContextConditions<T, K>;
23
23
  getConditionsForField<K extends Paths<T>>(fieldName: K): ContextConditions<T>;
24
+ /**
25
+ * Returns true if the given document can be a result of the query.
26
+ * The method does not account for limit and sort order.
27
+ */
28
+ documentMatchesQuery(doc: DocumentData): boolean;
24
29
  /**
25
30
  * Compares a condition against a given operator and value to determine if the
26
31
  * provided condition is a subset of the operator and value. A condition is
@@ -2,7 +2,7 @@ import { IntegrationId } from '../communication.types';
2
2
  import { CollectionName, DocumentData, FieldName, PrimitiveFieldType } from '../document.types';
3
3
  import { Operator, Query } from '../query.types';
4
4
  /** Base interface for a query builder. */
5
- export interface BaseQueryBuilderInterface<MyDocType extends DocumentData> {
5
+ export declare abstract class BaseQueryBuilderInterface<MyDocType extends DocumentData> {
6
6
  /**
7
7
  * Adds a condition to the query.
8
8
  * @param fieldName The name of the field to query.
@@ -10,7 +10,7 @@ export interface BaseQueryBuilderInterface<MyDocType extends DocumentData> {
10
10
  * @param value The value to compare against.
11
11
  * @returns The query builder.
12
12
  */
13
- where(fieldName: (keyof MyDocType & FieldName) | string, operator: Operator | 'in' | 'not in', value: PrimitiveFieldType | Array<PrimitiveFieldType>): this;
13
+ abstract where(fieldName: (keyof MyDocType & FieldName) | string, operator: Operator | 'in' | 'not in', value: PrimitiveFieldType | Array<PrimitiveFieldType>): this;
14
14
  /**
15
15
  * A shortcut for where(fieldName, '==', value)
16
16
  *
@@ -92,7 +92,7 @@ export interface BaseQueryBuilderInterface<MyDocType extends DocumentData> {
92
92
  * @param limit The limit to set.
93
93
  * @returns The query builder.
94
94
  */
95
- limit(limit: number): this;
95
+ abstract limit(limit: number): this;
96
96
  /**
97
97
  * Adds a sort order to the query. You can add multiple sort orders to the query. The order in which you add them
98
98
  * determines the order in which they are applied.
@@ -100,36 +100,16 @@ export interface BaseQueryBuilderInterface<MyDocType extends DocumentData> {
100
100
  * @param asc Whether to sort in ascending order. Defaults to true.
101
101
  * @returns The query builder.
102
102
  */
103
- sortBy(fieldName: keyof MyDocType & FieldName, asc?: boolean): this;
103
+ abstract sortBy(fieldName: keyof MyDocType & FieldName, asc?: boolean): this;
104
104
  }
105
105
  /** A query builder that can be used to build a query that returns a list of documents. */
106
- export declare class SimpleQueryBuilder<MyDocType extends DocumentData> implements BaseQueryBuilderInterface<MyDocType> {
106
+ export declare class SimpleQueryBuilder<MyDocType extends DocumentData> extends BaseQueryBuilderInterface<MyDocType> {
107
107
  protected readonly collectionName: CollectionName;
108
108
  protected readonly integrationId: IntegrationId;
109
109
  protected readonly query: Query<MyDocType>;
110
110
  /** @inheritDoc */
111
111
  where(fieldName: (keyof MyDocType & FieldName) | string, operator: Operator | 'in' | 'not in', value: PrimitiveFieldType | Array<PrimitiveFieldType>): this;
112
112
  /** @inheritDoc */
113
- eq(fieldName: (keyof MyDocType & FieldName) | string, value: PrimitiveFieldType): this;
114
- /** @inheritDoc */
115
- neq(fieldName: (keyof MyDocType & FieldName) | string, value: PrimitiveFieldType): this;
116
- /** @inheritDoc */
117
- in(fieldName: (keyof MyDocType & FieldName) | string, value: Array<PrimitiveFieldType>): this;
118
- /** @inheritDoc */
119
- nin(fieldName: (keyof MyDocType & FieldName) | string, value: Array<PrimitiveFieldType>): this;
120
- /** @inheritDoc */
121
- gt(fieldName: (keyof MyDocType & FieldName) | string, value: PrimitiveFieldType): this;
122
- /** @inheritDoc */
123
- gte(fieldName: (keyof MyDocType & FieldName) | string, value: PrimitiveFieldType): this;
124
- /** @inheritDoc */
125
- lt(fieldName: (keyof MyDocType & FieldName) | string, value: PrimitiveFieldType): this;
126
- /** @inheritDoc */
127
- lte(fieldName: (keyof MyDocType & FieldName) | string, value: PrimitiveFieldType): this;
128
- /** @inheritDoc */
129
- like(fieldName: (keyof MyDocType & FieldName) | string, pattern: string, caseSensitive?: boolean): this;
130
- /** @inheritDoc */
131
- notLike(fieldName: (keyof MyDocType & FieldName) | string, pattern: string, caseSensitive?: boolean): this;
132
- /** @inheritDoc */
133
113
  limit(limit: number): this;
134
114
  /** @inheritDoc */
135
115
  sortBy(fieldName: keyof MyDocType & FieldName, asc?: boolean): this;
@@ -1 +1,3 @@
1
- export {};
1
+ import { JSONSchemaType } from 'ajv';
2
+ import { QueryRegisterRequest } from './query.types';
3
+ export declare const QueryRegisterRequestSchema: JSONSchemaType<QueryRegisterRequest>;
@@ -1,3 +1,4 @@
1
+ import { ClientId, ClientRequestId } from './communication.types';
1
2
  import { CollectionName, FieldName } from './document.types';
2
3
  /** A list of query conditions. */
3
4
  export type Conditions<Doc = any, F extends FieldName<Doc> = any> = Array<Condition<Doc, F>>;
@@ -23,7 +24,7 @@ interface NotInContextCondition<Doc = any, F extends FieldName<Doc> = any> exten
23
24
  operator: 'not in';
24
25
  value: Array<Doc[F]>;
25
26
  }
26
- interface OtherContextCondition<Doc = any, F extends FieldName<Doc> = any> extends Omit<Condition<Doc, F>, 'operator'> {
27
+ export interface OtherContextCondition<Doc = any, F extends FieldName<Doc> = any> extends Omit<Condition<Doc, F>, 'operator'> {
27
28
  operator: Exclude<ContextOperator, 'in' | 'not in'>;
28
29
  }
29
30
  /** A condition that includes the 'in' and 'not in' operators. */
@@ -48,4 +49,10 @@ export interface Query<Doc = any> {
48
49
  sortOrder: Array<FieldSort<Doc>>;
49
50
  limit: number;
50
51
  }
52
+ export interface QueryRegisterRequest {
53
+ clientId: ClientId;
54
+ clientRequestId: ClientRequestId;
55
+ query: Query;
56
+ parentClientRequestId: ClientRequestId;
57
+ }
51
58
  export {};