@crowdin/app-project-module 0.95.1 → 0.95.3

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.
@@ -362,6 +362,7 @@ export interface BaseTreeItem {
362
362
  disabled?: boolean;
363
363
  tooltip?: string;
364
364
  path?: string;
365
+ type?: string;
365
366
  }
366
367
  export interface File extends BaseTreeItem {
367
368
  type: SourceFilesModel.FileType;
@@ -38,7 +38,7 @@ function getTreeItems(integrationData) {
38
38
  function getOneLevelFetchingFiles(integration, integrationCredentials, integrationSettings, parentFiles) {
39
39
  return __awaiter(this, void 0, void 0, function* () {
40
40
  for (const file of parentFiles) {
41
- if (!('type' in file)) {
41
+ if (!file.type) {
42
42
  let childs = yield integration.getIntegrationFiles(integrationCredentials, integrationSettings, file.id, '', 0);
43
43
  childs = getTreeItems(childs);
44
44
  if (childs.length > 0) {
@@ -378,12 +378,11 @@ function handle(config) {
378
378
  if (!(0, subscription_1.isAppFree)(config)) {
379
379
  events['subscription_paid'] = '/subscription-paid';
380
380
  }
381
- const defaultScopes = config.projectIntegration ? [types_1.Scope.USERS, types_1.Scope.PROJECTS] : [types_1.Scope.PROJECTS];
382
381
  return (_req, res) => {
383
382
  const manifest = Object.assign(Object.assign(Object.assign(Object.assign({ identifier: config.identifier, name: config.name, logo: (0, util_1.getLogoUrl)(), baseUrl: config.baseUrl, authentication: {
384
383
  type: config.authenticationType || types_1.AuthenticationType.APP,
385
384
  clientId: config.clientId,
386
- }, restrictAiToSameApp: config.restrictAiToSameApp }, (config.agent && { agent: config.agent })), { events, scopes: config.scopes ? config.scopes : defaultScopes }), (config.defaultPermissions && { default_permissions: config.defaultPermissions })), { modules });
385
+ }, restrictAiToSameApp: config.restrictAiToSameApp }, (config.agent && { agent: config.agent })), { events, scopes: config.scopes ? config.scopes : [types_1.Scope.PROJECTS] }), (config.defaultPermissions && { default_permissions: config.defaultPermissions })), { modules });
387
386
  res.send(manifest);
388
387
  };
389
388
  }
@@ -497,7 +497,7 @@ class PostgreStorage {
497
497
  saveFilesSnapshot(files, integrationId, crowdinId, provider) {
498
498
  return __awaiter(this, void 0, void 0, function* () {
499
499
  yield this.dbPromise;
500
- yield this.executeQuery((client) => client.query('INSERT INTO files_snapshot(integration_id, crowdin_id, files, provider) VALUES ($1, $2, $3, $4)', [files, integrationId, crowdinId, provider]));
500
+ yield this.executeQuery((client) => client.query('INSERT INTO files_snapshot(files, integration_id, crowdin_id, provider) VALUES ($1, $2, $3, $4)', [files, integrationId, crowdinId, provider]));
501
501
  });
502
502
  }
503
503
  updateFilesSnapshot(files, integrationId, crowdinId, provider) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crowdin/app-project-module",
3
- "version": "0.95.1",
3
+ "version": "0.95.3",
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",