@neon/sdk 1.4.1 → 2.0.0
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/README.md +257 -30
- package/dist/client/client/client.gen.js +1 -3
- package/dist/client/client/client.gen.js.map +1 -1
- package/dist/client/client/utils.gen.js +1 -3
- package/dist/client/client/utils.gen.js.map +1 -1
- package/dist/client/index.d.ts +3 -3
- package/dist/client/index.js +2 -2
- package/dist/client/raw.gen.d.ts +146 -16
- package/dist/client/raw.gen.d.ts.map +1 -1
- package/dist/client/raw.gen.js +8 -3
- package/dist/client/raw.gen.js.map +1 -1
- package/dist/client/sdk.gen.d.ts +137 -78
- package/dist/client/sdk.gen.d.ts.map +1 -1
- package/dist/client/sdk.gen.js +258 -96
- package/dist/client/sdk.gen.js.map +1 -1
- package/dist/client/types.gen.d.ts +1397 -315
- package/dist/client/types.gen.d.ts.map +1 -1
- package/dist/index.d.ts +6 -5
- package/dist/index.js +2 -2
- package/dist/neon/client.d.ts +2 -0
- package/dist/neon/client.d.ts.map +1 -1
- package/dist/neon/client.js +2 -0
- package/dist/neon/client.js.map +1 -1
- package/dist/neon/config.d.ts +13 -0
- package/dist/neon/config.d.ts.map +1 -1
- package/dist/neon/config.js +2 -0
- package/dist/neon/config.js.map +1 -1
- package/dist/neon/context.d.ts +26 -6
- package/dist/neon/context.d.ts.map +1 -1
- package/dist/neon/context.js +60 -10
- package/dist/neon/context.js.map +1 -1
- package/dist/neon/coverage.d.ts.map +1 -1
- package/dist/neon/coverage.js +12 -2
- package/dist/neon/coverage.js.map +1 -1
- package/dist/neon/deadline.d.ts +81 -0
- package/dist/neon/deadline.d.ts.map +1 -0
- package/dist/neon/deadline.js +143 -0
- package/dist/neon/deadline.js.map +1 -0
- package/dist/neon/errors.d.ts +22 -3
- package/dist/neon/errors.d.ts.map +1 -1
- package/dist/neon/errors.js +22 -2
- package/dist/neon/errors.js.map +1 -1
- package/dist/neon/paginate.d.ts +6 -1
- package/dist/neon/paginate.d.ts.map +1 -1
- package/dist/neon/paginate.js +63 -25
- package/dist/neon/paginate.js.map +1 -1
- package/dist/neon/raw-wrap.d.ts.map +1 -1
- package/dist/neon/raw-wrap.js +17 -2
- package/dist/neon/raw-wrap.js.map +1 -1
- package/dist/neon/resources/account.d.ts.map +1 -1
- package/dist/neon/resources/account.js +18 -12
- package/dist/neon/resources/account.js.map +1 -1
- package/dist/neon/resources/ai-gateway.js +3 -2
- package/dist/neon/resources/ai-gateway.js.map +1 -1
- package/dist/neon/resources/auth.d.ts.map +1 -1
- package/dist/neon/resources/auth.js +42 -28
- package/dist/neon/resources/auth.js.map +1 -1
- package/dist/neon/resources/branches.d.ts +1 -8
- package/dist/neon/resources/branches.d.ts.map +1 -1
- package/dist/neon/resources/branches.js +32 -32
- package/dist/neon/resources/branches.js.map +1 -1
- package/dist/neon/resources/bucket-objects.d.ts.map +1 -1
- package/dist/neon/resources/bucket-objects.js +15 -10
- package/dist/neon/resources/bucket-objects.js.map +1 -1
- package/dist/neon/resources/buckets.d.ts.map +1 -1
- package/dist/neon/resources/buckets.js +9 -6
- package/dist/neon/resources/buckets.js.map +1 -1
- package/dist/neon/resources/consumption.d.ts +4 -4
- package/dist/neon/resources/consumption.d.ts.map +1 -1
- package/dist/neon/resources/consumption.js +6 -6
- package/dist/neon/resources/consumption.js.map +1 -1
- package/dist/neon/resources/credentials.d.ts.map +1 -1
- package/dist/neon/resources/credentials.js +9 -6
- package/dist/neon/resources/credentials.js.map +1 -1
- package/dist/neon/resources/dataapi.d.ts.map +1 -1
- package/dist/neon/resources/dataapi.js +12 -8
- package/dist/neon/resources/dataapi.js.map +1 -1
- package/dist/neon/resources/databases.d.ts.map +1 -1
- package/dist/neon/resources/databases.js +15 -10
- package/dist/neon/resources/databases.js.map +1 -1
- package/dist/neon/resources/endpoints.d.ts.map +1 -1
- package/dist/neon/resources/endpoints.js +27 -18
- package/dist/neon/resources/endpoints.js.map +1 -1
- package/dist/neon/resources/functions.d.ts +1 -1
- package/dist/neon/resources/functions.d.ts.map +1 -1
- package/dist/neon/resources/functions.js +14 -10
- package/dist/neon/resources/functions.js.map +1 -1
- package/dist/neon/resources/logs.d.ts +76 -0
- package/dist/neon/resources/logs.d.ts.map +1 -0
- package/dist/neon/resources/logs.js +90 -0
- package/dist/neon/resources/logs.js.map +1 -0
- package/dist/neon/resources/operations.d.ts +12 -3
- package/dist/neon/resources/operations.d.ts.map +1 -1
- package/dist/neon/resources/operations.js +5 -4
- package/dist/neon/resources/operations.js.map +1 -1
- package/dist/neon/resources/postgres.d.ts.map +1 -1
- package/dist/neon/resources/postgres.js +10 -1
- package/dist/neon/resources/postgres.js.map +1 -1
- package/dist/neon/resources/projects.d.ts +62 -5
- package/dist/neon/resources/projects.d.ts.map +1 -1
- package/dist/neon/resources/projects.js +106 -29
- package/dist/neon/resources/projects.js.map +1 -1
- package/dist/neon/resources/roles.d.ts.map +1 -1
- package/dist/neon/resources/roles.js +18 -12
- package/dist/neon/resources/roles.js.map +1 -1
- package/dist/neon/resources/snapshots.d.ts +10 -1
- package/dist/neon/resources/snapshots.d.ts.map +1 -1
- package/dist/neon/resources/snapshots.js +37 -19
- package/dist/neon/resources/snapshots.js.map +1 -1
- package/dist/neon/resources/storage.js +3 -2
- package/dist/neon/resources/storage.js.map +1 -1
- package/dist/neon/retry.d.ts +30 -8
- package/dist/neon/retry.d.ts.map +1 -1
- package/dist/neon/retry.js +59 -20
- package/dist/neon/retry.js.map +1 -1
- package/dist/neon/wait.d.ts +7 -1
- package/dist/neon/wait.d.ts.map +1 -1
- package/dist/neon/wait.js +53 -34
- package/dist/neon/wait.js.map +1 -1
- package/dist/raw.d.ts +3 -3
- package/dist/raw.js +8 -3
- package/package.json +2 -1
package/dist/neon/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","names":[],"sources":["../../src/neon/errors.ts"],"sourcesContent":["/**\n * Typed error hierarchy surfaced on the `error` channel of every ergonomic call (and\n * thrown when `throwOnError` is set). All are `Error` subclasses with a `kind`\n * discriminant, so the same value works whether you read it from `{ error }` or `catch`\n * it.\n */\n\n/** Used when a transport failure carries neither an `errno` code nor any message. */\nconst UNKNOWN_TRANSPORT_REASON = \"cause unavailable\";\n\nexport type NeonErrorKind =\n\t| \"api\"\n\t| \"not_found\"\n\t| \"auth\"\n\t| \"rate_limit\"\n\t| \"operation\"\n\t| \"timeout\"\n\t| \"network\"\n\t| \"client\";\n\n/**\n * Base class for every error the ergonomic layer produces.\n *\n * Every subclass assigns `this.name` as a string literal rather than reading it from the\n * constructor. Bundlers rename classes, so deriving the name at runtime leaves consumers\n * of a minified build with errors called `s` and `r` — unreadable in logs and impossible\n * to group on in an error tracker.\n */\nexport class NeonError extends Error {\n\treadonly kind: NeonErrorKind;\n\n\tconstructor(\n\t\tmessage: string,\n\t\tkind: NeonErrorKind,\n\t\toptions?: { cause?: unknown },\n\t) {\n\t\tsuper(message, options);\n\t\tthis.name = \"NeonError\";\n\t\tthis.kind = kind;\n\t}\n}\n\n/** A non-2xx HTTP response from the Neon API. */\nexport class NeonApiError extends NeonError {\n\t/** HTTP status code. */\n\treadonly status: number;\n\t/** Machine-readable Neon error code (`GeneralError.code`), when present. */\n\treadonly code?: string;\n\t/** Neon request id (`X-Request-Id` / `GeneralError.request_id`), when present. */\n\treadonly requestId?: string;\n\t/** The raw response, when one was received. */\n\treadonly response?: Response;\n\t/** The parsed error body, as returned by the API. */\n\treadonly body: unknown;\n\n\tconstructor(\n\t\tmessage: string,\n\t\tinit: {\n\t\t\tkind?: NeonErrorKind;\n\t\t\tstatus: number;\n\t\t\tcode?: string;\n\t\t\trequestId?: string;\n\t\t\tresponse?: Response;\n\t\t\tbody?: unknown;\n\t\t},\n\t) {\n\t\tsuper(message, init.kind ?? \"api\");\n\t\tthis.name = \"NeonApiError\";\n\t\tthis.status = init.status;\n\t\tthis.code = init.code;\n\t\tthis.requestId = init.requestId;\n\t\tthis.response = init.response;\n\t\tthis.body = init.body;\n\t}\n}\n\n/** 404 — the resource does not exist. */\nexport class NeonNotFoundError extends NeonApiError {\n\tconstructor(\n\t\tmessage: string,\n\t\tinit: ConstructorParameters<typeof NeonApiError>[1],\n\t) {\n\t\tsuper(message, { ...init, kind: \"not_found\" });\n\t\tthis.name = \"NeonNotFoundError\";\n\t}\n}\n\n/** 401/403 — the API key is missing, invalid, or lacks permission. */\nexport class NeonAuthError extends NeonApiError {\n\tconstructor(\n\t\tmessage: string,\n\t\tinit: ConstructorParameters<typeof NeonApiError>[1],\n\t) {\n\t\tsuper(message, { ...init, kind: \"auth\" });\n\t\tthis.name = \"NeonAuthError\";\n\t}\n}\n\n/** 429 — rate limited (after retries, if enabled, were exhausted). */\nexport class NeonRateLimitError extends NeonApiError {\n\tconstructor(\n\t\tmessage: string,\n\t\tinit: ConstructorParameters<typeof NeonApiError>[1],\n\t) {\n\t\tsuper(message, { ...init, kind: \"rate_limit\" });\n\t\tthis.name = \"NeonRateLimitError\";\n\t}\n}\n\n/** An awaited Neon operation ended in a non-success terminal state. */\nexport class NeonOperationError extends NeonError {\n\t/** The id of the operation that failed. */\n\treadonly operationId: string;\n\t/** The terminal status reported by the API (`failed` / `error` / `cancelled`). */\n\treadonly status: string;\n\n\tconstructor(\n\t\tmessage: string,\n\t\tinit: { operationId: string; status: string },\n\t) {\n\t\tsuper(message, \"operation\");\n\t\tthis.name = \"NeonOperationError\";\n\t\tthis.operationId = init.operationId;\n\t\tthis.status = init.status;\n\t}\n}\n\n/** Waiting for operations to finish exceeded the configured timeout. */\nexport class NeonTimeoutError extends NeonError {\n\tconstructor(message: string) {\n\t\tsuper(message, \"timeout\");\n\t\tthis.name = \"NeonTimeoutError\";\n\t}\n}\n\n/** A transport-level failure (DNS, connection, abort) — no HTTP response received. */\nexport class NeonNetworkError extends NeonError {\n\t/**\n\t * The most specific reason the platform gave for the failure — an `errno` code such as\n\t * `ECONNRESET` when one is available, otherwise the innermost non-empty message. Read\n\t * this instead of matching on {@link message}.\n\t */\n\treadonly reason: string;\n\n\tconstructor(\n\t\tmessage: string,\n\t\toptions?: { cause?: unknown; reason?: string },\n\t) {\n\t\tsuper(message, \"network\", { cause: options?.cause });\n\t\tthis.name = \"NeonNetworkError\";\n\t\tthis.reason = options?.reason ?? UNKNOWN_TRANSPORT_REASON;\n\t}\n}\n\ninterface ApiErrorBody {\n\tmessage?: string;\n\tcode?: string;\n\trequest_id?: string;\n}\n\nfunction readApiErrorBody(body: unknown): ApiErrorBody {\n\tif (typeof body !== \"object\" || body === null) return {};\n\tconst out: ApiErrorBody = {};\n\tif (\"message\" in body && typeof body.message === \"string\")\n\t\tout.message = body.message;\n\tif (\"code\" in body && typeof body.code === \"string\") out.code = body.code;\n\tif (\"request_id\" in body && typeof body.request_id === \"string\") {\n\t\tout.request_id = body.request_id;\n\t}\n\treturn out;\n}\n\n/**\n * Walk a transport failure's `cause` chain for the most specific description available.\n *\n * `fetch` reports every transport fault as `TypeError: fetch failed` and puts the real\n * reason underneath, sometimes several levels down and sometimes with an empty message and\n * only an `errno` code. Without this, a DNS failure, a reset connection and a redirect the\n * client refused to follow all produce the same sentence.\n */\nexport function describeTransportFailure(error: unknown): string {\n\tconst seen = new Set<unknown>();\n\tlet current: unknown = error;\n\tlet deepestMessage: string | undefined;\n\n\twhile (current instanceof Error && !seen.has(current)) {\n\t\tseen.add(current);\n\t\tif (\"code\" in current && typeof current.code === \"string\") {\n\t\t\treturn current.code;\n\t\t}\n\t\tif (current.message) deepestMessage = current.message;\n\t\tcurrent = current.cause;\n\t}\n\n\treturn deepestMessage ?? UNKNOWN_TRANSPORT_REASON;\n}\n\n/**\n * Build the right {@link NeonError} subclass from a raw client result. `error` is the\n * decoded error body (Neon `GeneralError`); `response` is present unless the failure was\n * transport-level.\n */\nexport function toNeonError(\n\terror: unknown,\n\tresponse: Response | undefined,\n): NeonError {\n\tif (!response) {\n\t\tconst reason = describeTransportFailure(error);\n\t\treturn new NeonNetworkError(\n\t\t\t`Network error: no response received from the Neon API (${reason}).`,\n\t\t\t{ cause: error, reason },\n\t\t);\n\t}\n\n\tconst parsed = readApiErrorBody(error);\n\tconst status = response.status;\n\tconst message =\n\t\tparsed.message ?? `Neon API request failed with status ${status}.`;\n\tconst init = {\n\t\tstatus,\n\t\tcode: parsed.code,\n\t\trequestId:\n\t\t\tparsed.request_id ??\n\t\t\tresponse.headers.get(\"x-request-id\") ??\n\t\t\tundefined,\n\t\tresponse,\n\t\tbody: error,\n\t};\n\n\tif (status === 404) return new NeonNotFoundError(message, init);\n\tif (status === 401 || status === 403)\n\t\treturn new NeonAuthError(message, init);\n\tif (status === 429) return new NeonRateLimitError(message, init);\n\treturn new NeonApiError(message, init);\n}\n"],"mappings":";;;;;;;;AAQA,MAAM,2BAA2B;;;;;;;;;AAoBjC,IAAa,YAAb,cAA+B,MAAM;CACpC;CAEA,YACC,SACA,MACA,SACC;EACD,MAAM,SAAS,OAAO;EACtB,KAAK,OAAO;EACZ,KAAK,OAAO;CACb;AACD;;AAGA,IAAa,eAAb,cAAkC,UAAU;;CAE3C;;CAEA;;CAEA;;CAEA;;CAEA;CAEA,YACC,SACA,MAQC;EACD,MAAM,SAAS,KAAK,QAAQ,KAAK;EACjC,KAAK,OAAO;EACZ,KAAK,SAAS,KAAK;EACnB,KAAK,OAAO,KAAK;EACjB,KAAK,YAAY,KAAK;EACtB,KAAK,WAAW,KAAK;EACrB,KAAK,OAAO,KAAK;CAClB;AACD;;AAGA,IAAa,oBAAb,cAAuC,aAAa;CACnD,YACC,SACA,MACC;EACD,MAAM,SAAS;GAAE,GAAG;GAAM,MAAM;EAAY,CAAC;EAC7C,KAAK,OAAO;CACb;AACD;;AAGA,IAAa,gBAAb,cAAmC,aAAa;CAC/C,YACC,SACA,MACC;EACD,MAAM,SAAS;GAAE,GAAG;GAAM,MAAM;EAAO,CAAC;EACxC,KAAK,OAAO;CACb;AACD;;AAGA,IAAa,qBAAb,cAAwC,aAAa;CACpD,YACC,SACA,MACC;EACD,MAAM,SAAS;GAAE,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AI,CAAC,UAAU;EACd,MAAM,SAAS,yBAAyB,KAAK;EAC7C,OAAO,IAAI,iBACV,0DAA0D,OAAO,KACjE;GAAE,OAAO;GAAO;EAAO,CACxB;CACD;CAEA,MAAM,SAAS,iBAAiB,KAAK;CACrC,MAAM,SAAS,SAAS;CACxB,MAAM,UACL,OAAO,WAAW,uCAAuC,OAAO;CACjE,MAAM,OAAO;EACZ;EACA,MAAM,OAAO;EACb,WACC,OAAO,cACP,SAAS,QAAQ,IAAI,cAAc,KACnC,KAAA;EACD;EACA,MAAM;CACP;CAEA,IAAI,WAAW,KAAK,OAAO,IAAI,kBAAkB,SAAS,IAAI;CAC9D,IAAI,WAAW,OAAO,WAAW,KAChC,OAAO,IAAI,cAAc,SAAS,IAAI;CACvC,IAAI,WAAW,KAAK,OAAO,IAAI,mBAAmB,SAAS,IAAI;CAC/D,OAAO,IAAI,aAAa,SAAS,IAAI;AACtC"}
|
|
1
|
+
{"version":3,"file":"errors.js","names":[],"sources":["../../src/neon/errors.ts"],"sourcesContent":["/**\n * Typed error hierarchy surfaced on the `error` channel of every ergonomic call (and\n * thrown when `throwOnError` is set). All are `Error` subclasses with a `kind`\n * discriminant, so the same value works whether you read it from `{ error }` or `catch`\n * it.\n */\n\n/** Used when a transport failure carries neither an `errno` code nor any message. */\nconst UNKNOWN_TRANSPORT_REASON = \"cause unavailable\";\n\nexport type NeonErrorKind =\n\t| \"api\"\n\t| \"not_found\"\n\t| \"auth\"\n\t| \"rate_limit\"\n\t| \"operation\"\n\t| \"timeout\"\n\t| \"aborted\"\n\t| \"network\"\n\t| \"client\";\n\n/**\n * Base class for every error the ergonomic layer produces.\n *\n * Every subclass assigns `this.name` as a string literal rather than reading it from the\n * constructor. Bundlers rename classes, so deriving the name at runtime leaves consumers\n * of a minified build with errors called `s` and `r` — unreadable in logs and impossible\n * to group on in an error tracker.\n */\nexport class NeonError extends Error {\n\treadonly kind: NeonErrorKind;\n\n\tconstructor(\n\t\tmessage: string,\n\t\tkind: NeonErrorKind,\n\t\toptions?: { cause?: unknown },\n\t) {\n\t\tsuper(message, options);\n\t\tthis.name = \"NeonError\";\n\t\tthis.kind = kind;\n\t}\n}\n\n/** A non-2xx HTTP response from the Neon API. */\nexport class NeonApiError extends NeonError {\n\t/** HTTP status code. */\n\treadonly status: number;\n\t/** Machine-readable Neon error code (`GeneralError.code`), when present. */\n\treadonly code?: string;\n\t/** Neon request id (`X-Request-Id` / `GeneralError.request_id`), when present. */\n\treadonly requestId?: string;\n\t/** The raw response, when one was received. */\n\treadonly response?: Response;\n\t/** The parsed error body, as returned by the API. */\n\treadonly body: unknown;\n\n\tconstructor(\n\t\tmessage: string,\n\t\tinit: {\n\t\t\tkind?: NeonErrorKind;\n\t\t\tstatus: number;\n\t\t\tcode?: string;\n\t\t\trequestId?: string;\n\t\t\tresponse?: Response;\n\t\t\tbody?: unknown;\n\t\t},\n\t) {\n\t\tsuper(message, init.kind ?? \"api\");\n\t\tthis.name = \"NeonApiError\";\n\t\tthis.status = init.status;\n\t\tthis.code = init.code;\n\t\tthis.requestId = init.requestId;\n\t\tthis.response = init.response;\n\t\tthis.body = init.body;\n\t}\n}\n\n/** 404 — the resource does not exist. */\nexport class NeonNotFoundError extends NeonApiError {\n\tconstructor(\n\t\tmessage: string,\n\t\tinit: ConstructorParameters<typeof NeonApiError>[1],\n\t) {\n\t\tsuper(message, { ...init, kind: \"not_found\" });\n\t\tthis.name = \"NeonNotFoundError\";\n\t}\n}\n\n/** 401/403 — the API key is missing, invalid, or lacks permission. */\nexport class NeonAuthError extends NeonApiError {\n\tconstructor(\n\t\tmessage: string,\n\t\tinit: ConstructorParameters<typeof NeonApiError>[1],\n\t) {\n\t\tsuper(message, { ...init, kind: \"auth\" });\n\t\tthis.name = \"NeonAuthError\";\n\t}\n}\n\n/** 429 — rate limited (after retries, if enabled, were exhausted). */\nexport class NeonRateLimitError extends NeonApiError {\n\tconstructor(\n\t\tmessage: string,\n\t\tinit: ConstructorParameters<typeof NeonApiError>[1],\n\t) {\n\t\tsuper(message, { ...init, kind: \"rate_limit\" });\n\t\tthis.name = \"NeonRateLimitError\";\n\t}\n}\n\n/** An awaited Neon operation ended in a non-success terminal state. */\nexport class NeonOperationError extends NeonError {\n\t/** The id of the operation that failed. */\n\treadonly operationId: string;\n\t/** The terminal status reported by the API (`failed` / `error` / `cancelled`). */\n\treadonly status: string;\n\n\tconstructor(\n\t\tmessage: string,\n\t\tinit: { operationId: string; status: string },\n\t) {\n\t\tsuper(message, \"operation\");\n\t\tthis.name = \"NeonOperationError\";\n\t\tthis.operationId = init.operationId;\n\t\tthis.status = init.status;\n\t}\n}\n\n/**\n * A deadline was exceeded — either `requestTimeoutMs` for a request and its retries, or\n * the `wait` budget while polling operations for readiness.\n */\nexport class NeonTimeoutError extends NeonError {\n\tconstructor(message: string) {\n\t\tsuper(message, \"timeout\");\n\t\tthis.name = \"NeonTimeoutError\";\n\t}\n}\n\n/**\n * The caller's `AbortSignal` fired. Distinct from {@link NeonTimeoutError} because nothing\n * went wrong: the caller asked for the work to stop, and the two call for different\n * handling (retry a timeout, don't retry a cancellation).\n *\n * Raised only where the SDK knows the caller cancelled — the call's own deadline, or an\n * already-aborted `signal` on a raw call. A transport failure that merely looks like an\n * abort stays a {@link NeonNetworkError}, since the generated client reports auth,\n * serialization, interceptor and parsing faults through the same channel and an error's\n * name is not evidence about which one occurred.\n */\nexport class NeonAbortError extends NeonError {\n\tconstructor(message: string, options?: { cause?: unknown }) {\n\t\tsuper(message, \"aborted\", options);\n\t\tthis.name = \"NeonAbortError\";\n\t}\n}\n\n/** A transport-level failure (DNS, connection, abort) — no HTTP response received. */\nexport class NeonNetworkError extends NeonError {\n\t/**\n\t * The most specific reason the platform gave for the failure — an `errno` code such as\n\t * `ECONNRESET` when one is available, otherwise the innermost non-empty message. Read\n\t * this instead of matching on {@link message}.\n\t */\n\treadonly reason: string;\n\n\tconstructor(\n\t\tmessage: string,\n\t\toptions?: { cause?: unknown; reason?: string },\n\t) {\n\t\tsuper(message, \"network\", { cause: options?.cause });\n\t\tthis.name = \"NeonNetworkError\";\n\t\tthis.reason = options?.reason ?? UNKNOWN_TRANSPORT_REASON;\n\t}\n}\n\ninterface ApiErrorBody {\n\tmessage?: string;\n\tcode?: string;\n\trequest_id?: string;\n}\n\nfunction readApiErrorBody(body: unknown): ApiErrorBody {\n\tif (typeof body !== \"object\" || body === null) return {};\n\tconst out: ApiErrorBody = {};\n\tif (\"message\" in body && typeof body.message === \"string\")\n\t\tout.message = body.message;\n\tif (\"code\" in body && typeof body.code === \"string\") out.code = body.code;\n\tif (\"request_id\" in body && typeof body.request_id === \"string\") {\n\t\tout.request_id = body.request_id;\n\t}\n\treturn out;\n}\n\n/**\n * Walk a transport failure's `cause` chain for the most specific description available.\n *\n * `fetch` reports every transport fault as `TypeError: fetch failed` and puts the real\n * reason underneath, sometimes several levels down and sometimes with an empty message and\n * only an `errno` code. Without this, a DNS failure, a reset connection and a redirect the\n * client refused to follow all produce the same sentence.\n */\nexport function describeTransportFailure(error: unknown): string {\n\tconst seen = new Set<unknown>();\n\tlet current: unknown = error;\n\tlet deepestMessage: string | undefined;\n\n\twhile (current instanceof Error && !seen.has(current)) {\n\t\tseen.add(current);\n\t\tif (\"code\" in current && typeof current.code === \"string\") {\n\t\t\treturn current.code;\n\t\t}\n\t\tif (current.message) deepestMessage = current.message;\n\t\tcurrent = current.cause;\n\t}\n\n\treturn deepestMessage ?? UNKNOWN_TRANSPORT_REASON;\n}\n\n/**\n * Build the right {@link NeonError} subclass from a raw client result. `error` is the\n * decoded error body (Neon `GeneralError`); `response` is present unless the failure was\n * transport-level.\n */\nexport function toNeonError(\n\terror: unknown,\n\tresponse: Response | undefined,\n): NeonError {\n\tif (!response) {\n\t\tconst reason = describeTransportFailure(error);\n\t\treturn new NeonNetworkError(\n\t\t\t`Network error: no response received from the Neon API (${reason}).`,\n\t\t\t{ cause: error, reason },\n\t\t);\n\t}\n\n\tconst parsed = readApiErrorBody(error);\n\tconst status = response.status;\n\tconst message =\n\t\tparsed.message ?? `Neon API request failed with status ${status}.`;\n\tconst init = {\n\t\tstatus,\n\t\tcode: parsed.code,\n\t\trequestId:\n\t\t\tparsed.request_id ??\n\t\t\tresponse.headers.get(\"x-request-id\") ??\n\t\t\tundefined,\n\t\tresponse,\n\t\tbody: error,\n\t};\n\n\tif (status === 404) return new NeonNotFoundError(message, init);\n\tif (status === 401 || status === 403)\n\t\treturn new NeonAuthError(message, init);\n\tif (status === 429) return new NeonRateLimitError(message, init);\n\treturn new NeonApiError(message, init);\n}\n"],"mappings":";;;;;;;;AAQA,MAAM,2BAA2B;;;;;;;;;AAqBjC,IAAa,YAAb,cAA+B,MAAM;CACpC;CAEA,YACC,SACA,MACA,SACC;EACD,MAAM,SAAS,OAAO;EACtB,KAAK,OAAO;EACZ,KAAK,OAAO;CACb;AACD;;AAGA,IAAa,eAAb,cAAkC,UAAU;;CAE3C;;CAEA;;CAEA;;CAEA;;CAEA;CAEA,YACC,SACA,MAQC;EACD,MAAM,SAAS,KAAK,QAAQ,KAAK;EACjC,KAAK,OAAO;EACZ,KAAK,SAAS,KAAK;EACnB,KAAK,OAAO,KAAK;EACjB,KAAK,YAAY,KAAK;EACtB,KAAK,WAAW,KAAK;EACrB,KAAK,OAAO,KAAK;CAClB;AACD;;AAGA,IAAa,oBAAb,cAAuC,aAAa;CACnD,YACC,SACA,MACC;EACD,MAAM,SAAS;GAAE,GAAG;GAAM,MAAM;EAAY,CAAC;EAC7C,KAAK,OAAO;CACb;AACD;;AAGA,IAAa,gBAAb,cAAmC,aAAa;CAC/C,YACC,SACA,MACC;EACD,MAAM,SAAS;GAAE,GAAG;GAAM,MAAM;EAAO,CAAC;EACxC,KAAK,OAAO;CACb;AACD;;AAGA,IAAa,qBAAb,cAAwC,aAAa;CACpD,YACC,SACA,MACC;EACD,MAAM,SAAS;GAAE,GAAG;GAAM,MAAM;EAAa,CAAC;EAC9C,KAAK,OAAO;CACb;AACD;;AAGA,IAAa,qBAAb,cAAwC,U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AC1B;;;;;;AAOA,SAAgB,YACf,OACA,UACY;CACZ,IAAI,CAAC,UAAU;EACd,MAAM,SAAS,yBAAyB,KAAK;EAC7C,OAAO,IAAI,iBACV,0DAA0D,OAAO,KACjE;GAAE,OAAO;GAAO;EAAO,CACxB;CACD;CAEA,MAAM,SAAS,iBAAiB,KAAK;CACrC,MAAM,SAAS,SAAS;CACxB,MAAM,UACL,OAAO,WAAW,uCAAuC,OAAO;CACjE,MAAM,OAAO;EACZ;EACA,MAAM,OAAO;EACb,WACC,OAAO,cACP,SAAS,QAAQ,IAAI,cAAc,KACnC,KAAA;EACD;EACA,MAAM;CACP;CAEA,IAAI,WAAW,KAAK,OAAO,IAAI,kBAAkB,SAAS,IAAI;CAC9D,IAAI,WAAW,OAAO,WAAW,KAChC,OAAO,IAAI,cAAc,SAAS,IAAI;CACvC,IAAI,WAAW,KAAK,OAAO,IAAI,mBAAmB,SAAS,IAAI;CAC/D,OAAO,IAAI,aAAa,SAAS,IAAI;AACtC"}
|
package/dist/neon/paginate.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Deadline } from "./deadline.js";
|
|
1
2
|
import { NeonResult } from "./result.js";
|
|
2
3
|
|
|
3
4
|
//#region src/neon/paginate.d.ts
|
|
@@ -27,8 +28,12 @@ interface Paginated<T> extends AsyncIterable<T> {
|
|
|
27
28
|
/**
|
|
28
29
|
* Build a {@link Paginated} list from a page fetcher and a page mapper. The response-body
|
|
29
30
|
* type `D` is inferred and erased from the public `Paginated<T>` return.
|
|
31
|
+
*
|
|
32
|
+
* `newDeadline` is called once per consumption — each `page()`, each `all()`, each
|
|
33
|
+
* iteration — because a `Paginated` is lazy and may be consumed more than once, so a
|
|
34
|
+
* deadline created when the list was built would already be spent.
|
|
30
35
|
*/
|
|
31
|
-
declare function paginate<T, D>(fetchPage: (cursor: string | undefined, signal?: AbortSignal) => Promise<RawResult<D>>, mapPage: (data: D) => Page<T>,
|
|
36
|
+
declare function paginate<T, D>(fetchPage: (cursor: string | undefined, signal?: AbortSignal) => Promise<RawResult<D>>, mapPage: (data: D) => Page<T>, newDeadline: () => Deadline): Paginated<T>;
|
|
32
37
|
//#endregion
|
|
33
38
|
export { Page, Paginated, paginate };
|
|
34
39
|
//# sourceMappingURL=paginate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paginate.d.ts","names":[],"sources":["../../src/neon/paginate.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"paginate.d.ts","names":[],"sources":["../../src/neon/paginate.ts"],"mappings":";;;;UAIiB;SACT;EADS;EAMP,MAAA,CAAA,EAAA,MAAS;AAAA;AACX,UADE,SACF,CAAA,CAAA,CAAA,CAAA;EAEI,IAAA,CAAA,EAFJ,CAEI,GAAA,SAAA;EAAQ,KAAA,CAAA,EAAA,OAAA;EAUH,QAAA,CAAA,EAVL,QAUc,GAAA,SAAA;AAAA;AAA0B;AAEJ;AAAL;AAAX;AAAR;AAEG;AAAX;AAAR,UAJS,SAIT,CAAA,CAAA,CAAA,SAJ8B,aAI9B,CAJ4C,CAI5C,CAAA,CAAA;EAJ8B;EAAa,IAAA,CAAA,MAAA,CAAA,EAAA,MAAA,CAAA,EAE3B,OAF2B,CAEnB,UAFmB,CAER,IAFQ,CAEH,CAFG,CAAA,CAAA,CAAA;EAkHnC;EAAQ,GAAA,EAAA,EA9GhB,OA8GgB,CA9GR,UA8GQ,CA9GG,CA8GH,EAAA,CAAA,CAAA;AAGb;AACa;AAAV;AAAR;AACW;AAAW;AAAL;AACH;AACP;AAAV,iBAPa,QAOb,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,SAAA,EAAA,CAAA,MAAA,EAAA,MAAA,GAAA,SAAA,EAAA,MAAA,CAAA,EAJQ,WAIR,EAAA,GAHG,OAGH,CAHW,SAGX,CAHqB,CAGrB,CAAA,CAAA,EAAA,OAAA,EAAA,CAAA,IAAA,EAFc,CAEd,EAAA,GAFoB,IAEpB,CAFyB,CAEzB,CAAA,EAAA,WAAA,EAAA,GAAA,GADiB,QACjB,CAAA,EAAA,SAAA,CAAU,CAAV,CAAA"}
|
package/dist/neon/paginate.js
CHANGED
|
@@ -1,49 +1,87 @@
|
|
|
1
|
-
import { toNeonError } from "./errors.js";
|
|
1
|
+
import { NeonError, toNeonError } from "./errors.js";
|
|
2
|
+
import { cancelled, runBounded } from "./deadline.js";
|
|
2
3
|
import { err, ok } from "./result.js";
|
|
3
4
|
//#region src/neon/paginate.ts
|
|
4
5
|
var PaginatedList = class {
|
|
5
6
|
#fetchPage;
|
|
6
7
|
#mapPage;
|
|
7
|
-
#
|
|
8
|
-
constructor(fetchPage, mapPage,
|
|
8
|
+
#newDeadline;
|
|
9
|
+
constructor(fetchPage, mapPage, newDeadline) {
|
|
9
10
|
this.#fetchPage = fetchPage;
|
|
10
11
|
this.#mapPage = mapPage;
|
|
11
|
-
this.#
|
|
12
|
+
this.#newDeadline = newDeadline;
|
|
12
13
|
}
|
|
13
|
-
async page(cursor) {
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
async #page(cursor, deadline) {
|
|
15
|
+
let raw;
|
|
16
|
+
try {
|
|
17
|
+
raw = await runBounded(deadline, () => this.#fetchPage(cursor, deadline.signal));
|
|
18
|
+
} catch (error) {
|
|
19
|
+
return err(cancelled(deadline) ?? toNeonError(error, void 0));
|
|
20
|
+
}
|
|
21
|
+
const cancellation = cancelled(deadline);
|
|
22
|
+
if (cancellation) return err(cancellation);
|
|
23
|
+
if (raw === void 0 || raw.error || raw.data === void 0) {
|
|
24
|
+
if (raw?.error instanceof NeonError) return err(raw.error);
|
|
25
|
+
return err(toNeonError(raw?.error, raw?.response));
|
|
26
|
+
}
|
|
16
27
|
return ok(this.#mapPage(raw.data));
|
|
17
28
|
}
|
|
29
|
+
async page(cursor) {
|
|
30
|
+
const deadline = this.#newDeadline();
|
|
31
|
+
try {
|
|
32
|
+
return await this.#page(cursor, deadline);
|
|
33
|
+
} finally {
|
|
34
|
+
deadline.dispose();
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* One deadline covers the whole walk, not each page: `all()` is a single operation
|
|
39
|
+
* from the caller's side, and a per-page budget would leave an unbounded number of
|
|
40
|
+
* pages unbounded in total.
|
|
41
|
+
*/
|
|
18
42
|
async all() {
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
43
|
+
const deadline = this.#newDeadline();
|
|
44
|
+
try {
|
|
45
|
+
const items = [];
|
|
46
|
+
let cursor;
|
|
47
|
+
while (true) {
|
|
48
|
+
const result = await this.#page(cursor, deadline);
|
|
49
|
+
if (result.error) return err(result.error);
|
|
50
|
+
items.push(...result.data.items);
|
|
51
|
+
if (!result.data.cursor || result.data.items.length === 0) break;
|
|
52
|
+
cursor = result.data.cursor;
|
|
53
|
+
}
|
|
54
|
+
return ok(items);
|
|
55
|
+
} finally {
|
|
56
|
+
deadline.dispose();
|
|
27
57
|
}
|
|
28
|
-
return ok(items);
|
|
29
58
|
}
|
|
30
59
|
async *[Symbol.asyncIterator]() {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
60
|
+
const deadline = this.#newDeadline();
|
|
61
|
+
try {
|
|
62
|
+
let cursor;
|
|
63
|
+
while (true) {
|
|
64
|
+
const result = await this.#page(cursor, deadline);
|
|
65
|
+
if (result.error) throw result.error;
|
|
66
|
+
yield* result.data.items;
|
|
67
|
+
if (!result.data.cursor || result.data.items.length === 0) break;
|
|
68
|
+
cursor = result.data.cursor;
|
|
69
|
+
}
|
|
70
|
+
} finally {
|
|
71
|
+
deadline.dispose();
|
|
38
72
|
}
|
|
39
73
|
}
|
|
40
74
|
};
|
|
41
75
|
/**
|
|
42
76
|
* Build a {@link Paginated} list from a page fetcher and a page mapper. The response-body
|
|
43
77
|
* type `D` is inferred and erased from the public `Paginated<T>` return.
|
|
78
|
+
*
|
|
79
|
+
* `newDeadline` is called once per consumption — each `page()`, each `all()`, each
|
|
80
|
+
* iteration — because a `Paginated` is lazy and may be consumed more than once, so a
|
|
81
|
+
* deadline created when the list was built would already be spent.
|
|
44
82
|
*/
|
|
45
|
-
function paginate(fetchPage, mapPage,
|
|
46
|
-
return new PaginatedList(fetchPage, mapPage,
|
|
83
|
+
function paginate(fetchPage, mapPage, newDeadline) {
|
|
84
|
+
return new PaginatedList(fetchPage, mapPage, newDeadline);
|
|
47
85
|
}
|
|
48
86
|
//#endregion
|
|
49
87
|
export { paginate };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paginate.js","names":["#fetchPage","#mapPage","#
|
|
1
|
+
{"version":3,"file":"paginate.js","names":["#fetchPage","#mapPage","#newDeadline","#page"],"sources":["../../src/neon/paginate.ts"],"sourcesContent":["import { cancelled, type Deadline, runBounded } from \"./deadline.js\";\nimport { NeonError, toNeonError } from \"./errors.js\";\nimport { err, type NeonResult, ok } from \"./result.js\";\n\nexport interface Page<T> {\n\titems: T[];\n\t/** Cursor for the next page, when more results exist. */\n\tcursor?: string;\n}\n\ninterface RawResult<D> {\n\tdata?: D | undefined;\n\terror?: unknown;\n\tresponse?: Response | undefined;\n}\n\n/**\n * A lazy, cursor-paginated list. `all()` / `page()` return the `{ data, error }` envelope;\n * the async iterator streams items lazily and throws on a page-fetch error.\n *\n * Note: pagination helpers always use the result envelope (the iterator is the throwing\n * form) regardless of the client's `throwOnError` setting.\n */\nexport interface Paginated<T> extends AsyncIterable<T> {\n\t/** Fetch a single page (optionally from a cursor). */\n\tpage(cursor?: string): Promise<NeonResult<Page<T>>>;\n\t/** Fetch and concatenate every page. */\n\tall(): Promise<NeonResult<T[]>>;\n}\n\nclass PaginatedList<T, D> implements Paginated<T> {\n\treadonly #fetchPage: (\n\t\tcursor: string | undefined,\n\t\tsignal?: AbortSignal,\n\t) => Promise<RawResult<D>>;\n\treadonly #mapPage: (data: D) => Page<T>;\n\treadonly #newDeadline: () => Deadline;\n\n\tconstructor(\n\t\tfetchPage: (\n\t\t\tcursor: string | undefined,\n\t\t\tsignal?: AbortSignal,\n\t\t) => Promise<RawResult<D>>,\n\t\tmapPage: (data: D) => Page<T>,\n\t\tnewDeadline: () => Deadline,\n\t) {\n\t\tthis.#fetchPage = fetchPage;\n\t\tthis.#mapPage = mapPage;\n\t\tthis.#newDeadline = newDeadline;\n\t}\n\n\tasync #page(\n\t\tcursor: string | undefined,\n\t\tdeadline: Deadline,\n\t): Promise<NeonResult<Page<T>>> {\n\t\tlet raw: RawResult<D> | undefined;\n\t\ttry {\n\t\t\t// Bounded the same way the execution core bounds a request: the signal alone\n\t\t\t// does not cover the phases before `fetch` is reached, so a slow auth provider\n\t\t\t// would otherwise outlast the deadline.\n\t\t\traw = await runBounded(deadline, () =>\n\t\t\t\tthis.#fetchPage(cursor, deadline.signal),\n\t\t\t);\n\t\t} catch (error) {\n\t\t\treturn err(cancelled(deadline) ?? toNeonError(error, undefined));\n\t\t}\n\t\tconst cancellation = cancelled(deadline);\n\t\tif (cancellation) return err(cancellation);\n\t\tif (raw === undefined || raw.error || raw.data === undefined) {\n\t\t\t// A fetcher that already classified the failure keeps its own error.\n\t\t\t// Re-deriving one from the response would mislabel a fault the SDK\n\t\t\t// found in a 200 body as an API error with a 2xx status.\n\t\t\tif (raw?.error instanceof NeonError) return err(raw.error);\n\t\t\treturn err(toNeonError(raw?.error, raw?.response));\n\t\t}\n\t\treturn ok(this.#mapPage(raw.data));\n\t}\n\n\tasync page(cursor?: string): Promise<NeonResult<Page<T>>> {\n\t\tconst deadline = this.#newDeadline();\n\t\ttry {\n\t\t\treturn await this.#page(cursor, deadline);\n\t\t} finally {\n\t\t\tdeadline.dispose();\n\t\t}\n\t}\n\n\t/**\n\t * One deadline covers the whole walk, not each page: `all()` is a single operation\n\t * from the caller's side, and a per-page budget would leave an unbounded number of\n\t * pages unbounded in total.\n\t */\n\tasync all(): Promise<NeonResult<T[]>> {\n\t\tconst deadline = this.#newDeadline();\n\t\ttry {\n\t\t\tconst items: T[] = [];\n\t\t\tlet cursor: string | undefined;\n\t\t\twhile (true) {\n\t\t\t\tconst result = await this.#page(cursor, deadline);\n\t\t\t\tif (result.error) return err(result.error);\n\t\t\t\titems.push(...result.data.items);\n\t\t\t\tif (!result.data.cursor || result.data.items.length === 0)\n\t\t\t\t\tbreak;\n\t\t\t\tcursor = result.data.cursor;\n\t\t\t}\n\t\t\treturn ok(items);\n\t\t} finally {\n\t\t\tdeadline.dispose();\n\t\t}\n\t}\n\n\tasync *[Symbol.asyncIterator](): AsyncIterator<T> {\n\t\tconst deadline = this.#newDeadline();\n\t\ttry {\n\t\t\tlet cursor: string | undefined;\n\t\t\twhile (true) {\n\t\t\t\tconst result = await this.#page(cursor, deadline);\n\t\t\t\tif (result.error) throw result.error;\n\t\t\t\tyield* result.data.items;\n\t\t\t\tif (!result.data.cursor || result.data.items.length === 0)\n\t\t\t\t\tbreak;\n\t\t\t\tcursor = result.data.cursor;\n\t\t\t}\n\t\t} finally {\n\t\t\tdeadline.dispose();\n\t\t}\n\t}\n}\n\n/**\n * Build a {@link Paginated} list from a page fetcher and a page mapper. The response-body\n * type `D` is inferred and erased from the public `Paginated<T>` return.\n *\n * `newDeadline` is called once per consumption — each `page()`, each `all()`, each\n * iteration — because a `Paginated` is lazy and may be consumed more than once, so a\n * deadline created when the list was built would already be spent.\n */\nexport function paginate<T, D>(\n\tfetchPage: (\n\t\tcursor: string | undefined,\n\t\tsignal?: AbortSignal,\n\t) => Promise<RawResult<D>>,\n\tmapPage: (data: D) => Page<T>,\n\tnewDeadline: () => Deadline,\n): Paginated<T> {\n\treturn new PaginatedList(fetchPage, mapPage, newDeadline);\n}\n"],"mappings":";;;;AA8BA,IAAM,gBAAN,MAAkD;CACjD;CAIA;CACA;CAEA,YACC,WAIA,SACA,aACC;EACD,KAAKA,aAAa;EAClB,KAAKC,WAAW;EAChB,KAAKC,eAAe;CACrB;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AM,QAAQ,QAAQ;IAChD,IAAI,OAAO,OAAO,MAAM,OAAO;IAC/B,OAAO,OAAO,KAAK;IACnB,IAAI,CAAC,OAAO,KAAK,UAAU,OAAO,KAAK,MAAM,WAAW,GACvD;IACD,SAAS,OAAO,KAAK;GACtB;EACD,UAAU;GACT,SAAS,QAAQ;EAClB;CACD;AACD;;;;;;;;;AAUA,SAAgB,SACf,WAIA,SACA,aACe;CACf,OAAO,IAAI,cAAc,WAAW,SAAS,WAAW;AACzD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"raw-wrap.d.ts","names":[],"sources":["../../src/neon/raw-wrap.ts"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"raw-wrap.d.ts","names":[],"sources":["../../src/neon/raw-wrap.ts"],"mappings":";;;;AA+DgE;AAAC;AAGjE;AAAsB;AAAW;AACT;AAAX,KAtBD,QAAA,GAsBC,CAAA,OAAA,EAAA,GAAA,EAAA,GAtB4B,OAsB5B,CAAA,GAAA,CAAA;AAAZ;AAD4C,KAVxC,UAUwC,CAAA,CAAA,CAAA,GAVxB,CAUwB,SAAA;EAAI,KAAA,EAAA,SAAA,GAAA,IAAA;AAUjD,CAAA,GApB6D,CAoBjD,GAAA,KAAA;AAAS;AACV;AAAgC;AAAoB;AAGrD,KAlBE,OAkBF,CAAA,UAlBoB,QAkBpB,CAAA,GAjBT,UAiBS,CAjBE,OAiBF,CAjBU,UAiBV,CAjBqB,CAiBrB,CAAA,CAAA,CAAA,SAAA;EACI,IAAA,EAAA,KAAA,EAAA;AACD,CAAA,GAnBmD,CAmBnD,GAAA,KAAA;AAAO;AAeJ,KA/BJ,UA+BW,CAAA,UA/BU,QA+BV,CAAA,GA/BsB,IA+BtB,CA9BtB,WA8BsB,CA9BV,UA8BU,CA9BC,CA8BD,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,cAAA,GAAA,eAAA,CAAA;AAAA;AAAW;AAAc;AAAI;AAE9B;AAAX,KAvBC,SAuBD,CAAA,CAAA,CAAA,GAAA;EACS,IAAA,EAvBT,CAuBS;EAAR,KAAA,EAAA,SAAA;EAAR,QAAA,CAAA,EAvBuC,QAuBvC;EAEkB,OAAA,CAAA,EAzByC,OAyBzC;AAAX,CAAA,GAAA;EACmB,IAAA,EAAA,SAAA;EAAR,KAAA,EAvBZ,SAuBY;EAAV,QAAA,CAAA,EAtBE,QAsBF;EAAR,OAAA,CAAA,EArBS,OAqBT;AAAO,CAAA;;;;;;;;;;;;;iBANK,kBAAkB,cAAc,IAAI;YAEzC,WAAW;;MAClB,QAAQ,QAAQ;YAET,WAAW;;MAClB,QAAQ,UAAU,QAAQ"}
|
package/dist/neon/raw-wrap.js
CHANGED
|
@@ -1,6 +1,21 @@
|
|
|
1
|
-
import { toNeonError } from "./errors.js";
|
|
1
|
+
import { NeonAbortError, toNeonError } from "./errors.js";
|
|
2
2
|
//#region src/neon/raw-wrap.ts
|
|
3
3
|
/**
|
|
4
|
+
* Did the caller's own signal end this call?
|
|
5
|
+
*
|
|
6
|
+
* Read from the signal rather than the error, because the generated client reports
|
|
7
|
+
* authentication, serialization, interceptor, transport and parsing faults through one
|
|
8
|
+
* channel — an error named `AbortError` is not evidence about which occurred. A response
|
|
9
|
+
* having arrived rules cancellation out.
|
|
10
|
+
*
|
|
11
|
+
* This deliberately says nothing about a signal the SDK never saw: the Neon CLI installs
|
|
12
|
+
* its own request timeout inside a custom `fetch` rather than passing `signal`, so its
|
|
13
|
+
* timeouts keep classifying as {@link NeonNetworkError} exactly as before.
|
|
14
|
+
*/
|
|
15
|
+
function abortedBy(signal, response) {
|
|
16
|
+
return response === void 0 && signal?.aborted === true;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
4
19
|
* Wrap a generated raw function so it speaks the ergonomic result contract.
|
|
5
20
|
*
|
|
6
21
|
* @example
|
|
@@ -21,7 +36,7 @@ function wrapRaw(fn) {
|
|
|
21
36
|
responseStyle: "fields"
|
|
22
37
|
});
|
|
23
38
|
if (raw.error !== void 0 && raw.error !== null) {
|
|
24
|
-
const error = toNeonError(raw.error, raw.response);
|
|
39
|
+
const error = abortedBy(options.signal, raw.response) ? new NeonAbortError("The request was aborted by its signal.", { cause: raw.error }) : toNeonError(raw.error, raw.response);
|
|
25
40
|
if (shouldThrow) throw error;
|
|
26
41
|
return {
|
|
27
42
|
data: void 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"raw-wrap.js","names":[],"sources":["../../src/neon/raw-wrap.ts"],"sourcesContent":["/**\n * The raw layer's result adapter.\n *\n * The generated `client/sdk.gen.ts` functions return hey-api's `{ data, error, request,\n * response }` envelope and are driven by two orthogonal switches (`throwOnError` and\n * `responseStyle`). {@link wrapRaw} collapses that onto the ergonomic client's contract: a\n * `{ data, error }` result by default (with the typed {@link NeonError} on the error\n * channel), or the bare resource when you pass `throwOnError: true`. `responseStyle` is\n * removed from the public raw surface — `throwOnError` is the only switch and the return\n * type always tracks it.\n *\n * The one difference from the ergonomic `NeonResult` is that the raw result also exposes the\n * underlying `response`/`request`, so power users (and the neonctl CLI) can read HTTP status\n * and headers without dropping to the low-level client.\n */\n\nimport type { NeonError } from \"./errors.js\";\nimport { toNeonError } from \"./errors.js\";\n\n/**\n * Structural shape of any generated raw function: generic over `throwOnError`, resolving to\n * hey-api's envelope. The `any`s live only inside this adapter type so the generated\n * functions (each with their own precise option/response types) remain assignable; the\n * public {@link wrapRaw} overloads recover full type safety per function.\n */\n// biome-ignore lint/suspicious/noExplicitAny: adapter boundary over generated generic fns\nexport type AnyRawFn = (options: any) => Promise<any>;\n\n/** hey-api's non-throw \"fields\" envelope, parameterized by the success payload. */\ninterface RawFieldsResult<T> {\n\tdata?: T;\n\terror?: unknown;\n\tresponse?: Response;\n\trequest?: Request;\n}\n\n/** Extract the success arm of a discriminated fields envelope. */\ntype SuccessArm<R> = R extends { error: undefined | null } ? R : never;\n\n/**\n * The success payload of a generated raw function — derived from its default (non-throw,\n * fields) return type, so it stays correct as the client is regenerated.\n */\nexport type RawData<F extends AnyRawFn> =\n\tSuccessArm<Awaited<ReturnType<F>>> extends { data: infer D } ? D : never;\n\n/** The call options for a wrapped raw function, minus the removed hey-api switches. */\nexport type RawOptions<F extends AnyRawFn> = Omit<\n\tNonNullable<Parameters<F>[0]>,\n\t\"throwOnError\" | \"responseStyle\"\n>;\n\n/**\n * The non-throwing result of a wrapped raw call: the ergonomic `{ data, error }` union\n * (typed {@link NeonError}), plus the underlying `response`/`request` for HTTP status and\n * headers.\n */\nexport type RawResult<T> =\n\t| { data: T; error: undefined; response?: Response; request?: Request }\n\t| {\n\t\t\tdata: undefined;\n\t\t\terror: NeonError;\n\t\t\tresponse?: Response;\n\t\t\trequest?: Request;\n\t };\n\n/**\n * Wrap a generated raw function so it speaks the ergonomic result contract.\n *\n * @example\n * ```ts\n * import { getProject } from \"@neon/sdk/raw\";\n *\n * const { data, error } = await getProject({ client, path: { project_id } });\n * // or, throwing:\n * const { project } = await getProject({ client, path: { project_id }, throwOnError: true });\n * ```\n */\nexport function wrapRaw<F extends AnyRawFn>(fn: F & AnyRawFn) {\n\tfunction call(\n\t\toptions: RawOptions<F> & { throwOnError: true },\n\t): Promise<RawData<F>>;\n\tfunction call(\n\t\toptions: RawOptions<F> & { throwOnError?: false },\n\t): Promise<RawResult<RawData<F>>>;\n\tasync function call(\n\t\toptions: RawOptions<F> & { throwOnError?: boolean },\n\t): Promise<RawData<F> | RawResult<RawData<F>>> {\n\t\tconst shouldThrow = options.throwOnError === true;\n\t\tconst raw: RawFieldsResult<RawData<F>> = await fn({\n\t\t\t...options,\n\t\t\tthrowOnError: false,\n\t\t\tresponseStyle: \"fields\",\n\t\t});\n\t\tif (raw.error !== undefined && raw.error !== null) {\n\t\t\tconst error = toNeonError(raw.error, raw.response);\n\t\t\tif (shouldThrow) throw error;\n\t\t\treturn {\n\t\t\t\tdata: undefined,\n\t\t\t\terror,\n\t\t\t\tresponse: raw.response,\n\t\t\t\trequest: raw.request,\n\t\t\t};\n\t\t}\n\t\t// On success the payload is present (or `void`/`undefined` for 204 endpoints); it is\n\t\t// the declared `RawData<F>` by construction of the generated response types.\n\t\tconst data = raw.data as RawData<F>;\n\t\tif (shouldThrow) return data;\n\t\treturn {\n\t\t\tdata,\n\t\t\terror: undefined,\n\t\t\tresponse: raw.response,\n\t\t\trequest: raw.request,\n\t\t};\n\t}\n\treturn call;\n}\n"],"mappings":";;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"raw-wrap.js","names":[],"sources":["../../src/neon/raw-wrap.ts"],"sourcesContent":["/**\n * The raw layer's result adapter.\n *\n * The generated `client/sdk.gen.ts` functions return hey-api's `{ data, error, request,\n * response }` envelope and are driven by two orthogonal switches (`throwOnError` and\n * `responseStyle`). {@link wrapRaw} collapses that onto the ergonomic client's contract: a\n * `{ data, error }` result by default (with the typed {@link NeonError} on the error\n * channel), or the bare resource when you pass `throwOnError: true`. `responseStyle` is\n * removed from the public raw surface — `throwOnError` is the only switch and the return\n * type always tracks it.\n *\n * The one difference from the ergonomic `NeonResult` is that the raw result also exposes the\n * underlying `response`/`request`, so power users (and the neonctl CLI) can read HTTP status\n * and headers without dropping to the low-level client.\n */\n\nimport type { NeonError } from \"./errors.js\";\nimport { NeonAbortError, toNeonError } from \"./errors.js\";\n\n/**\n * Did the caller's own signal end this call?\n *\n * Read from the signal rather than the error, because the generated client reports\n * authentication, serialization, interceptor, transport and parsing faults through one\n * channel — an error named `AbortError` is not evidence about which occurred. A response\n * having arrived rules cancellation out.\n *\n * This deliberately says nothing about a signal the SDK never saw: the Neon CLI installs\n * its own request timeout inside a custom `fetch` rather than passing `signal`, so its\n * timeouts keep classifying as {@link NeonNetworkError} exactly as before.\n */\nfunction abortedBy(\n\tsignal: AbortSignal | undefined,\n\tresponse: Response | undefined,\n): boolean {\n\treturn response === undefined && signal?.aborted === true;\n}\n\n/**\n * Structural shape of any generated raw function: generic over `throwOnError`, resolving to\n * hey-api's envelope. The `any`s live only inside this adapter type so the generated\n * functions (each with their own precise option/response types) remain assignable; the\n * public {@link wrapRaw} overloads recover full type safety per function.\n */\n// biome-ignore lint/suspicious/noExplicitAny: adapter boundary over generated generic fns\nexport type AnyRawFn = (options: any) => Promise<any>;\n\n/** hey-api's non-throw \"fields\" envelope, parameterized by the success payload. */\ninterface RawFieldsResult<T> {\n\tdata?: T;\n\terror?: unknown;\n\tresponse?: Response;\n\trequest?: Request;\n}\n\n/** Extract the success arm of a discriminated fields envelope. */\ntype SuccessArm<R> = R extends { error: undefined | null } ? R : never;\n\n/**\n * The success payload of a generated raw function — derived from its default (non-throw,\n * fields) return type, so it stays correct as the client is regenerated.\n */\nexport type RawData<F extends AnyRawFn> =\n\tSuccessArm<Awaited<ReturnType<F>>> extends { data: infer D } ? D : never;\n\n/** The call options for a wrapped raw function, minus the removed hey-api switches. */\nexport type RawOptions<F extends AnyRawFn> = Omit<\n\tNonNullable<Parameters<F>[0]>,\n\t\"throwOnError\" | \"responseStyle\"\n>;\n\n/**\n * The non-throwing result of a wrapped raw call: the ergonomic `{ data, error }` union\n * (typed {@link NeonError}), plus the underlying `response`/`request` for HTTP status and\n * headers.\n */\nexport type RawResult<T> =\n\t| { data: T; error: undefined; response?: Response; request?: Request }\n\t| {\n\t\t\tdata: undefined;\n\t\t\terror: NeonError;\n\t\t\tresponse?: Response;\n\t\t\trequest?: Request;\n\t };\n\n/**\n * Wrap a generated raw function so it speaks the ergonomic result contract.\n *\n * @example\n * ```ts\n * import { getProject } from \"@neon/sdk/raw\";\n *\n * const { data, error } = await getProject({ client, path: { project_id } });\n * // or, throwing:\n * const { project } = await getProject({ client, path: { project_id }, throwOnError: true });\n * ```\n */\nexport function wrapRaw<F extends AnyRawFn>(fn: F & AnyRawFn) {\n\tfunction call(\n\t\toptions: RawOptions<F> & { throwOnError: true },\n\t): Promise<RawData<F>>;\n\tfunction call(\n\t\toptions: RawOptions<F> & { throwOnError?: false },\n\t): Promise<RawResult<RawData<F>>>;\n\tasync function call(\n\t\toptions: RawOptions<F> & { throwOnError?: boolean },\n\t): Promise<RawData<F> | RawResult<RawData<F>>> {\n\t\tconst shouldThrow = options.throwOnError === true;\n\t\tconst raw: RawFieldsResult<RawData<F>> = await fn({\n\t\t\t...options,\n\t\t\tthrowOnError: false,\n\t\t\tresponseStyle: \"fields\",\n\t\t});\n\t\tif (raw.error !== undefined && raw.error !== null) {\n\t\t\tconst error = abortedBy(options.signal, raw.response)\n\t\t\t\t? new NeonAbortError(\"The request was aborted by its signal.\", {\n\t\t\t\t\t\tcause: raw.error,\n\t\t\t\t\t})\n\t\t\t\t: toNeonError(raw.error, raw.response);\n\t\t\tif (shouldThrow) throw error;\n\t\t\treturn {\n\t\t\t\tdata: undefined,\n\t\t\t\terror,\n\t\t\t\tresponse: raw.response,\n\t\t\t\trequest: raw.request,\n\t\t\t};\n\t\t}\n\t\t// On success the payload is present (or `void`/`undefined` for 204 endpoints); it is\n\t\t// the declared `RawData<F>` by construction of the generated response types.\n\t\tconst data = raw.data as RawData<F>;\n\t\tif (shouldThrow) return data;\n\t\treturn {\n\t\t\tdata,\n\t\t\terror: undefined,\n\t\t\tresponse: raw.response,\n\t\t\trequest: raw.request,\n\t\t};\n\t}\n\treturn call;\n}\n"],"mappings":";;;;;;;;;;;;;;AA+BA,SAAS,UACR,QACA,UACU;CACV,OAAO,aAAa,KAAA,KAAa,QAAQ,YAAY;AACtD;;;;;;;;;;;;;AA6DA,SAAgB,QAA4B,IAAkB;CAO7D,eAAe,KACd,SAC8C;EAC9C,MAAM,cAAc,QAAQ,iBAAiB;EAC7C,MAAM,MAAmC,MAAM,GAAG;GACjD,GAAG;GACH,cAAc;GACd,eAAe;EAChB,CAAC;EACD,IAAI,IAAI,UAAU,KAAA,KAAa,IAAI,UAAU,MAAM;GAClD,MAAM,QAAQ,UAAU,QAAQ,QAAQ,IAAI,QAAQ,IACjD,IAAI,eAAe,0CAA0C,EAC7D,OAAO,IAAI,MACZ,CAAC,IACA,YAAY,IAAI,OAAO,IAAI,QAAQ;GACtC,IAAI,aAAa,MAAM;GACvB,OAAO;IACN,MAAM,KAAA;IACN;IACA,UAAU,IAAI;IACd,SAAS,IAAI;GACd;EACD;EAGA,MAAM,OAAO,IAAI;EACjB,IAAI,aAAa,OAAO;EACxB,OAAO;GACN;GACA,OAAO,KAAA;GACP,UAAU,IAAI;GACd,SAAS,IAAI;EACd;CACD;CACA,OAAO;AACR"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account.d.ts","names":[],"sources":["../../../src/neon/resources/account.ts"],"mappings":";;;;;;cAoBa;EAAA,CAAA,OAAI;EAAA,WAAA,CAAA,GAAA,EAGC,cAHD;EAGC;EAKK,EAAA,CAAA,CAAA,EAAhB,OAAgB,CAAR,OAAQ,CAAA,uBAAA,EAAyB,MAAzB,CAAA,CAAA;EAAyB,EAAA,CAAA,cAAA,OAAA,GACpB,MADoB,CAAA,CAAA,IAAA,EAExC,WAFwC,CAE5B,KAF4B,CAAA,CAAA,EAG5C,OAH4C,CAGpC,OAHoC,CAG5B,uBAH4B,EAGH,KAHG,CAAA,CAAA;EAAjC;EAAR,aAAA,CAAA,CAAA,
|
|
1
|
+
{"version":3,"file":"account.d.ts","names":[],"sources":["../../../src/neon/resources/account.ts"],"mappings":";;;;;;cAoBa;EAAA,CAAA,OAAI;EAAA,WAAA,CAAA,GAAA,EAGC,cAHD;EAGC;EAKK,EAAA,CAAA,CAAA,EAAhB,OAAgB,CAAR,OAAQ,CAAA,uBAAA,EAAyB,MAAzB,CAAA,CAAA;EAAyB,EAAA,CAAA,cAAA,OAAA,GACpB,MADoB,CAAA,CAAA,IAAA,EAExC,WAFwC,CAE5B,KAF4B,CAAA,CAAA,EAG5C,OAH4C,CAGpC,OAHoC,CAG5B,uBAH4B,EAGH,KAHG,CAAA,CAAA;EAAjC;EAAR,aAAA,CAAA,CAAA,EAgBW,OAhBX,CAgBmB,OAhBnB,CAgB2B,YAhB3B,EAAA,EAgB2C,MAhB3C,CAAA,CAAA;EACqB,aAAA,CAAA,cAA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AA,EAAA,MAAA,EAAA,IAAA,EAkDnC,WAlDmC,CAkDvB,KAlDuB,CAAA,CAAA,EAmDvC,OAnDuC,CAmD/B,OAnD+B,CAmDvB,oBAnDuB,EAmDD,KAnDC,CAAA,CAAA;EAA1B;EAAR,MAAA,CAAA,KAAA,EAAA,MAAA,CAAA,EAsEe,OAtEf,CAsEuB,OAtEvB,CAsE+B,oBAtE/B,EAsEqD,MAtErD,CAAA,CAAA;EACqB,MAAA,CAAA,cAAA,OAAA,GAsEE,MAtEF,CAAA,CAAA,KAAA,EAAA,MAAA,EAAA,IAAA,EAwEtB,WAxEsB,CAwEV,KAxEU,CAAA,CAAA,EAyE1B,OAzE0B,CAyElB,OAzEkB,CAyEV,oBAzEU,EAyEY,KAzEZ,CAAA,CAAA;AACV"}
|
|
@@ -7,15 +7,17 @@ var User = class {
|
|
|
7
7
|
this.#ctx = ctx;
|
|
8
8
|
}
|
|
9
9
|
me(opts) {
|
|
10
|
-
return this.#ctx.run(opts, (client) => getCurrentUserInfo({
|
|
10
|
+
return this.#ctx.run(opts, (client, signal) => getCurrentUserInfo({
|
|
11
11
|
client,
|
|
12
|
-
throwOnError: false
|
|
12
|
+
throwOnError: false,
|
|
13
|
+
signal
|
|
13
14
|
}), (data) => data);
|
|
14
15
|
}
|
|
15
16
|
organizations(opts) {
|
|
16
|
-
return this.#ctx.run(opts, (client) => getCurrentUserOrganizations({
|
|
17
|
+
return this.#ctx.run(opts, (client, signal) => getCurrentUserOrganizations({
|
|
17
18
|
client,
|
|
18
|
-
throwOnError: false
|
|
19
|
+
throwOnError: false,
|
|
20
|
+
signal
|
|
19
21
|
}), (data) => data.organizations);
|
|
20
22
|
}
|
|
21
23
|
};
|
|
@@ -26,9 +28,10 @@ var Regions = class {
|
|
|
26
28
|
this.#ctx = ctx;
|
|
27
29
|
}
|
|
28
30
|
list(opts) {
|
|
29
|
-
return this.#ctx.run(opts, (client) => getActiveRegions({
|
|
31
|
+
return this.#ctx.run(opts, (client, signal) => getActiveRegions({
|
|
30
32
|
client,
|
|
31
|
-
throwOnError: false
|
|
33
|
+
throwOnError: false,
|
|
34
|
+
signal
|
|
32
35
|
}), (data) => data.regions);
|
|
33
36
|
}
|
|
34
37
|
};
|
|
@@ -39,23 +42,26 @@ var ApiKeys = class {
|
|
|
39
42
|
this.#ctx = ctx;
|
|
40
43
|
}
|
|
41
44
|
list(opts) {
|
|
42
|
-
return this.#ctx.run(opts, (client) => listApiKeys({
|
|
45
|
+
return this.#ctx.run(opts, (client, signal) => listApiKeys({
|
|
43
46
|
client,
|
|
44
|
-
throwOnError: false
|
|
47
|
+
throwOnError: false,
|
|
48
|
+
signal
|
|
45
49
|
}), (data) => data);
|
|
46
50
|
}
|
|
47
51
|
create(keyName, opts) {
|
|
48
|
-
return this.#ctx.run(opts, (client) => createApiKey({
|
|
52
|
+
return this.#ctx.run(opts, (client, signal) => createApiKey({
|
|
49
53
|
client,
|
|
50
54
|
body: { key_name: keyName },
|
|
51
|
-
throwOnError: false
|
|
55
|
+
throwOnError: false,
|
|
56
|
+
signal
|
|
52
57
|
}), (data) => data);
|
|
53
58
|
}
|
|
54
59
|
revoke(keyId, opts) {
|
|
55
|
-
return this.#ctx.run(opts, (client) => revokeApiKey({
|
|
60
|
+
return this.#ctx.run(opts, (client, signal) => revokeApiKey({
|
|
56
61
|
client,
|
|
57
62
|
path: { key_id: keyId },
|
|
58
|
-
throwOnError: false
|
|
63
|
+
throwOnError: false,
|
|
64
|
+
signal
|
|
59
65
|
}), (data) => data);
|
|
60
66
|
}
|
|
61
67
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account.js","names":["#ctx"],"sources":["../../../src/neon/resources/account.ts"],"sourcesContent":["import {\n\tcreateApiKey,\n\tgetActiveRegions,\n\tgetCurrentUserInfo,\n\tgetCurrentUserOrganizations,\n\tlistApiKeys,\n\trevokeApiKey,\n} from \"../../client/sdk.gen.js\";\nimport type {\n\tApiKeyCreateResponse,\n\tApiKeyRevokeResponse,\n\tApiKeysListResponseItem,\n\tCurrentUserInfoResponse,\n\tOrganization,\n\tRegionResponse,\n} from \"../../client/types.gen.js\";\nimport type { CallOptions, RequestContext } from \"../context.js\";\nimport type { NeonResult, Outcome } from \"../result.js\";\n\n/** Current user / account resource. */\nexport class User<DThrow extends boolean> {\n\treadonly #ctx: RequestContext;\n\n\tconstructor(ctx: RequestContext) {\n\t\tthis.#ctx = ctx;\n\t}\n\n\t/** @apiCall GET /users/me */\n\tme(): Promise<Outcome<CurrentUserInfoResponse, DThrow>>;\n\tme<Throw extends boolean = DThrow>(\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<CurrentUserInfoResponse, Throw>>;\n\tme(\n\t\topts?: CallOptions,\n\t): Promise<CurrentUserInfoResponse | NeonResult<CurrentUserInfoResponse>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client)
|
|
1
|
+
{"version":3,"file":"account.js","names":["#ctx"],"sources":["../../../src/neon/resources/account.ts"],"sourcesContent":["import {\n\tcreateApiKey,\n\tgetActiveRegions,\n\tgetCurrentUserInfo,\n\tgetCurrentUserOrganizations,\n\tlistApiKeys,\n\trevokeApiKey,\n} from \"../../client/sdk.gen.js\";\nimport type {\n\tApiKeyCreateResponse,\n\tApiKeyRevokeResponse,\n\tApiKeysListResponseItem,\n\tCurrentUserInfoResponse,\n\tOrganization,\n\tRegionResponse,\n} from \"../../client/types.gen.js\";\nimport type { CallOptions, RequestContext } from \"../context.js\";\nimport type { NeonResult, Outcome } from \"../result.js\";\n\n/** Current user / account resource. */\nexport class User<DThrow extends boolean> {\n\treadonly #ctx: RequestContext;\n\n\tconstructor(ctx: RequestContext) {\n\t\tthis.#ctx = ctx;\n\t}\n\n\t/** @apiCall GET /users/me */\n\tme(): Promise<Outcome<CurrentUserInfoResponse, DThrow>>;\n\tme<Throw extends boolean = DThrow>(\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<CurrentUserInfoResponse, Throw>>;\n\tme(\n\t\topts?: CallOptions,\n\t): Promise<CurrentUserInfoResponse | NeonResult<CurrentUserInfoResponse>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client, signal) =>\n\t\t\t\tgetCurrentUserInfo({ client, throwOnError: false, signal }),\n\t\t\t(data) => data,\n\t\t);\n\t}\n\n\t/** @apiCall GET /users/me/organizations */\n\torganizations(): Promise<Outcome<Organization[], DThrow>>;\n\torganizations<Throw extends boolean = DThrow>(\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<Organization[], Throw>>;\n\torganizations(\n\t\topts?: CallOptions,\n\t): Promise<Organization[] | NeonResult<Organization[]>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client, signal) =>\n\t\t\t\tgetCurrentUserOrganizations({\n\t\t\t\t\tclient,\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t\tsignal,\n\t\t\t\t}),\n\t\t\t(data) => data.organizations,\n\t\t);\n\t}\n}\n\n/** Active regions. */\nexport class Regions<DThrow extends boolean> {\n\treadonly #ctx: RequestContext;\n\n\tconstructor(ctx: RequestContext) {\n\t\tthis.#ctx = ctx;\n\t}\n\n\t/** @apiCall GET /regions */\n\tlist(): Promise<Outcome<RegionResponse[], DThrow>>;\n\tlist<Throw extends boolean = DThrow>(\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<RegionResponse[], Throw>>;\n\tlist(\n\t\topts?: CallOptions,\n\t): Promise<RegionResponse[] | NeonResult<RegionResponse[]>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client, signal) =>\n\t\t\t\tgetActiveRegions({ client, throwOnError: false, signal }),\n\t\t\t(data) => data.regions,\n\t\t);\n\t}\n}\n\n/** Account API keys. */\nexport class ApiKeys<DThrow extends boolean> {\n\treadonly #ctx: RequestContext;\n\n\tconstructor(ctx: RequestContext) {\n\t\tthis.#ctx = ctx;\n\t}\n\n\t/** @apiCall GET /api_keys */\n\tlist(): Promise<Outcome<ApiKeysListResponseItem[], DThrow>>;\n\tlist<Throw extends boolean = DThrow>(\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<ApiKeysListResponseItem[], Throw>>;\n\tlist(\n\t\topts?: CallOptions,\n\t): Promise<\n\t\tApiKeysListResponseItem[] | NeonResult<ApiKeysListResponseItem[]>\n\t> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client, signal) =>\n\t\t\t\tlistApiKeys({ client, throwOnError: false, signal }),\n\t\t\t(data) => data,\n\t\t);\n\t}\n\n\t/**\n\t * Create an API key. The returned `key` token is shown **once** — store it now.\n\t *\n\t * @apiCall POST /api_keys\n\t */\n\tcreate(keyName: string): Promise<Outcome<ApiKeyCreateResponse, DThrow>>;\n\tcreate<Throw extends boolean = DThrow>(\n\t\tkeyName: string,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<ApiKeyCreateResponse, Throw>>;\n\tcreate(\n\t\tkeyName: string,\n\t\topts?: CallOptions,\n\t): Promise<ApiKeyCreateResponse | NeonResult<ApiKeyCreateResponse>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client, signal) =>\n\t\t\t\tcreateApiKey({\n\t\t\t\t\tclient,\n\t\t\t\t\tbody: { key_name: keyName },\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t\tsignal,\n\t\t\t\t}),\n\t\t\t(data) => data,\n\t\t);\n\t}\n\n\t/** @apiCall DELETE /api_keys/{key_id} */\n\trevoke(keyId: number): Promise<Outcome<ApiKeyRevokeResponse, DThrow>>;\n\trevoke<Throw extends boolean = DThrow>(\n\t\tkeyId: number,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<ApiKeyRevokeResponse, Throw>>;\n\trevoke(\n\t\tkeyId: number,\n\t\topts?: CallOptions,\n\t): Promise<ApiKeyRevokeResponse | NeonResult<ApiKeyRevokeResponse>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client, signal) =>\n\t\t\t\trevokeApiKey({\n\t\t\t\t\tclient,\n\t\t\t\t\tpath: { key_id: keyId },\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t\tsignal,\n\t\t\t\t}),\n\t\t\t(data) => data,\n\t\t);\n\t}\n}\n"],"mappings":";;;AAoBA,IAAa,OAAb,MAA0C;CACzC;CAEA,YAAY,KAAqB;EAChC,KAAKA,OAAO;CACb;CAOA,GACC,MACyE;EACzE,OAAO,KAAKA,KAAK,IAChB,OACC,QAAQ,WACR,mBAAmB;GAAE;GAAQ,cAAc;GAAO;EAAO,CAAC,IAC1D,SAAS,IACX;CACD;CAOA,cACC,MACuD;EACvD,OAAO,KAAKA,KAAK,IAChB,OACC,QAAQ,WACR,4BAA4B;GAC3B;GACA,cAAc;GACd;EACD,CAAC,IACD,SAAS,KAAK,aAChB;CACD;AACD;;AAGA,IAAa,UAAb,MAA6C;CAC5C;CAEA,YAAY,KAAqB;EAChC,KAAKA,OAAO;CACb;CAOA,KACC,MAC2D;EAC3D,OAAO,KAAKA,KAAK,IAChB,OACC,QAAQ,WACR,iBAAiB;GAAE;GAAQ,cAAc;GAAO;EAAO,CAAC,IACxD,SAAS,KAAK,OAChB;CACD;AACD;;AAGA,IAAa,UAAb,MAA6C;CAC5C;CAEA,YAAY,KAAqB;EAChC,KAAKA,OAAO;CACb;CAOA,KACC,MAGC;EACD,OAAO,KAAKA,KAAK,IAChB,OACC,QAAQ,WACR,YAAY;GAAE;GAAQ,cAAc;GAAO;EAAO,CAAC,IACnD,SAAS,IACX;CACD;CAYA,OACC,SACA,MACmE;EACnE,OAAO,KAAKA,KAAK,IAChB,OACC,QAAQ,WACR,aAAa;GACZ;GACA,MAAM,EAAE,UAAU,QAAQ;GAC1B,cAAc;GACd;EACD,CAAC,IACD,SAAS,IACX;CACD;CAQA,OACC,OACA,MACmE;EACnE,OAAO,KAAKA,KAAK,IAChB,OACC,QAAQ,WACR,aAAa;GACZ;GACA,MAAM,EAAE,QAAQ,MAAM;GACtB,cAAc;GACd;EACD,CAAC,IACD,SAAS,IACX;CACD;AACD"}
|
|
@@ -7,13 +7,14 @@ var AiGateway = class {
|
|
|
7
7
|
this.#ctx = ctx;
|
|
8
8
|
}
|
|
9
9
|
get(projectId, branchId, opts) {
|
|
10
|
-
return this.#ctx.run(opts, (client) => getProjectBranchAiGateway({
|
|
10
|
+
return this.#ctx.run(opts, (client, signal) => getProjectBranchAiGateway({
|
|
11
11
|
client,
|
|
12
12
|
path: {
|
|
13
13
|
project_id: projectId,
|
|
14
14
|
branch_id: branchId
|
|
15
15
|
},
|
|
16
|
-
throwOnError: false
|
|
16
|
+
throwOnError: false,
|
|
17
|
+
signal
|
|
17
18
|
}), (data) => data);
|
|
18
19
|
}
|
|
19
20
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-gateway.js","names":["#ctx"],"sources":["../../../src/neon/resources/ai-gateway.ts"],"sourcesContent":["import { getProjectBranchAiGateway } from \"../../client/sdk.gen.js\";\nimport type { BranchAiGateway } from \"../../client/types.gen.js\";\nimport type { CallOptions, RequestContext } from \"../context.js\";\nimport type { NeonResult, Outcome } from \"../result.js\";\n\n/** Branch-scoped AI Gateway endpoint metadata. */\nexport class AiGateway<DThrow extends boolean> {\n\treadonly #ctx: RequestContext;\n\n\tconstructor(ctx: RequestContext) {\n\t\tthis.#ctx = ctx;\n\t}\n\n\t/** @apiCall GET /projects/{project_id}/branches/{branch_id}/ai_gateway */\n\tget(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t): Promise<Outcome<BranchAiGateway, DThrow>>;\n\tget<Throw extends boolean = DThrow>(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<BranchAiGateway, Throw>>;\n\tget(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\topts?: CallOptions,\n\t): Promise<BranchAiGateway | NeonResult<BranchAiGateway>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client) =>\n\t\t\t\tgetProjectBranchAiGateway({\n\t\t\t\t\tclient,\n\t\t\t\t\tpath: { project_id: projectId, branch_id: branchId },\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t}),\n\t\t\t(data) => data,\n\t\t);\n\t}\n}\n"],"mappings":";;;AAMA,IAAa,YAAb,MAA+C;CAC9C;CAEA,YAAY,KAAqB;EAChC,KAAKA,OAAO;CACb;CAYA,IACC,WACA,UACA,MACyD;EACzD,OAAO,KAAKA,KAAK,IAChB,OACC,
|
|
1
|
+
{"version":3,"file":"ai-gateway.js","names":["#ctx"],"sources":["../../../src/neon/resources/ai-gateway.ts"],"sourcesContent":["import { getProjectBranchAiGateway } from \"../../client/sdk.gen.js\";\nimport type { BranchAiGateway } from \"../../client/types.gen.js\";\nimport type { CallOptions, RequestContext } from \"../context.js\";\nimport type { NeonResult, Outcome } from \"../result.js\";\n\n/** Branch-scoped AI Gateway endpoint metadata. */\nexport class AiGateway<DThrow extends boolean> {\n\treadonly #ctx: RequestContext;\n\n\tconstructor(ctx: RequestContext) {\n\t\tthis.#ctx = ctx;\n\t}\n\n\t/** @apiCall GET /projects/{project_id}/branches/{branch_id}/ai_gateway */\n\tget(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t): Promise<Outcome<BranchAiGateway, DThrow>>;\n\tget<Throw extends boolean = DThrow>(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\topts: CallOptions<Throw>,\n\t): Promise<Outcome<BranchAiGateway, Throw>>;\n\tget(\n\t\tprojectId: string,\n\t\tbranchId: string,\n\t\topts?: CallOptions,\n\t): Promise<BranchAiGateway | NeonResult<BranchAiGateway>> {\n\t\treturn this.#ctx.run(\n\t\t\topts,\n\t\t\t(client, signal) =>\n\t\t\t\tgetProjectBranchAiGateway({\n\t\t\t\t\tclient,\n\t\t\t\t\tpath: { project_id: projectId, branch_id: branchId },\n\t\t\t\t\tthrowOnError: false,\n\t\t\t\t\tsignal,\n\t\t\t\t}),\n\t\t\t(data) => data,\n\t\t);\n\t}\n}\n"],"mappings":";;;AAMA,IAAa,YAAb,MAA+C;CAC9C;CAEA,YAAY,KAAqB;EAChC,KAAKA,OAAO;CACb;CAYA,IACC,WACA,UACA,MACyD;EACzD,OAAO,KAAKA,KAAK,IAChB,OACC,QAAQ,WACR,0BAA0B;GACzB;GACA,MAAM;IAAE,YAAY;IAAW,WAAW;GAAS;GACnD,cAAc;GACd;EACD,CAAC,IACD,SAAS,IACX;CACD;AACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","names":[],"sources":["../../../src/neon/resources/auth.ts"],"mappings":";;;;;;cAqCa;EAAA,CAAA,OAAA;EAAkB,WAAA,CAAA,GAAA,EAGb,cAHa;EAGb;EAQE,IAAA,CAAA,SAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,CAAA,EAAhB,OAAgB,CAAR,OAAQ,CAAA,qBAAA,EAAA,EAAyB,MAAzB,CAAA,CAAA;EAAyB,IAAA,CAAA,cAAA,OAAA,GACf,MADe,CAAA,CAAA,SAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,IAAA,EAIrC,WAJqC,CAIzB,KAJyB,CAAA,CAAA,EAKzC,OALyC,CAKjC,OALiC,CAKzB,qBALyB,EAAA,EAKA,KALA,CAAA,CAAA;EAAjC;EAAR,GAAA,CAAA,SAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,KAAA,
|
|
1
|
+
{"version":3,"file":"auth.d.ts","names":[],"sources":["../../../src/neon/resources/auth.ts"],"mappings":";;;;;;cAqCa;EAAA,CAAA,OAAA;EAAkB,WAAA,CAAA,GAAA,EAGb,cAHa;EAGb;EAQE,IAAA,CAAA,SAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,CAAA,EAAhB,OAAgB,CAAR,OAAQ,CAAA,qBAAA,EAAA,EAAyB,MAAzB,CAAA,CAAA;EAAyB,IAAA,CAAA,cAAA,OAAA,GACf,MADe,CAAA,CAAA,SAAA,EAAA,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