@byted-apaas/server-sdk-node 1.1.23-beta.9 → 1.1.23

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.
Files changed (131) hide show
  1. package/package.json +2 -2
  2. package/application/application.d.ts +0 -33
  3. package/application/application.js +0 -2
  4. package/application/function/function.d.ts +0 -14
  5. package/application/function/function.js +0 -20
  6. package/application/impl/common.d.ts +0 -2
  7. package/application/impl/common.js +0 -52
  8. package/application/impl/impl.d.ts +0 -19
  9. package/application/impl/impl.js +0 -45
  10. package/common/structs.d.ts +0 -15
  11. package/common/structs.js +0 -21
  12. package/constants/constants.d.ts +0 -13
  13. package/constants/constants.js +0 -18
  14. package/context/context.d.ts +0 -44
  15. package/context/context.js +0 -25
  16. package/context/db/db.d.ts +0 -110
  17. package/context/db/db.js +0 -2
  18. package/context/db/impl/IObject.d.ts +0 -303
  19. package/context/db/impl/IObject.js +0 -5
  20. package/context/db/impl/IObjectV3.d.ts +0 -239
  21. package/context/db/impl/IObjectV3.js +0 -5
  22. package/context/db/impl/db.d.ts +0 -62
  23. package/context/db/impl/db.js +0 -84
  24. package/context/db/impl/dbV3.d.ts +0 -35
  25. package/context/db/impl/dbV3.js +0 -50
  26. package/context/db/impl/object.d.ts +0 -123
  27. package/context/db/impl/object.js +0 -1008
  28. package/context/db/impl/oql/ioql.d.ts +0 -14
  29. package/context/db/impl/oql/ioql.js +0 -4
  30. package/context/db/impl/oql/oql.d.ts +0 -14
  31. package/context/db/impl/oql/oql.js +0 -39
  32. package/context/db/impl/order.d.ts +0 -9
  33. package/context/db/impl/order.js +0 -15
  34. package/context/db/impl/propertiesStore.d.ts +0 -8
  35. package/context/db/impl/propertiesStore.js +0 -29
  36. package/context/db/impl/queryBuilder.d.ts +0 -33
  37. package/context/db/impl/queryBuilder.js +0 -72
  38. package/context/db/impl/transaction/index.d.ts +0 -25
  39. package/context/db/impl/transaction/index.js +0 -300
  40. package/context/db/impl/transaction/operation.d.ts +0 -27
  41. package/context/db/impl/transaction/operation.js +0 -69
  42. package/context/db/impl/transaction.d.ts +0 -70
  43. package/context/db/impl/transaction.js +0 -4
  44. package/context/globalConfig/globalConfig.d.ts +0 -7
  45. package/context/globalConfig/globalConfig.js +0 -16
  46. package/context/integration/IIntegration.d.ts +0 -30
  47. package/context/integration/IIntegration.js +0 -4
  48. package/context/integration/impl/integration.d.ts +0 -16
  49. package/context/integration/impl/integration.js +0 -62
  50. package/context/metadata/components/common.d.ts +0 -6
  51. package/context/metadata/components/common.js +0 -17
  52. package/context/metadata/components/components.d.ts +0 -12
  53. package/context/metadata/components/components.js +0 -19
  54. package/context/metadata/components/desktop/list.d.ts +0 -16
  55. package/context/metadata/components/desktop/list.js +0 -402
  56. package/context/metadata/components/desktop/recordDetail.d.ts +0 -11
  57. package/context/metadata/components/desktop/recordDetail.js +0 -53
  58. package/context/metadata/components/mobile/list.d.ts +0 -24
  59. package/context/metadata/components/mobile/list.js +0 -145
  60. package/context/metadata/metadata.d.ts +0 -63
  61. package/context/metadata/metadata.js +0 -125
  62. package/context/metadata/objects/fields.d.ts +0 -158
  63. package/context/metadata/objects/fields.js +0 -369
  64. package/context/metadata/objects/fields.util.d.ts +0 -52
  65. package/context/metadata/objects/fields.util.js +0 -420
  66. package/context/metadata/objects/fieldsV3.d.ts +0 -159
  67. package/context/metadata/objects/fieldsV3.js +0 -369
  68. package/context/metadata/objects/objects.d.ts +0 -11
  69. package/context/metadata/objects/objects.js +0 -20
  70. package/context/metadata/types/common.d.ts +0 -11
  71. package/context/metadata/types/common.js +0 -33
  72. package/context/metadata/types/components.d.ts +0 -90
  73. package/context/metadata/types/components.js +0 -4
  74. package/context/metadata/types/objects.d.ts +0 -246
  75. package/context/metadata/types/objects.js +0 -4
  76. package/context/metadata/types/objectsV3.d.ts +0 -128
  77. package/context/metadata/types/objectsV3.js +0 -4
  78. package/context/msg/msg.d.ts +0 -38
  79. package/context/msg/msg.js +0 -35
  80. package/context/resources/IResources.d.ts +0 -68
  81. package/context/resources/IResources.js +0 -2
  82. package/context/resources/impl/resources.d.ts +0 -42
  83. package/context/resources/impl/resources.js +0 -161
  84. package/context/tasks/tasks.d.ts +0 -33
  85. package/context/tasks/tasks.js +0 -139
  86. package/data/index.d.ts +0 -27
  87. package/data/index.js +0 -4
  88. package/global/application/flow/flow.d.ts +0 -99
  89. package/global/application/flow/flow.js +0 -8
  90. package/global/application/flow/impl/flow.d.ts +0 -20
  91. package/global/application/flow/impl/flow.js +0 -56
  92. package/global/application/globalVar/globalVar.d.ts +0 -7
  93. package/global/application/globalVar/globalVar.js +0 -2
  94. package/global/global.d.ts +0 -70
  95. package/global/global.js +0 -3
  96. package/hooks/api.d.ts +0 -65
  97. package/hooks/api.js +0 -347
  98. package/hooks/hooks.d.ts +0 -1
  99. package/hooks/hooks.js +0 -107
  100. package/kunlun/kunlun.d.ts +0 -55
  101. package/kunlun/kunlun.js +0 -58
  102. package/kunlun/operator/IOperator.d.ts +0 -158
  103. package/kunlun/operator/IOperator.js +0 -4
  104. package/kunlun/operator/impl/expression.d.ts +0 -75
  105. package/kunlun/operator/impl/expression.js +0 -96
  106. package/kunlun/operator/impl/logic.d.ts +0 -68
  107. package/kunlun/operator/impl/logic.js +0 -573
  108. package/kunlun/operator/impl/logicV2.d.ts +0 -59
  109. package/kunlun/operator/impl/logicV2.js +0 -197
  110. package/kunlun/operator/impl/operator.d.ts +0 -179
  111. package/kunlun/operator/impl/operator.js +0 -222
  112. package/kunlun/operator/impl/operatorV2.d.ts +0 -180
  113. package/kunlun/operator/impl/operatorV2.js +0 -216
  114. package/lib/core.d.ts +0 -4
  115. package/lib/core.js +0 -19
  116. package/request/common.d.ts +0 -13
  117. package/request/common.js +0 -88
  118. package/request/constants.d.ts +0 -12
  119. package/request/constants.js +0 -29
  120. package/request/faasinfra.d.ts +0 -8
  121. package/request/faasinfra.js +0 -146
  122. package/request/interface.d.ts +0 -121
  123. package/request/interface.js +0 -30
  124. package/request/openapi.d.ts +0 -84
  125. package/request/openapi.js +0 -1529
  126. package/request/structs.d.ts +0 -99
  127. package/request/structs.js +0 -15
  128. package/types/types.d.ts +0 -79
  129. package/types/types.js +0 -4
  130. package/version/version.d.ts +0 -2
  131. package/version/version.js +0 -8
@@ -1,246 +0,0 @@
1
- import { I18ns } from './common';
2
- export interface BaseFieldType {
3
- type: string;
4
- apiName: string;
5
- label: I18ns;
6
- }
7
- export interface KTextFieldType extends BaseFieldType {
8
- required: boolean;
9
- unique: boolean;
10
- caseSensitive: boolean;
11
- multiline: boolean;
12
- maxLength: number;
13
- validationRegex: string;
14
- errorMsg: I18ns;
15
- }
16
- export interface RichTextType extends BaseFieldType {
17
- required: boolean;
18
- maxLength: number;
19
- }
20
- export interface MultilingualType extends BaseFieldType {
21
- required: boolean;
22
- unique: boolean;
23
- caseSensitive: boolean;
24
- multiline: boolean;
25
- maxLength: number;
26
- }
27
- export interface NumberType extends BaseFieldType {
28
- required: boolean;
29
- unique: boolean;
30
- displayAsPercentage: boolean;
31
- decimalPlacesNumber: number;
32
- }
33
- export interface KDateType extends BaseFieldType {
34
- required: boolean;
35
- }
36
- export interface DateTimeType extends BaseFieldType {
37
- required: boolean;
38
- }
39
- export type SubOptionType = {
40
- label: I18ns;
41
- apiName: string;
42
- description: I18ns;
43
- color: ('grey' | 'blue' | 'cyan' | 'green' | 'yellow' | 'orange' | 'red' | 'magenta' | 'purple' | 'blueMagenta');
44
- active: boolean;
45
- };
46
- export interface OptionType extends BaseFieldType {
47
- required: boolean;
48
- multiple: boolean;
49
- optionSource: ('custom' | 'global');
50
- globalOptionApiName: string;
51
- optionList: SubOptionType[];
52
- }
53
- export interface Email extends BaseFieldType {
54
- required: boolean;
55
- unique: boolean;
56
- }
57
- export interface MobileNumber extends BaseFieldType {
58
- required: boolean;
59
- unique: boolean;
60
- }
61
- export interface Boolean extends BaseFieldType {
62
- descriptionWhenTrue: I18ns;
63
- descriptionWhenFalse: I18ns;
64
- defaultValue: boolean;
65
- }
66
- export interface AvatarOrLogo extends BaseFieldType {
67
- displayStyle: ('square' | 'round');
68
- }
69
- export interface SortConditionType {
70
- fieldApiName: string;
71
- sort: ('asc' | 'desc');
72
- }
73
- type ConditionType = {
74
- left: {
75
- objectApiName: string;
76
- fieldApiName: string;
77
- };
78
- operator: ('eq' | 'neq' | 'in' | 'notIn' | 'empty' | 'notEmpty' | 'lte' | 'gte' | 'hasAllOf' | 'hasNoneOf' | 'hasAnyOf');
79
- valueType: ('reference' | 'specified');
80
- right: (object | string);
81
- };
82
- export type CriterionType = {
83
- conditions: ConditionType[];
84
- logic: string;
85
- };
86
- export type FilterType = {
87
- label: string;
88
- needTriggerCriterion: boolean;
89
- triggerCriterion: CriterionType;
90
- criterion: CriterionType;
91
- errorMsg: I18ns;
92
- };
93
- export type RegionFilterType = {
94
- id: string;
95
- label: string;
96
- errorMessage: I18ns;
97
- recordFilter: CriterionType;
98
- precondition: object;
99
- };
100
- export interface Lookup extends BaseFieldType {
101
- required: boolean;
102
- multiple: boolean;
103
- objectApiName: string;
104
- hierarchy: boolean;
105
- displayStyle: ('search' | 'dropDown' | 'tree');
106
- sortConditions: SortConditionType[];
107
- filter: FilterType[];
108
- }
109
- export interface FormulaType extends BaseFieldType {
110
- returnType: string;
111
- formula: I18ns;
112
- }
113
- export interface AutoIDType extends BaseFieldType {
114
- generateMethod: ('random' | 'incremental');
115
- digitsNumber: number;
116
- prefix: string;
117
- suffix: string;
118
- }
119
- export interface ReferenceFieldType extends BaseFieldType {
120
- guideFieldApiName: string;
121
- fieldApiName: string;
122
- }
123
- export interface FileType extends BaseFieldType {
124
- required: boolean;
125
- multiple: boolean;
126
- fileTypes: string[];
127
- }
128
- export interface BackLookuType extends BaseFieldType {
129
- objectApiName: string;
130
- fieldApiName: string;
131
- }
132
- export interface CompositeType extends BaseFieldType {
133
- compositeTypeApiName: string;
134
- subFields: BaseFieldType[];
135
- required: boolean;
136
- multiple: boolean;
137
- }
138
- export interface ExtractSingleRecordType extends BaseFieldType {
139
- compositeTypeApiName: string;
140
- subFields: BaseFieldType[];
141
- filter: FilterType[];
142
- sortConditions: SortConditionType[];
143
- recordPosition: number;
144
- }
145
- export type FieldType = {
146
- 'allow_search': boolean;
147
- 'api_name': string;
148
- 'calculated': boolean;
149
- 'description': I18ns;
150
- 'domain': number;
151
- 'encryption_mode': string;
152
- 'field_permission': number;
153
- 'formula_id': number;
154
- 'id': number;
155
- 'indexed': number;
156
- 'inherit_settings': object;
157
- 'is_encrypted': boolean;
158
- 'is_inherit': boolean;
159
- 'is_progress_field': boolean;
160
- 'label': I18ns;
161
- 'namespace': string;
162
- 'object_api_name': string;
163
- 'object_id': number;
164
- 'order': number;
165
- 'required': boolean;
166
- 'tenant_id': number;
167
- 'type': {
168
- 'name': string;
169
- 'settings': {
170
- 'multiline': boolean;
171
- 'text_version': number;
172
- 'decimal_places': number;
173
- 'display_as_percentage': boolean;
174
- 'placeholder': object;
175
- 'max_length': number;
176
- 'regexp_expression': string;
177
- 'regexp_err_msg': I18ns;
178
- 'is_array': boolean;
179
- 'option_type': string;
180
- 'related_to_global_option': {
181
- 'apiName': string;
182
- 'id': number;
183
- 'name': string;
184
- };
185
- 'options': {
186
- 'name': I18ns;
187
- 'api_name': string;
188
- 'description': I18ns;
189
- 'color_id': string;
190
- 'active': boolean;
191
- }[];
192
- 'description_if_true': I18ns;
193
- 'description_if_false': I18ns;
194
- 'display_style': string;
195
- 'default_value': boolean;
196
- 'referenced_object_api_name': string;
197
- 'is_hierarchy': boolean;
198
- 'return_type': string;
199
- 'formulas': I18ns;
200
- 'generation_method': string;
201
- 'digits': number;
202
- 'prefix': string;
203
- 'suffix': string;
204
- 'target_referenced_object_api_name': string;
205
- 'target_reference_field_api_name': string;
206
- 'multiple': boolean;
207
- 'mime_types': string[];
208
- 'related_to_object_api_name': string;
209
- 'related_to_field_api_name': string;
210
- 'related_to_api_name': string;
211
- 'related_to_fields': object[];
212
- 'filter': FilterType[];
213
- 'sort': {
214
- 'field': string;
215
- 'type': 'string';
216
- 'direction': ('asc' | 'desc');
217
- }[];
218
- 'filter_record': {
219
- 'index': number;
220
- 'type': string;
221
- };
222
- 'is_extract': boolean;
223
- 'rollup_function_type': string;
224
- 'rolluped_object': {
225
- 'api_alias': string;
226
- };
227
- 'rolluped_field': {
228
- 'api_alias': string;
229
- };
230
- 'rolluped_lookup_field': {
231
- 'api_alias': string;
232
- };
233
- 'rollup_range_filter': CriterionType;
234
- 'hasLevelStrict': boolean;
235
- 'strictLevel': number;
236
- };
237
- };
238
- 'unique_type': number;
239
- 'updated_at': number;
240
- 'updated_by': {
241
- 'avatar': object;
242
- 'id': number;
243
- 'name': string;
244
- };
245
- };
246
- export {};
@@ -1,4 +0,0 @@
1
- "use strict";
2
- // Copyright 2022 ByteDance Ltd. and/or its affiliates
3
- // SPDX-License-Identifier: MIT
4
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,128 +0,0 @@
1
- import { MultilingualTypeV3 } from './common';
2
- import { CriterionType, SortConditionType } from './objects';
3
- export interface BaseFieldTypeV3 {
4
- type: string;
5
- apiName: string;
6
- label: MultilingualTypeV3;
7
- }
8
- export interface KTextFieldTypeV3 extends BaseFieldTypeV3 {
9
- required: boolean;
10
- unique: boolean;
11
- caseSensitive: boolean;
12
- multiline: boolean;
13
- maxLength: number;
14
- validationRegex: string;
15
- errorMsg: MultilingualTypeV3;
16
- }
17
- export interface RichTextTypeV3 extends BaseFieldTypeV3 {
18
- required: boolean;
19
- maxLength: number;
20
- }
21
- export interface KMultilingualTypeV3 extends BaseFieldTypeV3 {
22
- required: boolean;
23
- unique: boolean;
24
- caseSensitive: boolean;
25
- multiline: boolean;
26
- maxLength: number;
27
- }
28
- export interface NumberTypeV3 extends BaseFieldTypeV3 {
29
- required: boolean;
30
- unique: boolean;
31
- displayAsPercentage: boolean;
32
- decimalPlacesNumber: number;
33
- }
34
- export interface KDateTypeV3 extends BaseFieldTypeV3 {
35
- required: boolean;
36
- }
37
- export interface DateTimeTypeV3 extends BaseFieldTypeV3 {
38
- required: boolean;
39
- }
40
- export interface SubOptionTypeV3 {
41
- label: MultilingualTypeV3;
42
- apiName: string;
43
- description: MultilingualTypeV3;
44
- color: ('grey' | 'blue' | 'cyan' | 'green' | 'yellow' | 'orange' | 'red' | 'magenta' | 'purple' | 'blueMagenta');
45
- active: boolean;
46
- }
47
- export interface OptionTypeV3 extends BaseFieldTypeV3 {
48
- required: boolean;
49
- multiple: boolean;
50
- optionSource: ('custom' | 'global');
51
- globalOptionApiName: string;
52
- optionList: SubOptionTypeV3[];
53
- }
54
- export interface EmailV3 extends BaseFieldTypeV3 {
55
- required: boolean;
56
- unique: boolean;
57
- }
58
- export interface MobileNumberV3 extends BaseFieldTypeV3 {
59
- required: boolean;
60
- unique: boolean;
61
- }
62
- export interface BooleanV3 extends BaseFieldTypeV3 {
63
- descriptionWhenTrue: MultilingualTypeV3;
64
- descriptionWhenFalse: MultilingualTypeV3;
65
- defaultValue: boolean;
66
- }
67
- export interface AvatarOrLogoV3 extends BaseFieldTypeV3 {
68
- displayStyle: ('square' | 'round');
69
- }
70
- export type FilterTypeV3 = {
71
- label: string;
72
- needTriggerCriterion: boolean;
73
- triggerCriterion: CriterionType;
74
- criterion: CriterionType;
75
- errorMsg: MultilingualTypeV3;
76
- };
77
- export interface RegionFilterTypeV3 {
78
- id: string;
79
- label: string;
80
- errorMessage: MultilingualTypeV3;
81
- recordFilter: CriterionType;
82
- precondition: object;
83
- }
84
- export interface LookupV3 extends BaseFieldTypeV3 {
85
- required: boolean;
86
- multiple: boolean;
87
- objectApiName: string;
88
- hierarchy: boolean;
89
- displayStyle: ('search' | 'dropDown' | 'tree');
90
- sortConditions: SortConditionType[];
91
- filter: FilterTypeV3[];
92
- }
93
- export interface FormulaTypeV3 extends BaseFieldTypeV3 {
94
- returnType: string;
95
- formula: MultilingualTypeV3;
96
- }
97
- export interface AutoIDTypeV3 extends BaseFieldTypeV3 {
98
- generateMethod: ('random' | 'incremental');
99
- digitsNumber: number;
100
- prefix: string;
101
- suffix: string;
102
- }
103
- export interface ReferenceFieldTypeV3 extends BaseFieldTypeV3 {
104
- guideFieldApiName: string;
105
- fieldApiName: string;
106
- }
107
- export interface FileTypeV3 extends BaseFieldTypeV3 {
108
- required: boolean;
109
- multiple: boolean;
110
- fileTypes: string[];
111
- }
112
- export interface BackLookuTypeV3 extends BaseFieldTypeV3 {
113
- objectApiName: string;
114
- fieldApiName: string;
115
- }
116
- export interface CompositeTypeV3 extends BaseFieldTypeV3 {
117
- compositeTypeApiName: string;
118
- subFields: BaseFieldTypeV3[];
119
- required: boolean;
120
- multiple: boolean;
121
- }
122
- export interface ExtractSingleRecordTypeV3 extends BaseFieldTypeV3 {
123
- compositeTypeApiName: string;
124
- subFields: BaseFieldTypeV3[];
125
- filter: FilterTypeV3[];
126
- sortConditions: SortConditionType[];
127
- recordPosition: number;
128
- }
@@ -1,4 +0,0 @@
1
- "use strict";
2
- // Copyright 2022 ByteDance Ltd. and/or its affiliates
3
- // SPDX-License-Identifier: MIT
4
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,38 +0,0 @@
1
- import * as common from '@byted-apaas/server-common-node';
2
- import Multilingual = common.fieldType.Multilingual;
3
- export type _IconType = 'success' | 'error' | 'progress' | 'info';
4
- export declare class _NotifyCenter {
5
- /**
6
- * 消息中心推送消息
7
- * @param msg 消息
8
- */
9
- create(msg: {
10
- icon: _IconType;
11
- percent: Number;
12
- target_users: number[];
13
- title: Multilingual;
14
- detail: Multilingual;
15
- }): Promise<number>;
16
- /**
17
- * 消息中心更新消息
18
- * @param msgId 消息 ID
19
- * @param msg 消息
20
- */
21
- update(msgId: number, msg: {
22
- icon?: _IconType;
23
- percent?: Number;
24
- target_users?: number[];
25
- title?: Multilingual;
26
- detail?: Multilingual;
27
- }): Promise<void>;
28
- }
29
- /**
30
- * 消息类
31
- */
32
- export declare class Message {
33
- /**
34
- * 消息中心
35
- */
36
- notifyCenter: _NotifyCenter;
37
- constructor();
38
- }
@@ -1,35 +0,0 @@
1
- "use strict";
2
- // Copyright 2022 ByteDance Ltd. and/or its affiliates
3
- // SPDX-License-Identifier: MIT
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.Message = exports._NotifyCenter = void 0;
6
- const Request = require("../../request/interface");
7
- class _NotifyCenter {
8
- /**
9
- * 消息中心推送消息
10
- * @param msg 消息
11
- */
12
- async create(msg) {
13
- return await Request.GetInstance().createMessage(msg);
14
- }
15
- ;
16
- /**
17
- * 消息中心更新消息
18
- * @param msgId 消息 ID
19
- * @param msg 消息
20
- */
21
- async update(msgId, msg) {
22
- return await Request.GetInstance().updateMessage(msgId, msg);
23
- }
24
- ;
25
- }
26
- exports._NotifyCenter = _NotifyCenter;
27
- /**
28
- * 消息类
29
- */
30
- class Message {
31
- constructor() {
32
- this.notifyCenter = new _NotifyCenter();
33
- }
34
- }
35
- exports.Message = Message;
@@ -1,68 +0,0 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
- import { Stream } from 'stream';
4
- import { UploadFileResp } from '../../request/interface';
5
- export interface _FileInfo {
6
- id: string;
7
- }
8
- export interface _IKunlunFile {
9
- /**
10
- * 上传文件
11
- * @param filePath 文件路径
12
- * @param expire 文件过期时间,可选,单位:秒
13
- * @param fileName 文件名,可选
14
- */
15
- upload(filePath: string, expire?: number, fileName?: string): Promise<UploadFileResp>;
16
- /**
17
- * 上传文件
18
- * @param stream 文件流
19
- * @param expire 文件过期时间,可选,单位:秒
20
- * @param fileName 文件名,可选
21
- */
22
- upload(stream: Stream, expire?: number, fileName?: string): Promise<UploadFileResp>;
23
- /**
24
- * 下载文件
25
- * @param fileToken 文件令牌
26
- */
27
- download(fileToken: string): Promise<Buffer>;
28
- /**
29
- * 下载文件
30
- * @param fileToken 文件令牌
31
- * @param filePath 文件保存的路径
32
- */
33
- download(fileToken: string, filePath: string): Promise<void>;
34
- /**
35
- * 下载文件
36
- * @param fileInfo 文件信息
37
- */
38
- download(fileInfo: _FileInfo): Promise<Buffer>;
39
- /**
40
- * 下载文件
41
- * @param fileInfo 文件信息
42
- * @param filePath 文件保存的路径
43
- */
44
- download(fileInfo: _FileInfo, filePath: string): Promise<void>;
45
- }
46
- export type FileUploadResult = {
47
- fileId: string;
48
- type: string;
49
- name: string;
50
- size: number;
51
- };
52
- export type UploadAvatarResult = {
53
- ImageId: string;
54
- PreviewImageId: string;
55
- };
56
- export interface _IOpenSDKFile {
57
- Upload(fileName: string, path: string): Promise<FileUploadResult>;
58
- Upload(fileName: string, reader: Stream): Promise<FileUploadResult>;
59
- Upload(fileName: string, buffer: Buffer): Promise<FileUploadResult>;
60
- UploadAvatar(fileName: string, path: string): Promise<UploadAvatarResult>;
61
- UploadAvatar(fileName: string, reader: Stream): Promise<UploadAvatarResult>;
62
- UploadAvatar(fileName: string, buffer: Buffer): Promise<UploadAvatarResult>;
63
- Download(fileID: string): Promise<Buffer>;
64
- DownloadAvatar(imageID: string): Promise<Buffer>;
65
- }
66
- export interface _IOpenSDKResources {
67
- file: _IOpenSDKFile;
68
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,42 +0,0 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
- import { Stream } from 'stream';
4
- import { _FileInfo, _IKunlunFile, _IOpenSDKFile, UploadAvatarResult, FileUploadResult } from '../IResources';
5
- import * as Request from '../../../request/interface';
6
- import { AppCtx } from '../../../application/application';
7
- export declare class _KunlunOpenSDKFile implements _IOpenSDKFile {
8
- appCtx: AppCtx;
9
- constructor(appCtx: AppCtx);
10
- Upload(fileName: string, path: string): Promise<FileUploadResult>;
11
- Upload(fileName: string, reader: Stream): Promise<FileUploadResult>;
12
- Upload(fileName: string, buffer: Buffer): Promise<FileUploadResult>;
13
- UploadAvatar(fileName: string, path: string): Promise<UploadAvatarResult>;
14
- UploadAvatar(fileName: string, reader: Stream): Promise<UploadAvatarResult>;
15
- UploadAvatar(fileName: string, buffer: Buffer): Promise<UploadAvatarResult>;
16
- Download(fileID: string): Promise<Buffer>;
17
- DownloadAvatar(imageID: string): Promise<Buffer>;
18
- }
19
- export declare class _KunlunFile implements _IKunlunFile {
20
- download(fileToken: string): Promise<Buffer>;
21
- download(fileToken: string, filePath?: string): Promise<void>;
22
- download(fileToken: _FileInfo): Promise<Buffer>;
23
- download(fileInfo: _FileInfo, filePath: string): Promise<void>;
24
- upload(filePath: string): Promise<Request.UploadFileResp>;
25
- upload(stream: Stream): Promise<Request.UploadFileResp>;
26
- upload(filePath: string, expire: number, fileName?: string): Promise<Request.UploadFileResp>;
27
- upload(stream: Stream, expire: number, fileName?: string): Promise<Request.UploadFileResp>;
28
- }
29
- /**
30
- * OpenSDK 静态资源操作类
31
- */
32
- export declare class _OpenSDKResources {
33
- file: _IOpenSDKFile;
34
- constructor(appCtx: AppCtx);
35
- }
36
- /**
37
- * 静态资源操作类
38
- */
39
- export declare class _Resources {
40
- file: _IKunlunFile;
41
- constructor();
42
- }