ts-ag 1.2.0 → 1.2.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/browser.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import * as v from "valibot";
2
1
  import { GenericSchema, GenericSchemaAsync } from "valibot";
3
2
  import { Plugin } from "unified";
4
3
  import { APIGatewayProxyEventV2WithLambdaAuthorizer, APIGatewayProxyResultV2, Context } from "aws-lambda";
@@ -149,7 +148,7 @@ type HTTPMethod$1 = (typeof HTTPMethods$1)[number];
149
148
  type ApiRequestFunction<API extends ApiEndpoints> = <Path extends API['path'], Method extends Extract<API, {
150
149
  path: Path;
151
150
  }>['method']>(path: Path, method: Method, input: ApiInput<API, Path, Method>, headers?: HeadersInit) => Promise<ApiResponse<API, Path, Method>>;
152
- type ApiSchema = v.GenericSchema | v.GenericSchemaAsync;
151
+ type ApiSchema = GenericSchema | GenericSchemaAsync;
153
152
  /**
154
153
  * @returns A function that can be used to make API requests with type safety
155
154
  * @example const clientApiRequest = createApiRequest<ApiEndpoints>();
@@ -1 +1 @@
1
- {"version":3,"file":"browser.d.ts","names":["Data","Point","line","column","offset","Position","start","end","Literal","Node","value","type","data","position","Parent","children","Data","UnistData","Literal","UnistLiteral","Node","UnistNode","Parent","UnistParent","Properties","Array","PropertyName","ElementContent","ElementContentMap","Comment","Element","Text","comment","element","text","RootContent","RootContentMap","Doctype","doctype","Content","Literals","Nodes","Extract","Root","Parents","data","value","children","CommentData","type","DoctypeData","ElementData","tagName","properties","content","RootData","TextData"],"sources":["../src/lambda/handlerUtils.ts","../src/lambda/client-types.ts","../src/lambda/client.ts","../node_modules/.pnpm/@types+unist@3.0.3/node_modules/@types/unist/index.d.ts","../node_modules/.pnpm/@types+hast@3.0.4/node_modules/@types/hast/index.d.ts","../src/rehype/flat-toc.ts","../src/types/deep.ts","../src/types/safe.ts","../src/utils/valibot.ts","../src/utils/object.ts"],"x_google_ignoreList":[3,4],"mappings":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AAK,CAAA,EAAG,CAAA;;;iBCEvD,QAAA,CAAS,CAAA,YAAa,CAAA,IAAK,aAAA;AAAA,iBAI3B,MAAA,CAAO,MAAA,EAAQ,aAAA,GAAgB,aAAA;AAAA,KAmBnC,sBAAA;;;ARtBZ;;EQ2BE,YAAA;AAAA;AAAA,iBAGc,eAAA,CACd,IAAA,EAAM,aAAA,GAAgB,kBAAA,EACtB,IAAA,UACA,IAAA,GAAM,sBAAA,GACL,aAAA;;;;;;;;ARlCH;;iBSQgB,SAAA,kBAAA,CAA4B,GAAA,EAAK,CAAA,EAAG,IAAA,UAAc,KAAA,QAAa,CAAA;;;ATP/E;;;;iBSiCgB,SAAA,kBAAA,CAA4B,GAAA,EAAK,CAAA,EAAG,IAAA;AT/BpD;;;;;;;;;;AAKA;;;;;;;;;;AALA,cSkEa,QAAA,uCAA8C,CAAA,EAAK,CAAA,EAAC,CAAA,EAAK,CAAA,KAAI,WAAA,CAAY,CAAA;;;;ATrDtF;;;;;;;;;;;;;AAUA;;;;;AAGA;;iBSuFgB,YAAA,OAAA,CAAoB,MAAA,EAAQ,CAAA,EAAG,KAAA,EAAO,EAAA,GAAK,EAAA"}
1
+ {"version":3,"file":"browser.d.ts","names":["Data","Point","line","column","offset","Position","start","end","Literal","Node","value","type","data","position","Parent","children","Data","UnistData","Literal","UnistLiteral","Node","UnistNode","Parent","UnistParent","Properties","Array","PropertyName","ElementContent","ElementContentMap","Comment","Element","Text","comment","element","text","RootContent","RootContentMap","Doctype","doctype","Content","Literals","Nodes","Extract","Root","Parents","data","value","children","CommentData","type","DoctypeData","ElementData","tagName","properties","content","RootData","TextData"],"sources":["../src/lambda/handlerUtils.ts","../src/lambda/client-types.ts","../src/lambda/client.ts","../node_modules/.pnpm/@types+unist@3.0.3/node_modules/@types/unist/index.d.ts","../node_modules/.pnpm/@types+hast@3.0.4/node_modules/@types/hast/index.d.ts","../src/rehype/flat-toc.ts","../src/types/deep.ts","../src/types/safe.ts","../src/utils/valibot.ts","../src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QAAA,2BAAmC,CAAA,eAAgB,IAAA,CAAK,CAAA,EAAG,CAAA;;;iBCEvD,QAAA,CAAS,CAAA,YAAa,CAAA,IAAK,aAAA;AAAA,iBAI3B,MAAA,CAAO,MAAA,EAAQ,aAAA,GAAgB,aAAA;AAAA,KAmBnC,sBAAA;;ARtBZ;;;EQ2BE,YAAA;AAAA;AAAA,iBAGc,eAAA,CACd,IAAA,EAAM,aAAA,GAAgB,kBAAA,EACtB,IAAA,UACA,IAAA,GAAM,sBAAA,GACL,aAAA;;;;;;;ARlCH;;;iBSQgB,SAAA,kBAAA,CAA4B,GAAA,EAAK,CAAA,EAAG,IAAA,UAAc,KAAA,QAAa,CAAA;;ATP/E;;;;;iBSiCgB,SAAA,kBAAA,CAA4B,GAAA,EAAK,CAAA,EAAG,IAAA;;;;;;;;;;AT1BpD;;;;;;;;;;;cS6Da,QAAA,uCAA8C,CAAA,EAAK,CAAA,EAAC,CAAA,EAAK,CAAA,KAAI,WAAA,CAAY,CAAA;;;ATrDtF;;;;;;;;;;;;;AAUA;;;;;AAGA;;;iBSuFgB,YAAA,OAAA,CAAoB,MAAA,EAAQ,CAAA,EAAG,KAAA,EAAO,EAAA,GAAK,EAAA"}
package/dist/browser.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { parse, stringify } from "devalue";
2
- import * as v from "valibot";
2
+ import { parse as parse$1, parseAsync } from "valibot";
3
3
  import rehypeParse from "rehype-parse";
4
4
  import { unified } from "unified";
5
5
  import { isEqual, isObject } from "radash";
@@ -22,8 +22,8 @@ const bodyMethods = [
22
22
  ];
23
23
  const queryMethods = ["GET", "DELETE"];
24
24
  async function _apiRequest(path, method, input, schema, environment, apiUrl, headers) {
25
- if (schema) if (schema.async === true) await v.parseAsync(schema, input);
26
- else v.parse(schema, input);
25
+ if (schema) if (schema.async === true) await parseAsync(schema, input);
26
+ else parse$1(schema, input);
27
27
  let url = `${apiUrl}${apiUrl.endsWith("/") ? "" : "/"}${path}`;
28
28
  if (queryMethods.includes(method)) {
29
29
  const params = new URLSearchParams();
@@ -1 +1 @@
1
- {"version":3,"file":"browser.js","names":[],"sources":["../src/lambda/client-types.ts","../src/lambda/client.ts","../src/lambda/handlerUtils.ts","../src/rehype/flat-toc.ts","../src/utils/valibot.ts","../src/utils/object.ts"],"sourcesContent":["import type { ErrorBody, SuccessCode, ErrorCode } from './handlerUtils.js';\n\n// ----------------- Helpers ----------------------\n// Used to easily extract types from ApiEndpoints types\n\n/**\n * Extracts the requestInput type from an API endpoint definition\n * @template E - Union type of all API endpoints\n * @template P - Path string literal type (e.g. 'payments/account')\n * @template M - HTTP method string literal type (e.g. 'GET', 'POST')\n */\nexport type ApiInput<E extends ApiEndpoints, P extends E['path'], M extends E['method']> = Extract<\n E,\n { path: P; method: M }\n>['requestInput'];\n\n/**\n * Extracts the requestOutput type from an API endpoint definition\n * @template E - Union type of all API endpoints\n * @template P - Path string literal type (e.g. 'payments/account')\n * @template M - HTTP method string literal type (e.g. 'GET', 'POST')\n */\nexport type ApiOutput<E extends ApiEndpoints, P extends E['path'], M extends E['method']> = Extract<\n E,\n { path: P; method: M }\n>['requestOutput'];\n\n/**\n * Extracts the response type from an API endpoint definition\n * @template E - Union type of all API endpoints\n * @template P - Path string literal type (e.g. 'payments/account')\n * @template M - HTTP method string literal type (e.g. 'GET', 'POST')\n */\nexport type ApiResponse<E extends ApiEndpoints, P extends E['path'], M extends E['method']> = Extract<\n E,\n { path: P; method: M }\n>['response'];\n\n/**\n * Extracts the sucessful body type from an API endpoint definition\n * @template E - Union type of all API endpoints\n * @template P - Path string literal type (e.g. 'payments/account')\n * @template M - HTTP method string literal type (e.g. 'GET', 'POST')\n */\nexport type ApiSuccessBody<E extends ApiEndpoints, P extends E['path'], M extends E['method']> = Extract<\n Extract<E, { path: P; method: M }>['response'],\n { status: SuccessCode }\n>['json'] extends () => Promise<infer R>\n ? R\n : unknown;\n\n/**\n * Extracts the sucessful body type from an API endpoint definition\n * @template E - Union type of all API endpoints\n * @template P - Path string literal type (e.g. 'payments/account')\n * @template M - HTTP method string literal type (e.g. 'GET', 'POST')\n */\nexport type ApiErrorBody<E extends ApiEndpoints, P extends E['path'], M extends E['method']> = Extract<\n Extract<E, { path: P; method: M }>['response'],\n { status: ErrorCode }\n>['json'] extends () => Promise<infer R>\n ? R\n : unknown;\n\n/**\n * Converts a RawApiGatewayHandler response type to a fetch like response type.\n */\ntype ConvertToFetch<T> = T extends { statusCode: number; body: object; headers: object }\n ? { ok: T['statusCode'] extends SuccessCode ? true : false; json: () => Promise<T['body']>; status: T['statusCode'] }\n : T;\n\nexport type CleanResponse = Omit<Response, 'status' | 'ok' | 'json'>;\nexport type FetchResponse<T extends (...args: any) => any> = ConvertToFetch<Awaited<ReturnType<T>>> & CleanResponse;\n\n// ------------------------ Proper types ------------------\n// This is used by createApiRequest and createFormFunction\n\nexport const HTTPMethods = ['GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'OPTIONS', 'HEAD'] as const;\nexport type HTTPMethod = (typeof HTTPMethods)[number];\n\nexport type ApiEndpoints = {\n path: string;\n method: HTTPMethod;\n requestInput: Record<string, any> | null;\n requestOutput: object | null;\n response: FetchResponse<\n // This means we get better types\n () => Promise<\n | { headers: object; statusCode: SuccessCode; body: any }\n | { headers: object; statusCode: ErrorCode; body: ErrorBody }\n >\n >;\n};\n","// import { deserialize } from './deserializer.js';\nimport { parse } from 'devalue';\nimport * as v from 'valibot';\n\nimport type { ApiEndpoints, ApiInput, ApiResponse } from './client-types.js';\n\nconst bodyMethods = ['POST', 'PUT', 'PATCH'] as const;\nconst queryMethods = ['GET', 'DELETE'] as const;\n\nasync function _apiRequest<T = Response>(\n path: string,\n method: 'GET' | 'POST' | 'DELETE',\n input: object | null,\n schema: ApiSchema,\n // This was here because of the deserializer being different in prod\n environment: string | 'production',\n apiUrl: string,\n headers?: HeadersInit\n): Promise<T> {\n if (schema) {\n if (schema.async === true) await v.parseAsync(schema, input);\n else v.parse(schema, input);\n }\n\n let url = `${apiUrl}${apiUrl.endsWith('/') ? '' : '/'}${path}`;\n\n if (queryMethods.includes(method as any)) {\n const params = new URLSearchParams();\n\n for (const [key, value] of Object.entries(input ?? {})) {\n if (Array.isArray(value)) {\n value.forEach((item) => params.append(key, String(item)));\n } else {\n params.append(key, String(value));\n }\n }\n\n const queryString = params.toString();\n if (queryString) url += `?${queryString}`;\n }\n\n headers = { 'Content-Type': 'application/json', ...headers };\n const response = await fetch(url, {\n method,\n headers,\n // oxlint-disable-next-line\n body: bodyMethods.includes(method as any) ? JSON.stringify(input) : undefined,\n credentials: 'include'\n });\n const contentType = response.headers.get('content-type') ?? '';\n\n let retrieved: Promise<string> | false = false;\n response.json = async () => {\n if (retrieved === false) {\n retrieved = response.text();\n }\n\n if (contentType === 'application/devalue') {\n return await parse(await retrieved);\n } else {\n return JSON.parse(await retrieved);\n }\n };\n return response as unknown as T;\n}\n\nconst HTTPMethods = ['GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'OPTIONS', 'HEAD'] as const;\ntype HTTPMethod = (typeof HTTPMethods)[number];\n\nexport type ApiRequestFunction<API extends ApiEndpoints> = <\n Path extends API['path'],\n Method extends Extract<API, { path: Path }>['method']\n>(\n path: Path,\n method: Method,\n input: ApiInput<API, Path, Method>,\n headers?: HeadersInit\n) => Promise<ApiResponse<API, Path, Method>>;\n\nexport type ApiSchema = v.GenericSchema | v.GenericSchemaAsync;\n\n/**\n * @returns A function that can be used to make API requests with type safety\n * @example const clientApiRequest = createApiRequest<ApiEndpoints>();\n */\nexport function createApiRequest<API extends ApiEndpoints>(\n schemas: Partial<Record<API['path'], Partial<Record<HTTPMethod, ApiSchema>>>>,\n apiUrl: string,\n env: string\n): ApiRequestFunction<API> {\n return async function apiRequest(path, method, input, headers) {\n const schema = schemas[path]?.[method];\n if (schema === undefined) throw new Error('Schema is undefined in api request');\n\n // if (typeof schema === 'function') {\n // schema = schema();\n // }\n\n return _apiRequest<ApiResponse<API, typeof path, typeof method>>(\n path as string,\n method as 'GET' | 'POST',\n input,\n schema,\n env,\n apiUrl,\n headers\n );\n };\n}\n","import type { APIGatewayProxyResultV2, Context, APIGatewayProxyEventV2WithLambdaAuthorizer } from 'aws-lambda';\nimport { stringify } from 'devalue';\n\nexport type SuccessCode = 200 | 201 | 204;\nexport type ErrorCode = 400 | 401 | 403 | 404 | 409 | 500;\n\nexport type ErrorBody = { message: string; field?: { name: string; value: string } };\n\n/**\n * The error response for the lambda functions to return\n */\nexport type ErrorRawProxyResultV2 = {\n statusCode: ErrorCode;\n headers?: { [header: string]: string } | undefined;\n body?: ErrorBody;\n isBase64Encoded?: boolean | undefined;\n cookies?: string[] | undefined;\n};\n\nexport type OkRawProxyResultV2 = {\n statusCode: SuccessCode;\n headers?: { [header: string]: string } | undefined;\n body?: object | undefined;\n isBase64Encoded?: boolean | undefined;\n cookies?: string[] | undefined;\n};\n/**\n * A type for the raw proxy result - just using an object not a stirng for the body\n */\nexport type RawProxyResultV2 = ErrorRawProxyResultV2 | OkRawProxyResultV2;\n\n// The type of the handler returned from wrapHandler\nexport type APIGatewayHandler<E> = (event: E, context: Context) => Promise<APIGatewayProxyResultV2>;\n\n// The type of the handler passed into wrapHandler\nexport type RawApiGatewayHandler<E extends APIGatewayProxyEventV2WithLambdaAuthorizer<any>> = (\n event: E,\n context: Context\n) => Promise<RawProxyResultV2>;\n\n/**\n * Wraps a handler that returns the body as an object rather than a string.\n *\n * This means you can achieve proper type inference on your handler and have standardised serialisation\n *\n * @example\n```ts\nexport type AuthorizerContext = {\n details: JWTPayload;\n} | null;\n\nexport const wrapHandler = baseWrapHandler<APIGatewayProxyEventV2WithLambdaAuthorizer<AuthorizerContext>>\n\n*/\nexport function wrapHandler<E extends APIGatewayProxyEventV2WithLambdaAuthorizer<any>>(\n handler: RawApiGatewayHandler<E>\n): APIGatewayHandler<E> {\n return async (event: E, context: Context): Promise<APIGatewayProxyResultV2> => {\n const result = await handler(event, context);\n\n if (result.body) {\n const headers = new Headers(result.headers);\n headers.set('Content-Type', 'application/devalue');\n\n return { ...result, headers: Object.fromEntries(headers), body: stringify(result.body) };\n } else {\n return { ...result, body: undefined };\n }\n };\n}\n","import type { Root, RootContent, Element } from 'hast';\nimport rehypeParse from 'rehype-parse';\nimport type { Plugin } from 'unified';\nimport { unified } from 'unified';\nimport type { VFile } from 'vfile';\n\n/**\n * This rehype plugin extracts the headings from the markdown elements but also the raw elements.\n * So we get html headings in the TOC as well\n *\n * It sets the file.data.fm.toc to a flat map of the toc\n */\nexport const extractToc: Plugin<[], Root> = () => {\n return (tree: Root, file: VFile) => {\n const details = tree.children.flatMap(extractDetails);\n if (file.data.fm === undefined) file.data.fm = {};\n // @ts-expect-error its untyped but for svmdex it is there\n file.data.fm.toc = details;\n };\n};\nexport type Toc = TocEntry[];\nexport type TocEntry = { level: number; id: string; value: string };\n\nfunction extractDetails(content: RootContent | { type: 'raw'; value: string }): TocEntry[] {\n if (content.type === 'element' && content.tagName.startsWith('h') && 'id' in content.properties) {\n const value =\n content.children.length === 1 && content.children[0].type === 'text'\n ? content.children[0].value\n : (content.properties.id as string);\n\n return [{ level: parseInt(content.tagName.slice(1)), id: content.properties.id as string, value }];\n } else if (content.type === 'raw') {\n const parsed = parseRaw(content.value);\n return parsed.flatMap(extractDetails);\n }\n return [];\n}\n\n/**\n * Parses raw HTML and returns a flat array of all heading (h1-h6) elements as HAST nodes.\n */\nexport function parseRaw(raw: string): Element[] {\n // Parse the HTML string into a HAST Root node\n const tree = unified()\n .use(rehypeParse, { fragment: true }) // allow parsing HTML fragments\n .parse(raw) as Root;\n\n // Helper function to recursively find heading elements\n function collectHeadings(node: RootContent): Element[] {\n if (node.type === 'element' && /^h[1-6]$/.test(node.tagName)) {\n return [node];\n }\n // Check children recursively\n if ('children' in node && Array.isArray(node.children)) {\n return node.children.flatMap(collectHeadings);\n }\n return [];\n }\n\n // Flatten all headings found in the tree\n return tree.children.flatMap(collectHeadings);\n}\n","import type { GenericSchema, GenericSchemaAsync } from 'valibot';\n\nexport function isSchema(x: unknown): x is GenericSchema {\n return !!x && typeof x === 'object' && 'kind' in x && x['kind'] === 'schema';\n}\n\nexport function unwrap(schema: GenericSchema): GenericSchema {\n // Unwrap common wrappers that simply contain another schema under `wrapped`\n // optional | exactOptional | undefinedable | nullable | nullish | nonNullable | nonNullish | readonly | brand | description | metadata | title | flavor\n // Most of these share `{ type: string; wrapped: GenericSchema }`\n // Guarded unwrap to avoid infinite loops.\n let curr: any = schema as any;\n const seen = new Set<any>();\n while (curr && typeof curr === 'object' && !seen.has(curr) && 'wrapped' in curr && isSchema((curr as any).wrapped)) {\n seen.add(curr);\n curr = (curr as any).wrapped;\n }\n return curr as GenericSchema;\n}\n\nfunction isIntegerKey(s: string): boolean {\n // allow \"0\", \"01\" etc. to index tuples/arrays consistently\n return /^-?\\d+$/.test(s);\n}\n\nexport type GetSchemaByPathOptions = {\n /**\n * When a union/variant cannot be narrowed by the path segment,\n * choose index `preferOption` (default 0). Set to -1 to return undefined instead.\n */\n preferOption?: number;\n};\n\nexport function getSchemaByPath(\n root: GenericSchema | GenericSchemaAsync,\n path: string,\n opts: GetSchemaByPathOptions = {}\n): GenericSchema | undefined {\n if (!isSchema(root)) return undefined;\n if (!path) return root;\n\n const keys = path.split('.');\n let curr: GenericSchema | undefined = root;\n\n for (let i = 0; i < keys.length; i++) {\n if (!curr) return undefined;\n curr = unwrap(curr);\n const seg = keys[i];\n\n // Narrow by schema \"type\"\n const type = (curr as any).type as string | undefined;\n\n switch (type) {\n case 'object': {\n // ObjectSchema has `.entries`\n const entries = (curr as any).entries as Record<string, GenericSchema> | undefined;\n if (!entries) return undefined;\n curr = entries[seg];\n break;\n }\n\n case 'record': {\n // RecordSchema has `.value` for any key\n const value = (curr as any).value as GenericSchema | undefined;\n curr = value;\n break;\n }\n\n case 'array': {\n // ArraySchema has `.item`\n if (!isIntegerKey(seg)) return undefined;\n const item = (curr as any).item as GenericSchema | undefined;\n curr = item;\n break;\n }\n\n case 'tuple': {\n // TupleSchema has `.items` and possibly `.rest`\n if (!isIntegerKey(seg)) return undefined;\n const idx = Number(seg);\n const items = (curr as any).items as GenericSchema[] | undefined;\n const rest = (curr as any).rest as GenericSchema | undefined;\n if (!items) return undefined;\n curr = idx < items.length ? items[idx] : rest;\n break;\n }\n\n case 'union': {\n // UnionSchema has `.options` (array of schemas)\n const options = (curr as any).options as GenericSchema[] | undefined;\n if (!options?.length) return undefined;\n\n // Try to narrow by segment:\n // - if numeric seg: prefer array/tuple options\n // - if string seg: prefer object/record options that contain seg\n const numeric = isIntegerKey(seg);\n\n let next: GenericSchema | undefined;\n\n if (numeric) {\n next =\n options.find((o) => {\n const u = unwrap(o) as any;\n return u?.type === 'array' || u?.type === 'tuple';\n }) ?? options[opts.preferOption ?? 0];\n } else {\n // Prefer object/record with matching key\n next =\n options.find((o) => {\n const u = unwrap(o) as any;\n if (u?.type === 'object') {\n const ent = u.entries as Record<string, GenericSchema> | undefined;\n return !!ent && seg in ent;\n }\n return u?.type === 'record';\n }) ?? options[opts.preferOption ?? 0];\n }\n\n curr = next;\n // Loop continues to use seg against selected option\n i--; // reprocess this segment against the chosen branch\n break;\n }\n\n case 'variant': {\n // Variant (discriminated union) has `.options` too\n const options = (curr as any).options as GenericSchema[] | undefined;\n if (!options?.length) return undefined;\n // Same narrowing as union\n const numeric = isIntegerKey(seg);\n let next: GenericSchema | undefined;\n if (numeric) {\n next =\n options.find((o) => {\n const u = unwrap(o) as any;\n return u?.type === 'array' || u?.type === 'tuple';\n }) ?? options[opts.preferOption ?? 0];\n } else {\n next =\n options.find((o) => {\n const u = unwrap(o) as any;\n if (u?.type === 'object') {\n const ent = u.entries as Record<string, GenericSchema> | undefined;\n return !!ent && seg in ent;\n }\n return u?.type === 'record';\n }) ?? options[opts.preferOption ?? 0];\n }\n curr = next;\n i--;\n break;\n }\n\n default: {\n // If it’s a pipeline schema (`pipe`) or similar wrapper, many expose `.wrapped` and are handled by unwrap.\n // If we end up at a primitive or unknown structure while keys remain, fail.\n return undefined;\n }\n }\n }\n\n return curr ? unwrap(curr) : undefined;\n}\n","import { isEqual, isObject } from 'radash';\n\nimport type { DeepPartial } from '../types/deep.js';\n\n/**\n * Sets the value for an object by its dot path\n * @param obj - any object\n * @param path - the dot path eg. key1.0.1.key2\n * @param value - any value\n * @returns - the modified object\n */\nexport function setByPath<T extends object>(obj: T, path: string, value: any): T {\n const keys = path.split('.');\n let curr: any = obj;\n\n for (let i = 0; i < keys.length - 1; i++) {\n const k = keys[i];\n const next = keys[i + 1];\n // handle array indices like '0'\n if (Number.isInteger(Number(next))) {\n curr[k] ??= [];\n } else {\n curr[k] ??= {};\n }\n curr = curr[k];\n }\n\n curr[keys[keys.length - 1]] = value;\n return obj;\n}\n\n/**\n * Gets the value from an object by its dot path\n * @param obj - any object\n * @param path - the dot path eg. key1.0.1.key2\n * @returns - the value at the given path or undefined\n */\nexport function getByPath<T extends object>(obj: T, path: string): any {\n if (!obj || typeof obj !== 'object') return undefined;\n const keys = path.split('.');\n let curr: any = obj;\n\n for (const k of keys) {\n if (curr == null) return undefined;\n curr = curr[k];\n }\n\n return curr;\n}\n\nconst isPlainRecord = (v: unknown): v is Record<string, unknown> => isObject(v) && !Array.isArray(v);\n\n/**\n * Returns a deep \"patch\" object containing only the fields from `b`\n * that are different from `a`.\n *\n * Behavior:\n * - Only keys from `b` can appear in the result.\n * - New keys in `b` are included.\n * - Changed primitive/array values are included as the value from `b`.\n * - For nested plain objects, it recurses and returns only the differing nested fields.\n * - Arrays are treated as atomic (if different, the whole array from `b` is returned).\n *\n * Typing:\n * - Output is `DeepPartial<B>` because only a subset of `b`'s shape is returned.\n *\n * @template A\n * @template B\n * @param {A} a - Base/original object (can be a different shape than `b`).\n * @param {B} b - Updated object; output keys come from this object.\n * @returns {DeepPartial<B>} Deep partial of `b` containing only differences vs `a`.\n */\nexport const deepDiff = <A extends object, B extends object>(a: A, b: B): DeepPartial<B> => {\n const out: Record<string, unknown> = {};\n\n for (const key of Object.keys(b) as Array<keyof B>) {\n const aVal = (a as any)?.[key];\n const bVal = (b as any)[key];\n\n if (!((key as any) in (a as any))) {\n out[key as any] = bVal;\n continue;\n }\n\n if (isPlainRecord(aVal) && isPlainRecord(bVal)) {\n const nested = deepDiff(aVal, bVal);\n if (Object.keys(nested as any).length) out[key as any] = nested;\n continue;\n }\n\n if (!isEqual(aVal, bVal)) out[key as any] = bVal;\n }\n\n return out as DeepPartial<B>;\n};\n\n/**\n * Deeply prunes `source` to match the *shape* of `shape`.\n *\n * Rules:\n * - Only keys that exist on `shape` are kept.\n * - Pruning is deep for nested plain objects.\n * - Arrays are supported by using the first element of `shape` as the element-shape.\n * - If `shape` is `[]`, returns `[]` (drops all elements).\n * - Primitive values are kept as-is (no type coercion) if the key exists in `shape`.\n * - If `shape` expects an object/array but `source` is not compatible, returns an empty object/array of that shape.\n *\n * @typeParam S - Source object type.\n * @typeParam Sh - Shape object type.\n * @param source - The object to prune.\n * @param shape - The object whose keys/structure are the allowlist.\n * @returns A new value derived from `source`, containing only fields present in `shape`, pruned deeply.\n *\n * @example\n * const source = { a: 1, b: { c: 2, d: 3 }, e: [ { x: 1, y: 2 }, { x: 3, y: 4 } ], z: 9 };\n * const shape = { a: 0, b: { c: 0 }, e: [ { x: 0 } ] };\n * // => { a: 1, b: { c: 2 }, e: [ { x: 1 }, { x: 3 } ] }\n * const out = pruneToShape(source, shape);\n */\nexport function pruneToShape<S, Sh>(source: S, shape: Sh): Sh {\n return pruneAny(source as unknown, shape as unknown) as Sh;\n\n function pruneAny(src: unknown, sh: unknown): unknown {\n // Arrays: use first element as the \"element shape\"\n if (Array.isArray(sh)) {\n if (!Array.isArray(src)) return [];\n if (sh.length === 0) return [];\n const elemShape = sh[0];\n return src.map((v) => pruneAny(v, elemShape));\n }\n\n // Plain objects: keep only keys present on shape, recursively.\n if (isPlainObject(sh)) {\n const out: Record<string, unknown> = {};\n const srcObj = isPlainObject(src) ? (src as Record<string, unknown>) : undefined;\n\n for (const key of Object.keys(sh as Record<string, unknown>)) {\n const shVal = (sh as Record<string, unknown>)[key];\n const srcVal = srcObj ? srcObj[key] : undefined;\n\n if (Array.isArray(shVal) || isPlainObject(shVal)) {\n out[key] = pruneAny(srcVal, shVal);\n } else {\n // Primitive (or function/date/etc in shape): key exists => keep source value as-is\n out[key] = srcVal;\n }\n }\n return out;\n }\n\n // Non-object shape => allowed leaf; just return source leaf as-is.\n return src;\n }\n\n function isPlainObject(v: unknown): v is Record<string, unknown> {\n if (v === null || typeof v !== 'object') return false;\n const proto = Object.getPrototypeOf(v);\n return proto === Object.prototype || proto === null;\n }\n}\n"],"mappings":";;;;;;AA6EA,MAAa,cAAc;CAAC;CAAO;CAAQ;CAAO;CAAU;CAAS;CAAW;CAAO;;;ACvEvF,MAAM,cAAc;CAAC;CAAQ;CAAO;CAAQ;AAC5C,MAAM,eAAe,CAAC,OAAO,SAAS;AAEtC,eAAe,YACb,MACA,QACA,OACA,QAEA,aACA,QACA,SACY;AACZ,KAAI,OACF,KAAI,OAAO,UAAU,KAAM,OAAM,EAAE,WAAW,QAAQ,MAAM;KACvD,GAAE,MAAM,QAAQ,MAAM;CAG7B,IAAI,MAAM,GAAG,SAAS,OAAO,SAAS,IAAI,GAAG,KAAK,MAAM;AAExD,KAAI,aAAa,SAAS,OAAc,EAAE;EACxC,MAAM,SAAS,IAAI,iBAAiB;AAEpC,OAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,SAAS,EAAE,CAAC,CACpD,KAAI,MAAM,QAAQ,MAAM,CACtB,OAAM,SAAS,SAAS,OAAO,OAAO,KAAK,OAAO,KAAK,CAAC,CAAC;MAEzD,QAAO,OAAO,KAAK,OAAO,MAAM,CAAC;EAIrC,MAAM,cAAc,OAAO,UAAU;AACrC,MAAI,YAAa,QAAO,IAAI;;AAG9B,WAAU;EAAE,gBAAgB;EAAoB,GAAG;EAAS;CAC5D,MAAM,WAAW,MAAM,MAAM,KAAK;EAChC;EACA;EAEA,MAAM,YAAY,SAAS,OAAc,GAAG,KAAK,UAAU,MAAM,G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ChD,MAAM,QAAQ,OAAO,eAAe,EAAE;AACtC,SAAO,UAAU,OAAO,aAAa,UAAU"}
1
+ {"version":3,"file":"browser.js","names":[],"sources":["../src/lambda/client-types.ts","../src/lambda/client.ts","../src/lambda/handlerUtils.ts","../src/rehype/flat-toc.ts","../src/utils/valibot.ts","../src/utils/object.ts"],"sourcesContent":["import type { ErrorBody, SuccessCode, ErrorCode } from './handlerUtils.js';\n\n// ----------------- Helpers ----------------------\n// Used to easily extract types from ApiEndpoints types\n\n/**\n * Extracts the requestInput type from an API endpoint definition\n * @template E - Union type of all API endpoints\n * @template P - Path string literal type (e.g. 'payments/account')\n * @template M - HTTP method string literal type (e.g. 'GET', 'POST')\n */\nexport type ApiInput<E extends ApiEndpoints, P extends E['path'], M extends E['method']> = Extract<\n E,\n { path: P; method: M }\n>['requestInput'];\n\n/**\n * Extracts the requestOutput type from an API endpoint definition\n * @template E - Union type of all API endpoints\n * @template P - Path string literal type (e.g. 'payments/account')\n * @template M - HTTP method string literal type (e.g. 'GET', 'POST')\n */\nexport type ApiOutput<E extends ApiEndpoints, P extends E['path'], M extends E['method']> = Extract<\n E,\n { path: P; method: M }\n>['requestOutput'];\n\n/**\n * Extracts the response type from an API endpoint definition\n * @template E - Union type of all API endpoints\n * @template P - Path string literal type (e.g. 'payments/account')\n * @template M - HTTP method string literal type (e.g. 'GET', 'POST')\n */\nexport type ApiResponse<E extends ApiEndpoints, P extends E['path'], M extends E['method']> = Extract<\n E,\n { path: P; method: M }\n>['response'];\n\n/**\n * Extracts the sucessful body type from an API endpoint definition\n * @template E - Union type of all API endpoints\n * @template P - Path string literal type (e.g. 'payments/account')\n * @template M - HTTP method string literal type (e.g. 'GET', 'POST')\n */\nexport type ApiSuccessBody<E extends ApiEndpoints, P extends E['path'], M extends E['method']> = Extract<\n Extract<E, { path: P; method: M }>['response'],\n { status: SuccessCode }\n>['json'] extends () => Promise<infer R>\n ? R\n : unknown;\n\n/**\n * Extracts the sucessful body type from an API endpoint definition\n * @template E - Union type of all API endpoints\n * @template P - Path string literal type (e.g. 'payments/account')\n * @template M - HTTP method string literal type (e.g. 'GET', 'POST')\n */\nexport type ApiErrorBody<E extends ApiEndpoints, P extends E['path'], M extends E['method']> = Extract<\n Extract<E, { path: P; method: M }>['response'],\n { status: ErrorCode }\n>['json'] extends () => Promise<infer R>\n ? R\n : unknown;\n\n/**\n * Converts a RawApiGatewayHandler response type to a fetch like response type.\n */\ntype ConvertToFetch<T> = T extends { statusCode: number; body: object; headers: object }\n ? { ok: T['statusCode'] extends SuccessCode ? true : false; json: () => Promise<T['body']>; status: T['statusCode'] }\n : T;\n\nexport type CleanResponse = Omit<Response, 'status' | 'ok' | 'json'>;\nexport type FetchResponse<T extends (...args: any) => any> = ConvertToFetch<Awaited<ReturnType<T>>> & CleanResponse;\n\n// ------------------------ Proper types ------------------\n// This is used by createApiRequest and createFormFunction\n\nexport const HTTPMethods = ['GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'OPTIONS', 'HEAD'] as const;\nexport type HTTPMethod = (typeof HTTPMethods)[number];\n\nexport type ApiEndpoints = {\n path: string;\n method: HTTPMethod;\n requestInput: Record<string, any> | null;\n requestOutput: object | null;\n response: FetchResponse<\n // This means we get better types\n () => Promise<\n | { headers: object; statusCode: SuccessCode; body: any }\n | { headers: object; statusCode: ErrorCode; body: ErrorBody }\n >\n >;\n};\n","// import { deserialize } from './deserializer.js';\nimport { parse } from 'devalue';\nimport { parse as vParse, parseAsync, type GenericSchema, type GenericSchemaAsync } from 'valibot';\n\nimport type { ApiEndpoints, ApiInput, ApiResponse } from './client-types.js';\n\nconst bodyMethods = ['POST', 'PUT', 'PATCH'] as const;\nconst queryMethods = ['GET', 'DELETE'] as const;\n\nasync function _apiRequest<T = Response>(\n path: string,\n method: 'GET' | 'POST' | 'DELETE',\n input: object | null,\n schema: ApiSchema,\n // This was here because of the deserializer being different in prod\n environment: string | 'production',\n apiUrl: string,\n headers?: HeadersInit\n): Promise<T> {\n if (schema) {\n if (schema.async === true) await parseAsync(schema, input);\n else vParse(schema, input);\n }\n\n let url = `${apiUrl}${apiUrl.endsWith('/') ? '' : '/'}${path}`;\n\n if (queryMethods.includes(method as any)) {\n const params = new URLSearchParams();\n\n for (const [key, value] of Object.entries(input ?? {})) {\n if (Array.isArray(value)) {\n value.forEach((item) => params.append(key, String(item)));\n } else {\n params.append(key, String(value));\n }\n }\n\n const queryString = params.toString();\n if (queryString) url += `?${queryString}`;\n }\n\n headers = { 'Content-Type': 'application/json', ...headers };\n const response = await fetch(url, {\n method,\n headers,\n // oxlint-disable-next-line\n body: bodyMethods.includes(method as any) ? JSON.stringify(input) : undefined,\n credentials: 'include'\n });\n const contentType = response.headers.get('content-type') ?? '';\n\n let retrieved: Promise<string> | false = false;\n response.json = async () => {\n if (retrieved === false) {\n retrieved = response.text();\n }\n\n if (contentType === 'application/devalue') {\n return await parse(await retrieved);\n } else {\n return JSON.parse(await retrieved);\n }\n };\n return response as unknown as T;\n}\n\nconst HTTPMethods = ['GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'OPTIONS', 'HEAD'] as const;\ntype HTTPMethod = (typeof HTTPMethods)[number];\n\nexport type ApiRequestFunction<API extends ApiEndpoints> = <\n Path extends API['path'],\n Method extends Extract<API, { path: Path }>['method']\n>(\n path: Path,\n method: Method,\n input: ApiInput<API, Path, Method>,\n headers?: HeadersInit\n) => Promise<ApiResponse<API, Path, Method>>;\n\nexport type ApiSchema = GenericSchema | GenericSchemaAsync;\n\n/**\n * @returns A function that can be used to make API requests with type safety\n * @example const clientApiRequest = createApiRequest<ApiEndpoints>();\n */\nexport function createApiRequest<API extends ApiEndpoints>(\n schemas: Partial<Record<API['path'], Partial<Record<HTTPMethod, ApiSchema>>>>,\n apiUrl: string,\n env: string\n): ApiRequestFunction<API> {\n return async function apiRequest(path, method, input, headers) {\n const schema = schemas[path]?.[method];\n if (schema === undefined) throw new Error('Schema is undefined in api request');\n\n // if (typeof schema === 'function') {\n // schema = schema();\n // }\n\n return _apiRequest<ApiResponse<API, typeof path, typeof method>>(\n path as string,\n method as 'GET' | 'POST',\n input,\n schema,\n env,\n apiUrl,\n headers\n );\n };\n}\n","import type { APIGatewayProxyResultV2, Context, APIGatewayProxyEventV2WithLambdaAuthorizer } from 'aws-lambda';\nimport { stringify } from 'devalue';\n\nexport type SuccessCode = 200 | 201 | 204;\nexport type ErrorCode = 400 | 401 | 403 | 404 | 409 | 500;\n\nexport type ErrorBody = { message: string; field?: { name: string; value: string } };\n\n/**\n * The error response for the lambda functions to return\n */\nexport type ErrorRawProxyResultV2 = {\n statusCode: ErrorCode;\n headers?: { [header: string]: string } | undefined;\n body?: ErrorBody;\n isBase64Encoded?: boolean | undefined;\n cookies?: string[] | undefined;\n};\n\nexport type OkRawProxyResultV2 = {\n statusCode: SuccessCode;\n headers?: { [header: string]: string } | undefined;\n body?: object | undefined;\n isBase64Encoded?: boolean | undefined;\n cookies?: string[] | undefined;\n};\n/**\n * A type for the raw proxy result - just using an object not a stirng for the body\n */\nexport type RawProxyResultV2 = ErrorRawProxyResultV2 | OkRawProxyResultV2;\n\n// The type of the handler returned from wrapHandler\nexport type APIGatewayHandler<E> = (event: E, context: Context) => Promise<APIGatewayProxyResultV2>;\n\n// The type of the handler passed into wrapHandler\nexport type RawApiGatewayHandler<E extends APIGatewayProxyEventV2WithLambdaAuthorizer<any>> = (\n event: E,\n context: Context\n) => Promise<RawProxyResultV2>;\n\n/**\n * Wraps a handler that returns the body as an object rather than a string.\n *\n * This means you can achieve proper type inference on your handler and have standardised serialisation\n *\n * @example\n```ts\nexport type AuthorizerContext = {\n details: JWTPayload;\n} | null;\n\nexport const wrapHandler = baseWrapHandler<APIGatewayProxyEventV2WithLambdaAuthorizer<AuthorizerContext>>\n\n*/\nexport function wrapHandler<E extends APIGatewayProxyEventV2WithLambdaAuthorizer<any>>(\n handler: RawApiGatewayHandler<E>\n): APIGatewayHandler<E> {\n return async (event: E, context: Context): Promise<APIGatewayProxyResultV2> => {\n const result = await handler(event, context);\n\n if (result.body) {\n const headers = new Headers(result.headers);\n headers.set('Content-Type', 'application/devalue');\n\n return { ...result, headers: Object.fromEntries(headers), body: stringify(result.body) };\n } else {\n return { ...result, body: undefined };\n }\n };\n}\n","import type { Root, RootContent, Element } from 'hast';\nimport rehypeParse from 'rehype-parse';\nimport type { Plugin } from 'unified';\nimport { unified } from 'unified';\nimport type { VFile } from 'vfile';\n\n/**\n * This rehype plugin extracts the headings from the markdown elements but also the raw elements.\n * So we get html headings in the TOC as well\n *\n * It sets the file.data.fm.toc to a flat map of the toc\n */\nexport const extractToc: Plugin<[], Root> = () => {\n return (tree: Root, file: VFile) => {\n const details = tree.children.flatMap(extractDetails);\n if (file.data.fm === undefined) file.data.fm = {};\n // @ts-expect-error its untyped but for svmdex it is there\n file.data.fm.toc = details;\n };\n};\nexport type Toc = TocEntry[];\nexport type TocEntry = { level: number; id: string; value: string };\n\nfunction extractDetails(content: RootContent | { type: 'raw'; value: string }): TocEntry[] {\n if (content.type === 'element' && content.tagName.startsWith('h') && 'id' in content.properties) {\n const value =\n content.children.length === 1 && content.children[0].type === 'text'\n ? content.children[0].value\n : (content.properties.id as string);\n\n return [{ level: parseInt(content.tagName.slice(1)), id: content.properties.id as string, value }];\n } else if (content.type === 'raw') {\n const parsed = parseRaw(content.value);\n return parsed.flatMap(extractDetails);\n }\n return [];\n}\n\n/**\n * Parses raw HTML and returns a flat array of all heading (h1-h6) elements as HAST nodes.\n */\nexport function parseRaw(raw: string): Element[] {\n // Parse the HTML string into a HAST Root node\n const tree = unified()\n .use(rehypeParse, { fragment: true }) // allow parsing HTML fragments\n .parse(raw) as Root;\n\n // Helper function to recursively find heading elements\n function collectHeadings(node: RootContent): Element[] {\n if (node.type === 'element' && /^h[1-6]$/.test(node.tagName)) {\n return [node];\n }\n // Check children recursively\n if ('children' in node && Array.isArray(node.children)) {\n return node.children.flatMap(collectHeadings);\n }\n return [];\n }\n\n // Flatten all headings found in the tree\n return tree.children.flatMap(collectHeadings);\n}\n","import type { GenericSchema, GenericSchemaAsync } from 'valibot';\n\nexport function isSchema(x: unknown): x is GenericSchema {\n return !!x && typeof x === 'object' && 'kind' in x && x['kind'] === 'schema';\n}\n\nexport function unwrap(schema: GenericSchema): GenericSchema {\n // Unwrap common wrappers that simply contain another schema under `wrapped`\n // optional | exactOptional | undefinedable | nullable | nullish | nonNullable | nonNullish | readonly | brand | description | metadata | title | flavor\n // Most of these share `{ type: string; wrapped: GenericSchema }`\n // Guarded unwrap to avoid infinite loops.\n let curr: any = schema as any;\n const seen = new Set<any>();\n while (curr && typeof curr === 'object' && !seen.has(curr) && 'wrapped' in curr && isSchema((curr as any).wrapped)) {\n seen.add(curr);\n curr = (curr as any).wrapped;\n }\n return curr as GenericSchema;\n}\n\nfunction isIntegerKey(s: string): boolean {\n // allow \"0\", \"01\" etc. to index tuples/arrays consistently\n return /^-?\\d+$/.test(s);\n}\n\nexport type GetSchemaByPathOptions = {\n /**\n * When a union/variant cannot be narrowed by the path segment,\n * choose index `preferOption` (default 0). Set to -1 to return undefined instead.\n */\n preferOption?: number;\n};\n\nexport function getSchemaByPath(\n root: GenericSchema | GenericSchemaAsync,\n path: string,\n opts: GetSchemaByPathOptions = {}\n): GenericSchema | undefined {\n if (!isSchema(root)) return undefined;\n if (!path) return root;\n\n const keys = path.split('.');\n let curr: GenericSchema | undefined = root;\n\n for (let i = 0; i < keys.length; i++) {\n if (!curr) return undefined;\n curr = unwrap(curr);\n const seg = keys[i];\n\n // Narrow by schema \"type\"\n const type = (curr as any).type as string | undefined;\n\n switch (type) {\n case 'object': {\n // ObjectSchema has `.entries`\n const entries = (curr as any).entries as Record<string, GenericSchema> | undefined;\n if (!entries) return undefined;\n curr = entries[seg];\n break;\n }\n\n case 'record': {\n // RecordSchema has `.value` for any key\n const value = (curr as any).value as GenericSchema | undefined;\n curr = value;\n break;\n }\n\n case 'array': {\n // ArraySchema has `.item`\n if (!isIntegerKey(seg)) return undefined;\n const item = (curr as any).item as GenericSchema | undefined;\n curr = item;\n break;\n }\n\n case 'tuple': {\n // TupleSchema has `.items` and possibly `.rest`\n if (!isIntegerKey(seg)) return undefined;\n const idx = Number(seg);\n const items = (curr as any).items as GenericSchema[] | undefined;\n const rest = (curr as any).rest as GenericSchema | undefined;\n if (!items) return undefined;\n curr = idx < items.length ? items[idx] : rest;\n break;\n }\n\n case 'union': {\n // UnionSchema has `.options` (array of schemas)\n const options = (curr as any).options as GenericSchema[] | undefined;\n if (!options?.length) return undefined;\n\n // Try to narrow by segment:\n // - if numeric seg: prefer array/tuple options\n // - if string seg: prefer object/record options that contain seg\n const numeric = isIntegerKey(seg);\n\n let next: GenericSchema | undefined;\n\n if (numeric) {\n next =\n options.find((o) => {\n const u = unwrap(o) as any;\n return u?.type === 'array' || u?.type === 'tuple';\n }) ?? options[opts.preferOption ?? 0];\n } else {\n // Prefer object/record with matching key\n next =\n options.find((o) => {\n const u = unwrap(o) as any;\n if (u?.type === 'object') {\n const ent = u.entries as Record<string, GenericSchema> | undefined;\n return !!ent && seg in ent;\n }\n return u?.type === 'record';\n }) ?? options[opts.preferOption ?? 0];\n }\n\n curr = next;\n // Loop continues to use seg against selected option\n i--; // reprocess this segment against the chosen branch\n break;\n }\n\n case 'variant': {\n // Variant (discriminated union) has `.options` too\n const options = (curr as any).options as GenericSchema[] | undefined;\n if (!options?.length) return undefined;\n // Same narrowing as union\n const numeric = isIntegerKey(seg);\n let next: GenericSchema | undefined;\n if (numeric) {\n next =\n options.find((o) => {\n const u = unwrap(o) as any;\n return u?.type === 'array' || u?.type === 'tuple';\n }) ?? options[opts.preferOption ?? 0];\n } else {\n next =\n options.find((o) => {\n const u = unwrap(o) as any;\n if (u?.type === 'object') {\n const ent = u.entries as Record<string, GenericSchema> | undefined;\n return !!ent && seg in ent;\n }\n return u?.type === 'record';\n }) ?? options[opts.preferOption ?? 0];\n }\n curr = next;\n i--;\n break;\n }\n\n default: {\n // If it’s a pipeline schema (`pipe`) or similar wrapper, many expose `.wrapped` and are handled by unwrap.\n // If we end up at a primitive or unknown structure while keys remain, fail.\n return undefined;\n }\n }\n }\n\n return curr ? unwrap(curr) : undefined;\n}\n","import { isEqual, isObject } from 'radash';\n\nimport type { DeepPartial } from '../types/deep.js';\n\n/**\n * Sets the value for an object by its dot path\n * @param obj - any object\n * @param path - the dot path eg. key1.0.1.key2\n * @param value - any value\n * @returns - the modified object\n */\nexport function setByPath<T extends object>(obj: T, path: string, value: any): T {\n const keys = path.split('.');\n let curr: any = obj;\n\n for (let i = 0; i < keys.length - 1; i++) {\n const k = keys[i];\n const next = keys[i + 1];\n // handle array indices like '0'\n if (Number.isInteger(Number(next))) {\n curr[k] ??= [];\n } else {\n curr[k] ??= {};\n }\n curr = curr[k];\n }\n\n curr[keys[keys.length - 1]] = value;\n return obj;\n}\n\n/**\n * Gets the value from an object by its dot path\n * @param obj - any object\n * @param path - the dot path eg. key1.0.1.key2\n * @returns - the value at the given path or undefined\n */\nexport function getByPath<T extends object>(obj: T, path: string): any {\n if (!obj || typeof obj !== 'object') return undefined;\n const keys = path.split('.');\n let curr: any = obj;\n\n for (const k of keys) {\n if (curr == null) return undefined;\n curr = curr[k];\n }\n\n return curr;\n}\n\nconst isPlainRecord = (v: unknown): v is Record<string, unknown> => isObject(v) && !Array.isArray(v);\n\n/**\n * Returns a deep \"patch\" object containing only the fields from `b`\n * that are different from `a`.\n *\n * Behavior:\n * - Only keys from `b` can appear in the result.\n * - New keys in `b` are included.\n * - Changed primitive/array values are included as the value from `b`.\n * - For nested plain objects, it recurses and returns only the differing nested fields.\n * - Arrays are treated as atomic (if different, the whole array from `b` is returned).\n *\n * Typing:\n * - Output is `DeepPartial<B>` because only a subset of `b`'s shape is returned.\n *\n * @template A\n * @template B\n * @param {A} a - Base/original object (can be a different shape than `b`).\n * @param {B} b - Updated object; output keys come from this object.\n * @returns {DeepPartial<B>} Deep partial of `b` containing only differences vs `a`.\n */\nexport const deepDiff = <A extends object, B extends object>(a: A, b: B): DeepPartial<B> => {\n const out: Record<string, unknown> = {};\n\n for (const key of Object.keys(b) as Array<keyof B>) {\n const aVal = (a as any)?.[key];\n const bVal = (b as any)[key];\n\n if (!((key as any) in (a as any))) {\n out[key as any] = bVal;\n continue;\n }\n\n if (isPlainRecord(aVal) && isPlainRecord(bVal)) {\n const nested = deepDiff(aVal, bVal);\n if (Object.keys(nested as any).length) out[key as any] = nested;\n continue;\n }\n\n if (!isEqual(aVal, bVal)) out[key as any] = bVal;\n }\n\n return out as DeepPartial<B>;\n};\n\n/**\n * Deeply prunes `source` to match the *shape* of `shape`.\n *\n * Rules:\n * - Only keys that exist on `shape` are kept.\n * - Pruning is deep for nested plain objects.\n * - Arrays are supported by using the first element of `shape` as the element-shape.\n * - If `shape` is `[]`, returns `[]` (drops all elements).\n * - Primitive values are kept as-is (no type coercion) if the key exists in `shape`.\n * - If `shape` expects an object/array but `source` is not compatible, returns an empty object/array of that shape.\n *\n * @typeParam S - Source object type.\n * @typeParam Sh - Shape object type.\n * @param source - The object to prune.\n * @param shape - The object whose keys/structure are the allowlist.\n * @returns A new value derived from `source`, containing only fields present in `shape`, pruned deeply.\n *\n * @example\n * const source = { a: 1, b: { c: 2, d: 3 }, e: [ { x: 1, y: 2 }, { x: 3, y: 4 } ], z: 9 };\n * const shape = { a: 0, b: { c: 0 }, e: [ { x: 0 } ] };\n * // => { a: 1, b: { c: 2 }, e: [ { x: 1 }, { x: 3 } ] }\n * const out = pruneToShape(source, shape);\n */\nexport function pruneToShape<S, Sh>(source: S, shape: Sh): Sh {\n return pruneAny(source as unknown, shape as unknown) as Sh;\n\n function pruneAny(src: unknown, sh: unknown): unknown {\n // Arrays: use first element as the \"element shape\"\n if (Array.isArray(sh)) {\n if (!Array.isArray(src)) return [];\n if (sh.length === 0) return [];\n const elemShape = sh[0];\n return src.map((v) => pruneAny(v, elemShape));\n }\n\n // Plain objects: keep only keys present on shape, recursively.\n if (isPlainObject(sh)) {\n const out: Record<string, unknown> = {};\n const srcObj = isPlainObject(src) ? (src as Record<string, unknown>) : undefined;\n\n for (const key of Object.keys(sh as Record<string, unknown>)) {\n const shVal = (sh as Record<string, unknown>)[key];\n const srcVal = srcObj ? srcObj[key] : undefined;\n\n if (Array.isArray(shVal) || isPlainObject(shVal)) {\n out[key] = pruneAny(srcVal, shVal);\n } else {\n // Primitive (or function/date/etc in shape): key exists => keep source value as-is\n out[key] = srcVal;\n }\n }\n return out;\n }\n\n // Non-object shape => allowed leaf; just return source leaf as-is.\n return src;\n }\n\n function isPlainObject(v: unknown): v is Record<string, unknown> {\n if (v === null || typeof v !== 'object') return false;\n const proto = Object.getPrototypeOf(v);\n return proto === Object.prototype || proto === null;\n }\n}\n"],"mappings":";;;;;;AA6EA,MAAa,cAAc;CAAC;CAAO;CAAQ;CAAO;CAAU;CAAS;CAAW;CAAO;;;ACvEvF,MAAM,cAAc;CAAC;CAAQ;CAAO;CAAQ;AAC5C,MAAM,eAAe,CAAC,OAAO,SAAS;AAEtC,eAAe,YACb,MACA,QACA,OACA,QAEA,aACA,QACA,SACY;AACZ,KAAI,OACF,KAAI,OAAO,UAAU,KAAM,OAAM,WAAW,QAAQ,MAAM;KACrD,SAAO,QAAQ,MAAM;CAG5B,IAAI,MAAM,GAAG,SAAS,OAAO,SAAS,IAAI,GAAG,KAAK,MAAM;AAExD,KAAI,aAAa,SAAS,OAAc,EAAE;EACxC,MAAM,SAAS,IAAI,iBAAiB;AAEpC,OAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,SAAS,EAAE,CAAC,CACpD,KAAI,MAAM,QAAQ,MAAM,CACtB,OAAM,SAAS,SAAS,OAAO,OAAO,KAAK,OAAO,KAAK,CAAC,CAAC;MAEzD,QAAO,OAAO,KAAK,OAAO,MAAM,CAAC;EAIrC,MAAM,cAAc,OAAO,UAAU;AACrC,MAAI,YAAa,QAAO,IAAI;;AAG9B,WAAU;EAAE,gBAAgB;EAAoB,GAAG;EAAS;CAC5D,MAAM,WAAW,MAAM,MAAM,KAAK;EAChC;EACA;EAEA,MAAM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AAI,MAAM,QAAQ,OAAO,MAAM,SAAU,QAAO;EAChD,MAAM,QAAQ,OAAO,eAAe,EAAE;AACtC,SAAO,UAAU,OAAO,aAAa,UAAU"}
package/dist/index.d.mts CHANGED
@@ -1,15 +1,14 @@
1
- import * as v from "valibot";
2
1
  import { GenericSchema, GenericSchemaAsync, SafeParseResult } from "valibot";
3
- import * as _$cookie from "cookie";
2
+ import * as _$cookie_es0 from "cookie-es";
4
3
  import { Result, ResultAsync } from "neverthrow";
5
4
  import * as _$_aws_sdk_client_cognito_identity_provider0 from "@aws-sdk/client-cognito-identity-provider";
6
5
  import { AdminGetUserCommandOutput, AttributeType, CognitoIdentityProviderClient } from "@aws-sdk/client-cognito-identity-provider";
7
6
  import { S3Client } from "@aws-sdk/client-s3";
7
+ import { getSignedUrl as getSignedUrl$1 } from "@aws-sdk/s3-request-presigner";
8
8
  import { DynamoDBToolboxError } from "dynamodb-toolbox";
9
9
  import { Plugin } from "unified";
10
10
  import { styleText } from "node:util";
11
11
  import { APIGatewayProxyEventV2WithLambdaAuthorizer, APIGatewayProxyResultV2, APIGatewayRequestAuthorizerEventV2, Context } from "aws-lambda";
12
- import * as _$_smithy_types0 from "@smithy/types";
13
12
  import { PackageJson } from "type-fest";
14
13
 
15
14
  //#region src/lambda/handlerUtils.d.ts
@@ -158,7 +157,7 @@ type HTTPMethod$1 = (typeof HTTPMethods$1)[number];
158
157
  type ApiRequestFunction<API extends ApiEndpoints> = <Path extends API['path'], Method extends Extract<API, {
159
158
  path: Path;
160
159
  }>['method']>(path: Path, method: Method, input: ApiInput<API, Path, Method>, headers?: HeadersInit) => Promise<ApiResponse<API, Path, Method>>;
161
- type ApiSchema = v.GenericSchema | v.GenericSchemaAsync;
160
+ type ApiSchema = GenericSchema | GenericSchemaAsync;
162
161
  /**
163
162
  * @returns A function that can be used to make API requests with type safety
164
163
  * @example const clientApiRequest = createApiRequest<ApiEndpoints>();
@@ -174,12 +173,12 @@ declare function createApiRequest<API extends ApiEndpoints>(schemas: Partial<Rec
174
173
  * The separation means that they can be returned from functions that are certainly run inside a lambda fucntion but theyre not the actual return of the lambda.
175
174
  * Im not sure it this is optimal behaviour and if not we will migrate to only using the errorResponse function
176
175
  */
177
- declare const error_lambda_badRequest: (message: string, fieldName?: string, fieldValue?: string) => type_error_lambda_badRequest;
178
- declare const error_lambda_unauthorized: (message: string) => type_error_lambda_unauthorized;
179
- declare const error_lambda_forbidden: (message: string) => type_error_lambda_forbidden;
180
- declare const error_lambda_notFound: (message: string, fieldName?: string, fieldValue?: string) => type_error_lambda_notFound;
181
- declare const error_lambda_conflict: (message: string, fieldName?: string, fieldValue?: string) => type_error_lambda_conflict;
182
- declare const error_lambda_internal: (message: string) => type_error_lambda_internal;
176
+ declare function error_lambda_badRequest(message: string, fieldName?: string, fieldValue?: string): type_error_lambda_badRequest;
177
+ declare function error_lambda_unauthorized(message: string): type_error_lambda_unauthorized;
178
+ declare function error_lambda_forbidden(message: string): type_error_lambda_forbidden;
179
+ declare function error_lambda_notFound(message: string, fieldName?: string, fieldValue?: string): type_error_lambda_notFound;
180
+ declare function error_lambda_conflict(message: string, fieldName?: string, fieldValue?: string): type_error_lambda_conflict;
181
+ declare function error_lambda_internal(message: string): type_error_lambda_internal;
183
182
  type type_error_lambda_badRequest = {
184
183
  type: 'badRequest';
185
184
  message: string;
@@ -301,7 +300,7 @@ declare function response_ok<Body extends {
301
300
  /**
302
301
  * Wraps cookies parse along with the api gateway event with neverthrow
303
302
  */
304
- declare const getCookies: (event: APIGatewayProxyEventV2WithLambdaAuthorizer<any> | APIGatewayRequestAuthorizerEventV2) => Result<_$cookie.Cookies, type_error_lambda_unauthorized>;
303
+ declare function getCookies(event: APIGatewayProxyEventV2WithLambdaAuthorizer<any> | APIGatewayRequestAuthorizerEventV2): Result<_$cookie_es0.Cookies, type_error_lambda_unauthorized>;
305
304
  //#endregion
306
305
  //#region src/cognito/client.d.ts
307
306
  /**
@@ -335,10 +334,10 @@ type type_userResponse = Omit<AdminGetUserCommandOutput, 'UserAttributes'> & {
335
334
  /**
336
335
  * Performs an AdminGetUserCommand and extracts the user attributes into an object
337
336
  */
338
- declare const getUserDetails: (a: {
337
+ declare function getUserDetails(a: {
339
338
  username: string;
340
339
  userPoolId: string;
341
- }) => ResultAsync<type_userResponse, type_error_cognito>;
340
+ }): ResultAsync<type_userResponse, type_error_cognito>;
342
341
  /**
343
342
  * @returns An object of attributes with their names as keys and values as values.
344
343
  */
@@ -346,10 +345,10 @@ declare function extractAttributes(attrs: AttributeType[] | undefined): Record<s
346
345
  /**
347
346
  * Performs an AdminGetUserCommand and extracts the user attributes into an object
348
347
  */
349
- declare const getUserGroups: (a: {
348
+ declare function getUserGroups(a: {
350
349
  username: string;
351
350
  userPoolId: string;
352
- }) => ResultAsync<_$_aws_sdk_client_cognito_identity_provider0.AdminListGroupsForUserCommandOutput, type_error_cognito>;
351
+ }): ResultAsync<_$_aws_sdk_client_cognito_identity_provider0.AdminListGroupsForUserCommandOutput, type_error_cognito>;
353
352
  //#endregion
354
353
  //#region src/cognito/password.d.ts
355
354
  /**
@@ -367,7 +366,7 @@ declare function computeSecretHash(username: string, clientId: string, clientSec
367
366
  * @param oldPassword - Current password.
368
367
  * @param newPassword - New password to set.
369
368
  */
370
- declare const changePassword: (accessToken: string, oldPassword: string, newPassword: string) => ResultAsync<_$_aws_sdk_client_cognito_identity_provider0.ChangePasswordCommandOutput, type_error_cognito>;
369
+ declare function changePassword(accessToken: string, oldPassword: string, newPassword: string): ResultAsync<_$_aws_sdk_client_cognito_identity_provider0.ChangePasswordCommandOutput, type_error_cognito>;
371
370
  /**
372
371
  * Completes a forgot-password flow by submitting the confirmation code and new password.
373
372
  *
@@ -377,13 +376,13 @@ declare const changePassword: (accessToken: string, oldPassword: string, newPass
377
376
  * @param a.clientId - Cognito app client ID.
378
377
  * @param a.clientSecret - Cognito app client secret.
379
378
  */
380
- declare const confirmForgotPassword: (a: {
379
+ declare function confirmForgotPassword(a: {
381
380
  username: string;
382
381
  confirmationCode: string;
383
382
  newPassword: string;
384
383
  clientId: string;
385
384
  clientSecret: string;
386
- }) => ResultAsync<_$_aws_sdk_client_cognito_identity_provider0.ConfirmForgotPasswordCommandOutput, type_error_cognito>;
385
+ }): ResultAsync<_$_aws_sdk_client_cognito_identity_provider0.ConfirmForgotPasswordCommandOutput, type_error_cognito>;
387
386
  /**
388
387
  * Confirms a user's signup using the confirmation code sent by Cognito.
389
388
  *
@@ -392,12 +391,12 @@ declare const confirmForgotPassword: (a: {
392
391
  * @param a.clientId - Cognito app client ID.
393
392
  * @param a.clientSecret - Cognito app client secret.
394
393
  */
395
- declare const confirmSignup: (a: {
394
+ declare function confirmSignup(a: {
396
395
  username: string;
397
396
  confirmationCode: string;
398
397
  clientId: string;
399
398
  clientSecret: string;
400
- }) => ResultAsync<_$_aws_sdk_client_cognito_identity_provider0.ConfirmSignUpCommandOutput, type_error_cognito>;
399
+ }): ResultAsync<_$_aws_sdk_client_cognito_identity_provider0.ConfirmSignUpCommandOutput, type_error_cognito>;
401
400
  /**
402
401
  * Starts a forgot-password flow by sending a reset code to the user.
403
402
  *
@@ -405,11 +404,11 @@ declare const confirmSignup: (a: {
405
404
  * @param a.clientId - Cognito app client ID.
406
405
  * @param a.clientSecret - Cognito app client secret.
407
406
  */
408
- declare const forgotPassword: (a: {
407
+ declare function forgotPassword(a: {
409
408
  username: string;
410
409
  clientId: string;
411
410
  clientSecret: string;
412
- }) => ResultAsync<_$_aws_sdk_client_cognito_identity_provider0.ForgotPasswordCommandOutput, type_error_cognito>;
411
+ }): ResultAsync<_$_aws_sdk_client_cognito_identity_provider0.ForgotPasswordCommandOutput, type_error_cognito>;
413
412
  /**
414
413
  * Signs a user in with ADMIN_USER_PASSWORD_AUTH.
415
414
  *
@@ -419,13 +418,23 @@ declare const forgotPassword: (a: {
419
418
  * @param a.clientSecret - Cognito app client secret.
420
419
  * @param a.userPoolId - Cognito user pool ID.
421
420
  */
422
- declare const login: (a: {
421
+ declare function login(a: {
423
422
  username: string;
424
423
  password: string;
425
424
  clientId: string;
426
425
  clientSecret: string;
427
426
  userPoolId: string;
428
- }) => ResultAsync<_$_aws_sdk_client_cognito_identity_provider0.AdminInitiateAuthCommandOutput, type_error_cognito>;
427
+ }): ResultAsync<_$_aws_sdk_client_cognito_identity_provider0.AdminInitiateAuthCommandOutput, type_error_cognito>;
428
+ /**
429
+ * Sends a GetTokensFromRefreshTokenCommand
430
+ */
431
+ declare function refreshTokens(a: {
432
+ RefreshToken: string;
433
+ ClientId: string;
434
+ ClientSecret: string;
435
+ DeviceKey?: string | undefined;
436
+ ClientMetaData?: Record<string, string> | undefined;
437
+ }): ResultAsync<_$_aws_sdk_client_cognito_identity_provider0.GetTokensFromRefreshTokenCommandOutput, type_error_cognito>;
429
438
  /**
430
439
  * Exchanges a refresh token for new tokens.
431
440
  *
@@ -435,19 +444,19 @@ declare const login: (a: {
435
444
  * @param a.clientSecret - Cognito app client secret.
436
445
  * @param a.userPoolId - Cognito user pool ID.
437
446
  */
438
- declare const refreshTokens: (a: {
447
+ declare function refreshTokensAuth(a: {
439
448
  username: string;
440
449
  refreshToken: string;
441
450
  clientId: string;
442
451
  clientSecret: string;
443
452
  userPoolId: string;
444
- }) => ResultAsync<_$_aws_sdk_client_cognito_identity_provider0.AdminInitiateAuthCommandOutput, type_error_cognito>;
453
+ }): ResultAsync<_$_aws_sdk_client_cognito_identity_provider0.AdminInitiateAuthCommandOutput, type_error_cognito>;
445
454
  /**
446
455
  * Globally signs out a user by invalidating all refresh tokens.
447
456
  *
448
457
  * @param accessToken - Access token for the authenticated user.
449
458
  */
450
- declare const logout: (accessToken: string) => ResultAsync<_$_aws_sdk_client_cognito_identity_provider0.GlobalSignOutCommandOutput, type_error_cognito>;
459
+ declare function logout(accessToken: string): ResultAsync<_$_aws_sdk_client_cognito_identity_provider0.GlobalSignOutCommandOutput, type_error_cognito>;
451
460
  /**
452
461
  * Completes a NEW_PASSWORD_REQUIRED challenge for users who must set a new password.
453
462
  *
@@ -457,13 +466,13 @@ declare const logout: (accessToken: string) => ResultAsync<_$_aws_sdk_client_cog
457
466
  * @param a.clientId - Cognito app client ID.
458
467
  * @param a.clientSecret - Cognito app client secret.
459
468
  */
460
- declare const resetPassword: (a: {
469
+ declare function resetPassword(a: {
461
470
  session: string;
462
471
  newPassword: string;
463
472
  username: string;
464
473
  clientId: string;
465
474
  clientSecret: string;
466
- }) => ResultAsync<_$_aws_sdk_client_cognito_identity_provider0.RespondToAuthChallengeCommandOutput, type_error_cognito>;
475
+ }): ResultAsync<_$_aws_sdk_client_cognito_identity_provider0.RespondToAuthChallengeCommandOutput, type_error_cognito>;
467
476
  /**
468
477
  * Registers a new user with Cognito and optional custom attributes.
469
478
  *
@@ -473,12 +482,12 @@ declare const resetPassword: (a: {
473
482
  * @param a.clientSecret - Cognito app client secret.
474
483
  * @param a.<attribute> - Any additional user attributes to set.
475
484
  */
476
- declare const signUp: (a: {
485
+ declare function signUp(a: {
477
486
  username: string;
478
487
  password: string;
479
488
  clientId: string;
480
489
  clientSecret: string;
481
- } & Record<string, unknown>) => ResultAsync<_$_aws_sdk_client_cognito_identity_provider0.SignUpCommandOutput, type_error_cognito>;
490
+ } & Record<string, unknown>): ResultAsync<_$_aws_sdk_client_cognito_identity_provider0.SignUpCommandOutput, type_error_cognito>;
482
491
  /**
483
492
  * Exchanges an OAuth2 authorization code for Cognito tokens using the token endpoint.
484
493
  * See https://docs.aws.amazon.com/cognito/latest/developerguide/token-endpoint.html for request/response fields and grant details.
@@ -490,13 +499,13 @@ declare const signUp: (a: {
490
499
  * @param a.cognitoDomain - Cognito domain URL (e.g., your-domain.auth.region.amazoncognito.com).
491
500
  * @returns Parsed token payload containing `access_token`, `id_token`, `refresh_token`, token type, and expiry.
492
501
  */
493
- declare const verifyOAuthToken: (a: {
502
+ declare function verifyOAuthToken(a: {
494
503
  code: string;
495
504
  redirectUri: string;
496
505
  clientId: string;
497
506
  clientSecret: string;
498
507
  cognitoDomain: string;
499
- }) => ResultAsync<{
508
+ }): ResultAsync<{
500
509
  access_token: string;
501
510
  id_token: string;
502
511
  refresh_token: string;
@@ -513,12 +522,12 @@ declare const verifyOAuthToken: (a: {
513
522
  * @param a.cognitoDomain - Cognito domain URL (e.g., your-domain.auth.region.amazoncognito.com).
514
523
  * @returns Parsed token payload containing `access_token`, `id_token`, `refresh_token`, token type, and expiry.
515
524
  */
516
- declare const refreshOAuthToken: (a: {
525
+ declare function refreshOAuthToken(a: {
517
526
  clientId: string;
518
527
  clientSecret: string;
519
528
  cognitoDomain: string;
520
529
  refreshToken: string;
521
- }) => ResultAsync<{
530
+ }): ResultAsync<{
522
531
  access_token: string;
523
532
  id_token: string;
524
533
  refresh_token: string | undefined;
@@ -554,7 +563,7 @@ declare function error_lambda_fromS3(e: type_error_s3, options?: type_error_lamb
554
563
  declare function is_s3_notFound(error: unknown): boolean;
555
564
  //#endregion
556
565
  //#region src/s3/signedUrl.d.ts
557
- declare const getSignedUrl: <InputTypesUnion extends object, InputType extends InputTypesUnion, OutputType extends _$_smithy_types0.MetadataBearer = _$_smithy_types0.MetadataBearer>(client: _$_aws_sdk_client_cognito_identity_provider0.__Client<any, InputTypesUnion, _$_smithy_types0.MetadataBearer, any>, command: _$_aws_sdk_client_cognito_identity_provider0.$Command<InputType, OutputType, any, InputTypesUnion, _$_smithy_types0.MetadataBearer>, options?: _$_smithy_types0.RequestPresigningArguments | undefined) => ResultAsync<string, void>;
566
+ declare function getSignedUrl(...args: Parameters<typeof getSignedUrl$1>): ResultAsync<string, type_error_s3>;
558
567
  //#endregion
559
568
  //#region src/s3/object.d.ts
560
569
  /**
@@ -564,7 +573,7 @@ declare const getSignedUrl: <InputTypesUnion extends object, InputType extends I
564
573
  * @param {string} key - The key of the object to retrieve.
565
574
  * @returns {Promise<Buffer>} A promise that resolves to the object data as a Buffer.
566
575
  */
567
- declare const getObject: (bucketName: string, key: string) => ResultAsync<Buffer<ArrayBufferLike>, type_error_s3>;
576
+ declare function getObject(bucketName: string, key: string): ResultAsync<Buffer<ArrayBufferLike>, type_error_s3>;
568
577
  /**
569
578
  * Convenience function to get an object from S3 and return it as a string.
570
579
  */
@@ -576,7 +585,7 @@ declare function getObjectString(bucketName: string, key: string): ResultAsync<s
576
585
  * @param {string} key - The key of the object to retrieve.
577
586
  * @returns {Promise<Buffer>} A promise that resolves to a boolean.
578
587
  */
579
- declare const objectExists: (bucketName: string, key: string) => ResultAsync<boolean, type_error_s3>;
588
+ declare function objectExists(bucketName: string, key: string): ResultAsync<boolean, type_error_s3>;
580
589
  //#endregion
581
590
  //#region src/dynamo/errors.d.ts
582
591
  /** Error wrapper for failures that happen while doing DynamoDB or DynamoDB Toolbox work. */
@@ -1067,5 +1076,5 @@ declare function getErrorName(error: unknown): string | undefined;
1067
1076
  //#region src/types/safe.d.ts
1068
1077
  type SafeOmit<T, K extends keyof any> = T extends any ? Omit<T, K> : never;
1069
1078
  //#endregion
1070
- export { APIGatewayHandler, ApiEndpoints, ApiErrorBody, ApiInput, ApiOutput, ApiRequestFunction, ApiResponse, ApiSchema, ApiSuccessBody, CleanResponse, DeepOverride, DeepPartial, DeepReadonly, DeepRequired, ErrorBody, ErrorCode, ErrorRawProxyResultV2, FetchResponse, GetSchemaByPathOptions, HTTPMethod, HTTPMethods, LambdaErrorResponse, OkRawProxyResultV2, RawApiGatewayHandler, RawProxyResultV2, SafeOmit, SuccessCode, Toc, TocEntry, changePassword, colorText, computeSecretHash, confirmForgotPassword, confirmSignup, createApiRequest, deepDiff, error_cognito, error_dynamo, error_lambda_badRequest, error_lambda_conflict, error_lambda_forbidden, error_lambda_fromCognito, error_lambda_fromDynamo, error_lambda_fromS3, error_lambda_fromSes, error_lambda_internal, error_lambda_notFound, error_lambda_unauthorized, error_s3, error_ses, exists, extractAttributes, extractToc, forgotPassword, getByPath, getCognitoClient, getCookies, getErrorName, getObject, getObjectString, getS3, getSchemaByPath, getSignedUrl, getUserDetails, getUserGroups, isRecord, isSchema, is_s3_notFound, login, logout, objectExists, parseRaw, pruneToShape, readPackageJson, refreshOAuthToken, refreshTokens, resetPassword, response_error, response_ok, response_valibotError, setByPath, signUp, type_error_cognito, type_error_dynamo, type_error_lambda, type_error_lambda_badRequest, type_error_lambda_conflict, type_error_lambda_forbidden, type_error_lambda_fromCognito_options, type_error_lambda_fromCognito_reason, type_error_lambda_fromDynamo_options, type_error_lambda_fromDynamo_reason, type_error_lambda_fromS3_options, type_error_lambda_fromS3_reason, type_error_lambda_fromSes_options, type_error_lambda_fromSes_reason, type_error_lambda_internal, type_error_lambda_notFound, type_error_lambda_unauthorized, type_error_response, type_error_s3, type_error_ses, type_userResponse, unwrap, verifyOAuthToken, wrapHandler, writeIfDifferent };
1079
+ export { APIGatewayHandler, ApiEndpoints, ApiErrorBody, ApiInput, ApiOutput, ApiRequestFunction, ApiResponse, ApiSchema, ApiSuccessBody, CleanResponse, DeepOverride, DeepPartial, DeepReadonly, DeepRequired, ErrorBody, ErrorCode, ErrorRawProxyResultV2, FetchResponse, GetSchemaByPathOptions, HTTPMethod, HTTPMethods, LambdaErrorResponse, OkRawProxyResultV2, RawApiGatewayHandler, RawProxyResultV2, SafeOmit, SuccessCode, Toc, TocEntry, changePassword, colorText, computeSecretHash, confirmForgotPassword, confirmSignup, createApiRequest, deepDiff, error_cognito, error_dynamo, error_lambda_badRequest, error_lambda_conflict, error_lambda_forbidden, error_lambda_fromCognito, error_lambda_fromDynamo, error_lambda_fromS3, error_lambda_fromSes, error_lambda_internal, error_lambda_notFound, error_lambda_unauthorized, error_s3, error_ses, exists, extractAttributes, extractToc, forgotPassword, getByPath, getCognitoClient, getCookies, getErrorName, getObject, getObjectString, getS3, getSchemaByPath, getSignedUrl, getUserDetails, getUserGroups, isRecord, isSchema, is_s3_notFound, login, logout, objectExists, parseRaw, pruneToShape, readPackageJson, refreshOAuthToken, refreshTokens, refreshTokensAuth, resetPassword, response_error, response_ok, response_valibotError, setByPath, signUp, type_error_cognito, type_error_dynamo, type_error_lambda, type_error_lambda_badRequest, type_error_lambda_conflict, type_error_lambda_forbidden, type_error_lambda_fromCognito_options, type_error_lambda_fromCognito_reason, type_error_lambda_fromDynamo_options, type_error_lambda_fromDynamo_reason, type_error_lambda_fromS3_options, type_error_lambda_fromS3_reason, type_error_lambda_fromSes_options, type_error_lambda_fromSes_reason, type_error_lambda_internal, type_error_lambda_notFound, type_error_lambda_unauthorized, type_error_response, type_error_s3, type_error_ses, type_userResponse, unwrap, verifyOAuthToken, wrapHandler, writeIfDifferent };
1071
1080
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":["Data","Point","line","column","offset","Position","start","end","Literal","Node","value","type","data","position","Parent","children","Data","UnistData","Literal","UnistLiteral","Node","UnistNode","Parent","UnistParent","Properties","Array","PropertyName","ElementContent","ElementContentMap","Comment","Element","Text","comment","element","text","RootContent","RootContentMap","Doctype","doctype","Content","Literals","Nodes","Extract","Root","Parents","data","value","children","CommentData","type","DoctypeData","ElementData","tagName","properties","content","RootData","TextData"],"sources":["../src/lambda/handlerUtils.ts","../src/lambda/client-types.ts","../src/lambda/client.ts","../src/lambda/errors.ts","../src/lambda/response.ts","../src/lambda/server/authentication.ts","../src/cognito/client.ts","../src/cognito/errors.ts","../src/cognito/user.ts","../src/cognito/password.ts","../src/s3/client.ts","../src/s3/errors.ts","../src/s3/signedUrl.ts","../src/s3/object.ts","../src/dynamo/errors.ts","../src/ses/errors.ts","../node_modules/.pnpm/@types+unist@3.0.3/node_modules/@types/unist/index.d.ts","../node_modules/.pnpm/@types+hast@3.0.4/node_modules/@types/hast/index.d.ts","../src/rehype/flat-toc.ts","../src/utils/valibot.ts","../src/types/deep.ts","../src/utils/object.ts","../src/utils/fs.ts","../src/utils/cli.ts","../src/utils/errors.ts","../src/types/safe.ts"],"x_google_ignoreList":[16,17],"mappings":";;;;;;;;;;;;;;;KAGY,WAAA;AAAA,KACA,SAAA;AAAA,KAEA,SAAA;EAAc,OAAA;EAAiB,KAAA;IAAU,IAAA;IAAc,K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;;iBA4BrD,eAAA,CAAgB,QAAA,WAAmB,OAAA,CAAQ,WAAA;;;cChDpD,SAAA,GAAS,MAAA,EAAY,UAAA,QAAkB,SAAA,MAAa,IAAA;;;iBCFjD,QAAA,CAAS,KAAA,YAAiB,KAAA,IAAS,MAAA;AAAA,iBAGnC,YAAA,CAAa,KAAA;;;KCHjB,QAAA,2BAAmC,CAAA,eAAgB,IAAA,CAAK,CAAA,EAAG,CAAA"}
1
+ {"version":3,"file":"index.d.mts","names":["Data","Point","line","column","offset","Position","start","end","Literal","Node","value","type","data","position","Parent","children","Data","UnistData","Literal","UnistLiteral","Node","UnistNode","Parent","UnistParent","Properties","Array","PropertyName","ElementContent","ElementContentMap","Comment","Element","Text","comment","element","text","RootContent","RootContentMap","Doctype","doctype","Content","Literals","Nodes","Extract","Root","Parents","data","value","children","CommentData","type","DoctypeData","ElementData","tagName","properties","content","RootData","TextData"],"sources":["../src/lambda/handlerUtils.ts","../src/lambda/client-types.ts","../src/lambda/client.ts","../src/lambda/errors.ts","../src/lambda/response.ts","../src/lambda/server/authentication.ts","../src/cognito/client.ts","../src/cognito/errors.ts","../src/cognito/user.ts","../src/cognito/password.ts","../src/s3/client.ts","../src/s3/errors.ts","../src/s3/signedUrl.ts","../src/s3/object.ts","../src/dynamo/errors.ts","../src/ses/errors.ts","../node_modules/.pnpm/@types+unist@3.0.3/node_modules/@types/unist/index.d.ts","../node_modules/.pnpm/@types+hast@3.0.4/node_modules/@types/hast/index.d.ts","../src/rehype/flat-toc.ts","../src/utils/valibot.ts","../src/types/deep.ts","../src/utils/object.ts","../src/utils/fs.ts","../src/utils/cli.ts","../src/utils/errors.ts","../src/types/safe.ts"],"x_google_ignoreList":[16,17],"mappings":";;;;;;;;;;;;;;KAGY,WAAA;AAAA,KACA,SAAA;AAAA,KAEA,SAAA;EAAc,OAAA;EAAiB,KAAA;IAAU,IAAA;IAAc,KAAA;EAAA;AAAA;;;;KAKvD,qBAAA;EACV,UAAA,EAAY,SAAA;EAC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