@ruiapp/rapid-core 0.3.2 → 0.3.3
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/index.d.ts +3 -0
- package/dist/index.js +47 -24
- package/dist/utilities/entityUtility.d.ts +1 -0
- package/package.json +1 -1
- package/rollup.config.js +16 -16
- package/src/core/actionHandler.ts +22 -22
- package/src/core/eventManager.ts +20 -20
- package/src/core/facility.ts +7 -7
- package/src/core/http/formDataParser.ts +89 -89
- package/src/core/http-types.ts +4 -4
- package/src/core/pluginManager.ts +175 -175
- package/src/core/providers/runtimeProvider.ts +5 -5
- package/src/core/request.ts +86 -86
- package/src/core/routesBuilder.ts +88 -88
- package/src/deno-std/assert/assert.ts +9 -9
- package/src/deno-std/assert/assertion_error.ts +7 -7
- package/src/deno-std/datetime/to_imf.ts +32 -32
- package/src/deno-std/encoding/base64.ts +141 -141
- package/src/facilities/log/LogFacility.ts +35 -35
- package/src/helpers/inputHelper.ts +11 -11
- package/src/index.ts +3 -0
- package/src/plugins/auth/actionHandlers/deleteSession.ts +18 -18
- package/src/plugins/auth/actionHandlers/getMyProfile.ts +35 -35
- package/src/plugins/auth/actionHandlers/index.ts +8 -8
- package/src/plugins/auth/models/AccessToken.ts +56 -56
- package/src/plugins/auth/models/index.ts +3 -3
- package/src/plugins/auth/routes/changePassword.ts +15 -15
- package/src/plugins/auth/routes/getMyProfile.ts +15 -15
- package/src/plugins/auth/routes/index.ts +7 -7
- package/src/plugins/auth/routes/resetPassword.ts +15 -15
- package/src/plugins/auth/routes/signin.ts +15 -15
- package/src/plugins/auth/routes/signout.ts +15 -15
- package/src/plugins/cronJob/CronJobPluginTypes.ts +49 -49
- package/src/plugins/cronJob/actionHandlers/index.ts +4 -4
- package/src/plugins/cronJob/actionHandlers/runCronJob.ts +29 -29
- package/src/plugins/cronJob/routes/index.ts +3 -3
- package/src/plugins/cronJob/routes/runCronJob.ts +15 -15
- package/src/plugins/dataManage/actionHandlers/queryDatabase.ts +22 -22
- package/src/plugins/fileManage/actionHandlers/uploadFile.ts +33 -33
- package/src/plugins/fileManage/routes/downloadDocument.ts +15 -15
- package/src/plugins/fileManage/routes/downloadFile.ts +15 -15
- package/src/plugins/fileManage/routes/index.ts +5 -5
- package/src/plugins/fileManage/routes/uploadFile.ts +15 -15
- package/src/plugins/metaManage/actionHandlers/getMetaModelDetail.ts +10 -10
- package/src/plugins/metaManage/actionHandlers/listMetaModels.ts +9 -9
- package/src/plugins/metaManage/actionHandlers/listMetaRoutes.ts +9 -9
- package/src/plugins/routeManage/actionHandlers/httpProxy.ts +13 -13
- package/src/plugins/sequence/actionHandlers/index.ts +4 -4
- package/src/plugins/sequence/models/SequenceAutoIncrementRecord.ts +49 -49
- package/src/plugins/sequence/models/SequenceRule.ts +42 -42
- package/src/plugins/sequence/models/index.ts +4 -4
- package/src/plugins/sequence/routes/generateSn.ts +15 -15
- package/src/plugins/sequence/routes/index.ts +3 -3
- package/src/plugins/sequence/segment-utility.ts +11 -11
- package/src/plugins/sequence/segments/index.ts +9 -9
- package/src/plugins/serverOperation/ServerOperationPlugin.ts +91 -91
- package/src/plugins/serverOperation/ServerOperationPluginTypes.ts +15 -15
- package/src/plugins/serverOperation/actionHandlers/index.ts +4 -4
- package/src/plugins/serverOperation/actionHandlers/runServerOperation.ts +15 -15
- package/src/plugins/setting/SettingService.ts +213 -213
- package/src/plugins/setting/actionHandlers/getSystemSettingValues.ts +30 -30
- package/src/plugins/setting/actionHandlers/getUserSettingValues.ts +38 -38
- package/src/plugins/setting/actionHandlers/index.ts +6 -6
- package/src/plugins/setting/actionHandlers/setSystemSettingValues.ts +30 -30
- package/src/plugins/setting/models/SystemSettingGroupSetting.ts +57 -57
- package/src/plugins/setting/models/SystemSettingItemSetting.ts +73 -73
- package/src/plugins/setting/models/UserSettingGroupSetting.ts +57 -57
- package/src/plugins/setting/models/UserSettingItemSetting.ts +73 -73
- package/src/plugins/setting/models/index.ts +8 -8
- package/src/plugins/setting/routes/getSystemSettingValues.ts +15 -15
- package/src/plugins/setting/routes/getUserSettingValues.ts +15 -15
- package/src/plugins/setting/routes/index.ts +5 -5
- package/src/plugins/setting/routes/setSystemSettingValues.ts +15 -15
- package/src/plugins/stateMachine/actionHandlers/index.ts +4 -4
- package/src/plugins/stateMachine/models/StateMachine.ts +42 -42
- package/src/plugins/stateMachine/models/index.ts +3 -3
- package/src/plugins/stateMachine/routes/index.ts +3 -3
- package/src/plugins/stateMachine/routes/sendStateMachineEvent.ts +15 -15
- package/src/plugins/stateMachine/stateMachineHelper.ts +36 -36
- package/src/polyfill.ts +5 -5
- package/src/proxy/mod.ts +38 -38
- package/src/proxy/types.ts +21 -21
- package/src/queryBuilder/index.ts +1 -1
- package/src/utilities/accessControlUtility.ts +33 -33
- package/src/utilities/entityUtility.ts +18 -0
- package/src/utilities/fsUtility.ts +61 -61
- package/src/utilities/httpUtility.ts +19 -19
- package/src/utilities/jwtUtility.ts +26 -26
- package/src/utilities/timeUtility.ts +9 -9
- package/tsconfig.json +19 -19
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { RunQueryDatabaseHandlerOptions } from "~/types";
|
|
2
|
-
import { mergeInput } from "~/helpers/inputHelper";
|
|
3
|
-
import { ActionHandlerContext } from "~/core/actionHandler";
|
|
4
|
-
import { RapidPlugin } from "~/core/server";
|
|
5
|
-
import { first } from "lodash";
|
|
6
|
-
|
|
7
|
-
export const code = "queryDatabase";
|
|
8
|
-
|
|
9
|
-
export async function handler(plugin: RapidPlugin, ctx: ActionHandlerContext, options: RunQueryDatabaseHandlerOptions) {
|
|
10
|
-
const { logger, server, input } = ctx;
|
|
11
|
-
|
|
12
|
-
const { sql, querySingle, defaultInput, fixedInput } = options;
|
|
13
|
-
const mergedInput = mergeInput(defaultInput, input, fixedInput);
|
|
14
|
-
logger.debug(`Running ${code} handler...`, { defaultInput, fixedInput, mergedInput });
|
|
15
|
-
|
|
16
|
-
const result = await server.queryDatabaseObject(sql, mergedInput);
|
|
17
|
-
if (querySingle) {
|
|
18
|
-
ctx.output = first(result);
|
|
19
|
-
} else {
|
|
20
|
-
ctx.output = result;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
1
|
+
import { RunQueryDatabaseHandlerOptions } from "~/types";
|
|
2
|
+
import { mergeInput } from "~/helpers/inputHelper";
|
|
3
|
+
import { ActionHandlerContext } from "~/core/actionHandler";
|
|
4
|
+
import { RapidPlugin } from "~/core/server";
|
|
5
|
+
import { first } from "lodash";
|
|
6
|
+
|
|
7
|
+
export const code = "queryDatabase";
|
|
8
|
+
|
|
9
|
+
export async function handler(plugin: RapidPlugin, ctx: ActionHandlerContext, options: RunQueryDatabaseHandlerOptions) {
|
|
10
|
+
const { logger, server, input } = ctx;
|
|
11
|
+
|
|
12
|
+
const { sql, querySingle, defaultInput, fixedInput } = options;
|
|
13
|
+
const mergedInput = mergeInput(defaultInput, input, fixedInput);
|
|
14
|
+
logger.debug(`Running ${code} handler...`, { defaultInput, fixedInput, mergedInput });
|
|
15
|
+
|
|
16
|
+
const result = await server.queryDatabaseObject(sql, mergedInput);
|
|
17
|
+
if (querySingle) {
|
|
18
|
+
ctx.output = first(result);
|
|
19
|
+
} else {
|
|
20
|
+
ctx.output = result;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { v1 as uuidv1 } from "uuid";
|
|
2
|
-
import { appendFile } from "~/utilities/fsUtility";
|
|
3
|
-
import { ActionHandlerContext } from "~/core/actionHandler";
|
|
4
|
-
import path from "path";
|
|
5
|
-
import { isArray } from "lodash";
|
|
6
|
-
import { RapidPlugin } from "~/core/server";
|
|
7
|
-
|
|
8
|
-
export const code = "uploadFile";
|
|
9
|
-
|
|
10
|
-
export async function handler(plugin: RapidPlugin, ctx: ActionHandlerContext, options: any) {
|
|
11
|
-
const { server, applicationConfig, routerContext, input } = ctx;
|
|
12
|
-
const { request, response } = routerContext;
|
|
13
|
-
|
|
14
|
-
let file: File | File[] | null = input.file || input.files;
|
|
15
|
-
if (isArray(file)) {
|
|
16
|
-
file = file[0];
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
if (!file) {
|
|
20
|
-
ctx.status = 400;
|
|
21
|
-
ctx.output = { error: "File not found in request body." };
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const extName = path.extname(file.name);
|
|
26
|
-
const fileKey = `${uuidv1()}${extName}`;
|
|
27
|
-
const filePathName = path.join(server.config.localFileStoragePath, fileKey);
|
|
28
|
-
|
|
29
|
-
const fileBuffer = await file.arrayBuffer();
|
|
30
|
-
await appendFile(filePathName, fileBuffer);
|
|
31
|
-
|
|
32
|
-
ctx.output = { ok: true, fileKey };
|
|
33
|
-
}
|
|
1
|
+
import { v1 as uuidv1 } from "uuid";
|
|
2
|
+
import { appendFile } from "~/utilities/fsUtility";
|
|
3
|
+
import { ActionHandlerContext } from "~/core/actionHandler";
|
|
4
|
+
import path from "path";
|
|
5
|
+
import { isArray } from "lodash";
|
|
6
|
+
import { RapidPlugin } from "~/core/server";
|
|
7
|
+
|
|
8
|
+
export const code = "uploadFile";
|
|
9
|
+
|
|
10
|
+
export async function handler(plugin: RapidPlugin, ctx: ActionHandlerContext, options: any) {
|
|
11
|
+
const { server, applicationConfig, routerContext, input } = ctx;
|
|
12
|
+
const { request, response } = routerContext;
|
|
13
|
+
|
|
14
|
+
let file: File | File[] | null = input.file || input.files;
|
|
15
|
+
if (isArray(file)) {
|
|
16
|
+
file = file[0];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
if (!file) {
|
|
20
|
+
ctx.status = 400;
|
|
21
|
+
ctx.output = { error: "File not found in request body." };
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const extName = path.extname(file.name);
|
|
26
|
+
const fileKey = `${uuidv1()}${extName}`;
|
|
27
|
+
const filePathName = path.join(server.config.localFileStoragePath, fileKey);
|
|
28
|
+
|
|
29
|
+
const fileBuffer = await file.arrayBuffer();
|
|
30
|
+
await appendFile(filePathName, fileBuffer);
|
|
31
|
+
|
|
32
|
+
ctx.output = { ok: true, fileKey };
|
|
33
|
+
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { RpdRoute } from "~/types";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
namespace: "ecm",
|
|
5
|
-
name: "ecm.downloadDocument",
|
|
6
|
-
code: "ecm.downloadDocument",
|
|
7
|
-
type: "RESTful",
|
|
8
|
-
method: "GET",
|
|
9
|
-
endpoint: "/download/document",
|
|
10
|
-
actions: [
|
|
11
|
-
{
|
|
12
|
-
code: "downloadDocument",
|
|
13
|
-
},
|
|
14
|
-
],
|
|
15
|
-
} satisfies RpdRoute;
|
|
1
|
+
import { RpdRoute } from "~/types";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
namespace: "ecm",
|
|
5
|
+
name: "ecm.downloadDocument",
|
|
6
|
+
code: "ecm.downloadDocument",
|
|
7
|
+
type: "RESTful",
|
|
8
|
+
method: "GET",
|
|
9
|
+
endpoint: "/download/document",
|
|
10
|
+
actions: [
|
|
11
|
+
{
|
|
12
|
+
code: "downloadDocument",
|
|
13
|
+
},
|
|
14
|
+
],
|
|
15
|
+
} satisfies RpdRoute;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { RpdRoute } from "~/types";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
namespace: "ecm",
|
|
5
|
-
name: "ecm.downloadFile",
|
|
6
|
-
code: "ecm.downloadFile",
|
|
7
|
-
type: "RESTful",
|
|
8
|
-
method: "GET",
|
|
9
|
-
endpoint: "/download/file",
|
|
10
|
-
actions: [
|
|
11
|
-
{
|
|
12
|
-
code: "downloadFile",
|
|
13
|
-
},
|
|
14
|
-
],
|
|
15
|
-
} satisfies RpdRoute;
|
|
1
|
+
import { RpdRoute } from "~/types";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
namespace: "ecm",
|
|
5
|
+
name: "ecm.downloadFile",
|
|
6
|
+
code: "ecm.downloadFile",
|
|
7
|
+
type: "RESTful",
|
|
8
|
+
method: "GET",
|
|
9
|
+
endpoint: "/download/file",
|
|
10
|
+
actions: [
|
|
11
|
+
{
|
|
12
|
+
code: "downloadFile",
|
|
13
|
+
},
|
|
14
|
+
],
|
|
15
|
+
} satisfies RpdRoute;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import getMyProfile from "./uploadFile";
|
|
2
|
-
import signin from "./downloadFile";
|
|
3
|
-
import signout from "./downloadDocument";
|
|
4
|
-
|
|
5
|
-
export default [getMyProfile, signin, signout];
|
|
1
|
+
import getMyProfile from "./uploadFile";
|
|
2
|
+
import signin from "./downloadFile";
|
|
3
|
+
import signout from "./downloadDocument";
|
|
4
|
+
|
|
5
|
+
export default [getMyProfile, signin, signout];
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { RpdRoute } from "~/types";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
namespace: "ecm",
|
|
5
|
-
name: "ecm.uploadFile",
|
|
6
|
-
code: "ecm.uploadFile",
|
|
7
|
-
type: "RESTful",
|
|
8
|
-
method: "POST",
|
|
9
|
-
endpoint: "/upload",
|
|
10
|
-
actions: [
|
|
11
|
-
{
|
|
12
|
-
code: "uploadFile",
|
|
13
|
-
},
|
|
14
|
-
],
|
|
15
|
-
} satisfies RpdRoute;
|
|
1
|
+
import { RpdRoute } from "~/types";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
namespace: "ecm",
|
|
5
|
+
name: "ecm.uploadFile",
|
|
6
|
+
code: "ecm.uploadFile",
|
|
7
|
+
type: "RESTful",
|
|
8
|
+
method: "POST",
|
|
9
|
+
endpoint: "/upload",
|
|
10
|
+
actions: [
|
|
11
|
+
{
|
|
12
|
+
code: "uploadFile",
|
|
13
|
+
},
|
|
14
|
+
],
|
|
15
|
+
} satisfies RpdRoute;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { ActionHandlerContext } from "~/core/actionHandler";
|
|
2
|
-
import { RapidPlugin } from "~/core/server";
|
|
3
|
-
|
|
4
|
-
export const code = "getMetaModelDetail";
|
|
5
|
-
|
|
6
|
-
export async function handler(plugin: RapidPlugin, ctx: ActionHandlerContext, options: any) {
|
|
7
|
-
const { server, input } = ctx;
|
|
8
|
-
const model = server.getModel(input);
|
|
9
|
-
ctx.output = model;
|
|
10
|
-
}
|
|
1
|
+
import { ActionHandlerContext } from "~/core/actionHandler";
|
|
2
|
+
import { RapidPlugin } from "~/core/server";
|
|
3
|
+
|
|
4
|
+
export const code = "getMetaModelDetail";
|
|
5
|
+
|
|
6
|
+
export async function handler(plugin: RapidPlugin, ctx: ActionHandlerContext, options: any) {
|
|
7
|
+
const { server, input } = ctx;
|
|
8
|
+
const model = server.getModel(input);
|
|
9
|
+
ctx.output = model;
|
|
10
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ActionHandlerContext } from "~/core/actionHandler";
|
|
2
|
-
import { RapidPlugin } from "~/core/server";
|
|
3
|
-
|
|
4
|
-
export const code = "listMetaModels";
|
|
5
|
-
|
|
6
|
-
export async function handler(plugin: RapidPlugin, ctx: ActionHandlerContext, options: any) {
|
|
7
|
-
const { applicationConfig } = ctx;
|
|
8
|
-
ctx.output = { list: applicationConfig.models };
|
|
9
|
-
}
|
|
1
|
+
import { ActionHandlerContext } from "~/core/actionHandler";
|
|
2
|
+
import { RapidPlugin } from "~/core/server";
|
|
3
|
+
|
|
4
|
+
export const code = "listMetaModels";
|
|
5
|
+
|
|
6
|
+
export async function handler(plugin: RapidPlugin, ctx: ActionHandlerContext, options: any) {
|
|
7
|
+
const { applicationConfig } = ctx;
|
|
8
|
+
ctx.output = { list: applicationConfig.models };
|
|
9
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ActionHandlerContext } from "~/core/actionHandler";
|
|
2
|
-
import { RapidPlugin } from "~/core/server";
|
|
3
|
-
|
|
4
|
-
export const code = "listMetaRoutes";
|
|
5
|
-
|
|
6
|
-
export async function handler(plugin: RapidPlugin, ctx: ActionHandlerContext, options: any) {
|
|
7
|
-
const { applicationConfig } = ctx;
|
|
8
|
-
ctx.output = { list: applicationConfig.routes };
|
|
9
|
-
}
|
|
1
|
+
import { ActionHandlerContext } from "~/core/actionHandler";
|
|
2
|
+
import { RapidPlugin } from "~/core/server";
|
|
3
|
+
|
|
4
|
+
export const code = "listMetaRoutes";
|
|
5
|
+
|
|
6
|
+
export async function handler(plugin: RapidPlugin, ctx: ActionHandlerContext, options: any) {
|
|
7
|
+
const { applicationConfig } = ctx;
|
|
8
|
+
ctx.output = { list: applicationConfig.routes };
|
|
9
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { RunProxyHandlerOptions } from "~/types";
|
|
2
|
-
import { doProxy } from "~/proxy/mod";
|
|
3
|
-
import { ActionHandlerContext } from "~/core/actionHandler";
|
|
4
|
-
import { RapidPlugin } from "~/core/server";
|
|
5
|
-
|
|
6
|
-
export const code = "httpProxy";
|
|
7
|
-
|
|
8
|
-
export async function handler(plugin: RapidPlugin, ctx: ActionHandlerContext, options: RunProxyHandlerOptions) {
|
|
9
|
-
const { logger } = ctx;
|
|
10
|
-
logger.debug(`Running ${code} handler...`);
|
|
11
|
-
|
|
12
|
-
await doProxy(ctx.routerContext, options);
|
|
13
|
-
}
|
|
1
|
+
import { RunProxyHandlerOptions } from "~/types";
|
|
2
|
+
import { doProxy } from "~/proxy/mod";
|
|
3
|
+
import { ActionHandlerContext } from "~/core/actionHandler";
|
|
4
|
+
import { RapidPlugin } from "~/core/server";
|
|
5
|
+
|
|
6
|
+
export const code = "httpProxy";
|
|
7
|
+
|
|
8
|
+
export async function handler(plugin: RapidPlugin, ctx: ActionHandlerContext, options: RunProxyHandlerOptions) {
|
|
9
|
+
const { logger } = ctx;
|
|
10
|
+
logger.debug(`Running ${code} handler...`);
|
|
11
|
+
|
|
12
|
+
await doProxy(ctx.routerContext, options);
|
|
13
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IPluginActionHandler } from "~/core/actionHandler";
|
|
2
|
-
import * as generateSn from "./generateSn";
|
|
3
|
-
|
|
4
|
-
export default [generateSn] satisfies IPluginActionHandler[];
|
|
1
|
+
import { IPluginActionHandler } from "~/core/actionHandler";
|
|
2
|
+
import * as generateSn from "./generateSn";
|
|
3
|
+
|
|
4
|
+
export default [generateSn] satisfies IPluginActionHandler[];
|
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
import { RpdDataModel } from "~/types";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
maintainedBy: "sequencePlugin",
|
|
5
|
-
namespace: "svc",
|
|
6
|
-
name: "sequence_auto_increment_record",
|
|
7
|
-
singularCode: "sequence_auto_increment_record",
|
|
8
|
-
pluralCode: "sequence_auto_increment_records",
|
|
9
|
-
schema: "public",
|
|
10
|
-
tableName: "sequence_auto_increment_records",
|
|
11
|
-
properties: [
|
|
12
|
-
{
|
|
13
|
-
name: "id",
|
|
14
|
-
code: "id",
|
|
15
|
-
columnName: "id",
|
|
16
|
-
type: "integer",
|
|
17
|
-
required: true,
|
|
18
|
-
autoIncrement: true,
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
name: "ruleCode",
|
|
22
|
-
code: "ruleCode",
|
|
23
|
-
columnName: "rule_code",
|
|
24
|
-
type: "text",
|
|
25
|
-
required: true,
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
name: "scope",
|
|
29
|
-
code: "scope",
|
|
30
|
-
columnName: "scope",
|
|
31
|
-
type: "text",
|
|
32
|
-
required: false,
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
name: "currentValue",
|
|
36
|
-
code: "currentValue",
|
|
37
|
-
columnName: "current_value",
|
|
38
|
-
type: "integer",
|
|
39
|
-
required: true,
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
name: "updatedAt",
|
|
43
|
-
code: "updatedAt",
|
|
44
|
-
columnName: "updated_at",
|
|
45
|
-
type: "datetime",
|
|
46
|
-
required: true,
|
|
47
|
-
},
|
|
48
|
-
],
|
|
49
|
-
} as RpdDataModel;
|
|
1
|
+
import { RpdDataModel } from "~/types";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
maintainedBy: "sequencePlugin",
|
|
5
|
+
namespace: "svc",
|
|
6
|
+
name: "sequence_auto_increment_record",
|
|
7
|
+
singularCode: "sequence_auto_increment_record",
|
|
8
|
+
pluralCode: "sequence_auto_increment_records",
|
|
9
|
+
schema: "public",
|
|
10
|
+
tableName: "sequence_auto_increment_records",
|
|
11
|
+
properties: [
|
|
12
|
+
{
|
|
13
|
+
name: "id",
|
|
14
|
+
code: "id",
|
|
15
|
+
columnName: "id",
|
|
16
|
+
type: "integer",
|
|
17
|
+
required: true,
|
|
18
|
+
autoIncrement: true,
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: "ruleCode",
|
|
22
|
+
code: "ruleCode",
|
|
23
|
+
columnName: "rule_code",
|
|
24
|
+
type: "text",
|
|
25
|
+
required: true,
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: "scope",
|
|
29
|
+
code: "scope",
|
|
30
|
+
columnName: "scope",
|
|
31
|
+
type: "text",
|
|
32
|
+
required: false,
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: "currentValue",
|
|
36
|
+
code: "currentValue",
|
|
37
|
+
columnName: "current_value",
|
|
38
|
+
type: "integer",
|
|
39
|
+
required: true,
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: "updatedAt",
|
|
43
|
+
code: "updatedAt",
|
|
44
|
+
columnName: "updated_at",
|
|
45
|
+
type: "datetime",
|
|
46
|
+
required: true,
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
} as RpdDataModel;
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import { RpdDataModel } from "~/types";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
maintainedBy: "sequencePlugin",
|
|
5
|
-
namespace: "svc",
|
|
6
|
-
name: "sequence_rule",
|
|
7
|
-
singularCode: "sequence_rule",
|
|
8
|
-
pluralCode: "sequence_rules",
|
|
9
|
-
schema: "public",
|
|
10
|
-
tableName: "sequence_rules",
|
|
11
|
-
properties: [
|
|
12
|
-
{
|
|
13
|
-
name: "id",
|
|
14
|
-
code: "id",
|
|
15
|
-
columnName: "id",
|
|
16
|
-
type: "integer",
|
|
17
|
-
required: true,
|
|
18
|
-
autoIncrement: true,
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
name: "code",
|
|
22
|
-
code: "code",
|
|
23
|
-
columnName: "code",
|
|
24
|
-
type: "text",
|
|
25
|
-
required: true,
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
name: "description",
|
|
29
|
-
code: "description",
|
|
30
|
-
columnName: "description",
|
|
31
|
-
type: "text",
|
|
32
|
-
required: false,
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
name: "config",
|
|
36
|
-
code: "config",
|
|
37
|
-
columnName: "config",
|
|
38
|
-
type: "json",
|
|
39
|
-
required: false,
|
|
40
|
-
},
|
|
41
|
-
],
|
|
42
|
-
} as RpdDataModel;
|
|
1
|
+
import { RpdDataModel } from "~/types";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
maintainedBy: "sequencePlugin",
|
|
5
|
+
namespace: "svc",
|
|
6
|
+
name: "sequence_rule",
|
|
7
|
+
singularCode: "sequence_rule",
|
|
8
|
+
pluralCode: "sequence_rules",
|
|
9
|
+
schema: "public",
|
|
10
|
+
tableName: "sequence_rules",
|
|
11
|
+
properties: [
|
|
12
|
+
{
|
|
13
|
+
name: "id",
|
|
14
|
+
code: "id",
|
|
15
|
+
columnName: "id",
|
|
16
|
+
type: "integer",
|
|
17
|
+
required: true,
|
|
18
|
+
autoIncrement: true,
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: "code",
|
|
22
|
+
code: "code",
|
|
23
|
+
columnName: "code",
|
|
24
|
+
type: "text",
|
|
25
|
+
required: true,
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: "description",
|
|
29
|
+
code: "description",
|
|
30
|
+
columnName: "description",
|
|
31
|
+
type: "text",
|
|
32
|
+
required: false,
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: "config",
|
|
36
|
+
code: "config",
|
|
37
|
+
columnName: "config",
|
|
38
|
+
type: "json",
|
|
39
|
+
required: false,
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
} as RpdDataModel;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import SequenceRule from "./SequenceRule";
|
|
2
|
-
import SequenceAutoIncrementRecord from "./SequenceAutoIncrementRecord";
|
|
3
|
-
|
|
4
|
-
export default [SequenceRule, SequenceAutoIncrementRecord];
|
|
1
|
+
import SequenceRule from "./SequenceRule";
|
|
2
|
+
import SequenceAutoIncrementRecord from "./SequenceAutoIncrementRecord";
|
|
3
|
+
|
|
4
|
+
export default [SequenceRule, SequenceAutoIncrementRecord];
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { RpdRoute } from "~/types";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
namespace: "svc",
|
|
5
|
-
name: "svc.generateSn",
|
|
6
|
-
code: "svc.generateSn",
|
|
7
|
-
type: "RESTful",
|
|
8
|
-
method: "POST",
|
|
9
|
-
endpoint: "/svc/generateSn",
|
|
10
|
-
actions: [
|
|
11
|
-
{
|
|
12
|
-
code: "generateSn",
|
|
13
|
-
},
|
|
14
|
-
],
|
|
15
|
-
} satisfies RpdRoute;
|
|
1
|
+
import { RpdRoute } from "~/types";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
namespace: "svc",
|
|
5
|
+
name: "svc.generateSn",
|
|
6
|
+
code: "svc.generateSn",
|
|
7
|
+
type: "RESTful",
|
|
8
|
+
method: "POST",
|
|
9
|
+
endpoint: "/svc/generateSn",
|
|
10
|
+
actions: [
|
|
11
|
+
{
|
|
12
|
+
code: "generateSn",
|
|
13
|
+
},
|
|
14
|
+
],
|
|
15
|
+
} satisfies RpdRoute;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import generateSn from "./generateSn";
|
|
2
|
-
|
|
3
|
-
export default [generateSn];
|
|
1
|
+
import generateSn from "./generateSn";
|
|
2
|
+
|
|
3
|
+
export default [generateSn];
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export function padSegment(segment: string, length?: number, fillString?: string) {
|
|
2
|
-
if (!length) {
|
|
3
|
-
return segment;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
if (segment.length > length) {
|
|
7
|
-
return segment.substring(segment.length - length);
|
|
8
|
-
} else {
|
|
9
|
-
return segment.padStart(length, fillString || " ");
|
|
10
|
-
}
|
|
11
|
-
}
|
|
1
|
+
export function padSegment(segment: string, length?: number, fillString?: string) {
|
|
2
|
+
if (!length) {
|
|
3
|
+
return segment;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
if (segment.length > length) {
|
|
7
|
+
return segment.substring(segment.length - length);
|
|
8
|
+
} else {
|
|
9
|
+
return segment.padStart(length, fillString || " ");
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { SegmentResolver } from "../SequenceService";
|
|
2
|
-
import * as literal from "./literal";
|
|
3
|
-
import * as year from "./year";
|
|
4
|
-
import * as month from "./month";
|
|
5
|
-
import * as dayOfMonth from "./dayOfMonth";
|
|
6
|
-
import * as parameter from "./parameter";
|
|
7
|
-
import * as autoIncrement from "./autoIncrement";
|
|
8
|
-
|
|
9
|
-
export default [literal, year, month, dayOfMonth, parameter, autoIncrement] satisfies SegmentResolver[];
|
|
1
|
+
import { SegmentResolver } from "../SequenceService";
|
|
2
|
+
import * as literal from "./literal";
|
|
3
|
+
import * as year from "./year";
|
|
4
|
+
import * as month from "./month";
|
|
5
|
+
import * as dayOfMonth from "./dayOfMonth";
|
|
6
|
+
import * as parameter from "./parameter";
|
|
7
|
+
import * as autoIncrement from "./autoIncrement";
|
|
8
|
+
|
|
9
|
+
export default [literal, year, month, dayOfMonth, parameter, autoIncrement] satisfies SegmentResolver[];
|