@crowdin/app-project-module 0.17.4 → 0.17.6

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.
Files changed (79) hide show
  1. package/.github/workflows/basic.yml +39 -0
  2. package/.github/workflows/publish.yml +34 -0
  3. package/README.md +2 -1
  4. package/package.json +1 -1
  5. package/out/handlers/crowdin-file-progress.d.ts +0 -4
  6. package/out/handlers/crowdin-file-progress.js +0 -22
  7. package/out/handlers/crowdin-files.d.ts +0 -4
  8. package/out/handlers/crowdin-files.js +0 -31
  9. package/out/handlers/crowdin-project.d.ts +0 -4
  10. package/out/handlers/crowdin-project.js +0 -22
  11. package/out/handlers/crowdin-update.d.ts +0 -4
  12. package/out/handlers/crowdin-update.js +0 -26
  13. package/out/handlers/custom-file-format/download.d.ts +0 -4
  14. package/out/handlers/custom-file-format/download.js +0 -32
  15. package/out/handlers/custom-file-format/process.d.ts +0 -4
  16. package/out/handlers/custom-file-format/process.js +0 -134
  17. package/out/handlers/custom-mt/translate.d.ts +0 -4
  18. package/out/handlers/custom-mt/translate.js +0 -42
  19. package/out/handlers/install.d.ts +0 -4
  20. package/out/handlers/install.js +0 -45
  21. package/out/handlers/integration-data.d.ts +0 -4
  22. package/out/handlers/integration-data.js +0 -21
  23. package/out/handlers/integration-login.d.ts +0 -4
  24. package/out/handlers/integration-login.js +0 -30
  25. package/out/handlers/integration-logout.d.ts +0 -4
  26. package/out/handlers/integration-logout.js +0 -23
  27. package/out/handlers/integration-update.d.ts +0 -4
  28. package/out/handlers/integration-update.js +0 -25
  29. package/out/handlers/main.d.ts +0 -4
  30. package/out/handlers/main.js +0 -64
  31. package/out/handlers/manifest.d.ts +0 -3
  32. package/out/handlers/manifest.js +0 -126
  33. package/out/handlers/oauth-login.d.ts +0 -4
  34. package/out/handlers/oauth-login.js +0 -69
  35. package/out/handlers/settings-save.d.ts +0 -4
  36. package/out/handlers/settings-save.js +0 -21
  37. package/out/handlers/subscription-info.d.ts +0 -3
  38. package/out/handlers/subscription-info.js +0 -15
  39. package/out/handlers/subscription-paid.d.ts +0 -4
  40. package/out/handlers/subscription-paid.js +0 -22
  41. package/out/handlers/sync-settings-save.d.ts +0 -4
  42. package/out/handlers/sync-settings-save.js +0 -29
  43. package/out/handlers/sync-settings.d.ts +0 -4
  44. package/out/handlers/sync-settings.js +0 -27
  45. package/out/handlers/uninstall.d.ts +0 -4
  46. package/out/handlers/uninstall.js +0 -27
  47. package/out/index.d.ts +0 -5
  48. package/out/index.js +0 -191
  49. package/out/logo.png +0 -0
  50. package/out/middlewares/crowdin-client.d.ts +0 -10
  51. package/out/middlewares/crowdin-client.js +0 -88
  52. package/out/middlewares/integration-credentials.d.ts +0 -4
  53. package/out/middlewares/integration-credentials.js +0 -39
  54. package/out/middlewares/json-response.d.ts +0 -2
  55. package/out/middlewares/json-response.js +0 -7
  56. package/out/middlewares/ui-module.d.ts +0 -4
  57. package/out/middlewares/ui-module.js +0 -39
  58. package/out/models/index.d.ts +0 -538
  59. package/out/models/index.js +0 -41
  60. package/out/static/css/styles.css +0 -57
  61. package/out/static/js/main.js +0 -130
  62. package/out/static/js/polyfills/fetch.js +0 -494
  63. package/out/static/js/polyfills/promise.js +0 -375
  64. package/out/storage/index.d.ts +0 -22
  65. package/out/storage/index.js +0 -319
  66. package/out/util/connection.d.ts +0 -10
  67. package/out/util/connection.js +0 -213
  68. package/out/util/cron.d.ts +0 -3
  69. package/out/util/cron.js +0 -103
  70. package/out/util/defaults.d.ts +0 -5
  71. package/out/util/defaults.js +0 -153
  72. package/out/util/index.d.ts +0 -11
  73. package/out/util/index.js +0 -105
  74. package/out/views/install.handlebars +0 -16
  75. package/out/views/login.handlebars +0 -115
  76. package/out/views/main.handlebars +0 -471
  77. package/out/views/oauth.handlebars +0 -4
  78. package/out/views/partials/head.handlebars +0 -20
  79. package/out/views/subscription.handlebars +0 -26
@@ -1,375 +0,0 @@
1
- /**
2
- * setImmediate polyfill v1.0.1, supports IE9+
3
- * © 2014–2015 Dmitry Korobkin
4
- * Released under the MIT license
5
- * github.com/Octane/setImmediate
6
- */
7
- window.setImmediate ||
8
- (function () {
9
- 'use strict';
10
-
11
- var uid = 0;
12
- var storage = {};
13
- var firstCall = true;
14
- var slice = Array.prototype.slice;
15
- var message = 'setImmediatePolyfillMessage';
16
-
17
- function fastApply(args) {
18
- var func = args[0];
19
- switch (args.length) {
20
- case 1:
21
- return func();
22
- case 2:
23
- return func(args[1]);
24
- case 3:
25
- return func(args[1], args[2]);
26
- }
27
- return func.apply(window, slice.call(args, 1));
28
- }
29
-
30
- function callback(event) {
31
- var key = event.data;
32
- var data;
33
- if (typeof key == 'string' && key.indexOf(message) == 0) {
34
- data = storage[key];
35
- if (data) {
36
- delete storage[key];
37
- fastApply(data);
38
- }
39
- }
40
- }
41
-
42
- window.setImmediate = function setImmediate() {
43
- var id = uid++;
44
- var key = message + id;
45
- var i = arguments.length;
46
- var args = new Array(i);
47
- while (i--) {
48
- args[i] = arguments[i];
49
- }
50
- storage[key] = args;
51
- if (firstCall) {
52
- firstCall = false;
53
- window.addEventListener('message', callback);
54
- }
55
- window.postMessage(key, '*');
56
- return id;
57
- };
58
-
59
- window.clearImmediate = function clearImmediate(id) {
60
- delete storage[message + id];
61
- };
62
- })();
63
-
64
- /**
65
- * Promise polyfill v1.0.10
66
- * requires setImmediate
67
- *
68
- * © 2014–2015 Dmitry Korobkin
69
- * Released under the MIT license
70
- * github.com/Octane/Promise
71
- */
72
- (function (global) {
73
- 'use strict';
74
-
75
- var STATUS = '[[PromiseStatus]]';
76
- var VALUE = '[[PromiseValue]]';
77
- var ON_FUlFILLED = '[[OnFulfilled]]';
78
- var ON_REJECTED = '[[OnRejected]]';
79
- var ORIGINAL_ERROR = '[[OriginalError]]';
80
- var PENDING = 'pending';
81
- var INTERNAL_PENDING = 'internal pending';
82
- var FULFILLED = 'fulfilled';
83
- var REJECTED = 'rejected';
84
- var NOT_ARRAY = 'not an array.';
85
- var REQUIRES_NEW = 'constructor Promise requires "new".';
86
- var CHAINING_CYCLE = 'then() cannot return same Promise that it resolves.';
87
-
88
- var setImmediate = global.setImmediate || require('timers').setImmediate;
89
- var isArray =
90
- Array.isArray ||
91
- function (anything) {
92
- return Object.prototype.toString.call(anything) == '[object Array]';
93
- };
94
-
95
- function InternalError(originalError) {
96
- this[ORIGINAL_ERROR] = originalError;
97
- }
98
-
99
- function isInternalError(anything) {
100
- return anything instanceof InternalError;
101
- }
102
-
103
- function isObject(anything) {
104
- //Object.create(null) instanceof Object → false
105
- return Object(anything) === anything;
106
- }
107
-
108
- function isCallable(anything) {
109
- return typeof anything == 'function';
110
- }
111
-
112
- function isPromise(anything) {
113
- return anything instanceof Promise;
114
- }
115
-
116
- function identity(value) {
117
- return value;
118
- }
119
-
120
- function thrower(reason) {
121
- throw reason;
122
- }
123
-
124
- function enqueue(promise, onFulfilled, onRejected) {
125
- if (!promise[ON_FUlFILLED]) {
126
- promise[ON_FUlFILLED] = [];
127
- promise[ON_REJECTED] = [];
128
- }
129
- promise[ON_FUlFILLED].push(onFulfilled);
130
- promise[ON_REJECTED].push(onRejected);
131
- }
132
-
133
- function clearAllQueues(promise) {
134
- delete promise[ON_FUlFILLED];
135
- delete promise[ON_REJECTED];
136
- }
137
-
138
- function callEach(queue) {
139
- var i;
140
- var length = queue.length;
141
- for (i = 0; i < length; i++) {
142
- queue[i]();
143
- }
144
- }
145
-
146
- function call(resolve, reject, value) {
147
- var anything = toPromise(value);
148
- if (isPromise(anything)) {
149
- anything.then(resolve, reject);
150
- } else if (isInternalError(anything)) {
151
- reject(anything[ORIGINAL_ERROR]);
152
- } else {
153
- resolve(value);
154
- }
155
- }
156
-
157
- function toPromise(anything) {
158
- var then;
159
- if (isPromise(anything)) {
160
- return anything;
161
- }
162
- if (isObject(anything)) {
163
- try {
164
- then = anything.then;
165
- } catch (error) {
166
- return new InternalError(error);
167
- }
168
- if (isCallable(then)) {
169
- return new Promise(function (resolve, reject) {
170
- setImmediate(function () {
171
- try {
172
- then.call(anything, resolve, reject);
173
- } catch (error) {
174
- reject(error);
175
- }
176
- });
177
- });
178
- }
179
- }
180
- return null;
181
- }
182
-
183
- function resolvePromise(promise, resolver) {
184
- function resolve(value) {
185
- if (promise[STATUS] == PENDING) {
186
- fulfillPromise(promise, value);
187
- }
188
- }
189
- function reject(reason) {
190
- if (promise[STATUS] == PENDING) {
191
- rejectPromise(promise, reason);
192
- }
193
- }
194
- try {
195
- resolver(resolve, reject);
196
- } catch (error) {
197
- reject(error);
198
- }
199
- }
200
-
201
- function fulfillPromise(promise, value) {
202
- var queue;
203
- var anything = toPromise(value);
204
- if (isPromise(anything)) {
205
- promise[STATUS] = INTERNAL_PENDING;
206
- anything.then(
207
- function (value) {
208
- fulfillPromise(promise, value);
209
- },
210
- function (reason) {
211
- rejectPromise(promise, reason);
212
- },
213
- );
214
- } else if (isInternalError(anything)) {
215
- rejectPromise(promise, anything[ORIGINAL_ERROR]);
216
- } else {
217
- promise[STATUS] = FULFILLED;
218
- promise[VALUE] = value;
219
- queue = promise[ON_FUlFILLED];
220
- if (queue && queue.length) {
221
- clearAllQueues(promise);
222
- callEach(queue);
223
- }
224
- }
225
- }
226
-
227
- function rejectPromise(promise, reason) {
228
- var queue = promise[ON_REJECTED];
229
- promise[STATUS] = REJECTED;
230
- promise[VALUE] = reason;
231
- if (queue && queue.length) {
232
- clearAllQueues(promise);
233
- callEach(queue);
234
- }
235
- }
236
-
237
- function Promise(resolver) {
238
- var promise = this;
239
- if (!isPromise(promise)) {
240
- throw new TypeError(REQUIRES_NEW);
241
- }
242
- promise[STATUS] = PENDING;
243
- promise[VALUE] = undefined;
244
- resolvePromise(promise, resolver);
245
- }
246
-
247
- Promise.prototype.then = function (onFulfilled, onRejected) {
248
- var promise = this;
249
- var nextPromise;
250
- onFulfilled = isCallable(onFulfilled) ? onFulfilled : identity;
251
- onRejected = isCallable(onRejected) ? onRejected : thrower;
252
- nextPromise = new Promise(function (resolve, reject) {
253
- function tryCall(func) {
254
- var value;
255
- try {
256
- value = func(promise[VALUE]);
257
- } catch (error) {
258
- reject(error);
259
- return;
260
- }
261
- if (value === nextPromise) {
262
- reject(new TypeError(CHAINING_CYCLE));
263
- } else {
264
- call(resolve, reject, value);
265
- }
266
- }
267
- function asyncOnFulfilled() {
268
- setImmediate(tryCall, onFulfilled);
269
- }
270
- function asyncOnRejected() {
271
- setImmediate(tryCall, onRejected);
272
- }
273
- switch (promise[STATUS]) {
274
- case FULFILLED:
275
- asyncOnFulfilled();
276
- break;
277
- case REJECTED:
278
- asyncOnRejected();
279
- break;
280
- default:
281
- enqueue(promise, asyncOnFulfilled, asyncOnRejected);
282
- }
283
- });
284
- return nextPromise;
285
- };
286
-
287
- Promise.prototype['catch'] = function (onRejected) {
288
- return this.then(identity, onRejected);
289
- };
290
-
291
- Promise.resolve = function (value) {
292
- var anything = toPromise(value);
293
- if (isPromise(anything)) {
294
- return anything;
295
- }
296
- return new Promise(function (resolve, reject) {
297
- if (isInternalError(anything)) {
298
- reject(anything[ORIGINAL_ERROR]);
299
- } else {
300
- resolve(value);
301
- }
302
- });
303
- };
304
-
305
- Promise.reject = function (reason) {
306
- return new Promise(function (resolve, reject) {
307
- reject(reason);
308
- });
309
- };
310
-
311
- Promise.race = function (values) {
312
- return new Promise(function (resolve, reject) {
313
- var i;
314
- var length;
315
- if (isArray(values)) {
316
- length = values.length;
317
- for (i = 0; i < length; i++) {
318
- call(resolve, reject, values[i]);
319
- }
320
- } else {
321
- reject(new TypeError(NOT_ARRAY));
322
- }
323
- });
324
- };
325
-
326
- Promise.all = function (values) {
327
- return new Promise(function (resolve, reject) {
328
- var fulfilledCount = 0;
329
- var promiseCount = 0;
330
- var anything;
331
- var length;
332
- var value;
333
- var i;
334
- if (isArray(values)) {
335
- values = values.slice(0);
336
- length = values.length;
337
- for (i = 0; i < length; i++) {
338
- value = values[i];
339
- anything = toPromise(value);
340
- if (isPromise(anything)) {
341
- promiseCount++;
342
- anything.then(
343
- (function (index) {
344
- return function (value) {
345
- values[index] = value;
346
- fulfilledCount++;
347
- if (fulfilledCount == promiseCount) {
348
- resolve(values);
349
- }
350
- };
351
- })(i),
352
- reject,
353
- );
354
- } else if (isInternalError(anything)) {
355
- reject(anything[ORIGINAL_ERROR]);
356
- } else {
357
- //[1, , 3] → [1, undefined, 3]
358
- values[i] = value;
359
- }
360
- }
361
- if (!promiseCount) {
362
- resolve(values);
363
- }
364
- } else {
365
- reject(new TypeError(NOT_ARRAY));
366
- }
367
- });
368
- };
369
-
370
- if (typeof module != 'undefined' && module.exports) {
371
- module.exports = global.Promise || Promise;
372
- } else if (!global.Promise) {
373
- global.Promise = Promise;
374
- }
375
- })(this);
@@ -1,22 +0,0 @@
1
- import { CrowdinCredentials, IntegrationCredentials, IntegrationSyncSettings } from '../models';
2
- export declare function connect(folder: string): Promise<void>;
3
- export declare function saveCrowdinCredentials(credentials: CrowdinCredentials): Promise<void>;
4
- export declare function updateCrowdinCredentials(credentials: CrowdinCredentials): Promise<void>;
5
- export declare function getCrowdinCredentials(id: string): Promise<CrowdinCredentials | undefined>;
6
- export declare function getAllCrowdinCredentials(): Promise<CrowdinCredentials[]>;
7
- export declare function deleteCrowdinCredentials(id: string): Promise<void>;
8
- export declare function saveIntegrationCredentials(id: string, credentials: any, crowdinId: string): Promise<void>;
9
- export declare function updateIntegrationCredentials(id: string, credentials: any): Promise<void>;
10
- export declare function updateIntegrationConfig(id: string, config: any): Promise<void>;
11
- export declare function getIntegrationCredentials(id: string): Promise<IntegrationCredentials | undefined>;
12
- export declare function getAllIntegrationCredentials(crowdinId: string): Promise<IntegrationCredentials[]>;
13
- export declare function deleteIntegrationCredentials(id: string): Promise<void>;
14
- export declare function saveMetadata(id: string, metadata: any): Promise<void>;
15
- export declare function updateMetadata(id: string, metadata: any): Promise<void>;
16
- export declare function getMetadata(id: string): Promise<any | undefined>;
17
- export declare function deleteMetadata(id: string): Promise<void>;
18
- export declare function getSyncSettingsByProvider(integrationId: string, provider: string): Promise<IntegrationSyncSettings | undefined>;
19
- export declare function getAllSyncSettingsByType(type: string): Promise<IntegrationSyncSettings[]>;
20
- export declare function saveSyncSettings(files: any, integrationId: string, crowdinId: string, type: string, provider: string): Promise<void>;
21
- export declare function updateSyncSettings(files: any, integrationId: string, crowdinId: string, type: string, provider: string): Promise<void>;
22
- export declare function getSyncSettings(integrationId: string, crowdinId: string, type: string, provider: string): Promise<IntegrationSyncSettings | undefined>;