sonamu 0.0.32 → 0.0.33
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/api/decorators.js
CHANGED
|
@@ -7,9 +7,9 @@ function api(options = {}) {
|
|
|
7
7
|
options = Object.assign({ httpMethod: "GET", contentType: "application/json", clients: ["axios"] }, options);
|
|
8
8
|
return function (target, propertyKey) {
|
|
9
9
|
var _a;
|
|
10
|
-
const modelName = target.constructor.name.match(/(.+)Class
|
|
10
|
+
const modelName = target.constructor.name.match(/(.+)Class$/)[1];
|
|
11
11
|
const methodName = propertyKey;
|
|
12
|
-
const defaultPath = `/${(0, inflection_1.camelize)(modelName.replace(
|
|
12
|
+
const defaultPath = `/${(0, inflection_1.camelize)(modelName.replace(/Model$/, ""), true)}/${(0, inflection_1.camelize)(propertyKey, true)}`;
|
|
13
13
|
const api = {
|
|
14
14
|
modelName,
|
|
15
15
|
methodName,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decorators.js","sourceRoot":"","sources":["../../src/api/decorators.ts"],"names":[],"mappings":";;;AACA,2CAAsC;AAsBzB,QAAA,cAAc,GAKrB,EAAE,CAAC;AAWT,SAAgB,GAAG,CAAC,UAA+B,EAAE;IACnD,OAAO,mBACL,UAAU,EAAE,KAAK,EACjB,WAAW,EAAE,kBAAkB,EAC/B,OAAO,EAAE,CAAC,OAAO,CAAC,IACf,OAAO,CACX,CAAC;IAEF,OAAO,UAAU,MAAc,EAAE,WAAmB;;QAClD,MAAM,SAAS,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"decorators.js","sourceRoot":"","sources":["../../src/api/decorators.ts"],"names":[],"mappings":";;;AACA,2CAAsC;AAsBzB,QAAA,cAAc,GAKrB,EAAE,CAAC;AAWT,SAAgB,GAAG,CAAC,UAA+B,EAAE;IACnD,OAAO,mBACL,UAAU,EAAE,KAAK,EACjB,WAAW,EAAE,kBAAkB,EAC/B,OAAO,EAAE,CAAC,OAAO,CAAC,IACf,OAAO,CACX,CAAC;IAEF,OAAO,UAAU,MAAc,EAAE,WAAmB;;QAClD,MAAM,SAAS,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAE,CAAC,CAAC,CAAC,CAAC;QAClE,MAAM,UAAU,GAAG,WAAW,CAAC;QAC/B,MAAM,WAAW,GAAG,IAAI,IAAA,qBAAQ,EAC9B,SAAS,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,EAC/B,IAAI,CACL,IAAI,IAAA,qBAAQ,EAAC,WAAW,EAAE,IAAI,CAAC,EAAE,CAAC;QAEnC,MAAM,GAAG,GAAG;YACV,SAAS;YACT,UAAU;YACV,IAAI,EAAE,MAAA,OAAO,CAAC,IAAI,mCAAI,WAAW;YACjC,OAAO;SACR,CAAC;QACF,sBAAc,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC3B,CAAC,CAAC;AACJ,CAAC;AAxBD,kBAwBC"}
|
|
@@ -16,7 +16,7 @@ export declare class Template__view_form extends Template {
|
|
|
16
16
|
body: string;
|
|
17
17
|
importKeys: never[];
|
|
18
18
|
preTemplates: {
|
|
19
|
-
key: "
|
|
19
|
+
key: "model" | "smd" | "generated" | "init_enums" | "init_types" | "init_generated" | "generated_http" | "model_test" | "bridge" | "service" | "view_list" | "view_list_columns" | "view_search_input" | "view_form" | "view_id_all_select" | "view_id_async_select" | "view_enums_select" | "view_enums_dropdown" | "view_enums_buttonset";
|
|
20
20
|
options: {
|
|
21
21
|
refCode?: string | undefined;
|
|
22
22
|
smdId: string;
|
|
@@ -21,7 +21,7 @@ export declare class Template__view_list extends Template {
|
|
|
21
21
|
body: string;
|
|
22
22
|
importKeys: never[];
|
|
23
23
|
preTemplates: {
|
|
24
|
-
key: "
|
|
24
|
+
key: "model" | "smd" | "generated" | "init_enums" | "init_types" | "init_generated" | "generated_http" | "model_test" | "bridge" | "service" | "view_list" | "view_list_columns" | "view_search_input" | "view_form" | "view_id_all_select" | "view_id_async_select" | "view_enums_select" | "view_enums_dropdown" | "view_enums_buttonset";
|
|
25
25
|
options: {
|
|
26
26
|
refCode?: string | undefined;
|
|
27
27
|
smdId: string;
|
package/package.json
CHANGED
package/src/api/decorators.ts
CHANGED
|
@@ -46,10 +46,10 @@ export function api(options: ApiDecoratorOptions = {}) {
|
|
|
46
46
|
};
|
|
47
47
|
|
|
48
48
|
return function (target: Object, propertyKey: string) {
|
|
49
|
-
const modelName = target.constructor.name.match(/(.+)Class
|
|
49
|
+
const modelName = target.constructor.name.match(/(.+)Class$/)![1];
|
|
50
50
|
const methodName = propertyKey;
|
|
51
51
|
const defaultPath = `/${camelize(
|
|
52
|
-
modelName.replace(
|
|
52
|
+
modelName.replace(/Model$/, ""),
|
|
53
53
|
true
|
|
54
54
|
)}/${camelize(propertyKey, true)}`;
|
|
55
55
|
|