@crowdin/app-project-module 1.11.0 → 1.13.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.
- package/out/index.d.ts +1 -1
- package/out/index.js +5 -5
- package/out/middlewares/export.d.ts +2 -0
- package/out/middlewares/export.js +39 -0
- package/out/modules/ai-prompt-provider/handlers/status.d.ts +4 -0
- package/out/modules/ai-prompt-provider/handlers/status.js +43 -0
- package/out/modules/ai-prompt-provider/index.js +9 -0
- package/out/modules/ai-prompt-provider/types.d.ts +21 -0
- package/out/modules/ai-provider/handlers/chat-completions.js +5 -1
- package/out/modules/ai-provider/handlers/get-model-list.js +7 -6
- package/out/modules/ai-provider/types.d.ts +25 -3
- package/out/modules/integration/handlers/integration-data.d.ts +1 -1
- package/out/modules/integration/handlers/invite-users.d.ts +1 -1
- package/out/modules/integration/handlers/job-cancel.d.ts +1 -1
- package/out/modules/integration/handlers/job-info.d.ts +1 -1
- package/out/modules/integration/handlers/job-list.d.ts +1 -1
- package/out/modules/integration/handlers/settings-schema.d.ts +1 -1
- package/out/modules/integration/handlers/settings.d.ts +1 -1
- package/out/modules/integration/handlers/sync-settings.d.ts +1 -1
- package/out/modules/integration/handlers/user-errors.d.ts +1 -1
- package/out/modules/integration/handlers/users.d.ts +1 -1
- package/out/modules/integration/util/export.d.ts +3 -0
- package/out/modules/integration/util/export.js +19 -0
- package/out/modules/manifest.js +2 -2
- package/out/modules/subscription-paid.d.ts +1 -1
- package/out/storage/export.d.ts +1 -0
- package/out/storage/export.js +2 -0
- package/out/util/export.d.ts +4 -0
- package/out/util/export.js +47 -0
- package/package.json +21 -1
package/out/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { ClientConfig, Config, CrowdinAppUtilities, CrowdinMetadataStore } from
|
|
|
3
3
|
import express from './util/terminus-express';
|
|
4
4
|
import { getRequestCredentialsMasker, postRequestCredentialsMasker, maskKey } from './util/credentials-masker';
|
|
5
5
|
export { getRequestCredentialsMasker, postRequestCredentialsMasker, maskKey };
|
|
6
|
-
export
|
|
6
|
+
export * from './types';
|
|
7
7
|
export { Cron } from './util/cron';
|
|
8
8
|
export { express };
|
|
9
9
|
export declare const metadataStore: CrowdinMetadataStore;
|
package/out/index.js
CHANGED
|
@@ -32,6 +32,9 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
32
32
|
return result;
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
36
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
37
|
+
};
|
|
35
38
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
36
39
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
37
40
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -45,7 +48,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
45
48
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
46
49
|
};
|
|
47
50
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
-
exports.metadataStore = exports.express = exports.
|
|
51
|
+
exports.metadataStore = exports.express = exports.maskKey = exports.postRequestCredentialsMasker = exports.getRequestCredentialsMasker = void 0;
|
|
49
52
|
exports.createApp = createApp;
|
|
50
53
|
exports.addCrowdinEndpoints = addCrowdinEndpoints;
|
|
51
54
|
const logsFormatter = __importStar(require("@crowdin/logs-formatter"));
|
|
@@ -106,10 +109,7 @@ const aiRequestProcessors = __importStar(require("./modules/ai-request-processor
|
|
|
106
109
|
const automationAction = __importStar(require("./modules/automation-action"));
|
|
107
110
|
const authGuard = __importStar(require("./modules/auth-guard"));
|
|
108
111
|
const subscription_1 = require("./util/subscription");
|
|
109
|
-
|
|
110
|
-
Object.defineProperty(exports, "ProjectPermissions", { enumerable: true, get: function () { return types_2.ProjectPermissions; } });
|
|
111
|
-
Object.defineProperty(exports, "Scope", { enumerable: true, get: function () { return types_2.Scope; } });
|
|
112
|
-
Object.defineProperty(exports, "UserPermissions", { enumerable: true, get: function () { return types_2.UserPermissions; } });
|
|
112
|
+
__exportStar(require("./types"), exports);
|
|
113
113
|
exports.metadataStore = {
|
|
114
114
|
getMetadata: (id) => {
|
|
115
115
|
return storage.getStorage().getMetadata(id);
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.jsonResponse = exports.getToken = void 0;
|
|
37
|
+
var crowdin_client_1 = require("./crowdin-client");
|
|
38
|
+
Object.defineProperty(exports, "getToken", { enumerable: true, get: function () { return crowdin_client_1.getToken; } });
|
|
39
|
+
exports.jsonResponse = __importStar(require("./json-response"));
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Response } from 'express';
|
|
2
|
+
import { CrowdinClientRequest } from '../../../types';
|
|
3
|
+
import { AiPromptProviderModule } from '../types';
|
|
4
|
+
export default function handle(aiPromptProvider: AiPromptProviderModule): (req: import("express").Request | CrowdinClientRequest, res: Response, next: Function) => void;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.default = handle;
|
|
13
|
+
const util_1 = require("../../../util");
|
|
14
|
+
const logger_1 = require("../../../util/logger");
|
|
15
|
+
function handle(aiPromptProvider) {
|
|
16
|
+
return (0, util_1.runAsyncWrapper)((req, res) => __awaiter(this, void 0, void 0, function* () {
|
|
17
|
+
if (!aiPromptProvider.status) {
|
|
18
|
+
res.status(204).send();
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
try {
|
|
22
|
+
const { options, aiPromptId } = req.body;
|
|
23
|
+
const result = yield aiPromptProvider.status({
|
|
24
|
+
options,
|
|
25
|
+
aiPromptId,
|
|
26
|
+
client: req.crowdinApiClient,
|
|
27
|
+
context: req.crowdinContext,
|
|
28
|
+
});
|
|
29
|
+
res.send({
|
|
30
|
+
usedAiProviderIds: result.usedAiProviderIds,
|
|
31
|
+
isConfigured: result.isConfigured,
|
|
32
|
+
errors: result.errors,
|
|
33
|
+
warnings: result.warnings,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
catch (e) {
|
|
37
|
+
if (req.logError) {
|
|
38
|
+
req.logError(e);
|
|
39
|
+
}
|
|
40
|
+
res.status(500).send({ error: { message: (0, logger_1.getErrorMessage)(e) } });
|
|
41
|
+
}
|
|
42
|
+
}));
|
|
43
|
+
}
|
|
@@ -10,6 +10,7 @@ const render_ui_module_1 = __importDefault(require("../../middlewares/render-ui-
|
|
|
10
10
|
const util_1 = require("../../util");
|
|
11
11
|
const crowdin_client_1 = __importDefault(require("../../middlewares/crowdin-client"));
|
|
12
12
|
const compile_1 = __importDefault(require("./handlers/compile"));
|
|
13
|
+
const status_1 = __importDefault(require("./handlers/status"));
|
|
13
14
|
const normalize_module_1 = require("../../util/normalize-module");
|
|
14
15
|
function register({ config, app }) {
|
|
15
16
|
var _a;
|
|
@@ -34,6 +35,14 @@ function register({ config, app }) {
|
|
|
34
35
|
checkSubscriptionExpiration: true,
|
|
35
36
|
moduleKey: key,
|
|
36
37
|
}), (0, compile_1.default)(provider));
|
|
38
|
+
if (provider.status) {
|
|
39
|
+
app.post(`${base}/status`, json_response_1.default, (0, crowdin_client_1.default)({
|
|
40
|
+
config,
|
|
41
|
+
optional: false,
|
|
42
|
+
checkSubscriptionExpiration: true,
|
|
43
|
+
moduleKey: key,
|
|
44
|
+
}), (0, status_1.default)(provider));
|
|
45
|
+
}
|
|
37
46
|
if (provider.formSchema || provider.uiPath) {
|
|
38
47
|
app.use(`${base}/settings`, (0, ui_module_1.default)({ config, allowUnauthorized: true, moduleType: key }), (0, render_ui_module_1.default)(provider, config));
|
|
39
48
|
}
|
|
@@ -25,4 +25,25 @@ export interface AiPromptProviderModule extends UiModule {
|
|
|
25
25
|
* Default: true
|
|
26
26
|
*/
|
|
27
27
|
allowRetryOnQaIssues?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Optional handler that returns prompt status info (used providers, configuration state, errors).
|
|
30
|
+
* When provided, Crowdin will call this to display real-time status for external prompts.
|
|
31
|
+
*/
|
|
32
|
+
status?: (options: {
|
|
33
|
+
options: any;
|
|
34
|
+
aiPromptId: number;
|
|
35
|
+
client: Crowdin;
|
|
36
|
+
context: CrowdinContextInfo;
|
|
37
|
+
}) => Promise<{
|
|
38
|
+
usedAiProviderIds: number[];
|
|
39
|
+
isConfigured: boolean;
|
|
40
|
+
errors: Array<{
|
|
41
|
+
code: string;
|
|
42
|
+
message: string;
|
|
43
|
+
}>;
|
|
44
|
+
warnings: Array<{
|
|
45
|
+
code: string;
|
|
46
|
+
message: string;
|
|
47
|
+
}>;
|
|
48
|
+
}>;
|
|
28
49
|
}
|
|
@@ -35,7 +35,10 @@ function handle(aiProvider) {
|
|
|
35
35
|
let message;
|
|
36
36
|
let data;
|
|
37
37
|
const chunks = [];
|
|
38
|
-
const { crowdinApiClient: client, crowdinContext: context, body: { messages, model, action, stream, tools, tool_choice: toolChoice, responseFormat: { type: responseFormatType
|
|
38
|
+
const { crowdinApiClient: client, crowdinContext: context, body: { messages, model, action, stream, tools, tool_choice: toolChoice, responseFormat: { type: responseFormatType, json_schema: jsonSchema } = {
|
|
39
|
+
type: undefined,
|
|
40
|
+
json_schema: undefined,
|
|
41
|
+
}, }, } = req;
|
|
39
42
|
isStream = !!stream;
|
|
40
43
|
const startStream = () => {
|
|
41
44
|
if (!res.headersSent) {
|
|
@@ -52,6 +55,7 @@ function handle(aiProvider) {
|
|
|
52
55
|
model,
|
|
53
56
|
action,
|
|
54
57
|
responseFormat: responseFormatType,
|
|
58
|
+
jsonSchema,
|
|
55
59
|
client,
|
|
56
60
|
context,
|
|
57
61
|
request: req,
|
|
@@ -23,15 +23,16 @@ function handle(aiProvider) {
|
|
|
23
23
|
context: req.crowdinContext,
|
|
24
24
|
});
|
|
25
25
|
const data = modelList.map((model) => {
|
|
26
|
-
var _a, _b, _c, _d, _e, _f;
|
|
26
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
27
27
|
return ({
|
|
28
28
|
id: model.id,
|
|
29
29
|
supportsJsonMode: (_a = model.supportsJsonMode) !== null && _a !== void 0 ? _a : false,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
supportsJsonSchema: (_b = model.supportsJsonSchema) !== null && _b !== void 0 ? _b : false,
|
|
31
|
+
supportsFunctionCalling: (_c = model.supportsFunctionCalling) !== null && _c !== void 0 ? _c : false,
|
|
32
|
+
supportsStreaming: (_d = model.supportsStreaming) !== null && _d !== void 0 ? _d : false,
|
|
33
|
+
supportsVision: (_e = model.supportsVision) !== null && _e !== void 0 ? _e : false,
|
|
34
|
+
contextWindowLimit: (_f = model.contextWindowLimit) !== null && _f !== void 0 ? _f : exports.CONTEXT_WINDOW_LIMIT,
|
|
35
|
+
outputLimit: (_g = model.outputLimit) !== null && _g !== void 0 ? _g : exports.CONTEXT_WINDOW_LIMIT,
|
|
35
36
|
});
|
|
36
37
|
});
|
|
37
38
|
res.send({ data });
|
|
@@ -17,11 +17,12 @@ export interface AiProviderModule extends Environments, ModuleKey {
|
|
|
17
17
|
/**
|
|
18
18
|
* processes a sequence of conversation messages and generates responses from the assistant
|
|
19
19
|
*/
|
|
20
|
-
chatCompletions: ({ messages, model, action, responseFormat, client, context, request, isStream, sendEvent, tools, toolChoice, }: {
|
|
20
|
+
chatCompletions: ({ messages, model, action, responseFormat, jsonSchema, client, context, request, isStream, sendEvent, tools, toolChoice, }: {
|
|
21
21
|
messages: ChatCompletionMessage[];
|
|
22
22
|
model: string;
|
|
23
23
|
action: string;
|
|
24
|
-
responseFormat
|
|
24
|
+
responseFormat?: ChatCompletionResponseFormat;
|
|
25
|
+
jsonSchema?: ChatCompletionJsonSchema;
|
|
25
26
|
client: Crowdin;
|
|
26
27
|
context: CrowdinContextInfo;
|
|
27
28
|
request: CrowdinClientRequest;
|
|
@@ -41,6 +42,7 @@ export interface AiProviderModule extends Environments, ModuleKey {
|
|
|
41
42
|
export interface SupportedModels {
|
|
42
43
|
id: string;
|
|
43
44
|
supportsJsonMode?: boolean;
|
|
45
|
+
supportsJsonSchema?: boolean;
|
|
44
46
|
supportsFunctionCalling?: boolean;
|
|
45
47
|
supportsStreaming?: boolean;
|
|
46
48
|
supportsVision?: boolean;
|
|
@@ -64,7 +66,7 @@ export interface ChatCompletionToolFunctionDeclaration {
|
|
|
64
66
|
* The parameters the functions accepts, described as a JSON Schema object.
|
|
65
67
|
* https://json-schema.org/understanding-json-schema/
|
|
66
68
|
*/
|
|
67
|
-
parameters?:
|
|
69
|
+
parameters?: Record<string, unknown>;
|
|
68
70
|
}
|
|
69
71
|
export interface AiToolChoice {
|
|
70
72
|
type: 'function';
|
|
@@ -75,6 +77,26 @@ export interface AiToolChoice {
|
|
|
75
77
|
name: string;
|
|
76
78
|
};
|
|
77
79
|
}
|
|
80
|
+
export interface ChatCompletionJsonSchema {
|
|
81
|
+
/**
|
|
82
|
+
* The name of the response format.
|
|
83
|
+
*/
|
|
84
|
+
name: string;
|
|
85
|
+
/**
|
|
86
|
+
* A description of what the response format is for, used by the model to determine how to respond in the format.
|
|
87
|
+
*/
|
|
88
|
+
description?: string;
|
|
89
|
+
/**
|
|
90
|
+
* The schema for the response format, described as a JSON Schema object.
|
|
91
|
+
* https://json-schema.org/understanding-json-schema/
|
|
92
|
+
*/
|
|
93
|
+
schema: Record<string, unknown>;
|
|
94
|
+
/**
|
|
95
|
+
* Whether to enable strict schema adherence when generating the output.
|
|
96
|
+
*/
|
|
97
|
+
strict?: boolean;
|
|
98
|
+
}
|
|
99
|
+
export type ChatCompletionResponseFormat = 'text' | 'json_object' | 'json_schema';
|
|
78
100
|
export type ChatCompletionMessage = ChatCompletionSystemMessage | ChatCompletionUserMessage | ChatCompletionAssistantMessage | ChatCompletionToolMessage;
|
|
79
101
|
export interface ChatCompletionSystemMessage {
|
|
80
102
|
role: 'system';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Response } from 'express';
|
|
2
2
|
import { IntegrationLogic } from '../types';
|
|
3
|
-
export default function handle(integration: IntegrationLogic): (req: import("express").Request | import("
|
|
3
|
+
export default function handle(integration: IntegrationLogic): (req: import("express").Request | import("../../..").CrowdinClientRequest, res: Response, next: Function) => void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Response } from 'express';
|
|
2
|
-
export default function handle(): (req: import("express").Request | import("
|
|
2
|
+
export default function handle(): (req: import("express").Request | import("../../..").CrowdinClientRequest, res: Response, next: Function) => void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Response } from 'express';
|
|
2
|
-
export default function handle(): (req: import("express").Request | import("
|
|
2
|
+
export default function handle(): (req: import("express").Request | import("../../..").CrowdinClientRequest, res: Response, next: Function) => void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Response } from 'express';
|
|
2
|
-
export default function handle(): (req: import("express").Request | import("
|
|
2
|
+
export default function handle(): (req: import("express").Request | import("../../..").CrowdinClientRequest, res: Response, next: Function) => void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Response } from 'express';
|
|
2
|
-
export default function handle(): (req: import("express").Request | import("
|
|
2
|
+
export default function handle(): (req: import("express").Request | import("../../..").CrowdinClientRequest, res: Response, next: Function) => void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Response } from 'express';
|
|
2
2
|
import { IntegrationLogic } from '../types';
|
|
3
|
-
export default function handle(integration: IntegrationLogic): (req: import("express").Request | import("
|
|
3
|
+
export default function handle(integration: IntegrationLogic): (req: import("express").Request | import("../../..").CrowdinClientRequest, res: Response, next: Function) => void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Response } from 'express';
|
|
2
|
-
export default function handle(): (req: import("express").Request | import("
|
|
2
|
+
export default function handle(): (req: import("express").Request | import("../../..").CrowdinClientRequest, res: Response, next: Function) => void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Response } from 'express';
|
|
2
|
-
export default function handle(): (req: import("express").Request | import("
|
|
2
|
+
export default function handle(): (req: import("express").Request | import("../../..").CrowdinClientRequest, res: Response, next: Function) => void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Response } from 'express';
|
|
2
|
-
export default function handle(): (req: import("express").Request | import("
|
|
2
|
+
export default function handle(): (req: import("express").Request | import("../../..").CrowdinClientRequest, res: Response, next: Function) => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Crowdin, { UsersModel } from '@crowdin/crowdin-api-client';
|
|
2
2
|
import { Response } from 'express';
|
|
3
3
|
export type ProjectMember = UsersModel.ProjectMember | UsersModel.EnterpriseProjectMember;
|
|
4
|
-
export default function handle(): (req: import("express").Request | import("
|
|
4
|
+
export default function handle(): (req: import("express").Request | import("../../..").CrowdinClientRequest, res: Response, next: Function) => void;
|
|
5
5
|
export declare function isManager({ client, projectId, memberId, }: {
|
|
6
6
|
client: Crowdin;
|
|
7
7
|
projectId: number;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./types"), exports);
|
|
18
|
+
__exportStar(require("./cron"), exports);
|
|
19
|
+
__exportStar(require("./defaults"), exports);
|
package/out/modules/manifest.js
CHANGED
|
@@ -575,9 +575,9 @@ function handle(config) {
|
|
|
575
575
|
item.key = key;
|
|
576
576
|
const base = isSingle ? '/prompt-provider' : `/prompt-provider/${key}`;
|
|
577
577
|
const logoPath = isSingle ? '/ai-prompt-provider' : `/ai-prompt-provider-${key}`;
|
|
578
|
-
return Object.assign(Object.assign(Object.assign({ key, name: item.name || config.name, logo: (0, util_1.getLogoUrl)(config, item, logoPath), compileUrl: `${base}/compile` }, ((0, util_1.isDefined)(item.allowRetryOnQaIssues) && {
|
|
578
|
+
return Object.assign(Object.assign(Object.assign(Object.assign({ key, name: item.name || config.name, logo: (0, util_1.getLogoUrl)(config, item, logoPath), compileUrl: `${base}/compile` }, ((0, util_1.isDefined)(item.allowRetryOnQaIssues) && {
|
|
579
579
|
allowRetryOnQaIssues: item.allowRetryOnQaIssues,
|
|
580
|
-
})), (item.actions ? { actions: item.actions } : {})), (item.formSchema || item.uiPath
|
|
580
|
+
})), (item.actions ? { actions: item.actions } : {})), (item.status ? { statusUrl: `${base}/status` } : {})), (item.formSchema || item.uiPath
|
|
581
581
|
? { configuratorUrl: `${base}/settings/` + (item.fileName || 'index.html') }
|
|
582
582
|
: {}));
|
|
583
583
|
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Request, Response } from 'express';
|
|
2
|
-
export default function handle(): (req: Request | import("
|
|
2
|
+
export default function handle(): (req: Request | import("..").CrowdinClientRequest, res: Response, next: Function) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Storage } from './';
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.logger = exports.executeWithRetry = exports.decryptData = exports.encryptData = exports.extractBaseUrlFromRequest = exports.CodeError = exports.isAppFree = exports.prepareCrowdinClient = void 0;
|
|
37
|
+
var connection_1 = require("./connection");
|
|
38
|
+
Object.defineProperty(exports, "prepareCrowdinClient", { enumerable: true, get: function () { return connection_1.prepareCrowdinClient; } });
|
|
39
|
+
var subscription_1 = require("./subscription");
|
|
40
|
+
Object.defineProperty(exports, "isAppFree", { enumerable: true, get: function () { return subscription_1.isAppFree; } });
|
|
41
|
+
var _1 = require("./");
|
|
42
|
+
Object.defineProperty(exports, "CodeError", { enumerable: true, get: function () { return _1.CodeError; } });
|
|
43
|
+
Object.defineProperty(exports, "extractBaseUrlFromRequest", { enumerable: true, get: function () { return _1.extractBaseUrlFromRequest; } });
|
|
44
|
+
Object.defineProperty(exports, "encryptData", { enumerable: true, get: function () { return _1.encryptData; } });
|
|
45
|
+
Object.defineProperty(exports, "decryptData", { enumerable: true, get: function () { return _1.decryptData; } });
|
|
46
|
+
Object.defineProperty(exports, "executeWithRetry", { enumerable: true, get: function () { return _1.executeWithRetry; } });
|
|
47
|
+
exports.logger = __importStar(require("./logger"));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crowdin/app-project-module",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.13.0",
|
|
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",
|
|
@@ -24,6 +24,26 @@
|
|
|
24
24
|
"require": "./out/modules/*/types.js",
|
|
25
25
|
"import": "./out/modules/*/types.js",
|
|
26
26
|
"types": "./out/modules/*/types.d.ts"
|
|
27
|
+
},
|
|
28
|
+
"./storage": {
|
|
29
|
+
"require": "./out/storage/export.js",
|
|
30
|
+
"import": "./out/storage/export.js",
|
|
31
|
+
"types": "./out/storage/export.d.ts"
|
|
32
|
+
},
|
|
33
|
+
"./util": {
|
|
34
|
+
"require": "./out/util/export.js",
|
|
35
|
+
"import": "./out/util/export.js",
|
|
36
|
+
"types": "./out/util/export.d.ts"
|
|
37
|
+
},
|
|
38
|
+
"./middlewares": {
|
|
39
|
+
"require": "./out/middlewares/export.js",
|
|
40
|
+
"import": "./out/middlewares/export.js",
|
|
41
|
+
"types": "./out/middlewares/export.d.ts"
|
|
42
|
+
},
|
|
43
|
+
"./modules/integration/util": {
|
|
44
|
+
"require": "./out/modules/integration/util/export.js",
|
|
45
|
+
"import": "./out/modules/integration/util/export.js",
|
|
46
|
+
"types": "./out/modules/integration/util/export.d.ts"
|
|
27
47
|
}
|
|
28
48
|
},
|
|
29
49
|
"scripts": {
|