@squidcloud/client 1.0.166 → 1.0.168
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.
- package/dist/cjs/index.js +35 -16
- package/package.json +1 -1
- package/dist/internal-common/src/public-types/ai-assistant.public-types.d.ts +0 -25
- package/dist/internal-common/src/public-types/ai-chatbot.public-context.d.ts +0 -12
- package/dist/internal-common/src/public-types/ai-chatbot.public-types.d.ts +0 -31
- package/dist/internal-common/src/public-types/api-call.public-context.d.ts +0 -14
- package/dist/internal-common/src/public-types/application.public-types.d.ts +0 -149
- package/dist/internal-common/src/public-types/base-query-builder.public-types.d.ts +0 -147
- package/dist/internal-common/src/public-types/bundle-api.public-types.d.ts +0 -57
- package/dist/internal-common/src/public-types/bundle-data.public-types.d.ts +0 -8
- package/dist/internal-common/src/public-types/communication.public-types.d.ts +0 -12
- package/dist/internal-common/src/public-types/context.public-types.d.ts +0 -40
- package/dist/internal-common/src/public-types/distributed-lock.public-context.d.ts +0 -4
- package/dist/internal-common/src/public-types/document.public-types.d.ts +0 -32
- package/dist/internal-common/src/public-types/graphql.public-context.d.ts +0 -7
- package/dist/internal-common/src/public-types/graphql.public-types.d.ts +0 -9
- package/dist/internal-common/src/public-types/http-status.enum.d.ts +0 -50
- package/dist/internal-common/src/public-types/integration.public-types.d.ts +0 -61
- package/dist/internal-common/src/public-types/integrations/ai_chatbot.types.d.ts +0 -32
- package/dist/internal-common/src/public-types/integrations/api.types.d.ts +0 -81
- package/dist/internal-common/src/public-types/integrations/auth.types.d.ts +0 -54
- package/dist/internal-common/src/public-types/integrations/database.types.d.ts +0 -206
- package/dist/internal-common/src/public-types/integrations/observability.types.d.ts +0 -24
- package/dist/internal-common/src/public-types/integrations/queue-types.d.ts +0 -40
- package/dist/internal-common/src/public-types/integrations/schemas.d.ts +0 -70
- package/dist/internal-common/src/public-types/mutation.public-context.d.ts +0 -14
- package/dist/internal-common/src/public-types/mutation.public-types.d.ts +0 -53
- package/dist/internal-common/src/public-types/native-query.public-context.d.ts +0 -7
- package/dist/internal-common/src/public-types/native-query.public-types.d.ts +0 -16
- package/dist/internal-common/src/public-types/pagination.public-types.d.ts +0 -62
- package/dist/internal-common/src/public-types/query.public-context.d.ts +0 -137
- package/dist/internal-common/src/public-types/query.public-types.d.ts +0 -64
- package/dist/internal-common/src/public-types/regions.public-types.d.ts +0 -5
- package/dist/internal-common/src/public-types/schema.public-types.d.ts +0 -46
- package/dist/internal-common/src/public-types/secret.public-types.d.ts +0 -16
- package/dist/internal-common/src/public-types/serialized-query.public-types.d.ts +0 -24
- package/dist/internal-common/src/public-types/socket.public-types.d.ts +0 -5
- package/dist/internal-common/src/public-types/topic.public-context.d.ts +0 -10
- package/dist/internal-common/src/public-types/typescript.public-types.d.ts +0 -15
- package/dist/internal-common/src/public-utils/id-utils.d.ts +0 -6
- package/dist/internal-common/src/types/ai-assistant.types.d.ts +0 -1
- package/dist/internal-common/src/types/ai-chatbot.types.d.ts +0 -1
- package/dist/internal-common/src/types/api.types.d.ts +0 -2
- package/dist/internal-common/src/types/backend-function.types.d.ts +0 -1
- package/dist/internal-common/src/types/backend-run.types.d.ts +0 -2
- package/dist/internal-common/src/types/bundle-data.types.d.ts +0 -4
- package/dist/internal-common/src/types/communication.types.d.ts +0 -1
- package/dist/internal-common/src/types/document.types.d.ts +0 -1
- package/dist/internal-common/src/types/mutation.types.d.ts +0 -1
- package/dist/internal-common/src/types/openapi.types.d.ts +0 -1
- package/dist/internal-common/src/types/query.types.d.ts +0 -1
- package/dist/internal-common/src/types/secret.types.d.ts +0 -11
- package/dist/internal-common/src/types/socket.types.d.ts +0 -7
- package/dist/internal-common/src/utils/array.d.ts +0 -1
- package/dist/internal-common/src/utils/assert.d.ts +0 -1
- package/dist/internal-common/src/utils/global.utils.d.ts +0 -1
- package/dist/internal-common/src/utils/http.d.ts +0 -2
- package/dist/internal-common/src/utils/lock.manager.d.ts +0 -14
- package/dist/internal-common/src/utils/object.d.ts +0 -5
- package/dist/internal-common/src/utils/serialization.d.ts +0 -5
- package/dist/internal-common/src/utils/validation.d.ts +0 -27
- package/dist/internal-common/src/websocket.impl.d.ts +0 -21
- package/dist/node_modules/json-schema-typed/draft-2020-12.d.ts +0 -1239
- package/dist/typescript-client/src/ai-assistant-client.d.ts +0 -73
- package/dist/typescript-client/src/ai-chatbot-client.d.ts +0 -174
- package/dist/typescript-client/src/ai-chatbot-client.factory.d.ts +0 -8
- package/dist/typescript-client/src/ai.types.d.ts +0 -63
- package/dist/typescript-client/src/api.manager.d.ts +0 -11
- package/dist/typescript-client/src/auth.manager.d.ts +0 -27
- package/dist/typescript-client/src/backend-function.manager.d.ts +0 -9
- package/dist/typescript-client/src/backend-transforms.d.ts +0 -0
- package/dist/typescript-client/src/client-id.service.d.ts +0 -27
- package/dist/typescript-client/src/collection-reference.d.ts +0 -80
- package/dist/typescript-client/src/collection-reference.factory.d.ts +0 -13
- package/dist/typescript-client/src/connection-details.d.ts +0 -23
- package/dist/typescript-client/src/data.manager.d.ts +0 -175
- package/dist/typescript-client/src/destruct.manager.d.ts +0 -13
- package/dist/typescript-client/src/distributed-lock.manager.d.ts +0 -16
- package/dist/typescript-client/src/document-identity.service.d.ts +0 -12
- package/dist/typescript-client/src/document-reference.d.ts +0 -149
- package/dist/typescript-client/src/document-reference.factory.d.ts +0 -13
- package/dist/typescript-client/src/document-store.d.ts +0 -14
- package/dist/typescript-client/src/graphql-client.d.ts +0 -14
- package/dist/typescript-client/src/graphql-client.factory.d.ts +0 -11
- package/dist/typescript-client/src/index.d.ts +0 -11
- package/dist/typescript-client/src/mutation/mutation-sender.d.ts +0 -12
- package/dist/typescript-client/src/native-query-manager.d.ts +0 -7
- package/dist/typescript-client/src/public-types.d.ts +0 -37
- package/dist/typescript-client/src/public-utils.d.ts +0 -1
- package/dist/typescript-client/src/query/deserializer.d.ts +0 -3
- package/dist/typescript-client/src/query/join-query-builder.factory.d.ts +0 -161
- package/dist/typescript-client/src/query/local-query-manager.d.ts +0 -9
- package/dist/typescript-client/src/query/query-builder.factory.d.ts +0 -77
- package/dist/typescript-client/src/query/query-sender.d.ts +0 -34
- package/dist/typescript-client/src/query/query-subscription.manager.d.ts +0 -133
- package/dist/typescript-client/src/query/query.types.d.ts +0 -49
- package/dist/typescript-client/src/queue.manager.d.ts +0 -7
- package/dist/typescript-client/src/rate-limiter.d.ts +0 -32
- package/dist/typescript-client/src/rpc.manager.d.ts +0 -30
- package/dist/typescript-client/src/secret.client.d.ts +0 -23
- package/dist/typescript-client/src/socket.manager.d.ts +0 -44
- package/dist/typescript-client/src/squid.d.ts +0 -245
- package/dist/typescript-client/src/state/state.service.spec.d.ts +0 -1
- package/dist/typescript-client/src/testing/setup-tests.d.ts +0 -1
- package/dist/typescript-client/src/types.d.ts +0 -2
package/dist/cjs/index.js
CHANGED
|
@@ -51556,6 +51556,7 @@ class LockManager {
|
|
|
51556
51556
|
|
|
51557
51557
|
;// CONCATENATED MODULE: ./src/queue.manager.ts
|
|
51558
51558
|
|
|
51559
|
+
|
|
51559
51560
|
/** @internal */
|
|
51560
51561
|
class QueueManagerFactory {
|
|
51561
51562
|
constructor(rpcManager, socketManager, destructManager) {
|
|
@@ -51595,6 +51596,7 @@ class QueueManagerFactory {
|
|
|
51595
51596
|
return (_a = this.queueManagers.get(integrationId)) === null || _a === void 0 ? void 0 : _a.get(topicName);
|
|
51596
51597
|
}
|
|
51597
51598
|
}
|
|
51599
|
+
const SUBSCRIPTION_MUTEX = 'subscriptionMutex';
|
|
51598
51600
|
/** @internal */
|
|
51599
51601
|
class QueueManagerImpl {
|
|
51600
51602
|
constructor(integrationId, topicName, rpcManager) {
|
|
@@ -51603,6 +51605,7 @@ class QueueManagerImpl {
|
|
|
51603
51605
|
this.rpcManager = rpcManager;
|
|
51604
51606
|
this.messagesSubject = new external_rxjs_.Subject();
|
|
51605
51607
|
this.subscriberCount = 0;
|
|
51608
|
+
this.lockManager = new LockManager();
|
|
51606
51609
|
}
|
|
51607
51610
|
async produce(messages) {
|
|
51608
51611
|
await this.rpcManager.post('queue/produceMessages', {
|
|
@@ -51613,32 +51616,48 @@ class QueueManagerImpl {
|
|
|
51613
51616
|
}
|
|
51614
51617
|
consume() {
|
|
51615
51618
|
return (0,external_rxjs_.defer)(() => {
|
|
51616
|
-
// Code to run when the observable is subscribed
|
|
51617
51619
|
this.subscriberCount++;
|
|
51618
51620
|
if (this.subscriberCount === 1) {
|
|
51619
|
-
this.
|
|
51620
|
-
.post('queue/subscribe', {
|
|
51621
|
-
integrationId: this.integrationId,
|
|
51622
|
-
topicName: this.topicName,
|
|
51623
|
-
})
|
|
51624
|
-
.catch(e => {
|
|
51625
|
-
this.messagesSubject.error(e);
|
|
51626
|
-
this.messagesSubject.complete();
|
|
51627
|
-
this.subscriberCount = 0;
|
|
51628
|
-
this.messagesSubject = new external_rxjs_.Subject();
|
|
51629
|
-
});
|
|
51621
|
+
void this.performSubscribe();
|
|
51630
51622
|
}
|
|
51631
51623
|
return this.messagesSubject.asObservable().pipe((0,external_rxjs_.finalize)(() => {
|
|
51632
51624
|
this.subscriberCount--;
|
|
51633
51625
|
if (this.subscriberCount === 0) {
|
|
51634
|
-
this.
|
|
51635
|
-
integrationId: this.integrationId,
|
|
51636
|
-
topicName: this.topicName,
|
|
51637
|
-
});
|
|
51626
|
+
void this.performUnsubscribe();
|
|
51638
51627
|
}
|
|
51639
51628
|
}));
|
|
51640
51629
|
});
|
|
51641
51630
|
}
|
|
51631
|
+
async performSubscribe() {
|
|
51632
|
+
await this.lockManager.lock(SUBSCRIPTION_MUTEX);
|
|
51633
|
+
try {
|
|
51634
|
+
await this.rpcManager.post('queue/subscribe', {
|
|
51635
|
+
integrationId: this.integrationId,
|
|
51636
|
+
topicName: this.topicName,
|
|
51637
|
+
});
|
|
51638
|
+
}
|
|
51639
|
+
catch (e) {
|
|
51640
|
+
this.messagesSubject.error(e);
|
|
51641
|
+
this.messagesSubject.complete();
|
|
51642
|
+
this.subscriberCount = 0;
|
|
51643
|
+
this.messagesSubject = new external_rxjs_.Subject();
|
|
51644
|
+
}
|
|
51645
|
+
finally {
|
|
51646
|
+
this.lockManager.release(SUBSCRIPTION_MUTEX);
|
|
51647
|
+
}
|
|
51648
|
+
}
|
|
51649
|
+
async performUnsubscribe() {
|
|
51650
|
+
await this.lockManager.lock(SUBSCRIPTION_MUTEX);
|
|
51651
|
+
try {
|
|
51652
|
+
await this.rpcManager.post('queue/unsubscribe', {
|
|
51653
|
+
integrationId: this.integrationId,
|
|
51654
|
+
topicName: this.topicName,
|
|
51655
|
+
});
|
|
51656
|
+
}
|
|
51657
|
+
finally {
|
|
51658
|
+
this.lockManager.release(SUBSCRIPTION_MUTEX);
|
|
51659
|
+
}
|
|
51660
|
+
}
|
|
51642
51661
|
onMessages(payload) {
|
|
51643
51662
|
for (const message of payload) {
|
|
51644
51663
|
this.messagesSubject.next(message);
|
package/package.json
CHANGED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { FunctionName } from './bundle-data.public-types';
|
|
2
|
-
export type AssistantToolType = 'code_interpreter' | 'retrieval';
|
|
3
|
-
export interface CreateAssistantRequest {
|
|
4
|
-
name: string;
|
|
5
|
-
instructions: string;
|
|
6
|
-
functions: Array<FunctionName>;
|
|
7
|
-
toolTypes?: Array<AssistantToolType>;
|
|
8
|
-
}
|
|
9
|
-
export interface DeleteAssistantRequest {
|
|
10
|
-
assistantId: string;
|
|
11
|
-
}
|
|
12
|
-
export interface CreateAssistantThreadRequest {
|
|
13
|
-
assistantId: string;
|
|
14
|
-
}
|
|
15
|
-
export interface DeleteThreadRequest {
|
|
16
|
-
threadId: string;
|
|
17
|
-
}
|
|
18
|
-
export interface CreateAssistantThreadRequest {
|
|
19
|
-
}
|
|
20
|
-
export interface CreateAssistantResponse {
|
|
21
|
-
assistantId: string;
|
|
22
|
-
}
|
|
23
|
-
export interface CreateAssistantThreadResponse {
|
|
24
|
-
threadId: string;
|
|
25
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { AiChatbotMutationType, AiChatbotResourceType } from './ai-chatbot.public-types';
|
|
2
|
-
export declare class AiChatbotChatContext {
|
|
3
|
-
readonly prompt: string;
|
|
4
|
-
readonly profileId: string;
|
|
5
|
-
}
|
|
6
|
-
/** A context provided to the security rules of an AI Chatbot mutation. */
|
|
7
|
-
export declare class AiChatbotMutationContext {
|
|
8
|
-
readonly type: AiChatbotMutationType;
|
|
9
|
-
readonly resource: AiChatbotResourceType;
|
|
10
|
-
readonly profileId: string;
|
|
11
|
-
readonly payload: any;
|
|
12
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/** The supported AI model names. */
|
|
2
|
-
export declare const AI_MODEL_NAMES: readonly ["gpt-3.5-turbo", "gpt-3.5-turbo-1106", "gpt-4", "claude-2", "gpt-4-1106-preview"];
|
|
3
|
-
export type AiModelName = (typeof AI_MODEL_NAMES)[number];
|
|
4
|
-
/** The possible sources for the LLM provider API key. */
|
|
5
|
-
export type ApiKeySource = 'user' | 'system';
|
|
6
|
-
export type AiChatbotContextType = 'text' | 'url' | 'file';
|
|
7
|
-
interface AiChatbotContextBase {
|
|
8
|
-
type: AiChatbotContextType;
|
|
9
|
-
data: string;
|
|
10
|
-
}
|
|
11
|
-
export interface AiChatbotTextContext extends AiChatbotContextBase {
|
|
12
|
-
type: 'text';
|
|
13
|
-
}
|
|
14
|
-
export interface AiChatbotUrlContext extends AiChatbotContextBase {
|
|
15
|
-
type: 'url';
|
|
16
|
-
}
|
|
17
|
-
export interface AiChatbotFileContext extends AiChatbotContextBase {
|
|
18
|
-
type: 'file';
|
|
19
|
-
}
|
|
20
|
-
export type AiChatbotContext = AiChatbotTextContext | AiChatbotUrlContext | AiChatbotFileContext;
|
|
21
|
-
export type OpenAiResponseFormat = 'text' | 'json_object';
|
|
22
|
-
export interface AiChatbotChatOptions {
|
|
23
|
-
maxTokens?: number;
|
|
24
|
-
chatId?: string;
|
|
25
|
-
disableHistory?: boolean;
|
|
26
|
-
includeReference?: boolean;
|
|
27
|
-
responseFormat?: OpenAiResponseFormat;
|
|
28
|
-
}
|
|
29
|
-
export type AiChatbotMutationType = 'insert' | 'update' | 'delete';
|
|
30
|
-
export type AiChatbotResourceType = 'instruction' | 'context' | 'profile';
|
|
31
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ApiEndpointId, HttpMethod } from './integrations/api.types';
|
|
2
|
-
/** The headers of an API call. */
|
|
3
|
-
export type ApiHeaders = Record<string, string | number | boolean>;
|
|
4
|
-
/** The context of an API call. */
|
|
5
|
-
export declare class ApiCallContext {
|
|
6
|
-
readonly endpointId: ApiEndpointId;
|
|
7
|
-
readonly url: string;
|
|
8
|
-
readonly method: HttpMethod;
|
|
9
|
-
readonly headers: ApiHeaders;
|
|
10
|
-
readonly body: Record<string, any>;
|
|
11
|
-
readonly queryParams: Record<string, string | number | boolean>;
|
|
12
|
-
readonly pathParams: Record<string, string>;
|
|
13
|
-
readonly serverUrlOverride: string | undefined;
|
|
14
|
-
}
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
import { AuthIntegrationType, DatabaseIntegrationType, IntegrationConfig, IntegrationConfigTypes, IntegrationSchema, IntegrationSchemaKeys, IntegrationSchemaTypes, IntegrationTypeWithConfig } from './integrations/schemas';
|
|
2
|
-
import { IntegrationType } from './integration.public-types';
|
|
3
|
-
import { AppId, EnvironmentId, IntegrationId } from './communication.public-types';
|
|
4
|
-
/** A type alias for a string that represents a webhook. */
|
|
5
|
-
export type WebhookId = string;
|
|
6
|
-
/** A type alias for a string that represents a trigger id. */
|
|
7
|
-
export type TriggerId = string;
|
|
8
|
-
/** A type alias for a string that represents a scheduler id. */
|
|
9
|
-
export type SchedulerId = string;
|
|
10
|
-
/** The supported cron expression string. */
|
|
11
|
-
export type CronExpressionString = `${string} ${string} ${string} ${string} ${string}` | `${string} ${string} ${string} ${string}`;
|
|
12
|
-
/** A set of predefined cron expressions. */
|
|
13
|
-
export declare enum CronExpression {
|
|
14
|
-
EVERY_SECOND = "* * * * * *",
|
|
15
|
-
EVERY_5_SECONDS = "*/5 * * * * *",
|
|
16
|
-
EVERY_10_SECONDS = "*/10 * * * * *",
|
|
17
|
-
EVERY_30_SECONDS = "*/30 * * * * *",
|
|
18
|
-
EVERY_MINUTE = "*/1 * * * *",
|
|
19
|
-
EVERY_5_MINUTES = "0 */5 * * * *",
|
|
20
|
-
EVERY_10_MINUTES = "0 */10 * * * *",
|
|
21
|
-
EVERY_30_MINUTES = "0 */30 * * * *",
|
|
22
|
-
EVERY_HOUR = "0 0-23/1 * * *",
|
|
23
|
-
EVERY_2_HOURS = "0 0-23/2 * * *",
|
|
24
|
-
EVERY_3_HOURS = "0 0-23/3 * * *",
|
|
25
|
-
EVERY_4_HOURS = "0 0-23/4 * * *",
|
|
26
|
-
EVERY_5_HOURS = "0 0-23/5 * * *",
|
|
27
|
-
EVERY_6_HOURS = "0 0-23/6 * * *",
|
|
28
|
-
EVERY_7_HOURS = "0 0-23/7 * * *",
|
|
29
|
-
EVERY_8_HOURS = "0 0-23/8 * * *",
|
|
30
|
-
EVERY_9_HOURS = "0 0-23/9 * * *",
|
|
31
|
-
EVERY_10_HOURS = "0 0-23/10 * * *",
|
|
32
|
-
EVERY_11_HOURS = "0 0-23/11 * * *",
|
|
33
|
-
EVERY_12_HOURS = "0 0-23/12 * * *",
|
|
34
|
-
EVERY_DAY_AT_1AM = "0 01 * * *",
|
|
35
|
-
EVERY_DAY_AT_2AM = "0 02 * * *",
|
|
36
|
-
EVERY_DAY_AT_3AM = "0 03 * * *",
|
|
37
|
-
EVERY_DAY_AT_4AM = "0 04 * * *",
|
|
38
|
-
EVERY_DAY_AT_5AM = "0 05 * * *",
|
|
39
|
-
EVERY_DAY_AT_6AM = "0 06 * * *",
|
|
40
|
-
EVERY_DAY_AT_7AM = "0 07 * * *",
|
|
41
|
-
EVERY_DAY_AT_8AM = "0 08 * * *",
|
|
42
|
-
EVERY_DAY_AT_9AM = "0 09 * * *",
|
|
43
|
-
EVERY_DAY_AT_10AM = "0 10 * * *",
|
|
44
|
-
EVERY_DAY_AT_11AM = "0 11 * * *",
|
|
45
|
-
EVERY_DAY_AT_NOON = "0 12 * * *",
|
|
46
|
-
EVERY_DAY_AT_1PM = "0 13 * * *",
|
|
47
|
-
EVERY_DAY_AT_2PM = "0 14 * * *",
|
|
48
|
-
EVERY_DAY_AT_3PM = "0 15 * * *",
|
|
49
|
-
EVERY_DAY_AT_4PM = "0 16 * * *",
|
|
50
|
-
EVERY_DAY_AT_5PM = "0 17 * * *",
|
|
51
|
-
EVERY_DAY_AT_6PM = "0 18 * * *",
|
|
52
|
-
EVERY_DAY_AT_7PM = "0 19 * * *",
|
|
53
|
-
EVERY_DAY_AT_8PM = "0 20 * * *",
|
|
54
|
-
EVERY_DAY_AT_9PM = "0 21 * * *",
|
|
55
|
-
EVERY_DAY_AT_10PM = "0 22 * * *",
|
|
56
|
-
EVERY_DAY_AT_11PM = "0 23 * * *",
|
|
57
|
-
EVERY_DAY_AT_MIDNIGHT = "0 0 * * *",
|
|
58
|
-
EVERY_WEEK = "0 0 * * 7",
|
|
59
|
-
EVERY_WEEKDAY = "0 0 * * 1-5",
|
|
60
|
-
EVERY_WEEKEND = "0 0 * * 6,7",
|
|
61
|
-
EVERY_1ST_DAY_OF_MONTH_AT_MIDNIGHT = "0 0 1 * *",
|
|
62
|
-
EVERY_1ST_DAY_OF_MONTH_AT_NOON = "0 12 1 * *",
|
|
63
|
-
EVERY_2ND_HOUR = "0 */2 * * *",
|
|
64
|
-
EVERY_2ND_HOUR_FROM_1AM_THROUGH_11PM = "0 1-23/2 * * *",
|
|
65
|
-
EVERY_2ND_MONTH = "0 0 1 */2 *",
|
|
66
|
-
EVERY_QUARTER = "0 0 1 */3 *",
|
|
67
|
-
EVERY_6_MONTHS = "0 0 1 */6 *",
|
|
68
|
-
EVERY_YEAR = "0 0 1 1 *",
|
|
69
|
-
EVERY_30_MINUTES_BETWEEN_9AM_AND_5PM = "0 */30 9-17 * * *",
|
|
70
|
-
EVERY_30_MINUTES_BETWEEN_9AM_AND_6PM = "0 */30 9-18 * * *",
|
|
71
|
-
EVERY_30_MINUTES_BETWEEN_10AM_AND_7PM = "0 */30 10-19 * * *",
|
|
72
|
-
MONDAY_TO_FRIDAY_AT_1AM = "0 0 01 * * 1-5",
|
|
73
|
-
MONDAY_TO_FRIDAY_AT_2AM = "0 0 02 * * 1-5",
|
|
74
|
-
MONDAY_TO_FRIDAY_AT_3AM = "0 0 03 * * 1-5",
|
|
75
|
-
MONDAY_TO_FRIDAY_AT_4AM = "0 0 04 * * 1-5",
|
|
76
|
-
MONDAY_TO_FRIDAY_AT_5AM = "0 0 05 * * 1-5",
|
|
77
|
-
MONDAY_TO_FRIDAY_AT_6AM = "0 0 06 * * 1-5",
|
|
78
|
-
MONDAY_TO_FRIDAY_AT_7AM = "0 0 07 * * 1-5",
|
|
79
|
-
MONDAY_TO_FRIDAY_AT_8AM = "0 0 08 * * 1-5",
|
|
80
|
-
MONDAY_TO_FRIDAY_AT_9AM = "0 0 09 * * 1-5",
|
|
81
|
-
MONDAY_TO_FRIDAY_AT_09_30AM = "0 30 09 * * 1-5",
|
|
82
|
-
MONDAY_TO_FRIDAY_AT_10AM = "0 0 10 * * 1-5",
|
|
83
|
-
MONDAY_TO_FRIDAY_AT_11AM = "0 0 11 * * 1-5",
|
|
84
|
-
MONDAY_TO_FRIDAY_AT_11_30AM = "0 30 11 * * 1-5",
|
|
85
|
-
MONDAY_TO_FRIDAY_AT_12PM = "0 0 12 * * 1-5",
|
|
86
|
-
MONDAY_TO_FRIDAY_AT_1PM = "0 0 13 * * 1-5",
|
|
87
|
-
MONDAY_TO_FRIDAY_AT_2PM = "0 0 14 * * 1-5",
|
|
88
|
-
MONDAY_TO_FRIDAY_AT_3PM = "0 0 15 * * 1-5",
|
|
89
|
-
MONDAY_TO_FRIDAY_AT_4PM = "0 0 16 * * 1-5",
|
|
90
|
-
MONDAY_TO_FRIDAY_AT_5PM = "0 0 17 * * 1-5",
|
|
91
|
-
MONDAY_TO_FRIDAY_AT_6PM = "0 0 18 * * 1-5",
|
|
92
|
-
MONDAY_TO_FRIDAY_AT_7PM = "0 0 19 * * 1-5",
|
|
93
|
-
MONDAY_TO_FRIDAY_AT_8PM = "0 0 20 * * 1-5",
|
|
94
|
-
MONDAY_TO_FRIDAY_AT_9PM = "0 0 21 * * 1-5",
|
|
95
|
-
MONDAY_TO_FRIDAY_AT_10PM = "0 0 22 * * 1-5",
|
|
96
|
-
MONDAY_TO_FRIDAY_AT_11PM = "0 0 23 * * 1-5"
|
|
97
|
-
}
|
|
98
|
-
export interface DeleteIntegrationRequest {
|
|
99
|
-
integrationId: IntegrationId;
|
|
100
|
-
}
|
|
101
|
-
export interface UpdateAllowedHostsRequest {
|
|
102
|
-
allowedHosts: string[];
|
|
103
|
-
}
|
|
104
|
-
export interface CreateEnvironmentRequest {
|
|
105
|
-
sourceAppId: AppId;
|
|
106
|
-
environmentId: EnvironmentId;
|
|
107
|
-
}
|
|
108
|
-
export interface UpdateApplicationCodeRequest {
|
|
109
|
-
appId: AppId;
|
|
110
|
-
openApiSpecStr?: string;
|
|
111
|
-
openApiControllersStr?: string;
|
|
112
|
-
}
|
|
113
|
-
interface BaseUpsertIntegrationRequest<T extends IntegrationTypeWithConfig, C extends IntegrationConfig> {
|
|
114
|
-
id: IntegrationId;
|
|
115
|
-
type: T;
|
|
116
|
-
config: Partial<C>;
|
|
117
|
-
}
|
|
118
|
-
type ConfigurationTypes = {
|
|
119
|
-
[K in IntegrationTypeWithConfig]: IntegrationConfigTypes[K];
|
|
120
|
-
};
|
|
121
|
-
type UpsertIntegrationRequests = {
|
|
122
|
-
[K in IntegrationTypeWithConfig]: BaseUpsertIntegrationRequest<K, ConfigurationTypes[K]>;
|
|
123
|
-
};
|
|
124
|
-
export type UpsertDataIntegrationRequest = UpsertIntegrationRequests[DatabaseIntegrationType];
|
|
125
|
-
export type UpsertGraphQLIntegrationRequest = UpsertIntegrationRequests[IntegrationType.graphql];
|
|
126
|
-
export type UpsertApiIntegrationRequest = UpsertIntegrationRequests[IntegrationType.api];
|
|
127
|
-
export type UpsertAiChatbotIntegrationRequest = UpsertIntegrationRequests[IntegrationType.ai_chatbot];
|
|
128
|
-
export type UpsertKafkaIntegrationRequest = UpsertIntegrationRequests[IntegrationType.kafka];
|
|
129
|
-
export type UpsertConfluentIntegrationRequest = UpsertIntegrationRequests[IntegrationType.confluent];
|
|
130
|
-
export type UpsertAuthIntegrationRequest = UpsertIntegrationRequests[AuthIntegrationType];
|
|
131
|
-
interface BaseUpsertIntegrationSchemaRequest<T extends IntegrationType, S extends IntegrationSchema> {
|
|
132
|
-
id: IntegrationId;
|
|
133
|
-
type: T;
|
|
134
|
-
schema: S;
|
|
135
|
-
}
|
|
136
|
-
type SchemaTypes = {
|
|
137
|
-
[K in IntegrationSchemaKeys]: IntegrationSchemaTypes[K];
|
|
138
|
-
};
|
|
139
|
-
type UpsertIntegrationSchemaRequests = {
|
|
140
|
-
[K in IntegrationSchemaKeys]: BaseUpsertIntegrationSchemaRequest<K, SchemaTypes[K]>;
|
|
141
|
-
};
|
|
142
|
-
export type UpsertIntegrationSchemaRequest = UpsertDataIntegrationSchemaRequest | UpsertGraphQLIntegrationSchemaRequest | UpsertApiIntegrationSchemaRequest;
|
|
143
|
-
export type UpsertDataIntegrationSchemaRequest = UpsertIntegrationSchemaRequests[DatabaseIntegrationType];
|
|
144
|
-
export type UpsertGraphQLIntegrationSchemaRequest = UpsertIntegrationSchemaRequests[IntegrationType.graphql];
|
|
145
|
-
export type UpsertApiIntegrationSchemaRequest = UpsertIntegrationSchemaRequests[IntegrationType.api];
|
|
146
|
-
export interface GetSchemaRequest {
|
|
147
|
-
integrationId: IntegrationId;
|
|
148
|
-
}
|
|
149
|
-
export {};
|
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
import { Observable } from 'rxjs';
|
|
2
|
-
import { SerializedQuery } from './serialized-query.public-types';
|
|
3
|
-
import { Pagination, PaginationOptions } from './pagination.public-types';
|
|
4
|
-
import { Operator } from './query.public-types';
|
|
5
|
-
import { DocumentData, FieldName, PrimitiveFieldType } from './document.public-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,57 +0,0 @@
|
|
|
1
|
-
import { MutationContext } from './mutation.public-context';
|
|
2
|
-
import { ApiCallContext } from './api-call.public-context';
|
|
3
|
-
import { QueryContext } from './query.public-context';
|
|
4
|
-
import { AiChatbotActionType, DatabaseActionType, TopicActionType } from './bundle-data.public-types';
|
|
5
|
-
import { ClientConnectionState } from './socket.public-types';
|
|
6
|
-
import { DocumentData } from './document.public-types';
|
|
7
|
-
import { MutationType } from './mutation.public-types';
|
|
8
|
-
import { ClientId, SquidDocId } from './communication.public-types';
|
|
9
|
-
import { TopicReadContext, TopicWriteContext } from './topic.public-context';
|
|
10
|
-
import { NativeQueryContext } from './native-query.public-context';
|
|
11
|
-
import { DistributedLockContext } from './distributed-lock.public-context';
|
|
12
|
-
import { GraphqlContext } from './graphql.public-context';
|
|
13
|
-
import { AiChatbotChatContext, AiChatbotMutationContext } from './ai-chatbot.public-context';
|
|
14
|
-
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>);
|
|
15
|
-
export type SecureTopicAction<T extends TopicActionType> = T extends 'all' ? () => boolean | Promise<boolean> : T extends 'read' ? ((context: TopicReadContext) => boolean | Promise<boolean>) | (() => boolean | Promise<boolean>) : ((context: TopicWriteContext<T>) => boolean | Promise<boolean>) | (() => boolean | Promise<boolean>);
|
|
16
|
-
export type SecureApiAction = ((context: ApiCallContext) => boolean | Promise<boolean>) | (() => boolean | Promise<boolean>);
|
|
17
|
-
export type SecureNativeQueryAction = ((context: NativeQueryContext) => boolean | Promise<boolean>) | (() => boolean | Promise<boolean>);
|
|
18
|
-
export type SecureDistributedLockAction = ((context: DistributedLockContext) => boolean | Promise<boolean>) | (() => boolean | Promise<boolean>);
|
|
19
|
-
export type SecureGraphQLAction = ((context: GraphqlContext) => boolean | Promise<boolean>) | (() => boolean | Promise<boolean>);
|
|
20
|
-
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>);
|
|
21
|
-
export type ClientConnectionStateChangeAction = (clientId: ClientId, clientConnectionState: ClientConnectionState) => Promise<void> | void;
|
|
22
|
-
export type ExecutableAction = (...args: any[]) => any;
|
|
23
|
-
export type AiFunctionAction<T extends Record<string, any> = any> = (params: T) => any;
|
|
24
|
-
export type TriggerAction = ((request: TriggerRequest) => void | Promise<void>) | (() => void | Promise<void>);
|
|
25
|
-
/** The context provided to a trigger function. */
|
|
26
|
-
export interface TriggerRequest<T extends DocumentData = any> {
|
|
27
|
-
squidDocId: SquidDocId;
|
|
28
|
-
mutationType: MutationType;
|
|
29
|
-
docBefore?: T;
|
|
30
|
-
docAfter?: T;
|
|
31
|
-
}
|
|
32
|
-
export type SchedulerAction = () => void | Promise<void>;
|
|
33
|
-
export type WebhookAction = ((request: WebhookRequest) => any) | (() => any);
|
|
34
|
-
/** The context provided to a webhook function. */
|
|
35
|
-
export interface WebhookRequest<T = any> {
|
|
36
|
-
body: T;
|
|
37
|
-
rawBody?: string;
|
|
38
|
-
queryParams: Record<string, string>;
|
|
39
|
-
headers: Record<string, string>;
|
|
40
|
-
httpMethod: 'post' | 'get' | 'put' | 'delete';
|
|
41
|
-
files?: Array<SquidFile>;
|
|
42
|
-
}
|
|
43
|
-
export interface WebhookResponse {
|
|
44
|
-
headers: Record<string, any>;
|
|
45
|
-
body: any;
|
|
46
|
-
statusCode: number;
|
|
47
|
-
__isWebhookResponse__: true;
|
|
48
|
-
}
|
|
49
|
-
export interface SquidFile {
|
|
50
|
-
data: Uint8Array;
|
|
51
|
-
fieldName: string;
|
|
52
|
-
mimetype: string;
|
|
53
|
-
originalName: string;
|
|
54
|
-
size: number;
|
|
55
|
-
encoding?: string;
|
|
56
|
-
}
|
|
57
|
-
export type ActionMethodDecorator<U> = <T extends U>(target: Object, propertyName: string, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<T>;
|
|
@@ -1,8 +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 a topic. */
|
|
4
|
-
export type TopicActionType = 'read' | 'write' | 'all';
|
|
5
|
-
/** The different types of actions that can be performed on an AI chatbot. */
|
|
6
|
-
export type AiChatbotActionType = 'chat' | 'mutate' | 'all';
|
|
7
|
-
export type AiFunctionParamType = 'string' | 'number' | 'boolean' | 'date';
|
|
8
|
-
export type FunctionName = string;
|
|
@@ -1,12 +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
|
-
export type SquidDeveloperId = string;
|
|
6
|
-
/** @deprecated. Use ENVIRONMENT_IDS. */
|
|
7
|
-
export declare const allEnvironmentIds: Array<EnvironmentId>;
|
|
8
|
-
/** A type alias for an integration id. */
|
|
9
|
-
export type IntegrationId = string;
|
|
10
|
-
export type ClientId = string;
|
|
11
|
-
export type SquidDocId = string;
|
|
12
|
-
export type ClientRequestId = string;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { AppId, ClientId } from './communication.public-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,32 +0,0 @@
|
|
|
1
|
-
import { IntegrationId } from './communication.public-types';
|
|
2
|
-
export type PrimitiveFieldType = string | number | boolean | null | Date;
|
|
3
|
-
export type FieldType = PrimitiveFieldType | Array<FieldType> | {
|
|
4
|
-
[key: string]: FieldType;
|
|
5
|
-
};
|
|
6
|
-
/** A type alias for a field name. */
|
|
7
|
-
export type FieldName<T = any> = string & keyof T;
|
|
8
|
-
/** A type alias for a document id as string. */
|
|
9
|
-
export type DocId = string;
|
|
10
|
-
/** A type alias for a document id object when the ID is a composite of primary keys. */
|
|
11
|
-
export type DocIdObj = Record<FieldName, any>;
|
|
12
|
-
/** A type alias for a collection name. */
|
|
13
|
-
export type CollectionName = string;
|
|
14
|
-
/** A generic document data type. */
|
|
15
|
-
export type DocumentData = Record<FieldName, any | undefined>;
|
|
16
|
-
export type DocTimestamp = number;
|
|
17
|
-
export interface SquidDocument {
|
|
18
|
-
__docId__: DocId;
|
|
19
|
-
__ts__: DocTimestamp;
|
|
20
|
-
[fieldName: string]: FieldType | undefined;
|
|
21
|
-
}
|
|
22
|
-
/** The before and after documents of a document change. */
|
|
23
|
-
export interface BeforeAndAfterDocs<T = SquidDocument> {
|
|
24
|
-
before: T | undefined;
|
|
25
|
-
after: T | undefined;
|
|
26
|
-
}
|
|
27
|
-
/** The full document id, including the collection name and the integration id. */
|
|
28
|
-
export interface SquidDocIdObj {
|
|
29
|
-
collectionName: CollectionName;
|
|
30
|
-
docId: DocId;
|
|
31
|
-
integrationId: IntegrationId;
|
|
32
|
-
}
|
|
@@ -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
|
-
}
|