@squidcloud/backend 1.0.211 → 1.0.212
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.
|
@@ -6,4 +6,5 @@ export * from '../../internal-common/src/public-types-backend/graphql.public-con
|
|
|
6
6
|
export * from '../../internal-common/src/public-types-backend/mutation.public-context';
|
|
7
7
|
export * from '../../internal-common/src/public-types-backend/native-query.public-context';
|
|
8
8
|
export * from '../../internal-common/src/public-types-backend/query.public-context';
|
|
9
|
+
export * from '../../internal-common/src/public-types-backend/service.public-types';
|
|
9
10
|
export * from '../../internal-common/src/public-types-backend/topic.public-context';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AuthWithApiKey, AuthWithBearer, RunContext, SecretKey, SecretValue, Squid, SquidRegion } from '@squidcloud/client';
|
|
2
|
+
import { ServiceGlobalConfig } from '../../internal-common/src/public-types-backend/service.public-types';
|
|
2
3
|
/**
|
|
3
4
|
* A base class for all the different types of Squid backend services. This class serves as a container
|
|
4
5
|
* for the various methods implemented in the backend in order to customize the Squid backend for an application.
|
|
@@ -9,6 +10,7 @@ export declare class SquidService {
|
|
|
9
10
|
* Your application's region. When developing locally, the region will be set to `local`.
|
|
10
11
|
*/
|
|
11
12
|
readonly region: SquidRegion;
|
|
13
|
+
constructor(config: ServiceGlobalConfig);
|
|
12
14
|
/** The list of your application's secrets as defined in the Squid Cloud Console. */
|
|
13
15
|
get secrets(): Record<SecretKey, SecretValue>;
|
|
14
16
|
/**
|
|
@@ -4,7 +4,6 @@ import { CollectionName, DocumentData } from '@squidcloud/client';
|
|
|
4
4
|
import { IntegrationId } from '@squidcloud/client';
|
|
5
5
|
export declare class QueryContext<T extends DocumentData = any> {
|
|
6
6
|
readonly query: Query<T>;
|
|
7
|
-
private readonly parsedConditions;
|
|
8
7
|
/**
|
|
9
8
|
* The ID of the integration being queried.
|
|
10
9
|
*/
|
|
@@ -93,19 +92,6 @@ export declare class QueryContext<T extends DocumentData = any> {
|
|
|
93
92
|
* The method does not account for limit and sort order.
|
|
94
93
|
*/
|
|
95
94
|
documentMatchesQuery(doc: DocumentData): boolean;
|
|
96
|
-
/**
|
|
97
|
-
* Compares a condition against a given operator and value to determine if the
|
|
98
|
-
* provided condition is a subset of the operator and value. A condition is
|
|
99
|
-
* considered a subset if all values that satisfy (return true for) the
|
|
100
|
-
* condition also satisfy the operator and value.
|
|
101
|
-
*
|
|
102
|
-
* This is done using the underlying CompareTable, which provides a comparison
|
|
103
|
-
* function for each operator pair, or undefined if the comparison would
|
|
104
|
-
* always be false, regardless of the values.
|
|
105
|
-
*/
|
|
106
|
-
private evaluateSubset;
|
|
107
|
-
private evaluateIncludes;
|
|
108
|
-
private parseConditions;
|
|
109
95
|
}
|
|
110
96
|
/** A list of context conditions */
|
|
111
97
|
export type ContextConditions<Doc extends DocumentData = any, F extends Paths<Doc> = Paths<Doc>> = Array<ContextCondition<Doc, F>>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { AsyncLocalStorage } from 'async_hooks';
|
|
3
|
+
import { AppId, EnvironmentId, SquidDeveloperId } from '@squidcloud/client';
|
|
4
|
+
import { Auth, RunContext } from '@squidcloud/client';
|
|
5
|
+
import { SecretKey } from '@squidcloud/client';
|
|
6
|
+
/**
|
|
7
|
+
* Immutable part of the service config: this part of the Service config never changes for a service.
|
|
8
|
+
*/
|
|
9
|
+
export interface ServiceGlobalConfig {
|
|
10
|
+
codeDir: string;
|
|
11
|
+
environmentId?: EnvironmentId;
|
|
12
|
+
/** Your applicationId. */
|
|
13
|
+
appId: AppId;
|
|
14
|
+
squidDeveloperId?: SquidDeveloperId;
|
|
15
|
+
backendApiKey: string;
|
|
16
|
+
/**
|
|
17
|
+
* Current states of the secrets.
|
|
18
|
+
* Mutable, and can be dynamically updated in runtime.
|
|
19
|
+
*/
|
|
20
|
+
secrets: Record<SecretKey, any>;
|
|
21
|
+
requestLocalStorage: AsyncLocalStorage<ServiceRequestConfig>;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The part of the service config that changes every request.
|
|
25
|
+
*/
|
|
26
|
+
export interface ServiceRequestConfig {
|
|
27
|
+
auth: Auth | undefined;
|
|
28
|
+
context: RunContext;
|
|
29
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@squidcloud/backend",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.212",
|
|
4
4
|
"description": "Squid Cloud's backend SDK",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/backend/src/index.d.ts",
|
|
@@ -26,6 +26,6 @@
|
|
|
26
26
|
"tsoa": "^5.1.1"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"@squidcloud/client": "^1.0.
|
|
29
|
+
"@squidcloud/client": "^1.0.212"
|
|
30
30
|
}
|
|
31
31
|
}
|