@edgestore/shared 0.5.7 → 0.6.0-canary.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/dist/index.d.ts DELETED
@@ -1,7 +0,0 @@
1
- export * from './errors';
2
- export * from './types';
3
- export * from './internals/bucketBuilder';
4
- export * from './internals/types';
5
- export * from './internals/providerTypes';
6
- export * from './internals/sharedFuncTypes';
7
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC"}
package/dist/index.js DELETED
@@ -1,295 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var zod = require('zod');
6
-
7
- function _define_property$1(obj, key, value) {
8
- if (key in obj) {
9
- Object.defineProperty(obj, key, {
10
- value: value,
11
- enumerable: true,
12
- configurable: true,
13
- writable: true
14
- });
15
- } else {
16
- obj[key] = value;
17
- }
18
- return obj;
19
- }
20
- /* eslint-disable @typescript-eslint/no-non-null-assertion */ const EDGE_STORE_ERROR_CODES = {
21
- BAD_REQUEST: 400,
22
- FILE_TOO_LARGE: 400,
23
- MIME_TYPE_NOT_ALLOWED: 400,
24
- UNAUTHORIZED: 401,
25
- UPLOAD_NOT_ALLOWED: 403,
26
- DELETE_NOT_ALLOWED: 403,
27
- CREATE_CONTEXT_ERROR: 500,
28
- SERVER_ERROR: 500
29
- };
30
- class EdgeStoreError extends Error {
31
- formattedMessage() {
32
- return `${this.message}${this.details ? `\n Details: ${JSON.stringify(this.details)}` : ''}${this.cause ? `\n Caused by: ${this.cause.message}` : ''}`;
33
- }
34
- formattedJson() {
35
- return {
36
- message: this.code === 'SERVER_ERROR' ? 'Internal server error' : this.message,
37
- code: this.code,
38
- details: this.details
39
- };
40
- }
41
- constructor(opts){
42
- super(opts.message);
43
- _define_property$1(this, "cause", void 0);
44
- _define_property$1(this, "code", void 0);
45
- _define_property$1(this, "level", void 0);
46
- _define_property$1(this, "details", void 0);
47
- this.name = 'EdgeStoreError';
48
- this.code = opts.code;
49
- this.cause = opts.cause;
50
- this.level = EDGE_STORE_ERROR_CODES[opts.code] >= 500 ? 'error' : 'warn';
51
- this.details = 'details' in opts ? opts.details : undefined;
52
- }
53
- }
54
-
55
- function _define_property(obj, key, value) {
56
- if (key in obj) {
57
- Object.defineProperty(obj, key, {
58
- value: value,
59
- enumerable: true,
60
- configurable: true,
61
- writable: true
62
- });
63
- } else {
64
- obj[key] = value;
65
- }
66
- return obj;
67
- }
68
- class EdgeStoreApiClientError extends Error {
69
- constructor(opts){
70
- super(opts.response.message);
71
- _define_property(this, "data", void 0);
72
- this.name = 'EdgeStoreApiClientError';
73
- this.data = opts.response;
74
- }
75
- }
76
-
77
- /**
78
- * Creates a Proxy that prints the path to the property when called.
79
- *
80
- * Example:
81
- *
82
- * ```ts
83
- * const pathParamProxy = createPathParamProxy();
84
- * console.log(pathParamProxy.ctx.user.id());
85
- * // Logs: "ctx.user.id"
86
- * console.log(pathParamProxy.input.type());
87
- * // Logs: "input.type"
88
- * ```
89
- */ function createPathParamProxy() {
90
- const getPath = (target, _prop)=>{
91
- const proxyFunction = ()=>target;
92
- return new Proxy(proxyFunction, {
93
- get: (_target, propChild)=>{
94
- return getPath(`${target}.${String(propChild)}`);
95
- }
96
- });
97
- };
98
- return new Proxy(()=>'', {
99
- get: (_target, prop)=>{
100
- return getPath(String(prop));
101
- }
102
- });
103
- }
104
-
105
- const createNewBuilder = (initDef, newDef)=>{
106
- const mergedDef = {
107
- ...initDef,
108
- ...newDef
109
- };
110
- return createBuilder({
111
- type: mergedDef.type
112
- }, mergedDef);
113
- };
114
- function createBuilder(opts, initDef) {
115
- const _def = {
116
- type: opts.type,
117
- input: zod.z.never(),
118
- path: [],
119
- metadata: ()=>({}),
120
- ...initDef
121
- };
122
- return {
123
- $config: {
124
- ctx: undefined
125
- },
126
- // @ts-expect-error - I think it would be too much work to make this type correct.
127
- _def,
128
- input (input) {
129
- return createNewBuilder(_def, {
130
- input
131
- });
132
- },
133
- path (pathResolver) {
134
- // TODO: Should throw a runtime error in the following cases:
135
- // 1. in case of multiple keys in one object
136
- // 2. in case of duplicate keys
137
- const pathParamProxy = createPathParamProxy();
138
- const params = pathResolver(pathParamProxy);
139
- return createNewBuilder(_def, {
140
- path: params
141
- });
142
- },
143
- metadata (metadata) {
144
- return createNewBuilder(_def, {
145
- metadata
146
- });
147
- },
148
- accessControl (accessControl) {
149
- return createNewBuilder(_def, {
150
- accessControl: accessControl
151
- });
152
- },
153
- beforeUpload (beforeUpload) {
154
- return createNewBuilder(_def, {
155
- beforeUpload
156
- });
157
- },
158
- beforeDelete (beforeDelete) {
159
- return createNewBuilder(_def, {
160
- beforeDelete
161
- });
162
- }
163
- };
164
- }
165
- class EdgeStoreBuilder {
166
- context() {
167
- return new EdgeStoreBuilder();
168
- }
169
- create() {
170
- return createEdgeStoreInner()();
171
- }
172
- }
173
- function createRouterFactory() {
174
- return function createRouterInner(buckets) {
175
- return {
176
- $config: {
177
- ctx: undefined
178
- },
179
- buckets
180
- };
181
- };
182
- }
183
- function initBucket(type, config) {
184
- return createBuilder({
185
- type
186
- }, {
187
- bucketConfig: config
188
- });
189
- }
190
- function createEdgeStoreInner() {
191
- return function initEdgeStoreInner() {
192
- return {
193
- /**
194
- * Builder object for creating an image bucket
195
- */ imageBucket (config) {
196
- return initBucket('IMAGE', config);
197
- },
198
- /**
199
- * Builder object for creating a file bucket
200
- */ fileBucket (config) {
201
- return initBucket('FILE', config);
202
- },
203
- /**
204
- * Create a router
205
- */ router: createRouterFactory()
206
- };
207
- };
208
- }
209
- /**
210
- * Initialize EdgeStore - be done exactly once per backend
211
- */ const initEdgeStore = new EdgeStoreBuilder(); // ↓↓↓ TYPE TESTS ↓↓↓
212
- // type Context = {
213
- // userId: string;
214
- // userRole: 'admin' | 'visitor';
215
- // };
216
- // const es = initEdgeStore.context<Context>().create();
217
- // const imagesBucket = es.imageBucket()
218
- // .input(
219
- // z.object({
220
- // type: z.enum(['profile', 'post']),
221
- // extension: z.string().optional(),
222
- // }),
223
- // )
224
- // .path(({ ctx, input }) => [{ author: ctx.userId }, { type: input.type }])
225
- // .metadata(({ ctx, input }) => ({
226
- // extension: input.extension,
227
- // role: ctx.userRole,
228
- // }))
229
- // .beforeUpload(() => {
230
- // return true;
231
- // });
232
- // const a = es.imageBucket()
233
- // .input(z.object({ type: z.string(), someMeta: z.string().optional() }))
234
- // .path(({ ctx, input }) => [{ author: ctx.userId }, { type: input.type }])
235
- // .metadata(({ ctx, input }) => ({
236
- // role: ctx.userRole,
237
- // someMeta: input.someMeta,
238
- // }))
239
- // .accessControl({
240
- // OR: [
241
- // {
242
- // userId: { path: 'author' }, // this will check if the userId is the same as the author in the path parameter
243
- // },
244
- // {
245
- // userRole: 'admin', // this is the same as { userRole: { eq: "admin" } }
246
- // },
247
- // ],
248
- // })
249
- // .beforeUpload(({ ctx, input }) => {
250
- // return true;
251
- // })
252
- // .beforeDelete(({ ctx, file }) => {
253
- // return true;
254
- // });
255
- // const b = es.imageBucket().path(({ ctx }) => [{ author: ctx.userId }]);
256
- // const router = es.router({
257
- // original: imagesBucket,
258
- // imageBucket: a,
259
- // imageBucket2: b,
260
- // });
261
- // export { router };
262
- // type ListFilesResponse<TBucket extends AnyRouter['buckets'][string]> = {
263
- // data: {
264
- // // url: string;
265
- // // size: number;
266
- // // uploadedAt: Date;
267
- // // metadata: InferMetadataObject<TBucket>;
268
- // path: InferBucketPathKeys<TBucket> extends string ? {
269
- // [key: string]: string;
270
- // } :{
271
- // [TKey in InferBucketPathKeys<TBucket>]: string;
272
- // };
273
- // }[];
274
- // pagination: {
275
- // currentPage: number;
276
- // totalPages: number;
277
- // totalCount: number;
278
- // };
279
- // };
280
- // type TPathKeys = 'author' | 'type';
281
- // type TPathKeys2 = InferBucketPathKeys<AnyBuilder>;
282
- // type ObjectWithKeys<TKeys extends string> = {
283
- // [TKey in TKeys]: string;
284
- // };
285
- // type Test1 = ObjectWithKeys<TPathKeys>;
286
- // type Test2 = ObjectWithKeys<TPathKeys2>;
287
- // type PathKeys = InferBucketPathKeys<typeof router.buckets.imageBucket>;
288
- // type MetadataKeys = InferMetadataObject<typeof router.buckets.imageBucket>;
289
- // type MyEdgeStoreRouter = typeof router;
290
- // type MyAccessControl = AccessControlSchema<Context, AnyDef>;
291
-
292
- exports.EDGE_STORE_ERROR_CODES = EDGE_STORE_ERROR_CODES;
293
- exports.EdgeStoreApiClientError = EdgeStoreApiClientError;
294
- exports.EdgeStoreError = EdgeStoreError;
295
- exports.initEdgeStore = initEdgeStore;
@@ -1,270 +0,0 @@
1
- import { z } from 'zod';
2
- import { type KeysOfUnion, type MaybePromise, type Simplify } from '../types';
3
- type Merge<TType, TWith> = {
4
- [TKey in keyof TType | keyof TWith]?: TKey extends keyof TType ? TKey extends keyof TWith ? TType[TKey] & TWith[TKey] : TType[TKey] : TWith[TKey & keyof TWith];
5
- };
6
- type ConvertStringToFunction<TType> = {
7
- [K in keyof TType]: TType[K] extends object ? Simplify<ConvertStringToFunction<TType[K]>> : () => string;
8
- };
9
- type UnionToIntersection<TType> = (TType extends any ? (k: TType) => void : never) extends (k: infer I) => void ? I : never;
10
- export type InferBucketPathKeys<TBucket extends Builder<any, AnyDef>> = KeysOfUnion<TBucket['_def']['path'][number]>;
11
- type InferBucketPathKeysFromDef<TDef extends AnyDef> = KeysOfUnion<TDef['path'][number]>;
12
- export type InferBucketPathObject<TBucket extends Builder<any, AnyDef>> = InferBucketPathKeys<TBucket> extends never ? Record<string, never> : {
13
- [TKey in InferBucketPathKeys<TBucket>]: string;
14
- };
15
- export type InferBucketPathObjectFromDef<TDef extends AnyDef> = InferBucketPathKeysFromDef<TDef> extends never ? Record<string, never> : {
16
- [TKey in InferBucketPathKeysFromDef<TDef>]: string;
17
- };
18
- export type InferMetadataObject<TBucket extends Builder<any, AnyDef>> = TBucket['_def']['metadata'] extends (...args: any) => any ? Awaited<ReturnType<TBucket['_def']['metadata']>> : Record<string, never>;
19
- type InferMetadataObjectFromDef<TDef extends AnyDef> = TDef['metadata'] extends (...args: any) => any ? Awaited<ReturnType<TDef['metadata']>> : Record<string, never>;
20
- export type AnyContext = Record<string, string | undefined | null>;
21
- export type AnyInput = z.AnyZodObject | z.ZodNever;
22
- export type AnyPath = Record<string, () => string>[];
23
- type PathParam<TPath extends AnyPath> = {
24
- path: keyof UnionToIntersection<TPath[number]>;
25
- };
26
- type Conditions<TPath extends AnyPath> = {
27
- eq?: string | PathParam<TPath>;
28
- lt?: string | PathParam<TPath>;
29
- lte?: string | PathParam<TPath>;
30
- gt?: string | PathParam<TPath>;
31
- gte?: string | PathParam<TPath>;
32
- contains?: string | PathParam<TPath>;
33
- in?: string | PathParam<TPath> | (string | PathParam<TPath>)[];
34
- not?: string | PathParam<TPath> | Conditions<TPath>;
35
- };
36
- export type AccessControlSchema<TCtx, TDef extends AnyDef> = Merge<{
37
- [TKey in keyof TCtx]?: string | PathParam<TDef['path']> | Conditions<TDef['path']>;
38
- }, {
39
- OR?: AccessControlSchema<TCtx, TDef>[];
40
- AND?: AccessControlSchema<TCtx, TDef>[];
41
- NOT?: AccessControlSchema<TCtx, TDef>[];
42
- }>;
43
- type BucketConfig = {
44
- /**
45
- * Maximum size for a single file in bytes
46
- *
47
- * e.g. 1024 * 1024 * 10 = 10MB
48
- */
49
- maxSize?: number;
50
- /**
51
- * Accepted MIME types
52
- *
53
- * e.g. ['image/jpeg', 'image/png']
54
- *
55
- * You can also use wildcards after the slash:
56
- *
57
- * e.g. ['image/*']
58
- */
59
- accept?: string[];
60
- };
61
- type FileInfo = {
62
- size: number;
63
- type: string;
64
- extension: string;
65
- fileName?: string;
66
- replaceTargetUrl?: string;
67
- temporary: boolean;
68
- };
69
- type BeforeUploadFn<TCtx, TDef extends AnyDef> = (params: {
70
- ctx: TCtx;
71
- input: z.infer<TDef['input']>;
72
- fileInfo: FileInfo;
73
- }) => MaybePromise<boolean>;
74
- type BeforeDeleteFn<TCtx, TDef extends AnyDef> = (params: {
75
- ctx: TCtx;
76
- fileInfo: {
77
- url: string;
78
- size: number;
79
- uploadedAt: Date;
80
- path: InferBucketPathObjectFromDef<TDef>;
81
- metadata: InferMetadataObjectFromDef<TDef>;
82
- };
83
- }) => MaybePromise<boolean>;
84
- export type AnyMetadata = Record<string, string | undefined | null>;
85
- type MetadataFn<TCtx, TInput extends AnyInput, TMetadata extends AnyMetadata> = (params: {
86
- ctx: TCtx;
87
- input: z.infer<TInput>;
88
- }) => MaybePromise<TMetadata>;
89
- export type AnyMetadataFn = MetadataFn<any, AnyInput, AnyMetadata>;
90
- type BucketType = 'IMAGE' | 'FILE';
91
- type Def<TInput extends AnyInput, TPath extends AnyPath, TMetadata extends AnyMetadataFn> = {
92
- type: BucketType;
93
- input: TInput;
94
- path: TPath;
95
- metadata: TMetadata;
96
- bucketConfig?: BucketConfig;
97
- accessControl?: AccessControlSchema<any, any>;
98
- beforeUpload?: BeforeUploadFn<any, any>;
99
- beforeDelete?: BeforeDeleteFn<any, any>;
100
- };
101
- type AnyDef = Def<AnyInput, AnyPath, AnyMetadataFn>;
102
- type Builder<TCtx, TDef extends AnyDef> = {
103
- /** only used for types */
104
- $config: {
105
- ctx: TCtx;
106
- };
107
- /**
108
- * @internal
109
- */
110
- _def: TDef;
111
- /**
112
- * You can set an input that will be required in every upload from the client.
113
- *
114
- * This can be used to add additional information to the file, like choose the file path or add metadata.
115
- */
116
- input<TInput extends AnyInput>(input: TInput): Builder<TCtx, {
117
- type: TDef['type'];
118
- input: TInput;
119
- path: TDef['path'];
120
- metadata: TDef['metadata'];
121
- bucketConfig: TDef['bucketConfig'];
122
- accessControl: TDef['accessControl'];
123
- beforeUpload: TDef['beforeUpload'];
124
- beforeDelete: TDef['beforeDelete'];
125
- }>;
126
- /**
127
- * The `path` is similar to folders in a file system.
128
- * But in this case, every segment of the path must have a meaning.
129
- *
130
- * ```
131
- * // e.g. 123/profile/file.jpg
132
- * {
133
- * author: '123',
134
- * type: 'profile',
135
- * }
136
- * ```
137
- */
138
- path<TParams extends AnyPath>(pathResolver: (params: {
139
- ctx: Simplify<ConvertStringToFunction<TCtx>>;
140
- input: Simplify<ConvertStringToFunction<z.infer<TDef['input']>>>;
141
- }) => [...TParams]): Builder<TCtx, {
142
- type: TDef['type'];
143
- input: TDef['input'];
144
- path: TParams;
145
- metadata: TDef['metadata'];
146
- bucketConfig: TDef['bucketConfig'];
147
- accessControl: TDef['accessControl'];
148
- beforeUpload: TDef['beforeUpload'];
149
- beforeDelete: TDef['beforeDelete'];
150
- }>;
151
- /**
152
- * This metadata will be added to every file uploaded to this bucket.
153
- *
154
- * This can be used, for example, to filter files.
155
- */
156
- metadata<TMetadata extends AnyMetadata>(metadata: MetadataFn<TCtx, TDef['input'], TMetadata>): Builder<TCtx, {
157
- type: TDef['type'];
158
- input: TDef['input'];
159
- path: TDef['path'];
160
- metadata: MetadataFn<any, any, TMetadata>;
161
- bucketConfig: TDef['bucketConfig'];
162
- accessControl: TDef['accessControl'];
163
- beforeUpload: TDef['beforeUpload'];
164
- beforeDelete: TDef['beforeDelete'];
165
- }>;
166
- /**
167
- * If you set this, your bucket will automatically be configured as a protected bucket.
168
- *
169
- * This means that images will only be accessible from within your app.
170
- * And only if it passes the check set in this function.
171
- */
172
- accessControl(accessControl: AccessControlSchema<TCtx, TDef>): Builder<TCtx, {
173
- type: TDef['type'];
174
- input: TDef['input'];
175
- path: TDef['path'];
176
- metadata: TDef['metadata'];
177
- bucketConfig: TDef['bucketConfig'];
178
- accessControl: AccessControlSchema<any, any>;
179
- beforeUpload: TDef['beforeUpload'];
180
- beforeDelete: TDef['beforeDelete'];
181
- }>;
182
- /**
183
- * return `true` to allow upload
184
- *
185
- * By default, every upload from your app is allowed.
186
- */
187
- beforeUpload(beforeUpload: BeforeUploadFn<TCtx, TDef>): Builder<TCtx, {
188
- type: TDef['type'];
189
- input: TDef['input'];
190
- path: TDef['path'];
191
- metadata: TDef['metadata'];
192
- bucketConfig: TDef['bucketConfig'];
193
- accessControl: TDef['accessControl'];
194
- beforeUpload: BeforeUploadFn<any, any>;
195
- beforeDelete: TDef['beforeDelete'];
196
- }>;
197
- /**
198
- * return `true` to allow delete
199
- *
200
- * This function must be defined if you want to delete files directly from the client.
201
- */
202
- beforeDelete(beforeDelete: BeforeDeleteFn<TCtx, TDef>): Builder<TCtx, {
203
- type: TDef['type'];
204
- input: TDef['input'];
205
- path: TDef['path'];
206
- metadata: TDef['metadata'];
207
- bucketConfig: TDef['bucketConfig'];
208
- accessControl: TDef['accessControl'];
209
- beforeUpload: TDef['beforeUpload'];
210
- beforeDelete: BeforeDeleteFn<any, any>;
211
- }>;
212
- };
213
- export type AnyBuilder = Builder<any, AnyDef>;
214
- declare class EdgeStoreBuilder<TCtx = Record<string, never>> {
215
- context<TNewContext extends AnyContext>(): EdgeStoreBuilder<TNewContext>;
216
- create(): {
217
- /**
218
- * Builder object for creating an image bucket
219
- */
220
- imageBucket(config?: BucketConfig): Builder<TCtx, {
221
- type: "IMAGE";
222
- input: z.ZodNever;
223
- path: [];
224
- metadata: () => Record<string, never>;
225
- bucketConfig?: BucketConfig;
226
- accessControl?: AccessControlSchema<any, any>;
227
- beforeUpload?: BeforeUploadFn<any, any>;
228
- beforeDelete?: BeforeDeleteFn<any, any>;
229
- }>;
230
- /**
231
- * Builder object for creating a file bucket
232
- */
233
- fileBucket(config?: BucketConfig): Builder<TCtx, {
234
- type: "FILE";
235
- input: z.ZodNever;
236
- path: [];
237
- metadata: () => Record<string, never>;
238
- bucketConfig?: BucketConfig;
239
- accessControl?: AccessControlSchema<any, any>;
240
- beforeUpload?: BeforeUploadFn<any, any>;
241
- beforeDelete?: BeforeDeleteFn<any, any>;
242
- }>;
243
- /**
244
- * Create a router
245
- */
246
- router: <TBuckets extends Record<string, Builder<TCtx, AnyDef>>>(buckets: TBuckets) => {
247
- $config: {
248
- ctx: TCtx;
249
- };
250
- buckets: TBuckets;
251
- };
252
- };
253
- }
254
- export type EdgeStoreRouter<TCtx> = {
255
- /**
256
- * Only used for types
257
- * @internal
258
- */
259
- $config: {
260
- ctx: TCtx;
261
- };
262
- buckets: Record<string, Builder<TCtx, AnyDef>>;
263
- };
264
- export type AnyRouter = EdgeStoreRouter<any>;
265
- /**
266
- * Initialize EdgeStore - be done exactly once per backend
267
- */
268
- export declare const initEdgeStore: EdgeStoreBuilder<Record<string, never>>;
269
- export {};
270
- //# sourceMappingURL=bucketBuilder.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bucketBuilder.d.ts","sourceRoot":"","sources":["../../src/internals/bucketBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,YAAY,EAAE,KAAK,QAAQ,EAAE,MAAM,UAAU,CAAC;AAG9E,KAAK,KAAK,CAAC,KAAK,EAAE,KAAK,IAAI;KACxB,IAAI,IAAI,MAAM,KAAK,GAAG,MAAM,KAAK,CAAC,CAAC,EAAE,IAAI,SAAS,MAAM,KAAK,GAC1D,IAAI,SAAS,MAAM,KAAK,GACtB,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,GACzB,KAAK,CAAC,IAAI,CAAC,GACb,KAAK,CAAC,IAAI,GAAG,MAAM,KAAK,CAAC;CAC9B,CAAC;AAEF,KAAK,uBAAuB,CAAC,KAAK,IAAI;KACnC,CAAC,IAAI,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,SAAS,MAAM,GACvC,QAAQ,CAAC,uBAAuB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAC3C,MAAM,MAAM;CACjB,CAAC;AAEF,KAAK,mB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AAC;KACxC,CACF,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;AAyF9C,cAAM,gBAAgB,CAAC,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC;IACjD,OAAO,CAAC,WAAW,SAAS,UAAU;IAItC,MAAM;QAyCF;;WAEG;6BACkB,YAAY;;;;4BAtHG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC;2BAW5C,YAAY;4BACX,mBAAmB,CAAC,GAAG,EAAE,GAAG,CAAC;2BAC9B,cAAc,CAAC,GAAG,EAAE,GAAG,CAAC;2BACxB,cAAc,CAAC,GAAG,EAAE,GAAG,CAAC;;QA2GrC;;WAEG;4BACiB,YAAY;;;;4BA5HI,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC;2BAW5C,YAAY;4BACX,mBAAmB,CAAC,GAAG,EAAE,GAAG,CAAC;2BAC9B,cAAc,CAAC,GAAG,EAAE,GAAG,CAAC;2BACxB,cAAc,CAAC,GAAG,EAAE,GAAG,CAAC;;QAiHrC;;WAEG;iBAnCL,QAAQ;;;;;;;CAjBX;AAED,MAAM,MAAM,eAAe,CAAC,IAAI,IAAI;IAClC;;;OAGG;IACH,OAAO,EAAE;QACP,GAAG,EAAE,IAAI,CAAC;KACX,CAAC;IACF,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;CAChD,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC;AA6C7C;;GAEG;AACH,eAAO,MAAM,aAAa,yCAAyB,CAAC"}
@@ -1,21 +0,0 @@
1
- type RecursivePathProxy = {
2
- (): string;
3
- ctx: any;
4
- input: any;
5
- };
6
- /**
7
- * Creates a Proxy that prints the path to the property when called.
8
- *
9
- * Example:
10
- *
11
- * ```ts
12
- * const pathParamProxy = createPathParamProxy();
13
- * console.log(pathParamProxy.ctx.user.id());
14
- * // Logs: "ctx.user.id"
15
- * console.log(pathParamProxy.input.type());
16
- * // Logs: "input.type"
17
- * ```
18
- */
19
- export declare function createPathParamProxy(): RecursivePathProxy;
20
- export {};
21
- //# sourceMappingURL=createPathParamProxy.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createPathParamProxy.d.ts","sourceRoot":"","sources":["../../src/internals/createPathParamProxy.ts"],"names":[],"mappings":"AAAA,KAAK,kBAAkB,GAAG;IACxB,IAAI,MAAM,CAAC;IACX,GAAG,EAAE,GAAG,CAAC;IACT,KAAK,EAAE,GAAG,CAAC;CACZ,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,IAAI,kBAAkB,CAoBzD"}