@crowdin/app-project-module 0.68.0 → 0.69.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.
@@ -50,7 +50,7 @@ function catchRejection(e, message) {
50
50
  //payment required
51
51
  if (e.code && e.code === 402 && subscriptionModal) {
52
52
  subscriptionLink = e.message || message;
53
- subscriptionModal.open();
53
+ openModal(subscriptionModal);
54
54
  return;
55
55
  }
56
56
  showToast(e.message || message);
@@ -68,7 +68,7 @@ function checkResponse(response) {
68
68
  reject(res);
69
69
  } else {
70
70
  if (res.message) {
71
- showToast(res.message);
71
+ setTimeout(() => showToast(res.message), 100);
72
72
  }
73
73
  resolve(res);
74
74
  }
package/out/types.d.ts CHANGED
@@ -15,6 +15,7 @@ import { AiProviderModule } from './modules/ai-provider/types';
15
15
  import { AiPromptProviderModule } from './modules/ai-prompt-provider/types';
16
16
  import { AiTool, AiToolWidget } from './modules/ai-tools/types';
17
17
  import { ExternalQaCheckModule } from './modules/external-qa-check/types';
18
+ import { Webhook } from './modules/webhooks/types';
18
19
  export interface ClientConfig extends ImagePath {
19
20
  /**
20
21
  * Authentication Crowdin App type: "authorization_code", "crowdin_app", "crowdin_agent". Default: "crowdin_app"
@@ -206,6 +207,10 @@ export interface ClientConfig extends ImagePath {
206
207
  * qa check module
207
208
  */
208
209
  externalQaCheck?: ExternalQaCheckModule & ImagePath;
210
+ /**
211
+ * webhook modules
212
+ */
213
+ webhooks?: Webhook | Webhook[];
209
214
  }
210
215
  export interface Environments {
211
216
  environments?: Environment | Environment[];
@@ -37,10 +37,10 @@
37
37
  <crowdin-button id="show-integration-btn" class="hidden" icon-before="arrow_back" onclick="showIntegration();">Integration</crowdin-button>
38
38
  <crowdin-button id="show-error-logs-btn" icon-before="list" onclick="showErrorLogs();">Error logs</crowdin-button>
39
39
  {{#if infoModal}}
40
- <crowdin-button icon-before="info" onclick="infoModal.open();">{{infoModal.title}}</crowdin-button>
40
+ <crowdin-button icon-before="info" onclick="openModal(infoModal);">{{infoModal.title}}</crowdin-button>
41
41
  {{/if}}
42
42
  {{#if configurationFields}}
43
- <crowdin-button icon-before="settings" onclick="settingsModal.open();fillSettingsForm();">Settings</crowdin-button>
43
+ <crowdin-button icon-before="settings" onclick="openModal(settingsModal);fillSettingsForm();">Settings</crowdin-button>
44
44
  {{/if}}
45
45
  <crowdin-button icon-before="account_circle" onclick="integrationLogout()">Log out</crowdin-button>
46
46
  </div>
@@ -93,7 +93,12 @@
93
93
  <crowdin-async-progress
94
94
  cancelAsyncAction=""
95
95
  ></crowdin-async-progress>
96
- <crowdin-modal id="subscription-modal" modal-width="50" close-button="false">
96
+ <crowdin-modal
97
+ style="display: none;"
98
+ id="subscription-modal"
99
+ modal-width="50"
100
+ close-button="false"
101
+ >
97
102
  <div>
98
103
  <crowdin-alert type="warning">Subscribe to continue using the {{name}} app.</crowdin-alert>
99
104
  </div>
@@ -104,7 +109,13 @@
104
109
  </div>
105
110
  </crowdin-modal>
106
111
  {{#if infoModal}}
107
- <crowdin-modal id="info-modal" modal-width="50" modal-title="{{infoModal.title}}" close-button-title="Close">
112
+ <crowdin-modal
113
+ style="display: none;"
114
+ id="info-modal"
115
+ modal-width="50"
116
+ modal-title="{{infoModal.title}}"
117
+ close-button-title="Close"
118
+ >
108
119
  <div>
109
120
  {{{infoModal.content}}}
110
121
  </div>
@@ -112,11 +123,12 @@
112
123
  {{/if}}
113
124
  {{#if configurationFields}}
114
125
  <crowdin-modal
115
- id="settings-modal"
116
- body-overflow-unset="{{#checkLength configurationFields 3}}false{{else}}true{{/checkLength}}"
117
- modal-width="65"
118
- modal-title="Settings"
119
- close-button-title="Close"
126
+ style="display: none;"
127
+ id="settings-modal"
128
+ body-overflow-unset="{{#checkLength configurationFields 3}}false{{else}}true{{/checkLength}}"
129
+ modal-width="65"
130
+ modal-title="Settings"
131
+ close-button-title="Close"
120
132
  >
121
133
  <div class="loader hidden">
122
134
  <crowdin-progress-indicator></crowdin-progress-indicator>
@@ -268,12 +280,13 @@
268
280
  {{/if}}
269
281
  {{#or syncNewElements.crowdin syncNewElements.integration}}
270
282
  <crowdin-modal
271
- id="confirm-schedule-modal"
272
- modal-width="50"
273
- modal-title="Synchronization options"
274
- close-button-title="Close"
275
- close-button="true"
276
- body-overflow-unset
283
+ style="display: none;"
284
+ id="confirm-schedule-modal"
285
+ modal-width="50"
286
+ modal-title="Synchronization options"
287
+ close-button-title="Close"
288
+ close-button="true"
289
+ body-overflow-unset
277
290
  >
278
291
  <crowdin-checkbox
279
292
  id="selected-files"
@@ -298,9 +311,10 @@
298
311
  {{/or}}
299
312
 
300
313
  <crowdin-modal
301
- id="user-error-detail"
302
- close-button-title="Close"
303
- close-button="true"
314
+ style="display: none;"
315
+ id="user-error-detail"
316
+ close-button-title="Close"
317
+ close-button="true"
304
318
  >
305
319
  </crowdin-modal>
306
320
  </body>
@@ -801,7 +815,7 @@
801
815
  .finally(() => {
802
816
  unsetLoader();
803
817
  settingsSaveBtn.removeAttribute('disabled');
804
- settingsModal.close();
818
+ closeModal(settingsModal);
805
819
  {{#if reloadOnConfigSave}}
806
820
  getIntegrationData(true);
807
821
  getCrowdinData();
@@ -834,10 +848,10 @@
834
848
  if (event.keyCode == 27) {
835
849
 
836
850
  if (infoModal) {
837
- infoModal.close();
851
+ closeModal(infoModal);
838
852
  }
839
853
  if (settingsModal) {
840
- settingsModal.close();
854
+ closeModal(settingsModal);
841
855
  }
842
856
  }
843
857
  });
@@ -896,7 +910,7 @@
896
910
  {{/if}}
897
911
  }
898
912
 
899
- scheduleModal.close();
913
+ closeModal(scheduleModal);
900
914
  }
901
915
 
902
916
  async function openScheduleModal(type) {
@@ -945,7 +959,7 @@
945
959
  selectedFiles.value = true;
946
960
  scheduleModal.querySelector('#save-schedule-sync').setAttribute('disabled', false);
947
961
  scheduleModal.setAttribute('data-type', type);
948
- scheduleModal.open();
962
+ openModal(scheduleModal);
949
963
  }
950
964
 
951
965
  function onChangeAutoSynchronizationOptions() {
@@ -1128,7 +1142,7 @@
1128
1142
 
1129
1143
  const clickRow = (field, index, item) => {
1130
1144
  const modal = document.getElementById('user-error-detail');
1131
- modal.open();
1145
+ openModal(modal);
1132
1146
  modal.innerHTML = getUserErrorDetail(item);
1133
1147
  };
1134
1148
 
@@ -1225,6 +1239,16 @@
1225
1239
  tempDiv.textContent = str;
1226
1240
  return tempDiv.innerHTML;
1227
1241
  }
1242
+
1243
+ function openModal(modal) {
1244
+ modal.style.display = 'block';
1245
+ modal.open()
1246
+ }
1247
+
1248
+ function closeModal(modal) {
1249
+ modal.style.display = 'none';
1250
+ modal.close()
1251
+ }
1228
1252
  </script>
1229
1253
 
1230
1254
  </html>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crowdin/app-project-module",
3
- "version": "0.68.0",
3
+ "version": "0.69.0",
4
4
  "description": "Module that generates for you all common endpoints for serving standalone Crowdin App",
5
5
  "main": "out/index.js",
6
6
  "types": "out/index.d.ts",
@@ -28,6 +28,7 @@
28
28
  "express": "^4.21.0",
29
29
  "express-handlebars": "^5.3.5",
30
30
  "lodash.get": "^4.4.2",
31
+ "lodash.isstring": "^4.0.1",
31
32
  "lodash.uniqby": "^4.7.0",
32
33
  "mysql2": "^3.10.2",
33
34
  "node-cron": "^3.0.3",
@@ -59,6 +60,7 @@
59
60
  "@types/express-handlebars": "^5.3.1",
60
61
  "@types/jest": "^29.5.12",
61
62
  "@types/lodash.get": "^4.4.9",
63
+ "@types/lodash.isstring": "^4.0.9",
62
64
  "@types/lodash.uniqby": "^4.7.9",
63
65
  "@types/node": "^16.18.112",
64
66
  "@types/node-cron": "^3.0.11",