@iterable/cli 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.
- package/COMMANDS.md +1574 -0
- package/LICENSE.md +21 -0
- package/README.md +194 -0
- package/dist/commands/campaigns.d.ts +3 -0
- package/dist/commands/campaigns.d.ts.map +1 -0
- package/dist/commands/campaigns.js +106 -0
- package/dist/commands/campaigns.js.map +1 -0
- package/dist/commands/catalogs.d.ts +3 -0
- package/dist/commands/catalogs.d.ts.map +1 -0
- package/dist/commands/catalogs.js +99 -0
- package/dist/commands/catalogs.js.map +1 -0
- package/dist/commands/events.d.ts +3 -0
- package/dist/commands/events.d.ts.map +1 -0
- package/dist/commands/events.js +33 -0
- package/dist/commands/events.js.map +1 -0
- package/dist/commands/experiments.d.ts +3 -0
- package/dist/commands/experiments.d.ts.map +1 -0
- package/dist/commands/experiments.js +33 -0
- package/dist/commands/experiments.js.map +1 -0
- package/dist/commands/export.d.ts +3 -0
- package/dist/commands/export.d.ts.map +1 -0
- package/dist/commands/export.js +33 -0
- package/dist/commands/export.js.map +1 -0
- package/dist/commands/journeys.d.ts +3 -0
- package/dist/commands/journeys.d.ts.map +1 -0
- package/dist/commands/journeys.js +21 -0
- package/dist/commands/journeys.js.map +1 -0
- package/dist/commands/lists.d.ts +3 -0
- package/dist/commands/lists.d.ts.map +1 -0
- package/dist/commands/lists.js +64 -0
- package/dist/commands/lists.js.map +1 -0
- package/dist/commands/messaging.d.ts +3 -0
- package/dist/commands/messaging.d.ts.map +1 -0
- package/dist/commands/messaging.js +120 -0
- package/dist/commands/messaging.js.map +1 -0
- package/dist/commands/registry.d.ts +46 -0
- package/dist/commands/registry.d.ts.map +1 -0
- package/dist/commands/registry.js +42 -0
- package/dist/commands/registry.js.map +1 -0
- package/dist/commands/snippets.d.ts +3 -0
- package/dist/commands/snippets.d.ts.map +1 -0
- package/dist/commands/snippets.js +42 -0
- package/dist/commands/snippets.js.map +1 -0
- package/dist/commands/subscriptions.d.ts +3 -0
- package/dist/commands/subscriptions.d.ts.map +1 -0
- package/dist/commands/subscriptions.js +40 -0
- package/dist/commands/subscriptions.js.map +1 -0
- package/dist/commands/templates.d.ts +3 -0
- package/dist/commands/templates.d.ts.map +1 -0
- package/dist/commands/templates.js +160 -0
- package/dist/commands/templates.js.map +1 -0
- package/dist/commands/transforms.d.ts +3 -0
- package/dist/commands/transforms.d.ts.map +1 -0
- package/dist/commands/transforms.js +24 -0
- package/dist/commands/transforms.js.map +1 -0
- package/dist/commands/types.d.ts +40 -0
- package/dist/commands/types.d.ts.map +1 -0
- package/dist/commands/types.js +15 -0
- package/dist/commands/types.js.map +1 -0
- package/dist/commands/users.d.ts +3 -0
- package/dist/commands/users.d.ts.map +1 -0
- package/dist/commands/users.js +103 -0
- package/dist/commands/users.js.map +1 -0
- package/dist/commands/webhooks.d.ts +3 -0
- package/dist/commands/webhooks.d.ts.map +1 -0
- package/dist/commands/webhooks.js +21 -0
- package/dist/commands/webhooks.js.map +1 -0
- package/dist/config.d.ts +14 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +60 -0
- package/dist/config.js.map +1 -0
- package/dist/errors.d.ts +11 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +21 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +107 -0
- package/dist/index.js.map +1 -0
- package/dist/key-manager.d.ts +280 -0
- package/dist/key-manager.d.ts.map +1 -0
- package/dist/key-manager.js +989 -0
- package/dist/key-manager.js.map +1 -0
- package/dist/keys-cli.d.ts +3 -0
- package/dist/keys-cli.d.ts.map +1 -0
- package/dist/keys-cli.js +396 -0
- package/dist/keys-cli.js.map +1 -0
- package/dist/output.d.ts +5 -0
- package/dist/output.d.ts.map +1 -0
- package/dist/output.js +104 -0
- package/dist/output.js.map +1 -0
- package/dist/parser.d.ts +26 -0
- package/dist/parser.d.ts.map +1 -0
- package/dist/parser.js +281 -0
- package/dist/parser.js.map +1 -0
- package/dist/router.d.ts +20 -0
- package/dist/router.d.ts.map +1 -0
- package/dist/router.js +137 -0
- package/dist/router.js.map +1 -0
- package/dist/utils/cli-env.d.ts +10 -0
- package/dist/utils/cli-env.d.ts.map +1 -0
- package/dist/utils/cli-env.js +21 -0
- package/dist/utils/cli-env.js.map +1 -0
- package/dist/utils/command-info.d.ts +7 -0
- package/dist/utils/command-info.d.ts.map +1 -0
- package/dist/utils/command-info.js +36 -0
- package/dist/utils/command-info.js.map +1 -0
- package/dist/utils/detect-background.d.ts +3 -0
- package/dist/utils/detect-background.d.ts.map +1 -0
- package/dist/utils/detect-background.js +33 -0
- package/dist/utils/detect-background.js.map +1 -0
- package/dist/utils/endpoint-prompt.d.ts +5 -0
- package/dist/utils/endpoint-prompt.d.ts.map +1 -0
- package/dist/utils/endpoint-prompt.js +98 -0
- package/dist/utils/endpoint-prompt.js.map +1 -0
- package/dist/utils/formatting.d.ts +3 -0
- package/dist/utils/formatting.d.ts.map +1 -0
- package/dist/utils/formatting.js +5 -0
- package/dist/utils/formatting.js.map +1 -0
- package/dist/utils/password-prompt.d.ts +3 -0
- package/dist/utils/password-prompt.d.ts.map +1 -0
- package/dist/utils/password-prompt.js +21 -0
- package/dist/utils/password-prompt.js.map +1 -0
- package/dist/utils/sanitize.d.ts +13 -0
- package/dist/utils/sanitize.d.ts.map +1 -0
- package/dist/utils/sanitize.js +23 -0
- package/dist/utils/sanitize.js.map +1 -0
- package/dist/utils/theme.d.ts +11 -0
- package/dist/utils/theme.d.ts.map +1 -0
- package/dist/utils/theme.js +14 -0
- package/dist/utils/theme.js.map +1 -0
- package/dist/utils/ui.d.ts +22 -0
- package/dist/utils/ui.d.ts.map +1 -0
- package/dist/utils/ui.js +107 -0
- package/dist/utils/ui.js.map +1 -0
- package/dist/utils/url.d.ts +13 -0
- package/dist/utils/url.d.ts.map +1 -0
- package/dist/utils/url.js +20 -0
- package/dist/utils/url.js.map +1 -0
- package/package.json +90 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { CreateListParamsSchema, DeleteListParamsSchema, GetListPreviewUsersParamsSchema, GetListSizeParamsSchema, GetListUsersParamsSchema, SubscribeToListParamsSchema, UnsubscribeFromListParamsSchema, } from "@iterable/api";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { defineCommand } from "./types.js";
|
|
4
|
+
export const listCommands = [
|
|
5
|
+
defineCommand({
|
|
6
|
+
category: "lists",
|
|
7
|
+
name: "list",
|
|
8
|
+
description: "Retrieve user lists",
|
|
9
|
+
clientMethod: "getLists",
|
|
10
|
+
schema: z.object({}),
|
|
11
|
+
execute: (client) => client.getLists(),
|
|
12
|
+
}),
|
|
13
|
+
defineCommand({
|
|
14
|
+
category: "lists",
|
|
15
|
+
name: "get-users",
|
|
16
|
+
description: "Get users in a specific list",
|
|
17
|
+
clientMethod: "getListUsers",
|
|
18
|
+
schema: GetListUsersParamsSchema,
|
|
19
|
+
}),
|
|
20
|
+
defineCommand({
|
|
21
|
+
category: "lists",
|
|
22
|
+
name: "get-size",
|
|
23
|
+
description: "Get the count of users in a specific list",
|
|
24
|
+
clientMethod: "getListSize",
|
|
25
|
+
schema: GetListSizeParamsSchema,
|
|
26
|
+
}),
|
|
27
|
+
defineCommand({
|
|
28
|
+
category: "lists",
|
|
29
|
+
name: "get-preview-users",
|
|
30
|
+
description: "Preview users in a list (up to 5000 users)",
|
|
31
|
+
clientMethod: "getListPreviewUsers",
|
|
32
|
+
schema: GetListPreviewUsersParamsSchema,
|
|
33
|
+
}),
|
|
34
|
+
defineCommand({
|
|
35
|
+
category: "lists",
|
|
36
|
+
name: "create",
|
|
37
|
+
description: "Create a new user list",
|
|
38
|
+
clientMethod: "createList",
|
|
39
|
+
schema: CreateListParamsSchema,
|
|
40
|
+
}),
|
|
41
|
+
defineCommand({
|
|
42
|
+
category: "lists",
|
|
43
|
+
name: "delete",
|
|
44
|
+
description: "Delete a user list",
|
|
45
|
+
clientMethod: "deleteList",
|
|
46
|
+
schema: DeleteListParamsSchema,
|
|
47
|
+
execute: (client, params) => client.deleteList(params.listId),
|
|
48
|
+
}),
|
|
49
|
+
defineCommand({
|
|
50
|
+
category: "lists",
|
|
51
|
+
name: "subscribe",
|
|
52
|
+
description: "Subscribe users to a specific list",
|
|
53
|
+
clientMethod: "subscribeUserToList",
|
|
54
|
+
schema: SubscribeToListParamsSchema,
|
|
55
|
+
}),
|
|
56
|
+
defineCommand({
|
|
57
|
+
category: "lists",
|
|
58
|
+
name: "unsubscribe",
|
|
59
|
+
description: "Unsubscribe users from a specific list",
|
|
60
|
+
clientMethod: "unsubscribeUserFromList",
|
|
61
|
+
schema: UnsubscribeFromListParamsSchema,
|
|
62
|
+
}),
|
|
63
|
+
];
|
|
64
|
+
//# sourceMappingURL=lists.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lists.js","sourceRoot":"","sources":["../../src/commands/lists.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,+BAA+B,EAC/B,uBAAuB,EACvB,wBAAwB,EACxB,2BAA2B,EAC3B,+BAA+B,GAChC,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,MAAM,CAAC,MAAM,YAAY,GAAwB;IAC/C,aAAa,CAAC;QACZ,QAAQ,EAAE,OAAO;QACjB,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,qBAAqB;QAClC,YAAY,EAAE,UAAU;QACxB,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;QACpB,OAAO,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,EAAE;KACvC,CAAC;IACF,aAAa,CAAC;QACZ,QAAQ,EAAE,OAAO;QACjB,IAAI,EAAE,WAAW;QACjB,WAAW,EAAE,8BAA8B;QAC3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ings":"AAkBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAGpD,eAAO,MAAM,iBAAiB,EAAE,iBAAiB,EAqHhD,CAAC"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { CancelEmailParamsSchema, CancelInAppParamsSchema, CancelPushParamsSchema, CancelSMSParamsSchema, CancelWebPushParamsSchema, CancelWhatsAppParamsSchema, GetEmbeddedMessagesParamsSchema, GetInAppMessagesParamsSchema, SendEmailParamsSchema, SendInAppParamsSchema, SendPushParamsSchema, SendSMSParamsSchema, SendWebPushParamsSchema, SendWhatsAppParamsSchema, } from "@iterable/api";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { defineCommand } from "./types.js";
|
|
4
|
+
export const messagingCommands = [
|
|
5
|
+
defineCommand({
|
|
6
|
+
category: "messaging",
|
|
7
|
+
name: "send-email",
|
|
8
|
+
description: "Send email to user",
|
|
9
|
+
clientMethod: "sendEmail",
|
|
10
|
+
schema: SendEmailParamsSchema,
|
|
11
|
+
}),
|
|
12
|
+
defineCommand({
|
|
13
|
+
category: "messaging",
|
|
14
|
+
name: "cancel-email",
|
|
15
|
+
description: "Cancel scheduled email for specific user",
|
|
16
|
+
clientMethod: "cancelEmail",
|
|
17
|
+
schema: CancelEmailParamsSchema,
|
|
18
|
+
}),
|
|
19
|
+
defineCommand({
|
|
20
|
+
category: "messaging",
|
|
21
|
+
name: "send-sms",
|
|
22
|
+
description: "Send SMS message to user",
|
|
23
|
+
clientMethod: "sendSMS",
|
|
24
|
+
schema: SendSMSParamsSchema,
|
|
25
|
+
}),
|
|
26
|
+
defineCommand({
|
|
27
|
+
category: "messaging",
|
|
28
|
+
name: "cancel-sms",
|
|
29
|
+
description: "Cancel scheduled SMS message for specific user",
|
|
30
|
+
clientMethod: "cancelSMS",
|
|
31
|
+
schema: CancelSMSParamsSchema,
|
|
32
|
+
}),
|
|
33
|
+
defineCommand({
|
|
34
|
+
category: "messaging",
|
|
35
|
+
name: "send-push",
|
|
36
|
+
description: "Send push notification to user",
|
|
37
|
+
clientMethod: "sendPush",
|
|
38
|
+
schema: SendPushParamsSchema,
|
|
39
|
+
}),
|
|
40
|
+
defineCommand({
|
|
41
|
+
category: "messaging",
|
|
42
|
+
name: "cancel-push",
|
|
43
|
+
description: "Cancel scheduled push notification for specific user",
|
|
44
|
+
clientMethod: "cancelPush",
|
|
45
|
+
schema: CancelPushParamsSchema,
|
|
46
|
+
}),
|
|
47
|
+
defineCommand({
|
|
48
|
+
category: "messaging",
|
|
49
|
+
name: "send-web-push",
|
|
50
|
+
description: "Send web push notification to user",
|
|
51
|
+
clientMethod: "sendWebPush",
|
|
52
|
+
schema: SendWebPushParamsSchema,
|
|
53
|
+
}),
|
|
54
|
+
defineCommand({
|
|
55
|
+
category: "messaging",
|
|
56
|
+
name: "cancel-web-push",
|
|
57
|
+
description: "Cancel scheduled web push notification for specific user",
|
|
58
|
+
clientMethod: "cancelWebPush",
|
|
59
|
+
schema: CancelWebPushParamsSchema,
|
|
60
|
+
}),
|
|
61
|
+
defineCommand({
|
|
62
|
+
category: "messaging",
|
|
63
|
+
name: "send-whatsapp",
|
|
64
|
+
description: "Send WhatsApp message to user",
|
|
65
|
+
clientMethod: "sendWhatsApp",
|
|
66
|
+
schema: SendWhatsAppParamsSchema,
|
|
67
|
+
}),
|
|
68
|
+
defineCommand({
|
|
69
|
+
category: "messaging",
|
|
70
|
+
name: "cancel-whatsapp",
|
|
71
|
+
description: "Cancel scheduled WhatsApp message for specific user",
|
|
72
|
+
clientMethod: "cancelWhatsApp",
|
|
73
|
+
schema: CancelWhatsAppParamsSchema,
|
|
74
|
+
}),
|
|
75
|
+
defineCommand({
|
|
76
|
+
category: "messaging",
|
|
77
|
+
name: "send-in-app",
|
|
78
|
+
description: "Send in-app message to user",
|
|
79
|
+
clientMethod: "sendInApp",
|
|
80
|
+
schema: SendInAppParamsSchema,
|
|
81
|
+
}),
|
|
82
|
+
defineCommand({
|
|
83
|
+
category: "messaging",
|
|
84
|
+
name: "cancel-in-app",
|
|
85
|
+
description: "Cancel scheduled in-app message for specific user",
|
|
86
|
+
clientMethod: "cancelInApp",
|
|
87
|
+
schema: CancelInAppParamsSchema,
|
|
88
|
+
}),
|
|
89
|
+
defineCommand({
|
|
90
|
+
category: "messaging",
|
|
91
|
+
name: "get-in-app-messages",
|
|
92
|
+
description: "Get in-app messages for a user",
|
|
93
|
+
clientMethod: "getInAppMessages",
|
|
94
|
+
schema: GetInAppMessagesParamsSchema,
|
|
95
|
+
}),
|
|
96
|
+
defineCommand({
|
|
97
|
+
category: "messaging",
|
|
98
|
+
name: "get-embedded-messages",
|
|
99
|
+
description: "Get embedded messages for a user, grouped by placement ID",
|
|
100
|
+
clientMethod: "getEmbeddedMessages",
|
|
101
|
+
schema: GetEmbeddedMessagesParamsSchema,
|
|
102
|
+
}),
|
|
103
|
+
defineCommand({
|
|
104
|
+
category: "messaging",
|
|
105
|
+
name: "get-channels",
|
|
106
|
+
description: "Get all available communication channels (email, SMS, push, etc.)",
|
|
107
|
+
clientMethod: "getChannels",
|
|
108
|
+
schema: z.object({}),
|
|
109
|
+
execute: (client) => client.getChannels(),
|
|
110
|
+
}),
|
|
111
|
+
defineCommand({
|
|
112
|
+
category: "messaging",
|
|
113
|
+
name: "get-message-types",
|
|
114
|
+
description: "Get all message types within the project for use in templates",
|
|
115
|
+
clientMethod: "getMessageTypes",
|
|
116
|
+
schema: z.object({}),
|
|
117
|
+
execute: (client) => client.getMessageTypes(),
|
|
118
|
+
}),
|
|
119
|
+
];
|
|
120
|
+
//# sourceMappingURL=messaging.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messaging.js","sourceRoot":"","sources":["../../src/commands/messaging.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACtB,qBAAqB,EACrB,yBAAyB,EACzB,0BAA0B,EAC1B,+BAA+B,EAC/B,4BAA4B,EAC5B,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AAa,CAAC;QACZ,QAAQ,EAAE,WAAW;QACrB,IAAI,EAAE,cAAc;QACpB,WAAW,EACT,mEAAmE;QACrE,YAAY,EAAE,aAAa;QAC3B,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;QACpB,OAAO,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,WAAW,EAAE;KAC1C,CAAC;IACF,aAAa,CAAC;QACZ,QAAQ,EAAE,WAAW;QACrB,IAAI,EAAE,mBAAmB;QACzB,WAAW,EACT,+DAA+D;QACjE,YAAY,EAAE,iBAAiB;QAC/B,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;QACpB,OAAO,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,eAAe,EAAE;KAC9C,CAAC;CACH,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { CommandDefinition } from "./types.js";
|
|
2
|
+
export declare const COMMANDS_BY_CATEGORY: readonly [{
|
|
3
|
+
readonly category: "campaigns";
|
|
4
|
+
readonly commands: CommandDefinition[];
|
|
5
|
+
}, {
|
|
6
|
+
readonly category: "catalogs";
|
|
7
|
+
readonly commands: CommandDefinition[];
|
|
8
|
+
}, {
|
|
9
|
+
readonly category: "events";
|
|
10
|
+
readonly commands: CommandDefinition[];
|
|
11
|
+
}, {
|
|
12
|
+
readonly category: "experiments";
|
|
13
|
+
readonly commands: CommandDefinition[];
|
|
14
|
+
}, {
|
|
15
|
+
readonly category: "export";
|
|
16
|
+
readonly commands: CommandDefinition[];
|
|
17
|
+
}, {
|
|
18
|
+
readonly category: "journeys";
|
|
19
|
+
readonly commands: CommandDefinition[];
|
|
20
|
+
}, {
|
|
21
|
+
readonly category: "lists";
|
|
22
|
+
readonly commands: CommandDefinition[];
|
|
23
|
+
}, {
|
|
24
|
+
readonly category: "messaging";
|
|
25
|
+
readonly commands: CommandDefinition[];
|
|
26
|
+
}, {
|
|
27
|
+
readonly category: "snippets";
|
|
28
|
+
readonly commands: CommandDefinition[];
|
|
29
|
+
}, {
|
|
30
|
+
readonly category: "subscriptions";
|
|
31
|
+
readonly commands: CommandDefinition[];
|
|
32
|
+
}, {
|
|
33
|
+
readonly category: "templates";
|
|
34
|
+
readonly commands: CommandDefinition[];
|
|
35
|
+
}, {
|
|
36
|
+
readonly category: "users";
|
|
37
|
+
readonly commands: CommandDefinition[];
|
|
38
|
+
}, {
|
|
39
|
+
readonly category: "webhooks";
|
|
40
|
+
readonly commands: CommandDefinition[];
|
|
41
|
+
}];
|
|
42
|
+
export declare function getAllCommands(): CommandDefinition[];
|
|
43
|
+
export declare function getCategories(): string[];
|
|
44
|
+
export declare function getCommandsByCategory(category: string): CommandDefinition[];
|
|
45
|
+
export declare function findCommand(category: string, name: string): CommandDefinition | undefined;
|
|
46
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/commands/registry.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAIpD,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAcvB,CAAC;AAEX,wBAAgB,cAAc,IAAI,iBAAiB,EAAE,CAEpD;AAED,wBAAgB,aAAa,IAAI,MAAM,EAAE,CAExC;AAED,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,iBAAiB,EAAE,CAG3E;AAED,wBAAgB,WAAW,CACzB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,GACX,iBAAiB,GAAG,SAAS,CAE/B"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { campaignCommands } from "./campaigns.js";
|
|
2
|
+
import { catalogCommands } from "./catalogs.js";
|
|
3
|
+
import { eventCommands } from "./events.js";
|
|
4
|
+
import { experimentCommands } from "./experiments.js";
|
|
5
|
+
import { exportCommands } from "./export.js";
|
|
6
|
+
import { journeyCommands } from "./journeys.js";
|
|
7
|
+
import { listCommands } from "./lists.js";
|
|
8
|
+
import { messagingCommands } from "./messaging.js";
|
|
9
|
+
import { snippetCommands } from "./snippets.js";
|
|
10
|
+
import { subscriptionCommands } from "./subscriptions.js";
|
|
11
|
+
import { templateCommands } from "./templates.js";
|
|
12
|
+
import { userCommands } from "./users.js";
|
|
13
|
+
import { webhookCommands } from "./webhooks.js";
|
|
14
|
+
export const COMMANDS_BY_CATEGORY = [
|
|
15
|
+
{ category: "campaigns", commands: campaignCommands },
|
|
16
|
+
{ category: "catalogs", commands: catalogCommands },
|
|
17
|
+
{ category: "events", commands: eventCommands },
|
|
18
|
+
{ category: "experiments", commands: experimentCommands },
|
|
19
|
+
{ category: "export", commands: exportCommands },
|
|
20
|
+
{ category: "journeys", commands: journeyCommands },
|
|
21
|
+
{ category: "lists", commands: listCommands },
|
|
22
|
+
{ category: "messaging", commands: messagingCommands },
|
|
23
|
+
{ category: "snippets", commands: snippetCommands },
|
|
24
|
+
{ category: "subscriptions", commands: subscriptionCommands },
|
|
25
|
+
{ category: "templates", commands: templateCommands },
|
|
26
|
+
{ category: "users", commands: userCommands },
|
|
27
|
+
{ category: "webhooks", commands: webhookCommands },
|
|
28
|
+
];
|
|
29
|
+
export function getAllCommands() {
|
|
30
|
+
return COMMANDS_BY_CATEGORY.flatMap(({ commands }) => commands);
|
|
31
|
+
}
|
|
32
|
+
export function getCategories() {
|
|
33
|
+
return COMMANDS_BY_CATEGORY.map(({ category }) => category);
|
|
34
|
+
}
|
|
35
|
+
export function getCommandsByCategory(category) {
|
|
36
|
+
const entry = COMMANDS_BY_CATEGORY.find((c) => c.category === category);
|
|
37
|
+
return entry ? [...entry.commands] : [];
|
|
38
|
+
}
|
|
39
|
+
export function findCommand(category, name) {
|
|
40
|
+
return getCommandsByCategory(category).find((cmd) => cmd.name === name);
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL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ceRoot":"","sources":["../../src/commands/snippets.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAGpD,eAAO,MAAM,eAAe,EAAE,iBAAiB,EAqC9C,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { CreateSnippetParamsSchema, DeleteSnippetParamsSchema, GetSnippetParamsSchema, UpdateSnippetParamsSchema, } from "@iterable/api";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { defineCommand } from "./types.js";
|
|
4
|
+
export const snippetCommands = [
|
|
5
|
+
defineCommand({
|
|
6
|
+
category: "snippets",
|
|
7
|
+
name: "list",
|
|
8
|
+
description: "Get all snippets for the current project",
|
|
9
|
+
clientMethod: "getSnippets",
|
|
10
|
+
schema: z.object({}),
|
|
11
|
+
execute: (client) => client.getSnippets(),
|
|
12
|
+
}),
|
|
13
|
+
defineCommand({
|
|
14
|
+
category: "snippets",
|
|
15
|
+
name: "get",
|
|
16
|
+
description: "Get a snippet by ID (numeric) or name (string)",
|
|
17
|
+
clientMethod: "getSnippet",
|
|
18
|
+
schema: GetSnippetParamsSchema,
|
|
19
|
+
}),
|
|
20
|
+
defineCommand({
|
|
21
|
+
category: "snippets",
|
|
22
|
+
name: "create",
|
|
23
|
+
description: "Create a new snippet with Handlebars templating support",
|
|
24
|
+
clientMethod: "createSnippet",
|
|
25
|
+
schema: CreateSnippetParamsSchema,
|
|
26
|
+
}),
|
|
27
|
+
defineCommand({
|
|
28
|
+
category: "snippets",
|
|
29
|
+
name: "update",
|
|
30
|
+
description: "Update a snippet by ID (numeric) or name (string)",
|
|
31
|
+
clientMethod: "updateSnippet",
|
|
32
|
+
schema: UpdateSnippetParamsSchema,
|
|
33
|
+
}),
|
|
34
|
+
defineCommand({
|
|
35
|
+
category: "snippets",
|
|
36
|
+
name: "delete",
|
|
37
|
+
description: "Delete a snippet by ID (numeric) or name (string)",
|
|
38
|
+
clientMethod: "deleteSnippet",
|
|
39
|
+
schema: DeleteSnippetParamsSchema,
|
|
40
|
+
}),
|
|
41
|
+
];
|
|
42
|
+
//# sourceMappingURL=snippets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snippets.js","sourceRoot":"","sources":["../../src/commands/snippets.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,yBAAyB,EACzB,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,MAAM,CAAC,MAAM,eAAe,GAAwB;IAClD,aAAa,CAAC;QACZ,QAAQ,EAAE,UAAU;QACpB,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,0CAA0C;QACvD,YAAY,EAAE,aAAa;QAC3B,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;QACpB,OAAO,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,WAAW,EAAE;KAC1C,CAAC;IACF,aAAa,CAAC;QACZ,QAAQ,EAAE,UAAU;QACpB,IAAI,EAAE,KAAK;QACX,WAAW,EAAE,gDAAgD;QAC7D,YAAY,EAAE,YAAY;QAC1B,MAAM,EAAE,sBAAsB;KAC/B,CAAC;IACF,aAAa,CAAC;QACZ,QAAQ,EAAE,UAAU;QACpB,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,yDAAyD;QACtE,YAAY,EAAE,eAAe;QAC7B,MAAM,EAAE,yBAAyB;KAClC,CAAC;IACF,aAAa,CAAC;QACZ,QAAQ,EAAE,UAAU;QACpB,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,mDAAmD;QAChE,YAAY,EAAE,eAAe;QAC7B,MAAM,EAAE,yBAAyB;KAClC,CAAC;IACF,aAAa,CAAC;QACZ,QAAQ,EAAE,UAAU;QACpB,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,mDAAmD;QAChE,YAAY,EAAE,eAAe;QAC7B,MAAM,EAAE,yBAAyB;KAClC,CAAC;CACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscriptions.d.ts","sourceRoot":"","sources":["../../src/commands/subscriptions.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAGpD,eAAO,MAAM,oBAAoB,EAAE,iBAAiB,EAqCnD,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { BulkUpdateSubscriptionsParamsSchema, SubscribeUserByEmailParamsSchema, SubscribeUserByUserIdParamsSchema, UnsubscribeUserByEmailParamsSchema, UnsubscribeUserByUserIdParamsSchema, } from "@iterable/api";
|
|
2
|
+
import { defineCommand } from "./types.js";
|
|
3
|
+
export const subscriptionCommands = [
|
|
4
|
+
defineCommand({
|
|
5
|
+
category: "subscriptions",
|
|
6
|
+
name: "bulk-update",
|
|
7
|
+
description: "Subscribe or unsubscribe multiple users to/from a subscription group",
|
|
8
|
+
clientMethod: "bulkUpdateSubscriptions",
|
|
9
|
+
schema: BulkUpdateSubscriptionsParamsSchema,
|
|
10
|
+
}),
|
|
11
|
+
defineCommand({
|
|
12
|
+
category: "subscriptions",
|
|
13
|
+
name: "subscribe-by-email",
|
|
14
|
+
description: "Subscribe a user to a subscription group by email",
|
|
15
|
+
clientMethod: "subscribeUserByEmail",
|
|
16
|
+
schema: SubscribeUserByEmailParamsSchema,
|
|
17
|
+
}),
|
|
18
|
+
defineCommand({
|
|
19
|
+
category: "subscriptions",
|
|
20
|
+
name: "subscribe-by-userid",
|
|
21
|
+
description: "Subscribe a user to a subscription group by userId",
|
|
22
|
+
clientMethod: "subscribeUserByUserId",
|
|
23
|
+
schema: SubscribeUserByUserIdParamsSchema,
|
|
24
|
+
}),
|
|
25
|
+
defineCommand({
|
|
26
|
+
category: "subscriptions",
|
|
27
|
+
name: "unsubscribe-by-email",
|
|
28
|
+
description: "Unsubscribe a user from a subscription group by email",
|
|
29
|
+
clientMethod: "unsubscribeUserByEmail",
|
|
30
|
+
schema: UnsubscribeUserByEmailParamsSchema,
|
|
31
|
+
}),
|
|
32
|
+
defineCommand({
|
|
33
|
+
category: "subscriptions",
|
|
34
|
+
name: "unsubscribe-by-userid",
|
|
35
|
+
description: "Unsubscribe a user from a subscription group by userId",
|
|
36
|
+
clientMethod: "unsubscribeUserByUserId",
|
|
37
|
+
schema: UnsubscribeUserByUserIdParamsSchema,
|
|
38
|
+
}),
|
|
39
|
+
];
|
|
40
|
+
//# sourceMappingURL=subscriptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscriptions.js","sourceRoot":"","sources":["../../src/commands/subscriptions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mCAAmC,EACnC,gCAAgC,EAChC,iCAAiC,EACjC,kCAAkC,EAClC,mCAAmC,GACpC,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,MAAM,CAAC,MAAM,oBAAoB,GAAwB;IACvD,aAAa,CAAC;QACZ,QAAQ,EAAE,eAAe;QACzB,IAAI,EAAE,aAAa;QACnB,WAAW,EACT,sEAAsE;QACxE,YAAY,EAAE,yBAAyB;QACvC,MAAM,EAAE,mCAAmC;KAC5C,CAAC;IACF,aAAa,CAAC;QACZ,QAAQ,EAAE,eAAe;QACzB,IAAI,EAAE,oBAAoB;QAC1B,WAAW,EAAE,mDAAmD;QAChE,YAAY,EAAE,sBAAsB;QACpC,MAAM,EAAE,gCAAgC;KACzC,CAAC;IACF,aAAa,CAAC;QACZ,QAAQ,EAAE,eAAe;QACzB,IAAI,EAAE,qBAAqB;QAC3B,WAAW,EAAE,oDAAoD;QACjE,YAAY,EAAE,uBAAuB;QACrC,MAAM,EAAE,iCAAiC;KAC1C,CAAC;IACF,aAAa,CAAC;QACZ,QAAQ,EAAE,eAAe;QACzB,IAAI,EAAE,sBAAsB;QAC5B,WAAW,EAAE,uDAAuD;QACpE,YAAY,EAAE,wBAAwB;QACtC,MAAM,EAAE,kCAAkC;KAC3C,CAAC;IACF,aAAa,CAAC;QACZ,QAAQ,EAAE,eAAe;QACzB,IAAI,EAAE,uBAAuB;QAC7B,WAAW,EAAE,wDAAwD;QACrE,YAAY,EAAE,yBAAyB;QACvC,MAAM,EAAE,mCAAmC;KAC5C,CAAC;CACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../src/commands/templates.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAGpD,eAAO,MAAM,gBAAgB,EAAE,iBAAiB,EAwK/C,CAAC"}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { BulkDeleteTemplatesParamsSchema, GetTemplateByClientIdParamsSchema, GetTemplateParamsSchema, GetTemplatesParamsSchema, PreviewTemplateParamsSchema, SendTemplateProofParamsSchema, UpdateEmailTemplateParamsSchema, UpdateInAppTemplateParamsSchema, UpdatePushTemplateParamsSchema, UpdateSMSTemplateParamsSchema, UpsertEmailTemplateParamsSchema, UpsertInAppTemplateParamsSchema, UpsertPushTemplateParamsSchema, UpsertSMSTemplateParamsSchema, } from "@iterable/api";
|
|
2
|
+
import { sortTransform } from "./transforms.js";
|
|
3
|
+
import { defineCommand } from "./types.js";
|
|
4
|
+
export const templateCommands = [
|
|
5
|
+
defineCommand({
|
|
6
|
+
category: "templates",
|
|
7
|
+
name: "list",
|
|
8
|
+
description: "Retrieve templates",
|
|
9
|
+
clientMethod: "getTemplates",
|
|
10
|
+
schema: GetTemplatesParamsSchema,
|
|
11
|
+
cliTransforms: { sort: sortTransform },
|
|
12
|
+
}),
|
|
13
|
+
defineCommand({
|
|
14
|
+
category: "templates",
|
|
15
|
+
name: "get-by-client-id",
|
|
16
|
+
description: "Get template by client template ID",
|
|
17
|
+
clientMethod: "getTemplateByClientId",
|
|
18
|
+
schema: GetTemplateByClientIdParamsSchema,
|
|
19
|
+
execute: (client, params) => client.getTemplateByClientId(params.clientTemplateId),
|
|
20
|
+
}),
|
|
21
|
+
defineCommand({
|
|
22
|
+
category: "templates",
|
|
23
|
+
name: "delete",
|
|
24
|
+
description: "Delete one or more templates by ID",
|
|
25
|
+
clientMethod: "deleteTemplates",
|
|
26
|
+
schema: BulkDeleteTemplatesParamsSchema,
|
|
27
|
+
execute: (client, params) => client.deleteTemplates(params.ids),
|
|
28
|
+
}),
|
|
29
|
+
// Email templates
|
|
30
|
+
defineCommand({
|
|
31
|
+
category: "templates",
|
|
32
|
+
name: "get-email",
|
|
33
|
+
description: "Get details for specific email template by ID",
|
|
34
|
+
clientMethod: "getEmailTemplate",
|
|
35
|
+
schema: GetTemplateParamsSchema,
|
|
36
|
+
}),
|
|
37
|
+
defineCommand({
|
|
38
|
+
category: "templates",
|
|
39
|
+
name: "update-email",
|
|
40
|
+
description: "Update existing email template by templateId",
|
|
41
|
+
clientMethod: "updateEmailTemplate",
|
|
42
|
+
schema: UpdateEmailTemplateParamsSchema,
|
|
43
|
+
}),
|
|
44
|
+
defineCommand({
|
|
45
|
+
category: "templates",
|
|
46
|
+
name: "upsert-email",
|
|
47
|
+
description: "Create or update email template. If a template with the specified clientTemplateId exists, it will be updated; otherwise, a new template will be created.",
|
|
48
|
+
clientMethod: "upsertEmailTemplate",
|
|
49
|
+
schema: UpsertEmailTemplateParamsSchema,
|
|
50
|
+
}),
|
|
51
|
+
defineCommand({
|
|
52
|
+
category: "templates",
|
|
53
|
+
name: "preview-email",
|
|
54
|
+
description: "Preview email template with custom data. Returns fully rendered HTML.",
|
|
55
|
+
clientMethod: "previewEmailTemplate",
|
|
56
|
+
schema: PreviewTemplateParamsSchema,
|
|
57
|
+
}),
|
|
58
|
+
defineCommand({
|
|
59
|
+
category: "templates",
|
|
60
|
+
name: "proof-email",
|
|
61
|
+
description: "Send a proof of an email template to a specific user",
|
|
62
|
+
clientMethod: "sendEmailTemplateProof",
|
|
63
|
+
schema: SendTemplateProofParamsSchema,
|
|
64
|
+
}),
|
|
65
|
+
// SMS templates
|
|
66
|
+
defineCommand({
|
|
67
|
+
category: "templates",
|
|
68
|
+
name: "get-sms",
|
|
69
|
+
description: "Get details for specific SMS template by ID",
|
|
70
|
+
clientMethod: "getSMSTemplate",
|
|
71
|
+
schema: GetTemplateParamsSchema,
|
|
72
|
+
}),
|
|
73
|
+
defineCommand({
|
|
74
|
+
category: "templates",
|
|
75
|
+
name: "update-sms",
|
|
76
|
+
description: "Update existing SMS template by templateId",
|
|
77
|
+
clientMethod: "updateSMSTemplate",
|
|
78
|
+
schema: UpdateSMSTemplateParamsSchema,
|
|
79
|
+
}),
|
|
80
|
+
defineCommand({
|
|
81
|
+
category: "templates",
|
|
82
|
+
name: "upsert-sms",
|
|
83
|
+
description: "Create or update SMS template. If a template with the specified clientTemplateId exists, it will be updated; otherwise, a new template will be created.",
|
|
84
|
+
clientMethod: "upsertSMSTemplate",
|
|
85
|
+
schema: UpsertSMSTemplateParamsSchema,
|
|
86
|
+
}),
|
|
87
|
+
defineCommand({
|
|
88
|
+
category: "templates",
|
|
89
|
+
name: "proof-sms",
|
|
90
|
+
description: "Send a proof of an SMS template to a specific user",
|
|
91
|
+
clientMethod: "sendSMSTemplateProof",
|
|
92
|
+
schema: SendTemplateProofParamsSchema,
|
|
93
|
+
}),
|
|
94
|
+
// Push templates
|
|
95
|
+
defineCommand({
|
|
96
|
+
category: "templates",
|
|
97
|
+
name: "get-push",
|
|
98
|
+
description: "Get details for specific push notification template by ID",
|
|
99
|
+
clientMethod: "getPushTemplate",
|
|
100
|
+
schema: GetTemplateParamsSchema,
|
|
101
|
+
}),
|
|
102
|
+
defineCommand({
|
|
103
|
+
category: "templates",
|
|
104
|
+
name: "update-push",
|
|
105
|
+
description: "Update existing push notification template by templateId",
|
|
106
|
+
clientMethod: "updatePushTemplate",
|
|
107
|
+
schema: UpdatePushTemplateParamsSchema,
|
|
108
|
+
}),
|
|
109
|
+
defineCommand({
|
|
110
|
+
category: "templates",
|
|
111
|
+
name: "upsert-push",
|
|
112
|
+
description: "Create or update push notification template. If a template with the specified clientTemplateId exists, it will be updated; otherwise, a new template will be created.",
|
|
113
|
+
clientMethod: "upsertPushTemplate",
|
|
114
|
+
schema: UpsertPushTemplateParamsSchema,
|
|
115
|
+
}),
|
|
116
|
+
defineCommand({
|
|
117
|
+
category: "templates",
|
|
118
|
+
name: "proof-push",
|
|
119
|
+
description: "Send a proof of a push notification template to a specific user",
|
|
120
|
+
clientMethod: "sendPushTemplateProof",
|
|
121
|
+
schema: SendTemplateProofParamsSchema,
|
|
122
|
+
}),
|
|
123
|
+
// In-app templates
|
|
124
|
+
defineCommand({
|
|
125
|
+
category: "templates",
|
|
126
|
+
name: "get-inapp",
|
|
127
|
+
description: "Get details for specific in-app message template by ID",
|
|
128
|
+
clientMethod: "getInAppTemplate",
|
|
129
|
+
schema: GetTemplateParamsSchema,
|
|
130
|
+
}),
|
|
131
|
+
defineCommand({
|
|
132
|
+
category: "templates",
|
|
133
|
+
name: "update-inapp",
|
|
134
|
+
description: "Update existing in-app message template by templateId",
|
|
135
|
+
clientMethod: "updateInAppTemplate",
|
|
136
|
+
schema: UpdateInAppTemplateParamsSchema,
|
|
137
|
+
}),
|
|
138
|
+
defineCommand({
|
|
139
|
+
category: "templates",
|
|
140
|
+
name: "upsert-inapp",
|
|
141
|
+
description: "Create or update in-app message template. If a template with the specified clientTemplateId exists, it will be updated; otherwise, a new template will be created.",
|
|
142
|
+
clientMethod: "upsertInAppTemplate",
|
|
143
|
+
schema: UpsertInAppTemplateParamsSchema,
|
|
144
|
+
}),
|
|
145
|
+
defineCommand({
|
|
146
|
+
category: "templates",
|
|
147
|
+
name: "preview-inapp",
|
|
148
|
+
description: "Preview in-app message template with custom data. Returns fully rendered HTML.",
|
|
149
|
+
clientMethod: "previewInAppTemplate",
|
|
150
|
+
schema: PreviewTemplateParamsSchema,
|
|
151
|
+
}),
|
|
152
|
+
defineCommand({
|
|
153
|
+
category: "templates",
|
|
154
|
+
name: "proof-inapp",
|
|
155
|
+
description: "Send a proof of an in-app message template to a specific user",
|
|
156
|
+
clientMethod: "sendInAppTemplateProof",
|
|
157
|
+
schema: SendTemplateProofParamsSchema,
|
|
158
|
+
}),
|
|
159
|
+
];
|
|
160
|
+
//# sourceMappingURL=templates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../../src/commands/templates.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,+BAA+B,EAC/B,iCAAiC,EACjC,uBAAuB,EACvB,wBAAwB,EACxB,2BAA2B,EAC3B,6BAA6B,EAC7B,+BAA+B,EAC/B,+BAA+B,EAC/B,8BAA8B,EAC9B,6BAA6B,EAC7B,+BAA+B,EAC/B,+BAA+B,EAC/B,8BAA8B,EAC9B,6BAA6B,GAC9B,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,MAAM,CAAC,MAAM,gBAAgB,GAAwB;IACnD,aAAa,CAAC;QACZ,QAAQ,EAAE,WAAW;QACrB,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,oBAAoB;QACjC,YAAY,EAAE,cAAc;QAC5B,MAAM,EAAE,wBAAwB;QAChC,aAAa,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE;KACvC,CAAC;IACF,aAAa,CAAC;QACZ,QAAQ,EAAE,WAAW;QACrB,IAAI,EAAE,kBAAkB;QACxB,WAAW,EAAE,oCAAoC;QACjD,YAAY,EAAE,uBAAuB;QACrC,MAAM,EAAE,iCAAiC;QACzC,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,CAC1B,MAAM,CAAC,qBAAqB,CAAC,MAAM,CAAC,gBAAgB,C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QACjB,WAAW,EAAE,wDAAwD;QACrE,YAAY,EAAE,kBAAkB;QAChC,MAAM,EAAE,uBAAuB;KAChC,CAAC;IACF,aAAa,CAAC;QACZ,QAAQ,EAAE,WAAW;QACrB,IAAI,EAAE,cAAc;QACpB,WAAW,EAAE,uDAAuD;QACpE,YAAY,EAAE,qBAAqB;QACnC,MAAM,EAAE,+BAA+B;KACxC,CAAC;IACF,aAAa,CAAC;QACZ,QAAQ,EAAE,WAAW;QACrB,IAAI,EAAE,cAAc;QACpB,WAAW,EACT,oKAAoK;QACtK,YAAY,EAAE,qBAAqB;QACnC,MAAM,EAAE,+BAA+B;KACxC,CAAC;IACF,aAAa,CAAC;QACZ,QAAQ,EAAE,WAAW;QACrB,IAAI,EAAE,eAAe;QACrB,WAAW,EACT,gFAAgF;QAClF,YAAY,EAAE,sBAAsB;QACpC,MAAM,EAAE,2BAA2B;KACpC,CAAC;IACF,aAAa,CAAC;QACZ,QAAQ,EAAE,WAAW;QACrB,IAAI,EAAE,aAAa;QACnB,WAAW,EACT,+DAA+D;QACjE,YAAY,EAAE,wBAAwB;QACtC,MAAM,EAAE,6BAA6B;KACtC,CAAC;CACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transforms.d.ts","sourceRoot":"","sources":["../../src/commands/transforms.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,eAAO,MAAM,aAAa,EAAE,YAqB3B,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { ValidationError } from "../errors.js";
|
|
3
|
+
export const sortTransform = {
|
|
4
|
+
cliFields: {
|
|
5
|
+
sort: z.string().optional().describe("Field to sort by"),
|
|
6
|
+
order: z
|
|
7
|
+
.enum(["asc", "desc"])
|
|
8
|
+
.optional()
|
|
9
|
+
.describe("Sort direction (asc or desc)"),
|
|
10
|
+
},
|
|
11
|
+
toParam: (values) => {
|
|
12
|
+
if (!values.sort)
|
|
13
|
+
return undefined;
|
|
14
|
+
const direction = values.order;
|
|
15
|
+
if (direction && !["asc", "desc"].includes(direction)) {
|
|
16
|
+
throw new ValidationError(`Invalid sort direction: ${direction} (use asc or desc)`);
|
|
17
|
+
}
|
|
18
|
+
return {
|
|
19
|
+
field: values.sort,
|
|
20
|
+
...(direction ? { direction } : {}),
|
|
21
|
+
};
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=transforms.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transforms.js","sourceRoot":"","sources":["../../src/commands/transforms.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAG/C,MAAM,CAAC,MAAM,aAAa,GAAiB;IACzC,SAAS,EAAE;QACT,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,kBAAkB,CAAC;QACxD,KAAK,EAAE,CAAC;aACL,IAAI,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;aACrB,QAAQ,EAAE;aACV,QAAQ,CAAC,8BAA8B,CAAC;KAC5C;IACD,OAAO,EAAE,CAAC,MAA+B,EAAE,EAAE;QAC3C,IAAI,CAAC,MAAM,CAAC,IAAI;YAAE,OAAO,SAAS,CAAC;QACnC,MAAM,SAAS,GAAG,MAAM,CAAC,KAA2B,CAAC;QACrD,IAAI,SAAS,IAAI,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;YACtD,MAAM,IAAI,eAAe,CACvB,2BAA2B,SAAS,oBAAoB,CACzD,CAAC;QACJ,CAAC;QACD,OAAO;YACL,KAAK,EAAE,MAAM,CAAC,IAAI;YAClB,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACpC,CAAC;IACJ,CAAC;CACF,CAAC"}
|