@satorijs/adapter-lark 3.11.8 → 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 (68) hide show
  1. package/lib/bot.d.ts +5 -5
  2. package/lib/http.d.ts +6 -3
  3. package/lib/index.cjs +634 -261
  4. package/lib/types/acs.d.ts +4 -1
  5. package/lib/types/aily.d.ts +3 -3
  6. package/lib/types/apaas.d.ts +190 -28
  7. package/lib/types/application.d.ts +20 -4
  8. package/lib/types/approval.d.ts +0 -13
  9. package/lib/types/attendance.d.ts +11 -5
  10. package/lib/types/authen.d.ts +8 -2
  11. package/lib/types/bitable.d.ts +25 -4
  12. package/lib/types/board.d.ts +56 -0
  13. package/lib/types/calendar.d.ts +71 -5
  14. package/lib/types/cardkit.d.ts +2 -2
  15. package/lib/types/compensation.d.ts +400 -0
  16. package/lib/types/contact.d.ts +55 -12
  17. package/lib/types/corehr.d.ts +1287 -79
  18. package/lib/types/directory.d.ts +3 -41
  19. package/lib/types/docx.d.ts +23 -0
  20. package/lib/types/drive.d.ts +107 -90
  21. package/lib/types/ehr.d.ts +11 -2
  22. package/lib/types/helpdesk.d.ts +15 -6
  23. package/lib/types/hire.d.ts +52 -3
  24. package/lib/types/human_authentication.d.ts +1 -1
  25. package/lib/types/im.d.ts +77 -21
  26. package/lib/types/index.d.ts +1670 -105
  27. package/lib/types/mail.d.ts +106 -16
  28. package/lib/types/payroll.d.ts +117 -81
  29. package/lib/types/performance.d.ts +1 -1
  30. package/lib/types/search.d.ts +4 -1
  31. package/lib/types/security_and_compliance.d.ts +254 -1
  32. package/lib/ws.d.ts +30 -0
  33. package/package.json +6 -3
  34. package/src/bot.ts +28 -15
  35. package/src/http.ts +10 -4
  36. package/src/types/acs.ts +4 -1
  37. package/src/types/aily.ts +3 -3
  38. package/src/types/apaas.ts +237 -38
  39. package/src/types/application.ts +20 -4
  40. package/src/types/approval.ts +0 -15
  41. package/src/types/attendance.ts +11 -5
  42. package/src/types/authen.ts +8 -2
  43. package/src/types/bitable.ts +25 -4
  44. package/src/types/board.ts +75 -2
  45. package/src/types/calendar.ts +88 -5
  46. package/src/types/cardkit.ts +2 -2
  47. package/src/types/compensation.ts +485 -0
  48. package/src/types/contact.ts +55 -12
  49. package/src/types/corehr.ts +1480 -123
  50. package/src/types/directory.ts +3 -53
  51. package/src/types/docx.ts +29 -0
  52. package/src/types/drive.ts +129 -112
  53. package/src/types/ehr.ts +11 -2
  54. package/src/types/helpdesk.ts +15 -6
  55. package/src/types/hire.ts +66 -3
  56. package/src/types/human_authentication.ts +1 -1
  57. package/src/types/im.ts +77 -21
  58. package/src/types/index.ts +1751 -107
  59. package/src/types/mail.ts +106 -16
  60. package/src/types/payroll.ts +146 -103
  61. package/src/types/performance.ts +1 -1
  62. package/src/types/search.ts +4 -1
  63. package/src/types/security_and_compliance.ts +292 -1
  64. package/src/ws.ts +183 -0
  65. package/lib/types/api.d.ts +0 -28510
  66. package/lib/types/internal.d.ts +0 -21
  67. package/lib/types/message/content.d.ts +0 -433
  68. 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
  }