Skip to content
Snippets Groups Projects
Commit 0dd58ffa authored by Kasper Seweryn's avatar Kasper Seweryn :pancakes:
Browse files

Initial commit

parents
No related branches found
No related tags found
No related merge requests found
Showing with 731 additions and 0 deletions
wwwroot/*.js
node_modules
typings
dist
schema.yml
# empty npmignore to ensure all required files (e.g., in the dist folder) are published by npm
schema.yml
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.
# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md
git_push.sh
generate.sh
config.yaml
.gitignore
.npmignore
.gitignore
.npmignore
README.md
api.ts
api/activity-api.ts
api/albums-api.ts
api/artists-api.ts
api/attachments-api.ts
api/auth-api.ts
api/channels-api.ts
api/favorites-api.ts
api/federation-api.ts
api/history-api.ts
api/instance-api.ts
api/libraries-api.ts
api/licenses-api.ts
api/listen-api.ts
api/manage-api.ts
api/moderation-api.ts
api/mutations-api.ts
api/oauth-api.ts
api/oembed-api.ts
api/playlists-api.ts
api/plugins-api.ts
api/radios-api.ts
api/rate-limit-api.ts
api/search-api.ts
api/stream-api.ts
api/subscriptions-api.ts
api/tags-api.ts
api/text-preview-api.ts
api/tracks-api.ts
api/uploads-api.ts
api/users-api.ts
base.ts
common.ts
configuration.ts
git_push.sh
index.ts
package.json
tsconfig.json
types/activity.ts
types/album-create-description.ts
types/album-create.ts
types/album.ts
types/allow-list-stat.ts
types/apiactor.ts
types/apimutation.ts
types/application.ts
types/artist-album.ts
types/artist-with-albums.ts
types/attachment.ts
types/channel-create.ts
types/channel-update.ts
types/channel.ts
types/content-category-enum.ts
types/content-type-enum.ts
types/content.ts
types/cover-field.ts
types/create-application.ts
types/domain.ts
types/endpoints.ts
types/federation-choice-enum.ts
types/fetch-status-enum.ts
types/fetch.ts
types/full-actor.ts
types/global-preference.ts
types/ident.ts
types/inbox-item-type-enum.ts
types/inbox-item.ts
types/index.ts
types/library-follow.ts
types/library-for-owner.ts
types/library-privacy-level-enum.ts
types/library-scan.ts
types/library.ts
types/license.ts
types/listening-write.ts
types/listening.ts
types/manage-actor.ts
types/manage-album.ts
types/manage-artist.ts
types/manage-base-actor.ts
types/manage-base-note.ts
types/manage-channel.ts
types/manage-domain-update.ts
types/manage-domain.ts
types/manage-instance-policy.ts
types/manage-invitation.ts
types/manage-library.ts
types/manage-nested-artist.ts
types/manage-nested-library.ts
types/manage-nested-track.ts
types/manage-note.ts
types/manage-report.ts
types/manage-tag.ts
types/manage-target-type-enum.ts
types/manage-target.ts
types/manage-track-album.ts
types/manage-track.ts
types/manage-upload-import-status-enum.ts
types/manage-upload.ts
types/manage-user-request-status-enum.ts
types/manage-user-request-type-enum.ts
types/manage-user-request.ts
types/manage-user-simple.ts
types/manage-user.ts
types/metadata-usage-favorite.ts
types/metadata-usage.ts
types/metadata.ts
types/moderation-target-type-enum.ts
types/moderation-target.ts
types/nested-library-follow.ts
types/node-info20-services.ts
types/node-info20.ts
types/paginated-album-list.ts
types/paginated-apimutation-list.ts
types/paginated-application-list.ts
types/paginated-artist-with-albums-list.ts
types/paginated-channel-list.ts
types/paginated-domain-list.ts
types/paginated-inbox-item-list.ts
types/paginated-library-follow-list.ts
types/paginated-library-for-owner-list.ts
types/paginated-license-list.ts
types/paginated-listening-list.ts
types/paginated-manage-actor-list.ts
types/paginated-manage-album-list.ts
types/paginated-manage-artist-list.ts
types/paginated-manage-channel-list.ts
types/paginated-manage-domain-list.ts
types/paginated-manage-instance-policy-list.ts
types/paginated-manage-invitation-list.ts
types/paginated-manage-library-list.ts
types/paginated-manage-note-list.ts
types/paginated-manage-report-list.ts
types/paginated-manage-tag-list.ts
types/paginated-manage-track-list.ts
types/paginated-manage-upload-list.ts
types/paginated-manage-user-list.ts
types/paginated-manage-user-request-list.ts
types/paginated-playlist-list.ts
types/paginated-radio-list.ts
types/paginated-subscription-list.ts
types/paginated-tag-list.ts
types/paginated-track-list.ts
types/paginated-upload-for-owner-list.ts
types/paginated-user-filter-list.ts
types/paginated-user-track-favorite-list.ts
types/password-change.ts
types/password-reset-confirm.ts
types/password-reset.ts
types/patched-application.ts
types/patched-channel-update.ts
types/patched-global-preference.ts
types/patched-inbox-item.ts
types/patched-library-for-owner.ts
types/patched-manage-domain-update.ts
types/patched-manage-instance-policy.ts
types/patched-manage-invitation.ts
types/patched-manage-library.ts
types/patched-manage-report.ts
types/patched-manage-user-request.ts
types/patched-manage-user.ts
types/patched-playlist.ts
types/patched-radio.ts
types/patched-upload-for-owner-track.ts
types/patched-upload-for-owner.ts
types/patched-user-details.ts
types/patched-user-write.ts
types/playlist.ts
types/privacy-level-enum.ts
types/radio-session-track-serializer-create.ts
types/radio-session.ts
types/radio.ts
types/rate-limit.ts
types/register.ts
types/report-type-enum.ts
types/report-type.ts
types/report.ts
types/scopes.ts
types/services.ts
types/simple-artist.ts
types/software.ts
types/subscription.ts
types/tag.ts
types/total-count.ts
types/track-album.ts
types/track.ts
types/upload-for-owner-import-status-enum.ts
types/upload-for-owner.ts
types/usage.ts
types/user-basic.ts
types/user-details.ts
types/user-filter.ts
types/user-track-favorite-write.ts
types/user-track-favorite.ts
types/user-write.ts
types/users-usage.ts
types/verify-email.ts
4.3.1
\ No newline at end of file
## @funkwhale/api@1.2.8
This generator creates TypeScript/JavaScript client that utilizes [axios](https://github.com/axios/axios). The generated Node module can be used in the following environments:
Environment
* Node.js
* Webpack
* Browserify
Language level
* ES5 - you must have a Promises/A+ library installed
* ES6
Module system
* CommonJS
* ES6 module system
It can be used in both TypeScript and JavaScript. In TypeScript, the definition should be automatically resolved via `package.json`. ([Reference](http://www.typescriptlang.org/docs/handbook/typings-for-npm-packages.html))
### Building
To build and compile the typescript sources to javascript use:
```
npm install
npm run build
```
### Publishing
First build the package then run ```npm publish```
### Consuming
navigate to the folder of your consuming project and run one of the following commands.
_published:_
```
npm install @funkwhale/api@1.2.8 --save
```
_unPublished (not recommended):_
```
npm install PATH_TO_GENERATED_PACKAGE --save
api.ts 0 → 100644
// tslint:disable
/**
* Funkwhale API
* Interactive documentation for [Funkwhale](https://funkwhale.audio) API. Backward compatibility between minor versions (1.X to 1.Y) is guaranteed for all the endpoints documented here. Usage ----- Click on an endpoint name to inspect its properties, parameters and responses. Use the \"Try it out\" button to send a real world payload to the endpoint and inspect the corresponding response. OAuth Authentication -------------------- You can register your own OAuth app using the `/api/v1/oauth/apps/` endpoint. Proceed to the standard OAuth flow afterwards: - Our authorize URL is at `/authorize` - Our token acquisition and refresh URL is at `/api/v1/oauth/token` - The list of supported scopes is available by clicking the `Authorize` button in the Swagger UI documentation - Use `urn:ietf:wg:oauth:2.0:oob` as your redirect URI if you want the user to get a copy-pastable authorization code - At the moment, endpoints that deal with admin or moderator-level content are not accessible via OAuth, only through the Web UI You can use our demo server at `https://demo.funkwhale.audio` for testing purposes. Application token authentication -------------------------------- If using OAuth isn\'t practical and you have an account on the Funkwhale pod, you can create an application by visiting `/settings`. Once the application is created, you can authenticate using its access token in the `Authorization` header, like this: `Authorization: Bearer <token>`. Rate limiting ------------- Depending on server configuration, pods running Funkwhale 0.20 and higher may rate-limit incoming requests to prevent abuse and improve the stability of service. Requests that are dropped because of rate-limiting receive a 429 HTTP response. The limits themselves vary depending on: - The client: anonymous requests are subject to lower limits than authenticated requests - The operation being performed: Write and delete operations, as performed with DELETE, POST, PUT and PATCH HTTP methods are subject to lower limits Those conditions are used to determine the scope of the request, which in turns determine the limit that is applied. For instance, authenticated POST requests are bound to the `authenticated-create` scope, with a default limit of 1000 requests/hour, but anonymous POST requests are bound to the `anonymous-create` scope, with a lower limit of 1000 requests/day. A full list of scopes with their corresponding description, and the current usage data for the client performing the request is available via the `/api/v1/rate-limit` endpoint. Additionally, we include HTTP headers on all API response to ensure API clients can understand: - what scope was bound to a given request - what is the corresponding limit - how much similar requests can be sent before being limited - and how much time they should wait if they have been limited <table> <caption>Rate limiting headers</caption> <thead> <th>Header</th> <th>Example value</th> <th>Description value</th> </thead> <tbody> <tr> <td><code>X-RateLimit-Limit</code></td> <td>50</td> <td>The number of allowed requests whithin a given period</td> </tr> <tr> <td><code>X-RateLimit-Duration</code></td> <td>3600</td> <td>The time window, in seconds, during which those requests are accounted for.</td> </tr> <tr> <td><code>X-RateLimit-Scope</code></td> <td>login</td> <td>The name of the scope as computed for the request</td> </tr> <tr> <td><code>X-RateLimit-Remaining</code></td> <td>42</td> <td>How many requests can be sent with the same scope before the limit applies</td> </tr> <tr> <td><code>Retry-After</code> (if <code>X-RateLimit-Remaining</code> is 0)</td> <td>3543</td> <td>How many seconds to wait before a retry</td> </tr> <tr> <td><code>X-RateLimit-Reset</code></td> <td>1568126089</td> <td>A timestamp indicating when <code>X-RateLimit-Remaining</code> will return to its higher possible value</td> </tr> <tr> <td><code>X-RateLimit-ResetSeconds</code></td> <td>3599</td> <td>How many seconds to wait before <code>X-RateLimit-Remaining</code> returns to its higher possible value</td> </tr> </tbody> </table> Resources --------- For more targeted guides regarding API usage, and especially authentication, please refer to [https://docs.funkwhale.audio/api.html](https://docs.funkwhale.audio/api.html)
*
* The version of the OpenAPI document: 1.2.8
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export * from './api/activity-api';
export * from './api/albums-api';
export * from './api/artists-api';
export * from './api/attachments-api';
export * from './api/auth-api';
export * from './api/channels-api';
export * from './api/favorites-api';
export * from './api/federation-api';
export * from './api/history-api';
export * from './api/instance-api';
export * from './api/libraries-api';
export * from './api/licenses-api';
export * from './api/listen-api';
export * from './api/manage-api';
export * from './api/moderation-api';
export * from './api/mutations-api';
export * from './api/oauth-api';
export * from './api/oembed-api';
export * from './api/playlists-api';
export * from './api/plugins-api';
export * from './api/radios-api';
export * from './api/rate-limit-api';
export * from './api/search-api';
export * from './api/stream-api';
export * from './api/subscriptions-api';
export * from './api/tags-api';
export * from './api/text-preview-api';
export * from './api/tracks-api';
export * from './api/uploads-api';
export * from './api/users-api';
// tslint:disable
/**
* Funkwhale API
* Interactive documentation for [Funkwhale](https://funkwhale.audio) API. Backward compatibility between minor versions (1.X to 1.Y) is guaranteed for all the endpoints documented here. Usage ----- Click on an endpoint name to inspect its properties, parameters and responses. Use the \"Try it out\" button to send a real world payload to the endpoint and inspect the corresponding response. OAuth Authentication -------------------- You can register your own OAuth app using the `/api/v1/oauth/apps/` endpoint. Proceed to the standard OAuth flow afterwards: - Our authorize URL is at `/authorize` - Our token acquisition and refresh URL is at `/api/v1/oauth/token` - The list of supported scopes is available by clicking the `Authorize` button in the Swagger UI documentation - Use `urn:ietf:wg:oauth:2.0:oob` as your redirect URI if you want the user to get a copy-pastable authorization code - At the moment, endpoints that deal with admin or moderator-level content are not accessible via OAuth, only through the Web UI You can use our demo server at `https://demo.funkwhale.audio` for testing purposes. Application token authentication -------------------------------- If using OAuth isn\'t practical and you have an account on the Funkwhale pod, you can create an application by visiting `/settings`. Once the application is created, you can authenticate using its access token in the `Authorization` header, like this: `Authorization: Bearer <token>`. Rate limiting ------------- Depending on server configuration, pods running Funkwhale 0.20 and higher may rate-limit incoming requests to prevent abuse and improve the stability of service. Requests that are dropped because of rate-limiting receive a 429 HTTP response. The limits themselves vary depending on: - The client: anonymous requests are subject to lower limits than authenticated requests - The operation being performed: Write and delete operations, as performed with DELETE, POST, PUT and PATCH HTTP methods are subject to lower limits Those conditions are used to determine the scope of the request, which in turns determine the limit that is applied. For instance, authenticated POST requests are bound to the `authenticated-create` scope, with a default limit of 1000 requests/hour, but anonymous POST requests are bound to the `anonymous-create` scope, with a lower limit of 1000 requests/day. A full list of scopes with their corresponding description, and the current usage data for the client performing the request is available via the `/api/v1/rate-limit` endpoint. Additionally, we include HTTP headers on all API response to ensure API clients can understand: - what scope was bound to a given request - what is the corresponding limit - how much similar requests can be sent before being limited - and how much time they should wait if they have been limited <table> <caption>Rate limiting headers</caption> <thead> <th>Header</th> <th>Example value</th> <th>Description value</th> </thead> <tbody> <tr> <td><code>X-RateLimit-Limit</code></td> <td>50</td> <td>The number of allowed requests whithin a given period</td> </tr> <tr> <td><code>X-RateLimit-Duration</code></td> <td>3600</td> <td>The time window, in seconds, during which those requests are accounted for.</td> </tr> <tr> <td><code>X-RateLimit-Scope</code></td> <td>login</td> <td>The name of the scope as computed for the request</td> </tr> <tr> <td><code>X-RateLimit-Remaining</code></td> <td>42</td> <td>How many requests can be sent with the same scope before the limit applies</td> </tr> <tr> <td><code>Retry-After</code> (if <code>X-RateLimit-Remaining</code> is 0)</td> <td>3543</td> <td>How many seconds to wait before a retry</td> </tr> <tr> <td><code>X-RateLimit-Reset</code></td> <td>1568126089</td> <td>A timestamp indicating when <code>X-RateLimit-Remaining</code> will return to its higher possible value</td> </tr> <tr> <td><code>X-RateLimit-ResetSeconds</code></td> <td>3599</td> <td>How many seconds to wait before <code>X-RateLimit-Remaining</code> returns to its higher possible value</td> </tr> </tbody> </table> Resources --------- For more targeted guides regarding API usage, and especially authentication, please refer to [https://docs.funkwhale.audio/api.html](https://docs.funkwhale.audio/api.html)
*
* The version of the OpenAPI document: 1.2.8
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import * as globalImportUrl from 'url';
import globalAxios, { AxiosPromise, AxiosInstance } from 'axios';
import { Configuration } from '../configuration';
// Some imports not used depending on template conditions
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
/**
* ActivityApi - axios parameter creator
* @export
*/
export const ActivityApiAxiosParamCreator = function (configuration?: Configuration) {
return {
/**
*
* @param {string} [ordering] Which field to use when ordering the results.
* @param {number} [page] A page number within the paginated result set.
* @param {number} [pageSize] Number of results to return per page.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
activityList: async (ordering?: string, page?: number, pageSize?: number, options: any = {}): Promise<RequestArgs> => {
const localVarPath = `/api/v1/activity/`;
const localVarUrlObj = globalImportUrl.parse(localVarPath, true);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication ApplicationToken required
// http bearer authentication required
if (configuration && configuration.accessToken) {
const accessToken = typeof configuration.accessToken === 'function'
? configuration.accessToken()
: configuration.accessToken;
localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
}
// authentication oauth2 required
// oauth required
if (configuration && configuration.accessToken) {
const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
? configuration.accessToken("oauth2", [])
: configuration.accessToken;
localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue;
}
if (ordering !== undefined) {
localVarQueryParameter['ordering'] = ordering;
}
if (page !== undefined) {
localVarQueryParameter['page'] = page;
}
if (pageSize !== undefined) {
localVarQueryParameter['page_size'] = pageSize;
}
localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query};
// fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
delete localVarUrlObj.search;
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: globalImportUrl.format(localVarUrlObj),
options: localVarRequestOptions,
};
},
}
};
/**
* ActivityApi - functional programming interface
* @export
*/
export const ActivityApiFp = function(configuration?: Configuration) {
return {
/**
*
* @param {string} [ordering] Which field to use when ordering the results.
* @param {number} [page] A page number within the paginated result set.
* @param {number} [pageSize] Number of results to return per page.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async activityList(ordering?: string, page?: number, pageSize?: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
const localVarAxiosArgs = await ActivityApiAxiosParamCreator(configuration).activityList(ordering, page, pageSize, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
}
};
/**
* ActivityApi - factory interface
* @export
*/
export const ActivityApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
return {
/**
*
* @param {string} [ordering] Which field to use when ordering the results.
* @param {number} [page] A page number within the paginated result set.
* @param {number} [pageSize] Number of results to return per page.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
activityList(ordering?: string, page?: number, pageSize?: number, options?: any): AxiosPromise<void> {
return ActivityApiFp(configuration).activityList(ordering, page, pageSize, options).then((request) => request(axios, basePath));
},
};
};
/**
* ActivityApi - object-oriented interface
* @export
* @class ActivityApi
* @extends {BaseAPI}
*/
export class ActivityApi extends BaseAPI {
/**
*
* @param {string} [ordering] Which field to use when ordering the results.
* @param {number} [page] A page number within the paginated result set.
* @param {number} [pageSize] Number of results to return per page.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ActivityApi
*/
public activityList(ordering?: string, page?: number, pageSize?: number, options?: any) {
return ActivityApiFp(this.configuration).activityList(ordering, page, pageSize, options).then((request) => request(this.axios, this.basePath));
}
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
// tslint:disable
/**
* Funkwhale API
* Interactive documentation for [Funkwhale](https://funkwhale.audio) API. Backward compatibility between minor versions (1.X to 1.Y) is guaranteed for all the endpoints documented here. Usage ----- Click on an endpoint name to inspect its properties, parameters and responses. Use the \"Try it out\" button to send a real world payload to the endpoint and inspect the corresponding response. OAuth Authentication -------------------- You can register your own OAuth app using the `/api/v1/oauth/apps/` endpoint. Proceed to the standard OAuth flow afterwards: - Our authorize URL is at `/authorize` - Our token acquisition and refresh URL is at `/api/v1/oauth/token` - The list of supported scopes is available by clicking the `Authorize` button in the Swagger UI documentation - Use `urn:ietf:wg:oauth:2.0:oob` as your redirect URI if you want the user to get a copy-pastable authorization code - At the moment, endpoints that deal with admin or moderator-level content are not accessible via OAuth, only through the Web UI You can use our demo server at `https://demo.funkwhale.audio` for testing purposes. Application token authentication -------------------------------- If using OAuth isn\'t practical and you have an account on the Funkwhale pod, you can create an application by visiting `/settings`. Once the application is created, you can authenticate using its access token in the `Authorization` header, like this: `Authorization: Bearer <token>`. Rate limiting ------------- Depending on server configuration, pods running Funkwhale 0.20 and higher may rate-limit incoming requests to prevent abuse and improve the stability of service. Requests that are dropped because of rate-limiting receive a 429 HTTP response. The limits themselves vary depending on: - The client: anonymous requests are subject to lower limits than authenticated requests - The operation being performed: Write and delete operations, as performed with DELETE, POST, PUT and PATCH HTTP methods are subject to lower limits Those conditions are used to determine the scope of the request, which in turns determine the limit that is applied. For instance, authenticated POST requests are bound to the `authenticated-create` scope, with a default limit of 1000 requests/hour, but anonymous POST requests are bound to the `anonymous-create` scope, with a lower limit of 1000 requests/day. A full list of scopes with their corresponding description, and the current usage data for the client performing the request is available via the `/api/v1/rate-limit` endpoint. Additionally, we include HTTP headers on all API response to ensure API clients can understand: - what scope was bound to a given request - what is the corresponding limit - how much similar requests can be sent before being limited - and how much time they should wait if they have been limited <table> <caption>Rate limiting headers</caption> <thead> <th>Header</th> <th>Example value</th> <th>Description value</th> </thead> <tbody> <tr> <td><code>X-RateLimit-Limit</code></td> <td>50</td> <td>The number of allowed requests whithin a given period</td> </tr> <tr> <td><code>X-RateLimit-Duration</code></td> <td>3600</td> <td>The time window, in seconds, during which those requests are accounted for.</td> </tr> <tr> <td><code>X-RateLimit-Scope</code></td> <td>login</td> <td>The name of the scope as computed for the request</td> </tr> <tr> <td><code>X-RateLimit-Remaining</code></td> <td>42</td> <td>How many requests can be sent with the same scope before the limit applies</td> </tr> <tr> <td><code>Retry-After</code> (if <code>X-RateLimit-Remaining</code> is 0)</td> <td>3543</td> <td>How many seconds to wait before a retry</td> </tr> <tr> <td><code>X-RateLimit-Reset</code></td> <td>1568126089</td> <td>A timestamp indicating when <code>X-RateLimit-Remaining</code> will return to its higher possible value</td> </tr> <tr> <td><code>X-RateLimit-ResetSeconds</code></td> <td>3599</td> <td>How many seconds to wait before <code>X-RateLimit-Remaining</code> returns to its higher possible value</td> </tr> </tbody> </table> Resources --------- For more targeted guides regarding API usage, and especially authentication, please refer to [https://docs.funkwhale.audio/api.html](https://docs.funkwhale.audio/api.html)
*
* The version of the OpenAPI document: 1.2.8
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import * as globalImportUrl from 'url';
import globalAxios, { AxiosPromise, AxiosInstance } from 'axios';
import { Configuration } from '../configuration';
// Some imports not used depending on template conditions
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
// @ts-ignore
import { License } from '../types';
// @ts-ignore
import { PaginatedLicenseList } from '../types';
/**
* LicensesApi - axios parameter creator
* @export
*/
export const LicensesApiAxiosParamCreator = function (configuration?: Configuration) {
return {
/**
*
* @param {string} [ordering] Which field to use when ordering the results.
* @param {number} [page] A page number within the paginated result set.
* @param {number} [pageSize] Number of results to return per page.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
licensesList: async (ordering?: string, page?: number, pageSize?: number, options: any = {}): Promise<RequestArgs> => {
const localVarPath = `/api/v1/licenses/`;
const localVarUrlObj = globalImportUrl.parse(localVarPath, true);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication ApplicationToken required
// http bearer authentication required
if (configuration && configuration.accessToken) {
const accessToken = typeof configuration.accessToken === 'function'
? configuration.accessToken()
: configuration.accessToken;
localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
}
// authentication oauth2 required
// oauth required
if (configuration && configuration.accessToken) {
const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
? configuration.accessToken("oauth2", [])
: configuration.accessToken;
localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue;
}
if (ordering !== undefined) {
localVarQueryParameter['ordering'] = ordering;
}
if (page !== undefined) {
localVarQueryParameter['page'] = page;
}
if (pageSize !== undefined) {
localVarQueryParameter['page_size'] = pageSize;
}
localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query};
// fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
delete localVarUrlObj.search;
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: globalImportUrl.format(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @param {string} code A unique value identifying this license.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
licensesRetrieve: async (code: string, options: any = {}): Promise<RequestArgs> => {
// verify required parameter 'code' is not null or undefined
if (code === null || code === undefined) {
throw new RequiredError('code','Required parameter code was null or undefined when calling licensesRetrieve.');
}
const localVarPath = `/api/v1/licenses/{code}/`
.replace(`{${"code"}}`, encodeURIComponent(String(code)));
const localVarUrlObj = globalImportUrl.parse(localVarPath, true);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication ApplicationToken required
// http bearer authentication required
if (configuration && configuration.accessToken) {
const accessToken = typeof configuration.accessToken === 'function'
? configuration.accessToken()
: configuration.accessToken;
localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
}
// authentication oauth2 required
// oauth required
if (configuration && configuration.accessToken) {
const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
? configuration.accessToken("oauth2", [])
: configuration.accessToken;
localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue;
}
localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query};
// fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
delete localVarUrlObj.search;
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: globalImportUrl.format(localVarUrlObj),
options: localVarRequestOptions,
};
},
}
};
/**
* LicensesApi - functional programming interface
* @export
*/
export const LicensesApiFp = function(configuration?: Configuration) {
return {
/**
*
* @param {string} [ordering] Which field to use when ordering the results.
* @param {number} [page] A page number within the paginated result set.
* @param {number} [pageSize] Number of results to return per page.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async licensesList(ordering?: string, page?: number, pageSize?: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PaginatedLicenseList>> {
const localVarAxiosArgs = await LicensesApiAxiosParamCreator(configuration).licensesList(ordering, page, pageSize, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
*
* @param {string} code A unique value identifying this license.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async licensesRetrieve(code: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<License>> {
const localVarAxiosArgs = await LicensesApiAxiosParamCreator(configuration).licensesRetrieve(code, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
}
};
/**
* LicensesApi - factory interface
* @export
*/
export const LicensesApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
return {
/**
*
* @param {string} [ordering] Which field to use when ordering the results.
* @param {number} [page] A page number within the paginated result set.
* @param {number} [pageSize] Number of results to return per page.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
licensesList(ordering?: string, page?: number, pageSize?: number, options?: any): AxiosPromise<PaginatedLicenseList> {
return LicensesApiFp(configuration).licensesList(ordering, page, pageSize, options).then((request) => request(axios, basePath));
},
/**
*
* @param {string} code A unique value identifying this license.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
licensesRetrieve(code: string, options?: any): AxiosPromise<License> {
return LicensesApiFp(configuration).licensesRetrieve(code, options).then((request) => request(axios, basePath));
},
};
};
/**
* LicensesApi - object-oriented interface
* @export
* @class LicensesApi
* @extends {BaseAPI}
*/
export class LicensesApi extends BaseAPI {
/**
*
* @param {string} [ordering] Which field to use when ordering the results.
* @param {number} [page] A page number within the paginated result set.
* @param {number} [pageSize] Number of results to return per page.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof LicensesApi
*/
public licensesList(ordering?: string, page?: number, pageSize?: number, options?: any) {
return LicensesApiFp(this.configuration).licensesList(ordering, page, pageSize, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @param {string} code A unique value identifying this license.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof LicensesApi
*/
public licensesRetrieve(code: string, options?: any) {
return LicensesApiFp(this.configuration).licensesRetrieve(code, options).then((request) => request(this.axios, this.basePath));
}
}
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment