@mastra/client-js 0.1.0 → 0.1.2-alpha.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/.turbo/turbo-build.log +15 -16
- package/CHANGELOG.md +15 -0
- package/dist/index.mjs +29 -9
- package/package.json +2 -2
- package/src/client.ts +30 -6
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
[34mCLI[39m
|
|
7
|
-
[34mCLI[39m
|
|
8
|
-
[34mCLI[39m
|
|
9
|
-
[34mCLI[39m
|
|
10
|
-
[
|
|
11
|
-
[
|
|
12
|
-
[32mESM[39m
|
|
13
|
-
[
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
DTS dist/index.d.mts 13.46 KB
|
|
1
|
+
|
|
2
|
+
> @mastra/client-js@0.1.2-alpha.0 build /home/runner/work/mastra/mastra/client-sdks/client-js
|
|
3
|
+
> tsup-node src/index.ts --format esm --dts --clean --treeshake
|
|
4
|
+
|
|
5
|
+
[34mCLI[39m Building entry: src/index.ts
|
|
6
|
+
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
7
|
+
[34mCLI[39m tsup v8.3.6
|
|
8
|
+
[34mCLI[39m Target: es2022
|
|
9
|
+
[34mCLI[39m Cleaning output folder
|
|
10
|
+
[34mESM[39m Build start
|
|
11
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m13.39 KB[39m
|
|
12
|
+
[32mESM[39m ⚡️ Build success in 480ms
|
|
13
|
+
[34mDTS[39m Build start
|
|
14
|
+
[32mDTS[39m ⚡️ Build success in 9999ms
|
|
15
|
+
[32mDTS[39m [1mdist/index.d.mts [22m[32m13.46 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @mastra/client-js
|
|
2
2
|
|
|
3
|
+
## 0.1.2-alpha.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 5297264: Fix build errors by changing contracts
|
|
8
|
+
- Updated dependencies [2fc618f]
|
|
9
|
+
- @mastra/core@0.4.0-alpha.0
|
|
10
|
+
|
|
11
|
+
## 0.1.1
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [f205ede]
|
|
16
|
+
- @mastra/core@0.3.0
|
|
17
|
+
|
|
3
18
|
## 0.1.0
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/dist/index.mjs
CHANGED
|
@@ -444,16 +444,36 @@ var MastraClient = class extends BaseResource {
|
|
|
444
444
|
getTelemetry(params) {
|
|
445
445
|
const { name, scope, page, perPage, attribute } = params || {};
|
|
446
446
|
const _attribute = attribute ? Object.entries(attribute).map(([key, value]) => `${key}:${value}`) : [];
|
|
447
|
-
|
|
448
|
-
...name ? { name } : {},
|
|
449
|
-
...scope ? { scope } : {},
|
|
450
|
-
...page ? { page: String(page) } : {},
|
|
451
|
-
...perPage ? { perPage: String(perPage) } : {},
|
|
447
|
+
({
|
|
452
448
|
..._attribute?.length ? { attribute: _attribute } : {}
|
|
453
|
-
};
|
|
454
|
-
const
|
|
455
|
-
|
|
456
|
-
|
|
449
|
+
});
|
|
450
|
+
const searchParams = new URLSearchParams();
|
|
451
|
+
if (name) {
|
|
452
|
+
searchParams.set("name", name);
|
|
453
|
+
}
|
|
454
|
+
if (scope) {
|
|
455
|
+
searchParams.set("scope", scope);
|
|
456
|
+
}
|
|
457
|
+
if (page) {
|
|
458
|
+
searchParams.set("page", String(page));
|
|
459
|
+
}
|
|
460
|
+
if (perPage) {
|
|
461
|
+
searchParams.set("perPage", String(perPage));
|
|
462
|
+
}
|
|
463
|
+
if (_attribute) {
|
|
464
|
+
if (Array.isArray(_attribute)) {
|
|
465
|
+
for (const attr of _attribute) {
|
|
466
|
+
searchParams.append("attribute", attr);
|
|
467
|
+
}
|
|
468
|
+
} else {
|
|
469
|
+
searchParams.set("attribute", _attribute);
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
if (searchParams.size) {
|
|
473
|
+
return this.request(`/api/telemetry?${searchParams}`);
|
|
474
|
+
} else {
|
|
475
|
+
return this.request(`/api/telemetry`);
|
|
476
|
+
}
|
|
457
477
|
}
|
|
458
478
|
};
|
|
459
479
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/client-js",
|
|
3
|
-
"version": "0.1.0",
|
|
3
|
+
"version": "0.1.2-alpha.0",
|
|
4
4
|
"description": "The official TypeScript library for the Mastra Client API",
|
|
5
5
|
"author": "",
|
|
6
6
|
"types": "dist/index.d.mts",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"json-schema": "^0.4.0",
|
|
21
21
|
"zod": "^3.24.1",
|
|
22
22
|
"zod-to-json-schema": "^3.24.1",
|
|
23
|
-
"@mastra/core": "^0.
|
|
23
|
+
"@mastra/core": "^0.4.0-alpha.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@babel/preset-env": "^7.26.0",
|
package/src/client.ts
CHANGED
|
@@ -163,11 +163,35 @@ export class MastraClient extends BaseResource {
|
|
|
163
163
|
...(page ? { page: String(page) } : {}),
|
|
164
164
|
...(perPage ? { perPage: String(perPage) } : {}),
|
|
165
165
|
...(_attribute?.length ? { attribute: _attribute } : {}),
|
|
166
|
-
};
|
|
167
|
-
|
|
168
|
-
const
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
166
|
+
} as const;
|
|
167
|
+
|
|
168
|
+
const searchParams = new URLSearchParams();
|
|
169
|
+
if (name) {
|
|
170
|
+
searchParams.set('name', name);
|
|
171
|
+
}
|
|
172
|
+
if (scope) {
|
|
173
|
+
searchParams.set('scope', scope);
|
|
174
|
+
}
|
|
175
|
+
if (page) {
|
|
176
|
+
searchParams.set('page', String(page));
|
|
177
|
+
}
|
|
178
|
+
if (perPage) {
|
|
179
|
+
searchParams.set('perPage', String(perPage));
|
|
180
|
+
}
|
|
181
|
+
if (_attribute) {
|
|
182
|
+
if (Array.isArray(_attribute)) {
|
|
183
|
+
for (const attr of _attribute) {
|
|
184
|
+
searchParams.append('attribute', attr);
|
|
185
|
+
}
|
|
186
|
+
} else {
|
|
187
|
+
searchParams.set('attribute', _attribute);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
if (searchParams.size) {
|
|
192
|
+
return this.request(`/api/telemetry?${searchParams}`);
|
|
193
|
+
} else {
|
|
194
|
+
return this.request(`/api/telemetry`);
|
|
195
|
+
}
|
|
172
196
|
}
|
|
173
197
|
}
|