@crowdin/app-project-module 0.23.5 → 0.23.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.
@@ -15,7 +15,7 @@ function handle(baseConfig, config) {
15
15
  const source = req.query.source;
16
16
  const target = req.query.target;
17
17
  const body = req.body;
18
- (0, util_1.log)('Recieved request for custom mt', baseConfig.logger);
18
+ (0, util_1.log)('Received request for custom mt', baseConfig.logger);
19
19
  (0, util_1.log)(`Source language ${source}, target language ${target}`, baseConfig.logger);
20
20
  (0, util_1.log)(`Payload ${JSON.stringify(body, null, 2)}`, baseConfig.logger);
21
21
  const projectId = Number(req.query.project_id);
@@ -13,7 +13,7 @@ const storage_1 = require("../storage");
13
13
  const util_1 = require("../util");
14
14
  function handle(config, integration) {
15
15
  return (0, util_1.runAsyncWrapper)((req, res) => __awaiter(this, void 0, void 0, function* () {
16
- (0, util_1.log)('Recieved integration login request', config.logger);
16
+ (0, util_1.log)('Received integration login request', config.logger);
17
17
  if (integration.checkConnection) {
18
18
  (0, util_1.log)('Checking the integration credentials', config.logger);
19
19
  yield integration.checkConnection(req.body.credentials);
@@ -14,7 +14,7 @@ const util_1 = require("../util");
14
14
  const connection_1 = require("../util/connection");
15
15
  function handle(config, integration) {
16
16
  return (0, util_1.runAsyncWrapper)((req, res) => __awaiter(this, void 0, void 0, function* () {
17
- (0, util_1.log)('Recieved integration logout request', config.logger);
17
+ (0, util_1.log)('Received integration logout request', config.logger);
18
18
  if (integration.onLogout) {
19
19
  (0, util_1.log)('Invoking onLogout hook', config.logger);
20
20
  yield integration.onLogout(req.crowdinContext.jwtPayload.context.project_id, req.crowdinApiClient, req.integrationCredentials, req.integrationSettings);
@@ -13,10 +13,10 @@ const util_1 = require("../util");
13
13
  const defaults_1 = require("../util/defaults");
14
14
  function handle(config, integration) {
15
15
  return (0, util_1.runAsyncWrapper)((req, res) => __awaiter(this, void 0, void 0, function* () {
16
- (0, util_1.log)('Upading integratino data', config.logger);
16
+ (0, util_1.log)('Updating integration data', config.logger);
17
17
  const rootFolder = yield (0, defaults_1.getRootFolder)(config, integration, req.crowdinApiClient, req.crowdinContext.jwtPayload.context.project_id);
18
18
  if (rootFolder) {
19
- (0, util_1.log)(`Upading integration data for crowding root folder ${rootFolder.id}`, config.logger);
19
+ (0, util_1.log)(`Updating integration data for crowding root folder ${rootFolder.id}`, config.logger);
20
20
  }
21
21
  const result = yield integration.updateIntegration(req.crowdinContext.jwtPayload.context.project_id, req.crowdinApiClient, req.integrationCredentials, req.body, rootFolder, req.integrationSettings);
22
22
  let message;
@@ -22,7 +22,7 @@ function handle(config, integration) {
22
22
  uid: 'oauth_popup',
23
23
  };
24
24
  const code = req.query[((_b = (_a = integration.oauthLogin) === null || _a === void 0 ? void 0 : _a.fieldsMapping) === null || _b === void 0 ? void 0 : _b.code) || 'code'];
25
- (0, util_1.log)(`Recieved request from OAuth login callback. Code ${code}`, config.logger);
25
+ (0, util_1.log)(`Received request from OAuth login callback. Code ${code}`, config.logger);
26
26
  try {
27
27
  const oauthLogin = integration.oauthLogin;
28
28
  let credentials;
@@ -13,7 +13,7 @@ const util_1 = require("../util");
13
13
  const defaults_1 = require("../util/defaults");
14
14
  function handle(config, integration) {
15
15
  return (0, util_1.runAsyncWrapper)((req, res) => __awaiter(this, void 0, void 0, function* () {
16
- (0, util_1.log)('Recieved OAuth login url request', config.logger);
16
+ (0, util_1.log)('Received OAuth login url request', config.logger);
17
17
  const { oauthLogin } = integration;
18
18
  if (!oauthLogin) {
19
19
  (0, util_1.log)('OAuth login url request is not supported', config.logger);
@@ -14,7 +14,7 @@ const connection_1 = require("../util/connection");
14
14
  function handle(config) {
15
15
  return (0, util_1.runAsyncWrapper)((req, res) => __awaiter(this, void 0, void 0, function* () {
16
16
  const organizationId = (req.query || {})['organization_id'] || (req.body || {})['organization_id'];
17
- (0, util_1.log)(`Recieved subscription paid request for organization ${organizationId}`, config.logger);
17
+ (0, util_1.log)(`Received subscription paid request for organization ${organizationId}`, config.logger);
18
18
  (0, connection_1.clearCache)(organizationId);
19
19
  res.status(204).end();
20
20
  }), config.onError);
@@ -15,7 +15,7 @@ const connection_1 = require("../util/connection");
15
15
  function handle(config) {
16
16
  return (0, util_1.runAsyncWrapper)((req, res) => __awaiter(this, void 0, void 0, function* () {
17
17
  const event = req.body;
18
- (0, util_1.log)(`Recieved uninstall request ${JSON.stringify(event, null, 2)}`, config.logger);
18
+ (0, util_1.log)(`Received uninstall request ${JSON.stringify(event, null, 2)}`, config.logger);
19
19
  const projectIntegration = config.projectIntegration;
20
20
  const organization = (event.domain || event.organizationId).toString();
21
21
  if (config.onUninstall) {
@@ -117,14 +117,14 @@ function prepareIntegrationCredentials(config, integration, integrationCredentia
117
117
  }
118
118
  exports.prepareIntegrationCredentials = prepareIntegrationCredentials;
119
119
  const subscriptionCache = {};
120
- function addToCache(organization, appIdenfifier, validUntil, type, cachingSeconds, subscribeLink) {
120
+ function addToCache(organization, appIdentifier, validUntil, type, cachingSeconds, subscribeLink) {
121
121
  if (!cachingSeconds) {
122
122
  return;
123
123
  }
124
124
  const orgCache = subscriptionCache[organization] || {};
125
125
  const now = new Date();
126
126
  now.setSeconds(now.getSeconds() + cachingSeconds);
127
- orgCache[appIdenfifier] = {
127
+ orgCache[appIdentifier] = {
128
128
  cacheValidUntil: now,
129
129
  validUntil,
130
130
  subscribeLink,
@@ -132,8 +132,8 @@ function addToCache(organization, appIdenfifier, validUntil, type, cachingSecond
132
132
  };
133
133
  subscriptionCache[organization] = orgCache;
134
134
  }
135
- function getFromCache(organization, appIdenfifier) {
136
- return (subscriptionCache[organization] || {})[appIdenfifier];
135
+ function getFromCache(organization, appIdentifier) {
136
+ return (subscriptionCache[organization] || {})[appIdentifier];
137
137
  }
138
138
  function clearCache(organization) {
139
139
  delete subscriptionCache[organization];
@@ -143,10 +143,10 @@
143
143
  )
144
144
  .then(checkResponse)
145
145
  .then(reloadLocation)
146
- .catch(e => catchRejection(e, 'Credentials are not stored'))
147
- .finally(() => {
146
+ .catch(e => {
148
147
  loginButton.setAttribute('disabled', false);
149
148
  loginButton.setAttribute('is-loading', false);
149
+ catchRejection(e, 'Credentials are not stored');
150
150
  });
151
151
  }
152
152
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crowdin/app-project-module",
3
- "version": "0.23.5",
3
+ "version": "0.23.6",
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",