@kevinmichaelchen/distilled-avalara
v0.2.0
Published
Effect 4-native Avalara AvaTax REST v2 SDK generated from official Swagger
Readme
distilled-avalara
An Effect-native Avalara AvaTax REST v2 SDK generated from Avalara's official Swagger document.
The SDK groups operations into service modules. Runtime schemas, protocol
traits, typed errors, retry support, and streaming pagination come from
@kevinmichaelchen/distilled; authentication and Avalara's HTTP behavior are
defined by this package.
Set AVALARA_BEARER_TOKEN, or set AVALARA_ACCOUNT_ID and
AVALARA_LICENSE_KEY. AVALARA_BASE_URL defaults to production and may be set
to https://sandbox-rest.avatax.com for sandbox accounts.
import * as Effect from "effect/Effect";
import * as Layer from "effect/Layer";
import * as FetchHttpClient from "effect/unstable/http/FetchHttpClient";
import {
CredentialsFromEnv,
Services,
} from "@kevinmichaelchen/distilled-avalara";
const AvalaraLive = Layer.mergeAll(FetchHttpClient.layer, CredentialsFromEnv);
const response = await Effect.runPromise(
Services.utilities.ping({}).pipe(Effect.provide(AvalaraLive)),
);Run bun run generate after updating the pinned specification. Generated
service modules under src/services must not be edited by hand.
