mobx-tanstack-query-api 0.16.0 → 0.17.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.
Files changed (169) hide show
  1. package/builtin/index.cjs +26 -0
  2. package/builtin/index.d.cts +5 -0
  3. package/builtin/index.d.cts.map +1 -0
  4. package/builtin/index.d.ts +2 -2
  5. package/builtin/index.d.ts.map +1 -1
  6. package/builtin/index.js +2 -2
  7. package/cli/bin.cjs +17 -0
  8. package/cli/bin.d.cts +2 -0
  9. package/cli/bin.d.cts.map +1 -0
  10. package/cli/bin.js +4 -4
  11. package/cli/index.cjs +18 -0
  12. package/cli/index.d.cts +3 -0
  13. package/cli/index.d.cts.map +1 -0
  14. package/cli/index.d.ts +2 -1
  15. package/cli/index.d.ts.map +1 -1
  16. package/cli/index.js +2 -1
  17. package/cli/utils/define-config.cjs +9 -0
  18. package/cli/utils/define-config.d.cts +4 -0
  19. package/cli/utils/define-config.d.cts.map +1 -0
  20. package/cli/utils/define-config.d.ts +1 -1
  21. package/cli/utils/define-config.d.ts.map +1 -1
  22. package/cli/utils/exec-config-path.cjs +16 -0
  23. package/cli/utils/exec-config-path.d.cts +2 -0
  24. package/cli/utils/exec-config-path.d.cts.map +1 -0
  25. package/cli/utils/resolve-config-path.cjs +65 -0
  26. package/cli/utils/resolve-config-path.d.cts +3 -0
  27. package/cli/utils/resolve-config-path.d.cts.map +1 -0
  28. package/codegen/index.cjs +488 -0
  29. package/codegen/index.d.cts +167 -0
  30. package/codegen/index.d.cts.map +1 -0
  31. package/codegen/index.d.ts +1 -1
  32. package/codegen/index.d.ts.map +1 -1
  33. package/codegen/index.js +9 -9
  34. package/codegen/templates/all-endpoints-per-file.tmpl.cjs +99 -0
  35. package/codegen/templates/all-endpoints-per-file.tmpl.d.cts +18 -0
  36. package/codegen/templates/all-endpoints-per-file.tmpl.d.cts.map +1 -0
  37. package/codegen/templates/all-endpoints-per-file.tmpl.d.ts +1 -1
  38. package/codegen/templates/all-endpoints-per-file.tmpl.d.ts.map +1 -1
  39. package/codegen/templates/all-endpoints-per-file.tmpl.js +4 -4
  40. package/codegen/templates/all-exports.tmpl.cjs +14 -0
  41. package/codegen/templates/all-exports.tmpl.d.cts +11 -0
  42. package/codegen/templates/all-exports.tmpl.d.cts.map +1 -0
  43. package/codegen/templates/all-exports.tmpl.d.ts +1 -1
  44. package/codegen/templates/all-exports.tmpl.d.ts.map +1 -1
  45. package/codegen/templates/all-exports.tmpl.js +1 -1
  46. package/codegen/templates/constants.cjs +5 -0
  47. package/codegen/templates/constants.d.cts +2 -0
  48. package/codegen/templates/constants.d.cts.map +1 -0
  49. package/codegen/templates/data-contract.tmpl.cjs +49 -0
  50. package/codegen/templates/data-contract.tmpl.d.cts +8 -0
  51. package/codegen/templates/data-contract.tmpl.d.cts.map +1 -0
  52. package/codegen/templates/data-contracts-file.tmpl.cjs +27 -0
  53. package/codegen/templates/data-contracts-file.tmpl.d.cts +10 -0
  54. package/codegen/templates/data-contracts-file.tmpl.d.cts.map +1 -0
  55. package/codegen/templates/data-contracts-file.tmpl.d.ts +1 -1
  56. package/codegen/templates/data-contracts-file.tmpl.d.ts.map +1 -1
  57. package/codegen/templates/data-contracts-file.tmpl.js +2 -2
  58. package/codegen/templates/endpoint-jsdoc.tmpl.cjs +110 -0
  59. package/codegen/templates/endpoint-jsdoc.tmpl.d.cts +10 -0
  60. package/codegen/templates/endpoint-jsdoc.tmpl.d.cts.map +1 -0
  61. package/codegen/templates/endpoint-jsdoc.tmpl.d.ts +1 -1
  62. package/codegen/templates/endpoint-jsdoc.tmpl.d.ts.map +1 -1
  63. package/codegen/templates/endpoint-per-file.tmpl.cjs +90 -0
  64. package/codegen/templates/endpoint-per-file.tmpl.d.cts +18 -0
  65. package/codegen/templates/endpoint-per-file.tmpl.d.cts.map +1 -0
  66. package/codegen/templates/endpoint-per-file.tmpl.d.ts +1 -1
  67. package/codegen/templates/endpoint-per-file.tmpl.d.ts.map +1 -1
  68. package/codegen/templates/endpoint-per-file.tmpl.js +4 -4
  69. package/codegen/templates/index-ts-for-endpoint-per-file.tmpl.cjs +10 -0
  70. package/codegen/templates/index-ts-for-endpoint-per-file.tmpl.d.cts +10 -0
  71. package/codegen/templates/index-ts-for-endpoint-per-file.tmpl.d.cts.map +1 -0
  72. package/codegen/templates/index-ts-for-endpoint-per-file.tmpl.d.ts +1 -1
  73. package/codegen/templates/index-ts-for-endpoint-per-file.tmpl.d.ts.map +1 -1
  74. package/codegen/templates/index-ts-for-endpoint-per-file.tmpl.js +1 -1
  75. package/codegen/templates/meta-info.tmpl.cjs +48 -0
  76. package/codegen/templates/meta-info.tmpl.d.cts +12 -0
  77. package/codegen/templates/meta-info.tmpl.d.cts.map +1 -0
  78. package/codegen/templates/meta-info.tmpl.d.ts +1 -1
  79. package/codegen/templates/meta-info.tmpl.d.ts.map +1 -1
  80. package/codegen/templates/meta-info.tmpl.js +1 -1
  81. package/codegen/templates/new-endpoint.tmpl.cjs +178 -0
  82. package/codegen/templates/new-endpoint.tmpl.d.cts +21 -0
  83. package/codegen/templates/new-endpoint.tmpl.d.cts.map +1 -0
  84. package/codegen/templates/new-endpoint.tmpl.d.ts +1 -1
  85. package/codegen/templates/new-endpoint.tmpl.d.ts.map +1 -1
  86. package/codegen/templates/new-endpoint.tmpl.js +1 -1
  87. package/codegen/utils/remove-unused-types.cjs +117 -0
  88. package/codegen/utils/remove-unused-types.d.cts +7 -0
  89. package/codegen/utils/remove-unused-types.d.cts.map +1 -0
  90. package/codegen/utils/remove-unused-types.d.ts +1 -1
  91. package/codegen/utils/remove-unused-types.d.ts.map +1 -1
  92. package/codegen/utils/remove-unused-types.js +1 -1
  93. package/codegen/utils/unpack-filter-option.cjs +20 -0
  94. package/codegen/utils/unpack-filter-option.d.cts +4 -0
  95. package/codegen/utils/unpack-filter-option.d.cts.map +1 -0
  96. package/codegen/utils/unpack-filter-option.d.ts +1 -1
  97. package/codegen/utils/unpack-filter-option.d.ts.map +1 -1
  98. package/index.cjs +18 -0
  99. package/index.d.cts +3 -0
  100. package/index.d.cts.map +1 -0
  101. package/index.d.ts +1 -1
  102. package/index.d.ts.map +1 -1
  103. package/index.js +1 -1
  104. package/package.json +29 -147
  105. package/runtime/endpoint-infinite-query.cjs +101 -0
  106. package/runtime/endpoint-infinite-query.d.cts +17 -0
  107. package/runtime/endpoint-infinite-query.d.cts.map +1 -0
  108. package/runtime/endpoint-infinite-query.d.ts +3 -3
  109. package/runtime/endpoint-infinite-query.d.ts.map +1 -1
  110. package/runtime/endpoint-infinite-query.js +1 -1
  111. package/runtime/endpoint-infinite-query.types.cjs +2 -0
  112. package/runtime/endpoint-infinite-query.types.d.cts +30 -0
  113. package/runtime/endpoint-infinite-query.types.d.cts.map +1 -0
  114. package/runtime/endpoint-infinite-query.types.d.ts +2 -2
  115. package/runtime/endpoint-infinite-query.types.d.ts.map +1 -1
  116. package/runtime/endpoint-mutation.cjs +73 -0
  117. package/runtime/endpoint-mutation.d.cts +13 -0
  118. package/runtime/endpoint-mutation.d.cts.map +1 -0
  119. package/runtime/endpoint-mutation.d.ts +3 -3
  120. package/runtime/endpoint-mutation.d.ts.map +1 -1
  121. package/runtime/endpoint-mutation.types.cjs +2 -0
  122. package/runtime/endpoint-mutation.types.d.cts +30 -0
  123. package/runtime/endpoint-mutation.types.d.cts.map +1 -0
  124. package/runtime/endpoint-mutation.types.d.ts +2 -2
  125. package/runtime/endpoint-mutation.types.d.ts.map +1 -1
  126. package/runtime/endpoint-query-client.cjs +79 -0
  127. package/runtime/endpoint-query-client.d.cts +13 -0
  128. package/runtime/endpoint-query-client.d.cts.map +1 -0
  129. package/runtime/endpoint-query-client.d.ts +1 -1
  130. package/runtime/endpoint-query-client.d.ts.map +1 -1
  131. package/runtime/endpoint-query-client.types.cjs +2 -0
  132. package/runtime/endpoint-query-client.types.d.cts +16 -0
  133. package/runtime/endpoint-query-client.types.d.cts.map +1 -0
  134. package/runtime/endpoint-query-client.types.d.ts +2 -2
  135. package/runtime/endpoint-query-client.types.d.ts.map +1 -1
  136. package/runtime/endpoint-query.cjs +213 -0
  137. package/runtime/endpoint-query.d.cts +29 -0
  138. package/runtime/endpoint-query.d.cts.map +1 -0
  139. package/runtime/endpoint-query.d.ts +3 -3
  140. package/runtime/endpoint-query.d.ts.map +1 -1
  141. package/runtime/endpoint-query.types.cjs +2 -0
  142. package/runtime/endpoint-query.types.d.cts +37 -0
  143. package/runtime/endpoint-query.types.d.cts.map +1 -0
  144. package/runtime/endpoint-query.types.d.ts +1 -1
  145. package/runtime/endpoint-query.types.d.ts.map +1 -1
  146. package/runtime/endpoint.cjs +128 -0
  147. package/runtime/endpoint.d.cts +69 -0
  148. package/runtime/endpoint.d.cts.map +1 -0
  149. package/runtime/endpoint.d.ts +9 -9
  150. package/runtime/endpoint.d.ts.map +1 -1
  151. package/runtime/endpoint.js +3 -3
  152. package/runtime/endpoint.types.cjs +2 -0
  153. package/runtime/endpoint.types.d.cts +23 -0
  154. package/runtime/endpoint.types.d.cts.map +1 -0
  155. package/runtime/endpoint.types.d.ts +3 -3
  156. package/runtime/endpoint.types.d.ts.map +1 -1
  157. package/runtime/http-client.cjs +208 -0
  158. package/runtime/http-client.d.cts +85 -0
  159. package/runtime/http-client.d.cts.map +1 -0
  160. package/runtime/index.cjs +25 -0
  161. package/runtime/index.d.cts +10 -0
  162. package/runtime/index.d.cts.map +1 -0
  163. package/runtime/index.d.ts +9 -9
  164. package/runtime/index.d.ts.map +1 -1
  165. package/runtime/index.js +9 -9
  166. package/assets/gh-repo-template.pxz +0 -0
  167. package/assets/logo.png +0 -0
  168. package/assets/logo.pxz +0 -0
  169. package/cli/bin.mjs +0 -15
@@ -0,0 +1,128 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Endpoint = void 0;
4
+ const common_1 = require("yummies/common");
5
+ const endpoint_infinite_query_js_1 = require("./endpoint-infinite-query.cjs");
6
+ const endpoint_mutation_js_1 = require("./endpoint-mutation.cjs");
7
+ const endpoint_query_js_1 = require("./endpoint-query.cjs");
8
+ /**
9
+ * This class is a wrapper for your http request.
10
+ *
11
+ * [**Documentation**](https://js2me.github.io/mobx-tanstack-query-api/endpoints/)
12
+ */
13
+ class Endpoint {
14
+ configuration;
15
+ queryClient;
16
+ httpClient;
17
+ endpointId;
18
+ presets = {
19
+ mutations: {},
20
+ };
21
+ __params;
22
+ __response;
23
+ meta;
24
+ constructor(configuration, queryClient, httpClient) {
25
+ this.configuration = configuration;
26
+ this.queryClient = queryClient;
27
+ this.httpClient = httpClient;
28
+ this.endpointId = globalThis.crypto.randomUUID();
29
+ this.meta = configuration.meta ?? {};
30
+ // Сохраняем оригинальный инстанс
31
+ const instance = this;
32
+ // Создаем функцию-обертку
33
+ const callable = function (...args) {
34
+ return instance.request.apply(instance, args);
35
+ };
36
+ // Копируем прототип
37
+ Object.setPrototypeOf(callable, new.target.prototype);
38
+ // Копируем методы из оригинального инстанса
39
+ Object.getOwnPropertyNames(instance)
40
+ .concat(Object.getOwnPropertyNames(new.target.prototype))
41
+ .forEach((key) => {
42
+ if (key === 'constructor')
43
+ return;
44
+ const desc = Object.getOwnPropertyDescriptor(instance, key) ||
45
+ Object.getOwnPropertyDescriptor(new.target.prototype, key);
46
+ if (desc)
47
+ Object.defineProperty(callable, key, desc);
48
+ });
49
+ // biome-ignore lint/correctness/noConstructorReturn: this is special trick to add typings for callable class instance
50
+ return callable;
51
+ }
52
+ getFullUrl(...args) {
53
+ const params = this.configuration.params(args[0] ?? {});
54
+ return this.httpClient.buildUrl(params);
55
+ }
56
+ getPath(...args) {
57
+ const params = this.configuration.params(args[0] ?? {});
58
+ return params.path;
59
+ }
60
+ get tags() {
61
+ return this.configuration.tags;
62
+ }
63
+ get path() {
64
+ return this.configuration.path;
65
+ }
66
+ get pathDeclaration() {
67
+ return this.path.join('/');
68
+ }
69
+ get operationId() {
70
+ return this.configuration.operationId;
71
+ }
72
+ get group() {
73
+ return this.configuration.group;
74
+ }
75
+ get namespace() {
76
+ return this.configuration.namespace;
77
+ }
78
+ request(...args) {
79
+ return this.httpClient.request(this.configuration.params(args[0] ?? {}));
80
+ }
81
+ toQueryMeta = (meta) => ({
82
+ ...meta,
83
+ tags: this.tags,
84
+ operationId: this.operationId,
85
+ path: this.path,
86
+ pathDeclaration: this.pathDeclaration,
87
+ endpointId: this.endpointId,
88
+ endpointQuery: true,
89
+ });
90
+ toQueryKey(params, uniqKey) {
91
+ return [
92
+ ...this.configuration.path,
93
+ this.configuration.operationId,
94
+ params ?? {},
95
+ (0, common_1.callFunction)(uniqKey),
96
+ ];
97
+ }
98
+ toInfiniteQueryKey(params, uniqKey) {
99
+ return [
100
+ { infiniteQuery: true },
101
+ ...this.configuration.path,
102
+ this.configuration.operationId,
103
+ params ?? {},
104
+ (0, common_1.callFunction)(uniqKey),
105
+ ];
106
+ }
107
+ invalidateQuery(...args) {
108
+ this.queryClient.invalidateQueries({
109
+ queryKey: this.toQueryKey(args[0], args[1]?.uniqKey),
110
+ exact: true,
111
+ ...args[1],
112
+ }, args[2]);
113
+ }
114
+ toMutation(options) {
115
+ return new endpoint_mutation_js_1.EndpointMutation(this, this.queryClient, {
116
+ ...options,
117
+ invalidateEndpoints: options.invalidateEndpoints ??
118
+ this.presets.mutations?.invalidateQueries,
119
+ });
120
+ }
121
+ toQuery(options) {
122
+ return new endpoint_query_js_1.EndpointQuery(this, this.queryClient, options);
123
+ }
124
+ toInfiniteQuery(options) {
125
+ return new endpoint_infinite_query_js_1.EndpointInfiniteQuery(this, this.queryClient, options);
126
+ }
127
+ }
128
+ exports.Endpoint = Endpoint;
@@ -0,0 +1,69 @@
1
+ /** biome-ignore-all lint/style/useShorthandFunctionType: this is special trick to add typings for callable class instance */
2
+ import type { DefaultError, InvalidateOptions, InvalidateQueryFilters } from '@tanstack/query-core';
3
+ import type { AnyObject, IsPartial, Maybe } from 'yummies/utils/types';
4
+ import type { EndpointConfiguration, EndpointMutationPresets } from "./endpoint.types.cjs";
5
+ import { EndpointInfiniteQuery } from "./endpoint-infinite-query.cjs";
6
+ import type { EndpointInfiniteQueryFlattenOptions, EndpointInfiniteQueryOptions } from "./endpoint-infinite-query.types.cjs";
7
+ import { EndpointMutation } from "./endpoint-mutation.cjs";
8
+ import type { EndpointMutationOptions } from "./endpoint-mutation.types.cjs";
9
+ import { EndpointQuery } from "./endpoint-query.cjs";
10
+ import type { EndpointQueryFlattenOptions, EndpointQueryOptions, EndpointQueryUniqKey } from "./endpoint-query.types.cjs";
11
+ import type { EndpointQueryClient } from "./endpoint-query-client.cjs";
12
+ import type { HttpClient, HttpResponse } from "./http-client.cjs";
13
+ export interface Endpoint<TResponse extends HttpResponse<any, any>, TParams extends AnyObject, TMetaData extends AnyObject = AnyObject> {
14
+ (...args: IsPartial<TParams> extends true ? [params?: Maybe<TParams>] : [params: TParams]): ReturnType<Endpoint<TResponse, TParams, TMetaData>['request']>;
15
+ }
16
+ /**
17
+ * This class is a wrapper for your http request.
18
+ *
19
+ * [**Documentation**](https://js2me.github.io/mobx-tanstack-query-api/endpoints/)
20
+ */
21
+ export declare class Endpoint<TResponse extends HttpResponse<any, any>, TParams extends AnyObject, TMetaData extends AnyObject = AnyObject> {
22
+ configuration: EndpointConfiguration<NoInfer<TParams>, TMetaData>;
23
+ queryClient: EndpointQueryClient;
24
+ httpClient: HttpClient;
25
+ endpointId: string;
26
+ presets: {
27
+ mutations: EndpointMutationPresets;
28
+ };
29
+ __params: TParams;
30
+ __response: TResponse;
31
+ meta: TMetaData;
32
+ constructor(configuration: EndpointConfiguration<NoInfer<TParams>, TMetaData>, queryClient: EndpointQueryClient, httpClient: HttpClient);
33
+ getFullUrl(...args: IsPartial<TParams> extends true ? [params?: Maybe<TParams>] : [params: TParams]): string;
34
+ getPath(...args: IsPartial<TParams> extends true ? [params?: Maybe<TParams>] : [params: TParams]): string;
35
+ get tags(): string[];
36
+ get path(): string[];
37
+ get pathDeclaration(): string;
38
+ get operationId(): string;
39
+ get group(): string | undefined;
40
+ get namespace(): string | undefined;
41
+ request(...args: IsPartial<TParams> extends true ? [params?: Maybe<TParams>] : [params: TParams]): Promise<TResponse>;
42
+ toQueryMeta: (meta?: AnyObject) => {
43
+ tags: string[];
44
+ operationId: string;
45
+ path: string[];
46
+ pathDeclaration: string;
47
+ endpointId: string;
48
+ endpointQuery: true;
49
+ };
50
+ toQueryKey(params?: Maybe<TParams>, uniqKey?: EndpointQueryUniqKey): any;
51
+ toInfiniteQueryKey(params?: Maybe<TParams>, uniqKey?: EndpointQueryUniqKey): any;
52
+ invalidateQuery(...args: IsPartial<TParams> extends true ? [
53
+ params?: Maybe<TParams>,
54
+ filters?: InvalidateQueryFilters & {
55
+ uniqKey?: EndpointQueryUniqKey;
56
+ },
57
+ options?: InvalidateOptions
58
+ ] : [
59
+ params: TParams,
60
+ filters?: InvalidateQueryFilters & {
61
+ uniqKey?: EndpointQueryUniqKey;
62
+ },
63
+ options?: InvalidateOptions
64
+ ]): void;
65
+ toMutation<TData = TResponse['data'], TMutationMeta extends AnyObject | void = void, TContext = unknown>(options: EndpointMutationOptions<this, TData, TParams, TMutationMeta, TContext>): EndpointMutation<this, TData, TParams, TMutationMeta, TContext>;
66
+ toQuery<TQueryFnData = TResponse['data'], TError = DefaultError, TData = TQueryFnData, TQueryData = TQueryFnData>(options: EndpointQueryOptions<this, TQueryFnData, TError, TData, TQueryData> | (() => EndpointQueryFlattenOptions<this, TQueryFnData, TError, TData, TQueryData>)): EndpointQuery<this, TQueryFnData, TError, TData, TQueryData>;
67
+ toInfiniteQuery<TData = TResponse['data'], TError = DefaultError, TPageParam = unknown>(options: EndpointInfiniteQueryOptions<this, TData, TError, TPageParam> | (() => EndpointInfiniteQueryFlattenOptions<this, TData, TError, TPageParam>)): EndpointInfiniteQuery<this, TData, TError, TPageParam, import("@tanstack/query-core").InfiniteData<TData, TPageParam>>;
68
+ }
69
+ //# sourceMappingURL=endpoint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"endpoint.d.ts","sourceRoot":"","sources":["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M,EAAE,UAAU,CAAC,GAC7D,CAAC,MAAM,mCAAmC,CACxC,IAAI,EACJ,KAAK,EACL,MAAM,EACN,UAAU,CACX,CAAC;CAQT"}
@@ -1,15 +1,15 @@
1
1
  /** biome-ignore-all lint/style/useShorthandFunctionType: this is special trick to add typings for callable class instance */
2
2
  import type { DefaultError, InvalidateOptions, InvalidateQueryFilters } from '@tanstack/query-core';
3
3
  import type { AnyObject, IsPartial, Maybe } from 'yummies/utils/types';
4
- import type { EndpointConfiguration, EndpointMutationPresets } from './endpoint.types.js';
5
- import { EndpointInfiniteQuery } from './endpoint-infinite-query.js';
6
- import type { EndpointInfiniteQueryFlattenOptions, EndpointInfiniteQueryOptions } from './endpoint-infinite-query.types.js';
7
- import { EndpointMutation } from './endpoint-mutation.js';
8
- import type { EndpointMutationOptions } from './endpoint-mutation.types.js';
9
- import { EndpointQuery } from './endpoint-query.js';
10
- import type { EndpointQueryFlattenOptions, EndpointQueryOptions, EndpointQueryUniqKey } from './endpoint-query.types.js';
11
- import type { EndpointQueryClient } from './endpoint-query-client.js';
12
- import type { HttpClient, HttpResponse } from './http-client.js';
4
+ import type { EndpointConfiguration, EndpointMutationPresets } from "./endpoint.types.js";
5
+ import { EndpointInfiniteQuery } from "./endpoint-infinite-query.js";
6
+ import type { EndpointInfiniteQueryFlattenOptions, EndpointInfiniteQueryOptions } from "./endpoint-infinite-query.types.js";
7
+ import { EndpointMutation } from "./endpoint-mutation.js";
8
+ import type { EndpointMutationOptions } from "./endpoint-mutation.types.js";
9
+ import { EndpointQuery } from "./endpoint-query.js";
10
+ import type { EndpointQueryFlattenOptions, EndpointQueryOptions, EndpointQueryUniqKey } from "./endpoint-query.types.js";
11
+ import type { EndpointQueryClient } from "./endpoint-query-client.js";
12
+ import type { HttpClient, HttpResponse } from "./http-client.js";
13
13
  export interface Endpoint<TResponse extends HttpResponse<any, any>, TParams extends AnyObject, TMetaData extends AnyObject = AnyObject> {
14
14
  (...args: IsPartial<TParams> extends true ? [params?: Maybe<TParams>] : [params: TParams]): ReturnType<Endpoint<TResponse, TParams, TMetaData>['request']>;
15
15
  }
@@ -1 +1 @@
1
- {"version":3,"file":"endpoint.d.ts","sourceRoot":"","sources":["../../src/runtime/endpoint.ts"],"names":[],"mappings":"AAAA,6HAA6H;AAC7H,OAAO,KAAK,EACV,YAAY,EACZ,iBAAiB,EACjB,sBAAsB,EACvB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,KAAK,EACV,qBAAqB,EACrB,uBAAuB,EACxB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,KAAK,EACV,mCAAmC,EACnC,4BAA4B,EAC7B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EACV,2BAA2B,EAE3B,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEjE,MAAM,WAAW,QAAQ,CACvB,SAAS,SAAS,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,EACxC,OAAO,SAAS,SAAS,EACzB,SAAS,SAAS,SAAS,GAAG,SAAS;IAEvC,CACE,GAAG,IAAI,EAAE,SAAS,CAAC,OAAO,CAAC,SAAS,IAAI,GACpC,CAAC,MAAM,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,GACzB,CAAC,MAAM,EAAE,OAAO,CAAC,GACp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ACrB,KAAK,GAAG,YAAY,EACpB,UAAU,GAAG,YAAY,EAEzB,OAAO,EACH,oBAAoB,CAAC,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,CAAC,GACnE,CAAC,MAAM,2BAA2B,CAChC,IAAI,EACJ,YAAY,EACZ,MAAM,EACN,KAAK,EACL,UAAU,CACX,CAAC;IASR,eAAe,CACb,KAAK,GAAG,SAAS,CAAC,MAAM,CAAC,EACzB,MAAM,GAAG,YAAY,EACrB,UAAU,GAAG,OAAO,EAEpB,OAAO,EACH,4BAA4B,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,CAAC,GAC7D,CAAC,MAAM,mCAAmC,CACxC,IAAI,EACJ,KAAK,EACL,MAAM,EACN,UAAU,CACX,CAAC;CAQT"}
@@ -1,7 +1,7 @@
1
1
  import { callFunction } from 'yummies/common';
2
- import { EndpointInfiniteQuery } from './endpoint-infinite-query.js';
3
- import { EndpointMutation } from './endpoint-mutation.js';
4
- import { EndpointQuery } from './endpoint-query.js';
2
+ import { EndpointInfiniteQuery } from "./endpoint-infinite-query.js";
3
+ import { EndpointMutation } from "./endpoint-mutation.js";
4
+ import { EndpointQuery } from "./endpoint-query.js";
5
5
  /**
6
6
  * This class is a wrapper for your http request.
7
7
  *
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,23 @@
1
+ import type { AnyObject } from 'yummies/utils/types';
2
+ import type { Endpoint } from "./endpoint.cjs";
3
+ import type { InvalidateEndpointsFilters } from "./endpoint-query-client.types.cjs";
4
+ import type { FullRequestParams } from "./http-client.cjs";
5
+ export interface EndpointConfiguration<TInput extends AnyObject, TMetaData extends AnyObject = AnyObject> {
6
+ group?: string;
7
+ namespace?: string;
8
+ operationId: string;
9
+ path: string[];
10
+ meta?: TMetaData;
11
+ requiredParams: string[];
12
+ params: (input: Partial<TInput>) => FullRequestParams;
13
+ tags: string[];
14
+ }
15
+ export type AnyEndpoint = Endpoint<any, any, any>;
16
+ export type InferEndpointData<TEndpoint extends AnyEndpoint> = TEndpoint extends Endpoint<infer T, any, any> ? T : never;
17
+ export type InferEndpointResponse<TEndpoint extends AnyEndpoint> = TEndpoint extends Endpoint<infer T, any, any> ? T : never;
18
+ export type InferEndpointInput<TEndpoint extends AnyEndpoint> = TEndpoint extends Endpoint<any, infer T, any> ? T : never;
19
+ export type InferEndpointMetaData<TEndpoint extends AnyEndpoint> = TEndpoint extends Endpoint<any, any, infer T> ? T : never;
20
+ export interface EndpointMutationPresets {
21
+ invalidateQueries?: InvalidateEndpointsFilters;
22
+ }
23
+ //# sourceMappingURL=endpoint.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"endpoint.types.d.ts","sourceRoot":"","sources":["../../src/runtime/endpoint.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,uBAAsB;AAC9C,OAAO,KAAK,EAAE,0BAA0B,EAAE,0CAAyC;AACnF,OAAO,KAAK,EAAE,iBAAiB,EAAE,0BAAyB;AAE1D,MAAM,WAAW,qBAAqB,CACpC,MAAM,SAAS,SAAS,EACxB,SAAS,SAAS,SAAS,GAAG,SAAS;IAEvC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,MAAM,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,KAAK,iBAAiB,CAAC;IACtD,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AAED,MAAM,MAAM,WAAW,GAAG,QAAQ,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AAElD,MAAM,MAAM,iBAAiB,CAAC,SAAS,SAAS,WAAW,IACzD,SAAS,SAAS,QAAQ,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAE5D,MAAM,MAAM,qBAAqB,CAAC,SAAS,SAAS,WAAW,IAC7D,SAAS,SAAS,QAAQ,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAE5D,MAAM,MAAM,kBAAkB,CAAC,SAAS,SAAS,WAAW,IAC1D,SAAS,SAAS,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAE5D,MAAM,MAAM,qBAAqB,CAAC,SAAS,SAAS,WAAW,IAC7D,SAAS,SAAS,QAAQ,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAE5D,MAAM,WAAW,uBAAuB;IACtC,iBAAiB,CAAC,EAAE,0BAA0B,CAAC;CAChD"}
@@ -1,7 +1,7 @@
1
1
  import type { AnyObject } from 'yummies/utils/types';
2
- import type { Endpoint } from './endpoint.js';
3
- import type { InvalidateEndpointsFilters } from './endpoint-query-client.types.js';
4
- import type { FullRequestParams } from './http-client.js';
2
+ import type { Endpoint } from "./endpoint.js";
3
+ import type { InvalidateEndpointsFilters } from "./endpoint-query-client.types.js";
4
+ import type { FullRequestParams } from "./http-client.js";
5
5
  export interface EndpointConfiguration<TInput extends AnyObject, TMetaData extends AnyObject = AnyObject> {
6
6
  group?: string;
7
7
  namespace?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"endpoint.types.d.ts","sourceRoot":"","sources":["../../src/runtime/endpoint.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAAE,QAA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,kBAAkB,CAAC,SAAS,SAAS,WAAW,IAC1D,SAAS,SAAS,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAE5D,MAAM,MAAM,qBAAqB,CAAC,SAAS,SAAS,WAAW,IAC7D,SAAS,SAAS,QAAQ,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAE5D,MAAM,WAAW,uBAAuB;IACtC,iBAAiB,CAAC,EAAE,0BAA0B,CAAC;CAChD"}
@@ -0,0 +1,208 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HttpClient = exports.isHttpBadResponse = exports.isHttpResponse = void 0;
4
+ const mobx_1 = require("mobx");
5
+ const isHttpResponse = (response, status) => !!response &&
6
+ typeof response === 'object' &&
7
+ response instanceof Response &&
8
+ 'data' in response &&
9
+ (!status || response.status === status);
10
+ exports.isHttpResponse = isHttpResponse;
11
+ const isHttpBadResponse = (response) => {
12
+ return (0, exports.isHttpResponse)(response) && (!response.ok || !!response.error);
13
+ };
14
+ exports.isHttpBadResponse = isHttpBadResponse;
15
+ class HttpClient {
16
+ config;
17
+ fetch;
18
+ meta;
19
+ baseApiParams;
20
+ badResponse;
21
+ constructor(config) {
22
+ this.config = config ?? {};
23
+ this.badResponse = null;
24
+ this.meta = config?.meta ?? null;
25
+ this.fetch =
26
+ config?.fetch ??
27
+ ((...fetchParams) => globalThis.fetch(...fetchParams));
28
+ this.baseApiParams = {
29
+ credentials: 'same-origin',
30
+ headers: {},
31
+ redirect: 'follow',
32
+ referrerPolicy: 'no-referrer',
33
+ };
34
+ this.updateConfig(this.config);
35
+ mobx_1.observable.ref(this, 'badResponse');
36
+ mobx_1.observable.ref(this, 'meta');
37
+ (0, mobx_1.action)(this, 'setMeta');
38
+ (0, mobx_1.action)(this, 'setBadResponse');
39
+ (0, mobx_1.makeObservable)(this);
40
+ }
41
+ get baseUrl() {
42
+ return this.config.baseUrl ?? '';
43
+ }
44
+ updateConfig(update) {
45
+ Object.assign(this.config, update);
46
+ if (update.baseApiParams) {
47
+ Object.assign(this.baseApiParams, update.baseApiParams);
48
+ }
49
+ if (update.contentFormatters) {
50
+ Object.assign(this.contentFormatters, update.contentFormatters);
51
+ }
52
+ if (update.fetch) {
53
+ this.fetch = update.fetch;
54
+ }
55
+ }
56
+ setMeta = (data) => {
57
+ this.meta = data;
58
+ };
59
+ setBadResponse = (response) => {
60
+ this.badResponse = response;
61
+ };
62
+ encodeQueryParam(key, value) {
63
+ const encodedKey = encodeURIComponent(key);
64
+ return `${encodedKey}=${encodeURIComponent(typeof value === 'number' ? value : `${value}`)}`;
65
+ }
66
+ addQueryParam(query, key) {
67
+ return this.encodeQueryParam(key, query[key]);
68
+ }
69
+ addArrayQueryParam(query, key) {
70
+ const value = query[key];
71
+ return value.map((v) => this.encodeQueryParam(key, v)).join('&');
72
+ }
73
+ toQueryString(rawQuery) {
74
+ if (this.config.toQueryString) {
75
+ return this.config.toQueryString(rawQuery);
76
+ }
77
+ const query = rawQuery || {};
78
+ const keys = Object.keys(query).filter((key) => 'undefined' !== typeof query[key]);
79
+ return keys
80
+ .map((key) => Array.isArray(query[key])
81
+ ? this.addArrayQueryParam(query, key)
82
+ : this.addQueryParam(query, key))
83
+ .join('&');
84
+ }
85
+ contentFormatters = {
86
+ 'application/json': (input) => input !== null && (typeof input === 'object' || typeof input === 'string')
87
+ ? JSON.stringify(input)
88
+ : input,
89
+ 'text/plain': (input) => input !== null && typeof input !== 'string'
90
+ ? JSON.stringify(input)
91
+ : input,
92
+ 'multipart/form-data': (input) => Object.keys(input || {}).reduce((formData, key) => {
93
+ const property = input[key];
94
+ if (property instanceof Blob) {
95
+ formData.append(key, property);
96
+ }
97
+ else if (typeof property === 'object' && property !== null) {
98
+ formData.append(key, JSON.stringify(property));
99
+ }
100
+ else {
101
+ formData.append(key, `${property}`);
102
+ }
103
+ return formData;
104
+ }, new FormData()),
105
+ 'application/x-www-form-urlencoded': (input) => this.toQueryString(input),
106
+ 'application/octet-stream': (input) => input,
107
+ };
108
+ mergeRequestParams(params1, params2) {
109
+ return {
110
+ ...this.baseApiParams,
111
+ ...params1,
112
+ ...params2,
113
+ headers: {
114
+ ...this.baseApiParams.headers,
115
+ ...params1.headers,
116
+ ...params2?.headers,
117
+ },
118
+ };
119
+ }
120
+ async createResponse(responseFormat, raw, url, params) {
121
+ const response = raw;
122
+ response.request = {
123
+ url,
124
+ params,
125
+ };
126
+ response.data = null;
127
+ response.error = null;
128
+ if (responseFormat) {
129
+ try {
130
+ const formatted = await response[responseFormat]();
131
+ if (response.ok) {
132
+ response.data = formatted;
133
+ }
134
+ else {
135
+ response.error = formatted;
136
+ }
137
+ }
138
+ catch (error) {
139
+ if (response.ok) {
140
+ response.error = error;
141
+ }
142
+ else {
143
+ response.error = null;
144
+ }
145
+ }
146
+ }
147
+ if (!response.ok || response.error) {
148
+ this.setBadResponse(response);
149
+ }
150
+ return response;
151
+ }
152
+ buildUrl = (params) => {
153
+ const baseUrl = params.baseUrl ?? this.baseUrl ?? '';
154
+ const path = params.path;
155
+ const queryString = params.query && this.toQueryString(params.query);
156
+ const query = queryString ? `?${queryString}` : '';
157
+ if (this.config.buildUrl) {
158
+ return this.config.buildUrl(params, { baseUrl, path, query }, this.meta);
159
+ }
160
+ const url = baseUrl + path + query;
161
+ return url;
162
+ };
163
+ async request(fullParams) {
164
+ this.setBadResponse(null);
165
+ const { body, contentType = 'application/json', format = 'json', ...params } = fullParams;
166
+ let requestParams = this.mergeRequestParams(params);
167
+ if (this.config.interceptor) {
168
+ requestParams =
169
+ (await this.config.interceptor(requestParams, this.meta)) ??
170
+ requestParams;
171
+ }
172
+ const payloadFormatter = this.contentFormatters[contentType];
173
+ const responseFormat = format || requestParams.format;
174
+ const url = this.buildUrl(fullParams);
175
+ let headers;
176
+ if (requestParams.headers instanceof Headers) {
177
+ headers = requestParams.headers;
178
+ }
179
+ else if (Array.isArray(requestParams.headers)) {
180
+ headers = new Headers(requestParams.headers);
181
+ }
182
+ else {
183
+ headers = new Headers(requestParams.headers);
184
+ }
185
+ if (!headers.has('Content-Type')) {
186
+ headers.set('Content-Type', contentType);
187
+ }
188
+ const fetchUrl = url;
189
+ const fetchParams = {
190
+ ...requestParams,
191
+ headers,
192
+ body: body == null ? null : payloadFormatter(body),
193
+ };
194
+ let response;
195
+ try {
196
+ response = await this.fetch(fetchUrl, fetchParams);
197
+ }
198
+ catch (error) {
199
+ response = error;
200
+ }
201
+ const httpResponse = await this.createResponse(responseFormat, response, fetchUrl, fetchParams);
202
+ if (!httpResponse.ok || httpResponse.error) {
203
+ throw httpResponse;
204
+ }
205
+ return httpResponse;
206
+ }
207
+ }
208
+ exports.HttpClient = HttpClient;
@@ -0,0 +1,85 @@
1
+ import type { HttpStatusCode, HttpSuccessStatusCode } from 'http-status-code-types';
2
+ import type { ValueOf } from 'yummies/utils/types';
3
+ export type QueryParamsType = Record<string | number, any>;
4
+ export type ResponseFormat = keyof Omit<Body, 'body' | 'bodyUsed'>;
5
+ export interface FullRequestParams extends Omit<RequestInit, 'body'> {
6
+ /** set parameter to `true` for call `securityWorker` for this request */
7
+ secure?: boolean;
8
+ /** request path */
9
+ path: string;
10
+ /** content type of request body */
11
+ contentType?: string;
12
+ /** query params */
13
+ query?: QueryParamsType;
14
+ /** format of response (i.e. response.json() -> format: "json") */
15
+ format?: ResponseFormat;
16
+ /** request body */
17
+ body?: unknown;
18
+ /** base url */
19
+ baseUrl?: string;
20
+ /** meta data */
21
+ meta?: Record<string, any>;
22
+ }
23
+ export type RequestParams = Omit<FullRequestParams, 'body' | 'method' | 'query' | 'path' | 'serviceName'>;
24
+ export interface HttpClientConfig<TMeta = unknown> {
25
+ baseUrl?: string;
26
+ meta?: TMeta;
27
+ fetch?: typeof globalThis.fetch;
28
+ baseApiParams?: Omit<RequestParams, 'baseUrl' | 'cancelToken' | 'signal'>;
29
+ contentFormatters?: Record<string, (input: any) => any>;
30
+ toQueryString?: (query?: QueryParamsType) => string;
31
+ buildUrl?: (fullParams: FullRequestParams, formattedParts: {
32
+ baseUrl: string;
33
+ path: string;
34
+ query: string;
35
+ }, metadata: TMeta | null) => string;
36
+ interceptor?: (requestParams: RequestParams, metadata: TMeta | null) => Promise<RequestParams | void> | RequestParams | void;
37
+ }
38
+ export interface HttpResponse<TData, TError = null, TStatus = number> extends Omit<Response, 'status'> {
39
+ data: TData;
40
+ error: TError;
41
+ status: TStatus;
42
+ request: {
43
+ url: string;
44
+ params: globalThis.RequestInit;
45
+ };
46
+ }
47
+ export type HttpMultistatusResponse<TResponsesByStatusMap extends Partial<Record<HttpStatusCode, any>>, TDefaultOkResponse, TDefaultBadResponse = unknown> = Omit<Response, 'status'> & (ValueOf<{
48
+ [K in keyof TResponsesByStatusMap]: {
49
+ status: K;
50
+ data: K extends HttpSuccessStatusCode ? TResponsesByStatusMap[K] : TDefaultOkResponse;
51
+ error: K extends HttpSuccessStatusCode ? TDefaultBadResponse : TResponsesByStatusMap[K];
52
+ };
53
+ }> | {
54
+ status: Exclude<HttpStatusCode, keyof TResponsesByStatusMap>;
55
+ data: TDefaultOkResponse;
56
+ error: TDefaultBadResponse;
57
+ });
58
+ export type GetHttpResponse<T> = T extends (...args: any[]) => infer R ? R extends Promise<HttpResponse<any, any>> ? Awaited<R> : R extends Promise<HttpMultistatusResponse<any, any, any>> ? Awaited<R> : HttpResponse<any, any> : HttpResponse<any, any>;
59
+ export type HttpBadResponse<T = any> = HttpResponse<null, T>;
60
+ export type AnyHttpResponse = HttpResponse<any, any>;
61
+ export declare const isHttpResponse: (response: unknown, status?: number) => response is AnyHttpResponse;
62
+ export declare const isHttpBadResponse: (response: unknown) => response is HttpResponse<null, any>;
63
+ export declare class HttpClient<TMeta = unknown> {
64
+ private config;
65
+ private fetch;
66
+ meta: TMeta | null;
67
+ baseApiParams: RequestParams;
68
+ badResponse: unknown;
69
+ constructor(config?: HttpClientConfig<TMeta>);
70
+ get baseUrl(): string;
71
+ updateConfig(update: Partial<HttpClientConfig<TMeta>>): void;
72
+ setMeta: (data: TMeta | null) => void;
73
+ setBadResponse: (response: unknown) => void;
74
+ protected encodeQueryParam(key: string, value: any): string;
75
+ protected addQueryParam(query: QueryParamsType, key: string): string;
76
+ protected addArrayQueryParam(query: QueryParamsType, key: string): any;
77
+ protected toQueryString(rawQuery?: QueryParamsType): string;
78
+ private contentFormatters;
79
+ protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams;
80
+ protected createResponse(responseFormat: FullRequestParams['format'], raw: Response, url: string, params: RequestInit): Promise<AnyHttpResponse>;
81
+ buildUrl: (params: FullRequestParams) => string;
82
+ request<T, E>(fullParams: FullRequestParams): Promise<HttpResponse<T, E>>;
83
+ request<THttpResponse extends HttpResponse<any, any>>(fullParams: FullRequestParams): Promise<THttpResponse>;
84
+ }
85
+ //# sourceMappingURL=http-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http-client.d.ts","sourceRoot":"","sources":["../../src/runtime/http-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,qBAAqB,EACtB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAEnD,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,GAAG,CAAC,CAAC;AAC3D,MAAM,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAAC,CAAC;AAEnE,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC;IAClE,yEAAyE;IACzE,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,mBAAmB;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,mCAAmC;IACnC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mBAAmB;IACnB,KAAK,CAAC,EAA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IAkB3D,OAAO,CAAC,iBAAiB,CA0BvB;IAEF,SAAS,CAAC,kBAAkB,CAC1B,OAAO,EAAE,aAAa,EACtB,OAAO,CAAC,EAAE,aAAa,GACtB,aAAa;cAaA,cAAc,CAC5B,cAAc,EAAE,iBAAiB,CAAC,QAAQ,CAAC,EAC3C,GAAG,EAAE,QAAQ,EACb,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,WAAW,GAClB,OAAO,CAAC,eAAe,CAAC;IAkCpB,QAAQ,GAAI,QAAQ,iBAAiB,YAgB1C;IAEK,OAAO,CAAC,CAAC,EAAE,CAAC,EACjB,UAAU,EAAE,iBAAiB,GAC5B,OAAO,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACvB,OAAO,CAAC,aAAa,SAAS,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,EACzD,UAAU,EAAE,iBAAiB,GAC5B,OAAO,CAAC,aAAa,CAAC;CAmE1B"}
@@ -0,0 +1,25 @@
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
+ __exportStar(require("./endpoint.cjs"), exports);
18
+ __exportStar(require("./endpoint.types.cjs"), exports);
19
+ __exportStar(require("./endpoint-mutation.cjs"), exports);
20
+ __exportStar(require("./endpoint-mutation.types.cjs"), exports);
21
+ __exportStar(require("./endpoint-query.cjs"), exports);
22
+ __exportStar(require("./endpoint-query.types.cjs"), exports);
23
+ __exportStar(require("./endpoint-query-client.cjs"), exports);
24
+ __exportStar(require("./endpoint-query-client.types.cjs"), exports);
25
+ __exportStar(require("./http-client.cjs"), exports);