@distilled.cloud/steel 1.0.0-rc.19 → 1.0.0-rc.21
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 +9 -6
- package/lib/.lazy.json +1 -1
- package/lib/_bundle/sdk.js +1 -1
- package/lib/_bundle/sdk.js.map +1 -1
- package/lib/credentials.d.ts +8 -3
- package/lib/credentials.d.ts.map +1 -1
- package/lib/errors.d.ts +12 -8
- package/lib/errors.d.ts.map +1 -1
- package/lib/errors.js +1 -1
- package/lib/index.d.ts +2 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +0 -1
- package/lib/pagination.d.ts.map +1 -1
- package/lib/protocol.d.ts +9 -12
- package/lib/protocol.d.ts.map +1 -1
- package/lib/retry.d.ts.map +1 -1
- package/lib/services/api_keys.d.ts +38 -0
- package/lib/services/api_keys.d.ts.map +1 -1
- package/lib/services/api_keys.js +1 -1
- package/lib/services/api_keys.js.map +1 -1
- package/lib/services/auth.d.ts.map +1 -1
- package/lib/services/auth.js +1 -1
- package/lib/services/auth.js.map +1 -1
- package/lib/services/browser_tools.d.ts +35 -0
- package/lib/services/browser_tools.d.ts.map +1 -1
- package/lib/services/browser_tools.js +1 -1
- package/lib/services/browser_tools.js.map +1 -1
- package/lib/services/captchas.d.ts +32 -0
- package/lib/services/captchas.d.ts.map +1 -1
- package/lib/services/captchas.js +1 -1
- package/lib/services/captchas.js.map +1 -1
- package/lib/services/credentials.d.ts +54 -0
- package/lib/services/credentials.d.ts.map +1 -1
- package/lib/services/credentials.js +1 -1
- package/lib/services/credentials.js.map +1 -1
- package/lib/services/extensions.d.ts +47 -1
- package/lib/services/extensions.d.ts.map +1 -1
- package/lib/services/extensions.js +1 -1
- package/lib/services/extensions.js.map +1 -1
- package/lib/services/files.d.ts +57 -3
- package/lib/services/files.d.ts.map +1 -1
- package/lib/services/files.js +1 -1
- package/lib/services/files.js.map +1 -1
- package/lib/services/index.d.ts +2 -0
- package/lib/services/index.d.ts.map +1 -1
- package/lib/services/index.js +2 -0
- package/lib/services/profiles.d.ts +64 -5
- package/lib/services/profiles.d.ts.map +1 -1
- package/lib/services/profiles.js +1 -1
- package/lib/services/profiles.js.map +1 -1
- package/lib/services/projects.d.ts +32 -0
- package/lib/services/projects.d.ts.map +1 -1
- package/lib/services/projects.js +1 -1
- package/lib/services/projects.js.map +1 -1
- package/lib/services/secret_connections.d.ts +233 -0
- package/lib/services/secret_connections.d.ts.map +1 -0
- package/lib/services/secret_connections.js +2 -0
- package/lib/services/secret_connections.js.map +1 -0
- package/lib/services/sessions.d.ts +526 -233
- package/lib/services/sessions.d.ts.map +1 -1
- package/lib/services/sessions.js +50 -41
- package/lib/services/sessions.js.map +1 -1
- package/lib/services/vaults.d.ts +149 -0
- package/lib/services/vaults.d.ts.map +1 -0
- package/lib/services/vaults.js +2 -0
- package/lib/services/vaults.js.map +1 -0
- package/lib/services.lazy/index.js +2 -2
- package/lib/services.lazy/secret_connections.js +1 -0
- package/lib/services.lazy/sessions.js +2 -2
- package/lib/services.lazy/vaults.js +1 -0
- package/lib/traits.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/credentials.ts +18 -12
- package/src/errors.ts +13 -5
- package/src/index.ts +2 -3
- package/src/protocol.ts +18 -30
- package/src/services/api_keys.ts +87 -7
- package/src/services/auth.ts +3 -2
- package/src/services/browser_tools.ts +101 -28
- package/src/services/captchas.ts +85 -17
- package/src/services/credentials.ts +129 -25
- package/src/services/extensions.ts +136 -34
- package/src/services/files.ts +172 -58
- package/src/services/index.ts +2 -0
- package/src/services/profiles.ts +198 -60
- package/src/services/projects.ts +79 -12
- package/src/services/secret_connections.ts +538 -0
- package/src/services/sessions.ts +1384 -794
- package/src/services/vaults.ts +369 -0
- package/lib/index.lazy.js +0 -7
- package/lib/index.lazy.js.map +0 -1
package/README.md
CHANGED
|
@@ -16,20 +16,22 @@ npm install @distilled.cloud/steel effect
|
|
|
16
16
|
import { Effect, Layer } from "effect";
|
|
17
17
|
import * as FetchHttpClient from "effect/http/FetchHttpClient";
|
|
18
18
|
import * as Steel from "@distilled.cloud/steel";
|
|
19
|
+
import * as BrowserTools from "@distilled.cloud/steel/browser_tools";
|
|
20
|
+
import * as Sessions from "@distilled.cloud/steel/sessions";
|
|
19
21
|
|
|
20
22
|
const program = Effect.gen(function* () {
|
|
21
23
|
// A one-shot scrape runs in a throwaway browser.
|
|
22
|
-
const page = yield*
|
|
24
|
+
const page = yield* BrowserTools.scrape({ url: "https://example.com", format: ["markdown"] });
|
|
23
25
|
|
|
24
26
|
// A session is a long-lived browser you drive over CDP: hand
|
|
25
27
|
// `Redacted.value(session.websocketUrl)` to Playwright or Puppeteer.
|
|
26
|
-
const session = yield*
|
|
27
|
-
yield*
|
|
28
|
+
const session = yield* Sessions.createSession({ blockAds: true });
|
|
29
|
+
yield* Sessions.releaseSession({ id: session.id });
|
|
28
30
|
|
|
29
31
|
return { markdown: page.content.markdown, viewer: session.sessionViewerUrl };
|
|
30
32
|
});
|
|
31
33
|
|
|
32
|
-
const Live = Layer.mergeAll(FetchHttpClient.layer, Steel.CredentialsFromEnv
|
|
34
|
+
const Live = Layer.mergeAll(FetchHttpClient.layer, Steel.CredentialsFromEnv);
|
|
33
35
|
|
|
34
36
|
program.pipe(Effect.provide(Live), Effect.runPromise);
|
|
35
37
|
```
|
|
@@ -41,15 +43,16 @@ One module per API area: `sessions`, `browserTools`, `files`, `captchas`, `crede
|
|
|
41
43
|
|
|
42
44
|
```ts
|
|
43
45
|
import * as Stream from "effect/Stream";
|
|
46
|
+
import * as Sessions from "@distilled.cloud/steel/sessions";
|
|
44
47
|
|
|
45
|
-
const live = yield*
|
|
48
|
+
const live = yield* Sessions.listSessions.items({ status: "live" }).pipe(Stream.runCollect);
|
|
46
49
|
```
|
|
47
50
|
|
|
48
51
|
`websocketUrl` and `debugUrl` come back `Redacted`: the first carries a session token that grants
|
|
49
52
|
control of the browser, and the second opens the session player without an API key.
|
|
50
53
|
|
|
51
54
|
Downloads (`files.downloadFile`, `files.downloadArchive`, `extensions.downloadExtension`, …) return
|
|
52
|
-
|
|
55
|
+
`{ body, contentType }`: the bytes as a `Stream<Uint8Array>` read as they arrive (`Stream.mkUint8Array` collects them) and the response's `Content-Type`. Uploads are multipart and take a `Blob`, `Uint8Array` or `ArrayBuffer`.
|
|
53
56
|
|
|
54
57
|
## Auth
|
|
55
58
|
|
package/lib/.lazy.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"serviceDirs":["services"],"twins":[
|
|
1
|
+
{"serviceDirs":["services"],"twins":[]}
|
package/lib/_bundle/sdk.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{api$D as e,api$call as t,api$error as n,api$named as r,api$newError as i,api$op as a,api$opPaginated as o,category$withAuthError as s,category$withBadRequestError as c,category$withConflictError as
|
|
1
|
+
import{api$D as e,api$call as t,api$error as n,api$named as r,api$newError as i,api$op as a,api$opPaginated as o,category$withAuthError as s,category$withBadRequestError as c,category$withConflictError as ee,category$withParseError as te,config$Redacted as ne,config$String as re,config$all as ie,config$withDefault as ae,pagination$paginateCursor as l,retry$capped as u,retry$jittered as d,retry$makeDefault as f,retry$throttlingFactory as p,retry$throttlingOptions as m,retry$transientFactory as h,retry$transientOptions as g,schema_lite_typed$TaggedError as _,schema_lite_typed$Unknown as v,trait$Body as y,trait$FormDataFile as b,trait$Header as x,trait$Http as S,trait$HttpBody as C,trait$KeyDictionary as w,trait$Label as T,trait$Query as E,trait$ResponseCode as D,trait$UnionCases as O,trait$applyErrorMatchers as k,trait$bodySymbol as A,trait$errorMatchersSymbol as j,trait$formDataFileSymbol as M,trait$getErrorMatchers as N,trait$headerSymbol as P,trait$httpBodySymbol as F,trait$httpSymbol as I,trait$keyDictionarySymbol as L,trait$labelSymbol as R,trait$querySymbol as z,trait$responseCodeSymbol as B,trait$unionCasesSymbol as V}from"@distilled.cloud/core/_bundle/base";import{errors$API_ERRORS as H,errors$BadGateway as U,errors$BadRequest as W,errors$ConfigError as G,errors$Conflict as K,errors$DEFAULT_ERRORS as q,errors$Forbidden as J,errors$GatewayTimeout as oe,errors$HTTP_STATUS_MAP as se,errors$InternalServerError as ce,errors$Locked as le,errors$NotFound as ue,errors$ServiceUnavailable as de,errors$TooManyRequests as fe,errors$Unauthorized as pe,errors$UnknownErrorFields as me,errors$UnprocessableEntity as he,protocol_rest$BinaryResponse as ge,protocol_rest$BinaryStream as _e,protocol_rest$RawResponse as ve,protocol_rest$RawResponseRoot as ye,protocol_rest$SensitiveValue as be,protocol_rest$rawResponseRootSymbol as xe,protocol_rest$rawResponseSymbol as Se,protocol_rest$restProtocol as Ce,protocol_rest$sensitiveValueSymbol as we,protocol_rest$unknownErrorProps as Te,schema_lite$Array as Ee,schema_lite$Boolean as De,schema_lite$NullOr as Oe,schema_lite$Number as ke,schema_lite$Record as Ae,schema_lite$String as je,schema_lite$Struct as Me,schema_lite$StructWithRest as Ne,schema_lite$TaggedError as Pe,schema_lite$Union as Fe,schema_lite$Unknown as Ie,schema_lite$at as Le,schema_lite$instanceOf as Re,schema_lite$optional as ze,schema_lite$suspend as Be}from"@distilled.cloud/core/_bundle/rest";import*as Y from"effect/Context";import*as X from"effect/Effect";import*as Z from"effect/Layer";import*as Ve from"effect/Redacted";const Q=`https://api.steel.dev`;var Credentials=class extends (/*@__PURE__*/ Y.Service()(`SteelCredentials`)){};const He=/*@__PURE__*/ ie({apiKey:/*@__PURE__*/ ne(`STEEL_API_KEY`),baseUrl:/*@__PURE__*/ re(`STEEL_BASE_URL`).pipe(/*@__PURE__*/ ae(Q))});const Ue=/*@__PURE__*/ Z.effect(Credentials,/*@__PURE__*/ X.map(/*@__PURE__*/ He.pipe(/*@__PURE__*/ X.map(({apiKey:e,baseUrl:t})=>({apiKey:e,baseUrl:t.replace(/\/+$/,``)})),/*@__PURE__*/ X.mapError(()=>new G({message:`STEEL_API_KEY environment variable is required`}))),e=>X.succeed(e)));const fromApiKey=e=>Z.succeed(Credentials,X.succeed({apiKey:e.apiKey,baseUrl:(e.baseUrl??`https://api.steel.dev`).replace(/\/+$/,``)}));var UnknownSteelError=class extends (/*@__PURE__*/ _()(`UnknownSteelError`,me)){};var SteelParseError=class extends (/*@__PURE__*/ _()(`SteelParseError`,{body:v,cause:v}).pipe(te)){};const We=H;const str=e=>typeof e===`string`?e:void 0;const errorEnvelope=e=>{if(e===null||typeof e!==`object`)return void 0;const t=e;const n=t.error!==null&&typeof t.error===`object`?t.error:t;const r=str(n.code);const i=str(n.message)??str(t.error);if(r===void 0&&i===void 0)return void 0;return{code:r,message:i}};const $=/*@__PURE__*/ Ce({credentials:/*@__PURE__*/ X.flatten(Credentials),baseUrl:e=>e.baseUrl,headers:e=>({"steel-api-key":Ve.value(e.apiKey)}),errorEnvelope,unknownError:e=>new UnknownSteelError(Te(e)),parseError:({body:e,cause:t})=>new SteelParseError({body:e,cause:t})});var Retry=class extends (/*@__PURE__*/ Y.Service()(`SteelRetry`)){};const policy=e=>X.provide(Z.succeed(Retry,e));const Ge=/*@__PURE__*/ X.provide(/*@__PURE__*/ Z.succeed(Retry,{while:()=>false}));const Ke=f;const qe=d;const Je=u;const Ye=m;const Xe=/*@__PURE__*/ policy(p);const Ze=g;const Qe=/*@__PURE__*/ policy(h);export{ee as Ca,Oe as Fc,ke as Gc,Ae as Hc,je as Jc,_e as Kb,Me as Kc,Ne as Lc,Pe as Mc,Fe as Oc,Ie as Pc,Le as Rc,Re as Uc,ze as Wc,Be as Xc,e as a,t as b,Credentials as credentials$Credentials,Ue as credentials$CredentialsFromEnv,Q as credentials$DEFAULT_BASE_URL,fromApiKey as credentials$fromApiKey,H as errors$API_ERRORS,U as errors$BadGateway,W as errors$BadRequest,G as errors$ConfigError,K as errors$Conflict,q as errors$DEFAULT_ERRORS,J as errors$Forbidden,oe as errors$GatewayTimeout,se as errors$HTTP_STATUS_MAP,ce as errors$InternalServerError,le as errors$Locked,ue as errors$NotFound,de as errors$ServiceUnavailable,SteelParseError as errors$SteelParseError,We as errors$SteelServiceErrors,fe as errors$TooManyRequests,pe as errors$Unauthorized,UnknownSteelError as errors$UnknownSteelError,he as errors$UnprocessableEntity,n as f,r as l,i as m,a as n,o,l as pagination$paginateCursor,$ as protocol$SteelProtocol,Retry as retry$Retry,Je as retry$capped,qe as retry$jittered,Ke as retry$makeDefault,Ge as retry$none,policy as retry$policy,Xe as retry$throttling,Ye as retry$throttlingOptions,Qe as retry$transient,Ze as retry$transientOptions,ge as traits$BinaryResponse,y as traits$Body,b as traits$FormDataFile,x as traits$Header,S as traits$Http,C as traits$HttpBody,w as traits$KeyDictionary,T as traits$Label,E as traits$Query,ve as traits$RawResponse,ye as traits$RawResponseRoot,D as traits$ResponseCode,be as traits$SensitiveValue,O as traits$UnionCases,k as traits$applyErrorMatchers,A as traits$bodySymbol,j as traits$errorMatchersSymbol,M as traits$formDataFileSymbol,N as traits$getErrorMatchers,P as traits$headerSymbol,F as traits$httpBodySymbol,I as traits$httpSymbol,L as traits$keyDictionarySymbol,R as traits$labelSymbol,z as traits$querySymbol,xe as traits$rawResponseRootSymbol,Se as traits$rawResponseSymbol,B as traits$responseCodeSymbol,we as traits$sensitiveValueSymbol,V as traits$unionCasesSymbol,Ee as wc,De as xc,s as ya,c as za};
|
|
2
2
|
//# sourceMappingURL=sdk.js.map
|
package/lib/_bundle/sdk.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.js","names":["Schema.
|
|
1
|
+
{"version":3,"file":"sdk.js","names":["Schema.Unknown","Category.withParseError","Retries.makeDefault","Retries.jittered","Retries.capped","Retries.throttlingOptions","Retries.throttlingFactory","Retries.transientOptions","Retries.transientFactory","D","call","error","named","newError","op","opPaginated","withAuthError","withBadRequestError","withConflictError","withParseError","Redacted$3","String$2","all$1","withDefault","paginateCursor","capped$1","jittered$1","makeDefault$1","throttlingFactory","throttlingOptions$1","transientFactory","transientOptions$1","TaggedError$1","Unknown$1","Body","FormDataFile","Header","Http","HttpBody","KeyDictionary","Label","Query","ResponseCode","UnionCases","applyErrorMatchers","bodySymbol","errorMatchersSymbol","formDataFileSymbol","getErrorMatchers","headerSymbol","httpBodySymbol","httpSymbol","keyDictionarySymbol","labelSymbol","querySymbol","responseCodeSymbol","unionCasesSymbol","API_ERRORS","BadGateway","BadRequest","ConfigError","Conflict","DEFAULT_ERRORS","Forbidden","GatewayTimeout","HTTP_STATUS_MAP","InternalServerError","Locked","NotFound","ServiceUnavailable","TooManyRequests","Unauthorized","UnknownErrorFields","UnprocessableEntity","BinaryResponse","BinaryStream","RawResponse","RawResponseRoot","SensitiveValue","rawResponseRootSymbol","rawResponseSymbol","restProtocol","sensitiveValueSymbol","unknownErrorProps","Array","Boolean","NullOr","Number","Record","String","Struct","StructWithRest","TaggedError","Union","Unknown","at","instanceOf","optional","suspend","Context","Effect","Layer","Redacted","DEFAULT_BASE_URL","envConfig","CredentialsFromEnv","baseUrl","config","SteelServiceErrors","value","body","rec","nested","code","message","SteelProtocol","creds","info","optionsOrFactory","none","makeDefault","jittered","capped","throttlingOptions","throttling","transientOptions","transient"],"sources":["../../src/credentials.ts","../../src/errors.ts","../../src/protocol.ts","../../src/retry.ts"],"mappings":"kgFAiBA,MAAauG,EAAmB,wBAQhC,IAAa,YAAb,eACwB,gBAAQ,QAA4C,CAAC,CAAC,kBAAkB,EAAA,AAAE,CAAC,EAEnG,MAAMC,GAA0B,iBAAiB,CAC/C,OAAsB,iBAAsB,eAAe,EAC3D,QAAuB,iBAAoB,gBAAgB,CAAC,CAAC,KAC7C,iBAAyBD,CAAgB,CACzD,CACF,CAAC,EAQD,MAAaE,GAA0E,gBAAM,OAC3F,YACc,gBAAO,IACL,iBAAU,KACR,gBAAO,KAAK,CAAE,SAAQ,cAAe,CACjD,SACA,QAASC,EAAQ,QAAQ,OAAQ,EAAE,CACrC,EAAE,EACY,gBAAO,aACb,IAAI9C,EAAY,CAAE,QAAS,gDAAiD,CAAC,CACrF,CACF,EACC,GAAWwC,EAAO,QAAQO,CAAM,CACnC,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R,GAAwCjB,EAAO,QAAQC,EAAM,QAAQ,MAAOiB,CAAgB,CAAC,EAGlG,MAAaC,GAE+C,gBAAO,QACnD,gBAAM,QAAQ,MAAO,CAAE,UAAa,KAAM,CAAC,CAC3D,EAOA,MAAaC,GAAuBtH,EAEpC,MAAauH,GAAWtH,EACxB,MAAauH,GAAStH,EAGtB,MAAauH,GAA6BtH,EAG1C,MAAauH,GAE+C,qBAAOtH,CAAyB,EAG5F,MAAauH,GAA4BtH,EAGzC,MAAauH,GAE+C,qBAAOtH,CAAwB"}
|
package/lib/credentials.d.ts
CHANGED
|
@@ -10,11 +10,16 @@ export interface Config {
|
|
|
10
10
|
/** API base URL, without a trailing slash. */
|
|
11
11
|
readonly baseUrl: string;
|
|
12
12
|
}
|
|
13
|
-
declare const Credentials_base: Context.ServiceClass<Credentials, "SteelCredentials", Effect.Effect<Config,
|
|
13
|
+
declare const Credentials_base: Context.ServiceClass<Credentials, "SteelCredentials", Effect.Effect<Config, never, never>>;
|
|
14
14
|
export declare class Credentials extends /*@__PURE__*/ Credentials_base {
|
|
15
15
|
}
|
|
16
|
-
/**
|
|
17
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Reads `STEEL_API_KEY` (required) and `STEEL_BASE_URL` (optional).
|
|
18
|
+
*
|
|
19
|
+
* Its configuration is read and checked once, when the layer is built: a
|
|
20
|
+
* problem there fails the layer with `ConfigError`.
|
|
21
|
+
*/
|
|
22
|
+
export declare const CredentialsFromEnv: Layer.Layer<Credentials, ConfigError>;
|
|
18
23
|
/** Credentials from a redacted API key and an optional base URL. */
|
|
19
24
|
export declare const fromApiKey: (config: {
|
|
20
25
|
readonly apiKey: Redacted.Redacted<string>;
|
package/lib/credentials.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentials.d.ts","
|
|
1
|
+
{"version":3,"file":"credentials.d.ts","sources":["../src/credentials.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAE5C,sDAAsD;AACtD,eAAO,MAAM,gBAAgB,0BAA0B,CAAC;AAExD,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC3C,8CAA8C;IAC9C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;;AAED,qBAAa,WACX,SAAQ,aAAa,CAAC,gBAAyE;CAAG;AASpG;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,EAAE,WAAW,CAcpE,CAAC;AAEF,oEAAoE;AACpE,eAAO,MAAM,UAAU,WAAY;IACjC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC3C,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B,KAAG,KAAK,CAAC,KAAK,CAAC,WAAW,CAOxB,CAAC"}
|
package/lib/errors.d.ts
CHANGED
|
@@ -14,14 +14,11 @@ export { BadGateway, BadRequest, Conflict, ConfigError, Forbidden, GatewayTimeou
|
|
|
14
14
|
export type { DefaultErrors } from "@distilled.cloud/core/errors";
|
|
15
15
|
import * as Schema from "@distilled.cloud/core/schema-lite-typed";
|
|
16
16
|
declare const UnknownSteelError_base: Schema.TaggedErrorClass<"UnknownSteelError", {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
ServerError: true;
|
|
23
|
-
};
|
|
24
|
-
});
|
|
17
|
+
status: import("effect/Schema").Number;
|
|
18
|
+
code: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
19
|
+
message: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
20
|
+
body: import("effect/Schema").Unknown;
|
|
21
|
+
}>;
|
|
25
22
|
/**
|
|
26
23
|
* Unknown Steel error -- returned when an error response matches neither an
|
|
27
24
|
* operation's typed errors nor a shared HTTP status class.
|
|
@@ -39,4 +36,11 @@ declare const SteelParseError_base: Schema.TaggedErrorClass<"SteelParseError", {
|
|
|
39
36
|
/** A 2xx response that does not match the operation's output schema. */
|
|
40
37
|
export declare class SteelParseError extends /*@__PURE__*/ SteelParseError_base {
|
|
41
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* The errors declared on the Steel service: any operation can return them, and
|
|
41
|
+
* every generated operation lists them as its `serviceErrors`. Today that is
|
|
42
|
+
* each of core's status classes (401, 403, 404, 429, the 5xx ...).
|
|
43
|
+
*/
|
|
44
|
+
export declare const SteelServiceErrors: readonly [typeof import("@distilled.cloud/core/errors").Unauthorized, typeof import("@distilled.cloud/core/errors").Forbidden, typeof import("@distilled.cloud/core/errors").NotFound, typeof import("@distilled.cloud/core/errors").BadRequest, typeof import("@distilled.cloud/core/errors").Conflict, typeof import("@distilled.cloud/core/errors").UnprocessableEntity, typeof import("@distilled.cloud/core/errors").TooManyRequests, typeof import("@distilled.cloud/core/errors").Locked, typeof import("@distilled.cloud/core/errors").InternalServerError, typeof import("@distilled.cloud/core/errors").BadGateway, typeof import("@distilled.cloud/core/errors").ServiceUnavailable, typeof import("@distilled.cloud/core/errors").GatewayTimeout];
|
|
45
|
+
export type SteelServiceError = InstanceType<(typeof SteelServiceErrors)[number]>;
|
|
42
46
|
//# sourceMappingURL=errors.d.ts.map
|
package/lib/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EACL,UAAU,EACV,UAAU,EACV,QAAQ,EACR,WAAW,EACX,SAAS,EACT,cAAc,EACd,mBAAmB,EACnB,MAAM,EACN,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,UAAU,GACX,MAAM,8BAA8B,CAAC;AACtC,YAAY,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAGlE,OAAO,KAAK,MAAM,MAAM,yCAAyC,CAAC;;;;;;;AAElE;;;GAGG;AACH,qBAAa,iBACX,SAAQ,aAAa,CAAC,sBAGrB;CAAG;;;;;;;;;AAEN,wEAAwE;AACxE,qBAAa,eACX,SAAQ,aAAa,CAAC,oBAGU;CAAG;AAErC;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,+tBAAa,CAAC;AAC7C,MAAM,MAAM,iBAAiB,GAAG,YAAY,CAAC,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC"}
|
package/lib/errors.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { errors$API_ERRORS as API_ERRORS, errors$BadGateway as BadGateway, errors$BadRequest as BadRequest, errors$ConfigError as ConfigError, errors$Conflict as Conflict, errors$DEFAULT_ERRORS as DEFAULT_ERRORS, errors$Forbidden as Forbidden, errors$GatewayTimeout as GatewayTimeout, errors$HTTP_STATUS_MAP as HTTP_STATUS_MAP, errors$InternalServerError as InternalServerError, errors$Locked as Locked, errors$NotFound as NotFound, errors$ServiceUnavailable as ServiceUnavailable, errors$SteelParseError as SteelParseError, errors$TooManyRequests as TooManyRequests, errors$Unauthorized as Unauthorized, errors$UnknownSteelError as UnknownSteelError, errors$UnprocessableEntity as UnprocessableEntity } from "./_bundle/sdk.js";
|
|
1
|
+
export { errors$API_ERRORS as API_ERRORS, errors$BadGateway as BadGateway, errors$BadRequest as BadRequest, errors$ConfigError as ConfigError, errors$Conflict as Conflict, errors$DEFAULT_ERRORS as DEFAULT_ERRORS, errors$Forbidden as Forbidden, errors$GatewayTimeout as GatewayTimeout, errors$HTTP_STATUS_MAP as HTTP_STATUS_MAP, errors$InternalServerError as InternalServerError, errors$Locked as Locked, errors$NotFound as NotFound, errors$ServiceUnavailable as ServiceUnavailable, errors$SteelParseError as SteelParseError, errors$SteelServiceErrors as SteelServiceErrors, errors$TooManyRequests as TooManyRequests, errors$Unauthorized as Unauthorized, errors$UnknownSteelError as UnknownSteelError, errors$UnprocessableEntity as UnprocessableEntity } from "./_bundle/sdk.js";
|
package/lib/index.d.ts
CHANGED
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
*
|
|
12
12
|
* @example
|
|
13
13
|
* ```ts
|
|
14
|
-
* import * as
|
|
14
|
+
* import * as Sessions from "@distilled.cloud/steel/sessions";
|
|
15
15
|
*
|
|
16
|
-
* const session = yield*
|
|
16
|
+
* const session = yield* Sessions.createSession({ blockAds: true });
|
|
17
17
|
* ```
|
|
18
18
|
*/
|
|
19
19
|
export * from "./credentials.ts";
|
|
@@ -22,5 +22,4 @@ export * as T from "./traits.ts";
|
|
|
22
22
|
export { SteelProtocol, type SteelOpError, type SteelOpContext } from "./protocol.ts";
|
|
23
23
|
export { paginateCursor } from "./pagination.ts";
|
|
24
24
|
export * as Retry from "./retry.ts";
|
|
25
|
-
export * from "./services/index.ts";
|
|
26
25
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","
|
|
1
|
+
{"version":3,"file":"index.d.ts","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,KAAK,YAAY,EAAE,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AACtF,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC"}
|
package/lib/index.js
CHANGED
package/lib/pagination.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination.d.ts","
|
|
1
|
+
{"version":3,"file":"pagination.d.ts","sources":["../src/pagination.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC"}
|
package/lib/protocol.d.ts
CHANGED
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type { API_ERRORS, ConfigError, InvalidInput } from "@distilled.cloud/core/errors";
|
|
3
|
-
import type { SdkError } from "@distilled.cloud/core/sdk-error";
|
|
1
|
+
import type { ErrorOf } from "@distilled.cloud/core/protocol";
|
|
4
2
|
import type * as HttpClient from "effect/http/HttpClient";
|
|
5
|
-
import type * as HttpClientError from "effect/http/HttpClientError";
|
|
6
|
-
import type * as Layer from "effect/Layer";
|
|
7
3
|
import { Credentials } from "./credentials.ts";
|
|
8
|
-
import { SteelParseError, UnknownSteelError } from "./errors.ts";
|
|
4
|
+
import { SteelParseError, UnknownSteelError, type SteelServiceError } from "./errors.ts";
|
|
9
5
|
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
6
|
+
* What every generated Steel operation fails with besides its own errors: the
|
|
7
|
+
* service's errors, the protocol's, and what resolving the credentials fails
|
|
8
|
+
* with. Generated service files annotate operations with
|
|
9
|
+
* `API.OperationMethod<I, O, SteelOpError, SteelOpContext>` explicitly so the
|
|
10
|
+
* compiler never infers these back out of the schema generics.
|
|
14
11
|
*/
|
|
15
|
-
export type SteelOpError =
|
|
12
|
+
export type SteelOpError = SteelServiceError | ErrorOf<typeof SteelProtocol>;
|
|
16
13
|
/** Context (requirements) shared by every generated Steel operation. */
|
|
17
14
|
export type SteelOpContext = Credentials | HttpClient.HttpClient;
|
|
18
|
-
export declare const SteelProtocol:
|
|
15
|
+
export declare const SteelProtocol: import("@distilled.cloud/core/protocol").Protocol<SteelParseError | UnknownSteelError | import("@distilled.cloud/core/protocol-rest").RestProtocolError, Credentials>;
|
|
19
16
|
//# sourceMappingURL=protocol.d.ts.map
|
package/lib/protocol.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.d.ts","
|
|
1
|
+
{"version":3,"file":"protocol.d.ts","sources":["../src/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAoB9D,OAAO,KAAK,KAAK,UAAU,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEzF;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GAAG,iBAAiB,GAAG,OAAO,CAAC,OAAO,aAAa,CAAC,CAAC;AAE7E,wEAAwE;AACxE,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG,UAAU,CAAC,UAAU,CAAC;AAmBjE,eAAO,MAAM,aAAa,uKAUxB,CAAC"}
|
package/lib/retry.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retry.d.ts","
|
|
1
|
+
{"version":3,"file":"retry.d.ts","sources":["../src/retry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,6BAA6B,CAAC;AACvD;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,MAAM,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;AACtC,MAAM,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;AACtC,MAAM,MAAM,MAAM,GAAG,OAAO,CAAC,MA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E,CAAC,EAAE,CAAC,CAAC,KAC3B,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,KAAK,CAAC,CAAmD,CAAC;AAE9F,kEAAkE;AAClE,eAAO,MAAM,gBAAgB,EAAE,OAAkC,CAAC;AAElE,iDAAiD;AACjD,eAAO,MAAM,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAC9B,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,KAC3B,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,KAAK,CAAC,CAAkD,CAAC"}
|
|
@@ -6,32 +6,41 @@ export type { SteelOpError, SteelOpContext };
|
|
|
6
6
|
declare const BadRequest_base: S.TaggedErrorClass<"BadRequest", {
|
|
7
7
|
readonly code: any;
|
|
8
8
|
readonly message: any;
|
|
9
|
+
readonly body: any;
|
|
10
|
+
readonly headers: any;
|
|
9
11
|
}> & (new (...args: any[]) => {
|
|
10
12
|
"@distilled.cloud/error/categories": {
|
|
11
13
|
BadRequestError: true;
|
|
12
14
|
};
|
|
13
15
|
});
|
|
14
16
|
export declare class BadRequest extends /*@__PURE__*/ BadRequest_base {
|
|
17
|
+
readonly body?: ErrorResponse | string;
|
|
15
18
|
}
|
|
16
19
|
declare const Forbidden_base: S.TaggedErrorClass<"Forbidden", {
|
|
17
20
|
readonly code: any;
|
|
18
21
|
readonly message: any;
|
|
22
|
+
readonly body: any;
|
|
23
|
+
readonly headers: any;
|
|
19
24
|
}> & (new (...args: any[]) => {
|
|
20
25
|
"@distilled.cloud/error/categories": {
|
|
21
26
|
AuthError: true;
|
|
22
27
|
};
|
|
23
28
|
});
|
|
24
29
|
export declare class Forbidden extends /*@__PURE__*/ Forbidden_base {
|
|
30
|
+
readonly body?: ErrorResponse | string;
|
|
25
31
|
}
|
|
26
32
|
declare const NotFound_base: S.TaggedErrorClass<"NotFound", {
|
|
27
33
|
readonly code: any;
|
|
28
34
|
readonly message: any;
|
|
35
|
+
readonly body: any;
|
|
36
|
+
readonly headers: any;
|
|
29
37
|
}> & (new (...args: any[]) => {
|
|
30
38
|
"@distilled.cloud/error/categories": {
|
|
31
39
|
BadRequestError: true;
|
|
32
40
|
};
|
|
33
41
|
});
|
|
34
42
|
export declare class NotFound extends /*@__PURE__*/ NotFound_base {
|
|
43
|
+
readonly body?: ErrorResponse | string;
|
|
35
44
|
}
|
|
36
45
|
/** Defaults to `project`. Global API keys may only create project-scoped keys. Only organization admins using dashboard authentication may create a `global` key; projectId is ignored for those keys. */
|
|
37
46
|
export type CreateApiKeyRequestScopeType = "project" | "global";
|
|
@@ -57,6 +66,35 @@ export interface ApiKeyResponse {
|
|
|
57
66
|
scopeType: ApiKeyResponseScopeType;
|
|
58
67
|
updatedAt: string;
|
|
59
68
|
}
|
|
69
|
+
export interface ErrorResponseContextItem {
|
|
70
|
+
keyword: string;
|
|
71
|
+
message: string;
|
|
72
|
+
params: unknown;
|
|
73
|
+
}
|
|
74
|
+
export type ErrorResponseContextList = Array<ErrorResponseContextItem>;
|
|
75
|
+
/** Structured data about the error for the caller, e.g. `candidates` for credential_ambiguous. Never contains secret values. */
|
|
76
|
+
export type ErrorResponseDetailsMap = {
|
|
77
|
+
[key: string]: unknown | undefined;
|
|
78
|
+
};
|
|
79
|
+
/** An error response from the API */
|
|
80
|
+
export interface ErrorResponse {
|
|
81
|
+
/** Stable machine-readable reason, e.g. 'budget_exceeded' or 'profile_not_ready'. Branch on this instead of parsing the message. */
|
|
82
|
+
code?: string | undefined;
|
|
83
|
+
context?: ErrorResponseContextList | undefined;
|
|
84
|
+
/** Structured data about the error for the caller, e.g. `candidates` for credential_ambiguous. Never contains secret values. */
|
|
85
|
+
details?: ErrorResponseDetailsMap | undefined;
|
|
86
|
+
error?: string | undefined;
|
|
87
|
+
linkToDocs?: string | undefined;
|
|
88
|
+
message: string;
|
|
89
|
+
/** The request field that caused the error, if any. */
|
|
90
|
+
param?: string | undefined;
|
|
91
|
+
/** Seconds to wait before retrying. Also sent as the Retry-After header. */
|
|
92
|
+
retryAfterSeconds?: number | undefined;
|
|
93
|
+
/** Whether the same request can succeed later without changes. False means fix the request or the account first. */
|
|
94
|
+
retryable?: boolean | undefined;
|
|
95
|
+
/** Where a person turns on the refused feature, e.g. verifying the account. Pass it to your user. */
|
|
96
|
+
unlockUrl?: string | undefined;
|
|
97
|
+
}
|
|
60
98
|
export type CreateApiKeyError = BadRequest | Forbidden | NotFound | SteelOpError;
|
|
61
99
|
/** Create an API key Create a project-scoped API key using a global (organization-scoped) API key. Supply projectId for an active project in the authenticated organization; scopeType must be project or omitted. Project-scoped API keys cannot create keys, and global keys cannot create other global keys. Dashboard users may also create project keys, or global keys with organization admin access. Returns the full secret once with Cache-Control: no-store; save it securely. The new key is independent: revoking the creating global key does not revoke keys it created. Missing projectId returns 400; insufficient scope returns 403; an unavailable or foreign project returns 404. */
|
|
62
100
|
export declare const createApiKey: API.OperationMethod<CreateApiKeyRequest, ApiKeyResponse, CreateApiKeyError, SteelOpContext>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api_keys.d.ts","
|
|
1
|
+
{"version":3,"file":"api_keys.d.ts","sources":["../../src/services/api_keys.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,2BAA2B,CAAC;AAGjD,OAAO,KAAK,CAAC,MAAM,mCAAmC,CAAC;AAEvD,OAAO,KAAK,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAEjD,OAAO,EAAiB,KAAK,YAAY,EAAE,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAMvF,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,CAAC;;;;;;;;;;;AAc7C,qBAAa,UACX,SAAQ,aAAa,CAAC,eAUrB;IAED,SAAiB,IAAI,CAAC,EAAE,aAAa,GAAG,MAAM,CAAC;CAChD;;;;;;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AAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAA;CAAE,CAAC;AAC7E,qCAAqC;AACrC,MAAM,WAAW,aAAa;IAC5B,oIAAoI;IACpI,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,OAAO,CAAC,EAAE,wBAAwB,GAAG,SAAS,CAAC;IAC/C,gIAAgI;IAChI,OAAO,CAAC,EAAE,uBAAuB,GAAG,SAAS,CAAC;IAC9C,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,uDAAuD;IACvD,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,4EAA4E;IAC5E,iBAAiB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC,oHAAoH;IACpH,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAChC,qGAAqG;IACrG,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAChC;AACD,MAAM,MAAM,iBAAiB,GAAG,UAAU,GAAG,SAAS,GAAG,QAAQ,GAAG,YAAY,CAAC;AACjF,yqBAAyqB;AACzqB,eAAO,MAAM,YAAY,EAAE,GAAG,CAAC,eAAe,CAC5C,mBAAmB,EACnB,cAAc,EACd,iBAAiB,EACjB,cAAc,CAUb,CAAC"}
|
package/lib/services/api_keys.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Fc as e,Gc as t,Hc as n,Jc as r,Kc as i,Mc as a,Oc as o,Pc as s,Rc as c,Wc as l,Xc as u,a as d,b as f,errors$SteelServiceErrors as p,f as m,l as h,m as g,n as _,protocol$SteelProtocol as v,retry$Retry as y,traits$Http as b,traits$SensitiveValue as x,traits$applyErrorMatchers as S,wc as C,xc as w,ya as T,za as E}from"../_bundle/sdk.js";const D={system:`steel-api`,responseHeaders:[{header:`x-request-id`,name:`http.response.header.x-request-id`,transform:`list`},{header:`request-id`,name:`http.response.header.request-id`,transform:`list`}],prefix:`Steel`,service:`ApiKeys`,propagate:`w3c`};const O=/*@__PURE__*/ m(function BadRequest(e){return g(e,new.target,[`$10($9()("BadRequest",{code:$2,message:$3,body:$7($6([$5(>1),$3])),headers:$7($8($3,$3))}).pipe($1),[{status:400}]);#4:3`,[c,E,t,r,__d0,u,o,l,n,a,S]])});const k=/*@__PURE__*/ m(function Forbidden(e){return g(e,new.target,[`$10($9()("Forbidden",{code:$2,message:$3,body:$7($6([$5(>1),$3])),headers:$7($8($3,$3))}).pipe($1),[{status:403}]);#4:3`,[c,T,t,r,__d0,u,o,l,n,a,S]])});const A=/*@__PURE__*/ m(function NotFound(e){return g(e,new.target,[`$10($9()("NotFound",{code:$2,message:$3,body:$7($6([$5(>1),$3])),headers:$7($8($3,$3))}).pipe($1),[{status:404}]);#4:3`,[c,E,t,r,__d0,u,o,l,n,a,S]])});const j=/*@__PURE__*/ _(t=>t===d?h(`CreateApiKey`,`{input:#1,output:#2,errors:[$8,$9,$10],serviceErrors:$11,protocol:$12,retry:$13,telemetry:$14,span:"%"};$5(>3)@"%Request";$5(>4)@"ApiKeyResponse";$4({name:$3($2),projectId:$3($2),scopeType:$3($2)}).pipe($1({method:"POST",uri:"/v1/api-keys",code:200}));$4({createdAt:$2,id:$2,key:$2.pipe($6({})),name:$3($2),projectId:$7($2),scopeType:$2,updatedAt:$2})`,[c,b,r,l,i,u,x,e,O,k,A,p,v,y,D]):f(j,t));function __d0(){return[`$4(>4)@"ErrorResponseContextItem";$5(#0);$6($1,$2);$4(>5)@"ErrorResponse";$3({keyword:$1,message:$1,params:$2});$3({code:$7($1),context:$7(#1),details:$7(#2),error:$7($1),linkToDocs:$7($1),message:$1,param:$7($1),retryAfterSeconds:$7($8),retryable:$7($9),unlockUrl:$7($1)})`,[c,r,s,i,u,C,n,l,t,w]]}export{O as BadRequest,k as Forbidden,A as NotFound,j as createApiKey};
|
|
2
2
|
//# sourceMappingURL=api_keys.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api_keys.js","names":["API.newError","__L.at","C.withBadRequestError","S.Number","S.String","S.TaggedError","T.applyErrorMatchers","C.withAuthError","API.D","API.named","T.Http","S.
|
|
1
|
+
{"version":3,"file":"api_keys.js","names":["API.newError","__L.at","C.withBadRequestError","S.Number","S.String","S.suspend","S.Union","S.optional","S.Record","S.TaggedError","T.applyErrorMatchers","C.withAuthError","API.D","API.named","T.Http","S.Struct","T.SensitiveValue","S.NullOr","Retry.Retry","API.call","S.Unknown","S.Array","S.Boolean","NullOr","Number","Record","String","Struct","TaggedError","Union","Unknown","at","optional","suspend","D","call","SteelServiceErrors","error","named","newError","op","SteelProtocol","Retry","Http","SensitiveValue","applyErrorMatchers","Array","Boolean","withAuthError","withBadRequestError","TELEMETRY","BadRequest","i","Forbidden","NotFound","createApiKey"],"sources":["../../src/services/api_keys.ts"],"mappings":"wVAcA,MAAMkD,EAAY,CAChB,OAAQ,YACR,gBAAiB,CACf,CAAE,OAAQ,eAAgB,KAAM,oCAAqC,UAAW,MAAO,EACvF,CAAE,OAAQ,aAAc,KAAM,kCAAmC,UAAW,MAAO,CACrF,EACA,OAAQ,QACR,QAAS,UACT,UAAW,KACb,EAEA,MAAaC,EAAgC,gBAAU,SAAS,WAAW,EAAa,CACtF,OAAOnD,EAAaoD,EAAG,WAAY,CAAC,2HAA4H,CAACnD,EAAQC,EAAuBC,EAAUC,EAAU,KAAMC,EAAWC,EAASC,EAAYC,EAAUC,EAAeC,CAAoB,CAAC,CAAC,CAC3S,CAAC,EAED,MAAa2C,EAA+B,gBAAU,SAAS,UAAU,EAAa,CACpF,OAAOrD,EAAaoD,EAAG,WAAY,CAAC,0HAA2H,CAACnD,EAAQU,EAAiBR,EAAUC,EAAU,KAAMC,EAAWC,EAASC,EAAYC,EAAUC,EAAeC,CAAoB,CAAC,CAAC,CACpS,CAAC,EAED,M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,EAAE,MAAM,GAAG,SAAS,CAAC;IACvB,sEAAsE;IACtE,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AACD,+BAA+B;AAC/B,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC,CAAC;AAC/C,kEAAkE;AAClE,MAAM,WAAW,IAAI;IACnB,+BAA+B;IAC/B,IAAI,EAAE,YAAY,CAAC;CACpB;AACD,MAAM,MAAM,qBAAqB,GAAG,YAAY,CAAC;AACjD,6GAA6G;AAC7G,eAAO,MAAM,gBAAgB,EAAE,GAAG,CAAC,eAAe,CAChD,uBAAuB,EACvB,IAAI,EACJ,qBAAqB,EACrB,cAAc,CAUb,CAAC"}
|
package/lib/services/auth.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Hc as e,Jc as t,Kc as n,Lc as r,Pc as i,Rc as a,Wc as o,Xc as s,a as c,b as l,errors$SteelServiceErrors as u,l as d,n as f,protocol$SteelProtocol as p,retry$Retry as m,traits$Http as h,wc as g}from"../_bundle/sdk.js";const _={system:`steel-api`,responseHeaders:[{header:`x-request-id`,name:`http.response.header.x-request-id`,transform:`list`},{header:`request-id`,name:`http.response.header.request-id`,transform:`list`}],prefix:`Steel`,service:`Auth`,propagate:`w3c`};const v=/*@__PURE__*/ f(f=>f===c?d(`GetWellKnownJwks`,`{input:#1,output:#4,errors:[],serviceErrors:$10,protocol:$11,retry:$12,telemetry:$13,span:"%"};$3(>5)@"%Request";$3(>6)@"JwksKeysItem";$9(#2);$3(>7)@"Jwks";$2({}).pipe($1({method:"GET",uri:"/.well-known/jwks.json",code:200}));$8($2({alg:$5($4),e:$5($4),kid:$5($4),kty:$5($4),n:$5($4),use:$5($4)}),[$7($4,$6)]);$2({keys:#3})`,[a,h,n,s,t,o,i,e,r,g,u,p,m,_]):l(v,f));export{v as getWellKnownJwks};
|
|
2
2
|
//# sourceMappingURL=auth.js.map
|
package/lib/services/auth.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","names":["API.D","API.named","__L.at","T.Http","S.Struct","S.suspend","S.String","S.optional","S.Unknown","S.Record","S.StructWithRest","S.Array","Retry.Retry","API.call","
|
|
1
|
+
{"version":3,"file":"auth.js","names":["API.D","API.named","__L.at","T.Http","S.Struct","S.suspend","S.String","S.optional","S.Unknown","S.Record","S.StructWithRest","S.Array","Retry.Retry","API.call","Record","String","Struct","StructWithRest","Unknown","at","optional","suspend","D","call","SteelServiceErrors","named","op","SteelProtocol","Retry","Http","Array","TELEMETRY","getWellKnownJwks","i"],"sources":["../../src/services/auth.ts"],"mappings":"gOAYA,MAAM+B,EAAY,CAChB,OAAQ,YACR,gBAAiB,CACf,CAAE,OAAQ,eAAgB,KAAM,oCAAqC,UAAW,MAAO,EACvF,CAAE,OAAQ,aAAc,KAAM,kCAAmC,UAAW,MAAO,CACrF,EACA,OAAQ,QACR,QAAS,OACT,UAAW,KACb,EA4BA,MAAaC,EAKK,gBAAQ,GAAgBC,IAAMjC,EAAQC,EAAU,mBAAoB,sUAAuU,CAACC,EAAQC,EAAQC,EAAUC,EAAWC,EAAUC,EAAYC,EAAWC,EAAUC,EAAkBC,EAASa,EAAoBG,EAAef,EAAamB,CAAS,CAAC,EAAIlB,EAASmB,EAAkBC,CAAC,CAAC"}
|
|
@@ -5,22 +5,28 @@ export type { SteelOpError, SteelOpContext };
|
|
|
5
5
|
declare const BadRequest_base: S.TaggedErrorClass<"BadRequest", {
|
|
6
6
|
readonly code: any;
|
|
7
7
|
readonly message: any;
|
|
8
|
+
readonly body: any;
|
|
9
|
+
readonly headers: any;
|
|
8
10
|
}> & (new (...args: any[]) => {
|
|
9
11
|
"@distilled.cloud/error/categories": {
|
|
10
12
|
BadRequestError: true;
|
|
11
13
|
};
|
|
12
14
|
});
|
|
13
15
|
export declare class BadRequest extends /*@__PURE__*/ BadRequest_base {
|
|
16
|
+
readonly body?: ErrorResponse | string;
|
|
14
17
|
}
|
|
15
18
|
declare const UnprocessableEntity_base: S.TaggedErrorClass<"UnprocessableEntity", {
|
|
16
19
|
readonly code: any;
|
|
17
20
|
readonly message: any;
|
|
21
|
+
readonly body: any;
|
|
22
|
+
readonly headers: any;
|
|
18
23
|
}> & (new (...args: any[]) => {
|
|
19
24
|
"@distilled.cloud/error/categories": {
|
|
20
25
|
BadRequestError: true;
|
|
21
26
|
};
|
|
22
27
|
});
|
|
23
28
|
export declare class UnprocessableEntity extends /*@__PURE__*/ UnprocessableEntity_base {
|
|
29
|
+
readonly body?: ErrorResponse | string;
|
|
24
30
|
}
|
|
25
31
|
export interface PdfRequest {
|
|
26
32
|
/** Delay before generating the PDF (in milliseconds) */
|
|
@@ -154,6 +160,35 @@ export interface ScreenshotResponse {
|
|
|
154
160
|
/** URL where the screenshot is hosted */
|
|
155
161
|
url: string;
|
|
156
162
|
}
|
|
163
|
+
export interface ErrorResponseContextItem {
|
|
164
|
+
keyword: string;
|
|
165
|
+
message: string;
|
|
166
|
+
params: unknown;
|
|
167
|
+
}
|
|
168
|
+
export type ErrorResponseContextList = Array<ErrorResponseContextItem>;
|
|
169
|
+
/** Structured data about the error for the caller, e.g. `candidates` for credential_ambiguous. Never contains secret values. */
|
|
170
|
+
export type ErrorResponseDetailsMap = {
|
|
171
|
+
[key: string]: unknown | undefined;
|
|
172
|
+
};
|
|
173
|
+
/** An error response from the API */
|
|
174
|
+
export interface ErrorResponse {
|
|
175
|
+
/** Stable machine-readable reason, e.g. 'budget_exceeded' or 'profile_not_ready'. Branch on this instead of parsing the message. */
|
|
176
|
+
code?: string | undefined;
|
|
177
|
+
context?: ErrorResponseContextList | undefined;
|
|
178
|
+
/** Structured data about the error for the caller, e.g. `candidates` for credential_ambiguous. Never contains secret values. */
|
|
179
|
+
details?: ErrorResponseDetailsMap | undefined;
|
|
180
|
+
error?: string | undefined;
|
|
181
|
+
linkToDocs?: string | undefined;
|
|
182
|
+
message: string;
|
|
183
|
+
/** The request field that caused the error, if any. */
|
|
184
|
+
param?: string | undefined;
|
|
185
|
+
/** Seconds to wait before retrying. Also sent as the Retry-After header. */
|
|
186
|
+
retryAfterSeconds?: number | undefined;
|
|
187
|
+
/** Whether the same request can succeed later without changes. False means fix the request or the account first. */
|
|
188
|
+
retryable?: boolean | undefined;
|
|
189
|
+
/** Where a person turns on the refused feature, e.g. verifying the account. Pass it to your user. */
|
|
190
|
+
unlockUrl?: string | undefined;
|
|
191
|
+
}
|
|
157
192
|
export type PdfError = BadRequest | UnprocessableEntity | SteelOpError;
|
|
158
193
|
/** Convert webpage to PDF Generates a PDF from a specified webpage. */
|
|
159
194
|
export declare const pdf: API.OperationMethod<PdfRequest, PdfResponse, PdfError, SteelOpContext>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser_tools.d.ts","
|
|
1
|
+
{"version":3,"file":"browser_tools.d.ts","sources":["../../src/services/browser_tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,2BAA2B,CAAC;AAGjD,OAAO,KAAK,CAAC,MAAM,mCAAmC,CAAC;AAGvD,OAAO,EAAiB,KAAK,YAAY,EAAE,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAMvF,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,CAAC;;;;;;;;;;;AAc7C,qBAAa,UACX,SAAQ,aAAa,CAAC,eAUrB;IAED,SAAiB,IAAI,CAAC,EAAE,aAAa,GAAG,MAAM,CAAC;CAChD;;;;;;;;;;;AAED,qBAAa,mBACX,SAAQ,aAAa,CAAC,wBAUrB;IAED,SAAiB,IAAI,CAAC,EAAE,aAAa,GAAG,MAAM,CAAC;CAChD;AAED,MAAM,WAAW,UAAU;IACzB,wDAAwD;IACxD,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,gDAAgD;IAChD,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC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ACb,cAAc,EACd,WAAW,EACX,cAAc,CAUb,CAAC;AAEJ,MAAM,MAAM,eAAe,GAAG,UAAU,GAAG,mBAAmB,GAAG,YAAY,CAAC;AAC9E,+EAA+E;AAC/E,eAAO,MAAM,UAAU,EAAE,GAAG,CAAC,eAAe,CAC1C,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,cAAc,CAUb,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Gc as e,Hc as t,Jc as n,Kc as r,Mc as i,Oc as a,Pc as o,Rc as s,Wc as c,Xc as l,a as u,b as d,errors$SteelServiceErrors as f,f as p,l as m,m as h,n as g,protocol$SteelProtocol as _,retry$Retry as v,traits$Http as y,traits$applyErrorMatchers as b,wc as x,xc as S,za as C}from"../_bundle/sdk.js";const w={system:`steel-api`,responseHeaders:[{header:`x-request-id`,name:`http.response.header.x-request-id`,transform:`list`},{header:`request-id`,name:`http.response.header.request-id`,transform:`list`}],prefix:`Steel`,service:`BrowserTools`,propagate:`w3c`};const T=/*@__PURE__*/ p(function BadRequest(r){return h(r,new.target,[`$10($9()("BadRequest",{code:$2,message:$3,body:$7($6([$5(>1),$3])),headers:$7($8($3,$3))}).pipe($1),[{status:400}]);#4:2`,[s,C,e,n,__d1,l,a,c,t,i,b]])});const E=/*@__PURE__*/ p(function UnprocessableEntity(r){return h(r,new.target,[`$10($9()("UnprocessableEntity",{code:$2,message:$3,body:$7($6([$5(>1),$3])),headers:$7($8($3,$3))}).pipe($1),[{status:422}]);#4:2`,[s,C,e,n,__d1,l,a,c,t,i,b]])});const D=/*@__PURE__*/ g(t=>t===u?[`{input:#1,output:#9:0,errors:[$10,$11],serviceErrors:$12,protocol:$13,retry:$14,telemetry:$15,span:"Pdf"};$8(>2)@"PdfRequest";$7({delay:$3($2),projectId:$3($4),region:$3($5),url:$4,useProxy:$3($6)}).pipe($1({method:"POST",uri:"/v1/pdf",code:200}))`,[s,y,e,c,n,o,S,r,l,__d2,T,E,f,_,v,w]]:d(D,t));const O=/*@__PURE__*/ g(t=>t===u?m(`ScrapeResponse`,`{input:#2,output:#7,errors:[$12,$13],serviceErrors:$14,protocol:$15,retry:$16,telemetry:$17,span:"Scrape"};$2($1);$9(>8)@"ScrapeRequest";$9(>9)@"%Content";$9(>10)@"%LinksItem";$2(#4);$9(>11)@"%Metadata";$9(>12)@"%";$8({delay:$5($4),format:$5(#1),pdf:$5($6),projectId:$5($1),region:$5($7),screenshot:$5($6),url:$1,useProxy:$5($6)}).pipe($3({method:"POST",uri:"/v1/scrape",code:200}));$8({cleaned_html:$5($1),html:$5($1),markdown:$5($1),readability:$5(#10:0)});$8({text:$1,url:$1});$8({articleAuthor:$5($1),author:$5($1),canonical:$5($1),description:$5($1),favicon:$5($1),jsonLd:$5($7),keywords:$5($1),language:$5($1),modifiedTime:$5($1),ogDescription:$5($1),ogImage:$5($1),ogSiteName:$5($1),ogTitle:$5($1),ogUrl:$5($1),publishedTime:$5($1),statusCode:$4,timestamp:$5($1),title:$5($1),urlSource:$5($1)});$8({content:#3,links:#5,metadata:#6,pdf:$5(#11:0),screenshot:$5(#11:0)})`,[s,n,x,y,e,c,S,o,r,l,__d0,__d2,T,E,f,_,v,w]):d(O,t));const k=/*@__PURE__*/ g(t=>t===u?m(`Screenshot`,`{input:#1,output:#9:0,errors:[$10,$11],serviceErrors:$12,protocol:$13,retry:$14,telemetry:$15,span:"%"};$8(>2)@"%Request";$7({delay:$3($2),fullPage:$3($4),projectId:$3($5),region:$3($6),url:$5,useProxy:$3($4)}).pipe($1({method:"POST",uri:"/v1/screenshot",code:200}))`,[s,y,e,c,S,n,o,r,l,__d2,T,E,f,_,v,w]):d(k,t));function __d0(){return[`$3($1,$2)`,[s,n,o,t]]}function __d1(){return[`$4(>3)@"ErrorResponseContextItem";$5(#0);$4(>4)@"ErrorResponse";$3({keyword:$1,message:$1,params:$2});$3({code:$6($1),context:$6(#1),details:$6(#7:0),error:$6($1),linkToDocs:$6($1),message:$1,param:$6($1),retryAfterSeconds:$6($8),retryable:$6($9),unlockUrl:$6($1)})`,[s,n,o,r,l,x,c,__d0,e,S]]}function __d2(){return[`$3(>1)@"PdfResponse";$2({url:$1})`,[s,n,r,l]]}export{T as BadRequest,E as UnprocessableEntity,D as pdf,O as scrape,k as screenshot};
|
|
2
2
|
//# sourceMappingURL=browser_tools.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser_tools.js","names":["API.newError","__L.at","C.withBadRequestError","S.Number","S.String","S.TaggedError","T.applyErrorMatchers","API.D","T.Http","S.
|
|
1
|
+
{"version":3,"file":"browser_tools.js","names":["API.newError","__L.at","C.withBadRequestError","S.Number","S.String","S.suspend","S.Union","S.optional","S.Record","S.TaggedError","T.applyErrorMatchers","API.D","T.Http","S.Unknown","S.Boolean","S.Struct","Retry.Retry","API.call","API.named","S.Array","Number","Record","String","Struct","TaggedError","Union","Unknown","at","optional","suspend","D","call","SteelServiceErrors","error","named","newError","op","SteelProtocol","Retry","Http","applyErrorMatchers","Array","Boolean","withBadRequestError","TELEMETRY","BadRequest","i","UnprocessableEntity","pdf","scrape","screenshot"],"sources":["../../src/services/browser_tools.ts"],"mappings":"6SAaA,MAAM4C,EAAY,CAChB,OAAQ,YACR,gBAAiB,CACf,CAAE,OAAQ,eAAgB,KAAM,oCAAqC,UAAW,MAAO,EACvF,CAAE,OAAQ,aAAc,KAAM,kCAAmC,UAAW,MAAO,CACrF,EACA,OAAQ,QACR,QAAS,eACT,UAAW,KACb,EAEA,MAAaC,EAAgC,gBAAU,SAAS,WAAW,EAAa,CACtF,OAAO7C,EAAa8C,EAAG,WAAY,CAAC,2HAA4H,CAAC7C,EAAQC,EAAuBC,EAAUC,EAAU,KAAMC,EAAWC,EAASC,EAAYC,EAAUC,EAAeC,CAAoB,CAAC,CAAC,CAC3S,CAAC,EAED,MAAaqC,EAAyC,gBAAU,SAAS,oBAAoB,EAAa,CACxG,OAAO/C,EAAa8C,EAAG,WAAY,CAA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