@ruiapp/rapid-core 0.1.70 → 0.1.72

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,4 +1,5 @@
1
1
  import * as getUserSettingValues from "./getUserSettingValues";
2
2
  import * as getSystemSettingValues from "./getSystemSettingValues";
3
- declare const _default: (typeof getUserSettingValues | typeof getSystemSettingValues)[];
3
+ import * as setSystemSettingValues from "./setSystemSettingValues";
4
+ declare const _default: (typeof getUserSettingValues | typeof getSystemSettingValues | typeof setSystemSettingValues)[];
4
5
  export default _default;
@@ -1,4 +1,4 @@
1
- declare const _default: {
1
+ declare const _default: ({
2
2
  namespace: string;
3
3
  name: string;
4
4
  code: string;
@@ -8,5 +8,15 @@ declare const _default: {
8
8
  actions: {
9
9
  code: string;
10
10
  }[];
11
- }[];
11
+ } | {
12
+ namespace: string;
13
+ name: string;
14
+ code: string;
15
+ type: "RESTful";
16
+ method: "PATCH";
17
+ endpoint: string;
18
+ actions: {
19
+ code: string;
20
+ }[];
21
+ })[];
12
22
  export default _default;
@@ -1,6 +1,7 @@
1
1
  import { RpdDataModel, CreateEntityOptions, QuoteTableOptions, DatabaseQuery } from "../types";
2
2
  import { CountRowOptions, DeleteRowOptions, FindRowOptions, RowFilterOptions, UpdateRowOptions, ColumnSelectOptions } from "../dataAccess/dataAccessTypes";
3
3
  export interface BuildQueryContext {
4
+ model: RpdDataModel;
4
5
  builder: QueryBuilder;
5
6
  params: any[];
6
7
  emitTableAlias: boolean;
@@ -13,7 +14,7 @@ export default class QueryBuilder {
13
14
  constructor(options: InitQueryBuilderOptions);
14
15
  quoteTable(options: QuoteTableOptions): string;
15
16
  quoteObject(name: string): string;
16
- quoteColumn(column: ColumnSelectOptions, emitTableAlias: boolean): string;
17
+ quoteColumn(model: RpdDataModel, column: ColumnSelectOptions, emitTableAlias: boolean): string;
17
18
  select(model: RpdDataModel, options: FindRowOptions): DatabaseQuery;
18
19
  selectDerived(derivedModel: RpdDataModel, baseModel: RpdDataModel, options: FindRowOptions): DatabaseQuery;
19
20
  count(model: RpdDataModel, options: CountRowOptions): DatabaseQuery;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ruiapp/rapid-core",
3
- "version": "0.1.70",
3
+ "version": "0.1.72",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,109 +1,122 @@
1
- export type RowFilterRelationalOperators =
2
- | "eq"
3
- | "ne"
4
- | "lt"
5
- | "lte"
6
- | "gt"
7
- | "gte"
8
- | "contains"
9
- | "notContains"
10
- | "containsCS"
11
- | "notContainsCS"
12
- | "startsWith"
13
- | "notStartsWith"
14
- | "endsWith"
15
- | "notEndsWith";
16
-
17
- export type RowFilterSetOperators = "in" | "notIn";
18
-
19
- export type RowFilterLogicalOperators = "or" | "and";
20
-
21
- export type RowFilterUnaryOperators = "null" | "notNull";
22
-
23
- export type RowFilterExistenceOperators = "exists" | "notExists";
24
-
25
- export type RowFilterOperators =
26
- | RowFilterRelationalOperators
27
- | RowFilterSetOperators
28
- | RowFilterLogicalOperators
29
- | RowFilterUnaryOperators
30
- | RowFilterExistenceOperators;
31
-
32
- export type RowFilterOptions =
33
- | FindRowRelationalFilterOptions
34
- | FindRowSetFilterOptions
35
- | FindRowLogicalFilterOptions
36
- | FindRowUnaryFilterOptions
37
- | FindRowExistenceFilterOptions;
38
-
39
- export type RowNonRelationPropertyFilterOptions = FindRowRelationalFilterOptions | FindRowSetFilterOptions | FindRowUnaryFilterOptions;
40
-
41
- export type ColumnSelectOptions = string | ColumnNameWithTableName;
42
-
43
- export type ColumnNameWithTableName = {
44
- name: string;
45
- tableName?: string;
46
- };
47
-
48
- export interface FindRowOptions {
49
- filters?: RowFilterOptions[];
50
- orderBy?: FindRowOrderByOptions[];
51
- pagination?: FindRowPaginationOptions;
52
- // TODO: may be `columns` is a better name.
53
- fields?: ColumnSelectOptions[];
54
- keepNonPropertyFields?: boolean;
55
- }
56
-
57
- export interface FindRowRelationalFilterOptions {
58
- // TODO: may be `column` is a better name.
59
- field: ColumnSelectOptions;
60
- operator: RowFilterRelationalOperators;
61
- value: any;
62
- }
63
-
64
- export interface FindRowSetFilterOptions {
65
- field: ColumnSelectOptions;
66
- operator: RowFilterSetOperators;
67
- value: any[];
68
- itemType?: string;
69
- }
70
-
71
- export interface FindRowLogicalFilterOptions {
72
- operator: RowFilterLogicalOperators;
73
- filters: RowFilterOptions[];
74
- }
75
-
76
- export interface FindRowUnaryFilterOptions {
77
- field: ColumnSelectOptions;
78
- operator: RowFilterUnaryOperators;
79
- }
80
-
81
- export interface FindRowExistenceFilterOptions {
82
- field: ColumnSelectOptions;
83
- operator: RowFilterExistenceOperators;
84
- filters: RowFilterOptions[];
85
- }
86
-
87
- export interface FindRowPaginationOptions {
88
- offset: number;
89
- limit: number;
90
- withoutTotal?: boolean;
91
- }
92
-
93
- export interface FindRowOrderByOptions {
94
- field: ColumnSelectOptions;
95
- desc?: boolean;
96
- }
97
-
98
- export interface CountRowOptions {
99
- filters?: RowFilterOptions[];
100
- }
101
-
102
- export interface UpdateRowOptions {
103
- filters?: RowFilterOptions[];
104
- entity: any;
105
- }
106
-
107
- export interface DeleteRowOptions {
108
- filters?: RowFilterOptions[];
109
- }
1
+ export type RowFilterRelationalOperators =
2
+ | "eq"
3
+ | "ne"
4
+ | "lt"
5
+ | "lte"
6
+ | "gt"
7
+ | "gte"
8
+ | "contains"
9
+ | "notContains"
10
+ | "containsCS"
11
+ | "notContainsCS"
12
+ | "startsWith"
13
+ | "notStartsWith"
14
+ | "endsWith"
15
+ | "notEndsWith";
16
+
17
+ export type RowFilterSetOperators = "in" | "notIn";
18
+
19
+ export type RowFilterLogicalOperators = "or" | "and";
20
+
21
+ export type RowFilterUnaryOperators = "null" | "notNull";
22
+
23
+ export type RowFilterExistenceOperators = "exists" | "notExists";
24
+
25
+ export type RowFilterOperators =
26
+ | RowFilterRelationalOperators
27
+ | RowFilterSetOperators
28
+ | RowFilterLogicalOperators
29
+ | RowFilterUnaryOperators
30
+ | RowFilterExistenceOperators;
31
+
32
+ export type RowFilterOptions =
33
+ | FindRowRelationalFilterOptions
34
+ | FindRowSetFilterOptions
35
+ | FindRowLogicalFilterOptions
36
+ | FindRowUnaryFilterOptions
37
+ | FindRowExistenceFilterOptions;
38
+
39
+ export type RowNonRelationPropertyFilterOptions = FindRowRelationalFilterOptions | FindRowSetFilterOptions | FindRowUnaryFilterOptions;
40
+
41
+ export type ColumnSelectOptions = string | ColumnNameWithTableName;
42
+
43
+ export type ColumnNameWithTableName = {
44
+ name: string;
45
+ tableName?: string;
46
+ schema?: string;
47
+ };
48
+
49
+ export interface FindRowOptions {
50
+ filters?: RowFilterOptions[];
51
+ orderBy?: FindRowOrderByOptions[];
52
+ pagination?: FindRowPaginationOptions;
53
+ // TODO: may be `columns` is a better name.
54
+ fields?: ColumnSelectOptions[];
55
+ keepNonPropertyFields?: boolean;
56
+ }
57
+
58
+ export interface FindRowRelationalFilterOptions {
59
+ // TODO: may be `column` is a better name.
60
+ field: ColumnSelectOptions;
61
+ operator: RowFilterRelationalOperators;
62
+ value: any;
63
+ }
64
+
65
+ export interface FindRowSetFilterOptions {
66
+ field: ColumnSelectOptions;
67
+ operator: RowFilterSetOperators;
68
+ value: any[];
69
+ itemType?: string;
70
+ }
71
+
72
+ export interface FindRowLogicalFilterOptions {
73
+ operator: RowFilterLogicalOperators;
74
+ filters: RowFilterOptions[];
75
+ }
76
+
77
+ export interface FindRowUnaryFilterOptions {
78
+ field: ColumnSelectOptions;
79
+ operator: RowFilterUnaryOperators;
80
+ }
81
+
82
+ export interface FindRowExistenceFilterOptions {
83
+ field: ColumnSelectOptions;
84
+ operator: RowFilterExistenceOperators;
85
+ filters: RowFilterOptions[];
86
+ }
87
+
88
+ export interface FindRowPaginationOptions {
89
+ offset: number;
90
+ limit: number;
91
+ withoutTotal?: boolean;
92
+ }
93
+
94
+ export interface FindRowOrderByOptions {
95
+ /**
96
+ * 排序字段
97
+ */
98
+ field: ColumnSelectOptions;
99
+
100
+ /**
101
+ * 是否倒序
102
+ */
103
+ desc?: boolean;
104
+
105
+ /**
106
+ * 关系字段
107
+ */
108
+ relationField?: ColumnNameWithTableName;
109
+ }
110
+
111
+ export interface CountRowOptions {
112
+ filters?: RowFilterOptions[];
113
+ }
114
+
115
+ export interface UpdateRowOptions {
116
+ filters?: RowFilterOptions[];
117
+ entity: any;
118
+ }
119
+
120
+ export interface DeleteRowOptions {
121
+ filters?: RowFilterOptions[];
122
+ }