@nizam-os/dashboard-sdk 5.4.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.
- package/dist/api/resources/assets/client/Client.d.ts +1 -1
- package/dist/api/resources/assets/client/Client.js +1 -1
- package/dist/api/resources/organizations/client/Client.d.ts +2 -1
- package/dist/api/resources/organizations/client/Client.js +4 -1
- package/dist/api/resources/users/client/Client.d.ts +3 -2
- package/dist/api/resources/users/client/Client.js +3 -2
- package/dist/api/types/ReconcileResponse.d.ts +9 -0
- package/dist/api/types/ReconcileResponse.js +8 -0
- package/dist/core/fetcher/signals.js +9 -1
- package/package.json +1 -1
|
@@ -14,7 +14,7 @@ export declare class AssetsClient {
|
|
|
14
14
|
protected readonly _options: NormalizedClientOptionsWithAuth<AssetsClient.Options>;
|
|
15
15
|
constructor(options: AssetsClient.Options);
|
|
16
16
|
/**
|
|
17
|
-
* Without `q`: the org's assets ordered by `created_at` descending. With `q`: ranked
|
|
17
|
+
* Without `q`: the org's assets ordered by `created_at` descending. With `q`: ranked search across name, VIN, code, plate, serial, call sign, make, model and sub-kind — accent-insensitive and language-agnostic (epic #97). Matching is hybrid: whole words and word-prefixes (type-ahead — `pick` finds `Picker Bot 3`) plus substrings and typos (`ick`, or a misspelled `sprintr`, still match). Results are ordered by relevance and support forward-only cursors (`starting_after`). `highlight=true` adds a `<mark>`-wrapped match snippet.
|
|
18
18
|
*
|
|
19
19
|
* @param {NizamDashboard.ListAssetsRequest} request
|
|
20
20
|
* @param {AssetsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -50,7 +50,7 @@ class AssetsClient {
|
|
|
50
50
|
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
51
51
|
}
|
|
52
52
|
/**
|
|
53
|
-
* Without `q`: the org's assets ordered by `created_at` descending. With `q`: ranked
|
|
53
|
+
* Without `q`: the org's assets ordered by `created_at` descending. With `q`: ranked search across name, VIN, code, plate, serial, call sign, make, model and sub-kind — accent-insensitive and language-agnostic (epic #97). Matching is hybrid: whole words and word-prefixes (type-ahead — `pick` finds `Picker Bot 3`) plus substrings and typos (`ick`, or a misspelled `sprintr`, still match). Results are ordered by relevance and support forward-only cursors (`starting_after`). `highlight=true` adds a `<mark>`-wrapped match snippet.
|
|
54
54
|
*
|
|
55
55
|
* @param {NizamDashboard.ListAssetsRequest} request
|
|
56
56
|
* @param {AssetsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -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).
|
|
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).
|
|
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:
|
|
@@ -17,8 +17,9 @@ export declare class UsersClient {
|
|
|
17
17
|
* Returns the authenticated user merged with profile claims from their JWT.
|
|
18
18
|
*
|
|
19
19
|
* JIT-provisions a shadow row on the first call (so a brand-new Keycloak user can hit any
|
|
20
|
-
* endpoint without an explicit signup step)
|
|
21
|
-
* `login_count`
|
|
20
|
+
* endpoint without an explicit signup step). Records a login (`last_login_at` = the token's
|
|
21
|
+
* `auth_time`, `login_count` incremented) only when a genuinely new authentication is seen;
|
|
22
|
+
* repeated calls within the same session don't write.
|
|
22
23
|
*
|
|
23
24
|
* The `roles` array combines realm roles (flat, e.g. `platform_admin`) with portal-scoped
|
|
24
25
|
* client roles (prefixed, e.g. `dashboard:dispatcher`). The frontend usually drops the
|
|
@@ -53,8 +53,9 @@ class UsersClient {
|
|
|
53
53
|
* Returns the authenticated user merged with profile claims from their JWT.
|
|
54
54
|
*
|
|
55
55
|
* JIT-provisions a shadow row on the first call (so a brand-new Keycloak user can hit any
|
|
56
|
-
* endpoint without an explicit signup step)
|
|
57
|
-
* `login_count`
|
|
56
|
+
* endpoint without an explicit signup step). Records a login (`last_login_at` = the token's
|
|
57
|
+
* `auth_time`, `login_count` incremented) only when a genuinely new authentication is seen;
|
|
58
|
+
* repeated calls within the same session don't write.
|
|
58
59
|
*
|
|
59
60
|
* The `roles` array combines realm roles (flat, e.g. `platform_admin`) with portal-scoped
|
|
60
61
|
* client roles (prefixed, e.g. `dashboard:dispatcher`). The frontend usually drops the
|
|
@@ -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
|
-
|
|
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
|
}
|