@nizam-os/dashboard-sdk 6.0.0 → 6.1.0

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.
@@ -34,11 +34,12 @@ export declare class OrganizationsClient {
34
34
  /**
35
35
  * Creates a brand-new tenant with the calling user as the founding admin. The id is assigned by Keycloak so the same value identifies the organization in both systems. Slug is derived from the name when not supplied.
36
36
  *
37
- * Supports the standard `Idempotency-Key` header — submit a UUID v4 per logical attempt (same value on retry). Cached responses replay for matching request bodies; mismatching fingerprints surface as 409 `idempotency.key_conflict`.
37
+ * Supports the standard `Idempotency-Key` header — submit a UUID (v4 recommended) per logical attempt (same value on retry); malformed keys are rejected with 400 `idempotency.invalid_key`. Successful responses and 4xx domain rejections replay for matching request bodies; transient 5xx responses are never cached, so retrying with the same key re-executes. Mismatching fingerprints surface as 409 `idempotency.key_conflict`.
38
38
  *
39
39
  * @param {NizamDashboard.CreateOrganizationRequest} request
40
40
  * @param {OrganizationsClient.RequestOptions} requestOptions - Request-specific configuration.
41
41
  *
42
+ * @throws {@link NizamDashboard.BadRequestError}
42
43
  * @throws {@link NizamDashboard.UnauthorizedError}
43
44
  * @throws {@link NizamDashboard.ForbiddenError}
44
45
  * @throws {@link NizamDashboard.ConflictError}
@@ -122,11 +122,12 @@ class OrganizationsClient {
122
122
  /**
123
123
  * Creates a brand-new tenant with the calling user as the founding admin. The id is assigned by Keycloak so the same value identifies the organization in both systems. Slug is derived from the name when not supplied.
124
124
  *
125
- * Supports the standard `Idempotency-Key` header — submit a UUID v4 per logical attempt (same value on retry). Cached responses replay for matching request bodies; mismatching fingerprints surface as 409 `idempotency.key_conflict`.
125
+ * Supports the standard `Idempotency-Key` header — submit a UUID (v4 recommended) per logical attempt (same value on retry); malformed keys are rejected with 400 `idempotency.invalid_key`. Successful responses and 4xx domain rejections replay for matching request bodies; transient 5xx responses are never cached, so retrying with the same key re-executes. Mismatching fingerprints surface as 409 `idempotency.key_conflict`.
126
126
  *
127
127
  * @param {NizamDashboard.CreateOrganizationRequest} request
128
128
  * @param {OrganizationsClient.RequestOptions} requestOptions - Request-specific configuration.
129
129
  *
130
+ * @throws {@link NizamDashboard.BadRequestError}
130
131
  * @throws {@link NizamDashboard.UnauthorizedError}
131
132
  * @throws {@link NizamDashboard.ForbiddenError}
132
133
  * @throws {@link NizamDashboard.ConflictError}
@@ -176,6 +177,8 @@ class OrganizationsClient {
176
177
  }
177
178
  if (_response.error.reason === "status-code") {
178
179
  switch (_response.error.statusCode) {
180
+ case 400:
181
+ throw new NizamDashboard.BadRequestError(_response.error.body, _response.rawResponse);
179
182
  case 401:
180
183
  throw new NizamDashboard.UnauthorizedError(_response.error.body, _response.rawResponse);
181
184
  case 403:
@@ -9,4 +9,13 @@ export interface ReconcileResponse {
9
9
  kc_has_nizam_missing?: string[] | undefined;
10
10
  /** Per-org membership-set divergences (KC vs Nizam). */
11
11
  membership_divergent?: NizamDashboard.MembershipDriftResponse[] | undefined;
12
+ /** Object type discriminator (Stripe pattern). */
13
+ object?: ReconcileResponse.Object_ | undefined;
14
+ }
15
+ export declare namespace ReconcileResponse {
16
+ /** Object type discriminator (Stripe pattern). */
17
+ const Object_: {
18
+ readonly KeycloakReconciliation: "keycloak_reconciliation";
19
+ };
20
+ type Object_ = (typeof Object_)[keyof typeof Object_];
12
21
  }
@@ -1,3 +1,11 @@
1
1
  "use strict";
2
2
  // This file was auto-generated by Fern from our API Definition.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.ReconcileResponse = void 0;
5
+ var ReconcileResponse;
6
+ (function (ReconcileResponse) {
7
+ /** Object type discriminator (Stripe pattern). */
8
+ ReconcileResponse.Object_ = {
9
+ KeycloakReconciliation: "keycloak_reconciliation",
10
+ };
11
+ })(ReconcileResponse || (exports.ReconcileResponse = ReconcileResponse = {}));
@@ -14,11 +14,19 @@ function anySignal(...args) {
14
14
  for (const signal of signals) {
15
15
  if (signal.aborted) {
16
16
  controller.abort(signal?.reason);
17
- break;
17
+ return controller.signal;
18
18
  }
19
19
  signal.addEventListener("abort", () => controller.abort(signal?.reason), {
20
20
  signal: controller.signal,
21
21
  });
22
+ // Re-check after adding listener: the signal may have aborted
23
+ // between the initial `signal.aborted` check and the `addEventListener`
24
+ // call above. If it did, the abort event was already dispatched and
25
+ // the listener will never fire — we must manually abort.
26
+ if (signal.aborted) {
27
+ controller.abort(signal?.reason);
28
+ return controller.signal;
29
+ }
22
30
  }
23
31
  return controller.signal;
24
32
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nizam-os/dashboard-sdk",
3
- "version": "6.0.0",
3
+ "version": "6.1.0",
4
4
  "description": "Nizam Dashboard API SDK for TypeScript / JavaScript.",
5
5
  "license": "MIT",
6
6
  "private": false,