@vitable-inc/vitable-connect 2.0.0 → 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 (108) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/employers/client/Client.d.ts +2 -1
  3. package/dist/cjs/api/resources/employers/client/Client.js +40 -37
  4. package/dist/cjs/api/resources/employers/client/requests/CreateEmployerRequest.d.ts +2 -0
  5. package/dist/cjs/api/resources/employers/client/requests/EnsurePayrollIntegrationEmailEmployersRequest.d.ts +2 -0
  6. package/dist/cjs/api/resources/employers/client/requests/GetBenefitPlanYearEmployersRequest.d.ts +2 -0
  7. package/dist/cjs/api/resources/employers/client/requests/GetEmployersRequest.d.ts +2 -0
  8. package/dist/cjs/api/resources/employers/client/requests/GetHrisEmployersRequest.d.ts +2 -0
  9. package/dist/cjs/api/resources/employers/client/requests/GetInvoicePdfEmployersRequest.d.ts +2 -0
  10. package/dist/cjs/api/resources/employers/client/requests/GetPayrollAccessSetupEmployersRequest.d.ts +2 -0
  11. package/dist/cjs/api/resources/employers/client/requests/ListBenefitPlanYearEnrollmentsEmployersRequest.d.ts +2 -0
  12. package/dist/cjs/api/resources/employers/client/requests/ListBenefitPlanYearsEmployersRequest.d.ts +2 -0
  13. package/dist/cjs/api/resources/employers/client/requests/ListEmployeesEmployersRequest.d.ts +2 -0
  14. package/dist/cjs/api/resources/employers/client/requests/ListEmployersRequest.d.ts +2 -0
  15. package/dist/cjs/api/resources/employers/client/requests/ListHrisProvidersEmployersRequest.d.ts +9 -0
  16. package/dist/cjs/api/resources/employers/client/requests/ListHrisProvidersEmployersRequest.js +3 -0
  17. package/dist/cjs/api/resources/employers/client/requests/ListInvoicesEmployersRequest.d.ts +2 -0
  18. package/dist/cjs/api/resources/employers/client/requests/ListPayrollDeductionStatementsEmployersRequest.d.ts +2 -0
  19. package/dist/cjs/api/resources/employers/client/requests/SubmitPayrollAccessSetupRequest.d.ts +2 -0
  20. package/dist/cjs/api/resources/employers/client/requests/UpdateEmployerRequest.d.ts +2 -0
  21. package/dist/cjs/api/resources/employers/client/requests/UpdateEmployerSettingsRequest.d.ts +2 -0
  22. package/dist/cjs/api/resources/employers/client/requests/index.d.ts +1 -0
  23. package/dist/cjs/api/resources/enrollments/client/Client.js +6 -6
  24. package/dist/cjs/api/resources/enrollments/client/requests/GetEnrollmentsRequest.d.ts +2 -0
  25. package/dist/cjs/api/resources/enrollments/client/requests/ReissueEnrollmentRequest.d.ts +2 -0
  26. package/dist/cjs/api/resources/enrollments/client/requests/TerminateEnrollmentRequest.d.ts +2 -0
  27. package/dist/cjs/api/resources/members/client/Client.js +16 -16
  28. package/dist/cjs/api/resources/members/client/requests/GetHouseholdMembersRequest.d.ts +2 -0
  29. package/dist/cjs/api/resources/members/client/requests/GetMembersRequest.d.ts +2 -0
  30. package/dist/cjs/api/resources/members/client/requests/ListDependentsMembersRequest.d.ts +2 -0
  31. package/dist/cjs/api/resources/members/client/requests/ListEmploymentsMembersRequest.d.ts +2 -0
  32. package/dist/cjs/api/resources/members/client/requests/ListEnrollmentsMembersRequest.d.ts +2 -0
  33. package/dist/cjs/api/resources/members/client/requests/ListIdCardsMembersRequest.d.ts +2 -0
  34. package/dist/cjs/api/resources/members/client/requests/ListMembersRequest.d.ts +2 -0
  35. package/dist/cjs/api/resources/members/client/requests/ListQualifyingLifeEventsMembersRequest.d.ts +2 -0
  36. package/dist/cjs/api/resources/organizations/client/Client.d.ts +2 -2
  37. package/dist/cjs/api/resources/organizations/client/Client.js +2 -2
  38. package/dist/cjs/api/resources/organizations/client/requests/CreateOrganizationRequest.d.ts +1 -1
  39. package/dist/cjs/api/types/OrganizationMembership.d.ts +38 -0
  40. package/dist/cjs/api/types/OrganizationMembership.js +3 -0
  41. package/dist/cjs/api/types/OrganizationType.d.ts +5 -5
  42. package/dist/cjs/api/types/OrganizationType.js +5 -5
  43. package/dist/cjs/api/types/OrganizationUserRole.d.ts +13 -0
  44. package/dist/cjs/api/types/OrganizationUserRole.js +16 -0
  45. package/dist/cjs/api/types/OrganizationsListResponse.d.ts +1 -1
  46. package/dist/cjs/api/types/XVitableOrganization.d.ts +4 -0
  47. package/dist/cjs/api/types/XVitableOrganization.js +3 -0
  48. package/dist/cjs/api/types/index.d.ts +3 -1
  49. package/dist/cjs/api/types/index.js +3 -1
  50. package/dist/cjs/version.d.ts +1 -1
  51. package/dist/cjs/version.js +1 -1
  52. package/dist/esm/BaseClient.mjs +2 -2
  53. package/dist/esm/api/resources/employers/client/Client.d.mts +2 -1
  54. package/dist/esm/api/resources/employers/client/Client.mjs +41 -38
  55. package/dist/esm/api/resources/employers/client/requests/CreateEmployerRequest.d.mts +2 -0
  56. package/dist/esm/api/resources/employers/client/requests/EnsurePayrollIntegrationEmailEmployersRequest.d.mts +2 -0
  57. package/dist/esm/api/resources/employers/client/requests/GetBenefitPlanYearEmployersRequest.d.mts +2 -0
  58. package/dist/esm/api/resources/employers/client/requests/GetEmployersRequest.d.mts +2 -0
  59. package/dist/esm/api/resources/employers/client/requests/GetHrisEmployersRequest.d.mts +2 -0
  60. package/dist/esm/api/resources/employers/client/requests/GetInvoicePdfEmployersRequest.d.mts +2 -0
  61. package/dist/esm/api/resources/employers/client/requests/GetPayrollAccessSetupEmployersRequest.d.mts +2 -0
  62. package/dist/esm/api/resources/employers/client/requests/ListBenefitPlanYearEnrollmentsEmployersRequest.d.mts +2 -0
  63. package/dist/esm/api/resources/employers/client/requests/ListBenefitPlanYearsEmployersRequest.d.mts +2 -0
  64. package/dist/esm/api/resources/employers/client/requests/ListEmployeesEmployersRequest.d.mts +2 -0
  65. package/dist/esm/api/resources/employers/client/requests/ListEmployersRequest.d.mts +2 -0
  66. package/dist/esm/api/resources/employers/client/requests/ListHrisProvidersEmployersRequest.d.mts +9 -0
  67. package/dist/esm/api/resources/employers/client/requests/ListHrisProvidersEmployersRequest.mjs +2 -0
  68. package/dist/esm/api/resources/employers/client/requests/ListInvoicesEmployersRequest.d.mts +2 -0
  69. package/dist/esm/api/resources/employers/client/requests/ListPayrollDeductionStatementsEmployersRequest.d.mts +2 -0
  70. package/dist/esm/api/resources/employers/client/requests/SubmitPayrollAccessSetupRequest.d.mts +2 -0
  71. package/dist/esm/api/resources/employers/client/requests/UpdateEmployerRequest.d.mts +2 -0
  72. package/dist/esm/api/resources/employers/client/requests/UpdateEmployerSettingsRequest.d.mts +2 -0
  73. package/dist/esm/api/resources/employers/client/requests/index.d.mts +1 -0
  74. package/dist/esm/api/resources/enrollments/client/Client.mjs +7 -7
  75. package/dist/esm/api/resources/enrollments/client/requests/GetEnrollmentsRequest.d.mts +2 -0
  76. package/dist/esm/api/resources/enrollments/client/requests/ReissueEnrollmentRequest.d.mts +2 -0
  77. package/dist/esm/api/resources/enrollments/client/requests/TerminateEnrollmentRequest.d.mts +2 -0
  78. package/dist/esm/api/resources/members/client/Client.mjs +17 -17
  79. package/dist/esm/api/resources/members/client/requests/GetHouseholdMembersRequest.d.mts +2 -0
  80. package/dist/esm/api/resources/members/client/requests/GetMembersRequest.d.mts +2 -0
  81. package/dist/esm/api/resources/members/client/requests/ListDependentsMembersRequest.d.mts +2 -0
  82. package/dist/esm/api/resources/members/client/requests/ListEmploymentsMembersRequest.d.mts +2 -0
  83. package/dist/esm/api/resources/members/client/requests/ListEnrollmentsMembersRequest.d.mts +2 -0
  84. package/dist/esm/api/resources/members/client/requests/ListIdCardsMembersRequest.d.mts +2 -0
  85. package/dist/esm/api/resources/members/client/requests/ListMembersRequest.d.mts +2 -0
  86. package/dist/esm/api/resources/members/client/requests/ListQualifyingLifeEventsMembersRequest.d.mts +2 -0
  87. package/dist/esm/api/resources/organizations/client/Client.d.mts +2 -2
  88. package/dist/esm/api/resources/organizations/client/Client.mjs +2 -2
  89. package/dist/esm/api/resources/organizations/client/requests/CreateOrganizationRequest.d.mts +1 -1
  90. package/dist/esm/api/types/OrganizationMembership.d.mts +38 -0
  91. package/dist/esm/api/types/OrganizationMembership.mjs +2 -0
  92. package/dist/esm/api/types/OrganizationType.d.mts +5 -5
  93. package/dist/esm/api/types/OrganizationType.mjs +5 -5
  94. package/dist/esm/api/types/OrganizationUserRole.d.mts +13 -0
  95. package/dist/esm/api/types/OrganizationUserRole.mjs +13 -0
  96. package/dist/esm/api/types/OrganizationsListResponse.d.mts +1 -1
  97. package/dist/esm/api/types/XVitableOrganization.d.mts +4 -0
  98. package/dist/esm/api/types/XVitableOrganization.mjs +2 -0
  99. package/dist/esm/api/types/index.d.mts +3 -1
  100. package/dist/esm/api/types/index.mjs +3 -1
  101. package/dist/esm/version.d.mts +1 -1
  102. package/dist/esm/version.mjs +1 -1
  103. package/package.json +1 -1
  104. package/reference.md +11 -3
  105. package/dist/cjs/api/types/CreateOrganizationRequestType.d.ts +0 -17
  106. package/dist/cjs/api/types/CreateOrganizationRequestType.js +0 -20
  107. package/dist/esm/api/types/CreateOrganizationRequestType.d.mts +0 -17
  108. package/dist/esm/api/types/CreateOrganizationRequestType.mjs +0 -17
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
12
- import { mergeHeaders } from "../../../../core/headers.mjs";
12
+ import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
13
13
  import * as core from "../../../../core/index.mjs";
14
14
  import * as environments from "../../../../environments.mjs";
15
15
  import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
@@ -50,9 +50,9 @@ export class MembersClient {
50
50
  __get(request, requestOptions) {
51
51
  return __awaiter(this, void 0, void 0, function* () {
52
52
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
53
- const { member_id: memberId } = request;
53
+ const { member_id: memberId, "X-Vitable-Organization": vitableOrganization } = request;
54
54
  const _authRequest = yield this._options.authProvider.getAuthRequest();
55
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
55
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "X-Vitable-Organization": vitableOrganization }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
56
56
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
57
57
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.VitableConnectEnvironment.Production, `v1/members/${core.url.encodePathParam(memberId)}`),
58
58
  method: "GET",
@@ -124,9 +124,9 @@ export class MembersClient {
124
124
  __listDependents(request, requestOptions) {
125
125
  return __awaiter(this, void 0, void 0, function* () {
126
126
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
127
- const { member_id: memberId } = request;
127
+ const { member_id: memberId, "X-Vitable-Organization": vitableOrganization } = request;
128
128
  const _authRequest = yield this._options.authProvider.getAuthRequest();
129
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
129
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "X-Vitable-Organization": vitableOrganization }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
130
130
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
131
131
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.VitableConnectEnvironment.Production, `v1/members/${core.url.encodePathParam(memberId)}/dependents`),
132
132
  method: "GET",
@@ -201,9 +201,9 @@ export class MembersClient {
201
201
  __listEmployments(request, requestOptions) {
202
202
  return __awaiter(this, void 0, void 0, function* () {
203
203
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
204
- const { member_id: memberId } = request;
204
+ const { member_id: memberId, "X-Vitable-Organization": vitableOrganization } = request;
205
205
  const _authRequest = yield this._options.authProvider.getAuthRequest();
206
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
206
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "X-Vitable-Organization": vitableOrganization }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
207
207
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
208
208
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.VitableConnectEnvironment.Production, `v1/members/${core.url.encodePathParam(memberId)}/employments`),
209
209
  method: "GET",
@@ -278,9 +278,9 @@ export class MembersClient {
278
278
  __listEnrollments(request, requestOptions) {
279
279
  return __awaiter(this, void 0, void 0, function* () {
280
280
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
281
- const { member_id: memberId } = request;
281
+ const { member_id: memberId, "X-Vitable-Organization": vitableOrganization } = request;
282
282
  const _authRequest = yield this._options.authProvider.getAuthRequest();
283
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
283
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "X-Vitable-Organization": vitableOrganization }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
284
284
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
285
285
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.VitableConnectEnvironment.Production, `v1/members/${core.url.encodePathParam(memberId)}/enrollments`),
286
286
  method: "GET",
@@ -355,9 +355,9 @@ export class MembersClient {
355
355
  __getHousehold(request, requestOptions) {
356
356
  return __awaiter(this, void 0, void 0, function* () {
357
357
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
358
- const { member_id: memberId } = request;
358
+ const { member_id: memberId, "X-Vitable-Organization": vitableOrganization } = request;
359
359
  const _authRequest = yield this._options.authProvider.getAuthRequest();
360
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
360
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "X-Vitable-Organization": vitableOrganization }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
361
361
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
362
362
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.VitableConnectEnvironment.Production, `v1/members/${core.url.encodePathParam(memberId)}/household`),
363
363
  method: "GET",
@@ -432,9 +432,9 @@ export class MembersClient {
432
432
  __listIdCards(request, requestOptions) {
433
433
  return __awaiter(this, void 0, void 0, function* () {
434
434
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
435
- const { member_id: memberId } = request;
435
+ const { member_id: memberId, "X-Vitable-Organization": vitableOrganization } = request;
436
436
  const _authRequest = yield this._options.authProvider.getAuthRequest();
437
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
437
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "X-Vitable-Organization": vitableOrganization }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
438
438
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
439
439
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.VitableConnectEnvironment.Production, `v1/members/${core.url.encodePathParam(memberId)}/id-cards`),
440
440
  method: "GET",
@@ -509,14 +509,14 @@ export class MembersClient {
509
509
  return __awaiter(this, void 0, void 0, function* () {
510
510
  const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
511
511
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
512
- const { member_id: memberId, limit, page, status } = request;
512
+ const { member_id: memberId, limit, page, status, "X-Vitable-Organization": vitableOrganization, } = request;
513
513
  const _queryParams = {
514
514
  limit,
515
515
  page,
516
516
  status: status != null ? status : undefined,
517
517
  };
518
518
  const _authRequest = yield this._options.authProvider.getAuthRequest();
519
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
519
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "X-Vitable-Organization": vitableOrganization }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
520
520
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
521
521
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.VitableConnectEnvironment.Production, `v1/members/${core.url.encodePathParam(memberId)}/qualifying-life-events`),
522
522
  method: "GET",
@@ -607,14 +607,14 @@ export class MembersClient {
607
607
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
608
608
  const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
609
609
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
610
- const { limit, page, search } = request;
610
+ const { limit, page, search, "X-Vitable-Organization": vitableOrganization } = request;
611
611
  const _queryParams = {
612
612
  limit,
613
613
  page,
614
614
  search,
615
615
  };
616
616
  const _authRequest = yield this._options.authProvider.getAuthRequest();
617
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
617
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "X-Vitable-Organization": vitableOrganization }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
618
618
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
619
619
  url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.VitableConnectEnvironment.Production, "v2/members"),
620
620
  method: "GET",
@@ -7,4 +7,6 @@ import type * as VitableConnect from "../../../../index.mjs";
7
7
  */
8
8
  export interface GetHouseholdMembersRequest {
9
9
  member_id: VitableConnect.MemberId;
10
+ /** Organization to act as for this request (e.g. `org_SGVsbG8gV29ybGQ`). Optional when your credentials reach a single organization. Required when they reach several — omitting it then returns 400 `organization_required`. A malformed value returns 400 `invalid_organization_header`, and naming an organization you do not have access to returns 403 `organization_access_denied`. */
11
+ "X-Vitable-Organization"?: VitableConnect.XVitableOrganization;
10
12
  }
@@ -8,4 +8,6 @@ import type * as VitableConnect from "../../../../index.mjs";
8
8
  export interface GetMembersRequest {
9
9
  /** Unique member identifier (mbr_*) */
10
10
  member_id: VitableConnect.MemberId;
11
+ /** Organization to act as for this request (e.g. `org_SGVsbG8gV29ybGQ`). Optional when your credentials reach a single organization. Required when they reach several — omitting it then returns 400 `organization_required`. A malformed value returns 400 `invalid_organization_header`, and naming an organization you do not have access to returns 403 `organization_access_denied`. */
12
+ "X-Vitable-Organization"?: VitableConnect.XVitableOrganization;
11
13
  }
@@ -7,4 +7,6 @@ import type * as VitableConnect from "../../../../index.mjs";
7
7
  */
8
8
  export interface ListDependentsMembersRequest {
9
9
  member_id: VitableConnect.MemberId;
10
+ /** Organization to act as for this request (e.g. `org_SGVsbG8gV29ybGQ`). Optional when your credentials reach a single organization. Required when they reach several — omitting it then returns 400 `organization_required`. A malformed value returns 400 `invalid_organization_header`, and naming an organization you do not have access to returns 403 `organization_access_denied`. */
11
+ "X-Vitable-Organization"?: VitableConnect.XVitableOrganization;
10
12
  }
@@ -7,4 +7,6 @@ import type * as VitableConnect from "../../../../index.mjs";
7
7
  */
8
8
  export interface ListEmploymentsMembersRequest {
9
9
  member_id: VitableConnect.MemberId;
10
+ /** Organization to act as for this request (e.g. `org_SGVsbG8gV29ybGQ`). Optional when your credentials reach a single organization. Required when they reach several — omitting it then returns 400 `organization_required`. A malformed value returns 400 `invalid_organization_header`, and naming an organization you do not have access to returns 403 `organization_access_denied`. */
11
+ "X-Vitable-Organization"?: VitableConnect.XVitableOrganization;
10
12
  }
@@ -7,4 +7,6 @@ import type * as VitableConnect from "../../../../index.mjs";
7
7
  */
8
8
  export interface ListEnrollmentsMembersRequest {
9
9
  member_id: VitableConnect.MemberId;
10
+ /** Organization to act as for this request (e.g. `org_SGVsbG8gV29ybGQ`). Optional when your credentials reach a single organization. Required when they reach several — omitting it then returns 400 `organization_required`. A malformed value returns 400 `invalid_organization_header`, and naming an organization you do not have access to returns 403 `organization_access_denied`. */
11
+ "X-Vitable-Organization"?: VitableConnect.XVitableOrganization;
10
12
  }
@@ -7,4 +7,6 @@ import type * as VitableConnect from "../../../../index.mjs";
7
7
  */
8
8
  export interface ListIdCardsMembersRequest {
9
9
  member_id: VitableConnect.MemberId;
10
+ /** Organization to act as for this request (e.g. `org_SGVsbG8gV29ybGQ`). Optional when your credentials reach a single organization. Required when they reach several — omitting it then returns 400 `organization_required`. A malformed value returns 400 `invalid_organization_header`, and naming an organization you do not have access to returns 403 `organization_access_denied`. */
11
+ "X-Vitable-Organization"?: VitableConnect.XVitableOrganization;
10
12
  }
@@ -13,4 +13,6 @@ export interface ListMembersRequest {
13
13
  page?: VitableConnect.Page;
14
14
  /** Case-insensitive search across member name, email, and phone number; exact match on member id (prefixed or raw uuid) */
15
15
  search?: VitableConnect.MemberSearch;
16
+ /** Organization to act as for this request (e.g. `org_SGVsbG8gV29ybGQ`). Optional when your credentials reach a single organization. Required when they reach several — omitting it then returns 400 `organization_required`. A malformed value returns 400 `invalid_organization_header`, and naming an organization you do not have access to returns 403 `organization_access_denied`. */
17
+ "X-Vitable-Organization"?: VitableConnect.XVitableOrganization;
16
18
  }
@@ -16,4 +16,6 @@ export interface ListQualifyingLifeEventsMembersRequest {
16
16
  page?: VitableConnect.Page;
17
17
  /** Optional. Filter to a single QLE status; omit to return all statuses. */
18
18
  status?: VitableConnect.Status;
19
+ /** Organization to act as for this request (e.g. `org_SGVsbG8gV29ybGQ`). Optional when your credentials reach a single organization. Required when they reach several — omitting it then returns 400 `organization_required`. A malformed value returns 400 `invalid_organization_header`, and naming an organization you do not have access to returns 403 `organization_access_denied`. */
20
+ "X-Vitable-Organization"?: VitableConnect.XVitableOrganization;
19
21
  }
@@ -14,7 +14,7 @@ export declare class OrganizationsClient {
14
14
  protected readonly _options: NormalizedClientOptionsWithAuth<OrganizationsClient.Options>;
15
15
  constructor(options?: OrganizationsClient.Options);
16
16
  /**
17
- * Lists the organizations the authenticated caller is an active member of (paginated). Returns an empty list when the caller belongs to no organizations.
17
+ * Lists the organizations the authenticated caller is an active member of (paginated), each with the role the caller holds in it. Returns an empty list when the caller belongs to no organizations.
18
18
  *
19
19
  * @param {OrganizationsClient.RequestOptions} requestOptions - Request-specific configuration.
20
20
  *
@@ -35,7 +35,7 @@ export declare class OrganizationsClient {
35
35
  list(requestOptions?: OrganizationsClient.RequestOptions): core.HttpResponsePromise<VitableConnect.OrganizationsListResponse>;
36
36
  private __list;
37
37
  /**
38
- * Onboards the authenticated user's partner Organization: creates the local Organization + the creator's admin membership atomically, then mirrors it to WorkOS (creates the WorkOS org and binds the creator as admin). 409 `organization_already_exists` when the user already has an organization (v0: one organization per user).
38
+ * Onboards the authenticated user's partner Organization: creates the local Organization + the creator's admin membership atomically, then mirrors it to WorkOS (creates the WorkOS org and binds the creator as admin). A user may hold several organizations and selects which one a request acts as with the `X-Vitable-Organization` header. The founder's email domain is claimed only when no other organization holds it, so a taken domain is left with its owner rather than rejected.
39
39
  *
40
40
  * @param {VitableConnect.CreateOrganizationRequest} request
41
41
  * @param {OrganizationsClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -24,7 +24,7 @@ export class OrganizationsClient {
24
24
  this._options = normalizeClientOptionsWithAuth(options);
25
25
  }
26
26
  /**
27
- * Lists the organizations the authenticated caller is an active member of (paginated). Returns an empty list when the caller belongs to no organizations.
27
+ * Lists the organizations the authenticated caller is an active member of (paginated), each with the role the caller holds in it. Returns an empty list when the caller belongs to no organizations.
28
28
  *
29
29
  * @param {OrganizationsClient.RequestOptions} requestOptions - Request-specific configuration.
30
30
  *
@@ -97,7 +97,7 @@ export class OrganizationsClient {
97
97
  });
98
98
  }
99
99
  /**
100
- * Onboards the authenticated user's partner Organization: creates the local Organization + the creator's admin membership atomically, then mirrors it to WorkOS (creates the WorkOS org and binds the creator as admin). 409 `organization_already_exists` when the user already has an organization (v0: one organization per user).
100
+ * Onboards the authenticated user's partner Organization: creates the local Organization + the creator's admin membership atomically, then mirrors it to WorkOS (creates the WorkOS org and binds the creator as admin). A user may hold several organizations and selects which one a request acts as with the `X-Vitable-Organization` header. The founder's email domain is claimed only when no other organization holds it, so a taken domain is left with its owner rather than rejected.
101
101
  *
102
102
  * @param {VitableConnect.CreateOrganizationRequest} request
103
103
  * @param {OrganizationsClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -10,5 +10,5 @@ export interface CreateOrganizationRequest {
10
10
  /** Legal or trading name of the organization. */
11
11
  name: string;
12
12
  /** Category of organization being onboarded. */
13
- type?: VitableConnect.CreateOrganizationRequestType | null;
13
+ type?: VitableConnect.OrganizationType | null;
14
14
  }
@@ -0,0 +1,38 @@
1
+ import type * as VitableConnect from "../index.mjs";
2
+ export interface OrganizationMembership {
3
+ /** Prefixed organization identifier (`org_<base64-encoded-uuid>`). */
4
+ id: string;
5
+ /** Human-readable organization name. */
6
+ name: string;
7
+ /**
8
+ * Partner type (e.g. BROKERAGE, TPA).
9
+ *
10
+ * * `BROKERAGE` - Brokerage
11
+ * * `TPA` - TPA
12
+ * * `GENERAL_AGENT` - General Agent
13
+ * * `CHANNEL_PARTNER` - Channel Partner
14
+ * * `CONSULTING_FIRM` - Consulting Firm
15
+ * * `API_PLATFORM` - API Platform
16
+ */
17
+ type: VitableConnect.OrganizationType | null;
18
+ /** IdP-issued tenant id (WorkOS org id). */
19
+ idp_org_id: string | null;
20
+ /**
21
+ * IdP that minted idp_org_id (e.g. 'workos').
22
+ *
23
+ * * `workos` - WorkOS
24
+ * * `vitable` - Vitable
25
+ */
26
+ idp_provider: VitableConnect.IdpProvider | null;
27
+ /** Whether this organization reads across every organization. */
28
+ super_in: boolean;
29
+ /**
30
+ * The caller's role in this organization.
31
+ *
32
+ * * `ADMIN` - Admin
33
+ * * `OPERATIONS` - Operations
34
+ * * `SALES` - Sales
35
+ * * `ENROLLMENT_AGENT` - Enrollment Agent
36
+ */
37
+ role: VitableConnect.OrganizationUserRole;
38
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -1,10 +1,10 @@
1
1
  /**
2
- * * `BROKERAGE` - Brokerage
2
+ * * `BROKERAGE` - BROKERAGE
3
3
  * * `TPA` - TPA
4
- * * `GENERAL_AGENT` - General Agent
5
- * * `CHANNEL_PARTNER` - Channel Partner
6
- * * `CONSULTING_FIRM` - Consulting Firm
7
- * * `API_PLATFORM` - API Platform
4
+ * * `GENERAL_AGENT` - GENERAL_AGENT
5
+ * * `CHANNEL_PARTNER` - CHANNEL_PARTNER
6
+ * * `CONSULTING_FIRM` - CONSULTING_FIRM
7
+ * * `API_PLATFORM` - API_PLATFORM
8
8
  */
9
9
  export declare const OrganizationType: {
10
10
  readonly Brokerage: "BROKERAGE";
@@ -1,11 +1,11 @@
1
1
  // This file was auto-generated by Fern from our API Definition.
2
2
  /**
3
- * * `BROKERAGE` - Brokerage
3
+ * * `BROKERAGE` - BROKERAGE
4
4
  * * `TPA` - TPA
5
- * * `GENERAL_AGENT` - General Agent
6
- * * `CHANNEL_PARTNER` - Channel Partner
7
- * * `CONSULTING_FIRM` - Consulting Firm
8
- * * `API_PLATFORM` - API Platform
5
+ * * `GENERAL_AGENT` - GENERAL_AGENT
6
+ * * `CHANNEL_PARTNER` - CHANNEL_PARTNER
7
+ * * `CONSULTING_FIRM` - CONSULTING_FIRM
8
+ * * `API_PLATFORM` - API_PLATFORM
9
9
  */
10
10
  export const OrganizationType = {
11
11
  Brokerage: "BROKERAGE",
@@ -0,0 +1,13 @@
1
+ /**
2
+ * * `ADMIN` - Admin
3
+ * * `OPERATIONS` - Operations
4
+ * * `SALES` - Sales
5
+ * * `ENROLLMENT_AGENT` - Enrollment Agent
6
+ */
7
+ export declare const OrganizationUserRole: {
8
+ readonly Admin: "ADMIN";
9
+ readonly Operations: "OPERATIONS";
10
+ readonly Sales: "SALES";
11
+ readonly EnrollmentAgent: "ENROLLMENT_AGENT";
12
+ };
13
+ export type OrganizationUserRole = (typeof OrganizationUserRole)[keyof typeof OrganizationUserRole];
@@ -0,0 +1,13 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ /**
3
+ * * `ADMIN` - Admin
4
+ * * `OPERATIONS` - Operations
5
+ * * `SALES` - Sales
6
+ * * `ENROLLMENT_AGENT` - Enrollment Agent
7
+ */
8
+ export const OrganizationUserRole = {
9
+ Admin: "ADMIN",
10
+ Operations: "OPERATIONS",
11
+ Sales: "SALES",
12
+ EnrollmentAgent: "ENROLLMENT_AGENT",
13
+ };
@@ -4,7 +4,7 @@ import type * as VitableConnect from "../index.mjs";
4
4
  */
5
5
  export interface OrganizationsListResponse {
6
6
  /** This page of organizations. */
7
- organizations: VitableConnect.Organization[];
7
+ organizations: VitableConnect.OrganizationMembership[];
8
8
  /** Total number of organizations the caller belongs to. */
9
9
  total: number;
10
10
  }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Organization to act as for this request (e.g. `org_SGVsbG8gV29ybGQ`). Optional when your credentials reach a single organization. Required when they reach several — omitting it then returns 400 `organization_required`. A malformed value returns 400 `invalid_organization_header`, and naming an organization you do not have access to returns 403 `organization_access_denied`.
3
+ */
4
+ export type XVitableOrganization = string;
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -32,7 +32,6 @@ export * from "./ContributionTier.mjs";
32
32
  export * from "./CoverageTier.mjs";
33
33
  export * from "./CreatedAfter.mjs";
34
34
  export * from "./CreatedBefore.mjs";
35
- export * from "./CreateOrganizationRequestType.mjs";
36
35
  export * from "./DeductionDetail.mjs";
37
36
  export * from "./DeductionFrequency.mjs";
38
37
  export * from "./DigitalBenefitCard.mjs";
@@ -135,8 +134,10 @@ export * from "./OrganizationEmployer.mjs";
135
134
  export * from "./OrganizationEmployerListResponse.mjs";
136
135
  export * from "./OrganizationHrisProvider.mjs";
137
136
  export * from "./OrganizationHrisProvidersResponse.mjs";
137
+ export * from "./OrganizationMembership.mjs";
138
138
  export * from "./OrganizationsListResponse.mjs";
139
139
  export * from "./OrganizationType.mjs";
140
+ export * from "./OrganizationUserRole.mjs";
140
141
  export * from "./Page.mjs";
141
142
  export * from "./Pagination.mjs";
142
143
  export * from "./PayrollAccessSetupStatus.mjs";
@@ -173,3 +174,4 @@ export * from "./WebhookDelivery.mjs";
173
174
  export * from "./WebhookEvent.mjs";
174
175
  export * from "./WebhookEventListResponse.mjs";
175
176
  export * from "./WebhookEventResponse.mjs";
177
+ export * from "./XVitableOrganization.mjs";
@@ -32,7 +32,6 @@ export * from "./ContributionTier.mjs";
32
32
  export * from "./CoverageTier.mjs";
33
33
  export * from "./CreatedAfter.mjs";
34
34
  export * from "./CreatedBefore.mjs";
35
- export * from "./CreateOrganizationRequestType.mjs";
36
35
  export * from "./DeductionDetail.mjs";
37
36
  export * from "./DeductionFrequency.mjs";
38
37
  export * from "./DigitalBenefitCard.mjs";
@@ -135,8 +134,10 @@ export * from "./OrganizationEmployer.mjs";
135
134
  export * from "./OrganizationEmployerListResponse.mjs";
136
135
  export * from "./OrganizationHrisProvider.mjs";
137
136
  export * from "./OrganizationHrisProvidersResponse.mjs";
137
+ export * from "./OrganizationMembership.mjs";
138
138
  export * from "./OrganizationsListResponse.mjs";
139
139
  export * from "./OrganizationType.mjs";
140
+ export * from "./OrganizationUserRole.mjs";
140
141
  export * from "./Page.mjs";
141
142
  export * from "./Pagination.mjs";
142
143
  export * from "./PayrollAccessSetupStatus.mjs";
@@ -173,3 +174,4 @@ export * from "./WebhookDelivery.mjs";
173
174
  export * from "./WebhookEvent.mjs";
174
175
  export * from "./WebhookEventListResponse.mjs";
175
176
  export * from "./WebhookEventResponse.mjs";
177
+ export * from "./XVitableOrganization.mjs";
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "2.0.0";
1
+ export declare const SDK_VERSION = "3.0.0";
@@ -1 +1 @@
1
- export const SDK_VERSION = "2.0.0";
1
+ export const SDK_VERSION = "3.0.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitable-inc/vitable-connect",
3
- "version": "2.0.0",
3
+ "version": "3.0.0",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
package/reference.md CHANGED
@@ -1513,7 +1513,7 @@ await client.employers.updateSettings({
1513
1513
  </dl>
1514
1514
  </details>
1515
1515
 
1516
- <details><summary><code>client.employers.<a href="/src/api/resources/employers/client/Client.ts">listHrisProviders</a>() -> VitableConnect.OrganizationHrisProvidersResponse</code></summary>
1516
+ <details><summary><code>client.employers.<a href="/src/api/resources/employers/client/Client.ts">listHrisProviders</a>({ ...params }) -> VitableConnect.OrganizationHrisProvidersResponse</code></summary>
1517
1517
  <dl>
1518
1518
  <dd>
1519
1519
 
@@ -1556,6 +1556,14 @@ await client.employers.listHrisProviders();
1556
1556
  <dl>
1557
1557
  <dd>
1558
1558
 
1559
+ **request:** `VitableConnect.ListHrisProvidersEmployersRequest`
1560
+
1561
+ </dd>
1562
+ </dl>
1563
+
1564
+ <dl>
1565
+ <dd>
1566
+
1559
1567
  **requestOptions:** `EmployersClient.RequestOptions`
1560
1568
 
1561
1569
  </dd>
@@ -2618,7 +2626,7 @@ const response = page.response;
2618
2626
  <dl>
2619
2627
  <dd>
2620
2628
 
2621
- Lists the organizations the authenticated caller is an active member of (paginated). Returns an empty list when the caller belongs to no organizations.
2629
+ Lists the organizations the authenticated caller is an active member of (paginated), each with the role the caller holds in it. Returns an empty list when the caller belongs to no organizations.
2622
2630
  </dd>
2623
2631
  </dl>
2624
2632
  </dd>
@@ -2673,7 +2681,7 @@ await client.organizations.list();
2673
2681
  <dl>
2674
2682
  <dd>
2675
2683
 
2676
- Onboards the authenticated user's partner Organization: creates the local Organization + the creator's admin membership atomically, then mirrors it to WorkOS (creates the WorkOS org and binds the creator as admin). 409 `organization_already_exists` when the user already has an organization (v0: one organization per user).
2684
+ Onboards the authenticated user's partner Organization: creates the local Organization + the creator's admin membership atomically, then mirrors it to WorkOS (creates the WorkOS org and binds the creator as admin). A user may hold several organizations and selects which one a request acts as with the `X-Vitable-Organization` header. The founder's email domain is claimed only when no other organization holds it, so a taken domain is left with its owner rather than rejected.
2677
2685
  </dd>
2678
2686
  </dl>
2679
2687
  </dd>
@@ -1,17 +0,0 @@
1
- /**
2
- * * `BROKERAGE` - BROKERAGE
3
- * * `TPA` - TPA
4
- * * `GENERAL_AGENT` - GENERAL_AGENT
5
- * * `CHANNEL_PARTNER` - CHANNEL_PARTNER
6
- * * `CONSULTING_FIRM` - CONSULTING_FIRM
7
- * * `API_PLATFORM` - API_PLATFORM
8
- */
9
- export declare const CreateOrganizationRequestType: {
10
- readonly Brokerage: "BROKERAGE";
11
- readonly Tpa: "TPA";
12
- readonly GeneralAgent: "GENERAL_AGENT";
13
- readonly ChannelPartner: "CHANNEL_PARTNER";
14
- readonly ConsultingFirm: "CONSULTING_FIRM";
15
- readonly ApiPlatform: "API_PLATFORM";
16
- };
17
- export type CreateOrganizationRequestType = (typeof CreateOrganizationRequestType)[keyof typeof CreateOrganizationRequestType];
@@ -1,20 +0,0 @@
1
- "use strict";
2
- // This file was auto-generated by Fern from our API Definition.
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.CreateOrganizationRequestType = void 0;
5
- /**
6
- * * `BROKERAGE` - BROKERAGE
7
- * * `TPA` - TPA
8
- * * `GENERAL_AGENT` - GENERAL_AGENT
9
- * * `CHANNEL_PARTNER` - CHANNEL_PARTNER
10
- * * `CONSULTING_FIRM` - CONSULTING_FIRM
11
- * * `API_PLATFORM` - API_PLATFORM
12
- */
13
- exports.CreateOrganizationRequestType = {
14
- Brokerage: "BROKERAGE",
15
- Tpa: "TPA",
16
- GeneralAgent: "GENERAL_AGENT",
17
- ChannelPartner: "CHANNEL_PARTNER",
18
- ConsultingFirm: "CONSULTING_FIRM",
19
- ApiPlatform: "API_PLATFORM",
20
- };
@@ -1,17 +0,0 @@
1
- /**
2
- * * `BROKERAGE` - BROKERAGE
3
- * * `TPA` - TPA
4
- * * `GENERAL_AGENT` - GENERAL_AGENT
5
- * * `CHANNEL_PARTNER` - CHANNEL_PARTNER
6
- * * `CONSULTING_FIRM` - CONSULTING_FIRM
7
- * * `API_PLATFORM` - API_PLATFORM
8
- */
9
- export declare const CreateOrganizationRequestType: {
10
- readonly Brokerage: "BROKERAGE";
11
- readonly Tpa: "TPA";
12
- readonly GeneralAgent: "GENERAL_AGENT";
13
- readonly ChannelPartner: "CHANNEL_PARTNER";
14
- readonly ConsultingFirm: "CONSULTING_FIRM";
15
- readonly ApiPlatform: "API_PLATFORM";
16
- };
17
- export type CreateOrganizationRequestType = (typeof CreateOrganizationRequestType)[keyof typeof CreateOrganizationRequestType];
@@ -1,17 +0,0 @@
1
- // This file was auto-generated by Fern from our API Definition.
2
- /**
3
- * * `BROKERAGE` - BROKERAGE
4
- * * `TPA` - TPA
5
- * * `GENERAL_AGENT` - GENERAL_AGENT
6
- * * `CHANNEL_PARTNER` - CHANNEL_PARTNER
7
- * * `CONSULTING_FIRM` - CONSULTING_FIRM
8
- * * `API_PLATFORM` - API_PLATFORM
9
- */
10
- export const CreateOrganizationRequestType = {
11
- Brokerage: "BROKERAGE",
12
- Tpa: "TPA",
13
- GeneralAgent: "GENERAL_AGENT",
14
- ChannelPartner: "CHANNEL_PARTNER",
15
- ConsultingFirm: "CONSULTING_FIRM",
16
- ApiPlatform: "API_PLATFORM",
17
- };