@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.
- package/dist/index.cjs +74 -2996
- package/dist/index.js +71 -2993
- package/dist/types/packages/node/storage/entity/entity/types.d.ts +20 -20
- package/dist/types/packages/node/storage/entity/error/consts.d.ts +29 -29
- package/dist/types/packages/node/storage/entity/fetch/index.d.ts.map +1 -1
- package/dist/types/packages/node/storage/entity/index.d.ts +1 -1
- package/dist/types/packages/node/storage/entity/query/types.d.ts +52 -52
- package/dist/types/packages/node/storage/entity/result/types.d.ts +12 -12
- package/dist/types/packages/node/storage/entity/sort/consts.d.ts +3 -3
- package/dist/types/packages/node/storage/entity/types.d.ts +29 -29
- package/dist/types/packages/node/storage/entity/where/index.d.ts +1 -1
- package/dist/types/packages/node/storage/object/error/consts.d.ts +4 -4
- package/dist/types/packages/node/storage/object/error/index.d.ts +4 -4
- package/dist/types/packages/node/storage/object/fetch/index.d.ts.map +1 -1
- package/dist/types/packages/node/storage/object/index.d.ts +1 -1
- package/dist/types/packages/node/storage/object/result/types.d.ts +3 -3
- package/dist/types/packages/node/storage/object/types.d.ts +17 -17
- package/dist/types/packages/strict/env/index.d.ts +12 -28
- package/dist/types/packages/strict/env/index.d.ts.map +1 -1
- package/dist/types/packages/strict/result/types.d.ts +6 -6
- package/package.json +3 -3
|
@@ -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
|
|
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
|
|
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;
|
|
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"}
|
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
3
|
-
* @alias
|
|
4
|
-
* @
|
|
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
|
|
6
|
+
export declare const getONESHostedBaseUrl: () => string | undefined;
|
|
8
7
|
/**
|
|
9
|
-
* @description
|
|
10
|
-
* @alias
|
|
11
|
-
* @
|
|
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
|
|
12
|
+
export declare const getONESHostedAppID: () => string | undefined;
|
|
15
13
|
/**
|
|
16
|
-
* @description
|
|
17
|
-
* @alias
|
|
18
|
-
* @returns
|
|
14
|
+
* @description Get the app hosted token
|
|
15
|
+
* @alias getONESHostedToken
|
|
16
|
+
* @returns ONES_HOSTED_TOKEN
|
|
19
17
|
*/
|
|
20
|
-
export declare const
|
|
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
|
|
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.
|
|
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": "
|
|
53
|
+
"gitHead": "e5e51129d48f958f3601bad876aad064946c29a9"
|
|
54
54
|
}
|