@nizam-os/carrier-sdk 2.1.0 → 2.2.1

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.
@@ -0,0 +1,21 @@
1
+ import type * as NizamCarrier from "../index.js";
2
+ /**
3
+ * The caller's resolved active organization, stored preference, and full list of memberships.
4
+ */
5
+ export interface ActiveOrganization {
6
+ /** ID of the organization the request was actually scoped to. Null when the caller has no active memberships. */
7
+ active_organization_id?: string | undefined;
8
+ /** Stored preference (users.last_active_organization_id). Null when the user has never picked. */
9
+ preferred_organization_id?: string | undefined;
10
+ /** All active memberships for the picker UI. */
11
+ memberships?: NizamCarrier.MembershipChoice[] | undefined;
12
+ /** Object type discriminator (Stripe pattern). */
13
+ object?: ActiveOrganization.Object_ | undefined;
14
+ }
15
+ export declare namespace ActiveOrganization {
16
+ /** Object type discriminator (Stripe pattern). */
17
+ const Object_: {
18
+ readonly ActiveOrganization: "active_organization";
19
+ };
20
+ type Object_ = (typeof Object_)[keyof typeof Object_];
21
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.ActiveOrganization = void 0;
5
+ var ActiveOrganization;
6
+ (function (ActiveOrganization) {
7
+ /** Object type discriminator (Stripe pattern). */
8
+ ActiveOrganization.Object_ = {
9
+ ActiveOrganization: "active_organization",
10
+ };
11
+ })(ActiveOrganization || (exports.ActiveOrganization = ActiveOrganization = {}));
@@ -3,15 +3,14 @@ export interface CreateInviteRequest {
3
3
  organization_id: string;
4
4
  /** Recipient email. */
5
5
  email: string;
6
- /** Role the recipient will hold after acceptance. Lowercase enum names from MembershipRole. */
6
+ /** Role the recipient will hold after acceptance. */
7
7
  role: CreateInviteRequest.Role;
8
8
  /** TTL in days. Defaults to 7. */
9
9
  ttl_days?: number | undefined;
10
10
  }
11
11
  export declare namespace CreateInviteRequest {
12
- /** Role the recipient will hold after acceptance. Lowercase enum names from MembershipRole. */
12
+ /** Role the recipient will hold after acceptance. */
13
13
  const Role: {
14
- readonly SuperAdmin: "super_admin";
15
14
  readonly Admin: "admin";
16
15
  readonly Dispatcher: "dispatcher";
17
16
  readonly Manager: "manager";
@@ -4,9 +4,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.CreateInviteRequest = void 0;
5
5
  var CreateInviteRequest;
6
6
  (function (CreateInviteRequest) {
7
- /** Role the recipient will hold after acceptance. Lowercase enum names from MembershipRole. */
7
+ /** Role the recipient will hold after acceptance. */
8
8
  CreateInviteRequest.Role = {
9
- SuperAdmin: "super_admin",
10
9
  Admin: "admin",
11
10
  Dispatcher: "dispatcher",
12
11
  Manager: "manager",
@@ -22,7 +22,6 @@ export interface Invite {
22
22
  export declare namespace Invite {
23
23
  /** Role the recipient will hold after acceptance. */
24
24
  const Role: {
25
- readonly SuperAdmin: "super_admin";
26
25
  readonly Admin: "admin";
27
26
  readonly Dispatcher: "dispatcher";
28
27
  readonly Manager: "manager";
@@ -6,7 +6,6 @@ var Invite;
6
6
  (function (Invite) {
7
7
  /** Role the recipient will hold after acceptance. */
8
8
  Invite.Role = {
9
- SuperAdmin: "super_admin",
10
9
  Admin: "admin",
11
10
  Dispatcher: "dispatcher",
12
11
  Manager: "manager",
@@ -12,7 +12,6 @@ export interface Membership {
12
12
  export declare namespace Membership {
13
13
  /** The user's role in this organization. */
14
14
  const Role: {
15
- readonly SuperAdmin: "super_admin";
16
15
  readonly Admin: "admin";
17
16
  readonly Dispatcher: "dispatcher";
18
17
  readonly Manager: "manager";
@@ -6,7 +6,6 @@ var Membership;
6
6
  (function (Membership) {
7
7
  /** The user's role in this organization. */
8
8
  Membership.Role = {
9
- SuperAdmin: "super_admin",
10
9
  Admin: "admin",
11
10
  Dispatcher: "dispatcher",
12
11
  Manager: "manager",
@@ -0,0 +1,25 @@
1
+ /**
2
+ * One of the caller's active memberships — surfaced in the organization.select_required picker body.
3
+ */
4
+ export interface MembershipChoice {
5
+ /** Stable id of the organization. */
6
+ organization_id?: string | undefined;
7
+ /** URL-safe handle for the organization. */
8
+ slug?: string | undefined;
9
+ /** Display name. */
10
+ name?: string | undefined;
11
+ /** The caller's role in this organization. Lowercase enum names from MembershipRole. */
12
+ role?: MembershipChoice.Role | undefined;
13
+ }
14
+ export declare namespace MembershipChoice {
15
+ /** The caller's role in this organization. Lowercase enum names from MembershipRole. */
16
+ const Role: {
17
+ readonly Admin: "admin";
18
+ readonly Dispatcher: "dispatcher";
19
+ readonly Manager: "manager";
20
+ readonly Staff: "staff";
21
+ readonly Viewer: "viewer";
22
+ readonly BillingAdmin: "billing_admin";
23
+ };
24
+ type Role = (typeof Role)[keyof typeof Role];
25
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.MembershipChoice = void 0;
5
+ var MembershipChoice;
6
+ (function (MembershipChoice) {
7
+ /** The caller's role in this organization. Lowercase enum names from MembershipRole. */
8
+ MembershipChoice.Role = {
9
+ Admin: "admin",
10
+ Dispatcher: "dispatcher",
11
+ Manager: "manager",
12
+ Staff: "staff",
13
+ Viewer: "viewer",
14
+ BillingAdmin: "billing_admin",
15
+ };
16
+ })(MembershipChoice || (exports.MembershipChoice = MembershipChoice = {}));
@@ -2,7 +2,7 @@
2
2
  * A tenant — a logistics company, 3PL, or LSP.
3
3
  */
4
4
  export interface Organization {
5
- /** Stable UUID. Equal to the Keycloak Organization id. */
5
+ /** Stable UUID owned by Nizam. Pin this value in URLs and external integrations. The matching Keycloak Organization is tracked server-side via a separate keycloak_id bridge and is not exposed over the SDK; do not assume the two ids are equal. */
6
6
  id?: string | undefined;
7
7
  /** Display name. */
8
8
  name?: string | undefined;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Request body for setting the caller's preferred active organization. The slug must name an organization the caller is currently an active member of.
3
+ */
4
+ export interface SetActiveOrganizationRequest {
5
+ /** Slug of the organization to make active. Must match an active membership. */
6
+ slug: string;
7
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +1,4 @@
1
+ export * from "./ActiveOrganization.js";
1
2
  export * from "./ApiFieldError.js";
2
3
  export * from "./Asset.js";
3
4
  export * from "./Assignment.js";
@@ -24,10 +25,12 @@ export * from "./ListResponseMembership.js";
24
25
  export * from "./ListResponseTimezone.js";
25
26
  export * from "./ListResponseUserResource.js";
26
27
  export * from "./Membership.js";
28
+ export * from "./MembershipChoice.js";
27
29
  export * from "./OpenAssignmentRequest.js";
28
30
  export * from "./Operator.js";
29
31
  export * from "./Organization.js";
30
32
  export * from "./ProblemDetail.js";
33
+ export * from "./SetActiveOrganizationRequest.js";
31
34
  export * from "./Timezone.js";
32
35
  export * from "./UpdateOrganizationRequest.js";
33
36
  export * from "./User.js";
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./ActiveOrganization.js"), exports);
17
18
  __exportStar(require("./ApiFieldError.js"), exports);
18
19
  __exportStar(require("./Asset.js"), exports);
19
20
  __exportStar(require("./Assignment.js"), exports);
@@ -40,10 +41,12 @@ __exportStar(require("./ListResponseMembership.js"), exports);
40
41
  __exportStar(require("./ListResponseTimezone.js"), exports);
41
42
  __exportStar(require("./ListResponseUserResource.js"), exports);
42
43
  __exportStar(require("./Membership.js"), exports);
44
+ __exportStar(require("./MembershipChoice.js"), exports);
43
45
  __exportStar(require("./OpenAssignmentRequest.js"), exports);
44
46
  __exportStar(require("./Operator.js"), exports);
45
47
  __exportStar(require("./Organization.js"), exports);
46
48
  __exportStar(require("./ProblemDetail.js"), exports);
49
+ __exportStar(require("./SetActiveOrganizationRequest.js"), exports);
47
50
  __exportStar(require("./Timezone.js"), exports);
48
51
  __exportStar(require("./UpdateOrganizationRequest.js"), exports);
49
52
  __exportStar(require("./User.js"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nizam-os/carrier-sdk",
3
- "version": "2.1.0",
3
+ "version": "2.2.1",
4
4
  "description": "Nizam Carrier API SDK for TypeScript / JavaScript.",
5
5
  "license": "MIT",
6
6
  "private": false,