@channel.io/app-sdk-core 0.15.2 → 0.15.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.
@@ -79,19 +79,19 @@ export declare const FunctionRequestProtoSchema: z.ZodObject<{
79
79
  channel?: {
80
80
  id?: string | undefined;
81
81
  } | undefined;
82
- language?: string | undefined;
83
- authToken?: string | undefined;
84
- apiCredentials?: Record<string, string> | undefined;
85
- config?: Record<string, any> | undefined;
86
- sandbox?: boolean | undefined;
87
- sessionId?: string | undefined;
88
- seedState?: any;
89
82
  userChat?: {
90
83
  id?: string | undefined;
91
84
  profile?: Record<string, any> | undefined;
92
85
  state?: string | undefined;
93
86
  } | undefined;
87
+ authToken?: string | undefined;
94
88
  legacyAuthToken?: string | undefined;
89
+ apiCredentials?: Record<string, string> | undefined;
90
+ config?: Record<string, any> | undefined;
91
+ language?: string | undefined;
92
+ sandbox?: boolean | undefined;
93
+ sessionId?: string | undefined;
94
+ seedState?: any;
95
95
  }, {
96
96
  user?: {
97
97
  type?: string | undefined;
@@ -108,25 +108,22 @@ export declare const FunctionRequestProtoSchema: z.ZodObject<{
108
108
  channel?: {
109
109
  id?: string | undefined;
110
110
  } | undefined;
111
- language?: string | undefined;
112
- authToken?: string | undefined;
113
- apiCredentials?: Record<string, string> | undefined;
114
- config?: Record<string, any> | undefined;
115
- sandbox?: boolean | undefined;
116
- sessionId?: string | undefined;
117
- seedState?: any;
118
111
  userChat?: {
119
112
  id?: string | undefined;
120
113
  profile?: Record<string, any> | undefined;
121
114
  state?: string | undefined;
122
115
  } | undefined;
116
+ authToken?: string | undefined;
123
117
  legacyAuthToken?: string | undefined;
118
+ apiCredentials?: Record<string, string> | undefined;
119
+ config?: Record<string, any> | undefined;
120
+ language?: string | undefined;
121
+ sandbox?: boolean | undefined;
122
+ sessionId?: string | undefined;
123
+ seedState?: any;
124
124
  }>>;
125
125
  systemVersion: z.ZodOptional<z.ZodString>;
126
126
  }, "strip", z.ZodTypeAny, {
127
- params?: any;
128
- systemVersion?: string | undefined;
129
- method?: string | undefined;
130
127
  context?: {
131
128
  user?: {
132
129
  type?: string | undefined;
@@ -143,24 +140,24 @@ export declare const FunctionRequestProtoSchema: z.ZodObject<{
143
140
  channel?: {
144
141
  id?: string | undefined;
145
142
  } | undefined;
146
- language?: string | undefined;
147
- authToken?: string | undefined;
148
- apiCredentials?: Record<string, string> | undefined;
149
- config?: Record<string, any> | undefined;
150
- sandbox?: boolean | undefined;
151
- sessionId?: string | undefined;
152
- seedState?: any;
153
143
  userChat?: {
154
144
  id?: string | undefined;
155
145
  profile?: Record<string, any> | undefined;
156
146
  state?: string | undefined;
157
147
  } | undefined;
148
+ authToken?: string | undefined;
158
149
  legacyAuthToken?: string | undefined;
150
+ apiCredentials?: Record<string, string> | undefined;
151
+ config?: Record<string, any> | undefined;
152
+ language?: string | undefined;
153
+ sandbox?: boolean | undefined;
154
+ sessionId?: string | undefined;
155
+ seedState?: any;
159
156
  } | undefined;
160
- }, {
161
157
  params?: any;
162
- systemVersion?: string | undefined;
163
158
  method?: string | undefined;
159
+ systemVersion?: string | undefined;
160
+ }, {
164
161
  context?: {
165
162
  user?: {
166
163
  type?: string | undefined;
@@ -177,20 +174,23 @@ export declare const FunctionRequestProtoSchema: z.ZodObject<{
177
174
  channel?: {
178
175
  id?: string | undefined;
179
176
  } | undefined;
180
- language?: string | undefined;
181
- authToken?: string | undefined;
182
- apiCredentials?: Record<string, string> | undefined;
183
- config?: Record<string, any> | undefined;
184
- sandbox?: boolean | undefined;
185
- sessionId?: string | undefined;
186
- seedState?: any;
187
177
  userChat?: {
188
178
  id?: string | undefined;
189
179
  profile?: Record<string, any> | undefined;
190
180
  state?: string | undefined;
191
181
  } | undefined;
182
+ authToken?: string | undefined;
192
183
  legacyAuthToken?: string | undefined;
184
+ apiCredentials?: Record<string, string> | undefined;
185
+ config?: Record<string, any> | undefined;
186
+ language?: string | undefined;
187
+ sandbox?: boolean | undefined;
188
+ sessionId?: string | undefined;
189
+ seedState?: any;
193
190
  } | undefined;
191
+ params?: any;
192
+ method?: string | undefined;
193
+ systemVersion?: string | undefined;
194
194
  }>;
195
195
  export type FunctionRequestProto = z.infer<typeof FunctionRequestProtoSchema>;
196
196
  export declare const FunctionResponseProtoSchema: z.ZodObject<{
@@ -236,14 +236,14 @@ export declare const FunctionSchemaProtoSchema: z.ZodObject<{
236
236
  outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
237
237
  }, "strip", z.ZodTypeAny, {
238
238
  name?: string | undefined;
239
- description?: string | undefined;
240
239
  inputSchema?: Record<string, any> | undefined;
241
240
  outputSchema?: Record<string, any> | undefined;
241
+ description?: string | undefined;
242
242
  }, {
243
243
  name?: string | undefined;
244
- description?: string | undefined;
245
244
  inputSchema?: Record<string, any> | undefined;
246
245
  outputSchema?: Record<string, any> | undefined;
246
+ description?: string | undefined;
247
247
  }>;
248
248
  export type FunctionSchemaProto = z.infer<typeof FunctionSchemaProtoSchema>;
249
249
  export declare const GetFunctionsResultProtoSchema: z.ZodObject<{
@@ -254,32 +254,32 @@ export declare const GetFunctionsResultProtoSchema: z.ZodObject<{
254
254
  outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
255
255
  }, "strip", z.ZodTypeAny, {
256
256
  name?: string | undefined;
257
- description?: string | undefined;
258
257
  inputSchema?: Record<string, any> | undefined;
259
258
  outputSchema?: Record<string, any> | undefined;
259
+ description?: string | undefined;
260
260
  }, {
261
261
  name?: string | undefined;
262
- description?: string | undefined;
263
262
  inputSchema?: Record<string, any> | undefined;
264
263
  outputSchema?: Record<string, any> | undefined;
264
+ description?: string | undefined;
265
265
  }>>, "many">>;
266
266
  success: z.ZodOptional<z.ZodBoolean>;
267
267
  errorMessage: z.ZodOptional<z.ZodString>;
268
268
  }, "strip", z.ZodTypeAny, {
269
269
  functions?: {
270
270
  name?: string | undefined;
271
- description?: string | undefined;
272
271
  inputSchema?: Record<string, any> | undefined;
273
272
  outputSchema?: Record<string, any> | undefined;
273
+ description?: string | undefined;
274
274
  }[] | undefined;
275
275
  success?: boolean | undefined;
276
276
  errorMessage?: string | undefined;
277
277
  }, {
278
278
  functions?: {
279
279
  name?: string | undefined;
280
- description?: string | undefined;
281
280
  inputSchema?: Record<string, any> | undefined;
282
281
  outputSchema?: Record<string, any> | undefined;
282
+ description?: string | undefined;
283
283
  }[] | undefined;
284
284
  success?: boolean | undefined;
285
285
  errorMessage?: string | undefined;
@@ -79,19 +79,19 @@ export declare const NativeFunctionRequestProtoSchema: z.ZodObject<{
79
79
  channel?: {
80
80
  id?: string | undefined;
81
81
  } | undefined;
82
- language?: string | undefined;
83
- authToken?: string | undefined;
84
- apiCredentials?: Record<string, string> | undefined;
85
- config?: Record<string, any> | undefined;
86
- sandbox?: boolean | undefined;
87
- sessionId?: string | undefined;
88
- seedState?: any;
89
82
  userChat?: {
90
83
  id?: string | undefined;
91
84
  profile?: Record<string, any> | undefined;
92
85
  state?: string | undefined;
93
86
  } | undefined;
87
+ authToken?: string | undefined;
94
88
  legacyAuthToken?: string | undefined;
89
+ apiCredentials?: Record<string, string> | undefined;
90
+ config?: Record<string, any> | undefined;
91
+ language?: string | undefined;
92
+ sandbox?: boolean | undefined;
93
+ sessionId?: string | undefined;
94
+ seedState?: any;
95
95
  }, {
96
96
  user?: {
97
97
  type?: string | undefined;
@@ -108,25 +108,22 @@ export declare const NativeFunctionRequestProtoSchema: z.ZodObject<{
108
108
  channel?: {
109
109
  id?: string | undefined;
110
110
  } | undefined;
111
- language?: string | undefined;
112
- authToken?: string | undefined;
113
- apiCredentials?: Record<string, string> | undefined;
114
- config?: Record<string, any> | undefined;
115
- sandbox?: boolean | undefined;
116
- sessionId?: string | undefined;
117
- seedState?: any;
118
111
  userChat?: {
119
112
  id?: string | undefined;
120
113
  profile?: Record<string, any> | undefined;
121
114
  state?: string | undefined;
122
115
  } | undefined;
116
+ authToken?: string | undefined;
123
117
  legacyAuthToken?: string | undefined;
118
+ apiCredentials?: Record<string, string> | undefined;
119
+ config?: Record<string, any> | undefined;
120
+ language?: string | undefined;
121
+ sandbox?: boolean | undefined;
122
+ sessionId?: string | undefined;
123
+ seedState?: any;
124
124
  }>>;
125
125
  systemVersion: z.ZodOptional<z.ZodString>;
126
126
  }, "strip", z.ZodTypeAny, {
127
- params?: any;
128
- systemVersion?: string | undefined;
129
- method?: string | undefined;
130
127
  context?: {
131
128
  user?: {
132
129
  type?: string | undefined;
@@ -143,24 +140,24 @@ export declare const NativeFunctionRequestProtoSchema: z.ZodObject<{
143
140
  channel?: {
144
141
  id?: string | undefined;
145
142
  } | undefined;
146
- language?: string | undefined;
147
- authToken?: string | undefined;
148
- apiCredentials?: Record<string, string> | undefined;
149
- config?: Record<string, any> | undefined;
150
- sandbox?: boolean | undefined;
151
- sessionId?: string | undefined;
152
- seedState?: any;
153
143
  userChat?: {
154
144
  id?: string | undefined;
155
145
  profile?: Record<string, any> | undefined;
156
146
  state?: string | undefined;
157
147
  } | undefined;
148
+ authToken?: string | undefined;
158
149
  legacyAuthToken?: string | undefined;
150
+ apiCredentials?: Record<string, string> | undefined;
151
+ config?: Record<string, any> | undefined;
152
+ language?: string | undefined;
153
+ sandbox?: boolean | undefined;
154
+ sessionId?: string | undefined;
155
+ seedState?: any;
159
156
  } | undefined;
160
- }, {
161
157
  params?: any;
162
- systemVersion?: string | undefined;
163
158
  method?: string | undefined;
159
+ systemVersion?: string | undefined;
160
+ }, {
164
161
  context?: {
165
162
  user?: {
166
163
  type?: string | undefined;
@@ -177,20 +174,23 @@ export declare const NativeFunctionRequestProtoSchema: z.ZodObject<{
177
174
  channel?: {
178
175
  id?: string | undefined;
179
176
  } | undefined;
180
- language?: string | undefined;
181
- authToken?: string | undefined;
182
- apiCredentials?: Record<string, string> | undefined;
183
- config?: Record<string, any> | undefined;
184
- sandbox?: boolean | undefined;
185
- sessionId?: string | undefined;
186
- seedState?: any;
187
177
  userChat?: {
188
178
  id?: string | undefined;
189
179
  profile?: Record<string, any> | undefined;
190
180
  state?: string | undefined;
191
181
  } | undefined;
182
+ authToken?: string | undefined;
192
183
  legacyAuthToken?: string | undefined;
184
+ apiCredentials?: Record<string, string> | undefined;
185
+ config?: Record<string, any> | undefined;
186
+ language?: string | undefined;
187
+ sandbox?: boolean | undefined;
188
+ sessionId?: string | undefined;
189
+ seedState?: any;
193
190
  } | undefined;
191
+ params?: any;
192
+ method?: string | undefined;
193
+ systemVersion?: string | undefined;
194
194
  }>;
195
195
  export type NativeFunctionRequestProto = z.infer<typeof NativeFunctionRequestProtoSchema>;
196
196
  export declare const NativeFunctionResponseProtoSchema: z.ZodObject<{
@@ -259,12 +259,12 @@ export declare const ExtensionRegistrationParamsProtoSchema: z.ZodObject<{
259
259
  extensionName: z.ZodOptional<z.ZodString>;
260
260
  systemVersion: z.ZodOptional<z.ZodString>;
261
261
  }, "strip", z.ZodTypeAny, {
262
- appId?: string | undefined;
263
262
  systemVersion?: string | undefined;
263
+ appId?: string | undefined;
264
264
  extensionName?: string | undefined;
265
265
  }, {
266
- appId?: string | undefined;
267
266
  systemVersion?: string | undefined;
267
+ appId?: string | undefined;
268
268
  extensionName?: string | undefined;
269
269
  }>;
270
270
  export type ExtensionRegistrationParamsProto = z.infer<typeof ExtensionRegistrationParamsProtoSchema>;
@@ -310,12 +310,12 @@ export declare const AlfTaskVersionProtoSchema: z.ZodObject<{
310
310
  name: z.ZodOptional<z.ZodString>;
311
311
  version: z.ZodOptional<z.ZodString>;
312
312
  }, "strip", z.ZodTypeAny, {
313
- id?: string | undefined;
314
313
  name?: string | undefined;
314
+ id?: string | undefined;
315
315
  version?: string | undefined;
316
316
  }, {
317
- id?: string | undefined;
318
317
  name?: string | undefined;
318
+ id?: string | undefined;
319
319
  version?: string | undefined;
320
320
  }>;
321
321
  export type AlfTaskVersionProto = z.infer<typeof AlfTaskVersionProtoSchema>;
@@ -327,28 +327,28 @@ export declare const GetAlfTaskVersionsResultProtoSchema: z.ZodObject<{
327
327
  name: z.ZodOptional<z.ZodString>;
328
328
  version: z.ZodOptional<z.ZodString>;
329
329
  }, "strip", z.ZodTypeAny, {
330
- id?: string | undefined;
331
330
  name?: string | undefined;
331
+ id?: string | undefined;
332
332
  version?: string | undefined;
333
333
  }, {
334
- id?: string | undefined;
335
334
  name?: string | undefined;
335
+ id?: string | undefined;
336
336
  version?: string | undefined;
337
337
  }>>, "many">>;
338
338
  }, "strip", z.ZodTypeAny, {
339
339
  success?: boolean | undefined;
340
340
  errorMessage?: string | undefined;
341
341
  tasks?: {
342
- id?: string | undefined;
343
342
  name?: string | undefined;
343
+ id?: string | undefined;
344
344
  version?: string | undefined;
345
345
  }[] | undefined;
346
346
  }, {
347
347
  success?: boolean | undefined;
348
348
  errorMessage?: string | undefined;
349
349
  tasks?: {
350
- id?: string | undefined;
351
350
  name?: string | undefined;
351
+ id?: string | undefined;
352
352
  version?: string | undefined;
353
353
  }[] | undefined;
354
354
  }>;
@@ -1,11 +1,14 @@
1
+ import type { Caller as ProtoCaller, Channel as ProtoChannel, FunctionContext as ProtoFunctionContext, User as ProtoUser, UserChat as ProtoUserChat } from "../gen/channel/app/sdk/v1/context.js";
2
+ import type { FunctionRequest as ProtoFunctionRequest, FunctionResponse as ProtoFunctionResponse } from "../gen/channel/app/sdk/v1/function.js";
3
+ import type { FunctionError as ProtoFunctionError } from "../gen/channel/app/sdk/v1/error.js";
1
4
  /**
2
5
  * Caller type — matches Go's CallerType constants
3
6
  */
4
- export type CallerType = "user" | "manager" | "system";
7
+ export type CallerType = "user" | "manager" | "system" | "app";
5
8
  /**
6
9
  * Caller information from the function call context
7
10
  */
8
- export interface Caller {
11
+ export interface Caller extends ProtoCaller {
9
12
  /** Caller type */
10
13
  type: CallerType;
11
14
  /** Caller's unique identifier (omitted for some system calls) */
@@ -14,23 +17,37 @@ export interface Caller {
14
17
  /**
15
18
  * Channel information from the function call context
16
19
  */
17
- export interface Channel {
20
+ export interface Channel extends ProtoChannel {
18
21
  /** Channel's unique identifier */
19
22
  id: string;
20
23
  }
24
+ /**
25
+ * User information from the function call context.
26
+ */
27
+ export type User = ProtoUser;
28
+ /**
29
+ * User chat information from the function call context.
30
+ */
31
+ export type UserChat = ProtoUserChat;
21
32
  /**
22
33
  * Context passed to function handlers.
23
34
  * Mirrors Go's ChannelContext struct (internal/domain/app/subdomain/core/svc/function.go).
24
35
  */
25
- export interface Context {
36
+ export interface Context extends Omit<ProtoFunctionContext, "caller" | "channel" | "user" | "userChat"> {
26
37
  /** Caller information */
27
38
  caller: Caller;
28
39
  /** Channel information */
29
40
  channel: Channel;
41
+ /** User information, when the function is scoped to a user. */
42
+ user?: User;
43
+ /** User chat information, when the function is scoped to a chat. */
44
+ userChat?: UserChat;
30
45
  /** Language preference (e.g., "ko", "en") */
31
46
  language?: string;
32
47
  /** OAuth token (decrypted, auto-injected when OAuth is configured) */
33
48
  authToken?: string;
49
+ /** Legacy OAuth token field accepted for compatibility. */
50
+ legacyAuthToken?: string;
34
51
  /**
35
52
  * Decrypted API Key credentials.
36
53
  * AppStore automatically injects this for all function calls
@@ -56,7 +73,7 @@ export interface Context {
56
73
  /**
57
74
  * Raw request body from Channel.io
58
75
  */
59
- export interface FunctionCallRequest {
76
+ export interface FunctionCallRequest extends Omit<ProtoFunctionRequest, "context" | "params"> {
60
77
  /** Function method name (e.g., "extension.calendar.booking.createBooking") */
61
78
  method: string;
62
79
  /** Function call context */
@@ -67,7 +84,7 @@ export interface FunctionCallRequest {
67
84
  /**
68
85
  * Response format for function calls
69
86
  */
70
- export interface FunctionCallErrorResponse {
87
+ export interface FunctionCallErrorResponse extends Omit<ProtoFunctionError, "code" | "message"> {
71
88
  /** JSON-RPC error code */
72
89
  code: number;
73
90
  /** Human-readable error message */
@@ -77,7 +94,7 @@ export interface FunctionCallErrorResponse {
77
94
  /** Optional legacy error type */
78
95
  type?: string;
79
96
  }
80
- export interface FunctionCallResponse<T = unknown> {
97
+ export interface FunctionCallResponse<T = unknown> extends Omit<ProtoFunctionResponse, "result" | "error"> {
81
98
  /** Result data */
82
99
  result?: T;
83
100
  /** JSON-RPC function error */
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/types/context.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEvD;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB,kBAAkB;IAClB,IAAI,EAAE,UAAU,CAAC;IACjB,iEAAiE;IACjE,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB,kCAAkC;IAClC,EAAE,EAAE,MAAM,CAAC;CACZ;AAED;;;GAGG;AACH,MAAM,WAAW,OAAO;IACtB,yBAAyB;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,0BAA0B;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sEAAsE;IACtE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxC;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,+CAA+C;IAC/C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,yCAAyC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4CAA4C;IAC5C,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,4DAA4D;IAC5D,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,8EAA8E;IAC9E,MAAM,EAAE,MAAM,CAAC;IACf,4BAA4B;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,0BAA0B;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM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,IAAI,CAAC,kBAAkB,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7F,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,mCAAmC;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,qCAAqC;IACrC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,iCAAiC;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,oBAAoB,CAAC,CAAC,GAAG,OAAO,CAAE,SAAQ,IAAI,CAC7D,qBAAqB,EACrB,QAAQ,GAAG,OAAO,CACnB;IACC,kBAAkB;IAClB,MAAM,CAAC,EAAE,CAAC,CAAC;IACX,8BAA8B;IAC9B,KAAK,CAAC,EAAE,yBAAyB,CAAC;CACnC"}
@@ -1,5 +1,6 @@
1
1
  import type { z } from "zod";
2
2
  import type { Context } from "./context.js";
3
+ import type { FunctionSchema as ProtoFunctionSchema, GetFunctionsResult as ProtoGetFunctionsResult } from "../gen/channel/app/sdk/v1/function.js";
3
4
  /**
4
5
  * Function handler type
5
6
  */
@@ -35,7 +36,7 @@ export interface RegisteredFunction {
35
36
  /**
36
37
  * Function schema for getFunctions response
37
38
  */
38
- export interface FunctionSchema {
39
+ export interface FunctionSchema extends Omit<ProtoFunctionSchema, "name" | "inputSchema" | "outputSchema"> {
39
40
  /** Full function name */
40
41
  name: string;
41
42
  /** Function description */
@@ -45,15 +46,16 @@ export interface FunctionSchema {
45
46
  /** JSON Schema for output */
46
47
  outputSchema?: Record<string, unknown>;
47
48
  }
49
+ export interface GetFunctionsResult extends Omit<ProtoGetFunctionsResult, "functions" | "success" | "errorMessage"> {
50
+ functions: FunctionSchema[];
51
+ success: boolean;
52
+ errorMessage: string;
53
+ }
48
54
  /**
49
55
  * Response type for extension.core.function.getFunctions
50
56
  */
51
57
  export interface GetFunctionsResponse {
52
- result: {
53
- functions: FunctionSchema[];
54
- success: boolean;
55
- errorMessage: string;
56
- };
58
+ result: GetFunctionsResult;
57
59
  }
58
60
  /**
59
61
  * Response type for extension.core.function.getTestFunctions
@@ -1 +1 @@
1
- {"version":3,"file":"function.d.ts","sourceRoot":"","sources":["../../src/types/function.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C;;GAEG;AACH,MAAM,MAAM,eAAe,CAAC,MAAM,GAAG,OAAO,EAAE,OAAO,GAAG,OAAO,IAAI,CACjE,GAAG,EAAE,OAAO,EACZ,MAAM,EAAE,MAAM,KACX,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;AAEhC;;GAEG;AACH,MAAM,WAAW,kBAAkB,CACjC,MAAM,SAAS,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,OAAO,EACpC,OAAO,SAAS,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,OAAO;IAErC,6CAA6C;IAC7C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sCAAsC;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,kDAAkD;IAClD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,uBAAuB;IACvB,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;CAC7D;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,kEAAkE;IAClE,IAAI,EAAE,MAAM,CAAC;IACb,2BAA2B;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4BAA4B;IAC5B,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,6BAA6B;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACvC,uBAAuB;IACvB,OAAO,EAAE,eAAe,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,c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,6 +1,6 @@
1
1
  {
2
2
  "name": "@channel.io/app-sdk-core",
3
- "version": "0.15.2",
3
+ "version": "0.15.4",
4
4
  "description": "Core types and utilities for Channel.io App SDK",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",