@adinsure-ops/ops-cli 4.0.0-rc10

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.
Files changed (71) hide show
  1. package/CHANGELOGS.md +56 -0
  2. package/LICENSE +1 -0
  3. package/README.md +725 -0
  4. package/bin/run +5 -0
  5. package/bin/run.cmd +3 -0
  6. package/lib/command.base.d.ts +17 -0
  7. package/lib/command.base.jira.d.ts +11 -0
  8. package/lib/command.base.jira.js +37 -0
  9. package/lib/command.base.js +73 -0
  10. package/lib/commands/doctor.d.ts +54 -0
  11. package/lib/commands/doctor.js +311 -0
  12. package/lib/commands/download/client.d.ts +17 -0
  13. package/lib/commands/download/client.js +71 -0
  14. package/lib/commands/download/identity-server.d.ts +17 -0
  15. package/lib/commands/download/identity-server.js +71 -0
  16. package/lib/commands/download/platform.d.ts +18 -0
  17. package/lib/commands/download/platform.js +72 -0
  18. package/lib/commands/download/scheduler.d.ts +17 -0
  19. package/lib/commands/download/scheduler.js +71 -0
  20. package/lib/commands/download/server.d.ts +17 -0
  21. package/lib/commands/download/server.js +71 -0
  22. package/lib/commands/download/studio.d.ts +19 -0
  23. package/lib/commands/download/studio.js +88 -0
  24. package/lib/commands/gitlab/next-nightly-tag.d.ts +29 -0
  25. package/lib/commands/gitlab/next-nightly-tag.js +169 -0
  26. package/lib/commands/jira/issue.d.ts +17 -0
  27. package/lib/commands/jira/issue.js +31 -0
  28. package/lib/commands/jira/labels.d.ts +22 -0
  29. package/lib/commands/jira/labels.js +70 -0
  30. package/lib/commands/log/add.d.ts +17 -0
  31. package/lib/commands/log/add.js +107 -0
  32. package/lib/commands/log/generate.d.ts +22 -0
  33. package/lib/commands/log/generate.js +155 -0
  34. package/lib/commands/log/validate.d.ts +11 -0
  35. package/lib/commands/log/validate.js +58 -0
  36. package/lib/commands/login.d.ts +24 -0
  37. package/lib/commands/login.js +154 -0
  38. package/lib/commands/npm/check-publish.d.ts +16 -0
  39. package/lib/commands/npm/check-publish.js +77 -0
  40. package/lib/commands/npm/publish.d.ts +22 -0
  41. package/lib/commands/npm/publish.js +162 -0
  42. package/lib/commands/prepare-content.d.ts +29 -0
  43. package/lib/commands/prepare-content.js +386 -0
  44. package/lib/commands/sql.d.ts +24 -0
  45. package/lib/commands/sql.js +147 -0
  46. package/lib/commands/translate.d.ts +37 -0
  47. package/lib/commands/translate.js +149 -0
  48. package/lib/commands/version.d.ts +48 -0
  49. package/lib/commands/version.js +267 -0
  50. package/lib/config.d.ts +7 -0
  51. package/lib/config.js +9 -0
  52. package/lib/hooks/init/version-override.d.ts +2 -0
  53. package/lib/hooks/init/version-override.js +15 -0
  54. package/lib/index.d.ts +1 -0
  55. package/lib/index.js +4 -0
  56. package/lib/lib/command.d.ts +9 -0
  57. package/lib/lib/command.js +71 -0
  58. package/lib/lib/npm.d.ts +15 -0
  59. package/lib/lib/npm.js +79 -0
  60. package/lib/lib/npmrc.d.ts +17 -0
  61. package/lib/lib/npmrc.js +44 -0
  62. package/lib/security/cache.d.ts +7 -0
  63. package/lib/security/cache.js +33 -0
  64. package/lib/security/context.d.ts +58 -0
  65. package/lib/security/context.js +228 -0
  66. package/lib/types/changelog.types.d.ts +6 -0
  67. package/lib/types/changelog.types.js +2 -0
  68. package/lib/types/npm.types.d.ts +34 -0
  69. package/lib/types/npm.types.js +2 -0
  70. package/oclif.manifest.json +1 -0
  71. package/package.json +116 -0
package/README.md ADDED
@@ -0,0 +1,725 @@
1
+ # Operations CLI
2
+
3
+ Operations CLI for supporting AdInsure development processes.
4
+
5
+ # Latest version
6
+
7
+ 4.0.0
8
+
9
+ ## Install
10
+
11
+ OPS CLI can be downloaded and installed using installer.
12
+ For versions check [tags](https://git.adacta-fintech.com/ops/ops-cli/-/tags)
13
+ or [download a JSON](https://adinsure.blob.core.windows.net/ops-cli/version) containing version and other information.
14
+
15
+ | Platform| Link|
16
+ |:---|:---|
17
+ |Windows 64-bit|https://adinsure.blob.core.windows.net/ops-cli/win/ops-v4.0.0-x64.exe|
18
+ |Debian 64-bit |https://adinsure.blob.core.windows.net/ops-cli/deb/ops_4.0.0-1_amd64.deb|
19
+
20
+
21
+
22
+ ## CLI development
23
+
24
+ For development you will need **[Node.js](https://nodejs.org/en/)** (recommended 16 LTS, minimal 8.0.0) and **[Yarn](https://yarnpkg.com/en/)** installed.
25
+
26
+ We recommend **[Visual Studio Code](https://code.visualstudio.com/)** IDE.
27
+
28
+ To quick start development:
29
+
30
+ - Clone this repository (`git clone https://git.adacta-fintech.com/ops/ops-cli.git`)
31
+ - Open in VS Code
32
+ - Run `yarn install`
33
+ - For easier debugging, run `yarn link`
34
+
35
+ You can run and debug commands directly from terminal by running `ops [command]` (if you `yarn link`-ed the package) or execute `.\bin\run [command]` (if you didn't).
36
+
37
+ ## Commands
38
+
39
+ <!-- commands -->
40
+ * [`ops help [COMMAND]`](#ops-help-command)
41
+ * [`ops doctor`](#ops-doctor)
42
+ * [`ops download:client <flags>`](#ops-download-client-flags)
43
+ * [`ops download:identity-server <flags>`](#ops-download-identity-server-flags)
44
+ * [`ops download:platform <flags>`](#ops-download-platform-flags)
45
+ * [`ops download:scheduler <flags>`](#ops-download-scheduler-flags)
46
+ * [`ops download:server <flags>`](#ops-download-server-flags)
47
+ * [`ops download:studio <flags>`](#ops-download-studio-flags)
48
+ * [`ops gitlab:next-nightly-tag`](#ops-gitlab-next-nightly-tag)
49
+ * [`ops log <component> <issue> [options]`](#ops-log-component-issue-options)
50
+ * [`ops log:gen [options]`](#ops-loggen-options)
51
+ * [`ops log:validate [options]`](#ops-logvalidate-options)
52
+ * [`ops login`](#ops-login)
53
+ * [`ops npm:check-publish`](#ops-npm-check-publish)
54
+ * [`ops npm:publish`](#ops-npm-publish)
55
+ * [`ops prepare-content`](#ops-prepare-content)
56
+ * [`ops sql <type> <module> [flags]`](#ops-sql-type-module-flags)
57
+ * [`ops translate`](#ops-translate)
58
+ * [`ops update`](#ops-update)
59
+ * [`ops version <type> [flags]`](#ops-version)
60
+
61
+ ## `ops help [COMMAND]`
62
+
63
+ display help for ops
64
+
65
+ ```
66
+ USAGE
67
+ $ ops help [COMMAND]
68
+
69
+ ARGUMENTS
70
+ COMMAND command to show help for
71
+
72
+ OPTIONS
73
+ --all see all commands in CLI
74
+ ```
75
+
76
+ _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v2.2.0/src\commands\help.ts)_
77
+
78
+
79
+ ## `ops doctor`
80
+
81
+ check if everyting is installed
82
+
83
+ ```
84
+ USAGE
85
+ $ ops doctor
86
+
87
+ OPTIONS
88
+ -p, --fix try to install missing packages
89
+
90
+ EXAMPLE
91
+ $ ops doctor
92
+ ```
93
+
94
+ ## `ops download:client <flags>`
95
+
96
+ download AdInsure Client zip from Azure storage
97
+
98
+ ```
99
+ USAGE
100
+ $ ops download:client <flags>
101
+
102
+ OPTIONS
103
+ -o, --output=output [default: ./] output directory
104
+ -v, --version=version (required) version we want to download
105
+
106
+ EXAMPLE
107
+ $ ops download:client -v 3.2.0 -o ~/Downloads
108
+ ```
109
+
110
+ ## `ops download:identity-server <flags>`
111
+
112
+ download AdInsure Identity Server zip from Azure storage
113
+
114
+ ```
115
+ USAGE
116
+ $ ops download:identity-server <flags>
117
+
118
+ OPTIONS
119
+ -o, --output=output [default: ./] output directory
120
+ -v, --version=version (required) version we want to download
121
+
122
+ EXAMPLE
123
+ $ ops download:identity-server -v 3.0.3 -o ~/Downloads
124
+ ```
125
+
126
+ ## `ops download:platform <flags>`
127
+
128
+ download AdInsure Platform bundle containing zip of Client, Server and IdentityServer from azure storage
129
+
130
+ ```
131
+ USAGE
132
+ $ ops download <flags>
133
+
134
+ OPTIONS
135
+ -o, --output=output [default: ./] output directory
136
+ -v, --version=version (required) version we want to download
137
+
138
+ ALIASES
139
+ $ ops download
140
+
141
+ EXAMPLE
142
+ $ ops download -v 6.0.0 -o ~/Downloads
143
+ ```
144
+
145
+ ## `ops download:scheduler <flags>`
146
+
147
+ download AdInsure Scheduler zip from azure storage
148
+
149
+ ```
150
+ USAGE
151
+ $ ops download:scheduler <flags>
152
+
153
+ OPTIONS
154
+ -o, --output=output [default: ./] output directory
155
+ -v, --version=version (required) version we want to download
156
+
157
+ EXAMPLE
158
+ $ ops download:scheduler -v 3.2.0 -o ~/Downloads
159
+ ```
160
+
161
+ ## `ops download:server <flags>`
162
+
163
+ download AdInsure Server zip from Azure storage
164
+
165
+ ```
166
+ USAGE
167
+ $ ops download:server <flags>
168
+
169
+ OPTIONS
170
+ -o, --output=output [default: ./] output directory
171
+ -v, --version=version (required) version we want to download
172
+
173
+ EXAMPLE
174
+ $ ops download:server -v 3.2.0 -o ~/Downloads
175
+ ```
176
+
177
+ ## `ops download:studio <flags>`
178
+
179
+ download AdInsure Studio vsix from azure storage
180
+
181
+ ```
182
+ USAGE
183
+ $ ops download:studio <flags>
184
+
185
+ OPTIONS
186
+ -i, --install install plugin to vscode. save to temp folder and remove vsix after.
187
+ -o, --output=output [default: ./] output directory
188
+ -v, --version=version (required) version we want to download
189
+
190
+ EXAMPLES
191
+ $ ops download:studio -v 15.0.0 -o ~/Downloads
192
+ $ ops download:studio -v 15.0.0 -i
193
+ ```
194
+
195
+ ## `ops download:studio <flags>`
196
+
197
+ download AdInsure Studio vsix from azure storage
198
+
199
+ ```
200
+ USAGE
201
+ $ ops download:studio <flags>
202
+
203
+ OPTIONS
204
+ -i, --install install plugin to vscode. save to temp folder and remove vsix after.
205
+ -o, --output=output [default: ./] output directory
206
+ -v, --version=version (required) version we want to download
207
+
208
+ EXAMPLES
209
+ $ ops download:studio -v 15.0.0 -o ~/Downloads
210
+ $ ops download:studio -v 15.0.0 -i
211
+ ```
212
+
213
+ ## `ops gitlab:next-nightly-tag`
214
+
215
+ creates new gitlab tag
216
+
217
+ ```
218
+ USAGE
219
+ $ ops gitlab:next-nightly-tag <version>
220
+
221
+ ARGUMENTS
222
+ VERSION Tag version
223
+
224
+ OPTIONS
225
+ --dryRun Only printout version and don't create it
226
+ --host=host (required) [default: https://git.adacta-fintech.com] Server hostname
227
+ --pat=pat (required) Token from user that has permissions to list and create tags
228
+ --project=project (required) [default: 413] Project ID
229
+ --reference=reference (required) Reference to create tag on (branch, commit, tag)
230
+ ```
231
+
232
+ ## `ops jira:issue <issue>`
233
+
234
+ get Jira issue
235
+
236
+ ```
237
+ USAGE
238
+ $ ops jira:issue <issue>
239
+
240
+ ARGUMENTS
241
+ ISSUE Jira issue number
242
+
243
+ OPTIONS
244
+ --hostname=hostname [default: https://jira.adacta-fintech.com] jira hostname
245
+ --password=password (required) jira password
246
+ --username=username (required) jira username
247
+
248
+ EXAMPLE
249
+ $ ops jira:issue LJADIRD-1337
250
+ ```
251
+
252
+ ## `ops jira:issue <issue> -a [label] -r [label]`
253
+
254
+ list or edit labels on Jira issue
255
+
256
+ ```
257
+ USAGE
258
+ $ ops jira:labels <issue> -a [label] -r [label]
259
+
260
+ ARGUMENTS
261
+ ISSUE Jira issue number
262
+
263
+ OPTIONS
264
+ -a, --add=add add label
265
+ -r, --remove=remove remove label
266
+ --hostname=hostname [default: https://jira.adacta-fintech.com] jira hostname
267
+ --password=password (required) jira password
268
+ --username=username (required) jira username
269
+
270
+ EXAMPLE
271
+ $ ops jira:labels LJADIRD-1337
272
+ ```
273
+
274
+ ## `ops log <issue> -t <type> -c [component]`
275
+
276
+ creates a new changelog entry
277
+
278
+ ```
279
+ USAGE
280
+ $ ops log <issue> -t <type> -c [component]
281
+
282
+ ARGUMENTS
283
+ ISSUE Jira issue number
284
+ TYPE (feature|fixed|improve|breaking) Change type
285
+ COMPONENT (Configuration|DevOps|Implementation|Platform) Component for which new changelog should be generated
286
+
287
+
288
+ OPTIONS
289
+ -c, --component=component Component for which new changelog should be generated
290
+ -t, --type=feature|fixed|improve|breaking (required) type of changelog
291
+
292
+ ALIASES
293
+ $ ops log
294
+ $ ops log:add
295
+
296
+ EXAMPLES
297
+ $ ops log LJADIRD-1234 -t feature
298
+ $ ops log LJADIRD-5678 -t fixed
299
+ $ ops log LJADIRD-8765 -t breaking -c Platform
300
+ $ ops log LJADIRD-4321 -t improve -c Configuration
301
+ ```
302
+
303
+ ## `ops log:gen [options]`
304
+
305
+ generates final changelog from unreleased notes on the root,
306
+ final changelog for implementation component is placed under basic/Changelog.md
307
+
308
+ ```
309
+ USAGE
310
+ $ ops log:gen [options]
311
+
312
+ OPTIONS
313
+ -c, --components=components components separated by comma (,) to process for final changelog
314
+ -f, --file=file [default: CHANGELOG.md] file to update with new changelogs
315
+ -p, --preview generates a preview markdown of current unreleased changelogs
316
+ -v, --version=version version for which you're generating changelogs
317
+ --force update target file without prompting for confirmation
318
+ --ignore-no-changelogs generate final changelog even if no unreleased changelogs exist
319
+
320
+ ALIASES
321
+ $ ops log:gen
322
+
323
+ EXAMPLE
324
+ $ ops log:gen
325
+ $ ops log:gen -p
326
+ $ ops log:gen -c Platform
327
+ $ ops log:gen -c Platform,Configuration
328
+ $ ops log:gen -c Implementation -f CHANGELOG.Implementation.md
329
+ ```
330
+
331
+ ## `ops log:validate [options]`
332
+
333
+ validates formatting of all unreleased changelogs:
334
+
335
+ - 2.4.2 - added an exit statement that will force exit on changelog validation errors, preparing it for CI
336
+
337
+ ```
338
+ USAGE
339
+ $ ops log:validate [options]
340
+
341
+ ALIASES
342
+ $ ops log:validate
343
+
344
+ EXAMPLE
345
+ $ ops log:validate
346
+ ```
347
+
348
+ ## `ops login`
349
+
350
+ log in to use ops services
351
+
352
+ ```
353
+ USAGE
354
+ $ ops login
355
+
356
+ OPTIONS
357
+ --servicePrincipal authenticate using service principal credentials
358
+ -c, --clientId (application) client id
359
+ -s, --secret client secret
360
+
361
+ EXAMPLES
362
+ $ ops login
363
+ $ ops login --servicePrincipal -c {client id} -s {secret}
364
+ ```
365
+
366
+ ## `ops npm:check-publish`
367
+
368
+ check if npm packages were published
369
+
370
+ ```
371
+ USAGE
372
+ $ ops npm:check-publish [options]
373
+
374
+ OPTIONS
375
+ -p, --package=package package name filter you want to check
376
+ -v, --version=version (required) version we want to check if published
377
+ -x, --exclude=exclude exclude packages from filter
378
+ --pat=pat PAT token or AZURE_DEVOPS_EXT_PAT environment variable
379
+
380
+ EXAMPLES
381
+ $ ops npm:check-publish -v 6.0.1
382
+ $ ops npm:check-publish -p @adinsure/* -v 6.0.0
383
+ $ ops npm:check-publish -p @adinsure/* -x @adisure/demo -v 6.0.0
384
+ ```
385
+
386
+ ## `ops npm:publish`
387
+
388
+ publish npm packages
389
+
390
+ ```
391
+ USAGE
392
+ $ ops npm:publish [options]
393
+
394
+ OPTIONS
395
+ -p, --package=package package name filter you want to check
396
+ -v, --version=version (required) version we want to check if published
397
+ -x, --exclude=exclude exclude packages from filter
398
+ --pat=pat PAT token or AZURE_DEVOPS_EXT_PAT environment variable
399
+
400
+ EXAMPLES
401
+ $ ops npm:publish -v 15.0.0
402
+ $ ops npm:publish -v 15.0.0
403
+ $ ops npm:publish -p @adinsure-tooling/* -v 15.0.0
404
+ $ ops npm:publish -p @adinsure-tooling/* -x @adisure-tooling/studio-services -v 6.0.0
405
+ ```
406
+
407
+ ## `ops prepare-content -d <destination> -s [source]`
408
+
409
+ creates a directory/file structure from `/source` to `/destination</source>` as defined in the `.opsprepare` file. Actual
410
+ destination path for each file will be specified destination path with appended relative path from working directory where command is executed to specified source directory or current directory (if source is not specified). Be careful about using
411
+ `..` notation in target and source paths as it may lead to unpredictable results due to relative path resolving.
412
+
413
+ > Introduced in version 3.1.0.
414
+
415
+ ```
416
+ USAGE
417
+ $ ops prepare-content -d <destination> -s [source]
418
+
419
+
420
+ OPTIONS
421
+ -d, --destination=destination path to target directory
422
+ -s, --source=source optional path to source directory containing .opsprepare file, (default: current directory)
423
+
424
+ EXAMPLES
425
+ $ ops prepare-content -d ./target_directory/
426
+ copies everything defined in .opsprepare
427
+ from current directory
428
+ to ./target_directory
429
+
430
+ $ ops prepare-content -d ./target_directory/ -s ./source_directory
431
+ copies everything defined in ./source_directory/.opsprepare
432
+ from ./source_directory/
433
+ to ./target_directory/source_directory
434
+
435
+ $ ops prepare-content -d C:\git\target_directory
436
+ copies everything defined in .opsprepare
437
+ from current directory
438
+ to C:\git\target_directory
439
+
440
+ $ ops prepare-content -d C:\git\target_directory -s C:\git\subfolder\subfolder
441
+ when executed in c:\git it copies everything defined in C:\git\subfolder\subfolder\.opsprepare
442
+ from C:\git\subfolder\subfolder
443
+ to C:\git\target_directory\subfolder\subfolder
444
+ ```
445
+
446
+ ### .opsprepare dotfile
447
+
448
+ The prepare-content command uses `.opsprepare` dotfile as instruction set for content preparation.
449
+ The syntax resembles that of `.gitignore` but differs in how it functions and doesn't support advanced
450
+ pattern matching.
451
+
452
+ Following operations/transformations are currently supported:
453
+
454
+ - Copy: copies the file/directory from source path to destination path with same name
455
+ - Transform: transform source file to destination file with same name
456
+ - Removal: remove file/directory (based on source path) from destination path
457
+
458
+ Before diving into the actual syntax and supported tokens let's look at an example
459
+ of how using `ops prepare-content` creates a target directory structure with files
460
+ based on the specified `.opsprepare` file residing in source directory.
461
+
462
+ This is the example source directory structure:
463
+
464
+ ```
465
+ src_data
466
+ ├── .opsprepare
467
+ ├── README.tpl
468
+ ├── bin
469
+ │   ├── ops.sh
470
+ │   └── run
471
+ │   └── ops
472
+ ├── dist
473
+ │   └── server
474
+ │   └── main.cs
475
+ ├── src
476
+ │   ├── commands
477
+ │   │   ├── prepare.ts
478
+ │   │   └── version.ts
479
+ │   ├── config.ts
480
+ │   └── main.ts
481
+ └── transform
482
+ └── render-tpl.js
483
+ ```
484
+
485
+ Contents of `.opsprepare` file in the `src_data` directory:
486
+
487
+ ```
488
+ # Comment
489
+ src
490
+ dist/server
491
+ !src/commands
492
+ !src/config.ts
493
+ src/config.ts {cp:/src/configuration.ts}
494
+ # Another comment
495
+ !bin/run
496
+ README.md {js:/transform/render-tpl.js:render}
497
+ README.tpl {cp:/README.tpl.src}
498
+ ```
499
+
500
+ Running `ops -s src_data -d dst_data` with `src_data/.opsprepare` containing above content
501
+ results in:
502
+
503
+ ```sh
504
+ dst_data
505
+ └── src_data
506
+ ├── README.md
507
+ ├── README.tpl.src
508
+ ├── dist
509
+ │   └── server
510
+ │   └── main.cs
511
+ └── src
512
+ ├── main.ts
513
+ └── src
514
+ └── configuration.ts
515
+ ```
516
+
517
+ What actually happened:
518
+
519
+ 1. First note that all data was copied into `dst_data/src_data` because `.opsprepare` files relative
520
+ location to `ops` execution directiory is `src_data`.
521
+ 2. `src` directory was copied recursively to destination
522
+ 3. `dist/server` directory was copied recursively including its full path path relative to `src_data`
523
+ 4. `src/config.ts` file was transformed (copied) to `src/configuration.ts` in the destination
524
+ 5. `README.md` file was created at the destination as a result of JavaScript based transformation
525
+ 6. `README.tpl` file was transformed (copied) to `README.tpl.src` in the destination
526
+ 7. `src/commands` directory was removed from destination
527
+ 8. `src/config.ts` file was removed from destination
528
+ 9. `bin/run` directory was removed from destination
529
+
530
+ Note that copying and explicit transformations are performed before any removal operations.
531
+
532
+ #### Comments
533
+
534
+ Any line prefixed by `#` is considered a comment and will not result in any file/directory operation.
535
+ #### Copy operations
536
+
537
+ Any file/directory not prefixed by `!` or `#` having explicit transformation defined in `{...}` after
538
+ its name will be copied to the destination with it's full path relative to `ops` execution directory
539
+ to the target directory.
540
+
541
+ #### Transformation operations
542
+
543
+ Transformation operations are always specified using curly braces following the source file name. Base
544
+ syntax looks like this:
545
+
546
+ ```
547
+ {<transformation type>:<transformation parameters>}
548
+ ```
549
+
550
+ Two types of transformation operations are supported:
551
+
552
+ - cp: copy transformation which supports renaming of the source file at the destination
553
+ - js: JavasSript based transformation which results in the file containing string returned by the
554
+ transformation function contained in transformation module.
555
+
556
+ **cp - copy transformation syntax**
557
+
558
+ ```
559
+ {cp:<destination path>}
560
+
561
+ Examples:
562
+ {cp:/dst/newfilename}
563
+ {cp:dst/newfilenames}
564
+ ```
565
+
566
+ Copy transformation is supported for both files and directories. Source file or directory will be
567
+ copied to the destination path with its new name. The destination will always be relative to the
568
+ destination path of entire `prepare-content` operation therefore paths in the transformation block
569
+ can start with or without the `/` character but using makes the syntax more readable.
570
+
571
+ **js - JavaScript transformation syntax**
572
+
573
+ ```
574
+ {js:<transformation_module_path>:<transformation_function_name>}
575
+
576
+ Example:
577
+ {js:/transformations/templateRenderer.js:renderEjsTemplate}
578
+ ```
579
+
580
+ JavaScript transformation is supported only for files, not directories.
581
+
582
+ Transformation module path should be relative to `.opsprepare` file but can start with `/` character
583
+ for better readability. It can export multiple functions though only one can be used in single
584
+ transformation specification.
585
+
586
+ Transformation function that is defined in the transformation module will be called with a single
587
+ parameter - absolute path of the source file.
588
+
589
+ Transformation function MUST return a string. This string will become the content of the file on
590
+ destination.
591
+
592
+ Destination file will be created with the same name as source file and content returned by the
593
+ transformation function. The existence of actual source file will not be validated by the
594
+ `prepare-content` operation (warning is shown if it doesn't exist), such validation is responsibility
595
+ of the transformation function if required.
596
+
597
+ Example transformation module `transform.js` with exported function called transform:
598
+
599
+ ```js
600
+ module.exports = {
601
+ render: (path) => {
602
+ /*
603
+ Some transformation happens in here and it's result which is
604
+ a string is assigned to result variable which is returned.
605
+ */
606
+ return result;
607
+ }
608
+ }
609
+ ```
610
+
611
+ #### Removal operations
612
+
613
+ Any file/directory prefixed by `!` will be removed from the destination based on it's full path
614
+ relative from `ops` execution directory to source file/directory path.
615
+ ## `ops version <type>`
616
+
617
+ creates everything necessary for the new release
618
+
619
+ ```
620
+ USAGE
621
+ $ ops version <type> [flags]
622
+
623
+ ARGUMENTS
624
+ TYPE (patch|minor|major|prerelease|preminor|premajor|new) Type of release
625
+
626
+ OPTIONS
627
+ -i, --independent increment npm packages independent of VERSION file
628
+ -v, --version=version force version
629
+ --no-deps skip dependency update
630
+ --no-script skip creation of script
631
+ --only-npm-packages=only-npm-packages [default: .*] regular expression for which NPM packages to include
632
+ --script-prefix=script-prefix [default: 7.10] prefix for db script version creation.
633
+ --exclude-dir exclude directories where to search for package.json
634
+
635
+ EXAMPLES
636
+ $ ops version minor
637
+ $ ops version new-version -v 3.4.0
638
+ $ ops version new-version -v 3.2.1 --script-prefix 7.10
639
+ $ ops version patch --no-deps
640
+ $ ops version patch --no-script
641
+ $ ops version new -v 3.2.1 --only-npm-packages "@adinsure/"
642
+ ```
643
+
644
+ * *prerelease* is generated from YearMonth incremental number (example: 201909.1) or RC (example: rc.0). prereleases generated in same month will have only last number incremented and first prerelease generated in next month will bump first number and start with 0 (example: 201910.0)
645
+
646
+ * *patch* increments third number and prerelease number is ommited. (example: 3.4.0-201909.2 -> 3.4.0 and 3.3.11 -> 3.3.12)
647
+
648
+ * *preminor* increments for prerelease in second number (example: 3.2.3 -> 3.3.0-201910.0)
649
+
650
+ * *minor* increments second number (example: 3.4.3 -> 3.5.0)
651
+
652
+ * *premajor* increments to prerelease in first number (example: 3.4.3 -> 4.0.0-201911.0)
653
+
654
+ * *major* increments first number (example: 3.4.5 -> 4.0.0)
655
+
656
+ * *new-version* allows setting own version regardles of VERSION file. **Incrementing NPM version separately is not supported in this case. NPM packages are also bumped to specified version.**
657
+
658
+ > Prerelease Note: Prerelease should only be user in **master** branch.
659
+
660
+ > Patch Note: Patch is used on **release/x.x** branches for creating patch releases
661
+
662
+ > When creating new **release/x.x** branch 2 steps are needed:
663
+ > * creating *patch* version on **release/x.x** branch
664
+ > * creating *preminor* or *premajor* version on **master** branch
665
+
666
+ > Dependencies for packages are updated on all package.json files. If prerelease version in specified full version is specified (example: 4.0.0-201911.0), or if non prerelease version ends with x (example: 3.5.x)
667
+
668
+ > NPM packages node: For npm package to update properly *wsrun-version* preset needs to be in *scripts* portion of *package.json*. (example: `"wsrun-version": "yarn wsrun -p @adinsure-tools/* -p @adinsure/* -c"`)
669
+
670
+ ## `ops sql <type> <module> [flags]`
671
+
672
+ creates a new database script
673
+
674
+ ```
675
+ USAGE
676
+ $ ops sql <type> <module> [flags]
677
+
678
+ ARGUMENTS
679
+ TYPE (schema|data|migration) Type of database scripts
680
+ MODULE (acc|claims|core|pas|reins|shared) Module of data database scripts
681
+
682
+ OPTIONS
683
+ -l, --layer=layer name of the configuration layer for which you are generating database script
684
+ -v, --version=version version for which you're generating database script
685
+
686
+ EXAMPLES
687
+ $ ops sql schema
688
+ $ ops sql data shared --layer basic
689
+ ```
690
+
691
+ ## `ops translate`
692
+
693
+ downloads translate from AdDictionary service
694
+
695
+ ```
696
+ USAGE
697
+ $ ops translate <language> [flags]
698
+
699
+ ARGUMENTS
700
+ LANGUAGE language id you want to download. Values must be semi-colon (;) separated.
701
+
702
+ OPTIONS
703
+ -f, --format=json|xml (required) translations format [xml - server translations, json - client translations]
704
+ -m, --module=module module name you want to download. Values must be semi-colon (;) separated.
705
+ -o, --output=output [default: .] absolute or relative destination path to a folder where translations are extracted.
706
+ --filename=filename specify filename of output (XML only).
707
+ --respectServerFilename respect filename that is returned from AdDictionary server (XML only).
708
+
709
+ EXAMPLES
710
+ $ ops translate "en-US=en-US;ru-Ru=ru-RU" -f json -m "Client business accounting;Client business base;"
711
+ $ ops translate "en-US=en-US;ru-Ru=ru-RU" -f xml -o translationDestination
712
+ ```
713
+
714
+ ## `ops update`
715
+
716
+ update the ops CLI
717
+
718
+ ```
719
+ USAGE
720
+ $ ops update [CHANNEL]
721
+
722
+ OPTIONS
723
+ --from-local interactively choose an already installed version
724
+ ```
725
+