Skip to content
This repository was archived by the owner on Feb 15, 2023. It is now read-only.

Commit e9e2c30

Browse files
authored
Merge branch 'master' into refactor-tests
2 parents 980df2b + 1c57170 commit e9e2c30

File tree

6 files changed

+1636
-79
lines changed

6 files changed

+1636
-79
lines changed

.travis.yml

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,22 @@
11
language: node_js
22
node_js:
3-
- 0.10.40
4-
- 0.12
5-
- 4
6-
- 5
7-
- 6
3+
- "node"
4+
- "lts/*"
5+
- "8"
6+
- "7"
87
env:
9-
- MONGOOSE_VERSION=3.8 STREAM_URL='https://key:[email protected]/?app_id=42'
8+
- MONGOOSE_VERSION=4.11 STREAM_URL='https://key:[email protected]/?app_id=42'
109
matrix:
1110
include:
12-
- node_js: 4
11+
- node_js: 8
1312
env: MONGOOSE_VERSION=4.0
14-
- node_js: 4
15-
env: MONGOOSE_VERSION=4.1
16-
- node_js: 4
17-
env: MONGOOSE_VERSION=4.2
18-
- node_js: 4
19-
env: MONGOOSE_VERSION=4.3
20-
- node_js: 4
21-
env: MONGOOSE_VERSION=4.4
22-
- node_js: 4
23-
env: MONGOOSE_VERSION=4.5
24-
- node_js: 4
25-
env: MONGOOSE_VERSION=4.6
26-
- node_js: 4
13+
- node_js: 8
2714
env: MONGOOSE_VERSION=3.6
15+
- node_js: 8
16+
env: MONGOOSE_VERSION=3.0
2817
before_script:
2918
- npm install mongoose@$MONGOOSE_VERSION
3019
script:
3120
- bash ./bin/travis.sh
3221
services:
33-
- mongodb
22+
- mongodb

LICENSE

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
Copyright (c) 2015, Stream.io INC
1+
Copyright (c) 2015-2017 Stream.io Inc, and individual contributors.
2+
23
All rights reserved.
3-
4-
Redistribution and use in source and binary forms, with or without
5-
modification, are permitted provided that the following conditions are met:
6-
7-
* Redistributions of source code must retain the above copyright notice, this
8-
list of conditions and the following disclaimer.
9-
10-
* Redistributions in binary form must reproduce the above copyright notice,
11-
this list of conditions and the following disclaimer in the documentation
12-
and/or other materials provided with the distribution.
13-
14-
* Neither the name of Stream.io INC nor the names of its
15-
contributors may be used to endorse or promote products derived from
16-
this software without specific prior written permission.
17-
18-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19-
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20-
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21-
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22-
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23-
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24-
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25-
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26-
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4+
5+
Redistribution and use in source and binary forms, with or without modification, are permitted
6+
provided that the following conditions are met:
7+
8+
1. Redistributions of source code must retain the above copyright notice, this list of
9+
conditions and the following disclaimer.
10+
11+
2. Redistributions in binary form must reproduce the above copyright notice, this list of
12+
conditions and the following disclaimer in the documentation and/or other materials
13+
provided with the distribution.
14+
15+
3. Neither the name of the copyright holder nor the names of its contributors may
16+
be used to endorse or promote products derived from this software without specific prior
17+
written permission.
18+
19+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
20+
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
21+
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
22+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23+
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
26+
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27+
POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
1-
##Stream NodeJS
1+
## Stream Node.js
22

33
[![Build Status](https://travis-ci.org/tbarbugli/stream-node.svg)](https://travis-ci.org/tbarbugli/stream-node)
44
[![npm version](https://badge.fury.io/js/getstream-node.svg)](http://badge.fury.io/js/getstream-node)
55
[![Coverage Status](https://coveralls.io/repos/github/GetStream/stream-node-orm/badge.svg?branch=refactor-tests)](https://coveralls.io/github/GetStream/stream-node-orm?branch=refactor-tests)
66

77
[![NPM](https://nodei.co/npm/getstream-node.png)](https://nodei.co/npm/getstream-node/)
88

9-
This package helps you create activity streams & newsfeeds with NodeJS and [GetStream.io](https://getstream.io).
9+
[stream-node-orm](https://github.com/GetStream/stream-node-orm) is a Node.js (Sails, Waterline) client for [Stream](https://getstream.io/).
1010

11-
###Build activity streams & news feeds
11+
You can sign up for a Stream account at https://getstream.io/get_started.
12+
13+
Note there is also a lower level [Node.js - Stream integration](https://github.com/getstream/stream-js) library which is suitable for all JavaScript applications.
14+
15+
### Build activity streams & news feeds
1216

1317
<p align="center">
1418
<img src="https://dvqg2dogggmn6.cloudfront.net/images/mood-home.png" alt="Examples of what you can build" title="What you can build"/>
@@ -43,7 +47,7 @@ Install getstream_node package with npm:
4347

4448
#### Step 2 - Config file
4549

46-
Copy `getstream.js` config file from `node_modules/getstream-node` into the root directory of your application
50+
Copy `getstream.js` config file from `node_modules/getstream-node` into the root directory of your application
4751
Make sure you require the getstream-node early on in your application (eg. in app.js)
4852

4953
#### Step 3 - Get your API key
@@ -53,7 +57,7 @@ Login with Github on [getstream.io](https://getstream.io/) and edit the configur
5357

5458
###Model integration
5559

56-
Stream Nodejs can automatically publish new activities to your feeds. To do that you only need to register the models you want to publish with this library.
60+
Stream Node.js can automatically publish new activities to your feeds. To do that you only need to register the models you want to publish with this library.
5761

5862
```js
5963
var stream = require('getstream-node');
@@ -76,8 +80,8 @@ Every time a Tweet is created it will be added to the user's feed. Users which f
7680
Models are stored in feeds as activities. An activity is composed of at least the following fields: **actor**, **verb**, **object**, **time**. You can also add more custom data if needed.
7781
The Activity mixin will try to set things up automatically:
7882

79-
**object** is a reference to the model instance
80-
**actor** is a reference to the user attribute of the instance
83+
**object** is a reference to the model instance
84+
**actor** is a reference to the user attribute of the instance
8185
**verb** is a string representation of the class name
8286

8387
By default the actor field will look for an attribute called user or actor and a field called created_at to track creation time.
@@ -124,18 +128,18 @@ tweetSchema.methods.createActivity = function() {
124128

125129
###Feed manager
126130

127-
This packages comes with a feed_manager class that helps with all common feed operations.
131+
This packages comes with a feed_manager class that helps with all common feed operations.
128132

129133
####Feeds bundled with feed_manager
130134

131135
To get you started the manager has 4 feeds pre-configured. You can add more feeds if your application needs it.
132136
The three feeds are divided in three categories.
133137

134138
#####User feed:
135-
The user feed stores all activities for a user. Think of it as your personal Facebook page. You can easily get this feed from the manager.
139+
The user feed stores all activities for a user. Think of it as your personal Facebook page. You can easily get this feed from the manager.
136140
```js
137141
FeedManager.getUserFeed(req.user.id);
138-
```
142+
```
139143

140144
#####News feeds:
141145
The news feeds store the activities from the people you follow.
@@ -208,7 +212,7 @@ router.get('/flat', ensureAuthenticated, function(req, res, next){
208212
.then(function (enrichedActivities) {
209213
return res.render('feed', {location: 'feed', user: req.user, activities: enrichedActivities, path: req.url});
210214
})
211-
.catch(next)
215+
.catch(next)
212216
});
213217
});
214218
```
@@ -233,20 +237,16 @@ tweetSchema.statics.pathsToPopulate = function() {
233237
};
234238
```
235239

240+
### Full documentation and Low level APIs access
236241

237-
238-
### Low level APIs access
239-
240-
You can also use the low level JS API directly.
242+
When needed you can also use the [low level JavaScript API](https://github.com/getstream/stream-js) directly. Documentation is available at the [Stream website](https://getstream.io/docs/?language=js).
241243

242244
```js
243245
var streamNode = require('getstream-node');
244246
var client = streamNode.FeedManager.client
245247
// client.addActivity, client.removeActivity etc are all available
246248
```
247249

248-
The full documentation for the low level API is available in the [getstream.io documentation](https://getstream.io/docs/).
249-
250250
### Enrichment
251251

252252
You can use the enrichment capabilities of this library directly.
@@ -267,7 +267,7 @@ streamWaterline.enrichActivities(activities).then(function(enrichedActivities) {
267267

268268
### Customizing enrichment (since 1.4.0)
269269

270-
By default the enrichment system assumes that you're referencing items by their id. Sometimes you'll want to customize this behaviour. You might for instance use a username instead of an id. Alternatively you might mant to use a caching layer instead of the ORM for loading the data. The example below shows how to customize the lookup for all User entries.
270+
By default the enrichment system assumes that you're referencing items by their id. Sometimes you'll want to customize this behaviour. You might for instance use a username instead of an id. Alternatively you might mant to use a caching layer instead of the ORM for loading the data. The example below shows how to customize the lookup for all User entries.
271271

272272
```js
273273
// subclass streamMongoose
@@ -312,3 +312,9 @@ npm install
312312
npm version [ major | minor | patch ]
313313
npm publish
314314
```
315+
=======
316+
### Copyright and License Information
317+
318+
Copyright (c) 2015-2017 Stream.io Inc, and individual contributors. All rights reserved.
319+
320+
See the file "LICENSE" for information on the history of this software, terms & conditions for usage, and a DISCLAIMER OF ALL WARRANTIES.

0 commit comments

Comments
 (0)