@squidcloud/client 1.0.73 → 1.0.74

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,3 +1,4 @@
1
+ import { AppId, ClientId } from './communication.types';
1
2
  export type AuthType = 'Bearer' | 'ApiKey';
2
3
  /**
3
4
  * The payload of a JWT token in case an auth token was used.
@@ -22,11 +23,18 @@ export interface AuthToken {
22
23
  token: string;
23
24
  integrationId?: string;
24
25
  }
25
- /**
26
- * The context of a request to a service.
27
- */
26
+ /** The context of a request to a service. */
28
27
  export interface RunContext {
29
- appId: string;
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. */
30
37
  sourceIp?: string;
38
+ /** The headers of the request. */
31
39
  headers?: Record<string, any>;
32
40
  }
@@ -14,6 +14,13 @@ export interface CognitoIntegrationConfig extends BaseIntegrationConfig {
14
14
  appClientId: string;
15
15
  };
16
16
  }
17
+ export interface OktaIntegrationConfig extends BaseIntegrationConfig {
18
+ type: IntegrationType.okta;
19
+ configuration: {
20
+ domain: string;
21
+ clientId: string;
22
+ };
23
+ }
17
24
  export interface JwtRsaIntegrationConfig extends BaseIntegrationConfig {
18
25
  type: IntegrationType.jwt_rsa;
19
26
  configuration: {
@@ -6,7 +6,7 @@ export * from './observability.types';
6
6
  import { IntegrationId } from '../communication.types';
7
7
  import { AiAssistantIntegrationConfig } from './ai_assistant.types';
8
8
  import { GraphQLIntegrationConfig, HttpApiIntegrationConfig, TestGraphQLDataConnectionRequest } from './api.types';
9
- import { Auth0IntegrationConfig, CognitoIntegrationConfig, JwtHmacIntegrationConfig, JwtRsaIntegrationConfig } from './auth.types';
9
+ import { Auth0IntegrationConfig, CognitoIntegrationConfig, JwtHmacIntegrationConfig, JwtRsaIntegrationConfig, OktaIntegrationConfig } from './auth.types';
10
10
  import { BaseDatabaseIntegrationConfig, CockroachIntegrationConfig, InternalIntegrationConfig, MongoIntegrationConfig, MssqlIntegrationConfig, MySqlIntegrationConfig, OracleIntegrationConfig, PostgresIntegrationConfig, SnowflakeIntegrationConfig, TestDataConnectionRequest } from './database.types';
11
11
  import { DatadogIntegrationConfig, NewRelicIntegrationConfig } from './observability.types';
12
12
  export declare enum IntegrationCategory {
@@ -34,6 +34,7 @@ export declare enum IntegrationType {
34
34
  'jwt_hmac' = "jwt_hmac",
35
35
  'ai_assistant' = "ai_assistant",
36
36
  'cognito' = "cognito",
37
+ 'okta' = "okta",
37
38
  'algolia' = "algolia",
38
39
  'elastic_observability' = "elastic_observability",
39
40
  'elastic_search' = "elastic_search",
@@ -72,13 +73,14 @@ export interface IntegrationConfigTypes {
72
73
  [IntegrationType.jwt_hmac]: JwtHmacIntegrationConfig;
73
74
  [IntegrationType.ai_assistant]: AiAssistantIntegrationConfig;
74
75
  [IntegrationType.cognito]: CognitoIntegrationConfig;
76
+ [IntegrationType.okta]: OktaIntegrationConfig;
75
77
  }
76
78
  export declare const DatabaseIntegrationTypes: readonly [IntegrationType.built_in_db, IntegrationType.mongo, IntegrationType.mysql, IntegrationType.mssql, IntegrationType.postgres, IntegrationType.cockroach, IntegrationType.snowflake, IntegrationType.oracledb];
77
79
  export type DatabaseIntegrationType = (typeof DatabaseIntegrationTypes)[number];
78
80
  export type DatabaseIntegrationConfig = IntegrationConfigTypes[DatabaseIntegrationType];
79
81
  export declare const ApiIntegrationTypes: readonly [IntegrationType.api, IntegrationType.graphql];
80
82
  export declare const ObservabilityIntegrationTypes: readonly [IntegrationType.datadog, IntegrationType.newrelic];
81
- export declare const AuthIntegrationTypes: readonly [IntegrationType.auth0, IntegrationType.jwt_rsa, IntegrationType.jwt_hmac, IntegrationType.cognito];
83
+ export declare const AuthIntegrationTypes: readonly [IntegrationType.auth0, IntegrationType.jwt_rsa, IntegrationType.jwt_hmac, IntegrationType.cognito, IntegrationType.okta];
82
84
  export type ApiIntegrationType = (typeof ApiIntegrationTypes)[number];
83
85
  export type ApiIntegrationConfig = IntegrationConfigTypes[ApiIntegrationType];
84
86
  export type ObservabilityIntegrationType = (typeof ObservabilityIntegrationTypes)[number];
@@ -1,5 +1,5 @@
1
- import { Mutation, MutationType } from './mutation.types';
2
1
  import { BeforeAndAfterDocs } from './document.types';
2
+ import { Mutation, MutationType } from './mutation.types';
3
3
  import { Paths } from './types';
4
4
  /** The mutation context that will be provided to the security function. */
5
5
  export declare class MutationContext<T = any> {
@@ -7,6 +7,8 @@ export declare class MutationContext<T = any> {
7
7
  readonly beforeAndAfterDocs: BeforeAndAfterDocs<T>;
8
8
  readonly serverTimeStamp: Date;
9
9
  getMutationType(): MutationType;
10
+ get before(): T | undefined;
11
+ get after(): T | undefined;
10
12
  /** Returns true if the mutation affects the provided path. */
11
13
  affectsPath(path: Paths<T>): boolean;
12
14
  }
@@ -1,4 +1,4 @@
1
- import { ClientId, ClientRequestId } from './communication.types';
1
+ import { ClientRequestId } from './communication.types';
2
2
  import { CollectionName, FieldName } from './document.types';
3
3
  /** A list of query conditions. */
4
4
  export type Conditions<Doc = any, F extends FieldName<Doc> = any> = Array<Condition<Doc, F>>;
@@ -50,7 +50,6 @@ export interface Query<Doc = any> {
50
50
  limit: number;
51
51
  }
52
52
  export interface QueryRegisterRequest {
53
- clientId: ClientId;
54
53
  clientRequestId: ClientRequestId;
55
54
  query: Query;
56
55
  parentClientRequestId: ClientRequestId;
@@ -1,6 +1,6 @@
1
1
  export declare function normalizeJsonAsString(json: any): string;
2
2
  export declare function serializeObj(obj: any): string;
3
- export declare function deserializeObj<T = any>(serializedObj: string): T;
3
+ export declare function deserializeObj<T = any>(str: string): T;
4
4
  export declare function encodeValueForMapping(value: any): string;
5
5
  export declare function decodeValueForMapping(encodedString: string): any;
6
6
  export declare function recodeValue(value: any): any;