@danceroutine/tango-resources 1.11.2 → 1.11.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 (49) hide show
  1. package/README.md +2 -2
  2. package/dist/CursorPaginator-B_8MhYZY.js +195 -0
  3. package/dist/CursorPaginator-B_8MhYZY.js.map +1 -0
  4. package/dist/CursorPaginator-CfeMQCdJ.d.ts +177 -0
  5. package/dist/OffsetPaginator-CaycvxJU.js +188 -0
  6. package/dist/OffsetPaginator-CaycvxJU.js.map +1 -0
  7. package/dist/context/index.d.ts +2 -0
  8. package/dist/context/index.js +2 -0
  9. package/dist/context-euBQvNRT.js +65 -0
  10. package/dist/context-euBQvNRT.js.map +1 -0
  11. package/dist/filters/index.d.ts +2 -0
  12. package/dist/filters/index.js +2 -0
  13. package/dist/filters-46d2Nr5C.js +287 -0
  14. package/dist/filters-46d2Nr5C.js.map +1 -0
  15. package/dist/index-Ac94YL5S.d.ts +24 -0
  16. package/dist/index-BJJalUDB.d.ts +54 -0
  17. package/dist/index-Bg6TtnmQ.d.ts +175 -0
  18. package/dist/index-C55GDIOn.d.ts +222 -0
  19. package/dist/index-CiIB-1Ac.d.ts +123 -0
  20. package/dist/index-DkJtxvKu.d.ts +164 -0
  21. package/dist/index.d.ts +10 -12
  22. package/dist/index.js +10 -1013
  23. package/dist/inferModelFieldParsers-2irv7j1T.js +70 -0
  24. package/dist/inferModelFieldParsers-2irv7j1T.js.map +1 -0
  25. package/dist/pagination/index.d.ts +3 -0
  26. package/dist/pagination/index.js +15 -0
  27. package/dist/pagination/index.js.map +1 -0
  28. package/dist/paginators/index.d.ts +9 -0
  29. package/dist/paginators/index.js +12 -0
  30. package/dist/paginators/index.js.map +1 -0
  31. package/dist/resource/index.d.ts +3 -0
  32. package/dist/resource/index.js +7 -0
  33. package/dist/resource/index.js.map +1 -0
  34. package/dist/serializer/index.d.ts +2 -0
  35. package/dist/serializer/index.js +2 -0
  36. package/dist/serializer-RSwlXWls.js +305 -0
  37. package/dist/serializer-RSwlXWls.js.map +1 -0
  38. package/dist/view/index.d.ts +2 -1
  39. package/dist/view/index.js +1 -1
  40. package/dist/{view-C9B5Lln3.js → view-CYdJAO4t.js} +7 -314
  41. package/dist/view-CYdJAO4t.js.map +1 -0
  42. package/dist/viewset/index.d.ts +9 -0
  43. package/dist/viewset/index.js +2 -0
  44. package/dist/viewset-C9j-2U29.js +227 -0
  45. package/dist/viewset-C9j-2U29.js.map +1 -0
  46. package/package.json +21 -17
  47. package/dist/index-D6sfTSEj.d.ts +0 -902
  48. package/dist/index.js.map +0 -1
  49. package/dist/view-C9B5Lln3.js.map +0 -1
@@ -1,902 +0,0 @@
1
- import { TangoQueryParams, TangoRequest, TangoResponse } from "@danceroutine/tango-core";
2
- import { FilterInput, FilterValue, LookupType, ManagerLike, ManyToManyRelatedManager, QueryResult, QuerySet } from "@danceroutine/tango-orm";
3
- import { z } from "zod";
4
-
5
- //#region src/context/RequestContext.d.ts
6
- /**
7
- * Default user shape for RequestContext.
8
- * Consumers can provide their own user type via the TUser generic parameter.
9
- */
10
- interface BaseUser {
11
- id: string | number;
12
- roles?: string[];
13
- }
14
- /**
15
- * Normalized request context passed through the framework adapter into viewset methods.
16
- * Generic over the user type so consumers can plug in their own auth infrastructure.
17
- */
18
- declare class RequestContext<TUser = BaseUser> {
19
- readonly request: TangoRequest;
20
- user: TUser | null;
21
- params: Record<string, string>;
22
- static readonly BRAND: "tango.resources.request_context";
23
- readonly __tangoBrand: typeof RequestContext.BRAND;
24
- private state;
25
- constructor(request: TangoRequest, user?: TUser | null, params?: Record<string, string>);
26
- /**
27
- * Narrow an unknown value to `RequestContext`.
28
- */
29
- static isRequestContext<TUser = BaseUser>(value: unknown): value is RequestContext<TUser>;
30
- /**
31
- * Construct a context with optional user payload.
32
- */
33
- static create<TUser = BaseUser>(request: Request, user?: TUser | null): RequestContext<TUser>;
34
- /**
35
- * Store arbitrary per-request state for downstream middleware/handlers.
36
- */
37
- setState<T>(key: string | symbol, value: T): void;
38
- /**
39
- * Retrieve previously stored request state.
40
- */
41
- getState<T>(key: string | symbol): T | undefined;
42
- /**
43
- * Check whether a state key has been set.
44
- */
45
- hasState(key: string | symbol): boolean;
46
- /**
47
- * Clone the context, including route params and request-local state.
48
- */
49
- clone(): RequestContext<TUser>;
50
- }
51
- declare namespace index_d_exports$5 {
52
- export { BaseUser, RequestContext };
53
- }
54
- //#endregion
55
- //#region src/filters/internal/InternalFilterType.d.ts
56
- declare const InternalFilterType: {
57
- readonly SCALAR: "scalar";
58
- readonly ILIKE: "ilike";
59
- readonly RANGE: "range";
60
- readonly IN: "in";
61
- readonly CUSTOM: "custom";
62
- };
63
- //#endregion
64
- //#region src/filters/FilterType.d.ts
65
- type FilterType = (typeof InternalFilterType)[keyof typeof InternalFilterType];
66
- //#endregion
67
- //#region src/filters/internal/InternalRangeOperator.d.ts
68
- declare const InternalRangeOperator: {
69
- readonly GTE: "gte";
70
- readonly LTE: "lte";
71
- readonly GT: "gt";
72
- readonly LT: "lt";
73
- };
74
- //#endregion
75
- //#region src/filters/RangeOperator.d.ts
76
- type RangeOperator = (typeof InternalRangeOperator)[keyof typeof InternalRangeOperator];
77
- //#endregion
78
- //#region src/filters/FilterSet.d.ts
79
- type FilterFieldRef<T extends Record<string, unknown>> = Extract<keyof T, string> | string;
80
- /**
81
- * Configuration for how a query parameter should be resolved into a filter.
82
- * Supports scalar equality, case-insensitive search, range comparisons, IN queries, and custom logic.
83
- */
84
- type FilterResolver<T extends Record<string, unknown>> = {
85
- type: typeof InternalFilterType.SCALAR;
86
- column: FilterFieldRef<T>;
87
- } | {
88
- type: typeof InternalFilterType.ILIKE;
89
- columns: FilterFieldRef<T>[];
90
- } | {
91
- type: typeof InternalFilterType.RANGE;
92
- column: FilterFieldRef<T>;
93
- op: RangeOperator;
94
- } | {
95
- type: typeof InternalFilterType.IN;
96
- column: FilterFieldRef<T>;
97
- } | {
98
- type: typeof InternalFilterType.CUSTOM;
99
- apply: (value: string | string[] | undefined) => FilterInput<T> | undefined;
100
- };
101
- type FilterLookup = LookupType;
102
- type FilterValueParser = (raw: string | string[]) => FilterValue | FilterValue[] | undefined;
103
- type FieldFilterDeclaration = true | readonly FilterLookup[] | {
104
- lookups?: readonly FilterLookup[];
105
- param?: string;
106
- parse?: FilterValueParser;
107
- };
108
- type AliasFilterDeclaration<T extends Record<string, unknown>> = FilterResolver<T> | {
109
- field: FilterFieldRef<T>;
110
- lookup?: FilterLookup;
111
- parse?: FilterValueParser;
112
- } | {
113
- fields: readonly FilterFieldRef<T>[];
114
- lookup?: FilterLookup;
115
- parse?: FilterValueParser;
116
- };
117
- interface FilterSetDefineConfig<T extends Record<string, unknown>> {
118
- fields?: Partial<Record<string, FieldFilterDeclaration>>;
119
- aliases?: Record<string, AliasFilterDeclaration<T>>;
120
- parsers?: Partial<Record<string, FilterValueParser>>;
121
- all?: '__all__';
122
- }
123
- /**
124
- * Declarative query-param to filter translation.
125
- *
126
- * A `FilterSet` lets viewsets expose safe, explicit filtering behavior
127
- * without leaking raw ORM filter syntax to request handlers.
128
- */
129
- declare class FilterSet<T extends Record<string, unknown>> {
130
- private readonly spec;
131
- private readonly allowAllParams;
132
- static readonly BRAND: "tango.resources.filter_set";
133
- readonly __tangoBrand: typeof FilterSet.BRAND;
134
- /**
135
- * Resolve matching query parameters into ORM filter inputs.
136
- */
137
- constructor(spec: Record<string, FilterResolver<T>>, allowAllParams?: boolean);
138
- /**
139
- * Build a filter set from Django-style field declarations.
140
- */
141
- static define<T extends Record<string, unknown>>(config: FilterSetDefineConfig<T>): FilterSet<T>;
142
- /**
143
- * Narrow an unknown value to `FilterSet`.
144
- */
145
- static isFilterSet<T extends Record<string, unknown>>(value: unknown): value is FilterSet<T>;
146
- private static normalizeDefineConfig;
147
- private static addFieldDeclaration;
148
- private static isLookupArray;
149
- private static normalizeAliasDeclaration;
150
- private static isFilterResolverDeclaration;
151
- private static createMultiFieldResolver;
152
- private static createLookupResolver;
153
- private static resolveLookupFilter;
154
- private static resolveLookupParam;
155
- private static resolveParserValue;
156
- private static toScalarString;
157
- /**
158
- * Return a new filter set with parser-aware scalar/range/in resolvers for matching fields.
159
- */
160
- withFieldParsers(parsers: Partial<Record<string, FilterValueParser>>): FilterSet<T>;
161
- /**
162
- * Apply all configured resolvers against query params.
163
- */
164
- apply(params: TangoQueryParams): FilterInput<T>[];
165
- private buildAllResolver;
166
- private resolveFilter;
167
- private applyFieldParserOverride;
168
- }
169
- declare namespace index_d_exports$4 {
170
- export { AliasFilterDeclaration, FieldFilterDeclaration, FilterLookup, FilterResolver, FilterSet, FilterSetDefineConfig, FilterType, FilterValueParser, RangeOperator };
171
- }
172
- //#endregion
173
- //#region src/pagination/BasePaginator.d.ts
174
- declare abstract class BasePaginator {
175
- protected resolveQueryResultRows<T>(rows: readonly T[] | QueryResult<T>): T[];
176
- }
177
- //#endregion
178
- //#region src/pagination/PaginatedResponse.d.ts
179
- interface BasePaginatedResponse<T> {
180
- results: T[];
181
- next?: string | null;
182
- previous?: string | null;
183
- }
184
- interface OffsetPaginatedResponse<T> extends BasePaginatedResponse<T> {
185
- count?: number;
186
- }
187
- interface CursorPaginatedResponse<T> extends BasePaginatedResponse<T> {
188
- count?: never;
189
- }
190
- type PaginatedResponse<T> = OffsetPaginatedResponse<T> | CursorPaginatedResponse<T>;
191
- //#endregion
192
- //#region src/pagination/Paginator.d.ts
193
- interface Page<T> {
194
- results: T[];
195
- hasNext(): boolean;
196
- hasPrevious(): boolean;
197
- nextPageNumber(): number | null;
198
- previousPageNumber(): number | null;
199
- startIndex(): number;
200
- endIndex(): number;
201
- }
202
- interface Paginator<TModel extends Record<string, unknown>, TResult = TModel, TResponse extends PaginatedResponse<TResult> = PaginatedResponse<TResult>> {
203
- parse(params: TangoQueryParams): void;
204
- apply<TBaseResult extends Record<string, unknown>, TSourceModel, THydrated extends Record<string, unknown>>(queryset: QuerySet<TModel, TBaseResult, TSourceModel, THydrated>): QuerySet<TModel, TBaseResult, TSourceModel, THydrated>;
205
- needsTotalCount(): boolean;
206
- toResponse(results: readonly TResult[] | QueryResult<TResult>, context?: {
207
- totalCount?: number;
208
- params?: TangoQueryParams;
209
- }): TResponse;
210
- }
211
- //#endregion
212
- //#region src/paginators/OffsetPaginator.d.ts
213
- /**
214
- * Offset/limit paginator modelled after DRF's LimitOffsetPagination.
215
- * Handles parsing limit/offset/page from URL query params and building
216
- * the paginated response envelope with next/previous links.
217
- *
218
- * @example
219
- * ```typescript
220
- * const paginator = new OffsetPaginator(queryset);
221
- * const { limit, offset } = paginator.parseParams(searchParams);
222
- * const results = await queryset.limit(limit).offset(offset).fetchAll();
223
- * const response = paginator.getPaginatedResponse(results, totalCount);
224
- * ```
225
- */
226
- declare class OffsetPaginator<T extends Record<string, unknown>> extends BasePaginator implements Paginator<T, T, OffsetPaginatedResponse<T>> {
227
- private queryset;
228
- private perPage;
229
- static readonly BRAND: "tango.resources.offset_paginator";
230
- readonly __tangoBrand: typeof OffsetPaginator.BRAND;
231
- private limit;
232
- private offset;
233
- constructor(queryset: QuerySet<T>, perPage?: number);
234
- /**
235
- * Narrow an unknown value to `OffsetPaginator`.
236
- */
237
- static isOffsetPaginator<T extends Record<string, unknown>>(value: unknown): value is OffsetPaginator<T>;
238
- /**
239
- * Parse limit, offset, and page from Tango query params.
240
- * If `page` is provided, it's converted to an offset.
241
- * Stores parsed values for use by getPaginatedResponse.
242
- */
243
- parse(params: TangoQueryParams): void;
244
- /**
245
- * Parse params and return `{ limit, offset }` for compatibility callers.
246
- */
247
- parseParams(params: TangoQueryParams): {
248
- limit: number;
249
- offset: number;
250
- };
251
- /**
252
- * Build a DRF-style paginated response with count, next, and previous links.
253
- * Uses the limit/offset stored from the most recent parseParams call.
254
- */
255
- needsTotalCount(): boolean;
256
- toResponse<TResult>(results: readonly TResult[] | QueryResult<TResult>, context?: {
257
- totalCount?: number;
258
- params?: TangoQueryParams;
259
- }): OffsetPaginatedResponse<TResult>;
260
- /**
261
- * Backward-compatible alias for `toResponse`.
262
- */
263
- getPaginatedResponse<TResult>(results: readonly TResult[] | QueryResult<TResult>, totalCount?: number, params?: TangoQueryParams): OffsetPaginatedResponse<TResult>;
264
- /**
265
- * Apply current limit/offset to a queryset.
266
- */
267
- apply<TBaseResult extends Record<string, unknown>, TSourceModel, THydrated extends Record<string, unknown>>(queryset: QuerySet<T, TBaseResult, TSourceModel, THydrated>): QuerySet<T, TBaseResult, TSourceModel, THydrated>;
268
- /**
269
- * Fetch a 1-based page number from the bound queryset.
270
- */
271
- paginate(page: number): Promise<Page<T>>;
272
- /**
273
- * Fetch a 1-based page and return page metadata.
274
- */
275
- getPage(page: number): Promise<Page<T>>;
276
- /**
277
- * Count total rows for the current queryset state.
278
- */
279
- count(): Promise<number>;
280
- private buildPageLink;
281
- }
282
- //#endregion
283
- //#region src/paginators/CursorPaginator.d.ts
284
- /**
285
- * Cursor-based paginator for stable forward navigation with opaque cursor tokens.
286
- * It supports `limit`, `cursor`, and `ordering` query params and returns DRF-style
287
- * paginated envelopes with cursor links.
288
- */
289
- declare class CursorPaginator<T extends Record<string, unknown>> extends BasePaginator implements Paginator<T, T, CursorPaginatedResponse<T>> {
290
- private queryset;
291
- private perPage;
292
- private cursorField;
293
- static readonly BRAND: "tango.resources.cursor_paginator";
294
- readonly __tangoBrand: typeof CursorPaginator.BRAND;
295
- private limit;
296
- private cursor;
297
- private direction;
298
- private nextCursor;
299
- private previousCursor;
300
- constructor(queryset: QuerySet<T>, perPage?: number, cursorField?: keyof T);
301
- /**
302
- * Narrow an unknown value to `CursorPaginator`.
303
- */
304
- static isCursorPaginator<T extends Record<string, unknown>>(value: unknown): value is CursorPaginator<T>;
305
- /**
306
- * Parse cursor pagination parameters from Tango query params.
307
- */
308
- parse(params: TangoQueryParams): void;
309
- /**
310
- * Parse params and return compatibility `{ limit, offset }` shape.
311
- */
312
- parseParams(params: TangoQueryParams): {
313
- limit: number;
314
- offset: number;
315
- };
316
- /**
317
- * Build a paginated response payload with cursor links.
318
- */
319
- needsTotalCount(): boolean;
320
- toResponse<TResult>(results: readonly TResult[] | QueryResult<TResult>, _context?: {
321
- totalCount?: number;
322
- params?: TangoQueryParams;
323
- }): CursorPaginatedResponse<TResult>;
324
- /**
325
- * Backward-compatible alias for `toResponse`.
326
- */
327
- getPaginatedResponse<TResult>(results: readonly TResult[] | QueryResult<TResult>, _totalCount?: number): CursorPaginatedResponse<TResult>;
328
- /**
329
- * Apply cursor constraints and ordering to a queryset.
330
- */
331
- apply<TBaseResult extends Record<string, unknown>, TSourceModel, THydrated extends Record<string, unknown>>(queryset: QuerySet<T, TBaseResult, TSourceModel, THydrated>): QuerySet<T, TBaseResult, TSourceModel, THydrated>;
332
- /**
333
- * Fetch the next cursor page.
334
- */
335
- paginate(cursor?: string): Promise<Page<T>>;
336
- /**
337
- * Cursor paginators only support page `1` as an entry point.
338
- */
339
- getPage(page: number): Promise<Page<T>>;
340
- private buildPageLink;
341
- private encodeCursor;
342
- private decodeCursor;
343
- }
344
- //#endregion
345
- //#region src/pagination/OffsetPaginationInput.d.ts
346
- type OffsetPaginationInputValue = {
347
- limit: number;
348
- offset: number;
349
- page?: number;
350
- };
351
- declare const OffsetPaginationInput: z.ZodType<OffsetPaginationInputValue>;
352
- //#endregion
353
- //#region src/pagination/CursorPaginationInput.d.ts
354
- type CursorPaginationInputValue = {
355
- limit?: number;
356
- cursor: string | null;
357
- ordering?: string;
358
- };
359
- declare const CursorPaginationInput: z.ZodType<CursorPaginationInputValue>;
360
- declare namespace index_d_exports$3 {
361
- export { BasePaginatedResponse, BasePaginator, CursorPaginatedResponse, CursorPaginationInput, CursorPaginationInputValue, CursorPaginator, OffsetPaginatedResponse, OffsetPaginationInput, OffsetPaginationInputValue, OffsetPaginator, Page, PaginatedResponse, Paginator };
362
- }
363
- //#endregion
364
- //#region src/resource/ResourceModelLike.d.ts
365
- type ResourceModelFieldMetadata = {
366
- name: string;
367
- type: string;
368
- notNull?: boolean;
369
- default?: unknown;
370
- primaryKey?: boolean;
371
- };
372
- type ResourceModelMetadata = {
373
- name: string;
374
- fields: ResourceModelFieldMetadata[];
375
- };
376
- type ResourceModelLike<TModel extends Record<string, unknown>, TModelRecord extends Record<string, unknown> = TModel> = {
377
- /**
378
- * Resource-layer contracts own the outward representation. The underlying
379
- * model may materialize a richer ORM record, so the manager record type is kept
380
- * separate from the serializer-facing model shape.
381
- */
382
- readonly objects: ManagerLike<TModelRecord>;
383
- readonly metadata?: ResourceModelMetadata;
384
- readonly __tangoModelShape?: TModel;
385
- };
386
- //#endregion
387
- //#region src/view/APIView.d.ts
388
- type APIViewMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
389
- /**
390
- * Lightweight class-based request dispatcher for non-model API endpoints.
391
- */
392
- declare abstract class APIView {
393
- static readonly BRAND: "tango.resources.api_view";
394
- readonly __tangoBrand: typeof APIView.BRAND;
395
- /**
396
- * Narrow an unknown value to `APIView`.
397
- */
398
- static isAPIView(value: unknown): value is APIView;
399
- /**
400
- * Dispatch the request to the handler for the current HTTP method.
401
- */
402
- dispatch(ctx: RequestContext): Promise<TangoResponse>;
403
- getAllowedMethods(): readonly APIViewMethod[];
404
- protected get(_ctx: RequestContext): Promise<TangoResponse>;
405
- protected post(_ctx: RequestContext): Promise<TangoResponse>;
406
- protected put(_ctx: RequestContext): Promise<TangoResponse>;
407
- protected patch(_ctx: RequestContext): Promise<TangoResponse>;
408
- protected delete(_ctx: RequestContext): Promise<TangoResponse>;
409
- protected httpMethodNotAllowed(): TangoResponse;
410
- private getMethodHandler;
411
- }
412
- //#endregion
413
- //#region src/serializer/Serializer.d.ts
414
- type SerializerSchema = z.ZodTypeAny;
415
- type SerializerClass<TCreateSchema extends SerializerSchema = SerializerSchema, TUpdateSchema extends SerializerSchema = SerializerSchema, TOutputSchema extends SerializerSchema = SerializerSchema, TRecord = unknown> = {
416
- new (): Serializer<TCreateSchema, TUpdateSchema, TOutputSchema, TRecord>;
417
- readonly createSchema: TCreateSchema;
418
- readonly updateSchema: TUpdateSchema;
419
- readonly outputSchema: TOutputSchema;
420
- readonly outputResolvers?: SerializerOutputResolvers<TRecord>;
421
- };
422
- type AnySerializerClass = SerializerClass<SerializerSchema, SerializerSchema, SerializerSchema, any>;
423
- type SerializerCreateInput<TSerializer extends AnySerializerClass> = z.output<TSerializer['createSchema']>;
424
- type SerializerUpdateInput<TSerializer extends AnySerializerClass> = z.output<TSerializer['updateSchema']>;
425
- type SerializerOutput<TSerializer extends AnySerializerClass> = z.output<TSerializer['outputSchema']>;
426
- type SerializerOutputResolver<TRecord = unknown> = (record: TRecord) => unknown | Promise<unknown>;
427
- type SerializerOutputResolvers<TRecord = unknown> = Record<string, SerializerOutputResolver<TRecord>>;
428
- /**
429
- * DRF-inspired base serializer backed by Zod schemas.
430
- *
431
- * Tango serializers keep Zod as the source of truth for validation and type
432
- * inference while centralizing create, update, and representation workflows in
433
- * one class-owned contract.
434
- */
435
- declare abstract class Serializer<TCreateSchema extends SerializerSchema, TUpdateSchema extends SerializerSchema, TOutputSchema extends SerializerSchema, TRecord = unknown> {
436
- static readonly createSchema: SerializerSchema;
437
- static readonly updateSchema: SerializerSchema;
438
- static readonly outputSchema: SerializerSchema;
439
- static readonly outputResolvers: SerializerOutputResolvers< // oxlint-disable-next-line typescript/no-explicit-any
440
- any> | undefined;
441
- /**
442
- * Return the serializer class for the current instance.
443
- */
444
- getSerializerClass(): SerializerClass<TCreateSchema, TUpdateSchema, TOutputSchema, TRecord>;
445
- /**
446
- * Return the Zod schema used for create payloads.
447
- */
448
- getCreateSchema(): TCreateSchema;
449
- /**
450
- * Return the Zod schema used for update payloads.
451
- */
452
- getUpdateSchema(): TUpdateSchema;
453
- /**
454
- * Return the Zod schema used for serialized output.
455
- */
456
- getOutputSchema(): TOutputSchema;
457
- /**
458
- * Return the resolver map used to enrich serializer output fields before
459
- * the outward Zod schema parses the final response shape.
460
- */
461
- getOutputResolvers(): SerializerOutputResolvers<TRecord>;
462
- /**
463
- * Validate unknown input for create workflows.
464
- */
465
- deserializeCreate(input: unknown): z.output<TCreateSchema>;
466
- /**
467
- * Validate unknown input for update workflows.
468
- */
469
- deserializeUpdate(input: unknown): z.output<TUpdateSchema>;
470
- /**
471
- * Convert a persisted record into its outward-facing representation.
472
- *
473
- * @deprecated Use `serialize(...)` instead so serializer-owned output
474
- * resolvers run before the outward Zod schema parses the response shape.
475
- */
476
- toRepresentation(record: TRecord): z.output<TOutputSchema>;
477
- /**
478
- * Resolve serializer-owned output fields and parse the outward response
479
- * contract.
480
- */
481
- serialize(record: TRecord): Promise<z.output<TOutputSchema>>;
482
- /**
483
- * Serialize many records through the same outward response contract.
484
- */
485
- serializeMany(records: readonly TRecord[]): Promise<z.output<TOutputSchema>[]>;
486
- private applyOutputResolvers;
487
- }
488
- //#endregion
489
- //#region src/serializer/internal/InternalSerializerRelationKind.d.ts
490
- declare const InternalSerializerRelationKind: {
491
- readonly MANY_TO_MANY: "manyToMany";
492
- };
493
- declare const InternalManyToManyReadStrategyKind: {
494
- readonly PK_LIST: "pkList";
495
- readonly NESTED: "nested";
496
- };
497
- declare const InternalManyToManyWriteStrategyKind: {
498
- readonly PK_LIST: "pkList";
499
- readonly SLUG_LIST: "slugList";
500
- };
501
- //#endregion
502
- //#region src/serializer/relation.d.ts
503
- type AnyRecord = Record<string, unknown>;
504
- type ManyToManyManagerKeys<TRecord extends AnyRecord> = Extract<{ [K in keyof TRecord]: TRecord[K] extends ManyToManyRelatedManager<AnyRecord> ? K : never }[keyof TRecord], string>;
505
- type ManyToManyTargetRow<TRecord extends AnyRecord, TFieldName extends ManyToManyManagerKeys<TRecord>> = TRecord[TFieldName] extends ManyToManyRelatedManager<infer TTarget extends AnyRecord> ? TTarget : never;
506
- type ManyToManyPkListStrategy = {
507
- kind: typeof InternalManyToManyReadStrategyKind.PK_LIST | typeof InternalManyToManyWriteStrategyKind.PK_LIST;
508
- };
509
- type ManyToManyNestedStrategy = {
510
- kind: typeof InternalManyToManyReadStrategyKind.NESTED;
511
- schema: z.ZodTypeAny;
512
- };
513
- type ManyToManySlugListStrategy<TTarget extends AnyRecord> = {
514
- kind: typeof InternalManyToManyWriteStrategyKind.SLUG_LIST;
515
- model: ResourceModelLike<any, any>;
516
- lookupField: Extract<keyof TTarget, string>;
517
- createIfMissing?: boolean;
518
- buildCreateInput?: (value: string) => Partial<TTarget>;
519
- };
520
- type ManyToManyReadStrategy = ManyToManyPkListStrategy | ManyToManyNestedStrategy;
521
- type ManyToManyWriteStrategy<TTarget extends AnyRecord> = ManyToManyPkListStrategy | ManyToManySlugListStrategy<TTarget>;
522
- type ManyToManyRelationField<TRecord extends AnyRecord, TFieldName extends ManyToManyManagerKeys<TRecord>> = {
523
- kind: typeof InternalSerializerRelationKind.MANY_TO_MANY;
524
- read: ManyToManyReadStrategy;
525
- write: ManyToManyWriteStrategy<ManyToManyTargetRow<TRecord, TFieldName>>;
526
- };
527
- type ModelSerializerRelationFields<TRecord extends AnyRecord> = Partial<{ [K in ManyToManyManagerKeys<TRecord>]: ManyToManyRelationField<TRecord, K> }>;
528
- declare function pkList(): ManyToManyPkListStrategy;
529
- declare function nested(schema: z.ZodTypeAny): ManyToManyNestedStrategy;
530
- declare function slugList<TTarget extends AnyRecord>(options: Omit<ManyToManySlugListStrategy<TTarget>, 'kind'>): ManyToManySlugListStrategy<TTarget>;
531
- declare function manyToMany(config?: Partial<Pick<ManyToManyRelationField<any, any>, 'read' | 'write'>>): ManyToManyRelationField<any, any>;
532
- type RelationHelpers = {
533
- manyToMany: typeof manyToMany;
534
- pkList: typeof pkList;
535
- nested: typeof nested;
536
- slugList: typeof slugList;
537
- };
538
- declare const relation: RelationHelpers;
539
- //#endregion
540
- //#region src/serializer/ModelSerializer.d.ts
541
- type ModelSerializerClass<TModel extends Record<string, unknown> = Record<string, unknown>, TCreateSchema extends SerializerSchema = SerializerSchema, TUpdateSchema extends SerializerSchema = SerializerSchema, TOutputSchema extends SerializerSchema = SerializerSchema, TModelRecord extends Record<string, unknown> = TModel> = SerializerClass<TCreateSchema, TUpdateSchema, TOutputSchema, TModelRecord> & {
542
- new (): ModelSerializer<TModel, TCreateSchema, TUpdateSchema, TOutputSchema, TModelRecord>;
543
- readonly model?: ResourceModelLike<TModel, TModelRecord>;
544
- readonly relationFields?: ModelSerializerRelationFields<TModelRecord>;
545
- };
546
- type AnyModelSerializer<TModel extends Record<string, unknown> = Record<string, unknown>> = ModelSerializerClass<TModel, SerializerSchema, SerializerSchema, SerializerSchema, any>;
547
- type AnyModelSerializerClass = AnyModelSerializer;
548
- /**
549
- * Zod-backed serializer with default model-manager persistence behavior.
550
- */
551
- declare abstract class ModelSerializer<TModel extends Record<string, unknown>, TCreateSchema extends SerializerSchema, TUpdateSchema extends SerializerSchema, TOutputSchema extends SerializerSchema, TModelRecord extends Record<string, unknown> = TModel> extends Serializer<TCreateSchema, TUpdateSchema, TOutputSchema, TModelRecord> {
552
- static readonly model?: unknown;
553
- static readonly relationFields: ModelSerializerRelationFields<Record<string, unknown>> | undefined;
554
- /**
555
- * Return the Tango model backing this serializer.
556
- */
557
- getModel(): ResourceModelLike<TModel, TModelRecord>;
558
- /**
559
- * Return the manager used for create and update workflows.
560
- */
561
- getManager(): ManagerLike<TModelRecord>;
562
- /**
563
- * Return the declarative relation-field map for this serializer.
564
- */
565
- getRelationFields(): ModelSerializerRelationFields<TModelRecord>;
566
- /**
567
- * Merge relation-field read resolvers into the serializer output path.
568
- */
569
- getOutputResolvers(): SerializerOutputResolvers<TModelRecord>;
570
- /**
571
- * Validate, enrich, persist, and serialize a create workflow.
572
- */
573
- create(input: unknown): Promise<SerializerOutput<ModelSerializerClass<TModel, TCreateSchema, TUpdateSchema, TOutputSchema, TModelRecord>>>;
574
- /**
575
- * Validate, enrich, persist, and serialize an update workflow.
576
- */
577
- update(id: TModelRecord[keyof TModelRecord], input: unknown): Promise<SerializerOutput<ModelSerializerClass<TModel, TCreateSchema, TUpdateSchema, TOutputSchema, TModelRecord>>>;
578
- /**
579
- * Override to normalize create input for this resource workflow before the
580
- * manager call.
581
- *
582
- * Model-owned persistence rules belong in model hooks so they also run for
583
- * scripts and direct manager usage.
584
- */
585
- protected beforeCreate(data: SerializerCreateInput<ModelSerializerClass<TModel, TCreateSchema, TUpdateSchema, TOutputSchema, TModelRecord>>): Promise<Partial<TModelRecord>>;
586
- /**
587
- * Override to normalize update input for this resource workflow before the
588
- * manager call.
589
- *
590
- * Model-owned persistence rules belong in model hooks so they also run for
591
- * scripts and direct manager usage.
592
- */
593
- protected beforeUpdate(_id: TModelRecord[keyof TModelRecord], data: SerializerUpdateInput<ModelSerializerClass<TModel, TCreateSchema, TUpdateSchema, TOutputSchema, TModelRecord>>): Promise<Partial<TModelRecord>>;
594
- private extractRelationWrites;
595
- private stripRelationFields;
596
- private applyRelationWrites;
597
- private serializeRelationField;
598
- private syncManyToManyRelation;
599
- private resolveWriteTargets;
600
- private getManyToManyManager;
601
- private getManyToManyRelationMeta;
602
- }
603
- declare namespace index_d_exports$2 {
604
- export { AnyModelSerializer, AnyModelSerializerClass, AnySerializerClass, ManyToManyManagerKeys, ManyToManyReadStrategy, ManyToManyRelationField, ManyToManyWriteStrategy, ModelSerializer, ModelSerializerClass, ModelSerializerRelationFields, Serializer, SerializerClass, SerializerCreateInput, SerializerOutput, SerializerOutputResolver, SerializerOutputResolvers, SerializerSchema, SerializerUpdateInput, relation };
605
- }
606
- //#endregion
607
- //#region src/viewset/ModelViewSet.d.ts
608
- type ViewSetActionScope = 'detail' | 'collection';
609
- type ViewSetActionMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
610
- interface ViewSetActionDescriptor {
611
- name: string;
612
- scope: ViewSetActionScope;
613
- methods: readonly ViewSetActionMethod[];
614
- path?: string;
615
- }
616
- interface ResolvedViewSetActionDescriptor extends ViewSetActionDescriptor {
617
- path: string;
618
- }
619
- type AnyModelViewSet = ModelViewSet<Record<string, unknown>, AnyModelSerializerClass>;
620
- type SearchFieldRef$2<TModel extends Record<string, unknown>> = Extract<keyof TModel, string> | string;
621
- /**
622
- * Configuration for a ModelViewSet, defining how a serializer-backed model is exposed as an API resource.
623
- */
624
- interface ModelViewSetConfig<TModel extends Record<string, unknown>, TSerializer extends AnyModelSerializer<TModel>> {
625
- /** Serializer class that owns validation, representation, and persistence hooks */
626
- serializer: TSerializer;
627
- /** Optional filter set defining which query parameters can filter the list endpoint */
628
- filters?: FilterSet<TModel>;
629
- /** Fields that clients are allowed to sort by via query parameters */
630
- orderingFields?: (keyof TModel)[];
631
- /** Fields that are searched when a free-text search query parameter is provided */
632
- searchFields?: SearchFieldRef$2<TModel>[];
633
- /** Optional paginator factory used by list endpoints. */
634
- paginatorFactory?: (queryset: QuerySet<TModel>) => Paginator<TModel, SerializerOutput<TSerializer>>;
635
- }
636
- /**
637
- * Base class for creating RESTful API viewsets with built-in CRUD operations.
638
- * Provides list, retrieve, create, update, and delete methods with filtering,
639
- * search, pagination, and ordering support.
640
- */
641
- declare abstract class ModelViewSet<TModel extends Record<string, unknown>, TSerializer extends AnyModelSerializer<TModel>> {
642
- static readonly BRAND: "tango.resources.model_view_set";
643
- static readonly actions: readonly ViewSetActionDescriptor[];
644
- readonly __tangoBrand: typeof ModelViewSet.BRAND;
645
- protected readonly serializerClass: TSerializer;
646
- protected readonly filters?: FilterSet<TModel>;
647
- protected readonly orderingFields: (keyof TModel)[];
648
- protected readonly searchFields: SearchFieldRef$2<TModel>[];
649
- protected readonly paginatorFactory?: (queryset: QuerySet<TModel>) => Paginator<TModel, SerializerOutput<TSerializer>>;
650
- private serializer?;
651
- constructor(config: ModelViewSetConfig<TModel, TSerializer>);
652
- /**
653
- * Return the custom action descriptors declared by a viewset or constructor.
654
- */
655
- static getActions(viewsetOrConstructor: AnyModelViewSet | (new (...args: never[]) => AnyModelViewSet)): readonly ResolvedViewSetActionDescriptor[];
656
- /**
657
- * Narrow an unknown value to `ModelViewSet`.
658
- */
659
- static isModelViewSet(value: unknown): value is ModelViewSet<Record<string, unknown>, AnyModelSerializerClass>;
660
- /**
661
- * Preserve literal action inference while validating the descriptor shape.
662
- */
663
- static defineViewSetActions<const T extends readonly ViewSetActionDescriptor[]>(actions: T): T;
664
- private static resolvePathFromDescriptor;
665
- private static toKebabCase;
666
- /**
667
- * Return the serializer class that owns this resource contract.
668
- */
669
- getSerializerClass(): TSerializer;
670
- /**
671
- * Return the serializer instance for the current resource.
672
- */
673
- getSerializer(): InstanceType<TSerializer>;
674
- /**
675
- * Describe the public HTTP contract that this resource contributes to OpenAPI generation.
676
- */
677
- describeOpenAPI(): ModelViewSetOpenAPIDescription<TModel, TSerializer>;
678
- /**
679
- * List endpoint with filtering, search, ordering, and offset pagination.
680
- */
681
- list(ctx: RequestContext): Promise<TangoResponse>;
682
- /**
683
- * Retrieve endpoint for a single resource by id.
684
- */
685
- retrieve(_ctx: RequestContext, id: string): Promise<TangoResponse>;
686
- /**
687
- * Create endpoint: validate input, persist, and return serialized output.
688
- */
689
- create(ctx: RequestContext): Promise<TangoResponse>;
690
- /**
691
- * Update endpoint: validate partial payload and persist by id.
692
- */
693
- update(ctx: RequestContext, id: string): Promise<TangoResponse>;
694
- /**
695
- * Destroy endpoint: delete a resource by id.
696
- */
697
- destroy(_ctx: RequestContext, id: string): Promise<TangoResponse>;
698
- protected getPaginator(queryset: QuerySet<TModel>): Paginator<TModel, SerializerOutput<TSerializer>>;
699
- protected getManager(): ManagerLike<TModel>;
700
- /**
701
- * Convert thrown errors into normalized HTTP responses.
702
- */
703
- protected handleError(error: unknown): TangoResponse;
704
- /**
705
- * Resolve route path segment(s) for a custom action.
706
- * Override this in subclasses to customize path derivation globally.
707
- */
708
- protected resolveActionPath(action: ViewSetActionDescriptor): string;
709
- private requireModelMetadata;
710
- private getLookupFieldFromMetadata;
711
- }
712
- //#endregion
713
- //#region src/resource/OpenAPIDescription.d.ts
714
- type SearchFieldRef$1<TModel extends Record<string, unknown>> = Extract<keyof TModel, string> | string;
715
- type GenericAPIViewOpenAPIDescription<TModel extends Record<string, unknown>, TSerializer extends AnyModelSerializer<TModel> = AnyModelSerializer<TModel>> = {
716
- model: ResourceModelLike<TModel> & {
717
- metadata: NonNullable<ResourceModelLike<TModel>['metadata']>;
718
- };
719
- outputSchema: TSerializer['outputSchema'];
720
- createSchema: TSerializer['createSchema'];
721
- updateSchema: TSerializer['updateSchema'];
722
- searchFields: readonly SearchFieldRef$1<TModel>[];
723
- orderingFields: readonly (keyof TModel)[];
724
- lookupField: keyof TModel;
725
- lookupParam: string;
726
- allowedMethods: readonly APIViewMethod[];
727
- usesDefaultOffsetPagination: boolean;
728
- };
729
- type ModelViewSetOpenAPIDescription<TModel extends Record<string, unknown>, TSerializer extends AnyModelSerializer<TModel> = AnyModelSerializer<TModel>> = GenericAPIViewOpenAPIDescription<TModel, TSerializer> & {
730
- actions: readonly ResolvedViewSetActionDescriptor[];
731
- };
732
- declare namespace index_d_exports$1 {
733
- export { GenericAPIViewOpenAPIDescription, ModelViewSetOpenAPIDescription, ResourceModelFieldMetadata, ResourceModelLike, ResourceModelMetadata };
734
- }
735
- //#endregion
736
- //#region src/view/GenericAPIView.d.ts
737
- type SearchFieldRef<TModel extends Record<string, unknown>> = Extract<keyof TModel, string> | string;
738
- interface GenericAPIViewConfig<TModel extends Record<string, unknown>, TSerializer extends AnyModelSerializer<TModel>> {
739
- serializer: TSerializer;
740
- filters?: FilterSet<TModel>;
741
- orderingFields?: (keyof TModel)[];
742
- searchFields?: SearchFieldRef<TModel>[];
743
- lookupField?: keyof TModel;
744
- lookupParam?: string;
745
- paginatorFactory?: (queryset: QuerySet<TModel>) => Paginator<TModel, SerializerOutput<TSerializer>>;
746
- }
747
- /**
748
- * Generic API base class that centralizes query/build/validation helpers.
749
- */
750
- declare abstract class GenericAPIView<TModel extends Record<string, unknown>, TSerializer extends AnyModelSerializer<TModel>> extends APIView {
751
- protected readonly serializerClass: TSerializer;
752
- protected readonly filters?: FilterSet<TModel>;
753
- protected readonly orderingFields: readonly (keyof TModel)[];
754
- protected readonly searchFields: readonly SearchFieldRef<TModel>[];
755
- protected readonly lookupField?: keyof TModel;
756
- protected readonly lookupParam: string;
757
- protected readonly paginatorFactory?: (queryset: QuerySet<TModel>) => Paginator<TModel, SerializerOutput<TSerializer>>;
758
- private serializer?;
759
- constructor(config: GenericAPIViewConfig<TModel, TSerializer>);
760
- /**
761
- * Return the serializer class that owns this resource contract.
762
- */
763
- getSerializerClass(): TSerializer;
764
- /**
765
- * Return the serializer instance for the current resource.
766
- */
767
- getSerializer(): InstanceType<TSerializer>;
768
- /**
769
- * Describe the public HTTP contract that this resource contributes to OpenAPI generation.
770
- */
771
- describeOpenAPI(): GenericAPIViewOpenAPIDescription<TModel, TSerializer>;
772
- protected getManager(): ManagerLike<TModel>;
773
- protected getOutputSchema(): TSerializer['outputSchema'];
774
- protected getCreateSchema(): TSerializer['createSchema'];
775
- protected getUpdateSchema(): TSerializer['updateSchema'];
776
- protected getLookupField(): keyof TModel;
777
- protected getLookupValue(ctx: RequestContext): string | null;
778
- protected getPaginator(queryset: QuerySet<TModel>): Paginator<TModel, SerializerOutput<TSerializer>>;
779
- protected performList(ctx: RequestContext): Promise<TangoResponse>;
780
- protected performCreate(ctx: RequestContext): Promise<TangoResponse>;
781
- protected performRetrieve(ctx: RequestContext): Promise<TangoResponse>;
782
- protected performUpdate(ctx: RequestContext): Promise<TangoResponse>;
783
- protected performDestroy(ctx: RequestContext): Promise<TangoResponse>;
784
- protected handleError(error: unknown): TangoResponse;
785
- private requireModelMetadata;
786
- private getLookupFieldFromMetadata;
787
- }
788
- //#endregion
789
- //#region src/view/mixins/ListModelMixin.d.ts
790
- /**
791
- * Mixin that wires `GET` requests to the generic list implementation.
792
- */
793
- declare abstract class ListModelMixin<TModel extends Record<string, unknown>, TSerializer extends AnyModelSerializer<TModel>> extends GenericAPIView<TModel, TSerializer> {
794
- protected list(ctx: RequestContext): Promise<TangoResponse>;
795
- protected get(ctx: RequestContext): Promise<TangoResponse>;
796
- }
797
- //#endregion
798
- //#region src/view/mixins/CreateModelMixin.d.ts
799
- /**
800
- * Mixin that wires `POST` requests to the generic create implementation.
801
- */
802
- declare abstract class CreateModelMixin<TModel extends Record<string, unknown>, TSerializer extends AnyModelSerializer<TModel>> extends GenericAPIView<TModel, TSerializer> {
803
- protected create(ctx: RequestContext): Promise<TangoResponse>;
804
- protected post(ctx: RequestContext): Promise<TangoResponse>;
805
- }
806
- //#endregion
807
- //#region src/view/mixins/RetrieveModelMixin.d.ts
808
- /**
809
- * Mixin that wires `GET` requests to the generic retrieve implementation.
810
- */
811
- declare abstract class RetrieveModelMixin<TModel extends Record<string, unknown>, TSerializer extends AnyModelSerializer<TModel>> extends GenericAPIView<TModel, TSerializer> {
812
- protected retrieve(ctx: RequestContext): Promise<TangoResponse>;
813
- protected get(ctx: RequestContext): Promise<TangoResponse>;
814
- }
815
- //#endregion
816
- //#region src/view/mixins/UpdateModelMixin.d.ts
817
- /**
818
- * Mixin that wires `PUT` and `PATCH` requests to the generic update implementation.
819
- */
820
- declare abstract class UpdateModelMixin<TModel extends Record<string, unknown>, TSerializer extends AnyModelSerializer<TModel>> extends GenericAPIView<TModel, TSerializer> {
821
- protected update(ctx: RequestContext): Promise<TangoResponse>;
822
- protected put(ctx: RequestContext): Promise<TangoResponse>;
823
- protected patch(ctx: RequestContext): Promise<TangoResponse>;
824
- }
825
- //#endregion
826
- //#region src/view/mixins/DestroyModelMixin.d.ts
827
- /**
828
- * Mixin that wires `DELETE` requests to the generic destroy implementation.
829
- */
830
- declare abstract class DestroyModelMixin<TModel extends Record<string, unknown>, TSerializer extends AnyModelSerializer<TModel>> extends GenericAPIView<TModel, TSerializer> {
831
- protected destroy(ctx: RequestContext): Promise<TangoResponse>;
832
- protected delete(ctx: RequestContext): Promise<TangoResponse>;
833
- }
834
- //#endregion
835
- //#region src/view/generics/ListAPIView.d.ts
836
- /**
837
- * Generic API view for endpoints that only expose a list operation.
838
- */
839
- declare abstract class ListAPIView<TModel extends Record<string, unknown>, TSerializer extends AnyModelSerializer<TModel>> extends ListModelMixin<TModel, TSerializer> {
840
- protected get(ctx: RequestContext): Promise<TangoResponse>;
841
- }
842
- //#endregion
843
- //#region src/view/generics/CreateAPIView.d.ts
844
- /**
845
- * Generic API view for endpoints that only support resource creation.
846
- */
847
- declare abstract class CreateAPIView<TModel extends Record<string, unknown>, TSerializer extends AnyModelSerializer<TModel>> extends CreateModelMixin<TModel, TSerializer> {
848
- protected post(ctx: RequestContext): Promise<TangoResponse>;
849
- }
850
- //#endregion
851
- //#region src/view/generics/RetrieveAPIView.d.ts
852
- /**
853
- * Generic API view for endpoints that retrieve a single resource by lookup.
854
- */
855
- declare abstract class RetrieveAPIView<TModel extends Record<string, unknown>, TSerializer extends AnyModelSerializer<TModel>> extends RetrieveModelMixin<TModel, TSerializer> {
856
- protected get(ctx: RequestContext): Promise<TangoResponse>;
857
- }
858
- //#endregion
859
- //#region src/view/generics/ListCreateAPIView.d.ts
860
- /**
861
- * Generic API view for collection endpoints that list and create resources.
862
- */
863
- declare abstract class ListCreateAPIView<TModel extends Record<string, unknown>, TSerializer extends AnyModelSerializer<TModel>> extends GenericAPIView<TModel, TSerializer> {
864
- protected get(ctx: RequestContext): Promise<TangoResponse>;
865
- protected post(ctx: RequestContext): Promise<TangoResponse>;
866
- }
867
- //#endregion
868
- //#region src/view/generics/RetrieveUpdateAPIView.d.ts
869
- /**
870
- * Generic API view for endpoints that retrieve and update a single resource.
871
- */
872
- declare abstract class RetrieveUpdateAPIView<TModel extends Record<string, unknown>, TSerializer extends AnyModelSerializer<TModel>> extends GenericAPIView<TModel, TSerializer> {
873
- protected get(ctx: RequestContext): Promise<TangoResponse>;
874
- protected put(ctx: RequestContext): Promise<TangoResponse>;
875
- protected patch(ctx: RequestContext): Promise<TangoResponse>;
876
- }
877
- //#endregion
878
- //#region src/view/generics/RetrieveDestroyAPIView.d.ts
879
- /**
880
- * Generic API view for endpoints that retrieve and delete a single resource.
881
- */
882
- declare abstract class RetrieveDestroyAPIView<TModel extends Record<string, unknown>, TSerializer extends AnyModelSerializer<TModel>> extends GenericAPIView<TModel, TSerializer> {
883
- protected get(ctx: RequestContext): Promise<TangoResponse>;
884
- protected delete(ctx: RequestContext): Promise<TangoResponse>;
885
- }
886
- //#endregion
887
- //#region src/view/generics/RetrieveUpdateDestroyAPIView.d.ts
888
- /**
889
- * Generic API view for full detail endpoints that retrieve, update, and delete.
890
- */
891
- declare abstract class RetrieveUpdateDestroyAPIView<TModel extends Record<string, unknown>, TSerializer extends AnyModelSerializer<TModel>> extends GenericAPIView<TModel, TSerializer> {
892
- protected get(ctx: RequestContext): Promise<TangoResponse>;
893
- protected put(ctx: RequestContext): Promise<TangoResponse>;
894
- protected patch(ctx: RequestContext): Promise<TangoResponse>;
895
- protected delete(ctx: RequestContext): Promise<TangoResponse>;
896
- }
897
- declare namespace index_d_exports {
898
- export { APIView, APIViewMethod, CreateAPIView, CreateModelMixin, DestroyModelMixin, GenericAPIView, GenericAPIViewConfig, GenericAPIViewOpenAPIDescription, ListAPIView, ListCreateAPIView, ListModelMixin, RetrieveAPIView, RetrieveDestroyAPIView, RetrieveModelMixin, RetrieveUpdateAPIView, RetrieveUpdateDestroyAPIView, UpdateModelMixin };
899
- }
900
- //#endregion
901
- export { Page as $, ManyToManyManagerKeys as A, SerializerOutput as B, ViewSetActionMethod as C, AnyModelSerializerClass as D, AnyModelSerializer as E, relation as F, ResourceModelFieldMetadata as G, SerializerUpdateInput as H, AnySerializerClass as I, index_d_exports$3 as J, ResourceModelLike as K, Serializer as L, ManyToManyRelationField as M, ManyToManyWriteStrategy as N, ModelSerializer as O, ModelSerializerRelationFields as P, OffsetPaginator as Q, SerializerClass as R, ViewSetActionDescriptor as S, index_d_exports$2 as T, APIView as U, SerializerSchema as V, APIViewMethod as W, OffsetPaginationInput as X, CursorPaginationInput as Y, CursorPaginator as Z, GenericAPIViewOpenAPIDescription as _, RequestContext as _t, ListCreateAPIView as a, index_d_exports$4 as at, ModelViewSetConfig as b, ListAPIView as c, FilterLookup as ct, RetrieveModelMixin as d, FilterSetDefineConfig as dt, Paginator as et, CreateModelMixin as f, FilterValueParser as ft, index_d_exports$1 as g, BaseUser as gt, GenericAPIViewConfig as h, index_d_exports$5 as ht, RetrieveUpdateAPIView as i, PaginatedResponse as it, ManyToManyReadStrategy as j, ModelSerializerClass as k, DestroyModelMixin as l, FilterResolver as lt, GenericAPIView as m, FilterType as mt, RetrieveUpdateDestroyAPIView as n, CursorPaginatedResponse as nt, RetrieveAPIView as o, AliasFilterDeclaration as ot, ListModelMixin as p, RangeOperator as pt, ResourceModelMetadata as q, RetrieveDestroyAPIView as r, OffsetPaginatedResponse as rt, CreateAPIView as s, FieldFilterDeclaration as st, index_d_exports as t, BasePaginatedResponse as tt, UpdateModelMixin as u, FilterSet as ut, ModelViewSetOpenAPIDescription as v, ViewSetActionScope as w, ResolvedViewSetActionDescriptor as x, ModelViewSet as y, SerializerCreateInput as z };
902
- //# sourceMappingURL=index-D6sfTSEj.d.ts.map