@instantkom/cli 3.129.2 → 3.131.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/README.md +29 -0
- package/bin/run.js +0 -0
- package/dist/api-client.js +28 -5
- package/dist/command-helpers/download.d.ts +10 -0
- package/dist/command-helpers/download.js +10 -0
- package/dist/command-helpers/json.d.ts +4 -0
- package/dist/command-helpers/json.js +37 -0
- package/dist/commands/account/get.d.ts +14 -0
- package/dist/commands/account/get.js +14 -0
- package/dist/commands/account/update.d.ts +23 -0
- package/dist/commands/account/update.js +37 -0
- package/dist/commands/auth/login.js +0 -2
- package/dist/commands/auth/logout.js +0 -2
- package/dist/commands/auth/tokens/create.js +0 -2
- package/dist/commands/auth/tokens/list.js +0 -2
- package/dist/commands/auth/tokens/revoke.js +0 -2
- package/dist/commands/bots/env-vars/create.d.ts +1 -1
- package/dist/commands/bots/env-vars/create.js +18 -11
- package/dist/commands/bots/filters/create.d.ts +5 -5
- package/dist/commands/bots/filters/create.js +33 -18
- package/dist/commands/broadcast/delete.d.ts +20 -0
- package/dist/commands/broadcast/delete.js +18 -0
- package/dist/commands/broadcast/get.d.ts +20 -0
- package/dist/commands/broadcast/get.js +18 -0
- package/dist/commands/broadcast/list.d.ts +21 -0
- package/dist/commands/broadcast/list.js +39 -0
- package/dist/commands/broadcast/send.d.ts +20 -0
- package/dist/commands/broadcast/send.js +18 -0
- package/dist/commands/broadcast/status.d.ts +20 -0
- package/dist/commands/broadcast/status.js +31 -0
- package/dist/commands/broadcast/update.d.ts +30 -0
- package/dist/commands/broadcast/update.js +47 -0
- package/dist/commands/chats/get.d.ts +20 -0
- package/dist/commands/chats/get.js +18 -0
- package/dist/commands/chats/list.d.ts +22 -0
- package/dist/commands/chats/list.js +40 -0
- package/dist/commands/config/get.js +0 -2
- package/dist/commands/config/set.js +0 -2
- package/dist/commands/config/unset.js +0 -2
- package/dist/commands/contacts/custom-fields/delete-value.d.ts +24 -0
- package/dist/commands/contacts/custom-fields/delete-value.js +32 -0
- package/dist/commands/contacts/custom-fields/list.d.ts +20 -0
- package/dist/commands/contacts/custom-fields/list.js +24 -0
- package/dist/commands/contacts/custom-fields/set-value.d.ts +25 -0
- package/dist/commands/contacts/custom-fields/set-value.js +32 -0
- package/dist/commands/contacts/custom-fields/set.d.ts +23 -0
- package/dist/commands/contacts/custom-fields/set.js +42 -0
- package/dist/commands/contacts/tags/add.d.ts +24 -0
- package/dist/commands/contacts/tags/add.js +30 -0
- package/dist/commands/contacts/tags/list.d.ts +20 -0
- package/dist/commands/contacts/tags/list.js +24 -0
- package/dist/commands/contacts/tags/remove.d.ts +24 -0
- package/dist/commands/contacts/tags/remove.js +32 -0
- package/dist/commands/custom-fields/bulk-delete.d.ts +15 -0
- package/dist/commands/custom-fields/bulk-delete.js +24 -0
- package/dist/commands/custom-fields/create.d.ts +21 -0
- package/dist/commands/custom-fields/create.js +47 -0
- package/dist/commands/custom-fields/delete.d.ts +20 -0
- package/dist/commands/custom-fields/delete.js +18 -0
- package/dist/commands/custom-fields/get.d.ts +20 -0
- package/dist/commands/custom-fields/get.js +18 -0
- package/dist/commands/custom-fields/list.d.ts +14 -0
- package/dist/commands/custom-fields/list.js +14 -0
- package/dist/commands/custom-fields/reorder.d.ts +15 -0
- package/dist/commands/custom-fields/reorder.js +22 -0
- package/dist/commands/custom-fields/update.d.ts +27 -0
- package/dist/commands/custom-fields/update.js +52 -0
- package/dist/commands/doctor.d.ts +14 -0
- package/dist/commands/doctor.js +56 -0
- package/dist/commands/features.d.ts +14 -0
- package/dist/commands/features.js +19 -0
- package/dist/commands/messages/bulk-spam.d.ts +16 -0
- package/dist/commands/messages/bulk-spam.js +30 -0
- package/dist/commands/messages/create-ticket.d.ts +23 -0
- package/dist/commands/messages/create-ticket.js +28 -0
- package/dist/commands/messages/delete.d.ts +20 -0
- package/dist/commands/messages/delete.js +18 -0
- package/dist/commands/messages/get.d.ts +20 -0
- package/dist/commands/messages/get.js +18 -0
- package/dist/commands/messages/list.d.ts +22 -0
- package/dist/commands/messages/list.js +35 -0
- package/dist/commands/messages/reactions.d.ts +20 -0
- package/dist/commands/messages/reactions.js +18 -0
- package/dist/commands/messages/spam.d.ts +21 -0
- package/dist/commands/messages/spam.js +27 -0
- package/dist/commands/messages/unread-count.d.ts +14 -0
- package/dist/commands/messages/unread-count.js +14 -0
- package/dist/commands/messages/update.d.ts +27 -0
- package/dist/commands/messages/update.js +43 -0
- package/dist/commands/permissions.d.ts +14 -0
- package/dist/commands/permissions.js +14 -0
- package/dist/commands/segments/create.d.ts +21 -0
- package/dist/commands/segments/create.js +33 -0
- package/dist/commands/segments/delete.d.ts +20 -0
- package/dist/commands/segments/delete.js +18 -0
- package/dist/commands/segments/get.d.ts +20 -0
- package/dist/commands/segments/get.js +18 -0
- package/dist/commands/segments/list.d.ts +20 -0
- package/dist/commands/segments/list.js +34 -0
- package/dist/commands/segments/tags/add.d.ts +24 -0
- package/dist/commands/segments/tags/add.js +21 -0
- package/dist/commands/segments/tags/list.d.ts +20 -0
- package/dist/commands/segments/tags/list.js +18 -0
- package/dist/commands/segments/tags/remove.d.ts +24 -0
- package/dist/commands/segments/tags/remove.js +23 -0
- package/dist/commands/segments/update.d.ts +26 -0
- package/dist/commands/segments/update.js +34 -0
- package/dist/commands/tags/create.d.ts +19 -0
- package/dist/commands/tags/create.js +29 -0
- package/dist/commands/tags/delete.d.ts +20 -0
- package/dist/commands/tags/delete.js +16 -0
- package/dist/commands/tags/export.d.ts +15 -0
- package/dist/commands/tags/export.js +27 -0
- package/dist/commands/tags/get.d.ts +20 -0
- package/dist/commands/tags/get.js +16 -0
- package/dist/commands/tags/import.d.ts +16 -0
- package/dist/commands/tags/import.js +29 -0
- package/dist/commands/tags/list.d.ts +18 -0
- package/dist/commands/tags/list.js +27 -0
- package/dist/commands/tags/recipients/add.d.ts +21 -0
- package/dist/commands/tags/recipients/add.js +27 -0
- package/dist/commands/tags/recipients/remove.d.ts +21 -0
- package/dist/commands/tags/recipients/remove.js +27 -0
- package/dist/commands/tags/update.d.ts +25 -0
- package/dist/commands/tags/update.js +30 -0
- package/dist/commands/tags/validate-import.d.ts +15 -0
- package/dist/commands/tags/validate-import.js +21 -0
- package/dist/commands/team/create.d.ts +23 -0
- package/dist/commands/team/create.js +37 -0
- package/dist/commands/team/delete.d.ts +20 -0
- package/dist/commands/team/delete.js +18 -0
- package/dist/commands/team/list.d.ts +14 -0
- package/dist/commands/team/list.js +14 -0
- package/dist/commands/templates/create.d.ts +24 -0
- package/dist/commands/templates/create.js +63 -0
- package/dist/commands/templates/delete.d.ts +20 -0
- package/dist/commands/templates/delete.js +18 -0
- package/dist/commands/templates/export.d.ts +16 -0
- package/dist/commands/templates/export.js +29 -0
- package/dist/commands/templates/import.d.ts +17 -0
- package/dist/commands/templates/import.js +34 -0
- package/dist/commands/templates/update.d.ts +30 -0
- package/dist/commands/templates/update.js +61 -0
- package/dist/commands/templates/validate-import.d.ts +16 -0
- package/dist/commands/templates/validate-import.js +28 -0
- package/dist/commands/tickets/reply.d.ts +22 -0
- package/dist/commands/tickets/reply.js +36 -0
- package/dist/commands/tickets/update.d.ts +2 -0
- package/dist/commands/tickets/update.js +16 -0
- package/dist/commands/webhooks/events.d.ts +14 -0
- package/dist/commands/webhooks/events.js +18 -0
- package/dist/commands/webhooks/logs.d.ts +14 -0
- package/dist/commands/webhooks/logs.js +11 -0
- package/dist/commands/webhooks/test.d.ts +17 -0
- package/dist/commands/webhooks/test.js +27 -0
- package/dist/commands/whoami.js +0 -2
- package/dist/crud/csv.js +2 -1
- package/dist/errors/api-error.d.ts +1 -1
- package/dist/errors/exit-codes.js +1 -0
- package/npm-shrinkwrap.json +2 -2
- package/oclif.manifest.json +8672 -1602
- package/package.json +38 -5
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Args } from '@oclif/core';
|
|
2
|
+
import { BaseCommand } from '../../../base-command.js';
|
|
3
|
+
import { createCliApiClient } from '../../../send/api.js';
|
|
4
|
+
export default class SegmentsTagsAdd extends BaseCommand {
|
|
5
|
+
static description = 'Assign a tag to a segment';
|
|
6
|
+
static args = {
|
|
7
|
+
segmentId: Args.integer({ description: 'Segment ID', required: true }),
|
|
8
|
+
tagId: Args.integer({ description: 'Tag ID', required: true }),
|
|
9
|
+
};
|
|
10
|
+
static flags = { ...BaseCommand.baseFlags };
|
|
11
|
+
async run() {
|
|
12
|
+
const { args, flags } = await this.parse(SegmentsTagsAdd);
|
|
13
|
+
this.flags = flags;
|
|
14
|
+
const client = await createCliApiClient(flags);
|
|
15
|
+
const response = await client.post(`/v1/segments/${args.segmentId}/tags`, {
|
|
16
|
+
tagId: args.tagId,
|
|
17
|
+
});
|
|
18
|
+
if (!flags.quiet)
|
|
19
|
+
this.log(this.toFormatted(response));
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command.js';
|
|
2
|
+
export default class SegmentsTagsList extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static args: {
|
|
5
|
+
segmentId: import("@oclif/core/interfaces").Arg<number, {
|
|
6
|
+
max?: number;
|
|
7
|
+
min?: number;
|
|
8
|
+
}>;
|
|
9
|
+
};
|
|
10
|
+
static flags: {
|
|
11
|
+
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
format: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
14
|
+
quiet: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
15
|
+
'no-color': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
16
|
+
profile: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
|
+
'api-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
|
+
};
|
|
19
|
+
run(): Promise<void>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Args } from '@oclif/core';
|
|
2
|
+
import { BaseCommand } from '../../../base-command.js';
|
|
3
|
+
import { createCliApiClient } from '../../../send/api.js';
|
|
4
|
+
export default class SegmentsTagsList extends BaseCommand {
|
|
5
|
+
static description = 'List tags assigned to a segment';
|
|
6
|
+
static args = {
|
|
7
|
+
segmentId: Args.integer({ description: 'Segment ID', required: true }),
|
|
8
|
+
};
|
|
9
|
+
static flags = { ...BaseCommand.baseFlags };
|
|
10
|
+
async run() {
|
|
11
|
+
const { args, flags } = await this.parse(SegmentsTagsList);
|
|
12
|
+
this.flags = flags;
|
|
13
|
+
const client = await createCliApiClient(flags);
|
|
14
|
+
const response = await client.get(`/v1/segments/${args.segmentId}/tags`);
|
|
15
|
+
if (!flags.quiet)
|
|
16
|
+
this.log(this.toFormatted(response));
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command.js';
|
|
2
|
+
export default class SegmentsTagsRemove extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static args: {
|
|
5
|
+
segmentId: import("@oclif/core/interfaces").Arg<number, {
|
|
6
|
+
max?: number;
|
|
7
|
+
min?: number;
|
|
8
|
+
}>;
|
|
9
|
+
tagId: import("@oclif/core/interfaces").Arg<number, {
|
|
10
|
+
max?: number;
|
|
11
|
+
min?: number;
|
|
12
|
+
}>;
|
|
13
|
+
};
|
|
14
|
+
static flags: {
|
|
15
|
+
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
+
format: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
18
|
+
quiet: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
19
|
+
'no-color': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
20
|
+
profile: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
21
|
+
'api-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
22
|
+
};
|
|
23
|
+
run(): Promise<void>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Args } from '@oclif/core';
|
|
2
|
+
import { BaseCommand } from '../../../base-command.js';
|
|
3
|
+
import { createCliApiClient } from '../../../send/api.js';
|
|
4
|
+
export default class SegmentsTagsRemove extends BaseCommand {
|
|
5
|
+
static description = 'Remove a tag from a segment';
|
|
6
|
+
static args = {
|
|
7
|
+
segmentId: Args.integer({ description: 'Segment ID', required: true }),
|
|
8
|
+
tagId: Args.integer({ description: 'Tag ID', required: true }),
|
|
9
|
+
};
|
|
10
|
+
static flags = { ...BaseCommand.baseFlags };
|
|
11
|
+
async run() {
|
|
12
|
+
const { args, flags } = await this.parse(SegmentsTagsRemove);
|
|
13
|
+
this.flags = flags;
|
|
14
|
+
const client = await createCliApiClient(flags);
|
|
15
|
+
await client.delete(`/v1/segments/${args.segmentId}/tags/${args.tagId}`);
|
|
16
|
+
if (!flags.quiet)
|
|
17
|
+
this.log(this.toFormatted({
|
|
18
|
+
removed: true,
|
|
19
|
+
segmentId: args.segmentId,
|
|
20
|
+
tagId: args.tagId,
|
|
21
|
+
}));
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base-command.js';
|
|
2
|
+
export default class SegmentsUpdate extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static args: {
|
|
5
|
+
id: import("@oclif/core/interfaces").Arg<number, {
|
|
6
|
+
max?: number;
|
|
7
|
+
min?: number;
|
|
8
|
+
}>;
|
|
9
|
+
};
|
|
10
|
+
static flags: {
|
|
11
|
+
name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
description: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
color: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
tags: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
folder: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
+
data: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
|
+
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
|
+
format: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
19
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
20
|
+
quiet: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
21
|
+
'no-color': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
22
|
+
profile: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
23
|
+
'api-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
24
|
+
};
|
|
25
|
+
run(): Promise<void>;
|
|
26
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Args, Flags } from '@oclif/core';
|
|
2
|
+
import { BaseCommand } from '../../base-command.js';
|
|
3
|
+
import { mergeData, parseDataFlag } from '../../crud/data.js';
|
|
4
|
+
import { createCliApiClient } from '../../send/api.js';
|
|
5
|
+
export default class SegmentsUpdate extends BaseCommand {
|
|
6
|
+
static description = 'Update a segment';
|
|
7
|
+
static args = {
|
|
8
|
+
id: Args.integer({ description: 'Segment ID', required: true }),
|
|
9
|
+
};
|
|
10
|
+
static flags = {
|
|
11
|
+
...BaseCommand.baseFlags,
|
|
12
|
+
name: Flags.string({ description: 'Segment name' }),
|
|
13
|
+
description: Flags.string({ description: 'Segment description' }),
|
|
14
|
+
color: Flags.string({ description: 'Segment color as HEX' }),
|
|
15
|
+
tags: Flags.string({ description: 'Tags for filtering recipients' }),
|
|
16
|
+
folder: Flags.integer({ description: 'Object folder ID' }),
|
|
17
|
+
data: Flags.string({ description: 'Additional JSON object payload' }),
|
|
18
|
+
};
|
|
19
|
+
async run() {
|
|
20
|
+
const { args, flags } = await this.parse(SegmentsUpdate);
|
|
21
|
+
this.flags = flags;
|
|
22
|
+
const payload = mergeData(parseDataFlag(flags.data), {
|
|
23
|
+
name: flags.name,
|
|
24
|
+
description: flags.description,
|
|
25
|
+
color: flags.color,
|
|
26
|
+
tags: flags.tags,
|
|
27
|
+
folderId: flags.folder,
|
|
28
|
+
});
|
|
29
|
+
const client = await createCliApiClient(flags);
|
|
30
|
+
const response = await client.put(`/v1/segments/${args.id}`, payload);
|
|
31
|
+
if (!flags.quiet)
|
|
32
|
+
this.log(this.toFormatted(response));
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base-command.js';
|
|
2
|
+
export default class TagsCreate extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {
|
|
5
|
+
name: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
6
|
+
description: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
+
color: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
folder: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
data: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
format: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
13
|
+
quiet: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
14
|
+
'no-color': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
15
|
+
profile: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
+
'api-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
|
+
};
|
|
18
|
+
run(): Promise<void>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Flags } from '@oclif/core';
|
|
2
|
+
import { BaseCommand } from '../../base-command.js';
|
|
3
|
+
import { mergeData, parseDataFlag } from '../../crud/data.js';
|
|
4
|
+
import { createCliApiClient } from '../../send/api.js';
|
|
5
|
+
export default class TagsCreate extends BaseCommand {
|
|
6
|
+
static description = 'Create a tag';
|
|
7
|
+
static flags = {
|
|
8
|
+
...BaseCommand.baseFlags,
|
|
9
|
+
name: Flags.string({ description: 'Tag name', required: true }),
|
|
10
|
+
description: Flags.string({ description: 'Tag description' }),
|
|
11
|
+
color: Flags.string({ description: 'Tag color as HEX' }),
|
|
12
|
+
folder: Flags.integer({ description: 'Object folder ID' }),
|
|
13
|
+
data: Flags.string({ description: 'Additional JSON object payload' }),
|
|
14
|
+
};
|
|
15
|
+
async run() {
|
|
16
|
+
const { flags } = await this.parse(TagsCreate);
|
|
17
|
+
this.flags = flags;
|
|
18
|
+
const payload = mergeData(parseDataFlag(flags.data), {
|
|
19
|
+
name: flags.name,
|
|
20
|
+
description: flags.description,
|
|
21
|
+
color: flags.color,
|
|
22
|
+
folderId: flags.folder,
|
|
23
|
+
});
|
|
24
|
+
const client = await createCliApiClient(flags);
|
|
25
|
+
const response = await client.post('/v1/tags', payload);
|
|
26
|
+
if (!flags.quiet)
|
|
27
|
+
this.log(this.toFormatted(response));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base-command.js';
|
|
2
|
+
export default class TagsDelete extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static args: {
|
|
5
|
+
id: import("@oclif/core/interfaces").Arg<number, {
|
|
6
|
+
max?: number;
|
|
7
|
+
min?: number;
|
|
8
|
+
}>;
|
|
9
|
+
};
|
|
10
|
+
static flags: {
|
|
11
|
+
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
format: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
14
|
+
quiet: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
15
|
+
'no-color': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
16
|
+
profile: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
|
+
'api-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
|
+
};
|
|
19
|
+
run(): Promise<void>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Args } from '@oclif/core';
|
|
2
|
+
import { BaseCommand } from '../../base-command.js';
|
|
3
|
+
import { createCliApiClient } from '../../send/api.js';
|
|
4
|
+
export default class TagsDelete extends BaseCommand {
|
|
5
|
+
static description = 'Delete tag';
|
|
6
|
+
static args = { id: Args.integer({ description: 'tag ID', required: true }) };
|
|
7
|
+
static flags = { ...BaseCommand.baseFlags };
|
|
8
|
+
async run() {
|
|
9
|
+
const { args, flags } = await this.parse(TagsDelete);
|
|
10
|
+
this.flags = flags;
|
|
11
|
+
const client = await createCliApiClient(flags);
|
|
12
|
+
await client.delete(`/v1/tags/${args.id}`);
|
|
13
|
+
if (!flags.quiet)
|
|
14
|
+
this.log(this.toFormatted({ deleted: true, id: args.id }));
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base-command.js';
|
|
2
|
+
export default class TagsExport extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {
|
|
5
|
+
file: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
6
|
+
format: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
+
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
|
+
quiet: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
'no-color': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
profile: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
'api-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
};
|
|
14
|
+
run(): Promise<void>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Flags } from '@oclif/core';
|
|
2
|
+
import { BaseCommand } from '../../base-command.js';
|
|
3
|
+
import { writeDownloadResult } from '../../command-helpers/download.js';
|
|
4
|
+
import { createCliApiClient } from '../../send/api.js';
|
|
5
|
+
export default class TagsExport extends BaseCommand {
|
|
6
|
+
static description = 'Export tags to a file';
|
|
7
|
+
static flags = {
|
|
8
|
+
...BaseCommand.baseFlags,
|
|
9
|
+
file: Flags.string({ description: 'Output file path', required: true }),
|
|
10
|
+
format: Flags.string({
|
|
11
|
+
description: 'Export format',
|
|
12
|
+
options: ['csv', 'json'],
|
|
13
|
+
default: 'csv',
|
|
14
|
+
}),
|
|
15
|
+
};
|
|
16
|
+
async run() {
|
|
17
|
+
const { flags } = await this.parse(TagsExport);
|
|
18
|
+
this.flags = flags;
|
|
19
|
+
const client = await createCliApiClient(flags);
|
|
20
|
+
const result = await client.getBinary('/v1/tags/export/download', {
|
|
21
|
+
format: flags.format,
|
|
22
|
+
});
|
|
23
|
+
const output = await writeDownloadResult(flags.file, result);
|
|
24
|
+
if (!flags.quiet)
|
|
25
|
+
this.log(this.toFormatted(output));
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base-command.js';
|
|
2
|
+
export default class TagsGet extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static args: {
|
|
5
|
+
id: import("@oclif/core/interfaces").Arg<number, {
|
|
6
|
+
max?: number;
|
|
7
|
+
min?: number;
|
|
8
|
+
}>;
|
|
9
|
+
};
|
|
10
|
+
static flags: {
|
|
11
|
+
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
format: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
14
|
+
quiet: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
15
|
+
'no-color': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
16
|
+
profile: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
|
+
'api-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
|
+
};
|
|
19
|
+
run(): Promise<void>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Args } from '@oclif/core';
|
|
2
|
+
import { BaseCommand } from '../../base-command.js';
|
|
3
|
+
import { createCliApiClient } from '../../send/api.js';
|
|
4
|
+
export default class TagsGet extends BaseCommand {
|
|
5
|
+
static description = 'Get tag by ID';
|
|
6
|
+
static args = { id: Args.integer({ description: 'tag ID', required: true }) };
|
|
7
|
+
static flags = { ...BaseCommand.baseFlags };
|
|
8
|
+
async run() {
|
|
9
|
+
const { args, flags } = await this.parse(TagsGet);
|
|
10
|
+
this.flags = flags;
|
|
11
|
+
const client = await createCliApiClient(flags);
|
|
12
|
+
const response = await client.get(`/v1/tags/${args.id}`);
|
|
13
|
+
if (!flags.quiet)
|
|
14
|
+
this.log(this.toFormatted(response));
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base-command.js';
|
|
2
|
+
export default class TagsImport extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {
|
|
5
|
+
file: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
6
|
+
'skip-duplicates': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
7
|
+
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
format: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
quiet: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
'no-color': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
profile: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
'api-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
};
|
|
15
|
+
run(): Promise<void>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Flags } from '@oclif/core';
|
|
2
|
+
import { BaseCommand } from '../../base-command.js';
|
|
3
|
+
import { readJsonFile } from '../../command-helpers/json.js';
|
|
4
|
+
import { createCliApiClient } from '../../send/api.js';
|
|
5
|
+
export default class TagsImport extends BaseCommand {
|
|
6
|
+
static description = 'Import tags from JSON';
|
|
7
|
+
static flags = {
|
|
8
|
+
...BaseCommand.baseFlags,
|
|
9
|
+
file: Flags.string({ description: 'JSON file path', required: true }),
|
|
10
|
+
'skip-duplicates': Flags.boolean({
|
|
11
|
+
description: 'Skip duplicate tags',
|
|
12
|
+
default: true,
|
|
13
|
+
allowNo: true,
|
|
14
|
+
}),
|
|
15
|
+
};
|
|
16
|
+
async run() {
|
|
17
|
+
const { flags } = await this.parse(TagsImport);
|
|
18
|
+
this.flags = flags;
|
|
19
|
+
const input = await readJsonFile(flags.file, '--file');
|
|
20
|
+
const tags = Array.isArray(input) ? input : input.tags;
|
|
21
|
+
const client = await createCliApiClient(flags);
|
|
22
|
+
const response = await client.post('/v1/tags/import', {
|
|
23
|
+
tags,
|
|
24
|
+
skipDuplicates: flags['skip-duplicates'],
|
|
25
|
+
});
|
|
26
|
+
if (!flags.quiet)
|
|
27
|
+
this.log(this.toFormatted(response));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base-command.js';
|
|
2
|
+
export default class TagsList extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {
|
|
5
|
+
page: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
|
|
6
|
+
limit: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
+
search: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
color: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
format: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
quiet: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
13
|
+
'no-color': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
14
|
+
profile: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
'api-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
+
};
|
|
17
|
+
run(): Promise<void>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Flags } from '@oclif/core';
|
|
2
|
+
import { BaseCommand } from '../../base-command.js';
|
|
3
|
+
import { cleanQuery } from '../../crud/data.js';
|
|
4
|
+
import { createCliApiClient } from '../../send/api.js';
|
|
5
|
+
export default class TagsList extends BaseCommand {
|
|
6
|
+
static description = 'List tags';
|
|
7
|
+
static flags = {
|
|
8
|
+
...BaseCommand.baseFlags,
|
|
9
|
+
page: Flags.integer({ description: 'Page number', default: 1 }),
|
|
10
|
+
limit: Flags.integer({ description: 'Items per page', default: 20 }),
|
|
11
|
+
search: Flags.string({ description: 'Search by name' }),
|
|
12
|
+
color: Flags.string({ description: 'Filter by color' }),
|
|
13
|
+
};
|
|
14
|
+
async run() {
|
|
15
|
+
const { flags } = await this.parse(TagsList);
|
|
16
|
+
this.flags = flags;
|
|
17
|
+
const client = await createCliApiClient(flags);
|
|
18
|
+
const response = await client.get('/v1/tags', cleanQuery({
|
|
19
|
+
page: flags.page,
|
|
20
|
+
limit: flags.limit,
|
|
21
|
+
search: flags.search,
|
|
22
|
+
color: flags.color,
|
|
23
|
+
}));
|
|
24
|
+
if (!flags.quiet)
|
|
25
|
+
this.log(this.toFormatted(response));
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command.js';
|
|
2
|
+
export default class TagsRecipientsAdd extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static args: {
|
|
5
|
+
tagId: import("@oclif/core/interfaces").Arg<number, {
|
|
6
|
+
max?: number;
|
|
7
|
+
min?: number;
|
|
8
|
+
}>;
|
|
9
|
+
};
|
|
10
|
+
static flags: {
|
|
11
|
+
recipients: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
format: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
15
|
+
quiet: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
16
|
+
'no-color': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
17
|
+
profile: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
|
+
'api-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
19
|
+
};
|
|
20
|
+
run(): Promise<void>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Args, Flags } from '@oclif/core';
|
|
2
|
+
import { BaseCommand } from '../../../base-command.js';
|
|
3
|
+
import { parseNumberList } from '../../../command-helpers/json.js';
|
|
4
|
+
import { createCliApiClient } from '../../../send/api.js';
|
|
5
|
+
export default class TagsRecipientsAdd extends BaseCommand {
|
|
6
|
+
static description = 'Assign a tag to recipients';
|
|
7
|
+
static args = {
|
|
8
|
+
tagId: Args.integer({ description: 'Tag ID', required: true }),
|
|
9
|
+
};
|
|
10
|
+
static flags = {
|
|
11
|
+
...BaseCommand.baseFlags,
|
|
12
|
+
recipients: Flags.string({
|
|
13
|
+
description: 'Comma-separated recipient IDs',
|
|
14
|
+
required: true,
|
|
15
|
+
}),
|
|
16
|
+
};
|
|
17
|
+
async run() {
|
|
18
|
+
const { args, flags } = await this.parse(TagsRecipientsAdd);
|
|
19
|
+
this.flags = flags;
|
|
20
|
+
const client = await createCliApiClient(flags);
|
|
21
|
+
const response = await client.post(`/v1/tags/${args.tagId}/recipients`, {
|
|
22
|
+
recipientIds: parseNumberList(flags.recipients, '--recipients'),
|
|
23
|
+
});
|
|
24
|
+
if (!flags.quiet)
|
|
25
|
+
this.log(this.toFormatted(response));
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command.js';
|
|
2
|
+
export default class TagsRecipientsRemove extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static args: {
|
|
5
|
+
tagId: import("@oclif/core/interfaces").Arg<number, {
|
|
6
|
+
max?: number;
|
|
7
|
+
min?: number;
|
|
8
|
+
}>;
|
|
9
|
+
};
|
|
10
|
+
static flags: {
|
|
11
|
+
recipients: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
format: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
15
|
+
quiet: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
16
|
+
'no-color': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
17
|
+
profile: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
|
+
'api-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
19
|
+
};
|
|
20
|
+
run(): Promise<void>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Args, Flags } from '@oclif/core';
|
|
2
|
+
import { BaseCommand } from '../../../base-command.js';
|
|
3
|
+
import { parseNumberList } from '../../../command-helpers/json.js';
|
|
4
|
+
import { createCliApiClient } from '../../../send/api.js';
|
|
5
|
+
export default class TagsRecipientsRemove extends BaseCommand {
|
|
6
|
+
static description = 'Remove a tag from recipients';
|
|
7
|
+
static args = {
|
|
8
|
+
tagId: Args.integer({ description: 'Tag ID', required: true }),
|
|
9
|
+
};
|
|
10
|
+
static flags = {
|
|
11
|
+
...BaseCommand.baseFlags,
|
|
12
|
+
recipients: Flags.string({
|
|
13
|
+
description: 'Comma-separated recipient IDs',
|
|
14
|
+
required: true,
|
|
15
|
+
}),
|
|
16
|
+
};
|
|
17
|
+
async run() {
|
|
18
|
+
const { args, flags } = await this.parse(TagsRecipientsRemove);
|
|
19
|
+
this.flags = flags;
|
|
20
|
+
const client = await createCliApiClient(flags);
|
|
21
|
+
const response = await client.delete(`/v1/tags/${args.tagId}/recipients`, {
|
|
22
|
+
recipientIds: parseNumberList(flags.recipients, '--recipients'),
|
|
23
|
+
});
|
|
24
|
+
if (!flags.quiet)
|
|
25
|
+
this.log(this.toFormatted(response));
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base-command.js';
|
|
2
|
+
export default class TagsUpdate extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static args: {
|
|
5
|
+
id: import("@oclif/core/interfaces").Arg<number, {
|
|
6
|
+
max?: number;
|
|
7
|
+
min?: number;
|
|
8
|
+
}>;
|
|
9
|
+
};
|
|
10
|
+
static flags: {
|
|
11
|
+
name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
description: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
color: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
folder: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
data: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
+
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
|
+
format: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
19
|
+
quiet: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
20
|
+
'no-color': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
21
|
+
profile: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
22
|
+
'api-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
23
|
+
};
|
|
24
|
+
run(): Promise<void>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Args, Flags } from '@oclif/core';
|
|
2
|
+
import { BaseCommand } from '../../base-command.js';
|
|
3
|
+
import { mergeData, parseDataFlag } from '../../crud/data.js';
|
|
4
|
+
import { createCliApiClient } from '../../send/api.js';
|
|
5
|
+
export default class TagsUpdate extends BaseCommand {
|
|
6
|
+
static description = 'Update a tag';
|
|
7
|
+
static args = { id: Args.integer({ description: 'Tag ID', required: true }) };
|
|
8
|
+
static flags = {
|
|
9
|
+
...BaseCommand.baseFlags,
|
|
10
|
+
name: Flags.string({ description: 'Tag name' }),
|
|
11
|
+
description: Flags.string({ description: 'Tag description' }),
|
|
12
|
+
color: Flags.string({ description: 'Tag color as HEX' }),
|
|
13
|
+
folder: Flags.integer({ description: 'Object folder ID' }),
|
|
14
|
+
data: Flags.string({ description: 'Additional JSON object payload' }),
|
|
15
|
+
};
|
|
16
|
+
async run() {
|
|
17
|
+
const { args, flags } = await this.parse(TagsUpdate);
|
|
18
|
+
this.flags = flags;
|
|
19
|
+
const payload = mergeData(parseDataFlag(flags.data), {
|
|
20
|
+
name: flags.name,
|
|
21
|
+
description: flags.description,
|
|
22
|
+
color: flags.color,
|
|
23
|
+
folderId: flags.folder,
|
|
24
|
+
});
|
|
25
|
+
const client = await createCliApiClient(flags);
|
|
26
|
+
const response = await client.put(`/v1/tags/${args.id}`, payload);
|
|
27
|
+
if (!flags.quiet)
|
|
28
|
+
this.log(this.toFormatted(response));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base-command.js';
|
|
2
|
+
export default class TagsValidateImport extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {
|
|
5
|
+
file: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
6
|
+
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
+
format: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
|
+
quiet: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
'no-color': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
profile: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
'api-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
};
|
|
14
|
+
run(): Promise<void>;
|
|
15
|
+
}
|