@stechquick/symphony-cli 0.3.4 → 0.3.6
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/README.md +20 -18
- package/lib/commands/sym-build.js +5 -4
- package/lib/helpers/ui/quiBuilder.js +1 -1
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
- package/templates/addfunc/functions/{{FuncName}}/{{FuncName}}.ts +9 -8
- package/templates/init/{{AppName}}/functions/samplefunc/samplefunc.ts +34 -22
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ $ npm install -g @stechquick/symphony-cli
|
|
|
19
19
|
$ symphony-cli COMMAND
|
|
20
20
|
running command...
|
|
21
21
|
$ symphony-cli (-v|--version|version)
|
|
22
|
-
@stechquick/symphony-cli/0.3.
|
|
22
|
+
@stechquick/symphony-cli/0.3.6 linux-x64 node-v16.18.1
|
|
23
23
|
$ symphony-cli --help [COMMAND]
|
|
24
24
|
USAGE
|
|
25
25
|
$ symphony-cli COMMAND
|
|
@@ -81,7 +81,7 @@ EXAMPLE
|
|
|
81
81
|
symphony-cli mui-create myUI -d="My Micro UI project"
|
|
82
82
|
```
|
|
83
83
|
|
|
84
|
-
_See code: [src/commands/mui-create.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.3.
|
|
84
|
+
_See code: [src/commands/mui-create.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.3.6/src/commands/mui-create.ts)_
|
|
85
85
|
|
|
86
86
|
## `symphony-cli nc-addcomp NAME`
|
|
87
87
|
|
|
@@ -98,7 +98,7 @@ EXAMPLE
|
|
|
98
98
|
symphony-cli nc-addcomp my_comp_name
|
|
99
99
|
```
|
|
100
100
|
|
|
101
|
-
_See code: [src/commands/nc-addcomp.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.3.
|
|
101
|
+
_See code: [src/commands/nc-addcomp.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.3.6/src/commands/nc-addcomp.ts)_
|
|
102
102
|
|
|
103
103
|
## `symphony-cli nc-build`
|
|
104
104
|
|
|
@@ -116,7 +116,7 @@ EXAMPLES
|
|
|
116
116
|
$ symphony-cli nc-build -w
|
|
117
117
|
```
|
|
118
118
|
|
|
119
|
-
_See code: [src/commands/nc-build.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.3.
|
|
119
|
+
_See code: [src/commands/nc-build.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.3.6/src/commands/nc-build.ts)_
|
|
120
120
|
|
|
121
121
|
## `symphony-cli nc-create NAME`
|
|
122
122
|
|
|
@@ -136,7 +136,7 @@ EXAMPLE
|
|
|
136
136
|
symphony-cli nc-create nc_example -d="my named component example"
|
|
137
137
|
```
|
|
138
138
|
|
|
139
|
-
_See code: [src/commands/nc-create.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.3.
|
|
139
|
+
_See code: [src/commands/nc-create.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.3.6/src/commands/nc-create.ts)_
|
|
140
140
|
|
|
141
141
|
## `symphony-cli qui-build`
|
|
142
142
|
|
|
@@ -150,7 +150,7 @@ EXAMPLE
|
|
|
150
150
|
$ symphony-cli qui-build -w
|
|
151
151
|
```
|
|
152
152
|
|
|
153
|
-
_See code: [src/commands/qui-build.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.3.
|
|
153
|
+
_See code: [src/commands/qui-build.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.3.6/src/commands/qui-build.ts)_
|
|
154
154
|
|
|
155
155
|
## `symphony-cli qui-create NAME`
|
|
156
156
|
|
|
@@ -172,7 +172,7 @@ EXAMPLES
|
|
|
172
172
|
symphony-cli qui-create myUI -t=TOKEN -d="My Quick UI project"
|
|
173
173
|
```
|
|
174
174
|
|
|
175
|
-
_See code: [src/commands/qui-create.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.3.
|
|
175
|
+
_See code: [src/commands/qui-create.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.3.6/src/commands/qui-create.ts)_
|
|
176
176
|
|
|
177
177
|
## `symphony-cli qui-start`
|
|
178
178
|
|
|
@@ -189,7 +189,7 @@ EXAMPLE
|
|
|
189
189
|
$ symphony-cli qui-start -b
|
|
190
190
|
```
|
|
191
191
|
|
|
192
|
-
_See code: [src/commands/qui-start.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.3.
|
|
192
|
+
_See code: [src/commands/qui-start.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.3.6/src/commands/qui-start.ts)_
|
|
193
193
|
|
|
194
194
|
## `symphony-cli quick-serve`
|
|
195
195
|
|
|
@@ -212,7 +212,7 @@ EXAMPLES
|
|
|
212
212
|
$ symphony-cli quick-serve -g -r C:/MyPathToServe
|
|
213
213
|
```
|
|
214
214
|
|
|
215
|
-
_See code: [src/commands/quick-serve.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.3.
|
|
215
|
+
_See code: [src/commands/quick-serve.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.3.6/src/commands/quick-serve.ts)_
|
|
216
216
|
|
|
217
217
|
## `symphony-cli sym-addfunc FUNCNAME`
|
|
218
218
|
|
|
@@ -229,7 +229,7 @@ EXAMPLE
|
|
|
229
229
|
symphony-cli sym-addfunc havalemenu
|
|
230
230
|
```
|
|
231
231
|
|
|
232
|
-
_See code: [src/commands/sym-addfunc.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.3.
|
|
232
|
+
_See code: [src/commands/sym-addfunc.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.3.6/src/commands/sym-addfunc.ts)_
|
|
233
233
|
|
|
234
234
|
## `symphony-cli sym-build`
|
|
235
235
|
|
|
@@ -243,14 +243,16 @@ OPTIONS
|
|
|
243
243
|
-i, --swaggerInclusive to make swagger schema inclusive
|
|
244
244
|
-s, --skipversion skip version checking. Used for Deployment
|
|
245
245
|
-w, --watch for watch
|
|
246
|
-
--swagger for swagger
|
|
246
|
+
--swagger for swagger generation, this parameter must be given
|
|
247
247
|
|
|
248
248
|
EXAMPLES
|
|
249
249
|
$ symphony-cli sym-build
|
|
250
250
|
$ symphony-cli sym-build -w
|
|
251
|
+
$ symphony-cli sym-build --swagger
|
|
252
|
+
$ symphony-cli sym-build --swagger -i
|
|
251
253
|
```
|
|
252
254
|
|
|
253
|
-
_See code: [src/commands/sym-build.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.3.
|
|
255
|
+
_See code: [src/commands/sym-build.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.3.6/src/commands/sym-build.ts)_
|
|
254
256
|
|
|
255
257
|
## `symphony-cli sym-create NAME`
|
|
256
258
|
|
|
@@ -270,7 +272,7 @@ EXAMPLE
|
|
|
270
272
|
symphony-cli sym-create havale -d="Kanallardan yapılan havale işlemi"
|
|
271
273
|
```
|
|
272
274
|
|
|
273
|
-
_See code: [src/commands/sym-create.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.3.
|
|
275
|
+
_See code: [src/commands/sym-create.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.3.6/src/commands/sym-create.ts)_
|
|
274
276
|
|
|
275
277
|
## `symphony-cli sym-create-module NAME`
|
|
276
278
|
|
|
@@ -290,7 +292,7 @@ EXAMPLE
|
|
|
290
292
|
symphony-cli sym-create-module abm -d="abm module description"
|
|
291
293
|
```
|
|
292
294
|
|
|
293
|
-
_See code: [src/commands/sym-create-module.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.3.
|
|
295
|
+
_See code: [src/commands/sym-create-module.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.3.6/src/commands/sym-create-module.ts)_
|
|
294
296
|
|
|
295
297
|
## `symphony-cli sym-fn-deploy ENVIRONMENT`
|
|
296
298
|
|
|
@@ -324,7 +326,7 @@ EXAMPLES
|
|
|
324
326
|
--f_url="MyFnApiUrl"
|
|
325
327
|
```
|
|
326
328
|
|
|
327
|
-
_See code: [src/commands/sym-fn-deploy.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.3.
|
|
329
|
+
_See code: [src/commands/sym-fn-deploy.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.3.6/src/commands/sym-fn-deploy.ts)_
|
|
328
330
|
|
|
329
331
|
## `symphony-cli sym-nano-deploy`
|
|
330
332
|
|
|
@@ -342,7 +344,7 @@ EXAMPLE
|
|
|
342
344
|
symphony-cli sym-nano-deploy
|
|
343
345
|
```
|
|
344
346
|
|
|
345
|
-
_See code: [src/commands/sym-nano-deploy.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.3.
|
|
347
|
+
_See code: [src/commands/sym-nano-deploy.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.3.6/src/commands/sym-nano-deploy.ts)_
|
|
346
348
|
|
|
347
349
|
## `symphony-cli sym-start`
|
|
348
350
|
|
|
@@ -364,7 +366,7 @@ EXAMPLE
|
|
|
364
366
|
$ symphony-cli sym-start -b -d
|
|
365
367
|
```
|
|
366
368
|
|
|
367
|
-
_See code: [src/commands/sym-start.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.3.
|
|
369
|
+
_See code: [src/commands/sym-start.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.3.6/src/commands/sym-start.ts)_
|
|
368
370
|
|
|
369
371
|
## `symphony-cli sym-test`
|
|
370
372
|
|
|
@@ -381,5 +383,5 @@ EXAMPLE
|
|
|
381
383
|
$ symphony-cli sym-test
|
|
382
384
|
```
|
|
383
385
|
|
|
384
|
-
_See code: [src/commands/sym-test.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.3.
|
|
386
|
+
_See code: [src/commands/sym-test.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.3.6/src/commands/sym-test.ts)_
|
|
385
387
|
<!-- commandsstop -->
|
|
@@ -40,9 +40,10 @@ class Build extends command_1.Command {
|
|
|
40
40
|
}
|
|
41
41
|
async continueToBuild(watch) {
|
|
42
42
|
npmHelper_1.NpmHelper.build({ watch });
|
|
43
|
-
await new swaggerHelper_1.SwaggerHelper().Swagger("./functions");
|
|
44
43
|
const { flags } = this.parse(Build);
|
|
45
|
-
if (flags.
|
|
44
|
+
if (flags.swagger)
|
|
45
|
+
await new swaggerHelper_1.SwaggerHelper().Swagger("./functions");
|
|
46
|
+
if (flags.swagger && flags.swaggerInclusive)
|
|
46
47
|
new swaggerHelper_1.SwaggerHelper().SwaggerSchemaInclusive();
|
|
47
48
|
log_1.Logger.log({ message: styling_1.Chalk.create("green.bold", "Swagger created/updated successfully."), timeFormat: "datetime" });
|
|
48
49
|
log_1.Logger.log({ message: styling_1.Chalk.create("green.bold", "Build finished successfully."), timeFormat: "datetime" });
|
|
@@ -50,11 +51,11 @@ class Build extends command_1.Command {
|
|
|
50
51
|
}
|
|
51
52
|
exports.default = Build;
|
|
52
53
|
Build.description = 'Plateau-Symphony command to build the app with/without watch';
|
|
53
|
-
Build.examples = ["$ symphony-cli sym-build", "$ symphony-cli sym-build -w"];
|
|
54
|
+
Build.examples = ["$ symphony-cli sym-build", "$ symphony-cli sym-build -w", "$ symphony-cli sym-build --swagger", "$ symphony-cli sym-build --swagger -i"];
|
|
54
55
|
Build.flags = {
|
|
55
56
|
watch: command_1.flags.boolean({ char: 'w', description: 'for watch' }),
|
|
56
57
|
skipversion: command_1.flags.boolean({ char: 's', description: 'skip version checking. Used for Deployment' }),
|
|
57
|
-
swagger: command_1.flags.boolean({ description: 'for swagger' }),
|
|
58
|
+
swagger: command_1.flags.boolean({ description: 'for swagger generation, this parameter must be given' }),
|
|
58
59
|
swaggerInclusive: command_1.flags.boolean({ char: 'i', description: 'to make swagger schema inclusive' }),
|
|
59
60
|
};
|
|
60
61
|
Build.versionCheckSetting = {
|
|
@@ -177,7 +177,7 @@ class FolderCopier {
|
|
|
177
177
|
return retVal;
|
|
178
178
|
}
|
|
179
179
|
retVal.fileBody = fileBody.replace(": ComponentOptions =", " =");
|
|
180
|
-
retVal.fileBody = fileBody.replace('window["QEditorComponentOptions"]', 'window["plateauUIComponentOptions"]'); // for old versions of qui
|
|
180
|
+
retVal.fileBody = retVal.fileBody.replace('window["QEditorComponentOptions"]', 'window["plateauUIComponentOptions"]'); // for old versions of qui
|
|
181
181
|
return retVal;
|
|
182
182
|
}
|
|
183
183
|
}];
|
package/oclif.manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"0.3.
|
|
1
|
+
{"version":"0.3.6","commands":{"mui-create":{"id":"mui-create","description":"MicroUI command to create a new Micro UI project","pluginName":"@stechquick/symphony-cli","pluginType":"core","aliases":[],"examples":["symphony-cli mui-create myUI -d=\"My Micro UI project\""],"flags":{"desc":{"name":"desc","type":"option","char":"d","description":"description to project","hidden":false,"required":false,"default":""}},"args":[{"name":"name","description":"input microui name","required":true}]},"nc-addcomp":{"id":"nc-addcomp","description":"Command for add a named component to nc project.","pluginName":"@stechquick/symphony-cli","pluginType":"core","aliases":[],"examples":["symphony-cli nc-addcomp my_comp_name"],"flags":{},"args":[{"name":"name","description":"input component name","required":true}]},"nc-build":{"id":"nc-build","description":"Command for build your named component project.","pluginName":"@stechquick/symphony-cli","pluginType":"core","aliases":[],"examples":["$ symphony-cli nc-build","$ symphony-cli nc-build -w"],"flags":{"watch":{"name":"watch","type":"boolean","char":"w","description":"for watch","allowNo":false}},"args":[]},"nc-create":{"id":"nc-create","description":"Command for create a named component template project.","pluginName":"@stechquick/symphony-cli","pluginType":"core","aliases":[],"examples":["symphony-cli nc-create nc_example -d=\"my named component example\""],"flags":{"desc":{"name":"desc","type":"option","char":"d","description":"description to named component","hidden":false,"required":false,"default":""}},"args":[{"name":"name","description":"input project name","required":true}]},"qui-build":{"id":"qui-build","description":"Plateau-QUI command to build your Quick ui project","pluginName":"@stechquick/symphony-cli","pluginType":"core","aliases":[],"examples":["$ symphony-cli qui-build -w"],"flags":{},"args":[]},"qui-create":{"id":"qui-create","description":"Plateau-QUI command to create a new Quick ui project","pluginName":"@stechquick/symphony-cli","pluginType":"core","aliases":[],"examples":["symphony-cli qui-create myUI -t=TOKEN","symphony-cli qui-create myUI -t=TOKEN -d=\"My Quick UI project\""],"flags":{"desc":{"name":"desc","type":"option","char":"d","description":"description to project","hidden":false,"required":false,"default":""},"token":{"name":"token","type":"option","char":"t","description":"npm token for @stechquick","hidden":false,"required":true}},"args":[{"name":"name","description":"input quick ui name","required":true}]},"qui-start":{"id":"qui-start","description":"Plateau-QUI command for start your Quick ui project with/without build","pluginName":"@stechquick/symphony-cli","pluginType":"core","aliases":[],"examples":["$ symphony-cli qui-start -b"],"flags":{"build":{"name":"build","type":"boolean","char":"b","description":"for build","allowNo":false}},"args":[]},"quick-serve":{"id":"quick-serve","description":"QUICK command for serving your path","pluginName":"@stechquick/symphony-cli","pluginType":"core","aliases":[],"examples":["$ symphony-cli quick-serve","$ symphony-cli quick-serve -p 3000","$ symphony-cli quick-serve -g","$ symphony-cli quick-serve -r C:/MyPathToServe","$ symphony-cli quick-serve -g -r C:/MyPathToServe"],"flags":{"path":{"name":"path","type":"option","char":"r","description":"Change path to serve"},"httpPort":{"name":"httpPort","type":"option","char":"p","description":"HTTP port to serve"},"global":{"name":"global","type":"boolean","char":"g","description":"Host/visible for everyone.","allowNo":false}},"args":[]},"sym-addfunc":{"id":"sym-addfunc","description":"Plateau-Symphony command to create a new function","pluginName":"@stechquick/symphony-cli","pluginType":"core","aliases":[],"examples":["symphony-cli sym-addfunc havalemenu"],"flags":{},"args":[{"name":"funcname","description":"input function name","required":true,"hidden":false}]},"sym-build":{"id":"sym-build","description":"Plateau-Symphony command to build the app with/without watch","pluginName":"@stechquick/symphony-cli","pluginType":"core","aliases":[],"examples":["$ symphony-cli sym-build","$ symphony-cli sym-build -w","$ symphony-cli sym-build --swagger","$ symphony-cli sym-build --swagger -i"],"flags":{"watch":{"name":"watch","type":"boolean","char":"w","description":"for watch","allowNo":false},"skipversion":{"name":"skipversion","type":"boolean","char":"s","description":"skip version checking. Used for Deployment","allowNo":false},"swagger":{"name":"swagger","type":"boolean","description":"for swagger generation, this parameter must be given","allowNo":false},"swaggerInclusive":{"name":"swaggerInclusive","type":"boolean","char":"i","description":"to make swagger schema inclusive","allowNo":false}},"args":[]},"sym-create-module":{"id":"sym-create-module","description":"Plateau-Symphony command to create a Symphony App","pluginName":"@stechquick/symphony-cli","pluginType":"core","aliases":[],"examples":["symphony-cli sym-create-module abm -d=\"abm module description\""],"flags":{"desc":{"name":"desc","type":"option","char":"d","description":"description to module","hidden":false,"required":false,"default":""}},"args":[{"name":"name","description":"input module name","required":true}]},"sym-create":{"id":"sym-create","description":"Plateau-Symphony command to create a Symphony App","pluginName":"@stechquick/symphony-cli","pluginType":"core","aliases":[],"examples":["symphony-cli sym-create havale -d=\"Kanallardan yapılan havale işlemi\""],"flags":{"desc":{"name":"desc","type":"option","char":"d","description":"description to application","hidden":false,"required":false,"default":""}},"args":[{"name":"name","description":"input application name","required":true}]},"sym-fn-deploy":{"id":"sym-fn-deploy","description":"Plateau-Symphony fn command to deploy the all functions in your app","pluginName":"@stechquick/symphony-cli","pluginType":"core","aliases":[],"examples":["symphony-cli sym-fn-deploy local","symphony-cli sym-fn-deploy play","symphony-cli sym-fn-deploy remote","symphony-cli sym-fn-deploy remote -d MyDockerUrl -u MyDockerUser -p MyDockerPassword -f MyFnApiUrl","symphony-cli sym-fn-deploy remote --d_url MyDockerUrl --d_user MyDockerUser --d_pass MyDockerPassword --f_url MyFnApiUrl","symphony-cli sym-fn-deploy remote --d_url=\"MyDockerUrl\" --d_user=\"MyDockerUser\" --d_pass=\"MyDockerPassword\" --f_url=\"MyFnApiUrl\""],"flags":{"d_url":{"name":"d_url","type":"option","char":"d","description":"docker url to deploy","hidden":false,"required":false,"default":""},"d_user":{"name":"d_user","type":"option","char":"u","description":"docker username to deploy","hidden":false,"required":false,"default":""},"d_pass":{"name":"d_pass","type":"option","char":"p","description":"docker password for this username to deploy","hidden":false,"required":false,"default":""},"f_url":{"name":"f_url","type":"option","char":"f","description":"fn api url to deploy","hidden":false,"required":false,"default":""},"node_env":{"name":"node_env","type":"option","char":"e","description":"symphony environment name","hidden":false,"required":false}},"args":[{"name":"environment","description":"deploy environment: \n [local: your local] \n [play: playground environment] \n [remote: remote server]","required":true,"options":["local","play","remote"],"hidden":false}]},"sym-nano-deploy":{"id":"sym-nano-deploy","description":"Plateau-Symphony nano command to deploy the all functions in your app","pluginName":"@stechquick/symphony-cli","pluginType":"core","aliases":[],"examples":["symphony-cli sym-nano-deploy"],"flags":{"node_env":{"name":"node_env","type":"option","char":"e","description":"symphony environment name","hidden":false,"required":false},"imagename":{"name":"imagename","type":"option","char":"i","description":"image name for docker","hidden":false,"required":true}},"args":[]},"sym-start":{"id":"sym-start","description":"Plateau-Symphony command to start your functions with/without debug","pluginName":"@stechquick/symphony-cli","pluginType":"core","aliases":[],"examples":["$ symphony-cli sym-start -b -d"],"flags":{"debug":{"name":"debug","type":"boolean","char":"d","description":"for debug","allowNo":false},"build":{"name":"build","type":"boolean","char":"b","description":"for build","allowNo":false},"http_port":{"name":"http_port","type":"option","char":"p","description":"port to HTTP server"},"https_port":{"name":"https_port","type":"option","char":"h","description":"port to HTTPS server"},"environment":{"name":"environment","type":"option","char":"e","description":"environment variable","hidden":false,"required":false},"hosted_path":{"name":"hosted_path","type":"option","description":"application hosted sub path","required":false}},"args":[]},"sym-test":{"id":"sym-test","description":"Plateau-Symphony command to run your all test functions with coverage","pluginName":"@stechquick/symphony-cli","pluginType":"core","aliases":[],"examples":["$ symphony-cli sym-test"],"flags":{"func":{"name":"func","type":"option","char":"f","description":"funtion name to test particular file"}},"args":[]}}}
|
package/package.json
CHANGED
|
@@ -2,17 +2,18 @@ import { ISymphonyObject, symphony } from "@stechsym/symphony";
|
|
|
2
2
|
import { TReqDefault, TReqHeaderDefault } from "@stechsym/symphony/dist/src/infrastructure/managers/symphonyObject/symphonyRequest";
|
|
3
3
|
import { TRespDefault, TRespHeaderDefault } from "@stechsym/symphony/dist/src/infrastructure/managers/symphonyObject/symphonyResponse";
|
|
4
4
|
|
|
5
|
-
export interface IRequest extends TReqDefault {};
|
|
6
|
-
export interface IRequestHeader extends TReqHeaderDefault {};
|
|
7
|
-
export interface IResponse extends TRespDefault {};
|
|
8
|
-
export interface IResponseHeader extends TRespHeaderDefault {};
|
|
9
|
-
|
|
10
5
|
symphony.registerFunc({
|
|
11
6
|
funcName: "{{FuncName}}",
|
|
12
7
|
keepBag: false,
|
|
13
8
|
requireFunc: require,
|
|
14
|
-
func:
|
|
15
|
-
//write your code here
|
|
16
|
-
}
|
|
9
|
+
func: (sym: ISymphonyObject<IRequest, IRequestHeader, IResponse, IResponseHeader>) => {{FuncName}}Func(sym),
|
|
17
10
|
});
|
|
18
11
|
|
|
12
|
+
export interface IRequest extends TReqDefault { };
|
|
13
|
+
export interface IRequestHeader extends TReqHeaderDefault { };
|
|
14
|
+
export interface IResponse extends TRespDefault { };
|
|
15
|
+
export interface IResponseHeader extends TRespHeaderDefault { };
|
|
16
|
+
|
|
17
|
+
async function {{FuncName}}Func(sym: ISymphonyObject<IRequest, IRequestHeader, IResponse, IResponseHeader>) {
|
|
18
|
+
//write your code here
|
|
19
|
+
}
|
|
@@ -1,27 +1,39 @@
|
|
|
1
|
-
import { symphony } from "@stechsym/symphony";
|
|
1
|
+
import { ISymphonyObject, symphony } from "@stechsym/symphony";
|
|
2
|
+
import { TReqDefault, TReqHeaderDefault } from "@stechsym/symphony/dist/src/infrastructure/managers/symphonyObject/symphonyRequest";
|
|
3
|
+
import { TRespDefault, TRespHeaderDefault } from "@stechsym/symphony/dist/src/infrastructure/managers/symphonyObject/symphonyResponse";
|
|
2
4
|
|
|
3
5
|
symphony.registerFunc({
|
|
4
|
-
funcName: "samplefunc",
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
sym.response.body.calculations = { funcName: "samplefunc", sum: sum, difference: difference };
|
|
6
|
+
funcName: "samplefunc",
|
|
7
|
+
keepBag: false,
|
|
8
|
+
requireFunc: require,
|
|
9
|
+
func: (sym: ISymphonyObject<IRequest, IRequestHeader, IResponse, IResponseHeader>) => samplefunc(sym),
|
|
10
|
+
});
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
export interface IRequest extends TReqDefault { };
|
|
13
|
+
export interface IRequestHeader extends TReqHeaderDefault { };
|
|
14
|
+
export interface IResponse extends TRespDefault { };
|
|
15
|
+
export interface IResponseHeader extends TRespHeaderDefault { };
|
|
15
16
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
async function samplefunc(sym: ISymphonyObject<IRequest, IRequestHeader, IResponse, IResponseHeader>) {
|
|
18
|
+
const x = sym.request.body.number1;
|
|
19
|
+
const y = sym.request.body.number2;
|
|
20
|
+
const sum: number = x + y;
|
|
21
|
+
const difference: number = y - x;
|
|
22
|
+
sym.response.body.calculations = { funcName: "samplefunc", sum: sum, difference: difference };
|
|
20
23
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
});
|
|
24
|
+
//#region rest example
|
|
25
|
+
const respGet = await sym.rest.get({ symConfigKey: "restGetExample" });
|
|
26
|
+
sym.response.body.restGetResponse = { listEmp: respGet.body };
|
|
27
|
+
//#endregion
|
|
28
|
+
|
|
29
|
+
//#region rest example
|
|
30
|
+
const respPost = await sym.rest.post({ symConfigKey: "restPostExample", body: { "name": "test", "salary": "123", "age": "23" } });
|
|
31
|
+
sym.response.body.restPostResponse = { listEmp: respPost.body };
|
|
32
|
+
//#endregion
|
|
33
|
+
|
|
34
|
+
//#region soap example
|
|
35
|
+
const soapBody = { "intA": "2", "intB": "3" };
|
|
36
|
+
const respSoap = await sym.soap.request({ request: { body: soapBody, methodName: "Add", symConfigKey: "soapExample" } });
|
|
37
|
+
sym.response.body.soapResponse = { total: respSoap.data };
|
|
38
|
+
//#endregion
|
|
39
|
+
}
|