gridify-client 2.0.0-preview.2 → 2.0.0-preview.3

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/README.md ADDED
@@ -0,0 +1,59 @@
1
+ # Gridify (A Modern Dynamic LINQ library)
2
+
3
+ ![GitHub](https://img.shields.io/github/license/alirezanet/gridify)
4
+ ![Nuget](https://img.shields.io/nuget/dt/gridify?color=%239100ff)
5
+ ![Nuget](https://img.shields.io/nuget/v/gridify?label=stable)
6
+ ![Nuget (with prereleases)](https://img.shields.io/nuget/vpre/gridify?label=latest)
7
+ [![NuGet version (Gridify)](https://img.shields.io/nuget/v/Gridify.svg?style=flat-square)](https://www.nuget.org/packages/Gridify/)
8
+ ![CodeQL](https://github.com/alirezanet/Gridify/actions/workflows/codeql.yml/badge.svg)
9
+ [![Static Badge](https://img.shields.io/badge/fuget-f88445?logo=readme&logoColor=white)](https://www.fuget.org/packages/Gridify)
10
+ [![Static Badge](https://img.shields.io/badge/Documentation-42bc00?logo=readme&logoColor=white)](https://alirezanet.github.io/Gridify/)
11
+ [![Discord](https://img.shields.io/badge/Discord-Join%20our%20server-blue?style=flat-square&logo=discord)](https://discord.gg/jaSXnDMv)
12
+
13
+
14
+
15
+
16
+ [![Gridify](https://raw.githubusercontent.com/alirezanet/Gridify/master/docs/.vuepress/public/gridify-readme-logo.svg)](https://alirezanet.github.io/Gridify/)
17
+
18
+ ## Introduction
19
+ Gridify is a dynamic LINQ library that simplifies the process of converting strings to LINQ queries. With exceptional performance and ease-of-use, Gridify makes it effortless to apply filtering, sorting, and pagination using text-based data.
20
+
21
+ ## Features
22
+
23
+ - Fast and easy to use
24
+ - Supports filtering, sorting, and pagination
25
+ - Supports `string` to LINQ conversion
26
+ - Supports nested queries and sub-collections
27
+ - Supports `string` to `object` mapping
28
+ - Supports query compilation
29
+ - Supports collection indexes
30
+ - Custom Operators
31
+ - Compatible with ORMs, especially Entity Framework
32
+ - Can be used on every collection that LINQ supports
33
+ - Compatible with object-mappers like AutoMapper
34
+ - Compatible with Elasticsearch 🔥🔥
35
+
36
+ ## Documentation
37
+
38
+ Check out our docs at [https://alirezanet.github.io/Gridify/](https://alirezanet.github.io/Gridify/).
39
+
40
+ ## Articles / Examples
41
+ - [Using Gridify in the api controllers](https://alirezanet.github.io/Gridify/example/api-controller.html#using-gridify-in-api-controllers)
42
+ - [Trabajando con filtros dinámicos usando Gridify en .NET](https://henriquemauri.net/trabalhando-com-filtros-dinamicos-utilizando-o-gridify-no-net/) by [@Henrique Mauri](https://github.com/hgmauri) (Spanish)
43
+ - [<span dir="rtl" align="right">آشنایی با Gridify</span>](https://www.dntips.ir/post/3345/%d8%a2%d8%b4%d9%86%d8%a7%db%8c%db%8c-%d8%a8%d8%a7-gridify) (Persian)
44
+ - Comming soon
45
+
46
+ ## Want to support us?
47
+
48
+ - Don't forget to give a ⭐ to this repo on GitHub!
49
+ - Share your feedback and ideas to improve the library!
50
+ - Share the library on your favorite social media and with your friends!
51
+ - Help us to improve the documentation!
52
+
53
+ ## Contribution
54
+
55
+ We welcome contributions! Feel free to send us a pull request. Check out our [Contribution Page](https://alirezanet.github.io/Gridify/contribution) for more information.
56
+
57
+ ## License
58
+
59
+ This project is licensed under the [MIT License](https://github.com/alirezanet/gridify/blob/master/LICENSE).
package/dist/index.cjs.js CHANGED
@@ -1 +1 @@
1
- (()=>{"use strict";var t,e,o,r={d:(t,e)=>{for(var o in e)r.o(e,o)&&!r.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},a={};r.r(a),r.d(a,{ConditionalOperator:()=>t,LogicalOperator:()=>e}),function(t){t.Equal="=",t.NotEqual="!=",t.LessThan="<",t.GreaterThan=">",t.GreaterThanOrEqual=">=",t.LessThanOrEqual="<=",t.Contains="*",t.NotContains="!*",t.StartsWith="^",t.NotStartsWith="!^",t.EndsWith="$",t.NotEndsWith="!$"}(t||(t={})),(o=e||(e={})).And=",",o.Or="|",module.exports=a})();
1
+ (()=>{"use strict";var r,e,t={d:(r,e)=>{for(var o in e)t.o(e,o)&&!t.o(r,o)&&Object.defineProperty(r,o,{enumerable:!0,get:e[o]})},o:(r,e)=>Object.prototype.hasOwnProperty.call(r,e),r:r=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})}},o={};t.r(o),t.d(o,{ConditionalOperator:()=>r,GridifyQueryBuilder:()=>i,LogicalOperator:()=>e}),function(r){r.Equal="=",r.NotEqual="!=",r.LessThan="<",r.GreaterThan=">",r.GreaterThanOrEqual=">=",r.LessThanOrEqual="<=",r.Contains="*",r.NotContains="!*",r.StartsWith="^",r.NotStartsWith="!^",r.EndsWith="$",r.NotEndsWith="!$"}(r||(r={})),function(r){r.And=",",r.Or="|"}(e||(e={}));const i=class{constructor(){this.query={page:1,pageSize:20,orderBy:"",filter:""},this.filteringExpressions=[]}setPage(r){return this.query.page=r,this}setPageSize(r){return this.query.pageSize=r,this}addOrderBy(r,e=!1){const t=`${r.trim()} ${e?"desc":""}`.trim();return this.query.orderBy=this.query.orderBy?`${this.query.orderBy}, ${t}`:t,this}addCondition(r,e,t,o=!0,i=!0){let n=t;i&&"string"==typeof t&&(n=t.replace(/([(),|]|\/i)/g,"\\$1")),n=o?n.toString():`${n.toString()}/i`;var s=`${r.trim()}${e}${n}`;return this.filteringExpressions.push({value:s,type:"filter"}),this}startGroup(){return this.filteringExpressions.push({value:"(",type:"startGroup"}),this}endGroup(){return this.filteringExpressions.push({value:")",type:"endGroup"}),this}and(){return this.filteringExpressions.push({value:e.And,type:"op"}),this}or(){return this.filteringExpressions.push({value:e.Or,type:"op"}),this}build(){let r=null,e=0;if(this.filteringExpressions.forEach((t=>{if("startGroup"===t.type&&e++,"endGroup"===t.type&&e--,null===r&&"op"===t.type)throw new Error("expression cannot start with a logical operator");if("filter"===r&&"filter"===t.type)throw new Error("consecutive conditions are not allowed, consider adding a logical operator");if("op"===r&&"op"===t.type)throw new Error("consecutive operators are not allowed, consider adding a filter");if("startGroup"===r&&"op"===t.type)throw new Error("logical operator immediately after startGroup is not allowed");if("endGroup"===r&&"filter"===t.type)throw new Error("Missing logical operator after endGroup");if("startGroup"===r&&"endGroup"===t.type)throw new Error("Empty groups are not allowed");if("endGroup"===r&&"startGroup"===t.type)throw new Error("Missing a logical operator between groups");r=t.type,this.query.filter+=t.value})),0!=e)throw new Error("Group not properly closed");return this.query}};module.exports.GridifyClient=o})();
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export * from './GridifyQueryBuilder';
1
+ export { default as GridifyQueryBuilder } from './GridifyQueryBuilder';
2
+ export type { default as IGridifyQuery } from './IGridifyQuery';
2
3
  export * from './GridifyOperator';
3
- export * from './IGridifyQuery';
package/dist/index.esm.js CHANGED
@@ -1 +1 @@
1
- var t,a,r,o={d:(t,a)=>{for(var r in a)o.o(a,r)&&!o.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:a[r]})},o:(t,a)=>Object.prototype.hasOwnProperty.call(t,a)},e={};o.d(e,{S:()=>t,F:()=>a}),function(t){t.Equal="=",t.NotEqual="!=",t.LessThan="<",t.GreaterThan=">",t.GreaterThanOrEqual=">=",t.LessThanOrEqual="<=",t.Contains="*",t.NotContains="!*",t.StartsWith="^",t.NotStartsWith="!^",t.EndsWith="$",t.NotEndsWith="!$"}(t||(t={})),(r=a||(a={})).And=",",r.Or="|";var n=e.S,s=e.F;export{n as ConditionalOperator,s as LogicalOperator};
1
+ var r,t,e={d:(r,t)=>{for(var o in t)e.o(t,o)&&!e.o(r,o)&&Object.defineProperty(r,o,{enumerable:!0,get:t[o]})},o:(r,t)=>Object.prototype.hasOwnProperty.call(r,t)},o={};e.d(o,{SQ:()=>r,Fw:()=>i,Fn:()=>t}),function(r){r.Equal="=",r.NotEqual="!=",r.LessThan="<",r.GreaterThan=">",r.GreaterThanOrEqual=">=",r.LessThanOrEqual="<=",r.Contains="*",r.NotContains="!*",r.StartsWith="^",r.NotStartsWith="!^",r.EndsWith="$",r.NotEndsWith="!$"}(r||(r={})),function(r){r.And=",",r.Or="|"}(t||(t={}));const i=class{constructor(){this.query={page:1,pageSize:20,orderBy:"",filter:""},this.filteringExpressions=[]}setPage(r){return this.query.page=r,this}setPageSize(r){return this.query.pageSize=r,this}addOrderBy(r,t=!1){const e=`${r.trim()} ${t?"desc":""}`.trim();return this.query.orderBy=this.query.orderBy?`${this.query.orderBy}, ${e}`:e,this}addCondition(r,t,e,o=!0,i=!0){let s=e;i&&"string"==typeof e&&(s=e.replace(/([(),|]|\/i)/g,"\\$1")),s=o?s.toString():`${s.toString()}/i`;var n=`${r.trim()}${t}${s}`;return this.filteringExpressions.push({value:n,type:"filter"}),this}startGroup(){return this.filteringExpressions.push({value:"(",type:"startGroup"}),this}endGroup(){return this.filteringExpressions.push({value:")",type:"endGroup"}),this}and(){return this.filteringExpressions.push({value:t.And,type:"op"}),this}or(){return this.filteringExpressions.push({value:t.Or,type:"op"}),this}build(){let r=null,t=0;if(this.filteringExpressions.forEach((e=>{if("startGroup"===e.type&&t++,"endGroup"===e.type&&t--,null===r&&"op"===e.type)throw new Error("expression cannot start with a logical operator");if("filter"===r&&"filter"===e.type)throw new Error("consecutive conditions are not allowed, consider adding a logical operator");if("op"===r&&"op"===e.type)throw new Error("consecutive operators are not allowed, consider adding a filter");if("startGroup"===r&&"op"===e.type)throw new Error("logical operator immediately after startGroup is not allowed");if("endGroup"===r&&"filter"===e.type)throw new Error("Missing logical operator after endGroup");if("startGroup"===r&&"endGroup"===e.type)throw new Error("Empty groups are not allowed");if("endGroup"===r&&"startGroup"===e.type)throw new Error("Missing a logical operator between groups");r=e.type,this.query.filter+=e.value})),0!=t)throw new Error("Group not properly closed");return this.query}};var s=o.SQ,n=o.Fw,a=o.Fn;export{s as ConditionalOperator,n as GridifyQueryBuilder,a as LogicalOperator};
package/dist/index.umd.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.GridifyQueryBuilder=t():e.GridifyQueryBuilder=t()}(this,(()=>(()=>{"use strict";var e,t,o,r={d:(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},n={};return r.r(n),r.d(n,{ConditionalOperator:()=>e,LogicalOperator:()=>t}),function(e){e.Equal="=",e.NotEqual="!=",e.LessThan="<",e.GreaterThan=">",e.GreaterThanOrEqual=">=",e.LessThanOrEqual="<=",e.Contains="*",e.NotContains="!*",e.StartsWith="^",e.NotStartsWith="!^",e.EndsWith="$",e.NotEndsWith="!$"}(e||(e={})),(o=t||(t={})).And=",",o.Or="|",n})()));
1
+ !function(r,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.GridifyClient=e():r.GridifyClient=e()}(this,(()=>(()=>{"use strict";var r,e,t={d:(r,e)=>{for(var o in e)t.o(e,o)&&!t.o(r,o)&&Object.defineProperty(r,o,{enumerable:!0,get:e[o]})},o:(r,e)=>Object.prototype.hasOwnProperty.call(r,e),r:r=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})}},o={};t.r(o),t.d(o,{ConditionalOperator:()=>r,GridifyQueryBuilder:()=>i,LogicalOperator:()=>e}),function(r){r.Equal="=",r.NotEqual="!=",r.LessThan="<",r.GreaterThan=">",r.GreaterThanOrEqual=">=",r.LessThanOrEqual="<=",r.Contains="*",r.NotContains="!*",r.StartsWith="^",r.NotStartsWith="!^",r.EndsWith="$",r.NotEndsWith="!$"}(r||(r={})),function(r){r.And=",",r.Or="|"}(e||(e={}));const i=class{constructor(){this.query={page:1,pageSize:20,orderBy:"",filter:""},this.filteringExpressions=[]}setPage(r){return this.query.page=r,this}setPageSize(r){return this.query.pageSize=r,this}addOrderBy(r,e=!1){const t=`${r.trim()} ${e?"desc":""}`.trim();return this.query.orderBy=this.query.orderBy?`${this.query.orderBy}, ${t}`:t,this}addCondition(r,e,t,o=!0,i=!0){let n=t;i&&"string"==typeof t&&(n=t.replace(/([(),|]|\/i)/g,"\\$1")),n=o?n.toString():`${n.toString()}/i`;var s=`${r.trim()}${e}${n}`;return this.filteringExpressions.push({value:s,type:"filter"}),this}startGroup(){return this.filteringExpressions.push({value:"(",type:"startGroup"}),this}endGroup(){return this.filteringExpressions.push({value:")",type:"endGroup"}),this}and(){return this.filteringExpressions.push({value:e.And,type:"op"}),this}or(){return this.filteringExpressions.push({value:e.Or,type:"op"}),this}build(){let r=null,e=0;if(this.filteringExpressions.forEach((t=>{if("startGroup"===t.type&&e++,"endGroup"===t.type&&e--,null===r&&"op"===t.type)throw new Error("expression cannot start with a logical operator");if("filter"===r&&"filter"===t.type)throw new Error("consecutive conditions are not allowed, consider adding a logical operator");if("op"===r&&"op"===t.type)throw new Error("consecutive operators are not allowed, consider adding a filter");if("startGroup"===r&&"op"===t.type)throw new Error("logical operator immediately after startGroup is not allowed");if("endGroup"===r&&"filter"===t.type)throw new Error("Missing logical operator after endGroup");if("startGroup"===r&&"endGroup"===t.type)throw new Error("Empty groups are not allowed");if("endGroup"===r&&"startGroup"===t.type)throw new Error("Missing a logical operator between groups");r=t.type,this.query.filter+=t.value})),0!=e)throw new Error("Group not properly closed");return this.query}};return o})()));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gridify-client",
3
- "version": "2.0.0-preview.2",
3
+ "version": "2.0.0-preview.3",
4
4
  "description": "Client JS library for the dotnet Gridify project",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",