@roarkanalytics/sdk 2.20.0 → 2.21.1
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/CHANGELOG.md +16 -0
- package/README.md +83 -45
- package/api-promise.d.mts +47 -0
- package/api-promise.d.mts.map +1 -0
- package/api-promise.d.ts +47 -0
- package/api-promise.d.ts.map +1 -0
- package/api-promise.js +84 -0
- package/api-promise.js.map +1 -0
- package/api-promise.mjs +80 -0
- package/api-promise.mjs.map +1 -0
- package/client.d.mts +201 -0
- package/client.d.mts.map +1 -0
- package/client.d.ts +201 -0
- package/client.d.ts.map +1 -0
- package/client.js +454 -0
- package/client.js.map +1 -0
- package/client.mjs +427 -0
- package/client.mjs.map +1 -0
- package/error.d.mts +47 -0
- package/error.d.mts.map +1 -0
- package/error.d.ts +1 -1
- package/error.d.ts.map +1 -1
- package/error.js +2 -2
- package/error.js.map +1 -1
- package/error.mjs +1 -1
- package/error.mjs.map +1 -1
- package/index.d.mts +4 -130
- package/index.d.mts.map +1 -0
- package/index.d.ts +4 -130
- package/index.d.ts.map +1 -1
- package/index.js +10 -128
- package/index.js.map +1 -1
- package/index.mjs +4 -102
- package/index.mjs.map +1 -1
- package/internal/builtin-types.d.mts +65 -0
- package/internal/builtin-types.d.mts.map +1 -0
- package/internal/builtin-types.d.ts +65 -0
- package/internal/builtin-types.d.ts.map +1 -0
- package/internal/builtin-types.js +4 -0
- package/internal/builtin-types.js.map +1 -0
- package/internal/builtin-types.mjs +3 -0
- package/internal/builtin-types.mjs.map +1 -0
- package/internal/detect-platform.d.mts +15 -0
- package/internal/detect-platform.d.mts.map +1 -0
- package/internal/detect-platform.d.ts +15 -0
- package/internal/detect-platform.d.ts.map +1 -0
- package/internal/detect-platform.js +162 -0
- package/internal/detect-platform.js.map +1 -0
- package/internal/detect-platform.mjs +157 -0
- package/internal/detect-platform.mjs.map +1 -0
- package/internal/errors.d.mts +3 -0
- package/internal/errors.d.mts.map +1 -0
- package/internal/errors.d.ts +3 -0
- package/internal/errors.d.ts.map +1 -0
- package/internal/errors.js +26 -0
- package/internal/errors.js.map +1 -0
- package/internal/errors.mjs +21 -0
- package/internal/errors.mjs.map +1 -0
- package/internal/headers.d.mts +21 -0
- package/internal/headers.d.mts.map +1 -0
- package/internal/headers.d.ts +21 -0
- package/internal/headers.d.ts.map +1 -0
- package/internal/headers.js +77 -0
- package/internal/headers.js.map +1 -0
- package/internal/headers.mjs +72 -0
- package/internal/headers.mjs.map +1 -0
- package/internal/parse.d.mts +10 -0
- package/internal/parse.d.mts.map +1 -0
- package/internal/parse.d.ts +10 -0
- package/internal/parse.d.ts.map +1 -0
- package/internal/parse.js +28 -0
- package/internal/parse.js.map +1 -0
- package/internal/parse.mjs +24 -0
- package/internal/parse.mjs.map +1 -0
- package/internal/polyfill/crypto.node.d.ts +10 -0
- package/internal/polyfill/crypto.node.js +11 -0
- package/internal/polyfill/crypto.node.mjs +2 -0
- package/internal/polyfill/file.node.d.ts +9 -0
- package/internal/polyfill/file.node.js +17 -0
- package/internal/polyfill/file.node.mjs +9 -0
- package/internal/qs/formats.d.mts +6 -0
- package/internal/qs/formats.d.mts.map +1 -0
- package/internal/qs/formats.d.ts.map +1 -1
- package/internal/qs/index.d.mts +10 -0
- package/internal/qs/index.d.mts.map +1 -0
- package/internal/qs/index.d.ts.map +1 -1
- package/internal/qs/stringify.d.mts +3 -0
- package/internal/qs/stringify.d.mts.map +1 -0
- package/internal/qs/stringify.d.ts.map +1 -1
- package/internal/qs/types.d.mts +57 -0
- package/internal/qs/types.d.mts.map +1 -0
- package/internal/qs/utils.d.mts +14 -0
- package/internal/qs/utils.d.mts.map +1 -0
- package/internal/qs/utils.d.ts.map +1 -1
- package/internal/request-options.d.mts +34 -0
- package/internal/request-options.d.mts.map +1 -0
- package/internal/request-options.d.ts +34 -0
- package/internal/request-options.d.ts.map +1 -0
- package/internal/request-options.js +39 -0
- package/internal/request-options.js.map +1 -0
- package/internal/request-options.mjs +34 -0
- package/internal/request-options.mjs.map +1 -0
- package/internal/shim-types.d.mts +28 -0
- package/internal/shim-types.d.ts +28 -0
- package/internal/shims.d.mts +61 -0
- package/internal/shims.d.mts.map +1 -0
- package/internal/shims.d.ts +61 -0
- package/internal/shims.d.ts.map +1 -0
- package/internal/shims.js +101 -0
- package/internal/shims.js.map +1 -0
- package/internal/shims.mjs +92 -0
- package/internal/shims.mjs.map +1 -0
- package/internal/types.d.mts +68 -0
- package/internal/types.d.mts.map +1 -0
- package/internal/types.d.ts +68 -0
- package/internal/types.d.ts.map +1 -0
- package/internal/types.js +4 -0
- package/internal/types.js.map +1 -0
- package/internal/types.mjs +3 -0
- package/internal/types.mjs.map +1 -0
- package/internal/uploads.d.mts +73 -0
- package/internal/uploads.d.mts.map +1 -0
- package/internal/uploads.d.ts +73 -0
- package/internal/uploads.d.ts.map +1 -0
- package/internal/uploads.js +208 -0
- package/internal/uploads.js.map +1 -0
- package/internal/uploads.mjs +200 -0
- package/internal/uploads.mjs.map +1 -0
- package/internal/utils/base64.d.mts +3 -0
- package/internal/utils/base64.d.mts.map +1 -0
- package/internal/utils/base64.d.ts +3 -0
- package/internal/utils/base64.d.ts.map +1 -0
- package/internal/utils/base64.js +33 -0
- package/internal/utils/base64.js.map +1 -0
- package/internal/utils/base64.mjs +28 -0
- package/internal/utils/base64.mjs.map +1 -0
- package/internal/utils/env.d.mts +9 -0
- package/internal/utils/env.d.mts.map +1 -0
- package/internal/utils/env.d.ts +9 -0
- package/internal/utils/env.d.ts.map +1 -0
- package/internal/utils/env.js +22 -0
- package/internal/utils/env.js.map +1 -0
- package/internal/utils/env.mjs +18 -0
- package/internal/utils/env.mjs.map +1 -0
- package/internal/utils/log.d.mts +4 -0
- package/internal/utils/log.d.mts.map +1 -0
- package/internal/utils/log.d.ts +4 -0
- package/internal/utils/log.d.ts.map +1 -0
- package/internal/utils/log.js +47 -0
- package/internal/utils/log.js.map +1 -0
- package/internal/utils/log.mjs +43 -0
- package/internal/utils/log.mjs.map +1 -0
- package/internal/utils/sleep.d.mts +2 -0
- package/internal/utils/sleep.d.mts.map +1 -0
- package/internal/utils/sleep.d.ts +2 -0
- package/internal/utils/sleep.d.ts.map +1 -0
- package/internal/utils/sleep.js +7 -0
- package/internal/utils/sleep.js.map +1 -0
- package/internal/utils/sleep.mjs +3 -0
- package/internal/utils/sleep.mjs.map +1 -0
- package/internal/utils/uuid.d.mts +5 -0
- package/internal/utils/uuid.d.mts.map +1 -0
- package/internal/utils/uuid.d.ts +5 -0
- package/internal/utils/uuid.d.ts.map +1 -0
- package/internal/utils/uuid.js +15 -0
- package/internal/utils/uuid.js.map +1 -0
- package/internal/utils/uuid.mjs +11 -0
- package/internal/utils/uuid.mjs.map +1 -0
- package/internal/utils/values.d.mts +15 -0
- package/internal/utils/values.d.mts.map +1 -0
- package/internal/utils/values.d.ts +15 -0
- package/internal/utils/values.d.ts.map +1 -0
- package/internal/utils/values.js +100 -0
- package/internal/utils/values.js.map +1 -0
- package/internal/utils/values.mjs +84 -0
- package/internal/utils/values.mjs.map +1 -0
- package/internal/utils.d.mts +7 -0
- package/internal/utils.d.mts.map +1 -0
- package/internal/utils.d.ts +7 -0
- package/internal/utils.d.ts.map +1 -0
- package/{_shims/auto/runtime-bun.js → internal/utils.js} +8 -5
- package/internal/utils.js.map +1 -0
- package/internal/utils.mjs +8 -0
- package/internal/utils.mjs.map +1 -0
- package/package.json +83 -66
- package/resource.d.mts +6 -0
- package/resource.d.mts.map +1 -0
- package/resource.d.ts +2 -2
- package/resource.d.ts.map +1 -1
- package/resource.js.map +1 -1
- package/resource.mjs.map +1 -1
- package/resources/call.d.mts +1197 -0
- package/resources/call.d.mts.map +1 -0
- package/resources/call.d.ts +13 -24
- package/resources/call.d.ts.map +1 -1
- package/resources/call.js +15 -15
- package/resources/call.js.map +1 -1
- package/resources/call.mjs +15 -15
- package/resources/call.mjs.map +1 -1
- package/resources/evaluation.d.mts +1295 -0
- package/resources/evaluation.d.mts.map +1 -0
- package/resources/evaluation.d.ts +13 -26
- package/resources/evaluation.d.ts.map +1 -1
- package/resources/evaluation.js +13 -13
- package/resources/evaluation.js.map +1 -1
- package/resources/evaluation.mjs +13 -13
- package/resources/evaluation.mjs.map +1 -1
- package/resources/health.d.mts +29 -0
- package/resources/health.d.mts.map +1 -0
- package/resources/health.d.ts +3 -2
- package/resources/health.d.ts.map +1 -1
- package/resources/health.js.map +1 -1
- package/resources/health.mjs.map +1 -1
- package/resources/index.d.mts +8 -0
- package/resources/index.d.mts.map +1 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/integrations.d.mts +81 -0
- package/resources/integrations.d.mts.map +1 -0
- package/resources/integrations.d.ts +8 -40
- package/resources/integrations.d.ts.map +1 -1
- package/resources/integrations.js +0 -25
- package/resources/integrations.js.map +1 -1
- package/resources/integrations.mjs +0 -25
- package/resources/integrations.mjs.map +1 -1
- package/resources/metric.d.mts +75 -0
- package/resources/metric.d.mts.map +1 -0
- package/resources/metric.d.ts +3 -2
- package/resources/metric.d.ts.map +1 -1
- package/resources/metric.js.map +1 -1
- package/resources/metric.mjs.map +1 -1
- package/resources/persona.d.mts +491 -0
- package/resources/persona.d.mts.map +1 -0
- package/resources/persona.d.ts +13 -51
- package/resources/persona.d.ts.map +1 -1
- package/resources/persona.js +10 -26
- package/resources/persona.js.map +1 -1
- package/resources/persona.mjs +10 -26
- package/resources/persona.mjs.map +1 -1
- package/resources/simulation.d.mts +756 -0
- package/resources/simulation.d.mts.map +1 -0
- package/resources/simulation.d.ts +11 -58
- package/resources/simulation.d.ts.map +1 -1
- package/resources/simulation.js +13 -43
- package/resources/simulation.js.map +1 -1
- package/resources/simulation.mjs +13 -43
- package/resources/simulation.mjs.map +1 -1
- package/src/api-promise.ts +92 -0
- package/src/client.ts +751 -0
- package/src/error.ts +1 -1
- package/src/index.ts +4 -307
- package/src/internal/builtin-types.ts +79 -0
- package/src/internal/detect-platform.ts +196 -0
- package/src/internal/errors.ts +22 -0
- package/src/internal/headers.ts +96 -0
- package/src/internal/parse.ts +41 -0
- package/src/internal/polyfill/crypto.node.d.ts +10 -0
- package/src/internal/polyfill/crypto.node.js +11 -0
- package/src/internal/polyfill/crypto.node.mjs +2 -0
- package/src/internal/polyfill/file.node.d.ts +9 -0
- package/src/internal/polyfill/file.node.js +17 -0
- package/src/internal/polyfill/file.node.mjs +9 -0
- package/src/internal/request-options.ts +67 -0
- package/src/internal/shim-types.d.ts +28 -0
- package/src/internal/shims.ts +145 -0
- package/src/internal/types.ts +98 -0
- package/src/internal/uploads.ts +307 -0
- package/src/internal/utils/base64.ts +37 -0
- package/src/internal/utils/env.ts +18 -0
- package/src/internal/utils/log.ts +49 -0
- package/src/internal/utils/sleep.ts +3 -0
- package/src/internal/utils/uuid.ts +13 -0
- package/src/internal/utils/values.ts +94 -0
- package/src/internal/utils.ts +8 -0
- package/src/resource.ts +2 -2
- package/src/resources/call.ts +22 -42
- package/src/resources/evaluation.ts +25 -42
- package/src/resources/health.ts +3 -2
- package/src/resources/integrations.ts +10 -34
- package/src/resources/metric.ts +3 -2
- package/src/resources/persona.ts +22 -61
- package/src/resources/simulation.ts +22 -84
- package/src/tsconfig.json +2 -2
- package/src/uploads.ts +1 -255
- package/src/version.ts +1 -1
- package/uploads.d.mts +2 -0
- package/uploads.d.mts.map +1 -0
- package/uploads.d.ts +1 -74
- package/uploads.d.ts.map +1 -1
- package/uploads.js +3 -168
- package/uploads.js.map +1 -1
- package/uploads.mjs +1 -157
- package/uploads.mjs.map +1 -1
- package/version.d.mts +2 -0
- package/version.d.mts.map +1 -0
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
- package/_shims/MultipartBody.d.ts +0 -9
- package/_shims/MultipartBody.d.ts.map +0 -1
- package/_shims/MultipartBody.js +0 -16
- package/_shims/MultipartBody.js.map +0 -1
- package/_shims/MultipartBody.mjs +0 -12
- package/_shims/MultipartBody.mjs.map +0 -1
- package/_shims/README.md +0 -46
- package/_shims/auto/runtime-bun.d.ts +0 -5
- package/_shims/auto/runtime-bun.d.ts.map +0 -1
- package/_shims/auto/runtime-bun.js.map +0 -1
- package/_shims/auto/runtime-bun.mjs +0 -2
- package/_shims/auto/runtime-bun.mjs.map +0 -1
- package/_shims/auto/runtime-node.d.ts +0 -5
- package/_shims/auto/runtime-node.d.ts.map +0 -1
- package/_shims/auto/runtime-node.js +0 -21
- package/_shims/auto/runtime-node.js.map +0 -1
- package/_shims/auto/runtime-node.mjs +0 -2
- package/_shims/auto/runtime-node.mjs.map +0 -1
- package/_shims/auto/runtime.d.ts +0 -5
- package/_shims/auto/runtime.d.ts.map +0 -1
- package/_shims/auto/runtime.js +0 -21
- package/_shims/auto/runtime.js.map +0 -1
- package/_shims/auto/runtime.mjs +0 -2
- package/_shims/auto/runtime.mjs.map +0 -1
- package/_shims/auto/types-node.d.ts +0 -5
- package/_shims/auto/types-node.d.ts.map +0 -1
- package/_shims/auto/types-node.js +0 -21
- package/_shims/auto/types-node.js.map +0 -1
- package/_shims/auto/types-node.mjs +0 -2
- package/_shims/auto/types-node.mjs.map +0 -1
- package/_shims/auto/types.d.ts +0 -101
- package/_shims/auto/types.js +0 -3
- package/_shims/auto/types.mjs +0 -3
- package/_shims/bun-runtime.d.ts +0 -6
- package/_shims/bun-runtime.d.ts.map +0 -1
- package/_shims/bun-runtime.js +0 -14
- package/_shims/bun-runtime.js.map +0 -1
- package/_shims/bun-runtime.mjs +0 -10
- package/_shims/bun-runtime.mjs.map +0 -1
- package/_shims/index.d.ts +0 -83
- package/_shims/index.js +0 -17
- package/_shims/index.mjs +0 -11
- package/_shims/manual-types.d.ts +0 -12
- package/_shims/manual-types.js +0 -3
- package/_shims/manual-types.mjs +0 -3
- package/_shims/node-runtime.d.ts +0 -3
- package/_shims/node-runtime.d.ts.map +0 -1
- package/_shims/node-runtime.js +0 -89
- package/_shims/node-runtime.js.map +0 -1
- package/_shims/node-runtime.mjs +0 -56
- package/_shims/node-runtime.mjs.map +0 -1
- package/_shims/node-types.d.ts +0 -42
- package/_shims/node-types.js +0 -3
- package/_shims/node-types.mjs +0 -3
- package/_shims/registry.d.ts +0 -37
- package/_shims/registry.d.ts.map +0 -1
- package/_shims/registry.js +0 -41
- package/_shims/registry.js.map +0 -1
- package/_shims/registry.mjs +0 -37
- package/_shims/registry.mjs.map +0 -1
- package/_shims/web-runtime.d.ts +0 -5
- package/_shims/web-runtime.d.ts.map +0 -1
- package/_shims/web-runtime.js +0 -78
- package/_shims/web-runtime.js.map +0 -1
- package/_shims/web-runtime.mjs +0 -71
- package/_shims/web-runtime.mjs.map +0 -1
- package/_shims/web-types.d.ts +0 -83
- package/_shims/web-types.js +0 -3
- package/_shims/web-types.mjs +0 -3
- package/core.d.ts +0 -255
- package/core.d.ts.map +0 -1
- package/core.js +0 -929
- package/core.js.map +0 -1
- package/core.mjs +0 -897
- package/core.mjs.map +0 -1
- package/resources.d.ts +0 -2
- package/resources.d.ts.map +0 -1
- package/resources.js +0 -18
- package/resources.js.map +0 -1
- package/resources.mjs +0 -2
- package/resources.mjs.map +0 -1
- package/shims/node.d.ts +0 -30
- package/shims/node.d.ts.map +0 -1
- package/shims/node.js +0 -31
- package/shims/node.js.map +0 -1
- package/shims/node.mjs +0 -5
- package/shims/node.mjs.map +0 -1
- package/shims/web.d.ts +0 -26
- package/shims/web.d.ts.map +0 -1
- package/shims/web.js +0 -31
- package/shims/web.js.map +0 -1
- package/shims/web.mjs +0 -5
- package/shims/web.mjs.map +0 -1
- package/src/_shims/MultipartBody.ts +0 -9
- package/src/_shims/README.md +0 -46
- package/src/_shims/auto/runtime-bun.ts +0 -4
- package/src/_shims/auto/runtime-node.ts +0 -4
- package/src/_shims/auto/runtime.ts +0 -4
- package/src/_shims/auto/types-node.ts +0 -4
- package/src/_shims/auto/types.d.ts +0 -101
- package/src/_shims/auto/types.js +0 -3
- package/src/_shims/auto/types.mjs +0 -3
- package/src/_shims/bun-runtime.ts +0 -14
- package/src/_shims/index.d.ts +0 -83
- package/src/_shims/index.js +0 -17
- package/src/_shims/index.mjs +0 -11
- package/src/_shims/manual-types.d.ts +0 -12
- package/src/_shims/manual-types.js +0 -3
- package/src/_shims/manual-types.mjs +0 -3
- package/src/_shims/node-runtime.ts +0 -81
- package/src/_shims/node-types.d.ts +0 -42
- package/src/_shims/node-types.js +0 -3
- package/src/_shims/node-types.mjs +0 -3
- package/src/_shims/registry.ts +0 -67
- package/src/_shims/web-runtime.ts +0 -103
- package/src/_shims/web-types.d.ts +0 -83
- package/src/_shims/web-types.js +0 -3
- package/src/_shims/web-types.mjs +0 -3
- package/src/core.ts +0 -1242
- package/src/resources.ts +0 -1
- package/src/shims/node.ts +0 -50
- package/src/shims/web.ts +0 -50
package/index.d.mts
CHANGED
|
@@ -1,132 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import * as API from "./resources/index.js";
|
|
6
|
-
import { Call, CallCreateParams, CallCreateResponse, CallGetByIDResponse, CallListEvaluationRunsResponse, CallListMetricsParams, CallListMetricsResponse, CallListParams, CallListResponse, CallListSentimentRunsResponse } from "./resources/call.js";
|
|
7
|
-
import { Evaluation, EvaluationCreateJobParams, EvaluationCreateJobResponse, EvaluationGetEvaluatorByIDResponse, EvaluationGetJobResponse, EvaluationListEvaluatorsParams, EvaluationListEvaluatorsResponse, EvaluationListJobRunsParams, EvaluationListJobRunsResponse } from "./resources/evaluation.js";
|
|
8
|
-
import { Health, HealthGetResponse } from "./resources/health.js";
|
|
9
|
-
import { IntegrationCreateRetellCallParams, IntegrationCreateRetellCallResponse, IntegrationCreateVapiCallParams, IntegrationCreateVapiCallResponse, Integrations } from "./resources/integrations.js";
|
|
10
|
-
import { Metric, MetricListDefinitionsResponse } from "./resources/metric.js";
|
|
11
|
-
import { Persona, PersonaCreateParams, PersonaCreateResponse, PersonaGetByIDResponse, PersonaListParams, PersonaListResponse, PersonaUpdateParams, PersonaUpdateResponse } from "./resources/persona.js";
|
|
12
|
-
import { Simulation, SimulationGetRunPlanJobResponse, SimulationGetSimulationJobByIDResponse, SimulationListRunPlanJobsParams, SimulationListRunPlanJobsResponse, SimulationListScenariosParams, SimulationListScenariosResponse, SimulationLookupSimulationJobParams, SimulationLookupSimulationJobResponse, SimulationStartRunPlanJobResponse } from "./resources/simulation.js";
|
|
13
|
-
export interface ClientOptions {
|
|
14
|
-
/**
|
|
15
|
-
* JWT token for authentication
|
|
16
|
-
*/
|
|
17
|
-
bearerToken?: string | undefined;
|
|
18
|
-
/**
|
|
19
|
-
* Override the default base URL for the API, e.g., "https://api.example.com/v2/"
|
|
20
|
-
*
|
|
21
|
-
* Defaults to process.env['ROARK_BASE_URL'].
|
|
22
|
-
*/
|
|
23
|
-
baseURL?: string | null | undefined;
|
|
24
|
-
/**
|
|
25
|
-
* The maximum amount of time (in milliseconds) that the client should wait for a response
|
|
26
|
-
* from the server before timing out a single request.
|
|
27
|
-
*
|
|
28
|
-
* Note that request timeouts are retried by default, so in a worst-case scenario you may wait
|
|
29
|
-
* much longer than this timeout before the promise succeeds or fails.
|
|
30
|
-
*
|
|
31
|
-
* @unit milliseconds
|
|
32
|
-
*/
|
|
33
|
-
timeout?: number | undefined;
|
|
34
|
-
/**
|
|
35
|
-
* An HTTP agent used to manage HTTP(S) connections.
|
|
36
|
-
*
|
|
37
|
-
* If not provided, an agent will be constructed by default in the Node.js environment,
|
|
38
|
-
* otherwise no agent is used.
|
|
39
|
-
*/
|
|
40
|
-
httpAgent?: Agent | undefined;
|
|
41
|
-
/**
|
|
42
|
-
* Specify a custom `fetch` function implementation.
|
|
43
|
-
*
|
|
44
|
-
* If not provided, we use `node-fetch` on Node.js and otherwise expect that `fetch` is
|
|
45
|
-
* defined globally.
|
|
46
|
-
*/
|
|
47
|
-
fetch?: Core.Fetch | undefined;
|
|
48
|
-
/**
|
|
49
|
-
* The maximum number of times that the client will retry a request in case of a
|
|
50
|
-
* temporary failure, like a network error or a 5XX error from the server.
|
|
51
|
-
*
|
|
52
|
-
* @default 2
|
|
53
|
-
*/
|
|
54
|
-
maxRetries?: number | undefined;
|
|
55
|
-
/**
|
|
56
|
-
* Default headers to include with every request to the API.
|
|
57
|
-
*
|
|
58
|
-
* These can be removed in individual requests by explicitly setting the
|
|
59
|
-
* header to `undefined` or `null` in request options.
|
|
60
|
-
*/
|
|
61
|
-
defaultHeaders?: Core.Headers | undefined;
|
|
62
|
-
/**
|
|
63
|
-
* Default query parameters to include with every request to the API.
|
|
64
|
-
*
|
|
65
|
-
* These can be removed in individual requests by explicitly setting the
|
|
66
|
-
* param to `undefined` in request options.
|
|
67
|
-
*/
|
|
68
|
-
defaultQuery?: Core.DefaultQuery | undefined;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* API Client for interfacing with the Roark API.
|
|
72
|
-
*/
|
|
73
|
-
export declare class Roark extends Core.APIClient {
|
|
74
|
-
#private;
|
|
75
|
-
bearerToken: string;
|
|
76
|
-
private _options;
|
|
77
|
-
/**
|
|
78
|
-
* API Client for interfacing with the Roark API.
|
|
79
|
-
*
|
|
80
|
-
* @param {string | undefined} [opts.bearerToken=process.env['ROARK_API_BEARER_TOKEN'] ?? undefined]
|
|
81
|
-
* @param {string} [opts.baseURL=process.env['ROARK_BASE_URL'] ?? https://api.roark.ai] - Override the default base URL for the API.
|
|
82
|
-
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
|
|
83
|
-
* @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
|
|
84
|
-
* @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
|
|
85
|
-
* @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
|
|
86
|
-
* @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.
|
|
87
|
-
* @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API.
|
|
88
|
-
*/
|
|
89
|
-
constructor({ baseURL, bearerToken, ...opts }?: ClientOptions);
|
|
90
|
-
health: API.Health;
|
|
91
|
-
evaluation: API.Evaluation;
|
|
92
|
-
call: API.Call;
|
|
93
|
-
metric: API.Metric;
|
|
94
|
-
integrations: API.Integrations;
|
|
95
|
-
simulation: API.Simulation;
|
|
96
|
-
persona: API.Persona;
|
|
97
|
-
protected defaultQuery(): Core.DefaultQuery | undefined;
|
|
98
|
-
protected defaultHeaders(opts: Core.FinalRequestOptions): Core.Headers;
|
|
99
|
-
protected authHeaders(opts: Core.FinalRequestOptions): Core.Headers;
|
|
100
|
-
protected stringifyQuery(query: Record<string, unknown>): string;
|
|
101
|
-
static Roark: typeof Roark;
|
|
102
|
-
static DEFAULT_TIMEOUT: number;
|
|
103
|
-
static RoarkError: typeof Errors.RoarkError;
|
|
104
|
-
static APIError: typeof Errors.APIError;
|
|
105
|
-
static APIConnectionError: typeof Errors.APIConnectionError;
|
|
106
|
-
static APIConnectionTimeoutError: typeof Errors.APIConnectionTimeoutError;
|
|
107
|
-
static APIUserAbortError: typeof Errors.APIUserAbortError;
|
|
108
|
-
static NotFoundError: typeof Errors.NotFoundError;
|
|
109
|
-
static ConflictError: typeof Errors.ConflictError;
|
|
110
|
-
static RateLimitError: typeof Errors.RateLimitError;
|
|
111
|
-
static BadRequestError: typeof Errors.BadRequestError;
|
|
112
|
-
static AuthenticationError: typeof Errors.AuthenticationError;
|
|
113
|
-
static InternalServerError: typeof Errors.InternalServerError;
|
|
114
|
-
static PermissionDeniedError: typeof Errors.PermissionDeniedError;
|
|
115
|
-
static UnprocessableEntityError: typeof Errors.UnprocessableEntityError;
|
|
116
|
-
static toFile: typeof Uploads.toFile;
|
|
117
|
-
static fileFromPath: typeof Uploads.fileFromPath;
|
|
118
|
-
}
|
|
119
|
-
export declare namespace Roark {
|
|
120
|
-
export type RequestOptions = Core.RequestOptions;
|
|
121
|
-
export { Health as Health, type HealthGetResponse as HealthGetResponse };
|
|
122
|
-
export { Evaluation as Evaluation, type EvaluationCreateJobResponse as EvaluationCreateJobResponse, type EvaluationGetEvaluatorByIDResponse as EvaluationGetEvaluatorByIDResponse, type EvaluationGetJobResponse as EvaluationGetJobResponse, type EvaluationListEvaluatorsResponse as EvaluationListEvaluatorsResponse, type EvaluationListJobRunsResponse as EvaluationListJobRunsResponse, type EvaluationCreateJobParams as EvaluationCreateJobParams, type EvaluationListEvaluatorsParams as EvaluationListEvaluatorsParams, type EvaluationListJobRunsParams as EvaluationListJobRunsParams, };
|
|
123
|
-
export { Call as Call, type CallCreateResponse as CallCreateResponse, type CallListResponse as CallListResponse, type CallGetByIDResponse as CallGetByIDResponse, type CallListEvaluationRunsResponse as CallListEvaluationRunsResponse, type CallListMetricsResponse as CallListMetricsResponse, type CallListSentimentRunsResponse as CallListSentimentRunsResponse, type CallCreateParams as CallCreateParams, type CallListParams as CallListParams, type CallListMetricsParams as CallListMetricsParams, };
|
|
124
|
-
export { Metric as Metric, type MetricListDefinitionsResponse as MetricListDefinitionsResponse };
|
|
125
|
-
export { Integrations as Integrations, type IntegrationCreateRetellCallResponse as IntegrationCreateRetellCallResponse, type IntegrationCreateVapiCallResponse as IntegrationCreateVapiCallResponse, type IntegrationCreateRetellCallParams as IntegrationCreateRetellCallParams, type IntegrationCreateVapiCallParams as IntegrationCreateVapiCallParams, };
|
|
126
|
-
export { Simulation as Simulation, type SimulationGetRunPlanJobResponse as SimulationGetRunPlanJobResponse, type SimulationGetSimulationJobByIDResponse as SimulationGetSimulationJobByIDResponse, type SimulationListRunPlanJobsResponse as SimulationListRunPlanJobsResponse, type SimulationListScenariosResponse as SimulationListScenariosResponse, type SimulationLookupSimulationJobResponse as SimulationLookupSimulationJobResponse, type SimulationStartRunPlanJobResponse as SimulationStartRunPlanJobResponse, type SimulationListRunPlanJobsParams as SimulationListRunPlanJobsParams, type SimulationListScenariosParams as SimulationListScenariosParams, type SimulationLookupSimulationJobParams as SimulationLookupSimulationJobParams, };
|
|
127
|
-
export { Persona as Persona, type PersonaCreateResponse as PersonaCreateResponse, type PersonaUpdateResponse as PersonaUpdateResponse, type PersonaListResponse as PersonaListResponse, type PersonaGetByIDResponse as PersonaGetByIDResponse, type PersonaCreateParams as PersonaCreateParams, type PersonaUpdateParams as PersonaUpdateParams, type PersonaListParams as PersonaListParams, };
|
|
128
|
-
}
|
|
129
|
-
export { toFile, fileFromPath } from "./uploads.js";
|
|
1
|
+
export { Roark as default } from "./client.js";
|
|
2
|
+
export { type Uploadable, toFile } from "./uploads.js";
|
|
3
|
+
export { APIPromise } from "./api-promise.js";
|
|
4
|
+
export { Roark, type ClientOptions } from "./client.js";
|
|
130
5
|
export { RoarkError, APIError, APIConnectionError, APIConnectionTimeoutError, APIUserAbortError, NotFoundError, ConflictError, RateLimitError, BadRequestError, AuthenticationError, InternalServerError, PermissionDeniedError, UnprocessableEntityError, } from "./error.js";
|
|
131
|
-
export default Roark;
|
|
132
6
|
//# sourceMappingURL=index.d.ts.map
|
package/index.d.mts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"OAEO,EAAE,KAAK,IAAI,OAAO,EAAE;OAEpB,EAAE,KAAK,UAAU,EAAE,MAAM,EAAE;OAC3B,EAAE,UAAU,EAAE;OACd,EAAE,KAAK,EAAE,KAAK,aAAa,EAAE;OAC7B,EACL,UAAU,EACV,QAAQ,EACR,kBAAkB,EAClB,yBAAyB,EACzB,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,wBAAwB,GACzB"}
|
package/index.d.ts
CHANGED
|
@@ -1,132 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import * as API from "./resources/index.js";
|
|
6
|
-
import { Call, CallCreateParams, CallCreateResponse, CallGetByIDResponse, CallListEvaluationRunsResponse, CallListMetricsParams, CallListMetricsResponse, CallListParams, CallListResponse, CallListSentimentRunsResponse } from "./resources/call.js";
|
|
7
|
-
import { Evaluation, EvaluationCreateJobParams, EvaluationCreateJobResponse, EvaluationGetEvaluatorByIDResponse, EvaluationGetJobResponse, EvaluationListEvaluatorsParams, EvaluationListEvaluatorsResponse, EvaluationListJobRunsParams, EvaluationListJobRunsResponse } from "./resources/evaluation.js";
|
|
8
|
-
import { Health, HealthGetResponse } from "./resources/health.js";
|
|
9
|
-
import { IntegrationCreateRetellCallParams, IntegrationCreateRetellCallResponse, IntegrationCreateVapiCallParams, IntegrationCreateVapiCallResponse, Integrations } from "./resources/integrations.js";
|
|
10
|
-
import { Metric, MetricListDefinitionsResponse } from "./resources/metric.js";
|
|
11
|
-
import { Persona, PersonaCreateParams, PersonaCreateResponse, PersonaGetByIDResponse, PersonaListParams, PersonaListResponse, PersonaUpdateParams, PersonaUpdateResponse } from "./resources/persona.js";
|
|
12
|
-
import { Simulation, SimulationGetRunPlanJobResponse, SimulationGetSimulationJobByIDResponse, SimulationListRunPlanJobsParams, SimulationListRunPlanJobsResponse, SimulationListScenariosParams, SimulationListScenariosResponse, SimulationLookupSimulationJobParams, SimulationLookupSimulationJobResponse, SimulationStartRunPlanJobResponse } from "./resources/simulation.js";
|
|
13
|
-
export interface ClientOptions {
|
|
14
|
-
/**
|
|
15
|
-
* JWT token for authentication
|
|
16
|
-
*/
|
|
17
|
-
bearerToken?: string | undefined;
|
|
18
|
-
/**
|
|
19
|
-
* Override the default base URL for the API, e.g., "https://api.example.com/v2/"
|
|
20
|
-
*
|
|
21
|
-
* Defaults to process.env['ROARK_BASE_URL'].
|
|
22
|
-
*/
|
|
23
|
-
baseURL?: string | null | undefined;
|
|
24
|
-
/**
|
|
25
|
-
* The maximum amount of time (in milliseconds) that the client should wait for a response
|
|
26
|
-
* from the server before timing out a single request.
|
|
27
|
-
*
|
|
28
|
-
* Note that request timeouts are retried by default, so in a worst-case scenario you may wait
|
|
29
|
-
* much longer than this timeout before the promise succeeds or fails.
|
|
30
|
-
*
|
|
31
|
-
* @unit milliseconds
|
|
32
|
-
*/
|
|
33
|
-
timeout?: number | undefined;
|
|
34
|
-
/**
|
|
35
|
-
* An HTTP agent used to manage HTTP(S) connections.
|
|
36
|
-
*
|
|
37
|
-
* If not provided, an agent will be constructed by default in the Node.js environment,
|
|
38
|
-
* otherwise no agent is used.
|
|
39
|
-
*/
|
|
40
|
-
httpAgent?: Agent | undefined;
|
|
41
|
-
/**
|
|
42
|
-
* Specify a custom `fetch` function implementation.
|
|
43
|
-
*
|
|
44
|
-
* If not provided, we use `node-fetch` on Node.js and otherwise expect that `fetch` is
|
|
45
|
-
* defined globally.
|
|
46
|
-
*/
|
|
47
|
-
fetch?: Core.Fetch | undefined;
|
|
48
|
-
/**
|
|
49
|
-
* The maximum number of times that the client will retry a request in case of a
|
|
50
|
-
* temporary failure, like a network error or a 5XX error from the server.
|
|
51
|
-
*
|
|
52
|
-
* @default 2
|
|
53
|
-
*/
|
|
54
|
-
maxRetries?: number | undefined;
|
|
55
|
-
/**
|
|
56
|
-
* Default headers to include with every request to the API.
|
|
57
|
-
*
|
|
58
|
-
* These can be removed in individual requests by explicitly setting the
|
|
59
|
-
* header to `undefined` or `null` in request options.
|
|
60
|
-
*/
|
|
61
|
-
defaultHeaders?: Core.Headers | undefined;
|
|
62
|
-
/**
|
|
63
|
-
* Default query parameters to include with every request to the API.
|
|
64
|
-
*
|
|
65
|
-
* These can be removed in individual requests by explicitly setting the
|
|
66
|
-
* param to `undefined` in request options.
|
|
67
|
-
*/
|
|
68
|
-
defaultQuery?: Core.DefaultQuery | undefined;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* API Client for interfacing with the Roark API.
|
|
72
|
-
*/
|
|
73
|
-
export declare class Roark extends Core.APIClient {
|
|
74
|
-
#private;
|
|
75
|
-
bearerToken: string;
|
|
76
|
-
private _options;
|
|
77
|
-
/**
|
|
78
|
-
* API Client for interfacing with the Roark API.
|
|
79
|
-
*
|
|
80
|
-
* @param {string | undefined} [opts.bearerToken=process.env['ROARK_API_BEARER_TOKEN'] ?? undefined]
|
|
81
|
-
* @param {string} [opts.baseURL=process.env['ROARK_BASE_URL'] ?? https://api.roark.ai] - Override the default base URL for the API.
|
|
82
|
-
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
|
|
83
|
-
* @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
|
|
84
|
-
* @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
|
|
85
|
-
* @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
|
|
86
|
-
* @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.
|
|
87
|
-
* @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API.
|
|
88
|
-
*/
|
|
89
|
-
constructor({ baseURL, bearerToken, ...opts }?: ClientOptions);
|
|
90
|
-
health: API.Health;
|
|
91
|
-
evaluation: API.Evaluation;
|
|
92
|
-
call: API.Call;
|
|
93
|
-
metric: API.Metric;
|
|
94
|
-
integrations: API.Integrations;
|
|
95
|
-
simulation: API.Simulation;
|
|
96
|
-
persona: API.Persona;
|
|
97
|
-
protected defaultQuery(): Core.DefaultQuery | undefined;
|
|
98
|
-
protected defaultHeaders(opts: Core.FinalRequestOptions): Core.Headers;
|
|
99
|
-
protected authHeaders(opts: Core.FinalRequestOptions): Core.Headers;
|
|
100
|
-
protected stringifyQuery(query: Record<string, unknown>): string;
|
|
101
|
-
static Roark: typeof Roark;
|
|
102
|
-
static DEFAULT_TIMEOUT: number;
|
|
103
|
-
static RoarkError: typeof Errors.RoarkError;
|
|
104
|
-
static APIError: typeof Errors.APIError;
|
|
105
|
-
static APIConnectionError: typeof Errors.APIConnectionError;
|
|
106
|
-
static APIConnectionTimeoutError: typeof Errors.APIConnectionTimeoutError;
|
|
107
|
-
static APIUserAbortError: typeof Errors.APIUserAbortError;
|
|
108
|
-
static NotFoundError: typeof Errors.NotFoundError;
|
|
109
|
-
static ConflictError: typeof Errors.ConflictError;
|
|
110
|
-
static RateLimitError: typeof Errors.RateLimitError;
|
|
111
|
-
static BadRequestError: typeof Errors.BadRequestError;
|
|
112
|
-
static AuthenticationError: typeof Errors.AuthenticationError;
|
|
113
|
-
static InternalServerError: typeof Errors.InternalServerError;
|
|
114
|
-
static PermissionDeniedError: typeof Errors.PermissionDeniedError;
|
|
115
|
-
static UnprocessableEntityError: typeof Errors.UnprocessableEntityError;
|
|
116
|
-
static toFile: typeof Uploads.toFile;
|
|
117
|
-
static fileFromPath: typeof Uploads.fileFromPath;
|
|
118
|
-
}
|
|
119
|
-
export declare namespace Roark {
|
|
120
|
-
export type RequestOptions = Core.RequestOptions;
|
|
121
|
-
export { Health as Health, type HealthGetResponse as HealthGetResponse };
|
|
122
|
-
export { Evaluation as Evaluation, type EvaluationCreateJobResponse as EvaluationCreateJobResponse, type EvaluationGetEvaluatorByIDResponse as EvaluationGetEvaluatorByIDResponse, type EvaluationGetJobResponse as EvaluationGetJobResponse, type EvaluationListEvaluatorsResponse as EvaluationListEvaluatorsResponse, type EvaluationListJobRunsResponse as EvaluationListJobRunsResponse, type EvaluationCreateJobParams as EvaluationCreateJobParams, type EvaluationListEvaluatorsParams as EvaluationListEvaluatorsParams, type EvaluationListJobRunsParams as EvaluationListJobRunsParams, };
|
|
123
|
-
export { Call as Call, type CallCreateResponse as CallCreateResponse, type CallListResponse as CallListResponse, type CallGetByIDResponse as CallGetByIDResponse, type CallListEvaluationRunsResponse as CallListEvaluationRunsResponse, type CallListMetricsResponse as CallListMetricsResponse, type CallListSentimentRunsResponse as CallListSentimentRunsResponse, type CallCreateParams as CallCreateParams, type CallListParams as CallListParams, type CallListMetricsParams as CallListMetricsParams, };
|
|
124
|
-
export { Metric as Metric, type MetricListDefinitionsResponse as MetricListDefinitionsResponse };
|
|
125
|
-
export { Integrations as Integrations, type IntegrationCreateRetellCallResponse as IntegrationCreateRetellCallResponse, type IntegrationCreateVapiCallResponse as IntegrationCreateVapiCallResponse, type IntegrationCreateRetellCallParams as IntegrationCreateRetellCallParams, type IntegrationCreateVapiCallParams as IntegrationCreateVapiCallParams, };
|
|
126
|
-
export { Simulation as Simulation, type SimulationGetRunPlanJobResponse as SimulationGetRunPlanJobResponse, type SimulationGetSimulationJobByIDResponse as SimulationGetSimulationJobByIDResponse, type SimulationListRunPlanJobsResponse as SimulationListRunPlanJobsResponse, type SimulationListScenariosResponse as SimulationListScenariosResponse, type SimulationLookupSimulationJobResponse as SimulationLookupSimulationJobResponse, type SimulationStartRunPlanJobResponse as SimulationStartRunPlanJobResponse, type SimulationListRunPlanJobsParams as SimulationListRunPlanJobsParams, type SimulationListScenariosParams as SimulationListScenariosParams, type SimulationLookupSimulationJobParams as SimulationLookupSimulationJobParams, };
|
|
127
|
-
export { Persona as Persona, type PersonaCreateResponse as PersonaCreateResponse, type PersonaUpdateResponse as PersonaUpdateResponse, type PersonaListResponse as PersonaListResponse, type PersonaGetByIDResponse as PersonaGetByIDResponse, type PersonaCreateParams as PersonaCreateParams, type PersonaUpdateParams as PersonaUpdateParams, type PersonaListParams as PersonaListParams, };
|
|
128
|
-
}
|
|
129
|
-
export { toFile, fileFromPath } from "./uploads.js";
|
|
1
|
+
export { Roark as default } from "./client.js";
|
|
2
|
+
export { type Uploadable, toFile } from "./uploads.js";
|
|
3
|
+
export { APIPromise } from "./api-promise.js";
|
|
4
|
+
export { Roark, type ClientOptions } from "./client.js";
|
|
130
5
|
export { RoarkError, APIError, APIConnectionError, APIConnectionTimeoutError, APIUserAbortError, NotFoundError, ConflictError, RateLimitError, BadRequestError, AuthenticationError, InternalServerError, PermissionDeniedError, UnprocessableEntityError, } from "./error.js";
|
|
131
|
-
export default Roark;
|
|
132
6
|
//# sourceMappingURL=index.d.ts.map
|
package/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"OAEO,EAAE,KAAK,IAAI,OAAO,EAAE;OAEpB,EAAE,KAAK,UAAU,EAAE,MAAM,EAAE;OAC3B,EAAE,UAAU,EAAE;OACd,EAAE,KAAK,EAAE,KAAK,aAAa,EAAE;OAC7B,EACL,UAAU,EACV,QAAQ,EACR,kBAAkB,EAClB,yBAAyB,EACzB,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,wBAAwB,GACzB"}
|
package/index.js
CHANGED
|
@@ -1,134 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
-
|
|
4
|
-
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
-
}) : function(o, v) {
|
|
17
|
-
o["default"] = v;
|
|
18
|
-
});
|
|
19
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
20
|
-
if (mod && mod.__esModule) return mod;
|
|
21
|
-
var result = {};
|
|
22
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
23
|
-
__setModuleDefault(result, mod);
|
|
24
|
-
return result;
|
|
25
|
-
};
|
|
26
|
-
var _Roark_instances, _a, _Roark_baseURLOverridden;
|
|
27
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
exports.UnprocessableEntityError = exports.PermissionDeniedError = exports.InternalServerError = exports.AuthenticationError = exports.BadRequestError = exports.RateLimitError = exports.ConflictError = exports.NotFoundError = exports.APIUserAbortError = exports.APIConnectionTimeoutError = exports.APIConnectionError = exports.APIError = exports.RoarkError = exports.fileFromPath = exports.toFile = exports.Roark = void 0;
|
|
29
|
-
const qs = __importStar(require("./internal/qs/index.js"));
|
|
30
|
-
const Core = __importStar(require("./core.js"));
|
|
31
|
-
const Errors = __importStar(require("./error.js"));
|
|
32
|
-
const Uploads = __importStar(require("./uploads.js"));
|
|
33
|
-
const API = __importStar(require("./resources/index.js"));
|
|
34
|
-
const call_1 = require("./resources/call.js");
|
|
35
|
-
const evaluation_1 = require("./resources/evaluation.js");
|
|
36
|
-
const health_1 = require("./resources/health.js");
|
|
37
|
-
const integrations_1 = require("./resources/integrations.js");
|
|
38
|
-
const metric_1 = require("./resources/metric.js");
|
|
39
|
-
const persona_1 = require("./resources/persona.js");
|
|
40
|
-
const simulation_1 = require("./resources/simulation.js");
|
|
41
|
-
/**
|
|
42
|
-
* API Client for interfacing with the Roark API.
|
|
43
|
-
*/
|
|
44
|
-
class Roark extends Core.APIClient {
|
|
45
|
-
/**
|
|
46
|
-
* API Client for interfacing with the Roark API.
|
|
47
|
-
*
|
|
48
|
-
* @param {string | undefined} [opts.bearerToken=process.env['ROARK_API_BEARER_TOKEN'] ?? undefined]
|
|
49
|
-
* @param {string} [opts.baseURL=process.env['ROARK_BASE_URL'] ?? https://api.roark.ai] - Override the default base URL for the API.
|
|
50
|
-
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
|
|
51
|
-
* @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
|
|
52
|
-
* @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
|
|
53
|
-
* @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
|
|
54
|
-
* @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.
|
|
55
|
-
* @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API.
|
|
56
|
-
*/
|
|
57
|
-
constructor({ baseURL = Core.readEnv('ROARK_BASE_URL'), bearerToken = Core.readEnv('ROARK_API_BEARER_TOKEN'), ...opts } = {}) {
|
|
58
|
-
if (bearerToken === undefined) {
|
|
59
|
-
throw new Errors.RoarkError("The ROARK_API_BEARER_TOKEN environment variable is missing or empty; either provide it, or instantiate the Roark client with an bearerToken option, like new Roark({ bearerToken: 'My Bearer Token' }).");
|
|
60
|
-
}
|
|
61
|
-
const options = {
|
|
62
|
-
bearerToken,
|
|
63
|
-
...opts,
|
|
64
|
-
baseURL: baseURL || `https://api.roark.ai`,
|
|
65
|
-
};
|
|
66
|
-
super({
|
|
67
|
-
baseURL: options.baseURL,
|
|
68
|
-
baseURLOverridden: baseURL ? baseURL !== 'https://api.roark.ai' : false,
|
|
69
|
-
timeout: options.timeout ?? 60000 /* 1 minute */,
|
|
70
|
-
httpAgent: options.httpAgent,
|
|
71
|
-
maxRetries: options.maxRetries,
|
|
72
|
-
fetch: options.fetch,
|
|
73
|
-
});
|
|
74
|
-
_Roark_instances.add(this);
|
|
75
|
-
this.health = new API.Health(this);
|
|
76
|
-
this.evaluation = new API.Evaluation(this);
|
|
77
|
-
this.call = new API.Call(this);
|
|
78
|
-
this.metric = new API.Metric(this);
|
|
79
|
-
this.integrations = new API.Integrations(this);
|
|
80
|
-
this.simulation = new API.Simulation(this);
|
|
81
|
-
this.persona = new API.Persona(this);
|
|
82
|
-
this._options = options;
|
|
83
|
-
this.bearerToken = bearerToken;
|
|
84
|
-
}
|
|
85
|
-
defaultQuery() {
|
|
86
|
-
return this._options.defaultQuery;
|
|
87
|
-
}
|
|
88
|
-
defaultHeaders(opts) {
|
|
89
|
-
return {
|
|
90
|
-
...super.defaultHeaders(opts),
|
|
91
|
-
...this._options.defaultHeaders,
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
authHeaders(opts) {
|
|
95
|
-
return { Authorization: `Bearer ${this.bearerToken}` };
|
|
96
|
-
}
|
|
97
|
-
stringifyQuery(query) {
|
|
98
|
-
return qs.stringify(query, { arrayFormat: 'comma' });
|
|
99
|
-
}
|
|
3
|
+
exports = module.exports = function (...args) {
|
|
4
|
+
return new exports.default(...args)
|
|
100
5
|
}
|
|
101
|
-
exports
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
};
|
|
105
|
-
Roark.Roark = _a;
|
|
106
|
-
Roark.DEFAULT_TIMEOUT = 60000; // 1 minute
|
|
107
|
-
Roark.RoarkError = Errors.RoarkError;
|
|
108
|
-
Roark.APIError = Errors.APIError;
|
|
109
|
-
Roark.APIConnectionError = Errors.APIConnectionError;
|
|
110
|
-
Roark.APIConnectionTimeoutError = Errors.APIConnectionTimeoutError;
|
|
111
|
-
Roark.APIUserAbortError = Errors.APIUserAbortError;
|
|
112
|
-
Roark.NotFoundError = Errors.NotFoundError;
|
|
113
|
-
Roark.ConflictError = Errors.ConflictError;
|
|
114
|
-
Roark.RateLimitError = Errors.RateLimitError;
|
|
115
|
-
Roark.BadRequestError = Errors.BadRequestError;
|
|
116
|
-
Roark.AuthenticationError = Errors.AuthenticationError;
|
|
117
|
-
Roark.InternalServerError = Errors.InternalServerError;
|
|
118
|
-
Roark.PermissionDeniedError = Errors.PermissionDeniedError;
|
|
119
|
-
Roark.UnprocessableEntityError = Errors.UnprocessableEntityError;
|
|
120
|
-
Roark.toFile = Uploads.toFile;
|
|
121
|
-
Roark.fileFromPath = Uploads.fileFromPath;
|
|
122
|
-
Roark.Health = health_1.Health;
|
|
123
|
-
Roark.Evaluation = evaluation_1.Evaluation;
|
|
124
|
-
Roark.Call = call_1.Call;
|
|
125
|
-
Roark.Metric = metric_1.Metric;
|
|
126
|
-
Roark.Integrations = integrations_1.Integrations;
|
|
127
|
-
Roark.Simulation = simulation_1.Simulation;
|
|
128
|
-
Roark.Persona = persona_1.Persona;
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.UnprocessableEntityError = exports.PermissionDeniedError = exports.InternalServerError = exports.AuthenticationError = exports.BadRequestError = exports.RateLimitError = exports.ConflictError = exports.NotFoundError = exports.APIUserAbortError = exports.APIConnectionTimeoutError = exports.APIConnectionError = exports.APIError = exports.RoarkError = exports.Roark = exports.APIPromise = exports.toFile = exports.default = void 0;
|
|
8
|
+
var client_1 = require("./client.js");
|
|
9
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return client_1.Roark; } });
|
|
129
10
|
var uploads_1 = require("./uploads.js");
|
|
130
11
|
Object.defineProperty(exports, "toFile", { enumerable: true, get: function () { return uploads_1.toFile; } });
|
|
131
|
-
|
|
12
|
+
var api_promise_1 = require("./api-promise.js");
|
|
13
|
+
Object.defineProperty(exports, "APIPromise", { enumerable: true, get: function () { return api_promise_1.APIPromise; } });
|
|
14
|
+
var client_2 = require("./client.js");
|
|
15
|
+
Object.defineProperty(exports, "Roark", { enumerable: true, get: function () { return client_2.Roark; } });
|
|
132
16
|
var error_1 = require("./error.js");
|
|
133
17
|
Object.defineProperty(exports, "RoarkError", { enumerable: true, get: function () { return error_1.RoarkError; } });
|
|
134
18
|
Object.defineProperty(exports, "APIError", { enumerable: true, get: function () { return error_1.APIError; } });
|
|
@@ -143,6 +27,4 @@ Object.defineProperty(exports, "AuthenticationError", { enumerable: true, get: f
|
|
|
143
27
|
Object.defineProperty(exports, "InternalServerError", { enumerable: true, get: function () { return error_1.InternalServerError; } });
|
|
144
28
|
Object.defineProperty(exports, "PermissionDeniedError", { enumerable: true, get: function () { return error_1.PermissionDeniedError; } });
|
|
145
29
|
Object.defineProperty(exports, "UnprocessableEntityError", { enumerable: true, get: function () { return error_1.UnprocessableEntityError; } });
|
|
146
|
-
exports = module.exports = Roark;
|
|
147
|
-
exports.default = Roark;
|
|
148
30
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":";AAAA,sFAAsF
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,sCAA4C;AAAnC,iGAAA,KAAK,OAAW;AAEzB,wCAAoD;AAA1B,iGAAA,MAAM,OAAA;AAChC,gDAA2C;AAAlC,yGAAA,UAAU,OAAA;AACnB,sCAAqD;AAA5C,+FAAA,KAAK,OAAA;AACd,oCAciB;AAbf,mGAAA,UAAU,OAAA;AACV,iGAAA,QAAQ,OAAA;AACR,2GAAA,kBAAkB,OAAA;AAClB,kHAAA,yBAAyB,OAAA;AACzB,0GAAA,iBAAiB,OAAA;AACjB,sGAAA,aAAa,OAAA;AACb,sGAAA,aAAa,OAAA;AACb,uGAAA,cAAc,OAAA;AACd,wGAAA,eAAe,OAAA;AACf,4GAAA,mBAAmB,OAAA;AACnB,4GAAA,mBAAmB,OAAA;AACnB,8GAAA,qBAAqB,OAAA;AACrB,iHAAA,wBAAwB,OAAA"}
|
package/index.mjs
CHANGED
|
@@ -1,105 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import * as Uploads from "./uploads.mjs";
|
|
7
|
-
import * as API from "./resources/index.mjs";
|
|
8
|
-
import { Call, } from "./resources/call.mjs";
|
|
9
|
-
import { Evaluation, } from "./resources/evaluation.mjs";
|
|
10
|
-
import { Health } from "./resources/health.mjs";
|
|
11
|
-
import { Integrations, } from "./resources/integrations.mjs";
|
|
12
|
-
import { Metric } from "./resources/metric.mjs";
|
|
13
|
-
import { Persona, } from "./resources/persona.mjs";
|
|
14
|
-
import { Simulation, } from "./resources/simulation.mjs";
|
|
15
|
-
/**
|
|
16
|
-
* API Client for interfacing with the Roark API.
|
|
17
|
-
*/
|
|
18
|
-
export class Roark extends Core.APIClient {
|
|
19
|
-
/**
|
|
20
|
-
* API Client for interfacing with the Roark API.
|
|
21
|
-
*
|
|
22
|
-
* @param {string | undefined} [opts.bearerToken=process.env['ROARK_API_BEARER_TOKEN'] ?? undefined]
|
|
23
|
-
* @param {string} [opts.baseURL=process.env['ROARK_BASE_URL'] ?? https://api.roark.ai] - Override the default base URL for the API.
|
|
24
|
-
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
|
|
25
|
-
* @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
|
|
26
|
-
* @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
|
|
27
|
-
* @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
|
|
28
|
-
* @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.
|
|
29
|
-
* @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API.
|
|
30
|
-
*/
|
|
31
|
-
constructor({ baseURL = Core.readEnv('ROARK_BASE_URL'), bearerToken = Core.readEnv('ROARK_API_BEARER_TOKEN'), ...opts } = {}) {
|
|
32
|
-
if (bearerToken === undefined) {
|
|
33
|
-
throw new Errors.RoarkError("The ROARK_API_BEARER_TOKEN environment variable is missing or empty; either provide it, or instantiate the Roark client with an bearerToken option, like new Roark({ bearerToken: 'My Bearer Token' }).");
|
|
34
|
-
}
|
|
35
|
-
const options = {
|
|
36
|
-
bearerToken,
|
|
37
|
-
...opts,
|
|
38
|
-
baseURL: baseURL || `https://api.roark.ai`,
|
|
39
|
-
};
|
|
40
|
-
super({
|
|
41
|
-
baseURL: options.baseURL,
|
|
42
|
-
baseURLOverridden: baseURL ? baseURL !== 'https://api.roark.ai' : false,
|
|
43
|
-
timeout: options.timeout ?? 60000 /* 1 minute */,
|
|
44
|
-
httpAgent: options.httpAgent,
|
|
45
|
-
maxRetries: options.maxRetries,
|
|
46
|
-
fetch: options.fetch,
|
|
47
|
-
});
|
|
48
|
-
_Roark_instances.add(this);
|
|
49
|
-
this.health = new API.Health(this);
|
|
50
|
-
this.evaluation = new API.Evaluation(this);
|
|
51
|
-
this.call = new API.Call(this);
|
|
52
|
-
this.metric = new API.Metric(this);
|
|
53
|
-
this.integrations = new API.Integrations(this);
|
|
54
|
-
this.simulation = new API.Simulation(this);
|
|
55
|
-
this.persona = new API.Persona(this);
|
|
56
|
-
this._options = options;
|
|
57
|
-
this.bearerToken = bearerToken;
|
|
58
|
-
}
|
|
59
|
-
defaultQuery() {
|
|
60
|
-
return this._options.defaultQuery;
|
|
61
|
-
}
|
|
62
|
-
defaultHeaders(opts) {
|
|
63
|
-
return {
|
|
64
|
-
...super.defaultHeaders(opts),
|
|
65
|
-
...this._options.defaultHeaders,
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
authHeaders(opts) {
|
|
69
|
-
return { Authorization: `Bearer ${this.bearerToken}` };
|
|
70
|
-
}
|
|
71
|
-
stringifyQuery(query) {
|
|
72
|
-
return qs.stringify(query, { arrayFormat: 'comma' });
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
_a = Roark, _Roark_instances = new WeakSet(), _Roark_baseURLOverridden = function _Roark_baseURLOverridden() {
|
|
76
|
-
return this.baseURL !== 'https://api.roark.ai';
|
|
77
|
-
};
|
|
78
|
-
Roark.Roark = _a;
|
|
79
|
-
Roark.DEFAULT_TIMEOUT = 60000; // 1 minute
|
|
80
|
-
Roark.RoarkError = Errors.RoarkError;
|
|
81
|
-
Roark.APIError = Errors.APIError;
|
|
82
|
-
Roark.APIConnectionError = Errors.APIConnectionError;
|
|
83
|
-
Roark.APIConnectionTimeoutError = Errors.APIConnectionTimeoutError;
|
|
84
|
-
Roark.APIUserAbortError = Errors.APIUserAbortError;
|
|
85
|
-
Roark.NotFoundError = Errors.NotFoundError;
|
|
86
|
-
Roark.ConflictError = Errors.ConflictError;
|
|
87
|
-
Roark.RateLimitError = Errors.RateLimitError;
|
|
88
|
-
Roark.BadRequestError = Errors.BadRequestError;
|
|
89
|
-
Roark.AuthenticationError = Errors.AuthenticationError;
|
|
90
|
-
Roark.InternalServerError = Errors.InternalServerError;
|
|
91
|
-
Roark.PermissionDeniedError = Errors.PermissionDeniedError;
|
|
92
|
-
Roark.UnprocessableEntityError = Errors.UnprocessableEntityError;
|
|
93
|
-
Roark.toFile = Uploads.toFile;
|
|
94
|
-
Roark.fileFromPath = Uploads.fileFromPath;
|
|
95
|
-
Roark.Health = Health;
|
|
96
|
-
Roark.Evaluation = Evaluation;
|
|
97
|
-
Roark.Call = Call;
|
|
98
|
-
Roark.Metric = Metric;
|
|
99
|
-
Roark.Integrations = Integrations;
|
|
100
|
-
Roark.Simulation = Simulation;
|
|
101
|
-
Roark.Persona = Persona;
|
|
102
|
-
export { toFile, fileFromPath } from "./uploads.mjs";
|
|
2
|
+
export { Roark as default } from "./client.mjs";
|
|
3
|
+
export { toFile } from "./uploads.mjs";
|
|
4
|
+
export { APIPromise } from "./api-promise.mjs";
|
|
5
|
+
export { Roark } from "./client.mjs";
|
|
103
6
|
export { RoarkError, APIError, APIConnectionError, APIConnectionTimeoutError, APIUserAbortError, NotFoundError, ConflictError, RateLimitError, BadRequestError, AuthenticationError, InternalServerError, PermissionDeniedError, UnprocessableEntityError, } from "./error.mjs";
|
|
104
|
-
export default Roark;
|
|
105
7
|
//# sourceMappingURL=index.mjs.map
|
package/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAAA,sFAAsF
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,KAAK,IAAI,OAAO,EAAE;OAEpB,EAAmB,MAAM,EAAE;OAC3B,EAAE,UAAU,EAAE;OACd,EAAE,KAAK,EAAsB;OAC7B,EACL,UAAU,EACV,QAAQ,EACR,kBAAkB,EAClB,yBAAyB,EACzB,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,wBAAwB,GACzB"}
|