@vitable-inc/vitable-connect 3.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.
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/api/resources/index.d.ts +0 -1
- package/dist/cjs/api/resources/index.js +0 -1
- package/dist/cjs/api/resources/organizations/client/Client.d.ts +1 -26
- package/dist/cjs/api/resources/organizations/client/Client.js +1 -79
- package/dist/cjs/api/resources/organizations/client/index.d.ts +1 -1
- package/dist/cjs/api/resources/organizations/client/index.js +0 -15
- package/dist/cjs/api/types/OrganizationType.d.ts +5 -5
- package/dist/cjs/api/types/OrganizationType.js +5 -5
- package/dist/cjs/api/types/index.d.ts +0 -1
- package/dist/cjs/api/types/index.js +0 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/api/resources/index.d.mts +0 -1
- package/dist/esm/api/resources/index.mjs +0 -1
- package/dist/esm/api/resources/organizations/client/Client.d.mts +1 -26
- package/dist/esm/api/resources/organizations/client/Client.mjs +1 -79
- package/dist/esm/api/resources/organizations/client/index.d.mts +1 -1
- package/dist/esm/api/resources/organizations/client/index.mjs +1 -1
- package/dist/esm/api/types/OrganizationType.d.mts +5 -5
- package/dist/esm/api/types/OrganizationType.mjs +5 -5
- package/dist/esm/api/types/index.d.mts +0 -1
- package/dist/esm/api/types/index.mjs +0 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +0 -66
- package/dist/cjs/api/resources/organizations/client/requests/CreateOrganizationRequest.d.ts +0 -14
- package/dist/cjs/api/resources/organizations/client/requests/CreateOrganizationRequest.js +0 -3
- package/dist/cjs/api/resources/organizations/client/requests/index.d.ts +0 -1
- package/dist/cjs/api/resources/organizations/client/requests/index.js +0 -2
- package/dist/cjs/api/types/Organization.d.ts +0 -29
- package/dist/cjs/api/types/Organization.js +0 -3
- package/dist/esm/api/resources/organizations/client/requests/CreateOrganizationRequest.d.mts +0 -14
- package/dist/esm/api/resources/organizations/client/requests/CreateOrganizationRequest.mjs +0 -2
- package/dist/esm/api/resources/organizations/client/requests/index.d.mts +0 -1
- package/dist/esm/api/resources/organizations/client/requests/index.mjs +0 -1
- package/dist/esm/api/types/Organization.d.mts +0 -29
- package/dist/esm/api/types/Organization.mjs +0 -2
package/dist/cjs/BaseClient.js
CHANGED
|
@@ -44,8 +44,8 @@ function normalizeClientOptions(options) {
|
|
|
44
44
|
const headers = (0, headers_js_1.mergeHeaders)({
|
|
45
45
|
"X-Fern-Language": "JavaScript",
|
|
46
46
|
"X-Fern-SDK-Name": "@vitable-inc/vitable-connect",
|
|
47
|
-
"X-Fern-SDK-Version": "
|
|
48
|
-
"User-Agent": "@vitable-inc/vitable-connect/
|
|
47
|
+
"X-Fern-SDK-Version": "4.0.0",
|
|
48
|
+
"User-Agent": "@vitable-inc/vitable-connect/4.0.0",
|
|
49
49
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
50
50
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
51
51
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
|
@@ -10,7 +10,6 @@ export * from "./groups/client/requests/index.js";
|
|
|
10
10
|
export * as groups from "./groups/index.js";
|
|
11
11
|
export * from "./members/client/requests/index.js";
|
|
12
12
|
export * as members from "./members/index.js";
|
|
13
|
-
export * from "./organizations/client/requests/index.js";
|
|
14
13
|
export * as organizations from "./organizations/index.js";
|
|
15
14
|
export * from "./plans/client/requests/index.js";
|
|
16
15
|
export * as plans from "./plans/index.js";
|
|
@@ -49,7 +49,6 @@ __exportStar(require("./groups/client/requests/index.js"), exports);
|
|
|
49
49
|
exports.groups = __importStar(require("./groups/index.js"));
|
|
50
50
|
__exportStar(require("./members/client/requests/index.js"), exports);
|
|
51
51
|
exports.members = __importStar(require("./members/index.js"));
|
|
52
|
-
__exportStar(require("./organizations/client/requests/index.js"), exports);
|
|
53
52
|
exports.organizations = __importStar(require("./organizations/index.js"));
|
|
54
53
|
__exportStar(require("./plans/client/requests/index.js"), exports);
|
|
55
54
|
exports.plans = __importStar(require("./plans/index.js"));
|
|
@@ -8,7 +8,7 @@ export declare namespace OrganizationsClient {
|
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* List the organizations the authenticated caller is an active member of, to discover the ids accepted by `X-Vitable-Organization`.
|
|
12
12
|
*/
|
|
13
13
|
export declare class OrganizationsClient {
|
|
14
14
|
protected readonly _options: NormalizedClientOptionsWithAuth<OrganizationsClient.Options>;
|
|
@@ -34,29 +34,4 @@ export declare class OrganizationsClient {
|
|
|
34
34
|
*/
|
|
35
35
|
list(requestOptions?: OrganizationsClient.RequestOptions): core.HttpResponsePromise<VitableConnect.OrganizationsListResponse>;
|
|
36
36
|
private __list;
|
|
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). 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
|
-
*
|
|
40
|
-
* @param {VitableConnect.CreateOrganizationRequest} request
|
|
41
|
-
* @param {OrganizationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
42
|
-
*
|
|
43
|
-
* @throws {@link VitableConnect.BadRequestError}
|
|
44
|
-
* @throws {@link VitableConnect.UnauthorizedError}
|
|
45
|
-
* @throws {@link VitableConnect.ForbiddenError}
|
|
46
|
-
* @throws {@link VitableConnect.NotFoundError}
|
|
47
|
-
* @throws {@link VitableConnect.ConflictError}
|
|
48
|
-
* @throws {@link VitableConnect.TooManyRequestsError}
|
|
49
|
-
* @throws {@link VitableConnect.InternalServerError}
|
|
50
|
-
* @throws {@link VitableConnect.BadGatewayError}
|
|
51
|
-
* @throws {@link errors.VitableConnectError}
|
|
52
|
-
* @throws {@link errors.VitableConnectTimeoutError}
|
|
53
|
-
*
|
|
54
|
-
* @example
|
|
55
|
-
* await client.organizations.create({
|
|
56
|
-
* name: "Acme Brokerage",
|
|
57
|
-
* type: "BROKERAGE"
|
|
58
|
-
* })
|
|
59
|
-
*/
|
|
60
|
-
create(request: VitableConnect.CreateOrganizationRequest, requestOptions?: OrganizationsClient.RequestOptions): core.HttpResponsePromise<VitableConnect.Organization>;
|
|
61
|
-
private __create;
|
|
62
37
|
}
|
|
@@ -47,13 +47,12 @@ exports.OrganizationsClient = void 0;
|
|
|
47
47
|
const BaseClient_js_1 = require("../../../../BaseClient.js");
|
|
48
48
|
const headers_js_1 = require("../../../../core/headers.js");
|
|
49
49
|
const core = __importStar(require("../../../../core/index.js"));
|
|
50
|
-
const requestBody_js_1 = require("../../../../core/requestBody.js");
|
|
51
50
|
const environments = __importStar(require("../../../../environments.js"));
|
|
52
51
|
const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatusCodeError.js");
|
|
53
52
|
const errors = __importStar(require("../../../../errors/index.js"));
|
|
54
53
|
const VitableConnect = __importStar(require("../../../index.js"));
|
|
55
54
|
/**
|
|
56
|
-
*
|
|
55
|
+
* List the organizations the authenticated caller is an active member of, to discover the ids accepted by `X-Vitable-Organization`.
|
|
57
56
|
*/
|
|
58
57
|
class OrganizationsClient {
|
|
59
58
|
constructor(options = {}) {
|
|
@@ -132,82 +131,5 @@ class OrganizationsClient {
|
|
|
132
131
|
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v1/organizations");
|
|
133
132
|
});
|
|
134
133
|
}
|
|
135
|
-
/**
|
|
136
|
-
* 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.
|
|
137
|
-
*
|
|
138
|
-
* @param {VitableConnect.CreateOrganizationRequest} request
|
|
139
|
-
* @param {OrganizationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
140
|
-
*
|
|
141
|
-
* @throws {@link VitableConnect.BadRequestError}
|
|
142
|
-
* @throws {@link VitableConnect.UnauthorizedError}
|
|
143
|
-
* @throws {@link VitableConnect.ForbiddenError}
|
|
144
|
-
* @throws {@link VitableConnect.NotFoundError}
|
|
145
|
-
* @throws {@link VitableConnect.ConflictError}
|
|
146
|
-
* @throws {@link VitableConnect.TooManyRequestsError}
|
|
147
|
-
* @throws {@link VitableConnect.InternalServerError}
|
|
148
|
-
* @throws {@link VitableConnect.BadGatewayError}
|
|
149
|
-
* @throws {@link errors.VitableConnectError}
|
|
150
|
-
* @throws {@link errors.VitableConnectTimeoutError}
|
|
151
|
-
*
|
|
152
|
-
* @example
|
|
153
|
-
* await client.organizations.create({
|
|
154
|
-
* name: "Acme Brokerage",
|
|
155
|
-
* type: "BROKERAGE"
|
|
156
|
-
* })
|
|
157
|
-
*/
|
|
158
|
-
create(request, requestOptions) {
|
|
159
|
-
return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions));
|
|
160
|
-
}
|
|
161
|
-
__create(request, requestOptions) {
|
|
162
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
163
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
164
|
-
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
165
|
-
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
166
|
-
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
167
|
-
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/organizations"),
|
|
168
|
-
method: "POST",
|
|
169
|
-
headers: _headers,
|
|
170
|
-
contentType: "application/json",
|
|
171
|
-
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
172
|
-
requestType: "json",
|
|
173
|
-
body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
174
|
-
timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
|
|
175
|
-
maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
|
|
176
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
177
|
-
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
178
|
-
logging: this._options.logging,
|
|
179
|
-
});
|
|
180
|
-
if (_response.ok) {
|
|
181
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
182
|
-
}
|
|
183
|
-
if (_response.error.reason === "status-code") {
|
|
184
|
-
switch (_response.error.statusCode) {
|
|
185
|
-
case 400:
|
|
186
|
-
throw new VitableConnect.BadRequestError(_response.error.body, _response.rawResponse);
|
|
187
|
-
case 401:
|
|
188
|
-
throw new VitableConnect.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
189
|
-
case 403:
|
|
190
|
-
throw new VitableConnect.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
191
|
-
case 404:
|
|
192
|
-
throw new VitableConnect.NotFoundError(_response.error.body, _response.rawResponse);
|
|
193
|
-
case 409:
|
|
194
|
-
throw new VitableConnect.ConflictError(_response.error.body, _response.rawResponse);
|
|
195
|
-
case 429:
|
|
196
|
-
throw new VitableConnect.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
197
|
-
case 500:
|
|
198
|
-
throw new VitableConnect.InternalServerError(_response.error.body, _response.rawResponse);
|
|
199
|
-
case 502:
|
|
200
|
-
throw new VitableConnect.BadGatewayError(_response.error.body, _response.rawResponse);
|
|
201
|
-
default:
|
|
202
|
-
throw new errors.VitableConnectError({
|
|
203
|
-
statusCode: _response.error.statusCode,
|
|
204
|
-
body: _response.error.body,
|
|
205
|
-
rawResponse: _response.rawResponse,
|
|
206
|
-
});
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v1/organizations");
|
|
210
|
-
});
|
|
211
|
-
}
|
|
212
134
|
}
|
|
213
135
|
exports.OrganizationsClient = OrganizationsClient;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export {};
|
|
@@ -1,17 +1,2 @@
|
|
|
1
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
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./requests/index.js"), exports);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* * `BROKERAGE` -
|
|
2
|
+
* * `BROKERAGE` - Brokerage
|
|
3
3
|
* * `TPA` - TPA
|
|
4
|
-
* * `GENERAL_AGENT` -
|
|
5
|
-
* * `CHANNEL_PARTNER` -
|
|
6
|
-
* * `CONSULTING_FIRM` -
|
|
7
|
-
* * `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";
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.OrganizationType = void 0;
|
|
5
5
|
/**
|
|
6
|
-
* * `BROKERAGE` -
|
|
6
|
+
* * `BROKERAGE` - Brokerage
|
|
7
7
|
* * `TPA` - TPA
|
|
8
|
-
* * `GENERAL_AGENT` -
|
|
9
|
-
* * `CHANNEL_PARTNER` -
|
|
10
|
-
* * `CONSULTING_FIRM` -
|
|
11
|
-
* * `API_PLATFORM` -
|
|
8
|
+
* * `GENERAL_AGENT` - General Agent
|
|
9
|
+
* * `CHANNEL_PARTNER` - Channel Partner
|
|
10
|
+
* * `CONSULTING_FIRM` - Consulting Firm
|
|
11
|
+
* * `API_PLATFORM` - API Platform
|
|
12
12
|
*/
|
|
13
13
|
exports.OrganizationType = {
|
|
14
14
|
Brokerage: "BROKERAGE",
|
|
@@ -129,7 +129,6 @@ export * from "./MemberStatus.js";
|
|
|
129
129
|
export * from "./MissingEmployeeResolution.js";
|
|
130
130
|
export * from "./NameSuffix.js";
|
|
131
131
|
export * from "./Offset.js";
|
|
132
|
-
export * from "./Organization.js";
|
|
133
132
|
export * from "./OrganizationEmployer.js";
|
|
134
133
|
export * from "./OrganizationEmployerListResponse.js";
|
|
135
134
|
export * from "./OrganizationHrisProvider.js";
|
|
@@ -145,7 +145,6 @@ __exportStar(require("./MemberStatus.js"), exports);
|
|
|
145
145
|
__exportStar(require("./MissingEmployeeResolution.js"), exports);
|
|
146
146
|
__exportStar(require("./NameSuffix.js"), exports);
|
|
147
147
|
__exportStar(require("./Offset.js"), exports);
|
|
148
|
-
__exportStar(require("./Organization.js"), exports);
|
|
149
148
|
__exportStar(require("./OrganizationEmployer.js"), exports);
|
|
150
149
|
__exportStar(require("./OrganizationEmployerListResponse.js"), exports);
|
|
151
150
|
__exportStar(require("./OrganizationHrisProvider.js"), exports);
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "
|
|
1
|
+
export declare const SDK_VERSION = "4.0.0";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/BaseClient.mjs
CHANGED
|
@@ -7,8 +7,8 @@ export function normalizeClientOptions(options) {
|
|
|
7
7
|
const headers = mergeHeaders({
|
|
8
8
|
"X-Fern-Language": "JavaScript",
|
|
9
9
|
"X-Fern-SDK-Name": "@vitable-inc/vitable-connect",
|
|
10
|
-
"X-Fern-SDK-Version": "
|
|
11
|
-
"User-Agent": "@vitable-inc/vitable-connect/
|
|
10
|
+
"X-Fern-SDK-Version": "4.0.0",
|
|
11
|
+
"User-Agent": "@vitable-inc/vitable-connect/4.0.0",
|
|
12
12
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
13
13
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
14
14
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
|
@@ -10,7 +10,6 @@ export * from "./groups/client/requests/index.mjs";
|
|
|
10
10
|
export * as groups from "./groups/index.mjs";
|
|
11
11
|
export * from "./members/client/requests/index.mjs";
|
|
12
12
|
export * as members from "./members/index.mjs";
|
|
13
|
-
export * from "./organizations/client/requests/index.mjs";
|
|
14
13
|
export * as organizations from "./organizations/index.mjs";
|
|
15
14
|
export * from "./plans/client/requests/index.mjs";
|
|
16
15
|
export * as plans from "./plans/index.mjs";
|
|
@@ -10,7 +10,6 @@ export * from "./groups/client/requests/index.mjs";
|
|
|
10
10
|
export * as groups from "./groups/index.mjs";
|
|
11
11
|
export * from "./members/client/requests/index.mjs";
|
|
12
12
|
export * as members from "./members/index.mjs";
|
|
13
|
-
export * from "./organizations/client/requests/index.mjs";
|
|
14
13
|
export * as organizations from "./organizations/index.mjs";
|
|
15
14
|
export * from "./plans/client/requests/index.mjs";
|
|
16
15
|
export * as plans from "./plans/index.mjs";
|
|
@@ -8,7 +8,7 @@ export declare namespace OrganizationsClient {
|
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* List the organizations the authenticated caller is an active member of, to discover the ids accepted by `X-Vitable-Organization`.
|
|
12
12
|
*/
|
|
13
13
|
export declare class OrganizationsClient {
|
|
14
14
|
protected readonly _options: NormalizedClientOptionsWithAuth<OrganizationsClient.Options>;
|
|
@@ -34,29 +34,4 @@ export declare class OrganizationsClient {
|
|
|
34
34
|
*/
|
|
35
35
|
list(requestOptions?: OrganizationsClient.RequestOptions): core.HttpResponsePromise<VitableConnect.OrganizationsListResponse>;
|
|
36
36
|
private __list;
|
|
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). 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
|
-
*
|
|
40
|
-
* @param {VitableConnect.CreateOrganizationRequest} request
|
|
41
|
-
* @param {OrganizationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
42
|
-
*
|
|
43
|
-
* @throws {@link VitableConnect.BadRequestError}
|
|
44
|
-
* @throws {@link VitableConnect.UnauthorizedError}
|
|
45
|
-
* @throws {@link VitableConnect.ForbiddenError}
|
|
46
|
-
* @throws {@link VitableConnect.NotFoundError}
|
|
47
|
-
* @throws {@link VitableConnect.ConflictError}
|
|
48
|
-
* @throws {@link VitableConnect.TooManyRequestsError}
|
|
49
|
-
* @throws {@link VitableConnect.InternalServerError}
|
|
50
|
-
* @throws {@link VitableConnect.BadGatewayError}
|
|
51
|
-
* @throws {@link errors.VitableConnectError}
|
|
52
|
-
* @throws {@link errors.VitableConnectTimeoutError}
|
|
53
|
-
*
|
|
54
|
-
* @example
|
|
55
|
-
* await client.organizations.create({
|
|
56
|
-
* name: "Acme Brokerage",
|
|
57
|
-
* type: "BROKERAGE"
|
|
58
|
-
* })
|
|
59
|
-
*/
|
|
60
|
-
create(request: VitableConnect.CreateOrganizationRequest, requestOptions?: OrganizationsClient.RequestOptions): core.HttpResponsePromise<VitableConnect.Organization>;
|
|
61
|
-
private __create;
|
|
62
37
|
}
|
|
@@ -11,13 +11,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
12
12
|
import { mergeHeaders } from "../../../../core/headers.mjs";
|
|
13
13
|
import * as core from "../../../../core/index.mjs";
|
|
14
|
-
import { mergeAdditionalBodyParameters } from "../../../../core/requestBody.mjs";
|
|
15
14
|
import * as environments from "../../../../environments.mjs";
|
|
16
15
|
import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
|
|
17
16
|
import * as errors from "../../../../errors/index.mjs";
|
|
18
17
|
import * as VitableConnect from "../../../index.mjs";
|
|
19
18
|
/**
|
|
20
|
-
*
|
|
19
|
+
* List the organizations the authenticated caller is an active member of, to discover the ids accepted by `X-Vitable-Organization`.
|
|
21
20
|
*/
|
|
22
21
|
export class OrganizationsClient {
|
|
23
22
|
constructor(options = {}) {
|
|
@@ -96,81 +95,4 @@ export class OrganizationsClient {
|
|
|
96
95
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/organizations");
|
|
97
96
|
});
|
|
98
97
|
}
|
|
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). 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
|
-
*
|
|
102
|
-
* @param {VitableConnect.CreateOrganizationRequest} request
|
|
103
|
-
* @param {OrganizationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
104
|
-
*
|
|
105
|
-
* @throws {@link VitableConnect.BadRequestError}
|
|
106
|
-
* @throws {@link VitableConnect.UnauthorizedError}
|
|
107
|
-
* @throws {@link VitableConnect.ForbiddenError}
|
|
108
|
-
* @throws {@link VitableConnect.NotFoundError}
|
|
109
|
-
* @throws {@link VitableConnect.ConflictError}
|
|
110
|
-
* @throws {@link VitableConnect.TooManyRequestsError}
|
|
111
|
-
* @throws {@link VitableConnect.InternalServerError}
|
|
112
|
-
* @throws {@link VitableConnect.BadGatewayError}
|
|
113
|
-
* @throws {@link errors.VitableConnectError}
|
|
114
|
-
* @throws {@link errors.VitableConnectTimeoutError}
|
|
115
|
-
*
|
|
116
|
-
* @example
|
|
117
|
-
* await client.organizations.create({
|
|
118
|
-
* name: "Acme Brokerage",
|
|
119
|
-
* type: "BROKERAGE"
|
|
120
|
-
* })
|
|
121
|
-
*/
|
|
122
|
-
create(request, requestOptions) {
|
|
123
|
-
return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions));
|
|
124
|
-
}
|
|
125
|
-
__create(request, requestOptions) {
|
|
126
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
127
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
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);
|
|
130
|
-
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
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/organizations"),
|
|
132
|
-
method: "POST",
|
|
133
|
-
headers: _headers,
|
|
134
|
-
contentType: "application/json",
|
|
135
|
-
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
136
|
-
requestType: "json",
|
|
137
|
-
body: mergeAdditionalBodyParameters(request, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
138
|
-
timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
|
|
139
|
-
maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
|
|
140
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
141
|
-
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
142
|
-
logging: this._options.logging,
|
|
143
|
-
});
|
|
144
|
-
if (_response.ok) {
|
|
145
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
146
|
-
}
|
|
147
|
-
if (_response.error.reason === "status-code") {
|
|
148
|
-
switch (_response.error.statusCode) {
|
|
149
|
-
case 400:
|
|
150
|
-
throw new VitableConnect.BadRequestError(_response.error.body, _response.rawResponse);
|
|
151
|
-
case 401:
|
|
152
|
-
throw new VitableConnect.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
153
|
-
case 403:
|
|
154
|
-
throw new VitableConnect.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
155
|
-
case 404:
|
|
156
|
-
throw new VitableConnect.NotFoundError(_response.error.body, _response.rawResponse);
|
|
157
|
-
case 409:
|
|
158
|
-
throw new VitableConnect.ConflictError(_response.error.body, _response.rawResponse);
|
|
159
|
-
case 429:
|
|
160
|
-
throw new VitableConnect.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
161
|
-
case 500:
|
|
162
|
-
throw new VitableConnect.InternalServerError(_response.error.body, _response.rawResponse);
|
|
163
|
-
case 502:
|
|
164
|
-
throw new VitableConnect.BadGatewayError(_response.error.body, _response.rawResponse);
|
|
165
|
-
default:
|
|
166
|
-
throw new errors.VitableConnectError({
|
|
167
|
-
statusCode: _response.error.statusCode,
|
|
168
|
-
body: _response.error.body,
|
|
169
|
-
rawResponse: _response.rawResponse,
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/organizations");
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
98
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* * `BROKERAGE` -
|
|
2
|
+
* * `BROKERAGE` - Brokerage
|
|
3
3
|
* * `TPA` - TPA
|
|
4
|
-
* * `GENERAL_AGENT` -
|
|
5
|
-
* * `CHANNEL_PARTNER` -
|
|
6
|
-
* * `CONSULTING_FIRM` -
|
|
7
|
-
* * `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` -
|
|
3
|
+
* * `BROKERAGE` - Brokerage
|
|
4
4
|
* * `TPA` - TPA
|
|
5
|
-
* * `GENERAL_AGENT` -
|
|
6
|
-
* * `CHANNEL_PARTNER` -
|
|
7
|
-
* * `CONSULTING_FIRM` -
|
|
8
|
-
* * `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",
|
|
@@ -129,7 +129,6 @@ export * from "./MemberStatus.mjs";
|
|
|
129
129
|
export * from "./MissingEmployeeResolution.mjs";
|
|
130
130
|
export * from "./NameSuffix.mjs";
|
|
131
131
|
export * from "./Offset.mjs";
|
|
132
|
-
export * from "./Organization.mjs";
|
|
133
132
|
export * from "./OrganizationEmployer.mjs";
|
|
134
133
|
export * from "./OrganizationEmployerListResponse.mjs";
|
|
135
134
|
export * from "./OrganizationHrisProvider.mjs";
|
|
@@ -129,7 +129,6 @@ export * from "./MemberStatus.mjs";
|
|
|
129
129
|
export * from "./MissingEmployeeResolution.mjs";
|
|
130
130
|
export * from "./NameSuffix.mjs";
|
|
131
131
|
export * from "./Offset.mjs";
|
|
132
|
-
export * from "./Organization.mjs";
|
|
133
132
|
export * from "./OrganizationEmployer.mjs";
|
|
134
133
|
export * from "./OrganizationEmployerListResponse.mjs";
|
|
135
134
|
export * from "./OrganizationHrisProvider.mjs";
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "
|
|
1
|
+
export declare const SDK_VERSION = "4.0.0";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "
|
|
1
|
+
export const SDK_VERSION = "4.0.0";
|
package/package.json
CHANGED
package/reference.md
CHANGED
|
@@ -2665,72 +2665,6 @@ await client.organizations.list();
|
|
|
2665
2665
|
</dl>
|
|
2666
2666
|
|
|
2667
2667
|
|
|
2668
|
-
</dd>
|
|
2669
|
-
</dl>
|
|
2670
|
-
</details>
|
|
2671
|
-
|
|
2672
|
-
<details><summary><code>client.organizations.<a href="/src/api/resources/organizations/client/Client.ts">create</a>({ ...params }) -> VitableConnect.Organization</code></summary>
|
|
2673
|
-
<dl>
|
|
2674
|
-
<dd>
|
|
2675
|
-
|
|
2676
|
-
#### 📝 Description
|
|
2677
|
-
|
|
2678
|
-
<dl>
|
|
2679
|
-
<dd>
|
|
2680
|
-
|
|
2681
|
-
<dl>
|
|
2682
|
-
<dd>
|
|
2683
|
-
|
|
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.
|
|
2685
|
-
</dd>
|
|
2686
|
-
</dl>
|
|
2687
|
-
</dd>
|
|
2688
|
-
</dl>
|
|
2689
|
-
|
|
2690
|
-
#### 🔌 Usage
|
|
2691
|
-
|
|
2692
|
-
<dl>
|
|
2693
|
-
<dd>
|
|
2694
|
-
|
|
2695
|
-
<dl>
|
|
2696
|
-
<dd>
|
|
2697
|
-
|
|
2698
|
-
```typescript
|
|
2699
|
-
await client.organizations.create({
|
|
2700
|
-
name: "Acme Brokerage",
|
|
2701
|
-
type: "BROKERAGE"
|
|
2702
|
-
});
|
|
2703
|
-
|
|
2704
|
-
```
|
|
2705
|
-
</dd>
|
|
2706
|
-
</dl>
|
|
2707
|
-
</dd>
|
|
2708
|
-
</dl>
|
|
2709
|
-
|
|
2710
|
-
#### ⚙️ Parameters
|
|
2711
|
-
|
|
2712
|
-
<dl>
|
|
2713
|
-
<dd>
|
|
2714
|
-
|
|
2715
|
-
<dl>
|
|
2716
|
-
<dd>
|
|
2717
|
-
|
|
2718
|
-
**request:** `VitableConnect.CreateOrganizationRequest`
|
|
2719
|
-
|
|
2720
|
-
</dd>
|
|
2721
|
-
</dl>
|
|
2722
|
-
|
|
2723
|
-
<dl>
|
|
2724
|
-
<dd>
|
|
2725
|
-
|
|
2726
|
-
**requestOptions:** `OrganizationsClient.RequestOptions`
|
|
2727
|
-
|
|
2728
|
-
</dd>
|
|
2729
|
-
</dl>
|
|
2730
|
-
</dd>
|
|
2731
|
-
</dl>
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
2668
|
</dd>
|
|
2735
2669
|
</dl>
|
|
2736
2670
|
</details>
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type * as VitableConnect from "../../../../index.js";
|
|
2
|
-
/**
|
|
3
|
-
* @example
|
|
4
|
-
* {
|
|
5
|
-
* name: "Acme Brokerage",
|
|
6
|
-
* type: "BROKERAGE"
|
|
7
|
-
* }
|
|
8
|
-
*/
|
|
9
|
-
export interface CreateOrganizationRequest {
|
|
10
|
-
/** Legal or trading name of the organization. */
|
|
11
|
-
name: string;
|
|
12
|
-
/** Category of organization being onboarded. */
|
|
13
|
-
type?: VitableConnect.OrganizationType | null;
|
|
14
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type { CreateOrganizationRequest } from "./CreateOrganizationRequest.js";
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type * as VitableConnect from "../index.js";
|
|
2
|
-
export interface Organization {
|
|
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
|
-
}
|
package/dist/esm/api/resources/organizations/client/requests/CreateOrganizationRequest.d.mts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type * as VitableConnect from "../../../../index.mjs";
|
|
2
|
-
/**
|
|
3
|
-
* @example
|
|
4
|
-
* {
|
|
5
|
-
* name: "Acme Brokerage",
|
|
6
|
-
* type: "BROKERAGE"
|
|
7
|
-
* }
|
|
8
|
-
*/
|
|
9
|
-
export interface CreateOrganizationRequest {
|
|
10
|
-
/** Legal or trading name of the organization. */
|
|
11
|
-
name: string;
|
|
12
|
-
/** Category of organization being onboarded. */
|
|
13
|
-
type?: VitableConnect.OrganizationType | null;
|
|
14
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type { CreateOrganizationRequest } from "./CreateOrganizationRequest.mjs";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type * as VitableConnect from "../index.mjs";
|
|
2
|
-
export interface Organization {
|
|
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
|
-
}
|