@chili-publish/studio-connectors 1.10.1 → 1.11.6

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.
@@ -1,5 +1,5 @@
1
1
  export interface Dictionary {
2
- [Key: string]: string;
2
+ [Key: string]: string | boolean;
3
3
  }
4
4
  export type ChiliPlatform = 'web' | 'server';
5
5
  export interface ConnectorRuntimeContext {
@@ -66,3 +66,38 @@ export interface ConnectorConfigValue {
66
66
  readonly displayName: string;
67
67
  readonly type: ConnectorConfigValueType;
68
68
  }
69
+ /**
70
+ * A custom HTTP error for connectors.
71
+ *
72
+ * This should be thrown when any of the connector methods
73
+ * failed due to a non OK HTTP status code.
74
+ *
75
+ * The framework will be able to handle this error in a better way
76
+ * versus throwing a generic `Error`.
77
+ */
78
+ export interface ConnectorHttpError extends Error {
79
+ /**
80
+ * The HTTP status code associated with the error.
81
+ */
82
+ readonly status: number;
83
+ }
84
+ /**
85
+ * Interface for the constructor of ConnectorHttpError.
86
+ */
87
+ export interface ConnectorHttpErrorConstructor {
88
+ /**
89
+ * Creates a new ConnectorHttpError instance.
90
+ *
91
+ * @param status - The HTTP status code associated with the error.
92
+ * @param message - Optional error message.
93
+ * @returns A new instance of ConnectorHttpError.
94
+ */
95
+ new (status: number, message?: string): ConnectorHttpError;
96
+ /**
97
+ * The prototype of ConnectorHttpError.
98
+ */
99
+ readonly prototype: ConnectorHttpError;
100
+ }
101
+ declare global {
102
+ var ConnectorHttpError: ConnectorHttpErrorConstructor;
103
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chili-publish/studio-connectors",
3
- "version": "1.10.1",
3
+ "version": "1.11.6",
4
4
  "types": "dist/index.d.ts",
5
5
  "files": [
6
6
  "dist"