@lark-project/js-sdk 0.1.2 → 0.1.4
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/CHANGELOG.md +2 -0
- package/dist/es/index.js +36 -1
- package/dist/lib/index.js +38 -1
- package/dist/types/index.d.ts +61 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/es/index.js
CHANGED
|
@@ -164,6 +164,22 @@ _a6 = IMPL_KEY;
|
|
|
164
164
|
*/
|
|
165
165
|
Navigation[_a6] = "navigation";
|
|
166
166
|
|
|
167
|
+
// src/biz/Storage.ts
|
|
168
|
+
var _a7;
|
|
169
|
+
var Storage = class extends BaseModel {
|
|
170
|
+
/**
|
|
171
|
+
* @internal
|
|
172
|
+
*/
|
|
173
|
+
static load() {
|
|
174
|
+
throw new Error("not implemented");
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
_a7 = IMPL_KEY;
|
|
178
|
+
/**
|
|
179
|
+
* @internal
|
|
180
|
+
*/
|
|
181
|
+
Storage[_a7] = "storage";
|
|
182
|
+
|
|
167
183
|
// src/client.ts
|
|
168
184
|
function getImplClass(decl, impls) {
|
|
169
185
|
return impls == null ? void 0 : impls[decl[IMPL_KEY]];
|
|
@@ -178,6 +194,12 @@ var _SDKClient = class {
|
|
|
178
194
|
get navigation() {
|
|
179
195
|
return getImplValue(Navigation, this._meegoBizHub);
|
|
180
196
|
}
|
|
197
|
+
/**
|
|
198
|
+
* 本地存储
|
|
199
|
+
*/
|
|
200
|
+
get storage() {
|
|
201
|
+
return getImplValue(Storage, this._meegoBizHub);
|
|
202
|
+
}
|
|
181
203
|
/**
|
|
182
204
|
* 应用上下文
|
|
183
205
|
*/
|
|
@@ -234,7 +256,7 @@ var SDKClient = _SDKClient;
|
|
|
234
256
|
/**
|
|
235
257
|
* SDK 版本号
|
|
236
258
|
*/
|
|
237
|
-
SDKClient.version = "0.1.
|
|
259
|
+
SDKClient.version = "0.1.4";
|
|
238
260
|
|
|
239
261
|
// src/types/biz.ts
|
|
240
262
|
var AttributeType = /* @__PURE__ */ ((AttributeType2) => {
|
|
@@ -346,6 +368,17 @@ var NotFoundError = class extends CustomError {
|
|
|
346
368
|
}
|
|
347
369
|
};
|
|
348
370
|
|
|
371
|
+
// src/errors/OutOfLimitError.ts
|
|
372
|
+
var OutOfLimitError = class extends CustomError {
|
|
373
|
+
constructor(options) {
|
|
374
|
+
super({
|
|
375
|
+
message: "out of the limit",
|
|
376
|
+
originMessage: options.originMessage
|
|
377
|
+
});
|
|
378
|
+
this.name = "OutOfLimitError";
|
|
379
|
+
}
|
|
380
|
+
};
|
|
381
|
+
|
|
349
382
|
// src/index.ts
|
|
350
383
|
var src_default = SDKClient;
|
|
351
384
|
export {
|
|
@@ -363,8 +396,10 @@ export {
|
|
|
363
396
|
NoAuthError,
|
|
364
397
|
NodeStatus,
|
|
365
398
|
NotFoundError,
|
|
399
|
+
OutOfLimitError,
|
|
366
400
|
SDKClient,
|
|
367
401
|
Space,
|
|
402
|
+
Storage,
|
|
368
403
|
WorkItem,
|
|
369
404
|
WorkObject,
|
|
370
405
|
src_default as default
|
package/dist/lib/index.js
CHANGED
|
@@ -62,8 +62,10 @@ __export(src_exports, {
|
|
|
62
62
|
NoAuthError: () => NoAuthError,
|
|
63
63
|
NodeStatus: () => NodeStatus,
|
|
64
64
|
NotFoundError: () => NotFoundError,
|
|
65
|
+
OutOfLimitError: () => OutOfLimitError,
|
|
65
66
|
SDKClient: () => SDKClient,
|
|
66
67
|
Space: () => Space,
|
|
68
|
+
Storage: () => Storage,
|
|
67
69
|
WorkItem: () => WorkItem,
|
|
68
70
|
WorkObject: () => WorkObject,
|
|
69
71
|
default: () => src_default
|
|
@@ -206,6 +208,22 @@ _a6 = IMPL_KEY;
|
|
|
206
208
|
*/
|
|
207
209
|
Navigation[_a6] = "navigation";
|
|
208
210
|
|
|
211
|
+
// src/biz/Storage.ts
|
|
212
|
+
var _a7;
|
|
213
|
+
var Storage = class extends BaseModel {
|
|
214
|
+
/**
|
|
215
|
+
* @internal
|
|
216
|
+
*/
|
|
217
|
+
static load() {
|
|
218
|
+
throw new Error("not implemented");
|
|
219
|
+
}
|
|
220
|
+
};
|
|
221
|
+
_a7 = IMPL_KEY;
|
|
222
|
+
/**
|
|
223
|
+
* @internal
|
|
224
|
+
*/
|
|
225
|
+
Storage[_a7] = "storage";
|
|
226
|
+
|
|
209
227
|
// src/client.ts
|
|
210
228
|
function getImplClass(decl, impls) {
|
|
211
229
|
return impls == null ? void 0 : impls[decl[IMPL_KEY]];
|
|
@@ -220,6 +238,12 @@ var _SDKClient = class {
|
|
|
220
238
|
get navigation() {
|
|
221
239
|
return getImplValue(Navigation, this._meegoBizHub);
|
|
222
240
|
}
|
|
241
|
+
/**
|
|
242
|
+
* 本地存储
|
|
243
|
+
*/
|
|
244
|
+
get storage() {
|
|
245
|
+
return getImplValue(Storage, this._meegoBizHub);
|
|
246
|
+
}
|
|
223
247
|
/**
|
|
224
248
|
* 应用上下文
|
|
225
249
|
*/
|
|
@@ -276,7 +300,7 @@ var SDKClient = _SDKClient;
|
|
|
276
300
|
/**
|
|
277
301
|
* SDK 版本号
|
|
278
302
|
*/
|
|
279
|
-
SDKClient.version = "0.1.
|
|
303
|
+
SDKClient.version = "0.1.4";
|
|
280
304
|
|
|
281
305
|
// src/types/biz.ts
|
|
282
306
|
var AttributeType = /* @__PURE__ */ ((AttributeType2) => {
|
|
@@ -388,6 +412,17 @@ var NotFoundError = class extends CustomError {
|
|
|
388
412
|
}
|
|
389
413
|
};
|
|
390
414
|
|
|
415
|
+
// src/errors/OutOfLimitError.ts
|
|
416
|
+
var OutOfLimitError = class extends CustomError {
|
|
417
|
+
constructor(options) {
|
|
418
|
+
super({
|
|
419
|
+
message: "out of the limit",
|
|
420
|
+
originMessage: options.originMessage
|
|
421
|
+
});
|
|
422
|
+
this.name = "OutOfLimitError";
|
|
423
|
+
}
|
|
424
|
+
};
|
|
425
|
+
|
|
391
426
|
// src/index.ts
|
|
392
427
|
var src_default = SDKClient;
|
|
393
428
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -406,8 +441,10 @@ var src_default = SDKClient;
|
|
|
406
441
|
NoAuthError,
|
|
407
442
|
NodeStatus,
|
|
408
443
|
NotFoundError,
|
|
444
|
+
OutOfLimitError,
|
|
409
445
|
SDKClient,
|
|
410
446
|
Space,
|
|
447
|
+
Storage,
|
|
411
448
|
WorkItem,
|
|
412
449
|
WorkObject
|
|
413
450
|
});
|
package/dist/types/index.d.ts
CHANGED
|
@@ -298,6 +298,11 @@ type BriefView = any;
|
|
|
298
298
|
* 语言
|
|
299
299
|
*/
|
|
300
300
|
type Language = 'zh_CN' | 'en_US';
|
|
301
|
+
/**
|
|
302
|
+
* @public
|
|
303
|
+
* 颜色方案
|
|
304
|
+
*/
|
|
305
|
+
type ColorScheme = 'light' | 'dark';
|
|
301
306
|
|
|
302
307
|
/**
|
|
303
308
|
* 集成构成
|
|
@@ -479,6 +484,10 @@ declare abstract class Context extends BaseModel {
|
|
|
479
484
|
* 当前语言
|
|
480
485
|
*/
|
|
481
486
|
abstract language: Language;
|
|
487
|
+
/**
|
|
488
|
+
* 用户偏好的色彩方案
|
|
489
|
+
*/
|
|
490
|
+
abstract colorScheme: ColorScheme;
|
|
482
491
|
/**
|
|
483
492
|
* 当前登录用户信息
|
|
484
493
|
*/
|
|
@@ -777,6 +786,43 @@ declare abstract class Navigation extends BaseModel {
|
|
|
777
786
|
}) => void): void;
|
|
778
787
|
}
|
|
779
788
|
|
|
789
|
+
/**
|
|
790
|
+
* @public
|
|
791
|
+
* 本地临时存储
|
|
792
|
+
* 存储是当前登录用户 + 插件维度隔离,跨插件无法实现互相访问,每个插件的临时存储空间不超过 5MB
|
|
793
|
+
*/
|
|
794
|
+
declare abstract class Storage extends BaseModel {
|
|
795
|
+
/**
|
|
796
|
+
* @internal
|
|
797
|
+
*/
|
|
798
|
+
protected static [IMPL_KEY]: string;
|
|
799
|
+
/**
|
|
800
|
+
* @internal
|
|
801
|
+
*/
|
|
802
|
+
private static load;
|
|
803
|
+
/**
|
|
804
|
+
* 写入存储
|
|
805
|
+
* @param key 存储标识
|
|
806
|
+
* @param value 存储值
|
|
807
|
+
*/
|
|
808
|
+
abstract setItem(key: string, value: string | undefined): Promise<void>;
|
|
809
|
+
/**
|
|
810
|
+
* 读取存储
|
|
811
|
+
* @param key 存储标识
|
|
812
|
+
* @returns 存储值(Promise)
|
|
813
|
+
*/
|
|
814
|
+
abstract getItem(key: string): Promise<string | undefined>;
|
|
815
|
+
/**
|
|
816
|
+
* 移除存储
|
|
817
|
+
* @param key 待移除的存储标识
|
|
818
|
+
*/
|
|
819
|
+
abstract removeItem(key: string): Promise<void>;
|
|
820
|
+
/**
|
|
821
|
+
* 清除所有存储
|
|
822
|
+
*/
|
|
823
|
+
abstract clear(): Promise<void>;
|
|
824
|
+
}
|
|
825
|
+
|
|
780
826
|
/**
|
|
781
827
|
* @public
|
|
782
828
|
* SDKClient 的配置项
|
|
@@ -798,6 +844,10 @@ declare class SDKClient {
|
|
|
798
844
|
* 应用导航
|
|
799
845
|
*/
|
|
800
846
|
get navigation(): Navigation;
|
|
847
|
+
/**
|
|
848
|
+
* 本地存储
|
|
849
|
+
*/
|
|
850
|
+
get storage(): Storage;
|
|
801
851
|
/**
|
|
802
852
|
* 应用上下文
|
|
803
853
|
*/
|
|
@@ -871,6 +921,16 @@ declare class NotFoundError extends CustomError {
|
|
|
871
921
|
});
|
|
872
922
|
}
|
|
873
923
|
|
|
924
|
+
/**
|
|
925
|
+
* @public
|
|
926
|
+
* 超出限制异常,如 Storage 存储超额
|
|
927
|
+
*/
|
|
928
|
+
declare class OutOfLimitError extends CustomError {
|
|
929
|
+
constructor(options: {
|
|
930
|
+
originMessage: string;
|
|
931
|
+
});
|
|
932
|
+
}
|
|
933
|
+
|
|
874
934
|
/**
|
|
875
935
|
* 用于飞书项目插件读取系统数据的 JSSDK
|
|
876
936
|
*
|
|
@@ -880,4 +940,4 @@ declare class NotFoundError extends CustomError {
|
|
|
880
940
|
* @packageDocumentation
|
|
881
941
|
*/
|
|
882
942
|
|
|
883
|
-
export { AttributeType, BizLine, BriefField, BriefNode, BriefSpace, BriefTemplate, BriefView, BriefWorkItem, BriefWorkObject, ButtonFeatureContext, ButtonScene, Context, ControlFeatureContext, Field, FieldType, FlowMode, IMPL_KEY, IntegrationFeatureContext, InterceptionEvent, InterceptionFeatureContext, InternalError, Language, MEEGO_BIZ_HUB, Navigation, NoAuthError, NodeStatus, NotFoundError, PageFeatureContext, Role, RoleOwners, SDKClient, SDKClientOptions, Space, TabFeatureContext, User, ViewFeatureContext, WorkItem, WorkItemCreateFormPreset, WorkObject, SDKClient as default, unwatch };
|
|
943
|
+
export { AttributeType, BizLine, BriefField, BriefNode, BriefSpace, BriefTemplate, BriefView, BriefWorkItem, BriefWorkObject, ButtonFeatureContext, ButtonScene, ColorScheme, Context, ControlFeatureContext, Field, FieldType, FlowMode, IMPL_KEY, IntegrationFeatureContext, InterceptionEvent, InterceptionFeatureContext, InternalError, Language, MEEGO_BIZ_HUB, Navigation, NoAuthError, NodeStatus, NotFoundError, OutOfLimitError, PageFeatureContext, Role, RoleOwners, SDKClient, SDKClientOptions, Space, Storage, TabFeatureContext, User, ViewFeatureContext, WorkItem, WorkItemCreateFormPreset, WorkObject, SDKClient as default, unwatch };
|