@voyantjs/cloud-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/README.md +73 -0
- package/dist/client.d.ts +28 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +42 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -0
- package/dist/types.d.ts +129 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +1 -0
- package/node_modules/@voyant-sdk/sdk-core/README.md +31 -0
- package/node_modules/@voyant-sdk/sdk-core/dist/client.d.ts +13 -0
- package/node_modules/@voyant-sdk/sdk-core/dist/client.d.ts.map +1 -0
- package/node_modules/@voyant-sdk/sdk-core/dist/client.js +122 -0
- package/node_modules/@voyant-sdk/sdk-core/dist/errors.d.ts +11 -0
- package/node_modules/@voyant-sdk/sdk-core/dist/errors.d.ts.map +1 -0
- package/node_modules/@voyant-sdk/sdk-core/dist/errors.js +12 -0
- package/node_modules/@voyant-sdk/sdk-core/dist/index.d.ts +4 -0
- package/node_modules/@voyant-sdk/sdk-core/dist/index.d.ts.map +1 -0
- package/node_modules/@voyant-sdk/sdk-core/dist/index.js +2 -0
- package/node_modules/@voyant-sdk/sdk-core/dist/types.d.ts +26 -0
- package/node_modules/@voyant-sdk/sdk-core/dist/types.d.ts.map +1 -0
- package/node_modules/@voyant-sdk/sdk-core/dist/types.js +1 -0
- package/node_modules/@voyant-sdk/sdk-core/package.json +38 -0
- package/package.json +60 -0
package/README.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# `@voyantjs/cloud-sdk`
|
|
2
|
+
|
|
3
|
+
Public TypeScript client for Voyant Cloud APIs.
|
|
4
|
+
|
|
5
|
+
## Scope
|
|
6
|
+
|
|
7
|
+
`@voyantjs/cloud-sdk` is for hosted Voyant Cloud services:
|
|
8
|
+
|
|
9
|
+
- vault (read secrets)
|
|
10
|
+
- sms (send messages, list phone numbers and messages)
|
|
11
|
+
- verification (start verification, check codes, list recent attempts)
|
|
12
|
+
- email (list, send, and fetch email messages)
|
|
13
|
+
|
|
14
|
+
## Install
|
|
15
|
+
|
|
16
|
+
```sh
|
|
17
|
+
pnpm add @voyantjs/cloud-sdk
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
import { createVoyantCloudClient } from "@voyantjs/cloud-sdk";
|
|
24
|
+
|
|
25
|
+
const client = createVoyantCloudClient({
|
|
26
|
+
apiKey: process.env.VOYANT_API_KEY!,
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const vaults = await client.vault.listVaults();
|
|
30
|
+
const phoneNumbers = await client.sms.listPhoneNumbers();
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Shape
|
|
34
|
+
|
|
35
|
+
Root groups:
|
|
36
|
+
|
|
37
|
+
- `vault`
|
|
38
|
+
- `sms`
|
|
39
|
+
- `verification`
|
|
40
|
+
- `email`
|
|
41
|
+
|
|
42
|
+
The `vault` group covers list-vaults, list-secrets, and get-secret routes.
|
|
43
|
+
|
|
44
|
+
The `sms` group covers list-phone-numbers, list-messages, and send-message
|
|
45
|
+
routes.
|
|
46
|
+
|
|
47
|
+
The `verification` group covers verification start, check, and list-attempts routes.
|
|
48
|
+
|
|
49
|
+
The `email` group covers list-messages, send-message, and get-message routes.
|
|
50
|
+
|
|
51
|
+
## Key public types
|
|
52
|
+
|
|
53
|
+
Useful exported types include:
|
|
54
|
+
|
|
55
|
+
- `VaultSummary`, `VaultSecretSummary`, `VaultSecretValue`
|
|
56
|
+
- `PhoneNumberSummary`, `SmsMessageSummary`, `SendSmsInput`
|
|
57
|
+
- `VerificationAttemptSummary`, `VerificationCheckResult`
|
|
58
|
+
- `StartVerificationInput`, `CheckVerificationInput`
|
|
59
|
+
- `EmailMessageSummary`, `SendEmailInput`
|
|
60
|
+
- `PhoneNumberStatus`, `SmsMessageStatus`, `VerificationChannel`,
|
|
61
|
+
`VerificationAttemptStatus`, `EmailMessageStatus`
|
|
62
|
+
|
|
63
|
+
## Notes
|
|
64
|
+
|
|
65
|
+
- default base URL is `https://api.voyantjs.com`
|
|
66
|
+
- request auth defaults to `authorization: Bearer <apiKey>`
|
|
67
|
+
- response envelopes of the form `{ data: ... }` are unwrapped by default
|
|
68
|
+
- API tokens are scoped (`vault:read`, `sms:read`, `sms:send`,
|
|
69
|
+
`phone-numbers:read`, `verification:start`, `verification:check`,
|
|
70
|
+
`verification:read`, `emails:read`, `emails:send`); requests fail with `403`
|
|
71
|
+
if the token does not include the required scope
|
|
72
|
+
|
|
73
|
+
For repo-level context, see [../../docs/cloud.md](../../docs/cloud.md).
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
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";
|
|
3
|
+
export declare class VoyantCloudClient {
|
|
4
|
+
readonly transport: VoyantTransport;
|
|
5
|
+
constructor(options: VoyantCloudClientOptions);
|
|
6
|
+
readonly vault: {
|
|
7
|
+
getSecret: (vaultSlug: string, key: string) => Promise<VaultSecretValue>;
|
|
8
|
+
listSecrets: (vaultSlug: string) => Promise<VaultSecretSummary[]>;
|
|
9
|
+
listVaults: () => Promise<VaultSummary[]>;
|
|
10
|
+
};
|
|
11
|
+
readonly sms: {
|
|
12
|
+
listMessages: () => Promise<SmsMessageSummary[]>;
|
|
13
|
+
listPhoneNumbers: () => Promise<PhoneNumberSummary[]>;
|
|
14
|
+
sendMessage: (input: SendSmsInput) => Promise<SmsMessageSummary>;
|
|
15
|
+
};
|
|
16
|
+
readonly verification: {
|
|
17
|
+
check: (input: CheckVerificationInput) => Promise<VerificationCheckResult>;
|
|
18
|
+
listAttempts: () => Promise<VerificationAttemptSummary[]>;
|
|
19
|
+
start: (input: StartVerificationInput) => Promise<VerificationAttemptSummary>;
|
|
20
|
+
};
|
|
21
|
+
readonly email: {
|
|
22
|
+
getMessage: (id: string) => Promise<EmailMessageSummary>;
|
|
23
|
+
listMessages: () => Promise<EmailMessageSummary[]>;
|
|
24
|
+
sendMessage: (input: SendEmailInput) => Promise<EmailMessageSummary>;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export declare function createVoyantCloudClient(options: VoyantCloudClientOptions): VoyantCloudClient;
|
|
28
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +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,EACd,YAAY,EACZ,iBAAiB,EACjB,sBAAsB,EACtB,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,EACZ,0BAA0B,EAC1B,uBAAuB,EACvB,wBAAwB,EACzB,MAAM,YAAY,CAAC;AAEpB,qBAAa,iBAAiB;IAC5B,QAAQ,CAAC,SAAS,EAAE,eAAe,CAAC;gBAExB,OAAO,EAAE,wBAAwB;IAI7C,QAAQ,CAAC,KAAK;+BACW,MAAM,OAAO,MAAM;iCAIjB,MAAM;;MAK/B;IAEF,QAAQ,CAAC,GAAG;;;6BAKW,YAAY;MAKjC;IAEF,QAAQ,CAAC,YAAY;uBACJ,sBAAsB;;uBAStB,sBAAsB;MAKrC;IAEF,QAAQ,CAAC,KAAK;yBACK,MAAM;;6BAIF,cAAc;MAKnC;CACH;AAED,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,wBAAwB,qBAExE"}
|
package/dist/client.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { VoyantTransport } from "@voyant-sdk/sdk-core";
|
|
2
|
+
export class VoyantCloudClient {
|
|
3
|
+
transport;
|
|
4
|
+
constructor(options) {
|
|
5
|
+
this.transport = new VoyantTransport(options);
|
|
6
|
+
}
|
|
7
|
+
vault = {
|
|
8
|
+
getSecret: (vaultSlug, key) => this.transport.request(`/vault/v1/${vaultSlug}/secrets/${key}`),
|
|
9
|
+
listSecrets: (vaultSlug) => this.transport.request(`/vault/v1/${vaultSlug}/secrets`),
|
|
10
|
+
listVaults: () => this.transport.request("/vault/v1"),
|
|
11
|
+
};
|
|
12
|
+
sms = {
|
|
13
|
+
listMessages: () => this.transport.request("/sms/v1/messages"),
|
|
14
|
+
listPhoneNumbers: () => this.transport.request("/sms/v1/phone-numbers"),
|
|
15
|
+
sendMessage: (input) => this.transport.request("/sms/v1/messages", {
|
|
16
|
+
body: input,
|
|
17
|
+
method: "POST",
|
|
18
|
+
}),
|
|
19
|
+
};
|
|
20
|
+
verification = {
|
|
21
|
+
check: (input) => this.transport.request("/verify/v1/check", {
|
|
22
|
+
body: input,
|
|
23
|
+
method: "POST",
|
|
24
|
+
}),
|
|
25
|
+
listAttempts: () => this.transport.request("/verify/v1/attempts"),
|
|
26
|
+
start: (input) => this.transport.request("/verify/v1/start", {
|
|
27
|
+
body: input,
|
|
28
|
+
method: "POST",
|
|
29
|
+
}),
|
|
30
|
+
};
|
|
31
|
+
email = {
|
|
32
|
+
getMessage: (id) => this.transport.request(`/email/v1/messages/${id}`),
|
|
33
|
+
listMessages: () => this.transport.request("/email/v1/messages"),
|
|
34
|
+
sendMessage: (input) => this.transport.request("/email/v1/messages", {
|
|
35
|
+
body: input,
|
|
36
|
+
method: "POST",
|
|
37
|
+
}),
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export function createVoyantCloudClient(options) {
|
|
41
|
+
return new VoyantCloudClient(options);
|
|
42
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
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";
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +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"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createVoyantCloudClient, VoyantCloudClient } from "./client.js";
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import type { VoyantTransportOptions } from "@voyant-sdk/sdk-core";
|
|
2
|
+
export type VoyantCloudClientOptions = VoyantTransportOptions;
|
|
3
|
+
export type PhoneNumberStatus = "active" | "suspended" | "released";
|
|
4
|
+
export type SmsMessageStatus = "queued" | "sent" | "delivered" | "undelivered" | "failed";
|
|
5
|
+
export type VerificationChannel = "sms" | "call" | "email" | "whatsapp";
|
|
6
|
+
export type VerificationAttemptStatus = "pending" | "approved" | "canceled" | "expired" | "failed";
|
|
7
|
+
export type EmailMessageStatus = "queued" | "sent" | "delivered" | "delivery_delayed" | "bounced" | "complained" | "opened" | "clicked" | "failed";
|
|
8
|
+
export interface PhoneNumberCapabilities {
|
|
9
|
+
mms?: boolean;
|
|
10
|
+
sms?: boolean;
|
|
11
|
+
voice?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface VaultSummary {
|
|
14
|
+
createdAt: string;
|
|
15
|
+
description: string | null;
|
|
16
|
+
id: string;
|
|
17
|
+
name: string;
|
|
18
|
+
secretCount: number;
|
|
19
|
+
slug: string;
|
|
20
|
+
updatedAt: string;
|
|
21
|
+
}
|
|
22
|
+
export interface VaultSecretSummary {
|
|
23
|
+
createdAt: string;
|
|
24
|
+
key: string;
|
|
25
|
+
updatedAt: string;
|
|
26
|
+
version: number;
|
|
27
|
+
}
|
|
28
|
+
export interface VaultSecretValue {
|
|
29
|
+
key: string;
|
|
30
|
+
updatedAt: string;
|
|
31
|
+
value: string;
|
|
32
|
+
version: number;
|
|
33
|
+
}
|
|
34
|
+
export interface PhoneNumberSummary {
|
|
35
|
+
capabilities: PhoneNumberCapabilities;
|
|
36
|
+
country: string;
|
|
37
|
+
createdAt: string;
|
|
38
|
+
friendlyName: string | null;
|
|
39
|
+
id: string;
|
|
40
|
+
isShared: boolean;
|
|
41
|
+
monthlyCostCents: number | null;
|
|
42
|
+
organizationId: string;
|
|
43
|
+
phoneNumber: string;
|
|
44
|
+
purchasedAt: string | null;
|
|
45
|
+
releasedAt: string | null;
|
|
46
|
+
status: PhoneNumberStatus;
|
|
47
|
+
updatedAt: string;
|
|
48
|
+
}
|
|
49
|
+
export interface SmsMessageSummary {
|
|
50
|
+
body: string;
|
|
51
|
+
createdAt: string;
|
|
52
|
+
deliveredAt: string | null;
|
|
53
|
+
errorCode: string | null;
|
|
54
|
+
errorMessage: string | null;
|
|
55
|
+
fromNumber: string;
|
|
56
|
+
id: string;
|
|
57
|
+
lastEventAt: string | null;
|
|
58
|
+
organizationId: string;
|
|
59
|
+
priceCents: number | null;
|
|
60
|
+
providerMessageSid: string | null;
|
|
61
|
+
providerStatus: string | null;
|
|
62
|
+
segments: number;
|
|
63
|
+
sentAt: string | null;
|
|
64
|
+
status: SmsMessageStatus;
|
|
65
|
+
toNumber: string;
|
|
66
|
+
updatedAt: string;
|
|
67
|
+
}
|
|
68
|
+
export interface SendSmsInput {
|
|
69
|
+
body: string;
|
|
70
|
+
from?: string | null;
|
|
71
|
+
to: string;
|
|
72
|
+
}
|
|
73
|
+
export interface VerificationAttemptSummary {
|
|
74
|
+
channel: VerificationChannel;
|
|
75
|
+
createdAt: string;
|
|
76
|
+
errorMessage: string | null;
|
|
77
|
+
id: string;
|
|
78
|
+
organizationId: string;
|
|
79
|
+
providerStatus: string | null;
|
|
80
|
+
serviceId: string;
|
|
81
|
+
status: VerificationAttemptStatus;
|
|
82
|
+
toValue: string;
|
|
83
|
+
updatedAt: string;
|
|
84
|
+
verifiedAt: string | null;
|
|
85
|
+
}
|
|
86
|
+
export interface VerificationCheckResult extends VerificationAttemptSummary {
|
|
87
|
+
valid: boolean;
|
|
88
|
+
}
|
|
89
|
+
export interface StartVerificationInput {
|
|
90
|
+
channel?: VerificationChannel;
|
|
91
|
+
locale?: string;
|
|
92
|
+
to: string;
|
|
93
|
+
}
|
|
94
|
+
export interface CheckVerificationInput {
|
|
95
|
+
code: string;
|
|
96
|
+
to: string;
|
|
97
|
+
}
|
|
98
|
+
export interface EmailMessageSummary {
|
|
99
|
+
bccAddresses: string[];
|
|
100
|
+
ccAddresses: string[];
|
|
101
|
+
clickCount: number;
|
|
102
|
+
createdAt: string;
|
|
103
|
+
deliveredAt: string | null;
|
|
104
|
+
errorMessage: string | null;
|
|
105
|
+
fromAddress: string;
|
|
106
|
+
id: string;
|
|
107
|
+
lastEventAt: string | null;
|
|
108
|
+
openCount: number;
|
|
109
|
+
organizationId: string;
|
|
110
|
+
providerStatus: string | null;
|
|
111
|
+
replyTo: string[];
|
|
112
|
+
resendEmailId: string | null;
|
|
113
|
+
sentAt: string | null;
|
|
114
|
+
status: EmailMessageStatus;
|
|
115
|
+
subject: string;
|
|
116
|
+
toAddresses: string[];
|
|
117
|
+
updatedAt: string;
|
|
118
|
+
}
|
|
119
|
+
export interface SendEmailInput {
|
|
120
|
+
bcc?: string[] | null;
|
|
121
|
+
cc?: string[] | null;
|
|
122
|
+
from: string;
|
|
123
|
+
html?: string | null;
|
|
124
|
+
replyTo?: string[] | null;
|
|
125
|
+
subject: string;
|
|
126
|
+
text?: string | null;
|
|
127
|
+
to: string[];
|
|
128
|
+
}
|
|
129
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +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,MA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31 @@
|
|
|
1
|
+
# `@voyant-sdk/sdk-core`
|
|
2
|
+
|
|
3
|
+
Private shared runtime for the public Voyant SDK packages.
|
|
4
|
+
|
|
5
|
+
## Purpose
|
|
6
|
+
|
|
7
|
+
This package centralizes:
|
|
8
|
+
|
|
9
|
+
- request transport
|
|
10
|
+
- auth header handling
|
|
11
|
+
- query serialization
|
|
12
|
+
- JSON encoding
|
|
13
|
+
- API error handling
|
|
14
|
+
|
|
15
|
+
It is bundled into `@voyantjs/cloud-sdk` so consumers do not need to install it
|
|
16
|
+
directly.
|
|
17
|
+
|
|
18
|
+
## Rules
|
|
19
|
+
|
|
20
|
+
- keep this package private
|
|
21
|
+
- keep it transport-focused
|
|
22
|
+
- do not move product-specific business logic here
|
|
23
|
+
|
|
24
|
+
## Current exports
|
|
25
|
+
|
|
26
|
+
- `VoyantTransport`
|
|
27
|
+
- `VoyantApiError`
|
|
28
|
+
- transport option and request option types
|
|
29
|
+
|
|
30
|
+
If this package starts accumulating product-specific types, the boundary is
|
|
31
|
+
wrong and should be corrected.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { VoyantRequestOptions, VoyantTransportOptions } from "./types.js";
|
|
2
|
+
export declare class VoyantTransport {
|
|
3
|
+
readonly baseUrl: string;
|
|
4
|
+
private readonly apiKey;
|
|
5
|
+
private readonly authHeader;
|
|
6
|
+
private readonly authScheme;
|
|
7
|
+
private readonly defaultHeaders;
|
|
8
|
+
private readonly fetchImpl;
|
|
9
|
+
private readonly userAgent;
|
|
10
|
+
constructor(options: VoyantTransportOptions);
|
|
11
|
+
request<T>(path: string, options?: VoyantRequestOptions): Promise<T>;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +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;CA0DlE"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { VoyantApiError } from "./errors.js";
|
|
2
|
+
const DEFAULT_BASE_URL = "https://api.voyantjs.com";
|
|
3
|
+
function appendQuery(url, query) {
|
|
4
|
+
if (!query) {
|
|
5
|
+
return;
|
|
6
|
+
}
|
|
7
|
+
for (const [key, rawValue] of Object.entries(query)) {
|
|
8
|
+
if (rawValue === undefined || rawValue === null) {
|
|
9
|
+
continue;
|
|
10
|
+
}
|
|
11
|
+
const values = Array.isArray(rawValue) ? rawValue : [rawValue];
|
|
12
|
+
for (const value of values) {
|
|
13
|
+
if (value === undefined || value === null) {
|
|
14
|
+
continue;
|
|
15
|
+
}
|
|
16
|
+
url.searchParams.append(key, String(value));
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function normalizePath(path) {
|
|
21
|
+
return path.startsWith("/") ? path : `/${path}`;
|
|
22
|
+
}
|
|
23
|
+
function isBodyInit(value) {
|
|
24
|
+
return (value instanceof ArrayBuffer ||
|
|
25
|
+
value instanceof Blob ||
|
|
26
|
+
value instanceof FormData ||
|
|
27
|
+
value instanceof ReadableStream ||
|
|
28
|
+
value instanceof URLSearchParams ||
|
|
29
|
+
typeof value === "string");
|
|
30
|
+
}
|
|
31
|
+
function maybeJson(text, contentType) {
|
|
32
|
+
if (!text) {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
if (contentType?.includes("application/json")) {
|
|
36
|
+
return JSON.parse(text);
|
|
37
|
+
}
|
|
38
|
+
if (text.startsWith("{") || text.startsWith("[")) {
|
|
39
|
+
try {
|
|
40
|
+
return JSON.parse(text);
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
return text;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return text;
|
|
47
|
+
}
|
|
48
|
+
function getErrorMessage(body, fallback) {
|
|
49
|
+
if (typeof body === "string" && body.length > 0) {
|
|
50
|
+
return body;
|
|
51
|
+
}
|
|
52
|
+
if (body &&
|
|
53
|
+
typeof body === "object" &&
|
|
54
|
+
"message" in body &&
|
|
55
|
+
typeof body.message === "string" &&
|
|
56
|
+
body.message.length > 0) {
|
|
57
|
+
return body.message;
|
|
58
|
+
}
|
|
59
|
+
return fallback;
|
|
60
|
+
}
|
|
61
|
+
export class VoyantTransport {
|
|
62
|
+
baseUrl;
|
|
63
|
+
apiKey;
|
|
64
|
+
authHeader;
|
|
65
|
+
authScheme;
|
|
66
|
+
defaultHeaders;
|
|
67
|
+
fetchImpl;
|
|
68
|
+
userAgent;
|
|
69
|
+
constructor(options) {
|
|
70
|
+
this.apiKey = options.apiKey;
|
|
71
|
+
this.baseUrl = options.baseUrl ?? DEFAULT_BASE_URL;
|
|
72
|
+
this.defaultHeaders = options.headers;
|
|
73
|
+
this.fetchImpl = options.fetch ?? fetch;
|
|
74
|
+
this.authHeader = options.authHeader ?? "authorization";
|
|
75
|
+
this.authScheme = options.authScheme === undefined ? "Bearer" : options.authScheme;
|
|
76
|
+
this.userAgent = options.userAgent ?? "voyant-sdk";
|
|
77
|
+
}
|
|
78
|
+
async request(path, options = {}) {
|
|
79
|
+
const url = new URL(normalizePath(path), this.baseUrl.endsWith("/") ? this.baseUrl : `${this.baseUrl}/`);
|
|
80
|
+
appendQuery(url, options.query);
|
|
81
|
+
const headers = new Headers(this.defaultHeaders);
|
|
82
|
+
headers.set(this.authHeader, this.authScheme ? `${this.authScheme} ${this.apiKey}` : this.apiKey);
|
|
83
|
+
headers.set("x-voyant-sdk", this.userAgent);
|
|
84
|
+
if (options.headers) {
|
|
85
|
+
new Headers(options.headers).forEach((value, key) => {
|
|
86
|
+
headers.set(key, value);
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
let body;
|
|
90
|
+
if (options.body != null) {
|
|
91
|
+
if (isBodyInit(options.body)) {
|
|
92
|
+
body = options.body;
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
headers.set("content-type", "application/json");
|
|
96
|
+
body = JSON.stringify(options.body);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
const response = await this.fetchImpl(url, {
|
|
100
|
+
body,
|
|
101
|
+
headers,
|
|
102
|
+
method: options.method ?? "GET",
|
|
103
|
+
signal: options.signal,
|
|
104
|
+
});
|
|
105
|
+
const text = await response.text();
|
|
106
|
+
const parsed = maybeJson(text, response.headers.get("content-type"));
|
|
107
|
+
if (!response.ok) {
|
|
108
|
+
throw new VoyantApiError(getErrorMessage(parsed, `Request failed with status ${response.status}`), {
|
|
109
|
+
body: parsed,
|
|
110
|
+
requestId: response.headers.get("x-request-id"),
|
|
111
|
+
status: response.status,
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
if (options.unwrapData === false) {
|
|
115
|
+
return parsed;
|
|
116
|
+
}
|
|
117
|
+
if (parsed && typeof parsed === "object" && "data" in parsed) {
|
|
118
|
+
return parsed.data;
|
|
119
|
+
}
|
|
120
|
+
return parsed;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare class VoyantApiError extends Error {
|
|
2
|
+
readonly body: unknown;
|
|
3
|
+
readonly requestId: string | null;
|
|
4
|
+
readonly status: number;
|
|
5
|
+
constructor(message: string, options: {
|
|
6
|
+
body: unknown;
|
|
7
|
+
requestId: string | null;
|
|
8
|
+
status: number;
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,qBAAa,cAAe,SAAQ,KAAK;IACvC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAEZ,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE;QAAE,IAAI,EAAE,OAAO,CAAC;QAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE;CAOlG"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export class VoyantApiError extends Error {
|
|
2
|
+
body;
|
|
3
|
+
requestId;
|
|
4
|
+
status;
|
|
5
|
+
constructor(message, options) {
|
|
6
|
+
super(message);
|
|
7
|
+
this.name = "VoyantApiError";
|
|
8
|
+
this.status = options.status;
|
|
9
|
+
this.requestId = options.requestId;
|
|
10
|
+
this.body = options.body;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { VoyantTransport } from "./client.js";
|
|
2
|
+
export { VoyantApiError } from "./errors.js";
|
|
3
|
+
export type { FetchLike, JsonObject, JsonPrimitive, JsonValue, QueryParams, QueryValue, VoyantRequestOptions, VoyantTransportOptions, } from "./types.js";
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export type FetchLike = typeof fetch;
|
|
2
|
+
export type JsonPrimitive = boolean | null | number | string;
|
|
3
|
+
export type JsonValue = JsonPrimitive | JsonObject | JsonValue[];
|
|
4
|
+
export type JsonObject = {
|
|
5
|
+
[key: string]: JsonValue;
|
|
6
|
+
};
|
|
7
|
+
export type QueryValue = string | number | boolean | null | undefined | Array<string | number | boolean | null | undefined>;
|
|
8
|
+
export type QueryParams = Record<string, QueryValue>;
|
|
9
|
+
export interface VoyantTransportOptions {
|
|
10
|
+
apiKey: string;
|
|
11
|
+
authHeader?: string;
|
|
12
|
+
authScheme?: string | null;
|
|
13
|
+
baseUrl?: string;
|
|
14
|
+
fetch?: FetchLike;
|
|
15
|
+
headers?: HeadersInit;
|
|
16
|
+
userAgent?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface VoyantRequestOptions {
|
|
19
|
+
body?: BodyInit | object | null;
|
|
20
|
+
headers?: HeadersInit;
|
|
21
|
+
method?: "DELETE" | "GET" | "PATCH" | "POST" | "PUT";
|
|
22
|
+
query?: QueryParams;
|
|
23
|
+
signal?: AbortSignal;
|
|
24
|
+
unwrapData?: boolean;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +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,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC;AAC7D,MAAM,MAAM,SAAS,GAAG,aAAa,GAAG,UAAU,GAAG,SAAS,EAAE,CAAC;AACjE,MAAM,MAAM,UAAU,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC;AAEtD,MAAM,MAAM,UAAU,GAClB,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,SAAS,GACT,KAAK,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;AAExD,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;AAErD,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,IAAI,CAAC;IAChC,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,MAAM,CAAC,EAAE,QAAQ,GAAG,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,CAAC;IACrD,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@voyant-sdk/sdk-core",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"description": "Private shared runtime for Voyant SDK packages.",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"types": "./src/index.ts",
|
|
9
|
+
"sideEffects": false,
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./src/index.ts",
|
|
13
|
+
"default": "./dist/index.js"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"files": ["dist"],
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "tsc -p tsconfig.json",
|
|
19
|
+
"lint": "eslint src --max-warnings 0",
|
|
20
|
+
"check-types": "tsc --noEmit"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@voyant-sdk/eslint-config": "workspace:*",
|
|
24
|
+
"@voyant-sdk/typescript-config": "workspace:*",
|
|
25
|
+
"eslint": "^9.39.1",
|
|
26
|
+
"typescript": "5.9.2"
|
|
27
|
+
},
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"main": "./dist/index.js",
|
|
30
|
+
"types": "./dist/index.d.ts",
|
|
31
|
+
"exports": {
|
|
32
|
+
".": {
|
|
33
|
+
"types": "./dist/index.d.ts",
|
|
34
|
+
"import": "./dist/index.js"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@voyantjs/cloud-sdk",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Public TypeScript SDK for Voyant Cloud APIs.",
|
|
5
|
+
"license": "FSL-1.1-Apache-2.0",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/voyantjs/cloud-sdk.git",
|
|
9
|
+
"directory": "packages/cloud-sdk"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/voyantjs/cloud-sdk#readme",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/voyantjs/cloud-sdk/issues"
|
|
14
|
+
},
|
|
15
|
+
"type": "module",
|
|
16
|
+
"main": "./dist/index.js",
|
|
17
|
+
"types": "./src/index.ts",
|
|
18
|
+
"sideEffects": false,
|
|
19
|
+
"keywords": [
|
|
20
|
+
"voyant",
|
|
21
|
+
"voyant-cloud",
|
|
22
|
+
"sdk",
|
|
23
|
+
"typescript"
|
|
24
|
+
],
|
|
25
|
+
"exports": {
|
|
26
|
+
".": {
|
|
27
|
+
"types": "./src/index.ts",
|
|
28
|
+
"default": "./dist/index.js"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"files": ["dist"],
|
|
32
|
+
"bundleDependencies": [
|
|
33
|
+
"@voyant-sdk/sdk-core"
|
|
34
|
+
],
|
|
35
|
+
"scripts": {
|
|
36
|
+
"build": "tsc -p tsconfig.json",
|
|
37
|
+
"lint": "eslint src --max-warnings 0",
|
|
38
|
+
"check-types": "tsc --noEmit"
|
|
39
|
+
},
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"@voyant-sdk/sdk-core": "workspace:*"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@voyant-sdk/eslint-config": "workspace:*",
|
|
45
|
+
"@voyant-sdk/typescript-config": "workspace:*",
|
|
46
|
+
"eslint": "^9.39.1",
|
|
47
|
+
"typescript": "5.9.2"
|
|
48
|
+
},
|
|
49
|
+
"publishConfig": {
|
|
50
|
+
"access": "public",
|
|
51
|
+
"main": "./dist/index.js",
|
|
52
|
+
"types": "./dist/index.d.ts",
|
|
53
|
+
"exports": {
|
|
54
|
+
".": {
|
|
55
|
+
"types": "./dist/index.d.ts",
|
|
56
|
+
"import": "./dist/index.js"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|