getstream
Advanced tools
Comparing version 8.1.5 to 8.2.0
@@ -6,6 +6,6 @@ /// <reference path="../types/modules.d.ts" /> | ||
/// <reference types="node" /> | ||
import * as http from 'http'; | ||
import * as https from 'https'; | ||
import * as axios from 'axios'; | ||
import * as Faye from 'faye'; | ||
import * as http from 'http'; | ||
import * as https from 'https'; | ||
import { Personalization } from './personalization'; | ||
@@ -272,3 +272,4 @@ import { Collections } from './collections'; | ||
replaceReactionOptions: (options: { | ||
reactions?: Record<string, boolean>; | ||
reactionKindsFilter?: string[]; | ||
reactions?: Record<string, boolean | string[]>; | ||
withOwnChildren?: boolean; | ||
@@ -282,2 +283,3 @@ withOwnReactions?: boolean; | ||
ownReactions?: boolean; | ||
reactionKindsFilter?: string[]; | ||
withOwnChildren?: boolean; | ||
@@ -284,0 +286,0 @@ withReactionCounts?: boolean; |
@@ -16,6 +16,6 @@ "use strict"; | ||
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); | ||
var http = _interopRequireWildcard(require("http")); | ||
var https = _interopRequireWildcard(require("https")); | ||
var axios = _interopRequireWildcard(require("axios")); | ||
var Faye = _interopRequireWildcard(require("faye")); | ||
var http = _interopRequireWildcard(require("http")); | ||
var https = _interopRequireWildcard(require("https")); | ||
var _jwtDecode = _interopRequireDefault(require("jwt-decode")); | ||
@@ -69,5 +69,3 @@ var _personalization = require("./personalization"); | ||
function StreamClient(apiKey, apiSecretOrToken, appId) { | ||
var _this = this, | ||
_process$env, | ||
_process$env2; | ||
var _this = this; | ||
var _options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; | ||
@@ -129,2 +127,5 @@ (0, _classCallCheck2.default)(this, StreamClient); | ||
} | ||
if (options.reactions.kinds != null) { | ||
options.reactionKindsFilter = options.reactions.kinds; | ||
} | ||
delete options.reactions; | ||
@@ -204,4 +205,11 @@ } | ||
this.baseUrl = this.getBaseUrl(); | ||
if (typeof process !== 'undefined' && (_process$env = process.env) !== null && _process$env !== void 0 && _process$env.LOCAL_FAYE) this.fayeUrl = 'http://localhost:9999/faye/'; | ||
if (typeof process !== 'undefined' && (_process$env2 = process.env) !== null && _process$env2 !== void 0 && _process$env2.STREAM_ANALYTICS_BASE_URL) this.baseAnalyticsUrl = process.env.STREAM_ANALYTICS_BASE_URL; | ||
if (typeof process !== 'undefined') { | ||
var _process$env, _process$env2; | ||
if ((_process$env = process.env) !== null && _process$env !== void 0 && _process$env.LOCAL_FAYE) { | ||
this.fayeUrl = 'http://localhost:9999/faye/'; | ||
} | ||
if ((_process$env2 = process.env) !== null && _process$env2 !== void 0 && _process$env2.STREAM_ANALYTICS_BASE_URL) { | ||
this.baseAnalyticsUrl = process.env.STREAM_ANALYTICS_BASE_URL; | ||
} | ||
} | ||
this.handlers = {}; | ||
@@ -361,3 +369,3 @@ this.node = typeof window === 'undefined'; // use for real browser vs node behavior | ||
value: function userAgent() { | ||
if (process.env.PACKAGE_VERSION === undefined) { | ||
if (process === undefined || process.env.PACKAGE_VERSION === undefined) { | ||
// eslint-disable-next-line | ||
@@ -461,3 +469,3 @@ return "stream-javascript-client-".concat(this.node ? 'node' : 'browser', "-").concat(require('../package.json').version); | ||
} | ||
return this.enrichByDefault || options.ownReactions != null || options.withRecentReactions != null || options.withReactionCounts != null || options.withOwnChildren != null; | ||
return this.enrichByDefault || options.ownReactions != null || options.reactionKindsFilter != null || options.withRecentReactions != null || options.withReactionCounts != null || options.withOwnChildren != null; | ||
} | ||
@@ -464,0 +472,0 @@ |
@@ -14,3 +14,3 @@ /// <reference path="../types/modules.d.ts" /> | ||
ownReactions?: boolean; | ||
reactionKindsFilter?: string; | ||
reactionKindsFilter?: string[]; | ||
recentReactionsLimit?: number; | ||
@@ -17,0 +17,0 @@ withOwnChildren?: boolean; |
@@ -14,3 +14,3 @@ { | ||
"license": "BSD-3-Clause", | ||
"version": "8.1.5", | ||
"version": "8.2.0", | ||
"scripts": { | ||
@@ -76,4 +76,4 @@ "changelog": "standard-version --release-as $VERSION --skip.tag --skip.commit --tag-prefix=v", | ||
"@commitlint/config-conventional": "^17.6.3", | ||
"@typescript-eslint/eslint-plugin": "^5.8.1", | ||
"@typescript-eslint/parser": "^5.8.1", | ||
"@typescript-eslint/eslint-plugin": "^6.2.1", | ||
"@typescript-eslint/parser": "^6.2.1", | ||
"babel-loader": "^9.1.2", | ||
@@ -84,7 +84,7 @@ "chai": "^4.3.4", | ||
"eslint-config-airbnb-base": "^15.0.0", | ||
"eslint-config-prettier": "^8.3.0", | ||
"eslint-config-prettier": "^9.0.0", | ||
"eslint-plugin-chai-friendly": "^0.7.2", | ||
"eslint-plugin-import": "^2.25.4", | ||
"eslint-plugin-prettier": "^4.0.0", | ||
"eslint-plugin-sonarjs": "^0.19.0", | ||
"eslint-plugin-prettier": "^5.0.0", | ||
"eslint-plugin-sonarjs": "^0.20.0", | ||
"eslint-plugin-typescript-sort-keys": "^2.1.0", | ||
@@ -104,3 +104,5 @@ "expect.js": "^0.3.1", | ||
"nyc": "^15.1.0", | ||
"prettier": "^2.5.1", | ||
"prettier": "^3.0.1", | ||
"puppeteer": "^21.0.1", | ||
"puppeteer-core": "^21.0.1", | ||
"request": "^2.88.2", | ||
@@ -123,4 +125,2 @@ "standard-version": "^9.3.2", | ||
"jwt-decode": "^3.1.2", | ||
"puppeteer": "^20.2.1", | ||
"puppeteer-core": "^20.2.1", | ||
"qs": "^6.10.2" | ||
@@ -127,0 +127,0 @@ }, |
@@ -287,3 +287,3 @@ # Official JavaScript SDK for [Stream Feeds](https://getstream.io/activity-feeds/) | ||
```ts | ||
import { connect, UR, EnrichedActivity, NotificationActivity } from getstream; | ||
import { connect, UR, EnrichedActivity, NotificationActivity } from 'getstream'; | ||
@@ -290,0 +290,0 @@ type User1Type = { name: string; username: string; image?: string }; |
/// <reference path="../types/modules.d.ts" /> | ||
import * as http from 'http'; | ||
import * as https from 'https'; | ||
import * as axios from 'axios'; | ||
import * as Faye from 'faye'; | ||
import * as http from 'http'; | ||
import * as https from 'https'; | ||
import jwtDecode from 'jwt-decode'; | ||
@@ -242,5 +242,10 @@ | ||
if (typeof process !== 'undefined' && process.env?.LOCAL_FAYE) this.fayeUrl = 'http://localhost:9999/faye/'; | ||
if (typeof process !== 'undefined' && process.env?.STREAM_ANALYTICS_BASE_URL) | ||
this.baseAnalyticsUrl = process.env.STREAM_ANALYTICS_BASE_URL; | ||
if (typeof process !== 'undefined') { | ||
if (process.env?.LOCAL_FAYE) { | ||
this.fayeUrl = 'http://localhost:9999/faye/'; | ||
} | ||
if (process.env?.STREAM_ANALYTICS_BASE_URL) { | ||
this.baseAnalyticsUrl = process.env.STREAM_ANALYTICS_BASE_URL; | ||
} | ||
} | ||
@@ -400,3 +405,3 @@ this.handlers = {}; | ||
userAgent() { | ||
if (process.env.PACKAGE_VERSION === undefined) { | ||
if (process === undefined || process.env.PACKAGE_VERSION === undefined) { | ||
// eslint-disable-next-line | ||
@@ -492,3 +497,4 @@ return `stream-javascript-client-${this.node ? 'node' : 'browser'}-${require('../package.json').version}`; | ||
replaceReactionOptions = (options: { | ||
reactions?: Record<string, boolean>; | ||
reactionKindsFilter?: string[]; | ||
reactions?: Record<string, boolean | string[]>; | ||
withOwnChildren?: boolean; | ||
@@ -502,13 +508,16 @@ withOwnReactions?: boolean; | ||
if (options.reactions.own != null) { | ||
options.withOwnReactions = options.reactions.own; | ||
options.withOwnReactions = options.reactions.own as boolean; | ||
} | ||
if (options.reactions.recent != null) { | ||
options.withRecentReactions = options.reactions.recent; | ||
options.withRecentReactions = options.reactions.recent as boolean; | ||
} | ||
if (options.reactions.counts != null) { | ||
options.withReactionCounts = options.reactions.counts; | ||
options.withReactionCounts = options.reactions.counts as boolean; | ||
} | ||
if (options.reactions.own_children != null) { | ||
options.withOwnChildren = options.reactions.own_children; | ||
options.withOwnChildren = options.reactions.own_children as boolean; | ||
} | ||
if (options.reactions.kinds != null) { | ||
options.reactionKindsFilter = options.reactions.kinds as string[]; | ||
} | ||
delete options.reactions; | ||
@@ -522,2 +531,3 @@ } | ||
ownReactions?: boolean; | ||
reactionKindsFilter?: string[]; | ||
withOwnChildren?: boolean; | ||
@@ -537,2 +547,3 @@ withReactionCounts?: boolean; | ||
options.ownReactions != null || | ||
options.reactionKindsFilter != null || | ||
options.withRecentReactions != null || | ||
@@ -539,0 +550,0 @@ options.withReactionCounts != null || |
@@ -19,3 +19,3 @@ /// <reference path="../types/modules.d.ts" /> | ||
ownReactions?: boolean; // best not to use it, will be removed by client.replaceReactionOptions() | ||
reactionKindsFilter?: string; // TODO: add support for array sample: kind,kind,kind | ||
reactionKindsFilter?: string[]; // TODO: add support for array sample: kind,kind,kind | ||
recentReactionsLimit?: number; | ||
@@ -22,0 +22,0 @@ withOwnChildren?: boolean; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Possible typosquat attack
Supply chain riskThere is a package with a similar name that is downloaded much more often.
Did you mean |
---|
get-stream |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
814504
11
16497
0
48
- Removedpuppeteer@^20.2.1
- Removedpuppeteer-core@^20.2.1
- Removed@babel/code-frame@7.26.2(transitive)
- Removed@babel/helper-validator-identifier@7.25.9(transitive)
- Removed@puppeteer/browsers@1.4.6(transitive)
- Removed@tootallnate/quickjs-emscripten@0.23.0(transitive)
- Removed@types/yauzl@2.10.3(transitive)
- Removedagent-base@7.1.1(transitive)
- Removedansi-regex@5.0.1(transitive)
- Removedansi-styles@4.3.0(transitive)
- Removedargparse@2.0.1(transitive)
- Removedast-types@0.13.4(transitive)
- Removedb4a@1.6.7(transitive)
- Removedbare-events@2.5.0(transitive)
- Removedbase64-js@1.5.1(transitive)
- Removedbasic-ftp@5.0.5(transitive)
- Removedbuffer@5.7.1(transitive)
- Removedbuffer-crc32@0.2.13(transitive)
- Removedcallsites@3.1.0(transitive)
- Removedchromium-bidi@0.4.16(transitive)
- Removedcliui@8.0.1(transitive)
- Removedcolor-convert@2.0.1(transitive)
- Removedcolor-name@1.1.4(transitive)
- Removedcosmiconfig@8.2.0(transitive)
- Removedcross-fetch@4.0.0(transitive)
- Removeddata-uri-to-buffer@6.0.2(transitive)
- Removeddebug@4.3.4(transitive)
- Removeddegenerator@5.0.1(transitive)
- Removeddevtools-protocol@0.0.1147663(transitive)
- Removedemoji-regex@8.0.0(transitive)
- Removedend-of-stream@1.4.4(transitive)
- Removederror-ex@1.3.2(transitive)
- Removedescalade@3.2.0(transitive)
- Removedescodegen@2.1.0(transitive)
- Removedesprima@4.0.1(transitive)
- Removedestraverse@5.3.0(transitive)
- Removedesutils@2.0.3(transitive)
- Removedextract-zip@2.0.1(transitive)
- Removedfast-fifo@1.3.2(transitive)
- Removedfd-slicer@1.1.0(transitive)
- Removedfs-extra@11.2.0(transitive)
- Removedget-caller-file@2.0.5(transitive)
- Removedget-stream@5.2.0(transitive)
- Removedget-uri@6.0.3(transitive)
- Removedgraceful-fs@4.2.11(transitive)
- Removedhttp-proxy-agent@7.0.2(transitive)
- Removedhttps-proxy-agent@7.0.5(transitive)
- Removedieee754@1.2.1(transitive)
- Removedimport-fresh@3.3.0(transitive)
- Removedip-address@9.0.5(transitive)
- Removedis-arrayish@0.2.1(transitive)
- Removedis-fullwidth-code-point@3.0.0(transitive)
- Removedjs-tokens@4.0.0(transitive)
- Removedjs-yaml@4.1.0(transitive)
- Removedjsbn@1.1.0(transitive)
- Removedjson-parse-even-better-errors@2.3.1(transitive)
- Removedjsonfile@6.1.0(transitive)
- Removedlines-and-columns@1.2.4(transitive)
- Removedlru-cache@7.18.3(transitive)
- Removedmitt@3.0.0(transitive)
- Removedmkdirp-classic@0.5.3(transitive)
- Removedms@2.1.2(transitive)
- Removednetmask@2.0.2(transitive)
- Removednode-fetch@2.7.0(transitive)
- Removedonce@1.4.0(transitive)
- Removedpac-proxy-agent@7.0.2(transitive)
- Removedpac-resolver@7.0.1(transitive)
- Removedparent-module@1.0.1(transitive)
- Removedparse-json@5.2.0(transitive)
- Removedpath-type@4.0.0(transitive)
- Removedpend@1.2.0(transitive)
- Removedpicocolors@1.1.1(transitive)
- Removedprogress@2.0.3(transitive)
- Removedproxy-agent@6.3.0(transitive)
- Removedpump@3.0.2(transitive)
- Removedpuppeteer@20.9.0(transitive)
- Removedpuppeteer-core@20.9.0(transitive)
- Removedqueue-tick@1.0.1(transitive)
- Removedrequire-directory@2.1.1(transitive)
- Removedresolve-from@4.0.0(transitive)
- Removedsmart-buffer@4.2.0(transitive)
- Removedsocks@2.8.3(transitive)
- Removedsocks-proxy-agent@8.0.4(transitive)
- Removedsource-map@0.6.1(transitive)
- Removedsprintf-js@1.1.3(transitive)
- Removedstreamx@2.20.2(transitive)
- Removedstring-width@4.2.3(transitive)
- Removedstrip-ansi@6.0.1(transitive)
- Removedtar-fs@3.0.4(transitive)
- Removedtar-stream@3.1.7(transitive)
- Removedtext-decoder@1.2.1(transitive)
- Removedthrough@2.3.8(transitive)
- Removedtr46@0.0.3(transitive)
- Removedtslib@2.8.1(transitive)
- Removedunbzip2-stream@1.4.3(transitive)
- Removeduniversalify@2.0.1(transitive)
- Removedwebidl-conversions@3.0.1(transitive)
- Removedwhatwg-url@5.0.0(transitive)
- Removedwrap-ansi@7.0.0(transitive)
- Removedwrappy@1.0.2(transitive)
- Removedws@8.13.0(transitive)
- Removedy18n@5.0.8(transitive)
- Removedyargs@17.7.1(transitive)
- Removedyargs-parser@21.1.1(transitive)
- Removedyauzl@2.10.0(transitive)