@voyantjs/cloud-sdk 0.1.0 → 0.3.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 +109 -0
- package/README.md +42 -3
- package/dist/client.d.ts +37 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +95 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/types.d.ts +278 -1
- package/dist/types.d.ts.map +1 -1
- package/node_modules/@voyant-sdk/sdk-core/dist/client.d.ts.map +1 -1
- package/node_modules/@voyant-sdk/sdk-core/dist/client.js +25 -0
- package/node_modules/@voyant-sdk/sdk-core/dist/index.d.ts +1 -1
- package/node_modules/@voyant-sdk/sdk-core/dist/index.d.ts.map +1 -1
- package/node_modules/@voyant-sdk/sdk-core/dist/types.d.ts +2 -0
- package/node_modules/@voyant-sdk/sdk-core/dist/types.d.ts.map +1 -1
- package/node_modules/@voyant-sdk/sdk-core/package.json +4 -2
- package/package.json +18 -24
package/LICENSE
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# Functional Source License, Version 1.1, Apache 2.0 Future License
|
|
2
|
+
|
|
3
|
+
## Abbreviation
|
|
4
|
+
|
|
5
|
+
FSL-1.1-Apache-2.0
|
|
6
|
+
|
|
7
|
+
## Notice
|
|
8
|
+
|
|
9
|
+
Copyright 2026 PixelMakers Studio SRL
|
|
10
|
+
|
|
11
|
+
## Terms and Conditions
|
|
12
|
+
|
|
13
|
+
### Licensor ("We")
|
|
14
|
+
|
|
15
|
+
The party offering the Software under these Terms and Conditions.
|
|
16
|
+
|
|
17
|
+
### The Software
|
|
18
|
+
|
|
19
|
+
The "Software" is each version of the software that we make available under
|
|
20
|
+
these Terms and Conditions, as indicated by our inclusion of these Terms and
|
|
21
|
+
Conditions with the Software.
|
|
22
|
+
|
|
23
|
+
### License Grant
|
|
24
|
+
|
|
25
|
+
Subject to your compliance with this License Grant and the Patents,
|
|
26
|
+
Redistribution and Trademark clauses below, we hereby grant you the right to
|
|
27
|
+
use, copy, modify, create derivative works, publicly perform, publicly
|
|
28
|
+
display and redistribute the Software for any Permitted Purpose identified
|
|
29
|
+
below.
|
|
30
|
+
|
|
31
|
+
### Permitted Purpose
|
|
32
|
+
|
|
33
|
+
A Permitted Purpose is any purpose other than a Competing Use. A Competing
|
|
34
|
+
Use means making the Software available to others in a commercial product or
|
|
35
|
+
service that:
|
|
36
|
+
|
|
37
|
+
1. substitutes for the Software;
|
|
38
|
+
|
|
39
|
+
2. substitutes for any other product or service we offer using the Software
|
|
40
|
+
that exists as of the date we make the Software available; or
|
|
41
|
+
|
|
42
|
+
3. offers the same or substantially similar functionality as the Software.
|
|
43
|
+
|
|
44
|
+
Permitted Purposes specifically include using the Software:
|
|
45
|
+
|
|
46
|
+
1. for your internal use and access;
|
|
47
|
+
|
|
48
|
+
2. for non-commercial education;
|
|
49
|
+
|
|
50
|
+
3. for non-commercial research; and
|
|
51
|
+
|
|
52
|
+
4. in connection with professional services that you provide to a licensee
|
|
53
|
+
using the Software in accordance with these Terms and Conditions.
|
|
54
|
+
|
|
55
|
+
### Patents
|
|
56
|
+
|
|
57
|
+
To the extent your use for a Permitted Purpose would necessarily infringe
|
|
58
|
+
our patents, the license grant above includes a license under our patents.
|
|
59
|
+
If you make a claim against any party that the Software infringes or
|
|
60
|
+
contributes to the infringement of any patent, then your patent license to
|
|
61
|
+
the Software ends immediately.
|
|
62
|
+
|
|
63
|
+
### Redistribution
|
|
64
|
+
|
|
65
|
+
The Terms and Conditions apply to all copies, modifications and derivatives
|
|
66
|
+
of the Software.
|
|
67
|
+
|
|
68
|
+
If you redistribute any copies, modifications or derivatives of the
|
|
69
|
+
Software, you must include a copy of or a link to these Terms and Conditions
|
|
70
|
+
and not remove any copyright notices provided in or with the Software.
|
|
71
|
+
|
|
72
|
+
### Disclaimer
|
|
73
|
+
|
|
74
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS
|
|
75
|
+
OR IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A
|
|
76
|
+
PARTICULAR PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
|
|
77
|
+
|
|
78
|
+
IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO
|
|
79
|
+
THE SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL
|
|
80
|
+
DAMAGES, EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
|
|
81
|
+
|
|
82
|
+
### Trademarks
|
|
83
|
+
|
|
84
|
+
Except for displaying the License Details and identifying us as the origin
|
|
85
|
+
of the Software, you have no right under these Terms and Conditions to use
|
|
86
|
+
our trademarks, trade names, service marks or product names.
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Grant of Future License
|
|
91
|
+
|
|
92
|
+
We hereby irrevocably grant you an additional license to use the Software
|
|
93
|
+
under the Apache License, Version 2.0 that is effective on the second
|
|
94
|
+
anniversary of the date we make the Software available. On or after that
|
|
95
|
+
date, you may use the Software under the Apache License, Version 2.0, in
|
|
96
|
+
which case the following will apply:
|
|
97
|
+
|
|
98
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
|
99
|
+
use this file except in compliance with the License.
|
|
100
|
+
|
|
101
|
+
You may obtain a copy of the License at
|
|
102
|
+
|
|
103
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
104
|
+
|
|
105
|
+
Unless required by applicable law or agreed to in writing, software
|
|
106
|
+
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
107
|
+
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
108
|
+
License for the specific language governing permissions and limitations
|
|
109
|
+
under the License.
|
package/README.md
CHANGED
|
@@ -10,6 +10,8 @@ Public TypeScript client for Voyant Cloud APIs.
|
|
|
10
10
|
- sms (send messages, list phone numbers and messages)
|
|
11
11
|
- verification (start verification, check codes, list recent attempts)
|
|
12
12
|
- email (list, send, and fetch email messages)
|
|
13
|
+
- browser (render content, screenshots, PDFs; scrape and extract; manage
|
|
14
|
+
long-running crawls and keep-alive Puppeteer sessions)
|
|
13
15
|
|
|
14
16
|
## Install
|
|
15
17
|
|
|
@@ -38,6 +40,7 @@ Root groups:
|
|
|
38
40
|
- `sms`
|
|
39
41
|
- `verification`
|
|
40
42
|
- `email`
|
|
43
|
+
- `browser`
|
|
41
44
|
|
|
42
45
|
The `vault` group covers list-vaults, list-secrets, and get-secret routes.
|
|
43
46
|
|
|
@@ -48,6 +51,35 @@ The `verification` group covers verification start, check, and list-attempts rou
|
|
|
48
51
|
|
|
49
52
|
The `email` group covers list-messages, send-message, and get-message routes.
|
|
50
53
|
|
|
54
|
+
The `browser` group exposes Cloudflare Browser Rendering through Voyant. Render
|
|
55
|
+
helpers (`content`, `markdown`, `snapshot`, `scrape`, `links`, `json`) return
|
|
56
|
+
the unwrapped Cloudflare `result`. Binary helpers (`screenshot`, `pdf`) return
|
|
57
|
+
a `Uint8Array`. The `browser.crawls` and `browser.sessions` namespaces manage
|
|
58
|
+
long-running crawl jobs and keep-alive Puppeteer sessions.
|
|
59
|
+
|
|
60
|
+
```ts
|
|
61
|
+
import { createVoyantCloudClient } from "@voyantjs/cloud-sdk";
|
|
62
|
+
|
|
63
|
+
const client = createVoyantCloudClient({
|
|
64
|
+
apiKey: process.env.VOYANT_API_KEY!,
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
const html = await client.browser.content({ url: "https://example.com" });
|
|
68
|
+
const png = await client.browser.screenshot({
|
|
69
|
+
url: "https://example.com",
|
|
70
|
+
screenshotOptions: { fullPage: true },
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
const session = await client.browser.sessions.open({ keepAliveMs: 60_000 });
|
|
74
|
+
await client.browser.sessions.runCommands(session.id, {
|
|
75
|
+
commands: [
|
|
76
|
+
{ op: "goto", url: "https://example.com" },
|
|
77
|
+
{ op: "screenshot" },
|
|
78
|
+
],
|
|
79
|
+
});
|
|
80
|
+
await client.browser.sessions.close(session.id);
|
|
81
|
+
```
|
|
82
|
+
|
|
51
83
|
## Key public types
|
|
52
84
|
|
|
53
85
|
Useful exported types include:
|
|
@@ -57,8 +89,14 @@ Useful exported types include:
|
|
|
57
89
|
- `VerificationAttemptSummary`, `VerificationCheckResult`
|
|
58
90
|
- `StartVerificationInput`, `CheckVerificationInput`
|
|
59
91
|
- `EmailMessageSummary`, `SendEmailInput`
|
|
92
|
+
- `BrowserRenderInput`, `BrowserScreenshotInput`, `BrowserPdfInput`,
|
|
93
|
+
`BrowserScrapeInput`, `BrowserJsonInput`
|
|
94
|
+
- `BrowserSessionSummary`, `OpenBrowserSessionInput`, `BrowserCommand`,
|
|
95
|
+
`RunBrowserCommandsInput`, `RunBrowserCommandsResult`
|
|
96
|
+
- `BrowserCrawlSummary`, `StartBrowserCrawlInput`, `StartBrowserCrawlResult`
|
|
60
97
|
- `PhoneNumberStatus`, `SmsMessageStatus`, `VerificationChannel`,
|
|
61
|
-
`VerificationAttemptStatus`, `EmailMessageStatus
|
|
98
|
+
`VerificationAttemptStatus`, `EmailMessageStatus`,
|
|
99
|
+
`BrowserSessionStatus`, `BrowserJobStatus`
|
|
62
100
|
|
|
63
101
|
## Notes
|
|
64
102
|
|
|
@@ -67,7 +105,8 @@ Useful exported types include:
|
|
|
67
105
|
- response envelopes of the form `{ data: ... }` are unwrapped by default
|
|
68
106
|
- API tokens are scoped (`vault:read`, `sms:read`, `sms:send`,
|
|
69
107
|
`phone-numbers:read`, `verification:start`, `verification:check`,
|
|
70
|
-
`verification:read`, `emails:read`, `emails:send
|
|
71
|
-
|
|
108
|
+
`verification:read`, `emails:read`, `emails:send`, `browser:render`,
|
|
109
|
+
`browser:scrape`, `browser:extract`, `browser:crawl`, `browser:sessions`);
|
|
110
|
+
requests fail with `403` if the token does not include the required scope
|
|
72
111
|
|
|
73
112
|
For repo-level context, see [../../docs/cloud.md](../../docs/cloud.md).
|
package/dist/client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { VoyantTransport } from "@voyant-sdk/sdk-core";
|
|
2
|
-
import type { CheckVerificationInput, EmailMessageSummary, PhoneNumberSummary, SendEmailInput, SendSmsInput, SmsMessageSummary, StartVerificationInput, VaultSecretSummary, VaultSecretValue, VaultSummary, VerificationAttemptSummary, VerificationCheckResult, VoyantCloudClientOptions } from "./types.js";
|
|
2
|
+
import type { BrowserCrawlSummary, BrowserJsonInput, BrowserLink, BrowserPdfInput, BrowserRenderInput, BrowserScrapeInput, BrowserScreenshotInput, BrowserSessionSummary, BrowserSnapshotResult, CheckVerificationInput, EmailMessageSummary, OpenBrowserSessionInput, PhoneNumberSummary, RunBrowserCommandsInput, RunBrowserCommandsResult, SendEmailInput, SendSmsInput, SmsMessageSummary, StartBrowserCrawlInput, StartBrowserCrawlResult, StartVerificationInput, VaultSecretSummary, VaultSecretValue, VaultSummary, VerificationAttemptSummary, VerificationCheckResult, VoyantCloudClientOptions } from "./types.js";
|
|
3
3
|
export declare class VoyantCloudClient {
|
|
4
4
|
readonly transport: VoyantTransport;
|
|
5
5
|
constructor(options: VoyantCloudClientOptions);
|
|
@@ -23,6 +23,42 @@ export declare class VoyantCloudClient {
|
|
|
23
23
|
listMessages: () => Promise<EmailMessageSummary[]>;
|
|
24
24
|
sendMessage: (input: SendEmailInput) => Promise<EmailMessageSummary>;
|
|
25
25
|
};
|
|
26
|
+
readonly browser: {
|
|
27
|
+
content: (input: BrowserRenderInput) => Promise<string>;
|
|
28
|
+
markdown: (input: BrowserRenderInput) => Promise<string>;
|
|
29
|
+
snapshot: (input: BrowserRenderInput) => Promise<BrowserSnapshotResult>;
|
|
30
|
+
scrape: (input: BrowserScrapeInput) => Promise<{
|
|
31
|
+
selector: string;
|
|
32
|
+
results: Array<{
|
|
33
|
+
text: string;
|
|
34
|
+
attributes: Array<{
|
|
35
|
+
name: string;
|
|
36
|
+
value: string;
|
|
37
|
+
}>;
|
|
38
|
+
html?: string;
|
|
39
|
+
width?: number;
|
|
40
|
+
height?: number;
|
|
41
|
+
top?: number;
|
|
42
|
+
left?: number;
|
|
43
|
+
}>;
|
|
44
|
+
}[]>;
|
|
45
|
+
links: (input: BrowserRenderInput) => Promise<string[] | BrowserLink[]>;
|
|
46
|
+
json: <T = unknown>(input: BrowserJsonInput) => Promise<T>;
|
|
47
|
+
screenshot: (input: BrowserScreenshotInput) => Promise<Uint8Array<ArrayBufferLike>>;
|
|
48
|
+
pdf: (input: BrowserPdfInput) => Promise<Uint8Array<ArrayBufferLike>>;
|
|
49
|
+
crawls: {
|
|
50
|
+
start: (input: StartBrowserCrawlInput) => Promise<StartBrowserCrawlResult>;
|
|
51
|
+
get: (id: string) => Promise<BrowserCrawlSummary>;
|
|
52
|
+
cancel: (id: string) => Promise<null>;
|
|
53
|
+
};
|
|
54
|
+
sessions: {
|
|
55
|
+
open: (input?: OpenBrowserSessionInput) => Promise<BrowserSessionSummary>;
|
|
56
|
+
list: () => Promise<BrowserSessionSummary[]>;
|
|
57
|
+
get: (id: string) => Promise<BrowserSessionSummary>;
|
|
58
|
+
runCommands: (id: string, input: RunBrowserCommandsInput) => Promise<RunBrowserCommandsResult>;
|
|
59
|
+
close: (id: string) => Promise<BrowserSessionSummary>;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
26
62
|
}
|
|
27
63
|
export declare function createVoyantCloudClient(options: VoyantCloudClientOptions): VoyantCloudClient;
|
|
28
64
|
//# sourceMappingURL=client.d.ts.map
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,EACV,sBAAsB,EACtB,mBAAmB,EACnB,kBAAkB,EAClB,cAAc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mBAAmB,gBAAgB;4BAU7B,sBAAsB;qBAM7B,eAAe;;2BAOX,sBAAsB;sBAM3B,MAAM;yBAIH,MAAM;;;2BAOL,uBAAuB;;sBAO3B,MAAM;8BAIE,MAAM,SAAS,uBAAuB;wBAQ5C,MAAM;;MAQpB;CACH;AAED,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,wBAAwB,qBAExE"}
|
package/dist/client.js
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { VoyantTransport } from "@voyant-sdk/sdk-core";
|
|
2
|
+
function unwrapBrowserResult(envelope) {
|
|
3
|
+
if (envelope && typeof envelope === "object" && "result" in envelope && envelope.result !== undefined) {
|
|
4
|
+
return envelope.result;
|
|
5
|
+
}
|
|
6
|
+
return envelope;
|
|
7
|
+
}
|
|
2
8
|
export class VoyantCloudClient {
|
|
3
9
|
transport;
|
|
4
10
|
constructor(options) {
|
|
@@ -36,6 +42,95 @@ export class VoyantCloudClient {
|
|
|
36
42
|
method: "POST",
|
|
37
43
|
}),
|
|
38
44
|
};
|
|
45
|
+
browser = {
|
|
46
|
+
content: async (input) => {
|
|
47
|
+
const envelope = await this.transport.request("/browser/v1/content", {
|
|
48
|
+
body: input,
|
|
49
|
+
method: "POST",
|
|
50
|
+
unwrapData: false,
|
|
51
|
+
});
|
|
52
|
+
return unwrapBrowserResult(envelope);
|
|
53
|
+
},
|
|
54
|
+
markdown: async (input) => {
|
|
55
|
+
const envelope = await this.transport.request("/browser/v1/markdown", {
|
|
56
|
+
body: input,
|
|
57
|
+
method: "POST",
|
|
58
|
+
unwrapData: false,
|
|
59
|
+
});
|
|
60
|
+
return unwrapBrowserResult(envelope);
|
|
61
|
+
},
|
|
62
|
+
snapshot: async (input) => {
|
|
63
|
+
const envelope = await this.transport.request("/browser/v1/snapshot", {
|
|
64
|
+
body: input,
|
|
65
|
+
method: "POST",
|
|
66
|
+
unwrapData: false,
|
|
67
|
+
});
|
|
68
|
+
return unwrapBrowserResult(envelope);
|
|
69
|
+
},
|
|
70
|
+
scrape: async (input) => {
|
|
71
|
+
const envelope = await this.transport.request("/browser/v1/scrape", {
|
|
72
|
+
body: input,
|
|
73
|
+
method: "POST",
|
|
74
|
+
unwrapData: false,
|
|
75
|
+
});
|
|
76
|
+
return unwrapBrowserResult(envelope);
|
|
77
|
+
},
|
|
78
|
+
links: async (input) => {
|
|
79
|
+
const envelope = await this.transport.request("/browser/v1/links", {
|
|
80
|
+
body: input,
|
|
81
|
+
method: "POST",
|
|
82
|
+
unwrapData: false,
|
|
83
|
+
});
|
|
84
|
+
return unwrapBrowserResult(envelope);
|
|
85
|
+
},
|
|
86
|
+
json: async (input) => {
|
|
87
|
+
const envelope = await this.transport.request("/browser/v1/json", {
|
|
88
|
+
body: input,
|
|
89
|
+
method: "POST",
|
|
90
|
+
unwrapData: false,
|
|
91
|
+
});
|
|
92
|
+
return unwrapBrowserResult(envelope);
|
|
93
|
+
},
|
|
94
|
+
screenshot: (input) => this.transport.request("/browser/v1/screenshot", {
|
|
95
|
+
body: input,
|
|
96
|
+
method: "POST",
|
|
97
|
+
responseType: "binary",
|
|
98
|
+
}),
|
|
99
|
+
pdf: (input) => this.transport.request("/browser/v1/pdf", {
|
|
100
|
+
body: input,
|
|
101
|
+
method: "POST",
|
|
102
|
+
responseType: "binary",
|
|
103
|
+
}),
|
|
104
|
+
crawls: {
|
|
105
|
+
start: (input) => this.transport.request("/browser/v1/crawl", {
|
|
106
|
+
body: input,
|
|
107
|
+
method: "POST",
|
|
108
|
+
unwrapData: false,
|
|
109
|
+
}),
|
|
110
|
+
get: (id) => this.transport.request(`/browser/v1/crawl/${id}`, {
|
|
111
|
+
unwrapData: false,
|
|
112
|
+
}),
|
|
113
|
+
cancel: (id) => this.transport.request(`/browser/v1/crawl/${id}`, {
|
|
114
|
+
method: "DELETE",
|
|
115
|
+
responseType: "text",
|
|
116
|
+
}),
|
|
117
|
+
},
|
|
118
|
+
sessions: {
|
|
119
|
+
open: (input = {}) => this.transport.request("/browser/v1/sessions", {
|
|
120
|
+
body: input,
|
|
121
|
+
method: "POST",
|
|
122
|
+
}),
|
|
123
|
+
list: () => this.transport.request("/browser/v1/sessions"),
|
|
124
|
+
get: (id) => this.transport.request(`/browser/v1/sessions/${id}`),
|
|
125
|
+
runCommands: (id, input) => this.transport.request(`/browser/v1/sessions/${id}/commands`, {
|
|
126
|
+
body: input,
|
|
127
|
+
method: "POST",
|
|
128
|
+
}),
|
|
129
|
+
close: (id) => this.transport.request(`/browser/v1/sessions/${id}`, {
|
|
130
|
+
method: "DELETE",
|
|
131
|
+
}),
|
|
132
|
+
},
|
|
133
|
+
};
|
|
39
134
|
}
|
|
40
135
|
export function createVoyantCloudClient(options) {
|
|
41
136
|
return new VoyantCloudClient(options);
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { createVoyantCloudClient, VoyantCloudClient } from "./client.js";
|
|
2
|
-
export type { CheckVerificationInput, EmailMessageStatus, EmailMessageSummary, PhoneNumberCapabilities, PhoneNumberStatus, PhoneNumberSummary, SendEmailInput, SendSmsInput, SmsMessageStatus, SmsMessageSummary, StartVerificationInput, VaultSecretSummary, VaultSecretValue, VaultSummary, VerificationAttemptStatus, VerificationAttemptSummary, VerificationChannel, VerificationCheckResult, VoyantCloudClientOptions, } from "./types.js";
|
|
2
|
+
export type { BrowserCommand, BrowserCommandResult, BrowserCookie, BrowserCrawlSummary, BrowserGoToOptions, BrowserJobKind, BrowserJobStatus, BrowserJsonInput, BrowserLink, BrowserPdfInput, BrowserPdfOptions, BrowserRenderInput, BrowserSameSite, BrowserScrapeElement, BrowserScrapeInput, BrowserScrapeResult, BrowserScreenshotInput, BrowserScreenshotOptions, BrowserSessionStatus, BrowserSessionSummary, BrowserSnapshotResult, BrowserViewport, BrowserWaitForSelector, BrowserWaitUntil, CheckVerificationInput, EmailMessageStatus, EmailMessageSummary, OpenBrowserSessionInput, PhoneNumberCapabilities, PhoneNumberStatus, PhoneNumberSummary, RunBrowserCommandsInput, RunBrowserCommandsResult, SendEmailAttachment, SendEmailInput, SendSmsInput, SmsMessageStatus, SmsMessageSummary, StartBrowserCrawlInput, StartBrowserCrawlResult, StartVerificationInput, VaultSecretSummary, VaultSecretValue, VaultSummary, VerificationAttemptStatus, VerificationAttemptSummary, VerificationChannel, VerificationCheckResult, VoyantCloudClientOptions, } from "./types.js";
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACzE,YAAY,EACV,sBAAsB,EACtB,kBAAkB,EAClB,mBAAmB,EACnB,uBAAuB,EACvB,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACtB,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,EACZ,yBAAyB,EACzB,0BAA0B,EAC1B,mBAAmB,EACnB,uBAAuB,EACvB,wBAAwB,GACzB,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACzE,YAAY,EACV,cAAc,EACd,oBAAoB,EACpB,aAAa,EACb,mBAAmB,EACnB,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,EACtB,wBAAwB,EACxB,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,eAAe,EACf,sBAAsB,EACtB,gBAAgB,EAChB,sBAAsB,EACtB,kBAAkB,EAClB,mBAAmB,EACnB,uBAAuB,EACvB,uBAAuB,EACvB,iBAAiB,EACjB,kBAAkB,EAClB,uBAAuB,EACvB,wBAAwB,EACxB,mBAAmB,EACnB,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACtB,uBAAuB,EACvB,sBAAsB,EACtB,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,EACZ,yBAAyB,EACzB,0BAA0B,EAC1B,mBAAmB,EACnB,uBAAuB,EACvB,wBAAwB,GACzB,MAAM,YAAY,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -107,16 +107,29 @@ export interface EmailMessageSummary {
|
|
|
107
107
|
lastEventAt: string | null;
|
|
108
108
|
openCount: number;
|
|
109
109
|
organizationId: string;
|
|
110
|
+
providerEmailId: string | null;
|
|
110
111
|
providerStatus: string | null;
|
|
111
112
|
replyTo: string[];
|
|
112
|
-
resendEmailId: string | null;
|
|
113
113
|
sentAt: string | null;
|
|
114
114
|
status: EmailMessageStatus;
|
|
115
115
|
subject: string;
|
|
116
116
|
toAddresses: string[];
|
|
117
117
|
updatedAt: string;
|
|
118
118
|
}
|
|
119
|
+
export interface SendEmailAttachment {
|
|
120
|
+
/** Filename presented to the recipient. */
|
|
121
|
+
filename: string;
|
|
122
|
+
/** Base64-encoded file bytes. Mutually exclusive with `path`. */
|
|
123
|
+
content?: string;
|
|
124
|
+
/** Public URL the email provider will fetch. Mutually exclusive with `content`. */
|
|
125
|
+
path?: string;
|
|
126
|
+
/** MIME type override (e.g. "application/pdf"). */
|
|
127
|
+
contentType?: string;
|
|
128
|
+
/** Content-ID for inline images referenced via `cid:` in HTML. */
|
|
129
|
+
contentId?: string;
|
|
130
|
+
}
|
|
119
131
|
export interface SendEmailInput {
|
|
132
|
+
attachments?: SendEmailAttachment[] | null;
|
|
120
133
|
bcc?: string[] | null;
|
|
121
134
|
cc?: string[] | null;
|
|
122
135
|
from: string;
|
|
@@ -126,4 +139,268 @@ export interface SendEmailInput {
|
|
|
126
139
|
text?: string | null;
|
|
127
140
|
to: string[];
|
|
128
141
|
}
|
|
142
|
+
export type BrowserSessionStatus = "active" | "closed" | "expired";
|
|
143
|
+
export type BrowserJobKind = "crawl";
|
|
144
|
+
export type BrowserJobStatus = "queued" | "running" | "completed" | "errored" | "cancelled_due_to_timeout" | "cancelled_due_to_limits" | "cancelled_by_user";
|
|
145
|
+
export type BrowserWaitUntil = "load" | "domcontentloaded" | "networkidle0" | "networkidle2";
|
|
146
|
+
export type BrowserSameSite = "Strict" | "Lax" | "None";
|
|
147
|
+
export interface BrowserCookie {
|
|
148
|
+
name: string;
|
|
149
|
+
value: string;
|
|
150
|
+
url?: string;
|
|
151
|
+
domain?: string;
|
|
152
|
+
path?: string;
|
|
153
|
+
expires?: number;
|
|
154
|
+
httpOnly?: boolean;
|
|
155
|
+
secure?: boolean;
|
|
156
|
+
sameSite?: BrowserSameSite;
|
|
157
|
+
}
|
|
158
|
+
export interface BrowserViewport {
|
|
159
|
+
width: number;
|
|
160
|
+
height: number;
|
|
161
|
+
deviceScaleFactor?: number;
|
|
162
|
+
isMobile?: boolean;
|
|
163
|
+
hasTouch?: boolean;
|
|
164
|
+
isLandscape?: boolean;
|
|
165
|
+
}
|
|
166
|
+
export interface BrowserGoToOptions {
|
|
167
|
+
timeout?: number;
|
|
168
|
+
waitUntil?: BrowserWaitUntil;
|
|
169
|
+
referer?: string;
|
|
170
|
+
}
|
|
171
|
+
export interface BrowserWaitForSelector {
|
|
172
|
+
selector: string;
|
|
173
|
+
timeout?: number;
|
|
174
|
+
visible?: boolean;
|
|
175
|
+
hidden?: boolean;
|
|
176
|
+
}
|
|
177
|
+
export interface BrowserScreenshotOptions {
|
|
178
|
+
fullPage?: boolean;
|
|
179
|
+
omitBackground?: boolean;
|
|
180
|
+
type?: "png" | "jpeg" | "webp";
|
|
181
|
+
quality?: number;
|
|
182
|
+
clip?: {
|
|
183
|
+
x: number;
|
|
184
|
+
y: number;
|
|
185
|
+
width: number;
|
|
186
|
+
height: number;
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
export interface BrowserPdfOptions {
|
|
190
|
+
format?: "letter" | "legal" | "tabloid" | "ledger" | "a0" | "a1" | "a2" | "a3" | "a4" | "a5" | "a6";
|
|
191
|
+
landscape?: boolean;
|
|
192
|
+
printBackground?: boolean;
|
|
193
|
+
scale?: number;
|
|
194
|
+
margin?: {
|
|
195
|
+
top?: number | string;
|
|
196
|
+
bottom?: number | string;
|
|
197
|
+
left?: number | string;
|
|
198
|
+
right?: number | string;
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Common request fields accepted by every browser render endpoint. Forwarded
|
|
203
|
+
* to Cloudflare Browser Rendering, so any field supported by that API is
|
|
204
|
+
* accepted as well via the index signature.
|
|
205
|
+
*/
|
|
206
|
+
export interface BrowserRenderInput {
|
|
207
|
+
url?: string;
|
|
208
|
+
html?: string;
|
|
209
|
+
cookies?: BrowserCookie[];
|
|
210
|
+
viewport?: BrowserViewport;
|
|
211
|
+
userAgent?: string;
|
|
212
|
+
setExtraHTTPHeaders?: Record<string, string>;
|
|
213
|
+
authenticate?: {
|
|
214
|
+
username: string;
|
|
215
|
+
password: string;
|
|
216
|
+
};
|
|
217
|
+
rejectResourceTypes?: string[];
|
|
218
|
+
rejectRequestPattern?: string[];
|
|
219
|
+
allowResourceTypes?: string[];
|
|
220
|
+
allowRequestPattern?: string[];
|
|
221
|
+
bestAttempt?: boolean;
|
|
222
|
+
emulateMediaType?: "screen" | "print";
|
|
223
|
+
goToOptions?: BrowserGoToOptions;
|
|
224
|
+
waitForSelector?: BrowserWaitForSelector;
|
|
225
|
+
waitForTimeout?: number;
|
|
226
|
+
[key: string]: unknown;
|
|
227
|
+
}
|
|
228
|
+
export interface BrowserScreenshotInput extends BrowserRenderInput {
|
|
229
|
+
selector?: string;
|
|
230
|
+
screenshotOptions?: BrowserScreenshotOptions;
|
|
231
|
+
}
|
|
232
|
+
export interface BrowserPdfInput extends BrowserRenderInput {
|
|
233
|
+
pdfOptions?: BrowserPdfOptions;
|
|
234
|
+
}
|
|
235
|
+
export interface BrowserScrapeElement {
|
|
236
|
+
selector: string;
|
|
237
|
+
}
|
|
238
|
+
export interface BrowserScrapeInput extends BrowserRenderInput {
|
|
239
|
+
elements?: BrowserScrapeElement[];
|
|
240
|
+
}
|
|
241
|
+
export interface BrowserScrapeResult {
|
|
242
|
+
results: Array<{
|
|
243
|
+
selector: string;
|
|
244
|
+
results: Array<{
|
|
245
|
+
text: string;
|
|
246
|
+
attributes: Array<{
|
|
247
|
+
name: string;
|
|
248
|
+
value: string;
|
|
249
|
+
}>;
|
|
250
|
+
html?: string;
|
|
251
|
+
width?: number;
|
|
252
|
+
height?: number;
|
|
253
|
+
top?: number;
|
|
254
|
+
left?: number;
|
|
255
|
+
}>;
|
|
256
|
+
}>;
|
|
257
|
+
}
|
|
258
|
+
export interface BrowserLink {
|
|
259
|
+
url: string;
|
|
260
|
+
text?: string;
|
|
261
|
+
}
|
|
262
|
+
export interface BrowserSnapshotResult {
|
|
263
|
+
content: string;
|
|
264
|
+
screenshot: string;
|
|
265
|
+
}
|
|
266
|
+
export interface BrowserJsonInput extends BrowserRenderInput {
|
|
267
|
+
prompt?: string;
|
|
268
|
+
responseFormat?: {
|
|
269
|
+
type: "json_schema";
|
|
270
|
+
schema: unknown;
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
export interface StartBrowserCrawlInput {
|
|
274
|
+
url: string;
|
|
275
|
+
[key: string]: unknown;
|
|
276
|
+
}
|
|
277
|
+
export interface BrowserCrawlSummary {
|
|
278
|
+
id: string;
|
|
279
|
+
kind: BrowserJobKind;
|
|
280
|
+
status: BrowserJobStatus;
|
|
281
|
+
inputUrl: string;
|
|
282
|
+
browserMsUsed: number;
|
|
283
|
+
resultSummary: {
|
|
284
|
+
total?: number;
|
|
285
|
+
finished?: number;
|
|
286
|
+
errored?: number;
|
|
287
|
+
cursor?: string | null;
|
|
288
|
+
} | null;
|
|
289
|
+
errorMessage: string | null;
|
|
290
|
+
createdAt: string;
|
|
291
|
+
updatedAt: string;
|
|
292
|
+
completedAt: string | null;
|
|
293
|
+
}
|
|
294
|
+
export interface StartBrowserCrawlResult {
|
|
295
|
+
id: string;
|
|
296
|
+
status: BrowserJobStatus;
|
|
297
|
+
providerJobId: string;
|
|
298
|
+
}
|
|
299
|
+
export interface OpenBrowserSessionInput {
|
|
300
|
+
/** Human-readable label persisted on the session record. */
|
|
301
|
+
label?: string | null;
|
|
302
|
+
/** Keep-alive duration in milliseconds. Capped server-side at 1 hour. */
|
|
303
|
+
keepAliveMs?: number;
|
|
304
|
+
}
|
|
305
|
+
export interface BrowserSessionSummary {
|
|
306
|
+
id: string;
|
|
307
|
+
organizationId: string;
|
|
308
|
+
apiTokenId: string | null;
|
|
309
|
+
status: BrowserSessionStatus;
|
|
310
|
+
label: string | null;
|
|
311
|
+
browserMsUsed: number;
|
|
312
|
+
commandCount: number;
|
|
313
|
+
keepAliveMs: number;
|
|
314
|
+
lastUsedAt: string;
|
|
315
|
+
closedAt: string | null;
|
|
316
|
+
createdAt: string;
|
|
317
|
+
}
|
|
318
|
+
export type BrowserCommand = {
|
|
319
|
+
op: "goto";
|
|
320
|
+
url: string;
|
|
321
|
+
options?: BrowserGoToOptions;
|
|
322
|
+
} | {
|
|
323
|
+
op: "waitForSelector";
|
|
324
|
+
selector: string;
|
|
325
|
+
options?: {
|
|
326
|
+
timeout?: number;
|
|
327
|
+
visible?: boolean;
|
|
328
|
+
hidden?: boolean;
|
|
329
|
+
};
|
|
330
|
+
} | {
|
|
331
|
+
op: "waitForNavigation";
|
|
332
|
+
options?: BrowserGoToOptions;
|
|
333
|
+
} | {
|
|
334
|
+
op: "waitForTimeout";
|
|
335
|
+
ms: number;
|
|
336
|
+
} | {
|
|
337
|
+
op: "click";
|
|
338
|
+
selector: string;
|
|
339
|
+
options?: {
|
|
340
|
+
button?: "left" | "right" | "middle";
|
|
341
|
+
clickCount?: number;
|
|
342
|
+
delay?: number;
|
|
343
|
+
};
|
|
344
|
+
} | {
|
|
345
|
+
op: "type";
|
|
346
|
+
selector: string;
|
|
347
|
+
text: string;
|
|
348
|
+
options?: {
|
|
349
|
+
delay?: number;
|
|
350
|
+
};
|
|
351
|
+
} | {
|
|
352
|
+
op: "select";
|
|
353
|
+
selector: string;
|
|
354
|
+
values: string[];
|
|
355
|
+
} | {
|
|
356
|
+
op: "screenshot";
|
|
357
|
+
options?: BrowserScreenshotOptions;
|
|
358
|
+
} | {
|
|
359
|
+
op: "pdf";
|
|
360
|
+
options?: BrowserPdfOptions;
|
|
361
|
+
} | {
|
|
362
|
+
op: "content";
|
|
363
|
+
} | {
|
|
364
|
+
op: "title";
|
|
365
|
+
} | {
|
|
366
|
+
op: "url";
|
|
367
|
+
} | {
|
|
368
|
+
op: "evaluate";
|
|
369
|
+
script: string;
|
|
370
|
+
} | {
|
|
371
|
+
op: "cookies.get";
|
|
372
|
+
urls?: string[];
|
|
373
|
+
} | {
|
|
374
|
+
op: "cookies.set";
|
|
375
|
+
cookies: BrowserCookie[];
|
|
376
|
+
} | {
|
|
377
|
+
op: "setViewport";
|
|
378
|
+
width: number;
|
|
379
|
+
height: number;
|
|
380
|
+
deviceScaleFactor?: number;
|
|
381
|
+
} | {
|
|
382
|
+
op: "setUserAgent";
|
|
383
|
+
userAgent: string;
|
|
384
|
+
} | {
|
|
385
|
+
op: "setExtraHTTPHeaders";
|
|
386
|
+
headers: Record<string, string>;
|
|
387
|
+
};
|
|
388
|
+
export type BrowserCommandResult = {
|
|
389
|
+
op: BrowserCommand["op"];
|
|
390
|
+
durationMs: number;
|
|
391
|
+
} & ({
|
|
392
|
+
ok: true;
|
|
393
|
+
result: unknown;
|
|
394
|
+
} | {
|
|
395
|
+
ok: false;
|
|
396
|
+
error: string;
|
|
397
|
+
});
|
|
398
|
+
export interface RunBrowserCommandsInput {
|
|
399
|
+
commands: BrowserCommand[];
|
|
400
|
+
}
|
|
401
|
+
export interface RunBrowserCommandsResult {
|
|
402
|
+
sessionId: string;
|
|
403
|
+
results: BrowserCommandResult[];
|
|
404
|
+
totalMs: number;
|
|
405
|
+
}
|
|
129
406
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAEnE,MAAM,MAAM,wBAAwB,GAAG,sBAAsB,CAAC;AAE9D,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,WAAW,GAAG,UAAU,CAAC;AAEpE,MAAM,MAAM,gBAAgB,GACxB,QAAQ,GACR,MAAM,GACN,WAAW,GACX,aAAa,GACb,QAAQ,CAAC;AAEb,MAAM,MAAM,mBAAmB,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,CAAC;AAExE,MAAM,MAAM,yBAAyB,GACjC,SAAS,GACT,UAAU,GACV,UAAU,GACV,SAAS,GACT,QAAQ,CAAC;AAEb,MAAM,MAAM,kBAAkB,GAC1B,QAAQ,GACR,MAAM,GACN,WAAW,GACX,kBAAkB,GAClB,SAAS,GACT,YAAY,GACZ,QAAQ,GACR,SAAS,GACT,QAAQ,CAAC;AAEb,MAAM,WAAW,uBAAuB;IACtC,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,SAA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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAe,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AA8E5F,qBAAa,eAAe;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IACpC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAgB;IAC3C,OAAO,CAAC,QAAQ,CAAC,cAAc,CAA0B;IACzD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAe;IACzC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;gBAEvB,OAAO,EAAE,sBAAsB;IAUrC,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,oBAAyB;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAe,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AA8E5F,qBAAa,eAAe;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IACpC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAgB;IAC3C,OAAO,CAAC,QAAQ,CAAC,cAAc,CAA0B;IACzD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAe;IACzC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;gBAEvB,OAAO,EAAE,sBAAsB;IAUrC,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,oBAAyB;CA6FlE"}
|
|
@@ -102,7 +102,32 @@ export class VoyantTransport {
|
|
|
102
102
|
method: options.method ?? "GET",
|
|
103
103
|
signal: options.signal,
|
|
104
104
|
});
|
|
105
|
+
const responseType = options.responseType ?? "json";
|
|
106
|
+
if (responseType === "binary") {
|
|
107
|
+
if (!response.ok) {
|
|
108
|
+
const text = await response.text();
|
|
109
|
+
const parsed = maybeJson(text, response.headers.get("content-type"));
|
|
110
|
+
throw new VoyantApiError(getErrorMessage(parsed, `Request failed with status ${response.status}`), {
|
|
111
|
+
body: parsed,
|
|
112
|
+
requestId: response.headers.get("x-request-id"),
|
|
113
|
+
status: response.status,
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
const buffer = await response.arrayBuffer();
|
|
117
|
+
return new Uint8Array(buffer);
|
|
118
|
+
}
|
|
105
119
|
const text = await response.text();
|
|
120
|
+
if (responseType === "text") {
|
|
121
|
+
if (!response.ok) {
|
|
122
|
+
const parsed = maybeJson(text, response.headers.get("content-type"));
|
|
123
|
+
throw new VoyantApiError(getErrorMessage(parsed, `Request failed with status ${response.status}`), {
|
|
124
|
+
body: parsed,
|
|
125
|
+
requestId: response.headers.get("x-request-id"),
|
|
126
|
+
status: response.status,
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
return text;
|
|
130
|
+
}
|
|
106
131
|
const parsed = maybeJson(text, response.headers.get("content-type"));
|
|
107
132
|
if (!response.ok) {
|
|
108
133
|
throw new VoyantApiError(getErrorMessage(parsed, `Request failed with status ${response.status}`), {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { VoyantTransport } from "./client.js";
|
|
2
2
|
export { VoyantApiError } from "./errors.js";
|
|
3
|
-
export type { FetchLike, JsonObject, JsonPrimitive, JsonValue, QueryParams, QueryValue, VoyantRequestOptions, VoyantTransportOptions, } from "./types.js";
|
|
3
|
+
export type { FetchLike, JsonObject, JsonPrimitive, JsonValue, QueryParams, QueryValue, VoyantRequestOptions, VoyantResponseType, VoyantTransportOptions, } from "./types.js";
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,YAAY,EACV,SAAS,EACT,UAAU,EACV,aAAa,EACb,SAAS,EACT,WAAW,EACX,UAAU,EACV,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,YAAY,EACV,SAAS,EACT,UAAU,EACV,aAAa,EACb,SAAS,EACT,WAAW,EACX,UAAU,EACV,oBAAoB,EACpB,kBAAkB,EAClB,sBAAsB,GACvB,MAAM,YAAY,CAAC"}
|
|
@@ -15,11 +15,13 @@ export interface VoyantTransportOptions {
|
|
|
15
15
|
headers?: HeadersInit;
|
|
16
16
|
userAgent?: string;
|
|
17
17
|
}
|
|
18
|
+
export type VoyantResponseType = "json" | "text" | "binary";
|
|
18
19
|
export interface VoyantRequestOptions {
|
|
19
20
|
body?: BodyInit | object | null;
|
|
20
21
|
headers?: HeadersInit;
|
|
21
22
|
method?: "DELETE" | "GET" | "PATCH" | "POST" | "PUT";
|
|
22
23
|
query?: QueryParams;
|
|
24
|
+
responseType?: VoyantResponseType;
|
|
23
25
|
signal?: AbortSignal;
|
|
24
26
|
unwrapData?: boolean;
|
|
25
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,OAAO,KAAK,CAAC;AAErC,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,I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
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"private": true,
|
|
5
5
|
"description": "Private shared runtime for Voyant SDK packages.",
|
|
6
6
|
"type": "module",
|
|
@@ -13,7 +13,9 @@
|
|
|
13
13
|
"default": "./dist/index.js"
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
|
-
"files": [
|
|
16
|
+
"files": [
|
|
17
|
+
"dist"
|
|
18
|
+
],
|
|
17
19
|
"scripts": {
|
|
18
20
|
"build": "tsc -p tsconfig.json",
|
|
19
21
|
"lint": "eslint src --max-warnings 0",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voyantjs/cloud-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Public TypeScript SDK for Voyant Cloud APIs.",
|
|
5
5
|
"license": "FSL-1.1-Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
},
|
|
15
15
|
"type": "module",
|
|
16
16
|
"main": "./dist/index.js",
|
|
17
|
-
"types": "./
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
18
|
"sideEffects": false,
|
|
19
19
|
"keywords": [
|
|
20
20
|
"voyant",
|
|
@@ -24,37 +24,31 @@
|
|
|
24
24
|
],
|
|
25
25
|
"exports": {
|
|
26
26
|
".": {
|
|
27
|
-
"types": "./
|
|
28
|
-
"
|
|
27
|
+
"types": "./dist/index.d.ts",
|
|
28
|
+
"import": "./dist/index.js"
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
|
-
"files": [
|
|
31
|
+
"files": [
|
|
32
|
+
"dist"
|
|
33
|
+
],
|
|
32
34
|
"bundleDependencies": [
|
|
33
35
|
"@voyant-sdk/sdk-core"
|
|
34
36
|
],
|
|
35
|
-
"scripts": {
|
|
36
|
-
"build": "tsc -p tsconfig.json",
|
|
37
|
-
"lint": "eslint src --max-warnings 0",
|
|
38
|
-
"check-types": "tsc --noEmit"
|
|
39
|
-
},
|
|
40
37
|
"dependencies": {
|
|
41
|
-
"@voyant-sdk/sdk-core": "
|
|
38
|
+
"@voyant-sdk/sdk-core": "0.2.0"
|
|
42
39
|
},
|
|
43
40
|
"devDependencies": {
|
|
44
|
-
"@voyant-sdk/eslint-config": "workspace:*",
|
|
45
|
-
"@voyant-sdk/typescript-config": "workspace:*",
|
|
46
41
|
"eslint": "^9.39.1",
|
|
47
|
-
"typescript": "5.9.2"
|
|
42
|
+
"typescript": "5.9.2",
|
|
43
|
+
"@voyant-sdk/eslint-config": "0.0.0",
|
|
44
|
+
"@voyant-sdk/typescript-config": "0.0.0"
|
|
48
45
|
},
|
|
49
46
|
"publishConfig": {
|
|
50
|
-
"access": "public"
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
"
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
"import": "./dist/index.js"
|
|
57
|
-
}
|
|
58
|
-
}
|
|
47
|
+
"access": "public"
|
|
48
|
+
},
|
|
49
|
+
"scripts": {
|
|
50
|
+
"build": "tsc -p tsconfig.json",
|
|
51
|
+
"lint": "eslint src --max-warnings 0",
|
|
52
|
+
"check-types": "tsc --noEmit"
|
|
59
53
|
}
|
|
60
|
-
}
|
|
54
|
+
}
|