stefh / angular-odata-es5 Goto Github PK
View Code? Open in Web Editor NEWOData Service for Angular.io (es5 version)
License: MIT License
OData Service for Angular.io (es5 version)
License: MIT License
Trying to set post headers.
config.baseUrl = this.DataServiceURL;
config.postRequestOptions.headers = new HttpHeaders({
'Accept': 'application/json',
'Content-Type': 'application/json; charset=utf-8',
'Session': ''});
Never seems to set the headers.
Am i missing something?
When calling a custom function, it would be nice if it allowed custom parameter serialization. It makes sense that this could happen when the params were sent as a string, in which case they would just be inserted within the parens and sent off as is ...
Hi,
How can i execute a custom collection action ?
Thanks !
I created a pull request : #45
Hi,
I want to access a odata-service with angular 2 bzw. ionic. It seems this component can make
this a little bit more comfortable.
Do you have a complete example with a
service.svc/$metadata
by using the component ?
Or is it necessary to implement the $select - urls manually ?
kind regards
michael
The current implementation only escapes the first single quote.
If I doing Odata request with parameters and then doing Delete request, all parameters from first request sended in second request.
For example:
this.odata = odataFactory.CreateService<T>(serviceName);
// sending $top=100
this.odata.Query().Top(100).Exec();
// and here sending $top=100
this.odata.Delete(1);
Tell me, is this how it should be? I understand that Delete should be sent without parameters (except for the key parameter)
https://msdn.microsoft.com/en-us/library/dd942040.aspx
Query.InlineCount
package-lock.json update suggested: marked ~> 0.3.9.
Hi there,
Great library!
It would be handy if the URL that is used could be accessed anywhere in the pipeline.
i.e. instead of Exec()
a user could invoke Url()
or Uri()
and get the built URL up to that point. This would allow this great library to be used when there are maybe other kinds of odata sources (i.e. DevExtreme's grid data source)
Branch | Build failing π¨ |
---|---|
Dependency | tslint |
Current Version | 5.2.0 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
As tslint is βonlyβ a devDependency of this project it might not break production or downstream projects, but βonlyβ your build or test tools β preventing new deploys or publishes.
I recommend you give this issue a high priority. Iβm sure you can resolve this πͺ
prefer-switch
: Change default min-cases
to 3. (#2669)outputAbsolutePaths
option (#2667)prefer-object-spread
(#2624)encoding
(#2368)prefer-conditional-expression
(#2363)indent
support indent size (#2723)object-literal-sort-keys
adds ignore-case
(#2592)quotemark
: Add avoid-template
option (#2766)await-promise
: What's considered a "Promise" is now configurable. (#2661)indent
(#2723)typedef-whitespace
(#2718)variable-name
(#2672)typedef
: Use name or parameters for error location (#2460)object-literal-sort-keys
: check shorthand properties (#2592)space-before-function-paren
: Handle get
/set
accessor (#2700)typedef-whitespace
added checks for arrow function, call and construct signature (#2718)no-object-literal-type-assertion
: Allow cast to any
(#2671)-p
option handles directories (#2756)tsconfig.json
is found next to tslint.json
(#2769)return-undefined
: Treat a return type void | undefined
same as void
(#2731)no-unnecessary-initializer
: Handle BindingElement
anywhere, not just in a VariableDeclaration
. (#2707)jsdoc-format
: correctly handle alignment in files with BOM (#2619)jsdoc-format
: don't treat empty comments (/**/
) as jsdoc (#2619)typedef-whitespace
don't warn for leading whitespace if token is preceded by line break (#2718)jsdoc-format
: fixed error position if line ends with \r\n
(#2619)prefer-switch
: add missing checks for some expressions (#2686)prefer-template
: Allow "a" + "b" + "c"
. (#2741)prefer-const
: fix false positive with variable declared outside of for-of or for-in (#2760)--project
: fix file matching with relative path to tsconfig.json
(#2688)no-default-export
: correctly handle export default abstract class {...}
(#2630)no-mergeable-namespace
: display correct line in error message (#2656)object-literal-sort-keys
: handle object spread correctly (#2592)await-promise
: Consider types derived from a Promise in union types too. (#2661)no-unsafe-any
: Fix bug where number literal in type position was flagged as an unsafe any
. (#2712)Lint.Utils.objectify
(#2764)Thanks to our contributors!
There is a collection of frequently asked questions and of course you may always ask my humans.
Your Greenkeeper Bot π΄
I am unable to set the baseurl from the class extends from ODataConfiguration. I am using it in angular4.Please some can help me thank you
Returns a 404 when clicking the provided documentation link https://stefh.github.io/angular-odata-es5/docs/
Branch | Build failing π¨ |
---|---|
Dependency | rxjs |
Current Version | 5.3.1 |
Type | dependency |
This version is covered by your current version range and after updating it in your project the build failed.
rxjs is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you itβs very likely also breaking them.
I recommend you give this issue a very high priority. Iβm sure you can resolve this πͺ
There is a collection of frequently asked questions and of course you may always ask my humans.
Your Greenkeeper Bot π΄
As in title. Could you add support for $count endpoint. Example:
http://host/service/Categories/$count
http://host/service/Products/$count?$filter=Category eq 'Test'
Hi @StefH !
I don't know when but I think there is an update where you modified your code and it seems that the OrderBy on nested properties doesn't work anymore...
(Perhaps other operations with nested properties are also broken, I didn't try...)
It creates an url which looks like something like ...$orderby=Boss.Name
instead of ...$orderby=Boss/Name
which is the good syntax...
Thanks in advance !
PS : By the way, would it be possible to update PrimeNG-DataTable-Extensions
to be compatible with the most recent version of angular-odata-es5
?
Branch | Build failing π¨ |
---|---|
Dependency | @angular/animations |
Current Version | 4.2.1 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
As @angular/animations is βonlyβ a devDependency of this project it might not break production or downstream projects, but βonlyβ your build or test tools β preventing new deploys or publishes.
I recommend you give this issue a high priority. Iβm sure you can resolve this πͺ
There is a collection of frequently asked questions and of course you may always ask my humans.
Your Greenkeeper Bot π΄
we have a use case where we want to supply custom query parameters.
route looks like:
http://localhost:61868/route/v1/Reports?effectiveDate=2018-06-30
it would be great if we could supply Param like so.
service.Query().Param('effectiveDate', '2018-06-30').Exec()
also, thanks for getting the GetUrl functionality out so quick!
angular-odata-es5/src/angularODataQuery.ts
Lines 36 to 44 in 6d17be1
It looks like all the other methods have null checking, but these two do not.
I don't see any reason to not include null checking here so I'd like to add this in when I get a chance.
When server returns a 500 status and exception is thrown with message:
__WEBPACK_IMPORTED_MODULE_1_rxjs_Observable__.Observable.throw is not a function
It is thrown in a angularODataQuery.js file at line 59
return Observable.throw(err);
Quick google shows that it could because of missing import for throw method:
import 'rxjs/add/observable/throw'
Branch | Build failing π¨ |
---|---|
Dependency | @angular/platform-browser |
Current Version | 4.2.1 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
As @angular/platform-browser is βonlyβ a devDependency of this project it might not break production or downstream projects, but βonlyβ your build or test tools β preventing new deploys or publishes.
I recommend you give this issue a high priority. Iβm sure you can resolve this πͺ
There is a collection of frequently asked questions and of course you may always ask my humans.
Your Greenkeeper Bot π΄
Hi @StefH , how to set up ODataConfiguration so I can add an Authorization header to below query?
const query: ODataQuery<recordedCalls> = this.odata.Query().Select(...);
PrimeNGDataTableODataQueryExtensions.applyLazyLoadEvent(query, event);
query.ExecWithCount()
.subscribe((pagedResult: ODataPagedResult<recordedCalls>) => {
this.calls = pagedResult.data;
this.totalRecords = pagedResult.count;
},
(error) => {
console.log('getPagedData ERROR ' + error);
});
I am using filters to achieve this behavior instead as a work around, but would prefer to call Get('key')
I'm attempting to upgrade to Angular 6 and this is the only package I have that hasn't upgraded. I'm using rxjs-compat
currently, but wouldn't mind removing it if I can get this upgraded :)
Branch | Build failing π¨ |
---|---|
Dependency | @angular/compiler |
Current Version | 4.2.1 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
As @angular/compiler is βonlyβ a devDependency of this project it might not break production or downstream projects, but βonlyβ your build or test tools β preventing new deploys or publishes.
I recommend you give this issue a high priority. Iβm sure you can resolve this πͺ
There is a collection of frequently asked questions and of course you may always ask my humans.
Your Greenkeeper Bot π΄
Hi @StefH ,
I'd want to know if there is a possibility to use your package to select distinct
values or to do sum
operation for example, like in 7.1 and 7.2 in the following link.
I didn't find any solution and it kind of bothers me for what I'd need to do...
Please tell me if I'm wrong...
Thanks in advance !
When a parameter object is provided to a function, the serialization will serialize undefined fields as field=undefined
, which seems incorrect. I recommend that fields with undefined values be omitted from the serialized parameters.
Hi,
I'm using version 0.4.0.
I'm getting rxjs__WEBPACK_IMPORTED_MODULE_0__.Observable.throw is not a function error whenever server returns error status. I guess it's because with rxjs version 6.0.0 we should use
import {throwError} from 'rxjs'
and then throwError(e)
rather then Observable.throw(e).
Cant assign headers to ODataConfiguration because it always returns getters with new RequestOptions object.
Has any work been done to support the maxpagesize and nextLink features? If not I can look at trying to implement them but didn't want to duplicate functionality.
Hello, I'm getting the error described in the title when I'm using Exec and the url retrive a status 400 error.
A workaround to this issue was changing this line in angularODataQuery.js:
import { Observable } from 'rxjs/Observable';
To this
import { Observable } from 'rxjs/Rx';
So the whole Rx Package is imported and also the static method Observation.throw come together, but it's not the best approach.
This issue explain in details the problem and the best solution:
ReactiveX/rxjs#1866
The parameter processing code assumes that strings that can be parsed to numbers should be sent as numeric parameters, ie. without quotes. This seems like a bad assumption, and prevents me from using this code. For example, it prevents the expression of a string param value such as '2017'.
https://github.com/StefH/angular-odata-es5/blob/master/src/angularODataUtils.ts#L23
I propose it instead checks if the type of the value is a string, and if so, wraps it in quotes.
Hi @StefH,
Sorry to bother you again but do you think there could be a way to change programmatically the OrderBy
or Filter
.
I explain myself :
I use angular-odata-es5 and PrimeNG-DataTable-Extensions and after executing applyLazyLoadEvent
I would like to modify the sorting depending on different cases.
If I do query.OrderBy
or query.Filter
it replaces the existing ones and there is no way to get what were the already existing values.
The problem is that these values are in private and there is no way to get them :
private _filter: string[] = [];
private _orderBy: string[] = [];
If there would be two functions returning these two arrays (a sort of GetOrderBy
and GetFilter
), then I could do anything I want on the arrays and do again OrderBy
or Filter
.
Thanks in advance !
OData allows the ability to do something like a POST
with an $expand
which then returns an object with an expanded property, e.g.:
POST http://localhost/SomeService/v1/SomeResource?$expand=NestedObjects
Accept: application/json
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.9
{
"Name": "Dummy Object",
"NestedObjects": [
{
"Name": "Dummy Nested Object"
}
]
}
HTTP/1.1 200 OK
Content-Type: application/json; odata.metadata=minimal
Location: http://localhost/SomeService/v1/SomeResource?$expand=NestedObjects
OData-Version: 4.0
{
"@odata.context": "http://localhost/SomeService/v1/$metadata#SomeResource/$entity",
"Id": 1234,
"Name": "Dummy Object",
"NestedObjects": [
{
"Id": 4321,
"Name": "Dummy Nested Object"
}
]
}
In a specific use case that I'm using, we PUT
an object with a nested object to update both the parent and the children in the database. When we get a response, it'll just return the top level object by default unless we include the $expand
operator
Hi
The toCommaString present into this file : 'angular-odata-es5/src/angularODataOperation.ts' seems to broke the Datetime comparator.
For example:
SignatoryID eq ${this.signatory.ID} and EndDate lt ${new Date().toISOString()}
Format -> SignatoryID eq 14 and EndDate ge 2018-02-07T09:58:30.897Z
toCommaString -> SignatoryID eq 14 and EndDate ge 2018-02-07T09:58:30/897Z
The dot is replaced by a slash..
How can i patch composed IDS ?
Thanks
There is no POST example given in documentation, Can you please provide one post sample through this component from angular
https://github.com/dherges/ng-packagr
This is a very slick tool, which automates packing up an Angular-compatible library for maximum compatibility with CLI and other build tools, as well as direct (UMD) execution.
I suggest this as a better alternative to homegrown script setups inside a library - you generally get a more compatible, compliant library, with less code/config/work.
At the moment CustomCollectionAction and CustomAction methods when making requests (posts) are using 'this.config.defaultRequestOptions'.
Shouldn't they use this.config.postRequestOptions ?
Single quotes in function parameter values are not escaped
StefH/PrimeNG-DataTable-Extensions#19
Actually, the syntax should be:
odata/Employees?$expand=Boss($select=FirstName)&$select=EmployeeID
or
/odata/Employees?$expand=Boss($select=FirstName)&$filter=contains(Boss/FirstName, 'ex')
How is one supposed to make a post that references another object in a navigation property?
Example:
export interface Module {
Identity: Edm.Guid;
Equipment?: PropertyCore.Equipment;
}
I need to post with a reference to an existing Equipment (and yes, that makes little sense - I removed all the other elements).
Our front end is stuck here and I fail to find any documentation at all. Adding an equipment (wich only the Identity set, which is the key) results in a deep insert style of post (i.e. Equipment = { sub elements }, while in reality we want a reference to an existing object:
{"@odata.type":"#PropertyCore.Module","[email protected]":"http://localhost/Equipment(000a129f-a55c-441f-9d7a-d95d53986aa4)"}
Is there any way to do this?
Known moderate severity security vulnerability detected in hoek < 4.2.1 defined in package-lock.json.
Really was looking for GetUrl for more than just query (Get primarily).
Are you planning to replace HTTP with HTTP Client?
Expect:
/odata/entity/functionName()
Actual:
/odata/entity('key')/functionName
Looking at the source:
public CustomFunction(key: string, actionName: string): Observable<any> {
return this._http.get(this.getEntityUri(key) + '/' + actionName, this.config.defaultRequestOptions).map(resp => resp.json());
}
Passing it a key seems unneeded, functions are called on the entities so just a functionName is required.
Also looks like a copy paste bug that the second parameter should be functionName instead of actionName.
It would also be nice if it took an args array of key/value pair, but I can do a PR for that.
Branch | Build failing π¨ |
---|---|
Dependency | ts-node |
Current Version | 3.0.4 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
As ts-node is βonlyβ a devDependency of this project it might not break production or downstream projects, but βonlyβ your build or test tools β preventing new deploys or publishes.
I recommend you give this issue a high priority. Iβm sure you can resolve this πͺ
The new version differs by 7 commits.
c18331a
3.0.5
5cf97b1
Add --inspect-brk
to known flags (#343)
7dfb3e3
Pin node tests at 6.x
(#340)
633d537
chore(package): update chai to version 4.0.1 (#337)
b751a56
Define exports
and improve getTypeInfo
help (#332)
d018300
Update yn
default option
cc3bf22
Expose _
bin file for consumers to use
See the full diff
There is a collection of frequently asked questions and of course you may always ask my humans.
Your Greenkeeper Bot π΄
needed for upgrading angular to latest
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.