@notionhq/custom-blocks-host 0.1.10 → 0.1.11
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initErrors.d.ts","sourceRoot":"","sources":["../../src/lifecycle/initErrors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,wBAAwB,EACxB,wBAAwB,EACxB,MAAM,mDAAmD,CAAA;AAK1D;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CACxC,MAAM,EAAE,wBAAwB,EAChC,IAAI,GAAE;IACL,wBAAwB,CAAC,EAAE,MAAM,CAAA;IACjC,4BAA4B,CAAC,EAAE,MAAM,CAAA;CAChC,GACJ,wBAAwB,
|
|
1
|
+
{"version":3,"file":"initErrors.d.ts","sourceRoot":"","sources":["../../src/lifecycle/initErrors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,wBAAwB,EACxB,wBAAwB,EACxB,MAAM,mDAAmD,CAAA;AAK1D;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CACxC,MAAM,EAAE,wBAAwB,EAChC,IAAI,GAAE;IACL,wBAAwB,CAAC,EAAE,MAAM,CAAA;IACjC,4BAA4B,CAAC,EAAE,MAAM,CAAA;CAChC,GACJ,wBAAwB,CA+I1B"}
|
|
@@ -59,6 +59,12 @@ export function initErrorForFailureReason(reason, data = {}) {
|
|
|
59
59
|
isRetryable: false,
|
|
60
60
|
};
|
|
61
61
|
}
|
|
62
|
+
case "init_timeout":
|
|
63
|
+
return {
|
|
64
|
+
code: reason,
|
|
65
|
+
message: "Host dependencies did not finish loading before the timeout.",
|
|
66
|
+
isRetryable: true,
|
|
67
|
+
};
|
|
62
68
|
case "context_unavailable":
|
|
63
69
|
return {
|
|
64
70
|
code: reason,
|
|
@@ -127,12 +133,6 @@ export function initErrorForFailureReason(reason, data = {}) {
|
|
|
127
133
|
// The block must be embedded in an iframe.
|
|
128
134
|
isRetryable: false,
|
|
129
135
|
};
|
|
130
|
-
case "init_timeout":
|
|
131
|
-
return {
|
|
132
|
-
code: reason,
|
|
133
|
-
message: "Host did not respond to the `connect` message before the timeout.",
|
|
134
|
-
isRetryable: true,
|
|
135
|
-
};
|
|
136
136
|
case "unknown_error":
|
|
137
137
|
return {
|
|
138
138
|
code: reason,
|
|
@@ -2,14 +2,14 @@ import * as v from "valibot";
|
|
|
2
2
|
import type { CustomBlockErrorCode, CustomBlockErrorInfo } from "../errors.js";
|
|
3
3
|
import type { CustomBlockInitResultErrorCode } from "./initResult.js";
|
|
4
4
|
export declare const customBlockInitErrorCodeSchema: v.StringSchema<undefined>;
|
|
5
|
-
export type CustomBlockInitErrorCode = CustomBlockErrorCode<"manifest_unavailable" | "manifest_invalid" | "invalid_connect_payload" | "invalid_protocol_version" | "unsupported_protocol_version" | "context_unavailable" | "current_user_unavailable" | "missing_data_source_binding" | "data_source_unavailable" | "missing_property_binding" | "invalid_property_binding">;
|
|
5
|
+
export type CustomBlockInitErrorCode = CustomBlockErrorCode<"manifest_unavailable" | "manifest_invalid" | "invalid_connect_payload" | "invalid_protocol_version" | "unsupported_protocol_version" | "init_timeout" | "context_unavailable" | "current_user_unavailable" | "missing_data_source_binding" | "data_source_unavailable" | "missing_property_binding" | "invalid_property_binding">;
|
|
6
6
|
export type CustomBlockInitErrorInfo = CustomBlockErrorInfo<CustomBlockInitErrorCode>;
|
|
7
7
|
/**
|
|
8
8
|
* Every initialization failure visible to block code. This combines errors
|
|
9
9
|
* received in `init`, errors the sandbox reports in `initResult`, and failures
|
|
10
10
|
* detected locally while running `initCustomBlock()`.
|
|
11
11
|
*/
|
|
12
|
-
export type CustomBlockInitializationErrorCode = CustomBlockInitErrorCode | CustomBlockInitResultErrorCode | CustomBlockErrorCode<"not_in_iframe"
|
|
12
|
+
export type CustomBlockInitializationErrorCode = CustomBlockInitErrorCode | CustomBlockInitResultErrorCode | CustomBlockErrorCode<"not_in_iframe">;
|
|
13
13
|
export type CustomBlockInitializationErrorInfo = CustomBlockErrorInfo<CustomBlockInitializationErrorCode>;
|
|
14
14
|
export declare const customBlockInitErrorInfoSchema: v.ObjectSchema<{
|
|
15
15
|
readonly code: v.StringSchema<undefined>;
|
package/package.json
CHANGED
|
@@ -72,6 +72,12 @@ export function initErrorForFailureReason(
|
|
|
72
72
|
isRetryable: false,
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
+
case "init_timeout":
|
|
76
|
+
return {
|
|
77
|
+
code: reason,
|
|
78
|
+
message: "Host dependencies did not finish loading before the timeout.",
|
|
79
|
+
isRetryable: true,
|
|
80
|
+
}
|
|
75
81
|
case "context_unavailable":
|
|
76
82
|
return {
|
|
77
83
|
code: reason,
|
|
@@ -140,13 +146,6 @@ export function initErrorForFailureReason(
|
|
|
140
146
|
// The block must be embedded in an iframe.
|
|
141
147
|
isRetryable: false,
|
|
142
148
|
}
|
|
143
|
-
case "init_timeout":
|
|
144
|
-
return {
|
|
145
|
-
code: reason,
|
|
146
|
-
message:
|
|
147
|
-
"Host did not respond to the `connect` message before the timeout.",
|
|
148
|
-
isRetryable: true,
|
|
149
|
-
}
|
|
150
149
|
case "unknown_error":
|
|
151
150
|
return {
|
|
152
151
|
code: reason,
|