@giteeteam/apps-manifest 0.8.0 → 0.8.2

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.
@@ -1,151 +1,151 @@
1
- {
2
- "$id": "http://proxima.com/schemas/tables.json",
3
- "type": "array",
4
- "minItems": 1,
5
- "uniqueItems": true,
6
- "uniqueItemProperties": [
7
- "className"
8
- ],
9
- "items": {
10
- "type": "object",
11
- "properties": {
12
- "className": {
13
- "type": "string",
14
- "regexp": {
15
- "pattern": "(^_([a-zA-Z0-9]_?)*$)|(^[a-zA-Z](_?[a-zA-Z0-9])*_?$)",
16
- "flags": "i"
17
- }
18
- },
19
- "fields": {
20
- "type": "object",
21
- "patternProperties": {
22
- "(^_([a-zA-Z0-9]_?)*$)|(^[a-zA-Z](_?[a-zA-Z0-9])*_?$)": {
23
- "type": "object",
24
- "anyOf": [
25
- {
26
- "type": "object",
27
- "properties": {
28
- "type": {
29
- "type": "string",
30
- "enum": [
31
- "Pointer",
32
- "Relation"
33
- ]
34
- },
35
- "targetClass": {
36
- "type": "string",
37
- "regexp": {
38
- "pattern": "(^_([a-zA-Z0-9]_?)*$)|(^[a-zA-Z](_?[a-zA-Z0-9])*_?$)",
39
- "flags": "i"
40
- }
41
- },
42
- "isAppClass": {
43
- "type": "boolean",
44
- "default": false
45
- }
46
- },
47
- "required": [
48
- "type", "targetClass"
49
- ]
50
- },
51
- {
52
- "type": "object",
53
- "properties": {
54
- "type": {
55
- "type": "string",
56
- "const": "String"
57
- },
58
- "defaultValue": {
59
- "type": "string"
60
- }
61
- },
62
- "required": [
63
- "type"
64
- ]
65
- },
66
- {
67
- "type": "object",
68
- "properties": {
69
- "type": {
70
- "type": "string",
71
- "const": "Boolean"
72
- },
73
- "defaultValue": {
74
- "type": "boolean"
75
- }
76
- },
77
- "required": [
78
- "type"
79
- ]
80
- },
81
- {
82
- "type": "object",
83
- "properties": {
84
- "type": {
85
- "type": "string",
86
- "const": "Number"
87
- },
88
- "defaultValue": {
89
- "type": "number"
90
- }
91
- },
92
- "required": [
93
- "type"
94
- ]
95
- },
96
- {
97
- "type": "object",
98
- "properties": {
99
- "type": {
100
- "type": "string",
101
- "const": "Object"
102
- },
103
- "defaultValue": {
104
- "type": "object"
105
- }
106
- },
107
- "required": [
108
- "type"
109
- ]
110
- },
111
- {
112
- "type": "object",
113
- "properties": {
114
- "type": {
115
- "type": "string",
116
- "const": "Array"
117
- },
118
- "defaultValue": {
119
- "type": "array"
120
- }
121
- },
122
- "required": [
123
- "type"
124
- ]
125
- },
126
- {
127
- "type": "object",
128
- "properties": {
129
- "type": {
130
- "type": "string",
131
- "enum": [
132
- "Date",
133
- "File"
134
- ]
135
- }
136
- },
137
- "required": [
138
- "type"
139
- ]
140
- }
141
- ]
142
- }
143
- },
144
- "additionalProperties": false
145
- }
146
- },
147
- "required": [
148
- "className", "fields"
149
- ]
150
- }
151
- }
1
+ {
2
+ "$id": "http://proxima.com/schemas/tables.json",
3
+ "type": "array",
4
+ "minItems": 1,
5
+ "uniqueItems": true,
6
+ "uniqueItemProperties": [
7
+ "className"
8
+ ],
9
+ "items": {
10
+ "type": "object",
11
+ "properties": {
12
+ "className": {
13
+ "type": "string",
14
+ "regexp": {
15
+ "pattern": "(^_([a-zA-Z0-9]_?)*$)|(^[a-zA-Z](_?[a-zA-Z0-9])*_?$)",
16
+ "flags": "i"
17
+ }
18
+ },
19
+ "fields": {
20
+ "type": "object",
21
+ "patternProperties": {
22
+ "(^_([a-zA-Z0-9]_?)*$)|(^[a-zA-Z](_?[a-zA-Z0-9])*_?$)": {
23
+ "type": "object",
24
+ "anyOf": [
25
+ {
26
+ "type": "object",
27
+ "properties": {
28
+ "type": {
29
+ "type": "string",
30
+ "enum": [
31
+ "Pointer",
32
+ "Relation"
33
+ ]
34
+ },
35
+ "targetClass": {
36
+ "type": "string",
37
+ "regexp": {
38
+ "pattern": "(^_([a-zA-Z0-9]_?)*$)|(^[a-zA-Z](_?[a-zA-Z0-9])*_?$)",
39
+ "flags": "i"
40
+ }
41
+ },
42
+ "isAppClass": {
43
+ "type": "boolean",
44
+ "default": false
45
+ }
46
+ },
47
+ "required": [
48
+ "type", "targetClass"
49
+ ]
50
+ },
51
+ {
52
+ "type": "object",
53
+ "properties": {
54
+ "type": {
55
+ "type": "string",
56
+ "const": "String"
57
+ },
58
+ "defaultValue": {
59
+ "type": "string"
60
+ }
61
+ },
62
+ "required": [
63
+ "type"
64
+ ]
65
+ },
66
+ {
67
+ "type": "object",
68
+ "properties": {
69
+ "type": {
70
+ "type": "string",
71
+ "const": "Boolean"
72
+ },
73
+ "defaultValue": {
74
+ "type": "boolean"
75
+ }
76
+ },
77
+ "required": [
78
+ "type"
79
+ ]
80
+ },
81
+ {
82
+ "type": "object",
83
+ "properties": {
84
+ "type": {
85
+ "type": "string",
86
+ "const": "Number"
87
+ },
88
+ "defaultValue": {
89
+ "type": "number"
90
+ }
91
+ },
92
+ "required": [
93
+ "type"
94
+ ]
95
+ },
96
+ {
97
+ "type": "object",
98
+ "properties": {
99
+ "type": {
100
+ "type": "string",
101
+ "const": "Object"
102
+ },
103
+ "defaultValue": {
104
+ "type": "object"
105
+ }
106
+ },
107
+ "required": [
108
+ "type"
109
+ ]
110
+ },
111
+ {
112
+ "type": "object",
113
+ "properties": {
114
+ "type": {
115
+ "type": "string",
116
+ "const": "Array"
117
+ },
118
+ "defaultValue": {
119
+ "type": "array"
120
+ }
121
+ },
122
+ "required": [
123
+ "type"
124
+ ]
125
+ },
126
+ {
127
+ "type": "object",
128
+ "properties": {
129
+ "type": {
130
+ "type": "string",
131
+ "enum": [
132
+ "Date",
133
+ "File"
134
+ ]
135
+ }
136
+ },
137
+ "required": [
138
+ "type"
139
+ ]
140
+ }
141
+ ]
142
+ }
143
+ },
144
+ "additionalProperties": false
145
+ }
146
+ },
147
+ "required": [
148
+ "className", "fields"
149
+ ]
150
+ }
151
+ }
package/lib/types.d.ts CHANGED
@@ -1,130 +1,132 @@
1
- export type TriggerEvent = string;
2
- export interface IManifestResource {
3
- key: string;
4
- path: string;
5
- }
6
- export interface IManifestApp {
7
- id?: string;
8
- name?: string;
9
- key?: string;
10
- description?: string;
11
- version?: string;
12
- global?: boolean;
13
- category?: string;
14
- }
15
- export type LoadType = 'micro' | 'iframe' | 'remoteJs' | 'redirect' | 'uikit';
16
- export interface IManifestModule {
17
- key: string;
18
- loadType?: LoadType;
19
- title?: string;
20
- viewType?: string;
21
- function?: string;
22
- resource?: string;
23
- route?: string;
24
- type?: string;
25
- displayConditions?: Record<string, any>;
26
- resolver?: {
27
- function: string;
28
- method?: string;
29
- };
30
- parent?: string;
31
- }
32
- export interface IManifestFunction {
33
- key: string;
34
- handler: string;
35
- timeout?: number;
36
- }
37
- export interface IManifestImporterItemField {
38
- key: string;
39
- title: string;
40
- }
41
- export interface IManifestImporter {
42
- function: string;
43
- validate: string;
44
- itemFields: IManifestImporterItemField[];
45
- }
46
- export interface IManifestTrigger {
47
- key: string;
48
- function: string;
49
- events: TriggerEvent[];
50
- /** 是否异步执行trigger */
51
- async?: boolean;
52
- }
53
- export interface IManifestCustomField {
54
- key: string;
55
- name: string;
56
- type: string;
57
- description?: string;
58
- }
59
- export interface IManifestCustomFieldType {
60
- key: string;
61
- name: string;
62
- dataType: string;
63
- resource: string;
64
- description?: string;
65
- }
66
- export interface IConsumer {
67
- key: string;
68
- queue: string;
69
- resolver: {
70
- function: string;
71
- method: string;
72
- };
73
- }
74
- export interface IMessageQueueConsumer extends IConsumer {
75
- messageQueue: string;
76
- messageTransformer: Record<string, any>;
77
- }
78
- export interface IScheduledTrigger {
79
- key: string;
80
- function: string;
81
- cronTime: string;
82
- }
83
- export type TManifestModules = {
84
- [k in string]?: IManifestModule[];
85
- } & {
86
- function?: IManifestFunction[];
87
- trigger?: IManifestTrigger[];
88
- importer?: IManifestImporter;
89
- customField?: IManifestCustomField[];
90
- customFieldType?: IManifestCustomFieldType[];
91
- customItemType?: any[];
92
- consumer?: IConsumer[];
93
- messageQueueConsumer?: IMessageQueueConsumer[];
94
- scheduledTrigger?: IScheduledTrigger[];
95
- };
96
- export type TDependProduct = 'team' | 'one';
97
- export type TManifestLanguage = 'en-US' | 'zh-CN' | 'ru-RU';
98
- export type TManifestLocalesItem = Record<string, string>;
99
- export type TManifestLocalesItems = Record<string, TManifestLocalesItem>;
100
- export type TManifestLocales = Record<TManifestLanguage, TManifestLocalesItems>;
101
- export type TDependVersion = Record<TDependProduct, string[]>;
102
- export type TStorageAttributeType = 'String' | 'Float' | 'Date' | 'Boolean';
103
- export interface IStorageAttribute {
104
- type: TStorageAttributeType;
105
- required?: boolean;
106
- defaultValue?: any;
107
- }
108
- export interface IStorageEntity {
109
- name: string;
110
- attributes: Record<string, IStorageAttribute>;
111
- indexes?: string[];
112
- }
113
- export interface IStorage {
114
- entities: IStorageEntity[];
115
- }
116
- export interface IMessageQueue {
117
- key: string;
118
- type: string;
119
- endpoint: string;
120
- }
121
- export interface IManifest {
122
- app: IManifestApp;
123
- modules: TManifestModules;
124
- tables?: any;
125
- resources?: IManifestResource[];
126
- locales?: TManifestLocales;
127
- dependVersion?: TDependVersion;
128
- storage?: IStorage;
129
- messageQueues?: IMessageQueue[];
130
- }
1
+ export type TriggerEvent = string;
2
+ export interface IManifestResource {
3
+ key: string;
4
+ path: string;
5
+ }
6
+ export interface IManifestApp {
7
+ id?: string;
8
+ name?: string;
9
+ key?: string;
10
+ description?: string;
11
+ version?: string;
12
+ global?: boolean;
13
+ category?: string;
14
+ }
15
+ export type LoadType = 'micro' | 'iframe' | 'remoteJs' | 'redirect' | 'uikit';
16
+ export interface IManifestModule {
17
+ key: string;
18
+ loadType?: LoadType;
19
+ title?: string;
20
+ viewType?: string;
21
+ function?: string;
22
+ resource?: string;
23
+ route?: string;
24
+ type?: string;
25
+ displayConditions?: Record<string, any>;
26
+ resolver?: {
27
+ function: string;
28
+ method?: string;
29
+ };
30
+ parent?: string;
31
+ }
32
+ export interface IManifestFunction {
33
+ key: string;
34
+ handler: string;
35
+ timeout?: number;
36
+ runtime?: string;
37
+ }
38
+ export interface IManifestImporterItemField {
39
+ key: string;
40
+ title: string;
41
+ }
42
+ export interface IManifestImporter {
43
+ function: string;
44
+ validate: string;
45
+ after?: string;
46
+ itemFields: IManifestImporterItemField[];
47
+ }
48
+ export interface IManifestTrigger {
49
+ key: string;
50
+ function: string;
51
+ events: TriggerEvent[];
52
+ /** 是否异步执行trigger */
53
+ async?: boolean;
54
+ }
55
+ export interface IManifestCustomField {
56
+ key: string;
57
+ name: string;
58
+ type: string;
59
+ description?: string;
60
+ }
61
+ export interface IManifestCustomFieldType {
62
+ key: string;
63
+ name: string;
64
+ dataType: string;
65
+ resource: string;
66
+ description?: string;
67
+ }
68
+ export interface IConsumer {
69
+ key: string;
70
+ queue: string;
71
+ resolver: {
72
+ function: string;
73
+ method: string;
74
+ };
75
+ }
76
+ export interface IMessageQueueConsumer extends IConsumer {
77
+ messageQueue: string;
78
+ messageTransformer: Record<string, any>;
79
+ }
80
+ export interface IScheduledTrigger {
81
+ key: string;
82
+ function: string;
83
+ cronTime: string;
84
+ }
85
+ export type TManifestModules = {
86
+ [k in string]?: IManifestModule[];
87
+ } & {
88
+ function?: IManifestFunction[];
89
+ trigger?: IManifestTrigger[];
90
+ importer?: IManifestImporter;
91
+ customField?: IManifestCustomField[];
92
+ customFieldType?: IManifestCustomFieldType[];
93
+ customItemType?: any[];
94
+ consumer?: IConsumer[];
95
+ messageQueueConsumer?: IMessageQueueConsumer[];
96
+ scheduledTrigger?: IScheduledTrigger[];
97
+ };
98
+ export type TDependProduct = 'team' | 'one';
99
+ export type TManifestLanguage = 'en-US' | 'zh-CN' | 'ru-RU';
100
+ export type TManifestLocalesItem = Record<string, string>;
101
+ export type TManifestLocalesItems = Record<string, TManifestLocalesItem>;
102
+ export type TManifestLocales = Record<TManifestLanguage, TManifestLocalesItems>;
103
+ export type TDependVersion = Record<TDependProduct, string[]>;
104
+ export type TStorageAttributeType = 'String' | 'Float' | 'Date' | 'Boolean';
105
+ export interface IStorageAttribute {
106
+ type: TStorageAttributeType;
107
+ required?: boolean;
108
+ defaultValue?: any;
109
+ }
110
+ export interface IStorageEntity {
111
+ name: string;
112
+ attributes: Record<string, IStorageAttribute>;
113
+ indexes?: string[];
114
+ }
115
+ export interface IStorage {
116
+ entities: IStorageEntity[];
117
+ }
118
+ export interface IMessageQueue {
119
+ key: string;
120
+ type: string;
121
+ endpoint: string;
122
+ }
123
+ export interface IManifest {
124
+ app: IManifestApp;
125
+ modules: TManifestModules;
126
+ tables?: any;
127
+ resources?: IManifestResource[];
128
+ locales?: TManifestLocales;
129
+ dependVersion?: TDependVersion;
130
+ storage?: IStorage;
131
+ messageQueues?: IMessageQueue[];
132
+ }
package/lib/types.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });