Fairoj: Production environmnet setup
This commit is contained in:
parent
7438fdd57f
commit
a720dc4c2c
@ -1 +1 @@
|
||||
{"version":3,"sources":["../../@angular/common/http (ignored)"],"names":[],"mappings":";;;;;AAAA,e","file":"0.js","sourcesContent":["/* (ignored) */\n\n\n//////////////////\n// WEBPACK FOOTER\n// @angular/common/http (ignored)\n// module id = 717\n// module chunks = 0"],"sourceRoot":""}
|
||||
{"version":3,"sources":["../../@angular/common/http (ignored)"],"names":[],"mappings":";;;;;AAAA,e","file":"0.js","sourcesContent":["/* (ignored) */\n\n\n//////////////////\n// WEBPACK FOOTER\n// @angular/common/http (ignored)\n// module id = 718\n// module chunks = 0"],"sourceRoot":""}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
35
config/webpack.config.js
Normal file
35
config/webpack.config.js
Normal file
@ -0,0 +1,35 @@
|
||||
var chalk = require("chalk");
|
||||
var fs = require('fs');
|
||||
var path = require('path');
|
||||
var useDefaultConfig = require('@ionic/app-scripts/config/webpack.config.js');
|
||||
|
||||
var env = process.env.IONIC_ENV;
|
||||
|
||||
useDefaultConfig.prod.resolve.alias = {
|
||||
"@app/env": path.resolve(environmentPath('prod'))
|
||||
};
|
||||
|
||||
useDefaultConfig.dev.resolve.alias = {
|
||||
"@app/env": path.resolve(environmentPath('dev'))
|
||||
};
|
||||
|
||||
if (env !== 'prod' && env !== 'dev') {
|
||||
// Default to dev config
|
||||
useDefaultConfig[env] = useDefaultConfig.dev;
|
||||
useDefaultConfig[env].resolve.alias = {
|
||||
"@app/env": path.resolve(environmentPath(env))
|
||||
};
|
||||
}
|
||||
|
||||
function environmentPath(env) {
|
||||
var filePath = './src/environments/environment' + (env === 'prod' ? '' : '.' + env) + '.ts';
|
||||
if (!fs.existsSync(filePath)) {
|
||||
console.log(chalk.red('\n' + filePath + ' does not exist!'));
|
||||
} else {
|
||||
return filePath;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = function () {
|
||||
return useDefaultConfig;
|
||||
};
|
||||
@ -1,5 +1,5 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<manifest android:hardwareAccelerated="true" android:versionCode="10" android:versionName="0.0.10" package="com.sineedge.pdgenie" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<manifest android:hardwareAccelerated="true" android:versionCode="11" android:versionName="0.0.11" package="com.sineedge.pdgenie" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<application android:hardwareAccelerated="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsRtl="true">
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,5 +1,5 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<widget id="com.sineedge.pdgenie" version="0.0.10" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
|
||||
<widget id="com.sineedge.pdgenie" version="0.0.11" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
|
||||
<feature name="ActionSheet">
|
||||
<param name="android-package" value="nl.xservices.plugins.actionsheet.ActionSheet" />
|
||||
</feature>
|
||||
|
||||
@ -139,7 +139,7 @@ import {Push} from '@ionic-native/push'
|
||||
import {AppVersion} from '@ionic-native/app-version'
|
||||
// import { OfficerNotesModalPageModule } from '../pages/officer-notes-modal/officer-notes-modal.module';
|
||||
import { OfficerNotesModalPage } from '../pages/officer-notes-modal/officer-notes-modal';
|
||||
import {ComponentsQueriesDocsComponent} from '../components/components-queries-docs/components-queries-docs'
|
||||
|
||||
import { QueriesDocsPage } from '../pages/queries-docs/queries-docs';
|
||||
|
||||
@NgModule({
|
||||
@ -201,7 +201,7 @@ import { QueriesDocsPage } from '../pages/queries-docs/queries-docs';
|
||||
FormCompleteCheckModalPage,
|
||||
OfficerNotesModalPage,
|
||||
// PipesModule,
|
||||
ComponentsQueriesDocsComponent,
|
||||
|
||||
QueriesDocsPage
|
||||
|
||||
],
|
||||
@ -302,7 +302,7 @@ import { QueriesDocsPage } from '../pages/queries-docs/queries-docs';
|
||||
MapAddressPage,
|
||||
FormCompleteCheckModalPage,
|
||||
OfficerNotesModalPage,
|
||||
ComponentsQueriesDocsComponent,
|
||||
|
||||
QueriesDocsPage
|
||||
|
||||
|
||||
|
||||
@ -1,35 +0,0 @@
|
||||
<!-- Generated template for the ComponentsQueriesDocsComponent component -->
|
||||
<div [formGroup]="docsCollectedForm">
|
||||
<mat-card *ngIf="queries_docs_array.queries.length !=0">
|
||||
<mat-card-header>
|
||||
<mat-card-title>
|
||||
<h5>Credit Manager’s Specific Queries</h5>
|
||||
</mat-card-title>
|
||||
</mat-card-header>
|
||||
<mat-card-content>
|
||||
|
||||
<div *ngFor="let item of queries_docs_array.queries">
|
||||
<mat-form-field>
|
||||
<input matInput type="text" [formControlName]="item.add_req_id" [placeholder]="item.add_requirement">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
<!-- <mat-card *ngIf="queries_docs_array.docs.length !=0">
|
||||
<mat-card-header>
|
||||
<mat-card-title>
|
||||
<h5>Documents to be collected</h5>
|
||||
</mat-card-title>
|
||||
</mat-card-header>
|
||||
<mat-card-content>
|
||||
|
||||
<div *ngFor="let item of array">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput type="text" [formControlName]="item.add_req_id" [placeholder]="add_requirement">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
</mat-card-content>
|
||||
</mat-card> -->
|
||||
</div>
|
||||
@ -1,3 +0,0 @@
|
||||
components-queries-docs {
|
||||
|
||||
}
|
||||
@ -1,30 +0,0 @@
|
||||
import { Component,Input } from '@angular/core';
|
||||
import { FormGroup, FormControl, Validators } from '@angular/forms';
|
||||
|
||||
/**
|
||||
* Generated class for the ComponentsQueriesDocsComponent component.
|
||||
*
|
||||
* See https://angular.io/api/core/Component for more info on Angular
|
||||
* Components.
|
||||
*/
|
||||
@Component({
|
||||
selector: 'components-queries-docs',
|
||||
templateUrl: 'components-queries-docs.html'
|
||||
})
|
||||
export class ComponentsQueriesDocsComponent {
|
||||
@Input () queries_doc_data
|
||||
text: string;
|
||||
docsCollectedForm:FormGroup
|
||||
|
||||
constructor() {
|
||||
console.log('Hello ComponentsQueriesDocsComponent Component');
|
||||
this.text = 'Hello World';
|
||||
console.log("Component",this.queries_doc_data);
|
||||
if(this.queries_doc_data.queries.length != 0){
|
||||
this.queries_doc_data.queries.forEach(res=>{
|
||||
this.docsCollectedForm.addControl(res.add_req_id,new FormControl(Validators.compose([Validators.required])));
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,8 +0,0 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { ComponentsQueriesDocsComponent } from './components-queries-docs/components-queries-docs';
|
||||
@NgModule({
|
||||
declarations: [ComponentsQueriesDocsComponent],
|
||||
imports: [],
|
||||
exports: [ComponentsQueriesDocsComponent]
|
||||
})
|
||||
export class ComponentsModule {}
|
||||
@ -1,4 +1,4 @@
|
||||
export var environment = { //THIS IS FOR DEFAULT VALUES
|
||||
export const ENV = { //THIS IS FOR DEFAULT VALUES
|
||||
BASE_URL:'https://ssa.sineedge.com/sparqapi/api/',
|
||||
someVar:'someVal'
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
|
||||
export var environment = { //THIS IS FOR DEFAULT VALUES
|
||||
export const ENV = { //THIS IS FOR DEFAULT VALUES
|
||||
BASE_URL:'https://ssa.sineedge.com/sparqtest/api/',
|
||||
someVar:'someVal'
|
||||
|
||||
|
||||
@ -1,13 +0,0 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { IonicPageModule } from 'ionic-angular';
|
||||
import { QueriesDocsPage } from './queries-docs';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
QueriesDocsPage,
|
||||
],
|
||||
imports: [
|
||||
IonicPageModule.forChild(QueriesDocsPage),
|
||||
],
|
||||
})
|
||||
export class QueriesDocsPageModule {}
|
||||
@ -16,7 +16,7 @@ import { LoadingProvider } from '../../providers/common-provider/loading';
|
||||
* Ionic pages and navigation.
|
||||
*/
|
||||
|
||||
@IonicPage()
|
||||
// @IonicPage()
|
||||
@Component({
|
||||
selector: 'page-queries-docs',
|
||||
templateUrl: 'queries-docs.html',
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Injectable, Injector } from '@angular/core';
|
||||
import {
|
||||
HttpRequest,
|
||||
HttpHandler,
|
||||
@ -8,6 +8,7 @@ import {
|
||||
} from '@angular/common/http';
|
||||
// import { AuthGuard } from './auth.guard';
|
||||
import { Observable, of} from 'rxjs';
|
||||
import 'rxjs/add/operator/mergeMap'
|
||||
|
||||
// import { Router } from '@angular/router';
|
||||
|
||||
@ -15,40 +16,75 @@ import { catchError, map, tap } from 'rxjs/operators';
|
||||
import { HttpErrorResponse } from "@angular/common/http";
|
||||
|
||||
import { CognitoServiceProvider } from '../aws-service/cognito.service';
|
||||
|
||||
import {ConstantsProvider} from '../constants/constants'
|
||||
@Injectable()
|
||||
export class TokenInterceptor implements HttpInterceptor{
|
||||
constructor(public shared:CognitoServiceProvider ) {
|
||||
constructor(private injector:Injector ) {
|
||||
|
||||
}
|
||||
intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
|
||||
let env:any
|
||||
const constantProvider=this.injector.get(ConstantsProvider)
|
||||
env=constantProvider.environment()
|
||||
// console.log("authorization",env)
|
||||
return Observable.create((observer: any) => {
|
||||
setTimeout(() => {
|
||||
const authService = this.injector.get(CognitoServiceProvider)
|
||||
observer.next(authService.getToken())
|
||||
observer.complete()
|
||||
// console.log("token",authService.getToken())
|
||||
})
|
||||
})
|
||||
.mergeMap((token: any) => {
|
||||
let authReq = request
|
||||
|
||||
if (token) {
|
||||
|
||||
token=token.idToken.jwtToken
|
||||
// console.log("authorization",token)
|
||||
env=env.authorization
|
||||
// console.log("Sparq",env)
|
||||
authReq = request.clone({
|
||||
setHeaders: {
|
||||
'Authorization': env,
|
||||
'Token':token,
|
||||
'From':'1',
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
return next.handle(authReq).pipe(
|
||||
catchError(this.handleError<any>('role', []))
|
||||
)
|
||||
})
|
||||
|
||||
// request = request.clone({
|
||||
// setHeaders: {
|
||||
// Authorization: `${this.auth.getToken()}`
|
||||
// }
|
||||
// });
|
||||
let token:any;
|
||||
this.shared.refresh();
|
||||
token = this.shared.getToken() || null;
|
||||
// let token:any;
|
||||
// this.shared.refresh();
|
||||
// token = this.shared.getToken() || null;
|
||||
|
||||
token = token.getIdToken().getJwtToken();
|
||||
// token = token.getIdToken().getJwtToken();
|
||||
|
||||
//console.log(token);
|
||||
let requests = request.clone({
|
||||
headers:new HttpHeaders({
|
||||
// let requests = request.clone({
|
||||
// headers:new HttpHeaders({
|
||||
|
||||
'Authorization': 'sparqvenba2018',
|
||||
'Token':token,
|
||||
'From':'1',
|
||||
// 'Authorization': 'sparqvenba2018',
|
||||
// 'Token':'',
|
||||
// 'From':'1',
|
||||
|
||||
|
||||
})
|
||||
// })
|
||||
|
||||
});
|
||||
// });
|
||||
|
||||
return next.handle(requests).pipe(
|
||||
catchError(this.handleError<any>('role', []))
|
||||
)
|
||||
// return next.handle(requests).pipe(
|
||||
// catchError(this.handleError<any>('role', []))
|
||||
// )
|
||||
}
|
||||
|
||||
private handleError<T> (operation = 'operation', result?: T) {
|
||||
|
||||
@ -27,7 +27,8 @@ const vendor_poolData = {
|
||||
}
|
||||
// const sineedgeUserPool = new CognitoUserPool(sineedge_poolData);
|
||||
const lenderUserPool = new CognitoUserPool(lender_poolData);
|
||||
const sineedgedevUserpool = new CognitoUserPool(sineedgedev_poolData);
|
||||
// const sineedgedevUserpool = new CognitoUserPool(sineedgedev_poolData);
|
||||
|
||||
|
||||
/**
|
||||
* Identity PoolID
|
||||
@ -37,13 +38,20 @@ const lenderIdentity = "ap-south-1:ca22dabc-db59-4af5-9bb8-265f7ec95907";
|
||||
const vendorIdenttiy = "ap-south-1:5ad3ce43-4260-4273-87b2-e6a377b8e874";
|
||||
|
||||
const currentDate = new Date().toJSON().slice(0,19).replace('T',' ');
|
||||
|
||||
let sineedgedevUserpool
|
||||
|
||||
@Injectable()
|
||||
export class AwsServiceProvider {
|
||||
apiurl:any;
|
||||
constructor(public http:HttpClient,public shared:CognitoServiceProvider,public con:ConstantsProvider) {
|
||||
this.apiurl = con.apiurl();
|
||||
this.apiurl = con.environment();
|
||||
// console.log("api",this.apiurl);
|
||||
// this.apiurl=this.apiurl.url
|
||||
const sineedgePoolData={
|
||||
UserPoolId: this.apiurl.userPoolId, // UserName :SPARQ_SINEEDGE_DEV
|
||||
ClientId: this.apiurl.clientId // ClientName: SINEEDGE_DEV_WEB
|
||||
}
|
||||
sineedgedevUserpool=new CognitoUserPool(sineedgePoolData)
|
||||
}
|
||||
|
||||
dologin(authenticationData) {
|
||||
@ -183,7 +191,7 @@ apiurl:any;
|
||||
|
||||
|
||||
// let request = new RequestOptions({headers:headers});
|
||||
return this.http.post(this.apiurl+'getUsersDetails',roles);
|
||||
return this.http.post(this.apiurl.url+'getUsersDetails',roles);
|
||||
|
||||
}
|
||||
|
||||
@ -194,6 +202,6 @@ apiurl:any;
|
||||
let formdata = new FormData();
|
||||
|
||||
formdata.append('records',JSON.stringify(records));
|
||||
return this.http.post(this.apiurl+'updateExistUser',formdata);
|
||||
return this.http.post(this.apiurl.url+'updateExistUser',formdata);
|
||||
}
|
||||
}
|
||||
|
||||
@ -12,6 +12,7 @@ import {
|
||||
// import { environment } from '../../environments/environment';
|
||||
|
||||
import { BehaviorSubject,Observable,of } from 'rxjs';
|
||||
import { ConstantsProvider } from '../constants/constants';
|
||||
|
||||
const sineedge_poolData = {
|
||||
UserPoolId: "ap-south-1_y7dt3iEaX", //ap-south-1_qQ85yQZJO UserName :SPARQ_SINEEDGE_DEV
|
||||
@ -31,7 +32,7 @@ const vendor_poolData = {
|
||||
}
|
||||
const sineedgeUserPool = new CognitoUserPool(sineedge_poolData);
|
||||
const lenderUserPool = new CognitoUserPool(lender_poolData);
|
||||
const sineedgedevUserpool = new CognitoUserPool(sineedgedev_poolData);
|
||||
// const sineedgedevUserpool = new CognitoUserPool(sineedgedev_poolData);
|
||||
|
||||
/**
|
||||
* Identity PoolID
|
||||
@ -42,11 +43,12 @@ const vendorIdenttiy = "";
|
||||
// serviceProvider
|
||||
const apiurl = "http://ssa.sineedge.com/sparqapi/api/";
|
||||
// const apiurl = "http://localhost/sparqapi/api/";
|
||||
|
||||
let sineedgedevUserpool
|
||||
@Injectable()
|
||||
|
||||
export class CognitoServiceProvider {
|
||||
public loggedIn :boolean = false;
|
||||
public getenv:any;
|
||||
// public static _REGION = environment.region;
|
||||
|
||||
// public static _IDENTITY_POOL_ID = environment.identityPoolId;
|
||||
@ -66,7 +68,14 @@ isloggin:boolean = false;
|
||||
|
||||
|
||||
|
||||
constructor() {
|
||||
constructor(private constantProvider:ConstantsProvider) {
|
||||
this.getenv=this.constantProvider.environment()
|
||||
// console.log("cognito",this.getenv);
|
||||
const sinnedgePoolData = {
|
||||
UserPoolId: this.getenv.userPoolId, // UserName :SPARQ_SINEEDGE_DEV
|
||||
ClientId: this.getenv.clientId // ClientName: SINEEDGE_DEV_WEB
|
||||
}
|
||||
sineedgedevUserpool = new CognitoUserPool(sinnedgePoolData);
|
||||
|
||||
}
|
||||
getCurrentUser() {
|
||||
|
||||
@ -19,17 +19,50 @@ public commonimage = "http://pdgenie.com/logo/avatar.jpg";
|
||||
console.log('Hello ConstantsProvider Provider');
|
||||
}
|
||||
|
||||
apiurl()
|
||||
environment()
|
||||
{
|
||||
// let testapiurl = 'https://ssa.sineedge.com/sparqtest/api/';
|
||||
// let testapiurl_beta='http://ssa.sineedge.com/sparqtest_beta/api/';
|
||||
// let devapiurl_beta = 'http://ssa.sineedge.com/sparqapi_beta/api/';
|
||||
// let devapiurl = 'https://ssa.sineedge.com/sparqapi/api/';
|
||||
let localapiurl = 'http://192.168.0.6:9999/AWSEC2/sparqapi/api/';
|
||||
let sparqprod= 'https://pdgenie.com/sparqprod/'
|
||||
let demo='https://demo.pdgenie.com/sparqtest/api/'
|
||||
let test='https://demo.pdgenie.com/sparqapi/api/'
|
||||
return demo;
|
||||
|
||||
// let localapiurl = 'http://192.168.0.6:9999/AWSEC2/sparqapi/api/';
|
||||
// let sparqprod= 'https://pdgenie.com/sparqprod/'
|
||||
// let demo='https://demo.pdgenie.com/sparqtest/api/'
|
||||
// let test='https://demo.pdgenie.com/sparqapi/api/'
|
||||
// LIVE ENVIRONMENT
|
||||
let production={
|
||||
url:'https://pdgenie.com/sparqprod/api/',
|
||||
authorization:'TnAwuc64pVpcB9xf',
|
||||
login_string: "cognito-idp.ap-south-1.amazonaws.com/ap-south-1_MlTee1O5V",
|
||||
identityPoolId:'ap-south-1:31774418-8384-4fbb-b3e2-b87ce0f26ef1',
|
||||
userPoolId:'ap-south-1_MlTee1O5V', //username
|
||||
clientId:'2tr47e6sqj29opqsemn3lhnpk1' //Client Id for Mobile
|
||||
}
|
||||
// DEVELOPMENT ENVIRONMENT
|
||||
let development={
|
||||
url:'https://demo.pdgenie.com/sparqapi/api/',
|
||||
authorization:'sparqvenba2018',
|
||||
login_string: "cognito-idp.ap-south-1.amazonaws.com/ap-south-1_qQ85yQZJO",
|
||||
|
||||
identityPoolId:'ap-south-1:9a551eab-97cf-4991-b677-2f9bcd058961',
|
||||
userPoolId:'ap-south-1_qQ85yQZJO',
|
||||
clientId:'2o5c3cs9k3als16nqhp3irh8rs'
|
||||
}
|
||||
// TESTING ENVIRONMNET
|
||||
let testing={
|
||||
url:'https://demo.pdgenie.com/sparqtest/api/',
|
||||
authorization:'sparqvenba2018',
|
||||
login_string: "cognito-idp.ap-south-1.amazonaws.com/ap-south-1_qQ85yQZJO",
|
||||
|
||||
identityPoolId:'ap-south-1:9a551eab-97cf-4991-b677-2f9bcd058961',
|
||||
// userPoolId:'ap-south-1_qQ85yQZJO',
|
||||
// clientId:'67b4fnbuols5upms5to8bvqddh' //for web
|
||||
|
||||
userPoolId:'ap-south-1_qQ85yQZJO',
|
||||
clientId:'2o5c3cs9k3als16nqhp3irh8rs' //for mobile
|
||||
}
|
||||
return testing;
|
||||
}
|
||||
|
||||
getcurrentDate()
|
||||
|
||||
@ -16,7 +16,8 @@ import { catchError } from 'rxjs/operators';
|
||||
export class PdtriggerProvider {
|
||||
apiurl:any;
|
||||
constructor(public http: HttpClient,public constants:ConstantsProvider) {
|
||||
this.apiurl = constants.apiurl();
|
||||
this.apiurl = constants.environment();
|
||||
this.apiurl=this.apiurl.url
|
||||
console.log('Hello PdtriggerProvider Provider');
|
||||
}
|
||||
|
||||
|
||||
@ -15,7 +15,9 @@ export class QuestionCategoryProvider {
|
||||
apiurl:any;
|
||||
constructor(public http: HttpClient,public constant:ConstantsProvider,private cache:CacheService) {
|
||||
console.log('Hello QuestionCategoryProvider Provider');
|
||||
this.apiurl = constant.apiurl();
|
||||
this.apiurl = constant.environment();
|
||||
this.apiurl=this.apiurl.url
|
||||
console.log("a",this.apiurl);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user