@sonisoft/now-sdk-ext-core 2.5.1 β 3.0.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 +122 -27
- package/package.json +8 -7
package/README.md
CHANGED
|
@@ -2,17 +2,31 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@sonisoft/now-sdk-ext-core)
|
|
4
4
|
[](https://opensource.org/licenses/MIT)
|
|
5
|
-
[](https://nodejs.org)
|
|
6
6
|
|
|
7
7
|
A comprehensive TypeScript library that extends the ServiceNow SDK with powerful features for application management, automated testing, log monitoring, and more. Perfect for CI/CD pipelines, development automation, and DevOps workflows.
|
|
8
8
|
|
|
9
9
|
## β¨ Features
|
|
10
10
|
|
|
11
11
|
- π **Application Management** - Install, upgrade, and manage ServiceNow applications programmatically
|
|
12
|
+
- πͺ **Store Application Management** - Search, install, and update apps from the ServiceNow Store
|
|
12
13
|
- π§ͺ **ATF Test Execution** - Run automated tests and get detailed results
|
|
13
14
|
- π **Real-time Log Monitoring** - Tail ServiceNow logs with two efficient methods
|
|
14
15
|
- π **AMB (Asynchronous Message Bus)** - WebSocket-based real-time event monitoring
|
|
15
16
|
- π **Background Script Execution** - Execute server-side scripts programmatically
|
|
17
|
+
- π **Scope Management** - Set/get current application scope programmatically
|
|
18
|
+
- π¦ **Update Set Management** - Create, clone, inspect, and manage update sets
|
|
19
|
+
- π **Code Search** - Search across platform code, apps, and tables
|
|
20
|
+
- ποΈ **Schema Discovery** - Discover table schemas, explain fields, validate catalogs
|
|
21
|
+
- π **Attachment Management** - Upload, list, and retrieve file attachments
|
|
22
|
+
- β‘ **Batch Operations** - Bulk create/update with variable substitution and query-based bulk operations
|
|
23
|
+
- π§ **Workflow Management** - Create complete workflows programmatically
|
|
24
|
+
- π **Task Operations** - Add comments, assign tasks, resolve/close incidents
|
|
25
|
+
- π **Script Sync** - Bidirectional sync of scripts between local files and instance
|
|
26
|
+
- π **Aggregate Queries** - COUNT, AVG, MIN, MAX, SUM with GROUP BY via Stats API
|
|
27
|
+
- π₯ **Instance Health** - Version, cluster, stuck jobs, semaphore monitoring
|
|
28
|
+
- πΊοΈ **CMDB Relationships** - Query and traverse CI relationship graphs
|
|
29
|
+
- π **Instance Discovery** - List tables, scoped apps, store apps, and plugins
|
|
16
30
|
- π **Authentication** - Seamless integration with ServiceNow CLI authentication
|
|
17
31
|
- π‘ **Table API** - Full CRUD operations on ServiceNow tables
|
|
18
32
|
- π οΈ **Type-Safe** - Complete TypeScript definitions for all APIs
|
|
@@ -25,9 +39,9 @@ npm install @sonisoft/now-sdk-ext-core
|
|
|
25
39
|
|
|
26
40
|
### Prerequisites
|
|
27
41
|
|
|
28
|
-
- Node.js
|
|
42
|
+
- Node.js 18.x or higher
|
|
29
43
|
- ServiceNow CLI configured with instance credentials
|
|
30
|
-
- TypeScript
|
|
44
|
+
- TypeScript 5.x or higher (optional, for TypeScript projects)
|
|
31
45
|
|
|
32
46
|
### ServiceNow CLI Setup
|
|
33
47
|
|
|
@@ -39,6 +53,32 @@ npm install -g @servicenow/sdk
|
|
|
39
53
|
snc configure profile set
|
|
40
54
|
```
|
|
41
55
|
|
|
56
|
+
## β οΈ Breaking Change β v3.0.0 (ServiceNow SDK 4.3.0)
|
|
57
|
+
|
|
58
|
+
> **If you are upgrading from v2.x, read this first.**
|
|
59
|
+
>
|
|
60
|
+
> This version upgrades the underlying ServiceNow SDK dependencies from **4.2.x to 4.3.0**. ServiceNow 4.3.0 **changed how credential aliases are stored**, replacing the previous `keytar`-based credential store with a new implementation.
|
|
61
|
+
>
|
|
62
|
+
> **What this means for you:**
|
|
63
|
+
> - Credential aliases created with ServiceNow SDK 4.2.x **cannot be read** by SDK 4.3.x
|
|
64
|
+
> - You **must re-create all instance aliases** after upgrading
|
|
65
|
+
>
|
|
66
|
+
> **Migration steps:**
|
|
67
|
+
> ```bash
|
|
68
|
+
> # 1. Update the global CLI
|
|
69
|
+
> npm install -g @servicenow/sdk@4.3.0
|
|
70
|
+
>
|
|
71
|
+
> # 2. Re-add each instance alias
|
|
72
|
+
> snc configure profile set
|
|
73
|
+
> # β or β
|
|
74
|
+
> npx @servicenow/sdk auth --add <your-alias>
|
|
75
|
+
>
|
|
76
|
+
> # 3. Verify your aliases work
|
|
77
|
+
> npx @servicenow/sdk auth --list
|
|
78
|
+
> ```
|
|
79
|
+
>
|
|
80
|
+
> All API surfaces in this library remain unchanged β only the underlying authentication storage has changed.
|
|
81
|
+
|
|
42
82
|
## π Quick Start
|
|
43
83
|
|
|
44
84
|
### Basic Connection
|
|
@@ -359,29 +399,60 @@ console.log('Return value:', result.result);
|
|
|
359
399
|
|
|
360
400
|
- **`ServiceNowInstance`** - Instance connection and configuration
|
|
361
401
|
- **`ServiceNowRequest`** - HTTP request handling with authentication
|
|
362
|
-
- **`TableAPIRequest`** - ServiceNow Table API wrapper
|
|
402
|
+
- **`TableAPIRequest`** - ServiceNow Table API wrapper (CRUD)
|
|
363
403
|
|
|
364
404
|
### Application Management
|
|
365
405
|
|
|
366
|
-
- **`ApplicationManager`** -
|
|
406
|
+
- **`ApplicationManager`** - Install, upgrade, and validate applications via batch definitions
|
|
367
407
|
- **`AppRepoApplication`** - App repository operations
|
|
368
|
-
- **`
|
|
369
|
-
|
|
408
|
+
- **`CompanyApplications`** - Store application search, install, update, and progress tracking
|
|
409
|
+
|
|
410
|
+
### Scope & Configuration
|
|
411
|
+
|
|
412
|
+
- **`ScopeManager`** - Set/get current application scope, list and retrieve applications
|
|
413
|
+
- **`UpdateSetManager`** - Create, clone, inspect, move records, and manage update sets
|
|
370
414
|
|
|
371
415
|
### Testing & Automation
|
|
372
416
|
|
|
373
|
-
- **`ATFTestExecutor`** - ATF test execution and monitoring
|
|
374
|
-
- **`BackgroundScriptExecutor`** - Server-side
|
|
417
|
+
- **`ATFTestExecutor`** - ATF test execution and monitoring with progress tracking
|
|
418
|
+
- **`BackgroundScriptExecutor`** - Server-side GlideScript execution
|
|
419
|
+
|
|
420
|
+
### Code & Schema
|
|
421
|
+
|
|
422
|
+
- **`CodeSearch`** - Search across platform code by term, app, or table
|
|
423
|
+
- **`SchemaDiscovery`** - Discover table schemas, explain fields, validate catalog items
|
|
424
|
+
|
|
425
|
+
### Data Operations
|
|
426
|
+
|
|
427
|
+
- **`AttachmentManager`** - Upload, list, and retrieve file attachments
|
|
428
|
+
- **`BatchOperations`** - Sequential bulk create/update with variable substitution
|
|
429
|
+
- **`QueryBatchOperations`** - Query-based bulk update/delete with dry-run safety
|
|
430
|
+
|
|
431
|
+
### Workflow & Task
|
|
432
|
+
|
|
433
|
+
- **`WorkflowManager`** - Create complete workflows with activities, transitions, and conditions
|
|
434
|
+
- **`TaskOperations`** - Add comments, assign tasks, resolve/close incidents, approve changes
|
|
435
|
+
|
|
436
|
+
### Scripting
|
|
375
437
|
|
|
376
|
-
|
|
438
|
+
- **`ScriptSync`** - Bidirectional sync of Script Includes, Business Rules, and more
|
|
377
439
|
|
|
378
|
-
|
|
379
|
-
|
|
440
|
+
### Monitoring & Discovery
|
|
441
|
+
|
|
442
|
+
- **`AggregateQuery`** - COUNT, AVG, MIN, MAX, SUM with GROUP BY via Stats API
|
|
443
|
+
- **`InstanceHealth`** - Version, cluster nodes, stuck jobs, semaphores, operational counts
|
|
444
|
+
- **`CMDBRelationships`** - Query direct relationships and traverse CI graphs (BFS)
|
|
445
|
+
- **`InstanceDiscovery`** - List tables, scoped apps, store apps, and plugins
|
|
446
|
+
|
|
447
|
+
### Logging & Real-time Events
|
|
448
|
+
|
|
449
|
+
- **`SyslogReader`** - Log querying, formatting, export, and real-time tailing
|
|
450
|
+
- **`AMBClient`** - WebSocket-based real-time event subscriptions
|
|
380
451
|
- **`MessageClientBuilder`** - AMB client configuration
|
|
381
452
|
|
|
382
453
|
### Utilities
|
|
383
454
|
|
|
384
|
-
- **`Logger`** - Winston-based logging
|
|
455
|
+
- **`Logger`** - Winston-based logging with file output
|
|
385
456
|
- **`NowStringUtil`** - String manipulation utilities
|
|
386
457
|
- **`AppUtil`** - Application utility functions
|
|
387
458
|
|
|
@@ -460,14 +531,41 @@ node docs/examples/syslog-tail.mjs your-instance error ./logs/errors.log
|
|
|
460
531
|
|
|
461
532
|
Comprehensive documentation is available in the `/docs` directory:
|
|
462
533
|
|
|
534
|
+
**Getting Started:**
|
|
463
535
|
- **[Getting Started](./docs/GettingStarted.md)** - Setup and basic usage
|
|
464
536
|
- **[API Reference](./docs/APIReference.md)** - Complete API documentation
|
|
537
|
+
- **[Examples](./docs/examples/)** - Working code examples
|
|
538
|
+
|
|
539
|
+
**Application & Scope Management:**
|
|
465
540
|
- **[Application Manager](./docs/ApplicationManager.md)** - Application management guide
|
|
541
|
+
- **[Store Applications](./docs/CompanyApplications.md)** - Store app search, install, and update
|
|
542
|
+
- **[Scope Manager](./docs/ScopeManager.md)** - Application scope management
|
|
543
|
+
- **[Update Set Manager](./docs/UpdateSetManager.md)** - Update set lifecycle management
|
|
544
|
+
|
|
545
|
+
**Code, Schema & Search:**
|
|
546
|
+
- **[Code Search](./docs/CodeSearch.md)** - Platform code search
|
|
547
|
+
- **[Schema Discovery](./docs/SchemaDiscovery.md)** - Table schema and field discovery
|
|
548
|
+
|
|
549
|
+
**Data Operations:**
|
|
550
|
+
- **[Attachment Manager](./docs/AttachmentManager.md)** - File attachment operations
|
|
551
|
+
- **[Batch Operations](./docs/BatchOperations.md)** - Bulk create/update with variable substitution
|
|
552
|
+
- **[Query Batch Operations](./docs/QueryBatchOperations.md)** - Query-based bulk update/delete
|
|
553
|
+
|
|
554
|
+
**Workflow, Task & Scripting:**
|
|
555
|
+
- **[Workflow Manager](./docs/WorkflowManager.md)** - Programmatic workflow creation
|
|
556
|
+
- **[Task Operations](./docs/TaskOperations.md)** - ITSM task management
|
|
557
|
+
- **[Script Sync](./docs/ScriptSync.md)** - Bidirectional script synchronization
|
|
558
|
+
|
|
559
|
+
**Monitoring & Discovery:**
|
|
560
|
+
- **[Aggregate Query](./docs/AggregateQuery.md)** - Stats API aggregations
|
|
561
|
+
- **[Instance Health](./docs/InstanceHealth.md)** - Health monitoring
|
|
562
|
+
- **[CMDB Relationships](./docs/CMDBRelationships.md)** - CI relationship graph traversal
|
|
563
|
+
- **[Instance Discovery](./docs/InstanceDiscovery.md)** - Table, app, and plugin discovery
|
|
564
|
+
|
|
565
|
+
**Testing & Logging:**
|
|
466
566
|
- **[ATF Test Executor](./docs/ATFTestExecutor.md)** - Testing automation
|
|
467
567
|
- **[Syslog Reader](./docs/SyslogReader.md)** - Log monitoring guide
|
|
468
568
|
- **[ChannelAjax Tailing](./docs/SyslogReaderChannelAjax.md)** - Advanced log tailing
|
|
469
|
-
- **[AMB Guide](./docs/AMB_FIX_SUMMARY.md)** - Real-time event monitoring
|
|
470
|
-
- **[Examples](./docs/examples/)** - Working code examples
|
|
471
569
|
|
|
472
570
|
## π§ Advanced Configuration
|
|
473
571
|
|
|
@@ -559,12 +657,14 @@ try {
|
|
|
559
657
|
|
|
560
658
|
## π¦ Dependencies
|
|
561
659
|
|
|
562
|
-
- `@servicenow/sdk` - ServiceNow SDK
|
|
563
|
-
- `@servicenow/sdk-cli` - ServiceNow CLI tools
|
|
564
|
-
- `cometd` - WebSocket support for AMB
|
|
565
|
-
- `xml2js` - XML parsing
|
|
566
|
-
- `winston` - Logging
|
|
660
|
+
- `@servicenow/sdk` 4.3.0 / `@servicenow/sdk-cli` 4.3.0 / `@servicenow/sdk-core` 4.3.0 - ServiceNow SDK and CLI tools
|
|
567
661
|
- `axios` - HTTP client
|
|
662
|
+
- `cometd` / `cometd-nodejs-client` - WebSocket support for AMB
|
|
663
|
+
- `winston` - Logging
|
|
664
|
+
- `xml2js` / `fast-xml-parser` - XML parsing
|
|
665
|
+
- `ws` - WebSocket client
|
|
666
|
+
- `zod` - Runtime schema validation
|
|
667
|
+
- `lodash` - Utility functions
|
|
568
668
|
|
|
569
669
|
## π§ͺ Testing
|
|
570
670
|
|
|
@@ -623,15 +723,10 @@ For issues, questions, or contributions:
|
|
|
623
723
|
|
|
624
724
|
- [ ] GraphQL API support
|
|
625
725
|
- [ ] Webhook integration
|
|
626
|
-
- [ ]
|
|
627
|
-
- [ ]
|
|
628
|
-
- [ ] CLI tool package
|
|
726
|
+
- [ ] Performance metrics dashboard
|
|
727
|
+
- [ ] Standalone CLI tool package
|
|
629
728
|
- [ ] Plugin development tools
|
|
630
729
|
|
|
631
|
-
## π Version History
|
|
632
|
-
|
|
633
|
-
See [CHANGELOG](./CHANGELOG.md) for version history and release notes.
|
|
634
|
-
|
|
635
730
|
---
|
|
636
731
|
|
|
637
732
|
**Made with β€οΈ for the ServiceNow Developer Community**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sonisoft/now-sdk-ext-core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Comprehensive TypeScript library extending ServiceNow SDK with application management, ATF testing, real-time log monitoring, AMB event subscriptions, and automation tools",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"servicenow",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
],
|
|
17
17
|
"repository": {
|
|
18
18
|
"type": "git",
|
|
19
|
-
"url": "https://
|
|
19
|
+
"url": "https://github.com/sonisoft-cnanda/now-dev.git"
|
|
20
20
|
},
|
|
21
21
|
"type": "module",
|
|
22
22
|
"author": "",
|
|
@@ -57,11 +57,11 @@
|
|
|
57
57
|
"types": "./dist/index.d.ts",
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"@servicenow/glide": "^26.0.1",
|
|
60
|
-
"@servicenow/sdk": "4.
|
|
61
|
-
"@servicenow/sdk-build-core": "4.0
|
|
62
|
-
"@servicenow/sdk-cli": "4.
|
|
63
|
-
"@servicenow/sdk-cli-core": "3.0.
|
|
64
|
-
"@servicenow/sdk-core": "4.
|
|
60
|
+
"@servicenow/sdk": "4.3.0",
|
|
61
|
+
"@servicenow/sdk-build-core": "4.3.0",
|
|
62
|
+
"@servicenow/sdk-cli": "4.3.0",
|
|
63
|
+
"@servicenow/sdk-cli-core": "3.0.3",
|
|
64
|
+
"@servicenow/sdk-core": "4.3.0",
|
|
65
65
|
"@ts-morph/common": "^0.24.0",
|
|
66
66
|
"@types/mock-fs": "^4.13.4",
|
|
67
67
|
"@types/node-gzip": "^1.1.3",
|
|
@@ -125,6 +125,7 @@
|
|
|
125
125
|
"@types/ws": "^8.5.12",
|
|
126
126
|
"chai": "5.1.1",
|
|
127
127
|
"concurrently": "8.2.2",
|
|
128
|
+
"conventional-changelog-conventionalcommits": "^9.1.0",
|
|
128
129
|
"create-ts-index": "^1.14.0",
|
|
129
130
|
"ctix": "^2.6.4",
|
|
130
131
|
"diff": "^5.1.0",
|