Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

Commit

Permalink
Release 23.2.0-rc1
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Dec 2, 2023
1 parent d8fbc53 commit 53936c4
Show file tree
Hide file tree
Showing 214 changed files with 1,049 additions and 2,471 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rivet-gg/api",
"version": "v23.1.0",
"version": "23.2.0-rc1",
"private": false,
"repository": "https://github.com/rivet-gg/rivet-node",
"files": [
Expand Down
10 changes: 5 additions & 5 deletions src/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import * as environments from "./environments";
import * as core from "./core";
import { Chat } from "./api/resources/chat/client/Client";
import { Admin } from "./api/resources/admin/client/Client";
import { Cloud } from "./api/resources/cloud/client/Client";
import { Group } from "./api/resources/group/client/Client";
import { Identity } from "./api/resources/identity/client/Client";
Expand All @@ -14,18 +14,18 @@ import { Matchmaker } from "./api/resources/matchmaker/client/Client";

export declare namespace RivetClient {
interface Options {
environment?: environments.RivetEnvironment | environments.RivetEnvironmentUrls;
environment?: environments.RivetEnvironment | string;
token?: core.Supplier<core.BearerToken | undefined>;
}
}

export class RivetClient {
constructor(private readonly options: RivetClient.Options) {}

private _chat: Chat | undefined;
private _admin: Admin | undefined;

public get chat(): Chat {
return (this._chat ??= new Chat(this.options));
public get admin(): Admin {
return (this._admin ??= new Admin(this.options));
}

private _cloud: Cloud | undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,43 @@
* This file was auto-generated by Fern from our API Definition.
*/

import * as environments from "../../../../../../environments";
import * as core from "../../../../../../core";
import * as environments from "../../../../environments";
import * as core from "../../../../core";
import { Rivet } from "@rivet-gg/api";
import urlJoin from "url-join";
import * as serializers from "../../../../../../serialization";
import * as errors from "../../../../../../errors";
import * as serializers from "../../../../serialization";
import * as errors from "../../../../errors";

export declare namespace Identity {
export declare namespace Admin {
interface Options {
environment?: environments.RivetEnvironment | environments.RivetEnvironmentUrls;
environment?: environments.RivetEnvironment | string;
token?: core.Supplier<core.BearerToken | undefined>;
}
}

export class Identity {
constructor(private readonly options: Identity.Options) {}
export class Admin {
constructor(private readonly options: Admin.Options) {}

/**
* Returns a thread ID with a given identity.
* @throws {Rivet.InternalError}
* @throws {Rivet.RateLimitError}
* @throws {Rivet.ForbiddenError}
* @throws {Rivet.UnauthorizedError}
* @throws {Rivet.NotFoundError}
* @throws {Rivet.BadRequestError}
*/
public async getDirectThread(identityId: string): Promise<Rivet.chat.GetDirectThreadResponse> {
public async login(request: Rivet.admin.LoginRequest): Promise<Rivet.admin.LoginResponse> {
const _response = await core.fetcher({
url: urlJoin(
(this.options.environment ?? environments.RivetEnvironment.Production).chat,
`/identities/${identityId}/thread`
),
method: "GET",
url: urlJoin(this.options.environment ?? environments.RivetEnvironment.Production, "/admin/login"),
method: "POST",
headers: {
Authorization: await this._getAuthorizationHeader(),
},
contentType: "application/json",
body: await serializers.admin.LoginRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
});
if (_response.ok) {
return await serializers.chat.GetDirectThreadResponse.parseOrThrow(_response.body, {
return await serializers.admin.LoginResponse.parseOrThrow(_response.body, {
unrecognizedObjectKeys: "passthrough",
allowUnrecognizedUnionMembers: true,
allowUnrecognizedEnumValues: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
* This file was auto-generated by Fern from our API Definition.
*/

export interface MessageBodyChatCreate {}
export interface LoginRequest {
name: string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
* This file was auto-generated by Fern from our API Definition.
*/

export interface MessageBodyIdentityFollow {}
export interface LoginResponse {
url: string;
}
2 changes: 2 additions & 0 deletions src/api/resources/admin/types/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from "./LoginRequest";
export * from "./LoginResponse";
Loading

0 comments on commit 53936c4

Please sign in to comment.