Skip to content

Commit

Permalink
publish v0.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
rotorsoft committed Oct 10, 2024
1 parent 82838ec commit ac8f0ef
Show file tree
Hide file tree
Showing 1,832 changed files with 4,315 additions and 2,605 deletions.
14 changes: 13 additions & 1 deletion libs/api-client/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# Common API

## TODO: write readme file
## Manual Setup

### Generate a new API client

- Start app with `pnpm start` so fern can refresh the lastest `openapi.spec` from `http://localhost:8080/api/v1/openapi.json`
- Run `pnpm generate-client` to generate:
- A new `fern/openapi/openapi.yml` file
- A client API in `/src`, formatted with our root `.prettierrc.json` config

### Deploy a new API client

- Update the version in `package.json`
- Run `pnpm publish` to publish the client
2 changes: 1 addition & 1 deletion libs/api-client/fern/fern.config.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"organization": "Common",
"version": "0.43.5"
"version": "0.44.11"
}
49 changes: 0 additions & 49 deletions libs/api-client/fern/openapi/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2982,8 +2982,6 @@ paths:
maximum: 2147483647
text:
type: string
plaintext:
type: string
parent_id:
type: string
nullable: true
Expand Down Expand Up @@ -3292,9 +3290,6 @@ paths:
body:
type: string
nullable: true
plaintext:
type: string
nullable: true
url:
type: string
nullable: true
Expand Down Expand Up @@ -4300,12 +4295,7 @@ paths:
- address_id
- title
- kind
- stage
- community_id
- view_count
- reaction_count
- reaction_weights_sum
- comment_count
- search
additionalProperties: false
nullable: true
Expand Down Expand Up @@ -4611,7 +4601,6 @@ paths:
- thread_id
- address_id
- text
- plaintext
- reaction_count
- search
additionalProperties: false
Expand Down Expand Up @@ -10763,9 +10752,6 @@ paths:
body:
type: string
nullable: true
plaintext:
type: string
nullable: true
url:
type: string
nullable: true
Expand Down Expand Up @@ -11769,12 +11755,7 @@ paths:
- address_id
- title
- kind
- stage
- community_id
- view_count
- reaction_count
- reaction_weights_sum
- comment_count
- search
additionalProperties: false
default:
Expand Down Expand Up @@ -11872,9 +11853,6 @@ paths:
body:
type: string
nullable: true
plaintext:
type: string
nullable: true
url:
type: string
nullable: true
Expand Down Expand Up @@ -12878,12 +12856,7 @@ paths:
- address_id
- title
- kind
- stage
- community_id
- view_count
- reaction_count
- reaction_weights_sum
- comment_count
- search
additionalProperties: false
default:
Expand Down Expand Up @@ -13032,8 +13005,6 @@ paths:
maximum: 2147483647
text:
type: string
plaintext:
type: string
parent_id:
type: string
nullable: true
Expand Down Expand Up @@ -13342,9 +13313,6 @@ paths:
body:
type: string
nullable: true
plaintext:
type: string
nullable: true
url:
type: string
nullable: true
Expand Down Expand Up @@ -14348,12 +14316,7 @@ paths:
- address_id
- title
- kind
- stage
- community_id
- view_count
- reaction_count
- reaction_weights_sum
- comment_count
- search
additionalProperties: false
nullable: true
Expand Down Expand Up @@ -14661,7 +14624,6 @@ paths:
- thread_id
- address_id
- text
- plaintext
- reaction_count
- search
- community_id
Expand Down Expand Up @@ -14721,8 +14683,6 @@ paths:
maximum: 2147483647
text:
type: string
plaintext:
type: string
parent_id:
type: string
nullable: true
Expand Down Expand Up @@ -15031,9 +14991,6 @@ paths:
body:
type: string
nullable: true
plaintext:
type: string
nullable: true
url:
type: string
nullable: true
Expand Down Expand Up @@ -16037,12 +15994,7 @@ paths:
- address_id
- title
- kind
- stage
- community_id
- view_count
- reaction_count
- reaction_weights_sum
- comment_count
- search
additionalProperties: false
nullable: true
Expand Down Expand Up @@ -16350,7 +16302,6 @@ paths:
- thread_id
- address_id
- text
- plaintext
- reaction_count
- search
- community_id
Expand Down
5 changes: 3 additions & 2 deletions libs/api-client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@commonxyz/api-client",
"version": "0.0.1",
"version": "0.0.2",
"type": "module",
"description": "Common Client Proxy",
"repository": {
Expand Down Expand Up @@ -29,7 +29,8 @@
"publish": "npm publish",
"run-test": "tsx ./test/index.ts",
"check-types": "tsc --noEmit",
"generate-client": "chmod u+x scripts/fern-init.sh && ./scripts/fern-init.sh && fern generate"
"format": "npx prettier --write 'src/**/*.{js,d.ts}'",
"generate-client": "chmod u+x scripts/fern-init.sh && ./scripts/fern-init.sh && fern generate && pnpm format"
},
"keywords": [
"commonwealth",
Expand Down
8 changes: 0 additions & 8 deletions libs/api-client/src/Client.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@ 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>;
/** Override the address header */
address?: core.Supplier<string | undefined>;
}

interface RequestOptions {
/** The maximum time to wait for a response in seconds. */
timeoutInSeconds?: number;
Expand All @@ -27,21 +25,15 @@ export declare namespace CommonApiClient {
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;
}
5 changes: 0 additions & 5 deletions libs/api-client/src/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,28 @@ 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) {
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
9 changes: 0 additions & 9 deletions libs/api-client/src/api/resources/comment/client/Client.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@
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>;
/** Override the address header */
address?: core.Supplier<string | undefined>;
}

interface RequestOptions {
/** The maximum time to wait for a response in seconds. */
timeoutInSeconds?: number;
Expand All @@ -24,12 +22,9 @@ export declare namespace Comment {
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.
Expand All @@ -43,7 +38,6 @@ export declare class Comment {
request: CommonApi.GetCommentsRequest,
requestOptions?: Comment.RequestOptions,
): Promise<CommonApi.GetCommentsResponse>;

/**
* @param {CommonApi.CreateCommentRequest} request
* @param {Comment.RequestOptions} requestOptions - Request-specific configuration.
Expand All @@ -58,7 +52,6 @@ export declare class Comment {
request: CommonApi.CreateCommentRequest,
requestOptions?: Comment.RequestOptions,
): Promise<CommonApi.CreateCommentResponse>;

/**
* @param {CommonApi.UpdateCommentRequest} request
* @param {Comment.RequestOptions} requestOptions - Request-specific configuration.
Expand All @@ -73,7 +66,6 @@ export declare class Comment {
request: CommonApi.UpdateCommentRequest,
requestOptions?: Comment.RequestOptions,
): Promise<CommonApi.UpdateCommentResponse>;

/**
* @param {CommonApi.DeleteCommentRequest} request
* @param {Comment.RequestOptions} requestOptions - Request-specific configuration.
Expand All @@ -87,7 +79,6 @@ export declare class Comment {
request: CommonApi.DeleteCommentRequest,
requestOptions?: Comment.RequestOptions,
): Promise<CommonApi.DeleteCommentResponse>;

protected _getCustomAuthorizationHeaders(): Promise<{
'x-api-key': string;
}>;
Expand Down
Loading

0 comments on commit ac8f0ef

Please sign in to comment.