@notionhq/custom-blocks 0.3.2 → 0.3.4

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 (100) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +13 -19
  3. package/dist/bridge/SandboxBridge.d.ts +0 -2
  4. package/dist/bridge/SandboxBridge.d.ts.map +1 -1
  5. package/dist/bridge/SandboxBridge.js +16 -39
  6. package/dist/bridge/SandboxInitialization.d.ts +1 -3
  7. package/dist/bridge/SandboxInitialization.d.ts.map +1 -1
  8. package/dist/bridge/SandboxInitialization.js +13 -15
  9. package/dist/bridge/appearance.d.ts +2 -10
  10. package/dist/bridge/appearance.d.ts.map +1 -1
  11. package/dist/bridge/appearance.js +2 -10
  12. package/dist/bridge/dataSources/query.d.ts +1 -2
  13. package/dist/bridge/dataSources/query.d.ts.map +1 -1
  14. package/dist/bridge/dataSources/query.js +15 -398
  15. package/dist/bridge/dataSources/queryFilter.d.ts +10 -0
  16. package/dist/bridge/dataSources/queryFilter.d.ts.map +1 -0
  17. package/dist/bridge/dataSources/queryFilter.js +123 -0
  18. package/dist/bridge/dataSources/resolveProperty.d.ts +1 -20
  19. package/dist/bridge/dataSources/resolveProperty.d.ts.map +1 -1
  20. package/dist/bridge/dataSources/resolveProperty.js +37 -32
  21. package/dist/bridge/dataSources/resolvePropertyAddress.d.ts +10 -0
  22. package/dist/bridge/dataSources/resolvePropertyAddress.d.ts.map +1 -0
  23. package/dist/bridge/dataSources/resolvePropertyAddress.js +55 -0
  24. package/dist/bridge/dataSources/resolveSorts.d.ts +10 -0
  25. package/dist/bridge/dataSources/resolveSorts.d.ts.map +1 -0
  26. package/dist/bridge/dataSources/resolveSorts.js +80 -0
  27. package/dist/bridge/hostState.d.ts +3 -7
  28. package/dist/bridge/hostState.d.ts.map +1 -1
  29. package/dist/bridge/hostState.js +0 -24
  30. package/dist/bridge/page.d.ts +9 -3
  31. package/dist/bridge/page.d.ts.map +1 -1
  32. package/dist/bridge/page.js +19 -2
  33. package/dist/bridge/readLocalManifest.d.ts +23 -0
  34. package/dist/bridge/readLocalManifest.d.ts.map +1 -0
  35. package/dist/bridge/readLocalManifest.js +46 -0
  36. package/dist/bridge/sandboxClient.d.ts +0 -2
  37. package/dist/bridge/sandboxClient.d.ts.map +1 -1
  38. package/dist/bridge/sandboxClient.js +50 -24
  39. package/dist/protocol/dataSources/dataSourcePage.d.ts +3 -4
  40. package/dist/protocol/dataSources/dataSourcePage.js +2 -3
  41. package/dist/protocol/index.d.ts +1 -0
  42. package/dist/protocol/index.js +1 -0
  43. package/dist/protocol/isLocalBlockServerUrl.d.ts +2 -0
  44. package/dist/protocol/isLocalBlockServerUrl.js +9 -0
  45. package/dist/protocol/messages/connect.d.ts +2 -2
  46. package/dist/protocol/messages/connect.js +2 -2
  47. package/dist/protocol/messages/createPage.d.ts +1 -1
  48. package/dist/protocol/messages/createPage.js +1 -1
  49. package/dist/protocol/messages/createPageResult.d.ts +3 -3
  50. package/dist/protocol/messages/createPageResult.js +4 -4
  51. package/dist/protocol/messages/getPage.d.ts +2 -2
  52. package/dist/protocol/messages/getPage.js +4 -4
  53. package/dist/protocol/messages/hostToSandbox.d.ts +3 -3
  54. package/dist/protocol/messages/hostToSandbox.js +10 -10
  55. package/dist/protocol/messages/init.d.ts +1 -1
  56. package/dist/protocol/messages/queryDataSource.d.ts +24 -0
  57. package/dist/protocol/messages/queryDataSource.js +2 -0
  58. package/dist/protocol/messages/queryDataSourceResult.d.ts +3 -3
  59. package/dist/protocol/messages/queryDataSourceResult.js +5 -5
  60. package/dist/protocol/messages/sandboxToHost.d.ts +8 -0
  61. package/dist/protocol/messages/updatePageResult.d.ts +3 -3
  62. package/dist/protocol/messages/updatePageResult.js +4 -4
  63. package/dist/protocol/pages/page.d.ts +4 -4
  64. package/dist/protocol/pages/page.js +2 -2
  65. package/dist/protocol/parent.d.ts +1 -1
  66. package/dist/protocol/protocolVersion.d.ts +3 -2
  67. package/dist/protocol/protocolVersion.js +4 -2
  68. package/dist/react/useDataSource.d.ts +2 -2
  69. package/dist/react/useDataSource.js +2 -2
  70. package/dist/types.d.ts +5 -5
  71. package/dist/types.d.ts.map +1 -1
  72. package/dist/version.js +1 -1
  73. package/docs/block-location.md +6 -4
  74. package/docs/bridge-interceptors.md +4 -0
  75. package/docs/build-tools.md +58 -0
  76. package/docs/data-sources.md +24 -18
  77. package/docs/deployment.md +23 -36
  78. package/docs/errors.md +75 -52
  79. package/docs/lifecycle.md +10 -3
  80. package/docs/pages.md +84 -76
  81. package/docs/users.md +4 -4
  82. package/package.json +4 -19
  83. package/src/bridge/SandboxBridge.ts +18 -48
  84. package/src/bridge/SandboxInitialization.ts +14 -20
  85. package/src/bridge/appearance.ts +2 -10
  86. package/src/bridge/dataSources/query.ts +17 -530
  87. package/src/bridge/dataSources/queryFilter.ts +181 -0
  88. package/src/bridge/dataSources/resolveProperty.ts +48 -39
  89. package/src/bridge/dataSources/resolvePropertyAddress.ts +62 -0
  90. package/src/bridge/dataSources/resolveSorts.ts +107 -0
  91. package/src/bridge/hostState.ts +3 -43
  92. package/src/bridge/page.ts +28 -4
  93. package/src/bridge/readLocalManifest.ts +60 -0
  94. package/src/bridge/sandboxClient.ts +63 -38
  95. package/src/react/useDataSource.ts +2 -2
  96. package/src/types.ts +5 -5
  97. package/dist/bridge/loadManifest.d.ts +0 -21
  98. package/dist/bridge/loadManifest.d.ts.map +0 -1
  99. package/dist/bridge/loadManifest.js +0 -85
  100. package/src/bridge/loadManifest.ts +0 -114
@@ -16,12 +16,11 @@ import type {
16
16
  } from "../types.js"
17
17
  import {
18
18
  type CustomBlockHostState,
19
+ createEmptyDataSourceQueryState,
19
20
  type DataSourceQueryView,
20
- getDataSourceQueryView as getDataSourceQueryViewWithBridge,
21
21
  } from "./hostState.js"
22
- import type { ManifestLoadResult } from "./loadManifest.js"
23
22
  import type { MessageInterceptor } from "./messageInterceptor.js"
24
- import { toNotionPageFromNotionPageData } from "./page.js"
23
+ import { makeUpdatePageByKey, toNotionPageFromBridgePage } from "./page.js"
25
24
  import {
26
25
  type MessageLogEntry,
27
26
  type QueryDataSourceArgs,
@@ -44,10 +43,6 @@ export const customBlockHost = {
44
43
  return getBridge().registerMessageInterceptor(interceptor)
45
44
  },
46
45
 
47
- sendConnect: (manifestResult: ManifestLoadResult) => {
48
- getBridge().sendConnect(manifestResult)
49
- },
50
-
51
46
  initialize: () => getBridge().initialize(),
52
47
 
53
48
  subscribe: (listener: () => void) => {
@@ -75,6 +70,13 @@ export const customBlockHost = {
75
70
  },
76
71
  }
77
72
 
73
+ const EMPTY_QUERY_VIEW: DataSourceQueryView = {
74
+ items: [],
75
+ propertyIdsByKey: {},
76
+ isLoading: false,
77
+ hasMore: false,
78
+ }
79
+
78
80
  export const customBlockDataSources = {
79
81
  createSubscriptionId: () => {
80
82
  return getBridge().createDataSourceSubscriptionId()
@@ -93,37 +95,60 @@ export const customBlockDataSources = {
93
95
  key: string,
94
96
  subscriptionId: string,
95
97
  ): DataSourceQueryView => {
96
- return getDataSourceQueryViewWithBridge(
97
- hostState,
98
- key,
99
- subscriptionId,
100
- ({ page: pageData, dataSource }) => {
101
- const bridge = getBridge()
102
- const update = async (
103
- args: Parameters<SandboxBridge["updatePage"]>[0],
104
- ): Promise<UpdatePageResult> => {
105
- const result = await bridge.updatePage(args)
106
- if (result.status === "error") {
107
- return result
108
- }
109
- Object.assign(page, result.page)
110
- return { status: "success", page }
111
- }
112
- const page: NotionPage = toNotionPageFromNotionPageData({
113
- page: pageData,
114
- dataSourceKey: key,
115
- getPropertyById: propertyId =>
116
- bridge.getPropertyById({ page, propertyId }),
117
- getPropertyByKey: propertyKey =>
118
- bridge.getPropertyByKey({ page, dataSource, propertyKey }),
119
- updateById: payload =>
120
- update({ ...payload, pageId: page.id, dataSource: undefined }),
121
- updateByKey: payload =>
122
- update({ ...payload, pageId: page.id, dataSource }),
123
- })
124
- return page
125
- },
126
- )
98
+ if (hostState.status !== "initialized") {
99
+ return EMPTY_QUERY_VIEW
100
+ }
101
+
102
+ const dataSource = hostState.dataSources.find(entry => entry.key === key)
103
+ const subscriptionState = hostState.dataSourceState[subscriptionId]
104
+ const queryState =
105
+ subscriptionState?.dataSourceKey === key
106
+ ? subscriptionState
107
+ : createEmptyDataSourceQueryState(key)
108
+
109
+ const items =
110
+ dataSource === undefined
111
+ ? []
112
+ : queryState.items.map(bridgePage => {
113
+ const bridge = getBridge()
114
+ const update = async (
115
+ args: Parameters<SandboxBridge["updatePage"]>[0],
116
+ ): Promise<UpdatePageResult> => {
117
+ const result = await bridge.updatePage(args)
118
+ if (result.status === "error") {
119
+ return result
120
+ }
121
+ Object.assign(page, result.page)
122
+ return { status: "success", page }
123
+ }
124
+ const page: NotionPage = toNotionPageFromBridgePage({
125
+ bridgePage,
126
+ dataSourceKey: key,
127
+ getPropertyById: propertyId =>
128
+ bridge.getPropertyById({ page, propertyId }),
129
+ getPropertyByKey: propertyKey =>
130
+ bridge.getPropertyByKey({ page, dataSource, propertyKey }),
131
+ updateById: payload =>
132
+ update({
133
+ ...payload,
134
+ pageId: page.id,
135
+ dataSource: undefined,
136
+ }),
137
+ updateByKey: makeUpdatePageByKey({
138
+ dataSource,
139
+ update: payload =>
140
+ update({ ...payload, pageId: page.id, dataSource }),
141
+ }),
142
+ })
143
+ return page
144
+ })
145
+
146
+ return {
147
+ items,
148
+ propertyIdsByKey: dataSource?.propertyIdsByKey ?? {},
149
+ isLoading: queryState.isLoading,
150
+ hasMore: queryState.hasMore,
151
+ }
127
152
  },
128
153
  }
129
154
 
@@ -21,8 +21,8 @@ type DataSourceHookState = {
21
21
  * Reads from the data source mapped to the given semantic `key`.
22
22
  *
23
23
  * @param key - The semantic data source key the block is wired to (e.g. `"people"`).
24
- * @param options - Optional live snapshot options. `limit` defaults to 20 and
25
- * is capped at 999. `sorts` are applied in array order.
24
+ * @param options - Optional live snapshot options. The host enforces the maximum row
25
+ * limit. `sorts` are applied in array order.
26
26
  *
27
27
  * @example
28
28
  * const { items, propertyIdsByKey, isLoading, hasMore, error } = useDataSource("default", { limit: 25 })
package/src/types.ts CHANGED
@@ -41,11 +41,11 @@ import type {
41
41
  import type { CustomBlockQueryDataSourceErrorInfo } from "@notionhq/custom-blocks-protocol/messages/queryDataSourceResult.js"
42
42
  import type { CustomBlockUpdatePageErrorInfo } from "@notionhq/custom-blocks-protocol/messages/updatePageResult.js"
43
43
  import type {
44
+ bridgePageSchema,
44
45
  NotionPageCover,
45
46
  NotionPageIcon,
46
47
  NotionPagePropertyValue,
47
48
  NotionPagePropertyWriteMap,
48
- notionPageDataSchema,
49
49
  } from "@notionhq/custom-blocks-protocol/pages/page.js"
50
50
  import type { InferOutput } from "valibot"
51
51
 
@@ -104,7 +104,7 @@ export type NotionPagePropertyInputMap = {
104
104
  [propertyIdOrKey: string]: NotionPagePropertyInputValue
105
105
  }
106
106
 
107
- export type NotionPage = InferOutput<typeof notionPageDataSchema> & {
107
+ export type NotionPage = InferOutput<typeof bridgePageSchema> & {
108
108
  dataSourceKey: string | null
109
109
  getPropertyById: (propertyId: string) => NotionPagePropertyValue | null
110
110
  getPropertyByKey: (propertyKey: string) => NotionPagePropertyValue | null
@@ -232,9 +232,9 @@ export type UseDataSourceOptions = DataSourceQueryOptions
232
232
  * parent shape; see https://developers.notion.com/reference/data-source.
233
233
  *
234
234
  * - `page_id`: Create a child page under the given Notion page.
235
- * - `data_source_id`: Create a row inside the given Notion data source (aka the internal
236
- * collection). The public API's `data_source_id` is the same UUID as the `collectionPointer.id`
237
- * exposed in `dataSources`, so either value works here.
235
+ * - `data_source_id`: Create a row inside the given Notion data source. The public API's
236
+ * `data_source_id` is the same UUID as the `collectionPointer.id` exposed in `dataSources`,
237
+ * so either value works here.
238
238
  * - `data_source_key`: Create a row inside the data source that the custom block was configured with
239
239
  * under this semantic key. The SDK resolves the key to a `data_source_id` locally before
240
240
  * sending the request to the host.
@@ -1,21 +0,0 @@
1
- import type { CustomBlockErrorInfo } from "../protocol/errors.js";
2
- import { type CustomBlockManifest } from "../protocol/manifest.js";
3
- type CustomBlockConnectErrorCode = "manifest_unavailable" | "manifest_invalid" | (string & {});
4
- type CustomBlockConnectError = CustomBlockErrorInfo<CustomBlockConnectErrorCode>;
5
- export type ManifestLoadResult = {
6
- manifest: CustomBlockManifest | null;
7
- error?: undefined;
8
- } | {
9
- manifest: null;
10
- error: CustomBlockConnectError;
11
- };
12
- /**
13
- * On the literal `localhost` hostname, attempts to load the custom block's optional self-hosted
14
- * manifest exposed by the worker dev shell, requested at the page-relative `manifest` path so
15
- * blocks served from a subpath resolve it against their own base.
16
- *
17
- * It is up to the host to decide whether to use this manifest or provide its own persisted manifest.
18
- */
19
- export declare function attemptToLoadSelfHostedManifest(hostname?: string | undefined): Promise<ManifestLoadResult>;
20
- export {};
21
- //# sourceMappingURL=loadManifest.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"loadManifest.d.ts","sourceRoot":"","sources":["../../src/bridge/loadManifest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAA;AACtF,OAAO,EACN,KAAK,mBAAmB,EAExB,MAAM,8CAA8C,CAAA;AAKrD,KAAK,2BAA2B,GAC7B,sBAAsB,GACtB,kBAAkB,GAClB,CAAC,MAAM,GAAG,EAAE,CAAC,CAAA;AAEhB,KAAK,uBAAuB,GAAG,oBAAoB,CAAC,2BAA2B,CAAC,CAAA;AAEhF,MAAM,MAAM,kBAAkB,GAC3B;IACA,QAAQ,EAAE,mBAAmB,GAAG,IAAI,CAAA;IACpC,KAAK,CAAC,EAAE,SAAS,CAAA;CAChB,GACD;IACA,QAAQ,EAAE,IAAI,CAAA;IACd,KAAK,EAAE,uBAAuB,CAAA;CAC7B,CAAA;AAEJ;;;;;;GAMG;AACH,wBAAsB,+BAA+B,CACpD,QAAQ,GAAE,MAAM,GAAG,SAEQ,GACzB,OAAO,CAAC,kBAAkB,CAAC,CAgE7B"}
@@ -1,85 +0,0 @@
1
- import { manifestSchema, } from "../protocol/manifest.js";
2
- import * as v from "valibot";
3
- const MANIFEST_URL = "manifest";
4
- /**
5
- * On the literal `localhost` hostname, attempts to load the custom block's optional self-hosted
6
- * manifest exposed by the worker dev shell, requested at the page-relative `manifest` path so
7
- * blocks served from a subpath resolve it against their own base.
8
- *
9
- * It is up to the host to decide whether to use this manifest or provide its own persisted manifest.
10
- */
11
- export async function attemptToLoadSelfHostedManifest(hostname = typeof window === "undefined"
12
- ? undefined
13
- : window.location.hostname) {
14
- // Runtime manifests are a localhost-only development fallback. Deployed
15
- // blocks receive their authoritative manifest from the host during init.
16
- if (hostname !== "localhost") {
17
- return { manifest: null };
18
- }
19
- let response;
20
- try {
21
- response = await fetch(MANIFEST_URL, { credentials: "omit" });
22
- }
23
- catch (error) {
24
- const message = `Could not fetch ${MANIFEST_URL}.`;
25
- console.warn(`[custom-blocks-sdk] ${message}`, error);
26
- return {
27
- manifest: null,
28
- // Consider this retryable because it may have just been a network issue. Because `init`
29
- // errors are considered terminal, the host should "retry" by reloading the iframe and
30
- // sending another `connect` message.
31
- error: { code: "manifest_unavailable", message, isRetryable: true },
32
- };
33
- }
34
- if (response.status === 404) {
35
- const message = `No manifest found at ${MANIFEST_URL} (status ${response.status}).`;
36
- console.warn(`[custom-blocks-sdk] ${message}`);
37
- return { manifest: null };
38
- }
39
- if (!response.ok) {
40
- const message = `Could not fetch ${MANIFEST_URL} (status ${response.status}).`;
41
- console.warn(`[custom-blocks-sdk] ${message}`);
42
- return {
43
- manifest: null,
44
- error: {
45
- code: "manifest_unavailable",
46
- message,
47
- isRetryable: isRetryableManifestHttpStatus(response.status),
48
- },
49
- };
50
- }
51
- let json;
52
- try {
53
- json = await response.json();
54
- }
55
- catch (error) {
56
- const message = `Manifest at ${MANIFEST_URL} was not valid JSON.`;
57
- console.warn(`[custom-blocks-sdk] ${message}`, error);
58
- return {
59
- manifest: null,
60
- // Consider invalid manifests as unrecoverable errors.
61
- error: { code: "manifest_invalid", message, isRetryable: false },
62
- };
63
- }
64
- const parsed = v.safeParse(manifestSchema, json);
65
- if (!parsed.success) {
66
- const message = `Manifest at ${MANIFEST_URL} did not match schema.`;
67
- console.warn(`[custom-blocks-sdk] ${message}`, parsed.issues);
68
- return {
69
- manifest: null,
70
- // Consider invalid manifests as unrecoverable errors.
71
- error: { code: "manifest_invalid", message, isRetryable: false },
72
- };
73
- }
74
- return { manifest: parsed.output };
75
- }
76
- function isRetryableManifestHttpStatus(status) {
77
- // Consider these statuses retryable because they may reflect transient failures.
78
- return (status === 408 || // Request Timeout
79
- status === 425 || // Too Early
80
- status === 500 || // Internal Server Error
81
- status === 502 || // Bad Gateway
82
- status === 503 || // Service Unavailable
83
- status === 504 // Gateway Timeout
84
- );
85
- }
@@ -1,114 +0,0 @@
1
- import type { CustomBlockErrorInfo } from "@notionhq/custom-blocks-protocol/errors.js"
2
- import {
3
- type CustomBlockManifest,
4
- manifestSchema,
5
- } from "@notionhq/custom-blocks-protocol/manifest.js"
6
- import * as v from "valibot"
7
-
8
- const MANIFEST_URL = "manifest"
9
-
10
- type CustomBlockConnectErrorCode =
11
- | "manifest_unavailable"
12
- | "manifest_invalid"
13
- | (string & {})
14
-
15
- type CustomBlockConnectError = CustomBlockErrorInfo<CustomBlockConnectErrorCode>
16
-
17
- export type ManifestLoadResult =
18
- | {
19
- manifest: CustomBlockManifest | null
20
- error?: undefined
21
- }
22
- | {
23
- manifest: null
24
- error: CustomBlockConnectError
25
- }
26
-
27
- /**
28
- * On the literal `localhost` hostname, attempts to load the custom block's optional self-hosted
29
- * manifest exposed by the worker dev shell, requested at the page-relative `manifest` path so
30
- * blocks served from a subpath resolve it against their own base.
31
- *
32
- * It is up to the host to decide whether to use this manifest or provide its own persisted manifest.
33
- */
34
- export async function attemptToLoadSelfHostedManifest(
35
- hostname: string | undefined = typeof window === "undefined"
36
- ? undefined
37
- : window.location.hostname,
38
- ): Promise<ManifestLoadResult> {
39
- // Runtime manifests are a localhost-only development fallback. Deployed
40
- // blocks receive their authoritative manifest from the host during init.
41
- if (hostname !== "localhost") {
42
- return { manifest: null }
43
- }
44
-
45
- let response: Response
46
- try {
47
- response = await fetch(MANIFEST_URL, { credentials: "omit" })
48
- } catch (error) {
49
- const message = `Could not fetch ${MANIFEST_URL}.`
50
- console.warn(`[custom-blocks-sdk] ${message}`, error)
51
- return {
52
- manifest: null,
53
- // Consider this retryable because it may have just been a network issue. Because `init`
54
- // errors are considered terminal, the host should "retry" by reloading the iframe and
55
- // sending another `connect` message.
56
- error: { code: "manifest_unavailable", message, isRetryable: true },
57
- }
58
- }
59
- if (response.status === 404) {
60
- const message = `No manifest found at ${MANIFEST_URL} (status ${response.status}).`
61
- console.warn(`[custom-blocks-sdk] ${message}`)
62
- return { manifest: null }
63
- }
64
- if (!response.ok) {
65
- const message = `Could not fetch ${MANIFEST_URL} (status ${response.status}).`
66
- console.warn(`[custom-blocks-sdk] ${message}`)
67
- return {
68
- manifest: null,
69
- error: {
70
- code: "manifest_unavailable",
71
- message,
72
- isRetryable: isRetryableManifestHttpStatus(response.status),
73
- },
74
- }
75
- }
76
-
77
- let json: unknown
78
- try {
79
- json = await response.json()
80
- } catch (error) {
81
- const message = `Manifest at ${MANIFEST_URL} was not valid JSON.`
82
- console.warn(`[custom-blocks-sdk] ${message}`, error)
83
- return {
84
- manifest: null,
85
- // Consider invalid manifests as unrecoverable errors.
86
- error: { code: "manifest_invalid", message, isRetryable: false },
87
- }
88
- }
89
-
90
- const parsed = v.safeParse(manifestSchema, json)
91
- if (!parsed.success) {
92
- const message = `Manifest at ${MANIFEST_URL} did not match schema.`
93
- console.warn(`[custom-blocks-sdk] ${message}`, parsed.issues)
94
- return {
95
- manifest: null,
96
- // Consider invalid manifests as unrecoverable errors.
97
- error: { code: "manifest_invalid", message, isRetryable: false },
98
- }
99
- }
100
-
101
- return { manifest: parsed.output }
102
- }
103
-
104
- function isRetryableManifestHttpStatus(status: number): boolean {
105
- // Consider these statuses retryable because they may reflect transient failures.
106
- return (
107
- status === 408 || // Request Timeout
108
- status === 425 || // Too Early
109
- status === 500 || // Internal Server Error
110
- status === 502 || // Bad Gateway
111
- status === 503 || // Service Unavailable
112
- status === 504 // Gateway Timeout
113
- )
114
- }