@sonisoft/now-sdk-ext-cli 5.3.0 → 5.5.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 +293 -74
- package/dist/commands/behavior/details.d.ts +16 -0
- package/dist/commands/behavior/details.d.ts.map +1 -0
- package/dist/commands/behavior/details.js +31 -0
- package/dist/commands/behavior/details.js.map +1 -0
- package/dist/commands/behavior/index.d.ts +23 -0
- package/dist/commands/behavior/index.d.ts.map +1 -0
- package/dist/commands/behavior/index.js +41 -0
- package/dist/commands/behavior/index.js.map +1 -0
- package/dist/commands/flow/definition.d.ts +1 -1
- package/dist/commands/transaction/kill.d.ts +12 -0
- package/dist/commands/transaction/kill.d.ts.map +1 -0
- package/dist/commands/transaction/kill.js +48 -0
- package/dist/commands/transaction/kill.js.map +1 -0
- package/dist/commands/transaction/list.d.ts +20 -0
- package/dist/commands/transaction/list.d.ts.map +1 -0
- package/dist/commands/transaction/list.js +64 -0
- package/dist/commands/transaction/list.js.map +1 -0
- package/dist/common/authenticated-command.d.ts.map +1 -1
- package/dist/common/authenticated-command.js +21 -1
- package/dist/common/authenticated-command.js.map +1 -1
- package/dist/common/behavior-flags.d.ts +17 -0
- package/dist/common/behavior-flags.d.ts.map +1 -0
- package/dist/common/behavior-flags.js +14 -0
- package/dist/common/behavior-flags.js.map +1 -0
- package/dist/services/behavior-display.service.d.ts +6 -0
- package/dist/services/behavior-display.service.d.ts.map +1 -0
- package/dist/services/behavior-display.service.js +50 -0
- package/dist/services/behavior-display.service.js.map +1 -0
- package/dist/services/flow-display.service.d.ts +9 -9
- package/dist/services/flow-display.service.d.ts.map +1 -1
- package/dist/services/flow-display.service.js +117 -117
- package/dist/services/flow-display.service.js.map +1 -1
- package/dist/services/transaction-display.service.d.ts +5 -0
- package/dist/services/transaction-display.service.d.ts.map +1 -0
- package/dist/services/transaction-display.service.js +33 -0
- package/dist/services/transaction-display.service.js.map +1 -0
- package/oclif.manifest.json +2074 -1457
- package/package.json +9 -3
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AuthenticatedCommand } from '../../common/authenticated-command.js';
|
|
2
|
+
/** Retrieve known behavior references in a batch, without table discovery. */
|
|
3
|
+
export declare class BehaviorDetails extends AuthenticatedCommand<typeof BehaviorDetails> {
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static flags: {
|
|
7
|
+
reference: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string[], import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
8
|
+
'dependency-depth': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<number, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
9
|
+
details: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<("dependencies" | "scripts" | "definitions")[] | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
10
|
+
json: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
11
|
+
'max-bytes': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<number, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
12
|
+
scope: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
13
|
+
};
|
|
14
|
+
run(): Promise<void>;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=details.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"details.d.ts","sourceRoot":"","sources":["../../../src/commands/behavior/details.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAA;AAI5E,8EAA8E;AAC9E,qBAAa,eAAgB,SAAQ,oBAAoB,CAAC,OAAO,eAAe,CAAC;IAC/E,MAAM,CAAC,WAAW,SAAwU;IAC1V,MAAM,CAAC,QAAQ,WAAqJ;IACpK,MAAM,CAAC,KAAK;;;;;;;MAGX;IAEK,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAa3B"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Flags } from '@oclif/core';
|
|
2
|
+
import { TableBehaviorDiscovery } from '@sonisoft/now-sdk-ext-core';
|
|
3
|
+
import { AuthenticatedCommand } from '../../common/authenticated-command.js';
|
|
4
|
+
import { behaviorFlags, behaviorOptions } from '../../common/behavior-flags.js';
|
|
5
|
+
import { BehaviorDisplayService } from '../../services/behavior-display.service.js';
|
|
6
|
+
/** Retrieve known behavior references in a batch, without table discovery. */
|
|
7
|
+
export class BehaviorDetails extends AuthenticatedCommand {
|
|
8
|
+
static description = 'Retrieve known behavior artifacts without rediscovery. Repeat --reference kind:source_table:sys_id for up to 50 records. Add --details scripts, --details definitions or --details dependencies to include bodies immediately. Source references are returned by behavior discovery; flows also accept flows:sys_hub_flow:<sys_id>.';
|
|
9
|
+
static examples = ['<%= config.bin %> <%= command.id %> --reference business_rules:sys_script:0123456789abcdef0123456789abcdef --details scripts --auth dev --json'];
|
|
10
|
+
static flags = {
|
|
11
|
+
...behaviorFlags,
|
|
12
|
+
reference: Flags.string({ description: 'kind:source_table:sys_id; repeat for a batch', multiple: true, required: true }),
|
|
13
|
+
};
|
|
14
|
+
async run() {
|
|
15
|
+
const { flags } = await this.parse(BehaviorDetails);
|
|
16
|
+
const references = flags.reference.map(value => {
|
|
17
|
+
const parts = value.split(':');
|
|
18
|
+
if (parts.length !== 3)
|
|
19
|
+
this.error('Reference must be kind:source_table:sys_id');
|
|
20
|
+
return { kind: parts[0], sourceTable: parts[1], sysId: parts[2] };
|
|
21
|
+
});
|
|
22
|
+
const result = await new TableBehaviorDiscovery(this.instance).getBehaviorDetails(references, behaviorOptions(flags));
|
|
23
|
+
for (const line of new BehaviorDisplayService().format(result, flags.json)) {
|
|
24
|
+
if (flags.json)
|
|
25
|
+
process.stdout.write(`${line}\n`);
|
|
26
|
+
else
|
|
27
|
+
this.log(line);
|
|
28
|
+
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,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAA;QAChG,CAAC,CAAC,CAAA;QACF,MAAM,MAAM,GAAG,MAAM,IAAI,sBAAsB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,kBAAkB,CAAC,UAAU,EAAE,eAAe,CAAC,KAAK,CAAC,CAAC,CAAA;QACrH,KAAK,MAAM,IAAI,IAAI,IAAI,sBAAsB,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;YAC3E,IAAI,KAAK,CAAC,IAAI;gBAAE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,IAAI,CAAC,CAAA;;gBAC5C,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QACrB,CAAC;IACH,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { AuthenticatedCommand } from '../../common/authenticated-command.js';
|
|
2
|
+
/** Discover configuration that can affect a table, including optional detail immediately. */
|
|
3
|
+
export declare class Behavior extends AuthenticatedCommand<typeof Behavior> {
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static flags: {
|
|
7
|
+
category: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<("business_rules" | "ui_actions" | "client_scripts" | "ui_policies" | "data_policies" | "workflows" | "flows" | "state_models")[] | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
8
|
+
cursor: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
9
|
+
'include-inactive': import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
10
|
+
'include-inherited': import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
11
|
+
limit: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<number, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
12
|
+
name: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
13
|
+
'sys-id': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
14
|
+
table: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
15
|
+
'dependency-depth': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<number, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
16
|
+
details: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<("dependencies" | "scripts" | "definitions")[] | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
17
|
+
json: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
18
|
+
'max-bytes': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<number, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
19
|
+
scope: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
20
|
+
};
|
|
21
|
+
run(): Promise<void>;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/behavior/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAA;AAI5E,6FAA6F;AAC7F,qBAAa,QAAS,SAAQ,oBAAoB,CAAC,OAAO,QAAQ,CAAC;IACjE,MAAM,CAAC,WAAW,SAAsS;IACxT,MAAM,CAAC,QAAQ,WAGd;IACD,MAAM,CAAC,KAAK;;;;;;;;;;;;;;MAUX;IAEK,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAa3B"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Flags } from '@oclif/core';
|
|
2
|
+
import { BEHAVIOR_CATEGORIES, TableBehaviorDiscovery } from '@sonisoft/now-sdk-ext-core';
|
|
3
|
+
import { AuthenticatedCommand } from '../../common/authenticated-command.js';
|
|
4
|
+
import { behaviorFlags, behaviorOptions } from '../../common/behavior-flags.js';
|
|
5
|
+
import { BehaviorDisplayService } from '../../services/behavior-display.service.js';
|
|
6
|
+
/** Discover configuration that can affect a table, including optional detail immediately. */
|
|
7
|
+
export class Behavior extends AuthenticatedCommand {
|
|
8
|
+
static description = 'Discover table behavior: rules, UI actions/scripts, UI/data policies, workflows, flows and state models. Active and applicable inherited behavior is included by default. Conditions describe configuration, not a prediction of execution. Select categories and details to control output size.';
|
|
9
|
+
static examples = [
|
|
10
|
+
'<%= config.bin %> <%= command.id %> --table incident --auth dev --json',
|
|
11
|
+
'<%= config.bin %> <%= command.id %> --table change_request --category business_rules --details scripts --auth dev --json',
|
|
12
|
+
];
|
|
13
|
+
static flags = {
|
|
14
|
+
...behaviorFlags,
|
|
15
|
+
category: Flags.option({ description: 'Category to inspect; repeat to select several, default all', multiple: true, options: BEHAVIOR_CATEGORIES })(),
|
|
16
|
+
cursor: Flags.string({ description: 'Continuation token; requires exactly one --category and the same filters' }),
|
|
17
|
+
'include-inactive': Flags.boolean({ default: false, description: 'Include inactive/published and draft candidates when discoverable' }),
|
|
18
|
+
'include-inherited': Flags.boolean({ allowNo: true, default: true, description: 'Include applicable ancestor behavior' }),
|
|
19
|
+
limit: Flags.integer({ default: 50, description: 'Maximum items per category', max: 200, min: 1 }),
|
|
20
|
+
name: Flags.string({ description: 'Metadata name contains this text' }),
|
|
21
|
+
'sys-id': Flags.string({ description: 'Metadata source sys_id to include; repeat for multiple records', multiple: true }),
|
|
22
|
+
table: Flags.string({ char: 't', description: 'Target table name', required: true }),
|
|
23
|
+
};
|
|
24
|
+
async run() {
|
|
25
|
+
const { flags } = await this.parse(Behavior);
|
|
26
|
+
if (flags.cursor && flags.category?.length !== 1)
|
|
27
|
+
this.error('--cursor requires exactly one --category');
|
|
28
|
+
const result = await new TableBehaviorDiscovery(this.instance).discoverTableBehavior(flags.table, {
|
|
29
|
+
...behaviorOptions(flags), categories: flags.category, cursors: flags.cursor && flags.category ? { [flags.category[0]]: flags.cursor } : undefined,
|
|
30
|
+
includeInactive: flags['include-inactive'], includeInherited: flags['include-inherited'], limit: flags.limit, name: flags.name,
|
|
31
|
+
sysIds: flags['sys-id'],
|
|
32
|
+
});
|
|
33
|
+
for (const line of new BehaviorDisplayService().format(result, flags.json)) {
|
|
34
|
+
if (flags.json)
|
|
35
|
+
process.stdout.write(`${line}\n`);
|
|
36
|
+
else
|
|
37
|
+
this.log(line);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/behavior/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAA;AAExF,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAA;AAC5E,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAC/E,OAAO,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAA;AAEnF,6FAA6F;AAC7F,MAAM,OAAO,QAAS,SAAQ,oBAAqC;IACjE,MAAM,CAAC,WAAW,GAAG,mSAAmS,CAAA;IACxT,MAAM,CAAC,QAAQ,GAAG;QAChB,wEAAwE;QACxE,0HAA0H;KAC3H,CAAA;IACD,MAAM,CAAC,KAAK,GAAG;QACb,GAAG,aAAa;QAChB,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,4DAA4D,EAAE,QAAQ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AAe,CAAC,KAAK,CAAC,EAAE,UAAU,EAAE,KAAK,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,SAAS;YAClJ,eAAe,EAAE,KAAK,CAAC,kBAAkB,CAAC,EAAE,gBAAgB,EAAE,KAAK,CAAC,mBAAmB,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI;YAC9H,MAAM,EAAE,KAAK,CAAC,QAAQ,CAAC;SACxB,CAAC,CAAA;QACF,KAAK,MAAM,IAAI,IAAI,IAAI,sBAAsB,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;YAC3E,IAAI,KAAK,CAAC,IAAI;gBAAE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,IAAI,CAAC,CAAA;;gBAC5C,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QACrB,CAAC;IACH,CAAC"}
|
|
@@ -8,7 +8,7 @@ export declare class FlowDefinition extends AuthenticatedCommand<typeof FlowDefi
|
|
|
8
8
|
}[];
|
|
9
9
|
static flags: {
|
|
10
10
|
'sys-id': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
11
|
-
type: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<"
|
|
11
|
+
type: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<"subflow" | "action" | "flow", import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
12
12
|
scope: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
13
13
|
json: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
14
14
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type KillTransactionResult } from '@sonisoft/now-sdk-ext-core';
|
|
2
|
+
import { AuthenticatedCommand } from '../../common/authenticated-command.js';
|
|
3
|
+
export default class TransactionKill extends AuthenticatedCommand<typeof TransactionKill> {
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static flags: {
|
|
7
|
+
confirm: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
8
|
+
'transaction-id': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
9
|
+
};
|
|
10
|
+
run(): Promise<KillTransactionResult>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=kill.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kill.d.ts","sourceRoot":"","sources":["../../../src/commands/transaction/kill.ts"],"names":[],"mappings":"AACA,OAAO,EAA6C,KAAK,qBAAqB,EAAC,MAAM,4BAA4B,CAAA;AAEjH,OAAO,EAAC,oBAAoB,EAAC,MAAM,uCAAuC,CAAA;AAE1E,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,oBAAoB,CAAC,OAAO,eAAe,CAAC;IACvF,MAAM,CAAC,WAAW,SAGuC;IACzD,MAAM,CAAC,QAAQ,WAGd;IACD,MAAM,CAAC,KAAK;;;MAOX;IAEY,GAAG,IAAI,OAAO,CAAC,qBAAqB,CAAC;CA8BnD"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Flags } from '@oclif/core';
|
|
2
|
+
import { ClusterTransactionManager, isPolicyRefusal } from '@sonisoft/now-sdk-ext-core';
|
|
3
|
+
import { AuthenticatedCommand } from '../../common/authenticated-command.js';
|
|
4
|
+
export default class TransactionKill extends AuthenticatedCommand {
|
|
5
|
+
static description = 'Submit a request to terminate one active transaction. Platform acceptance does not mean immediate removal.\n\n' +
|
|
6
|
+
'Only pass an identifier you deliberately selected from `nex transaction list`. ' +
|
|
7
|
+
"Killing another user's transaction aborts their work.";
|
|
8
|
+
static examples = [
|
|
9
|
+
'<%= config.bin %> <%= command.id %> --transaction-id 8f9a1234567890abcdef1234567890c1 --confirm --auth dev',
|
|
10
|
+
'<%= config.bin %> <%= command.id %> --transaction-id 8f9a1234567890abcdef1234567890c1 --confirm --json --auth dev',
|
|
11
|
+
];
|
|
12
|
+
static flags = {
|
|
13
|
+
confirm: Flags.boolean({ description: 'Confirm submission of the kill request.' }),
|
|
14
|
+
'transaction-id': Flags.string({
|
|
15
|
+
char: 't',
|
|
16
|
+
description: 'Exact 32-character hexadecimal sys_id from `nex transaction list`.',
|
|
17
|
+
required: true,
|
|
18
|
+
}),
|
|
19
|
+
};
|
|
20
|
+
async run() {
|
|
21
|
+
const { flags } = await this.parse(TransactionKill);
|
|
22
|
+
const transactionId = flags['transaction-id'].trim();
|
|
23
|
+
if (!/^[0-9a-f]{32}$/i.test(transactionId)) {
|
|
24
|
+
this.error('--transaction-id must be exactly 32 hexadecimal characters.');
|
|
25
|
+
}
|
|
26
|
+
if (!flags.confirm) {
|
|
27
|
+
this.error('Refusing to submit a transaction kill request without --confirm.', {
|
|
28
|
+
suggestions: ['Deliberately select an identifier, then rerun this command with --confirm.'],
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
try {
|
|
32
|
+
const result = await new ClusterTransactionManager(this.instance).killTransaction(transactionId);
|
|
33
|
+
this._logger.info('Transaction kill request accepted.', { sysId: result.sysId });
|
|
34
|
+
if (!this.jsonEnabled()) {
|
|
35
|
+
this.log(`Kill request accepted by the platform for transaction ${result.sysId}.`);
|
|
36
|
+
this.log('The transaction may take a moment to clear. Run `nex transaction list` again to confirm.');
|
|
37
|
+
}
|
|
38
|
+
return result;
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
this._logger.error('Transaction kill request failed.', error);
|
|
42
|
+
if (isPolicyRefusal(error))
|
|
43
|
+
throw error;
|
|
44
|
+
this.error(error, { suggestions: ['Verify the selected transaction identifier and instance permissions.'] });
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=kill.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kill.js","sourceRoot":"","sources":["../../../src/commands/transaction/kill.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,aAAa,CAAA;AACjC,OAAO,EAAC,yBAAyB,EAAE,eAAe,EAA6B,MAAM,4BAA4B,CAAA;AAEjH,OAAO,EAAC,oBAAoB,EAAC,MAAM,uCAAuC,CAAA;AAE1E,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,oBAA4C;IACvF,MAAM,CAAC,WAAW,GAChB,gHAAgH;QAChH,iFAAiF;QACjF,uDAAuD,CAAA;IACzD,MAAM,CAAC,QAAQ,GAAG;QAChB,4GAA4G;QAC5G,mHAAmH;KACpH,CAAA;IACD,MAAM,CAAC,KAAK,GAAG;QACb,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,EAAC,WAAW,EAAE,yCAAyC,EAAC,CAAC;QAChF,gBAAgB,EAAE,KAAK,CAAC,MAAM,CAAC;YAC7B,IAAI,EAAE,GAAG;YACT,WAAW,EAAE,oEAAoE;YACjF,QAAQ,EAAE,IAAI;SACf,CAAC;KACH,CAAA;IAEM,KAAK,CAAC,GAAG;QACd,MAAM,EAAC,KAAK,EAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAA;QACjD,MAAM,aAAa,GAAG,KAAK,CAAC,gBAAgB,CAAC,CAAC,IAAI,EAAE,CAAA;QAEpD,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC;YAC3C,IAAI,CAAC,KAAK,CAAC,6DAA6D,CAAC,CAAA;QAC3E,CAAC;QAED,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;YACnB,IAAI,CAAC,KAAK,CAAC,kEAAkE,EAAE;gBAC7E,WAAW,EAAE,CAAC,4EAA4E,CAAC;aAC5F,CAAC,CAAA;QACJ,CAAC;QAED,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,IAAI,yBAAyB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,eAAe,CAAC,aAAa,CAAC,CAAA;YAChG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,oCAAoC,EAAE,EAAC,KAAK,EAAE,MAAM,CAAC,KAAK,EAAC,CAAC,CAAA;YAE9E,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;gBACxB,IAAI,CAAC,GAAG,CAAC,yDAAyD,MAAM,CAAC,KAAK,GAAG,CAAC,CAAA;gBAClF,IAAI,CAAC,GAAG,CAAC,0FAA0F,CAAC,CAAA;YACtG,CAAC;YAED,OAAO,MAAM,CAAA;QACf,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,kCAAkC,EAAE,KAAc,CAAC,CAAA;YACtE,IAAI,eAAe,CAAC,KAAK,CAAC;gBAAE,MAAM,KAAK,CAAA;YACvC,IAAI,CAAC,KAAK,CAAC,KAAc,EAAE,EAAC,WAAW,EAAE,CAAC,sEAAsE,CAAC,EAAC,CAAC,CAAA;QACrH,CAAC;IACH,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type ClusterTransaction } from '@sonisoft/now-sdk-ext-core';
|
|
2
|
+
import { AuthenticatedCommand } from '../../common/authenticated-command.js';
|
|
3
|
+
type TransactionListResult = {
|
|
4
|
+
count: number;
|
|
5
|
+
transactions: ClusterTransaction[];
|
|
6
|
+
};
|
|
7
|
+
export default class TransactionList extends AuthenticatedCommand<typeof TransactionList> {
|
|
8
|
+
static description: string;
|
|
9
|
+
static examples: string[];
|
|
10
|
+
static flags: {
|
|
11
|
+
limit: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
12
|
+
'poll-interval-ms': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
13
|
+
query: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
14
|
+
'timeout-ms': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
15
|
+
};
|
|
16
|
+
run(): Promise<TransactionListResult>;
|
|
17
|
+
private validateFlags;
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/commands/transaction/list.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,kBAAkB,EAIxB,MAAM,4BAA4B,CAAA;AAEnC,OAAO,EAAC,oBAAoB,EAAC,MAAM,uCAAuC,CAAA;AAG1E,KAAK,qBAAqB,GAAG;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,kBAAkB,EAAE,CAAA;CAAC,CAAA;AAEhF,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,oBAAoB,CAAC,OAAO,eAAe,CAAC;IACvF,MAAM,CAAC,WAAW,SAA2E;IAC7F,MAAM,CAAC,QAAQ,WAKd;IACD,MAAM,CAAC,KAAK;;;;;MAKX;IAEY,GAAG,IAAI,OAAO,CAAC,qBAAqB,CAAC;IAkClD,OAAO,CAAC,aAAa;CAatB"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Flags } from '@oclif/core';
|
|
2
|
+
import { ClusterTransactionManager, isPolicyRefusal, } from '@sonisoft/now-sdk-ext-core';
|
|
3
|
+
import { AuthenticatedCommand } from '../../common/authenticated-command.js';
|
|
4
|
+
import { TransactionDisplayService } from '../../services/transaction-display.service.js';
|
|
5
|
+
export default class TransactionList extends AuthenticatedCommand {
|
|
6
|
+
static description = 'List active transactions from all responding ServiceNow cluster nodes.';
|
|
7
|
+
static examples = [
|
|
8
|
+
'<%= config.bin %> <%= command.id %> --auth dev',
|
|
9
|
+
'<%= config.bin %> <%= command.id %> --json --auth dev',
|
|
10
|
+
'<%= config.bin %> <%= command.id %> --query "user=admin" --limit 50 --auth dev',
|
|
11
|
+
'<%= config.bin %> <%= command.id %> --timeout-ms 120000 --poll-interval-ms 2000 --auth dev',
|
|
12
|
+
];
|
|
13
|
+
static flags = {
|
|
14
|
+
limit: Flags.integer({ char: 'l', description: 'Maximum transactions to return. Core default: 1000.' }),
|
|
15
|
+
'poll-interval-ms': Flags.integer({ description: 'Interval between collection status polls. Core default: 1000.' }),
|
|
16
|
+
query: Flags.string({ char: 'q', description: 'Encoded query used to filter transactions. Core default: none.' }),
|
|
17
|
+
'timeout-ms': Flags.integer({ description: 'Collection timeout in milliseconds. Core default: 60000.' }),
|
|
18
|
+
};
|
|
19
|
+
async run() {
|
|
20
|
+
const { flags } = await this.parse(TransactionList);
|
|
21
|
+
this.validateFlags(flags);
|
|
22
|
+
const controller = new AbortController();
|
|
23
|
+
const onSigint = () => controller.abort();
|
|
24
|
+
process.once('SIGINT', onSigint);
|
|
25
|
+
try {
|
|
26
|
+
const options = {
|
|
27
|
+
signal: controller.signal,
|
|
28
|
+
...(flags['poll-interval-ms'] === undefined ? {} : { pollIntervalMs: flags['poll-interval-ms'] }),
|
|
29
|
+
...(flags['timeout-ms'] === undefined ? {} : { timeoutMs: flags['timeout-ms'] }),
|
|
30
|
+
...(flags.limit === undefined ? {} : { limit: flags.limit }),
|
|
31
|
+
...(flags.query === undefined ? {} : { query: flags.query }),
|
|
32
|
+
};
|
|
33
|
+
const transactions = await new ClusterTransactionManager(this.instance).getTransactions(options);
|
|
34
|
+
this._logger.info('Active transaction collection completed.', { count: transactions.length });
|
|
35
|
+
if (!this.jsonEnabled()) {
|
|
36
|
+
const display = new TransactionDisplayService();
|
|
37
|
+
for (const line of display.formatTransactions(transactions))
|
|
38
|
+
this.log(line);
|
|
39
|
+
}
|
|
40
|
+
return { count: transactions.length, transactions };
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
this._logger.error('Active transaction collection failed.', error);
|
|
44
|
+
if (isPolicyRefusal(error))
|
|
45
|
+
throw error;
|
|
46
|
+
this.error(error, { suggestions: ['Check authentication and collection timeout settings, then try again.'] });
|
|
47
|
+
}
|
|
48
|
+
finally {
|
|
49
|
+
process.off('SIGINT', onSigint);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
validateFlags(flags) {
|
|
53
|
+
if (flags['poll-interval-ms'] !== undefined && (!Number.isFinite(flags['poll-interval-ms']) || flags['poll-interval-ms'] < 0)) {
|
|
54
|
+
this.error('--poll-interval-ms must be a non-negative integer.');
|
|
55
|
+
}
|
|
56
|
+
if (flags['timeout-ms'] !== undefined && (!Number.isFinite(flags['timeout-ms']) || flags['timeout-ms'] < 0)) {
|
|
57
|
+
this.error('--timeout-ms must be a non-negative integer.');
|
|
58
|
+
}
|
|
59
|
+
if (flags.limit !== undefined && (!Number.isInteger(flags.limit) || flags.limit <= 0)) {
|
|
60
|
+
this.error('--limit must be a positive integer.');
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/transaction/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,aAAa,CAAA;AACjC,OAAO,EAEL,yBAAyB,EAEzB,eAAe,GAChB,MAAM,4BAA4B,CAAA;AAEnC,OAAO,EAAC,oBAAoB,EAAC,MA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E,EAAC,WAAW,EAAE,CAAC,uEAAuE,CAAC,EAAC,CAAC,CAAA;QACtH,CAAC;gBAAS,CAAC;YACT,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;QACjC,CAAC;IACH,CAAC;IAEO,aAAa,CAAC,KAA2E;QAC/F,IAAI,KAAK,CAAC,kBAAkB,CAAC,KAAK,SAAS,IAAI,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC,IAAI,KAAK,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;YAC9H,IAAI,CAAC,KAAK,CAAC,oDAAoD,CAAC,CAAA;QAClE,CAAC;QAED,IAAI,KAAK,CAAC,YAAY,CAAC,KAAK,SAAS,IAAI,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,IAAI,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;YAC5G,IAAI,CAAC,KAAK,CAAC,8CAA8C,CAAC,CAAA;QAC5D,CAAC;QAED,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS,IAAI,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,IAAI,CAAC,CAAC,EAAE,CAAC;YACtF,IAAI,CAAC,KAAK,CAAC,qCAAqC,CAAC,CAAA;QACnD,CAAC;IACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authenticated-command.d.ts","sourceRoot":"","sources":["../../src/common/authenticated-command.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAS,UAAU,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"authenticated-command.d.ts","sourceRoot":"","sources":["../../src/common/authenticated-command.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAS,UAAU,EAAE,M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Flags } from '@oclif/core';
|
|
2
2
|
import { getCredentials } from "@servicenow/sdk-cli/dist/auth/index.js";
|
|
3
|
-
import {
|
|
3
|
+
import { logger as sdkLogger } from '@servicenow/sdk-cli/dist/logger/index.js';
|
|
4
|
+
import { configureLogging, flushLogs, isPolicyRefusal, redactValue, ServiceNowInstance } from '@sonisoft/now-sdk-ext-core';
|
|
4
5
|
import { LogFactory } from '../util/log-factory.js';
|
|
5
6
|
import { installCliPolicy } from './policy.js';
|
|
6
7
|
export class AuthenticatedCommand extends Command {
|
|
@@ -142,6 +143,25 @@ export class AuthenticatedCommand extends Command {
|
|
|
142
143
|
});
|
|
143
144
|
this.logger = LogFactory.createLogger(this.ctor.name);
|
|
144
145
|
this.authLogger = LogFactory.createLogger("AuthenticatedCommand");
|
|
146
|
+
if (this.jsonEnabled()) {
|
|
147
|
+
const sdkLog = LogFactory.createLogger('ServiceNow SDK');
|
|
148
|
+
sdkLogger.setLevel('silent');
|
|
149
|
+
for (const level of ['info', 'warn', 'error', 'debug']) {
|
|
150
|
+
sdkLogger[level] = (...args) => {
|
|
151
|
+
const message = args.map(arg => {
|
|
152
|
+
if (typeof arg === 'string')
|
|
153
|
+
return arg;
|
|
154
|
+
try {
|
|
155
|
+
return JSON.stringify(redactValue(arg)) ?? String(arg);
|
|
156
|
+
}
|
|
157
|
+
catch {
|
|
158
|
+
return '[unserializable]';
|
|
159
|
+
}
|
|
160
|
+
}).join(' ');
|
|
161
|
+
sdkLog[level](message || 'ServiceNow SDK');
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
}
|
|
145
165
|
// Install the permission ladder before anything can issue a request. Core's gate
|
|
146
166
|
// is inert until this runs, so ordering matters: after logging (so a malformed
|
|
147
167
|
// NEX_POLICY_DENY has somewhere to warn) and before the first credential fetch.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authenticated-command.js","sourceRoot":"","sources":["../../src/common/authenticated-command.ts"],"names":[],"mappings":"AAEA,OAAO,EA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,OAAO,CAAC,CAAC,CAAC,mCAAmC,KAAK,IAAI,CAAC;QACrG,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,EAAC,WAAW,EAAC,CAAC,CAAC;IACpC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BehaviorDetailOptions } from '@sonisoft/now-sdk-ext-core';
|
|
2
|
+
/** Shared controls for table discovery and direct behavior retrieval. */
|
|
3
|
+
export declare const behaviorFlags: {
|
|
4
|
+
'dependency-depth': import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
5
|
+
details: import("@oclif/core/lib/interfaces").OptionFlag<("dependencies" | "scripts" | "definitions")[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
6
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
7
|
+
'max-bytes': import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
8
|
+
scope: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
|
+
};
|
|
10
|
+
/** Translate CLI flag spelling into core options. */
|
|
11
|
+
export declare function behaviorOptions(flags: {
|
|
12
|
+
'dependency-depth': number;
|
|
13
|
+
details?: BehaviorDetailOptions['details'];
|
|
14
|
+
'max-bytes': number;
|
|
15
|
+
scope?: string;
|
|
16
|
+
}): BehaviorDetailOptions;
|
|
17
|
+
//# sourceMappingURL=behavior-flags.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"behavior-flags.d.ts","sourceRoot":"","sources":["../../src/common/behavior-flags.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AAElE,yEAAyE;AACzE,eAAO,MAAM,aAAa;;;;;;CAMzB,CAAA;AAED,qDAAqD;AACrD,wBAAgB,eAAe,CAAC,KAAK,EAAE;IACrC,kBAAkB,EAAE,MAAM,CAAA;IAC1B,OAAO,CAAC,EAAE,qBAAqB,CAAC,SAAS,CAAC,CAAA;IAC1C,WAAW,EAAE,MAAM,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,GAAG,qBAAqB,CAExB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Flags } from '@oclif/core';
|
|
2
|
+
/** Shared controls for table discovery and direct behavior retrieval. */
|
|
3
|
+
export const behaviorFlags = {
|
|
4
|
+
'dependency-depth': Flags.integer({ default: 0, description: 'Expand one dependency level; requires --details dependencies', max: 1, min: 0 }),
|
|
5
|
+
details: Flags.option({ description: 'Include selected detail now; repeat for multiple kinds', multiple: true, options: ['scripts', 'definitions', 'dependencies'] })(),
|
|
6
|
+
json: Flags.boolean({ default: false, description: 'Emit one JSON document' }),
|
|
7
|
+
'max-bytes': Flags.integer({ default: 65_536, description: 'Maximum JSON response bytes; omissions include retrieval references', max: 1_048_576, min: 4096 }),
|
|
8
|
+
scope: Flags.string({ description: 'Transaction scope for flow definition reads' }),
|
|
9
|
+
};
|
|
10
|
+
/** Translate CLI flag spelling into core options. */
|
|
11
|
+
export function behaviorOptions(flags) {
|
|
12
|
+
return { dependencyDepth: flags['dependency-depth'], details: flags.details, maxBytes: flags['max-bytes'], scope: flags.scope };
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=behavior-flags.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"behavior-flags.js","sourceRoot":"","sources":["../../src/common/behavior-flags.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAGnC,yEAAyE;AACzE,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,kBAAkB,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,WAAW,EAAE,8DAA8D,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;IAC9I,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,wDAAwD,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,SAAS,EAAE,aAAa,EAAE,cAAc,CAAU,EAAE,CAAC,EAAE;IAChL,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,wBAAwB,EAAE,CAAC;IAC9E,WAAW,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,qEAAqE,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC;IAC9J,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,6CAA6C,EAAE,CAAC;CACpF,CAAA;AAED,qDAAqD;AACrD,MAAM,UAAU,eAAe,CAAC,KAK/B;IACC,OAAO,EAAE,eAAe,EAAE,KAAK,CAAC,kBAAkB,CAAU,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,CAAC,WAAW,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,CAAA;AAC1I,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { BehaviorDetailsResult, TableBehaviorResult } from '@sonisoft/now-sdk-ext-core';
|
|
2
|
+
/** Human and JSON rendering of the shared core behavior response. */
|
|
3
|
+
export declare class BehaviorDisplayService {
|
|
4
|
+
format(result: BehaviorDetailsResult | TableBehaviorResult, json: boolean): string[];
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=behavior-display.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"behavior-display.service.d.ts","sourceRoot":"","sources":["../../src/services/behavior-display.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAgB,mBAAmB,EAAE,MAAM,4BAA4B,CAAA;AAErG,qEAAqE;AACrE,qBAAa,sBAAsB;IACjC,MAAM,CAAC,MAAM,EAAE,qBAAqB,GAAG,mBAAmB,EAAE,IAAI,EAAE,OAAO,GAAG,MAAM,EAAE;CAgCrF"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/** Human and JSON rendering of the shared core behavior response. */
|
|
2
|
+
export class BehaviorDisplayService {
|
|
3
|
+
format(result, json) {
|
|
4
|
+
if (json)
|
|
5
|
+
return [JSON.stringify(result)];
|
|
6
|
+
const lines = ['Configuration visible to this account; conditions are not evaluated.'];
|
|
7
|
+
const show = (item) => {
|
|
8
|
+
lines.push(`${item.name} [${item.reference.kind}] ${item.reference.sourceTable}:${item.reference.sysId}`);
|
|
9
|
+
if (item.inherited)
|
|
10
|
+
lines.push(` Inherited from ${item.table}`);
|
|
11
|
+
lines.push(` ${JSON.stringify(item.configuration)}`);
|
|
12
|
+
if (item.related?.length)
|
|
13
|
+
lines.push(` Related: ${JSON.stringify(item.related)}`);
|
|
14
|
+
if (item.scripts)
|
|
15
|
+
lines.push(` Scripts: ${JSON.stringify(item.scripts)}`);
|
|
16
|
+
if (item.definition)
|
|
17
|
+
lines.push(` Definition (${item.definitionSource}): ${JSON.stringify(item.definition)}`);
|
|
18
|
+
if (item.dependencies?.length)
|
|
19
|
+
lines.push(` Dependencies: ${JSON.stringify(item.dependencies)}`);
|
|
20
|
+
for (const warning of item.warnings)
|
|
21
|
+
lines.push(` ${warning.code}: ${warning.message}`);
|
|
22
|
+
};
|
|
23
|
+
if ('categories' in result) {
|
|
24
|
+
lines.push(`Table: ${result.table}; ancestors: ${result.ancestors.join(', ') || '(none)'}`);
|
|
25
|
+
for (const section of result.categories) {
|
|
26
|
+
lines.push(`${section.category}: ${section.items.length} (${section.status})`);
|
|
27
|
+
for (const item of section.items)
|
|
28
|
+
show(item);
|
|
29
|
+
for (const warning of section.warnings)
|
|
30
|
+
lines.push(` ${warning.code}: ${warning.message}`);
|
|
31
|
+
if (section.nextCursor)
|
|
32
|
+
lines.push(` Continue: --category ${section.category} --cursor ${section.nextCursor}`);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
for (const item of result.items)
|
|
37
|
+
show(item);
|
|
38
|
+
if (result.remainingReferences.length > 0)
|
|
39
|
+
lines.push(`Remaining references: ${JSON.stringify(result.remainingReferences)}`);
|
|
40
|
+
}
|
|
41
|
+
if (result.dependencies.length > 0)
|
|
42
|
+
lines.push('Expanded dependencies:');
|
|
43
|
+
for (const item of result.dependencies)
|
|
44
|
+
show(item);
|
|
45
|
+
for (const warning of result.warnings)
|
|
46
|
+
lines.push(`${warning.code}: ${warning.message}`);
|
|
47
|
+
return lines;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=behavior-display.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"behavior-display.service.js","sourceRoot":"","sources":["../../src/services/behavior-display.service.ts"],"names":[],"mappings":"AAEA,qEAAqE;AACrE,MAAM,OAAO,sBAAsB;IACjC,MAAM,CAAC,MAAmD,EAAE,IAAa;QACvE,IAAI,IAAI;YAAE,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAA;QACzC,MAAM,KAAK,GAAG,CAAC,sEAAsE,CAAC,CAAA;QACtF,MAAM,IAAI,GAAG,CAAC,IAAkB,EAAQ,EAAE;YACxC,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,SAAS,CAAC,IAAI,KAAK,IAAI,CAAC,SAAS,CAAC,WAAW,IAAI,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC,CAAA;YACzG,IAAI,IAAI,CAAC,SAAS;gBAAE,KAAK,CAAC,IAAI,CAAC,oBAAoB,IAAI,CAAC,KAAK,EAAE,CAAC,CAAA;YAChE,KAAK,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,SAAS,CA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K;oBAAE,IAAI,CAAC,IAAI,CAAC,CAAA;gBAC5C,KAAK,MAAM,OAAO,IAAI,OAAO,CAAC,QAAQ;oBAAE,KAAK,CAAC,IAAI,CAAC,KAAK,OAAO,CAAC,IAAI,KAAK,OAAO,CAAC,OAAO,EAAE,CAAC,CAAA;gBAC3F,IAAI,OAAO,CAAC,UAAU;oBAAE,KAAK,CAAC,IAAI,CAAC,0BAA0B,OAAO,CAAC,QAAQ,aAAa,OAAO,CAAC,UAAU,EAAE,CAAC,CAAA;YACjH,CAAC;QACH,CAAC;aAAM,CAAC;YACN,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,KAAK;gBAAE,IAAI,CAAC,IAAI,CAAC,CAAA;YAC3C,IAAI,MAAM,CAAC,mBAAmB,CAAC,MAAM,GAAG,CAAC;gBAAE,KAAK,CAAC,IAAI,CAAC,yBAAyB,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,mBAAmB,CAAC,EAAE,CAAC,CAAA;QAC9H,CAAC;QAED,IAAI,MAAM,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC;YAAE,KAAK,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAA;QACxE,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,YAAY;YAAE,IAAI,CAAC,IAAI,CAAC,CAAA;QAClD,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,QAAQ;YAAE,KAAK,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,KAAK,OAAO,CAAC,OAAO,EAAE,CAAC,CAAA;QACxF,OAAO,KAAK,CAAA;IACd,CAAC;CACF"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import type { ActionDefinitionResult, FlowArtifactDefinitionResult, FlowContextDetailsResult, FlowLogResult } from '@sonisoft/now-sdk-ext-core';
|
|
2
2
|
export interface FlowCopyResult {
|
|
3
|
-
success: boolean;
|
|
4
|
-
newFlowSysId?: string;
|
|
5
|
-
errorMessage?: string;
|
|
6
3
|
errorCode?: number;
|
|
4
|
+
errorMessage?: string;
|
|
5
|
+
newFlowSysId?: string;
|
|
6
|
+
success: boolean;
|
|
7
7
|
}
|
|
8
8
|
export interface FlowTestResult {
|
|
9
|
-
success: boolean;
|
|
10
9
|
contextId?: string;
|
|
10
|
+
errorMessage?: string;
|
|
11
11
|
flowId?: string;
|
|
12
|
-
state?: string;
|
|
13
12
|
outputs?: Record<string, unknown>;
|
|
14
|
-
|
|
13
|
+
state?: string;
|
|
14
|
+
success: boolean;
|
|
15
15
|
}
|
|
16
16
|
export declare class FlowDisplayService {
|
|
17
17
|
/** Widest description the one-line summary will print before eliding. */
|
|
@@ -32,16 +32,16 @@ export declare class FlowDisplayService {
|
|
|
32
32
|
* carries step scripts and input values, which do not belong on a terminal.
|
|
33
33
|
*/
|
|
34
34
|
formatArtifactDefinitionResult(result: FlowArtifactDefinitionResult, jsonOutput: boolean): string[];
|
|
35
|
-
formatCopyResult(result: FlowCopyResult, jsonOutput: boolean): string[];
|
|
36
35
|
formatCancelResult(result: any, jsonOutput: boolean): string[];
|
|
36
|
+
formatCopyResult(result: FlowCopyResult, jsonOutput: boolean): string[];
|
|
37
|
+
formatDetailsResult(result: FlowContextDetailsResult, jsonOutput: boolean): string[];
|
|
37
38
|
formatErrorResult(result: any, jsonOutput: boolean): string[];
|
|
38
39
|
formatExecutionResult(result: any, jsonOutput: boolean): string[];
|
|
40
|
+
formatLogsResult(result: FlowLogResult, jsonOutput: boolean): string[];
|
|
39
41
|
formatMessageResult(result: any, jsonOutput: boolean): string[];
|
|
40
42
|
formatOutputsResult(result: any, jsonOutput: boolean): string[];
|
|
41
43
|
formatStatusResult(result: any, jsonOutput: boolean): string[];
|
|
42
44
|
formatTestResult(result: FlowTestResult, jsonOutput: boolean): string[];
|
|
43
|
-
formatDetailsResult(result: FlowContextDetailsResult, jsonOutput: boolean): string[];
|
|
44
|
-
formatLogsResult(result: FlowLogResult, jsonOutput: boolean): string[];
|
|
45
45
|
private _artifactLabel;
|
|
46
46
|
private _mapLogLevel;
|
|
47
47
|
private _stateIcon;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow-display.service.d.ts","sourceRoot":"","sources":["../../src/services/flow-display.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,4BAA4B,EAAE,wBAAwB,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAE/I,MAAM,WAAW,cAAc;IAC7B,
|
|
1
|
+
{"version":3,"file":"flow-display.service.d.ts","sourceRoot":"","sources":["../../src/services/flow-display.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,4BAA4B,EAAE,wBAAwB,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAE/I,MAAM,WAAW,cAAc;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,qBAAa,kBAAkB;IAC7B,yEAAyE;IACzE,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,sBAAsB,CAAO;IAErD;;;;;OAKG;IACH,4BAA4B,CAAC,MAAM,EAAE,sBAAsB,EAAE,UAAU,EAAE,OAAO,GAAG,MAAM,EAAE;IAoD3F;;;;;;;OAOG;IACH,8BAA8B,CAAC,MAAM,EAAE,4BAA4B,EAAE,UAAU,EAAE,OAAO,GAAG,MAAM,EAAE;IAiDnG,kBAAkB,CAAC,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