@alevnyacow/nzmt 0.0.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.
@@ -0,0 +1,19 @@
1
+ /**
2
+ * @license React
3
+ * react.development.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */
10
+
11
+ /**
12
+ * @license React
13
+ * react.production.js
14
+ *
15
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
16
+ *
17
+ * This source code is licensed under the MIT license found in the
18
+ * LICENSE file in the root directory of this source tree.
19
+ */
@@ -0,0 +1,25 @@
1
+ var __webpack_modules__ = {};
2
+ var __webpack_module_cache__ = {};
3
+ function __webpack_require__(moduleId) {
4
+ var cachedModule = __webpack_module_cache__[moduleId];
5
+ if (void 0 !== cachedModule) return cachedModule.exports;
6
+ var module = __webpack_module_cache__[moduleId] = {
7
+ exports: {}
8
+ };
9
+ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
10
+ return module.exports;
11
+ }
12
+ __webpack_require__.m = __webpack_modules__;
13
+ (()=>{
14
+ __webpack_require__.add = function(modules) {
15
+ Object.assign(__webpack_require__.m, modules);
16
+ };
17
+ })();
18
+ (()=>{
19
+ __webpack_require__.nmd = (module)=>{
20
+ module.paths = [];
21
+ if (!module.children) module.children = [];
22
+ return module;
23
+ };
24
+ })();
25
+ export { __webpack_require__ };
@@ -0,0 +1,3 @@
1
+ export { type StoreTypes } from './store.shared-models.utils';
2
+ export { zodStoreMethodFactory, type ZodStore, type ZodStoreMetadata } from './store.zod.utils';
3
+ export { RAMStore } from './store.ram.utils';
@@ -0,0 +1,18 @@
1
+ import z from 'zod';
2
+ export type PaginationModel = z.infer<typeof Pagination.schema>;
3
+ export declare class Pagination {
4
+ private readonly data;
5
+ static schema: z.ZodObject<{
6
+ zeroBasedIndex: z.ZodCoercedNumber<unknown>;
7
+ pageSize: z.ZodCoercedNumber<unknown>;
8
+ }, z.core.$strip>;
9
+ private constructor();
10
+ static create: (data: PaginationModel) => Pagination;
11
+ get model(): PaginationModel;
12
+ same: (pagination: Pagination) => boolean;
13
+ get nextPage(): Pagination;
14
+ /**
15
+ * Safe implementation. If it's first page, pagination with the same model is returned.
16
+ */
17
+ get previousPage(): Pagination;
18
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,23 @@
1
+ import type { CRUDStore, StoreTypes } from './store.shared-models.utils';
2
+ import { type ZodStore, type ZodStoreMetadata } from './store.zod.utils';
3
+ export declare const RAMStore: <T extends ZodStoreMetadata>(schemas: T, options?: {
4
+ searchLogic?: {
5
+ list?: (entity: StoreTypes<ZodStore<T>>["details"], pattern: StoreTypes<ZodStore<T>>["findListPayload"]) => boolean;
6
+ specific?: (entity: StoreTypes<ZodStore<T>>["details"], pattern: StoreTypes<ZodStore<T>>["findOnePayload"]) => boolean;
7
+ };
8
+ mappers?: {
9
+ detailToList?: (details: StoreTypes<ZodStore<T>>["details"]) => StoreTypes<ZodStore<T>>["listModel"];
10
+ createPayloadToDetail?: (details: StoreTypes<ZodStore<T>>["createPayload"]) => StoreTypes<ZodStore<T>>["details"];
11
+ updatePayloadToDetail?: (prevValue: StoreTypes<ZodStore<T>>["details"], update: StoreTypes<ZodStore<T>>["updatePayload"]) => StoreTypes<ZodStore<T>>["details"];
12
+ };
13
+ initialData?: Array<StoreTypes<ZodStore<T>>["details"]>;
14
+ }) => new () => CRUDStore<{
15
+ list: StoreTypes<ZodStore<T>>["listModel"];
16
+ detail: StoreTypes<ZodStore<T>>["details"];
17
+ }, {
18
+ list: StoreTypes<ZodStore<T>>["findListPayload"];
19
+ specific: StoreTypes<ZodStore<T>>["findOnePayload"];
20
+ }, {
21
+ create: StoreTypes<ZodStore<T>>["createPayload"];
22
+ update: StoreTypes<ZodStore<T>>["updatePayload"];
23
+ }>;
@@ -0,0 +1,86 @@
1
+ import type { PaginationModel } from './store.pagination.entity';
2
+ export type CRUDStore<Models extends {
3
+ list: unknown;
4
+ detail: unknown;
5
+ }, SearchPayload extends {
6
+ list: unknown;
7
+ specific: unknown;
8
+ }, ActionsPayload extends {
9
+ create: unknown;
10
+ update: unknown;
11
+ }> = {
12
+ list: (data: {
13
+ filter: SearchPayload['list'];
14
+ pagination?: PaginationModel;
15
+ }) => Promise<Models['list'][]>;
16
+ details: (data: {
17
+ filter: SearchPayload['specific'];
18
+ }) => Promise<Models['detail'] | null>;
19
+ create: (data: {
20
+ payload: ActionsPayload['create'];
21
+ }) => Promise<{
22
+ id: string;
23
+ }>;
24
+ updateOne: (data: {
25
+ filter: SearchPayload['specific'];
26
+ payload: ActionsPayload['update'];
27
+ }) => Promise<{
28
+ success: boolean;
29
+ }>;
30
+ deleteOne: (data: {
31
+ filter: SearchPayload['specific'];
32
+ }) => Promise<{
33
+ success: boolean;
34
+ }>;
35
+ };
36
+ export type Models<List, Detail> = {
37
+ list: List;
38
+ detail: Detail;
39
+ };
40
+ export type SearchPayload<List, Specific> = {
41
+ list: List;
42
+ specific: Specific;
43
+ };
44
+ export type ActionsPayload<Create, Update> = {
45
+ create: Create;
46
+ update: Update;
47
+ };
48
+ type ExtractCRUDParams<T> = T extends {
49
+ list: (data: {
50
+ filter: infer SList;
51
+ pagination?: any;
52
+ }) => Promise<Array<infer MList>>;
53
+ details: (data: {
54
+ filter: infer SDetail;
55
+ }) => Promise<infer MDetail>;
56
+ create: (data: {
57
+ payload: infer ACreate;
58
+ }) => Promise<any>;
59
+ updateOne: (data: {
60
+ filter: any;
61
+ payload: infer AUpdate;
62
+ }) => Promise<any>;
63
+ deleteOne: (payload: any) => Promise<any>;
64
+ } ? {
65
+ Models: {
66
+ list: NonNullable<MList>;
67
+ detail: NonNullable<MDetail>;
68
+ };
69
+ SearchPayload: {
70
+ list: SList;
71
+ specific: SDetail;
72
+ };
73
+ ActionsPayload: {
74
+ create: ACreate;
75
+ update: AUpdate;
76
+ };
77
+ } : never;
78
+ export type StoreTypes<T> = {
79
+ listModel: ExtractCRUDParams<T>['Models']['list'];
80
+ details: ExtractCRUDParams<T>['Models']['detail'];
81
+ findOnePayload: ExtractCRUDParams<T>['SearchPayload']['specific'];
82
+ findListPayload: ExtractCRUDParams<T>['SearchPayload']['list'];
83
+ createPayload: ExtractCRUDParams<T>['ActionsPayload']['create'];
84
+ updatePayload: ExtractCRUDParams<T>['ActionsPayload']['update'];
85
+ };
86
+ export {};
@@ -0,0 +1,449 @@
1
+ import type { ZodArray, ZodBoolean, ZodObject, ZodString, ZodType, ZodUnion } from 'zod';
2
+ import z from 'zod';
3
+ import { Pagination } from './store.pagination.entity';
4
+ import type { ActionsPayload, CRUDStore, Models, SearchPayload } from './store.shared-models.utils';
5
+ type ZodSchema = ZodType;
6
+ export type ZodStoreMetadata = {
7
+ name: string;
8
+ models: {
9
+ list: ZodSchema;
10
+ details: ZodSchema;
11
+ };
12
+ searchPayload: {
13
+ list: ZodSchema;
14
+ specific: ZodSchema;
15
+ };
16
+ actionsPayload: {
17
+ create: ZodSchema;
18
+ update: ZodSchema;
19
+ };
20
+ customOperations?: Record<string, {
21
+ payload: ZodSchema;
22
+ response: ZodSchema;
23
+ }>;
24
+ };
25
+ export type ZodStore<Schemas extends {
26
+ models: {
27
+ list: unknown;
28
+ details: unknown;
29
+ };
30
+ searchPayload: {
31
+ list: unknown;
32
+ specific: unknown;
33
+ };
34
+ actionsPayload: {
35
+ create: unknown;
36
+ update: unknown;
37
+ };
38
+ customOperations?: Record<string, {
39
+ payload: unknown;
40
+ response: unknown;
41
+ }>;
42
+ }> = CRUDStore<Models<z.infer<Schemas['models']['list']>, z.infer<Schemas['models']['details']>>, SearchPayload<z.infer<Schemas['searchPayload']['list']>, z.infer<Schemas['searchPayload']['specific']>>, ActionsPayload<z.infer<Schemas['actionsPayload']['create']>, z.infer<Schemas['actionsPayload']['update']>>> & (Schemas['customOperations'] extends Record<string, {
43
+ payload: ZodSchema;
44
+ response: ZodSchema;
45
+ }> ? {
46
+ [operation in keyof Schemas['customOperations']]: (payload: z.infer<Schemas['customOperations'][operation]['payload']>) => Promise<z.infer<Schemas['customOperations'][operation]['response']>>;
47
+ } : {});
48
+ export declare const zodStoreMethodFactory: <T extends ZodStoreMetadata>(schemas: T) => <Method extends "details" | "list" | "create" | "updateOne" | "deleteOne" | Exclude<keyof (T["customOperations"] extends Record<string, {
49
+ payload: ZodSchema;
50
+ response: ZodSchema;
51
+ }> ? { [operation in keyof T["customOperations"]]: {
52
+ payload: T["customOperations"][operation]["payload"];
53
+ response: T["customOperations"][operation]["response"];
54
+ }; } : {}), keyof CRUDStore<any, any, any>>>(methodName: Method, handler: (payload: z.core.output<(Record<Exclude<keyof (T["customOperations"] extends Record<string, {
55
+ payload: ZodSchema;
56
+ response: ZodSchema;
57
+ }> ? { [operation in keyof T["customOperations"]]: {
58
+ payload: T["customOperations"][operation]["payload"];
59
+ response: T["customOperations"][operation]["response"];
60
+ }; } : {}), keyof CRUDStore<any, any, any>>, {
61
+ payload: (CRUDStore<Models<T["models"]["list"], T["models"]["details"]>, SearchPayload<T["searchPayload"]["list"], T["searchPayload"]["specific"]>, ActionsPayload<T["actionsPayload"]["create"], T["actionsPayload"]["update"]>> & (T["customOperations"] extends Record<string, {
62
+ payload: ZodSchema;
63
+ response: ZodSchema;
64
+ }> ? { [operation in keyof T["customOperations"]]: {
65
+ payload: T["customOperations"][operation]["payload"];
66
+ response: T["customOperations"][operation]["response"];
67
+ }; } : {}))[Exclude<keyof (T["customOperations"] extends Record<string, {
68
+ payload: ZodSchema;
69
+ response: ZodSchema;
70
+ }> ? { [operation in keyof T["customOperations"]]: {
71
+ payload: T["customOperations"][operation]["payload"];
72
+ response: T["customOperations"][operation]["response"];
73
+ }; } : {}), keyof CRUDStore<any, any, any>>]["payload"];
74
+ response: (CRUDStore<Models<T["models"]["list"], T["models"]["details"]>, SearchPayload<T["searchPayload"]["list"], T["searchPayload"]["specific"]>, ActionsPayload<T["actionsPayload"]["create"], T["actionsPayload"]["update"]>> & (T["customOperations"] extends Record<string, {
75
+ payload: ZodSchema;
76
+ response: ZodSchema;
77
+ }> ? { [operation in keyof T["customOperations"]]: {
78
+ payload: T["customOperations"][operation]["payload"];
79
+ response: T["customOperations"][operation]["response"];
80
+ }; } : {}))[Exclude<keyof (T["customOperations"] extends Record<string, {
81
+ payload: ZodSchema;
82
+ response: ZodSchema;
83
+ }> ? { [operation in keyof T["customOperations"]]: {
84
+ payload: T["customOperations"][operation]["payload"];
85
+ response: T["customOperations"][operation]["response"];
86
+ }; } : {}), keyof CRUDStore<any, any, any>>]["response"];
87
+ }> & {
88
+ list: {
89
+ payload: ZodObject<Parameters<(CRUDStore<Models<T["models"]["list"], T["models"]["details"]>, SearchPayload<T["searchPayload"]["list"], T["searchPayload"]["specific"]>, ActionsPayload<T["actionsPayload"]["create"], T["actionsPayload"]["update"]>> & (T["customOperations"] extends Record<string, {
90
+ payload: ZodSchema;
91
+ response: ZodSchema;
92
+ }> ? { [operation in keyof T["customOperations"]]: {
93
+ payload: T["customOperations"][operation]["payload"];
94
+ response: T["customOperations"][operation]["response"];
95
+ }; } : {}))["list"]>[0] & {
96
+ pagination: ReturnType<typeof Pagination.schema.optional>;
97
+ }, z.core.$strip>;
98
+ response: ZodArray<Awaited<ReturnType<(CRUDStore<Models<T["models"]["list"], T["models"]["details"]>, SearchPayload<T["searchPayload"]["list"], T["searchPayload"]["specific"]>, ActionsPayload<T["actionsPayload"]["create"], T["actionsPayload"]["update"]>> & (T["customOperations"] extends Record<string, {
99
+ payload: ZodSchema;
100
+ response: ZodSchema;
101
+ }> ? { [operation in keyof T["customOperations"]]: {
102
+ payload: T["customOperations"][operation]["payload"];
103
+ response: T["customOperations"][operation]["response"];
104
+ }; } : {}))["list"]>>[number]>;
105
+ };
106
+ details: {
107
+ payload: ZodObject<Parameters<(CRUDStore<Models<T["models"]["list"], T["models"]["details"]>, SearchPayload<T["searchPayload"]["list"], T["searchPayload"]["specific"]>, ActionsPayload<T["actionsPayload"]["create"], T["actionsPayload"]["update"]>> & (T["customOperations"] extends Record<string, {
108
+ payload: ZodSchema;
109
+ response: ZodSchema;
110
+ }> ? { [operation in keyof T["customOperations"]]: {
111
+ payload: T["customOperations"][operation]["payload"];
112
+ response: T["customOperations"][operation]["response"];
113
+ }; } : {}))["details"]>[0], z.core.$strip>;
114
+ response: ZodUnion<[T["models"]["details"], z.ZodNull]>;
115
+ };
116
+ create: {
117
+ payload: ZodObject<Parameters<(CRUDStore<Models<T["models"]["list"], T["models"]["details"]>, SearchPayload<T["searchPayload"]["list"], T["searchPayload"]["specific"]>, ActionsPayload<T["actionsPayload"]["create"], T["actionsPayload"]["update"]>> & (T["customOperations"] extends Record<string, {
118
+ payload: ZodSchema;
119
+ response: ZodSchema;
120
+ }> ? { [operation in keyof T["customOperations"]]: {
121
+ payload: T["customOperations"][operation]["payload"];
122
+ response: T["customOperations"][operation]["response"];
123
+ }; } : {}))["create"]>[0], z.core.$strip>;
124
+ response: ZodObject<{
125
+ id: ZodString;
126
+ }, z.core.$strip>;
127
+ };
128
+ updateOne: {
129
+ payload: ZodObject<Parameters<(CRUDStore<Models<T["models"]["list"], T["models"]["details"]>, SearchPayload<T["searchPayload"]["list"], T["searchPayload"]["specific"]>, ActionsPayload<T["actionsPayload"]["create"], T["actionsPayload"]["update"]>> & (T["customOperations"] extends Record<string, {
130
+ payload: ZodSchema;
131
+ response: ZodSchema;
132
+ }> ? { [operation in keyof T["customOperations"]]: {
133
+ payload: T["customOperations"][operation]["payload"];
134
+ response: T["customOperations"][operation]["response"];
135
+ }; } : {}))["updateOne"]>[0], z.core.$strip>;
136
+ response: ZodObject<{
137
+ success: ZodBoolean;
138
+ }, z.core.$strip>;
139
+ };
140
+ deleteOne: {
141
+ payload: ZodObject<Parameters<(CRUDStore<Models<T["models"]["list"], T["models"]["details"]>, SearchPayload<T["searchPayload"]["list"], T["searchPayload"]["specific"]>, ActionsPayload<T["actionsPayload"]["create"], T["actionsPayload"]["update"]>> & (T["customOperations"] extends Record<string, {
142
+ payload: ZodSchema;
143
+ response: ZodSchema;
144
+ }> ? { [operation in keyof T["customOperations"]]: {
145
+ payload: T["customOperations"][operation]["payload"];
146
+ response: T["customOperations"][operation]["response"];
147
+ }; } : {}))["deleteOne"]>[0], z.core.$strip>;
148
+ response: ZodObject<{
149
+ success: ZodBoolean;
150
+ }, z.core.$strip>;
151
+ };
152
+ })[Method]["payload"]>, config: {
153
+ methodError: (payload: string | import("../errors.utils").ErrorBaseCreatingPayload, cause?: unknown) => import("../errors.utils").ModuleErrorModel;
154
+ }) => Promise<z.core.output<(Record<Exclude<keyof (T["customOperations"] extends Record<string, {
155
+ payload: ZodSchema;
156
+ response: ZodSchema;
157
+ }> ? { [operation in keyof T["customOperations"]]: {
158
+ payload: T["customOperations"][operation]["payload"];
159
+ response: T["customOperations"][operation]["response"];
160
+ }; } : {}), keyof CRUDStore<any, any, any>>, {
161
+ payload: (CRUDStore<Models<T["models"]["list"], T["models"]["details"]>, SearchPayload<T["searchPayload"]["list"], T["searchPayload"]["specific"]>, ActionsPayload<T["actionsPayload"]["create"], T["actionsPayload"]["update"]>> & (T["customOperations"] extends Record<string, {
162
+ payload: ZodSchema;
163
+ response: ZodSchema;
164
+ }> ? { [operation in keyof T["customOperations"]]: {
165
+ payload: T["customOperations"][operation]["payload"];
166
+ response: T["customOperations"][operation]["response"];
167
+ }; } : {}))[Exclude<keyof (T["customOperations"] extends Record<string, {
168
+ payload: ZodSchema;
169
+ response: ZodSchema;
170
+ }> ? { [operation in keyof T["customOperations"]]: {
171
+ payload: T["customOperations"][operation]["payload"];
172
+ response: T["customOperations"][operation]["response"];
173
+ }; } : {}), keyof CRUDStore<any, any, any>>]["payload"];
174
+ response: (CRUDStore<Models<T["models"]["list"], T["models"]["details"]>, SearchPayload<T["searchPayload"]["list"], T["searchPayload"]["specific"]>, ActionsPayload<T["actionsPayload"]["create"], T["actionsPayload"]["update"]>> & (T["customOperations"] extends Record<string, {
175
+ payload: ZodSchema;
176
+ response: ZodSchema;
177
+ }> ? { [operation in keyof T["customOperations"]]: {
178
+ payload: T["customOperations"][operation]["payload"];
179
+ response: T["customOperations"][operation]["response"];
180
+ }; } : {}))[Exclude<keyof (T["customOperations"] extends Record<string, {
181
+ payload: ZodSchema;
182
+ response: ZodSchema;
183
+ }> ? { [operation in keyof T["customOperations"]]: {
184
+ payload: T["customOperations"][operation]["payload"];
185
+ response: T["customOperations"][operation]["response"];
186
+ }; } : {}), keyof CRUDStore<any, any, any>>]["response"];
187
+ }> & {
188
+ list: {
189
+ payload: ZodObject<Parameters<(CRUDStore<Models<T["models"]["list"], T["models"]["details"]>, SearchPayload<T["searchPayload"]["list"], T["searchPayload"]["specific"]>, ActionsPayload<T["actionsPayload"]["create"], T["actionsPayload"]["update"]>> & (T["customOperations"] extends Record<string, {
190
+ payload: ZodSchema;
191
+ response: ZodSchema;
192
+ }> ? { [operation in keyof T["customOperations"]]: {
193
+ payload: T["customOperations"][operation]["payload"];
194
+ response: T["customOperations"][operation]["response"];
195
+ }; } : {}))["list"]>[0] & {
196
+ pagination: ReturnType<typeof Pagination.schema.optional>;
197
+ }, z.core.$strip>;
198
+ response: ZodArray<Awaited<ReturnType<(CRUDStore<Models<T["models"]["list"], T["models"]["details"]>, SearchPayload<T["searchPayload"]["list"], T["searchPayload"]["specific"]>, ActionsPayload<T["actionsPayload"]["create"], T["actionsPayload"]["update"]>> & (T["customOperations"] extends Record<string, {
199
+ payload: ZodSchema;
200
+ response: ZodSchema;
201
+ }> ? { [operation in keyof T["customOperations"]]: {
202
+ payload: T["customOperations"][operation]["payload"];
203
+ response: T["customOperations"][operation]["response"];
204
+ }; } : {}))["list"]>>[number]>;
205
+ };
206
+ details: {
207
+ payload: ZodObject<Parameters<(CRUDStore<Models<T["models"]["list"], T["models"]["details"]>, SearchPayload<T["searchPayload"]["list"], T["searchPayload"]["specific"]>, ActionsPayload<T["actionsPayload"]["create"], T["actionsPayload"]["update"]>> & (T["customOperations"] extends Record<string, {
208
+ payload: ZodSchema;
209
+ response: ZodSchema;
210
+ }> ? { [operation in keyof T["customOperations"]]: {
211
+ payload: T["customOperations"][operation]["payload"];
212
+ response: T["customOperations"][operation]["response"];
213
+ }; } : {}))["details"]>[0], z.core.$strip>;
214
+ response: ZodUnion<[T["models"]["details"], z.ZodNull]>;
215
+ };
216
+ create: {
217
+ payload: ZodObject<Parameters<(CRUDStore<Models<T["models"]["list"], T["models"]["details"]>, SearchPayload<T["searchPayload"]["list"], T["searchPayload"]["specific"]>, ActionsPayload<T["actionsPayload"]["create"], T["actionsPayload"]["update"]>> & (T["customOperations"] extends Record<string, {
218
+ payload: ZodSchema;
219
+ response: ZodSchema;
220
+ }> ? { [operation in keyof T["customOperations"]]: {
221
+ payload: T["customOperations"][operation]["payload"];
222
+ response: T["customOperations"][operation]["response"];
223
+ }; } : {}))["create"]>[0], z.core.$strip>;
224
+ response: ZodObject<{
225
+ id: ZodString;
226
+ }, z.core.$strip>;
227
+ };
228
+ updateOne: {
229
+ payload: ZodObject<Parameters<(CRUDStore<Models<T["models"]["list"], T["models"]["details"]>, SearchPayload<T["searchPayload"]["list"], T["searchPayload"]["specific"]>, ActionsPayload<T["actionsPayload"]["create"], T["actionsPayload"]["update"]>> & (T["customOperations"] extends Record<string, {
230
+ payload: ZodSchema;
231
+ response: ZodSchema;
232
+ }> ? { [operation in keyof T["customOperations"]]: {
233
+ payload: T["customOperations"][operation]["payload"];
234
+ response: T["customOperations"][operation]["response"];
235
+ }; } : {}))["updateOne"]>[0], z.core.$strip>;
236
+ response: ZodObject<{
237
+ success: ZodBoolean;
238
+ }, z.core.$strip>;
239
+ };
240
+ deleteOne: {
241
+ payload: ZodObject<Parameters<(CRUDStore<Models<T["models"]["list"], T["models"]["details"]>, SearchPayload<T["searchPayload"]["list"], T["searchPayload"]["specific"]>, ActionsPayload<T["actionsPayload"]["create"], T["actionsPayload"]["update"]>> & (T["customOperations"] extends Record<string, {
242
+ payload: ZodSchema;
243
+ response: ZodSchema;
244
+ }> ? { [operation in keyof T["customOperations"]]: {
245
+ payload: T["customOperations"][operation]["payload"];
246
+ response: T["customOperations"][operation]["response"];
247
+ }; } : {}))["deleteOne"]>[0], z.core.$strip>;
248
+ response: ZodObject<{
249
+ success: ZodBoolean;
250
+ }, z.core.$strip>;
251
+ };
252
+ })[Method]["response"]>>, config?: import("../zod-module.utils").ZodModuleConfig) => (payload: z.core.output<(Record<Exclude<keyof (T["customOperations"] extends Record<string, {
253
+ payload: ZodSchema;
254
+ response: ZodSchema;
255
+ }> ? { [operation in keyof T["customOperations"]]: {
256
+ payload: T["customOperations"][operation]["payload"];
257
+ response: T["customOperations"][operation]["response"];
258
+ }; } : {}), keyof CRUDStore<any, any, any>>, {
259
+ payload: (CRUDStore<Models<T["models"]["list"], T["models"]["details"]>, SearchPayload<T["searchPayload"]["list"], T["searchPayload"]["specific"]>, ActionsPayload<T["actionsPayload"]["create"], T["actionsPayload"]["update"]>> & (T["customOperations"] extends Record<string, {
260
+ payload: ZodSchema;
261
+ response: ZodSchema;
262
+ }> ? { [operation in keyof T["customOperations"]]: {
263
+ payload: T["customOperations"][operation]["payload"];
264
+ response: T["customOperations"][operation]["response"];
265
+ }; } : {}))[Exclude<keyof (T["customOperations"] extends Record<string, {
266
+ payload: ZodSchema;
267
+ response: ZodSchema;
268
+ }> ? { [operation in keyof T["customOperations"]]: {
269
+ payload: T["customOperations"][operation]["payload"];
270
+ response: T["customOperations"][operation]["response"];
271
+ }; } : {}), keyof CRUDStore<any, any, any>>]["payload"];
272
+ response: (CRUDStore<Models<T["models"]["list"], T["models"]["details"]>, SearchPayload<T["searchPayload"]["list"], T["searchPayload"]["specific"]>, ActionsPayload<T["actionsPayload"]["create"], T["actionsPayload"]["update"]>> & (T["customOperations"] extends Record<string, {
273
+ payload: ZodSchema;
274
+ response: ZodSchema;
275
+ }> ? { [operation in keyof T["customOperations"]]: {
276
+ payload: T["customOperations"][operation]["payload"];
277
+ response: T["customOperations"][operation]["response"];
278
+ }; } : {}))[Exclude<keyof (T["customOperations"] extends Record<string, {
279
+ payload: ZodSchema;
280
+ response: ZodSchema;
281
+ }> ? { [operation in keyof T["customOperations"]]: {
282
+ payload: T["customOperations"][operation]["payload"];
283
+ response: T["customOperations"][operation]["response"];
284
+ }; } : {}), keyof CRUDStore<any, any, any>>]["response"];
285
+ }> & {
286
+ list: {
287
+ payload: ZodObject<Parameters<(CRUDStore<Models<T["models"]["list"], T["models"]["details"]>, SearchPayload<T["searchPayload"]["list"], T["searchPayload"]["specific"]>, ActionsPayload<T["actionsPayload"]["create"], T["actionsPayload"]["update"]>> & (T["customOperations"] extends Record<string, {
288
+ payload: ZodSchema;
289
+ response: ZodSchema;
290
+ }> ? { [operation in keyof T["customOperations"]]: {
291
+ payload: T["customOperations"][operation]["payload"];
292
+ response: T["customOperations"][operation]["response"];
293
+ }; } : {}))["list"]>[0] & {
294
+ pagination: ReturnType<typeof Pagination.schema.optional>;
295
+ }, z.core.$strip>;
296
+ response: ZodArray<Awaited<ReturnType<(CRUDStore<Models<T["models"]["list"], T["models"]["details"]>, SearchPayload<T["searchPayload"]["list"], T["searchPayload"]["specific"]>, ActionsPayload<T["actionsPayload"]["create"], T["actionsPayload"]["update"]>> & (T["customOperations"] extends Record<string, {
297
+ payload: ZodSchema;
298
+ response: ZodSchema;
299
+ }> ? { [operation in keyof T["customOperations"]]: {
300
+ payload: T["customOperations"][operation]["payload"];
301
+ response: T["customOperations"][operation]["response"];
302
+ }; } : {}))["list"]>>[number]>;
303
+ };
304
+ details: {
305
+ payload: ZodObject<Parameters<(CRUDStore<Models<T["models"]["list"], T["models"]["details"]>, SearchPayload<T["searchPayload"]["list"], T["searchPayload"]["specific"]>, ActionsPayload<T["actionsPayload"]["create"], T["actionsPayload"]["update"]>> & (T["customOperations"] extends Record<string, {
306
+ payload: ZodSchema;
307
+ response: ZodSchema;
308
+ }> ? { [operation in keyof T["customOperations"]]: {
309
+ payload: T["customOperations"][operation]["payload"];
310
+ response: T["customOperations"][operation]["response"];
311
+ }; } : {}))["details"]>[0], z.core.$strip>;
312
+ response: ZodUnion<[T["models"]["details"], z.ZodNull]>;
313
+ };
314
+ create: {
315
+ payload: ZodObject<Parameters<(CRUDStore<Models<T["models"]["list"], T["models"]["details"]>, SearchPayload<T["searchPayload"]["list"], T["searchPayload"]["specific"]>, ActionsPayload<T["actionsPayload"]["create"], T["actionsPayload"]["update"]>> & (T["customOperations"] extends Record<string, {
316
+ payload: ZodSchema;
317
+ response: ZodSchema;
318
+ }> ? { [operation in keyof T["customOperations"]]: {
319
+ payload: T["customOperations"][operation]["payload"];
320
+ response: T["customOperations"][operation]["response"];
321
+ }; } : {}))["create"]>[0], z.core.$strip>;
322
+ response: ZodObject<{
323
+ id: ZodString;
324
+ }, z.core.$strip>;
325
+ };
326
+ updateOne: {
327
+ payload: ZodObject<Parameters<(CRUDStore<Models<T["models"]["list"], T["models"]["details"]>, SearchPayload<T["searchPayload"]["list"], T["searchPayload"]["specific"]>, ActionsPayload<T["actionsPayload"]["create"], T["actionsPayload"]["update"]>> & (T["customOperations"] extends Record<string, {
328
+ payload: ZodSchema;
329
+ response: ZodSchema;
330
+ }> ? { [operation in keyof T["customOperations"]]: {
331
+ payload: T["customOperations"][operation]["payload"];
332
+ response: T["customOperations"][operation]["response"];
333
+ }; } : {}))["updateOne"]>[0], z.core.$strip>;
334
+ response: ZodObject<{
335
+ success: ZodBoolean;
336
+ }, z.core.$strip>;
337
+ };
338
+ deleteOne: {
339
+ payload: ZodObject<Parameters<(CRUDStore<Models<T["models"]["list"], T["models"]["details"]>, SearchPayload<T["searchPayload"]["list"], T["searchPayload"]["specific"]>, ActionsPayload<T["actionsPayload"]["create"], T["actionsPayload"]["update"]>> & (T["customOperations"] extends Record<string, {
340
+ payload: ZodSchema;
341
+ response: ZodSchema;
342
+ }> ? { [operation in keyof T["customOperations"]]: {
343
+ payload: T["customOperations"][operation]["payload"];
344
+ response: T["customOperations"][operation]["response"];
345
+ }; } : {}))["deleteOne"]>[0], z.core.$strip>;
346
+ response: ZodObject<{
347
+ success: ZodBoolean;
348
+ }, z.core.$strip>;
349
+ };
350
+ })[Method]["payload"]>) => Promise<z.core.output<(Record<Exclude<keyof (T["customOperations"] extends Record<string, {
351
+ payload: ZodSchema;
352
+ response: ZodSchema;
353
+ }> ? { [operation in keyof T["customOperations"]]: {
354
+ payload: T["customOperations"][operation]["payload"];
355
+ response: T["customOperations"][operation]["response"];
356
+ }; } : {}), keyof CRUDStore<any, any, any>>, {
357
+ payload: (CRUDStore<Models<T["models"]["list"], T["models"]["details"]>, SearchPayload<T["searchPayload"]["list"], T["searchPayload"]["specific"]>, ActionsPayload<T["actionsPayload"]["create"], T["actionsPayload"]["update"]>> & (T["customOperations"] extends Record<string, {
358
+ payload: ZodSchema;
359
+ response: ZodSchema;
360
+ }> ? { [operation in keyof T["customOperations"]]: {
361
+ payload: T["customOperations"][operation]["payload"];
362
+ response: T["customOperations"][operation]["response"];
363
+ }; } : {}))[Exclude<keyof (T["customOperations"] extends Record<string, {
364
+ payload: ZodSchema;
365
+ response: ZodSchema;
366
+ }> ? { [operation in keyof T["customOperations"]]: {
367
+ payload: T["customOperations"][operation]["payload"];
368
+ response: T["customOperations"][operation]["response"];
369
+ }; } : {}), keyof CRUDStore<any, any, any>>]["payload"];
370
+ response: (CRUDStore<Models<T["models"]["list"], T["models"]["details"]>, SearchPayload<T["searchPayload"]["list"], T["searchPayload"]["specific"]>, ActionsPayload<T["actionsPayload"]["create"], T["actionsPayload"]["update"]>> & (T["customOperations"] extends Record<string, {
371
+ payload: ZodSchema;
372
+ response: ZodSchema;
373
+ }> ? { [operation in keyof T["customOperations"]]: {
374
+ payload: T["customOperations"][operation]["payload"];
375
+ response: T["customOperations"][operation]["response"];
376
+ }; } : {}))[Exclude<keyof (T["customOperations"] extends Record<string, {
377
+ payload: ZodSchema;
378
+ response: ZodSchema;
379
+ }> ? { [operation in keyof T["customOperations"]]: {
380
+ payload: T["customOperations"][operation]["payload"];
381
+ response: T["customOperations"][operation]["response"];
382
+ }; } : {}), keyof CRUDStore<any, any, any>>]["response"];
383
+ }> & {
384
+ list: {
385
+ payload: ZodObject<Parameters<(CRUDStore<Models<T["models"]["list"], T["models"]["details"]>, SearchPayload<T["searchPayload"]["list"], T["searchPayload"]["specific"]>, ActionsPayload<T["actionsPayload"]["create"], T["actionsPayload"]["update"]>> & (T["customOperations"] extends Record<string, {
386
+ payload: ZodSchema;
387
+ response: ZodSchema;
388
+ }> ? { [operation in keyof T["customOperations"]]: {
389
+ payload: T["customOperations"][operation]["payload"];
390
+ response: T["customOperations"][operation]["response"];
391
+ }; } : {}))["list"]>[0] & {
392
+ pagination: ReturnType<typeof Pagination.schema.optional>;
393
+ }, z.core.$strip>;
394
+ response: ZodArray<Awaited<ReturnType<(CRUDStore<Models<T["models"]["list"], T["models"]["details"]>, SearchPayload<T["searchPayload"]["list"], T["searchPayload"]["specific"]>, ActionsPayload<T["actionsPayload"]["create"], T["actionsPayload"]["update"]>> & (T["customOperations"] extends Record<string, {
395
+ payload: ZodSchema;
396
+ response: ZodSchema;
397
+ }> ? { [operation in keyof T["customOperations"]]: {
398
+ payload: T["customOperations"][operation]["payload"];
399
+ response: T["customOperations"][operation]["response"];
400
+ }; } : {}))["list"]>>[number]>;
401
+ };
402
+ details: {
403
+ payload: ZodObject<Parameters<(CRUDStore<Models<T["models"]["list"], T["models"]["details"]>, SearchPayload<T["searchPayload"]["list"], T["searchPayload"]["specific"]>, ActionsPayload<T["actionsPayload"]["create"], T["actionsPayload"]["update"]>> & (T["customOperations"] extends Record<string, {
404
+ payload: ZodSchema;
405
+ response: ZodSchema;
406
+ }> ? { [operation in keyof T["customOperations"]]: {
407
+ payload: T["customOperations"][operation]["payload"];
408
+ response: T["customOperations"][operation]["response"];
409
+ }; } : {}))["details"]>[0], z.core.$strip>;
410
+ response: ZodUnion<[T["models"]["details"], z.ZodNull]>;
411
+ };
412
+ create: {
413
+ payload: ZodObject<Parameters<(CRUDStore<Models<T["models"]["list"], T["models"]["details"]>, SearchPayload<T["searchPayload"]["list"], T["searchPayload"]["specific"]>, ActionsPayload<T["actionsPayload"]["create"], T["actionsPayload"]["update"]>> & (T["customOperations"] extends Record<string, {
414
+ payload: ZodSchema;
415
+ response: ZodSchema;
416
+ }> ? { [operation in keyof T["customOperations"]]: {
417
+ payload: T["customOperations"][operation]["payload"];
418
+ response: T["customOperations"][operation]["response"];
419
+ }; } : {}))["create"]>[0], z.core.$strip>;
420
+ response: ZodObject<{
421
+ id: ZodString;
422
+ }, z.core.$strip>;
423
+ };
424
+ updateOne: {
425
+ payload: ZodObject<Parameters<(CRUDStore<Models<T["models"]["list"], T["models"]["details"]>, SearchPayload<T["searchPayload"]["list"], T["searchPayload"]["specific"]>, ActionsPayload<T["actionsPayload"]["create"], T["actionsPayload"]["update"]>> & (T["customOperations"] extends Record<string, {
426
+ payload: ZodSchema;
427
+ response: ZodSchema;
428
+ }> ? { [operation in keyof T["customOperations"]]: {
429
+ payload: T["customOperations"][operation]["payload"];
430
+ response: T["customOperations"][operation]["response"];
431
+ }; } : {}))["updateOne"]>[0], z.core.$strip>;
432
+ response: ZodObject<{
433
+ success: ZodBoolean;
434
+ }, z.core.$strip>;
435
+ };
436
+ deleteOne: {
437
+ payload: ZodObject<Parameters<(CRUDStore<Models<T["models"]["list"], T["models"]["details"]>, SearchPayload<T["searchPayload"]["list"], T["searchPayload"]["specific"]>, ActionsPayload<T["actionsPayload"]["create"], T["actionsPayload"]["update"]>> & (T["customOperations"] extends Record<string, {
438
+ payload: ZodSchema;
439
+ response: ZodSchema;
440
+ }> ? { [operation in keyof T["customOperations"]]: {
441
+ payload: T["customOperations"][operation]["payload"];
442
+ response: T["customOperations"][operation]["response"];
443
+ }; } : {}))["deleteOne"]>[0], z.core.$strip>;
444
+ response: ZodObject<{
445
+ success: ZodBoolean;
446
+ }, z.core.$strip>;
447
+ };
448
+ })[Method]["response"]>>;
449
+ export {};