@aizu-chat/react 0.0.10 → 0.1.1

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/package.json CHANGED
@@ -1,33 +1,17 @@
1
1
  {
2
2
  "name": "@aizu-chat/react",
3
- "version": "0.0.10",
4
- "sideEffects": ["*.css", "dist/**/*.css"],
3
+ "version": "0.1.1",
4
+ "main": "./dist/index.js",
5
+ "module": "./dist/index.mjs",
6
+ "types": "./dist/index.d.ts",
7
+ "sideEffects": [
8
+ "*.css",
9
+ "dist/**/*.css"
10
+ ],
5
11
  "license": "MIT",
6
- "files": ["dist"],
7
- "exports": {
8
- ".": {
9
- "types": "./dist/index.d.ts",
10
- "import": "./dist/index.mjs",
11
- "require": "./dist/index.js"
12
- },
13
- "./components": {
14
- "types": "./dist/components.d.ts",
15
- "import": "./dist/components.mjs",
16
- "require": "./dist/components.js"
17
- },
18
- "./hooks": {
19
- "types": "./dist/hooks.d.ts",
20
- "import": "./dist/hooks.mjs",
21
- "require": "./dist/hooks.js"
22
- }
23
- },
24
- "typesVersions": {
25
- "*": {
26
- "*": ["./dist/index.d.ts"],
27
- "components": ["./dist/components.d.ts"],
28
- "hooks": ["./dist/hooks.d.ts"]
29
- }
30
- },
12
+ "files": [
13
+ "dist/**"
14
+ ],
31
15
  "scripts": {
32
16
  "build": "tsup",
33
17
  "dev": "tsup --watch",
@@ -59,7 +43,7 @@
59
43
  },
60
44
  "repository": {
61
45
  "type": "git",
62
- "url": "https://github.com/Zimpligital/aizu-chat-agent"
46
+ "url": "git+https://github.com/Zimpligital/aizu-chat-agent.git"
63
47
  },
64
48
  "dependencies": {
65
49
  "clsx": "^2.1.1",
@@ -1,67 +0,0 @@
1
- 'use client'
2
- import {
3
- __async,
4
- __objRest,
5
- __spreadProps,
6
- __spreadValues
7
- } from "./chunk-33CPD3DF.mjs";
8
-
9
- // src/sdk/client.ts
10
- var AizuClient = class {
11
- constructor(config) {
12
- const { hostUrl, apiKey } = config;
13
- if (typeof hostUrl !== "string" || hostUrl.trim().length === 0) {
14
- throw new Error(
15
- "Invalid AizuClient configuration: 'hostUrl' must be a non-empty string."
16
- );
17
- }
18
- if (typeof apiKey !== "string" || apiKey.trim().length === 0) {
19
- throw new Error(
20
- "Invalid AizuClient configuration: 'apiKey' must be a non-empty string."
21
- );
22
- }
23
- this.hostUrl = hostUrl;
24
- this.apiKey = apiKey;
25
- }
26
- request(_0) {
27
- return __async(this, arguments, function* (path, options = {}) {
28
- const url = `${this.hostUrl}${path}`;
29
- const _a = options, { body } = _a, restOptions = __objRest(_a, ["body"]);
30
- const response = yield fetch(url, __spreadProps(__spreadValues({}, restOptions), {
31
- headers: __spreadValues({
32
- "Content-Type": "application/json",
33
- "x-api-key": this.apiKey
34
- }, options.headers),
35
- body: body ? JSON.stringify(body) : void 0
36
- }));
37
- if (!response.ok) {
38
- const errorBody = yield response.text().catch(() => "");
39
- const errorMessage = `API Error: ${response.status} ${response.statusText}${errorBody ? ` - ${errorBody}` : ""}`;
40
- throw new Error(errorMessage);
41
- }
42
- return yield response.json();
43
- });
44
- }
45
- chat(params) {
46
- return __async(this, null, function* () {
47
- if (!params.query.trim()) {
48
- throw new Error("Query is required");
49
- }
50
- return this.request("/chat/query", {
51
- method: "POST",
52
- body: params
53
- });
54
- });
55
- }
56
- };
57
- var createAizuClient = ({
58
- hostUrl,
59
- apiKey
60
- }) => {
61
- return new AizuClient({ hostUrl, apiKey });
62
- };
63
-
64
- export {
65
- AizuClient,
66
- createAizuClient
67
- };
@@ -1,59 +0,0 @@
1
- 'use client'
2
- var __defProp = Object.defineProperty;
3
- var __defProps = Object.defineProperties;
4
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
5
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
8
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9
- var __spreadValues = (a, b) => {
10
- for (var prop in b || (b = {}))
11
- if (__hasOwnProp.call(b, prop))
12
- __defNormalProp(a, prop, b[prop]);
13
- if (__getOwnPropSymbols)
14
- for (var prop of __getOwnPropSymbols(b)) {
15
- if (__propIsEnum.call(b, prop))
16
- __defNormalProp(a, prop, b[prop]);
17
- }
18
- return a;
19
- };
20
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
21
- var __objRest = (source, exclude) => {
22
- var target = {};
23
- for (var prop in source)
24
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
25
- target[prop] = source[prop];
26
- if (source != null && __getOwnPropSymbols)
27
- for (var prop of __getOwnPropSymbols(source)) {
28
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
29
- target[prop] = source[prop];
30
- }
31
- return target;
32
- };
33
- var __async = (__this, __arguments, generator) => {
34
- return new Promise((resolve, reject) => {
35
- var fulfilled = (value) => {
36
- try {
37
- step(generator.next(value));
38
- } catch (e) {
39
- reject(e);
40
- }
41
- };
42
- var rejected = (value) => {
43
- try {
44
- step(generator.throw(value));
45
- } catch (e) {
46
- reject(e);
47
- }
48
- };
49
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
50
- step((generator = generator.apply(__this, __arguments)).next());
51
- });
52
- };
53
-
54
- export {
55
- __spreadValues,
56
- __spreadProps,
57
- __objRest,
58
- __async
59
- };