@squidcloud/client 1.0.157 → 1.0.159

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.
Files changed (96) hide show
  1. package/dist/cjs/index.js +146 -66
  2. package/package.json +1 -1
  3. package/dist/internal-common/src/public-types/ai-assistant.types.d.ts +0 -25
  4. package/dist/internal-common/src/public-types/ai-chatbot.context.d.ts +0 -12
  5. package/dist/internal-common/src/public-types/ai-chatbot.types.d.ts +0 -29
  6. package/dist/internal-common/src/public-types/api-call.context.d.ts +0 -13
  7. package/dist/internal-common/src/public-types/api.types.d.ts +0 -4
  8. package/dist/internal-common/src/public-types/application.types.d.ts +0 -147
  9. package/dist/internal-common/src/public-types/backend-run.types.d.ts +0 -2
  10. package/dist/internal-common/src/public-types/base-query-builder.d.ts +0 -147
  11. package/dist/internal-common/src/public-types/bundle-api.types.d.ts +0 -47
  12. package/dist/internal-common/src/public-types/bundle-data.types.d.ts +0 -9
  13. package/dist/internal-common/src/public-types/communication.types.d.ts +0 -10
  14. package/dist/internal-common/src/public-types/context.types.d.ts +0 -40
  15. package/dist/internal-common/src/public-types/distributed-lock.context.d.ts +0 -4
  16. package/dist/internal-common/src/public-types/document.types.d.ts +0 -22
  17. package/dist/internal-common/src/public-types/graphql.context.d.ts +0 -7
  18. package/dist/internal-common/src/public-types/graphql.types.d.ts +0 -9
  19. package/dist/internal-common/src/public-types/heartbeat.types.d.ts +0 -1
  20. package/dist/internal-common/src/public-types/http-status.enum.d.ts +0 -50
  21. package/dist/internal-common/src/public-types/integration-types.d.ts +0 -57
  22. package/dist/internal-common/src/public-types/integrations/ai_chatbot.types.d.ts +0 -32
  23. package/dist/internal-common/src/public-types/integrations/api.types.d.ts +0 -81
  24. package/dist/internal-common/src/public-types/integrations/auth.types.d.ts +0 -48
  25. package/dist/internal-common/src/public-types/integrations/database.types.d.ts +0 -275
  26. package/dist/internal-common/src/public-types/integrations/observability.types.d.ts +0 -24
  27. package/dist/internal-common/src/public-types/integrations/schemas.d.ts +0 -73
  28. package/dist/internal-common/src/public-types/logger.types.d.ts +0 -21
  29. package/dist/internal-common/src/public-types/metrics.types.d.ts +0 -1
  30. package/dist/internal-common/src/public-types/mutation.context.d.ts +0 -14
  31. package/dist/internal-common/src/public-types/mutation.types.d.ts +0 -53
  32. package/dist/internal-common/src/public-types/native-query.context.d.ts +0 -7
  33. package/dist/internal-common/src/public-types/native-query.types.d.ts +0 -16
  34. package/dist/internal-common/src/public-types/openapi.types.d.ts +0 -1
  35. package/dist/internal-common/src/public-types/pagination.d.ts +0 -62
  36. package/dist/internal-common/src/public-types/query-context.d.ts +0 -137
  37. package/dist/internal-common/src/public-types/query.types.d.ts +0 -64
  38. package/dist/internal-common/src/public-types/regions.d.ts +0 -1
  39. package/dist/internal-common/src/public-types/secret.types.d.ts +0 -22
  40. package/dist/internal-common/src/public-types/serialized-query.types.d.ts +0 -24
  41. package/dist/internal-common/src/public-types/socket.types.d.ts +0 -5
  42. package/dist/internal-common/src/public-types/types.d.ts +0 -14
  43. package/dist/internal-common/src/public-utils/id-utils.d.ts +0 -4
  44. package/dist/internal-common/src/schema/schema.types.d.ts +0 -54
  45. package/dist/internal-common/src/types/backend-function.types.d.ts +0 -1
  46. package/dist/internal-common/src/utils/array.d.ts +0 -1
  47. package/dist/internal-common/src/utils/assert.d.ts +0 -1
  48. package/dist/internal-common/src/utils/global.utils.d.ts +0 -1
  49. package/dist/internal-common/src/utils/http.d.ts +0 -2
  50. package/dist/internal-common/src/utils/lock.manager.d.ts +0 -14
  51. package/dist/internal-common/src/utils/object.d.ts +0 -5
  52. package/dist/internal-common/src/utils/serialization.d.ts +0 -5
  53. package/dist/internal-common/src/utils/validation.d.ts +0 -27
  54. package/dist/internal-common/src/websocket.impl.d.ts +0 -21
  55. package/dist/node_modules/json-schema-typed/draft-2020-12.d.ts +0 -1239
  56. package/dist/typescript-client/src/ai-assistant-client.d.ts +0 -73
  57. package/dist/typescript-client/src/ai-chatbot-client.d.ts +0 -174
  58. package/dist/typescript-client/src/ai-chatbot-client.factory.d.ts +0 -8
  59. package/dist/typescript-client/src/ai.types.d.ts +0 -63
  60. package/dist/typescript-client/src/api.manager.d.ts +0 -11
  61. package/dist/typescript-client/src/auth.manager.d.ts +0 -27
  62. package/dist/typescript-client/src/backend-function.manager.d.ts +0 -9
  63. package/dist/typescript-client/src/backend-transforms.d.ts +0 -0
  64. package/dist/typescript-client/src/client-id.service.d.ts +0 -27
  65. package/dist/typescript-client/src/collection-reference.d.ts +0 -80
  66. package/dist/typescript-client/src/collection-reference.factory.d.ts +0 -13
  67. package/dist/typescript-client/src/connection-details.d.ts +0 -23
  68. package/dist/typescript-client/src/data.manager.d.ts +0 -175
  69. package/dist/typescript-client/src/destruct.manager.d.ts +0 -12
  70. package/dist/typescript-client/src/distributed-lock.manager.d.ts +0 -16
  71. package/dist/typescript-client/src/document-identity.service.d.ts +0 -12
  72. package/dist/typescript-client/src/document-reference.d.ts +0 -148
  73. package/dist/typescript-client/src/document-reference.factory.d.ts +0 -13
  74. package/dist/typescript-client/src/document-store.d.ts +0 -14
  75. package/dist/typescript-client/src/graphql-client.d.ts +0 -14
  76. package/dist/typescript-client/src/graphql-client.factory.d.ts +0 -11
  77. package/dist/typescript-client/src/index.d.ts +0 -11
  78. package/dist/typescript-client/src/mutation/mutation-sender.d.ts +0 -11
  79. package/dist/typescript-client/src/native-query-manager.d.ts +0 -7
  80. package/dist/typescript-client/src/public-types.d.ts +0 -40
  81. package/dist/typescript-client/src/public-utils.d.ts +0 -1
  82. package/dist/typescript-client/src/query/deserializer.d.ts +0 -3
  83. package/dist/typescript-client/src/query/join-query-builder.factory.d.ts +0 -161
  84. package/dist/typescript-client/src/query/local-query-manager.d.ts +0 -9
  85. package/dist/typescript-client/src/query/query-builder.factory.d.ts +0 -77
  86. package/dist/typescript-client/src/query/query-sender.d.ts +0 -33
  87. package/dist/typescript-client/src/query/query-subscription.manager.d.ts +0 -131
  88. package/dist/typescript-client/src/query/query.types.d.ts +0 -49
  89. package/dist/typescript-client/src/rate-limiter.d.ts +0 -32
  90. package/dist/typescript-client/src/rpc.manager.d.ts +0 -30
  91. package/dist/typescript-client/src/secret.client.d.ts +0 -22
  92. package/dist/typescript-client/src/socket.manager.d.ts +0 -43
  93. package/dist/typescript-client/src/squid.d.ts +0 -238
  94. package/dist/typescript-client/src/state/state.service.spec.d.ts +0 -1
  95. package/dist/typescript-client/src/testing/setup-tests.d.ts +0 -1
  96. package/dist/typescript-client/src/types.d.ts +0 -2
@@ -1,147 +0,0 @@
1
- import { Observable } from 'rxjs';
2
- import { SerializedQuery } from './serialized-query.types';
3
- import { Pagination, PaginationOptions } from './pagination';
4
- import { DocumentData, FieldName, PrimitiveFieldType } from './document.types';
5
- import { Operator } from './query.types';
6
- export interface SnapshotEmitter<ReturnType> {
7
- /**
8
- * Returns a promise that resolves to the query results.
9
- *
10
- * @returns A promise that resolves to the query results.
11
- */
12
- snapshot(): Promise<Array<ReturnType>>;
13
- /**
14
- * Returns an observable that emits the query results and updates whenever the query results change unless
15
- * `subscribe=false` is provided.
16
- *
17
- * Important: Make sure to unsubscribe from the observable when you are done with it.
18
- *
19
- * @param subscribe Whether to subscribe to changes to the query results. Defaults to `true`.
20
- * @returns An observable for the query results.
21
- */
22
- snapshots(subscribe?: boolean): Observable<Array<ReturnType>>;
23
- /**
24
- * Returns the results of the query based on the data that is currently available on the client. This method is useful
25
- * for synchronously accessing data that has already been fetched by another query. The method will return an empty
26
- * array if data has not yet been populated.
27
- *
28
- * @returns An array of query results.
29
- */
30
- peek(): Array<ReturnType>;
31
- limit(limit: number): SnapshotEmitter<ReturnType>;
32
- /**
33
- * Returns a pagination wrapper for this query.
34
- * @param options The pagination options. Defaults to `{ subscribe: true, pageSize: 100 }`.
35
- */
36
- paginate(options?: Partial<PaginationOptions>): Pagination<ReturnType>;
37
- serialize(): SerializedQuery;
38
- }
39
- /** Query builder base class. */
40
- export declare abstract class BaseQueryBuilder<MyDocType extends DocumentData> {
41
- /**
42
- * Adds a condition to the query.
43
- * @param fieldName The name of the field to query.
44
- * @param operator The operator to use.
45
- * @param value The value to compare against.
46
- * @returns The query builder.
47
- */
48
- abstract where(fieldName: (keyof MyDocType & FieldName) | string, operator: Operator | 'in' | 'not in', value: PrimitiveFieldType | Array<PrimitiveFieldType>): this;
49
- /**
50
- * A shortcut for where(fieldName, '==', value)
51
- *
52
- * @param fieldName The name of the field to query.
53
- * @param value The value to compare against.
54
- * @returns The query builder.
55
- */
56
- eq(fieldName: (keyof MyDocType & FieldName) | string, value: PrimitiveFieldType): this;
57
- /**
58
- * A shortcut for where(fieldName, '!=', value)
59
- * @param fieldName The name of the field to query.
60
- * @param value The value to compare against.
61
- * @returns The query builder.
62
- */
63
- neq(fieldName: (keyof MyDocType & FieldName) | string, value: PrimitiveFieldType): this;
64
- /**
65
- * A shortcut for where(fieldName, 'in', value)
66
- * @param fieldName The name of the field to query.
67
- * @param value An array of values to compare against.
68
- * @returns The query builder.
69
- */
70
- in(fieldName: (keyof MyDocType & FieldName) | string, value: Array<PrimitiveFieldType>): this;
71
- /**
72
- * A shortcut for where(fieldName, 'not in', value)
73
- * @param fieldName The name of the field to query.
74
- * @param value An array of values to compare against.
75
- * @returns The query builder.
76
- */
77
- nin(fieldName: (keyof MyDocType & FieldName) | string, value: Array<PrimitiveFieldType>): this;
78
- /**
79
- * A shortcut for where(fieldName, '>', value)
80
- * @param fieldName The name of the field to query.
81
- * @param value The value to compare against.
82
- * @returns The query builder.
83
- */
84
- gt(fieldName: (keyof MyDocType & FieldName) | string, value: PrimitiveFieldType): this;
85
- /**
86
- * A shortcut for where(fieldName, '>=', value)
87
- * @param fieldName The name of the field to query.
88
- * @param value The value to compare against.
89
- * @returns The query builder.
90
- */
91
- gte(fieldName: (keyof MyDocType & FieldName) | string, value: PrimitiveFieldType): this;
92
- /**
93
- * A shortcut for where(fieldName, '<', value)
94
- * @param fieldName The name of the field to query.
95
- * @param value The value to compare against.
96
- * @returns The query builder.
97
- */
98
- lt(fieldName: (keyof MyDocType & FieldName) | string, value: PrimitiveFieldType): this;
99
- /**
100
- * A shortcut for where(fieldName, '<=', value)
101
- * @param fieldName The name of the field to query.
102
- * @param value The value to compare against.
103
- * @returns The query builder.
104
- */
105
- lte(fieldName: (keyof MyDocType & FieldName) | string, value: PrimitiveFieldType): this;
106
- /**
107
- * A shortcut for where(fieldName, 'like', pattern).
108
- *
109
- * @param fieldName The name of the field to query.
110
- * @param pattern The pattern to compare against. '%' is the only allowed wildcard
111
- * @param caseSensitive Whether to use case-sensitive comparison. Defaults to true.
112
- * @returns The query builder.
113
- */
114
- like(fieldName: (keyof MyDocType & FieldName) | string, pattern: string, caseSensitive?: boolean): this;
115
- /**
116
- * A shortcut for where(fieldName, 'not like', pattern).
117
- *
118
- * @param fieldName The name of the field to query.
119
- * @param pattern The pattern to compare against. '%' is the only allowed wildcard
120
- * @param caseSensitive Whether to use case-sensitive comparison. Defaults to true.
121
- * @returns The query builder.
122
- */
123
- notLike(fieldName: (keyof MyDocType & FieldName) | string, pattern: string, caseSensitive?: boolean): this;
124
- /**
125
- * Sets a limit to the number of results returned by the query. The maximum limit is 20,000 and the default is 1,000
126
- * if none is provided.
127
- * @param limit The limit to set.
128
- * @returns The query builder.
129
- */
130
- abstract limit(limit: number): this;
131
- /**
132
- * Adds a sort order to the query. You can add multiple sort orders to the query. The order in which you add them
133
- * determines the order in which they are applied.
134
- * @param fieldName The name of the field to sort by.
135
- * @param asc Whether to sort in ascending order. Defaults to true.
136
- * @returns The query builder.
137
- */
138
- abstract sortBy(fieldName: keyof MyDocType & FieldName, asc?: boolean): this;
139
- }
140
- export interface HasDereference {
141
- /**
142
- * Dereferences the document references in the result of this query. For example, collection.query().snapshot()
143
- * returns an array of DocumentReference objects, but collection.query().dereference().snapshot() returns an array of
144
- * the actual document data.
145
- */
146
- dereference(): any;
147
- }
@@ -1,47 +0,0 @@
1
- import { MutationContext } from './mutation.context';
2
- import { ApiCallContext } from './api-call.context';
3
- import { GraphqlContext } from './graphql.context';
4
- import { DistributedLockContext } from './distributed-lock.context';
5
- import { NativeQueryContext } from './native-query.context';
6
- import { AiChatbotChatContext, AiChatbotMutationContext } from './ai-chatbot.context';
7
- import { QueryContext } from './query-context';
8
- import { AiChatbotActionType, DatabaseActionType } from './bundle-data.types';
9
- import { ClientId } from './communication.types';
10
- import { DocumentData, SquidDocId } from './document.types';
11
- import { MutationType } from './mutation.types';
12
- import { ClientConnectionState } from './socket.types';
13
- export type SecureDatabaseAction<T extends DatabaseActionType> = T extends 'all' ? () => boolean | Promise<boolean> : T extends 'read' ? ((context: QueryContext) => boolean | Promise<boolean>) | (() => boolean | Promise<boolean>) : ((context: MutationContext) => boolean | Promise<boolean>) | (() => boolean | Promise<boolean>);
14
- export type SecureApiAction = ((context: ApiCallContext) => boolean | Promise<boolean>) | (() => boolean | Promise<boolean>);
15
- export type SecureNativeQueryAction = ((context: NativeQueryContext) => boolean | Promise<boolean>) | (() => boolean | Promise<boolean>);
16
- export type SecureDistributedLockAction = ((context: DistributedLockContext) => boolean | Promise<boolean>) | (() => boolean | Promise<boolean>);
17
- export type SecureGraphQLAction = ((context: GraphqlContext) => boolean | Promise<boolean>) | (() => boolean | Promise<boolean>);
18
- export type SecureAiChatbotAction<T extends AiChatbotActionType> = T extends 'all' ? () => boolean | Promise<boolean> : T extends 'chat' ? ((context: AiChatbotChatContext) => boolean | Promise<boolean>) | (() => boolean | Promise<boolean>) : ((context: AiChatbotMutationContext) => boolean | Promise<boolean>) | (() => boolean | Promise<boolean>);
19
- export type ClientConnectionStateChangeAction = (clientId: ClientId, clientConnectionState: ClientConnectionState) => Promise<void> | void;
20
- export type ExecutableAction = (...args: any[]) => any;
21
- export type AiFunctionAction<T extends Record<string, any> = any> = (params: T) => any;
22
- export type TriggerAction = ((request: TriggerRequest) => void | Promise<void>) | (() => void | Promise<void>);
23
- /** The context provided to a trigger function. */
24
- export interface TriggerRequest<T extends DocumentData = any> {
25
- squidDocId: SquidDocId;
26
- mutationType: MutationType;
27
- docBefore?: T;
28
- docAfter?: T;
29
- }
30
- export type SchedulerAction = () => void | Promise<void>;
31
- export type WebhookAction = ((request: WebhookRequest) => any) | (() => any);
32
- /** The context provided to a webhook function. */
33
- export interface WebhookRequest<T = any> {
34
- body: T;
35
- rawBody?: string;
36
- queryParams: Record<string, string>;
37
- headers: Record<string, string>;
38
- httpMethod: 'post' | 'get' | 'put' | 'delete';
39
- files?: Array<SquidFile>;
40
- }
41
- export interface WebhookResponse {
42
- headers: Record<string, any>;
43
- body: any;
44
- statusCode: number;
45
- __isWebhookResponse__: true;
46
- }
47
- export type ActionMethodDecorator<U> = <T extends U>(target: Object, propertyName: string, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<T>;
@@ -1,9 +0,0 @@
1
- /** The different types of actions that can be performed on a database. */
2
- export type DatabaseActionType = 'read' | 'write' | 'update' | 'insert' | 'delete' | 'all';
3
- /** The different types of actions that can be performed on an AI chatbot. */
4
- export type AiChatbotActionType = 'chat' | 'mutate' | 'all';
5
- export interface LocalBackendData {
6
- applicationBundleData: ApplicationBundleData;
7
- openApiSpecStr?: string;
8
- }
9
- export type AiFunctionParamType = 'string' | 'number' | 'boolean' | 'date';
@@ -1,10 +0,0 @@
1
- /** A type alias for an application id. */
2
- export type AppId = string;
3
- export declare const ENVIRONMENT_IDS: readonly ["dev", "prod"];
4
- export type EnvironmentId = (typeof ENVIRONMENT_IDS)[number];
5
- /** @deprecated. Use ENVIRONMENT_IDS. */
6
- export declare const allEnvironmentIds: Array<EnvironmentId>;
7
- /** A type alias for an integration id. */
8
- export type IntegrationId = string;
9
- export type ChatId = string;
10
- export type SquidDeveloperId = string;
@@ -1,40 +0,0 @@
1
- import { AppId, ClientId } from './communication.types';
2
- export type AuthType = 'Bearer' | 'ApiKey';
3
- /**
4
- * The payload of a JWT token in case an auth token was used.
5
- */
6
- export interface AuthWithBearer {
7
- type: 'Bearer';
8
- userId: string;
9
- expiration: number;
10
- attributes: Record<string, any>;
11
- }
12
- /**
13
- * The authentication object for the current request in case an API key is used.
14
- */
15
- export interface AuthWithApiKey {
16
- type: 'ApiKey';
17
- apiKey: string;
18
- }
19
- /** The authentication object for the current request. */
20
- export type Auth = AuthWithBearer | AuthWithApiKey;
21
- export interface AuthToken {
22
- type: AuthType;
23
- token: string;
24
- integrationId?: string;
25
- }
26
- /** The context of a request to a service. */
27
- export interface RunContext {
28
- /** Your applicationId. */
29
- appId: AppId;
30
- /**
31
- * The id of the client that initiated this request. This is only relevant in cases that the request was initiated by
32
- * a client such as when securing an api call or a DB operation. This id will not be available for triggers,
33
- * schedulers, webhooks and other functions that are not directly initiated by a user action.
34
- */
35
- clientId?: ClientId;
36
- /** The IP address of the client that initiated this request. */
37
- sourceIp?: string;
38
- /** The headers of the request. */
39
- headers?: Record<string, any>;
40
- }
@@ -1,4 +0,0 @@
1
- /** The context provided to a secure distributed lock function. */
2
- export declare class DistributedLockContext {
3
- readonly mutex: string;
4
- }
@@ -1,22 +0,0 @@
1
- import { IntegrationId } from './communication.types';
2
- /** A type alias for a field name. */
3
- export type FieldName<T = any> = string & keyof T;
4
- /** A type alias for a document id as string. */
5
- export type DocId = string;
6
- /** A type alias for a document id object when the ID is a composite of primary keys. */
7
- export type DocIdObj = Record<FieldName, any>;
8
- /** A type alias for a collection name. */
9
- export type CollectionName = string;
10
- /** The full document id, including the collection name and the integration id. */
11
- export interface SquidDocIdObj {
12
- collectionName: CollectionName;
13
- docId: DocId;
14
- integrationId: IntegrationId;
15
- }
16
- /** The before and after documents of a document change. */
17
- export interface BeforeAndAfterDocs<T = SquidDocument> {
18
- before: T | undefined;
19
- after: T | undefined;
20
- }
21
- /** A generic document data type. */
22
- export type DocumentData = Record<FieldName, any | undefined>;
@@ -1,7 +0,0 @@
1
- /** The context provided to a secure GraphQL function. */
2
- export declare class GraphqlContext {
3
- readonly isGraphiQL: boolean;
4
- readonly query: string | undefined;
5
- readonly variables: string | Record<string, any> | undefined;
6
- readonly operationName: string | undefined;
7
- }
@@ -1,9 +0,0 @@
1
- export { type ExecutionResult, type IntrospectionQuery } from 'graphql';
2
- export interface GraphQLRequest {
3
- operationName?: string;
4
- query?: string;
5
- variables?: string | Record<string, any>;
6
- }
7
- export interface SecureGraphQLRequest extends GraphQLRequest {
8
- isGraphiQL: boolean;
9
- }
@@ -1 +0,0 @@
1
- export declare function checkAllHeartbeatProviders(heartbeatProviders: Record<string, HeartbeatProvider>): Promise<void>;
@@ -1,50 +0,0 @@
1
- export declare enum HttpStatus {
2
- CONTINUE = 100,
3
- SWITCHING_PROTOCOLS = 101,
4
- PROCESSING = 102,
5
- EARLYHINTS = 103,
6
- OK = 200,
7
- CREATED = 201,
8
- ACCEPTED = 202,
9
- NON_AUTHORITATIVE_INFORMATION = 203,
10
- NO_CONTENT = 204,
11
- RESET_CONTENT = 205,
12
- PARTIAL_CONTENT = 206,
13
- AMBIGUOUS = 300,
14
- MOVED_PERMANENTLY = 301,
15
- FOUND = 302,
16
- SEE_OTHER = 303,
17
- NOT_MODIFIED = 304,
18
- TEMPORARY_REDIRECT = 307,
19
- PERMANENT_REDIRECT = 308,
20
- BAD_REQUEST = 400,
21
- UNAUTHORIZED = 401,
22
- PAYMENT_REQUIRED = 402,
23
- FORBIDDEN = 403,
24
- NOT_FOUND = 404,
25
- METHOD_NOT_ALLOWED = 405,
26
- NOT_ACCEPTABLE = 406,
27
- PROXY_AUTHENTICATION_REQUIRED = 407,
28
- REQUEST_TIMEOUT = 408,
29
- CONFLICT = 409,
30
- GONE = 410,
31
- LENGTH_REQUIRED = 411,
32
- PRECONDITION_FAILED = 412,
33
- PAYLOAD_TOO_LARGE = 413,
34
- URI_TOO_LONG = 414,
35
- UNSUPPORTED_MEDIA_TYPE = 415,
36
- REQUESTED_RANGE_NOT_SATISFIABLE = 416,
37
- EXPECTATION_FAILED = 417,
38
- I_AM_A_TEAPOT = 418,
39
- MISDIRECTED = 421,
40
- UNPROCESSABLE_ENTITY = 422,
41
- FAILED_DEPENDENCY = 424,
42
- PRECONDITION_REQUIRED = 428,
43
- TOO_MANY_REQUESTS = 429,
44
- INTERNAL_SERVER_ERROR = 500,
45
- NOT_IMPLEMENTED = 501,
46
- BAD_GATEWAY = 502,
47
- SERVICE_UNAVAILABLE = 503,
48
- GATEWAY_TIMEOUT = 504,
49
- HTTP_VERSION_NOT_SUPPORTED = 505
50
- }
@@ -1,57 +0,0 @@
1
- export declare enum IntegrationCategory {
2
- 'database' = "database",
3
- 'api' = "api",
4
- 'observability' = "observability",
5
- 'crm' = "crm",
6
- 'auth' = "auth",
7
- 'ai' = "ai"
8
- }
9
- export declare enum IntegrationType {
10
- 'built_in_db' = "built_in_db",
11
- 'mongo' = "mongo",
12
- 'mysql' = "mysql",
13
- 'mssql' = "mssql",
14
- 'postgres' = "postgres",
15
- 'cockroach' = "cockroach",
16
- 'api' = "api",
17
- 'graphql' = "graphql",
18
- 'snowflake' = "snowflake",
19
- 'datadog' = "datadog",
20
- 'newrelic' = "newrelic",
21
- 'auth0' = "auth0",
22
- 'jwt_rsa' = "jwt_rsa",
23
- 'jwt_hmac' = "jwt_hmac",
24
- 'ai_chatbot' = "ai_chatbot",
25
- 'cognito' = "cognito",
26
- 'okta' = "okta",
27
- 'algolia' = "algolia",
28
- 'elastic_observability' = "elastic_observability",
29
- 'elastic_search' = "elastic_search",
30
- 'elastic_enterprise_search' = "elastic_enterprise_search",
31
- 'sentry' = "sentry",
32
- 'sap_hana' = "sap_hana",
33
- 'salesforce_crm' = "salesforce_crm",
34
- 'documentdb' = "documentdb",
35
- 'dynamodb' = "dynamodb",
36
- 'cassandra' = "cassandra",
37
- 'clickhouse' = "clickhouse",
38
- 'alloydb' = "alloydb",
39
- 'spanner' = "spanner",
40
- 'db2' = "db2",
41
- 'mariadb' = "mariadb",
42
- 'oracledb' = "oracledb",
43
- 'pinot' = "pinot",
44
- 'redis' = "redis",
45
- 'xata' = "xata",
46
- 'azure_sql' = "azure_sql",
47
- 'azure_postgresql' = "azure_postgresql",
48
- 'azure_cosmosdb' = "azure_cosmosdb",
49
- 'firestore' = "firestore",
50
- 'bigquery' = "bigquery",
51
- 'cloudsql' = "cloudsql"
52
- }
53
- export declare enum IntegrationSchemaType {
54
- 'data' = "data",
55
- 'api' = "api",
56
- 'graphql' = "graphql"
57
- }
@@ -1,32 +0,0 @@
1
- import { BaseIntegrationConfig } from './schemas';
2
- import { AiModelName } from '../ai-chatbot.types';
3
- import { IntegrationId } from '../communication.types';
4
- import { IntegrationType } from '../integration-types';
5
- export interface AiChatbotIntegrationConfig extends BaseIntegrationConfig {
6
- type: IntegrationType.ai_chatbot;
7
- configuration: AiChatbotConfiguration;
8
- }
9
- export type AiChatbotConfiguration = {
10
- apiKey?: string;
11
- };
12
- export type AiChatbotProfileMetadata = {
13
- modelName: AiModelName;
14
- isPublic: boolean;
15
- strictContext: boolean;
16
- instructions: Record<string, string>;
17
- };
18
- export type AiChatbotContextMetadata = {
19
- title: string;
20
- text: string;
21
- preview: boolean;
22
- sizeBytes?: number;
23
- };
24
- export interface AiChatbotProfile extends AiChatbotProfileMetadata {
25
- contexts: Record<string, AiChatbotContextMetadata>;
26
- }
27
- export interface AiChatbotProfiles {
28
- profiles: Record<string, AiChatbotProfile>;
29
- }
30
- export interface GetAiChatbotProfilesRequest {
31
- integrationId: IntegrationId;
32
- }
@@ -1,81 +0,0 @@
1
- import { FieldName } from '../document.types';
2
- import { IntrospectionQuery } from '../graphql.types';
3
- import { BaseIntegrationConfig, BaseIntegrationSchema } from './schemas';
4
- import { IntegrationSchemaType, IntegrationType } from '../integration-types';
5
- export type HttpMethod = 'post' | 'get' | 'delete' | 'patch' | 'put';
6
- export type ApiEndpointId = string;
7
- export type ApiParameterLocation = 'query' | 'body' | 'header' | 'path';
8
- export type ApiResponseParameterLocation = 'header' | 'body';
9
- export type ApiInjectionParameterLocation = 'header' | 'query';
10
- export type FieldPath = string;
11
- export type IntegrationApiEndpoints = Record<ApiEndpointId, ApiEndpoint>;
12
- export interface IntegrationGraphQLSchema extends BaseIntegrationSchema {
13
- type: IntegrationSchemaType.graphql;
14
- introspection: IntrospectionQuery;
15
- }
16
- export interface IntegrationApiSchema extends BaseIntegrationSchema {
17
- type: IntegrationSchemaType.api;
18
- baseUrl: string;
19
- endpoints: IntegrationApiEndpoints;
20
- injectionSchema?: ApiInjectionSchema;
21
- }
22
- export interface ApiRequestField {
23
- location: ApiParameterLocation;
24
- }
25
- export interface ApiResponseField {
26
- location: ApiResponseParameterLocation;
27
- path?: FieldPath;
28
- }
29
- export type ApiInjectionFieldType = 'secret' | 'regular';
30
- export interface ApiInjectionField {
31
- value: string;
32
- type: ApiInjectionFieldType;
33
- location: ApiInjectionParameterLocation;
34
- }
35
- export interface GraphQLConnectionOptions {
36
- baseUrl: string;
37
- injectionSchema?: ApiInjectionSchema;
38
- }
39
- export type ApiInjectionSchema = Record<FieldName, ApiInjectionField>;
40
- export interface OpenApiDiscoveryOptions {
41
- openApiSpecUrl: string;
42
- }
43
- export interface ApiEndpoint {
44
- relativePath: string;
45
- method: HttpMethod;
46
- requestSchema?: Record<FieldName, ApiRequestField>;
47
- responseSchema?: Record<FieldPath, ApiResponseField>;
48
- injectionSchema?: ApiInjectionSchema;
49
- }
50
- export interface HttpApiIntegrationConfig extends BaseIntegrationConfig {
51
- type: IntegrationType.api;
52
- configuration?: {
53
- discoveryOptions: OpenApiDiscoveryOptions;
54
- };
55
- }
56
- export interface GraphQLIntegrationConfig extends BaseIntegrationConfig {
57
- type: IntegrationType.graphql;
58
- configuration: {
59
- connectionOptions: GraphQLConnectionOptions;
60
- };
61
- }
62
- export interface DiscoverGraphQLConnectionSchemaRequest {
63
- integrationType: IntegrationType.graphql;
64
- connectionOptions: GraphQLConnectionOptions;
65
- }
66
- export interface DiscoverOpenApiSchemaRequest {
67
- integrationType: IntegrationType.api;
68
- discoveryOptions: OpenApiDiscoveryOptions;
69
- }
70
- export interface TestGraphQLDataConnectionRequest {
71
- type: IntegrationType.graphql;
72
- configuration: {
73
- connectionOptions: GraphQLConnectionOptions;
74
- };
75
- }
76
- export interface DiscoverGraphQLConnectionSchemaResponse {
77
- schema: IntegrationGraphQLSchema;
78
- }
79
- export interface DiscoverOpenApiSchemaResponse {
80
- schema: IntegrationApiSchema;
81
- }
@@ -1,48 +0,0 @@
1
- import { BaseIntegrationConfig } from './schemas';
2
- import { IntegrationType } from '../integration-types';
3
- export interface Auth0IntegrationConfig extends BaseIntegrationConfig {
4
- type: IntegrationType.auth0;
5
- configuration: {
6
- /** Auth0 domain. Used to build JWKS URL (https://$domain/.well-known/jwks.json) to check the JWT token signature.*/
7
- domain: string;
8
- /**
9
- * The Auth0 audience is a parameter that ensures the JWT token is intended for the specific backend being accessed.
10
- *
11
- * Note: the audience for the web-app auth token is equal to the Auth0 web client id: it means that the web app
12
- * client is a target audience for the JWT token. Such JWT tokens (ID tokens) should not be sent to the backend:
13
- * backend calls should use another kind of JWT tokens (access tokens) issued by Auth0 for the backends.
14
- */
15
- clientId: string;
16
- };
17
- }
18
- export interface CognitoIntegrationConfig extends BaseIntegrationConfig {
19
- type: IntegrationType.cognito;
20
- configuration: {
21
- region: string;
22
- userPoolId: string;
23
- appClientId: string;
24
- };
25
- }
26
- export interface OktaIntegrationConfig extends BaseIntegrationConfig {
27
- type: IntegrationType.okta;
28
- configuration: {
29
- domain: string;
30
- clientId: string;
31
- };
32
- }
33
- export interface JwtRsaIntegrationConfig extends BaseIntegrationConfig {
34
- type: IntegrationType.jwt_rsa;
35
- configuration: {
36
- jwksUri: string;
37
- validations?: {
38
- aud?: string;
39
- iss?: string;
40
- };
41
- };
42
- }
43
- export interface JwtHmacIntegrationConfig extends BaseIntegrationConfig {
44
- type: IntegrationType.jwt_hmac;
45
- configuration: {
46
- verifyUri?: string;
47
- };
48
- }