mirror of
https://github.com/LukeHagar/discoursejs.git
synced 2025-12-06 04:19:37 +00:00
ci: regenerated with OpenAPI Doc latest, Speakeasy CLI 1.385.0
This commit is contained in:
@@ -3,10 +3,10 @@ id: 599a9576-4665-431e-be1e-44cc13ef28aa
|
|||||||
management:
|
management:
|
||||||
docChecksum: dd4d04e62622de8f631720b5be68964d
|
docChecksum: dd4d04e62622de8f631720b5be68964d
|
||||||
docVersion: latest
|
docVersion: latest
|
||||||
speakeasyVersion: 1.378.0
|
speakeasyVersion: 1.385.0
|
||||||
generationVersion: 2.404.3
|
generationVersion: 2.407.2
|
||||||
releaseVersion: 0.7.1
|
releaseVersion: 0.7.2
|
||||||
configChecksum: 29af96f7ea7470cddf48d91f3b2873ec
|
configChecksum: ed711ed185d766c457022634eb07a389
|
||||||
repoURL: https://github.com/LukeHagar/discoursejs.git
|
repoURL: https://github.com/LukeHagar/discoursejs.git
|
||||||
repoSubDirectory: .
|
repoSubDirectory: .
|
||||||
installationURL: https://github.com/LukeHagar/discoursejs
|
installationURL: https://github.com/LukeHagar/discoursejs
|
||||||
@@ -16,7 +16,7 @@ features:
|
|||||||
additionalDependencies: 0.1.0
|
additionalDependencies: 0.1.0
|
||||||
additionalProperties: 0.1.1
|
additionalProperties: 0.1.1
|
||||||
constsAndDefaults: 0.1.11
|
constsAndDefaults: 0.1.11
|
||||||
core: 3.14.1
|
core: 3.14.2
|
||||||
defaultEnabledRetries: 0.1.0
|
defaultEnabledRetries: 0.1.0
|
||||||
deprecations: 2.81.1
|
deprecations: 2.81.1
|
||||||
envVarSecurityUsage: 0.1.1
|
envVarSecurityUsage: 0.1.1
|
||||||
|
|||||||
79
README.md
79
README.md
@@ -7,9 +7,88 @@
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Start Summary [summary] -->
|
||||||
|
## Summary
|
||||||
|
|
||||||
|
Discourse API Documentation: This page contains the documentation on how to use Discourse through API calls.
|
||||||
|
|
||||||
|
> Note: For any endpoints not listed you can follow the
|
||||||
|
[reverse engineer the Discourse API](https://meta.discourse.org/t/-/20576)
|
||||||
|
guide to figure out how to use an API endpoint.
|
||||||
|
|
||||||
|
### Request Content-Type
|
||||||
|
|
||||||
|
The Content-Type for POST and PUT requests can be set to `application/x-www-form-urlencoded`,
|
||||||
|
`multipart/form-data`, or `application/json`.
|
||||||
|
|
||||||
|
### Endpoint Names and Response Content-Type
|
||||||
|
|
||||||
|
Most API endpoints provide the same content as their HTML counterparts. For example
|
||||||
|
the URL `/categories` serves a list of categories, the `/categories.json` API provides the
|
||||||
|
same information in JSON format.
|
||||||
|
|
||||||
|
Instead of sending API requests to `/categories.json` you may also send them to `/categories`
|
||||||
|
and add an `Accept: application/json` header to the request to get the JSON response.
|
||||||
|
Sending requests with the `Accept` header is necessary if you want to use URLs
|
||||||
|
for related endpoints returned by the API, such as pagination URLs.
|
||||||
|
These URLs are returned without the `.json` prefix so you need to add the header in
|
||||||
|
order to get the correct response format.
|
||||||
|
|
||||||
|
### Authentication
|
||||||
|
|
||||||
|
Some endpoints do not require any authentication, pretty much anything else will
|
||||||
|
require you to be authenticated.
|
||||||
|
|
||||||
|
To become authenticated you will need to create an API Key from the admin panel.
|
||||||
|
|
||||||
|
Once you have your API Key you can pass it in along with your API Username
|
||||||
|
as an HTTP header like this:
|
||||||
|
|
||||||
|
```
|
||||||
|
curl -X GET "http://127.0.0.1:3000/admin/users/list/active.json" \
|
||||||
|
-H "Api-Key: 714552c6148e1617aeab526d0606184b94a80ec048fc09894ff1a72b740c5f19" \
|
||||||
|
-H "Api-Username: system"
|
||||||
|
```
|
||||||
|
|
||||||
|
and this is how POST requests will look:
|
||||||
|
|
||||||
|
```
|
||||||
|
curl -X POST "http://127.0.0.1:3000/categories" \
|
||||||
|
-H "Content-Type: multipart/form-data;" \
|
||||||
|
-H "Api-Key: 714552c6148e1617aeab526d0606184b94a80ec048fc09894ff1a72b740c5f19" \
|
||||||
|
-H "Api-Username: system" \
|
||||||
|
-F "name=89853c20-4409-e91a-a8ea-f6cdff96aaaa" \
|
||||||
|
-F "color=49d9e9" \
|
||||||
|
-F "text_color=f0fcfd"
|
||||||
|
```
|
||||||
|
|
||||||
|
### Boolean values
|
||||||
|
|
||||||
|
If an endpoint accepts a boolean be sure to specify it as a lowercase
|
||||||
|
`true` or `false` value unless noted otherwise.
|
||||||
|
<!-- End Summary [summary] -->
|
||||||
|
|
||||||
|
<!-- Start Table of Contents [toc] -->
|
||||||
|
## Table of Contents
|
||||||
|
|
||||||
|
* [SDK Installation](#sdk-installation)
|
||||||
|
* [Requirements](#requirements)
|
||||||
|
* [SDK Example Usage](#sdk-example-usage)
|
||||||
|
* [Available Resources and Operations](#available-resources-and-operations)
|
||||||
|
* [Standalone functions](#standalone-functions)
|
||||||
|
* [File uploads](#file-uploads)
|
||||||
|
* [Retries](#retries)
|
||||||
|
* [Error Handling](#error-handling)
|
||||||
|
* [Server Selection](#server-selection)
|
||||||
|
* [Custom HTTP Client](#custom-http-client)
|
||||||
|
* [Debugging](#debugging)
|
||||||
|
<!-- End Table of Contents [toc] -->
|
||||||
|
|
||||||
<!-- Start SDK Installation [installation] -->
|
<!-- Start SDK Installation [installation] -->
|
||||||
## SDK Installation
|
## SDK Installation
|
||||||
|
|
||||||
|
The SDK can be installed with either [npm](https://www.npmjs.com/), [pnpm](https://pnpm.io/), [bun](https://bun.sh/) or [yarn](https://classic.yarnpkg.com/en/) package managers.
|
||||||
|
|
||||||
### NPM
|
### NPM
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|||||||
12
RELEASES.md
12
RELEASES.md
@@ -238,4 +238,14 @@ Based on:
|
|||||||
### Generated
|
### Generated
|
||||||
- [typescript v0.7.1] .
|
- [typescript v0.7.1] .
|
||||||
### Releases
|
### Releases
|
||||||
- [NPM v0.7.1] https://www.npmjs.com/package/@lukehagar/discoursejs/v/0.7.1 - .
|
- [NPM v0.7.1] https://www.npmjs.com/package/@lukehagar/discoursejs/v/0.7.1 - .
|
||||||
|
|
||||||
|
## 2024-08-31 00:23:16
|
||||||
|
### Changes
|
||||||
|
Based on:
|
||||||
|
- OpenAPI Doc latest
|
||||||
|
- Speakeasy CLI 1.385.0 (2.407.2) https://github.com/speakeasy-api/speakeasy
|
||||||
|
### Generated
|
||||||
|
- [typescript v0.7.2] .
|
||||||
|
### Releases
|
||||||
|
- [NPM v0.7.2] https://www.npmjs.com/package/@lukehagar/discoursejs/v/0.7.2 - .
|
||||||
2
gen.yaml
2
gen.yaml
@@ -11,7 +11,7 @@ generation:
|
|||||||
auth:
|
auth:
|
||||||
oAuth2ClientCredentialsEnabled: false
|
oAuth2ClientCredentialsEnabled: false
|
||||||
typescript:
|
typescript:
|
||||||
version: 0.7.1
|
version: 0.7.2
|
||||||
additionalDependencies:
|
additionalDependencies:
|
||||||
dependencies: {}
|
dependencies: {}
|
||||||
devDependencies: {}
|
devDependencies: {}
|
||||||
|
|||||||
2
jsr.json
2
jsr.json
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
"name": "@lukehagar/discoursejs",
|
"name": "@lukehagar/discoursejs",
|
||||||
"version": "0.7.1",
|
"version": "0.7.2",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./src/index.ts",
|
".": "./src/index.ts",
|
||||||
"./sdk/models/errors": "./src/sdk/models/errors/index.ts",
|
"./sdk/models/errors": "./src/sdk/models/errors/index.ts",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@lukehagar/discoursejs",
|
"name": "@lukehagar/discoursejs",
|
||||||
"version": "0.7.1",
|
"version": "0.7.2",
|
||||||
"author": "LukeHagar",
|
"author": "LukeHagar",
|
||||||
"main": "./index.js",
|
"main": "./index.js",
|
||||||
"sideEffects": false,
|
"sideEffects": false,
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|||||||
export const SDK_METADATA = {
|
export const SDK_METADATA = {
|
||||||
language: "typescript",
|
language: "typescript",
|
||||||
openapiDocVersion: "latest",
|
openapiDocVersion: "latest",
|
||||||
sdkVersion: "0.7.1",
|
sdkVersion: "0.7.2",
|
||||||
genVersion: "2.404.3",
|
genVersion: "2.407.2",
|
||||||
userAgent: "speakeasy-sdk/typescript 0.7.1 2.404.3 latest @lukehagar/discoursejs",
|
userAgent: "speakeasy-sdk/typescript 0.7.2 2.407.2 latest @lukehagar/discoursejs",
|
||||||
} as const;
|
} as const;
|
||||||
|
|||||||
@@ -68,13 +68,20 @@ type SecurityInputOAuth2ClientCredentials = {
|
|||||||
value: { clientID?: string | undefined; clientSecret?: string | undefined } | null | undefined;
|
value: { clientID?: string | undefined; clientSecret?: string | undefined } | null | undefined;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
type SecurityInputCustom = {
|
||||||
|
type: "http:custom";
|
||||||
|
value: any | null | undefined;
|
||||||
|
fieldName: string;
|
||||||
|
};
|
||||||
|
|
||||||
export type SecurityInput =
|
export type SecurityInput =
|
||||||
| SecurityInputBasic
|
| SecurityInputBasic
|
||||||
| SecurityInputBearer
|
| SecurityInputBearer
|
||||||
| SecurityInputAPIKey
|
| SecurityInputAPIKey
|
||||||
| SecurityInputOAuth2
|
| SecurityInputOAuth2
|
||||||
| SecurityInputOAuth2ClientCredentials
|
| SecurityInputOAuth2ClientCredentials
|
||||||
| SecurityInputOIDC;
|
| SecurityInputOIDC
|
||||||
|
| SecurityInputCustom;
|
||||||
|
|
||||||
export function resolveSecurity(...options: SecurityInput[][]): SecurityState | null {
|
export function resolveSecurity(...options: SecurityInput[][]): SecurityState | null {
|
||||||
const state: SecurityState = {
|
const state: SecurityState = {
|
||||||
@@ -90,6 +97,8 @@ export function resolveSecurity(...options: SecurityInput[][]): SecurityState |
|
|||||||
return false;
|
return false;
|
||||||
} else if (o.type === "http:basic") {
|
} else if (o.type === "http:basic") {
|
||||||
return o.value.username != null || o.value.password != null;
|
return o.value.username != null || o.value.password != null;
|
||||||
|
} else if (o.type === "http:custom") {
|
||||||
|
return null;
|
||||||
} else if (o.type === "oauth2:client_credentials") {
|
} else if (o.type === "oauth2:client_credentials") {
|
||||||
return o.value.clientID != null || o.value.clientSecret != null;
|
return o.value.clientID != null || o.value.clientSecret != null;
|
||||||
} else if (typeof o.value === "string") {
|
} else if (typeof o.value === "string") {
|
||||||
@@ -125,6 +134,8 @@ export function resolveSecurity(...options: SecurityInput[][]): SecurityState |
|
|||||||
case "http:basic":
|
case "http:basic":
|
||||||
applyBasic(state, spec);
|
applyBasic(state, spec);
|
||||||
break;
|
break;
|
||||||
|
case "http:custom":
|
||||||
|
break;
|
||||||
case "http:bearer":
|
case "http:bearer":
|
||||||
applyBearer(state, spec);
|
applyBearer(state, spec);
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user