Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
seth-mg committed Nov 22, 2024
2 parents ca4fc7e + 081dc92 commit 8829901
Show file tree
Hide file tree
Showing 67 changed files with 1,123 additions and 937 deletions.
131 changes: 0 additions & 131 deletions .eslintrc.json

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Dependency directory
node_modules

coverage
.nyc_output
target

.grunt
Expand Down
62 changes: 62 additions & 0 deletions CI.Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
node ("docker-light") {
def sourceDir = pwd()
def nodeVersions = ["18", "20", "22", "23"]
try {
stage("Clean up") {
step([$class: 'WsCleanup'])
}
stage("Checkout Code") {
checkout scm
}
stage("Build And Test") {

withSonarQubeEnv {
mySonarOpts="-Dsonar.login=${env.SONAR_AUTH_TOKEN} -Dsonar.host.url=${env.SONAR_HOST_URL}"
if("${env.CHANGE_ID}" != "null"){
mySonarOpts = "$mySonarOpts -Dsonar.pullrequest.key=${env.CHANGE_ID} -Dsonar.pullrequest.branch=${env.BRANCH_NAME}"
} else {
mySonarOpts = "$mySonarOpts -Dsonar.branch.name=${env.BRANCH_NAME}"
}
if ("${env.CHANGE_BRANCH}" != "null") {
mySonarOpts="$mySonarOpts -Dsonar.pullrequest.base=${env.CHANGE_TARGET} -Dsonar.pullrequest.branch=${env.CHANGE_BRANCH}"
}

nodeVersions.each { version ->
if (version == "23") {
sonarScannerVersion="6.2.1.4610-linux-x64"
sonarExec="cd /root/ && \
wget -q https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${sonarScannerVersion}.zip && \
unzip -q sonar-scanner-cli-${sonarScannerVersion}.zip && \
cd /source && \
/root/sonar-scanner-${sonarScannerVersion}/bin/sonar-scanner ${mySonarOpts}"
} else {
sonarExec="echo Skipping Sonar for this version."
}

sh "docker run --rm \
--pull always \
--volume ${sourceDir}:/source \
node:${version} \
sh -c \"cd /source && \
npm install && \
npx grunt && \
${sonarExec} && \
chown -R 9960:9960 /source\""
}
}
}
postToTeams(true)
} catch (e) {
currentBuild.result = "FAILED"
postToTeams(false)
throw e
}
}

def postToTeams(boolean success) {
def webhookUrl = "${env.TEAMS_PNC_JENKINS_WEBHOOK_URL}"
def color = success ? "#00FF00" : "#FF0000"
def status = success ? "SUCCESSFUL" : "FAILED"
def message = "*" + status + ":* '${env.JOB_NAME}' - [${env.BUILD_NUMBER}] - ${env.BUILD_URL}"
office365ConnectorSend(webhookUrl: webhookUrl, color: color, message: message, status: status)
}
2 changes: 1 addition & 1 deletion DEVELOPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Here are the old instructions from examples/README.
##### Docker
A Docker image for running the examples against the compiled source library is available on Docker Hub.

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

Additional environment settings:
`-e ALT_URL=<alternative URL>`
Expand Down
19 changes: 16 additions & 3 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module.exports = function(grunt) {
}
}
},
mochaTest: {
mochaTest: {
test: {
options: {
reporter: 'spec',
Expand All @@ -34,6 +34,17 @@ module.exports = function(grunt) {
src: ['tests/**/*.js']
}
},
nyc: {
cover: {
options: {
include: ['lib/**/*.js'],
reporter: ['html', 'lcov'],
reportDir: 'coverage'
},
cmd: false,
args: ['grunt', 'mochaTest']
}
},
'gh-pages': {
options: {
base: 'target/html'
Expand All @@ -54,14 +65,16 @@ module.exports = function(grunt) {

// These plugins provide necessary tasks.
grunt.loadNpmTasks("grunt-contrib-clean");
grunt.loadNpmTasks("grunt-contrib-watch");;
grunt.loadNpmTasks("grunt-contrib-watch");
grunt.loadNpmTasks("grunt-jsdoc");
grunt.loadNpmTasks('grunt-mocha-test');
grunt.loadNpmTasks('grunt-gh-pages');
grunt.loadNpmTasks('grunt-simple-nyc');

// Task definitions.
// run `grunt <task>` in command line and it will run the sequence in brackets
grunt.registerTask("default", ["clean","jsdoc", "test"]);
grunt.registerTask("default", ["clean","jsdoc", "nyc:cover"]);
grunt.registerTask("doc", ["jsdoc", "gh-pages"]);
grunt.registerTask("test", ["mochaTest"]);
grunt.registerTask("coverage", ["nyc:cover"]);
};
15 changes: 8 additions & 7 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,21 @@ node ("docker-light") {
echo "${env.ALT_URL}"
def useUrl = ("${env.ALT_URL}" == "null") ? "${env.BINDING_TEST_URL}" : "${env.ALT_URL}"
withEnv(["API_KEY=${env.ROSETTE_API_KEY}", "ALT_URL=${useUrl}"]) {
sh "docker run --rm -e API_KEY=${API_KEY} -e ALT_URL=${ALT_URL} -v ${SOURCEDIR}:/source rosetteapi/docker-nodejs"
sh "docker run --rm -e API_KEY=${API_KEY} -e ALT_URL=${ALT_URL} -v ${SOURCEDIR}:/source rosette/docker-nodejs"
}
}
slack(true)
postToTeams(true)
} catch (e) {
currentBuild.result = "FAILED"
slack(false)
postToTeams(false)
throw e
}
}

def slack(boolean success) {
def postToTeams(boolean success) {
def webhookUrl = "${env.TEAMS_PNC_JENKINS_WEBHOOK_URL}"
def color = success ? "#00FF00" : "#FF0000"
def status = success ? "SUCCESSFUL" : "FAILED"
def message = status + ": Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})"
slackSend(color: color, channel: "#rapid", message: message)
}
def message = "*" + status + ":* '${env.JOB_NAME}' - [${env.BUILD_NUMBER}] - ${env.BUILD_URL}"
office365ConnectorSend(webhookUrl: webhookUrl, color: color, message: message, status: status)
}
13 changes: 7 additions & 6 deletions Jenkinsfile.examples
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,18 @@ node {
sh "docker run --rm -e API_KEY=${API_KEY} -e ALT_URL=${ALT_URL} -v ${examplesDir}:/source ${TEST_CONTAINER}"
}
}
slack(true)
postToTeams(true)
} catch (e) {
currentBuild.result = "FAILED"
slack(false)
postToTeams(false)
throw e
}
}

def slack(boolean success) {
def postToTeams(boolean success) {
def webhookUrl = "${env.TEAMS_PNC_JENKINS_WEBHOOK_URL}"
def color = success ? "#00FF00" : "#FF0000"
def status = success ? "SUCCESSFUL" : "FAILED"
def message = status + ": Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})"
slackSend(color: color, channel: "#rapid", message: message)
}
def message = "*" + status + ":* '${env.JOB_NAME}' - [${env.BUILD_NUMBER}] - ${env.BUILD_URL}"
office365ConnectorSend(webhookUrl: webhookUrl, color: color, message: message, status: status)
}
41 changes: 26 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,47 @@
<a href="https://www.rosette.com"><img src="https://s3.amazonaws.com/styleguide.basistech.com/logos/rosette-logo.png" width="181" height="47" /></a>
<a href="https://www.babelstreet.com/rosette">
<picture>
<source media="(prefers-color-scheme: light)" srcset="https://charts.babelstreet.com/icon-dark.png">
<source media="(prefers-color-scheme: dark)" srcset="https://charts.babelstreet.com/icon-light.png">
<img src="https://charts.babelstreet.com/icon-dark.png" alt="Babel Street Logo" width="48" height="48">
</picture>
</a>

---

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

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

## Rosette API Access
- Rosette Cloud [Sign Up](https://developer.rosette.com/signup)
- Rosette Enterprise [Evaluation](https://www.rosette.com/product-eval/)
Text Analytics extracts events and entities — people, organizations, and places — from unstructured text and adds the
structure of associating those entities into events that deliver only the necessary information for near real-time
decision making. Accompanying tools shorten the process of training AI models to recognize domain-specific events.

The product delivers a multitude of ways to sharpen and expand search results. Semantic similarity expands search
beyond keywords to words with the same meaning, even in other languages. Sentiment analysis and topic extraction help
filter results to what’s relevant.

## Analytics API Access
- Analytics Cloud [Sign Up](https://developer.babelstreet.com/signup)

## Quick Start

#### Installation
`npm install rosette-api`

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

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

## Binding Developer Information
Expand Down
9 changes: 9 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import globals from "globals";
import pluginJs from "@eslint/js";


/** @type {import('eslint').Linter.Config[]} */
export default [
{languageOptions: { globals: globals.node }},
pluginJs.configs.recommended,
];
Loading

0 comments on commit 8829901

Please sign in to comment.