@bigbinary/neeto-integrations-frontend 2.9.0 → 2.10.1

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/README.md CHANGED
@@ -1,19 +1,22 @@
1
- @bigbinary/neeto-integrations-frontend
1
+ # neeto-integrations-nano
2
+
3
+ 1. [Engine and package installation](./docs/engine-and-package-installation.md)
4
+ 2. [Building and releasing](./docs/building-and-releasing.md)
5
+
6
+ ## @bigbinary/neeto-integrations-frontend
2
7
 
3
8
  ![npm](https://img.shields.io/npm/v/@bigbinary/neeto-integrations-frontend?color=greenyellow)
4
9
  ![npm](https://img.shields.io/npm/dw/@bigbinary/neeto-integrations-frontend?color=greenyellow)
5
10
 
6
11
  UI for integrations for all neeto products.
7
12
 
8
- ## Installation
13
+ ### Installation
9
14
 
10
15
  ```bash
11
16
  yarn add @bigbinary/neeto-integrations-frontend
12
17
  ```
13
18
 
14
- ## Usage
15
-
16
- Available components:
19
+ ### Usage
17
20
 
18
21
  Available components:
19
22
 
@@ -21,10 +24,9 @@ Available components:
21
24
  - [Finish](./docs/finish/README.md)
22
25
  - [Demo](./docs/demo/README.md)
23
26
  - [DisconnectAlert](./docs/DisconnectAlert/README.md)
27
+ - [GoogleCalendar](./docs/GoogleCalendar/README.md)
24
28
 
25
- View the [example app](./example/src/App.jsx) to see usage.
26
-
27
- ## Development
29
+ ### Development
28
30
 
29
31
  Install all the dependencies by executing the following command
30
32
 
@@ -32,11 +34,6 @@ Install all the dependencies by executing the following command
32
34
  yarn install
33
35
  ```
34
36
 
35
- ### Using example app
36
-
37
- Start the development server using the `yarn start` command. Development server
38
- will run the example app using webpack.
39
-
40
37
  ### Using host application
41
38
 
42
39
  1. Clone this repository.
@@ -55,12 +52,12 @@ will run the example app using webpack.
55
52
  webpack-dev-server in host if changes are not applied.
56
53
  8. Video explanation on how to use yalc: https://vimeo.com/722958162/9e931b640c
57
54
 
58
- ## Exports and Types
55
+ ### Exports and Types
59
56
 
60
57
  The **neeto-integrations-frontend** JavaScript library offers two types of
61
58
  exports: the common bundle and the per-component bundle.
62
59
 
63
- ### Common Bundle
60
+ #### Common Bundle
64
61
 
65
62
  The common bundle includes components such as `Card`, `Modal`, and `Connect`.
66
63
  You can import them using the following syntax:
@@ -77,7 +74,7 @@ To add a component to the common bundle, follow these steps:
77
74
  3. Export the component in the `index.js` file located in the library's root
78
75
  directory
79
76
 
80
- ### Per-Component Bundle
77
+ #### Per-Component Bundle
81
78
 
82
79
  Each component inside the `components/Integrations` folder has its own bundle.
83
80
  For example, the `ZapierForm` component can be imported using the following
@@ -92,28 +89,6 @@ To export a component as its own bundle, follow these steps:
92
89
  1. Place the component strictly inside the `components/Integrations` folder.
93
90
  2. Add the necessary types for the component in the `types` folder.
94
91
 
95
- ## Building and releasing.
96
-
97
- The `@bigbinary/neeto-integrations-frontend` package gets published to NPM when
98
- we merge a PR with `patch`, `minor` or `major` label to the `main` branch. The
99
- `patch` label is used for bug fixes, `minor` label is used for new features and
100
- `major` label is used for breaking changes. You can checkout the
101
- `Create and publish releases` workflow in GitHub Actions to get a live update.
102
-
103
- In case if you missed to add the label, you can manually publish the package.
104
- For that first you need to create a PR to update the version number in the
105
- `package.json` file and merge it to the `main` branch. After merging the PR, you
106
- need to create a
107
- [new github release](https://github.com/bigbinary/neeto-integrations-frontend/releases/new)
108
- from main branch. Whenever a new release is created with a new version number,
109
- the github actions will automatically publish the built package to npm. You can
110
- checkout the `Publish to npm` workflow in GitHub Actions to get a live update.
111
-
112
- Please note that before publishing the package, you need to verify the
113
- functionality in some of the neeto web-apps locally using `yalc` package
114
- manager. The usage of yalc is explained in this video:
115
- https://youtu.be/QBiYGP0Rhe0
116
-
117
92
  # Product integrations
118
93
 
119
94
  | Projects | IntegrationsFrontend |
@@ -122,6 +97,166 @@ https://youtu.be/QBiYGP0Rhe0
122
97
  | neetoDesk | :white_check_mark: |
123
98
  | neetoForm | :white_check_mark: |
124
99
  | neetoInvoice | :white_check_mark: |
125
- | neetoBugtrap | :white_check_mark: |
100
+ | neetoKB | :white_check_mark: |
126
101
  | neetoMonitor | :white_check_mark: |
127
102
  | neetoCal | :white_check_mark: |
103
+
104
+ ## neeto-integrations-engine
105
+
106
+ This engine handles the authentication and token management for integrations
107
+ with the following providers.
108
+
109
+ - Meta ( Facebook, Instagram, WhatsApp )
110
+ - Google ( Analytics, YouTube )
111
+ - Microsoft ( MS Teams)
112
+ - Zapier
113
+ - Twilio
114
+
115
+ Host can provide required permissions for a supported third party integration,
116
+ then engine will handle the authentication, token expiry for the host. Tokens
117
+ and account details are stored in a table handled by the engine.
118
+
119
+ This engine also webhook support and post Integration Video walkthrough support
120
+ for MS Teams, Facebook Pages, and WhatsApp Integration.
121
+
122
+ ### Usage
123
+
124
+ 1. Add the gem to your `Gemfile`.
125
+
126
+ ```ruby
127
+ source "https://O6Ts9-SVDaUZpHMRs2CpJp22RwbETDE@gems.neeto.com" do
128
+ gem "neeto-integrations-engine"
129
+ end
130
+ ```
131
+
132
+ 2. Run `bundle install`
133
+
134
+ 3. Add the required env variables to `.env.development` and update your
135
+ `secrets.yml`. Refer [here](./docs/setup.md) for more details on specific
136
+ integrations.
137
+
138
+ 4. Import migrations to your project:
139
+
140
+ ```bash
141
+ bundle exec rails neeto_integrations_engine:install:migrations
142
+ ```
143
+
144
+ 5. Add the migrations to the database:
145
+
146
+ ```bash
147
+ bundle exec rails db:migrate
148
+ ```
149
+
150
+ 6. Add the Integrations List required to `config/neeto_integrations.yml`. Also,
151
+ add the required integration(not natively supported by engine) as
152
+ `other_applications` for post Integration UI support.
153
+
154
+ ```yml
155
+ applications:
156
+ - title: "Instagram Chat"
157
+ service_name: Instagram
158
+ provider: Facebook
159
+ service_type: Social
160
+ scope:
161
+ - email
162
+ - public_profile
163
+ - pages_show_list
164
+ - instagram_manage_messages
165
+ - instagram_basic
166
+ other_applications:
167
+ - title: "neetoDesk"
168
+ service_name: neetoDesk
169
+ service_type: Support
170
+ provider: neeto
171
+ ```
172
+
173
+ Refer the [here](./docs/setup.md) for list of supported `provider`,
174
+ `service_name` and `service_type`.
175
+
176
+ 7. Import data migration to update the integrations list with the newly added
177
+ integration from `config/neeto_integrations.yml`:
178
+
179
+ ```bash
180
+ bundle exec rails generate neeto_integrations_engine:integrations_list:update
181
+ ```
182
+
183
+ Or manually execute the following command in all the environments to update the
184
+ integrations list. Although the above approach is recommended.
185
+
186
+ ```bash
187
+ bundle exec rails neeto_integrations_engine:integrations_list:update
188
+ ```
189
+
190
+ 8. Mount Neeto Integrations to your `routes.rb`:
191
+
192
+ ```ruby
193
+ mount NeetoIntegrationsEngine::Engine => "/neeto_integrations"
194
+ ```
195
+
196
+ 9. Add association to `User` model:
197
+
198
+ ```ruby
199
+ has_many :auth_requests, class_name: "NeetoIntegrationsEngine::AuthRequest", dependent: :destroy
200
+ ```
201
+
202
+ 10. Add association to `Organization` model:
203
+
204
+ ```ruby
205
+ has_many :integrated_apps, class_name: "NeetoIntegrationsEngine::IntegratedApp", dependent: :destroy
206
+ ```
207
+
208
+ 11. If you want your integration to be specific to other model like `User`,
209
+ `Form` , etc, add association as:
210
+
211
+ ```ruby
212
+ has_many :integrated_apps, as: :integrable, class_name: "NeetoIntegrationsEngine::IntegratedApp", dependent: :destroy
213
+ ```
214
+
215
+ ### Endpoints
216
+
217
+ | Endpoint | Usage |
218
+ | :---------------------------------------: | :------------------------------------------------: |
219
+ | `/neeto_integrations/auth/url` | For generating oauth URL for integration |
220
+ | `/neeto_integrations/settings` | For getting integrated_app and setting details |
221
+ | `/neeto_integrations/disconnect` | For disconnecting an integrated_app |
222
+ | `/neeto_integrations/status` | For getting demoShown status for an integrated_app |
223
+ | `/neeto_integrations/zapier/api-keys` | For creating and destroying Zapier API key |
224
+ | `/neeto_integrations/zapier/subscription` | For creating and destroying Zapier Subscription |
225
+
226
+ ⚠️ **Note**: By default, the `integrable` is the current `organization`. You
227
+ should add `integrableType` and `integrableId` in the payload, to fetch the
228
+ integrated_app properly.
229
+
230
+ ### Errors
231
+
232
+ #### Response format
233
+
234
+ - `status`: failure
235
+ - `state`: Any state that was passed during Auth
236
+ - `error`: Contains the error `message` and `code`
237
+
238
+ #### Errors list
239
+
240
+ | Error | Description |
241
+ | :----------------------------: | :---------------------------------------------------------------------: |
242
+ | `AuthRequestError` | When an invalid `AuthRequest` ID has been given |
243
+ | `InvalidServiceError` | When an unsupported `service_name` is provided for seeding |
244
+ | `InvalidProviderError` | When an unsupported `provider` name is given for seeding |
245
+ | `InvalidCallbackParamsError` | When the `params` received during callback is invalid |
246
+ | `InsufficientPermissionsError` | When the user denies any permissions requested |
247
+ | `InvalidRequestError` | When an invalid request is created in RequestDispatcher |
248
+ | `InvalidRefreshTokenError` | When the invalid refresh token is given for refreshing token |
249
+ | `TokenError` | When an error has occurred while fetching token details |
250
+ | `MissingImplementationError` | When a service has been inherited but the method(s) are not implemented |
251
+ | `TokenDebuggerServiceError` | When an error has occurred while fetching `token details` |
252
+ | `AccountDetailsServiceError` | When an error has occurred while fetching `account details` |
253
+ | `OauthError` | When an error occurred in the Oauth process |
254
+
255
+ ## neeto products currently using this engine
256
+
257
+ | Products | Integrated (Used in production) | Integration (Currently in development/staging) |
258
+ | :---------: | :------------------------------------------------------------------: | :--------------------------------------------: |
259
+ | neetoChat | :x: | Instagram, WhatsApp, Twilio, Zapier, MS Teams |
260
+ | neetoSocial | Instagram(page), Facebook(page), Google(Analytics, YouTube), Twitter | :x: |
261
+ | neetoCal | MS Teams | :x: |
262
+ | neetoForm | :x: | MS Teams |
@@ -101,6 +101,19 @@
101
101
  "title": "Disconnect Zoom integration?",
102
102
  "message": "This action will disconnect Zoom integration."
103
103
  }
104
+ },
105
+ "google": {
106
+ "connect": {
107
+ "title": "Connect your Google account",
108
+ "signIn": "Sign in with Google",
109
+ "reminderToAcceptPermissions": "When connecting to your Google Account, please make sure to <strong>select the checkbox</strong> that grants app access to your Google Calendar after clicking the 'Sign in with Google' button. This checkbox can be found in the permission request screen as shown in the picture below.",
110
+ "selectCheckbox": "select the checkbox"
111
+ },
112
+ "finish": {
113
+ "title": "Google account is successfully integrated to neetoCal"
114
+ },
115
+ "calendar": "Google calendar",
116
+ "statusForbidden": "An unknown error occurred in your google integration, please reconnect."
104
117
  }
105
118
  }
106
119
  }