@satorijs/adapter-lark 3.11.9 → 3.12.0

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 (52) hide show
  1. package/lib/bot.d.ts +5 -5
  2. package/lib/http.d.ts +6 -3
  3. package/lib/index.cjs +293 -223
  4. package/lib/types/acs.d.ts +4 -1
  5. package/lib/types/apaas.d.ts +152 -0
  6. package/lib/types/application.d.ts +20 -4
  7. package/lib/types/approval.d.ts +0 -13
  8. package/lib/types/attendance.d.ts +11 -5
  9. package/lib/types/authen.d.ts +8 -2
  10. package/lib/types/bitable.d.ts +25 -4
  11. package/lib/types/board.d.ts +17 -0
  12. package/lib/types/calendar.d.ts +16 -5
  13. package/lib/types/contact.d.ts +55 -12
  14. package/lib/types/corehr.d.ts +754 -142
  15. package/lib/types/drive.d.ts +20 -3
  16. package/lib/types/ehr.d.ts +11 -2
  17. package/lib/types/helpdesk.d.ts +15 -6
  18. package/lib/types/hire.d.ts +13 -13
  19. package/lib/types/human_authentication.d.ts +1 -1
  20. package/lib/types/im.d.ts +76 -20
  21. package/lib/types/index.d.ts +712 -115
  22. package/lib/types/mail.d.ts +106 -16
  23. package/lib/types/search.d.ts +4 -1
  24. package/lib/ws.d.ts +30 -0
  25. package/package.json +6 -3
  26. package/src/bot.ts +28 -15
  27. package/src/http.ts +10 -4
  28. package/src/types/acs.ts +4 -1
  29. package/src/types/apaas.ts +185 -0
  30. package/src/types/application.ts +20 -4
  31. package/src/types/approval.ts +0 -15
  32. package/src/types/attendance.ts +11 -5
  33. package/src/types/authen.ts +8 -2
  34. package/src/types/bitable.ts +25 -4
  35. package/src/types/board.ts +22 -0
  36. package/src/types/calendar.ts +16 -5
  37. package/src/types/contact.ts +55 -12
  38. package/src/types/corehr.ts +796 -142
  39. package/src/types/drive.ts +20 -3
  40. package/src/types/ehr.ts +11 -2
  41. package/src/types/helpdesk.ts +15 -6
  42. package/src/types/hire.ts +17 -17
  43. package/src/types/human_authentication.ts +1 -1
  44. package/src/types/im.ts +76 -20
  45. package/src/types/index.ts +738 -115
  46. package/src/types/mail.ts +106 -16
  47. package/src/types/search.ts +4 -1
  48. package/src/ws.ts +183 -0
  49. package/lib/types/api.d.ts +0 -28510
  50. package/lib/types/internal.d.ts +0 -21
  51. package/lib/types/message/content.d.ts +0 -433
  52. package/lib/types/message/index.d.ts +0 -95
package/lib/bot.d.ts CHANGED
@@ -1,15 +1,16 @@
1
1
  import { Bot, Context, h, HTTP, Schema, Universal } from '@satorijs/core';
2
2
  import { HttpServer } from './http';
3
+ import { WsClient } from './ws';
3
4
  import { LarkMessageEncoder } from './message';
4
5
  import { Internal } from './internal';
5
- export declare class LarkBot<C extends Context = Context> extends Bot<C, LarkBot.Config> {
6
+ export declare class LarkBot<C extends Context = Context, T extends LarkBot.Config = LarkBot.Config> extends Bot<C, T> {
6
7
  static inject: string[];
7
8
  static MessageEncoder: typeof LarkMessageEncoder;
8
9
  _refresher?: NodeJS.Timeout;
9
10
  http: HTTP;
10
11
  assetsQuester: HTTP;
11
12
  internal: Internal<C>;
12
- constructor(ctx: C, config: LarkBot.Config);
13
+ constructor(ctx: C, config: T);
13
14
  getResourceUrl(type: string, message_id: string, file_key: string): string;
14
15
  initialize(): Promise<void>;
15
16
  private refreshToken;
@@ -43,12 +44,11 @@ export declare class LarkBot<C extends Context = Context> extends Bot<C, LarkBot
43
44
  createUpload(...uploads: Universal.Upload[]): Promise<string[]>;
44
45
  }
45
46
  export declare namespace LarkBot {
46
- interface Config extends HttpServer.Options, HTTP.Config {
47
+ interface BaseConfig extends HTTP.Config {
47
48
  appId: string;
48
49
  appSecret: string;
49
- encryptKey?: string;
50
- verificationToken?: string;
51
50
  }
51
+ type Config = BaseConfig & (HttpServer.Options | WsClient.Options);
52
52
  const Config: Schema<Config>;
53
53
  }
54
54
  export { LarkBot as FeishuBot };
package/lib/http.d.ts CHANGED
@@ -1,21 +1,24 @@
1
1
  import { Adapter, Context, Schema } from '@satorijs/core';
2
2
  import { LarkBot } from './bot';
3
3
  import { EventPayload } from './utils';
4
- export declare class HttpServer<C extends Context = Context> extends Adapter<C, LarkBot<C>> {
4
+ export declare class HttpServer<C extends Context = Context> extends Adapter<C, LarkBot<C, LarkBot.BaseConfig & HttpServer.Options>> {
5
5
  static inject: string[];
6
6
  private logger;
7
7
  private ciphers;
8
8
  constructor(ctx: C, bot: LarkBot<C>);
9
- fork(ctx: C, bot: LarkBot<C>): Promise<void>;
10
- connect(bot: LarkBot): Promise<void>;
9
+ fork(ctx: C, bot: LarkBot<C, LarkBot.BaseConfig & HttpServer.Options>): Promise<void>;
10
+ connect(bot: LarkBot<C, LarkBot.BaseConfig & HttpServer.Options>): Promise<void>;
11
11
  dispatchSession(body: EventPayload): Promise<void>;
12
12
  private _tryDecryptBody;
13
13
  private _refreshCipher;
14
14
  }
15
15
  export declare namespace HttpServer {
16
16
  interface Options {
17
+ protocol: 'http';
17
18
  selfUrl?: string;
18
19
  path?: string;
20
+ encryptKey?: string;
21
+ verificationToken?: string;
19
22
  verifyToken?: boolean;
20
23
  verifySignature?: boolean;
21
24
  }