vrchat 1.0.2 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/base.d.ts CHANGED
@@ -1,55 +1,54 @@
1
- /**
2
- * VRChat API Documentation
3
- * ![VRChat API Banner](https://vrchatapi.github.io/assets/img/api_banner_1500x400.png) # Welcome to the VRChat API Before we begin, we would like to state this is a **COMMUNITY DRIVEN PROJECT**. This means that everything you read on here was written by the community itself and is **not** officially supported by VRChat. The documentation is provided \"AS IS\", and any action you take towards VRChat is completely your own responsibility. The documentation and additional libraries SHALL ONLY be used for applications interacting with VRChat\'s API in accordance with their [Terms of Service](https://github.com/VRChatAPI), and MUST NOT be used for modifying the client, \"avatar ripping\", or other illegal activities. Malicious usage or spamming the API may result in account termination. Certain parts of the API are also more sensitive than others, for example moderation, so please read tread extra carefully and read the warnings when present. ![Tupper Policy on API](https://i.imgur.com/yLlW7Ok.png) Finally, use of the API using applications other than the approved methods (website, VRChat application, Unity SDK) is not officially supported. VRChat provides no guarantee or support for external applications using the API. Access to API endpoints may break **at any time, without notice**. Therefore, please **do not ping** VRChat Staff in the VRChat Discord if you are having API problems, as they do not provide API support. We will make a best effort in keeping this documentation and associated language libraries up to date, but things might be outdated or missing. If you find that something is no longer valid, please contact us on Discord or [create an issue](https://github.com/vrchatapi/specification/issues) and tell us so we can fix it. # Getting Started The VRChat API can be used to programmatically retrieve or update information regarding your profile, friends, avatars, worlds and more. The API consists of two parts, \"Photon\" which is only used in-game, and the \"Web API\" which is used by both the game and the website. This documentation focuses only on the Web API. The API is designed around the REST ideology, providing semi-simple and usually predictable URIs to access and modify objects. Requests support standard HTTP methods like GET, PUT, POST, and DELETE and standard status codes. Response bodies are always UTF-8 encoded JSON objects, unless explicitly documented otherwise. <div class=\"callout callout-error\"> <strong>🛑 Warning! Do not touch Photon!</strong><br> Photon is only used by the in-game client and should <b>not</b> be touched. Doing so may result in permanent account termination. </div> <div class=\"callout callout-info\"> <strong>â„šī¸ API Key and Authentication</strong><br> The API Key has always been the same and is currently <code>JlE5Jldo5Jibnk5O5hTx6XVqsJu4WJ26</code>. Read <a href=\"#tag--authentication\">Authentication</a> for how to log in. </div> # Using the API For simply exploring what the API can do it is strongly recommended to download [Insomnia](https://insomnia.rest/download), a free and open-source API client that\'s great for sending requests to the API in an orderly fashion. Insomnia allows you to send data in the format that\'s required for VRChat\'s API. It is also possible to try out the API in your browser, by first logging in at [vrchat.com/home](https://vrchat.com/home/) and then going to [vrchat.com/api/1/auth/user](https://vrchat.com/api/1/auth/user), but the information will be much harder to work with. For more permanent operation such as software development it is instead recommended to use one of the existing language SDKs. This community project maintains API libraries in several languages, which allows you to interact with the API with simple function calls rather than having to implement the HTTP protocol yourself. Most of these libraries are automatically generated from the API specification, sometimes with additional helpful wrapper code to make usage easier. This allows them to be almost automatically updated and expanded upon as soon as a new feature is introduced in the specification itself. The libraries can be found on [GitHub](https://github.com/vrchatapi) or following: * [NodeJS (JavaScript)](https://www.npmjs.com/package/vrchat) * [Dart](https://pub.dev/packages/vrchat_dart) * [Rust](https://crates.io/crates/vrchatapi) * [C#](github.com/vrchatapi/vrchatapi-csharp) * [Python](https://github.com/vrchatapi/VRChatPython) # Pagination Most endpoints enforce pagination, meaning they will only return 10 entries by default, and never more than 100.<br> Using both the limit and offset parameters allows you to easily paginate through a large number of objects. | Query Parameter | Type | Description | | ----------|--|------- | | `limit` | integer | The number of objects to return. This value often defaults to 10. Highest limit is always 100.| | `offset` | integer | A zero-based offset from the default object sorting.| If a request returns fewer objects than the `limit` parameter, there are no more items available to return. # Contribution Do you want to get involved in the documentation effort? Do you want to help improve one of the language API libraries? This project is an [OPEN Open Source Project](https://openopensource.org)! This means that individuals making significant and valuable contributions are given commit-access to the project. It also means we are very open and welcoming of new people making contributions, unlike some more guarded open-source projects. [![Discord](https://img.shields.io/static/v1?label=vrchatapi&message=discord&color=blueviolet&style=for-the-badge)](https://discord.gg/qjZE9C9fkB)
4
- *
5
- * The version of the OpenAPI document: 1.0.2
6
- * Contact: me@ruby.js.org
7
- *
8
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
- * https://openapi-generator.tech
10
- * Do not edit the class manually.
11
- */
12
- import { Configuration } from "./configuration";
13
- import { AxiosInstance } from 'axios';
14
- export declare const BASE_PATH: string;
15
- /**
16
- *
17
- * @export
18
- */
19
- export declare const COLLECTION_FORMATS: {
20
- csv: string;
21
- ssv: string;
22
- tsv: string;
23
- pipes: string;
24
- };
25
- /**
26
- *
27
- * @export
28
- * @interface RequestArgs
29
- */
30
- export interface RequestArgs {
31
- url: string;
32
- options: any;
33
- }
34
- /**
35
- *
36
- * @export
37
- * @class BaseAPI
38
- */
39
- export declare class BaseAPI {
40
- protected basePath: string;
41
- protected axios: AxiosInstance;
42
- protected configuration: Configuration | undefined;
43
- constructor(configuration?: Configuration, basePath?: string, axios?: AxiosInstance);
44
- }
45
- /**
46
- *
47
- * @export
48
- * @class RequiredError
49
- * @extends {Error}
50
- */
51
- export declare class RequiredError extends Error {
52
- field: string;
53
- name: "RequiredError";
54
- constructor(field: string, msg?: string);
55
- }
1
+ /**
2
+ * VRChat API Documentation
3
+ *
4
+ * The version of the OpenAPI document: 1.3.1
5
+ * Contact: me@ruby.js.org
6
+ *
7
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
8
+ * https://openapi-generator.tech
9
+ * Do not edit the class manually.
10
+ */
11
+ import { Configuration } from "./configuration";
12
+ import { AxiosInstance } from 'axios';
13
+ export declare const BASE_PATH: string;
14
+ /**
15
+ *
16
+ * @export
17
+ */
18
+ export declare const COLLECTION_FORMATS: {
19
+ csv: string;
20
+ ssv: string;
21
+ tsv: string;
22
+ pipes: string;
23
+ };
24
+ /**
25
+ *
26
+ * @export
27
+ * @interface RequestArgs
28
+ */
29
+ export interface RequestArgs {
30
+ url: string;
31
+ options: any;
32
+ }
33
+ /**
34
+ *
35
+ * @export
36
+ * @class BaseAPI
37
+ */
38
+ export declare class BaseAPI {
39
+ protected basePath: string;
40
+ protected axios: AxiosInstance;
41
+ protected configuration: Configuration | undefined;
42
+ constructor(configuration?: Configuration, basePath?: string, axios?: AxiosInstance);
43
+ }
44
+ /**
45
+ *
46
+ * @export
47
+ * @class RequiredError
48
+ * @extends {Error}
49
+ */
50
+ export declare class RequiredError extends Error {
51
+ field: string;
52
+ name: "RequiredError";
53
+ constructor(field: string, msg?: string);
54
+ }
package/dist/base.js CHANGED
@@ -1,80 +1,79 @@
1
- "use strict";
2
- /* tslint:disable */
3
- /* eslint-disable */
4
- /**
5
- * VRChat API Documentation
6
- * ![VRChat API Banner](https://vrchatapi.github.io/assets/img/api_banner_1500x400.png) # Welcome to the VRChat API Before we begin, we would like to state this is a **COMMUNITY DRIVEN PROJECT**. This means that everything you read on here was written by the community itself and is **not** officially supported by VRChat. The documentation is provided \"AS IS\", and any action you take towards VRChat is completely your own responsibility. The documentation and additional libraries SHALL ONLY be used for applications interacting with VRChat\'s API in accordance with their [Terms of Service](https://github.com/VRChatAPI), and MUST NOT be used for modifying the client, \"avatar ripping\", or other illegal activities. Malicious usage or spamming the API may result in account termination. Certain parts of the API are also more sensitive than others, for example moderation, so please read tread extra carefully and read the warnings when present. ![Tupper Policy on API](https://i.imgur.com/yLlW7Ok.png) Finally, use of the API using applications other than the approved methods (website, VRChat application, Unity SDK) is not officially supported. VRChat provides no guarantee or support for external applications using the API. Access to API endpoints may break **at any time, without notice**. Therefore, please **do not ping** VRChat Staff in the VRChat Discord if you are having API problems, as they do not provide API support. We will make a best effort in keeping this documentation and associated language libraries up to date, but things might be outdated or missing. If you find that something is no longer valid, please contact us on Discord or [create an issue](https://github.com/vrchatapi/specification/issues) and tell us so we can fix it. # Getting Started The VRChat API can be used to programmatically retrieve or update information regarding your profile, friends, avatars, worlds and more. The API consists of two parts, \"Photon\" which is only used in-game, and the \"Web API\" which is used by both the game and the website. This documentation focuses only on the Web API. The API is designed around the REST ideology, providing semi-simple and usually predictable URIs to access and modify objects. Requests support standard HTTP methods like GET, PUT, POST, and DELETE and standard status codes. Response bodies are always UTF-8 encoded JSON objects, unless explicitly documented otherwise. <div class=\"callout callout-error\"> <strong>🛑 Warning! Do not touch Photon!</strong><br> Photon is only used by the in-game client and should <b>not</b> be touched. Doing so may result in permanent account termination. </div> <div class=\"callout callout-info\"> <strong>â„šī¸ API Key and Authentication</strong><br> The API Key has always been the same and is currently <code>JlE5Jldo5Jibnk5O5hTx6XVqsJu4WJ26</code>. Read <a href=\"#tag--authentication\">Authentication</a> for how to log in. </div> # Using the API For simply exploring what the API can do it is strongly recommended to download [Insomnia](https://insomnia.rest/download), a free and open-source API client that\'s great for sending requests to the API in an orderly fashion. Insomnia allows you to send data in the format that\'s required for VRChat\'s API. It is also possible to try out the API in your browser, by first logging in at [vrchat.com/home](https://vrchat.com/home/) and then going to [vrchat.com/api/1/auth/user](https://vrchat.com/api/1/auth/user), but the information will be much harder to work with. For more permanent operation such as software development it is instead recommended to use one of the existing language SDKs. This community project maintains API libraries in several languages, which allows you to interact with the API with simple function calls rather than having to implement the HTTP protocol yourself. Most of these libraries are automatically generated from the API specification, sometimes with additional helpful wrapper code to make usage easier. This allows them to be almost automatically updated and expanded upon as soon as a new feature is introduced in the specification itself. The libraries can be found on [GitHub](https://github.com/vrchatapi) or following: * [NodeJS (JavaScript)](https://www.npmjs.com/package/vrchat) * [Dart](https://pub.dev/packages/vrchat_dart) * [Rust](https://crates.io/crates/vrchatapi) * [C#](github.com/vrchatapi/vrchatapi-csharp) * [Python](https://github.com/vrchatapi/VRChatPython) # Pagination Most endpoints enforce pagination, meaning they will only return 10 entries by default, and never more than 100.<br> Using both the limit and offset parameters allows you to easily paginate through a large number of objects. | Query Parameter | Type | Description | | ----------|--|------- | | `limit` | integer | The number of objects to return. This value often defaults to 10. Highest limit is always 100.| | `offset` | integer | A zero-based offset from the default object sorting.| If a request returns fewer objects than the `limit` parameter, there are no more items available to return. # Contribution Do you want to get involved in the documentation effort? Do you want to help improve one of the language API libraries? This project is an [OPEN Open Source Project](https://openopensource.org)! This means that individuals making significant and valuable contributions are given commit-access to the project. It also means we are very open and welcoming of new people making contributions, unlike some more guarded open-source projects. [![Discord](https://img.shields.io/static/v1?label=vrchatapi&message=discord&color=blueviolet&style=for-the-badge)](https://discord.gg/qjZE9C9fkB)
7
- *
8
- * The version of the OpenAPI document: 1.0.2
9
- * Contact: me@ruby.js.org
10
- *
11
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
- * https://openapi-generator.tech
13
- * Do not edit the class manually.
14
- */
15
- var __extends = (this && this.__extends) || (function () {
16
- var extendStatics = function (d, b) {
17
- extendStatics = Object.setPrototypeOf ||
18
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
19
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
20
- return extendStatics(d, b);
21
- };
22
- return function (d, b) {
23
- extendStatics(d, b);
24
- function __() { this.constructor = d; }
25
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
26
- };
27
- })();
28
- Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.RequiredError = exports.BaseAPI = exports.COLLECTION_FORMATS = exports.BASE_PATH = void 0;
30
- // Some imports not used depending on template conditions
31
- // @ts-ignore
32
- var axios_1 = require("axios");
33
- exports.BASE_PATH = "https://api.vrchat.cloud/api/1".replace(/\/+$/, "");
34
- /**
35
- *
36
- * @export
37
- */
38
- exports.COLLECTION_FORMATS = {
39
- csv: ",",
40
- ssv: " ",
41
- tsv: "\t",
42
- pipes: "|",
43
- };
44
- /**
45
- *
46
- * @export
47
- * @class BaseAPI
48
- */
49
- var BaseAPI = /** @class */ (function () {
50
- function BaseAPI(configuration, basePath, axios) {
51
- if (basePath === void 0) { basePath = exports.BASE_PATH; }
52
- if (axios === void 0) { axios = axios_1.default; }
53
- this.basePath = basePath;
54
- this.axios = axios;
55
- if (configuration) {
56
- this.configuration = configuration;
57
- this.basePath = configuration.basePath || this.basePath;
58
- }
59
- }
60
- return BaseAPI;
61
- }());
62
- exports.BaseAPI = BaseAPI;
63
- ;
64
- /**
65
- *
66
- * @export
67
- * @class RequiredError
68
- * @extends {Error}
69
- */
70
- var RequiredError = /** @class */ (function (_super) {
71
- __extends(RequiredError, _super);
72
- function RequiredError(field, msg) {
73
- var _this = _super.call(this, msg) || this;
74
- _this.field = field;
75
- _this.name = "RequiredError";
76
- return _this;
77
- }
78
- return RequiredError;
79
- }(Error));
80
- exports.RequiredError = RequiredError;
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * VRChat API Documentation
6
+ *
7
+ * The version of the OpenAPI document: 1.3.1
8
+ * Contact: me@ruby.js.org
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+ var __extends = (this && this.__extends) || (function () {
15
+ var extendStatics = function (d, b) {
16
+ extendStatics = Object.setPrototypeOf ||
17
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
18
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
19
+ return extendStatics(d, b);
20
+ };
21
+ return function (d, b) {
22
+ extendStatics(d, b);
23
+ function __() { this.constructor = d; }
24
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
25
+ };
26
+ })();
27
+ Object.defineProperty(exports, "__esModule", { value: true });
28
+ exports.RequiredError = exports.BaseAPI = exports.COLLECTION_FORMATS = exports.BASE_PATH = void 0;
29
+ // Some imports not used depending on template conditions
30
+ // @ts-ignore
31
+ var axios_1 = require("axios");
32
+ exports.BASE_PATH = "https://api.vrchat.cloud/api/1".replace(/\/+$/, "");
33
+ /**
34
+ *
35
+ * @export
36
+ */
37
+ exports.COLLECTION_FORMATS = {
38
+ csv: ",",
39
+ ssv: " ",
40
+ tsv: "\t",
41
+ pipes: "|",
42
+ };
43
+ /**
44
+ *
45
+ * @export
46
+ * @class BaseAPI
47
+ */
48
+ var BaseAPI = /** @class */ (function () {
49
+ function BaseAPI(configuration, basePath, axios) {
50
+ if (basePath === void 0) { basePath = exports.BASE_PATH; }
51
+ if (axios === void 0) { axios = axios_1.default; }
52
+ this.basePath = basePath;
53
+ this.axios = axios;
54
+ if (configuration) {
55
+ this.configuration = configuration;
56
+ this.basePath = configuration.basePath || this.basePath;
57
+ }
58
+ }
59
+ return BaseAPI;
60
+ }());
61
+ exports.BaseAPI = BaseAPI;
62
+ ;
63
+ /**
64
+ *
65
+ * @export
66
+ * @class RequiredError
67
+ * @extends {Error}
68
+ */
69
+ var RequiredError = /** @class */ (function (_super) {
70
+ __extends(RequiredError, _super);
71
+ function RequiredError(field, msg) {
72
+ var _this = _super.call(this, msg) || this;
73
+ _this.field = field;
74
+ _this.name = "RequiredError";
75
+ return _this;
76
+ }
77
+ return RequiredError;
78
+ }(Error));
79
+ exports.RequiredError = RequiredError;
package/dist/common.d.ts CHANGED
@@ -1,65 +1,64 @@
1
- /**
2
- * VRChat API Documentation
3
- * ![VRChat API Banner](https://vrchatapi.github.io/assets/img/api_banner_1500x400.png) # Welcome to the VRChat API Before we begin, we would like to state this is a **COMMUNITY DRIVEN PROJECT**. This means that everything you read on here was written by the community itself and is **not** officially supported by VRChat. The documentation is provided \"AS IS\", and any action you take towards VRChat is completely your own responsibility. The documentation and additional libraries SHALL ONLY be used for applications interacting with VRChat\'s API in accordance with their [Terms of Service](https://github.com/VRChatAPI), and MUST NOT be used for modifying the client, \"avatar ripping\", or other illegal activities. Malicious usage or spamming the API may result in account termination. Certain parts of the API are also more sensitive than others, for example moderation, so please read tread extra carefully and read the warnings when present. ![Tupper Policy on API](https://i.imgur.com/yLlW7Ok.png) Finally, use of the API using applications other than the approved methods (website, VRChat application, Unity SDK) is not officially supported. VRChat provides no guarantee or support for external applications using the API. Access to API endpoints may break **at any time, without notice**. Therefore, please **do not ping** VRChat Staff in the VRChat Discord if you are having API problems, as they do not provide API support. We will make a best effort in keeping this documentation and associated language libraries up to date, but things might be outdated or missing. If you find that something is no longer valid, please contact us on Discord or [create an issue](https://github.com/vrchatapi/specification/issues) and tell us so we can fix it. # Getting Started The VRChat API can be used to programmatically retrieve or update information regarding your profile, friends, avatars, worlds and more. The API consists of two parts, \"Photon\" which is only used in-game, and the \"Web API\" which is used by both the game and the website. This documentation focuses only on the Web API. The API is designed around the REST ideology, providing semi-simple and usually predictable URIs to access and modify objects. Requests support standard HTTP methods like GET, PUT, POST, and DELETE and standard status codes. Response bodies are always UTF-8 encoded JSON objects, unless explicitly documented otherwise. <div class=\"callout callout-error\"> <strong>🛑 Warning! Do not touch Photon!</strong><br> Photon is only used by the in-game client and should <b>not</b> be touched. Doing so may result in permanent account termination. </div> <div class=\"callout callout-info\"> <strong>â„šī¸ API Key and Authentication</strong><br> The API Key has always been the same and is currently <code>JlE5Jldo5Jibnk5O5hTx6XVqsJu4WJ26</code>. Read <a href=\"#tag--authentication\">Authentication</a> for how to log in. </div> # Using the API For simply exploring what the API can do it is strongly recommended to download [Insomnia](https://insomnia.rest/download), a free and open-source API client that\'s great for sending requests to the API in an orderly fashion. Insomnia allows you to send data in the format that\'s required for VRChat\'s API. It is also possible to try out the API in your browser, by first logging in at [vrchat.com/home](https://vrchat.com/home/) and then going to [vrchat.com/api/1/auth/user](https://vrchat.com/api/1/auth/user), but the information will be much harder to work with. For more permanent operation such as software development it is instead recommended to use one of the existing language SDKs. This community project maintains API libraries in several languages, which allows you to interact with the API with simple function calls rather than having to implement the HTTP protocol yourself. Most of these libraries are automatically generated from the API specification, sometimes with additional helpful wrapper code to make usage easier. This allows them to be almost automatically updated and expanded upon as soon as a new feature is introduced in the specification itself. The libraries can be found on [GitHub](https://github.com/vrchatapi) or following: * [NodeJS (JavaScript)](https://www.npmjs.com/package/vrchat) * [Dart](https://pub.dev/packages/vrchat_dart) * [Rust](https://crates.io/crates/vrchatapi) * [C#](github.com/vrchatapi/vrchatapi-csharp) * [Python](https://github.com/vrchatapi/VRChatPython) # Pagination Most endpoints enforce pagination, meaning they will only return 10 entries by default, and never more than 100.<br> Using both the limit and offset parameters allows you to easily paginate through a large number of objects. | Query Parameter | Type | Description | | ----------|--|------- | | `limit` | integer | The number of objects to return. This value often defaults to 10. Highest limit is always 100.| | `offset` | integer | A zero-based offset from the default object sorting.| If a request returns fewer objects than the `limit` parameter, there are no more items available to return. # Contribution Do you want to get involved in the documentation effort? Do you want to help improve one of the language API libraries? This project is an [OPEN Open Source Project](https://openopensource.org)! This means that individuals making significant and valuable contributions are given commit-access to the project. It also means we are very open and welcoming of new people making contributions, unlike some more guarded open-source projects. [![Discord](https://img.shields.io/static/v1?label=vrchatapi&message=discord&color=blueviolet&style=for-the-badge)](https://discord.gg/qjZE9C9fkB)
4
- *
5
- * The version of the OpenAPI document: 1.0.2
6
- * Contact: me@ruby.js.org
7
- *
8
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
- * https://openapi-generator.tech
10
- * Do not edit the class manually.
11
- */
12
- import { Configuration } from "./configuration";
13
- import { RequestArgs } from "./base";
14
- import { AxiosInstance } from 'axios';
15
- /**
16
- *
17
- * @export
18
- */
19
- export declare const DUMMY_BASE_URL = "https://example.com";
20
- /**
21
- *
22
- * @throws {RequiredError}
23
- * @export
24
- */
25
- export declare const assertParamExists: (functionName: string, paramName: string, paramValue: unknown) => void;
26
- /**
27
- *
28
- * @export
29
- */
30
- export declare const setApiKeyToObject: (object: any, keyParamName: string, configuration?: Configuration) => Promise<void>;
31
- /**
32
- *
33
- * @export
34
- */
35
- export declare const setBasicAuthToObject: (object: any, configuration?: Configuration) => void;
36
- /**
37
- *
38
- * @export
39
- */
40
- export declare const setBearerAuthToObject: (object: any, configuration?: Configuration) => Promise<void>;
41
- /**
42
- *
43
- * @export
44
- */
45
- export declare const setOAuthToObject: (object: any, name: string, scopes: string[], configuration?: Configuration) => Promise<void>;
46
- /**
47
- *
48
- * @export
49
- */
50
- export declare const setSearchParams: (url: URL, ...objects: any[]) => void;
51
- /**
52
- *
53
- * @export
54
- */
55
- export declare const serializeDataIfNeeded: (value: any, requestOptions: any, configuration?: Configuration) => any;
56
- /**
57
- *
58
- * @export
59
- */
60
- export declare const toPathString: (url: URL) => string;
61
- /**
62
- *
63
- * @export
64
- */
65
- export declare const createRequestFunction: (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) => (axios?: AxiosInstance, basePath?: string) => Promise<import("axios").AxiosResponse<any>>;
1
+ /**
2
+ * VRChat API Documentation
3
+ *
4
+ * The version of the OpenAPI document: 1.3.1
5
+ * Contact: me@ruby.js.org
6
+ *
7
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
8
+ * https://openapi-generator.tech
9
+ * Do not edit the class manually.
10
+ */
11
+ import { Configuration } from "./configuration";
12
+ import { RequestArgs } from "./base";
13
+ import { AxiosInstance } from 'axios';
14
+ /**
15
+ *
16
+ * @export
17
+ */
18
+ export declare const DUMMY_BASE_URL = "https://example.com";
19
+ /**
20
+ *
21
+ * @throws {RequiredError}
22
+ * @export
23
+ */
24
+ export declare const assertParamExists: (functionName: string, paramName: string, paramValue: unknown) => void;
25
+ /**
26
+ *
27
+ * @export
28
+ */
29
+ export declare const setApiKeyToObject: (object: any, keyParamName: string, configuration?: Configuration) => Promise<void>;
30
+ /**
31
+ *
32
+ * @export
33
+ */
34
+ export declare const setBasicAuthToObject: (object: any, configuration?: Configuration) => void;
35
+ /**
36
+ *
37
+ * @export
38
+ */
39
+ export declare const setBearerAuthToObject: (object: any, configuration?: Configuration) => Promise<void>;
40
+ /**
41
+ *
42
+ * @export
43
+ */
44
+ export declare const setOAuthToObject: (object: any, name: string, scopes: string[], configuration?: Configuration) => Promise<void>;
45
+ /**
46
+ *
47
+ * @export
48
+ */
49
+ export declare const setSearchParams: (url: URL, ...objects: any[]) => void;
50
+ /**
51
+ *
52
+ * @export
53
+ */
54
+ export declare const serializeDataIfNeeded: (value: any, requestOptions: any, configuration?: Configuration) => any;
55
+ /**
56
+ *
57
+ * @export
58
+ */
59
+ export declare const toPathString: (url: URL) => string;
60
+ /**
61
+ *
62
+ * @export
63
+ */
64
+ export declare const createRequestFunction: (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) => (axios?: AxiosInstance, basePath?: string) => Promise<import("axios").AxiosResponse<any>>;
package/dist/common.js CHANGED
@@ -1,234 +1,233 @@
1
- "use strict";
2
- /* tslint:disable */
3
- /* eslint-disable */
4
- /**
5
- * VRChat API Documentation
6
- * ![VRChat API Banner](https://vrchatapi.github.io/assets/img/api_banner_1500x400.png) # Welcome to the VRChat API Before we begin, we would like to state this is a **COMMUNITY DRIVEN PROJECT**. This means that everything you read on here was written by the community itself and is **not** officially supported by VRChat. The documentation is provided \"AS IS\", and any action you take towards VRChat is completely your own responsibility. The documentation and additional libraries SHALL ONLY be used for applications interacting with VRChat\'s API in accordance with their [Terms of Service](https://github.com/VRChatAPI), and MUST NOT be used for modifying the client, \"avatar ripping\", or other illegal activities. Malicious usage or spamming the API may result in account termination. Certain parts of the API are also more sensitive than others, for example moderation, so please read tread extra carefully and read the warnings when present. ![Tupper Policy on API](https://i.imgur.com/yLlW7Ok.png) Finally, use of the API using applications other than the approved methods (website, VRChat application, Unity SDK) is not officially supported. VRChat provides no guarantee or support for external applications using the API. Access to API endpoints may break **at any time, without notice**. Therefore, please **do not ping** VRChat Staff in the VRChat Discord if you are having API problems, as they do not provide API support. We will make a best effort in keeping this documentation and associated language libraries up to date, but things might be outdated or missing. If you find that something is no longer valid, please contact us on Discord or [create an issue](https://github.com/vrchatapi/specification/issues) and tell us so we can fix it. # Getting Started The VRChat API can be used to programmatically retrieve or update information regarding your profile, friends, avatars, worlds and more. The API consists of two parts, \"Photon\" which is only used in-game, and the \"Web API\" which is used by both the game and the website. This documentation focuses only on the Web API. The API is designed around the REST ideology, providing semi-simple and usually predictable URIs to access and modify objects. Requests support standard HTTP methods like GET, PUT, POST, and DELETE and standard status codes. Response bodies are always UTF-8 encoded JSON objects, unless explicitly documented otherwise. <div class=\"callout callout-error\"> <strong>🛑 Warning! Do not touch Photon!</strong><br> Photon is only used by the in-game client and should <b>not</b> be touched. Doing so may result in permanent account termination. </div> <div class=\"callout callout-info\"> <strong>â„šī¸ API Key and Authentication</strong><br> The API Key has always been the same and is currently <code>JlE5Jldo5Jibnk5O5hTx6XVqsJu4WJ26</code>. Read <a href=\"#tag--authentication\">Authentication</a> for how to log in. </div> # Using the API For simply exploring what the API can do it is strongly recommended to download [Insomnia](https://insomnia.rest/download), a free and open-source API client that\'s great for sending requests to the API in an orderly fashion. Insomnia allows you to send data in the format that\'s required for VRChat\'s API. It is also possible to try out the API in your browser, by first logging in at [vrchat.com/home](https://vrchat.com/home/) and then going to [vrchat.com/api/1/auth/user](https://vrchat.com/api/1/auth/user), but the information will be much harder to work with. For more permanent operation such as software development it is instead recommended to use one of the existing language SDKs. This community project maintains API libraries in several languages, which allows you to interact with the API with simple function calls rather than having to implement the HTTP protocol yourself. Most of these libraries are automatically generated from the API specification, sometimes with additional helpful wrapper code to make usage easier. This allows them to be almost automatically updated and expanded upon as soon as a new feature is introduced in the specification itself. The libraries can be found on [GitHub](https://github.com/vrchatapi) or following: * [NodeJS (JavaScript)](https://www.npmjs.com/package/vrchat) * [Dart](https://pub.dev/packages/vrchat_dart) * [Rust](https://crates.io/crates/vrchatapi) * [C#](github.com/vrchatapi/vrchatapi-csharp) * [Python](https://github.com/vrchatapi/VRChatPython) # Pagination Most endpoints enforce pagination, meaning they will only return 10 entries by default, and never more than 100.<br> Using both the limit and offset parameters allows you to easily paginate through a large number of objects. | Query Parameter | Type | Description | | ----------|--|------- | | `limit` | integer | The number of objects to return. This value often defaults to 10. Highest limit is always 100.| | `offset` | integer | A zero-based offset from the default object sorting.| If a request returns fewer objects than the `limit` parameter, there are no more items available to return. # Contribution Do you want to get involved in the documentation effort? Do you want to help improve one of the language API libraries? This project is an [OPEN Open Source Project](https://openopensource.org)! This means that individuals making significant and valuable contributions are given commit-access to the project. It also means we are very open and welcoming of new people making contributions, unlike some more guarded open-source projects. [![Discord](https://img.shields.io/static/v1?label=vrchatapi&message=discord&color=blueviolet&style=for-the-badge)](https://discord.gg/qjZE9C9fkB)
7
- *
8
- * The version of the OpenAPI document: 1.0.2
9
- * Contact: me@ruby.js.org
10
- *
11
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
- * https://openapi-generator.tech
13
- * Do not edit the class manually.
14
- */
15
- var __assign = (this && this.__assign) || function () {
16
- __assign = Object.assign || function(t) {
17
- for (var s, i = 1, n = arguments.length; i < n; i++) {
18
- s = arguments[i];
19
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
20
- t[p] = s[p];
21
- }
22
- return t;
23
- };
24
- return __assign.apply(this, arguments);
25
- };
26
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
27
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
28
- return new (P || (P = Promise))(function (resolve, reject) {
29
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
30
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
31
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
32
- step((generator = generator.apply(thisArg, _arguments || [])).next());
33
- });
34
- };
35
- var __generator = (this && this.__generator) || function (thisArg, body) {
36
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
37
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
38
- function verb(n) { return function (v) { return step([n, v]); }; }
39
- function step(op) {
40
- if (f) throw new TypeError("Generator is already executing.");
41
- while (_) try {
42
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
43
- if (y = 0, t) op = [op[0] & 2, t.value];
44
- switch (op[0]) {
45
- case 0: case 1: t = op; break;
46
- case 4: _.label++; return { value: op[1], done: false };
47
- case 5: _.label++; y = op[1]; op = [0]; continue;
48
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
49
- default:
50
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
51
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
52
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
53
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
54
- if (t[2]) _.ops.pop();
55
- _.trys.pop(); continue;
56
- }
57
- op = body.call(thisArg, _);
58
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
59
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
60
- }
61
- };
62
- Object.defineProperty(exports, "__esModule", { value: true });
63
- exports.createRequestFunction = exports.toPathString = exports.serializeDataIfNeeded = exports.setSearchParams = exports.setOAuthToObject = exports.setBearerAuthToObject = exports.setBasicAuthToObject = exports.setApiKeyToObject = exports.assertParamExists = exports.DUMMY_BASE_URL = void 0;
64
- var base_1 = require("./base");
65
- /**
66
- *
67
- * @export
68
- */
69
- exports.DUMMY_BASE_URL = 'https://example.com';
70
- /**
71
- *
72
- * @throws {RequiredError}
73
- * @export
74
- */
75
- exports.assertParamExists = function (functionName, paramName, paramValue) {
76
- if (paramValue === null || paramValue === undefined) {
77
- throw new base_1.RequiredError(paramName, "Required parameter " + paramName + " was null or undefined when calling " + functionName + ".");
78
- }
79
- };
80
- /**
81
- *
82
- * @export
83
- */
84
- exports.setApiKeyToObject = function (object, keyParamName, configuration) {
85
- return __awaiter(this, void 0, void 0, function () {
86
- var localVarApiKeyValue, _a;
87
- return __generator(this, function (_b) {
88
- switch (_b.label) {
89
- case 0:
90
- if (!(configuration && configuration.apiKey)) return [3 /*break*/, 5];
91
- if (!(typeof configuration.apiKey === 'function')) return [3 /*break*/, 2];
92
- return [4 /*yield*/, configuration.apiKey(keyParamName)];
93
- case 1:
94
- _a = _b.sent();
95
- return [3 /*break*/, 4];
96
- case 2: return [4 /*yield*/, configuration.apiKey];
97
- case 3:
98
- _a = _b.sent();
99
- _b.label = 4;
100
- case 4:
101
- localVarApiKeyValue = _a;
102
- object[keyParamName] = localVarApiKeyValue;
103
- _b.label = 5;
104
- case 5: return [2 /*return*/];
105
- }
106
- });
107
- });
108
- };
109
- /**
110
- *
111
- * @export
112
- */
113
- exports.setBasicAuthToObject = function (object, configuration) {
114
- if (configuration && (configuration.username || configuration.password)) {
115
- object["auth"] = { username: configuration.username, password: configuration.password };
116
- }
117
- };
118
- /**
119
- *
120
- * @export
121
- */
122
- exports.setBearerAuthToObject = function (object, configuration) {
123
- return __awaiter(this, void 0, void 0, function () {
124
- var accessToken, _a;
125
- return __generator(this, function (_b) {
126
- switch (_b.label) {
127
- case 0:
128
- if (!(configuration && configuration.accessToken)) return [3 /*break*/, 5];
129
- if (!(typeof configuration.accessToken === 'function')) return [3 /*break*/, 2];
130
- return [4 /*yield*/, configuration.accessToken()];
131
- case 1:
132
- _a = _b.sent();
133
- return [3 /*break*/, 4];
134
- case 2: return [4 /*yield*/, configuration.accessToken];
135
- case 3:
136
- _a = _b.sent();
137
- _b.label = 4;
138
- case 4:
139
- accessToken = _a;
140
- object["Authorization"] = "Bearer " + accessToken;
141
- _b.label = 5;
142
- case 5: return [2 /*return*/];
143
- }
144
- });
145
- });
146
- };
147
- /**
148
- *
149
- * @export
150
- */
151
- exports.setOAuthToObject = function (object, name, scopes, configuration) {
152
- return __awaiter(this, void 0, void 0, function () {
153
- var localVarAccessTokenValue, _a;
154
- return __generator(this, function (_b) {
155
- switch (_b.label) {
156
- case 0:
157
- if (!(configuration && configuration.accessToken)) return [3 /*break*/, 5];
158
- if (!(typeof configuration.accessToken === 'function')) return [3 /*break*/, 2];
159
- return [4 /*yield*/, configuration.accessToken(name, scopes)];
160
- case 1:
161
- _a = _b.sent();
162
- return [3 /*break*/, 4];
163
- case 2: return [4 /*yield*/, configuration.accessToken];
164
- case 3:
165
- _a = _b.sent();
166
- _b.label = 4;
167
- case 4:
168
- localVarAccessTokenValue = _a;
169
- object["Authorization"] = "Bearer " + localVarAccessTokenValue;
170
- _b.label = 5;
171
- case 5: return [2 /*return*/];
172
- }
173
- });
174
- });
175
- };
176
- /**
177
- *
178
- * @export
179
- */
180
- exports.setSearchParams = function (url) {
181
- var objects = [];
182
- for (var _i = 1; _i < arguments.length; _i++) {
183
- objects[_i - 1] = arguments[_i];
184
- }
185
- var searchParams = new URLSearchParams(url.search);
186
- for (var _a = 0, objects_1 = objects; _a < objects_1.length; _a++) {
187
- var object = objects_1[_a];
188
- for (var key in object) {
189
- if (Array.isArray(object[key])) {
190
- searchParams.delete(key);
191
- for (var _b = 0, _c = object[key]; _b < _c.length; _b++) {
192
- var item = _c[_b];
193
- searchParams.append(key, item);
194
- }
195
- }
196
- else {
197
- searchParams.set(key, object[key]);
198
- }
199
- }
200
- }
201
- url.search = searchParams.toString();
202
- };
203
- /**
204
- *
205
- * @export
206
- */
207
- exports.serializeDataIfNeeded = function (value, requestOptions, configuration) {
208
- var nonString = typeof value !== 'string';
209
- var needsSerialization = nonString && configuration && configuration.isJsonMime
210
- ? configuration.isJsonMime(requestOptions.headers['Content-Type'])
211
- : nonString;
212
- return needsSerialization
213
- ? JSON.stringify(value !== undefined ? value : {})
214
- : (value || "");
215
- };
216
- /**
217
- *
218
- * @export
219
- */
220
- exports.toPathString = function (url) {
221
- return url.pathname + url.search + url.hash;
222
- };
223
- /**
224
- *
225
- * @export
226
- */
227
- exports.createRequestFunction = function (axiosArgs, globalAxios, BASE_PATH, configuration) {
228
- return function (axios, basePath) {
229
- if (axios === void 0) { axios = globalAxios; }
230
- if (basePath === void 0) { basePath = BASE_PATH; }
231
- var axiosRequestArgs = __assign(__assign({}, axiosArgs.options), { url: ((configuration === null || configuration === void 0 ? void 0 : configuration.basePath) || basePath) + axiosArgs.url });
232
- return axios.request(axiosRequestArgs);
233
- };
234
- };
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * VRChat API Documentation
6
+ *
7
+ * The version of the OpenAPI document: 1.3.1
8
+ * Contact: me@ruby.js.org
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+ var __assign = (this && this.__assign) || function () {
15
+ __assign = Object.assign || function(t) {
16
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
17
+ s = arguments[i];
18
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
19
+ t[p] = s[p];
20
+ }
21
+ return t;
22
+ };
23
+ return __assign.apply(this, arguments);
24
+ };
25
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
+ return new (P || (P = Promise))(function (resolve, reject) {
28
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
32
+ });
33
+ };
34
+ var __generator = (this && this.__generator) || function (thisArg, body) {
35
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
36
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
37
+ function verb(n) { return function (v) { return step([n, v]); }; }
38
+ function step(op) {
39
+ if (f) throw new TypeError("Generator is already executing.");
40
+ while (_) try {
41
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
42
+ if (y = 0, t) op = [op[0] & 2, t.value];
43
+ switch (op[0]) {
44
+ case 0: case 1: t = op; break;
45
+ case 4: _.label++; return { value: op[1], done: false };
46
+ case 5: _.label++; y = op[1]; op = [0]; continue;
47
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
48
+ default:
49
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
50
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
51
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
52
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
53
+ if (t[2]) _.ops.pop();
54
+ _.trys.pop(); continue;
55
+ }
56
+ op = body.call(thisArg, _);
57
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
58
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
59
+ }
60
+ };
61
+ Object.defineProperty(exports, "__esModule", { value: true });
62
+ exports.createRequestFunction = exports.toPathString = exports.serializeDataIfNeeded = exports.setSearchParams = exports.setOAuthToObject = exports.setBearerAuthToObject = exports.setBasicAuthToObject = exports.setApiKeyToObject = exports.assertParamExists = exports.DUMMY_BASE_URL = void 0;
63
+ var base_1 = require("./base");
64
+ /**
65
+ *
66
+ * @export
67
+ */
68
+ exports.DUMMY_BASE_URL = 'https://example.com';
69
+ /**
70
+ *
71
+ * @throws {RequiredError}
72
+ * @export
73
+ */
74
+ exports.assertParamExists = function (functionName, paramName, paramValue) {
75
+ if (paramValue === null || paramValue === undefined) {
76
+ throw new base_1.RequiredError(paramName, "Required parameter " + paramName + " was null or undefined when calling " + functionName + ".");
77
+ }
78
+ };
79
+ /**
80
+ *
81
+ * @export
82
+ */
83
+ exports.setApiKeyToObject = function (object, keyParamName, configuration) {
84
+ return __awaiter(this, void 0, void 0, function () {
85
+ var localVarApiKeyValue, _a;
86
+ return __generator(this, function (_b) {
87
+ switch (_b.label) {
88
+ case 0:
89
+ if (!(configuration && configuration.apiKey)) return [3 /*break*/, 5];
90
+ if (!(typeof configuration.apiKey === 'function')) return [3 /*break*/, 2];
91
+ return [4 /*yield*/, configuration.apiKey(keyParamName)];
92
+ case 1:
93
+ _a = _b.sent();
94
+ return [3 /*break*/, 4];
95
+ case 2: return [4 /*yield*/, configuration.apiKey];
96
+ case 3:
97
+ _a = _b.sent();
98
+ _b.label = 4;
99
+ case 4:
100
+ localVarApiKeyValue = _a;
101
+ object[keyParamName] = localVarApiKeyValue;
102
+ _b.label = 5;
103
+ case 5: return [2 /*return*/];
104
+ }
105
+ });
106
+ });
107
+ };
108
+ /**
109
+ *
110
+ * @export
111
+ */
112
+ exports.setBasicAuthToObject = function (object, configuration) {
113
+ if (configuration && (configuration.username || configuration.password)) {
114
+ object["auth"] = { username: configuration.username, password: configuration.password };
115
+ }
116
+ };
117
+ /**
118
+ *
119
+ * @export
120
+ */
121
+ exports.setBearerAuthToObject = function (object, configuration) {
122
+ return __awaiter(this, void 0, void 0, function () {
123
+ var accessToken, _a;
124
+ return __generator(this, function (_b) {
125
+ switch (_b.label) {
126
+ case 0:
127
+ if (!(configuration && configuration.accessToken)) return [3 /*break*/, 5];
128
+ if (!(typeof configuration.accessToken === 'function')) return [3 /*break*/, 2];
129
+ return [4 /*yield*/, configuration.accessToken()];
130
+ case 1:
131
+ _a = _b.sent();
132
+ return [3 /*break*/, 4];
133
+ case 2: return [4 /*yield*/, configuration.accessToken];
134
+ case 3:
135
+ _a = _b.sent();
136
+ _b.label = 4;
137
+ case 4:
138
+ accessToken = _a;
139
+ object["Authorization"] = "Bearer " + accessToken;
140
+ _b.label = 5;
141
+ case 5: return [2 /*return*/];
142
+ }
143
+ });
144
+ });
145
+ };
146
+ /**
147
+ *
148
+ * @export
149
+ */
150
+ exports.setOAuthToObject = function (object, name, scopes, configuration) {
151
+ return __awaiter(this, void 0, void 0, function () {
152
+ var localVarAccessTokenValue, _a;
153
+ return __generator(this, function (_b) {
154
+ switch (_b.label) {
155
+ case 0:
156
+ if (!(configuration && configuration.accessToken)) return [3 /*break*/, 5];
157
+ if (!(typeof configuration.accessToken === 'function')) return [3 /*break*/, 2];
158
+ return [4 /*yield*/, configuration.accessToken(name, scopes)];
159
+ case 1:
160
+ _a = _b.sent();
161
+ return [3 /*break*/, 4];
162
+ case 2: return [4 /*yield*/, configuration.accessToken];
163
+ case 3:
164
+ _a = _b.sent();
165
+ _b.label = 4;
166
+ case 4:
167
+ localVarAccessTokenValue = _a;
168
+ object["Authorization"] = "Bearer " + localVarAccessTokenValue;
169
+ _b.label = 5;
170
+ case 5: return [2 /*return*/];
171
+ }
172
+ });
173
+ });
174
+ };
175
+ /**
176
+ *
177
+ * @export
178
+ */
179
+ exports.setSearchParams = function (url) {
180
+ var objects = [];
181
+ for (var _i = 1; _i < arguments.length; _i++) {
182
+ objects[_i - 1] = arguments[_i];
183
+ }
184
+ var searchParams = new URLSearchParams(url.search);
185
+ for (var _a = 0, objects_1 = objects; _a < objects_1.length; _a++) {
186
+ var object = objects_1[_a];
187
+ for (var key in object) {
188
+ if (Array.isArray(object[key])) {
189
+ searchParams.delete(key);
190
+ for (var _b = 0, _c = object[key]; _b < _c.length; _b++) {
191
+ var item = _c[_b];
192
+ searchParams.append(key, item);
193
+ }
194
+ }
195
+ else {
196
+ searchParams.set(key, object[key]);
197
+ }
198
+ }
199
+ }
200
+ url.search = searchParams.toString();
201
+ };
202
+ /**
203
+ *
204
+ * @export
205
+ */
206
+ exports.serializeDataIfNeeded = function (value, requestOptions, configuration) {
207
+ var nonString = typeof value !== 'string';
208
+ var needsSerialization = nonString && configuration && configuration.isJsonMime
209
+ ? configuration.isJsonMime(requestOptions.headers['Content-Type'])
210
+ : nonString;
211
+ return needsSerialization
212
+ ? JSON.stringify(value !== undefined ? value : {})
213
+ : (value || "");
214
+ };
215
+ /**
216
+ *
217
+ * @export
218
+ */
219
+ exports.toPathString = function (url) {
220
+ return url.pathname + url.search + url.hash;
221
+ };
222
+ /**
223
+ *
224
+ * @export
225
+ */
226
+ exports.createRequestFunction = function (axiosArgs, globalAxios, BASE_PATH, configuration) {
227
+ return function (axios, basePath) {
228
+ if (axios === void 0) { axios = globalAxios; }
229
+ if (basePath === void 0) { basePath = BASE_PATH; }
230
+ var axiosRequestArgs = __assign(__assign({}, axiosArgs.options), { url: ((configuration === null || configuration === void 0 ? void 0 : configuration.basePath) || basePath) + axiosArgs.url });
231
+ return axios.request(axiosRequestArgs);
232
+ };
233
+ };