Skip to content

Commit

Permalink
Merge pull request #9444 from hicommonwealth/tim/api-key-auth-perf-im…
Browse files Browse the repository at this point in the history
…provments
  • Loading branch information
timolegros authored Oct 9, 2024
2 parents 888e103 + c664a4f commit 3eb23f2
Show file tree
Hide file tree
Showing 2,173 changed files with 22,993 additions and 15,308 deletions.
885 changes: 873 additions & 12 deletions libs/api-client/fern/openapi/openapi.yml

Large diffs are not rendered by default.

72 changes: 40 additions & 32 deletions libs/api-client/src/Client.d.ts
Original file line number Diff line number Diff line change
@@ -1,39 +1,47 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
import * as environments from "./environments";
import * as core from "./core";
import { Community } from "./api/resources/community/client/Client";
import { Comment } from "./api/resources/comment/client/Client";
import { Thread } from "./api/resources/thread/client/Client";
import { Reaction } from "./api/resources/reaction/client/Client";
import { Comment } from './api/resources/comment/client/Client';
import { Community } from './api/resources/community/client/Client';
import { Reaction } from './api/resources/reaction/client/Client';
import { Thread } from './api/resources/thread/client/Client';
import * as core from './core';
import * as environments from './environments';

export declare namespace CommonApiClient {
interface Options {
environment?: core.Supplier<environments.CommonApiEnvironment | string>;
apiKey?: core.Supplier<string | undefined>;
/** Override the address header */
address?: core.Supplier<string | undefined>;
}
interface RequestOptions {
/** The maximum time to wait for a response in seconds. */
timeoutInSeconds?: number;
/** The number of times to retry the request. Defaults to 2. */
maxRetries?: number;
/** A hook to abort the request. */
abortSignal?: AbortSignal;
/** Override the address header */
address?: string | undefined;
}
interface Options {
environment?: core.Supplier<environments.CommonApiEnvironment | string>;
apiKey: core.Supplier<string>;
/** Override the address header */
address?: core.Supplier<string | undefined>;
}

interface RequestOptions {
/** The maximum time to wait for a response in seconds. */
timeoutInSeconds?: number;
/** The number of times to retry the request. Defaults to 2. */
maxRetries?: number;
/** A hook to abort the request. */
abortSignal?: AbortSignal;
/** Override the address header */
address?: string | undefined;
}
}

export declare class CommonApiClient {
protected readonly _options: CommonApiClient.Options;
constructor(_options?: CommonApiClient.Options);
protected _community: Community | undefined;
get community(): Community;
protected _comment: Comment | undefined;
get comment(): Comment;
protected _thread: Thread | undefined;
get thread(): Thread;
protected _reaction: Reaction | undefined;
get reaction(): Reaction;
protected readonly _options: CommonApiClient.Options;

constructor(_options: CommonApiClient.Options);

protected _community: Community | undefined;
get community(): Community;

protected _comment: Comment | undefined;
get comment(): Comment;

protected _thread: Thread | undefined;
get thread(): Thread;

protected _reaction: Reaction | undefined;
get reaction(): Reaction;
}
7 changes: 6 additions & 1 deletion libs/api-client/src/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,33 @@ import { Comment } from './api/resources/comment/client/Client';
import { Community } from './api/resources/community/client/Client';
import { Reaction } from './api/resources/reaction/client/Client';
import { Thread } from './api/resources/thread/client/Client';

export class CommonApiClient {
constructor(_options = {}) {
constructor(_options) {
this._options = _options;
}

get community() {
var _a;
return (_a = this._community) !== null && _a !== void 0
? _a
: (this._community = new Community(this._options));
}

get comment() {
var _a;
return (_a = this._comment) !== null && _a !== void 0
? _a
: (this._comment = new Comment(this._options));
}

get thread() {
var _a;
return (_a = this._thread) !== null && _a !== void 0
? _a
: (this._thread = new Thread(this._options));
}

get reaction() {
var _a;
return (_a = this._reaction) !== null && _a !== void 0
Expand Down
2 changes: 1 addition & 1 deletion libs/api-client/src/api/index.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "./resources";
export * from './resources';
153 changes: 87 additions & 66 deletions libs/api-client/src/api/resources/comment/client/Client.d.ts
Original file line number Diff line number Diff line change
@@ -1,73 +1,94 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
import * as environments from "../../../../environments";
import * as core from "../../../../core";
import * as CommonApi from "../../../index";
import * as core from '../../../../core';
import * as environments from '../../../../environments';
import * as CommonApi from '../../../index';

export declare namespace Comment {
interface Options {
environment?: core.Supplier<environments.CommonApiEnvironment | string>;
apiKey?: core.Supplier<string | undefined>;
/** Override the address header */
address?: core.Supplier<string | undefined>;
}
interface RequestOptions {
/** The maximum time to wait for a response in seconds. */
timeoutInSeconds?: number;
/** The number of times to retry the request. Defaults to 2. */
maxRetries?: number;
/** A hook to abort the request. */
abortSignal?: AbortSignal;
/** Override the address header */
address?: string | undefined;
}
interface Options {
environment?: core.Supplier<environments.CommonApiEnvironment | string>;
apiKey: core.Supplier<string>;
/** Override the address header */
address?: core.Supplier<string | undefined>;
}

interface RequestOptions {
/** The maximum time to wait for a response in seconds. */
timeoutInSeconds?: number;
/** The number of times to retry the request. Defaults to 2. */
maxRetries?: number;
/** A hook to abort the request. */
abortSignal?: AbortSignal;
/** Override the address header */
address?: string | undefined;
}
}

export declare class Comment {
protected readonly _options: Comment.Options;
constructor(_options?: Comment.Options);
/**
* @param {CommonApi.GetCommentsRequest} request
* @param {Comment.RequestOptions} requestOptions - Request-specific configuration.
*
* @example
* await client.comment.getComments({
* threadId: 1
* })
*/
getComments(request: CommonApi.GetCommentsRequest, requestOptions?: Comment.RequestOptions): Promise<CommonApi.GetCommentsResponse>;
/**
* @param {CommonApi.CreateCommentRequest} request
* @param {Comment.RequestOptions} requestOptions - Request-specific configuration.
*
* @example
* await client.comment.createComment({
* threadId: 1,
* text: "text"
* })
*/
createComment(request: CommonApi.CreateCommentRequest, requestOptions?: Comment.RequestOptions): Promise<CommonApi.CreateCommentResponse>;
/**
* @param {CommonApi.UpdateCommentRequest} request
* @param {Comment.RequestOptions} requestOptions - Request-specific configuration.
*
* @example
* await client.comment.updateComment({
* commentId: 1,
* text: "text"
* })
*/
updateComment(request: CommonApi.UpdateCommentRequest, requestOptions?: Comment.RequestOptions): Promise<CommonApi.UpdateCommentResponse>;
/**
* @param {CommonApi.DeleteCommentRequest} request
* @param {Comment.RequestOptions} requestOptions - Request-specific configuration.
*
* @example
* await client.comment.deleteComment({
* commentId: 1
* })
*/
deleteComment(request: CommonApi.DeleteCommentRequest, requestOptions?: Comment.RequestOptions): Promise<CommonApi.DeleteCommentResponse>;
protected _getCustomAuthorizationHeaders(): Promise<{
"x-api-key": string | undefined;
}>;
protected readonly _options: Comment.Options;

constructor(_options: Comment.Options);

/**
* @param {CommonApi.GetCommentsRequest} request
* @param {Comment.RequestOptions} requestOptions - Request-specific configuration.
*
* @example
* await client.comment.getComments({
* threadId: 1
* })
*/
getComments(
request: CommonApi.GetCommentsRequest,
requestOptions?: Comment.RequestOptions,
): Promise<CommonApi.GetCommentsResponse>;

/**
* @param {CommonApi.CreateCommentRequest} request
* @param {Comment.RequestOptions} requestOptions - Request-specific configuration.
*
* @example
* await client.comment.createComment({
* threadId: 1,
* text: "text"
* })
*/
createComment(
request: CommonApi.CreateCommentRequest,
requestOptions?: Comment.RequestOptions,
): Promise<CommonApi.CreateCommentResponse>;

/**
* @param {CommonApi.UpdateCommentRequest} request
* @param {Comment.RequestOptions} requestOptions - Request-specific configuration.
*
* @example
* await client.comment.updateComment({
* commentId: 1,
* text: "text"
* })
*/
updateComment(
request: CommonApi.UpdateCommentRequest,
requestOptions?: Comment.RequestOptions,
): Promise<CommonApi.UpdateCommentResponse>;

/**
* @param {CommonApi.DeleteCommentRequest} request
* @param {Comment.RequestOptions} requestOptions - Request-specific configuration.
*
* @example
* await client.comment.deleteComment({
* commentId: 1
* })
*/
deleteComment(
request: CommonApi.DeleteCommentRequest,
requestOptions?: Comment.RequestOptions,
): Promise<CommonApi.DeleteCommentResponse>;

protected _getCustomAuthorizationHeaders(): Promise<{
'x-api-key': string;
}>;
}
12 changes: 11 additions & 1 deletion libs/api-client/src/api/resources/comment/client/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ var __awaiter =
resolve(value);
});
}

return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) {
try {
Expand All @@ -19,18 +20,21 @@ var __awaiter =
reject(e);
}
}

function rejected(value) {
try {
step(generator['throw'](value));
} catch (e) {
reject(e);
}
}

function step(result) {
result.done
? resolve(result.value)
: adopt(result.value).then(fulfilled, rejected);
}

step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Expand All @@ -39,10 +43,12 @@ import * as core from '../../../../core';
import * as environments from '../../../../environments';
import * as errors from '../../../../errors/index';
import * as serializers from '../../../../serialization/index';

export class Comment {
constructor(_options = {}) {
constructor(_options) {
this._options = _options;
}

/**
* @param {CommonApi.GetCommentsRequest} request
* @param {Comment.RequestOptions} requestOptions - Request-specific configuration.
Expand Down Expand Up @@ -156,6 +162,7 @@ export class Comment {
}
});
}

/**
* @param {CommonApi.CreateCommentRequest} request
* @param {Comment.RequestOptions} requestOptions - Request-specific configuration.
Expand Down Expand Up @@ -239,6 +246,7 @@ export class Comment {
}
});
}

/**
* @param {CommonApi.UpdateCommentRequest} request
* @param {Comment.RequestOptions} requestOptions - Request-specific configuration.
Expand Down Expand Up @@ -322,6 +330,7 @@ export class Comment {
}
});
}

/**
* @param {CommonApi.DeleteCommentRequest} request
* @param {Comment.RequestOptions} requestOptions - Request-specific configuration.
Expand Down Expand Up @@ -404,6 +413,7 @@ export class Comment {
}
});
}

_getCustomAuthorizationHeaders() {
return __awaiter(this, void 0, void 0, function* () {
const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "./requests";
export * from './requests';
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
import * as CommonApi from "../../../../index";
import * as CommonApi from '../../../../index';

/**
* @example
* {
Expand All @@ -10,12 +11,12 @@ import * as CommonApi from "../../../../index";
* }
*/
export interface CreateCommentRequest {
threadId: number;
threadMsgId?: string;
text: string;
parentId?: number;
parentMsgId?: string;
canvasSignedData?: string;
canvasMsgId?: string;
discordMeta?: CommonApi.CreateCommentRequestDiscordMeta;
threadId: number;
threadMsgId?: string;
text: string;
parentId?: number;
parentMsgId?: string;
canvasSignedData?: string;
canvasMsgId?: string;
discordMeta?: CommonApi.CreateCommentRequestDiscordMeta;
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
* }
*/
export interface DeleteCommentRequest {
commentId: number;
commentId: number;
}
Loading

0 comments on commit 3eb23f2

Please sign in to comment.