@flytedesk/app-kit 3.2.2 → 3.2.3
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
CHANGED
|
@@ -75,6 +75,33 @@ isn't one) — e.g. `error={consumeSignInError()}` straight into
|
|
|
75
75
|
`@flytedan/flytebot-design-system`'s `SignInPage` (0.21.0+). `@flytedesk/app-kit` itself
|
|
76
76
|
never depends on the design system; this returns a plain string.
|
|
77
77
|
|
|
78
|
+
## BigQuery (`@flytedesk/app-kit/bigquery`)
|
|
79
|
+
|
|
80
|
+
This module takes no hard dependency on any GCP SDK — every function accepts a
|
|
81
|
+
structural `BigQueryLike` (see `src/bigquery/types.ts`), which a real
|
|
82
|
+
`@google-cloud/bigquery` `BigQuery` instance satisfies via TypeScript's
|
|
83
|
+
structural typing, with no wrapping required:
|
|
84
|
+
|
|
85
|
+
```ts
|
|
86
|
+
import { BigQuery } from "@google-cloud/bigquery";
|
|
87
|
+
import { createBigQueryReadClient } from "@flytedesk/app-kit/bigquery";
|
|
88
|
+
|
|
89
|
+
const client = createBigQueryReadClient(new BigQuery());
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
**Supported `@google-cloud/bigquery` version range: `^9.0.0`** (verified against
|
|
93
|
+
`9.1.0`). `AK-21` added a compile-time conformance test
|
|
94
|
+
(`src/bigquery/type-safety.test.ts`, run as part of `npm run check`) that
|
|
95
|
+
type-checks the real SDK's `BigQuery`/`Dataset`/`Table`/`Job` classes against
|
|
96
|
+
this module's own `BigQueryLike` — the same real-vs-structural mismatch that
|
|
97
|
+
forced three unplanned patch releases on 2026-09-25 (3.2.0 → 3.2.2, each
|
|
98
|
+
fixing one drift a consuming app only found after publishing: the query
|
|
99
|
+
`types` option shape, `Job#id` optionality, the `getQueryResults` tuple
|
|
100
|
+
shape, the extract `format` literal, and the load `schema` shape) now fails
|
|
101
|
+
app-kit's own gate instead. Bumping the supported range means re-running that
|
|
102
|
+
test against the new version and updating this section — a passing gate is
|
|
103
|
+
the actual proof, not this paragraph.
|
|
104
|
+
|
|
78
105
|
## Publishing
|
|
79
106
|
|
|
80
107
|
Published to the public npm registry under the `@flytedesk` org, access `restricted`.
|
|
@@ -10,6 +10,13 @@ export declare class BadQueryError extends BigQueryReadError {
|
|
|
10
10
|
export declare class PermissionDeniedError extends BigQueryReadError {
|
|
11
11
|
constructor(message: string, cause?: unknown);
|
|
12
12
|
}
|
|
13
|
+
/** BigQuery's own rate-limit/quota class of error (e.g. "too many table
|
|
14
|
+
* update operations for this table" on a load job). Transient — distinct
|
|
15
|
+
* from PermissionDeniedError so a caller (or an operator reading logs)
|
|
16
|
+
* doesn't chase IAM for what's actually a retryable quota condition. */
|
|
17
|
+
export declare class RateLimitExceededError extends BigQueryReadError {
|
|
18
|
+
constructor(message: string, cause?: unknown);
|
|
19
|
+
}
|
|
13
20
|
/** A dry-run estimate exceeded the caller-supplied byte budget — thrown
|
|
14
21
|
* before any billable query actually runs. */
|
|
15
22
|
export declare class DryRunBudgetExceededError extends BigQueryReadError {
|
package/dist/bigquery/errors.js
CHANGED
|
@@ -20,6 +20,16 @@ export class PermissionDeniedError extends BigQueryReadError {
|
|
|
20
20
|
this.name = "PermissionDeniedError";
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
+
/** BigQuery's own rate-limit/quota class of error (e.g. "too many table
|
|
24
|
+
* update operations for this table" on a load job). Transient — distinct
|
|
25
|
+
* from PermissionDeniedError so a caller (or an operator reading logs)
|
|
26
|
+
* doesn't chase IAM for what's actually a retryable quota condition. */
|
|
27
|
+
export class RateLimitExceededError extends BigQueryReadError {
|
|
28
|
+
constructor(message, cause) {
|
|
29
|
+
super(message, cause);
|
|
30
|
+
this.name = "RateLimitExceededError";
|
|
31
|
+
}
|
|
32
|
+
}
|
|
23
33
|
/** A dry-run estimate exceeded the caller-supplied byte budget — thrown
|
|
24
34
|
* before any billable query actually runs. */
|
|
25
35
|
export class DryRunBudgetExceededError extends BigQueryReadError {
|
|
@@ -68,6 +78,9 @@ export function classifyBigQueryError(err) {
|
|
|
68
78
|
const message = detail?.message ??
|
|
69
79
|
apiErr?.message ??
|
|
70
80
|
(err instanceof Error ? err.message : String(err));
|
|
81
|
+
if (reason && RATE_LIMIT_REASONS.has(reason)) {
|
|
82
|
+
return new RateLimitExceededError(message, err);
|
|
83
|
+
}
|
|
71
84
|
if (reason && PERMISSION_DENIED_REASONS.has(reason)) {
|
|
72
85
|
return new PermissionDeniedError(message, err);
|
|
73
86
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/bigquery/errors.ts"],"names":[],"mappings":"AAQA,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IAGxB;IAFlB,YACE,OAAe,EACC,KAAe;QAE/B,KAAK,CAAC,OAAO,CAAC,CAAC;QAFC,UAAK,GAAL,KAAK,CAAU;QAG/B,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC;IAClC,CAAC;CACF;AAED,+DAA+D;AAC/D,MAAM,OAAO,aAAc,SAAQ,iBAAiB;IAClD,YAAY,OAAe,EAAE,KAAe;QAC1C,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QACtB,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;IAC9B,CAAC;CACF;AAED,2EAA2E;AAC3E,MAAM,OAAO,qBAAsB,SAAQ,iBAAiB;IAC1D,YAAY,OAAe,EAAE,KAAe;QAC1C,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QACtB,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;IACtC,CAAC;CACF;AAED;+CAC+C;AAC/C,MAAM,OAAO,yBAA0B,SAAQ,iBAAiB;IAE5C;IACA;IAFlB,YACkB,mBAA2B,EAC3B,cAAsB;QAEtC,KAAK,CACH,uBAAuB,mBAAmB,sBAAsB,cAAc,cAAc,CAC7F,CAAC;QALc,wBAAmB,GAAnB,mBAAmB,CAAQ;QAC3B,m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yB,CAAC;IAEzC,IACE,MAAM,CAAC,MAAM,EAAE,IAAI,CACjB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,KAAK,SAAS,IAAI,kBAAkB,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAC9E,EACD,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,CACL,OAAO,MAAM,CAAC,OAAO,KAAK,QAAQ;QAClC,iCAAiC,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CACvD,CAAC;AACJ,CAAC"}
|
package/dist/bigquery/index.d.ts
CHANGED
|
@@ -46,5 +46,5 @@ export { loadRowsWithRetry } from "./load.js";
|
|
|
46
46
|
export type { LoadRowsOptions } from "./load.js";
|
|
47
47
|
export { buildJobLabels, sanitizeLabelValue } from "./labels.js";
|
|
48
48
|
export { unwrapBigQueryCount, unwrapBigQueryValue } from "./values.js";
|
|
49
|
-
export { BadQueryError, BigQueryReadError, DryRunBudgetExceededError, PermissionDeniedError, classifyBigQueryError, isRetryableBigQueryError, } from "./errors.js";
|
|
49
|
+
export { BadQueryError, BigQueryReadError, DryRunBudgetExceededError, PermissionDeniedError, RateLimitExceededError, classifyBigQueryError, isRetryableBigQueryError, } from "./errors.js";
|
|
50
50
|
export type { BigQueryApiErrorDetail, BigQueryCreateQueryJobOptions, BigQueryDatasetLike, BigQueryExtractOptions, BigQueryJobLike, BigQueryJobMetadata, BigQueryLike, BigQueryLoadOptions, BigQueryNextQuery, BigQueryQueryResultsOptions, BigQuerySchemaField, BigQueryTableLike, BigQueryWriteStreamLike, DryRunEstimate, EstimateQueryBytesOptions, ExtractJobHandle, ExtractJobState, ExtractJobStatus, ExtractTableToGCSInput, GcsFileLike, JobLabelInput, QueryPage, RunQueryOptions, WaitForExtractJobOptions, } from "./types.js";
|
package/dist/bigquery/index.js
CHANGED
|
@@ -44,5 +44,5 @@ export { extractTableToGCS, getExtractJobStatus, waitForExtractJob, } from "./ex
|
|
|
44
44
|
export { loadRowsWithRetry } from "./load.js";
|
|
45
45
|
export { buildJobLabels, sanitizeLabelValue } from "./labels.js";
|
|
46
46
|
export { unwrapBigQueryCount, unwrapBigQueryValue } from "./values.js";
|
|
47
|
-
export { BadQueryError, BigQueryReadError, DryRunBudgetExceededError, PermissionDeniedError, classifyBigQueryError, isRetryableBigQueryError, } from "./errors.js";
|
|
47
|
+
export { BadQueryError, BigQueryReadError, DryRunBudgetExceededError, PermissionDeniedError, RateLimitExceededError, classifyBigQueryError, isRetryableBigQueryError, } from "./errors.js";
|
|
48
48
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/bigquery/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAMvD,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAE5E,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAG9C,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjE,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEvE,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,yBAAyB,EACzB,qBAAqB,EACrB,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/bigquery/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAMvD,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAE5E,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAG9C,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjE,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEvE,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,yBAAyB,EACzB,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,aAAa,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flytedesk/app-kit",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.3",
|
|
4
4
|
"description": "Shared platform kit for flytedesk apps: flytedesk-id auth (BFF/OIDC client) and a Postgres-native trace/audit layer.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -116,6 +116,7 @@
|
|
|
116
116
|
"@arethetypeswrong/cli": "^0.18.5",
|
|
117
117
|
"@changesets/changelog-github": "^1.0.0",
|
|
118
118
|
"@changesets/cli": "^3.0.1",
|
|
119
|
+
"@google-cloud/bigquery": "^9.1.0",
|
|
119
120
|
"@prisma/client": "^7.10.0",
|
|
120
121
|
"@testcontainers/postgresql": "^12.1.0",
|
|
121
122
|
"@testing-library/react": "^16.3.3",
|