@visgate_ai/client 0.4.1 → 0.4.3

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.d.cts CHANGED
@@ -298,8 +298,18 @@ declare class HfModels {
298
298
  list(options?: HfModelsListOptions): Promise<HfModelInfo[]>;
299
299
  }
300
300
 
301
- /** Invitations resource: create, list, cancel, accept, decline */
301
+ /** Invitations resource: create, list, cancel, accept, decline, getPreview, listSent */
302
302
 
303
+ /** Public invitation preview (no auth). Does not include invitee email. */
304
+ interface InvitationPreview {
305
+ id: string;
306
+ organizationId: string;
307
+ organizationName: string;
308
+ role: string;
309
+ invitedByEmail: string;
310
+ status: string;
311
+ expiresAt: string;
312
+ }
303
313
  interface Invitation {
304
314
  id: string;
305
315
  organizationId: string;
@@ -319,10 +329,16 @@ declare class Invitations {
319
329
  create(orgId: string, email: string, role: "admin" | "member"): Promise<Invitation>;
320
330
  /** List pending invitations for an organization. */
321
331
  listForOrg(orgId: string): Promise<Invitation[]>;
332
+ /** List all invitations for an organization regardless of status, ordered newest first. */
333
+ listAllForOrg(orgId: string): Promise<Invitation[]>;
322
334
  /** Cancel a pending invitation. */
323
335
  cancel(orgId: string, inviteId: string): Promise<void>;
324
336
  /** List pending invitations for the current user. */
325
337
  listPending(): Promise<Invitation[]>;
338
+ /** Public preview of an invitation (no auth). Use for invite landing pages. */
339
+ getPreview(inviteId: string): Promise<InvitationPreview>;
340
+ /** List invitations sent by organizations the current user is a member of. */
341
+ listSent(): Promise<Invitation[]>;
326
342
  /** Accept a pending invitation. */
327
343
  accept(inviteId: string): Promise<Record<string, unknown>>;
328
344
  /** Decline a pending invitation. */
@@ -760,6 +776,6 @@ declare class VisgateConnectionError extends VisgateError {
760
776
  * Visgate JavaScript/TypeScript SDK — unified client for the Visgate vision AI gateway.
761
777
  */
762
778
 
763
- declare const VERSION = "0.3.5";
779
+ declare const VERSION = "0.4.2";
764
780
 
765
- export { AsyncClient, type AsyncVideoAccepted, AuthenticationError, Billing, type BillingInfo, type CheckoutOptions, Client, type ClientOptions, type DashboardResponse, type DeploymentCostResponse, type DeploymentCreateOptions, type DeploymentGpuInfo, type DeploymentGpuListResponse, type DeploymentInfo, type DeploymentListResponse, type DeploymentLogEntry, type DeploymentLogsResponse, type DeploymentRunRequest, Deployments, type FeaturedSection, Generate, type GenerateResult, type HfModelInfo, HfModels, type HfModelsListOptions, type ImageResult, Images, type ImagesGenerateOptions, type Invitation, Invitations, type Member, type MemberPermissions, Members, type ModelInfo, type ModelPricing, Models, type ModelsListOptions, type ModelsResponse, type Organization, type OrganizationSummary, Organizations, type PricingResponse, type ProviderBalanceItem, type ProviderBalancesResponse, ProviderError, type ProviderKeyInfo, type ProviderKeysResponse, type ProviderValidationResult, Providers, RateLimitError, type RequestStatusResult, Requests, type StreamStatusEvent, Usage, type UsageSummary, VERSION, VIDEO_MODEL_PRESETS, ValidationError, type VideoResult, Videos, type VideosGenerateOptions, VisgateConnectionError, VisgateError, type VisgateErrorDetails, VisgateTimeoutError, billingInfoFromResponse, deploymentCostResponseFromResponse, deploymentGpuInfoFromResponse, deploymentGpuListResponseFromResponse, deploymentInfoFromResponse, deploymentListResponseFromResponse, deploymentLogsResponseFromResponse, featuredSectionFromResponse, generateResultFromResponse, imageResultFromResponse, invitationFromResponse, memberFromResponse, modelInfoFromResponse, modelPricingFromResponse, modelsResponseFromResponse, organizationFromResponse, organizationSummaryFromResponse, pricingResponseFromResponse, providerBalanceItemFromResponse, providerBalancesResponseFromResponse, providerKeyInfoFromResponse, providerKeysResponseFromResponse, providerValidationResultFromResponse, requestStatusFromResponse, usageSummaryFromResponse, videoResultFromResponse };
781
+ export { AsyncClient, type AsyncVideoAccepted, AuthenticationError, Billing, type BillingInfo, type CheckoutOptions, Client, type ClientOptions, type DashboardResponse, type DeploymentCostResponse, type DeploymentCreateOptions, type DeploymentGpuInfo, type DeploymentGpuListResponse, type DeploymentInfo, type DeploymentListResponse, type DeploymentLogEntry, type DeploymentLogsResponse, type DeploymentRunRequest, Deployments, type FeaturedSection, Generate, type GenerateResult, type HfModelInfo, HfModels, type HfModelsListOptions, type ImageResult, Images, type ImagesGenerateOptions, type Invitation, type InvitationPreview, Invitations, type Member, type MemberPermissions, Members, type ModelInfo, type ModelPricing, Models, type ModelsListOptions, type ModelsResponse, type Organization, type OrganizationSummary, Organizations, type PricingResponse, type ProviderBalanceItem, type ProviderBalancesResponse, ProviderError, type ProviderKeyInfo, type ProviderKeysResponse, type ProviderValidationResult, Providers, RateLimitError, type RequestStatusResult, Requests, type StreamStatusEvent, Usage, type UsageSummary, VERSION, VIDEO_MODEL_PRESETS, ValidationError, type VideoResult, Videos, type VideosGenerateOptions, VisgateConnectionError, VisgateError, type VisgateErrorDetails, VisgateTimeoutError, billingInfoFromResponse, deploymentCostResponseFromResponse, deploymentGpuInfoFromResponse, deploymentGpuListResponseFromResponse, deploymentInfoFromResponse, deploymentListResponseFromResponse, deploymentLogsResponseFromResponse, featuredSectionFromResponse, generateResultFromResponse, imageResultFromResponse, invitationFromResponse, memberFromResponse, modelInfoFromResponse, modelPricingFromResponse, modelsResponseFromResponse, organizationFromResponse, organizationSummaryFromResponse, pricingResponseFromResponse, providerBalanceItemFromResponse, providerBalancesResponseFromResponse, providerKeyInfoFromResponse, providerKeysResponseFromResponse, providerValidationResultFromResponse, requestStatusFromResponse, usageSummaryFromResponse, videoResultFromResponse };
package/dist/index.d.ts CHANGED
@@ -298,8 +298,18 @@ declare class HfModels {
298
298
  list(options?: HfModelsListOptions): Promise<HfModelInfo[]>;
299
299
  }
300
300
 
301
- /** Invitations resource: create, list, cancel, accept, decline */
301
+ /** Invitations resource: create, list, cancel, accept, decline, getPreview, listSent */
302
302
 
303
+ /** Public invitation preview (no auth). Does not include invitee email. */
304
+ interface InvitationPreview {
305
+ id: string;
306
+ organizationId: string;
307
+ organizationName: string;
308
+ role: string;
309
+ invitedByEmail: string;
310
+ status: string;
311
+ expiresAt: string;
312
+ }
303
313
  interface Invitation {
304
314
  id: string;
305
315
  organizationId: string;
@@ -319,10 +329,16 @@ declare class Invitations {
319
329
  create(orgId: string, email: string, role: "admin" | "member"): Promise<Invitation>;
320
330
  /** List pending invitations for an organization. */
321
331
  listForOrg(orgId: string): Promise<Invitation[]>;
332
+ /** List all invitations for an organization regardless of status, ordered newest first. */
333
+ listAllForOrg(orgId: string): Promise<Invitation[]>;
322
334
  /** Cancel a pending invitation. */
323
335
  cancel(orgId: string, inviteId: string): Promise<void>;
324
336
  /** List pending invitations for the current user. */
325
337
  listPending(): Promise<Invitation[]>;
338
+ /** Public preview of an invitation (no auth). Use for invite landing pages. */
339
+ getPreview(inviteId: string): Promise<InvitationPreview>;
340
+ /** List invitations sent by organizations the current user is a member of. */
341
+ listSent(): Promise<Invitation[]>;
326
342
  /** Accept a pending invitation. */
327
343
  accept(inviteId: string): Promise<Record<string, unknown>>;
328
344
  /** Decline a pending invitation. */
@@ -760,6 +776,6 @@ declare class VisgateConnectionError extends VisgateError {
760
776
  * Visgate JavaScript/TypeScript SDK — unified client for the Visgate vision AI gateway.
761
777
  */
762
778
 
763
- declare const VERSION = "0.3.5";
779
+ declare const VERSION = "0.4.2";
764
780
 
765
- export { AsyncClient, type AsyncVideoAccepted, AuthenticationError, Billing, type BillingInfo, type CheckoutOptions, Client, type ClientOptions, type DashboardResponse, type DeploymentCostResponse, type DeploymentCreateOptions, type DeploymentGpuInfo, type DeploymentGpuListResponse, type DeploymentInfo, type DeploymentListResponse, type DeploymentLogEntry, type DeploymentLogsResponse, type DeploymentRunRequest, Deployments, type FeaturedSection, Generate, type GenerateResult, type HfModelInfo, HfModels, type HfModelsListOptions, type ImageResult, Images, type ImagesGenerateOptions, type Invitation, Invitations, type Member, type MemberPermissions, Members, type ModelInfo, type ModelPricing, Models, type ModelsListOptions, type ModelsResponse, type Organization, type OrganizationSummary, Organizations, type PricingResponse, type ProviderBalanceItem, type ProviderBalancesResponse, ProviderError, type ProviderKeyInfo, type ProviderKeysResponse, type ProviderValidationResult, Providers, RateLimitError, type RequestStatusResult, Requests, type StreamStatusEvent, Usage, type UsageSummary, VERSION, VIDEO_MODEL_PRESETS, ValidationError, type VideoResult, Videos, type VideosGenerateOptions, VisgateConnectionError, VisgateError, type VisgateErrorDetails, VisgateTimeoutError, billingInfoFromResponse, deploymentCostResponseFromResponse, deploymentGpuInfoFromResponse, deploymentGpuListResponseFromResponse, deploymentInfoFromResponse, deploymentListResponseFromResponse, deploymentLogsResponseFromResponse, featuredSectionFromResponse, generateResultFromResponse, imageResultFromResponse, invitationFromResponse, memberFromResponse, modelInfoFromResponse, modelPricingFromResponse, modelsResponseFromResponse, organizationFromResponse, organizationSummaryFromResponse, pricingResponseFromResponse, providerBalanceItemFromResponse, providerBalancesResponseFromResponse, providerKeyInfoFromResponse, providerKeysResponseFromResponse, providerValidationResultFromResponse, requestStatusFromResponse, usageSummaryFromResponse, videoResultFromResponse };
781
+ export { AsyncClient, type AsyncVideoAccepted, AuthenticationError, Billing, type BillingInfo, type CheckoutOptions, Client, type ClientOptions, type DashboardResponse, type DeploymentCostResponse, type DeploymentCreateOptions, type DeploymentGpuInfo, type DeploymentGpuListResponse, type DeploymentInfo, type DeploymentListResponse, type DeploymentLogEntry, type DeploymentLogsResponse, type DeploymentRunRequest, Deployments, type FeaturedSection, Generate, type GenerateResult, type HfModelInfo, HfModels, type HfModelsListOptions, type ImageResult, Images, type ImagesGenerateOptions, type Invitation, type InvitationPreview, Invitations, type Member, type MemberPermissions, Members, type ModelInfo, type ModelPricing, Models, type ModelsListOptions, type ModelsResponse, type Organization, type OrganizationSummary, Organizations, type PricingResponse, type ProviderBalanceItem, type ProviderBalancesResponse, ProviderError, type ProviderKeyInfo, type ProviderKeysResponse, type ProviderValidationResult, Providers, RateLimitError, type RequestStatusResult, Requests, type StreamStatusEvent, Usage, type UsageSummary, VERSION, VIDEO_MODEL_PRESETS, ValidationError, type VideoResult, Videos, type VideosGenerateOptions, VisgateConnectionError, VisgateError, type VisgateErrorDetails, VisgateTimeoutError, billingInfoFromResponse, deploymentCostResponseFromResponse, deploymentGpuInfoFromResponse, deploymentGpuListResponseFromResponse, deploymentInfoFromResponse, deploymentListResponseFromResponse, deploymentLogsResponseFromResponse, featuredSectionFromResponse, generateResultFromResponse, imageResultFromResponse, invitationFromResponse, memberFromResponse, modelInfoFromResponse, modelPricingFromResponse, modelsResponseFromResponse, organizationFromResponse, organizationSummaryFromResponse, pricingResponseFromResponse, providerBalanceItemFromResponse, providerBalancesResponseFromResponse, providerKeyInfoFromResponse, providerKeysResponseFromResponse, providerValidationResultFromResponse, requestStatusFromResponse, usageSummaryFromResponse, videoResultFromResponse };
package/dist/index.js CHANGED
@@ -549,6 +549,17 @@ var HfModels = class {
549
549
  };
550
550
 
551
551
  // src/resources/invitations.ts
552
+ function invitationPreviewFromResponse(data) {
553
+ return {
554
+ id: data.id ?? "",
555
+ organizationId: data.organization_id ?? "",
556
+ organizationName: data.organization_name ?? "",
557
+ role: data.role ?? "member",
558
+ invitedByEmail: data.invited_by_email ?? "",
559
+ status: data.status ?? "pending",
560
+ expiresAt: data.expires_at ?? ""
561
+ };
562
+ }
552
563
  function invitationFromResponse(data) {
553
564
  return {
554
565
  id: data.id ?? "",
@@ -578,6 +589,11 @@ var Invitations = class {
578
589
  const data = await this.client._request("GET", `/organizations/${encodeURIComponent(orgId)}/invitations`);
579
590
  return data.map(invitationFromResponse);
580
591
  }
592
+ /** List all invitations for an organization regardless of status, ordered newest first. */
593
+ async listAllForOrg(orgId) {
594
+ const data = await this.client._request("GET", `/organizations/${encodeURIComponent(orgId)}/invitations/all`);
595
+ return data.map(invitationFromResponse);
596
+ }
581
597
  /** Cancel a pending invitation. */
582
598
  async cancel(orgId, inviteId) {
583
599
  await this.client._request("DELETE", `/organizations/${encodeURIComponent(orgId)}/invitations/${encodeURIComponent(inviteId)}`);
@@ -587,6 +603,21 @@ var Invitations = class {
587
603
  const data = await this.client._request("GET", "/invitations/pending");
588
604
  return data.map(invitationFromResponse);
589
605
  }
606
+ /** Public preview of an invitation (no auth). Use for invite landing pages. */
607
+ async getPreview(inviteId) {
608
+ const url = `${this.client.baseUrl}/invite/${encodeURIComponent(inviteId)}`;
609
+ const response = await fetch(url, {
610
+ method: "GET",
611
+ headers: { "Content-Type": "application/json" }
612
+ });
613
+ const data = await handleResponse(response);
614
+ return invitationPreviewFromResponse(data);
615
+ }
616
+ /** List invitations sent by organizations the current user is a member of. */
617
+ async listSent() {
618
+ const data = await this.client._request("GET", "/invitations/sent");
619
+ return data.map(invitationFromResponse);
620
+ }
590
621
  /** Accept a pending invitation. */
591
622
  async accept(inviteId) {
592
623
  return await this.client._request("POST", `/invitations/${encodeURIComponent(inviteId)}/accept`);
@@ -980,7 +1011,7 @@ var DEFAULT_BASE_URL = "https://visgateai.com/api/v1";
980
1011
  var DEFAULT_TIMEOUT = 12e4;
981
1012
  var DEFAULT_MAX_RETRIES = 2;
982
1013
  var RETRYABLE_STATUS_CODES = /* @__PURE__ */ new Set([429, 500, 502, 503, 504]);
983
- var SDK_VERSION = "0.3.3";
1014
+ var SDK_VERSION = "0.4.2";
984
1015
  function getVersion() {
985
1016
  try {
986
1017
  if (typeof __VERSION__ !== "undefined") return __VERSION__;
@@ -1182,7 +1213,7 @@ var AsyncClient = class extends Client {
1182
1213
  };
1183
1214
 
1184
1215
  // src/index.ts
1185
- var VERSION = "0.3.5";
1216
+ var VERSION = "0.4.2";
1186
1217
 
1187
1218
  export { AsyncClient, AuthenticationError, Billing, Client, Deployments, Generate, HfModels, Images, Invitations, Members, Models, Organizations, ProviderError, Providers, RateLimitError, Requests, Usage, VERSION, VIDEO_MODEL_PRESETS, ValidationError, Videos, VisgateConnectionError, VisgateError, VisgateTimeoutError, billingInfoFromResponse, deploymentCostResponseFromResponse, deploymentGpuInfoFromResponse, deploymentGpuListResponseFromResponse, deploymentInfoFromResponse, deploymentListResponseFromResponse, deploymentLogsResponseFromResponse, featuredSectionFromResponse, generateResultFromResponse, imageResultFromResponse, invitationFromResponse, memberFromResponse, modelInfoFromResponse, modelPricingFromResponse, modelsResponseFromResponse, organizationFromResponse, organizationSummaryFromResponse, pricingResponseFromResponse, providerBalanceItemFromResponse, providerBalancesResponseFromResponse, providerKeyInfoFromResponse, providerKeysResponseFromResponse, providerValidationResultFromResponse, requestStatusFromResponse, usageSummaryFromResponse, videoResultFromResponse };
1188
1219
  //# sourceMappingURL=index.js.map