@lark-project/js-sdk 0.0.24 → 0.0.26

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/es/index.js CHANGED
@@ -226,7 +226,7 @@ var _SDKClient = class {
226
226
  if (typeof __MEEGO_BIZ_HUB__ !== "function") {
227
227
  throw new Error("The application does not support the sdk");
228
228
  }
229
- this._meegoBizHub = __MEEGO_BIZ_HUB__({
229
+ this._meegoBizHub = yield __MEEGO_BIZ_HUB__({
230
230
  sdkVersion: _SDKClient.version
231
231
  });
232
232
  yield this._meegoBizHub.configure({
@@ -242,7 +242,7 @@ var SDKClient = _SDKClient;
242
242
  /**
243
243
  * SDK 版本号
244
244
  */
245
- SDKClient.version = "0.0.24";
245
+ SDKClient.version = "0.0.26";
246
246
 
247
247
  // src/types/biz.ts
248
248
  var FieldType = /* @__PURE__ */ ((FieldType2) => {
@@ -302,6 +302,47 @@ var InterceptionEvent = /* @__PURE__ */ ((InterceptionEvent2) => {
302
302
  return InterceptionEvent2;
303
303
  })(InterceptionEvent || {});
304
304
 
305
+ // src/errors/CustomError.ts
306
+ var CustomError = class extends Error {
307
+ constructor(options) {
308
+ super(options.message);
309
+ this.originMessage = options.originMessage;
310
+ }
311
+ };
312
+
313
+ // src/errors/InternalError.ts
314
+ var InternalError = class extends CustomError {
315
+ constructor(options) {
316
+ super({
317
+ message: "internal error",
318
+ originMessage: options.originMessage
319
+ });
320
+ this.name = "InternalError";
321
+ }
322
+ };
323
+
324
+ // src/errors/NoAuthError.ts
325
+ var NoAuthError = class extends CustomError {
326
+ constructor(options) {
327
+ super({
328
+ message: "no auth",
329
+ originMessage: options.originMessage
330
+ });
331
+ this.name = "NoAuthError";
332
+ }
333
+ };
334
+
335
+ // src/errors/NotFoundError.ts
336
+ var NotFoundError = class extends CustomError {
337
+ constructor(options) {
338
+ super({
339
+ message: "not found",
340
+ originMessage: options.originMessage
341
+ });
342
+ this.name = "NotFoundError";
343
+ }
344
+ };
345
+
305
346
  // src/index.ts
306
347
  var src_default = SDKClient;
307
348
  export {
@@ -313,7 +354,10 @@ export {
313
354
  HostEnv,
314
355
  IMPL_KEY,
315
356
  InterceptionEvent,
357
+ InternalError,
316
358
  MEEGO_BIZ_HUB,
359
+ NoAuthError,
360
+ NotFoundError,
317
361
  SDKClient,
318
362
  Session,
319
363
  Space,
package/dist/lib/index.js CHANGED
@@ -56,7 +56,10 @@ __export(src_exports, {
56
56
  HostEnv: () => HostEnv,
57
57
  IMPL_KEY: () => IMPL_KEY,
58
58
  InterceptionEvent: () => InterceptionEvent,
59
+ InternalError: () => InternalError,
59
60
  MEEGO_BIZ_HUB: () => MEEGO_BIZ_HUB,
61
+ NoAuthError: () => NoAuthError,
62
+ NotFoundError: () => NotFoundError,
60
63
  SDKClient: () => SDKClient,
61
64
  Session: () => Session,
62
65
  Space: () => Space,
@@ -264,7 +267,7 @@ var _SDKClient = class {
264
267
  if (typeof __MEEGO_BIZ_HUB__ !== "function") {
265
268
  throw new Error("The application does not support the sdk");
266
269
  }
267
- this._meegoBizHub = __MEEGO_BIZ_HUB__({
270
+ this._meegoBizHub = yield __MEEGO_BIZ_HUB__({
268
271
  sdkVersion: _SDKClient.version
269
272
  });
270
273
  yield this._meegoBizHub.configure({
@@ -280,7 +283,7 @@ var SDKClient = _SDKClient;
280
283
  /**
281
284
  * SDK 版本号
282
285
  */
283
- SDKClient.version = "0.0.24";
286
+ SDKClient.version = "0.0.26";
284
287
 
285
288
  // src/types/biz.ts
286
289
  var FieldType = /* @__PURE__ */ ((FieldType2) => {
@@ -340,6 +343,47 @@ var InterceptionEvent = /* @__PURE__ */ ((InterceptionEvent2) => {
340
343
  return InterceptionEvent2;
341
344
  })(InterceptionEvent || {});
342
345
 
346
+ // src/errors/CustomError.ts
347
+ var CustomError = class extends Error {
348
+ constructor(options) {
349
+ super(options.message);
350
+ this.originMessage = options.originMessage;
351
+ }
352
+ };
353
+
354
+ // src/errors/InternalError.ts
355
+ var InternalError = class extends CustomError {
356
+ constructor(options) {
357
+ super({
358
+ message: "internal error",
359
+ originMessage: options.originMessage
360
+ });
361
+ this.name = "InternalError";
362
+ }
363
+ };
364
+
365
+ // src/errors/NoAuthError.ts
366
+ var NoAuthError = class extends CustomError {
367
+ constructor(options) {
368
+ super({
369
+ message: "no auth",
370
+ originMessage: options.originMessage
371
+ });
372
+ this.name = "NoAuthError";
373
+ }
374
+ };
375
+
376
+ // src/errors/NotFoundError.ts
377
+ var NotFoundError = class extends CustomError {
378
+ constructor(options) {
379
+ super({
380
+ message: "not found",
381
+ originMessage: options.originMessage
382
+ });
383
+ this.name = "NotFoundError";
384
+ }
385
+ };
386
+
343
387
  // src/index.ts
344
388
  var src_default = SDKClient;
345
389
  // Annotate the CommonJS export names for ESM import in node:
@@ -352,7 +396,10 @@ var src_default = SDKClient;
352
396
  HostEnv,
353
397
  IMPL_KEY,
354
398
  InterceptionEvent,
399
+ InternalError,
355
400
  MEEGO_BIZ_HUB,
401
+ NoAuthError,
402
+ NotFoundError,
356
403
  SDKClient,
357
404
  Session,
358
405
  Space,
@@ -716,6 +716,47 @@ declare class SDKClient {
716
716
  config(options: SDKClientOptions): Promise<this>;
717
717
  }
718
718
 
719
+ /**
720
+ * @internal
721
+ */
722
+ declare class CustomError extends Error {
723
+ originMessage: string;
724
+ constructor(options: {
725
+ message: string;
726
+ originMessage: string;
727
+ });
728
+ }
729
+
730
+ /**
731
+ * @public
732
+ * 内部逻辑异常
733
+ */
734
+ declare class InternalError extends CustomError {
735
+ constructor(options: {
736
+ originMessage: string;
737
+ });
738
+ }
739
+
740
+ /**
741
+ * @public
742
+ * 无权限访问对应数据的异常
743
+ */
744
+ declare class NoAuthError extends CustomError {
745
+ constructor(options: {
746
+ originMessage: string;
747
+ });
748
+ }
749
+
750
+ /**
751
+ * @public
752
+ * 未找到对应数据的异常
753
+ */
754
+ declare class NotFoundError extends CustomError {
755
+ constructor(options: {
756
+ originMessage: string;
757
+ });
758
+ }
759
+
719
760
  /**
720
761
  * 用于飞书项目插件读取系统数据的 JSSDK
721
762
  *
@@ -725,4 +766,4 @@ declare class SDKClient {
725
766
  * @packageDocumentation
726
767
  */
727
768
 
728
- export { BizLine, BriefField, BriefNode, BriefTemplate, BriefView, BriefWorkItem, BriefWorkObject, ButtonFeatureContext, ButtonScene, ControlFeatureContext, Cursor, Field, FieldType, FlowMode, HostEnv, IMPL_KEY, IntegrationFeatureContext, InterceptionEvent, InterceptionFeatureContext, Language, MEEGO_BIZ_HUB, PageFeatureContext, Role, RoleOwners, SDKClient, SDKClientOptions, Session, Space, TabFeatureContext, User, ViewFeatureContext, WorkItem, WorkObject, SDKClient as default, unwatch };
769
+ export { BizLine, BriefField, BriefNode, BriefTemplate, BriefView, BriefWorkItem, BriefWorkObject, ButtonFeatureContext, ButtonScene, ControlFeatureContext, Cursor, Field, FieldType, FlowMode, HostEnv, IMPL_KEY, IntegrationFeatureContext, InterceptionEvent, InterceptionFeatureContext, InternalError, Language, MEEGO_BIZ_HUB, NoAuthError, NotFoundError, PageFeatureContext, Role, RoleOwners, SDKClient, SDKClientOptions, Session, Space, TabFeatureContext, User, ViewFeatureContext, WorkItem, WorkObject, SDKClient as default, unwatch };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-project/js-sdk",
3
- "version": "0.0.24",
3
+ "version": "0.0.26",
4
4
  "runtimeMinVersions": {
5
5
  "web": "2.1.0",
6
6
  "mobile": "1.1.0"