@squidcloud/client 1.0.77 → 1.0.79

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 (102) hide show
  1. package/dist/cjs/index.js +1 -1
  2. package/dist/common/src/ai-assistant.context.d.ts +12 -12
  3. package/dist/common/src/ai-assistant.schemas.d.ts +1 -1
  4. package/dist/common/src/ai-assistant.types.d.ts +2 -2
  5. package/dist/common/src/api-call.context.d.ts +13 -13
  6. package/dist/common/src/api.types.d.ts +4 -4
  7. package/dist/common/src/application.schemas.d.ts +1 -1
  8. package/dist/common/src/application.types.d.ts +184 -184
  9. package/dist/common/src/backend-function.schemas.d.ts +1 -1
  10. package/dist/common/src/backend-function.types.d.ts +1 -1
  11. package/dist/common/src/backend-run.types.d.ts +2 -2
  12. package/dist/common/src/bundle-api.types.d.ts +36 -36
  13. package/dist/common/src/bundle-data.types.d.ts +4 -4
  14. package/dist/common/src/communication.types.d.ts +12 -12
  15. package/dist/common/src/context.types.d.ts +40 -40
  16. package/dist/common/src/distributed-lock.context.d.ts +5 -5
  17. package/dist/common/src/document.types.d.ts +22 -22
  18. package/dist/common/src/graphql.context.d.ts +7 -7
  19. package/dist/common/src/graphql.types.d.ts +9 -9
  20. package/dist/common/src/heartbeat.types.d.ts +1 -1
  21. package/dist/common/src/http-status.enum.d.ts +50 -50
  22. package/dist/common/src/index.d.ts +54 -54
  23. package/dist/common/src/integrations/ai_assistant.types.d.ts +30 -30
  24. package/dist/common/src/integrations/api.types.d.ts +80 -80
  25. package/dist/common/src/integrations/auth.types.d.ts +39 -39
  26. package/dist/common/src/integrations/database.types.d.ts +236 -236
  27. package/dist/common/src/integrations/index.d.ts +101 -101
  28. package/dist/common/src/integrations/observability.types.d.ts +23 -23
  29. package/dist/common/src/logger.types.d.ts +21 -21
  30. package/dist/common/src/metrics.types.d.ts +1 -1
  31. package/dist/common/src/mutation.context.d.ts +14 -14
  32. package/dist/common/src/mutation.schemas.d.ts +1 -1
  33. package/dist/common/src/mutation.types.d.ts +53 -53
  34. package/dist/common/src/named-query.context.d.ts +4 -4
  35. package/dist/common/src/named-query.schemas.d.ts +1 -1
  36. package/dist/common/src/named-query.types.d.ts +1 -1
  37. package/dist/common/src/query/index.d.ts +2 -2
  38. package/dist/common/src/query/query-context.d.ts +42 -42
  39. package/dist/common/src/query/simple-query-builder.d.ts +117 -117
  40. package/dist/common/src/query.schemas.d.ts +3 -3
  41. package/dist/common/src/query.types.d.ts +57 -57
  42. package/dist/common/src/regions.d.ts +1 -1
  43. package/dist/common/src/schema/schema.types.d.ts +54 -54
  44. package/dist/common/src/secret.schemas.d.ts +1 -1
  45. package/dist/common/src/secret.types.d.ts +8 -8
  46. package/dist/common/src/security.types.d.ts +1 -1
  47. package/dist/common/src/socket.schemas.d.ts +1 -1
  48. package/dist/common/src/socket.types.d.ts +1 -1
  49. package/dist/common/src/time-units.d.ts +1 -1
  50. package/dist/common/src/trigger.types.d.ts +1 -1
  51. package/dist/common/src/types.d.ts +8 -8
  52. package/dist/common/src/utils/array.d.ts +1 -1
  53. package/dist/common/src/utils/assert.d.ts +1 -1
  54. package/dist/common/src/utils/error.d.ts +4 -4
  55. package/dist/common/src/utils/http.d.ts +2 -2
  56. package/dist/common/src/utils/id.d.ts +2 -2
  57. package/dist/common/src/utils/lock.manager.d.ts +14 -14
  58. package/dist/common/src/utils/nullish.d.ts +1 -1
  59. package/dist/common/src/utils/object.d.ts +6 -6
  60. package/dist/common/src/utils/serialization.d.ts +6 -6
  61. package/dist/common/src/utils/transforms.d.ts +18 -18
  62. package/dist/common/src/utils/url.d.ts +1 -1
  63. package/dist/common/src/utils/validation.d.ts +30 -30
  64. package/dist/common/src/webhook-response.d.ts +1 -1
  65. package/dist/esm/index.js +1 -1
  66. package/dist/node_modules/json-schema-typed/draft-2020-12.d.ts +1239 -1239
  67. package/dist/typescript-client/src/ai-assistant-client.d.ts +167 -167
  68. package/dist/typescript-client/src/ai-client.factory.d.ts +11 -11
  69. package/dist/typescript-client/src/api.manager.d.ts +15 -15
  70. package/dist/typescript-client/src/auth.manager.d.ts +23 -23
  71. package/dist/typescript-client/src/backend-function.manager.d.ts +13 -13
  72. package/dist/typescript-client/src/client-id.service.d.ts +25 -25
  73. package/dist/typescript-client/src/collection-reference.d.ts +81 -81
  74. package/dist/typescript-client/src/collection-reference.factory.d.ts +16 -16
  75. package/dist/typescript-client/src/connection-details.d.ts +23 -23
  76. package/dist/typescript-client/src/data.manager.d.ts +172 -172
  77. package/dist/typescript-client/src/destruct.manager.d.ts +12 -12
  78. package/dist/typescript-client/src/distributed-lock.manager.d.ts +19 -19
  79. package/dist/typescript-client/src/document-identity.service.d.ts +12 -12
  80. package/dist/typescript-client/src/document-reference.d.ts +134 -134
  81. package/dist/typescript-client/src/document-reference.factory.d.ts +9 -9
  82. package/dist/typescript-client/src/document-store.d.ts +11 -11
  83. package/dist/typescript-client/src/graphql-client.d.ts +12 -12
  84. package/dist/typescript-client/src/graphql-client.factory.d.ts +9 -9
  85. package/dist/typescript-client/src/index.d.ts +8 -8
  86. package/dist/typescript-client/src/mutation/mutation-sender.d.ts +10 -10
  87. package/dist/typescript-client/src/named-query.manager.d.ts +12 -12
  88. package/dist/typescript-client/src/query/join-query-builder.factory.d.ts +72 -72
  89. package/dist/typescript-client/src/query/query-builder.factory.d.ts +89 -89
  90. package/dist/typescript-client/src/query/query-subscription.manager.d.ts +135 -135
  91. package/dist/typescript-client/src/query/query.types.d.ts +14 -14
  92. package/dist/typescript-client/src/rpc.manager.d.ts +28 -28
  93. package/dist/typescript-client/src/socket.manager.d.ts +32 -32
  94. package/dist/typescript-client/src/squid.d.ts +218 -218
  95. package/dist/typescript-client/src/state/action.applier.d.ts +7 -7
  96. package/dist/typescript-client/src/state/actions.d.ts +29 -29
  97. package/dist/typescript-client/src/state/path_trie.d.ts +27 -27
  98. package/dist/typescript-client/src/state/state.service.d.ts +22 -22
  99. package/dist/typescript-client/src/state/state.service.spec.d.ts +1 -1
  100. package/dist/typescript-client/src/testing/setup-tests.d.ts +1 -1
  101. package/dist/typescript-client/src/types.d.ts +2 -2
  102. package/package.json +1 -1
@@ -1,117 +1,117 @@
1
- import { IntegrationId } from '../communication.types';
2
- import { CollectionName, DocumentData, FieldName, PrimitiveFieldType } from '../document.types';
3
- import { Operator, Query } from '../query.types';
4
- /** Base interface for a query builder. */
5
- export declare abstract class BaseQueryBuilderInterface<MyDocType extends DocumentData> {
6
- /**
7
- * Adds a condition to the query.
8
- * @param fieldName The name of the field to query.
9
- * @param operator The operator to use.
10
- * @param value The value to compare against.
11
- * @returns The query builder.
12
- */
13
- abstract where(fieldName: (keyof MyDocType & FieldName) | string, operator: Operator | 'in' | 'not in', value: PrimitiveFieldType | Array<PrimitiveFieldType>): this;
14
- /**
15
- * A shortcut for where(fieldName, '==', value)
16
- *
17
- * @param fieldName The name of the field to query.
18
- * @param value The value to compare against.
19
- * @returns The query builder.
20
- */
21
- eq(fieldName: (keyof MyDocType & FieldName) | string, value: PrimitiveFieldType): this;
22
- /**
23
- * A shortcut for where(fieldName, '!=', value)
24
- * @param fieldName The name of the field to query.
25
- * @param value The value to compare against.
26
- * @returns The query builder.
27
- */
28
- neq(fieldName: (keyof MyDocType & FieldName) | string, value: PrimitiveFieldType): this;
29
- /**
30
- * A shortcut for where(fieldName, 'in', value)
31
- * @param fieldName The name of the field to query.
32
- * @param value An array of values to compare against.
33
- * @returns The query builder.
34
- */
35
- in(fieldName: (keyof MyDocType & FieldName) | string, value: Array<PrimitiveFieldType>): this;
36
- /**
37
- * A shortcut for where(fieldName, 'not in', value)
38
- * @param fieldName The name of the field to query.
39
- * @param value An array of values to compare against.
40
- * @returns The query builder.
41
- */
42
- nin(fieldName: (keyof MyDocType & FieldName) | string, value: Array<PrimitiveFieldType>): this;
43
- /**
44
- * A shortcut for where(fieldName, '>', value)
45
- * @param fieldName The name of the field to query.
46
- * @param value The value to compare against.
47
- * @returns The query builder.
48
- */
49
- gt(fieldName: (keyof MyDocType & FieldName) | string, value: PrimitiveFieldType): this;
50
- /**
51
- * A shortcut for where(fieldName, '>=', value)
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
- gte(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
- lt(fieldName: (keyof MyDocType & FieldName) | string, value: PrimitiveFieldType): this;
64
- /**
65
- * A shortcut for where(fieldName, '<=', value)
66
- * @param fieldName The name of the field to query.
67
- * @param value The value to compare against.
68
- * @returns The query builder.
69
- */
70
- lte(fieldName: (keyof MyDocType & FieldName) | string, value: PrimitiveFieldType): this;
71
- /**
72
- * A shortcut for where(fieldName, 'like', pattern).
73
- *
74
- * @param fieldName The name of the field to query.
75
- * @param pattern The pattern to compare against. '%' is the only allowed wildcard
76
- * @param caseSensitive Whether to use case-sensitive comparison. Defaults to true.
77
- * @returns The query builder.
78
- */
79
- like(fieldName: (keyof MyDocType & FieldName) | string, pattern: string, caseSensitive?: boolean): this;
80
- /**
81
- * A shortcut for where(fieldName, 'not like', pattern).
82
- *
83
- * @param fieldName The name of the field to query.
84
- * @param pattern The pattern to compare against. '%' is the only allowed wildcard
85
- * @param caseSensitive Whether to use case-sensitive comparison. Defaults to true.
86
- * @returns The query builder.
87
- */
88
- notLike(fieldName: (keyof MyDocType & FieldName) | string, pattern: string, caseSensitive?: boolean): this;
89
- /**
90
- * Sets a limit to the number of results returned by the query. The maximum limit is 20,000 and the default is 1,000
91
- * if none is provided.
92
- * @param limit The limit to set.
93
- * @returns The query builder.
94
- */
95
- abstract limit(limit: number): this;
96
- /**
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
- * determines the order in which they are applied.
99
- * @param fieldName The name of the field to sort by.
100
- * @param asc Whether to sort in ascending order. Defaults to true.
101
- * @returns The query builder.
102
- */
103
- abstract sortBy(fieldName: keyof MyDocType & FieldName, asc?: boolean): this;
104
- }
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> extends BaseQueryBuilderInterface<MyDocType> {
107
- protected readonly collectionName: CollectionName;
108
- protected readonly integrationId: IntegrationId;
109
- protected readonly query: Query<MyDocType>;
110
- /** @inheritDoc */
111
- where(fieldName: (keyof MyDocType & FieldName) | string, operator: Operator | 'in' | 'not in', value: PrimitiveFieldType | Array<PrimitiveFieldType>): this;
112
- /** @inheritDoc */
113
- limit(limit: number): this;
114
- /** @inheritDoc */
115
- sortBy(fieldName: keyof MyDocType & FieldName, asc?: boolean): this;
116
- private mergeConditions;
117
- }
1
+ import { IntegrationId } from '../communication.types';
2
+ import { CollectionName, DocumentData, FieldName, PrimitiveFieldType } from '../document.types';
3
+ import { Operator, Query } from '../query.types';
4
+ /** Base interface for a query builder. */
5
+ export declare abstract class BaseQueryBuilderInterface<MyDocType extends DocumentData> {
6
+ /**
7
+ * Adds a condition to the query.
8
+ * @param fieldName The name of the field to query.
9
+ * @param operator The operator to use.
10
+ * @param value The value to compare against.
11
+ * @returns The query builder.
12
+ */
13
+ abstract where(fieldName: (keyof MyDocType & FieldName) | string, operator: Operator | 'in' | 'not in', value: PrimitiveFieldType | Array<PrimitiveFieldType>): this;
14
+ /**
15
+ * A shortcut for where(fieldName, '==', value)
16
+ *
17
+ * @param fieldName The name of the field to query.
18
+ * @param value The value to compare against.
19
+ * @returns The query builder.
20
+ */
21
+ eq(fieldName: (keyof MyDocType & FieldName) | string, value: PrimitiveFieldType): this;
22
+ /**
23
+ * A shortcut for where(fieldName, '!=', value)
24
+ * @param fieldName The name of the field to query.
25
+ * @param value The value to compare against.
26
+ * @returns The query builder.
27
+ */
28
+ neq(fieldName: (keyof MyDocType & FieldName) | string, value: PrimitiveFieldType): this;
29
+ /**
30
+ * A shortcut for where(fieldName, 'in', value)
31
+ * @param fieldName The name of the field to query.
32
+ * @param value An array of values to compare against.
33
+ * @returns The query builder.
34
+ */
35
+ in(fieldName: (keyof MyDocType & FieldName) | string, value: Array<PrimitiveFieldType>): this;
36
+ /**
37
+ * A shortcut for where(fieldName, 'not in', value)
38
+ * @param fieldName The name of the field to query.
39
+ * @param value An array of values to compare against.
40
+ * @returns The query builder.
41
+ */
42
+ nin(fieldName: (keyof MyDocType & FieldName) | string, value: Array<PrimitiveFieldType>): this;
43
+ /**
44
+ * A shortcut for where(fieldName, '>', value)
45
+ * @param fieldName The name of the field to query.
46
+ * @param value The value to compare against.
47
+ * @returns The query builder.
48
+ */
49
+ gt(fieldName: (keyof MyDocType & FieldName) | string, value: PrimitiveFieldType): this;
50
+ /**
51
+ * A shortcut for where(fieldName, '>=', value)
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
+ gte(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
+ lt(fieldName: (keyof MyDocType & FieldName) | string, value: PrimitiveFieldType): this;
64
+ /**
65
+ * A shortcut for where(fieldName, '<=', value)
66
+ * @param fieldName The name of the field to query.
67
+ * @param value The value to compare against.
68
+ * @returns The query builder.
69
+ */
70
+ lte(fieldName: (keyof MyDocType & FieldName) | string, value: PrimitiveFieldType): this;
71
+ /**
72
+ * A shortcut for where(fieldName, 'like', pattern).
73
+ *
74
+ * @param fieldName The name of the field to query.
75
+ * @param pattern The pattern to compare against. '%' is the only allowed wildcard
76
+ * @param caseSensitive Whether to use case-sensitive comparison. Defaults to true.
77
+ * @returns The query builder.
78
+ */
79
+ like(fieldName: (keyof MyDocType & FieldName) | string, pattern: string, caseSensitive?: boolean): this;
80
+ /**
81
+ * A shortcut for where(fieldName, 'not like', pattern).
82
+ *
83
+ * @param fieldName The name of the field to query.
84
+ * @param pattern The pattern to compare against. '%' is the only allowed wildcard
85
+ * @param caseSensitive Whether to use case-sensitive comparison. Defaults to true.
86
+ * @returns The query builder.
87
+ */
88
+ notLike(fieldName: (keyof MyDocType & FieldName) | string, pattern: string, caseSensitive?: boolean): this;
89
+ /**
90
+ * Sets a limit to the number of results returned by the query. The maximum limit is 20,000 and the default is 1,000
91
+ * if none is provided.
92
+ * @param limit The limit to set.
93
+ * @returns The query builder.
94
+ */
95
+ abstract limit(limit: number): this;
96
+ /**
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
+ * determines the order in which they are applied.
99
+ * @param fieldName The name of the field to sort by.
100
+ * @param asc Whether to sort in ascending order. Defaults to true.
101
+ * @returns The query builder.
102
+ */
103
+ abstract sortBy(fieldName: keyof MyDocType & FieldName, asc?: boolean): this;
104
+ }
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> extends BaseQueryBuilderInterface<MyDocType> {
107
+ protected readonly collectionName: CollectionName;
108
+ protected readonly integrationId: IntegrationId;
109
+ protected readonly query: Query<MyDocType>;
110
+ /** @inheritDoc */
111
+ where(fieldName: (keyof MyDocType & FieldName) | string, operator: Operator | 'in' | 'not in', value: PrimitiveFieldType | Array<PrimitiveFieldType>): this;
112
+ /** @inheritDoc */
113
+ limit(limit: number): this;
114
+ /** @inheritDoc */
115
+ sortBy(fieldName: keyof MyDocType & FieldName, asc?: boolean): this;
116
+ private mergeConditions;
117
+ }
@@ -1,3 +1,3 @@
1
- import { JSONSchemaType } from 'ajv';
2
- import { QueryRegisterRequest } from './query.types';
3
- export declare const QueryRegisterRequestSchema: JSONSchemaType<QueryRegisterRequest>;
1
+ import { JSONSchemaType } from 'ajv';
2
+ import { QueryRegisterRequest } from './query.types';
3
+ export declare const QueryRegisterRequestSchema: JSONSchemaType<QueryRegisterRequest>;
@@ -1,57 +1,57 @@
1
- import { ClientRequestId } from './communication.types';
2
- import { CollectionName, FieldName } from './document.types';
3
- /** A list of query conditions. */
4
- export type Conditions<Doc = any, F extends FieldName<Doc> = any> = Array<Condition<Doc, F>>;
5
- /** A single query condition. */
6
- export interface Condition<Doc = any, F extends FieldName<Doc> = any> {
7
- fieldName: F;
8
- operator: Operator;
9
- value: Doc[F] | null;
10
- }
11
- /** An operator in a query condition. */
12
- export type Operator = '==' | '>=' | '<=' | '>' | '<' | '!=' | 'like' | 'not like' | 'like_cs' | 'not like_cs';
13
- /** A list of context conditions */
14
- export type ContextConditions<Doc = any, F extends FieldName<Doc> = any> = Array<ContextCondition<Doc, F>>;
15
- /** A generic value that can exist in a query. */
16
- export type GenericValue<Doc = any, F extends FieldName<Doc> = any, O extends AllOperators = any> = O extends 'in' ? Array<Doc[F]> | null : O extends 'not in' ? Array<Doc[F]> | null : Doc[F] | null;
17
- /** A Context condition - a condition that replaces multiple '==' or '!=' conditions with 'in' and 'not in'. */
18
- export type ContextCondition<Doc = any, F extends FieldName<Doc> = any> = InContextCondition<Doc, F> | NotInContextCondition<Doc, F> | OtherContextCondition<Doc, F>;
19
- interface InContextCondition<Doc = any, F extends FieldName<Doc> = any> extends Omit<Condition<Doc, F>, 'operator' | 'value'> {
20
- operator: 'in';
21
- value: Array<Doc[F]>;
22
- }
23
- interface NotInContextCondition<Doc = any, F extends FieldName<Doc> = any> extends Omit<Condition<Doc, F>, 'operator' | 'value'> {
24
- operator: 'not in';
25
- value: Array<Doc[F]>;
26
- }
27
- export interface OtherContextCondition<Doc = any, F extends FieldName<Doc> = any> extends Omit<Condition<Doc, F>, 'operator'> {
28
- operator: Exclude<ContextOperator, 'in' | 'not in'>;
29
- }
30
- /** A condition that includes the 'in' and 'not in' operators. */
31
- export interface GeneralCondition<Doc = any, F extends FieldName<Doc> = any> extends Omit<Condition<Doc, F>, 'operator' | 'value'> {
32
- operator: AllOperators;
33
- value: any;
34
- }
35
- /** A list of general conditions. */
36
- export type GeneralConditions<Doc = any, F extends FieldName<Doc> = any> = Array<GeneralCondition<Doc, F>>;
37
- export type ContextOperator = Exclude<Operator, '==' | '!='> | 'in' | 'not in';
38
- export type AllOperators = Operator | 'in' | 'not in';
39
- /** A definition of a sort by a filed. */
40
- export interface FieldSort<Doc> {
41
- fieldName: FieldName<Doc>;
42
- asc: boolean;
43
- }
44
- /** A query object. */
45
- export interface Query<Doc = any> {
46
- collectionName: CollectionName;
47
- integrationId: string;
48
- conditions: Conditions<Doc>;
49
- sortOrder: Array<FieldSort<Doc>>;
50
- limit: number;
51
- }
52
- export interface QueryRegisterRequest {
53
- clientRequestId: ClientRequestId;
54
- query: Query;
55
- parentClientRequestId: ClientRequestId;
56
- }
57
- export {};
1
+ import { ClientRequestId } from './communication.types';
2
+ import { CollectionName, FieldName } from './document.types';
3
+ /** A list of query conditions. */
4
+ export type Conditions<Doc = any, F extends FieldName<Doc> = any> = Array<Condition<Doc, F>>;
5
+ /** A single query condition. */
6
+ export interface Condition<Doc = any, F extends FieldName<Doc> = any> {
7
+ fieldName: F;
8
+ operator: Operator;
9
+ value: Doc[F] | null;
10
+ }
11
+ /** An operator in a query condition. */
12
+ export type Operator = '==' | '>=' | '<=' | '>' | '<' | '!=' | 'like' | 'not like' | 'like_cs' | 'not like_cs';
13
+ /** A list of context conditions */
14
+ export type ContextConditions<Doc = any, F extends FieldName<Doc> = any> = Array<ContextCondition<Doc, F>>;
15
+ /** A generic value that can exist in a query. */
16
+ export type GenericValue<Doc = any, F extends FieldName<Doc> = any, O extends AllOperators = any> = O extends 'in' ? Array<Doc[F]> | null : O extends 'not in' ? Array<Doc[F]> | null : Doc[F] | null;
17
+ /** A Context condition - a condition that replaces multiple '==' or '!=' conditions with 'in' and 'not in'. */
18
+ export type ContextCondition<Doc = any, F extends FieldName<Doc> = any> = InContextCondition<Doc, F> | NotInContextCondition<Doc, F> | OtherContextCondition<Doc, F>;
19
+ interface InContextCondition<Doc = any, F extends FieldName<Doc> = any> extends Omit<Condition<Doc, F>, 'operator' | 'value'> {
20
+ operator: 'in';
21
+ value: Array<Doc[F]>;
22
+ }
23
+ interface NotInContextCondition<Doc = any, F extends FieldName<Doc> = any> extends Omit<Condition<Doc, F>, 'operator' | 'value'> {
24
+ operator: 'not in';
25
+ value: Array<Doc[F]>;
26
+ }
27
+ export interface OtherContextCondition<Doc = any, F extends FieldName<Doc> = any> extends Omit<Condition<Doc, F>, 'operator'> {
28
+ operator: Exclude<ContextOperator, 'in' | 'not in'>;
29
+ }
30
+ /** A condition that includes the 'in' and 'not in' operators. */
31
+ export interface GeneralCondition<Doc = any, F extends FieldName<Doc> = any> extends Omit<Condition<Doc, F>, 'operator' | 'value'> {
32
+ operator: AllOperators;
33
+ value: any;
34
+ }
35
+ /** A list of general conditions. */
36
+ export type GeneralConditions<Doc = any, F extends FieldName<Doc> = any> = Array<GeneralCondition<Doc, F>>;
37
+ export type ContextOperator = Exclude<Operator, '==' | '!='> | 'in' | 'not in';
38
+ export type AllOperators = Operator | 'in' | 'not in';
39
+ /** A definition of a sort by a filed. */
40
+ export interface FieldSort<Doc> {
41
+ fieldName: FieldName<Doc>;
42
+ asc: boolean;
43
+ }
44
+ /** A query object. */
45
+ export interface Query<Doc = any> {
46
+ collectionName: CollectionName;
47
+ integrationId: string;
48
+ conditions: Conditions<Doc>;
49
+ sortOrder: Array<FieldSort<Doc>>;
50
+ limit: number;
51
+ }
52
+ export interface QueryRegisterRequest {
53
+ clientRequestId: ClientRequestId;
54
+ query: Query;
55
+ parentClientRequestId: ClientRequestId;
56
+ }
57
+ export {};
@@ -1 +1 @@
1
- export type SupportedSquidRegion = (typeof SupportedSquidRegions)[number];
1
+ export type SupportedSquidRegion = (typeof SupportedSquidRegions)[number];
@@ -1,54 +1,54 @@
1
- import { JSONSchema } from 'json-schema-typed';
2
- export type FieldPlaceholder = '__SQUID_SERVER_TIMESTAMP__' | '__SQUID_CLIENT_IP__' | '__SQUID_USER_ID__' | '__SQUID_API_KEY__';
3
- export type BasicFieldType = 'string' | 'integer' | 'number' | 'boolean' | 'map' | 'array' | 'any';
4
- export type CustomFieldType = 'date' | 'json' | 'objectId';
5
- export type SupportedFieldType = BasicFieldType | CustomFieldType;
6
- export declare const SUPPORTED_FIELD_TYPES_ARRAY: Array<SupportedFieldType>;
7
- type ConvertDeep<T extends JSONSchema> = Exclude<T, boolean> & {
8
- properties?: Record<string, ConvertDeep<JSONSchema>>;
9
- patternProperties?: Record<string, ConvertDeep<JSONSchema>>;
10
- nullable?: boolean;
11
- /**
12
- * The default value will be applied (default to 'empty'):
13
- * 'always' - no matter what the client sent, both on update and insert. In case of readOnly - applies only on insert.
14
- * 'empty' - only if the value of the filed is empty (undefined)
15
- * 'updateOrEmpty' - no matter what the client sent, updating the record will use the default value
16
- */
17
- applyDefaultValueOn?: 'always' | 'empty' | 'updateOrEmpty';
18
- isDate?: boolean;
19
- isJSON?: boolean;
20
- /**
21
- * Applies to the top level schema, a record in a nested object, or a regular property.
22
- * Basically, whether this property can participate in an insert mutation.
23
- */
24
- insertable?: boolean;
25
- /** Applies to the top level schema or a record in a nested object. */
26
- deletable?: boolean;
27
- };
28
- export type PropertySchema = ConvertDeep<JSONSchema>;
29
- export type TopLevelPropertySchema = PropertySchema & {
30
- primaryKey?: boolean;
31
- /**
32
- * Whether the property is computed based on other properties or some formula.
33
- * If true, readonly also needs to be true and this field should not be part of an insert statement.
34
- */
35
- isComputed?: boolean;
36
- /**
37
- * Whether the default value generated by the database. CURRENT_DATE is something generated by the database vs
38
- * 'Hello' which is a constant.
39
- */
40
- isDefaultComputed?: boolean;
41
- /**
42
- * The database data type that is represented by this property. This is often different from the actual property
43
- * type, with is a Javascript primitive. For example, for a SMALLINT the dataType would be 'smallint', but the type
44
- * would be 'integer'.
45
- */
46
- dataType?: string;
47
- };
48
- export type CollectionSchema = Omit<ConvertDeep<JSONSchema>, 'properties'> & {
49
- properties?: Record<string, TopLevelPropertySchema>;
50
- };
51
- export declare function compileSchema<S extends CollectionSchema>(schema: S): any;
52
- export declare function validateSchema<S extends CollectionSchema>(schema: S, data: any, updatedPaths?: Array<string>, dataBefore?: any): void;
53
- export declare function findMatchingPropertiesForKey<S extends CollectionSchema | PropertySchema>(schema: S, key: string): Array<PropertySchema>;
54
- export {};
1
+ import { JSONSchema } from 'json-schema-typed';
2
+ export type FieldPlaceholder = '__SQUID_SERVER_TIMESTAMP__' | '__SQUID_CLIENT_IP__' | '__SQUID_USER_ID__' | '__SQUID_API_KEY__';
3
+ export type BasicFieldType = 'string' | 'integer' | 'number' | 'boolean' | 'map' | 'array' | 'any';
4
+ export type CustomFieldType = 'date' | 'json' | 'objectId';
5
+ export type SupportedFieldType = BasicFieldType | CustomFieldType;
6
+ export declare const SUPPORTED_FIELD_TYPES_ARRAY: Array<SupportedFieldType>;
7
+ type ConvertDeep<T extends JSONSchema> = Exclude<T, boolean> & {
8
+ properties?: Record<string, ConvertDeep<JSONSchema>>;
9
+ patternProperties?: Record<string, ConvertDeep<JSONSchema>>;
10
+ nullable?: boolean;
11
+ /**
12
+ * The default value will be applied (default to 'empty'):
13
+ * 'always' - no matter what the client sent, both on update and insert. In case of readOnly - applies only on insert.
14
+ * 'empty' - only if the value of the filed is empty (undefined)
15
+ * 'updateOrEmpty' - no matter what the client sent, updating the record will use the default value
16
+ */
17
+ applyDefaultValueOn?: 'always' | 'empty' | 'updateOrEmpty';
18
+ isDate?: boolean;
19
+ isJSON?: boolean;
20
+ /**
21
+ * Applies to the top level schema, a record in a nested object, or a regular property.
22
+ * Basically, whether this property can participate in an insert mutation.
23
+ */
24
+ insertable?: boolean;
25
+ /** Applies to the top level schema or a record in a nested object. */
26
+ deletable?: boolean;
27
+ };
28
+ export type PropertySchema = ConvertDeep<JSONSchema>;
29
+ export type TopLevelPropertySchema = PropertySchema & {
30
+ primaryKey?: boolean;
31
+ /**
32
+ * Whether the property is computed based on other properties or some formula.
33
+ * If true, readonly also needs to be true and this field should not be part of an insert statement.
34
+ */
35
+ isComputed?: boolean;
36
+ /**
37
+ * Whether the default value generated by the database. CURRENT_DATE is something generated by the database vs
38
+ * 'Hello' which is a constant.
39
+ */
40
+ isDefaultComputed?: boolean;
41
+ /**
42
+ * The database data type that is represented by this property. This is often different from the actual property
43
+ * type, with is a Javascript primitive. For example, for a SMALLINT the dataType would be 'smallint', but the type
44
+ * would be 'integer'.
45
+ */
46
+ dataType?: string;
47
+ };
48
+ export type CollectionSchema = Omit<ConvertDeep<JSONSchema>, 'properties'> & {
49
+ properties?: Record<string, TopLevelPropertySchema>;
50
+ };
51
+ export declare function compileSchema<S extends CollectionSchema>(schema: S): any;
52
+ export declare function validateSchema<S extends CollectionSchema>(schema: S, data: any, updatedPaths?: Array<string>, dataBefore?: any): void;
53
+ export declare function findMatchingPropertiesForKey<S extends CollectionSchema | PropertySchema>(schema: S, key: string): Array<PropertySchema>;
54
+ export {};
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1,8 +1,8 @@
1
- /** The secret key, an alias for a string. */
2
- export type SecretKey = string;
3
- /** The secret value. */
4
- export type SecretValue = string | number | boolean;
5
- /** A type alias for an ApiKey. */
6
- export type ApiKey = string;
7
- export declare const BACKEND_API_KEY = "_BACKEND_API_KEY";
8
- export declare const APP_API_KEY = "APP_API_KEY";
1
+ /** The secret key, an alias for a string. */
2
+ export type SecretKey = string;
3
+ /** The secret value. */
4
+ export type SecretValue = string | number | boolean;
5
+ /** A type alias for an ApiKey. */
6
+ export type ApiKey = string;
7
+ export declare const BACKEND_API_KEY = "_BACKEND_API_KEY";
8
+ export declare const APP_API_KEY = "APP_API_KEY";
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1,8 +1,8 @@
1
- export interface Type<T> extends Function {
2
- new (...args: any[]): T;
3
- }
4
- type Pred = [0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
5
- export type Paths<T, RemainingDepth extends number & keyof Pred = 5, Prefix extends string = ''> = RemainingDepth extends 0 ? `${Prefix}${string}` : {
6
- [k in keyof T]-?: k extends string | number ? `${Prefix}${k}` | (Required<T>[k] extends any[] ? never : Required<T>[k] extends object ? Paths<Required<T>[k], Pred[RemainingDepth], `${Prefix}${k}.`> : never) : never;
7
- }[keyof T];
8
- export {};
1
+ export interface Type<T> extends Function {
2
+ new (...args: any[]): T;
3
+ }
4
+ type Pred = [0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
5
+ export type Paths<T, RemainingDepth extends number & keyof Pred = 5, Prefix extends string = ''> = RemainingDepth extends 0 ? `${Prefix}${string}` : {
6
+ [k in keyof T]-?: k extends string | number ? `${Prefix}${k}` | (Required<T>[k] extends any[] ? never : Required<T>[k] extends object ? Paths<Required<T>[k], Pred[RemainingDepth], `${Prefix}${k}.`> : never) : never;
7
+ }[keyof T];
8
+ export {};
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1,4 +1,4 @@
1
- export declare class CodeExecutionError extends Error {
2
- readonly details?: string | undefined;
3
- constructor(error: string, details?: string | undefined);
4
- }
1
+ export declare class CodeExecutionError extends Error {
2
+ readonly details?: string | undefined;
3
+ constructor(error: string, details?: string | undefined);
4
+ }
@@ -1,2 +1,2 @@
1
- export declare function getApplicationUrl(regionPrefix: string, appId: string): string;
2
- export declare function getApplicationHttpHeaders(regionPrefix: string, appId: string): Record<string, string>;
1
+ export declare function getApplicationUrl(regionPrefix: string, appId: string): string;
2
+ export declare function getApplicationHttpHeaders(regionPrefix: string, appId: string): Record<string, string>;
@@ -1,2 +1,2 @@
1
- export declare function generateId(): string;
2
- export declare function generateShortId(length?: number): string;
1
+ export declare function generateId(): string;
2
+ export declare function generateShortId(length?: number): string;
@@ -1,14 +1,14 @@
1
- type LockMutex = string;
2
- /**
3
- * A simple lock manager that locks a list of mutexes.
4
- * When locking a list of mutexes, the lock will start only when all the mutexes are available - preventing partial lock
5
- * and potential deadlocks.
6
- */
7
- export declare class LockManager {
8
- private readonly locks;
9
- lock(...mutexes: LockMutex[]): Promise<void>;
10
- release(...mutexes: LockMutex[]): void;
11
- canGetLock(...mutexes: LockMutex[]): boolean;
12
- lockSync(...mutexes: LockMutex[]): void;
13
- }
14
- export {};
1
+ type LockMutex = string;
2
+ /**
3
+ * A simple lock manager that locks a list of mutexes.
4
+ * When locking a list of mutexes, the lock will start only when all the mutexes are available - preventing partial lock
5
+ * and potential deadlocks.
6
+ */
7
+ export declare class LockManager {
8
+ private readonly locks;
9
+ lock(...mutexes: LockMutex[]): Promise<void>;
10
+ release(...mutexes: LockMutex[]): void;
11
+ canGetLock(...mutexes: LockMutex[]): boolean;
12
+ lockSync(...mutexes: LockMutex[]): void;
13
+ }
14
+ export {};
@@ -1 +1 @@
1
- export declare function isNotNullish<T>(t: T | undefined | null): t is T;
1
+ export declare function isNotNullish<T>(t: T | undefined | null): t is T;
@@ -1,6 +1,6 @@
1
- export declare function getInPath(obj: any, path: string, delimiter?: string): any;
2
- export declare function setInPath(obj: any, path: string, value: any, delimiter?: string): void;
3
- export declare function deleteInPath(obj: any, path: string, delimiter?: string): void;
4
- export declare function deepReplace(obj: any, keyName: string, replacer: (from: any) => any): void;
5
- export declare function replaceKeyInMap<K, T>(map: Map<K, T | undefined>, a: K, b: K): void;
6
- export declare function replaceKeyInRecord<K extends keyof any, T>(record: Record<K, T>, a: K, b: K): void;
1
+ export declare function getInPath(obj: any, path: string, delimiter?: string): any;
2
+ export declare function setInPath(obj: any, path: string, value: any, delimiter?: string): void;
3
+ export declare function deleteInPath(obj: any, path: string, delimiter?: string): void;
4
+ export declare function deepReplace(obj: any, keyName: string, replacer: (from: any) => any): void;
5
+ export declare function replaceKeyInMap<K, T>(map: Map<K, T | undefined>, a: K, b: K): void;
6
+ export declare function replaceKeyInRecord<K extends keyof any, T>(record: Record<K, T>, a: K, b: K): void;
@@ -1,6 +1,6 @@
1
- export declare function normalizeJsonAsString(json: any): string;
2
- export declare function serializeObj(obj: any): string;
3
- export declare function deserializeObj<T = any>(str: string): T;
4
- export declare function encodeValueForMapping(value: any): string;
5
- export declare function decodeValueForMapping(encodedString: string): any;
6
- export declare function recodeValue(value: any): any;
1
+ export declare function normalizeJsonAsString(json: any): string;
2
+ export declare function serializeObj(obj: any): string;
3
+ export declare function deserializeObj<T = any>(str: string): T;
4
+ export declare function encodeValueForMapping(value: any): string;
5
+ export declare function decodeValueForMapping(encodedString: string): any;
6
+ export declare function recodeValue(value: any): any;