@digital-realty/ix-notifications 1.0.2 → 1.0.4

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 (67) hide show
  1. package/dist/IxNotifications.d.ts +37 -37
  2. package/dist/IxNotifications.js +163 -163
  3. package/dist/api/notifications-api/apis/NotificationsApi.d.ts +83 -83
  4. package/dist/api/notifications-api/apis/NotificationsApi.js +203 -203
  5. package/dist/api/notifications-api/apis/index.d.ts +1 -1
  6. package/dist/api/notifications-api/apis/index.js +3 -3
  7. package/dist/api/notifications-api/index.d.ts +3 -3
  8. package/dist/api/notifications-api/index.js +5 -5
  9. package/dist/api/notifications-api/models/ErrorResponse.d.ts +55 -55
  10. package/dist/api/notifications-api/models/ErrorResponse.js +51 -51
  11. package/dist/api/notifications-api/models/GetNotifications200Response.d.ts +62 -62
  12. package/dist/api/notifications-api/models/GetNotifications200Response.js +55 -55
  13. package/dist/api/notifications-api/models/Notification.d.ts +86 -86
  14. package/dist/api/notifications-api/models/Notification.js +62 -62
  15. package/dist/api/notifications-api/models/NotificationDelete.d.ts +31 -31
  16. package/dist/api/notifications-api/models/NotificationDelete.js +43 -43
  17. package/dist/api/notifications-api/models/NotificationPatch.d.ts +32 -32
  18. package/dist/api/notifications-api/models/NotificationPatch.js +44 -44
  19. package/dist/api/notifications-api/models/NotificationRequest.d.ts +73 -73
  20. package/dist/api/notifications-api/models/NotificationRequest.js +61 -61
  21. package/dist/api/notifications-api/models/PaginatedResponse.d.ts +61 -61
  22. package/dist/api/notifications-api/models/PaginatedResponse.js +54 -54
  23. package/dist/api/notifications-api/models/Status.d.ts +23 -23
  24. package/dist/api/notifications-api/models/Status.js +30 -30
  25. package/dist/api/notifications-api/models/index.d.ts +8 -8
  26. package/dist/api/notifications-api/models/index.js +10 -10
  27. package/dist/api/notifications-api/runtime.d.ts +182 -182
  28. package/dist/api/notifications-api/runtime.js +318 -318
  29. package/dist/components/notifications/confirmation-dialog.d.ts +10 -10
  30. package/dist/components/notifications/confirmation-dialog.js +42 -42
  31. package/dist/components/notifications/date-filters.d.ts +19 -19
  32. package/dist/components/notifications/date-filters.js +90 -90
  33. package/dist/components/notifications/group-filters.d.ts +8 -8
  34. package/dist/components/notifications/group-filters.js +35 -35
  35. package/dist/components/notifications/grouped-item.d.ts +13 -13
  36. package/dist/components/notifications/grouped-item.js +56 -56
  37. package/dist/components/notifications/notification-item.d.ts +18 -18
  38. package/dist/components/notifications/notification-item.js +95 -95
  39. package/dist/components/notifications/view-item-dialog.d.ts +12 -12
  40. package/dist/components/notifications/view-item-dialog.js +61 -61
  41. package/dist/constants/api-constants.d.ts +3 -3
  42. package/dist/constants/api-constants.js +3 -3
  43. package/dist/constants/notification-types.d.ts +15 -15
  44. package/dist/constants/notification-types.js +1 -1
  45. package/dist/constants/notifications.d.ts +15 -15
  46. package/dist/constants/notifications.js +18 -18
  47. package/dist/helper/errors.d.ts +1 -1
  48. package/dist/helper/errors.js +19 -19
  49. package/dist/index.d.ts +1 -1
  50. package/dist/index.js +1 -1
  51. package/dist/ix-notifications.d.ts +1 -1
  52. package/dist/ix-notifications.js +2 -2
  53. package/dist/models/notification.d.ts +13 -13
  54. package/dist/models/notification.js +1 -1
  55. package/dist/services/api-client.d.ts +13 -13
  56. package/dist/services/api-client.js +23 -23
  57. package/dist/services/app-service.d.ts +1 -1
  58. package/dist/services/app-service.js +6 -6
  59. package/dist/services/notifications-service.d.ts +10 -10
  60. package/dist/services/notifications-service.js +55 -55
  61. package/dist/state/NotificationState.d.ts +28 -28
  62. package/dist/state/NotificationState.js +153 -153
  63. package/dist/styles/notifications-style.d.ts +1 -1
  64. package/dist/styles/notifications-style.js +2 -2
  65. package/dist/tw.d.ts +1 -1
  66. package/dist/tw.js +2 -2
  67. package/package.json +3 -2
@@ -1,55 +1,55 @@
1
- /* tslint:disable */
2
- /* eslint-disable */
3
- /**
4
- * Notifications API
5
- * An API to create and read notifications
6
- *
7
- * The version of the OpenAPI document: 1.0.0
8
- * Contact: DevTeamProduct@digitalrealty.com
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
- import { exists } from '../runtime';
15
- /**
16
- * Check if a given object implements the PaginatedResponse interface.
17
- */
18
- export function instanceOfPaginatedResponse(value) {
19
- let isInstance = true;
20
- isInstance = isInstance && "items" in value;
21
- return isInstance;
22
- }
23
- export function PaginatedResponseFromJSON(json) {
24
- return PaginatedResponseFromJSONTyped(json, false);
25
- }
26
- export function PaginatedResponseFromJSONTyped(json, ignoreDiscriminator) {
27
- if ((json === undefined) || (json === null)) {
28
- return json;
29
- }
30
- return {
31
- 'self': !exists(json, 'self') ? undefined : json['self'],
32
- 'first': !exists(json, 'first') ? undefined : json['first'],
33
- 'prev': !exists(json, 'prev') ? undefined : json['prev'],
34
- 'next': !exists(json, 'next') ? undefined : json['next'],
35
- 'last': !exists(json, 'last') ? undefined : json['last'],
36
- 'items': json['items'],
37
- };
38
- }
39
- export function PaginatedResponseToJSON(value) {
40
- if (value === undefined) {
41
- return undefined;
42
- }
43
- if (value === null) {
44
- return null;
45
- }
46
- return {
47
- 'self': value.self,
48
- 'first': value.first,
49
- 'prev': value.prev,
50
- 'next': value.next,
51
- 'last': value.last,
52
- 'items': value.items,
53
- };
54
- }
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Notifications API
5
+ * An API to create and read notifications
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ * Contact: DevTeamProduct@digitalrealty.com
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
+ import { exists } from '../runtime';
15
+ /**
16
+ * Check if a given object implements the PaginatedResponse interface.
17
+ */
18
+ export function instanceOfPaginatedResponse(value) {
19
+ let isInstance = true;
20
+ isInstance = isInstance && "items" in value;
21
+ return isInstance;
22
+ }
23
+ export function PaginatedResponseFromJSON(json) {
24
+ return PaginatedResponseFromJSONTyped(json, false);
25
+ }
26
+ export function PaginatedResponseFromJSONTyped(json, ignoreDiscriminator) {
27
+ if ((json === undefined) || (json === null)) {
28
+ return json;
29
+ }
30
+ return {
31
+ 'self': !exists(json, 'self') ? undefined : json['self'],
32
+ 'first': !exists(json, 'first') ? undefined : json['first'],
33
+ 'prev': !exists(json, 'prev') ? undefined : json['prev'],
34
+ 'next': !exists(json, 'next') ? undefined : json['next'],
35
+ 'last': !exists(json, 'last') ? undefined : json['last'],
36
+ 'items': json['items'],
37
+ };
38
+ }
39
+ export function PaginatedResponseToJSON(value) {
40
+ if (value === undefined) {
41
+ return undefined;
42
+ }
43
+ if (value === null) {
44
+ return null;
45
+ }
46
+ return {
47
+ 'self': value.self,
48
+ 'first': value.first,
49
+ 'prev': value.prev,
50
+ 'next': value.next,
51
+ 'last': value.last,
52
+ 'items': value.items,
53
+ };
54
+ }
55
55
  //# sourceMappingURL=PaginatedResponse.js.map
@@ -1,23 +1,23 @@
1
- /**
2
- * Notifications API
3
- * An API to create and read notifications
4
- *
5
- * The version of the OpenAPI document: 1.0.0
6
- * Contact: DevTeamProduct@digitalrealty.com
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
- * Status of the notification
14
- * @export
15
- */
16
- export declare const Status: {
17
- readonly Unread: "unread";
18
- readonly Read: "read";
19
- };
20
- export type Status = typeof Status[keyof typeof Status];
21
- export declare function StatusFromJSON(json: any): Status;
22
- export declare function StatusFromJSONTyped(json: any, ignoreDiscriminator: boolean): Status;
23
- export declare function StatusToJSON(value?: Status | null): any;
1
+ /**
2
+ * Notifications API
3
+ * An API to create and read notifications
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ * Contact: DevTeamProduct@digitalrealty.com
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
+ * Status of the notification
14
+ * @export
15
+ */
16
+ export declare const Status: {
17
+ readonly Unread: "unread";
18
+ readonly Read: "read";
19
+ };
20
+ export type Status = typeof Status[keyof typeof Status];
21
+ export declare function StatusFromJSON(json: any): Status;
22
+ export declare function StatusFromJSONTyped(json: any, ignoreDiscriminator: boolean): Status;
23
+ export declare function StatusToJSON(value?: Status | null): any;
@@ -1,31 +1,31 @@
1
- /* tslint:disable */
2
- /* eslint-disable */
3
- /**
4
- * Notifications API
5
- * An API to create and read notifications
6
- *
7
- * The version of the OpenAPI document: 1.0.0
8
- * Contact: DevTeamProduct@digitalrealty.com
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
- /**
15
- * Status of the notification
16
- * @export
17
- */
18
- export const Status = {
19
- Unread: 'unread',
20
- Read: 'read'
21
- };
22
- export function StatusFromJSON(json) {
23
- return StatusFromJSONTyped(json, false);
24
- }
25
- export function StatusFromJSONTyped(json, ignoreDiscriminator) {
26
- return json;
27
- }
28
- export function StatusToJSON(value) {
29
- return value;
30
- }
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Notifications API
5
+ * An API to create and read notifications
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ * Contact: DevTeamProduct@digitalrealty.com
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
+ /**
15
+ * Status of the notification
16
+ * @export
17
+ */
18
+ export const Status = {
19
+ Unread: 'unread',
20
+ Read: 'read'
21
+ };
22
+ export function StatusFromJSON(json) {
23
+ return StatusFromJSONTyped(json, false);
24
+ }
25
+ export function StatusFromJSONTyped(json, ignoreDiscriminator) {
26
+ return json;
27
+ }
28
+ export function StatusToJSON(value) {
29
+ return value;
30
+ }
31
31
  //# sourceMappingURL=Status.js.map
@@ -1,8 +1,8 @@
1
- export * from './ErrorResponse';
2
- export * from './GetNotifications200Response';
3
- export * from './Notification';
4
- export * from './NotificationDelete';
5
- export * from './NotificationPatch';
6
- export * from './NotificationRequest';
7
- export * from './PaginatedResponse';
8
- export * from './Status';
1
+ export * from './ErrorResponse';
2
+ export * from './GetNotifications200Response';
3
+ export * from './Notification';
4
+ export * from './NotificationDelete';
5
+ export * from './NotificationPatch';
6
+ export * from './NotificationRequest';
7
+ export * from './PaginatedResponse';
8
+ export * from './Status';
@@ -1,11 +1,11 @@
1
- /* tslint:disable */
2
- /* eslint-disable */
3
- export * from './ErrorResponse';
4
- export * from './GetNotifications200Response';
5
- export * from './Notification';
6
- export * from './NotificationDelete';
7
- export * from './NotificationPatch';
8
- export * from './NotificationRequest';
9
- export * from './PaginatedResponse';
10
- export * from './Status';
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ export * from './ErrorResponse';
4
+ export * from './GetNotifications200Response';
5
+ export * from './Notification';
6
+ export * from './NotificationDelete';
7
+ export * from './NotificationPatch';
8
+ export * from './NotificationRequest';
9
+ export * from './PaginatedResponse';
10
+ export * from './Status';
11
11
  //# sourceMappingURL=index.js.map
@@ -1,182 +1,182 @@
1
- /**
2
- * Notifications API
3
- * An API to create and read notifications
4
- *
5
- * The version of the OpenAPI document: 1.0.0
6
- * Contact: DevTeamProduct@digitalrealty.com
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 | ((name: string) => 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) | 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 exists(json: any, key: string): boolean;
126
- export declare function querystring(params: HTTPQuery, prefix?: string): string;
127
- export declare function mapValues(data: any, fn: (item: any) => any): {};
128
- export declare function canConsumeForm(consumes: Consume[]): boolean;
129
- export interface Consume {
130
- contentType: string;
131
- }
132
- export interface RequestContext {
133
- fetch: FetchAPI;
134
- url: string;
135
- init: RequestInit;
136
- }
137
- export interface ResponseContext {
138
- fetch: FetchAPI;
139
- url: string;
140
- init: RequestInit;
141
- response: Response;
142
- }
143
- export interface ErrorContext {
144
- fetch: FetchAPI;
145
- url: string;
146
- init: RequestInit;
147
- error: unknown;
148
- response?: Response;
149
- }
150
- export interface Middleware {
151
- pre?(context: RequestContext): Promise<FetchParams | void>;
152
- post?(context: ResponseContext): Promise<Response | void>;
153
- onError?(context: ErrorContext): Promise<Response | void>;
154
- }
155
- export interface ApiResponse<T> {
156
- raw: Response;
157
- value(): Promise<T>;
158
- }
159
- export interface ResponseTransformer<T> {
160
- (json: any): T;
161
- }
162
- export declare class JSONApiResponse<T> {
163
- raw: Response;
164
- private transformer;
165
- constructor(raw: Response, transformer?: ResponseTransformer<T>);
166
- value(): Promise<T>;
167
- }
168
- export declare class VoidApiResponse {
169
- raw: Response;
170
- constructor(raw: Response);
171
- value(): Promise<void>;
172
- }
173
- export declare class BlobApiResponse {
174
- raw: Response;
175
- constructor(raw: Response);
176
- value(): Promise<Blob>;
177
- }
178
- export declare class TextApiResponse {
179
- raw: Response;
180
- constructor(raw: Response);
181
- value(): Promise<string>;
182
- }
1
+ /**
2
+ * Notifications API
3
+ * An API to create and read notifications
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ * Contact: DevTeamProduct@digitalrealty.com
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 | ((name: string) => 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) | 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 exists(json: any, key: string): boolean;
126
+ export declare function querystring(params: HTTPQuery, prefix?: string): string;
127
+ export declare function mapValues(data: any, fn: (item: any) => any): {};
128
+ export declare function canConsumeForm(consumes: Consume[]): boolean;
129
+ export interface Consume {
130
+ contentType: string;
131
+ }
132
+ export interface RequestContext {
133
+ fetch: FetchAPI;
134
+ url: string;
135
+ init: RequestInit;
136
+ }
137
+ export interface ResponseContext {
138
+ fetch: FetchAPI;
139
+ url: string;
140
+ init: RequestInit;
141
+ response: Response;
142
+ }
143
+ export interface ErrorContext {
144
+ fetch: FetchAPI;
145
+ url: string;
146
+ init: RequestInit;
147
+ error: unknown;
148
+ response?: Response;
149
+ }
150
+ export interface Middleware {
151
+ pre?(context: RequestContext): Promise<FetchParams | void>;
152
+ post?(context: ResponseContext): Promise<Response | void>;
153
+ onError?(context: ErrorContext): Promise<Response | void>;
154
+ }
155
+ export interface ApiResponse<T> {
156
+ raw: Response;
157
+ value(): Promise<T>;
158
+ }
159
+ export interface ResponseTransformer<T> {
160
+ (json: any): T;
161
+ }
162
+ export declare class JSONApiResponse<T> {
163
+ raw: Response;
164
+ private transformer;
165
+ constructor(raw: Response, transformer?: ResponseTransformer<T>);
166
+ value(): Promise<T>;
167
+ }
168
+ export declare class VoidApiResponse {
169
+ raw: Response;
170
+ constructor(raw: Response);
171
+ value(): Promise<void>;
172
+ }
173
+ export declare class BlobApiResponse {
174
+ raw: Response;
175
+ constructor(raw: Response);
176
+ value(): Promise<Blob>;
177
+ }
178
+ export declare class TextApiResponse {
179
+ raw: Response;
180
+ constructor(raw: Response);
181
+ value(): Promise<string>;
182
+ }