@talocode/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.
- package/LICENSE +21 -0
- package/README.md +65 -0
- package/dist/agent-browser.d.ts +11 -0
- package/dist/agent-browser.js +40 -0
- package/dist/agent-browser.js.map +1 -0
- package/dist/cliploop.d.ts +17 -0
- package/dist/cliploop.js +56 -0
- package/dist/cliploop.js.map +1 -0
- package/dist/codra.d.ts +12 -0
- package/dist/codra.js +47 -0
- package/dist/codra.js.map +1 -0
- package/dist/crawlerlane.d.ts +115 -0
- package/dist/crawlerlane.js +93 -0
- package/dist/crawlerlane.js.map +1 -0
- package/dist/errors.d.ts +24 -0
- package/dist/errors.js +58 -0
- package/dist/errors.js.map +1 -0
- package/dist/forgecad.d.ts +139 -0
- package/dist/forgecad.js +49 -0
- package/dist/forgecad.js.map +1 -0
- package/dist/index.d.ts +170 -0
- package/dist/index.js +178 -0
- package/dist/index.js.map +1 -0
- package/dist/invoicelane.d.ts +53 -0
- package/dist/invoicelane.js +45 -0
- package/dist/invoicelane.js.map +1 -0
- package/dist/opensourcelane.d.ts +135 -0
- package/dist/opensourcelane.js +101 -0
- package/dist/opensourcelane.js.map +1 -0
- package/dist/placeholders.d.ts +9 -0
- package/dist/placeholders.js +23 -0
- package/dist/placeholders.js.map +1 -0
- package/dist/replylane.d.ts +113 -0
- package/dist/replylane.js +83 -0
- package/dist/replylane.js.map +1 -0
- package/dist/request.d.ts +7 -0
- package/dist/request.js +77 -0
- package/dist/request.js.map +1 -0
- package/dist/router.d.ts +12 -0
- package/dist/router.js +44 -0
- package/dist/router.js.map +1 -0
- package/dist/signallane.d.ts +76 -0
- package/dist/signallane.js +45 -0
- package/dist/signallane.js.map +1 -0
- package/dist/skills.d.ts +19 -0
- package/dist/skills.js +48 -0
- package/dist/skills.js.map +1 -0
- package/dist/talocode.d.ts +51 -0
- package/dist/talocode.js +82 -0
- package/dist/talocode.js.map +1 -0
- package/dist/tera.d.ts +15 -0
- package/dist/tera.js +65 -0
- package/dist/tera.js.map +1 -0
- package/dist/types.d.ts +398 -0
- package/dist/types.js +4 -0
- package/dist/types.js.map +1 -0
- package/dist/ugclane.d.ts +105 -0
- package/dist/ugclane.js +93 -0
- package/dist/ugclane.js.map +1 -0
- package/dist/webdatalane.d.ts +74 -0
- package/dist/webdatalane.js +63 -0
- package/dist/webdatalane.js.map +1 -0
- package/package.json +49 -0
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { TalocodeApiClient } from './talocode.js';
|
|
2
|
+
export interface ForgeCADDimensions {
|
|
3
|
+
length?: number;
|
|
4
|
+
width?: number;
|
|
5
|
+
height?: number;
|
|
6
|
+
thickness?: number;
|
|
7
|
+
unit?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ForgeCADGenerateDesignInput {
|
|
10
|
+
projectType: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
dimensions?: ForgeCADDimensions;
|
|
13
|
+
manufacturingMethod?: string;
|
|
14
|
+
material?: string;
|
|
15
|
+
requirements?: string[];
|
|
16
|
+
constraints?: Record<string, unknown>;
|
|
17
|
+
}
|
|
18
|
+
export interface ForgeCADOpenScadInput {
|
|
19
|
+
projectType: string;
|
|
20
|
+
dimensions?: ForgeCADDimensions;
|
|
21
|
+
features?: string[];
|
|
22
|
+
manufacturingMethod?: string;
|
|
23
|
+
material?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface ForgeCADBomInput {
|
|
26
|
+
projectType?: string;
|
|
27
|
+
parts?: Array<{
|
|
28
|
+
name: string;
|
|
29
|
+
quantity?: number;
|
|
30
|
+
}>;
|
|
31
|
+
fasteners?: string[];
|
|
32
|
+
material?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface ForgeCADCutListInput {
|
|
35
|
+
projectType?: string;
|
|
36
|
+
dimensions?: ForgeCADDimensions;
|
|
37
|
+
material?: string;
|
|
38
|
+
members?: Array<{
|
|
39
|
+
name: string;
|
|
40
|
+
length?: number;
|
|
41
|
+
width?: number;
|
|
42
|
+
quantity?: number;
|
|
43
|
+
}>;
|
|
44
|
+
}
|
|
45
|
+
export interface ForgeCADAssemblyInput {
|
|
46
|
+
projectType?: string;
|
|
47
|
+
parts?: Array<{
|
|
48
|
+
name: string;
|
|
49
|
+
}>;
|
|
50
|
+
design?: Record<string, unknown>;
|
|
51
|
+
}
|
|
52
|
+
export interface ForgeCADPrintabilityInput {
|
|
53
|
+
manufacturingMethod?: string;
|
|
54
|
+
material?: string;
|
|
55
|
+
dimensions?: ForgeCADDimensions;
|
|
56
|
+
features?: string[];
|
|
57
|
+
constraints?: Record<string, unknown>;
|
|
58
|
+
}
|
|
59
|
+
export interface ForgeCADManufacturabilityInput {
|
|
60
|
+
manufacturingMethod?: string;
|
|
61
|
+
material?: string;
|
|
62
|
+
dimensions?: ForgeCADDimensions;
|
|
63
|
+
features?: string[];
|
|
64
|
+
}
|
|
65
|
+
export interface ForgeCADReviewInput {
|
|
66
|
+
design?: Record<string, unknown>;
|
|
67
|
+
requirements?: string[];
|
|
68
|
+
manufacturingMethod?: string;
|
|
69
|
+
}
|
|
70
|
+
export interface ForgeCADMaterialInput {
|
|
71
|
+
projectType?: string;
|
|
72
|
+
dimensions?: ForgeCADDimensions;
|
|
73
|
+
material?: string;
|
|
74
|
+
manufacturingMethod?: string;
|
|
75
|
+
}
|
|
76
|
+
export interface ForgeCADRenderInput {
|
|
77
|
+
code: string;
|
|
78
|
+
format?: string;
|
|
79
|
+
filename?: string;
|
|
80
|
+
}
|
|
81
|
+
export interface ForgeCADExportInput {
|
|
82
|
+
data?: Record<string, unknown>;
|
|
83
|
+
design?: Record<string, unknown>;
|
|
84
|
+
title?: string;
|
|
85
|
+
}
|
|
86
|
+
export interface ForgeCADResponse<T> {
|
|
87
|
+
result?: T;
|
|
88
|
+
usage: {
|
|
89
|
+
action: string;
|
|
90
|
+
credits: number;
|
|
91
|
+
remaining?: number;
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
export declare class ForgeCADClient {
|
|
95
|
+
private api;
|
|
96
|
+
constructor(api: TalocodeApiClient);
|
|
97
|
+
health(): Promise<{
|
|
98
|
+
ok: boolean;
|
|
99
|
+
service: string;
|
|
100
|
+
version: string;
|
|
101
|
+
product: string;
|
|
102
|
+
status: string;
|
|
103
|
+
}>;
|
|
104
|
+
design: {
|
|
105
|
+
generate: (input: ForgeCADGenerateDesignInput) => Promise<ForgeCADResponse<Record<string, unknown>>>;
|
|
106
|
+
review: (input: ForgeCADReviewInput) => Promise<ForgeCADResponse<Record<string, unknown>>>;
|
|
107
|
+
};
|
|
108
|
+
openscad: {
|
|
109
|
+
generate: (input: ForgeCADOpenScadInput) => Promise<ForgeCADResponse<Record<string, unknown>>>;
|
|
110
|
+
};
|
|
111
|
+
bom: {
|
|
112
|
+
generate: (input: ForgeCADBomInput) => Promise<ForgeCADResponse<Record<string, unknown>>>;
|
|
113
|
+
};
|
|
114
|
+
cutList: {
|
|
115
|
+
generate: (input: ForgeCADCutListInput) => Promise<ForgeCADResponse<Record<string, unknown>>>;
|
|
116
|
+
};
|
|
117
|
+
assembly: {
|
|
118
|
+
plan: (input: ForgeCADAssemblyInput) => Promise<ForgeCADResponse<Record<string, unknown>>>;
|
|
119
|
+
};
|
|
120
|
+
printability: {
|
|
121
|
+
check: (input: ForgeCADPrintabilityInput) => Promise<ForgeCADResponse<Record<string, unknown>>>;
|
|
122
|
+
};
|
|
123
|
+
manufacturability: {
|
|
124
|
+
check: (input: ForgeCADManufacturabilityInput) => Promise<ForgeCADResponse<Record<string, unknown>>>;
|
|
125
|
+
};
|
|
126
|
+
material: {
|
|
127
|
+
estimate: (input: ForgeCADMaterialInput) => Promise<ForgeCADResponse<Record<string, unknown>>>;
|
|
128
|
+
};
|
|
129
|
+
tools: {
|
|
130
|
+
detect: () => Promise<ForgeCADResponse<Record<string, unknown>>>;
|
|
131
|
+
};
|
|
132
|
+
render: {
|
|
133
|
+
openscad: (input: ForgeCADRenderInput) => Promise<ForgeCADResponse<Record<string, unknown>>>;
|
|
134
|
+
};
|
|
135
|
+
export: {
|
|
136
|
+
markdown: (input: ForgeCADExportInput) => Promise<ForgeCADResponse<Record<string, unknown>>>;
|
|
137
|
+
json: (input: ForgeCADExportInput) => Promise<ForgeCADResponse<Record<string, unknown>>>;
|
|
138
|
+
};
|
|
139
|
+
}
|
package/dist/forgecad.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ForgeCADClient = void 0;
|
|
4
|
+
class ForgeCADClient {
|
|
5
|
+
api;
|
|
6
|
+
constructor(api) {
|
|
7
|
+
this.api = api;
|
|
8
|
+
}
|
|
9
|
+
async health() {
|
|
10
|
+
return this.api.request('/v1/forgecad/health');
|
|
11
|
+
}
|
|
12
|
+
design = {
|
|
13
|
+
generate: async (input) => this.api.request('/v1/forgecad/design/generate', { method: 'POST', body: input }),
|
|
14
|
+
review: async (input) => this.api.request('/v1/forgecad/design/review', { method: 'POST', body: input }),
|
|
15
|
+
};
|
|
16
|
+
openscad = {
|
|
17
|
+
generate: async (input) => this.api.request('/v1/forgecad/openscad/generate', { method: 'POST', body: input }),
|
|
18
|
+
};
|
|
19
|
+
bom = {
|
|
20
|
+
generate: async (input) => this.api.request('/v1/forgecad/bom/generate', { method: 'POST', body: input }),
|
|
21
|
+
};
|
|
22
|
+
cutList = {
|
|
23
|
+
generate: async (input) => this.api.request('/v1/forgecad/cutlist/generate', { method: 'POST', body: input }),
|
|
24
|
+
};
|
|
25
|
+
assembly = {
|
|
26
|
+
plan: async (input) => this.api.request('/v1/forgecad/assembly/plan', { method: 'POST', body: input }),
|
|
27
|
+
};
|
|
28
|
+
printability = {
|
|
29
|
+
check: async (input) => this.api.request('/v1/forgecad/printability/check', { method: 'POST', body: input }),
|
|
30
|
+
};
|
|
31
|
+
manufacturability = {
|
|
32
|
+
check: async (input) => this.api.request('/v1/forgecad/manufacturability/check', { method: 'POST', body: input }),
|
|
33
|
+
};
|
|
34
|
+
material = {
|
|
35
|
+
estimate: async (input) => this.api.request('/v1/forgecad/material/estimate', { method: 'POST', body: input }),
|
|
36
|
+
};
|
|
37
|
+
tools = {
|
|
38
|
+
detect: async () => this.api.request('/v1/forgecad/tools/detect', { method: 'POST', body: {} }),
|
|
39
|
+
};
|
|
40
|
+
render = {
|
|
41
|
+
openscad: async (input) => this.api.request('/v1/forgecad/render/openscad', { method: 'POST', body: input }),
|
|
42
|
+
};
|
|
43
|
+
export = {
|
|
44
|
+
markdown: async (input) => this.api.request('/v1/forgecad/export/markdown', { method: 'POST', body: input }),
|
|
45
|
+
json: async (input) => this.api.request('/v1/forgecad/export/json', { method: 'POST', body: input }),
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
exports.ForgeCADClient = ForgeCADClient;
|
|
49
|
+
//# sourceMappingURL=forgecad.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"forgecad.js","sourceRoot":"","sources":["../src/forgecad.ts"],"names":[],"mappings":";;;AA6FA,MAAa,cAAc;IACjB,GAAG,CAAmB;IAE9B,YAAY,GAAsB;QAChC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;IAChB,CAAC;IAED,KAAK,CAAC,MAAM;QACV,OAAO,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,qBAAqB,CAAgG,CAAA;IAC/I,CAAC;IAED,MAAM,GAAG;QACP,QAAQ,EAAE,KAAK,EAAE,KAAkC,EAAE,EAAE,CACrD,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,8BAA8B,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAA2C,EAAE,CAAuD;QAC/K,MAAM,EAAE,KAAK,EAAE,KAA0B,EAAE,EAAE,CAC3C,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,4BAA4B,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAA2C,EAAE,CA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ACT,QAAQ,EAAE,KAAK,EAAE,KAA4B,EAAE,EAAE,CAC/C,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,gCAAgC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAA2C,EAAE,CAAuD;KAClL,CAAA;IAED,KAAK,GAAG;QACN,MAAM,EAAE,KAAK,IAAI,EAAE,CACjB,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,2BAA2B,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,CAAuD;KACpI,CAAA;IAED,MAAM,GAAG;QACP,QAAQ,EAAE,KAAK,EAAE,KAA0B,EAAE,EAAE,CAC7C,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,8BAA8B,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAA2C,EAAE,CAAuD;KAChL,CAAA;IAED,MAAM,GAAG;QACP,QAAQ,EAAE,KAAK,EAAE,KAA0B,EAAE,EAAE,CAC7C,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,8BAA8B,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAA2C,EAAE,CAAuD;QAC/K,IAAI,EAAE,KAAK,EAAE,KAA0B,EAAE,EAAE,CACzC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,0BAA0B,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAA2C,EAAE,CAAuD;KAC5K,CAAA;CACF;AArED,wCAqEC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
export interface StacklaneClientOptions {
|
|
2
|
+
baseUrl: string;
|
|
3
|
+
accessToken?: string;
|
|
4
|
+
}
|
|
5
|
+
interface ApiResponse<T> {
|
|
6
|
+
ok: boolean;
|
|
7
|
+
data?: T;
|
|
8
|
+
error?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function createStacklaneClient(options: StacklaneClientOptions): {
|
|
11
|
+
health(): Promise<ApiResponse<{
|
|
12
|
+
ok: boolean;
|
|
13
|
+
service: string;
|
|
14
|
+
version?: string;
|
|
15
|
+
}>>;
|
|
16
|
+
configStatus(): Promise<ApiResponse<{
|
|
17
|
+
ok: boolean;
|
|
18
|
+
config: unknown;
|
|
19
|
+
}>>;
|
|
20
|
+
createCustomer(data: {
|
|
21
|
+
name: string;
|
|
22
|
+
email?: string;
|
|
23
|
+
externalRef?: string;
|
|
24
|
+
status?: "active" | "suspended" | "deleted";
|
|
25
|
+
}): Promise<ApiResponse<{
|
|
26
|
+
ok: boolean;
|
|
27
|
+
customer: any;
|
|
28
|
+
}>>;
|
|
29
|
+
listCustomers(): Promise<ApiResponse<{
|
|
30
|
+
ok: boolean;
|
|
31
|
+
customers: any[];
|
|
32
|
+
}>>;
|
|
33
|
+
getCustomer(customerId: string): Promise<ApiResponse<{
|
|
34
|
+
ok: boolean;
|
|
35
|
+
customer: any;
|
|
36
|
+
}>>;
|
|
37
|
+
updateCustomer(customerId: string, data: Record<string, unknown>): Promise<ApiResponse<{
|
|
38
|
+
ok: boolean;
|
|
39
|
+
customer: any;
|
|
40
|
+
}>>;
|
|
41
|
+
createApiKey(data: {
|
|
42
|
+
customerId: string;
|
|
43
|
+
name: string;
|
|
44
|
+
scopes?: string[];
|
|
45
|
+
mode?: "dev" | "live";
|
|
46
|
+
}): Promise<ApiResponse<{
|
|
47
|
+
ok: boolean;
|
|
48
|
+
apiKey: any;
|
|
49
|
+
warning: string;
|
|
50
|
+
}>>;
|
|
51
|
+
listApiKeys(customerId?: string): Promise<ApiResponse<{
|
|
52
|
+
ok: boolean;
|
|
53
|
+
apiKeys: any[];
|
|
54
|
+
}>>;
|
|
55
|
+
revokeApiKey(apiKeyId: string): Promise<ApiResponse<{
|
|
56
|
+
ok: boolean;
|
|
57
|
+
apiKey: any;
|
|
58
|
+
}>>;
|
|
59
|
+
recordUsageEvent(data: {
|
|
60
|
+
product: string;
|
|
61
|
+
action: string;
|
|
62
|
+
units: number;
|
|
63
|
+
metadata?: Record<string, unknown>;
|
|
64
|
+
}): Promise<ApiResponse<{
|
|
65
|
+
ok: boolean;
|
|
66
|
+
event: any;
|
|
67
|
+
}>>;
|
|
68
|
+
listUsageEvents(query?: Record<string, string>): Promise<ApiResponse<{
|
|
69
|
+
ok: boolean;
|
|
70
|
+
events: any[];
|
|
71
|
+
}>>;
|
|
72
|
+
summarizeUsage(query?: Record<string, string>): Promise<ApiResponse<{
|
|
73
|
+
ok: boolean;
|
|
74
|
+
summary: any;
|
|
75
|
+
byCustomer: any;
|
|
76
|
+
byProduct: any;
|
|
77
|
+
byAction: any;
|
|
78
|
+
}>>;
|
|
79
|
+
createAsset(data: {
|
|
80
|
+
product: string;
|
|
81
|
+
filename: string;
|
|
82
|
+
contentType: string;
|
|
83
|
+
bytesBase64?: string;
|
|
84
|
+
publicUrl?: string;
|
|
85
|
+
metadata?: Record<string, unknown>;
|
|
86
|
+
}): Promise<ApiResponse<{
|
|
87
|
+
ok: boolean;
|
|
88
|
+
asset: any;
|
|
89
|
+
}>>;
|
|
90
|
+
listAssets(query?: Record<string, string>): Promise<ApiResponse<{
|
|
91
|
+
ok: boolean;
|
|
92
|
+
assets: any[];
|
|
93
|
+
}>>;
|
|
94
|
+
getAsset(assetId: string): Promise<ApiResponse<{
|
|
95
|
+
ok: boolean;
|
|
96
|
+
asset: any;
|
|
97
|
+
}>>;
|
|
98
|
+
deleteAsset(assetId: string): Promise<ApiResponse<{
|
|
99
|
+
ok: boolean;
|
|
100
|
+
asset: any;
|
|
101
|
+
}>>;
|
|
102
|
+
projects: {
|
|
103
|
+
create(data: {
|
|
104
|
+
name: string;
|
|
105
|
+
organizationId: string;
|
|
106
|
+
}): Promise<ApiResponse<{
|
|
107
|
+
project: any;
|
|
108
|
+
}>>;
|
|
109
|
+
list(): Promise<ApiResponse<{
|
|
110
|
+
projects: any[];
|
|
111
|
+
}>>;
|
|
112
|
+
get(projectId: string): Promise<ApiResponse<{
|
|
113
|
+
project: any;
|
|
114
|
+
}>>;
|
|
115
|
+
};
|
|
116
|
+
database: {
|
|
117
|
+
set(projectId: string, data: {
|
|
118
|
+
databaseUrl: string;
|
|
119
|
+
password: string;
|
|
120
|
+
provider?: string;
|
|
121
|
+
}): Promise<ApiResponse<{
|
|
122
|
+
database: any;
|
|
123
|
+
}>>;
|
|
124
|
+
get(projectId: string): Promise<ApiResponse<{
|
|
125
|
+
database: any;
|
|
126
|
+
}>>;
|
|
127
|
+
};
|
|
128
|
+
tokens: {
|
|
129
|
+
create(projectId: string, data: {
|
|
130
|
+
name: string;
|
|
131
|
+
scopes?: string[];
|
|
132
|
+
}): Promise<ApiResponse<{
|
|
133
|
+
token: any;
|
|
134
|
+
rawToken: string;
|
|
135
|
+
}>>;
|
|
136
|
+
verify(token: string): Promise<ApiResponse<{
|
|
137
|
+
valid: boolean;
|
|
138
|
+
projectId: string;
|
|
139
|
+
scopes: string[];
|
|
140
|
+
}>>;
|
|
141
|
+
revoke(projectId: string, tokenId: string): Promise<ApiResponse<{
|
|
142
|
+
message: string;
|
|
143
|
+
}>>;
|
|
144
|
+
};
|
|
145
|
+
audit: {
|
|
146
|
+
list(projectId: string, limit?: number): Promise<ApiResponse<{
|
|
147
|
+
events: any[];
|
|
148
|
+
}>>;
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
export type StacklaneClient = ReturnType<typeof createStacklaneClient>;
|
|
152
|
+
export { Talocode } from './talocode';
|
|
153
|
+
export type { TalocodeOptions } from './talocode';
|
|
154
|
+
export { TeraClient } from './tera';
|
|
155
|
+
export { RouterClient } from './router';
|
|
156
|
+
export { AgentBrowserClient } from './agent-browser';
|
|
157
|
+
export { ClipLoopClient } from './cliploop';
|
|
158
|
+
export { CodraClient } from './codra';
|
|
159
|
+
export { InvoiceLaneClient } from './invoicelane.js';
|
|
160
|
+
export { WebDataLaneClient } from './webdatalane.js';
|
|
161
|
+
export { SkillsClient } from './skills';
|
|
162
|
+
export { SignalLaneClient } from './signallane.js';
|
|
163
|
+
export { UGCLaneClient } from './ugclane.js';
|
|
164
|
+
export { CrawlerLaneClient } from './crawlerlane.js';
|
|
165
|
+
export { OpenSourceLaneClient } from './opensourcelane.js';
|
|
166
|
+
export { ForgeCADClient } from './forgecad.js';
|
|
167
|
+
export { ReplyLaneClient } from './replylane.js';
|
|
168
|
+
export { CodraClientPlaceholder, TradiaClientPlaceholder, WorkLaneClientPlaceholder, } from './placeholders';
|
|
169
|
+
export { TalocodeError, TalocodeAuthError, TalocodeInsufficientCreditsError, TalocodeRateLimitError, TalocodeValidationError, TalocodeNotImplementedError, } from './errors';
|
|
170
|
+
export * from './types';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// ─── Existing Stacklane client (backward compatible) ───
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.TalocodeNotImplementedError = exports.TalocodeValidationError = exports.TalocodeRateLimitError = exports.TalocodeInsufficientCreditsError = exports.TalocodeAuthError = exports.TalocodeError = exports.WorkLaneClientPlaceholder = exports.TradiaClientPlaceholder = exports.CodraClientPlaceholder = exports.ReplyLaneClient = exports.ForgeCADClient = exports.OpenSourceLaneClient = exports.CrawlerLaneClient = exports.UGCLaneClient = exports.SignalLaneClient = exports.SkillsClient = exports.WebDataLaneClient = exports.InvoiceLaneClient = exports.CodraClient = exports.ClipLoopClient = exports.AgentBrowserClient = exports.RouterClient = exports.TeraClient = exports.Talocode = void 0;
|
|
19
|
+
exports.createStacklaneClient = createStacklaneClient;
|
|
20
|
+
function createStacklaneClient(options) {
|
|
21
|
+
const { baseUrl, accessToken } = options;
|
|
22
|
+
async function request(path, method = 'GET', body) {
|
|
23
|
+
const headers = {
|
|
24
|
+
'Content-Type': 'application/json',
|
|
25
|
+
};
|
|
26
|
+
if (accessToken) {
|
|
27
|
+
headers['Authorization'] = `Bearer ${accessToken}`;
|
|
28
|
+
}
|
|
29
|
+
try {
|
|
30
|
+
const res = await fetch(`${baseUrl}${path}`, {
|
|
31
|
+
method,
|
|
32
|
+
headers,
|
|
33
|
+
body: body ? JSON.stringify(body) : undefined,
|
|
34
|
+
});
|
|
35
|
+
const data = await res.json();
|
|
36
|
+
if (!res.ok) {
|
|
37
|
+
return { ok: false, error: data.error?.message || `HTTP ${res.status}` };
|
|
38
|
+
}
|
|
39
|
+
return { ok: true, data };
|
|
40
|
+
}
|
|
41
|
+
catch (err) {
|
|
42
|
+
return { ok: false, error: err instanceof Error ? err.message : 'Network error' };
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
async health() {
|
|
47
|
+
return request('/api/v1/health');
|
|
48
|
+
},
|
|
49
|
+
async configStatus() {
|
|
50
|
+
return request('/api/v1/config/status');
|
|
51
|
+
},
|
|
52
|
+
async createCustomer(data) {
|
|
53
|
+
return request('/api/v1/customers', 'POST', data);
|
|
54
|
+
},
|
|
55
|
+
async listCustomers() {
|
|
56
|
+
return request('/api/v1/customers');
|
|
57
|
+
},
|
|
58
|
+
async getCustomer(customerId) {
|
|
59
|
+
return request(`/api/v1/customers/${customerId}`);
|
|
60
|
+
},
|
|
61
|
+
async updateCustomer(customerId, data) {
|
|
62
|
+
return request(`/api/v1/customers/${customerId}`, 'PATCH', data);
|
|
63
|
+
},
|
|
64
|
+
async createApiKey(data) {
|
|
65
|
+
return request('/api/v1/api-keys', 'POST', data);
|
|
66
|
+
},
|
|
67
|
+
async listApiKeys(customerId) {
|
|
68
|
+
const suffix = customerId ? `?customerId=${encodeURIComponent(customerId)}` : '';
|
|
69
|
+
return request(`/api/v1/api-keys${suffix}`);
|
|
70
|
+
},
|
|
71
|
+
async revokeApiKey(apiKeyId) {
|
|
72
|
+
return request(`/api/v1/api-keys/${apiKeyId}/revoke`, 'POST');
|
|
73
|
+
},
|
|
74
|
+
async recordUsageEvent(data) {
|
|
75
|
+
return request('/api/v1/usage/events', 'POST', data);
|
|
76
|
+
},
|
|
77
|
+
async listUsageEvents(query) {
|
|
78
|
+
const suffix = query ? `?${new URLSearchParams(query).toString()}` : '';
|
|
79
|
+
return request(`/api/v1/usage/events${suffix}`);
|
|
80
|
+
},
|
|
81
|
+
async summarizeUsage(query) {
|
|
82
|
+
const suffix = query ? `?${new URLSearchParams(query).toString()}` : '';
|
|
83
|
+
return request(`/api/v1/usage/summary${suffix}`);
|
|
84
|
+
},
|
|
85
|
+
async createAsset(data) {
|
|
86
|
+
return request('/api/v1/assets', 'POST', data);
|
|
87
|
+
},
|
|
88
|
+
async listAssets(query) {
|
|
89
|
+
const suffix = query ? `?${new URLSearchParams(query).toString()}` : '';
|
|
90
|
+
return request(`/api/v1/assets${suffix}`);
|
|
91
|
+
},
|
|
92
|
+
async getAsset(assetId) {
|
|
93
|
+
return request(`/api/v1/assets/${assetId}`);
|
|
94
|
+
},
|
|
95
|
+
async deleteAsset(assetId) {
|
|
96
|
+
return request(`/api/v1/assets/${assetId}`, 'DELETE');
|
|
97
|
+
},
|
|
98
|
+
projects: {
|
|
99
|
+
async create(data) {
|
|
100
|
+
return request('/v1/projects', 'POST', data);
|
|
101
|
+
},
|
|
102
|
+
async list() {
|
|
103
|
+
return request('/v1/projects');
|
|
104
|
+
},
|
|
105
|
+
async get(projectId) {
|
|
106
|
+
return request(`/v1/projects/${projectId}`);
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
database: {
|
|
110
|
+
async set(projectId, data) {
|
|
111
|
+
return request(`/v1/projects/${projectId}/database`, 'POST', data);
|
|
112
|
+
},
|
|
113
|
+
async get(projectId) {
|
|
114
|
+
return request(`/v1/projects/${projectId}/database`);
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
tokens: {
|
|
118
|
+
async create(projectId, data) {
|
|
119
|
+
return request(`/v1/projects/${projectId}/tokens`, 'POST', data);
|
|
120
|
+
},
|
|
121
|
+
async verify(token) {
|
|
122
|
+
return request('/v1/tokens/verify', 'POST', { token });
|
|
123
|
+
},
|
|
124
|
+
async revoke(projectId, tokenId) {
|
|
125
|
+
return request(`/v1/projects/${projectId}/tokens/${tokenId}/revoke`, 'POST');
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
audit: {
|
|
129
|
+
async list(projectId, limit = 50) {
|
|
130
|
+
return request(`/v1/projects/${projectId}/audit?limit=${limit}`);
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
// ─── Talocode Cloud SDK ───
|
|
136
|
+
var talocode_1 = require("./talocode");
|
|
137
|
+
Object.defineProperty(exports, "Talocode", { enumerable: true, get: function () { return talocode_1.Talocode; } });
|
|
138
|
+
var tera_1 = require("./tera");
|
|
139
|
+
Object.defineProperty(exports, "TeraClient", { enumerable: true, get: function () { return tera_1.TeraClient; } });
|
|
140
|
+
var router_1 = require("./router");
|
|
141
|
+
Object.defineProperty(exports, "RouterClient", { enumerable: true, get: function () { return router_1.RouterClient; } });
|
|
142
|
+
var agent_browser_1 = require("./agent-browser");
|
|
143
|
+
Object.defineProperty(exports, "AgentBrowserClient", { enumerable: true, get: function () { return agent_browser_1.AgentBrowserClient; } });
|
|
144
|
+
var cliploop_1 = require("./cliploop");
|
|
145
|
+
Object.defineProperty(exports, "ClipLoopClient", { enumerable: true, get: function () { return cliploop_1.ClipLoopClient; } });
|
|
146
|
+
var codra_1 = require("./codra");
|
|
147
|
+
Object.defineProperty(exports, "CodraClient", { enumerable: true, get: function () { return codra_1.CodraClient; } });
|
|
148
|
+
var invoicelane_js_1 = require("./invoicelane.js");
|
|
149
|
+
Object.defineProperty(exports, "InvoiceLaneClient", { enumerable: true, get: function () { return invoicelane_js_1.InvoiceLaneClient; } });
|
|
150
|
+
var webdatalane_js_1 = require("./webdatalane.js");
|
|
151
|
+
Object.defineProperty(exports, "WebDataLaneClient", { enumerable: true, get: function () { return webdatalane_js_1.WebDataLaneClient; } });
|
|
152
|
+
var skills_1 = require("./skills");
|
|
153
|
+
Object.defineProperty(exports, "SkillsClient", { enumerable: true, get: function () { return skills_1.SkillsClient; } });
|
|
154
|
+
var signallane_js_1 = require("./signallane.js");
|
|
155
|
+
Object.defineProperty(exports, "SignalLaneClient", { enumerable: true, get: function () { return signallane_js_1.SignalLaneClient; } });
|
|
156
|
+
var ugclane_js_1 = require("./ugclane.js");
|
|
157
|
+
Object.defineProperty(exports, "UGCLaneClient", { enumerable: true, get: function () { return ugclane_js_1.UGCLaneClient; } });
|
|
158
|
+
var crawlerlane_js_1 = require("./crawlerlane.js");
|
|
159
|
+
Object.defineProperty(exports, "CrawlerLaneClient", { enumerable: true, get: function () { return crawlerlane_js_1.CrawlerLaneClient; } });
|
|
160
|
+
var opensourcelane_js_1 = require("./opensourcelane.js");
|
|
161
|
+
Object.defineProperty(exports, "OpenSourceLaneClient", { enumerable: true, get: function () { return opensourcelane_js_1.OpenSourceLaneClient; } });
|
|
162
|
+
var forgecad_js_1 = require("./forgecad.js");
|
|
163
|
+
Object.defineProperty(exports, "ForgeCADClient", { enumerable: true, get: function () { return forgecad_js_1.ForgeCADClient; } });
|
|
164
|
+
var replylane_js_1 = require("./replylane.js");
|
|
165
|
+
Object.defineProperty(exports, "ReplyLaneClient", { enumerable: true, get: function () { return replylane_js_1.ReplyLaneClient; } });
|
|
166
|
+
var placeholders_1 = require("./placeholders");
|
|
167
|
+
Object.defineProperty(exports, "CodraClientPlaceholder", { enumerable: true, get: function () { return placeholders_1.CodraClientPlaceholder; } });
|
|
168
|
+
Object.defineProperty(exports, "TradiaClientPlaceholder", { enumerable: true, get: function () { return placeholders_1.TradiaClientPlaceholder; } });
|
|
169
|
+
Object.defineProperty(exports, "WorkLaneClientPlaceholder", { enumerable: true, get: function () { return placeholders_1.WorkLaneClientPlaceholder; } });
|
|
170
|
+
var errors_1 = require("./errors");
|
|
171
|
+
Object.defineProperty(exports, "TalocodeError", { enumerable: true, get: function () { return errors_1.TalocodeError; } });
|
|
172
|
+
Object.defineProperty(exports, "TalocodeAuthError", { enumerable: true, get: function () { return errors_1.TalocodeAuthError; } });
|
|
173
|
+
Object.defineProperty(exports, "TalocodeInsufficientCreditsError", { enumerable: true, get: function () { return errors_1.TalocodeInsufficientCreditsError; } });
|
|
174
|
+
Object.defineProperty(exports, "TalocodeRateLimitError", { enumerable: true, get: function () { return errors_1.TalocodeRateLimitError; } });
|
|
175
|
+
Object.defineProperty(exports, "TalocodeValidationError", { enumerable: true, get: function () { return errors_1.TalocodeValidationError; } });
|
|
176
|
+
Object.defineProperty(exports, "TalocodeNotImplementedError", { enumerable: true, get: function () { return errors_1.TalocodeNotImplementedError; } });
|
|
177
|
+
__exportStar(require("./types"), exports);
|
|
178
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,0DAA0D;;;;;;;;;;;;;;;;;AAa1D,sDAwIC;AAxID,SAAgB,qBAAqB,CAAC,OAA+B;IACnE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC;IAEzC,KAAK,UAAU,OAAO,CAAI,IAAY,EAAE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B,2CAA4C;AAAnC,2GAAA,aAAa,OAAA;AACtB,mDAAoD;AAA3C,mHAAA,iBAAiB,OAAA;AAC1B,yDAA0D;AAAjD,yHAAA,oBAAoB,OAAA;AAC7B,6CAA8C;AAArC,6GAAA,cAAc,OAAA;AACvB,+CAAgD;AAAvC,+GAAA,eAAe,OAAA;AACxB,+CAIuB;AAHrB,sHAAA,sBAAsB,OAAA;AACtB,uHAAA,uBAAuB,OAAA;AACvB,yHAAA,yBAAyB,OAAA;AAE3B,mCAOiB;AANf,uGAAA,aAAa,OAAA;AACb,2GAAA,iBAAiB,OAAA;AACjB,0HAAA,gCAAgC,OAAA;AAChC,gHAAA,sBAAsB,OAAA;AACtB,iHAAA,uBAAuB,OAAA;AACvB,qHAAA,2BAA2B,OAAA;AAE7B,0CAAuB"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { TalocodeApiClient } from './talocode.js';
|
|
2
|
+
export interface InvoiceLaneExtractInput {
|
|
3
|
+
type?: 'invoice' | 'receipt' | 'document' | 'auto';
|
|
4
|
+
text?: string;
|
|
5
|
+
fileUrl?: string;
|
|
6
|
+
base64?: string;
|
|
7
|
+
currency?: string;
|
|
8
|
+
locale?: string;
|
|
9
|
+
fields?: string[];
|
|
10
|
+
}
|
|
11
|
+
export interface InvoiceLaneReceiptInput {
|
|
12
|
+
text?: string;
|
|
13
|
+
fileUrl?: string;
|
|
14
|
+
base64?: string;
|
|
15
|
+
currency?: string;
|
|
16
|
+
locale?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface InvoiceLaneInvoiceInput {
|
|
19
|
+
text?: string;
|
|
20
|
+
fileUrl?: string;
|
|
21
|
+
base64?: string;
|
|
22
|
+
currency?: string;
|
|
23
|
+
locale?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface InvoiceLaneValidateInput {
|
|
26
|
+
documentType: string;
|
|
27
|
+
fields: Record<string, unknown>;
|
|
28
|
+
}
|
|
29
|
+
export interface InvoiceLaneExportCsvInput {
|
|
30
|
+
rows: Record<string, unknown>[];
|
|
31
|
+
}
|
|
32
|
+
export interface InvoiceLaneResponse<T> {
|
|
33
|
+
data: T;
|
|
34
|
+
usage: {
|
|
35
|
+
action: string;
|
|
36
|
+
credits: number;
|
|
37
|
+
remaining: number;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export declare class InvoiceLaneClient {
|
|
41
|
+
private api;
|
|
42
|
+
constructor(api: TalocodeApiClient);
|
|
43
|
+
health(): Promise<{
|
|
44
|
+
ok: boolean;
|
|
45
|
+
service: string;
|
|
46
|
+
version: string;
|
|
47
|
+
}>;
|
|
48
|
+
extract(input: InvoiceLaneExtractInput): Promise<InvoiceLaneResponse<Record<string, unknown>>>;
|
|
49
|
+
receiptExtract(input: InvoiceLaneReceiptInput): Promise<InvoiceLaneResponse<Record<string, unknown>>>;
|
|
50
|
+
invoiceExtract(input: InvoiceLaneInvoiceInput): Promise<InvoiceLaneResponse<Record<string, unknown>>>;
|
|
51
|
+
validate(input: InvoiceLaneValidateInput): Promise<InvoiceLaneResponse<Record<string, unknown>>>;
|
|
52
|
+
exportCsv(input: InvoiceLaneExportCsvInput): Promise<InvoiceLaneResponse<Record<string, unknown>>>;
|
|
53
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InvoiceLaneClient = void 0;
|
|
4
|
+
class InvoiceLaneClient {
|
|
5
|
+
api;
|
|
6
|
+
constructor(api) {
|
|
7
|
+
this.api = api;
|
|
8
|
+
}
|
|
9
|
+
async health() {
|
|
10
|
+
const res = await this.api.request('/v1/invoicelane/health');
|
|
11
|
+
return res;
|
|
12
|
+
}
|
|
13
|
+
async extract(input) {
|
|
14
|
+
return this.api.request('/v1/invoicelane/extract', {
|
|
15
|
+
method: 'POST',
|
|
16
|
+
body: input,
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
async receiptExtract(input) {
|
|
20
|
+
return this.api.request('/v1/invoicelane/receipt/extract', {
|
|
21
|
+
method: 'POST',
|
|
22
|
+
body: input,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
async invoiceExtract(input) {
|
|
26
|
+
return this.api.request('/v1/invoicelane/invoice/extract', {
|
|
27
|
+
method: 'POST',
|
|
28
|
+
body: input,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
async validate(input) {
|
|
32
|
+
return this.api.request('/v1/invoicelane/validate', {
|
|
33
|
+
method: 'POST',
|
|
34
|
+
body: input,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
async exportCsv(input) {
|
|
38
|
+
return this.api.request('/v1/invoicelane/export/csv', {
|
|
39
|
+
method: 'POST',
|
|
40
|
+
body: input,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.InvoiceLaneClient = InvoiceLaneClient;
|
|
45
|
+
//# sourceMappingURL=invoicelane.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invoicelane.js","sourceRoot":"","sources":["../src/invoicelane.ts"],"names":[],"mappings":";;;AA8CA,MAAa,iBAAiB;IACpB,GAAG,CAAmB;IAE9B,YAAY,GAAsB;QAChC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;IAChB,CAAC;IAED,KAAK,CAAC,MAAM;QACV,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,wBAAwB,CAAC,CAAA;QAC5D,OAAO,GAAwD,CAAA;IACjE,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,KAA8B;QAC1C,OAAO,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,yBAAyB,EAAE;YACjD,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,KAA2C;SAClD,CAA0D,CAAA;IAC7D,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,KAA8B;QACjD,OAAO,IAAI,CAAC,GAAG,CAAC,OAAO,CAA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