@squidcloud/client 1.0.253 → 1.0.255

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,10 +1,10 @@
1
1
  import { FunctionName } from './bundle-data.public-types';
2
2
  /** The supported OpenAI models */
3
- export declare const OPENAI_CHAT_MODEL_NAMES: readonly ["gpt-3.5-turbo", "gpt-3.5-turbo-1106", "gpt-4", "gpt-4-turbo-preview", "gpt-4o", "gpt-4-turbo"];
3
+ export declare const OPENAI_CHAT_MODEL_NAMES: readonly ["gpt-3.5-turbo", "gpt-3.5-turbo-1106", "gpt-4", "gpt-4-turbo-preview", "gpt-4o", "gpt-4o-mini", "gpt-4-turbo"];
4
4
  export declare const GEMINI_CHAT_MODEL_NAMES: readonly ["gemini-pro"];
5
5
  export declare const ANTHROPIC_CHAT_MODEL_NAMES: readonly ["claude-3-opus-20240229", "claude-3-sonnet-20240229", "claude-3-haiku-20240307", "claude-3-5-sonnet-20240620"];
6
6
  /** The supported AI model names. */
7
- export declare const AI_CHAT_MODEL_NAMES: readonly ["gpt-3.5-turbo", "gpt-3.5-turbo-1106", "gpt-4", "gpt-4-turbo-preview", "gpt-4o", "gpt-4-turbo", "claude-3-opus-20240229", "claude-3-sonnet-20240229", "claude-3-haiku-20240307", "claude-3-5-sonnet-20240620", "gemini-pro"];
7
+ export declare const AI_CHAT_MODEL_NAMES: readonly ["gpt-3.5-turbo", "gpt-3.5-turbo-1106", "gpt-4", "gpt-4-turbo-preview", "gpt-4o", "gpt-4o-mini", "gpt-4-turbo", "claude-3-opus-20240229", "claude-3-sonnet-20240229", "claude-3-haiku-20240307", "claude-3-5-sonnet-20240620", "gemini-pro"];
8
8
  export declare const OPENAI_EMBEDDINGS_MODEL_NAMES: readonly ["text-embedding-3-small", "text-embedding-3-large", "text-embedding-ada-002"];
9
9
  export declare const AI_EMBEDDINGS_MODEL_NAMES: readonly ["text-embedding-3-small", "text-embedding-3-large", "text-embedding-ada-002"];
10
10
  /** The supported AI image generation model names. */
@@ -6,7 +6,8 @@ interface BaseMutation {
6
6
  /** A mutation on a document. */
7
7
  export type Mutation<T = any> = UpdateMutation<T> | InsertMutation<T> | DeleteMutation;
8
8
  /** The mutation type. */
9
- export type MutationType = 'insert' | 'update' | 'delete';
9
+ export declare const MUTATION_TYPES: readonly ["insert", "update", "delete"];
10
+ export type MutationType = (typeof MUTATION_TYPES)[number];
10
11
  export interface DeleteMutation extends BaseMutation {
11
12
  type: 'delete';
12
13
  }
@@ -17,8 +17,6 @@ export * from './document-identity.service';
17
17
  export * from './document-reference.factory';
18
18
  export * from './document-reference';
19
19
  export * from './document-store';
20
- export * from './graphql-client.factory';
21
- export * from './graphql-client';
22
20
  export * from './mutation/mutation-sender';
23
21
  export * from './native-query-manager';
24
22
  export * from './public-types';
@@ -6,7 +6,6 @@ export * from '../../internal-common/src/public-types/bundle-data.public-types';
6
6
  export * from '../../internal-common/src/public-types/communication.public-types';
7
7
  export * from '../../internal-common/src/public-types/context.public-types';
8
8
  export * from '../../internal-common/src/public-types/document.public-types';
9
- export * from '../../internal-common/src/public-types/graphql.public-types';
10
9
  export * from '../../internal-common/src/public-types/http-status.enum';
11
10
  export * from '../../internal-common/src/public-types/integration.public-types';
12
11
  export * from '../../internal-common/src/public-types/integrations/ai_chatbot.public-types';
@@ -3,7 +3,6 @@ import { ApiClient } from './api-client';
3
3
  import { CollectionReference } from './collection-reference';
4
4
  import { ConnectionDetails } from './connection-details';
5
5
  import { DistributedLock } from './distributed-lock.manager';
6
- import { GraphQLClient } from './graphql-client';
7
6
  import { ApiKey, AppId, CollectionName, DocumentData, EnvironmentId, IntegrationId, SquidDeveloperId, SquidRegion } from './public-types';
8
7
  import { QueueManager } from './queue.manager';
9
8
  import { SecretClient } from './secret.client';
@@ -88,7 +87,6 @@ export declare class Squid {
88
87
  private readonly collectionReferenceFactory;
89
88
  private readonly backendFunctionManager;
90
89
  private readonly nativeQueryManager;
91
- private readonly graphqlClientFactory;
92
90
  private readonly destructManager;
93
91
  private readonly documentIdentityService;
94
92
  private readonly distributedLockManager;
@@ -195,16 +193,6 @@ export declare class Squid {
195
193
  * @type {Promise<Array<SquidDocument>>}
196
194
  */
197
195
  executeNativeMongoQuery<T = any>(integrationId: IntegrationId, collectionName: string, aggregationPipeline: Array<any | undefined>): Promise<Array<T>>;
198
- /**
199
- * Returns a GraphQL client for the given integration. The GraphQL client can be used to execute GraphQL queries and
200
- * mutations. For more information about GraphQL in Squid, please refer to the
201
- * {@link https://docs.squid.cloud/docs/integrations/api/graphql documentation}.
202
- *
203
- * @param integrationId The id of the integration that the GraphQL API is defined with.
204
- * @returns A GraphQL client for the given integration.
205
- * @deprecated Use @squidcloud/graphql. See https://docs.squid.cloud/docs/integrations/api/graphql.
206
- */
207
- graphql(integrationId: IntegrationId): GraphQLClient;
208
196
  /**
209
197
  * Returns a set of AI specific clients.
210
198
  *
@@ -0,0 +1 @@
1
+ export declare const SQUIDCLOUD_CLIENT_PACKAGE_VERSION = "1.0.255";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@squidcloud/client",
3
- "version": "1.0.253",
3
+ "version": "1.0.255",
4
4
  "description": "A typescript implementation of the Squid client",
5
5
  "main": "dist/cjs/index.js",
6
6
  "types": "dist/typescript-client/src/index.d.ts",
@@ -8,8 +8,8 @@
8
8
  "dist/**/*"
9
9
  ],
10
10
  "scripts": {
11
- "prebuild": "del-cli dist",
12
- "build": "webpack --mode=production && npm run keep-only-public-types",
11
+ "prebuild": "del-cli dist && node inject-version.js",
12
+ "build": "webpack --mode=production && npm run keep-only-public-types && npm run check-bundle-size",
13
13
  "build:dev": "webpack --mode=development",
14
14
  "build:prod": "webpack --mode=production",
15
15
  "watch": "webpack --watch",
@@ -17,6 +17,7 @@
17
17
  "build-and-check-public-types": "npm run build && npm run check-public-types",
18
18
  "keep-only-public-types": "del-cli 'dist/internal-common/src/**' '!dist/internal-common/src/public-types' '!dist/internal-common/src/public-utils'",
19
19
  "check-public-types": "tsc -p tsconfig.types.json",
20
+ "check-bundle-size": "node check-bundle-size.js",
20
21
  "test": "jest --detectOpenHandles",
21
22
  "test:watch": "jest --watch",
22
23
  "test:cov": "jest --coverage",
@@ -36,29 +37,19 @@
36
37
  "author": "",
37
38
  "license": "ISC",
38
39
  "dependencies": {
39
- "@apollo/client": "^3.7.4",
40
- "@supercharge/promise-pool": "^2.3.2",
41
- "ajv": "^8.11.2",
42
- "ajv-formats": "^2.1.1",
43
- "bufferutil": "^4.0.7",
44
- "date-fns": "^2.30.0",
45
- "deep-diff": "^1.0.2",
46
- "graphql": "^16.6.0",
47
40
  "json-schema-typed": "^8.0.1",
48
- "otrie": "1.1.2",
49
- "utf-8-validate": "^6.0.3",
50
- "ws": "^8.13.0"
41
+ "ws": "^8.18.0"
51
42
  },
52
43
  "peerDependencies": {
53
44
  "rxjs": ">=7.5.7 <8.0.0"
54
45
  },
55
46
  "devDependencies": {
56
- "@types/deep-diff": "^1.0.2",
57
- "@types/uuid": "^9.0.0",
47
+ "@supercharge/promise-pool": "^2.3.2",
58
48
  "@webpack-cli/generators": "^3.0.0",
59
49
  "copy-webpack-plugin": "^12.0.2",
60
50
  "cpx": "^1.5.0",
61
51
  "generate-package-json-webpack-plugin": "^2.6.0",
52
+ "otrie": "^1.1.3",
62
53
  "tsconfig-paths-webpack-plugin": "^4.1.0",
63
54
  "tscpaths": "^0.0.9",
64
55
  "webpack": "^5.92.1",
@@ -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,12 +0,0 @@
1
- import { GraphQLRequest } from './public-types';
2
- /** A GraphQL client that can be used to query and mutate data. */
3
- export declare class GraphQLClient {
4
- private readonly rpcManager;
5
- private readonly region;
6
- private readonly appId;
7
- private readonly client;
8
- /** Executes a GraphQL query and returns a promise with the result. */
9
- query<T = any>(request: GraphQLRequest): Promise<T>;
10
- /** Executes a GraphQL mutation and returns a promise with the result. */
11
- mutate<T = Record<string, any>>(request: GraphQLRequest): Promise<T | null | undefined>;
12
- }