@channel.io/app-sdk-core 0.6.2 → 0.6.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.
@@ -0,0 +1,212 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * Hook type returned from extension.hook.metadata.getHooks.
4
+ */
5
+ export declare const HookTypeSchema: z.ZodEnum<["app.installed", "app.uninstalled", "command.toggle", "widget.installed", "widget.uninstalled"]>;
6
+ export type HookType = z.infer<typeof HookTypeSchema>;
7
+ /**
8
+ * Hook metadata schema returned from extension.hook.metadata.getHooks.
9
+ *
10
+ * App and command hooks do not require a target identifier.
11
+ * Widget hooks must include a targetId that matches the widget name.
12
+ */
13
+ export declare const HookConfigSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
14
+ actionFunctionName: z.ZodString;
15
+ systemVersion: z.ZodOptional<z.ZodString>;
16
+ } & {
17
+ type: z.ZodLiteral<"app.installed">;
18
+ }, "strict", z.ZodTypeAny, {
19
+ type: "app.installed";
20
+ actionFunctionName: string;
21
+ systemVersion?: string | undefined;
22
+ }, {
23
+ type: "app.installed";
24
+ actionFunctionName: string;
25
+ systemVersion?: string | undefined;
26
+ }>, z.ZodObject<{
27
+ actionFunctionName: z.ZodString;
28
+ systemVersion: z.ZodOptional<z.ZodString>;
29
+ } & {
30
+ type: z.ZodLiteral<"app.uninstalled">;
31
+ }, "strict", z.ZodTypeAny, {
32
+ type: "app.uninstalled";
33
+ actionFunctionName: string;
34
+ systemVersion?: string | undefined;
35
+ }, {
36
+ type: "app.uninstalled";
37
+ actionFunctionName: string;
38
+ systemVersion?: string | undefined;
39
+ }>, z.ZodObject<{
40
+ actionFunctionName: z.ZodString;
41
+ systemVersion: z.ZodOptional<z.ZodString>;
42
+ } & {
43
+ type: z.ZodLiteral<"command.toggle">;
44
+ }, "strict", z.ZodTypeAny, {
45
+ type: "command.toggle";
46
+ actionFunctionName: string;
47
+ systemVersion?: string | undefined;
48
+ }, {
49
+ type: "command.toggle";
50
+ actionFunctionName: string;
51
+ systemVersion?: string | undefined;
52
+ }>, z.ZodObject<{
53
+ actionFunctionName: z.ZodString;
54
+ systemVersion: z.ZodOptional<z.ZodString>;
55
+ } & {
56
+ type: z.ZodLiteral<"widget.installed">;
57
+ targetId: z.ZodString;
58
+ }, "strict", z.ZodTypeAny, {
59
+ type: "widget.installed";
60
+ actionFunctionName: string;
61
+ targetId: string;
62
+ systemVersion?: string | undefined;
63
+ }, {
64
+ type: "widget.installed";
65
+ actionFunctionName: string;
66
+ targetId: string;
67
+ systemVersion?: string | undefined;
68
+ }>, z.ZodObject<{
69
+ actionFunctionName: z.ZodString;
70
+ systemVersion: z.ZodOptional<z.ZodString>;
71
+ } & {
72
+ type: z.ZodLiteral<"widget.uninstalled">;
73
+ targetId: z.ZodString;
74
+ }, "strict", z.ZodTypeAny, {
75
+ type: "widget.uninstalled";
76
+ actionFunctionName: string;
77
+ targetId: string;
78
+ systemVersion?: string | undefined;
79
+ }, {
80
+ type: "widget.uninstalled";
81
+ actionFunctionName: string;
82
+ targetId: string;
83
+ systemVersion?: string | undefined;
84
+ }>]>;
85
+ export type HookConfig = z.infer<typeof HookConfigSchema>;
86
+ /**
87
+ * Metadata response schema for hook registration.
88
+ */
89
+ export declare const GetHooksOutputSchema: z.ZodObject<{
90
+ hooks: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
91
+ actionFunctionName: z.ZodString;
92
+ systemVersion: z.ZodOptional<z.ZodString>;
93
+ } & {
94
+ type: z.ZodLiteral<"app.installed">;
95
+ }, "strict", z.ZodTypeAny, {
96
+ type: "app.installed";
97
+ actionFunctionName: string;
98
+ systemVersion?: string | undefined;
99
+ }, {
100
+ type: "app.installed";
101
+ actionFunctionName: string;
102
+ systemVersion?: string | undefined;
103
+ }>, z.ZodObject<{
104
+ actionFunctionName: z.ZodString;
105
+ systemVersion: z.ZodOptional<z.ZodString>;
106
+ } & {
107
+ type: z.ZodLiteral<"app.uninstalled">;
108
+ }, "strict", z.ZodTypeAny, {
109
+ type: "app.uninstalled";
110
+ actionFunctionName: string;
111
+ systemVersion?: string | undefined;
112
+ }, {
113
+ type: "app.uninstalled";
114
+ actionFunctionName: string;
115
+ systemVersion?: string | undefined;
116
+ }>, z.ZodObject<{
117
+ actionFunctionName: z.ZodString;
118
+ systemVersion: z.ZodOptional<z.ZodString>;
119
+ } & {
120
+ type: z.ZodLiteral<"command.toggle">;
121
+ }, "strict", z.ZodTypeAny, {
122
+ type: "command.toggle";
123
+ actionFunctionName: string;
124
+ systemVersion?: string | undefined;
125
+ }, {
126
+ type: "command.toggle";
127
+ actionFunctionName: string;
128
+ systemVersion?: string | undefined;
129
+ }>, z.ZodObject<{
130
+ actionFunctionName: z.ZodString;
131
+ systemVersion: z.ZodOptional<z.ZodString>;
132
+ } & {
133
+ type: z.ZodLiteral<"widget.installed">;
134
+ targetId: z.ZodString;
135
+ }, "strict", z.ZodTypeAny, {
136
+ type: "widget.installed";
137
+ actionFunctionName: string;
138
+ targetId: string;
139
+ systemVersion?: string | undefined;
140
+ }, {
141
+ type: "widget.installed";
142
+ actionFunctionName: string;
143
+ targetId: string;
144
+ systemVersion?: string | undefined;
145
+ }>, z.ZodObject<{
146
+ actionFunctionName: z.ZodString;
147
+ systemVersion: z.ZodOptional<z.ZodString>;
148
+ } & {
149
+ type: z.ZodLiteral<"widget.uninstalled">;
150
+ targetId: z.ZodString;
151
+ }, "strict", z.ZodTypeAny, {
152
+ type: "widget.uninstalled";
153
+ actionFunctionName: string;
154
+ targetId: string;
155
+ systemVersion?: string | undefined;
156
+ }, {
157
+ type: "widget.uninstalled";
158
+ actionFunctionName: string;
159
+ targetId: string;
160
+ systemVersion?: string | undefined;
161
+ }>]>, "many">;
162
+ }, "strip", z.ZodTypeAny, {
163
+ hooks: ({
164
+ type: "app.installed";
165
+ actionFunctionName: string;
166
+ systemVersion?: string | undefined;
167
+ } | {
168
+ type: "app.uninstalled";
169
+ actionFunctionName: string;
170
+ systemVersion?: string | undefined;
171
+ } | {
172
+ type: "command.toggle";
173
+ actionFunctionName: string;
174
+ systemVersion?: string | undefined;
175
+ } | {
176
+ type: "widget.installed";
177
+ actionFunctionName: string;
178
+ targetId: string;
179
+ systemVersion?: string | undefined;
180
+ } | {
181
+ type: "widget.uninstalled";
182
+ actionFunctionName: string;
183
+ targetId: string;
184
+ systemVersion?: string | undefined;
185
+ })[];
186
+ }, {
187
+ hooks: ({
188
+ type: "app.installed";
189
+ actionFunctionName: string;
190
+ systemVersion?: string | undefined;
191
+ } | {
192
+ type: "app.uninstalled";
193
+ actionFunctionName: string;
194
+ systemVersion?: string | undefined;
195
+ } | {
196
+ type: "command.toggle";
197
+ actionFunctionName: string;
198
+ systemVersion?: string | undefined;
199
+ } | {
200
+ type: "widget.installed";
201
+ actionFunctionName: string;
202
+ targetId: string;
203
+ systemVersion?: string | undefined;
204
+ } | {
205
+ type: "widget.uninstalled";
206
+ actionFunctionName: string;
207
+ targetId: string;
208
+ systemVersion?: string | undefined;
209
+ })[];
210
+ }>;
211
+ export type GetHooksOutput = z.infer<typeof GetHooksOutputSchema>;
212
+ //# sourceMappingURL=hook.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hook.d.ts","sourceRoot":"","sources":["../../src/extensions/hook.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,eAAO,MAAM,cAAc,6GAMzB,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAqBtD;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAkB3B,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAE/B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
@@ -0,0 +1,58 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * Hook type returned from extension.hook.metadata.getHooks.
4
+ */
5
+ export const HookTypeSchema = z.enum([
6
+ "app.installed",
7
+ "app.uninstalled",
8
+ "command.toggle",
9
+ "widget.installed",
10
+ "widget.uninstalled",
11
+ ]);
12
+ const HookSystemVersionSchema = z
13
+ .string()
14
+ .min(1)
15
+ .max(50)
16
+ .regex(/^[A-Za-z0-9._-]+$/);
17
+ const HookActionFunctionNameSchema = z
18
+ .string()
19
+ .min(1)
20
+ .max(255)
21
+ .regex(/^[a-zA-Z_][a-zA-Z0-9._]*$/);
22
+ const HookTargetIdSchema = z.string().min(1).max(255);
23
+ const BaseHookConfigSchema = z.object({
24
+ actionFunctionName: HookActionFunctionNameSchema,
25
+ systemVersion: HookSystemVersionSchema.optional(),
26
+ });
27
+ /**
28
+ * Hook metadata schema returned from extension.hook.metadata.getHooks.
29
+ *
30
+ * App and command hooks do not require a target identifier.
31
+ * Widget hooks must include a targetId that matches the widget name.
32
+ */
33
+ export const HookConfigSchema = z.discriminatedUnion("type", [
34
+ BaseHookConfigSchema.extend({
35
+ type: z.literal("app.installed"),
36
+ }).strict(),
37
+ BaseHookConfigSchema.extend({
38
+ type: z.literal("app.uninstalled"),
39
+ }).strict(),
40
+ BaseHookConfigSchema.extend({
41
+ type: z.literal("command.toggle"),
42
+ }).strict(),
43
+ BaseHookConfigSchema.extend({
44
+ type: z.literal("widget.installed"),
45
+ targetId: HookTargetIdSchema,
46
+ }).strict(),
47
+ BaseHookConfigSchema.extend({
48
+ type: z.literal("widget.uninstalled"),
49
+ targetId: HookTargetIdSchema,
50
+ }).strict(),
51
+ ]);
52
+ /**
53
+ * Metadata response schema for hook registration.
54
+ */
55
+ export const GetHooksOutputSchema = z.object({
56
+ hooks: z.array(HookConfigSchema),
57
+ });
58
+ //# sourceMappingURL=hook.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hook.js","sourceRoot":"","sources":["../../src/extensions/hook.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,IAAI,CAAC;IACnC,eAAe;IACf,iBAAiB;IACjB,gBAAgB;IAChB,kBAAkB;IAClB,oBAAoB;CACrB,CAAC,CAAC;AAIH,MAAM,uBAAuB,GAAG,CAAC;KAC9B,MAAM,EAAE;KACR,GAAG,CAAC,CAAC,CAAC;KACN,GAAG,CAAC,EAAE,CAAC;KACP,KAAK,CAAC,mBAAmB,CAAC,CAAC;AAE9B,MAAM,4BAA4B,GAAG,CAAC;KACnC,MAAM,EAAE;KACR,GAAG,CAAC,CAAC,CAAC;KACN,GAAG,CAAC,GAAG,CAAC;KACR,KAAK,CAAC,2BAA2B,CAAC,CAAC;AAEtC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAEtD,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC,kBAAkB,EAAE,4BAA4B;IAChD,aAAa,EAAE,uBAAuB,CAAC,QAAQ,EAAE;CAClD,CAAC,CAAC;AAEH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IAC3D,oBAAoB,CAAC,MAAM,CAAC;QAC1B,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC;KACjC,CAAC,CAAC,MAAM,EAAE;IACX,oBAAoB,CAAC,MAAM,CAAC;QAC1B,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC;KACnC,CAAC,CAAC,MAAM,EAAE;IACX,oBAAoB,CAAC,MAAM,CAAC;QAC1B,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC;KAClC,CAAC,CAAC,MAAM,EAAE;IACX,oBAAoB,CAAC,MAAM,CAAC;QAC1B,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,kBAAkB,CAAC;QACnC,QAAQ,EAAE,kBAAkB;KAC7B,CAAC,CAAC,MAAM,EAAE;IACX,oBAAoB,CAAC,MAAM,CAAC;QAC1B,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,oBAAoB,CAAC;QACrC,QAAQ,EAAE,kBAAkB;KAC7B,CAAC,CAAC,MAAM,EAAE;CACZ,CAAC,CAAC;AAIH;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC;CACjC,CAAC,CAAC"}
@@ -4,6 +4,7 @@ export { CalendarSchema, EventTypeSchema, TimeSlotSchema, AttendeeSchema, Bookin
4
4
  export { CommandScopeSchema, CommandAlfModeSchema, CommandParamTypeSchema, CommandNameI18nSchema, CommandNameDescI18nSchema, CommandParamDefI18nSchema, CommandChoiceSchema, CommandParamDefinitionSchema, CommandConfigSchema, GetCommandsOutputSchema, CommandSuggestionSchema, CommandResultSchema, type CommandScope, type CommandAlfMode, type CommandParamType, type CommandNameI18n, type CommandNameDescI18n, type CommandParamDefI18n, type CommandChoice, type CommandParamDefinition, type CommandConfig, type GetCommandsOutput, type CommandSuggestion, type CommandResult, } from "./command.js";
5
5
  export { WidgetScope, WidgetType, NameDescI18nSchema, WidgetConfigSchema, GetWidgetsOutputSchema, WidgetActionResultSchema, type NameDescI18n, type WidgetConfig, type GetWidgetsOutput, type WidgetActionResult, } from "./widget.js";
6
6
  export { CustomTabNameI18nSchema, CustomTabConfigSchema, GetCustomTabsOutputSchema, CustomTabActionResultSchema, type CustomTabNameI18n, type CustomTabConfig, type GetCustomTabsOutput, type CustomTabActionResult, } from "./customtab.js";
7
+ export { HookTypeSchema, HookConfigSchema, GetHooksOutputSchema, type HookType, type HookConfig, type GetHooksOutput, } from "./hook.js";
7
8
  export { MemoryDefinitionSchema, WorkflowNodeSchema, PredefinedTaskSchema, GetAlfTasksResponseSchema, type MemoryDefinition, type WorkflowNode, type PredefinedTask, type GetAlfTasksResponse, } from "./alftask.js";
8
9
  export { AddressSchema, BankAccountSchema, DefectInfoSchema, ClaimReasonSchema, ClaimabilitySchema, ClaimSchema, OrderItemSchema, PaymentSchema, FulfillmentSchema, OrderSchema, FieldConfigSchema, OperationOptionsSchema, AppCapabilitiesSchema, type Address, type BankAccount, type DefectInfo, type ClaimReason, type Claimability, type Claim, type OrderItem, type Payment, type Fulfillment, type Order, type FieldConfig, type OperationOptions, type AppCapabilities, } from "./order.js";
9
10
  export { WmsShippingInfoSchema, WmsDeliverySchema, WmsOrderItemSchema, WmsOrderSchema, CommerceIdentifiersSchema, type WmsShippingInfo, type WmsDelivery, type WmsOrderItem, type WmsOrder, type CommerceIdentifiers, } from "./wms.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/extensions/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,iBAAiB,EACjB,gCAAgC,EAChC,KAAK,WAAW,EAChB,KAAK,0BAA0B,GAChC,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,yBAAyB,EACzB,+BAA+B,EAC/B,KAAK,WAAW,EAChB,KAAK,mBAAmB,EACxB,KAAK,yBAAyB,GAC/B,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,cAAc,EACd,eAAe,EACf,cAAc,EACd,cAAc,EACd,aAAa,EACb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jB,WAAW,EACX,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,EACrB,KAAK,OAAO,EACZ,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,KAAK,EACV,KAAK,SAAS,EACd,KAAK,OAAO,EACZ,KAAK,WAAW,EAChB,KAAK,KAAK,EACV,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,eAAe,GACrB,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,yBAAyB,EACzB,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,QAAQ,EACb,KAAK,mBAAmB,GACzB,MAAM,UAAU,CAAC;AAGlB,cAAc,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/extensions/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,iBAAiB,EACjB,gCAAgC,EAChC,KAAK,WAAW,EAChB,KAAK,0BAA0B,GAChC,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,yBAAyB,EACzB,+BAA+B,EAC/B,KAAK,WAAW,EAChB,KAAK,mBAAmB,EACxB,KAAK,yBAAyB,GAC/B,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,cAAc,EACd,eAAe,EACf,cAAc,EACd,cAAc,EACd,aAAa,EACb,aAAa,EACb,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,OAAO,GACb,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EACrB,yBAAyB,EACzB,yBAAyB,EACzB,mBAAmB,EACnB,4BAA4B,EAC5B,mBAAmB,EACnB,uBAAuB,EACvB,uBAAuB,EACvB,mBAAm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S,EACd,KAAK,OAAO,EACZ,KAAK,WAAW,EAChB,KAAK,KAAK,EACV,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,eAAe,GACrB,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,yBAAyB,EACzB,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,QAAQ,EACb,KAAK,mBAAmB,GACzB,MAAM,UAAU,CAAC;AAGlB,cAAc,uBAAuB,CAAC"}
@@ -10,6 +10,8 @@ export { CommandScopeSchema, CommandAlfModeSchema, CommandParamTypeSchema, Comma
10
10
  export { WidgetScope, WidgetType, NameDescI18nSchema, WidgetConfigSchema, GetWidgetsOutputSchema, WidgetActionResultSchema, } from "./widget.js";
11
11
  // Custom Tab Extension Schemas (v1)
12
12
  export { CustomTabNameI18nSchema, CustomTabConfigSchema, GetCustomTabsOutputSchema, CustomTabActionResultSchema, } from "./customtab.js";
13
+ // Hook Extension Schemas (v1)
14
+ export { HookTypeSchema, HookConfigSchema, GetHooksOutputSchema, } from "./hook.js";
13
15
  // ALF Task Extension Schemas (v1)
14
16
  export { MemoryDefinitionSchema, WorkflowNodeSchema, PredefinedTaskSchema, GetAlfTasksResponseSchema, } from "./alftask.js";
15
17
  // Order Extension Schemas (v1)
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/extensions/index.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,OAAO,EACL,iBAAiB,EACjB,gCAAgC,GAGjC,MAAM,YAAY,CAAC;AAEpB,iCAAiC;AACjC,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,yBAAyB,EACzB,+BAA+B,GAIhC,MAAM,aAAa,CAAC;AAErB,kCAAkC;AAClC,OAAO,EACL,cAAc,EACd,eAAe,EACf,cAAc,EACd,cAAc,EACd,aAAa,EACb,aAAa,GAMd,MAAM,eAAe,CAAC;AAEvB,iCAAiC;AACjC,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EACrB,yBAAyB,EACzB,yBAAyB,EACzB,mBAAmB,EACnB,4BAA4B,EAC5B,mBAAmB,EACnB,uBAAuB,EACvB,uBAAuB,EACvB,mBAAmB,GAapB,MAAM,cAAc,CAAC;AAEtB,gCAAgC;AAChC,OAAO,EACL,WAAW,EACX,UAAU,EACV,kBAAkB,EAClB,kBAAkB,EAClB,sBAAsB,EACtB,wBAAwB,GAKzB,MAAM,aAAa,CAAC;AAErB,oCAAoC;AACpC,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,yBAAyB,EACzB,2BAA2B,GAK5B,MAAM,gBAAgB,CAAC;AAExB,kCAAkC;AAClC,OAAO,EACL,sBAAsB,EACtB,kBAAkB,EAClB,oBAAoB,EACpB,yBAAyB,GAK1B,MAAM,cAAc,CAAC;AAEtB,+BAA+B;AAC/B,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,WAAW,EACX,eAAe,EACf,aAAa,EACb,iBAAiB,EACjB,WAAW,EACX,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,GActB,MAAM,YAAY,CAAC;AAEpB,6BAA6B;AAC7B,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,yBAAyB,GAM1B,MAAM,UAAU,CAAC;AAElB,qDAAqD;AACrD,cAAc,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/extensions/index.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,OAAO,EACL,iBAAiB,EACjB,gCAAgC,GAGjC,MAAM,YAAY,CAAC;AAEpB,iCAAiC;AACjC,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,yBAAyB,EACzB,+BAA+B,GAIhC,MAAM,aAAa,CAAC;AAErB,kCAAkC;AAClC,OAAO,EACL,cAAc,EACd,eAAe,EACf,cAAc,EACd,cAAc,EACd,aAAa,EACb,aAAa,GAMd,MAAM,eAAe,CAAC;AAEvB,iCAAiC;AACjC,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EACrB,yBAAyB,EACzB,yBAAyB,EACzB,mBAAmB,EACnB,4BAA4B,EAC5B,mBAAmB,EACnB,uBAAuB,EACvB,uBAAuB,EACvB,mBAAmB,GAapB,MAAM,cAAc,CAAC;AAEtB,gCAAgC;AAChC,OAAO,EACL,WAAW,EACX,UAAU,EACV,kBAAkB,EAClB,kBAAkB,EAClB,sBAAsB,EACtB,wBAAwB,GAKzB,MAAM,aAAa,CAAC;AAErB,oCAAoC;AACpC,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,yBAAyB,EACzB,2BAA2B,GAK5B,MAAM,gBAAgB,CAAC;AAExB,8BAA8B;AAC9B,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,oBAAoB,GAIrB,MAAM,WAAW,CAAC;AAEnB,kCAAkC;AAClC,OAAO,EACL,sBAAsB,EACtB,kBAAkB,EAClB,oBAAoB,EACpB,yBAAyB,GAK1B,MAAM,cAAc,CAAC;AAEtB,+BAA+B;AAC/B,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,WAAW,EACX,eAAe,EACf,aAAa,EACb,iBAAiB,EACjB,WAAW,EACX,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,GActB,MAAM,YAAY,CAAC;AAEpB,6BAA6B;AAC7B,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,yBAAyB,GAM1B,MAAM,UAAU,CAAC;AAElB,qDAAqD;AACrD,cAAc,uBAAuB,CAAC"}
@@ -0,0 +1,51 @@
1
+ import type { GetHooksOutput } from "../hook.js";
2
+ import type { Context } from "../../types/context.js";
3
+ /**
4
+ * Hook metadata input/output types
5
+ */
6
+ export type GetHooksInput = Record<string, never>;
7
+ /**
8
+ * Hook metadata extension interface
9
+ *
10
+ * Implement this interface to expose hook definitions for AppStore registration.
11
+ * Hook handlers themselves are plain app functions referenced by each hook's
12
+ * `actionFunctionName`.
13
+ *
14
+ * @example
15
+ * ```typescript
16
+ * @Extension({ name: "hook", systemVersion: "v1" })
17
+ * export class MyHookExtension implements HookExtensionInterface {
18
+ * @Func("metadata.getHooks")
19
+ * async getHooks(ctx, params): Promise<GetHooksOutput> {
20
+ * return {
21
+ * hooks: [
22
+ * {
23
+ * type: "app.installed",
24
+ * actionFunctionName: "hooks.lifecycle.onAppInstalled",
25
+ * },
26
+ * {
27
+ * type: "widget.installed",
28
+ * targetId: "quick_actions",
29
+ * actionFunctionName: "hooks.widgets.onQuickActionsInstalled",
30
+ * },
31
+ * ],
32
+ * };
33
+ * }
34
+ * }
35
+ * ```
36
+ */
37
+ export interface HookExtensionInterface {
38
+ /**
39
+ * Get hook definitions for AppStore registration
40
+ *
41
+ * Function name: "metadata.getHooks"
42
+ */
43
+ getHooks(ctx: Context, params: GetHooksInput): Promise<GetHooksOutput>;
44
+ }
45
+ /**
46
+ * Hook Extension Function Names
47
+ */
48
+ export declare const HookFunctionNames: {
49
+ readonly getHooks: "metadata.getHooks";
50
+ };
51
+ //# sourceMappingURL=hook.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hook.d.ts","sourceRoot":"","sources":["../../../src/extensions/interfaces/hook.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEtD;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAElD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,WAAW,sBAAsB;IACrC;;;;OAIG;IACH,QAAQ,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;CACxE;AAED;;GAEG;AACH,eAAO,MAAM,iBAAiB;;CAEpB,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Hook Extension Function Names
3
+ */
4
+ export const HookFunctionNames = {
5
+ getHooks: "metadata.getHooks",
6
+ };
7
+ //# sourceMappingURL=hook.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hook.js","sourceRoot":"","sources":["../../../src/extensions/interfaces/hook.ts"],"names":[],"mappings":"AA+CA;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,QAAQ,EAAE,mBAAmB;CACrB,CAAC"}
@@ -21,6 +21,7 @@ export * from "./calendar.js";
21
21
  export * from "./command.js";
22
22
  export * from "./widget.js";
23
23
  export * from "./customtab.js";
24
+ export * from "./hook.js";
24
25
  export * from "./alftask.js";
25
26
  export * from "./order.js";
26
27
  export * from "./wms.js";
@@ -1 +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;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC"}
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,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC"}
@@ -21,6 +21,7 @@ export * from "./calendar.js";
21
21
  export * from "./command.js";
22
22
  export * from "./widget.js";
23
23
  export * from "./customtab.js";
24
+ export * from "./hook.js";
24
25
  export * from "./alftask.js";
25
26
  export * from "./order.js";
26
27
  export * from "./wms.js";
@@ -1 +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;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC"}
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,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC"}
@@ -2,7 +2,7 @@ import type { FunctionDefinition } from "./function.js";
2
2
  /**
3
3
  * Available extension names
4
4
  */
5
- export type ExtensionName = "oauth" | "apikey" | "calendar" | "messaging" | "command" | "widget" | "customtab" | "commerce" | "order" | "wms" | "alfTask" | (string & {});
5
+ export type ExtensionName = "oauth" | "apikey" | "calendar" | "messaging" | "command" | "widget" | "customtab" | "hook" | "commerce" | "order" | "wms" | "alfTask" | (string & {});
6
6
  /**
7
7
  * Extension configuration
8
8
  */
@@ -1 +1 @@
1
- {"version":3,"file":"extension.d.ts","sourceRoot":"","sources":["../../src/types/extension.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAExD;;GAEG;AACH,MAAM,MAAM,aAAa,GACrB,OAAO,GACP,QAAQ,GACR,UAAU,GACV,WAAW,GACX,SAAS,GACT,QAAQ,GACR,WAAW,GACX,UAAU,GACV,OAAO,GACP,KAAK,GACL,SAAS,GACT,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAElB;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,iDAAiD;IACjD,IAAI,EAAE,aAAa,CAAC;IACpB,wCAAwC;IACxC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,2EAA2E;IAC3E,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,4CAA4C;IAC5C,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,CACvB,UAAU,SAAS,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,IACxF;IACF,mCAAmC;IACnC,OAAO,CAAC,EAAE,mBAAmB,CAAC;CAC/B,GAAG,UAAU,CAAC;AAEf;;GAEG;AACH,MAAM,WAAW,mBAAmB,CAClC,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAC7E,SAAQ,eAAe;IACvB,sBAAsB;IACtB,MAAM,EAAE,OAAO,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,wCAAwC;IACxC,aAAa,EAAE,MAAM,CAAC;IACtB,wBAAwB;IACxB,SAAS,EAAE,OAAO,CAAC;IACnB,2CAA2C;IAC3C,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC,CAAC;CACtD"}
1
+ {"version":3,"file":"extension.d.ts","sourceRoot":"","sources":["../../src/types/extension.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAExD;;GAEG;AACH,MAAM,MAAM,aAAa,GACrB,OAAO,GACP,QAAQ,GACR,UAAU,GACV,WAAW,GACX,SAAS,GACT,QAAQ,GACR,WAAW,GACX,MAAM,GACN,UAAU,GACV,OAAO,GACP,KAAK,GACL,SAAS,GACT,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAElB;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,iDAAiD;IACjD,IAAI,EAAE,aAAa,CAAC;IACpB,wCAAwC;IACxC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,2EAA2E;IAC3E,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,4CAA4C;IAC5C,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,CACvB,UAAU,SAAS,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,IACxF;IACF,mCAAmC;IACnC,OAAO,CAAC,EAAE,mBAAmB,CAAC;CAC/B,GAAG,UAAU,CAAC;AAEf;;GAEG;AACH,MAAM,WAAW,mBAAmB,CAClC,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAC7E,SAAQ,eAAe;IACvB,sBAAsB;IACtB,MAAM,EAAE,OAAO,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,wCAAwC;IACxC,aAAa,EAAE,MAAM,CAAC;IACtB,wBAAwB;IACxB,SAAS,EAAE,OAAO,CAAC;IACnB,2CAA2C;IAC3C,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC,CAAC;CACtD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@channel.io/app-sdk-core",
3
- "version": "0.6.2",
3
+ "version": "0.6.4",
4
4
  "description": "Core types and utilities for Channel.io App SDK",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",