@nizam-os/dashboard-sdk 1.0.1 → 3.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 (80) hide show
  1. package/dist/Client.d.ts +8 -5
  2. package/dist/Client.js +13 -9
  3. package/dist/api/errors/BadRequestError.d.ts +6 -0
  4. package/dist/api/errors/BadRequestError.js +54 -0
  5. package/dist/api/errors/index.d.ts +1 -0
  6. package/dist/api/errors/index.js +1 -0
  7. package/dist/api/resources/assets/client/Client.d.ts +1 -0
  8. package/dist/api/resources/assets/client/Client.js +3 -0
  9. package/dist/api/resources/index.d.ts +4 -2
  10. package/dist/api/resources/index.js +5 -3
  11. package/dist/api/resources/invites/client/requests/CreateInviteRequest.d.ts +2 -2
  12. package/dist/api/resources/invites/client/requests/CreateInviteRequest.js +1 -1
  13. package/dist/api/resources/lookups/client/Client.d.ts +45 -1
  14. package/dist/api/resources/lookups/client/Client.js +192 -1
  15. package/dist/api/resources/memberships/client/Client.d.ts +52 -0
  16. package/dist/api/resources/memberships/client/Client.js +181 -0
  17. package/dist/api/resources/memberships/client/requests/ListMyMembershipsRequest.d.ts +15 -0
  18. package/dist/api/resources/memberships/client/requests/index.d.ts +2 -0
  19. package/dist/api/resources/memberships/exports.d.ts +2 -0
  20. package/dist/api/resources/memberships/exports.js +21 -0
  21. package/dist/api/resources/organizations/client/Client.d.ts +1 -34
  22. package/dist/api/resources/organizations/client/Client.js +1 -118
  23. package/dist/api/resources/organizations/client/requests/index.d.ts +0 -1
  24. package/dist/api/resources/{identity → users}/client/Client.d.ts +25 -21
  25. package/dist/api/resources/{identity → users}/client/Client.js +29 -19
  26. package/dist/api/resources/users/client/index.d.ts +1 -0
  27. package/dist/api/resources/users/client/index.js +17 -0
  28. package/dist/api/resources/users/client/requests/ListUsersRequest.d.ts +17 -0
  29. package/dist/api/resources/users/client/requests/UserUpdateRequest.js +3 -0
  30. package/dist/api/resources/users/client/requests/index.js +2 -0
  31. package/dist/api/resources/users/exports.d.ts +2 -0
  32. package/dist/api/resources/{identity → users}/exports.js +2 -2
  33. package/dist/api/resources/users/index.d.ts +1 -0
  34. package/dist/api/resources/users/index.js +17 -0
  35. package/dist/api/types/BusinessCategory.d.ts +18 -0
  36. package/dist/api/types/BusinessCategory.js +11 -0
  37. package/dist/api/types/Country.d.ts +20 -0
  38. package/dist/api/types/Country.js +11 -0
  39. package/dist/api/types/Currency.d.ts +22 -0
  40. package/dist/api/types/Currency.js +11 -0
  41. package/dist/api/types/Language.d.ts +20 -0
  42. package/dist/api/types/Language.js +11 -0
  43. package/dist/api/types/ListResponseBusinessCategory.d.ts +27 -0
  44. package/dist/api/types/ListResponseBusinessCategory.js +11 -0
  45. package/dist/api/types/ListResponseCountry.d.ts +27 -0
  46. package/dist/api/types/{ListResponse.js → ListResponseCountry.js} +5 -5
  47. package/dist/api/types/ListResponseCurrency.d.ts +27 -0
  48. package/dist/api/types/ListResponseCurrency.js +11 -0
  49. package/dist/api/types/ListResponseLanguage.d.ts +27 -0
  50. package/dist/api/types/ListResponseLanguage.js +11 -0
  51. package/dist/api/types/ListResponseMembership.d.ts +27 -0
  52. package/dist/api/types/ListResponseMembership.js +11 -0
  53. package/dist/api/types/ListResponseTimezone.d.ts +27 -0
  54. package/dist/api/types/ListResponseTimezone.js +11 -0
  55. package/dist/api/types/{ListResponse.d.ts → ListResponseUserResource.d.ts} +7 -3
  56. package/dist/api/types/ListResponseUserResource.js +11 -0
  57. package/dist/api/types/{OrganizationMembership.d.ts → Membership.d.ts} +5 -5
  58. package/dist/api/types/{OrganizationMembership.js → Membership.js} +7 -7
  59. package/dist/api/types/Timezone.d.ts +20 -0
  60. package/dist/api/types/Timezone.js +11 -0
  61. package/dist/api/types/index.d.ts +13 -2
  62. package/dist/api/types/index.js +13 -2
  63. package/package.json +1 -1
  64. package/dist/api/resources/identity/client/requests/ListUsersRequest.d.ts +0 -10
  65. package/dist/api/resources/identity/exports.d.ts +0 -2
  66. /package/dist/api/resources/{identity → memberships}/client/index.d.ts +0 -0
  67. /package/dist/api/resources/{identity → memberships}/client/index.js +0 -0
  68. /package/dist/api/resources/{organizations → memberships}/client/requests/LeaveOrganizationRequest.d.ts +0 -0
  69. /package/dist/api/resources/{organizations → memberships}/client/requests/LeaveOrganizationRequest.js +0 -0
  70. /package/dist/api/resources/{identity/client/requests/InviteUserRequest.js → memberships/client/requests/ListMyMembershipsRequest.js} +0 -0
  71. /package/dist/api/resources/{identity → memberships}/client/requests/index.js +0 -0
  72. /package/dist/api/resources/{identity → memberships}/index.d.ts +0 -0
  73. /package/dist/api/resources/{identity → memberships}/index.js +0 -0
  74. /package/dist/api/resources/{identity → users}/client/requests/InviteUserRequest.d.ts +0 -0
  75. /package/dist/api/resources/{identity/client/requests/ListUsersRequest.js → users/client/requests/InviteUserRequest.js} +0 -0
  76. /package/dist/api/resources/{identity/client/requests/SoftDeleteUserRequest.js → users/client/requests/ListUsersRequest.js} +0 -0
  77. /package/dist/api/resources/{identity → users}/client/requests/SoftDeleteUserRequest.d.ts +0 -0
  78. /package/dist/api/resources/{identity/client/requests/UserUpdateRequest.js → users/client/requests/SoftDeleteUserRequest.js} +0 -0
  79. /package/dist/api/resources/{identity → users}/client/requests/UserUpdateRequest.d.ts +0 -0
  80. /package/dist/api/resources/{identity → users}/client/requests/index.d.ts +0 -0
package/dist/Client.d.ts CHANGED
@@ -1,10 +1,11 @@
1
1
  import { AssetsClient } from "./api/resources/assets/client/Client.js";
2
2
  import { AssignmentsClient } from "./api/resources/assignments/client/Client.js";
3
- import { IdentityClient } from "./api/resources/identity/client/Client.js";
4
3
  import { InvitesClient } from "./api/resources/invites/client/Client.js";
5
4
  import { LookupsClient } from "./api/resources/lookups/client/Client.js";
5
+ import { MembershipsClient } from "./api/resources/memberships/client/Client.js";
6
6
  import { OperatorsClient } from "./api/resources/operators/client/Client.js";
7
7
  import { OrganizationsClient } from "./api/resources/organizations/client/Client.js";
8
+ import { UsersClient } from "./api/resources/users/client/Client.js";
8
9
  import type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.js";
9
10
  import { type NormalizedClientOptionsWithAuth } from "./BaseClient.js";
10
11
  import * as core from "./core/index.js";
@@ -19,17 +20,19 @@ export declare class NizamDashboardClient {
19
20
  protected _assignments: AssignmentsClient | undefined;
20
21
  protected _invites: InvitesClient | undefined;
21
22
  protected _lookups: LookupsClient | undefined;
22
- protected _identity: IdentityClient | undefined;
23
- protected _organizations: OrganizationsClient | undefined;
23
+ protected _users: UsersClient | undefined;
24
+ protected _memberships: MembershipsClient | undefined;
24
25
  protected _operators: OperatorsClient | undefined;
26
+ protected _organizations: OrganizationsClient | undefined;
25
27
  constructor(options: NizamDashboardClient.Options);
26
28
  get assets(): AssetsClient;
27
29
  get assignments(): AssignmentsClient;
28
30
  get invites(): InvitesClient;
29
31
  get lookups(): LookupsClient;
30
- get identity(): IdentityClient;
31
- get organizations(): OrganizationsClient;
32
+ get users(): UsersClient;
33
+ get memberships(): MembershipsClient;
32
34
  get operators(): OperatorsClient;
35
+ get organizations(): OrganizationsClient;
33
36
  /**
34
37
  * Make a passthrough request using the SDK's configured auth, retry, logging, etc.
35
38
  * This is useful for making requests to endpoints not yet supported in the SDK.
package/dist/Client.js CHANGED
@@ -37,11 +37,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
37
37
  exports.NizamDashboardClient = void 0;
38
38
  const Client_js_1 = require("./api/resources/assets/client/Client.js");
39
39
  const Client_js_2 = require("./api/resources/assignments/client/Client.js");
40
- const Client_js_3 = require("./api/resources/identity/client/Client.js");
41
- const Client_js_4 = require("./api/resources/invites/client/Client.js");
42
- const Client_js_5 = require("./api/resources/lookups/client/Client.js");
40
+ const Client_js_3 = require("./api/resources/invites/client/Client.js");
41
+ const Client_js_4 = require("./api/resources/lookups/client/Client.js");
42
+ const Client_js_5 = require("./api/resources/memberships/client/Client.js");
43
43
  const Client_js_6 = require("./api/resources/operators/client/Client.js");
44
44
  const Client_js_7 = require("./api/resources/organizations/client/Client.js");
45
+ const Client_js_8 = require("./api/resources/users/client/Client.js");
45
46
  const BaseClient_js_1 = require("./BaseClient.js");
46
47
  const core = __importStar(require("./core/index.js"));
47
48
  class NizamDashboardClient {
@@ -55,20 +56,23 @@ class NizamDashboardClient {
55
56
  return (this._assignments ?? (this._assignments = new Client_js_2.AssignmentsClient(this._options)));
56
57
  }
57
58
  get invites() {
58
- return (this._invites ?? (this._invites = new Client_js_4.InvitesClient(this._options)));
59
+ return (this._invites ?? (this._invites = new Client_js_3.InvitesClient(this._options)));
59
60
  }
60
61
  get lookups() {
61
- return (this._lookups ?? (this._lookups = new Client_js_5.LookupsClient(this._options)));
62
+ return (this._lookups ?? (this._lookups = new Client_js_4.LookupsClient(this._options)));
62
63
  }
63
- get identity() {
64
- return (this._identity ?? (this._identity = new Client_js_3.IdentityClient(this._options)));
64
+ get users() {
65
+ return (this._users ?? (this._users = new Client_js_8.UsersClient(this._options)));
65
66
  }
66
- get organizations() {
67
- return (this._organizations ?? (this._organizations = new Client_js_7.OrganizationsClient(this._options)));
67
+ get memberships() {
68
+ return (this._memberships ?? (this._memberships = new Client_js_5.MembershipsClient(this._options)));
68
69
  }
69
70
  get operators() {
70
71
  return (this._operators ?? (this._operators = new Client_js_6.OperatorsClient(this._options)));
71
72
  }
73
+ get organizations() {
74
+ return (this._organizations ?? (this._organizations = new Client_js_7.OrganizationsClient(this._options)));
75
+ }
72
76
  /**
73
77
  * Make a passthrough request using the SDK's configured auth, retry, logging, etc.
74
78
  * This is useful for making requests to endpoints not yet supported in the SDK.
@@ -0,0 +1,6 @@
1
+ import type * as core from "../../core/index.js";
2
+ import * as errors from "../../errors/index.js";
3
+ import type * as NizamDashboard from "../index.js";
4
+ export declare class BadRequestError extends errors.NizamDashboardError {
5
+ constructor(body: NizamDashboard.ProblemDetail, rawResponse?: core.RawResponse);
6
+ }
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
36
+ Object.defineProperty(exports, "__esModule", { value: true });
37
+ exports.BadRequestError = void 0;
38
+ const errors = __importStar(require("../../errors/index.js"));
39
+ class BadRequestError extends errors.NizamDashboardError {
40
+ constructor(body, rawResponse) {
41
+ super({
42
+ message: "BadRequestError",
43
+ statusCode: 400,
44
+ body: body,
45
+ rawResponse: rawResponse,
46
+ });
47
+ Object.setPrototypeOf(this, new.target.prototype);
48
+ if (Error.captureStackTrace) {
49
+ Error.captureStackTrace(this, this.constructor);
50
+ }
51
+ this.name = this.constructor.name;
52
+ }
53
+ }
54
+ exports.BadRequestError = BadRequestError;
@@ -1,3 +1,4 @@
1
+ export * from "./BadRequestError.js";
1
2
  export * from "./ConflictError.js";
2
3
  export * from "./ForbiddenError.js";
3
4
  export * from "./GoneError.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("./BadRequestError.js"), exports);
17
18
  __exportStar(require("./ConflictError.js"), exports);
18
19
  __exportStar(require("./ForbiddenError.js"), exports);
19
20
  __exportStar(require("./GoneError.js"), exports);
@@ -19,6 +19,7 @@ export declare class AssetsClient {
19
19
  * @param {NizamDashboard.CreateAssetRequest} request
20
20
  * @param {AssetsClient.RequestOptions} requestOptions - Request-specific configuration.
21
21
  *
22
+ * @throws {@link NizamDashboard.BadRequestError}
22
23
  * @throws {@link NizamDashboard.UnauthorizedError}
23
24
  * @throws {@link NizamDashboard.ForbiddenError}
24
25
  * @throws {@link NizamDashboard.UnprocessableEntityError}
@@ -55,6 +55,7 @@ class AssetsClient {
55
55
  * @param {NizamDashboard.CreateAssetRequest} request
56
56
  * @param {AssetsClient.RequestOptions} requestOptions - Request-specific configuration.
57
57
  *
58
+ * @throws {@link NizamDashboard.BadRequestError}
58
59
  * @throws {@link NizamDashboard.UnauthorizedError}
59
60
  * @throws {@link NizamDashboard.ForbiddenError}
60
61
  * @throws {@link NizamDashboard.UnprocessableEntityError}
@@ -94,6 +95,8 @@ class AssetsClient {
94
95
  }
95
96
  if (_response.error.reason === "status-code") {
96
97
  switch (_response.error.statusCode) {
98
+ case 400:
99
+ throw new NizamDashboard.BadRequestError(_response.error.body, _response.rawResponse);
97
100
  case 401:
98
101
  throw new NizamDashboard.UnauthorizedError(_response.error.body, _response.rawResponse);
99
102
  case 403:
@@ -2,12 +2,14 @@ export * from "./assets/client/requests/index.js";
2
2
  export * as assets from "./assets/index.js";
3
3
  export * from "./assignments/client/requests/index.js";
4
4
  export * as assignments from "./assignments/index.js";
5
- export * from "./identity/client/requests/index.js";
6
- export * as identity from "./identity/index.js";
7
5
  export * from "./invites/client/requests/index.js";
8
6
  export * as invites from "./invites/index.js";
9
7
  export * as lookups from "./lookups/index.js";
8
+ export * from "./memberships/client/requests/index.js";
9
+ export * as memberships from "./memberships/index.js";
10
10
  export * from "./operators/client/requests/index.js";
11
11
  export * as operators from "./operators/index.js";
12
12
  export * from "./organizations/client/requests/index.js";
13
13
  export * as organizations from "./organizations/index.js";
14
+ export * from "./users/client/requests/index.js";
15
+ export * as users from "./users/index.js";
@@ -36,17 +36,19 @@ var __importStar = (this && this.__importStar) || (function () {
36
36
  };
37
37
  })();
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.organizations = exports.operators = exports.lookups = exports.invites = exports.identity = exports.assignments = exports.assets = void 0;
39
+ exports.users = exports.organizations = exports.operators = exports.memberships = exports.lookups = exports.invites = exports.assignments = exports.assets = void 0;
40
40
  __exportStar(require("./assets/client/requests/index.js"), exports);
41
41
  exports.assets = __importStar(require("./assets/index.js"));
42
42
  __exportStar(require("./assignments/client/requests/index.js"), exports);
43
43
  exports.assignments = __importStar(require("./assignments/index.js"));
44
- __exportStar(require("./identity/client/requests/index.js"), exports);
45
- exports.identity = __importStar(require("./identity/index.js"));
46
44
  __exportStar(require("./invites/client/requests/index.js"), exports);
47
45
  exports.invites = __importStar(require("./invites/index.js"));
48
46
  exports.lookups = __importStar(require("./lookups/index.js"));
47
+ __exportStar(require("./memberships/client/requests/index.js"), exports);
48
+ exports.memberships = __importStar(require("./memberships/index.js"));
49
49
  __exportStar(require("./operators/client/requests/index.js"), exports);
50
50
  exports.operators = __importStar(require("./operators/index.js"));
51
51
  __exportStar(require("./organizations/client/requests/index.js"), exports);
52
52
  exports.organizations = __importStar(require("./organizations/index.js"));
53
+ __exportStar(require("./users/client/requests/index.js"), exports);
54
+ exports.users = __importStar(require("./users/index.js"));
@@ -12,13 +12,13 @@ export interface CreateInviteRequest {
12
12
  organization_id: string;
13
13
  /** Recipient email. */
14
14
  email: string;
15
- /** Role the recipient will hold after acceptance. Lowercase enum names from OrgUserRole. */
15
+ /** Role the recipient will hold after acceptance. Lowercase enum names from MembershipRole. */
16
16
  role: CreateInviteRequest.Role;
17
17
  /** TTL in days. Defaults to 7. */
18
18
  ttl_days?: number;
19
19
  }
20
20
  export declare namespace CreateInviteRequest {
21
- /** Role the recipient will hold after acceptance. Lowercase enum names from OrgUserRole. */
21
+ /** Role the recipient will hold after acceptance. Lowercase enum names from MembershipRole. */
22
22
  const Role: {
23
23
  readonly SuperAdmin: "super_admin";
24
24
  readonly Admin: "admin";
@@ -4,7 +4,7 @@ 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 OrgUserRole. */
7
+ /** Role the recipient will hold after acceptance. Lowercase enum names from MembershipRole. */
8
8
  CreateInviteRequest.Role = {
9
9
  SuperAdmin: "super_admin",
10
10
  Admin: "admin",
@@ -22,6 +22,50 @@ export declare class LookupsClient {
22
22
  * @example
23
23
  * await client.lookups.listBusinessCategories()
24
24
  */
25
- listBusinessCategories(requestOptions?: LookupsClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.ListResponse>;
25
+ listBusinessCategories(requestOptions?: LookupsClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.ListResponseBusinessCategory>;
26
26
  private __listBusinessCategories;
27
+ /**
28
+ * @param {LookupsClient.RequestOptions} requestOptions - Request-specific configuration.
29
+ *
30
+ * @throws {@link NizamDashboard.UnauthorizedError}
31
+ * @throws {@link NizamDashboard.InternalServerError}
32
+ *
33
+ * @example
34
+ * await client.lookups.listCountries()
35
+ */
36
+ listCountries(requestOptions?: LookupsClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.ListResponseCountry>;
37
+ private __listCountries;
38
+ /**
39
+ * @param {LookupsClient.RequestOptions} requestOptions - Request-specific configuration.
40
+ *
41
+ * @throws {@link NizamDashboard.UnauthorizedError}
42
+ * @throws {@link NizamDashboard.InternalServerError}
43
+ *
44
+ * @example
45
+ * await client.lookups.listCurrencies()
46
+ */
47
+ listCurrencies(requestOptions?: LookupsClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.ListResponseCurrency>;
48
+ private __listCurrencies;
49
+ /**
50
+ * @param {LookupsClient.RequestOptions} requestOptions - Request-specific configuration.
51
+ *
52
+ * @throws {@link NizamDashboard.UnauthorizedError}
53
+ * @throws {@link NizamDashboard.InternalServerError}
54
+ *
55
+ * @example
56
+ * await client.lookups.listLanguages()
57
+ */
58
+ listLanguages(requestOptions?: LookupsClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.ListResponseLanguage>;
59
+ private __listLanguages;
60
+ /**
61
+ * @param {LookupsClient.RequestOptions} requestOptions - Request-specific configuration.
62
+ *
63
+ * @throws {@link NizamDashboard.UnauthorizedError}
64
+ * @throws {@link NizamDashboard.InternalServerError}
65
+ *
66
+ * @example
67
+ * await client.lookups.listTimezones()
68
+ */
69
+ listTimezones(requestOptions?: LookupsClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.ListResponseTimezone>;
70
+ private __listTimezones;
27
71
  }
@@ -78,7 +78,10 @@ class LookupsClient {
78
78
  logging: this._options.logging,
79
79
  });
80
80
  if (_response.ok) {
81
- return { data: _response.body, rawResponse: _response.rawResponse };
81
+ return {
82
+ data: _response.body,
83
+ rawResponse: _response.rawResponse,
84
+ };
82
85
  }
83
86
  if (_response.error.reason === "status-code") {
84
87
  switch (_response.error.statusCode) {
@@ -96,5 +99,193 @@ class LookupsClient {
96
99
  }
97
100
  return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v1/lookups/business-categories");
98
101
  }
102
+ /**
103
+ * @param {LookupsClient.RequestOptions} requestOptions - Request-specific configuration.
104
+ *
105
+ * @throws {@link NizamDashboard.UnauthorizedError}
106
+ * @throws {@link NizamDashboard.InternalServerError}
107
+ *
108
+ * @example
109
+ * await client.lookups.listCountries()
110
+ */
111
+ listCountries(requestOptions) {
112
+ return core.HttpResponsePromise.fromPromise(this.__listCountries(requestOptions));
113
+ }
114
+ async __listCountries(requestOptions) {
115
+ const _authRequest = await this._options.authProvider.getAuthRequest();
116
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, requestOptions?.headers);
117
+ const _response = await core.fetcher({
118
+ url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
119
+ (await core.Supplier.get(this._options.environment)) ??
120
+ environments.NizamDashboardEnvironment.Production, "v1/lookups/countries"),
121
+ method: "GET",
122
+ headers: _headers,
123
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
124
+ timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
125
+ maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
126
+ abortSignal: requestOptions?.abortSignal,
127
+ fetchFn: this._options?.fetch,
128
+ logging: this._options.logging,
129
+ });
130
+ if (_response.ok) {
131
+ return { data: _response.body, rawResponse: _response.rawResponse };
132
+ }
133
+ if (_response.error.reason === "status-code") {
134
+ switch (_response.error.statusCode) {
135
+ case 401:
136
+ throw new NizamDashboard.UnauthorizedError(_response.error.body, _response.rawResponse);
137
+ case 500:
138
+ throw new NizamDashboard.InternalServerError(_response.error.body, _response.rawResponse);
139
+ default:
140
+ throw new errors.NizamDashboardError({
141
+ statusCode: _response.error.statusCode,
142
+ body: _response.error.body,
143
+ rawResponse: _response.rawResponse,
144
+ });
145
+ }
146
+ }
147
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v1/lookups/countries");
148
+ }
149
+ /**
150
+ * @param {LookupsClient.RequestOptions} requestOptions - Request-specific configuration.
151
+ *
152
+ * @throws {@link NizamDashboard.UnauthorizedError}
153
+ * @throws {@link NizamDashboard.InternalServerError}
154
+ *
155
+ * @example
156
+ * await client.lookups.listCurrencies()
157
+ */
158
+ listCurrencies(requestOptions) {
159
+ return core.HttpResponsePromise.fromPromise(this.__listCurrencies(requestOptions));
160
+ }
161
+ async __listCurrencies(requestOptions) {
162
+ const _authRequest = await this._options.authProvider.getAuthRequest();
163
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, requestOptions?.headers);
164
+ const _response = await core.fetcher({
165
+ url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
166
+ (await core.Supplier.get(this._options.environment)) ??
167
+ environments.NizamDashboardEnvironment.Production, "v1/lookups/currencies"),
168
+ method: "GET",
169
+ headers: _headers,
170
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
171
+ timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
172
+ maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
173
+ abortSignal: requestOptions?.abortSignal,
174
+ fetchFn: this._options?.fetch,
175
+ logging: this._options.logging,
176
+ });
177
+ if (_response.ok) {
178
+ return { data: _response.body, rawResponse: _response.rawResponse };
179
+ }
180
+ if (_response.error.reason === "status-code") {
181
+ switch (_response.error.statusCode) {
182
+ case 401:
183
+ throw new NizamDashboard.UnauthorizedError(_response.error.body, _response.rawResponse);
184
+ case 500:
185
+ throw new NizamDashboard.InternalServerError(_response.error.body, _response.rawResponse);
186
+ default:
187
+ throw new errors.NizamDashboardError({
188
+ statusCode: _response.error.statusCode,
189
+ body: _response.error.body,
190
+ rawResponse: _response.rawResponse,
191
+ });
192
+ }
193
+ }
194
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v1/lookups/currencies");
195
+ }
196
+ /**
197
+ * @param {LookupsClient.RequestOptions} requestOptions - Request-specific configuration.
198
+ *
199
+ * @throws {@link NizamDashboard.UnauthorizedError}
200
+ * @throws {@link NizamDashboard.InternalServerError}
201
+ *
202
+ * @example
203
+ * await client.lookups.listLanguages()
204
+ */
205
+ listLanguages(requestOptions) {
206
+ return core.HttpResponsePromise.fromPromise(this.__listLanguages(requestOptions));
207
+ }
208
+ async __listLanguages(requestOptions) {
209
+ const _authRequest = await this._options.authProvider.getAuthRequest();
210
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, requestOptions?.headers);
211
+ const _response = await core.fetcher({
212
+ url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
213
+ (await core.Supplier.get(this._options.environment)) ??
214
+ environments.NizamDashboardEnvironment.Production, "v1/lookups/languages"),
215
+ method: "GET",
216
+ headers: _headers,
217
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
218
+ timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
219
+ maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
220
+ abortSignal: requestOptions?.abortSignal,
221
+ fetchFn: this._options?.fetch,
222
+ logging: this._options.logging,
223
+ });
224
+ if (_response.ok) {
225
+ return { data: _response.body, rawResponse: _response.rawResponse };
226
+ }
227
+ if (_response.error.reason === "status-code") {
228
+ switch (_response.error.statusCode) {
229
+ case 401:
230
+ throw new NizamDashboard.UnauthorizedError(_response.error.body, _response.rawResponse);
231
+ case 500:
232
+ throw new NizamDashboard.InternalServerError(_response.error.body, _response.rawResponse);
233
+ default:
234
+ throw new errors.NizamDashboardError({
235
+ statusCode: _response.error.statusCode,
236
+ body: _response.error.body,
237
+ rawResponse: _response.rawResponse,
238
+ });
239
+ }
240
+ }
241
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v1/lookups/languages");
242
+ }
243
+ /**
244
+ * @param {LookupsClient.RequestOptions} requestOptions - Request-specific configuration.
245
+ *
246
+ * @throws {@link NizamDashboard.UnauthorizedError}
247
+ * @throws {@link NizamDashboard.InternalServerError}
248
+ *
249
+ * @example
250
+ * await client.lookups.listTimezones()
251
+ */
252
+ listTimezones(requestOptions) {
253
+ return core.HttpResponsePromise.fromPromise(this.__listTimezones(requestOptions));
254
+ }
255
+ async __listTimezones(requestOptions) {
256
+ const _authRequest = await this._options.authProvider.getAuthRequest();
257
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, requestOptions?.headers);
258
+ const _response = await core.fetcher({
259
+ url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
260
+ (await core.Supplier.get(this._options.environment)) ??
261
+ environments.NizamDashboardEnvironment.Production, "v1/lookups/timezones"),
262
+ method: "GET",
263
+ headers: _headers,
264
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
265
+ timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
266
+ maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
267
+ abortSignal: requestOptions?.abortSignal,
268
+ fetchFn: this._options?.fetch,
269
+ logging: this._options.logging,
270
+ });
271
+ if (_response.ok) {
272
+ return { data: _response.body, rawResponse: _response.rawResponse };
273
+ }
274
+ if (_response.error.reason === "status-code") {
275
+ switch (_response.error.statusCode) {
276
+ case 401:
277
+ throw new NizamDashboard.UnauthorizedError(_response.error.body, _response.rawResponse);
278
+ case 500:
279
+ throw new NizamDashboard.InternalServerError(_response.error.body, _response.rawResponse);
280
+ default:
281
+ throw new errors.NizamDashboardError({
282
+ statusCode: _response.error.statusCode,
283
+ body: _response.error.body,
284
+ rawResponse: _response.rawResponse,
285
+ });
286
+ }
287
+ }
288
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v1/lookups/timezones");
289
+ }
99
290
  }
100
291
  exports.LookupsClient = LookupsClient;
@@ -0,0 +1,52 @@
1
+ import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
2
+ import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js";
3
+ import * as core from "../../../../core/index.js";
4
+ import * as NizamDashboard from "../../../index.js";
5
+ export declare namespace MembershipsClient {
6
+ type Options = BaseClientOptions;
7
+ interface RequestOptions extends BaseRequestOptions {
8
+ }
9
+ }
10
+ /**
11
+ * User ↔ organization memberships — list, join, leave, role checks.
12
+ */
13
+ export declare class MembershipsClient {
14
+ protected readonly _options: NormalizedClientOptionsWithAuth<MembershipsClient.Options>;
15
+ constructor(options: MembershipsClient.Options);
16
+ /**
17
+ * Returns the caller's organization memberships — each entry is a `{organization, role}` pair, so the role per org is available without a second fetch. Bounded by the caller's own memberships — typically under 50 — and returned in a single page; the response carries the standard `ListResponse` envelope and a `first` Link header rel for wire-shape consistency with paginated endpoints, but the `starting_after` / `ending_before` cursors are no-ops here. Promote to keyset pagination when membership counts grow to where a single page is no longer enough.
18
+ *
19
+ * @param {NizamDashboard.ListMyMembershipsRequest} request
20
+ * @param {MembershipsClient.RequestOptions} requestOptions - Request-specific configuration.
21
+ *
22
+ * @throws {@link NizamDashboard.UnauthorizedError}
23
+ * @throws {@link NizamDashboard.ForbiddenError}
24
+ * @throws {@link NizamDashboard.InternalServerError}
25
+ *
26
+ * @example
27
+ * await client.memberships.listMyMemberships({
28
+ * starting_after: "Y3Vyc29yX25leHRfMDFKNVE=",
29
+ * ending_before: "Y3Vyc29yX25leHRfMDFKNVE="
30
+ * })
31
+ */
32
+ listMyMemberships(request?: NizamDashboard.ListMyMembershipsRequest, requestOptions?: MembershipsClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.ListResponseMembership>;
33
+ private __listMyMemberships;
34
+ /**
35
+ * Removes the caller's membership from the organization. The owner cannot leave — they must transfer ownership (future endpoint) or delete the org instead.
36
+ *
37
+ * @param {NizamDashboard.LeaveOrganizationRequest} request
38
+ * @param {MembershipsClient.RequestOptions} requestOptions - Request-specific configuration.
39
+ *
40
+ * @throws {@link NizamDashboard.UnauthorizedError}
41
+ * @throws {@link NizamDashboard.ForbiddenError}
42
+ * @throws {@link NizamDashboard.ConflictError}
43
+ * @throws {@link NizamDashboard.InternalServerError}
44
+ *
45
+ * @example
46
+ * await client.memberships.leaveOrganization({
47
+ * id: "00000000-0000-0000-0000-000000000000"
48
+ * })
49
+ */
50
+ leaveOrganization(request: NizamDashboard.LeaveOrganizationRequest, requestOptions?: MembershipsClient.RequestOptions): core.HttpResponsePromise<void>;
51
+ private __leaveOrganization;
52
+ }