@hexclave/shared 1.0.1 → 1.0.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.
- package/dist/ai/unified-prompts/skill-site-prompt-parts/ai-setup-prompt.d.ts.map +1 -1
- package/dist/ai/unified-prompts/skill-site-prompt-parts/ai-setup-prompt.js +3 -1
- package/dist/ai/unified-prompts/skill-site-prompt-parts/ai-setup-prompt.js.map +1 -1
- package/dist/config/schema.d.ts +55 -55
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/ai-setup-prompt.d.ts.map +1 -1
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/ai-setup-prompt.js +3 -1
- package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/ai-setup-prompt.js.map +1 -1
- package/dist/esm/config/schema.d.ts +55 -55
- package/dist/esm/hooks/use-hover.d.ts +1 -1
- package/dist/esm/hooks/use-hover.d.ts.map +1 -1
- package/dist/esm/hooks/use-hover.js.map +1 -1
- package/dist/esm/interface/admin-metrics.d.ts +12 -12
- package/dist/esm/interface/conversations.d.ts +34 -34
- package/dist/esm/interface/crud/current-user.d.ts +13 -13
- package/dist/esm/interface/crud/email-outbox.d.ts +202 -202
- package/dist/esm/interface/crud/products.d.ts +13 -13
- package/dist/esm/interface/crud/products.d.ts.map +1 -1
- package/dist/esm/interface/crud/project-api-keys.d.ts +4 -4
- package/dist/esm/interface/crud/projects.d.ts +36 -36
- package/dist/esm/interface/crud/team-member-profiles.d.ts +20 -20
- package/dist/esm/interface/crud/transactions.d.ts +6 -6
- package/dist/esm/interface/crud/transactions.d.ts.map +1 -1
- package/dist/esm/interface/crud/users.d.ts +14 -14
- package/dist/esm/interface/webhooks.d.ts +2 -2
- package/dist/esm/known-errors.d.ts +2 -2
- package/dist/esm/schema-fields.d.ts +2 -2
- package/dist/esm/sessions.d.ts +7 -7
- package/dist/esm/utils/react.d.ts.map +1 -1
- package/dist/esm/utils/react.js +4 -4
- package/dist/esm/utils/react.js.map +1 -1
- package/dist/hooks/use-hover.d.ts +1 -1
- package/dist/hooks/use-hover.d.ts.map +1 -1
- package/dist/hooks/use-hover.js.map +1 -1
- package/dist/interface/admin-metrics.d.ts +12 -12
- package/dist/interface/conversations.d.ts +34 -34
- package/dist/interface/crud/current-user.d.ts +13 -13
- package/dist/interface/crud/email-outbox.d.ts +202 -202
- package/dist/interface/crud/products.d.ts +13 -13
- package/dist/interface/crud/products.d.ts.map +1 -1
- package/dist/interface/crud/project-api-keys.d.ts +4 -4
- package/dist/interface/crud/projects.d.ts +36 -36
- package/dist/interface/crud/team-member-profiles.d.ts +20 -20
- package/dist/interface/crud/transactions.d.ts +6 -6
- package/dist/interface/crud/transactions.d.ts.map +1 -1
- package/dist/interface/crud/users.d.ts +14 -14
- package/dist/interface/webhooks.d.ts +2 -2
- package/dist/known-errors.d.ts +2 -2
- package/dist/schema-fields.d.ts +2 -2
- package/dist/sessions.d.ts +7 -7
- package/dist/utils/react.d.ts.map +1 -1
- package/dist/utils/react.js +4 -4
- package/dist/utils/react.js.map +1 -1
- package/package.json +1 -1
package/dist/esm/utils/react.js
CHANGED
|
@@ -49,7 +49,7 @@ function getNodeText(node) {
|
|
|
49
49
|
if (["number", "string"].includes(typeof node)) return `${node}`;
|
|
50
50
|
if (!node) return "";
|
|
51
51
|
if (Array.isArray(node)) return node.map(getNodeText).join("");
|
|
52
|
-
if (
|
|
52
|
+
if (React.isValidElement(node)) return getNodeText(node.props.children);
|
|
53
53
|
throw new Error(`Unknown node type: ${typeof node}`);
|
|
54
54
|
}
|
|
55
55
|
(void 0)?.test("getNodeText", ({ expect }) => {
|
|
@@ -72,9 +72,9 @@ function getNodeText(node) {
|
|
|
72
72
|
42,
|
|
73
73
|
null
|
|
74
74
|
])).toBe("hello42");
|
|
75
|
-
expect(getNodeText(
|
|
76
|
-
expect(getNodeText(
|
|
77
|
-
expect(getNodeText([
|
|
75
|
+
expect(getNodeText(React.createElement("span", null, "child text"))).toBe("child text");
|
|
76
|
+
expect(getNodeText(React.createElement("div", null, React.createElement("span", null, "nested text")))).toBe("nested text");
|
|
77
|
+
expect(getNodeText([React.createElement("span", null, "first"), React.createElement("span", null, "second")])).toBe("firstsecond");
|
|
78
78
|
});
|
|
79
79
|
/**
|
|
80
80
|
* Suspends the currently rendered component indefinitely. Will not unsuspend unless the component rerenders.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.js","names":[],"sources":["../../../src/utils/react.tsx"],"sourcesContent":["import React, { SetStateAction } from \"react\";\nimport { isBrowserLike } from \"./env\";\nimport { neverResolve, runAsynchronously } from \"./promises\";\nimport { AsyncResult } from \"./results\";\nimport { ensureMonkeyPatch, NO_SUSPENSE_BOUNDARY_ERROR_SENTINEL } from \"./monkey-patch\";\nimport { deindent } from \"./strings\";\n\nexport function componentWrapper<\n C extends React.ComponentType<any> | keyof React.JSX.IntrinsicElements,\n ExtraProps extends {} = {}\n>(displayName: string, render: React.ForwardRefRenderFunction<RefFromComponent<C>, React.ComponentPropsWithRef<C> & ExtraProps>) {\n const Component = forwardRefIfNeeded(render);\n Component.displayName = displayName;\n return Component;\n}\ntype RefFromComponent<C extends React.ComponentType<any> | keyof React.JSX.IntrinsicElements> = NonNullable<RefFromComponentDistCond<React.ComponentPropsWithRef<C>[\"ref\"]>>;\ntype RefFromComponentDistCond<A> = A extends React.RefObject<infer T> ? T : never; // distributive conditional type; see https://www.typescriptlang.org/docs/handbook/2/conditional-types.html#distributive-conditional-types\n\nconst react18PromiseCache = new WeakMap<Promise<unknown>, AsyncResult<unknown, unknown>>();\nexport function use<T>(promise: Promise<T>): T {\n if (\"use\" in React) {\n return React.use(promise);\n } else {\n if (react18PromiseCache.has(promise)) {\n const result = react18PromiseCache.get(promise)!;\n if (result.status === \"pending\") {\n throw promise;\n } else if (result.status === \"ok\") {\n return result.data as T;\n } else {\n throw result.error;\n }\n } else {\n react18PromiseCache.set(promise, { \"status\": \"pending\", progress: undefined });\n runAsynchronously(async () => {\n try {\n const res = await promise;\n react18PromiseCache.set(promise, { \"status\": \"ok\", data: res });\n } catch (e) {\n react18PromiseCache.set(promise, { \"status\": \"error\", error: e });\n }\n });\n throw promise;\n }\n }\n}\n\nexport function forwardRefIfNeeded<T, P = {}>(render: React.ForwardRefRenderFunction<T, P>): React.FC<P & { ref?: React.Ref<T> }> {\n // TODO: when we drop support for react 18, remove this\n\n const version = React.version;\n const major = parseInt(version.split(\".\")[0]);\n if (major < 19) {\n return React.forwardRef<T, P>(render as any) as any;\n } else {\n return ((props: P) => render(props, (props as any).ref)) as any;\n }\n}\n\nexport function getNodeText(node: React.ReactNode): string {\n if ([\"number\", \"string\"].includes(typeof node)) {\n return `${node}`;\n }\n if (!node) {\n return \"\";\n }\n if (Array.isArray(node)) {\n return node.map(getNodeText).join(\"\");\n }\n if (typeof node === \"object\" && \"props\" in node) {\n return getNodeText(node.props.children);\n }\n throw new Error(`Unknown node type: ${typeof node}`);\n}\nimport.meta.vitest?.test(\"getNodeText\", ({ expect }) => {\n // Test with string\n expect(getNodeText(\"hello\")).toBe(\"hello\");\n\n // Test with number\n expect(getNodeText(42)).toBe(\"42\");\n\n // Test with null/undefined\n expect(getNodeText(null)).toBe(\"\");\n expect(getNodeText(undefined)).toBe(\"\");\n\n // Test with array\n expect(getNodeText([\"hello\", \" \", \"world\"])).toBe(\"hello world\");\n expect(getNodeText([1, 2, 3])).toBe(\"123\");\n\n // Test with mixed array\n expect(getNodeText([\"hello\", 42, null])).toBe(\"hello42\");\n\n // Test with React element (mocked)\n const mockElement = {\n props: {\n children: \"child text\"\n }\n } as React.ReactElement;\n expect(getNodeText(mockElement)).toBe(\"child text\");\n\n // Test with nested React elements\n const nestedElement = {\n props: {\n children: {\n props: {\n children: \"nested text\"\n }\n } as React.ReactElement\n }\n } as React.ReactElement;\n expect(getNodeText(nestedElement)).toBe(\"nested text\");\n\n // Test with array of React elements\n const arrayOfElements = [\n { props: { children: \"first\" } } as React.ReactElement,\n { props: { children: \"second\" } } as React.ReactElement\n ];\n expect(getNodeText(arrayOfElements)).toBe(\"firstsecond\");\n});\n\n/**\n * Suspends the currently rendered component indefinitely. Will not unsuspend unless the component rerenders.\n *\n * You can use this to translate older query- or AsyncResult-based code to new the Suspense system, for example: `if (query.isLoading) suspend();`\n */\nexport function suspend(): never {\n use(neverResolve());\n throw new Error(\"Somehow a Promise that never resolves was resolved?\");\n}\n\nexport function mapRef<T, R>(ref: ReadonlyRef<T>, mapper: (value: T) => R): ReadonlyRef<R> {\n let last: [T, R] | null = null;\n return {\n get current() {\n const input = ref.current;\n if (last === null || input !== last[0]) {\n last = [input, mapper(input)];\n }\n return last[1];\n },\n };\n}\n\nexport type ReadonlyRef<T> = {\n readonly current: T,\n};\n\nexport type RefState<T> = ReadonlyRef<T> & {\n set: (updater: SetStateAction<T>) => void,\n};\n\n/**\n * Like useState, but its value is immediately available on refState.current after being set.\n *\n * Like useRef, but setting the value will cause a rerender.\n *\n * Note that useRefState returns a new object every time a rerender happens due to a value change, which is intentional\n * as it allows you to specify it in a dependency array like this:\n *\n * ```tsx\n * useEffect(() => {\n * // do something with refState.current\n * }, [refState]); // instead of refState.current\n * ```\n *\n * If you don't want this, you can wrap the result in a useMemo call.\n */\nexport function useRefState<T>(initialValue: T | (() => T)): RefState<T> {\n // Support lazy initialization like React.useState does: if initialValue is a function,\n // call it once to get the actual initial value (React.useRef does NOT do this automatically).\n const lazyInitRef = React.useRef<{ v: T } | null>(null);\n if (lazyInitRef.current === null) {\n lazyInitRef.current = {\n v: typeof initialValue === \"function\" ? (initialValue as () => T)() : initialValue,\n };\n }\n const resolvedInitialValue = lazyInitRef.current.v;\n const [, setState] = React.useState<T>(() => resolvedInitialValue);\n const ref = React.useRef(resolvedInitialValue);\n const setValue = React.useCallback((updater: SetStateAction<T>) => {\n const value: T = typeof updater === \"function\" ? (updater as any)(ref.current) : updater;\n ref.current = value;\n setState(value);\n }, []);\n const res = React.useMemo(() => ({\n get current() {\n return ref.current;\n },\n set: setValue,\n }), [setValue]);\n return res;\n}\n\nexport function mapRefState<T, R>(refState: RefState<T>, mapper: (value: T) => R, reverseMapper: (oldT: T, newR: R) => T): RefState<R> {\n let last: [T, R] | null = null;\n return {\n get current() {\n const input = refState.current;\n if (last === null || input !== last[0]) {\n last = [input, mapper(input)];\n }\n return last[1];\n },\n set(updater: SetStateAction<R>) {\n const value: R = typeof updater === \"function\" ? (updater as any)(this.current) : updater;\n refState.set(reverseMapper(refState.current, value));\n },\n };\n}\n\nexport function useQueryState(key: string, defaultValue?: string) {\n const getValue = () => new URLSearchParams(window.location.search).get(key) ?? defaultValue ?? null;\n\n const [value, setValue] = React.useState(getValue);\n\n React.useEffect(() => {\n const onPopState = () => setValue(getValue());\n window.addEventListener(\"popstate\", onPopState);\n return () => window.removeEventListener(\"popstate\", onPopState);\n }, []);\n\n const update = (next: string | null) => {\n const params = new URLSearchParams(window.location.search);\n if (next !== null) {\n params.set(key, next);\n } else {\n params.delete(key);\n }\n const newUrl = params.toString()\n ? `${window.location.pathname}?${params.toString()}`\n : window.location.pathname;\n window.history.pushState(null, \"\", newUrl);\n setValue(next);\n };\n\n return [value, update] as const;\n}\n\nexport function shouldRethrowRenderingError(error: unknown): boolean {\n return !!error && typeof error === \"object\" && \"digest\" in error && error.digest === \"BAILOUT_TO_CLIENT_SIDE_RENDERING\";\n}\n\nexport class NoSuspenseBoundaryError extends Error {\n digest: string;\n reason: string;\n __noSuspenseBoundarySentinel = NO_SUSPENSE_BOUNDARY_ERROR_SENTINEL;\n\n constructor(options: { caller?: string }) {\n ensureMonkeyPatch();\n\n super(deindent`\n Suspense boundary not found! Read the error message below carefully (or paste it into your AI agent).\n\n ${options.caller ?? \"This code path\"} attempted to display a loading indicator, but didn't find a Suspense boundary above it. Please read the error message below carefully.\n \n There are several potential causes:\n \n 1. [Next.js] You are missing a loading.tsx file in your app directory. Fix it by adding a loading.tsx file in your app directory.\n\n 2. [React] You are missing a <Suspense> boundary in your component. Fix it by wrapping your component (or the entire app) in a <Suspense> component.\n\n 3. [Next.js] The component is rendered in the root (outermost) layout.tsx or template.tsx file. Next.js does not wrap those files in a Suspense boundary, even if there is a loading.tsx file in the same folder. To fix it, wrap your layout inside a route group like this:\n\n - app\n - - layout.tsx // contains <html> and <body>, alongside providers and other components that don't need ${options.caller ?? \"this code path\"}\n - - loading.tsx // required for suspense\n - - (main)\n - - - layout.tsx // contains the main layout of your app, like a sidebar or a header, and can use ${options.caller ?? \"this code path\"}\n - - - route.tsx // your actual main page\n - - - the rest of your app\n\n For more information on this approach, see Next's documentation on route groups: https://nextjs.org/docs/app/building-your-application/routing/route-groups\n \n 4. You caught this error with try-catch or a custom error boundary. Fix this by rethrowing the error or not catching it in the first place.\n\n 5. Your version of Hexclave is too old. Upgrade to the latest version to see if that fixes the issue.\n\n See: https://nextjs.org/docs/messages/missing-suspense-with-csr-bailout\n\n More information on SSR and Suspense boundaries: https://react.dev/reference/react/Suspense#providing-a-fallback-for-server-errors-and-client-only-content\n `);\n\n this.name = \"NoSuspenseBoundaryError\";\n this.reason = options.caller ?? \"suspendIfSsr()\";\n\n // set the digest so nextjs doesn't log the error\n // https://github.com/vercel/next.js/blob/d01d6d9c35a8c2725b3d74c1402ab76d4779a6cf/packages/next/src/shared/lib/lazy-dynamic/bailout-to-csr.ts#L14\n this.digest = \"BAILOUT_TO_CLIENT_SIDE_RENDERING\";\n }\n}\nimport.meta.vitest?.test(\"NoSuspenseBoundaryError\", ({ expect }) => {\n // Test with default options\n const defaultError = new NoSuspenseBoundaryError({});\n expect(defaultError.name).toBe(\"NoSuspenseBoundaryError\");\n expect(defaultError.reason).toBe(\"suspendIfSsr()\");\n expect(defaultError.digest).toBe(\"BAILOUT_TO_CLIENT_SIDE_RENDERING\");\n expect(defaultError.message).toContain(\"This code path attempted to display a loading indicator\");\n\n // Test with custom caller\n const customError = new NoSuspenseBoundaryError({ caller: \"CustomComponent\" });\n expect(customError.name).toBe(\"NoSuspenseBoundaryError\");\n expect(customError.reason).toBe(\"CustomComponent\");\n expect(customError.digest).toBe(\"BAILOUT_TO_CLIENT_SIDE_RENDERING\");\n expect(customError.message).toContain(\"CustomComponent attempted to display a loading indicator\");\n\n // Verify error message contains all the necessary information\n expect(customError.message).toContain(\"loading.tsx\");\n expect(customError.message).toContain(\"route groups\");\n expect(customError.message).toContain(\"https://nextjs.org/docs/messages/missing-suspense-with-csr-bailout\");\n});\n\n\n/**\n * Use this in a component or a hook to disable SSR. Should be wrapped in a Suspense boundary, or it will throw an error.\n */\nexport function suspendIfSsr(caller?: string) {\n if (!isBrowserLike()) {\n throw new NoSuspenseBoundaryError({ caller });\n }\n}\n"],"mappings":";;;;;;;AAOA,SAAgB,iBAGd,aAAqB,QAA0G;CAC/H,MAAM,YAAY,mBAAmB,OAAO;AAC5C,WAAU,cAAc;AACxB,QAAO;;MAKH,sCAAsB,IAAI,SAA0D;AAC1F,SAAgB,IAAO,SAAwB;AAC7C,KAAI,SAAS,MACX,QAAO,MAAM,IAAI,QAAQ;UAErB,oBAAoB,IAAI,QAAQ,EAAE;EACpC,MAAM,SAAS,oBAAoB,IAAI,QAAQ;AAC/C,MAAI,OAAO,WAAW,UACpB,OAAM;WACG,OAAO,WAAW,KAC3B,QAAO,OAAO;MAEd,OAAM,OAAO;QAEV;AACL,sBAAoB,IAAI,SAAS;GAAE,UAAU;GAAW,UAAU;GAAW,CAAC;AAC9E,oBAAkB,YAAY;AAC5B,OAAI;IACF,MAAM,MAAM,MAAM;AAClB,wBAAoB,IAAI,SAAS;KAAE,UAAU;KAAM,MAAM;KAAK,CAAC;YACxD,GAAG;AACV,wBAAoB,IAAI,SAAS;KAAE,UAAU;KAAS,OAAO;KAAG,CAAC;;IAEnE;AACF,QAAM;;;AAKZ,SAAgB,mBAA8B,QAAoF;CAGhI,MAAM,UAAU,MAAM;AAEtB,KADc,SAAS,QAAQ,MAAM,IAAI,CAAC,GAAG,GACjC,GACV,QAAO,MAAM,WAAiB,OAAc;KAE5C,UAAS,UAAa,OAAO,OAAQ,MAAc,IAA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I,wBAAwB,EAAE,QAAQ,mBAAmB,CAAC;AAC9E,QAAO,YAAY,KAAK,CAAC,KAAK,0BAA0B;AACxD,QAAO,YAAY,OAAO,CAAC,KAAK,kBAAkB;AAClD,QAAO,YAAY,OAAO,CAAC,KAAK,mCAAmC;AACnE,QAAO,YAAY,QAAQ,CAAC,UAAU,2DAA2D;AAGjG,QAAO,YAAY,QAAQ,CAAC,UAAU,cAAc;AACpD,QAAO,YAAY,QAAQ,CAAC,UAAU,eAAe;AACrD,QAAO,YAAY,QAAQ,CAAC,UAAU,qEAAqE;EAC3G;;;;AAMF,SAAgB,aAAa,QAAiB;AAC5C,KAAI,CAAC,eAAe,CAClB,OAAM,IAAI,wBAAwB,EAAE,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"react.js","names":[],"sources":["../../../src/utils/react.tsx"],"sourcesContent":["import React, { SetStateAction } from \"react\";\nimport { isBrowserLike } from \"./env\";\nimport { neverResolve, runAsynchronously } from \"./promises\";\nimport { AsyncResult } from \"./results\";\nimport { ensureMonkeyPatch, NO_SUSPENSE_BOUNDARY_ERROR_SENTINEL } from \"./monkey-patch\";\nimport { deindent } from \"./strings\";\n\nexport function componentWrapper<\n C extends React.ComponentType<any> | keyof React.JSX.IntrinsicElements,\n ExtraProps extends {} = {}\n>(displayName: string, render: React.ForwardRefRenderFunction<RefFromComponent<C>, React.ComponentPropsWithRef<C> & ExtraProps>) {\n const Component = forwardRefIfNeeded(render);\n Component.displayName = displayName;\n return Component;\n}\ntype RefFromComponent<C extends React.ComponentType<any> | keyof React.JSX.IntrinsicElements> = NonNullable<RefFromComponentDistCond<React.ComponentPropsWithRef<C>[\"ref\"]>>;\ntype RefFromComponentDistCond<A> = A extends React.RefObject<infer T> ? T : never; // distributive conditional type; see https://www.typescriptlang.org/docs/handbook/2/conditional-types.html#distributive-conditional-types\n\nconst react18PromiseCache = new WeakMap<Promise<unknown>, AsyncResult<unknown, unknown>>();\nexport function use<T>(promise: Promise<T>): T {\n if (\"use\" in React) {\n return React.use(promise);\n } else {\n if (react18PromiseCache.has(promise)) {\n const result = react18PromiseCache.get(promise)!;\n if (result.status === \"pending\") {\n throw promise;\n } else if (result.status === \"ok\") {\n return result.data as T;\n } else {\n throw result.error;\n }\n } else {\n react18PromiseCache.set(promise, { \"status\": \"pending\", progress: undefined });\n runAsynchronously(async () => {\n try {\n const res = await promise;\n react18PromiseCache.set(promise, { \"status\": \"ok\", data: res });\n } catch (e) {\n react18PromiseCache.set(promise, { \"status\": \"error\", error: e });\n }\n });\n throw promise;\n }\n }\n}\n\nexport function forwardRefIfNeeded<T, P = {}>(render: React.ForwardRefRenderFunction<T, P>): React.FC<P & { ref?: React.Ref<T> }> {\n // TODO: when we drop support for react 18, remove this\n\n const version = React.version;\n const major = parseInt(version.split(\".\")[0]);\n if (major < 19) {\n return React.forwardRef<T, P>(render as any) as any;\n } else {\n return ((props: P) => render(props, (props as any).ref)) as any;\n }\n}\n\nexport function getNodeText(node: React.ReactNode): string {\n if ([\"number\", \"string\"].includes(typeof node)) {\n return `${node}`;\n }\n if (!node) {\n return \"\";\n }\n if (Array.isArray(node)) {\n return node.map(getNodeText).join(\"\");\n }\n if (React.isValidElement<{ children?: React.ReactNode }>(node)) {\n return getNodeText(node.props.children);\n }\n throw new Error(`Unknown node type: ${typeof node}`);\n}\nimport.meta.vitest?.test(\"getNodeText\", ({ expect }) => {\n // Test with string\n expect(getNodeText(\"hello\")).toBe(\"hello\");\n\n // Test with number\n expect(getNodeText(42)).toBe(\"42\");\n\n // Test with null/undefined\n expect(getNodeText(null)).toBe(\"\");\n expect(getNodeText(undefined)).toBe(\"\");\n\n // Test with array\n expect(getNodeText([\"hello\", \" \", \"world\"])).toBe(\"hello world\");\n expect(getNodeText([1, 2, 3])).toBe(\"123\");\n\n // Test with mixed array\n expect(getNodeText([\"hello\", 42, null])).toBe(\"hello42\");\n\n // Test with React element\n const mockElement = React.createElement(\"span\", null, \"child text\");\n expect(getNodeText(mockElement)).toBe(\"child text\");\n\n // Test with nested React elements\n const nestedElement = React.createElement(\"div\", null, React.createElement(\"span\", null, \"nested text\"));\n expect(getNodeText(nestedElement)).toBe(\"nested text\");\n\n // Test with array of React elements\n const arrayOfElements = [\n React.createElement(\"span\", null, \"first\"),\n React.createElement(\"span\", null, \"second\"),\n ];\n expect(getNodeText(arrayOfElements)).toBe(\"firstsecond\");\n});\n\n/**\n * Suspends the currently rendered component indefinitely. Will not unsuspend unless the component rerenders.\n *\n * You can use this to translate older query- or AsyncResult-based code to new the Suspense system, for example: `if (query.isLoading) suspend();`\n */\nexport function suspend(): never {\n use(neverResolve());\n throw new Error(\"Somehow a Promise that never resolves was resolved?\");\n}\n\nexport function mapRef<T, R>(ref: ReadonlyRef<T>, mapper: (value: T) => R): ReadonlyRef<R> {\n let last: [T, R] | null = null;\n return {\n get current() {\n const input = ref.current;\n if (last === null || input !== last[0]) {\n last = [input, mapper(input)];\n }\n return last[1];\n },\n };\n}\n\nexport type ReadonlyRef<T> = {\n readonly current: T,\n};\n\nexport type RefState<T> = ReadonlyRef<T> & {\n set: (updater: SetStateAction<T>) => void,\n};\n\n/**\n * Like useState, but its value is immediately available on refState.current after being set.\n *\n * Like useRef, but setting the value will cause a rerender.\n *\n * Note that useRefState returns a new object every time a rerender happens due to a value change, which is intentional\n * as it allows you to specify it in a dependency array like this:\n *\n * ```tsx\n * useEffect(() => {\n * // do something with refState.current\n * }, [refState]); // instead of refState.current\n * ```\n *\n * If you don't want this, you can wrap the result in a useMemo call.\n */\nexport function useRefState<T>(initialValue: T | (() => T)): RefState<T> {\n // Support lazy initialization like React.useState does: if initialValue is a function,\n // call it once to get the actual initial value (React.useRef does NOT do this automatically).\n const lazyInitRef = React.useRef<{ v: T } | null>(null);\n if (lazyInitRef.current === null) {\n lazyInitRef.current = {\n v: typeof initialValue === \"function\" ? (initialValue as () => T)() : initialValue,\n };\n }\n const resolvedInitialValue = lazyInitRef.current.v;\n const [, setState] = React.useState<T>(() => resolvedInitialValue);\n const ref = React.useRef(resolvedInitialValue);\n const setValue = React.useCallback((updater: SetStateAction<T>) => {\n const value: T = typeof updater === \"function\" ? (updater as any)(ref.current) : updater;\n ref.current = value;\n setState(value);\n }, []);\n const res = React.useMemo(() => ({\n get current() {\n return ref.current;\n },\n set: setValue,\n }), [setValue]);\n return res;\n}\n\nexport function mapRefState<T, R>(refState: RefState<T>, mapper: (value: T) => R, reverseMapper: (oldT: T, newR: R) => T): RefState<R> {\n let last: [T, R] | null = null;\n return {\n get current() {\n const input = refState.current;\n if (last === null || input !== last[0]) {\n last = [input, mapper(input)];\n }\n return last[1];\n },\n set(updater: SetStateAction<R>) {\n const value: R = typeof updater === \"function\" ? (updater as any)(this.current) : updater;\n refState.set(reverseMapper(refState.current, value));\n },\n };\n}\n\nexport function useQueryState(key: string, defaultValue?: string) {\n const getValue = () => new URLSearchParams(window.location.search).get(key) ?? defaultValue ?? null;\n\n const [value, setValue] = React.useState(getValue);\n\n React.useEffect(() => {\n const onPopState = () => setValue(getValue());\n window.addEventListener(\"popstate\", onPopState);\n return () => window.removeEventListener(\"popstate\", onPopState);\n }, []);\n\n const update = (next: string | null) => {\n const params = new URLSearchParams(window.location.search);\n if (next !== null) {\n params.set(key, next);\n } else {\n params.delete(key);\n }\n const newUrl = params.toString()\n ? `${window.location.pathname}?${params.toString()}`\n : window.location.pathname;\n window.history.pushState(null, \"\", newUrl);\n setValue(next);\n };\n\n return [value, update] as const;\n}\n\nexport function shouldRethrowRenderingError(error: unknown): boolean {\n return !!error && typeof error === \"object\" && \"digest\" in error && error.digest === \"BAILOUT_TO_CLIENT_SIDE_RENDERING\";\n}\n\nexport class NoSuspenseBoundaryError extends Error {\n digest: string;\n reason: string;\n __noSuspenseBoundarySentinel = NO_SUSPENSE_BOUNDARY_ERROR_SENTINEL;\n\n constructor(options: { caller?: string }) {\n ensureMonkeyPatch();\n\n super(deindent`\n Suspense boundary not found! Read the error message below carefully (or paste it into your AI agent).\n\n ${options.caller ?? \"This code path\"} attempted to display a loading indicator, but didn't find a Suspense boundary above it. Please read the error message below carefully.\n \n There are several potential causes:\n \n 1. [Next.js] You are missing a loading.tsx file in your app directory. Fix it by adding a loading.tsx file in your app directory.\n\n 2. [React] You are missing a <Suspense> boundary in your component. Fix it by wrapping your component (or the entire app) in a <Suspense> component.\n\n 3. [Next.js] The component is rendered in the root (outermost) layout.tsx or template.tsx file. Next.js does not wrap those files in a Suspense boundary, even if there is a loading.tsx file in the same folder. To fix it, wrap your layout inside a route group like this:\n\n - app\n - - layout.tsx // contains <html> and <body>, alongside providers and other components that don't need ${options.caller ?? \"this code path\"}\n - - loading.tsx // required for suspense\n - - (main)\n - - - layout.tsx // contains the main layout of your app, like a sidebar or a header, and can use ${options.caller ?? \"this code path\"}\n - - - route.tsx // your actual main page\n - - - the rest of your app\n\n For more information on this approach, see Next's documentation on route groups: https://nextjs.org/docs/app/building-your-application/routing/route-groups\n \n 4. You caught this error with try-catch or a custom error boundary. Fix this by rethrowing the error or not catching it in the first place.\n\n 5. Your version of Hexclave is too old. Upgrade to the latest version to see if that fixes the issue.\n\n See: https://nextjs.org/docs/messages/missing-suspense-with-csr-bailout\n\n More information on SSR and Suspense boundaries: https://react.dev/reference/react/Suspense#providing-a-fallback-for-server-errors-and-client-only-content\n `);\n\n this.name = \"NoSuspenseBoundaryError\";\n this.reason = options.caller ?? \"suspendIfSsr()\";\n\n // set the digest so nextjs doesn't log the error\n // https://github.com/vercel/next.js/blob/d01d6d9c35a8c2725b3d74c1402ab76d4779a6cf/packages/next/src/shared/lib/lazy-dynamic/bailout-to-csr.ts#L14\n this.digest = \"BAILOUT_TO_CLIENT_SIDE_RENDERING\";\n }\n}\nimport.meta.vitest?.test(\"NoSuspenseBoundaryError\", ({ expect }) => {\n // Test with default options\n const defaultError = new NoSuspenseBoundaryError({});\n expect(defaultError.name).toBe(\"NoSuspenseBoundaryError\");\n expect(defaultError.reason).toBe(\"suspendIfSsr()\");\n expect(defaultError.digest).toBe(\"BAILOUT_TO_CLIENT_SIDE_RENDERING\");\n expect(defaultError.message).toContain(\"This code path attempted to display a loading indicator\");\n\n // Test with custom caller\n const customError = new NoSuspenseBoundaryError({ caller: \"CustomComponent\" });\n expect(customError.name).toBe(\"NoSuspenseBoundaryError\");\n expect(customError.reason).toBe(\"CustomComponent\");\n expect(customError.digest).toBe(\"BAILOUT_TO_CLIENT_SIDE_RENDERING\");\n expect(customError.message).toContain(\"CustomComponent attempted to display a loading indicator\");\n\n // Verify error message contains all the necessary information\n expect(customError.message).toContain(\"loading.tsx\");\n expect(customError.message).toContain(\"route groups\");\n expect(customError.message).toContain(\"https://nextjs.org/docs/messages/missing-suspense-with-csr-bailout\");\n});\n\n\n/**\n * Use this in a component or a hook to disable SSR. Should be wrapped in a Suspense boundary, or it will throw an error.\n */\nexport function suspendIfSsr(caller?: string) {\n if (!isBrowserLike()) {\n throw new NoSuspenseBoundaryError({ caller });\n }\n}\n"],"mappings":";;;;;;;AAOA,SAAgB,iBAGd,aAAqB,QAA0G;CAC/H,MAAM,YAAY,mBAAmB,OAAO;AAC5C,WAAU,cAAc;AACxB,QAAO;;MAKH,sCAAsB,IAAI,SAA0D;AAC1F,SAAgB,IAAO,SAAwB;AAC7C,KAAI,SAAS,MACX,QAAO,MAAM,IAAI,QAAQ;UAErB,oBAAoB,IAAI,QAAQ,EAAE;EACpC,MAAM,SAAS,oBAAoB,IAAI,QAAQ;AAC/C,MAAI,OAAO,WAAW,UACpB,OAAM;WACG,OAAO,WAAW,KAC3B,QAAO,OAAO;MAEd,OAAM,OAAO;QAEV;AACL,sBAAoB,IAAI,SAAS;GAAE,UAAU;GAAW,UAAU;GAAW,CAAC;AAC9E,oBAAkB,YAAY;AAC5B,OAAI;IACF,MAAM,MAAM,MAAM;AAClB,wBAAoB,IAAI,SAAS;KAAE,UAAU;KAAM,MAAM;KAAK,CAAC;YACxD,GAAG;AACV,wBAAoB,IAAI,SAAS;KAAE,UAAU;KAAS,OAAO;KAAG,CAAC;;IAEnE;AACF,QAAM;;;AA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A0B;AACzD,QAAO,aAAa,OAAO,CAAC,KAAK,iBAAiB;AAClD,QAAO,aAAa,OAAO,CAAC,KAAK,mCAAmC;AACpE,QAAO,aAAa,QAAQ,CAAC,UAAU,0DAA0D;CAGjG,MAAM,cAAc,IAAI,wBAAwB,EAAE,QAAQ,mBAAmB,CAAC;AAC9E,QAAO,YAAY,KAAK,CAAC,KAAK,0BAA0B;AACxD,QAAO,YAAY,OAAO,CAAC,KAAK,kBAAkB;AAClD,QAAO,YAAY,OAAO,CAAC,KAAK,mCAAmC;AACnE,QAAO,YAAY,QAAQ,CAAC,UAAU,2DAA2D;AAGjG,QAAO,YAAY,QAAQ,CAAC,UAAU,cAAc;AACpD,QAAO,YAAY,QAAQ,CAAC,UAAU,eAAe;AACrD,QAAO,YAAY,QAAQ,CAAC,UAAU,qEAAqE;EAC3G;;;;AAMF,SAAgB,aAAa,QAAiB;AAC5C,KAAI,CAAC,eAAe,CAClB,OAAM,IAAI,wBAAwB,EAAE,QAAQ,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/hooks/use-hover.d.ts
|
|
2
|
-
declare function useHover<T extends HTMLElement>(ref: React.RefObject<T>, options?: {
|
|
2
|
+
declare function useHover<T extends HTMLElement | null>(ref: React.RefObject<T>, options?: {
|
|
3
3
|
onMouseEnter?: () => void;
|
|
4
4
|
onMouseLeave?: () => void;
|
|
5
5
|
}): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-hover.d.ts","names":[],"sources":["../../src/hooks/use-hover.tsx"],"mappings":";iBAGgB,QAAA,WAAmB,WAAA,
|
|
1
|
+
{"version":3,"file":"use-hover.d.ts","names":[],"sources":["../../src/hooks/use-hover.tsx"],"mappings":";iBAGgB,QAAA,WAAmB,WAAA,QAAA,CACjC,GAAA,EAAK,KAAA,CAAM,SAAA,CAAU,CAAA,GACrB,OAAA;EACE,YAAA;EACA,YAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-hover.js","names":[],"sources":["../../src/hooks/use-hover.tsx"],"sourcesContent":["import { useLayoutEffect } from \"react\";\nimport { useRefState } from \"../utils/react\";\n\nexport function useHover<T extends HTMLElement>(\n ref: React.RefObject<T>,\n options: {\n onMouseEnter?: () => void,\n onMouseLeave?: () => void,\n } = {},\n): boolean {\n // Internal counter: mouseenter++ / mouseleave-- (isHovering = counter > 0)\n const counter = useRefState(0);\n\n useLayoutEffect(() => {\n const el = ref.current;\n if (!el) return;\n let incr = 0;\n let prevInside = false;\n\n const contains = (r: DOMRect, x: number, y: number) =>\n x >= r.left && x <= r.right && y >= r.top && y <= r.bottom;\n\n const enter = () => {\n incr++;\n counter.set(c => c + 1);\n if (counter.current === 1) {\n options.onMouseEnter?.();\n }\n };\n\n const leave = () => {\n incr--;\n requestAnimationFrame(() => {\n requestAnimationFrame(() => {\n counter.set(c => c - 1);\n if (counter.current === 0) {\n options.onMouseLeave?.();\n }\n });\n });\n };\n\n const topMatchesTarget = (x: number, y: number) => {\n const top = document.elementFromPoint(x, y);\n return !!(top && (top === el || el.contains(top)));\n };\n\n const processPoint = (x: number, y: number) => {\n const rect = el.getBoundingClientRect();\n\n // True “hoverability”: inside rect AND not occluded by others\n const inside = contains(rect, x, y) && topMatchesTarget(x, y);\n if (inside && !prevInside) {\n enter();\n } else if (!inside && prevInside) {\n leave();\n }\n prevInside = inside;\n };\n\n const onMove = (e: PointerEvent) => {\n if (e.pointerType !== \"mouse\") return; // keep it hover-only\n // Use coalesced points when available\n const batch = e.getCoalescedEvents();\n if (batch.length) {\n for (let eventIndex = 0; eventIndex < batch.length - 1; eventIndex++) {\n const e1 = batch[eventIndex];\n const e2 = batch[eventIndex + 1];\n const steps = 10;\n for (let i = 0; i <= steps; i++) {\n processPoint(e1.clientX + (e2.clientX - e1.clientX) * i / steps, e1.clientY + (e2.clientY - e1.clientY) * i / steps);\n }\n }\n } else {\n processPoint(e.clientX, e.clientY);\n }\n };\n\n window.addEventListener(\"pointermove\", onMove, { passive: true });\n\n return () => {\n window.removeEventListener(\"pointermove\", onMove);\n counter.set(c => c - incr);\n };\n }, []);\n\n return counter.current > 0;\n}\n"],"mappings":";;;;;;AAGA,SAAgB,SACd,KACA,UAGI,EAAE,EACG;CAET,MAAM,6CAAsB,EAAE;AAE9B,kCAAsB;EACpB,MAAM,KAAK,IAAI;AACf,MAAI,CAAC,GAAI;EACT,IAAI,OAAO;EACX,IAAI,aAAa;EAEjB,MAAM,YAAY,GAAY,GAAW,MACvC,KAAK,EAAE,QAAQ,KAAK,EAAE,SAAS,KAAK,EAAE,OAAO,KAAK,EAAE;EAEtD,MAAM,cAAc;AAClB;AACA,WAAQ,KAAI,MAAK,IAAI,EAAE;AACvB,OAAI,QAAQ,YAAY,EACtB,SAAQ,gBAAgB;;EAI5B,MAAM,cAAc;AAClB;AACA,+BAA4B;AAC1B,gCAA4B;AAC1B,aAAQ,KAAI,MAAK,IAAI,EAAE;AACvB,SAAI,QAAQ,YAAY,EACtB,SAAQ,gBAAgB;MAE1B;KACF;;EAGJ,MAAM,oBAAoB,GAAW,MAAc;GACjD,MAAM,MAAM,SAAS,iBAAiB,GAAG,EAAE;AAC3C,UAAO,CAAC,EAAE,QAAQ,QAAQ,MAAM,GAAG,SAAS,IAAI;;EAGlD,MAAM,gBAAgB,GAAW,MAAc;GAI7C,MAAM,SAAS,SAHF,GAAG,uBAAuB,EAGT,GAAG,EAAE,IAAI,iBAAiB,GAAG,EAAE;AAC7D,OAAI,UAAU,CAAC,WACb,QAAO;YACE,CAAC,UAAU,WACpB,QAAO;AAET,gBAAa;;EAGf,MAAM,UAAU,MAAoB;AAClC,OAAI,EAAE,gBAAgB,QAAS;GAE/B,MAAM,QAAQ,EAAE,oBAAoB;AACpC,OAAI,MAAM,OACR,MAAK,IAAI,aAAa,GAAG,aAAa,MAAM,SAAS,GAAG,cAAc;IACpE,MAAM,KAAK,MAAM;IACjB,MAAM,KAAK,MAAM,aAAa;IAC9B,MAAM,QAAQ;AACd,SAAK,IAAI,IAAI,GAAG,KAAK,OAAO,IAC1B,cAAa,GAAG,WAAW,GAAG,UAAU,GAAG,WAAW,IAAI,OAAO,GAAG,WAAW,GAAG,UAAU,GAAG,WAAW,IAAI,MAAM;;OAIxH,cAAa,EAAE,SAAS,EAAE,QAAQ;;AAItC,SAAO,iBAAiB,eAAe,QAAQ,EAAE,SAAS,MAAM,CAAC;AAEjE,eAAa;AACX,UAAO,oBAAoB,eAAe,OAAO;AACjD,WAAQ,KAAI,MAAK,IAAI,KAAK;;IAE3B,EAAE,CAAC;AAEN,QAAO,QAAQ,UAAU"}
|
|
1
|
+
{"version":3,"file":"use-hover.js","names":[],"sources":["../../src/hooks/use-hover.tsx"],"sourcesContent":["import { useLayoutEffect } from \"react\";\nimport { useRefState } from \"../utils/react\";\n\nexport function useHover<T extends HTMLElement | null>(\n ref: React.RefObject<T>,\n options: {\n onMouseEnter?: () => void,\n onMouseLeave?: () => void,\n } = {},\n): boolean {\n // Internal counter: mouseenter++ / mouseleave-- (isHovering = counter > 0)\n const counter = useRefState(0);\n\n useLayoutEffect(() => {\n const el = ref.current;\n if (!el) return;\n let incr = 0;\n let prevInside = false;\n\n const contains = (r: DOMRect, x: number, y: number) =>\n x >= r.left && x <= r.right && y >= r.top && y <= r.bottom;\n\n const enter = () => {\n incr++;\n counter.set(c => c + 1);\n if (counter.current === 1) {\n options.onMouseEnter?.();\n }\n };\n\n const leave = () => {\n incr--;\n requestAnimationFrame(() => {\n requestAnimationFrame(() => {\n counter.set(c => c - 1);\n if (counter.current === 0) {\n options.onMouseLeave?.();\n }\n });\n });\n };\n\n const topMatchesTarget = (x: number, y: number) => {\n const top = document.elementFromPoint(x, y);\n return !!(top && (top === el || el.contains(top)));\n };\n\n const processPoint = (x: number, y: number) => {\n const rect = el.getBoundingClientRect();\n\n // True “hoverability”: inside rect AND not occluded by others\n const inside = contains(rect, x, y) && topMatchesTarget(x, y);\n if (inside && !prevInside) {\n enter();\n } else if (!inside && prevInside) {\n leave();\n }\n prevInside = inside;\n };\n\n const onMove = (e: PointerEvent) => {\n if (e.pointerType !== \"mouse\") return; // keep it hover-only\n // Use coalesced points when available\n const batch = e.getCoalescedEvents();\n if (batch.length) {\n for (let eventIndex = 0; eventIndex < batch.length - 1; eventIndex++) {\n const e1 = batch[eventIndex];\n const e2 = batch[eventIndex + 1];\n const steps = 10;\n for (let i = 0; i <= steps; i++) {\n processPoint(e1.clientX + (e2.clientX - e1.clientX) * i / steps, e1.clientY + (e2.clientY - e1.clientY) * i / steps);\n }\n }\n } else {\n processPoint(e.clientX, e.clientY);\n }\n };\n\n window.addEventListener(\"pointermove\", onMove, { passive: true });\n\n return () => {\n window.removeEventListener(\"pointermove\", onMove);\n counter.set(c => c - incr);\n };\n }, []);\n\n return counter.current > 0;\n}\n"],"mappings":";;;;;;AAGA,SAAgB,SACd,KACA,UAGI,EAAE,EACG;CAET,MAAM,6CAAsB,EAAE;AAE9B,kCAAsB;EACpB,MAAM,KAAK,IAAI;AACf,MAAI,CAAC,GAAI;EACT,IAAI,OAAO;EACX,IAAI,aAAa;EAEjB,MAAM,YAAY,GAAY,GAAW,MACvC,KAAK,EAAE,QAAQ,KAAK,EAAE,SAAS,KAAK,EAAE,OAAO,KAAK,EAAE;EAEtD,MAAM,cAAc;AAClB;AACA,WAAQ,KAAI,MAAK,IAAI,EAAE;AACvB,OAAI,QAAQ,YAAY,EACtB,SAAQ,gBAAgB;;EAI5B,MAAM,cAAc;AAClB;AACA,+BAA4B;AAC1B,gCAA4B;AAC1B,aAAQ,KAAI,MAAK,IAAI,EAAE;AACvB,SAAI,QAAQ,YAAY,EACtB,SAAQ,gBAAgB;MAE1B;KACF;;EAGJ,MAAM,oBAAoB,GAAW,MAAc;GACjD,MAAM,MAAM,SAAS,iBAAiB,GAAG,EAAE;AAC3C,UAAO,CAAC,EAAE,QAAQ,QAAQ,MAAM,GAAG,SAAS,IAAI;;EAGlD,MAAM,gBAAgB,GAAW,MAAc;GAI7C,MAAM,SAAS,SAHF,GAAG,uBAAuB,EAGT,GAAG,EAAE,IAAI,iBAAiB,GAAG,EAAE;AAC7D,OAAI,UAAU,CAAC,WACb,QAAO;YACE,CAAC,UAAU,WACpB,QAAO;AAET,gBAAa;;EAGf,MAAM,UAAU,MAAoB;AAClC,OAAI,EAAE,gBAAgB,QAAS;GAE/B,MAAM,QAAQ,EAAE,oBAAoB;AACpC,OAAI,MAAM,OACR,MAAK,IAAI,aAAa,GAAG,aAAa,MAAM,SAAS,GAAG,cAAc;IACpE,MAAM,KAAK,MAAM;IACjB,MAAM,KAAK,MAAM,aAAa;IAC9B,MAAM,QAAQ;AACd,SAAK,IAAI,IAAI,GAAG,KAAK,OAAO,IAC1B,cAAa,GAAG,WAAW,GAAG,UAAU,GAAG,WAAW,IAAI,OAAO,GAAG,WAAW,GAAG,UAAU,GAAG,WAAW,IAAI,MAAM;;OAIxH,cAAa,EAAE,SAAS,EAAE,QAAQ;;AAItC,SAAO,iBAAiB,eAAe,QAAQ,EAAE,SAAS,MAAM,CAAC;AAEjE,eAAa;AACX,UAAO,oBAAoB,eAAe,OAAO;AACjD,WAAQ,KAAI,MAAK,IAAI,KAAK;;IAE3B,EAAE,CAAC;AAEN,QAAO,QAAQ,UAAU"}
|
|
@@ -150,15 +150,15 @@ declare const MetricsEmailOverviewSchema: yup.ObjectSchema<{
|
|
|
150
150
|
activity: number;
|
|
151
151
|
}[];
|
|
152
152
|
daily_emails_by_status: {
|
|
153
|
+
ok: number;
|
|
153
154
|
error: number;
|
|
154
155
|
date: string;
|
|
155
|
-
ok: number;
|
|
156
156
|
in_progress: number;
|
|
157
157
|
}[];
|
|
158
158
|
emails_sent: number;
|
|
159
159
|
recent_emails: {
|
|
160
|
-
status: string;
|
|
161
160
|
id: string;
|
|
161
|
+
status: string;
|
|
162
162
|
subject: string;
|
|
163
163
|
created_at_millis: number;
|
|
164
164
|
}[];
|
|
@@ -310,9 +310,9 @@ declare const UserActivityResponseBodySchema: yup.ObjectSchema<{
|
|
|
310
310
|
data_points: undefined;
|
|
311
311
|
}, "">;
|
|
312
312
|
declare const MetricsActiveUsersByCountrySchema: yup.MixedSchema<Record<string, {
|
|
313
|
-
primary_email: string | null;
|
|
314
|
-
display_name: string | null;
|
|
315
313
|
id: string;
|
|
314
|
+
display_name: string | null;
|
|
315
|
+
primary_email: string | null;
|
|
316
316
|
profile_image_url: string | null;
|
|
317
317
|
signed_up_at_millis: number;
|
|
318
318
|
last_active_at_millis: number | null;
|
|
@@ -330,25 +330,25 @@ declare const MetricsResponseBodySchema: yup.ObjectSchema<{
|
|
|
330
330
|
}[];
|
|
331
331
|
users_by_country: Record<string, number>;
|
|
332
332
|
active_users_by_country: Record<string, {
|
|
333
|
-
primary_email: string | null;
|
|
334
|
-
display_name: string | null;
|
|
335
333
|
id: string;
|
|
334
|
+
display_name: string | null;
|
|
335
|
+
primary_email: string | null;
|
|
336
336
|
profile_image_url: string | null;
|
|
337
337
|
signed_up_at_millis: number;
|
|
338
338
|
last_active_at_millis: number | null;
|
|
339
339
|
}[]>;
|
|
340
340
|
recently_registered: {
|
|
341
|
-
primary_email: string | null;
|
|
342
|
-
display_name: string | null;
|
|
343
341
|
id: string;
|
|
342
|
+
display_name: string | null;
|
|
343
|
+
primary_email: string | null;
|
|
344
344
|
profile_image_url: string | null;
|
|
345
345
|
signed_up_at_millis: number;
|
|
346
346
|
last_active_at_millis: number | null;
|
|
347
347
|
}[];
|
|
348
348
|
recently_active: {
|
|
349
|
-
primary_email: string | null;
|
|
350
|
-
display_name: string | null;
|
|
351
349
|
id: string;
|
|
350
|
+
display_name: string | null;
|
|
351
|
+
primary_email: string | null;
|
|
352
352
|
profile_image_url: string | null;
|
|
353
353
|
signed_up_at_millis: number;
|
|
354
354
|
last_active_at_millis: number | null;
|
|
@@ -422,15 +422,15 @@ declare const MetricsResponseBodySchema: yup.ObjectSchema<{
|
|
|
422
422
|
emails_by_status: Record<string, number>;
|
|
423
423
|
total_emails: number;
|
|
424
424
|
daily_emails_by_status: {
|
|
425
|
+
ok: number;
|
|
425
426
|
error: number;
|
|
426
427
|
date: string;
|
|
427
|
-
ok: number;
|
|
428
428
|
in_progress: number;
|
|
429
429
|
}[];
|
|
430
430
|
emails_sent: number;
|
|
431
431
|
recent_emails: {
|
|
432
|
-
status: string;
|
|
433
432
|
id: string;
|
|
433
|
+
status: string;
|
|
434
434
|
subject: string;
|
|
435
435
|
created_at_millis: number;
|
|
436
436
|
}[];
|
|
@@ -49,7 +49,7 @@ declare const conversationSummarySchema: yup$1.ObjectSchema<{
|
|
|
49
49
|
userPrimaryEmail: string | null;
|
|
50
50
|
userProfileImageUrl: string | null;
|
|
51
51
|
subject: string;
|
|
52
|
-
status: "
|
|
52
|
+
status: "pending" | "open" | "closed";
|
|
53
53
|
priority: "low" | "normal" | "high" | "urgent";
|
|
54
54
|
source: "email" | "manual" | "chat" | "api";
|
|
55
55
|
lastMessageType: "message" | "internal-note" | "status-change";
|
|
@@ -129,7 +129,7 @@ declare const conversationMessageSchema: yup$1.ObjectSchema<{
|
|
|
129
129
|
userId: string | null;
|
|
130
130
|
teamId: string | null;
|
|
131
131
|
subject: string;
|
|
132
|
-
status: "
|
|
132
|
+
status: "pending" | "open" | "closed";
|
|
133
133
|
priority: "low" | "normal" | "high" | "urgent";
|
|
134
134
|
source: "email" | "manual" | "chat" | "api";
|
|
135
135
|
messageType: "message" | "internal-note" | "status-change";
|
|
@@ -139,8 +139,8 @@ declare const conversationMessageSchema: yup$1.ObjectSchema<{
|
|
|
139
139
|
createdAt: string;
|
|
140
140
|
sender: {
|
|
141
141
|
type: "user" | "agent" | "system";
|
|
142
|
-
displayName: string | null;
|
|
143
142
|
id: string | null;
|
|
143
|
+
displayName: string | null;
|
|
144
144
|
primaryEmail: string | null;
|
|
145
145
|
};
|
|
146
146
|
}, yup$1.AnyObject, {
|
|
@@ -173,19 +173,7 @@ declare const conversationListResponseSchema: yup$1.ObjectSchema<{
|
|
|
173
173
|
lastOutboundAt?: string | null | undefined;
|
|
174
174
|
closedAt?: string | null | undefined;
|
|
175
175
|
recordMetadata?: {} | null | undefined;
|
|
176
|
-
status: "open" | "pending" | "closed";
|
|
177
|
-
priority: "low" | "normal" | "high" | "urgent";
|
|
178
|
-
subject: string;
|
|
179
|
-
conversationId: string;
|
|
180
|
-
userId: string | null;
|
|
181
|
-
teamId: string | null;
|
|
182
|
-
userDisplayName: string | null;
|
|
183
|
-
userPrimaryEmail: string | null;
|
|
184
|
-
userProfileImageUrl: string | null;
|
|
185
176
|
source: "email" | "manual" | "chat" | "api";
|
|
186
|
-
lastMessageType: "message" | "internal-note" | "status-change";
|
|
187
|
-
preview: string | null;
|
|
188
|
-
lastActivityAt: string;
|
|
189
177
|
metadata: {
|
|
190
178
|
assignedToUserId: string | null;
|
|
191
179
|
assignedToDisplayName: string | null;
|
|
@@ -196,6 +184,18 @@ declare const conversationListResponseSchema: yup$1.ObjectSchema<{
|
|
|
196
184
|
lastCustomerReplyAt: string | null;
|
|
197
185
|
lastAgentReplyAt: string | null;
|
|
198
186
|
};
|
|
187
|
+
status: "pending" | "open" | "closed";
|
|
188
|
+
subject: string;
|
|
189
|
+
conversationId: string;
|
|
190
|
+
userId: string | null;
|
|
191
|
+
teamId: string | null;
|
|
192
|
+
userDisplayName: string | null;
|
|
193
|
+
userPrimaryEmail: string | null;
|
|
194
|
+
userProfileImageUrl: string | null;
|
|
195
|
+
priority: "low" | "normal" | "high" | "urgent";
|
|
196
|
+
lastMessageType: "message" | "internal-note" | "status-change";
|
|
197
|
+
preview: string | null;
|
|
198
|
+
lastActivityAt: string;
|
|
199
199
|
}[];
|
|
200
200
|
hasMore: boolean;
|
|
201
201
|
}, yup$1.AnyObject, {
|
|
@@ -211,19 +211,7 @@ declare const conversationDetailResponseSchema: yup$1.ObjectSchema<{
|
|
|
211
211
|
lastOutboundAt?: string | null | undefined;
|
|
212
212
|
closedAt?: string | null | undefined;
|
|
213
213
|
recordMetadata?: {} | null | undefined;
|
|
214
|
-
status: "open" | "pending" | "closed";
|
|
215
|
-
priority: "low" | "normal" | "high" | "urgent";
|
|
216
|
-
subject: string;
|
|
217
|
-
conversationId: string;
|
|
218
|
-
userId: string | null;
|
|
219
|
-
teamId: string | null;
|
|
220
|
-
userDisplayName: string | null;
|
|
221
|
-
userPrimaryEmail: string | null;
|
|
222
|
-
userProfileImageUrl: string | null;
|
|
223
214
|
source: "email" | "manual" | "chat" | "api";
|
|
224
|
-
lastMessageType: "message" | "internal-note" | "status-change";
|
|
225
|
-
preview: string | null;
|
|
226
|
-
lastActivityAt: string;
|
|
227
215
|
metadata: {
|
|
228
216
|
assignedToUserId: string | null;
|
|
229
217
|
assignedToDisplayName: string | null;
|
|
@@ -234,31 +222,43 @@ declare const conversationDetailResponseSchema: yup$1.ObjectSchema<{
|
|
|
234
222
|
lastCustomerReplyAt: string | null;
|
|
235
223
|
lastAgentReplyAt: string | null;
|
|
236
224
|
};
|
|
225
|
+
status: "pending" | "open" | "closed";
|
|
226
|
+
subject: string;
|
|
227
|
+
conversationId: string;
|
|
228
|
+
userId: string | null;
|
|
229
|
+
teamId: string | null;
|
|
230
|
+
userDisplayName: string | null;
|
|
231
|
+
userPrimaryEmail: string | null;
|
|
232
|
+
userProfileImageUrl: string | null;
|
|
233
|
+
priority: "low" | "normal" | "high" | "urgent";
|
|
234
|
+
lastMessageType: "message" | "internal-note" | "status-change";
|
|
235
|
+
preview: string | null;
|
|
236
|
+
lastActivityAt: string;
|
|
237
237
|
};
|
|
238
238
|
messages: {
|
|
239
|
-
|
|
239
|
+
body: string | null;
|
|
240
|
+
source: "email" | "manual" | "chat" | "api";
|
|
241
|
+
metadata: {} | null;
|
|
240
242
|
id: string;
|
|
241
|
-
|
|
243
|
+
status: "pending" | "open" | "closed";
|
|
242
244
|
subject: string;
|
|
243
245
|
conversationId: string;
|
|
244
246
|
userId: string | null;
|
|
245
247
|
teamId: string | null;
|
|
246
|
-
|
|
247
|
-
metadata: {} | null;
|
|
248
|
+
priority: "low" | "normal" | "high" | "urgent";
|
|
248
249
|
createdAt: string;
|
|
249
250
|
messageType: "message" | "internal-note" | "status-change";
|
|
250
|
-
body: string | null;
|
|
251
251
|
attachments: {}[];
|
|
252
252
|
sender: {
|
|
253
253
|
type: "user" | "agent" | "system";
|
|
254
|
-
displayName: string | null;
|
|
255
254
|
id: string | null;
|
|
255
|
+
displayName: string | null;
|
|
256
256
|
primaryEmail: string | null;
|
|
257
257
|
};
|
|
258
258
|
}[];
|
|
259
259
|
entryPoints: {
|
|
260
|
-
id: string;
|
|
261
260
|
metadata: {} | null;
|
|
261
|
+
id: string;
|
|
262
262
|
createdAt: string;
|
|
263
263
|
updatedAt: string;
|
|
264
264
|
channelType: string;
|
|
@@ -4,20 +4,20 @@ import * as yup$1 from "yup";
|
|
|
4
4
|
//#region src/interface/crud/current-user.d.ts
|
|
5
5
|
declare const currentUserCrud: CrudSchemaFromOptions<{
|
|
6
6
|
clientReadSchema: yup$1.ObjectSchema<{
|
|
7
|
-
restricted_reason: {
|
|
8
|
-
type: "anonymous" | "email_not_verified" | "restricted_by_administrator";
|
|
9
|
-
} | null;
|
|
10
|
-
primary_email: string | null;
|
|
11
|
-
display_name: string | null;
|
|
12
|
-
client_metadata: {} | null;
|
|
13
|
-
client_read_only_metadata: {} | null;
|
|
14
|
-
id: string;
|
|
15
7
|
selected_team_id: string | null;
|
|
16
8
|
is_anonymous: boolean;
|
|
17
9
|
is_restricted: boolean;
|
|
10
|
+
restricted_reason: {
|
|
11
|
+
type: "anonymous" | "email_not_verified" | "restricted_by_administrator";
|
|
12
|
+
} | null;
|
|
18
13
|
requires_totp_mfa: boolean;
|
|
14
|
+
id: string;
|
|
15
|
+
display_name: string | null;
|
|
16
|
+
primary_email: string | null;
|
|
19
17
|
profile_image_url: string | null;
|
|
20
18
|
signed_up_at_millis: number;
|
|
19
|
+
client_metadata: {} | null;
|
|
20
|
+
client_read_only_metadata: {} | null;
|
|
21
21
|
primary_email_verified: boolean;
|
|
22
22
|
has_password: boolean;
|
|
23
23
|
otp_auth_enabled: boolean;
|
|
@@ -34,8 +34,8 @@ declare const currentUserCrud: CrudSchemaFromOptions<{
|
|
|
34
34
|
selected_team: {
|
|
35
35
|
client_metadata?: {} | null | undefined;
|
|
36
36
|
client_read_only_metadata?: {} | null | undefined;
|
|
37
|
-
display_name: string;
|
|
38
37
|
id: string;
|
|
38
|
+
display_name: string;
|
|
39
39
|
profile_image_url: string | null;
|
|
40
40
|
} | null;
|
|
41
41
|
}, yup$1.AnyObject, {
|
|
@@ -90,9 +90,9 @@ declare const currentUserCrud: CrudSchemaFromOptions<{
|
|
|
90
90
|
client_metadata?: {} | null | undefined;
|
|
91
91
|
client_read_only_metadata?: {} | null | undefined;
|
|
92
92
|
server_metadata?: {} | null | undefined;
|
|
93
|
-
display_name: string;
|
|
94
93
|
id: string;
|
|
95
94
|
created_at_millis: number;
|
|
95
|
+
display_name: string;
|
|
96
96
|
profile_image_url: string | null;
|
|
97
97
|
} | null;
|
|
98
98
|
selected_team_id: string | null;
|
|
@@ -172,11 +172,11 @@ declare const currentUserCrud: CrudSchemaFromOptions<{
|
|
|
172
172
|
requires_totp_mfa: undefined;
|
|
173
173
|
}, "">;
|
|
174
174
|
clientUpdateSchema: yup$1.ObjectSchema<{
|
|
175
|
-
primary_email: string | null | undefined;
|
|
176
|
-
display_name: string | null | undefined;
|
|
177
|
-
client_metadata: {} | null | undefined;
|
|
178
175
|
selected_team_id: string | null | undefined;
|
|
176
|
+
display_name: string | null | undefined;
|
|
177
|
+
primary_email: string | null | undefined;
|
|
179
178
|
profile_image_url: string | null | undefined;
|
|
179
|
+
client_metadata: {} | null | undefined;
|
|
180
180
|
otp_auth_enabled: boolean | undefined;
|
|
181
181
|
passkey_auth_enabled: boolean | undefined;
|
|
182
182
|
totp_secret_base64: string | null | undefined;
|