@squidcloud/client 1.0.145 → 1.0.146-beta
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 +1 -53942
- package/dist/esm/index.js +1 -0
- package/dist/internal-common/src/metric-name.d.ts +9 -0
- package/dist/internal-common/src/public-types/ai-agent-integrations.public-types.d.ts +47 -0
- package/dist/internal-common/src/public-types/ai-agent.public-types.d.ts +895 -0
- package/dist/internal-common/src/public-types/ai-assistant.public-types.d.ts +31 -0
- package/dist/internal-common/src/public-types/ai-common.public-types.d.ts +185 -0
- package/dist/internal-common/src/public-types/ai-knowledge-base.public-types.d.ts +431 -0
- package/dist/internal-common/src/public-types/ai-matchmaking.public-types.d.ts +186 -0
- package/dist/internal-common/src/public-types/ai-query.public-types.d.ts +170 -0
- package/dist/internal-common/src/public-types/api-client.public-types.d.ts +9 -0
- package/dist/internal-common/src/public-types/api.public-types.d.ts +91 -0
- package/dist/internal-common/src/public-types/backend.public-types.d.ts +50 -0
- package/dist/{common/src/backend-function.schemas.d.ts → internal-common/src/public-types/code-executor.public-types.d.ts} +1 -1
- package/dist/internal-common/src/public-types/communication.public-types.d.ts +30 -0
- package/dist/internal-common/src/public-types/context.public-types.d.ts +83 -0
- package/dist/internal-common/src/public-types/document.public-types.d.ts +71 -0
- package/dist/internal-common/src/public-types/external-auth/external-auth.public-types.d.ts +39 -0
- package/dist/internal-common/src/public-types/extraction.public-types.d.ts +183 -0
- package/dist/internal-common/src/public-types/http-status.public-types.d.ts +415 -0
- package/dist/internal-common/src/public-types/integration.public-types.d.ts +51 -0
- package/dist/internal-common/src/public-types/job.public-types.d.ts +59 -0
- package/dist/internal-common/src/public-types/metric.public-types.d.ts +154 -0
- package/dist/internal-common/src/public-types/openapi.public-types.d.ts +9 -0
- package/dist/internal-common/src/public-types/query.public-types.d.ts +113 -0
- package/dist/internal-common/src/public-types/regions.public-types.d.ts +4 -0
- package/dist/internal-common/src/public-types/scheduler.public-types.d.ts +43 -0
- package/dist/{common/src/schema/schema.types.d.ts → internal-common/src/public-types/schema.public-types.d.ts} +54 -54
- package/dist/internal-common/src/public-types/secret.public-types.d.ts +51 -0
- package/dist/internal-common/src/public-types/serialized-query.public-types.d.ts +60 -0
- package/dist/internal-common/src/public-types/socket.public-types.d.ts +4 -0
- package/dist/{common/src/types.d.ts → internal-common/src/public-types/typescript.public-types.d.ts} +20 -14
- package/dist/internal-common/src/public-types/web.public-types.d.ts +93 -0
- package/dist/internal-common/src/public-types-backend/api-call.public-context.d.ts +30 -0
- package/dist/internal-common/src/public-types-backend/mutation.public-context.d.ts +148 -0
- package/dist/internal-common/src/public-types-backend/native-query.public-context.d.ts +72 -0
- package/dist/{common/src/query/query-context.d.ts → internal-common/src/public-types-backend/query.public-context.d.ts} +177 -137
- package/dist/{common/src/ai-chatbot.schemas.d.ts → internal-common/src/public-utils/context-utils.d.ts} +1 -1
- package/dist/internal-common/src/public-utils/id-utils.d.ts +44 -0
- package/dist/internal-common/src/types/ai-agent.types.d.ts +199 -0
- package/dist/{common/src/mutation.schemas.d.ts → internal-common/src/types/ai-assistant.types.d.ts} +1 -1
- package/dist/internal-common/src/types/ai-knowledge-base.types.d.ts +202 -0
- package/dist/internal-common/src/types/ai-matchmaking.types.d.ts +59 -0
- package/dist/{common/src → internal-common/src/types}/backend-function.types.d.ts +1 -1
- package/dist/internal-common/src/types/communication.types.d.ts +1 -0
- package/dist/internal-common/src/types/document.types.d.ts +1 -0
- package/dist/internal-common/src/types/file.types.d.ts +6 -0
- package/dist/internal-common/src/types/headers.types.d.ts +17 -0
- package/dist/internal-common/src/types/mutation.types.d.ts +1 -0
- package/dist/internal-common/src/types/notification.types.d.ts +5 -0
- package/dist/internal-common/src/types/observability.types.d.ts +78 -0
- package/dist/internal-common/src/types/query.types.d.ts +13 -0
- package/dist/internal-common/src/types/secret.types.d.ts +7 -0
- package/dist/internal-common/src/types/socket.types.d.ts +1 -0
- package/dist/internal-common/src/types/stage.d.ts +9 -0
- package/dist/{common/src → internal-common/src/types}/time-units.d.ts +1 -1
- package/dist/internal-common/src/types/url-shortener.types.d.ts +41 -0
- package/dist/internal-common/src/utils/array.d.ts +7 -0
- package/dist/internal-common/src/utils/e2e-test-utils.d.ts +2 -0
- package/dist/{common → internal-common}/src/utils/global.utils.d.ts +1 -1
- package/dist/internal-common/src/utils/http.d.ts +5 -0
- package/dist/{common → internal-common}/src/utils/lock.manager.d.ts +14 -14
- package/dist/internal-common/src/utils/metric-utils.d.ts +4 -0
- package/dist/internal-common/src/utils/metrics.types.d.ts +7 -0
- package/dist/internal-common/src/utils/object.d.ts +58 -0
- package/dist/internal-common/src/utils/serialization.d.ts +17 -0
- package/dist/internal-common/src/utils/squid.constants.d.ts +1 -0
- package/dist/internal-common/src/utils/trace-id-generator.d.ts +1 -0
- package/dist/internal-common/src/utils/validation.d.ts +19 -0
- package/dist/{common → internal-common}/src/websocket.impl.d.ts +26 -21
- package/dist/node_modules/json-schema-typed/draft-2020-12.d.ts +1239 -1239
- package/dist/typescript-client/src/admin-client.d.ts +23 -0
- package/dist/typescript-client/src/agent/ai-agent-client-reference.d.ts +181 -0
- package/dist/typescript-client/src/agent/ai-agent-client.d.ts +37 -0
- package/dist/typescript-client/src/agent/ai-agent-client.types.d.ts +69 -0
- package/dist/typescript-client/src/ai-assistant-client.d.ts +72 -73
- package/dist/typescript-client/src/ai-audio-client.d.ts +25 -0
- package/dist/typescript-client/src/ai-client.d.ts +129 -0
- package/dist/typescript-client/src/ai-files-client.d.ts +33 -0
- package/dist/typescript-client/src/ai-image-client.d.ts +25 -0
- package/dist/typescript-client/src/ai-knowledge-base/ai-knowledge-base-client-reference.d.ts +86 -0
- package/dist/typescript-client/src/ai-knowledge-base/ai-knowledge-base-client.d.ts +28 -0
- package/dist/typescript-client/src/ai-matchmaking-client.d.ts +99 -0
- package/dist/typescript-client/src/api-client.d.ts +69 -0
- package/dist/typescript-client/src/auth.manager.d.ts +11 -26
- package/dist/typescript-client/src/backend-function.manager.d.ts +1 -9
- package/dist/typescript-client/src/client-customization.utils.d.ts +1 -0
- package/dist/typescript-client/src/client-id.service.d.ts +1 -27
- package/dist/typescript-client/src/collection-reference.d.ts +105 -80
- package/dist/typescript-client/src/collection-reference.factory.d.ts +1 -13
- package/dist/typescript-client/src/connection-details.d.ts +24 -23
- package/dist/typescript-client/src/console-utils.d.ts +1 -0
- package/dist/typescript-client/src/data.manager.d.ts +1 -173
- package/dist/typescript-client/src/destruct.manager.d.ts +1 -12
- package/dist/typescript-client/src/distributed-lock.manager.d.ts +39 -16
- package/dist/typescript-client/src/document-identity.service.d.ts +1 -12
- package/dist/typescript-client/src/document-reference.d.ts +151 -140
- package/dist/typescript-client/src/document-reference.factory.d.ts +1 -13
- package/dist/typescript-client/src/document-store.d.ts +1 -14
- package/dist/typescript-client/src/execute-function-options.d.ts +73 -0
- package/dist/typescript-client/src/external-auth-client.d.ts +36 -0
- package/dist/typescript-client/src/extraction-client.d.ts +32 -0
- package/dist/typescript-client/src/file-args-transformer.d.ts +1 -0
- package/dist/typescript-client/src/file-utils.d.ts +1 -0
- package/dist/typescript-client/src/index.d.ts +63 -9
- package/dist/typescript-client/src/integration-client.d.ts +60 -0
- package/dist/typescript-client/src/job-client.d.ts +32 -0
- package/dist/typescript-client/src/mutation/mutation-sender.d.ts +1 -10
- package/dist/typescript-client/src/native-query-manager.d.ts +1 -7
- package/dist/typescript-client/src/notification-client.d.ts +20 -0
- package/dist/typescript-client/src/observability-client.d.ts +43 -0
- package/dist/typescript-client/src/public-types.d.ts +30 -0
- package/dist/typescript-client/src/public-utils.d.ts +1 -0
- package/dist/typescript-client/src/query/deserializer.d.ts +10 -3
- package/dist/typescript-client/src/query/join-query-builder.factory.d.ts +316 -161
- package/dist/typescript-client/src/query/local-query-manager.d.ts +1 -9
- package/dist/{common → typescript-client}/src/query/pagination.d.ts +65 -62
- package/dist/typescript-client/src/query/query-builder.factory.d.ts +228 -77
- package/dist/typescript-client/src/query/query-sender.d.ts +1 -33
- package/dist/typescript-client/src/query/query-subscription.manager.d.ts +1 -130
- package/dist/typescript-client/src/query/query.types.d.ts +16 -49
- package/dist/typescript-client/src/query/snapshot-emitter.d.ts +41 -0
- package/dist/typescript-client/src/query-utils.d.ts +18 -0
- package/dist/typescript-client/src/queue.manager.d.ts +12 -0
- package/dist/typescript-client/src/rate-limiter.d.ts +1 -32
- package/dist/typescript-client/src/rpc.manager.d.ts +1 -30
- package/dist/typescript-client/src/scheduler-client.d.ts +31 -0
- package/dist/typescript-client/src/secret.client.d.ts +96 -22
- package/dist/typescript-client/src/socket.manager.d.ts +1 -43
- package/dist/typescript-client/src/squid-http-client.d.ts +11 -0
- package/dist/typescript-client/src/squid.d.ts +378 -269
- package/dist/typescript-client/src/state/state.service.spec.d.ts +1 -1
- package/dist/typescript-client/src/storage-client.d.ts +145 -0
- package/dist/typescript-client/src/types.d.ts +27 -2
- package/dist/typescript-client/src/version.d.ts +5 -0
- package/dist/typescript-client/src/web-client.d.ts +63 -0
- package/dist/typescript-client/src/webhook.manager.d.ts +10 -0
- package/package.json +34 -18
- package/dist/common/src/ai-assistant.types.d.ts +0 -25
- package/dist/common/src/ai-chatbot.context.d.ts +0 -12
- package/dist/common/src/ai-chatbot.types.d.ts +0 -27
- package/dist/common/src/api-call.context.d.ts +0 -13
- package/dist/common/src/api.types.d.ts +0 -4
- package/dist/common/src/application.schemas.d.ts +0 -66
- package/dist/common/src/application.types.d.ts +0 -143
- package/dist/common/src/backend-run.types.d.ts +0 -2
- package/dist/common/src/bundle-api.types.d.ts +0 -43
- package/dist/common/src/bundle-data.types.d.ts +0 -5
- package/dist/common/src/communication.types.d.ts +0 -8
- package/dist/common/src/context.types.d.ts +0 -40
- package/dist/common/src/distributed-lock.context.d.ts +0 -4
- package/dist/common/src/document.types.d.ts +0 -22
- package/dist/common/src/graphql.context.d.ts +0 -7
- package/dist/common/src/graphql.types.d.ts +0 -9
- package/dist/common/src/heartbeat.types.d.ts +0 -1
- package/dist/common/src/http-status.enum.d.ts +0 -50
- package/dist/common/src/index.d.ts +0 -57
- package/dist/common/src/integrations/ai_chatbot.types.d.ts +0 -31
- package/dist/common/src/integrations/api.types.d.ts +0 -80
- package/dist/common/src/integrations/auth.types.d.ts +0 -47
- package/dist/common/src/integrations/database.types.d.ts +0 -274
- package/dist/common/src/integrations/index.d.ts +0 -134
- package/dist/common/src/integrations/observability.types.d.ts +0 -23
- package/dist/common/src/logger.types.d.ts +0 -21
- package/dist/common/src/metrics.types.d.ts +0 -1
- package/dist/common/src/mutation.context.d.ts +0 -14
- package/dist/common/src/mutation.types.d.ts +0 -53
- package/dist/common/src/named-query.context.d.ts +0 -4
- package/dist/common/src/named-query.schemas.d.ts +0 -1
- package/dist/common/src/named-query.types.d.ts +0 -1
- package/dist/common/src/native-query.context.d.ts +0 -7
- package/dist/common/src/native-query.types.d.ts +0 -16
- package/dist/common/src/query/base-query-builder.d.ts +0 -147
- package/dist/common/src/query/index.d.ts +0 -4
- package/dist/common/src/query/serialized-query.types.d.ts +0 -24
- package/dist/common/src/query.types.d.ts +0 -64
- package/dist/common/src/regions.d.ts +0 -1
- package/dist/common/src/secret.schemas.d.ts +0 -1
- package/dist/common/src/secret.types.d.ts +0 -22
- package/dist/common/src/security.types.d.ts +0 -1
- package/dist/common/src/socket.schemas.d.ts +0 -1
- package/dist/common/src/socket.types.d.ts +0 -5
- package/dist/common/src/trigger.types.d.ts +0 -1
- package/dist/common/src/utils/array.d.ts +0 -1
- package/dist/common/src/utils/assert.d.ts +0 -1
- package/dist/common/src/utils/error.d.ts +0 -4
- package/dist/common/src/utils/http.d.ts +0 -2
- package/dist/common/src/utils/id.d.ts +0 -2
- package/dist/common/src/utils/object.d.ts +0 -5
- package/dist/common/src/utils/serialization.d.ts +0 -6
- package/dist/common/src/utils/transforms.d.ts +0 -18
- package/dist/common/src/utils/url.d.ts +0 -1
- package/dist/common/src/utils/validation.d.ts +0 -25
- package/dist/common/src/webhook-response.d.ts +0 -1
- 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 -61
- package/dist/typescript-client/src/api.manager.d.ts +0 -11
- 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/named-query.manager.d.ts +0 -11
- package/dist/typescript-client/src/state/action.applier.d.ts +0 -7
- package/dist/typescript-client/src/state/actions.d.ts +0 -29
- package/dist/typescript-client/src/state/path_trie.d.ts +0 -27
- package/dist/typescript-client/src/state/state.service.d.ts +0 -22
- package/dist/typescript-client/src/testing/setup-tests.d.ts +0 -1
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { IntegrationId } from './communication.public-types';
|
|
2
|
+
/**
|
|
3
|
+
* Represents a primitive data type used in database fields.
|
|
4
|
+
* @category Database
|
|
5
|
+
*/
|
|
6
|
+
export type PrimitiveFieldType = string | number | boolean | null | Date;
|
|
7
|
+
/**
|
|
8
|
+
* Represents a recursive field type structure for database documents, including primitives, arrays, and nested objects.
|
|
9
|
+
* @category Database
|
|
10
|
+
*/
|
|
11
|
+
export type FieldType = PrimitiveFieldType | Array<FieldType> | {
|
|
12
|
+
[key: string]: FieldType;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* A type alias for a field name.
|
|
16
|
+
* @category Database
|
|
17
|
+
*/
|
|
18
|
+
export type FieldName<T = any> = string & keyof T;
|
|
19
|
+
/**
|
|
20
|
+
* A type alias for a document id as string.
|
|
21
|
+
* @category Database
|
|
22
|
+
*/
|
|
23
|
+
export type DocId = string;
|
|
24
|
+
/**
|
|
25
|
+
* A type alias for a document id object when the ID is a composite of primary keys.
|
|
26
|
+
* @category Database
|
|
27
|
+
*/
|
|
28
|
+
export type DocIdObj = Record<FieldName, any>;
|
|
29
|
+
/**
|
|
30
|
+
* A type alias for a document id or a document id object.
|
|
31
|
+
* @category Database
|
|
32
|
+
*/
|
|
33
|
+
export type DocIdOrDocIdObj = DocId | DocIdObj;
|
|
34
|
+
/**
|
|
35
|
+
* A type alias for a collection name.
|
|
36
|
+
* @category Database
|
|
37
|
+
*/
|
|
38
|
+
export type CollectionName = string;
|
|
39
|
+
/**
|
|
40
|
+
* A generic document data type.
|
|
41
|
+
* @category Database
|
|
42
|
+
*/
|
|
43
|
+
export type DocumentData = Record<FieldName, any | undefined>;
|
|
44
|
+
/**
|
|
45
|
+
* A type alias for timestamp field..
|
|
46
|
+
* @category Database
|
|
47
|
+
*/
|
|
48
|
+
export type DocTimestamp = number;
|
|
49
|
+
/**
|
|
50
|
+
* The structure of a Squid Document with metadata and dynamic fields.
|
|
51
|
+
* @category Database
|
|
52
|
+
*/
|
|
53
|
+
export interface SquidDocument {
|
|
54
|
+
[fieldName: string]: FieldType | undefined;
|
|
55
|
+
/** The unique identifier of the document. */
|
|
56
|
+
__docId__: DocId;
|
|
57
|
+
/** The timestamp of the document, typically in milliseconds. */
|
|
58
|
+
__ts__: DocTimestamp;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* The full document identifier, combining collection name, document ID, and integration ID.
|
|
62
|
+
* @category Database
|
|
63
|
+
*/
|
|
64
|
+
export interface SquidDocIdObj {
|
|
65
|
+
/** The name of the collection containing the document. */
|
|
66
|
+
collectionName: CollectionName;
|
|
67
|
+
/** The unique identifier of the document within the collection. */
|
|
68
|
+
docId: DocId;
|
|
69
|
+
/** The ID of the integration associated with the document. */
|
|
70
|
+
integrationId: IntegrationId;
|
|
71
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { IntegrationId } from '../communication.public-types';
|
|
2
|
+
/**
|
|
3
|
+
* Configuration for identifying a user's external auth connection.
|
|
4
|
+
* @category ExternalAuth
|
|
5
|
+
*/
|
|
6
|
+
export interface ExternalAuthConfig {
|
|
7
|
+
/** The integration ID (e.g., 'google-calendar', 'microsoft-teams'). */
|
|
8
|
+
integrationId: IntegrationId;
|
|
9
|
+
/** User-specific identifier to distinguish between different users' tokens. */
|
|
10
|
+
identifier: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Request to save an authorization code and exchange it for tokens.
|
|
14
|
+
* @category ExternalAuth
|
|
15
|
+
*/
|
|
16
|
+
export interface SaveAuthCodeRequest {
|
|
17
|
+
/** The authorization code from the auth provider. */
|
|
18
|
+
authCode: string;
|
|
19
|
+
/** Configuration identifying the user and integration. */
|
|
20
|
+
externalAuthConfig: ExternalAuthConfig;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Request to get a valid access token for an integration.
|
|
24
|
+
* @category ExternalAuth
|
|
25
|
+
*/
|
|
26
|
+
export interface GetAccessTokenRequest {
|
|
27
|
+
/** Configuration identifying the user and integration. */
|
|
28
|
+
externalAuthConfig: ExternalAuthConfig;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Response containing a valid access token and expiration time.
|
|
32
|
+
* @category ExternalAuth
|
|
33
|
+
*/
|
|
34
|
+
export interface GetAccessTokenResponse {
|
|
35
|
+
/** Valid access token for making API calls. */
|
|
36
|
+
accessToken: string;
|
|
37
|
+
/** When the access token expires. */
|
|
38
|
+
expirationTime: Date;
|
|
39
|
+
}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The extraction method to use for processing documents.
|
|
3
|
+
*/
|
|
4
|
+
export type DocumentExtractionMethod = 'mistral_ocr' | 'legacy';
|
|
5
|
+
/**
|
|
6
|
+
* Options for customizing how data is extracted from a document.
|
|
7
|
+
*/
|
|
8
|
+
export interface ExtractDataFromDocumentOptions {
|
|
9
|
+
/**
|
|
10
|
+
* Minimum width/height (in pixels) of images to extract. Smaller images will be ignored.
|
|
11
|
+
*/
|
|
12
|
+
imageMinSizePixels?: number;
|
|
13
|
+
/**
|
|
14
|
+
* Whether to extract embedded images from the document.
|
|
15
|
+
*/
|
|
16
|
+
extractImages?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Specific page indexes to extract from the document (0-based). If omitted, all pages are extracted.
|
|
19
|
+
*/
|
|
20
|
+
pageIndexes?: number[];
|
|
21
|
+
/**
|
|
22
|
+
* The preferred method for extracting data from the document.
|
|
23
|
+
*/
|
|
24
|
+
preferredExtractionMethod?: DocumentExtractionMethod;
|
|
25
|
+
/**
|
|
26
|
+
* Whether Squid keeps or discards the original file.
|
|
27
|
+
*
|
|
28
|
+
* Keeping the original file allows reprocessing and the ability for the user to download it later.
|
|
29
|
+
*
|
|
30
|
+
* Defaults to false.
|
|
31
|
+
*/
|
|
32
|
+
discardOriginalFile?: boolean;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Request payload for extracting data from a document via URL.
|
|
36
|
+
*/
|
|
37
|
+
export interface ExtractDataFromDocumentUrlRequest {
|
|
38
|
+
/**
|
|
39
|
+
* The publicly accessible URL pointing to the document file.
|
|
40
|
+
*/
|
|
41
|
+
url: string;
|
|
42
|
+
/**
|
|
43
|
+
* Optional parameters to control how the extraction is performed.
|
|
44
|
+
*/
|
|
45
|
+
options?: ExtractDataFromDocumentOptions;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Request payload for extracting data from a document file (uploaded directly).
|
|
49
|
+
*/
|
|
50
|
+
export interface ExtractDataFromDocumentFileRequest {
|
|
51
|
+
/**
|
|
52
|
+
* Optional parameters to control how the extraction is performed.
|
|
53
|
+
*/
|
|
54
|
+
options?: ExtractDataFromDocumentOptions;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Representation of an image extracted from a document, for use in generated content.
|
|
58
|
+
*/
|
|
59
|
+
export interface ExtractDataFromDocumentImage {
|
|
60
|
+
/**
|
|
61
|
+
* A unique identifier for the image.
|
|
62
|
+
*/
|
|
63
|
+
id: string;
|
|
64
|
+
/**
|
|
65
|
+
* A placeholder or marker in the content where this image should be inserted.
|
|
66
|
+
*/
|
|
67
|
+
textToReplaceInContent: string;
|
|
68
|
+
/**
|
|
69
|
+
* The base64-encoded image data, prefixed with its MIME type (e.g., data:image/png;base64,...).
|
|
70
|
+
*/
|
|
71
|
+
imageBase64Url: string;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* A single extracted page from the document, including structured content and images.
|
|
75
|
+
*/
|
|
76
|
+
export interface ExtractDataFromDocumentPage {
|
|
77
|
+
/**
|
|
78
|
+
* Optional title for the page (e.g., sheet name or section heading).
|
|
79
|
+
*/
|
|
80
|
+
title?: string;
|
|
81
|
+
/**
|
|
82
|
+
* Page index in the original document (0-based).
|
|
83
|
+
*/
|
|
84
|
+
index: number;
|
|
85
|
+
/**
|
|
86
|
+
* Extracted textual content or CSV representation of the page.
|
|
87
|
+
*/
|
|
88
|
+
content: string;
|
|
89
|
+
/**
|
|
90
|
+
* List of images extracted from this page.
|
|
91
|
+
*/
|
|
92
|
+
images: Array<ExtractDataFromDocumentImage>;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* The full result of extracting data from a document, including all pages and any extracted images.
|
|
96
|
+
*/
|
|
97
|
+
export interface ExtractDataFromDocumentResponse {
|
|
98
|
+
/**
|
|
99
|
+
* Array of pages containing extracted data.
|
|
100
|
+
*/
|
|
101
|
+
pages: Array<ExtractDataFromDocumentPage>;
|
|
102
|
+
/**
|
|
103
|
+
* Path to the original file in cloud storage, if applicable.
|
|
104
|
+
*/
|
|
105
|
+
longTermStoragePath?: string;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Create PDF request type.
|
|
109
|
+
*/
|
|
110
|
+
export type CreatePdfType = 'html' | 'url';
|
|
111
|
+
/** The type of output options to apply when creating a PDF document. */
|
|
112
|
+
export type CreatePdfOutputOptionsType = 'format' | 'dimensions';
|
|
113
|
+
/** Base interface for PDF output options. This is used to define the type of output options. */
|
|
114
|
+
export interface BaseCreatePdfOutputOptions {
|
|
115
|
+
/** The type of output options, either 'format' or 'dimensions'. */
|
|
116
|
+
type: CreatePdfOutputOptionsType;
|
|
117
|
+
}
|
|
118
|
+
/** Output options by format */
|
|
119
|
+
export interface CreatePdfOutputFormatOptions extends BaseCreatePdfOutputOptions {
|
|
120
|
+
/** The type of output options, always 'format' for this interface. */
|
|
121
|
+
type: 'format';
|
|
122
|
+
/** The type of formatting, always 'format' for this interface. */
|
|
123
|
+
format: 'letter' | 'legal' | 'tabloid' | 'ledger' | 'a0' | 'a1' | 'a2' | 'a3' | 'a4' | 'a5' | 'a6';
|
|
124
|
+
}
|
|
125
|
+
/** Output options by custom dimensions */
|
|
126
|
+
export interface CreatePdfOutputDimensionsOptions extends BaseCreatePdfOutputOptions {
|
|
127
|
+
/** The type of formatting, always 'dimensions' for this interface. */
|
|
128
|
+
type: 'dimensions';
|
|
129
|
+
/** The width of the PDF document in pixels. */
|
|
130
|
+
width: number;
|
|
131
|
+
/** The height of the PDF document in pixels. */
|
|
132
|
+
height: number;
|
|
133
|
+
}
|
|
134
|
+
/** Combined formatting options for creating a PDF document. */
|
|
135
|
+
export type CreatePdfOutputOptions = CreatePdfOutputFormatOptions | CreatePdfOutputDimensionsOptions;
|
|
136
|
+
/**
|
|
137
|
+
* Base request for creating a PDF document.
|
|
138
|
+
*/
|
|
139
|
+
export interface BaseCreatePdfRequest {
|
|
140
|
+
/**
|
|
141
|
+
* The type of PDF creation to perform, either from HTML or a URL.
|
|
142
|
+
*/
|
|
143
|
+
type: CreatePdfType;
|
|
144
|
+
/** The formatting options for the PDF document. Can be either a predefined format (like 'letter') or custom dimensions. */
|
|
145
|
+
outputOptions?: CreatePdfOutputOptions;
|
|
146
|
+
/** Optional title for the PDF document. */
|
|
147
|
+
title?: string;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Request payload for creating a PDF from a URL.
|
|
151
|
+
*/
|
|
152
|
+
export interface CreatePdfFromUrlRequest extends BaseCreatePdfRequest {
|
|
153
|
+
/** The type of PDF creation, always 'url' for this request. */
|
|
154
|
+
type: 'url';
|
|
155
|
+
/**
|
|
156
|
+
* The URL of the webpage to convert into a PDF.
|
|
157
|
+
*/
|
|
158
|
+
url: string;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Request payload for creating a PDF from HTML content.
|
|
162
|
+
*/
|
|
163
|
+
export interface CreatePdfFromHtmlRequest extends BaseCreatePdfRequest {
|
|
164
|
+
/** The type of PDF creation, always 'html' for this request. */
|
|
165
|
+
type: 'html';
|
|
166
|
+
/** The HTML content to convert into a PDF. Should not contain <html>, <body>, <head>, should just include the inner HTML */
|
|
167
|
+
innerHtml: string;
|
|
168
|
+
/** Optional URL for CSS styles to apply to the HTML content. */
|
|
169
|
+
cssUrl?: string;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Combined request type for creating a PDF, which can be either from a URL or HTML content.
|
|
173
|
+
*/
|
|
174
|
+
export type CreatePdfRequest = CreatePdfFromUrlRequest | CreatePdfFromHtmlRequest;
|
|
175
|
+
/**
|
|
176
|
+
* Response type for the PDF creation operation, containing the URL of the generated PDF.
|
|
177
|
+
*/
|
|
178
|
+
export interface CreatePdfResponse {
|
|
179
|
+
/** The publicly accessible URL where the generated PDF can be downloaded. */
|
|
180
|
+
url: string;
|
|
181
|
+
/** The generated filename. */
|
|
182
|
+
fileName?: string;
|
|
183
|
+
}
|