@zenstackhq/server 1.0.0-alpha.99 → 1.0.0-beta.2

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/api/rest/index.d.ts +19 -0
  2. package/api/rest/index.js +1271 -0
  3. package/api/rest/index.js.map +1 -0
  4. package/api/rpc/index.d.ts +2 -0
  5. package/api/rpc/index.js +166 -0
  6. package/api/rpc/index.js.map +1 -0
  7. package/api/utils.d.ts +18 -0
  8. package/api/utils.js +82 -0
  9. package/api/utils.js.map +1 -0
  10. package/express/index.d.ts +1 -0
  11. package/express/index.js +15 -0
  12. package/express/index.js.map +1 -1
  13. package/express/middleware.d.ts +2 -12
  14. package/express/middleware.js +50 -15
  15. package/express/middleware.js.map +1 -1
  16. package/fastify/index.d.ts +1 -0
  17. package/fastify/index.js +15 -0
  18. package/fastify/index.js.map +1 -1
  19. package/fastify/plugin.d.ts +2 -12
  20. package/fastify/plugin.js +35 -20
  21. package/fastify/plugin.js.map +1 -1
  22. package/next/app-route-handler.d.ts +15 -0
  23. package/next/app-route-handler.js +85 -0
  24. package/next/app-route-handler.js.map +1 -0
  25. package/next/index.d.ts +38 -0
  26. package/next/index.js +18 -0
  27. package/next/index.js.map +1 -0
  28. package/next/pages-route-handler.d.ts +9 -0
  29. package/next/pages-route-handler.js +73 -0
  30. package/next/pages-route-handler.js.map +1 -0
  31. package/package.json +17 -7
  32. package/sveltekit/handler.d.ts +19 -0
  33. package/sveltekit/handler.js +100 -0
  34. package/sveltekit/handler.js.map +1 -0
  35. package/sveltekit/index.d.ts +2 -0
  36. package/sveltekit/index.js +24 -0
  37. package/sveltekit/index.js.map +1 -0
  38. package/types.d.ts +97 -0
  39. package/types.js +3 -0
  40. package/types.js.map +1 -0
  41. package/utils.d.ts +17 -0
  42. package/utils.js +93 -0
  43. package/utils.js.map +1 -0
  44. package/openapi/index.d.ts +0 -46
  45. package/openapi/index.js +0 -193
  46. package/openapi/index.js.map +0 -1
  47. package/openapi/utils.d.ts +0 -4
  48. package/openapi/utils.js +0 -25
  49. package/openapi/utils.js.map +0 -1
@@ -0,0 +1,19 @@
1
+ import { RequestContext, Response } from '../../types';
2
+ /**
3
+ * Request handler options
4
+ */
5
+ export type Options = {
6
+ /**
7
+ * The base endpoint of the RESTful API, must be a valid URL
8
+ */
9
+ endpoint: string;
10
+ /**
11
+ * The default page size for limiting the number of results returned
12
+ * from collection queries, including resource collection, related data
13
+ * of collection types, and relashionship of collection types.
14
+ *
15
+ * Defaults to 100. Set to Infinity to disable pagination.
16
+ */
17
+ pageSize?: number;
18
+ };
19
+ export default function makeHandler(options: Options): ({ prisma, method, path, query, requestBody, logger, modelMeta, }: RequestContext) => Promise<Response>;