@ruiapp/rapid-core 0.1.10 → 0.1.12

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.js CHANGED
@@ -3770,7 +3770,7 @@ async function handler$5(plugin, ctx, options) {
3770
3770
  iss: "authManager",
3771
3771
  sub: "userAccessToken",
3772
3772
  aud: "" + user.id,
3773
- iat: new Date,
3773
+ iat: Math.floor(Date.now() / 1000),
3774
3774
  act: user.login,
3775
3775
  }, secretKey);
3776
3776
  setCookie(response.headers, {
@@ -3836,7 +3836,7 @@ async function handler$3(plugin, ctx, options) {
3836
3836
  };
3837
3837
  }
3838
3838
 
3839
- var getMyProfile$1 = /*#__PURE__*/Object.freeze({
3839
+ var getMyProfile$2 = /*#__PURE__*/Object.freeze({
3840
3840
  __proto__: null,
3841
3841
  code: code$3,
3842
3842
  handler: handler$3
@@ -3845,7 +3845,7 @@ var getMyProfile$1 = /*#__PURE__*/Object.freeze({
3845
3845
  var pluginActionHandlers = [
3846
3846
  createSession,
3847
3847
  deleteSession,
3848
- getMyProfile$1,
3848
+ getMyProfile$2,
3849
3849
  ];
3850
3850
 
3851
3851
  var AccessToken = {
@@ -3907,10 +3907,10 @@ var pluginModels = [
3907
3907
  AccessToken,
3908
3908
  ];
3909
3909
 
3910
- var getMyProfile = {
3910
+ var getMyProfile$1 = {
3911
3911
  namespace: "auth",
3912
3912
  name: "auth.getMyProfile",
3913
- code: "",
3913
+ code: "auth.getMyProfile",
3914
3914
  type: "RESTful",
3915
3915
  method: "GET",
3916
3916
  endpoint: "/me",
@@ -3921,10 +3921,10 @@ var getMyProfile = {
3921
3921
  ],
3922
3922
  };
3923
3923
 
3924
- var signin = {
3924
+ var signin$1 = {
3925
3925
  namespace: "auth",
3926
3926
  name: "auth.signin",
3927
- code: "",
3927
+ code: "auth.signin",
3928
3928
  type: "RESTful",
3929
3929
  method: "POST",
3930
3930
  endpoint: "/signin",
@@ -3935,10 +3935,10 @@ var signin = {
3935
3935
  ],
3936
3936
  };
3937
3937
 
3938
- var signout = {
3938
+ var signout$1 = {
3939
3939
  namespace: "auth",
3940
3940
  name: "auth.signout",
3941
- code: "",
3941
+ code: "auth.signout",
3942
3942
  type: "RESTful",
3943
3943
  method: "GET",
3944
3944
  endpoint: "/signout",
@@ -3949,10 +3949,10 @@ var signout = {
3949
3949
  ],
3950
3950
  };
3951
3951
 
3952
- var pluginRoutes = [
3953
- getMyProfile,
3954
- signin,
3955
- signout,
3952
+ var pluginRoutes$1 = [
3953
+ getMyProfile$1,
3954
+ signin$1,
3955
+ signout$1,
3956
3956
  ];
3957
3957
 
3958
3958
  /**
@@ -3997,7 +3997,7 @@ class AuthPlugin {
3997
3997
  async configureModelProperties(server, applicationConfig) {
3998
3998
  }
3999
3999
  async configureRoutes(server, applicationConfig) {
4000
- server.appendApplicationConfig({ routes: pluginRoutes });
4000
+ server.appendApplicationConfig({ routes: pluginRoutes$1 });
4001
4001
  }
4002
4002
  async onApplicationLoaded(server, applicationConfig) {
4003
4003
  console.log("authManager.onApplicationLoaded");
@@ -4141,6 +4141,54 @@ var uploadFileActionHandler = /*#__PURE__*/Object.freeze({
4141
4141
  handler: handler
4142
4142
  });
4143
4143
 
4144
+ var getMyProfile = {
4145
+ namespace: "ecm",
4146
+ name: "ecm.uploadFile",
4147
+ code: "ecm.uploadFile",
4148
+ type: "RESTful",
4149
+ method: "POST",
4150
+ endpoint: "/upload",
4151
+ actions: [
4152
+ {
4153
+ code: "uploadFile",
4154
+ },
4155
+ ],
4156
+ };
4157
+
4158
+ var signin = {
4159
+ namespace: "ecm",
4160
+ name: "ecm.downloadFile",
4161
+ code: "ecm.downloadFile",
4162
+ type: "RESTful",
4163
+ method: "GET",
4164
+ endpoint: "/download/file",
4165
+ actions: [
4166
+ {
4167
+ code: "downloadFile",
4168
+ },
4169
+ ],
4170
+ };
4171
+
4172
+ var signout = {
4173
+ namespace: "ecm",
4174
+ name: "ecm.downloadDocument",
4175
+ code: "ecm.downloadDocument",
4176
+ type: "RESTful",
4177
+ method: "GET",
4178
+ endpoint: "/download/document",
4179
+ actions: [
4180
+ {
4181
+ code: "downloadDocument",
4182
+ },
4183
+ ],
4184
+ };
4185
+
4186
+ var pluginRoutes = [
4187
+ getMyProfile,
4188
+ signin,
4189
+ signout,
4190
+ ];
4191
+
4144
4192
  /**
4145
4193
  * File manager plugin
4146
4194
  */
@@ -4182,6 +4230,7 @@ class FileManager {
4182
4230
  async configureModelProperties(server, applicationConfig) {
4183
4231
  }
4184
4232
  async configureRoutes(server, applicationConfig) {
4233
+ server.appendApplicationConfig({ routes: pluginRoutes });
4185
4234
  }
4186
4235
  async onApplicationLoaded(server, applicationConfig) {
4187
4236
  console.log("fileManager.onApplicationLoaded");
@@ -0,0 +1,12 @@
1
+ declare const _default: {
2
+ namespace: string;
3
+ name: string;
4
+ code: string;
5
+ type: "RESTful";
6
+ method: "GET";
7
+ endpoint: string;
8
+ actions: {
9
+ code: string;
10
+ }[];
11
+ };
12
+ export default _default;
@@ -0,0 +1,12 @@
1
+ declare const _default: {
2
+ namespace: string;
3
+ name: string;
4
+ code: string;
5
+ type: "RESTful";
6
+ method: "GET";
7
+ endpoint: string;
8
+ actions: {
9
+ code: string;
10
+ }[];
11
+ };
12
+ export default _default;
@@ -0,0 +1,22 @@
1
+ declare const _default: ({
2
+ namespace: string;
3
+ name: string;
4
+ code: string;
5
+ type: "RESTful";
6
+ method: "POST";
7
+ endpoint: string;
8
+ actions: {
9
+ code: string;
10
+ }[];
11
+ } | {
12
+ namespace: string;
13
+ name: string;
14
+ code: string;
15
+ type: "RESTful";
16
+ method: "GET";
17
+ endpoint: string;
18
+ actions: {
19
+ code: string;
20
+ }[];
21
+ })[];
22
+ export default _default;
@@ -0,0 +1,12 @@
1
+ declare const _default: {
2
+ namespace: string;
3
+ name: string;
4
+ code: string;
5
+ type: "RESTful";
6
+ method: "POST";
7
+ endpoint: string;
8
+ actions: {
9
+ code: string;
10
+ }[];
11
+ };
12
+ export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ruiapp/rapid-core",
3
- "version": "0.1.10",
3
+ "version": "0.1.12",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "keywords": [],
@@ -42,7 +42,7 @@ export async function handler(
42
42
  iss: "authManager",
43
43
  sub: "userAccessToken",
44
44
  aud: "" + user.id,
45
- iat: new Date,
45
+ iat: Math.floor(Date.now() / 1000),
46
46
  act: user.login,
47
47
  } as UserAccessToken, secretKey);
48
48
 
@@ -3,7 +3,7 @@ import { RpdRoute } from "~/types";
3
3
  export default {
4
4
  namespace: "auth",
5
5
  name: "auth.getMyProfile",
6
- code: "",
6
+ code: "auth.getMyProfile",
7
7
  type: "RESTful",
8
8
  method: "GET",
9
9
  endpoint: "/me",
@@ -3,7 +3,7 @@ import { RpdRoute } from "~/types";
3
3
  export default {
4
4
  namespace: "auth",
5
5
  name: "auth.signin",
6
- code: "",
6
+ code: "auth.signin",
7
7
  type: "RESTful",
8
8
  method: "POST",
9
9
  endpoint: "/signin",
@@ -3,7 +3,7 @@ import { RpdRoute } from "~/types";
3
3
  export default {
4
4
  namespace: "auth",
5
5
  name: "auth.signout",
6
- code: "",
6
+ code: "auth.signout",
7
7
  type: "RESTful",
8
8
  method: "GET",
9
9
  endpoint: "/signout",
@@ -11,6 +11,7 @@ import * as downloadFileActionHandler from "./actionHandlers/downloadFile";
11
11
  import * as uploadFileActionHandler from "./actionHandlers/uploadFile";
12
12
  import { IRpdServer, RapidPlugin, RpdConfigurationItemOptions, RpdServerPluginConfigurableTargetOptions, RpdServerPluginExtendingAbilities } from "~/core/server";
13
13
 
14
+ import pluginRoutes from "./routes";
14
15
 
15
16
  class FileManager implements RapidPlugin {
16
17
  get code(): string {
@@ -64,6 +65,7 @@ class FileManager implements RapidPlugin {
64
65
  }
65
66
 
66
67
  async configureRoutes(server: IRpdServer, applicationConfig: RpdApplicationConfig): Promise<any> {
68
+ server.appendApplicationConfig({ routes: pluginRoutes });
67
69
  }
68
70
 
69
71
  async onApplicationLoaded(server: IRpdServer, applicationConfig: RpdApplicationConfig): Promise<any> {
@@ -0,0 +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;
@@ -0,0 +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;
@@ -0,0 +1,9 @@
1
+ import getMyProfile from "./uploadFile";
2
+ import signin from "./downloadFile";
3
+ import signout from "./downloadDocument";
4
+
5
+ export default [
6
+ getMyProfile,
7
+ signin,
8
+ signout,
9
+ ]
@@ -0,0 +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;