@visgate_ai/client 0.4.1 → 0.4.2
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/index.cjs +28 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +17 -3
- package/dist/index.d.ts +17 -3
- package/dist/index.js +28 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -551,6 +551,17 @@ var HfModels = class {
|
|
|
551
551
|
};
|
|
552
552
|
|
|
553
553
|
// src/resources/invitations.ts
|
|
554
|
+
function invitationPreviewFromResponse(data) {
|
|
555
|
+
return {
|
|
556
|
+
id: data.id ?? "",
|
|
557
|
+
organizationId: data.organization_id ?? "",
|
|
558
|
+
organizationName: data.organization_name ?? "",
|
|
559
|
+
role: data.role ?? "member",
|
|
560
|
+
invitedByEmail: data.invited_by_email ?? "",
|
|
561
|
+
status: data.status ?? "pending",
|
|
562
|
+
expiresAt: data.expires_at ?? ""
|
|
563
|
+
};
|
|
564
|
+
}
|
|
554
565
|
function invitationFromResponse(data) {
|
|
555
566
|
return {
|
|
556
567
|
id: data.id ?? "",
|
|
@@ -589,6 +600,21 @@ var Invitations = class {
|
|
|
589
600
|
const data = await this.client._request("GET", "/invitations/pending");
|
|
590
601
|
return data.map(invitationFromResponse);
|
|
591
602
|
}
|
|
603
|
+
/** Public preview of an invitation (no auth). Use for invite landing pages. */
|
|
604
|
+
async getPreview(inviteId) {
|
|
605
|
+
const url = `${this.client.baseUrl}/invite/${encodeURIComponent(inviteId)}`;
|
|
606
|
+
const response = await fetch(url, {
|
|
607
|
+
method: "GET",
|
|
608
|
+
headers: { "Content-Type": "application/json" }
|
|
609
|
+
});
|
|
610
|
+
const data = await handleResponse(response);
|
|
611
|
+
return invitationPreviewFromResponse(data);
|
|
612
|
+
}
|
|
613
|
+
/** List invitations sent by organizations the current user is a member of. */
|
|
614
|
+
async listSent() {
|
|
615
|
+
const data = await this.client._request("GET", "/invitations/sent");
|
|
616
|
+
return data.map(invitationFromResponse);
|
|
617
|
+
}
|
|
592
618
|
/** Accept a pending invitation. */
|
|
593
619
|
async accept(inviteId) {
|
|
594
620
|
return await this.client._request("POST", `/invitations/${encodeURIComponent(inviteId)}/accept`);
|
|
@@ -982,7 +1008,7 @@ var DEFAULT_BASE_URL = "https://visgateai.com/api/v1";
|
|
|
982
1008
|
var DEFAULT_TIMEOUT = 12e4;
|
|
983
1009
|
var DEFAULT_MAX_RETRIES = 2;
|
|
984
1010
|
var RETRYABLE_STATUS_CODES = /* @__PURE__ */ new Set([429, 500, 502, 503, 504]);
|
|
985
|
-
var SDK_VERSION = "0.
|
|
1011
|
+
var SDK_VERSION = "0.4.2";
|
|
986
1012
|
function getVersion() {
|
|
987
1013
|
try {
|
|
988
1014
|
if (typeof __VERSION__ !== "undefined") return __VERSION__;
|
|
@@ -1184,7 +1210,7 @@ var AsyncClient = class extends Client {
|
|
|
1184
1210
|
};
|
|
1185
1211
|
|
|
1186
1212
|
// src/index.ts
|
|
1187
|
-
var VERSION = "0.
|
|
1213
|
+
var VERSION = "0.4.2";
|
|
1188
1214
|
|
|
1189
1215
|
exports.AsyncClient = AsyncClient;
|
|
1190
1216
|
exports.AuthenticationError = AuthenticationError;
|