@vertesia/client 1.6.0-dev.20260912.110338Z → 1.6.0-dev.20260918.061604Z
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/lib/AccountApi.d.ts +2 -0
- package/lib/AccountApi.d.ts.map +1 -1
- package/lib/AccountApi.js +3 -0
- package/lib/AccountApi.js.map +1 -1
- package/lib/AccountApiKeysApi.d.ts +11 -0
- package/lib/AccountApiKeysApi.d.ts.map +1 -0
- package/lib/AccountApiKeysApi.js +22 -0
- package/lib/AccountApiKeysApi.js.map +1 -0
- package/lib/vertesia-client.js +3 -3
- package/lib/vertesia-client.js.map +1 -1
- package/package.json +7 -7
- package/src/AccountApi.ts +4 -0
- package/src/AccountApiKeysApi.ts +29 -0
- package/src/bundle-isolation.test.ts +37 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vertesia/client",
|
|
3
|
-
"version": "1.6.0-dev.
|
|
3
|
+
"version": "1.6.0-dev.20260918.061604Z",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -13,14 +13,14 @@
|
|
|
13
13
|
"devDependencies": {
|
|
14
14
|
"@types/node": "^24.13.3",
|
|
15
15
|
"@vertesia/tsconfig": "0.1.0",
|
|
16
|
-
"rolldown": "1.2.
|
|
16
|
+
"rolldown": "1.2.8",
|
|
17
17
|
"typescript": "7.0.2",
|
|
18
|
-
"vitest": "
|
|
18
|
+
"vitest": "5.0.0"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@llumiverse/common": "1.6.0-dev.
|
|
22
|
-
"@vertesia/api-fetch-client": "1.6.0-dev.
|
|
23
|
-
"@vertesia/common": "1.6.0-dev.
|
|
21
|
+
"@llumiverse/common": "1.6.0-dev.20260918.055633Z",
|
|
22
|
+
"@vertesia/api-fetch-client": "1.6.0-dev.20260918.061604Z",
|
|
23
|
+
"@vertesia/common": "1.6.0-dev.20260918.061604Z",
|
|
24
24
|
"eventsource": "^5.1.1"
|
|
25
25
|
},
|
|
26
26
|
"exports": {
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"ai",
|
|
49
49
|
"typescript"
|
|
50
50
|
],
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "ea552337206e77c256478b76e19b4235e70bf769",
|
|
52
52
|
"scripts": {
|
|
53
53
|
"lint": "biome lint src",
|
|
54
54
|
"clean:lib": "rimraf ./lib ./tsconfig.tsbuildinfo",
|
package/src/AccountApi.ts
CHANGED
|
@@ -13,10 +13,14 @@ import type {
|
|
|
13
13
|
User,
|
|
14
14
|
UserInviteToken,
|
|
15
15
|
} from '@vertesia/common';
|
|
16
|
+
import AccountApiKeysApi from './AccountApiKeysApi.js';
|
|
16
17
|
|
|
17
18
|
export default class AccountApi extends ApiTopic {
|
|
19
|
+
readonly apikeys: AccountApiKeysApi;
|
|
20
|
+
|
|
18
21
|
constructor(parent: ClientBase) {
|
|
19
22
|
super(parent, '/api/v1/account');
|
|
23
|
+
this.apikeys = new AccountApiKeysApi(parent);
|
|
20
24
|
}
|
|
21
25
|
|
|
22
26
|
/**
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ApiTopic, type ClientBase } from '@vertesia/api-fetch-client';
|
|
2
|
+
import type {
|
|
3
|
+
AccountApiKey,
|
|
4
|
+
AccountApiKeyWithValue,
|
|
5
|
+
CreateAccountApiKeyPayload,
|
|
6
|
+
DeleteOperationResult,
|
|
7
|
+
UpdateAccountApiKeyPayload,
|
|
8
|
+
} from '@vertesia/common';
|
|
9
|
+
|
|
10
|
+
export default class AccountApiKeysApi extends ApiTopic {
|
|
11
|
+
constructor(parent: ClientBase) {
|
|
12
|
+
super(parent, '/api/v1/account/apikeys');
|
|
13
|
+
}
|
|
14
|
+
list(): Promise<AccountApiKey[]> {
|
|
15
|
+
return this.get('/');
|
|
16
|
+
}
|
|
17
|
+
retrieve(id: string): Promise<AccountApiKey> {
|
|
18
|
+
return this.get(`/${id}`);
|
|
19
|
+
}
|
|
20
|
+
create(payload: CreateAccountApiKeyPayload): Promise<AccountApiKeyWithValue> {
|
|
21
|
+
return this.post('/', { payload });
|
|
22
|
+
}
|
|
23
|
+
update(id: string, payload: UpdateAccountApiKeyPayload): Promise<AccountApiKey> {
|
|
24
|
+
return this.put(`/${id}`, { payload });
|
|
25
|
+
}
|
|
26
|
+
delete(id: string): Promise<DeleteOperationResult> {
|
|
27
|
+
return this.del(`/${id}`);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
2
|
+
import { describe, expect, it } from 'vitest';
|
|
3
|
+
|
|
4
|
+
// Build outputs are required; Turbo runs this package's build before its tests.
|
|
5
|
+
const path = (relative: string) => new URL(relative, import.meta.url).pathname;
|
|
6
|
+
|
|
7
|
+
const CLIENT_BUNDLE = path('../lib/vertesia-client.js');
|
|
8
|
+
/** `.` and `./node` in the client's exports map — the latter is `lib/nodejs/index.js`, not `lib/index.js`. */
|
|
9
|
+
const CLIENT_ENTRIES = [
|
|
10
|
+
{ label: 'client default entry (.)', file: path('../lib/index.js') },
|
|
11
|
+
{ label: 'client node entry (./node)', file: path('../lib/nodejs/index.js') },
|
|
12
|
+
];
|
|
13
|
+
|
|
14
|
+
/** Markers that prove a runtime schema import leaked into a browser artifact. */
|
|
15
|
+
const FORBIDDEN = ['zod', '_zod', 'ZodObject', 'api-schemas', 'toOpenApiComponents', 'ApiSchemaComponents'];
|
|
16
|
+
|
|
17
|
+
function expectNoSchemaRuntime(file: string, label: string): void {
|
|
18
|
+
const contents = readFileSync(file, 'utf8');
|
|
19
|
+
for (const marker of FORBIDDEN) {
|
|
20
|
+
expect(contents, `${label} must not contain '${marker}'`).not.toContain(marker);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
describe('@vertesia/client consumer runtime isolation', () => {
|
|
25
|
+
it('contains no zod import or schema registry code', () => {
|
|
26
|
+
// The client is served to the browser the same way common is, so importing
|
|
27
|
+
// `@vertesia/common/api-schemas` from an SDK method would ship zod to every UI user.
|
|
28
|
+
expectNoSchemaRuntime(CLIENT_BUNDLE, 'client browser bundle');
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it.each(CLIENT_ENTRIES)('does not reference the api-schemas subpath from the $label', ({ label, file }) => {
|
|
32
|
+
// Asserted rather than skipped: a missing artifact means the entry moved or stopped being
|
|
33
|
+
// built, and silently passing would let a packaging regression through unnoticed.
|
|
34
|
+
expect(existsSync(file), `${label} not found at ${file} — has the exports map changed?`).toBe(true);
|
|
35
|
+
expect(readFileSync(file, 'utf8'), `${label} must not import api-schemas`).not.toContain('api-schemas');
|
|
36
|
+
});
|
|
37
|
+
});
|