@webstudio-is/trpc-interface 0.63.0 → 0.65.0

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.
@@ -0,0 +1,29 @@
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
+ );
@@ -28,11 +28,13 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
29
  var index_server_exports = {};
30
30
  __export(index_server_exports, {
31
+ AuthorizationError: () => import_errors.AuthorizationError,
31
32
  authorizeAuthorizationToken: () => authorizeAuthorizationToken,
32
33
  authorizeProject: () => authorizeProject,
33
34
  createTrpcProxyServiceClient: () => import_client.createTrpcProxyServiceClient
34
35
  });
35
36
  module.exports = __toCommonJS(index_server_exports);
36
37
  var import_client = require("./shared/client");
38
+ var import_errors = require("./context/errors.server");
37
39
  var authorizeProject = __toESM(require("./authorize/project.server"), 1);
38
40
  var authorizeAuthorizationToken = __toESM(require("./authorize/authorization-token.server"), 1);
@@ -0,0 +1,9 @@
1
+ import { customErrorFactory } from "ts-custom-error";
2
+ const AuthorizationError = customErrorFactory(
3
+ function AuthorizationError2(message) {
4
+ this.message = message;
5
+ }
6
+ );
7
+ export {
8
+ AuthorizationError
9
+ };
@@ -1,7 +1,9 @@
1
1
  import { createTrpcProxyServiceClient } from "./shared/client";
2
+ import { AuthorizationError } from "./context/errors.server";
2
3
  import * as authorizeProject from "./authorize/project.server";
3
4
  import * as authorizeAuthorizationToken from "./authorize/authorization-token.server";
4
5
  export {
6
+ AuthorizationError,
5
7
  authorizeAuthorizationToken,
6
8
  authorizeProject,
7
9
  createTrpcProxyServiceClient
@@ -0,0 +1 @@
1
+ export declare const AuthorizationError: import("ts-custom-error").CustomErrorConstructor<import("ts-custom-error").CustomErrorProperties>;
@@ -1,6 +1,7 @@
1
1
  export type { SharedRouter } from "./shared/shared-router";
2
2
  export { createTrpcProxyServiceClient } from "./shared/client";
3
3
  export type { AppContext } from "./context/context.server";
4
+ export { AuthorizationError } from "./context/errors.server";
4
5
  export * as authorizeProject from "./authorize/project.server";
5
6
  export * as authorizeAuthorizationToken from "./authorize/authorization-token.server";
6
7
  export type { AuthPermit } from "./shared/authorization-router";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webstudio-is/trpc-interface",
3
- "version": "0.63.0",
3
+ "version": "0.65.0",
4
4
  "description": "Webstudio TRPC Interface",
5
5
  "author": "Webstudio <github@webstudio.is>",
6
6
  "homepage": "https://webstudio.is",
@@ -9,9 +9,10 @@
9
9
  "@trpc/client": "^10.9.0",
10
10
  "@trpc/server": "^10.9.0",
11
11
  "node-fetch": "2",
12
+ "ts-custom-error": "^3.3.1",
12
13
  "uuid": "^9.0.0",
13
14
  "zod": "^3.19.1",
14
- "@webstudio-is/prisma-client": "^0.63.0"
15
+ "@webstudio-is/prisma-client": "^0.65.0"
15
16
  },
16
17
  "devDependencies": {
17
18
  "@types/node": "^18.11.18",
@@ -0,0 +1,7 @@
1
+ import { customErrorFactory } from "ts-custom-error";
2
+
3
+ export const AuthorizationError = customErrorFactory(
4
+ function AuthorizationError(message: string) {
5
+ this.message = message;
6
+ }
7
+ );
@@ -2,6 +2,7 @@ export type { SharedRouter } from "./shared/shared-router";
2
2
  export { createTrpcProxyServiceClient } from "./shared/client";
3
3
 
4
4
  export type { AppContext } from "./context/context.server";
5
+ export { AuthorizationError } from "./context/errors.server";
5
6
  export * as authorizeProject from "./authorize/project.server";
6
7
  export * as authorizeAuthorizationToken from "./authorize/authorization-token.server";
7
8
  export type { AuthPermit } from "./shared/authorization-router";