@beseif-solutions/prow-core 0.0.34 → 0.0.35
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/dist/entities/commons.js +2 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -1
- package/dist/minified-utils/locales.d.ts +1 -0
- package/dist/minified-utils/locales.js +6 -1
- package/package.json +1 -1
- package/src/entities/commons.ts +2 -1
- package/src/index.ts +1 -1
- package/src/minified-utils/locales.ts +8 -0
package/dist/entities/commons.js
CHANGED
|
@@ -5,7 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.commonSchema = exports.idSchema = void 0;
|
|
7
7
|
const joi_1 = __importDefault(require("joi"));
|
|
8
|
-
const idSchema = () => joi_1.default.string().required().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/)
|
|
8
|
+
const idSchema = () => joi_1.default.string().required().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/)
|
|
9
|
+
.invalid(`ui`);
|
|
9
10
|
exports.idSchema = idSchema;
|
|
10
11
|
const commonSchema = () => joi_1.default.object({
|
|
11
12
|
id: (0, exports.idSchema)(),
|
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,6 @@ export { Action, actionOutputSchema, actionSchema, Event, eventSchema, Immediate
|
|
|
5
5
|
export { Provider, providerSchema } from './entities/provider';
|
|
6
6
|
export { Source } from './entities/source';
|
|
7
7
|
export { extract, Field, fieldSchema, fieldsSchema, SelectFieldChoice, validate, ValidationResult } from './minified-utils/fields';
|
|
8
|
-
export { i18n, localizeFields, localizeInputs, localizeOutputs, localizeProperties
|
|
8
|
+
export { i18n, LocalizedField, LocalizedProperties, localizeFields, localizeGroup, localizeInputs, localizeOutputs, localizeProperties } from './minified-utils/locales';
|
|
9
9
|
export { Properties } from './minified-utils/properties';
|
|
10
10
|
export { Protocol } from './minified-utils/protocol';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Protocol = exports.Properties = exports.localizeProperties = exports.localizeOutputs = exports.localizeInputs = exports.localizeFields = exports.i18n = exports.validate = exports.fieldsSchema = exports.fieldSchema = exports.extract = exports.providerSchema = exports.triggerSchema = exports.triggerOutputSchema = exports.scheduledTriggerSchema = exports.immediateTriggerSchema = exports.eventSchema = exports.actionSchema = exports.actionOutputSchema = exports.staticCredentialsSchema = exports.sessionCredentialsSchema = exports.oauthCredentialsSchema = exports.credentialsSchema = exports.idSchema = exports.core = void 0;
|
|
3
|
+
exports.Protocol = exports.Properties = exports.localizeProperties = exports.localizeOutputs = exports.localizeInputs = exports.localizeGroup = exports.localizeFields = exports.i18n = exports.validate = exports.fieldsSchema = exports.fieldSchema = exports.extract = exports.providerSchema = exports.triggerSchema = exports.triggerOutputSchema = exports.scheduledTriggerSchema = exports.immediateTriggerSchema = exports.eventSchema = exports.actionSchema = exports.actionOutputSchema = exports.staticCredentialsSchema = exports.sessionCredentialsSchema = exports.oauthCredentialsSchema = exports.credentialsSchema = exports.idSchema = exports.core = void 0;
|
|
4
4
|
var core_1 = require("./core");
|
|
5
5
|
Object.defineProperty(exports, "core", { enumerable: true, get: function () { return core_1.core; } });
|
|
6
6
|
var commons_1 = require("./entities/commons");
|
|
@@ -28,6 +28,7 @@ Object.defineProperty(exports, "validate", { enumerable: true, get: function ()
|
|
|
28
28
|
var locales_1 = require("./minified-utils/locales");
|
|
29
29
|
Object.defineProperty(exports, "i18n", { enumerable: true, get: function () { return locales_1.i18n; } });
|
|
30
30
|
Object.defineProperty(exports, "localizeFields", { enumerable: true, get: function () { return locales_1.localizeFields; } });
|
|
31
|
+
Object.defineProperty(exports, "localizeGroup", { enumerable: true, get: function () { return locales_1.localizeGroup; } });
|
|
31
32
|
Object.defineProperty(exports, "localizeInputs", { enumerable: true, get: function () { return locales_1.localizeInputs; } });
|
|
32
33
|
Object.defineProperty(exports, "localizeOutputs", { enumerable: true, get: function () { return locales_1.localizeOutputs; } });
|
|
33
34
|
Object.defineProperty(exports, "localizeProperties", { enumerable: true, get: function () { return locales_1.localizeProperties; } });
|
|
@@ -34,6 +34,7 @@ export declare const i18n: (options: FromCatalog | FromDirectory) => {
|
|
|
34
34
|
};
|
|
35
35
|
export declare const localizeFields: (t: ReturnType<typeof i18n>[`t`], element: Action | Trigger | StaticCredentials | SessionCredentials | Source) => Field<LocalizedField>[];
|
|
36
36
|
export declare const localizeProperties: (t: ReturnType<typeof i18n>[`t`], element: Action | Trigger | Credentials | Provider | Source) => LocalizedProperties;
|
|
37
|
+
export declare const localizeGroup: (t: ReturnType<typeof i18n>[`t`], element: Action | Trigger) => LocalizedProperties;
|
|
37
38
|
export declare const localizeInputs: (t: ReturnType<typeof i18n>[`t`], element: Action) => (ConnectableEvent & LocalizedProperties)[];
|
|
38
39
|
export declare const localizeOutputs: (t: ReturnType<typeof i18n>[`t`], element: Action | Trigger) => (ConnectableEvent & LocalizedProperties)[];
|
|
39
40
|
export {};
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.localizeOutputs = exports.localizeInputs = exports.localizeProperties = exports.localizeFields = exports.i18n = exports.validateDirectory = void 0;
|
|
6
|
+
exports.localizeOutputs = exports.localizeInputs = exports.localizeGroup = exports.localizeProperties = exports.localizeFields = exports.i18n = exports.validateDirectory = void 0;
|
|
7
7
|
const i18n_1 = __importDefault(require("i18n"));
|
|
8
8
|
const lodash_1 = __importDefault(require("lodash"));
|
|
9
9
|
const fs_1 = __importDefault(require("fs"));
|
|
@@ -112,6 +112,11 @@ const localizeProperties = (t, element) => ({
|
|
|
112
112
|
description: t(`${element.id}.description`),
|
|
113
113
|
});
|
|
114
114
|
exports.localizeProperties = localizeProperties;
|
|
115
|
+
const localizeGroup = (t, element) => ({
|
|
116
|
+
name: t(`ui.groups.${element.ui.group}.name`, { fallback: true }),
|
|
117
|
+
description: t(`ui.groups.${element.ui.group}.description`),
|
|
118
|
+
});
|
|
119
|
+
exports.localizeGroup = localizeGroup;
|
|
115
120
|
const localizeConnectable = (t, element, type) => {
|
|
116
121
|
const response = [];
|
|
117
122
|
if (element[type] && element[type].length > 0) {
|
package/package.json
CHANGED
package/src/entities/commons.ts
CHANGED
|
@@ -31,7 +31,8 @@ export type Common<Config extends CommonConfig = {}> = {
|
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
export const idSchema = () =>
|
|
34
|
-
Joi.string().required().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/)
|
|
34
|
+
Joi.string().required().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/)
|
|
35
|
+
.invalid(`ui`);
|
|
35
36
|
|
|
36
37
|
export const commonSchema = () =>
|
|
37
38
|
Joi.object({
|
package/src/index.ts
CHANGED
|
@@ -5,6 +5,6 @@ export { Action, actionOutputSchema, actionSchema, Event, eventSchema, Immediate
|
|
|
5
5
|
export { Provider, providerSchema } from './entities/provider';
|
|
6
6
|
export { Source } from './entities/source';
|
|
7
7
|
export { extract, Field, fieldSchema, fieldsSchema, SelectFieldChoice, validate, ValidationResult } from './minified-utils/fields';
|
|
8
|
-
export { i18n, localizeFields, localizeInputs, localizeOutputs, localizeProperties
|
|
8
|
+
export { i18n, LocalizedField, LocalizedProperties, localizeFields, localizeGroup, localizeInputs, localizeOutputs, localizeProperties } from './minified-utils/locales';
|
|
9
9
|
export { Properties } from './minified-utils/properties';
|
|
10
10
|
export { Protocol } from './minified-utils/protocol';
|
|
@@ -157,6 +157,14 @@ export const localizeProperties = (
|
|
|
157
157
|
description: t(`${element.id}.description`),
|
|
158
158
|
});
|
|
159
159
|
|
|
160
|
+
export const localizeGroup = (
|
|
161
|
+
t: ReturnType<typeof i18n>[`t`],
|
|
162
|
+
element: Action | Trigger,
|
|
163
|
+
): LocalizedProperties => ({
|
|
164
|
+
name: t(`ui.groups.${element.ui.group}.name`, { fallback: true }),
|
|
165
|
+
description: t(`ui.groups.${element.ui.group}.description`),
|
|
166
|
+
});
|
|
167
|
+
|
|
160
168
|
const localizeConnectable = (
|
|
161
169
|
t: ReturnType<typeof i18n>[`t`],
|
|
162
170
|
element: Action | Trigger,
|