@ones-open/node-sdk 0.0.2 → 0.0.4-10001.152

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.
@@ -3,7 +3,7 @@ export * from './consts';
3
3
  export * from './types';
4
4
  /**
5
5
  * @constant WhereConditions
6
- * @description 实体查询条件方法枚举
6
+ * @description Entity query condition method enum
7
7
  */
8
8
  export declare const WhereConditions: {
9
9
  /**
@@ -1,19 +1,19 @@
1
1
  /**
2
2
  * @enum ObjectErrorCode
3
- * @description 对象存储错误码枚举
3
+ * @description Object storage error code enum
4
4
  */
5
5
  export declare enum ObjectErrorCode {
6
6
  /**
7
- * @description 对象存储 key 为空/包含非法字符/超出最大长度限制
7
+ * @description Object storage key is empty / contains invalid characters / exceeds max length
8
8
  * @satisfies /^[0-9a-zA-Z!_.*'()-]{1,128}$/
9
9
  */
10
10
  ObjectKeyInvalid = "ObjectKeyInvalid",
11
11
  /**
12
- * @description 对象存储 key 不存在
12
+ * @description Object storage key does not exist
13
13
  */
14
14
  ObjectKeyNotfound = "ObjectKeyNotfound",
15
15
  /**
16
- * @description 请求超时
16
+ * @description Request timeout
17
17
  */
18
18
  RequestTimeOut = "RequestTimeOut"
19
19
  }
@@ -2,19 +2,19 @@ import type { ObjectErrorResult } from './types';
2
2
  export * from './consts';
3
3
  export * from './types';
4
4
  /**
5
- * @description 对象存储操作错误对象
5
+ * @description Object storage operation error object
6
6
  */
7
7
  export declare class ObjectError implements ObjectErrorResult {
8
8
  /**
9
- * @description 错误码枚举
9
+ * @description Error code enum
10
10
  */
11
11
  code: import("../../..").ErrorCode | import("./consts").ObjectErrorCode;
12
12
  /**
13
- * @description 错误文案
13
+ * @description Error message
14
14
  */
15
15
  err_msg: string;
16
16
  /**
17
- * @description 错误载荷
17
+ * @description Error payload
18
18
  */
19
19
  err_values: Record<string, any> | undefined;
20
20
  constructor(result: ObjectErrorResult);
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/packages/node/storage/object/fetch/index.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAGV,qBAAqB,EAErB,uBAAuB,EAEvB,qBAAqB,EAErB,uBAAuB,EAExB,MAAM,SAAS,CAAA;AAEhB,cAAc,SAAS,CAAA;AAyCvB,eAAO,MAAM,WAAW,EAAE,qBAKzB,CAAA;AAED,eAAO,MAAM,aAAa,EAAE,uBAK3B,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,qBAKzB,CAAA;AAED,eAAO,MAAM,aAAa,EAAE,uBAK3B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/packages/node/storage/object/fetch/index.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAGV,qBAAqB,EAErB,uBAAuB,EAEvB,qBAAqB,EAErB,uBAAuB,EAExB,MAAM,SAAS,CAAA;AAEhB,cAAc,SAAS,CAAA;AAwDvB,eAAO,MAAM,WAAW,EAAE,qBAKzB,CAAA;AAED,eAAO,MAAM,aAAa,EAAE,uBAK3B,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,qBAEzB,CAAA;AAED,eAAO,MAAM,aAAa,EAAE,uBAE3B,CAAA"}
@@ -5,7 +5,7 @@ export type * from './result';
5
5
  export type * from './types';
6
6
  /**
7
7
  * @constant object
8
- * @description 对象存储
8
+ * @description Object storage
9
9
  * @member ObjectError
10
10
  * @member ObjectErrorCode
11
11
  * @member upload
@@ -15,15 +15,15 @@ export type ObjectDownloadResult = ObjectResult<{
15
15
  }>;
16
16
  export type ObjectDeleteResult = ObjectResult<never>;
17
17
  /**
18
- * @description 对象的元信息的结果对象
18
+ * @description Result object for object metadata
19
19
  */
20
20
  export interface ObjectMetadataResultData {
21
21
  /**
22
- * @description 对象存储 key
22
+ * @description Object storage key
23
23
  */
24
24
  object_key: string;
25
25
  /**
26
- * @description 文件大小,字节
26
+ * @description File size in bytes
27
27
  */
28
28
  size: number;
29
29
  }
@@ -1,64 +1,64 @@
1
1
  import type { ObjectError, ObjectErrorCode } from './error';
2
2
  import type { ObjectResultDataFields, ObjectMetadataResultData } from './result';
3
3
  /**
4
- * @description 获取上传信息的操作对象
4
+ * @description Operation object for getting upload info
5
5
  */
6
6
  export interface ObjectStoreUploadResult {
7
7
  /**
8
- * @description 获取上传地址(需要在插件后端请求)
8
+ * @description Get upload URL (must be requested from plugin backend)
9
9
  */
10
10
  getUrl(): string;
11
11
  /**
12
- * @description 获取上传地址(适合在浏览器中请求)
12
+ * @description Get upload URL (suitable for browser requests)
13
13
  */
14
14
  getWebUrl(): string;
15
15
  /**
16
- * @description 获取请求的 FormData 参数
16
+ * @description Get FormData parameters for the request
17
17
  */
18
18
  getFields(): ObjectResultDataFields;
19
19
  }
20
20
  /**
21
- * @description 获取下载信息的操作对象
21
+ * @description Operation object for getting download info
22
22
  */
23
23
  export interface ObjectStoreDownloadResult {
24
24
  /**
25
- * @description 获取下载地址(需要在插件后端请求)
25
+ * @description Get download URL (must be requested from plugin backend)
26
26
  */
27
27
  getUrl(): string;
28
28
  /**
29
- * @description 获取下载地址(适合在浏览器中请求)
29
+ * @description Get download URL (suitable for browser requests)
30
30
  */
31
31
  getWebUrl(): string;
32
32
  }
33
33
  export interface ObjectStore {
34
34
  /**
35
- * @description 对象存储操作错误对象
35
+ * @description Object storage operation error object
36
36
  */
37
37
  ObjectError: typeof ObjectError;
38
38
  /**
39
- * @description 对象存储错误码枚举
39
+ * @description Object storage error code enum
40
40
  */
41
41
  ObjectErrorCode: typeof ObjectErrorCode;
42
42
  /**
43
- * @description 上传一个对象
44
- * @param key 对象存储 key
43
+ * @description Upload an object
44
+ * @param key Object storage key
45
45
  * @returns ObjectStoreUploadResult
46
46
  */
47
47
  upload(key: string): Promise<ObjectStoreUploadResult | ObjectError>;
48
48
  /**
49
- * @description 下载一个对象
50
- * @param key 对象存储 key
49
+ * @description Download an object
50
+ * @param key Object storage key
51
51
  * @returns ObjectStoreDownloadResult
52
52
  */
53
53
  download(key: string): Promise<ObjectStoreDownloadResult | ObjectError>;
54
54
  /**
55
- * @description 删除一个对象
56
- * @param key 对象存储 key
55
+ * @description Delete an object
56
+ * @param key Object storage key
57
57
  */
58
58
  delete(key: string): Promise<void | ObjectError>;
59
59
  /**
60
- * @description 获取一个对象的元信息
61
- * @param key 对象存储 key
60
+ * @description Get metadata of an object
61
+ * @param key Object storage key
62
62
  * @returns ObjectMetadataResultData
63
63
  */
64
64
  metadata(key: string): Promise<ObjectMetadataResultData | ObjectError>;
@@ -1,35 +1,19 @@
1
1
  /**
2
- * @description 获取开放平台 host
3
- * @alias getPlatformApiHost
4
- * @alias getPlatformAPIHost
5
- * @returns platformApiHost
2
+ * @description Get the open platform base URL
3
+ * @alias getONESHostedBaseUrl
4
+ * @returns ONES_HOSTED_BASE_URL
6
5
  */
7
- export declare const getPlatformApiHost: () => string;
6
+ export declare const getONESHostedBaseUrl: () => string | undefined;
8
7
  /**
9
- * @description 获取开放平台 host
10
- * @alias getPlatformApiHost
11
- * @alias getPlatformAPIHost
12
- * @returns platformApiHost
8
+ * @description Get the app instance ID
9
+ * @alias getONESHostedAppID
10
+ * @returns ONES_HOSTED_APP_ID
13
11
  */
14
- export declare const getPlatformAPIHost: () => string;
12
+ export declare const getONESHostedAppID: () => string | undefined;
15
13
  /**
16
- * @description 获取插件实例 ID
17
- * @alias getInstanceId
18
- * @returns instanceId
14
+ * @description Get the app hosted token
15
+ * @alias getONESHostedToken
16
+ * @returns ONES_HOSTED_TOKEN
19
17
  */
20
- export declare const getInstanceId: () => string;
21
- /**
22
- * @description 获取插件 ID
23
- * @alias getApplicationId
24
- * @alias getAppId
25
- * @returns applicationId
26
- */
27
- export declare const getApplicationId: () => string;
28
- /**
29
- * @description 获取插件 ID
30
- * @alias getApplicationId
31
- * @alias getAppId
32
- * @returns applicationId
33
- */
34
- export declare const getAppId: () => string;
18
+ export declare const getONESHostedToken: () => string | undefined;
35
19
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/packages/strict/env/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,cAE9B,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,cAAqB,CAAA;AAEpD;;;;GAIG;AACH,eAAO,MAAM,aAAa,cAEzB,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,cAE5B,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,cAAmB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/packages/strict/env/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,0BAEhC,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,0BAE9B,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,0BAE9B,CAAA"}
@@ -1,29 +1,29 @@
1
1
  import type { ErrorCode } from '../../../packages/strict/error';
2
2
  export interface SuccessResult<Data> {
3
3
  /**
4
- * @description 请求成功
4
+ * @description Request succeeded
5
5
  */
6
6
  code: 'OK';
7
7
  /**
8
- * @description 请求响应体
8
+ * @description Response body
9
9
  */
10
10
  data?: Data;
11
11
  }
12
12
  export interface ErrorResult<Data, Code> {
13
13
  /**
14
- * @description 错误码枚举
14
+ * @description Error code enum
15
15
  */
16
16
  code: Code | ErrorCode;
17
17
  /**
18
- * @description 请求响应体
18
+ * @description Response body
19
19
  */
20
20
  data?: Data;
21
21
  /**
22
- * @description 错误文案
22
+ * @description Error message
23
23
  */
24
24
  err_msg: string;
25
25
  /**
26
- * @description 错误载荷
26
+ * @description Error payload
27
27
  */
28
28
  err_values?: Record<string, any>;
29
29
  }
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@ones-open/node-sdk",
3
- "version": "0.0.2",
3
+ "version": "0.0.4-10001.152+e5e51129",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
7
7
  "module": "./dist/index.js",
8
- "types": "./dist/index.d.ts",
8
+ "types": "./dist/types/index.d.ts",
9
9
  "exports": {
10
10
  ".": {
11
11
  "types": "./dist/types/index.d.ts",
@@ -50,5 +50,5 @@
50
50
  "devDependencies": {
51
51
  "@types/lodash-es": "^4.17.12"
52
52
  },
53
- "gitHead": "68e9c4e979144c84bdc92e6ba7da9776022f3a98"
53
+ "gitHead": "e5e51129d48f958f3601bad876aad064946c29a9"
54
54
  }