@polardbx/pxbaas-client 0.1.0-beta.1 → 0.1.0-beta.10
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 +57 -0
- package/dist/drivers/apps.driver.d.ts +33 -0
- package/dist/drivers/apps.driver.d.ts.map +1 -1
- package/dist/drivers/apps.driver.js +8 -0
- package/dist/drivers/apps.driver.js.map +1 -1
- package/dist/drivers/meta.driver.d.ts +3 -0
- package/dist/drivers/meta.driver.d.ts.map +1 -1
- package/dist/drivers/meta.driver.js +22 -15
- package/dist/drivers/meta.driver.js.map +1 -1
- package/dist/drivers/share-links.driver.d.ts.map +1 -1
- package/dist/drivers/share-links.driver.js +7 -5
- package/dist/drivers/share-links.driver.js.map +1 -1
- package/dist/drivers/storage.driver.d.ts +21 -6
- package/dist/drivers/storage.driver.d.ts.map +1 -1
- package/dist/drivers/storage.driver.js +44 -33
- package/dist/drivers/storage.driver.js.map +1 -1
- package/dist/drivers/tenant-admin.driver.d.ts +130 -0
- package/dist/drivers/tenant-admin.driver.d.ts.map +1 -0
- package/dist/drivers/tenant-admin.driver.js +222 -0
- package/dist/drivers/tenant-admin.driver.js.map +1 -0
- package/dist/drivers/tenant-ddl.driver.d.ts +106 -0
- package/dist/drivers/tenant-ddl.driver.d.ts.map +1 -0
- package/dist/drivers/tenant-ddl.driver.js +131 -0
- package/dist/drivers/tenant-ddl.driver.js.map +1 -0
- package/dist/drivers/zero.driver.d.ts +51 -4
- package/dist/drivers/zero.driver.d.ts.map +1 -1
- package/dist/drivers/zero.driver.js +51 -3
- package/dist/drivers/zero.driver.js.map +1 -1
- package/dist/errors.d.ts +37 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +64 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -7,12 +7,20 @@
|
|
|
7
7
|
* Contract source: https://zero.polardbx.com/BAAS-SKILL.md (polardbx-zero-pxbaas v0.1.0)
|
|
8
8
|
*
|
|
9
9
|
* Endpoints:
|
|
10
|
-
* - POST /api/v1/supabase/instances
|
|
11
|
-
* - GET /api/v1/supabase/instances
|
|
12
|
-
* - DELETE /api/v1/supabase/instances/{id}
|
|
10
|
+
* - POST /api/v1/supabase/instances claim (body: { whitelistIp? })
|
|
11
|
+
* - GET /api/v1/supabase/instances list (needs pxz_token cookie)
|
|
12
|
+
* - DELETE /api/v1/supabase/instances/{id} release (needs pxz_token cookie; id = sbx_*)
|
|
13
|
+
* - GET /api/v1/supabase/instances/{cloudId}/whitelist query whitelist (Studio-credential hash; cloudId = pxsp-*)
|
|
14
|
+
* - PUT /api/v1/supabase/instances/{cloudId}/whitelist append whitelist (Studio-credential hash; append-only)
|
|
13
15
|
*
|
|
14
16
|
* Ownership: the claim response returns a `token` (also set as the `pxz_token`
|
|
15
17
|
* cookie). list/release must send it back via `Cookie: pxz_token=<token>`.
|
|
18
|
+
*
|
|
19
|
+
* The whitelist self-service API uses a DIFFERENT auth + id space: an
|
|
20
|
+
* `X-Studio-User: supabase` / `X-Studio-Hash: sha256hex("supabase:"+dashboardPassword)`
|
|
21
|
+
* pair, and the cloud instance id (`pxsp-*`, derived from the public endpoint host),
|
|
22
|
+
* not the `sbx_*` ownership id. Callers compute the hash (see apps/baas
|
|
23
|
+
* instance/zero-whitelist.ts) and pass it in; the password/hash is never logged.
|
|
16
24
|
*/
|
|
17
25
|
import { AxiosError } from 'axios';
|
|
18
26
|
export interface ZeroInstance {
|
|
@@ -44,13 +52,32 @@ export interface ZeroClaimResponse {
|
|
|
44
52
|
instance: ZeroInstance;
|
|
45
53
|
token: string;
|
|
46
54
|
}
|
|
55
|
+
/** Result of `GET .../{cloudId}/whitelist` (flat success body). */
|
|
56
|
+
export interface ZeroWhitelist {
|
|
57
|
+
instanceId: string;
|
|
58
|
+
groupName: string;
|
|
59
|
+
/** Comma-separated effective entries (excludes the system 127.0.0.1 baseline). */
|
|
60
|
+
whitelist: string;
|
|
61
|
+
/** Where the value came from, e.g. "zero-record". */
|
|
62
|
+
source: string;
|
|
63
|
+
expiresAt?: string;
|
|
64
|
+
updatedAt?: string;
|
|
65
|
+
}
|
|
66
|
+
/** Result of `PUT .../{cloudId}/whitelist` (append-only; flat success body). */
|
|
67
|
+
export interface ZeroWhitelistAppendResult {
|
|
68
|
+
instanceId: string;
|
|
69
|
+
groupName: string;
|
|
70
|
+
appliedIps: string;
|
|
71
|
+
effectiveWhitelist: string;
|
|
72
|
+
cloudRequestId?: string;
|
|
73
|
+
}
|
|
47
74
|
export interface ZeroDriverOptions {
|
|
48
75
|
/** Zero API base URL. Defaults to https://zero.polardbx.com (override via BAAS_ZERO_ENDPOINT). */
|
|
49
76
|
baseUrl?: string;
|
|
50
77
|
timeout?: number;
|
|
51
78
|
}
|
|
52
79
|
/** Error codes returned by Zero (`{ error: { code, message } }`). */
|
|
53
|
-
export type ZeroErrorCode = 'INVALID_WHITELIST_IP' | 'INSTANCE_NOT_FOUND' | 'RATE_LIMIT_EXCEEDED' | 'SUPABASE_LIMIT_REACHED' | 'SUPABASE_POOL_EXHAUSTED' | 'SUPABASE_DISABLED' | 'INTERNAL_ERROR' | 'NETWORK_ERROR' | 'UNKNOWN';
|
|
80
|
+
export type ZeroErrorCode = 'INVALID_WHITELIST_IP' | 'INSTANCE_NOT_FOUND' | 'RATE_LIMIT_EXCEEDED' | 'SUPABASE_LIMIT_REACHED' | 'SUPABASE_POOL_EXHAUSTED' | 'SUPABASE_DISABLED' | 'INTERNAL_ERROR' | 'NETWORK_ERROR' | 'UNKNOWN' | 'INVALID_PARAMETER' | 'IP_MISMATCH' | 'ASSIGNMENT_EXPIRED' | 'STUDIO_CREDENTIALS_INVALID' | 'INSTANCE_NOT_ACCESSIBLE' | 'INSTANCE_BUSY' | 'CONCURRENT_UPDATE' | 'CREDENTIALS_UNAVAILABLE' | 'WHITELIST_MODIFY_FAILED';
|
|
54
81
|
export declare class ZeroError extends Error {
|
|
55
82
|
code: ZeroErrorCode;
|
|
56
83
|
status?: number;
|
|
@@ -58,6 +85,8 @@ export declare class ZeroError extends Error {
|
|
|
58
85
|
}
|
|
59
86
|
export declare class ZeroDriver {
|
|
60
87
|
private client;
|
|
88
|
+
/** The whitelist API fixes the Studio user to `supabase` (see spec). */
|
|
89
|
+
private static readonly STUDIO_USER;
|
|
61
90
|
constructor(options?: ZeroDriverOptions);
|
|
62
91
|
/** Claim a new instance. Unauthenticated. Optionally whitelist extra IPs. */
|
|
63
92
|
claim(whitelistIp?: string): Promise<ZeroClaimResponse>;
|
|
@@ -65,6 +94,24 @@ export declare class ZeroDriver {
|
|
|
65
94
|
list(token: string): Promise<ZeroInstance[]>;
|
|
66
95
|
/** Release (destroy) an instance. Requires the ownership token. */
|
|
67
96
|
release(id: string, token: string): Promise<void>;
|
|
97
|
+
/**
|
|
98
|
+
* Query the effective IP whitelist of a Zero instance.
|
|
99
|
+
* Auth: Studio-credential hash (NOT the pxz_token). `cloudInstanceId` is the
|
|
100
|
+
* `pxsp-*` id (see ZeroDriver.cloudInstanceId), not the `sbx_*` ownership id.
|
|
101
|
+
*/
|
|
102
|
+
getWhitelist(cloudInstanceId: string, studioHash: string): Promise<ZeroWhitelist>;
|
|
103
|
+
/**
|
|
104
|
+
* Append IPs/CIDRs to the whitelist (append-only and idempotent: existing
|
|
105
|
+
* entries are kept, duplicates are not added). Same auth/id space as getWhitelist.
|
|
106
|
+
*/
|
|
107
|
+
appendWhitelist(cloudInstanceId: string, ips: string, studioHash: string): Promise<ZeroWhitelistAppendResult>;
|
|
108
|
+
/**
|
|
109
|
+
* Derive the cloud instance id (`pxsp-*`) from a public/intranet endpoint or
|
|
110
|
+
* bare host. The platform inserts an `http`/`https` infix before the registrable
|
|
111
|
+
* domain on the public host (e.g. `pxsp-abc123http.pxbaas...`); strip scheme,
|
|
112
|
+
* path, port, then the trailing infix from the first label.
|
|
113
|
+
*/
|
|
114
|
+
static cloudInstanceId(endpointOrHost: string): string;
|
|
68
115
|
/**
|
|
69
116
|
* Normalize the publicEndpoint (host:8000, no scheme) into a base URL.
|
|
70
117
|
* Prefers dashboardUrl when it already carries a scheme.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zero.driver.d.ts","sourceRoot":"","sources":["../../src/drivers/zero.driver.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"zero.driver.d.ts","sourceRoot":"","sources":["../../src/drivers/zero.driver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAc,EAAiB,UAAU,EAAE,MAAM,OAAO,CAAC;AAEzD,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,6FAA6F;IAC7F,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iFAAiF;IACjF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE;QACV,QAAQ,EAAE,MAAM,CAAC;QACjB,MAAM,EAAE,MAAM,CAAC;QACf,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,YAAY,CAAC;I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GAAE,iBAAsB;IAa3C,6EAA6E;IACvE,KAAK,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAe7D,8EAA8E;IACxE,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAalD,mEAAmE;IAC7D,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IASvD;;;;OAIG;IACG,YAAY,CAAC,eAAe,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAWvF;;;OAGG;IACG,eAAe,CACnB,eAAe,EAAE,MAAM,EACvB,GAAG,EAAE,MAAM,EACX,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,yBAAyB,CAAC;IAYrC;;;;;OAKG;IACH,MAAM,CAAC,eAAe,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM;IAatD;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,GAAG,MAAM;IAQlE,OAAO,CAAC,OAAO;IAOf,OAAO,CAAC,cAAc;CAUvB;AAED,2DAA2D;AAC3D,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,UAAU,CAE9D"}
|
|
@@ -7,12 +7,20 @@
|
|
|
7
7
|
* Contract source: https://zero.polardbx.com/BAAS-SKILL.md (polardbx-zero-pxbaas v0.1.0)
|
|
8
8
|
*
|
|
9
9
|
* Endpoints:
|
|
10
|
-
* - POST /api/v1/supabase/instances
|
|
11
|
-
* - GET /api/v1/supabase/instances
|
|
12
|
-
* - DELETE /api/v1/supabase/instances/{id}
|
|
10
|
+
* - POST /api/v1/supabase/instances claim (body: { whitelistIp? })
|
|
11
|
+
* - GET /api/v1/supabase/instances list (needs pxz_token cookie)
|
|
12
|
+
* - DELETE /api/v1/supabase/instances/{id} release (needs pxz_token cookie; id = sbx_*)
|
|
13
|
+
* - GET /api/v1/supabase/instances/{cloudId}/whitelist query whitelist (Studio-credential hash; cloudId = pxsp-*)
|
|
14
|
+
* - PUT /api/v1/supabase/instances/{cloudId}/whitelist append whitelist (Studio-credential hash; append-only)
|
|
13
15
|
*
|
|
14
16
|
* Ownership: the claim response returns a `token` (also set as the `pxz_token`
|
|
15
17
|
* cookie). list/release must send it back via `Cookie: pxz_token=<token>`.
|
|
18
|
+
*
|
|
19
|
+
* The whitelist self-service API uses a DIFFERENT auth + id space: an
|
|
20
|
+
* `X-Studio-User: supabase` / `X-Studio-Hash: sha256hex("supabase:"+dashboardPassword)`
|
|
21
|
+
* pair, and the cloud instance id (`pxsp-*`, derived from the public endpoint host),
|
|
22
|
+
* not the `sbx_*` ownership id. Callers compute the hash (see apps/baas
|
|
23
|
+
* instance/zero-whitelist.ts) and pass it in; the password/hash is never logged.
|
|
16
24
|
*/
|
|
17
25
|
import axios from 'axios';
|
|
18
26
|
export class ZeroError extends Error {
|
|
@@ -28,6 +36,8 @@ export class ZeroError extends Error {
|
|
|
28
36
|
const DEFAULT_BASE_URL = 'https://zero.polardbx.com';
|
|
29
37
|
export class ZeroDriver {
|
|
30
38
|
client;
|
|
39
|
+
/** The whitelist API fixes the Studio user to `supabase` (see spec). */
|
|
40
|
+
static STUDIO_USER = 'supabase';
|
|
31
41
|
constructor(options = {}) {
|
|
32
42
|
const baseUrl = options.baseUrl ?? process.env.BAAS_ZERO_ENDPOINT ?? DEFAULT_BASE_URL;
|
|
33
43
|
this.client = axios.create({
|
|
@@ -78,6 +88,44 @@ export class ZeroDriver {
|
|
|
78
88
|
throw this.toError(res.status, res.data);
|
|
79
89
|
}
|
|
80
90
|
}
|
|
91
|
+
/**
|
|
92
|
+
* Query the effective IP whitelist of a Zero instance.
|
|
93
|
+
* Auth: Studio-credential hash (NOT the pxz_token). `cloudInstanceId` is the
|
|
94
|
+
* `pxsp-*` id (see ZeroDriver.cloudInstanceId), not the `sbx_*` ownership id.
|
|
95
|
+
*/
|
|
96
|
+
async getWhitelist(cloudInstanceId, studioHash) {
|
|
97
|
+
const res = await this.client.get(`/api/v1/supabase/instances/${encodeURIComponent(cloudInstanceId)}/whitelist`, { headers: { 'X-Studio-User': ZeroDriver.STUDIO_USER, 'X-Studio-Hash': studioHash } });
|
|
98
|
+
if (res.status !== 200) {
|
|
99
|
+
throw this.toError(res.status, res.data);
|
|
100
|
+
}
|
|
101
|
+
return res.data;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Append IPs/CIDRs to the whitelist (append-only and idempotent: existing
|
|
105
|
+
* entries are kept, duplicates are not added). Same auth/id space as getWhitelist.
|
|
106
|
+
*/
|
|
107
|
+
async appendWhitelist(cloudInstanceId, ips, studioHash) {
|
|
108
|
+
const res = await this.client.put(`/api/v1/supabase/instances/${encodeURIComponent(cloudInstanceId)}/whitelist`, { ips }, { headers: { 'X-Studio-User': ZeroDriver.STUDIO_USER, 'X-Studio-Hash': studioHash } });
|
|
109
|
+
if (res.status !== 200) {
|
|
110
|
+
throw this.toError(res.status, res.data);
|
|
111
|
+
}
|
|
112
|
+
return res.data;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Derive the cloud instance id (`pxsp-*`) from a public/intranet endpoint or
|
|
116
|
+
* bare host. The platform inserts an `http`/`https` infix before the registrable
|
|
117
|
+
* domain on the public host (e.g. `pxsp-abc123http.pxbaas...`); strip scheme,
|
|
118
|
+
* path, port, then the trailing infix from the first label.
|
|
119
|
+
*/
|
|
120
|
+
static cloudInstanceId(endpointOrHost) {
|
|
121
|
+
const host = endpointOrHost.replace(/^https?:\/\//, '').split('/')[0].split(':')[0];
|
|
122
|
+
const firstLabel = host.split('.')[0] ?? '';
|
|
123
|
+
const id = firstLabel.replace(/https?$/, '');
|
|
124
|
+
if (!/^pxsp-/.test(id)) {
|
|
125
|
+
throw new ZeroError('INVALID_PARAMETER', `Cannot derive a pxsp- cloud instance id from '${endpointOrHost}'`);
|
|
126
|
+
}
|
|
127
|
+
return id;
|
|
128
|
+
}
|
|
81
129
|
/**
|
|
82
130
|
* Normalize the publicEndpoint (host:8000, no scheme) into a base URL.
|
|
83
131
|
* Prefers dashboardUrl when it already carries a scheme.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zero.driver.js","sourceRoot":"","sources":["../../src/drivers/zero.driver.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"zero.driver.js","sourceRoot":"","sources":["../../src/drivers/zero.driver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAoC,MAAM,OAAO,CAAC;AAkFzD,MAAM,OAAO,SAAU,SAAQ,KAAK;IAClC,IAAI,CAAgB;IACpB,MAAM,CAAU;IAChB,YAAY,IAAmB,EAAE,OAAe,EAAE,MAAe;QAC/D,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;CACF;AAED,MAAM,gBAAgB,GAAG,2BAA2B,CAAC;AAErD,MAAM,OAAO,UAAU;IACb,MAAM,CAAgB;IAE9B,wEAAwE;IAChE,MAAM,CAAU,WAAW,GAAG,UAAU,CAAC;IAEjD,YAAY,UAA6B,EAAE;QACzC,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,gBAAgB,CAAC;QACtF,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;YACzB,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;YACnC,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,KAAK;YACjC,uEAAuE;YACvE,4EAA4E;YAC5E,0EAA0E;YAC1E,oDAAoD;Y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CAAC;QACD,MAAM,IAAI,GAAG,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACpF,OAAO,GAAG,MAAM,MAAM,IAAI,EAAE,CAAC;IAC/B,CAAC;IAEO,OAAO,CAAC,MAAc,EAAE,IAAa;QAC3C,MAAM,GAAG,GAAI,IAAwD,EAAE,KAAK,CAAC;QAC7E,MAAM,IAAI,GAAI,GAAG,EAAE,IAAsB,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;QACzE,MAAM,OAAO,GAAG,GAAG,EAAE,OAAO,IAAI,wBAAwB,MAAM,GAAG,CAAC;QAClE,OAAO,IAAI,SAAS,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IAC9C,CAAC;IAEO,cAAc,CAAC,MAAc;QACnC,IAAI,MAAM,KAAK,GAAG;YAAE,OAAO,qBAAqB,CAAC;QACjD,IAAI,MAAM,KAAK,GAAG;YAAE,OAAO,yBAAyB,CAAC;QACrD,IAAI,MAAM,KAAK,GAAG;YAAE,OAAO,oBAAoB,CAAC;QAChD,IAAI,MAAM,IAAI,GAAG;YAAE,OAAO,gBAAgB,CAAC;QAC3C,+EAA+E;QAC/E,+EAA+E;QAC/E,6EAA6E;QAC7E,OAAO,SAAS,CAAC;IACnB,CAAC;;AAGH,2DAA2D;AAC3D,MAAM,UAAU,kBAAkB,CAAC,CAAU;IAC3C,OAAO,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;AAC/B,CAAC"}
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared API error formatting for all drivers.
|
|
3
|
+
*
|
|
4
|
+
* WHY: Storage/Meta error bodies are `{ statusCode, error, message }` where
|
|
5
|
+
* `error` is a coarse category (literally "Error" for Storage 400s) and
|
|
6
|
+
* `message` carries the actionable detail. Each driver used to prefer `error`
|
|
7
|
+
* and hard-coded 401/403/404 texts that swallowed the server `message`
|
|
8
|
+
* entirely, so users saw e.g. `Storage API error (400): Error` instead of
|
|
9
|
+
* `body must have required property 'prefix'`.
|
|
10
|
+
*
|
|
11
|
+
* Contract: always throws a plain `Error` whose message starts with
|
|
12
|
+
* `<source> API error (<status>): ` — upper layers match on that text, so do
|
|
13
|
+
* not introduce custom error classes or codes here.
|
|
14
|
+
*/
|
|
15
|
+
/** Minimal view of an AxiosResponse so drivers can pass plain object literals. */
|
|
16
|
+
export interface ApiErrorInfo {
|
|
17
|
+
status?: number;
|
|
18
|
+
data?: unknown;
|
|
19
|
+
/** Transport-level message (axiosError.message); used when there is no response body. */
|
|
20
|
+
fallbackMessage?: string;
|
|
21
|
+
/** Debug context appended verbatim under `--debug`. */
|
|
22
|
+
debug?: {
|
|
23
|
+
method?: string;
|
|
24
|
+
url?: string;
|
|
25
|
+
/** Response body serialized by the caller. */
|
|
26
|
+
responseBody?: string;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export interface FormatApiErrorOptions {
|
|
30
|
+
/** Friendly texts per HTTP status; the server message (if any) is appended after them. */
|
|
31
|
+
statusTexts?: Partial<Record<401 | 403 | 404, string>>;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Build the error for a failed API call and throw it as a plain `Error`.
|
|
35
|
+
*/
|
|
36
|
+
export declare function formatApiError(source: string, info: ApiErrorInfo, options?: FormatApiErrorOptions): never;
|
|
37
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,kFAAkF;AAClF,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,yFAAyF;IACzF,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,uDAAuD;IACvD,KAAK,CAAC,EAAE;QACN,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,8CAA8C;QAC9C,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC;CACH;AAED,MAAM,WAAW,qBAAqB;IACpC,0FAA0F;IAC1F,WAAW,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG,GAAG,GAAG,GAAG,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC;CACxD;AAaD;;GAEG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,YAAY,EAClB,OAAO,GAAE,qBAA0B,GAClC,KAAK,CAoCP"}
|
package/dist/errors.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared API error formatting for all drivers.
|
|
3
|
+
*
|
|
4
|
+
* WHY: Storage/Meta error bodies are `{ statusCode, error, message }` where
|
|
5
|
+
* `error` is a coarse category (literally "Error" for Storage 400s) and
|
|
6
|
+
* `message` carries the actionable detail. Each driver used to prefer `error`
|
|
7
|
+
* and hard-coded 401/403/404 texts that swallowed the server `message`
|
|
8
|
+
* entirely, so users saw e.g. `Storage API error (400): Error` instead of
|
|
9
|
+
* `body must have required property 'prefix'`.
|
|
10
|
+
*
|
|
11
|
+
* Contract: always throws a plain `Error` whose message starts with
|
|
12
|
+
* `<source> API error (<status>): ` — upper layers match on that text, so do
|
|
13
|
+
* not introduce custom error classes or codes here.
|
|
14
|
+
*/
|
|
15
|
+
function asRecord(value) {
|
|
16
|
+
return typeof value === 'object' && value !== null ? value : undefined;
|
|
17
|
+
}
|
|
18
|
+
function firstString(...candidates) {
|
|
19
|
+
for (const candidate of candidates) {
|
|
20
|
+
if (typeof candidate === 'string' && candidate.trim() !== '')
|
|
21
|
+
return candidate;
|
|
22
|
+
}
|
|
23
|
+
return undefined;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Build the error for a failed API call and throw it as a plain `Error`.
|
|
27
|
+
*/
|
|
28
|
+
export function formatApiError(source, info, options = {}) {
|
|
29
|
+
const { status, data } = info;
|
|
30
|
+
const body = asRecord(data);
|
|
31
|
+
// Share-Links nests details as `{ error: { message } }`; Meta/Storage use flat
|
|
32
|
+
// `{ error, message }`. `message` always wins over the coarse `error` category.
|
|
33
|
+
const nested = asRecord(body?.error);
|
|
34
|
+
const detail = firstString(body?.message, nested?.message, body?.error);
|
|
35
|
+
const friendly = status !== undefined
|
|
36
|
+
? options.statusTexts?.[status]
|
|
37
|
+
: undefined;
|
|
38
|
+
let message;
|
|
39
|
+
if (friendly) {
|
|
40
|
+
message = detail ? `${friendly} Server said: ${detail}` : friendly;
|
|
41
|
+
}
|
|
42
|
+
else if (detail) {
|
|
43
|
+
// Keep the category as a prefix only when it adds information beyond the detail.
|
|
44
|
+
const category = typeof body?.error === 'string' && body.error !== detail ? `${body.error}: ` : '';
|
|
45
|
+
message = `${category}${detail}`;
|
|
46
|
+
}
|
|
47
|
+
else if (body === undefined && info.fallbackMessage) {
|
|
48
|
+
// No JSON body at all (network failure / gateway HTML): keep the transport message.
|
|
49
|
+
message = info.fallbackMessage;
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
message = 'no error body';
|
|
53
|
+
}
|
|
54
|
+
if (info.debug) {
|
|
55
|
+
const method = info.debug.method ?? 'unknown';
|
|
56
|
+
const url = info.debug.url ?? 'unknown';
|
|
57
|
+
message += `\n[debug] ${method.toUpperCase()} ${url} -> ${status ?? 'unknown'}`;
|
|
58
|
+
if (info.debug.responseBody !== undefined) {
|
|
59
|
+
message += `\n[debug] response body: ${info.debug.responseBody}`;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
throw new Error(`${source} API error (${status ?? 'unknown'}): ${message}`);
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
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,EAAE,CAAC;QAClB,iFAAiF;QACjF,MAAM,QAAQ,GAAG,OAAO,IAAI,EAAE,KAAK,KAAK,QAAQ,IAAI,IAAI,CAAC,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QACnG,OAAO,GAAG,GAAG,QAAQ,GAAG,MAAM,EAAE,CAAC;IACnC,CAAC;SAAM,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;QACtD,oFAAoF;QACpF,OAAO,GAAG,IAAI,CAAC,eAAe,CAAC;IACjC,CAAC;SAAM,CAAC;QACN,OAAO,GAAG,eAAe,CAAC;IAC5B,CAAC;IAED,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;QACf,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,IAAI,SAAS,CAAC;QAC9C,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,IAAI,SAAS,CAAC;QACxC,OAAO,IAAI,aAAa,MAAM,CAAC,WAAW,EAAE,IAAI,GAAG,OAAO,MAAM,IAAI,SAAS,EAAE,CAAC;QAChF,IAAI,IAAI,CAAC,KAAK,CAAC,YAAY,KAAK,SAAS,EAAE,CAAC;YAC1C,OAAO,IAAI,4BAA4B,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC;QACnE,CAAC;IACH,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,GAAG,MAAM,eAAe,MAAM,IAAI,SAAS,MAAM,OAAO,EAAE,CAAC,CAAC;AAC9E,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -14,11 +14,14 @@
|
|
|
14
14
|
* @packageDocumentation
|
|
15
15
|
*/
|
|
16
16
|
export * from "./types.js";
|
|
17
|
+
export * from "./errors.js";
|
|
17
18
|
export * from "./drivers/meta.driver.js";
|
|
18
19
|
export * from "./drivers/functions.driver.js";
|
|
19
20
|
export * from "./drivers/apps.driver.js";
|
|
20
21
|
export * from "./drivers/share-links.driver.js";
|
|
21
22
|
export * from "./drivers/storage.driver.js";
|
|
22
23
|
export * from "./drivers/auth-admin.driver.js";
|
|
24
|
+
export * from "./drivers/tenant-ddl.driver.js";
|
|
25
|
+
export * from "./drivers/tenant-admin.driver.js";
|
|
23
26
|
export * from "./drivers/zero.driver.js";
|
|
24
27
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAM5B,cAAc,0BAA0B,CAAC;AAGzC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0BAA0B,CAAC;AACzC,cAAc,iCAAiC,CAAC;AAChD,cAAc,6BAA6B,CAAC;AAG5C,cAAc,gCAAgC,CAAC;AAG/C,cAAc,gCAAgC,CAAC;AAG/C,cAAc,kCAAkC,CAAC;AAGjD,cAAc,0BAA0B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* @packageDocumentation
|
|
15
15
|
*/
|
|
16
16
|
export * from "./types.js";
|
|
17
|
+
export * from "./errors.js";
|
|
17
18
|
// TODO: M1 - Add Kong client
|
|
18
19
|
// export * from './kong.js';
|
|
19
20
|
// M3 - Meta API driver
|
|
@@ -25,6 +26,10 @@ export * from "./drivers/share-links.driver.js";
|
|
|
25
26
|
export * from "./drivers/storage.driver.js";
|
|
26
27
|
// M5 - Auth Admin driver
|
|
27
28
|
export * from "./drivers/auth-admin.driver.js";
|
|
29
|
+
// Tenant self-service DDL / RLS driver (multi-tenant, per-tenant service_role)
|
|
30
|
+
export * from "./drivers/tenant-ddl.driver.js";
|
|
31
|
+
// Tenant admin driver (platform-operator surface; dashboard Basic Auth)
|
|
32
|
+
export * from "./drivers/tenant-admin.driver.js";
|
|
28
33
|
// Zero provisioning driver (PolarDB-X Zero PXBaas)
|
|
29
34
|
export * from "./drivers/zero.driver.js";
|
|
30
35
|
// TODO: M5 - Add REST driver
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAE5B,6BAA6B;AAC7B,6BAA6B;AAE7B,uBAAuB;AACvB,cAAc,0BAA0B,CAAC;AAEzC,4CAA4C;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0BAA0B,CAAC;AACzC,cAAc,iCAAiC,CAAC;AAChD,cAAc,6BAA6B,CAAC;AAE5C,yBAAyB;AACzB,cAAc,gCAAgC,CAAC;AAE/C,+EAA+E;AAC/E,cAAc,gCAAgC,CAAC;AAE/C,wEAAwE;AACxE,cAAc,kCAAkC,CAAC;AAEjD,mDAAmD;AACnD,cAAc,0BAA0B,CAAC;AAEzC,6BAA6B;AAC7B,4CAA4C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@polardbx/pxbaas-client",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.10",
|
|
4
4
|
"description": "Shared HTTP client SDK for PolarDB-X BaaS data plane APIs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"polardbx",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"vitest": "^1.2.0"
|
|
46
46
|
},
|
|
47
47
|
"engines": {
|
|
48
|
-
"node": ">=
|
|
48
|
+
"node": "^22.23.4 || ^24.22.1 || >=26.12.1"
|
|
49
49
|
},
|
|
50
50
|
"scripts": {
|
|
51
51
|
"build": "tsc --build",
|