@sonisoft/now-sdk-ext-cli 5.4.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 +182 -76
- 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/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/oclif.manifest.json +1670 -1314
- package/package.json +6 -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
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=details.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"details.js","sourceRoot":"","sources":["../../../src/commands/behavior/details.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,EAAqB,sBAAsB,EAAE,MAAM,4BAA4B,CAAA;AAEtF,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAA;AAC5E,OAAO,EAAE,aAAa,EAAE,eAAe,EA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,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,EAAE,IAAI,EAAE,OAAO,EAAE,mBAAmB,EAAE,CAAC,EAAE;QACrJ,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,0EAA0E,EAAE,CAAC;QACjH,kBAAkB,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,mEAAmE,EAAE,CAAC;QACvI,mBAAmB,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,sCAAs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K,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
|
};
|
|
@@ -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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