@distilled.cloud/okta 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.
- package/lib/.lazy.json +1 -0
- package/lib/_bundle/lazy.js +4 -0
- package/lib/_bundle/sdk.js +2 -0
- package/lib/_bundle/sdk.js.map +1 -0
- package/lib/credentials.d.ts +6 -6
- package/lib/credentials.d.ts.map +1 -1
- package/lib/credentials.js +1 -60
- package/lib/errors.d.ts +15 -15
- package/lib/errors.d.ts.map +1 -1
- package/lib/errors.js +1 -26
- package/lib/index.d.ts +1 -1
- package/lib/index.js +0 -19
- package/lib/index.lazy.js +9 -0
- package/lib/{index.js.map → index.lazy.js.map} +1 -1
- package/lib/pagination.d.ts +1 -1
- package/lib/pagination.js +1 -10
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +1 -57
- package/lib/retry.d.ts +1 -1
- package/lib/retry.d.ts.map +1 -1
- package/lib/retry.js +1 -32
- package/lib/services/index.js +0 -2
- package/lib/services/okta.d.ts +14 -2851
- package/lib/services/okta.d.ts.map +1 -1
- package/lib/services/okta.js +948 -18377
- package/lib/services/okta.js.map +1 -1
- package/lib/services.lazy/index.js +3 -0
- package/lib/services.lazy/okta.js +4 -0
- package/lib/traits.d.ts +1 -1
- package/lib/traits.js +1 -11
- package/package.json +9 -7
- package/src/credentials.ts +9 -10
- package/src/errors.ts +15 -13
- package/src/index.ts +2 -2
- package/src/pagination.ts +1 -1
- package/src/protocol.ts +5 -8
- package/src/retry.ts +6 -4
- package/src/services/okta.ts +18909 -21994
- package/src/traits.ts +1 -1
- package/lib/credentials.js.map +0 -1
- package/lib/errors.js.map +0 -1
- package/lib/pagination.js.map +0 -1
- package/lib/protocol.js.map +0 -1
- package/lib/retry.js.map +0 -1
- package/lib/services/index.js.map +0 -1
- package/lib/traits.js.map +0 -1
package/lib/.lazy.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"serviceDirs":["services"],"twins":["index.js"]}
|
|
@@ -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 ae,errors$TooManyRequests as s,errors$Unauthorized as c,errors$UnprocessableEntity as l,protocol_rest$RawResponse as u,protocol_rest$RawResponseRoot as d,protocol_rest$SensitiveValue as f,protocol_rest$makeRestProtocol as p,protocol_rest$rawResponseRootSymbol as m,protocol_rest$rawResponseSymbol as h,protocol_rest$sensitiveValueSymbol as g,schema_lite$Array as _,schema_lite$Boolean as v,schema_lite$NullOr as y,schema_lite$Number as b,schema_lite$Record as x,schema_lite$String as S,schema_lite$Struct as C,schema_lite$TaggedError 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$error as j,api$named as M,api$newError as N,api$op as P,category$withAuthError as F,category$withBadRequestError as I,category$withConflictError as L,category$withParseError as R,category$withServerError as z,retry$capped as B,retry$jittered as V,retry$makeDefault as H,retry$throttlingFactory as U,retry$throttlingOptions as W,retry$transientFactory as G,retry$transientOptions as K,trait$Body as oe,trait$FormDataFile as q,trait$Header as se,trait$Http as ce,trait$HttpBody as le,trait$KeyDictionary as ue,trait$Label as de,trait$Query as fe,trait$ResponseCode as pe,trait$UnionCases as me,trait$applyErrorMatchers as he,trait$bodySymbol as ge,trait$errorMatchersSymbol as _e,trait$formDataFileSymbol as ve,trait$getErrorMatchers as ye,trait$headerSymbol as be,trait$httpBodySymbol as xe,trait$httpSymbol as Se,trait$keyDictionarySymbol as Ce,trait$labelSymbol as we,trait$querySymbol as Te,trait$responseCodeSymbol as J,trait$unionCasesSymbol as Ee}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";var Credentials=class extends (/*@__PURE__*/ Y.Service()(`OktaCredentials`)){};const stripTrailingSlash=e=>e.replace(/\/+$/,``);const fromApiToken=e=>Z.succeed(Credentials,X.succeed({apiToken:e.apiToken,apiBaseUrl:stripTrailingSlash(e.apiBaseUrl),authScheme:e.authScheme??`SSWS`}));const fromAccessToken=e=>fromApiToken({apiToken:e.accessToken,apiBaseUrl:e.apiBaseUrl,authScheme:`Bearer`});const De=/*@__PURE__*/ Z.succeed(Credentials,/*@__PURE__*/ X.gen(function*(){const e=process.env.OKTA_API_TOKEN;const t=process.env.OKTA_ORG_URL;const n=process.env.OKTA_AUTH_SCHEME;if(!e||!t)return yield*new r({message:`OKTA_API_TOKEN and OKTA_ORG_URL environment variables are required`});const i=n===`Bearer`||n===`SSWS`?n:`SSWS`;return{apiToken:Q.make(e),apiBaseUrl:stripTrailingSlash(t),authScheme:i}}).pipe(X.orDie));const formatHeaders=e=>({Authorization:`${e.authScheme} ${Q.value(e.apiToken)}`,Accept:`application/json`});var UnknownOktaError=class extends (/*@__PURE__*/ $.TaggedError()(`UnknownOktaError`,{code:/*@__PURE__*/ $.optional($.String),message:/*@__PURE__*/ $.optional($.String),body:$.Unknown}).pipe(z)){};var OktaParseError=class extends (/*@__PURE__*/ $.TaggedError()(`OktaParseError`,{body:$.Unknown,cause:$.Unknown}).pipe(R)){};const errorEnvelope=e=>{if(e===null||typeof e!==`object`)return void 0;const t=e;const n=typeof t.errorCode===`string`?t.errorCode:typeof t.code===`string`?t.code:void 0;const r=typeof t.errorSummary===`string`?t.errorSummary:typeof t.message===`string`?t.message:void 0;if(n===void 0&&r===void 0)return void 0;return{code:n,message:r}};const Oe=/*@__PURE__*/ p({credentials:/*@__PURE__*/ X.flatMap(Credentials,e=>e),baseUrl:e=>e.apiBaseUrl,headers:e=>formatHeaders(e),errorEnvelope,unknownError:({code:e,message:t,body:n})=>new UnknownOktaError({code:typeof e===`string`?e:e!==void 0?String(e):void 0,message:t,body:n}),parseError:({body:e,cause:t})=>new OktaParseError({body:e,cause:t})});var Retry=class extends (/*@__PURE__*/ Y.Service()(`OktaRetry`)){};const policy=e=>X.provide(Z.succeed(Retry,e));const ke=/*@__PURE__*/ X.provide(/*@__PURE__*/ Z.succeed(Retry,{while:()=>false}));const Ae=/*@__PURE__*/ policy(U);const je=/*@__PURE__*/ policy(G);export{N as _,x as a,I as b,w as c,Credentials as credentials$Credentials,De as credentials$CredentialsFromEnv,formatHeaders as credentials$formatHeaders,fromAccessToken as credentials$fromAccessToken,fromApiToken as credentials$fromApiToken,D 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,OktaParseError as errors$OktaParseError,ae as errors$ServiceUnavailable,s as errors$TooManyRequests,c as errors$Unauthorized,UnknownOktaError as errors$UnknownOktaError,l as errors$UnprocessableEntity,O as f,M as g,j as h,b as i,T as l,A as m,v as n,S as o,k as p,Oe as protocol$OktaProtocol,y as r,Retry as retry$Retry,B as retry$capped,V as retry$jittered,H as retry$makeDefault,ke as retry$none,policy as retry$policy,Ae as retry$throttling,U as retry$throttlingFactory,W as retry$throttlingOptions,je as retry$transient,G as retry$transientFactory,K as retry$transientOptions,C as s,_ as t,oe as traits$Body,q as traits$FormDataFile,se as traits$Header,ce as traits$Http,le as traits$HttpBody,ue as traits$KeyDictionary,de as traits$Label,fe as traits$Query,u as traits$RawResponse,d as traits$RawResponseRoot,pe as traits$ResponseCode,f as traits$SensitiveValue,me as traits$UnionCases,he as traits$applyErrorMatchers,ge as traits$bodySymbol,_e as traits$errorMatchersSymbol,ve as traits$formDataFileSymbol,ye as traits$getErrorMatchers,be as traits$headerSymbol,xe as traits$httpBodySymbol,Se as traits$httpSymbol,Ce as traits$keyDictionarySymbol,we as traits$labelSymbol,Te as traits$querySymbol,m as traits$rawResponseRootSymbol,h as traits$rawResponseSymbol,J as traits$responseCodeSymbol,g as traits$sensitiveValueSymbol,Ee as traits$unionCasesSymbol,E as u,P as v,L as x,F as y};
|
|
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","TaggedError","Unknown","at","optional","suspend","D","call","error","named","newError","op","withAuthError","withBadRequestError","withConflictError","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","url","config","CredentialsFromEnv","apiToken","apiBaseUrl","scheme","authScheme","body","b","code","message","OktaProtocol","resolve","creds","optionsOrFactory","none","throttling","transient"],"sources":["../../src/credentials.ts","../../src/errors.ts","../../src/protocol.ts","../../src/retry.ts"],"mappings":"grEA6BA,IAAa,YAAb,eACwB,gBAAQ,QAA4C,CAAC,CAAC,iBAAiB,EAAA,AAAE,CAAC,EAElG,MAAM,mBAAsB,GAAwBmF,EAAI,QAAQ,OAAQ,E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A,IAAS,SAAU,OAAO,IAAA,GACtD,MAAMC,EAAID,EACV,MAAME,EACJ,OAAOD,EAAE,YAAc,SAAWA,EAAE,UAAY,OAAOA,EAAE,OAAS,SAAWA,EAAE,KAAO,IAAA,GACxF,MAAME,EACJ,OAAOF,EAAE,eAAiB,SACtBA,EAAE,aACF,OAAOA,EAAE,UAAY,SACnBA,EAAE,QACF,IAAA,GACR,GAAIC,IAAS,IAAA,IAAaC,IAAY,IAAA,GAAW,OAAO,IAAA,GACxD,MAAO,CAAE,OAAM,SAAQ,CACzB,EAEA,MAAaC,GAAwD,gBAAyB,CAG5F,YAA2B,gBAAO,QAAQ,YAAc,GAAYC,CAAO,EAC3E,QAAU,GAAUC,EAAM,WAC1B,QAAU,GAAU,cAAcA,CAAK,EACvC,cACA,cAAe,CAAE,OAAM,UAAS,UAC9B,IAAI,iBAAiB,CACnB,KAAM,OAAOJ,IAAS,SAAWA,EAAOA,IAAS,IAAA,GAAY,OAAOA,CAAI,EAAI,IAAA,GAC5E,UACA,MACF,CAAC,EACH,YAAa,CAAE,OAAM,WAAY,IAAI,eAAe,CAAE,OAAM,OAAM,CAAC,CACrE,CAAC,EC1CD,IAAa,MAAb,eAAyC,gBAAQ,QAAuB,CAAC,CAAC,WAAW,EAAA,AAAE,CAAC,EAGxF,MAAa,OAAU,GACrBb,EAAO,QAAQC,EAAM,QAAQ,MAAOiB,CAAgB,CAAC,EAGvD,MAAaC,GAAqB,gBAAO,QACzB,gBAAM,QAAQ,MAAO,CAAE,UAAa,KAAM,CAAC,CAC3D,EAGA,MAAaC,GAA2B,qBAAOhD,CAAiB,EAGhE,MAAaiD,GAA0B,qBAAO/C,CAAgB"}
|
package/lib/credentials.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Okta credentials
|
|
2
|
+
* Okta 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
|
|
6
6
|
* on the calling fiber). Dual-mode auth:
|
|
7
7
|
*
|
|
8
|
-
* SSWS API token
|
|
9
|
-
* OAuth access token
|
|
8
|
+
* SSWS API token -> `Authorization: SSWS <apiToken>`
|
|
9
|
+
* OAuth access token -> `Authorization: Bearer <apiToken>`
|
|
10
10
|
*
|
|
11
|
-
* There is no global Okta host
|
|
12
|
-
* (`https://dev-123456.okta.com`, a custom domain,
|
|
11
|
+
* There is no global Okta host -- every org has its own domain
|
|
12
|
+
* (`https://dev-123456.okta.com`, a custom domain, ...), so `apiBaseUrl` is
|
|
13
13
|
* required.
|
|
14
14
|
*/
|
|
15
15
|
import * as Context from "effect/Context";
|
|
@@ -24,7 +24,7 @@ export interface Config {
|
|
|
24
24
|
readonly authScheme: AuthScheme;
|
|
25
25
|
}
|
|
26
26
|
declare const Credentials_base: Context.ServiceClass<Credentials, "OktaCredentials", Effect.Effect<Config, never, never>>;
|
|
27
|
-
export declare class Credentials extends Credentials_base {
|
|
27
|
+
export declare class Credentials extends /*@__PURE__*/ Credentials_base {
|
|
28
28
|
}
|
|
29
29
|
/** Layer from an SSWS API token + org base URL. */
|
|
30
30
|
export declare const fromApiToken: (config: {
|
package/lib/credentials.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;GAaG;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,yCAAyC;AACzC,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE3C,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC,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;AACH,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,CAqBvD,CAAC;AAEF,sDAAsD;AACtD,eAAO,MAAM,aAAa,WAAY,MAAM,KAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAGlE,CAAC"}
|
package/lib/credentials.js
CHANGED
|
@@ -1,60 +1 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* Okta 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). Dual-mode auth:
|
|
8
|
-
*
|
|
9
|
-
* SSWS API token → `Authorization: SSWS <apiToken>`
|
|
10
|
-
* OAuth access token → `Authorization: Bearer <apiToken>`
|
|
11
|
-
*
|
|
12
|
-
* There is no global Okta host — every org has its own domain
|
|
13
|
-
* (`https://dev-123456.okta.com`, a custom domain, …), so `apiBaseUrl` is
|
|
14
|
-
* required.
|
|
15
|
-
*/
|
|
16
|
-
import * as Context from "effect/Context";
|
|
17
|
-
import * as Effect from "effect/Effect";
|
|
18
|
-
import * as Layer from "effect/Layer";
|
|
19
|
-
import * as Redacted from "effect/Redacted";
|
|
20
|
-
export class Credentials extends Context.Service()("OktaCredentials") {
|
|
21
|
-
}
|
|
22
|
-
const stripTrailingSlash = (url) => url.replace(/\/+$/, "");
|
|
23
|
-
/** Layer from an SSWS API token + org base URL. */
|
|
24
|
-
export const fromApiToken = (config) => Layer.succeed(Credentials, Effect.succeed({
|
|
25
|
-
apiToken: config.apiToken,
|
|
26
|
-
apiBaseUrl: stripTrailingSlash(config.apiBaseUrl),
|
|
27
|
-
authScheme: config.authScheme ?? "SSWS",
|
|
28
|
-
}));
|
|
29
|
-
/** Layer from an OAuth 2.0 access token + org base URL. */
|
|
30
|
-
export const fromAccessToken = (config) => fromApiToken({
|
|
31
|
-
apiToken: config.accessToken,
|
|
32
|
-
apiBaseUrl: config.apiBaseUrl,
|
|
33
|
-
authScheme: "Bearer",
|
|
34
|
-
});
|
|
35
|
-
/**
|
|
36
|
-
* Reads OKTA_API_TOKEN + OKTA_ORG_URL (required) and OKTA_AUTH_SCHEME
|
|
37
|
-
* (optional, `SSWS` or `Bearer`; default SSWS).
|
|
38
|
-
*/
|
|
39
|
-
export const CredentialsFromEnv = Layer.succeed(Credentials, Effect.gen(function* () {
|
|
40
|
-
const apiToken = process.env.OKTA_API_TOKEN;
|
|
41
|
-
const apiBaseUrl = process.env.OKTA_ORG_URL;
|
|
42
|
-
const scheme = process.env.OKTA_AUTH_SCHEME;
|
|
43
|
-
if (!apiToken || !apiBaseUrl) {
|
|
44
|
-
return yield* new ConfigError({
|
|
45
|
-
message: "OKTA_API_TOKEN and OKTA_ORG_URL environment variables are required",
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
const authScheme = scheme === "Bearer" || scheme === "SSWS" ? scheme : "SSWS";
|
|
49
|
-
return {
|
|
50
|
-
apiToken: Redacted.make(apiToken),
|
|
51
|
-
apiBaseUrl: stripTrailingSlash(apiBaseUrl),
|
|
52
|
-
authScheme,
|
|
53
|
-
};
|
|
54
|
-
}).pipe(Effect.orDie));
|
|
55
|
-
/** Auth headers for a resolved credentials config. */
|
|
56
|
-
export const formatHeaders = (config) => ({
|
|
57
|
-
Authorization: `${config.authScheme} ${Redacted.value(config.apiToken)}`,
|
|
58
|
-
Accept: "application/json",
|
|
59
|
-
});
|
|
60
|
-
//# sourceMappingURL=credentials.js.map
|
|
1
|
+
export { credentials$Credentials as Credentials, credentials$CredentialsFromEnv as CredentialsFromEnv, credentials$formatHeaders as formatHeaders, credentials$fromAccessToken as fromAccessToken, credentials$fromApiToken as fromApiToken } 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 Okta fallback
|
|
5
5
|
* errors. Note the generated service module additionally defines its own
|
|
6
|
-
* per-status matcher classes (BadRequest/NotFound
|
|
7
|
-
* operation declares
|
|
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 "
|
|
13
|
-
declare const UnknownOktaError_base: Schema.
|
|
14
|
-
readonly code: Schema.optional<Schema.String>;
|
|
15
|
-
readonly message: Schema.optional<Schema.String>;
|
|
16
|
-
readonly body: Schema.Unknown;
|
|
17
|
-
}
|
|
12
|
+
import * as Schema from "@distilled.cloud/core/schema-lite-typed";
|
|
13
|
+
declare const UnknownOktaError_base: Schema.TaggedErrorClass<"UnknownOktaError", {
|
|
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 Okta error
|
|
23
|
-
export declare class UnknownOktaError extends UnknownOktaError_base {
|
|
22
|
+
/** Unknown Okta error -- returned when nothing else matches the failure. */
|
|
23
|
+
export declare class UnknownOktaError extends /*@__PURE__*/ UnknownOktaError_base {
|
|
24
24
|
}
|
|
25
|
-
declare const OktaParseError_base: Schema.
|
|
26
|
-
readonly body: Schema.Unknown;
|
|
27
|
-
readonly cause: Schema.Unknown;
|
|
28
|
-
}
|
|
25
|
+
declare const OktaParseError_base: Schema.TaggedErrorClass<"OktaParseError", {
|
|
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 (kept for surface parity with other SDKs). */
|
|
34
|
-
export declare class OktaParseError extends OktaParseError_base {
|
|
34
|
+
export declare class OktaParseError extends /*@__PURE__*/ OktaParseError_base {
|
|
35
35
|
}
|
|
36
36
|
//# sourceMappingURL=errors.d.ts.map
|
package/lib/errors.d.ts.map
CHANGED
|
@@ -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,
|
|
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,4EAA4E;AAC5E,qBAAa,gBACX,SAAQ,aAAa,CAAC,qBAIW;CAAG;;;;;;;;;AAEtC,4EAA4E;AAC5E,qBAAa,cACX,SAAQ,aAAa,CAAC,mBAGU;CAAG"}
|
package/lib/errors.js
CHANGED
|
@@ -1,26 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Okta-specific error types.
|
|
3
|
-
*
|
|
4
|
-
* Re-exports the common HTTP errors from core and adds the Okta fallback
|
|
5
|
-
* errors. Note the generated service module additionally defines its 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 Okta error — returned when nothing else matches the failure. */
|
|
14
|
-
export class UnknownOktaError extends Schema.TaggedError()("UnknownOktaError", {
|
|
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 (kept for surface parity with other SDKs). */
|
|
21
|
-
export class OktaParseError extends Schema.TaggedError()("OktaParseError", {
|
|
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$OktaParseError as OktaParseError, errors$ServiceUnavailable as ServiceUnavailable, errors$TooManyRequests as TooManyRequests, errors$Unauthorized as Unauthorized, errors$UnknownOktaError as UnknownOktaError, errors$UnprocessableEntity as UnprocessableEntity } from "./_bundle/sdk.js";
|
package/lib/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @distilled.cloud/okta
|
|
2
|
+
* @distilled.cloud/okta -- Okta Management SDK for Effect.
|
|
3
3
|
*
|
|
4
4
|
* `./services` is generated by `scripts/generate.ts` from the Smithy model
|
|
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/okta — Okta Management SDK for Effect.
|
|
3
|
-
*
|
|
4
|
-
* `./services` is generated by `scripts/generate.ts` from the Smithy model
|
|
5
|
-
* in `.generated-specs` (written by `scripts/convert.ts` from the OpenAPI
|
|
6
|
-
* spec). Everything else in this folder is hand-written.
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* ```ts
|
|
10
|
-
* import * as Okta from "@distilled.cloud/okta";
|
|
11
|
-
*
|
|
12
|
-
* const users = yield* Okta.Services.okta.listUsers({});
|
|
13
|
-
* ```
|
|
14
|
-
*/
|
|
15
1
|
export * from "./credentials.js";
|
|
16
2
|
export * from "./errors.js";
|
|
17
3
|
export * as T from "./traits.js";
|
|
@@ -19,10 +5,5 @@ export { OktaProtocol } from "./protocol.js";
|
|
|
19
5
|
export { paginateCursor } from "./pagination.js";
|
|
20
6
|
export * as Retry from "./retry.js";
|
|
21
7
|
export * as Services from "./services/index.js";
|
|
22
|
-
// Operations (and their request/response types) are importable straight off
|
|
23
|
-
// the package root. The service-local typed error classes shadow the
|
|
24
|
-
// same-named shared ones from ./errors.ts — the ops actually raise the
|
|
25
|
-
// service-local classes.
|
|
26
8
|
export * from "./services/okta.js";
|
|
27
9
|
export { BadRequest, Conflict, Forbidden, NotFound, UnprocessableEntity } from "./services/okta.js";
|
|
28
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from "./credentials.js";
|
|
2
|
+
export * from "./errors.js";
|
|
3
|
+
export * as T from "./traits.js";
|
|
4
|
+
export { OktaProtocol } from "./protocol.js";
|
|
5
|
+
export { paginateCursor } from "./pagination.js";
|
|
6
|
+
export * as Retry from "./retry.js";
|
|
7
|
+
export * as Services from "./services.lazy/index.js";
|
|
8
|
+
export * from "./services.lazy/okta.js";
|
|
9
|
+
export { BadRequest, Conflict, Forbidden, NotFound, UnprocessableEntity } from "./services.lazy/okta.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,YAAY,EAAwC,MAAM,eAAe,CAAC;AACnF,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAChD,4EAA4E;AAC5E,qEAAqE;AACrE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,YAAY,EAAwC,MAAM,eAAe,CAAC;AACnF,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAChD,4EAA4E;AAC5E,qEAAqE;AACrE,wEAAwE;AACxE,yBAAyB;AACzB,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC"}
|
package/lib/pagination.d.ts
CHANGED
package/lib/pagination.js
CHANGED
|
@@ -1,10 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Okta pagination — hand-written.
|
|
3
|
-
*
|
|
4
|
-
* List operations that the converter stamps as paginated are cursor-mode
|
|
5
|
-
* (`after` in). Generated operations pass core's {@link paginateCursor}
|
|
6
|
-
* strategy to `API.makePaginated`. Endpoints that only advertise the `Link`
|
|
7
|
-
* response header stay plain operations.
|
|
8
|
-
*/
|
|
9
|
-
export { paginateCursor } from "@distilled.cloud/core/pagination";
|
|
10
|
-
//# sourceMappingURL=pagination.js.map
|
|
1
|
+
import{pagination$paginateCursor as e}from"@distilled.cloud/core/_bundle/base";export{e as paginateCursor};
|
package/lib/protocol.d.ts.map
CHANGED
|
@@ -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;AAmB5E,OAAO,KAAK,KAAK,UAAU,MAAM,wBAAwB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,aAAa,GAAG,WAAW,GAAG,UAAU,CAAC,UAAU,CAAC;AAsBhE,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAcjD,CAAC"}
|
package/lib/protocol.js
CHANGED
|
@@ -1,57 +1 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* OktaProtocol — hand-written.
|
|
4
|
-
*
|
|
5
|
-
* Okta speaks JSON REST (no response envelope), so the whole protocol is one
|
|
6
|
-
* `makeRestProtocol` call from `core/protocol-rest`:
|
|
7
|
-
*
|
|
8
|
-
* request: credentials → `Authorization: SSWS <apiToken>` (API token) or
|
|
9
|
-
* `Authorization: Bearer <apiToken>` (OAuth) + org base URL
|
|
10
|
-
* (`https://{yourOktaDomain}`), resolved from the calling fiber
|
|
11
|
-
* on every request
|
|
12
|
-
*
|
|
13
|
-
* response: 2xx JSON is the payload (sensitive members delivered as
|
|
14
|
-
* `Redacted`); non-2xx `{ errorCode, errorSummary }` bodies map
|
|
15
|
-
* to the operation's typed error classes by status, then the
|
|
16
|
-
* shared HTTP-status classes, then {@link UnknownOktaError}.
|
|
17
|
-
*/
|
|
18
|
-
import * as Effect from "effect/Effect";
|
|
19
|
-
import { Credentials, formatHeaders } from "./credentials.js";
|
|
20
|
-
import { UnknownOktaError, OktaParseError } from "./errors.js";
|
|
21
|
-
/**
|
|
22
|
-
* Okta error bodies are `{ errorCode, errorSummary, errorLink?, errorId?,
|
|
23
|
-
* errorCauses? }`. A response that arrives without that envelope falls
|
|
24
|
-
* through to the protocol's `HTTP <status>` default.
|
|
25
|
-
*/
|
|
26
|
-
const errorEnvelope = (body) => {
|
|
27
|
-
if (body === null || typeof body !== "object")
|
|
28
|
-
return undefined;
|
|
29
|
-
const b = body;
|
|
30
|
-
const code = typeof b.errorCode === "string" ? b.errorCode : typeof b.code === "string" ? b.code : undefined;
|
|
31
|
-
const message = typeof b.errorSummary === "string"
|
|
32
|
-
? b.errorSummary
|
|
33
|
-
: typeof b.message === "string"
|
|
34
|
-
? b.message
|
|
35
|
-
: undefined;
|
|
36
|
-
if (code === undefined && message === undefined)
|
|
37
|
-
return undefined;
|
|
38
|
-
return { code, message };
|
|
39
|
-
};
|
|
40
|
-
export const OktaProtocol = makeRestProtocol({
|
|
41
|
-
// The Credentials service holds an effect — resolving it here (per
|
|
42
|
-
// request, on the calling fiber) picks up context-provided credentials.
|
|
43
|
-
credentials: Effect.gen(function* () {
|
|
44
|
-
const resolve = yield* Credentials;
|
|
45
|
-
return yield* resolve;
|
|
46
|
-
}),
|
|
47
|
-
baseUrl: (creds) => creds.apiBaseUrl,
|
|
48
|
-
headers: (creds) => formatHeaders(creds),
|
|
49
|
-
errorEnvelope,
|
|
50
|
-
unknownError: ({ code, message, body }) => new UnknownOktaError({
|
|
51
|
-
code: typeof code === "string" ? code : code !== undefined ? String(code) : undefined,
|
|
52
|
-
message,
|
|
53
|
-
body,
|
|
54
|
-
}),
|
|
55
|
-
parseError: ({ body, cause }) => new OktaParseError({ body, cause }),
|
|
56
|
-
});
|
|
57
|
-
//# sourceMappingURL=protocol.js.map
|
|
1
|
+
export { protocol$OktaProtocol as OktaProtocol } 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, "OktaRetry", Policy>;
|
|
21
21
|
/** Context tag for configuring retry behavior of Okta 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 Okta 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>>;
|
package/lib/retry.d.ts.map
CHANGED
|
@@ -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,oEAAoE;AACpE,qBAAa,KAAM,SAAQ,UAA6C;CAAG;
|
|
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,oEAAoE;AACpE,qBAAa,KAAM,SAAQ,aAAa,CAAC,UAA6C;CAAG;AAEzF,sEAAsE;AACtE,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
|
-
|
|
2
|
-
/**
|
|
3
|
-
* Okta 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 Okta API call below it pick it up:
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```ts
|
|
11
|
-
* import * as Okta from "@distilled.cloud/okta";
|
|
12
|
-
*
|
|
13
|
-
* myEffect.pipe(Okta.Retry.transient);
|
|
14
|
-
* Effect.provide(myEffect, Layer.succeed(Okta.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 Okta API calls. */
|
|
22
|
-
export class Retry extends Context.Service()("OktaRetry") {
|
|
23
|
-
}
|
|
24
|
-
/** Provides a custom retry policy to every Okta 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";
|
package/lib/services/index.js
CHANGED