@squidcloud/client 1.0.317 → 1.0.319

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 (38) hide show
  1. package/dist/cjs/index.js +1 -1
  2. package/dist/internal-common/src/metric-name.d.ts +9 -0
  3. package/dist/internal-common/src/public-types/ai-agent.public-types.d.ts +12 -8
  4. package/dist/internal-common/src/public-types/bundle-data.public-types.d.ts +2 -2
  5. package/dist/internal-common/src/public-types-backend/api-call.public-context.d.ts +21 -0
  6. package/dist/internal-common/src/public-types-backend/native-query.public-context.d.ts +18 -0
  7. package/dist/internal-common/src/public-types-backend/query.public-context.d.ts +127 -0
  8. package/dist/internal-common/src/types/ai-agent.types.d.ts +29 -0
  9. package/dist/internal-common/src/types/ai-assistant.types.d.ts +1 -0
  10. package/dist/internal-common/src/types/ai-matchmaking.types.d.ts +40 -0
  11. package/dist/internal-common/src/types/backend-function.types.d.ts +1 -0
  12. package/dist/internal-common/src/types/communication.types.d.ts +1 -0
  13. package/dist/internal-common/src/types/document.types.d.ts +1 -0
  14. package/dist/internal-common/src/types/mutation.types.d.ts +1 -0
  15. package/dist/internal-common/src/types/observability.types.d.ts +71 -0
  16. package/dist/internal-common/src/types/query.types.d.ts +10 -0
  17. package/dist/internal-common/src/types/secret.types.d.ts +2 -0
  18. package/dist/internal-common/src/types/socket.types.d.ts +1 -0
  19. package/dist/internal-common/src/types/time-units.d.ts +1 -0
  20. package/dist/internal-common/src/utils/array.d.ts +1 -0
  21. package/dist/internal-common/src/utils/assert.d.ts +1 -0
  22. package/dist/internal-common/src/utils/e2e-test-utils.d.ts +2 -0
  23. package/dist/internal-common/src/utils/global.utils.d.ts +1 -0
  24. package/dist/internal-common/src/utils/http.d.ts +1 -0
  25. package/dist/internal-common/src/utils/lock.manager.d.ts +14 -0
  26. package/dist/internal-common/src/utils/metric-utils.d.ts +4 -0
  27. package/dist/internal-common/src/utils/metrics.types.d.ts +7 -0
  28. package/dist/internal-common/src/utils/object.d.ts +49 -0
  29. package/dist/internal-common/src/utils/serialization.d.ts +5 -0
  30. package/dist/internal-common/src/utils/squid.constants.d.ts +1 -0
  31. package/dist/internal-common/src/utils/validation.d.ts +20 -0
  32. package/dist/internal-common/src/websocket.impl.d.ts +26 -0
  33. package/dist/typescript-client/src/ai-agent-client.d.ts +5 -13
  34. package/dist/typescript-client/src/ai-matchmaking-client.d.ts +5 -0
  35. package/dist/typescript-client/src/query/join-query-builder.factory.d.ts +5 -2
  36. package/dist/typescript-client/src/query/query-builder.factory.d.ts +7 -1
  37. package/dist/typescript-client/src/version.d.ts +1 -1
  38. package/package.json +1 -1
@@ -24,6 +24,11 @@ export declare class MatchMaker {
24
24
  private readonly rpcManager;
25
25
  /** Adds a new entity to the matchmaker - replaces existing entity with the same ID if exists. */
26
26
  insertEntity(entity: MmEntity): Promise<void>;
27
+ /**
28
+ * Adds a new entities to the matchmaker - replaces existing entities with the same ID if exists.
29
+ * This method is more efficient than calling insertEntity multiple times.
30
+ */
31
+ insertManyEntities(entities: Array<MmEntity>): Promise<void>;
27
32
  delete(): Promise<void>;
28
33
  deleteEntity(entityId: string): Promise<void>;
29
34
  /** Finds matches for the given entity id. */
@@ -1,7 +1,7 @@
1
1
  import { Observable } from 'rxjs';
2
2
  import { DocumentReference } from '../document-reference';
3
3
  import { BaseQueryBuilder, HasDereference, QueryBuilder } from './query-builder.factory';
4
- import { Alias, DocumentData, FieldName, FieldSort, Operator, PrimitiveFieldType, SerializedJoinQuery, SimpleCondition } from '../public-types';
4
+ import { Alias, DocumentData, FieldName, FieldSort, Operator, PrimitiveFieldType, Query, SerializedJoinQuery, SimpleCondition } from '../public-types';
5
5
  import { Pagination, PaginationOptions } from './pagination';
6
6
  import { SnapshotEmitter } from './snapshot-emitter';
7
7
  type WithDocumentReferences<T extends Record<any, DocumentData>> = {
@@ -40,7 +40,8 @@ interface HasGrouped {
40
40
  /**
41
41
  * A query builder that can participate in a join.
42
42
  * To learn more about join queries, see the
43
- * {@link https://docs.getsquid.ai/docs/database/queries#joining-data-across-collections-and-integrations documentation}.
43
+ * {@link https://docs.getsquid.ai/docs/database/queries#joining-data-across-collections-and-integrations
44
+ * documentation}.
44
45
  */
45
46
  export declare class JoinQueryBuilder<Aliases extends Record<Alias, Alias[]>, ReturnType extends Record<Alias, DocumentData>, LatestAlias extends Alias, RootAlias extends Alias> extends BaseQueryBuilder<ReturnType> implements SnapshotEmitter<WithDocumentReferences<ReturnType>>, HasGrouped, HasDereference {
46
47
  private readonly collectionName;
@@ -112,6 +113,8 @@ export declare class JoinQueryBuilder<Aliases extends Record<Alias, Alias[]>, Re
112
113
  grouped(): GroupedJoin<Aliases, ReturnType, RootAlias, LatestAlias>;
113
114
  /** @inheritDoc */
114
115
  dereference(): DereferencedJoin<Aliases, ReturnType, RootAlias, LatestAlias>;
116
+ /** @inheritDoc */
117
+ build(): Query;
115
118
  getSortOrders(): Array<FieldSort<any>>;
116
119
  clone(): JoinQueryBuilder<Aliases, ReturnType, LatestAlias, RootAlias>;
117
120
  addCompositeCondition(conditions: Array<SimpleCondition>): JoinQueryBuilder<Aliases, ReturnType, LatestAlias, RootAlias>;
@@ -1,6 +1,6 @@
1
1
  import { Observable } from 'rxjs';
2
2
  import { DocumentReference } from '../document-reference';
3
- import { DocumentData, FieldName, FieldSort, Operator, PrimitiveFieldType, SerializedSimpleQuery, SimpleCondition } from '../public-types';
3
+ import { DocumentData, FieldName, FieldSort, Operator, PrimitiveFieldType, Query, SerializedSimpleQuery, SimpleCondition } from '../public-types';
4
4
  import { Pagination, PaginationOptions } from './pagination';
5
5
  import { SnapshotEmitter } from './snapshot-emitter';
6
6
  /**
@@ -145,6 +145,10 @@ export declare abstract class BaseQueryBuilder<MyDocType extends DocumentData> {
145
145
  * @returns The query builder.
146
146
  */
147
147
  abstract sortBy(fieldName: (keyof MyDocType & FieldName) | string, asc?: boolean): this;
148
+ /**
149
+ * Returns the query object built by this query builder.
150
+ */
151
+ abstract build(): Query;
148
152
  }
149
153
  /** A query builder that can be used to build a query that returns a list of documents. */
150
154
  export declare class QueryBuilder<DocumentType extends DocumentData> extends BaseQueryBuilder<DocumentType> implements SnapshotEmitter<DocumentReference<DocumentType>>, HasDereference {
@@ -164,6 +168,8 @@ export declare class QueryBuilder<DocumentType extends DocumentData> extends Bas
164
168
  limitBy(limit: number, ...fields: FieldName[]): this;
165
169
  /** @inheritDoc */
166
170
  sortBy(fieldName: (keyof DocumentType & FieldName) | string, asc?: boolean): this;
171
+ /** @inheritDoc */
172
+ build(): Query;
167
173
  private mergeConditions;
168
174
  getSortOrder(): FieldSort<DocumentType>[];
169
175
  /**
@@ -1 +1 @@
1
- export declare const SQUIDCLOUD_CLIENT_PACKAGE_VERSION = "1.0.317";
1
+ export declare const SQUIDCLOUD_CLIENT_PACKAGE_VERSION = "1.0.319";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@squidcloud/client",
3
- "version": "1.0.317",
3
+ "version": "1.0.319",
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",