@crowdin/app-project-module 0.28.9 → 0.28.11
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/index.js +11 -1
- package/out/models/index.d.ts +8 -0
- package/package.json +1 -1
package/out/index.js
CHANGED
|
@@ -108,7 +108,7 @@ function addCrowdinEndpoints(app, clientConfig) {
|
|
|
108
108
|
return options.inverse(this);
|
|
109
109
|
},
|
|
110
110
|
in: function (a, b, options) {
|
|
111
|
-
if (a.includes(b)) {
|
|
111
|
+
if (a.toString().includes(b.toString())) {
|
|
112
112
|
return options.fn(this);
|
|
113
113
|
}
|
|
114
114
|
return options.inverse(this);
|
|
@@ -254,6 +254,16 @@ function addCrowdinEndpoints(app, clientConfig) {
|
|
|
254
254
|
}
|
|
255
255
|
}),
|
|
256
256
|
establishCrowdinConnection: (jwtToken) => (0, crowdin_client_1.prepareCrowdinRequest)(jwtToken, config),
|
|
257
|
+
encryptCrowdinConnection: (data) => (0, util_1.encryptData)(config, JSON.stringify(data)),
|
|
258
|
+
dencryptCrowdinConnection: (hash) => __awaiter(this, void 0, void 0, function* () {
|
|
259
|
+
const { crowdinId, extra } = JSON.parse((0, util_1.decryptData)(config, hash));
|
|
260
|
+
const creds = yield storage.getStorage().getCrowdinCredentials(crowdinId);
|
|
261
|
+
if (!creds) {
|
|
262
|
+
throw new Error('Failed to find Crowdin credentials');
|
|
263
|
+
}
|
|
264
|
+
const { client } = yield (0, connection_1.prepareCrowdinClient)(config, creds);
|
|
265
|
+
return { client, extra };
|
|
266
|
+
}),
|
|
257
267
|
};
|
|
258
268
|
}
|
|
259
269
|
exports.addCrowdinEndpoints = addCrowdinEndpoints;
|
package/out/models/index.d.ts
CHANGED
|
@@ -745,6 +745,14 @@ export interface CrowdinAppUtilities {
|
|
|
745
745
|
context: CrowdinContextInfo;
|
|
746
746
|
client?: Crowdin;
|
|
747
747
|
}>;
|
|
748
|
+
encryptCrowdinConnection: (data: {
|
|
749
|
+
crowdinId: string;
|
|
750
|
+
extra: Record<string, any>;
|
|
751
|
+
}) => string;
|
|
752
|
+
dencryptCrowdinConnection: (hash: string) => Promise<{
|
|
753
|
+
client: Crowdin;
|
|
754
|
+
extra: Record<string, any>;
|
|
755
|
+
}>;
|
|
748
756
|
}
|
|
749
757
|
export interface IntegrationSyncSettings {
|
|
750
758
|
id: number;
|
package/package.json
CHANGED