@nizam-os/dashboard-sdk 2.0.0 → 4.0.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.
Files changed (60) hide show
  1. package/dist/Client.d.ts +8 -5
  2. package/dist/Client.js +13 -9
  3. package/dist/api/resources/index.d.ts +4 -2
  4. package/dist/api/resources/index.js +5 -3
  5. package/dist/api/resources/invites/client/Client.d.ts +1 -1
  6. package/dist/api/resources/invites/client/Client.js +1 -1
  7. package/dist/api/resources/invites/client/requests/CreateInviteRequest.d.ts +3 -4
  8. package/dist/api/resources/invites/client/requests/CreateInviteRequest.js +1 -2
  9. package/dist/api/resources/memberships/client/Client.d.ts +52 -0
  10. package/dist/api/resources/memberships/client/Client.js +181 -0
  11. package/dist/api/resources/memberships/client/requests/ListMyMembershipsRequest.d.ts +15 -0
  12. package/dist/api/resources/memberships/client/requests/index.d.ts +2 -0
  13. package/dist/api/resources/memberships/exports.d.ts +2 -0
  14. package/dist/api/resources/memberships/exports.js +21 -0
  15. package/dist/api/resources/organizations/client/Client.d.ts +1 -34
  16. package/dist/api/resources/organizations/client/Client.js +1 -118
  17. package/dist/api/resources/organizations/client/requests/index.d.ts +0 -1
  18. package/dist/api/resources/{identity → users}/client/Client.d.ts +24 -21
  19. package/dist/api/resources/{identity → users}/client/Client.js +22 -18
  20. package/dist/api/resources/users/client/index.d.ts +1 -0
  21. package/dist/api/resources/users/client/index.js +17 -0
  22. package/dist/api/resources/users/client/requests/ListUsersRequest.d.ts +17 -0
  23. package/dist/api/resources/users/client/requests/UserUpdateRequest.js +3 -0
  24. package/dist/api/resources/users/client/requests/index.js +2 -0
  25. package/dist/api/resources/users/exports.d.ts +2 -0
  26. package/dist/api/resources/{identity → users}/exports.js +2 -2
  27. package/dist/api/resources/users/index.d.ts +1 -0
  28. package/dist/api/resources/users/index.js +17 -0
  29. package/dist/api/types/Invite.d.ts +0 -1
  30. package/dist/api/types/Invite.js +0 -1
  31. package/dist/api/types/ListResponseBusinessCategory.d.ts +4 -0
  32. package/dist/api/types/ListResponseCountry.d.ts +4 -0
  33. package/dist/api/types/ListResponseCurrency.d.ts +4 -0
  34. package/dist/api/types/ListResponseLanguage.d.ts +4 -0
  35. package/dist/api/types/ListResponseMembership.d.ts +27 -0
  36. package/dist/api/types/ListResponseMembership.js +11 -0
  37. package/dist/api/types/ListResponseTimezone.d.ts +4 -0
  38. package/dist/api/types/ListResponseUserResource.d.ts +4 -0
  39. package/dist/api/types/{OrganizationMembership.d.ts → Membership.d.ts} +5 -6
  40. package/dist/api/types/{OrganizationMembership.js → Membership.js} +7 -8
  41. package/dist/api/types/index.d.ts +2 -1
  42. package/dist/api/types/index.js +2 -1
  43. package/package.json +1 -1
  44. package/dist/api/resources/identity/client/requests/ListUsersRequest.d.ts +0 -10
  45. package/dist/api/resources/identity/exports.d.ts +0 -2
  46. /package/dist/api/resources/{identity → memberships}/client/index.d.ts +0 -0
  47. /package/dist/api/resources/{identity → memberships}/client/index.js +0 -0
  48. /package/dist/api/resources/{organizations → memberships}/client/requests/LeaveOrganizationRequest.d.ts +0 -0
  49. /package/dist/api/resources/{organizations → memberships}/client/requests/LeaveOrganizationRequest.js +0 -0
  50. /package/dist/api/resources/{identity/client/requests/InviteUserRequest.js → memberships/client/requests/ListMyMembershipsRequest.js} +0 -0
  51. /package/dist/api/resources/{identity → memberships}/client/requests/index.js +0 -0
  52. /package/dist/api/resources/{identity → memberships}/index.d.ts +0 -0
  53. /package/dist/api/resources/{identity → memberships}/index.js +0 -0
  54. /package/dist/api/resources/{identity → users}/client/requests/InviteUserRequest.d.ts +0 -0
  55. /package/dist/api/resources/{identity/client/requests/ListUsersRequest.js → users/client/requests/InviteUserRequest.js} +0 -0
  56. /package/dist/api/resources/{identity/client/requests/SoftDeleteUserRequest.js → users/client/requests/ListUsersRequest.js} +0 -0
  57. /package/dist/api/resources/{identity → users}/client/requests/SoftDeleteUserRequest.d.ts +0 -0
  58. /package/dist/api/resources/{identity/client/requests/UserUpdateRequest.js → users/client/requests/SoftDeleteUserRequest.js} +0 -0
  59. /package/dist/api/resources/{identity → users}/client/requests/UserUpdateRequest.d.ts +0 -0
  60. /package/dist/api/resources/{identity → users}/client/requests/index.d.ts +0 -0
@@ -43,67 +43,12 @@ const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatu
43
43
  const errors = __importStar(require("../../../../errors/index.js"));
44
44
  const NizamDashboard = __importStar(require("../../../index.js"));
45
45
  /**
46
- * Tenantsthe top-level container for users, merchants, and operations.
46
+ * Organization aggregate tenant CRUD.
47
47
  */
48
48
  class OrganizationsClient {
49
49
  constructor(options) {
50
50
  this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
51
51
  }
52
- /**
53
- * Returns every organization the calling user is a member of, with their role inside.
54
- *
55
- * @param {OrganizationsClient.RequestOptions} requestOptions - Request-specific configuration.
56
- *
57
- * @throws {@link NizamDashboard.UnauthorizedError}
58
- * @throws {@link NizamDashboard.ForbiddenError}
59
- * @throws {@link NizamDashboard.InternalServerError}
60
- *
61
- * @example
62
- * await client.organizations.listMyOrganizations()
63
- */
64
- listMyOrganizations(requestOptions) {
65
- return core.HttpResponsePromise.fromPromise(this.__listMyOrganizations(requestOptions));
66
- }
67
- async __listMyOrganizations(requestOptions) {
68
- const _authRequest = await this._options.authProvider.getAuthRequest();
69
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, requestOptions?.headers);
70
- const _response = await core.fetcher({
71
- url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
72
- (await core.Supplier.get(this._options.environment)) ??
73
- environments.NizamDashboardEnvironment.Production, "v1/me/organizations"),
74
- method: "GET",
75
- headers: _headers,
76
- queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
77
- timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
78
- maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
79
- abortSignal: requestOptions?.abortSignal,
80
- fetchFn: this._options?.fetch,
81
- logging: this._options.logging,
82
- });
83
- if (_response.ok) {
84
- return {
85
- data: _response.body,
86
- rawResponse: _response.rawResponse,
87
- };
88
- }
89
- if (_response.error.reason === "status-code") {
90
- switch (_response.error.statusCode) {
91
- case 401:
92
- throw new NizamDashboard.UnauthorizedError(_response.error.body, _response.rawResponse);
93
- case 403:
94
- throw new NizamDashboard.ForbiddenError(_response.error.body, _response.rawResponse);
95
- case 500:
96
- throw new NizamDashboard.InternalServerError(_response.error.body, _response.rawResponse);
97
- default:
98
- throw new errors.NizamDashboardError({
99
- statusCode: _response.error.statusCode,
100
- body: _response.error.body,
101
- rawResponse: _response.rawResponse,
102
- });
103
- }
104
- }
105
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v1/me/organizations");
106
- }
107
52
  /**
108
53
  * 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.
109
54
  *
@@ -366,67 +311,5 @@ class OrganizationsClient {
366
311
  }
367
312
  return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PATCH", "/v1/organizations/{id}");
368
313
  }
369
- /**
370
- * Removes the caller's membership from the organization. The owner cannot leave — they must transfer ownership (future endpoint) or delete the org instead.
371
- *
372
- * @param {NizamDashboard.LeaveOrganizationRequest} request
373
- * @param {OrganizationsClient.RequestOptions} requestOptions - Request-specific configuration.
374
- *
375
- * @throws {@link NizamDashboard.UnauthorizedError}
376
- * @throws {@link NizamDashboard.ForbiddenError}
377
- * @throws {@link NizamDashboard.NotFoundError}
378
- * @throws {@link NizamDashboard.ConflictError}
379
- * @throws {@link NizamDashboard.InternalServerError}
380
- *
381
- * @example
382
- * await client.organizations.leaveOrganization({
383
- * id: "00000000-0000-0000-0000-000000000000"
384
- * })
385
- */
386
- leaveOrganization(request, requestOptions) {
387
- return core.HttpResponsePromise.fromPromise(this.__leaveOrganization(request, requestOptions));
388
- }
389
- async __leaveOrganization(request, requestOptions) {
390
- const { id } = request;
391
- const _authRequest = await this._options.authProvider.getAuthRequest();
392
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, requestOptions?.headers);
393
- const _response = await core.fetcher({
394
- url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
395
- (await core.Supplier.get(this._options.environment)) ??
396
- environments.NizamDashboardEnvironment.Production, `v1/organizations/${core.url.encodePathParam(id)}/members/me`),
397
- method: "DELETE",
398
- headers: _headers,
399
- queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
400
- timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
401
- maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
402
- abortSignal: requestOptions?.abortSignal,
403
- fetchFn: this._options?.fetch,
404
- logging: this._options.logging,
405
- });
406
- if (_response.ok) {
407
- return { data: undefined, rawResponse: _response.rawResponse };
408
- }
409
- if (_response.error.reason === "status-code") {
410
- switch (_response.error.statusCode) {
411
- case 401:
412
- throw new NizamDashboard.UnauthorizedError(_response.error.body, _response.rawResponse);
413
- case 403:
414
- throw new NizamDashboard.ForbiddenError(_response.error.body, _response.rawResponse);
415
- case 404:
416
- throw new NizamDashboard.NotFoundError(_response.error.body, _response.rawResponse);
417
- case 409:
418
- throw new NizamDashboard.ConflictError(_response.error.body, _response.rawResponse);
419
- case 500:
420
- throw new NizamDashboard.InternalServerError(_response.error.body, _response.rawResponse);
421
- default:
422
- throw new errors.NizamDashboardError({
423
- statusCode: _response.error.statusCode,
424
- body: _response.error.body,
425
- rawResponse: _response.rawResponse,
426
- });
427
- }
428
- }
429
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/v1/organizations/{id}/members/me");
430
- }
431
314
  }
432
315
  exports.OrganizationsClient = OrganizationsClient;
@@ -1,5 +1,4 @@
1
1
  export type { CreateOrganizationRequest } from "./CreateOrganizationRequest.js";
2
2
  export type { DeleteOrganizationRequest } from "./DeleteOrganizationRequest.js";
3
3
  export type { GetOrganizationRequest } from "./GetOrganizationRequest.js";
4
- export type { LeaveOrganizationRequest } from "./LeaveOrganizationRequest.js";
5
4
  export type { UpdateOrganizationRequest } from "./UpdateOrganizationRequest.js";
@@ -2,17 +2,17 @@ import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClie
2
2
  import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js";
3
3
  import * as core from "../../../../core/index.js";
4
4
  import * as NizamDashboard from "../../../index.js";
5
- export declare namespace IdentityClient {
5
+ export declare namespace UsersClient {
6
6
  type Options = BaseClientOptions;
7
7
  interface RequestOptions extends BaseRequestOptions {
8
8
  }
9
9
  }
10
10
  /**
11
- * Users, organizations, and the active session.
11
+ * User aggregate — current session (`/me`) and user-entity operations (invite, list, lifecycle, platform-staff admin).
12
12
  */
13
- export declare class IdentityClient {
14
- protected readonly _options: NormalizedClientOptionsWithAuth<IdentityClient.Options>;
15
- constructor(options: IdentityClient.Options);
13
+ export declare class UsersClient {
14
+ protected readonly _options: NormalizedClientOptionsWithAuth<UsersClient.Options>;
15
+ constructor(options: UsersClient.Options);
16
16
  /**
17
17
  * Returns the authenticated user merged with profile claims from their JWT.
18
18
  *
@@ -24,7 +24,7 @@ export declare class IdentityClient {
24
24
  * client roles (prefixed, e.g. `dashboard:dispatcher`). The frontend usually drops the
25
25
  * portal prefix when rendering since it knows its own portal.
26
26
  *
27
- * @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
27
+ * @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
28
28
  *
29
29
  * @throws {@link NizamDashboard.UnauthorizedError}
30
30
  * @throws {@link NizamDashboard.ForbiddenError}
@@ -32,15 +32,15 @@ export declare class IdentityClient {
32
32
  * @throws {@link NizamDashboard.InternalServerError}
33
33
  *
34
34
  * @example
35
- * await client.identity.me()
35
+ * await client.users.me()
36
36
  */
37
- me(requestOptions?: IdentityClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.User>;
37
+ me(requestOptions?: UsersClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.User>;
38
38
  private __me;
39
39
  /**
40
- * Dashboard sees co-members of the caller's active organization (tenant-scoped via the organization_users join). Platform staff bypass RLS and see across tenants, and may sort by `deleted_at`.
40
+ * Dashboard sees co-members of the caller's active organization (tenant-scoped via the organization_users join). Platform staff bypass RLS and see across tenants, and may sort by `deleted_at`. RFC 8288 Link header carries `first`, `prev`, `next` rels alongside the body's bidirectional cursors.
41
41
  *
42
42
  * @param {NizamDashboard.ListUsersRequest} request
43
- * @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
43
+ * @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
44
44
  *
45
45
  * @throws {@link NizamDashboard.BadRequestError}
46
46
  * @throws {@link NizamDashboard.UnauthorizedError}
@@ -48,15 +48,18 @@ export declare class IdentityClient {
48
48
  * @throws {@link NizamDashboard.InternalServerError}
49
49
  *
50
50
  * @example
51
- * await client.identity.listUsers()
51
+ * await client.users.listUsers({
52
+ * starting_after: "Y3Vyc29yX25leHRfMDFKNVE=",
53
+ * ending_before: "Y3Vyc29yX25leHRfMDFKNVE="
54
+ * })
52
55
  */
53
- listUsers(request?: NizamDashboard.ListUsersRequest, requestOptions?: IdentityClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.ListResponseUserResource>;
56
+ listUsers(request?: NizamDashboard.ListUsersRequest, requestOptions?: UsersClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.ListResponseUserResource>;
54
57
  private __listUsers;
55
58
  /**
56
59
  * Tenant-admin operation. Creates a placeholder User row that JIT provisioning replaces once the recipient completes Keycloak signup.
57
60
  *
58
61
  * @param {NizamDashboard.InviteUserRequest} request
59
- * @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
62
+ * @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
60
63
  *
61
64
  * @throws {@link NizamDashboard.UnauthorizedError}
62
65
  * @throws {@link NizamDashboard.ForbiddenError}
@@ -65,18 +68,18 @@ export declare class IdentityClient {
65
68
  * @throws {@link NizamDashboard.InternalServerError}
66
69
  *
67
70
  * @example
68
- * await client.identity.inviteUser({
71
+ * await client.users.inviteUser({
69
72
  * email: "newhire@acme.example",
70
73
  * name: "New Hire"
71
74
  * })
72
75
  */
73
- inviteUser(request: NizamDashboard.InviteUserRequest, requestOptions?: IdentityClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.UserResource>;
76
+ inviteUser(request: NizamDashboard.InviteUserRequest, requestOptions?: UsersClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.UserResource>;
74
77
  private __inviteUser;
75
78
  /**
76
79
  * Tenant-admin operation. Sets `deleted_at = NOW()`. Subsequent dashboard reads filter the row out; platform staff can still surface and act on it.
77
80
  *
78
81
  * @param {NizamDashboard.SoftDeleteUserRequest} request
79
- * @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
82
+ * @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
80
83
  *
81
84
  * @throws {@link NizamDashboard.UnauthorizedError}
82
85
  * @throws {@link NizamDashboard.ForbiddenError}
@@ -84,17 +87,17 @@ export declare class IdentityClient {
84
87
  * @throws {@link NizamDashboard.InternalServerError}
85
88
  *
86
89
  * @example
87
- * await client.identity.softDeleteUser({
90
+ * await client.users.softDeleteUser({
88
91
  * id: "00000000-0000-0000-0000-000000000000"
89
92
  * })
90
93
  */
91
- softDeleteUser(request: NizamDashboard.SoftDeleteUserRequest, requestOptions?: IdentityClient.RequestOptions): core.HttpResponsePromise<void>;
94
+ softDeleteUser(request: NizamDashboard.SoftDeleteUserRequest, requestOptions?: UsersClient.RequestOptions): core.HttpResponsePromise<void>;
92
95
  private __softDeleteUser;
93
96
  /**
94
97
  * Tenant-admin operation. Body has no `status` — lifecycle changes go through the platform-staff surface.
95
98
  *
96
99
  * @param {NizamDashboard.UserUpdateRequest} request
97
- * @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
100
+ * @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
98
101
  *
99
102
  * @throws {@link NizamDashboard.UnauthorizedError}
100
103
  * @throws {@link NizamDashboard.ForbiddenError}
@@ -104,12 +107,12 @@ export declare class IdentityClient {
104
107
  * @throws {@link NizamDashboard.InternalServerError}
105
108
  *
106
109
  * @example
107
- * await client.identity.updateUser({
110
+ * await client.users.updateUser({
108
111
  * id: "00000000-0000-0000-0000-000000000000",
109
112
  * email: "renamed@acme.example",
110
113
  * name: "Ali Issa"
111
114
  * })
112
115
  */
113
- updateUser(request: NizamDashboard.UserUpdateRequest, requestOptions?: IdentityClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.UserResource>;
116
+ updateUser(request: NizamDashboard.UserUpdateRequest, requestOptions?: UsersClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.UserResource>;
114
117
  private __updateUser;
115
118
  }
@@ -34,7 +34,7 @@ var __importStar = (this && this.__importStar) || (function () {
34
34
  };
35
35
  })();
36
36
  Object.defineProperty(exports, "__esModule", { value: true });
37
- exports.IdentityClient = void 0;
37
+ exports.UsersClient = void 0;
38
38
  const BaseClient_js_1 = require("../../../../BaseClient.js");
39
39
  const headers_js_1 = require("../../../../core/headers.js");
40
40
  const core = __importStar(require("../../../../core/index.js"));
@@ -43,9 +43,9 @@ const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatu
43
43
  const errors = __importStar(require("../../../../errors/index.js"));
44
44
  const NizamDashboard = __importStar(require("../../../index.js"));
45
45
  /**
46
- * Users, organizations, and the active session.
46
+ * User aggregate — current session (`/me`) and user-entity operations (invite, list, lifecycle, platform-staff admin).
47
47
  */
48
- class IdentityClient {
48
+ class UsersClient {
49
49
  constructor(options) {
50
50
  this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
51
51
  }
@@ -60,7 +60,7 @@ class IdentityClient {
60
60
  * client roles (prefixed, e.g. `dashboard:dispatcher`). The frontend usually drops the
61
61
  * portal prefix when rendering since it knows its own portal.
62
62
  *
63
- * @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
63
+ * @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
64
64
  *
65
65
  * @throws {@link NizamDashboard.UnauthorizedError}
66
66
  * @throws {@link NizamDashboard.ForbiddenError}
@@ -68,7 +68,7 @@ class IdentityClient {
68
68
  * @throws {@link NizamDashboard.InternalServerError}
69
69
  *
70
70
  * @example
71
- * await client.identity.me()
71
+ * await client.users.me()
72
72
  */
73
73
  me(requestOptions) {
74
74
  return core.HttpResponsePromise.fromPromise(this.__me(requestOptions));
@@ -113,10 +113,10 @@ class IdentityClient {
113
113
  return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v1/me");
114
114
  }
115
115
  /**
116
- * Dashboard sees co-members of the caller's active organization (tenant-scoped via the organization_users join). Platform staff bypass RLS and see across tenants, and may sort by `deleted_at`.
116
+ * Dashboard sees co-members of the caller's active organization (tenant-scoped via the organization_users join). Platform staff bypass RLS and see across tenants, and may sort by `deleted_at`. RFC 8288 Link header carries `first`, `prev`, `next` rels alongside the body's bidirectional cursors.
117
117
  *
118
118
  * @param {NizamDashboard.ListUsersRequest} request
119
- * @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
119
+ * @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
120
120
  *
121
121
  * @throws {@link NizamDashboard.BadRequestError}
122
122
  * @throws {@link NizamDashboard.UnauthorizedError}
@@ -124,17 +124,21 @@ class IdentityClient {
124
124
  * @throws {@link NizamDashboard.InternalServerError}
125
125
  *
126
126
  * @example
127
- * await client.identity.listUsers()
127
+ * await client.users.listUsers({
128
+ * starting_after: "Y3Vyc29yX25leHRfMDFKNVE=",
129
+ * ending_before: "Y3Vyc29yX25leHRfMDFKNVE="
130
+ * })
128
131
  */
129
132
  listUsers(request = {}, requestOptions) {
130
133
  return core.HttpResponsePromise.fromPromise(this.__listUsers(request, requestOptions));
131
134
  }
132
135
  async __listUsers(request = {}, requestOptions) {
133
- const { limit, offset, sort } = request;
136
+ const { sort, limit, starting_after: startingAfter, ending_before: endingBefore } = request;
134
137
  const _queryParams = {
135
- limit,
136
- offset,
137
138
  sort,
139
+ limit,
140
+ starting_after: startingAfter,
141
+ ending_before: endingBefore,
138
142
  };
139
143
  const _authRequest = await this._options.authProvider.getAuthRequest();
140
144
  const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, requestOptions?.headers);
@@ -185,7 +189,7 @@ class IdentityClient {
185
189
  * Tenant-admin operation. Creates a placeholder User row that JIT provisioning replaces once the recipient completes Keycloak signup.
186
190
  *
187
191
  * @param {NizamDashboard.InviteUserRequest} request
188
- * @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
192
+ * @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
189
193
  *
190
194
  * @throws {@link NizamDashboard.UnauthorizedError}
191
195
  * @throws {@link NizamDashboard.ForbiddenError}
@@ -194,7 +198,7 @@ class IdentityClient {
194
198
  * @throws {@link NizamDashboard.InternalServerError}
195
199
  *
196
200
  * @example
197
- * await client.identity.inviteUser({
201
+ * await client.users.inviteUser({
198
202
  * email: "newhire@acme.example",
199
203
  * name: "New Hire"
200
204
  * })
@@ -250,7 +254,7 @@ class IdentityClient {
250
254
  * Tenant-admin operation. Sets `deleted_at = NOW()`. Subsequent dashboard reads filter the row out; platform staff can still surface and act on it.
251
255
  *
252
256
  * @param {NizamDashboard.SoftDeleteUserRequest} request
253
- * @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
257
+ * @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
254
258
  *
255
259
  * @throws {@link NizamDashboard.UnauthorizedError}
256
260
  * @throws {@link NizamDashboard.ForbiddenError}
@@ -258,7 +262,7 @@ class IdentityClient {
258
262
  * @throws {@link NizamDashboard.InternalServerError}
259
263
  *
260
264
  * @example
261
- * await client.identity.softDeleteUser({
265
+ * await client.users.softDeleteUser({
262
266
  * id: "00000000-0000-0000-0000-000000000000"
263
267
  * })
264
268
  */
@@ -309,7 +313,7 @@ class IdentityClient {
309
313
  * Tenant-admin operation. Body has no `status` — lifecycle changes go through the platform-staff surface.
310
314
  *
311
315
  * @param {NizamDashboard.UserUpdateRequest} request
312
- * @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
316
+ * @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
313
317
  *
314
318
  * @throws {@link NizamDashboard.UnauthorizedError}
315
319
  * @throws {@link NizamDashboard.ForbiddenError}
@@ -319,7 +323,7 @@ class IdentityClient {
319
323
  * @throws {@link NizamDashboard.InternalServerError}
320
324
  *
321
325
  * @example
322
- * await client.identity.updateUser({
326
+ * await client.users.updateUser({
323
327
  * id: "00000000-0000-0000-0000-000000000000",
324
328
  * email: "renamed@acme.example",
325
329
  * name: "Ali Issa"
@@ -376,4 +380,4 @@ class IdentityClient {
376
380
  return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PATCH", "/v1/users/{id}");
377
381
  }
378
382
  }
379
- exports.IdentityClient = IdentityClient;
383
+ exports.UsersClient = UsersClient;
@@ -0,0 +1 @@
1
+ export * from "./requests/index.js";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./requests/index.js"), exports);
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * starting_after: "Y3Vyc29yX25leHRfMDFKNVE=",
5
+ * ending_before: "Y3Vyc29yX25leHRfMDFKNVE="
6
+ * }
7
+ */
8
+ export interface ListUsersRequest {
9
+ /** Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported. */
10
+ sort?: string | string[];
11
+ /** Page size. Default 20, maximum 100. Out-of-range values are silently clamped; the response body's `limit` field reflects what was applied. */
12
+ limit?: number;
13
+ /** Opaque cursor — return the page starting strictly after this entity in the sort order. Mutually exclusive with `ending_before`. */
14
+ starting_after?: string;
15
+ /** Opaque cursor — return the page ending strictly before this entity in the sort order. Mutually exclusive with `starting_after`. */
16
+ ending_before?: string;
17
+ }
@@ -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 });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export { UsersClient } from "./client/Client.js";
2
+ export * from "./client/index.js";
@@ -15,7 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
16
16
  };
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.IdentityClient = void 0;
18
+ exports.UsersClient = void 0;
19
19
  var Client_js_1 = require("./client/Client.js");
20
- Object.defineProperty(exports, "IdentityClient", { enumerable: true, get: function () { return Client_js_1.IdentityClient; } });
20
+ Object.defineProperty(exports, "UsersClient", { enumerable: true, get: function () { return Client_js_1.UsersClient; } });
21
21
  __exportStar(require("./client/index.js"), exports);
@@ -0,0 +1 @@
1
+ export * from "./client/index.js";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./client/index.js"), exports);
@@ -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",
@@ -9,8 +9,12 @@ export interface ListResponseBusinessCategory {
9
9
  data?: NizamDashboard.BusinessCategory[] | undefined;
10
10
  /** True when more pages exist; pass `next_cursor` as `?starting_after=` to fetch the next page. */
11
11
  has_more?: boolean | undefined;
12
+ /** True when earlier pages exist; pass `prev_cursor` as `?ending_before=` to fetch the previous page. */
13
+ has_previous?: boolean | undefined;
12
14
  /** Opaque cursor for the next page. `null` on the last page. */
13
15
  next_cursor?: string | undefined;
16
+ /** Opaque cursor for the previous page. `null` on the first page. */
17
+ prev_cursor?: string | undefined;
14
18
  /** Page size that produced this response. */
15
19
  limit?: number | undefined;
16
20
  }
@@ -9,8 +9,12 @@ export interface ListResponseCountry {
9
9
  data?: NizamDashboard.Country[] | undefined;
10
10
  /** True when more pages exist; pass `next_cursor` as `?starting_after=` to fetch the next page. */
11
11
  has_more?: boolean | undefined;
12
+ /** True when earlier pages exist; pass `prev_cursor` as `?ending_before=` to fetch the previous page. */
13
+ has_previous?: boolean | undefined;
12
14
  /** Opaque cursor for the next page. `null` on the last page. */
13
15
  next_cursor?: string | undefined;
16
+ /** Opaque cursor for the previous page. `null` on the first page. */
17
+ prev_cursor?: string | undefined;
14
18
  /** Page size that produced this response. */
15
19
  limit?: number | undefined;
16
20
  }
@@ -9,8 +9,12 @@ export interface ListResponseCurrency {
9
9
  data?: NizamDashboard.Currency[] | undefined;
10
10
  /** True when more pages exist; pass `next_cursor` as `?starting_after=` to fetch the next page. */
11
11
  has_more?: boolean | undefined;
12
+ /** True when earlier pages exist; pass `prev_cursor` as `?ending_before=` to fetch the previous page. */
13
+ has_previous?: boolean | undefined;
12
14
  /** Opaque cursor for the next page. `null` on the last page. */
13
15
  next_cursor?: string | undefined;
16
+ /** Opaque cursor for the previous page. `null` on the first page. */
17
+ prev_cursor?: string | undefined;
14
18
  /** Page size that produced this response. */
15
19
  limit?: number | undefined;
16
20
  }
@@ -9,8 +9,12 @@ export interface ListResponseLanguage {
9
9
  data?: NizamDashboard.Language[] | undefined;
10
10
  /** True when more pages exist; pass `next_cursor` as `?starting_after=` to fetch the next page. */
11
11
  has_more?: boolean | undefined;
12
+ /** True when earlier pages exist; pass `prev_cursor` as `?ending_before=` to fetch the previous page. */
13
+ has_previous?: boolean | undefined;
12
14
  /** Opaque cursor for the next page. `null` on the last page. */
13
15
  next_cursor?: string | undefined;
16
+ /** Opaque cursor for the previous page. `null` on the first page. */
17
+ prev_cursor?: string | undefined;
14
18
  /** Page size that produced this response. */
15
19
  limit?: number | undefined;
16
20
  }
@@ -0,0 +1,27 @@
1
+ import type * as NizamDashboard from "../index.js";
2
+ /**
3
+ * Envelope for paginated list responses (Stripe-style cursor pagination).
4
+ */
5
+ export interface ListResponseMembership {
6
+ /** Object type discriminator (Stripe pattern). Always `list` for this envelope. */
7
+ object?: ListResponseMembership.Object_ | undefined;
8
+ /** Page of resources. Empty array when there are no matches. */
9
+ data?: NizamDashboard.Membership[] | undefined;
10
+ /** True when more pages exist; pass `next_cursor` as `?starting_after=` to fetch the next page. */
11
+ has_more?: boolean | undefined;
12
+ /** True when earlier pages exist; pass `prev_cursor` as `?ending_before=` to fetch the previous page. */
13
+ has_previous?: boolean | undefined;
14
+ /** Opaque cursor for the next page. `null` on the last page. */
15
+ next_cursor?: string | undefined;
16
+ /** Opaque cursor for the previous page. `null` on the first page. */
17
+ prev_cursor?: string | undefined;
18
+ /** Page size that produced this response. */
19
+ limit?: number | undefined;
20
+ }
21
+ export declare namespace ListResponseMembership {
22
+ /** Object type discriminator (Stripe pattern). Always `list` for this envelope. */
23
+ const Object_: {
24
+ readonly List: "list";
25
+ };
26
+ type Object_ = (typeof Object_)[keyof typeof Object_];
27
+ }
@@ -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.ListResponseMembership = void 0;
5
+ var ListResponseMembership;
6
+ (function (ListResponseMembership) {
7
+ /** Object type discriminator (Stripe pattern). Always `list` for this envelope. */
8
+ ListResponseMembership.Object_ = {
9
+ List: "list",
10
+ };
11
+ })(ListResponseMembership || (exports.ListResponseMembership = ListResponseMembership = {}));
@@ -9,8 +9,12 @@ export interface ListResponseTimezone {
9
9
  data?: NizamDashboard.Timezone[] | undefined;
10
10
  /** True when more pages exist; pass `next_cursor` as `?starting_after=` to fetch the next page. */
11
11
  has_more?: boolean | undefined;
12
+ /** True when earlier pages exist; pass `prev_cursor` as `?ending_before=` to fetch the previous page. */
13
+ has_previous?: boolean | undefined;
12
14
  /** Opaque cursor for the next page. `null` on the last page. */
13
15
  next_cursor?: string | undefined;
16
+ /** Opaque cursor for the previous page. `null` on the first page. */
17
+ prev_cursor?: string | undefined;
14
18
  /** Page size that produced this response. */
15
19
  limit?: number | undefined;
16
20
  }
@@ -9,8 +9,12 @@ export interface ListResponseUserResource {
9
9
  data?: NizamDashboard.UserResource[] | undefined;
10
10
  /** True when more pages exist; pass `next_cursor` as `?starting_after=` to fetch the next page. */
11
11
  has_more?: boolean | undefined;
12
+ /** True when earlier pages exist; pass `prev_cursor` as `?ending_before=` to fetch the previous page. */
13
+ has_previous?: boolean | undefined;
12
14
  /** Opaque cursor for the next page. `null` on the last page. */
13
15
  next_cursor?: string | undefined;
16
+ /** Opaque cursor for the previous page. `null` on the first page. */
17
+ prev_cursor?: string | undefined;
14
18
  /** Page size that produced this response. */
15
19
  limit?: number | undefined;
16
20
  }