@channel.io/app-sdk-core 0.1.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 (109) hide show
  1. package/dist/errors/index.d.ts +35 -0
  2. package/dist/errors/index.d.ts.map +1 -0
  3. package/dist/errors/index.js +55 -0
  4. package/dist/errors/index.js.map +1 -0
  5. package/dist/extensions/alftask.d.ts +257 -0
  6. package/dist/extensions/alftask.d.ts.map +1 -0
  7. package/dist/extensions/alftask.js +55 -0
  8. package/dist/extensions/alftask.js.map +1 -0
  9. package/dist/extensions/apikey.d.ts +160 -0
  10. package/dist/extensions/apikey.d.ts.map +1 -0
  11. package/dist/extensions/apikey.js +41 -0
  12. package/dist/extensions/apikey.js.map +1 -0
  13. package/dist/extensions/calendar.d.ts +139 -0
  14. package/dist/extensions/calendar.d.ts.map +1 -0
  15. package/dist/extensions/calendar.js +55 -0
  16. package/dist/extensions/calendar.js.map +1 -0
  17. package/dist/extensions/command.d.ts +50 -0
  18. package/dist/extensions/command.d.ts.map +1 -0
  19. package/dist/extensions/command.js +31 -0
  20. package/dist/extensions/command.js.map +1 -0
  21. package/dist/extensions/customtab.d.ts +69 -0
  22. package/dist/extensions/customtab.d.ts.map +1 -0
  23. package/dist/extensions/customtab.js +38 -0
  24. package/dist/extensions/customtab.js.map +1 -0
  25. package/dist/extensions/index.d.ts +9 -0
  26. package/dist/extensions/index.d.ts.map +1 -0
  27. package/dist/extensions/index.js +17 -0
  28. package/dist/extensions/index.js.map +1 -0
  29. package/dist/extensions/interfaces/alftask.d.ts +58 -0
  30. package/dist/extensions/interfaces/alftask.d.ts.map +1 -0
  31. package/dist/extensions/interfaces/alftask.js +7 -0
  32. package/dist/extensions/interfaces/alftask.js.map +1 -0
  33. package/dist/extensions/interfaces/apikey.d.ts +66 -0
  34. package/dist/extensions/interfaces/apikey.d.ts.map +1 -0
  35. package/dist/extensions/interfaces/apikey.js +8 -0
  36. package/dist/extensions/interfaces/apikey.js.map +1 -0
  37. package/dist/extensions/interfaces/calendar.d.ts +153 -0
  38. package/dist/extensions/interfaces/calendar.d.ts.map +1 -0
  39. package/dist/extensions/interfaces/calendar.js +12 -0
  40. package/dist/extensions/interfaces/calendar.js.map +1 -0
  41. package/dist/extensions/interfaces/command.d.ts +92 -0
  42. package/dist/extensions/interfaces/command.d.ts.map +1 -0
  43. package/dist/extensions/interfaces/command.js +8 -0
  44. package/dist/extensions/interfaces/command.js.map +1 -0
  45. package/dist/extensions/interfaces/customtab.d.ts +82 -0
  46. package/dist/extensions/interfaces/customtab.d.ts.map +1 -0
  47. package/dist/extensions/interfaces/customtab.js +8 -0
  48. package/dist/extensions/interfaces/customtab.js.map +1 -0
  49. package/dist/extensions/interfaces/index.d.ts +25 -0
  50. package/dist/extensions/interfaces/index.d.ts.map +1 -0
  51. package/dist/extensions/interfaces/index.js +25 -0
  52. package/dist/extensions/interfaces/index.js.map +1 -0
  53. package/dist/extensions/interfaces/oauth.d.ts +78 -0
  54. package/dist/extensions/interfaces/oauth.d.ts.map +1 -0
  55. package/dist/extensions/interfaces/oauth.js +8 -0
  56. package/dist/extensions/interfaces/oauth.js.map +1 -0
  57. package/dist/extensions/interfaces/widget.d.ts +87 -0
  58. package/dist/extensions/interfaces/widget.d.ts.map +1 -0
  59. package/dist/extensions/interfaces/widget.js +8 -0
  60. package/dist/extensions/interfaces/widget.js.map +1 -0
  61. package/dist/extensions/oauth.d.ts +45 -0
  62. package/dist/extensions/oauth.d.ts.map +1 -0
  63. package/dist/extensions/oauth.js +21 -0
  64. package/dist/extensions/oauth.js.map +1 -0
  65. package/dist/extensions/widget.d.ts +90 -0
  66. package/dist/extensions/widget.d.ts.map +1 -0
  67. package/dist/extensions/widget.js +42 -0
  68. package/dist/extensions/widget.js.map +1 -0
  69. package/dist/index.d.ts +6 -0
  70. package/dist/index.d.ts.map +1 -0
  71. package/dist/index.js +11 -0
  72. package/dist/index.js.map +1 -0
  73. package/dist/schemas/extension.d.ts +15 -0
  74. package/dist/schemas/extension.d.ts.map +1 -0
  75. package/dist/schemas/extension.js +39 -0
  76. package/dist/schemas/extension.js.map +1 -0
  77. package/dist/schemas/function.d.ts +7 -0
  78. package/dist/schemas/function.d.ts.map +1 -0
  79. package/dist/schemas/function.js +31 -0
  80. package/dist/schemas/function.js.map +1 -0
  81. package/dist/schemas/index.d.ts +3 -0
  82. package/dist/schemas/index.d.ts.map +1 -0
  83. package/dist/schemas/index.js +3 -0
  84. package/dist/schemas/index.js.map +1 -0
  85. package/dist/types/context.d.ts +55 -0
  86. package/dist/types/context.d.ts.map +1 -0
  87. package/dist/types/context.js +2 -0
  88. package/dist/types/context.js.map +1 -0
  89. package/dist/types/extension.d.ts +53 -0
  90. package/dist/types/extension.d.ts.map +1 -0
  91. package/dist/types/extension.js +2 -0
  92. package/dist/types/extension.js.map +1 -0
  93. package/dist/types/function.d.ts +58 -0
  94. package/dist/types/function.d.ts.map +1 -0
  95. package/dist/types/function.js +2 -0
  96. package/dist/types/function.js.map +1 -0
  97. package/dist/types/index.d.ts +4 -0
  98. package/dist/types/index.d.ts.map +1 -0
  99. package/dist/types/index.js +4 -0
  100. package/dist/types/index.js.map +1 -0
  101. package/dist/utils/index.d.ts +2 -0
  102. package/dist/utils/index.d.ts.map +1 -0
  103. package/dist/utils/index.js +2 -0
  104. package/dist/utils/index.js.map +1 -0
  105. package/dist/utils/zod-to-json-schema.d.ts +6 -0
  106. package/dist/utils/zod-to-json-schema.d.ts.map +1 -0
  107. package/dist/utils/zod-to-json-schema.js +10 -0
  108. package/dist/utils/zod-to-json-schema.js.map +1 -0
  109. package/package.json +44 -0
@@ -0,0 +1,153 @@
1
+ import type { Calendar, EventType, TimeSlot, Attendee, Booking } from "../calendar.js";
2
+ import type { ExtensionContext } from "./oauth.js";
3
+ /**
4
+ * Calendar Extension Input Types
5
+ */
6
+ export interface ListCalendarsInput {
7
+ /** Optional page token for pagination */
8
+ pageToken?: string;
9
+ }
10
+ export interface ListCalendarsOutput {
11
+ calendars: Calendar[];
12
+ nextPageToken?: string;
13
+ }
14
+ export interface ListEventTypesInput {
15
+ /** Optional calendar ID to filter event types */
16
+ calendarId?: string;
17
+ }
18
+ export interface ListEventTypesOutput {
19
+ eventTypes: EventType[];
20
+ }
21
+ export interface GetAvailabilityInput {
22
+ /** Event type ID to check availability for */
23
+ eventTypeId: string;
24
+ /** Start date in ISO format (e.g., "2024-01-01") */
25
+ startDate: string;
26
+ /** End date in ISO format (e.g., "2024-01-31") */
27
+ endDate: string;
28
+ /** Optional timezone (e.g., "America/New_York") */
29
+ timezone?: string;
30
+ }
31
+ export interface GetAvailabilityOutput {
32
+ /** Available time slots */
33
+ slots: TimeSlot[];
34
+ }
35
+ export interface CreateBookingInput {
36
+ /** Event type ID to book */
37
+ eventTypeId: string;
38
+ /** Start time in ISO format */
39
+ startTime: string;
40
+ /** Attendee information */
41
+ attendee: Attendee;
42
+ /** Optional notes for the booking */
43
+ notes?: string;
44
+ /** Optional timezone */
45
+ timezone?: string;
46
+ }
47
+ export interface CancelBookingInput {
48
+ /** Booking ID to cancel */
49
+ bookingId: string;
50
+ /** Optional cancellation reason */
51
+ reason?: string;
52
+ }
53
+ export interface CancelBookingOutput {
54
+ /** Whether the cancellation was successful */
55
+ success: boolean;
56
+ /** Updated booking (if available) */
57
+ booking?: Booking;
58
+ }
59
+ export interface GetBookingInput {
60
+ /** Booking ID to retrieve */
61
+ bookingId: string;
62
+ }
63
+ /**
64
+ * Calendar Extension Interface
65
+ *
66
+ * Implement this interface to create a calendar/scheduling extension.
67
+ *
68
+ * @example
69
+ * ```typescript
70
+ * @Extension({ name: "calendar", systemVersion: "v1" })
71
+ * export class MyCalendarExtension implements CalendarExtensionInterface {
72
+ * @Func("calendar.listCalendars")
73
+ * async listCalendars(ctx, params): Promise<ListCalendarsOutput> {
74
+ * return { calendars: [...] };
75
+ * }
76
+ *
77
+ * @Func("calendar.listEventTypes")
78
+ * async listEventTypes(ctx, params): Promise<ListEventTypesOutput> {
79
+ * return { eventTypes: [...] };
80
+ * }
81
+ *
82
+ * @Func("calendar.getAvailability")
83
+ * async getAvailability(ctx, params): Promise<GetAvailabilityOutput> {
84
+ * return { slots: [...] };
85
+ * }
86
+ *
87
+ * @Func("calendar.createBooking")
88
+ * async createBooking(ctx, params): Promise<Booking> {
89
+ * return { id: "...", ... };
90
+ * }
91
+ *
92
+ * @Func("calendar.cancelBooking")
93
+ * async cancelBooking(ctx, params): Promise<CancelBookingOutput> {
94
+ * return { success: true };
95
+ * }
96
+ *
97
+ * @Func("calendar.getBooking")
98
+ * async getBooking(ctx, params): Promise<Booking> {
99
+ * return { id: "...", ... };
100
+ * }
101
+ * }
102
+ * ```
103
+ */
104
+ export interface CalendarExtensionInterface {
105
+ /**
106
+ * List available calendars
107
+ *
108
+ * Function name: "calendar.listCalendars"
109
+ */
110
+ listCalendars(ctx: ExtensionContext, params: ListCalendarsInput): Promise<ListCalendarsOutput>;
111
+ /**
112
+ * List event types (meeting types)
113
+ *
114
+ * Function name: "calendar.listEventTypes"
115
+ */
116
+ listEventTypes(ctx: ExtensionContext, params: ListEventTypesInput): Promise<ListEventTypesOutput>;
117
+ /**
118
+ * Get available time slots for booking
119
+ *
120
+ * Function name: "calendar.getAvailability"
121
+ */
122
+ getAvailability(ctx: ExtensionContext, params: GetAvailabilityInput): Promise<GetAvailabilityOutput>;
123
+ /**
124
+ * Create a new booking
125
+ *
126
+ * Function name: "calendar.createBooking"
127
+ */
128
+ createBooking(ctx: ExtensionContext, params: CreateBookingInput): Promise<Booking>;
129
+ /**
130
+ * Cancel an existing booking
131
+ *
132
+ * Function name: "calendar.cancelBooking"
133
+ */
134
+ cancelBooking(ctx: ExtensionContext, params: CancelBookingInput): Promise<CancelBookingOutput>;
135
+ /**
136
+ * Get booking details
137
+ *
138
+ * Function name: "calendar.getBooking"
139
+ */
140
+ getBooking(ctx: ExtensionContext, params: GetBookingInput): Promise<Booking>;
141
+ }
142
+ /**
143
+ * Calendar Extension Function Names
144
+ */
145
+ export declare const CalendarFunctionNames: {
146
+ readonly listCalendars: "calendar.listCalendars";
147
+ readonly listEventTypes: "calendar.listEventTypes";
148
+ readonly getAvailability: "calendar.getAvailability";
149
+ readonly createBooking: "calendar.createBooking";
150
+ readonly cancelBooking: "calendar.cancelBooking";
151
+ readonly getBooking: "calendar.getBooking";
152
+ };
153
+ //# sourceMappingURL=calendar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../../src/extensions/interfaces/calendar.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACvF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,yCAAyC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,mBAAmB;IAClC,iDAAiD;IACjD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE,SAAS,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,oBAAoB;IACnC,8CAA8C;IAC9C,WAAW,EAAE,MAAM,CAAC;IACpB,oDAAoD;IACpD,SAAS,EAAE,MAAM,CAAC;IAClB,kDAAkD;IAClD,OAAO,EAAE,MAAM,CAAC;IAChB,mDAAmD;IACnD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,qBAAqB;IACpC,2BAA2B;IAC3B,KAAK,EAAE,QAAQ,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,kBAAkB;IACjC,4BAA4B;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,+BAA+B;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,2BAA2B;IAC3B,QAAQ,EAAE,QAAQ,CAAC;IACnB,qCAAqC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wBAAwB;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,kBAAkB;IACjC,2BAA2B;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,mCAAmC;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,mBAAmB;IAClC,8CAA8C;IAC9C,OAAO,EAAE,OAAO,CAAC;IACjB,qCAAqC;IACrC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,eAAe;IAC9B,6BAA6B;IAC7B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,MAAM,WAAW,0BAA0B;IACzC;;;;OAIG;IACH,aAAa,CAAC,GAAG,EAAE,gBAAgB,EAAE,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAE/F;;;;OAIG;IACH,cAAc,CAAC,GAAG,EAAE,gBAAgB,EAAE,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAElG;;;;OAIG;IACH,eAAe,CACb,GAAG,EAAE,gBAAgB,EACrB,MAAM,EAAE,oBAAoB,GAC3B,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAElC;;;;OAIG;IACH,aAAa,CAAC,GAAG,EAAE,gBAAgB,EAAE,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAEnF;;;;OAIG;IACH,aAAa,CAAC,GAAG,EAAE,gBAAgB,EAAE,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAE/F;;;;OAIG;IACH,UAAU,CAAC,GAAG,EAAE,gBAAgB,EAAE,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC9E;AAED;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;CAOxB,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Calendar Extension Function Names
3
+ */
4
+ export const CalendarFunctionNames = {
5
+ listCalendars: "calendar.listCalendars",
6
+ listEventTypes: "calendar.listEventTypes",
7
+ getAvailability: "calendar.getAvailability",
8
+ createBooking: "calendar.createBooking",
9
+ cancelBooking: "calendar.cancelBooking",
10
+ getBooking: "calendar.getBooking",
11
+ };
12
+ //# sourceMappingURL=calendar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calendar.js","sourceRoot":"","sources":["../../../src/extensions/interfaces/calendar.ts"],"names":[],"mappings":"AAiKA;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,aAAa,EAAE,wBAAwB;IACvC,cAAc,EAAE,yBAAyB;IACzC,eAAe,EAAE,0BAA0B;IAC3C,aAAa,EAAE,wBAAwB;IACvC,aAAa,EAAE,wBAAwB;IACvC,UAAU,EAAE,qBAAqB;CACzB,CAAC"}
@@ -0,0 +1,92 @@
1
+ import type { CommandSuggestion, CommandResult } from "../command.js";
2
+ import type { ExtensionContext } from "./oauth.js";
3
+ /**
4
+ * Command Extension Input Types
5
+ */
6
+ export interface GetSuggestionsInput {
7
+ /** Current command input text (e.g., "/schedule " -> "schedule ") */
8
+ query: string;
9
+ /** Chat ID where the command is being used */
10
+ chatId?: string;
11
+ /** User ID who is typing the command */
12
+ userId?: string;
13
+ }
14
+ export interface GetSuggestionsOutput {
15
+ /** List of command suggestions */
16
+ suggestions: CommandSuggestion[];
17
+ }
18
+ export interface ExecuteCommandInput {
19
+ /** Command name (e.g., "schedule") */
20
+ command: string;
21
+ /** Arguments passed to the command */
22
+ args: string[];
23
+ /** Raw command text */
24
+ rawText?: string;
25
+ /** Chat ID where the command was executed */
26
+ chatId?: string;
27
+ /** User ID who executed the command */
28
+ userId?: string;
29
+ }
30
+ /**
31
+ * Command Extension Interface
32
+ *
33
+ * Implement this interface to create a slash command extension.
34
+ *
35
+ * @example
36
+ * ```typescript
37
+ * @Extension({ name: "command", systemVersion: "v1" })
38
+ * export class MyCommandExtension implements CommandExtensionInterface {
39
+ * @Func("command.getSuggestions")
40
+ * @InputSchema(GetSuggestionsInputSchema)
41
+ * @OutputSchema(GetSuggestionsOutputSchema)
42
+ * async getSuggestions(ctx, params): Promise<GetSuggestionsOutput> {
43
+ * if (params.query.startsWith("meet")) {
44
+ * return {
45
+ * suggestions: [
46
+ * { value: "meeting", label: "/meeting", description: "Schedule a meeting" },
47
+ * ],
48
+ * };
49
+ * }
50
+ * return { suggestions: [] };
51
+ * }
52
+ *
53
+ * @Func("command.execute")
54
+ * @InputSchema(ExecuteCommandInputSchema)
55
+ * @OutputSchema(CommandResultSchema)
56
+ * async execute(ctx, params): Promise<CommandResult> {
57
+ * if (params.command === "meeting") {
58
+ * return {
59
+ * action: "openWam",
60
+ * wamName: "meeting-scheduler",
61
+ * wamParams: { chatId: params.chatId },
62
+ * };
63
+ * }
64
+ * return { action: "none" };
65
+ * }
66
+ * }
67
+ * ```
68
+ */
69
+ export interface CommandExtensionInterface {
70
+ /**
71
+ * Get command suggestions as user types
72
+ *
73
+ * Function name: "command.getSuggestions"
74
+ */
75
+ getSuggestions(ctx: ExtensionContext, params: GetSuggestionsInput): Promise<GetSuggestionsOutput>;
76
+ /**
77
+ * Execute a command
78
+ *
79
+ * Function name: "command.execute"
80
+ *
81
+ * @returns Action to perform (sendMessage, insertText, openWam, openUrl, or none)
82
+ */
83
+ execute(ctx: ExtensionContext, params: ExecuteCommandInput): Promise<CommandResult>;
84
+ }
85
+ /**
86
+ * Command Extension Function Names
87
+ */
88
+ export declare const CommandFunctionNames: {
89
+ readonly getSuggestions: "command.getSuggestions";
90
+ readonly execute: "command.execute";
91
+ };
92
+ //# sourceMappingURL=command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../src/extensions/interfaces/command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACtE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,qEAAqE;IACrE,KAAK,EAAE,MAAM,CAAC;IACd,8CAA8C;IAC9C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,wCAAwC;IACxC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,oBAAoB;IACnC,kCAAkC;IAClC,WAAW,EAAE,iBAAiB,EAAE,CAAC;CAClC;AAED,MAAM,WAAW,mBAAmB;IAClC,sCAAsC;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,sCAAsC;IACtC,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,uBAAuB;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6CAA6C;IAC7C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,uCAAuC;IACvC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,MAAM,WAAW,yBAAyB;IACxC;;;;OAIG;IACH,cAAc,CAAC,GAAG,EAAE,gBAAgB,EAAE,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAElG;;;;;;OAMG;IACH,OAAO,CAAC,GAAG,EAAE,gBAAgB,EAAE,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;CACrF;AAED;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;CAGvB,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Command Extension Function Names
3
+ */
4
+ export const CommandFunctionNames = {
5
+ getSuggestions: "command.getSuggestions",
6
+ execute: "command.execute",
7
+ };
8
+ //# sourceMappingURL=command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command.js","sourceRoot":"","sources":["../../../src/extensions/interfaces/command.ts"],"names":[],"mappings":"AA0FA;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,cAAc,EAAE,wBAAwB;IACxC,OAAO,EAAE,iBAAiB;CAClB,CAAC"}
@@ -0,0 +1,82 @@
1
+ import type { CustomTabConfig, CustomTabContent } from "../customtab.js";
2
+ import type { ExtensionContext } from "./oauth.js";
3
+ /**
4
+ * Custom Tab Extension Input Types
5
+ */
6
+ export interface GetTabConfigInput {
7
+ /** Optional tab ID to get specific tab config */
8
+ tabId?: string;
9
+ }
10
+ export interface GetTabConfigOutput {
11
+ /** Tab configurations */
12
+ tabs: CustomTabConfig[];
13
+ }
14
+ export interface GetTabContentInput {
15
+ /** Tab ID */
16
+ tabId: string;
17
+ /** User chat ID (if opened from a chat) */
18
+ chatId?: string;
19
+ /** User ID */
20
+ userId?: string;
21
+ }
22
+ /**
23
+ * Custom Tab Extension Interface
24
+ *
25
+ * Implement this interface to create a custom tab in Desk.
26
+ *
27
+ * @example
28
+ * ```typescript
29
+ * @Extension({ name: "customtab", systemVersion: "v1" })
30
+ * export class MyCustomTabExtension implements CustomTabExtensionInterface {
31
+ * @Func("customtab.getConfig")
32
+ * async getConfig(ctx, params): Promise<GetTabConfigOutput> {
33
+ * return {
34
+ * tabs: [
35
+ * {
36
+ * name: "Analytics",
37
+ * nameI18nMap: {
38
+ * ko: { name: "분석" },
39
+ * ja: { name: "分析" },
40
+ * },
41
+ * icon: "chart",
42
+ * },
43
+ * ],
44
+ * };
45
+ * }
46
+ *
47
+ * @Func("customtab.getContent")
48
+ * async getContent(ctx, params): Promise<CustomTabContent> {
49
+ * return {
50
+ * wamName: "analytics-dashboard",
51
+ * wamParams: { userId: params.userId },
52
+ * };
53
+ * }
54
+ * }
55
+ * ```
56
+ */
57
+ export interface CustomTabExtensionInterface {
58
+ /**
59
+ * Get custom tab configuration
60
+ *
61
+ * Function name: "customtab.getConfig"
62
+ *
63
+ * @returns List of tab configurations
64
+ */
65
+ getConfig(ctx: ExtensionContext, params: GetTabConfigInput): Promise<GetTabConfigOutput>;
66
+ /**
67
+ * Get content for a specific tab
68
+ *
69
+ * Function name: "customtab.getContent"
70
+ *
71
+ * @returns WAM name and params to render in the tab
72
+ */
73
+ getContent(ctx: ExtensionContext, params: GetTabContentInput): Promise<CustomTabContent>;
74
+ }
75
+ /**
76
+ * Custom Tab Extension Function Names
77
+ */
78
+ export declare const CustomTabFunctionNames: {
79
+ readonly getConfig: "customtab.getConfig";
80
+ readonly getContent: "customtab.getContent";
81
+ };
82
+ //# sourceMappingURL=customtab.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customtab.d.ts","sourceRoot":"","sources":["../../../src/extensions/interfaces/customtab.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,iDAAiD;IACjD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,kBAAkB;IACjC,yBAAyB;IACzB,IAAI,EAAE,eAAe,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,kBAAkB;IACjC,aAAa;IACb,KAAK,EAAE,MAAM,CAAC;IACd,2CAA2C;IAC3C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM,WAAW,2BAA2B;IAC1C;;;;;;OAMG;IACH,SAAS,CAAC,GAAG,EAAE,gBAAgB,EAAE,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAEzF;;;;;;OAMG;IACH,UAAU,CAAC,GAAG,EAAE,gBAAgB,EAAE,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;CAC1F;AAED;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;CAGzB,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Custom Tab Extension Function Names
3
+ */
4
+ export const CustomTabFunctionNames = {
5
+ getConfig: "customtab.getConfig",
6
+ getContent: "customtab.getContent",
7
+ };
8
+ //# sourceMappingURL=customtab.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customtab.js","sourceRoot":"","sources":["../../../src/extensions/interfaces/customtab.ts"],"names":[],"mappings":"AAgFA;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,SAAS,EAAE,qBAAqB;IAChC,UAAU,EAAE,sBAAsB;CAC1B,CAAC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Extension Function Interfaces
3
+ *
4
+ * These interfaces define the required function signatures for each extension type.
5
+ * Use these as a guide when implementing your extension classes.
6
+ *
7
+ * @example
8
+ * ```typescript
9
+ * import { Extension, Func, Ctx, Input, InputSchema, OutputSchema } from "@channel.io/app-sdk-server";
10
+ * import type { CalendarExtensionInterface } from "@channel.io/app-sdk-core";
11
+ *
12
+ * @Extension({ name: "calendar", systemVersion: "v1" })
13
+ * export class MyCalendarExtension implements CalendarExtensionInterface {
14
+ * // IDE will show required methods and their signatures
15
+ * }
16
+ * ```
17
+ */
18
+ export * from "./oauth.js";
19
+ export * from "./apikey.js";
20
+ export * from "./calendar.js";
21
+ export * from "./command.js";
22
+ export * from "./widget.js";
23
+ export * from "./customtab.js";
24
+ export * from "./alftask.js";
25
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/extensions/interfaces/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Extension Function Interfaces
3
+ *
4
+ * These interfaces define the required function signatures for each extension type.
5
+ * Use these as a guide when implementing your extension classes.
6
+ *
7
+ * @example
8
+ * ```typescript
9
+ * import { Extension, Func, Ctx, Input, InputSchema, OutputSchema } from "@channel.io/app-sdk-server";
10
+ * import type { CalendarExtensionInterface } from "@channel.io/app-sdk-core";
11
+ *
12
+ * @Extension({ name: "calendar", systemVersion: "v1" })
13
+ * export class MyCalendarExtension implements CalendarExtensionInterface {
14
+ * // IDE will show required methods and their signatures
15
+ * }
16
+ * ```
17
+ */
18
+ export * from "./oauth.js";
19
+ export * from "./apikey.js";
20
+ export * from "./calendar.js";
21
+ export * from "./command.js";
22
+ export * from "./widget.js";
23
+ export * from "./customtab.js";
24
+ export * from "./alftask.js";
25
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/extensions/interfaces/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC"}
@@ -0,0 +1,78 @@
1
+ import type { OAuthConfig, CredentialValidationResult } from "../oauth.js";
2
+ /**
3
+ * Base context for all extension functions
4
+ */
5
+ export interface ExtensionContext {
6
+ channel: {
7
+ id: string;
8
+ };
9
+ caller: {
10
+ type: "user" | "manager" | "system";
11
+ id: string;
12
+ };
13
+ authToken?: string;
14
+ apiCredentials?: Record<string, string>;
15
+ }
16
+ /**
17
+ * OAuth Extension Interface
18
+ *
19
+ * Implement this interface to create an OAuth-based authentication extension.
20
+ *
21
+ * @example
22
+ * ```typescript
23
+ * @Extension({ name: "oauth", systemVersion: "v1" })
24
+ * export class MyOAuthExtension implements OAuthExtensionInterface {
25
+ * @Func("oauth.getConfig")
26
+ * @OutputSchema(OAuthConfigSchema)
27
+ * async getConfig(ctx: ExtensionContext): Promise<OAuthConfig> {
28
+ * return {
29
+ * authorizationUrl: "https://example.com/oauth/authorize",
30
+ * tokenUrl: "https://example.com/oauth/token",
31
+ * scopes: ["read", "write"],
32
+ * clientId: "your-client-id",
33
+ * };
34
+ * }
35
+ *
36
+ * @Func("oauth.validateCredential")
37
+ * @InputSchema(ValidateCredentialInputSchema)
38
+ * @OutputSchema(CredentialValidationResultSchema)
39
+ * async validateCredential(
40
+ * ctx: ExtensionContext,
41
+ * params: { accessToken: string }
42
+ * ): Promise<CredentialValidationResult> {
43
+ * // Validate the access token
44
+ * return { valid: true };
45
+ * }
46
+ * }
47
+ * ```
48
+ */
49
+ export interface OAuthExtensionInterface {
50
+ /**
51
+ * Get OAuth configuration for authorization flow
52
+ *
53
+ * Function name: "oauth.getConfig"
54
+ *
55
+ * @returns OAuth configuration including authorization URL, token URL, and scopes
56
+ */
57
+ getConfig(ctx: ExtensionContext): Promise<OAuthConfig>;
58
+ /**
59
+ * Validate an OAuth credential (access token)
60
+ *
61
+ * Function name: "oauth.validateCredential"
62
+ *
63
+ * @param ctx - Extension context
64
+ * @param params - Contains the access token to validate
65
+ * @returns Validation result with expiration info
66
+ */
67
+ validateCredential(ctx: ExtensionContext, params: {
68
+ accessToken: string;
69
+ }): Promise<CredentialValidationResult>;
70
+ }
71
+ /**
72
+ * OAuth Extension Function Names
73
+ */
74
+ export declare const OAuthFunctionNames: {
75
+ readonly getConfig: "oauth.getConfig";
76
+ readonly validateCredential: "oauth.validateCredential";
77
+ };
78
+ //# sourceMappingURL=oauth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth.d.ts","sourceRoot":"","sources":["../../../src/extensions/interfaces/oauth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAE3E;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IACxB,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACzC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,WAAW,uBAAuB;IACtC;;;;;;OAMG;IACH,SAAS,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAEvD;;;;;;;;OAQG;IACH,kBAAkB,CAChB,GAAG,EAAE,gBAAgB,EACrB,MAAM,EAAE;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,GAC9B,OAAO,CAAC,0BAA0B,CAAC,CAAC;CACxC;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;CAGrB,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * OAuth Extension Function Names
3
+ */
4
+ export const OAuthFunctionNames = {
5
+ getConfig: "oauth.getConfig",
6
+ validateCredential: "oauth.validateCredential",
7
+ };
8
+ //# sourceMappingURL=oauth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth.js","sourceRoot":"","sources":["../../../src/extensions/interfaces/oauth.ts"],"names":[],"mappings":"AAsEA;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,SAAS,EAAE,iBAAiB;IAC5B,kBAAkB,EAAE,0BAA0B;CACtC,CAAC"}
@@ -0,0 +1,87 @@
1
+ import type { WidgetConfig, WidgetActionResult } from "../widget.js";
2
+ import type { ExtensionContext } from "./oauth.js";
3
+ /**
4
+ * Widget Extension Input Types
5
+ */
6
+ export interface GetWidgetConfigInput {
7
+ /** Widget ID */
8
+ widgetId?: string;
9
+ /** Scope where widget is displayed ("front" or "desk") */
10
+ scope?: "front" | "desk";
11
+ }
12
+ export interface GetWidgetConfigOutput {
13
+ /** Widget configurations */
14
+ widgets: WidgetConfig[];
15
+ }
16
+ export interface WidgetActionInput {
17
+ /** Widget ID */
18
+ widgetId: string;
19
+ /** Action name */
20
+ action: string;
21
+ /** Action parameters */
22
+ params?: Record<string, unknown>;
23
+ /** User ID who triggered the action */
24
+ userId?: string;
25
+ /** Chat ID where the action was triggered (if applicable) */
26
+ chatId?: string;
27
+ }
28
+ /**
29
+ * Widget Extension Interface
30
+ *
31
+ * Implement this interface to create a widget extension for Front or Desk.
32
+ *
33
+ * @example
34
+ * ```typescript
35
+ * @Extension({ name: "widget", systemVersion: "v1" })
36
+ * export class MyWidgetExtension implements WidgetExtensionInterface {
37
+ * @Func("widget.getConfig")
38
+ * async getConfig(ctx, params): Promise<GetWidgetConfigOutput> {
39
+ * return {
40
+ * widgets: [
41
+ * {
42
+ * name: "Quick Actions",
43
+ * description: "Frequently used actions",
44
+ * scope: "desk",
45
+ * widgetType: "wam",
46
+ * },
47
+ * ],
48
+ * };
49
+ * }
50
+ *
51
+ * @Func("widget.action")
52
+ * async action(ctx, params): Promise<WidgetActionResult> {
53
+ * if (params.action === "refresh") {
54
+ * // Handle refresh action
55
+ * return { success: true, message: "Refreshed" };
56
+ * }
57
+ * return { success: false, message: "Unknown action" };
58
+ * }
59
+ * }
60
+ * ```
61
+ */
62
+ export interface WidgetExtensionInterface {
63
+ /**
64
+ * Get widget configuration
65
+ *
66
+ * Function name: "widget.getConfig"
67
+ *
68
+ * @returns List of widget configurations
69
+ */
70
+ getConfig(ctx: ExtensionContext, params: GetWidgetConfigInput): Promise<GetWidgetConfigOutput>;
71
+ /**
72
+ * Handle widget action
73
+ *
74
+ * Function name: "widget.action"
75
+ *
76
+ * @returns Action result with success status
77
+ */
78
+ action(ctx: ExtensionContext, params: WidgetActionInput): Promise<WidgetActionResult>;
79
+ }
80
+ /**
81
+ * Widget Extension Function Names
82
+ */
83
+ export declare const WidgetFunctionNames: {
84
+ readonly getConfig: "widget.getConfig";
85
+ readonly action: "widget.action";
86
+ };
87
+ //# sourceMappingURL=widget.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"widget.d.ts","sourceRoot":"","sources":["../../../src/extensions/interfaces/widget.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,gBAAgB;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0DAA0D;IAC1D,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,qBAAqB;IACpC,4BAA4B;IAC5B,OAAO,EAAE,YAAY,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,iBAAiB;IAChC,gBAAgB;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,kBAAkB;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,wBAAwB;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,uCAAuC;IACvC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,6DAA6D;IAC7D,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,WAAW,wBAAwB;IACvC;;;;;;OAMG;IACH,SAAS,CAAC,GAAG,EAAE,gBAAgB,EAAE,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAE/F;;;;;;OAMG;IACH,MAAM,CAAC,GAAG,EAAE,gBAAgB,EAAE,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;CACvF;AAED;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;CAGtB,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Widget Extension Function Names
3
+ */
4
+ export const WidgetFunctionNames = {
5
+ getConfig: "widget.getConfig",
6
+ action: "widget.action",
7
+ };
8
+ //# sourceMappingURL=widget.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"widget.js","sourceRoot":"","sources":["../../../src/extensions/interfaces/widget.ts"],"names":[],"mappings":"AAqFA;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,SAAS,EAAE,kBAAkB;IAC7B,MAAM,EAAE,eAAe;CACf,CAAC"}