Skip to content

Commit 9dbf809

Browse files
authored
Rename to workplace (#27)
* Remove logo * Rename files * Rename Enterprise -> Workplace * Change API routes
1 parent c27ab7a commit 9dbf809

File tree

7 files changed

+33
-35
lines changed

7 files changed

+33
-35
lines changed

NOTICE.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Elastic Enterprise Search Node.js client.
2-
Copyright 2012-2019 Elasticsearch B.V.
1+
Elastic Workplace Search Node.js client.
2+
Copyright 2012-2020 Elasticsearch B.V.

README.md

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
<p align="center"><img src="https://github.com/elastic/enterprise-search-node/blob/master/logo-enterprise-search.png?raw=true" alt="Elastic Enterprise Search Logo"></p>
1+
<p align="center"><a href="https://circleci.com/gh/elastic/workplace-search-node"><img src="https://circleci.com/gh/elastic/workplace-search-node.svg?style=svg" alt="CircleCI build"></a></p>
22

3-
<p align="center"><a href="https://circleci.com/gh/elastic/enterprise-search-node"><img src="https://circleci.com/gh/elastic/enterprise-search-node.svg?style=svg" alt="CircleCI build"></a></p>
4-
5-
> A first-party Node.js client for [Elastic Enterprise Search](https://www.elastic.co/solutions/enterprise-search).
3+
> A first-party Node.js client for [Elastic Workplace Search](https://www.elastic.co/workplace-search).
64
75
## Contents
86

@@ -19,33 +17,33 @@
1917
With npm:
2018

2119
```bash
22-
npm install @elastic/enterprise-search-node
20+
npm install @elastic/workplace-search-node
2321
```
2422

2523
or clone locally:
2624

2725
```bash
28-
git clone git@github.com:elastic/enterprise-search-node.git
29-
cd enterprise-search-node
26+
git clone git@github.com:elastic/workplace-search-node.git
27+
cd workplace-search-node
3028
npm install
3129
```
3230

3331
## Usage
3432

35-
Create a new instance of the Elastic Enterprise Search Client with your access token:
33+
Create a new instance of the Elastic Workplace Search Client with your access token:
3634

3735
```javascript
38-
const EnterpriseSearchClient = require('@elastic/enterprise-search-node')
36+
const WorkplaceSearchClient = require('@elastic/workplace-search-node')
3937
const accessToken = '' // your access token
40-
const client = new EnterpriseSearchClient(accessToken)
38+
const client = new WorkplaceSearchClient(accessToken)
4139
```
4240

4341
### Change API endpoint
4442

4543
```javascript
46-
const client = new EnterpriseSearchClient(
44+
const client = new WorkplaceSearchClient(
4745
accessToken,
48-
'https://your-server.example.com/api/v1/ent'
46+
'https://your-server.example.com/api/ws/v1'
4947
)
5048
```
5149

@@ -193,17 +191,17 @@ $ npm test
193191

194192
### Where do I report issues with the client?
195193

196-
If something is not working as expected, please open an [issue](https://github.com/elastic/enterprise-search-node/issues/new).
194+
If something is not working as expected, please open an [issue](https://github.com/elastic/workplace-search-node/issues/new).
197195

198196
## Contribute 🚀
199197

200198
We welcome contributors to the project. Before you begin, a couple notes...
201199

202-
- Before opening a pull request, please create an issue to [discuss the scope of your proposal](https://github.com/elastic/enterprise-search-node/issues).
200+
- Before opening a pull request, please create an issue to [discuss the scope of your proposal](https://github.com/elastic/workplace-search-node/issues).
203201
- Please write simple code and concise documentation, when appropriate.
204202

205203
## License 📗
206204

207-
[Apache 2.0](https://github.com/elastic/enterprise-search-node/blob/master/LICENSE.txt) © [Elastic](https://github.com/elastic)
205+
[Apache 2.0](https://github.com/elastic/workplace-search-node/blob/master/LICENSE.txt) © [Elastic](https://github.com/elastic)
208206

209-
Thank you to all the [contributors](https://github.com/elastic/enterprise-search-node/graphs/contributors)!
207+
Thank you to all the [contributors](https://github.com/elastic/workplace-search-node/graphs/contributors)!

lib/client.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const packageJson = require('../package.json')
88
class Client {
99
constructor(accessToken, baseUrl) {
1010
this.accessToken = accessToken
11-
this.packageName = 'elastic-enterprise-search-node'
11+
this.packageName = 'elastic-workplace-search-node'
1212
this.baseUrl = baseUrl
1313
}
1414

lib/enterpriseSearch.js renamed to lib/workplaceSearch.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const Client = require('./client')
22

3-
class EnterpriseSearchClient {
4-
constructor(accessToken, baseUrl = 'http://localhost:3002/api/v1/ent') {
3+
class WorkplaceSearchClient {
4+
constructor(accessToken, baseUrl = 'http://localhost:3002/api/ws/v1') {
55
this.client = new Client(accessToken, baseUrl)
66
}
77

@@ -74,4 +74,4 @@ class EnterpriseSearchClient {
7474
}
7575
}
7676

77-
module.exports = EnterpriseSearchClient
77+
module.exports = WorkplaceSearchClient

logo-enterprise-search.png

-27.6 KB
Binary file not shown.

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
{
2-
"name": "@elastic/enterprise-search-node",
2+
"name": "@elastic/workplace-search-node",
33
"version": "0.3.0",
4-
"description": "Elastic Enterprise Search client for Node.js",
4+
"description": "Elastic Workplace Search client for Node.js",
55
"files": [
66
"lib/"
77
],
8-
"main": "lib/enterpriseSearch.js",
8+
"main": "lib/workplaceSearch.js",
99
"scripts": {
1010
"test": "mocha"
1111
},
1212
"repository": {
1313
"type": "git",
14-
"url": "git+https://github.com/elastic/enterprise-search-node.git"
14+
"url": "git+https://github.com/elastic/workplace-search-node.git"
1515
},
1616
"engines": {
1717
"node": ">= v6.5.0"
1818
},
1919
"author": "Elastic",
2020
"license": "Apache-2.0",
2121
"bugs": {
22-
"url": "https://github.com/elastic/enterprise-search-node/issues"
22+
"url": "https://github.com/elastic/workplace-search-node/issues"
2323
},
24-
"homepage": "https://github.com/elastic/enterprise-search-node#readme",
24+
"homepage": "https://github.com/elastic/workplace-search-node#readme",
2525
"devDependencies": {
2626
"mocha": "^6.2.0",
2727
"nock": "^10.0.6"

test/test.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
const assert = require('assert')
44
const nock = require('nock')
5-
const EnterpriseSearchClient = require('../lib/enterpriseSearch')
5+
const WorkplaceSearchClient = require('../lib/workplaceSearch')
66
const HttpClient = require('../lib/client')
77
const packageJson = require('../package.json')
88

@@ -24,11 +24,11 @@ const mockDocuments = [
2424
url: 'https://www.shopify.com/content/how-to-profit-from-your-passions'
2525
}
2626
]
27-
const clientName = 'elastic-enterprise-search-node'
27+
const clientName = 'elastic-workplace-search-node'
2828
const clientVersion = '0.3.0'
2929

30-
// Mock for Enterprise Search client
31-
nock('https://api.swiftype.com/api/v1/ent', {
30+
// Mock for Workplace Search client
31+
nock('https://api.swiftype.com/api/ws/v1', {
3232
reqheaders: {
3333
authorization: `Bearer ${mockAccessToken}`,
3434
'x-swiftype-client': clientName,
@@ -107,10 +107,10 @@ nock('https://example.com', {
107107
.post('/error', { foo: 'bar' })
108108
.reply(500, { hello: 'world' })
109109

110-
describe('EnterpriseSearchClient', () => {
111-
const client = new EnterpriseSearchClient(
110+
describe('WorkplaceSearchClient', () => {
111+
const client = new WorkplaceSearchClient(
112112
mockAccessToken,
113-
'https://api.swiftype.com/api/v1/ent'
113+
'https://api.swiftype.com/api/ws/v1'
114114
)
115115

116116
context('#indexDocuments', () => {

0 commit comments

Comments
 (0)