@nizam-os/carrier-sdk 2.2.1 → 2.2.2
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/types/MembershipDriftResponse.d.ts +13 -0
- package/dist/api/types/MembershipDriftResponse.js +3 -0
- package/dist/api/types/Organization.d.ts +2 -0
- package/dist/api/types/ReconcileResponse.d.ts +12 -0
- package/dist/api/types/ReconcileResponse.js +3 -0
- package/dist/api/types/index.d.ts +2 -0
- package/dist/api/types/index.js +2 -0
- package/dist/core/fetcher/getResponseBody.js +11 -0
- package/package.json +1 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One org with divergent membership sets.
|
|
3
|
+
*/
|
|
4
|
+
export interface MembershipDriftResponse {
|
|
5
|
+
/** Nizam organization id. */
|
|
6
|
+
organization_id?: string | undefined;
|
|
7
|
+
/** Matching Keycloak organization id. */
|
|
8
|
+
keycloak_id?: string | undefined;
|
|
9
|
+
/** User ids present in the Nizam member set but not in KC. */
|
|
10
|
+
in_nizam_only?: string[] | undefined;
|
|
11
|
+
/** User ids present in the KC member set but not in Nizam. */
|
|
12
|
+
in_kc_only?: string[] | undefined;
|
|
13
|
+
}
|
|
@@ -16,6 +16,8 @@ export interface Organization {
|
|
|
16
16
|
owner_user_id?: string | undefined;
|
|
17
17
|
/** When this organization was created. */
|
|
18
18
|
created_at?: string | undefined;
|
|
19
|
+
/** Populated ONLY on the POST /v1/organizations create response — the active organization id Nizam pinned for the founder as part of the same transaction that created the org. Null on every other endpoint (GET, list, membership embeds). Per issue #67 phase 1, the SPA writes its active-org cookie from this field instead of issuing a follow-up PATCH /v1/me/active-organization. */
|
|
20
|
+
active_organization_id?: string | undefined;
|
|
19
21
|
/** Object type discriminator (Stripe pattern). */
|
|
20
22
|
object?: Organization.Object_ | undefined;
|
|
21
23
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type * as NizamCarrier from "../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Drift report for a single aggregate reconciliation.
|
|
4
|
+
*/
|
|
5
|
+
export interface ReconcileResponse {
|
|
6
|
+
/** Nizam org ids whose stored keycloak_id no longer resolves on the KC side. */
|
|
7
|
+
nizam_has_kc_missing?: string[] | undefined;
|
|
8
|
+
/** KC org ids with no matching Nizam organizations.keycloak_id row. */
|
|
9
|
+
kc_has_nizam_missing?: string[] | undefined;
|
|
10
|
+
/** Per-org membership-set divergences (KC vs Nizam). */
|
|
11
|
+
membership_divergent?: NizamCarrier.MembershipDriftResponse[] | undefined;
|
|
12
|
+
}
|
|
@@ -26,10 +26,12 @@ export * from "./ListResponseTimezone.js";
|
|
|
26
26
|
export * from "./ListResponseUserResource.js";
|
|
27
27
|
export * from "./Membership.js";
|
|
28
28
|
export * from "./MembershipChoice.js";
|
|
29
|
+
export * from "./MembershipDriftResponse.js";
|
|
29
30
|
export * from "./OpenAssignmentRequest.js";
|
|
30
31
|
export * from "./Operator.js";
|
|
31
32
|
export * from "./Organization.js";
|
|
32
33
|
export * from "./ProblemDetail.js";
|
|
34
|
+
export * from "./ReconcileResponse.js";
|
|
33
35
|
export * from "./SetActiveOrganizationRequest.js";
|
|
34
36
|
export * from "./Timezone.js";
|
|
35
37
|
export * from "./UpdateOrganizationRequest.js";
|
package/dist/api/types/index.js
CHANGED
|
@@ -42,10 +42,12 @@ __exportStar(require("./ListResponseTimezone.js"), exports);
|
|
|
42
42
|
__exportStar(require("./ListResponseUserResource.js"), exports);
|
|
43
43
|
__exportStar(require("./Membership.js"), exports);
|
|
44
44
|
__exportStar(require("./MembershipChoice.js"), exports);
|
|
45
|
+
__exportStar(require("./MembershipDriftResponse.js"), exports);
|
|
45
46
|
__exportStar(require("./OpenAssignmentRequest.js"), exports);
|
|
46
47
|
__exportStar(require("./Operator.js"), exports);
|
|
47
48
|
__exportStar(require("./Organization.js"), exports);
|
|
48
49
|
__exportStar(require("./ProblemDetail.js"), exports);
|
|
50
|
+
__exportStar(require("./ReconcileResponse.js"), exports);
|
|
49
51
|
__exportStar(require("./SetActiveOrganizationRequest.js"), exports);
|
|
50
52
|
__exportStar(require("./Timezone.js"), exports);
|
|
51
53
|
__exportStar(require("./UpdateOrganizationRequest.js"), exports);
|
|
@@ -3,6 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getResponseBody = getResponseBody;
|
|
4
4
|
const json_js_1 = require("../json.js");
|
|
5
5
|
const BinaryResponse_js_1 = require("./BinaryResponse.js");
|
|
6
|
+
// Pins the upstream Response so undici's FinalizationRegistry can't GC it and cancel the body stream.
|
|
7
|
+
function retainResponse(target, response) {
|
|
8
|
+
Object.defineProperty(target, "__fern_response_ref", {
|
|
9
|
+
value: response,
|
|
10
|
+
enumerable: false,
|
|
11
|
+
configurable: true,
|
|
12
|
+
writable: false,
|
|
13
|
+
});
|
|
14
|
+
}
|
|
6
15
|
async function getResponseBody(response, responseType) {
|
|
7
16
|
switch (responseType) {
|
|
8
17
|
case "binary-response":
|
|
@@ -21,6 +30,7 @@ async function getResponseBody(response, responseType) {
|
|
|
21
30
|
},
|
|
22
31
|
};
|
|
23
32
|
}
|
|
33
|
+
retainResponse(response.body, response);
|
|
24
34
|
return response.body;
|
|
25
35
|
case "streaming":
|
|
26
36
|
if (response.body == null) {
|
|
@@ -32,6 +42,7 @@ async function getResponseBody(response, responseType) {
|
|
|
32
42
|
},
|
|
33
43
|
};
|
|
34
44
|
}
|
|
45
|
+
retainResponse(response.body, response);
|
|
35
46
|
return response.body;
|
|
36
47
|
case "text":
|
|
37
48
|
return await response.text();
|