@distilled.cloud/okta 1.0.0-rc.14 → 1.0.0-rc.16

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/traits.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Okta SDK trait surface — hand-written.
2
+ * Okta SDK trait surface -- hand-written.
3
3
  *
4
4
  * Re-exports the generic protocol traits from core (so generated operations
5
5
  * import everything from one place). Okta has no envelope of its own; the
package/lib/traits.js CHANGED
@@ -1,11 +1,11 @@
1
- /**
2
- * Okta SDK trait surface — hand-written.
3
- *
4
- * Re-exports the generic protocol traits from core (so generated operations
5
- * import everything from one place). Okta has no envelope of its own; the
6
- * REST-protocol traits (SensitiveValue / RawResponse) come from
7
- * `core/protocol-rest`.
8
- */
1
+
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
9
  export { Body, Header, Query, Label, Http, ResponseCode, HttpBody, FormDataFile, KeyDictionary, UnionCases, applyErrorMatchers, getErrorMatchers, bodySymbol, headerSymbol, querySymbol, labelSymbol, httpSymbol, responseCodeSymbol, httpBodySymbol, formDataFileSymbol, keyDictionarySymbol, unionCasesSymbol, errorMatchersSymbol, } from "@distilled.cloud/core/trait";
10
10
  export { SensitiveValue, RawResponse, RawResponseRoot, sensitiveValueSymbol, rawResponseSymbol, rawResponseRootSymbol, } from "@distilled.cloud/core/protocol-rest";
11
11
  //# sourceMappingURL=traits.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@distilled.cloud/okta",
3
- "version": "1.0.0-rc.14",
3
+ "version": "1.0.0-rc.16",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -18,7 +18,9 @@
18
18
  "types": "./lib/index.d.ts",
19
19
  "bun": "./src/index.ts",
20
20
  "worker": "./src/index.ts",
21
- "default": "./lib/index.js"
21
+ "module": "./lib/index.full.js",
22
+ "module-sync": "./lib/index.js",
23
+ "default": "./lib/index.full.js"
22
24
  },
23
25
  "./Credentials": {
24
26
  "types": "./lib/credentials.d.ts",
@@ -60,27 +62,29 @@
60
62
  "types": "./lib/services/*.d.ts",
61
63
  "bun": "./src/services/*.ts",
62
64
  "worker": "./src/services/*.ts",
63
- "default": "./lib/services/*.js"
65
+ "module": "./lib/services.full/*.js",
66
+ "module-sync": "./lib/services/*.js",
67
+ "default": "./lib/services.full/*.js"
64
68
  }
65
69
  },
66
70
  "dependencies": {
67
- "@distilled.cloud/core": "1.0.0-rc.14"
71
+ "@distilled.cloud/core": "1.0.0-rc.16"
68
72
  },
69
73
  "devDependencies": {
70
- "@types/node": "26.2.0"
74
+ "@types/node": "26.6.5"
71
75
  },
72
76
  "peerDependencies": {
73
- "effect": "^4.0.0"
77
+ "effect": "^4.0.5"
74
78
  },
75
79
  "distilled": {
76
- "generatedAt": "2026-10-06",
80
+ "generatedAt": "2026-10-09",
77
81
  "specUpdatedAt": "2026-10-05"
78
82
  },
79
83
  "scripts": {
80
- "build": "tsc -b",
84
+ "build": "tsrs -b",
81
85
  "convert": "node --conditions=bun scripts/convert.ts",
82
86
  "generate": "node --conditions=bun scripts/convert.ts && node --conditions=bun scripts/generate.ts",
83
- "typecheck": "tsc -p tsconfig.json",
87
+ "typecheck": "tsrs -p tsconfig.json",
84
88
  "specs:fetch": "git submodule update --force --init --depth=1 specs/spec-mirror-okta",
85
89
  "specs:update": "git submodule update --remote --force --depth=1 specs/spec-mirror-okta"
86
90
  }
@@ -1,16 +1,16 @@
1
1
  import { ConfigError } from "@distilled.cloud/core/errors";
2
2
  /**
3
- * Okta credentials — hand-written.
3
+ * Okta credentials -- hand-written.
4
4
  *
5
5
  * The `Credentials` service holds an *effect* that resolves the current
6
6
  * credentials on every request (the protocol layer resolves it per request
7
7
  * on the calling fiber). Dual-mode auth:
8
8
  *
9
- * SSWS API token → `Authorization: SSWS <apiToken>`
10
- * OAuth access token → `Authorization: Bearer <apiToken>`
9
+ * SSWS API token -> `Authorization: SSWS <apiToken>`
10
+ * OAuth access token -> `Authorization: Bearer <apiToken>`
11
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
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
14
  * required.
15
15
  */
16
16
  import * as Context from "effect/Context";
@@ -27,9 +27,8 @@ export interface Config {
27
27
  readonly authScheme: AuthScheme;
28
28
  }
29
29
 
30
- export class Credentials extends Context.Service<Credentials, Effect.Effect<Config>>()(
31
- "OktaCredentials",
32
- ) {}
30
+ export class Credentials
31
+ extends /*@__PURE__*/ Context.Service<Credentials, Effect.Effect<Config>>()("OktaCredentials") {}
33
32
 
34
33
  const stripTrailingSlash = (url: string): string => url.replace(/\/+$/, "");
35
34
 
@@ -63,9 +62,9 @@ export const fromAccessToken = (config: {
63
62
  * Reads OKTA_API_TOKEN + OKTA_ORG_URL (required) and OKTA_AUTH_SCHEME
64
63
  * (optional, `SSWS` or `Bearer`; default SSWS).
65
64
  */
66
- export const CredentialsFromEnv: Layer.Layer<Credentials> = Layer.succeed(
65
+ export const CredentialsFromEnv: Layer.Layer<Credentials> = /*@__PURE__*/ Layer.succeed(
67
66
  Credentials,
68
- Effect.gen(function* () {
67
+ /*@__PURE__*/ Effect.gen(function* () {
69
68
  const apiToken = process.env.OKTA_API_TOKEN;
70
69
  const apiBaseUrl = process.env.OKTA_ORG_URL;
71
70
  const scheme = process.env.OKTA_AUTH_SCHEME;
package/src/errors.ts CHANGED
@@ -3,8 +3,8 @@
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/…) 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 {
@@ -28,17 +28,19 @@ export {
28
28
  export type { DefaultErrors } from "@distilled.cloud/core/errors";
29
29
 
30
30
  import * as Category from "@distilled.cloud/core/category";
31
- import * as Schema from "effect/Schema";
31
+ import * as Schema from "@distilled.cloud/core/schema-lite-typed";
32
32
 
33
- /** Unknown Okta error — returned when nothing else matches the failure. */
34
- export class UnknownOktaError extends Schema.TaggedError<UnknownOktaError>()("UnknownOktaError", {
35
- code: Schema.optional(Schema.String),
36
- message: Schema.optional(Schema.String),
37
- body: Schema.Unknown,
38
- }).pipe(Category.withServerError) {}
33
+ /** Unknown Okta error -- returned when nothing else matches the failure. */
34
+ export class UnknownOktaError
35
+ extends /*@__PURE__*/ Schema.TaggedError<UnknownOktaError>()("UnknownOktaError", {
36
+ code: /*@__PURE__*/ Schema.optional(Schema.String),
37
+ message: /*@__PURE__*/ Schema.optional(Schema.String),
38
+ body: Schema.Unknown,
39
+ }).pipe(Category.withServerError) {}
39
40
 
40
41
  /** Schema parse error wrapper (kept for surface parity with other SDKs). */
41
- export class OktaParseError extends Schema.TaggedError<OktaParseError>()("OktaParseError", {
42
- body: Schema.Unknown,
43
- cause: Schema.Unknown,
44
- }).pipe(Category.withParseError) {}
42
+ export class OktaParseError
43
+ extends /*@__PURE__*/ Schema.TaggedError<OktaParseError>()("OktaParseError", {
44
+ body: Schema.Unknown,
45
+ cause: Schema.Unknown,
46
+ }).pipe(Category.withParseError) {}
package/src/index.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @distilled.cloud/okta — Okta Management SDK for Effect.
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
@@ -21,7 +21,7 @@ export * as Retry from "./retry.ts";
21
21
  export * as Services from "./services/index.ts";
22
22
  // Operations (and their request/response types) are importable straight off
23
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
24
+ // same-named shared ones from ./errors.ts -- the ops actually raise the
25
25
  // service-local classes.
26
26
  export * from "./services/okta.ts";
27
27
  export { BadRequest, Conflict, Forbidden, NotFound, UnprocessableEntity } from "./services/okta.ts";
package/src/pagination.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Okta pagination — hand-written.
2
+ * Okta pagination -- hand-written.
3
3
  *
4
4
  * List operations that the converter stamps as paginated are cursor-mode
5
5
  * (`after` in). Generated operations pass core's {@link paginateCursor}
package/src/protocol.ts CHANGED
@@ -2,12 +2,12 @@ import type * as API from "@distilled.cloud/core/api";
2
2
  import type { API_ERRORS, ConfigError } from "@distilled.cloud/core/errors";
3
3
  import { makeRestProtocol, type RestErrorEnvelope } from "@distilled.cloud/core/protocol-rest";
4
4
  /**
5
- * OktaProtocol — hand-written.
5
+ * OktaProtocol -- hand-written.
6
6
  *
7
7
  * Okta speaks JSON REST (no response envelope), so the whole protocol is one
8
8
  * `makeRestProtocol` call from `core/protocol-rest`:
9
9
  *
10
- * request: credentials → `Authorization: SSWS <apiToken>` (API token) or
10
+ * request: credentials -> `Authorization: SSWS <apiToken>` (API token) or
11
11
  * `Authorization: Bearer <apiToken>` (OAuth) + org base URL
12
12
  * (`https://{yourOktaDomain}`), resolved from the calling fiber
13
13
  * on every request
@@ -60,13 +60,10 @@ const errorEnvelope = (body: unknown): RestErrorEnvelope | undefined => {
60
60
  return { code, message };
61
61
  };
62
62
 
63
- export const OktaProtocol: Layer.Layer<API.Protocol> = makeRestProtocol<Config>({
64
- // The Credentials service holds an effect — resolving it here (per
63
+ export const OktaProtocol: Layer.Layer<API.Protocol> = /*@__PURE__*/ makeRestProtocol<Config>({
64
+ // The Credentials service holds an effect -- resolving it here (per
65
65
  // request, on the calling fiber) picks up context-provided credentials.
66
- credentials: Effect.gen(function* () {
67
- const resolve = yield* Credentials;
68
- return yield* resolve;
69
- }),
66
+ credentials: /*@__PURE__*/ Effect.flatMap(Credentials, (resolve) => resolve),
70
67
  baseUrl: (creds) => creds.apiBaseUrl,
71
68
  headers: (creds) => formatHeaders(creds),
72
69
  errorEnvelope,
package/src/retry.ts CHANGED
@@ -32,17 +32,19 @@ export {
32
32
  } from "@distilled.cloud/core/retry";
33
33
 
34
34
  /** Context tag for configuring retry behavior of Okta API calls. */
35
- export class Retry extends Context.Service<Retry, Policy>()("OktaRetry") {}
35
+ export class Retry extends /*@__PURE__*/ Context.Service<Retry, Policy>()("OktaRetry") {}
36
36
 
37
37
  /** Provides a custom retry policy to every Okta API call below it. */
38
38
  export const policy = (optionsOrFactory: Policy) =>
39
39
  Effect.provide(Layer.succeed(Retry, optionsOrFactory));
40
40
 
41
41
  /** Disables all automatic retries. */
42
- export const none = Effect.provide(Layer.succeed(Retry, { while: () => false }));
42
+ export const none = /*@__PURE__*/ Effect.provide(
43
+ /*@__PURE__*/ Layer.succeed(Retry, { while: () => false }),
44
+ );
43
45
 
44
46
  /** Apply the throttling retry policy (retries throttling errors indefinitely). */
45
- export const throttling = policy(throttlingFactory);
47
+ export const throttling = /*@__PURE__*/ policy(throttlingFactory);
46
48
 
47
49
  /** Apply the transient retry policy (retries all transient errors indefinitely). */
48
- export const transient = policy(transientFactory);
50
+ export const transient = /*@__PURE__*/ policy(transientFactory);