Skip to content

Commit 8829901

Browse files
committed
Merge branch 'develop'
2 parents ca4fc7e + 081dc92 commit 8829901

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+1123
-937
lines changed

.eslintrc.json

Lines changed: 0 additions & 131 deletions
This file was deleted.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Dependency directory
22
node_modules
33

4+
coverage
5+
.nyc_output
46
target
57

68
.grunt

CI.Jenkinsfile

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
node ("docker-light") {
2+
def sourceDir = pwd()
3+
def nodeVersions = ["18", "20", "22", "23"]
4+
try {
5+
stage("Clean up") {
6+
step([$class: 'WsCleanup'])
7+
}
8+
stage("Checkout Code") {
9+
checkout scm
10+
}
11+
stage("Build And Test") {
12+
13+
withSonarQubeEnv {
14+
mySonarOpts="-Dsonar.login=${env.SONAR_AUTH_TOKEN} -Dsonar.host.url=${env.SONAR_HOST_URL}"
15+
if("${env.CHANGE_ID}" != "null"){
16+
mySonarOpts = "$mySonarOpts -Dsonar.pullrequest.key=${env.CHANGE_ID} -Dsonar.pullrequest.branch=${env.BRANCH_NAME}"
17+
} else {
18+
mySonarOpts = "$mySonarOpts -Dsonar.branch.name=${env.BRANCH_NAME}"
19+
}
20+
if ("${env.CHANGE_BRANCH}" != "null") {
21+
mySonarOpts="$mySonarOpts -Dsonar.pullrequest.base=${env.CHANGE_TARGET} -Dsonar.pullrequest.branch=${env.CHANGE_BRANCH}"
22+
}
23+
24+
nodeVersions.each { version ->
25+
if (version == "23") {
26+
sonarScannerVersion="6.2.1.4610-linux-x64"
27+
sonarExec="cd /root/ && \
28+
wget -q https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${sonarScannerVersion}.zip && \
29+
unzip -q sonar-scanner-cli-${sonarScannerVersion}.zip && \
30+
cd /source && \
31+
/root/sonar-scanner-${sonarScannerVersion}/bin/sonar-scanner ${mySonarOpts}"
32+
} else {
33+
sonarExec="echo Skipping Sonar for this version."
34+
}
35+
36+
sh "docker run --rm \
37+
--pull always \
38+
--volume ${sourceDir}:/source \
39+
node:${version} \
40+
sh -c \"cd /source && \
41+
npm install && \
42+
npx grunt && \
43+
${sonarExec} && \
44+
chown -R 9960:9960 /source\""
45+
}
46+
}
47+
}
48+
postToTeams(true)
49+
} catch (e) {
50+
currentBuild.result = "FAILED"
51+
postToTeams(false)
52+
throw e
53+
}
54+
}
55+
56+
def postToTeams(boolean success) {
57+
def webhookUrl = "${env.TEAMS_PNC_JENKINS_WEBHOOK_URL}"
58+
def color = success ? "#00FF00" : "#FF0000"
59+
def status = success ? "SUCCESSFUL" : "FAILED"
60+
def message = "*" + status + ":* '${env.JOB_NAME}' - [${env.BUILD_NUMBER}] - ${env.BUILD_URL}"
61+
office365ConnectorSend(webhookUrl: webhookUrl, color: color, message: message, status: status)
62+
}

DEVELOPER.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Here are the old instructions from examples/README.
1818
##### Docker
1919
A Docker image for running the examples against the compiled source library is available on Docker Hub.
2020

21-
Command: `docker run -e API_KEY=api-key -v "<binding root directory>:/source" rosetteapi/docker-nodejs`
21+
Command: `docker run -e API_KEY=api-key -v "<binding root directory>:/source" rosette/docker-nodejs`
2222

2323
Additional environment settings:
2424
`-e ALT_URL=<alternative URL>`

Gruntfile.js

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ module.exports = function(grunt) {
2424
}
2525
}
2626
},
27-
mochaTest: {
27+
mochaTest: {
2828
test: {
2929
options: {
3030
reporter: 'spec',
@@ -34,6 +34,17 @@ module.exports = function(grunt) {
3434
src: ['tests/**/*.js']
3535
}
3636
},
37+
nyc: {
38+
cover: {
39+
options: {
40+
include: ['lib/**/*.js'],
41+
reporter: ['html', 'lcov'],
42+
reportDir: 'coverage'
43+
},
44+
cmd: false,
45+
args: ['grunt', 'mochaTest']
46+
}
47+
},
3748
'gh-pages': {
3849
options: {
3950
base: 'target/html'
@@ -54,14 +65,16 @@ module.exports = function(grunt) {
5465

5566
// These plugins provide necessary tasks.
5667
grunt.loadNpmTasks("grunt-contrib-clean");
57-
grunt.loadNpmTasks("grunt-contrib-watch");;
68+
grunt.loadNpmTasks("grunt-contrib-watch");
5869
grunt.loadNpmTasks("grunt-jsdoc");
5970
grunt.loadNpmTasks('grunt-mocha-test');
6071
grunt.loadNpmTasks('grunt-gh-pages');
72+
grunt.loadNpmTasks('grunt-simple-nyc');
6173

6274
// Task definitions.
6375
// run `grunt <task>` in command line and it will run the sequence in brackets
64-
grunt.registerTask("default", ["clean","jsdoc", "test"]);
76+
grunt.registerTask("default", ["clean","jsdoc", "nyc:cover"]);
6577
grunt.registerTask("doc", ["jsdoc", "gh-pages"]);
6678
grunt.registerTask("test", ["mochaTest"]);
79+
grunt.registerTask("coverage", ["nyc:cover"]);
6780
};

Jenkinsfile

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,21 @@ node ("docker-light") {
1111
echo "${env.ALT_URL}"
1212
def useUrl = ("${env.ALT_URL}" == "null") ? "${env.BINDING_TEST_URL}" : "${env.ALT_URL}"
1313
withEnv(["API_KEY=${env.ROSETTE_API_KEY}", "ALT_URL=${useUrl}"]) {
14-
sh "docker run --rm -e API_KEY=${API_KEY} -e ALT_URL=${ALT_URL} -v ${SOURCEDIR}:/source rosetteapi/docker-nodejs"
14+
sh "docker run --rm -e API_KEY=${API_KEY} -e ALT_URL=${ALT_URL} -v ${SOURCEDIR}:/source rosette/docker-nodejs"
1515
}
1616
}
17-
slack(true)
17+
postToTeams(true)
1818
} catch (e) {
1919
currentBuild.result = "FAILED"
20-
slack(false)
20+
postToTeams(false)
2121
throw e
2222
}
2323
}
2424

25-
def slack(boolean success) {
25+
def postToTeams(boolean success) {
26+
def webhookUrl = "${env.TEAMS_PNC_JENKINS_WEBHOOK_URL}"
2627
def color = success ? "#00FF00" : "#FF0000"
2728
def status = success ? "SUCCESSFUL" : "FAILED"
28-
def message = status + ": Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})"
29-
slackSend(color: color, channel: "#rapid", message: message)
30-
}
29+
def message = "*" + status + ":* '${env.JOB_NAME}' - [${env.BUILD_NUMBER}] - ${env.BUILD_URL}"
30+
office365ConnectorSend(webhookUrl: webhookUrl, color: color, message: message, status: status)
31+
}

Jenkinsfile.examples

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,18 @@ node {
2222
sh "docker run --rm -e API_KEY=${API_KEY} -e ALT_URL=${ALT_URL} -v ${examplesDir}:/source ${TEST_CONTAINER}"
2323
}
2424
}
25-
slack(true)
25+
postToTeams(true)
2626
} catch (e) {
2727
currentBuild.result = "FAILED"
28-
slack(false)
28+
postToTeams(false)
2929
throw e
3030
}
3131
}
3232

33-
def slack(boolean success) {
33+
def postToTeams(boolean success) {
34+
def webhookUrl = "${env.TEAMS_PNC_JENKINS_WEBHOOK_URL}"
3435
def color = success ? "#00FF00" : "#FF0000"
3536
def status = success ? "SUCCESSFUL" : "FAILED"
36-
def message = status + ": Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})"
37-
slackSend(color: color, channel: "#rapid", message: message)
38-
}
37+
def message = "*" + status + ":* '${env.JOB_NAME}' - [${env.BUILD_NUMBER}] - ${env.BUILD_URL}"
38+
office365ConnectorSend(webhookUrl: webhookUrl, color: color, message: message, status: status)
39+
}

README.md

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,47 @@
1-
<a href="https://www.rosette.com"><img src="https://s3.amazonaws.com/styleguide.basistech.com/logos/rosette-logo.png" width="181" height="47" /></a>
1+
<a href="https://www.babelstreet.com/rosette">
2+
<picture>
3+
<source media="(prefers-color-scheme: light)" srcset="https://charts.babelstreet.com/icon-dark.png">
4+
<source media="(prefers-color-scheme: dark)" srcset="https://charts.babelstreet.com/icon-light.png">
5+
<img src="https://charts.babelstreet.com/icon-dark.png" alt="Babel Street Logo" width="48" height="48">
6+
</picture>
7+
</a>
28

39
---
410

5-
[![Build Status](https://travis-ci.org/rosette-api/nodejs.svg?branch=develop)](https://travis-ci.org/rosette-api/nodejs)
611
[![npm version](https://badge.fury.io/js/rosette-api.svg)](https://badge.fury.io/js/rosette-api)
712
![node engine](https://img.shields.io/node/v/rosette-api.svg)
813

9-
## Rosette API
10-
The Rosette Text Analytics Platform uses natural language processing, statistical modeling, and machine learning to
11-
analyze unstructured and semi-structured text across 364 language-encoding-script combinations, revealing valuable
12-
information and actionable data. Rosette provides endpoints for extracting entities and relationships, translating and
13-
comparing the similarity of names, categorizing and adding linguistic tags to text and more.
14+
## Analytics by Babel Street
15+
Our product is a full text processing pipeline from data preparation to extracting the most relevant information and
16+
analysis utilizing precise, focused AI that has built-in human understanding. Text Analytics provides foundational
17+
linguistic analysis for identifying languages and relating words. The result is enriched and normalized text for
18+
high-speed search and processing without translation.
1419

15-
## Rosette API Access
16-
- Rosette Cloud [Sign Up](https://developer.rosette.com/signup)
17-
- Rosette Enterprise [Evaluation](https://www.rosette.com/product-eval/)
20+
Text Analytics extracts events and entities — people, organizations, and places — from unstructured text and adds the
21+
structure of associating those entities into events that deliver only the necessary information for near real-time
22+
decision making. Accompanying tools shorten the process of training AI models to recognize domain-specific events.
23+
24+
The product delivers a multitude of ways to sharpen and expand search results. Semantic similarity expands search
25+
beyond keywords to words with the same meaning, even in other languages. Sentiment analysis and topic extraction help
26+
filter results to what’s relevant.
27+
28+
## Analytics API Access
29+
- Analytics Cloud [Sign Up](https://developer.babelstreet.com/signup)
1830

1931
## Quick Start
2032

2133
#### Installation
2234
`npm install rosette-api`
2335

2436
#### Examples
25-
View small example programs for each Rosette endpoint in the [examples](https://github.com/rosette-api/nodejs/tree/develop/examples) directory.
37+
View small example programs for each Analytics endpoint in the [examples](https://github.com/rosette-api/nodejs/tree/develop/examples) directory.
2638

2739
#### Documentation & Support
2840
- [Binding API](https://rosette-api.github.io/nodejs/)
29-
- [Rosette Platform API](https://developer.rosette.com/features-and-functions)
41+
- [Analytics Platform API](https://docs.babelstreet.com/API/en/index-en.html)
3042
- [Binding Release Notes](https://github.com/rosette-api/nodejs/wiki/Release-Notes)
31-
- [Rosette Platform Release Notes](https://support.rosette.com/hc/en-us/articles/360018354971-Release-Notes)
32-
- [Binding/Rosette Platform Compatibility](https://developer.rosette.com/features-and-functions?javascript#)
33-
- [Support](https://support.rosette.com)
43+
- [Analytics Platform Release Notes](https://docs.babelstreet.com/Release/en/rosette-cloud.html)
44+
- [Support](https://babelstreet.my.site.com/support/s/)
3445
- [Binding License: Apache 2.0](https://github.com/rosette-api/nodejs/blob/develop/LICENSE.txt)
3546

3647
## Binding Developer Information

eslint.config.mjs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import globals from "globals";
2+
import pluginJs from "@eslint/js";
3+
4+
5+
/** @type {import('eslint').Linter.Config[]} */
6+
export default [
7+
{languageOptions: { globals: globals.node }},
8+
pluginJs.configs.recommended,
9+
];

0 commit comments

Comments
 (0)