@francesco_ksh/app-ksh-mgd-schemas 1.2.2 → 1.2.4
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/models/ShopifyApi.js +114 -109
- package/models/User.js +6 -0
- package/models/WoocommerceApi.js +68 -63
- package/package.json +1 -1
package/models/ShopifyApi.js
CHANGED
|
@@ -1,55 +1,33 @@
|
|
|
1
1
|
const mongoose = require('mongoose');
|
|
2
2
|
const Schema = mongoose.Schema;
|
|
3
3
|
|
|
4
|
-
const shopifyApiSchema = new Schema(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
storefrontApiAccessToken: {
|
|
10
|
-
type: String,
|
|
11
|
-
required: true,
|
|
12
|
-
},
|
|
13
|
-
apiKey: {
|
|
14
|
-
type: String,
|
|
15
|
-
required: true,
|
|
16
|
-
},
|
|
17
|
-
storeName: {
|
|
18
|
-
type: String,
|
|
19
|
-
},
|
|
20
|
-
sellerId: {
|
|
21
|
-
type: Schema.Types.ObjectId,
|
|
22
|
-
ref: 'User',
|
|
23
|
-
required: true,
|
|
24
|
-
},
|
|
25
|
-
email: { type: String },
|
|
26
|
-
domain: { type: String },
|
|
27
|
-
shopifyDomain: { type: String },
|
|
28
|
-
|
|
29
|
-
storeLocation: {
|
|
30
|
-
address: { type: String },
|
|
31
|
-
city: { type: String },
|
|
32
|
-
country: { type: String },
|
|
33
|
-
province: { type: String },
|
|
34
|
-
phone: { type: String },
|
|
35
|
-
zip: { type: String },
|
|
36
|
-
coordinates: {
|
|
37
|
-
lat: { type: Number },
|
|
38
|
-
long: { type: Number },
|
|
4
|
+
const shopifyApiSchema = new Schema(
|
|
5
|
+
{
|
|
6
|
+
adminApiAccessToken: {
|
|
7
|
+
type: String,
|
|
8
|
+
required: true,
|
|
39
9
|
},
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
type: Number,
|
|
10
|
+
storefrontApiAccessToken: {
|
|
11
|
+
type: String,
|
|
12
|
+
required: true,
|
|
44
13
|
},
|
|
45
|
-
|
|
46
|
-
type:
|
|
14
|
+
apiKey: {
|
|
15
|
+
type: String,
|
|
16
|
+
required: true,
|
|
47
17
|
},
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
18
|
+
storeName: {
|
|
19
|
+
type: String,
|
|
20
|
+
},
|
|
21
|
+
sellerId: {
|
|
22
|
+
type: Schema.Types.ObjectId,
|
|
23
|
+
ref: 'User',
|
|
24
|
+
required: true,
|
|
25
|
+
},
|
|
26
|
+
email: { type: String },
|
|
27
|
+
domain: { type: String },
|
|
28
|
+
shopifyDomain: { type: String },
|
|
29
|
+
|
|
30
|
+
storeLocation: {
|
|
53
31
|
address: { type: String },
|
|
54
32
|
city: { type: String },
|
|
55
33
|
country: { type: String },
|
|
@@ -61,83 +39,110 @@ const shopifyApiSchema = new Schema({
|
|
|
61
39
|
long: { type: Number },
|
|
62
40
|
},
|
|
63
41
|
},
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
shopOwner: { type: String },
|
|
68
|
-
name: { type: String },
|
|
69
|
-
metafieldValues: [
|
|
70
|
-
{
|
|
71
|
-
active: {
|
|
72
|
-
type: Boolean,
|
|
73
|
-
},
|
|
74
|
-
key: {
|
|
75
|
-
type: String,
|
|
42
|
+
products: {
|
|
43
|
+
published: {
|
|
44
|
+
type: Number,
|
|
76
45
|
},
|
|
77
|
-
|
|
78
|
-
type:
|
|
46
|
+
unpublished: {
|
|
47
|
+
type: Number,
|
|
79
48
|
},
|
|
80
|
-
values: [
|
|
81
|
-
{
|
|
82
|
-
shopifyValue: {
|
|
83
|
-
type: String,
|
|
84
|
-
},
|
|
85
|
-
kashewValue: {
|
|
86
|
-
type: String,
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
],
|
|
90
|
-
},
|
|
91
|
-
],
|
|
92
|
-
matchedValues: { type: Array },
|
|
93
|
-
matchingKeys: { type: Object },
|
|
94
|
-
shopifyShopId: { type: String },
|
|
95
|
-
pastUploads: {
|
|
96
|
-
uploading: {
|
|
97
|
-
type: Boolean,
|
|
98
|
-
deafult: false,
|
|
99
49
|
},
|
|
100
|
-
|
|
50
|
+
productLocations: [
|
|
101
51
|
{
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
},
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
},
|
|
109
|
-
|
|
110
|
-
|
|
52
|
+
id: { type: Number },
|
|
53
|
+
name: { type: String },
|
|
54
|
+
address: { type: String },
|
|
55
|
+
city: { type: String },
|
|
56
|
+
country: { type: String },
|
|
57
|
+
province: { type: String },
|
|
58
|
+
phone: { type: String },
|
|
59
|
+
zip: { type: String },
|
|
60
|
+
coordinates: {
|
|
61
|
+
lat: { type: Number },
|
|
62
|
+
long: { type: Number },
|
|
111
63
|
},
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
phone: { type: String },
|
|
112
67
|
|
|
113
|
-
|
|
114
|
-
|
|
68
|
+
shopOwner: { type: String },
|
|
69
|
+
name: { type: String },
|
|
70
|
+
metafieldValues: [
|
|
71
|
+
{
|
|
72
|
+
active: {
|
|
73
|
+
type: Boolean,
|
|
115
74
|
},
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
type: Number,
|
|
75
|
+
key: {
|
|
76
|
+
type: String,
|
|
119
77
|
},
|
|
120
|
-
|
|
121
|
-
type:
|
|
78
|
+
match: {
|
|
79
|
+
type: String,
|
|
122
80
|
},
|
|
123
|
-
|
|
81
|
+
values: [
|
|
82
|
+
{
|
|
83
|
+
shopifyValue: {
|
|
84
|
+
type: String,
|
|
85
|
+
},
|
|
86
|
+
kashewValue: {
|
|
87
|
+
type: String,
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
],
|
|
124
91
|
},
|
|
125
92
|
],
|
|
126
|
-
|
|
93
|
+
matchedValues: { type: Array },
|
|
94
|
+
matchingKeys: { type: Object },
|
|
95
|
+
shopifyShopId: { type: String },
|
|
96
|
+
pastUploads: {
|
|
97
|
+
uploading: {
|
|
98
|
+
type: Boolean,
|
|
99
|
+
deafult: false,
|
|
100
|
+
},
|
|
101
|
+
uploads: [
|
|
102
|
+
{
|
|
103
|
+
soldProducts: {
|
|
104
|
+
type: Number,
|
|
105
|
+
},
|
|
106
|
+
date: {
|
|
107
|
+
type: Date,
|
|
108
|
+
default: Date.now,
|
|
109
|
+
},
|
|
110
|
+
newProducts: {
|
|
111
|
+
type: Number,
|
|
112
|
+
},
|
|
127
113
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
114
|
+
skipped: {
|
|
115
|
+
type: Number,
|
|
116
|
+
},
|
|
117
|
+
|
|
118
|
+
editedProducts: {
|
|
119
|
+
type: Number,
|
|
120
|
+
},
|
|
121
|
+
errors: {
|
|
122
|
+
type: Array,
|
|
123
|
+
},
|
|
124
|
+
savedProducts: [{ type: Schema.Types.ObjectId, ref: 'Listing' }],
|
|
125
|
+
},
|
|
126
|
+
],
|
|
127
|
+
},
|
|
128
|
+
|
|
129
|
+
updatingStoreFields: {
|
|
130
|
+
lastUpdated: {
|
|
131
|
+
type: Date,
|
|
132
|
+
},
|
|
133
|
+
loading: {
|
|
134
|
+
type: Boolean,
|
|
135
|
+
default: false,
|
|
136
|
+
},
|
|
131
137
|
},
|
|
132
|
-
|
|
133
|
-
type:
|
|
134
|
-
default:
|
|
138
|
+
date: {
|
|
139
|
+
type: Date,
|
|
140
|
+
default: Date.now,
|
|
135
141
|
},
|
|
136
142
|
},
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
});
|
|
143
|
+
{
|
|
144
|
+
suppressReservedKeysWarning: true,
|
|
145
|
+
}
|
|
146
|
+
);
|
|
142
147
|
|
|
143
148
|
module.exports = shopifyApiSchema;
|
package/models/User.js
CHANGED
package/models/WoocommerceApi.js
CHANGED
|
@@ -1,73 +1,78 @@
|
|
|
1
1
|
const mongoose = require('mongoose');
|
|
2
2
|
const Schema = mongoose.Schema;
|
|
3
3
|
|
|
4
|
-
const woocommerceApiSchema = new Schema(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
apiSecret: {
|
|
9
|
-
type: String,
|
|
10
|
-
},
|
|
11
|
-
storeName: {
|
|
12
|
-
type: String,
|
|
13
|
-
required: true,
|
|
14
|
-
},
|
|
15
|
-
storeUrl: {
|
|
16
|
-
type: String,
|
|
17
|
-
required: true,
|
|
18
|
-
},
|
|
19
|
-
sellerId: {
|
|
20
|
-
type: Schema.Types.ObjectId,
|
|
21
|
-
ref: 'User',
|
|
22
|
-
required: true,
|
|
23
|
-
},
|
|
24
|
-
permission: {
|
|
25
|
-
type: String,
|
|
26
|
-
},
|
|
27
|
-
pastUploads: {
|
|
28
|
-
uploading: {
|
|
29
|
-
type: Boolean,
|
|
30
|
-
deafult: false,
|
|
4
|
+
const woocommerceApiSchema = new Schema(
|
|
5
|
+
{
|
|
6
|
+
apiKey: {
|
|
7
|
+
type: String,
|
|
31
8
|
},
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
9
|
+
apiSecret: {
|
|
10
|
+
type: String,
|
|
11
|
+
},
|
|
12
|
+
storeName: {
|
|
13
|
+
type: String,
|
|
14
|
+
required: true,
|
|
15
|
+
},
|
|
16
|
+
storeUrl: {
|
|
17
|
+
type: String,
|
|
18
|
+
required: true,
|
|
19
|
+
},
|
|
20
|
+
sellerId: {
|
|
21
|
+
type: Schema.Types.ObjectId,
|
|
22
|
+
ref: 'User',
|
|
23
|
+
required: true,
|
|
24
|
+
},
|
|
25
|
+
permission: {
|
|
26
|
+
type: String,
|
|
27
|
+
},
|
|
28
|
+
pastUploads: {
|
|
29
|
+
uploading: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
deafult: false,
|
|
32
|
+
},
|
|
33
|
+
uploads: [
|
|
34
|
+
{
|
|
35
|
+
soldProducts: {
|
|
36
|
+
type: Number,
|
|
37
|
+
},
|
|
38
|
+
date: {
|
|
39
|
+
type: Date,
|
|
40
|
+
default: Date.now,
|
|
41
|
+
},
|
|
42
|
+
newProducts: {
|
|
43
|
+
type: Number,
|
|
44
|
+
},
|
|
44
45
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
skipped: {
|
|
47
|
+
type: Number,
|
|
48
|
+
},
|
|
48
49
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
editedProducts: {
|
|
51
|
+
type: Number,
|
|
52
|
+
},
|
|
53
|
+
errors: {
|
|
54
|
+
type: Array,
|
|
55
|
+
},
|
|
56
|
+
savedProducts: [{ type: Schema.Types.ObjectId, ref: 'Listing' }],
|
|
54
57
|
},
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
+
],
|
|
59
|
+
},
|
|
60
|
+
keyId: { type: String },
|
|
61
|
+
email: { type: String },
|
|
62
|
+
domain: { type: String },
|
|
63
|
+
phone: { type: String },
|
|
64
|
+
city: { type: String },
|
|
65
|
+
country: { type: String },
|
|
66
|
+
province: { type: String },
|
|
67
|
+
zip: { type: String },
|
|
68
|
+
shopOwner: { type: String },
|
|
69
|
+
name: { type: String },
|
|
70
|
+
matchedValues: { type: Array },
|
|
71
|
+
matchingKeys: { type: Object },
|
|
58
72
|
},
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
city: { type: String },
|
|
64
|
-
country: { type: String },
|
|
65
|
-
province: { type: String },
|
|
66
|
-
zip: { type: String },
|
|
67
|
-
shopOwner: { type: String },
|
|
68
|
-
name: { type: String },
|
|
69
|
-
matchedValues: { type: Array },
|
|
70
|
-
matchingKeys: { type: Object },
|
|
71
|
-
});
|
|
73
|
+
{
|
|
74
|
+
suppressReservedKeysWarning: true,
|
|
75
|
+
}
|
|
76
|
+
);
|
|
72
77
|
|
|
73
78
|
module.exports = woocommerceApiSchema;
|