lms-sync 1.0.2 → 1.0.3

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.
@@ -1189,11 +1189,8 @@ const server = {
1189
1189
  console.log("");
1190
1190
 
1191
1191
  const studentApi = (await api.Student()).data
1192
-
1193
- const sectionsApi = await api.Section()
1194
1192
  const instructorApi = await api.Instructor()
1195
1193
 
1196
-
1197
1194
  const studentSeq = await Students.findAll()
1198
1195
  const courseSeq = await Courses.findAll()
1199
1196
  const campusSeq = await Campuses.findAll()
package/app.js CHANGED
@@ -1,25 +1,30 @@
1
1
  #!/usr/bin/env node
2
- const express = require('express')
3
- const app = express()
4
2
 
5
3
  const sequelizeStart = require('./apiConnections/sequelizeConnection');
6
4
  const apiConnects = require('./apiConnections/apiConnects')
7
- const mappings = require('./apiConnections/mapping')
5
+ const mappings = require('./apiConnections/mapping');
8
6
 
9
7
 
10
8
  async function start(){
11
9
  try {
12
10
 
13
- // return
11
+ const apis = await apiConnects.ApiConnections()
12
+ if(apis){
13
+ console.log('Connected to Apis.');
14
+ console.log(`Api link:`, apis.api.baseURL);
15
+ }
14
16
  const startSequel = await sequelizeStart.getSequelConnection();
15
17
  if (startSequel) {
16
18
  console.log('Connected to Sequelize.');
17
19
  console.log(`Sequelize host:`, startSequel.config.host);
18
- } else {
19
- console.error('Failed to establish database connections. Migrations not started.');
20
+ }
21
+ if(apis && startSequel){
22
+ console.log('Both connections successful. Starting migrations...');
23
+ await mappings.executeAll()
24
+ }
25
+ else {
26
+ console.error('Failed to establish database and api connections. Migrations not started.');
20
27
  }
21
-
22
- await mappings.executeAll()
23
28
  } catch (error) {
24
29
  console.error('error :>> ', error);
25
30
  }
package/login.json ADDED
@@ -0,0 +1,5 @@
1
+ {
2
+ "email": "ictsc@mscmarinduque.edu.ph",
3
+ "password": "MjU8qweXLaFpDnEyfRrbY9",
4
+ "baseURL": "https://lms.api.msc.priisms.online/api"
5
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lms-sync",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Migration App for MSC LMS",
5
5
  "main": "index.js",
6
6
  "scripts": {