@ruiapp/rapid-core 0.1.28 → 0.1.30
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 +1 -0
- package/dist/index.js +151 -74
- package/dist/plugins/auth/actionHandlers/index.d.ts +2 -1
- package/dist/plugins/auth/routes/changePassword.d.ts +12 -0
- package/dist/plugins/auth/routes/index.d.ts +2 -2
- package/dist/plugins/auth/routes/resetPassword.d.ts +12 -0
- package/package.json +1 -1
- package/src/index.ts +2 -1
- package/src/plugins/auth/actionHandlers/index.ts +2 -0
- package/src/plugins/auth/routes/changePassword.ts +15 -0
- package/src/plugins/auth/routes/index.ts +4 -0
- package/src/plugins/auth/routes/resetPassword.ts +15 -0
- package/src/plugins/sequence/SequencePlugin.ts +1 -3
- package/src/plugins/sequence/SequenceService.ts +1 -1
- /package/dist/plugins/sequence/{sequence-types.d.ts → SequencePluginTypes.d.ts} +0 -0
- /package/src/plugins/sequence/{sequence-types.ts → SequencePluginTypes.ts} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export { default as MetaManagePlugin } from "./plugins/metaManage/MetaManagePlug
|
|
|
11
11
|
export { default as DataManagePlugin } from "./plugins/dataManage/DataManagePlugin";
|
|
12
12
|
export { default as RouteManagePlugin } from "./plugins/routeManage/RouteManagePlugin";
|
|
13
13
|
export { default as SequencePlugin } from "./plugins/sequence/SequencePlugin";
|
|
14
|
+
export * from "./plugins/sequence/SequencePluginTypes";
|
|
14
15
|
export { default as WebhooksPlugin } from "./plugins/webhooks/WebhooksPlugin";
|
|
15
16
|
export { default as AuthPlugin } from "./plugins/auth/AuthPlugin";
|
|
16
17
|
export { default as FileManagePlugin } from "./plugins/fileManage/FileManagePlugin";
|
package/dist/index.js
CHANGED
|
@@ -2784,32 +2784,32 @@ async function generateJwtSecretKey() {
|
|
|
2784
2784
|
return encode(exportedKey);
|
|
2785
2785
|
}
|
|
2786
2786
|
|
|
2787
|
-
const code$
|
|
2788
|
-
async function handler$
|
|
2787
|
+
const code$n = "listMetaModels";
|
|
2788
|
+
async function handler$n(plugin, ctx, options) {
|
|
2789
2789
|
const { applicationConfig } = ctx;
|
|
2790
2790
|
ctx.output = { list: applicationConfig.models };
|
|
2791
2791
|
}
|
|
2792
2792
|
|
|
2793
2793
|
var listMetaModels = /*#__PURE__*/Object.freeze({
|
|
2794
2794
|
__proto__: null,
|
|
2795
|
-
code: code$
|
|
2796
|
-
handler: handler$
|
|
2795
|
+
code: code$n,
|
|
2796
|
+
handler: handler$n
|
|
2797
2797
|
});
|
|
2798
2798
|
|
|
2799
|
-
const code$
|
|
2800
|
-
async function handler$
|
|
2799
|
+
const code$m = "listMetaRoutes";
|
|
2800
|
+
async function handler$m(plugin, ctx, options) {
|
|
2801
2801
|
const { applicationConfig } = ctx;
|
|
2802
2802
|
ctx.output = { list: applicationConfig.routes };
|
|
2803
2803
|
}
|
|
2804
2804
|
|
|
2805
2805
|
var listMetaRoutes = /*#__PURE__*/Object.freeze({
|
|
2806
2806
|
__proto__: null,
|
|
2807
|
-
code: code$
|
|
2808
|
-
handler: handler$
|
|
2807
|
+
code: code$m,
|
|
2808
|
+
handler: handler$m
|
|
2809
2809
|
});
|
|
2810
2810
|
|
|
2811
|
-
const code$
|
|
2812
|
-
async function handler$
|
|
2811
|
+
const code$l = "getMetaModelDetail";
|
|
2812
|
+
async function handler$l(plugin, ctx, options) {
|
|
2813
2813
|
const { server, input } = ctx;
|
|
2814
2814
|
const model = server.getModel(input);
|
|
2815
2815
|
ctx.output = model;
|
|
@@ -2817,8 +2817,8 @@ async function handler$k(plugin, ctx, options) {
|
|
|
2817
2817
|
|
|
2818
2818
|
var getMetaModelDetail = /*#__PURE__*/Object.freeze({
|
|
2819
2819
|
__proto__: null,
|
|
2820
|
-
code: code$
|
|
2821
|
-
handler: handler$
|
|
2820
|
+
code: code$l,
|
|
2821
|
+
handler: handler$l
|
|
2822
2822
|
});
|
|
2823
2823
|
|
|
2824
2824
|
/**
|
|
@@ -3170,9 +3170,9 @@ function transformFilterWithSubFilters(filter) {
|
|
|
3170
3170
|
return filter;
|
|
3171
3171
|
}
|
|
3172
3172
|
|
|
3173
|
-
const code$
|
|
3174
|
-
async function handler$
|
|
3175
|
-
await runCollectionEntityActionHandler(ctx, options, code$
|
|
3173
|
+
const code$k = "findCollectionEntities";
|
|
3174
|
+
async function handler$k(plugin, ctx, options) {
|
|
3175
|
+
await runCollectionEntityActionHandler(ctx, options, code$k, async (entityManager, input) => {
|
|
3176
3176
|
input.filters = removeFiltersWithNullValue(input.filters);
|
|
3177
3177
|
const entities = await entityManager.findEntities(input);
|
|
3178
3178
|
const result = { list: entities };
|
|
@@ -3187,14 +3187,14 @@ async function handler$j(plugin, ctx, options) {
|
|
|
3187
3187
|
|
|
3188
3188
|
var findCollectionEntities = /*#__PURE__*/Object.freeze({
|
|
3189
3189
|
__proto__: null,
|
|
3190
|
-
code: code$
|
|
3191
|
-
handler: handler$
|
|
3190
|
+
code: code$k,
|
|
3191
|
+
handler: handler$k
|
|
3192
3192
|
});
|
|
3193
3193
|
|
|
3194
|
-
const code$
|
|
3195
|
-
async function handler$
|
|
3194
|
+
const code$j = "findCollectionEntityById";
|
|
3195
|
+
async function handler$j(plugin, ctx, options) {
|
|
3196
3196
|
const { logger, server, input } = ctx;
|
|
3197
|
-
logger.debug(`Running ${code$
|
|
3197
|
+
logger.debug(`Running ${code$j} handler...`, { input });
|
|
3198
3198
|
const { id } = input;
|
|
3199
3199
|
const entityManager = server.getEntityManager(options.singularCode);
|
|
3200
3200
|
const entity = await entityManager.findById(id);
|
|
@@ -3206,13 +3206,13 @@ async function handler$i(plugin, ctx, options) {
|
|
|
3206
3206
|
|
|
3207
3207
|
var findCollectionEntityById = /*#__PURE__*/Object.freeze({
|
|
3208
3208
|
__proto__: null,
|
|
3209
|
-
code: code$
|
|
3210
|
-
handler: handler$
|
|
3209
|
+
code: code$j,
|
|
3210
|
+
handler: handler$j
|
|
3211
3211
|
});
|
|
3212
3212
|
|
|
3213
|
-
const code$
|
|
3214
|
-
async function handler$
|
|
3215
|
-
await runCollectionEntityActionHandler(ctx, options, code$
|
|
3213
|
+
const code$i = "countCollectionEntities";
|
|
3214
|
+
async function handler$i(plugin, ctx, options) {
|
|
3215
|
+
await runCollectionEntityActionHandler(ctx, options, code$i, (entityManager, input) => {
|
|
3216
3216
|
input.filters = removeFiltersWithNullValue(input.filters);
|
|
3217
3217
|
return entityManager.count(input);
|
|
3218
3218
|
});
|
|
@@ -3220,16 +3220,16 @@ async function handler$h(plugin, ctx, options) {
|
|
|
3220
3220
|
|
|
3221
3221
|
var countCollectionEntities = /*#__PURE__*/Object.freeze({
|
|
3222
3222
|
__proto__: null,
|
|
3223
|
-
code: code$
|
|
3224
|
-
handler: handler$
|
|
3223
|
+
code: code$i,
|
|
3224
|
+
handler: handler$i
|
|
3225
3225
|
});
|
|
3226
3226
|
|
|
3227
|
-
const code$
|
|
3228
|
-
async function handler$
|
|
3227
|
+
const code$h = "createCollectionEntity";
|
|
3228
|
+
async function handler$h(plugin, ctx, options) {
|
|
3229
3229
|
const { logger, server, input } = ctx;
|
|
3230
3230
|
const { defaultInput, fixedInput } = options;
|
|
3231
3231
|
const mergedInput = mergeInput(defaultInput, input, fixedInput);
|
|
3232
|
-
logger.debug(`Running ${code$
|
|
3232
|
+
logger.debug(`Running ${code$h} handler...`, { defaultInput, fixedInput, mergedInput });
|
|
3233
3233
|
const userId = ctx.routerContext.state?.userId;
|
|
3234
3234
|
if (userId) {
|
|
3235
3235
|
input.createdBy = userId;
|
|
@@ -3243,15 +3243,15 @@ async function handler$g(plugin, ctx, options) {
|
|
|
3243
3243
|
|
|
3244
3244
|
var createCollectionEntity = /*#__PURE__*/Object.freeze({
|
|
3245
3245
|
__proto__: null,
|
|
3246
|
-
code: code$
|
|
3247
|
-
handler: handler$
|
|
3246
|
+
code: code$h,
|
|
3247
|
+
handler: handler$h
|
|
3248
3248
|
});
|
|
3249
3249
|
|
|
3250
|
-
const code$
|
|
3251
|
-
async function handler$
|
|
3250
|
+
const code$g = "createCollectionEntitiesBatch";
|
|
3251
|
+
async function handler$g(plugin, ctx, options) {
|
|
3252
3252
|
const { logger, server, input } = ctx;
|
|
3253
3253
|
const { defaultInput, fixedInput } = options;
|
|
3254
|
-
logger.debug(`Running ${code$
|
|
3254
|
+
logger.debug(`Running ${code$g} handler...`, { defaultInput, fixedInput, input });
|
|
3255
3255
|
const { entities } = input;
|
|
3256
3256
|
if (!lodash.isArray(entities)) {
|
|
3257
3257
|
throw new Error("input.entities should be an array.");
|
|
@@ -3274,16 +3274,16 @@ async function handler$f(plugin, ctx, options) {
|
|
|
3274
3274
|
|
|
3275
3275
|
var createCollectionEntitiesBatch = /*#__PURE__*/Object.freeze({
|
|
3276
3276
|
__proto__: null,
|
|
3277
|
-
code: code$
|
|
3278
|
-
handler: handler$
|
|
3277
|
+
code: code$g,
|
|
3278
|
+
handler: handler$g
|
|
3279
3279
|
});
|
|
3280
3280
|
|
|
3281
|
-
const code$
|
|
3282
|
-
async function handler$
|
|
3281
|
+
const code$f = "updateCollectionEntityById";
|
|
3282
|
+
async function handler$f(plugin, ctx, options) {
|
|
3283
3283
|
const { logger, server, input } = ctx;
|
|
3284
3284
|
const { defaultInput, fixedInput } = options;
|
|
3285
3285
|
const mergedInput = mergeInput(defaultInput, input, fixedInput);
|
|
3286
|
-
logger.debug(`Running ${code$
|
|
3286
|
+
logger.debug(`Running ${code$f} handler...`, { defaultInput, fixedInput, mergedInput });
|
|
3287
3287
|
const entityManager = server.getEntityManager(options.singularCode);
|
|
3288
3288
|
const output = await entityManager.updateEntityById({ id: mergedInput.id, entityToSave: mergedInput }, plugin);
|
|
3289
3289
|
ctx.output = output;
|
|
@@ -3291,14 +3291,14 @@ async function handler$e(plugin, ctx, options) {
|
|
|
3291
3291
|
|
|
3292
3292
|
var updateCollectionEntityById = /*#__PURE__*/Object.freeze({
|
|
3293
3293
|
__proto__: null,
|
|
3294
|
-
code: code$
|
|
3295
|
-
handler: handler$
|
|
3294
|
+
code: code$f,
|
|
3295
|
+
handler: handler$f
|
|
3296
3296
|
});
|
|
3297
3297
|
|
|
3298
|
-
const code$
|
|
3299
|
-
async function handler$
|
|
3298
|
+
const code$e = "deleteCollectionEntityById";
|
|
3299
|
+
async function handler$e(plugin, ctx, options) {
|
|
3300
3300
|
const { logger, server, input } = ctx;
|
|
3301
|
-
logger.debug(`Running ${code$
|
|
3301
|
+
logger.debug(`Running ${code$e} handler...`);
|
|
3302
3302
|
const entityManager = server.getEntityManager(options.singularCode);
|
|
3303
3303
|
await entityManager.deleteById(input.id, plugin);
|
|
3304
3304
|
ctx.status = 200;
|
|
@@ -3307,16 +3307,16 @@ async function handler$d(plugin, ctx, options) {
|
|
|
3307
3307
|
|
|
3308
3308
|
var deleteCollectionEntityById = /*#__PURE__*/Object.freeze({
|
|
3309
3309
|
__proto__: null,
|
|
3310
|
-
code: code$
|
|
3311
|
-
handler: handler$
|
|
3310
|
+
code: code$e,
|
|
3311
|
+
handler: handler$e
|
|
3312
3312
|
});
|
|
3313
3313
|
|
|
3314
|
-
const code$
|
|
3315
|
-
async function handler$
|
|
3314
|
+
const code$d = "addEntityRelations";
|
|
3315
|
+
async function handler$d(plugin, ctx, options) {
|
|
3316
3316
|
const { logger, server, input } = ctx;
|
|
3317
3317
|
const { defaultInput, fixedInput } = options;
|
|
3318
3318
|
const mergedInput = mergeInput(defaultInput, input, fixedInput);
|
|
3319
|
-
logger.debug(`Running ${code$
|
|
3319
|
+
logger.debug(`Running ${code$d} handler...`, { defaultInput, fixedInput, mergedInput });
|
|
3320
3320
|
const entityManager = server.getEntityManager(options.singularCode);
|
|
3321
3321
|
await entityManager.addRelations(mergedInput, plugin);
|
|
3322
3322
|
ctx.output = {};
|
|
@@ -3324,16 +3324,16 @@ async function handler$c(plugin, ctx, options) {
|
|
|
3324
3324
|
|
|
3325
3325
|
var addEntityRelations = /*#__PURE__*/Object.freeze({
|
|
3326
3326
|
__proto__: null,
|
|
3327
|
-
code: code$
|
|
3328
|
-
handler: handler$
|
|
3327
|
+
code: code$d,
|
|
3328
|
+
handler: handler$d
|
|
3329
3329
|
});
|
|
3330
3330
|
|
|
3331
|
-
const code$
|
|
3332
|
-
async function handler$
|
|
3331
|
+
const code$c = "removeEntityRelations";
|
|
3332
|
+
async function handler$c(plugin, ctx, options) {
|
|
3333
3333
|
const { logger, server, input } = ctx;
|
|
3334
3334
|
const { defaultInput, fixedInput } = options;
|
|
3335
3335
|
const mergedInput = mergeInput(defaultInput, input, fixedInput);
|
|
3336
|
-
logger.debug(`Running ${code$
|
|
3336
|
+
logger.debug(`Running ${code$c} handler...`, { defaultInput, fixedInput, mergedInput });
|
|
3337
3337
|
const entityManager = server.getEntityManager(options.singularCode);
|
|
3338
3338
|
await entityManager.removeRelations(mergedInput, plugin);
|
|
3339
3339
|
ctx.output = {};
|
|
@@ -3341,16 +3341,16 @@ async function handler$b(plugin, ctx, options) {
|
|
|
3341
3341
|
|
|
3342
3342
|
var removeEntityRelations = /*#__PURE__*/Object.freeze({
|
|
3343
3343
|
__proto__: null,
|
|
3344
|
-
code: code$
|
|
3345
|
-
handler: handler$
|
|
3344
|
+
code: code$c,
|
|
3345
|
+
handler: handler$c
|
|
3346
3346
|
});
|
|
3347
3347
|
|
|
3348
|
-
const code$
|
|
3349
|
-
async function handler$
|
|
3348
|
+
const code$b = "queryDatabase";
|
|
3349
|
+
async function handler$b(plugin, ctx, options) {
|
|
3350
3350
|
const { logger, server, input } = ctx;
|
|
3351
3351
|
const { sql, querySingle, defaultInput, fixedInput } = options;
|
|
3352
3352
|
const mergedInput = mergeInput(defaultInput, input, fixedInput);
|
|
3353
|
-
logger.debug(`Running ${code$
|
|
3353
|
+
logger.debug(`Running ${code$b} handler...`, { defaultInput, fixedInput, mergedInput });
|
|
3354
3354
|
const result = await server.queryDatabaseObject(sql, mergedInput);
|
|
3355
3355
|
if (querySingle) {
|
|
3356
3356
|
ctx.output = lodash.first(result);
|
|
@@ -3362,8 +3362,8 @@ async function handler$a(plugin, ctx, options) {
|
|
|
3362
3362
|
|
|
3363
3363
|
var queryDatabase = /*#__PURE__*/Object.freeze({
|
|
3364
3364
|
__proto__: null,
|
|
3365
|
-
code: code$
|
|
3366
|
-
handler: handler$
|
|
3365
|
+
code: code$b,
|
|
3366
|
+
handler: handler$b
|
|
3367
3367
|
});
|
|
3368
3368
|
|
|
3369
3369
|
/**
|
|
@@ -3534,17 +3534,17 @@ async function sendSourceResponse(proxyCtx, targetRes) {
|
|
|
3534
3534
|
srcRes.body = targetRes.body;
|
|
3535
3535
|
}
|
|
3536
3536
|
|
|
3537
|
-
const code$
|
|
3538
|
-
async function handler$
|
|
3537
|
+
const code$a = "httpProxy";
|
|
3538
|
+
async function handler$a(plugin, ctx, options) {
|
|
3539
3539
|
const { logger } = ctx;
|
|
3540
|
-
logger.debug(`Running ${code$
|
|
3540
|
+
logger.debug(`Running ${code$a} handler...`);
|
|
3541
3541
|
await doProxy(ctx.routerContext, options);
|
|
3542
3542
|
}
|
|
3543
3543
|
|
|
3544
3544
|
var httpProxy = /*#__PURE__*/Object.freeze({
|
|
3545
3545
|
__proto__: null,
|
|
3546
|
-
code: code$
|
|
3547
|
-
handler: handler$
|
|
3546
|
+
code: code$a,
|
|
3547
|
+
handler: handler$a
|
|
3548
3548
|
});
|
|
3549
3549
|
|
|
3550
3550
|
/**
|
|
@@ -3783,8 +3783,8 @@ async function generateSn$2(server, input) {
|
|
|
3783
3783
|
return sequenceNumbers;
|
|
3784
3784
|
}
|
|
3785
3785
|
|
|
3786
|
-
const code$
|
|
3787
|
-
async function handler$
|
|
3786
|
+
const code$9 = "generateSn";
|
|
3787
|
+
async function handler$9(plugin, ctx, options) {
|
|
3788
3788
|
const { server, routerContext } = ctx;
|
|
3789
3789
|
const input = ctx.input;
|
|
3790
3790
|
if (options?.ruleCode) {
|
|
@@ -3801,8 +3801,8 @@ async function handler$8(plugin, ctx, options) {
|
|
|
3801
3801
|
|
|
3802
3802
|
var generateSn$1 = /*#__PURE__*/Object.freeze({
|
|
3803
3803
|
__proto__: null,
|
|
3804
|
-
code: code$
|
|
3805
|
-
handler: handler$
|
|
3804
|
+
code: code$9,
|
|
3805
|
+
handler: handler$9
|
|
3806
3806
|
});
|
|
3807
3807
|
|
|
3808
3808
|
var pluginActionHandlers$2 = [
|
|
@@ -3989,7 +3989,6 @@ class SequencePlugin {
|
|
|
3989
3989
|
}
|
|
3990
3990
|
}
|
|
3991
3991
|
async beforeCreateEntity(server, model, options) {
|
|
3992
|
-
debugger;
|
|
3993
3992
|
const entity = options.entity;
|
|
3994
3993
|
for (const property of model.properties) {
|
|
3995
3994
|
const sequenceConfig = property.config?.sequence;
|
|
@@ -4192,6 +4191,53 @@ class WebhooksPlugin {
|
|
|
4192
4191
|
}
|
|
4193
4192
|
}
|
|
4194
4193
|
|
|
4194
|
+
const code$8 = "changePassword";
|
|
4195
|
+
async function handler$8(plugin, ctx, options) {
|
|
4196
|
+
const { server, input, routerContext } = ctx;
|
|
4197
|
+
const { id, oldPassword, newPassword } = input;
|
|
4198
|
+
const userId = routerContext.state.userId;
|
|
4199
|
+
if (!userId) {
|
|
4200
|
+
ctx.status = 401;
|
|
4201
|
+
ctx.output = {
|
|
4202
|
+
error: {
|
|
4203
|
+
message: "You are not signed in."
|
|
4204
|
+
}
|
|
4205
|
+
};
|
|
4206
|
+
return;
|
|
4207
|
+
}
|
|
4208
|
+
const userDataAccessor = server.getDataAccessor({
|
|
4209
|
+
singularCode: "oc_user",
|
|
4210
|
+
});
|
|
4211
|
+
const user = await userDataAccessor.findOne({
|
|
4212
|
+
filters: [
|
|
4213
|
+
{
|
|
4214
|
+
operator: "eq",
|
|
4215
|
+
field: "id",
|
|
4216
|
+
value: userId,
|
|
4217
|
+
}
|
|
4218
|
+
]
|
|
4219
|
+
});
|
|
4220
|
+
if (!user) {
|
|
4221
|
+
throw new Error("User not found.");
|
|
4222
|
+
}
|
|
4223
|
+
const isMatch = await bcrypt__default["default"].compare(oldPassword, user.password);
|
|
4224
|
+
if (!isMatch) {
|
|
4225
|
+
throw new Error("旧密码错误。");
|
|
4226
|
+
}
|
|
4227
|
+
const saltRounds = 10;
|
|
4228
|
+
const passwordHash = await bcrypt__default["default"].hash(newPassword, saltRounds);
|
|
4229
|
+
await userDataAccessor.updateById(user.id, {
|
|
4230
|
+
password: passwordHash,
|
|
4231
|
+
});
|
|
4232
|
+
ctx.output = {};
|
|
4233
|
+
}
|
|
4234
|
+
|
|
4235
|
+
var changePassword$1 = /*#__PURE__*/Object.freeze({
|
|
4236
|
+
__proto__: null,
|
|
4237
|
+
code: code$8,
|
|
4238
|
+
handler: handler$8
|
|
4239
|
+
});
|
|
4240
|
+
|
|
4195
4241
|
const code$7 = "createSession";
|
|
4196
4242
|
async function handler$7(plugin, ctx, options) {
|
|
4197
4243
|
const { server, input, routerContext } = ctx;
|
|
@@ -4320,17 +4366,18 @@ async function handler$4(plugin, ctx, options) {
|
|
|
4320
4366
|
ctx.output = {};
|
|
4321
4367
|
}
|
|
4322
4368
|
|
|
4323
|
-
var resetPassword = /*#__PURE__*/Object.freeze({
|
|
4369
|
+
var resetPassword$1 = /*#__PURE__*/Object.freeze({
|
|
4324
4370
|
__proto__: null,
|
|
4325
4371
|
code: code$4,
|
|
4326
4372
|
handler: handler$4
|
|
4327
4373
|
});
|
|
4328
4374
|
|
|
4329
4375
|
var pluginActionHandlers$1 = [
|
|
4376
|
+
changePassword$1,
|
|
4330
4377
|
createSession,
|
|
4331
4378
|
deleteSession,
|
|
4332
4379
|
getMyProfile$2,
|
|
4333
|
-
resetPassword,
|
|
4380
|
+
resetPassword$1,
|
|
4334
4381
|
];
|
|
4335
4382
|
|
|
4336
4383
|
var AccessToken = {
|
|
@@ -4392,6 +4439,20 @@ var pluginModels = [
|
|
|
4392
4439
|
AccessToken,
|
|
4393
4440
|
];
|
|
4394
4441
|
|
|
4442
|
+
var changePassword = {
|
|
4443
|
+
namespace: "auth",
|
|
4444
|
+
name: "auth.changePassword",
|
|
4445
|
+
code: "auth.changePassword",
|
|
4446
|
+
type: "RESTful",
|
|
4447
|
+
method: "POST",
|
|
4448
|
+
endpoint: "/changePassword",
|
|
4449
|
+
actions: [
|
|
4450
|
+
{
|
|
4451
|
+
code: "changePassword",
|
|
4452
|
+
},
|
|
4453
|
+
],
|
|
4454
|
+
};
|
|
4455
|
+
|
|
4395
4456
|
var getMyProfile$1 = {
|
|
4396
4457
|
namespace: "auth",
|
|
4397
4458
|
name: "auth.getMyProfile",
|
|
@@ -4406,6 +4467,20 @@ var getMyProfile$1 = {
|
|
|
4406
4467
|
],
|
|
4407
4468
|
};
|
|
4408
4469
|
|
|
4470
|
+
var resetPassword = {
|
|
4471
|
+
namespace: "auth",
|
|
4472
|
+
name: "auth.resetPassword",
|
|
4473
|
+
code: "auth.resetPassword",
|
|
4474
|
+
type: "RESTful",
|
|
4475
|
+
method: "POST",
|
|
4476
|
+
endpoint: "/resetPassword",
|
|
4477
|
+
actions: [
|
|
4478
|
+
{
|
|
4479
|
+
code: "resetPassword",
|
|
4480
|
+
},
|
|
4481
|
+
],
|
|
4482
|
+
};
|
|
4483
|
+
|
|
4409
4484
|
var signin$1 = {
|
|
4410
4485
|
namespace: "auth",
|
|
4411
4486
|
name: "auth.signin",
|
|
@@ -4435,7 +4510,9 @@ var signout$1 = {
|
|
|
4435
4510
|
};
|
|
4436
4511
|
|
|
4437
4512
|
var pluginRoutes$1 = [
|
|
4513
|
+
changePassword,
|
|
4438
4514
|
getMyProfile$1,
|
|
4515
|
+
resetPassword,
|
|
4439
4516
|
signin$1,
|
|
4440
4517
|
signout$1,
|
|
4441
4518
|
];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import * as changePassword from "./changePassword";
|
|
1
2
|
import * as createSession from "./createSession";
|
|
2
3
|
import * as deleteSession from "./deleteSession";
|
|
3
4
|
import * as getMyProfile from "./getMyProfile";
|
|
4
5
|
import * as resetPassword from "./resetPassword";
|
|
5
|
-
declare const _default: (typeof createSession | typeof deleteSession | typeof getMyProfile | typeof resetPassword)[];
|
|
6
|
+
declare const _default: (typeof changePassword | typeof createSession | typeof deleteSession | typeof getMyProfile | typeof resetPassword)[];
|
|
6
7
|
export default _default;
|
|
@@ -3,7 +3,7 @@ declare const _default: ({
|
|
|
3
3
|
name: string;
|
|
4
4
|
code: string;
|
|
5
5
|
type: "RESTful";
|
|
6
|
-
method: "
|
|
6
|
+
method: "POST";
|
|
7
7
|
endpoint: string;
|
|
8
8
|
actions: {
|
|
9
9
|
code: string;
|
|
@@ -13,7 +13,7 @@ declare const _default: ({
|
|
|
13
13
|
name: string;
|
|
14
14
|
code: string;
|
|
15
15
|
type: "RESTful";
|
|
16
|
-
method: "
|
|
16
|
+
method: "GET";
|
|
17
17
|
endpoint: string;
|
|
18
18
|
actions: {
|
|
19
19
|
code: string;
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -18,6 +18,7 @@ export { default as MetaManagePlugin } from "./plugins/metaManage/MetaManagePlug
|
|
|
18
18
|
export { default as DataManagePlugin } from "./plugins/dataManage/DataManagePlugin";
|
|
19
19
|
export { default as RouteManagePlugin } from "./plugins/routeManage/RouteManagePlugin";
|
|
20
20
|
export { default as SequencePlugin } from "./plugins/sequence/SequencePlugin";
|
|
21
|
+
export * from "./plugins/sequence/SequencePluginTypes";
|
|
21
22
|
export { default as WebhooksPlugin } from "./plugins/webhooks/WebhooksPlugin";
|
|
22
23
|
export { default as AuthPlugin } from "./plugins/auth/AuthPlugin";
|
|
23
24
|
export { default as FileManagePlugin } from "./plugins/fileManage/FileManagePlugin";
|
|
@@ -25,4 +26,4 @@ export { default as ServerOperationPlugin } from "./plugins/serverOperation/Serv
|
|
|
25
26
|
export * from "./plugins/serverOperation/ServerOperationPluginTypes";
|
|
26
27
|
export { default as EntityWatchPlugin } from "./plugins/entityWatch/EntityWatchPlugin";
|
|
27
28
|
export * from "./plugins/entityWatch/EntityWatchPluginTypes";
|
|
28
|
-
export { default as EntityAccessControlPlugin } from "./plugins/entityAccessControl/EntityAccessControlPlugin";
|
|
29
|
+
export { default as EntityAccessControlPlugin } from "./plugins/entityAccessControl/EntityAccessControlPlugin";
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { IPluginActionHandler } from "~/core/actionHandler";
|
|
2
|
+
import * as changePassword from "./changePassword";
|
|
2
3
|
import * as createSession from "./createSession";
|
|
3
4
|
import * as deleteSession from "./deleteSession";
|
|
4
5
|
import * as getMyProfile from "./getMyProfile";
|
|
5
6
|
import * as resetPassword from "./resetPassword";
|
|
6
7
|
|
|
7
8
|
export default [
|
|
9
|
+
changePassword,
|
|
8
10
|
createSession,
|
|
9
11
|
deleteSession,
|
|
10
12
|
getMyProfile,
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { RpdRoute } from "~/types";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
namespace: "auth",
|
|
5
|
+
name: "auth.changePassword",
|
|
6
|
+
code: "auth.changePassword",
|
|
7
|
+
type: "RESTful",
|
|
8
|
+
method: "POST",
|
|
9
|
+
endpoint: "/changePassword",
|
|
10
|
+
actions: [
|
|
11
|
+
{
|
|
12
|
+
code: "changePassword",
|
|
13
|
+
},
|
|
14
|
+
],
|
|
15
|
+
} satisfies RpdRoute;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
+
import changePassword from "./changePassword";
|
|
1
2
|
import getMyProfile from "./getMyProfile";
|
|
3
|
+
import resetPassword from "./resetPassword";
|
|
2
4
|
import signin from "./signin";
|
|
3
5
|
import signout from "./signout";
|
|
4
6
|
|
|
5
7
|
export default [
|
|
8
|
+
changePassword,
|
|
6
9
|
getMyProfile,
|
|
10
|
+
resetPassword,
|
|
7
11
|
signin,
|
|
8
12
|
signout,
|
|
9
13
|
]
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { RpdRoute } from "~/types";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
namespace: "auth",
|
|
5
|
+
name: "auth.resetPassword",
|
|
6
|
+
code: "auth.resetPassword",
|
|
7
|
+
type: "RESTful",
|
|
8
|
+
method: "POST",
|
|
9
|
+
endpoint: "/resetPassword",
|
|
10
|
+
actions: [
|
|
11
|
+
{
|
|
12
|
+
code: "resetPassword",
|
|
13
|
+
},
|
|
14
|
+
],
|
|
15
|
+
} satisfies RpdRoute;
|
|
@@ -13,8 +13,7 @@ import { IRpdServer, RapidPlugin, RpdConfigurationItemOptions, RpdServerPluginCo
|
|
|
13
13
|
import pluginActionHandlers from "./actionHandlers";
|
|
14
14
|
import pluginModels from "./models";
|
|
15
15
|
import pluginRoutes from "./routes";
|
|
16
|
-
import {
|
|
17
|
-
import { PropertySequenceConfig } from "./sequence-types";
|
|
16
|
+
import { PropertySequenceConfig } from "./SequencePluginTypes";
|
|
18
17
|
import { isNull, isUndefined } from "lodash";
|
|
19
18
|
import { generateSn } from "./SequenceService";
|
|
20
19
|
|
|
@@ -94,7 +93,6 @@ class SequencePlugin implements RapidPlugin {
|
|
|
94
93
|
}
|
|
95
94
|
|
|
96
95
|
async beforeCreateEntity(server: IRpdServer, model: RpdDataModel, options: CreateEntityOptions) {
|
|
97
|
-
debugger;
|
|
98
96
|
const entity = options.entity;
|
|
99
97
|
for (const property of model.properties) {
|
|
100
98
|
const sequenceConfig: PropertySequenceConfig = property.config?.sequence;
|
|
@@ -2,7 +2,7 @@ import { IRpdServer } from "~/core/server";
|
|
|
2
2
|
import { SequenceSegmentConfig } from "~/types";
|
|
3
3
|
import segmentResolvers from "./segments";
|
|
4
4
|
import { find } from "lodash";
|
|
5
|
-
import { SequenceRuleConfig } from "./
|
|
5
|
+
import { SequenceRuleConfig } from "./SequencePluginTypes";
|
|
6
6
|
|
|
7
7
|
export interface GenerateSequenceNumbersInput {
|
|
8
8
|
ruleCode: string;
|
|
File without changes
|
|
File without changes
|