Skip to content
This repository was archived by the owner on Apr 11, 2023. It is now read-only.

Commit 48d0b02

Browse files
committed
Merge branch 'development' of github.com:jaydata/jaydata into development
2 parents 16d212e + f4ab9e5 commit 48d0b02

29 files changed

+211
-229
lines changed

gulpfile.js

Lines changed: 43 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ var paths = {
3030

3131
gulp.task('default', ['babel:compile'], function() {});
3232

33-
gulp.task('jaydata', function() {
33+
/*gulp.task('jaydata_tmp', function() {
3434
return browserify()
3535
.transform(babelify)
3636
.require('./src/index.js', { expose: 'jaydata/core' })
@@ -42,7 +42,7 @@ gulp.task('jaydata', function() {
4242
.pipe(gulp.dest('./dist/public'));
4343
});
4444
45-
gulp.task('odataprovider', function() {
45+
gulp.task('odataprovider_tmp', function() {
4646
if (!fs.existsSync('dist')) fs.mkdirSync('dist');
4747
return browserify({
4848
standalone: '$data'
@@ -57,23 +57,7 @@ gulp.task('odataprovider', function() {
5757
.pipe(buffer())
5858
//.pipe(uglify())
5959
.pipe(gulp.dest('./dist/public/jaydataproviders'));
60-
});
61-
62-
gulp.task('sqliteprovider', function() {
63-
if (!fs.existsSync('dist')) fs.mkdirSync('dist');
64-
return browserify({
65-
standalone: '$data'
66-
})
67-
.transform(babelify)
68-
.require('./src/Types/StorageProviders/SqLite/index.js', { entry: true })
69-
.external('jaydata/core')
70-
.bundle()
71-
.on("error", function (err) { console.log("Error: " + err.message) })
72-
.pipe(source('SqLiteProvider.js'))
73-
.pipe(buffer())
74-
//.pipe(uglify())
75-
.pipe(gulp.dest('./dist/public/jaydataproviders'));
76-
});
60+
});*/
7761

7862
gulp.task('lint', function(){
7963
return gulp.src(['src/**/*.js'])
@@ -97,7 +81,7 @@ gulp.task('lint', function(){
9781
.pipe(eslint.failAfterError());
9882
});
9983

100-
gulp.task('bundle', ['lint', 'jaydata', 'odataprovider', 'sqliteprovider'])
84+
//gulp.task('bundle', ['lint', 'jaydata', 'odataprovider', 'sqliteprovider'])
10185

10286
gulp.task('nodejs', function() {
10387
return gulp.src(['src/**/*.js'])
@@ -153,28 +137,49 @@ gulp.task('apidocs', ['jaydata'], function (cb) {
153137
});
154138
});
155139

140+
156141
for (var i = 0; i < config.components.length; i++) {
157-
(function(taskName, dep, source, name, output) {
158-
if (source) {
159-
gulp.task(taskName, dep, function() {
160-
return gulpTask(source, name, output || config.options.output);
142+
(function(td) {
143+
if (td.browserify) {
144+
gulp.task(td.taskName, td.dependencies, function() {
145+
return gulpTask(td, config);
161146
});
162147
} else {
163-
gulp.task(taskName, dep);
148+
gulp.task(td.taskName, td.dependencies);
164149
}
165-
})(config.components[i].taskName, config.components[i].dependencies, config.components[i].componentItems, config.components[i].fileName, config.components[i]
166-
.output);
150+
})(config.components[i]);
167151
}
168152

169-
function gulpTask(srcList, resultName, destFolder) {
170-
var task = gulp.src(srcList)
171-
.pipe(concat(resultName + '.js'))
172-
.pipe(gulp.dest(destFolder));
173-
174-
if (config.options.min) {
175-
task = task.pipe(rename(resultName + '.min.js'))
176-
.pipe(uglify())
177-
.pipe(gulp.dest(destFolder));
178-
}
179-
return task;
153+
function gulpTask(td, config) {
154+
155+
var task = browserify(td.browserify)
156+
.transform(babelify)
157+
158+
task = task.require.apply(task, td.require)
159+
160+
if(td.external){
161+
for (var i = 0; i < td.external.length; i++){
162+
task = task.external(td.external[i])
163+
}
164+
}
165+
166+
if(td.ignore){
167+
for (var i = 0; i < td.ignore.length; i++){
168+
task = task.ignore(td.ignore[i])
169+
}
170+
}
171+
172+
task = task.bundle()
173+
.on("error", function (err) { console.log("Error: " + err.message) })
174+
.pipe(source(td.destFile))
175+
.pipe(buffer())
176+
177+
if(config.options.min){
178+
task = task.pipe(uglify())
179+
}
180+
181+
task = task.pipe(gulp.dest(td.destFolder));
182+
183+
return task;
184+
180185
}

jsconfig.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"compilerOptions": {
3+
"target": "ES6"
4+
}
5+
6+
}

src/Types/StorageProviders/Facebook/EntitySets/FQL/friend.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import $data, { $C, Guard, Container, Exception, MemberDefinition } from 'jaydata/core';
2+
13

24
$data.Class.define("$data.Facebook.types.FbFriend", $data.Entity, null, {
35
uid1: { type: "number", key: true, searchable: true },

src/Types/StorageProviders/Facebook/EntitySets/FQL/page.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import $data, { $C, Guard, Container, Exception, MemberDefinition } from 'jaydata/core';
2+
13
$data.Class.define("$data.Facebook.types.FbPage", $data.Entity, null, {
24
page_id: { type: "number", key: true, isPublic: true, searchable: true },
35
name: { type: "string", isPublic: true, searchable: true },
@@ -10,7 +12,7 @@ $data.Class.define("$data.Facebook.types.FbPage", $data.Entity, null, {
1012
pic_square: { type: "string", isPublic: true },
1113
pic: { type: "string", isPublic: true },
1214
pic_large: { type: "string", isPublic: true },
13-
pic_cover: { type: "object", isPublic: true }, //object The JSON object containing three fields: cover_id (the ID of the cover photo), source (the URL for the cover photo), andoffset_y (indicating percentage offset from top [0-100])
15+
pic_cover: { type: "object", isPublic: true }, //object The JSON object containing three fields:cover_id(the ID of the cover photo),source(the URL for the cover photo), andoffset_y(indicating percentage offset from top [0-100])
1416
unread_notif_count: { type: "number", isPublic: false },
1517
new_like_count: { type: "number", isPublic: false },
1618
fan_count: { type: "number", isPublic: true },
@@ -25,18 +27,18 @@ $data.Class.define("$data.Facebook.types.FbPage", $data.Entity, null, {
2527
company_overview: { type: "string", isPublic: true },
2628
mission: { type: "string", isPublic: true },
2729
products: { type: "string", isPublic: true },
28-
location: { type: "object", isPublic: true }, // array Applicable to all Places.
29-
parking: { type: "object", isPublic: true }, // array Applicable to Businesses and Places. Can be one of street, lot orvalet
30-
hours: { type: "array", isPublic: true }, // array Applicable to Businesses and Places.
30+
location: { type: "object", isPublic: true }, // array Applicable to allPlaces.
31+
parking: { type: "object", isPublic: true }, // array Applicable toBusinessesandPlaces. Can be one ofstreet,lotorvalet
32+
hours: { type: "array", isPublic: true }, // array Applicable toBusinessesandPlaces.
3133
pharma_safety_info: { type: "string", isPublic: true },
3234
public_transit: { type: "string", isPublic: true },
3335
attire: { type: "string", isPublic: true },
34-
payment_options: { type: "object", isPublic: true }, //array Applicable to Restaurants or Nightlife.
36+
payment_options: { type: "object", isPublic: true }, //array Applicable toRestaurants�or�Nightlife.
3537
culinary_team: { type: "string", isPublic: true },
3638
general_manager: { type: "string", isPublic: true },
3739
price_range: { type: "string", isPublic: true },
38-
restaurant_services: { type: "object", isPublic: true },// array Applicable to Restaurants.
39-
restaurant_specialties: { type: "object", isPublic: true },// array Applicable to Restaurants.
40+
restaurant_services: { type: "object", isPublic: true },// array Applicable toRestaurants.
41+
restaurant_specialties: { type: "object", isPublic: true },// array Applicable toRestaurants.
4042
phone: { type: "string", isPublic: true },
4143
release_date: { type: "string", isPublic: true },
4244
genre: { type: "string", isPublic: true },
@@ -69,4 +71,3 @@ $data.Class.define("$data.Facebook.types.FbPage", $data.Entity, null, {
6971
features: { type: "string", isPublic: true },
7072
mpg: { type: "string", isPublic: true }
7173
}, null);
72-

src/Types/StorageProviders/Facebook/EntitySets/FQL/user.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import $data, { $C, Guard, Container, Exception, MemberDefinition } from 'jaydata/core';
2+
13

24
$data.Class.define("$data.Facebook.types.FbUser", $data.Entity, null, {
35
uid: { type: "number", key: true, isPublic: true, searchable: true },

src/Types/StorageProviders/Facebook/EntitySets/FQLContext.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import $data, { $C, Guard, Container, Exception, MemberDefinition } from 'jaydata/core';
2+
13
$data.Class.define('$data.storageProviders.Facebook.EntitySets.Command', null, null, {
24
constructor: function (cfg) {
35
this.Config = $data.typeSystem.extend({
@@ -48,5 +50,3 @@ $data.Facebook.FQLCommands = {
4850
me: new $data.storageProviders.Facebook.EntitySets.Command({ CommandValue: "me()" }),
4951
now: new $data.storageProviders.Facebook.EntitySets.Command({ CommandValue: "now()" })
5052
};
51-
52-

src/Types/StorageProviders/Facebook/FacebookCompiler.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import $data, { $C, Guard, Container, Exception, MemberDefinition } from 'jaydata/core';
12

23
//"use strict"; // suspicious code
34

@@ -284,4 +285,3 @@ $C('$data.storageProviders.Facebook.FacebookCompiler', $data.Expressions.EntityE
284285
context.sql += ')';
285286
}
286287
}, null);
287-

src/Types/StorageProviders/Facebook/FacebookConverter.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import $data, { $C, Guard, Container, Exception, MemberDefinition } from 'jaydata/core';
2+
13
$data.FacebookConverter = {
24
fromDb: {
35
'$data.Byte': $data.Container.proxyConverter,

src/Types/StorageProviders/Facebook/FacebookProvider.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import $data, { $C, Guard, Container, Exception, MemberDefinition } from 'jaydata/core';
12

23
$data.Class.define('$data.storageProviders.Facebook.FacebookProvider', $data.StorageProviderBase, null,
34
{
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import $data from 'jaydata/core';
2+
3+
import FacebookConverter from './FacebookConverter.js';
4+
import FacebookProvider from './FacebookProvider.js';
5+
import FacebookCompiler from './FacebookCompiler.js';
6+
import user from './EntitySets/FQL/user.js';
7+
import friend from './EntitySets/FQL/friend.js';
8+
import page from './EntitySets/FQL/page.js';
9+
import FQLContext from './EntitySets/FQLContext.js';
10+
11+
export default $data;

0 commit comments

Comments
 (0)