@sava-info-systems/api-maker-with-extensions 1.19.0 โ†’ 1.19.2

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/.env CHANGED
@@ -7,7 +7,7 @@ NODE_ENV=production
7
7
 
8
8
  # API Maker admin panel frontend will try to connect to backend on this host.
9
9
  BE_HOST_PORT="http://__ip_address__:38246" # ๐Ÿ‘ˆ http://127.0.0.1:38246 or https://example.com
10
- BE_WS_HOST_PORT="ws://__ip_address__:38245" # ๐Ÿ‘ˆ http://127.0.0.1:38245 or wss://example.com
10
+ BE_WS_HOST_PORT="ws://__ip_address__:38245" # ๐Ÿ‘ˆ ws://127.0.0.1:38245 or wss://example.com
11
11
 
12
12
  # Required environment variables. You can set them in package.json also and remove from here.
13
13
  am__serverName=server1 # To go inside the object in package.json am, you can use "__" double underscore.
package/README.md CHANGED
@@ -4,27 +4,131 @@
4
4
  </a>
5
5
  </div>
6
6
 
7
- <h1 align="center"><a href="https://apimaker.dev">API Makerยฎ</a> + Extensions</h1>
7
+ <h1 align="center"><a href="https://apimaker.dev">API Makerยฎ</a></h1>
8
8
 
9
9
  <h3 align="center">๐Ÿ† World's No.1 backend API generation & development solution. ๐Ÿ†</h3>
10
10
  <hr/>
11
11
 
12
- ๐Ÿ‘‰ This version is API Maker comes with additional extensions which makes software development process even more faster.<br/>
12
+ ๐Ÿ‘‰ API Maker makes backend development super simple.<br/>
13
+ ๐Ÿ‘‰ Provide database connection string & it will generate powerful APIs in just single click for all tables/collections.<br/>
14
+ ๐Ÿšš๏ธ Deliver projects before deadline & robust & secure & easy to maintain.
15
+
16
+ <hr/>
17
+
13
18
  ๐Ÿ‘‰ You will need --extLicenseKey=YOUR_KEY for installation.<br/>
14
19
  ๐Ÿ‘‰ Contact us to buy license of extensions : https://apimaker.dev <br/>
15
20
  ๐Ÿ‘‰ Email address : contact@apimaker.dev <br/>
16
21
 
22
+ ## ๐Ÿš€ Installation Script
17
23
  ```shell
18
24
  # Add your key in below command
19
25
  curl -fsSL https://apimaker.dev/v1/install.sh > install.sh && bash install.sh --version=latest --extLicenseKey=YOUR_KEY
26
+ ```
27
+
28
+ ## ๐Ÿš€ Note for AWS Users
29
+ ```sh
30
+ chmod 400 ~/Desktop/aws_server.pem # Avoid permission error
31
+ ssh -i ~/Desktop/aws_server.pem ubuntu@__server_ip__ # Login into server
32
+ sudo -s # Login to root user.
33
+ # Now you can execute above installation command.
34
+ ```
35
+
36
+ ## โœจ Features
37
+ * [Auto Generated APIs](https://apimaker.dev/auto-generated-apis-from-database)
38
+ * [8 Database Types Support](https://apimaker.dev/database-support)
39
+ * MongoDB
40
+ * MySQL
41
+ * SQL Server
42
+ * Maria DB
43
+ * Oracle DB
44
+ * PostgreSQL
45
+ * Ti DB
46
+ * Percona XtraDB
47
+ * [Custom APIs](https://apimaker.dev/custom-api)
48
+ * [Schedulers](https://apimaker.dev/schedule)
49
+ * [Automatic Caching](https://apimaker.dev/automatic-caching)
50
+ * [WebSocket Notifications](https://apimaker.dev/events-management)
51
+ * [Database Migrations](https://apimaker.dev/database-migrations)
52
+ * [Inbuilt Testing Framework](https://apimaker.dev/inbuilt-testing)
53
+ * [Git Integration & Deployment](https://apimaker.dev/git-deployment)
54
+ * [Developer Accounts](https://apimaker.dev/developer-accounts)
55
+ * [And Many More...](https://apimaker.dev/features)
56
+ <br/>
57
+
58
+
59
+ ## ๐ŸŽฆ Quick Trailer
60
+ <div>
61
+ <a href="https://youtu.be/7CMinfkIDCE">
62
+ <img width="400px" src="https://apimaker.dev/external/npm/api-maker-trailer-thumbnail-2.png" alt="API Maker features quick walkthrough video"/>
63
+ </a>
64
+ </div>
65
+ <br/>
66
+
67
+
68
+ ## ๐Ÿ”— Useful Resources
69
+ * [API Makerยฎ Website](https://apimaker.dev)
70
+ * [Video Tutorials (YouTube)](https://www.youtube.com/@api_maker)
71
+ * [LinkedIn](https://www.linkedin.com/company/api-maker)
72
+ * [Twitter](https://twitter.com/api_maker)
73
+ * [Request Feature | Report Bug](https://github.com/APIMaker-dev/issues/issues)
74
+ <br/>
75
+
76
+ [//]: # (## ๐Ÿ’ก Demo & Installation Automation)
77
+
78
+ [//]: # (* [API Makerยฎ Cloud]&#40;https://cloud.apimaker.dev&#41;)
79
+
80
+ [//]: # ( * Use it for installation automation and demo)
81
+
82
+ [//]: # ( * Single click server creation and destroy)
83
+
84
+ [//]: # ( * Load balancing)
85
+
86
+ [//]: # ( * Automatic SSL management)
20
87
 
88
+ [//]: # ( * One click upgrade/downgrade between API Maker versions)
89
+
90
+ [//]: # ( * Much more...)
91
+
92
+ [//]: # (<br/>)
93
+
94
+
95
+ ## ๐Ÿ‘จโ€๐Ÿฆฐ Default Users
96
+ ```sh
97
+ admin@admin.com | Admin_123456789
98
+ root@root.com | R00t_123456789
99
+ ```
100
+ <br/>
101
+
102
+
103
+ ## ๐Ÿ”— Install API Maker on VPS for DevOps & Pro Developers
104
+ * [API Makerยฎ Detailed Installation Guide](https://docs.apimaker.dev/v1/docs/blog/install-api-maker.html)
105
+
106
+ <br/>
107
+
108
+ ## ๐Ÿ–ฅ๏ธ Minimum Server Requirement
109
+ ```text
110
+ 1 CPU Core
111
+ 1 GB RAM
112
+ 25 GB Storage
21
113
  ```
114
+ <br/>
115
+
116
+ ## `package.json` Configurations In More Detail
117
+ https://docs.apimaker.dev/v1/docs/am-resources/api-maker-configurations.html
118
+ <br/>
119
+ <br/>
120
+
121
+
122
+ ## Release Notes
123
+ https://docs.apimaker.dev/v1/docs/blog/release-notes/release_notes_summary.html
124
+ <br/>
125
+ <br/>
22
126
 
23
127
 
24
128
  ## ๐Ÿ™ Special Thanks To ๐Ÿ™
25
129
  * [SAVA INFO SYSTEMS PRIVATE LIMITED](https://savainfosystems.com)
26
- * API Maker is developed and maintained by SAVA.
130
+ * API Maker is developed and maintained by SAVA Info Systems.
27
131
 
28
132
  <br/>
29
133
  <br/>
30
- <br/>
134
+ <br/>
@@ -7,7 +7,7 @@ NODE_ENV=production
7
7
 
8
8
  # API Maker admin panel frontend will try to connect to backend on this host and "am__port" will be appended automatically.
9
9
  BE_HOST_PORT="http://__ip_address__:38246" # ๐Ÿ‘ˆ http://127.0.0.1:38246 or https://example.com
10
- BE_WS_HOST_PORT="ws://__ip_address__:38245" # ๐Ÿ‘ˆ http://127.0.0.1:38245 or wss://example.com
10
+ BE_WS_HOST_PORT="ws://__ip_address__:38245" # ๐Ÿ‘ˆ ws://127.0.0.1:38245 or wss://example.com
11
11
 
12
12
  # Required environment variables. You can set them in package.json also and remove from here.
13
13
  am__serverName="server1" # To go inside the object in package.json am, you can use "__" double underscore.
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[8447],{8447:(Re,I,n)=>{n.r(I),n.d(I,{ApiUserM:()=>Ee});var x=n(7060),X=n(1709),M=n(2173),e=n(540),S=n(5779),V=n(572),l=n(467),p=n(8727),d=n(5046),U=n(7326),C=n(7376),u=n(6645),_=n(7427),b=n(6129),w=n(6708),O=n(7337),y=n(7237),A=n(1987),F=n(3966),E=n(177),h=n(7645),D=n(7515),R=n(8542),m=n(4341),Y=n(9773),k=n(5312),B=n(9561),L=n(6268),K=n(5203),W=n(3478),J=n(8150),z=n(5430);function Q(r,i){1&r&&(e.j41(0,"span"),e.nrm(1,"i",24),e.EFF(2," Add API User"),e.k0s())}function H(r,i){1&r&&(e.j41(0,"span"),e.nrm(1,"i",25),e.EFF(2," View API User"),e.k0s())}function Z(r,i){1&r&&(e.j41(0,"span"),e.nrm(1,"i",26),e.EFF(2," Edit API User"),e.k0s())}function q(r,i){if(1&r){const t=e.RV6();e.j41(0,"a",30),e.bIt("click",function(){e.eBV(t);const s=e.XpG(2);return e.Njj(s.openSecret())}),e.nrm(1,"i",31),e.EFF(2," Open Secret "),e.k0s()}}function ee(r,i){if(1&r&&(e.j41(0,"div")(1,"div",10)(2,"label",11),e.EFF(3,"Password Path"),e.k0s(),e.j41(4,"div",12),e.nrm(5,"p-dropdown",27),e.k0s(),e.j41(6,"div",28),e.DNE(7,q,3,0,"a",29),e.k0s()()()),2&r){const t=e.XpG();e.R7$(5),e.Y8G("options",t.connectionStringSecrets)("filter",!0),e.R7$(2),e.Y8G("ngIf",t.data.mode!==t.EFormMode.VIEW)}}function te(r,i){1&r&&(e.j41(0,"div",10)(1,"label",11),e.EFF(2,"Password"),e.k0s(),e.j41(3,"div",12),e.nrm(4,"input",32),e.k0s()())}function se(r,i){if(1&r){const t=e.RV6();e.j41(0,"div",10)(1,"label",11),e.EFF(2,"Swagger Token"),e.k0s(),e.j41(3,"div",12),e.nrm(4,"input",33),e.k0s(),e.j41(5,"div",34)(6,"button",35),e.bIt("click",function(){e.eBV(t);const s=e.XpG();return e.Njj(s.generateRandomStringForSwaggerURLPart())}),e.nrm(7,"i",36),e.k0s()()()}}function ae(r,i){if(1&r&&(e.j41(0,"div",10),e.nrm(1,"label",11),e.j41(2,"div",12)(3,"a",37),e.EFF(4,"View Swagger JSON"),e.k0s()()()),2&r){const t=e.XpG();e.R7$(3),e.yjJ("href","",t.environment.BE_HOST_PORT+t.EApiPaths.API+t.EApiPaths.SITES+t.EModelApiPaths.INSTANCE,"/",t.authCS.gUser.apiPath,"/get-swagger-docs/",t.form.getRawValue().swaggerURLRandomPart,"",e.B4B)}}function re(r,i){1&r&&(e.j41(0,"span"),e.EFF(1,"Save User"),e.k0s())}function ne(r,i){1&r&&(e.j41(0,"span"),e.EFF(1,"Update User"),e.k0s())}function ie(r,i){if(1&r){const t=e.RV6();e.j41(0,"button",38),e.bIt("click",function(){e.eBV(t);const s=e.XpG();return e.Njj(s.save())}),e.nrm(1,"i",39),e.DNE(2,re,2,0,"span",4),e.DNE(3,ne,2,0,"span",4),e.k0s()}if(2&r){const t=e.XpG();e.Y8G("disabled",t.form.invalid),e.R7$(2),e.Y8G("ngIf",t.data.mode===t.EFormMode.ADD),e.R7$(1),e.Y8G("ngIf",t.data.mode===t.EFormMode.EDIT)}}function oe(r,i){1&r&&e.nrm(0,"p-progressSpinner",40)}let P=(()=>{class r{fb;ns;apiUserS;generalS;instanceS;eventCenterS;secretS;constantsS;authCS;data;loading={form:!1};EFormMode=d.X;form;subscriptions=[];environment=k.c;connectionStringSecrets=[];constructor(t,a,s,o,c,f,g,v,De){this.fb=t,this.ns=a,this.apiUserS=s,this.generalS=o,this.instanceS=c,this.eventCenterS=f,this.secretS=g,this.constantsS=v,this.authCS=De}ngOnInit(){var t=this;this.createForm(),this.subscriptions.push(this.data.eventChannel.subscribe(function(){var a=(0,l.A)(function*(s){if(s)if(t.form.enable(),yield t.loadConnectionStringFromSecret(),s.action===p.K.OPEN_FORM_IN_EDIT_MODE){const o=yield t.apiUserS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(o.data),t.form.get("password").setValidators([]),t.form.get("password").updateValueAndValidity()}else if(s.action===p.K.OPEN_FORM_IN_VIEW_MODE){const o=yield t.apiUserS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(o.data),t.form.disable()}else s.action===p.K.OPEN_FORM_IN_ADD_MODE&&(t.form.reset(),t.form.get("enablePasswordPath").setValue(!0))});return function(s){return a.apply(this,arguments)}}())),this.subscriptions.push(this.eventCenterS.headerC.dataSecretForm.eventChannel.subscribe(function(){var a=(0,l.A)(function*(s){s&&s.action===p.K.UPDATED&&(t.eventCenterS.headerC.secManFormC.hideModal(),yield t.loadConnectionStringFromSecret())});return function(s){return a.apply(this,arguments)}}()))}createForm(){this.form=this.fb.group({name:[null,[m.k0.required]],username:[null,[m.k0.required]],password:[null,[]],enablePasswordPath:[!1,[]],apiUserPasswordPath:[null,[]],swaggerURLRandomPart:[null,[]],enableSwaggerDocs:[!1,[]]})}showModal(){$("#idApiUsersForm").modal("show")}hideModal(){$("#idApiUsersForm").modal("hide")}openSecret(){var t=this;return(0,l.A)(function*(){t.eventCenterS.headerC.dataSecretForm.formData=yield t.getDefaultSecret(),t.eventCenterS.headerC.dataSecretForm.mode=d.X.EDIT,t.eventCenterS.headerC.dataSecretForm.eventChannel.emit({action:p.K.OPEN_FORM_IN_EDIT_MODE}),t.eventCenterS.headerC.secManFormC.showModal(),t.eventCenterS.headerC.secManFormC.zIndex=1051})()}loadConnectionStringFromSecret(){var t=this;return(0,l.A)(function*(){try{const a=(yield t.instanceS.getConnectionStringSecret().toPromise())?.data;t.connectionStringSecrets=a}catch(a){t.ns.showErrorFromResponse(a.error||a,"Unable to load connection string.")}})()}getDefaultSecret(){var t=this;return(0,l.A)(function*(){const a={find:{user:t.authCS.getUserId(),active:!0,isDefault:!0}};return(yield t.secretS.query(a).toPromise()).data?.[0]})()}save(){var t=this;return(0,l.A)(function*(){const a=t.form.getRawValue();a.user=t.authCS.getUserId();try{let s;if(t.loading.form=!0,t.data.mode===d.X.ADD){if(!a.password&&!a.apiUserPasswordPath)return t.loading.form=!1,t.ns.showError(t.constantsS.apiUser.passwordError);t.processDataBeforeSaveOrUpdate(a),s=yield t.apiUserS.post(a).toPromise()}else t.data.mode===d.X.EDIT&&(a.password||delete a.password,t.processDataBeforeSaveOrUpdate(a),s=yield t.apiUserS.put(t.data.formData._id,a,{select:u.GX._id}).toPromise());t.ns.showSuccess(t.data.mode===d.X.ADD?t.constantsS.apiUser.addSuccess:t.constantsS.apiUser.editSuccess),t.data.eventChannel.emit({action:t.data.mode===d.X.ADD?p.K.SAVED:p.K.UPDATED}),t.loading.form=!1}catch(s){t.loading.form=!1,t.ns.showErrorFromResponse(s.error||s,"Unable to save user info.")}})()}processDataBeforeSaveOrUpdate(t){t.password&&(t.password=this.generalS.getEncryptedString(t.password,k.c.crypto.passCommunication))}generateRandomStringForSwaggerURLPart(){this.form.patchValue({swaggerURLRandomPart:this.generalS.getRandomStringWithCapitals(32)})}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}EApiPaths=Y.ey;EModelApiPaths=B.bd;static \u0275fac=function(a){return new(a||r)(e.rXU(m.ok),e.rXU(w.m),e.rXU(_.N),e.rXU(b.f),e.rXU(L.J),e.rXU(F.d),e.rXU(K.S),e.rXU(A.X),e.rXU(y.l))};static \u0275cmp=e.VBU({type:r,selectors:[["app-w-api-user-form"]],inputs:{data:"data"},decls:42,vars:12,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idApiUsersForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog","modal-lg"],[1,"modal-content"],[1,"modal-header"],[4,"ngIf"],["aria-label","Close","data-dismiss","modal","type","button",1,"close"],["aria-hidden","true"],[1,"fas","fa-window-close"],[1,"modal-body","overflow-auto"],[1,"container","pt-3",3,"formGroup"],[1,"form-group","row"],[1,"col-4","col-form-label","col-form-label-sm","text-right"],[1,"col-6"],["formControlName","name","name","name","spellcheck","false","type","text","placeholder","Please provide name",1,"form-control","form-control-sm"],["formControlName","username","name","username","spellcheck","false","type","text","placeholder","Please provide username",1,"form-control","form-control-sm"],[1,"align-middle","mb-0","pt-1"],["formControlName","enablePasswordPath","label","Enable Password From Secret Path",3,"binary"],["class","form-group row",4,"ngIf"],["formControlName","enableSwaggerDocs","label","Enable Swagger Docs",3,"binary"],[1,"modal-footer"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary"],[1,"fas","fa-times","text-danger","fa-fw"],["class","btn btn-primary btn-sm","sava-no-dbl-click","","type","button",3,"disabled","click",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],[1,"far","fa-eye","text-info","fa-fw","mr-1"],[1,"fas","fa-pencil-alt","text-light","fa-fw","mr-1"],["formControlName","apiUserPasswordPath","optionValue","value","optionLabel","name","filterBy","name","appendTo","body","styleClass","w-100 p-input-filled",3,"options","filter"],[1,"col-2","p-0"],["class","d-block mt-2 text-info","href","javascript:","sava-no-dbl-click","",3,"click",4,"ngIf"],["href","javascript:","sava-no-dbl-click","",1,"d-block","mt-2","text-info",3,"click"],[1,"fas","fa-key","text-danger","fa-fw","mr-1"],["formControlName","password","name","password","spellcheck","false","type","password","placeholder","Please provide password",1,"form-control","form-control-sm"],["formControlName","swaggerURLRandomPart","name","swaggerURLRandomPart","spellcheck","false","type","text","placeholder","Please generate random URL",1,"form-control","form-control-sm"],[1,"col-2","pl-0"],["pTooltip","Generate random swagger token","type","button",1,"btn","btn-sm","btn-outline-info",3,"click"],[1,"fas","fa-star-of-life","text-info","fa-fw"],["target","_blank",3,"href"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"disabled","click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(a,s){1&a&&(e.j41(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.DNE(4,Q,3,0,"span",4),e.DNE(5,H,3,0,"span",4),e.DNE(6,Z,3,0,"span",4),e.j41(7,"button",5)(8,"span",6),e.nrm(9,"i",7),e.k0s()()(),e.j41(10,"div",8)(11,"form",9)(12,"div",10)(13,"label",11),e.EFF(14,"Name"),e.k0s(),e.j41(15,"div",12),e.nrm(16,"input",13),e.k0s()(),e.j41(17,"div",10)(18,"label",11),e.EFF(19,"Username"),e.k0s(),e.j41(20,"div",12),e.nrm(21,"input",14),e.k0s()(),e.j41(22,"div",10),e.nrm(23,"label",11),e.j41(24,"div",12)(25,"label",15),e.nrm(26,"p-checkbox",16),e.k0s()()(),e.DNE(27,ee,8,3,"div",4),e.DNE(28,te,5,0,"div",17),e.j41(29,"div",10),e.nrm(30,"label",11),e.j41(31,"div",12)(32,"label",15),e.nrm(33,"p-checkbox",18),e.k0s()()(),e.DNE(34,se,8,0,"div",17),e.DNE(35,ae,5,3,"div",17),e.k0s()(),e.j41(36,"div",19)(37,"button",20),e.nrm(38,"i",21),e.EFF(39," Close"),e.k0s(),e.DNE(40,ie,4,3,"button",22),e.k0s(),e.DNE(41,oe,1,0,"p-progressSpinner",23),e.k0s()()()),2&a&&(e.R7$(4),e.Y8G("ngIf",s.data.mode===s.EFormMode.ADD),e.R7$(1),e.Y8G("ngIf",s.data.mode===s.EFormMode.VIEW),e.R7$(1),e.Y8G("ngIf",s.data.mode===s.EFormMode.EDIT),e.R7$(5),e.Y8G("formGroup",s.form),e.R7$(15),e.Y8G("binary",!0),e.R7$(1),e.Y8G("ngIf",!0===s.form.get("enablePasswordPath").value),e.R7$(1),e.Y8G("ngIf",s.data.mode!==s.EFormMode.VIEW&&!s.form.get("enablePasswordPath").value),e.R7$(5),e.Y8G("binary",!0),e.R7$(1),e.Y8G("ngIf",s.form.getRawValue().enableSwaggerDocs),e.R7$(1),e.Y8G("ngIf",s.form.getRawValue().enableSwaggerDocs&&s.form.getRawValue().swaggerURLRandomPart),e.R7$(5),e.Y8G("ngIf",s.data.mode!==s.EFormMode.VIEW),e.R7$(1),e.Y8G("ngIf",s.loading.form))},dependencies:[m.qT,m.me,m.BC,m.cb,m.j4,m.JD,E.bT,W.U,D.p,R.m,J.ms,z.Sc],encapsulation:2})}return r})();const le=["apiUserFormC"];function ce(r,i){if(1&r){const t=e.RV6();e.j41(0,"span",17),e.bIt("click",function(){e.eBV(t);const s=e.XpG();return e.Njj(s.edit())}),e.nrm(1,"i",18),e.k0s()}}function pe(r,i){if(1&r){const t=e.RV6();e.j41(0,"span",19),e.bIt("click",function(){e.eBV(t);const s=e.XpG();return e.Njj(s.removePermanentDialog())}),e.nrm(1,"i",20),e.k0s()}}function de(r,i){1&r&&(e.j41(0,"tr")(1,"th"),e.EFF(2,"Name"),e.k0s(),e.j41(3,"th"),e.EFF(4,"Username"),e.k0s()())}function me(r,i){if(1&r&&(e.j41(0,"tr",21)(1,"td"),e.EFF(2),e.k0s(),e.j41(3,"td"),e.EFF(4),e.k0s()()),2&r){const t=i.$implicit;e.Y8G("pSelectableRow",t),e.R7$(2),e.JRh(t.name),e.R7$(2),e.JRh(t.username)}}function fe(r,i){1&r&&e.nrm(0,"p-progressSpinner",22)}let G=(()=>{class r{apiUserS;generalS;notificationS;navigationCS;authCS;constantsS;confirmationService;eventCenterS;loading={grid:!1};subscriptions=[];data={mode:d.X.ADD,eventChannel:new e.bkB,formData:void 0};rows=[];rowsMap={};showAll=!1;selectedRows=[];gridKey=u.GX._id;apiUserFormC;constructor(t,a,s,o,c,f,g,v){this.apiUserS=t,this.generalS=a,this.notificationS=s,this.navigationCS=o,this.authCS=c,this.constantsS=f,this.confirmationService=g,this.eventCenterS=v}ngOnInit(){this.eventCenterS.apiUser.selectedApiUsers.next([]),this.loadGridData(),this.subscriptions.push(this.data.eventChannel.subscribe(t=>{(t.action===p.K.SAVED||t.action===p.K.UPDATED)&&(this.apiUserFormC.hideModal(),this.loadGridData())})),this.generalS.setNewTitle("API Maker - API Users")}loadGridData(){var t=this;this.loading.grid=!0;const a={find:{user:this.authCS.getUserId(),active:!0},select:{name:1,username:1,active:1},sort:{name:1}};this.showAll&&delete a.find.active,this.subscriptions.push(this.apiUserS.query(a).subscribe(function(){var s=(0,l.A)(function*(o){if(o.success&&(t.selectedRows=[],t.rows=o.data,t.rowsMap=C.keyBy(t.rows,u.GX._id),t.rows[0]?._id)){const c=(yield t.apiUserS.getById(t.rows[0]._id).toPromise()).data;c._id&&(yield t.navigationCS.setQueryParam(U.F.api_user,c._id),t.eventCenterS.apiUser.selectedApiUsers.next([c]),t.selectedRows=[c],yield t.fillData())}t.generalS.setNewTitle("API Maker - API Users"),t.loading.grid=!1});return function(o){return s.apply(this,arguments)}}()))}add(){this.data.formData=void 0,this.data.mode=d.X.ADD,this.data.eventChannel.emit({action:p.K.OPEN_FORM_IN_ADD_MODE}),this.apiUserFormC.showModal()}view(){this.data.formData=this.selectedRows[0],this.data.mode=d.X.VIEW,this.data.eventChannel.emit({action:p.K.OPEN_FORM_IN_VIEW_MODE}),this.apiUserFormC.showModal()}edit(){this.data.formData=this.selectedRows[0],this.data.mode=d.X.EDIT,this.data.eventChannel.emit({action:p.K.OPEN_FORM_IN_EDIT_MODE}),this.apiUserFormC.showModal()}removePermanentDialog(){var t=this;return(0,l.A)(function*(){var a;t.confirmationService.confirm({message:t.constantsS.apiUser.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(a=(0,l.A)(function*(){yield t.removePermanent()}),function(){return a.apply(this,arguments)})})})()}removePermanent(){var t=this;return(0,l.A)(function*(){t.loading.grid=!0;const a=yield t.apiUserS.permanentDelete(t.selectedRows[0]._id).toPromise();t.loading.grid=!1,a.success?(t.notificationS.showSuccess(t.constantsS.apiUser.removePermanent),t.resetSelectedRows(),t.loadGridData()):t.notificationS.showErrorFromResponse(a,t.constantsS.apiUser.removePermanentError)})()}resetSelectedRows(){this.selectedRows.length=0,this.eventCenterS.apiUser.selectedApiUsers.next([])}resetDependents(){var t=this;return(0,l.A)(function*(){t.eventCenterS.apiUser.selectedApiUsers.next([]),yield t.navigationCS.setQueryParam(U.F.api_user,null)})()}apiUserSelected(){var t=this;return(0,l.A)(function*(){yield t.resetDependents(),yield t.fillData()})()}fillData(){var t=this;return(0,l.A)(function*(){if(!t.selectedRows.length)return yield t.navigationCS.setQueryParam(U.F.api_user,""),void t.eventCenterS.apiUser.selectedApiUsers.next([]);const a=(yield t.apiUserS.getById(t.selectedRows[0]._id).toPromise()).data;a._id?(yield t.navigationCS.setQueryParam(U.F.api_user,a._id),t.eventCenterS.apiUser.selectedApiUsers.next([a])):t.resetDependents().then()})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}dblClickUsers(){this.selectedRows.length&&this.edit()}static \u0275fac=function(a){return new(a||r)(e.rXU(_.N),e.rXU(b.f),e.rXU(w.m),e.rXU(O.$),e.rXU(y.l),e.rXU(A.X),e.rXU(S.td),e.rXU(F.d))};static \u0275cmp=e.VBU({type:r,selectors:[["app-w-api-users"]],viewQuery:function(a,s){if(1&a&&e.GBs(le,5),2&a){let o;e.mGM(o=e.lsd())&&(s.apiUserFormC=o.first)}},decls:19,vars:10,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],["src","/assets/images/icons/api-user.svg","alt","API Group Permissions",1,"fa-fw","mr-1"],[1,"float-right"],["href","https://docs.apimaker.dev/v1/docs/apis-security/api-user-permission.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-3","mr-1","mt-n1",2,"font-size","25px"],["pTooltip","Add New",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],["class","float-right cursor-pointer ml-3","pTooltip","Edit",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Permanent Delete",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["styleClass","p-datatable-striped","scrollHeight","calc(100vh - 100px)",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"data"],["apiUserFormC",""],["pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["pTooltip","Permanent Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],[3,"pSelectableRow"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(a,s){1&a&&(e.j41(0,"div",0)(1,"div",1)(2,"span"),e.nrm(3,"img",2),e.EFF(4," API Users"),e.k0s(),e.j41(5,"div",3)(6,"a",4),e.nrm(7,"img",5),e.k0s()(),e.j41(8,"span",6),e.bIt("click",function(){return s.add()}),e.nrm(9,"i",7),e.k0s(),e.DNE(10,ce,2,0,"span",8),e.DNE(11,pe,2,0,"span",9),e.k0s(),e.j41(12,"div",10)(13,"p-table",11),e.bIt("selectionChange",function(c){return s.selectedRows=c})("dblclick",function(){return s.dblClickUsers()})("selectionChange",function(){return s.apiUserSelected()}),e.DNE(14,de,5,0,"ng-template",12),e.DNE(15,me,5,3,"ng-template",13),e.k0s(),e.DNE(16,fe,1,0,"p-progressSpinner",14),e.k0s()(),e.nrm(17,"app-w-api-user-form",15,16)),2&a&&(e.R7$(10),e.Y8G("ngIf",s.selectedRows.length),e.R7$(1),e.Y8G("ngIf",s.selectedRows.length),e.R7$(2),e.Y8G("selectionMode","multiple")("metaKeySelection",!0)("selection",s.selectedRows)("dataKey",s.gridKey)("scrollable",!0)("value",s.rows),e.R7$(3),e.Y8G("ngIf",s.loading.grid),e.R7$(1),e.Y8G("data",s.data))},dependencies:[E.bT,h.XI,S.Ei,h.d5,D.p,R.m,P],encapsulation:2})}return r})();var ue=n(152),he=n(4774),ge=n(4752);function ve(r,i){if(1&r){const t=e.RV6();e.j41(0,"span",10),e.bIt("click",function(){e.eBV(t);const s=e.XpG();return e.Njj(s.saveUserPermissions())}),e.nrm(1,"i",11),e.EFF(2," Save"),e.k0s()}}function Se(r,i){1&r&&(e.j41(0,"tr"),e.nrm(1,"th",15),e.j41(2,"th"),e.EFF(3,"Name"),e.k0s()())}function Ue(r,i){if(1&r&&(e.j41(0,"td"),e.nrm(1,"p-tableCheckbox",18),e.k0s()),2&r){const t=e.XpG().$implicit;e.R7$(1),e.Y8G("value",t)("pSelectableRow",t)}}function Ce(r,i){if(1&r&&(e.j41(0,"tr",16),e.DNE(1,Ue,2,2,"td",17),e.j41(2,"td"),e.EFF(3),e.k0s()()),2&r){const t=i.$implicit,a=e.XpG(2);e.Y8G("pSelectableRow",t),e.R7$(1),e.Y8G("ngIf",a.showCheckbox),e.R7$(2),e.JRh(t.name)}}function _e(r,i){if(1&r){const t=e.RV6();e.j41(0,"p-table",12),e.bIt("selectionChange",function(s){e.eBV(t);const o=e.XpG();return e.Njj(o.selectedRows=s)})("selectionChange",function(){e.eBV(t);const s=e.XpG();return e.Njj(s.apiGroupSelected())}),e.DNE(1,Se,4,0,"ng-template",13),e.DNE(2,Ce,4,3,"ng-template",14),e.k0s()}if(2&r){const t=e.XpG();e.Y8G("selectionMode","multiple")("metaKeySelection",!1)("selection",t.selectedRows)("dataKey",t.gridKey)("scrollable",!0)("value",t.rows)}}function be(r,i){1&r&&e.nrm(0,"p-progressSpinner",19)}let T=(()=>{class r{groupS;generalS;notificationS;navigationS;authCS;apiUserS;constantsS;eventCenterS;showCheckbox=!0;loading={grid:!1};subscriptions=[];data={eventChannel:new e.bkB};rows=[];rowsMap={};selectedRows=[];gridKey=u.h3.name;constructor(t,a,s,o,c,f,g,v){this.groupS=t,this.generalS=a,this.notificationS=s,this.navigationS=o,this.authCS=c,this.apiUserS=f,this.constantsS=g,this.eventCenterS=v}ngOnInit(){var t=this;this.eventCenterS.apiUser.selectedGroups.next([]),this.subscriptions.push(this.eventCenterS.apiUser.selectedApiUsers.pipe((0,ue.B)(10)).subscribe(function(){var a=(0,l.A)(function*(s){s.length?yield t.loadGridData():t.resetList()});return function(s){return a.apply(this,arguments)}}()))}loadGridData(){var t=this;return(0,l.A)(function*(){t.loading.grid=!0;const a={find:{user:t.authCS.getUserId(),active:!0},select:{name:1},sort:{name:1}},s=yield t.groupS.query(a).toPromise();if(s.success){t.selectedRows=[],t.rows=s.data,t.rowsMap=C.keyBy(t.rows,"name");const o=t.eventCenterS.apiUser.selectedApiUsers.value[0].groupNames||[],c=[];for(const f of o)t.rowsMap[f]&&c.push(t.rowsMap[f]);t.selectedRows=c,t.eventCenterS.apiUser.selectedGroups.next(C.map(t.selectedRows,"_id"))}t.loading.grid=!1})()}resetList(){var t=this;return(0,l.A)(function*(){t.rows=[],t.rowsMap={},t.selectedRows.length=0,t.eventCenterS.apiUser.selectedGroups.next([])})()}apiGroupSelected(){var t=this;return(0,l.A)(function*(){t.eventCenterS.apiUser.selectedGroups.next(C.map(t.selectedRows,t.gridKey))})()}saveUserPermissions(){var t=this;return(0,l.A)(function*(){const a=JSON.parse(JSON.stringify(t.eventCenterS.apiUser.selectedApiUsers.value[0]));a.user=t.authCS.getUserId(),a.groupNames=t.eventCenterS.apiUser.selectedGroups.value||[],t.loading.grid=!0;const s=yield t.apiUserS.put(a._id,a,{select:u.GX._id}).toPromise();s&&s.success&&t.notificationS.showSuccess("User updated successfully."),t.loading.grid=!1})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(a){return new(a||r)(e.rXU(he.L),e.rXU(b.f),e.rXU(w.m),e.rXU(ge.O),e.rXU(y.l),e.rXU(_.N),e.rXU(A.X),e.rXU(F.d))};static \u0275cmp=e.VBU({type:r,selectors:[["app-w-api-group-list"]],inputs:{showCheckbox:"showCheckbox"},decls:12,vars:3,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],["src","/assets/images/icons/api-group.svg","alt","API Group Permissions",1,"fa-fw","mr-1"],[1,"float-right"],["href","https://docs.apimaker.dev/v1/docs/apis-security/api-group-permission.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-3","mr-1","mt-n1",2,"font-size","25px"],["class","float-right cursor-pointer ml-3","pTooltip","Save",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["styleClass","p-datatable-striped","scrollHeight","flex",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],["pTooltip","Save",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-save","fa-fw","text-success"],["styleClass","p-datatable-striped","scrollHeight","flex",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange"],["pTemplate","header"],["pTemplate","body"],[2,"width","40px"],[3,"pSelectableRow"],[4,"ngIf"],[3,"value","pSelectableRow"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(a,s){1&a&&(e.j41(0,"div",0)(1,"div",1)(2,"span"),e.nrm(3,"img",2),e.EFF(4," Groups"),e.k0s(),e.j41(5,"div",3)(6,"a",4),e.nrm(7,"img",5),e.k0s()(),e.DNE(8,ve,3,0,"span",6),e.k0s(),e.j41(9,"div",7),e.DNE(10,_e,3,6,"p-table",8),e.DNE(11,be,1,0,"p-progressSpinner",9),e.k0s()()),2&a&&(e.R7$(8),e.Y8G("ngIf",s.eventCenterS.apiUser.selectedApiUsers.value.length),e.R7$(2),e.Y8G("ngIf",s.eventCenterS.apiUser.selectedApiUsers.value.length),e.R7$(1),e.Y8G("ngIf",s.loading.grid))},dependencies:[E.bT,h.XI,S.Ei,h.d5,h.S9,D.p,R.m],encapsulation:2})}return r})();function we(r,i){1&r&&(e.j41(0,"div",3),e.nrm(1,"app-w-api-users"),e.k0s())}function ye(r,i){1&r&&(e.j41(0,"div",4),e.nrm(1,"app-w-api-group-list"),e.k0s())}const Ae=function(){return{height:"calc(100% - 100px);"}},j=function(){return[50,50]};const Fe=[{path:"layout",component:(()=>{class r{constructor(){}ngOnInit(){}static \u0275fac=function(a){return new(a||r)};static \u0275cmp=e.VBU({type:r,selectors:[["app-api-user-layout"]],decls:4,vars:7,consts:[[1,"pt-1","pl-1","pr-1"],["styleClass","full-body border-0 shadow-sm mb-5","orientation","horizontal",3,"panelSizes","minSizes"],["pTemplate",""],[1,"col","flex","align-items-center","justify-content-center","pl-0","pr-1"],[1,"col","flex","align-items-center","justify-content-center","pl-1","pr-0"]],template:function(a,s){1&a&&(e.j41(0,"div",0)(1,"p-splitter",1),e.DNE(2,we,2,0,"ng-template",2),e.DNE(3,ye,2,0,"ng-template",2),e.k0s()()),2&a&&(e.R7$(1),e.Aen(e.lJ4(4,Ae)),e.Y8G("panelSizes",e.lJ4(5,j))("minSizes",e.lJ4(6,j)))},dependencies:[S.Ei,V.O,G,T],encapsulation:2})}return r})(),canActivate:[M.Z]}];let Ee=(()=>{class r{static \u0275fac=function(a){return new(a||r)};static \u0275mod=e.$C({type:r});static \u0275inj=e.G2t({imports:[x.iI.forChild(Fe),X.u]})}return r})()}}]);
package/dist/index.html CHANGED
@@ -162,5 +162,5 @@
162
162
  </style>
163
163
  </noscript>
164
164
 
165
- <script src="runtime.f7e0fa10d087fa0b.js" type="module"></script><script src="polyfills.9cbb1c8222a6b6c3.js" type="module"></script><script src="main.ffc8631f3e17b1c3.js" type="module"></script></body>
165
+ <script src="runtime.212fca73d6a42b3a.js" type="module"></script><script src="polyfills.9cbb1c8222a6b6c3.js" type="module"></script><script src="main.1da32156380b46d5.js" type="module"></script></body>
166
166
  </html>