agrs-sequelize-sdk 1.0.26 → 1.0.28

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 (3) hide show
  1. package/models/Users.js +24 -1
  2. package/package.json +1 -1
  3. package/run.sh +91 -91
package/models/Users.js CHANGED
@@ -23,7 +23,7 @@ module.exports = (sequelize, DataTypes) => {
23
23
  allowNull: false,
24
24
  },
25
25
  Password: {
26
- type: DataTypes.STRING(256), // Store hash with max length 256
26
+ type: DataTypes.STRING(1024), // Store hash with max length 256
27
27
  allowNull: false,
28
28
  },
29
29
  Roles: {
@@ -36,11 +36,34 @@ module.exports = (sequelize, DataTypes) => {
36
36
  allowNull: true,
37
37
  defaultValue: [],
38
38
  },
39
+ MediaBuyers: {
40
+ type: DataTypes.ARRAY(DataTypes.STRING), // Array of account IDs
41
+ allowNull: true,
42
+ defaultValue: [],
43
+ },
44
+ Pages: {
45
+ type: DataTypes.ARRAY(DataTypes.STRING), // Array of account IDs
46
+ allowNull: true,
47
+ defaultValue: [],
48
+ },
49
+ FeedProvider: {
50
+ type: DataTypes.ARRAY(DataTypes.STRING), // Array of account IDs
51
+ allowNull: true,
52
+ defaultValue: [],
53
+ },
39
54
  Organization: {
40
55
  type: DataTypes.ARRAY(DataTypes.STRING), // Array of organization IDs
41
56
  allowNull: true,
42
57
  defaultValue: [],
43
58
  },
59
+ LastEntrance: {
60
+ type: DataTypes.DATE, // Array of organization IDs
61
+ allowNull: true,
62
+ },
63
+ Status: {
64
+ type: DataTypes.STRING, // Array of organization IDs
65
+ allowNull: true,
66
+ },
44
67
  },
45
68
  {
46
69
  tableName: "Users",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agrs-sequelize-sdk",
3
- "version": "1.0.26",
3
+ "version": "1.0.28",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "start": "node index.js",
package/run.sh CHANGED
@@ -1,91 +1,91 @@
1
- #!/bin/bash
2
-
3
- # Check if root is only required for jq installation
4
- require_root_for_jq=0
5
-
6
- # Check if jq is installed
7
- if ! command -v jq &> /dev/null; then
8
- echo "jq not found. Installing jq..."
9
- require_root_for_jq=1
10
- if command -v apt-get &> /dev/null; then
11
- sudo apt-get update && sudo apt-get install -y jq
12
- elif command -v brew &> /dev/null; then
13
- brew install jq
14
- else
15
- echo "Please install jq manually."
16
- exit 1
17
- fi
18
- fi
19
-
20
- # Only require root if jq installation was needed
21
- if [[ $require_root_for_jq -eq 1 && $EUID -ne 0 ]]; then
22
- echo "This script must be run as root for jq installation. Please use sudo."
23
- exit 1
24
- fi
25
-
26
- # Step 1: Check if logged in to NPM
27
- npmUsername=$(npm whoami 2>&1)
28
- if [[ $npmUsername == *"ERR"* ]]; then
29
- echo "Not logged in. Please log in to NPM."
30
- npm login
31
- if [[ $? -ne 0 ]]; then
32
- echo "NPM login failed. Exiting..."
33
- exit 1
34
- fi
35
- else
36
- echo "Already logged in to NPM as $npmUsername"
37
- fi
38
-
39
- # Step 2: Increment version in package.json
40
- if [[ ! -f package.json ]]; then
41
- echo "package.json not found. Exiting..."
42
- exit 1
43
- fi
44
-
45
- currentVersion=$(jq -r '.version' package.json)
46
-
47
- if [[ -z "$currentVersion" ]]; then
48
- echo "Could not find version in package.json"
49
- exit 1
50
- fi
51
-
52
- # Split version into major, minor, patch
53
- IFS='.' read -r major minor patch <<< "$currentVersion"
54
-
55
- # Increment version numbers with three-digit logic
56
- if [[ $patch -eq 99 ]]; then
57
- patch=0
58
- if [[ $minor -eq 99 ]]; then
59
- minor=0
60
- ((major++))
61
- else
62
- ((minor++))
63
- fi
64
- else
65
- ((patch++))
66
- fi
67
-
68
- newVersion="$major.$minor.$patch"
69
-
70
- # Update the version in package.json while maintaining formatting
71
- jq --arg version "$newVersion" '.version = $version' package.json > tmp.json && mv tmp.json package.json
72
- echo "Version updated from $currentVersion to $newVersion"
73
-
74
- # Step 3: Publish the package to NPM
75
- npm publish
76
- if [[ $? -ne 0 ]]; then
77
- echo "NPM publish failed. Exiting..."
78
- exit 1
79
- fi
80
-
81
- # Step 4: Commit the changes and push to GitHub
82
- git add .
83
- git commit -m "Bump version to $newVersion"
84
- git push origin main
85
-
86
- if [[ $? -ne 0 ]]; then
87
- echo "Failed to push changes to GitHub. Exiting..."
88
- exit 1
89
- fi
90
-
91
- echo "Version $newVersion published and changes pushed to GitHub successfully!"
1
+ #!/bin/bash
2
+
3
+ # Check if root is only required for jq installation
4
+ require_root_for_jq=0
5
+
6
+ # Check if jq is installed
7
+ if ! command -v jq &> /dev/null; then
8
+ echo "jq not found. Installing jq..."
9
+ require_root_for_jq=1
10
+ if command -v apt-get &> /dev/null; then
11
+ sudo apt-get update && sudo apt-get install -y jq
12
+ elif command -v brew &> /dev/null; then
13
+ brew install jq
14
+ else
15
+ echo "Please install jq manually."
16
+ exit 1
17
+ fi
18
+ fi
19
+
20
+ # Only require root if jq installation was needed
21
+ if [[ $require_root_for_jq -eq 1 && $EUID -ne 0 ]]; then
22
+ echo "This script must be run as root for jq installation. Please use sudo."
23
+ exit 1
24
+ fi
25
+
26
+ # Step 1: Check if logged in to NPM
27
+ npmUsername=$(npm whoami 2>&1)
28
+ if [[ $npmUsername == *"ERR"* ]]; then
29
+ echo "Not logged in. Please log in to NPM."
30
+ npm login
31
+ if [[ $? -ne 0 ]]; then
32
+ echo "NPM login failed. Exiting..."
33
+ exit 1
34
+ fi
35
+ else
36
+ echo "Already logged in to NPM as $npmUsername"
37
+ fi
38
+
39
+ # Step 2: Increment version in package.json
40
+ if [[ ! -f package.json ]]; then
41
+ echo "package.json not found. Exiting..."
42
+ exit 1
43
+ fi
44
+
45
+ currentVersion=$(jq -r '.version' package.json)
46
+
47
+ if [[ -z "$currentVersion" ]]; then
48
+ echo "Could not find version in package.json"
49
+ exit 1
50
+ fi
51
+
52
+ # Split version into major, minor, patch
53
+ IFS='.' read -r major minor patch <<< "$currentVersion"
54
+
55
+ # Increment version numbers with three-digit logic
56
+ if [[ $patch -eq 99 ]]; then
57
+ patch=0
58
+ if [[ $minor -eq 99 ]]; then
59
+ minor=0
60
+ ((major++))
61
+ else
62
+ ((minor++))
63
+ fi
64
+ else
65
+ ((patch++))
66
+ fi
67
+
68
+ newVersion="$major.$minor.$patch"
69
+
70
+ # Update the version in package.json while maintaining formatting
71
+ jq --arg version "$newVersion" '.version = $version' package.json > tmp.json && mv tmp.json package.json
72
+ echo "Version updated from $currentVersion to $newVersion"
73
+
74
+ # Step 3: Publish the package to NPM
75
+ npm publish
76
+ if [[ $? -ne 0 ]]; then
77
+ echo "NPM publish failed. Exiting..."
78
+ exit 1
79
+ fi
80
+
81
+ # Step 4: Commit the changes and push to GitHub
82
+ git add .
83
+ git commit -m "Bump version to $newVersion"
84
+ git push origin main
85
+
86
+ if [[ $? -ne 0 ]]; then
87
+ echo "Failed to push changes to GitHub. Exiting..."
88
+ exit 1
89
+ fi
90
+
91
+ echo "Version $newVersion published and changes pushed to GitHub successfully!"