@distilled.cloud/vanta 1.0.0-rc.15 → 1.0.0-rc.17

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.
Files changed (64) hide show
  1. package/lib/.lazy.json +1 -0
  2. package/lib/_bundle/lazy.js +4 -0
  3. package/lib/_bundle/sdk.js +2 -0
  4. package/lib/_bundle/sdk.js.map +1 -0
  5. package/lib/credentials.d.ts +2 -2
  6. package/lib/credentials.d.ts.map +1 -1
  7. package/lib/credentials.js +1 -39
  8. package/lib/errors.d.ts +15 -15
  9. package/lib/errors.d.ts.map +1 -1
  10. package/lib/errors.js +1 -26
  11. package/lib/index.d.ts +1 -1
  12. package/lib/index.js +0 -15
  13. package/lib/index.lazy.js +7 -0
  14. package/lib/pagination.d.ts +1 -1
  15. package/lib/pagination.js +1 -8
  16. package/lib/protocol.d.ts.map +1 -1
  17. package/lib/protocol.js +1 -41
  18. package/lib/retry.d.ts +1 -1
  19. package/lib/retry.d.ts.map +1 -1
  20. package/lib/retry.js +1 -32
  21. package/lib/services/auditor_api.d.ts +18 -325
  22. package/lib/services/auditor_api.d.ts.map +1 -1
  23. package/lib/services/auditor_api.js +71 -1887
  24. package/lib/services/auditor_api.js.map +1 -1
  25. package/lib/services/build_integrations.d.ts +1 -230
  26. package/lib/services/build_integrations.d.ts.map +1 -1
  27. package/lib/services/build_integrations.js +47 -1185
  28. package/lib/services/build_integrations.js.map +1 -1
  29. package/lib/services/index.js +0 -2
  30. package/lib/services/manage_vanta.d.ts +18 -1088
  31. package/lib/services/manage_vanta.d.ts.map +1 -1
  32. package/lib/services/manage_vanta.js +332 -6930
  33. package/lib/services/manage_vanta.js.map +1 -1
  34. package/lib/services/webhooks.d.ts +6 -105
  35. package/lib/services/webhooks.d.ts.map +1 -1
  36. package/lib/services/webhooks.js +35 -542
  37. package/lib/services/webhooks.js.map +1 -1
  38. package/lib/services.lazy/auditor_api.js +3 -0
  39. package/lib/services.lazy/build_integrations.js +3 -0
  40. package/lib/services.lazy/index.js +3 -0
  41. package/lib/services.lazy/manage_vanta.js +3 -0
  42. package/lib/services.lazy/webhooks.js +3 -0
  43. package/lib/traits.d.ts +1 -1
  44. package/lib/traits.js +1 -11
  45. package/package.json +9 -7
  46. package/src/credentials.ts +5 -6
  47. package/src/errors.ts +14 -15
  48. package/src/index.ts +1 -1
  49. package/src/pagination.ts +1 -1
  50. package/src/protocol.ts +6 -9
  51. package/src/retry.ts +6 -4
  52. package/src/services/auditor_api.ts +2040 -2476
  53. package/src/services/build_integrations.ts +937 -1664
  54. package/src/services/manage_vanta.ts +7230 -8522
  55. package/src/services/webhooks.ts +432 -638
  56. package/src/traits.ts +1 -1
  57. package/lib/credentials.js.map +0 -1
  58. package/lib/errors.js.map +0 -1
  59. package/lib/pagination.js.map +0 -1
  60. package/lib/protocol.js.map +0 -1
  61. package/lib/retry.js.map +0 -1
  62. package/lib/services/index.js.map +0 -1
  63. package/lib/traits.js.map +0 -1
  64. /package/lib/{index.js.map → index.lazy.js.map} +0 -0
package/lib/.lazy.json ADDED
@@ -0,0 +1 @@
1
+ {"serviceDirs":["services"],"twins":["index.js"]}
@@ -0,0 +1,4 @@
1
+ import*as $0 from"./sdk.js";
2
+ import{api$lazyService as L}from"@distilled.cloud/core/_bundle/base";
3
+ const u=import.meta.url,N=[$0];
4
+ export const $L=(s,k,a,l,x)=>L(u,s,k,a===void 0?void 0:x?N.concat(x):N,a,l);
@@ -0,0 +1,2 @@
1
+ import{errors$API_ERRORS as e,errors$BadGateway as t,errors$BadRequest as n,errors$ConfigError as r,errors$Conflict as i,errors$DEFAULT_ERRORS as a,errors$Forbidden as o,errors$GatewayTimeout as ee,errors$HTTP_STATUS_MAP as te,errors$InternalServerError as ne,errors$Locked as re,errors$NotFound as ie,errors$ServiceUnavailable as s,errors$TooManyRequests as c,errors$Unauthorized as l,errors$UnprocessableEntity as u,protocol_rest$RawResponse as d,protocol_rest$RawResponseRoot as f,protocol_rest$SensitiveValue as p,protocol_rest$makeRestProtocol as m,protocol_rest$rawResponseRootSymbol as h,protocol_rest$rawResponseSymbol as g,protocol_rest$sensitiveValueSymbol as _,schema_lite$Array as v,schema_lite$Boolean as y,schema_lite$NullOr as b,schema_lite$Number as x,schema_lite$Record as S,schema_lite$String as C,schema_lite$Struct as w,schema_lite$Unknown as T,schema_lite$at as E,schema_lite$optional as D,schema_lite$suspend as O}from"@distilled.cloud/core/_bundle/rest";import{api$D as k,api$call as A,api$named as j,api$op as M,category$withParseError as N,category$withServerError as P,retry$capped as F,retry$jittered as I,retry$makeDefault as L,retry$throttlingFactory as R,retry$throttlingOptions as z,retry$transientFactory as B,retry$transientOptions as V,trait$Body as H,trait$FormDataFile as ae,trait$Header as U,trait$Http as W,trait$HttpBody as G,trait$KeyDictionary as K,trait$Label as q,trait$Query as J,trait$ResponseCode as oe,trait$UnionCases as se,trait$applyErrorMatchers as ce,trait$bodySymbol as le,trait$errorMatchersSymbol as ue,trait$formDataFileSymbol as de,trait$getErrorMatchers as fe,trait$headerSymbol as pe,trait$httpBodySymbol as me,trait$httpSymbol as he,trait$keyDictionarySymbol as ge,trait$labelSymbol as _e,trait$querySymbol as ve,trait$responseCodeSymbol as ye,trait$unionCasesSymbol as be}from"@distilled.cloud/core/_bundle/base";import*as Y from"effect/Context";import*as X from"effect/Effect";import*as Z from"effect/Layer";import*as Q from"effect/Redacted";import*as $ from"@distilled.cloud/core/schema-lite-typed";const xe=`https://api.vanta.com`;const Se=`https://api.vanta-gov.com`;var Credentials=class extends (/*@__PURE__*/ Y.Service()(`VantaCredentials`)){};const fromApiKey=e=>Z.succeed(Credentials,X.succeed({apiKey:e.apiKey,apiBaseUrl:e.apiBaseUrl??`https://api.vanta.com`}));const Ce=/*@__PURE__*/ Z.succeed(Credentials,/*@__PURE__*/ X.gen(function*(){const e=process.env.VANTA_ACCESS_TOKEN;if(!e)return yield*new r({message:`VANTA_ACCESS_TOKEN environment variable is required`});return{apiKey:Q.make(e),apiBaseUrl:process.env.VANTA_API_BASE_URL??`https://api.vanta.com`}}).pipe(X.orDie));var UnknownVantaError=class extends (/*@__PURE__*/ $.TaggedError()(`UnknownVantaError`,{code:/*@__PURE__*/ $.optional($.String),message:/*@__PURE__*/ $.optional($.String),body:$.Unknown}).pipe(P)){};var VantaParseError=class extends (/*@__PURE__*/ $.TaggedError()(`VantaParseError`,{body:$.Unknown,cause:$.Unknown}).pipe(N)){};const we=/*@__PURE__*/ m({credentials:/*@__PURE__*/ X.flatMap(Credentials,e=>e),baseUrl:e=>e.apiBaseUrl,headers:e=>({Authorization:`Bearer ${Q.value(e.apiKey)}`}),unknownError:({code:e,message:t,body:n})=>new UnknownVantaError({code:typeof e===`string`?e:e!==void 0?String(e):void 0,message:t,body:n}),parseError:({body:e,cause:t})=>new VantaParseError({body:e,cause:t})});var Retry=class extends (/*@__PURE__*/ Y.Service()(`VantaRetry`)){};const policy=e=>X.provide(Z.succeed(Retry,e));const Te=/*@__PURE__*/ X.provide(/*@__PURE__*/ Z.succeed(Retry,{while:()=>false}));const Ee=/*@__PURE__*/ policy(R);const De=/*@__PURE__*/ policy(B);export{S as a,T as c,Credentials as credentials$Credentials,Ce as credentials$CredentialsFromEnv,xe as credentials$DEFAULT_API_BASE_URL,Se as credentials$GOV_API_BASE_URL,fromApiKey as credentials$fromApiKey,O as d,e as errors$API_ERRORS,t as errors$BadGateway,n as errors$BadRequest,r as errors$ConfigError,i as errors$Conflict,a as errors$DEFAULT_ERRORS,o as errors$Forbidden,ee as errors$GatewayTimeout,te as errors$HTTP_STATUS_MAP,ne as errors$InternalServerError,re as errors$Locked,ie as errors$NotFound,s as errors$ServiceUnavailable,c as errors$TooManyRequests,l as errors$Unauthorized,UnknownVantaError as errors$UnknownVantaError,u as errors$UnprocessableEntity,VantaParseError as errors$VantaParseError,k as f,M as h,x as i,E as l,j as m,y as n,C as o,A as p,we as protocol$VantaProtocol,b as r,Retry as retry$Retry,F as retry$capped,I as retry$jittered,L as retry$makeDefault,Te as retry$none,policy as retry$policy,Ee as retry$throttling,R as retry$throttlingFactory,z as retry$throttlingOptions,De as retry$transient,B as retry$transientFactory,V as retry$transientOptions,w as s,v as t,H as traits$Body,ae as traits$FormDataFile,U as traits$Header,W as traits$Http,G as traits$HttpBody,K as traits$KeyDictionary,q as traits$Label,J as traits$Query,d as traits$RawResponse,f as traits$RawResponseRoot,oe as traits$ResponseCode,p as traits$SensitiveValue,se as traits$UnionCases,ce as traits$applyErrorMatchers,le as traits$bodySymbol,ue as traits$errorMatchersSymbol,de as traits$formDataFileSymbol,fe as traits$getErrorMatchers,pe as traits$headerSymbol,me as traits$httpBodySymbol,he as traits$httpSymbol,ge as traits$keyDictionarySymbol,_e as traits$labelSymbol,ve as traits$querySymbol,h as traits$rawResponseRootSymbol,g as traits$rawResponseSymbol,ye as traits$responseCodeSymbol,_ as traits$sensitiveValueSymbol,be as traits$unionCasesSymbol,D as u};
2
+ //# sourceMappingURL=sdk.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sdk.js","names":["Category.withServerError","Category.withParseError","API_ERRORS","BadGateway","BadRequest","ConfigError","Conflict","DEFAULT_ERRORS","Forbidden","GatewayTimeout","HTTP_STATUS_MAP","InternalServerError","Locked","NotFound","ServiceUnavailable","TooManyRequests","Unauthorized","UnprocessableEntity","RawResponse","RawResponseRoot","SensitiveValue","makeRestProtocol","rawResponseRootSymbol","rawResponseSymbol","sensitiveValueSymbol","Array","Boolean","NullOr","Number","Record","String$1","Struct","Unknown","at","optional","suspend","D","call","named","op","withParseError","withServerError","capped","jittered","makeDefault","throttlingFactory","throttlingOptions","transientFactory","transientOptions","Body","FormDataFile","Header","Http","HttpBody","KeyDictionary","Label","Query","ResponseCode","UnionCases","applyErrorMatchers","bodySymbol","errorMatchersSymbol","formDataFileSymbol","getErrorMatchers","headerSymbol","httpBodySymbol","httpSymbol","keyDictionarySymbol","labelSymbol","querySymbol","responseCodeSymbol","unionCasesSymbol","Context","Effect","Layer","Redacted","Schema","DEFAULT_API_BASE_URL","GOV_API_BASE_URL","config","CredentialsFromEnv","apiKey","VantaProtocol","resolve","creds","code","optionsOrFactory","none","throttling","transient"],"sources":["../../src/credentials.ts","../../src/errors.ts","../../src/protocol.ts","../../src/retry.ts"],"mappings":"8gEAgBA,MAAa6E,GAAuB,wBAGpC,MAAaC,GAAmB,4BAOhC,IAAa,YAAb,eACwB,gBAAQ,QAA4C,CAAC,CAAC,kBAAkB,EAAA,AAAE,CAAC,EAGnG,MAAa,WAAc,GAIzBJ,EAAM,QACJ,YACAD,EAAO,QAAQ,CACb,OAAQM,EAAO,OACf,WAAYA,EAAO,YAAA,uBACrB,CAAC,CACH,EAGF,MAAaC,GAA6D,gBAAM,QAC9E,YACc,gBAAO,IAAI,WAAa,CACpC,MAAMC,EAAS,QAAQ,IAAI,mBAE3B,GAAI,CAACA,EACH,OAAO,MAAO,IAAI5E,EAAY,CAC5B,QAAS,qDACX,CAAC,EAGH,MAAO,CACL,OAAQsE,EAAS,KAAKM,CAAM,EAC5B,WAAY,QAAQ,IAAI,oBAAA,uBAC1B,CACF,CAAC,CAAC,CAAC,KAAKR,EAAO,KAAK,CACtB,EC1BA,IAAa,kBAAb,eACwB,gBAAO,YAA+B,CAAC,CAAC,oBAAqB,CACjF,KAAoB,gBAAO,SAASG,EAAO,MAAM,EACjD,QAAuB,gBAAO,SAASA,EAAO,MAAM,EACpD,KAAMA,EAAO,OACf,CAAC,CAAC,CAAC,KAAK5E,CAAwB,EAAA,AAAE,CAAC,EAGrC,IAAa,gBAAb,eACwB,gBAAO,YAA6B,CAAC,CAAC,kBAAmB,CAC7E,KAAM4E,EAAO,QACb,MAAOA,EAAO,OAChB,CAAC,CAAC,CAAC,KAAK3E,CAAuB,EAAA,AAAE,CAAC,ECHpC,MAAaiF,GAAyD,gBAAyB,CAG7F,YAA2B,gBAAO,QAAQ,YAAc,GAAYC,CAAO,EAC3E,QAAU,GAAUC,EAAM,WAC1B,QAAU,IAAW,CACnB,cAAe,UAAUT,EAAS,MAAMS,EAAM,MAAM,GACtD,GAGA,cAAe,CAAE,OAAM,UAAS,UAC9B,IAAI,kBAAkB,CACpB,KAAM,OAAOC,IAAS,SAAWA,EAAOA,IAAS,IAAA,GAAY,OAAOA,CAAI,EAAI,IAAA,GAC5E,UACA,MACF,CAAC,EACH,YAAa,CAAE,OAAM,WAAY,IAAI,gBAAgB,CAAE,OAAM,OAAM,CAAC,CACtE,CAAC,ECzBD,IAAa,MAAb,eAAyC,gBAAQ,QAAuB,CAAC,CAAC,YAAY,EAAA,AAAE,CAAC,EAGzF,MAAa,OAAU,GACrBZ,EAAO,QAAQC,EAAM,QAAQ,MAAOY,CAAgB,CAAC,EAGvD,MAAaC,GAAqB,gBAAO,QACzB,gBAAM,QAAQ,MAAO,CAAE,UAAa,KAAM,CAAC,CAC3D,EAGA,MAAaC,GAA2B,qBAAO3C,CAAiB,EAGhE,MAAa4C,GAA0B,qBAAO1C,CAAgB"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Vanta credentials — hand-written.
2
+ * Vanta credentials -- hand-written.
3
3
  *
4
4
  * The `Credentials` service holds an *effect* that resolves the current
5
5
  * credentials on every request (the protocol layer resolves it per request
@@ -20,7 +20,7 @@ export interface Config {
20
20
  readonly apiBaseUrl: string;
21
21
  }
22
22
  declare const Credentials_base: Context.ServiceClass<Credentials, "VantaCredentials", Effect.Effect<Config, never, never>>;
23
- export declare class Credentials extends Credentials_base {
23
+ export declare class Credentials extends /*@__PURE__*/ Credentials_base {
24
24
  }
25
25
  /** Layer from a redacted access token + optional base URL. */
26
26
  export declare const fromApiKey: (config: {
@@ -1 +1 @@
1
- {"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"AACA;;;;;;;;GAQG;AACH,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,6EAA6E;AAC7E,eAAO,MAAM,oBAAoB,0BAA0B,CAAC;AAE5D,oCAAoC;AACpC,eAAO,MAAM,gBAAgB,8BAA8B,CAAC;AAE5D,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC3C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;;AAED,qBAAa,WAAY,SAAQ,gBAEhC;CAAG;AAEJ,8DAA8D;AAC9D,eAAO,MAAM,UAAU,WAAY;IACjC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC3C,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B,KAAG,KAAK,CAAC,KAAK,CAAC,WAAW,CAOxB,CAAC;AAEJ,6EAA6E;AAC7E,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,CAgBvD,CAAC"}
1
+ {"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"AACA;;;;;;;;GAQG;AACH,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,6EAA6E;AAC7E,eAAO,MAAM,oBAAoB,0BAA0B,CAAC;AAE5D,oCAAoC;AACpC,eAAO,MAAM,gBAAgB,8BAA8B,CAAC;AAE5D,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC3C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;;AAED,qBAAa,WACX,SAAQ,aAAa,CAAC,gBAAyE;CAAG;AAEpG,8DAA8D;AAC9D,eAAO,MAAM,UAAU,WAAY;IACjC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC3C,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B,KAAG,KAAK,CAAC,KAAK,CAAC,WAAW,CAOxB,CAAC;AAEJ,6EAA6E;AAC7E,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,CAgBvD,CAAC"}
@@ -1,39 +1 @@
1
- import { ConfigError } from "@distilled.cloud/core/errors";
2
- /**
3
- * Vanta credentials — hand-written.
4
- *
5
- * The `Credentials` service holds an *effect* that resolves the current
6
- * credentials on every request (the protocol layer resolves it per request
7
- * on the calling fiber). Vanta authenticates with OAuth 2.0 bearer tokens:
8
- * callers hand an already-fetched access token; the protocol sends it as
9
- * `Authorization: Bearer <token>`.
10
- */
11
- import * as Context from "effect/Context";
12
- import * as Effect from "effect/Effect";
13
- import * as Layer from "effect/Layer";
14
- import * as Redacted from "effect/Redacted";
15
- /** Vanta commercial API root. Use {@link GOV_API_BASE_URL} for Vanta Gov. */
16
- export const DEFAULT_API_BASE_URL = "https://api.vanta.com";
17
- /** Vanta Gov (FedRAMP) API root. */
18
- export const GOV_API_BASE_URL = "https://api.vanta-gov.com";
19
- export class Credentials extends Context.Service()("VantaCredentials") {
20
- }
21
- /** Layer from a redacted access token + optional base URL. */
22
- export const fromApiKey = (config) => Layer.succeed(Credentials, Effect.succeed({
23
- apiKey: config.apiKey,
24
- apiBaseUrl: config.apiBaseUrl ?? DEFAULT_API_BASE_URL,
25
- }));
26
- /** Reads VANTA_ACCESS_TOKEN (required) and VANTA_API_BASE_URL (optional). */
27
- export const CredentialsFromEnv = Layer.succeed(Credentials, Effect.gen(function* () {
28
- const apiKey = process.env.VANTA_ACCESS_TOKEN;
29
- if (!apiKey) {
30
- return yield* new ConfigError({
31
- message: "VANTA_ACCESS_TOKEN environment variable is required",
32
- });
33
- }
34
- return {
35
- apiKey: Redacted.make(apiKey),
36
- apiBaseUrl: process.env.VANTA_API_BASE_URL ?? DEFAULT_API_BASE_URL,
37
- };
38
- }).pipe(Effect.orDie));
39
- //# sourceMappingURL=credentials.js.map
1
+ export { credentials$Credentials as Credentials, credentials$CredentialsFromEnv as CredentialsFromEnv, credentials$DEFAULT_API_BASE_URL as DEFAULT_API_BASE_URL, credentials$GOV_API_BASE_URL as GOV_API_BASE_URL, credentials$fromApiKey as fromApiKey } from "./_bundle/sdk.js";
package/lib/errors.d.ts CHANGED
@@ -3,34 +3,34 @@
3
3
  *
4
4
  * Re-exports the common HTTP errors from core and adds the Vanta fallback
5
5
  * errors. Note the generated service modules additionally define their own
6
- * per-status matcher classes (BadRequest/NotFound/…) for the statuses each
7
- * operation declares — those share `_tag`s with the core classes here, so
6
+ * per-status matcher classes (BadRequest/NotFound/...) for the statuses each
7
+ * operation declares -- those share `_tag`s with the core classes here, so
8
8
  * `catchTag` works against either.
9
9
  */
10
10
  export { BadGateway, BadRequest, Conflict, ConfigError, Forbidden, GatewayTimeout, InternalServerError, Locked, NotFound, ServiceUnavailable, TooManyRequests, Unauthorized, UnprocessableEntity, HTTP_STATUS_MAP, DEFAULT_ERRORS, API_ERRORS, } from "@distilled.cloud/core/errors";
11
11
  export type { DefaultErrors } from "@distilled.cloud/core/errors";
12
- import * as Schema from "effect/Schema";
13
- declare const UnknownVantaError_base: Schema.Class<UnknownVantaError, Schema.TaggedStruct<"UnknownVantaError", {
14
- readonly code: Schema.optional<Schema.String>;
15
- readonly message: Schema.optional<Schema.String>;
16
- readonly body: Schema.Unknown;
17
- }>, import("effect/Cause").YieldableError> & (new (...args: any[]) => {
12
+ import * as Schema from "@distilled.cloud/core/schema-lite-typed";
13
+ declare const UnknownVantaError_base: Schema.TaggedErrorClass<"UnknownVantaError", {
14
+ readonly code: import("effect/Schema").optional<import("effect/Schema").String>;
15
+ readonly message: import("effect/Schema").optional<import("effect/Schema").String>;
16
+ readonly body: import("effect/Schema").Unknown;
17
+ }> & (new (...args: any[]) => {
18
18
  "@distilled.cloud/error/categories": {
19
19
  ServerError: true;
20
20
  };
21
21
  });
22
- /** Unknown Vanta error — returned when nothing else matches the failure. */
23
- export declare class UnknownVantaError extends UnknownVantaError_base {
22
+ /** Unknown Vanta error -- returned when nothing else matches the failure. */
23
+ export declare class UnknownVantaError extends /*@__PURE__*/ UnknownVantaError_base {
24
24
  }
25
- declare const VantaParseError_base: Schema.Class<VantaParseError, Schema.TaggedStruct<"VantaParseError", {
26
- readonly body: Schema.Unknown;
27
- readonly cause: Schema.Unknown;
28
- }>, import("effect/Cause").YieldableError> & (new (...args: any[]) => {
25
+ declare const VantaParseError_base: Schema.TaggedErrorClass<"VantaParseError", {
26
+ readonly body: import("effect/Schema").Unknown;
27
+ readonly cause: import("effect/Schema").Unknown;
28
+ }> & (new (...args: any[]) => {
29
29
  "@distilled.cloud/error/categories": {
30
30
  ParseError: true;
31
31
  };
32
32
  });
33
33
  /** Schema parse error wrapper. */
34
- export declare class VantaParseError extends VantaParseError_base {
34
+ export declare class VantaParseError extends /*@__PURE__*/ VantaParseError_base {
35
35
  }
36
36
  //# sourceMappingURL=errors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;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,eAAe,CAAC;;;;;;;;;;AAExC,4EAA4E;AAC5E,qBAAa,iBAAkB,SAAQ,sBAOP;CAAG;;;;;;;;;AAEnC,kCAAkC;AAClC,qBAAa,eAAgB,SAAQ,oBAGL;CAAG"}
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;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,6EAA6E;AAC7E,qBAAa,iBACX,SAAQ,aAAa,CAAC,sBAIW;CAAG;;;;;;;;;AAEtC,kCAAkC;AAClC,qBAAa,eACX,SAAQ,aAAa,CAAC,oBAGU;CAAG"}
package/lib/errors.js CHANGED
@@ -1,26 +1 @@
1
- /**
2
- * Vanta-specific error types.
3
- *
4
- * Re-exports the common HTTP errors from core and adds the Vanta fallback
5
- * errors. Note the generated service modules additionally define their own
6
- * per-status matcher classes (BadRequest/NotFound/…) for the statuses each
7
- * operation declares — those share `_tag`s with the core classes here, so
8
- * `catchTag` works against either.
9
- */
10
- export { BadGateway, BadRequest, Conflict, ConfigError, Forbidden, GatewayTimeout, InternalServerError, Locked, NotFound, ServiceUnavailable, TooManyRequests, Unauthorized, UnprocessableEntity, HTTP_STATUS_MAP, DEFAULT_ERRORS, API_ERRORS, } from "@distilled.cloud/core/errors";
11
- import * as Category from "@distilled.cloud/core/category";
12
- import * as Schema from "effect/Schema";
13
- /** Unknown Vanta error — returned when nothing else matches the failure. */
14
- export class UnknownVantaError extends Schema.TaggedError()("UnknownVantaError", {
15
- code: Schema.optional(Schema.String),
16
- message: Schema.optional(Schema.String),
17
- body: Schema.Unknown,
18
- }).pipe(Category.withServerError) {
19
- }
20
- /** Schema parse error wrapper. */
21
- export class VantaParseError extends Schema.TaggedError()("VantaParseError", {
22
- body: Schema.Unknown,
23
- cause: Schema.Unknown,
24
- }).pipe(Category.withParseError) {
25
- }
26
- //# sourceMappingURL=errors.js.map
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$TooManyRequests as TooManyRequests, errors$Unauthorized as Unauthorized, errors$UnknownVantaError as UnknownVantaError, errors$UnprocessableEntity as UnprocessableEntity, errors$VantaParseError as VantaParseError } from "./_bundle/sdk.js";
package/lib/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @distilled.cloud/vanta — Vanta SDK for Effect.
2
+ * @distilled.cloud/vanta -- Vanta SDK for Effect.
3
3
  *
4
4
  * `./services` is generated by `scripts/generate.ts` from the Smithy models
5
5
  * in `.generated-specs` (written by `scripts/convert.ts` from the OpenAPI
package/lib/index.js CHANGED
@@ -1,17 +1,3 @@
1
- /**
2
- * @distilled.cloud/vanta — Vanta SDK for Effect.
3
- *
4
- * `./services` is generated by `scripts/generate.ts` from the Smithy models
5
- * in `.generated-specs` (written by `scripts/convert.ts` from the OpenAPI
6
- * specs). Everything else in this folder is hand-written.
7
- *
8
- * @example
9
- * ```ts
10
- * import * as Vanta from "@distilled.cloud/vanta";
11
- *
12
- * const frameworks = yield* Vanta.manageVanta.listComplianceFrameworks({});
13
- * ```
14
- */
15
1
  export * from "./credentials.js";
16
2
  export * from "./errors.js";
17
3
  export * as T from "./traits.js";
@@ -19,4 +5,3 @@ export { VantaProtocol } from "./protocol.js";
19
5
  export { paginateCursor } from "./pagination.js";
20
6
  export * as Retry from "./retry.js";
21
7
  export * from "./services/index.js";
22
- //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ export * from "./credentials.js";
2
+ export * from "./errors.js";
3
+ export * as T from "./traits.js";
4
+ export { VantaProtocol } from "./protocol.js";
5
+ export { paginateCursor } from "./pagination.js";
6
+ export * as Retry from "./retry.js";
7
+ export * from "./services.lazy/index.js";
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Vanta pagination — hand-written.
2
+ * Vanta pagination -- hand-written.
3
3
  *
4
4
  * Generated operations that the converter stamps as cursor-paginated pass
5
5
  * core's {@link paginateCursor} strategy to `API.makePaginated`.
package/lib/pagination.js CHANGED
@@ -1,8 +1 @@
1
- /**
2
- * Vanta pagination — hand-written.
3
- *
4
- * Generated operations that the converter stamps as cursor-paginated pass
5
- * core's {@link paginateCursor} strategy to `API.makePaginated`.
6
- */
7
- export { paginateCursor } from "@distilled.cloud/core/pagination";
8
- //# sourceMappingURL=pagination.js.map
1
+ import{pagination$paginateCursor as e}from"@distilled.cloud/core/_bundle/base";export{e as paginateCursor};
@@ -1 +1 @@
1
- {"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,GAAG,MAAM,2BAA2B,CAAC;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAkB5E,OAAO,KAAK,KAAK,UAAU,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,KAAK,eAAe,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAC;AAE3C,OAAO,EAAE,WAAW,EAAe,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEjE;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GACpB,YAAY,CAAC,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC,GACzC,iBAAiB,GACjB,WAAW,GACX,eAAe,CAAC,eAAe,GAC/B,eAAe,CAAC;AAEpB,wEAAwE;AACxE,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG,UAAU,CAAC,UAAU,CAAC;AAEjE,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAoBlD,CAAC"}
1
+ {"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,GAAG,MAAM,2BAA2B,CAAC;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAkB5E,OAAO,KAAK,KAAK,UAAU,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,KAAK,eAAe,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAC;AAE3C,OAAO,EAAE,WAAW,EAAe,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEjE;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GACpB,YAAY,CAAC,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC,GACzC,iBAAiB,GACjB,WAAW,GACX,eAAe,CAAC,eAAe,GAC/B,eAAe,CAAC;AAEpB,wEAAwE;AACxE,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG,UAAU,CAAC,UAAU,CAAC;AAEjE,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAiBlD,CAAC"}
package/lib/protocol.js CHANGED
@@ -1,41 +1 @@
1
- import { makeRestProtocol } from "@distilled.cloud/core/protocol-rest";
2
- /**
3
- * VantaProtocol — hand-written.
4
- *
5
- * Vanta speaks bearer-authenticated JSON REST (no response envelope), so the
6
- * whole protocol is one `makeRestProtocol` call from `core/protocol-rest`:
7
- *
8
- * request: credentials → `Authorization: Bearer <access_token>` + base URL
9
- * (default https://api.vanta.com), resolved from the calling
10
- * fiber on every request
11
- *
12
- * response: 2xx JSON is the payload (sensitive members delivered as
13
- * `Redacted`); non-2xx `{ code?, message }` bodies map to the
14
- * operation's typed error classes by status, then the shared
15
- * HTTP-status classes, then {@link UnknownVantaError}.
16
- */
17
- import * as Effect from "effect/Effect";
18
- import * as Redacted from "effect/Redacted";
19
- import { Credentials } from "./credentials.js";
20
- import { UnknownVantaError, VantaParseError } from "./errors.js";
21
- export const VantaProtocol = makeRestProtocol({
22
- // The Credentials service holds an effect — resolving it here (per
23
- // request, on the calling fiber) picks up context-provided credentials.
24
- credentials: Effect.gen(function* () {
25
- const resolve = yield* Credentials;
26
- return yield* resolve;
27
- }),
28
- baseUrl: (creds) => creds.apiBaseUrl,
29
- headers: (creds) => ({
30
- Authorization: `Bearer ${Redacted.value(creds.apiKey)}`,
31
- }),
32
- // Vanta's error body is `{ code?: string, message?: string }` — the
33
- // factory's default lenient envelope covers it.
34
- unknownError: ({ code, message, body }) => new UnknownVantaError({
35
- code: typeof code === "string" ? code : code !== undefined ? String(code) : undefined,
36
- message,
37
- body,
38
- }),
39
- parseError: ({ body, cause }) => new VantaParseError({ body, cause }),
40
- });
41
- //# sourceMappingURL=protocol.js.map
1
+ export { protocol$VantaProtocol as VantaProtocol } from "./_bundle/sdk.js";
package/lib/retry.d.ts CHANGED
@@ -19,7 +19,7 @@ import * as Effect from "effect/Effect";
19
19
  export { type Options, type Factory, type Policy, makeDefault, jittered, capped, throttlingOptions, transientOptions, throttlingFactory, transientFactory, } from "@distilled.cloud/core/retry";
20
20
  declare const Retry_base: Context.ServiceClass<Retry, "VantaRetry", Policy>;
21
21
  /** Context tag for configuring retry behavior of Vanta API calls. */
22
- export declare class Retry extends Retry_base {
22
+ export declare class Retry extends /*@__PURE__*/ Retry_base {
23
23
  }
24
24
  /** Provides a custom retry policy to every Vanta API call below it. */
25
25
  export declare const policy: (optionsOrFactory: Policy) => <A, E, R>(self: Effect.Effect<A, E, R>) => Effect.Effect<A, E, Exclude<R, Retry>>;
@@ -1 +1 @@
1
- {"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../src/retry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAuC,MAAM,6BAA6B,CAAC;AAC/F;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,OAAO,EACZ,KAAK,MAAM,EACX,WAAW,EACX,QAAQ,EACR,MAAM,EACN,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,6BAA6B,CAAC;;AAErC,qEAAqE;AACrE,qBAAa,KAAM,SAAQ,UAA8C;CAAG;AAE5E,uEAAuE;AACvE,eAAO,MAAM,MAAM,qBAAsB,MAAM,sFACS,CAAC;AAEzD,sCAAsC;AACtC,eAAO,MAAM,IAAI,mFAA+D,CAAC;AAEjF,kFAAkF;AAClF,eAAO,MAAM,UAAU,mFAA4B,CAAC;AAEpD,oFAAoF;AACpF,eAAO,MAAM,SAAS,mFAA2B,CAAC"}
1
+ {"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../src/retry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAuC,MAAM,6BAA6B,CAAC;AAC/F;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,OAAO,EACZ,KAAK,MAAM,EACX,WAAW,EACX,QAAQ,EACR,MAAM,EACN,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,6BAA6B,CAAC;;AAErC,qEAAqE;AACrE,qBAAa,KAAM,SAAQ,aAAa,CAAC,UAA8C;CAAG;AAE1F,uEAAuE;AACvE,eAAO,MAAM,MAAM,qBAAsB,MAAM,sFACS,CAAC;AAEzD,sCAAsC;AACtC,eAAO,MAAM,IAAI,mFAEhB,CAAC;AAEF,kFAAkF;AAClF,eAAO,MAAM,UAAU,mFAA0C,CAAC;AAElE,oFAAoF;AACpF,eAAO,MAAM,SAAS,mFAAyC,CAAC"}
package/lib/retry.js CHANGED
@@ -1,32 +1 @@
1
- import { throttlingFactory, transientFactory } from "@distilled.cloud/core/retry";
2
- /**
3
- * Vanta retry configuration.
4
- *
5
- * Defines the per-SDK `Retry` Context.Service tag that generated operations
6
- * wire into `API.make`. Callers can install a blanket retry policy at the
7
- * layer level and have every Vanta API call below it pick it up:
8
- *
9
- * @example
10
- * ```ts
11
- * import * as Vanta from "@distilled.cloud/vanta";
12
- *
13
- * myEffect.pipe(Vanta.Retry.transient);
14
- * Effect.provide(myEffect, Layer.succeed(Vanta.Retry.Retry, customPolicy));
15
- * ```
16
- */
17
- import * as Context from "effect/Context";
18
- import * as Effect from "effect/Effect";
19
- import * as Layer from "effect/Layer";
20
- export { makeDefault, jittered, capped, throttlingOptions, transientOptions, throttlingFactory, transientFactory, } from "@distilled.cloud/core/retry";
21
- /** Context tag for configuring retry behavior of Vanta API calls. */
22
- export class Retry extends Context.Service()("VantaRetry") {
23
- }
24
- /** Provides a custom retry policy to every Vanta API call below it. */
25
- export const policy = (optionsOrFactory) => Effect.provide(Layer.succeed(Retry, optionsOrFactory));
26
- /** Disables all automatic retries. */
27
- export const none = Effect.provide(Layer.succeed(Retry, { while: () => false }));
28
- /** Apply the throttling retry policy (retries throttling errors indefinitely). */
29
- export const throttling = policy(throttlingFactory);
30
- /** Apply the transient retry policy (retries all transient errors indefinitely). */
31
- export const transient = policy(transientFactory);
32
- //# sourceMappingURL=retry.js.map
1
+ export { retry$Retry as Retry, retry$capped as capped, retry$jittered as jittered, retry$makeDefault as makeDefault, retry$none as none, retry$policy as policy, retry$throttling as throttling, retry$throttlingFactory as throttlingFactory, retry$throttlingOptions as throttlingOptions, retry$transient as transient, retry$transientFactory as transientFactory, retry$transientOptions as transientOptions } from "./_bundle/sdk.js";