@xfloor/floor-memory-sdk-ts 1.0.0

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.
Files changed (95) hide show
  1. package/LICENSE +1 -0
  2. package/README.md +176 -0
  3. package/dist/apis/DefaultApi.d.ts +209 -0
  4. package/dist/apis/DefaultApi.js +986 -0
  5. package/dist/apis/EditFloorApi.d.ts +36 -0
  6. package/dist/apis/EditFloorApi.js +173 -0
  7. package/dist/apis/EventApi.d.ts +32 -0
  8. package/dist/apis/EventApi.js +157 -0
  9. package/dist/apis/GetFloorInformationApi.d.ts +33 -0
  10. package/dist/apis/GetFloorInformationApi.js +144 -0
  11. package/dist/apis/GetRecentEventsApi.d.ts +33 -0
  12. package/dist/apis/GetRecentEventsApi.js +146 -0
  13. package/dist/apis/QueryApi.d.ts +31 -0
  14. package/dist/apis/QueryApi.js +139 -0
  15. package/dist/apis/index.d.ts +6 -0
  16. package/dist/apis/index.js +24 -0
  17. package/dist/index.d.ts +3 -0
  18. package/dist/index.js +21 -0
  19. package/dist/models/BlockDetails.d.ts +44 -0
  20. package/dist/models/BlockDetails.js +59 -0
  21. package/dist/models/ChangePassword200Response.d.ts +32 -0
  22. package/dist/models/ChangePassword200Response.js +51 -0
  23. package/dist/models/EditFloor400Response.d.ts +33 -0
  24. package/dist/models/EditFloor400Response.js +52 -0
  25. package/dist/models/EditFloor400ResponseError.d.ts +50 -0
  26. package/dist/models/EditFloor400ResponseError.js +63 -0
  27. package/dist/models/Event400Response.d.ts +33 -0
  28. package/dist/models/Event400Response.js +52 -0
  29. package/dist/models/Event400ResponseError.d.ts +50 -0
  30. package/dist/models/Event400ResponseError.js +63 -0
  31. package/dist/models/EventResponse.d.ts +32 -0
  32. package/dist/models/EventResponse.js +51 -0
  33. package/dist/models/FloorInfo.d.ts +64 -0
  34. package/dist/models/FloorInfo.js +67 -0
  35. package/dist/models/GetFloorInformation200Response.d.ts +64 -0
  36. package/dist/models/GetFloorInformation200Response.js +67 -0
  37. package/dist/models/GetRecentEvents200Response.d.ts +39 -0
  38. package/dist/models/GetRecentEvents200Response.js +56 -0
  39. package/dist/models/GetRecentEvents200ResponseItemsInner.d.ts +82 -0
  40. package/dist/models/GetRecentEvents200ResponseItemsInner.js +67 -0
  41. package/dist/models/GetRecentEvents200ResponseItemsInnerAuthor.d.ts +51 -0
  42. package/dist/models/GetRecentEvents200ResponseItemsInnerAuthor.js +56 -0
  43. package/dist/models/GetRecentEvents400Response.d.ts +33 -0
  44. package/dist/models/GetRecentEvents400Response.js +52 -0
  45. package/dist/models/GetRecentEvents400ResponseError.d.ts +50 -0
  46. package/dist/models/GetRecentEvents400ResponseError.js +63 -0
  47. package/dist/models/Media.d.ts +38 -0
  48. package/dist/models/Media.js +55 -0
  49. package/dist/models/Model400ErrorCode.d.ts +50 -0
  50. package/dist/models/Model400ErrorCode.js +63 -0
  51. package/dist/models/Query422Response.d.ts +33 -0
  52. package/dist/models/Query422Response.js +52 -0
  53. package/dist/models/Query422ResponseError.d.ts +32 -0
  54. package/dist/models/Query422ResponseError.js +51 -0
  55. package/dist/models/QueryRequest.d.ts +69 -0
  56. package/dist/models/QueryRequest.js +68 -0
  57. package/dist/models/QueryRequestFilters.d.ts +50 -0
  58. package/dist/models/QueryRequestFilters.js +63 -0
  59. package/dist/models/QueryResponse.d.ts +39 -0
  60. package/dist/models/QueryResponse.js +52 -0
  61. package/dist/models/QueryResponseItemsInner.d.ts +92 -0
  62. package/dist/models/QueryResponseItemsInner.js +69 -0
  63. package/dist/models/SendSignInValidationCode200Response.d.ts +44 -0
  64. package/dist/models/SendSignInValidationCode200Response.js +57 -0
  65. package/dist/models/SendSignInValidationCode400Response.d.ts +50 -0
  66. package/dist/models/SendSignInValidationCode400Response.js +63 -0
  67. package/dist/models/SendValidationCode200Response.d.ts +32 -0
  68. package/dist/models/SendValidationCode200Response.js +51 -0
  69. package/dist/models/SendValidationCodeRequest.d.ts +38 -0
  70. package/dist/models/SendValidationCodeRequest.js +55 -0
  71. package/dist/models/SignInWithEmail200Response.d.ts +46 -0
  72. package/dist/models/SignInWithEmail200Response.js +61 -0
  73. package/dist/models/SignInWithEmail200ResponseProfile.d.ts +76 -0
  74. package/dist/models/SignInWithEmail200ResponseProfile.js +73 -0
  75. package/dist/models/SignInWithEmail200ResponseProfileAvatar.d.ts +38 -0
  76. package/dist/models/SignInWithEmail200ResponseProfileAvatar.js +55 -0
  77. package/dist/models/SignUp200Response.d.ts +38 -0
  78. package/dist/models/SignUp200Response.js +55 -0
  79. package/dist/models/SignUpResponse.d.ts +38 -0
  80. package/dist/models/SignUpResponse.js +55 -0
  81. package/dist/models/UserDetails.d.ts +46 -0
  82. package/dist/models/UserDetails.js +61 -0
  83. package/dist/models/ValidateCode400Response.d.ts +33 -0
  84. package/dist/models/ValidateCode400Response.js +52 -0
  85. package/dist/models/ValidateCode400ResponseError.d.ts +50 -0
  86. package/dist/models/ValidateCode400ResponseError.js +63 -0
  87. package/dist/models/ValidateCode412Response.d.ts +32 -0
  88. package/dist/models/ValidateCode412Response.js +51 -0
  89. package/dist/models/ValidateCodeRequest.d.ts +50 -0
  90. package/dist/models/ValidateCodeRequest.js +63 -0
  91. package/dist/models/index.d.ts +36 -0
  92. package/dist/models/index.js +54 -0
  93. package/dist/runtime.d.ts +184 -0
  94. package/dist/runtime.js +564 -0
  95. package/package.json +36 -0
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Floor Memory
3
+ * The set APIs are used to develop Floor pds which can be used as their personal assistants. This set of APIs are divided into two parts. - Memory and - Registration. The developer has two ways of using the APIs for the app development. Developer can choose to the Registration APIs for using the existing xfloor infracture or can implement custom Registration process. In the case of custom registration process, the developer is bound to provide proper authentication mechanisms and then send the user information to xlfoor.
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ * Contact: contact@ipomo.in
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
+ /**
13
+ *
14
+ * @export
15
+ * @interface ValidateCode412Response
16
+ */
17
+ export interface ValidateCode412Response {
18
+ /**
19
+ * Something went wrong. Try again
20
+ * @type {string}
21
+ * @memberof ValidateCode412Response
22
+ */
23
+ error: string;
24
+ }
25
+ /**
26
+ * Check if a given object implements the ValidateCode412Response interface.
27
+ */
28
+ export declare function instanceOfValidateCode412Response(value: object): value is ValidateCode412Response;
29
+ export declare function ValidateCode412ResponseFromJSON(json: any): ValidateCode412Response;
30
+ export declare function ValidateCode412ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ValidateCode412Response;
31
+ export declare function ValidateCode412ResponseToJSON(json: any): ValidateCode412Response;
32
+ export declare function ValidateCode412ResponseToJSONTyped(value?: ValidateCode412Response | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Floor Memory
6
+ * The set APIs are used to develop Floor pds which can be used as their personal assistants. This set of APIs are divided into two parts. - Memory and - Registration. The developer has two ways of using the APIs for the app development. Developer can choose to the Registration APIs for using the existing xfloor infracture or can implement custom Registration process. In the case of custom registration process, the developer is bound to provide proper authentication mechanisms and then send the user information to xlfoor.
7
+ *
8
+ * The version of the OpenAPI document: 1.0.0
9
+ * Contact: contact@ipomo.in
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
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.instanceOfValidateCode412Response = instanceOfValidateCode412Response;
17
+ exports.ValidateCode412ResponseFromJSON = ValidateCode412ResponseFromJSON;
18
+ exports.ValidateCode412ResponseFromJSONTyped = ValidateCode412ResponseFromJSONTyped;
19
+ exports.ValidateCode412ResponseToJSON = ValidateCode412ResponseToJSON;
20
+ exports.ValidateCode412ResponseToJSONTyped = ValidateCode412ResponseToJSONTyped;
21
+ /**
22
+ * Check if a given object implements the ValidateCode412Response interface.
23
+ */
24
+ function instanceOfValidateCode412Response(value) {
25
+ if (!('error' in value) || value['error'] === undefined)
26
+ return false;
27
+ return true;
28
+ }
29
+ function ValidateCode412ResponseFromJSON(json) {
30
+ return ValidateCode412ResponseFromJSONTyped(json, false);
31
+ }
32
+ function ValidateCode412ResponseFromJSONTyped(json, ignoreDiscriminator) {
33
+ if (json == null) {
34
+ return json;
35
+ }
36
+ return {
37
+ 'error': json['error'],
38
+ };
39
+ }
40
+ function ValidateCode412ResponseToJSON(json) {
41
+ return ValidateCode412ResponseToJSONTyped(json, false);
42
+ }
43
+ function ValidateCode412ResponseToJSONTyped(value, ignoreDiscriminator) {
44
+ if (ignoreDiscriminator === void 0) { ignoreDiscriminator = false; }
45
+ if (value == null) {
46
+ return value;
47
+ }
48
+ return {
49
+ 'error': value['error'],
50
+ };
51
+ }
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Floor Memory
3
+ * The set APIs are used to develop Floor pds which can be used as their personal assistants. This set of APIs are divided into two parts. - Memory and - Registration. The developer has two ways of using the APIs for the app development. Developer can choose to the Registration APIs for using the existing xfloor infracture or can implement custom Registration process. In the case of custom registration process, the developer is bound to provide proper authentication mechanisms and then send the user information to xlfoor.
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ * Contact: contact@ipomo.in
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
+ /**
13
+ *
14
+ * @export
15
+ * @interface ValidateCodeRequest
16
+ */
17
+ export interface ValidateCodeRequest {
18
+ /**
19
+ * User ID
20
+ * @type {string}
21
+ * @memberof ValidateCodeRequest
22
+ */
23
+ userId: string;
24
+ /**
25
+ * Validation code
26
+ * @type {string}
27
+ * @memberof ValidateCodeRequest
28
+ */
29
+ activationCode: string;
30
+ /**
31
+ * App ID which is given while registering as developer
32
+ * @type {string}
33
+ * @memberof ValidateCodeRequest
34
+ */
35
+ appId: string;
36
+ /**
37
+ * 4 for sign up, 5 for login
38
+ * @type {string}
39
+ * @memberof ValidateCodeRequest
40
+ */
41
+ mode: string;
42
+ }
43
+ /**
44
+ * Check if a given object implements the ValidateCodeRequest interface.
45
+ */
46
+ export declare function instanceOfValidateCodeRequest(value: object): value is ValidateCodeRequest;
47
+ export declare function ValidateCodeRequestFromJSON(json: any): ValidateCodeRequest;
48
+ export declare function ValidateCodeRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): ValidateCodeRequest;
49
+ export declare function ValidateCodeRequestToJSON(json: any): ValidateCodeRequest;
50
+ export declare function ValidateCodeRequestToJSONTyped(value?: ValidateCodeRequest | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Floor Memory
6
+ * The set APIs are used to develop Floor pds which can be used as their personal assistants. This set of APIs are divided into two parts. - Memory and - Registration. The developer has two ways of using the APIs for the app development. Developer can choose to the Registration APIs for using the existing xfloor infracture or can implement custom Registration process. In the case of custom registration process, the developer is bound to provide proper authentication mechanisms and then send the user information to xlfoor.
7
+ *
8
+ * The version of the OpenAPI document: 1.0.0
9
+ * Contact: contact@ipomo.in
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
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.instanceOfValidateCodeRequest = instanceOfValidateCodeRequest;
17
+ exports.ValidateCodeRequestFromJSON = ValidateCodeRequestFromJSON;
18
+ exports.ValidateCodeRequestFromJSONTyped = ValidateCodeRequestFromJSONTyped;
19
+ exports.ValidateCodeRequestToJSON = ValidateCodeRequestToJSON;
20
+ exports.ValidateCodeRequestToJSONTyped = ValidateCodeRequestToJSONTyped;
21
+ /**
22
+ * Check if a given object implements the ValidateCodeRequest interface.
23
+ */
24
+ function instanceOfValidateCodeRequest(value) {
25
+ if (!('userId' in value) || value['userId'] === undefined)
26
+ return false;
27
+ if (!('activationCode' in value) || value['activationCode'] === undefined)
28
+ return false;
29
+ if (!('appId' in value) || value['appId'] === undefined)
30
+ return false;
31
+ if (!('mode' in value) || value['mode'] === undefined)
32
+ return false;
33
+ return true;
34
+ }
35
+ function ValidateCodeRequestFromJSON(json) {
36
+ return ValidateCodeRequestFromJSONTyped(json, false);
37
+ }
38
+ function ValidateCodeRequestFromJSONTyped(json, ignoreDiscriminator) {
39
+ if (json == null) {
40
+ return json;
41
+ }
42
+ return {
43
+ 'userId': json['user_id'],
44
+ 'activationCode': json['activation_code'],
45
+ 'appId': json['app_id'],
46
+ 'mode': json['mode'],
47
+ };
48
+ }
49
+ function ValidateCodeRequestToJSON(json) {
50
+ return ValidateCodeRequestToJSONTyped(json, false);
51
+ }
52
+ function ValidateCodeRequestToJSONTyped(value, ignoreDiscriminator) {
53
+ if (ignoreDiscriminator === void 0) { ignoreDiscriminator = false; }
54
+ if (value == null) {
55
+ return value;
56
+ }
57
+ return {
58
+ 'user_id': value['userId'],
59
+ 'activation_code': value['activationCode'],
60
+ 'app_id': value['appId'],
61
+ 'mode': value['mode'],
62
+ };
63
+ }
@@ -0,0 +1,36 @@
1
+ export * from './BlockDetails';
2
+ export * from './ChangePassword200Response';
3
+ export * from './EditFloor400Response';
4
+ export * from './EditFloor400ResponseError';
5
+ export * from './Event400Response';
6
+ export * from './Event400ResponseError';
7
+ export * from './EventResponse';
8
+ export * from './FloorInfo';
9
+ export * from './GetFloorInformation200Response';
10
+ export * from './GetRecentEvents200Response';
11
+ export * from './GetRecentEvents200ResponseItemsInner';
12
+ export * from './GetRecentEvents200ResponseItemsInnerAuthor';
13
+ export * from './GetRecentEvents400Response';
14
+ export * from './GetRecentEvents400ResponseError';
15
+ export * from './Media';
16
+ export * from './Model400ErrorCode';
17
+ export * from './Query422Response';
18
+ export * from './Query422ResponseError';
19
+ export * from './QueryRequest';
20
+ export * from './QueryRequestFilters';
21
+ export * from './QueryResponse';
22
+ export * from './QueryResponseItemsInner';
23
+ export * from './SendSignInValidationCode200Response';
24
+ export * from './SendSignInValidationCode400Response';
25
+ export * from './SendValidationCode200Response';
26
+ export * from './SendValidationCodeRequest';
27
+ export * from './SignInWithEmail200Response';
28
+ export * from './SignInWithEmail200ResponseProfile';
29
+ export * from './SignInWithEmail200ResponseProfileAvatar';
30
+ export * from './SignUp200Response';
31
+ export * from './SignUpResponse';
32
+ export * from './UserDetails';
33
+ export * from './ValidateCode400Response';
34
+ export * from './ValidateCode400ResponseError';
35
+ export * from './ValidateCode412Response';
36
+ export * from './ValidateCodeRequest';
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ /* tslint:disable */
18
+ /* eslint-disable */
19
+ __exportStar(require("./BlockDetails"), exports);
20
+ __exportStar(require("./ChangePassword200Response"), exports);
21
+ __exportStar(require("./EditFloor400Response"), exports);
22
+ __exportStar(require("./EditFloor400ResponseError"), exports);
23
+ __exportStar(require("./Event400Response"), exports);
24
+ __exportStar(require("./Event400ResponseError"), exports);
25
+ __exportStar(require("./EventResponse"), exports);
26
+ __exportStar(require("./FloorInfo"), exports);
27
+ __exportStar(require("./GetFloorInformation200Response"), exports);
28
+ __exportStar(require("./GetRecentEvents200Response"), exports);
29
+ __exportStar(require("./GetRecentEvents200ResponseItemsInner"), exports);
30
+ __exportStar(require("./GetRecentEvents200ResponseItemsInnerAuthor"), exports);
31
+ __exportStar(require("./GetRecentEvents400Response"), exports);
32
+ __exportStar(require("./GetRecentEvents400ResponseError"), exports);
33
+ __exportStar(require("./Media"), exports);
34
+ __exportStar(require("./Model400ErrorCode"), exports);
35
+ __exportStar(require("./Query422Response"), exports);
36
+ __exportStar(require("./Query422ResponseError"), exports);
37
+ __exportStar(require("./QueryRequest"), exports);
38
+ __exportStar(require("./QueryRequestFilters"), exports);
39
+ __exportStar(require("./QueryResponse"), exports);
40
+ __exportStar(require("./QueryResponseItemsInner"), exports);
41
+ __exportStar(require("./SendSignInValidationCode200Response"), exports);
42
+ __exportStar(require("./SendSignInValidationCode400Response"), exports);
43
+ __exportStar(require("./SendValidationCode200Response"), exports);
44
+ __exportStar(require("./SendValidationCodeRequest"), exports);
45
+ __exportStar(require("./SignInWithEmail200Response"), exports);
46
+ __exportStar(require("./SignInWithEmail200ResponseProfile"), exports);
47
+ __exportStar(require("./SignInWithEmail200ResponseProfileAvatar"), exports);
48
+ __exportStar(require("./SignUp200Response"), exports);
49
+ __exportStar(require("./SignUpResponse"), exports);
50
+ __exportStar(require("./UserDetails"), exports);
51
+ __exportStar(require("./ValidateCode400Response"), exports);
52
+ __exportStar(require("./ValidateCode400ResponseError"), exports);
53
+ __exportStar(require("./ValidateCode412Response"), exports);
54
+ __exportStar(require("./ValidateCodeRequest"), exports);
@@ -0,0 +1,184 @@
1
+ /**
2
+ * Floor Memory
3
+ * The set APIs are used to develop Floor pds which can be used as their personal assistants. This set of APIs are divided into two parts. - Memory and - Registration. The developer has two ways of using the APIs for the app development. Developer can choose to the Registration APIs for using the existing xfloor infracture or can implement custom Registration process. In the case of custom registration process, the developer is bound to provide proper authentication mechanisms and then send the user information to xlfoor.
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ * Contact: contact@ipomo.in
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
+ export declare const BASE_PATH: string;
13
+ export interface ConfigurationParameters {
14
+ basePath?: string;
15
+ fetchApi?: FetchAPI;
16
+ middleware?: Middleware[];
17
+ queryParamsStringify?: (params: HTTPQuery) => string;
18
+ username?: string;
19
+ password?: string;
20
+ apiKey?: string | Promise<string> | ((name: string) => string | Promise<string>);
21
+ accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string | Promise<string>);
22
+ headers?: HTTPHeaders;
23
+ credentials?: RequestCredentials;
24
+ }
25
+ export declare class Configuration {
26
+ private configuration;
27
+ constructor(configuration?: ConfigurationParameters);
28
+ set config(configuration: Configuration);
29
+ get basePath(): string;
30
+ get fetchApi(): FetchAPI | undefined;
31
+ get middleware(): Middleware[];
32
+ get queryParamsStringify(): (params: HTTPQuery) => string;
33
+ get username(): string | undefined;
34
+ get password(): string | undefined;
35
+ get apiKey(): ((name: string) => string | Promise<string>) | undefined;
36
+ get accessToken(): ((name?: string, scopes?: string[]) => string | Promise<string>) | undefined;
37
+ get headers(): HTTPHeaders | undefined;
38
+ get credentials(): RequestCredentials | undefined;
39
+ }
40
+ export declare const DefaultConfig: Configuration;
41
+ /**
42
+ * This is the base class for all generated API classes.
43
+ */
44
+ export declare class BaseAPI {
45
+ protected configuration: Configuration;
46
+ private static readonly jsonRegex;
47
+ private middleware;
48
+ constructor(configuration?: Configuration);
49
+ withMiddleware<T extends BaseAPI>(this: T, ...middlewares: Middleware[]): T;
50
+ withPreMiddleware<T extends BaseAPI>(this: T, ...preMiddlewares: Array<Middleware['pre']>): T;
51
+ withPostMiddleware<T extends BaseAPI>(this: T, ...postMiddlewares: Array<Middleware['post']>): T;
52
+ /**
53
+ * Check if the given MIME is a JSON MIME.
54
+ * JSON MIME examples:
55
+ * application/json
56
+ * application/json; charset=UTF8
57
+ * APPLICATION/JSON
58
+ * application/vnd.company+json
59
+ * @param mime - MIME (Multipurpose Internet Mail Extensions)
60
+ * @return True if the given MIME is JSON, false otherwise.
61
+ */
62
+ protected isJsonMime(mime: string | null | undefined): boolean;
63
+ protected request(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction): Promise<Response>;
64
+ private createFetchParams;
65
+ private fetchApi;
66
+ /**
67
+ * Create a shallow clone of `this` by constructing a new instance
68
+ * and then shallow cloning data members.
69
+ */
70
+ private clone;
71
+ }
72
+ export declare class ResponseError extends Error {
73
+ response: Response;
74
+ name: "ResponseError";
75
+ constructor(response: Response, msg?: string);
76
+ }
77
+ export declare class FetchError extends Error {
78
+ cause: Error;
79
+ name: "FetchError";
80
+ constructor(cause: Error, msg?: string);
81
+ }
82
+ export declare class RequiredError extends Error {
83
+ field: string;
84
+ name: "RequiredError";
85
+ constructor(field: string, msg?: string);
86
+ }
87
+ export declare const COLLECTION_FORMATS: {
88
+ csv: string;
89
+ ssv: string;
90
+ tsv: string;
91
+ pipes: string;
92
+ };
93
+ export type FetchAPI = WindowOrWorkerGlobalScope['fetch'];
94
+ export type Json = any;
95
+ export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD';
96
+ export type HTTPHeaders = {
97
+ [key: string]: string;
98
+ };
99
+ export type HTTPQuery = {
100
+ [key: string]: string | number | null | boolean | Array<string | number | null | boolean> | Set<string | number | null | boolean> | HTTPQuery;
101
+ };
102
+ export type HTTPBody = Json | FormData | URLSearchParams;
103
+ export type HTTPRequestInit = {
104
+ headers?: HTTPHeaders;
105
+ method: HTTPMethod;
106
+ credentials?: RequestCredentials;
107
+ body?: HTTPBody;
108
+ };
109
+ export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original';
110
+ export type InitOverrideFunction = (requestContext: {
111
+ init: HTTPRequestInit;
112
+ context: RequestOpts;
113
+ }) => Promise<RequestInit>;
114
+ export interface FetchParams {
115
+ url: string;
116
+ init: RequestInit;
117
+ }
118
+ export interface RequestOpts {
119
+ path: string;
120
+ method: HTTPMethod;
121
+ headers: HTTPHeaders;
122
+ query?: HTTPQuery;
123
+ body?: HTTPBody;
124
+ }
125
+ export declare function querystring(params: HTTPQuery, prefix?: string): string;
126
+ export declare function exists(json: any, key: string): boolean;
127
+ export declare function mapValues(data: any, fn: (item: any) => any): {
128
+ [key: string]: any;
129
+ };
130
+ export declare function canConsumeForm(consumes: Consume[]): boolean;
131
+ export interface Consume {
132
+ contentType: string;
133
+ }
134
+ export interface RequestContext {
135
+ fetch: FetchAPI;
136
+ url: string;
137
+ init: RequestInit;
138
+ }
139
+ export interface ResponseContext {
140
+ fetch: FetchAPI;
141
+ url: string;
142
+ init: RequestInit;
143
+ response: Response;
144
+ }
145
+ export interface ErrorContext {
146
+ fetch: FetchAPI;
147
+ url: string;
148
+ init: RequestInit;
149
+ error: unknown;
150
+ response?: Response;
151
+ }
152
+ export interface Middleware {
153
+ pre?(context: RequestContext): Promise<FetchParams | void>;
154
+ post?(context: ResponseContext): Promise<Response | void>;
155
+ onError?(context: ErrorContext): Promise<Response | void>;
156
+ }
157
+ export interface ApiResponse<T> {
158
+ raw: Response;
159
+ value(): Promise<T>;
160
+ }
161
+ export interface ResponseTransformer<T> {
162
+ (json: any): T;
163
+ }
164
+ export declare class JSONApiResponse<T> {
165
+ raw: Response;
166
+ private transformer;
167
+ constructor(raw: Response, transformer?: ResponseTransformer<T>);
168
+ value(): Promise<T>;
169
+ }
170
+ export declare class VoidApiResponse {
171
+ raw: Response;
172
+ constructor(raw: Response);
173
+ value(): Promise<void>;
174
+ }
175
+ export declare class BlobApiResponse {
176
+ raw: Response;
177
+ constructor(raw: Response);
178
+ value(): Promise<Blob>;
179
+ }
180
+ export declare class TextApiResponse {
181
+ raw: Response;
182
+ constructor(raw: Response);
183
+ value(): Promise<string>;
184
+ }