Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
jio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Aurélien Vermylen
jio
Commits
976ca8a4
Commit
976ca8a4
authored
Nov 07, 2017
by
Aurelien Vermylen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make credentials possible in ERP5Storage for nodejs use.
parent
d1895b24
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
93 additions
and
39 deletions
+93
-39
dist/jio-v3.23.1.js
dist/jio-v3.23.1.js
+30
-12
dist/jio-v3.23.1.min.js
dist/jio-v3.23.1.min.js
+3
-3
dist/nodejs/jio.js
dist/nodejs/jio.js
+30
-12
src/jio.storage/erp5storage.js
src/jio.storage/erp5storage.js
+30
-12
No files found.
dist/jio-v3.23.1.js
View file @
976ca8a4
...
@@ -11368,7 +11368,7 @@ return new Parser;
...
@@ -11368,7 +11368,7 @@ return new Parser;
/*jslint nomen: true, unparam: true */
/*jslint nomen: true, unparam: true */
/*global jIO, UriTemplate, FormData, RSVP, URI, Blob,
/*global jIO, UriTemplate, FormData, RSVP, URI, Blob,
SimpleQuery, ComplexQuery*/
SimpleQuery, ComplexQuery
, btoa
*/
(
function
(
jIO
,
UriTemplate
,
FormData
,
RSVP
,
URI
,
Blob
,
(
function
(
jIO
,
UriTemplate
,
FormData
,
RSVP
,
URI
,
Blob
,
SimpleQuery
,
ComplexQuery
)
{
SimpleQuery
,
ComplexQuery
)
{
...
@@ -11381,8 +11381,9 @@ return new Parser;
...
@@ -11381,8 +11381,9 @@ return new Parser;
"
type
"
:
"
GET
"
,
"
type
"
:
"
GET
"
,
"
url
"
:
storage
.
_url
,
"
url
"
:
storage
.
_url
,
"
xhrFields
"
:
{
"
xhrFields
"
:
{
withCredentials
:
true
withCredentials
:
this
.
_withCredentials
}
},
"
headers
"
:
this
.
_headers
});
});
})
})
.
push
(
function
(
event
)
{
.
push
(
function
(
event
)
{
...
@@ -11407,8 +11408,9 @@ return new Parser;
...
@@ -11407,8 +11408,9 @@ return new Parser;
view
:
options
.
_view
view
:
options
.
_view
}),
}),
"
xhrFields
"
:
{
"
xhrFields
"
:
{
withCredentials
:
true
withCredentials
:
this
.
_withCredentials
}
},
"
headers
"
:
this
.
_headers
});
});
})
})
.
push
(
undefined
,
function
(
error
)
{
.
push
(
undefined
,
function
(
error
)
{
...
@@ -11506,6 +11508,13 @@ return new Parser;
...
@@ -11506,6 +11508,13 @@ return new Parser;
}
}
this
.
_url
=
spec
.
url
;
this
.
_url
=
spec
.
url
;
this
.
_default_view_reference
=
spec
.
default_view_reference
;
this
.
_default_view_reference
=
spec
.
default_view_reference
;
this
.
_headers
=
{};
this
.
_withCredentials
=
true
;
if
(
spec
.
login
!==
undefined
&&
spec
.
password
!==
undefined
)
{
this
.
_headers
=
{
"
Authorization
"
:
"
Basic
"
+
btoa
(
spec
.
login
+
"
:
"
+
spec
.
password
)};
this
.
_withCredentials
=
false
;
}
}
}
function
convertJSONToGet
(
json
)
{
function
convertJSONToGet
(
json
)
{
...
@@ -11543,8 +11552,9 @@ return new Parser;
...
@@ -11543,8 +11552,9 @@ return new Parser;
url
:
site_hal
.
_actions
.
add
.
href
,
url
:
site_hal
.
_actions
.
add
.
href
,
data
:
form_data
,
data
:
form_data
,
xhrFields
:
{
xhrFields
:
{
withCredentials
:
true
withCredentials
:
this
.
_withCredentials
}
},
"
headers
"
:
this
.
_headers
});
});
})
})
.
push
(
function
(
evt
)
{
.
push
(
function
(
evt
)
{
...
@@ -11658,6 +11668,7 @@ return new Parser;
...
@@ -11658,6 +11668,7 @@ return new Parser;
return
new
RSVP
.
Queue
()
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
.
push
(
function
()
{
var
start
,
var
start
,
k
,
end
,
end
,
range
,
range
,
request_options
=
{
request_options
=
{
...
@@ -11665,7 +11676,7 @@ return new Parser;
...
@@ -11665,7 +11676,7 @@ return new Parser;
"
dataType
"
:
"
blob
"
,
"
dataType
"
:
"
blob
"
,
"
url
"
:
action
,
"
url
"
:
action
,
"
xhrFields
"
:
{
"
xhrFields
"
:
{
withCredentials
:
t
rue
withCredentials
:
t
his
.
_withCredentials
}
}
};
};
if
(
options
.
start
!==
undefined
||
options
.
end
!==
undefined
)
{
if
(
options
.
start
!==
undefined
||
options
.
end
!==
undefined
)
{
...
@@ -11687,6 +11698,11 @@ return new Parser;
...
@@ -11687,6 +11698,11 @@ return new Parser;
range
=
"
bytes=
"
+
start
+
"
-
"
+
end
;
range
=
"
bytes=
"
+
start
+
"
-
"
+
end
;
}
}
request_options
.
headers
=
{
Range
:
range
};
request_options
.
headers
=
{
Range
:
range
};
for
(
k
in
this
.
_headers
)
{
if
(
this
.
_headers
.
hasOwnProperty
(
k
))
{
request_options
.
headers
[
k
]
=
this
.
_headers
[
k
];
}
}
}
}
return
jIO
.
util
.
ajax
(
request_options
);
return
jIO
.
util
.
ajax
(
request_options
);
})
})
...
@@ -11746,8 +11762,9 @@ return new Parser;
...
@@ -11746,8 +11762,9 @@ return new Parser;
"
data
"
:
data
,
"
data
"
:
data
,
"
dataType
"
:
"
blob
"
,
"
dataType
"
:
"
blob
"
,
"
xhrFields
"
:
{
"
xhrFields
"
:
{
withCredentials
:
true
withCredentials
:
this
.
_withCredentials
}
},
"
headers
"
:
this
.
_headers
});
});
});
});
};
};
...
@@ -11864,8 +11881,9 @@ return new Parser;
...
@@ -11864,8 +11881,9 @@ return new Parser;
local_roles
:
local_roles
local_roles
:
local_roles
}),
}),
"
xhrFields
"
:
{
"
xhrFields
"
:
{
withCredentials
:
true
withCredentials
:
this
.
_withCredentials
}
},
"
headers
"
:
this
.
_headers
});
});
})
})
.
push
(
function
(
response
)
{
.
push
(
function
(
response
)
{
...
...
dist/jio-v3.23.1.min.js
View file @
976ca8a4
This source diff could not be displayed because it is too large. You can
view the blob
instead.
dist/nodejs/jio.js
View file @
976ca8a4
...
@@ -4268,7 +4268,7 @@ return new Parser;
...
@@ -4268,7 +4268,7 @@ return new Parser;
/*jslint nomen: true, unparam: true */
/*jslint nomen: true, unparam: true */
/*global jIO, UriTemplate, FormData, RSVP, URI, Blob,
/*global jIO, UriTemplate, FormData, RSVP, URI, Blob,
SimpleQuery, ComplexQuery*/
SimpleQuery, ComplexQuery
, btoa
*/
(
function
(
jIO
,
UriTemplate
,
FormData
,
RSVP
,
URI
,
Blob
,
(
function
(
jIO
,
UriTemplate
,
FormData
,
RSVP
,
URI
,
Blob
,
SimpleQuery
,
ComplexQuery
)
{
SimpleQuery
,
ComplexQuery
)
{
...
@@ -4281,8 +4281,9 @@ return new Parser;
...
@@ -4281,8 +4281,9 @@ return new Parser;
"
type
"
:
"
GET
"
,
"
type
"
:
"
GET
"
,
"
url
"
:
storage
.
_url
,
"
url
"
:
storage
.
_url
,
"
xhrFields
"
:
{
"
xhrFields
"
:
{
withCredentials
:
true
withCredentials
:
this
.
_withCredentials
}
},
"
headers
"
:
this
.
_headers
});
});
})
})
.
push
(
function
(
event
)
{
.
push
(
function
(
event
)
{
...
@@ -4307,8 +4308,9 @@ return new Parser;
...
@@ -4307,8 +4308,9 @@ return new Parser;
view
:
options
.
_view
view
:
options
.
_view
}),
}),
"
xhrFields
"
:
{
"
xhrFields
"
:
{
withCredentials
:
true
withCredentials
:
this
.
_withCredentials
}
},
"
headers
"
:
this
.
_headers
});
});
})
})
.
push
(
undefined
,
function
(
error
)
{
.
push
(
undefined
,
function
(
error
)
{
...
@@ -4406,6 +4408,13 @@ return new Parser;
...
@@ -4406,6 +4408,13 @@ return new Parser;
}
}
this
.
_url
=
spec
.
url
;
this
.
_url
=
spec
.
url
;
this
.
_default_view_reference
=
spec
.
default_view_reference
;
this
.
_default_view_reference
=
spec
.
default_view_reference
;
this
.
_headers
=
{};
this
.
_withCredentials
=
true
;
if
(
spec
.
login
!==
undefined
&&
spec
.
password
!==
undefined
)
{
this
.
_headers
=
{
"
Authorization
"
:
"
Basic
"
+
btoa
(
spec
.
login
+
"
:
"
+
spec
.
password
)};
this
.
_withCredentials
=
false
;
}
}
}
function
convertJSONToGet
(
json
)
{
function
convertJSONToGet
(
json
)
{
...
@@ -4443,8 +4452,9 @@ return new Parser;
...
@@ -4443,8 +4452,9 @@ return new Parser;
url
:
site_hal
.
_actions
.
add
.
href
,
url
:
site_hal
.
_actions
.
add
.
href
,
data
:
form_data
,
data
:
form_data
,
xhrFields
:
{
xhrFields
:
{
withCredentials
:
true
withCredentials
:
this
.
_withCredentials
}
},
"
headers
"
:
this
.
_headers
});
});
})
})
.
push
(
function
(
evt
)
{
.
push
(
function
(
evt
)
{
...
@@ -4558,6 +4568,7 @@ return new Parser;
...
@@ -4558,6 +4568,7 @@ return new Parser;
return
new
RSVP
.
Queue
()
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
.
push
(
function
()
{
var
start
,
var
start
,
k
,
end
,
end
,
range
,
range
,
request_options
=
{
request_options
=
{
...
@@ -4565,7 +4576,7 @@ return new Parser;
...
@@ -4565,7 +4576,7 @@ return new Parser;
"
dataType
"
:
"
blob
"
,
"
dataType
"
:
"
blob
"
,
"
url
"
:
action
,
"
url
"
:
action
,
"
xhrFields
"
:
{
"
xhrFields
"
:
{
withCredentials
:
t
rue
withCredentials
:
t
his
.
_withCredentials
}
}
};
};
if
(
options
.
start
!==
undefined
||
options
.
end
!==
undefined
)
{
if
(
options
.
start
!==
undefined
||
options
.
end
!==
undefined
)
{
...
@@ -4587,6 +4598,11 @@ return new Parser;
...
@@ -4587,6 +4598,11 @@ return new Parser;
range
=
"
bytes=
"
+
start
+
"
-
"
+
end
;
range
=
"
bytes=
"
+
start
+
"
-
"
+
end
;
}
}
request_options
.
headers
=
{
Range
:
range
};
request_options
.
headers
=
{
Range
:
range
};
for
(
k
in
this
.
_headers
)
{
if
(
this
.
_headers
.
hasOwnProperty
(
k
))
{
request_options
.
headers
[
k
]
=
this
.
_headers
[
k
];
}
}
}
}
return
jIO
.
util
.
ajax
(
request_options
);
return
jIO
.
util
.
ajax
(
request_options
);
})
})
...
@@ -4646,8 +4662,9 @@ return new Parser;
...
@@ -4646,8 +4662,9 @@ return new Parser;
"
data
"
:
data
,
"
data
"
:
data
,
"
dataType
"
:
"
blob
"
,
"
dataType
"
:
"
blob
"
,
"
xhrFields
"
:
{
"
xhrFields
"
:
{
withCredentials
:
true
withCredentials
:
this
.
_withCredentials
}
},
"
headers
"
:
this
.
_headers
});
});
});
});
};
};
...
@@ -4764,8 +4781,9 @@ return new Parser;
...
@@ -4764,8 +4781,9 @@ return new Parser;
local_roles
:
local_roles
local_roles
:
local_roles
}),
}),
"
xhrFields
"
:
{
"
xhrFields
"
:
{
withCredentials
:
true
withCredentials
:
this
.
_withCredentials
}
},
"
headers
"
:
this
.
_headers
});
});
})
})
.
push
(
function
(
response
)
{
.
push
(
function
(
response
)
{
...
...
src/jio.storage/erp5storage.js
View file @
976ca8a4
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
/*jslint nomen: true, unparam: true */
/*jslint nomen: true, unparam: true */
/*global jIO, UriTemplate, FormData, RSVP, URI, Blob,
/*global jIO, UriTemplate, FormData, RSVP, URI, Blob,
SimpleQuery, ComplexQuery*/
SimpleQuery, ComplexQuery
, btoa
*/
(
function
(
jIO
,
UriTemplate
,
FormData
,
RSVP
,
URI
,
Blob
,
(
function
(
jIO
,
UriTemplate
,
FormData
,
RSVP
,
URI
,
Blob
,
SimpleQuery
,
ComplexQuery
)
{
SimpleQuery
,
ComplexQuery
)
{
...
@@ -24,8 +24,9 @@
...
@@ -24,8 +24,9 @@
"
type
"
:
"
GET
"
,
"
type
"
:
"
GET
"
,
"
url
"
:
storage
.
_url
,
"
url
"
:
storage
.
_url
,
"
xhrFields
"
:
{
"
xhrFields
"
:
{
withCredentials
:
true
withCredentials
:
this
.
_withCredentials
}
},
"
headers
"
:
this
.
_headers
});
});
})
})
.
push
(
function
(
event
)
{
.
push
(
function
(
event
)
{
...
@@ -50,8 +51,9 @@
...
@@ -50,8 +51,9 @@
view
:
options
.
_view
view
:
options
.
_view
}),
}),
"
xhrFields
"
:
{
"
xhrFields
"
:
{
withCredentials
:
true
withCredentials
:
this
.
_withCredentials
}
},
"
headers
"
:
this
.
_headers
});
});
})
})
.
push
(
undefined
,
function
(
error
)
{
.
push
(
undefined
,
function
(
error
)
{
...
@@ -149,6 +151,13 @@
...
@@ -149,6 +151,13 @@
}
}
this
.
_url
=
spec
.
url
;
this
.
_url
=
spec
.
url
;
this
.
_default_view_reference
=
spec
.
default_view_reference
;
this
.
_default_view_reference
=
spec
.
default_view_reference
;
this
.
_headers
=
{};
this
.
_withCredentials
=
true
;
if
(
spec
.
login
!==
undefined
&&
spec
.
password
!==
undefined
)
{
this
.
_headers
=
{
"
Authorization
"
:
"
Basic
"
+
btoa
(
spec
.
login
+
"
:
"
+
spec
.
password
)};
this
.
_withCredentials
=
false
;
}
}
}
function
convertJSONToGet
(
json
)
{
function
convertJSONToGet
(
json
)
{
...
@@ -186,8 +195,9 @@
...
@@ -186,8 +195,9 @@
url
:
site_hal
.
_actions
.
add
.
href
,
url
:
site_hal
.
_actions
.
add
.
href
,
data
:
form_data
,
data
:
form_data
,
xhrFields
:
{
xhrFields
:
{
withCredentials
:
true
withCredentials
:
this
.
_withCredentials
}
},
"
headers
"
:
this
.
_headers
});
});
})
})
.
push
(
function
(
evt
)
{
.
push
(
function
(
evt
)
{
...
@@ -301,6 +311,7 @@
...
@@ -301,6 +311,7 @@
return
new
RSVP
.
Queue
()
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
.
push
(
function
()
{
var
start
,
var
start
,
k
,
end
,
end
,
range
,
range
,
request_options
=
{
request_options
=
{
...
@@ -308,7 +319,7 @@
...
@@ -308,7 +319,7 @@
"
dataType
"
:
"
blob
"
,
"
dataType
"
:
"
blob
"
,
"
url
"
:
action
,
"
url
"
:
action
,
"
xhrFields
"
:
{
"
xhrFields
"
:
{
withCredentials
:
t
rue
withCredentials
:
t
his
.
_withCredentials
}
}
};
};
if
(
options
.
start
!==
undefined
||
options
.
end
!==
undefined
)
{
if
(
options
.
start
!==
undefined
||
options
.
end
!==
undefined
)
{
...
@@ -330,6 +341,11 @@
...
@@ -330,6 +341,11 @@
range
=
"
bytes=
"
+
start
+
"
-
"
+
end
;
range
=
"
bytes=
"
+
start
+
"
-
"
+
end
;
}
}
request_options
.
headers
=
{
Range
:
range
};
request_options
.
headers
=
{
Range
:
range
};
for
(
k
in
this
.
_headers
)
{
if
(
this
.
_headers
.
hasOwnProperty
(
k
))
{
request_options
.
headers
[
k
]
=
this
.
_headers
[
k
];
}
}
}
}
return
jIO
.
util
.
ajax
(
request_options
);
return
jIO
.
util
.
ajax
(
request_options
);
})
})
...
@@ -389,8 +405,9 @@
...
@@ -389,8 +405,9 @@
"
data
"
:
data
,
"
data
"
:
data
,
"
dataType
"
:
"
blob
"
,
"
dataType
"
:
"
blob
"
,
"
xhrFields
"
:
{
"
xhrFields
"
:
{
withCredentials
:
true
withCredentials
:
this
.
_withCredentials
}
},
"
headers
"
:
this
.
_headers
});
});
});
});
};
};
...
@@ -507,8 +524,9 @@
...
@@ -507,8 +524,9 @@
local_roles
:
local_roles
local_roles
:
local_roles
}),
}),
"
xhrFields
"
:
{
"
xhrFields
"
:
{
withCredentials
:
true
withCredentials
:
this
.
_withCredentials
}
},
"
headers
"
:
this
.
_headers
});
});
})
})
.
push
(
function
(
response
)
{
.
push
(
function
(
response
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment