@nlabs/reaktor 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.vscode/extensions.json +15 -0
- package/.vscode/settings.json +82 -0
- package/README.md +211 -0
- package/index.d.ts +1 -0
- package/index.js +5 -0
- package/lex.config.js +4 -0
- package/lib/config.d.ts +21 -0
- package/lib/config.js +127 -0
- package/lib/data/conversations.d.ts +6 -0
- package/lib/data/conversations.js +201 -0
- package/lib/data/dynamodb.d.ts +8 -0
- package/lib/data/dynamodb.js +139 -0
- package/lib/data/email.d.ts +7 -0
- package/lib/data/email.js +164 -0
- package/lib/data/files.d.ts +16 -0
- package/lib/data/files.js +407 -0
- package/lib/data/groups.d.ts +13 -0
- package/lib/data/groups.js +354 -0
- package/lib/data/images.d.ts +12 -0
- package/lib/data/images.js +668 -0
- package/lib/data/index.d.ts +19 -0
- package/lib/data/index.js +24 -0
- package/lib/data/ios.d.ts +6 -0
- package/lib/data/ios.js +302 -0
- package/lib/data/locations.d.ts +3 -0
- package/lib/data/locations.js +132 -0
- package/lib/data/messages.d.ts +9 -0
- package/lib/data/messages.js +248 -0
- package/lib/data/notifications.d.ts +5 -0
- package/lib/data/notifications.js +42 -0
- package/lib/data/payments.d.ts +11 -0
- package/lib/data/payments.js +748 -0
- package/lib/data/posts.d.ts +14 -0
- package/lib/data/posts.js +458 -0
- package/lib/data/reactions.d.ts +6 -0
- package/lib/data/reactions.js +218 -0
- package/lib/data/s3.d.ts +6 -0
- package/lib/data/s3.js +103 -0
- package/lib/data/search.d.ts +3 -0
- package/lib/data/search.js +98 -0
- package/lib/data/sms.d.ts +3 -0
- package/lib/data/sms.js +59 -0
- package/lib/data/subscription.d.ts +7 -0
- package/lib/data/subscription.js +284 -0
- package/lib/data/tags.d.ts +14 -0
- package/lib/data/tags.js +304 -0
- package/lib/data/users.d.ts +12 -0
- package/lib/data/users.js +312 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.js +8 -0
- package/lib/types/apps.d.ts +44 -0
- package/lib/types/apps.js +2 -0
- package/lib/types/arangodb.d.ts +17 -0
- package/lib/types/arangodb.js +2 -0
- package/lib/types/auth.d.ts +9 -0
- package/lib/types/auth.js +2 -0
- package/lib/types/conversations.d.ts +6 -0
- package/lib/types/conversations.js +2 -0
- package/lib/types/email.d.ts +12 -0
- package/lib/types/email.js +2 -0
- package/lib/types/files.d.ts +28 -0
- package/lib/types/files.js +2 -0
- package/lib/types/google.d.ts +27 -0
- package/lib/types/google.js +2 -0
- package/lib/types/groups.d.ts +22 -0
- package/lib/types/groups.js +2 -0
- package/lib/types/images.d.ts +25 -0
- package/lib/types/images.js +2 -0
- package/lib/types/index.d.ts +17 -0
- package/lib/types/index.js +22 -0
- package/lib/types/locations.d.ts +21 -0
- package/lib/types/locations.js +2 -0
- package/lib/types/messages.d.ts +12 -0
- package/lib/types/messages.js +2 -0
- package/lib/types/notifications.d.ts +19 -0
- package/lib/types/notifications.js +2 -0
- package/lib/types/payments.d.ts +119 -0
- package/lib/types/payments.js +2 -0
- package/lib/types/posts.d.ts +20 -0
- package/lib/types/posts.js +2 -0
- package/lib/types/reactions.d.ts +4 -0
- package/lib/types/reactions.js +2 -0
- package/lib/types/tags.d.ts +10 -0
- package/lib/types/tags.js +2 -0
- package/lib/types/users.d.ts +78 -0
- package/lib/types/users.js +2 -0
- package/lib/utils/analytics.d.ts +3 -0
- package/lib/utils/analytics.js +47 -0
- package/lib/utils/arangodb.d.ts +9 -0
- package/lib/utils/arangodb.js +98 -0
- package/lib/utils/auth.d.ts +2 -0
- package/lib/utils/auth.js +43 -0
- package/lib/utils/index.d.ts +5 -0
- package/lib/utils/index.js +10 -0
- package/lib/utils/objects.d.ts +3 -0
- package/lib/utils/objects.js +34 -0
- package/lib/utils/redis.d.ts +1 -0
- package/lib/utils/redis.js +15 -0
- package/package.json +75 -0
- package/src/config.ts +121 -0
- package/src/data/conversations.ts +183 -0
- package/src/data/dynamodb.ts +157 -0
- package/src/data/email.ts +164 -0
- package/src/data/files.ts +352 -0
- package/src/data/groups.ts +308 -0
- package/src/data/images.ts +606 -0
- package/src/data/index.ts +23 -0
- package/src/data/ios.ts +249 -0
- package/src/data/locations.ts +114 -0
- package/src/data/messages.ts +237 -0
- package/src/data/notifications.ts +48 -0
- package/src/data/payments.ts +675 -0
- package/src/data/posts.ts +508 -0
- package/src/data/reactions.ts +186 -0
- package/src/data/s3.ts +117 -0
- package/src/data/search.ts +74 -0
- package/src/data/sms.ts +60 -0
- package/src/data/subscription.ts +228 -0
- package/src/data/tags.ts +230 -0
- package/src/data/users.ts +256 -0
- package/src/index.ts +7 -0
- package/src/types/apps.ts +57 -0
- package/src/types/arangodb.ts +23 -0
- package/src/types/auth.ts +19 -0
- package/src/types/conversations.ts +11 -0
- package/src/types/email.ts +17 -0
- package/src/types/files.ts +33 -0
- package/src/types/google.ts +37 -0
- package/src/types/groups.ts +28 -0
- package/src/types/images.ts +33 -0
- package/src/types/index.ts +21 -0
- package/src/types/locations.ts +25 -0
- package/src/types/messages.ts +16 -0
- package/src/types/notifications.ts +26 -0
- package/src/types/payments.ts +134 -0
- package/src/types/posts.ts +25 -0
- package/src/types/reactions.ts +8 -0
- package/src/types/tags.ts +14 -0
- package/src/types/users.ts +89 -0
- package/src/utils/analytics.ts +41 -0
- package/src/utils/arangodb.ts +100 -0
- package/src/utils/auth.ts +28 -0
- package/src/utils/index.ts +9 -0
- package/src/utils/objects.ts +34 -0
- package/src/utils/redis.ts +17 -0
- package/templates/email/layout.html +279 -0
- package/templates/email/passwordForgot.html +15 -0
- package/templates/email/passwordRecovery.html +12 -0
- package/templates/email/verifyEmail.html +15 -0
- package/templates/sms/passwordForgot.txt +1 -0
- package/templates/sms/passwordRecovery.txt +1 -0
- package/templates/sms/verifyEmail.txt +1 -0
- package/templates/sms/verifyPhone.txt +1 -0
- package/tsconfig.json +45 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"recommendations": [
|
|
3
|
+
"dbaeumer.vscode-eslint",
|
|
4
|
+
"streetsidesoftware.code-spell-checker",
|
|
5
|
+
"bierner.markdown-preview-github-styles",
|
|
6
|
+
"DavidAnson.vscode-markdownlint",
|
|
7
|
+
"ricard.postcss",
|
|
8
|
+
"shinnn.stylelint",
|
|
9
|
+
"jpoissonnier.vscode-styled-components",
|
|
10
|
+
"flowtype.flow-for-vscode",
|
|
11
|
+
"rbbit.typescript-hero",
|
|
12
|
+
"Equinusocio.vsc-material-theme",
|
|
13
|
+
"PKief.material-icon-theme"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
{
|
|
2
|
+
"cSpell.words": [
|
|
3
|
+
"arkham",
|
|
4
|
+
"arkhamjs",
|
|
5
|
+
"nitrogenlabs",
|
|
6
|
+
"nlabs",
|
|
7
|
+
"polyfill",
|
|
8
|
+
"transpiler"
|
|
9
|
+
],
|
|
10
|
+
"css.validate": false,
|
|
11
|
+
"editor.autoClosingBrackets": "never",
|
|
12
|
+
"editor.detectIndentation": false,
|
|
13
|
+
"editor.formatOnSave": true,
|
|
14
|
+
"editor.rulers": [
|
|
15
|
+
120
|
|
16
|
+
],
|
|
17
|
+
"editor.tabCompletion": "on",
|
|
18
|
+
"editor.tabSize": 2,
|
|
19
|
+
"editor.wordWrap": "off",
|
|
20
|
+
"editor.wordWrapColumn": 120,
|
|
21
|
+
"editor.wrappingIndent": "indent",
|
|
22
|
+
"emmet.includeLanguages": {
|
|
23
|
+
"postcss": "css"
|
|
24
|
+
},
|
|
25
|
+
"emmet.syntaxProfiles": {
|
|
26
|
+
"postcss": "css"
|
|
27
|
+
},
|
|
28
|
+
"eslint.autoFixOnSave": true,
|
|
29
|
+
"eslint.alwaysShowStatus": true,
|
|
30
|
+
"eslint.enable": true,
|
|
31
|
+
"eslint.packageManager": "yarn",
|
|
32
|
+
"eslint.validate": [
|
|
33
|
+
{
|
|
34
|
+
"language": "javascript",
|
|
35
|
+
"autoFix": true
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"language": "javascriptreact",
|
|
39
|
+
"autoFix": true
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"language": "typescript",
|
|
43
|
+
"autoFix": true
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"language": "typescriptreact",
|
|
47
|
+
"autoFix": true
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
"explorer.decorations.badges": false,
|
|
51
|
+
"files.autoSave": "onFocusChange",
|
|
52
|
+
"html.format.indentInnerHtml": true,
|
|
53
|
+
"html.format.indentHandlebars": true,
|
|
54
|
+
"html.suggest.html5": false,
|
|
55
|
+
"explorer.confirmDragAndDrop": false,
|
|
56
|
+
"files.trimTrailingWhitespace": true,
|
|
57
|
+
"javascript.autoClosingTags": false,
|
|
58
|
+
"javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false,
|
|
59
|
+
"javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": false,
|
|
60
|
+
"javascript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions": false,
|
|
61
|
+
"javascript.format.insertSpaceAfterKeywordsInControlFlowStatements": false,
|
|
62
|
+
"javascript.updateImportsOnFileMove.enabled": "never",
|
|
63
|
+
"html.autoClosingTags": false,
|
|
64
|
+
"html.format.enable": false,
|
|
65
|
+
"html.format.endWithNewline": true,
|
|
66
|
+
"html.format.extraLiners": "",
|
|
67
|
+
"typescript.autoClosingTags": false,
|
|
68
|
+
"typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false,
|
|
69
|
+
"typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": false,
|
|
70
|
+
"typescript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions": false,
|
|
71
|
+
"typescript.format.insertSpaceAfterKeywordsInControlFlowStatements": false,
|
|
72
|
+
"typescript.updateImportsOnFileMove.enabled": "never",
|
|
73
|
+
"typescriptHero.imports.insertSpaceBeforeAndAfterImportBraces": false,
|
|
74
|
+
"typescriptHero.imports.multiLineTrailingComma": false,
|
|
75
|
+
"typescriptHero.imports.multiLineWrapThreshold": 120,
|
|
76
|
+
"typescriptHero.imports.organizeOnSave": true,
|
|
77
|
+
"window.zoomLevel": 0,
|
|
78
|
+
"javascript.preferences.importModuleSpecifier": "relative",
|
|
79
|
+
"javascript.preferences.quoteStyle": "single",
|
|
80
|
+
"typescript.preferences.importModuleSpecifier": "relative",
|
|
81
|
+
"typescript.preferences.quoteStyle": "single",
|
|
82
|
+
}
|
package/README.md
ADDED
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
Reaktor
|
|
2
|
+
=======
|
|
3
|
+
|
|
4
|
+
A simple skeleton to start you off on your ReactJS project. Uses a Flux framework and Falcor for data.
|
|
5
|
+
|
|
6
|
+
Getting Started
|
|
7
|
+
---------------
|
|
8
|
+
|
|
9
|
+
- Download the lastest version of [ArangoDB](https://www.arangodb.com/download/) and install.
|
|
10
|
+
- Clone the repo and install the necessary node modules:
|
|
11
|
+
|
|
12
|
+
```shell
|
|
13
|
+
$ npm install # Install Node modules listed in ./package.json (may take a while the first time)
|
|
14
|
+
$ npm install -g nodemon # Install Nodemon
|
|
15
|
+
$ gulp # Compile and launch
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Usage
|
|
19
|
+
-----
|
|
20
|
+
|
|
21
|
+
#### `gulp` also `gulp dev`
|
|
22
|
+
Runs the webpack build system just like in `compile` but enables HMR. The webpack dev server can be found at `localhost:3000`.
|
|
23
|
+
|
|
24
|
+
#### `gulp compile`
|
|
25
|
+
Runs the Webpack build system with your current NODE_ENV and compiles the application to disk (`~/dist`). Production builds will fail on eslint errors (but not on warnings).
|
|
26
|
+
|
|
27
|
+
#### `gulp test`
|
|
28
|
+
Runs unit tests with Karma.
|
|
29
|
+
|
|
30
|
+
#### `gulp deploy`
|
|
31
|
+
Helper script to run tests and then, on success, compile your application.
|
|
32
|
+
|
|
33
|
+
#### `gulp db:get:s3`
|
|
34
|
+
Get a copy of the latest database data from S3 and import into your local database
|
|
35
|
+
|
|
36
|
+
#### `gulp db:get:direct`
|
|
37
|
+
Get a copy of the latest database data from the production database and import into your local database
|
|
38
|
+
|
|
39
|
+
#### `gulp db:save`
|
|
40
|
+
Get a copy of the latest database data from the production database and save to S3
|
|
41
|
+
|
|
42
|
+
### Configuration
|
|
43
|
+
|
|
44
|
+
Basic project configuration can be found in `~/src/config.js`. Here you'll be able to redefine your src and dist directories, as well as tweak what ports Webpack and WebpackDevServer run on.
|
|
45
|
+
|
|
46
|
+
Structure
|
|
47
|
+
---------
|
|
48
|
+
|
|
49
|
+
The folder structure provided is only meant to serve as a guide, it is by no means prescriptive. It is something that has worked very well for me and my team, but use only what makes sense to you.
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
.
|
|
53
|
+
├── bin # Build/Start scripts
|
|
54
|
+
├── build # All build-related configuration
|
|
55
|
+
│ ├── webpack # Environment-specific configuration files for Webpack
|
|
56
|
+
| ├── config.js # Project configuration settings
|
|
57
|
+
| ├── karma.js # Karma configuration settings
|
|
58
|
+
└── src # Application source code
|
|
59
|
+
├── components # React Components
|
|
60
|
+
├── containers # Components that provide context (e.g. Redux Providers)
|
|
61
|
+
├── layouts # Components that dictate major page structure
|
|
62
|
+
├── reducers # Redux reducers
|
|
63
|
+
├── routes # Application route definitions
|
|
64
|
+
├── stores # Redux store configuration
|
|
65
|
+
├── utils # Utilities
|
|
66
|
+
├── views # Components that live at a route
|
|
67
|
+
└── index.js # Application bootstrap and rendering
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Components vs. Views vs. Layouts
|
|
71
|
+
|
|
72
|
+
**TL;DR:** They're all components.
|
|
73
|
+
|
|
74
|
+
This distinction may not be important for you, but as an explanation: A **Layout** is something that describes an entire page structure, such as a fixed navigation, viewport, sidebar, and footer. Most applications will probably only have one layout, but keeping these components separate makes their intent clear. **Views** are components that live at routes, and are generally rendered within a **Layout**. What this ends up meaning is that, with this structure, nearly everything inside of **Components** ends up being a dumb component.
|
|
75
|
+
|
|
76
|
+
Webpack
|
|
77
|
+
-------
|
|
78
|
+
|
|
79
|
+
### Configuration
|
|
80
|
+
The webpack compiler configuration is located in `~/build/webpack`. When the webpack dev server runs, only the client compiler will be used. When webpack itself is run to compile to disk, both the client and server configurations will be used. Settings that are bundle agnostic should be defined in `~/src/config.js` and imported where needed.
|
|
81
|
+
|
|
82
|
+
### Vendor Bundle
|
|
83
|
+
You can redefine which packages to treat as vendor dependencies by editing `vendor_dependencies` in `~/config/index.js`. These default to:
|
|
84
|
+
|
|
85
|
+
```js
|
|
86
|
+
[
|
|
87
|
+
'arkhamjs',
|
|
88
|
+
'history',
|
|
89
|
+
'react',
|
|
90
|
+
'react-router',
|
|
91
|
+
'venomcss',
|
|
92
|
+
]
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Aliases
|
|
96
|
+
As mentioned in features, the default Webpack configuration provides some globals and aliases to make your life easier. These can be used as such:
|
|
97
|
+
|
|
98
|
+
```js
|
|
99
|
+
import MyComponent from '../../components/my-component'; // without alias
|
|
100
|
+
import MyComponent from 'components/my-component'; // with alias
|
|
101
|
+
|
|
102
|
+
// Available aliases:
|
|
103
|
+
actions => '~/src/actions'
|
|
104
|
+
components => '~/src/components'
|
|
105
|
+
constants => '~/src/constants'
|
|
106
|
+
containers => '~/src/containers'
|
|
107
|
+
layouts => '~/src/layouts'
|
|
108
|
+
reducers => '~/src/reducers'
|
|
109
|
+
routes => '~/src/routes'
|
|
110
|
+
services => '~/src/services'
|
|
111
|
+
styles => '~/src/styles'
|
|
112
|
+
utils => '~/src/utils'
|
|
113
|
+
views => '~/src/views'
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Globals
|
|
117
|
+
|
|
118
|
+
#### `__DEV__`
|
|
119
|
+
True when `process.env.NODE_ENV` is `development`
|
|
120
|
+
|
|
121
|
+
#### `__PROD__`
|
|
122
|
+
True when `process.env.NODE_ENV` is `production`
|
|
123
|
+
|
|
124
|
+
#### `__DEBUG__`
|
|
125
|
+
True when the compiler is run with `--debug` (any environment).
|
|
126
|
+
|
|
127
|
+
Styles
|
|
128
|
+
------
|
|
129
|
+
|
|
130
|
+
All `.scss` imports will be run through the sass-loader, extracted during production builds, and ignored during server builds. If you're requiring styles from a base styles directory (useful for generic, app-wide styles) in your JS, you can make use of the `styles` alias, e.g.:
|
|
131
|
+
|
|
132
|
+
```js
|
|
133
|
+
// ~/src/components/some/nested/component/index.jsx
|
|
134
|
+
import `styles/core.scss`;
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Furthermore, this `styles` directory is aliased for sass imports, which further eliminates manual directory traversing. An example nested `.scss` file:
|
|
138
|
+
|
|
139
|
+
```scss
|
|
140
|
+
// current path: ~/src/styles/some/nested/style.scss
|
|
141
|
+
// what used to be this:
|
|
142
|
+
@import '../../base';
|
|
143
|
+
|
|
144
|
+
// can now be this:
|
|
145
|
+
@import 'base';
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Database
|
|
149
|
+
-------
|
|
150
|
+
- Install the latest MacOS [binary](https://www.arangodb.com/download/macosx/) into the Applications directory.
|
|
151
|
+
- Create the database `reaktor`.
|
|
152
|
+
- Run the gulp import task to import the latest data into your local database.
|
|
153
|
+
|
|
154
|
+
```
|
|
155
|
+
gulp db:get:s3
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
Testing
|
|
159
|
+
-------
|
|
160
|
+
|
|
161
|
+
To add a unit test, simply create `.spec.js` file anywhere in `~/test`. All imports will be relative to the "~/src" directory. The entry point for Karma uses webpack's custom require to load all these files, and Jasmine will be available to you within your test without the need to import them.
|
|
162
|
+
|
|
163
|
+
Utilities
|
|
164
|
+
---------
|
|
165
|
+
|
|
166
|
+
This boilerplate comes with two simple utilities (thanks to [StevenLangbroek](https://github.com/StevenLangbroek)) to help speed up your Redux development process. In `~/client/utils` you'll find exports for `createConstants` and `createReducer`. The former is pretty much an even lazier `keyMirror`, so if you _really_ hate typing out those constants you may want to give it a shot. Check it out:
|
|
167
|
+
|
|
168
|
+
```js
|
|
169
|
+
import { createConstants } from 'utils';
|
|
170
|
+
|
|
171
|
+
export default createConstants(
|
|
172
|
+
'TODO_CREATE',
|
|
173
|
+
'TODO_DESTROY',
|
|
174
|
+
'TODO_TOGGLE_COMPLETE'
|
|
175
|
+
);
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
The other utility, `create-reducer`, is designed to expedite creating reducers when they're defined via an object map rather than switch statements. As an example, what once looked like this:
|
|
179
|
+
|
|
180
|
+
```js
|
|
181
|
+
import { TODO_CREATE } from 'constants/todo';
|
|
182
|
+
|
|
183
|
+
const initialState = [];
|
|
184
|
+
const handlers = {
|
|
185
|
+
[TODO_CREATE] : (state, payload) => { ... }
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
export default function todo (state = initialState, action) {
|
|
189
|
+
const handler = handlers[action.type];
|
|
190
|
+
|
|
191
|
+
return handler ? handler(state, action.payload) : state;
|
|
192
|
+
}
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
Can now look like this:
|
|
196
|
+
|
|
197
|
+
```js
|
|
198
|
+
import { TODO_CREATE } from 'constants/todo';
|
|
199
|
+
import { createReducer } from 'utils';
|
|
200
|
+
|
|
201
|
+
const initialState = [];
|
|
202
|
+
|
|
203
|
+
export default createReducer(initialState, {
|
|
204
|
+
[TODO_CREATE] : (state, payload) => { ... }
|
|
205
|
+
});
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
Troubleshooting
|
|
209
|
+
---------------
|
|
210
|
+
|
|
211
|
+
Nothing yet. Having an issue? Report it and I'll get to it as soon as possible!
|
package/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './lib';
|
package/index.js
ADDED
package/lex.config.js
ADDED
package/lib/config.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface AppConfig {
|
|
2
|
+
readonly app?: object;
|
|
3
|
+
readonly arangodb?: object;
|
|
4
|
+
readonly aws?: object;
|
|
5
|
+
readonly giphy?: object;
|
|
6
|
+
readonly google?: object;
|
|
7
|
+
readonly image?: object;
|
|
8
|
+
readonly redis?: object;
|
|
9
|
+
readonly stripe?: object;
|
|
10
|
+
readonly twilio?: object;
|
|
11
|
+
}
|
|
12
|
+
export interface EnvConfig {
|
|
13
|
+
readonly default: AppConfig;
|
|
14
|
+
readonly development: AppConfig;
|
|
15
|
+
readonly production: AppConfig;
|
|
16
|
+
readonly test: AppConfig;
|
|
17
|
+
}
|
|
18
|
+
export declare class Config {
|
|
19
|
+
static values: EnvConfig;
|
|
20
|
+
static get(path: string | string[]): any;
|
|
21
|
+
}
|
package/lib/config.js
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
2
|
+
|
|
3
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
4
|
+
|
|
5
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
6
|
+
|
|
7
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Copyright (c) 2019-Present, Nitrogen Labs, Inc.
|
|
11
|
+
* Copyrights licensed under the MIT License. See the accompanying LICENSE file for terms.
|
|
12
|
+
*/
|
|
13
|
+
import _get from 'lodash/get';
|
|
14
|
+
import merge from 'lodash/merge';
|
|
15
|
+
|
|
16
|
+
var appPackage = require('../package.json');
|
|
17
|
+
|
|
18
|
+
var _process$env = process.env,
|
|
19
|
+
arangodbDatabase = _process$env.arangodbDatabase,
|
|
20
|
+
arangodbPassword = _process$env.arangodbPassword,
|
|
21
|
+
_process$env$arangodb = _process$env.arangodbPort,
|
|
22
|
+
arangodbPort = _process$env$arangodb === void 0 ? '8529' : _process$env$arangodb,
|
|
23
|
+
arangodbUrl = _process$env.arangodbUrl,
|
|
24
|
+
arangodbUsername = _process$env.arangodbUsername;
|
|
25
|
+
export var Config =
|
|
26
|
+
/*#__PURE__*/
|
|
27
|
+
function () {
|
|
28
|
+
function Config() {
|
|
29
|
+
_classCallCheck(this, Config);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
_createClass(Config, null, [{
|
|
33
|
+
key: "get",
|
|
34
|
+
value: function get(path) {
|
|
35
|
+
var environment = process.env.stage || 'development';
|
|
36
|
+
var configValues = merge(this.values.default, this.values[environment], {
|
|
37
|
+
environment: environment
|
|
38
|
+
});
|
|
39
|
+
return _get(configValues, path);
|
|
40
|
+
}
|
|
41
|
+
}]);
|
|
42
|
+
|
|
43
|
+
return Config;
|
|
44
|
+
}();
|
|
45
|
+
|
|
46
|
+
_defineProperty(Config, "values", {
|
|
47
|
+
default: {
|
|
48
|
+
app: {
|
|
49
|
+
name: 'reaktor',
|
|
50
|
+
url: 'reaktor.io',
|
|
51
|
+
version: appPackage.version
|
|
52
|
+
},
|
|
53
|
+
arangodb: {
|
|
54
|
+
apiUrl: "http://".concat(arangodbUsername, ":").concat(arangodbPassword, "@").concat(arangodbUrl, ":").concat(arangodbPort),
|
|
55
|
+
database: arangodbDatabase,
|
|
56
|
+
dump: '/Applications/ArangoDB-CLI.app/Contents/MacOS/arangodump',
|
|
57
|
+
password: arangodbPassword,
|
|
58
|
+
port: arangodbPort,
|
|
59
|
+
restore: '/Applications/ArangoDB-CLI.app/Contents/MacOS/arangorestore',
|
|
60
|
+
url: arangodbUrl,
|
|
61
|
+
username: arangodbUsername
|
|
62
|
+
},
|
|
63
|
+
aws: {
|
|
64
|
+
Bucket: 'dev.reaktor.io',
|
|
65
|
+
accessKeyId: 'AKIAJIYDT3EA2ZFMTJNA',
|
|
66
|
+
maxRetries: 3,
|
|
67
|
+
region: 'us-east-1',
|
|
68
|
+
secretAccessKey: 'bUssQRtJTZC7geF9RDH5KCn8CalVnf2VT34yqS+9',
|
|
69
|
+
signatureVersion: 'v4'
|
|
70
|
+
},
|
|
71
|
+
giphy: {
|
|
72
|
+
key: 'dc6zaTOxFJmzC'
|
|
73
|
+
},
|
|
74
|
+
google: {
|
|
75
|
+
analytics: {
|
|
76
|
+
accountId: '78158717',
|
|
77
|
+
trackingId: 'UA-78158717-1'
|
|
78
|
+
},
|
|
79
|
+
geocode: {
|
|
80
|
+
key: 'AIzaSyBwjmpBjWhiJoBCZiYzRurM9m4WnCxslv0',
|
|
81
|
+
url: 'https://maps.googleapis.com/maps/api/geocode/json'
|
|
82
|
+
},
|
|
83
|
+
key: 'AIzaSyC3_f2Us3y0qjbyMJ-4t5ObtCzfq_FHIgQ'
|
|
84
|
+
},
|
|
85
|
+
image: {
|
|
86
|
+
imgQuality: 90,
|
|
87
|
+
imgSize: 1500,
|
|
88
|
+
thmQuality: 80,
|
|
89
|
+
thmSize: 150
|
|
90
|
+
},
|
|
91
|
+
redis: {
|
|
92
|
+
host: '127.0.0.1',
|
|
93
|
+
port: 6379
|
|
94
|
+
},
|
|
95
|
+
stripe: {
|
|
96
|
+
token: 'sk_test_LS956be57YUXTB5a4sLGb5BQ'
|
|
97
|
+
},
|
|
98
|
+
twilio: {
|
|
99
|
+
number: '+15005550006',
|
|
100
|
+
sid: 'AC6bd7f513cbed2e5134c650be06cc732e',
|
|
101
|
+
token: '520ae739e761bab759b147f1ad28278f'
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
development: {},
|
|
105
|
+
production: {
|
|
106
|
+
arangodb: {
|
|
107
|
+
dump: '/usr/bin/arangodump',
|
|
108
|
+
restore: '/usr/bin/arangorestore'
|
|
109
|
+
},
|
|
110
|
+
aws: {
|
|
111
|
+
Bucket: 'box.reaktor.io'
|
|
112
|
+
},
|
|
113
|
+
redis: {
|
|
114
|
+
host: 'reaktor-redis.ehcvnt.0001.use1.cache.amazonaws.com'
|
|
115
|
+
},
|
|
116
|
+
stripe: {
|
|
117
|
+
token: 'sk_live_bElZl8RLhMCJy33KG4lyLD4o'
|
|
118
|
+
},
|
|
119
|
+
twilio: {
|
|
120
|
+
number: '+18554165227',
|
|
121
|
+
sid: 'AC90b0528a911e652d643329a4d7b4d2c7',
|
|
122
|
+
token: 'a7941d173bd4846d0966a186e9865b72'
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
test: {}
|
|
126
|
+
});
|
|
127
|
+
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9jb25maWcudHMiXSwibmFtZXMiOlsiZ2V0IiwibWVyZ2UiLCJhcHBQYWNrYWdlIiwicmVxdWlyZSIsInByb2Nlc3MiLCJlbnYiLCJhcmFuZ29kYkRhdGFiYXNlIiwiYXJhbmdvZGJQYXNzd29yZCIsImFyYW5nb2RiUG9ydCIsImFyYW5nb2RiVXJsIiwiYXJhbmdvZGJVc2VybmFtZSIsIkNvbmZpZyIsInBhdGgiLCJlbnZpcm9ubWVudCIsInN0YWdlIiwiY29uZmlnVmFsdWVzIiwidmFsdWVzIiwiZGVmYXVsdCIsImFwcCIsIm5hbWUiLCJ1cmwiLCJ2ZXJzaW9uIiwiYXJhbmdvZGIiLCJhcGlVcmwiLCJkYXRhYmFzZSIsImR1bXAiLCJwYXNzd29yZCIsInBvcnQiLCJyZXN0b3JlIiwidXNlcm5hbWUiLCJhd3MiLCJCdWNrZXQiLCJhY2Nlc3NLZXlJZCIsIm1heFJldHJpZXMiLCJyZWdpb24iLCJzZWNyZXRBY2Nlc3NLZXkiLCJzaWduYXR1cmVWZXJzaW9uIiwiZ2lwaHkiLCJrZXkiLCJnb29nbGU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TQxNjUyMjcnLFxuICAgICAgICBzaWQ6ICdBQzkwYjA1MjhhOTExZTY1MmQ2NDMzMjlhNGQ3YjRkMmM3JyxcbiAgICAgICAgdG9rZW46ICdhNzk0MWQxNzNiZDQ4NDZkMDk2NmExODZlOTg2NWI3MidcbiAgICAgIH1cbiAgICB9LFxuICAgIHRlc3Q6IHtcbiAgICB9XG4gIH07XG5cbiAgc3RhdGljIGdldChwYXRoOiBzdHJpbmcgfCBzdHJpbmdbXSk6IGFueSB7XG4gICAgY29uc3QgZW52aXJvbm1lbnQ6IHN0cmluZyA9IHByb2Nlc3MuZW52LnN0YWdlIHx8ICdkZXZlbG9wbWVudCc7XG4gICAgY29uc3QgY29uZmlnVmFsdWVzOiBvYmplY3QgPSBtZXJnZSh0aGlzLnZhbHVlcy5kZWZhdWx0LCB0aGlzLnZhbHVlc1tlbnZpcm9ubWVudF0sIHtlbnZpcm9ubWVudH0pO1xuICAgIHJldHVybiBnZXQoY29uZmlnVmFsdWVzLCBwYXRoKTtcbiAgfVxufVxuIl19
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ApiContext } from 'types/auth';
|
|
2
|
+
import { ConversationType } from '../types';
|
|
3
|
+
export declare const getConversationList: (context: ApiContext, from: number, to: number) => Promise<ConversationType[]>;
|
|
4
|
+
export declare const getDirectConversation: (context: ApiContext, userId: string) => Promise<ConversationType>;
|
|
5
|
+
export declare const getConversation: (context: ApiContext, convoId: string) => Promise<ConversationType>;
|
|
6
|
+
export declare const updateConversation: (context: ApiContext, item: any) => Promise<ConversationType>;
|