@baseplate-dev/fastify-generators 0.5.3 → 0.6.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.
- package/CHANGELOG.md +70 -0
- package/dist/constants/fastify-packages.d.ts +14 -14
- package/dist/constants/fastify-packages.js +14 -14
- package/dist/constants/fastify-packages.js.map +1 -1
- package/dist/generators/auth/auth-context/templates/module/types/auth-context.types.ts +1 -0
- package/dist/generators/auth/auth-context/templates/module/utils/auth-context.utils.ts +3 -1
- package/dist/generators/core/fastify/fastify.generator.d.ts.map +1 -1
- package/dist/generators/core/fastify/fastify.generator.js +3 -1
- package/dist/generators/core/fastify/fastify.generator.js.map +1 -1
- package/dist/generators/pothos/index.d.ts +1 -0
- package/dist/generators/pothos/index.d.ts.map +1 -1
- package/dist/generators/pothos/index.js +1 -0
- package/dist/generators/pothos/index.js.map +1 -1
- package/dist/generators/pothos/pothos-auth/pothos-auth.generator.d.ts +5 -0
- package/dist/generators/pothos/pothos-auth/pothos-auth.generator.d.ts.map +1 -1
- package/dist/generators/pothos/pothos-auth/pothos-auth.generator.js +8 -0
- package/dist/generators/pothos/pothos-auth/pothos-auth.generator.js.map +1 -1
- package/dist/generators/pothos/pothos-prisma-count-query/index.d.ts +2 -0
- package/dist/generators/pothos/pothos-prisma-count-query/index.d.ts.map +1 -0
- package/dist/generators/pothos/pothos-prisma-count-query/index.js +2 -0
- package/dist/generators/pothos/pothos-prisma-count-query/index.js.map +1 -0
- package/dist/generators/pothos/pothos-prisma-count-query/pothos-prisma-count-query.generator.d.ts +16 -0
- package/dist/generators/pothos/pothos-prisma-count-query/pothos-prisma-count-query.generator.d.ts.map +1 -0
- package/dist/generators/pothos/pothos-prisma-count-query/pothos-prisma-count-query.generator.js +104 -0
- package/dist/generators/pothos/pothos-prisma-count-query/pothos-prisma-count-query.generator.js.map +1 -0
- package/dist/generators/pothos/pothos-prisma-crud-mutation/pothos-prisma-crud-mutation.generator.d.ts.map +1 -1
- package/dist/generators/pothos/pothos-prisma-crud-mutation/pothos-prisma-crud-mutation.generator.js +2 -5
- package/dist/generators/pothos/pothos-prisma-crud-mutation/pothos-prisma-crud-mutation.generator.js.map +1 -1
- package/dist/generators/pothos/pothos-prisma-find-query/pothos-prisma-find-query.generator.d.ts +4 -0
- package/dist/generators/pothos/pothos-prisma-find-query/pothos-prisma-find-query.generator.d.ts.map +1 -1
- package/dist/generators/pothos/pothos-prisma-find-query/pothos-prisma-find-query.generator.js +52 -10
- package/dist/generators/pothos/pothos-prisma-find-query/pothos-prisma-find-query.generator.js.map +1 -1
- package/dist/generators/pothos/pothos-prisma-list-query/pothos-prisma-list-query.generator.d.ts +4 -0
- package/dist/generators/pothos/pothos-prisma-list-query/pothos-prisma-list-query.generator.d.ts.map +1 -1
- package/dist/generators/pothos/pothos-prisma-list-query/pothos-prisma-list-query.generator.js +39 -3
- package/dist/generators/pothos/pothos-prisma-list-query/pothos-prisma-list-query.generator.js.map +1 -1
- package/dist/generators/pothos/pothos-prisma-object/pothos-prisma-object.generator.d.ts +7 -1
- package/dist/generators/pothos/pothos-prisma-object/pothos-prisma-object.generator.d.ts.map +1 -1
- package/dist/generators/pothos/pothos-prisma-object/pothos-prisma-object.generator.js +73 -13
- package/dist/generators/pothos/pothos-prisma-object/pothos-prisma-object.generator.js.map +1 -1
- package/dist/generators/prisma/_shared/build-data-helpers/generate-authorize-fragment.d.ts +20 -0
- package/dist/generators/prisma/_shared/build-data-helpers/generate-authorize-fragment.d.ts.map +1 -0
- package/dist/generators/prisma/_shared/build-data-helpers/generate-authorize-fragment.js +28 -0
- package/dist/generators/prisma/_shared/build-data-helpers/generate-authorize-fragment.js.map +1 -0
- package/dist/generators/prisma/_shared/build-data-helpers/generate-operation-callbacks.d.ts +48 -55
- package/dist/generators/prisma/_shared/build-data-helpers/generate-operation-callbacks.d.ts.map +1 -1
- package/dist/generators/prisma/_shared/build-data-helpers/generate-operation-callbacks.js +130 -67
- package/dist/generators/prisma/_shared/build-data-helpers/generate-operation-callbacks.js.map +1 -1
- package/dist/generators/prisma/_shared/build-data-helpers/generate-relation-build-data.d.ts +2 -0
- package/dist/generators/prisma/_shared/build-data-helpers/generate-relation-build-data.d.ts.map +1 -1
- package/dist/generators/prisma/_shared/build-data-helpers/generate-relation-build-data.js +3 -3
- package/dist/generators/prisma/_shared/build-data-helpers/generate-relation-build-data.js.map +1 -1
- package/dist/generators/prisma/_shared/build-data-helpers/index.d.ts +1 -0
- package/dist/generators/prisma/_shared/build-data-helpers/index.d.ts.map +1 -1
- package/dist/generators/prisma/_shared/build-data-helpers/index.js +1 -0
- package/dist/generators/prisma/_shared/build-data-helpers/index.js.map +1 -1
- package/dist/generators/prisma/data-utils/data-utils.generator.d.ts +25 -6
- package/dist/generators/prisma/data-utils/data-utils.generator.d.ts.map +1 -1
- package/dist/generators/prisma/data-utils/generated/index.d.ts +78 -23
- package/dist/generators/prisma/data-utils/generated/index.d.ts.map +1 -1
- package/dist/generators/prisma/data-utils/generated/template-paths.d.ts +3 -1
- package/dist/generators/prisma/data-utils/generated/template-paths.d.ts.map +1 -1
- package/dist/generators/prisma/data-utils/generated/template-paths.js +3 -1
- package/dist/generators/prisma/data-utils/generated/template-paths.js.map +1 -1
- package/dist/generators/prisma/data-utils/generated/ts-import-providers.d.ts +75 -18
- package/dist/generators/prisma/data-utils/generated/ts-import-providers.d.ts.map +1 -1
- package/dist/generators/prisma/data-utils/generated/ts-import-providers.js +26 -8
- package/dist/generators/prisma/data-utils/generated/ts-import-providers.js.map +1 -1
- package/dist/generators/prisma/data-utils/generated/typed-templates.d.ts +106 -34
- package/dist/generators/prisma/data-utils/generated/typed-templates.d.ts.map +1 -1
- package/dist/generators/prisma/data-utils/generated/typed-templates.js +61 -14
- package/dist/generators/prisma/data-utils/generated/typed-templates.js.map +1 -1
- package/dist/generators/prisma/data-utils/templates/src/utils/data-operations/commit-operations.ts +366 -0
- package/dist/generators/prisma/data-utils/templates/src/utils/data-operations/compose-operations.ts +131 -0
- package/dist/generators/prisma/data-utils/templates/src/utils/data-operations/field-definitions.ts +26 -30
- package/dist/generators/prisma/data-utils/templates/src/utils/data-operations/field-utils.ts +201 -0
- package/dist/generators/prisma/data-utils/templates/src/utils/data-operations/prisma-types.ts +24 -20
- package/dist/generators/prisma/data-utils/templates/src/utils/data-operations/prisma-utils.ts +14 -6
- package/dist/generators/prisma/data-utils/templates/src/utils/data-operations/relation-helpers.ts +21 -26
- package/dist/generators/prisma/data-utils/templates/src/utils/data-operations/types.ts +374 -25
- package/dist/generators/prisma/index.d.ts +2 -0
- package/dist/generators/prisma/index.d.ts.map +1 -1
- package/dist/generators/prisma/index.js +2 -0
- package/dist/generators/prisma/index.js.map +1 -1
- package/dist/generators/prisma/prisma-authorizer-utils/generated/index.d.ts +50 -12
- package/dist/generators/prisma/prisma-authorizer-utils/generated/index.d.ts.map +1 -1
- package/dist/generators/prisma/prisma-authorizer-utils/generated/template-renderers.d.ts +25 -6
- package/dist/generators/prisma/prisma-authorizer-utils/generated/template-renderers.d.ts.map +1 -1
- package/dist/generators/prisma/prisma-authorizer-utils/generated/typed-templates.d.ts +50 -12
- package/dist/generators/prisma/prisma-authorizer-utils/generated/typed-templates.d.ts.map +1 -1
- package/dist/generators/prisma/prisma-authorizer-utils/prisma-authorizer-utils.generator.d.ts +25 -6
- package/dist/generators/prisma/prisma-authorizer-utils/prisma-authorizer-utils.generator.d.ts.map +1 -1
- package/dist/generators/prisma/prisma-data-create/prisma-data-create.generator.d.ts +26 -6
- package/dist/generators/prisma/prisma-data-create/prisma-data-create.generator.d.ts.map +1 -1
- package/dist/generators/prisma/prisma-data-create/prisma-data-create.generator.js +53 -25
- package/dist/generators/prisma/prisma-data-create/prisma-data-create.generator.js.map +1 -1
- package/dist/generators/prisma/prisma-data-delete/prisma-data-delete.generator.d.ts +31 -6
- package/dist/generators/prisma/prisma-data-delete/prisma-data-delete.generator.d.ts.map +1 -1
- package/dist/generators/prisma/prisma-data-delete/prisma-data-delete.generator.js +52 -15
- package/dist/generators/prisma/prisma-data-delete/prisma-data-delete.generator.js.map +1 -1
- package/dist/generators/prisma/prisma-data-nested-field/prisma-data-nested-field.generator.d.ts +25 -6
- package/dist/generators/prisma/prisma-data-nested-field/prisma-data-nested-field.generator.d.ts.map +1 -1
- package/dist/generators/prisma/prisma-data-service/prisma-data-service.generator.d.ts +25 -6
- package/dist/generators/prisma/prisma-data-service/prisma-data-service.generator.d.ts.map +1 -1
- package/dist/generators/prisma/prisma-data-update/prisma-data-update.generator.d.ts +31 -6
- package/dist/generators/prisma/prisma-data-update/prisma-data-update.generator.d.ts.map +1 -1
- package/dist/generators/prisma/prisma-data-update/prisma-data-update.generator.js +65 -23
- package/dist/generators/prisma/prisma-data-update/prisma-data-update.generator.js.map +1 -1
- package/dist/generators/prisma/prisma-model-authorizer/prisma-model-authorizer.generator.d.ts +2 -0
- package/dist/generators/prisma/prisma-model-authorizer/prisma-model-authorizer.generator.d.ts.map +1 -1
- package/dist/generators/prisma/prisma-model-authorizer/prisma-model-authorizer.generator.js +86 -53
- package/dist/generators/prisma/prisma-model-authorizer/prisma-model-authorizer.generator.js.map +1 -1
- package/dist/generators/prisma/prisma-model-query-filter/index.d.ts +2 -0
- package/dist/generators/prisma/prisma-model-query-filter/index.d.ts.map +1 -0
- package/dist/generators/prisma/prisma-model-query-filter/index.js +2 -0
- package/dist/generators/prisma/prisma-model-query-filter/index.js.map +1 -0
- package/dist/generators/prisma/prisma-model-query-filter/prisma-model-query-filter.generator.d.ts +60 -0
- package/dist/generators/prisma/prisma-model-query-filter/prisma-model-query-filter.generator.d.ts.map +1 -0
- package/dist/generators/prisma/prisma-model-query-filter/prisma-model-query-filter.generator.js +124 -0
- package/dist/generators/prisma/prisma-model-query-filter/prisma-model-query-filter.generator.js.map +1 -0
- package/dist/generators/prisma/prisma-query-filter-utils/generated/index.d.ts +364 -0
- package/dist/generators/prisma/prisma-query-filter-utils/generated/index.d.ts.map +1 -0
- package/dist/generators/prisma/prisma-query-filter-utils/generated/index.js +13 -0
- package/dist/generators/prisma/prisma-query-filter-utils/generated/index.js.map +1 -0
- package/dist/generators/prisma/prisma-query-filter-utils/generated/template-paths.d.ts +13 -0
- package/dist/generators/prisma/prisma-query-filter-utils/generated/template-paths.d.ts.map +1 -0
- package/dist/generators/prisma/prisma-query-filter-utils/generated/template-paths.js +25 -0
- package/dist/generators/prisma/prisma-query-filter-utils/generated/template-paths.js.map +1 -0
- package/dist/generators/prisma/prisma-query-filter-utils/generated/template-renderers.d.ts +131 -0
- package/dist/generators/prisma/prisma-query-filter-utils/generated/template-renderers.d.ts.map +1 -0
- package/dist/generators/prisma/prisma-query-filter-utils/generated/template-renderers.js +49 -0
- package/dist/generators/prisma/prisma-query-filter-utils/generated/template-renderers.js.map +1 -0
- package/dist/generators/prisma/prisma-query-filter-utils/generated/ts-import-providers.d.ts +66 -0
- package/dist/generators/prisma/prisma-query-filter-utils/generated/ts-import-providers.d.ts.map +1 -0
- package/dist/generators/prisma/prisma-query-filter-utils/generated/ts-import-providers.js +40 -0
- package/dist/generators/prisma/prisma-query-filter-utils/generated/ts-import-providers.js.map +1 -0
- package/dist/generators/prisma/prisma-query-filter-utils/generated/typed-templates.d.ts +411 -0
- package/dist/generators/prisma/prisma-query-filter-utils/generated/typed-templates.d.ts.map +1 -0
- package/dist/generators/prisma/prisma-query-filter-utils/generated/typed-templates.js +46 -0
- package/dist/generators/prisma/prisma-query-filter-utils/generated/typed-templates.js.map +1 -0
- package/dist/generators/prisma/prisma-query-filter-utils/index.d.ts +4 -0
- package/dist/generators/prisma/prisma-query-filter-utils/index.d.ts.map +1 -0
- package/dist/generators/prisma/prisma-query-filter-utils/index.js +3 -0
- package/dist/generators/prisma/prisma-query-filter-utils/index.js.map +1 -0
- package/dist/generators/prisma/prisma-query-filter-utils/prisma-query-filter-utils.generator.d.ts +156 -0
- package/dist/generators/prisma/prisma-query-filter-utils/prisma-query-filter-utils.generator.d.ts.map +1 -0
- package/dist/generators/prisma/prisma-query-filter-utils/prisma-query-filter-utils.generator.js +32 -0
- package/dist/generators/prisma/prisma-query-filter-utils/prisma-query-filter-utils.generator.js.map +1 -0
- package/dist/generators/prisma/prisma-query-filter-utils/templates/src/utils/query-filters.ts +209 -0
- package/dist/generators/prisma/prisma-query-filter-utils/templates/src/utils/query-helpers.ts +70 -0
- package/dist/generators/vitest/prisma-vitest/generated/index.d.ts +0 -6
- package/dist/generators/vitest/prisma-vitest/generated/index.d.ts.map +1 -1
- package/dist/generators/vitest/prisma-vitest/generated/template-renderers.d.ts.map +1 -1
- package/dist/generators/vitest/prisma-vitest/generated/template-renderers.js +0 -1
- package/dist/generators/vitest/prisma-vitest/generated/template-renderers.js.map +1 -1
- package/dist/generators/vitest/prisma-vitest/generated/typed-templates.d.ts +0 -6
- package/dist/generators/vitest/prisma-vitest/generated/typed-templates.d.ts.map +1 -1
- package/dist/generators/vitest/prisma-vitest/generated/typed-templates.js +1 -4
- package/dist/generators/vitest/prisma-vitest/generated/typed-templates.js.map +1 -1
- package/dist/generators/vitest/prisma-vitest/templates/src/tests/helpers/prisma.test-helper.ts +2 -10
- package/dist/types/service-dto-kinds.d.ts +0 -6
- package/dist/types/service-dto-kinds.d.ts.map +1 -1
- package/dist/types/service-dto-kinds.js +0 -6
- package/dist/types/service-dto-kinds.js.map +1 -1
- package/dist/writers/pothos/helpers.d.ts +1 -0
- package/dist/writers/pothos/helpers.d.ts.map +1 -1
- package/dist/writers/pothos/helpers.js +1 -0
- package/dist/writers/pothos/helpers.js.map +1 -1
- package/dist/writers/pothos/scalar-fields.d.ts +3 -1
- package/dist/writers/pothos/scalar-fields.d.ts.map +1 -1
- package/dist/writers/pothos/scalar-fields.js +1 -0
- package/dist/writers/pothos/scalar-fields.js.map +1 -1
- package/dist/writers/prisma-schema/fields.d.ts +1 -1
- package/dist/writers/prisma-schema/fields.js +2 -2
- package/dist/writers/prisma-schema/fields.js.map +1 -1
- package/package.json +8 -8
- package/dist/generators/prisma/data-utils/templates/src/utils/data-operations/define-operations.ts +0 -1134
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
2
|
|
|
3
|
-
import type {
|
|
3
|
+
import type {
|
|
4
|
+
GetPayload,
|
|
5
|
+
ModelInclude,
|
|
6
|
+
ModelPropName,
|
|
7
|
+
WhereUniqueInput,
|
|
8
|
+
} from '$prismaTypes';
|
|
9
|
+
import type {
|
|
10
|
+
GlobalRoleCheck,
|
|
11
|
+
InstanceRoleCheck,
|
|
12
|
+
} from '%authorizerUtilsImports';
|
|
13
|
+
import type { Prisma } from '%prismaGeneratedImports';
|
|
4
14
|
import type { ServiceContext } from '%serviceContextImports';
|
|
5
|
-
import type { ITXClientDenyList } from '@prisma/client/runtime/client';
|
|
6
15
|
import type { z } from 'zod';
|
|
7
16
|
|
|
8
|
-
/**
|
|
9
|
-
* Prisma transaction client type for data operations.
|
|
10
|
-
*
|
|
11
|
-
* This is the Prisma client type available within transaction callbacks,
|
|
12
|
-
* with operations that cannot be used inside transactions excluded.
|
|
13
|
-
*/
|
|
14
|
-
export type PrismaTransaction = Omit<PrismaClient, ITXClientDenyList>;
|
|
15
|
-
|
|
16
17
|
/**
|
|
17
18
|
* Type of data operation being performed.
|
|
18
19
|
*
|
|
@@ -70,7 +71,7 @@ export interface TransactionalOperationContext<
|
|
|
70
71
|
TConfig extends { hasResult: boolean },
|
|
71
72
|
> extends OperationContext<TModel, TConfig> {
|
|
72
73
|
/** Prisma transaction client for performing database operations */
|
|
73
|
-
tx:
|
|
74
|
+
tx: Prisma.TransactionClient;
|
|
74
75
|
}
|
|
75
76
|
|
|
76
77
|
/**
|
|
@@ -166,22 +167,14 @@ export interface FieldTransformData<TCreateOutput, TUpdateOutput> {
|
|
|
166
167
|
/**
|
|
167
168
|
* Result of field processing, including transformed data and optional hooks.
|
|
168
169
|
*
|
|
169
|
-
* The data can be either synchronous or asynchronous (resolved inside transaction).
|
|
170
170
|
* Hooks allow fields to perform side effects during the operation lifecycle.
|
|
171
171
|
*
|
|
172
172
|
* @template TCreateOutput - Data type for create operations
|
|
173
173
|
* @template TUpdateOutput - Data type for update operations
|
|
174
174
|
*/
|
|
175
175
|
export interface FieldTransformResult<TCreateOutput, TUpdateOutput> {
|
|
176
|
-
/**
|
|
177
|
-
|
|
178
|
-
* Async functions are resolved inside the transaction, allowing access to tx client.
|
|
179
|
-
*/
|
|
180
|
-
data?:
|
|
181
|
-
| FieldTransformData<TCreateOutput, TUpdateOutput>
|
|
182
|
-
| ((
|
|
183
|
-
tx: PrismaTransaction,
|
|
184
|
-
) => Promise<FieldTransformData<TCreateOutput, TUpdateOutput>>);
|
|
176
|
+
/** Transformed field data for create and update operations */
|
|
177
|
+
data?: FieldTransformData<TCreateOutput, TUpdateOutput>;
|
|
185
178
|
|
|
186
179
|
/** Optional hooks to execute during operation lifecycle */
|
|
187
180
|
hooks?: AnyOperationHooks;
|
|
@@ -228,10 +221,8 @@ export interface FieldDefinition<
|
|
|
228
221
|
schema: TInputSchema;
|
|
229
222
|
|
|
230
223
|
/**
|
|
231
|
-
* Processes and transforms an input value
|
|
232
|
-
*
|
|
233
|
-
* Note: Validation happens at the operation level (defineCreateOperation/defineUpdateOperation),
|
|
234
|
-
* not at the field level. This function receives already-validated input.
|
|
224
|
+
* Processes and transforms an already-validated input value into
|
|
225
|
+
* Prisma-compatible create/update data.
|
|
235
226
|
*
|
|
236
227
|
* @param value - The validated input value to process
|
|
237
228
|
* @param ctx - Context about the operation
|
|
@@ -370,3 +361,361 @@ export interface InferFieldsOutput<
|
|
|
370
361
|
/** Field outputs for update operations */
|
|
371
362
|
update: InferFieldsUpdateOutput<TFields>;
|
|
372
363
|
}
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* =========================================
|
|
367
|
+
* Operation Plans
|
|
368
|
+
* =========================================
|
|
369
|
+
*/
|
|
370
|
+
|
|
371
|
+
type HookPhase = keyof Required<AnyOperationHooks>;
|
|
372
|
+
type HookFn<TPhase extends HookPhase> =
|
|
373
|
+
Required<AnyOperationHooks>[TPhase][number];
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* Immutable plan for a create operation, returned by `composeCreate`.
|
|
377
|
+
*
|
|
378
|
+
* Contains the resolved field data, collected hooks, and service context.
|
|
379
|
+
* Use `mapData` and `addHook` to derive new plans — the original is never mutated.
|
|
380
|
+
*/
|
|
381
|
+
export class CreatePlan<
|
|
382
|
+
TModelName extends ModelPropName,
|
|
383
|
+
TFields extends Record<string, AnyFieldDefinition>,
|
|
384
|
+
> {
|
|
385
|
+
/** The Prisma model name */
|
|
386
|
+
readonly model: TModelName;
|
|
387
|
+
|
|
388
|
+
/** Resolved field data for the create operation */
|
|
389
|
+
readonly data: InferFieldsCreateOutput<TFields>;
|
|
390
|
+
|
|
391
|
+
/** Collected hooks from field processing and any `addHook` calls */
|
|
392
|
+
readonly hooks: Readonly<Required<AnyOperationHooks>>;
|
|
393
|
+
|
|
394
|
+
/** Service context for the operation */
|
|
395
|
+
readonly serviceContext: ServiceContext;
|
|
396
|
+
|
|
397
|
+
constructor(args: {
|
|
398
|
+
model: TModelName;
|
|
399
|
+
data: InferFieldsCreateOutput<TFields>;
|
|
400
|
+
hooks: Required<AnyOperationHooks>;
|
|
401
|
+
serviceContext: ServiceContext;
|
|
402
|
+
}) {
|
|
403
|
+
this.model = args.model;
|
|
404
|
+
this.data = args.data;
|
|
405
|
+
this.hooks = args.hooks;
|
|
406
|
+
this.serviceContext = args.serviceContext;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
/** Return a new plan with transformed data. */
|
|
410
|
+
mapData(
|
|
411
|
+
fn: (
|
|
412
|
+
data: InferFieldsCreateOutput<TFields>,
|
|
413
|
+
) => InferFieldsCreateOutput<TFields>,
|
|
414
|
+
): CreatePlan<TModelName, TFields> {
|
|
415
|
+
return new CreatePlan({
|
|
416
|
+
model: this.model,
|
|
417
|
+
data: fn(this.data),
|
|
418
|
+
hooks: this.hooks,
|
|
419
|
+
serviceContext: this.serviceContext,
|
|
420
|
+
});
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
/** Return a new plan with an additional hook appended to the given phase. */
|
|
424
|
+
addHook<TPhase extends HookPhase>(
|
|
425
|
+
phase: TPhase,
|
|
426
|
+
hook: HookFn<TPhase>,
|
|
427
|
+
): CreatePlan<TModelName, TFields> {
|
|
428
|
+
return new CreatePlan({
|
|
429
|
+
model: this.model,
|
|
430
|
+
data: this.data,
|
|
431
|
+
hooks: {
|
|
432
|
+
...this.hooks,
|
|
433
|
+
[phase]: [...this.hooks[phase], hook],
|
|
434
|
+
},
|
|
435
|
+
serviceContext: this.serviceContext,
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
/**
|
|
441
|
+
* Immutable plan for an update operation, returned by `composeUpdate`.
|
|
442
|
+
*
|
|
443
|
+
* Contains the resolved field data, collected hooks, existing item access,
|
|
444
|
+
* and service context. Use `mapData` and `addHook` to derive new plans —
|
|
445
|
+
* the original is never mutated.
|
|
446
|
+
*/
|
|
447
|
+
export class UpdatePlan<
|
|
448
|
+
TModelName extends ModelPropName,
|
|
449
|
+
TFields extends Record<string, AnyFieldDefinition>,
|
|
450
|
+
> {
|
|
451
|
+
/** The Prisma model name */
|
|
452
|
+
readonly model: TModelName;
|
|
453
|
+
|
|
454
|
+
/** Resolved field data for the update operation */
|
|
455
|
+
readonly data: InferFieldsUpdateOutput<TFields>;
|
|
456
|
+
|
|
457
|
+
/** Collected hooks from field processing and any `addHook` calls */
|
|
458
|
+
readonly hooks: Readonly<Required<AnyOperationHooks>>;
|
|
459
|
+
|
|
460
|
+
/** Service context for the operation */
|
|
461
|
+
readonly serviceContext: ServiceContext;
|
|
462
|
+
|
|
463
|
+
/**
|
|
464
|
+
* Lazy loader for the existing item. Caches the result.
|
|
465
|
+
* Call this if you need to inspect the existing item for diffing.
|
|
466
|
+
*/
|
|
467
|
+
readonly loadExisting: () => Promise<GetPayload<TModelName>>;
|
|
468
|
+
|
|
469
|
+
constructor(args: {
|
|
470
|
+
model: TModelName;
|
|
471
|
+
data: InferFieldsUpdateOutput<TFields>;
|
|
472
|
+
hooks: Required<AnyOperationHooks>;
|
|
473
|
+
serviceContext: ServiceContext;
|
|
474
|
+
loadExisting: () => Promise<GetPayload<TModelName>>;
|
|
475
|
+
}) {
|
|
476
|
+
this.model = args.model;
|
|
477
|
+
this.data = args.data;
|
|
478
|
+
this.hooks = args.hooks;
|
|
479
|
+
this.serviceContext = args.serviceContext;
|
|
480
|
+
this.loadExisting = args.loadExisting;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
/** Return a new plan with transformed data. */
|
|
484
|
+
mapData(
|
|
485
|
+
fn: (
|
|
486
|
+
data: InferFieldsUpdateOutput<TFields>,
|
|
487
|
+
) => InferFieldsUpdateOutput<TFields>,
|
|
488
|
+
): UpdatePlan<TModelName, TFields> {
|
|
489
|
+
return new UpdatePlan({
|
|
490
|
+
model: this.model,
|
|
491
|
+
data: fn(this.data),
|
|
492
|
+
hooks: this.hooks,
|
|
493
|
+
serviceContext: this.serviceContext,
|
|
494
|
+
loadExisting: this.loadExisting,
|
|
495
|
+
});
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
/** Return a new plan with an additional hook appended to the given phase. */
|
|
499
|
+
addHook<TPhase extends HookPhase>(
|
|
500
|
+
phase: TPhase,
|
|
501
|
+
hook: HookFn<TPhase>,
|
|
502
|
+
): UpdatePlan<TModelName, TFields> {
|
|
503
|
+
return new UpdatePlan({
|
|
504
|
+
model: this.model,
|
|
505
|
+
data: this.data,
|
|
506
|
+
hooks: {
|
|
507
|
+
...this.hooks,
|
|
508
|
+
[phase]: [...this.hooks[phase], hook],
|
|
509
|
+
},
|
|
510
|
+
serviceContext: this.serviceContext,
|
|
511
|
+
loadExisting: this.loadExisting,
|
|
512
|
+
});
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
/**
|
|
517
|
+
* =========================================
|
|
518
|
+
* Compose Configs
|
|
519
|
+
* =========================================
|
|
520
|
+
*/
|
|
521
|
+
|
|
522
|
+
/**
|
|
523
|
+
* Configuration for `composeCreate`.
|
|
524
|
+
*/
|
|
525
|
+
export interface ComposeCreateConfig<
|
|
526
|
+
TModelName extends ModelPropName,
|
|
527
|
+
TFields extends Record<string, AnyFieldDefinition>,
|
|
528
|
+
> {
|
|
529
|
+
model: TModelName;
|
|
530
|
+
fields: TFields;
|
|
531
|
+
input: InferInput<TFields>;
|
|
532
|
+
context: ServiceContext;
|
|
533
|
+
|
|
534
|
+
/**
|
|
535
|
+
* Optional authorization checks. Only global roles are allowed for create
|
|
536
|
+
* since there is no existing instance to check against.
|
|
537
|
+
* Runs before field processing — fails fast on unauthorized access.
|
|
538
|
+
*/
|
|
539
|
+
authorize?: GlobalRoleCheck[];
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
/**
|
|
543
|
+
* Configuration for `composeUpdate`.
|
|
544
|
+
*
|
|
545
|
+
* The `loadExisting` function is a cached lazy loader for the existing item.
|
|
546
|
+
* It is called by field processing (e.g., nested relations) when they need
|
|
547
|
+
* to read the current state. The caller defines this function to control
|
|
548
|
+
* how the item is fetched (e.g., with extra includes).
|
|
549
|
+
*/
|
|
550
|
+
export interface ComposeUpdateConfig<
|
|
551
|
+
TModelName extends ModelPropName,
|
|
552
|
+
TFields extends Record<string, AnyFieldDefinition>,
|
|
553
|
+
> {
|
|
554
|
+
model: TModelName;
|
|
555
|
+
fields: TFields;
|
|
556
|
+
input: Partial<InferInput<TFields>>;
|
|
557
|
+
context: ServiceContext;
|
|
558
|
+
loadExisting: () => Promise<GetPayload<TModelName>>;
|
|
559
|
+
|
|
560
|
+
/**
|
|
561
|
+
* Optional authorization checks. Supports both global roles (strings)
|
|
562
|
+
* and instance-level checks (functions that receive the existing item).
|
|
563
|
+
* Runs before field processing — fails fast on unauthorized access.
|
|
564
|
+
*/
|
|
565
|
+
authorize?: (GlobalRoleCheck | InstanceRoleCheck<GetPayload<TModelName>>)[];
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
/**
|
|
569
|
+
* =========================================
|
|
570
|
+
* Data Service Input Types
|
|
571
|
+
* =========================================
|
|
572
|
+
*/
|
|
573
|
+
|
|
574
|
+
/**
|
|
575
|
+
* Input type for data service create functions.
|
|
576
|
+
*/
|
|
577
|
+
export interface DataCreateInput<
|
|
578
|
+
TModelName extends ModelPropName,
|
|
579
|
+
TFields extends Record<string, AnyFieldDefinition>,
|
|
580
|
+
TIncludeArgs extends ModelInclude<TModelName> = ModelInclude<TModelName>,
|
|
581
|
+
> {
|
|
582
|
+
data: InferInput<TFields>;
|
|
583
|
+
query?: TIncludeArgs;
|
|
584
|
+
context: ServiceContext;
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
/**
|
|
588
|
+
* Input type for data service update functions.
|
|
589
|
+
*/
|
|
590
|
+
export interface DataUpdateInput<
|
|
591
|
+
TModelName extends ModelPropName,
|
|
592
|
+
TFields extends Record<string, AnyFieldDefinition>,
|
|
593
|
+
TIncludeArgs extends ModelInclude<TModelName> = ModelInclude<TModelName>,
|
|
594
|
+
> {
|
|
595
|
+
where: WhereUniqueInput<TModelName>;
|
|
596
|
+
data: Partial<InferInput<TFields>>;
|
|
597
|
+
query?: TIncludeArgs;
|
|
598
|
+
context: ServiceContext;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
/**
|
|
602
|
+
* Input type for data service delete functions.
|
|
603
|
+
*/
|
|
604
|
+
export interface DataDeleteInput<
|
|
605
|
+
TModelName extends ModelPropName,
|
|
606
|
+
TIncludeArgs extends ModelInclude<TModelName> = ModelInclude<TModelName>,
|
|
607
|
+
> {
|
|
608
|
+
where: WhereUniqueInput<TModelName>;
|
|
609
|
+
query?: TIncludeArgs;
|
|
610
|
+
context: ServiceContext;
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
/**
|
|
614
|
+
* =========================================
|
|
615
|
+
* Commit Configs
|
|
616
|
+
* =========================================
|
|
617
|
+
*/
|
|
618
|
+
|
|
619
|
+
/**
|
|
620
|
+
* Configuration for `commitCreate`.
|
|
621
|
+
*/
|
|
622
|
+
export interface CommitCreateConfig<
|
|
623
|
+
TModelName extends ModelPropName,
|
|
624
|
+
TFields extends Record<string, AnyFieldDefinition>,
|
|
625
|
+
TIncludeArgs extends ModelInclude<TModelName>,
|
|
626
|
+
> {
|
|
627
|
+
/** Prisma query arguments (include) to shape returned data */
|
|
628
|
+
query?: TIncludeArgs;
|
|
629
|
+
|
|
630
|
+
/**
|
|
631
|
+
* Optional override for the default refetch behavior.
|
|
632
|
+
* By default, records are refetched using `findUnique({ where: { id } })`
|
|
633
|
+
* via a generic Prisma delegate. Provide this if you need custom refetch logic.
|
|
634
|
+
*/
|
|
635
|
+
refetchWithQuery?: (
|
|
636
|
+
result: GetPayload<TModelName>,
|
|
637
|
+
query: TIncludeArgs,
|
|
638
|
+
) => Promise<GetPayload<TModelName, TIncludeArgs>>;
|
|
639
|
+
|
|
640
|
+
/** Execute the Prisma create operation inside the transaction */
|
|
641
|
+
execute: (args: {
|
|
642
|
+
tx: Prisma.TransactionClient;
|
|
643
|
+
data: InferFieldsCreateOutput<TFields>;
|
|
644
|
+
query: ModelInclude<TModelName>;
|
|
645
|
+
serviceContext: ServiceContext;
|
|
646
|
+
}) => Promise<GetPayload<TModelName, ModelInclude<TModelName>>>;
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
/**
|
|
650
|
+
* Configuration for `commitUpdate`.
|
|
651
|
+
*/
|
|
652
|
+
export interface CommitUpdateConfig<
|
|
653
|
+
TModelName extends ModelPropName,
|
|
654
|
+
TFields extends Record<string, AnyFieldDefinition>,
|
|
655
|
+
TIncludeArgs extends ModelInclude<TModelName>,
|
|
656
|
+
> {
|
|
657
|
+
/** Prisma query arguments (include) to shape returned data */
|
|
658
|
+
query?: TIncludeArgs;
|
|
659
|
+
|
|
660
|
+
/**
|
|
661
|
+
* Optional override for the default refetch behavior.
|
|
662
|
+
* By default, records are refetched using `findUnique({ where: { id } })`
|
|
663
|
+
* via a generic Prisma delegate. Provide this if you need custom refetch logic.
|
|
664
|
+
*/
|
|
665
|
+
refetchWithQuery?: (
|
|
666
|
+
result: GetPayload<TModelName>,
|
|
667
|
+
query: TIncludeArgs,
|
|
668
|
+
) => Promise<GetPayload<TModelName, TIncludeArgs>>;
|
|
669
|
+
|
|
670
|
+
/** Execute the Prisma update operation inside the transaction */
|
|
671
|
+
execute: (args: {
|
|
672
|
+
tx: Prisma.TransactionClient;
|
|
673
|
+
data: InferFieldsUpdateOutput<TFields>;
|
|
674
|
+
query: ModelInclude<TModelName>;
|
|
675
|
+
serviceContext: ServiceContext;
|
|
676
|
+
}) => Promise<GetPayload<TModelName, ModelInclude<TModelName>>>;
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
/**
|
|
680
|
+
* Configuration for `commitDelete`.
|
|
681
|
+
*
|
|
682
|
+
* Delete has no compose step since there are no fields to process.
|
|
683
|
+
* Authorization, hooks, and execution are all handled directly.
|
|
684
|
+
*/
|
|
685
|
+
export interface CommitDeleteConfig<
|
|
686
|
+
TModelName extends ModelPropName,
|
|
687
|
+
TIncludeArgs extends ModelInclude<TModelName>,
|
|
688
|
+
> {
|
|
689
|
+
/** The Prisma model name */
|
|
690
|
+
model: TModelName;
|
|
691
|
+
|
|
692
|
+
/** Prisma query arguments (include) to shape returned data */
|
|
693
|
+
query?: TIncludeArgs;
|
|
694
|
+
|
|
695
|
+
/** Service context for the operation */
|
|
696
|
+
context: ServiceContext;
|
|
697
|
+
|
|
698
|
+
/**
|
|
699
|
+
* Optional authorization checks. Supports both global roles (strings)
|
|
700
|
+
* and instance-level checks (functions that receive the existing item).
|
|
701
|
+
* Runs before hooks and delete execution.
|
|
702
|
+
*/
|
|
703
|
+
authorize?: (GlobalRoleCheck | InstanceRoleCheck<GetPayload<TModelName>>)[];
|
|
704
|
+
|
|
705
|
+
/** Optional hooks to run during the delete lifecycle */
|
|
706
|
+
hooks?: Partial<AnyOperationHooks>;
|
|
707
|
+
|
|
708
|
+
/**
|
|
709
|
+
* Lazy loader for the existing item. Required when using instance-level
|
|
710
|
+
* authorization or hooks that need to inspect the record before deletion.
|
|
711
|
+
* The result is cached so the item is fetched at most once.
|
|
712
|
+
*/
|
|
713
|
+
loadExisting?: () => Promise<GetPayload<TModelName>>;
|
|
714
|
+
|
|
715
|
+
/** Execute the Prisma delete operation inside the transaction */
|
|
716
|
+
execute: (args: {
|
|
717
|
+
tx: Prisma.TransactionClient;
|
|
718
|
+
query: ModelInclude<TModelName>;
|
|
719
|
+
serviceContext: ServiceContext;
|
|
720
|
+
}) => Promise<GetPayload<TModelName, ModelInclude<TModelName>>>;
|
|
721
|
+
}
|
|
@@ -11,8 +11,10 @@ export * from './prisma-field/index.js';
|
|
|
11
11
|
export * from './prisma-model-authorizer/index.js';
|
|
12
12
|
export * from './prisma-model-id/index.js';
|
|
13
13
|
export * from './prisma-model-index/index.js';
|
|
14
|
+
export * from './prisma-model-query-filter/index.js';
|
|
14
15
|
export * from './prisma-model-unique/index.js';
|
|
15
16
|
export * from './prisma-model/index.js';
|
|
17
|
+
export * from './prisma-query-filter-utils/index.js';
|
|
16
18
|
export * from './prisma-relation-field/index.js';
|
|
17
19
|
export * from './prisma/index.js';
|
|
18
20
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/generators/prisma/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oCAAoC,CAAC;AACnD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qCAAqC,CAAC;AACpD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oCAAoC,CAAC;AACnD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,yBAAyB,CAAC;AACxC,cAAc,kCAAkC,CAAC;AACjD,cAAc,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/generators/prisma/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oCAAoC,CAAC;AACnD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qCAAqC,CAAC;AACpD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oCAAoC,CAAC;AACnD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,sCAAsC,CAAC;AACrD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,yBAAyB,CAAC;AACxC,cAAc,sCAAsC,CAAC;AACrD,cAAc,kCAAkC,CAAC;AACjD,cAAc,mBAAmB,CAAC"}
|
|
@@ -11,8 +11,10 @@ export * from './prisma-field/index.js';
|
|
|
11
11
|
export * from './prisma-model-authorizer/index.js';
|
|
12
12
|
export * from './prisma-model-id/index.js';
|
|
13
13
|
export * from './prisma-model-index/index.js';
|
|
14
|
+
export * from './prisma-model-query-filter/index.js';
|
|
14
15
|
export * from './prisma-model-unique/index.js';
|
|
15
16
|
export * from './prisma-model/index.js';
|
|
17
|
+
export * from './prisma-query-filter-utils/index.js';
|
|
16
18
|
export * from './prisma-relation-field/index.js';
|
|
17
19
|
export * from './prisma/index.js';
|
|
18
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/generators/prisma/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oCAAoC,CAAC;AACnD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qCAAqC,CAAC;AACpD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oCAAoC,CAAC;AACnD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,yBAAyB,CAAC;AACxC,cAAc,kCAAkC,CAAC;AACjD,cAAc,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/generators/prisma/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oCAAoC,CAAC;AACnD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qCAAqC,CAAC;AACpD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oCAAoC,CAAC;AACnD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,sCAAsC,CAAC;AACrD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,yBAAyB,CAAC;AACxC,cAAc,sCAAsC,CAAC;AACrD,cAAc,kCAAkC,CAAC;AACjD,cAAc,mBAAmB,CAAC"}
|
|
@@ -55,13 +55,24 @@ export declare const PRISMA_PRISMA_AUTHORIZER_UTILS_GENERATED: {
|
|
|
55
55
|
AnyOperationHooks: {
|
|
56
56
|
isTypeOnly: true;
|
|
57
57
|
};
|
|
58
|
+
commitCreate: {};
|
|
59
|
+
commitDelete: {};
|
|
60
|
+
commitUpdate: {};
|
|
61
|
+
composeCreate: {};
|
|
62
|
+
composeUpdate: {};
|
|
58
63
|
createParentModelConfig: {};
|
|
64
|
+
DataCreateInput: {
|
|
65
|
+
isTypeOnly: true;
|
|
66
|
+
};
|
|
67
|
+
DataDeleteInput: {
|
|
68
|
+
isTypeOnly: true;
|
|
69
|
+
};
|
|
59
70
|
DataOperationType: {
|
|
60
71
|
isTypeOnly: true;
|
|
61
72
|
};
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
73
|
+
DataUpdateInput: {
|
|
74
|
+
isTypeOnly: true;
|
|
75
|
+
};
|
|
65
76
|
FieldContext: {
|
|
66
77
|
isTypeOnly: true;
|
|
67
78
|
};
|
|
@@ -74,6 +85,8 @@ export declare const PRISMA_PRISMA_AUTHORIZER_UTILS_GENERATED: {
|
|
|
74
85
|
FieldTransformResult: {
|
|
75
86
|
isTypeOnly: true;
|
|
76
87
|
};
|
|
88
|
+
generateCreateSchema: {};
|
|
89
|
+
generateUpdateSchema: {};
|
|
77
90
|
GetPayload: {
|
|
78
91
|
isTypeOnly: true;
|
|
79
92
|
};
|
|
@@ -83,6 +96,9 @@ export declare const PRISMA_PRISMA_AUTHORIZER_UTILS_GENERATED: {
|
|
|
83
96
|
InferInput: {
|
|
84
97
|
isTypeOnly: true;
|
|
85
98
|
};
|
|
99
|
+
ModelInclude: {
|
|
100
|
+
isTypeOnly: true;
|
|
101
|
+
};
|
|
86
102
|
ModelPropName: {
|
|
87
103
|
isTypeOnly: true;
|
|
88
104
|
};
|
|
@@ -103,14 +119,17 @@ export declare const PRISMA_PRISMA_AUTHORIZER_UTILS_GENERATED: {
|
|
|
103
119
|
ParentModelConfig: {
|
|
104
120
|
isTypeOnly: true;
|
|
105
121
|
};
|
|
106
|
-
PrismaTransaction: {
|
|
107
|
-
isTypeOnly: true;
|
|
108
|
-
};
|
|
109
122
|
relationHelpers: {};
|
|
110
123
|
scalarField: {};
|
|
111
124
|
TransactionalOperationContext: {
|
|
112
125
|
isTypeOnly: true;
|
|
113
126
|
};
|
|
127
|
+
WhereInput: {
|
|
128
|
+
isTypeOnly: true;
|
|
129
|
+
};
|
|
130
|
+
WhereUniqueInput: {
|
|
131
|
+
isTypeOnly: true;
|
|
132
|
+
};
|
|
114
133
|
}>>;
|
|
115
134
|
errorHandlerServiceImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
116
135
|
BadRequestError: {};
|
|
@@ -156,13 +175,24 @@ export declare const PRISMA_PRISMA_AUTHORIZER_UTILS_GENERATED: {
|
|
|
156
175
|
AnyOperationHooks: {
|
|
157
176
|
isTypeOnly: true;
|
|
158
177
|
};
|
|
178
|
+
commitCreate: {};
|
|
179
|
+
commitDelete: {};
|
|
180
|
+
commitUpdate: {};
|
|
181
|
+
composeCreate: {};
|
|
182
|
+
composeUpdate: {};
|
|
159
183
|
createParentModelConfig: {};
|
|
184
|
+
DataCreateInput: {
|
|
185
|
+
isTypeOnly: true;
|
|
186
|
+
};
|
|
187
|
+
DataDeleteInput: {
|
|
188
|
+
isTypeOnly: true;
|
|
189
|
+
};
|
|
160
190
|
DataOperationType: {
|
|
161
191
|
isTypeOnly: true;
|
|
162
192
|
};
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
193
|
+
DataUpdateInput: {
|
|
194
|
+
isTypeOnly: true;
|
|
195
|
+
};
|
|
166
196
|
FieldContext: {
|
|
167
197
|
isTypeOnly: true;
|
|
168
198
|
};
|
|
@@ -175,6 +205,8 @@ export declare const PRISMA_PRISMA_AUTHORIZER_UTILS_GENERATED: {
|
|
|
175
205
|
FieldTransformResult: {
|
|
176
206
|
isTypeOnly: true;
|
|
177
207
|
};
|
|
208
|
+
generateCreateSchema: {};
|
|
209
|
+
generateUpdateSchema: {};
|
|
178
210
|
GetPayload: {
|
|
179
211
|
isTypeOnly: true;
|
|
180
212
|
};
|
|
@@ -184,6 +216,9 @@ export declare const PRISMA_PRISMA_AUTHORIZER_UTILS_GENERATED: {
|
|
|
184
216
|
InferInput: {
|
|
185
217
|
isTypeOnly: true;
|
|
186
218
|
};
|
|
219
|
+
ModelInclude: {
|
|
220
|
+
isTypeOnly: true;
|
|
221
|
+
};
|
|
187
222
|
ModelPropName: {
|
|
188
223
|
isTypeOnly: true;
|
|
189
224
|
};
|
|
@@ -204,14 +239,17 @@ export declare const PRISMA_PRISMA_AUTHORIZER_UTILS_GENERATED: {
|
|
|
204
239
|
ParentModelConfig: {
|
|
205
240
|
isTypeOnly: true;
|
|
206
241
|
};
|
|
207
|
-
PrismaTransaction: {
|
|
208
|
-
isTypeOnly: true;
|
|
209
|
-
};
|
|
210
242
|
relationHelpers: {};
|
|
211
243
|
scalarField: {};
|
|
212
244
|
TransactionalOperationContext: {
|
|
213
245
|
isTypeOnly: true;
|
|
214
246
|
};
|
|
247
|
+
WhereInput: {
|
|
248
|
+
isTypeOnly: true;
|
|
249
|
+
};
|
|
250
|
+
WhereUniqueInput: {
|
|
251
|
+
isTypeOnly: true;
|
|
252
|
+
};
|
|
215
253
|
}>>;
|
|
216
254
|
errorHandlerServiceImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
217
255
|
BadRequestError: {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/generators/prisma/prisma-authorizer-utils/generated/index.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,wCAAwC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/generators/prisma/prisma-authorizer-utils/generated/index.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,wCAAwC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKpD,CAAC"}
|
|
@@ -29,13 +29,24 @@ export declare const PRISMA_PRISMA_AUTHORIZER_UTILS_RENDERERS: {
|
|
|
29
29
|
AnyOperationHooks: {
|
|
30
30
|
isTypeOnly: true;
|
|
31
31
|
};
|
|
32
|
+
commitCreate: {};
|
|
33
|
+
commitDelete: {};
|
|
34
|
+
commitUpdate: {};
|
|
35
|
+
composeCreate: {};
|
|
36
|
+
composeUpdate: {};
|
|
32
37
|
createParentModelConfig: {};
|
|
38
|
+
DataCreateInput: {
|
|
39
|
+
isTypeOnly: true;
|
|
40
|
+
};
|
|
41
|
+
DataDeleteInput: {
|
|
42
|
+
isTypeOnly: true;
|
|
43
|
+
};
|
|
33
44
|
DataOperationType: {
|
|
34
45
|
isTypeOnly: true;
|
|
35
46
|
};
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
47
|
+
DataUpdateInput: {
|
|
48
|
+
isTypeOnly: true;
|
|
49
|
+
};
|
|
39
50
|
FieldContext: {
|
|
40
51
|
isTypeOnly: true;
|
|
41
52
|
};
|
|
@@ -48,6 +59,8 @@ export declare const PRISMA_PRISMA_AUTHORIZER_UTILS_RENDERERS: {
|
|
|
48
59
|
FieldTransformResult: {
|
|
49
60
|
isTypeOnly: true;
|
|
50
61
|
};
|
|
62
|
+
generateCreateSchema: {};
|
|
63
|
+
generateUpdateSchema: {};
|
|
51
64
|
GetPayload: {
|
|
52
65
|
isTypeOnly: true;
|
|
53
66
|
};
|
|
@@ -57,6 +70,9 @@ export declare const PRISMA_PRISMA_AUTHORIZER_UTILS_RENDERERS: {
|
|
|
57
70
|
InferInput: {
|
|
58
71
|
isTypeOnly: true;
|
|
59
72
|
};
|
|
73
|
+
ModelInclude: {
|
|
74
|
+
isTypeOnly: true;
|
|
75
|
+
};
|
|
60
76
|
ModelPropName: {
|
|
61
77
|
isTypeOnly: true;
|
|
62
78
|
};
|
|
@@ -77,14 +93,17 @@ export declare const PRISMA_PRISMA_AUTHORIZER_UTILS_RENDERERS: {
|
|
|
77
93
|
ParentModelConfig: {
|
|
78
94
|
isTypeOnly: true;
|
|
79
95
|
};
|
|
80
|
-
PrismaTransaction: {
|
|
81
|
-
isTypeOnly: true;
|
|
82
|
-
};
|
|
83
96
|
relationHelpers: {};
|
|
84
97
|
scalarField: {};
|
|
85
98
|
TransactionalOperationContext: {
|
|
86
99
|
isTypeOnly: true;
|
|
87
100
|
};
|
|
101
|
+
WhereInput: {
|
|
102
|
+
isTypeOnly: true;
|
|
103
|
+
};
|
|
104
|
+
WhereUniqueInput: {
|
|
105
|
+
isTypeOnly: true;
|
|
106
|
+
};
|
|
88
107
|
}>>;
|
|
89
108
|
errorHandlerServiceImports: import("@baseplate-dev/sync").ProviderType<import("@baseplate-dev/core-generators").InferTsImportMapFromSchema<{
|
|
90
109
|
BadRequestError: {};
|
package/dist/generators/prisma/prisma-authorizer-utils/generated/template-renderers.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template-renderers.d.ts","sourceRoot":"","sources":["../../../../../src/generators/prisma/prisma-authorizer-utils/generated/template-renderers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,gCAAgC,CAAC;AACvF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAWzD,OAAO,EAAE,wCAAwC,EAAE,MAAM,sBAAsB,CAAC;AAEhF,MAAM,WAAW,oCAAoC;IACnD,SAAS,EAAE;QACT,MAAM,EAAE,CACN,OAAO,EAAE,IAAI,CACX,gCAAgC,CAC9B,OAAO,wCAAwC,CAAC,SAAS,CAC1D,EACD,oBAAoB,GAAG,OAAO,GAAG,OAAO,GAAG,gBAAgB,CAC5D,KACE,aAAa,CAAC;KACpB,CAAC;CACH;AAmDD,eAAO,MAAM,wCAAwC
|
|
1
|
+
{"version":3,"file":"template-renderers.d.ts","sourceRoot":"","sources":["../../../../../src/generators/prisma/prisma-authorizer-utils/generated/template-renderers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,gCAAgC,CAAC;AACvF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAWzD,OAAO,EAAE,wCAAwC,EAAE,MAAM,sBAAsB,CAAC;AAEhF,MAAM,WAAW,oCAAoC;IACnD,SAAS,EAAE;QACT,MAAM,EAAE,CACN,OAAO,EAAE,IAAI,CACX,gCAAgC,CAC9B,OAAO,wCAAwC,CAAC,SAAS,CAC1D,EACD,oBAAoB,GAAG,OAAO,GAAG,OAAO,GAAG,gBAAgB,CAC5D,KACE,aAAa,CAAC;KACpB,CAAC;CACH;AAmDD,eAAO,MAAM,wCAAwC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGpD,CAAC"}
|