@dajiaoai/algeo-sdk 1.1.0 → 1.2.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/dist/index.d.ts CHANGED
@@ -2,17 +2,12 @@
2
2
  * 大角几何内嵌画板 SDK
3
3
  * 绑定 DOM 容器,自动创建 iframe 并封装 postMessage 通信
4
4
  */
5
+ import { AlgeoError, type AlgeoErrorPayload, type FileContentV10, EMBED_ERROR_CODES } from '@dajiaoai/algeo-protocol';
5
6
  /** SDK 版本号,构建时由 rollup 注入 */
6
7
  export declare const VERSION = "__ALGEO_SDK_VERSION__";
7
- /** loadFile 时传入的文件内容,需符合 FileContentV10 格式 */
8
- export interface FileContent {
9
- slides: unknown[];
10
- messages: unknown[];
11
- metadata: {
12
- version: string;
13
- shareOptions?: unknown;
14
- };
15
- }
8
+ /** 从协议层 re-export,供外部使用 */
9
+ export type { FileContentV10, AlgeoErrorPayload };
10
+ export { AlgeoError, EMBED_ERROR_CODES };
16
11
  export interface AlgeoSdkOptions {
17
12
  /** 内嵌页基础 URL,默认 https://dajiaoai.com */
18
13
  baseUrl?: string;
@@ -34,16 +29,6 @@ export interface GetSlideCountResult {
34
29
  export interface ReplResult {
35
30
  output: string;
36
31
  }
37
- export interface AlgeoErrorPayload {
38
- code: string;
39
- message: string;
40
- details?: unknown;
41
- }
42
- export declare class AlgeoSdkError extends Error {
43
- code: string;
44
- details?: unknown | undefined;
45
- constructor(message: string, code: string, details?: unknown | undefined);
46
- }
47
32
  /**
48
33
  * 大角几何内嵌画板 SDK
49
34
  */
@@ -69,7 +54,7 @@ export declare class AlgeoSdk {
69
54
  /**
70
55
  * 加载完整文件内容(覆盖式)
71
56
  */
72
- loadFile(content: FileContent): Promise<LoadFileResult>;
57
+ loadFile(content: FileContentV10): Promise<LoadFileResult>;
73
58
  /**
74
59
  * 切换到指定索引的画板
75
60
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dajiaoai/algeo-sdk",
3
- "version": "1.1.0",
3
+ "version": "1.2.1",
4
4
  "description": "大角几何内嵌画板 SDK,支持 iframe 挂载与 postMessage 通信",
5
5
  "main": "dist/algeo-sdk.cjs.js",
6
6
  "module": "dist/algeo-sdk.esm.js",
@@ -13,7 +13,8 @@
13
13
  "scripts": {
14
14
  "build": "rollup -c",
15
15
  "typecheck": "tsc --noEmit",
16
- "examples": "npx serve ."
16
+ "examples": "npx serve .",
17
+ "release": "npm run build && npm publish --access public"
17
18
  },
18
19
  "keywords": [
19
20
  "algeo",
@@ -33,10 +34,14 @@
33
34
  "homepage": "https://github.com/dajiaoai/algeo-sdk#readme",
34
35
  "type": "module",
35
36
  "devDependencies": {
37
+ "@rollup/plugin-node-resolve": "^16.0.3",
36
38
  "@rollup/plugin-replace": "^6.0.1",
37
39
  "@rollup/plugin-typescript": "^11.1.6",
38
40
  "rollup": "^4.28.1",
39
41
  "tslib": "^2.8.0",
40
42
  "typescript": "^5.9.3"
43
+ },
44
+ "dependencies": {
45
+ "@dajiaoai/algeo-protocol": "^1.0.0"
41
46
  }
42
47
  }