@channel.io/app-sdk-core 0.4.2 → 0.6.1

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 (43) hide show
  1. package/dist/extensions/command.d.ts +642 -0
  2. package/dist/extensions/command.d.ts.map +1 -1
  3. package/dist/extensions/command.js +77 -0
  4. package/dist/extensions/command.js.map +1 -1
  5. package/dist/extensions/customtab.d.ts +84 -22
  6. package/dist/extensions/customtab.d.ts.map +1 -1
  7. package/dist/extensions/customtab.js +26 -16
  8. package/dist/extensions/customtab.js.map +1 -1
  9. package/dist/extensions/index.d.ts +4 -3
  10. package/dist/extensions/index.d.ts.map +1 -1
  11. package/dist/extensions/index.js +5 -3
  12. package/dist/extensions/index.js.map +1 -1
  13. package/dist/extensions/interfaces/command.d.ts +108 -59
  14. package/dist/extensions/interfaces/command.d.ts.map +1 -1
  15. package/dist/extensions/interfaces/command.js +1 -0
  16. package/dist/extensions/interfaces/command.js.map +1 -1
  17. package/dist/extensions/interfaces/customtab.d.ts +67 -45
  18. package/dist/extensions/interfaces/customtab.d.ts.map +1 -1
  19. package/dist/extensions/interfaces/customtab.js +2 -2
  20. package/dist/extensions/interfaces/customtab.js.map +1 -1
  21. package/dist/extensions/interfaces/index.d.ts +1 -0
  22. package/dist/extensions/interfaces/index.d.ts.map +1 -1
  23. package/dist/extensions/interfaces/index.js +1 -0
  24. package/dist/extensions/interfaces/index.js.map +1 -1
  25. package/dist/extensions/interfaces/widget.d.ts +68 -50
  26. package/dist/extensions/interfaces/widget.d.ts.map +1 -1
  27. package/dist/extensions/interfaces/widget.js +1 -1
  28. package/dist/extensions/interfaces/widget.js.map +1 -1
  29. package/dist/extensions/interfaces/wms.d.ts +98 -0
  30. package/dist/extensions/interfaces/wms.d.ts.map +1 -0
  31. package/dist/extensions/interfaces/wms.js +14 -0
  32. package/dist/extensions/interfaces/wms.js.map +1 -0
  33. package/dist/extensions/widget.d.ts +281 -31
  34. package/dist/extensions/widget.d.ts.map +1 -1
  35. package/dist/extensions/widget.js +53 -19
  36. package/dist/extensions/widget.js.map +1 -1
  37. package/dist/extensions/wms.d.ts +318 -0
  38. package/dist/extensions/wms.d.ts.map +1 -0
  39. package/dist/extensions/wms.js +51 -0
  40. package/dist/extensions/wms.js.map +1 -0
  41. package/dist/types/extension.d.ts +1 -1
  42. package/dist/types/extension.d.ts.map +1 -1
  43. package/package.json +1 -1
@@ -1,4 +1,81 @@
1
1
  import { z } from "zod";
2
+ /**
3
+ * Command scope
4
+ */
5
+ export const CommandScopeSchema = z.enum(["front", "desk"]);
6
+ /**
7
+ * ALF mode for commands
8
+ */
9
+ export const CommandAlfModeSchema = z.enum(["disable", "recommend"]);
10
+ /**
11
+ * Parameter type for command inputs
12
+ */
13
+ export const CommandParamTypeSchema = z.enum(["string", "float", "int", "bool"]);
14
+ /**
15
+ * I18n name schema
16
+ */
17
+ export const CommandNameI18nSchema = z.object({
18
+ name: z.string().min(1).max(30),
19
+ });
20
+ /**
21
+ * I18n name and description schema
22
+ */
23
+ export const CommandNameDescI18nSchema = z.object({
24
+ name: z.string().min(1).max(30),
25
+ description: z.string().max(100),
26
+ });
27
+ /**
28
+ * I18n schema for parameter definitions
29
+ */
30
+ export const CommandParamDefI18nSchema = z.object({
31
+ name: z.string().min(1).max(20),
32
+ description: z.string().max(50),
33
+ });
34
+ /**
35
+ * Choice option schema for command parameters
36
+ */
37
+ export const CommandChoiceSchema = z.object({
38
+ name: z.string(),
39
+ value: z.union([z.string(), z.number(), z.boolean()]),
40
+ nameDescI18nMap: z.record(CommandNameDescI18nSchema).optional(),
41
+ });
42
+ /**
43
+ * Parameter definition schema for command metadata
44
+ */
45
+ export const CommandParamDefinitionSchema = z.object({
46
+ name: z.string().min(1).max(20),
47
+ type: CommandParamTypeSchema,
48
+ required: z.boolean(),
49
+ description: z.string().max(50).optional(),
50
+ choices: z.array(CommandChoiceSchema).max(10).optional(),
51
+ nameDescI18nMap: z.record(CommandParamDefI18nSchema).optional(),
52
+ autoComplete: z.boolean().optional(),
53
+ alfDescription: z.string().max(1500).optional(),
54
+ });
55
+ /**
56
+ * Command metadata schema returned from extension.command.metadata.getCommands
57
+ */
58
+ export const CommandConfigSchema = z.object({
59
+ name: z.string().min(1).max(30),
60
+ scope: CommandScopeSchema,
61
+ buttonName: z.string().min(1).max(30).optional(),
62
+ buttonNameI18nMap: z.record(CommandNameI18nSchema).optional(),
63
+ description: z.string().max(100).optional(),
64
+ nameDescI18nMap: z.record(CommandNameDescI18nSchema).optional(),
65
+ actionFunctionName: z.string().min(1),
66
+ autoCompleteFunctionName: z.string().min(1).optional(),
67
+ systemVersion: z.string().optional(),
68
+ alfMode: CommandAlfModeSchema,
69
+ alfDescription: z.string().max(1500).optional(),
70
+ paramDefinitions: z.array(CommandParamDefinitionSchema).max(10).optional(),
71
+ enabledByDefault: z.boolean().optional(),
72
+ });
73
+ /**
74
+ * Metadata response schema for command registration
75
+ */
76
+ export const GetCommandsOutputSchema = z.object({
77
+ commands: z.array(CommandConfigSchema).max(30),
78
+ });
2
79
  /**
3
80
  * Command suggestion schema
4
81
  */
@@ -1 +1 @@
1
- {"version":3,"file":"command.js","sourceRoot":"","sources":["../../src/extensions/command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC5B,CAAC,CAAC;AAIH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC;KACjC,MAAM,CAAC;IACN,IAAI,EAAE,CAAC,CAAC,MAAM,EA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AC,GAAG,CAAC,EAAE,CAAC;CAC/C,CAAC,CAAC;AAGH;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC5B,CAAC,CAAC;AAIH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC;KACjC,MAAM,CAAC;IACN,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE;CAC7C,CAAC;KACD,MAAM,EAAE,CAAC"}
@@ -11,13 +11,21 @@ export declare const CustomTabNameI18nSchema: z.ZodObject<{
11
11
  }>;
12
12
  export type CustomTabNameI18n = z.infer<typeof CustomTabNameI18nSchema>;
13
13
  /**
14
- * Custom tab configuration schema
14
+ * Custom tab metadata schema returned from extension.customtab.metadata.getCustomTabs.
15
15
  */
16
16
  export declare const CustomTabConfigSchema: z.ZodObject<{
17
17
  /**
18
18
  * Tab name (displayed in the Desk UI)
19
19
  */
20
20
  name: z.ZodString;
21
+ /**
22
+ * App function invoked when the custom tab is opened.
23
+ */
24
+ actionFunctionName: z.ZodString;
25
+ /**
26
+ * System version used when invoking custom tab functions
27
+ */
28
+ systemVersion: z.ZodOptional<z.ZodString>;
21
29
  /**
22
30
  * i18n name map keyed by language code (e.g., "ko", "en", "ja")
23
31
  */
@@ -28,42 +36,96 @@ export declare const CustomTabConfigSchema: z.ZodObject<{
28
36
  }, {
29
37
  name: string;
30
38
  }>>>;
31
- /**
32
- * Icon URL or icon name
33
- */
34
- icon: z.ZodOptional<z.ZodString>;
35
39
  }, "strip", z.ZodTypeAny, {
36
40
  name: string;
37
- icon?: string | undefined;
41
+ actionFunctionName: string;
42
+ systemVersion?: string | undefined;
38
43
  nameI18nMap?: Record<string, {
39
44
  name: string;
40
45
  }> | undefined;
41
46
  }, {
42
47
  name: string;
43
- icon?: string | undefined;
48
+ actionFunctionName: string;
49
+ systemVersion?: string | undefined;
44
50
  nameI18nMap?: Record<string, {
45
51
  name: string;
46
52
  }> | undefined;
47
53
  }>;
48
54
  export type CustomTabConfig = z.infer<typeof CustomTabConfigSchema>;
49
55
  /**
50
- * Custom tab content schema
56
+ * Metadata response schema for custom tab registration
51
57
  */
52
- export declare const CustomTabContentSchema: z.ZodObject<{
53
- /**
54
- * WAM name to render in the custom tab
55
- */
56
- wamName: z.ZodString;
57
- /**
58
- * Additional parameters to pass to the WAM
59
- */
60
- wamParams: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
58
+ export declare const GetCustomTabsOutputSchema: z.ZodObject<{
59
+ customTabs: z.ZodArray<z.ZodObject<{
60
+ /**
61
+ * Tab name (displayed in the Desk UI)
62
+ */
63
+ name: z.ZodString;
64
+ /**
65
+ * App function invoked when the custom tab is opened.
66
+ */
67
+ actionFunctionName: z.ZodString;
68
+ /**
69
+ * System version used when invoking custom tab functions
70
+ */
71
+ systemVersion: z.ZodOptional<z.ZodString>;
72
+ /**
73
+ * i18n name map keyed by language code (e.g., "ko", "en", "ja")
74
+ */
75
+ nameI18nMap: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
76
+ name: z.ZodString;
77
+ }, "strip", z.ZodTypeAny, {
78
+ name: string;
79
+ }, {
80
+ name: string;
81
+ }>>>;
82
+ }, "strip", z.ZodTypeAny, {
83
+ name: string;
84
+ actionFunctionName: string;
85
+ systemVersion?: string | undefined;
86
+ nameI18nMap?: Record<string, {
87
+ name: string;
88
+ }> | undefined;
89
+ }, {
90
+ name: string;
91
+ actionFunctionName: string;
92
+ systemVersion?: string | undefined;
93
+ nameI18nMap?: Record<string, {
94
+ name: string;
95
+ }> | undefined;
96
+ }>, "many">;
61
97
  }, "strip", z.ZodTypeAny, {
62
- wamName: string;
63
- wamParams?: Record<string, unknown> | undefined;
98
+ customTabs: {
99
+ name: string;
100
+ actionFunctionName: string;
101
+ systemVersion?: string | undefined;
102
+ nameI18nMap?: Record<string, {
103
+ name: string;
104
+ }> | undefined;
105
+ }[];
106
+ }, {
107
+ customTabs: {
108
+ name: string;
109
+ actionFunctionName: string;
110
+ systemVersion?: string | undefined;
111
+ nameI18nMap?: Record<string, {
112
+ name: string;
113
+ }> | undefined;
114
+ }[];
115
+ }>;
116
+ export type GetCustomTabsOutput = z.infer<typeof GetCustomTabsOutputSchema>;
117
+ /**
118
+ * Custom tab action result schema — matches AppStore action payloads.
119
+ */
120
+ export declare const CustomTabActionResultSchema: z.ZodObject<{
121
+ type: z.ZodString;
122
+ attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
123
+ }, "strict", z.ZodTypeAny, {
124
+ type: string;
125
+ attributes?: Record<string, unknown> | undefined;
64
126
  }, {
65
- wamName: string;
66
- wamParams?: Record<string, unknown> | undefined;
127
+ type: string;
128
+ attributes?: Record<string, unknown> | undefined;
67
129
  }>;
68
- export type CustomTabContent = z.infer<typeof CustomTabContentSchema>;
130
+ export type CustomTabActionResult = z.infer<typeof CustomTabActionResultSchema>;
69
131
  //# sourceMappingURL=customtab.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"customtab.d.ts","sourceRoot":"","sources":["../../src/extensions/customtab.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;;;;EAElC,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE;;GAEG;AACH,eAAO,M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export const CustomTabNameI18nSchema = z.object({
6
6
  name: z.string().min(1).max(30),
7
7
  });
8
8
  /**
9
- * Custom tab configuration schema
9
+ * Custom tab metadata schema returned from extension.customtab.metadata.getCustomTabs.
10
10
  */
11
11
  export const CustomTabConfigSchema = z.object({
12
12
  /**
13
13
  * Tab name (displayed in the Desk UI)
14
14
  */
15
- name: z.string().min(1).max(30),
15
+ name: z
16
+ .string()
17
+ .min(1)
18
+ .max(30)
19
+ .regex(/^[a-zA-Z_-]*$/),
16
20
  /**
17
- * i18n name map keyed by language code (e.g., "ko", "en", "ja")
21
+ * App function invoked when the custom tab is opened.
18
22
  */
19
- nameI18nMap: z.record(CustomTabNameI18nSchema).optional(),
23
+ actionFunctionName: z.string().min(1),
20
24
  /**
21
- * Icon URL or icon name
25
+ * System version used when invoking custom tab functions
22
26
  */
23
- icon: z.string().optional(),
27
+ systemVersion: z.string().optional(),
28
+ /**
29
+ * i18n name map keyed by language code (e.g., "ko", "en", "ja")
30
+ */
31
+ nameI18nMap: z.record(CustomTabNameI18nSchema).optional(),
24
32
  });
25
33
  /**
26
- * Custom tab content schema
34
+ * Metadata response schema for custom tab registration
27
35
  */
28
- export const CustomTabContentSchema = z.object({
29
- /**
30
- * WAM name to render in the custom tab
31
- */
32
- wamName: z.string(),
33
- /**
34
- * Additional parameters to pass to the WAM
35
- */
36
- wamParams: z.record(z.unknown()).optional(),
36
+ export const GetCustomTabsOutputSchema = z.object({
37
+ customTabs: z.array(CustomTabConfigSchema).max(5),
37
38
  });
39
+ /**
40
+ * Custom tab action result schema — matches AppStore action payloads.
41
+ */
42
+ export const CustomTabActionResultSchema = z
43
+ .object({
44
+ type: z.string().min(1),
45
+ attributes: z.record(z.unknown()).optional(),
46
+ })
47
+ .strict();
38
48
  //# sourceMappingURL=customtab.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"customtab.js","sourceRoot":"","sources":["../../src/extensions/customtab.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAA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5C;;OAEG;IACH,IAAI,EAAE,CAAC;SACJ,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,EAAE,CAAC;SACP,KAAK,CAAC,eAAe,CAAC;IACzB;;OAEG;IACH,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACrC;;OAEG;IACH,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACpC;;OAEG;IACH,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC,QAAQ,EAAE;CAC1D,CAAC,CAAC;AAIH;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;CAClD,CAAC,CAAC;AAIH;;GAEG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC;KACzC,MAAM,CAAC;IACN,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE;CAC7C,CAAC;KACD,MAAM,EAAE,CAAC"}
@@ -1,10 +1,11 @@
1
1
  export { OAuthConfigSchema, CredentialValidationResultSchema, type OAuthConfig, type CredentialValidationResult, } from "./oauth.js";
2
2
  export { ApiKeyFieldSchema, ApiKeyAuthScope, GetAuthConfigOutputSchema, ValidateCredentialsOutputSchema, type ApiKeyField, type GetAuthConfigOutput, type ValidateCredentialsOutput, } from "./apikey.js";
3
3
  export { CalendarSchema, EventTypeSchema, TimeSlotSchema, AttendeeSchema, BookingStatus, BookingSchema, type Calendar, type EventType, type TimeSlot, type Attendee, type Booking, } from "./calendar.js";
4
- export { CommandSuggestionSchema, CommandResultSchema, type CommandSuggestion, type CommandResult, } from "./command.js";
5
- export { WidgetScope, WidgetType, NameDescI18nSchema, WidgetConfigSchema, WidgetActionResultSchema, type NameDescI18n, type WidgetConfig, type WidgetActionResult, } from "./widget.js";
6
- export { CustomTabNameI18nSchema, CustomTabConfigSchema, CustomTabContentSchema, type CustomTabNameI18n, type CustomTabConfig, type CustomTabContent, } from "./customtab.js";
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
+ export { WidgetScope, WidgetType, NameDescI18nSchema, WidgetConfigSchema, GetWidgetsOutputSchema, WidgetActionResultSchema, type NameDescI18n, type WidgetConfig, type GetWidgetsOutput, type WidgetActionResult, } from "./widget.js";
6
+ export { CustomTabNameI18nSchema, CustomTabConfigSchema, GetCustomTabsOutputSchema, CustomTabActionResultSchema, type CustomTabNameI18n, type CustomTabConfig, type GetCustomTabsOutput, type CustomTabActionResult, } from "./customtab.js";
7
7
  export { MemoryDefinitionSchema, WorkflowNodeSchema, PredefinedTaskSchema, GetAlfTasksResponseSchema, type MemoryDefinition, type WorkflowNode, type PredefinedTask, type GetAlfTasksResponse, } from "./alftask.js";
8
8
  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
+ export { WmsShippingInfoSchema, WmsDeliverySchema, WmsOrderItemSchema, WmsOrderSchema, CommerceIdentifiersSchema, type WmsShippingInfo, type WmsDelivery, type WmsOrderItem, type WmsOrder, type CommerceIdentifiers, } from "./wms.js";
9
10
  export * from "./interfaces/index.js";
10
11
  //# sourceMappingURL=index.d.ts.map
@@ -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,aAAa,EACb,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,OAAO,GACb,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,uBAAuB,EACvB,mBAAmB,EACnB,KAAK,iBAAiB,EACtB,KAAK,aAAa,GACnB,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,WAAW,EACX,UAAU,EACV,kBAAkB,EAClB,kBAAkB,EAClB,wBAAwB,EACxB,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,kBAAkB,GACxB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,sBAAsB,EACtB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,gBAAgB,GACtB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,sBAAsB,EACtB,kBAAkB,EAClB,oBAAoB,EACpB,yBAAyB,EACzB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,mBAAmB,GACzB,MAAM,cAAc,CAAC;AAGtB,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,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,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,uB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B,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"}
@@ -5,15 +5,17 @@ export { ApiKeyFieldSchema, ApiKeyAuthScope, GetAuthConfigOutputSchema, Validate
5
5
  // Calendar Extension Schemas (v1)
6
6
  export { CalendarSchema, EventTypeSchema, TimeSlotSchema, AttendeeSchema, BookingStatus, BookingSchema, } from "./calendar.js";
7
7
  // Command Extension Schemas (v1)
8
- export { CommandSuggestionSchema, CommandResultSchema, } from "./command.js";
8
+ export { CommandScopeSchema, CommandAlfModeSchema, CommandParamTypeSchema, CommandNameI18nSchema, CommandNameDescI18nSchema, CommandParamDefI18nSchema, CommandChoiceSchema, CommandParamDefinitionSchema, CommandConfigSchema, GetCommandsOutputSchema, CommandSuggestionSchema, CommandResultSchema, } from "./command.js";
9
9
  // Widget Extension Schemas (v1)
10
- export { WidgetScope, WidgetType, NameDescI18nSchema, WidgetConfigSchema, WidgetActionResultSchema, } from "./widget.js";
10
+ export { WidgetScope, WidgetType, NameDescI18nSchema, WidgetConfigSchema, GetWidgetsOutputSchema, WidgetActionResultSchema, } from "./widget.js";
11
11
  // Custom Tab Extension Schemas (v1)
12
- export { CustomTabNameI18nSchema, CustomTabConfigSchema, CustomTabContentSchema, } from "./customtab.js";
12
+ export { CustomTabNameI18nSchema, CustomTabConfigSchema, GetCustomTabsOutputSchema, CustomTabActionResultSchema, } from "./customtab.js";
13
13
  // ALF Task Extension Schemas (v1)
14
14
  export { MemoryDefinitionSchema, WorkflowNodeSchema, PredefinedTaskSchema, GetAlfTasksResponseSchema, } from "./alftask.js";
15
15
  // Order Extension Schemas (v1)
16
16
  export { AddressSchema, BankAccountSchema, DefectInfoSchema, ClaimReasonSchema, ClaimabilitySchema, ClaimSchema, OrderItemSchema, PaymentSchema, FulfillmentSchema, OrderSchema, FieldConfigSchema, OperationOptionsSchema, AppCapabilitiesSchema, } from "./order.js";
17
+ // WMS Extension Schemas (v1)
18
+ export { WmsShippingInfoSchema, WmsDeliverySchema, WmsOrderItemSchema, WmsOrderSchema, CommerceIdentifiersSchema, } from "./wms.js";
17
19
  // Extension Interfaces (for implementing extensions)
18
20
  export * from "./interfaces/index.js";
19
21
  //# sourceMappingURL=index.js.map
@@ -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,uBAAuB,EACvB,mBAAmB,GAGpB,MAAM,cAAc,CAAC;AAEtB,gCAAgC;AAChC,OAAO,EACL,WAAW,EACX,UAAU,EACV,kBAAkB,EAClB,kBAAkB,EAClB,wBAAwB,GAIzB,MAAM,aAAa,CAAC;AAErB,oCAAoC;AACpC,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,sBAAsB,GAIvB,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,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,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,94 +1,143 @@
1
- import type { CommandSuggestion, CommandResult } from "../command.js";
1
+ import type { CommandChoice, CommandConfig, CommandResult } from "../command.js";
2
2
  import type { Context } from "../../types/context.js";
3
3
  /**
4
- * Command Extension Input Types
4
+ * Command metadata input/output types
5
5
  */
6
+ export type GetCommandsInput = Record<string, never>;
7
+ export interface GetCommandsOutput {
8
+ /** Command definitions discovered by AppStore during extension registration */
9
+ commands: CommandConfig[];
10
+ }
11
+ /**
12
+ * Command function input/output types
13
+ */
14
+ export interface CommandChat {
15
+ /** Chat type where the command is executed */
16
+ type: string;
17
+ /** Chat ID */
18
+ id: string;
19
+ }
20
+ export interface CommandTrigger {
21
+ /** Trigger source such as slash command, shortcut, or custom UI */
22
+ type: string;
23
+ /** Additional trigger metadata */
24
+ attributes: Record<string, string>;
25
+ }
26
+ export interface AutoCompleteArgument {
27
+ /** Whether this argument is currently focused in the UI */
28
+ focused: boolean;
29
+ /** Parameter name */
30
+ name: string;
31
+ /** Current value */
32
+ value: unknown;
33
+ }
6
34
  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;
35
+ /** Chat where autocomplete is requested */
36
+ chat: CommandChat;
37
+ /** Current argument state sent by AppStore */
38
+ input: AutoCompleteArgument[];
39
+ /** Active language */
40
+ language: string;
13
41
  }
14
42
  export interface GetSuggestionsOutput {
15
- /** List of command suggestions */
16
- suggestions: CommandSuggestion[];
43
+ /** Choices shown by AppStore for the focused parameter */
44
+ choices: CommandChoice[];
17
45
  }
18
46
  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;
47
+ /** Chat where the command is executed */
48
+ chat: CommandChat;
49
+ /** Trigger metadata sent by AppStore */
50
+ trigger: CommandTrigger;
51
+ /** Parsed command input values keyed by parameter name */
52
+ input: Record<string, unknown>;
53
+ /** Active language */
54
+ language: string;
29
55
  }
30
56
  /**
31
- * Command Extension Interface
57
+ * Command metadata extension interface
32
58
  *
33
- * Implement this interface to create a slash command extension.
59
+ * Implement this interface to expose command definitions for AppStore registration.
60
+ *
61
+ * @example
62
+ * ```typescript
63
+ * @Extension({ name: "command", systemVersion: "v1" })
64
+ * export class MyCommandExtension implements CommandMetadataExtensionInterface {
65
+ * @Func("metadata.getCommands")
66
+ * async getCommands(ctx, params): Promise<GetCommandsOutput> {
67
+ * return {
68
+ * commands: [
69
+ * {
70
+ * name: "meeting",
71
+ * scope: "desk",
72
+ * actionFunctionName: "commands.meeting.execute",
73
+ * autoCompleteFunctionName: "commands.meeting.autocomplete",
74
+ * alfMode: "disable",
75
+ * },
76
+ * ],
77
+ * };
78
+ * }
79
+ * }
80
+ * ```
81
+ */
82
+ export interface CommandMetadataExtensionInterface {
83
+ /**
84
+ * Get command definitions for AppStore registration
85
+ *
86
+ * Function name: "metadata.getCommands"
87
+ */
88
+ getCommands(ctx: Context, params: GetCommandsInput): Promise<GetCommandsOutput>;
89
+ }
90
+ /**
91
+ * Command extension interface
92
+ *
93
+ * Kept intentionally flexible: command metadata is registered via
94
+ * `metadata.getCommands`, while action, autocomplete, or toggle handlers are
95
+ * plain app functions and may live outside the extension class.
34
96
  *
35
97
  * @example
36
98
  * ```typescript
37
99
  * @Extension({ name: "command", systemVersion: "v1" })
38
100
  * 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: [] };
101
+ * @Func("metadata.getCommands")
102
+ * async getCommands(ctx, params): Promise<GetCommandsOutput> {
103
+ * return {
104
+ * commands: [
105
+ * {
106
+ * name: "meeting",
107
+ * scope: "desk",
108
+ * actionFunctionName: "commands.meeting.execute",
109
+ * alfMode: "disable",
110
+ * },
111
+ * ],
112
+ * };
51
113
  * }
114
+ * }
52
115
  *
53
- * @Func("command.execute")
54
- * @InputSchema(ExecuteCommandInputSchema)
55
- * @OutputSchema(CommandResultSchema)
116
+ * export class CommandFunctions {
117
+ * @Func("commands.meeting.execute")
56
118
  * async execute(ctx, params): Promise<CommandResult> {
57
- * if (params.command === "meeting") {
58
- * return {
59
- * type: "wam",
60
- * attributes: {
61
- * appId: process.env.APP_ID,
62
- * name: "meeting-scheduler",
63
- * wamArgs: { chatId: params.chatId },
64
- * },
65
- * };
66
- * }
67
- * return { type: "text", attributes: { message: "Unknown command" } };
119
+ * return { type: "text", attributes: { message: "Opened meeting flow" } };
68
120
  * }
69
121
  * }
70
122
  * ```
71
123
  */
72
- export interface CommandExtensionInterface {
124
+ export interface CommandExtensionInterface extends CommandMetadataExtensionInterface {
73
125
  /**
74
- * Get command suggestions as user types
75
- *
76
- * Function name: "command.getSuggestions"
126
+ * Optional autocomplete function.
127
+ * This is a plain app function referenced by `autoCompleteFunctionName`.
77
128
  */
78
- getSuggestions(ctx: Context, params: GetSuggestionsInput): Promise<GetSuggestionsOutput>;
129
+ getSuggestions?(ctx: Context, params: GetSuggestionsInput): Promise<GetSuggestionsOutput>;
79
130
  /**
80
- * Execute a command
81
- *
82
- * Function name: "command.execute"
83
- *
84
- * @returns Action to perform (e.g. wam, web, command)
131
+ * Optional action function.
132
+ * This is a plain app function referenced by `actionFunctionName`.
85
133
  */
86
- execute(ctx: Context, params: ExecuteCommandInput): Promise<CommandResult>;
134
+ execute?(ctx: Context, params: ExecuteCommandInput): Promise<CommandResult>;
87
135
  }
88
136
  /**
89
137
  * Command Extension Function Names
90
138
  */
91
139
  export declare const CommandFunctionNames: {
140
+ readonly getCommands: "metadata.getCommands";
92
141
  readonly getSuggestions: "command.getSuggestions";
93
142
  readonly execute: "command.execute";
94
143
  };
@@ -1 +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,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEtD;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,MAAM,WAAW,yBAAyB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AoB,EAAE,CAAC;IAC9B,sBAAsB;IACtB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,oBAAoB;IACnC,0DAA0D;IAC1D,OAAO,EAAE,aAAa,EAAE,CAAC;CAC1B;AAED,MAAM,WAAW,mBAAmB;IAClC,yCAAyC;IACzC,IAAI,EAAE,WAAW,CAAC;IAClB,wCAAwC;IACxC,OAAO,EAAE,cAAc,CAAC;IACxB,0DAA0D;IAC1D,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,sBAAsB;IACtB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,WAAW,iCAAiC;IAChD;;;;OAIG;IACH,WAAW,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;CACjF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,WAAW,yBAA0B,SAAQ,iCAAiC;IAClF;;;OAGG;IACH,cAAc,CAAC,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAE1F;;;OAGG;IACH,OAAO,CAAC,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;CAC7E;AAED;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;CAIvB,CAAC"}
@@ -2,6 +2,7 @@
2
2
  * Command Extension Function Names
3
3
  */
4
4
  export const CommandFunctionNames = {
5
+ getCommands: "metadata.getCommands",
5
6
  getSuggestions: "command.getSuggestions",
6
7
  execute: "command.execute",
7
8
  };
@@ -1 +1 @@
1
- {"version":3,"file":"command.js","sourceRoot":"","sources":["../../../src/extensions/interfaces/command.ts"],"names":[],"mappings":"AA6FA;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,cAAc,EAAE,wBAAwB;IACxC,OAAO,EAAE,iBAAiB;CAClB,CAAC"}
1
+ {"version":3,"file":"command.js","sourceRoot":"","sources":["../../../src/extensions/interfaces/command.ts"],"names":[],"mappings":"AAmJA;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,WAAW,EAAE,sBAAsB;IACnC,cAAc,EAAE,wBAAwB;IACxC,OAAO,EAAE,iBAAiB;CAClB,CAAC"}