agrs-sequelize-sdk 1.0.0
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/LICENSE +21 -0
- package/README.md +1 -0
- package/config/config.json +24 -0
- package/index.js +69 -0
- package/models/ActivityHistory.js +73 -0
- package/models/Ad.js +140 -0
- package/models/AdAccount.js +90 -0
- package/models/AdCreative.js +57 -0
- package/models/AdPerformance.js +65 -0
- package/models/AdPerformanceHourly.js +51 -0
- package/models/AdSet.js +69 -0
- package/models/Campaign.js +112 -0
- package/models/CodefuelCampaign.js +112 -0
- package/models/CodefuelCampaignKWHistory.js +41 -0
- package/models/CodefuelKeywords.js +35 -0
- package/models/CurrencyRate.js +27 -0
- package/models/Files.js +64 -0
- package/models/Folders.js +37 -0
- package/models/KeywordPerformance.js +65 -0
- package/models/KeywordRotationState.js +46 -0
- package/models/Rule.js +39 -0
- package/models/TonicCampaign.js +97 -0
- package/models/Users.js +41 -0
- package/models/pixel.js +33 -0
- package/models/pixels.js +33 -0
- package/package.json +19 -0
package/models/Users.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
const { Organization } = require("facebook-nodejs-business-sdk");
|
|
2
|
+
const { or } = require("sequelize");
|
|
3
|
+
|
|
4
|
+
module.exports = (sequelize, DataTypes) => {
|
|
5
|
+
const Users = sequelize.define(
|
|
6
|
+
"Users",
|
|
7
|
+
{
|
|
8
|
+
Username: {
|
|
9
|
+
type: DataTypes.STRING,
|
|
10
|
+
allowNull: false,
|
|
11
|
+
unique: true,
|
|
12
|
+
},
|
|
13
|
+
// add name field
|
|
14
|
+
Name: {
|
|
15
|
+
type: DataTypes.STRING,
|
|
16
|
+
allowNull: false,
|
|
17
|
+
},
|
|
18
|
+
Password: {
|
|
19
|
+
type: DataTypes.STRING(256), // Store hash with max length 256
|
|
20
|
+
allowNull: false,
|
|
21
|
+
},
|
|
22
|
+
Roles: {
|
|
23
|
+
type: DataTypes.ARRAY(DataTypes.STRING), // Array of roles
|
|
24
|
+
allowNull: false,
|
|
25
|
+
},
|
|
26
|
+
Accounts: {
|
|
27
|
+
type: DataTypes.ARRAY(DataTypes.STRING), // Array of account IDs
|
|
28
|
+
allowNull: true,
|
|
29
|
+
},
|
|
30
|
+
Organization: {
|
|
31
|
+
type: DataTypes.ARRAY(DataTypes.STRING), // Array of organization IDs
|
|
32
|
+
allowNull: true,
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
tableName: "Users",
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
return Users;
|
|
41
|
+
};
|
package/models/pixel.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
const { DataTypes } = require("sequelize");
|
|
2
|
+
|
|
3
|
+
module.exports = (sequelize) => {
|
|
4
|
+
const Pixel = sequelize.define("Pixel", {
|
|
5
|
+
id: {
|
|
6
|
+
type: DataTypes.STRING,
|
|
7
|
+
allowNull: false,
|
|
8
|
+
primaryKey: true,
|
|
9
|
+
},
|
|
10
|
+
platform: {
|
|
11
|
+
type: DataTypes.STRING,
|
|
12
|
+
allowNull: false,
|
|
13
|
+
defaultValue: "facebook", // Default to Facebook, but you can adjust as needed
|
|
14
|
+
in: ["Facebook", "Tiktok", "Taboola", "Outbrain", "Yahoo"],
|
|
15
|
+
},
|
|
16
|
+
access_token: {
|
|
17
|
+
type: DataTypes.STRING,
|
|
18
|
+
allowNull: false,
|
|
19
|
+
},
|
|
20
|
+
createdAt: {
|
|
21
|
+
type: DataTypes.DATE,
|
|
22
|
+
allowNull: false,
|
|
23
|
+
defaultValue: DataTypes.NOW,
|
|
24
|
+
},
|
|
25
|
+
updatedAt: {
|
|
26
|
+
type: DataTypes.DATE,
|
|
27
|
+
allowNull: false,
|
|
28
|
+
defaultValue: DataTypes.NOW,
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
return Pixel;
|
|
33
|
+
};
|
package/models/pixels.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
const { DataTypes } = require("sequelize");
|
|
2
|
+
|
|
3
|
+
module.exports = (sequelize) => {
|
|
4
|
+
const Pixel = sequelize.define("Pixel", {
|
|
5
|
+
id: {
|
|
6
|
+
type: DataTypes.STRING,
|
|
7
|
+
allowNull: false,
|
|
8
|
+
primaryKey: true,
|
|
9
|
+
},
|
|
10
|
+
platform: {
|
|
11
|
+
type: DataTypes.STRING,
|
|
12
|
+
allowNull: false,
|
|
13
|
+
defaultValue: "facebook", // Default to Facebook, but you can adjust as needed
|
|
14
|
+
in: ["Facebook", "Tiktok", "Taboola", "Outbrain", "Yahoo"],
|
|
15
|
+
},
|
|
16
|
+
access_token: {
|
|
17
|
+
type: DataTypes.STRING,
|
|
18
|
+
allowNull: false,
|
|
19
|
+
},
|
|
20
|
+
createdAt: {
|
|
21
|
+
type: DataTypes.DATE,
|
|
22
|
+
allowNull: false,
|
|
23
|
+
defaultValue: DataTypes.NOW,
|
|
24
|
+
},
|
|
25
|
+
updatedAt: {
|
|
26
|
+
type: DataTypes.DATE,
|
|
27
|
+
allowNull: false,
|
|
28
|
+
defaultValue: DataTypes.NOW,
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
return Pixel;
|
|
33
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "agrs-sequelize-sdk",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"main": "index.js",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"start": "node index.js",
|
|
7
|
+
"sync": "node services/sequelizeService.js",
|
|
8
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
9
|
+
},
|
|
10
|
+
"keywords": [],
|
|
11
|
+
"author": "",
|
|
12
|
+
"license": "ISC",
|
|
13
|
+
"description": "",
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"pg": "^8.13.0",
|
|
16
|
+
"pg-hstore": "^2.3.4",
|
|
17
|
+
"sequelize": "^6.37.4"
|
|
18
|
+
}
|
|
19
|
+
}
|