@giteeteam/apps-manifest 0.5.3 → 0.6.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/lib/manifest.d.ts +1 -0
- package/lib/manifest.js +3 -0
- package/lib/schema/all.json +3 -0
- package/lib/schema/mq.json +28 -0
- package/lib/types.d.ts +20 -0
- package/lib/validate.d.ts +7 -0
- package/lib/validate.js +4 -1
- package/package.json +1 -1
package/lib/manifest.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export declare class Manifest {
|
|
|
9
9
|
get modules(): import("./types").TManifestModules;
|
|
10
10
|
get storage(): import("./types").IStorage | undefined;
|
|
11
11
|
get locales(): import("./types").TManifestLocales | undefined;
|
|
12
|
+
get mq(): import("./types").IMq[] | undefined;
|
|
12
13
|
getManifest(): IManifest;
|
|
13
14
|
getManifestString(): string;
|
|
14
15
|
/**
|
package/lib/manifest.js
CHANGED
package/lib/schema/all.json
CHANGED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$id": "http://proxima.com/schemas/mq.json",
|
|
3
|
+
"type": "array",
|
|
4
|
+
"minItems": 1,
|
|
5
|
+
"uniqueItems": true,
|
|
6
|
+
"uniqueItemProperties": [
|
|
7
|
+
"key"
|
|
8
|
+
],
|
|
9
|
+
"items": {
|
|
10
|
+
"type": "object",
|
|
11
|
+
"properties": {
|
|
12
|
+
"key": {
|
|
13
|
+
"type": "string"
|
|
14
|
+
},
|
|
15
|
+
"type": {
|
|
16
|
+
"type": "string"
|
|
17
|
+
},
|
|
18
|
+
"endpoint": {
|
|
19
|
+
"type": "string"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"required": [
|
|
23
|
+
"key",
|
|
24
|
+
"type",
|
|
25
|
+
"endpoint"
|
|
26
|
+
]
|
|
27
|
+
}
|
|
28
|
+
}
|
package/lib/types.d.ts
CHANGED
|
@@ -56,6 +56,18 @@ export interface IManifestCustomFieldType {
|
|
|
56
56
|
resource: string;
|
|
57
57
|
description?: string;
|
|
58
58
|
}
|
|
59
|
+
export interface IConsumer {
|
|
60
|
+
key: string;
|
|
61
|
+
queue: string;
|
|
62
|
+
resolver: {
|
|
63
|
+
function: string;
|
|
64
|
+
method: string;
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
export interface IMqConsumer extends IConsumer {
|
|
68
|
+
mq: string;
|
|
69
|
+
messageTransformer: Record<string, any>;
|
|
70
|
+
}
|
|
59
71
|
export type TManifestModules = {
|
|
60
72
|
[k in string]?: IManifestModule[];
|
|
61
73
|
} & {
|
|
@@ -65,6 +77,8 @@ export type TManifestModules = {
|
|
|
65
77
|
customField?: IManifestCustomField[];
|
|
66
78
|
customFieldType?: IManifestCustomFieldType[];
|
|
67
79
|
customItemType?: any[];
|
|
80
|
+
consumer?: IConsumer[];
|
|
81
|
+
mqConsumer?: IMqConsumer[];
|
|
68
82
|
};
|
|
69
83
|
export type TDependProduct = 'team' | 'one';
|
|
70
84
|
export type TManifestLanguage = 'en-US' | 'zh-CN' | 'ru-RU';
|
|
@@ -86,6 +100,11 @@ export interface IStorageEntity {
|
|
|
86
100
|
export interface IStorage {
|
|
87
101
|
entities: IStorageEntity[];
|
|
88
102
|
}
|
|
103
|
+
export interface IMq {
|
|
104
|
+
key: string;
|
|
105
|
+
type: string;
|
|
106
|
+
endpoint: string;
|
|
107
|
+
}
|
|
89
108
|
export interface IManifest {
|
|
90
109
|
app: IManifestApp;
|
|
91
110
|
modules: TManifestModules;
|
|
@@ -94,4 +113,5 @@ export interface IManifest {
|
|
|
94
113
|
locales?: TManifestLocales;
|
|
95
114
|
dependVersion?: TDependVersion;
|
|
96
115
|
storage?: IStorage;
|
|
116
|
+
mq?: IMq[];
|
|
97
117
|
}
|
package/lib/validate.d.ts
CHANGED
|
@@ -58,3 +58,10 @@ export declare const validateStorage: (json: IManifest) => {
|
|
|
58
58
|
message: string | undefined;
|
|
59
59
|
}[] | null;
|
|
60
60
|
};
|
|
61
|
+
export declare const validateMq: (json: IManifest) => {
|
|
62
|
+
pass: boolean | Promise<unknown> | undefined;
|
|
63
|
+
errors: {
|
|
64
|
+
path: string;
|
|
65
|
+
message: string | undefined;
|
|
66
|
+
}[] | null;
|
|
67
|
+
};
|
package/lib/validate.js
CHANGED
|
@@ -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.validateStorage = exports.validateDependVersion = exports.validateLocales = exports.validateTables = exports.validateResources = exports.validateModules = exports.validateApp = exports.validateAll = void 0;
|
|
6
|
+
exports.validateMq = exports.validateStorage = exports.validateDependVersion = exports.validateLocales = exports.validateTables = exports.validateResources = exports.validateModules = exports.validateApp = exports.validateAll = void 0;
|
|
7
7
|
const ajv_1 = __importDefault(require("ajv"));
|
|
8
8
|
const ajv_keywords_1 = __importDefault(require("ajv-keywords"));
|
|
9
9
|
const lodash_1 = require("lodash");
|
|
@@ -21,6 +21,7 @@ const tables_json_1 = __importDefault(require("./schema/tables.json"));
|
|
|
21
21
|
const locales_json_1 = __importDefault(require("./schema/locales.json"));
|
|
22
22
|
const dependVersion_json_1 = __importDefault(require("./schema/dependVersion.json"));
|
|
23
23
|
const storage_json_1 = __importDefault(require("./schema/storage.json"));
|
|
24
|
+
const mq_json_1 = __importDefault(require("./schema/mq.json"));
|
|
24
25
|
const validateResource = (json) => {
|
|
25
26
|
const errors = [];
|
|
26
27
|
const frontendModules = ['adminPage', 'itemPanel', 'itemActivity', 'appPage'];
|
|
@@ -97,6 +98,7 @@ const validateFactory = (schema) => {
|
|
|
97
98
|
locales_json_1.default,
|
|
98
99
|
dependVersion_json_1.default,
|
|
99
100
|
storage_json_1.default,
|
|
101
|
+
mq_json_1.default,
|
|
100
102
|
],
|
|
101
103
|
});
|
|
102
104
|
(0, ajv_keywords_1.default)(ajv);
|
|
@@ -131,3 +133,4 @@ exports.validateTables = validateFactory('http://proxima.com/schemas/tables.json
|
|
|
131
133
|
exports.validateLocales = validateFactory('http://proxima.com/schemas/locales.json');
|
|
132
134
|
exports.validateDependVersion = validateFactory('http://proxima.com/schemas/dependVersion.json');
|
|
133
135
|
exports.validateStorage = validateFactory('http://proxima.com/schemas/storage.json');
|
|
136
|
+
exports.validateMq = validateFactory('http://proxima.com/schemas/mq.json');
|