@webstudio-is/trpc-interface 0.91.0 → 0.260.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 (61) hide show
  1. package/package.json +26 -25
  2. package/src/authorize/project.server.test.ts +443 -0
  3. package/src/authorize/project.server.ts +309 -121
  4. package/src/authorize/role.ts +18 -0
  5. package/src/context/context.server.ts +59 -24
  6. package/src/context/errors.server.ts +16 -0
  7. package/src/context/router.server.ts +19 -0
  8. package/src/index.server.ts +15 -3
  9. package/src/shared/client.ts +0 -2
  10. package/src/shared/deployment.ts +23 -6
  11. package/src/shared/domain.ts +3 -3
  12. package/src/shared/plan-client.server.ts +7 -0
  13. package/src/shared/plan-features.ts +7 -0
  14. package/src/shared/shared-router.ts +0 -2
  15. package/src/shared/trpc.ts +5 -1
  16. package/src/trpc-caller-link.test.ts +1 -1
  17. package/src/trpc-caller-link.ts +1 -2
  18. package/tsconfig.json +3 -0
  19. package/lib/authorize/authorization-token.server.js +0 -72
  20. package/lib/authorize/project.server.js +0 -103
  21. package/lib/cjs/authorize/authorization-token.server.js +0 -92
  22. package/lib/cjs/authorize/project.server.js +0 -123
  23. package/lib/cjs/context/context.server.js +0 -16
  24. package/lib/cjs/context/errors.server.js +0 -29
  25. package/lib/cjs/index.js +0 -18
  26. package/lib/cjs/index.server.js +0 -40
  27. package/lib/cjs/package.json +0 -1
  28. package/lib/cjs/shared/authorization-router.js +0 -184
  29. package/lib/cjs/shared/client.js +0 -63
  30. package/lib/cjs/shared/deployment.js +0 -51
  31. package/lib/cjs/shared/domain.js +0 -98
  32. package/lib/cjs/shared/shared-router.js +0 -32
  33. package/lib/cjs/shared/trpc.js +0 -31
  34. package/lib/cjs/trpc-caller-link.js +0 -46
  35. package/lib/context/context.server.js +0 -0
  36. package/lib/context/errors.server.js +0 -9
  37. package/lib/index.js +0 -1
  38. package/lib/index.server.js +0 -10
  39. package/lib/shared/authorization-router.js +0 -164
  40. package/lib/shared/client.js +0 -35
  41. package/lib/shared/deployment.js +0 -31
  42. package/lib/shared/domain.js +0 -78
  43. package/lib/shared/shared-router.js +0 -12
  44. package/lib/shared/trpc.js +0 -11
  45. package/lib/trpc-caller-link.js +0 -26
  46. package/lib/types/authorize/authorization-token.server.d.ts +0 -21
  47. package/lib/types/authorize/project.server.d.ts +0 -25
  48. package/lib/types/context/context.server.d.ts +0 -53
  49. package/lib/types/context/errors.server.d.ts +0 -1
  50. package/lib/types/index.d.ts +0 -1
  51. package/lib/types/index.server.d.ts +0 -7
  52. package/lib/types/shared/authorization-router.d.ts +0 -276
  53. package/lib/types/shared/client.d.ts +0 -8
  54. package/lib/types/shared/deployment.d.ts +0 -45
  55. package/lib/types/shared/domain.d.ts +0 -119
  56. package/lib/types/shared/shared-router.d.ts +0 -415
  57. package/lib/types/shared/trpc.d.ts +0 -48
  58. package/lib/types/trpc-caller-link.d.ts +0 -16
  59. package/lib/types/trpc-caller-link.test.d.ts +0 -49
  60. package/src/authorize/authorization-token.server.ts +0 -106
  61. package/src/shared/authorization-router.ts +0 -198
@@ -1,17 +1,25 @@
1
1
  import { z } from "zod";
2
2
  import { router, procedure } from "./trpc";
3
3
 
4
- const PublishInput = z.object({
4
+ // Has corresponding type in saas
5
+ export const PublishInput = z.object({
5
6
  // used to load build data from the builder see routes/rest.build.$buildId.ts
6
7
  buildId: z.string(),
7
- builderApiOrigin: z.string(),
8
+ builderOrigin: z.string(),
9
+ githubSha: z.string().optional(),
10
+
11
+ destination: z.enum(["saas", "static"]),
8
12
  // preview support
9
13
  branchName: z.string(),
10
14
  // action log helper (not used for deployment, but for action logs readablity)
11
- projectDomainName: z.string(),
15
+ logProjectName: z.string(),
16
+ });
17
+
18
+ export const UnpublishInput = z.object({
19
+ domain: z.string(),
12
20
  });
13
21
 
14
- const Output = z.discriminatedUnion("success", [
22
+ export const Output = z.discriminatedUnion("success", [
15
23
  z.object({
16
24
  success: z.literal(true),
17
25
  }),
@@ -29,10 +37,19 @@ export const deploymentRouter = router({
29
37
  publish: procedure
30
38
  .input(PublishInput)
31
39
  .output(Output)
32
- .mutation(async ({ input, ctx }) => {
40
+ .mutation(() => {
41
+ return {
42
+ success: false,
43
+ error: "NOT_IMPLEMENTED",
44
+ };
45
+ }),
46
+ unpublish: procedure
47
+ .input(UnpublishInput)
48
+ .output(Output)
49
+ .mutation(() => {
33
50
  return {
34
51
  success: false,
35
- error: `Not implemented, use buildId=${input.buildId}`,
52
+ error: "NOT_IMPLEMENTED",
36
53
  };
37
54
  }),
38
55
  });
@@ -35,7 +35,7 @@ export const domainRouter = router({
35
35
  create: procedure
36
36
  .input(CreateInput)
37
37
  .output(createOutput(z.optional(z.undefined())))
38
- .mutation(async ({ input, ctx }) => {
38
+ .mutation(async ({ input }) => {
39
39
  const record = dnsTxtEntries.get(input.domain);
40
40
  if (record !== input.txtRecord) {
41
41
  // Return an error once then update the record
@@ -57,7 +57,7 @@ export const domainRouter = router({
57
57
  refresh: procedure
58
58
  .input(Input)
59
59
  .output(createOutput(z.optional(z.undefined())))
60
- .mutation(async ({ input, ctx }) => {
60
+ .mutation(async () => {
61
61
  return { success: true };
62
62
  }),
63
63
  /**
@@ -73,7 +73,7 @@ export const domainRouter = router({
73
73
  ])
74
74
  )
75
75
  )
76
- .query(async ({ input, ctx }) => {
76
+ .query(async ({ input }) => {
77
77
  const domainState = domainStates.get(input.domain);
78
78
 
79
79
  if (domainState === undefined) {
@@ -0,0 +1,7 @@
1
+ // Re-exported from @webstudio-is/plans — all plan client logic lives there.
2
+ export {
3
+ getPlanInfo,
4
+ getAuthorizationOwnerId,
5
+ parsePlansEnv,
6
+ __testing__,
7
+ } from "@webstudio-is/plans/index.server";
@@ -0,0 +1,7 @@
1
+ // Re-exported from @webstudio-is/plans — all plan feature logic lives there.
2
+ export {
3
+ PlanFeaturesSchema,
4
+ defaultPlanFeatures,
5
+ parsePlansEnv,
6
+ } from "@webstudio-is/plans";
7
+ export type { PlanFeatures, Purchase } from "@webstudio-is/plans";
@@ -1,11 +1,9 @@
1
1
  import type { createTRPCProxyClient } from "@trpc/client";
2
2
  import { router } from "./trpc";
3
- import { authorizationRouter } from "./authorization-router";
4
3
  import { domainRouter } from "./domain";
5
4
  import { deploymentRouter } from "./deployment";
6
5
 
7
6
  export const sharedRouter = router({
8
- authorize: authorizationRouter,
9
7
  domain: domainRouter,
10
8
  deployment: deploymentRouter,
11
9
  });
@@ -1,11 +1,15 @@
1
1
  import { initTRPC, type inferAsyncReturnType } from "@trpc/server";
2
2
 
3
3
  export const createContext = async () => {
4
- return {};
4
+ // Use any for typecheck at saas to not use ctx router types in satisfies constraints
5
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
6
+ return {} as any;
5
7
  };
6
8
 
7
9
  export type Context = inferAsyncReturnType<typeof createContext>;
8
10
 
11
+ // Here is different router and trpc types not the same as in ../context/router.server.ts
12
+ // And used only for saas shared routers
9
13
  export const { router, procedure, middleware } = initTRPC
10
14
  .context<Context>()
11
15
  .create();
@@ -1,5 +1,5 @@
1
1
  import { initTRPC } from "@trpc/server";
2
- import { describe, test, expect } from "@jest/globals";
2
+ import { describe, test, expect } from "vitest";
3
3
  import { callerLink } from "./trpc-caller-link";
4
4
  import { createTRPCProxyClient } from "@trpc/client";
5
5
  import { z } from "zod";
@@ -1,5 +1,4 @@
1
1
  import type { AnyRouter } from "@trpc/server";
2
- // eslint-disable-next-line import/no-internal-modules
3
2
  import { observable } from "@trpc/server/observable";
4
3
  import { TRPCClientError, type TRPCLink } from "@trpc/client";
5
4
 
@@ -21,7 +20,7 @@ export const callerLink = <TemplateRouter extends AnyRouter>(
21
20
  ): TRPCLink<TemplateRouter> => {
22
21
  const { appRouter, createContext } = opts;
23
22
 
24
- return (runtime) =>
23
+ return (_runtime) =>
25
24
  ({ op }) =>
26
25
  observable((observer) => {
27
26
  const caller = appRouter.createCaller(createContext?.() ?? {});
package/tsconfig.json ADDED
@@ -0,0 +1,3 @@
1
+ {
2
+ "extends": "@webstudio-is/tsconfig/base.json"
3
+ }
@@ -1,72 +0,0 @@
1
- const registerToken = async (props, context) => {
2
- const { authorization } = context;
3
- const { userId, authorizeTrpc } = authorization;
4
- if (userId === void 0) {
5
- throw new Error("The user must be authenticated to create a token");
6
- }
7
- await authorizeTrpc.create.mutate({
8
- namespace: "Project",
9
- id: props.projectId,
10
- relation: props.relation,
11
- subjectSet: {
12
- namespace: "Token",
13
- id: props.tokenId
14
- }
15
- });
16
- };
17
- const patchToken = async (props, prevRelation, nextRelation, context) => {
18
- const { authorization } = context;
19
- const { userId, authorizeTrpc } = authorization;
20
- if (userId === void 0) {
21
- throw new Error("The user must be authenticated to delete a token");
22
- }
23
- if (prevRelation !== nextRelation) {
24
- await authorizeTrpc.patch.mutate([
25
- {
26
- action: "delete",
27
- relationTuple: {
28
- namespace: "Project",
29
- id: props.projectId,
30
- relation: prevRelation,
31
- subjectSet: {
32
- namespace: "Token",
33
- id: props.tokenId
34
- }
35
- }
36
- },
37
- {
38
- action: "insert",
39
- relationTuple: {
40
- namespace: "Project",
41
- id: props.projectId,
42
- relation: nextRelation,
43
- subjectSet: {
44
- namespace: "Token",
45
- id: props.tokenId
46
- }
47
- }
48
- }
49
- ]);
50
- }
51
- };
52
- const unregisterToken = async (props, context) => {
53
- const { authorization } = context;
54
- const { userId, authorizeTrpc } = authorization;
55
- if (userId === void 0) {
56
- throw new Error("The user must be authenticated to delete a token");
57
- }
58
- await authorizeTrpc.delete.mutate({
59
- namespace: "Project",
60
- id: props.projectId,
61
- relation: props.relation,
62
- subjectSet: {
63
- namespace: "Token",
64
- id: props.tokenId
65
- }
66
- });
67
- };
68
- export {
69
- patchToken,
70
- registerToken,
71
- unregisterToken
72
- };
@@ -1,103 +0,0 @@
1
- const registerProjectOwner = async (props, context) => {
2
- const { authorization } = context;
3
- const { userId, authorizeTrpc } = authorization;
4
- if (userId === void 0) {
5
- throw new Error("The user must be authenticated to create a project");
6
- }
7
- await authorizeTrpc.create.mutate({
8
- namespace: "Project",
9
- id: props.projectId,
10
- relation: "owners",
11
- subjectSet: {
12
- namespace: "User",
13
- id: userId
14
- }
15
- });
16
- };
17
- const hasProjectPermit = async (props, context) => {
18
- const start = Date.now();
19
- try {
20
- const { authorization } = context;
21
- const { authorizeTrpc } = authorization;
22
- const checks = [];
23
- const namespace = "Project";
24
- if (props.permit === "view" && context.authorization.isServiceCall) {
25
- return true;
26
- }
27
- if (props.permit === "view" && props.projectId === "62154aaef0cb0860ccf85d6e") {
28
- return true;
29
- }
30
- if (props.permit === "view" && context.authorization.projectTemplates.includes(props.projectId)) {
31
- return true;
32
- }
33
- if (authorization.userId !== void 0) {
34
- checks.push(
35
- authorizeTrpc.check.query({
36
- subjectSet: {
37
- namespace: "User",
38
- id: authorization.userId
39
- },
40
- namespace,
41
- id: props.projectId,
42
- permit: props.permit
43
- })
44
- );
45
- }
46
- if (authorization.authToken !== void 0 && props.permit !== "own") {
47
- checks.push(
48
- authorizeTrpc.check.query({
49
- namespace,
50
- id: props.projectId,
51
- subjectSet: {
52
- id: authorization.authToken,
53
- namespace: "Token"
54
- },
55
- permit: props.permit
56
- })
57
- );
58
- }
59
- if (checks.length === 0) {
60
- return false;
61
- }
62
- const authResults = await Promise.allSettled(checks);
63
- for (const authResult of authResults) {
64
- if (authResult.status === "rejected") {
65
- throw new Error(`Authorization call failed ${authResult.reason}`);
66
- }
67
- }
68
- const allowed = authResults.some(
69
- (authResult) => authResult.status === "fulfilled" && authResult.value.allowed
70
- );
71
- return allowed;
72
- } finally {
73
- const diff = Date.now() - start;
74
- console.log(`hasProjectPermit execution ${diff}ms`);
75
- }
76
- };
77
- const getProjectPermit = async (props, context) => {
78
- const start = Date.now();
79
- try {
80
- const permitToCheck = props.permits;
81
- const permits = await Promise.allSettled(
82
- permitToCheck.map(
83
- (permit) => hasProjectPermit({ projectId: props.projectId, permit }, context)
84
- )
85
- );
86
- for (const permit of permits) {
87
- if (permit.status === "rejected") {
88
- throw new Error(`Authorization call failed ${permit.reason}`);
89
- }
90
- if (permit.value === true) {
91
- return permitToCheck[permits.indexOf(permit)];
92
- }
93
- }
94
- } finally {
95
- const diff = Date.now() - start;
96
- console.log(`getProjectPermit execution ${diff}ms`);
97
- }
98
- };
99
- export {
100
- getProjectPermit,
101
- hasProjectPermit,
102
- registerProjectOwner
103
- };
@@ -1,92 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var authorization_token_server_exports = {};
20
- __export(authorization_token_server_exports, {
21
- patchToken: () => patchToken,
22
- registerToken: () => registerToken,
23
- unregisterToken: () => unregisterToken
24
- });
25
- module.exports = __toCommonJS(authorization_token_server_exports);
26
- const registerToken = async (props, context) => {
27
- const { authorization } = context;
28
- const { userId, authorizeTrpc } = authorization;
29
- if (userId === void 0) {
30
- throw new Error("The user must be authenticated to create a token");
31
- }
32
- await authorizeTrpc.create.mutate({
33
- namespace: "Project",
34
- id: props.projectId,
35
- relation: props.relation,
36
- subjectSet: {
37
- namespace: "Token",
38
- id: props.tokenId
39
- }
40
- });
41
- };
42
- const patchToken = async (props, prevRelation, nextRelation, context) => {
43
- const { authorization } = context;
44
- const { userId, authorizeTrpc } = authorization;
45
- if (userId === void 0) {
46
- throw new Error("The user must be authenticated to delete a token");
47
- }
48
- if (prevRelation !== nextRelation) {
49
- await authorizeTrpc.patch.mutate([
50
- {
51
- action: "delete",
52
- relationTuple: {
53
- namespace: "Project",
54
- id: props.projectId,
55
- relation: prevRelation,
56
- subjectSet: {
57
- namespace: "Token",
58
- id: props.tokenId
59
- }
60
- }
61
- },
62
- {
63
- action: "insert",
64
- relationTuple: {
65
- namespace: "Project",
66
- id: props.projectId,
67
- relation: nextRelation,
68
- subjectSet: {
69
- namespace: "Token",
70
- id: props.tokenId
71
- }
72
- }
73
- }
74
- ]);
75
- }
76
- };
77
- const unregisterToken = async (props, context) => {
78
- const { authorization } = context;
79
- const { userId, authorizeTrpc } = authorization;
80
- if (userId === void 0) {
81
- throw new Error("The user must be authenticated to delete a token");
82
- }
83
- await authorizeTrpc.delete.mutate({
84
- namespace: "Project",
85
- id: props.projectId,
86
- relation: props.relation,
87
- subjectSet: {
88
- namespace: "Token",
89
- id: props.tokenId
90
- }
91
- });
92
- };
@@ -1,123 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var project_server_exports = {};
20
- __export(project_server_exports, {
21
- getProjectPermit: () => getProjectPermit,
22
- hasProjectPermit: () => hasProjectPermit,
23
- registerProjectOwner: () => registerProjectOwner
24
- });
25
- module.exports = __toCommonJS(project_server_exports);
26
- const registerProjectOwner = async (props, context) => {
27
- const { authorization } = context;
28
- const { userId, authorizeTrpc } = authorization;
29
- if (userId === void 0) {
30
- throw new Error("The user must be authenticated to create a project");
31
- }
32
- await authorizeTrpc.create.mutate({
33
- namespace: "Project",
34
- id: props.projectId,
35
- relation: "owners",
36
- subjectSet: {
37
- namespace: "User",
38
- id: userId
39
- }
40
- });
41
- };
42
- const hasProjectPermit = async (props, context) => {
43
- const start = Date.now();
44
- try {
45
- const { authorization } = context;
46
- const { authorizeTrpc } = authorization;
47
- const checks = [];
48
- const namespace = "Project";
49
- if (props.permit === "view" && context.authorization.isServiceCall) {
50
- return true;
51
- }
52
- if (props.permit === "view" && props.projectId === "62154aaef0cb0860ccf85d6e") {
53
- return true;
54
- }
55
- if (props.permit === "view" && context.authorization.projectTemplates.includes(props.projectId)) {
56
- return true;
57
- }
58
- if (authorization.userId !== void 0) {
59
- checks.push(
60
- authorizeTrpc.check.query({
61
- subjectSet: {
62
- namespace: "User",
63
- id: authorization.userId
64
- },
65
- namespace,
66
- id: props.projectId,
67
- permit: props.permit
68
- })
69
- );
70
- }
71
- if (authorization.authToken !== void 0 && props.permit !== "own") {
72
- checks.push(
73
- authorizeTrpc.check.query({
74
- namespace,
75
- id: props.projectId,
76
- subjectSet: {
77
- id: authorization.authToken,
78
- namespace: "Token"
79
- },
80
- permit: props.permit
81
- })
82
- );
83
- }
84
- if (checks.length === 0) {
85
- return false;
86
- }
87
- const authResults = await Promise.allSettled(checks);
88
- for (const authResult of authResults) {
89
- if (authResult.status === "rejected") {
90
- throw new Error(`Authorization call failed ${authResult.reason}`);
91
- }
92
- }
93
- const allowed = authResults.some(
94
- (authResult) => authResult.status === "fulfilled" && authResult.value.allowed
95
- );
96
- return allowed;
97
- } finally {
98
- const diff = Date.now() - start;
99
- console.log(`hasProjectPermit execution ${diff}ms`);
100
- }
101
- };
102
- const getProjectPermit = async (props, context) => {
103
- const start = Date.now();
104
- try {
105
- const permitToCheck = props.permits;
106
- const permits = await Promise.allSettled(
107
- permitToCheck.map(
108
- (permit) => hasProjectPermit({ projectId: props.projectId, permit }, context)
109
- )
110
- );
111
- for (const permit of permits) {
112
- if (permit.status === "rejected") {
113
- throw new Error(`Authorization call failed ${permit.reason}`);
114
- }
115
- if (permit.value === true) {
116
- return permitToCheck[permits.indexOf(permit)];
117
- }
118
- }
119
- } finally {
120
- const diff = Date.now() - start;
121
- console.log(`getProjectPermit execution ${diff}ms`);
122
- }
123
- };
@@ -1,16 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __copyProps = (to, from, except, desc) => {
7
- if (from && typeof from === "object" || typeof from === "function") {
8
- for (let key of __getOwnPropNames(from))
9
- if (!__hasOwnProp.call(to, key) && key !== except)
10
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
- }
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
- var context_server_exports = {};
16
- module.exports = __toCommonJS(context_server_exports);
@@ -1,29 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var errors_server_exports = {};
20
- __export(errors_server_exports, {
21
- AuthorizationError: () => AuthorizationError
22
- });
23
- module.exports = __toCommonJS(errors_server_exports);
24
- var import_ts_custom_error = require("ts-custom-error");
25
- const AuthorizationError = (0, import_ts_custom_error.customErrorFactory)(
26
- function AuthorizationError2(message) {
27
- this.message = message;
28
- }
29
- );
package/lib/cjs/index.js DELETED
@@ -1,18 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __copyProps = (to, from, except, desc) => {
7
- if (from && typeof from === "object" || typeof from === "function") {
8
- for (let key of __getOwnPropNames(from))
9
- if (!__hasOwnProp.call(to, key) && key !== except)
10
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
- }
12
- return to;
13
- };
14
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
- var src_exports = {};
17
- module.exports = __toCommonJS(src_exports);
18
- __reExport(src_exports, require("./index.server"), module.exports);
@@ -1,40 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var index_server_exports = {};
30
- __export(index_server_exports, {
31
- AuthorizationError: () => import_errors.AuthorizationError,
32
- authorizeAuthorizationToken: () => authorizeAuthorizationToken,
33
- authorizeProject: () => authorizeProject,
34
- createTrpcProxyServiceClient: () => import_client.createTrpcProxyServiceClient
35
- });
36
- module.exports = __toCommonJS(index_server_exports);
37
- var import_client = require("./shared/client");
38
- var import_errors = require("./context/errors.server");
39
- var authorizeProject = __toESM(require("./authorize/project.server"), 1);
40
- var authorizeAuthorizationToken = __toESM(require("./authorize/authorization-token.server"), 1);
@@ -1 +0,0 @@
1
- {"type":"commonjs"}