@permute/sdk 0.1.0

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.
@@ -0,0 +1,17 @@
1
+ export * from './types.js';
2
+ export * from './client.js';
3
+ export declare const CONTEXT: {
4
+ readonly QuickBooks: "quickbooks";
5
+ readonly HubSpot: "hubspot";
6
+ readonly Attio: "attio";
7
+ readonly BigQuery: "bigquery";
8
+ readonly Billcom: "billcom";
9
+ readonly Brex: "brex";
10
+ readonly Double: "double";
11
+ readonly Fireflies: "fireflies";
12
+ readonly Klaviyo: "klaviyo";
13
+ readonly Mercury: "mercury";
14
+ readonly Monday: "monday";
15
+ readonly Stripe: "stripe";
16
+ readonly Xero: "xero";
17
+ };
package/dist/index.js ADDED
@@ -0,0 +1,17 @@
1
+ export * from './types.js';
2
+ export * from './client.js';
3
+ export const CONTEXT = {
4
+ QuickBooks: 'quickbooks',
5
+ HubSpot: 'hubspot',
6
+ Attio: 'attio',
7
+ BigQuery: 'bigquery',
8
+ Billcom: 'billcom',
9
+ Brex: 'brex',
10
+ Double: 'double',
11
+ Fireflies: 'fireflies',
12
+ Klaviyo: 'klaviyo',
13
+ Mercury: 'mercury',
14
+ Monday: 'monday',
15
+ Stripe: 'stripe',
16
+ Xero: 'xero',
17
+ };
@@ -0,0 +1,56 @@
1
+ import type { components } from './generated/openapi.js';
2
+ type PublicApiSchema<Name extends keyof components['schemas']> = components['schemas'][Name];
3
+ export type Workspace = PublicApiSchema<'Workspace'>;
4
+ export type WorkspaceList = PublicApiSchema<'WorkspaceList'>;
5
+ export type WorkspaceCreateRequest = PublicApiSchema<'WorkspaceCreateRequest'>;
6
+ export type WorkspaceUpdateRequest = PublicApiSchema<'WorkspaceUpdateRequest'>;
7
+ export type WorkspaceDeleteResponse = PublicApiSchema<'WorkspaceDeleteResponse'>;
8
+ export type Source = PublicApiSchema<'Source'>;
9
+ export type SourceList = PublicApiSchema<'SourceList'>;
10
+ export type SourceDetail = PublicApiSchema<'SourceDetail'>;
11
+ export type CatalogField = PublicApiSchema<'CatalogField'>;
12
+ export type CatalogTable = PublicApiSchema<'CatalogTable'>;
13
+ type DatasetApiCreateRequest = PublicApiSchema<'DatasetCreateRequest'>;
14
+ export type DatasetResponse = PublicApiSchema<'DatasetResponse'>;
15
+ export type CustomDatasetResponse = PublicApiSchema<'CustomDatasetResponse'>;
16
+ export type FileDatasetResponse = PublicApiSchema<'FileDatasetResponse'>;
17
+ export type DatasetUploadBody = string | Blob | ArrayBuffer | ArrayBufferView;
18
+ export type CustomDatasetCreateRequest = Extract<DatasetApiCreateRequest, {
19
+ type: 'custom';
20
+ }>;
21
+ export type FileDatasetCreateRequest = Omit<Extract<DatasetApiCreateRequest, {
22
+ type: 'file';
23
+ }>, 'sizeBytes'> & {
24
+ data: DatasetUploadBody;
25
+ sizeBytes?: number;
26
+ headers?: Record<string, string>;
27
+ };
28
+ export type DatasetCreateRequest = CustomDatasetCreateRequest | FileDatasetCreateRequest;
29
+ export type DatasetWriteTablesRequest = PublicApiSchema<'DatasetWriteTablesRequest'>;
30
+ export type DatasetWriteTablesResponse = PublicApiSchema<'DatasetWriteTablesResponse'>;
31
+ export type DatasetRows = Record<string, unknown>[];
32
+ export type SearchRequest = PublicApiSchema<'SearchRequest'>;
33
+ export type SearchResult = PublicApiSchema<'SearchResult'>;
34
+ export type SearchResponse = PublicApiSchema<'SearchResponse'>;
35
+ export type AnswerRequest = PublicApiSchema<'AnswerRequest'>;
36
+ export type AnswerCitation = PublicApiSchema<'AnswerCitation'>;
37
+ export type AnswerConfidence = PublicApiSchema<'AnswerConfidence'>;
38
+ export type AnswerResponse = PublicApiSchema<'AnswerResponse'>;
39
+ export type AnswerJobResponse = PublicApiSchema<'AnswerJobResponse'>;
40
+ export type QueryRequest = PublicApiSchema<'QueryRequest'>;
41
+ export type QueryResponse = PublicApiSchema<'QueryResponse'>;
42
+ export interface PermuteRequestOptions {
43
+ workspaceId?: string;
44
+ headers?: Record<string, string>;
45
+ signal?: AbortSignal;
46
+ /** Maximum time to wait for a durable operation. Defaults to 20 minutes. */
47
+ pollTimeoutMs?: number;
48
+ }
49
+ export interface PermuteClientOptions {
50
+ apiKey: string;
51
+ baseUrl?: string;
52
+ workspaceId?: string;
53
+ fetch?: typeof fetch;
54
+ headers?: Record<string, string>;
55
+ }
56
+ export {};
package/dist/types.js ADDED
@@ -0,0 +1 @@
1
+ export {};
package/package.json ADDED
@@ -0,0 +1,57 @@
1
+ {
2
+ "name": "@permute/sdk",
3
+ "version": "0.1.0",
4
+ "description": "TypeScript client for the Permute public API",
5
+ "type": "module",
6
+ "license": "Apache-2.0",
7
+ "author": "Permute, Inc. <info@permute.ai>",
8
+ "homepage": "https://permute.ai",
9
+ "keywords": [
10
+ "permute",
11
+ "analytics",
12
+ "data",
13
+ "sdk"
14
+ ],
15
+ "files": [
16
+ "dist",
17
+ "README.md",
18
+ "LICENSE"
19
+ ],
20
+ "main": "./dist/index.js",
21
+ "types": "./dist/index.d.ts",
22
+ "sideEffects": false,
23
+ "engines": {
24
+ "node": ">=20"
25
+ },
26
+ "exports": {
27
+ ".": {
28
+ "types": "./dist/index.d.ts",
29
+ "import": "./dist/index.js",
30
+ "default": "./dist/index.js"
31
+ }
32
+ },
33
+ "publishConfig": {
34
+ "access": "public"
35
+ },
36
+ "scripts": {
37
+ "build": "bun run scripts/build.ts",
38
+ "generate": "bun run scripts/generate-contract.ts",
39
+ "prepack": "bun run build",
40
+ "prepublishOnly": "bun run verify:package",
41
+ "verify:package": "bun run scripts/verify-package.ts",
42
+ "test": "bun run generate && vitest --run",
43
+ "test:live": "bun run scripts/run-live-scope-test.ts",
44
+ "typecheck": "bun run scripts/typecheck.ts"
45
+ },
46
+ "dependencies": {
47
+ "ajv": "^8.20.0"
48
+ },
49
+ "devDependencies": {
50
+ "@types/bun": "1.3.13",
51
+ "@types/node": "^24",
52
+ "openapi-typescript": "^7.13.0",
53
+ "prettier": "3.6.2",
54
+ "typescript": "^5.9.3",
55
+ "vitest": "^4.1.6"
56
+ }
57
+ }