@crowdin/app-project-module 3.1.0 → 3.2.1

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.
package/out/types.d.ts CHANGED
@@ -408,6 +408,7 @@ export interface CrowdinClientRequest extends Request {
408
408
  logInfo: LogFunction;
409
409
  logError: LogErrorFunction;
410
410
  isApiCall?: boolean;
411
+ injectedIntegrationCredentials?: any;
411
412
  }
412
413
  export interface CrowdinCredentials {
413
414
  id: string;
@@ -17,5 +17,10 @@ export interface IntegrationAccessResult {
17
17
  clientId: string;
18
18
  ownerIds: number[];
19
19
  }
20
+ export declare function buildCrowdinClientFromPat({ config, token, organization, }: {
21
+ config: Config;
22
+ token: string;
23
+ organization?: string;
24
+ }): Promise<Crowdin>;
20
25
  export declare function resolveIntegrationAccess(clientId: string): Promise<IntegrationAccessResult>;
21
26
  export declare function prepareIntegrationCredentials(config: Config, integration: IntegrationLogic, integrationCredentials: IntegrationCredentials): Promise<any>;
@@ -46,6 +46,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
46
46
  };
47
47
  Object.defineProperty(exports, "__esModule", { value: true });
48
48
  exports.prepareCrowdinClient = prepareCrowdinClient;
49
+ exports.buildCrowdinClientFromPat = buildCrowdinClientFromPat;
49
50
  exports.resolveIntegrationAccess = resolveIntegrationAccess;
50
51
  exports.prepareIntegrationCredentials = prepareIntegrationCredentials;
51
52
  const crowdin_api_client_1 = __importDefault(require("@crowdin/crowdin-api-client"));
@@ -256,6 +257,12 @@ function prepareCrowdinClient(_a) {
256
257
  };
257
258
  });
258
259
  }
260
+ function buildCrowdinClientFromPat(_a) {
261
+ return __awaiter(this, arguments, void 0, function* ({ config, token, organization, }) {
262
+ var _b;
263
+ return new crowdin_api_client_1.default({ token, organization, apiDomain: (_b = config.crowdinUrls) === null || _b === void 0 ? void 0 : _b.apiDomain });
264
+ });
265
+ }
259
266
  function resolveIntegrationAccess(clientId) {
260
267
  return __awaiter(this, void 0, void 0, function* () {
261
268
  const { organization, projectId, userId } = (0, token_1.parseCrowdinId)(clientId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crowdin/app-project-module",
3
- "version": "3.1.0",
3
+ "version": "3.2.1",
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",