@crowdin/app-project-module 1.15.0 → 1.16.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.
@@ -15,11 +15,12 @@ export declare function prepareCrowdinRequest({ jwtToken, config, optional, chec
15
15
  client?: Crowdin;
16
16
  subscriptionInfo?: SubscriptionInfo;
17
17
  }>;
18
- export default function handle({ config, optional, checkSubscriptionExpiration, moduleKey, isIntegration, }: {
18
+ export default function handle({ config, optional, checkSubscriptionExpiration, moduleKey, isIntegration, isLogout, }: {
19
19
  config: Config;
20
20
  optional: boolean;
21
21
  checkSubscriptionExpiration: boolean;
22
22
  moduleKey?: string[] | string | undefined;
23
23
  isIntegration?: boolean;
24
+ isLogout?: boolean;
24
25
  }): (req: import("express").Request | CrowdinClientRequest, res: Response, next: Function) => void;
25
26
  export declare function getToken(req: CrowdinClientRequest): string | undefined;
@@ -65,7 +65,7 @@ function prepareCrowdinRequest(_a) {
65
65
  return { context, client, subscriptionInfo, logInfo, logError };
66
66
  });
67
67
  }
68
- function handle({ config, optional = false, checkSubscriptionExpiration = true, moduleKey, isIntegration = false, }) {
68
+ function handle({ config, optional = false, checkSubscriptionExpiration = true, moduleKey, isIntegration = false, isLogout = false, }) {
69
69
  return (0, util_1.runAsyncWrapper)((req, res, next) => __awaiter(this, void 0, void 0, function* () {
70
70
  var _a, _b;
71
71
  const jwtToken = getToken(req);
@@ -93,7 +93,7 @@ function handle({ config, optional = false, checkSubscriptionExpiration = true,
93
93
  }
94
94
  if (isIntegration && data.client) {
95
95
  const result = yield (0, connection_1.resolveIntegrationAccess)(data.context.clientId);
96
- if (!result.integrationCredentials) {
96
+ if (!result.integrationCredentials && !isLogout) {
97
97
  const owners = yield (0, integration_access_denied_1.getIntegrationManagedBy)({
98
98
  ownerIds: result.ownerIds,
99
99
  crowdinApiClient: data.client,
@@ -118,6 +118,7 @@ function register({ config, app }) {
118
118
  checkSubscriptionExpiration: false,
119
119
  moduleKey: integrationLogic.key,
120
120
  isIntegration: true,
121
+ isLogout: true,
121
122
  }), (0, integration_credentials_1.default)({ config, integration: integrationLogic, isLogout: true }), (0, integration_logout_1.default)(config, integrationLogic));
122
123
  app.get('/api/crowdin/files', json_response_1.default, (0, crowdin_client_1.default)({
123
124
  config,