@bigbinary/neeto-integrations-frontend 2.10.4 → 2.10.5

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,109 +1,9 @@
1
1
  # neeto-integrations-nano
2
2
 
3
- 1. [Engine and package installation](./docs/engine-and-package-installation.md)
4
- 2. [Building and releasing](./docs/building-and-releasing.md)
3
+ The `neeto-integrations-nano` provides support for third-party integrations to neeto
4
+ applications. The nano exports the `@bigbinary/neeto-integrations-frontend` NPM package and `neeto-integrations-engine` Rails engine for development.
5
5
 
6
- ## @bigbinary/neeto-integrations-frontend
7
-
8
- ![npm](https://img.shields.io/npm/v/@bigbinary/neeto-integrations-frontend?color=greenyellow)
9
- ![npm](https://img.shields.io/npm/dw/@bigbinary/neeto-integrations-frontend?color=greenyellow)
10
-
11
- UI for integrations for all neeto products.
12
-
13
- ### Installation
14
-
15
- ```bash
16
- yarn add @bigbinary/neeto-integrations-frontend
17
- ```
18
-
19
- ### Usage
20
-
21
- Available components:
22
-
23
- - [Connect](./docs/connect/README.md)
24
- - [Finish](./docs/finish/README.md)
25
- - [Demo](./docs/demo/README.md)
26
- - [DisconnectAlert](./docs/DisconnectAlert/README.md)
27
- - [GoogleCalendar](./docs/GoogleCalendar/README.md)
28
-
29
- ### Development
30
-
31
- Install all the dependencies by executing the following command
32
-
33
- ```bash
34
- yarn install
35
- ```
36
-
37
- ### Using host application
38
-
39
- 1. Clone this repository.
40
- 2. Run `yarn install` to download the dependencies and setup the development
41
- environment.
42
- 3. Have a host application ready.
43
- 4. Run `yarn build --watch` to automatically transpile code as you save the
44
- file. You can omit the `--watch` flag if you want to run the build only once.
45
- 5. In a different terminal, run `yalc publish` to publish the
46
- neeto-integrations-frontend to the local yalc store.
47
- 6. Run `yalc add @bigbinary/neeto-integrations-frontend` to install the
48
- neeto-integrations-frontend to the host application.
49
- 7. After making necessary changes to `neeto-integrations-frontend`, run
50
- `yalc push` to push the changes to the host application (assuming that you
51
- are in watch mode and the changes are bundled automatically). Restart
52
- webpack-dev-server in host if changes are not applied.
53
- 8. Video explanation on how to use yalc: https://vimeo.com/722958162/9e931b640c
54
-
55
- ### Exports and Types
56
-
57
- The **neeto-integrations-frontend** JavaScript library offers two types of
58
- exports: the common bundle and the per-component bundle.
59
-
60
- #### Common Bundle
61
-
62
- The common bundle includes components such as `Card`, `Modal`, and `Connect`.
63
- You can import them using the following syntax:
64
-
65
- ```js
66
- import { Card, Modal, Connect } from "@bigbinary/neeto-integrations-frontend";
67
- ```
68
-
69
- To add a component to the common bundle, follow these steps:
70
-
71
- 1. Place the component inside the `components` folder
72
- 2. Add the necessary types for the component in the `types.d.ts` file located in
73
- the library's root directory
74
- 3. Export the component in the `index.js` file located in the library's root
75
- directory
76
-
77
- #### Per-Component Bundle
78
-
79
- Each component inside the `components/Integrations` folder has its own bundle.
80
- For example, the `ZapierForm` component can be imported using the following
81
- syntax:
82
-
83
- ```js
84
- import ZapierForm from "@bigbinary/neeto-integrations-frontend/ZapierForm";
85
- ```
86
-
87
- To export a component as its own bundle, follow these steps:
88
-
89
- 1. Place the component strictly inside the `components/Integrations` folder.
90
- 2. Add the necessary types for the component in the `types` folder.
91
-
92
- # Product integrations
93
-
94
- | Projects | IntegrationsFrontend |
95
- | ------------ | :------------------: |
96
- | neetoChat | :white_check_mark: |
97
- | neetoDesk | :white_check_mark: |
98
- | neetoForm | :white_check_mark: |
99
- | neetoInvoice | :white_check_mark: |
100
- | neetoKB | :white_check_mark: |
101
- | neetoMonitor | :white_check_mark: |
102
- | neetoCal | :white_check_mark: |
103
-
104
- ## neeto-integrations-engine
105
-
106
- This engine handles the authentication and token management for integrations
6
+ The engine handles the authentication, webhooks and token management for integrations
107
7
  with the following providers.
108
8
 
109
9
  - Meta ( Facebook, Instagram, WhatsApp )
@@ -112,19 +12,32 @@ with the following providers.
112
12
  - Zapier
113
13
  - Twilio
114
14
 
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.
15
+ Host can provide required permissions for a supported third-party integration, then engine will handle the authentication, token storing and refreshing for the host. Tokens, account details and webhook subscription details are stored in tables handled by the engine.
118
16
 
119
- This engine also webhook support and post Integration Video walkthrough support
120
- for MS Teams, Facebook Pages, and WhatsApp Integration.
17
+ The frontend package provides components to handle integration card, steps, disconnect and other integration configuration page support.
121
18
 
122
- ### Usage
19
+ ## Contents
20
+ 1. [Development with Host application](#development-with-host-application)
21
+ - [Engine](#engine)
22
+ - [Installation](#installation)
23
+ - [Details](#details)
24
+ - [neeto products currently using this engine](#neeto-products-currently-using-this-engine)
25
+ - [Frontend package](#frontend-package---bigbinaryneeto-integrations-frontend)
26
+ - [Installation](#installation-1)
27
+ - [Usage](#usage)
28
+ - [Product integrations](#product-integrations)
29
+ 2. [Instructions for publishing](#instructions-for-publishing)
30
+
31
+ ## Development with Host application
32
+
33
+ ### Engine
34
+
35
+ #### Installation
123
36
 
124
37
  1. Add the gem to your `Gemfile`.
125
38
 
126
39
  ```ruby
127
- source "https://O6Ts9-SVDaUZpHMRs2CpJp22RwbETDE@gems.neeto.com" do
40
+ source "NEETO_GEM_SERVER_URL" do
128
41
  gem "neeto-integrations-engine"
129
42
  end
130
43
  ```
@@ -132,7 +45,7 @@ end
132
45
  2. Run `bundle install`
133
46
 
134
47
  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
48
+ `secrets.yml`. Refer [OAuth Config](./docs/engine/oauth-config.md) for more details on specific
136
49
  integrations.
137
50
 
138
51
  4. Import migrations to your project:
@@ -170,7 +83,7 @@ other_applications:
170
83
  provider: neeto
171
84
  ```
172
85
 
173
- Refer the [here](./docs/setup.md) for list of supported `provider`,
86
+ Refer the [Oauth Config](./docs/engine/oauth-config.md) for list of supported `provider`,
174
87
  `service_name` and `service_type`.
175
88
 
176
89
  7. Import data migration to update the integrations list with the newly added
@@ -212,47 +125,13 @@ has_many :integrated_apps, class_name: "NeetoIntegrationsEngine::IntegratedApp",
212
125
  has_many :integrated_apps, as: :integrable, class_name: "NeetoIntegrationsEngine::IntegratedApp", dependent: :destroy
213
126
  ```
214
127
 
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.
128
+ #### Details
229
129
 
230
- ### Errors
130
+ - [Endpoints](./docs/engine/endpoints.md)
131
+ - [Errors](./docs/engine/errors.md)
132
+ - [MS Teams credentials and integration information](./docs/engine/ms-teams.md)
231
133
 
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
134
+ #### neeto products currently using this engine
256
135
 
257
136
  | Products | Integrated (Used in production) | Integration (Currently in development/staging) |
258
137
  | :---------: | :------------------------------------------------------------------: | :--------------------------------------------: |
@@ -260,3 +139,50 @@ integrated_app properly.
260
139
  | neetoSocial | Instagram(page), Facebook(page), Google(Analytics, YouTube), Twitter | :x: |
261
140
  | neetoCal | MS Teams | :x: |
262
141
  | neetoForm | :x: | MS Teams |
142
+
143
+ ### Frontend package - @bigbinary/neeto-integrations-frontend
144
+
145
+ ![npm](https://img.shields.io/npm/v/@bigbinary/neeto-integrations-frontend?color=greenyellow)
146
+ ![npm](https://img.shields.io/npm/dw/@bigbinary/neeto-integrations-frontend?color=greenyellow)
147
+
148
+ UI for integrations for all neeto products.
149
+
150
+ #### Installation
151
+
152
+ ```bash
153
+ yarn add @bigbinary/neeto-integrations-frontend
154
+ ```
155
+
156
+ #### Usage
157
+
158
+ Available components:
159
+
160
+ - Components
161
+ - [Card](./docs/frontend/components/Card/README.md)
162
+ - [Connect](./docs/frontend/components/connect/README.md)
163
+ - [Daily.co](./docs/frontend/components/daily.co/README.md)
164
+ - [Demo](./docs/frontend/components/demo/README.md)
165
+ - [DisconnectAlert](./docs/frontend/components/DisconnectAlert/README.md)
166
+ - [Finish](./docs/frontend/components/finish/README.md)
167
+ - [GoogleCalendar](./docs/frontend/components/GoogleCalendar/README.md)
168
+ - [Modal](./docs/frontend/components/Modal/README.md)
169
+ - [Twilio](./docs/frontend/components/twilio/README.md)
170
+ - [WalkthroughModal](./docs/frontend/components/WalkthroughModal/README.md)
171
+ - [Zoom](./docs/frontend/components/zoom/README.md)
172
+ - [Exports and Types](./docs/frontend/exports-and-types.md)
173
+
174
+ #### Product integrations
175
+
176
+ | Projects | IntegrationsFrontend |
177
+ | ------------ | :------------------: |
178
+ | neetoChat | :white_check_mark: |
179
+ | neetoDesk | :white_check_mark: |
180
+ | neetoForm | :white_check_mark: |
181
+ | neetoInvoice | :white_check_mark: |
182
+ | neetoKB | :white_check_mark: |
183
+ | neetoMonitor | :white_check_mark: |
184
+ | neetoCal | :white_check_mark: |
185
+
186
+ ## Instructions for Publishing
187
+
188
+ Consult the [building and releasing packages](https://neeto-engineering.neetokb.com/articles/building-and-releasing-packages) guide for details on how to publish.
package/dist/Daily.cjs.js CHANGED
@@ -51,14 +51,14 @@ var PageLoader__default = /*#__PURE__*/_interopDefaultLegacy(PageLoader);
51
51
  var yup__namespace = /*#__PURE__*/_interopNamespace(yup);
52
52
  var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
53
53
 
54
- function _typeof(obj) {
54
+ function _typeof(o) {
55
55
  "@babel/helpers - typeof";
56
56
 
57
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
58
- return typeof obj;
59
- } : function (obj) {
60
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
61
- }, _typeof(obj);
57
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
58
+ return typeof o;
59
+ } : function (o) {
60
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
61
+ }, _typeof(o);
62
62
  }
63
63
 
64
64
  function _toPrimitive(input, hint) {
@@ -119,8 +119,8 @@ var QUERY_KEYS = {
119
119
  ZOOM_DETAILS: "zoom-details"
120
120
  };
121
121
 
122
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
123
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
122
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
123
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
124
124
  var useCreateDaily = function useCreateDaily() {
125
125
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
126
126
  return reactUtils.useMutationWithInvalidation(dailiesApi.create, _objectSpread({
@@ -144,31 +144,31 @@ function _arrayWithHoles(arr) {
144
144
  if (Array.isArray(arr)) return arr;
145
145
  }
146
146
 
147
- function _iterableToArrayLimit(arr, i) {
148
- var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
149
- if (null != _i) {
150
- var _s,
151
- _e,
152
- _x,
153
- _r,
154
- _arr = [],
155
- _n = !0,
156
- _d = !1;
147
+ function _iterableToArrayLimit(r, l) {
148
+ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
149
+ if (null != t) {
150
+ var e,
151
+ n,
152
+ i,
153
+ u,
154
+ a = [],
155
+ f = !0,
156
+ o = !1;
157
157
  try {
158
- if (_x = (_i = _i.call(arr)).next, 0 === i) {
159
- if (Object(_i) !== _i) return;
160
- _n = !1;
161
- } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
162
- } catch (err) {
163
- _d = !0, _e = err;
158
+ if (i = (t = t.call(r)).next, 0 === l) {
159
+ if (Object(t) !== t) return;
160
+ f = !1;
161
+ } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
162
+ } catch (r) {
163
+ o = !0, n = r;
164
164
  } finally {
165
165
  try {
166
- if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
166
+ if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
167
167
  } finally {
168
- if (_d) throw _e;
168
+ if (o) throw n;
169
169
  }
170
170
  }
171
- return _arr;
171
+ return a;
172
172
  }
173
173
  }
174
174
 
@@ -275,11 +275,13 @@ var Manage$1 = reactUtils.withT(function (_ref) {
275
275
  }))), isConnected ? /*#__PURE__*/React__default["default"].createElement("div", {
276
276
  className: "space-x-2"
277
277
  }, managePath && /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
278
+ "data-cy": "manage-button",
278
279
  to: managePath,
279
280
  label: t("neetoIntegrations.common.manageIntegration", {
280
281
  integration: integrationName || neetoCist.humanize(integration)
281
282
  })
282
283
  }), onDisconnect && /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
284
+ "data-cy": "disconnect-button",
283
285
  style: "secondary",
284
286
  label: t("neetoIntegrations.common.disconnectIntegration", {
285
287
  integration: integrationName || neetoCist.humanize(integration)
@@ -288,6 +290,7 @@ var Manage$1 = reactUtils.withT(function (_ref) {
288
290
  return setIsDisconnectAlertOpen(true);
289
291
  }
290
292
  })) : /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
293
+ "data-cy": "connect-button",
291
294
  disabled: isConnectDisabled,
292
295
  href: connectUrl,
293
296
  to: connectPath,
@@ -737,7 +740,7 @@ var Manage = function Manage(_ref) {
737
740
  var _useDestroyDaily = useDestroyDaily({
738
741
  onSuccess: function onSuccess() {
739
742
  setIsDisconnectAlertOpen(false);
740
- onDisconnect === null || onDisconnect === void 0 ? void 0 : onDisconnect();
743
+ onDisconnect === null || onDisconnect === void 0 || onDisconnect();
741
744
  }
742
745
  }),
743
746
  destroyIntegration = _useDestroyDaily.mutate,